diff --git a/assets/index-4y1im5vg.js b/assets/index-C-0VmNX9.js similarity index 94% rename from assets/index-4y1im5vg.js rename to assets/index-C-0VmNX9.js index b275632b..7ccf76d5 100644 --- a/assets/index-4y1im5vg.js +++ b/assets/index-C-0VmNX9.js @@ -1,4 +1,4 @@ -var M0t=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ejo=M0t((bg,ph)=>{function WFe(t,e){for(var n=0;no[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();var Ac=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function NFe(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function o(){return this instanceof o?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(o){var r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:function(){return t[o]}})}),n}var UFe={exports:{}},HK={},jFe={exports:{}},ol={};/** +var M0t=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ejo=M0t((bg,ph)=>{function NFe(t,e){for(var n=0;no[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();var Ac=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function UFe(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function o(){return this instanceof o?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(o){var r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:function(){return t[o]}})}),n}var jFe={exports:{}},MK={},BFe={exports:{}},ol={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var M0t=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ejo=M0t((bg, * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var YL=Symbol.for("react.element"),I0t=Symbol.for("react.portal"),z0t=Symbol.for("react.fragment"),D0t=Symbol.for("react.strict_mode"),E0t=Symbol.for("react.profiler"),F0t=Symbol.for("react.provider"),k0t=Symbol.for("react.context"),L0t=Symbol.for("react.forward_ref"),W0t=Symbol.for("react.suspense"),N0t=Symbol.for("react.memo"),U0t=Symbol.for("react.lazy"),I6e=Symbol.iterator;function j0t(t){return t===null||typeof t!="object"?null:(t=I6e&&t[I6e]||t["@@iterator"],typeof t=="function"?t:null)}var BFe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},YFe=Object.assign,OFe={};function xH(t,e,n){this.props=t,this.context=e,this.refs=OFe,this.updater=n||BFe}xH.prototype.isReactComponent={};xH.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};xH.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function _Fe(){}_Fe.prototype=xH.prototype;function Ape(t,e,n){this.props=t,this.context=e,this.refs=OFe,this.updater=n||BFe}var wpe=Ape.prototype=new _Fe;wpe.constructor=Ape;YFe(wpe,xH.prototype);wpe.isPureReactComponent=!0;var z6e=Array.isArray,VFe=Object.prototype.hasOwnProperty,vpe={current:null},GFe={key:!0,ref:!0,__self:!0,__source:!0};function XFe(t,e,n){var o,r={},i=null,a=null;if(e!=null)for(o in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(i=""+e.key),e)VFe.call(e,o)&&!GFe.hasOwnProperty(o)&&(r[o]=e[o]);var l=arguments.length-2;if(l===1)r.children=n;else if(1()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ejo=M0t((bg, * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var V0t=m,G0t=Symbol.for("react.element"),X0t=Symbol.for("react.fragment"),J0t=Object.prototype.hasOwnProperty,K0t=V0t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,q0t={key:!0,ref:!0,__self:!0,__source:!0};function JFe(t,e,n){var o,r={},i=null,a=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(a=e.ref);for(o in e)J0t.call(e,o)&&!q0t.hasOwnProperty(o)&&(r[o]=e[o]);if(t&&t.defaultProps)for(o in e=t.defaultProps,e)r[o]===void 0&&(r[o]=e[o]);return{$$typeof:G0t,type:t,key:i,ref:a,props:r,_owner:K0t.current}}HK.Fragment=X0t;HK.jsx=JFe;HK.jsxs=JFe;UFe.exports=HK;var h=UFe.exports,KFe={exports:{}},Wg={},qFe={exports:{}},$Fe={};/** + */var V0t=m,G0t=Symbol.for("react.element"),X0t=Symbol.for("react.fragment"),J0t=Object.prototype.hasOwnProperty,K0t=V0t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,q0t={key:!0,ref:!0,__self:!0,__source:!0};function KFe(t,e,n){var o,r={},i=null,a=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(a=e.ref);for(o in e)J0t.call(e,o)&&!q0t.hasOwnProperty(o)&&(r[o]=e[o]);if(t&&t.defaultProps)for(o in e=t.defaultProps,e)r[o]===void 0&&(r[o]=e[o]);return{$$typeof:G0t,type:t,key:i,ref:a,props:r,_owner:K0t.current}}MK.Fragment=X0t;MK.jsx=KFe;MK.jsxs=KFe;jFe.exports=MK;var h=jFe.exports,qFe={exports:{}},Wg={},$Fe={exports:{}},QFe={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var M0t=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ejo=M0t((bg, * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e(F,U){var O=F.length;F.push(U);e:for(;0>>1,_=F[B];if(0>>1;Br(Q,O))le<_&&0>r(q,Q)?(F[B]=q,F[le]=O,B=le):(F[B]=Q,F[$]=O,B=$);else if(le<_&&0>r(q,O))F[B]=q,F[le]=O,B=le;else break e}}return U}function r(F,U){var O=F.sortIndex-U.sortIndex;return O!==0?O:F.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var s=[],c=[],u=1,d=null,f=3,p=!1,g=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,C=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(F){for(var U=n(c);U!==null;){if(U.callback===null)o(c);else if(U.startTime<=F)o(c),U.sortIndex=U.expirationTime,e(s,U);else break;U=n(c)}}function v(F){if(y=!1,P(F),!g)if(n(s)!==null)g=!0,k(T);else{var U=n(c);U!==null&&N(v,U.startTime-F)}}function T(F,U){g=!1,y&&(y=!1,b(S),S=-1),p=!0;var O=f;try{for(P(U),d=n(s);d!==null&&(!(d.expirationTime>U)||F&&!D());){var B=d.callback;if(typeof B=="function"){d.callback=null,f=d.priorityLevel;var _=B(d.expirationTime<=U);U=t.unstable_now(),typeof _=="function"?d.callback=_:d===n(s)&&o(s),P(U)}else o(s);d=n(s)}if(d!==null)var X=!0;else{var $=n(c);$!==null&&N(v,$.startTime-U),X=!1}return X}finally{d=null,f=O,p=!1}}var A=!1,x=null,S=-1,R=5,M=-1;function D(){return!(t.unstable_now()-MF||125B?(F.sortIndex=O,e(c,F),n(s)===null&&F===n(c)&&(y?(b(S),S=-1):y=!0,N(v,O-B))):(F.sortIndex=_,e(s,F),g||p||(g=!0,k(T))),F},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(F){var U=f;return function(){var O=f;f=U;try{return F.apply(this,arguments)}finally{f=O}}}})($Fe);qFe.exports=$Fe;var $0t=qFe.exports;/** + */(function(t){function e(F,U){var O=F.length;F.push(U);e:for(;0>>1,_=F[B];if(0>>1;Br(Q,O))le<_&&0>r(q,Q)?(F[B]=q,F[le]=O,B=le):(F[B]=Q,F[$]=O,B=$);else if(le<_&&0>r(q,O))F[B]=q,F[le]=O,B=le;else break e}}return U}function r(F,U){var O=F.sortIndex-U.sortIndex;return O!==0?O:F.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var s=[],c=[],u=1,d=null,f=3,p=!1,g=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,C=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(F){for(var U=n(c);U!==null;){if(U.callback===null)o(c);else if(U.startTime<=F)o(c),U.sortIndex=U.expirationTime,e(s,U);else break;U=n(c)}}function v(F){if(y=!1,P(F),!g)if(n(s)!==null)g=!0,k(T);else{var U=n(c);U!==null&&N(v,U.startTime-F)}}function T(F,U){g=!1,y&&(y=!1,b(S),S=-1),p=!0;var O=f;try{for(P(U),d=n(s);d!==null&&(!(d.expirationTime>U)||F&&!D());){var B=d.callback;if(typeof B=="function"){d.callback=null,f=d.priorityLevel;var _=B(d.expirationTime<=U);U=t.unstable_now(),typeof _=="function"?d.callback=_:d===n(s)&&o(s),P(U)}else o(s);d=n(s)}if(d!==null)var X=!0;else{var $=n(c);$!==null&&N(v,$.startTime-U),X=!1}return X}finally{d=null,f=O,p=!1}}var A=!1,x=null,S=-1,R=5,M=-1;function D(){return!(t.unstable_now()-MF||125B?(F.sortIndex=O,e(c,F),n(s)===null&&F===n(c)&&(y?(b(S),S=-1):y=!0,N(v,O-B))):(F.sortIndex=_,e(s,F),g||p||(g=!0,k(T))),F},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(F){var U=f;return function(){var O=f;f=U;try{return F.apply(this,arguments)}finally{f=O}}}})(QFe);$Fe.exports=QFe;var $0t=$Fe.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var M0t=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ejo=M0t((bg, * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var QFe=m,Mg=$0t;function Xo(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ule=Object.prototype.hasOwnProperty,Q0t=/^[: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]*$/,E6e={},F6e={};function Z0t(t){return Ule.call(F6e,t)?!0:Ule.call(E6e,t)?!1:Q0t.test(t)?F6e[t]=!0:(E6e[t]=!0,!1)}function eut(t,e,n,o){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return o?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function tut(t,e,n,o){if(e===null||typeof e>"u"||eut(t,e,n,o))return!0;if(o)return!1;if(n!==null)switch(n.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 hp(t,e,n,o,r,i,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=o,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=a}var xf={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){xf[t]=new hp(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];xf[e]=new hp(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){xf[t]=new hp(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){xf[t]=new hp(t,2,!1,t,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(t){xf[t]=new hp(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){xf[t]=new hp(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){xf[t]=new hp(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){xf[t]=new hp(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){xf[t]=new hp(t,5,!1,t.toLowerCase(),null,!1,!1)});var bpe=/[\-:]([a-z])/g;function Spe(t){return t[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(t){var e=t.replace(bpe,Spe);xf[e]=new hp(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(bpe,Spe);xf[e]=new hp(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(bpe,Spe);xf[e]=new hp(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){xf[t]=new hp(t,1,!1,t.toLowerCase(),null,!1,!1)});xf.xlinkHref=new hp("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){xf[t]=new hp(t,1,!1,t.toLowerCase(),null,!0,!0)});function Tpe(t,e,n,o){var r=xf.hasOwnProperty(e)?xf[e]:null;(r!==null?r.type!==0:o||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ule=Object.prototype.hasOwnProperty,Q0t=/^[: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]*$/,F6e={},k6e={};function Z0t(t){return Ule.call(k6e,t)?!0:Ule.call(F6e,t)?!1:Q0t.test(t)?k6e[t]=!0:(F6e[t]=!0,!1)}function eut(t,e,n,o){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return o?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function tut(t,e,n,o){if(e===null||typeof e>"u"||eut(t,e,n,o))return!0;if(o)return!1;if(n!==null)switch(n.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 hp(t,e,n,o,r,i,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=o,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=a}var xf={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){xf[t]=new hp(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];xf[e]=new hp(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){xf[t]=new hp(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){xf[t]=new hp(t,2,!1,t,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(t){xf[t]=new hp(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){xf[t]=new hp(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){xf[t]=new hp(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){xf[t]=new hp(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){xf[t]=new hp(t,5,!1,t.toLowerCase(),null,!1,!1)});var bpe=/[\-:]([a-z])/g;function Spe(t){return t[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(t){var e=t.replace(bpe,Spe);xf[e]=new hp(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(bpe,Spe);xf[e]=new hp(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(bpe,Spe);xf[e]=new hp(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){xf[t]=new hp(t,1,!1,t.toLowerCase(),null,!1,!1)});xf.xlinkHref=new hp("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){xf[t]=new hp(t,1,!1,t.toLowerCase(),null,!0,!0)});function Tpe(t,e,n,o){var r=xf.hasOwnProperty(e)?xf[e]:null;(r!==null?r.type!==0:o||!(2l||r[a]!==i[l]){var s=` -`+r[a].replace(" at new "," at ");return t.displayName&&s.includes("")&&(s=s.replace("",t.displayName)),s}while(1<=a&&0<=l);break}}}finally{Une=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?wD(t):""}function nut(t){switch(t.tag){case 5:return wD(t.type);case 16:return wD("Lazy");case 13:return wD("Suspense");case 19:return wD("SuspenseList");case 0:case 2:case 15:return t=jne(t.type,!1),t;case 11:return t=jne(t.type.render,!1),t;case 1:return t=jne(t.type,!0),t;default:return""}}function Ole(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case DP:return"Fragment";case zP:return"Portal";case jle:return"Profiler";case Ppe:return"StrictMode";case Ble:return"Suspense";case Yle:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case tke:return(t.displayName||"Context")+".Consumer";case eke:return(t._context.displayName||"Context")+".Provider";case Cpe:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Rpe:return e=t.displayName||null,e!==null?e:Ole(t.type)||"Memo";case O4:e=t._payload,t=t._init;try{return Ole(t(e))}catch{}}return null}function out(t){var e=t.type;switch(t.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 t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ole(e);case 8:return e===Ppe?"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 K8(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function oke(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function rut(t){var e=oke(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),o=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(a){o=""+a,i.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return o},setValue:function(a){o=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Gj(t){t._valueTracker||(t._valueTracker=rut(t))}function rke(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),o="";return t&&(o=oke(t)?t.checked?"true":"false":t.value),t=o,t!==n?(e.setValue(t),!0):!1}function wV(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function _le(t,e){var n=e.checked;return a0({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function L6e(t,e){var n=e.defaultValue==null?"":e.defaultValue,o=e.checked!=null?e.checked:e.defaultChecked;n=K8(e.value!=null?e.value:n),t._wrapperState={initialChecked:o,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function ike(t,e){e=e.checked,e!=null&&Tpe(t,"checked",e,!1)}function Vle(t,e){ike(t,e);var n=K8(e.value),o=e.type;if(n!=null)o==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(o==="submit"||o==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Gle(t,e.type,n):e.hasOwnProperty("defaultValue")&&Gle(t,e.type,K8(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function W6e(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var o=e.type;if(!(o!=="submit"&&o!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Gle(t,e,n){(e!=="number"||wV(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var vD=Array.isArray;function mC(t,e,n,o){if(t=t.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=Xj.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function nF(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ZD={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},iut=["Webkit","ms","Moz","O"];Object.keys(ZD).forEach(function(t){iut.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ZD[e]=ZD[t]})});function cke(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ZD.hasOwnProperty(t)&&ZD[t]?(""+e).trim():e+"px"}function uke(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var o=n.indexOf("--")===0,r=cke(n,e[n],o);n==="float"&&(n="cssFloat"),o?t.setProperty(n,r):t[n]=r}}var aut=a0({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 Kle(t,e){if(e){if(aut[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Xo(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Xo(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Xo(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Xo(62))}}function qle(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 $le=null;function Hpe(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Qle=null,yC=null,AC=null;function j6e(t){if(t=VL(t)){if(typeof Qle!="function")throw Error(Xo(280));var e=t.stateNode;e&&(e=FK(e),Qle(t.stateNode,t.type,e))}}function dke(t){yC?AC?AC.push(t):AC=[t]:yC=t}function fke(){if(yC){var t=yC,e=AC;if(AC=yC=null,j6e(t),e)for(t=0;t>>=0,t===0?32:31-(yut(t)/Aut|0)|0}var Jj=64,Kj=4194304;function xD(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function SV(t,e){var n=t.pendingLanes;if(n===0)return 0;var o=0,r=t.suspendedLanes,i=t.pingedLanes,a=n&268435455;if(a!==0){var l=a&~r;l!==0?o=xD(l):(i&=a,i!==0&&(o=xD(i)))}else a=n&~r,a!==0?o=xD(a):i!==0&&(o=xD(i));if(o===0)return 0;if(e!==0&&e!==o&&!(e&r)&&(r=o&-o,i=e&-e,r>=i||r===16&&(i&4194240)!==0))return e;if(o&4&&(o|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=o;0n;n++)e.push(t);return e}function OL(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-I2(e),t[e]=n}function but(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var o=t.eventTimes;for(t=t.expirationTimes;0=tE),K6e=" ",q6e=!1;function Dke(t,e){switch(t){case"keyup":return qut.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eke(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var EP=!1;function Qut(t,e){switch(t){case"compositionend":return Eke(e);case"keypress":return e.which!==32?null:(q6e=!0,K6e);case"textInput":return t=e.data,t===K6e&&q6e?null:t;default:return null}}function Zut(t,e){if(EP)return t==="compositionend"||!Lpe&&Dke(t,e)?(t=Ike(),g_=Epe=u8=null,EP=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=o}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=eAe(n)}}function Wke(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Wke(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Nke(){for(var t=window,e=wV();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=wV(t.document)}return e}function Wpe(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function sdt(t){var e=Nke(),n=t.focusedElem,o=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Wke(n.ownerDocument.documentElement,n)){if(o!==null&&Wpe(n)){if(e=o.start,t=o.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var r=n.textContent.length,i=Math.min(o.start,r);o=o.end===void 0?i:Math.min(o.end,r),!t.extend&&i>o&&(r=o,o=i,i=r),r=tAe(n,i);var a=tAe(n,o);r&&a&&(t.rangeCount!==1||t.anchorNode!==r.node||t.anchorOffset!==r.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),t.removeAllRanges(),i>o?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,FP=null,rse=null,oE=null,ise=!1;function nAe(t,e,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ise||FP==null||FP!==wV(o)||(o=FP,"selectionStart"in o&&Wpe(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),oE&&sF(oE,o)||(oE=o,o=CV(rse,"onSelect"),0WP||(t.current=dse[WP],dse[WP]=null,WP--)}function Js(t,e){WP++,dse[WP]=t.current,t.current=e}var q8={},yh=Tw(q8),Kp=Tw(!1),kx=q8;function XC(t,e){var n=t.type.contextTypes;if(!n)return q8;var o=t.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===e)return o.__reactInternalMemoizedMaskedChildContext;var r={},i;for(i in n)r[i]=e[i];return o&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=r),r}function qp(t){return t=t.childContextTypes,t!=null}function HV(){vc(Kp),vc(yh)}function cAe(t,e,n){if(yh.current!==q8)throw Error(Xo(168));Js(yh,e),Js(Kp,n)}function Xke(t,e,n){var o=t.stateNode;if(e=e.childContextTypes,typeof o.getChildContext!="function")return n;o=o.getChildContext();for(var r in o)if(!(r in e))throw Error(Xo(108,out(t)||"Unknown",r));return a0({},n,o)}function MV(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||q8,kx=yh.current,Js(yh,t),Js(Kp,Kp.current),!0}function uAe(t,e,n){var o=t.stateNode;if(!o)throw Error(Xo(169));n?(t=Xke(t,e,kx),o.__reactInternalMemoizedMergedChildContext=t,vc(Kp),vc(yh),Js(yh,t)):vc(Kp),Js(Kp,n)}var g6=null,kK=!1,eoe=!1;function Jke(t){g6===null?g6=[t]:g6.push(t)}function vdt(t){kK=!0,Jke(t)}function Pw(){if(!eoe&&g6!==null){eoe=!0;var t=0,e=fs;try{var n=g6;for(fs=1;t>=a,r-=a,v6=1<<32-I2(e)+r|n<S?(R=x,x=null):R=x.sibling;var M=f(b,x,P[S],v);if(M===null){x===null&&(x=R);break}t&&x&&M.alternate===null&&e(b,x),C=i(M,C,S),A===null?T=M:A.sibling=M,A=M,x=R}if(S===P.length)return n(b,x),Uc&&rv(b,S),T;if(x===null){for(;SS?(R=x,x=null):R=x.sibling;var D=f(b,x,M.value,v);if(D===null){x===null&&(x=R);break}t&&x&&D.alternate===null&&e(b,x),C=i(D,C,S),A===null?T=D:A.sibling=D,A=D,x=R}if(M.done)return n(b,x),Uc&&rv(b,S),T;if(x===null){for(;!M.done;S++,M=P.next())M=d(b,M.value,v),M!==null&&(C=i(M,C,S),A===null?T=M:A.sibling=M,A=M);return Uc&&rv(b,S),T}for(x=o(b,x);!M.done;S++,M=P.next())M=p(x,b,S,M.value,v),M!==null&&(t&&M.alternate!==null&&x.delete(M.key===null?S:M.key),C=i(M,C,S),A===null?T=M:A.sibling=M,A=M);return t&&x.forEach(function(E){return e(b,E)}),Uc&&rv(b,S),T}function w(b,C,P,v){if(typeof P=="object"&&P!==null&&P.type===DP&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case Vj:e:{for(var T=P.key,A=C;A!==null;){if(A.key===T){if(T=P.type,T===DP){if(A.tag===7){n(b,A.sibling),C=r(A,P.props.children),C.return=b,b=C;break e}}else if(A.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===O4&&yAe(T)===A.type){n(b,A.sibling),C=r(A,P.props),C.ref=cz(b,A,P),C.return=b,b=C;break e}n(b,A);break}else e(b,A);A=A.sibling}P.type===DP?(C=rx(P.props.children,b.mode,v,P.key),C.return=b,b=C):(v=S_(P.type,P.key,P.props,null,b.mode,v),v.ref=cz(b,C,P),v.return=b,b=v)}return a(b);case zP:e:{for(A=P.key;C!==null;){if(C.key===A)if(C.tag===4&&C.stateNode.containerInfo===P.containerInfo&&C.stateNode.implementation===P.implementation){n(b,C.sibling),C=r(C,P.children||[]),C.return=b,b=C;break e}else{n(b,C);break}else e(b,C);C=C.sibling}C=soe(P,b.mode,v),C.return=b,b=C}return a(b);case O4:return A=P._init,w(b,C,A(P._payload),v)}if(vD(P))return g(b,C,P,v);if(rz(P))return y(b,C,P,v);nB(b,P)}return typeof P=="string"&&P!==""||typeof P=="number"?(P=""+P,C!==null&&C.tag===6?(n(b,C.sibling),C=r(C,P),C.return=b,b=C):(n(b,C),C=loe(P,b.mode,v),C.return=b,b=C),a(b)):n(b,C)}return w}var KC=nLe(!0),oLe=nLe(!1),GL={},b9=Tw(GL),fF=Tw(GL),hF=Tw(GL);function Hv(t){if(t===GL)throw Error(Xo(174));return t}function Gpe(t,e){switch(Js(hF,e),Js(fF,t),Js(b9,GL),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Jle(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Jle(e,t)}vc(b9),Js(b9,e)}function qC(){vc(b9),vc(fF),vc(hF)}function rLe(t){Hv(hF.current);var e=Hv(b9.current),n=Jle(e,t.type);e!==n&&(Js(fF,t),Js(b9,n))}function Xpe(t){fF.current===t&&(vc(b9),vc(fF))}var e0=Tw(0);function kV(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var toe=[];function Jpe(){for(var t=0;tn?n:4,t(!0);var o=noe.transition;noe.transition={};try{t(!1),e()}finally{fs=n,noe.transition=o}}function vLe(){return Km().memoizedState}function Tdt(t,e,n){var o=k8(t);if(n={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null},xLe(t))bLe(e,n);else if(n=Qke(t,e,n,o),n!==null){var r=cp();z2(n,t,o,r),SLe(n,e,o)}}function Pdt(t,e,n){var o=k8(t),r={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null};if(xLe(t))bLe(e,r);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var a=e.lastRenderedState,l=i(a,n);if(r.hasEagerState=!0,r.eagerState=l,O2(l,a)){var s=e.interleaved;s===null?(r.next=r,_pe(e)):(r.next=s.next,s.next=r),e.interleaved=r;return}}catch{}finally{}n=Qke(t,e,r,o),n!==null&&(r=cp(),z2(n,t,o,r),SLe(n,e,o))}}function xLe(t){var e=t.alternate;return t===r0||e!==null&&e===r0}function bLe(t,e){rE=LV=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function SLe(t,e,n){if(n&4194240){var o=e.lanes;o&=t.pendingLanes,n|=o,e.lanes=n,Ipe(t,n)}}var WV={readContext:Jm,useCallback:jf,useContext:jf,useEffect:jf,useImperativeHandle:jf,useInsertionEffect:jf,useLayoutEffect:jf,useMemo:jf,useReducer:jf,useRef:jf,useState:jf,useDebugValue:jf,useDeferredValue:jf,useTransition:jf,useMutableSource:jf,useSyncExternalStore:jf,useId:jf,unstable_isNewReconciler:!1},Cdt={readContext:Jm,useCallback:function(t,e){return Q5().memoizedState=[t,e===void 0?null:e],t},useContext:Jm,useEffect:wAe,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,w_(4194308,4,gLe.bind(null,e,t),n)},useLayoutEffect:function(t,e){return w_(4194308,4,t,e)},useInsertionEffect:function(t,e){return w_(4,2,t,e)},useMemo:function(t,e){var n=Q5();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var o=Q5();return e=n!==void 0?n(e):e,o.memoizedState=o.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},o.queue=t,t=t.dispatch=Tdt.bind(null,r0,t),[o.memoizedState,t]},useRef:function(t){var e=Q5();return t={current:t},e.memoizedState=t},useState:AAe,useDebugValue:Zpe,useDeferredValue:function(t){return Q5().memoizedState=t},useTransition:function(){var t=AAe(!1),e=t[0];return t=Sdt.bind(null,t[1]),Q5().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var o=r0,r=Q5();if(Uc){if(n===void 0)throw Error(Xo(407));n=n()}else{if(n=e(),Sd===null)throw Error(Xo(349));Wx&30||lLe(o,e,n)}r.memoizedState=n;var i={value:n,getSnapshot:e};return r.queue=i,wAe(cLe.bind(null,o,i,t),[t]),o.flags|=2048,mF(9,sLe.bind(null,o,i,n,e),void 0,null),n},useId:function(){var t=Q5(),e=Sd.identifierPrefix;if(Uc){var n=x6,o=v6;n=(o&~(1<<32-I2(o)-1)).toString(32)+n,e=":"+e+"R"+n,n=pF++,0")&&(s=s.replace("",t.displayName)),s}while(1<=a&&0<=l);break}}}finally{Une=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?wD(t):""}function nut(t){switch(t.tag){case 5:return wD(t.type);case 16:return wD("Lazy");case 13:return wD("Suspense");case 19:return wD("SuspenseList");case 0:case 2:case 15:return t=jne(t.type,!1),t;case 11:return t=jne(t.type.render,!1),t;case 1:return t=jne(t.type,!0),t;default:return""}}function Ole(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case DP:return"Fragment";case zP:return"Portal";case jle:return"Profiler";case Ppe:return"StrictMode";case Ble:return"Suspense";case Yle:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case nke:return(t.displayName||"Context")+".Consumer";case tke:return(t._context.displayName||"Context")+".Provider";case Cpe:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Rpe:return e=t.displayName||null,e!==null?e:Ole(t.type)||"Memo";case O4:e=t._payload,t=t._init;try{return Ole(t(e))}catch{}}return null}function out(t){var e=t.type;switch(t.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 t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ole(e);case 8:return e===Ppe?"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 K8(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function rke(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function rut(t){var e=rke(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),o=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(a){o=""+a,i.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return o},setValue:function(a){o=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Xj(t){t._valueTracker||(t._valueTracker=rut(t))}function ike(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),o="";return t&&(o=rke(t)?t.checked?"true":"false":t.value),t=o,t!==n?(e.setValue(t),!0):!1}function vV(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function _le(t,e){var n=e.checked;return a0({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function W6e(t,e){var n=e.defaultValue==null?"":e.defaultValue,o=e.checked!=null?e.checked:e.defaultChecked;n=K8(e.value!=null?e.value:n),t._wrapperState={initialChecked:o,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function ake(t,e){e=e.checked,e!=null&&Tpe(t,"checked",e,!1)}function Vle(t,e){ake(t,e);var n=K8(e.value),o=e.type;if(n!=null)o==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(o==="submit"||o==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Gle(t,e.type,n):e.hasOwnProperty("defaultValue")&&Gle(t,e.type,K8(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function N6e(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var o=e.type;if(!(o!=="submit"&&o!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Gle(t,e,n){(e!=="number"||vV(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var vD=Array.isArray;function mC(t,e,n,o){if(t=t.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=Jj.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function nF(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ZD={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},iut=["Webkit","ms","Moz","O"];Object.keys(ZD).forEach(function(t){iut.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ZD[e]=ZD[t]})});function uke(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ZD.hasOwnProperty(t)&&ZD[t]?(""+e).trim():e+"px"}function dke(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var o=n.indexOf("--")===0,r=uke(n,e[n],o);n==="float"&&(n="cssFloat"),o?t.setProperty(n,r):t[n]=r}}var aut=a0({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 Kle(t,e){if(e){if(aut[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Xo(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Xo(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Xo(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Xo(62))}}function qle(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 $le=null;function Hpe(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Qle=null,yC=null,AC=null;function B6e(t){if(t=VL(t)){if(typeof Qle!="function")throw Error(Xo(280));var e=t.stateNode;e&&(e=kK(e),Qle(t.stateNode,t.type,e))}}function fke(t){yC?AC?AC.push(t):AC=[t]:yC=t}function hke(){if(yC){var t=yC,e=AC;if(AC=yC=null,B6e(t),e)for(t=0;t>>=0,t===0?32:31-(yut(t)/Aut|0)|0}var Kj=64,qj=4194304;function xD(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function TV(t,e){var n=t.pendingLanes;if(n===0)return 0;var o=0,r=t.suspendedLanes,i=t.pingedLanes,a=n&268435455;if(a!==0){var l=a&~r;l!==0?o=xD(l):(i&=a,i!==0&&(o=xD(i)))}else a=n&~r,a!==0?o=xD(a):i!==0&&(o=xD(i));if(o===0)return 0;if(e!==0&&e!==o&&!(e&r)&&(r=o&-o,i=e&-e,r>=i||r===16&&(i&4194240)!==0))return e;if(o&4&&(o|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=o;0n;n++)e.push(t);return e}function OL(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-I2(e),t[e]=n}function but(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var o=t.eventTimes;for(t=t.expirationTimes;0=tE),q6e=" ",$6e=!1;function Eke(t,e){switch(t){case"keyup":return qut.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fke(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var EP=!1;function Qut(t,e){switch(t){case"compositionend":return Fke(e);case"keypress":return e.which!==32?null:($6e=!0,q6e);case"textInput":return t=e.data,t===q6e&&$6e?null:t;default:return null}}function Zut(t,e){if(EP)return t==="compositionend"||!Lpe&&Eke(t,e)?(t=zke(),m_=Epe=u8=null,EP=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=o}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=tAe(n)}}function Nke(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Nke(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Uke(){for(var t=window,e=vV();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=vV(t.document)}return e}function Wpe(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function sdt(t){var e=Uke(),n=t.focusedElem,o=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Nke(n.ownerDocument.documentElement,n)){if(o!==null&&Wpe(n)){if(e=o.start,t=o.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var r=n.textContent.length,i=Math.min(o.start,r);o=o.end===void 0?i:Math.min(o.end,r),!t.extend&&i>o&&(r=o,o=i,i=r),r=nAe(n,i);var a=nAe(n,o);r&&a&&(t.rangeCount!==1||t.anchorNode!==r.node||t.anchorOffset!==r.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),t.removeAllRanges(),i>o?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,FP=null,rse=null,oE=null,ise=!1;function oAe(t,e,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ise||FP==null||FP!==vV(o)||(o=FP,"selectionStart"in o&&Wpe(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),oE&&sF(oE,o)||(oE=o,o=RV(rse,"onSelect"),0WP||(t.current=dse[WP],dse[WP]=null,WP--)}function Js(t,e){WP++,dse[WP]=t.current,t.current=e}var q8={},yh=Tw(q8),Kp=Tw(!1),kx=q8;function XC(t,e){var n=t.type.contextTypes;if(!n)return q8;var o=t.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===e)return o.__reactInternalMemoizedMaskedChildContext;var r={},i;for(i in n)r[i]=e[i];return o&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=r),r}function qp(t){return t=t.childContextTypes,t!=null}function MV(){vc(Kp),vc(yh)}function uAe(t,e,n){if(yh.current!==q8)throw Error(Xo(168));Js(yh,e),Js(Kp,n)}function Jke(t,e,n){var o=t.stateNode;if(e=e.childContextTypes,typeof o.getChildContext!="function")return n;o=o.getChildContext();for(var r in o)if(!(r in e))throw Error(Xo(108,out(t)||"Unknown",r));return a0({},n,o)}function IV(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||q8,kx=yh.current,Js(yh,t),Js(Kp,Kp.current),!0}function dAe(t,e,n){var o=t.stateNode;if(!o)throw Error(Xo(169));n?(t=Jke(t,e,kx),o.__reactInternalMemoizedMergedChildContext=t,vc(Kp),vc(yh),Js(yh,t)):vc(Kp),Js(Kp,n)}var g6=null,LK=!1,eoe=!1;function Kke(t){g6===null?g6=[t]:g6.push(t)}function vdt(t){LK=!0,Kke(t)}function Pw(){if(!eoe&&g6!==null){eoe=!0;var t=0,e=fs;try{var n=g6;for(fs=1;t>=a,r-=a,v6=1<<32-I2(e)+r|n<S?(R=x,x=null):R=x.sibling;var M=f(b,x,P[S],v);if(M===null){x===null&&(x=R);break}t&&x&&M.alternate===null&&e(b,x),C=i(M,C,S),A===null?T=M:A.sibling=M,A=M,x=R}if(S===P.length)return n(b,x),Uc&&rv(b,S),T;if(x===null){for(;SS?(R=x,x=null):R=x.sibling;var D=f(b,x,M.value,v);if(D===null){x===null&&(x=R);break}t&&x&&D.alternate===null&&e(b,x),C=i(D,C,S),A===null?T=D:A.sibling=D,A=D,x=R}if(M.done)return n(b,x),Uc&&rv(b,S),T;if(x===null){for(;!M.done;S++,M=P.next())M=d(b,M.value,v),M!==null&&(C=i(M,C,S),A===null?T=M:A.sibling=M,A=M);return Uc&&rv(b,S),T}for(x=o(b,x);!M.done;S++,M=P.next())M=p(x,b,S,M.value,v),M!==null&&(t&&M.alternate!==null&&x.delete(M.key===null?S:M.key),C=i(M,C,S),A===null?T=M:A.sibling=M,A=M);return t&&x.forEach(function(E){return e(b,E)}),Uc&&rv(b,S),T}function w(b,C,P,v){if(typeof P=="object"&&P!==null&&P.type===DP&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case Gj:e:{for(var T=P.key,A=C;A!==null;){if(A.key===T){if(T=P.type,T===DP){if(A.tag===7){n(b,A.sibling),C=r(A,P.props.children),C.return=b,b=C;break e}}else if(A.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===O4&&AAe(T)===A.type){n(b,A.sibling),C=r(A,P.props),C.ref=cz(b,A,P),C.return=b,b=C;break e}n(b,A);break}else e(b,A);A=A.sibling}P.type===DP?(C=rx(P.props.children,b.mode,v,P.key),C.return=b,b=C):(v=T_(P.type,P.key,P.props,null,b.mode,v),v.ref=cz(b,C,P),v.return=b,b=v)}return a(b);case zP:e:{for(A=P.key;C!==null;){if(C.key===A)if(C.tag===4&&C.stateNode.containerInfo===P.containerInfo&&C.stateNode.implementation===P.implementation){n(b,C.sibling),C=r(C,P.children||[]),C.return=b,b=C;break e}else{n(b,C);break}else e(b,C);C=C.sibling}C=soe(P,b.mode,v),C.return=b,b=C}return a(b);case O4:return A=P._init,w(b,C,A(P._payload),v)}if(vD(P))return g(b,C,P,v);if(rz(P))return y(b,C,P,v);oB(b,P)}return typeof P=="string"&&P!==""||typeof P=="number"?(P=""+P,C!==null&&C.tag===6?(n(b,C.sibling),C=r(C,P),C.return=b,b=C):(n(b,C),C=loe(P,b.mode,v),C.return=b,b=C),a(b)):n(b,C)}return w}var KC=oLe(!0),rLe=oLe(!1),GL={},b9=Tw(GL),fF=Tw(GL),hF=Tw(GL);function Hv(t){if(t===GL)throw Error(Xo(174));return t}function Gpe(t,e){switch(Js(hF,e),Js(fF,t),Js(b9,GL),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Jle(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Jle(e,t)}vc(b9),Js(b9,e)}function qC(){vc(b9),vc(fF),vc(hF)}function iLe(t){Hv(hF.current);var e=Hv(b9.current),n=Jle(e,t.type);e!==n&&(Js(fF,t),Js(b9,n))}function Xpe(t){fF.current===t&&(vc(b9),vc(fF))}var e0=Tw(0);function LV(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var toe=[];function Jpe(){for(var t=0;tn?n:4,t(!0);var o=noe.transition;noe.transition={};try{t(!1),e()}finally{fs=n,noe.transition=o}}function xLe(){return Km().memoizedState}function Tdt(t,e,n){var o=k8(t);if(n={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null},bLe(t))SLe(e,n);else if(n=Zke(t,e,n,o),n!==null){var r=cp();z2(n,t,o,r),TLe(n,e,o)}}function Pdt(t,e,n){var o=k8(t),r={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null};if(bLe(t))SLe(e,r);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var a=e.lastRenderedState,l=i(a,n);if(r.hasEagerState=!0,r.eagerState=l,O2(l,a)){var s=e.interleaved;s===null?(r.next=r,_pe(e)):(r.next=s.next,s.next=r),e.interleaved=r;return}}catch{}finally{}n=Zke(t,e,r,o),n!==null&&(r=cp(),z2(n,t,o,r),TLe(n,e,o))}}function bLe(t){var e=t.alternate;return t===r0||e!==null&&e===r0}function SLe(t,e){rE=WV=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function TLe(t,e,n){if(n&4194240){var o=e.lanes;o&=t.pendingLanes,n|=o,e.lanes=n,Ipe(t,n)}}var NV={readContext:Jm,useCallback:jf,useContext:jf,useEffect:jf,useImperativeHandle:jf,useInsertionEffect:jf,useLayoutEffect:jf,useMemo:jf,useReducer:jf,useRef:jf,useState:jf,useDebugValue:jf,useDeferredValue:jf,useTransition:jf,useMutableSource:jf,useSyncExternalStore:jf,useId:jf,unstable_isNewReconciler:!1},Cdt={readContext:Jm,useCallback:function(t,e){return Q5().memoizedState=[t,e===void 0?null:e],t},useContext:Jm,useEffect:vAe,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,v_(4194308,4,mLe.bind(null,e,t),n)},useLayoutEffect:function(t,e){return v_(4194308,4,t,e)},useInsertionEffect:function(t,e){return v_(4,2,t,e)},useMemo:function(t,e){var n=Q5();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var o=Q5();return e=n!==void 0?n(e):e,o.memoizedState=o.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},o.queue=t,t=t.dispatch=Tdt.bind(null,r0,t),[o.memoizedState,t]},useRef:function(t){var e=Q5();return t={current:t},e.memoizedState=t},useState:wAe,useDebugValue:Zpe,useDeferredValue:function(t){return Q5().memoizedState=t},useTransition:function(){var t=wAe(!1),e=t[0];return t=Sdt.bind(null,t[1]),Q5().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var o=r0,r=Q5();if(Uc){if(n===void 0)throw Error(Xo(407));n=n()}else{if(n=e(),Sd===null)throw Error(Xo(349));Wx&30||sLe(o,e,n)}r.memoizedState=n;var i={value:n,getSnapshot:e};return r.queue=i,vAe(uLe.bind(null,o,i,t),[t]),o.flags|=2048,mF(9,cLe.bind(null,o,i,n,e),void 0,null),n},useId:function(){var t=Q5(),e=Sd.identifierPrefix;if(Uc){var n=x6,o=v6;n=(o&~(1<<32-I2(o)-1)).toString(32)+n,e=":"+e+"R"+n,n=pF++,0<\/script>",t=t.removeChild(t.firstChild)):typeof o.is=="string"?t=a.createElement(n,{is:o.is}):(t=a.createElement(n),n==="select"&&(a=t,o.multiple?a.multiple=!0:o.size&&(a.size=o.size))):t=a.createElementNS(t,n),t[u9]=e,t[dF]=o,DLe(t,e,!1,!1),e.stateNode=t;e:{switch(a=qle(n,o),n){case"dialog":ac("cancel",t),ac("close",t),r=o;break;case"iframe":case"object":case"embed":ac("load",t),r=o;break;case"video":case"audio":for(r=0;rQC&&(e.flags|=128,o=!0,uz(i,!1),e.lanes=4194304)}else{if(!o)if(t=kV(a),t!==null){if(e.flags|=128,o=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),uz(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Uc)return Bf(e),null}else 2*W0()-i.renderingStartTime>QC&&n!==1073741824&&(e.flags|=128,o=!0,uz(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(n=i.last,n!==null?n.sibling=a:e.child=a,i.last=a)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=W0(),e.sibling=null,n=e0.current,Js(e0,o?n&1|2:n&1),e):(Bf(e),null);case 22:case 23:return i1e(),o=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==o&&(e.flags|=8192),o&&e.mode&1?eg&1073741824&&(Bf(e),e.subtreeFlags&6&&(e.flags|=8192)):Bf(e),null;case 24:return null;case 25:return null}throw Error(Xo(156,e.tag))}function Fdt(t,e){switch(Upe(e),e.tag){case 1:return qp(e.type)&&HV(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return qC(),vc(Kp),vc(yh),Jpe(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Xpe(e),null;case 13:if(vc(e0),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Xo(340));JC()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return vc(e0),null;case 4:return qC(),null;case 10:return Ope(e.type._context),null;case 22:case 23:return i1e(),null;case 24:return null;default:return null}}var rB=!1,ih=!1,kdt=typeof WeakSet=="function"?WeakSet:Set,jr=null;function BP(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(o){d0(t,e,o)}else n.current=null}function Sse(t,e,n){try{n()}catch(o){d0(t,e,o)}}var HAe=!1;function Ldt(t,e){if(ase=TV,t=Nke(),Wpe(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var o=n.getSelection&&n.getSelection();if(o&&o.rangeCount!==0){n=o.anchorNode;var r=o.anchorOffset,i=o.focusNode;o=o.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,l=-1,s=-1,c=0,u=0,d=t,f=null;t:for(;;){for(var p;d!==n||r!==0&&d.nodeType!==3||(l=a+r),d!==i||o!==0&&d.nodeType!==3||(s=a+o),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===n&&++c===r&&(l=a),f===i&&++u===o&&(s=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=l===-1||s===-1?null:{start:l,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(lse={focusedElem:t,selectionRange:n},TV=!1,jr=e;jr!==null;)if(e=jr,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,jr=t;else for(;jr!==null;){e=jr;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,w=g.memoizedState,b=e.stateNode,C=b.getSnapshotBeforeUpdate(e.elementType===e.type?y:a2(e.type,y),w);b.__reactInternalSnapshotBeforeUpdate=C}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(Xo(163))}}catch(v){d0(e,e.return,v)}if(t=e.sibling,t!==null){t.return=e.return,jr=t;break}jr=e.return}return g=HAe,HAe=!1,g}function iE(t,e,n){var o=e.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var r=o=o.next;do{if((r.tag&t)===t){var i=r.destroy;r.destroy=void 0,i!==void 0&&Sse(e,n,i)}r=r.next}while(r!==o)}}function NK(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var o=n.create;n.destroy=o()}n=n.next}while(n!==e)}}function Tse(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function kLe(t){var e=t.alternate;e!==null&&(t.alternate=null,kLe(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[u9],delete e[dF],delete e[use],delete e[Adt],delete e[wdt])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function LLe(t){return t.tag===5||t.tag===3||t.tag===4}function MAe(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||LLe(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Pse(t,e,n){var o=t.tag;if(o===5||o===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=RV));else if(o!==4&&(t=t.child,t!==null))for(Pse(t,e,n),t=t.sibling;t!==null;)Pse(t,e,n),t=t.sibling}function Cse(t,e,n){var o=t.tag;if(o===5||o===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(o!==4&&(t=t.child,t!==null))for(Cse(t,e,n),t=t.sibling;t!==null;)Cse(t,e,n),t=t.sibling}var rf=null,c2=!1;function g4(t,e,n){for(n=n.child;n!==null;)WLe(t,e,n),n=n.sibling}function WLe(t,e,n){if(x9&&typeof x9.onCommitFiberUnmount=="function")try{x9.onCommitFiberUnmount(IK,n)}catch{}switch(n.tag){case 5:ih||BP(n,e);case 6:var o=rf,r=c2;rf=null,g4(t,e,n),rf=o,c2=r,rf!==null&&(c2?(t=rf,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):rf.removeChild(n.stateNode));break;case 18:rf!==null&&(c2?(t=rf,n=n.stateNode,t.nodeType===8?Zne(t.parentNode,n):t.nodeType===1&&Zne(t,n),aF(t)):Zne(rf,n.stateNode));break;case 4:o=rf,r=c2,rf=n.stateNode.containerInfo,c2=!0,g4(t,e,n),rf=o,c2=r;break;case 0:case 11:case 14:case 15:if(!ih&&(o=n.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){r=o=o.next;do{var i=r,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Sse(n,e,a),r=r.next}while(r!==o)}g4(t,e,n);break;case 1:if(!ih&&(BP(n,e),o=n.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=n.memoizedProps,o.state=n.memoizedState,o.componentWillUnmount()}catch(l){d0(n,e,l)}g4(t,e,n);break;case 21:g4(t,e,n);break;case 22:n.mode&1?(ih=(o=ih)||n.memoizedState!==null,g4(t,e,n),ih=o):g4(t,e,n);break;default:g4(t,e,n)}}function IAe(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new kdt),e.forEach(function(o){var r=Vdt.bind(null,t,o);n.has(o)||(n.add(o),o.then(r,r))})}}function Vy(t,e){var n=e.deletions;if(n!==null)for(var o=0;or&&(r=a),o&=~i}if(o=r,o=W0()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*Ndt(o/1960))-o,10t?16:t,d8===null)var o=!1;else{if(t=d8,d8=null,jV=0,Hl&6)throw Error(Xo(331));var r=Hl;for(Hl|=4,jr=t.current;jr!==null;){var i=jr,a=i.child;if(jr.flags&16){var l=i.deletions;if(l!==null){for(var s=0;sW0()-o1e?ox(t,0):n1e|=n),$p(t,e)}function VLe(t,e){e===0&&(t.mode&1?(e=Kj,Kj<<=1,!(Kj&130023424)&&(Kj=4194304)):e=1);var n=cp();t=G6(t,e),t!==null&&(OL(t,e,n),$p(t,n))}function _dt(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),VLe(t,n)}function Vdt(t,e){var n=0;switch(t.tag){case 13:var o=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:o=t.stateNode;break;default:throw Error(Xo(314))}o!==null&&o.delete(e),VLe(t,n)}var GLe;GLe=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Kp.current)Yp=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Yp=!1,Ddt(t,e,n);Yp=!!(t.flags&131072)}else Yp=!1,Uc&&e.flags&1048576&&Kke(e,zV,e.index);switch(e.lanes=0,e.tag){case 2:var o=e.type;v_(t,e),t=e.pendingProps;var r=XC(e,yh.current);vC(e,n),r=qpe(null,e,o,t,r,n);var i=$pe();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,qp(o)?(i=!0,MV(e)):i=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Vpe(e),r.updater=LK,e.stateNode=r,r._reactInternals=e,mse(e,o,t,n),e=wse(null,e,o,!0,i,n)):(e.tag=0,Uc&&i&&Npe(e),Jh(null,e,r,n),e=e.child),e;case 16:o=e.elementType;e:{switch(v_(t,e),t=e.pendingProps,r=o._init,o=r(o._payload),e.type=o,r=e.tag=Xdt(o),t=a2(o,t),r){case 0:e=Ase(null,e,o,t,n);break e;case 1:e=PAe(null,e,o,t,n);break e;case 11:e=SAe(null,e,o,t,n);break e;case 14:e=TAe(null,e,o,a2(o.type,t),n);break e}throw Error(Xo(306,o,""))}return e;case 0:return o=e.type,r=e.pendingProps,r=e.elementType===o?r:a2(o,r),Ase(t,e,o,r,n);case 1:return o=e.type,r=e.pendingProps,r=e.elementType===o?r:a2(o,r),PAe(t,e,o,r,n);case 3:e:{if(MLe(e),t===null)throw Error(Xo(387));o=e.pendingProps,i=e.memoizedState,r=i.element,Zke(t,e),FV(e,o,null,n);var a=e.memoizedState;if(o=a.element,i.isDehydrated)if(i={element:o,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){r=$C(Error(Xo(423)),e),e=CAe(t,e,o,n,r);break e}else if(o!==r){r=$C(Error(Xo(424)),e),e=CAe(t,e,o,n,r);break e}else for(gg=D8(e.stateNode.containerInfo.firstChild),Sg=e,Uc=!0,g2=null,n=oLe(e,null,o,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(JC(),o===r){e=X6(t,e,n);break e}Jh(t,e,o,n)}e=e.child}return e;case 5:return rLe(e),t===null&&hse(e),o=e.type,r=e.pendingProps,i=t!==null?t.memoizedProps:null,a=r.children,sse(o,r)?a=null:i!==null&&sse(o,i)&&(e.flags|=32),HLe(t,e),Jh(t,e,a,n),e.child;case 6:return t===null&&hse(e),null;case 13:return ILe(t,e,n);case 4:return Gpe(e,e.stateNode.containerInfo),o=e.pendingProps,t===null?e.child=KC(e,null,o,n):Jh(t,e,o,n),e.child;case 11:return o=e.type,r=e.pendingProps,r=e.elementType===o?r:a2(o,r),SAe(t,e,o,r,n);case 7:return Jh(t,e,e.pendingProps,n),e.child;case 8:return Jh(t,e,e.pendingProps.children,n),e.child;case 12:return Jh(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(o=e.type._context,r=e.pendingProps,i=e.memoizedProps,a=r.value,Js(DV,o._currentValue),o._currentValue=a,i!==null)if(O2(i.value,a)){if(i.children===r.children&&!Kp.current){e=X6(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var s=l.firstContext;s!==null;){if(s.context===o){if(i.tag===1){s=D6(-1,n&-n),s.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?s.next=s:(s.next=u.next,u.next=s),c.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),pse(i.return,n,e),l.lanes|=n;break}s=s.next}}else if(i.tag===10)a=i.type===e.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(Xo(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),pse(a,n,e),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Jh(t,e,r.children,n),e=e.child}return e;case 9:return r=e.type,o=e.pendingProps.children,vC(e,n),r=Jm(r),o=o(r),e.flags|=1,Jh(t,e,o,n),e.child;case 14:return o=e.type,r=a2(o,e.pendingProps),r=a2(o.type,r),TAe(t,e,o,r,n);case 15:return CLe(t,e,e.type,e.pendingProps,n);case 17:return o=e.type,r=e.pendingProps,r=e.elementType===o?r:a2(o,r),v_(t,e),e.tag=1,qp(o)?(t=!0,MV(e)):t=!1,vC(e,n),tLe(e,o,r),mse(e,o,r,n),wse(null,e,o,!0,t,n);case 19:return zLe(t,e,n);case 22:return RLe(t,e,n)}throw Error(Xo(156,e.tag))};function XLe(t,e){return wke(t,e)}function Gdt(t,e,n,o){this.tag=t,this.key=n,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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lm(t,e,n,o){return new Gdt(t,e,n,o)}function l1e(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Xdt(t){if(typeof t=="function")return l1e(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Cpe)return 11;if(t===Rpe)return 14}return 2}function L8(t,e){var n=t.alternate;return n===null?(n=Lm(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function S_(t,e,n,o,r,i){var a=2;if(o=t,typeof t=="function")l1e(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case DP:return rx(n.children,r,i,e);case Ppe:a=8,r|=8;break;case jle:return t=Lm(12,n,e,r|2),t.elementType=jle,t.lanes=i,t;case Ble:return t=Lm(13,n,e,r),t.elementType=Ble,t.lanes=i,t;case Yle:return t=Lm(19,n,e,r),t.elementType=Yle,t.lanes=i,t;case nke:return jK(n,r,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case eke:a=10;break e;case tke:a=9;break e;case Cpe:a=11;break e;case Rpe:a=14;break e;case O4:a=16,o=null;break e}throw Error(Xo(130,t==null?t:typeof t,""))}return e=Lm(a,n,e,r),e.elementType=t,e.type=o,e.lanes=i,e}function rx(t,e,n,o){return t=Lm(7,t,o,e),t.lanes=n,t}function jK(t,e,n,o){return t=Lm(22,t,o,e),t.elementType=nke,t.lanes=n,t.stateNode={isHidden:!1},t}function loe(t,e,n){return t=Lm(6,t,null,e),t.lanes=n,t}function soe(t,e,n){return e=Lm(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Jdt(t,e,n,o,r){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yne(0),this.expirationTimes=Yne(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yne(0),this.identifierPrefix=o,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function s1e(t,e,n,o,r,i,a,l,s){return t=new Jdt(t,e,n,l,s),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Lm(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:o,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vpe(i),t}function Kdt(t,e,n){var o=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($Le)}catch(t){console.error(t)}}$Le(),KFe.exports=Wg;var Cd=KFe.exports;const OV=Fi(Cd),eft=WFe({__proto__:null,default:OV},[Cd]);var QLe,NAe=Cd;QLe=NAe.createRoot,NAe.hydrateRoot;var ZLe={exports:{}},eWe={},tWe={exports:{}},nWe={};/** +`+i.stack}return{value:t,source:e,stack:r,digest:null}}function ioe(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function yse(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var Mdt=typeof WeakMap=="function"?WeakMap:Map;function PLe(t,e,n){n=D6(-1,n),n.tag=3,n.payload={element:null};var o=e.value;return n.callback=function(){jV||(jV=!0,Rse=o),yse(t,e)},n}function CLe(t,e,n){n=D6(-1,n),n.tag=3;var o=t.type.getDerivedStateFromError;if(typeof o=="function"){var r=e.value;n.payload=function(){return o(r)},n.callback=function(){yse(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){yse(t,e),typeof o!="function"&&(F8===null?F8=new Set([this]):F8.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}function xAe(t,e,n){var o=t.pingCache;if(o===null){o=t.pingCache=new Mdt;var r=new Set;o.set(e,r)}else r=o.get(e),r===void 0&&(r=new Set,o.set(e,r));r.has(n)||(r.add(n),t=Odt.bind(null,t,e,n),e.then(t,t))}function bAe(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function SAe(t,e,n,o,r){return t.mode&1?(t.flags|=65536,t.lanes=r,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=D6(-1,1),e.tag=2,E8(n,e,1))),n.lanes|=1),t)}var Idt=dA.ReactCurrentOwner,Yp=!1;function Jh(t,e,n,o){e.child=t===null?rLe(e,null,n,o):KC(e,t.child,n,o)}function TAe(t,e,n,o,r){n=n.render;var i=e.ref;return vC(e,r),o=qpe(t,e,n,o,i,r),n=$pe(),t!==null&&!Yp?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,X6(t,e,r)):(Uc&&n&&Npe(e),e.flags|=1,Jh(t,e,o,r),e.child)}function PAe(t,e,n,o,r){if(t===null){var i=n.type;return typeof i=="function"&&!l1e(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,RLe(t,e,i,o,r)):(t=T_(n.type,null,o,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&r)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:sF,n(a,o)&&t.ref===e.ref)return X6(t,e,r)}return e.flags|=1,t=L8(i,o),t.ref=e.ref,t.return=e,e.child=t}function RLe(t,e,n,o,r){if(t!==null){var i=t.memoizedProps;if(sF(i,o)&&t.ref===e.ref)if(Yp=!1,e.pendingProps=o=i,(t.lanes&r)!==0)t.flags&131072&&(Yp=!0);else return e.lanes=t.lanes,X6(t,e,r)}return Ase(t,e,n,o,r)}function HLe(t,e,n){var o=e.pendingProps,r=o.children,i=t!==null?t.memoizedState:null;if(o.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Js(YP,eg),eg|=n;else{if(!(n&1073741824))return t=i!==null?i.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Js(YP,eg),eg|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},o=i!==null?i.baseLanes:n,Js(YP,eg),eg|=o}else i!==null?(o=i.baseLanes|n,e.memoizedState=null):o=n,Js(YP,eg),eg|=o;return Jh(t,e,r,n),e.child}function MLe(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Ase(t,e,n,o,r){var i=qp(n)?kx:yh.current;return i=XC(e,i),vC(e,r),n=qpe(t,e,n,o,i,r),o=$pe(),t!==null&&!Yp?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,X6(t,e,r)):(Uc&&o&&Npe(e),e.flags|=1,Jh(t,e,n,r),e.child)}function CAe(t,e,n,o,r){if(qp(n)){var i=!0;IV(e)}else i=!1;if(vC(e,r),e.stateNode===null)x_(t,e),nLe(e,n,o),mse(e,n,o,r),o=!0;else if(t===null){var a=e.stateNode,l=e.memoizedProps;a.props=l;var s=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=Jm(c):(c=qp(n)?kx:yh.current,c=XC(e,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==o||s!==c)&&yAe(e,a,o,c),_4=!1;var f=e.memoizedState;a.state=f,kV(e,o,a,r),s=e.memoizedState,l!==o||f!==s||Kp.current||_4?(typeof u=="function"&&(gse(e,n,u,o),s=e.memoizedState),(l=_4||mAe(e,n,l,o,f,s,c))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=o,e.memoizedState=s),a.props=o,a.state=s,a.context=c,o=l):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),o=!1)}else{a=e.stateNode,eLe(t,e),l=e.memoizedProps,c=e.type===e.elementType?l:a2(e.type,l),a.props=c,d=e.pendingProps,f=a.context,s=n.contextType,typeof s=="object"&&s!==null?s=Jm(s):(s=qp(n)?kx:yh.current,s=XC(e,s));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==d||f!==s)&&yAe(e,a,o,s),_4=!1,f=e.memoizedState,a.state=f,kV(e,o,a,r);var g=e.memoizedState;l!==d||f!==g||Kp.current||_4?(typeof p=="function"&&(gse(e,n,p,o),g=e.memoizedState),(c=_4||mAe(e,n,c,o,f,g,s)||!1)?(u||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(o,g,s),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(o,g,s)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=o,e.memoizedState=g),a.props=o,a.state=g,a.context=s,o=c):(typeof a.componentDidUpdate!="function"||l===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),o=!1)}return wse(t,e,n,o,i,r)}function wse(t,e,n,o,r,i){MLe(t,e);var a=(e.flags&128)!==0;if(!o&&!a)return r&&dAe(e,n,!1),X6(t,e,i);o=e.stateNode,Idt.current=e;var l=a&&typeof n.getDerivedStateFromError!="function"?null:o.render();return e.flags|=1,t!==null&&a?(e.child=KC(e,t.child,null,i),e.child=KC(e,null,l,i)):Jh(t,e,l,i),e.memoizedState=o.state,r&&dAe(e,n,!0),e.child}function ILe(t){var e=t.stateNode;e.pendingContext?uAe(t,e.pendingContext,e.pendingContext!==e.context):e.context&&uAe(t,e.context,!1),Gpe(t,e.containerInfo)}function RAe(t,e,n,o,r){return JC(),jpe(r),e.flags|=256,Jh(t,e,n,o),e.child}var vse={dehydrated:null,treeContext:null,retryLane:0};function xse(t){return{baseLanes:t,cachePool:null,transitions:null}}function zLe(t,e,n){var o=e.pendingProps,r=e0.current,i=!1,a=(e.flags&128)!==0,l;if((l=a)||(l=t!==null&&t.memoizedState===null?!1:(r&2)!==0),l?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(r|=1),Js(e0,r&1),t===null)return hse(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(a=o.children,t=o.fallback,i?(o=e.mode,i=e.child,a={mode:"hidden",children:a},!(o&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=BK(a,o,0,null),t=rx(t,o,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=xse(n),e.memoizedState=vse,t):e1e(e,a));if(r=t.memoizedState,r!==null&&(l=r.dehydrated,l!==null))return zdt(t,e,a,o,l,r,n);if(i){i=o.fallback,a=e.mode,r=t.child,l=r.sibling;var s={mode:"hidden",children:o.children};return!(a&1)&&e.child!==r?(o=e.child,o.childLanes=0,o.pendingProps=s,e.deletions=null):(o=L8(r,s),o.subtreeFlags=r.subtreeFlags&14680064),l!==null?i=L8(l,i):(i=rx(i,a,n,null),i.flags|=2),i.return=e,o.return=e,o.sibling=i,e.child=o,o=i,i=e.child,a=t.child.memoizedState,a=a===null?xse(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=t.childLanes&~n,e.memoizedState=vse,o}return i=t.child,t=i.sibling,o=L8(i,{mode:"visible",children:o.children}),!(e.mode&1)&&(o.lanes=n),o.return=e,o.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=o,e.memoizedState=null,o}function e1e(t,e){return e=BK({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function rB(t,e,n,o){return o!==null&&jpe(o),KC(e,t.child,null,n),t=e1e(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function zdt(t,e,n,o,r,i,a){if(n)return e.flags&256?(e.flags&=-257,o=ioe(Error(Xo(422))),rB(t,e,a,o)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=o.fallback,r=e.mode,o=BK({mode:"visible",children:o.children},r,0,null),i=rx(i,r,a,null),i.flags|=2,o.return=e,i.return=e,o.sibling=i,e.child=o,e.mode&1&&KC(e,t.child,null,a),e.child.memoizedState=xse(a),e.memoizedState=vse,i);if(!(e.mode&1))return rB(t,e,a,null);if(r.data==="$!"){if(o=r.nextSibling&&r.nextSibling.dataset,o)var l=o.dgst;return o=l,i=Error(Xo(419)),o=ioe(i,o,void 0),rB(t,e,a,o)}if(l=(a&t.childLanes)!==0,Yp||l){if(o=Sd,o!==null){switch(a&-a){case 4:r=2;break;case 16:r=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:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(o.suspendedLanes|a)?0:r,r!==0&&r!==i.retryLane&&(i.retryLane=r,G6(t,r),z2(o,t,r,-1))}return a1e(),o=ioe(Error(Xo(421))),rB(t,e,a,o)}return r.data==="$?"?(e.flags|=128,e.child=t.child,e=_dt.bind(null,t),r._reactRetry=e,null):(t=i.treeContext,gg=D8(r.nextSibling),Sg=e,Uc=!0,g2=null,t!==null&&(Rm[Hm++]=v6,Rm[Hm++]=x6,Rm[Hm++]=Lx,v6=t.id,x6=t.overflow,Lx=e),e=e1e(e,o.children),e.flags|=4096,e)}function HAe(t,e,n){t.lanes|=e;var o=t.alternate;o!==null&&(o.lanes|=e),pse(t.return,e,n)}function aoe(t,e,n,o,r){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:o,tail:n,tailMode:r}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=o,i.tail=n,i.tailMode=r)}function DLe(t,e,n){var o=e.pendingProps,r=o.revealOrder,i=o.tail;if(Jh(t,e,o.children,n),o=e0.current,o&2)o=o&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&HAe(t,n,e);else if(t.tag===19)HAe(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}o&=1}if(Js(e0,o),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&LV(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),aoe(e,!1,r,n,i);break;case"backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&LV(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}aoe(e,!0,n,null,i);break;case"together":aoe(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function x_(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function X6(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Nx|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Xo(153));if(e.child!==null){for(t=e.child,n=L8(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=L8(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Ddt(t,e,n){switch(e.tag){case 3:ILe(e),JC();break;case 5:iLe(e);break;case 1:qp(e.type)&&IV(e);break;case 4:Gpe(e,e.stateNode.containerInfo);break;case 10:var o=e.type._context,r=e.memoizedProps.value;Js(EV,o._currentValue),o._currentValue=r;break;case 13:if(o=e.memoizedState,o!==null)return o.dehydrated!==null?(Js(e0,e0.current&1),e.flags|=128,null):n&e.child.childLanes?zLe(t,e,n):(Js(e0,e0.current&1),t=X6(t,e,n),t!==null?t.sibling:null);Js(e0,e0.current&1);break;case 19:if(o=(n&e.childLanes)!==0,t.flags&128){if(o)return DLe(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Js(e0,e0.current),o)break;return null;case 22:case 23:return e.lanes=0,HLe(t,e,n)}return X6(t,e,n)}var ELe,bse,FLe,kLe;ELe=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};bse=function(){};FLe=function(t,e,n,o){var r=t.memoizedProps;if(r!==o){t=e.stateNode,Hv(b9.current);var i=null;switch(n){case"input":r=_le(t,r),o=_le(t,o),i=[];break;case"select":r=a0({},r,{value:void 0}),o=a0({},o,{value:void 0}),i=[];break;case"textarea":r=Xle(t,r),o=Xle(t,o),i=[];break;default:typeof r.onClick!="function"&&typeof o.onClick=="function"&&(t.onclick=HV)}Kle(n,o);var a;n=null;for(c in r)if(!o.hasOwnProperty(c)&&r.hasOwnProperty(c)&&r[c]!=null)if(c==="style"){var l=r[c];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(tF.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in o){var s=o[c];if(l=r!=null?r[c]:void 0,o.hasOwnProperty(c)&&s!==l&&(s!=null||l!=null))if(c==="style")if(l){for(a in l)!l.hasOwnProperty(a)||s&&s.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in s)s.hasOwnProperty(a)&&l[a]!==s[a]&&(n||(n={}),n[a]=s[a])}else n||(i||(i=[]),i.push(c,n)),n=s;else c==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,l=l?l.__html:void 0,s!=null&&l!==s&&(i=i||[]).push(c,s)):c==="children"?typeof s!="string"&&typeof s!="number"||(i=i||[]).push(c,""+s):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(tF.hasOwnProperty(c)?(s!=null&&c==="onScroll"&&ac("scroll",t),i||l===s||(i=[])):(i=i||[]).push(c,s))}n&&(i=i||[]).push("style",n);var c=i;(e.updateQueue=c)&&(e.flags|=4)}};kLe=function(t,e,n,o){n!==o&&(e.flags|=4)};function uz(t,e){if(!Uc)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function Bf(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,o=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,o|=r.subtreeFlags&14680064,o|=r.flags&14680064,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,o|=r.subtreeFlags,o|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=o,t.childLanes=n,e}function Edt(t,e,n){var o=e.pendingProps;switch(Upe(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bf(e),null;case 1:return qp(e.type)&&MV(),Bf(e),null;case 3:return o=e.stateNode,qC(),vc(Kp),vc(yh),Jpe(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(t===null||t.child===null)&&(nB(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,g2!==null&&(Ise(g2),g2=null))),bse(t,e),Bf(e),null;case 5:Xpe(e);var r=Hv(hF.current);if(n=e.type,t!==null&&e.stateNode!=null)FLe(t,e,n,o,r),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!o){if(e.stateNode===null)throw Error(Xo(166));return Bf(e),null}if(t=Hv(b9.current),nB(e)){o=e.stateNode,n=e.type;var i=e.memoizedProps;switch(o[u9]=e,o[dF]=i,t=(e.mode&1)!==0,n){case"dialog":ac("cancel",o),ac("close",o);break;case"iframe":case"object":case"embed":ac("load",o);break;case"video":case"audio":for(r=0;r<\/script>",t=t.removeChild(t.firstChild)):typeof o.is=="string"?t=a.createElement(n,{is:o.is}):(t=a.createElement(n),n==="select"&&(a=t,o.multiple?a.multiple=!0:o.size&&(a.size=o.size))):t=a.createElementNS(t,n),t[u9]=e,t[dF]=o,ELe(t,e,!1,!1),e.stateNode=t;e:{switch(a=qle(n,o),n){case"dialog":ac("cancel",t),ac("close",t),r=o;break;case"iframe":case"object":case"embed":ac("load",t),r=o;break;case"video":case"audio":for(r=0;rQC&&(e.flags|=128,o=!0,uz(i,!1),e.lanes=4194304)}else{if(!o)if(t=LV(a),t!==null){if(e.flags|=128,o=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),uz(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Uc)return Bf(e),null}else 2*W0()-i.renderingStartTime>QC&&n!==1073741824&&(e.flags|=128,o=!0,uz(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(n=i.last,n!==null?n.sibling=a:e.child=a,i.last=a)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=W0(),e.sibling=null,n=e0.current,Js(e0,o?n&1|2:n&1),e):(Bf(e),null);case 22:case 23:return i1e(),o=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==o&&(e.flags|=8192),o&&e.mode&1?eg&1073741824&&(Bf(e),e.subtreeFlags&6&&(e.flags|=8192)):Bf(e),null;case 24:return null;case 25:return null}throw Error(Xo(156,e.tag))}function Fdt(t,e){switch(Upe(e),e.tag){case 1:return qp(e.type)&&MV(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return qC(),vc(Kp),vc(yh),Jpe(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Xpe(e),null;case 13:if(vc(e0),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Xo(340));JC()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return vc(e0),null;case 4:return qC(),null;case 10:return Ope(e.type._context),null;case 22:case 23:return i1e(),null;case 24:return null;default:return null}}var iB=!1,ih=!1,kdt=typeof WeakSet=="function"?WeakSet:Set,jr=null;function BP(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(o){d0(t,e,o)}else n.current=null}function Sse(t,e,n){try{n()}catch(o){d0(t,e,o)}}var MAe=!1;function Ldt(t,e){if(ase=PV,t=Uke(),Wpe(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var o=n.getSelection&&n.getSelection();if(o&&o.rangeCount!==0){n=o.anchorNode;var r=o.anchorOffset,i=o.focusNode;o=o.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,l=-1,s=-1,c=0,u=0,d=t,f=null;t:for(;;){for(var p;d!==n||r!==0&&d.nodeType!==3||(l=a+r),d!==i||o!==0&&d.nodeType!==3||(s=a+o),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===n&&++c===r&&(l=a),f===i&&++u===o&&(s=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=l===-1||s===-1?null:{start:l,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(lse={focusedElem:t,selectionRange:n},PV=!1,jr=e;jr!==null;)if(e=jr,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,jr=t;else for(;jr!==null;){e=jr;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,w=g.memoizedState,b=e.stateNode,C=b.getSnapshotBeforeUpdate(e.elementType===e.type?y:a2(e.type,y),w);b.__reactInternalSnapshotBeforeUpdate=C}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(Xo(163))}}catch(v){d0(e,e.return,v)}if(t=e.sibling,t!==null){t.return=e.return,jr=t;break}jr=e.return}return g=MAe,MAe=!1,g}function iE(t,e,n){var o=e.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var r=o=o.next;do{if((r.tag&t)===t){var i=r.destroy;r.destroy=void 0,i!==void 0&&Sse(e,n,i)}r=r.next}while(r!==o)}}function UK(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var o=n.create;n.destroy=o()}n=n.next}while(n!==e)}}function Tse(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function LLe(t){var e=t.alternate;e!==null&&(t.alternate=null,LLe(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[u9],delete e[dF],delete e[use],delete e[Adt],delete e[wdt])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function WLe(t){return t.tag===5||t.tag===3||t.tag===4}function IAe(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||WLe(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Pse(t,e,n){var o=t.tag;if(o===5||o===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=HV));else if(o!==4&&(t=t.child,t!==null))for(Pse(t,e,n),t=t.sibling;t!==null;)Pse(t,e,n),t=t.sibling}function Cse(t,e,n){var o=t.tag;if(o===5||o===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(o!==4&&(t=t.child,t!==null))for(Cse(t,e,n),t=t.sibling;t!==null;)Cse(t,e,n),t=t.sibling}var rf=null,c2=!1;function g4(t,e,n){for(n=n.child;n!==null;)NLe(t,e,n),n=n.sibling}function NLe(t,e,n){if(x9&&typeof x9.onCommitFiberUnmount=="function")try{x9.onCommitFiberUnmount(zK,n)}catch{}switch(n.tag){case 5:ih||BP(n,e);case 6:var o=rf,r=c2;rf=null,g4(t,e,n),rf=o,c2=r,rf!==null&&(c2?(t=rf,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):rf.removeChild(n.stateNode));break;case 18:rf!==null&&(c2?(t=rf,n=n.stateNode,t.nodeType===8?Zne(t.parentNode,n):t.nodeType===1&&Zne(t,n),aF(t)):Zne(rf,n.stateNode));break;case 4:o=rf,r=c2,rf=n.stateNode.containerInfo,c2=!0,g4(t,e,n),rf=o,c2=r;break;case 0:case 11:case 14:case 15:if(!ih&&(o=n.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){r=o=o.next;do{var i=r,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Sse(n,e,a),r=r.next}while(r!==o)}g4(t,e,n);break;case 1:if(!ih&&(BP(n,e),o=n.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=n.memoizedProps,o.state=n.memoizedState,o.componentWillUnmount()}catch(l){d0(n,e,l)}g4(t,e,n);break;case 21:g4(t,e,n);break;case 22:n.mode&1?(ih=(o=ih)||n.memoizedState!==null,g4(t,e,n),ih=o):g4(t,e,n);break;default:g4(t,e,n)}}function zAe(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new kdt),e.forEach(function(o){var r=Vdt.bind(null,t,o);n.has(o)||(n.add(o),o.then(r,r))})}}function Vy(t,e){var n=e.deletions;if(n!==null)for(var o=0;or&&(r=a),o&=~i}if(o=r,o=W0()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*Ndt(o/1960))-o,10t?16:t,d8===null)var o=!1;else{if(t=d8,d8=null,BV=0,Hl&6)throw Error(Xo(331));var r=Hl;for(Hl|=4,jr=t.current;jr!==null;){var i=jr,a=i.child;if(jr.flags&16){var l=i.deletions;if(l!==null){for(var s=0;sW0()-o1e?ox(t,0):n1e|=n),$p(t,e)}function GLe(t,e){e===0&&(t.mode&1?(e=qj,qj<<=1,!(qj&130023424)&&(qj=4194304)):e=1);var n=cp();t=G6(t,e),t!==null&&(OL(t,e,n),$p(t,n))}function _dt(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),GLe(t,n)}function Vdt(t,e){var n=0;switch(t.tag){case 13:var o=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:o=t.stateNode;break;default:throw Error(Xo(314))}o!==null&&o.delete(e),GLe(t,n)}var XLe;XLe=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Kp.current)Yp=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Yp=!1,Ddt(t,e,n);Yp=!!(t.flags&131072)}else Yp=!1,Uc&&e.flags&1048576&&qke(e,DV,e.index);switch(e.lanes=0,e.tag){case 2:var o=e.type;x_(t,e),t=e.pendingProps;var r=XC(e,yh.current);vC(e,n),r=qpe(null,e,o,t,r,n);var i=$pe();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,qp(o)?(i=!0,IV(e)):i=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Vpe(e),r.updater=WK,e.stateNode=r,r._reactInternals=e,mse(e,o,t,n),e=wse(null,e,o,!0,i,n)):(e.tag=0,Uc&&i&&Npe(e),Jh(null,e,r,n),e=e.child),e;case 16:o=e.elementType;e:{switch(x_(t,e),t=e.pendingProps,r=o._init,o=r(o._payload),e.type=o,r=e.tag=Xdt(o),t=a2(o,t),r){case 0:e=Ase(null,e,o,t,n);break e;case 1:e=CAe(null,e,o,t,n);break e;case 11:e=TAe(null,e,o,t,n);break e;case 14:e=PAe(null,e,o,a2(o.type,t),n);break e}throw Error(Xo(306,o,""))}return e;case 0:return o=e.type,r=e.pendingProps,r=e.elementType===o?r:a2(o,r),Ase(t,e,o,r,n);case 1:return o=e.type,r=e.pendingProps,r=e.elementType===o?r:a2(o,r),CAe(t,e,o,r,n);case 3:e:{if(ILe(e),t===null)throw Error(Xo(387));o=e.pendingProps,i=e.memoizedState,r=i.element,eLe(t,e),kV(e,o,null,n);var a=e.memoizedState;if(o=a.element,i.isDehydrated)if(i={element:o,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){r=$C(Error(Xo(423)),e),e=RAe(t,e,o,n,r);break e}else if(o!==r){r=$C(Error(Xo(424)),e),e=RAe(t,e,o,n,r);break e}else for(gg=D8(e.stateNode.containerInfo.firstChild),Sg=e,Uc=!0,g2=null,n=rLe(e,null,o,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(JC(),o===r){e=X6(t,e,n);break e}Jh(t,e,o,n)}e=e.child}return e;case 5:return iLe(e),t===null&&hse(e),o=e.type,r=e.pendingProps,i=t!==null?t.memoizedProps:null,a=r.children,sse(o,r)?a=null:i!==null&&sse(o,i)&&(e.flags|=32),MLe(t,e),Jh(t,e,a,n),e.child;case 6:return t===null&&hse(e),null;case 13:return zLe(t,e,n);case 4:return Gpe(e,e.stateNode.containerInfo),o=e.pendingProps,t===null?e.child=KC(e,null,o,n):Jh(t,e,o,n),e.child;case 11:return o=e.type,r=e.pendingProps,r=e.elementType===o?r:a2(o,r),TAe(t,e,o,r,n);case 7:return Jh(t,e,e.pendingProps,n),e.child;case 8:return Jh(t,e,e.pendingProps.children,n),e.child;case 12:return Jh(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(o=e.type._context,r=e.pendingProps,i=e.memoizedProps,a=r.value,Js(EV,o._currentValue),o._currentValue=a,i!==null)if(O2(i.value,a)){if(i.children===r.children&&!Kp.current){e=X6(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var s=l.firstContext;s!==null;){if(s.context===o){if(i.tag===1){s=D6(-1,n&-n),s.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?s.next=s:(s.next=u.next,u.next=s),c.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),pse(i.return,n,e),l.lanes|=n;break}s=s.next}}else if(i.tag===10)a=i.type===e.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(Xo(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),pse(a,n,e),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Jh(t,e,r.children,n),e=e.child}return e;case 9:return r=e.type,o=e.pendingProps.children,vC(e,n),r=Jm(r),o=o(r),e.flags|=1,Jh(t,e,o,n),e.child;case 14:return o=e.type,r=a2(o,e.pendingProps),r=a2(o.type,r),PAe(t,e,o,r,n);case 15:return RLe(t,e,e.type,e.pendingProps,n);case 17:return o=e.type,r=e.pendingProps,r=e.elementType===o?r:a2(o,r),x_(t,e),e.tag=1,qp(o)?(t=!0,IV(e)):t=!1,vC(e,n),nLe(e,o,r),mse(e,o,r,n),wse(null,e,o,!0,t,n);case 19:return DLe(t,e,n);case 22:return HLe(t,e,n)}throw Error(Xo(156,e.tag))};function JLe(t,e){return vke(t,e)}function Gdt(t,e,n,o){this.tag=t,this.key=n,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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lm(t,e,n,o){return new Gdt(t,e,n,o)}function l1e(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Xdt(t){if(typeof t=="function")return l1e(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Cpe)return 11;if(t===Rpe)return 14}return 2}function L8(t,e){var n=t.alternate;return n===null?(n=Lm(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function T_(t,e,n,o,r,i){var a=2;if(o=t,typeof t=="function")l1e(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case DP:return rx(n.children,r,i,e);case Ppe:a=8,r|=8;break;case jle:return t=Lm(12,n,e,r|2),t.elementType=jle,t.lanes=i,t;case Ble:return t=Lm(13,n,e,r),t.elementType=Ble,t.lanes=i,t;case Yle:return t=Lm(19,n,e,r),t.elementType=Yle,t.lanes=i,t;case oke:return BK(n,r,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case tke:a=10;break e;case nke:a=9;break e;case Cpe:a=11;break e;case Rpe:a=14;break e;case O4:a=16,o=null;break e}throw Error(Xo(130,t==null?t:typeof t,""))}return e=Lm(a,n,e,r),e.elementType=t,e.type=o,e.lanes=i,e}function rx(t,e,n,o){return t=Lm(7,t,o,e),t.lanes=n,t}function BK(t,e,n,o){return t=Lm(22,t,o,e),t.elementType=oke,t.lanes=n,t.stateNode={isHidden:!1},t}function loe(t,e,n){return t=Lm(6,t,null,e),t.lanes=n,t}function soe(t,e,n){return e=Lm(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Jdt(t,e,n,o,r){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yne(0),this.expirationTimes=Yne(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yne(0),this.identifierPrefix=o,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function s1e(t,e,n,o,r,i,a,l,s){return t=new Jdt(t,e,n,l,s),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Lm(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:o,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vpe(i),t}function Kdt(t,e,n){var o=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(QLe)}catch(t){console.error(t)}}QLe(),qFe.exports=Wg;var Cd=qFe.exports;const _V=Fi(Cd),eft=NFe({__proto__:null,default:_V},[Cd]);var ZLe,UAe=Cd;ZLe=UAe.createRoot,UAe.hydrateRoot;var eWe={exports:{}},tWe={},nWe={exports:{}},oWe={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -45,7 +45,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ZC=m;function tft(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var nft=typeof Object.is=="function"?Object.is:tft,oft=ZC.useState,rft=ZC.useEffect,ift=ZC.useLayoutEffect,aft=ZC.useDebugValue;function lft(t,e){var n=e(),o=oft({inst:{value:n,getSnapshot:e}}),r=o[0].inst,i=o[1];return ift(function(){r.value=n,r.getSnapshot=e,coe(r)&&i({inst:r})},[t,n,e]),rft(function(){return coe(r)&&i({inst:r}),t(function(){coe(r)&&i({inst:r})})},[t]),aft(n),n}function coe(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!nft(t,n)}catch{return!0}}function sft(t,e){return e()}var cft=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?sft:lft;nWe.useSyncExternalStore=ZC.useSyncExternalStore!==void 0?ZC.useSyncExternalStore:cft;tWe.exports=nWe;var uft=tWe.exports;/** + */var ZC=m;function tft(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var nft=typeof Object.is=="function"?Object.is:tft,oft=ZC.useState,rft=ZC.useEffect,ift=ZC.useLayoutEffect,aft=ZC.useDebugValue;function lft(t,e){var n=e(),o=oft({inst:{value:n,getSnapshot:e}}),r=o[0].inst,i=o[1];return ift(function(){r.value=n,r.getSnapshot=e,coe(r)&&i({inst:r})},[t,n,e]),rft(function(){return coe(r)&&i({inst:r}),t(function(){coe(r)&&i({inst:r})})},[t]),aft(n),n}function coe(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!nft(t,n)}catch{return!0}}function sft(t,e){return e()}var cft=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?sft:lft;oWe.useSyncExternalStore=ZC.useSyncExternalStore!==void 0?ZC.useSyncExternalStore:cft;nWe.exports=oWe;var uft=nWe.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -53,7 +53,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var VK=m,dft=uft;function fft(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var hft=typeof Object.is=="function"?Object.is:fft,pft=dft.useSyncExternalStore,gft=VK.useRef,mft=VK.useEffect,yft=VK.useMemo,Aft=VK.useDebugValue;eWe.useSyncExternalStoreWithSelector=function(t,e,n,o,r){var i=gft(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=yft(function(){function s(p){if(!c){if(c=!0,u=p,p=o(p),r!==void 0&&a.hasValue){var g=a.value;if(r(g,p))return d=g}return d=p}if(g=d,hft(u,p))return g;var y=o(p);return r!==void 0&&r(g,y)?g:(u=p,d=y)}var c=!1,u,d,f=n===void 0?null:n;return[function(){return s(e())},f===null?void 0:function(){return s(f())}]},[e,n,o,r]);var l=pft(t,i[0],i[1]);return mft(function(){a.hasValue=!0,a.value=l},[l]),Aft(l),l};ZLe.exports=eWe;var wft=ZLe.exports;const vft=Fi(wft);var xft={VITE_MAPS_API_KEY:"AIzaSyCX6AmhM9d6R1ne9E7redd86YEahX_2Scs",VITE_FIREBASE_API_KEY:"AIzaSyD-236qE4ix9TkH2AW_wjKSz8jgK0ukjW0",VITE_FIREBASE_AUTH_DOMAIN:"aladdin-316017.firebaseapp.com",VITE_FIREBASE_DATABASE_URL:"https://aladdin-316017.firebaseio.com",VITE_FIREBASE_PROJECT_ID:"aladdin-316017",VITE_FIREBASE_STORAGE_BUCKET:"aladdin-316017.appspot.com",VITE_FIREBASE_MESSAGING_SENDER_ID:"169516488625",VITE_FIREBASE_APP_ID:"1:169516488625:web:bb0ae3c3f7c6e813250f90",VITE_FIREBASE_MEASUREMENT_ID:"G-G0XPQ7JNYJ",VITE_FIREBASE_LOGGER_DATABASE_URL:"https://aladdin-2024.firebaseio.com",VITE_EXAMPLE_PROJECT_OWNER:"QWecNcxhyvP6j6sBN11hBsfZDau1",BASE_URL:"/aladdin",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const UAe=t=>{let e;const n=new Set,o=(s,c)=>{const u=typeof s=="function"?s(e):s;if(!Object.is(u,e)){const d=e;e=c??typeof u!="object"?u:Object.assign({},e,u),n.forEach(f=>f(e,d))}},r=()=>e,l={setState:o,getState:r,subscribe:s=>(n.add(s),()=>n.delete(s)),destroy:()=>{(xft?"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."),n.clear()}};return e=t(o,r,l),l},bft=t=>t?UAe(t):UAe,{useDebugValue:Sft}=be,{useSyncExternalStoreWithSelector:Tft}=vft;function Pft(t,e=t.getState,n){const o=Tft(t.subscribe,t.getState,t.getServerState||t.getState,e,n);return Sft(o),o}const Cft=(t,e)=>{const n=bft(t),o=(r,i=e)=>Pft(n,r,i);return Object.assign(o,n),o},GK=(t,e)=>Cft;var lB,Rft=new Uint8Array(16);function oWe(){if(!lB&&(lB=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!lB))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return lB(Rft)}const Hft=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function XK(t){return typeof t=="string"&&Hft.test(t)}var tf=[];for(var uoe=0;uoe<256;++uoe)tf.push((uoe+256).toString(16).substr(1));function JK(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(tf[t[e+0]]+tf[t[e+1]]+tf[t[e+2]]+tf[t[e+3]]+"-"+tf[t[e+4]]+tf[t[e+5]]+"-"+tf[t[e+6]]+tf[t[e+7]]+"-"+tf[t[e+8]]+tf[t[e+9]]+"-"+tf[t[e+10]]+tf[t[e+11]]+tf[t[e+12]]+tf[t[e+13]]+tf[t[e+14]]+tf[t[e+15]]).toLowerCase();if(!XK(n))throw TypeError("Stringified UUID is invalid");return n}var jAe,doe,foe=0,hoe=0;function Mft(t,e,n){var o=e&&n||0,r=e||new Array(16);t=t||{};var i=t.node||jAe,a=t.clockseq!==void 0?t.clockseq:doe;if(i==null||a==null){var l=t.random||(t.rng||oWe)();i==null&&(i=jAe=[l[0]|1,l[1],l[2],l[3],l[4],l[5]]),a==null&&(a=doe=(l[6]<<8|l[7])&16383)}var s=t.msecs!==void 0?t.msecs:Date.now(),c=t.nsecs!==void 0?t.nsecs:hoe+1,u=s-foe+(c-hoe)/1e4;if(u<0&&t.clockseq===void 0&&(a=a+1&16383),(u<0||s>foe)&&t.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");foe=s,hoe=c,doe=a,s+=122192928e5;var d=((s&268435455)*1e4+c)%4294967296;r[o++]=d>>>24&255,r[o++]=d>>>16&255,r[o++]=d>>>8&255,r[o++]=d&255;var f=s/4294967296*1e4&268435455;r[o++]=f>>>8&255,r[o++]=f&255,r[o++]=f>>>24&15|16,r[o++]=f>>>16&255,r[o++]=a>>>8|128,r[o++]=a&255;for(var p=0;p<6;++p)r[o+p]=i[p];return e||JK(r)}function rWe(t){if(!XK(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=e&255,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=e&255,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=e&255,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=e&255,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=e&255,n}function Ift(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n>5]>>>r%32&255,a=parseInt(o.charAt(i>>>4&15)+o.charAt(i&15),16);e.push(a)}return e}function aWe(t){return(t+64>>>9<<4)+14+1}function kft(t,e){t[e>>5]|=128<>5]|=(t[o/8]&255)<>16)+(e>>16)+(n>>16);return o<<16|n&65535}function Wft(t,e){return t<>>32-e}function KK(t,e,n,o,r,i){return f8(Wft(f8(f8(e,t),f8(o,i)),r),n)}function Yf(t,e,n,o,r,i,a){return KK(e&n|~e&o,t,e,r,i,a)}function Of(t,e,n,o,r,i,a){return KK(e&o|n&~o,t,e,r,i,a)}function _f(t,e,n,o,r,i,a){return KK(e^n^o,t,e,r,i,a)}function Vf(t,e,n,o,r,i,a){return KK(n^(e|~o),t,e,r,i,a)}var Nft=iWe("v3",48,Eft);const Uft=Nft;function jft(t,e,n){t=t||{};var o=t.random||(t.rng||oWe)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,e){n=n||0;for(var r=0;r<16;++r)e[n+r]=o[r];return e}return JK(o)}function Bft(t,e,n,o){switch(t){case 0:return e&n^~e&o;case 1:return e^n^o;case 2:return e&n^e&o^n&o;case 3:return e^n^o}}function poe(t,e){return t<>>32-e}function Yft(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var o=unescape(encodeURIComponent(t));t=[];for(var r=0;r>>0;P=C,C=b,b=poe(w,30)>>>0,w=y,y=A}n[0]=n[0]+y>>>0,n[1]=n[1]+w>>>0,n[2]=n[2]+b>>>0,n[3]=n[3]+C>>>0,n[4]=n[4]+P>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var Oft=iWe("v5",80,Yft);const _ft=Oft,Vft="00000000-0000-0000-0000-000000000000";function Gft(t){if(!XK(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}const Xft=Object.freeze(Object.defineProperty({__proto__:null,NIL:Vft,parse:rWe,stringify:JK,v1:Mft,v3:Uft,v4:jft,v5:_ft,validate:XK,version:Gft},Symbol.toStringTag,{value:"Module"})),Jft=NFe(Xft);function f1e(t,e){if(!t||!e||!t.length||!e.length)throw new Error("Bad alphabet");this.srcAlphabet=t,this.dstAlphabet=e}f1e.prototype.convert=function(t){var e,n,o,r={},i=this.srcAlphabet.length,a=this.dstAlphabet.length,l=t.length,s=typeof t=="string"?"":[];if(!this.isValid(t))throw new Error('Number "'+t+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return t;for(e=0;e=a?(r[o++]=parseInt(n/a,10),n=n%a):o>0&&(r[o++]=0);l=o,s=this.dstAlphabet.slice(n,n+1).concat(s)}while(o!==0);return s};f1e.prototype.isValid=function(t){for(var e=0;e?@[]^_`{|}~",Zft={consistentLength:!0};let yoe;const BAe=(t,e,n)=>{const o=e(t.toLowerCase().replace(/-/g,""));return!n||!n.consistentLength?o:o.padStart(n.shortIdLength,n.paddingChar)},eht=(t,e)=>{const o=e(t).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[o[1],o[2],o[3],o[4],o[5]].join("-")},tht=t=>Math.ceil(Math.log(2**128)/Math.log(t));var nht=(()=>{const t=(e,n)=>{const o=e||moe,r={...Zft,...n};if([...new Set(Array.from(o))].length!==o.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const i=tht(o.length),a={shortIdLength:i,consistentLength:r.consistentLength,paddingChar:o[0]},l=sB(sB.HEX,o),s=sB(o,sB.HEX),c=()=>BAe(goe(),l,a),u={new:c,generate:c,uuid:goe,fromUUID:d=>BAe(d,l,a),toUUID:d=>eht(d,s),alphabet:o,maxLength:i};return Object.freeze(u),u};return t.constants={flickrBase58:moe,cookieBase90:Qft},t.uuid=goe,t.generate=()=>(yoe||(yoe=t(moe).generate),yoe()),t})();const Xi=Fi(nht);var lWe={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Ac,function(){var n=1e3,o=6e4,r=36e5,i="millisecond",a="second",l="minute",s="hour",c="day",u="week",d="month",f="quarter",p="year",g="date",y="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(j){var L=["th","st","nd","rd"],k=j%100;return"["+j+(L[(k-20)%10]||L[k]||L[0])+"]"}},P=function(j,L,k){var N=String(j);return!N||N.length>=L?j:""+Array(L+1-N.length).join(k)+j},v={s:P,z:function(j){var L=-j.utcOffset(),k=Math.abs(L),N=Math.floor(k/60),F=k%60;return(L<=0?"+":"-")+P(N,2,"0")+":"+P(F,2,"0")},m:function j(L,k){if(L.date()1)return j(O[0])}else{var B=L.name;A[B]=L,F=B}return!N&&F&&(T=F),F||!N&&T},M=function(j,L){if(S(j))return j.clone();var k=typeof L=="object"?L:{};return k.date=j,k.args=arguments,new E(k)},D=v;D.l=R,D.i=S,D.w=function(j,L){return M(j,{locale:L.$L,utc:L.$u,x:L.$x,$offset:L.$offset})};var E=function(){function j(k){this.$L=R(k.locale,null,!0),this.parse(k),this.$x=this.$x||k.x||{},this[x]=!0}var L=j.prototype;return L.parse=function(k){this.$d=function(N){var F=N.date,U=N.utc;if(F===null)return new Date(NaN);if(D.u(F))return new Date;if(F instanceof Date)return new Date(F);if(typeof F=="string"&&!/Z$/i.test(F)){var O=F.match(w);if(O){var B=O[2]-1||0,_=(O[7]||"0").substring(0,3);return U?new Date(Date.UTC(O[1],B,O[3]||1,O[4]||0,O[5]||0,O[6]||0,_)):new Date(O[1],B,O[3]||1,O[4]||0,O[5]||0,O[6]||0,_)}}return new Date(F)}(k),this.init()},L.init=function(){var k=this.$d;this.$y=k.getFullYear(),this.$M=k.getMonth(),this.$D=k.getDate(),this.$W=k.getDay(),this.$H=k.getHours(),this.$m=k.getMinutes(),this.$s=k.getSeconds(),this.$ms=k.getMilliseconds()},L.$utils=function(){return D},L.isValid=function(){return this.$d.toString()!==y},L.isSame=function(k,N){var F=M(k);return this.startOf(N)<=F&&F<=this.endOf(N)},L.isAfter=function(k,N){return M(k){let e;const n=new Set,o=(s,c)=>{const u=typeof s=="function"?s(e):s;if(!Object.is(u,e)){const d=e;e=c??typeof u!="object"?u:Object.assign({},e,u),n.forEach(f=>f(e,d))}},r=()=>e,l={setState:o,getState:r,subscribe:s=>(n.add(s),()=>n.delete(s)),destroy:()=>{(xft?"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."),n.clear()}};return e=t(o,r,l),l},bft=t=>t?jAe(t):jAe,{useDebugValue:Sft}=be,{useSyncExternalStoreWithSelector:Tft}=vft;function Pft(t,e=t.getState,n){const o=Tft(t.subscribe,t.getState,t.getServerState||t.getState,e,n);return Sft(o),o}const Cft=(t,e)=>{const n=bft(t),o=(r,i=e)=>Pft(n,r,i);return Object.assign(o,n),o},XK=(t,e)=>Cft;var sB,Rft=new Uint8Array(16);function rWe(){if(!sB&&(sB=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!sB))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return sB(Rft)}const Hft=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function JK(t){return typeof t=="string"&&Hft.test(t)}var tf=[];for(var uoe=0;uoe<256;++uoe)tf.push((uoe+256).toString(16).substr(1));function KK(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(tf[t[e+0]]+tf[t[e+1]]+tf[t[e+2]]+tf[t[e+3]]+"-"+tf[t[e+4]]+tf[t[e+5]]+"-"+tf[t[e+6]]+tf[t[e+7]]+"-"+tf[t[e+8]]+tf[t[e+9]]+"-"+tf[t[e+10]]+tf[t[e+11]]+tf[t[e+12]]+tf[t[e+13]]+tf[t[e+14]]+tf[t[e+15]]).toLowerCase();if(!JK(n))throw TypeError("Stringified UUID is invalid");return n}var BAe,doe,foe=0,hoe=0;function Mft(t,e,n){var o=e&&n||0,r=e||new Array(16);t=t||{};var i=t.node||BAe,a=t.clockseq!==void 0?t.clockseq:doe;if(i==null||a==null){var l=t.random||(t.rng||rWe)();i==null&&(i=BAe=[l[0]|1,l[1],l[2],l[3],l[4],l[5]]),a==null&&(a=doe=(l[6]<<8|l[7])&16383)}var s=t.msecs!==void 0?t.msecs:Date.now(),c=t.nsecs!==void 0?t.nsecs:hoe+1,u=s-foe+(c-hoe)/1e4;if(u<0&&t.clockseq===void 0&&(a=a+1&16383),(u<0||s>foe)&&t.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");foe=s,hoe=c,doe=a,s+=122192928e5;var d=((s&268435455)*1e4+c)%4294967296;r[o++]=d>>>24&255,r[o++]=d>>>16&255,r[o++]=d>>>8&255,r[o++]=d&255;var f=s/4294967296*1e4&268435455;r[o++]=f>>>8&255,r[o++]=f&255,r[o++]=f>>>24&15|16,r[o++]=f>>>16&255,r[o++]=a>>>8|128,r[o++]=a&255;for(var p=0;p<6;++p)r[o+p]=i[p];return e||KK(r)}function iWe(t){if(!JK(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=e&255,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=e&255,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=e&255,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=e&255,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=e&255,n}function Ift(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n>5]>>>r%32&255,a=parseInt(o.charAt(i>>>4&15)+o.charAt(i&15),16);e.push(a)}return e}function lWe(t){return(t+64>>>9<<4)+14+1}function kft(t,e){t[e>>5]|=128<>5]|=(t[o/8]&255)<>16)+(e>>16)+(n>>16);return o<<16|n&65535}function Wft(t,e){return t<>>32-e}function qK(t,e,n,o,r,i){return f8(Wft(f8(f8(e,t),f8(o,i)),r),n)}function Yf(t,e,n,o,r,i,a){return qK(e&n|~e&o,t,e,r,i,a)}function Of(t,e,n,o,r,i,a){return qK(e&o|n&~o,t,e,r,i,a)}function _f(t,e,n,o,r,i,a){return qK(e^n^o,t,e,r,i,a)}function Vf(t,e,n,o,r,i,a){return qK(n^(e|~o),t,e,r,i,a)}var Nft=aWe("v3",48,Eft);const Uft=Nft;function jft(t,e,n){t=t||{};var o=t.random||(t.rng||rWe)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,e){n=n||0;for(var r=0;r<16;++r)e[n+r]=o[r];return e}return KK(o)}function Bft(t,e,n,o){switch(t){case 0:return e&n^~e&o;case 1:return e^n^o;case 2:return e&n^e&o^n&o;case 3:return e^n^o}}function poe(t,e){return t<>>32-e}function Yft(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var o=unescape(encodeURIComponent(t));t=[];for(var r=0;r>>0;P=C,C=b,b=poe(w,30)>>>0,w=y,y=A}n[0]=n[0]+y>>>0,n[1]=n[1]+w>>>0,n[2]=n[2]+b>>>0,n[3]=n[3]+C>>>0,n[4]=n[4]+P>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var Oft=aWe("v5",80,Yft);const _ft=Oft,Vft="00000000-0000-0000-0000-000000000000";function Gft(t){if(!JK(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}const Xft=Object.freeze(Object.defineProperty({__proto__:null,NIL:Vft,parse:iWe,stringify:KK,v1:Mft,v3:Uft,v4:jft,v5:_ft,validate:JK,version:Gft},Symbol.toStringTag,{value:"Module"})),Jft=UFe(Xft);function f1e(t,e){if(!t||!e||!t.length||!e.length)throw new Error("Bad alphabet");this.srcAlphabet=t,this.dstAlphabet=e}f1e.prototype.convert=function(t){var e,n,o,r={},i=this.srcAlphabet.length,a=this.dstAlphabet.length,l=t.length,s=typeof t=="string"?"":[];if(!this.isValid(t))throw new Error('Number "'+t+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return t;for(e=0;e=a?(r[o++]=parseInt(n/a,10),n=n%a):o>0&&(r[o++]=0);l=o,s=this.dstAlphabet.slice(n,n+1).concat(s)}while(o!==0);return s};f1e.prototype.isValid=function(t){for(var e=0;e?@[]^_`{|}~",Zft={consistentLength:!0};let yoe;const YAe=(t,e,n)=>{const o=e(t.toLowerCase().replace(/-/g,""));return!n||!n.consistentLength?o:o.padStart(n.shortIdLength,n.paddingChar)},eht=(t,e)=>{const o=e(t).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[o[1],o[2],o[3],o[4],o[5]].join("-")},tht=t=>Math.ceil(Math.log(2**128)/Math.log(t));var nht=(()=>{const t=(e,n)=>{const o=e||moe,r={...Zft,...n};if([...new Set(Array.from(o))].length!==o.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const i=tht(o.length),a={shortIdLength:i,consistentLength:r.consistentLength,paddingChar:o[0]},l=cB(cB.HEX,o),s=cB(o,cB.HEX),c=()=>YAe(goe(),l,a),u={new:c,generate:c,uuid:goe,fromUUID:d=>YAe(d,l,a),toUUID:d=>eht(d,s),alphabet:o,maxLength:i};return Object.freeze(u),u};return t.constants={flickrBase58:moe,cookieBase90:Qft},t.uuid=goe,t.generate=()=>(yoe||(yoe=t(moe).generate),yoe()),t})();const Xi=Fi(nht);var sWe={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Ac,function(){var n=1e3,o=6e4,r=36e5,i="millisecond",a="second",l="minute",s="hour",c="day",u="week",d="month",f="quarter",p="year",g="date",y="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(j){var L=["th","st","nd","rd"],k=j%100;return"["+j+(L[(k-20)%10]||L[k]||L[0])+"]"}},P=function(j,L,k){var N=String(j);return!N||N.length>=L?j:""+Array(L+1-N.length).join(k)+j},v={s:P,z:function(j){var L=-j.utcOffset(),k=Math.abs(L),N=Math.floor(k/60),F=k%60;return(L<=0?"+":"-")+P(N,2,"0")+":"+P(F,2,"0")},m:function j(L,k){if(L.date()1)return j(O[0])}else{var B=L.name;A[B]=L,F=B}return!N&&F&&(T=F),F||!N&&T},M=function(j,L){if(S(j))return j.clone();var k=typeof L=="object"?L:{};return k.date=j,k.args=arguments,new E(k)},D=v;D.l=R,D.i=S,D.w=function(j,L){return M(j,{locale:L.$L,utc:L.$u,x:L.$x,$offset:L.$offset})};var E=function(){function j(k){this.$L=R(k.locale,null,!0),this.parse(k),this.$x=this.$x||k.x||{},this[x]=!0}var L=j.prototype;return L.parse=function(k){this.$d=function(N){var F=N.date,U=N.utc;if(F===null)return new Date(NaN);if(D.u(F))return new Date;if(F instanceof Date)return new Date(F);if(typeof F=="string"&&!/Z$/i.test(F)){var O=F.match(w);if(O){var B=O[2]-1||0,_=(O[7]||"0").substring(0,3);return U?new Date(Date.UTC(O[1],B,O[3]||1,O[4]||0,O[5]||0,O[6]||0,_)):new Date(O[1],B,O[3]||1,O[4]||0,O[5]||0,O[6]||0,_)}}return new Date(F)}(k),this.init()},L.init=function(){var k=this.$d;this.$y=k.getFullYear(),this.$M=k.getMonth(),this.$D=k.getDate(),this.$W=k.getDay(),this.$H=k.getHours(),this.$m=k.getMinutes(),this.$s=k.getSeconds(),this.$ms=k.getMilliseconds()},L.$utils=function(){return D},L.isValid=function(){return this.$d.toString()!==y},L.isSame=function(k,N){var F=M(k);return this.startOf(N)<=F&&F<=this.endOf(N)},L.isAfter=function(k,N){return M(k)=j)return Be(!0)}else for(pe=N,N++;;){if((pe=U.indexOf(R,pe+1))===-1)return B||te.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:q.length,index:N}),Pe();if(pe===_-1)return Pe(U.substring(N,pe).replace(ce,R));if(R!==k||U[pe+1]!==k){if(R===k||pe===0||U[pe-1]!==k){Ie!==-1&&Ie=j)return Be(!0);break}te.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:q.length,index:N}),pe++}}else pe++}return Pe();function Te(We){q.push(We),ae=N}function Me(We){var Ke=0;if(We!==-1){var Ne=U.substring(pe+1,We);Ne&&Ne.trim()===""&&(Ke=Ne.length)}return Ke}function Pe(We){return B||(We===void 0&&(We=U.substring(N)),re.push(We),N=_,Te(re),le&&Je()),Be()}function Ee(We){N=We,Te(re),re=[],ye=U.indexOf(D,N)}function Be(We){return{data:q,errors:te,meta:{delimiter:M,linebreak:D,aborted:F,truncated:!!We,cursor:ae+(O||0)}}}function Je(){W(Be()),q=[],te=[]}},this.abort=function(){F=!0},this.getCharIndex=function(){return N}}function C(S){var R=S.data,M=a[R.workerId],D=!1;if(R.error)M.userError(R.error,R.file);else if(R.results&&R.results.data){var E={abort:function(){D=!0,P(R.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:v,resume:v};if(x(M.userStep)){for(var W=0;W1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||iht,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),o=0;o{this.observers[o]||(this.observers[o]=new Map);const r=this.observers[o].get(n)||0;this.observers[o].set(n,r+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r{let[l,s]=a;for(let c=0;c{let[l,s]=a;for(let c=0;c{t=o,e=r});return n.resolve=t,n.reject=e,n}function YAe(t){return t==null?"":""+t}function lht(t,e,n){t.forEach(o=>{e[o]&&(n[o]=e[o])})}const sht=/###/g;function sE(t,e,n){function o(l){return l&&l.indexOf("###")>-1?l.replace(sht,"."):l}function r(){return!t||typeof t=="string"}const i=typeof e!="string"?e:e.split(".");let a=0;for(;a":">",'"':""","'":"'","/":"/"};function fht(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,e=>dht[e]):t}class hht{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const o=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,o),this.regExpQueue.push(e),o}}const pht=[" ",",","?","!",";"],ght=new hht(20);function mht(t,e,n){e=e||"",n=n||"";const o=pht.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(o.length===0)return!0;const r=ght.getRegExp(`(${o.map(a=>a==="?"?"\\?":a).join("|")})`);let i=!r.test(t);if(!i){const a=t.indexOf(n);a>0&&!r.test(t.substring(0,a))&&(i=!0)}return i}function Dse(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const o=e.split(n);let r=t;for(let i=0;i-1&&s0?t.replace("_","-"):t}class _Ae extends qK{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,a=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;e.indexOf(".")>-1?l=e.split("."):(l=[e,n],o&&(Array.isArray(o)?l.push(...o):typeof o=="string"&&i?l.push(...o.split(i)):l.push(o)));const s=_V(this.data,l);return!s&&!n&&!o&&e.indexOf(".")>-1&&(e=l[0],n=l[1],o=l.slice(2).join(".")),s||!a||typeof o!="string"?s:Dse(this.data&&this.data[e]&&this.data[e][n],o,i)}addResource(e,n,o,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let l=[e,n];o&&(l=l.concat(a?o.split(a):o)),e.indexOf(".")>-1&&(l=e.split("."),r=n,n=l[1]),this.addNamespaces(n),OAe(this.data,l,r),i.silent||this.emit("added",e,n,o,r)}addResources(e,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in o)(typeof o[i]=="string"||Object.prototype.toString.apply(o[i])==="[object Array]")&&this.addResource(e,n,i,o[i],{silent:!0});r.silent||this.emit("added",e,n,o)}addResourceBundle(e,n,o,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},l=[e,n];e.indexOf(".")>-1&&(l=e.split("."),r=o,o=n,n=l[1]),this.addNamespaces(n);let s=_V(this.data,l)||{};a.skipCopy||(o=JSON.parse(JSON.stringify(o))),r?cWe(s,o,i):s={...s,...o},OAe(this.data,l,s),a.silent||this.emit("added",e,n,o)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,n)}:this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var uWe={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,o,r){return t.forEach(i=>{this.processors[i]&&(e=this.processors[i].process(e,n,o,r))}),e}};const VAe={};class GV extends qK{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),lht(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=p9.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const o=this.resolve(e,n);return o&&o.res!==void 0}extractFromKey(e,n){let o=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const a=o&&e.indexOf(o)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!mht(e,o,r);if(a&&!l){const s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:i};const c=e.split(o);(o!==r||o===r&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(r)}return typeof i=="string"&&(i=[i]),{key:e,namespaces:i}}translate(e,n,o){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const r=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(e[e.length-1],n),s=l[l.length-1],c=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(u){const v=n.nsSeparator||this.options.nsSeparator;return r?{res:`${s}${v}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:s,usedParams:this.getUsedParamsDetails(n)}:`${s}${v}${a}`}return r?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:s,usedParams:this.getUsedParamsDetails(n)}:a}const d=this.resolve(e,n);let f=d&&d.res;const p=d&&d.usedKey||a,g=d&&d.exactUsedKey||a,y=Object.prototype.toString.apply(f),w=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject;if(C&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&w.indexOf(y)<0&&!(typeof b=="string"&&y==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const v=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,f,{...n,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return r?(d.res=v,d.usedParams=this.getUsedParamsDetails(n),d):v}if(i){const v=y==="[object Array]",T=v?[]:{},A=v?g:p;for(const x in f)if(Object.prototype.hasOwnProperty.call(f,x)){const S=`${A}${i}${x}`;T[x]=this.translate(S,{...n,joinArrays:!1,ns:l}),T[x]===S&&(T[x]=f[x])}f=T}}else if(C&&typeof b=="string"&&y==="[object Array]")f=f.join(b),f&&(f=this.extendTranslation(f,e,n,o));else{let v=!1,T=!1;const A=n.count!==void 0&&typeof n.count!="string",x=GV.hasDefaultValue(n),S=A?this.pluralResolver.getSuffix(c,n.count,n):"",R=n.ordinal&&A?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",M=A&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),D=M&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${S}`]||n[`defaultValue${R}`]||n.defaultValue;!this.isValidLookup(f)&&x&&(v=!0,f=D),this.isValidLookup(f)||(T=!0,f=a);const W=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&T?void 0:f,j=x&&D!==f&&this.options.updateMissing;if(T||v||j){if(this.logger.log(j?"updateKey":"missingKey",c,s,a,j?D:f),i){const F=this.resolve(a,{...n,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let L=[];const k=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&k&&k[0])for(let F=0;F{const B=x&&O!==f?O:W;this.options.missingKeyHandler?this.options.missingKeyHandler(F,s,U,B,j,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(F,s,U,B,j,n),this.emit("missingKey",F,s,U,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?L.forEach(F=>{const U=this.pluralResolver.getSuffixes(F,n);M&&n[`defaultValue${this.options.pluralSeparator}zero`]&&U.indexOf(`${this.options.pluralSeparator}zero`)<0&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(O=>{N([F],a+O,n[`defaultValue${O}`]||D)})}):N(L,a,D))}f=this.extendTranslation(f,e,n,d,o),T&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${s}:${a}`),(T||v)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${s}:${a}`:a,v?f:void 0):f=this.options.parseMissingKeyHandler(f))}return r?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(e,n,o,r,i){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const c=typeof e=="string"&&(o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(c){const f=e.match(this.interpolator.nestingRegexp);u=f&&f.length}let d=o.replace&&typeof o.replace!="string"?o.replace:o;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,o.lng||this.language,o),c){const f=e.match(this.interpolator.nestingRegexp),p=f&&f.length;u1&&arguments[1]!==void 0?arguments[1]:{},o,r,i,a,l;return typeof e=="string"&&(e=[e]),e.forEach(s=>{if(this.isValidLookup(o))return;const c=this.extractFromKey(s,n),u=c.key;r=u;let d=c.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",p=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),g=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(w=>{this.isValidLookup(o)||(l=w,!VAe[`${y[0]}-${w}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(VAe[`${y[0]}-${w}`]=!0,this.logger.warn(`key "${r}" for languages "${y.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(b=>{if(this.isValidLookup(o))return;a=b;const C=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(C,u,b,w,n);else{let v;f&&(v=this.pluralResolver.getSuffix(b,n.count,n));const T=`${this.options.pluralSeparator}zero`,A=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(C.push(u+v),n.ordinal&&v.indexOf(A)===0&&C.push(u+v.replace(A,this.options.pluralSeparator)),p&&C.push(u+T)),g){const x=`${u}${this.options.contextSeparator}${n.context}`;C.push(x),f&&(C.push(x+v),n.ordinal&&v.indexOf(A)===0&&C.push(x+v.replace(A,this.options.pluralSeparator)),p&&C.push(x+T))}}let P;for(;P=C.pop();)this.isValidLookup(o)||(i=P,o=this.getResource(b,w,P,n))}))})}),{res:o,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:l}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,o,r):this.resourceStore.getResource(e,n,o,r)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=e.replace&&typeof e.replace!="string";let r=o?e.replace:e;if(o&&typeof e.count<"u"&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!o){r={...r};for(const i of n)delete r[i]}return r}static hasDefaultValue(e){const n="defaultValue";for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&n===o.substring(0,n.length)&&e[o]!==void 0)return!0;return!1}}function Aoe(t){return t.charAt(0).toUpperCase()+t.slice(1)}class GAe{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=p9.create("languageUtils")}getScriptPartFromCode(e){if(e=VV(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=VV(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let o=e.split("-");return this.options.lowerCaseLng?o=o.map(r=>r.toLowerCase()):o.length===2?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),n.indexOf(o[1].toLowerCase())>-1&&(o[1]=Aoe(o[1].toLowerCase()))):o.length===3&&(o[0]=o[0].toLowerCase(),o[1].length===2&&(o[1]=o[1].toUpperCase()),o[0]!=="sgn"&&o[2].length===2&&(o[2]=o[2].toUpperCase()),n.indexOf(o[1].toLowerCase())>-1&&(o[1]=Aoe(o[1].toLowerCase())),n.indexOf(o[2].toLowerCase())>-1&&(o[2]=Aoe(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(o=>{if(n)return;const r=this.formatLanguageCode(o);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&e.forEach(o=>{if(n)return;const r=this.getLanguagePartFromCode(o);if(this.isSupportedCode(r))return n=r;n=this.options.supportedLngs.find(i=>{if(i===r)return i;if(!(i.indexOf("-")<0&&r.indexOf("-")<0)&&(i.indexOf("-")>0&&r.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===r||i.indexOf(r)===0&&r.length>1))return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),typeof e=="string"&&(e=[e]),Object.prototype.toString.apply(e)==="[object Array]")return e;if(!n)return e.default||[];let o=e[n];return o||(o=e[this.getScriptPartFromCode(n)]),o||(o=e[this.formatLanguageCode(n)]),o||(o=e[this.getLanguagePartFromCode(n)]),o||(o=e.default),o||[]}toResolveHierarchy(e,n){const o=this.getFallbackCodes(n||this.options.fallbackLng||[],e),r=[],i=a=>{a&&(this.isSupportedCode(a)?r.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):typeof e=="string"&&i(this.formatLanguageCode(e)),o.forEach(a=>{r.indexOf(a)<0&&i(this.formatLanguageCode(a))}),r}}let yht=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Aht={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},5:function(t){return t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},6:function(t){return t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}};const wht=["v1","v2","v3"],vht=["v4"],XAe={zero:0,one:1,two:2,few:3,many:4,other:5};function xht(){const t={};return yht.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:Aht[e.fc]}})}),t}class bht{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=p9.create("pluralResolver"),(!this.options.compatibilityJSON||vht.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=xht()}addRule(e,n){this.rules[e]=n}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(VV(e==="dev"?"en":e),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=this.getRule(e,n);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}getPluralFormsOfKey(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,o).map(r=>`${n}${r}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=this.getRule(e,n);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort((r,i)=>XAe[r]-XAe[i]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):o.numbers.map(r=>this.getSuffix(e,r,n)):[]}getSuffix(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=this.getRule(e,o);return r?this.shouldUseIntlApi()?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:this.getSuffixRetroCompatible(r,n):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,n){const o=e.noAbs?e.plurals(n):e.plurals(Math.abs(n));let r=e.numbers[o];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(r===2?r="plural":r===1&&(r=""));const i=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return this.options.compatibilityJSON==="v1"?r===1?"":typeof r=="number"?`_plural_${r.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}shouldUseIntlApi(){return!wht.includes(this.options.compatibilityJSON)}}function JAe(t,e,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=uht(t,e,n);return!i&&r&&typeof n=="string"&&(i=Dse(t,n,o),i===void 0&&(i=Dse(e,n,o))),i}class Sht{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=p9.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const n=e.interpolation;this.escape=n.escape!==void 0?n.escape:fht,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?ZS(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?ZS(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?ZS(n.nestingPrefix):n.nestingPrefixEscaped||ZS("$t("),this.nestingSuffix=n.nestingSuffix?ZS(n.nestingSuffix):n.nestingSuffixEscaped||ZS(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,o)=>n&&n.source===o?(n.lastIndex=0,n):new RegExp(o,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,o,r){let i,a,l;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(g){return g.replace(/\$/g,"$$$$")}const u=g=>{if(g.indexOf(this.formatSeparator)<0){const C=JAe(n,s,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,o,{...r,...n,interpolationkey:g}):C}const y=g.split(this.formatSeparator),w=y.shift().trim(),b=y.join(this.formatSeparator).trim();return this.format(JAe(n,s,w,this.options.keySeparator,this.options.ignoreJSONStructure),b,o,{...r,...n,interpolationkey:w})};this.resetRegExp();const d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>c(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?c(this.escape(g)):c(g)}].forEach(g=>{for(l=0;i=g.regex.exec(e);){const y=i[1].trim();if(a=u(y),a===void 0)if(typeof d=="function"){const b=d(e,i,r);a=typeof b=="string"?b:""}else if(r&&Object.prototype.hasOwnProperty.call(r,y))a="";else if(f){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=YAe(a));const w=g.safeValue(a);if(e=e.replace(i[0],w),f?(g.regex.lastIndex+=a.length,g.regex.lastIndex-=i[0].length):g.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),e}nest(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,i,a;function l(s,c){const u=this.nestingOptionsSeparator;if(s.indexOf(u)<0)return s;const d=s.split(new RegExp(`${u}[ ]*{`));let f=`{${d[1]}`;s=d[0],f=this.interpolate(f,a);const p=f.match(/'/g),g=f.match(/"/g);(p&&p.length%2===0&&!g||g.length%2!==0)&&(f=f.replace(/'/g,'"'));try{a=JSON.parse(f),c&&(a={...c,...a})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${s}`,y),`${s}${u}${f}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,s}for(;r=this.nestingRegexp.exec(e);){let s=[];a={...o},a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(r[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(r[1])){const u=r[1].split(this.formatSeparator).map(d=>d.trim());r[1]=u.shift(),s=u,c=!0}if(i=n(l.call(this,r[1].trim(),a),a),i&&r[0]===e&&typeof i!="string")return i;typeof i!="string"&&(i=YAe(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),i=""),c&&(i=s.reduce((u,d)=>this.format(u,d,o.lng,{...o,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}}function Tht(t){let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const o=t.split("(");e=o[0].toLowerCase().trim();const r=o[1].substring(0,o[1].length-1);e==="currency"&&r.indexOf(":")<0?n.currency||(n.currency=r.trim()):e==="relativetime"&&r.indexOf(":")<0?n.range||(n.range=r.trim()):r.split(";").forEach(a=>{if(!a)return;const[l,...s]=a.split(":"),c=s.join(":").trim().replace(/^'+|'+$/g,"");n[l.trim()]||(n[l.trim()]=c),c==="false"&&(n[l.trim()]=!1),c==="true"&&(n[l.trim()]=!0),isNaN(c)||(n[l.trim()]=parseInt(c,10))})}return{formatName:e,formatOptions:n}}function eT(t){const e={};return function(o,r,i){const a=r+JSON.stringify(i);let l=e[a];return l||(l=t(VV(r),i),e[a]=l),l(o)}}class Pht{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=p9.create("formatter"),this.options=e,this.formats={number:eT((n,o)=>{const r=new Intl.NumberFormat(n,{...o});return i=>r.format(i)}),currency:eT((n,o)=>{const r=new Intl.NumberFormat(n,{...o,style:"currency"});return i=>r.format(i)}),datetime:eT((n,o)=>{const r=new Intl.DateTimeFormat(n,{...o});return i=>r.format(i)}),relativetime:eT((n,o)=>{const r=new Intl.RelativeTimeFormat(n,{...o});return i=>r.format(i,o.range||"day")}),list:eT((n,o)=>{const r=new Intl.ListFormat(n,{...o});return i=>r.format(i)})},this.init(e)}init(e){const o=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=eT(n)}format(e,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((l,s)=>{const{formatName:c,formatOptions:u}=Tht(s);if(this.formats[c]){let d=l;try{const f=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},p=f.locale||f.lng||r.locale||r.lng||o;d=this.formats[c](l,p,{...u,...r,...f})}catch(f){this.logger.warn(f)}return d}else this.logger.warn(`there was no format function for ${c}`);return l},e)}}function Cht(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}class Rht extends qK{constructor(e,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=o,this.languageUtils=o.languageUtils,this.options=r,this.logger=p9.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(o,r.backend,r)}queueLoad(e,n,o,r){const i={},a={},l={},s={};return e.forEach(c=>{let u=!0;n.forEach(d=>{const f=`${c}|${d}`;!o.reload&&this.store.hasResourceBundle(c,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?a[f]===void 0&&(a[f]=!0):(this.state[f]=1,u=!1,a[f]===void 0&&(a[f]=!0),i[f]===void 0&&(i[f]=!0),s[d]===void 0&&(s[d]=!0)))}),u||(l[c]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(s)}}loaded(e,n,o){const r=e.split("|"),i=r[0],a=r[1];n&&this.emit("failedLoading",i,a,n),o&&this.store.addResourceBundle(i,a,o,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2;const l={};this.queue.forEach(s=>{cht(s.loaded,[i],a),Cht(s,e),n&&s.errors.push(n),s.pendingCount===0&&!s.done&&(Object.keys(s.loaded).forEach(c=>{l[c]||(l[c]={});const u=s.loaded[c];u.length&&u.forEach(d=>{l[c][d]===void 0&&(l[c][d]=!0)})}),s.done=!0,s.errors.length?s.callback(s.errors):s.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(s=>!s.done)}read(e,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:o,tried:r,wait:i,callback:a});return}this.readingCalls++;const l=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(c&&u&&r{this.read.call(this,e,n,o,r+1,i*2,a)},i);return}a(c,u)},s=this.backend[o].bind(this.backend);if(s.length===2){try{const c=s(e,n);c&&typeof c.then=="function"?c.then(u=>l(null,u)).catch(l):l(null,c)}catch(c){l(c)}return}return s(e,n,l)}prepareLoading(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof n=="string"&&(n=[n]);const i=this.queueLoad(e,n,o,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(a=>{this.loadOne(a)})}load(e,n,o){this.prepareLoading(e,n,{},o)}reload(e,n,o){this.prepareLoading(e,n,{reload:!0},o)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const o=e.split("|"),r=o[0],i=o[1];this.read(r,i,"read",void 0,void 0,(a,l)=>{a&&this.logger.warn(`${n}loading namespace ${i} for language ${r} failed`,a),!a&&l&&this.logger.log(`${n}loaded namespace ${i} for language ${r}`,l),this.loaded(e,a,l)})}saveMissing(e,n,o,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${o}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(o==null||o==="")){if(this.backend&&this.backend.create){const s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(e,n,o,r,s):u=c(e,n,o,r),u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}else c(e,n,o,r,l,s)}!e||!e[0]||this.store.addResource(e[0],n,o,r)}}}function KAe(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let n={};if(typeof e[1]=="object"&&(n=e[1]),typeof e[1]=="string"&&(n.defaultValue=e[1]),typeof e[2]=="string"&&(n.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const o=e[3]||e[2];Object.keys(o).forEach(r=>{n[r]=o[r]})}return n},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function qAe(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function uB(){}function Hht(t){Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})}class AF extends qK{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=qAe(e),this.services={},this.logger=p9,this.modules={external:[]},Hht(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(o=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const r=KAe();this.options={...r,...this.options,...qAe(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function i(u){return u?typeof u=="function"?new u:u:null}if(!this.options.isClone){this.modules.logger?p9.init(i(this.modules.logger),this.options):p9.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=Pht);const d=new GAe(this.options);this.store=new _Ae(this.options.resources,this.options);const f=this.services;f.logger=p9,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new bht(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=i(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Sht(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Rht(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(p){for(var g=arguments.length,y=new Array(g>1?g-1:0),w=1;w1?g-1:0),w=1;w{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,o||(o=uB),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=function(){return e.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return e.store[u](...arguments),e}});const s=fz(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(f),o(d,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),s}loadResources(e){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:uB;const r=typeof e=="string"?e:this.language;if(typeof e=="function"&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&r.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return o();const i=[],a=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(c=>{c!=="cimode"&&i.indexOf(c)<0&&i.push(c)})};r?a(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(s=>a(s)),this.options.preload&&this.options.preload.forEach(l=>a(l)),this.services.backendConnector.load(i,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),o(l)})}else o(null)}reloadResources(e,n,o){const r=fz();return e||(e=this.languages),n||(n=this.options.ns),o||(o=uB),this.services.backendConnector.reload(e,n,i=>{r.resolve(),o(i)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&uWe.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}}changeLanguage(e,n){var o=this;this.isLanguageChangingTo=e;const r=fz();this.emit("languageChanging",e);const i=s=>{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},a=(s,c)=>{c?(i(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,r.resolve(function(){return o.t(...arguments)}),n&&n(s,function(){return o.t(...arguments)})},l=s=>{!e&&!s&&this.services.languageDetector&&(s=[]);const c=typeof s=="string"?s:this.services.languageUtils.getBestMatchFromCodes(s);c&&(this.language||i(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,u=>{a(u,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(e),r}getFixedT(e,n,o){var r=this;const i=function(a,l){let s;if(typeof l!="object"){for(var c=arguments.length,u=new Array(c>2?c-2:0),d=2;d`${s.keyPrefix}${f}${g}`):p=s.keyPrefix?`${s.keyPrefix}${f}${a}`:a,r.t(p,s)};return typeof e=="string"?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=o,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const o=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;const a=(l,s)=>{const c=this.services.backendConnector.state[`${l}|${s}`];return c===-1||c===2};if(n.precheck){const l=n.precheck(this,a);if(l!==void 0)return l}return!!(this.hasResourceBundle(o,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(o,e)&&(!r||a(i,e)))}loadNamespaces(e,n){const o=fz();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(r=>{this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}),this.loadResources(r=>{o.resolve(),n&&n(r)}),o):(n&&n(),Promise.resolve())}loadLanguages(e,n){const o=fz();typeof e=="string"&&(e=[e]);const r=this.options.preload||[],i=e.filter(a=>r.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return i.length?(this.options.preload=r.concat(i),this.loadResources(a=>{o.resolve(),n&&n(a)}),o):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],o=this.services&&this.services.languageUtils||new GAe(KAe());return n.indexOf(o.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new AF(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:uB;const o=e.forkResourceStore;o&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},i=new AF(r);return(e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(l=>{i[l]=this[l]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},o&&(i.store=new _Ae(this.store.data,r),i.services.resourceStore=i.store),i.translator=new GV(i.services,r),i.translator.on("*",function(l){for(var s=arguments.length,c=new Array(s>1?s-1:0),u=1;u()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}};function QAe(t,e,n){t.loadNamespaces(e,dWe(t,n))}function ZAe(t,e,n,o){typeof n=="string"&&(n=[n]),n.forEach(r=>{t.options.ns.indexOf(r)<0&&t.options.ns.push(r)}),t.loadLanguages(e,dWe(t,o))}function Iht(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=e.languages[0],r=e.options?e.options.fallbackLng:!1,i=e.languages[e.languages.length-1];if(o.toLowerCase()==="cimode")return!0;const a=(l,s)=>{const c=e.services.backendConnector.state[`${l}|${s}`];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!a(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(o,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||a(o,t)&&(!r||a(i,t)))}function zht(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(Ese("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,t))return!1}}):Iht(t,e,n)}const Dht=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Eht={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Fht=t=>Eht[t],kht=t=>t.replace(Dht,Fht);let Fse={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:kht};function Lht(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fse={...Fse,...t}}function Wht(){return Fse}let fWe;function Nht(t){fWe=t}function Uht(){return fWe}const jht={type:"3rdParty",init(t){Lht(t.options.react),Nht(t)}},Bht=m.createContext();class Yht{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Oht=(t,e)=>{const n=m.useRef();return m.useEffect(()=>{n.current=t},[t,e]),n.current};function Vl(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=e,{i18n:o,defaultNS:r}=m.useContext(Bht)||{},i=n||o||Uht();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new Yht),!i){Ese("You will need to pass in an i18next instance by using initReactI18next");const P=(T,A)=>typeof A=="string"?A:A&&typeof A=="object"&&typeof A.defaultValue=="string"?A.defaultValue:Array.isArray(T)?T[T.length-1]:T,v=[P,{},!1];return v.t=P,v.i18n={},v.ready=!1,v}i.options.react&&i.options.react.wait!==void 0&&Ese("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...Wht(),...i.options.react,...e},{useSuspense:l,keyPrefix:s}=a;let c=r||i.options&&i.options.defaultNS;c=typeof c=="string"?[c]:c||["translation"],i.reportNamespaces.addUsedNamespaces&&i.reportNamespaces.addUsedNamespaces(c);const u=(i.isInitialized||i.initializedStoreOnce)&&c.every(P=>zht(P,i,a));function d(){return i.getFixedT(e.lng||null,a.nsMode==="fallback"?c:c[0],s)}const[f,p]=m.useState(d);let g=c.join();e.lng&&(g=`${e.lng}${g}`);const y=Oht(g),w=m.useRef(!0);m.useEffect(()=>{const{bindI18n:P,bindI18nStore:v}=a;w.current=!0,!u&&!l&&(e.lng?ZAe(i,e.lng,c,()=>{w.current&&p(d)}):QAe(i,c,()=>{w.current&&p(d)})),u&&y&&y!==g&&w.current&&p(d);function T(){w.current&&p(d)}return P&&i&&i.on(P,T),v&&i&&i.store.on(v,T),()=>{w.current=!1,P&&i&&P.split(" ").forEach(A=>i.off(A,T)),v&&i&&v.split(" ").forEach(A=>i.store.off(A,T))}},[i,g]);const b=m.useRef(!0);m.useEffect(()=>{w.current&&!b.current&&p(d),b.current=!1},[i,s]);const C=[f,i,u];if(C.t=f,C.i18n=i,C.ready=u,u||!u&&!l)return C;throw new Promise(P=>{e.lng?ZAe(i,e.lng,c,()=>P()):QAe(i,c,()=>P())})}function _ht(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wF(t){"@babel/helpers - typeof";return wF=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},wF(t)}function Vht(t,e){if(wF(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(wF(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Ght(t){var e=Vht(t,"string");return wF(e)==="symbol"?e:String(e)}function Xht(t,e){for(var n=0;n0){var l=r.maxAge-0;if(Number.isNaN(l))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(l))}if(r.domain){if(!e4e.test(r.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(r.domain)}if(r.path){if(!e4e.test(r.path))throw new TypeError("option path is invalid");a+="; Path=".concat(r.path)}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(r.expires.toUTCString())}if(r.httpOnly&&(a+="; HttpOnly"),r.secure&&(a+="; Secure"),r.sameSite){var s=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(s){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},t4e={create:function(e,n,o,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};o&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+o*60*1e3)),r&&(i.domain=r),document.cookie=Qht(e,encodeURIComponent(n),i)},read:function(e){for(var n="".concat(e,"="),o=document.cookie.split(";"),r=0;r-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));for(var r=o.substring(1),i=r.split("&"),a=0;a0){var s=i[a].substring(0,l);s===e.lookupQuerystring&&(n=i[a].substring(l+1))}}}return n}},hz=null,n4e=function(){if(hz!==null)return hz;try{hz=window!=="undefined"&&window.localStorage!==null;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{hz=!1}return hz},tpt={name:"localStorage",lookup:function(e){var n;if(e.lookupLocalStorage&&n4e()){var o=window.localStorage.getItem(e.lookupLocalStorage);o&&(n=o)}return n},cacheUserLanguage:function(e,n){n.lookupLocalStorage&&n4e()&&window.localStorage.setItem(n.lookupLocalStorage,e)}},pz=null,o4e=function(){if(pz!==null)return pz;try{pz=window!=="undefined"&&window.sessionStorage!==null;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{pz=!1}return pz},npt={name:"sessionStorage",lookup:function(e){var n;if(e.lookupSessionStorage&&o4e()){var o=window.sessionStorage.getItem(e.lookupSessionStorage);o&&(n=o)}return n},cacheUserLanguage:function(e,n){n.lookupSessionStorage&&o4e()&&window.sessionStorage.setItem(n.lookupSessionStorage,e)}},opt={name:"navigator",lookup:function(e){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var o=0;o0?n:void 0}},rpt={name:"htmlTag",lookup:function(e){var n,o=e.htmlTag||(typeof document<"u"?document.documentElement:null);return o&&typeof o.getAttribute=="function"&&(n=o.getAttribute("lang")),n}},ipt={name:"path",lookup:function(e){var n;if(typeof window<"u"){var o=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(o instanceof Array)if(typeof e.lookupFromPathIndex=="number"){if(typeof o[e.lookupFromPathIndex]!="string")return;n=o[e.lookupFromPathIndex].replace("/","")}else n=o[0].replace("/","")}return n}},apt={name:"subdomain",lookup:function(e){var n=typeof e.lookupFromSubdomainIndex=="number"?e.lookupFromSubdomainIndex+1:1,o=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(o)return o[n]}};function lpt(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(e){return e}}}var pWe=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_ht(this,t),this.type="languageDetector",this.detectors={},this.init(e,n)}return Jht(t,[{key:"init",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n||{languageUtils:{}},this.options=$ht(o,this.options||{},lpt()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(i){return i.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Zht),this.addDetector(ept),this.addDetector(tpt),this.addDetector(npt),this.addDetector(opt),this.addDetector(rpt),this.addDetector(ipt),this.addDetector(apt)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var o=this;n||(n=this.options.order);var r=[];return n.forEach(function(i){if(o.detectors[i]){var a=o.detectors[i].lookup(o.options);a&&typeof a=="string"&&(a=[a]),a&&(r=r.concat(a))}}),r=r.map(function(i){return o.options.convertDetectedLanguage(i)}),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}},{key:"cacheUserLanguage",value:function(n,o){var r=this;o||(o=this.options.caches),o&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||o.forEach(function(i){r.detectors[i]&&r.detectors[i].cacheUserLanguage(n,r.options)}))}}]),t}();pWe.type="languageDetector";const spt={translation:{name:{IFI:"Institute for Future Intelligence",Aladdin:"Aladdin",Tagline:"Aladdin: Reimagining Design with Explainable AI — Institute for Future Intelligence"},cookie:{Statement:"By clicking Accept, you agree to our use of cookies to improve your experience with Aladdin.",Accept:"Accept"},aboutUs:{ProductBroughtToYouBy:"This product is brought to you by",TermsOfService:"Terms of Service",PrivacyPolicy:"Privacy Policy",Software:"Software",Content:"Content",Research:"Research",Support:"Support",Acknowledgment:"Acknowledgment",FundingInformation:"The National Science Foundation (NSF) generously provided funding for the research and development of this product through grants #2105695, #2131097, and #2301164. Any opinions, findings, and conclusions or recommendations expressed in this product, however, are those of the authors and do not necessarily reflect the views of NSF.",Contact:"For more information, please contact Charles Xie (charles@intofuture.org).",Translators:"Translators"},word:{Refresh:"Refresh",LastUpdate:"Last Update",Small:"Small",Medium:"Medium",Large:"Large",Design:"Design",Information:"Information",Type:"Type",Text:"Text",FontSize:"Font Size",FontColor:"Font Color",Model:"Model",Models:"Models",Upload:"Upload",ClickCount:"Click Count",Share:"Share",AlreadyLike:"Already like",Like:"Like",MustLogInToLike:"Must log in to like",AllRightsReserved:"All Rights Reserved",MeterAbbreviation:"m",Version:"Version",VersionInitial:"V",Options:"Options",Maximum:"Maximum",Minimum:"Minimum",MaximumNumber:"Maximum Number",MinimumNumber:"Minimum Number",MaximumValue:"Maximum Value",MinimumValue:"Minimum Value",Or:"Or",None:"None",High:"High",Partial:"Partial",Teacher:"Teacher",Class:"Class",Total:"Total",Leaderboard:"Leaderboard",Latest:"Latest",Range:"Range",SIUnit:"SI Unit",USUnit:"US Unit",ThermalTransmittance:"Thermal Transmittance",ThermalResistance:"Thermal Resistance",UValue:"U-Value",RValue:"R-Value",VolumetricHeatCapacity:"Volumetric Heat Capacity",BuildingHVACSystem:"Building HVAC System",ThermostatSetpoint:"Thermostat Setpoint",TemperatureToleranceThreshold:"Tolerance Threshold",TemperatureToleranceThresholdExplanation:`Heater will not run if the lowest outside temperature of the day is higher than the setpoint minus this threshold. +`);var N=0,F=!1;this.parse=function(U,O,B){if(typeof U!="string")throw new Error("Input must be a string");var _=U.length,X=M.length,$=D.length,Q=E.length,le=x(W),q=[],te=[],re=[],ae=N=0;if(!U)return Be();if(S.header&&!O){var se=U.split(D)[0].split(M),ne=[],fe={},ge=!1;for(var de in se){var Z=se[de];x(S.transformHeader)&&(Z=S.transformHeader(Z,de));var he=Z,xe=fe[Z]||0;for(0=j)return Be(!0)}else for(pe=N,N++;;){if((pe=U.indexOf(R,pe+1))===-1)return B||te.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:q.length,index:N}),Pe();if(pe===_-1)return Pe(U.substring(N,pe).replace(ce,R));if(R!==k||U[pe+1]!==k){if(R===k||pe===0||U[pe-1]!==k){Ie!==-1&&Ie=j)return Be(!0);break}te.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:q.length,index:N}),pe++}}else pe++}return Pe();function Te(We){q.push(We),ae=N}function Me(We){var Ke=0;if(We!==-1){var Ne=U.substring(pe+1,We);Ne&&Ne.trim()===""&&(Ke=Ne.length)}return Ke}function Pe(We){return B||(We===void 0&&(We=U.substring(N)),re.push(We),N=_,Te(re),le&&Je()),Be()}function Ee(We){N=We,Te(re),re=[],ye=U.indexOf(D,N)}function Be(We){return{data:q,errors:te,meta:{delimiter:M,linebreak:D,aborted:F,truncated:!!We,cursor:ae+(O||0)}}}function Je(){W(Be()),q=[],te=[]}},this.abort=function(){F=!0},this.getCharIndex=function(){return N}}function C(S){var R=S.data,M=a[R.workerId],D=!1;if(R.error)M.userError(R.error,R.file);else if(R.results&&R.results.data){var E={abort:function(){D=!0,P(R.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:v,resume:v};if(x(M.userStep)){for(var W=0;W1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||iht,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),o=0;o{this.observers[o]||(this.observers[o]=new Map);const r=this.observers[o].get(n)||0;this.observers[o].set(n,r+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r{let[l,s]=a;for(let c=0;c{let[l,s]=a;for(let c=0;c{t=o,e=r});return n.resolve=t,n.reject=e,n}function OAe(t){return t==null?"":""+t}function lht(t,e,n){t.forEach(o=>{e[o]&&(n[o]=e[o])})}const sht=/###/g;function sE(t,e,n){function o(l){return l&&l.indexOf("###")>-1?l.replace(sht,"."):l}function r(){return!t||typeof t=="string"}const i=typeof e!="string"?e:e.split(".");let a=0;for(;a":">",'"':""","'":"'","/":"/"};function fht(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,e=>dht[e]):t}class hht{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const o=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,o),this.regExpQueue.push(e),o}}const pht=[" ",",","?","!",";"],ght=new hht(20);function mht(t,e,n){e=e||"",n=n||"";const o=pht.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(o.length===0)return!0;const r=ght.getRegExp(`(${o.map(a=>a==="?"?"\\?":a).join("|")})`);let i=!r.test(t);if(!i){const a=t.indexOf(n);a>0&&!r.test(t.substring(0,a))&&(i=!0)}return i}function Dse(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const o=e.split(n);let r=t;for(let i=0;i-1&&s0?t.replace("_","-"):t}class VAe extends $K{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,a=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;e.indexOf(".")>-1?l=e.split("."):(l=[e,n],o&&(Array.isArray(o)?l.push(...o):typeof o=="string"&&i?l.push(...o.split(i)):l.push(o)));const s=VV(this.data,l);return!s&&!n&&!o&&e.indexOf(".")>-1&&(e=l[0],n=l[1],o=l.slice(2).join(".")),s||!a||typeof o!="string"?s:Dse(this.data&&this.data[e]&&this.data[e][n],o,i)}addResource(e,n,o,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let l=[e,n];o&&(l=l.concat(a?o.split(a):o)),e.indexOf(".")>-1&&(l=e.split("."),r=n,n=l[1]),this.addNamespaces(n),_Ae(this.data,l,r),i.silent||this.emit("added",e,n,o,r)}addResources(e,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in o)(typeof o[i]=="string"||Object.prototype.toString.apply(o[i])==="[object Array]")&&this.addResource(e,n,i,o[i],{silent:!0});r.silent||this.emit("added",e,n,o)}addResourceBundle(e,n,o,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},l=[e,n];e.indexOf(".")>-1&&(l=e.split("."),r=o,o=n,n=l[1]),this.addNamespaces(n);let s=VV(this.data,l)||{};a.skipCopy||(o=JSON.parse(JSON.stringify(o))),r?uWe(s,o,i):s={...s,...o},_Ae(this.data,l,s),a.silent||this.emit("added",e,n,o)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,n)}:this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var dWe={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,o,r){return t.forEach(i=>{this.processors[i]&&(e=this.processors[i].process(e,n,o,r))}),e}};const GAe={};class XV extends $K{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),lht(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=p9.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const o=this.resolve(e,n);return o&&o.res!==void 0}extractFromKey(e,n){let o=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const a=o&&e.indexOf(o)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!mht(e,o,r);if(a&&!l){const s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:i};const c=e.split(o);(o!==r||o===r&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(r)}return typeof i=="string"&&(i=[i]),{key:e,namespaces:i}}translate(e,n,o){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const r=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(e[e.length-1],n),s=l[l.length-1],c=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(u){const v=n.nsSeparator||this.options.nsSeparator;return r?{res:`${s}${v}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:s,usedParams:this.getUsedParamsDetails(n)}:`${s}${v}${a}`}return r?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:s,usedParams:this.getUsedParamsDetails(n)}:a}const d=this.resolve(e,n);let f=d&&d.res;const p=d&&d.usedKey||a,g=d&&d.exactUsedKey||a,y=Object.prototype.toString.apply(f),w=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject;if(C&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&w.indexOf(y)<0&&!(typeof b=="string"&&y==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const v=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,f,{...n,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return r?(d.res=v,d.usedParams=this.getUsedParamsDetails(n),d):v}if(i){const v=y==="[object Array]",T=v?[]:{},A=v?g:p;for(const x in f)if(Object.prototype.hasOwnProperty.call(f,x)){const S=`${A}${i}${x}`;T[x]=this.translate(S,{...n,joinArrays:!1,ns:l}),T[x]===S&&(T[x]=f[x])}f=T}}else if(C&&typeof b=="string"&&y==="[object Array]")f=f.join(b),f&&(f=this.extendTranslation(f,e,n,o));else{let v=!1,T=!1;const A=n.count!==void 0&&typeof n.count!="string",x=XV.hasDefaultValue(n),S=A?this.pluralResolver.getSuffix(c,n.count,n):"",R=n.ordinal&&A?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",M=A&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),D=M&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${S}`]||n[`defaultValue${R}`]||n.defaultValue;!this.isValidLookup(f)&&x&&(v=!0,f=D),this.isValidLookup(f)||(T=!0,f=a);const W=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&T?void 0:f,j=x&&D!==f&&this.options.updateMissing;if(T||v||j){if(this.logger.log(j?"updateKey":"missingKey",c,s,a,j?D:f),i){const F=this.resolve(a,{...n,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let L=[];const k=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&k&&k[0])for(let F=0;F{const B=x&&O!==f?O:W;this.options.missingKeyHandler?this.options.missingKeyHandler(F,s,U,B,j,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(F,s,U,B,j,n),this.emit("missingKey",F,s,U,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?L.forEach(F=>{const U=this.pluralResolver.getSuffixes(F,n);M&&n[`defaultValue${this.options.pluralSeparator}zero`]&&U.indexOf(`${this.options.pluralSeparator}zero`)<0&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(O=>{N([F],a+O,n[`defaultValue${O}`]||D)})}):N(L,a,D))}f=this.extendTranslation(f,e,n,d,o),T&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${s}:${a}`),(T||v)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${s}:${a}`:a,v?f:void 0):f=this.options.parseMissingKeyHandler(f))}return r?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(e,n,o,r,i){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const c=typeof e=="string"&&(o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(c){const f=e.match(this.interpolator.nestingRegexp);u=f&&f.length}let d=o.replace&&typeof o.replace!="string"?o.replace:o;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,o.lng||this.language,o),c){const f=e.match(this.interpolator.nestingRegexp),p=f&&f.length;u1&&arguments[1]!==void 0?arguments[1]:{},o,r,i,a,l;return typeof e=="string"&&(e=[e]),e.forEach(s=>{if(this.isValidLookup(o))return;const c=this.extractFromKey(s,n),u=c.key;r=u;let d=c.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",p=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),g=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(w=>{this.isValidLookup(o)||(l=w,!GAe[`${y[0]}-${w}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(GAe[`${y[0]}-${w}`]=!0,this.logger.warn(`key "${r}" for languages "${y.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(b=>{if(this.isValidLookup(o))return;a=b;const C=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(C,u,b,w,n);else{let v;f&&(v=this.pluralResolver.getSuffix(b,n.count,n));const T=`${this.options.pluralSeparator}zero`,A=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(C.push(u+v),n.ordinal&&v.indexOf(A)===0&&C.push(u+v.replace(A,this.options.pluralSeparator)),p&&C.push(u+T)),g){const x=`${u}${this.options.contextSeparator}${n.context}`;C.push(x),f&&(C.push(x+v),n.ordinal&&v.indexOf(A)===0&&C.push(x+v.replace(A,this.options.pluralSeparator)),p&&C.push(x+T))}}let P;for(;P=C.pop();)this.isValidLookup(o)||(i=P,o=this.getResource(b,w,P,n))}))})}),{res:o,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:l}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,o,r):this.resourceStore.getResource(e,n,o,r)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=e.replace&&typeof e.replace!="string";let r=o?e.replace:e;if(o&&typeof e.count<"u"&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!o){r={...r};for(const i of n)delete r[i]}return r}static hasDefaultValue(e){const n="defaultValue";for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&n===o.substring(0,n.length)&&e[o]!==void 0)return!0;return!1}}function Aoe(t){return t.charAt(0).toUpperCase()+t.slice(1)}class XAe{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=p9.create("languageUtils")}getScriptPartFromCode(e){if(e=GV(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=GV(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let o=e.split("-");return this.options.lowerCaseLng?o=o.map(r=>r.toLowerCase()):o.length===2?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),n.indexOf(o[1].toLowerCase())>-1&&(o[1]=Aoe(o[1].toLowerCase()))):o.length===3&&(o[0]=o[0].toLowerCase(),o[1].length===2&&(o[1]=o[1].toUpperCase()),o[0]!=="sgn"&&o[2].length===2&&(o[2]=o[2].toUpperCase()),n.indexOf(o[1].toLowerCase())>-1&&(o[1]=Aoe(o[1].toLowerCase())),n.indexOf(o[2].toLowerCase())>-1&&(o[2]=Aoe(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(o=>{if(n)return;const r=this.formatLanguageCode(o);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&e.forEach(o=>{if(n)return;const r=this.getLanguagePartFromCode(o);if(this.isSupportedCode(r))return n=r;n=this.options.supportedLngs.find(i=>{if(i===r)return i;if(!(i.indexOf("-")<0&&r.indexOf("-")<0)&&(i.indexOf("-")>0&&r.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===r||i.indexOf(r)===0&&r.length>1))return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),typeof e=="string"&&(e=[e]),Object.prototype.toString.apply(e)==="[object Array]")return e;if(!n)return e.default||[];let o=e[n];return o||(o=e[this.getScriptPartFromCode(n)]),o||(o=e[this.formatLanguageCode(n)]),o||(o=e[this.getLanguagePartFromCode(n)]),o||(o=e.default),o||[]}toResolveHierarchy(e,n){const o=this.getFallbackCodes(n||this.options.fallbackLng||[],e),r=[],i=a=>{a&&(this.isSupportedCode(a)?r.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):typeof e=="string"&&i(this.formatLanguageCode(e)),o.forEach(a=>{r.indexOf(a)<0&&i(this.formatLanguageCode(a))}),r}}let yht=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Aht={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},5:function(t){return t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},6:function(t){return t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}};const wht=["v1","v2","v3"],vht=["v4"],JAe={zero:0,one:1,two:2,few:3,many:4,other:5};function xht(){const t={};return yht.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:Aht[e.fc]}})}),t}class bht{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=p9.create("pluralResolver"),(!this.options.compatibilityJSON||vht.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=xht()}addRule(e,n){this.rules[e]=n}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(GV(e==="dev"?"en":e),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=this.getRule(e,n);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}getPluralFormsOfKey(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,o).map(r=>`${n}${r}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=this.getRule(e,n);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort((r,i)=>JAe[r]-JAe[i]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):o.numbers.map(r=>this.getSuffix(e,r,n)):[]}getSuffix(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=this.getRule(e,o);return r?this.shouldUseIntlApi()?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:this.getSuffixRetroCompatible(r,n):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,n){const o=e.noAbs?e.plurals(n):e.plurals(Math.abs(n));let r=e.numbers[o];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(r===2?r="plural":r===1&&(r=""));const i=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return this.options.compatibilityJSON==="v1"?r===1?"":typeof r=="number"?`_plural_${r.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}shouldUseIntlApi(){return!wht.includes(this.options.compatibilityJSON)}}function KAe(t,e,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=uht(t,e,n);return!i&&r&&typeof n=="string"&&(i=Dse(t,n,o),i===void 0&&(i=Dse(e,n,o))),i}class Sht{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=p9.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const n=e.interpolation;this.escape=n.escape!==void 0?n.escape:fht,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?ZS(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?ZS(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?ZS(n.nestingPrefix):n.nestingPrefixEscaped||ZS("$t("),this.nestingSuffix=n.nestingSuffix?ZS(n.nestingSuffix):n.nestingSuffixEscaped||ZS(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,o)=>n&&n.source===o?(n.lastIndex=0,n):new RegExp(o,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,o,r){let i,a,l;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(g){return g.replace(/\$/g,"$$$$")}const u=g=>{if(g.indexOf(this.formatSeparator)<0){const C=KAe(n,s,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,o,{...r,...n,interpolationkey:g}):C}const y=g.split(this.formatSeparator),w=y.shift().trim(),b=y.join(this.formatSeparator).trim();return this.format(KAe(n,s,w,this.options.keySeparator,this.options.ignoreJSONStructure),b,o,{...r,...n,interpolationkey:w})};this.resetRegExp();const d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>c(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?c(this.escape(g)):c(g)}].forEach(g=>{for(l=0;i=g.regex.exec(e);){const y=i[1].trim();if(a=u(y),a===void 0)if(typeof d=="function"){const b=d(e,i,r);a=typeof b=="string"?b:""}else if(r&&Object.prototype.hasOwnProperty.call(r,y))a="";else if(f){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=OAe(a));const w=g.safeValue(a);if(e=e.replace(i[0],w),f?(g.regex.lastIndex+=a.length,g.regex.lastIndex-=i[0].length):g.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),e}nest(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,i,a;function l(s,c){const u=this.nestingOptionsSeparator;if(s.indexOf(u)<0)return s;const d=s.split(new RegExp(`${u}[ ]*{`));let f=`{${d[1]}`;s=d[0],f=this.interpolate(f,a);const p=f.match(/'/g),g=f.match(/"/g);(p&&p.length%2===0&&!g||g.length%2!==0)&&(f=f.replace(/'/g,'"'));try{a=JSON.parse(f),c&&(a={...c,...a})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${s}`,y),`${s}${u}${f}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,s}for(;r=this.nestingRegexp.exec(e);){let s=[];a={...o},a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(r[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(r[1])){const u=r[1].split(this.formatSeparator).map(d=>d.trim());r[1]=u.shift(),s=u,c=!0}if(i=n(l.call(this,r[1].trim(),a),a),i&&r[0]===e&&typeof i!="string")return i;typeof i!="string"&&(i=OAe(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),i=""),c&&(i=s.reduce((u,d)=>this.format(u,d,o.lng,{...o,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}}function Tht(t){let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const o=t.split("(");e=o[0].toLowerCase().trim();const r=o[1].substring(0,o[1].length-1);e==="currency"&&r.indexOf(":")<0?n.currency||(n.currency=r.trim()):e==="relativetime"&&r.indexOf(":")<0?n.range||(n.range=r.trim()):r.split(";").forEach(a=>{if(!a)return;const[l,...s]=a.split(":"),c=s.join(":").trim().replace(/^'+|'+$/g,"");n[l.trim()]||(n[l.trim()]=c),c==="false"&&(n[l.trim()]=!1),c==="true"&&(n[l.trim()]=!0),isNaN(c)||(n[l.trim()]=parseInt(c,10))})}return{formatName:e,formatOptions:n}}function eT(t){const e={};return function(o,r,i){const a=r+JSON.stringify(i);let l=e[a];return l||(l=t(GV(r),i),e[a]=l),l(o)}}class Pht{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=p9.create("formatter"),this.options=e,this.formats={number:eT((n,o)=>{const r=new Intl.NumberFormat(n,{...o});return i=>r.format(i)}),currency:eT((n,o)=>{const r=new Intl.NumberFormat(n,{...o,style:"currency"});return i=>r.format(i)}),datetime:eT((n,o)=>{const r=new Intl.DateTimeFormat(n,{...o});return i=>r.format(i)}),relativetime:eT((n,o)=>{const r=new Intl.RelativeTimeFormat(n,{...o});return i=>r.format(i,o.range||"day")}),list:eT((n,o)=>{const r=new Intl.ListFormat(n,{...o});return i=>r.format(i)})},this.init(e)}init(e){const o=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=eT(n)}format(e,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((l,s)=>{const{formatName:c,formatOptions:u}=Tht(s);if(this.formats[c]){let d=l;try{const f=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},p=f.locale||f.lng||r.locale||r.lng||o;d=this.formats[c](l,p,{...u,...r,...f})}catch(f){this.logger.warn(f)}return d}else this.logger.warn(`there was no format function for ${c}`);return l},e)}}function Cht(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}class Rht extends $K{constructor(e,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=o,this.languageUtils=o.languageUtils,this.options=r,this.logger=p9.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(o,r.backend,r)}queueLoad(e,n,o,r){const i={},a={},l={},s={};return e.forEach(c=>{let u=!0;n.forEach(d=>{const f=`${c}|${d}`;!o.reload&&this.store.hasResourceBundle(c,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?a[f]===void 0&&(a[f]=!0):(this.state[f]=1,u=!1,a[f]===void 0&&(a[f]=!0),i[f]===void 0&&(i[f]=!0),s[d]===void 0&&(s[d]=!0)))}),u||(l[c]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(s)}}loaded(e,n,o){const r=e.split("|"),i=r[0],a=r[1];n&&this.emit("failedLoading",i,a,n),o&&this.store.addResourceBundle(i,a,o,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2;const l={};this.queue.forEach(s=>{cht(s.loaded,[i],a),Cht(s,e),n&&s.errors.push(n),s.pendingCount===0&&!s.done&&(Object.keys(s.loaded).forEach(c=>{l[c]||(l[c]={});const u=s.loaded[c];u.length&&u.forEach(d=>{l[c][d]===void 0&&(l[c][d]=!0)})}),s.done=!0,s.errors.length?s.callback(s.errors):s.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(s=>!s.done)}read(e,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:o,tried:r,wait:i,callback:a});return}this.readingCalls++;const l=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(c&&u&&r{this.read.call(this,e,n,o,r+1,i*2,a)},i);return}a(c,u)},s=this.backend[o].bind(this.backend);if(s.length===2){try{const c=s(e,n);c&&typeof c.then=="function"?c.then(u=>l(null,u)).catch(l):l(null,c)}catch(c){l(c)}return}return s(e,n,l)}prepareLoading(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof n=="string"&&(n=[n]);const i=this.queueLoad(e,n,o,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(a=>{this.loadOne(a)})}load(e,n,o){this.prepareLoading(e,n,{},o)}reload(e,n,o){this.prepareLoading(e,n,{reload:!0},o)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const o=e.split("|"),r=o[0],i=o[1];this.read(r,i,"read",void 0,void 0,(a,l)=>{a&&this.logger.warn(`${n}loading namespace ${i} for language ${r} failed`,a),!a&&l&&this.logger.log(`${n}loaded namespace ${i} for language ${r}`,l),this.loaded(e,a,l)})}saveMissing(e,n,o,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${o}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(o==null||o==="")){if(this.backend&&this.backend.create){const s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(e,n,o,r,s):u=c(e,n,o,r),u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}else c(e,n,o,r,l,s)}!e||!e[0]||this.store.addResource(e[0],n,o,r)}}}function qAe(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let n={};if(typeof e[1]=="object"&&(n=e[1]),typeof e[1]=="string"&&(n.defaultValue=e[1]),typeof e[2]=="string"&&(n.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const o=e[3]||e[2];Object.keys(o).forEach(r=>{n[r]=o[r]})}return n},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function $Ae(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function dB(){}function Hht(t){Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})}class AF extends $K{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=$Ae(e),this.services={},this.logger=p9,this.modules={external:[]},Hht(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(o=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const r=qAe();this.options={...r,...this.options,...$Ae(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function i(u){return u?typeof u=="function"?new u:u:null}if(!this.options.isClone){this.modules.logger?p9.init(i(this.modules.logger),this.options):p9.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=Pht);const d=new XAe(this.options);this.store=new VAe(this.options.resources,this.options);const f=this.services;f.logger=p9,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new bht(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=i(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Sht(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Rht(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(p){for(var g=arguments.length,y=new Array(g>1?g-1:0),w=1;w1?g-1:0),w=1;w{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,o||(o=dB),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=function(){return e.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return e.store[u](...arguments),e}});const s=fz(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(f),o(d,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),s}loadResources(e){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:dB;const r=typeof e=="string"?e:this.language;if(typeof e=="function"&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&r.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return o();const i=[],a=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(c=>{c!=="cimode"&&i.indexOf(c)<0&&i.push(c)})};r?a(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(s=>a(s)),this.options.preload&&this.options.preload.forEach(l=>a(l)),this.services.backendConnector.load(i,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),o(l)})}else o(null)}reloadResources(e,n,o){const r=fz();return e||(e=this.languages),n||(n=this.options.ns),o||(o=dB),this.services.backendConnector.reload(e,n,i=>{r.resolve(),o(i)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&dWe.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}}changeLanguage(e,n){var o=this;this.isLanguageChangingTo=e;const r=fz();this.emit("languageChanging",e);const i=s=>{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},a=(s,c)=>{c?(i(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,r.resolve(function(){return o.t(...arguments)}),n&&n(s,function(){return o.t(...arguments)})},l=s=>{!e&&!s&&this.services.languageDetector&&(s=[]);const c=typeof s=="string"?s:this.services.languageUtils.getBestMatchFromCodes(s);c&&(this.language||i(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,u=>{a(u,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(e),r}getFixedT(e,n,o){var r=this;const i=function(a,l){let s;if(typeof l!="object"){for(var c=arguments.length,u=new Array(c>2?c-2:0),d=2;d`${s.keyPrefix}${f}${g}`):p=s.keyPrefix?`${s.keyPrefix}${f}${a}`:a,r.t(p,s)};return typeof e=="string"?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=o,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const o=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;const a=(l,s)=>{const c=this.services.backendConnector.state[`${l}|${s}`];return c===-1||c===2};if(n.precheck){const l=n.precheck(this,a);if(l!==void 0)return l}return!!(this.hasResourceBundle(o,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(o,e)&&(!r||a(i,e)))}loadNamespaces(e,n){const o=fz();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(r=>{this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}),this.loadResources(r=>{o.resolve(),n&&n(r)}),o):(n&&n(),Promise.resolve())}loadLanguages(e,n){const o=fz();typeof e=="string"&&(e=[e]);const r=this.options.preload||[],i=e.filter(a=>r.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return i.length?(this.options.preload=r.concat(i),this.loadResources(a=>{o.resolve(),n&&n(a)}),o):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],o=this.services&&this.services.languageUtils||new XAe(qAe());return n.indexOf(o.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new AF(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:dB;const o=e.forkResourceStore;o&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},i=new AF(r);return(e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(l=>{i[l]=this[l]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},o&&(i.store=new VAe(this.store.data,r),i.services.resourceStore=i.store),i.translator=new XV(i.services,r),i.translator.on("*",function(l){for(var s=arguments.length,c=new Array(s>1?s-1:0),u=1;u()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}};function ZAe(t,e,n){t.loadNamespaces(e,fWe(t,n))}function e4e(t,e,n,o){typeof n=="string"&&(n=[n]),n.forEach(r=>{t.options.ns.indexOf(r)<0&&t.options.ns.push(r)}),t.loadLanguages(e,fWe(t,o))}function Iht(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=e.languages[0],r=e.options?e.options.fallbackLng:!1,i=e.languages[e.languages.length-1];if(o.toLowerCase()==="cimode")return!0;const a=(l,s)=>{const c=e.services.backendConnector.state[`${l}|${s}`];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!a(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(o,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||a(o,t)&&(!r||a(i,t)))}function zht(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(Ese("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,t))return!1}}):Iht(t,e,n)}const Dht=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Eht={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Fht=t=>Eht[t],kht=t=>t.replace(Dht,Fht);let Fse={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:kht};function Lht(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fse={...Fse,...t}}function Wht(){return Fse}let hWe;function Nht(t){hWe=t}function Uht(){return hWe}const jht={type:"3rdParty",init(t){Lht(t.options.react),Nht(t)}},Bht=m.createContext();class Yht{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Oht=(t,e)=>{const n=m.useRef();return m.useEffect(()=>{n.current=t},[t,e]),n.current};function Vl(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=e,{i18n:o,defaultNS:r}=m.useContext(Bht)||{},i=n||o||Uht();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new Yht),!i){Ese("You will need to pass in an i18next instance by using initReactI18next");const P=(T,A)=>typeof A=="string"?A:A&&typeof A=="object"&&typeof A.defaultValue=="string"?A.defaultValue:Array.isArray(T)?T[T.length-1]:T,v=[P,{},!1];return v.t=P,v.i18n={},v.ready=!1,v}i.options.react&&i.options.react.wait!==void 0&&Ese("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...Wht(),...i.options.react,...e},{useSuspense:l,keyPrefix:s}=a;let c=r||i.options&&i.options.defaultNS;c=typeof c=="string"?[c]:c||["translation"],i.reportNamespaces.addUsedNamespaces&&i.reportNamespaces.addUsedNamespaces(c);const u=(i.isInitialized||i.initializedStoreOnce)&&c.every(P=>zht(P,i,a));function d(){return i.getFixedT(e.lng||null,a.nsMode==="fallback"?c:c[0],s)}const[f,p]=m.useState(d);let g=c.join();e.lng&&(g=`${e.lng}${g}`);const y=Oht(g),w=m.useRef(!0);m.useEffect(()=>{const{bindI18n:P,bindI18nStore:v}=a;w.current=!0,!u&&!l&&(e.lng?e4e(i,e.lng,c,()=>{w.current&&p(d)}):ZAe(i,c,()=>{w.current&&p(d)})),u&&y&&y!==g&&w.current&&p(d);function T(){w.current&&p(d)}return P&&i&&i.on(P,T),v&&i&&i.store.on(v,T),()=>{w.current=!1,P&&i&&P.split(" ").forEach(A=>i.off(A,T)),v&&i&&v.split(" ").forEach(A=>i.store.off(A,T))}},[i,g]);const b=m.useRef(!0);m.useEffect(()=>{w.current&&!b.current&&p(d),b.current=!1},[i,s]);const C=[f,i,u];if(C.t=f,C.i18n=i,C.ready=u,u||!u&&!l)return C;throw new Promise(P=>{e.lng?e4e(i,e.lng,c,()=>P()):ZAe(i,c,()=>P())})}function _ht(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wF(t){"@babel/helpers - typeof";return wF=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},wF(t)}function Vht(t,e){if(wF(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(wF(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Ght(t){var e=Vht(t,"string");return wF(e)==="symbol"?e:String(e)}function Xht(t,e){for(var n=0;n0){var l=r.maxAge-0;if(Number.isNaN(l))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(l))}if(r.domain){if(!t4e.test(r.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(r.domain)}if(r.path){if(!t4e.test(r.path))throw new TypeError("option path is invalid");a+="; Path=".concat(r.path)}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(r.expires.toUTCString())}if(r.httpOnly&&(a+="; HttpOnly"),r.secure&&(a+="; Secure"),r.sameSite){var s=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(s){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},n4e={create:function(e,n,o,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};o&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+o*60*1e3)),r&&(i.domain=r),document.cookie=Qht(e,encodeURIComponent(n),i)},read:function(e){for(var n="".concat(e,"="),o=document.cookie.split(";"),r=0;r-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));for(var r=o.substring(1),i=r.split("&"),a=0;a0){var s=i[a].substring(0,l);s===e.lookupQuerystring&&(n=i[a].substring(l+1))}}}return n}},hz=null,o4e=function(){if(hz!==null)return hz;try{hz=window!=="undefined"&&window.localStorage!==null;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{hz=!1}return hz},tpt={name:"localStorage",lookup:function(e){var n;if(e.lookupLocalStorage&&o4e()){var o=window.localStorage.getItem(e.lookupLocalStorage);o&&(n=o)}return n},cacheUserLanguage:function(e,n){n.lookupLocalStorage&&o4e()&&window.localStorage.setItem(n.lookupLocalStorage,e)}},pz=null,r4e=function(){if(pz!==null)return pz;try{pz=window!=="undefined"&&window.sessionStorage!==null;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{pz=!1}return pz},npt={name:"sessionStorage",lookup:function(e){var n;if(e.lookupSessionStorage&&r4e()){var o=window.sessionStorage.getItem(e.lookupSessionStorage);o&&(n=o)}return n},cacheUserLanguage:function(e,n){n.lookupSessionStorage&&r4e()&&window.sessionStorage.setItem(n.lookupSessionStorage,e)}},opt={name:"navigator",lookup:function(e){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var o=0;o0?n:void 0}},rpt={name:"htmlTag",lookup:function(e){var n,o=e.htmlTag||(typeof document<"u"?document.documentElement:null);return o&&typeof o.getAttribute=="function"&&(n=o.getAttribute("lang")),n}},ipt={name:"path",lookup:function(e){var n;if(typeof window<"u"){var o=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(o instanceof Array)if(typeof e.lookupFromPathIndex=="number"){if(typeof o[e.lookupFromPathIndex]!="string")return;n=o[e.lookupFromPathIndex].replace("/","")}else n=o[0].replace("/","")}return n}},apt={name:"subdomain",lookup:function(e){var n=typeof e.lookupFromSubdomainIndex=="number"?e.lookupFromSubdomainIndex+1:1,o=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(o)return o[n]}};function lpt(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(e){return e}}}var gWe=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_ht(this,t),this.type="languageDetector",this.detectors={},this.init(e,n)}return Jht(t,[{key:"init",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n||{languageUtils:{}},this.options=$ht(o,this.options||{},lpt()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(i){return i.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Zht),this.addDetector(ept),this.addDetector(tpt),this.addDetector(npt),this.addDetector(opt),this.addDetector(rpt),this.addDetector(ipt),this.addDetector(apt)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var o=this;n||(n=this.options.order);var r=[];return n.forEach(function(i){if(o.detectors[i]){var a=o.detectors[i].lookup(o.options);a&&typeof a=="string"&&(a=[a]),a&&(r=r.concat(a))}}),r=r.map(function(i){return o.options.convertDetectedLanguage(i)}),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}},{key:"cacheUserLanguage",value:function(n,o){var r=this;o||(o=this.options.caches),o&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||o.forEach(function(i){r.detectors[i]&&r.detectors[i].cacheUserLanguage(n,r.options)}))}}]),t}();gWe.type="languageDetector";const spt={translation:{name:{IFI:"Institute for Future Intelligence",Aladdin:"Aladdin",Tagline:"Aladdin: Reimagining Design with Explainable AI — Institute for Future Intelligence"},cookie:{Statement:"By clicking Accept, you agree to our use of cookies to improve your experience with Aladdin.",Accept:"Accept"},aboutUs:{ProductBroughtToYouBy:"This product is brought to you by",TermsOfService:"Terms of Service",PrivacyPolicy:"Privacy Policy",Software:"Software",Content:"Content",Research:"Research",Support:"Support",Acknowledgment:"Acknowledgment",FundingInformation:"The National Science Foundation (NSF) generously provided funding for the research and development of this product through grants #2105695, #2131097, and #2301164. Any opinions, findings, and conclusions or recommendations expressed in this product, however, are those of the authors and do not necessarily reflect the views of NSF.",Contact:"For more information, please contact Charles Xie (charles@intofuture.org).",Translators:"Translators"},word:{Refresh:"Refresh",LastUpdate:"Last Update",Small:"Small",Medium:"Medium",Large:"Large",Design:"Design",Information:"Information",Type:"Type",Text:"Text",FontSize:"Font Size",FontColor:"Font Color",Model:"Model",Models:"Models",Upload:"Upload",ClickCount:"Click Count",Share:"Share",AlreadyLike:"Already like",Like:"Like",MustLogInToLike:"Must log in to like",AllRightsReserved:"All Rights Reserved",MeterAbbreviation:"m",Version:"Version",VersionInitial:"V",Options:"Options",Maximum:"Maximum",Minimum:"Minimum",MaximumNumber:"Maximum Number",MinimumNumber:"Minimum Number",MaximumValue:"Maximum Value",MinimumValue:"Minimum Value",Or:"Or",None:"None",High:"High",Partial:"Partial",Teacher:"Teacher",Class:"Class",Total:"Total",Leaderboard:"Leaderboard",Latest:"Latest",Range:"Range",SIUnit:"SI Unit",USUnit:"US Unit",ThermalTransmittance:"Thermal Transmittance",ThermalResistance:"Thermal Resistance",UValue:"U-Value",RValue:"R-Value",VolumetricHeatCapacity:"Volumetric Heat Capacity",BuildingHVACSystem:"Building HVAC System",ThermostatSetpoint:"Thermostat Setpoint",TemperatureToleranceThreshold:"Tolerance Threshold",TemperatureToleranceThresholdExplanation:`Heater will not run if the lowest outside temperature of the day is higher than the setpoint minus this threshold. AC will not run if the highest outside temperature of the day is lower than the setpoint plus this threshold.`,Press:"Press",Open:"Open",Save:"Save",SaveAsImage:"Save as Image",SaveAsCsv:"Save as CSV",Update:"Update",Paste:"Paste",Copy:"Copy",Cut:"Cut",Delete:"Delete",Lock:"Lock",Translucent:"Translucent",Transparency:"Transparency",Color:"Color",Pattern:"Pattern",Texture:"Texture",Size:"Size",Thickness:"Thickness",Yes:"Yes",No:"No",OK:"OK",Cancel:"Cancel",Apply:"Apply",Close:"Close",ApplyTo:"Apply to",Run:"Run",Pause:"Pause",Resume:"Resume",Clear:"Clear",Warning:"Warning",Caution:"Caution",Reminder:"Reminder",Length:"Length",Width:"Width",Height:"Height",Radius:"Radius",Angle:"Angle",Azimuth:"Azimuth",Coordinates:"Coordinates",Weather:"Weather",Show:"Show",Animate:"Animate",Date:"Date",Time:"Time",Title:"Title",Owner:"Owner",Action:"Action",Rename:"Rename",Location:"Location",Latitude:"Latitude",Month:"Month",Day:"Day",Hour:"Hour",Daylight:"Daylight",Radiation:"Radiation",Temperature:"Temperature",kWh:"kWh",dollar:"dollar",MeterPerSecond:"m/s",NorthInitial:"N",SouthInitial:"S",EastInitial:"E",WestInitial:"W",Fixed:"Fixed",Elements:"Elements",Energy:"Energy",Unknown:"Unknown",Label:"Label",Description:"Description",NoDescription:"No description",MaximumCharacters:"Maximum characters",Author:"Author",Publisher:"Publisher",Building:"Building",ResidentialBuilding:"Residential Building",CommercialBuilding:"Commercial Building",SchoolBuilding:"School Building",TouristAttraction:"Tourist Attraction",UnderConstruction:"Under Construction",Photovoltaic:"Photovoltaic",WindPower:"Wind Power",ColocationProjects:"Colocation Projects",Anonymous:"Anonymous",Nickname:"Nickname",Pin:"Pin",Unpin:"Unpin"},shared:{NoTexture:"No Texture",FoundationElement:"Foundation",CuboidElement:"Cuboid",PolygonElement:"Polygon",SensorElement:"Sensor",SolarPanelElement:"Solar Panel",WaterHeaterElement:"Water Heater",ParabolicDishElement:"Parabolic Dish",ParabolicTroughElement:"Parabolic Trough",FresnelReflectorElement:"Fresnel Reflector",HeliostatElement:"Heliostat",WindTurbineElement:"Wind Turbine",LightElement:"Light",ElementLocked:"Locked",ModelType:"Model Type",OutputBreakdown:"Breakdown",MoreResults:"More Results"},message:{NewVersionAvailable:"A new version is available",CalculationMayBeSlowDoYouWantToContinue:"Calculation may be slow. Do you want to continue?",IncreaseSolarRadiationHeatmapGridCellSizeToSpeedUp:"Increase solar radiation heatmap grid cell size to speed up",ModelNotFound:"Model not found",CannotSignIn:"Cannot sign in",CannotSignOut:"Cannot sign out",YourAccountWasCreated:"Your account was created.",CannotCreateAccount:"Cannot create an account",YourAccountSettingsWereSaved:"Your account settings were saved.",CannotSaveYourAccountSettings:"Cannot save your account settings",CannotSaveYourFileToCloud:"Cannot save your file to the cloud",CannotCreateNewProject:"Cannot create a new project",CannotCreateNewProjectWithoutTitle:"Cannot create a new project without a title",CannotOpenYourProjects:"Cannot open your projects",CannotOpenProject:"Cannot open the project",CannotDeleteProject:"Cannot delete the project",CannotRenameProject:"Cannot rename the project",CannotAddDesignToProject:"Cannot add this design to the project",CannotAddDesignToProjectOwnedByOthers:"Cannot add this design to a project owned by others",DesignRemovedFromProject:"The design was successfully removed from the project",CannotRemoveDesignFromProject:"Cannot remove this design from the project",CannotUpdateProject:"Cannot update the project",CannotFetchProjectData:"Cannot fetch project data",TitleUsedChooseDifferentOne:"This title has been used. Choose a different one",CloudFileWithTitleExistsDoYouWantToOverwrite:"A cloud file with the title exists. Do you want to overwrite it?",CloudFileNotFound:"The cloud file was not found",CannotLoadModelsOnMap:"Cannot load models on map",CannotLoadLeaderboard:"Cannot load leaderboard",CannotPublishModelOnMap:"Cannot publish model on map",CannotLikeModelFromMap:"Cannot like model from map",CannotDeleteModelFromMap:"Cannot delete model from map",ModelDeletedFromMap:"Model is deleted from map",DoYouWantToDeleteModelFromMap:"Do you want to delete the model from map?",CannotOpenCloudFile:"Cannot open the cloud file",CannotReadCloudFile:"Cannot read the cloud file",CannotWriteCloudFile:"Cannot write the cloud file",CloudFileCopied:"Cloud file copied",CannotOpenCloudFolder:"Cannot open your cloud folder",CannotDeleteCloudFile:"Cannot delete the cloud file",CannotRenameCloudFile:"Cannot rename the cloud file",DoYouWantToSaveChanges:"Do you want to save changes?",NotApplicableToSelectedAction:"Not Applicable to Selected Action",ThisElementIsLocked:"This element is locked.",ThisCannotBeUndone:"This cannot be undone.",AzimuthOfNorthIsZero:"Azimuth of north is 0°",CounterclockwiseAzimuthIsPositive:"Counter-clockwise is positive",SouthFacingIsZero:"South-facing is 0°",ClockwiseRotationIsPositive:"Clockwise is positive",MoveCancelledBecauseOfOverlap:"Move cancelled because of overlap.",MoveOutsideBoundaryCancelled:"Move outside the boundary cancelled.",RotationCancelledBecauseOfOverlap:"Rotation cancelled because of overlap.",RotationOutsideBoundaryCancelled:"Rotation outside the boundary cancelled.",ResizingCancelledBecauseOfOverlap:"Resizing cancelled because of overlap.",ResizingOutsideBoundaryCancelled:"Resizing outside the boundary cancelled.",CannotPasteOutsideBoundary:"Cannot paste outside the boundary.",CannotPasteBecauseOfOverlap:"Cannot paste because of overlap.",CannotMoveObjectTooFar:"Cannot move object too far.",ExistingSolarPanelsWillBeRemovedBeforeApplyingNewLayout:"Existing solar panels will be removed before applying the new layout.",DoYouWantToContinue:"Do you want to continue?",SolarPanelsCannotIntersectWithGround:"Solar panels cannot intersect with the ground.",SolarPanelsCannotOverlapWithOneAnother:"Solar panels cannot overlap with one another.",ScreenshotSaved:"A screenshot was saved.",CsvFileSaved:"A CSV file was saved.",SimulationStarted:"Simulation started.",SimulationCompleted:"Simulation completed.",SimulationAborted:"Simulation aborted.",SimulationPaused:"Simulation paused.",CancelSimulation:"Cancel simulation",PauseSimulation:"Pause simulation",ResumeSimulation:"Resume simulation",SimulationWillNotStartDueToErrors:"Simulation will not start due to errors",SimulationWillStartDespiteWarnings:"Simulation will start despite warnings.",EvolutionStarted:"Evolution started.",EvolutionCompleted:"Evolution completed.",EvolutionAborted:"Evolution aborted.",EvolutionPaused:"Evolution paused.",EncounterEvolutionError:"Encountered an evolution error.",CancelEvolution:"Cancel evolution",PauseEvolution:"Pause evolution",ResumeEvolution:"Resume evolution",ConvergenceThresholdHasBeenReached:"The convergence threshold has been reached.",MaximumNumberOfGenerationsHasBeenReached:"The maximum number of generations has been reached.",MaximumNumberOfStepsHasBeenReached:"The maximum number of steps has been reached.",ObjectiveFunctionTypeError:"The current objective function is not supported by this operation. Please start from the menu.",WallsAreNotAtSameHeight:"Walls are not at the same height.",WallsAreNotPerpendicular:"Walls are not perpendicular.",WallsAreNotConnected:"Walls are not connected.",WallsNumberNeedToBeFour:"The number of walls needs to be four.",BuildingContainsEmptyWall:"Building contains one or more empty wall.",BuildingRoofMissing:"Building has a missing roof.",UnknownErrors:"Unknown errors."},menu:{AnalysisOptions:"Analysis Options",option:{GridCellSize:"Grid Cell Size",SamplingFrequency:"Sampling Frequency",TimesPerHour:"Times per Hour",DaysPerYear:"Days per Year"},mainMenu:"Main Menu",cloudMenu:"Cloud Menu",projectSubMenu:"Project",project:{CreateNewProject:"Create New Project",OpenProject:"Open Project",SaveProject:"Save Project",SaveProjectAs:"Save Project As",YouMustLogInToCreateProject:"You must log in to create a new project",YouMustLogInToOpenProject:"You must log in to open a project"},fileSubMenu:"File",file:{CreateNewFile:"Create New File",OpenLocalFile:"Open Local File",SaveAsLocalFile:"Save as Local File",SavingAbortedMustHaveValidFileName:"Saving aborted! You must have a valid file name",OpenCloudFile:"Open Cloud File",SaveCloudFile:"Save Cloud File",SaveAsCloudFile:"Save as Cloud File",SavingAbortedMustHaveValidTitle:"Saving aborted! You must have a valid title for a cloud file",ToSaveYourWorkPleaseSignIn:"To save your work, please sign in.",TakeScreenshot:"Take Screenshot",UseCloudFileName:"Use Cloud File Name",PublishOnModelsMap:"Publish on Models Map",PublishedOnModelsMap:"Your model has been published on the Models Map",UpdatedOnModelsMap:"Your model has been updated on the Models Map",YouMustLogInToPublishYourModel:"You must log in to publish your model",YouCannotPublishAModelThatYouDoNotOwn:"You cannot publish a model that you do not own",YouMustSaveModelOnCloudBeforePublishingIt:"You must save the model on the cloud before publishing it"},editSubMenu:"Edit",edit:{Undo:"Undo",Redo:"Redo"},viewSubMenu:"View",view:{NavigationView:"Navigation View",TwoDimensionalView:"2D View",ResetView:"Reset",ZoomIn:"Zoom In",ZoomOut:"Zoom Out",AutoRotate:"Auto Rotate",ShowShadow:"Show Shadow",ShowSurfaceShininess:"Show Surface Shininess",TranslucentFloatingWindows:"Translucent Floating Windows",accessoriesSubMenu:"Accessories",accessories:{SiteInformation:"Site Information",DesignInformation:"Design Information",Instruction:"Instruction",StickyNote:"Sticky Note",Note:"Note"}},settingsSubMenu:"Settings",settings:{WeatherData:"Weather Data",DiurnalTemperature:"Diurnal Temperature",Heliodon:"Heliodon",SunAndTime:"Sun & Time"},benchmarksSubMenu:"Benchmarks",benchmarks:{SolarRadiationPredictionVsMeasurement:"Solar Radiation Prediction vs. Measurement",BESTESTCase600:"Building Energy Simulation Test: BESTEST Case 600",BESTESTCase610:"Building Energy Simulation Test: BESTEST Case 610",BESTESTCase620:"Building Energy Simulation Test: BESTEST Case 620",BESTESTCase630:"Building Energy Simulation Test: BESTEST Case 630"},graph:{LineWidth:"Line Width",SymbolSize:"Symbol Size",BarCategoryGap:"Bar Category Gap",ShowHorizontalGridLines:"Show Horizontal Grid Lines",ShowVerticalGridLines:"Show Vertical Grid Lines"},analysisSubMenu:"Analysis",physicsSubMenu:"Physics",physics:{DailySolarRadiationHeatmap:"Daily Solar Radiation Heatmap",SolarRadiationHeatmapOptions:"Solar Radiation Heatmap Options",SolarRadiationHeatmapGridCellSize:"Solar Radiation Heatmap Grid Cell Size",SolarRadiationHeatmapMaxValue:"Solar Radiation Heatmap Maximum Value",SolarRadiationHeatmapNoAnimation:"No Animation for Static Model",ReflectionHeatmap:"Reflection Heatmap"},sensorSubMenu:"Sensor",sensor:{CollectDailyData:"Collect Daily Data",CollectYearlyData:"Collect Yearly Data",SensorSimulationNoAnimation:"No Animation for Collecting Sensor Data"},buildingSubMenu:"Building",building:{AnalyzeDailyBuildingEnergy:"Analyze Daily Building Energy",AnalyzeYearlyBuildingEnergy:"Analyze Yearly Building Energy",EnergyAnalysisOptions:"Energy Analysis Options",EnergyGridCellSize:"Energy Grid Cell Size",BuildingEnergySimulationNoAnimation:"No Animation for Building Energy Simulation"},solarPanelSubMenu:"Solar Panel",solarPanel:{AnalyzeDailyYield:"Analyze Daily Yield",AnalyzeYearlyYield:"Analyze Yearly Yield",AnalyzeVisibility:"Analyze Visibility",PanelDiscretization:"Panel Discretization",Exact:"Exact",Approximate:"Approximate",EnergyGridCellSize:"Energy Grid Cell Size",VisibilityGridCellSize:"View Factor Grid Cell Size",EnergyAnalysisOptions:"Energy Analysis Options",VisibilityAnalysisOptions:"Visibility Analysis Options",SolarPanelSimulationNoAnimation:"No Animation for Solar Panel Simulation"},parabolicTroughSubMenu:"Parabolic Trough",parabolicTrough:{AnalyzeDailyYield:"Analyze Daily Yield",AnalyzeYearlyYield:"Analyze Yearly Yield"},parabolicDishSubMenu:"Parabolic Dish",parabolicDish:{AnalyzeDailyYield:"Analyze Daily Yield",AnalyzeYearlyYield:"Analyze Yearly Yield"},fresnelReflectorSubMenu:"Fresnel Reflector",fresnelReflector:{AnalyzeDailyYield:"Analyze Daily Yield",AnalyzeYearlyYield:"Analyze Yearly Yield"},heliostatSubMenu:"Heliostat",heliostat:{AnalyzeDailyYield:"Analyze Daily Yield",AnalyzeYearlyYield:"Analyze Yearly Yield"},solarUpdraftTowerSubMenu:"Solar Updraft Tower",solarUpdraftTower:{AnalyzeDailyYield:"Analyze Daily Yield",AnalyzeYearlyYield:"Analyze Yearly Yield",SolarUpdraftTowerSimulationNoAnimation:"No Animation for Solar Updraft Tower Simulation"},tutorialsSubMenu:"Tutorials",solarEnergyScienceSubMenu:"Solar Science",solarEnergyScienceTutorials:{SunAngles:"Sun Angles Relative to an Observer on the Ground",InsolationAndClimate:"Insolation and Climate",SolarRadiationToBox:"Solar Radiation to a Box"},buildingScienceSubMenu:"Building Science",buildingScienceTutorials:{ThermalEnvelopeVsBuildingEnvelope:"Thermal Envelope vs. Building Envelope",EffectOfSizeOnBuildingEnergy:"Effect of Size on Building Energy",EffectOfOrientationOnBuildingEnergy:"Effect of Orientation on Building Energy",EffectOfInsulationOnBuildingEnergy:"Effect of Insulation on Building Energy",EffectOfRoofColorOnBuildingEnergy:"Effect of Roof Color on Building Energy",EffectOfEavesOverhangLengthOnBuildingEnergy:"Effect of Eaves Overhang Length on Building Energy",EffectOfWindowSHGCOnBuildingEnergy:"Effect of Window Solar Heat Gain on Building Energy",EffectOfThermostatSetpointOnBuildingEnergy:"Effect of Thermostat Setpoint on Building Energy",EffectOfSolarPanelsOnBuildingEnergy:"Effect of Solar Panels on Building Energy",EffectOfGroundTemperatureOnBuildingEnergy:"Effect of Ground Temperature on Building Energy",EffectOfTreesOnBuildingEnergy:"Effect of Trees on Building Energy"},buildingDesignSubMenu:"Building Design",buildingDesignTutorials:{CapeCodStyleHouseWithShedDormer:"Cape Cod Style House with Shed Dormer",MansardRoofWithDormers:"Mansard Roof with Dormers",GableRoofVsHipRoof:"Gable Roof vs. Hip Roof",ColonialVsSaltbox:"Colonial vs. Saltbox",GambrelRoofVsMansardRoof:"Gambrel Roof vs. Mansard Roof",CombinationRoofVsBonnetRoof:"Combination Roof vs. Bonnet Roof",DutchGableRoof:"Dutch Gable Roof",GableAndValleyRoof:"Gable and Valley Roof",ClerestoryRoof:"Clerestory Roof",MonitorRoof:"Monitor Roof",AFrameHouse:"A-Frame House",HalfTimberedHouse:"Half-Timbered House",AllBasicRoofTypes:"All Basic Roof Types"},photovoltaicSolarPowerSubMenu:"Photovoltaic Solar Power",photovoltaicSolarPowerTutorials:{EffectOfTiltAngleOfSolarPanel:"Effect of Tilt Angle of a Solar Panel",EffectOfAzimuthOfSolarPanel:"Effect of Azimuth of a Solar Panel",SolarPanelTypes:"Solar Panel Types",VerticalBifacialSolarPanels:"Vertical Bifacial Solar Panels",CompareMonofacialAndBifacialSolarPanels:"Monofacial vs. Bifacial Solar Panels",SolarTrackers:"Solar Trackers",CoveringGroundWithSolarPanels:"Why Just Covering the Ground with Solar Panels is not a Good Idea",InterRowSpacingOfSolarPanelArray:"Effect of Inter-Row Spacing in a Solar Panel Array",EffectOfOrientationOfSolarPanels:"Effect of Orientation of Solar Panels",SolarPanelArrayAutomaticLayout:"Solar Panel Array Automatic Layout"},concentratedSolarPowerSubMenu:"Concentrated Solar Power",concentratedSolarPowerTutorials:{EffectOfAzimuthOfParabolicTrough:"Effect of Azimuth of a Parabolic Trough",EffectOfLatusRectumOfParabolicTrough:"Effect of Latus Rectum of a Parabolic Trough",FocusSunlightWithParabolicDish:"Focus Sunlight with a Parabolic Dish",LinearFresnelReflectors:"Linear Fresnel Reflectors",EffectOfAbsorberPipeHeightForLinearFresnelReflectors:"Effect of Absorber Pipe Height for Linear Fresnel Reflectors",EffectOfAzimuthOfLinearFresnelReflectors:"Effect of Azimuth of Linear Fresnel Reflectors",LinearFresnelReflectorsWithTwoAbsorbers:"Linear Fresnel Reflectors with Two Absorbers",CosineEfficiencyOfHeliostats:"Cosine Efficiency of Heliostats",ShadowingAndBlockingOfHeliostats:"Shadowing and Blocking of Heliostats",EffectSolarPowerTowerHeight:"Effect of Solar Power Tower Height",SolarPowerTower:"Solar Power Tower"},otherTypesOfSolarPowerSubMenu:"Other Types of Solar Power",otherTypesOfSolarPowerTutorials:{SolarUpdraftTower:"Solar Updraft Tower"},windPowerSubMenu:"Wind Power",windPowerTutorials:{EffectOfBladeNumberOfWindTurbine:"Effect of Blade Number of Wind Turbine",EffectOfPitchAngleOfWindTurbineBlades:"Effect of Pitch Angle of Wind Turbine Blades",BirdSafeBladeDesign:"Bird-Safe Blade Design",OffshoreWindFarm:"Offshore Wind Farm"},colocationSubMenu:"Colocation",colocationTutorials:{AgricultureSolarWindColocation:"Agriculture-Solar-Wind Colocation"},generativeDesignSubMenu:"Generative Design",generativeDesignTutorials:{MonofacialSolarPanelArrayTiltAngle:"The Tilt Angle of a Monofacial Solar Panel Array",BifacialSolarPanelArrayTiltAngle:"The Tilt Angle of a Bifacial Solar Panel Array",OutputOfSolarPanelArrayInDifferentPlaces:"The Output of a Solar Panel Array in Different Places",SimpleSolarFarmParetoFront:"The Pareto Front for Designing a Simple Solar Farm"},examplesSubMenu:"Examples",solarEnergySubMenu:"Solar Energy",solarEnergyExamples:{SunBeamAndHeliodon:"Sun Beam and Heliodon",RooftopSolarPanels:"Rooftop Solar Panels",NevadaSolarOneParabolicTroughArray:"Nevada Solar One Parabolic Trough Array",TooeleParabolicDishArray:"Tooele Parabolic Dish Array",PS10SolarPowerTower:"PS10 Solar Power Tower",TucsonLinearFresnelReflectors:"Tucson Linear Fresnel Reflectors",SolarCanopyFormFactors:"Solar Canopy Form Factors",SolarCanopyOverBleachers:"Solar Canopy Over Bleachers",SolarCanopyOverGarage:"Solar Canopy Over Garage",SolarBusStop:"Solar Bus Stop",SolarFacadeTesla:"Tesla Solar Façade",BuildingIntegratedPhotovoltaics:"Building-Integrated Photovoltaics",Floatovoltaics:"Floatovoltaics",Agrivoltaics:"Agrivoltaics",VegetativeBuffer:"Vegetative Buffer",RainbowSwashSolarFarmBostonMA:"Rainbow Swash Solar Farm in Boston, MA",MickeyMouseSolarFarmOrlandoFL:"Mickey Mouse Solar Farm in Orlando, FL",SolarPanelsOverCanalBakersfieldCA:"Hypothetical Solar Panels Over Canal in Bakersfield, CA",SolarNoiseBarrierLexingtonMA:"Hypothetical Solar Noise Barrier in Lexington, MA",HSATSolarTrackersRaleighNC:"Horizontal Single Axis Trackers (HSAT) in Raleigh, NC",AADATSolarTrackersLancasterCA:"Azimuth–Altitude Dual Axis Trackers (AADAT) in Lancaster, CA",SolarUpdraftTowerInCity:"Solar Updraft Tower in City"},builtEnvironmentSubMenu:"Built Environment",residentialBuildingsSubMenu:"Residential Buildings",residentialBuildingExamples:{ColonialHouse:"Colonial House",DutchColonialHouse:"Dutch Colonial House",TShapedHouse:"T-Shaped House",CapeCodHouseWithGarage:"Cape Cod House with Garage",Solarium:"Solarium",Church1:"Church 1",Cathedral1:"Cathedral 1",Cathedral2:"Cathedral 2",Mosque1:"Mosque 1",AdobeTaosHouse:"Adobe Taos House",RanchHouse:"Ranch House",BonnetHouse:"Bonnet House",BarnStyleHouse:"Barn Style House",ModernHouse:"Modern House",ButterflyRoofHouse:"Butterfly Roof House"},commercialBuildingsSubMenu:"Commercial Buildings",commercialBuildingExamples:{WhiteHouse:"White House",HaroldWashingtonCollege:"Harold Washington College",BilimMersinTurkiye:"BILIM, Mersin, Turkiye",SpanishStyleHotel:"Spanish Style Hotel",ApartmentBuilding:"Apartment Building",OfficeBuilding:"Office Building",Hotel:"Hotel"},buildingComplexesSubMenu:"Building Complexes",buildingComplexExamples:{SouthBurlingtonHighSchoolVermont:"South Burlington High School, VT",MescaleroApacheSchoolNewMexico:"Mescalero Apache School, NM"},urbanPlanningSubMenu:"Urban Planning",urbanPlanningExamples:{CityBlockHeatmap:"City Block Heatmap",ChicagoSkyline:"Chicago Skyline"},otherBuildingsSubMenu:"Other Buildings",otherBuildingExamples:{Greenhouse:"Greenhouse",Pavilion:"Pavilion in a Park",OctagonalPagoda:"Octagonal Pagoda",OceanFront:"Ocean Front",EgyptianPyramids:"Egyptian Pyramids",MayanPyramid:"Mayan Pyramid",SiOSePol:"Si-o-se-pol",StackedCuboids:"Stacked Cuboids"},artificialIntelligenceSubMenu:"Artificial Intelligence",artificialIntelligenceExamples:{OptimizingTiltAngleOfOneSolarPanelRow:"Optimizing the Tilt Angle of a Solar Panel Row",OptimizingTiltAnglesOfMultipleSolarPanelRows:"Optimizing the Tilt Angles of Multiple Solar Panel Rows",SolarFarmGenerativeDesign:"Solar Farm Generative Design",SolarFarmGenerativeDesignWithBlock:"Solar Farm Generative Design in the Presence of a Block",FitchburgSolarFarmGenerativeDesign:"Fitchburg Solar Farm Generative Design"},languageSubMenu:"Language",publicSubMenu:"Public",ModelsGallery:"Models Gallery",ModelsMap:"Models Map",AboutUs:"About Us"},avatarMenu:{AccountSettings:"Account Settings",PrivacyStatementTitle:"User Privacy Protection Statement",PrivacyStatement:"When you sign in, your Google ID is used to create and access your Aladdin account. Only a random alphanumeric string is stored in our database as a reference. No personally identifiable data such as your name or email is ever gathered. For more information, see our ",SignIn:"Sign In",SignOut:"Sign Out",IfYouAreAStudent:"If you are a student"},skyMenu:{Axes:"Axes",Theme:"Theme",ThemeDefault:"Default",ThemeDesert:"Desert",ThemeDune:"Dune",ThemeForest:"Forest",ThemeGrassland:"Grassland",ThemeHill:"Hill",ThemeLake:"Lake",ThemeMountain:"Mountain",ThemeRural:"Rural",SunlightAttenuationCoefficientInAir:"Sunlight Attenuation Coefficient in Air",ConvectiveCoefficientOfAir:"Convective Coefficient of Air",HighestTemperatureTimeInMinutes:"Highest Temperature Time (Minutes)",SelectSunAnglesToShow:"Select Sun Angles to Show",ShowAzimuthAngle:"Show Azimuth Angle",ShowElevationAngle:"Show Elevation Angle",ShowZenithAngle:"Show Zenith Angle",DirectLightBrightnessAtNoon:"Direct Light Brightness at Noon",AmbientLightBrightnessAtNoon:"Ambient Light Brightness at Noon"},groundMenu:{MonthlyIrradianceLoss:"Monthly Irradiance Loss",Vegetation:"Vegetation",LeafOutDay:"Leaf-Out Day",LeafOffDay:"Leaf-Off Day",Albedo:"Albedo",ImageOnGround:"Image on Ground",WaterSurface:"Water Surface",RemoveAllUnlockedTrees:"Remove All Unlocked Trees",RemoveAllUnlockedFlowers:"Remove All Unlocked Flowers",RemoveAllUnlockedSolarPanels:"Remove All Unlocked Solar Panels",RemoveAllUnlockedPeople:"Remove All Unlocked People",RemoveAllUnlockedFoundations:"Remove All Unlocked Foundations",RemoveAllUnlockedCuboids:"Remove All Unlocked Cuboids",DoYouReallyWantToRemoveAllPeople:"Do you really want to remove all the people who are not locked",DoYouReallyWantToRemoveAllTrees:"Do you really want to remove all the trees that are not locked",DoYouReallyWantToRemoveAllFlowers:"Do you really want to remove all the flowers that are not locked",DoYouReallyWantToRemoveAllSolarPanels:"Do you really want to remove all the solar panels that are not locked",DoYouReallyWantToRemoveAllFoundations:"Do you really want to remove all the foundations that are not locked",DoYouReallyWantToRemoveAllCuboids:"Do you really want to remove all the cuboids that are not locked",LockAllUnlockedElements:"Lock All Unlocked Elements",UnlockAllLockedElements:"Unlock All Locked Elements"},labelSubMenu:{Label:"Label",LabelText:"Label Text",LabelHeight:"Label Height",LabelSize:"Label Size",LabelFontSize:"Font Size",LabelColor:"Label Color",KeepShowingLabel:"Keep Showing Label"},foundationMenu:{RemoveAllUnlockedSolarPanels:"Remove All Unlocked Solar Panels",RemoveAllUnlockedParabolicTroughs:"Remove All Unlocked Parabolic Troughs",RemoveAllUnlockedParabolicDishes:"Remove All Unlocked Parabolic Dishes",RemoveAllUnlockedFresnelReflectors:"Remove All Unlocked Fresnel Reflectors",RemoveAllUnlockedHeliostats:"Remove All Unlocked Heliostats",RemoveAllUnlockedWindTurbines:"Remove All Unlocked Wind Turbines",RemoveAllUnlockedSensors:"Remove All Unlocked Sensors",RemoveAllUnlockedLights:"Remove All Unlocked Lights",RemoveAllUnlockedWalls:"Remove All Unlocked Walls",RemoveAllUnlockedWindows:"Remove All Unlocked Windows",RemoveAllUnlockedDoors:"Remove All Unlocked Doors",RemoveAllUnlockedPolygons:"Remove All Unlocked Polygons",RemoveAllUnlockedHumans:"Remove All Unlocked Humans",RemoveAllUnlockedTrees:"Remove All Unlocked Trees",RemoveAllUnlockedFlowers:"Remove All Unlocked Flowers",Racks:"Racks",Texture01:"Texture 1",Texture02:"Texture 2",Texture03:"Texture 3",Texture04:"Texture 4",Texture05:"Texture 5",Texture06:"Texture 6",Texture07:"Texture 7",Texture08:"Texture 8",Texture09:"Texture 9",Texture10:"Texture 10",SolarPanels:"Solar Panels",SolarPanelArray:"Solar Panel Array",DoYouReallyWantToRemoveAllSolarPanelsOnFoundation:"Do you really want to remove all the solar panels on this foundation that are not locked",ParabolicTroughs:"Parabolic Troughs",DoYouReallyWantToRemoveAllParabolicTroughsOnFoundation:"Do you really want to remove all the parabolic troughs on this foundation that are not locked",ParabolicDishes:"Parabolic Dishes",DoYouReallyWantToRemoveAllParabolicDishesOnFoundation:"Do you really want to remove all the parabolic dishes on this foundation that are not locked",FresnelReflectors:"Fresnel Reflectors",DoYouReallyWantToRemoveAllFresnelReflectorsOnFoundation:"Do you really want to remove all the Fresnel reflectors on this foundation that are not locked",Heliostats:"Heliostats",DoYouReallyWantToRemoveAllHeliostatsOnFoundation:"Do you really want to remove all the heliostats on this foundation that are not locked",WindTurbines:"Wind Turbines",DoYouReallyWantToRemoveAllWindTurbinesOnFoundation:"Do you really want to remove all the wind turbines on this foundation that are not locked",Sensors:"Sensors",DoYouReallyWantToRemoveAllSensorsOnFoundation:"Do you really want to remove all the sensors on this foundation that are not locked",Lights:"Lights",DoYouReallyWantToRemoveAllLightsOnFoundation:"Do you really want to remove all the lights on this foundation that are not locked",Walls:"Walls",DoYouReallyWantToRemoveAllWallsOnFoundation:"Do you really want to remove all the walls on this foundation that are not locked",Windows:"Windows",DoYouReallyWantToRemoveAllWindowsOnFoundation:"Do you really want to remove all the windows on this foundation that are not locked",Doors:"Doors",DoYouReallyWantToRemoveAllDoorsOnFoundation:"Do you really want to remove all the doors on this foundation that are not locked",Polygons:"Polygons",DoYouReallyWantToRemoveAllPolygonsOnFoundation:"Do you really want to remove all the polygons on this foundation that are not locked",Humans:"Humans",DoYouReallyWantToRemoveAllHumansOnFoundation:"Do you really want to remove all the humans on this foundation who are not locked",Trees:"Trees",DoYouReallyWantToRemoveAllTreesOnFoundation:"Do you really want to remove all the trees on this foundation that are not locked",Flowers:"Flowers",DoYouReallyWantToRemoveAllFlowersOnFoundation:"Do you really want to remove all the flowers on this foundation that are not locked",OnlyThisFoundation:"Only This Foundation",AllConnectedFoundations:"All Connected Foundations",AllSelectedFoundations:"All Selected Foundations",AllFoundations:"All Foundations",AddPolygon:"Add Polygon",SolarStructure:"Solar Structure",GroupMaster:"Group Master",LockAllUnlockedElementsOnThisFoundation:"Lock All Unlocked Elements on This Foundation",UnlockAllLockedElementsOnThisFoundation:"Unlock All Locked Elements on This Foundation",GroundFloorRValue:"Ground Floor R-Value",OnlyThisGroundFloor:"Only This Ground Floor",AllGroundFloors:"All Ground Floors"},solarPowerTowerMenu:{ReceiverTowerForHeliostats:"Receiver Tower for Heliostats",ReceiverTowerPhysicalProperties:"Physical Properties of Receiver Tower",ReceiverTowerHeight:"Height of Receiver Tower",ReceiverTowerRadius:"Radius of Receiver Tower",ReceiverAbsorptance:"Absorptance of Receiver",ReceiverOpticalEfficiency:"Optical Efficiency of Receiver",ReceiverThermalEfficiency:"Thermal Efficiency of Receiver"},solarAbsorberPipeMenu:{AbsorberPipeForFresnelReflectors:"Absorber Pipe for Fresnel Reflectors",AbsorberPipePhysicalProperties:"Physical Properties of Absorber Pipe",AbsorberHeight:"Height of Absorber Pipe",AbsorberApertureWidth:"Aperture Width of Absorber Pipe",AbsorberPipePoleNumber:"Pole Number for Absorber Pipe",AbsorberAbsorptance:"Absorptance of Absorber",AbsorberOpticalEfficiency:"Optical Efficiency of Absorber",AbsorberThermalEfficiency:"Thermal Efficiency of Absorber"},solarUpdraftTowerMenu:{SolarUpdraftTower:"Solar Updraft Tower",SolarUpdraftTowerPhysicalProperties:"Physical Properties of Solar Updraft Tower",SolarUpdraftTowerChimneyHeight:"Solar Updraft Tower Chimney Height",SolarUpdraftTowerChimneyRadius:"Solar Updraft Tower Chimney Radius",SolarUpdraftTowerCollectorHeight:"Solar Updraft Tower Collector Height",SolarUpdraftTowerCollectorRadius:"Solar Updraft Tower Collector Radius",SolarUpdraftTowerCollectorTransmissivity:"Solar Updraft Tower Collector Transmissivity",SolarUpdraftTowerCollectorEmissivity:"Solar Updraft Tower Collector Emissivity",SolarUpdraftTowerDischargeCoefficient:"Solar Updraft Tower Discharge Coefficient",SolarUpdraftTowerTurbineEfficiency:"Solar Updraft Tower Turbine Efficiency"},cuboidMenu:{Texture01:"Texture 1",Texture02:"Texture 2",Texture03:"Texture 3",Texture04:"Texture 4",Texture05:"Texture 5",Texture06:"Texture 6",Texture07:"Texture 7",Texture08:"Texture 8",Texture09:"Texture 9",Texture10:"Texture 10",RemoveAllUnlockedSolarPanels:"Remove All Unlocked Solar Panels",RemoveAllUnlockedSensors:"Remove All Unlocked Sensors",RemoveAllUnlockedPolygons:"Remove All Unlocked Polygons",RemoveAllUnlockedHumans:"Remove All Unlocked Humans",RemoveAllUnlockedTrees:"Remove All Unlocked Trees",RemoveAllUnlockedFlowers:"Remove All Unlocked Flowers",RemoveAllUnlockedLights:"Remove All Unlocked Lights",Racks:"Racks",SolarPanels:"Solar Panels",DoYouReallyWantToRemoveAllSolarPanelsOnCuboid:"Do you really want to remove all the solar panels on this cuboid that are not locked",Lights:"Lights",DoYouReallyWantToRemoveAllLightsOnCuboid:"Do you really want to remove all the lights on this cuboid that are not locked",Sensors:"Sensors",DoYouReallyWantToRemoveAllSensorsOnCuboid:"Do you really want to remove all the sensors on this cuboid that are not locked",Polygons:"Polygons",DoYouReallyWantToRemoveAllPolygonsOnCuboid:"Do you really want to remove all the polygons on this cuboid that are not locked",Humans:"Humans",DoYouReallyWantToRemoveAllHumansOnCuboid:"Do you really want to remove all the humans on this cuboid who are not locked",Trees:"Trees",DoYouReallyWantToRemoveAllTreesOnCuboid:"Do you really want to remove all the trees on this cuboid that are not locked",Flowers:"Flowers",DoYouReallyWantToRemoveAllFlowersOnCuboid:"Do you really want to remove all the flowers on this cuboid that are not locked",OnlyThisCuboid:"Only This Cuboid",AllCuboidsOnSameSurface:"All Cuboids on Same Surface",AllCuboidsAboveSameBase:"All Cuboids Above Same Base",AllSelectedCuboids:"All Selected Cuboids",AllCuboids:"All Cuboids",OnlyThisSide:"Only This Side",AllSidesOfThisCuboid:"All Sides of This Cuboid",AllSidesOfSelectedCuboids:"All Sides of Selected Cuboids",AllSidesOfAllCuboids:"All Sides of All Cuboids",AddPolygon:"Add Polygon",Stackable:"Stackable",GroupMaster:"Group Master"},polygonMenu:{Texture01:"Texture 1",Texture02:"Texture 2",Texture03:"Texture 3",Texture04:"Texture 4",Texture05:"Texture 5",Texture06:"Texture 6",Texture07:"Texture 7",Texture08:"Texture 8",Texture09:"Texture 9",Texture10:"Texture 10",TextBox:"Text Box",FontOutlineColor:"Font Outline Color",FontOutlineWidth:"Font Outline Width",FontStrokeColor:"Font Stroke Color",FontStrokeWidth:"Font Stroke Width",NoOutline:"No Outline",Shiny:"Shiny",Filled:"Filled",FillTexture:"Fill Texture",FillColor:"Fill Color",Opacity:"Opacity",LineColor:"Line Color",LineWidth:"Line Width",LineStyle:"Line Style",SolidLine:"Solid Line",DashedLine:"Dashed Line",DottedLine:"Dotted Line",InsertVertexBeforeIndex:"Insert Vertex Before Index",InsertVertexAfterIndex:"Insert Vertex After Index",DeleteVertex:"Delete Vertex",OnlyThisPolygon:"Only This Polygon",AllPolygonsOnSurface:"All Polygons on the Same Surface",AllPolygonsAboveFoundation:"All Polygons Above Foundation",AllSelectedPolygons:"All Selected Polygons",AllPolygons:"All Polygons",Layout:"Layout",SolarPanelArrayLayout:"Solar Panel Array Layout",SolarPanelArrayLayoutParametricDesign:"Solar Panel Array Layout: Parametric Design",SolarPanelArrayLayoutGenerativeDesign:"Solar Panel Array Layout: Generative Design",SolarPanelArrayModel:"Solar Panel Model",SolarPanelArrayOrientation:"Orientation",SolarPanelArrayTiltAngle:"Tilt Angle",SolarPanelArrayRowWidth:"Row Width",SolarPanelArrayInterRowSpacing:"Inter-Row Spacing",SolarPanelArrayRowSpacing:"Row Spacing",SolarPanelArrayRowAxis:"Row Axis",SolarPanelArrayLeftRightRowAxis:"Left-Right (Relative)",SolarPanelArrayUpDownRowAxis:"Up-Down (Relative)",SolarPanelArrayEastWestRowAxis:"East-West (Absolute)",SolarPanelArrayNorthSouthRowAxis:"North-South (Absolute)",SolarPanelArrayMargin:"Margin",SolarPanelArrayPoleHeight:"Pole Height",SolarPanelArrayPoleSpacing:"Pole Spacing",SolarPanelArrayTotalYearlyCost:"Total Cost",SolarPanelArrayTotalYearlyRevenue:"Total Revenue",SolarPanelArrayTotalYearlyYield:"Total Yield",SolarPanelArrayMeanYearlyYield:"Mean Yield",SolarPanelArrayYearlyProfit:"Profit",LayoutNotAcceptedCheckYourParameters:"This layout is not accepted. Please check your parameters."},optimizationMenu:{Optimization:"Optimization",Parameters:"Parameters",Variables:"Variables",Constants:"Constants",GeneticAlgorithm:"Genetic Algorithm",GeneticAlgorithmSettings:"Genetic Algorithm Settings",ParticleSwarmOptimization:"Particle Swarm Optimization",ParticleSwarmOptimizationSettings:"Particle Swarm Optimization Settings",SolarPanelTiltAngleOptimization:"Solar Panel Tilt Angle Optimization",SolarPanelArrayLayout:"Solar Panel Array Layout",Generation:"Generation",Gene:"Gene",NormalizedVariables:"Normalized Variables",Objective:"Objective",ObjectiveFunctionDailyTotalYield:"Daily Total Yield",ObjectiveFunctionYearlyTotalYield:"Yearly Total Yield",ObjectiveFunctionDailyMeanYield:"Daily Mean Yield",ObjectiveFunctionYearlyMeanYield:"Yearly Mean Yield",ObjectiveFunctionDailyProfit:"Daily Profit",ObjectiveFunctionYearlyProfit:"Yearly Profit",GeneticAlgorithmSelectionMethod:"Genetic Algorithm Selection Method",RouletteWheel:"Roulette Wheel",Tournament:"Tournament",SearchMethod:"Search Method",GlobalSearchUniformSelection:"Global Search Uniform Selection",LocalSearchRandomOptimization:"Local Search Random Optimization",PopulationSize:"Population Size",MaximumGenerations:"Maximum Generations",SelectionRate:"Selection Rate",CrossoverRate:"Crossover Rate",MutationRate:"Mutation Rate",Step:"Step",SwarmSize:"Swarm Size",MaximumSteps:"Maximum Steps",MaximumVelocity:"Maximum Velocity",InertiaWeight:"Inertia Weight",CognitiveCoefficient:"Cognitive Coefficient",SocialCoefficient:"Social Coefficient",ConvergenceThreshold:"Convergence Threshold for Termination",LocalSearchRadius:"Local Search Radius",RowsPerRackRange:"Range for Rows per Rack",TiltAngleRange:"Range for Tilt Angle",InterRowSpacingRange:"Range for Inter-Row Spacing",ClickTargetPolygonToActivate:"Click Target Polygon to Activate",ClickTargetFoundationToActivate:"Click Target Foundation to Activate"},treeMenu:{ShowModel:"Show Model",Flip:"Flip",Type:"Type",Spread:"Spread"},flowerMenu:{Flip:"Flip",Type:"Type",Spread:"Spread"},peopleMenu:{ChangePerson:"Change Person",Flip:"Flip",Observer:"Observer",ViewFromThisPerson:"View from This Person"},lightMenu:{Color:"Color",Intensity:"Intensity",Decay:"Decay",MaximumDistance:"Distance",Inside:"Inside"},solarCollectorMenu:{Coordinates:"Coordinates",RelativeXCoordinateOfCenter:"Relative X Coordinate of Center",RelativeYCoordinateOfCenter:"Relative Y Coordinate of Center",RelativeAzimuth:"Relative Azimuth",Pole:"Pole",PoleHeight:"Pole Height",PoleRadius:"Pole Radius",ExtraPoleHeight:"Extra Pole Height",ExtraPoleHeightInAdditionToHalfWidth:"Extra Pole Height in Addition to Half Width",DrawSunBeam:"Draw Sun Beam"},concentratedSolarPowerCollectorMenu:{ReflectorReflectance:"Reflector Reflectance",ReceiverAbsorptance:"Receiver Absorptance",ReflectorOpticalEfficiency:"Reflector Optical Efficiency",ReceiverThermalEfficiency:"Receiver Thermal Efficiency"},solarPanelMenu:{ElectricalProperties:"Electrical Properties",InverterEfficiency:"Inverter Efficiency",InverterEfficiencyExplained:"The efficiency for converting direct current (DC) to alternating current (AC).",DcToAcSizeRatio:"DC-to-AC Size Ratio",DcToAcSizeRatioExplained:"The ratio of the solar panels' DC-rated size to the inverter's AC-rated size.",ChangePvModel:"Change PV Model",Orientation:"Orientation",Portrait:"Portrait",Landscape:"Landscape",FrameColor:"Frame Color",Panels:"panels",PanelsWide:"panels wide",PanelsLong:"panels long",TiltAngle:"Tilt Angle",SouthFacingIsPositive:"South facing is positive",Tracker:"Tracker",SolarTrackerFollowsSun:"A tracker follows the sun to increase solar panel outputs.",PoleSpacing:"Pole Spacing",NoTracker:"No Tracker",HorizontalSingleAxisTracker:"Horizontal Single Axis Tracker",VerticalSingleAxisTracker:"Vertical Single Axis Tracker",AltazimuthDualAxisTracker:"Altazimuth Dual Axis Tracker",OnlyThisSolarPanel:"Only This Solar Panel",AllSolarPanelsOnSurface:"All Solar Panels on the Same Surface",AllSolarPanelsAboveFoundation:"All Solar Panels Above the Same Foundation",AllSelectedSolarPanels:"All Selected Solar Panels",AllSolarPanels:"All Solar Panels"},waterHeaterMenu:{OnlyThisWaterHeater:"Only This Water Heater",AllWaterHeatersOnSurface:"All Water Heaters on the Same Surface",AllWaterHeatersAboveFoundation:"All Water Heaters Above the Same Foundation",AllSelectedWaterHeaters:"All Selected Water Heaters",AllWaterHeaters:"All Water Heaters"},pvModelPanel:{SolarPanelSpecs:"Solar Panel Specs",Model:"Model",PanelSize:"Panel Size",Cells:"Cells",CellType:"Cell Type",Monocrystalline:"Monocrystalline",Polycrystalline:"Polycrystalline",ThinFilm:"Thin Film",Bifacial:"Bifacial",BifacialityFactor:"Bifaciality Factor",Black:"Black",Blue:"Blue",ShadeTolerance:"Shade Tolerance",SolarCellEfficiency:"Solar Cell Efficiency",NominalOperatingCellTemperature:"Nominal Operating Cell Temperature",TemperatureCoefficientOfPmax:"Temperature Coefficient of Pmax"},parabolicTroughMenu:{ModuleLength:"Module Length",Modules:"modules",ModulesLong:"modules long",LatusRectum:"Latus Rectum",OnlyThisParabolicTrough:"Only This Parabolic Trough",AllParabolicTroughsAboveFoundation:"All Parabolic Troughs Above the Same Foundation",AllSelectedParabolicTroughs:"All Selected Parabolic Troughs",AllParabolicTroughs:"All Parabolic Troughs"},fresnelReflectorMenu:{AbsorberPipe:"Absorber Pipe",SelectAbsorberToReflectSunlightTo:"Select Absorber to Reflect Sunlight to",ModuleLength:"Module Length",Modules:"modules",ModulesLong:"modules long",OnlyThisFresnelReflector:"Only This Fresnel Reflector",AllFresnelReflectorsAboveFoundation:"All Fresnel Reflectors Above the Same Foundation",AllSelectedFresnelReflectors:"All Selected Fresnel Reflectors",AllFresnelReflectors:"All Fresnel Reflectors"},heliostatMenu:{Tower:"Tower",SelectTowerToReflectSunlightTo:"Select Tower to Reflect Sunlight to",OnlyThisHeliostat:"Only This Heliostat",AllHeliostatsAboveFoundation:"All Heliostats Above the Same Foundation",AllSelectedHeliostats:"All Selected Heliostats",AllHeliostats:"All Heliostats"},parabolicDishMenu:{ReceiverStructure:"Receiver Structure",CentralPole:"Central Pole",CentralPoleWithTripod:"Central Pole with Tripod",Quadrupod:"Quadrupod",RimDiameter:"Rim Diameter",LatusRectum:"Latus Rectum",ExtraPoleHeightInAdditionToRadius:"Extra Pole Height in Addition to Radius",OnlyThisParabolicDish:"Only This Parabolic Dish",AllParabolicDishesAboveFoundation:"All Parabolic Dishes Above the Same Foundation",AllSelectedParabolicDishes:"All Selected Parabolic Dishes",AllParabolicDishes:"All Parabolic Dishes"},windTurbineMenu:{BirdSafeDesign:"Bird-Safe Design",BirdSafeNone:"None",BirdSafeBicolor:"Bicolor",BirdSafeStriped:"Striped",Rotor:"Rotor",BladeNumber:"Blade Number",RotorInitialAngle:"Rotor Initial Angle",RotorBladeDesign:"Rotor Blade Design",RotorBladeRadius:"Rotor Blade Radius",RotorBladePitchAngle:"Rotor Blade Pitch Angle",RelativeYawAngle:"Relative Yaw Angle",MaximumChordLength:"Maximum Chord Length",Tower:"Tower",TowerHeight:"Tower Height",TowerRadius:"Tower Radius",HubDesign:"Hub Design",HubRadius:"Hub Radius",HubLength:"Hub Length",OnlyThisWindTurbine:"Only This Wind Turbine",AllWindTurbinesAboveFoundation:"All Wind Turbines Above the Same Foundation",AllSelectedWindTurbines:"All Selected Wind Turbines",AllWindTurbines:"All Wind Turbines"},wallMenu:{TextureDefault:"Default",Texture01:"Texture 1",Texture02:"Texture 2",Texture03:"Texture 3",Texture04:"Texture 4",Texture05:"Texture 5",Texture06:"Texture 6",Texture07:"Texture 7",Texture08:"Texture 8",Texture09:"Texture 9",Texture10:"Texture 10",SizeOfWall:"Size of Wall",OnlyThisWall:"Only This Wall",AllConnectedWalls:"All Connected Walls",AllWallsAboveFoundation:"All Walls Above the Same Foundation",AllSelectedWalls:"All Selected Walls",AllWalls:"All Walls",Windows:"Windows",LockAllUnlockedWindows:"Lock All Unlocked Windows",UnlockAllLockedWindows:"Unlock All Locked Windows",RemoveAllUnlockedWindows:"Remove All Unlocked Windows",DoYouReallyWantToRemoveAllWindowsOnThisWall:"Do you really want to remove all the windows on this wall",Doors:"Doors",LockAllUnlockedDoors:"Lock All Unlocked Doors",UnlockAllLockedDoors:"Unlock All Locked Doors",RemoveAllUnlockedDoors:"Remove All Unlocked Doors",DoYouReallyWantToRemoveAllDoorsOnThisWall:"Do you really want to remove all the doors on this wall",SolarPanels:"Solar Panels",LockAllUnlockedSolarPanels:"Lock All Unlocked Solar Panels",UnlockAllLockedSolarPanels:"Unlock All Locked Solar Panels",RemoveAllUnlockedSolarPanels:"Remove All Unlocked Solar Panels",DoYouReallyWantToRemoveAllSolarPanelsOnThisWall:"Do you really want to remove all the solar panels on this wall",Sensors:"Sensors",LockAllUnlockedSensors:"Lock All Unlocked Sensors",UnlockAllLockedSensors:"Unlock All Locked Sensors",RemoveAllUnlockedSensors:"Remove All Unlocked Sensors",DoYouReallyWantToRemoveAllSensorsOnThisWall:"Do you really want to remove all the sensors on this wall",Lights:"Lights",LockAllUnlockedLights:"Lock All Unlocked Lights",UnlockAllLockedLights:"Unlock All Locked Lights",RemoveAllUnlockedLights:"Remove All Unlocked Lights",DoYouReallyWantToRemoveAllLightsOnThisWall:"Do you really want to remove all the lights on this wall",Polygons:"Polygons",LockAllUnlockedPolygons:"Lock All Unlocked Polygons",UnlockAllLockedPolygons:"Unlock All Locked Polygons",RemoveAllUnlockedPolygons:"Remove All Unlocked Polygons",DoYouReallyWantToRemoveAllPolygonsOnThisWall:"Do you really want to remove all the polygons on this wall",WallStructure:"Wall Structure",DefaultStructure:"Default",StudStructure:"Stud",PillarStructure:"Pillar",Opacity:"Opacity",StructureSpacing:"Structure Spacing",StructureWidth:"Structure Width",StructureThickness:"Structure Thickness",StructureColor:"Structure Color",Color:"Wall Color",Height:"Height",Thickness:"Thickness",Texture:"Texture",AllLightsOnWallInside:"All Lights on Wall Inside",AllLightsOnWallOutside:"All Lights on Wall Outside",Fill:"Fill",Full:"Full",Partial:"Partial",Empty:"Empty",OpenToOutside:"Open to Outside",EavesLength:"Eaves Overhang Length",Parapet:"Parapet",ParapetColor:"Parapet Color",ParapetTexture:"Parapet Texture",ParapetHeight:"Parapet Height",CopingsHeight:"Copings Height",CopingsWidth:"Copings Width"},windowMenu:{OnlyThisWindow:"Only This Window",AllWindowsOnSurface:"All Windows on the Same Surface",AllWindowsAboveFoundation:"All Windows Above the Same Foundation",AllSelectedWindows:"All Selected Windows",AllWindows:"All Windows",Width:"Width",Height:"Height",Setback:"Setback from Exterior Surface",RelativeToWallThickness:"Relative to wall thickness",Mullion:"Mullion",HorizontalMullion:"Horizontal Mullion",VerticalMullion:"Vertical Mullion",MullionWidth:"Mullion Width",HorizontalMullionSpacing:"Horizontal Mullion Spacing",VerticalMullionSpacing:"Vertical Mullion Spacing",MullionColor:"Mullion Color",Tint:"Tint",Opacity:"Opacity",SolarHeatGainCoefficient:"Solar heat gain coefficient (SHGC) = 1 - opacity",Shutter:"Shutter",LeftShutter:"Left Shutter",RightShutter:"Right Shutter",BothShutters:"Both Shutters",ShutterWidth:"Relative Width",ShutterColor:"Shutter Color",Frame:"Frame",FrameWidth:"Frame Width",SillWidth:"Sill Width",Color:"Frame Color",WindowType:"Window Type",Default:"Default",Arched:"Arched",Polygonal:"Polygonal",Interior:"Interior",Empty:"Empty"},roofMenu:{TextureDefault:"Default",Texture01:"Texture 1",Texture02:"Texture 2",Texture03:"Texture 3",Texture04:"Texture 4",Texture05:"Texture 5",Texture06:"Texture 6",Texture07:"Texture 7",OnlyThisRoof:"Only This Roof",AllRoofsAboveFoundation:"All Roofs Above the Same Foundation",AllSelectedRoofs:"All Selected Roofs",AllRoofs:"All Roofs",OnlyThisCeiling:"Only This Ceiling",AllCeilingsAboveFoundation:"All Ceilings Above the Same Foundation",AllCeilings:"All Ceilings",EavesOverhangLength:"Eaves Overhang Length",RafterSpacing:"Rafter Spacing",RafterWidth:"Rafter Width",RafterThickness:"Rafter Thickness",RafterColor:"Rafter Color",RoofColor:"Roof Color",RoofSideColor:"Roof Side Color",GlassTint:"Glass Tint",Opacity:"Opacity",RoofStructure:"Roof Structure",DefaultStructure:"Default",RafterStructure:"Rafter",GlassStructure:"Glass",SolarPanels:"Solar Panels",LockAllUnlockedSolarPanels:"Lock All Unlocked Solar Panels",UnlockAllLockedSolarPanels:"Unlock All Locked Solar Panels",RemoveAllUnlockedSolarPanels:"Remove All Unlocked Solar Panels",DoYouReallyWantToRemoveAllSolarPanelsOnThisRoof:"Do you really want to remove all the solar panels on this roof",Windows:"Windows",LockAllUnlockedWindows:"Lock All Unlocked Windows",UnlockAllLockedWindows:"Unlock All Locked Windows",RemoveAllUnlockedWindows:"Remove All Unlocked Windows",DoYouReallyWantToRemoveAllWindowsOnThisRoof:"Do you really want to remove all the windows on this roof",Sensors:"Sensors",LockAllUnlockedSensors:"Lock All Unlocked Sensors",UnlockAllLockedSensors:"Unlock All Locked Sensors",RemoveAllUnlockedSensors:"Remove All Unlocked Sensors",DoYouReallyWantToRemoveAllSensorsOnThisRoof:"Do you really want to remove all the sensors on this roof",Lights:"Lights",RemoveAllUnlockedLights:"Remove All Unlocked Lights",DoYouReallyWantToRemoveAllLightsOnThisRoof:"Do you really want to remove all the lights on this roof",AllLightsOnRoofInside:"All Lights on Roof Inside",AllLightsOnRoofOutside:"All Lights on Roof Outside",Rise:"Rise",Ceiling:"Ceiling",RoofRValue:"Roof R-Value",CeilingRValue:"Ceiling R-Value"},doorMenu:{TextureDefault:"Default",Texture01:"Texture 1",Texture02:"Texture 2",Texture03:"Texture 3",Texture04:"Texture 4",Texture05:"Texture 5",Texture06:"Texture 6",Texture07:"Texture 7",Texture08:"Texture 8",Texture09:"Texture 9",Texture10:"Texture 10",Texture11:"Texture 11",Texture12:"Texture 12",Texture13:"Texture 13",Texture14:"Texture 14",Texture15:"Texture 15",Texture16:"Texture 16",Texture17:"Texture 17",OnlyThisDoor:"Only This Door",AllDoorsOnWall:"All Doors on the Same Wall",AllDoorsAboveFoundation:"All Doors Above the Same Foundation",AllSelectedDoors:"All Selected Doors",AllDoors:"All Doors",DoorType:"Door Type",Default:"Default",Arched:"Arched",Filled:"Filled",FrameColor:"Frame Color",Interior:"Interior"},siteInfoPanel:{High:"High",Low:"Low"},designInfoPanel:{NumberOfSelectedHeliostats:"Number of selected heliostats",NumberOfSelectedSolarPanels:"Number of selected solar panels",ElectricityGeneratedDailyBySolarPanels:"Electricity generated daily by these solar panels",SceneDiameter:"Scene diameter",BuildingArea:"Building area"},visualizationControlPanel:{ColorContrast:"Color Contrast",FluxScale:"Flux Scale",ClickUpOrDownArrowButtonsToChange:"Click up or down arrow buttons to change"},instructionPanel:{Rotate:"Rotate",DragMouse:"Drag mouse",Zoom:"Zoom",MouseWheelOrKeys:"Rotate mouse wheel or press Ctrl+[ or Ctrl+]",MouseWheelOrKeysMac:"Rotate mouse wheel or press ⌘+[ or ⌘+]",Pan:"Pan",HoldCtrlDragMouse:"Hold Ctrl and drag mouse",HoldMetaDragMouse:"Hold ⌘ and drag mouse",Enter2DMode:"Enter 2D mode",Exit2DMode:"Exit 2D mode",NavigationMode:"Navigation mode",EnableNavigation:"Enable navigation",DisableNavigation:"Disable navigation",MoveForwardBack:"Move forward/back",MoveForwardBackInstruction:"Press W/S",MoveLeftRight:"Move left/right",MoveLeftRightInstruction:"Press A/D",MoveUpDown:"Move up/down",MoveUpDownInstruction:"Press Z/X",Turn:"Turn",TurnInstruction:"Press arrow keys",ResetView:"Reset",AutoRotate:"Auto rotate",StartOrStop:"Press F4 to start or stop"},mapPanel:{ImageOnGround:"Image on Ground",HideAddress:"Hide Address",WeatherStations:"Weather Stations",WeatherStationsNote:"Turn this off to speed up",Coordinates:"Coordinates",Zoom:"Zoom"},visibilityPanel:{SolarPanelVisibility:"Solar Panel Visibility",Observer:"Observer",VantagePoint:"Vantage Point",ItemizedVisibilityByFields:"Itemized by Fields",TotalVisibility:"Total"},sensorPanel:{LightSensor:"Light Sensor",WeatherDataFrom:"Weather Data from"},buildingEnergyPanel:{DailyBuildingEnergy:"Daily Building Energy",YearlyBuildingEnergy:"Yearly Building Energy",Heater:"Heater",AC:"AC",SolarPanel:"Solar Panel",Net:"Net"},solarPanelYieldPanel:{SolarPanelDailyYield:"Solar Panel Daily Yield",SolarPanelYearlyYield:"Solar Panel Yearly Yield",Yield:"Yield",YieldPerHour:"Yield per Hour",DailyTotal:"Daily Total",YearlyTotal:"Yearly Total",ShowOutputsOfIndividualSolarPanels:"Show outputs of individual solar panels",Profit:"Profit",TotalCost:"Total Cost",TotalRevenue:"Total Revenue",TotalYield:"Total Yield",MeanYield:"Mean Yield",ModuleCount:"Module Count"},parabolicTroughYieldPanel:{ParabolicTroughDailyYield:"Parabolic Trough Daily Yield",ParabolicTroughYearlyYield:"Parabolic Trough Yearly Yield",Yield:"Yield",YieldPerHour:"Yield per Hour",DailyTotal:"Daily Total",YearlyTotal:"Yearly Total",ShowOutputsOfIndividualParabolicTroughs:"Show outputs of individual parabolic troughs"},parabolicDishYieldPanel:{ParabolicDishDailyYield:"Parabolic Dish Daily Yield",ParabolicDishYearlyYield:"Parabolic Dish Yearly Yield",Yield:"Yield",YieldPerHour:"Yield per Hour",DailyTotal:"Daily Total",YearlyTotal:"Yearly Total",ShowOutputsOfIndividualParabolicDishes:"Show outputs of individual parabolic dishes"},fresnelReflectorYieldPanel:{FresnelReflectorDailyYield:"Fresnel Reflector Daily Yield",FresnelReflectorYearlyYield:"Fresnel Reflector Yearly Yield",Yield:"Yield",YieldPerHour:"Yield per Hour",DailyTotal:"Daily Total",YearlyTotal:"Yearly Total",ShowOutputsOfIndividualFresnelReflectors:"Show outputs of individual Fresnel feflectors"},heliostatYieldPanel:{HeliostatDailyYield:"Heliostat Daily Yield",HeliostatYearlyYield:"Heliostat Yearly Yield",Yield:"Yield",YieldPerHour:"Yield per Hour",DailyTotal:"Daily Total",YearlyTotal:"Yearly Total",ShowOutputsOfIndividualHeliostats:"Show outputs of individual heliostats"},updraftTowerYieldPanel:{UpdraftTowerDailyYield:"Solar Updraft Tower Daily Yield",UpdraftTowerYearlyYield:"Solar Updraft Tower Yearly Yield",ChimneyAirTemperature:"Chimney Air Temperature",ChimneyWindSpeed:"Chimney Wind Speed",Yield:"Yield",YieldPerHour:"Yield per Hour",DailyTotal:"Daily Total",YearlyTotal:"Yearly Total",ShowOutputsOfIndividualUpdraftTowers:"Show outputs of individual updraft towers"},heliodonPanel:{SunAndTimeSettings:"Sun & Time Settings",SunAngles:"Angles",TwentyFourHours:"24 Hours"},cloudFilePanel:{CopyTitle:"Copy Title",TitleCopiedToClipBoard:"The title was copied to the clip board",SearchByTitle:"Search by title",MyLikes:"My Likes",MyCloudFiles:"My Cloud Files",GenerateLink:"Generate Link",LinkGeneratedInClipBoard:"A link was generated in the clip board",DoYouReallyWantToDelete:"Do you really want to delete",IfSharedOrPublishedRenamingFileBreaksExistingLinks:"If this file has been shared or published, renaming it breaks existing links"},projectListPanel:{CopyTitle:"Copy Title",TitleCopiedToClipBoard:"The title was copied to the clip board",SearchByTitle:"Search by title",MyProjects:"My Projects",GenerateProjectLink:"Generate Project Link",ProjectLinkGeneratedInClipBoard:"A link to the project was generated in the clip board",DoYouReallyWantToDeleteProject:"Do you really want to delete Project",IfSharedOrPublishedRenamingProjectBreaksExistingLinks:"If this project has been shared or published, renaming it breaks existing links"},projectPanel:{ProjectSettings:"Project Settings",ThumbnailImageSize:"Thumbnail Image Size",ProjectByOtherPeople:"Project by Other People",Project:"Project",ProjectType:"Type",ProjectDescription:"Description",MakeDescriptionEditable:"Make this description editable",MakeDescriptionNonEditable:"Make this description non-editable",DoubleClickToMakeDescriptionEditable:"Double-click to make this description editable",SolarPanelArray:"Solar Panel Array",CurateCurrentDesign:"Curate current design",UpdateSelectedDesign:"Update selected design",RemoveSelectedDesign:"Remove selected design",ClickToFlipSortingOrder:"Click to flip the sorting order",DesignNotShownInSolutionSpaceClickToShow:"This design is not shown in solution space; click to show",DesignShownInSolutionSpaceClickToHide:"This design is shown in solution space; click to hide",SolutionSpace:"Solution Space",ChooseSolutionSpace:"Choose solution space",ChooseDataColoring:"Choose data coloring",SameColorForAllDesigns:"Same color for all designs",OneColorForEachDesign:"One color for each design",SolutionSpaceScreenshot:"Take a screenshot of the solution space",ScatterPlotScreenshot:"Take a screenshot of the scatter plot",SingleClickToSelectDoubleClickToOpen:"Single-click to select, double-click to open.",SingleClickToDeselectDoubleClickToOpen:"Single-click to deselect, double-click to open.",GenerateScatterPlot:"Generate Scatter Plot",SelectXAxis:"Select X Axis",SelectYAxis:"Select Y Axis"},accountSettingsPanel:{MyAccountSettings:"My Account Settings",MyID:"My 🆔",ClickToCopyMyID:"Click to copy my ID",IDInClipBoard:"Your ID was copied and is ready to paste.",StoreMyNameInMyFilesWhenSaving:"Store my name in my files when saving",DoYouReallyWantToShowYourNameInYourFiles:"Do you really want to show your display name in your files?",SignFileDisclaimer:"If yes, your display name may be seen by anyone who can access your files.",Likes:"Likes",AllPublished:"All Published",PublishedUnderAliases:"Aliases",UserCount:"User Count",SchoolID:"School ID",ClassID:"Class ID"},weatherPanel:{SunshineHours:"Sunshine"},diurnalTemperaturePanel:{SelectAirTemperatureModel:"Select Air Temperature Model",Sinusoidal:"Sinusoidal"},economicsPanel:{EconomicsParameters:"Economics Parameters",ElectricitySellingPrice:"Electricity Selling Price",OperationalCostPerUnit:"Operational Cost per Unit",SellingPrice:"Selling Price",UnitCost:"Unit Cost"},navigationPanel:{NavigationParameters:"Navigation Parameters",MinimumMoveSpeed:"Minimum Move Speed",MinimumTurnSpeed:"Minimum Turn Speed"},shadowSettingsPanel:{ShadowSettings:"Shadow Settings",ShadowCameraFarDistance:"Shadow Camera Far Distance",ShadowMapSize:"Shadow Map Size",Notes:"Notes",RefreshPageNote:"Refresh the page for the new settings to take effect.",MapSizeWarning:"A large shadow map size may cause Aladdin to crash on some computers."},yearlyLightSensorPanel:{SkyClearness:"Clearness",ShowDaylightResults:"Show daylight results",ShowSkyClearnessResults:"Show sky clearness results",ShowAverageDailySolarRadiation:"Show average daily solar radiation"},analysisManager:{NoSensorForCollectingData:"There is no sensor for collecting data.",NoSolarPanelForAnalysis:"There is no solar panel for analysis.",NoObserverForVisibilityAnalysis:"There is no observer for visibility analysis.",NoWaterHeaterForAnalysis:"There is no water heater for analysis.",NoParabolicDishForAnalysis:"There is no parabolic dish for analysis.",NoParabolicTroughForAnalysis:"There is no parabolic trough for analysis.",NoFresnelReflectorForAnalysis:"There is no Fresnel reflector for analysis.",NoHeliostatForAnalysis:"There is no heliostat for analysis.",NoSolarUpdraftTowerForAnalysis:"There is no solar updraft tower for analysis.",NoBuildingForAnalysis:"There is no building for analysis."},toolbar:{CloudFile:"Cloud file",Select:"Select",AddFoundation:"Add Foundation",AddWall:"Add Wall",AddWindow:"Add Window",AddDoor:"Add Door",AddPyramidRoof:"Add Pyramid Roof",AddGableRoof:"Add Gable Roof",AddHipRoof:"Add Hip Roof",AddGambrelRoof:"Add Gambrel Roof",AddMansardRoof:"Add Mansard Roof",AddCuboid:"Add Cuboid",AddSensor:"Add Sensor",AddSolarPanel:"Add Solar Panel",AddWaterHeater:"Add Water Heater",AddPowerWall:"Add Power Wall",AddParabolicDish:"Add Parabolic Dish",AddParabolicTrough:"Add Parabolic Trough",AddFresnelReflector:"Add Fresnel Reflector",AddHeliostat:"Add Heliostat",AddWindTurbine:"Add Horizontal Axis Wind Turbine",AddVerticalAxisWindTurbine:"Add Vertical Axis Wind Turbine",AddLight:"Add Light",AddTree:"Add Tree",AddFlower:"Add Flower",AddPeople:"Add People",DoubleClickToLockThisModeForNextAction:"Double-click to lock this mode for next action",ClickToUnlockThisModeForNextAction:"Click to unlock this mode for next action",ManipulateGroup:"Manipulate a group",ClearScene:"Clear scene",ShowSunAndTimeSettings:"Show sun and time settings",SpatialAnalysisOfEnergy:"Spatial analysis of energy",DoYouReallyWantToClearContent:"Do you really want to clear the content",ClickForMoreButtons:"Click for more buttons"},tooltip:{gotoIFI:"Go to Institute for Future Intelligence",visitAladdinHomePage:"Visit Aladdin Homepage",clickToOpenMenu:"Click to open main menu",clickToAccessAccountSettings:"Click to access account settings"},tree:{Apple:"Apple",Birch:"Birch",Coconut:"Coconut",Dogwood:"Dogwood",Elm:"Elm",FanPalm:"Fan Palm",Linden:"Linden",Magnolia:"Magnolia",Maple:"Maple",Oak:"Oak",Pine:"Pine",Spruce:"Spruce"},flower:{Bellflower:"Bellflower",Boxwood:"Boxwood",CactusCombo1:"Cactus Combo 1",CactusCombo2:"Cactus Combo 2",CactusCombo3:"Cactus Combo 3",CactusCombo4:"Cactus Combo 4",Hibiscus:"Hibiscus",Hosta:"Hosta",Hydrangea:"Hydrangea",Peony:"Peony",RedRose:"Red Rose",Spirea:"Spirea",Sunflower:"Sunflower",TallBush:"Tall Bush",Tulip:"Tulip",WhiteFlower:"White Flower",YellowFlower:"Yellow Flower"},people:{Jaah:"Jaah",Jack:"Jack",Jacob:"Jacob",Jacqueline:"Jacqueline",Jade:"Jade",Jamelia:"Jamelia",James:"James",Jane:"Jane",Jaya:"Jaya",Jaye:"Jaye",Jeanette:"Jeanette",Jedi:"Jedi",Jeff:"Jeff",Jena:"Jena",Jennifer:"Jennifer",Jess:"Jess",Jett:"Jett",Jill:"Jill",Jiya:"Jiya",Joan:"Joan",Jocelyn:"Jocelyn",Joel:"Joel",Joey:"Joey",John:"John",Jonathon:"Jonathon",Jose:"Jose",Joseph:"Joseph",Joshua:"Joshua",Judd:"Judd",Judy:"Judy",Julia:"Julia",Julio:"Julio",Jumapili:"Jumapili",June:"June",Juro:"Juro",Justin:"Justin"},compass:{N:"N",S:"S",W:"W",E:"E"},month:{January:"Jan",February:"Feb",March:"Mar",April:"Apr",May:"May",June:"Jun",July:"Jul",August:"Aug",September:"Sep",October:"Oct",November:"Nov",December:"Dec"},modelsMap:{SearchByPublisher:"Search by publisher",SearchByLabel:"Search by label",MyPublishedModels:"My Published Models",TotalNumberOfUserPublishedModels:"Total number of user-published models",SortFromOldestToNewest:"Sort from oldest to newest",SortFromNewestToOldest:"Sort from newest to oldest",ModelsFoundOnThisSite:"models found on this site",ShowModelsPublishedByThisAuthor:"Show the models published by this author"}}},cpt={translation:{name:{IFI:"未来智能研究所",Aladdin:"阿拉丁",Tagline:"阿拉丁: 探索人工智能时代的设计软件 — 未来智能研究所研发"},cookie:{Statement:"声明:为了改善您的用户体验,阿拉丁采用cookie储存少量数据。",Accept:"同意"},aboutUs:{ProductBroughtToYouBy:"未来智能研究所荣誉出品",TermsOfService:"服务条款",PrivacyPolicy:"隐私政策",Software:"软件",Content:"课件",Research:"研究",Support:"服务",Acknowledgment:"鸣谢",FundingInformation:"本产品的研发承蒙美国国家科学基金会慷慨资助(项目号#2105695,#2131097,#2301164)。本产品的任何观点或结论仅代表创作者个人意见。",Contact:"如您需要更多信息,请联系 Charles Xie (charles@intofuture.org)。我们会尽快回复。",Translators:"翻译"},word:{Refresh:"刷新",LastUpdate:"上一次更新",Small:"小",Medium:"中",Large:"大",Design:"设计",Information:"信息",Type:"类别",Text:"文字",FontSize:"字体大小",FontColor:"字体颜色",Model:"模型",Models:"模型",Upload:"上传",ClickCount:"点击数",Share:"分享",AlreadyLike:"已点赞",Like:"点赞",MustLogInToLike:"必须登录才能点赞",AllRightsReserved:"版权所有",MeterAbbreviation:"米",Version:"版本",VersionInitial:"版本",Options:"选项",Maximum:"最大",Minimum:"最小",MaximumNumber:"最多",MinimumNumber:"最少",MaximumValue:"最大值",MinimumValue:"最小值",Or:"或",None:"无",High:"高",Partial:"部分",Teacher:"老师",Class:"班级",Total:"总数",Leaderboard:"用戶排行榜",Latest:"最新",Range:"范围",SIUnit:"国际单位制",USUnit:"美国单位制",ThermalTransmittance:"热透过率",ThermalResistance:"热阻",UValue:"U值",RValue:"R值",VolumetricHeatCapacity:"容积热容",BuildingHVACSystem:"建筑物暖通空调系统",ThermostatSetpoint:"恒温器设定值",TemperatureToleranceThreshold:"温度忍耐阈值",TemperatureToleranceThresholdExplanation:`当日最低外面温度高于恒温器设定值减去此阈值,暖气不开。 当日最高外面温度低于恒温器设定值加上此阈值,空调不开。`,Press:"按",Open:"打开",Save:"保存",SaveAsImage:"保存为图像",SaveAsCsv:"保存为CSV",Update:"刷新",Paste:"粘贴",Copy:"复制",Cut:"剪切",Delete:"删除",Lock:"固定",Translucent:"半透明",Transparency:"透明度",Color:"颜色",Pattern:"图案",Texture:"材质",Thickness:"厚度",Size:"尺寸",Yes:"是",No:"不",OK:"确定",Cancel:"取消",Apply:"应用",Close:"关闭",ApplyTo:"适用于",Run:"运行",Pause:"暂停",Resume:"继续",Clear:"清空",Warning:"警告",Caution:"小心",Reminder:"提醒",Length:"长度",Width:"宽度",Height:"高度",Radius:"半径",Angle:"角度",Azimuth:"方位角",Coordinates:"坐标",Weather:"天气",Show:"显示",Animate:"动画",Date:"日期",Time:"时间",Title:"标题",Owner:"所有者",Action:"操作",Rename:"改名",Location:"位置",Latitude:"纬度",Month:"月份",Day:"天",Hour:"小时",Daylight:"白天长度",Radiation:"辐射",Temperature:"温度",kWh:"千瓦时",dollar:"元",MeterPerSecond:"米/秒",NorthInitial:"北",SouthInitial:"南",EastInitial:"东",WestInitial:"西",Fixed:"固定",Elements:"部件",Energy:"能量",Unknown:"未知",Label:"标签",Description:"描述",NoDescription:"无描述",MaximumCharacters:"最多字符数",Author:"作者",Publisher:"发布者",Building:"建筑",ResidentialBuilding:"住宅建筑",CommercialBuilding:"商用建筑",SchoolBuilding:"学校建筑",TouristAttraction:"旅游景点",UnderConstruction:"在建",Photovoltaic:"光伏",WindPower:"风能",ColocationProjects:"共用空间项目",Anonymous:"无名氏",Nickname:"别名",Pin:"置顶",Unpin:"解除置顶"},shared:{NoTexture:"无材质",FoundationElement:"地基",CuboidElement:"长方体",PolygonElement:"多边形",SensorElement:"传感器",SolarPanelElement:"光伏板",WaterHeaterElement:"太阳能热水器",ParabolicDishElement:"抛物线碟",ParabolicTroughElement:"抛物线槽",FresnelReflectorElement:"菲涅耳反射镜",HeliostatElement:"定日镜",WindTurbineElement:"风力涡轮机",LightElement:"电灯",ElementLocked:"固定",ModelType:"模型类别",OutputBreakdown:"分列发电量",MoreResults:"更多结果"},message:{NewVersionAvailable:"有新版本",CalculationMayBeSlowDoYouWantToContinue:"计算可能会很慢。您想继续吗?",IncreaseSolarRadiationHeatmapGridCellSizeToSpeedUp:"加大太阳辐射热图网格的尺寸可加速",ModelNotFound:"没有找到模型",CannotSignIn:"登录失败",CannotSignOut:"退出失败",YourAccountWasCreated:"成功建立您的账号。",CannotCreateAccount:"无法创建账号",YourAccountSettingsWereSaved:"您的账号设定已保存。",CannotSaveYourAccountSettings:"您的账号设定无法保存",CannotSaveYourFileToCloud:"无法保存您的文件到云端",CannotCreateNewProject:"无法创建新项目",CannotCreateNewProjectWithoutTitle:"没有标题, 无法创建新项目",CannotOpenYourProjects:"无法打开您的项目列表",CannotOpenProject:"无法打开项目",CannotDeleteProject:"无法删除项目",CannotRenameProject:"无法给项目改名",CannotAddDesignToProject:"无法把此设计加到项目里",CannotAddDesignToProjectOwnedByOthers:"不能把此设计加到别人的项目里",DesignRemovedFromProject:"设计被成功地从项目里删除",CannotRemoveDesignFromProject:"无法把此设计从项目里删除",CannotUpdateProject:"无法更新项目",CannotFetchProjectData:"无法取得项目数据",TitleUsedChooseDifferentOne:"此标题已经被使用, 请采用不同的标题",CloudFileWithTitleExistsDoYouWantToOverwrite:"使用此标题的云文件已经存在,您确定要覆盖它吗?",CloudFileNotFound:"找不到此云端文件",CannotLoadModelsOnMap:"无法下载地图上的模型",CannotLoadLeaderboard:"无法下载排行榜",CannotPublishModelOnMap:"模型无法发布到地图上",CannotLikeModelFromMap:"无法点赞地图上的模型",CannotDeleteModelFromMap:"无法删除地图上的模型",ModelDeletedFromMap:"模型已从地图上删除",DoYouWantToDeleteModelFromMap:"您要删除地图上的这个模型吗?",CannotOpenCloudFile:"此云端文件无法打开",CannotReadCloudFile:"无法读取此云端文件",CannotWriteCloudFile:"无法存储此云端文件",CloudFileCopied:"拷贝云端文件",CannotOpenCloudFolder:"您的云端文件夹无法打开",CannotDeleteCloudFile:"无法删除此云端文件",CannotRenameCloudFile:"此云端文件的名字无法更改",DoYouWantToSaveChanges:"您要保存当前文件吗?",NotApplicableToSelectedAction:"此值不适用于当前选择范围",ThisElementIsLocked:"这个部件被锁定。",ThisCannotBeUndone:"这个操作一旦执行就不能撤销。",AzimuthOfNorthIsZero:"正北的方位角为零度",CounterclockwiseAzimuthIsPositive:"逆时针为正",SouthFacingIsZero:"朝南为零度",ClockwiseRotationIsPositive:"顺时针为正",MoveCancelledBecauseOfOverlap:"位置重叠,移动取消。",MoveOutsideBoundaryCancelled:"位置出界,移动取消。",RotationCancelledBecauseOfOverlap:"位置重叠,旋转取消。",RotationOutsideBoundaryCancelled:"位置出界,旋转取消。",ResizingCancelledBecauseOfOverlap:"位置重叠,尺寸调整取消。",ResizingOutsideBoundaryCancelled:"位置出界,尺寸调整取消。",CannotPasteOutsideBoundary:"位置出界,不能复制。",CannotPasteBecauseOfOverlap:"位置重叠,不能复制。",CannotMoveObjectTooFar:"位置太远,移动取消。",ExistingSolarPanelsWillBeRemovedBeforeApplyingNewLayout:"采用新布局之前必须移除现有的光伏板。",DoYouWantToContinue:"您想继续吗?",SolarPanelsCannotIntersectWithGround:"光伏板不能和地面接触。",SolarPanelsCannotOverlapWithOneAnother:"光伏板不能重叠。",ScreenshotSaved:"截屏图片保存在下载文件夹里。",CsvFileSaved:"CSV保存在下载文件夹里。",SimulationStarted:"模拟开始。",SimulationCompleted:"模拟结束。",SimulationAborted:"模拟取消。",SimulationPaused:"模拟暂停。",CancelSimulation:"取消模拟",PauseSimulation:"暂停模拟",ResumeSimulation:"继续模拟",SimulationWillNotStartDueToErrors:"由于错误模拟无法运行",SimulationWillStartDespiteWarnings:"发现问题,但模拟仍然将运行。",EvolutionStarted:"演化开始。",EvolutionCompleted:"演化结束。",EvolutionAborted:"演化取消。",EvolutionPaused:"演化暂停。",EncounterEvolutionError:"演化出错。",CancelEvolution:"取消演化",PauseEvolution:"暂停演化",ResumeEvolution:"继续演化",ConvergenceThresholdHasBeenReached:"收敛阈值已达到。",MaximumNumberOfGenerationsHasBeenReached:"最大世代数已达到。",MaximumNumberOfStepsHasBeenReached:"最大步数已达到。",ObjectiveFunctionTypeError:"此操作不支持当前的目标函数。请从菜单启动此功能。",WallsAreNotAtSameHeight:"墙体高度不同。",WallsAreNotPerpendicular:"墙体不垂直。",WallsAreNotConnected:"墙体不相连。",WallsNumberNeedToBeFour:"墙体数量必须为四个。",BuildingContainsEmptyWall:"建筑物有空墙。",BuildingRoofMissing:"建筑物没有屋顶。",UnknownErrors:"未知错误。"},menu:{AnalysisOptions:"分析选项",option:{GridCellSize:"计算网格的尺寸",SamplingFrequency:"采样频率",TimesPerHour:"每小时采样次数",DaysPerYear:"每一年采样天数"},mainMenu:"主菜单",cloudMenu:"云菜单",projectSubMenu:"项目",project:{CreateNewProject:"创建新项目",OpenProject:"打开项目",SaveProject:"保存项目",SaveProjectAs:"另存项目为",YouMustLogInToCreateProject:"您必须登录才能创建项目",YouMustLogInToOpenProject:"您必须登录才能打开项目"},fileSubMenu:"文件",file:{CreateNewFile:"创建新文件",OpenLocalFile:"打开本地文件",SaveAsLocalFile:"保存为本地文件",SavingAbortedMustHaveValidFileName:"文件名无效,保存失败",OpenCloudFile:"打开云端文件",SaveCloudFile:"保存云端文件",SaveAsCloudFile:"另存云端文件为",SavingAbortedMustHaveValidTitle:"云端文件名无效,保存失败",ToSaveYourWorkPleaseSignIn:"为了保存您的云端文件,请先登录。",TakeScreenshot:"截屏",UseCloudFileName:"采用云端文件名",PublishOnModelsMap:"发布到地图上",PublishedOnModelsMap:"您的模型成功发布到地图上",UpdatedOnModelsMap:"您的模型更新成功",YouMustLogInToPublishYourModel:"您必须登录才能发布模型",YouCannotPublishAModelThatYouDoNotOwn:"您不能发布他人的模型",YouMustSaveModelOnCloudBeforePublishingIt:"您必须先把此模型保存在云端才能发布它"},editSubMenu:"编辑",edit:{Undo:"撤销",Redo:"重做"},viewSubMenu:"视界",view:{NavigationView:"导航模式",TwoDimensionalView:"二维模式",ResetView:"重置视角",ZoomIn:"放大",ZoomOut:"缩小",AutoRotate:"自动旋转",ShowShadow:"显示阴影",ShowSurfaceShininess:"显示表面光泽",TranslucentFloatingWindows:"透明浮动窗口",accessoriesSubMenu:"配件",accessories:{SiteInformation:"位置信息",DesignInformation:"设计信息",Instruction:"操作说明",StickyNote:"便签",Note:"便签"}},settingsSubMenu:"设置",settings:{WeatherData:"气象数据",DiurnalTemperature:"昼夜温度",Heliodon:"日影仪",SunAndTime:"太阳和时间"},benchmarksSubMenu:"基准",benchmarks:{SolarRadiationPredictionVsMeasurement:"太阳能辐射模型预测和实际测量的对比",BESTESTCase600:"建筑物能耗模拟测试:BESTEST案例600",BESTESTCase610:"建筑物能耗模拟测试:BESTEST案例610",BESTESTCase620:"建筑物能耗模拟测试:BESTEST案例620",BESTESTCase630:"建筑物能耗模拟测试:BESTEST案例630"},graph:{LineWidth:"线条宽度",SymbolSize:"符号大小",BarCategoryGap:"直条间隙",ShowHorizontalGridLines:"显示格子的水平线条",ShowVerticalGridLines:"显示格子的竖直线条"},analysisSubMenu:"分析",physicsSubMenu:"物理",physics:{DailySolarRadiationHeatmap:"当日太阳辐射总量分布热图",SolarRadiationHeatmapOptions:"太阳辐射热图选项",SolarRadiationHeatmapGridCellSize:"太阳辐射热图网格的尺寸",SolarRadiationHeatmapMaxValue:"太阳辐射热图最大值",SolarRadiationHeatmapNoAnimation:"若无移动部件则省略动画",ReflectionHeatmap:"反射热图"},sensorSubMenu:"传感器",sensor:{CollectDailyData:"收集当天数据",CollectYearlyData:"收集全年数据",SensorSimulationNoAnimation:"若无移动部件则省略动画"},buildingSubMenu:"建筑物",building:{AnalyzeDailyBuildingEnergy:"建筑物当天能耗分析",AnalyzeYearlyBuildingEnergy:"建筑物全年能耗分析",EnergyAnalysisOptions:"能耗分析选项",EnergyGridCellSize:"计算网格的尺寸",BuildingEnergySimulationNoAnimation:"若无移动部件则省略动画"},solarPanelSubMenu:"太阳能光伏板",solarPanel:{AnalyzeDailyYield:"分析当天产出",AnalyzeYearlyYield:"分析全年产出",AnalyzeVisibility:"分析可见度",PanelDiscretization:"光伏板离散化方法",Exact:"准确",Approximate:"近似",EnergyGridCellSize:"计算网格的尺寸",VisibilityGridCellSize:"视界因子计算网格的尺寸",EnergyAnalysisOptions:"能量分析选项",VisibilityAnalysisOptions:"可见度分析选项",SolarPanelSimulationNoAnimation:"若无移动部件则省略动画"},parabolicTroughSubMenu:"抛物线槽",parabolicTrough:{AnalyzeDailyYield:"分析当天产出",AnalyzeYearlyYield:"分析全年产出"},parabolicDishSubMenu:"抛物线碟",parabolicDish:{AnalyzeDailyYield:"分析当天产出",AnalyzeYearlyYield:"分析全年产出"},fresnelReflectorSubMenu:"菲涅尔反射镜",fresnelReflector:{AnalyzeDailyYield:"分析当天产出",AnalyzeYearlyYield:"分析全年产出"},heliostatSubMenu:"定日镜",heliostat:{AnalyzeDailyYield:"分析当天产出",AnalyzeYearlyYield:"分析全年产出"},solarUpdraftTowerSubMenu:"太阳能上升气流塔",solarUpdraftTower:{AnalyzeDailyYield:"分析当天产出",AnalyzeYearlyYield:"分析全年产出",SolarUpdraftTowerSimulationNoAnimation:"若无移动部件则省略动画"},tutorialsSubMenu:"教程",solarEnergyScienceSubMenu:"太阳能科学",solarEnergyScienceTutorials:{SunAngles:"太阳相对于地面观察者的角度",InsolationAndClimate:"太阳辐射和气候的关系",SolarRadiationToBox:"一个长方体受到的太阳能辐射分析"},buildingScienceSubMenu:"建筑科学",buildingScienceTutorials:{ThermalEnvelopeVsBuildingEnvelope:"房屋的热学封套和围护封套",EffectOfSizeOnBuildingEnergy:"房屋大小对能耗的影响",EffectOfOrientationOnBuildingEnergy:"房屋方位对能耗的影响",EffectOfInsulationOnBuildingEnergy:"房屋隔热对能耗的影响",EffectOfRoofColorOnBuildingEnergy:"屋顶颜色对建筑物能耗的影响",EffectOfEavesOverhangLengthOnBuildingEnergy:"屋檐延伸长度对建筑物能耗的影响",EffectOfWindowSHGCOnBuildingEnergy:"窗户太阳能输入对房屋能耗的影响",EffectOfThermostatSetpointOnBuildingEnergy:"恒温器设定值对房屋能耗的影响",EffectOfSolarPanelsOnBuildingEnergy:"光伏板对房屋能耗的影响",EffectOfGroundTemperatureOnBuildingEnergy:"地表温度对房屋能耗的影响",EffectOfTreesOnBuildingEnergy:"树荫对房屋能耗的影响"},buildingDesignSubMenu:"建筑设计",buildingDesignTutorials:{CapeCodStyleHouseWithShedDormer:"有棚顶窗的科德角风格的住宅",MansardRoofWithDormers:"有天窗的折线屋顶",GableRoofVsHipRoof:"双坡屋顶和四坡屋顶的对比",ColonialVsSaltbox:"殖民地风格和盐盒风格的对比",GambrelRoofVsMansardRoof:"复斜屋顶和折线屋顶的对比",CombinationRoofVsBonnetRoof:"组合屋顶和帽檐屋顶的对比",DutchGableRoof:"荷兰双坡屋顶",GableAndValleyRoof:"坡谷屋顶",ClerestoryRoof:"天窗屋顶",MonitorRoof:"采光屋顶",AFrameHouse:"A字形房子",HalfTimberedHouse:"半木骨架房子",AllBasicRoofTypes:"所有的基本屋顶类型"},photovoltaicSolarPowerSubMenu:"光伏发电",photovoltaicSolarPowerTutorials:{EffectOfTiltAngleOfSolarPanel:"光伏板倾斜角对发电量的影响",EffectOfAzimuthOfSolarPanel:"光伏板方位角对发电量的影响",SolarPanelTypes:"光伏板类型",VerticalBifacialSolarPanels:"竖直的双面光伏板",CompareMonofacialAndBifacialSolarPanels:"单面光伏板和双面光伏板的对比",SolarTrackers:"自动追日器",CoveringGroundWithSolarPanels:"为什么我们不简单地用光伏板覆盖地面",InterRowSpacingOfSolarPanelArray:"光伏板阵列行间距对发电量的影响",EffectOfOrientationOfSolarPanels:"光伏板排列方向对发电量的影响",SolarPanelArrayAutomaticLayout:"光伏板自动排列"},concentratedSolarPowerSubMenu:"光热发电",concentratedSolarPowerTutorials:{EffectOfAzimuthOfParabolicTrough:"抛物线槽方位角对发电量的影响",EffectOfLatusRectumOfParabolicTrough:"抛物线槽通径对发电量的影响",FocusSunlightWithParabolicDish:"用抛物线碟聚焦陽光",LinearFresnelReflectors:"用直线式菲涅尔反射镜聚焦陽光",EffectOfAbsorberPipeHeightForLinearFresnelReflectors:"吸热管的安装高度对直线式菲涅尔反射镜发电量的影响",EffectOfAzimuthOfLinearFresnelReflectors:"直线式菲涅尔反射镜方位角对发电量的影响",LinearFresnelReflectorsWithTwoAbsorbers:"配备两个吸收管的直线式菲涅尔反射镜阵列",CosineEfficiencyOfHeliostats:"定日镜的余弦效率",ShadowingAndBlockingOfHeliostats:"定日镜的阴影和遮挡",EffectSolarPowerTowerHeight:"吸收塔高度对发电量的影响",SolarPowerTower:"塔式光热发电站"},otherTypesOfSolarPowerSubMenu:"其它类型的太阳能发电",otherTypesOfSolarPowerTutorials:{SolarUpdraftTower:"太阳能上升气流塔"},windPowerSubMenu:"风力发电",windPowerTutorials:{EffectOfBladeNumberOfWindTurbine:"转子叶片的数目对风力涡轮机输出的影响",EffectOfPitchAngleOfWindTurbineBlades:"转子叶片的俯仰角对风力涡轮机输出的影响",BirdSafeBladeDesign:"对鸟类安全的叶片设计",OffshoreWindFarm:"海上风电场"},colocationSubMenu:"共用空间项目",colocationTutorials:{AgricultureSolarWindColocation:"农业光伏风力共用空间"},generativeDesignSubMenu:"生成式设计",generativeDesignTutorials:{MonofacialSolarPanelArrayTiltAngle:"单面光伏板阵列的倾斜角",BifacialSolarPanelArrayTiltAngle:"双面光伏板阵列的倾斜角",OutputOfSolarPanelArrayInDifferentPlaces:"一个光伏板阵列在不同地区的产出",SimpleSolarFarmParetoFront:"简单太阳能农场设计的帕累托前沿"},examplesSubMenu:"例子",solarEnergySubMenu:"太阳能",solarEnergyExamples:{SunBeamAndHeliodon:"太阳光束和日影仪",RooftopSolarPanels:"屋顶光伏板",NevadaSolarOneParabolicTroughArray:"内华达州太阳能一号的抛物线槽阵列",TooeleParabolicDishArray:"犹他州图埃勒的抛物线碟阵列",PS10SolarPowerTower:"西班牙塞维利亚的PS10太阳能发电塔",TucsonLinearFresnelReflectors:"亚利桑那州图森的直线式菲涅尔反射镜阵列",SolarCanopyFormFactors:"太阳能天篷外形设计",SolarCanopyOverBleachers:"看台太阳能天篷",SolarCanopyOverGarage:"车库太阳能天篷",SolarBusStop:"太阳能候车亭",SolarFacadeTesla:"特斯拉光伏墙",BuildingIntegratedPhotovoltaics:"建筑整合光伏",Floatovoltaics:"浮动光伏",Agrivoltaics:"农业光伏",VegetativeBuffer:"太阳能农场绿化带",RainbowSwashSolarFarmBostonMA:"马萨诸塞州波士顿彩虹激流旁边的光伏板阵列",MickeyMouseSolarFarmOrlandoFL:"佛罗里达州奥兰多的米老鼠形状光伏板阵列",SolarPanelsOverCanalBakersfieldCA:"加利福尼亚州贝克斯菲尔德灌溉渠上假想的光伏板阵列",SolarNoiseBarrierLexingtonMA:"马萨诸塞州列克星敦高速公路噪音墙上假想的光伏板",HSATSolarTrackersRaleighNC:"北卡罗来纳州罗利的一个水平方向单轴旋转追日光伏板阵列(HSAT)",AADATSolarTrackersLancasterCA:"加利福尼亚州兰开斯特的一个双轴旋转追日光伏板阵列(AADAT)",SolarUpdraftTowerInCity:"太阳能上升气流塔在城市中的应用"},builtEnvironmentSubMenu:"建造环境",residentialBuildingsSubMenu:"住宅建筑",residentialBuildingExamples:{ColonialHouse:"殖民地风格的住宅",DutchColonialHouse:"荷兰殖民地风格的住宅",TShapedHouse:"T字型房子",CapeCodHouseWithGarage:"有车库的科德角风格的住宅",Solarium:"有日光浴室的房子",Church1:"教堂例一",Cathedral1:"主教座堂例一",Cathedral2:"主教座堂例二",Mosque1:"清真寺例一",AdobeTaosHouse:"陶斯土坯房",RanchHouse:"牧场风格的住宅",BonnetHouse:"有帽檐屋顶的住宅",BarnStyleHouse:"谷仓式风格的住宅",ModernHouse:"现代风格的住宅",ButterflyRoofHouse:"蝴蝶型屋顶的住宅"},commercialBuildingsSubMenu:"商用建筑",commercialBuildingExamples:{WhiteHouse:"白宫",HaroldWashingtonCollege:"哈罗德华盛顿学院",BilimMersinTurkiye:"土耳其梅尔辛科学教育中心",SpanishStyleHotel:"西班牙风格旅馆",ApartmentBuilding:"公寓楼",OfficeBuilding:"办公楼",Hotel:"旅馆"},buildingComplexesSubMenu:"建筑群",buildingComplexExamples:{SouthBurlingtonHighSchoolVermont:"佛蒙特州南伯灵顿高中",MescaleroApacheSchoolNewMexico:"新墨西哥州梅斯卡勒罗阿帕奇学校"},urbanPlanningSubMenu:"城市规划",urbanPlanningExamples:{CityBlockHeatmap:"城市街区热图",ChicagoSkyline:"芝加哥天际线"},otherBuildingsSubMenu:"其它建筑",otherBuildingExamples:{Greenhouse:"温室",Pavilion:"公园的亭子",OctagonalPagoda:"八角塔",OceanFront:"海边",EgyptianPyramids:"埃及金字塔",MayanPyramid:"玛雅金字塔",SiOSePol:"三十三孔桥",StackedCuboids:"堆砌长方体"},artificialIntelligenceSubMenu:"人工智能",artificialIntelligenceExamples:{OptimizingTiltAngleOfOneSolarPanelRow:"优化单排光伏板的倾斜角",OptimizingTiltAnglesOfMultipleSolarPanelRows:"优化多排光伏板的倾斜角",SolarFarmGenerativeDesign:"生成式设计太阳能农场",SolarFarmGenerativeDesignWithBlock:"生成式设计太阳能农场:周边有建筑物的情况",FitchburgSolarFarmGenerativeDesign:"生成式设计太阳能农场:真实世界案例"},languageSubMenu:"语言",publicSubMenu:"公共",ModelsGallery:"模型画廊",ModelsMap:"模型地图",AboutUs:"关于我们"},avatarMenu:{AccountSettings:"账号设定",PrivacyStatementTitle:"用户隐私保护声明",PrivacyStatement:"登录需要采用您的谷歌ID建立或进入您的阿拉丁账户。 我们只储存一个随机的字符串作为您的ID。 任何关于您的可辨识的个人信息都没有被收集。 详情请参考我们的",SignIn:"登录",SignOut:"退出账号",IfYouAreAStudent:"如果您是一个学生"},skyMenu:{Axes:"显示坐标轴",Theme:"环境主题",ThemeDefault:"默认",ThemeDesert:"沙漠",ThemeDune:"沙丘",ThemeForest:"森林",ThemeGrassland:"草原",ThemeHill:"丘陵",ThemeLake:"湖泊",ThemeMountain:"山脉",ThemeRural:"田园",SunlightAttenuationCoefficientInAir:"阳光在空气中传播的衰减系数",ConvectiveCoefficientOfAir:"空气对流传热系数",HighestTemperatureTimeInMinutes:"最高气温时间(分钟)",SelectSunAnglesToShow:"选择太阳角度显示",ShowAzimuthAngle:"显示方位角",ShowElevationAngle:"显示高度角",ShowZenithAngle:"显示天顶角",DirectLightBrightnessAtNoon:"正午直射光照度",AmbientLightBrightnessAtNoon:"正午环境光照度"},groundMenu:{MonthlyIrradianceLoss:"月份辐射度损失比",Vegetation:"植被",LeafOutDay:"树叶长出的日子",LeafOffDay:"树叶脱落的日子",Albedo:"反照率",ImageOnGround:"地面显示图像",WaterSurface:"水面",RemoveAllUnlockedTrees:"删除所有非固定的树木",RemoveAllUnlockedFlowers:"删除所有非固定的花草",RemoveAllUnlockedSolarPanels:"删除所有非固定的光伏板",RemoveAllUnlockedPeople:"删除所有非固定的人物",RemoveAllUnlockedFoundations:"删除所有非固定的地基",RemoveAllUnlockedCuboids:"删除所有非固定的长方体",DoYouReallyWantToRemoveAllPeople:"你确定删除所有非固定的人物吗",DoYouReallyWantToRemoveAllTrees:"你确定删除所有非固定的树木吗",DoYouReallyWantToRemoveAllFlowers:"你确定删除所有非固定的花草吗",DoYouReallyWantToRemoveAllSolarPanels:"你确定删除所有非固定的光伏板吗",DoYouReallyWantToRemoveAllFoundations:"你确定删除所有非固定的地基吗",DoYouReallyWantToRemoveAllCuboids:"你确定删除所有非固定的长方体吗",LockAllUnlockedElements:"固定所有非固定的部件",UnlockAllLockedElements:"解除所有的固定"},labelSubMenu:{Label:"标签",LabelText:"标签的内容",LabelHeight:"标签的高度",LabelSize:"标签的大小",LabelFontSize:"字体的大小",LabelColor:"标签的颜色",KeepShowingLabel:"显示标签"},foundationMenu:{RemoveAllUnlockedSolarPanels:"删除此地基上所有非固定的光伏板",RemoveAllUnlockedParabolicTroughs:"删除此地基上所有非固定的抛物线槽",RemoveAllUnlockedParabolicDishes:"删除此地基上所有非固定的抛物线碟",RemoveAllUnlockedFresnelReflectors:"删除此地基上所有非固定的菲涅耳反射镜",RemoveAllUnlockedHeliostats:"删除此地基上所有非固定的定日镜",RemoveAllUnlockedWindTurbines:"删除此地基上所有非固定的风力涡轮机",RemoveAllUnlockedSensors:"删除此地基上所有非固定的传感器",RemoveAllUnlockedLights:"删除此地基上所有非固定的电灯",RemoveAllUnlockedWalls:"删除此地基上所有非固定的墙",RemoveAllUnlockedWindows:"删除此地基上所有非固定的窗户",RemoveAllUnlockedDoors:"删除此地基上所有非固定的门",RemoveAllUnlockedPolygons:"删除此地基上所有非固定的多边形",RemoveAllUnlockedHumans:"删除此地基上所有非固定的人物",RemoveAllUnlockedTrees:"删除此地基上所有非固定的树木",RemoveAllUnlockedFlowers:"删除此地基上所有非固定的花草",Racks:"支架",Texture01:"一号材质",Texture02:"二号材质",Texture03:"三号材质",Texture04:"四号材质",Texture05:"五号材质",Texture06:"六号材质",Texture07:"七号材质",Texture08:"八号材质",Texture09:"九号材质",Texture10:"十号材质",SolarPanels:"光伏板",SolarPanelArray:"光伏板阵列",DoYouReallyWantToRemoveAllSolarPanelsOnFoundation:"你确定删除此地基上所有非固定的光伏板吗",ParabolicTroughs:"抛物线槽",DoYouReallyWantToRemoveAllParabolicTroughsOnFoundation:"你确定删除此地基上所有非固定的抛物线槽吗",ParabolicDishes:"抛物线碟",DoYouReallyWantToRemoveAllParabolicDishesOnFoundation:"你确定删除此地基上所有非固定的抛物线碟吗",FresnelReflectors:"菲涅耳反射镜",DoYouReallyWantToRemoveAllFresnelReflectorsOnFoundation:"你确定删除此地基上所有非固定的菲涅耳反射镜吗",Heliostats:"定日镜",DoYouReallyWantToRemoveAllHeliostatsOnFoundation:"你确定删除此地基上所有非固定的定日镜吗",WindTurbines:"风力涡轮机",DoYouReallyWantToRemoveAllWindTurbinesOnFoundation:"你确定删除此地基上所有非固定的风力涡轮机吗",Sensors:"传感器",DoYouReallyWantToRemoveAllSensorsOnFoundation:"你确定删除此地基上所有非固定的传感器吗",Lights:"电灯",DoYouReallyWantToRemoveAllLightsOnFoundation:"你确定删除此地基上所有非固定的电灯吗",Walls:"墙",DoYouReallyWantToRemoveAllWallsOnFoundation:"你确定删除此地基上所有非固定的墙吗",Windows:"窗户",DoYouReallyWantToRemoveAllWindowsOnFoundation:"你确定删除此地基上所有非固定的窗户吗",Doors:"门",DoYouReallyWantToRemoveAllDoorsOnFoundation:"你确定删除此地基上所有非固定的门吗",Polygons:"多边形",DoYouReallyWantToRemoveAllPolygonsOnFoundation:"你确定删除此地基上所有非固定的多边形吗",Humans:"人物",DoYouReallyWantToRemoveAllHumansOnFoundation:"你确定删除此地基上所有非固定的人物吗",Trees:"树木",DoYouReallyWantToRemoveAllTreesOnFoundation:"你确定删除此地基上所有非固定的树木吗",Flowers:"花草",DoYouReallyWantToRemoveAllFlowersOnFoundation:"你确定删除此地基上所有非固定的花草吗",OnlyThisFoundation:"只这块地基",AllSelectedFoundations:"所有选中的地基",AllConnectedFoundations:"所有相连的地基",AllFoundations:"所有的地基",AddPolygon:"添加多边形",SolarStructure:"太阳能构型",GroupMaster:"主地基",LockAllUnlockedElementsOnThisFoundation:"固定此地基上所有非固定的部件",UnlockAllLockedElementsOnThisFoundation:"解除此地基上所有的固定",GroundFloorRValue:"建筑物地板的R值",OnlyThisGroundFloor:"只这个建筑物的地板",AllGroundFloors:"所有建筑物的地板"},solarPowerTowerMenu:{ReceiverTowerForHeliostats:"和定日镜配套的吸收塔",ReceiverTowerPhysicalProperties:"太阳能吸收塔的物理性质",ReceiverTowerHeight:"太阳能吸收塔的高度",ReceiverTowerRadius:"太阳能吸收塔的半径",ReceiverAbsorptance:"太阳能吸收器的吸收率",ReceiverOpticalEfficiency:"太阳能吸收器的光效率",ReceiverThermalEfficiency:"太阳能吸收器的热效率"},solarAbsorberPipeMenu:{AbsorberPipeForFresnelReflectors:"和菲涅尔反射镜配套的吸收管",AbsorberPipePhysicalProperties:"太阳能吸收管的物理性质",AbsorberHeight:"太阳能吸收管的安装高度",AbsorberApertureWidth:"太阳能吸收管的孔径",AbsorberPipePoleNumber:"太阳能吸收管的支柱数量",AbsorberAbsorptance:"太阳能吸收管的吸收率",AbsorberOpticalEfficiency:"太阳能吸收管的光效率",AbsorberThermalEfficiency:"太阳能吸收管的热效率"},solarUpdraftTowerMenu:{SolarUpdraftTower:"太阳能上升气流塔",SolarUpdraftTowerPhysicalProperties:"太阳能上升气流塔的物理性质",SolarUpdraftTowerChimneyHeight:"太阳能上升气流塔烟囱的高度",SolarUpdraftTowerChimneyRadius:"太阳能上升气流塔烟囱的半径",SolarUpdraftTowerCollectorHeight:"太阳能上升气流塔集热棚的高度",SolarUpdraftTowerCollectorRadius:"太阳能上升气流塔集热棚的半径",SolarUpdraftTowerCollectorTransmissivity:"太阳能上升气流塔集热棚的透射率",SolarUpdraftTowerCollectorEmissivity:"太阳能上升气流塔集热棚的发射率",SolarUpdraftTowerDischargeCoefficient:"太阳能上升气流塔的流量系数",SolarUpdraftTowerTurbineEfficiency:"太阳能上升气流塔的涡轮机效率"},cuboidMenu:{Texture01:"一号材质",Texture02:"二号材质",Texture03:"三号材质",Texture04:"四号材质",Texture05:"五号材质",Texture06:"六号材质",Texture07:"七号材质",Texture08:"八号材质",Texture09:"九号材质",Texture10:"十号材质",RemoveAllUnlockedSolarPanels:"删除此长方体表面上所有非固定的光伏板",RemoveAllUnlockedSensors:"删除此长方体表面上所有非固定的传感器",RemoveAllUnlockedPolygons:"删除此长方体表面上所有非固定的多边形",RemoveAllUnlockedHumans:"删除此长方体表面上所有非固定的人物",RemoveAllUnlockedTrees:"删除此长方体表面上所有非固定的树木",RemoveAllUnlockedFlowers:"删除此长方体表面上所有非固定的花草",RemoveAllUnlockedLights:"删除此长方体表面上所有非固定的电灯",Racks:"支架",SolarPanels:"光伏板",Lights:"电灯",DoYouReallyWantToRemoveAllLightsOnCuboid:"你确定删除此长方体表面上所有非固定的电灯吗",DoYouReallyWantToRemoveAllSolarPanelsOnCuboid:"你确定删除此长方体表面上所有非固定的光伏板吗",Sensors:"传感器",DoYouReallyWantToRemoveAllSensorsOnCuboid:"你确定删除此长方体表面上所有非固定的传感器吗",Polygons:"多边形",DoYouReallyWantToRemoveAllPolygonsOnCuboid:"你确定删除此长方体表面上所有非固定的多边形吗",Humans:"人物",DoYouReallyWantToRemoveAllHumansOnCuboid:"你确定删除此长方体表面上所有非固定的人物吗",Trees:"树木",DoYouReallyWantToRemoveAllTreesOnCuboid:"你确定删除此长方体表面上所有非固定的树木吗",Flowers:"花草",DoYouReallyWantToRemoveAllFlowersOnCuboid:"你确定删除此长方体表面上所有非固定的花草吗",OnlyThisCuboid:"只这个长方体",AllCuboidsOnSameSurface:"同一表面上所有的长方体",AllCuboidsAboveSameBase:"同一地基上所有的长方体",AllSelectedCuboids:"所有选中的长方体",AllCuboids:"所有的长方体",OnlyThisSide:"只这个表面",AllSidesOfThisCuboid:"这个长方体所有的侧面",AllSidesOfSelectedCuboids:"所有选中长方体所有的侧面",AllSidesOfAllCuboids:"所有的长方体所有的侧面",AddPolygon:"添加多边形",Stackable:"可堆砌",GroupMaster:"主长方体"},polygonMenu:{Texture01:"一号材质",Texture02:"二号材质",Texture03:"三号材质",Texture04:"四号材质",Texture05:"五号材质",Texture06:"六号材质",Texture07:"七号材质",Texture08:"八号材质",Texture09:"九号材质",Texture10:"十号材质",TextBox:"文字框",FontOutlineColor:"字体轮廓颜色",FontOutlineWidth:"字体轮廓线宽",FontStrokeColor:"字体描边颜色",FontStrokeWidth:"字体描边线宽",NoOutline:"无轮廓线",Shiny:"光泽",Filled:"填充",FillTexture:"填充材质",FillColor:"填充颜色",Opacity:"遮光度",LineColor:"线条颜色",LineWidth:"线条宽度",LineStyle:"线条样式",SolidLine:"实线",DashedLine:"虚线",DottedLine:"点线",InsertVertexBeforeIndex:"前面插入顶点",InsertVertexAfterIndex:"后面插入顶点",DeleteVertex:"移除顶点",OnlyThisPolygon:"只这个多边形",AllPolygonsOnSurface:"同一表面上所有的多边形",AllPolygonsAboveFoundation:"同一地基上所有的多边形",AllSelectedPolygons:"所有选中的多边形",AllPolygons:"所有的多边形",Layout:"布局",SolarPanelArrayLayout:"光伏板阵列布局",SolarPanelArrayLayoutParametricDesign:"光伏板阵列布局参数化设计",SolarPanelArrayLayoutGenerativeDesign:"光伏板阵列布局生成式设计",SolarPanelArrayModel:"光伏板型号",SolarPanelArrayOrientation:"排列方向",SolarPanelArrayTiltAngle:"倾斜角度",SolarPanelArrayRowWidth:"行宽度",SolarPanelArrayInterRowSpacing:"行间距",SolarPanelArrayRowSpacing:"行间距",SolarPanelArrayRowAxis:"行轴方向",SolarPanelArrayLeftRightRowAxis:"左右方向(相对)",SolarPanelArrayUpDownRowAxis:"上下方向(相对)",SolarPanelArrayEastWestRowAxis:"东西方向(绝对)",SolarPanelArrayNorthSouthRowAxis:"南北方向(绝对)",SolarPanelArrayMargin:"边缘余地",SolarPanelArrayPoleHeight:"支架高度",SolarPanelArrayPoleSpacing:"支柱间隔",SolarPanelArrayTotalYearlyCost:"全年总成本",SolarPanelArrayTotalYearlyRevenue:"全年总收入",SolarPanelArrayTotalYearlyYield:"全年总发电量",SolarPanelArrayMeanYearlyYield:"平均年发电量",SolarPanelArrayYearlyProfit:"全年利润",LayoutNotAcceptedCheckYourParameters:"恕不能采用此布局。请检查您的参数设置。"},optimizationMenu:{Optimization:"优化",Parameters:"参数",Variables:"变量",Constants:"常量",GeneticAlgorithm:"遗传算法",GeneticAlgorithmSettings:"遗传算法设定",ParticleSwarmOptimization:"粒子群优化",ParticleSwarmOptimizationSettings:"粒子群优化设定",SolarPanelTiltAngleOptimization:"光伏板倾斜角度优化",SolarPanelArrayLayout:"光伏板阵列布局",Generation:"世代",Gene:"基因",NormalizedVariables:"标准化变量",Objective:"目标函数",ObjectiveFunctionDailyTotalYield:"当日总产出",ObjectiveFunctionYearlyTotalYield:"全年总产出",ObjectiveFunctionDailyMeanYield:"当日平均产出",ObjectiveFunctionYearlyMeanYield:"全年平均产出",ObjectiveFunctionDailyProfit:"当日利润",ObjectiveFunctionYearlyProfit:"全年利润",GeneticAlgorithmSelectionMethod:"遗传算法选择方法",RouletteWheel:"轮盘制",Tournament:"淘汰制",SearchMethod:"搜索方法",GlobalSearchUniformSelection:"全局搜索均匀取样",LocalSearchRandomOptimization:"局部搜索随机优化",PopulationSize:"种群个体数目",MaximumGenerations:"最大世代数目",SelectionRate:"选择概率",CrossoverRate:"交配概率",MutationRate:"突变概率",Step:"步数",SwarmSize:"粒子数目",MaximumSteps:"最大步数",MaximumVelocity:"最大速度",InertiaWeight:"惯性权重",CognitiveCoefficient:"认知系数",SocialCoefficient:"社会系数",ConvergenceThreshold:"终止条件的收敛阈值",LocalSearchRadius:"局部搜索的半径",RowsPerRackRange:"单个支架上光伏板行数的变化范围",TiltAngleRange:"光伏板倾斜角度的变化范围",InterRowSpacingRange:"光伏板阵列行间距的变化范围",ClickTargetPolygonToActivate:"点击目标多边形激活",ClickTargetFoundationToActivate:"点击目标地基激活"},treeMenu:{ShowModel:"显示近似模型",Flip:"翻转",Type:"树种",Spread:"树冠直径"},flowerMenu:{Flip:"翻转",Type:"品种",Spread:"直径"},peopleMenu:{ChangePerson:"改变人物",Flip:"转身",Observer:"观察者",ViewFromThisPerson:"视角移到此人位置"},lightMenu:{Color:"颜色",Intensity:"亮度",Decay:"衰减",MaximumDistance:"最大距离",Inside:"内部"},solarCollectorMenu:{Coordinates:"坐标",RelativeXCoordinateOfCenter:"中心的相对X坐标",RelativeYCoordinateOfCenter:"中心的相对Y坐标",RelativeAzimuth:"相对方位角",Pole:"支柱",PoleHeight:"支柱高度",PoleRadius:"支柱半径",ExtraPoleHeight:"额外的支柱高度",ExtraPoleHeightInAdditionToHalfWidth:"宽度一半额外的支柱高度",DrawSunBeam:"显示光束"},concentratedSolarPowerCollectorMenu:{ReflectorReflectance:"反射器镜面反射率",ReceiverAbsorptance:"接收器吸收率",ReflectorOpticalEfficiency:"反射器光效率",ReceiverThermalEfficiency:"接收器热效率"},waterHeaterMenu:{OnlyThisWaterHeater:"只这个热水器",AllWaterHeatersOnSurface:"同一表面上所有的热水器",AllWaterHeatersAboveFoundation:"同一地基上所有的热水器",AllSelectedWaterHeaters:"所有选中的热水器",AllWaterHeaters:"所有的热水器"},solarPanelMenu:{ElectricalProperties:"电气特性",InverterEfficiency:"逆变器效率",InverterEfficiencyExplained:"直流电转换为交流电的效率。",DcToAcSizeRatio:"直流-交流容量比例",DcToAcSizeRatioExplained:"直流电容量和交流电容量的比例。",ChangePvModel:"改变光伏板型号",Orientation:"排列方向",Portrait:"纵向",Landscape:"橫向",FrameColor:"框架颜色",Panels:"块",PanelsWide:"块光伏板宽",PanelsLong:"块光伏板长",TiltAngle:"倾斜角度",SouthFacingIsPositive:"朝南为正",Tracker:"追日系统",SolarTrackerFollowsSun:"追日系统提高光伏板产出。",PoleSpacing:"支柱间隔",NoTracker:"无追日系统",HorizontalSingleAxisTracker:"水平单轴追日系统",VerticalSingleAxisTracker:"竖直单轴追日系统",AltazimuthDualAxisTracker:"地平双轴追日系统",OnlyThisSolarPanel:"只这个光伏板",AllSolarPanelsOnSurface:"同一表面上所有的光伏板",AllSolarPanelsAboveFoundation:"同一地基上所有的光伏板",AllSelectedSolarPanels:"所有选中的光伏板",AllSolarPanels:"所有的光伏板"},pvModelPanel:{SolarPanelSpecs:"光伏板型号性能",Model:"型号",PanelSize:"尺寸",Cells:"电池組",CellType:"光伏电池类型",Monocrystalline:"单晶硅",Polycrystalline:"多晶硅",ThinFilm:"薄膜",Bifacial:"双面",BifacialityFactor:"双面性因子",Black:"黑色",Blue:"蓝色",ShadeTolerance:"阴影耐受度",SolarCellEfficiency:"光伏电池效率",NominalOperatingCellTemperature:"名义电池运行温度",TemperatureCoefficientOfPmax:"Pmax温度系数"},parabolicTroughMenu:{ModuleLength:"模块长度",Modules:"模块",ModulesLong:"模块长",LatusRectum:"通径",OnlyThisParabolicTrough:"只这个抛物线槽",AllParabolicTroughsAboveFoundation:"同一地基上所有的抛物线槽",AllSelectedParabolicTroughs:"所有选中的抛物线槽",AllParabolicTroughs:"所有的抛物线槽"},fresnelReflectorMenu:{AbsorberPipe:"吸收管",SelectAbsorberToReflectSunlightTo:"选择阳光反射到的吸收管",ModuleLength:"模块长度",Modules:"模块",ModulesLong:"模块长",OnlyThisFresnelReflector:"只这个菲涅耳反射镜",AllFresnelReflectorsAboveFoundation:"同一地基上所有的菲涅耳反射镜",AllSelectedFresnelReflectors:"所有选中的菲涅耳反射镜",AllFresnelReflectors:"所有的菲涅耳反射镜"},heliostatMenu:{Tower:"吸收塔",SelectTowerToReflectSunlightTo:"选择阳光反射到的吸收塔",OnlyThisHeliostat:"只这个定日镜",AllHeliostatsAboveFoundation:"同一地基上所有的定日镜",AllSelectedHeliostats:"所有选中的定日镜",AllHeliostats:"所有的定日镜"},parabolicDishMenu:{ReceiverStructure:"接收器结构",CentralPole:"中心直柱",CentralPoleWithTripod:"三脚架和中心直柱",Quadrupod:"四脚架",RimDiameter:"外圈直径",LatusRectum:"通径",ExtraPoleHeightInAdditionToRadius:"半径之外额外的支架高度",OnlyThisParabolicDish:"只这个抛物线碟",AllParabolicDishesAboveFoundation:"同一地基上所有的抛物线碟",AllSelectedParabolicDishes:"所有选中的抛物线碟",AllParabolicDishes:"所有的抛物线碟"},windTurbineMenu:{BirdSafeDesign:"鸟类安全设计",BirdSafeNone:"无",BirdSafeBicolor:"双色",BirdSafeStriped:"条纹",Rotor:"转子",BladeNumber:"叶片数目",RotorInitialAngle:"转子初始角度",RotorBladeDesign:"转子叶片设计",RotorBladeRadius:"转子叶片半径",RotorBladePitchAngle:"转子叶片俯仰角",RelativeYawAngle:"相对偏流角",MaximumChordLength:"最大弦长度",Tower:"塔架",TowerHeight:"塔架高度",TowerRadius:"塔架半径",HubDesign:"转子轮毂设计",HubRadius:"轮毂半径",HubLength:"轮毂长度",OnlyThisWindTurbine:"只这个风力涡轮机",AllWindTurbinesAboveFoundation:"同一地基上所有的风力涡轮机",AllSelectedWindTurbines:"所有选中的风力涡轮机",AllWindTurbines:"所有的风力涡轮机"},wallMenu:{TextureDefault:"默认材质",Texture01:"一号材质",Texture02:"二号材质",Texture03:"三号材质",Texture04:"四号材质",Texture05:"五号材质",Texture06:"六号材质",Texture07:"七号材质",Texture08:"八号材质",Texture09:"九号材质",Texture10:"十号材质",SizeOfWall:"墙的尺寸",OnlyThisWall:"只这堵墙",AllConnectedWalls:"所有连接的墙",AllWallsAboveFoundation:"同一地基上所有的墙",AllSelectedWalls:"所有选中的墙",AllWalls:"所有的墙",Windows:"窗户",LockAllUnlockedWindows:"固定所有非固定的窗户",UnlockAllLockedWindows:"解除所有的窗户固定",RemoveAllUnlockedWindows:"删除这堵墙上所有非固定的窗户",DoYouReallyWantToRemoveAllWindowsOnThisWall:"你确定删除这堵墙上所有非固定的窗户吗",Doors:"门",LockAllUnlockedDoors:"固定所有非固定的门",UnlockAllLockedDoors:"解除所有的门固定",RemoveAllUnlockedDoors:"删除这堵墙上所有非固定的门",DoYouReallyWantToRemoveAllDoorsOnThisWall:"你确定删除这堵墙上所有非固定的门吗",SolarPanels:"光伏板",LockAllUnlockedSolarPanels:"固定所有非固定的光伏板",UnlockAllLockedSolarPanels:"解除所有的光伏板固定",RemoveAllUnlockedSolarPanels:"删除这堵墙上所有非固定的光伏板",DoYouReallyWantToRemoveAllSolarPanelsOnThisWall:"你确定删除这堵墙上所有非固定的光伏板吗",Sensors:"传感器",LockAllUnlockedSensors:"固定所有非固定的传感器",UnlockAllLockedSensors:"解除所有的传感器固定",RemoveAllUnlockedSensors:"删除这堵墙上所有非固定的传感器",DoYouReallyWantToRemoveAllSensorsOnThisWall:"你确定删除这堵墙上所有非固定的传感器吗",Lights:"电灯",LockAllUnlockedLights:"固定这堵墙上所有非固定的电灯",UnlockAllLockedLights:"解除这堵墙上所有的电灯固定",RemoveAllUnlockedLights:"删除这堵墙上所有非固定的电灯",DoYouReallyWantToRemoveAllLightsOnThisWall:"你确定删除这堵墙上所有非固定的电灯吗",Polygons:"多边形",LockAllUnlockedPolygons:"固定这堵墙上所有非固定的多边形",UnlockAllLockedPolygons:"解除这堵墙上所有的多边形固定",RemoveAllUnlockedPolygons:"删除这堵墙上所有非固定的多边形",DoYouReallyWantToRemoveAllPolygonsOnThisWall:"你确定删除这堵墙上所有非固定的多边形吗",WallStructure:"墙结构",DefaultStructure:"默认",StudStructure:"墙柱",PillarStructure:"圆柱",Opacity:"遮光度",StructureSpacing:"结构间距",StructureWidth:"结构宽度",StructureThickness:"结构厚度",StructureColor:"结构颜色",Color:"牆体颜色",Height:"高度",Thickness:"厚度",Texture:"材质",AllLightsOnWallInside:"所有电灯在牆内",AllLightsOnWallOutside:"所有电灯在牆外",Fill:"填充",Full:"全部",Partial:"部分",Empty:"空白",OpenToOutside:"对外面开放",EavesLength:"屋檐延伸长度",Parapet:"女墙",ParapetColor:"女墙颜色",ParapetTexture:"女墙材质",ParapetHeight:"女墙高度",CopingsHeight:"顶盖高度",CopingsWidth:"顶盖宽度"},windowMenu:{OnlyThisWindow:"只这个窗户",AllWindowsOnSurface:"同一表面上所有的窗户",AllWindowsAboveFoundation:"同一地基上所有的窗户",AllSelectedWindows:"所有选中的窗户",AllWindows:"所有的窗户",Width:"宽度",Height:"高度",Setback:"离墙体外表面的距离",RelativeToWallThickness:"相对于墙的厚度",Mullion:"直棂",HorizontalMullion:"水平的直棂",VerticalMullion:"竖直的直棂",MullionWidth:"直棂宽度",HorizontalMullionSpacing:"水平直棂的间距",VerticalMullionSpacing:"竖直直棂的间距",MullionColor:"直棂颜色",Tint:"着色",Opacity:"不透明度",SolarHeatGainCoefficient:"太阳辐射热获取系数(SHGC) = 1 - 不透明度",Shutter:"百叶窗",LeftShutter:"左侧百叶窗",RightShutter:"右侧百叶窗",BothShutters:"两侧百叶窗",ShutterWidth:"相对宽度",ShutterColor:"百叶窗颜色",Frame:"边框",FrameWidth:"边框宽度",SillWidth:"窗台宽度",Color:"边框颜色",WindowType:"窗户种类",Default:"默认",Arched:"拱形",Polygonal:"多边形",Interior:"内窗",Empty:"空白"},roofMenu:{TextureDefault:"默认材质",Texture01:"一号材质",Texture02:"二号材质",Texture03:"三号材质",Texture04:"四号材质",Texture05:"五号材质",Texture06:"六号材质",Texture07:"七号材质",OnlyThisRoof:"只这个屋顶",AllRoofsAboveFoundation:"同一地基上所有的屋顶",AllSelectedRoofs:"所有选中的屋顶",AllRoofs:"所有的屋顶",OnlyThisCeiling:"只这个天花板",AllCeilingsAboveFoundation:"同一地基上所有的天花板",AllCeilings:"所有的天花板",EavesOverhangLength:"屋檐延伸长度",RafterSpacing:"屋椽间距",RafterWidth:"屋椽宽度",RafterThickness:"屋椽厚度",RafterColor:"屋椽颜色",RoofColor:"屋顶颜色",RoofSideColor:"屋顶侧面颜色",GlassTint:"玻璃颜色",Opacity:"遮光度",RoofStructure:"屋顶结构",DefaultStructure:"默认",RafterStructure:"屋椽",GlassStructure:"玻璃",SolarPanels:"光伏板",LockAllUnlockedSolarPanels:"固定所有非固定的光伏板",UnlockAllLockedSolarPanels:"解除所有的光伏板固定",RemoveAllUnlockedSolarPanels:"删除这个屋顶上所有非固定的光伏板",DoYouReallyWantToRemoveAllSolarPanelsOnThisRoof:"你确定删除这个屋顶上所有非固定的光伏板吗",Windows:"天窗",LockAllUnlockedWindows:"固定所有非固定的天窗",UnlockAllLockedWindows:"解除所有的天窗固定",RemoveAllUnlockedWindows:"删除这个屋顶上所有非固定的天窗",DoYouReallyWantToRemoveAllWindowsOnThisRoof:"你确定删除这个屋顶上所有非固定的天窗吗",Sensors:"传感器",LockAllUnlockedSensors:"固定所有非固定的传感器",UnlockAllLockedSensors:"解除所有的传感器固定",RemoveAllUnlockedSensors:"删除这个屋顶上所有非固定的传感器",DoYouReallyWantToRemoveAllSensorsOnThisRoof:"你确定删除这个屋顶上所有非固定的传感器吗",Lights:"电灯",RemoveAllUnlockedLights:"删除这个屋顶上所有非固定的电灯",DoYouReallyWantToRemoveAllLightsOnThisRoof:"你确定删除这个屋顶上所有非固定的电灯吗",AllLightsOnRoofInside:"所有电灯在屋顶内",AllLightsOnRoofOutside:"所有电灯在屋顶外",Rise:"相对高度",Ceiling:"天花板",RoofRValue:"屋顶R值",CeilingRValue:"天花板R值"},doorMenu:{TextureDefault:"默认材质",Texture01:"一号材质",Texture02:"二号材质",Texture03:"三号材质",Texture04:"四号材质",Texture05:"五号材质",Texture06:"六号材质",Texture07:"七号材质",Texture08:"八号材质",Texture09:"九号材质",Texture10:"十号材质",Texture11:"十一号材质",Texture12:"十二号材质",Texture13:"十三号材质",Texture14:"十四号材质",Texture15:"十五号材质",Texture16:"十六号材质",Texture17:"十七号材质",OnlyThisDoor:"只这个门",AllDoorsOnWall:"同一面墙上所有的门",AllDoorsAboveFoundation:"同一地基上所有的门",AllSelectedDoors:"所有选中的门",AllDoors:"所有的门",DoorType:"门种类",Default:"默认",Arched:"拱形",Filled:"填充",FrameColor:"门框颜色",Interior:"内门"},siteInfoPanel:{High:"最高温度",Low:"最低温度"},designInfoPanel:{NumberOfSelectedHeliostats:"选中的定日镜总数",NumberOfSelectedSolarPanels:"选中的光伏板总数",ElectricityGeneratedDailyBySolarPanels:"这些光伏板的日发电量",SceneDiameter:"场景直径",BuildingArea:"建筑面积"},visualizationControlPanel:{ColorContrast:"热图颜色对比度",FluxScale:"热通量长度",ClickUpOrDownArrowButtonsToChange:"点击上下箭头改变参数"},instructionPanel:{Rotate:"旋转",DragMouse:"拖动鼠标",Zoom:"缩放",MouseWheelOrKeys:"鼠标滚轮或者Ctrl+[和Ctrl+]",MouseWheelOrKeysMac:"鼠标滚轮或者⌘+[和⌘+]",Pan:"平移",HoldCtrlDragMouse:"按下Ctrl键并拖动鼠标",HoldMetaDragMouse:"按下⌘键并拖动鼠标",Enter2DMode:"進入二维模式",Exit2DMode:"退出二维模式",NavigationMode:"导航模式",EnableNavigation:"進入导航模式",DisableNavigation:"退出导航模式",MoveForwardBack:"前后移动",MoveForwardBackInstruction:"按W/S键",MoveLeftRight:"左右移动",MoveLeftRightInstruction:"按A/D键",MoveUpDown:"上下移动",MoveUpDownInstruction:"按Z/X键",Turn:"拐弯",TurnInstruction:"按方向键",ResetView:"重置视角",AutoRotate:"自动旋转",StartOrStop:"按F4键启动或停止"},mapPanel:{ImageOnGround:"地面显示图像",HideAddress:"隐藏地址",WeatherStations:"气象站",WeatherStationsNote:"关闭此选项以提高地图速度",Coordinates:"经纬度坐标",Zoom:"放大程度"},visibilityPanel:{SolarPanelVisibility:"光伏板对观察者的可见度",Observer:"观察者",VantagePoint:"观察位置",ItemizedVisibilityByFields:"每个场的可见度",TotalVisibility:"总可见度"},sensorPanel:{LightSensor:"光传感器",WeatherDataFrom:"气象数据来自"},buildingEnergyPanel:{DailyBuildingEnergy:"建筑物日能耗",YearlyBuildingEnergy:"建筑物年能耗",Heater:"暖气",AC:"空调",SolarPanel:"光伏",Net:"净能耗"},solarPanelYieldPanel:{SolarPanelDailyYield:"光伏日发电量",SolarPanelYearlyYield:"光伏年发电量",Yield:"发电量",YieldPerHour:"每小时发电量",DailyTotal:"日发电总量",YearlyTotal:"年发电总量",ShowOutputsOfIndividualSolarPanels:"显示每行光伏板单独发电量",Profit:"利润",TotalCost:"总成本",TotalRevenue:"总收入",TotalYield:"总发电量",MeanYield:"平均发电量",ModuleCount:"光伏板总数"},parabolicTroughYieldPanel:{ParabolicTroughDailyYield:"抛物线槽日发电量",ParabolicTroughYearlyYield:"抛物线槽年发电量",Yield:"发电量",YieldPerHour:"每小时发电量",DailyTotal:"日发电总量",YearlyTotal:"年发电总量",ShowOutputsOfIndividualParabolicTroughs:"显示每行抛物线槽单独发电量"},parabolicDishYieldPanel:{ParabolicDishDailyYield:"抛物线碟日发电量",ParabolicDishYearlyYield:"抛物线碟年发电量",Yield:"发电量",YieldPerHour:"每小时发电量",DailyTotal:"日发电总量",YearlyTotal:"年发电总量",ShowOutputsOfIndividualParabolicDishes:"显示每个抛物线碟单独发电量"},fresnelReflectorYieldPanel:{FresnelReflectorDailyYield:"菲涅耳反射镜日发电量",FresnelReflectorYearlyYield:"菲涅耳反射镜年发电量",Yield:"发电量",YieldPerHour:"每小时发电量",DailyTotal:"日发电总量",YearlyTotal:"年发电总量",ShowOutputsOfIndividualFresnelReflectors:"显示每个菲涅耳反射镜单独发电量"},heliostatYieldPanel:{HeliostatDailyYield:"定日镜日发电量",HeliostatYearlyYield:"定日镜年发电量",Yield:"发电量",YieldPerHour:"每小时发电量",DailyTotal:"日发电总量",YearlyTotal:"年发电总量",ShowOutputsOfIndividualHeliostats:"显示每个定日镜单独发电量"},updraftTowerYieldPanel:{UpdraftTowerDailyYield:"太阳能上升气流塔日发电量",UpdraftTowerYearlyYield:"太阳能上升气流塔年发电量",ChimneyAirTemperature:"烟囱空气温度",ChimneyWindSpeed:"烟囱风速",Yield:"发电量",YieldPerHour:"每小时发电量",DailyTotal:"日发电总量",YearlyTotal:"年发电总量",ShowOutputsOfIndividualUpdraftTowers:"显示每个太阳能上升气流塔单独发电量"},heliodonPanel:{SunAndTimeSettings:"太阳和时间设置",SunAngles:"角度",TwentyFourHours:"24小时"},cloudFilePanel:{CopyTitle:"拷贝标题",TitleCopiedToClipBoard:"标题拷贝到剪贴板",SearchByTitle:"按标题搜索",MyLikes:"我喜欢的模型",MyCloudFiles:"我的云文件",GenerateLink:"生成链接",LinkGeneratedInClipBoard:"链接生成到剪贴板",DoYouReallyWantToDelete:"您确定删除此文件",IfSharedOrPublishedRenamingFileBreaksExistingLinks:"如果此文件已被分享或发布, 改名会使已有链接失效"},projectListPanel:{CopyTitle:"拷贝标题",TitleCopiedToClipBoard:"标题拷贝到剪贴板",SearchByTitle:"按标题搜索",MyProjects:"我的项目",GenerateProjectLink:"生成项目链接",ProjectLinkGeneratedInClipBoard:"项目链接生成到剪贴板",DoYouReallyWantToDeleteProject:"您确定删除项目",IfSharedOrPublishedRenamingProjectBreaksExistingLinks:"如果此项目已被分享或发布, 改名会使已有链接失效"},projectPanel:{ProjectSettings:"项目设定",ThumbnailImageSize:"缩略图大小",ProjectByOtherPeople:"别人的项目",Project:"项目",ProjectType:"类别",ProjectDescription:"描述",MakeDescriptionEditable:"编辑描述",MakeDescriptionNonEditable:"不编辑描述",DoubleClickToMakeDescriptionEditable:"双击此描述激活编辑功能",SolarPanelArray:"光伏板阵列设计",CurateCurrentDesign:"收藏当前设计",UpdateSelectedDesign:"更新选中设计",RemoveSelectedDesign:"删除选中设计",ClickToFlipSortingOrder:"点击逆转排序方向",DesignNotShownInSolutionSpaceClickToShow:"此设计目前不显示在设计空间内,点击显示",DesignShownInSolutionSpaceClickToHide:"此设计目前显示在设计空间内,点击隐藏",SolutionSpace:"设计空间",ChooseSolutionSpace:"选择设计空间",ChooseDataColoring:"选择数据着色",SameColorForAllDesigns:"所有设计一个颜色",OneColorForEachDesign:"每个设计一个颜色",SolutionSpaceScreenshot:"设计空间截屏",ScatterPlotScreenshot:"散点图截屏",SingleClickToSelectDoubleClickToOpen:"单击选择,双击打开。",SingleClickToDeselectDoubleClickToOpen:"单击取消选择,双击打开。",GenerateScatterPlot:"生成散点图",SelectXAxis:"选择X轴",SelectYAxis:"选择Y轴"},accountSettingsPanel:{MyAccountSettings:"我的账户设定",MyID:"我的🆔",ClickToCopyMyID:"点击此处拷贝我的ID",IDInClipBoard:"您现在可以粘贴ID了。",StoreMyNameInMyFilesWhenSaving:"保存文件时签上我的大名",DoYouReallyWantToShowYourNameInYourFiles:"您确定在您的文件里保存您的大名吗?",SignFileDisclaimer:"如果您选择保存,您的大名可能被所有打开您的文件的人看到。",Likes:"点赞总数",AllPublished:"发布总数",PublishedUnderAliases:"别名发布",UserCount:"用户总数",SchoolID:"学校编号",ClassID:"班级编号"},weatherPanel:{SunshineHours:"日照时间"},diurnalTemperaturePanel:{SelectAirTemperatureModel:"选择气温模型",Sinusoidal:"正弦函数"},economicsPanel:{EconomicsParameters:"经济学参数",ElectricitySellingPrice:"销售电价",OperationalCostPerUnit:"单位运行成本",SellingPrice:"销售电价",UnitCost:"单位成本"},navigationPanel:{NavigationParameters:"导航模式参数",MinimumMoveSpeed:"最小移动速度",MinimumTurnSpeed:"最小拐弯速度"},shadowSettingsPanel:{ShadowSettings:"阴影设定",ShadowCameraFarDistance:"最远距离",ShadowMapSize:"映射图长宽",Notes:"注意事项",RefreshPageNote:"改变设置后须刷新页面。",MapSizeWarning:"大的映射图长宽可能导致阿拉丁无法在某些电脑上运行。"},yearlyLightSensorPanel:{SkyClearness:"天空清晰度",ShowDaylightResults:"显示日照时间结果",ShowSkyClearnessResults:"显示天空清晰度结果",ShowAverageDailySolarRadiation:"显示日平均辐射结果"},analysisManager:{NoSensorForCollectingData:"没有传感器收集数据。",NoSolarPanelForAnalysis:"没有光伏板可以分析。",NoObserverForVisibilityAnalysis:"没有找到可见度分析的观察者。",NoWaterHeaterForAnalysis:"沒有太阳能热水器可以分析。",NoParabolicDishForAnalysis:"沒有抛物线碟可以分析。",NoParabolicTroughForAnalysis:"沒有抛物线槽可以分析。",NoFresnelReflectorForAnalysis:"沒有菲涅耳反射镜可以分析。",NoHeliostatForAnalysis:"沒有定日镜可以分析。",NoSolarUpdraftTowerForAnalysis:"沒有太阳能上升气流塔可以分析。",NoBuildingForAnalysis:"沒有建筑物可以分析。"},toolbar:{CloudFile:"云文件",Select:"选择",AddFoundation:"添加地基",AddWall:"添加墙体",AddWindow:"添加窗户",AddDoor:"添加门",AddPyramidRoof:"添加金字塔屋顶",AddGableRoof:"添加双坡屋顶",AddHipRoof:"添加四坡屋顶",AddGambrelRoof:"添加复斜屋顶",AddMansardRoof:"添加折线屋顶",AddCuboid:"添加长方体",AddSensor:"添加传感器",AddSolarPanel:"添加光伏板",AddWaterHeater:"添加太阳能热水器",AddPowerWall:"添加电源墙",AddParabolicDish:"添加抛物线碟",AddParabolicTrough:"添加抛物线槽",AddFresnelReflector:"添加菲涅耳反射镜",AddHeliostat:"添加定日镜",AddWindTurbine:"添加水平轴风力涡轮机",AddVerticalAxisWindTurbine:"添加垂直轴风力涡轮机",AddLight:"添加电灯",AddTree:"添加树木",AddFlower:"添加花草",AddPeople:"添加人物",DoubleClickToLockThisModeForNextAction:"双击按钮给下个动作锁定此模式",ClickToUnlockThisModeForNextAction:"点击按钮让动作完成即离开此模式",ManipulateGroup:"整体操作一个组",ClearScene:"清空场景",ShowSunAndTimeSettings:"显示太阳和时间设置",SpatialAnalysisOfEnergy:"能量的空间分析",DoYouReallyWantToClearContent:"您确定清空场景吗",ClickForMoreButtons:"点击此处切换到更多的按钮模式"},tooltip:{gotoIFI:"访问未来智能研究所",visitAladdinHomePage:"访问阿拉丁主页",clickToOpenMenu:"点击打开主菜单",clickToAccessAccountSettings:"点击打开账号设定"},tree:{Apple:"苹果树",Birch:"白桦",Coconut:"椰子树",Dogwood:"茱萸",Elm:"榆树",FanPalm:"扇叶棕榈",Linden:"菩提",Magnolia:"玉兰",Maple:"枫树",Oak:"橡树",Pine:"松树",Spruce:"云杉"},flower:{Bellflower:"铃兰",Boxwood:"黄杨",CactusCombo1:"仙人掌组合一",CactusCombo2:"仙人掌组合二",CactusCombo3:"仙人掌组合三",CactusCombo4:"仙人掌组合四",Hibiscus:"木槿",Hosta:"玉簪",Hydrangea:"绣球花",Peony:"牡丹",RedRose:"红玫瑰",Spirea:"绣线菊",Sunflower:"向日葵",TallBush:"高灌木",Tulip:"郁金香",WhiteFlower:"白花",YellowFlower:"黄花"},people:{Jaah:"贾阿",Jack:"杰克",Jacob:"雅各布",Jacqueline:"杰奎琳",Jade:"美玉",Jamelia:"洁米莉雅",James:"詹姆斯",Jane:"简",Jaya:"佳娅",Jaye:"杰伊",Jeanette:"珍妮特",Jedi:"杰迪",Jeff:"杰夫",Jena:"珍娜",Jennifer:"珍尼弗",Jess:"杰西",Jett:"杰特",Jill:"吉尔",Jiya:"吉娅",Joan:"琼",Jocelyn:"乔斯林",Joel:"乔尔",Joey:"乔伊",John:"约翰",Jonathon:"乔纳森",Jose:"何塞",Joseph:"约瑟夫",Joshua:"约书亚",Judd:"贾德",Judy:"朱蒂",Julia:"朱莉娅",Julio:"胡里奥",Jumapili:"祖玛匹莉",June:"准卫",Juro:"朱诺",Justin:"贾斯汀"},compass:{N:"北",S:"南",W:"西",E:"东"},month:{January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月"},modelsMap:{SearchByPublisher:"按发布者搜索",SearchByLabel:"按标签搜索",MyPublishedModels:"我发布的模型",TotalNumberOfUserPublishedModels:"用户发布的模型总数",SortFromOldestToNewest:"从早到晚排序",SortFromNewestToOldest:"从晚到早排序",ModelsFoundOnThisSite:"个模型在此位置",ShowModelsPublishedByThisAuthor:"展示此用户发布的模型"}}},upt={translation:{name:{IFI:"未來智能研究所",Aladdin:"阿拉丁",Tagline:"阿拉丁: 探索人工智慧時代的設計軟體 — 未來智能研究所研發"},cookie:{Statement:"聲明:為了改善您的用戶體驗,阿拉丁採用cookie儲存少量數據。",Accept:"同意"},aboutUs:{ProductBroughtToYouBy:"未來智能研究所榮譽出品",TermsOfService:"服務條款",PrivacyPolicy:"隱私政策",Software:"軟體",Content:"課件",Research:"研究",Support:"服務",Acknowledgment:"鳴謝",FundingInformation:"本產品的研發承蒙美國國家科學基金會慷慨資助(項目號#2105695,#2131097,#2301164)。本產品的任何觀點或結論僅代表創作者個人意見。",Contact:"如您需要更多資訊,請聯繫 Charles Xie (charles@intofuture.org)。我們會盡快回复。",Translators:"翻譯"},word:{Refresh:"刷新",LastUpdate:"上一次更新",Small:"小",Medium:"中",Large:"大",Design:"設計",Information:"資訊",Type:"類别",Text:"文字",FontSize:"字體大小",FontColor:"字體顏色",Model:"模型",Models:"模型",Upload:"上傳",ClickCount:"點擊數",Share:"分享",AlreadyLike:"已點贊",Like:"點贊",MustLogInToLike:"必須登錄才能點贊",AllRightsReserved:"版權所有",MeterAbbreviation:"米",Version:"版本",VersionInitial:"版本",Options:"選項",Maximum:"最大",Minimum:"最小",MaximumNumber:"最多",MinimumNumber:"最少",MaximumValue:"最大值",MinimumValue:"最小值",Or:"或",None:"無",High:"高",Partial:"部分",Teacher:"老師",Class:"班級",Total:"總數",Leaderboard:"用戶排行榜",Latest:"最新",Range:"範圍",SIUnit:"國際單位制",USUnit:"美國單位制",ThermalTransmittance:"熱透過率",ThermalResistance:"熱阻",UValue:"U值",RValue:"R值",VolumetricHeatCapacity:"容積熱容",BuildingHVACSystem:"建築物暖通空調系統",ThermostatSetpoint:"恆溫器設定值",TemperatureToleranceThreshold:"溫度忍耐閾值",TemperatureToleranceThresholdExplanation:`當日最低外面溫度高於恆溫器設定值減去此閾值,暖氣不開。 當日最高外面溫度低於恆溫器設定值加上此閾值,空調不開。`,Press:"按",Open:"打開",Save:"保存",SaveAsImage:"保存為圖像",SaveAsCsv:"保存為CSV",Update:"刷新",Paste:"粘貼",Copy:"複製",Cut:"剪切",Delete:"删除",Lock:"固定",Translucent:"半透明",Transparency:"透明度",Color:"顏色",Pattern:"圖案",Texture:"材質",Thickness:"厚度",Size:"尺寸",Yes:"是",No:"不",OK:"確定",Cancel:"取消",Apply:"應用",Close:"關閉",ApplyTo:"適用於",Run:"運行",Pause:"暫停",Resume:"繼續",Clear:"清空",Warning:"警告",Caution:"小心",Reminder:"提醒",Length:"長度",Width:"寬度",Height:"高度",Radius:"半徑",Angle:"角度",Azimuth:"方位角",Coordinates:"坐標",Weather:"天氣",Show:"顯示",Animate:"動畫",Date:"日期",Time:"時間",Title:"標題",Owner:"所有者",Action:"操作",Rename:"改名",Location:"位置",Latitude:"緯度",Month:"月份",Day:"天",Hour:"小時",Daylight:"白天長度",Radiation:"輻射",Temperature:"温度",kWh:"千瓦時",dollar:"元",MeterPerSecond:"米/秒",NorthInitial:"北",SouthInitial:"南",EastInitial:"東",WestInitial:"西",Fixed:"固定",Elements:"部件",Energy:"能量",Unknown:"未知",Label:"標籤",Description:"描述",NoDescription:"無描述",MaximumCharacters:"最多字符數",Author:"作者",Publisher:"發布者",Building:"建築",ResidentialBuilding:"住宅建築",CommercialBuilding:"商用建築",SchoolBuilding:"學校建築",TouristAttraction:"旅遊景點",UnderConstruction:"在建",Photovoltaic:"光伏",WindPower:"風能",ColocationProjects:"共用空間專案",Anonymous:"無名氏",Nickname:"别名",Pin:"置頂",Unpin:"解除置頂"},shared:{NoTexture:"無材質",FoundationElement:"地基",CuboidElement:"長方體",PolygonElement:"多邊形",SensorElement:"傳感器",SolarPanelElement:"光伏板",WaterHeaterElement:"太陽能熱水器",ParabolicDishElement:"拋物線碟",ParabolicTroughElement:"拋物線槽",FresnelReflectorElement:"菲涅耳反射鏡",HeliostatElement:"定日鏡",WindTurbineElement:"風力渦輪機",LightElement:"電燈",ElementLocked:"固定",ModelType:"模型類别",OutputBreakdown:"分列發電量",MoreResults:"更多結果"},message:{NewVersionAvailable:"有新版本",CalculationMayBeSlowDoYouWantToContinue:"計算可能會很慢。您想繼續嗎?",IncreaseSolarRadiationHeatmapGridCellSizeToSpeedUp:"加大太陽輻射熱圖網格的尺寸可加速",ModelNotFound:"沒有找到模型",CannotSignIn:"登錄失敗",CannotSignOut:"退出失敗",YourAccountWasCreated:"成功建立您的賬號。",CannotCreateAccount:"無法創建賬號",YourAccountSettingsWereSaved:"您的賬號設定已保存。",CannotSaveYourAccountSettings:"您的賬號設定無法保存",CannotSaveYourFileToCloud:"無法保存您的文檔到雲端",CannotCreateNewProject:"無法創建新專案",CannotCreateNewProjectWithoutTitle:"沒有標題, 無法創建新專案",CannotOpenYourProjects:"無法打開您的專案列表",CannotOpenProject:"無法打開專案",CannotDeleteProject:"無法刪除專案",CannotRenameProject:"無法給專案改名",CannotAddDesignToProject:"無法把此設計加到專案裡",CannotAddDesignToProjectOwnedByOthers:"不能把此設計加到別人的專案裡",DesignRemovedFromProject:"設計被成功地從專案裡刪除",CannotRemoveDesignFromProject:"無法把此設計從專案裡刪除",CannotUpdateProject:"無法更新專案",CannotFetchProjectData:"無法取得專案數據",TitleUsedChooseDifferentOne:"此標題已經被使用, 請採用不同的標題",CloudFileWithTitleExistsDoYouWantToOverwrite:"使用此標題的雲文檔已經存在,您確定要覆蓋它嗎?",CloudFileNotFound:"找不到此云端文檔",CannotLoadModelsOnMap:"無法下載地圖上的模型",CannotLoadLeaderboard:"無法下載排行榜",CannotPublishModelOnMap:"模型無法發佈到地圖上",CannotLikeModelFromMap:"無法點贊地圖上的模型",CannotDeleteModelFromMap:"無法删除地圖上的模型",ModelDeletedFromMap:"模型已從地圖上刪除",DoYouWantToDeleteModelFromMap:"您要删除地圖上的這個模型嗎?",CannotOpenCloudFile:"此云端文檔無法打開",CannotReadCloudFile:"無法讀取此云端文檔",CannotWriteCloudFile:"無法存儲此云端文檔",CloudFileCopied:"拷貝云端文檔",CannotOpenCloudFolder:"您的雲端文檔夾無法打開",CannotDeleteCloudFile:"無法刪除此云端文檔",CannotRenameCloudFile:"此云端文檔的名字無法更改",DoYouWantToSaveChanges:"您要保存當前文檔嗎?",NotApplicableToSelectedAction:"此值不適用於當前選擇範圍",ThisElementIsLocked:"這個部件被鎖定。",ThisCannotBeUndone:"這個操作一旦執行就不能撤銷。",AzimuthOfNorthIsZero:"正北的方位角為零度",CounterclockwiseAzimuthIsPositive:"逆時針為正",SouthFacingIsZero:"朝南為零度",ClockwiseRotationIsPositive:"順時針為正",MoveCancelledBecauseOfOverlap:"位置重疊,移動取消。",MoveOutsideBoundaryCancelled:"位置出界,移動取消。",RotationCancelledBecauseOfOverlap:"位置重疊,旋轉取消。",RotationOutsideBoundaryCancelled:"位置出界,旋轉取消。",ResizingCancelledBecauseOfOverlap:"位置重疊,尺寸調整取消。",ResizingOutsideBoundaryCancelled:"位置出界,尺寸調整取消。",CannotPasteOutsideBoundary:"位置出界,不能複制。",CannotPasteBecauseOfOverlap:"位置重疊,不能複制。",CannotMoveObjectTooFar:"位置太遠,移動取消。",ExistingSolarPanelsWillBeRemovedBeforeApplyingNewLayout:"採用新佈局之前必須移除現有的光伏板。",DoYouWantToContinue:"您想繼續嗎?",SolarPanelsCannotIntersectWithGround:"光伏板不能和地面接觸。",SolarPanelsCannotOverlapWithOneAnother:"光伏板不能重疊。",ScreenshotSaved:"截屏圖片保存在下載文檔夾裡。",CsvFileSaved:"CSV保存在下載文檔夾裡。",SimulationStarted:"模擬開始。",SimulationCompleted:"模擬結束。",SimulationAborted:"模擬取消。",SimulationPaused:"模擬暫停。",CancelSimulation:"取消模擬",PauseSimulation:"暫停模擬",ResumeSimulation:"繼續模擬",SimulationWillNotStartDueToErrors:"由於錯誤模擬無法運行",SimulationWillStartDespiteWarnings:"發現問題,但模擬仍然將運行。",EvolutionStarted:"演化開始。",EvolutionCompleted:"演化結束。",EvolutionAborted:"演化取消。",EvolutionPaused:"演化暫停。",EncounterEvolutionError:"演化出錯。",CancelEvolution:"取消演化",PauseEvolution:"暫停演化",ResumeEvolution:"繼續演化",ConvergenceThresholdHasBeenReached:"收斂閾值已達到。",MaximumNumberOfGenerationsHasBeenReached:"最大世代數已達到。",MaximumNumberOfStepsHasBeenReached:"最大步數已達到。",ObjectiveFunctionTypeError:"此操作不支持當前的目標函數。請從菜單啟動此功能。",WallsAreNotAtSameHeight:"墻體高度不同。",WallsAreNotPerpendicular:"墻體不垂直。",WallsAreNotConnected:"墻體不相連。",WallsNumberNeedToBeFour:"墻體數量必須為四個。",BuildingContainsEmptyWall:"建築物有空牆。",BuildingRoofMissing:"建築物沒有屋頂。",UnknownErrors:"未知錯誤。"},menu:{AnalysisOptions:"分析選項",option:{GridCellSize:"計算網格的尺寸",SamplingFrequency:"採樣頻率",TimesPerHour:"每小時採樣次數",DaysPerYear:"每一年採樣天數"},mainMenu:"主菜單",cloudMenu:"雲菜單",projectSubMenu:"專案",project:{CreateNewProject:"創建新專案",OpenProject:"打開專案",SaveProject:"保存專案",SaveProjectAs:"另存專案為",YouMustLogInToCreateProject:"您必須登錄才能創建專案",YouMustLogInToOpenProject:"您必須登錄才能打開專案"},fileSubMenu:"文檔",file:{CreateNewFile:"創建新文檔",OpenLocalFile:"打開本地文檔",SaveAsLocalFile:"保存為本地文檔",SavingAbortedMustHaveValidFileName:"文檔名無效,保存失敗",OpenCloudFile:"打開雲端文檔",SaveCloudFile:"保存雲端文檔",SaveAsCloudFile:"另存雲端文檔為",SavingAbortedMustHaveValidTitle:"雲端文檔名無效,保存失敗",ToSaveYourWorkPleaseSignIn:"為了保存您的雲端文檔,請先登錄。",TakeScreenshot:"截屏",UseCloudFileName:"採用雲端文件名",PublishOnModelsMap:"發佈到地圖上",PublishedOnModelsMap:"您的模型成功發佈到地圖上",UpdatedOnModelsMap:"您的模型更新成功",YouMustLogInToPublishYourModel:"您必須登錄才能發布模型",YouCannotPublishAModelThatYouDoNotOwn:"您不能發布他人的模型",YouMustSaveModelOnCloudBeforePublishingIt:"您必須先把此模型保存在雲端才能發布它"},editSubMenu:"編輯",edit:{Undo:"撤銷",Redo:"重做"},viewSubMenu:"視界",view:{NavigationView:"導航模式",TwoDimensionalView:"二維模式",ResetView:"重置視角",ZoomIn:"放大",ZoomOut:"縮小",AutoRotate:"自動旋轉",ShowShadow:"顯示陰影",ShowSurfaceShininess:"顯示表面光澤",TranslucentFloatingWindows:"透明浮動窗口",accessoriesSubMenu:"配件",accessories:{SiteInformation:"位置資訊",DesignInformation:"設計資訊",Instruction:"操作說明",StickyNote:"便簽",Note:"便簽"}},settingsSubMenu:"設置",settings:{WeatherData:"氣象數據",DiurnalTemperature:"晝夜溫度",Heliodon:"日影儀",SunAndTime:"太陽和時間"},benchmarksSubMenu:"基準",benchmarks:{SolarRadiationPredictionVsMeasurement:"太陽能輻射模型預測和實際測量的對比",BESTESTCase600:"建築物能耗模擬測試:BESTEST案例600",BESTESTCase610:"建築物能耗模擬測試:BESTEST案例610",BESTESTCase620:"建築物能耗模擬測試:BESTEST案例620",BESTESTCase630:"建築物能耗模擬測試:BESTEST案例630"},graph:{LineWidth:"線條寬度",SymbolSize:"符號大小",BarCategoryGap:"直條間隙",ShowHorizontalGridLines:"顯示格子的水平線條",ShowVerticalGridLines:"顯示格子的豎直線條"},analysisSubMenu:"分析",physicsSubMenu:"物理",physics:{DailySolarRadiationHeatmap:"當日太陽輻射總量分佈熱圖",SolarRadiationHeatmapOptions:"太陽輻射熱圖選項",SolarRadiationHeatmapGridCellSize:"太陽輻射熱圖網格的尺寸",SolarRadiationHeatmapMaxValue:"太陽輻射熱圖最大值",SolarRadiationHeatmapNoAnimation:"若無移動部件則省略動畫",ReflectionHeatmap:"反射熱圖"},sensorSubMenu:"傳感器",sensor:{CollectDailyData:"收集當天數據",CollectYearlyData:"收集全年數據",SensorSimulationNoAnimation:"若無移動部件則省略動畫"},buildingSubMenu:"建築物",building:{AnalyzeDailyBuildingEnergy:"建築物當天能耗分析",AnalyzeYearlyBuildingEnergy:"建築物全年能耗分析",EnergyAnalysisOptions:"能耗分析選項",EnergyGridCellSize:"計算網格的尺寸",BuildingEnergySimulationNoAnimation:"若無移動部件則省略動畫"},solarPanelSubMenu:"太陽能光伏板",solarPanel:{AnalyzeDailyYield:"分析當天產出",AnalyzeYearlyYield:"分析全年產出",AnalyzeVisibility:"分析可見度",PanelDiscretization:"光伏板離散化方法",Exact:"準確",Approximate:"近似",EnergyGridCellSize:"計算網格的尺寸",VisibilityGridCellSize:"視界因子計算網格的尺寸",EnergyAnalysisOptions:"能量分析選項",VisibilityAnalysisOptions:"可見度分析選項",SolarPanelSimulationNoAnimation:"若無移動部件則省略動畫"},parabolicTroughSubMenu:"拋物線槽",parabolicTrough:{AnalyzeDailyYield:"分析當天產出",AnalyzeYearlyYield:"分析全年產出"},parabolicDishSubMenu:"拋物線碟",parabolicDish:{AnalyzeDailyYield:"分析當天產出",AnalyzeYearlyYield:"分析全年產出"},fresnelReflectorSubMenu:"菲涅爾反射鏡",fresnelReflector:{AnalyzeDailyYield:"分析當天產出",AnalyzeYearlyYield:"分析全年產出"},heliostatSubMenu:"定日鏡",heliostat:{AnalyzeDailyYield:"分析當天產出",AnalyzeYearlyYield:"分析全年產出"},solarUpdraftTowerSubMenu:"太陽能上升氣流塔",solarUpdraftTower:{AnalyzeDailyYield:"分析當天產出",AnalyzeYearlyYield:"分析全年產出",SolarUpdraftTowerSimulationNoAnimation:"若無移動部件則省略動畫"},tutorialsSubMenu:"教程",solarEnergyScienceSubMenu:"太陽能科學",solarEnergyScienceTutorials:{SunAngles:"太陽相對於地面觀察者的角度",InsolationAndClimate:"太陽輻射和氣候的關係",SolarRadiationToBox:"一個長方體受到的太陽能輻射分析"},buildingScienceSubMenu:"建築科學",buildingScienceTutorials:{ThermalEnvelopeVsBuildingEnvelope:"房屋的熱學封套和圍護封套",EffectOfSizeOnBuildingEnergy:"房屋大小對能耗的影響",EffectOfOrientationOnBuildingEnergy:"房屋方位對能耗的影響",EffectOfInsulationOnBuildingEnergy:"房屋隔熱對能耗的影響",EffectOfRoofColorOnBuildingEnergy:"屋頂顏色對建築物能耗的影響",EffectOfEavesOverhangLengthOnBuildingEnergy:"屋簷延伸長度對建築物能耗的影響",EffectOfWindowSHGCOnBuildingEnergy:"窗戶太陽能輸入對房屋能耗的影響",EffectOfThermostatSetpointOnBuildingEnergy:"恆溫器設定值對房屋能耗的影響",EffectOfSolarPanelsOnBuildingEnergy:"光伏板對房屋能耗的影響",EffectOfGroundTemperatureOnBuildingEnergy:"地表温度對房屋能耗的影響",EffectOfTreesOnBuildingEnergy:"樹蔭對房屋能耗的影響"},buildingDesignSubMenu:"建築設計",buildingDesignTutorials:{CapeCodStyleHouseWithShedDormer:"有棚頂窗的科德角風格的住宅",MansardRoofWithDormers:"有天窗的折線屋頂",GableRoofVsHipRoof:"雙坡屋頂和四坡屋顶的對比",ColonialVsSaltbox:"殖民地風格和鹽盒風格的對比",GambrelRoofVsMansardRoof:"复斜屋顶和折線屋頂的對比",CombinationRoofVsBonnetRoof:"組合屋頂和帽簷屋頂的對比",DutchGableRoof:"荷蘭雙坡屋頂",GableAndValleyRoof:"坡谷屋頂",ClerestoryRoof:"天窗屋頂",MonitorRoof:"採光屋頂",AFrameHouse:"A字形房子",HalfTimberedHouse:"半木骨架房子",AllBasicRoofTypes:"所有的基本屋頂類型"},photovoltaicSolarPowerSubMenu:"光伏發電",photovoltaicSolarPowerTutorials:{EffectOfTiltAngleOfSolarPanel:"光伏板傾斜角對發電量的影響",EffectOfAzimuthOfSolarPanel:"光伏板方位角對發電量的影響",SolarPanelTypes:"光伏板類型",VerticalBifacialSolarPanels:"豎直的雙面光伏板",CompareMonofacialAndBifacialSolarPanels:"單面光伏板和雙面光伏板的對比",SolarTrackers:"自動追日器",CoveringGroundWithSolarPanels:"為什麼我們不簡單地用光伏板覆蓋地面",InterRowSpacingOfSolarPanelArray:"光伏板陣列行間距對發電量的影響",EffectOfOrientationOfSolarPanels:"光伏板排列方向對發電量的影響",SolarPanelArrayAutomaticLayout:"光伏板自動排列"},concentratedSolarPowerSubMenu:"光熱發電",concentratedSolarPowerTutorials:{EffectOfAzimuthOfParabolicTrough:"拋物線槽方位角對發電量的影響",EffectOfLatusRectumOfParabolicTrough:"拋物線槽通徑對發電量的影響",FocusSunlightWithParabolicDish:"用拋物線碟聚焦阳光",LinearFresnelReflectors:"用直線式菲涅爾反射鏡聚焦阳光",EffectOfAbsorberPipeHeightForLinearFresnelReflectors:"吸熱管的安装高度對直線式菲涅爾反射鏡發電量的影響",EffectOfAzimuthOfLinearFresnelReflectors:"直線式菲涅爾反射鏡方位角對發電量的影響",LinearFresnelReflectorsWithTwoAbsorbers:"配備兩個吸收管的直線式菲涅爾反射鏡陣列",CosineEfficiencyOfHeliostats:"定日鏡的餘弦效率",ShadowingAndBlockingOfHeliostats:"定日鏡的陰影和遮擋",EffectSolarPowerTowerHeight:"吸收塔高度對發電量的影響",SolarPowerTower:"塔式光熱發電站"},otherTypesOfSolarPowerSubMenu:"其它類型的太陽能發電",otherTypesOfSolarPowerTutorials:{SolarUpdraftTower:"太陽能上升氣流塔"},windPowerSubMenu:"風力發電",windPowerTutorials:{EffectOfBladeNumberOfWindTurbine:"轉子葉片的數目對風力渦輪機輸出的影響",EffectOfPitchAngleOfWindTurbineBlades:"轉子葉片的俯仰角對風力渦輪機輸出的影響",BirdSafeBladeDesign:"對鳥類安全的葉片設計",OffshoreWindFarm:"離岸風電場"},colocationSubMenu:"共用空間項目",colocationTutorials:{AgricultureSolarWindColocation:"農業光電風力共用空間"},generativeDesignSubMenu:"生成式設計",generativeDesignTutorials:{MonofacialSolarPanelArrayTiltAngle:"單面光伏板陣列的傾斜角",BifacialSolarPanelArrayTiltAngle:"雙面光伏板陣列的傾斜角",OutputOfSolarPanelArrayInDifferentPlaces:"一個光伏板陣列在不同地區的產出",SimpleSolarFarmParetoFront:"簡單太陽能農場設計的帕累托前沿"},examplesSubMenu:"例子",solarEnergySubMenu:"太陽能",solarEnergyExamples:{SunBeamAndHeliodon:"太陽光束和日影儀",RooftopSolarPanels:"屋頂光伏板",NevadaSolarOneParabolicTroughArray:"內華達州太陽能一號的拋物線槽陣列",TooeleParabolicDishArray:"猶他州圖埃勒的拋物線碟陣列",PS10SolarPowerTower:"西班牙塞維利亞的PS10太陽能發電塔",TucsonLinearFresnelReflectors:"亞利桑那州圖森的直線式菲涅爾反射鏡陣列",SolarCanopyFormFactors:"太陽能天篷外形設計",SolarCanopyOverBleachers:"看台太陽能天篷",SolarCanopyOverGarage:"車庫太陽能天篷",SolarBusStop:"太陽能候車亭",SolarFacadeTesla:"特斯拉光伏牆",BuildingIntegratedPhotovoltaics:"建築整合光伏",Floatovoltaics:"浮動光伏",Agrivoltaics:"農業光伏",VegetativeBuffer:"太陽能農場绿化带",RainbowSwashSolarFarmBostonMA:"馬薩諸塞州波士頓彩虹激流旁邊的光伏板陣列",MickeyMouseSolarFarmOrlandoFL:"佛羅里達州奧蘭多的米老鼠形狀光伏板陣列",SolarPanelsOverCanalBakersfieldCA:"加利福尼亞州貝克斯菲爾德灌溉渠上假想的光伏板陣列",SolarNoiseBarrierLexingtonMA:"馬薩諸塞州列剋星敦高速公路噪音牆上假想的光伏板",HSATSolarTrackersRaleighNC:"北卡羅來納州羅利的一個水平方向單軸旋轉追日光伏板陣列(HSAT)",AADATSolarTrackersLancasterCA:"加利福尼亞州蘭開斯特的一個雙軸旋轉追日光伏板陣列(AADAT)",SolarTrackersInRealWorld:"模擬",SolarUpdraftTowerInCity:"太陽能上升氣流塔在城市中的應用"},builtEnvironmentSubMenu:"建造環境",residentialBuildingsSubMenu:"住宅建築",residentialBuildingExamples:{ColonialHouse:"殖民地風格的住宅",DutchColonialHouse:"荷蘭殖民地風格的住宅",TShapedHouse:"T字型房子",CapeCodHouseWithGarage:"有車庫的科德角風格的住宅",Solarium:"有日光浴室的房子",Church1:"教堂例一",Cathedral1:"主教座堂例一",Cathedral2:"主教座堂例二",Mosque1:"清真寺例一",AdobeTaosHouse:"陶斯土坯房",RanchHouse:"牧場風格的住宅",BonnetHouse:"有帽簷屋頂的住宅",BarnStyleHouse:"穀倉式風格的住宅",ModernHouse:"現代風格的住宅",ButterflyRoofHouse:"蝴蝶型屋頂的住宅"},commercialBuildingsSubMenu:"商用建築",commercialBuildingExamples:{WhiteHouse:"白宫",HaroldWashingtonCollege:"哈羅德華盛頓學院",BilimMersinTurkiye:"土耳其梅爾辛科學教育中心",SpanishStyleHotel:"西班牙風格旅館",ApartmentBuilding:"公寓樓",OfficeBuilding:"寫字樓",Hotel:"旅館"},buildingComplexesSubMenu:"建築群",buildingComplexExamples:{SouthBurlingtonHighSchoolVermont:"佛蒙特州南伯靈頓高中",MescaleroApacheSchoolNewMexico:"新墨西哥州梅斯卡勒羅阿帕奇學校"},urbanPlanningSubMenu:"城市規劃",urbanPlanningExamples:{CityBlockHeatmap:"城市街區熱圖",ChicagoSkyline:"芝加哥天際線"},otherBuildingsSubMenu:"其它建築",otherBuildingExamples:{Greenhouse:"溫室",Pavilion:"公園的亭子",OctagonalPagoda:"八角塔",OceanFront:"海邊",EgyptianPyramids:"埃及金字塔",MayanPyramid:"瑪雅金字塔",SiOSePol:"三十三孔橋",StackedCuboids:"堆砌長方體"},artificialIntelligenceSubMenu:"人工智慧",artificialIntelligenceExamples:{OptimizingTiltAngleOfOneSolarPanelRow:"優化單排光伏板的傾斜角",OptimizingTiltAnglesOfMultipleSolarPanelRows:"優化多排光伏板的傾斜角",SolarFarmGenerativeDesign:"生成式設計太陽能農場",SolarFarmGenerativeDesignWithBlock:"生成式設計太陽能農場:周邊有建築物的情況",FitchburgSolarFarmGenerativeDesign:"生成式設計太陽能農場:真實世界案例"},languageSubMenu:"語言",publicSubMenu:"公共",ModelsGallery:"模型畫廊",ModelsMap:"模型地圖",AboutUs:"關於我們"},avatarMenu:{AccountSettings:"賬號設定",PrivacyStatementTitle:"用戶隱私權保護聲明",PrivacyStatement:"登錄需要採用您的谷歌ID建立或進入您的阿拉丁賬戶。 我們只儲存一個隨機的字符串作為您的ID。 任何關於您的可辨識的個人信息都沒有被收集。 詳情請參考我們的",SignIn:"登錄",SignOut:"退出賬號",IfYouAreAStudent:"如果您是一個學生"},skyMenu:{Axes:"顯示坐標軸",Theme:"環境主題",ThemeDefault:"默認",ThemeDesert:"沙漠",ThemeDune:"沙丘",ThemeForest:"森林",ThemeGrassland:"草原",ThemeHill:"丘陵",ThemeLake:"湖泊",ThemeMountain:"山脈",ThemeRural:"田園",SunlightAttenuationCoefficientInAir:"陽光在空氣中傳播的衰減係數",ConvectiveCoefficientOfAir:"空氣對流傳熱係數",HighestTemperatureTimeInMinutes:"最高氣溫時間(分鐘)",SelectSunAnglesToShow:"選擇太陽角度顯示",ShowAzimuthAngle:"顯示方位角",ShowElevationAngle:"顯示高度角",ShowZenithAngle:"顯示天頂角",DirectLightBrightnessAtNoon:"正午直射光照度",AmbientLightBrightnessAtNoon:"正午環境光照度"},groundMenu:{MonthlyIrradianceLoss:"月份輻射度損失比",Vegetation:"植被",LeafOutDay:"樹葉長出的日子",LeafOffDay:"樹葉脫落的日子",Albedo:"反照率",ImageOnGround:"地面顯示圖像",WaterSurface:"水面",RemoveAllUnlockedTrees:"刪除所有非固定的樹木",RemoveAllUnlockedFlowers:"删除所有非固定的花草",RemoveAllUnlockedSolarPanels:"删除所有非固定的光伏板",RemoveAllUnlockedPeople:"删除所有非固定的人物",RemoveAllUnlockedFoundations:"删除所有非固定的地基",RemoveAllUnlockedCuboids:"删除所有非固定的長方體",DoYouReallyWantToRemoveAllPeople:"你確定刪除所有非固定的人物嗎",DoYouReallyWantToRemoveAllTrees:"你確定刪除所有非固定的樹木嗎",DoYouReallyWantToRemoveAllFlowers:"你確定刪除所有非固定的花草嗎",DoYouReallyWantToRemoveAllSolarPanels:"你確定刪除所有非固定的光伏板嗎",DoYouReallyWantToRemoveAllFoundations:"你確定刪除所有非固定的地基嗎",DoYouReallyWantToRemoveAllCuboids:"你確定刪除所有非固定的長方體嗎",LockAllUnlockedElements:"固定所有非固定的部件",UnlockAllLockedElements:"解除所有的固定"},labelSubMenu:{Label:"標籤",LabelText:"標籤的内容",LabelHeight:"標籤的高度",LabelSize:"標籤的大小",LabelFontSize:"字體的大小",LabelColor:"標籤的顏色",KeepShowingLabel:"顯示標籤"},foundationMenu:{RemoveAllUnlockedSolarPanels:"刪除此地基上所有非固定的光伏板",RemoveAllUnlockedParabolicTroughs:"刪除此地基上所有非固定的拋物線槽",RemoveAllUnlockedParabolicDishes:"刪除此地基上所有非固定的拋物線碟",RemoveAllUnlockedFresnelReflectors:"刪除此地基上所有非固定的菲涅耳反射鏡",RemoveAllUnlockedHeliostats:"刪除此地基上所有非固定的定日鏡",RemoveAllUnlockedWindTurbines:"刪除此地基上所有非固定的風力渦輪機",RemoveAllUnlockedSensors:"刪除此地基上所有非固定的傳感器",RemoveAllUnlockedLights:"刪除此地基上所有非固定的電燈",RemoveAllUnlockedWalls:"刪除此地基上所有非固定的牆",RemoveAllUnlockedWindows:"刪除此地基上所有非固定的窗戶",RemoveAllUnlockedDoors:"刪除此地基上所有非固定的門",RemoveAllUnlockedPolygons:"刪除此地基上所有非固定的多邊形",RemoveAllUnlockedHumans:"刪除此地基上所有非固定的人物",RemoveAllUnlockedTrees:"刪除此地基上所有非固定的樹木",RemoveAllUnlockedFlowers:"刪除此地基上所有非固定的花草",Racks:"支架",Texture01:"一號材質",Texture02:"二號材質",Texture03:"三號材質",Texture04:"四號材質",Texture05:"五號材質",Texture06:"六號材質",Texture07:"七號材質",Texture08:"八號材質",Texture09:"九號材質",Texture10:"十號材質",SolarPanels:"光伏板",SolarPanelArray:"光伏板陣列",DoYouReallyWantToRemoveAllSolarPanelsOnFoundation:"你確定刪除此地基上所有非固定的光伏板嗎",ParabolicTroughs:"拋物線槽",DoYouReallyWantToRemoveAllParabolicTroughsOnFoundation:"你確定刪除此地基上所有非固定的拋物線槽嗎",ParabolicDishes:"拋物線碟",DoYouReallyWantToRemoveAllParabolicDishesOnFoundation:"你確定刪除此地基上所有非固定的拋物線碟嗎",FresnelReflectors:"菲涅耳反射鏡",DoYouReallyWantToRemoveAllFresnelReflectorsOnFoundation:"你確定刪除此地基上所有非固定的菲涅耳反射鏡嗎",Heliostats:"定日鏡",DoYouReallyWantToRemoveAllHeliostatsOnFoundation:"你確定刪除此地基上所有非固定的定日鏡嗎",WindTurbines:"風力渦輪機",DoYouReallyWantToRemoveAllWindTurbinesOnFoundation:"你確定刪除此地基上所有非固定的風力渦輪機嗎",Sensors:"傳感器",DoYouReallyWantToRemoveAllSensorsOnFoundation:"你確定刪除此地基上所有非固定的傳感器嗎",Lights:"電燈",DoYouReallyWantToRemoveAllLightsOnFoundation:"你確定刪除此地基上所有非固定的電燈嗎",Walls:"牆",DoYouReallyWantToRemoveAllWallsOnFoundation:"你確定刪除此地基上所有非固定的牆嗎",Windows:"窗戶",DoYouReallyWantToRemoveAllWindowsOnFoundation:"你確定刪除此地基上所有非固定的窗戶嗎",Doors:"門",DoYouReallyWantToRemoveAllDoorsOnFoundation:"你確定刪除此地基上所有非固定的門嗎",Polygons:"多邊形",DoYouReallyWantToRemoveAllPolygonsOnFoundation:"你確定刪除此地基上所有非固定的多邊形嗎",Humans:"人物",DoYouReallyWantToRemoveAllHumansOnFoundation:"你確定刪除此地基上所有非固定的人物嗎",Trees:"樹木",DoYouReallyWantToRemoveAllTreesOnFoundation:"你確定刪除此地基上所有非固定的樹木嗎",Flowers:"花草",DoYouReallyWantToRemoveAllFlowersOnFoundation:"你確定刪除此地基上所有非固定的花草嗎",OnlyThisFoundation:"只這塊地基",AllConnectedFoundations:"所有相連的地基",AllSelectedFoundations:"所有選中的地基",AllFoundations:"所有的地基",AddPolygon:"添加多邊形",SolarStructure:"太陽能構型",GroupMaster:"主地基",LockAllUnlockedElementsOnThisFoundation:"固定此地基上所有非固定的部件",UnlockAllLockedElementsOnThisFoundation:"解除此地基上所有的固定",GroundFloorRValue:"建築物地板的R值",OnlyThisGroundFloor:"只這個建築物的地板",AllGroundFloors:"所有建築物的地板"},solarPowerTowerMenu:{ReceiverTowerForHeliostats:"和定日鏡配套的吸收塔",ReceiverTowerPhysicalProperties:"太陽能吸收塔的物理性質",ReceiverTowerHeight:"太陽能吸收塔的高度",ReceiverTowerRadius:"太陽能吸收塔的半徑",ReceiverAbsorptance:"太陽能吸收器的吸收率",ReceiverOpticalEfficiency:"太陽能吸收器的光效率",ReceiverThermalEfficiency:"太陽能吸收器的熱效率"},solarAbsorberPipeMenu:{AbsorberPipeForFresnelReflectors:"和菲涅爾反射鏡配套的吸收管",AbsorberPipePhysicalProperties:"太陽能吸收管的物理性質",AbsorberHeight:"太陽能吸收管的安装高度",AbsorberApertureWidth:"太陽能吸收管的孔徑",AbsorberPipePoleNumber:"太陽能吸收管的支柱數量",AbsorberAbsorptance:"太陽能吸收管的吸收率",AbsorberOpticalEfficiency:"太陽能吸收管的光效率",AbsorberThermalEfficiency:"太陽能吸收管的熱效率"},solarUpdraftTowerMenu:{SolarUpdraftTower:"太陽能上升氣流塔",SolarUpdraftTowerPhysicalProperties:"太陽能上升氣流塔的物理性質",SolarUpdraftTowerChimneyHeight:"太陽能上升氣流塔煙囪的高度",SolarUpdraftTowerChimneyRadius:"太陽能上升氣流塔煙囪的半徑",SolarUpdraftTowerCollectorHeight:"太陽能上升氣流塔集熱棚的高度",SolarUpdraftTowerCollectorRadius:"太陽能上升氣流塔集熱棚的半徑",SolarUpdraftTowerCollectorTransmissivity:"太陽能上升氣流塔集熱棚的透射率",SolarUpdraftTowerCollectorEmissivity:"太陽能上升氣流塔集熱棚的發射率",SolarUpdraftTowerDischargeCoefficient:"太陽能上升氣流塔的流量係數",SolarUpdraftTowerTurbineEfficiency:"太陽能上升氣流塔的渦輪機效率"},cuboidMenu:{Texture01:"一號材質",Texture02:"二號材質",Texture03:"三號材質",Texture04:"四號材質",Texture05:"五號材質",Texture06:"六號材質",Texture07:"七號材質",Texture08:"八號材質",Texture09:"九號材質",Texture10:"十號材質",RemoveAllUnlockedSolarPanels:"刪除此長方體表面上所有非固定的光伏板",RemoveAllUnlockedSensors:"刪除此長方體表面上所有非固定的傳感器",RemoveAllUnlockedPolygons:"刪除此長方體表面上所有非固定的多邊形",RemoveAllUnlockedHumans:"刪除此長方體表面上所有非固定的人物",RemoveAllUnlockedTrees:"刪除此長方體表面上所有非固定的樹木",RemoveAllUnlockedFlowers:"刪除此長方體表面上所有非固定的花草",RemoveAllUnlockedLights:"刪除此長方體表面上所有非固定的電燈",Racks:"支架",Lights:"電燈",DoYouReallyWantToRemoveAllLightsOnCuboid:"你確定刪除此長方體表面上所有非固定的電燈嗎",SolarPanels:"光伏板",DoYouReallyWantToRemoveAllSolarPanelsOnCuboid:"你確定刪除此長方體表面上所有非固定的光伏板嗎",Sensors:"傳感器",DoYouReallyWantToRemoveAllSensorsOnCuboid:"你確定刪除此長方體表面上所有非固定的傳感器嗎",Polygons:"多邊形",DoYouReallyWantToRemoveAllPolygonsOnCuboid:"你確定刪除此長方體表面上所有非固定的多邊形嗎",Humans:"人物",DoYouReallyWantToRemoveAllHumansOnCuboid:"你確定刪除此長方體表面上所有非固定的人物嗎",Trees:"樹木",DoYouReallyWantToRemoveAllTreesOnCuboid:"你確定刪除此長方體表面上所有非固定的樹木嗎",Flowers:"花草",DoYouReallyWantToRemoveAllFlowersOnCuboid:"你確定刪除此長方體表面上所有非固定的花草嗎",OnlyThisCuboid:"只這個長方體",AllCuboidsOnSameSurface:"同一表面上所有的長方體",AllCuboidsAboveSameBase:"同一地基上所有的長方體",AllSelectedCuboids:"所有選中的長方體",AllCuboids:"所有的長方體",OnlyThisSide:"只這個表面",AllSidesOfThisCuboid:"這個長方體所有的側面",AllSidesOfSelectedCuboids:"所有選中長方體所有的側面",AllSidesOfAllCuboids:"所有的長方體所有的側面",AddPolygon:"添加多邊形",Stackable:"可堆砌",GroupMaster:"主長方體"},polygonMenu:{Texture01:"一號材質",Texture02:"二號材質",Texture03:"三號材質",Texture04:"四號材質",Texture05:"五號材質",Texture06:"六號材質",Texture07:"七號材質",Texture08:"八號材質",Texture09:"九號材質",Texture10:"十號材質",TextBox:"文字框",FontOutlineColor:"字體輪廓顏色",FontOutlineWidth:"字體輪廓線寬",FontStrokeColor:"字體描邊顏色",FontStrokeWidth:"字體描邊線寬",NoOutline:"無輪廓線",Shiny:"光澤",Filled:"填充",FillTexture:"填充材質",FillColor:"填充顏色",Opacity:"遮光度",LineColor:"線條顏色",LineWidth:"線條寬度",LineStyle:"線條樣式",SolidLine:"實線",DashedLine:"虛線",DottedLine:"點線",InsertVertexBeforeIndex:"前面插入頂點",InsertVertexAfterIndex:"後面插入頂點",DeleteVertex:"移除頂點",OnlyThisPolygon:"只這個多邊形",AllPolygonsOnSurface:"同一表面上所有的多邊形",AllPolygonsAboveFoundation:"同一地基上所有的多邊形",AllSelectedPolygons:"所有選中的多邊形",AllPolygons:"所有的多邊形",Layout:"佈局",SolarPanelArrayLayout:"光伏板陣列佈局",SolarPanelArrayLayoutParametricDesign:"光伏板陣列佈局參數化設計",SolarPanelArrayLayoutGenerativeDesign:"光伏板陣列佈局生成式設計",SolarPanelArrayModel:"光伏板型號",SolarPanelArrayOrientation:"排列方向",SolarPanelArrayTiltAngle:"傾斜角度",SolarPanelArrayRowWidth:"行寬度",SolarPanelArrayInterRowSpacing:"行間距",SolarPanelArrayRowSpacing:"行間距",SolarPanelArrayRowAxis:"行軸方向",SolarPanelArrayLeftRightRowAxis:"左右方向(相對)",SolarPanelArrayUpDownRowAxis:"上下方向(相對)",SolarPanelArrayEastWestRowAxis:"東西方向(絕對)",SolarPanelArrayNorthSouthRowAxis:"南北方向(絕對)",SolarPanelArrayMargin:"邊緣餘地",SolarPanelArrayPoleHeight:"支架高度",SolarPanelArrayPoleSpacing:"支柱間隔",SolarPanelArrayTotalYearlyCost:"全年總成本",SolarPanelArrayTotalYearlyRevenue:"全年總收入",SolarPanelArrayTotalYearlyYield:"全年總發電量",SolarPanelArrayMeanYearlyYield:"平均年發電量",SolarPanelArrayYearlyProfit:"全年利潤",LayoutNotAcceptedCheckYourParameters:"恕不能採用此佈局。請檢查您的參數設置。"},optimizationMenu:{Optimization:"優化",Parameters:"參數",Variables:"變量",Constants:"常量",GeneticAlgorithm:"遺傳算法",GeneticAlgorithmSettings:"遺傳算法設定",ParticleSwarmOptimization:"粒子群優化",ParticleSwarmOptimizationSettings:"粒子群優化設定",SolarPanelTiltAngleOptimization:"光伏板傾斜角度優化",SolarPanelArrayLayout:"光伏板陣列佈局",Generation:"世代",Gene:"基因",NormalizedVariables:"標準化變量",Objective:"目標函數",ObjectiveFunctionDailyTotalYield:"當日總產出",ObjectiveFunctionYearlyTotalYield:"全年總產出",ObjectiveFunctionDailyMeanYield:"當日平均產出",ObjectiveFunctionYearlyMeanYield:"全年平均產出",ObjectiveFunctionDailyProfit:"當日利潤",ObjectiveFunctionYearlyProfit:"全年利潤",GeneticAlgorithmSelectionMethod:"遺傳算法選擇方法",RouletteWheel:"輪盤制",Tournament:"淘汰制",SearchMethod:"搜索方法",GlobalSearchUniformSelection:"全局搜索均勻取樣",LocalSearchRandomOptimization:"局部搜索隨機優化",PopulationSize:"種群個體數目",MaximumGenerations:"最大世代數目",SelectionRate:"選擇概率",CrossoverRate:"交配概率",MutationRate:"突變概率",Step:"步數",SwarmSize:"粒子數目",MaximumSteps:"最大步數",MaximumVelocity:"最大速度",InertiaWeight:"慣性權重",CognitiveCoefficient:"認知係數",SocialCoefficient:"社會係數",ConvergenceThreshold:"終止條件的收斂閾值",LocalSearchRadius:"局部搜索的半徑",RowsPerRackRange:"單個支架上光伏板行數的變化範圍",TiltAngleRange:"光伏板傾斜角度的變化範圍",InterRowSpacingRange:"光伏板陣列行間距的變化範圍",ClickTargetPolygonToActivate:"點擊目標多邊形激活",ClickTargetFoundationToActivate:"點擊目標地基激活"},treeMenu:{ShowModel:"顯示近似模型",Flip:"翻轉",Type:"樹種",Spread:"樹冠直徑"},flowerMenu:{Flip:"翻轉",Type:"品種",Spread:"直徑"},peopleMenu:{ChangePerson:"改變人物",Flip:"轉身",Observer:"觀察者",ViewFromThisPerson:"視角移到此人位置"},lightMenu:{Color:"顏色",Intensity:"亮度",Decay:"衰减",MaximumDistance:"最大距離",Inside:"内部"},solarCollectorMenu:{Coordinates:"座標",RelativeXCoordinateOfCenter:"中心的相對X座標",RelativeYCoordinateOfCenter:"中心的相對Y座標",RelativeAzimuth:"相對方位角",Pole:"支柱",PoleHeight:"支柱高度",PoleRadius:"支柱半徑",ExtraPoleHeight:"額外的支柱高度",ExtraPoleHeightInAdditionToHalfWidth:"寬度一半額外的支柱高度",DrawSunBeam:"顯示光束"},concentratedSolarPowerCollectorMenu:{ReflectorReflectance:"反射器鏡面反射率",ReceiverAbsorptance:"接收器吸收率",ReflectorOpticalEfficiency:"反射器光效率",ReceiverThermalEfficiency:"接收器熱效率"},waterHeaterMenu:{OnlyThisWaterHeater:"只這個熱水器",AllWaterHeatersOnSurface:"同一表面上所有的熱水器",AllWaterHeatersAboveFoundation:"同一地基上所有的熱水器",AllSelectedWaterHeaters:"所有選中的熱水器",AllWaterHeaters:"所有的熱水器"},solarPanelMenu:{ElectricalProperties:"電氣特性",InverterEfficiency:"逆變器效率",InverterEfficiencyExplained:"直流電轉換為交流電的效率。",DcToAcSizeRatio:"直流-交流容量比例",DcToAcSizeRatioExplained:"直流電容量和交流電容量的比例。",ChangePvModel:"改變光伏板型號",Orientation:"排列方向",Portrait:"縱向",Landscape:"橫向",FrameColor:"框架顏色",Panels:"塊",PanelsWide:"塊光伏板寬",PanelsLong:"塊光伏板長",TiltAngle:"傾斜角度",SouthFacingIsPositive:"朝南為正",Tracker:"追日系統",SolarTrackerFollowsSun:"追日系統提高光伏板產出。",PoleSpacing:"支柱間隔",NoTracker:"無追日系統",HorizontalSingleAxisTracker:"水平單軸追日系統",VerticalSingleAxisTracker:"豎直單軸追日系統",AltazimuthDualAxisTracker:"地平雙軸追日系統",OnlyThisSolarPanel:"只這個光伏板",AllSolarPanelsOnSurface:"同一表面上所有的光伏板",AllSolarPanelsAboveFoundation:"同一地基上所有的光伏板",AllSelectedSolarPanels:"所有選中的光伏板",AllSolarPanels:"所有的光伏板"},pvModelPanel:{SolarPanelSpecs:"光伏板型號性能",Model:"型號",PanelSize:"尺寸",Cells:"電池組",CellType:"光伏電池類型",Monocrystalline:"單晶矽",Polycrystalline:"多晶矽",ThinFilm:"薄膜",Bifacial:"雙面",BifacialityFactor:"雙面性因子",Black:"黑色",Blue:"藍色",ShadeTolerance:"陰影耐受度",SolarCellEfficiency:"光伏電池效率",NominalOperatingCellTemperature:"名義電池運行溫度",TemperatureCoefficientOfPmax:"Pmax溫度係數"},parabolicTroughMenu:{ModuleLength:"模塊長度",Modules:"模塊",ModulesLong:"模塊長",LatusRectum:"通徑",OnlyThisParabolicTrough:"只這個拋物線槽",AllParabolicTroughsAboveFoundation:"同一地基上所有的拋物線槽",AllSelectedParabolicTroughs:"所有選中的抛物线槽",AllParabolicTroughs:"所有的拋物線槽"},fresnelReflectorMenu:{AbsorberPipe:"吸收管",SelectAbsorberToReflectSunlightTo:"選擇陽光反射到的吸收管",ModuleLength:"模塊長度",Modules:"模塊",ModulesLong:"模塊長",OnlyThisFresnelReflector:"只這個菲涅耳反射鏡",AllFresnelReflectorsAboveFoundation:"同一地基上所有的菲涅耳反射鏡",AllSelectedFresnelReflectors:"所有選中的菲涅耳反射镜",AllFresnelReflectors:"所有的菲涅耳反射鏡"},heliostatMenu:{Tower:"吸收塔",SelectTowerToReflectSunlightTo:"選擇陽光反射到的吸收塔",OnlyThisHeliostat:"只這個定日鏡",AllHeliostatsAboveFoundation:"同一地基上所有的定日鏡",AllSelectedHeliostats:"所有選中的定日镜",AllHeliostats:"所有的定日鏡"},parabolicDishMenu:{ReceiverStructure:"接收器結構",CentralPole:"中心直柱",CentralPoleWithTripod:"三腳架和中心直柱",Quadrupod:"四脚架",RimDiameter:"外圈直徑",LatusRectum:"通徑",ExtraPoleHeightInAdditionToRadius:"半徑之外額外的支架高度",OnlyThisParabolicDish:"只這個拋物線碟",AllParabolicDishesAboveFoundation:"同一地基上所有的拋物線碟",AllSelectedParabolicDishes:"所有選中的抛物线碟",AllParabolicDishes:"所有的拋物線碟"},windTurbineMenu:{BirdSafeDesign:"鳥類安全設計",BirdSafeNone:"無",BirdSafeBicolor:"雙色",BirdSafeStriped:"條紋",Rotor:"轉子",BladeNumber:"葉片數目",RotorInitialAngle:"轉子初始角度",RotorBladeDesign:"轉子葉片設計",RotorBladeRadius:"轉子葉片半徑",RotorBladePitchAngle:"轉子葉片俯仰角",RelativeYawAngle:"相對偏流角",MaximumChordLength:"最大弦長度",Tower:"塔架",TowerHeight:"塔架高度",TowerRadius:"塔架半徑",HubDesign:"轉子輪轂設計",HubRadius:"輪轂半徑",HubLength:"輪轂長度",OnlyThisWindTurbine:"只這個風力渦輪機",AllWindTurbinesAboveFoundation:"同一地基上所有的風力渦輪機",AllSelectedWindTurbines:"所有選中的風力渦輪機",AllWindTurbines:"所有的風力渦輪機"},wallMenu:{TextureDefault:"默認材質",Texture01:"一號材質",Texture02:"二號材質",Texture03:"三號材質",Texture04:"四號材質",Texture05:"五號材質",Texture06:"六號材質",Texture07:"七號材質",Texture08:"八號材質",Texture09:"九號材質",Texture10:"十號材質",SizeOfWall:"牆的尺寸",OnlyThisWall:"只這堵牆",AllConnectedWalls:"所有連接的牆",AllWallsAboveFoundation:"同一地基上所有的牆",AllSelectedWalls:"所有選中的墙",AllWalls:"所有的牆",Windows:"窗戶",LockAllUnlockedWindows:"固定所有非固定的窗戶",UnlockAllLockedWindows:"解除所有的窗戶固定",RemoveAllUnlockedWindows:"刪除這堵牆上所有非固定的窗戶",DoYouReallyWantToRemoveAllWindowsOnThisWall:"你確定刪除這堵牆上所有非固定的窗戶嗎",Doors:"門",LockAllUnlockedDoors:"固定所有非固定的門",UnlockAllLockedDoors:"解除所有的門固定",RemoveAllUnlockedDoors:"刪除這堵牆上所有非固定的門",DoYouReallyWantToRemoveAllDoorsOnThisWall:"你確定刪除這堵牆上所有非固定的門嗎",SolarPanels:"光伏板",LockAllUnlockedSolarPanels:"固定所有非固定的光伏板",UnlockAllLockedSolarPanels:"解除所有的光伏板固定",RemoveAllUnlockedSolarPanels:"刪除這堵牆上所有非固定的光伏板",DoYouReallyWantToRemoveAllSolarPanelsOnThisWall:"你確定刪除這堵牆上所有非固定的光伏板嗎",Sensors:"傳感器",LockAllUnlockedSensors:"固定所有非固定的傳感器",UnlockAllLockedSensors:"解除所有的傳感器固定",RemoveAllUnlockedSensors:"刪除這堵牆上所有非固定的傳感器",DoYouReallyWantToRemoveAllSensorsOnThisWall:"你確定刪除這堵牆上所有非固定的傳感器嗎",Lights:"電燈",LockAllUnlockedLights:"固定這堵牆上所有非固定的電燈",UnlockAllLockedLights:"解除這堵牆上所有的電燈固定",RemoveAllUnlockedLights:"刪除這堵牆上所有非固定的電燈",DoYouReallyWantToRemoveAllLightsOnThisWall:"你確定刪除這堵牆上所有非固定的電燈嗎",Polygons:"多邊形",LockAllUnlockedPolygons:"固定這堵牆上所有非固定的多邊形",UnlockAllLockedPolygons:"解除這堵牆上所有的多邊形固定",RemoveAllUnlockedPolygons:"刪除這堵牆上所有非固定的多邊形",DoYouReallyWantToRemoveAllPolygonsOnThisWall:"你確定刪除這堵牆上所有非固定的多邊形嗎",WallStructure:"牆結構",DefaultStructure:"默認",StudStructure:"牆柱",PillarStructure:"圓柱",Opacity:"遮光度",StructureSpacing:"結構間距",StructureWidth:"結構寬度",StructureThickness:"結構厚度",StructureColor:"結構颜色",Color:"牆体颜色",Height:"高度",Thickness:"厚度",Texture:"材質",AllLightsOnWallInside:"所有電燈在牆內",AllLightsOnWallOutside:"所有電燈在牆外",Fill:"填充",Full:"全部",Partial:"部分",Empty:"空白",OpenToOutside:"對外面開放",EavesLength:"屋簷延伸長度",Parapet:"女牆",ParapetColor:"女牆颜色",ParapetTexture:"女牆材質",ParapetHeight:"女牆高度",CopingsHeight:"頂蓋高度",CopingsWidth:"頂蓋寬度"},windowMenu:{OnlyThisWindow:"只這個窗戶",AllWindowsOnSurface:"同一表面上所有的窗戶",AllWindowsAboveFoundation:"同一地基上所有的窗戶",AllSelectedWindows:"所有選中的窗户",AllWindows:"所有的窗戶",Width:"寬度",Height:"高度",Setback:"離牆體外表面的距離",RelativeToWallThickness:"相對於牆的厚度",Mullion:"直櫺",HorizontalMullion:"水平的直櫺",VerticalMullion:"豎直的直櫺",MullionWidth:"直櫺寬度",HorizontalMullionSpacing:"水平直櫺的間距",VerticalMullionSpacing:"豎直直櫺的間距",MullionColor:"直櫺颜色",Tint:"著色",Opacity:"不透明度",SolarHeatGainCoefficient:"太陽輻射熱獲取係數(SHGC) = 1 - 不透明度",Shutter:"百葉窗",LeftShutter:"左側百葉窗",RightShutter:"右側百葉窗",BothShutters:"兩側百葉窗",ShutterWidth:"相對寬度",ShutterColor:"百葉窗顏色",Frame:"邊框",FrameWidth:"邊框寬度",SillWidth:"窗台寬度",Color:"邊框顔色",WindowType:"窗戶種類",Default:"默認",Arched:"拱形",Polygonal:"多邊形",Interior:"内窗",Empty:"空白"},roofMenu:{TextureDefault:"默認材質",Texture01:"一號材質",Texture02:"二號材質",Texture03:"三號材質",Texture04:"四號材質",Texture05:"五號材質",Texture06:"六號材質",Texture07:"七號材質",OnlyThisRoof:"只這個屋顶",AllRoofsAboveFoundation:"同一地基上所有的屋顶",AllSelectedRoofs:"所有選中的屋顶",AllRoofs:"所有的屋顶",OnlyThisCeiling:"只這個天花板",AllCeilingsAboveFoundation:"同一地基上所有的天花板",AllCeilings:"所有的天花板",EavesOverhangLength:"屋簷延伸長度",RafterSpacing:"屋椽間距",RafterWidth:"屋椽寬度",RafterThickness:"屋椽厚度",RafterColor:"屋椽颜色",RoofColor:"屋顶颜色",RoofSideColor:"屋顶側面颜色",GlassTint:"玻璃顏色",Opacity:"遮光度",RoofStructure:"屋頂結構",DefaultStructure:"默認",RafterStructure:"屋椽",GlassStructure:"玻璃",SolarPanels:"光伏板",LockAllUnlockedSolarPanels:"固定所有非固定的光伏板",UnlockAllLockedSolarPanels:"解除所有的光伏板固定",RemoveAllUnlockedSolarPanels:"刪除這個屋顶上所有非固定的光伏板",DoYouReallyWantToRemoveAllSolarPanelsOnThisRoof:"你確定刪除這個屋顶上所有非固定的光伏板嗎",Windows:"天窗",LockAllUnlockedWindows:"固定所有非固定的天窗",UnlockAllLockedWindows:"解除所有的天窗固定",RemoveAllUnlockedWindows:"刪除這個屋顶上所有非固定的天窗",DoYouReallyWantToRemoveAllWindowsOnThisRoof:"你確定刪除這個屋顶上所有非固定的天窗嗎",Sensors:"傳感器",LockAllUnlockedSensors:"固定所有非固定的傳感器",UnlockAllLockedSensors:"解除所有的傳感器固定",RemoveAllUnlockedSensors:"刪除這個屋顶上所有非固定的傳感器",DoYouReallyWantToRemoveAllSensorsOnThisRoof:"你確定刪除這個屋顶上所有非固定的傳感器嗎",Lights:"電燈",RemoveAllUnlockedLights:"刪除這個屋顶上所有非固定的電燈",DoYouReallyWantToRemoveAllLightsOnThisRoof:"你確定刪除這個屋顶上所有非固定的電燈嗎",AllLightsOnRoofInside:"所有電燈在屋頂內",AllLightsOnRoofOutside:"所有電燈在屋頂外",Rise:"相對高度",Ceiling:"天花板",RoofRValue:"屋顶R值",CeilingRValue:"天花板R值"},doorMenu:{TextureDefault:"默認材質",Texture01:"一號材質",Texture02:"二號材質",Texture03:"三號材質",Texture04:"四號材質",Texture05:"五號材質",Texture06:"六號材質",Texture07:"七號材質",Texture08:"八號材質",Texture09:"九號材質",Texture10:"十號材質",Texture11:"十一號材質",Texture12:"十二號材質",Texture13:"十三號材質",Texture14:"十四號材質",Texture15:"十五號材質",Texture16:"十六號材質",Texture17:"十七號材質",OnlyThisDoor:"只這個門",AllDoorsOnWall:"同一面牆上所有的門",AllDoorsAboveFoundation:"同一地基上所有的門",AllSelectedDoors:"所有選中的门",AllDoors:"所有的門",DoorType:"門種類",Default:"默認",Arched:"拱形",Filled:"填充",FrameColor:"門框顏色",Interior:"內門"},siteInfoPanel:{High:"最高溫度",Low:"最低温度"},designInfoPanel:{NumberOfSelectedHeliostats:"選中的定日鏡總數",NumberOfSelectedSolarPanels:"選中的光伏板總數",ElectricityGeneratedDailyBySolarPanels:"這些光伏板的日發電量",SceneDiameter:"場景直徑",BuildingArea:"建築面積"},visualizationControlPanel:{ColorContrast:"熱圖顏色對比度",FluxScale:"熱通量長度",ClickUpOrDownArrowButtonsToChange:"點擊上下箭頭改變參數"},instructionPanel:{Rotate:"旋轉",DragMouse:"拖動滑鼠",Zoom:"缩放",MouseWheelOrKeys:"滑鼠滾輪或者Ctrl+[和Ctrl+]",MouseWheelOrKeysMac:"滑鼠滾輪或者⌘+[和⌘+]",Pan:"平移",HoldCtrlDragMouse:"按下Ctrl鍵並拖動滑鼠",HoldMetaDragMouse:"按下⌘鍵並拖動滑鼠",Enter2DMode:"進入二維模式",Exit2DMode:"退出二維模式",NavigationMode:"導航模式",EnableNavigation:"進入導航模式",DisableNavigation:"退出導航模式",MoveForwardBack:"前後移動",MoveForwardBackInstruction:"按W/S鍵",MoveLeftRight:"左右移動",MoveLeftRightInstruction:"按A/D鍵",MoveUpDown:"上下移動",MoveUpDownInstruction:"按Z/X鍵",Turn:"拐彎",TurnInstruction:"按方向鍵",ResetView:"重置視角",AutoRotate:"自動旋轉",StartOrStop:"按F4鍵啟動或停止"},mapPanel:{ImageOnGround:"地面顯示圖像",HideAddress:"隱藏地址",WeatherStations:"氣象站",WeatherStationsNote:"關閉此選項以提高地圖速度",Coordinates:"經緯度坐標",Zoom:"放大程度"},visibilityPanel:{SolarPanelVisibility:"光伏板對觀察者的可見度",Observer:"觀察者",VantagePoint:"觀察位置",ItemizedVisibilityByFields:"每個場的可見度",TotalVisibility:"總可見度"},sensorPanel:{LightSensor:"光傳感器",WeatherDataFrom:"氣象數據來自"},buildingEnergyPanel:{DailyBuildingEnergy:"建築物日能耗",YearlyBuildingEnergy:"建築物年能耗",Heater:"暖氣",AC:"空調",SolarPanel:"光伏",Net:"淨能耗"},solarPanelYieldPanel:{SolarPanelDailyYield:"光伏日發電量",SolarPanelYearlyYield:"光伏年發電量",Yield:"發電量",YieldPerHour:"每小時發電量",DailyTotal:"日發電總量",YearlyTotal:"年發電總量",ShowOutputsOfIndividualSolarPanels:"顯示每行光伏板單獨發電量",Profit:"利潤",TotalCost:"總成本",TotalRevenue:"總收入",TotalYield:"總發電量",MeanYield:"平均發電量",ModuleCount:"光伏板總數"},parabolicTroughYieldPanel:{ParabolicTroughDailyYield:"拋物線槽日發電量",ParabolicTroughYearlyYield:"拋物線槽年發電量",Yield:"發電量",YieldPerHour:"每小時發電量",DailyTotal:"日發電總量",YearlyTotal:"年發電總量",ShowOutputsOfIndividualParabolicTroughs:"顯示每行拋物線槽單獨發電量"},parabolicDishYieldPanel:{ParabolicDishDailyYield:"拋物線碟日發電量",ParabolicDishYearlyYield:"拋物線碟年發電量",Yield:"發電量",YieldPerHour:"每小時發電量",DailyTotal:"日發電總量",YearlyTotal:"年發電總量",ShowOutputsOfIndividualParabolicDishes:"顯示每個拋物線碟單獨發電量"},fresnelReflectorYieldPanel:{FresnelReflectorDailyYield:"菲涅耳反射鏡日發電量",FresnelReflectorYearlyYield:"菲涅耳反射鏡年發電量",Yield:"發電量",YieldPerHour:"每小時發電量",DailyTotal:"日發電總量",YearlyTotal:"年發電總量",ShowOutputsOfIndividualFresnelReflectors:"顯示每個菲涅耳反射鏡單獨發電量"},heliostatYieldPanel:{HeliostatDailyYield:"定日鏡日發電量",HeliostatYearlyYield:"定日鏡年發電量",Yield:"發電量",YieldPerHour:"每小時發電量",DailyTotal:"日發電總量",YearlyTotal:"年發電總量",ShowOutputsOfIndividualHeliostats:"顯示每個定日鏡單獨發電量"},updraftTowerYieldPanel:{UpdraftTowerDailyYield:"太陽能上升氣流塔日發電量",UpdraftTowerYearlyYield:"太陽能上升氣流塔年發電量",ChimneyAirTemperature:"煙囪空氣溫度",ChimneyWindSpeed:"煙囪風速",Yield:"發電量",YieldPerHour:"每小時發電量",DailyTotal:"日發電總量",YearlyTotal:"年發電總量",ShowOutputsOfIndividualUpdraftTowers:"顯示每個太陽能上升氣流塔單獨發電量"},heliodonPanel:{SunAndTimeSettings:"太陽和時間設置",SunAngles:"角度",TwentyFourHours:"24小時"},cloudFilePanel:{CopyTitle:"拷貝標題",TitleCopiedToClipBoard:"標題拷貝到剪貼板",SearchByTitle:"按標題搜索",MyLikes:"我喜歡的模型",MyCloudFiles:"我的雲文件",GenerateLink:"生成鏈接",LinkGeneratedInClipBoard:"鏈接生成到剪貼板",DoYouReallyWantToDelete:"您確定刪除此文檔",IfSharedOrPublishedRenamingFileBreaksExistingLinks:"如果此文檔已被分享或發布, 改名會使已有鏈接失效"},projectListPanel:{CopyTitle:"拷貝標題",TitleCopiedToClipBoard:"標題拷貝到剪貼板",SearchByTitle:"按標題搜索",MyProjects:"我的專案",GenerateProjectLink:"生成專案鏈接",ProjectLinkGeneratedInClipBoard:"專案鏈接生成到剪貼板",DoYouReallyWantToDeleteProject:"您確定刪除專案",IfSharedOrPublishedRenamingProjectBreaksExistingLinks:"如果此專案已被分享或發布, 改名會使已有鏈接失效"},projectPanel:{ProjectSettings:"專案設定",ThumbnailImageSize:"縮略圖大小",ProjectByOtherPeople:"別人的專案",Project:"專案",ProjectType:"類别",ProjectDescription:"描述",MakeDescriptionEditable:"編輯描述",MakeDescriptionNonEditable:"不編輯描述",DoubleClickToMakeDescriptionEditable:"雙擊此描述激活編輯功能",SolarPanelArray:"光伏板陣列設計",CurateCurrentDesign:"收藏當前設計",UpdateSelectedDesign:"更新選中設計",RemoveSelectedDesign:"刪除選中設計",ClickToFlipSortingOrder:"點擊逆轉排序方向",DesignNotShownInSolutionSpaceClickToShow:"此設計目前不顯示在設計空間內,點擊顯示",DesignShownInSolutionSpaceClickToHide:"此設計目前顯示在設計空間內,點擊隱藏",SolutionSpace:"設計空間",ChooseSolutionSpace:"選擇設計空間",ChooseDataColoring:"選擇數據著色",SameColorForAllDesigns:"所有設計一個顏色",OneColorForEachDesign:"每個設計一個顏色",SolutionSpaceScreenshot:"設計空間截屏",ScatterPlotScreenshot:"散點圖截屏",SingleClickToSelectDoubleClickToOpen:"單擊選擇,雙擊打開。",SingleClickToDeselectDoubleClickToOpen:"單擊取消選擇,雙擊打開。",GenerateScatterPlot:"生成散點圖",SelectXAxis:"選擇X軸",SelectYAxis:"選擇Y軸"},accountSettingsPanel:{MyAccountSettings:"我的賬戶設定",MyID:"我的🆔",ClickToCopyMyID:"點擊此處拷貝我的ID",IDInClipBoard:"您現在可以粘貼ID了。",StoreMyNameInMyFilesWhenSaving:"保存文檔時籤上我的大名",DoYouReallyWantToShowYourNameInYourFiles:"您確定在您的文檔裡保存您的大名嗎?",SignFileDisclaimer:"如果您選擇保存,您的大名可能被所有打開您的文檔的人看到。",Likes:"點贊總數",AllPublished:"發佈總數",PublishedUnderAliases:"别名發佈",UserCount:"用戶總數",SchoolID:"學校編號",ClassID:"班級編號"},weatherPanel:{SunshineHours:"日照時間"},diurnalTemperaturePanel:{SelectAirTemperatureModel:"選擇氣溫模型",Sinusoidal:"正弦函數"},economicsPanel:{EconomicsParameters:"經濟學參數",ElectricitySellingPrice:"銷售電價",OperationalCostPerUnit:"單位運行成本",SellingPrice:"銷售電價",UnitCost:"單位成本"},navigationPanel:{NavigationParameters:"導航模式參數",MinimumMoveSpeed:"最小移動速度",MinimumTurnSpeed:"最小拐彎速度"},shadowSettingsPanel:{ShadowSettings:"陰影設定",ShadowCameraFarDistance:"最遠距離",ShadowMapSize:"映射圖長寬",Notes:"注意事項",RefreshPageNote:"改變設定後須刷新頁面。",MapSizeWarning:"大的映射圖長寬可能導致阿拉丁無法在某些電腦上運作。"},yearlyLightSensorPanel:{SkyClearness:"天空清晰度",ShowDaylightResults:"顯示日照時間結果",ShowSkyClearnessResults:"顯示天空清晰度結果",ShowAverageDailySolarRadiation:"顯示日平均輻射結果"},analysisManager:{NoSensorForCollectingData:"沒有傳感器收集數據。",NoSolarPanelForAnalysis:"沒有光伏板可以分析。",NoObserverForVisibilityAnalysis:"沒有找到可見度分析的觀察者。",NoWaterHeaterForAnalysis:"沒有太陽能熱水器可以分析。",NoParabolicDishForAnalysis:"沒有拋物線碟可以分析。",NoParabolicTroughForAnalysis:"沒有拋物線槽可以分析。",NoFresnelReflectorForAnalysis:"沒有菲涅耳反射鏡可以分析。",NoHeliostatForAnalysis:"沒有定日鏡可以分析。",NoSolarUpdraftTowerForAnalysis:"沒有太陽能上升氣流塔可以分析。",NoBuildingForAnalysis:"沒有建築物可以分析。"},toolbar:{CloudFile:"雲文檔",Select:"選擇",AddFoundation:"添加地基",AddWall:"添加牆體",AddWindow:"添加窗戶",AddDoor:"添加門",AddPyramidRoof:"添加金字塔屋頂",AddGableRoof:"添加雙坡屋頂",AddHipRoof:"添加四坡屋顶",AddGambrelRoof:"添加复斜屋顶",AddMansardRoof:"添加折線屋顶",AddCuboid:"添加長方體",AddSensor:"添加傳感器",AddSolarPanel:"添加光伏板",AddWaterHeater:"添加太陽能熱水器",AddPowerWall:"添加電源墻",AddParabolicDish:"添加拋物線碟",AddParabolicTrough:"添加拋物線槽",AddFresnelReflector:"添加菲涅耳反射鏡",AddHeliostat:"添加定日鏡",AddWindTurbine:"添加水平轴風力渦輪機",AddVerticalAxisWindTurbine:"添加垂直軸風力渦輪機",AddLight:"添加電燈",AddTree:"添加樹木",AddFlower:"添加花草",AddPeople:"添加人物",DoubleClickToLockThisModeForNextAction:"雙擊按鈕給下個動作鎖定此模式",ClickToUnlockThisModeForNextAction:"點擊按鈕讓動作完成即離開此模式",ManipulateGroup:"整體操作一個組",ClearScene:"清空場景",ShowSunAndTimeSettings:"顯示太陽和時間設置",SpatialAnalysisOfEnergy:"能量的空間分析",DoYouReallyWantToClearContent:"您確定清空場景嗎",ClickForMoreButtons:"點擊此處切換到更多的按鈕模式"},tooltip:{gotoIFI:"訪問未來智能研究所",visitAladdinHomePage:"訪問阿拉丁主頁",clickToOpenMenu:"點擊打開主菜單",clickToAccessAccountSettings:"點擊打開賬號設定"},tree:{Apple:"蘋果樹",Birch:"白樺",Coconut:"椰子樹",Dogwood:"茱萸",Elm:"榆樹",FanPalm:"扇葉棕櫚",Linden:"菩提",Magnolia:"玉蘭",Maple:"楓樹",Oak:"橡樹",Pine:"松樹",Spruce:"雲杉"},flower:{Bellflower:"鈴蘭",Boxwood:"黃楊",CactusCombo1:"仙人掌組合一",CactusCombo2:"仙人掌組合二",CactusCombo3:"仙人掌組合三",CactusCombo4:"仙人掌組合四",Hibiscus:"木槿",Hosta:"玉簪",Hydrangea:"繡球花",Peony:"牡丹",RedRose:"紅玫瑰",Spirea:"繡線菊",Sunflower:"向日葵",TallBush:"高灌木",Tulip:"鬱金香",WhiteFlower:"白花",YellowFlower:"黄花"},people:{Jaah:"賈阿",Jack:"傑克",Jacob:"雅各布",Jacqueline:"杰奎琳",Jade:"美玉",Jamelia:"潔米莉雅",James:"詹姆斯",Jane:"簡",Jaya:"佳婭",Jaye:"傑伊",Jeanette:"珍妮特",Jedi:"傑迪",Jeff:"傑夫",Jena:"珍娜",Jennifer:"珍尼弗",Jess:"傑西",Jett:"傑特",Jill:"吉爾",Jiya:"吉娅",Joan:"瓊",Jocelyn:"喬斯林",Joel:"喬爾",Joey:"喬伊",John:"約翰",Jonathon:"喬納森",Jose:"何塞",Joseph:"約瑟夫",Joshua:"約書亞",Judd:"賈德",Judy:"朱蒂",Julia:"朱莉婭",Julio:"胡里奥",Jumapili:"祖瑪匹莉",June:"準衛",Juro:"朱諾",Justin:"賈斯汀"},compass:{N:"北",S:"南",W:"西",E:"東"},month:{January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月"},modelsMap:{SearchByPublisher:"按發布者搜索",SearchByLabel:"按標籤搜索",MyPublishedModels:"我發布的模型",TotalNumberOfUserPublishedModels:"用戶發布的模型總數",SortFromOldestToNewest:"從早到晚排序",SortFromNewestToOldest:"從晚到早排序",ModelsFoundOnThisSite:"個模型在此位置",ShowModelsPublishedByThisAuthor:"展示此用戶發布的模型"}}},dpt={translation:{name:{IFI:"Instituto de inteligencia futura",Aladdin:"Aladdin",Tagline:"Aladdin: Reimagining Design with Explainable AI — Institute for Future Intelligence"},cookie:{Statement:"Clicando Aceptar, autoriza el uso de cookies para mejora la experiencia con Aladdin",Accept:"Aceptar"},aboutUs:{ProductBroughtToYouBy:"Este producto esta hecho por",TermsOfService:"Términos de servicio",PrivacyPolicy:"Política de privacidad",Software:"Programa",Content:"Contenido",Research:"Investigación",Support:"Ayuda",Acknowledgment:"Agradecimientos",FundingInformation:"La National Science Foundation (NSF) proporcionó generosamente fondos para la investigación y el desarrollo de este producto a través de las subvenciones con número #2105695, #2131097, y #2301164. Sin embargo, todas las opiniones, hallazgos y conclusiones o recomendaciones expresados en este producto pertenecen a los autores y no reflejan necesariamente los puntos de vista de la NSF.",Contact:"Para más información, por favor contacte con Charles Xie (charles@intofuture.org).",Translators:"Translators"},word:{Refresh:"Refresh",LastUpdate:"Last Update",Small:"Small",Medium:"Medium",Large:"Large",Design:"Design",Information:"Information",Type:"Type",Text:"Text",FontSize:"Font Size",FontColor:"Font Color",Model:"Model",Models:"Models",Upload:"Upload",ClickCount:"Click Count",Share:"Share",AlreadyLike:"Already like",Like:"Like",MustLogInToLike:"Must log in to like",AllRightsReserved:"Todos los derechos reservados",MeterAbbreviation:"m",Version:"Versión",VersionInitial:"V",Options:"Opciones",Maximum:"Maximum",Minimum:"Minimum",MaximumNumber:"Número máximo",MinimumNumber:"Minimum Number",MaximumValue:"Maximum Value",MinimumValue:"Minimum Value",Or:"O",None:"Ninguno",High:"High",Partial:"Partial",Teacher:"Profesor",Class:"Clase",Total:"Total",Leaderboard:"Leaderboard",Latest:"Latest",Range:"Rango",SIUnit:"SI Unit",USUnit:"US Unit",ThermalTransmittance:"Thermal Transmittance",ThermalResistance:"Thermal Resistance",UValue:"U-Value",RValue:"R-Value",VolumetricHeatCapacity:"Volumetric Heat Capacity",BuildingHVACSystem:"Building HVAC System",ThermostatSetpoint:"Thermostat Setpoint",TemperatureToleranceThreshold:"Tolerance Threshold",TemperatureToleranceThresholdExplanation:`Heater will not run if the lowest outside temperature of the day is higher than the setpoint minus this threshold. AC will not run if the highest outside temperature of the day is lower than the setpoint plus this threshold.`,Press:"Press",Open:"Abrir",Save:"Guardar",SaveAsImage:"Guardar como imagen",SaveAsCsv:"Save as CSV",Update:"Actualizar",Paste:"Pegar",Copy:"Copiar",Cut:"Cortar",Delete:"Eliminar",Lock:"Cerrar con llave",Translucent:"Translucent",Transparency:"Transparency",Color:"Color",Pattern:"Pattern",Texture:"Textura",Size:"Tamaño",Thickness:"Grosor",Yes:"Sí",No:"No",OK:"OK",Cancel:"Cancelar",Apply:"Aplicar",Close:"Cerrar",ApplyTo:"Aplicar a",Run:"Run",Pause:"Pause",Resume:"Resume",Clear:"Limpiar",Warning:"Aviso",Caution:"Caution",Reminder:"Reminder",Length:"Longitud",Width:"Ancho",Height:"Altura",Radius:"Radius",Angle:"Ángulo",Azimuth:"Azimut",Coordinates:"Coordinates",Weather:"Tiempo",Show:"Mostrar",Animate:"Animar",Date:"Fecha",Time:"Tiempo",Title:"Título",Owner:"Propietario",Action:"Acción",Rename:"Renombrar",Location:"Location",Latitude:"Latitud",Month:"Mes",Day:"Día",Hour:"Hora",Daylight:"Luz solar",Radiation:"Radiación",Temperature:"Temperatura",kWh:"kWh",dollar:"dollar",MeterPerSecond:"m/s",NorthInitial:"N",SouthInitial:"S",EastInitial:"E",WestInitial:"O",Fixed:"Fixed",Elements:"Elements",Energy:"Energy",Unknown:"Unknown",Label:"Label",Description:"Description",NoDescription:"No description",MaximumCharacters:"Maximum characters",Author:"Author",Publisher:"Publisher",Building:"Building",ResidentialBuilding:"Residential Building",CommercialBuilding:"Commercial Building",SchoolBuilding:"School Building",TouristAttraction:"Tourist Attraction",UnderConstruction:"Under Construction",Photovoltaic:"Photovoltaic",WindPower:"Wind Power",ColocationProjects:"Colocation Projects",Anonymous:"Anonymous",Nickname:"Nickname",Pin:"Pin",Unpin:"Unpin"},shared:{NoTexture:"Sin textura",FoundationElement:"Bases",CuboidElement:"Cuboide",PolygonElement:"Polígon",SensorElement:"Sensor",SolarPanelElement:"Panel solar",WaterHeaterElement:"Water Heater",ParabolicDishElement:"Parabolic Dish",ParabolicTroughElement:"Parabolic Trough",FresnelReflectorElement:"Fresnel Reflector",HeliostatElement:"Heliostat",WindTurbineElement:"Wind Turbine",LightElement:"Light",ElementLocked:"Bloqueado",ModelType:"Model Type",OutputBreakdown:"Breakdown",MoreResults:"More Results"},message:{NewVersionAvailable:"A new version is available",CalculationMayBeSlowDoYouWantToContinue:"Calculation may be slow. Do you want to continue?",IncreaseSolarRadiationHeatmapGridCellSizeToSpeedUp:"Increase solar radiation heatmap grid cell size to speed up",ModelNotFound:"Model not found",CannotSignIn:"Cannot sign in",CannotSignOut:"Cannot sign out",YourAccountWasCreated:"Your account was created.",CannotCreateAccount:"Cannot create an account",YourAccountSettingsWereSaved:"Your account settings were saved.",CannotSaveYourAccountSettings:"Cannot save your account settings",CannotSaveYourFileToCloud:"Cannot save your file to the cloud",CannotCreateNewProject:"Cannot create a new project",CannotCreateNewProjectWithoutTitle:"Cannot create a new project without a title",CannotOpenYourProjects:"Cannot open your projects",CannotOpenProject:"Cannot open the project",CannotDeleteProject:"Cannot delete the project",CannotRenameProject:"Cannot rename the project",CannotAddDesignToProject:"Cannot add this design to the project",CannotAddDesignToProjectOwnedByOthers:"Cannot add this design to a project owned by others",DesignRemovedFromProject:"The design was successfully removed from the project",CannotRemoveDesignFromProject:"Cannot remove this design from the project",CannotUpdateProject:"Cannot update the project",CannotFetchProjectData:"Cannot fetch project data",TitleUsedChooseDifferentOne:"This title has been used. Choose a different one",CloudFileWithTitleExistsDoYouWantToOverwrite:"A cloud file with the title exists. Do you want to overwrite it?",CloudFileNotFound:"The cloud file was not found",CannotLoadModelsOnMap:"Cannot load models on map",CannotLoadLeaderboard:"Cannot load leaderboard",CannotPublishModelOnMap:"Cannot publish model on map",CannotLikeModelFromMap:"Cannot like model from map",CannotDeleteModelFromMap:"Cannot delete model from map",ModelDeletedFromMap:"Model is deleted from map",DoYouWantToDeleteModelFromMap:"Do you want to delete the model from map?",CannotOpenCloudFile:"Cannot open the cloud file",CannotReadCloudFile:"Cannot read the cloud file",CannotWriteCloudFile:"Cannot write the cloud file",CloudFileCopied:"Cloud file copied",CannotOpenCloudFolder:"Cannot open your cloud folder",CannotDeleteCloudFile:"Cannot delete the cloud file",CannotRenameCloudFile:"Cannot rename the cloud file",DoYouWantToSaveChanges:"¿Quieres guardar los cambios?",NotApplicableToSelectedAction:"No se aplica a la acción seleccionada",ThisElementIsLocked:"Este elemento está bloqueado",ThisCannotBeUndone:"Esto no se puede deshacer",AzimuthOfNorthIsZero:"Azimut del norte es 0°",CounterclockwiseAzimuthIsPositive:"Hacia la izquierda es positivo",SouthFacingIsZero:"South-facing is 0°",ClockwiseRotationIsPositive:"Clockwise is positive",MoveCancelledBecauseOfOverlap:"Move cancelled because of overlap.",MoveOutsideBoundaryCancelled:"Move outside the boundary cancelled.",RotationCancelledBecauseOfOverlap:"Rotation cancelled because of overlap.",RotationOutsideBoundaryCancelled:"Rotation outside the boundary cancelled.",ResizingCancelledBecauseOfOverlap:"Resizing cancelled because of overlap.",ResizingOutsideBoundaryCancelled:"Resizing outside the boundary cancelled.",CannotPasteOutsideBoundary:"Cannot paste outside this surface.",CannotPasteBecauseOfOverlap:"Cannot paste because of overlap.",CannotMoveObjectTooFar:"Cannot move object too far.",ExistingSolarPanelsWillBeRemovedBeforeApplyingNewLayout:"Existing solar panels will be removed before applying the new layout.",DoYouWantToContinue:"Do you want to continue?",SolarPanelsCannotIntersectWithGround:"Solar panels cannot intersect with the ground.",SolarPanelsCannotOverlapWithOneAnother:"Solar panels cannot overlap with one another.",ScreenshotSaved:"A screenshot was saved.",CsvFileSaved:"A CSV file was saved.",SimulationStarted:"Simulation started.",SimulationCompleted:"Simulation completed.",SimulationAborted:"Simulation aborted.",SimulationPaused:"Simulation paused.",CancelSimulation:"Cancel simulation",PauseSimulation:"Pause simulation",ResumeSimulation:"Resume simulation",SimulationWillNotStartDueToErrors:"Simulation will not start due to errors",SimulationWillStartDespiteWarnings:"Simulation will start despite warnings.",EvolutionStarted:"Evolution started.",EvolutionCompleted:"Evolution completed.",EvolutionAborted:"Evolution aborted.",EvolutionPaused:"Evolution paused.",EncounterEvolutionError:"Encountered an evolution error.",CancelEvolution:"Cancel evolution",PauseEvolution:"Pause evolution",ResumeEvolution:"Resume evolution",ConvergenceThresholdHasBeenReached:"The convergence threshold has been reached.",MaximumNumberOfGenerationsHasBeenReached:"The maximum number of generations has been reached.",MaximumNumberOfStepsHasBeenReached:"The maximum number of steps has been reached.",ObjectiveFunctionTypeError:"The current objective function is not supported by this operation. Please start from the menu.",WallsAreNotAtSameHeight:"Walls are not at the same height.",WallsAreNotPerpendicular:"Walls are not perpendicular.",WallsAreNotConnected:"Walls are not connected.",WallsNumberNeedToBeFour:"The number of walls needs to be four.",BuildingContainsEmptyWall:"Building contains one or more empty wall.",BuildingRoofMissing:"Building has a missing roof.",UnknownErrors:"Unknown errors."},menu:{AnalysisOptions:"Analysis Options",option:{GridCellSize:"Grid Cell Size",SamplingFrequency:"Frecuencia de muestreo",TimesPerHour:"Veces per hora",DaysPerYear:"Days per Year"},mainMenu:"Menu principal",cloudMenu:"Menú en la nube",projectSubMenu:"Project",project:{CreateNewProject:"Create New Project",OpenProject:"Open Project",SaveProject:"Save Project",SaveProjectAs:"Save Project As",YouMustLogInToCreateProject:"You must log in to create a new project",YouMustLogInToOpenProject:"You must log in to open a project"},fileSubMenu:"Archivo",file:{CreateNewFile:"Crear nuevo archivo",OpenLocalFile:"Abrir archivo local",SaveAsLocalFile:"Guardar como archivo local",SavingAbortedMustHaveValidFileName:"!Error guardando! Debes tener un nombre de archivo válido",OpenCloudFile:"Abrir archivo en la nube",SaveCloudFile:"Guardar archivo en la nube",SaveAsCloudFile:"Guardar como archivo en la nube",SavingAbortedMustHaveValidTitle:"!Error guardando! Debes tener un título válido para el archivo en la nube",ToSaveYourWorkPleaseSignIn:"Para guardar tu trabajo, por favor regístrese.",TakeScreenshot:"Hacer captura de pantalla",UseCloudFileName:"Use Cloud File Name",PublishOnModelsMap:"Publish on Models Map",PublishedOnModelsMap:"Your model has been published on the Models Map",UpdatedOnModelsMap:"Your model has been updated on the Models Map",YouMustLogInToPublishYourModel:"You must log in to publish your model",YouCannotPublishAModelThatYouDoNotOwn:"You cannot publish a model that you do not own",YouMustSaveModelOnCloudBeforePublishingIt:"You must save the model on the cloud before publishing it"},editSubMenu:"Editar",edit:{Undo:"Deshacer",Redo:"Repetir"},viewSubMenu:"Vista",view:{NavigationView:"Navigation View",TwoDimensionalView:"Vista 2D",ResetView:"Resetear",ZoomIn:"Acercar",ZoomOut:"Alejar",AutoRotate:"Auto rotación",ShowShadow:"Mostrar sombra",ShowSurfaceShininess:"Show Surface Shininess",TranslucentFloatingWindows:"Translucent Floating Windows",accessoriesSubMenu:"Accessories",accessories:{SiteInformation:"Información del sitio",DesignInformation:"Información de diseño",Instruction:"Instrucción",StickyNote:"Nota adhesiva",Note:"Nota"}},settingsSubMenu:"Settings",settings:{WeatherData:"Datos del tiempo",DiurnalTemperature:"Diurnal Temperature",Heliodon:"Heliodon",SunAndTime:"Sun & Time"},benchmarksSubMenu:"Benchmarks",benchmarks:{SolarRadiationPredictionVsMeasurement:"Solar Radiation Prediction vs. Measurement",BESTESTCase600:"Building Energy Simulation Test: BESTEST Case 600",BESTESTCase610:"Building Energy Simulation Test: BESTEST Case 610",BESTESTCase620:"Building Energy Simulation Test: BESTEST Case 620",BESTESTCase630:"Building Energy Simulation Test: BESTEST Case 630"},graph:{LineWidth:"Line Width",SymbolSize:"Symbol Size",BarCategoryGap:"Bar Category Gap",ShowHorizontalGridLines:"Show Horizontal Grid Lines",ShowVerticalGridLines:"Show Vertical Grid Lines"},analysisSubMenu:"Análisis",physicsSubMenu:"Physics",physics:{DailySolarRadiationHeatmap:"Daily Solar Radiation Heatmap",SolarRadiationHeatmapOptions:"Solar Radiation Heatmap Options",SolarRadiationHeatmapGridCellSize:"Solar Radiation Heatmap Grid Cell Size",SolarRadiationHeatmapMaxValue:"Solar Radiation Heatmap Maximum Value",SolarRadiationHeatmapNoAnimation:"No Animation for Static Model",ReflectionHeatmap:"Reflection Heatmap"},sensorSubMenu:"Sensores",sensor:{CollectDailyData:"Recoger datos diarios",CollectYearlyData:"Recoger datos anuales",SensorSimulationNoAnimation:"No Animation for Collecting Sensor Data"},buildingSubMenu:"Building",building:{AnalyzeDailyBuildingEnergy:"Analyze Daily Building Energy",AnalyzeYearlyBuildingEnergy:"Analyze Yearly Building Energy",EnergyAnalysisOptions:"Energy Analysis Options",EnergyGridCellSize:"Energy Grid Cell Size",BuildingEnergySimulationNoAnimation:"No Animation for Building Energy Simulation"},solarPanelSubMenu:"Paneles solares",solarPanel:{AnalyzeDailyYield:"Analizar el rendimiento diario",AnalyzeYearlyYield:"Analizar el rendimiento anual",AnalyzeVisibility:"Analyze Visibility",PanelDiscretization:"Discretización del panel",Exact:"Exacto",Approximate:"Aproximado",EnergyGridCellSize:"Energy Grid Cell Size",VisibilityGridCellSize:"View Factor Grid Cell Size",EnergyAnalysisOptions:"Energy Analysis Options",VisibilityAnalysisOptions:"Visibility Analysis Options",SolarPanelSimulationNoAnimation:"No Animation for Solar Panel Simulation"},parabolicTroughSubMenu:"Parabolic Trough",parabolicTrough:{AnalyzeDailyYield:"Analyze Daily Yield",AnalyzeYearlyYield:"Analyze Yearly Yield"},parabolicDishSubMenu:"Parabolic Dish",parabolicDish:{AnalyzeDailyYield:"Analyze Daily Yield",AnalyzeYearlyYield:"Analyze Yearly Yield"},fresnelReflectorSubMenu:"Fresnel Reflector",fresnelReflector:{AnalyzeDailyYield:"Analyze Daily Yield",AnalyzeYearlyYield:"Analyze Yearly Yield"},heliostatSubMenu:"Heliostat",heliostat:{AnalyzeDailyYield:"Analyze Daily Yield",AnalyzeYearlyYield:"Analyze Yearly Yield"},solarUpdraftTowerSubMenu:"Solar Updraft Tower",solarUpdraftTower:{AnalyzeDailyYield:"Analyze Daily Yield",AnalyzeYearlyYield:"Analyze Yearly Yield",SolarUpdraftTowerSimulationNoAnimation:"No Animation for Solar Updraft Tower Simulation"},tutorialsSubMenu:"Tutorials",solarEnergyScienceSubMenu:"Solar Science",solarEnergyScienceTutorials:{SunAngles:"Ángulos solares relativos a un observador en el suelo",InsolationAndClimate:"Insolation and Climate",SolarRadiationToBox:"Radiación solar a una caja"},buildingScienceSubMenu:"Building Science",buildingScienceTutorials:{ThermalEnvelopeVsBuildingEnvelope:"Thermal Envelope vs. Building Envelope",EffectOfSizeOnBuildingEnergy:"Effect of Size on Building Energy",EffectOfOrientationOnBuildingEnergy:"Effect of Orientation on Building Energy",EffectOfInsulationOnBuildingEnergy:"Effect of Insulation on Building Energy",EffectOfRoofColorOnBuildingEnergy:"Effect of Roof Color on Building Energy",EffectOfEavesOverhangLengthOnBuildingEnergy:"Effect of Eaves Overhang Length on Building Energy",EffectOfWindowSHGCOnBuildingEnergy:"Effect of Window Solar Heat Gain on Building Energy",EffectOfThermostatSetpointOnBuildingEnergy:"Effect of Thermostat Setpoint on Building Energy",EffectOfSolarPanelsOnBuildingEnergy:"Effect of Solar Panels on Building Energy",EffectOfGroundTemperatureOnBuildingEnergy:"Effect of Ground Temperature on Building Energy",EffectOfTreesOnBuildingEnergy:"Effect of Trees on Building Energy"},buildingDesignSubMenu:"Building Design",buildingDesignTutorials:{CapeCodStyleHouseWithShedDormer:"Cape Cod Style House with Shed Dormer",MansardRoofWithDormers:"Mansard Roof with Dormers",GableRoofVsHipRoof:"Gable Roof vs. Hip Roof",ColonialVsSaltbox:"Colonial vs. Saltbox",GambrelRoofVsMansardRoof:"Gambrel Roof vs. Mansard Roof",CombinationRoofVsBonnetRoof:"Combination Roof vs. Bonnet Roof",DutchGableRoof:"Dutch Gable Roof",GableAndValleyRoof:"Gable and Valley Roof",ClerestoryRoof:"Clerestory Roof",MonitorRoof:"Monitor Roof",AFrameHouse:"A-Frame House",HalfTimberedHouse:"Half-Timbered House",AllBasicRoofTypes:"All Basic Roof Types"},photovoltaicSolarPowerSubMenu:"Photovoltaic Solar Power",photovoltaicSolarPowerTutorials:{EffectOfTiltAngleOfSolarPanel:"Effect of Tilt Angle",EffectOfAzimuthOfSolarPanel:"Effect of Azimuth",SolarPanelTypes:"Solar Panel Types",VerticalBifacialSolarPanels:"Vertical Bifacial Solar Panels",CompareMonofacialAndBifacialSolarPanels:"Monofacial vs. Bifacial Solar Panels",SolarTrackers:"Seguidores solares",CoveringGroundWithSolarPanels:"Why Just Covering the Ground with Solar Panels is not a Good Idea",InterRowSpacingOfSolarPanelArray:"Effect of Inter-Row Spacing in a Solar Panel Array",EffectOfOrientationOfSolarPanels:"Effect of Orientation of Solar Panels",SolarPanelArrayAutomaticLayout:"Solar Panel Array Automatic Layout"},concentratedSolarPowerSubMenu:"Concentrated Solar Power",concentratedSolarPowerTutorials:{EffectOfAzimuthOfParabolicTrough:"Effect of Azimuth of a Parabolic Trough",EffectOfLatusRectumOfParabolicTrough:"Effect of Latus Rectum of a Parabolic Trough",FocusSunlightWithParabolicDish:"Focus Sunlight with a Parabolic Dish",LinearFresnelReflectors:"Linear Fresnel Reflectors",EffectOfAbsorberPipeHeightForLinearFresnelReflectors:"Effect of Absorber Pipe Height for Linear Fresnel Reflectors",EffectOfAzimuthOfLinearFresnelReflectors:"Effect of Azimuth of Linear Fresnel Reflectors",LinearFresnelReflectorsWithTwoAbsorbers:"Linear Fresnel Reflectors with Two Absorbers",CosineEfficiencyOfHeliostats:"Cosine Efficiency of Heliostats",ShadowingAndBlockingOfHeliostats:"Shadowing and Blocking of Heliostats",EffectSolarPowerTowerHeight:"Effect of Solar Power Tower Height",SolarPowerTower:"Solar Power Tower"},otherTypesOfSolarPowerSubMenu:"Other Types of Solar Power",otherTypesOfSolarPowerTutorials:{SolarUpdraftTower:"Solar Updraft Tower"},windPowerSubMenu:"Wind Power",windPowerTutorials:{EffectOfBladeNumberOfWindTurbine:"Effect of Blade Number of Wind Turbine",EffectOfPitchAngleOfWindTurbineBlades:"Effect of Pitch Angle of Wind Turbine Blades",BirdSafeBladeDesign:"Bird-Safe Blade Design",OffshoreWindFarm:"Offshore Wind Farm"},colocationSubMenu:"Colocation",colocationTutorials:{AgricultureSolarWindColocation:"Agriculture-Solar-Wind Colocation"},generativeDesignSubMenu:"Generative Design",generativeDesignTutorials:{MonofacialSolarPanelArrayTiltAngle:"The Tilt Angle of a Monofacial Solar Panel Array",BifacialSolarPanelArrayTiltAngle:"The Tilt Angle of a Bifacial Solar Panel Array",OutputOfSolarPanelArrayInDifferentPlaces:"The Output of a Solar Panel Array in Different Places",SimpleSolarFarmParetoFront:"The Pareto Front for Designing a Simple Solar Farm"},examplesSubMenu:"Ejemplos",solarEnergySubMenu:"Energía Solar",solarEnergyExamples:{SunBeamAndHeliodon:"Rayo de sol y heliodon",RooftopSolarPanels:"Rooftop Solar Panels",NevadaSolarOneParabolicTroughArray:"Nevada Solar One Parabolic Trough Array",TooeleParabolicDishArray:"Tooele Parabolic Dish Array",PS10SolarPowerTower:"PS10 Solar Power Tower",TucsonLinearFresnelReflectors:"Tucson Linear Fresnel Reflectors",SolarCanopyFormFactors:"Solar Canopy Form Factors",SolarCanopyOverBleachers:"Solar Canopy Over Bleachers",SolarCanopyOverGarage:"Solar Canopy Over Garage",SolarBusStop:"Solar Bus Stop",SolarFacadeTesla:"Tesla Solar Façade",BuildingIntegratedPhotovoltaics:"Building-Integrated Photovoltaics",Floatovoltaics:"Floatovoltaics",Agrivoltaics:"Agrivoltaics",VegetativeBuffer:"Vegetative Buffer",RainbowSwashSolarFarmBostonMA:"Rainbow Swash Solar Farm in Boston, MA",MickeyMouseSolarFarmOrlandoFL:"Mickey Mouse Solar Farm in Orlando, FL",SolarPanelsOverCanalBakersfieldCA:"Hypothetical Solar Panels Over Canal in Bakersfield, CA",SolarNoiseBarrierLexingtonMA:"Hypothetical Solar Noise Barrier in Lexington, MA",HSATSolarTrackersRaleighNC:"Horizontal Single Axis Trackers (HSAT) in Raleigh, NC",AADATSolarTrackersLancasterCA:"Azimuth–Altitude Dual Axis Trackers (AADAT) in Lancaster, CA",SolarUpdraftTowerInCity:"Solar Updraft Tower in City"},builtEnvironmentSubMenu:"Built Environment",residentialBuildingsSubMenu:"Residential Buildings",residentialBuildingExamples:{ColonialHouse:"Colonial House",DutchColonialHouse:"Dutch Colonial House",TShapedHouse:"T-Shaped House",CapeCodHouseWithGarage:"Cape Cod House with Garage",Solarium:"Solarium",Church1:"Church 1",Cathedral1:"Cathedral 1",Cathedral2:"Cathedral 2",Mosque1:"Mosque 1",AdobeTaosHouse:"Adobe Taos House",RanchHouse:"Ranch House",BonnetHouse:"Bonnet House",BarnStyleHouse:"Barn Style House",ModernHouse:"Modern House",ButterflyRoofHouse:"Butterfly Roof House"},commercialBuildingsSubMenu:"Commercial Buildings",commercialBuildingExamples:{WhiteHouse:"White House",HaroldWashingtonCollege:"Harold Washington College",BilimMersinTurkiye:"BILIM, Mersin, Turkiye",SpanishStyleHotel:"Spanish Style Hotel",ApartmentBuilding:"Apartment Building",OfficeBuilding:"Edificio de oficinas",Hotel:"Hotel"},buildingComplexesSubMenu:"Building Complexes",buildingComplexExamples:{SouthBurlingtonHighSchoolVermont:"South Burlington High School, VT",MescaleroApacheSchoolNewMexico:"Mescalero Apache School, NM"},urbanPlanningSubMenu:"Urban Planning",urbanPlanningExamples:{CityBlockHeatmap:"City Block Heatmap",ChicagoSkyline:"Chicago Skyline"},otherBuildingsSubMenu:"Other Buildings",otherBuildingExamples:{Greenhouse:"Greenhouse",Pavilion:"Pavilion in a Park",OctagonalPagoda:"Octagonal Pagoda",OceanFront:"Ocean Front",EgyptianPyramids:"Egyptian Pyramids",MayanPyramid:"Mayan Pyramid",SiOSePol:"Si-o-se-pol",StackedCuboids:"Stacked Cuboids"},artificialIntelligenceSubMenu:"Artificial Intelligence",artificialIntelligenceExamples:{OptimizingTiltAngleOfOneSolarPanelRow:"Optimizing the Tilt Angle of a Solar Panel Row",OptimizingTiltAnglesOfMultipleSolarPanelRows:"Optimizing the Tilt Angles of Multiple Solar Panel Rows",SolarFarmGenerativeDesign:"Solar Farm Generative Design",SolarFarmGenerativeDesignWithBlock:"Solar Farm Generative Design in the Presence of a Block",FitchburgSolarFarmGenerativeDesign:"Fitchburg Solar Farm Generative Design"},languageSubMenu:"Idioma",publicSubMenu:"Public",ModelsGallery:"Models Gallery",ModelsMap:"Models Map",AboutUs:"Sobre nosotros"},avatarMenu:{AccountSettings:"Configuraciones de la cuenta",PrivacyStatementTitle:"User Privacy Protection Statement",PrivacyStatement:"When you sign in, your Google ID is used to create and access your Aladdin account. Only a random alphanumeric string is stored in our database as a reference. No personally identifiable data such as your name or email is ever gathered. For more information, see our ",SignIn:"Iniciar sesión",SignOut:"Desconectar",IfYouAreAStudent:"Si eres un estudiante"},skyMenu:{Axes:"Ejes",Theme:"Tema",ThemeDefault:"Por defecto",ThemeDesert:"Desierto",ThemeDune:"Dune",ThemeForest:"Bosque",ThemeGrassland:"Campo",ThemeHill:"Hill",ThemeLake:"Lake",ThemeMountain:"Mountain",ThemeRural:"Rural",SunlightAttenuationCoefficientInAir:"Sunlight Attenuation Coefficient in Air",ConvectiveCoefficientOfAir:"Convective Coefficient of Air",HighestTemperatureTimeInMinutes:"Highest Temperature Time (Minutes)",SelectSunAnglesToShow:"Select Sun Angles to Show",ShowAzimuthAngle:"Show Azimuth Angle",ShowElevationAngle:"Show Elevation Angle",ShowZenithAngle:"Show Zenith Angle",DirectLightBrightnessAtNoon:"Direct Light Brightness at Noon",AmbientLightBrightnessAtNoon:"Ambient Light Brightness at Noon"},groundMenu:{MonthlyIrradianceLoss:"Monthly Irradiance Loss",Vegetation:"Vegetation",LeafOutDay:"Leaf-Out Day",LeafOffDay:"Leaf-Off Day",Albedo:"Albedo",ImageOnGround:"Imagen en el suelo",WaterSurface:"Water Surface",RemoveAllUnlockedTrees:"Eliminar todos los árboles",RemoveAllUnlockedFlowers:"Remove All Unlocked Flowers",RemoveAllUnlockedSolarPanels:"Remove All Unlocked Solar Panels",RemoveAllUnlockedPeople:"Eliminar toda la gente",RemoveAllUnlockedFoundations:"Eliminar todos las bases",RemoveAllUnlockedCuboids:"Eliminar todos los cuboides",DoYouReallyWantToRemoveAllPeople:"Estás seguro que quieres eliminar a toda la gente who are not locked",DoYouReallyWantToRemoveAllTrees:"Estás seguro que quieres eliminar todos los árboles that are not locked",DoYouReallyWantToRemoveAllFlowers:"Do you really want to remove all the flowers that are not locked",DoYouReallyWantToRemoveAllSolarPanels:"Do you really want to remove all the solar panels that are not locked",DoYouReallyWantToRemoveAllFoundations:"Estás seguro que quieres eliminar todas las bases that are not locked",DoYouReallyWantToRemoveAllCuboids:"Estás seguro que quieres eliminar todos los cuboides that are not locked",LockAllUnlockedElements:"Lock All Unlocked Elements",UnlockAllLockedElements:"Unlock All Locked Elements"},labelSubMenu:{Label:"Etiqueta",LabelText:"Label Text",LabelHeight:"Label Height",LabelSize:"Label Size",LabelFontSize:"Font Size",LabelColor:"Label Color",KeepShowingLabel:"Seguir mostrando etiqueta"},foundationMenu:{RemoveAllUnlockedSolarPanels:"Eliminar todos los paneles solares",RemoveAllUnlockedParabolicTroughs:"Remove All Unlocked Parabolic Troughs",RemoveAllUnlockedParabolicDishes:"Remove All Unlocked Parabolic Dishes",RemoveAllUnlockedFresnelReflectors:"Remove All Unlocked Fresnel Reflectors",RemoveAllUnlockedHeliostats:"Remove All Unlocked Heliostats",RemoveAllUnlockedWindTurbines:"Remove All Unlocked Wind Turbines",RemoveAllUnlockedSensors:"Eliminar todos los sensores",RemoveAllUnlockedLights:"Remove All Unlocked Lights",RemoveAllUnlockedWalls:"Eliminar todas las paredes",RemoveAllUnlockedWindows:"Remove All Unlocked Windows",RemoveAllUnlockedDoors:"Remove All Unlocked Doors",RemoveAllUnlockedPolygons:"Eliminar todos los polígonos",RemoveAllUnlockedHumans:"Remove All Humans",RemoveAllUnlockedTrees:"Remove All Trees",RemoveAllUnlockedFlowers:"Remove All Unlocked Flowers",Racks:"Rejillas",Texture01:"Textura 1",Texture02:"Textura 2",Texture03:"Textura 3",Texture04:"Textura 4",Texture05:"Textura 5",Texture06:"Textura 6",Texture07:"Textura 7",Texture08:"Textura 8",Texture09:"Textura 9",Texture10:"Textura 10",SolarPanels:"Paneles solares",SolarPanelArray:"Solar Panel Array",DoYouReallyWantToRemoveAllSolarPanelsOnFoundation:"Estás seguro que quieres eliminar todos los paneles solares en esta base that are not locked",ParabolicTroughs:"Parabolic Troughs",DoYouReallyWantToRemoveAllParabolicTroughsOnFoundation:"Do you really want to remove all the parabolic troughs on this foundation that are not locked",ParabolicDishes:"Parabolic Dishes",DoYouReallyWantToRemoveAllParabolicDishesOnFoundation:"Do you really want to remove all the parabolic dishes on this foundation that are not locked",FresnelReflectors:"Fresnel Reflectors",DoYouReallyWantToRemoveAllFresnelReflectorsOnFoundation:"Do you really want to remove all the Fresnel reflectors on this foundation that are not locked",Heliostats:"Heliostats",DoYouReallyWantToRemoveAllHeliostatsOnFoundation:"Do you really want to remove all the heliostats on this foundation that are not locked",WindTurbines:"Wind Turbines",DoYouReallyWantToRemoveAllWindTurbinesOnFoundation:"Do you really want to remove all the wind turbines on this foundation that are not locked",Sensors:"Sensores",DoYouReallyWantToRemoveAllSensorsOnFoundation:"Estás seguro que quieres eliminar todos los sensores de esta base",Lights:"Lights",DoYouReallyWantToRemoveAllLightsOnFoundation:"Do you really want to remove all the lights on this foundation that are not locked",Walls:"Paredes",DoYouReallyWantToRemoveAllWallsOnFoundation:"Estás seguro que quieres eliminar todas las paredes de esta base that are not locked",Windows:"Windows",DoYouReallyWantToRemoveAllWindowsOnFoundation:"Do you really want to remove all the windows on this foundation that are not locked",Doors:"Doors",DoYouReallyWantToRemoveAllDoorsOnFoundation:"Do you really want to remove all the doors on this foundation that are not locked",Polygons:"Polígonos",DoYouReallyWantToRemoveAllPolygonsOnFoundation:"Estás seguro que quieres eliminar todos los polígonos de esta base that are not locked",Humans:"Humans",DoYouReallyWantToRemoveAllHumansOnFoundation:"Do you really want to remove all the humans on this foundation who are not locked",Trees:"Trees",DoYouReallyWantToRemoveAllTreesOnFoundation:"Do you really want to remove all the trees on this foundation that are not locked",Flowers:"Flowers",DoYouReallyWantToRemoveAllFlowersOnFoundation:"Do you really want to remove all the flowers on this foundation that are not locked",OnlyThisFoundation:"Solamente esta base",AllConnectedFoundations:"Todas las bases conectadas",AllSelectedFoundations:"All Selected Foundations",AllFoundations:"Todas las bases",AddPolygon:"Añadir polígono",SolarStructure:"Solar Structure",GroupMaster:"Group Master",LockAllUnlockedElementsOnThisFoundation:"Lock All Unlocked Elements on This Foundation",UnlockAllLockedElementsOnThisFoundation:"Unlock All Locked Elements on This Foundation",GroundFloorRValue:"Ground Floor R-Value",OnlyThisGroundFloor:"Only This Ground Floor",AllGroundFloors:"All Ground Floors"},solarPowerTowerMenu:{ReceiverTowerForHeliostats:"Receiver Tower for Heliostats",ReceiverTowerPhysicalProperties:"Physical Properties of Receiver Tower",ReceiverTowerHeight:"Height of Receiver Tower",ReceiverTowerRadius:"Radius of Receiver Tower",ReceiverAbsorptance:"Absorptance of Receiver",ReceiverOpticalEfficiency:"Optical Efficiency of Receiver",ReceiverThermalEfficiency:"Thermal Efficiency of Receiver"},solarAbsorberPipeMenu:{AbsorberPipeForFresnelReflectors:"Absorber Pipe for Fresnel Reflectors",AbsorberPipePhysicalProperties:"Physical Properties of Absorber Pipe",AbsorberHeight:"Height of Absorber Pipe",AbsorberApertureWidth:"Aperture Width of Absorber Pipe",AbsorberPipePoleNumber:"Pole Number for Absorber Pipe",AbsorberAbsorptance:"Absorptance of Absorber",AbsorberOpticalEfficiency:"Optical Efficiency of Absorber",AbsorberThermalEfficiency:"Thermal Efficiency of Absorber"},solarUpdraftTowerMenu:{SolarUpdraftTower:"Solar Updraft Tower",SolarUpdraftTowerPhysicalProperties:"Physical Properties of Solar Updraft Tower",SolarUpdraftTowerChimneyHeight:"Solar Updraft Tower Chimney Height",SolarUpdraftTowerChimneyRadius:"Solar Updraft Tower Chimney Radius",SolarUpdraftTowerCollectorHeight:"Solar Updraft Tower Collector Height",SolarUpdraftTowerCollectorRadius:"Solar Updraft Tower Collector Radius",SolarUpdraftTowerCollectorTransmissivity:"Solar Updraft Tower Collector Transmissivity",SolarUpdraftTowerCollectorEmissivity:"Solar Updraft Tower Collector Emissivity",SolarUpdraftTowerDischargeCoefficient:"Solar Updraft Tower Discharge Coefficient",SolarUpdraftTowerTurbineEfficiency:"Solar Updraft Tower Turbine Efficiency"},cuboidMenu:{Texture01:"Textura 1",Texture02:"Textura 2",Texture03:"Textura 3",Texture04:"Textura 4",Texture05:"Textura 5",Texture06:"Textura 6",Texture07:"Textura 7",Texture08:"Textura 8",Texture09:"Textura 9",Texture10:"Textura 10",RemoveAllUnlockedSolarPanels:"Eliminar todos los paneles solares",RemoveAllUnlockedSensors:"Eliminar todos los sensores",RemoveAllUnlockedPolygons:"Eliminar todos los polígonos",RemoveAllUnlockedHumans:"Remove All Humans",RemoveAllUnlockedTrees:"Remove All Trees",RemoveAllUnlockedFlowers:"Remove All Unlocked Flowers",RemoveAllUnlockedLights:"Remove All Unlocked Lights",Racks:"Rejillas",Lights:"Lights",DoYouReallyWantToRemoveAllLightsOnCuboid:"Do you really want to remove all the lights on this cuboid that are not locked",SolarPanels:"Paneles solares",DoYouReallyWantToRemoveAllSolarPanelsOnCuboid:"Estás seguro que quieres eliminar todos los paneles solares de este cuboide that are not locked",Sensors:"Sensores",DoYouReallyWantToRemoveAllSensorsOnCuboid:"Estás seguro que quieres eliminar todos los sensores de este cuboide that are not locked",Polygons:"Polígonos",DoYouReallyWantToRemoveAllPolygonsOnCuboid:"Estás seguro que quieres eliminar todos los polígonos de este cuboide that are not locked",Humans:"Humans",DoYouReallyWantToRemoveAllHumansOnCuboid:"Do you really want to remove all the humans on this cuboid who are not locked",Trees:"Trees",DoYouReallyWantToRemoveAllTreesOnCuboid:"Do you really want to remove all the trees on this cuboid that are not locked",Flowers:"Flowers",DoYouReallyWantToRemoveAllFlowersOnCuboid:"Do you really want to remove all the flowers on this cuboid that are not locked",OnlyThisCuboid:"Solamente este cuboide",AllCuboidsOnSameSurface:"All Cuboids on Same Surface",AllCuboidsAboveSameBase:"All Cuboids above Same Base",AllSelectedCuboids:"All Selected Cuboids",AllCuboids:"Todos los cuboides",OnlyThisSide:"Solamente este lado",AllSidesOfThisCuboid:"Todos los lados en este cuboide",AllSidesOfSelectedCuboids:"All Sides of Selected Cuboids",AllSidesOfAllCuboids:"Todos los lados en todos los cuboides",AddPolygon:"Añadir polígono",Stackable:"Stackable",GroupMaster:"Group Master"},polygonMenu:{Texture01:"Textura 1",Texture02:"Textura 2",Texture03:"Textura 3",Texture04:"Textura 4",Texture05:"Textura 5",Texture06:"Textura 6",Texture07:"Textura 7",Texture08:"Textura 8",Texture09:"Textura 9",Texture10:"Textura 10",TextBox:"Text Box",FontOutlineColor:"Font Outline Color",FontOutlineWidth:"Font Outline Width",FontStrokeColor:"Font Stroke Color",FontStrokeWidth:"Font Stroke Width",NoOutline:"No Outline",Shiny:"Shiny",Filled:"Rellenar",FillTexture:"Rellenar textura",FillColor:"Rellenar color",Opacity:"Opacity",LineColor:"Color de la línea",LineWidth:"Line Width",LineStyle:"Line Style",SolidLine:"Solid Line",DashedLine:"Dashed Line",DottedLine:"Dotted Line",InsertVertexBeforeIndex:"Añadir vértice antes del índice",InsertVertexAfterIndex:"Añadir vértice después del índice",DeleteVertex:"Eliminar vértice",OnlyThisPolygon:"Solamente este polígono",AllPolygonsOnSurface:"All Polygons on the Same Surface",AllPolygonsAboveFoundation:"Todos los polígonos sobre la base",AllSelectedPolygons:"All Selected Polygons",AllPolygons:"Todos los polígonos",Layout:"Layout",SolarPanelArrayLayout:"Solar Panel Array Layout",SolarPanelArrayLayoutParametricDesign:"Solar Panel Array Layout: Parametric Design",SolarPanelArrayLayoutGenerativeDesign:"Solar Panel Array Layout: Generative Design",SolarPanelArrayModel:"Solar Panel Model",SolarPanelArrayOrientation:"Orientation",SolarPanelArrayTiltAngle:"Tilt Angle",SolarPanelArrayRowWidth:"Row Width",SolarPanelArrayInterRowSpacing:"Inter-Row Spacing",SolarPanelArrayRowSpacing:"Row Spacing",SolarPanelArrayRowAxis:"Row Axis",SolarPanelArrayLeftRightRowAxis:"Left-Right (Relative)",SolarPanelArrayUpDownRowAxis:"Up-Down (Relative)",SolarPanelArrayEastWestRowAxis:"East-West (Absolute)",SolarPanelArrayNorthSouthRowAxis:"North-South (Absolute)",SolarPanelArrayMargin:"Margin",SolarPanelArrayPoleHeight:"Pole Height",SolarPanelArrayPoleSpacing:"Pole Spacing",SolarPanelArrayTotalYearlyCost:"Total Cost",SolarPanelArrayTotalYearlyRevenue:"Total Revenue",SolarPanelArrayTotalYearlyYield:"Total Yield",SolarPanelArrayMeanYearlyYield:"Mean Yield",SolarPanelArrayYearlyProfit:"Profit",LayoutNotAcceptedCheckYourParameters:"This layout is not accepted. Please check your parameters."},optimizationMenu:{Optimization:"Optimization",Parameters:"Parameters",Variables:"Variables",Constants:"Constants",GeneticAlgorithm:"Genetic Algorithm",GeneticAlgorithmSettings:"Genetic Algorithm Settings",ParticleSwarmOptimization:"Particle Swarm Optimization",ParticleSwarmOptimizationSettings:"Particle Swarm Optimization Settings",SolarPanelTiltAngleOptimization:"Solar Panel Tilt Angle Optimization",SolarPanelArrayLayout:"Solar Panel Array Layout",Generation:"Generation",Gene:"Gene",NormalizedVariables:"Normalized Variables",Objective:"Objective",ObjectiveFunctionDailyTotalYield:"Daily Total Yield",ObjectiveFunctionYearlyTotalYield:"Yearly Total Yield",ObjectiveFunctionDailyMeanYield:"Daily Mean Yield",ObjectiveFunctionYearlyMeanYield:"Yearly Mean Yield",ObjectiveFunctionDailyProfit:"Daily Profit",ObjectiveFunctionYearlyProfit:"Yearly Profit",GeneticAlgorithmSelectionMethod:"Genetic Algorithm Selection Method",RouletteWheel:"Roulette Wheel",Tournament:"Tournament",SearchMethod:"Search Method",GlobalSearchUniformSelection:"Global Search Uniform Selection",LocalSearchRandomOptimization:"Local Search Random Optimization",PopulationSize:"Population Size",MaximumGenerations:"Maximum Generations",SelectionRate:"Selection Rate",CrossoverRate:"Crossover Rate",MutationRate:"Mutation Rate",Step:"Step",SwarmSize:"Swarm Size",MaximumSteps:"Maximum Steps",MaximumVelocity:"Maximum Velocity",InertiaWeight:"Inertia Weight",CognitiveCoefficient:"Cognitive Coefficient",SocialCoefficient:"Social Coefficient",ConvergenceThreshold:"Convergence Threshold for Termination",LocalSearchRadius:"Local Search Radius",RowsPerRackRange:"Range for Rows per Rack",TiltAngleRange:"Range for Tilt Angle",InterRowSpacingRange:"Range for Inter-Row Spacing",ClickTargetPolygonToActivate:"Click Target Polygon to Activate",ClickTargetFoundationToActivate:"Click Target Foundation to Activate"},treeMenu:{ShowModel:"Mostrar modelo",Flip:"Flip",Type:"Tipo",Spread:"Extender"},flowerMenu:{Flip:"Flip",Type:"Type",Spread:"Spread"},peopleMenu:{ChangePerson:"Cambiar persona",Flip:"Flip",Observer:"Observer",ViewFromThisPerson:"View from This Person"},lightMenu:{Color:"Color",Intensity:"Intensity",Decay:"Decay",MaximumDistance:"Distance",Inside:"Inside"},solarCollectorMenu:{Coordinates:"Coordinates",RelativeXCoordinateOfCenter:"Relative X Coordinate of Center",RelativeYCoordinateOfCenter:"Relative Y Coordinate of Center",RelativeAzimuth:"Azimut relativa",Pole:"Pole",PoleHeight:"Altura del poste",PoleRadius:"Pole Radius",ExtraPoleHeight:"Extra Pole Height",ExtraPoleHeightInAdditionToHalfWidth:"Extra Pole Height in Addition to Half Width",DrawSunBeam:"Dibujar rayo del sol"},concentratedSolarPowerCollectorMenu:{ReflectorReflectance:"Reflector Reflectance",ReceiverAbsorptance:"Receiver Absorptance",ReflectorOpticalEfficiency:"Reflector Optical Efficiency",ReceiverThermalEfficiency:"Receiver Thermal Efficiency"},solarPanelMenu:{ElectricalProperties:"Electrical Properties",InverterEfficiency:"Inverter Efficiency",InverterEfficiencyExplained:"The efficiency for converting direct current (DC) to alternating current (AC).",DcToAcSizeRatio:"DC-to-AC Size Ratio",DcToAcSizeRatioExplained:"The ratio of the solar panels' DC-rated size to the inverter's AC-rated size.",ChangePvModel:"Cambiar modelo PV",Orientation:"Orientación",Portrait:"Vertical",Landscape:"Horizontal",FrameColor:"Frame Color",Panels:"paneles",PanelsWide:"ancho paneles",PanelsLong:"longitud paneles",TiltAngle:"Inclinar ángulo",SouthFacingIsPositive:"Orientado al sur es positivo",Tracker:"Seguidor",SolarTrackerFollowsSun:"Un seguidor sigue el sol para incrementar las salidas de los paneles solares",PoleSpacing:"Espaciado entre postes",NoTracker:"Sin seguimiento",HorizontalSingleAxisTracker:"Seguidor horizontal de eje único",VerticalSingleAxisTracker:"Seguidor vertical de eje único",AltazimuthDualAxisTracker:"Seguidor de doble eje altazimutal",OnlyThisSolarPanel:"Solamente este panel solar",AllSolarPanelsOnSurface:"Todos los paneles solares en la misma superficie",AllSolarPanelsAboveFoundation:"Todos los paneles solares sobre la misma base",AllSelectedSolarPanels:"All Selected Solar Panels",AllSolarPanels:"Todos los paneles solares"},waterHeaterMenu:{OnlyThisWaterHeater:"Only This Water Heater",AllWaterHeatersOnSurface:"All Water Heaters on the Same Surface",AllWaterHeatersAboveFoundation:"All Water Heaters Above the Same Foundation",AllSelectedWaterHeaters:"All Selected Water Heaters",AllWaterHeaters:"All Water Heaters"},pvModelPanel:{SolarPanelSpecs:"Especificaciones del panel solar",Model:"Modelo",PanelSize:"Tamaño del panel",Cells:"Celdas",CellType:"Tipo de celda",Monocrystalline:"Monocristalino",Polycrystalline:"Policristalino",ThinFilm:"Película delgada",Bifacial:"Bifacial",BifacialityFactor:"Bifaciality Factor",Black:"Negro",Blue:"Azul",ShadeTolerance:"Tolerancia a la sombra",SolarCellEfficiency:"Eficiencia de la célula solar",NominalOperatingCellTemperature:"Temperatura nominal de la celda de funcionamiento",TemperatureCoefficientOfPmax:"Coeficiente de temperatura de Pmax"},parabolicTroughMenu:{ModuleLength:"Module Length",Modules:"modules",ModulesLong:"modules long",LatusRectum:"Latus Rectum",OnlyThisParabolicTrough:"Only This Parabolic Trough",AllParabolicTroughsAboveFoundation:"All Parabolic Troughs Above the Same Foundation",AllSelectedParabolicTroughs:"All Selected Parabolic Troughs",AllParabolicTroughs:"All Parabolic Troughs"},fresnelReflectorMenu:{AbsorberPipe:"Absorber Pipe",SelectAbsorberToReflectSunlightTo:"Select Absorber to Reflect Sunlight to",ModuleLength:"Module Length",Modules:"modules",ModulesLong:"modules long",OnlyThisFresnelReflector:"Only This Fresnel Reflector",AllFresnelReflectorsAboveFoundation:"All Fresnel Reflectors Above the Same Foundation",AllSelectedFresnelReflectors:"All Selected Fresnel Reflectors",AllFresnelReflectors:"All Fresnel Reflectors"},heliostatMenu:{Tower:"Tower",SelectTowerToReflectSunlightTo:"Select Tower to Reflect Sunlight to",OnlyThisHeliostat:"Only This Heliostat",AllHeliostatsAboveFoundation:"All Heliostats Above the Same Foundation",AllSelectedHeliostats:"All Selected Heliostats",AllHeliostats:"All Heliostats"},parabolicDishMenu:{ReceiverStructure:"Receiver Structure",CentralPole:"Central Pole",CentralPoleWithTripod:"Central Pole with Tripod",Quadrupod:"Quadrupod",RimDiameter:"Rim Diameter",LatusRectum:"Latus Rectum",ExtraPoleHeightInAdditionToRadius:"Extra Pole Height in Addition to Radius",OnlyThisParabolicDish:"Only This Parabolic Dish",AllParabolicDishesAboveFoundation:"All Parabolic Dishes Above the Same Foundation",AllSelectedParabolicDishes:"All Selected Parabolic Dishes",AllParabolicDishes:"All Parabolic Dishes"},windTurbineMenu:{BirdSafeDesign:"Bird-Safe Design",BirdSafeNone:"None",BirdSafeBicolor:"Bicolor",BirdSafeStriped:"Striped",Rotor:"Rotor",BladeNumber:"Blade Number",RotorInitialAngle:"Rotor Initial Angle",RotorBladeDesign:"Rotor Blade Design",RotorBladeRadius:"Rotor Blade Radius",RotorBladePitchAngle:"Rotor Blade Pitch Angle",RelativeYawAngle:"Relative Yaw Angle",MaximumChordLength:"Maximum Chord Length",Tower:"Tower",TowerHeight:"Tower Height",TowerRadius:"Tower Radius",HubDesign:"Hub Design",HubRadius:"Hub Radius",HubLength:"Hub Length",OnlyThisWindTurbine:"Only This Wind Turbine",AllWindTurbinesAboveFoundation:"All Wind Turbines Above the Same Foundation",AllSelectedWindTurbines:"All Selected Wind Turbines",AllWindTurbines:"All Wind Turbines"},wallMenu:{TextureDefault:"Por defecto",Texture01:"Textura 1",Texture02:"Textura 2",Texture03:"Textura 3",Texture04:"Textura 4",Texture05:"Textura 5",Texture06:"Textura 6",Texture07:"Textura 7",Texture08:"Textura 8",Texture09:"Textura 9",Texture10:"Textura 10",SizeOfWall:"Tamaño de la pared",OnlyThisWall:"Solamente esta pared",AllConnectedWalls:"All Connected Walls",AllWallsAboveFoundation:"Todas las paredes sobre la misma base",AllSelectedWalls:"All Selected Walls",AllWalls:"Todo paredes",Windows:"Windows",LockAllUnlockedWindows:"Lock All Unlocked Windows",UnlockAllLockedWindows:"Unlock All Locked Windows",RemoveAllUnlockedWindows:"Remove All Unlocked Windows",DoYouReallyWantToRemoveAllWindowsOnThisWall:"Do you really want to remove all the windows on this wall",Doors:"Doors",LockAllUnlockedDoors:"Lock All Unlocked Doors",UnlockAllLockedDoors:"Unlock All Locked Doors",RemoveAllUnlockedDoors:"Remove All Unlocked Doors",DoYouReallyWantToRemoveAllDoorsOnThisWall:"Do you really want to remove all the doors on this wall",SolarPanels:"Solar Panels",LockAllUnlockedSolarPanels:"Lock All Unlocked Solar Panels",UnlockAllLockedSolarPanels:"Unlock All Locked Solar Panels",RemoveAllUnlockedSolarPanels:"Remove All Unlocked Solar Panels",DoYouReallyWantToRemoveAllSolarPanelsOnThisWall:"Do you really want to remove all the solar panels on this wall",Sensors:"Sensors",LockAllUnlockedSensors:"Lock All Unlocked Sensors",UnlockAllLockedSensors:"Unlock All Locked Sensors",RemoveAllUnlockedSensors:"Remove All Unlocked Sensors",DoYouReallyWantToRemoveAllSensorsOnThisWall:"Do you really want to remove all the sensors on this wall",Lights:"Lights",LockAllUnlockedLights:"Lock All Unlocked Lights",UnlockAllLockedLights:"Unlock All Locked Lights",RemoveAllUnlockedLights:"Remove All Unlocked Lights",DoYouReallyWantToRemoveAllLightsOnThisWall:"Do you really want to remove all the lights on this wall",Polygons:"Polygons",LockAllUnlockedPolygons:"Lock All Unlocked Polygons",UnlockAllLockedPolygons:"Unlock All Locked Polygons",RemoveAllUnlockedPolygons:"Eliminar todos los polígonos",DoYouReallyWantToRemoveAllPolygonsOnThisWall:"Do you really want to remove all the polygons on this wall",WallStructure:"Wall Structure",DefaultStructure:"Default",StudStructure:"Stud",PillarStructure:"Pillar",Opacity:"Opacity",StructureSpacing:"Structure Spacing",StructureWidth:"Structure Width",StructureThickness:"Structure Thickness",StructureColor:"Structure Color",Color:"Wall Color",Height:"Altura",Thickness:"Thickness",Texture:"Texture",AllLightsOnWallInside:"All Lights on Wall Inside",AllLightsOnWallOutside:"All Lights on Wall Outside",Fill:"Fill",Full:"Full",Partial:"Partial",Empty:"Empty",OpenToOutside:"Open to Outside",EavesLength:"Eaves Overhang Length",Parapet:"Parapet",ParapetColor:"Parapet Color",ParapetTexture:"Parapet Texture",ParapetHeight:"Parapet Height",CopingsHeight:"Copings Height",CopingsWidth:"Copings Width"},windowMenu:{OnlyThisWindow:"Only This Window",AllWindowsOnSurface:"All Windows on the Same Surface",AllWindowsAboveFoundation:"All Windows Above the Same Foundation",AllSelectedWindows:"All Selected Windows",AllWindows:"All Windows",Width:"Ancho",Height:"Altura",Setback:"Setback from Exterior Surface",RelativeToWallThickness:"Relative to wall thickness",Mullion:"Mullion",HorizontalMullion:"Horizontal Mullion",VerticalMullion:"Vertical Mullion",MullionWidth:"Mullion Width",HorizontalMullionSpacing:"Horizontal Mullion Spacing",VerticalMullionSpacing:"Vertical Mullion Spacing",MullionColor:"Mullion Color",Tint:"Tint",Opacity:"Opacity",SolarHeatGainCoefficient:"Solar heat gain coefficient (SHGC) = 1 - opacity",Shutter:"Shutter",LeftShutter:"Left Shutter",RightShutter:"Right Shutter",BothShutters:"Both Shutters",ShutterWidth:"Relative Width",ShutterColor:"Shutter Color",Frame:"Frame",FrameWidth:"Frame Width",SillWidth:"Sill Width",Color:"Frame Color",WindowType:"Window Type",Default:"Default",Arched:"Arched",Polygonal:"Polygonal",Interior:"Interior",Empty:"Empty"},roofMenu:{TextureDefault:"Por defecto",Texture01:"Textura 1",Texture02:"Textura 2",Texture03:"Textura 3",Texture04:"Textura 4",Texture05:"Textura 5",Texture06:"Textura 6",Texture07:"Textura 7",OnlyThisRoof:"Only This Wall",AllRoofsAboveFoundation:"All Walls Above the Same Foundation",AllSelectedRoofs:"All Selected Roofs",AllRoofs:"All Roofs",OnlyThisCeiling:"Only This Ceiling",AllCeilingsAboveFoundation:"All Ceilings Above the Same Foundation",AllCeilings:"All Ceilings",EavesOverhangLength:"Eaves Overhang Length",RafterSpacing:"Rafter Spacing",RafterWidth:"Rafter Width",RafterThickness:"Rafter Thickness",RafterColor:"Rafter Color",RoofColor:"Roof Color",RoofSideColor:"Roof Side Color",GlassTint:"Glass Tint",Opacity:"Opacity",RoofStructure:"Roof Structure",DefaultStructure:"Default",RafterStructure:"Rafter",GlassStructure:"Glass",SolarPanels:"Solar Panels",LockAllUnlockedSolarPanels:"Lock All Unlocked Solar Panels",UnlockAllLockedSolarPanels:"Unlock All Locked Solar Panels",RemoveAllUnlockedSolarPanels:"Remove All Unlocked Solar Panels",DoYouReallyWantToRemoveAllSolarPanelsOnThisRoof:"Do you really want to remove all the solar panels on this roof",Windows:"Windows",LockAllUnlockedWindows:"Lock All Unlocked Windows",UnlockAllLockedWindows:"Unlock All Locked Windows",RemoveAllUnlockedWindows:"Remove All Unlocked Windows",DoYouReallyWantToRemoveAllWindowsOnThisRoof:"Do you really want to remove all the windows on this roof",Sensors:"Sensors",LockAllUnlockedSensors:"Lock All Unlocked Sensors",UnlockAllLockedSensors:"Unlock All Locked Sensors",RemoveAllUnlockedSensors:"Remove All Unlocked Sensors",DoYouReallyWantToRemoveAllSensorsOnThisRoof:"Do you really want to remove all the sensors on this roof",Lights:"Lights",RemoveAllUnlockedLights:"Remove All Unlocked Lights",DoYouReallyWantToRemoveAllLightsOnThisRoof:"Do you really want to remove all the lights on this roof",AllLightsOnRoofInside:"All Lights on Roof Inside",AllLightsOnRoofOutside:"All Lights on Roof Outside",Rise:"Rise",Ceiling:"Ceiling",RoofRValue:"Roof R-Value",CeilingRValue:"Ceiling R-Value"},doorMenu:{TextureDefault:"Por defecto",Texture01:"Textura 1",Texture02:"Textura 2",Texture03:"Textura 3",Texture04:"Textura 4",Texture05:"Textura 5",Texture06:"Textura 6",Texture07:"Textura 7",Texture08:"Textura 8",Texture09:"Textura 9",Texture10:"Textura 10",Texture11:"Textura 11",Texture12:"Textura 12",Texture13:"Textura 13",Texture14:"Textura 14",Texture15:"Textura 15",Texture16:"Textura 16",Texture17:"Textura 17",OnlyThisDoor:"Only This Door",AllDoorsOnWall:"All Doors on the Same Wall",AllDoorsAboveFoundation:"All Doors Above the Same Foundation",AllSelectedDoors:"All Selected Doors",AllDoors:"All Doors",DoorType:"Door Type",Default:"Default",Arched:"Arched",Filled:"Filled",FrameColor:"Frame Color",Interior:"Interior"},siteInfoPanel:{High:"Alto",Low:"Bajo"},designInfoPanel:{NumberOfSelectedHeliostats:"Number of selected heliostats",NumberOfSelectedSolarPanels:"Number of selected solar panels",ElectricityGeneratedDailyBySolarPanels:"Electricity generated daily by these solar panels",SceneDiameter:"Scene diameter",BuildingArea:"Building area"},visualizationControlPanel:{ColorContrast:"Color Contrast",FluxScale:"Flux Scale",ClickUpOrDownArrowButtonsToChange:"Click up or down arrow buttons to change"},instructionPanel:{Rotate:"Rotar",DragMouse:"Arrastrar el ratón",Zoom:"Zoom",MouseWheelOrKeys:"Girar el mouse o presionar Ctrl+[ o Ctrl+]",MouseWheelOrKeysMac:"Girar el mouse o presionar ⌘+[ o ⌘+]",Pan:"Panorámica",HoldCtrlDragMouse:"Mantener Ctrl y mover el ratón",HoldMetaDragMouse:"Hold ⌘ and drag mouse",Enter2DMode:"Enter 2D mode",Exit2DMode:"Exit 2D mode",NavigationMode:"Navigation mode",EnableNavigation:"Enable navigation",DisableNavigation:"Disable navigation",MoveForwardBack:"Move forward/back",MoveForwardBackInstruction:"Press W/S",MoveLeftRight:"Move left/right",MoveLeftRightInstruction:"Press A/D",MoveUpDown:"Move up/down",MoveUpDownInstruction:"Press Z/X",Turn:"Turn",TurnInstruction:"Press arrow keys",ResetView:"Reset",AutoRotate:"Auto rotar",StartOrStop:"Presiona F4 para empezar o parar"},mapPanel:{ImageOnGround:"Imagen en el suelo",HideAddress:"Hide Address",WeatherStations:"Weather Stations",WeatherStationsNote:"Turn this off to speed up",Coordinates:"Coordenadas",Zoom:"Zoom"},visibilityPanel:{SolarPanelVisibility:"Solar Panel Visibility",Observer:"Observer",VantagePoint:"Vantage Point",ItemizedVisibilityByFields:"Itemized by Fields",TotalVisibility:"Total"},sensorPanel:{LightSensor:"Sensor de luz",WeatherDataFrom:"Datos metereológicos de"},buildingEnergyPanel:{DailyBuildingEnergy:"Daily Building Energy",YearlyBuildingEnergy:"Yearly Building Energy",Heater:"Heater",AC:"AC",SolarPanel:"Solar Panel",Net:"Net"},solarPanelYieldPanel:{SolarPanelDailyYield:"Rendimiento diario del panel solar",SolarPanelYearlyYield:"Rendimiento anual del panel solar",Yield:"Rendimiento",YieldPerHour:"Rendimiento por hora",DailyTotal:"Total diario",YearlyTotal:"Total anual",ShowOutputsOfIndividualSolarPanels:"Mostrar salidas de paneles solares individuales",Profit:"Profit",TotalCost:"Total Cost",TotalRevenue:"Total Revenue",TotalYield:"Total Yield",MeanYield:"Mean Yield",ModuleCount:"Module Count"},parabolicTroughYieldPanel:{ParabolicTroughDailyYield:"Parabolic Trough Daily Yield",ParabolicTroughYearlyYield:"Parabolic Trough Yearly Yield",Yield:"Yield",YieldPerHour:"Yield per Hour",DailyTotal:"Daily Total",YearlyTotal:"Yearly Total",ShowOutputsOfIndividualParabolicTroughs:"Show outputs of individual parabolic troughs"},parabolicDishYieldPanel:{ParabolicDishDailyYield:"Parabolic Dish Daily Yield",ParabolicDishYearlyYield:"Parabolic Dish Yearly Yield",Yield:"Yield",YieldPerHour:"Yield per Hour",DailyTotal:"Daily Total",YearlyTotal:"Yearly Total",ShowOutputsOfIndividualParabolicDishes:"Show outputs of individual parabolic dishes"},fresnelReflectorYieldPanel:{FresnelReflectorDailyYield:"Fresnel Reflector Daily Yield",FresnelReflectorYearlyYield:"Fresnel Reflector Yearly Yield",Yield:"Yield",YieldPerHour:"Yield per Hour",DailyTotal:"Daily Total",YearlyTotal:"Yearly Total",ShowOutputsOfIndividualFresnelReflectors:"Show outputs of individual Fresnel feflectors"},heliostatYieldPanel:{HeliostatDailyYield:"Heliostat Daily Yield",HeliostatYearlyYield:"Heliostat Yearly Yield",Yield:"Yield",YieldPerHour:"Yield per Hour",DailyTotal:"Daily Total",YearlyTotal:"Yearly Total",ShowOutputsOfIndividualHeliostats:"Show outputs of individual heliostats"},updraftTowerYieldPanel:{UpdraftTowerDailyYield:"Solar Updraft Tower Daily Yield",UpdraftTowerYearlyYield:"Solar Updraft Tower Yearly Yield",ChimneyAirTemperature:"Chimney Air Temperature",ChimneyWindSpeed:"Chimney Wind Speed",Yield:"Yield",YieldPerHour:"Yield per Hour",DailyTotal:"Daily Total",YearlyTotal:"Yearly Total",ShowOutputsOfIndividualUpdraftTowers:"Show outputs of individual updraft towers"},heliodonPanel:{SunAndTimeSettings:"Sun & Time Settings",SunAngles:"Ángulos",TwentyFourHours:"24 Hours"},cloudFilePanel:{CopyTitle:"Copy Title",TitleCopiedToClipBoard:"The title was copied to the clip board",SearchByTitle:"Search by title",MyLikes:"My Likes",MyCloudFiles:"Mis archivos en la nube",GenerateLink:"Generar enlace",LinkGeneratedInClipBoard:"Se ha generado un enlace en el portapapeles",DoYouReallyWantToDelete:"Estás seguro que quieres eliminar",IfSharedOrPublishedRenamingFileBreaksExistingLinks:"If this file has been shared or published, renaming it breaks existing links"},projectListPanel:{CopyTitle:"Copy Title",TitleCopiedToClipBoard:"The title was copied to the clip board",SearchByTitle:"Search by title",MyProjects:"My Projects",GenerateProjectLink:"Generate Project Link",ProjectLinkGeneratedInClipBoard:"A link to the project was generated in the clip board",DoYouReallyWantToDeleteProject:"Do you really want to delete Project",IfSharedOrPublishedRenamingProjectBreaksExistingLinks:"If this project has been shared or published, renaming it breaks existing links"},projectPanel:{ProjectSettings:"Project Settings",ThumbnailImageSize:"Thumbnail Image Size",ProjectByOtherPeople:"Project by Other People",Project:"Project",ProjectType:"Type",ProjectDescription:"Description",MakeDescriptionEditable:"Make this description editable",MakeDescriptionNonEditable:"Make this description non-editable",DoubleClickToMakeDescriptionEditable:"Double-click to make this description editable",SolarPanelArray:"Solar Panel Array",CurateCurrentDesign:"Curate current design",UpdateSelectedDesign:"Update selected design",RemoveSelectedDesign:"Remove selected design",ClickToFlipSortingOrder:"Click to flip the sorting order",DesignNotShownInSolutionSpaceClickToShow:"This design is not shown in solution space; click to show",DesignShownInSolutionSpaceClickToHide:"This design is shown in solution space; click to hide",SolutionSpace:"Solution Space",ChooseSolutionSpace:"Choose solution space",ChooseDataColoring:"Choose data coloring",SameColorForAllDesigns:"Same color for all designs",OneColorForEachDesign:"One color for each design",SolutionSpaceScreenshot:"Take a screenshot of the solution space",ScatterPlotScreenshot:"Take a screenshot of the scatter plot",SingleClickToSelectDoubleClickToOpen:"Single-click to select, double-click to open.",SingleClickToDeselectDoubleClickToOpen:"Single-click to deselect, double-click to open.",GenerateScatterPlot:"Generate Scatter Plot",SelectXAxis:"Select X Axis",SelectYAxis:"Select Y Axis"},accountSettingsPanel:{MyAccountSettings:"Configuración de mi cuenta",MyID:"My 🆔",ClickToCopyMyID:"Click to copy my ID",IDInClipBoard:"Your ID was copied and is ready to paste.",StoreMyNameInMyFilesWhenSaving:"Store my name in my files when saving",DoYouReallyWantToShowYourNameInYourFiles:"Do you really want to show your display name in your files?",SignFileDisclaimer:"If yes, your display name may be seen by anyone who can access your files.",Likes:"Likes",AllPublished:"All Published",PublishedUnderAliases:"Aliases",UserCount:"User Count",SchoolID:"School ID",ClassID:"Class ID"},weatherPanel:{SunshineHours:"Luz solar"},diurnalTemperaturePanel:{SelectAirTemperatureModel:"Select Air Temperature Model",Sinusoidal:"Sinusoidal"},economicsPanel:{EconomicsParameters:"Economics Parameters",ElectricitySellingPrice:"Electricity Selling Price",OperationalCostPerUnit:"Operational Cost per Unit",SellingPrice:"Selling Price",UnitCost:"Unit Cost"},navigationPanel:{NavigationParameters:"Navigation Parameters",MinimumMoveSpeed:"Minimum Move Speed",MinimumTurnSpeed:"Minimum Turn Speed"},shadowSettingsPanel:{ShadowSettings:"Shadow Settings",ShadowCameraFarDistance:"Shadow Camera Far Distance",ShadowMapSize:"Shadow Map Size",Notes:"Notes",RefreshPageNote:"Refresh the page for the new settings to take effect.",MapSizeWarning:"A large shadow map size may cause Aladdin to crash on some computers."},yearlyLightSensorPanel:{SkyClearness:"Claridad",ShowDaylightResults:"Mostrar resultados de la luz solar",ShowSkyClearnessResults:"Mostrar resultados de claridad del cielo",ShowAverageDailySolarRadiation:"Mostrar la radiación solar diaria promedio"},analysisManager:{NoSensorForCollectingData:"Sin sensor para recopilar datos",NoSolarPanelForAnalysis:"Sin panel solar para el análisis",NoObserverForVisibilityAnalysis:"There is no observer for visibility analysis.",NoWaterHeaterForAnalysis:"There is no water heater for analysis.",NoParabolicDishForAnalysis:"There is no parabolic dish for analysis.",NoParabolicTroughForAnalysis:"There is no parabolic trough for analysis.",NoFresnelReflectorForAnalysis:"There is no Fresnel reflector for analysis.",NoHeliostatForAnalysis:"There is no heliostat for analysis.",NoSolarUpdraftTowerForAnalysis:"There is no solar updraft tower for analysis.",NoBuildingForAnalysis:"There is no building for analysis."},toolbar:{CloudFile:"Archivo en la nube",Select:"Seleccionar",AddFoundation:"Añadir base",AddWall:"Añadir pared",AddWindow:"Añadir ventana",AddDoor:"Añadir door",AddPyramidRoof:"Add Pyramid Roof",AddGableRoof:"Add Gable Roof",AddHipRoof:"Add Hip Roof",AddGambrelRoof:"Add Gambrel Roof",AddMansardRoof:"Add Mansard Roof",AddCuboid:"Añadir Cuboid",AddSensor:"Añadir Sensor",AddSolarPanel:"Añadir Panel Solar",AddWaterHeater:"Add Water Heater",AddPowerWall:"Add Power Wall",AddParabolicDish:"Add Parabolic Dish",AddParabolicTrough:"Add Parabolic Trough",AddFresnelReflector:"Add Fresnel Reflector",AddHeliostat:"Add Heliostat",AddWindTurbine:"Add Horizontal Axis Wind Turbine",AddVerticalAxisWindTurbine:"Add Vertical Axis Wind Turbine",AddLight:"Add Light",AddTree:"Añadir árbol",AddFlower:"Add Flower",AddPeople:"Añadir gente",DoubleClickToLockThisModeForNextAction:"Double-click to lock this mode for next action",ClickToUnlockThisModeForNextAction:"Click to unlock this mode for next action",ManipulateGroup:"Manipulate a group",ClearScene:"Clear escena",ShowSunAndTimeSettings:"Show sun and time settings",SpatialAnalysisOfEnergy:"Spatial analysis of energy",DoYouReallyWantToClearContent:"Estás seguro que quieres borrar el contenido",ClickForMoreButtons:"Click for more buttons"},tooltip:{gotoIFI:"Ver Institute for Future Intelligence",visitAladdinHomePage:"Visita la página de Aladdin",clickToOpenMenu:"Haz clic para abrir el menú principal",clickToAccessAccountSettings:"Click to access account settings"},tree:{Apple:"Apple",Birch:"Birch",Coconut:"Coconut",Dogwood:"Cerezo silvestre",Elm:"Olmo",FanPalm:"Fan Palm",Linden:"Tilo",Magnolia:"Magnolia",Maple:"Arce",Oak:"Roble",Pine:"Pino",Spruce:"Spruce"},flower:{Bellflower:"Bellflower",Boxwood:"Boxwood",CactusCombo1:"Cactus Combo 1",CactusCombo2:"Cactus Combo 2",CactusCombo3:"Cactus Combo 3",CactusCombo4:"Cactus Combo 4",Hibiscus:"Hibiscus",Hosta:"Hosta",Hydrangea:"Hydrangea",Peony:"Peony",RedRose:"Red Rose",Spirea:"Spirea",Sunflower:"Sunflower",TallBush:"Tall Bush",Tulip:"Tulip",WhiteFlower:"White Flower",YellowFlower:"Yellow Flower"},people:{Jaah:"Jaah",Jack:"Jack",Jacob:"Jacob",Jacqueline:"Jacqueline",Jade:"Jade",Jamelia:"Jamelia",James:"James",Jane:"Jane",Jaya:"Jaya",Jaye:"Jaye",Jeanette:"Jeanette",Jedi:"Jedi",Jeff:"Jeff",Jena:"Jena",Jennifer:"Jennifer",Jess:"Jess",Jett:"Jett",Jill:"Jill",Jiya:"Jiya",Joan:"Joan",Jocelyn:"Jocelyn",Joel:"Joel",Joey:"Joey",John:"John",Jonathon:"Jonathon",Jose:"Jose",Joseph:"Joseph",Joshua:"Joshua",Judd:"Judd",Judy:"Judy",Julia:"Julia",Julio:"Julio",Jumapili:"Jumapili",June:"June",Juro:"Juro",Justin:"Justin"},compass:{N:"N",S:"S",W:"W",E:"E"},month:{January:"Jan",February:"Feb",March:"Mar",April:"Apr",May:"May",June:"Jun",July:"Jul",August:"Aug",September:"Sep",October:"Oct",November:"Nov",December:"Dec"},modelsMap:{SearchByPublisher:"Search by publisher",SearchByLabel:"Search by label",MyPublishedModels:"My Published Models",TotalNumberOfUserPublishedModels:"Total number of user-published models",SortFromOldestToNewest:"Sort from oldest to newest",SortFromNewestToOldest:"Sort from newest to oldest",ModelsFoundOnThisSite:"models found on this site",ShowModelsPublishedByThisAuthor:"Show the models published by this author"}}},fpt={translation:{name:{IFI:"Yarının Zekası Enstitüsü",Aladdin:"Aladdin",Tagline:"Aladdin: Açıklanabilir Yapay Zeka ile Tasarımı Yeniden Hayal Et — Yarının Zekası Enstitüsü"},cookie:{Statement:"Kabul Ete tıklayarak, iyi bir Aladdin deneyimi için çerez kullanımını kabul etmiş olursunuz.",Accept:"Kabul Et"},aboutUs:{ProductBroughtToYouBy:"Geliştiriciler",TermsOfService:"Hizmet Şartları",PrivacyPolicy:"Gizlilik Politikası",Software:"Yazılım",Content:"İçerik",Research:"Araştırma",Support:"Destek",Acknowledgment:"Onay",FundingInformation:"Ulusal Bilim Vakfı (NSF), #2105695, #2131097, ve #2301164 numaralı fon destekleriyle mevcut ürünün araştırma ve geliştirme çalışmalarına cömert bir mali kaynak sağlamıştır. Bununla birlikte üründe ifade edilen herhangi bir görüş, bulgu ve sonuç veya öneri yazarların kendi görüşleridir. NSF'nin kurumsal görüşlerini yansıtmayabilir.",Contact:"Daha fazla bilgi için lütfen Charles Xie (charles@intofuture.org) ile iletişime geçiniz.",Translators:"Çevirmenler"},word:{Refresh:"Refresh",LastUpdate:"Last Update",Small:"Small",Medium:"Medium",Large:"Large",Design:"Design",Information:"Information",Type:"Type",Text:"Text",FontSize:"Font Size",FontColor:"Font Color",Model:"Model",Models:"Models",Upload:"Upload",ClickCount:"Click Count",Share:"Share",AlreadyLike:"Already like",Like:"Like",MustLogInToLike:"Must log in to like",AllRightsReserved:"Tüm Hakları Saklıdır.",MeterAbbreviation:"m",Version:"Sürüm",VersionInitial:"S",Options:"Seçenekler",Maximum:"Maximum",Minimum:"Minimum",MaximumNumber:"Maksimum Sayı",MinimumNumber:"Minimum Sayı",MaximumValue:"Maksimum Değer",MinimumValue:"Minimum Değer",Or:"Veya",None:"Hiçbiri",High:"Yüksek",Partial:"Kısmi",Teacher:"Öğretmen",Class:"Sınıf",Total:"Toplam",Leaderboard:"Leaderboard",Latest:"Latest",Range:"Aralık",SIUnit:"SI Unit",USUnit:"US Unit",ThermalTransmittance:"Thermal Transmittance",ThermalResistance:"Thermal Resistance",UValue:"U-Value",RValue:"R-Value",VolumetricHeatCapacity:"Volumetric Heat Capacity",BuildingHVACSystem:"Building HVAC System",ThermostatSetpoint:"Thermostat Setpoint",TemperatureToleranceThreshold:"Tolerance Threshold",TemperatureToleranceThresholdExplanation:`Heater will not run if the lowest outside temperature of the day is higher than the setpoint minus this threshold. -AC will not run if the highest outside temperature of the day is lower than the setpoint plus this threshold.`,Press:"Tıkla",Open:"Aç",Save:"Kaydet",SaveAsImage:"Resim Olarak Kaydet",SaveAsCsv:"Save as CSV",Update:"Güncelle",Paste:"Yapıştır",Copy:"Kopyala",Cut:"Kes",Delete:"Sil",Lock:"Kilitle",Translucent:"Yarı Saydam",Transparency:"Transparency",Color:"Renk",Pattern:"Pattern",Texture:"Doku",Size:"Boyut",Thickness:"Kalınlık",Yes:"Evet",No:"Hayır",OK:"Tamam",Cancel:"İptal",Apply:"Uygula",Close:"Kapat",ApplyTo:"Uygula",Run:"Çalıştır",Pause:"Duraklat",Resume:"Sürdür",Clear:"Temizle",Warning:"Uyarı",Caution:"Caution",Reminder:"Hatırlatıcı",Length:"Uzunluk",Width:"Genişlik",Height:"Yükseklik",Radius:"Yarıçap",Angle:"Açı",Azimuth:"Azimut",Coordinates:"Koordinatlar",Weather:"Hava Durumu",Show:"Göster",Animate:"Oynat",Date:"Tarih",Time:"Saat",Title:"Başlık",Owner:"Sahibi",Action:"Eylem",Rename:"Yeniden Adlandır",Location:"Konum",Latitude:"Enlem",Month:"Ay",Day:"Gün",Hour:"Saat",Daylight:"Gün Işığı",Radiation:"Işınım",Temperature:"Sıcaklık",kWh:"kWh",dollar:"dollar",MeterPerSecond:"m/s",NorthInitial:"N",SouthInitial:"S",EastInitial:"E",WestInitial:"W",Fixed:"Sabit",Elements:"Öğeler",Energy:"Energy",Unknown:"Unknown",Label:"Label",Description:"Description",NoDescription:"No description",MaximumCharacters:"Maximum characters",Author:"Author",Publisher:"Publisher",Building:"Building",ResidentialBuilding:"Residential Building",CommercialBuilding:"Commercial Building",SchoolBuilding:"School Building",TouristAttraction:"Tourist Attraction",UnderConstruction:"Under Construction",Photovoltaic:"Photovoltaic",WindPower:"Wind Power",ColocationProjects:"Colocation Projects",Anonymous:"Anonymous",Nickname:"Nickname",Pin:"Pin",Unpin:"Unpin"},shared:{NoTexture:"Doku Yok",FoundationElement:"Temel",CuboidElement:"Kübik",PolygonElement:"Poligon",SensorElement:"Sensör",SolarPanelElement:"Güneş Paneli",WaterHeaterElement:"Su Isıtıcı",ParabolicDishElement:"Parabolik Çanak",ParabolicTroughElement:"Parabolik Oluk",FresnelReflectorElement:"Fresnel Reflektör",HeliostatElement:"Heliostat",WindTurbineElement:"Wind Turbine",LightElement:"Light",ElementLocked:"Kilitli",ModelType:"Model Type",OutputBreakdown:"Breakdown",MoreResults:"More Results"},message:{NewVersionAvailable:"A new version is available",CalculationMayBeSlowDoYouWantToContinue:"Calculation may be slow. Do you want to continue?",IncreaseSolarRadiationHeatmapGridCellSizeToSpeedUp:"Increase solar radiation heatmap grid cell size to speed up",ModelNotFound:"Model not found",CannotSignIn:"Oturum açılamıyor",CannotSignOut:"Çıkış yapılamıyor",YourAccountWasCreated:"Hesabınız oluşturuldu",CannotCreateAccount:"Hesap oluşturulamıyor",YourAccountSettingsWereSaved:"Hesap ayarlarınız kaydedildi.",CannotSaveYourAccountSettings:"Hesap ayarlarınız kaydedilemiyor",CannotSaveYourFileToCloud:"Dosyanız buluta kaydedilemiyor",CannotCreateNewProject:"Cannot create a new project",CannotCreateNewProjectWithoutTitle:"Cannot create a new project without a title",CannotOpenYourProjects:"Cannot open your projects",CannotOpenProject:"Cannot open the project",CannotDeleteProject:"Cannot delete the project",CannotRenameProject:"Cannot rename the project",CannotAddDesignToProject:"Cannot add this design to the project",CannotAddDesignToProjectOwnedByOthers:"Cannot add this design to a project owned by others",DesignRemovedFromProject:"The design was successfully removed from the project",CannotRemoveDesignFromProject:"Cannot remove this design from the project",CannotUpdateProject:"Cannot update the project",CannotFetchProjectData:"Cannot fetch project data",TitleUsedChooseDifferentOne:"This title has been used. Choose a different one",CloudFileWithTitleExistsDoYouWantToOverwrite:"A cloud file with the title exists. Do you want to overwrite it?",CloudFileNotFound:"Bulut dosyası bulunamadı",CannotLoadModelsOnMap:"Cannot load models on map",CannotLoadLeaderboard:"Cannot load leaderboard",CannotPublishModelOnMap:"Cannot publish model on map",CannotLikeModelFromMap:"Cannot like model from map",CannotDeleteModelFromMap:"Cannot delete model from map",ModelDeletedFromMap:"Model is deleted from map",DoYouWantToDeleteModelFromMap:"Do you want to delete the model from map?",CannotOpenCloudFile:"Bulut dosyası açılamıyor",CannotReadCloudFile:"Cannot read the cloud file",CannotWriteCloudFile:"Cannot write the cloud file",CloudFileCopied:"Cloud file copied",CannotOpenCloudFolder:"Bulut klasörünüz açılamıyor",CannotDeleteCloudFile:"Bulut dosyası silinemiyor",CannotRenameCloudFile:"Bulut dosyası yeniden adlandırılamıyor",DoYouWantToSaveChanges:"Değişiklikleri kaydetmek istiyor musunuz?",NotApplicableToSelectedAction:"Seçili eyleme uygulanamaz",ThisElementIsLocked:"Bu öğe kilitli.",ThisCannotBeUndone:"Geri alınamaz.",AzimuthOfNorthIsZero:"Kuzey yönünün azimut açısı 0 ° derecedir.",CounterclockwiseAzimuthIsPositive:"Saat yönünün tersi yönde azimut açısı pozitiftir.",SouthFacingIsZero:"South-facing is 0°",ClockwiseRotationIsPositive:"Clockwise is positive",MoveCancelledBecauseOfOverlap:"Çakışma nedeniyle taşıma iptal edildi.",MoveOutsideBoundaryCancelled:"Alan dışına çıkan taşıma iptal edildi.",RotationCancelledBecauseOfOverlap:"Çakışma nedeniyle döndürme iptal edildi.",RotationOutsideBoundaryCancelled:"Alan dışı döndürme iptal edildi.",ResizingCancelledBecauseOfOverlap:"Çakışma nedeniyle yeniden boyutlandırma iptal edildi.",ResizingOutsideBoundaryCancelled:"Alan dışında yeniden boyutlandırma iptal edildi.",CannotPasteOutsideBoundary:"Alanın dışına yapıştırılamaz.",CannotPasteBecauseOfOverlap:"Çakışma nedeniyle yapıştırılamıyor.",CannotMoveObjectTooFar:"Nesne buraya taşınamaz.",ExistingSolarPanelsWillBeRemovedBeforeApplyingNewLayout:"Yeni yerleşim düzeni uygulanmadan önce mevcut güneş panelleri kaldırılacaktır.",DoYouWantToContinue:"Devam etmek istiyor musunuz?",SolarPanelsCannotIntersectWithGround:"Güneş panelleri zeminle kesişemez.",SolarPanelsCannotOverlapWithOneAnother:"Güneş panelleri birbiriyle örtüşemez.",ScreenshotSaved:"Ekran görüntüsü kaydedildi.",CsvFileSaved:"A CSV file was saved.",SimulationStarted:"Simülasyon başladı.",SimulationCompleted:"Simülasyon tamamlandı.",SimulationAborted:"Simülasyon iptal edildi.",SimulationPaused:"Simülasyon duraklatıldı.",CancelSimulation:"Simülasyonu iptal et",PauseSimulation:"Simülasyonu duraklat",ResumeSimulation:"Simülasyonu devam ettir",SimulationWillNotStartDueToErrors:"Simulation will not start due to errors",SimulationWillStartDespiteWarnings:"Simulation will start despite warnings.",EvolutionStarted:"Evrim başladı.",EvolutionCompleted:"Evrim tamamlandı.",EvolutionAborted:"Evrim iptal edildi.",EvolutionPaused:"Evrim duraklatıldı.",EncounterEvolutionError:"Evrim hatasıyla karşılaşıldı.",CancelEvolution:"Evrimi iptal et",PauseEvolution:"Evrimi duraklat",ResumeEvolution:"Evrime devam et",ConvergenceThresholdHasBeenReached:"Yakınsama eşiğine ulaşıldı.",MaximumNumberOfGenerationsHasBeenReached:"Maksimum nesil sayısına ulaşıldı.",MaximumNumberOfStepsHasBeenReached:"Maksimum adım sayısına ulaşıldı.",ObjectiveFunctionTypeError:"Geçerli işlev desteklenmiyor. Lütfen menüden başlatınız.",WallsAreNotAtSameHeight:"Walls are not at same height.",WallsAreNotPerpendicular:"Walls are not perpendicular.",WallsAreNotConnected:"Walls are not connected.",WallsNumberNeedToBeFour:"The number of walls needs to be four.",BuildingContainsEmptyWall:"Building contains one or more empty wall.",BuildingRoofMissing:"Building has a missing roof.",UnknownErrors:"Unknown errors."},menu:{AnalysisOptions:"Analiz Seçenekleri",option:{GridCellSize:"Hücre Boyutu",SamplingFrequency:"Örneklem Frekansı",TimesPerHour:"x 1/saat",DaysPerYear:"Gün Sayısı / Yıl"},mainMenu:"Ana Menü",cloudMenu:"Bulut Menüsü",projectSubMenu:"Project",project:{CreateNewProject:"Create New Project",OpenProject:"Open Project",SaveProject:"Save Project",SaveProjectAs:"Save Project As",YouMustLogInToCreateProject:"You must log in to create a new project",YouMustLogInToOpenProject:"You must log in to open a project"},fileSubMenu:"Dosya",file:{CreateNewFile:"Yeni Dosya Oluştur",OpenLocalFile:"Yerel Dosya Aç",SaveAsLocalFile:"Yerel Dosya Olarak Kaydet",SavingAbortedMustHaveValidFileName:"Kaydetme iptal edildi! Geçerli bir dosya adı kullanınız.",OpenCloudFile:"Bulut Dosyası Aç",SaveCloudFile:"Bulut Dosyasını Kaydet",SaveAsCloudFile:"Bulut Dosyası Olarak Kaydet",SavingAbortedMustHaveValidTitle:"Kaydetme iptal edildi! Dosya adı geçersiz!",ToSaveYourWorkPleaseSignIn:"Çalışmanızı kaydetmek için lütfen oturum açınız.",TakeScreenshot:"Ekran görüntüsü al",UseCloudFileName:"Bulut Dosya Adını Kullan",PublishOnModelsMap:"Publish on Models Map",PublishedOnModelsMap:"Your model has been published on the Models Map",UpdatedOnModelsMap:"Your model has been updated on the Models Map",YouMustLogInToPublishYourModel:"You must log in to publish your model",YouCannotPublishAModelThatYouDoNotOwn:"You cannot publish a model that you do not own",YouMustSaveModelOnCloudBeforePublishingIt:"You must save the model on the cloud before publishing it"},editSubMenu:"Düzen",edit:{Undo:"Geri Al",Redo:"Yinele"},viewSubMenu:"Görünüm",view:{NavigationView:"Navigation View",TwoDimensionalView:"2D",ResetView:"Yenile",ZoomIn:"Yaklaş",ZoomOut:"Uzaklaş",AutoRotate:"Otomatik Döndür",ShowShadow:"Gölge",ShowSurfaceShininess:"Show Surface Shininess",TranslucentFloatingWindows:"Yüzer Pencere",accessoriesSubMenu:"Accessories",accessories:{SiteInformation:"Konum Bilgisi",DesignInformation:"Izgara Hücre Sayısı",Instruction:"Yardım",StickyNote:"Notlar",Note:"Notlar"}},settingsSubMenu:"Settings",settings:{WeatherData:"Hava Durumu",DiurnalTemperature:"Günlük Sıcaklık",Heliodon:"Heliodon",SunAndTime:"Güneş & Zaman"},benchmarksSubMenu:"Deneysel",benchmarks:{SolarRadiationPredictionVsMeasurement:"Güneş Işınım Tahmini Vs. Ölçümü ",BESTESTCase600:"Building Energy Simulation Test: BESTEST Case 600",BESTESTCase610:"Building Energy Simulation Test: BESTEST Case 610",BESTESTCase620:"Building Energy Simulation Test: BESTEST Case 620",BESTESTCase630:"Building Energy Simulation Test: BESTEST Case 630"},graph:{LineWidth:"Çizgi Kalınlığı",SymbolSize:"Sembol Boyutu",BarCategoryGap:"Bar Category Gap",ShowHorizontalGridLines:"Yatay Izgara Çizgilerini Göster",ShowVerticalGridLines:"Dikey Izgara Çizgilerini Göster"},analysisSubMenu:"Analiz",physicsSubMenu:"Fizik",physics:{DailySolarRadiationHeatmap:"Günlük Isı Haritası",SolarRadiationHeatmapOptions:"Isı Haritası Seçenekleri",SolarRadiationHeatmapGridCellSize:"Hücre Boyutu",SolarRadiationHeatmapMaxValue:"Işınım Maksimum Değer",SolarRadiationHeatmapNoAnimation:"Animasyon Yok",ReflectionHeatmap:"Yansıma Isı Haritası"},sensorSubMenu:"Sensörler",sensor:{CollectDailyData:"Günlük Veri Topla",CollectYearlyData:"Yıllık Veri Topla",SensorSimulationNoAnimation:"Animasyon Yok"},buildingSubMenu:"Building",building:{AnalyzeDailyBuildingEnergy:"Analyze Daily Building Energy",AnalyzeYearlyBuildingEnergy:"Analyze Yearly Building Energy",EnergyAnalysisOptions:"Energy Analysis Options",EnergyGridCellSize:"Energy Grid Cell Size",BuildingEnergySimulationNoAnimation:"No Animation for Building Energy Simulation"},solarPanelSubMenu:"Güneş Panelleri",solarPanel:{AnalyzeDailyYield:"Günlük Üretim Analizi",AnalyzeYearlyYield:"Yıllık Üretim Analizi",AnalyzeVisibility:"Görünüm Analizi",PanelDiscretization:"Panel Ayrıklaştırma",Exact:"Kesin",Approximate:" Yaklaşık",EnergyGridCellSize:"Hücre Boyutu",VisibilityGridCellSize:"Hücre Boyutu",EnergyAnalysisOptions:"Enerji Analiz Seçenekleri",VisibilityAnalysisOptions:"Görünüm Analiz Seçenekleri",SolarPanelSimulationNoAnimation:"Animasyon Yok"},parabolicTroughSubMenu:"Parabolik Oluk",parabolicTrough:{AnalyzeDailyYield:"Günlük Üretim Analizi",AnalyzeYearlyYield:"Yıllık Üretim Analizi"},parabolicDishSubMenu:"Parabolik Çanak",parabolicDish:{AnalyzeDailyYield:"Günlük Üretim Analizi",AnalyzeYearlyYield:"Yıllık Üretim Analizi"},fresnelReflectorSubMenu:"Fresnel Yansıtıcı",fresnelReflector:{AnalyzeDailyYield:"Günlük Üretim Analizi",AnalyzeYearlyYield:"Yıllık Üretim Analizi"},heliostatSubMenu:"Heliostat",heliostat:{AnalyzeDailyYield:"Günlük Üretim Analizi",AnalyzeYearlyYield:"Yıllık Üretim Analizi"},solarUpdraftTowerSubMenu:"Solar Updraft Kulesi",solarUpdraftTower:{AnalyzeDailyYield:"Günlük Üretim Analizi",AnalyzeYearlyYield:"Yıllık Üretim Analizi",SolarUpdraftTowerSimulationNoAnimation:"Animasyon Yok"},tutorialsSubMenu:"Öğrenme Merkezi",solarEnergyScienceSubMenu:"Güneş Bilimi",solarEnergyScienceTutorials:{SunAngles:"Gözlemciye Göre Güneş Açıları",InsolationAndClimate:"Güneşlenme ve İklim",SolarRadiationToBox:"Kutu Güneş Işınımı"},buildingScienceSubMenu:"Building Science",buildingScienceTutorials:{ThermalEnvelopeVsBuildingEnvelope:"Thermal Envelope vs. Building Envelope",EffectOfSizeOnBuildingEnergy:"Effect of Size on Building Energy",EffectOfOrientationOnBuildingEnergy:"Effect of Orientation on Building Energy",EffectOfInsulationOnBuildingEnergy:"Effect of Insulation on Building Energy",EffectOfRoofColorOnBuildingEnergy:"Effect of Roof Color on Building Energy",EffectOfEavesOverhangLengthOnBuildingEnergy:"Effect of Eaves Overhang Length on Building Energy",EffectOfWindowSHGCOnBuildingEnergy:"Effect of Window Solar Heat Gain on Building Energy",EffectOfThermostatSetpointOnBuildingEnergy:"Effect of Thermostat Setpoint on Building Energy",EffectOfSolarPanelsOnBuildingEnergy:"Effect of Solar Panels on Building Energy",EffectOfGroundTemperatureOnBuildingEnergy:"Effect of Ground Temperature on Building Energy",EffectOfTreesOnBuildingEnergy:"Effect of Trees on Building Energy"},buildingDesignSubMenu:"Bina Tasarımı",buildingDesignTutorials:{CapeCodStyleHouseWithShedDormer:"Çatı Pencereli Cape Cod Evi",MansardRoofWithDormers:"Mansard Roof with Dormers",GableRoofVsHipRoof:"Beşik Çatı vs. Kırma Çatı",ColonialVsSaltbox:"Koloni vs. Tuz Kutusu",GambrelRoofVsMansardRoof:"Flemenk Çatı vs. Mansart Çatı",CombinationRoofVsBonnetRoof:"Combination Roof vs. Bonnet Roof",DutchGableRoof:"Dutch Gable Roof",GableAndValleyRoof:"Gable and Valley Roof",ClerestoryRoof:"Clerestory Roof",MonitorRoof:"Monitor Roof",AFrameHouse:"A-Frame House",HalfTimberedHouse:"Half-Timbered House",AllBasicRoofTypes:"Tüm Çatı Tipleri"},photovoltaicSolarPowerSubMenu:"Fotovoltaik Güneş Enerjisi",photovoltaicSolarPowerTutorials:{EffectOfTiltAngleOfSolarPanel:"Güneş Paneli Eğim Açısı Etkisi",EffectOfAzimuthOfSolarPanel:"Güneş Paneli Azimut Açısı Etkisi",SolarPanelTypes:"Solar Panel Types",VerticalBifacialSolarPanels:"Vertical Bifacial Solar Panels",CompareMonofacialAndBifacialSolarPanels:"Monofacial vs. Bifacial Solar Panels",SolarTrackers:"Güneş İzleyiciler",CoveringGroundWithSolarPanels:"Sadece güneş panellerini kullanarak yüzeyi kaplamak neden iyi bir fikir değildir?",InterRowSpacingOfSolarPanelArray:"Güneş Paneli Dizi Arası Boşluk Etkisi",EffectOfOrientationOfSolarPanels:"Güneş Panelleri Yön Etkisi",SolarPanelArrayAutomaticLayout:"Solar Panel Array Automatic Layout"},concentratedSolarPowerSubMenu:"Yoğunlaştırılmış Güneş Enerjisi",concentratedSolarPowerTutorials:{EffectOfAzimuthOfParabolicTrough:"Parabolik Oluk Azimut Açısı Etkisi",EffectOfLatusRectumOfParabolicTrough:"Parabolik Oluk Özkiriş Etkisi",FocusSunlightWithParabolicDish:"Güneş Işığını Parabolik Çanakla Odaklama",LinearFresnelReflectors:"Doğrusal Fresnel Reflektörler",EffectOfAbsorberPipeHeightForLinearFresnelReflectors:"Doğrusal Fresnel Reflektörlerde Soğurucu Boru Yükseklik Etkisi",EffectOfAzimuthOfLinearFresnelReflectors:"Doğrusal Fresnel Reflektörlerde Azimut Açısı Etkisi",LinearFresnelReflectorsWithTwoAbsorbers:"İki Soğuruculu Doğrusal Fresnel Reflektörler",CosineEfficiencyOfHeliostats:"Heliostatların Kosinüs Verimliliği",ShadowingAndBlockingOfHeliostats:"Heliostatlarda Gölgeleme ve Engellenme",EffectSolarPowerTowerHeight:"Güneş Güç Kulesi Yükseklik Etkisi",SolarPowerTower:"Güneş Güç Kulesi"},otherTypesOfSolarPowerSubMenu:"Diğer Güneş Gücü Türleri",otherTypesOfSolarPowerTutorials:{SolarUpdraftTower:"Solar Updraft Kulesi"},windPowerSubMenu:"Wind Power",windPowerTutorials:{EffectOfBladeNumberOfWindTurbine:"Effect of Blade Number of Wind Turbine",EffectOfPitchAngleOfWindTurbineBlades:"Effect of Pitch Angle of Wind Turbine Blades",BirdSafeBladeDesign:"Bird-Safe Blade Design",OffshoreWindFarm:"Offshore Wind Farm"},colocationSubMenu:"Colocation",colocationTutorials:{AgricultureSolarWindColocation:"Agriculture-Solar-Wind Colocation"},generativeDesignSubMenu:"Generative Design",generativeDesignTutorials:{MonofacialSolarPanelArrayTiltAngle:"The Tilt Angle of a Monofacial Solar Panel Array",BifacialSolarPanelArrayTiltAngle:"The Tilt Angle of a Bifacial Solar Panel Array",OutputOfSolarPanelArrayInDifferentPlaces:"The Output of a Solar Panel Array in Different Places",SimpleSolarFarmParetoFront:"The Pareto Front for Designing a Simple Solar Farm"},examplesSubMenu:"Örnekler",solarEnergySubMenu:"Güneş Enerjisi",solarEnergyExamples:{SunBeamAndHeliodon:"Güneş Işını ve Heliodon",RooftopSolarPanels:"Çatı Üstü Güneş Panelleri",NevadaSolarOneParabolicTroughArray:"Nevada Eyaletinde Parabolik Oluk Dizisi",TooeleParabolicDishArray:"Tooele Şehrinde Parabolik Çanak Dizisi",PS10SolarPowerTower:"PS10 Güneş Güç Kulesi",TucsonLinearFresnelReflectors:"Tucson Şehrinde Doğrusal Fresnel Reflektörleri",SolarCanopyFormFactors:"Solar Gölgelik Biçim Etkileri",SolarCanopyOverBleachers:"Tirübün Üzeri Solar Gölgelik",SolarCanopyOverGarage:"Solar Canopy Over Garage",SolarBusStop:"Solar Otobüs Durağı",SolarFacadeTesla:"Tesla Solar Façade",BuildingIntegratedPhotovoltaics:"Building-Integrated Photovoltaics",Floatovoltaics:"Floatovoltaics",Agrivoltaics:"Agrivoltaics",VegetativeBuffer:"Bitkisel Tampon",RainbowSwashSolarFarmBostonMA:"Rainbow Swash Solar Farm in Boston, MA",MickeyMouseSolarFarmOrlandoFL:"Mickey Mouse Solar Farm in Orlando, FL",SolarPanelsOverCanalBakersfieldCA:"Bakersfield Şehrinde Kanal Üzerindeki Varsayımsal Güneş Panelleri",SolarNoiseBarrierLexingtonMA:"Lexington Kasabasında Varsayımsal Güneş Gürültü Bariyeri",HSATSolarTrackersRaleighNC:"Raleigh Şehrinde Yatay Tek Eksenli İzleyiciler (HSAT)",AADATSolarTrackersLancasterCA:"Lancaster Şehrinde Azimut–İrtifa Çift Eksenli İzleyiciler (AADAT)",SolarUpdraftTowerInCity:"Şehir Solar Updraft Kulesi"},builtEnvironmentSubMenu:"Yapılı Çevre",residentialBuildingsSubMenu:"Konut inşaatları",residentialBuildingExamples:{ColonialHouse:"Colonial House",DutchColonialHouse:"Flemenk Koloni Evi",TShapedHouse:"T-Shaped House",CapeCodHouseWithGarage:"Cape Cod House with Garage",Solarium:"Solaryum",Church1:"Kilise 1",Cathedral1:"Cathedral 1",Cathedral2:"Cathedral 2",Mosque1:"Mosque 1",AdobeTaosHouse:"Adobe Taos House",RanchHouse:"Ranch House",BonnetHouse:"Bonnet House",BarnStyleHouse:"Çiftlik Evi",ModernHouse:"Modern House",ButterflyRoofHouse:"Butterfly Roof House"},commercialBuildingsSubMenu:"Ticari Binalar",commercialBuildingExamples:{WhiteHouse:"White House",HaroldWashingtonCollege:"Harold Washington College",BilimMersinTurkiye:"Yenişehir Belediyesi Bilim ve Sanat Merkezi",SpanishStyleHotel:"Spanish Style Hotel",ApartmentBuilding:"Apartment Building",OfficeBuilding:"Ofis Binası",Hotel:"Hotel"},buildingComplexesSubMenu:"Building Complexes",buildingComplexExamples:{SouthBurlingtonHighSchoolVermont:"Güney Burlington Lisesi",MescaleroApacheSchoolNewMexico:"Mescalero Apache School, NM"},urbanPlanningSubMenu:"Şehir Planlaması",urbanPlanningExamples:{CityBlockHeatmap:"City Block Heatmap",ChicagoSkyline:"Chicago Skyline"},otherBuildingsSubMenu:"Other Buildings",otherBuildingExamples:{Greenhouse:"Sera",Pavilion:"Park Kamelyası",OctagonalPagoda:"Octagonal Pagoda",OceanFront:"Ocean Front",EgyptianPyramids:"Egyptian Pyramids",MayanPyramid:"Mayan Pyramid",SiOSePol:"Si-o-se-pol",StackedCuboids:"Stacked Cuboids"},artificialIntelligenceSubMenu:"Yapay Zeka",artificialIntelligenceExamples:{OptimizingTiltAngleOfOneSolarPanelRow:"Güneş Paneli Sıra Eğim Açısı Optimize Etme",OptimizingTiltAnglesOfMultipleSolarPanelRows:"Çoklu Güneş Paneli Sıra Eğim Açısı Optimize Etme",SolarFarmGenerativeDesign:"Güneş Tarlası Tasarımı",SolarFarmGenerativeDesignWithBlock:"Blok Varlığında Güneş Tarlası Tasarımı",FitchburgSolarFarmGenerativeDesign:"Fitchburg Güneş Tarlası Tasarımı"},languageSubMenu:"Dil",publicSubMenu:"Public",ModelsGallery:"Models Gallery",ModelsMap:"Models Map",AboutUs:"Hakkımızda"},avatarMenu:{AccountSettings:"Hesap Ayarları",PrivacyStatementTitle:"User Privacy Protection Statement",PrivacyStatement:"Oturum açtığınızda, Aladdin hesabınızı oluşturmak ve hesabınıza erişmek için Google Kimliğiniz kullanılır. Veritabanımızda referans olarak yalnızca rastgele bir alfasayısal dize depolanır. Adınız veya e-posta adresiniz gibi kişisel olarak tanımlanabilir hiçbir veri toplanmaz. Daha fazla bilgi için ",SignIn:"Kayıt Ol",SignOut:"Oturum Kapat",IfYouAreAStudent:"Eğer Öğrenciyseniz"},skyMenu:{Axes:"Eksenler",Theme:"Tema",ThemeDefault:"Varsayılan",ThemeDesert:"Çöl",ThemeDune:"Dune",ThemeForest:"Orman",ThemeGrassland:"Çayır",ThemeHill:"Hill",ThemeLake:"Lake",ThemeMountain:"Mountain",ThemeRural:"Rural",SunlightAttenuationCoefficientInAir:"Havan Güneş Işığı Zayıflatma Katsayısı",ConvectiveCoefficientOfAir:"Havan Isı İletkenlik Katsayısı",HighestTemperatureTimeInMinutes:"En Yüksek Sıcaklık Süresi (Dakika)",SelectSunAnglesToShow:"Gösterilecek Güneş Açılarını Seçin",ShowAzimuthAngle:"Azimut Açısını Göster",ShowElevationAngle:"Yükselme Açısını Göster",ShowZenithAngle:"Zenit Açısını Göster",DirectLightBrightnessAtNoon:"Direct Light Brightness at Noon",AmbientLightBrightnessAtNoon:"Ambient Light Brightness at Noon"},groundMenu:{MonthlyIrradianceLoss:"Monthly Irradiance Loss",Vegetation:"Vegetation",LeafOutDay:"Leaf-Out Day",LeafOffDay:"Leaf-Off Day",Albedo:"Albedo",ImageOnGround:"Yer Görüntüsü",WaterSurface:"Water Surface",RemoveAllUnlockedTrees:"Tüm Ağaçları Kaldır",RemoveAllUnlockedFlowers:"Remove All Unlocked Flowers",RemoveAllUnlockedSolarPanels:"Remove All Unlocked Solar Panels",RemoveAllUnlockedPeople:"Tüm Kişileri Kaldır",RemoveAllUnlockedFoundations:"Tüm Temelleri Kaldır",RemoveAllUnlockedCuboids:"Tüm Kübikleri Kaldır",DoYouReallyWantToRemoveAllPeople:"Tüm Kişileri Kaldırmak İstiyor Musunuz?",DoYouReallyWantToRemoveAllTrees:"Tüm Ağaçları Kaldırmak İstiyor Musunuz?",DoYouReallyWantToRemoveAllFlowers:"Do you really want to remove all the flowers that are not locked",DoYouReallyWantToRemoveAllSolarPanels:"Do you really want to remove all the solar panels that are not locked",DoYouReallyWantToRemoveAllFoundations:"Tüm Temelleri Kaldırmak İstiyor Musunuz?",DoYouReallyWantToRemoveAllCuboids:"Tüm Kübikleri Kaldırmak İstiyor Musunuz?",LockAllUnlockedElements:"Lock All Unlocked Elements",UnlockAllLockedElements:"Unlock All Locked Elements"},labelSubMenu:{Label:"Etiket",LabelText:"Label Text",LabelHeight:"Label Height",LabelSize:"Label Size",LabelFontSize:"Font Size",LabelColor:"Label Color",KeepShowingLabel:"Etiketi Göstermeye Devam Et"},foundationMenu:{RemoveAllUnlockedSolarPanels:"Tüm Kilitlenmemiş Güneş Panellerini Kaldır",RemoveAllUnlockedParabolicTroughs:"Tüm Kilitlenmemiş Parabolik Olukları Kaldır",RemoveAllUnlockedParabolicDishes:"Tüm Kilitlenmemiş Parabolik Çanakları Kaldır",RemoveAllUnlockedFresnelReflectors:"Tüm Kilitlenmemiş Fresnel Reflektörleri Kaldır",RemoveAllUnlockedHeliostats:"Tüm Kilitlenmemiş Heliostatları Kaldır",RemoveAllUnlockedWindTurbines:"Remove All Unlocked Wind Turbines",RemoveAllUnlockedSensors:"Tüm Kilitlenmemiş Sensörleri Kaldır",RemoveAllUnlockedLights:"Remove All Unlocked Lights",RemoveAllUnlockedWalls:"Tüm Kilitlenmemiş Duvarları Kaldır",RemoveAllUnlockedWindows:"Remove All Unlocked Windows",RemoveAllUnlockedDoors:"Remove All Unlocked Doors",RemoveAllUnlockedPolygons:"Tüm Kilitlenmemiş Çokgenleri Kaldır",RemoveAllUnlockedHumans:"Tüm Kilitlenmemiş İnsanları Kaldır",RemoveAllUnlockedTrees:"Tüm Kilitlenmemiş Ağaçları Kaldır",RemoveAllUnlockedFlowers:"Remove All Unlocked Flowers",Racks:"Çerçeveler",Texture01:"Doku 1",Texture02:"Doku 2",Texture03:"Doku 3",Texture04:"Doku 4",Texture05:"Doku 5",Texture06:"Doku 6",Texture07:"Doku 7",Texture08:"Doku 8",Texture09:"Doku 9",Texture10:"Doku 10",SolarPanels:"Güneş Panelleri",SolarPanelArray:"Solar Panel Array",DoYouReallyWantToRemoveAllSolarPanelsOnFoundation:" Seçili temel üzerindeki tüm güneş panellerini kaldırmak istiyor musunuz?",ParabolicTroughs:"Parabolik Oluklar",DoYouReallyWantToRemoveAllParabolicTroughsOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm parabolik olukları kaldırmak istiyor musunuz?",ParabolicDishes:"Parabolik Çanaklar",DoYouReallyWantToRemoveAllParabolicDishesOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm parabolik çanakları kaldırmak istiyor musunuz?",FresnelReflectors:"Fresnel Reflektörler",DoYouReallyWantToRemoveAllFresnelReflectorsOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm Fresnel reflektörlerini kaldırmak istiyor musunuz?",Heliostats:"Heliostatlar",DoYouReallyWantToRemoveAllHeliostatsOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm heliostatları kaldırmak istiyor musunuz?",WindTurbines:"Wind Turbines",DoYouReallyWantToRemoveAllWindTurbinesOnFoundation:"Do you really want to remove all the wind turbines on this foundation that are not locked",Sensors:"Sensörler",DoYouReallyWantToRemoveAllSensorsOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm sensörleri kaldırmak istiyor musunuz?",Lights:"Lights",DoYouReallyWantToRemoveAllLightsOnFoundation:"Do you really want to remove all the lights on this foundation that are not locked",Walls:"Duvarlar",DoYouReallyWantToRemoveAllWallsOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm duvarları kaldırmak istiyor musunuz? ",Windows:"Windows",DoYouReallyWantToRemoveAllWindowsOnFoundation:"Do you really want to remove all the windows on this foundation that are not locked",Doors:"Doors",DoYouReallyWantToRemoveAllDoorsOnFoundation:"Do you really want to remove all the doors on this foundation that are not locked",Polygons:"Poligonlar",DoYouReallyWantToRemoveAllPolygonsOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm poligonları kaldırmak istiyor musunuz?",Humans:"Kişiler",DoYouReallyWantToRemoveAllHumansOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm insanları kaldırmak istiyor musunuz?",Trees:"Ağaçlar",DoYouReallyWantToRemoveAllTreesOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm ağaçları kaldırmak istiyor musunuz?",Flowers:"Flowers",DoYouReallyWantToRemoveAllFlowersOnFoundation:"Do you really want to remove all the flowers on this foundation that are not locked",OnlyThisFoundation:"Sadece Seçili Temel",AllConnectedFoundations:"Tüm Bağlantılı Temeller",AllSelectedFoundations:"All Selected Foundations",AllFoundations:"Tüm Temeller",AddPolygon:"Poligon Ekle",SolarStructure:"Solar Yapı Seçin",GroupMaster:"Grup Yöneticisi",LockAllUnlockedElementsOnThisFoundation:"Lock All Unlocked Elements on This Foundation",UnlockAllLockedElementsOnThisFoundation:"Unlock All Locked Elements on This Foundation",GroundFloorRValue:"Ground Floor R-Value",OnlyThisGroundFloor:"Only This Ground Floor",AllGroundFloors:"All Ground Floors"},solarPowerTowerMenu:{ReceiverTowerForHeliostats:"Heliostat Alıcı Kulesi",ReceiverTowerPhysicalProperties:"Alıcı Kule Fiziksel Özellikler",ReceiverTowerHeight:"Alıcı Kule Yükseklik",ReceiverTowerRadius:"Alıcı Kule Yarıçap",ReceiverAbsorptance:"Alıcı Absorbsiyon",ReceiverOpticalEfficiency:"Alıcı Optik Verim",ReceiverThermalEfficiency:"Alıcı Termal Verim"},solarAbsorberPipeMenu:{AbsorberPipeForFresnelReflectors:"Fresnel Reflektör Soğurucu Boru",AbsorberPipePhysicalProperties:"Soğurucu Boru Fiziksel Özellikler",AbsorberHeight:"Soğurucu Boru Yükseklik",AbsorberApertureWidth:"Soğurucu boru diyafram genişliği",AbsorberPipePoleNumber:"Soğurucu Boru Sayısı",AbsorberAbsorptance:"Soğurucu Absorbsiyonu",AbsorberOpticalEfficiency:"Soğurucu Optik Verimlilik",AbsorberThermalEfficiency:"Soğurucu Isıl Verimlilik"},solarUpdraftTowerMenu:{SolarUpdraftTower:"Solar Updraft Kulesi",SolarUpdraftTowerPhysicalProperties:"Solar Updraft Kulesi Fiziksel Özellikler",SolarUpdraftTowerChimneyHeight:"Solar Updraft Kulesi Baca Yüksekliği",SolarUpdraftTowerChimneyRadius:"Solar Updraft Kulesi Baca Yarıçapı",SolarUpdraftTowerCollectorHeight:"Solar Updraft Kulesi Collector Height",SolarUpdraftTowerCollectorRadius:"Solar Updraft Kulesi Kollektör Yarıçapı",SolarUpdraftTowerCollectorTransmissivity:"Solar Updraft Kulesi Kollektör Geçirgenliği",SolarUpdraftTowerCollectorEmissivity:"Solar Updraft Kulesi Kollektör Emisivite",SolarUpdraftTowerDischargeCoefficient:"Solar Updraft Kulesi Deşarj Katsayısı",SolarUpdraftTowerTurbineEfficiency:"Solar Updraft Kulesi Türbin Verimliliği"},cuboidMenu:{Texture01:"Doku 1",Texture02:"Doku 2",Texture03:"Doku 3",Texture04:"Doku 4",Texture05:"Doku 5",Texture06:"Doku 6",Texture07:"Doku 7",Texture08:"Doku 8",Texture09:"Doku 9",Texture10:"Doku 10",RemoveAllUnlockedSolarPanels:"Tüm Kilitlenmemiş Güneş Panellerini Kaldır",RemoveAllUnlockedSensors:"Tüm Kilitlenmemiş Sensörleri Kaldır",RemoveAllUnlockedPolygons:"Tüm Kilitlenmemiş Poligonları Kaldır",RemoveAllUnlockedHumans:"Tüm Kilitlenmemiş Kişileri Kaldır",RemoveAllUnlockedTrees:"Tüm Kilitlenmemiş Ağaçları Kaldır",RemoveAllUnlockedFlowers:"Remove All Unlocked Flowers",RemoveAllUnlockedLights:"Remove All Unlocked Lights",Racks:"Çerçeveler",Lights:"Lights",DoYouReallyWantToRemoveAllLightsOnCuboid:"Do you really want to remove all the lights on this cuboid that are not locked",SolarPanels:"Güneş Panelleri",DoYouReallyWantToRemoveAllSolarPanelsOnCuboid:" Seçili kübik üzerinde kilitlenmemiş tüm güneş panellerini kaldırmak istiyor musunuz?",Sensors:"Sensörler",DoYouReallyWantToRemoveAllSensorsOnCuboid:" Seçili kübik üzerinde kilitlenmemiş tüm sensörleri kaldırmak istiyor musunuz?",Polygons:"Poligonlar",DoYouReallyWantToRemoveAllPolygonsOnCuboid:" Seçili kübik üzerinde kilitlenmemiş tüm poligonları kaldırmak istiyor musunuz?",Humans:"İnsanlar",DoYouReallyWantToRemoveAllHumansOnCuboid:" Seçili kübik üzerinde kilitlenmemiş tüm insanları kaldırmak istiyor musunuz?",Trees:"Ağaçlar",DoYouReallyWantToRemoveAllTreesOnCuboid:" Seçili kübik üzerinde kilitlenmemiş tüm ağaçları kaldırmak istiyor musunuz?",Flowers:"Flowers",DoYouReallyWantToRemoveAllFlowersOnCuboid:"Do you really want to remove all the flowers on this cuboid that are not locked",OnlyThisCuboid:"Sadece Seçili Kübik",AllCuboidsOnSameSurface:"All Cuboids on Same Surface",AllCuboidsAboveSameBase:"All Cuboids above Same Base",AllSelectedCuboids:"All Selected Cuboids",AllCuboids:"Tüm Kübikler",OnlyThisSide:"Sadece Seçili Yüzey",AllSidesOfThisCuboid:"Seçili Kübik Tüm Yüzeyler",AllSidesOfSelectedCuboids:"All Sides of Selected Cuboids",AllSidesOfAllCuboids:"Bütün Kübik Yüzeyleri ",AddPolygon:"Poligon Ekle",Stackable:"Stackable",GroupMaster:"Group Master"},polygonMenu:{Texture01:"Doku 1",Texture02:"Doku 2",Texture03:"Doku 3",Texture04:"Doku 4",Texture05:"Doku 5",Texture06:"Doku 6",Texture07:"Doku 7",Texture08:"Doku 8",Texture09:"Doku 9",Texture10:"Doku 10",TextBox:"Text Box",FontOutlineColor:"Font Outline Color",FontOutlineWidth:"Font Outline Width",FontStrokeColor:"Font Stroke Color",FontStrokeWidth:"Font Stroke Width",NoOutline:"No Outline",Shiny:"Shiny",Filled:"Dolgu",FillTexture:"Dolgu Dokusu",FillColor:"Dolgu Rengi",Opacity:"Opaklık",LineColor:"Çizgi Rengi",LineWidth:"Çizgi Kalınlığı",LineStyle:"Çizgi Stili",SolidLine:"Düz çizgi",DashedLine:"Kesik çizgi",DottedLine:"Noktalı çizgi",InsertVertexBeforeIndex:"İndeksten Önce Tepe Noktası Ekle",InsertVertexAfterIndex:"İndeksten Sonra Tepe Noktası Ekle",DeleteVertex:"Tepe Noktası Sil",OnlyThisPolygon:"Sadece Seçili Poligon",AllPolygonsOnSurface:"Tüm Poligonlar Aynı Yüzeyde",AllPolygonsAboveFoundation:"Temel Üzerindeki Tüm Poligonlar",AllSelectedPolygons:"All Selected Polygons",AllPolygons:"Tüm Poligonlar",Layout:"Düzen",SolarPanelArrayLayout:"Güneş Paneli Dizi Düzeni",SolarPanelArrayLayoutParametricDesign:"Güneş Paneli Dizi Düzeni: Parametrik Tasarım",SolarPanelArrayLayoutGenerativeDesign:"Güneş Paneli Dizi Düzeni: Üretici Tasarım",SolarPanelArrayModel:"Güneş Paneli Modeli",SolarPanelArrayOrientation:"Oryantasyon",SolarPanelArrayTiltAngle:"Eğim Açısı",SolarPanelArrayRowWidth:"Dizi Sıra Genişliği",SolarPanelArrayInterRowSpacing:"Dizi Sıra Arası Boşluk",SolarPanelArrayRowSpacing:"Row Spacing",SolarPanelArrayRowAxis:"Dizi Sıra Ekseni",SolarPanelArrayLeftRightRowAxis:"Left-Right (Relative)",SolarPanelArrayUpDownRowAxis:"Up-Down (Relative)",SolarPanelArrayEastWestRowAxis:"Doğu-Batı (Absolute)",SolarPanelArrayNorthSouthRowAxis:"Kuzey-Güney (Absolute)",SolarPanelArrayMargin:"Margin",SolarPanelArrayPoleHeight:"Direk Yükseklik",SolarPanelArrayPoleSpacing:"Direk Aralık",SolarPanelArrayTotalYearlyCost:"Total Cost",SolarPanelArrayTotalYearlyRevenue:"Total Revenue",SolarPanelArrayTotalYearlyYield:"Total Yield",SolarPanelArrayMeanYearlyYield:"Mean Yield",SolarPanelArrayYearlyProfit:"Profit",LayoutNotAcceptedCheckYourParameters:"Bu yerleşim düzeni uygulanamaz. Lütfen parametrelerinizi kontrol edin."},optimizationMenu:{Optimization:"Optimizasyon",Parameters:"Parametreler",Variables:"Değişkenler",Constants:"Sabitler",GeneticAlgorithm:"Genetik Algoritma",GeneticAlgorithmSettings:"Genetik Algoritma Ayarı",ParticleSwarmOptimization:"Parçacık Sürü Optimizasyon",ParticleSwarmOptimizationSettings:"Parçacık Sürü Optimizasyon Ayarı",SolarPanelTiltAngleOptimization:"Güneş Paneli Eğim Açısı Optimizasyonu",SolarPanelArrayLayout:"Güneş Paneli Dizi Düzeni",Generation:"Nesil",Gene:"Gen",NormalizedVariables:"Normalleştirilmiş Değişkenler",Objective:"Amaç",ObjectiveFunctionDailyTotalYield:"Günlük Toplam Üretim",ObjectiveFunctionYearlyTotalYield:"Yıllık Toplam Üretim",ObjectiveFunctionDailyMeanYield:"Günlük Ortalama Üretim",ObjectiveFunctionYearlyMeanYield:"Yıllık Ortalama Üretim",ObjectiveFunctionDailyProfit:"Günlük Kazanç",ObjectiveFunctionYearlyProfit:"Yıllık Kazanç",GeneticAlgorithmSelectionMethod:"Genetik Algoritma Seçim Yöntemi",RouletteWheel:"Rulet Çarkı",Tournament:"Turnuva",SearchMethod:"Arama Yöntemi",GlobalSearchUniformSelection:"Küresel Arama Standart Seçim",LocalSearchRandomOptimization:"Yerel Arama Rastgele Optimizasyon",PopulationSize:"Popülasyon Boyutu",MaximumGenerations:"Maksimum Nesil",SelectionRate:"Seçim Oranı",CrossoverRate:"Geçiş Oranı",MutationRate:"Mutasyon Oranı",Step:"Adım",SwarmSize:"Sürü Boyutu",MaximumSteps:"Maksimum Adım",MaximumVelocity:"Maksimum Hız",InertiaWeight:"Atalet Ağırlığı",CognitiveCoefficient:"Bilişsel Katsayı",SocialCoefficient:"Sosyal Katsayı",ConvergenceThreshold:"Sonlandırma için Yakınsama Eşiği",LocalSearchRadius:"Yerel Arama Yarıçapı",RowsPerRackRange:"Raf Başına Sıra Aralığı",TiltAngleRange:"Eğim Açısı Aralığı",InterRowSpacingRange:"Sıra Arası Aralık Ranjı",ClickTargetPolygonToActivate:"Etkinleştirmek için Hedef Poligona Tıklayınız",ClickTargetFoundationToActivate:"Etkinleştirmek için Hedef Temele Tıklayınız"},treeMenu:{ShowModel:"Modeli Göster",Flip:"Flip",Type:"Tür",Spread:"Yayılım"},flowerMenu:{Flip:"Flip",Type:"Type",Spread:"Spread"},peopleMenu:{ChangePerson:"Kişi Değiştir",Flip:"Flip",Observer:"Gözlemci",ViewFromThisPerson:" Seçili Kişiye Göre Perspektif"},lightMenu:{Color:"Color",Intensity:"Intensity",Decay:"Decay",MaximumDistance:"Distance",Inside:"Inside"},solarCollectorMenu:{Coordinates:"Coordinates",RelativeXCoordinateOfCenter:"Relative X Coordinate of Center",RelativeYCoordinateOfCenter:"Relative Y Coordinate of Center",RelativeAzimuth:"Göreceli Azimut Açısı",Pole:"Pole",PoleHeight:"Direk Yüksekliği",PoleRadius:"Pole Radius",ExtraPoleHeight:"Ekstra Direk Yüksekliği",ExtraPoleHeightInAdditionToHalfWidth:"Yarım Genişliğe Ek Ekstra Direk Yüksekliği",DrawSunBeam:"Güneş Işını Çiz"},concentratedSolarPowerCollectorMenu:{ReflectorReflectance:"Reflektör Yansıma",ReceiverAbsorptance:"Alıcı Absorbsiyonu",ReflectorOpticalEfficiency:"Reflektör Optik Verimliliği",ReceiverThermalEfficiency:"Alıcı Termal Verimliliği"},waterHeaterMenu:{OnlyThisWaterHeater:"Only This Water Heater",AllWaterHeatersOnSurface:"All Water Heaters on the Same Surface",AllWaterHeatersAboveFoundation:"All Water Heaters Above the Same Foundation",AllSelectedWaterHeaters:"All Selected Water Heaters",AllWaterHeaters:"All Water Heaters"},solarPanelMenu:{ElectricalProperties:"Electrical Properties",InverterEfficiency:"Inverter Efficiency",InverterEfficiencyExplained:"The efficiency for converting direct current (DC) to alternating current (AC).",DcToAcSizeRatio:"DC-to-AC Size Ratio",DcToAcSizeRatioExplained:"The ratio of the solar panels' DC-rated size to the inverter's AC-rated size.",ChangePvModel:"PV Modelini Değiştir",Orientation:"Oryantasyon",Portrait:"Portre",Landscape:"Peyzaj",FrameColor:"Frame Color",Panels:"Paneller",PanelsWide:"Panel Genişliği",PanelsLong:"Panel Uzunluğu",TiltAngle:"Eğim Açısı",SouthFacingIsPositive:"Güney yönünde açı pozitiftir.",Tracker:"İzleyici",SolarTrackerFollowsSun:"Güneş paneli verimini artırmak için bir güneş izleme sistemi güneşi sürekli takip eder.",PoleSpacing:"Direk Aralığı",NoTracker:"İzleme Sistemi Yok",HorizontalSingleAxisTracker:"Yatay Tek Eksenli İzleme Sistemi",VerticalSingleAxisTracker:"Dikey Tek Eksenli İzleme Sistemi",AltazimuthDualAxisTracker:"Altazimut Çift Eksenli İzleme Sistemi",OnlyThisSolarPanel:"Sadece Seçili Güneş Paneli",AllSolarPanelsOnSurface:"Tüm Güneş Panelleri Aynı Yüzeyde",AllSolarPanelsAboveFoundation:"Tüm Güneş Panelleri Aynı Temel Üzerinde",AllSelectedSolarPanels:"All Selected Solar Panels",AllSolarPanels:"Tüm Güneş Panelleri"},pvModelPanel:{SolarPanelSpecs:"Güneş Paneli Özellikleri",Model:"Model",PanelSize:"Panel Boyutu",Cells:"Hücreler",CellType:"Hücre Tipi",Monocrystalline:"Monokristal",Polycrystalline:"Polikristal",ThinFilm:"İnce Katman",Bifacial:"Bifacial",BifacialityFactor:"Bifaciality Factor",Black:"Siyah",Blue:"Mavi",ShadeTolerance:"Gölge Toleransı",SolarCellEfficiency:"Güneş Pili Verimliliği",NominalOperatingCellTemperature:"Nominal Çalışma Hücresi Sıcaklığı",TemperatureCoefficientOfPmax:"Pmax Sıcaklık Katsayısı"},parabolicTroughMenu:{ModuleLength:"Modül Uzunluğu",Modules:"Modüller",ModulesLong:"Modüllerin Uzunluğu",LatusRectum:"Özkiriş",OnlyThisParabolicTrough:"Sadece Seçili Parabolik Oluk",AllParabolicTroughsAboveFoundation:"Aynı Temelin Üzerindeki Tüm Parabolik Oluklar",AllSelectedParabolicTroughs:"All Selected Parabolic Troughs",AllParabolicTroughs:"Tüm Parabolik Oluklar"},fresnelReflectorMenu:{AbsorberPipe:"Soğurucu Boru",SelectAbsorberToReflectSunlightTo:"Güneş Işığı Yansıtılacak Soğurucuyu Seçin",ModuleLength:"Modül Uzunluğu",Modules:"Modüller",ModulesLong:"Modüllerin Uzunluğu",OnlyThisFresnelReflector:"Sadece Seçili Fresnel Reflektör",AllFresnelReflectorsAboveFoundation:"Aynı Temel Üzerindeki Tüm Fresnel Reflektörler",AllSelectedFresnelReflectors:"All Selected Fresnel Reflectors",AllFresnelReflectors:"Tüm Fresnel Reflektörler"},heliostatMenu:{Tower:"Kule",SelectTowerToReflectSunlightTo:"Güneş Işığı Yansıtılacak Kuleyi Seçin",OnlyThisHeliostat:"Sadece Seçili Heliostat",AllHeliostatsAboveFoundation:"Aynı Temel Üzerindeki Tüm Heliostatlar",AllSelectedHeliostats:"All Selected Heliostats",AllHeliostats:"Tüm Heliostatlar"},parabolicDishMenu:{ReceiverStructure:"Alıcı Yapısı",CentralPole:"Merkez Direk",CentralPoleWithTripod:"Tripodlu Merkez Direk",Quadrupod:"Dört Ayaklı",RimDiameter:"Kasnak Çapı",LatusRectum:"Özkiriş",ExtraPoleHeightInAdditionToRadius:"Yarıçapa Ek Olarak Ekstra Direk Yüksekliği",OnlyThisParabolicDish:"Sadece Seçili Parabolik Çanak",AllParabolicDishesAboveFoundation:"Aynı Temel Üzerindeki Tüm Parabolik Çanaklar",AllSelectedParabolicDishes:"All Selected Parabolic Dishes",AllParabolicDishes:"Tüm Parabolik Çanaklar"},windTurbineMenu:{BirdSafeDesign:"Bird-Safe Design",BirdSafeNone:"None",BirdSafeBicolor:"Bicolor",BirdSafeStriped:"Striped",Rotor:"Rotor",BladeNumber:"Blade Number",RotorInitialAngle:"Rotor Initial Angle",RotorBladeDesign:"Rotor Blade Design",RotorBladeRadius:"Rotor Blade Radius",RotorBladePitchAngle:"Rotor Blade Pitch Angle",RelativeYawAngle:"Relative Yaw Angle",MaximumChordLength:"Maximum Chord Length",Tower:"Tower",TowerHeight:"Tower Height",TowerRadius:"Tower Radius",HubDesign:"Hub Design",HubRadius:"Hub Radius",HubLength:"Hub Length",OnlyThisWindTurbine:"Only This Wind Turbine",AllWindTurbinesAboveFoundation:"All Wind Turbines Above the Same Foundation",AllSelectedWindTurbines:"All Selected Wind Turbines",AllWindTurbines:"All Wind Turbines"},wallMenu:{TextureDefault:"Varsayılan",Texture01:"Doku 1",Texture02:"Doku 2",Texture03:"Doku 3",Texture04:"Doku 4",Texture05:"Doku 5",Texture06:"Doku 6",Texture07:"Doku 7",Texture08:"Doku 8",Texture09:"Doku 9",Texture10:"Doku 10",SizeOfWall:"Duvar Boyutu",OnlyThisWall:"Sadece Seçili Duvar",AllConnectedWalls:"All Connected Walls",AllWallsAboveFoundation:" Aynı Temel Üzerindeki Tüm Duvarlar",AllSelectedWalls:"All Selected Walls",AllWalls:"Tüm Duvarlar",Windows:"Pencereler",LockAllUnlockedWindows:"Lock All Unlocked Windows",UnlockAllLockedWindows:"Unlock All Locked Windows",RemoveAllUnlockedWindows:"Kilitlenmemiş Tüm Pencereleri Kaldır",DoYouReallyWantToRemoveAllWindowsOnThisWall:" Seçili duvardaki tüm pencereleri kaldırmak istiyor musunuz?",Doors:"Kapılar",LockAllUnlockedDoors:"Lock All Unlocked Doors",UnlockAllLockedDoors:"Unlock All Locked Doors",RemoveAllUnlockedDoors:"Tüm Kilitlenmemiş Kapıları Kaldır",DoYouReallyWantToRemoveAllDoorsOnThisWall:" Seçili duvardaki tüm kapıları kaldırmak istiyor musun?",SolarPanels:"Güneş Panelleri",LockAllUnlockedSolarPanels:"Lock All Unlocked Solar Panels",UnlockAllLockedSolarPanels:"Unlock All Locked Solar Panels",RemoveAllUnlockedSolarPanels:"Kilitlenmemiş Tüm Güneş Panellerini Kaldır",DoYouReallyWantToRemoveAllSolarPanelsOnThisWall:" Seçili duvardaki tüm güneş panellerini kaldırmak istiyor musunuz?",Sensors:"Sensors",LockAllUnlockedSensors:"Lock All Unlocked Sensors",UnlockAllLockedSensors:"Unlock All Locked Sensors",RemoveAllUnlockedSensors:"Remove All Unlocked Sensors",DoYouReallyWantToRemoveAllSensorsOnThisWall:"Do you really want to remove all the sensors on this wall",Lights:"Lights",LockAllUnlockedLights:"Lock All Unlocked Lights",UnlockAllLockedLights:"Unlock All Locked Lights",RemoveAllUnlockedLights:"Remove All Unlocked Lights",DoYouReallyWantToRemoveAllLightsOnThisWall:"Do you really want to remove all the lights on this wall",Polygons:"Polygons",LockAllUnlockedPolygons:"Lock All Unlocked Polygons",UnlockAllLockedPolygons:"Unlock All Locked Polygons",RemoveAllUnlockedPolygons:"Tüm Kilitlenmemiş Poligonları Kaldır",DoYouReallyWantToRemoveAllPolygonsOnThisWall:"Do you really want to remove all the polygons on this wall",WallStructure:"Duvar Yapısı",DefaultStructure:"Varsayılan",StudStructure:"Ahşap Dikme",PillarStructure:"Pillar",Opacity:"Opaklık",StructureSpacing:"Structure Spacing",StructureWidth:"Structure Width",StructureThickness:"Structure Thickness",StructureColor:"Structure Color",Color:"Wall Color",Height:"Height",Thickness:"Thickness",Texture:"Texture",AllLightsOnWallInside:"All Lights on Wall Inside",AllLightsOnWallOutside:"All Lights on Wall Outside",Fill:"Fill",Full:"Full",Partial:"Partial",Empty:"Empty",OpenToOutside:"Open to Outside",EavesLength:"Eaves Overhang Length",Parapet:"Parapet",ParapetColor:"Parapet Color",ParapetTexture:"Parapet Texture",ParapetHeight:"Parapet Height",CopingsHeight:"Copings Height",CopingsWidth:"Copings Width"},windowMenu:{OnlyThisWindow:"Sadece Bu Pencere",AllWindowsOnSurface:"All Windows on the Same Surface",AllWindowsAboveFoundation:"Aynı Temelin Üzerindeki Tüm Pencereler",AllSelectedWindows:"All Selected Windows",AllWindows:"Tüm Pencereler",Width:"Genişlik",Height:"Yükseklik",Setback:"Setback from Exterior Surface",RelativeToWallThickness:"Relative to wall thickness",Mullion:"Tiriz",HorizontalMullion:"Horizontal Mullion",VerticalMullion:"Vertical Mullion",MullionWidth:"Tiriz Genişliği",HorizontalMullionSpacing:"Horizontal Mullion Spacing",VerticalMullionSpacing:"Vertical Mullion Spacing",MullionColor:"Mullion Color",Tint:"Ton",Opacity:"Opaklık",SolarHeatGainCoefficient:"Solar heat gain coefficient (SHGC) = 1 - opacity",Shutter:"Kepenk",LeftShutter:"Sol Kepenk",RightShutter:"Sağ Kepenk",BothShutters:"Kepenkler",ShutterWidth:"Genişlik",ShutterColor:"Kepenk Rengi",Frame:"Frame",FrameWidth:"Frame Width",SillWidth:"Sill Width",Color:"Frame Color",WindowType:"Window Type",Default:"Default",Arched:"Arched",Polygonal:"Polygonal",Interior:"Interior",Empty:"Empty"},roofMenu:{TextureDefault:"Varsayılan",Texture01:"Doku 1",Texture02:"Doku 2",Texture03:"Doku 3",Texture04:"Doku 4",Texture05:"Doku 5",Texture06:"Doku 6",Texture07:"Doku 7",OnlyThisRoof:"Sadece Seçili Çatı",AllRoofsAboveFoundation:"Aynı Temelin Üzerinde Tüm Çatılar",AllSelectedRoofs:"All Selected Roofs",AllRoofs:"Tüm Çatılar",OnlyThisCeiling:"Only This Ceiling",AllCeilingsAboveFoundation:"All Ceilings Above the Same Foundation",AllCeilings:"All Ceilings",EavesOverhangLength:"Eaves Overhang Length",RafterSpacing:"Mertek Aralığı",RafterWidth:"Mertek Genişliği",RafterThickness:"Mertek Kalınlığı",RafterColor:"Mertek Rengi",RoofColor:"Çatı Rengi",RoofSideColor:"Roof Side Color",GlassTint:"Cam Tonu",Opacity:"Opaklık",RoofStructure:"Çatı Yapısı",DefaultStructure:"Varsayılan",RafterStructure:"Mertek",GlassStructure:"Cam",SolarPanels:"Solar Panels",LockAllUnlockedSolarPanels:"Lock All Unlocked Solar Panels",UnlockAllLockedSolarPanels:"Unlock All Locked Solar Panels",RemoveAllUnlockedSolarPanels:"Remove All Unlocked Solar Panels",DoYouReallyWantToRemoveAllSolarPanelsOnThisRoof:"Do you really want to remove all the solar panels on this roof",Windows:"Windows",LockAllUnlockedWindows:"Lock All Unlocked Windows",UnlockAllLockedWindows:"Unlock All Locked Windows",RemoveAllUnlockedWindows:"Remove All Unlocked Windows",DoYouReallyWantToRemoveAllWindowsOnThisRoof:"Do you really want to remove all the windows on this roof",Sensors:"Sensors",LockAllUnlockedSensors:"Lock All Unlocked Sensors",UnlockAllLockedSensors:"Unlock All Locked Sensors",RemoveAllUnlockedSensors:"Remove All Unlocked Sensors",DoYouReallyWantToRemoveAllSensorsOnThisRoof:"Do you really want to remove all the sensors on this roof",Lights:"Lights",RemoveAllUnlockedLights:"Remove All Unlocked Lights",DoYouReallyWantToRemoveAllLightsOnThisRoof:"Do you really want to remove all the lights on this roof",AllLightsOnRoofInside:"All Lights on Roof Inside",AllLightsOnRoofOutside:"All Lights on Roof Outside",Rise:"Rise",Ceiling:"Ceiling",RoofRValue:"Roof R-Value",CeilingRValue:"Ceiling R-Value"},doorMenu:{TextureDefault:"Varsayılan",Texture01:"Doku 1",Texture02:"Doku 2",Texture03:"Doku 3",Texture04:"Doku 4",Texture05:"Doku 5",Texture06:"Doku 6",Texture07:"Doku 7",Texture08:"Doku 8",Texture09:"Doku 9",Texture10:"Doku 10",Texture11:"Doku 11",Texture12:"Doku 12",Texture13:"Doku 13",Texture14:"Doku 14",Texture15:"Doku 15",Texture16:"Doku 16",Texture17:"Doku 17",OnlyThisDoor:"Sadece Seçili Kapı",AllDoorsOnWall:"Aynı Duvardaki Tüm Kapılar",AllDoorsAboveFoundation:"Aynı Temelin Üstündeki Tüm Kapılar",AllSelectedDoors:"All Selected Doors",AllDoors:"Tüm Kapılar",DoorType:"Door Type",Default:"Default",Arched:"Arched",Filled:"Filled",FrameColor:"Frame Color",Interior:"Interior"},siteInfoPanel:{High:"Yüksek",Low:"Düşük"},designInfoPanel:{NumberOfSelectedHeliostats:"Seçilen heliostat sayısı",NumberOfSelectedSolarPanels:"Seçilen güneş paneli sayısı",ElectricityGeneratedDailyBySolarPanels:"Güneş panellerinin günlük elektrik üretimi",SceneDiameter:"Scene diameter",BuildingArea:"Building area"},visualizationControlPanel:{ColorContrast:"Renk Kontrastı",FluxScale:"Flux Scale",ClickUpOrDownArrowButtonsToChange:"Değiştirmek için yukarı veya aşağı ok butonlarına tıklayınız"},instructionPanel:{Rotate:"Döndürme",DragMouse:"Sol Tık + Sürükle",Zoom:"Yakınlaştırma",MouseWheelOrKeys:"Tekerlek veya Ctrl+[ veya Ctrl+]",MouseWheelOrKeysMac:"Tekerlek veya ⌘+[ veya ⌘+]",Pan:"Ekran Kaydırma",HoldCtrlDragMouse:"Ctrl + Sürükle",HoldMetaDragMouse:"Hold ⌘ and drag mouse",Enter2DMode:"Enter 2D mode",Exit2DMode:"Exit 2D mode",NavigationMode:"Navigation mode",EnableNavigation:"Enable navigation",DisableNavigation:"Disable navigation",MoveForwardBack:"Move forward/back",MoveForwardBackInstruction:"Press W/S",MoveLeftRight:"Move left/right",MoveLeftRightInstruction:"Press A/D",MoveUpDown:"Move up/down",MoveUpDownInstruction:"Press Z/X",Turn:"Turn",TurnInstruction:"Press arrow keys",ResetView:"Yeniden Başlat",AutoRotate:"Otomatik Döndürme",StartOrStop:"Başlat veya Durdur (F4)"},mapPanel:{ImageOnGround:"Yüzey Görünümü",HideAddress:"Hide Address",WeatherStations:"Referans",WeatherStationsNote:"Turn this off to speed up",Coordinates:"Koordinatlar",Zoom:"Büyüt"},visibilityPanel:{SolarPanelVisibility:"Güneş Paneli Görünüm",Observer:"Gözlemci",VantagePoint:"Referans Noktası",ItemizedVisibilityByFields:"Alana Özel Perspektif",TotalVisibility:"Toplam"},sensorPanel:{LightSensor:"Işık Sensörü",WeatherDataFrom:"Hava Durumu"},buildingEnergyPanel:{DailyBuildingEnergy:"Daily Building Energy",YearlyBuildingEnergy:"Yearly Building Energy",Heater:"Heater",AC:"AC",SolarPanel:"Solar Panel",Net:"Net"},solarPanelYieldPanel:{SolarPanelDailyYield:"Güneş Paneli Günlük Üretim",SolarPanelYearlyYield:"Güneş Paneli Yıllık Üretim",Yield:"Üretim",YieldPerHour:"Saatlik Üretim",DailyTotal:"Günlük Toplam",YearlyTotal:"Yıllık Toplam",ShowOutputsOfIndividualSolarPanels:"Herbir güneş panelinin üretimini göster",Profit:"Kazanç",TotalCost:"Total Cost",TotalRevenue:"Total Revenue",TotalYield:"Total Yield",MeanYield:"Mean Yield",ModuleCount:"Module Count"},parabolicTroughYieldPanel:{ParabolicTroughDailyYield:"Parabolik Oluk Günlük Üretim",ParabolicTroughYearlyYield:"Parabolik Oluk Yıllık Üretim",Yield:"Üretim",YieldPerHour:"Saatlik Üretim",DailyTotal:"Günlük Toplam",YearlyTotal:"Yıllık Toplam",ShowOutputsOfIndividualParabolicTroughs:"Herbir parabolik oluğun üretimini göster"},parabolicDishYieldPanel:{ParabolicDishDailyYield:"Parabolik Çanak Günlük Üretim",ParabolicDishYearlyYield:"Parabolik Çanak Yıllık Üretim",Yield:"Üretim",YieldPerHour:"Saatlik Üretim",DailyTotal:"Günlük Toplam",YearlyTotal:"Yıllık Toplam",ShowOutputsOfIndividualParabolicDishes:"Herbir parabolik çanağın üretimini göster"},fresnelReflectorYieldPanel:{FresnelReflectorDailyYield:"Fresnel Reflektör Günlük Üretim",FresnelReflectorYearlyYield:"Fresnel Reflektör Yıllık Üretim",Yield:"Üretim",YieldPerHour:"Saatlik Üretim",DailyTotal:"Günlük Toplam",YearlyTotal:"Yıllık Toplam",ShowOutputsOfIndividualFresnelReflectors:"Herbir Fresnel yansıtıcısının üretimini göster"},heliostatYieldPanel:{HeliostatDailyYield:"Heliostat Günlük Üretim",HeliostatYearlyYield:"Heliostat Yıllık Üretim",Yield:"Üretim",YieldPerHour:"Saatlik Üretim",DailyTotal:"Günlük Toplam",YearlyTotal:"Yıllık Toplam",ShowOutputsOfIndividualHeliostats:"Herbir heliostatın üretimini göster"},updraftTowerYieldPanel:{UpdraftTowerDailyYield:"Solar Updraft Kulesi Günlük Üretimi",UpdraftTowerYearlyYield:"Solar Updraft Kulesi Yıllık Üretimi",ChimneyAirTemperature:"Baca Hava Sıcaklığı",ChimneyWindSpeed:"Baca Rüzgar Hızı",Yield:"Üretim",YieldPerHour:"Saatlik Üretim",DailyTotal:"Günlük Toplam",YearlyTotal:"Yıllık Toplam",ShowOutputsOfIndividualUpdraftTowers:"Herbir updraft kulesinin üretimini göster"},heliodonPanel:{SunAndTimeSettings:"Güneş & Saat Ayarları",SunAngles:"Açılar",TwentyFourHours:"24 Hours"},cloudFilePanel:{CopyTitle:"Copy Title",TitleCopiedToClipBoard:"The title was copied to the clip board",SearchByTitle:"Search by title",MyLikes:"My Likes",MyCloudFiles:"Bulut Dosyalarım",GenerateLink:"Link Oluştur",LinkGeneratedInClipBoard:"Klip Panosunda Oluşturulan Link",DoYouReallyWantToDelete:"Gerçekten silmek istiyor musun?",IfSharedOrPublishedRenamingFileBreaksExistingLinks:"If this file has been shared or published, renaming it breaks existing links"},projectListPanel:{CopyTitle:"Copy Title",TitleCopiedToClipBoard:"The title was copied to the clip board",SearchByTitle:"Search by title",MyProjects:"My Projects",GenerateProjectLink:"Generate Project Link",ProjectLinkGeneratedInClipBoard:"A link to the project was generated in the clip board",DoYouReallyWantToDeleteProject:"Do you really want to delete Project",IfSharedOrPublishedRenamingProjectBreaksExistingLinks:"If this project has been shared or published, renaming it breaks existing links"},projectPanel:{ProjectSettings:"Project Settings",ThumbnailImageSize:"Thumbnail Image Size",ProjectByOtherPeople:"Project by Other People",Project:"Project",ProjectType:"Type",ProjectDescription:"Description",MakeDescriptionEditable:"Make this description editable",MakeDescriptionNonEditable:"Make this description non-editable",DoubleClickToMakeDescriptionEditable:"Double-click to make this description editable",SolarPanelArray:"Solar Panel Array",CurateCurrentDesign:"Curate current design",UpdateSelectedDesign:"Update selected design",RemoveSelectedDesign:"Remove selected design",ClickToFlipSortingOrder:"Click to flip the sorting order",DesignNotShownInSolutionSpaceClickToShow:"This design is not shown in solution space; click to show",DesignShownInSolutionSpaceClickToHide:"This design is shown in solution space; click to hide",SolutionSpace:"Solution Space",ChooseSolutionSpace:"Choose solution space",ChooseDataColoring:"Choose data coloring",SameColorForAllDesigns:"Same color for all designs",OneColorForEachDesign:"One color for each design",SolutionSpaceScreenshot:"Take a screenshot of the solution space",ScatterPlotScreenshot:"Take a screenshot of the scatter plot",SingleClickToSelectDoubleClickToOpen:"Single-click to select, double-click to open.",SingleClickToDeselectDoubleClickToOpen:"Single-click to deselect, double-click to open.",GenerateScatterPlot:"Generate Scatter Plot",SelectXAxis:"Select X Axis",SelectYAxis:"Select Y Axis"},accountSettingsPanel:{MyAccountSettings:"Hesap Ayarlarım",MyID:"Bilgilerim",ClickToCopyMyID:"Bilgilerinizi kopyalamak için tıklayın",IDInClipBoard:"Kişisel bilgileriniz kopyalandı ve yapıştırmaya hazır.",StoreMyNameInMyFilesWhenSaving:"Kaydederken, adımı dosyalarıma ekle",DoYouReallyWantToShowYourNameInYourFiles:"Dosyalarınızda isminizin gösterilmesini istiyor musunuz?",SignFileDisclaimer:"Evet ise, isiminiz dosyalarınıza erişimi olan bütün kişiler tarafından görülebilir.",Likes:"Likes",AllPublished:"All Published",PublishedUnderAliases:"Aliases",UserCount:"Kullanıcı Sayısı",SchoolID:"Okul",ClassID:"Sınıf"},weatherPanel:{SunshineHours:"Gündüz Saatleri"},diurnalTemperaturePanel:{SelectAirTemperatureModel:"Model Seç",Sinusoidal:"Sinüzoidal"},economicsPanel:{EconomicsParameters:"Ekonomik Parametreler",ElectricitySellingPrice:"Elektrik Satış Fiyatı",OperationalCostPerUnit:"Birim Başına İşletme Maliyeti",SellingPrice:"Selling Price",UnitCost:"Unit Cost"},navigationPanel:{NavigationParameters:"Navigation Parameters",MinimumMoveSpeed:"Minimum Move Speed",MinimumTurnSpeed:"Minimum Turn Speed"},shadowSettingsPanel:{ShadowSettings:"Shadow Settings",ShadowCameraFarDistance:"Shadow Camera Far Distance",ShadowMapSize:"Shadow Map Size",Notes:"Notes",RefreshPageNote:"Refresh the page for the new settings to take effect.",MapSizeWarning:"A large shadow map size may cause Aladdin to crash on some computers."},yearlyLightSensorPanel:{SkyClearness:"Gökyüzü Açıklığı",ShowDaylightResults:"Gün Işığı Sonuçlarını Göster",ShowSkyClearnessResults:"Gökyüzü Açıklığı Sonuçlarını Göster",ShowAverageDailySolarRadiation:"Günlük ortalama güneş Işınımını göster"},analysisManager:{NoSensorForCollectingData:"Veri toplamak için sensör yok.",NoSolarPanelForAnalysis:"Analiz için güneş paneli yok.",NoObserverForVisibilityAnalysis:"Görünürlük analizi için gözlemci yok.",NoWaterHeaterForAnalysis:"Analiz için su ısıtıcısı yok",NoParabolicDishForAnalysis:"Analiz için parabolik çanak yok",NoParabolicTroughForAnalysis:"Analiz için parabolik oluk yok.",NoFresnelReflectorForAnalysis:"Analiz için Fresnel reflektörü yok.",NoHeliostatForAnalysis:"Analiz için heliostat yok.",NoSolarUpdraftTowerForAnalysis:"Analiz için Solar Updraft Kulesi yok.",NoBuildingForAnalysis:"There is no building for analysis."},toolbar:{CloudFile:"Bulut Dosyası",Select:"Seç",AddFoundation:"Temel Ekle",AddWall:"Duvar Ekle",AddWindow:"Pencere Ekle",AddDoor:"Kapı Ekle",AddPyramidRoof:"Piramit Çatı Ekle",AddGableRoof:"Beşik Çatı Ekle",AddHipRoof:"Kırma Çatı Ekle",AddGambrelRoof:"Flemenk Çatı Ekle",AddMansardRoof:"Mansart Çatı Ekle",AddCuboid:"Kübik Ekle",AddSensor:"Sensör Ekle",AddSolarPanel:"Güneş Paneli Ekle",AddWaterHeater:"Su Isıtıcı Ekle",AddPowerWall:"Add Power Wall",AddParabolicDish:"Parabolik Çanak Ekle",AddParabolicTrough:"Parabolik Oluk Ekle",AddFresnelReflector:"Fresnel Reflektörü Ekle",AddHeliostat:"Heliostat Ekle",AddWindTurbine:"Add Horizontal Axis Wind Turbine",AddVerticalAxisWindTurbine:"Add Vertical Axis Wind Turbine",AddLight:"Add Light",AddTree:"Ağaç Ekle",AddFlower:"Add Flower",AddPeople:"İnsan Ekle",DoubleClickToLockThisModeForNextAction:"Double-click to lock this mode for next action",ClickToUnlockThisModeForNextAction:"Click to unlock this mode for next action",ManipulateGroup:"Ölçeklendirme",ClearScene:"Herşeyi Sil",ShowSunAndTimeSettings:"Güneş & Zaman Ayarlarını Göster",SpatialAnalysisOfEnergy:"Spatial analysis of energy",DoYouReallyWantToClearContent:"İçeriği silmek istiyor musunuz",ClickForMoreButtons:"Daha fazla buton için tıklayın"},tooltip:{gotoIFI:"Yarının Zekası Enstitüsüne Git",visitAladdinHomePage:"Aladdin Ana Sayfasını Ziyaret Edin",clickToOpenMenu:"Ana Menüyü Açmak İçin Tıklayınız",clickToAccessAccountSettings:"Click to access account settings"},tree:{Apple:"Apple",Birch:"Birch",Coconut:"Coconut",Dogwood:"Kızılcık Ağacı",Elm:"Karaağaç",FanPalm:"Fan Palm",Linden:"Ihlamur Ağacı",Magnolia:"Magnolia",Maple:"Akçaağaç",Oak:"Meşe Ağacı",Pine:"Çam",Spruce:"Alaçam"},flower:{Bellflower:"Bellflower",Boxwood:"Boxwood",CactusCombo1:"Cactus Combo 1",CactusCombo2:"Cactus Combo 2",CactusCombo3:"Cactus Combo 3",CactusCombo4:"Cactus Combo 4",Hibiscus:"Hibiscus",Hosta:"Hosta",Hydrangea:"Hydrangea",Peony:"Peony",RedRose:"Red Rose",Spirea:"Spirea",Sunflower:"Sunflower",TallBush:"Tall Bush",Tulip:"Tulip",WhiteFlower:"White Flower",YellowFlower:"Yellow Flower"},people:{Jaah:"Ata",Jack:"Mete",Jacob:"Jacob",Jacqueline:"Beril",Jade:"Ece",Jamelia:"Bilge",James:"James",Jane:"Jane",Jaya:"Asya",Jaye:"Aylin",Jeanette:"Jeanette",Jedi:"Alp",Jeff:"Kaya",Jena:"Nehir",Jennifer:"Defne",Jess:"Zeynep",Jett:"Umut",Jill:"Jill",Jiya:"Elif",Joan:"Ezgi",Jocelyn:"Jocelyn",Joel:"Cenk",Joey:"Azra",John:"Can",Jonathon:"Jonathon",Jose:"Mert",Joseph:"Joseph",Joshua:"Joshua",Judd:"Ozan",Judy:"Judy",Julia:"Julia",Julio:"Bulut",Jumapili:"Umay",June:"Naz",Juro:"Efe",Justin:"Justin"},compass:{N:"N",S:"S",W:"W",E:"E"},month:{January:"Jan",February:"Feb",March:"Mar",April:"Apr",May:"May",June:"Jun",July:"Jul",August:"Aug",September:"Sep",October:"Oct",November:"Nov",December:"Dec"},modelsMap:{SearchByPublisher:"Search by publisher",SearchByLabel:"Search by label",MyPublishedModels:"My Published Models",TotalNumberOfUserPublishedModels:"Total number of user-published models",SortFromOldestToNewest:"Sort from oldest to newest",SortFromNewestToOldest:"Sort from newest to oldest",ModelsFoundOnThisSite:"models found on this site",ShowModelsPublishedByThisAuthor:"Show the models published by this author"}}},hpt={translation:{name:{IFI:"Інститут Інтелекту Майбутнього",Aladdin:"Aladdin",Tagline:"Aladdin: Переосмислення Дизайну з Пояснювальним Штучним Інтелектом - Інститут Інтелекту Майбутнього"},cookie:{Statement:"Натиснувши «Прийняти», ви погоджуєтеся з використанням файлів cookie для покращення вашого досвіду з Aladdin.",Accept:"Прийняти"},aboutUs:{ProductBroughtToYouBy:"Цей Продукт Було Створено:",TermsOfService:"Умови Використання",PrivacyPolicy:"Політика Конфіденційності",Software:"Програмне Забезпечення",Content:"Матеріали",Research:"Дослідження",Support:"Підтримка",Acknowledgment:"Подяка",FundingInformation:"Національний Науковий Фонд (ННФ, Cполучені Штати Америки) надав фінансову підтримку для дослідження та розробки цього продукту за допомогою грантів №2105695, №2131097, та №#2301164. Однак, будь-які погляди, результати та висновки, висловлені у продукті, належать авторам і можуть не повністю відображати погляди ННФ.",Contact:"Для отримання додаткової інформації, будь ласка, зверніться до Charles Xie (charles@intofuture.org).",Translators:"Переклад"},word:{Refresh:"Refresh",LastUpdate:"Last Update",Small:"Small",Medium:"Medium",Large:"Large",Design:"Design",Information:"Information",Type:"Type",Text:"Текст",FontSize:"Розмір Шрифту",FontColor:"Колір Шрифту",Model:" Модель",Models:"Моделі",Upload:"Завантажити",ClickCount:"Натисніть Підрахувати",Share:"Поділитись",AlreadyLike:"Вподобано",Like:"Вподобати",MustLogInToLike:"Потрібно Увійти, щоб Вподобати",AllRightsReserved:"Усі Права Захищено",MeterAbbreviation:"м",Version:"Версія",VersionInitial:"В",Options:"Опції",Maximum:"Максимум",Minimum:"Мінімум",MaximumNumber:"Максимальне Число",MinimumNumber:"Мінімальне Число",MaximumValue:"Максимальне Значення",MinimumValue:"Мінімальне Значення",Or:"Або",None:"Жоден",High:"Високий",Partial:"Частковий",Teacher:"Вчитель",Class:"Клас",Total:"Всього",Leaderboard:"Таблиця Лідерів",Latest:"Останнє",Range:"Діапазон",SIUnit:"SI Одиниця",USUnit:"US Одиниця",ThermalTransmittance:"Теплопередача",ThermalResistance:"Термічний Опір",UValue:"U-Значення",RValue:"R-Значення",VolumetricHeatCapacity:"Об'ємна Теплоємність",BuildingHVACSystem:"Побудова Системи Опалення, Вентиляції та Кондиціювання Повітря (ОВК)",ThermostatSetpoint:"Задана Температура Термостата",TemperatureToleranceThreshold:"Порогове Значення Допустимого Відхилення Температури",TemperatureToleranceThresholdExplanation:"Обігрівач не працюватиме, якщо найнижча зовнішня температура дня вища за значення отриманe, якщо від заданої температури відняти порогове значення. Кондиціонер не працюватиме, якщо найвища зовнішня температура дня нижча за значення отримане, якщо від заданої температури відняти порогове значення.",Press:"Натисніть",Open:"Відкрити",Save:"Зберегти",SaveAsImage:"Зберегти як Зображення",SaveAsCsv:"Зберегти як CSV",Update:"Оновити",Paste:"Вставити",Copy:"Копіювати",Cut:"Вирізати",Delete:"Видалити",Lock:"Заблокувати",Translucent:"Півпрозорий",Transparency:"Transparency",Color:"Колір",Pattern:"Pattern",Texture:"Текстура",Size:"Розмір",Thickness:"Товщина",Yes:"Так",No:"Ні",OK:"ОК",Cancel:"Скасувати",Apply:"Застосувати",Close:"Закрити",ApplyTo:"Застосувати До",Run:"Запустити",Pause:"Пауза",Resume:"Відновити",Clear:"Очистити",Warning:"Попередження",Caution:"Обережно",Reminder:"Нагадування",Length:"Довжина",Width:"Ширина",Height:"Висота",Radius:"Радіус",Angle:"Кут",Azimuth:"Азимут",Coordinates:"Координати",Weather:"Погода",Show:"Показати",Animate:"Анімувати",Date:"Дата",Time:"Час",Title:"Заголовок",Owner:"Власник",Action:"Дія",Rename:"Перейменувати",Location:"Місцезнаходження",Latitude:"Широта",Month:"Місяць",Day:"День",Hour:"Година",Daylight:"Денне світло",Radiation:"Радіаційне Випромінювання",Temperature:"Температура",kWh:"кВт-год",dollar:"долар",MeterPerSecond:"м/с",NorthInitial:"Північ",SouthInitial:"Південь",EastInitial:"Схід",WestInitial:"Захід",Fixed:"Фіксований",Elements:"Елементи",Energy:"Енергія",Unknown:"Невідомо",Label:"Мітка",Description:"Опис",NoDescription:"Без опису",MaximumCharacters:"Максимальна кількість символів",Author:"Автор",Publisher:"Видавець",Building:"Будівля",ResidentialBuilding:"Житлова будівля",CommercialBuilding:"Комерційна будівля",SchoolBuilding:"Шкільна будівля",TouristAttraction:"Туристична визначна пам'ятка",UnderConstruction:"В стадії будівництва",Photovoltaic:"Фотоелектричний",WindPower:"Wind Power",ColocationProjects:"Colocation Projects",Anonymous:"Анонімний",Nickname:"Нікнейм",Pin:"Закріпити",Unpin:"Відкріпити"},shared:{NoTexture:"Без текстури",FoundationElement:"Фундамент",CuboidElement:"Паралелепіпед",PolygonElement:"Багатокутник",SensorElement:"Сенсор",SolarPanelElement:"Сонячна панель",WaterHeaterElement:"Водонагрівач",ParabolicDishElement:"Параболічна тарілка",ParabolicTroughElement:"Параболічний сонячний колектор",FresnelReflectorElement:"Відбивач Френеля",HeliostatElement:"Геліостат",WindTurbineElement:"Вітрова турбіна",LightElement:"Світло",ElementLocked:"Заблоковано",ModelType:"Тип моделі",OutputBreakdown:"Breakdown",MoreResults:"More Results"},message:{NewVersionAvailable:"A new version is available",CalculationMayBeSlowDoYouWantToContinue:"Calculation may be slow. Do you want to continue?",IncreaseSolarRadiationHeatmapGridCellSizeToSpeedUp:"Increase solar radiation heatmap grid cell size to speed up",ModelNotFound:"Модель не знайдено",CannotSignIn:"Не вдається увійти",CannotSignOut:"Не вдається вийти",YourAccountWasCreated:"Ваш обліковий запис був створений",CannotCreateAccount:"Не вдається створити обліковий запис",YourAccountSettingsWereSaved:"Налаштування облікового запису були збережені",CannotSaveYourAccountSettings:"Не вдається зберегти налаштування облікового запису",CannotSaveYourFileToCloud:"Не вдається зберегти ваш файл у хмарному середовищі",CannotCreateNewProject:"Не вдається створити новий проєкт",CannotCreateNewProjectWithoutTitle:"Cannot create a new project without a title",CannotOpenYourProjects:"Не вдається відкрити ваші проєкти",CannotOpenProject:"Cannot open the project",CannotDeleteProject:"Cannot delete the project",CannotRenameProject:"Cannot rename the project",CannotAddDesignToProject:"Cannot add this design to the project",CannotAddDesignToProjectOwnedByOthers:"Cannot add this design to a project owned by others",DesignRemovedFromProject:"The design was successfully removed from the project",CannotRemoveDesignFromProject:"Cannot remove this design from the project",CannotUpdateProject:"Cannot update the project",CannotFetchProjectData:"Cannot fetch project data",TitleUsedChooseDifferentOne:"Ця назва була використана. Виберіть іншу",CloudFileWithTitleExistsDoYouWantToOverwrite:"Хмарний файл з такою ж назвою вже існує. Ви хочете перезаписати його?",CloudFileNotFound:"Файл у хмарному середовищі не знайдено",CannotLoadModelsOnMap:"Не вдається завантажити моделі на карту",CannotLoadLeaderboard:"Не вдається завантажити таблицю лідерів",CannotPublishModelOnMap:"Не вдається опублікувати модель на карті",CannotLikeModelFromMap:"Не вдається оцінити модель з карти",CannotDeleteModelFromMap:"Не вдається видалити модель з карти",ModelDeletedFromMap:"Модель видалена з карти",DoYouWantToDeleteModelFromMap:"Ви бажаєте видалити модель з карти?",CannotOpenCloudFile:"Не вдається відкрити файл у хмарному середовищі",CannotReadCloudFile:"Cannot read the cloud file",CannotWriteCloudFile:"Cannot write the cloud file",CloudFileCopied:"Cloud file copied",CannotOpenCloudFolder:"Не вдається відкрити папку у хмарному середовищі",CannotDeleteCloudFile:"Не вдається видалити файл у хмарному середовищі",CannotRenameCloudFile:"Не вдається перейменувати файл у хмарному середовищі",DoYouWantToSaveChanges:"Бажаєте зберегти зміни?",NotApplicableToSelectedAction:"Не застосовується до обраної дії",ThisElementIsLocked:"Цей елемент заблокований.",ThisCannotBeUndone:"Це не можна скасувати.",AzimuthOfNorthIsZero:"Азимут півночі дорівнює 0°",CounterclockwiseAzimuthIsPositive:"Азимут є позитивним проти годинникової стрілки.",SouthFacingIsZero:"South-facing is 0°",ClockwiseRotationIsPositive:"Clockwise is positive",MoveCancelledBecauseOfOverlap:"Переміщення скасовано через перекриття.",MoveOutsideBoundaryCancelled:"Переміщення за межі скасовано.",RotationCancelledBecauseOfOverlap:"Ротацію скасовано через перекриття.",RotationOutsideBoundaryCancelled:"Ротація за межі скасована.",ResizingCancelledBecauseOfOverlap:"Зміна розміру скасована через перекриття.",ResizingOutsideBoundaryCancelled:"Зміна розміру за межі скасована.",CannotPasteOutsideBoundary:"Не можна вставити за межі.",CannotPasteBecauseOfOverlap:"Не можна вставити через перекриття.",CannotMoveObjectTooFar:"Не можна перемістити об'єкт занадто далеко.",ExistingSolarPanelsWillBeRemovedBeforeApplyingNewLayout:"Існуючі сонячні панелі будуть видалені перед застосуванням нового макету.",DoYouWantToContinue:"Бажаєте продовжити?",SolarPanelsCannotIntersectWithGround:"Сонячні панелі не можуть перетинатися з землею.",SolarPanelsCannotOverlapWithOneAnother:"Сонячні панелі не можуть накладатися одна на одну.",ScreenshotSaved:"Знімок екрана збережено.",CsvFileSaved:"CSV файл збережено.",SimulationStarted:"Розпочато симуляцію.",SimulationCompleted:"Симуляцію завершено.",SimulationAborted:"Симуляцію перервано.",SimulationPaused:"Симуляцію призупинено.",CancelSimulation:"Скасувати симуляцію",PauseSimulation:"Призупинити симуляцію",ResumeSimulation:"Продовжити симуляцію",SimulationWillNotStartDueToErrors:"Симуляція не розпочнеться через помилки",SimulationWillStartDespiteWarnings:"Симуляція розпочнеться незважаючи на попередження.",EvolutionStarted:"Еволюцію розпочато.",EvolutionCompleted:"Еволюцію завершено.",EvolutionAborted:"Еволюцію перервано.",EvolutionPaused:"Еволюцію призупинено.",EncounterEvolutionError:"Сталася помилка еволюції.",CancelEvolution:"Скасувати еволюцію",PauseEvolution:"Призупинити еволюцію",ResumeEvolution:"Продовжити еволюцію",ConvergenceThresholdHasBeenReached:"Досягнуто порогове значення збіжності.",MaximumNumberOfGenerationsHasBeenReached:"Досягнуто максимальну кількість поколінь.",MaximumNumberOfStepsHasBeenReached:"Досягнуто максимальну кількість кроків.",ObjectiveFunctionTypeError:"Поточна цільова функція не підтримується цією операцією. Будь ласка, розпочніть з меню.",WallsAreNotAtSameHeight:"Стіни не знаходяться на однаковій висоті.",WallsAreNotPerpendicular:"Стіни не перпендикулярні.",WallsAreNotConnected:"Стіни не з'єднані.",WallsNumberNeedToBeFour:"Кількість стін має дорівнювати чотири.",BuildingContainsEmptyWall:"Будівля містить одну або кілька порожніх стін.",BuildingRoofMissing:"У будівлі відсутній дах.",UnknownErrors:"Невідомі помилки."},menu:{AnalysisOptions:"Опції аналізу",option:{GridCellSize:"Розмір комірки сітки",SamplingFrequency:"Частота вибірки",TimesPerHour:"Разів на годину",DaysPerYear:"Днів на рік"},mainMenu:"Головне Меню",cloudMenu:"Меню Хмарного Середовища",projectSubMenu:"Проєкт",project:{CreateNewProject:"Створити Новий Проєкт",OpenProject:"Відкрити Проєкт",SaveProject:"Save Project",SaveProjectAs:"Save Project As",YouMustLogInToCreateProject:"Ви повинні увійти, щоб створити новий проєкт",YouMustLogInToOpenProject:"Ви повинні увійти, щоб відкрити проєкт"},fileSubMenu:"Файл",file:{CreateNewFile:"Створити новий",OpenLocalFile:"Відкрити локально",SaveAsLocalFile:"Зберегти як",SavingAbortedMustHaveValidFileName:"Збереження перервано! Вам потрібно мати дійсне ім'я файлу",OpenCloudFile:"Відкрити у хмарному середовищі",SaveCloudFile:"Зберегти у хмарному середовищі",SaveAsCloudFile:"Зберегти у хмарному середовищі",SavingAbortedMustHaveValidTitle:"Збереження перервано! Вам потрібно мати дійсний заголовок для хмарного файлу",ToSaveYourWorkPleaseSignIn:"Щоб зберегти вашу роботу, будь ласка, увійдіть в систему.",TakeScreenshot:"Зробити знімок екрана",UseCloudFileName:"Використовувати ім'я файлу у хмарному середовищі",PublishOnModelsMap:"Опублікувати на карті моделей",PublishedOnModelsMap:"Вашу модель було опубліковано на карті моделей",UpdatedOnModelsMap:"Ваша модель була оновлена на карті моделей",YouMustLogInToPublishYourModel:"Вам потрібно увійти в систему, щоб опублікувати свою модель",YouCannotPublishAModelThatYouDoNotOwn:"Ви не можете опублікувати модель, якою не володієте",YouMustSaveModelOnCloudBeforePublishingIt:"Вам потрібно зберегти модель у хмарному середовищі перед її публікацією"},editSubMenu:"Редагувати",edit:{Undo:"Скасувати",Redo:"Повторити"},viewSubMenu:"Перегляд",view:{NavigationView:"Navigation View",TwoDimensionalView:"2D Вигляд",ResetView:"Скинути",ZoomIn:"Збільшити масштаб",ZoomOut:"Зменшити масштаб",AutoRotate:"Автоматичний поворот",ShowShadow:"Показати тінь",ShowSurfaceShininess:"Показати блиск поверхні",TranslucentFloatingWindows:"Напівпрозорі плаваючі вікна",accessoriesSubMenu:"Додаткові елементи",accessories:{SiteInformation:"Інформація про місце",DesignInformation:"Інформація про дизайн",Instruction:"Інструкція",StickyNote:"Примітка",Note:"Примітка"}},settingsSubMenu:"Налаштування",settings:{WeatherData:"Дані про погоду",DiurnalTemperature:"Добова температура",Heliodon:"Геліодон",SunAndTime:"Сонце та час"},benchmarksSubMenu:"Бенчмарки",benchmarks:{SolarRadiationPredictionVsMeasurement:"Прогнозування сонячної радіації порівняно з вимірюванням",BESTESTCase600:"Тестування енергоефективності будівель: BESTEST Case 600",BESTESTCase610:"Тестування енергоефективності будівель: BESTEST Case 610",BESTESTCase620:"Тестування енергоефективності будівель: BESTEST Case 620",BESTESTCase630:"Тестування енергоефективності будівель: BESTEST Case 630"},graph:{LineWidth:"Товщина лінії",SymbolSize:"Розмір символу",BarCategoryGap:"Відступ категорій стовпців",ShowHorizontalGridLines:"Показати горизонтальні лінії сітки",ShowVerticalGridLines:"Показати вертикальні лінії сітки"},analysisSubMenu:"Аналіз",physicsSubMenu:"Фізика",physics:{DailySolarRadiationHeatmap:"Щоденна карта сонячної радіації",SolarRadiationHeatmapOptions:"Параметри карти сонячної радіації",SolarRadiationHeatmapGridCellSize:"Розмір комірки на карті сонячної радіації",SolarRadiationHeatmapMaxValue:"Максимальне значення на карті",SolarRadiationHeatmapNoAnimation:"Немає анімації для статичної моделі",ReflectionHeatmap:"Карта відображень"},sensorSubMenu:"Датчик",sensor:{CollectDailyData:"Збирати щоденні дані",CollectYearlyData:"Збирати щорічні дані",SensorSimulationNoAnimation:"Немає анімації для збору даних датчика"},buildingSubMenu:"Будівля",building:{AnalyzeDailyBuildingEnergy:"Аналізувати щоденну енергію будівлі",AnalyzeYearlyBuildingEnergy:"Аналізувати щорічну енергію будівлі",EnergyAnalysisOptions:"Параметри аналізу енергії",EnergyGridCellSize:"Розмір комірки сітки",BuildingEnergySimulationNoAnimation:"Немає анімації симулювати енергію будівлі"},solarPanelSubMenu:"Сонячна панель",solarPanel:{AnalyzeDailyYield:"Аналізувати щоденний дохід",AnalyzeYearlyYield:"Аналізувати щорічний дохід",AnalyzeVisibility:"Аналізувати видимість",PanelDiscretization:"Дискретизація панелі",Exact:"Точний",Approximate:"Наближений",EnergyGridCellSize:"Розмір комірки сітки енергії",VisibilityGridCellSize:"Розмір комірки сітки коефіцієнта видимості",EnergyAnalysisOptions:"Параметри аналізу енергії",VisibilityAnalysisOptions:"Параметри аналізу видимості",SolarPanelSimulationNoAnimation:"Немає анімації для симуляції сонячної панелі"},parabolicTroughSubMenu:"Параболічний сонячний колектор",parabolicTrough:{AnalyzeDailyYield:"Аналізувати щоденний дохід",AnalyzeYearlyYield:"Аналізувати щорічний дохід"},parabolicDishSubMenu:"Параболічний диск",parabolicDish:{AnalyzeDailyYield:"Аналізувати щоденний дохід",AnalyzeYearlyYield:"Аналізувати щорічний дохід"},fresnelReflectorSubMenu:"Відбивач Френеля",fresnelReflector:{AnalyzeDailyYield:"Аналізувати щоденний дохід",AnalyzeYearlyYield:"Аналізувати щорічний дохід"},heliostatSubMenu:"Геліостат",heliostat:{AnalyzeDailyYield:"Аналізувати щоденний дохід",AnalyzeYearlyYield:"Аналізувати щорічний дохід"},solarUpdraftTowerSubMenu:"Сонячна вежа з використаним повітрям",solarUpdraftTower:{AnalyzeDailyYield:"Аналізувати щоденний дохід",AnalyzeYearlyYield:"Аналізувати щорічний дохід",SolarUpdraftTowerSimulationNoAnimation:"Немає анімації симулювати сонячну вежу з використаним повітрям"},tutorialsSubMenu:"Посібники",solarEnergyScienceSubMenu:"Сонячна наука",solarEnergyScienceTutorials:{SunAngles:"Кути сонця відносно спостерігача на землі",InsolationAndClimate:"Інсоляція та клімат",SolarRadiationToBox:"Сонячна радіація в коробку"},buildingScienceSubMenu:"Наука про будівлі",buildingScienceTutorials:{ThermalEnvelopeVsBuildingEnvelope:"Теплозахисна оболонка проти будівельної оболонки",EffectOfSizeOnBuildingEnergy:"Вплив розміру на енергію будівлі",EffectOfOrientationOnBuildingEnergy:"Вплив орієнтації на енергію будівлі",EffectOfInsulationOnBuildingEnergy:"Вплив інсоляції на енергію будівлі",EffectOfRoofColorOnBuildingEnergy:"Вплив кольору даху на енергію будівлі",EffectOfEavesOverhangLengthOnBuildingEnergy:"Вплив довжини виступу карнизу на енергію будівлі",EffectOfWindowSHGCOnBuildingEnergy:"Вплив коефіцієнта сонячного теплозиску вікна на енергію будівлі",EffectOfThermostatSetpointOnBuildingEnergy:"Вплив заданої температури на термостаті на енергію будівлі",EffectOfSolarPanelsOnBuildingEnergy:"Вплив сонячних панелей на енергію будівлі",EffectOfGroundTemperatureOnBuildingEnergy:"Вплив температури грунту на енергію будівлі",EffectOfTreesOnBuildingEnergy:"Вплив дерев на енергію будівлі"},buildingDesignSubMenu:"Дизайн будівлі",buildingDesignTutorials:{CapeCodStyleHouseWithShedDormer:'Будинок у стилі Кейп Код з пристроєм типу "шед-дормер"',MansardRoofWithDormers:"Мансарда з горизонтальними пристроями",GableRoofVsHipRoof:"Схиловий дах проти двосхилих дахів",ColonialVsSaltbox:"Колоніальний стиль проти стилю Saltbox",GambrelRoofVsMansardRoof:"Півшаровий дах проти мансардного даху",CombinationRoofVsBonnetRoof:"Комбінований дах проти капотного даху",DutchGableRoof:"Голландський дах з рикетом",GableAndValleyRoof:"Схиловий та долинний дах",ClerestoryRoof:"Клересторний дах",MonitorRoof:"Моніторний дах",AFrameHouse:'Будинок у формі літери "А"',HalfTimberedHouse:"Будинок з напівдерев'яними стінами",AllBasicRoofTypes:"Усі основні типи дахів"},photovoltaicSolarPowerSubMenu:"Фотоелектрична сонячна енергія",photovoltaicSolarPowerTutorials:{EffectOfTiltAngleOfSolarPanel:"Вплив кута нахилу сонячної панелі",EffectOfAzimuthOfSolarPanel:"Вплив азимуту сонячної панелі",SolarPanelTypes:"Типи сонячних панелей",VerticalBifacialSolarPanels:"Vertical Bifacial Solar Panels",CompareMonofacialAndBifacialSolarPanels:"Monofacial vs. Bifacial Solar Panels",SolarTrackers:"Сонячні трекери",CoveringGroundWithSolarPanels:"Чому просто покриття землі сонячними панелями - не найкраща ідея",InterRowSpacingOfSolarPanelArray:"Вплив міжрядного простору в масиві сонячних панелей",EffectOfOrientationOfSolarPanels:"Вплив орієнтації сонячних панелей",SolarPanelArrayAutomaticLayout:"Автоматичне розміщення масиву сонячних панелей"},concentratedSolarPowerSubMenu:"Концентрована сонячна енергія",concentratedSolarPowerTutorials:{EffectOfAzimuthOfParabolicTrough:"Вплив азимуту параболічного сонячного колектора",EffectOfLatusRectumOfParabolicTrough:"Вплив прямої лінії на параболічний сонячний колектор",FocusSunlightWithParabolicDish:"Фокусування сонячного світла за допомогою параболічного диску",LinearFresnelReflectors:"Лінійні відбивачі Френеля",EffectOfAbsorberPipeHeightForLinearFresnelReflectors:"Вплив висоти поглинаючої трубки на лінійні відбивачі Френеля",EffectOfAzimuthOfLinearFresnelReflectors:"Вплив азимуту на лінійні відбивачі Френеля",LinearFresnelReflectorsWithTwoAbsorbers:"Лінійні відбивачі Френеля з двома поглинаючими елементами",CosineEfficiencyOfHeliostats:"Косинусна ефективність геліостатів",ShadowingAndBlockingOfHeliostats:"Затінення та блокування геліостатів",EffectSolarPowerTowerHeight:"Вплив висоти сонячної вежі з використаним повітрям",SolarPowerTower:"Сонячна вежа з використаним повітрям"},otherTypesOfSolarPowerSubMenu:"Інші типи сонячної енергії",otherTypesOfSolarPowerTutorials:{SolarUpdraftTower:"Сонячна вежа з використаним повітрям"},windPowerSubMenu:"Wind Power",windPowerTutorials:{EffectOfBladeNumberOfWindTurbine:"Effect of Blade Number of Wind Turbine",EffectOfPitchAngleOfWindTurbineBlades:"Effect of Pitch Angle of Wind Turbine Blades",BirdSafeBladeDesign:"Bird-Safe Blade Design",OffshoreWindFarm:"Offshore Wind Farm"},colocationSubMenu:"Colocation",colocationTutorials:{AgricultureSolarWindColocation:"Agriculture-Solar-Wind Colocation"},generativeDesignSubMenu:"Generative Design",generativeDesignTutorials:{MonofacialSolarPanelArrayTiltAngle:"The Tilt Angle of a Monofacial Solar Panel Array",BifacialSolarPanelArrayTiltAngle:"The Tilt Angle of a Bifacial Solar Panel Array",OutputOfSolarPanelArrayInDifferentPlaces:"The Output of a Solar Panel Array in Different Places",SimpleSolarFarmParetoFront:"The Pareto Front for Designing a Simple Solar Farm"},examplesSubMenu:"Приклади",solarEnergySubMenu:"Сонячна енергія",solarEnergyExamples:{SunBeamAndHeliodon:"Промінь сонця та геліодон",RooftopSolarPanels:"Сонячні панелі на даху",NevadaSolarOneParabolicTroughArray:"Масив параболічних сонячних колекторів Nevada Solar One",TooeleParabolicDishArray:"Масив параболічних тарілок Tooele",PS10SolarPowerTower:"Сонячна енергетична вежа PS10",TucsonLinearFresnelReflectors:"Лінійні відбивачі Френеля в Tucson",SolarCanopyFormFactors:"Форми сонячних козирків",SolarCanopyOverBleachers:"Сонячний козирок над трибунами",SolarCanopyOverGarage:"Сонячний козирок над гаражем",SolarBusStop:"Сонячна автобусна зупинка",SolarFacadeTesla:"Сонячна фасадна панель Tesla",BuildingIntegratedPhotovoltaics:"Вбудовані фотоелектричні системи в будівлі",Floatovoltaics:"Сонячні панелі на плавучих платформах",Agrivoltaics:"Агровольтаїка",VegetativeBuffer:"Вегетативна зона",RainbowSwashSolarFarmBostonMA:"Сонячна ферма Rainbow Swash в Boston, MA",MickeyMouseSolarFarmOrlandoFL:"Сонячна ферма Міккі Мауса в Orlando, FL",SolarPanelsOverCanalBakersfieldCA:"Сонячні панелі над каналом в Bakersfield, CA",SolarNoiseBarrierLexingtonMA:"Сонячний шумовий бар'єр в Lexington, MA",HSATSolarTrackersRaleighNC:"Сонячні трекери з горизонтальною віссю в Raleign, NC",AADATSolarTrackersLancasterCA:"Сонячні трекери з азимутальною-вертикальною віссю в Lancaster, CA",SolarUpdraftTowerInCity:"Сонячна вежа з використаним повітрям у місті"},builtEnvironmentSubMenu:"Забудоване середовище",residentialBuildingsSubMenu:"Житлові будівлі",residentialBuildingExamples:{ColonialHouse:"Колоніальний будинок",DutchColonialHouse:"Голландський колоніальний будинок",TShapedHouse:"Будинок у формі літери Т",CapeCodHouseWithGarage:"Будинок у стилі Cape Cod з гаражем",Solarium:"Солярій",Church1:"Церква 1",Cathedral1:"Собор 1",Cathedral2:"Собор 2",Mosque1:"Мечеть 1",AdobeTaosHouse:"Будинок з адобе в стилі Taos",RanchHouse:"Ranch House",BonnetHouse:"Будинок в стилі Bonnet",BarnStyleHouse:"Будинок у стилі амбара",ModernHouse:"Сучасний будинок",ButterflyRoofHouse:"Будинок з метеликовим дахом"},commercialBuildingsSubMenu:"Комерційні будівлі",commercialBuildingExamples:{WhiteHouse:"Білий Дім",HaroldWashingtonCollege:"Harold Washington College",BilimMersinTurkiye:"Bilim, Mersin, Туреччина",SpanishStyleHotel:"Готель в іспанському стилі",ApartmentBuilding:"Багатоквартирний будинок",OfficeBuilding:"Офісна будівля",Hotel:"Готель"},buildingComplexesSubMenu:"Будівельні комплекси",buildingComplexExamples:{SouthBurlingtonHighSchoolVermont:"South Burlington High School, Vermont",MescaleroApacheSchoolNewMexico:"Mescalero Apache School, New Mexico"},urbanPlanningSubMenu:"Міське планування",urbanPlanningExamples:{CityBlockHeatmap:"City Block Heatmap",ChicagoSkyline:"Chicago Skyline"},otherBuildingsSubMenu:"Інші будівлі",otherBuildingExamples:{Greenhouse:"Теплиця",Pavilion:"Павільйон у парку",OctagonalPagoda:"Восьмикутна пагода",OceanFront:"Будівля біля океану",EgyptianPyramids:"Єгипетські піраміди",MayanPyramid:"Піраміда Мая",SiOSePol:"Si-O-Se-Pol",StackedCuboids:"Стековані кубоїди"},artificialIntelligenceSubMenu:"Штучний інтелект",artificialIntelligenceExamples:{OptimizingTiltAngleOfOneSolarPanelRow:"Оптимізація кута нахилу одного ряду сонячних панелей",OptimizingTiltAnglesOfMultipleSolarPanelRows:"Оптимізація кутів нахилу декількох рядів сонячних панелей",SolarFarmGenerativeDesign:"Генеративний дизайн сонячної ферми",SolarFarmGenerativeDesignWithBlock:"Генеративний дизайн сонячної ферми в присутності перешкоди",FitchburgSolarFarmGenerativeDesign:"Генеративний дизайн сонячної ферми у Fitchburg"},languageSubMenu:"Мова",publicSubMenu:"Загальнодоступно",ModelsGallery:"Галерея моделей",ModelsMap:"Карта моделей",AboutUs:"Про нас"},avatarMenu:{AccountSettings:"Налаштування облікового запису",PrivacyStatementTitle:"User Privacy Protection Statement",PrivacyStatement:"Коли ви увійдете, ваш Google ID використовується для створення та доступу до вашого облікового запису Aladdin. В нашій базі даних зберігається лише випадковий алфавітно-цифровий рядок як посилання. Ми ніколи не збираємо особисто ідентифіковану інформацію, таку як ваше ім'я або електронна пошта. Для отримання додаткової інформації ознайомтесь з нашою ",SignIn:"Увійти",SignOut:"Вийти",IfYouAreAStudent:"Якщо ви студент"},skyMenu:{Axes:"Вісі",Theme:"Тематика",ThemeDefault:"За замовчуванням",ThemeDesert:"Пустеля",ThemeDune:"Дюна",ThemeForest:"Ліс",ThemeGrassland:"Степ",ThemeHill:"Пагорб",ThemeLake:"Озеро",ThemeMountain:"Гора",ThemeRural:"Сільська місцевість",SunlightAttenuationCoefficientInAir:"Коефіцієнт затухання сонячного світла у повітрі",ConvectiveCoefficientOfAir:"Коефіцієнт конвекції повітря",HighestTemperatureTimeInMinutes:"Час найвищої температури (хвилини)",SelectSunAnglesToShow:"Виберіть кути сонця, які показати",ShowAzimuthAngle:"Показати азимутний кут",ShowElevationAngle:"Показати висотний кут",ShowZenithAngle:"Показати зенітний кут",DirectLightBrightnessAtNoon:"Direct Light Brightness at Noon",AmbientLightBrightnessAtNoon:"Ambient Light Brightness at Noon"},groundMenu:{MonthlyIrradianceLoss:"Monthly Irradiance Loss",Vegetation:"Рослинність",LeafOutDay:"День розпускання листя",LeafOffDay:"День опадання листя",Albedo:"Альбедо",ImageOnGround:"Зображення на поверхні",WaterSurface:"Поверхня води",RemoveAllUnlockedTrees:"Видалити всі розблоковані дерева",RemoveAllUnlockedFlowers:"Видалити всі розблоковані квіти",RemoveAllUnlockedSolarPanels:"Remove All Unlocked Solar Panels",RemoveAllUnlockedPeople:"Видалити всіх розблокованих людей",RemoveAllUnlockedFoundations:"Видалити всі розблоковані фундаменти",RemoveAllUnlockedCuboids:"Видалити всі розблоковані кубоїди",DoYouReallyWantToRemoveAllPeople:"Ви дійсно хочете видалити всіх людей, що не заблоковані",DoYouReallyWantToRemoveAllTrees:"Ви дійсно хочете видалити всі дерева, що не заблоковані",DoYouReallyWantToRemoveAllFlowers:"Ви дійсно хочете видалити всі квіти, що не заблоковані",DoYouReallyWantToRemoveAllSolarPanels:"Do you really want to remove all the solar panels that are not locked",DoYouReallyWantToRemoveAllFoundations:"Ви дійсно хочете видалити всі фундаменти, що не заблоковані",DoYouReallyWantToRemoveAllCuboids:"Ви дійсно хочете видалити всі кубоїди, що не заблоковані",LockAllUnlockedElements:"Lock All Unlocked Elements",UnlockAllLockedElements:"Unlock All Locked Elements"},labelSubMenu:{Label:"Мітка",LabelText:"Текст мітки",LabelHeight:"Висота мітки",LabelSize:"Розмір мітки",LabelFontSize:"Розмір шрифту",LabelColor:"Колір мітки",KeepShowingLabel:"Залишати видимою мітку"},foundationMenu:{RemoveAllUnlockedSolarPanels:"Видалити всі незаблоковані сонячні панелі",RemoveAllUnlockedParabolicTroughs:"Видалити всі незаблоковані параболічні сонячні колектори",RemoveAllUnlockedParabolicDishes:"Видалити всі незаблоковані параболічні антени",RemoveAllUnlockedFresnelReflectors:"Видалити всі незаблоковані відбивачі Френеля",RemoveAllUnlockedHeliostats:"Видалити всі незаблоковані геліостати",RemoveAllUnlockedWindTurbines:"Remove All Unlocked Wind Turbines",RemoveAllUnlockedSensors:"Видалити всі незаблоковані датчики",RemoveAllUnlockedLights:"Видалити всі незаблоковані освітлювальні прилади",RemoveAllUnlockedWalls:"Видалити всі незаблоковані стіни",RemoveAllUnlockedWindows:"Видалити всі незаблоковані вікна",RemoveAllUnlockedDoors:"Видалити всі незаблоковані двері",RemoveAllUnlockedPolygons:"Видалити всі незаблоковані полігони",RemoveAllUnlockedHumans:"Видалити всіх незаблокованих людей",RemoveAllUnlockedTrees:"Видалити всі незаблоковані дерева",RemoveAllUnlockedFlowers:"Видалити всі незаблоковані квіти",Racks:"Стелажі",Texture01:"Текстура 1",Texture02:"Текстура 2",Texture03:"Текстура 3",Texture04:"Текстура 4",Texture05:"Текстура 5",Texture06:"Текстура 6",Texture07:"Текстура 7",Texture08:"Текстура 8",Texture09:"Текстура 9",Texture10:"Текстура 10",SolarPanels:"Сонячні панелі",SolarPanelArray:"Solar Panel Array",DoYouReallyWantToRemoveAllSolarPanelsOnFoundation:"Ви дійсно бажаєте видалити всі сонячні панелі на цьому фундаменті, які не є заблокованими",ParabolicTroughs:"Параболічні сонячні колектори",DoYouReallyWantToRemoveAllParabolicTroughsOnFoundation:"Ви дійсно бажаєте видалити всі параболічні сонячні колектори на цьому фундаменті, які не є заблокованими",ParabolicDishes:"Параболічні антени",DoYouReallyWantToRemoveAllParabolicDishesOnFoundation:"Ви дійсно бажаєте видалити всі параболічні антени на цьому фундаменті, які не є заблокованими",FresnelReflectors:"Відбивачі Френеля",DoYouReallyWantToRemoveAllFresnelReflectorsOnFoundation:"Ви дійсно бажаєте видалити всі відбивачі Френеля на цьому фундаменті, які не є заблокованими",Heliostats:"Геліостати",DoYouReallyWantToRemoveAllHeliostatsOnFoundation:"Ви дійсно бажаєте видалити всі геліостати на цьому фундаменті, які не є заблокованими",WindTurbines:"Wind Turbines",DoYouReallyWantToRemoveAllWindTurbinesOnFoundation:"Do you really want to remove all the wind turbines on this foundation that are not locked",Sensors:"Датчики",DoYouReallyWantToRemoveAllSensorsOnFoundation:"Ви дійсно бажаєте видалити всі датчики на цьому фундаменті, які не є заблокованими",Lights:"Світильники",DoYouReallyWantToRemoveAllLightsOnFoundation:"Ви дійсно бажаєте видалити всі світильники на цьому фундаменті, які не є заблокованими",Walls:"Стіни",DoYouReallyWantToRemoveAllWallsOnFoundation:"Ви дійсно бажаєте видалити всі стіни на цьому фундаменті, які не є заблокованими",Windows:"Вікна",DoYouReallyWantToRemoveAllWindowsOnFoundation:"Ви дійсно бажаєте видалити всі вікна на цьому фундаменті, які не є заблокованими",Doors:"Двері",DoYouReallyWantToRemoveAllDoorsOnFoundation:"Ви дійсно бажаєте видалити всі двері на цьому фундаменті, які не є заблокованими",Polygons:"Багатокутники",DoYouReallyWantToRemoveAllPolygonsOnFoundation:"Ви дійсно бажаєте видалити всі багатокутники на цьому фундаменті, які не є заблокованими",Humans:"Люди",DoYouReallyWantToRemoveAllHumansOnFoundation:"Ви дійсно бажаєте видалити всіх людей на цьому фундаменті, які не є заблокованими",Trees:"Дерева",DoYouReallyWantToRemoveAllTreesOnFoundation:"Ви дійсно бажаєте видалити всі дерева на цьому фундаменті, які не є заблокованими",Flowers:"Квіти",DoYouReallyWantToRemoveAllFlowersOnFoundation:"Ви дійсно бажаєте видалити всі квіти на цьому фундаменті, які не є заблокованими",OnlyThisFoundation:"Тільки цей фундамент",AllConnectedFoundations:"Всі пов’язані фундаменти",AllSelectedFoundations:"All Selected Foundations",AllFoundations:"Всі фундаменти",AddPolygon:"Додати багатокутник",SolarStructure:"Вибрати сонячну структуру",GroupMaster:"Груповий майстер",LockAllUnlockedElementsOnThisFoundation:"Lock All Unlocked Elements on This Foundation",UnlockAllLockedElementsOnThisFoundation:"Unlock All Locked Elements on This Foundation",GroundFloorRValue:"Теплопровідність перекриття цокольного поверху",OnlyThisGroundFloor:"Тільки цокольний поверх",AllGroundFloors:"Всі цокольні поверхи"},solarPowerTowerMenu:{ReceiverTowerForHeliostats:"Вежа приймача для геліостатів",ReceiverTowerPhysicalProperties:"Фізичні властивості вежі приймача",ReceiverTowerHeight:"Висота вежі приймача",ReceiverTowerRadius:"Радіус вежі приймача",ReceiverAbsorptance:"Поглинання приймача",ReceiverOpticalEfficiency:"Оптична ефективність приймача",ReceiverThermalEfficiency:"Теплова ефективність приймача"},solarAbsorberPipeMenu:{AbsorberPipeForFresnelReflectors:"Трубопровід для відбивачів Френеля",AbsorberPipePhysicalProperties:"Фізичні властивості трубопроводу поглинання",AbsorberHeight:"Висота трубопроводу поглинання",AbsorberApertureWidth:"Ширина отвору трубопроводу поглинання",AbsorberPipePoleNumber:"Кількість полюсів для трубопроводу поглинання",AbsorberAbsorptance:"Сила поглинання",AbsorberOpticalEfficiency:"Оптична ефективність поглинача",AbsorberThermalEfficiency:"Теплова ефективність поглинача"},solarUpdraftTowerMenu:{SolarUpdraftTower:"Сонячна вежа з тяговим потоком",SolarUpdraftTowerPhysicalProperties:"Фізичні властивості сонячної вежі з тяговим потоком",SolarUpdraftTowerChimneyHeight:"Висота димової труби сонячної вежі з тяговим потоком",SolarUpdraftTowerChimneyRadius:"Радіус димової труби сонячної вежі з тяговим потоком",SolarUpdraftTowerCollectorHeight:"Висота колектора сонячної вежі з тяговим потоком",SolarUpdraftTowerCollectorRadius:"Радіус колектора сонячної вежі з тяговим потоком",SolarUpdraftTowerCollectorTransmissivity:"Проникність колектора сонячної вежі з тяговим потоком",SolarUpdraftTowerCollectorEmissivity:"Випромінюваність колектора сонячної вежі з тяговим потоком",SolarUpdraftTowerDischargeCoefficient:"Коефіцієнт викиду сонячної вежі з тяговим потоком",SolarUpdraftTowerTurbineEfficiency:"Ефективність турбіни сонячної вежі з тяговим потоком"},cuboidMenu:{Texture01:"Текстура 1",Texture02:"Текстура 2",Texture03:"Текстура 3",Texture04:"Текстура 4",Texture05:"Текстура 5",Texture06:"Текстура 6",Texture07:"Текстура 7",Texture08:"Текстура 8",Texture09:"Текстура 9",Texture10:"Текстура 10",RemoveAllUnlockedSolarPanels:"Видалити всі розблоковані сонячні панелі",RemoveAllUnlockedSensors:"Видалити всі розблоковані сенсори",RemoveAllUnlockedPolygons:"Видалити всі розблоковані полігони",RemoveAllUnlockedHumans:"Видалити всіх розблокованих людей",RemoveAllUnlockedTrees:"Видалити всі розблоковані дерева",RemoveAllUnlockedFlowers:"Видалити всі розблоковані квіти",RemoveAllUnlockedLights:"Remove All Unlocked Lights",Racks:"Стійки",Lights:"Lights",DoYouReallyWantToRemoveAllLightsOnCuboid:"Do you really want to remove all the lights on this cuboid that are not locked",SolarPanels:"Сонячні панелі",DoYouReallyWantToRemoveAllSolarPanelsOnCuboid:"Ви дійсно бажаєте видалити всі сонячні панелі на цьому кубоїді, які не заблоковані",Sensors:"Сенсори",DoYouReallyWantToRemoveAllSensorsOnCuboid:"Ви дійсно бажаєте видалити всі сенсори на цьому кубоїді, які не заблоковані",Polygons:"Полігони",DoYouReallyWantToRemoveAllPolygonsOnCuboid:"Ви дійсно бажаєте видалити всі полігони на цьому кубоїді, які не заблоковані",Humans:"Люди",DoYouReallyWantToRemoveAllHumansOnCuboid:"Ви дійсно бажаєте видалити всіх людей на цьому кубоїді, які не заблоковані",Trees:"Дерева",DoYouReallyWantToRemoveAllTreesOnCuboid:"Ви дійсно бажаєте видалити всі дерева на цьому кубоїді, які не заблоковані",Flowers:"Квіти",DoYouReallyWantToRemoveAllFlowersOnCuboid:"Ви дійсно бажаєте видалити всі квіти на цьому кубоїді, які не заблоковані",OnlyThisCuboid:"Тільки цей кубоїд",AllCuboidsOnSameSurface:"Усі кубоїди на одній поверхні",AllCuboidsAboveSameBase:"Усі кубоїди над тією ж основою",AllSelectedCuboids:"All Selected Cuboids",AllCuboids:"Всі кубоїди",OnlyThisSide:"Тільки ця сторона",AllSidesOfThisCuboid:"Всі сторони цього кубоїда",AllSidesOfSelectedCuboids:"All Sides of Selected Cuboids",AllSidesOfAllCuboids:"Всі сторони всіх кубоїдів",AddPolygon:"Додати полігон",Stackable:"Стекабельне",GroupMaster:"Майстер групи"},polygonMenu:{Texture01:"Текстура 1",Texture02:"Текстура 2",Texture03:"Текстура 3",Texture04:"Текстура 4",Texture05:"Текстура 5",Texture06:"Текстура 6",Texture07:"Текстура 7",Texture08:"Текстура 8",Texture09:"Текстура 9",Texture10:"Текстура 10",TextBox:"Текстове поле",FontOutlineColor:"Колір контуру шрифту",FontOutlineWidth:"Товщина контуру шрифту",FontStrokeColor:"Колір обводки шрифту",FontStrokeWidth:"Товщина обводки шрифту",NoOutline:"Без контуру",Shiny:"Блискучий",Filled:"Заповнений",FillTexture:"Текстура заповнення",FillColor:"Колір заповнення",Opacity:"Прозорість",LineColor:"Колір лінії",LineWidth:"Товщина лінії",LineStyle:"Стиль лінії",SolidLine:"Суцільна лінія",DashedLine:"Пунктирна лінія",DottedLine:"Точкова лінія",InsertVertexBeforeIndex:"Вставити вершину перед індексом",InsertVertexAfterIndex:"Вставити вершину після індексу",DeleteVertex:"Видалити вершину",OnlyThisPolygon:"Тільки цей полігон",AllPolygonsOnSurface:"Всі полігони на цій поверхні",AllPolygonsAboveFoundation:"Всі полігони вище фундаменту",AllSelectedPolygons:"All Selected Polygons",AllPolygons:"Всі полігони",Layout:"Розташування",SolarPanelArrayLayout:"Розташування сонячних панелей",SolarPanelArrayLayoutParametricDesign:"Розташування сонячних панелей: параметричний дизайн",SolarPanelArrayLayoutGenerativeDesign:"Розташування сонячних панелей: генеративний дизайн",SolarPanelArrayModel:"Модель сонячної панелі",SolarPanelArrayOrientation:"Орієнтація",SolarPanelArrayTiltAngle:"Кут нахилу",SolarPanelArrayRowWidth:"Ширина ряду",SolarPanelArrayInterRowSpacing:"Міжрядковий інтервал",SolarPanelArrayRowSpacing:"Row Spacing",SolarPanelArrayRowAxis:"Вісь ряду",SolarPanelArrayLeftRightRowAxis:"Наліво-Направо (відносне)",SolarPanelArrayUpDownRowAxis:"Вгору-Вниз (відносне)",SolarPanelArrayEastWestRowAxis:"Схід-Захід (абсолютне)",SolarPanelArrayNorthSouthRowAxis:"Північ-Південь (абсолютне)",SolarPanelArrayMargin:"Відступ",SolarPanelArrayPoleHeight:"Висота стовпа",SolarPanelArrayPoleSpacing:"Інтервал між стовпами",SolarPanelArrayTotalYearlyCost:"Total Cost",SolarPanelArrayTotalYearlyRevenue:"Total Revenue",SolarPanelArrayTotalYearlyYield:"Total Yield",SolarPanelArrayMeanYearlyYield:"Mean Yield",SolarPanelArrayYearlyProfit:"Profit",LayoutNotAcceptedCheckYourParameters:"Це розташування не приймається. Будь ласка, перевірте ваші параметри."},optimizationMenu:{Optimization:"Оптимізація",Parameters:"Параметри",Variables:"Змінні",Constants:"Константи",GeneticAlgorithm:"Генетичний алгоритм",GeneticAlgorithmSettings:"Налаштування генетичного алгоритму",ParticleSwarmOptimization:"Оптимізація роєм частинок",ParticleSwarmOptimizationSettings:"Налаштування оптимізації роєм частинок",SolarPanelTiltAngleOptimization:"Оптимізація кута нахилу сонячних панелей",SolarPanelArrayLayout:"Розташування сонячних панелей",Generation:"Покоління",Gene:"Ген",NormalizedVariables:"Нормалізовані змінні",Objective:"Ціль",ObjectiveFunctionDailyTotalYield:"Щоденний загальний дохід",ObjectiveFunctionYearlyTotalYield:"Щорічний загальний дохід",ObjectiveFunctionDailyMeanYield:"Щоденний середній дохід",ObjectiveFunctionYearlyMeanYield:"Щорічний середній дохід",ObjectiveFunctionDailyProfit:"Щоденний прибуток",ObjectiveFunctionYearlyProfit:"Щорічний прибуток",GeneticAlgorithmSelectionMethod:"Метод вибору для генетичного алгоритму",RouletteWheel:"Велосипедне колесо",Tournament:"Турнір",SearchMethod:"Метод пошуку",GlobalSearchUniformSelection:"Глобальний пошук з однорідним вибором",LocalSearchRandomOptimization:"Локальний пошук випадкової оптимізації",PopulationSize:"Розмір населення",MaximumGenerations:"Максимальна кількість поколінь",SelectionRate:"Швидкість відбору",CrossoverRate:"Швидкість схрещування",MutationRate:"Швидкість мутації",Step:"Крок",SwarmSize:"Розмір рою",MaximumSteps:"Максимальна кількість кроків",MaximumVelocity:"Максимальна швидкість",InertiaWeight:"Вага інерції",CognitiveCoefficient:"Коефіцієнт когнітивної функції",SocialCoefficient:"Коефіцієнт соціальної взаємодії",ConvergenceThreshold:"Поріг збіжності для завершення",LocalSearchRadius:"Радіус локального пошуку",RowsPerRackRange:"Діапазон для рядів на стелаж",TiltAngleRange:"Діапазон для кута нахилу",InterRowSpacingRange:"Діапазон для міжрядкового проміжку",ClickTargetPolygonToActivate:"Натисніть на цільовий полігон для активації",ClickTargetFoundationToActivate:"Натисніть на цільовий фундамент для активації"},treeMenu:{ShowModel:"Показати модель",Flip:"Перевернути",Type:"Тип",Spread:"Розповсюдження"},flowerMenu:{Flip:"Перевернути",Type:"Тип",Spread:"Розповсюдження"},peopleMenu:{ChangePerson:"Змінити особу",Flip:"Перевернути",Observer:"Спостерігач",ViewFromThisPerson:"Переглянути з цієї особи"},lightMenu:{Color:"Колір",Intensity:"Інтенсивність",Decay:"Затухання",MaximumDistance:"Максимальна відстань",Inside:"Усередині"},solarCollectorMenu:{Coordinates:"Coordinates",RelativeXCoordinateOfCenter:"Relative X Coordinate of Center",RelativeYCoordinateOfCenter:"Relative Y Coordinate of Center",RelativeAzimuth:"Відносний азимут",Pole:"Стовп",PoleHeight:"Висота стовпа",PoleRadius:"Pole Radius",ExtraPoleHeight:"Додаткова висота стовпа",ExtraPoleHeightInAdditionToHalfWidth:"Додаткова висота стовпа на додаток до половини ширини",DrawSunBeam:"Намалювати промінь сонця"},concentratedSolarPowerCollectorMenu:{ReflectorReflectance:"Відбивання відбивача",ReceiverAbsorptance:"Поглинання приймача",ReflectorOpticalEfficiency:"Оптична ефективність відбивача",ReceiverThermalEfficiency:"Теплова ефективність приймача"},waterHeaterMenu:{OnlyThisWaterHeater:"Only This Water Heater",AllWaterHeatersOnSurface:"All Water Heaters on the Same Surface",AllWaterHeatersAboveFoundation:"All Water Heaters Above the Same Foundation",AllSelectedWaterHeaters:"All Selected Water Heaters",AllWaterHeaters:"All Water Heaters"},solarPanelMenu:{ElectricalProperties:"Electrical Properties",InverterEfficiency:"Inverter Efficiency",InverterEfficiencyExplained:"The efficiency for converting direct current (DC) to alternating current (AC).",DcToAcSizeRatio:"DC-to-AC Size Ratio",DcToAcSizeRatioExplained:"The ratio of the solar panels' DC-rated size to the inverter's AC-rated size.",ChangePvModel:"Змінити модель",Orientation:"Орієнтація",Portrait:"Вертикальна",Landscape:"Горизонтальна",FrameColor:"Колір рамки",Panels:"панелі",PanelsWide:"панелі по ширині",PanelsLong:"панелі по довжині",TiltAngle:"Кут нахилу",SouthFacingIsPositive:"Південь вважається позитивним",Tracker:"Трекер",SolarTrackerFollowsSun:"Трекер слідкує за сонцем для збільшення виходу сонячних панелей.",PoleSpacing:"Відстань між стовпами",NoTracker:"Без трекера",HorizontalSingleAxisTracker:"Трекер з горизонтальною одноосевою орієнтацією",VerticalSingleAxisTracker:"Трекер з вертикальною одноосевою орієнтацією",AltazimuthDualAxisTracker:"Трекер з азимутально-альтазимутальною двоосевою орієнтацією",OnlyThisSolarPanel:"Тільки ця сонячна панель",AllSolarPanelsOnSurface:"Всі сонячні панелі на одній поверхні",AllSolarPanelsAboveFoundation:"Всі сонячні панелі над однією фундаментом",AllSelectedSolarPanels:"All Selected Solar Panels",AllSolarPanels:"Всі сонячні панелі"},pvModelPanel:{SolarPanelSpecs:"Технічні характеристики сонячної панелі",Model:"Модель",PanelSize:"Розмір панелі",Cells:"Комірки",CellType:"Тип комірок",Monocrystalline:"Монокристалічні",Polycrystalline:"Полікристалічні",ThinFilm:"Тонкоплівкові",Bifacial:"Bifacial",BifacialityFactor:"Bifaciality Factor",Black:"Чорний",Blue:"Синій",ShadeTolerance:"Стійкість до затінення",SolarCellEfficiency:"Ефективність сонячної комірки",NominalOperatingCellTemperature:"Номінальна робоча температура комірки",TemperatureCoefficientOfPmax:"Температурний коефіцієнт Pmax"},parabolicTroughMenu:{ModuleLength:"Довжина модуля",Modules:"модулі",ModulesLong:"модулів у довжину",LatusRectum:"Велика піввісь",OnlyThisParabolicTrough:"Тільки цей параболічний сонячний колектор",AllParabolicTroughsAboveFoundation:"Усі параболічні сонячні колектори над цим фундаментом",AllSelectedParabolicTroughs:"All Selected Parabolic Troughs",AllParabolicTroughs:"Усі параболічні сонячні колектори"},fresnelReflectorMenu:{AbsorberPipe:"Труба поглинання",SelectAbsorberToReflectSunlightTo:"Виберіть поглинач, до якого буде відбиватися сонячне світло",ModuleLength:"Довжина модуля",Modules:"модулі",ModulesLong:"модулів у довжину",OnlyThisFresnelReflector:"Тільки цей відбивач Френеля",AllFresnelReflectorsAboveFoundation:"Усі відбивачі Френеля над цим фундаментом",AllSelectedFresnelReflectors:"All Selected Fresnel Reflectors",AllFresnelReflectors:"Усі відбивачі Френеля"},heliostatMenu:{Tower:"Вежа",SelectTowerToReflectSunlightTo:"Виберіть вежу, до якої буде відбиватися сонячне світло",OnlyThisHeliostat:"Тільки цей геліостат",AllHeliostatsAboveFoundation:"Усі геліостати над цим фундаментом",AllSelectedHeliostats:"All Selected Heliostats",AllHeliostats:"Усі геліостати"},parabolicDishMenu:{ReceiverStructure:"Структура приймача",CentralPole:"Центральний стовп",CentralPoleWithTripod:"Центральний стовп з триногою",Quadrupod:"Чотиринога",RimDiameter:"Діаметр ободу",LatusRectum:"Велика піввісь",ExtraPoleHeightInAdditionToRadius:"Додаткова висота стовпа плюс радіус",OnlyThisParabolicDish:"Тільки ця параболічна тарілка",AllParabolicDishesAboveFoundation:"Усі параболічні тарілки над цим фундаментом",AllSelectedParabolicDishes:"All Selected Parabolic Dishes",AllParabolicDishes:"Усі параболічні тарілки"},windTurbineMenu:{BirdSafeDesign:"Bird-Safe Design",BirdSafeNone:"None",BirdSafeBicolor:"Bicolor",BirdSafeStriped:"Striped",Rotor:"Rotor",BladeNumber:"Blade Number",RotorInitialAngle:"Rotor Initial Angle",RotorBladeDesign:"Rotor Blade Design",RotorBladeRadius:"Rotor Blade Radius",RotorBladePitchAngle:"Rotor Blade Pitch Angle",RelativeYawAngle:"Relative Yaw Angle",MaximumChordLength:"Maximum Chord Length",Tower:"Tower",TowerHeight:"Tower Height",TowerRadius:"Tower Radius",HubDesign:"Hub Design",HubRadius:"Hub Radius",HubLength:"Hub Length",OnlyThisWindTurbine:"Only This Wind Turbine",AllWindTurbinesAboveFoundation:"All Wind Turbines Above the Same Foundation",AllSelectedWindTurbines:"All Selected Wind Turbines",AllWindTurbines:"All Wind Turbines"},wallMenu:{TextureDefault:"Типова текстура",Texture01:"Текстура 1",Texture02:"Текстура 2",Texture03:"Текстура 3",Texture04:"Текстура 4",Texture05:"Текстура 5",Texture06:"Текстура 6",Texture07:"Текстура 7",Texture08:"Текстура 8",Texture09:"Текстура 9",Texture10:"Текстура 10",SizeOfWall:"Розмір стіни",OnlyThisWall:"Тільки ця стіна",AllConnectedWalls:"Всі пов'язані стіни",AllWallsAboveFoundation:"Всі стіни над цим фундаментом",AllSelectedWalls:"All Selected Walls",AllWalls:"Всі стіни",Windows:"Вікна",LockAllUnlockedWindows:"Lock All Unlocked Windows",UnlockAllLockedWindows:"Unlock All Locked Windows",RemoveAllUnlockedWindows:"Видалити всі розблоковані вікна",DoYouReallyWantToRemoveAllWindowsOnThisWall:"Ви дійсно бажаєте видалити всі вікна на цій стіні",Doors:"Двері",LockAllUnlockedDoors:"Lock All Unlocked Doors",UnlockAllLockedDoors:"Unlock All Locked Doors",RemoveAllUnlockedDoors:"Видалити всі розблоковані двері",DoYouReallyWantToRemoveAllDoorsOnThisWall:"Ви дійсно бажаєте видалити всі двері на цій стіні",SolarPanels:"Сонячні панелі",LockAllUnlockedSolarPanels:"Lock All Unlocked Solar Panels",UnlockAllLockedSolarPanels:"Unlock All Locked Solar Panels",RemoveAllUnlockedSolarPanels:"Видалити всі розблоковані сонячні панелі",DoYouReallyWantToRemoveAllSolarPanelsOnThisWall:"Ви дійсно бажаєте видалити всі сонячні панелі на цій стіні",Sensors:"Датчики",LockAllUnlockedSensors:"Lock All Unlocked Sensors",UnlockAllLockedSensors:"Unlock All Locked Sensors",RemoveAllUnlockedSensors:"Видалити всі розблоковані датчики",DoYouReallyWantToRemoveAllSensorsOnThisWall:"Ви дійсно бажаєте видалити всі датчики на цій стіні",Lights:"Лампи",LockAllUnlockedLights:"Lock All Unlocked Lights",UnlockAllLockedLights:"Unlock All Locked Lights",RemoveAllUnlockedLights:"Видалити всі розблоковані лампи",DoYouReallyWantToRemoveAllLightsOnThisWall:"Ви дійсно бажаєте видалити всі лампи на цій стіні",Polygons:"Polygons",LockAllUnlockedPolygons:"Lock All Unlocked Polygons",UnlockAllLockedPolygons:"Unlock All Locked Polygons",RemoveAllUnlockedPolygons:"Видалити всі розблоковані полігони",DoYouReallyWantToRemoveAllPolygonsOnThisWall:"Do you really want to remove all the polygons on this wall",WallStructure:"Структура стіни",DefaultStructure:"Типова",StudStructure:"Студ",PillarStructure:"Пілар",Opacity:"Непрозорість",StructureSpacing:"Відстань між структурами",StructureWidth:"Ширина структури",StructureThickness:"Товщина структури",StructureColor:"Колір структури",Color:"Колір стіни",Height:"Висота",Thickness:"Товщина",Texture:"Текстура",AllLightsOnWallInside:"Всі лампи всередині стіни",AllLightsOnWallOutside:"Всі лампи ззовні стіни",Fill:"Заповнення",Full:"Повне",Partial:"Часткове",Empty:"Порожнє",OpenToOutside:"Відкрите на зовнішню сторону",EavesLength:"Довжина карнизу",Parapet:"Перила",ParapetColor:"Колір перил",ParapetTexture:"Текстура перил",ParapetHeight:"Висота перил",CopingsHeight:"Висота паркану",CopingsWidth:"Ширина паркану"},windowMenu:{OnlyThisWindow:"Тільки це вікно",AllWindowsOnSurface:"All Windows on the Same Surface",AllWindowsAboveFoundation:"Всі вікна над однією фундаментом",AllSelectedWindows:"All Selected Windows",AllWindows:"Всі вікна",Width:"Ширина",Height:"Висота",Setback:"Setback from Exterior Surface",RelativeToWallThickness:"Relative to wall thickness",Mullion:"Розділовий стовпець",HorizontalMullion:"Horizontal Mullion",VerticalMullion:"Vertical Mullion",MullionWidth:"Ширина розділового стовпця",HorizontalMullionSpacing:"Horizontal Mullion Spacing",VerticalMullionSpacing:"Vertical Mullion Spacing",MullionColor:"Колір розділового стовпця",Tint:"Відтінок",Opacity:"Непрозорість",SolarHeatGainCoefficient:"Коефіцієнт сонячного теплового навантаження (SHGC) = 1 - непрозорість",Shutter:"Жалюзі",LeftShutter:"Ліве жалюзі",RightShutter:"Праве жалюзі",BothShutters:"Обидві жалюзі",ShutterWidth:"Відносна ширина",ShutterColor:"Колір жалюзі",Frame:"Рамка",FrameWidth:"Ширина рамки",SillWidth:"Ширина підвіконня",Color:"Колір рамки",WindowType:"Тип вікна",Default:"Типове",Arched:"Аркове",Polygonal:"Багатокутне",Interior:"Інтер'єр",Empty:"Порожнє"},roofMenu:{TextureDefault:"Типове",Texture01:"Текстура 1",Texture02:"Текстура 2",Texture03:"Текстура 3",Texture04:"Текстура 4",Texture05:"Текстура 5",Texture06:"Текстура 6",Texture07:"Текстура 7",OnlyThisRoof:"Тільки цей дах",AllRoofsAboveFoundation:"Всі дахи над одним фундаментом",AllSelectedRoofs:"All Selected Roofs",AllRoofs:"Всі дахи",OnlyThisCeiling:"Тільки ця стеля",AllCeilingsAboveFoundation:"Всі стелі над одним фундаментом",AllCeilings:"Всі стелі",EavesOverhangLength:"Довжина виступу карнизу",RafterSpacing:"Відстань між стропилами",RafterWidth:"Ширина стропила",RafterThickness:"Товщина стропила",RafterColor:"Колір стропила",RoofColor:"Колір даху",RoofSideColor:"Колір бокової частини даху",GlassTint:"Колір скла",Opacity:"Непрозорість",RoofStructure:"Структура даху",DefaultStructure:"Типова",RafterStructure:"Стропило",GlassStructure:"Скло",SolarPanels:"Сонячні панелі",LockAllUnlockedSolarPanels:"Lock All Unlocked Solar Panels",UnlockAllLockedSolarPanels:"Unlock All Locked Solar Panels",RemoveAllUnlockedSolarPanels:"Видалити всі розблоковані сонячні панелі",DoYouReallyWantToRemoveAllSolarPanelsOnThisRoof:"Ви дійсно бажаєте видалити всі сонячні панелі на цьому даху",Windows:"Вікна",LockAllUnlockedWindows:"Lock All Unlocked Windows",UnlockAllLockedWindows:"Unlock All Locked Windows",RemoveAllUnlockedWindows:"Видалити всі розблоковані вікна",DoYouReallyWantToRemoveAllWindowsOnThisRoof:"Ви дійсно бажаєте видалити всі вікна на цьому даху",Sensors:"Сенсори",LockAllUnlockedSensors:"Lock All Unlocked Sensors",UnlockAllLockedSensors:"Unlock All Locked Sensors",RemoveAllUnlockedSensors:"Видалити всі розблоковані сенсори",DoYouReallyWantToRemoveAllSensorsOnThisRoof:"Ви дійсно бажаєте видалити всі сенсори на цьому даху",Lights:"Лампи",RemoveAllUnlockedLights:"Видалити всі розблоковані лампи",DoYouReallyWantToRemoveAllLightsOnThisRoof:"Ви дійсно бажаєте видалити всі лампи на цьому даху",AllLightsOnRoofInside:"Всі лампи на даху всередині",AllLightsOnRoofOutside:"Всі лампи на даху ззовні",Rise:"Піднімання",Ceiling:"Стеля",RoofRValue:"Значення R для даху",CeilingRValue:"Значення R для стелі"},doorMenu:{TextureDefault:"За замовчуванням",Texture01:"Текстура 1",Texture02:"Текстура 2",Texture03:"Текстура 3",Texture04:"Текстура 4",Texture05:"Текстура 5",Texture06:"Текстура 6",Texture07:"Текстура 7",Texture08:"Текстура 8",Texture09:"Текстура 9",Texture10:"Текстура 10",Texture11:"Текстура 11",Texture12:"Текстура 12",Texture13:"Текстура 13",Texture14:"Текстура 14",Texture15:"Текстура 15",Texture16:"Текстура 16",Texture17:"Текстура 17",OnlyThisDoor:"Тільки ці двері",AllDoorsOnWall:"Всі двері на цій стіні",AllDoorsAboveFoundation:"Всі двері над тим самим фундаментом",AllSelectedDoors:"All Selected Doors",AllDoors:"Всі двері",DoorType:"Тип дверей",Default:"За замовчуванням",Arched:"Аркові",Filled:"Заповнені",FrameColor:"Колір рамки",Interior:"Інтер'єр"},siteInfoPanel:{High:"Високо",Low:"Низько"},designInfoPanel:{NumberOfSelectedHeliostats:"Кількість вибраних геліостатів",NumberOfSelectedSolarPanels:"Кількість вибраних сонячних панелей",ElectricityGeneratedDailyBySolarPanels:"Електрика, що генерується щоденно цими сонячними панелями",SceneDiameter:"Діаметр сцени",BuildingArea:"Площа будівлі"},visualizationControlPanel:{ColorContrast:"Контраст кольору",FluxScale:"Шкала потоку",ClickUpOrDownArrowButtonsToChange:"Натисніть кнопки зі стрілками вгору або вниз щоб змінити"},instructionPanel:{Rotate:"Повернути",DragMouse:"Перетягніть мишею",Zoom:"Масштабування",MouseWheelOrKeys:"Обертайте колесо миші або натисніть Ctrl+[ або Ctrl+]",MouseWheelOrKeysMac:"Обертайте колесо миші або натисніть ⌘+[ або ⌘+]",Pan:"Переміщення",HoldCtrlDragMouse:"Натисніть і утримуйте Ctrl, перетягніть мишею",HoldMetaDragMouse:"Натисніть і утримуйте ⌘, перетягніть мишею",Enter2DMode:"Ввійти в 2D режим",Exit2DMode:"Вийти з 2D режиму",NavigationMode:"Режим навігації",EnableNavigation:"Увімкнути навігацію",DisableNavigation:"Вимкнути навігацію",MoveForwardBack:"Рухатися вперед/назад",MoveForwardBackInstruction:"Натисніть W/S",MoveLeftRight:"Рухатися вліво/вправо",MoveLeftRightInstruction:"Натисніть A/D",MoveUpDown:"Рухатися вгору/вниз",MoveUpDownInstruction:"Натисніть Z/X",Turn:"Повернути",TurnInstruction:"Натисніть клавіші зі стрілками",ResetView:"Скинути",AutoRotate:"Автоматичний поворот",StartOrStop:"Натисніть F4, щоб почати або зупинити"},mapPanel:{ImageOnGround:"Зображення на землі",HideAddress:"Hide Address",WeatherStations:"Метеостанції",WeatherStationsNote:"Вимкніть це, щоб прискорити",Coordinates:"Координати",Zoom:"Масштабування"},visibilityPanel:{SolarPanelVisibility:"Видимість сонячних панелей",Observer:"Спостерігач",VantagePoint:"Точка огляду",ItemizedVisibilityByFields:"Розгорнутий за полями",TotalVisibility:"Загальна видимість"},sensorPanel:{LightSensor:"Датчик освітленості",WeatherDataFrom:"Метеодані з"},buildingEnergyPanel:{DailyBuildingEnergy:"Щоденна енергія будівлі",YearlyBuildingEnergy:"Річна енергія будівлі",Heater:"Обігрівач",AC:"Кондиціонер",SolarPanel:"Сонячна панель",Net:"Всього"},solarPanelYieldPanel:{SolarPanelDailyYield:"Щоденний дохід сонячних панелей",SolarPanelYearlyYield:"Річний дохід сонячних панелей",Yield:"Дохід",YieldPerHour:"Дохід за годину",DailyTotal:"Щоденний загальний",YearlyTotal:"Річний загальний",ShowOutputsOfIndividualSolarPanels:"Показати дохід окремих сонячних панелей",Profit:"Прибуток",TotalCost:"Total Cost",TotalRevenue:"Total Revenue",TotalYield:"Total Yield",MeanYield:"Mean Yield",ModuleCount:"Module Count"},parabolicTroughYieldPanel:{ParabolicTroughDailyYield:"Щоденний дохід параболічних сонячних колекторів",ParabolicTroughYearlyYield:"Річний дохід параболічних сонячних колекторів",Yield:"Дохід",YieldPerHour:"Дохід за годину",DailyTotal:"Щоденний загальний",YearlyTotal:"Річний загальний",ShowOutputsOfIndividualParabolicTroughs:"Показати дохід окремих параболічних сонячних колекторів"},parabolicDishYieldPanel:{ParabolicDishDailyYield:"Щоденний дохід параболічних тарілок",ParabolicDishYearlyYield:"Річний дохід параболічних тарілок",Yield:"Дохід",YieldPerHour:"Дохід за годину",DailyTotal:"Щоденний загальний",YearlyTotal:"Річний загальний",ShowOutputsOfIndividualParabolicDishes:"Показати дохід окремих параболічних тарілок"},fresnelReflectorYieldPanel:{FresnelReflectorDailyYield:"Щоденний дохід відбивача Френеля",FresnelReflectorYearlyYield:"Річний дохід відбивача Френеля",Yield:"Дохід",YieldPerHour:"Дохід за годину",DailyTotal:"Щоденний загальний",YearlyTotal:"Річний загальний",ShowOutputsOfIndividualFresnelReflectors:"Показати дохід окремих відбивачів Френеля"},heliostatYieldPanel:{HeliostatDailyYield:"Щоденний дохід геліостату",HeliostatYearlyYield:"Річний дохід геліостату",Yield:"Дохід",YieldPerHour:"Дохід за годину",DailyTotal:"Щоденний загальний",YearlyTotal:"Річний загальний",ShowOutputsOfIndividualHeliostats:"Показати дохід окремих геліостатів"},updraftTowerYieldPanel:{UpdraftTowerDailyYield:"Щоденний дохід сонячної вежі",UpdraftTowerYearlyYield:"Річний дохід сонячної вежі",ChimneyAirTemperature:"Температура повітря у димовій трубі",ChimneyWindSpeed:"Швидкість вітру у димовій трубі",Yield:"дохід",YieldPerHour:"Дохід за годину",DailyTotal:"Щоденний загальний",YearlyTotal:"Річний загальний",ShowOutputsOfIndividualUpdraftTowers:"Показати дохід окремих сонячних веж"},heliodonPanel:{SunAndTimeSettings:"Налаштування Сонця та Часу",SunAngles:"Кути Сонця",TwentyFourHours:"24 Години"},cloudFilePanel:{CopyTitle:"Copy Title",TitleCopiedToClipBoard:"The title was copied to the clip board",SearchByTitle:"Пошук за назвою",MyLikes:"Мої вподобання",MyCloudFiles:"Мої файли у хмарному середовищі",GenerateLink:"Створити посилання",LinkGeneratedInClipBoard:"Посилання було створено та скопійовано до буферу обміну",DoYouReallyWantToDelete:"Ви дійсно бажаєте видалити",IfSharedOrPublishedRenamingFileBreaksExistingLinks:"Якщо цей файл було відкрито або опубліковано, зміна його назви порушить наявні посилання"},projectListPanel:{CopyTitle:"Copy Title",TitleCopiedToClipBoard:"The title was copied to the clip board",SearchByTitle:"Пошук за назвою",MyProjects:"My Projects",GenerateProjectLink:"Generate Project Link",ProjectLinkGeneratedInClipBoard:"A link to the project was generated in the clip board",DoYouReallyWantToDeleteProject:"Do you really want to delete Project",IfSharedOrPublishedRenamingProjectBreaksExistingLinks:"If this project has been shared or published, renaming it breaks existing links"},projectPanel:{ProjectSettings:"Project Settings",ThumbnailImageSize:"Thumbnail Image Size",ProjectByOtherPeople:"Project by Other People",Project:"Project",ProjectType:"Тип проєкту",ProjectDescription:"Description",MakeDescriptionEditable:"Make this description editable",MakeDescriptionNonEditable:"Make this description non-editable",DoubleClickToMakeDescriptionEditable:"Double-click to make this description editable",SolarPanelArray:"Solar Panel Array",CurateCurrentDesign:"Curate current design",UpdateSelectedDesign:"Update selected design",RemoveSelectedDesign:"Remove selected design",ClickToFlipSortingOrder:"Click to flip the sorting order",DesignNotShownInSolutionSpaceClickToShow:"This design is not shown in solution space; click to show",DesignShownInSolutionSpaceClickToHide:"This design is shown in solution space; click to hide",SolutionSpace:"Solution Space",ChooseSolutionSpace:"Choose solution space",ChooseDataColoring:"Choose data coloring",SameColorForAllDesigns:"Same color for all designs",OneColorForEachDesign:"One color for each design",SolutionSpaceScreenshot:"Take a screenshot of the solution space",ScatterPlotScreenshot:"Take a screenshot of the scatter plot",SingleClickToSelectDoubleClickToOpen:"Single-click to select, double-click to open.",SingleClickToDeselectDoubleClickToOpen:"Single-click to deselect, double-click to open.",GenerateScatterPlot:"Generate Scatter Plot",SelectXAxis:"Select X Axis",SelectYAxis:"Select Y Axis"},accountSettingsPanel:{MyAccountSettings:"Мої налаштування облікового запису",MyID:"Моє 🆔",ClickToCopyMyID:"Натисніть, щоб скопіювати моє ID",IDInClipBoard:"Ваш ID було скопійоване і готове для вставки.",StoreMyNameInMyFilesWhenSaving:"Зберігати моє ім'я в моїх файлах при збереженні",DoYouReallyWantToShowYourNameInYourFiles:"Ви дійсно бажаєте відображати ваше ім'я в файлах?",SignFileDisclaimer:"Якщо так, ваше ім'я зможе бачити будь-хто, хто матиме доступ до ваших файлів.",Likes:"Вподобання",AllPublished:"Усі опубліковані",PublishedUnderAliases:"Псевдоніми",UserCount:"Кількість користувачів",SchoolID:"ID Школи",ClassID:"ID Класу"},weatherPanel:{SunshineHours:"Сонячні години"},diurnalTemperaturePanel:{SelectAirTemperatureModel:"Виберіть модель повітряної температури",Sinusoidal:"Синусоїдальна"},economicsPanel:{EconomicsParameters:"Параметри економіки",ElectricitySellingPrice:"Ціна продажу електроенергії",OperationalCostPerUnit:"Операційні витрати за одиницю",SellingPrice:"Selling Price",UnitCost:"Unit Cost"},navigationPanel:{NavigationParameters:"Navigation Parameters",MinimumMoveSpeed:"Minimum Move Speed",MinimumTurnSpeed:"Minimum Turn Speed"},shadowSettingsPanel:{ShadowSettings:"Shadow Settings",ShadowCameraFarDistance:"Shadow Camera Far Distance",ShadowMapSize:"Shadow Map Size",Notes:"Notes",RefreshPageNote:"Refresh the page for the new settings to take effect.",MapSizeWarning:"A large shadow map size may cause Aladdin to crash on some computers."},yearlyLightSensorPanel:{SkyClearness:"Ясність неба",ShowDaylightResults:"Показати результати денного освітлення",ShowSkyClearnessResults:"Показати результати ясності неба",ShowAverageDailySolarRadiation:"Показати середню щоденну сонячну радіацію"},analysisManager:{NoSensorForCollectingData:"Немає датчика для збору даних.",NoSolarPanelForAnalysis:"Немає сонячної панелі для аналізу.",NoObserverForVisibilityAnalysis:"Немає спостерігача для аналізу видимості.",NoWaterHeaterForAnalysis:"Немає водонагрівача для аналізу.",NoParabolicDishForAnalysis:"Немає параболічної тарілки для аналізу.",NoParabolicTroughForAnalysis:"Немає параболічного сонячного колектора для аналізу.",NoFresnelReflectorForAnalysis:"Немає відбивача Френеля для аналізу.",NoHeliostatForAnalysis:"Немає геліостата для аналізу.",NoSolarUpdraftTowerForAnalysis:"Немає сонячної вежі для аналізу.",NoBuildingForAnalysis:"Немає будівлі для аналізу."},toolbar:{CloudFile:"Хмарний файл",Select:"Вибрати",AddFoundation:"Додати фундамент",AddWall:"Додати стіну",AddWindow:"Додати вікно",AddDoor:"Додати двері",AddPyramidRoof:"Додати пірамідальний дах",AddGableRoof:"Додати шатровий дах",AddHipRoof:"Додати чотирихилий дах",AddGambrelRoof:"Додати двосхилий дах",AddMansardRoof:"Додати мансардний дах",AddCuboid:"Додати прямокутний паралелепіпед",AddSensor:"Додати датчик",AddSolarPanel:"Додати сонячну панель",AddWaterHeater:"Додати водонагрівач",AddPowerWall:"Add Power Wall",AddParabolicDish:"Додати параболічну тарілку",AddParabolicTrough:"Додати параболічний сонячний колектор",AddFresnelReflector:"Додати відбивач Френеля",AddHeliostat:"Додати геліостат",AddWindTurbine:"Add Horizontal Axis Wind Turbine",AddVerticalAxisWindTurbine:"Add Vertical Axis Wind Turbine",AddLight:"Додати світло",AddTree:"Додати дерево",AddFlower:"Додати квітку",AddPeople:"Додати людей",DoubleClickToLockThisModeForNextAction:"Подвійне клацання, щоб заблокувати цей режим для наступної дії",ClickToUnlockThisModeForNextAction:"Клацніть, щоб розблокувати цей режим для наступної дії",ManipulateGroup:"Маніпулювати групою",ClearScene:"Очистити сцену",ShowSunAndTimeSettings:"Показати налаштування Сонця та Часу",SpatialAnalysisOfEnergy:"Просторовий аналіз енергії",DoYouReallyWantToClearContent:"Ви дійсно бажаєте очистити вміст",ClickForMoreButtons:"Натисніть для додаткових кнопок"},tooltip:{gotoIFI:"Перейти до Інституту Інтелекту Майбутнього",visitAladdinHomePage:"Відвідати домашню сторінку Aladdin",clickToOpenMenu:"Натисність, щоб відкрити Головне Меню",clickToAccessAccountSettings:"Click to access account settings"},tree:{Apple:"Яблуня",Birch:"Береза",Coconut:"Кокос",Dogwood:"Дерен",Elm:"В'яз",FanPalm:"Віяльна пальма",Linden:"Липа",Magnolia:"Магнолія",Maple:"Клен",Oak:"Дуб",Pine:"Сосна",Spruce:"Ялина"},flower:{Bellflower:"Дзвоник",Boxwood:"Самшит",CactusCombo1:"Кактус Комбо 1",CactusCombo2:"Кактус Комбо 2",CactusCombo3:"Кактус Комбо 3",CactusCombo4:"Кактус Комбо 4",Hibiscus:"Гібіскус",Hosta:"Госта",Hydrangea:"Гортензія",Peony:"Півонія",RedRose:"Червона троянда",Spirea:"Спірея",Sunflower:"Соняшник",TallBush:"Високий кущ",Tulip:"Тюльпан",WhiteFlower:"Біла квітка",YellowFlower:"Жовта квітка"},people:{Jaah:"Артем",Jack:"Віталій",Jacob:"Ярослав",Jacqueline:"Олена",Jade:"Ольга",Jamelia:"Олександра",James:"Андрій",Jane:"Вікторія",Jaya:"Ірина",Jaye:"Назар",Jeanette:"Соломія",Jedi:"Євген",Jeff:"Павло",Jena:"Любов",Jennifer:"Тетяна",Jess:"Злата",Jett:"Сергій",Jill:"Надія",Jiya:"Марина",Joan:"Іванна",Jocelyn:"Анастасія",Joel:"Володимир",Joey:"Вероніка",John:"Іван",Jonathon:"Петро",Jose:"Микита",Joseph:"Віктор",Joshua:"Михайло",Judd:"Владислав",Judy:"Марія",Julia:"Юлія",Julio:"Дмитро",Jumapili:"Марта",June:"Анна",Juro:"Юрій",Justin:"Богдан"},compass:{N:"Пн",S:"Пд",W:"Зx",E:"Сх"},month:{January:"Jan",February:"Feb",March:"Mar",April:"Apr",May:"May",June:"Jun",July:"Jul",August:"Aug",September:"Sep",October:"Oct",November:"Nov",December:"Dec"},modelsMap:{SearchByPublisher:"Пошук за виробником",SearchByLabel:"Пошук за міткою",MyPublishedModels:"Мої опубліковані моделі",TotalNumberOfUserPublishedModels:"Загальна кількість моделей, опублікованих користувачами",SortFromOldestToNewest:"Сортувати від найдавніших до найновіших",SortFromNewestToOldest:"Сортувати від найновіших до найдавніших",ModelsFoundOnThisSite:"моделей знайдено на цьому сайті",ShowModelsPublishedByThisAuthor:"Показати моделі, опубліковані цим автором"}}};Y.use(pWe).use(jht).init({debug:!0,fallbackLng:"en",interpolation:{escapeValue:!1},resources:{en:spt,zh_cn:cpt,zh_tw:upt,es:dpt,tr:fpt,ua:hpt}});var h1e={},gWe={exports:{}};(function(t){function e(n){return n&&n.__esModule?n:{default:n}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(gWe);var Md=gWe.exports,$K={};Object.defineProperty($K,"__esModule",{value:!0});$K.default=void 0;var ppt={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"};$K.default=ppt;var QK={},JL={},ZK={};Object.defineProperty(ZK,"__esModule",{value:!0});ZK.default=void 0;var gpt={locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"};ZK.default=gpt;var KL={};Object.defineProperty(KL,"__esModule",{value:!0});KL.default=void 0;const mpt={placeholder:"Select time",rangePlaceholder:["Start time","End time"]};KL.default=mpt;var mWe=Md.default;Object.defineProperty(JL,"__esModule",{value:!0});JL.default=void 0;var ypt=mWe(ZK),Apt=mWe(KL);const wpt={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},ypt.default),timePickerLocale:Object.assign({},Apt.default)};JL.default=wpt;var vpt=Md.default;Object.defineProperty(QK,"__esModule",{value:!0});QK.default=void 0;var xpt=vpt(JL);QK.default=xpt.default;var eq=Md.default;Object.defineProperty(h1e,"__esModule",{value:!0});var p1e=h1e.default=void 0,bpt=eq($K),Spt=eq(QK),Tpt=eq(JL),Ppt=eq(KL);const F1="${label} is not a valid ${type}",Cpt={locale:"en",Pagination:bpt.default,DatePicker:Tpt.default,TimePicker:Ppt.default,Calendar:Spt.default,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:F1,method:F1,array:F1,object:F1,number:F1,date:F1,boolean:F1,integer:F1,float:F1,regexp:F1,email:F1,url:F1,hex:F1},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty"}};p1e=h1e.default=Cpt;const Rpt="/aladdin/assets/weather-_rJLhoXU.csv",Hpt="/aladdin/assets/solar_radiation_horizontal-D4I5HnbU.csv",Mpt="/aladdin/assets/solar_radiation_vertical-ChWgQAyS.csv",Ipt="/aladdin/assets/pvmodules-BhZ8sEOG.csv";function Em(t){for(var e=arguments.length,n=Array(e>1?e-1:0),o=1;o3?e.i-4:e.i:Array.isArray(t)?1:g1e(t)?2:m1e(t)?3:0}function kse(t,e){return TH(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function zpt(t,e){return TH(t)===2?t.get(e):t[e]}function yWe(t,e,n){var o=TH(t);o===2?t.set(e,n):o===3?t.add(n):t[e]=n}function Dpt(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function g1e(t){return Npt&&t instanceof Map}function m1e(t){return Upt&&t instanceof Set}function gd(t){return t.o||t.t}function y1e(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Bpt(t);delete e[es];for(var n=x1e(e),o=0;o1&&(t.set=t.add=t.clear=t.delete=Ept),Object.freeze(t),e&&tR(t,function(n,o){return A1e(o,!0)},!0)),t}function Ept(){Em(2)}function w1e(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function S9(t){var e=Wse[t];return e||Em(18,t),e}function Fpt(t,e){Wse[t]||(Wse[t]=e)}function XV(){return xF}function woe(t,e){e&&(S9("Patches"),t.u=[],t.s=[],t.v=e)}function JV(t){Lse(t),t.p.forEach(kpt),t.p=null}function Lse(t){t===xF&&(xF=t.l)}function r4e(t){return xF={p:[],l:xF,h:t,m:!0,_:0}}function kpt(t){var e=t[es];e.i===0||e.i===1?e.j():e.g=!0}function voe(t,e){e._=e.p.length;var n=e.p[0],o=t!==void 0&&t!==n;return e.h.O||S9("ES5").S(e,t,o),o?(n[es].P&&(JV(e),Em(4)),J6(t)&&(t=KV(e,t),e.l||qV(e,t)),e.u&&S9("Patches").M(n[es].t,t,e.u,e.s)):t=KV(e,n,[]),JV(e),e.u&&e.v(e.u,e.s),t!==AWe?t:void 0}function KV(t,e,n){if(w1e(e))return e;var o=e[es];if(!o)return tR(e,function(l,s){return i4e(t,o,e,l,s,n)},!0),e;if(o.A!==t)return e;if(!o.P)return qV(t,o.t,!0),o.t;if(!o.I){o.I=!0,o.A._--;var r=o.i===4||o.i===5?o.o=y1e(o.k):o.o,i=r,a=!1;o.i===3&&(i=new Set(r),r.clear(),a=!0),tR(i,function(l,s){return i4e(t,o,r,l,s,n,a)}),qV(t,r,!1),n&&t.u&&S9("Patches").N(o,n,t.u,t.s)}return o.o}function i4e(t,e,n,o,r,i,a){if(eR(r)){var l=KV(t,r,i&&e&&e.i!==3&&!kse(e.R,o)?i.concat(o):void 0);if(yWe(n,o,l),!eR(l))return;t.m=!1}else a&&n.add(r);if(J6(r)&&!w1e(r)){if(!t.h.D&&t._<1)return;KV(t,r),e&&e.A.l||qV(t,r)}}function qV(t,e,n){n===void 0&&(n=!1),!t.l&&t.h.D&&t.m&&A1e(e,n)}function xoe(t,e){var n=t[es];return(n?gd(n):t)[e]}function a4e(t,e){if(e in t)for(var n=Object.getPrototypeOf(t);n;){var o=Object.getOwnPropertyDescriptor(n,e);if(o)return o;n=Object.getPrototypeOf(n)}}function m6(t){t.P||(t.P=!0,t.l&&m6(t.l))}function boe(t){t.o||(t.o=y1e(t.t))}function vF(t,e,n){var o=g1e(e)?S9("MapSet").F(e,n):m1e(e)?S9("MapSet").T(e,n):t.O?function(r,i){var a=Array.isArray(r),l={i:a?1:0,A:i?i.A:XV(),P:!1,I:!1,R:{},l:i,t:r,k:null,o:null,j:null,C:!1},s=l,c=Nse;a&&(s=[l],c=SD);var u=Proxy.revocable(s,c),d=u.revoke,f=u.proxy;return l.k=f,l.j=d,f}(e,n):S9("ES5").J(e,n);return(n?n.A:XV()).p.push(o),o}function Lpt(t){return eR(t)||Em(22,t),function e(n){if(!J6(n))return n;var o,r=n[es],i=TH(n);if(r){if(!r.P&&(r.i<4||!S9("ES5").K(r)))return r.t;r.I=!0,o=l4e(n,i),r.I=!1}else o=l4e(n,i);return tR(o,function(a,l){r&&zpt(r.t,a)===l||yWe(o,a,e(l))}),i===3?new Set(o):o}(t)}function l4e(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return y1e(t)}function Wpt(){function t(l,s){function c(){this.constructor=l}r(l,s),l.prototype=(c.prototype=s.prototype,new c)}function e(l){l.o||(l.R=new Map,l.o=new Map(l.t))}function n(l){l.o||(l.o=new Set,l.t.forEach(function(s){if(J6(s)){var c=vF(l.A.h,s,l);l.p.set(s,c),l.o.add(c)}else l.o.add(s)}))}function o(l){l.g&&Em(3,JSON.stringify(gd(l)))}var r=function(l,s){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,u){c.__proto__=u}||function(c,u){for(var d in u)u.hasOwnProperty(d)&&(c[d]=u[d])})(l,s)},i=function(){function l(c,u){return this[es]={i:2,l:u,A:u?u.A:XV(),P:!1,I:!1,o:void 0,R:void 0,t:c,k:this,C:!1,g:!1},this}t(l,Map);var s=l.prototype;return Object.defineProperty(s,"size",{get:function(){return gd(this[es]).size}}),s.has=function(c){return gd(this[es]).has(c)},s.set=function(c,u){var d=this[es];return o(d),gd(d).has(c)&&gd(d).get(c)===u||(e(d),m6(d),d.R.set(c,!0),d.o.set(c,u),d.R.set(c,!0)),this},s.delete=function(c){if(!this.has(c))return!1;var u=this[es];return o(u),e(u),m6(u),u.t.has(c)?u.R.set(c,!1):u.R.delete(c),u.o.delete(c),!0},s.clear=function(){var c=this[es];o(c),gd(c).size&&(e(c),m6(c),c.R=new Map,tR(c.t,function(u){c.R.set(u,!1)}),c.o.clear())},s.forEach=function(c,u){var d=this;gd(this[es]).forEach(function(f,p){c.call(u,d.get(p),p,d)})},s.get=function(c){var u=this[es];o(u);var d=gd(u).get(c);if(u.I||!J6(d)||d!==u.t.get(c))return d;var f=vF(u.A.h,d,u);return e(u),u.o.set(c,f),f},s.keys=function(){return gd(this[es]).keys()},s.values=function(){var c,u=this,d=this.keys();return(c={})[dB]=function(){return u.values()},c.next=function(){var f=d.next();return f.done?f:{done:!1,value:u.get(f.value)}},c},s.entries=function(){var c,u=this,d=this.keys();return(c={})[dB]=function(){return u.entries()},c.next=function(){var f=d.next();if(f.done)return f;var p=u.get(f.value);return{done:!1,value:[f.value,p]}},c},s[dB]=function(){return this.entries()},l}(),a=function(){function l(c,u){return this[es]={i:3,l:u,A:u?u.A:XV(),P:!1,I:!1,o:void 0,t:c,k:this,p:new Map,g:!1,C:!1},this}t(l,Set);var s=l.prototype;return Object.defineProperty(s,"size",{get:function(){return gd(this[es]).size}}),s.has=function(c){var u=this[es];return o(u),u.o?!!u.o.has(c)||!(!u.p.has(c)||!u.o.has(u.p.get(c))):u.t.has(c)},s.add=function(c){var u=this[es];return o(u),this.has(c)||(n(u),m6(u),u.o.add(c)),this},s.delete=function(c){if(!this.has(c))return!1;var u=this[es];return o(u),n(u),m6(u),u.o.delete(c)||!!u.p.has(c)&&u.o.delete(u.p.get(c))},s.clear=function(){var c=this[es];o(c),gd(c).size&&(n(c),m6(c),c.o.clear())},s.values=function(){var c=this[es];return o(c),n(c),c.o.values()},s.entries=function(){var c=this[es];return o(c),n(c),c.o.entries()},s.keys=function(){return this.values()},s[dB]=function(){return this.values()},s.forEach=function(c,u){for(var d=this.values(),f=d.next();!f.done;)c.call(u,f.value,f.value,this),f=d.next()},l}();Fpt("MapSet",{F:function(l,s){return new i(l,s)},T:function(l,s){return new a(l,s)}})}var s4e,xF,v1e=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Npt=typeof Map<"u",Upt=typeof Set<"u",c4e=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",AWe=v1e?Symbol.for("immer-nothing"):((s4e={})["immer-nothing"]=!0,s4e),qm=v1e?Symbol.for("immer-draftable"):"__$immer_draftable",es=v1e?Symbol.for("immer-state"):"__$immer_state",dB=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",jpt=""+Object.prototype.constructor,x1e=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Bpt=Object.getOwnPropertyDescriptors||function(t){var e={};return x1e(t).forEach(function(n){e[n]=Object.getOwnPropertyDescriptor(t,n)}),e},Wse={},Nse={get:function(t,e){if(e===es)return t;var n=gd(t);if(!kse(n,e))return function(r,i,a){var l,s=a4e(i,a);return s?"value"in s?s.value:(l=s.get)===null||l===void 0?void 0:l.call(r.k):void 0}(t,n,e);var o=n[e];return t.I||!J6(o)?o:o===xoe(t.t,e)?(boe(t),t.o[e]=vF(t.A.h,o,t)):o},has:function(t,e){return e in gd(t)},ownKeys:function(t){return Reflect.ownKeys(gd(t))},set:function(t,e,n){var o=a4e(gd(t),e);if(o!=null&&o.set)return o.set.call(t.k,n),!0;if(!t.P){var r=xoe(gd(t),e),i=r==null?void 0:r[es];if(i&&i.t===n)return t.o[e]=n,t.R[e]=!1,!0;if(Dpt(n,r)&&(n!==void 0||kse(t.t,e)))return!0;boe(t),m6(t)}return t.o[e]===n&&(n!==void 0||e in t.o)||Number.isNaN(n)&&Number.isNaN(t.o[e])||(t.o[e]=n,t.R[e]=!0),!0},deleteProperty:function(t,e){return xoe(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,boe(t),m6(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var n=gd(t),o=Reflect.getOwnPropertyDescriptor(n,e);return o&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:o.enumerable,value:n[e]}},defineProperty:function(){Em(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Em(12)}},SD={};tR(Nse,function(t,e){SD[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),SD.deleteProperty=function(t,e){return SD.set.call(this,t,e,void 0)},SD.set=function(t,e,n){return Nse.set.call(this,t[0],e,n,t[0])};var Ypt=function(){function t(n){var o=this;this.O=c4e,this.D=!0,this.produce=function(r,i,a){if(typeof r=="function"&&typeof i!="function"){var l=i;i=r;var s=o;return function(y){var w=this;y===void 0&&(y=l);for(var b=arguments.length,C=Array(b>1?b-1:0),P=1;P1?u-1:0),f=1;f=0;r--){var i=o[r];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}r>-1&&(o=o.slice(r+1));var a=S9("Patches").$;return eR(n)?a(n,o):this.produce(n,function(l){return a(l,o)})},t}(),Ig=new Ypt,OP=Ig.produce;Ig.produceWithPatches.bind(Ig);Ig.setAutoFreeze.bind(Ig);Ig.setUseProxies.bind(Ig);Ig.applyPatches.bind(Ig);Ig.createDraft.bind(Ig);Ig.finishDraft.bind(Ig);/** +AC will not run if the highest outside temperature of the day is lower than the setpoint plus this threshold.`,Press:"Tıkla",Open:"Aç",Save:"Kaydet",SaveAsImage:"Resim Olarak Kaydet",SaveAsCsv:"Save as CSV",Update:"Güncelle",Paste:"Yapıştır",Copy:"Kopyala",Cut:"Kes",Delete:"Sil",Lock:"Kilitle",Translucent:"Yarı Saydam",Transparency:"Transparency",Color:"Renk",Pattern:"Pattern",Texture:"Doku",Size:"Boyut",Thickness:"Kalınlık",Yes:"Evet",No:"Hayır",OK:"Tamam",Cancel:"İptal",Apply:"Uygula",Close:"Kapat",ApplyTo:"Uygula",Run:"Çalıştır",Pause:"Duraklat",Resume:"Sürdür",Clear:"Temizle",Warning:"Uyarı",Caution:"Caution",Reminder:"Hatırlatıcı",Length:"Uzunluk",Width:"Genişlik",Height:"Yükseklik",Radius:"Yarıçap",Angle:"Açı",Azimuth:"Azimut",Coordinates:"Koordinatlar",Weather:"Hava Durumu",Show:"Göster",Animate:"Oynat",Date:"Tarih",Time:"Saat",Title:"Başlık",Owner:"Sahibi",Action:"Eylem",Rename:"Yeniden Adlandır",Location:"Konum",Latitude:"Enlem",Month:"Ay",Day:"Gün",Hour:"Saat",Daylight:"Gün Işığı",Radiation:"Işınım",Temperature:"Sıcaklık",kWh:"kWh",dollar:"dollar",MeterPerSecond:"m/s",NorthInitial:"N",SouthInitial:"S",EastInitial:"E",WestInitial:"W",Fixed:"Sabit",Elements:"Öğeler",Energy:"Energy",Unknown:"Unknown",Label:"Label",Description:"Description",NoDescription:"No description",MaximumCharacters:"Maximum characters",Author:"Author",Publisher:"Publisher",Building:"Building",ResidentialBuilding:"Residential Building",CommercialBuilding:"Commercial Building",SchoolBuilding:"School Building",TouristAttraction:"Tourist Attraction",UnderConstruction:"Under Construction",Photovoltaic:"Photovoltaic",WindPower:"Wind Power",ColocationProjects:"Colocation Projects",Anonymous:"Anonymous",Nickname:"Nickname",Pin:"Pin",Unpin:"Unpin"},shared:{NoTexture:"Doku Yok",FoundationElement:"Temel",CuboidElement:"Kübik",PolygonElement:"Poligon",SensorElement:"Sensör",SolarPanelElement:"Güneş Paneli",WaterHeaterElement:"Su Isıtıcı",ParabolicDishElement:"Parabolik Çanak",ParabolicTroughElement:"Parabolik Oluk",FresnelReflectorElement:"Fresnel Reflektör",HeliostatElement:"Heliostat",WindTurbineElement:"Wind Turbine",LightElement:"Light",ElementLocked:"Kilitli",ModelType:"Model Type",OutputBreakdown:"Breakdown",MoreResults:"More Results"},message:{NewVersionAvailable:"A new version is available",CalculationMayBeSlowDoYouWantToContinue:"Calculation may be slow. Do you want to continue?",IncreaseSolarRadiationHeatmapGridCellSizeToSpeedUp:"Increase solar radiation heatmap grid cell size to speed up",ModelNotFound:"Model not found",CannotSignIn:"Oturum açılamıyor",CannotSignOut:"Çıkış yapılamıyor",YourAccountWasCreated:"Hesabınız oluşturuldu",CannotCreateAccount:"Hesap oluşturulamıyor",YourAccountSettingsWereSaved:"Hesap ayarlarınız kaydedildi.",CannotSaveYourAccountSettings:"Hesap ayarlarınız kaydedilemiyor",CannotSaveYourFileToCloud:"Dosyanız buluta kaydedilemiyor",CannotCreateNewProject:"Cannot create a new project",CannotCreateNewProjectWithoutTitle:"Cannot create a new project without a title",CannotOpenYourProjects:"Cannot open your projects",CannotOpenProject:"Cannot open the project",CannotDeleteProject:"Cannot delete the project",CannotRenameProject:"Cannot rename the project",CannotAddDesignToProject:"Cannot add this design to the project",CannotAddDesignToProjectOwnedByOthers:"Cannot add this design to a project owned by others",DesignRemovedFromProject:"The design was successfully removed from the project",CannotRemoveDesignFromProject:"Cannot remove this design from the project",CannotUpdateProject:"Cannot update the project",CannotFetchProjectData:"Cannot fetch project data",TitleUsedChooseDifferentOne:"This title has been used. Choose a different one",CloudFileWithTitleExistsDoYouWantToOverwrite:"A cloud file with the title exists. Do you want to overwrite it?",CloudFileNotFound:"Bulut dosyası bulunamadı",CannotLoadModelsOnMap:"Cannot load models on map",CannotLoadLeaderboard:"Cannot load leaderboard",CannotPublishModelOnMap:"Cannot publish model on map",CannotLikeModelFromMap:"Cannot like model from map",CannotDeleteModelFromMap:"Cannot delete model from map",ModelDeletedFromMap:"Model is deleted from map",DoYouWantToDeleteModelFromMap:"Do you want to delete the model from map?",CannotOpenCloudFile:"Bulut dosyası açılamıyor",CannotReadCloudFile:"Cannot read the cloud file",CannotWriteCloudFile:"Cannot write the cloud file",CloudFileCopied:"Cloud file copied",CannotOpenCloudFolder:"Bulut klasörünüz açılamıyor",CannotDeleteCloudFile:"Bulut dosyası silinemiyor",CannotRenameCloudFile:"Bulut dosyası yeniden adlandırılamıyor",DoYouWantToSaveChanges:"Değişiklikleri kaydetmek istiyor musunuz?",NotApplicableToSelectedAction:"Seçili eyleme uygulanamaz",ThisElementIsLocked:"Bu öğe kilitli.",ThisCannotBeUndone:"Geri alınamaz.",AzimuthOfNorthIsZero:"Kuzey yönünün azimut açısı 0 ° derecedir.",CounterclockwiseAzimuthIsPositive:"Saat yönünün tersi yönde azimut açısı pozitiftir.",SouthFacingIsZero:"South-facing is 0°",ClockwiseRotationIsPositive:"Clockwise is positive",MoveCancelledBecauseOfOverlap:"Çakışma nedeniyle taşıma iptal edildi.",MoveOutsideBoundaryCancelled:"Alan dışına çıkan taşıma iptal edildi.",RotationCancelledBecauseOfOverlap:"Çakışma nedeniyle döndürme iptal edildi.",RotationOutsideBoundaryCancelled:"Alan dışı döndürme iptal edildi.",ResizingCancelledBecauseOfOverlap:"Çakışma nedeniyle yeniden boyutlandırma iptal edildi.",ResizingOutsideBoundaryCancelled:"Alan dışında yeniden boyutlandırma iptal edildi.",CannotPasteOutsideBoundary:"Alanın dışına yapıştırılamaz.",CannotPasteBecauseOfOverlap:"Çakışma nedeniyle yapıştırılamıyor.",CannotMoveObjectTooFar:"Nesne buraya taşınamaz.",ExistingSolarPanelsWillBeRemovedBeforeApplyingNewLayout:"Yeni yerleşim düzeni uygulanmadan önce mevcut güneş panelleri kaldırılacaktır.",DoYouWantToContinue:"Devam etmek istiyor musunuz?",SolarPanelsCannotIntersectWithGround:"Güneş panelleri zeminle kesişemez.",SolarPanelsCannotOverlapWithOneAnother:"Güneş panelleri birbiriyle örtüşemez.",ScreenshotSaved:"Ekran görüntüsü kaydedildi.",CsvFileSaved:"A CSV file was saved.",SimulationStarted:"Simülasyon başladı.",SimulationCompleted:"Simülasyon tamamlandı.",SimulationAborted:"Simülasyon iptal edildi.",SimulationPaused:"Simülasyon duraklatıldı.",CancelSimulation:"Simülasyonu iptal et",PauseSimulation:"Simülasyonu duraklat",ResumeSimulation:"Simülasyonu devam ettir",SimulationWillNotStartDueToErrors:"Simulation will not start due to errors",SimulationWillStartDespiteWarnings:"Simulation will start despite warnings.",EvolutionStarted:"Evrim başladı.",EvolutionCompleted:"Evrim tamamlandı.",EvolutionAborted:"Evrim iptal edildi.",EvolutionPaused:"Evrim duraklatıldı.",EncounterEvolutionError:"Evrim hatasıyla karşılaşıldı.",CancelEvolution:"Evrimi iptal et",PauseEvolution:"Evrimi duraklat",ResumeEvolution:"Evrime devam et",ConvergenceThresholdHasBeenReached:"Yakınsama eşiğine ulaşıldı.",MaximumNumberOfGenerationsHasBeenReached:"Maksimum nesil sayısına ulaşıldı.",MaximumNumberOfStepsHasBeenReached:"Maksimum adım sayısına ulaşıldı.",ObjectiveFunctionTypeError:"Geçerli işlev desteklenmiyor. Lütfen menüden başlatınız.",WallsAreNotAtSameHeight:"Walls are not at same height.",WallsAreNotPerpendicular:"Walls are not perpendicular.",WallsAreNotConnected:"Walls are not connected.",WallsNumberNeedToBeFour:"The number of walls needs to be four.",BuildingContainsEmptyWall:"Building contains one or more empty wall.",BuildingRoofMissing:"Building has a missing roof.",UnknownErrors:"Unknown errors."},menu:{AnalysisOptions:"Analiz Seçenekleri",option:{GridCellSize:"Hücre Boyutu",SamplingFrequency:"Örneklem Frekansı",TimesPerHour:"x 1/saat",DaysPerYear:"Gün Sayısı / Yıl"},mainMenu:"Ana Menü",cloudMenu:"Bulut Menüsü",projectSubMenu:"Project",project:{CreateNewProject:"Create New Project",OpenProject:"Open Project",SaveProject:"Save Project",SaveProjectAs:"Save Project As",YouMustLogInToCreateProject:"You must log in to create a new project",YouMustLogInToOpenProject:"You must log in to open a project"},fileSubMenu:"Dosya",file:{CreateNewFile:"Yeni Dosya Oluştur",OpenLocalFile:"Yerel Dosya Aç",SaveAsLocalFile:"Yerel Dosya Olarak Kaydet",SavingAbortedMustHaveValidFileName:"Kaydetme iptal edildi! Geçerli bir dosya adı kullanınız.",OpenCloudFile:"Bulut Dosyası Aç",SaveCloudFile:"Bulut Dosyasını Kaydet",SaveAsCloudFile:"Bulut Dosyası Olarak Kaydet",SavingAbortedMustHaveValidTitle:"Kaydetme iptal edildi! Dosya adı geçersiz!",ToSaveYourWorkPleaseSignIn:"Çalışmanızı kaydetmek için lütfen oturum açınız.",TakeScreenshot:"Ekran görüntüsü al",UseCloudFileName:"Bulut Dosya Adını Kullan",PublishOnModelsMap:"Publish on Models Map",PublishedOnModelsMap:"Your model has been published on the Models Map",UpdatedOnModelsMap:"Your model has been updated on the Models Map",YouMustLogInToPublishYourModel:"You must log in to publish your model",YouCannotPublishAModelThatYouDoNotOwn:"You cannot publish a model that you do not own",YouMustSaveModelOnCloudBeforePublishingIt:"You must save the model on the cloud before publishing it"},editSubMenu:"Düzen",edit:{Undo:"Geri Al",Redo:"Yinele"},viewSubMenu:"Görünüm",view:{NavigationView:"Navigation View",TwoDimensionalView:"2D",ResetView:"Yenile",ZoomIn:"Yaklaş",ZoomOut:"Uzaklaş",AutoRotate:"Otomatik Döndür",ShowShadow:"Gölge",ShowSurfaceShininess:"Show Surface Shininess",TranslucentFloatingWindows:"Yüzer Pencere",accessoriesSubMenu:"Accessories",accessories:{SiteInformation:"Konum Bilgisi",DesignInformation:"Izgara Hücre Sayısı",Instruction:"Yardım",StickyNote:"Notlar",Note:"Notlar"}},settingsSubMenu:"Settings",settings:{WeatherData:"Hava Durumu",DiurnalTemperature:"Günlük Sıcaklık",Heliodon:"Heliodon",SunAndTime:"Güneş & Zaman"},benchmarksSubMenu:"Deneysel",benchmarks:{SolarRadiationPredictionVsMeasurement:"Güneş Işınım Tahmini Vs. Ölçümü ",BESTESTCase600:"Building Energy Simulation Test: BESTEST Case 600",BESTESTCase610:"Building Energy Simulation Test: BESTEST Case 610",BESTESTCase620:"Building Energy Simulation Test: BESTEST Case 620",BESTESTCase630:"Building Energy Simulation Test: BESTEST Case 630"},graph:{LineWidth:"Çizgi Kalınlığı",SymbolSize:"Sembol Boyutu",BarCategoryGap:"Bar Category Gap",ShowHorizontalGridLines:"Yatay Izgara Çizgilerini Göster",ShowVerticalGridLines:"Dikey Izgara Çizgilerini Göster"},analysisSubMenu:"Analiz",physicsSubMenu:"Fizik",physics:{DailySolarRadiationHeatmap:"Günlük Isı Haritası",SolarRadiationHeatmapOptions:"Isı Haritası Seçenekleri",SolarRadiationHeatmapGridCellSize:"Hücre Boyutu",SolarRadiationHeatmapMaxValue:"Işınım Maksimum Değer",SolarRadiationHeatmapNoAnimation:"Animasyon Yok",ReflectionHeatmap:"Yansıma Isı Haritası"},sensorSubMenu:"Sensörler",sensor:{CollectDailyData:"Günlük Veri Topla",CollectYearlyData:"Yıllık Veri Topla",SensorSimulationNoAnimation:"Animasyon Yok"},buildingSubMenu:"Building",building:{AnalyzeDailyBuildingEnergy:"Analyze Daily Building Energy",AnalyzeYearlyBuildingEnergy:"Analyze Yearly Building Energy",EnergyAnalysisOptions:"Energy Analysis Options",EnergyGridCellSize:"Energy Grid Cell Size",BuildingEnergySimulationNoAnimation:"No Animation for Building Energy Simulation"},solarPanelSubMenu:"Güneş Panelleri",solarPanel:{AnalyzeDailyYield:"Günlük Üretim Analizi",AnalyzeYearlyYield:"Yıllık Üretim Analizi",AnalyzeVisibility:"Görünüm Analizi",PanelDiscretization:"Panel Ayrıklaştırma",Exact:"Kesin",Approximate:" Yaklaşık",EnergyGridCellSize:"Hücre Boyutu",VisibilityGridCellSize:"Hücre Boyutu",EnergyAnalysisOptions:"Enerji Analiz Seçenekleri",VisibilityAnalysisOptions:"Görünüm Analiz Seçenekleri",SolarPanelSimulationNoAnimation:"Animasyon Yok"},parabolicTroughSubMenu:"Parabolik Oluk",parabolicTrough:{AnalyzeDailyYield:"Günlük Üretim Analizi",AnalyzeYearlyYield:"Yıllık Üretim Analizi"},parabolicDishSubMenu:"Parabolik Çanak",parabolicDish:{AnalyzeDailyYield:"Günlük Üretim Analizi",AnalyzeYearlyYield:"Yıllık Üretim Analizi"},fresnelReflectorSubMenu:"Fresnel Yansıtıcı",fresnelReflector:{AnalyzeDailyYield:"Günlük Üretim Analizi",AnalyzeYearlyYield:"Yıllık Üretim Analizi"},heliostatSubMenu:"Heliostat",heliostat:{AnalyzeDailyYield:"Günlük Üretim Analizi",AnalyzeYearlyYield:"Yıllık Üretim Analizi"},solarUpdraftTowerSubMenu:"Solar Updraft Kulesi",solarUpdraftTower:{AnalyzeDailyYield:"Günlük Üretim Analizi",AnalyzeYearlyYield:"Yıllık Üretim Analizi",SolarUpdraftTowerSimulationNoAnimation:"Animasyon Yok"},tutorialsSubMenu:"Öğrenme Merkezi",solarEnergyScienceSubMenu:"Güneş Bilimi",solarEnergyScienceTutorials:{SunAngles:"Gözlemciye Göre Güneş Açıları",InsolationAndClimate:"Güneşlenme ve İklim",SolarRadiationToBox:"Kutu Güneş Işınımı"},buildingScienceSubMenu:"Building Science",buildingScienceTutorials:{ThermalEnvelopeVsBuildingEnvelope:"Thermal Envelope vs. Building Envelope",EffectOfSizeOnBuildingEnergy:"Effect of Size on Building Energy",EffectOfOrientationOnBuildingEnergy:"Effect of Orientation on Building Energy",EffectOfInsulationOnBuildingEnergy:"Effect of Insulation on Building Energy",EffectOfRoofColorOnBuildingEnergy:"Effect of Roof Color on Building Energy",EffectOfEavesOverhangLengthOnBuildingEnergy:"Effect of Eaves Overhang Length on Building Energy",EffectOfWindowSHGCOnBuildingEnergy:"Effect of Window Solar Heat Gain on Building Energy",EffectOfThermostatSetpointOnBuildingEnergy:"Effect of Thermostat Setpoint on Building Energy",EffectOfSolarPanelsOnBuildingEnergy:"Effect of Solar Panels on Building Energy",EffectOfGroundTemperatureOnBuildingEnergy:"Effect of Ground Temperature on Building Energy",EffectOfTreesOnBuildingEnergy:"Effect of Trees on Building Energy"},buildingDesignSubMenu:"Bina Tasarımı",buildingDesignTutorials:{CapeCodStyleHouseWithShedDormer:"Çatı Pencereli Cape Cod Evi",MansardRoofWithDormers:"Mansard Roof with Dormers",GableRoofVsHipRoof:"Beşik Çatı vs. Kırma Çatı",ColonialVsSaltbox:"Koloni vs. Tuz Kutusu",GambrelRoofVsMansardRoof:"Flemenk Çatı vs. Mansart Çatı",CombinationRoofVsBonnetRoof:"Combination Roof vs. Bonnet Roof",DutchGableRoof:"Dutch Gable Roof",GableAndValleyRoof:"Gable and Valley Roof",ClerestoryRoof:"Clerestory Roof",MonitorRoof:"Monitor Roof",AFrameHouse:"A-Frame House",HalfTimberedHouse:"Half-Timbered House",AllBasicRoofTypes:"Tüm Çatı Tipleri"},photovoltaicSolarPowerSubMenu:"Fotovoltaik Güneş Enerjisi",photovoltaicSolarPowerTutorials:{EffectOfTiltAngleOfSolarPanel:"Güneş Paneli Eğim Açısı Etkisi",EffectOfAzimuthOfSolarPanel:"Güneş Paneli Azimut Açısı Etkisi",SolarPanelTypes:"Solar Panel Types",VerticalBifacialSolarPanels:"Vertical Bifacial Solar Panels",CompareMonofacialAndBifacialSolarPanels:"Monofacial vs. Bifacial Solar Panels",SolarTrackers:"Güneş İzleyiciler",CoveringGroundWithSolarPanels:"Sadece güneş panellerini kullanarak yüzeyi kaplamak neden iyi bir fikir değildir?",InterRowSpacingOfSolarPanelArray:"Güneş Paneli Dizi Arası Boşluk Etkisi",EffectOfOrientationOfSolarPanels:"Güneş Panelleri Yön Etkisi",SolarPanelArrayAutomaticLayout:"Solar Panel Array Automatic Layout"},concentratedSolarPowerSubMenu:"Yoğunlaştırılmış Güneş Enerjisi",concentratedSolarPowerTutorials:{EffectOfAzimuthOfParabolicTrough:"Parabolik Oluk Azimut Açısı Etkisi",EffectOfLatusRectumOfParabolicTrough:"Parabolik Oluk Özkiriş Etkisi",FocusSunlightWithParabolicDish:"Güneş Işığını Parabolik Çanakla Odaklama",LinearFresnelReflectors:"Doğrusal Fresnel Reflektörler",EffectOfAbsorberPipeHeightForLinearFresnelReflectors:"Doğrusal Fresnel Reflektörlerde Soğurucu Boru Yükseklik Etkisi",EffectOfAzimuthOfLinearFresnelReflectors:"Doğrusal Fresnel Reflektörlerde Azimut Açısı Etkisi",LinearFresnelReflectorsWithTwoAbsorbers:"İki Soğuruculu Doğrusal Fresnel Reflektörler",CosineEfficiencyOfHeliostats:"Heliostatların Kosinüs Verimliliği",ShadowingAndBlockingOfHeliostats:"Heliostatlarda Gölgeleme ve Engellenme",EffectSolarPowerTowerHeight:"Güneş Güç Kulesi Yükseklik Etkisi",SolarPowerTower:"Güneş Güç Kulesi"},otherTypesOfSolarPowerSubMenu:"Diğer Güneş Gücü Türleri",otherTypesOfSolarPowerTutorials:{SolarUpdraftTower:"Solar Updraft Kulesi"},windPowerSubMenu:"Wind Power",windPowerTutorials:{EffectOfBladeNumberOfWindTurbine:"Effect of Blade Number of Wind Turbine",EffectOfPitchAngleOfWindTurbineBlades:"Effect of Pitch Angle of Wind Turbine Blades",BirdSafeBladeDesign:"Bird-Safe Blade Design",OffshoreWindFarm:"Offshore Wind Farm"},colocationSubMenu:"Colocation",colocationTutorials:{AgricultureSolarWindColocation:"Agriculture-Solar-Wind Colocation"},generativeDesignSubMenu:"Generative Design",generativeDesignTutorials:{MonofacialSolarPanelArrayTiltAngle:"The Tilt Angle of a Monofacial Solar Panel Array",BifacialSolarPanelArrayTiltAngle:"The Tilt Angle of a Bifacial Solar Panel Array",OutputOfSolarPanelArrayInDifferentPlaces:"The Output of a Solar Panel Array in Different Places",SimpleSolarFarmParetoFront:"The Pareto Front for Designing a Simple Solar Farm"},examplesSubMenu:"Örnekler",solarEnergySubMenu:"Güneş Enerjisi",solarEnergyExamples:{SunBeamAndHeliodon:"Güneş Işını ve Heliodon",RooftopSolarPanels:"Çatı Üstü Güneş Panelleri",NevadaSolarOneParabolicTroughArray:"Nevada Eyaletinde Parabolik Oluk Dizisi",TooeleParabolicDishArray:"Tooele Şehrinde Parabolik Çanak Dizisi",PS10SolarPowerTower:"PS10 Güneş Güç Kulesi",TucsonLinearFresnelReflectors:"Tucson Şehrinde Doğrusal Fresnel Reflektörleri",SolarCanopyFormFactors:"Solar Gölgelik Biçim Etkileri",SolarCanopyOverBleachers:"Tirübün Üzeri Solar Gölgelik",SolarCanopyOverGarage:"Solar Canopy Over Garage",SolarBusStop:"Solar Otobüs Durağı",SolarFacadeTesla:"Tesla Solar Façade",BuildingIntegratedPhotovoltaics:"Building-Integrated Photovoltaics",Floatovoltaics:"Floatovoltaics",Agrivoltaics:"Agrivoltaics",VegetativeBuffer:"Bitkisel Tampon",RainbowSwashSolarFarmBostonMA:"Rainbow Swash Solar Farm in Boston, MA",MickeyMouseSolarFarmOrlandoFL:"Mickey Mouse Solar Farm in Orlando, FL",SolarPanelsOverCanalBakersfieldCA:"Bakersfield Şehrinde Kanal Üzerindeki Varsayımsal Güneş Panelleri",SolarNoiseBarrierLexingtonMA:"Lexington Kasabasında Varsayımsal Güneş Gürültü Bariyeri",HSATSolarTrackersRaleighNC:"Raleigh Şehrinde Yatay Tek Eksenli İzleyiciler (HSAT)",AADATSolarTrackersLancasterCA:"Lancaster Şehrinde Azimut–İrtifa Çift Eksenli İzleyiciler (AADAT)",SolarUpdraftTowerInCity:"Şehir Solar Updraft Kulesi"},builtEnvironmentSubMenu:"Yapılı Çevre",residentialBuildingsSubMenu:"Konut inşaatları",residentialBuildingExamples:{ColonialHouse:"Colonial House",DutchColonialHouse:"Flemenk Koloni Evi",TShapedHouse:"T-Shaped House",CapeCodHouseWithGarage:"Cape Cod House with Garage",Solarium:"Solaryum",Church1:"Kilise 1",Cathedral1:"Cathedral 1",Cathedral2:"Cathedral 2",Mosque1:"Mosque 1",AdobeTaosHouse:"Adobe Taos House",RanchHouse:"Ranch House",BonnetHouse:"Bonnet House",BarnStyleHouse:"Çiftlik Evi",ModernHouse:"Modern House",ButterflyRoofHouse:"Butterfly Roof House"},commercialBuildingsSubMenu:"Ticari Binalar",commercialBuildingExamples:{WhiteHouse:"White House",HaroldWashingtonCollege:"Harold Washington College",BilimMersinTurkiye:"Yenişehir Belediyesi Bilim ve Sanat Merkezi",SpanishStyleHotel:"Spanish Style Hotel",ApartmentBuilding:"Apartment Building",OfficeBuilding:"Ofis Binası",Hotel:"Hotel"},buildingComplexesSubMenu:"Building Complexes",buildingComplexExamples:{SouthBurlingtonHighSchoolVermont:"Güney Burlington Lisesi",MescaleroApacheSchoolNewMexico:"Mescalero Apache School, NM"},urbanPlanningSubMenu:"Şehir Planlaması",urbanPlanningExamples:{CityBlockHeatmap:"City Block Heatmap",ChicagoSkyline:"Chicago Skyline"},otherBuildingsSubMenu:"Other Buildings",otherBuildingExamples:{Greenhouse:"Sera",Pavilion:"Park Kamelyası",OctagonalPagoda:"Octagonal Pagoda",OceanFront:"Ocean Front",EgyptianPyramids:"Egyptian Pyramids",MayanPyramid:"Mayan Pyramid",SiOSePol:"Si-o-se-pol",StackedCuboids:"Stacked Cuboids"},artificialIntelligenceSubMenu:"Yapay Zeka",artificialIntelligenceExamples:{OptimizingTiltAngleOfOneSolarPanelRow:"Güneş Paneli Sıra Eğim Açısı Optimize Etme",OptimizingTiltAnglesOfMultipleSolarPanelRows:"Çoklu Güneş Paneli Sıra Eğim Açısı Optimize Etme",SolarFarmGenerativeDesign:"Güneş Tarlası Tasarımı",SolarFarmGenerativeDesignWithBlock:"Blok Varlığında Güneş Tarlası Tasarımı",FitchburgSolarFarmGenerativeDesign:"Fitchburg Güneş Tarlası Tasarımı"},languageSubMenu:"Dil",publicSubMenu:"Public",ModelsGallery:"Models Gallery",ModelsMap:"Models Map",AboutUs:"Hakkımızda"},avatarMenu:{AccountSettings:"Hesap Ayarları",PrivacyStatementTitle:"User Privacy Protection Statement",PrivacyStatement:"Oturum açtığınızda, Aladdin hesabınızı oluşturmak ve hesabınıza erişmek için Google Kimliğiniz kullanılır. Veritabanımızda referans olarak yalnızca rastgele bir alfasayısal dize depolanır. Adınız veya e-posta adresiniz gibi kişisel olarak tanımlanabilir hiçbir veri toplanmaz. Daha fazla bilgi için ",SignIn:"Kayıt Ol",SignOut:"Oturum Kapat",IfYouAreAStudent:"Eğer Öğrenciyseniz"},skyMenu:{Axes:"Eksenler",Theme:"Tema",ThemeDefault:"Varsayılan",ThemeDesert:"Çöl",ThemeDune:"Dune",ThemeForest:"Orman",ThemeGrassland:"Çayır",ThemeHill:"Hill",ThemeLake:"Lake",ThemeMountain:"Mountain",ThemeRural:"Rural",SunlightAttenuationCoefficientInAir:"Havan Güneş Işığı Zayıflatma Katsayısı",ConvectiveCoefficientOfAir:"Havan Isı İletkenlik Katsayısı",HighestTemperatureTimeInMinutes:"En Yüksek Sıcaklık Süresi (Dakika)",SelectSunAnglesToShow:"Gösterilecek Güneş Açılarını Seçin",ShowAzimuthAngle:"Azimut Açısını Göster",ShowElevationAngle:"Yükselme Açısını Göster",ShowZenithAngle:"Zenit Açısını Göster",DirectLightBrightnessAtNoon:"Direct Light Brightness at Noon",AmbientLightBrightnessAtNoon:"Ambient Light Brightness at Noon"},groundMenu:{MonthlyIrradianceLoss:"Monthly Irradiance Loss",Vegetation:"Vegetation",LeafOutDay:"Leaf-Out Day",LeafOffDay:"Leaf-Off Day",Albedo:"Albedo",ImageOnGround:"Yer Görüntüsü",WaterSurface:"Water Surface",RemoveAllUnlockedTrees:"Tüm Ağaçları Kaldır",RemoveAllUnlockedFlowers:"Remove All Unlocked Flowers",RemoveAllUnlockedSolarPanels:"Remove All Unlocked Solar Panels",RemoveAllUnlockedPeople:"Tüm Kişileri Kaldır",RemoveAllUnlockedFoundations:"Tüm Temelleri Kaldır",RemoveAllUnlockedCuboids:"Tüm Kübikleri Kaldır",DoYouReallyWantToRemoveAllPeople:"Tüm Kişileri Kaldırmak İstiyor Musunuz?",DoYouReallyWantToRemoveAllTrees:"Tüm Ağaçları Kaldırmak İstiyor Musunuz?",DoYouReallyWantToRemoveAllFlowers:"Do you really want to remove all the flowers that are not locked",DoYouReallyWantToRemoveAllSolarPanels:"Do you really want to remove all the solar panels that are not locked",DoYouReallyWantToRemoveAllFoundations:"Tüm Temelleri Kaldırmak İstiyor Musunuz?",DoYouReallyWantToRemoveAllCuboids:"Tüm Kübikleri Kaldırmak İstiyor Musunuz?",LockAllUnlockedElements:"Lock All Unlocked Elements",UnlockAllLockedElements:"Unlock All Locked Elements"},labelSubMenu:{Label:"Etiket",LabelText:"Label Text",LabelHeight:"Label Height",LabelSize:"Label Size",LabelFontSize:"Font Size",LabelColor:"Label Color",KeepShowingLabel:"Etiketi Göstermeye Devam Et"},foundationMenu:{RemoveAllUnlockedSolarPanels:"Tüm Kilitlenmemiş Güneş Panellerini Kaldır",RemoveAllUnlockedParabolicTroughs:"Tüm Kilitlenmemiş Parabolik Olukları Kaldır",RemoveAllUnlockedParabolicDishes:"Tüm Kilitlenmemiş Parabolik Çanakları Kaldır",RemoveAllUnlockedFresnelReflectors:"Tüm Kilitlenmemiş Fresnel Reflektörleri Kaldır",RemoveAllUnlockedHeliostats:"Tüm Kilitlenmemiş Heliostatları Kaldır",RemoveAllUnlockedWindTurbines:"Remove All Unlocked Wind Turbines",RemoveAllUnlockedSensors:"Tüm Kilitlenmemiş Sensörleri Kaldır",RemoveAllUnlockedLights:"Remove All Unlocked Lights",RemoveAllUnlockedWalls:"Tüm Kilitlenmemiş Duvarları Kaldır",RemoveAllUnlockedWindows:"Remove All Unlocked Windows",RemoveAllUnlockedDoors:"Remove All Unlocked Doors",RemoveAllUnlockedPolygons:"Tüm Kilitlenmemiş Çokgenleri Kaldır",RemoveAllUnlockedHumans:"Tüm Kilitlenmemiş İnsanları Kaldır",RemoveAllUnlockedTrees:"Tüm Kilitlenmemiş Ağaçları Kaldır",RemoveAllUnlockedFlowers:"Remove All Unlocked Flowers",Racks:"Çerçeveler",Texture01:"Doku 1",Texture02:"Doku 2",Texture03:"Doku 3",Texture04:"Doku 4",Texture05:"Doku 5",Texture06:"Doku 6",Texture07:"Doku 7",Texture08:"Doku 8",Texture09:"Doku 9",Texture10:"Doku 10",SolarPanels:"Güneş Panelleri",SolarPanelArray:"Solar Panel Array",DoYouReallyWantToRemoveAllSolarPanelsOnFoundation:" Seçili temel üzerindeki tüm güneş panellerini kaldırmak istiyor musunuz?",ParabolicTroughs:"Parabolik Oluklar",DoYouReallyWantToRemoveAllParabolicTroughsOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm parabolik olukları kaldırmak istiyor musunuz?",ParabolicDishes:"Parabolik Çanaklar",DoYouReallyWantToRemoveAllParabolicDishesOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm parabolik çanakları kaldırmak istiyor musunuz?",FresnelReflectors:"Fresnel Reflektörler",DoYouReallyWantToRemoveAllFresnelReflectorsOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm Fresnel reflektörlerini kaldırmak istiyor musunuz?",Heliostats:"Heliostatlar",DoYouReallyWantToRemoveAllHeliostatsOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm heliostatları kaldırmak istiyor musunuz?",WindTurbines:"Wind Turbines",DoYouReallyWantToRemoveAllWindTurbinesOnFoundation:"Do you really want to remove all the wind turbines on this foundation that are not locked",Sensors:"Sensörler",DoYouReallyWantToRemoveAllSensorsOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm sensörleri kaldırmak istiyor musunuz?",Lights:"Lights",DoYouReallyWantToRemoveAllLightsOnFoundation:"Do you really want to remove all the lights on this foundation that are not locked",Walls:"Duvarlar",DoYouReallyWantToRemoveAllWallsOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm duvarları kaldırmak istiyor musunuz? ",Windows:"Windows",DoYouReallyWantToRemoveAllWindowsOnFoundation:"Do you really want to remove all the windows on this foundation that are not locked",Doors:"Doors",DoYouReallyWantToRemoveAllDoorsOnFoundation:"Do you really want to remove all the doors on this foundation that are not locked",Polygons:"Poligonlar",DoYouReallyWantToRemoveAllPolygonsOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm poligonları kaldırmak istiyor musunuz?",Humans:"Kişiler",DoYouReallyWantToRemoveAllHumansOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm insanları kaldırmak istiyor musunuz?",Trees:"Ağaçlar",DoYouReallyWantToRemoveAllTreesOnFoundation:" Seçili temel üzerinde kilitli olmayan tüm ağaçları kaldırmak istiyor musunuz?",Flowers:"Flowers",DoYouReallyWantToRemoveAllFlowersOnFoundation:"Do you really want to remove all the flowers on this foundation that are not locked",OnlyThisFoundation:"Sadece Seçili Temel",AllConnectedFoundations:"Tüm Bağlantılı Temeller",AllSelectedFoundations:"All Selected Foundations",AllFoundations:"Tüm Temeller",AddPolygon:"Poligon Ekle",SolarStructure:"Solar Yapı Seçin",GroupMaster:"Grup Yöneticisi",LockAllUnlockedElementsOnThisFoundation:"Lock All Unlocked Elements on This Foundation",UnlockAllLockedElementsOnThisFoundation:"Unlock All Locked Elements on This Foundation",GroundFloorRValue:"Ground Floor R-Value",OnlyThisGroundFloor:"Only This Ground Floor",AllGroundFloors:"All Ground Floors"},solarPowerTowerMenu:{ReceiverTowerForHeliostats:"Heliostat Alıcı Kulesi",ReceiverTowerPhysicalProperties:"Alıcı Kule Fiziksel Özellikler",ReceiverTowerHeight:"Alıcı Kule Yükseklik",ReceiverTowerRadius:"Alıcı Kule Yarıçap",ReceiverAbsorptance:"Alıcı Absorbsiyon",ReceiverOpticalEfficiency:"Alıcı Optik Verim",ReceiverThermalEfficiency:"Alıcı Termal Verim"},solarAbsorberPipeMenu:{AbsorberPipeForFresnelReflectors:"Fresnel Reflektör Soğurucu Boru",AbsorberPipePhysicalProperties:"Soğurucu Boru Fiziksel Özellikler",AbsorberHeight:"Soğurucu Boru Yükseklik",AbsorberApertureWidth:"Soğurucu boru diyafram genişliği",AbsorberPipePoleNumber:"Soğurucu Boru Sayısı",AbsorberAbsorptance:"Soğurucu Absorbsiyonu",AbsorberOpticalEfficiency:"Soğurucu Optik Verimlilik",AbsorberThermalEfficiency:"Soğurucu Isıl Verimlilik"},solarUpdraftTowerMenu:{SolarUpdraftTower:"Solar Updraft Kulesi",SolarUpdraftTowerPhysicalProperties:"Solar Updraft Kulesi Fiziksel Özellikler",SolarUpdraftTowerChimneyHeight:"Solar Updraft Kulesi Baca Yüksekliği",SolarUpdraftTowerChimneyRadius:"Solar Updraft Kulesi Baca Yarıçapı",SolarUpdraftTowerCollectorHeight:"Solar Updraft Kulesi Collector Height",SolarUpdraftTowerCollectorRadius:"Solar Updraft Kulesi Kollektör Yarıçapı",SolarUpdraftTowerCollectorTransmissivity:"Solar Updraft Kulesi Kollektör Geçirgenliği",SolarUpdraftTowerCollectorEmissivity:"Solar Updraft Kulesi Kollektör Emisivite",SolarUpdraftTowerDischargeCoefficient:"Solar Updraft Kulesi Deşarj Katsayısı",SolarUpdraftTowerTurbineEfficiency:"Solar Updraft Kulesi Türbin Verimliliği"},cuboidMenu:{Texture01:"Doku 1",Texture02:"Doku 2",Texture03:"Doku 3",Texture04:"Doku 4",Texture05:"Doku 5",Texture06:"Doku 6",Texture07:"Doku 7",Texture08:"Doku 8",Texture09:"Doku 9",Texture10:"Doku 10",RemoveAllUnlockedSolarPanels:"Tüm Kilitlenmemiş Güneş Panellerini Kaldır",RemoveAllUnlockedSensors:"Tüm Kilitlenmemiş Sensörleri Kaldır",RemoveAllUnlockedPolygons:"Tüm Kilitlenmemiş Poligonları Kaldır",RemoveAllUnlockedHumans:"Tüm Kilitlenmemiş Kişileri Kaldır",RemoveAllUnlockedTrees:"Tüm Kilitlenmemiş Ağaçları Kaldır",RemoveAllUnlockedFlowers:"Remove All Unlocked Flowers",RemoveAllUnlockedLights:"Remove All Unlocked Lights",Racks:"Çerçeveler",Lights:"Lights",DoYouReallyWantToRemoveAllLightsOnCuboid:"Do you really want to remove all the lights on this cuboid that are not locked",SolarPanels:"Güneş Panelleri",DoYouReallyWantToRemoveAllSolarPanelsOnCuboid:" Seçili kübik üzerinde kilitlenmemiş tüm güneş panellerini kaldırmak istiyor musunuz?",Sensors:"Sensörler",DoYouReallyWantToRemoveAllSensorsOnCuboid:" Seçili kübik üzerinde kilitlenmemiş tüm sensörleri kaldırmak istiyor musunuz?",Polygons:"Poligonlar",DoYouReallyWantToRemoveAllPolygonsOnCuboid:" Seçili kübik üzerinde kilitlenmemiş tüm poligonları kaldırmak istiyor musunuz?",Humans:"İnsanlar",DoYouReallyWantToRemoveAllHumansOnCuboid:" Seçili kübik üzerinde kilitlenmemiş tüm insanları kaldırmak istiyor musunuz?",Trees:"Ağaçlar",DoYouReallyWantToRemoveAllTreesOnCuboid:" Seçili kübik üzerinde kilitlenmemiş tüm ağaçları kaldırmak istiyor musunuz?",Flowers:"Flowers",DoYouReallyWantToRemoveAllFlowersOnCuboid:"Do you really want to remove all the flowers on this cuboid that are not locked",OnlyThisCuboid:"Sadece Seçili Kübik",AllCuboidsOnSameSurface:"All Cuboids on Same Surface",AllCuboidsAboveSameBase:"All Cuboids above Same Base",AllSelectedCuboids:"All Selected Cuboids",AllCuboids:"Tüm Kübikler",OnlyThisSide:"Sadece Seçili Yüzey",AllSidesOfThisCuboid:"Seçili Kübik Tüm Yüzeyler",AllSidesOfSelectedCuboids:"All Sides of Selected Cuboids",AllSidesOfAllCuboids:"Bütün Kübik Yüzeyleri ",AddPolygon:"Poligon Ekle",Stackable:"Stackable",GroupMaster:"Group Master"},polygonMenu:{Texture01:"Doku 1",Texture02:"Doku 2",Texture03:"Doku 3",Texture04:"Doku 4",Texture05:"Doku 5",Texture06:"Doku 6",Texture07:"Doku 7",Texture08:"Doku 8",Texture09:"Doku 9",Texture10:"Doku 10",TextBox:"Text Box",FontOutlineColor:"Font Outline Color",FontOutlineWidth:"Font Outline Width",FontStrokeColor:"Font Stroke Color",FontStrokeWidth:"Font Stroke Width",NoOutline:"No Outline",Shiny:"Shiny",Filled:"Dolgu",FillTexture:"Dolgu Dokusu",FillColor:"Dolgu Rengi",Opacity:"Opaklık",LineColor:"Çizgi Rengi",LineWidth:"Çizgi Kalınlığı",LineStyle:"Çizgi Stili",SolidLine:"Düz çizgi",DashedLine:"Kesik çizgi",DottedLine:"Noktalı çizgi",InsertVertexBeforeIndex:"İndeksten Önce Tepe Noktası Ekle",InsertVertexAfterIndex:"İndeksten Sonra Tepe Noktası Ekle",DeleteVertex:"Tepe Noktası Sil",OnlyThisPolygon:"Sadece Seçili Poligon",AllPolygonsOnSurface:"Tüm Poligonlar Aynı Yüzeyde",AllPolygonsAboveFoundation:"Temel Üzerindeki Tüm Poligonlar",AllSelectedPolygons:"All Selected Polygons",AllPolygons:"Tüm Poligonlar",Layout:"Düzen",SolarPanelArrayLayout:"Güneş Paneli Dizi Düzeni",SolarPanelArrayLayoutParametricDesign:"Güneş Paneli Dizi Düzeni: Parametrik Tasarım",SolarPanelArrayLayoutGenerativeDesign:"Güneş Paneli Dizi Düzeni: Üretici Tasarım",SolarPanelArrayModel:"Güneş Paneli Modeli",SolarPanelArrayOrientation:"Oryantasyon",SolarPanelArrayTiltAngle:"Eğim Açısı",SolarPanelArrayRowWidth:"Dizi Sıra Genişliği",SolarPanelArrayInterRowSpacing:"Dizi Sıra Arası Boşluk",SolarPanelArrayRowSpacing:"Row Spacing",SolarPanelArrayRowAxis:"Dizi Sıra Ekseni",SolarPanelArrayLeftRightRowAxis:"Left-Right (Relative)",SolarPanelArrayUpDownRowAxis:"Up-Down (Relative)",SolarPanelArrayEastWestRowAxis:"Doğu-Batı (Absolute)",SolarPanelArrayNorthSouthRowAxis:"Kuzey-Güney (Absolute)",SolarPanelArrayMargin:"Margin",SolarPanelArrayPoleHeight:"Direk Yükseklik",SolarPanelArrayPoleSpacing:"Direk Aralık",SolarPanelArrayTotalYearlyCost:"Total Cost",SolarPanelArrayTotalYearlyRevenue:"Total Revenue",SolarPanelArrayTotalYearlyYield:"Total Yield",SolarPanelArrayMeanYearlyYield:"Mean Yield",SolarPanelArrayYearlyProfit:"Profit",LayoutNotAcceptedCheckYourParameters:"Bu yerleşim düzeni uygulanamaz. Lütfen parametrelerinizi kontrol edin."},optimizationMenu:{Optimization:"Optimizasyon",Parameters:"Parametreler",Variables:"Değişkenler",Constants:"Sabitler",GeneticAlgorithm:"Genetik Algoritma",GeneticAlgorithmSettings:"Genetik Algoritma Ayarı",ParticleSwarmOptimization:"Parçacık Sürü Optimizasyon",ParticleSwarmOptimizationSettings:"Parçacık Sürü Optimizasyon Ayarı",SolarPanelTiltAngleOptimization:"Güneş Paneli Eğim Açısı Optimizasyonu",SolarPanelArrayLayout:"Güneş Paneli Dizi Düzeni",Generation:"Nesil",Gene:"Gen",NormalizedVariables:"Normalleştirilmiş Değişkenler",Objective:"Amaç",ObjectiveFunctionDailyTotalYield:"Günlük Toplam Üretim",ObjectiveFunctionYearlyTotalYield:"Yıllık Toplam Üretim",ObjectiveFunctionDailyMeanYield:"Günlük Ortalama Üretim",ObjectiveFunctionYearlyMeanYield:"Yıllık Ortalama Üretim",ObjectiveFunctionDailyProfit:"Günlük Kazanç",ObjectiveFunctionYearlyProfit:"Yıllık Kazanç",GeneticAlgorithmSelectionMethod:"Genetik Algoritma Seçim Yöntemi",RouletteWheel:"Rulet Çarkı",Tournament:"Turnuva",SearchMethod:"Arama Yöntemi",GlobalSearchUniformSelection:"Küresel Arama Standart Seçim",LocalSearchRandomOptimization:"Yerel Arama Rastgele Optimizasyon",PopulationSize:"Popülasyon Boyutu",MaximumGenerations:"Maksimum Nesil",SelectionRate:"Seçim Oranı",CrossoverRate:"Geçiş Oranı",MutationRate:"Mutasyon Oranı",Step:"Adım",SwarmSize:"Sürü Boyutu",MaximumSteps:"Maksimum Adım",MaximumVelocity:"Maksimum Hız",InertiaWeight:"Atalet Ağırlığı",CognitiveCoefficient:"Bilişsel Katsayı",SocialCoefficient:"Sosyal Katsayı",ConvergenceThreshold:"Sonlandırma için Yakınsama Eşiği",LocalSearchRadius:"Yerel Arama Yarıçapı",RowsPerRackRange:"Raf Başına Sıra Aralığı",TiltAngleRange:"Eğim Açısı Aralığı",InterRowSpacingRange:"Sıra Arası Aralık Ranjı",ClickTargetPolygonToActivate:"Etkinleştirmek için Hedef Poligona Tıklayınız",ClickTargetFoundationToActivate:"Etkinleştirmek için Hedef Temele Tıklayınız"},treeMenu:{ShowModel:"Modeli Göster",Flip:"Flip",Type:"Tür",Spread:"Yayılım"},flowerMenu:{Flip:"Flip",Type:"Type",Spread:"Spread"},peopleMenu:{ChangePerson:"Kişi Değiştir",Flip:"Flip",Observer:"Gözlemci",ViewFromThisPerson:" Seçili Kişiye Göre Perspektif"},lightMenu:{Color:"Color",Intensity:"Intensity",Decay:"Decay",MaximumDistance:"Distance",Inside:"Inside"},solarCollectorMenu:{Coordinates:"Coordinates",RelativeXCoordinateOfCenter:"Relative X Coordinate of Center",RelativeYCoordinateOfCenter:"Relative Y Coordinate of Center",RelativeAzimuth:"Göreceli Azimut Açısı",Pole:"Pole",PoleHeight:"Direk Yüksekliği",PoleRadius:"Pole Radius",ExtraPoleHeight:"Ekstra Direk Yüksekliği",ExtraPoleHeightInAdditionToHalfWidth:"Yarım Genişliğe Ek Ekstra Direk Yüksekliği",DrawSunBeam:"Güneş Işını Çiz"},concentratedSolarPowerCollectorMenu:{ReflectorReflectance:"Reflektör Yansıma",ReceiverAbsorptance:"Alıcı Absorbsiyonu",ReflectorOpticalEfficiency:"Reflektör Optik Verimliliği",ReceiverThermalEfficiency:"Alıcı Termal Verimliliği"},waterHeaterMenu:{OnlyThisWaterHeater:"Only This Water Heater",AllWaterHeatersOnSurface:"All Water Heaters on the Same Surface",AllWaterHeatersAboveFoundation:"All Water Heaters Above the Same Foundation",AllSelectedWaterHeaters:"All Selected Water Heaters",AllWaterHeaters:"All Water Heaters"},solarPanelMenu:{ElectricalProperties:"Electrical Properties",InverterEfficiency:"Inverter Efficiency",InverterEfficiencyExplained:"The efficiency for converting direct current (DC) to alternating current (AC).",DcToAcSizeRatio:"DC-to-AC Size Ratio",DcToAcSizeRatioExplained:"The ratio of the solar panels' DC-rated size to the inverter's AC-rated size.",ChangePvModel:"PV Modelini Değiştir",Orientation:"Oryantasyon",Portrait:"Portre",Landscape:"Peyzaj",FrameColor:"Frame Color",Panels:"Paneller",PanelsWide:"Panel Genişliği",PanelsLong:"Panel Uzunluğu",TiltAngle:"Eğim Açısı",SouthFacingIsPositive:"Güney yönünde açı pozitiftir.",Tracker:"İzleyici",SolarTrackerFollowsSun:"Güneş paneli verimini artırmak için bir güneş izleme sistemi güneşi sürekli takip eder.",PoleSpacing:"Direk Aralığı",NoTracker:"İzleme Sistemi Yok",HorizontalSingleAxisTracker:"Yatay Tek Eksenli İzleme Sistemi",VerticalSingleAxisTracker:"Dikey Tek Eksenli İzleme Sistemi",AltazimuthDualAxisTracker:"Altazimut Çift Eksenli İzleme Sistemi",OnlyThisSolarPanel:"Sadece Seçili Güneş Paneli",AllSolarPanelsOnSurface:"Tüm Güneş Panelleri Aynı Yüzeyde",AllSolarPanelsAboveFoundation:"Tüm Güneş Panelleri Aynı Temel Üzerinde",AllSelectedSolarPanels:"All Selected Solar Panels",AllSolarPanels:"Tüm Güneş Panelleri"},pvModelPanel:{SolarPanelSpecs:"Güneş Paneli Özellikleri",Model:"Model",PanelSize:"Panel Boyutu",Cells:"Hücreler",CellType:"Hücre Tipi",Monocrystalline:"Monokristal",Polycrystalline:"Polikristal",ThinFilm:"İnce Katman",Bifacial:"Bifacial",BifacialityFactor:"Bifaciality Factor",Black:"Siyah",Blue:"Mavi",ShadeTolerance:"Gölge Toleransı",SolarCellEfficiency:"Güneş Pili Verimliliği",NominalOperatingCellTemperature:"Nominal Çalışma Hücresi Sıcaklığı",TemperatureCoefficientOfPmax:"Pmax Sıcaklık Katsayısı"},parabolicTroughMenu:{ModuleLength:"Modül Uzunluğu",Modules:"Modüller",ModulesLong:"Modüllerin Uzunluğu",LatusRectum:"Özkiriş",OnlyThisParabolicTrough:"Sadece Seçili Parabolik Oluk",AllParabolicTroughsAboveFoundation:"Aynı Temelin Üzerindeki Tüm Parabolik Oluklar",AllSelectedParabolicTroughs:"All Selected Parabolic Troughs",AllParabolicTroughs:"Tüm Parabolik Oluklar"},fresnelReflectorMenu:{AbsorberPipe:"Soğurucu Boru",SelectAbsorberToReflectSunlightTo:"Güneş Işığı Yansıtılacak Soğurucuyu Seçin",ModuleLength:"Modül Uzunluğu",Modules:"Modüller",ModulesLong:"Modüllerin Uzunluğu",OnlyThisFresnelReflector:"Sadece Seçili Fresnel Reflektör",AllFresnelReflectorsAboveFoundation:"Aynı Temel Üzerindeki Tüm Fresnel Reflektörler",AllSelectedFresnelReflectors:"All Selected Fresnel Reflectors",AllFresnelReflectors:"Tüm Fresnel Reflektörler"},heliostatMenu:{Tower:"Kule",SelectTowerToReflectSunlightTo:"Güneş Işığı Yansıtılacak Kuleyi Seçin",OnlyThisHeliostat:"Sadece Seçili Heliostat",AllHeliostatsAboveFoundation:"Aynı Temel Üzerindeki Tüm Heliostatlar",AllSelectedHeliostats:"All Selected Heliostats",AllHeliostats:"Tüm Heliostatlar"},parabolicDishMenu:{ReceiverStructure:"Alıcı Yapısı",CentralPole:"Merkez Direk",CentralPoleWithTripod:"Tripodlu Merkez Direk",Quadrupod:"Dört Ayaklı",RimDiameter:"Kasnak Çapı",LatusRectum:"Özkiriş",ExtraPoleHeightInAdditionToRadius:"Yarıçapa Ek Olarak Ekstra Direk Yüksekliği",OnlyThisParabolicDish:"Sadece Seçili Parabolik Çanak",AllParabolicDishesAboveFoundation:"Aynı Temel Üzerindeki Tüm Parabolik Çanaklar",AllSelectedParabolicDishes:"All Selected Parabolic Dishes",AllParabolicDishes:"Tüm Parabolik Çanaklar"},windTurbineMenu:{BirdSafeDesign:"Bird-Safe Design",BirdSafeNone:"None",BirdSafeBicolor:"Bicolor",BirdSafeStriped:"Striped",Rotor:"Rotor",BladeNumber:"Blade Number",RotorInitialAngle:"Rotor Initial Angle",RotorBladeDesign:"Rotor Blade Design",RotorBladeRadius:"Rotor Blade Radius",RotorBladePitchAngle:"Rotor Blade Pitch Angle",RelativeYawAngle:"Relative Yaw Angle",MaximumChordLength:"Maximum Chord Length",Tower:"Tower",TowerHeight:"Tower Height",TowerRadius:"Tower Radius",HubDesign:"Hub Design",HubRadius:"Hub Radius",HubLength:"Hub Length",OnlyThisWindTurbine:"Only This Wind Turbine",AllWindTurbinesAboveFoundation:"All Wind Turbines Above the Same Foundation",AllSelectedWindTurbines:"All Selected Wind Turbines",AllWindTurbines:"All Wind Turbines"},wallMenu:{TextureDefault:"Varsayılan",Texture01:"Doku 1",Texture02:"Doku 2",Texture03:"Doku 3",Texture04:"Doku 4",Texture05:"Doku 5",Texture06:"Doku 6",Texture07:"Doku 7",Texture08:"Doku 8",Texture09:"Doku 9",Texture10:"Doku 10",SizeOfWall:"Duvar Boyutu",OnlyThisWall:"Sadece Seçili Duvar",AllConnectedWalls:"All Connected Walls",AllWallsAboveFoundation:" Aynı Temel Üzerindeki Tüm Duvarlar",AllSelectedWalls:"All Selected Walls",AllWalls:"Tüm Duvarlar",Windows:"Pencereler",LockAllUnlockedWindows:"Lock All Unlocked Windows",UnlockAllLockedWindows:"Unlock All Locked Windows",RemoveAllUnlockedWindows:"Kilitlenmemiş Tüm Pencereleri Kaldır",DoYouReallyWantToRemoveAllWindowsOnThisWall:" Seçili duvardaki tüm pencereleri kaldırmak istiyor musunuz?",Doors:"Kapılar",LockAllUnlockedDoors:"Lock All Unlocked Doors",UnlockAllLockedDoors:"Unlock All Locked Doors",RemoveAllUnlockedDoors:"Tüm Kilitlenmemiş Kapıları Kaldır",DoYouReallyWantToRemoveAllDoorsOnThisWall:" Seçili duvardaki tüm kapıları kaldırmak istiyor musun?",SolarPanels:"Güneş Panelleri",LockAllUnlockedSolarPanels:"Lock All Unlocked Solar Panels",UnlockAllLockedSolarPanels:"Unlock All Locked Solar Panels",RemoveAllUnlockedSolarPanels:"Kilitlenmemiş Tüm Güneş Panellerini Kaldır",DoYouReallyWantToRemoveAllSolarPanelsOnThisWall:" Seçili duvardaki tüm güneş panellerini kaldırmak istiyor musunuz?",Sensors:"Sensors",LockAllUnlockedSensors:"Lock All Unlocked Sensors",UnlockAllLockedSensors:"Unlock All Locked Sensors",RemoveAllUnlockedSensors:"Remove All Unlocked Sensors",DoYouReallyWantToRemoveAllSensorsOnThisWall:"Do you really want to remove all the sensors on this wall",Lights:"Lights",LockAllUnlockedLights:"Lock All Unlocked Lights",UnlockAllLockedLights:"Unlock All Locked Lights",RemoveAllUnlockedLights:"Remove All Unlocked Lights",DoYouReallyWantToRemoveAllLightsOnThisWall:"Do you really want to remove all the lights on this wall",Polygons:"Polygons",LockAllUnlockedPolygons:"Lock All Unlocked Polygons",UnlockAllLockedPolygons:"Unlock All Locked Polygons",RemoveAllUnlockedPolygons:"Tüm Kilitlenmemiş Poligonları Kaldır",DoYouReallyWantToRemoveAllPolygonsOnThisWall:"Do you really want to remove all the polygons on this wall",WallStructure:"Duvar Yapısı",DefaultStructure:"Varsayılan",StudStructure:"Ahşap Dikme",PillarStructure:"Pillar",Opacity:"Opaklık",StructureSpacing:"Structure Spacing",StructureWidth:"Structure Width",StructureThickness:"Structure Thickness",StructureColor:"Structure Color",Color:"Wall Color",Height:"Height",Thickness:"Thickness",Texture:"Texture",AllLightsOnWallInside:"All Lights on Wall Inside",AllLightsOnWallOutside:"All Lights on Wall Outside",Fill:"Fill",Full:"Full",Partial:"Partial",Empty:"Empty",OpenToOutside:"Open to Outside",EavesLength:"Eaves Overhang Length",Parapet:"Parapet",ParapetColor:"Parapet Color",ParapetTexture:"Parapet Texture",ParapetHeight:"Parapet Height",CopingsHeight:"Copings Height",CopingsWidth:"Copings Width"},windowMenu:{OnlyThisWindow:"Sadece Bu Pencere",AllWindowsOnSurface:"All Windows on the Same Surface",AllWindowsAboveFoundation:"Aynı Temelin Üzerindeki Tüm Pencereler",AllSelectedWindows:"All Selected Windows",AllWindows:"Tüm Pencereler",Width:"Genişlik",Height:"Yükseklik",Setback:"Setback from Exterior Surface",RelativeToWallThickness:"Relative to wall thickness",Mullion:"Tiriz",HorizontalMullion:"Horizontal Mullion",VerticalMullion:"Vertical Mullion",MullionWidth:"Tiriz Genişliği",HorizontalMullionSpacing:"Horizontal Mullion Spacing",VerticalMullionSpacing:"Vertical Mullion Spacing",MullionColor:"Mullion Color",Tint:"Ton",Opacity:"Opaklık",SolarHeatGainCoefficient:"Solar heat gain coefficient (SHGC) = 1 - opacity",Shutter:"Kepenk",LeftShutter:"Sol Kepenk",RightShutter:"Sağ Kepenk",BothShutters:"Kepenkler",ShutterWidth:"Genişlik",ShutterColor:"Kepenk Rengi",Frame:"Frame",FrameWidth:"Frame Width",SillWidth:"Sill Width",Color:"Frame Color",WindowType:"Window Type",Default:"Default",Arched:"Arched",Polygonal:"Polygonal",Interior:"Interior",Empty:"Empty"},roofMenu:{TextureDefault:"Varsayılan",Texture01:"Doku 1",Texture02:"Doku 2",Texture03:"Doku 3",Texture04:"Doku 4",Texture05:"Doku 5",Texture06:"Doku 6",Texture07:"Doku 7",OnlyThisRoof:"Sadece Seçili Çatı",AllRoofsAboveFoundation:"Aynı Temelin Üzerinde Tüm Çatılar",AllSelectedRoofs:"All Selected Roofs",AllRoofs:"Tüm Çatılar",OnlyThisCeiling:"Only This Ceiling",AllCeilingsAboveFoundation:"All Ceilings Above the Same Foundation",AllCeilings:"All Ceilings",EavesOverhangLength:"Eaves Overhang Length",RafterSpacing:"Mertek Aralığı",RafterWidth:"Mertek Genişliği",RafterThickness:"Mertek Kalınlığı",RafterColor:"Mertek Rengi",RoofColor:"Çatı Rengi",RoofSideColor:"Roof Side Color",GlassTint:"Cam Tonu",Opacity:"Opaklık",RoofStructure:"Çatı Yapısı",DefaultStructure:"Varsayılan",RafterStructure:"Mertek",GlassStructure:"Cam",SolarPanels:"Solar Panels",LockAllUnlockedSolarPanels:"Lock All Unlocked Solar Panels",UnlockAllLockedSolarPanels:"Unlock All Locked Solar Panels",RemoveAllUnlockedSolarPanels:"Remove All Unlocked Solar Panels",DoYouReallyWantToRemoveAllSolarPanelsOnThisRoof:"Do you really want to remove all the solar panels on this roof",Windows:"Windows",LockAllUnlockedWindows:"Lock All Unlocked Windows",UnlockAllLockedWindows:"Unlock All Locked Windows",RemoveAllUnlockedWindows:"Remove All Unlocked Windows",DoYouReallyWantToRemoveAllWindowsOnThisRoof:"Do you really want to remove all the windows on this roof",Sensors:"Sensors",LockAllUnlockedSensors:"Lock All Unlocked Sensors",UnlockAllLockedSensors:"Unlock All Locked Sensors",RemoveAllUnlockedSensors:"Remove All Unlocked Sensors",DoYouReallyWantToRemoveAllSensorsOnThisRoof:"Do you really want to remove all the sensors on this roof",Lights:"Lights",RemoveAllUnlockedLights:"Remove All Unlocked Lights",DoYouReallyWantToRemoveAllLightsOnThisRoof:"Do you really want to remove all the lights on this roof",AllLightsOnRoofInside:"All Lights on Roof Inside",AllLightsOnRoofOutside:"All Lights on Roof Outside",Rise:"Rise",Ceiling:"Ceiling",RoofRValue:"Roof R-Value",CeilingRValue:"Ceiling R-Value"},doorMenu:{TextureDefault:"Varsayılan",Texture01:"Doku 1",Texture02:"Doku 2",Texture03:"Doku 3",Texture04:"Doku 4",Texture05:"Doku 5",Texture06:"Doku 6",Texture07:"Doku 7",Texture08:"Doku 8",Texture09:"Doku 9",Texture10:"Doku 10",Texture11:"Doku 11",Texture12:"Doku 12",Texture13:"Doku 13",Texture14:"Doku 14",Texture15:"Doku 15",Texture16:"Doku 16",Texture17:"Doku 17",OnlyThisDoor:"Sadece Seçili Kapı",AllDoorsOnWall:"Aynı Duvardaki Tüm Kapılar",AllDoorsAboveFoundation:"Aynı Temelin Üstündeki Tüm Kapılar",AllSelectedDoors:"All Selected Doors",AllDoors:"Tüm Kapılar",DoorType:"Door Type",Default:"Default",Arched:"Arched",Filled:"Filled",FrameColor:"Frame Color",Interior:"Interior"},siteInfoPanel:{High:"Yüksek",Low:"Düşük"},designInfoPanel:{NumberOfSelectedHeliostats:"Seçilen heliostat sayısı",NumberOfSelectedSolarPanels:"Seçilen güneş paneli sayısı",ElectricityGeneratedDailyBySolarPanels:"Güneş panellerinin günlük elektrik üretimi",SceneDiameter:"Scene diameter",BuildingArea:"Building area"},visualizationControlPanel:{ColorContrast:"Renk Kontrastı",FluxScale:"Flux Scale",ClickUpOrDownArrowButtonsToChange:"Değiştirmek için yukarı veya aşağı ok butonlarına tıklayınız"},instructionPanel:{Rotate:"Döndürme",DragMouse:"Sol Tık + Sürükle",Zoom:"Yakınlaştırma",MouseWheelOrKeys:"Tekerlek veya Ctrl+[ veya Ctrl+]",MouseWheelOrKeysMac:"Tekerlek veya ⌘+[ veya ⌘+]",Pan:"Ekran Kaydırma",HoldCtrlDragMouse:"Ctrl + Sürükle",HoldMetaDragMouse:"Hold ⌘ and drag mouse",Enter2DMode:"Enter 2D mode",Exit2DMode:"Exit 2D mode",NavigationMode:"Navigation mode",EnableNavigation:"Enable navigation",DisableNavigation:"Disable navigation",MoveForwardBack:"Move forward/back",MoveForwardBackInstruction:"Press W/S",MoveLeftRight:"Move left/right",MoveLeftRightInstruction:"Press A/D",MoveUpDown:"Move up/down",MoveUpDownInstruction:"Press Z/X",Turn:"Turn",TurnInstruction:"Press arrow keys",ResetView:"Yeniden Başlat",AutoRotate:"Otomatik Döndürme",StartOrStop:"Başlat veya Durdur (F4)"},mapPanel:{ImageOnGround:"Yüzey Görünümü",HideAddress:"Hide Address",WeatherStations:"Referans",WeatherStationsNote:"Turn this off to speed up",Coordinates:"Koordinatlar",Zoom:"Büyüt"},visibilityPanel:{SolarPanelVisibility:"Güneş Paneli Görünüm",Observer:"Gözlemci",VantagePoint:"Referans Noktası",ItemizedVisibilityByFields:"Alana Özel Perspektif",TotalVisibility:"Toplam"},sensorPanel:{LightSensor:"Işık Sensörü",WeatherDataFrom:"Hava Durumu"},buildingEnergyPanel:{DailyBuildingEnergy:"Daily Building Energy",YearlyBuildingEnergy:"Yearly Building Energy",Heater:"Heater",AC:"AC",SolarPanel:"Solar Panel",Net:"Net"},solarPanelYieldPanel:{SolarPanelDailyYield:"Güneş Paneli Günlük Üretim",SolarPanelYearlyYield:"Güneş Paneli Yıllık Üretim",Yield:"Üretim",YieldPerHour:"Saatlik Üretim",DailyTotal:"Günlük Toplam",YearlyTotal:"Yıllık Toplam",ShowOutputsOfIndividualSolarPanels:"Herbir güneş panelinin üretimini göster",Profit:"Kazanç",TotalCost:"Total Cost",TotalRevenue:"Total Revenue",TotalYield:"Total Yield",MeanYield:"Mean Yield",ModuleCount:"Module Count"},parabolicTroughYieldPanel:{ParabolicTroughDailyYield:"Parabolik Oluk Günlük Üretim",ParabolicTroughYearlyYield:"Parabolik Oluk Yıllık Üretim",Yield:"Üretim",YieldPerHour:"Saatlik Üretim",DailyTotal:"Günlük Toplam",YearlyTotal:"Yıllık Toplam",ShowOutputsOfIndividualParabolicTroughs:"Herbir parabolik oluğun üretimini göster"},parabolicDishYieldPanel:{ParabolicDishDailyYield:"Parabolik Çanak Günlük Üretim",ParabolicDishYearlyYield:"Parabolik Çanak Yıllık Üretim",Yield:"Üretim",YieldPerHour:"Saatlik Üretim",DailyTotal:"Günlük Toplam",YearlyTotal:"Yıllık Toplam",ShowOutputsOfIndividualParabolicDishes:"Herbir parabolik çanağın üretimini göster"},fresnelReflectorYieldPanel:{FresnelReflectorDailyYield:"Fresnel Reflektör Günlük Üretim",FresnelReflectorYearlyYield:"Fresnel Reflektör Yıllık Üretim",Yield:"Üretim",YieldPerHour:"Saatlik Üretim",DailyTotal:"Günlük Toplam",YearlyTotal:"Yıllık Toplam",ShowOutputsOfIndividualFresnelReflectors:"Herbir Fresnel yansıtıcısının üretimini göster"},heliostatYieldPanel:{HeliostatDailyYield:"Heliostat Günlük Üretim",HeliostatYearlyYield:"Heliostat Yıllık Üretim",Yield:"Üretim",YieldPerHour:"Saatlik Üretim",DailyTotal:"Günlük Toplam",YearlyTotal:"Yıllık Toplam",ShowOutputsOfIndividualHeliostats:"Herbir heliostatın üretimini göster"},updraftTowerYieldPanel:{UpdraftTowerDailyYield:"Solar Updraft Kulesi Günlük Üretimi",UpdraftTowerYearlyYield:"Solar Updraft Kulesi Yıllık Üretimi",ChimneyAirTemperature:"Baca Hava Sıcaklığı",ChimneyWindSpeed:"Baca Rüzgar Hızı",Yield:"Üretim",YieldPerHour:"Saatlik Üretim",DailyTotal:"Günlük Toplam",YearlyTotal:"Yıllık Toplam",ShowOutputsOfIndividualUpdraftTowers:"Herbir updraft kulesinin üretimini göster"},heliodonPanel:{SunAndTimeSettings:"Güneş & Saat Ayarları",SunAngles:"Açılar",TwentyFourHours:"24 Hours"},cloudFilePanel:{CopyTitle:"Copy Title",TitleCopiedToClipBoard:"The title was copied to the clip board",SearchByTitle:"Search by title",MyLikes:"My Likes",MyCloudFiles:"Bulut Dosyalarım",GenerateLink:"Link Oluştur",LinkGeneratedInClipBoard:"Klip Panosunda Oluşturulan Link",DoYouReallyWantToDelete:"Gerçekten silmek istiyor musun?",IfSharedOrPublishedRenamingFileBreaksExistingLinks:"If this file has been shared or published, renaming it breaks existing links"},projectListPanel:{CopyTitle:"Copy Title",TitleCopiedToClipBoard:"The title was copied to the clip board",SearchByTitle:"Search by title",MyProjects:"My Projects",GenerateProjectLink:"Generate Project Link",ProjectLinkGeneratedInClipBoard:"A link to the project was generated in the clip board",DoYouReallyWantToDeleteProject:"Do you really want to delete Project",IfSharedOrPublishedRenamingProjectBreaksExistingLinks:"If this project has been shared or published, renaming it breaks existing links"},projectPanel:{ProjectSettings:"Project Settings",ThumbnailImageSize:"Thumbnail Image Size",ProjectByOtherPeople:"Project by Other People",Project:"Project",ProjectType:"Type",ProjectDescription:"Description",MakeDescriptionEditable:"Make this description editable",MakeDescriptionNonEditable:"Make this description non-editable",DoubleClickToMakeDescriptionEditable:"Double-click to make this description editable",SolarPanelArray:"Solar Panel Array",CurateCurrentDesign:"Curate current design",UpdateSelectedDesign:"Update selected design",RemoveSelectedDesign:"Remove selected design",ClickToFlipSortingOrder:"Click to flip the sorting order",DesignNotShownInSolutionSpaceClickToShow:"This design is not shown in solution space; click to show",DesignShownInSolutionSpaceClickToHide:"This design is shown in solution space; click to hide",SolutionSpace:"Solution Space",ChooseSolutionSpace:"Choose solution space",ChooseDataColoring:"Choose data coloring",SameColorForAllDesigns:"Same color for all designs",OneColorForEachDesign:"One color for each design",SolutionSpaceScreenshot:"Take a screenshot of the solution space",ScatterPlotScreenshot:"Take a screenshot of the scatter plot",SingleClickToSelectDoubleClickToOpen:"Single-click to select, double-click to open.",SingleClickToDeselectDoubleClickToOpen:"Single-click to deselect, double-click to open.",GenerateScatterPlot:"Generate Scatter Plot",SelectXAxis:"Select X Axis",SelectYAxis:"Select Y Axis"},accountSettingsPanel:{MyAccountSettings:"Hesap Ayarlarım",MyID:"Bilgilerim",ClickToCopyMyID:"Bilgilerinizi kopyalamak için tıklayın",IDInClipBoard:"Kişisel bilgileriniz kopyalandı ve yapıştırmaya hazır.",StoreMyNameInMyFilesWhenSaving:"Kaydederken, adımı dosyalarıma ekle",DoYouReallyWantToShowYourNameInYourFiles:"Dosyalarınızda isminizin gösterilmesini istiyor musunuz?",SignFileDisclaimer:"Evet ise, isiminiz dosyalarınıza erişimi olan bütün kişiler tarafından görülebilir.",Likes:"Likes",AllPublished:"All Published",PublishedUnderAliases:"Aliases",UserCount:"Kullanıcı Sayısı",SchoolID:"Okul",ClassID:"Sınıf"},weatherPanel:{SunshineHours:"Gündüz Saatleri"},diurnalTemperaturePanel:{SelectAirTemperatureModel:"Model Seç",Sinusoidal:"Sinüzoidal"},economicsPanel:{EconomicsParameters:"Ekonomik Parametreler",ElectricitySellingPrice:"Elektrik Satış Fiyatı",OperationalCostPerUnit:"Birim Başına İşletme Maliyeti",SellingPrice:"Selling Price",UnitCost:"Unit Cost"},navigationPanel:{NavigationParameters:"Navigation Parameters",MinimumMoveSpeed:"Minimum Move Speed",MinimumTurnSpeed:"Minimum Turn Speed"},shadowSettingsPanel:{ShadowSettings:"Shadow Settings",ShadowCameraFarDistance:"Shadow Camera Far Distance",ShadowMapSize:"Shadow Map Size",Notes:"Notes",RefreshPageNote:"Refresh the page for the new settings to take effect.",MapSizeWarning:"A large shadow map size may cause Aladdin to crash on some computers."},yearlyLightSensorPanel:{SkyClearness:"Gökyüzü Açıklığı",ShowDaylightResults:"Gün Işığı Sonuçlarını Göster",ShowSkyClearnessResults:"Gökyüzü Açıklığı Sonuçlarını Göster",ShowAverageDailySolarRadiation:"Günlük ortalama güneş Işınımını göster"},analysisManager:{NoSensorForCollectingData:"Veri toplamak için sensör yok.",NoSolarPanelForAnalysis:"Analiz için güneş paneli yok.",NoObserverForVisibilityAnalysis:"Görünürlük analizi için gözlemci yok.",NoWaterHeaterForAnalysis:"Analiz için su ısıtıcısı yok",NoParabolicDishForAnalysis:"Analiz için parabolik çanak yok",NoParabolicTroughForAnalysis:"Analiz için parabolik oluk yok.",NoFresnelReflectorForAnalysis:"Analiz için Fresnel reflektörü yok.",NoHeliostatForAnalysis:"Analiz için heliostat yok.",NoSolarUpdraftTowerForAnalysis:"Analiz için Solar Updraft Kulesi yok.",NoBuildingForAnalysis:"There is no building for analysis."},toolbar:{CloudFile:"Bulut Dosyası",Select:"Seç",AddFoundation:"Temel Ekle",AddWall:"Duvar Ekle",AddWindow:"Pencere Ekle",AddDoor:"Kapı Ekle",AddPyramidRoof:"Piramit Çatı Ekle",AddGableRoof:"Beşik Çatı Ekle",AddHipRoof:"Kırma Çatı Ekle",AddGambrelRoof:"Flemenk Çatı Ekle",AddMansardRoof:"Mansart Çatı Ekle",AddCuboid:"Kübik Ekle",AddSensor:"Sensör Ekle",AddSolarPanel:"Güneş Paneli Ekle",AddWaterHeater:"Su Isıtıcı Ekle",AddPowerWall:"Add Power Wall",AddParabolicDish:"Parabolik Çanak Ekle",AddParabolicTrough:"Parabolik Oluk Ekle",AddFresnelReflector:"Fresnel Reflektörü Ekle",AddHeliostat:"Heliostat Ekle",AddWindTurbine:"Add Horizontal Axis Wind Turbine",AddVerticalAxisWindTurbine:"Add Vertical Axis Wind Turbine",AddLight:"Add Light",AddTree:"Ağaç Ekle",AddFlower:"Add Flower",AddPeople:"İnsan Ekle",DoubleClickToLockThisModeForNextAction:"Double-click to lock this mode for next action",ClickToUnlockThisModeForNextAction:"Click to unlock this mode for next action",ManipulateGroup:"Ölçeklendirme",ClearScene:"Herşeyi Sil",ShowSunAndTimeSettings:"Güneş & Zaman Ayarlarını Göster",SpatialAnalysisOfEnergy:"Spatial analysis of energy",DoYouReallyWantToClearContent:"İçeriği silmek istiyor musunuz",ClickForMoreButtons:"Daha fazla buton için tıklayın"},tooltip:{gotoIFI:"Yarının Zekası Enstitüsüne Git",visitAladdinHomePage:"Aladdin Ana Sayfasını Ziyaret Edin",clickToOpenMenu:"Ana Menüyü Açmak İçin Tıklayınız",clickToAccessAccountSettings:"Click to access account settings"},tree:{Apple:"Apple",Birch:"Birch",Coconut:"Coconut",Dogwood:"Kızılcık Ağacı",Elm:"Karaağaç",FanPalm:"Fan Palm",Linden:"Ihlamur Ağacı",Magnolia:"Magnolia",Maple:"Akçaağaç",Oak:"Meşe Ağacı",Pine:"Çam",Spruce:"Alaçam"},flower:{Bellflower:"Bellflower",Boxwood:"Boxwood",CactusCombo1:"Cactus Combo 1",CactusCombo2:"Cactus Combo 2",CactusCombo3:"Cactus Combo 3",CactusCombo4:"Cactus Combo 4",Hibiscus:"Hibiscus",Hosta:"Hosta",Hydrangea:"Hydrangea",Peony:"Peony",RedRose:"Red Rose",Spirea:"Spirea",Sunflower:"Sunflower",TallBush:"Tall Bush",Tulip:"Tulip",WhiteFlower:"White Flower",YellowFlower:"Yellow Flower"},people:{Jaah:"Ata",Jack:"Mete",Jacob:"Jacob",Jacqueline:"Beril",Jade:"Ece",Jamelia:"Bilge",James:"James",Jane:"Jane",Jaya:"Asya",Jaye:"Aylin",Jeanette:"Jeanette",Jedi:"Alp",Jeff:"Kaya",Jena:"Nehir",Jennifer:"Defne",Jess:"Zeynep",Jett:"Umut",Jill:"Jill",Jiya:"Elif",Joan:"Ezgi",Jocelyn:"Jocelyn",Joel:"Cenk",Joey:"Azra",John:"Can",Jonathon:"Jonathon",Jose:"Mert",Joseph:"Joseph",Joshua:"Joshua",Judd:"Ozan",Judy:"Judy",Julia:"Julia",Julio:"Bulut",Jumapili:"Umay",June:"Naz",Juro:"Efe",Justin:"Justin"},compass:{N:"N",S:"S",W:"W",E:"E"},month:{January:"Jan",February:"Feb",March:"Mar",April:"Apr",May:"May",June:"Jun",July:"Jul",August:"Aug",September:"Sep",October:"Oct",November:"Nov",December:"Dec"},modelsMap:{SearchByPublisher:"Search by publisher",SearchByLabel:"Search by label",MyPublishedModels:"My Published Models",TotalNumberOfUserPublishedModels:"Total number of user-published models",SortFromOldestToNewest:"Sort from oldest to newest",SortFromNewestToOldest:"Sort from newest to oldest",ModelsFoundOnThisSite:"models found on this site",ShowModelsPublishedByThisAuthor:"Show the models published by this author"}}},hpt={translation:{name:{IFI:"Інститут Інтелекту Майбутнього",Aladdin:"Aladdin",Tagline:"Aladdin: Переосмислення Дизайну з Пояснювальним Штучним Інтелектом - Інститут Інтелекту Майбутнього"},cookie:{Statement:"Натиснувши «Прийняти», ви погоджуєтеся з використанням файлів cookie для покращення вашого досвіду з Aladdin.",Accept:"Прийняти"},aboutUs:{ProductBroughtToYouBy:"Цей Продукт Було Створено:",TermsOfService:"Умови Використання",PrivacyPolicy:"Політика Конфіденційності",Software:"Програмне Забезпечення",Content:"Матеріали",Research:"Дослідження",Support:"Підтримка",Acknowledgment:"Подяка",FundingInformation:"Національний Науковий Фонд (ННФ, Cполучені Штати Америки) надав фінансову підтримку для дослідження та розробки цього продукту за допомогою грантів №2105695, №2131097, та №#2301164. Однак, будь-які погляди, результати та висновки, висловлені у продукті, належать авторам і можуть не повністю відображати погляди ННФ.",Contact:"Для отримання додаткової інформації, будь ласка, зверніться до Charles Xie (charles@intofuture.org).",Translators:"Переклад"},word:{Refresh:"Refresh",LastUpdate:"Last Update",Small:"Small",Medium:"Medium",Large:"Large",Design:"Design",Information:"Information",Type:"Type",Text:"Текст",FontSize:"Розмір Шрифту",FontColor:"Колір Шрифту",Model:" Модель",Models:"Моделі",Upload:"Завантажити",ClickCount:"Натисніть Підрахувати",Share:"Поділитись",AlreadyLike:"Вподобано",Like:"Вподобати",MustLogInToLike:"Потрібно Увійти, щоб Вподобати",AllRightsReserved:"Усі Права Захищено",MeterAbbreviation:"м",Version:"Версія",VersionInitial:"В",Options:"Опції",Maximum:"Максимум",Minimum:"Мінімум",MaximumNumber:"Максимальне Число",MinimumNumber:"Мінімальне Число",MaximumValue:"Максимальне Значення",MinimumValue:"Мінімальне Значення",Or:"Або",None:"Жоден",High:"Високий",Partial:"Частковий",Teacher:"Вчитель",Class:"Клас",Total:"Всього",Leaderboard:"Таблиця Лідерів",Latest:"Останнє",Range:"Діапазон",SIUnit:"SI Одиниця",USUnit:"US Одиниця",ThermalTransmittance:"Теплопередача",ThermalResistance:"Термічний Опір",UValue:"U-Значення",RValue:"R-Значення",VolumetricHeatCapacity:"Об'ємна Теплоємність",BuildingHVACSystem:"Побудова Системи Опалення, Вентиляції та Кондиціювання Повітря (ОВК)",ThermostatSetpoint:"Задана Температура Термостата",TemperatureToleranceThreshold:"Порогове Значення Допустимого Відхилення Температури",TemperatureToleranceThresholdExplanation:"Обігрівач не працюватиме, якщо найнижча зовнішня температура дня вища за значення отриманe, якщо від заданої температури відняти порогове значення. Кондиціонер не працюватиме, якщо найвища зовнішня температура дня нижча за значення отримане, якщо від заданої температури відняти порогове значення.",Press:"Натисніть",Open:"Відкрити",Save:"Зберегти",SaveAsImage:"Зберегти як Зображення",SaveAsCsv:"Зберегти як CSV",Update:"Оновити",Paste:"Вставити",Copy:"Копіювати",Cut:"Вирізати",Delete:"Видалити",Lock:"Заблокувати",Translucent:"Півпрозорий",Transparency:"Transparency",Color:"Колір",Pattern:"Pattern",Texture:"Текстура",Size:"Розмір",Thickness:"Товщина",Yes:"Так",No:"Ні",OK:"ОК",Cancel:"Скасувати",Apply:"Застосувати",Close:"Закрити",ApplyTo:"Застосувати До",Run:"Запустити",Pause:"Пауза",Resume:"Відновити",Clear:"Очистити",Warning:"Попередження",Caution:"Обережно",Reminder:"Нагадування",Length:"Довжина",Width:"Ширина",Height:"Висота",Radius:"Радіус",Angle:"Кут",Azimuth:"Азимут",Coordinates:"Координати",Weather:"Погода",Show:"Показати",Animate:"Анімувати",Date:"Дата",Time:"Час",Title:"Заголовок",Owner:"Власник",Action:"Дія",Rename:"Перейменувати",Location:"Місцезнаходження",Latitude:"Широта",Month:"Місяць",Day:"День",Hour:"Година",Daylight:"Денне світло",Radiation:"Радіаційне Випромінювання",Temperature:"Температура",kWh:"кВт-год",dollar:"долар",MeterPerSecond:"м/с",NorthInitial:"Північ",SouthInitial:"Південь",EastInitial:"Схід",WestInitial:"Захід",Fixed:"Фіксований",Elements:"Елементи",Energy:"Енергія",Unknown:"Невідомо",Label:"Мітка",Description:"Опис",NoDescription:"Без опису",MaximumCharacters:"Максимальна кількість символів",Author:"Автор",Publisher:"Видавець",Building:"Будівля",ResidentialBuilding:"Житлова будівля",CommercialBuilding:"Комерційна будівля",SchoolBuilding:"Шкільна будівля",TouristAttraction:"Туристична визначна пам'ятка",UnderConstruction:"В стадії будівництва",Photovoltaic:"Фотоелектричний",WindPower:"Wind Power",ColocationProjects:"Colocation Projects",Anonymous:"Анонімний",Nickname:"Нікнейм",Pin:"Закріпити",Unpin:"Відкріпити"},shared:{NoTexture:"Без текстури",FoundationElement:"Фундамент",CuboidElement:"Паралелепіпед",PolygonElement:"Багатокутник",SensorElement:"Сенсор",SolarPanelElement:"Сонячна панель",WaterHeaterElement:"Водонагрівач",ParabolicDishElement:"Параболічна тарілка",ParabolicTroughElement:"Параболічний сонячний колектор",FresnelReflectorElement:"Відбивач Френеля",HeliostatElement:"Геліостат",WindTurbineElement:"Вітрова турбіна",LightElement:"Світло",ElementLocked:"Заблоковано",ModelType:"Тип моделі",OutputBreakdown:"Breakdown",MoreResults:"More Results"},message:{NewVersionAvailable:"A new version is available",CalculationMayBeSlowDoYouWantToContinue:"Calculation may be slow. Do you want to continue?",IncreaseSolarRadiationHeatmapGridCellSizeToSpeedUp:"Increase solar radiation heatmap grid cell size to speed up",ModelNotFound:"Модель не знайдено",CannotSignIn:"Не вдається увійти",CannotSignOut:"Не вдається вийти",YourAccountWasCreated:"Ваш обліковий запис був створений",CannotCreateAccount:"Не вдається створити обліковий запис",YourAccountSettingsWereSaved:"Налаштування облікового запису були збережені",CannotSaveYourAccountSettings:"Не вдається зберегти налаштування облікового запису",CannotSaveYourFileToCloud:"Не вдається зберегти ваш файл у хмарному середовищі",CannotCreateNewProject:"Не вдається створити новий проєкт",CannotCreateNewProjectWithoutTitle:"Cannot create a new project without a title",CannotOpenYourProjects:"Не вдається відкрити ваші проєкти",CannotOpenProject:"Cannot open the project",CannotDeleteProject:"Cannot delete the project",CannotRenameProject:"Cannot rename the project",CannotAddDesignToProject:"Cannot add this design to the project",CannotAddDesignToProjectOwnedByOthers:"Cannot add this design to a project owned by others",DesignRemovedFromProject:"The design was successfully removed from the project",CannotRemoveDesignFromProject:"Cannot remove this design from the project",CannotUpdateProject:"Cannot update the project",CannotFetchProjectData:"Cannot fetch project data",TitleUsedChooseDifferentOne:"Ця назва була використана. Виберіть іншу",CloudFileWithTitleExistsDoYouWantToOverwrite:"Хмарний файл з такою ж назвою вже існує. Ви хочете перезаписати його?",CloudFileNotFound:"Файл у хмарному середовищі не знайдено",CannotLoadModelsOnMap:"Не вдається завантажити моделі на карту",CannotLoadLeaderboard:"Не вдається завантажити таблицю лідерів",CannotPublishModelOnMap:"Не вдається опублікувати модель на карті",CannotLikeModelFromMap:"Не вдається оцінити модель з карти",CannotDeleteModelFromMap:"Не вдається видалити модель з карти",ModelDeletedFromMap:"Модель видалена з карти",DoYouWantToDeleteModelFromMap:"Ви бажаєте видалити модель з карти?",CannotOpenCloudFile:"Не вдається відкрити файл у хмарному середовищі",CannotReadCloudFile:"Cannot read the cloud file",CannotWriteCloudFile:"Cannot write the cloud file",CloudFileCopied:"Cloud file copied",CannotOpenCloudFolder:"Не вдається відкрити папку у хмарному середовищі",CannotDeleteCloudFile:"Не вдається видалити файл у хмарному середовищі",CannotRenameCloudFile:"Не вдається перейменувати файл у хмарному середовищі",DoYouWantToSaveChanges:"Бажаєте зберегти зміни?",NotApplicableToSelectedAction:"Не застосовується до обраної дії",ThisElementIsLocked:"Цей елемент заблокований.",ThisCannotBeUndone:"Це не можна скасувати.",AzimuthOfNorthIsZero:"Азимут півночі дорівнює 0°",CounterclockwiseAzimuthIsPositive:"Азимут є позитивним проти годинникової стрілки.",SouthFacingIsZero:"South-facing is 0°",ClockwiseRotationIsPositive:"Clockwise is positive",MoveCancelledBecauseOfOverlap:"Переміщення скасовано через перекриття.",MoveOutsideBoundaryCancelled:"Переміщення за межі скасовано.",RotationCancelledBecauseOfOverlap:"Ротацію скасовано через перекриття.",RotationOutsideBoundaryCancelled:"Ротація за межі скасована.",ResizingCancelledBecauseOfOverlap:"Зміна розміру скасована через перекриття.",ResizingOutsideBoundaryCancelled:"Зміна розміру за межі скасована.",CannotPasteOutsideBoundary:"Не можна вставити за межі.",CannotPasteBecauseOfOverlap:"Не можна вставити через перекриття.",CannotMoveObjectTooFar:"Не можна перемістити об'єкт занадто далеко.",ExistingSolarPanelsWillBeRemovedBeforeApplyingNewLayout:"Існуючі сонячні панелі будуть видалені перед застосуванням нового макету.",DoYouWantToContinue:"Бажаєте продовжити?",SolarPanelsCannotIntersectWithGround:"Сонячні панелі не можуть перетинатися з землею.",SolarPanelsCannotOverlapWithOneAnother:"Сонячні панелі не можуть накладатися одна на одну.",ScreenshotSaved:"Знімок екрана збережено.",CsvFileSaved:"CSV файл збережено.",SimulationStarted:"Розпочато симуляцію.",SimulationCompleted:"Симуляцію завершено.",SimulationAborted:"Симуляцію перервано.",SimulationPaused:"Симуляцію призупинено.",CancelSimulation:"Скасувати симуляцію",PauseSimulation:"Призупинити симуляцію",ResumeSimulation:"Продовжити симуляцію",SimulationWillNotStartDueToErrors:"Симуляція не розпочнеться через помилки",SimulationWillStartDespiteWarnings:"Симуляція розпочнеться незважаючи на попередження.",EvolutionStarted:"Еволюцію розпочато.",EvolutionCompleted:"Еволюцію завершено.",EvolutionAborted:"Еволюцію перервано.",EvolutionPaused:"Еволюцію призупинено.",EncounterEvolutionError:"Сталася помилка еволюції.",CancelEvolution:"Скасувати еволюцію",PauseEvolution:"Призупинити еволюцію",ResumeEvolution:"Продовжити еволюцію",ConvergenceThresholdHasBeenReached:"Досягнуто порогове значення збіжності.",MaximumNumberOfGenerationsHasBeenReached:"Досягнуто максимальну кількість поколінь.",MaximumNumberOfStepsHasBeenReached:"Досягнуто максимальну кількість кроків.",ObjectiveFunctionTypeError:"Поточна цільова функція не підтримується цією операцією. Будь ласка, розпочніть з меню.",WallsAreNotAtSameHeight:"Стіни не знаходяться на однаковій висоті.",WallsAreNotPerpendicular:"Стіни не перпендикулярні.",WallsAreNotConnected:"Стіни не з'єднані.",WallsNumberNeedToBeFour:"Кількість стін має дорівнювати чотири.",BuildingContainsEmptyWall:"Будівля містить одну або кілька порожніх стін.",BuildingRoofMissing:"У будівлі відсутній дах.",UnknownErrors:"Невідомі помилки."},menu:{AnalysisOptions:"Опції аналізу",option:{GridCellSize:"Розмір комірки сітки",SamplingFrequency:"Частота вибірки",TimesPerHour:"Разів на годину",DaysPerYear:"Днів на рік"},mainMenu:"Головне Меню",cloudMenu:"Меню Хмарного Середовища",projectSubMenu:"Проєкт",project:{CreateNewProject:"Створити Новий Проєкт",OpenProject:"Відкрити Проєкт",SaveProject:"Save Project",SaveProjectAs:"Save Project As",YouMustLogInToCreateProject:"Ви повинні увійти, щоб створити новий проєкт",YouMustLogInToOpenProject:"Ви повинні увійти, щоб відкрити проєкт"},fileSubMenu:"Файл",file:{CreateNewFile:"Створити новий",OpenLocalFile:"Відкрити локально",SaveAsLocalFile:"Зберегти як",SavingAbortedMustHaveValidFileName:"Збереження перервано! Вам потрібно мати дійсне ім'я файлу",OpenCloudFile:"Відкрити у хмарному середовищі",SaveCloudFile:"Зберегти у хмарному середовищі",SaveAsCloudFile:"Зберегти у хмарному середовищі",SavingAbortedMustHaveValidTitle:"Збереження перервано! Вам потрібно мати дійсний заголовок для хмарного файлу",ToSaveYourWorkPleaseSignIn:"Щоб зберегти вашу роботу, будь ласка, увійдіть в систему.",TakeScreenshot:"Зробити знімок екрана",UseCloudFileName:"Використовувати ім'я файлу у хмарному середовищі",PublishOnModelsMap:"Опублікувати на карті моделей",PublishedOnModelsMap:"Вашу модель було опубліковано на карті моделей",UpdatedOnModelsMap:"Ваша модель була оновлена на карті моделей",YouMustLogInToPublishYourModel:"Вам потрібно увійти в систему, щоб опублікувати свою модель",YouCannotPublishAModelThatYouDoNotOwn:"Ви не можете опублікувати модель, якою не володієте",YouMustSaveModelOnCloudBeforePublishingIt:"Вам потрібно зберегти модель у хмарному середовищі перед її публікацією"},editSubMenu:"Редагувати",edit:{Undo:"Скасувати",Redo:"Повторити"},viewSubMenu:"Перегляд",view:{NavigationView:"Navigation View",TwoDimensionalView:"2D Вигляд",ResetView:"Скинути",ZoomIn:"Збільшити масштаб",ZoomOut:"Зменшити масштаб",AutoRotate:"Автоматичний поворот",ShowShadow:"Показати тінь",ShowSurfaceShininess:"Показати блиск поверхні",TranslucentFloatingWindows:"Напівпрозорі плаваючі вікна",accessoriesSubMenu:"Додаткові елементи",accessories:{SiteInformation:"Інформація про місце",DesignInformation:"Інформація про дизайн",Instruction:"Інструкція",StickyNote:"Примітка",Note:"Примітка"}},settingsSubMenu:"Налаштування",settings:{WeatherData:"Дані про погоду",DiurnalTemperature:"Добова температура",Heliodon:"Геліодон",SunAndTime:"Сонце та час"},benchmarksSubMenu:"Бенчмарки",benchmarks:{SolarRadiationPredictionVsMeasurement:"Прогнозування сонячної радіації порівняно з вимірюванням",BESTESTCase600:"Тестування енергоефективності будівель: BESTEST Case 600",BESTESTCase610:"Тестування енергоефективності будівель: BESTEST Case 610",BESTESTCase620:"Тестування енергоефективності будівель: BESTEST Case 620",BESTESTCase630:"Тестування енергоефективності будівель: BESTEST Case 630"},graph:{LineWidth:"Товщина лінії",SymbolSize:"Розмір символу",BarCategoryGap:"Відступ категорій стовпців",ShowHorizontalGridLines:"Показати горизонтальні лінії сітки",ShowVerticalGridLines:"Показати вертикальні лінії сітки"},analysisSubMenu:"Аналіз",physicsSubMenu:"Фізика",physics:{DailySolarRadiationHeatmap:"Щоденна карта сонячної радіації",SolarRadiationHeatmapOptions:"Параметри карти сонячної радіації",SolarRadiationHeatmapGridCellSize:"Розмір комірки на карті сонячної радіації",SolarRadiationHeatmapMaxValue:"Максимальне значення на карті",SolarRadiationHeatmapNoAnimation:"Немає анімації для статичної моделі",ReflectionHeatmap:"Карта відображень"},sensorSubMenu:"Датчик",sensor:{CollectDailyData:"Збирати щоденні дані",CollectYearlyData:"Збирати щорічні дані",SensorSimulationNoAnimation:"Немає анімації для збору даних датчика"},buildingSubMenu:"Будівля",building:{AnalyzeDailyBuildingEnergy:"Аналізувати щоденну енергію будівлі",AnalyzeYearlyBuildingEnergy:"Аналізувати щорічну енергію будівлі",EnergyAnalysisOptions:"Параметри аналізу енергії",EnergyGridCellSize:"Розмір комірки сітки",BuildingEnergySimulationNoAnimation:"Немає анімації симулювати енергію будівлі"},solarPanelSubMenu:"Сонячна панель",solarPanel:{AnalyzeDailyYield:"Аналізувати щоденний дохід",AnalyzeYearlyYield:"Аналізувати щорічний дохід",AnalyzeVisibility:"Аналізувати видимість",PanelDiscretization:"Дискретизація панелі",Exact:"Точний",Approximate:"Наближений",EnergyGridCellSize:"Розмір комірки сітки енергії",VisibilityGridCellSize:"Розмір комірки сітки коефіцієнта видимості",EnergyAnalysisOptions:"Параметри аналізу енергії",VisibilityAnalysisOptions:"Параметри аналізу видимості",SolarPanelSimulationNoAnimation:"Немає анімації для симуляції сонячної панелі"},parabolicTroughSubMenu:"Параболічний сонячний колектор",parabolicTrough:{AnalyzeDailyYield:"Аналізувати щоденний дохід",AnalyzeYearlyYield:"Аналізувати щорічний дохід"},parabolicDishSubMenu:"Параболічний диск",parabolicDish:{AnalyzeDailyYield:"Аналізувати щоденний дохід",AnalyzeYearlyYield:"Аналізувати щорічний дохід"},fresnelReflectorSubMenu:"Відбивач Френеля",fresnelReflector:{AnalyzeDailyYield:"Аналізувати щоденний дохід",AnalyzeYearlyYield:"Аналізувати щорічний дохід"},heliostatSubMenu:"Геліостат",heliostat:{AnalyzeDailyYield:"Аналізувати щоденний дохід",AnalyzeYearlyYield:"Аналізувати щорічний дохід"},solarUpdraftTowerSubMenu:"Сонячна вежа з використаним повітрям",solarUpdraftTower:{AnalyzeDailyYield:"Аналізувати щоденний дохід",AnalyzeYearlyYield:"Аналізувати щорічний дохід",SolarUpdraftTowerSimulationNoAnimation:"Немає анімації симулювати сонячну вежу з використаним повітрям"},tutorialsSubMenu:"Посібники",solarEnergyScienceSubMenu:"Сонячна наука",solarEnergyScienceTutorials:{SunAngles:"Кути сонця відносно спостерігача на землі",InsolationAndClimate:"Інсоляція та клімат",SolarRadiationToBox:"Сонячна радіація в коробку"},buildingScienceSubMenu:"Наука про будівлі",buildingScienceTutorials:{ThermalEnvelopeVsBuildingEnvelope:"Теплозахисна оболонка проти будівельної оболонки",EffectOfSizeOnBuildingEnergy:"Вплив розміру на енергію будівлі",EffectOfOrientationOnBuildingEnergy:"Вплив орієнтації на енергію будівлі",EffectOfInsulationOnBuildingEnergy:"Вплив інсоляції на енергію будівлі",EffectOfRoofColorOnBuildingEnergy:"Вплив кольору даху на енергію будівлі",EffectOfEavesOverhangLengthOnBuildingEnergy:"Вплив довжини виступу карнизу на енергію будівлі",EffectOfWindowSHGCOnBuildingEnergy:"Вплив коефіцієнта сонячного теплозиску вікна на енергію будівлі",EffectOfThermostatSetpointOnBuildingEnergy:"Вплив заданої температури на термостаті на енергію будівлі",EffectOfSolarPanelsOnBuildingEnergy:"Вплив сонячних панелей на енергію будівлі",EffectOfGroundTemperatureOnBuildingEnergy:"Вплив температури грунту на енергію будівлі",EffectOfTreesOnBuildingEnergy:"Вплив дерев на енергію будівлі"},buildingDesignSubMenu:"Дизайн будівлі",buildingDesignTutorials:{CapeCodStyleHouseWithShedDormer:'Будинок у стилі Кейп Код з пристроєм типу "шед-дормер"',MansardRoofWithDormers:"Мансарда з горизонтальними пристроями",GableRoofVsHipRoof:"Схиловий дах проти двосхилих дахів",ColonialVsSaltbox:"Колоніальний стиль проти стилю Saltbox",GambrelRoofVsMansardRoof:"Півшаровий дах проти мансардного даху",CombinationRoofVsBonnetRoof:"Комбінований дах проти капотного даху",DutchGableRoof:"Голландський дах з рикетом",GableAndValleyRoof:"Схиловий та долинний дах",ClerestoryRoof:"Клересторний дах",MonitorRoof:"Моніторний дах",AFrameHouse:'Будинок у формі літери "А"',HalfTimberedHouse:"Будинок з напівдерев'яними стінами",AllBasicRoofTypes:"Усі основні типи дахів"},photovoltaicSolarPowerSubMenu:"Фотоелектрична сонячна енергія",photovoltaicSolarPowerTutorials:{EffectOfTiltAngleOfSolarPanel:"Вплив кута нахилу сонячної панелі",EffectOfAzimuthOfSolarPanel:"Вплив азимуту сонячної панелі",SolarPanelTypes:"Типи сонячних панелей",VerticalBifacialSolarPanels:"Vertical Bifacial Solar Panels",CompareMonofacialAndBifacialSolarPanels:"Monofacial vs. Bifacial Solar Panels",SolarTrackers:"Сонячні трекери",CoveringGroundWithSolarPanels:"Чому просто покриття землі сонячними панелями - не найкраща ідея",InterRowSpacingOfSolarPanelArray:"Вплив міжрядного простору в масиві сонячних панелей",EffectOfOrientationOfSolarPanels:"Вплив орієнтації сонячних панелей",SolarPanelArrayAutomaticLayout:"Автоматичне розміщення масиву сонячних панелей"},concentratedSolarPowerSubMenu:"Концентрована сонячна енергія",concentratedSolarPowerTutorials:{EffectOfAzimuthOfParabolicTrough:"Вплив азимуту параболічного сонячного колектора",EffectOfLatusRectumOfParabolicTrough:"Вплив прямої лінії на параболічний сонячний колектор",FocusSunlightWithParabolicDish:"Фокусування сонячного світла за допомогою параболічного диску",LinearFresnelReflectors:"Лінійні відбивачі Френеля",EffectOfAbsorberPipeHeightForLinearFresnelReflectors:"Вплив висоти поглинаючої трубки на лінійні відбивачі Френеля",EffectOfAzimuthOfLinearFresnelReflectors:"Вплив азимуту на лінійні відбивачі Френеля",LinearFresnelReflectorsWithTwoAbsorbers:"Лінійні відбивачі Френеля з двома поглинаючими елементами",CosineEfficiencyOfHeliostats:"Косинусна ефективність геліостатів",ShadowingAndBlockingOfHeliostats:"Затінення та блокування геліостатів",EffectSolarPowerTowerHeight:"Вплив висоти сонячної вежі з використаним повітрям",SolarPowerTower:"Сонячна вежа з використаним повітрям"},otherTypesOfSolarPowerSubMenu:"Інші типи сонячної енергії",otherTypesOfSolarPowerTutorials:{SolarUpdraftTower:"Сонячна вежа з використаним повітрям"},windPowerSubMenu:"Wind Power",windPowerTutorials:{EffectOfBladeNumberOfWindTurbine:"Effect of Blade Number of Wind Turbine",EffectOfPitchAngleOfWindTurbineBlades:"Effect of Pitch Angle of Wind Turbine Blades",BirdSafeBladeDesign:"Bird-Safe Blade Design",OffshoreWindFarm:"Offshore Wind Farm"},colocationSubMenu:"Colocation",colocationTutorials:{AgricultureSolarWindColocation:"Agriculture-Solar-Wind Colocation"},generativeDesignSubMenu:"Generative Design",generativeDesignTutorials:{MonofacialSolarPanelArrayTiltAngle:"The Tilt Angle of a Monofacial Solar Panel Array",BifacialSolarPanelArrayTiltAngle:"The Tilt Angle of a Bifacial Solar Panel Array",OutputOfSolarPanelArrayInDifferentPlaces:"The Output of a Solar Panel Array in Different Places",SimpleSolarFarmParetoFront:"The Pareto Front for Designing a Simple Solar Farm"},examplesSubMenu:"Приклади",solarEnergySubMenu:"Сонячна енергія",solarEnergyExamples:{SunBeamAndHeliodon:"Промінь сонця та геліодон",RooftopSolarPanels:"Сонячні панелі на даху",NevadaSolarOneParabolicTroughArray:"Масив параболічних сонячних колекторів Nevada Solar One",TooeleParabolicDishArray:"Масив параболічних тарілок Tooele",PS10SolarPowerTower:"Сонячна енергетична вежа PS10",TucsonLinearFresnelReflectors:"Лінійні відбивачі Френеля в Tucson",SolarCanopyFormFactors:"Форми сонячних козирків",SolarCanopyOverBleachers:"Сонячний козирок над трибунами",SolarCanopyOverGarage:"Сонячний козирок над гаражем",SolarBusStop:"Сонячна автобусна зупинка",SolarFacadeTesla:"Сонячна фасадна панель Tesla",BuildingIntegratedPhotovoltaics:"Вбудовані фотоелектричні системи в будівлі",Floatovoltaics:"Сонячні панелі на плавучих платформах",Agrivoltaics:"Агровольтаїка",VegetativeBuffer:"Вегетативна зона",RainbowSwashSolarFarmBostonMA:"Сонячна ферма Rainbow Swash в Boston, MA",MickeyMouseSolarFarmOrlandoFL:"Сонячна ферма Міккі Мауса в Orlando, FL",SolarPanelsOverCanalBakersfieldCA:"Сонячні панелі над каналом в Bakersfield, CA",SolarNoiseBarrierLexingtonMA:"Сонячний шумовий бар'єр в Lexington, MA",HSATSolarTrackersRaleighNC:"Сонячні трекери з горизонтальною віссю в Raleign, NC",AADATSolarTrackersLancasterCA:"Сонячні трекери з азимутальною-вертикальною віссю в Lancaster, CA",SolarUpdraftTowerInCity:"Сонячна вежа з використаним повітрям у місті"},builtEnvironmentSubMenu:"Забудоване середовище",residentialBuildingsSubMenu:"Житлові будівлі",residentialBuildingExamples:{ColonialHouse:"Колоніальний будинок",DutchColonialHouse:"Голландський колоніальний будинок",TShapedHouse:"Будинок у формі літери Т",CapeCodHouseWithGarage:"Будинок у стилі Cape Cod з гаражем",Solarium:"Солярій",Church1:"Церква 1",Cathedral1:"Собор 1",Cathedral2:"Собор 2",Mosque1:"Мечеть 1",AdobeTaosHouse:"Будинок з адобе в стилі Taos",RanchHouse:"Ranch House",BonnetHouse:"Будинок в стилі Bonnet",BarnStyleHouse:"Будинок у стилі амбара",ModernHouse:"Сучасний будинок",ButterflyRoofHouse:"Будинок з метеликовим дахом"},commercialBuildingsSubMenu:"Комерційні будівлі",commercialBuildingExamples:{WhiteHouse:"Білий Дім",HaroldWashingtonCollege:"Harold Washington College",BilimMersinTurkiye:"Bilim, Mersin, Туреччина",SpanishStyleHotel:"Готель в іспанському стилі",ApartmentBuilding:"Багатоквартирний будинок",OfficeBuilding:"Офісна будівля",Hotel:"Готель"},buildingComplexesSubMenu:"Будівельні комплекси",buildingComplexExamples:{SouthBurlingtonHighSchoolVermont:"South Burlington High School, Vermont",MescaleroApacheSchoolNewMexico:"Mescalero Apache School, New Mexico"},urbanPlanningSubMenu:"Міське планування",urbanPlanningExamples:{CityBlockHeatmap:"City Block Heatmap",ChicagoSkyline:"Chicago Skyline"},otherBuildingsSubMenu:"Інші будівлі",otherBuildingExamples:{Greenhouse:"Теплиця",Pavilion:"Павільйон у парку",OctagonalPagoda:"Восьмикутна пагода",OceanFront:"Будівля біля океану",EgyptianPyramids:"Єгипетські піраміди",MayanPyramid:"Піраміда Мая",SiOSePol:"Si-O-Se-Pol",StackedCuboids:"Стековані кубоїди"},artificialIntelligenceSubMenu:"Штучний інтелект",artificialIntelligenceExamples:{OptimizingTiltAngleOfOneSolarPanelRow:"Оптимізація кута нахилу одного ряду сонячних панелей",OptimizingTiltAnglesOfMultipleSolarPanelRows:"Оптимізація кутів нахилу декількох рядів сонячних панелей",SolarFarmGenerativeDesign:"Генеративний дизайн сонячної ферми",SolarFarmGenerativeDesignWithBlock:"Генеративний дизайн сонячної ферми в присутності перешкоди",FitchburgSolarFarmGenerativeDesign:"Генеративний дизайн сонячної ферми у Fitchburg"},languageSubMenu:"Мова",publicSubMenu:"Загальнодоступно",ModelsGallery:"Галерея моделей",ModelsMap:"Карта моделей",AboutUs:"Про нас"},avatarMenu:{AccountSettings:"Налаштування облікового запису",PrivacyStatementTitle:"User Privacy Protection Statement",PrivacyStatement:"Коли ви увійдете, ваш Google ID використовується для створення та доступу до вашого облікового запису Aladdin. В нашій базі даних зберігається лише випадковий алфавітно-цифровий рядок як посилання. Ми ніколи не збираємо особисто ідентифіковану інформацію, таку як ваше ім'я або електронна пошта. Для отримання додаткової інформації ознайомтесь з нашою ",SignIn:"Увійти",SignOut:"Вийти",IfYouAreAStudent:"Якщо ви студент"},skyMenu:{Axes:"Вісі",Theme:"Тематика",ThemeDefault:"За замовчуванням",ThemeDesert:"Пустеля",ThemeDune:"Дюна",ThemeForest:"Ліс",ThemeGrassland:"Степ",ThemeHill:"Пагорб",ThemeLake:"Озеро",ThemeMountain:"Гора",ThemeRural:"Сільська місцевість",SunlightAttenuationCoefficientInAir:"Коефіцієнт затухання сонячного світла у повітрі",ConvectiveCoefficientOfAir:"Коефіцієнт конвекції повітря",HighestTemperatureTimeInMinutes:"Час найвищої температури (хвилини)",SelectSunAnglesToShow:"Виберіть кути сонця, які показати",ShowAzimuthAngle:"Показати азимутний кут",ShowElevationAngle:"Показати висотний кут",ShowZenithAngle:"Показати зенітний кут",DirectLightBrightnessAtNoon:"Direct Light Brightness at Noon",AmbientLightBrightnessAtNoon:"Ambient Light Brightness at Noon"},groundMenu:{MonthlyIrradianceLoss:"Monthly Irradiance Loss",Vegetation:"Рослинність",LeafOutDay:"День розпускання листя",LeafOffDay:"День опадання листя",Albedo:"Альбедо",ImageOnGround:"Зображення на поверхні",WaterSurface:"Поверхня води",RemoveAllUnlockedTrees:"Видалити всі розблоковані дерева",RemoveAllUnlockedFlowers:"Видалити всі розблоковані квіти",RemoveAllUnlockedSolarPanels:"Remove All Unlocked Solar Panels",RemoveAllUnlockedPeople:"Видалити всіх розблокованих людей",RemoveAllUnlockedFoundations:"Видалити всі розблоковані фундаменти",RemoveAllUnlockedCuboids:"Видалити всі розблоковані кубоїди",DoYouReallyWantToRemoveAllPeople:"Ви дійсно хочете видалити всіх людей, що не заблоковані",DoYouReallyWantToRemoveAllTrees:"Ви дійсно хочете видалити всі дерева, що не заблоковані",DoYouReallyWantToRemoveAllFlowers:"Ви дійсно хочете видалити всі квіти, що не заблоковані",DoYouReallyWantToRemoveAllSolarPanels:"Do you really want to remove all the solar panels that are not locked",DoYouReallyWantToRemoveAllFoundations:"Ви дійсно хочете видалити всі фундаменти, що не заблоковані",DoYouReallyWantToRemoveAllCuboids:"Ви дійсно хочете видалити всі кубоїди, що не заблоковані",LockAllUnlockedElements:"Lock All Unlocked Elements",UnlockAllLockedElements:"Unlock All Locked Elements"},labelSubMenu:{Label:"Мітка",LabelText:"Текст мітки",LabelHeight:"Висота мітки",LabelSize:"Розмір мітки",LabelFontSize:"Розмір шрифту",LabelColor:"Колір мітки",KeepShowingLabel:"Залишати видимою мітку"},foundationMenu:{RemoveAllUnlockedSolarPanels:"Видалити всі незаблоковані сонячні панелі",RemoveAllUnlockedParabolicTroughs:"Видалити всі незаблоковані параболічні сонячні колектори",RemoveAllUnlockedParabolicDishes:"Видалити всі незаблоковані параболічні антени",RemoveAllUnlockedFresnelReflectors:"Видалити всі незаблоковані відбивачі Френеля",RemoveAllUnlockedHeliostats:"Видалити всі незаблоковані геліостати",RemoveAllUnlockedWindTurbines:"Remove All Unlocked Wind Turbines",RemoveAllUnlockedSensors:"Видалити всі незаблоковані датчики",RemoveAllUnlockedLights:"Видалити всі незаблоковані освітлювальні прилади",RemoveAllUnlockedWalls:"Видалити всі незаблоковані стіни",RemoveAllUnlockedWindows:"Видалити всі незаблоковані вікна",RemoveAllUnlockedDoors:"Видалити всі незаблоковані двері",RemoveAllUnlockedPolygons:"Видалити всі незаблоковані полігони",RemoveAllUnlockedHumans:"Видалити всіх незаблокованих людей",RemoveAllUnlockedTrees:"Видалити всі незаблоковані дерева",RemoveAllUnlockedFlowers:"Видалити всі незаблоковані квіти",Racks:"Стелажі",Texture01:"Текстура 1",Texture02:"Текстура 2",Texture03:"Текстура 3",Texture04:"Текстура 4",Texture05:"Текстура 5",Texture06:"Текстура 6",Texture07:"Текстура 7",Texture08:"Текстура 8",Texture09:"Текстура 9",Texture10:"Текстура 10",SolarPanels:"Сонячні панелі",SolarPanelArray:"Solar Panel Array",DoYouReallyWantToRemoveAllSolarPanelsOnFoundation:"Ви дійсно бажаєте видалити всі сонячні панелі на цьому фундаменті, які не є заблокованими",ParabolicTroughs:"Параболічні сонячні колектори",DoYouReallyWantToRemoveAllParabolicTroughsOnFoundation:"Ви дійсно бажаєте видалити всі параболічні сонячні колектори на цьому фундаменті, які не є заблокованими",ParabolicDishes:"Параболічні антени",DoYouReallyWantToRemoveAllParabolicDishesOnFoundation:"Ви дійсно бажаєте видалити всі параболічні антени на цьому фундаменті, які не є заблокованими",FresnelReflectors:"Відбивачі Френеля",DoYouReallyWantToRemoveAllFresnelReflectorsOnFoundation:"Ви дійсно бажаєте видалити всі відбивачі Френеля на цьому фундаменті, які не є заблокованими",Heliostats:"Геліостати",DoYouReallyWantToRemoveAllHeliostatsOnFoundation:"Ви дійсно бажаєте видалити всі геліостати на цьому фундаменті, які не є заблокованими",WindTurbines:"Wind Turbines",DoYouReallyWantToRemoveAllWindTurbinesOnFoundation:"Do you really want to remove all the wind turbines on this foundation that are not locked",Sensors:"Датчики",DoYouReallyWantToRemoveAllSensorsOnFoundation:"Ви дійсно бажаєте видалити всі датчики на цьому фундаменті, які не є заблокованими",Lights:"Світильники",DoYouReallyWantToRemoveAllLightsOnFoundation:"Ви дійсно бажаєте видалити всі світильники на цьому фундаменті, які не є заблокованими",Walls:"Стіни",DoYouReallyWantToRemoveAllWallsOnFoundation:"Ви дійсно бажаєте видалити всі стіни на цьому фундаменті, які не є заблокованими",Windows:"Вікна",DoYouReallyWantToRemoveAllWindowsOnFoundation:"Ви дійсно бажаєте видалити всі вікна на цьому фундаменті, які не є заблокованими",Doors:"Двері",DoYouReallyWantToRemoveAllDoorsOnFoundation:"Ви дійсно бажаєте видалити всі двері на цьому фундаменті, які не є заблокованими",Polygons:"Багатокутники",DoYouReallyWantToRemoveAllPolygonsOnFoundation:"Ви дійсно бажаєте видалити всі багатокутники на цьому фундаменті, які не є заблокованими",Humans:"Люди",DoYouReallyWantToRemoveAllHumansOnFoundation:"Ви дійсно бажаєте видалити всіх людей на цьому фундаменті, які не є заблокованими",Trees:"Дерева",DoYouReallyWantToRemoveAllTreesOnFoundation:"Ви дійсно бажаєте видалити всі дерева на цьому фундаменті, які не є заблокованими",Flowers:"Квіти",DoYouReallyWantToRemoveAllFlowersOnFoundation:"Ви дійсно бажаєте видалити всі квіти на цьому фундаменті, які не є заблокованими",OnlyThisFoundation:"Тільки цей фундамент",AllConnectedFoundations:"Всі пов’язані фундаменти",AllSelectedFoundations:"All Selected Foundations",AllFoundations:"Всі фундаменти",AddPolygon:"Додати багатокутник",SolarStructure:"Вибрати сонячну структуру",GroupMaster:"Груповий майстер",LockAllUnlockedElementsOnThisFoundation:"Lock All Unlocked Elements on This Foundation",UnlockAllLockedElementsOnThisFoundation:"Unlock All Locked Elements on This Foundation",GroundFloorRValue:"Теплопровідність перекриття цокольного поверху",OnlyThisGroundFloor:"Тільки цокольний поверх",AllGroundFloors:"Всі цокольні поверхи"},solarPowerTowerMenu:{ReceiverTowerForHeliostats:"Вежа приймача для геліостатів",ReceiverTowerPhysicalProperties:"Фізичні властивості вежі приймача",ReceiverTowerHeight:"Висота вежі приймача",ReceiverTowerRadius:"Радіус вежі приймача",ReceiverAbsorptance:"Поглинання приймача",ReceiverOpticalEfficiency:"Оптична ефективність приймача",ReceiverThermalEfficiency:"Теплова ефективність приймача"},solarAbsorberPipeMenu:{AbsorberPipeForFresnelReflectors:"Трубопровід для відбивачів Френеля",AbsorberPipePhysicalProperties:"Фізичні властивості трубопроводу поглинання",AbsorberHeight:"Висота трубопроводу поглинання",AbsorberApertureWidth:"Ширина отвору трубопроводу поглинання",AbsorberPipePoleNumber:"Кількість полюсів для трубопроводу поглинання",AbsorberAbsorptance:"Сила поглинання",AbsorberOpticalEfficiency:"Оптична ефективність поглинача",AbsorberThermalEfficiency:"Теплова ефективність поглинача"},solarUpdraftTowerMenu:{SolarUpdraftTower:"Сонячна вежа з тяговим потоком",SolarUpdraftTowerPhysicalProperties:"Фізичні властивості сонячної вежі з тяговим потоком",SolarUpdraftTowerChimneyHeight:"Висота димової труби сонячної вежі з тяговим потоком",SolarUpdraftTowerChimneyRadius:"Радіус димової труби сонячної вежі з тяговим потоком",SolarUpdraftTowerCollectorHeight:"Висота колектора сонячної вежі з тяговим потоком",SolarUpdraftTowerCollectorRadius:"Радіус колектора сонячної вежі з тяговим потоком",SolarUpdraftTowerCollectorTransmissivity:"Проникність колектора сонячної вежі з тяговим потоком",SolarUpdraftTowerCollectorEmissivity:"Випромінюваність колектора сонячної вежі з тяговим потоком",SolarUpdraftTowerDischargeCoefficient:"Коефіцієнт викиду сонячної вежі з тяговим потоком",SolarUpdraftTowerTurbineEfficiency:"Ефективність турбіни сонячної вежі з тяговим потоком"},cuboidMenu:{Texture01:"Текстура 1",Texture02:"Текстура 2",Texture03:"Текстура 3",Texture04:"Текстура 4",Texture05:"Текстура 5",Texture06:"Текстура 6",Texture07:"Текстура 7",Texture08:"Текстура 8",Texture09:"Текстура 9",Texture10:"Текстура 10",RemoveAllUnlockedSolarPanels:"Видалити всі розблоковані сонячні панелі",RemoveAllUnlockedSensors:"Видалити всі розблоковані сенсори",RemoveAllUnlockedPolygons:"Видалити всі розблоковані полігони",RemoveAllUnlockedHumans:"Видалити всіх розблокованих людей",RemoveAllUnlockedTrees:"Видалити всі розблоковані дерева",RemoveAllUnlockedFlowers:"Видалити всі розблоковані квіти",RemoveAllUnlockedLights:"Remove All Unlocked Lights",Racks:"Стійки",Lights:"Lights",DoYouReallyWantToRemoveAllLightsOnCuboid:"Do you really want to remove all the lights on this cuboid that are not locked",SolarPanels:"Сонячні панелі",DoYouReallyWantToRemoveAllSolarPanelsOnCuboid:"Ви дійсно бажаєте видалити всі сонячні панелі на цьому кубоїді, які не заблоковані",Sensors:"Сенсори",DoYouReallyWantToRemoveAllSensorsOnCuboid:"Ви дійсно бажаєте видалити всі сенсори на цьому кубоїді, які не заблоковані",Polygons:"Полігони",DoYouReallyWantToRemoveAllPolygonsOnCuboid:"Ви дійсно бажаєте видалити всі полігони на цьому кубоїді, які не заблоковані",Humans:"Люди",DoYouReallyWantToRemoveAllHumansOnCuboid:"Ви дійсно бажаєте видалити всіх людей на цьому кубоїді, які не заблоковані",Trees:"Дерева",DoYouReallyWantToRemoveAllTreesOnCuboid:"Ви дійсно бажаєте видалити всі дерева на цьому кубоїді, які не заблоковані",Flowers:"Квіти",DoYouReallyWantToRemoveAllFlowersOnCuboid:"Ви дійсно бажаєте видалити всі квіти на цьому кубоїді, які не заблоковані",OnlyThisCuboid:"Тільки цей кубоїд",AllCuboidsOnSameSurface:"Усі кубоїди на одній поверхні",AllCuboidsAboveSameBase:"Усі кубоїди над тією ж основою",AllSelectedCuboids:"All Selected Cuboids",AllCuboids:"Всі кубоїди",OnlyThisSide:"Тільки ця сторона",AllSidesOfThisCuboid:"Всі сторони цього кубоїда",AllSidesOfSelectedCuboids:"All Sides of Selected Cuboids",AllSidesOfAllCuboids:"Всі сторони всіх кубоїдів",AddPolygon:"Додати полігон",Stackable:"Стекабельне",GroupMaster:"Майстер групи"},polygonMenu:{Texture01:"Текстура 1",Texture02:"Текстура 2",Texture03:"Текстура 3",Texture04:"Текстура 4",Texture05:"Текстура 5",Texture06:"Текстура 6",Texture07:"Текстура 7",Texture08:"Текстура 8",Texture09:"Текстура 9",Texture10:"Текстура 10",TextBox:"Текстове поле",FontOutlineColor:"Колір контуру шрифту",FontOutlineWidth:"Товщина контуру шрифту",FontStrokeColor:"Колір обводки шрифту",FontStrokeWidth:"Товщина обводки шрифту",NoOutline:"Без контуру",Shiny:"Блискучий",Filled:"Заповнений",FillTexture:"Текстура заповнення",FillColor:"Колір заповнення",Opacity:"Прозорість",LineColor:"Колір лінії",LineWidth:"Товщина лінії",LineStyle:"Стиль лінії",SolidLine:"Суцільна лінія",DashedLine:"Пунктирна лінія",DottedLine:"Точкова лінія",InsertVertexBeforeIndex:"Вставити вершину перед індексом",InsertVertexAfterIndex:"Вставити вершину після індексу",DeleteVertex:"Видалити вершину",OnlyThisPolygon:"Тільки цей полігон",AllPolygonsOnSurface:"Всі полігони на цій поверхні",AllPolygonsAboveFoundation:"Всі полігони вище фундаменту",AllSelectedPolygons:"All Selected Polygons",AllPolygons:"Всі полігони",Layout:"Розташування",SolarPanelArrayLayout:"Розташування сонячних панелей",SolarPanelArrayLayoutParametricDesign:"Розташування сонячних панелей: параметричний дизайн",SolarPanelArrayLayoutGenerativeDesign:"Розташування сонячних панелей: генеративний дизайн",SolarPanelArrayModel:"Модель сонячної панелі",SolarPanelArrayOrientation:"Орієнтація",SolarPanelArrayTiltAngle:"Кут нахилу",SolarPanelArrayRowWidth:"Ширина ряду",SolarPanelArrayInterRowSpacing:"Міжрядковий інтервал",SolarPanelArrayRowSpacing:"Row Spacing",SolarPanelArrayRowAxis:"Вісь ряду",SolarPanelArrayLeftRightRowAxis:"Наліво-Направо (відносне)",SolarPanelArrayUpDownRowAxis:"Вгору-Вниз (відносне)",SolarPanelArrayEastWestRowAxis:"Схід-Захід (абсолютне)",SolarPanelArrayNorthSouthRowAxis:"Північ-Південь (абсолютне)",SolarPanelArrayMargin:"Відступ",SolarPanelArrayPoleHeight:"Висота стовпа",SolarPanelArrayPoleSpacing:"Інтервал між стовпами",SolarPanelArrayTotalYearlyCost:"Total Cost",SolarPanelArrayTotalYearlyRevenue:"Total Revenue",SolarPanelArrayTotalYearlyYield:"Total Yield",SolarPanelArrayMeanYearlyYield:"Mean Yield",SolarPanelArrayYearlyProfit:"Profit",LayoutNotAcceptedCheckYourParameters:"Це розташування не приймається. Будь ласка, перевірте ваші параметри."},optimizationMenu:{Optimization:"Оптимізація",Parameters:"Параметри",Variables:"Змінні",Constants:"Константи",GeneticAlgorithm:"Генетичний алгоритм",GeneticAlgorithmSettings:"Налаштування генетичного алгоритму",ParticleSwarmOptimization:"Оптимізація роєм частинок",ParticleSwarmOptimizationSettings:"Налаштування оптимізації роєм частинок",SolarPanelTiltAngleOptimization:"Оптимізація кута нахилу сонячних панелей",SolarPanelArrayLayout:"Розташування сонячних панелей",Generation:"Покоління",Gene:"Ген",NormalizedVariables:"Нормалізовані змінні",Objective:"Ціль",ObjectiveFunctionDailyTotalYield:"Щоденний загальний дохід",ObjectiveFunctionYearlyTotalYield:"Щорічний загальний дохід",ObjectiveFunctionDailyMeanYield:"Щоденний середній дохід",ObjectiveFunctionYearlyMeanYield:"Щорічний середній дохід",ObjectiveFunctionDailyProfit:"Щоденний прибуток",ObjectiveFunctionYearlyProfit:"Щорічний прибуток",GeneticAlgorithmSelectionMethod:"Метод вибору для генетичного алгоритму",RouletteWheel:"Велосипедне колесо",Tournament:"Турнір",SearchMethod:"Метод пошуку",GlobalSearchUniformSelection:"Глобальний пошук з однорідним вибором",LocalSearchRandomOptimization:"Локальний пошук випадкової оптимізації",PopulationSize:"Розмір населення",MaximumGenerations:"Максимальна кількість поколінь",SelectionRate:"Швидкість відбору",CrossoverRate:"Швидкість схрещування",MutationRate:"Швидкість мутації",Step:"Крок",SwarmSize:"Розмір рою",MaximumSteps:"Максимальна кількість кроків",MaximumVelocity:"Максимальна швидкість",InertiaWeight:"Вага інерції",CognitiveCoefficient:"Коефіцієнт когнітивної функції",SocialCoefficient:"Коефіцієнт соціальної взаємодії",ConvergenceThreshold:"Поріг збіжності для завершення",LocalSearchRadius:"Радіус локального пошуку",RowsPerRackRange:"Діапазон для рядів на стелаж",TiltAngleRange:"Діапазон для кута нахилу",InterRowSpacingRange:"Діапазон для міжрядкового проміжку",ClickTargetPolygonToActivate:"Натисніть на цільовий полігон для активації",ClickTargetFoundationToActivate:"Натисніть на цільовий фундамент для активації"},treeMenu:{ShowModel:"Показати модель",Flip:"Перевернути",Type:"Тип",Spread:"Розповсюдження"},flowerMenu:{Flip:"Перевернути",Type:"Тип",Spread:"Розповсюдження"},peopleMenu:{ChangePerson:"Змінити особу",Flip:"Перевернути",Observer:"Спостерігач",ViewFromThisPerson:"Переглянути з цієї особи"},lightMenu:{Color:"Колір",Intensity:"Інтенсивність",Decay:"Затухання",MaximumDistance:"Максимальна відстань",Inside:"Усередині"},solarCollectorMenu:{Coordinates:"Coordinates",RelativeXCoordinateOfCenter:"Relative X Coordinate of Center",RelativeYCoordinateOfCenter:"Relative Y Coordinate of Center",RelativeAzimuth:"Відносний азимут",Pole:"Стовп",PoleHeight:"Висота стовпа",PoleRadius:"Pole Radius",ExtraPoleHeight:"Додаткова висота стовпа",ExtraPoleHeightInAdditionToHalfWidth:"Додаткова висота стовпа на додаток до половини ширини",DrawSunBeam:"Намалювати промінь сонця"},concentratedSolarPowerCollectorMenu:{ReflectorReflectance:"Відбивання відбивача",ReceiverAbsorptance:"Поглинання приймача",ReflectorOpticalEfficiency:"Оптична ефективність відбивача",ReceiverThermalEfficiency:"Теплова ефективність приймача"},waterHeaterMenu:{OnlyThisWaterHeater:"Only This Water Heater",AllWaterHeatersOnSurface:"All Water Heaters on the Same Surface",AllWaterHeatersAboveFoundation:"All Water Heaters Above the Same Foundation",AllSelectedWaterHeaters:"All Selected Water Heaters",AllWaterHeaters:"All Water Heaters"},solarPanelMenu:{ElectricalProperties:"Electrical Properties",InverterEfficiency:"Inverter Efficiency",InverterEfficiencyExplained:"The efficiency for converting direct current (DC) to alternating current (AC).",DcToAcSizeRatio:"DC-to-AC Size Ratio",DcToAcSizeRatioExplained:"The ratio of the solar panels' DC-rated size to the inverter's AC-rated size.",ChangePvModel:"Змінити модель",Orientation:"Орієнтація",Portrait:"Вертикальна",Landscape:"Горизонтальна",FrameColor:"Колір рамки",Panels:"панелі",PanelsWide:"панелі по ширині",PanelsLong:"панелі по довжині",TiltAngle:"Кут нахилу",SouthFacingIsPositive:"Південь вважається позитивним",Tracker:"Трекер",SolarTrackerFollowsSun:"Трекер слідкує за сонцем для збільшення виходу сонячних панелей.",PoleSpacing:"Відстань між стовпами",NoTracker:"Без трекера",HorizontalSingleAxisTracker:"Трекер з горизонтальною одноосевою орієнтацією",VerticalSingleAxisTracker:"Трекер з вертикальною одноосевою орієнтацією",AltazimuthDualAxisTracker:"Трекер з азимутально-альтазимутальною двоосевою орієнтацією",OnlyThisSolarPanel:"Тільки ця сонячна панель",AllSolarPanelsOnSurface:"Всі сонячні панелі на одній поверхні",AllSolarPanelsAboveFoundation:"Всі сонячні панелі над однією фундаментом",AllSelectedSolarPanels:"All Selected Solar Panels",AllSolarPanels:"Всі сонячні панелі"},pvModelPanel:{SolarPanelSpecs:"Технічні характеристики сонячної панелі",Model:"Модель",PanelSize:"Розмір панелі",Cells:"Комірки",CellType:"Тип комірок",Monocrystalline:"Монокристалічні",Polycrystalline:"Полікристалічні",ThinFilm:"Тонкоплівкові",Bifacial:"Bifacial",BifacialityFactor:"Bifaciality Factor",Black:"Чорний",Blue:"Синій",ShadeTolerance:"Стійкість до затінення",SolarCellEfficiency:"Ефективність сонячної комірки",NominalOperatingCellTemperature:"Номінальна робоча температура комірки",TemperatureCoefficientOfPmax:"Температурний коефіцієнт Pmax"},parabolicTroughMenu:{ModuleLength:"Довжина модуля",Modules:"модулі",ModulesLong:"модулів у довжину",LatusRectum:"Велика піввісь",OnlyThisParabolicTrough:"Тільки цей параболічний сонячний колектор",AllParabolicTroughsAboveFoundation:"Усі параболічні сонячні колектори над цим фундаментом",AllSelectedParabolicTroughs:"All Selected Parabolic Troughs",AllParabolicTroughs:"Усі параболічні сонячні колектори"},fresnelReflectorMenu:{AbsorberPipe:"Труба поглинання",SelectAbsorberToReflectSunlightTo:"Виберіть поглинач, до якого буде відбиватися сонячне світло",ModuleLength:"Довжина модуля",Modules:"модулі",ModulesLong:"модулів у довжину",OnlyThisFresnelReflector:"Тільки цей відбивач Френеля",AllFresnelReflectorsAboveFoundation:"Усі відбивачі Френеля над цим фундаментом",AllSelectedFresnelReflectors:"All Selected Fresnel Reflectors",AllFresnelReflectors:"Усі відбивачі Френеля"},heliostatMenu:{Tower:"Вежа",SelectTowerToReflectSunlightTo:"Виберіть вежу, до якої буде відбиватися сонячне світло",OnlyThisHeliostat:"Тільки цей геліостат",AllHeliostatsAboveFoundation:"Усі геліостати над цим фундаментом",AllSelectedHeliostats:"All Selected Heliostats",AllHeliostats:"Усі геліостати"},parabolicDishMenu:{ReceiverStructure:"Структура приймача",CentralPole:"Центральний стовп",CentralPoleWithTripod:"Центральний стовп з триногою",Quadrupod:"Чотиринога",RimDiameter:"Діаметр ободу",LatusRectum:"Велика піввісь",ExtraPoleHeightInAdditionToRadius:"Додаткова висота стовпа плюс радіус",OnlyThisParabolicDish:"Тільки ця параболічна тарілка",AllParabolicDishesAboveFoundation:"Усі параболічні тарілки над цим фундаментом",AllSelectedParabolicDishes:"All Selected Parabolic Dishes",AllParabolicDishes:"Усі параболічні тарілки"},windTurbineMenu:{BirdSafeDesign:"Bird-Safe Design",BirdSafeNone:"None",BirdSafeBicolor:"Bicolor",BirdSafeStriped:"Striped",Rotor:"Rotor",BladeNumber:"Blade Number",RotorInitialAngle:"Rotor Initial Angle",RotorBladeDesign:"Rotor Blade Design",RotorBladeRadius:"Rotor Blade Radius",RotorBladePitchAngle:"Rotor Blade Pitch Angle",RelativeYawAngle:"Relative Yaw Angle",MaximumChordLength:"Maximum Chord Length",Tower:"Tower",TowerHeight:"Tower Height",TowerRadius:"Tower Radius",HubDesign:"Hub Design",HubRadius:"Hub Radius",HubLength:"Hub Length",OnlyThisWindTurbine:"Only This Wind Turbine",AllWindTurbinesAboveFoundation:"All Wind Turbines Above the Same Foundation",AllSelectedWindTurbines:"All Selected Wind Turbines",AllWindTurbines:"All Wind Turbines"},wallMenu:{TextureDefault:"Типова текстура",Texture01:"Текстура 1",Texture02:"Текстура 2",Texture03:"Текстура 3",Texture04:"Текстура 4",Texture05:"Текстура 5",Texture06:"Текстура 6",Texture07:"Текстура 7",Texture08:"Текстура 8",Texture09:"Текстура 9",Texture10:"Текстура 10",SizeOfWall:"Розмір стіни",OnlyThisWall:"Тільки ця стіна",AllConnectedWalls:"Всі пов'язані стіни",AllWallsAboveFoundation:"Всі стіни над цим фундаментом",AllSelectedWalls:"All Selected Walls",AllWalls:"Всі стіни",Windows:"Вікна",LockAllUnlockedWindows:"Lock All Unlocked Windows",UnlockAllLockedWindows:"Unlock All Locked Windows",RemoveAllUnlockedWindows:"Видалити всі розблоковані вікна",DoYouReallyWantToRemoveAllWindowsOnThisWall:"Ви дійсно бажаєте видалити всі вікна на цій стіні",Doors:"Двері",LockAllUnlockedDoors:"Lock All Unlocked Doors",UnlockAllLockedDoors:"Unlock All Locked Doors",RemoveAllUnlockedDoors:"Видалити всі розблоковані двері",DoYouReallyWantToRemoveAllDoorsOnThisWall:"Ви дійсно бажаєте видалити всі двері на цій стіні",SolarPanels:"Сонячні панелі",LockAllUnlockedSolarPanels:"Lock All Unlocked Solar Panels",UnlockAllLockedSolarPanels:"Unlock All Locked Solar Panels",RemoveAllUnlockedSolarPanels:"Видалити всі розблоковані сонячні панелі",DoYouReallyWantToRemoveAllSolarPanelsOnThisWall:"Ви дійсно бажаєте видалити всі сонячні панелі на цій стіні",Sensors:"Датчики",LockAllUnlockedSensors:"Lock All Unlocked Sensors",UnlockAllLockedSensors:"Unlock All Locked Sensors",RemoveAllUnlockedSensors:"Видалити всі розблоковані датчики",DoYouReallyWantToRemoveAllSensorsOnThisWall:"Ви дійсно бажаєте видалити всі датчики на цій стіні",Lights:"Лампи",LockAllUnlockedLights:"Lock All Unlocked Lights",UnlockAllLockedLights:"Unlock All Locked Lights",RemoveAllUnlockedLights:"Видалити всі розблоковані лампи",DoYouReallyWantToRemoveAllLightsOnThisWall:"Ви дійсно бажаєте видалити всі лампи на цій стіні",Polygons:"Polygons",LockAllUnlockedPolygons:"Lock All Unlocked Polygons",UnlockAllLockedPolygons:"Unlock All Locked Polygons",RemoveAllUnlockedPolygons:"Видалити всі розблоковані полігони",DoYouReallyWantToRemoveAllPolygonsOnThisWall:"Do you really want to remove all the polygons on this wall",WallStructure:"Структура стіни",DefaultStructure:"Типова",StudStructure:"Студ",PillarStructure:"Пілар",Opacity:"Непрозорість",StructureSpacing:"Відстань між структурами",StructureWidth:"Ширина структури",StructureThickness:"Товщина структури",StructureColor:"Колір структури",Color:"Колір стіни",Height:"Висота",Thickness:"Товщина",Texture:"Текстура",AllLightsOnWallInside:"Всі лампи всередині стіни",AllLightsOnWallOutside:"Всі лампи ззовні стіни",Fill:"Заповнення",Full:"Повне",Partial:"Часткове",Empty:"Порожнє",OpenToOutside:"Відкрите на зовнішню сторону",EavesLength:"Довжина карнизу",Parapet:"Перила",ParapetColor:"Колір перил",ParapetTexture:"Текстура перил",ParapetHeight:"Висота перил",CopingsHeight:"Висота паркану",CopingsWidth:"Ширина паркану"},windowMenu:{OnlyThisWindow:"Тільки це вікно",AllWindowsOnSurface:"All Windows on the Same Surface",AllWindowsAboveFoundation:"Всі вікна над однією фундаментом",AllSelectedWindows:"All Selected Windows",AllWindows:"Всі вікна",Width:"Ширина",Height:"Висота",Setback:"Setback from Exterior Surface",RelativeToWallThickness:"Relative to wall thickness",Mullion:"Розділовий стовпець",HorizontalMullion:"Horizontal Mullion",VerticalMullion:"Vertical Mullion",MullionWidth:"Ширина розділового стовпця",HorizontalMullionSpacing:"Horizontal Mullion Spacing",VerticalMullionSpacing:"Vertical Mullion Spacing",MullionColor:"Колір розділового стовпця",Tint:"Відтінок",Opacity:"Непрозорість",SolarHeatGainCoefficient:"Коефіцієнт сонячного теплового навантаження (SHGC) = 1 - непрозорість",Shutter:"Жалюзі",LeftShutter:"Ліве жалюзі",RightShutter:"Праве жалюзі",BothShutters:"Обидві жалюзі",ShutterWidth:"Відносна ширина",ShutterColor:"Колір жалюзі",Frame:"Рамка",FrameWidth:"Ширина рамки",SillWidth:"Ширина підвіконня",Color:"Колір рамки",WindowType:"Тип вікна",Default:"Типове",Arched:"Аркове",Polygonal:"Багатокутне",Interior:"Інтер'єр",Empty:"Порожнє"},roofMenu:{TextureDefault:"Типове",Texture01:"Текстура 1",Texture02:"Текстура 2",Texture03:"Текстура 3",Texture04:"Текстура 4",Texture05:"Текстура 5",Texture06:"Текстура 6",Texture07:"Текстура 7",OnlyThisRoof:"Тільки цей дах",AllRoofsAboveFoundation:"Всі дахи над одним фундаментом",AllSelectedRoofs:"All Selected Roofs",AllRoofs:"Всі дахи",OnlyThisCeiling:"Тільки ця стеля",AllCeilingsAboveFoundation:"Всі стелі над одним фундаментом",AllCeilings:"Всі стелі",EavesOverhangLength:"Довжина виступу карнизу",RafterSpacing:"Відстань між стропилами",RafterWidth:"Ширина стропила",RafterThickness:"Товщина стропила",RafterColor:"Колір стропила",RoofColor:"Колір даху",RoofSideColor:"Колір бокової частини даху",GlassTint:"Колір скла",Opacity:"Непрозорість",RoofStructure:"Структура даху",DefaultStructure:"Типова",RafterStructure:"Стропило",GlassStructure:"Скло",SolarPanels:"Сонячні панелі",LockAllUnlockedSolarPanels:"Lock All Unlocked Solar Panels",UnlockAllLockedSolarPanels:"Unlock All Locked Solar Panels",RemoveAllUnlockedSolarPanels:"Видалити всі розблоковані сонячні панелі",DoYouReallyWantToRemoveAllSolarPanelsOnThisRoof:"Ви дійсно бажаєте видалити всі сонячні панелі на цьому даху",Windows:"Вікна",LockAllUnlockedWindows:"Lock All Unlocked Windows",UnlockAllLockedWindows:"Unlock All Locked Windows",RemoveAllUnlockedWindows:"Видалити всі розблоковані вікна",DoYouReallyWantToRemoveAllWindowsOnThisRoof:"Ви дійсно бажаєте видалити всі вікна на цьому даху",Sensors:"Сенсори",LockAllUnlockedSensors:"Lock All Unlocked Sensors",UnlockAllLockedSensors:"Unlock All Locked Sensors",RemoveAllUnlockedSensors:"Видалити всі розблоковані сенсори",DoYouReallyWantToRemoveAllSensorsOnThisRoof:"Ви дійсно бажаєте видалити всі сенсори на цьому даху",Lights:"Лампи",RemoveAllUnlockedLights:"Видалити всі розблоковані лампи",DoYouReallyWantToRemoveAllLightsOnThisRoof:"Ви дійсно бажаєте видалити всі лампи на цьому даху",AllLightsOnRoofInside:"Всі лампи на даху всередині",AllLightsOnRoofOutside:"Всі лампи на даху ззовні",Rise:"Піднімання",Ceiling:"Стеля",RoofRValue:"Значення R для даху",CeilingRValue:"Значення R для стелі"},doorMenu:{TextureDefault:"За замовчуванням",Texture01:"Текстура 1",Texture02:"Текстура 2",Texture03:"Текстура 3",Texture04:"Текстура 4",Texture05:"Текстура 5",Texture06:"Текстура 6",Texture07:"Текстура 7",Texture08:"Текстура 8",Texture09:"Текстура 9",Texture10:"Текстура 10",Texture11:"Текстура 11",Texture12:"Текстура 12",Texture13:"Текстура 13",Texture14:"Текстура 14",Texture15:"Текстура 15",Texture16:"Текстура 16",Texture17:"Текстура 17",OnlyThisDoor:"Тільки ці двері",AllDoorsOnWall:"Всі двері на цій стіні",AllDoorsAboveFoundation:"Всі двері над тим самим фундаментом",AllSelectedDoors:"All Selected Doors",AllDoors:"Всі двері",DoorType:"Тип дверей",Default:"За замовчуванням",Arched:"Аркові",Filled:"Заповнені",FrameColor:"Колір рамки",Interior:"Інтер'єр"},siteInfoPanel:{High:"Високо",Low:"Низько"},designInfoPanel:{NumberOfSelectedHeliostats:"Кількість вибраних геліостатів",NumberOfSelectedSolarPanels:"Кількість вибраних сонячних панелей",ElectricityGeneratedDailyBySolarPanels:"Електрика, що генерується щоденно цими сонячними панелями",SceneDiameter:"Діаметр сцени",BuildingArea:"Площа будівлі"},visualizationControlPanel:{ColorContrast:"Контраст кольору",FluxScale:"Шкала потоку",ClickUpOrDownArrowButtonsToChange:"Натисніть кнопки зі стрілками вгору або вниз щоб змінити"},instructionPanel:{Rotate:"Повернути",DragMouse:"Перетягніть мишею",Zoom:"Масштабування",MouseWheelOrKeys:"Обертайте колесо миші або натисніть Ctrl+[ або Ctrl+]",MouseWheelOrKeysMac:"Обертайте колесо миші або натисніть ⌘+[ або ⌘+]",Pan:"Переміщення",HoldCtrlDragMouse:"Натисніть і утримуйте Ctrl, перетягніть мишею",HoldMetaDragMouse:"Натисніть і утримуйте ⌘, перетягніть мишею",Enter2DMode:"Ввійти в 2D режим",Exit2DMode:"Вийти з 2D режиму",NavigationMode:"Режим навігації",EnableNavigation:"Увімкнути навігацію",DisableNavigation:"Вимкнути навігацію",MoveForwardBack:"Рухатися вперед/назад",MoveForwardBackInstruction:"Натисніть W/S",MoveLeftRight:"Рухатися вліво/вправо",MoveLeftRightInstruction:"Натисніть A/D",MoveUpDown:"Рухатися вгору/вниз",MoveUpDownInstruction:"Натисніть Z/X",Turn:"Повернути",TurnInstruction:"Натисніть клавіші зі стрілками",ResetView:"Скинути",AutoRotate:"Автоматичний поворот",StartOrStop:"Натисніть F4, щоб почати або зупинити"},mapPanel:{ImageOnGround:"Зображення на землі",HideAddress:"Hide Address",WeatherStations:"Метеостанції",WeatherStationsNote:"Вимкніть це, щоб прискорити",Coordinates:"Координати",Zoom:"Масштабування"},visibilityPanel:{SolarPanelVisibility:"Видимість сонячних панелей",Observer:"Спостерігач",VantagePoint:"Точка огляду",ItemizedVisibilityByFields:"Розгорнутий за полями",TotalVisibility:"Загальна видимість"},sensorPanel:{LightSensor:"Датчик освітленості",WeatherDataFrom:"Метеодані з"},buildingEnergyPanel:{DailyBuildingEnergy:"Щоденна енергія будівлі",YearlyBuildingEnergy:"Річна енергія будівлі",Heater:"Обігрівач",AC:"Кондиціонер",SolarPanel:"Сонячна панель",Net:"Всього"},solarPanelYieldPanel:{SolarPanelDailyYield:"Щоденний дохід сонячних панелей",SolarPanelYearlyYield:"Річний дохід сонячних панелей",Yield:"Дохід",YieldPerHour:"Дохід за годину",DailyTotal:"Щоденний загальний",YearlyTotal:"Річний загальний",ShowOutputsOfIndividualSolarPanels:"Показати дохід окремих сонячних панелей",Profit:"Прибуток",TotalCost:"Total Cost",TotalRevenue:"Total Revenue",TotalYield:"Total Yield",MeanYield:"Mean Yield",ModuleCount:"Module Count"},parabolicTroughYieldPanel:{ParabolicTroughDailyYield:"Щоденний дохід параболічних сонячних колекторів",ParabolicTroughYearlyYield:"Річний дохід параболічних сонячних колекторів",Yield:"Дохід",YieldPerHour:"Дохід за годину",DailyTotal:"Щоденний загальний",YearlyTotal:"Річний загальний",ShowOutputsOfIndividualParabolicTroughs:"Показати дохід окремих параболічних сонячних колекторів"},parabolicDishYieldPanel:{ParabolicDishDailyYield:"Щоденний дохід параболічних тарілок",ParabolicDishYearlyYield:"Річний дохід параболічних тарілок",Yield:"Дохід",YieldPerHour:"Дохід за годину",DailyTotal:"Щоденний загальний",YearlyTotal:"Річний загальний",ShowOutputsOfIndividualParabolicDishes:"Показати дохід окремих параболічних тарілок"},fresnelReflectorYieldPanel:{FresnelReflectorDailyYield:"Щоденний дохід відбивача Френеля",FresnelReflectorYearlyYield:"Річний дохід відбивача Френеля",Yield:"Дохід",YieldPerHour:"Дохід за годину",DailyTotal:"Щоденний загальний",YearlyTotal:"Річний загальний",ShowOutputsOfIndividualFresnelReflectors:"Показати дохід окремих відбивачів Френеля"},heliostatYieldPanel:{HeliostatDailyYield:"Щоденний дохід геліостату",HeliostatYearlyYield:"Річний дохід геліостату",Yield:"Дохід",YieldPerHour:"Дохід за годину",DailyTotal:"Щоденний загальний",YearlyTotal:"Річний загальний",ShowOutputsOfIndividualHeliostats:"Показати дохід окремих геліостатів"},updraftTowerYieldPanel:{UpdraftTowerDailyYield:"Щоденний дохід сонячної вежі",UpdraftTowerYearlyYield:"Річний дохід сонячної вежі",ChimneyAirTemperature:"Температура повітря у димовій трубі",ChimneyWindSpeed:"Швидкість вітру у димовій трубі",Yield:"дохід",YieldPerHour:"Дохід за годину",DailyTotal:"Щоденний загальний",YearlyTotal:"Річний загальний",ShowOutputsOfIndividualUpdraftTowers:"Показати дохід окремих сонячних веж"},heliodonPanel:{SunAndTimeSettings:"Налаштування Сонця та Часу",SunAngles:"Кути Сонця",TwentyFourHours:"24 Години"},cloudFilePanel:{CopyTitle:"Copy Title",TitleCopiedToClipBoard:"The title was copied to the clip board",SearchByTitle:"Пошук за назвою",MyLikes:"Мої вподобання",MyCloudFiles:"Мої файли у хмарному середовищі",GenerateLink:"Створити посилання",LinkGeneratedInClipBoard:"Посилання було створено та скопійовано до буферу обміну",DoYouReallyWantToDelete:"Ви дійсно бажаєте видалити",IfSharedOrPublishedRenamingFileBreaksExistingLinks:"Якщо цей файл було відкрито або опубліковано, зміна його назви порушить наявні посилання"},projectListPanel:{CopyTitle:"Copy Title",TitleCopiedToClipBoard:"The title was copied to the clip board",SearchByTitle:"Пошук за назвою",MyProjects:"My Projects",GenerateProjectLink:"Generate Project Link",ProjectLinkGeneratedInClipBoard:"A link to the project was generated in the clip board",DoYouReallyWantToDeleteProject:"Do you really want to delete Project",IfSharedOrPublishedRenamingProjectBreaksExistingLinks:"If this project has been shared or published, renaming it breaks existing links"},projectPanel:{ProjectSettings:"Project Settings",ThumbnailImageSize:"Thumbnail Image Size",ProjectByOtherPeople:"Project by Other People",Project:"Project",ProjectType:"Тип проєкту",ProjectDescription:"Description",MakeDescriptionEditable:"Make this description editable",MakeDescriptionNonEditable:"Make this description non-editable",DoubleClickToMakeDescriptionEditable:"Double-click to make this description editable",SolarPanelArray:"Solar Panel Array",CurateCurrentDesign:"Curate current design",UpdateSelectedDesign:"Update selected design",RemoveSelectedDesign:"Remove selected design",ClickToFlipSortingOrder:"Click to flip the sorting order",DesignNotShownInSolutionSpaceClickToShow:"This design is not shown in solution space; click to show",DesignShownInSolutionSpaceClickToHide:"This design is shown in solution space; click to hide",SolutionSpace:"Solution Space",ChooseSolutionSpace:"Choose solution space",ChooseDataColoring:"Choose data coloring",SameColorForAllDesigns:"Same color for all designs",OneColorForEachDesign:"One color for each design",SolutionSpaceScreenshot:"Take a screenshot of the solution space",ScatterPlotScreenshot:"Take a screenshot of the scatter plot",SingleClickToSelectDoubleClickToOpen:"Single-click to select, double-click to open.",SingleClickToDeselectDoubleClickToOpen:"Single-click to deselect, double-click to open.",GenerateScatterPlot:"Generate Scatter Plot",SelectXAxis:"Select X Axis",SelectYAxis:"Select Y Axis"},accountSettingsPanel:{MyAccountSettings:"Мої налаштування облікового запису",MyID:"Моє 🆔",ClickToCopyMyID:"Натисніть, щоб скопіювати моє ID",IDInClipBoard:"Ваш ID було скопійоване і готове для вставки.",StoreMyNameInMyFilesWhenSaving:"Зберігати моє ім'я в моїх файлах при збереженні",DoYouReallyWantToShowYourNameInYourFiles:"Ви дійсно бажаєте відображати ваше ім'я в файлах?",SignFileDisclaimer:"Якщо так, ваше ім'я зможе бачити будь-хто, хто матиме доступ до ваших файлів.",Likes:"Вподобання",AllPublished:"Усі опубліковані",PublishedUnderAliases:"Псевдоніми",UserCount:"Кількість користувачів",SchoolID:"ID Школи",ClassID:"ID Класу"},weatherPanel:{SunshineHours:"Сонячні години"},diurnalTemperaturePanel:{SelectAirTemperatureModel:"Виберіть модель повітряної температури",Sinusoidal:"Синусоїдальна"},economicsPanel:{EconomicsParameters:"Параметри економіки",ElectricitySellingPrice:"Ціна продажу електроенергії",OperationalCostPerUnit:"Операційні витрати за одиницю",SellingPrice:"Selling Price",UnitCost:"Unit Cost"},navigationPanel:{NavigationParameters:"Navigation Parameters",MinimumMoveSpeed:"Minimum Move Speed",MinimumTurnSpeed:"Minimum Turn Speed"},shadowSettingsPanel:{ShadowSettings:"Shadow Settings",ShadowCameraFarDistance:"Shadow Camera Far Distance",ShadowMapSize:"Shadow Map Size",Notes:"Notes",RefreshPageNote:"Refresh the page for the new settings to take effect.",MapSizeWarning:"A large shadow map size may cause Aladdin to crash on some computers."},yearlyLightSensorPanel:{SkyClearness:"Ясність неба",ShowDaylightResults:"Показати результати денного освітлення",ShowSkyClearnessResults:"Показати результати ясності неба",ShowAverageDailySolarRadiation:"Показати середню щоденну сонячну радіацію"},analysisManager:{NoSensorForCollectingData:"Немає датчика для збору даних.",NoSolarPanelForAnalysis:"Немає сонячної панелі для аналізу.",NoObserverForVisibilityAnalysis:"Немає спостерігача для аналізу видимості.",NoWaterHeaterForAnalysis:"Немає водонагрівача для аналізу.",NoParabolicDishForAnalysis:"Немає параболічної тарілки для аналізу.",NoParabolicTroughForAnalysis:"Немає параболічного сонячного колектора для аналізу.",NoFresnelReflectorForAnalysis:"Немає відбивача Френеля для аналізу.",NoHeliostatForAnalysis:"Немає геліостата для аналізу.",NoSolarUpdraftTowerForAnalysis:"Немає сонячної вежі для аналізу.",NoBuildingForAnalysis:"Немає будівлі для аналізу."},toolbar:{CloudFile:"Хмарний файл",Select:"Вибрати",AddFoundation:"Додати фундамент",AddWall:"Додати стіну",AddWindow:"Додати вікно",AddDoor:"Додати двері",AddPyramidRoof:"Додати пірамідальний дах",AddGableRoof:"Додати шатровий дах",AddHipRoof:"Додати чотирихилий дах",AddGambrelRoof:"Додати двосхилий дах",AddMansardRoof:"Додати мансардний дах",AddCuboid:"Додати прямокутний паралелепіпед",AddSensor:"Додати датчик",AddSolarPanel:"Додати сонячну панель",AddWaterHeater:"Додати водонагрівач",AddPowerWall:"Add Power Wall",AddParabolicDish:"Додати параболічну тарілку",AddParabolicTrough:"Додати параболічний сонячний колектор",AddFresnelReflector:"Додати відбивач Френеля",AddHeliostat:"Додати геліостат",AddWindTurbine:"Add Horizontal Axis Wind Turbine",AddVerticalAxisWindTurbine:"Add Vertical Axis Wind Turbine",AddLight:"Додати світло",AddTree:"Додати дерево",AddFlower:"Додати квітку",AddPeople:"Додати людей",DoubleClickToLockThisModeForNextAction:"Подвійне клацання, щоб заблокувати цей режим для наступної дії",ClickToUnlockThisModeForNextAction:"Клацніть, щоб розблокувати цей режим для наступної дії",ManipulateGroup:"Маніпулювати групою",ClearScene:"Очистити сцену",ShowSunAndTimeSettings:"Показати налаштування Сонця та Часу",SpatialAnalysisOfEnergy:"Просторовий аналіз енергії",DoYouReallyWantToClearContent:"Ви дійсно бажаєте очистити вміст",ClickForMoreButtons:"Натисніть для додаткових кнопок"},tooltip:{gotoIFI:"Перейти до Інституту Інтелекту Майбутнього",visitAladdinHomePage:"Відвідати домашню сторінку Aladdin",clickToOpenMenu:"Натисність, щоб відкрити Головне Меню",clickToAccessAccountSettings:"Click to access account settings"},tree:{Apple:"Яблуня",Birch:"Береза",Coconut:"Кокос",Dogwood:"Дерен",Elm:"В'яз",FanPalm:"Віяльна пальма",Linden:"Липа",Magnolia:"Магнолія",Maple:"Клен",Oak:"Дуб",Pine:"Сосна",Spruce:"Ялина"},flower:{Bellflower:"Дзвоник",Boxwood:"Самшит",CactusCombo1:"Кактус Комбо 1",CactusCombo2:"Кактус Комбо 2",CactusCombo3:"Кактус Комбо 3",CactusCombo4:"Кактус Комбо 4",Hibiscus:"Гібіскус",Hosta:"Госта",Hydrangea:"Гортензія",Peony:"Півонія",RedRose:"Червона троянда",Spirea:"Спірея",Sunflower:"Соняшник",TallBush:"Високий кущ",Tulip:"Тюльпан",WhiteFlower:"Біла квітка",YellowFlower:"Жовта квітка"},people:{Jaah:"Артем",Jack:"Віталій",Jacob:"Ярослав",Jacqueline:"Олена",Jade:"Ольга",Jamelia:"Олександра",James:"Андрій",Jane:"Вікторія",Jaya:"Ірина",Jaye:"Назар",Jeanette:"Соломія",Jedi:"Євген",Jeff:"Павло",Jena:"Любов",Jennifer:"Тетяна",Jess:"Злата",Jett:"Сергій",Jill:"Надія",Jiya:"Марина",Joan:"Іванна",Jocelyn:"Анастасія",Joel:"Володимир",Joey:"Вероніка",John:"Іван",Jonathon:"Петро",Jose:"Микита",Joseph:"Віктор",Joshua:"Михайло",Judd:"Владислав",Judy:"Марія",Julia:"Юлія",Julio:"Дмитро",Jumapili:"Марта",June:"Анна",Juro:"Юрій",Justin:"Богдан"},compass:{N:"Пн",S:"Пд",W:"Зx",E:"Сх"},month:{January:"Jan",February:"Feb",March:"Mar",April:"Apr",May:"May",June:"Jun",July:"Jul",August:"Aug",September:"Sep",October:"Oct",November:"Nov",December:"Dec"},modelsMap:{SearchByPublisher:"Пошук за виробником",SearchByLabel:"Пошук за міткою",MyPublishedModels:"Мої опубліковані моделі",TotalNumberOfUserPublishedModels:"Загальна кількість моделей, опублікованих користувачами",SortFromOldestToNewest:"Сортувати від найдавніших до найновіших",SortFromNewestToOldest:"Сортувати від найновіших до найдавніших",ModelsFoundOnThisSite:"моделей знайдено на цьому сайті",ShowModelsPublishedByThisAuthor:"Показати моделі, опубліковані цим автором"}}};Y.use(gWe).use(jht).init({debug:!0,fallbackLng:"en",interpolation:{escapeValue:!1},resources:{en:spt,zh_cn:cpt,zh_tw:upt,es:dpt,tr:fpt,ua:hpt}});var h1e={},mWe={exports:{}};(function(t){function e(n){return n&&n.__esModule?n:{default:n}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(mWe);var Md=mWe.exports,QK={};Object.defineProperty(QK,"__esModule",{value:!0});QK.default=void 0;var ppt={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"};QK.default=ppt;var ZK={},JL={},eq={};Object.defineProperty(eq,"__esModule",{value:!0});eq.default=void 0;var gpt={locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"};eq.default=gpt;var KL={};Object.defineProperty(KL,"__esModule",{value:!0});KL.default=void 0;const mpt={placeholder:"Select time",rangePlaceholder:["Start time","End time"]};KL.default=mpt;var yWe=Md.default;Object.defineProperty(JL,"__esModule",{value:!0});JL.default=void 0;var ypt=yWe(eq),Apt=yWe(KL);const wpt={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},ypt.default),timePickerLocale:Object.assign({},Apt.default)};JL.default=wpt;var vpt=Md.default;Object.defineProperty(ZK,"__esModule",{value:!0});ZK.default=void 0;var xpt=vpt(JL);ZK.default=xpt.default;var tq=Md.default;Object.defineProperty(h1e,"__esModule",{value:!0});var p1e=h1e.default=void 0,bpt=tq(QK),Spt=tq(ZK),Tpt=tq(JL),Ppt=tq(KL);const F1="${label} is not a valid ${type}",Cpt={locale:"en",Pagination:bpt.default,DatePicker:Tpt.default,TimePicker:Ppt.default,Calendar:Spt.default,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:F1,method:F1,array:F1,object:F1,number:F1,date:F1,boolean:F1,integer:F1,float:F1,regexp:F1,email:F1,url:F1,hex:F1},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty"}};p1e=h1e.default=Cpt;const Rpt="/aladdin/assets/weather-_rJLhoXU.csv",Hpt="/aladdin/assets/solar_radiation_horizontal-D4I5HnbU.csv",Mpt="/aladdin/assets/solar_radiation_vertical-ChWgQAyS.csv",Ipt="/aladdin/assets/pvmodules-BhZ8sEOG.csv";function Em(t){for(var e=arguments.length,n=Array(e>1?e-1:0),o=1;o3?e.i-4:e.i:Array.isArray(t)?1:g1e(t)?2:m1e(t)?3:0}function kse(t,e){return TH(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function zpt(t,e){return TH(t)===2?t.get(e):t[e]}function AWe(t,e,n){var o=TH(t);o===2?t.set(e,n):o===3?t.add(n):t[e]=n}function Dpt(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function g1e(t){return Npt&&t instanceof Map}function m1e(t){return Upt&&t instanceof Set}function gd(t){return t.o||t.t}function y1e(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Bpt(t);delete e[es];for(var n=x1e(e),o=0;o1&&(t.set=t.add=t.clear=t.delete=Ept),Object.freeze(t),e&&tR(t,function(n,o){return A1e(o,!0)},!0)),t}function Ept(){Em(2)}function w1e(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function S9(t){var e=Wse[t];return e||Em(18,t),e}function Fpt(t,e){Wse[t]||(Wse[t]=e)}function JV(){return xF}function woe(t,e){e&&(S9("Patches"),t.u=[],t.s=[],t.v=e)}function KV(t){Lse(t),t.p.forEach(kpt),t.p=null}function Lse(t){t===xF&&(xF=t.l)}function i4e(t){return xF={p:[],l:xF,h:t,m:!0,_:0}}function kpt(t){var e=t[es];e.i===0||e.i===1?e.j():e.g=!0}function voe(t,e){e._=e.p.length;var n=e.p[0],o=t!==void 0&&t!==n;return e.h.O||S9("ES5").S(e,t,o),o?(n[es].P&&(KV(e),Em(4)),J6(t)&&(t=qV(e,t),e.l||$V(e,t)),e.u&&S9("Patches").M(n[es].t,t,e.u,e.s)):t=qV(e,n,[]),KV(e),e.u&&e.v(e.u,e.s),t!==wWe?t:void 0}function qV(t,e,n){if(w1e(e))return e;var o=e[es];if(!o)return tR(e,function(l,s){return a4e(t,o,e,l,s,n)},!0),e;if(o.A!==t)return e;if(!o.P)return $V(t,o.t,!0),o.t;if(!o.I){o.I=!0,o.A._--;var r=o.i===4||o.i===5?o.o=y1e(o.k):o.o,i=r,a=!1;o.i===3&&(i=new Set(r),r.clear(),a=!0),tR(i,function(l,s){return a4e(t,o,r,l,s,n,a)}),$V(t,r,!1),n&&t.u&&S9("Patches").N(o,n,t.u,t.s)}return o.o}function a4e(t,e,n,o,r,i,a){if(eR(r)){var l=qV(t,r,i&&e&&e.i!==3&&!kse(e.R,o)?i.concat(o):void 0);if(AWe(n,o,l),!eR(l))return;t.m=!1}else a&&n.add(r);if(J6(r)&&!w1e(r)){if(!t.h.D&&t._<1)return;qV(t,r),e&&e.A.l||$V(t,r)}}function $V(t,e,n){n===void 0&&(n=!1),!t.l&&t.h.D&&t.m&&A1e(e,n)}function xoe(t,e){var n=t[es];return(n?gd(n):t)[e]}function l4e(t,e){if(e in t)for(var n=Object.getPrototypeOf(t);n;){var o=Object.getOwnPropertyDescriptor(n,e);if(o)return o;n=Object.getPrototypeOf(n)}}function m6(t){t.P||(t.P=!0,t.l&&m6(t.l))}function boe(t){t.o||(t.o=y1e(t.t))}function vF(t,e,n){var o=g1e(e)?S9("MapSet").F(e,n):m1e(e)?S9("MapSet").T(e,n):t.O?function(r,i){var a=Array.isArray(r),l={i:a?1:0,A:i?i.A:JV(),P:!1,I:!1,R:{},l:i,t:r,k:null,o:null,j:null,C:!1},s=l,c=Nse;a&&(s=[l],c=SD);var u=Proxy.revocable(s,c),d=u.revoke,f=u.proxy;return l.k=f,l.j=d,f}(e,n):S9("ES5").J(e,n);return(n?n.A:JV()).p.push(o),o}function Lpt(t){return eR(t)||Em(22,t),function e(n){if(!J6(n))return n;var o,r=n[es],i=TH(n);if(r){if(!r.P&&(r.i<4||!S9("ES5").K(r)))return r.t;r.I=!0,o=s4e(n,i),r.I=!1}else o=s4e(n,i);return tR(o,function(a,l){r&&zpt(r.t,a)===l||AWe(o,a,e(l))}),i===3?new Set(o):o}(t)}function s4e(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return y1e(t)}function Wpt(){function t(l,s){function c(){this.constructor=l}r(l,s),l.prototype=(c.prototype=s.prototype,new c)}function e(l){l.o||(l.R=new Map,l.o=new Map(l.t))}function n(l){l.o||(l.o=new Set,l.t.forEach(function(s){if(J6(s)){var c=vF(l.A.h,s,l);l.p.set(s,c),l.o.add(c)}else l.o.add(s)}))}function o(l){l.g&&Em(3,JSON.stringify(gd(l)))}var r=function(l,s){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,u){c.__proto__=u}||function(c,u){for(var d in u)u.hasOwnProperty(d)&&(c[d]=u[d])})(l,s)},i=function(){function l(c,u){return this[es]={i:2,l:u,A:u?u.A:JV(),P:!1,I:!1,o:void 0,R:void 0,t:c,k:this,C:!1,g:!1},this}t(l,Map);var s=l.prototype;return Object.defineProperty(s,"size",{get:function(){return gd(this[es]).size}}),s.has=function(c){return gd(this[es]).has(c)},s.set=function(c,u){var d=this[es];return o(d),gd(d).has(c)&&gd(d).get(c)===u||(e(d),m6(d),d.R.set(c,!0),d.o.set(c,u),d.R.set(c,!0)),this},s.delete=function(c){if(!this.has(c))return!1;var u=this[es];return o(u),e(u),m6(u),u.t.has(c)?u.R.set(c,!1):u.R.delete(c),u.o.delete(c),!0},s.clear=function(){var c=this[es];o(c),gd(c).size&&(e(c),m6(c),c.R=new Map,tR(c.t,function(u){c.R.set(u,!1)}),c.o.clear())},s.forEach=function(c,u){var d=this;gd(this[es]).forEach(function(f,p){c.call(u,d.get(p),p,d)})},s.get=function(c){var u=this[es];o(u);var d=gd(u).get(c);if(u.I||!J6(d)||d!==u.t.get(c))return d;var f=vF(u.A.h,d,u);return e(u),u.o.set(c,f),f},s.keys=function(){return gd(this[es]).keys()},s.values=function(){var c,u=this,d=this.keys();return(c={})[fB]=function(){return u.values()},c.next=function(){var f=d.next();return f.done?f:{done:!1,value:u.get(f.value)}},c},s.entries=function(){var c,u=this,d=this.keys();return(c={})[fB]=function(){return u.entries()},c.next=function(){var f=d.next();if(f.done)return f;var p=u.get(f.value);return{done:!1,value:[f.value,p]}},c},s[fB]=function(){return this.entries()},l}(),a=function(){function l(c,u){return this[es]={i:3,l:u,A:u?u.A:JV(),P:!1,I:!1,o:void 0,t:c,k:this,p:new Map,g:!1,C:!1},this}t(l,Set);var s=l.prototype;return Object.defineProperty(s,"size",{get:function(){return gd(this[es]).size}}),s.has=function(c){var u=this[es];return o(u),u.o?!!u.o.has(c)||!(!u.p.has(c)||!u.o.has(u.p.get(c))):u.t.has(c)},s.add=function(c){var u=this[es];return o(u),this.has(c)||(n(u),m6(u),u.o.add(c)),this},s.delete=function(c){if(!this.has(c))return!1;var u=this[es];return o(u),n(u),m6(u),u.o.delete(c)||!!u.p.has(c)&&u.o.delete(u.p.get(c))},s.clear=function(){var c=this[es];o(c),gd(c).size&&(n(c),m6(c),c.o.clear())},s.values=function(){var c=this[es];return o(c),n(c),c.o.values()},s.entries=function(){var c=this[es];return o(c),n(c),c.o.entries()},s.keys=function(){return this.values()},s[fB]=function(){return this.values()},s.forEach=function(c,u){for(var d=this.values(),f=d.next();!f.done;)c.call(u,f.value,f.value,this),f=d.next()},l}();Fpt("MapSet",{F:function(l,s){return new i(l,s)},T:function(l,s){return new a(l,s)}})}var c4e,xF,v1e=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Npt=typeof Map<"u",Upt=typeof Set<"u",u4e=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",wWe=v1e?Symbol.for("immer-nothing"):((c4e={})["immer-nothing"]=!0,c4e),qm=v1e?Symbol.for("immer-draftable"):"__$immer_draftable",es=v1e?Symbol.for("immer-state"):"__$immer_state",fB=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",jpt=""+Object.prototype.constructor,x1e=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Bpt=Object.getOwnPropertyDescriptors||function(t){var e={};return x1e(t).forEach(function(n){e[n]=Object.getOwnPropertyDescriptor(t,n)}),e},Wse={},Nse={get:function(t,e){if(e===es)return t;var n=gd(t);if(!kse(n,e))return function(r,i,a){var l,s=l4e(i,a);return s?"value"in s?s.value:(l=s.get)===null||l===void 0?void 0:l.call(r.k):void 0}(t,n,e);var o=n[e];return t.I||!J6(o)?o:o===xoe(t.t,e)?(boe(t),t.o[e]=vF(t.A.h,o,t)):o},has:function(t,e){return e in gd(t)},ownKeys:function(t){return Reflect.ownKeys(gd(t))},set:function(t,e,n){var o=l4e(gd(t),e);if(o!=null&&o.set)return o.set.call(t.k,n),!0;if(!t.P){var r=xoe(gd(t),e),i=r==null?void 0:r[es];if(i&&i.t===n)return t.o[e]=n,t.R[e]=!1,!0;if(Dpt(n,r)&&(n!==void 0||kse(t.t,e)))return!0;boe(t),m6(t)}return t.o[e]===n&&(n!==void 0||e in t.o)||Number.isNaN(n)&&Number.isNaN(t.o[e])||(t.o[e]=n,t.R[e]=!0),!0},deleteProperty:function(t,e){return xoe(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,boe(t),m6(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var n=gd(t),o=Reflect.getOwnPropertyDescriptor(n,e);return o&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:o.enumerable,value:n[e]}},defineProperty:function(){Em(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Em(12)}},SD={};tR(Nse,function(t,e){SD[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),SD.deleteProperty=function(t,e){return SD.set.call(this,t,e,void 0)},SD.set=function(t,e,n){return Nse.set.call(this,t[0],e,n,t[0])};var Ypt=function(){function t(n){var o=this;this.O=u4e,this.D=!0,this.produce=function(r,i,a){if(typeof r=="function"&&typeof i!="function"){var l=i;i=r;var s=o;return function(y){var w=this;y===void 0&&(y=l);for(var b=arguments.length,C=Array(b>1?b-1:0),P=1;P1?u-1:0),f=1;f=0;r--){var i=o[r];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}r>-1&&(o=o.slice(r+1));var a=S9("Patches").$;return eR(n)?a(n,o):this.produce(n,function(l){return a(l,o)})},t}(),Ig=new Ypt,OP=Ig.produce;Ig.produceWithPatches.bind(Ig);Ig.setAutoFreeze.bind(Ig);Ig.setUseProxies.bind(Ig);Ig.applyPatches.bind(Ig);Ig.createDraft.bind(Ig);Ig.finishDraft.bind(Ig);/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT - */const qL="158",av={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},lv={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},wWe=0,Use=1,vWe=2,Opt=3,xWe=0,tq=1,cE=2,l2=3,Ra=0,p0=1,$r=2,_pt=2,E6=0,ix=1,nR=2,jse=3,Bse=4,bWe=5,n8=100,SWe=101,TWe=102,Yse=103,Ose=104,PWe=200,CWe=201,RWe=202,HWe=203,$V=204,QV=205,MWe=206,IWe=207,zWe=208,DWe=209,EWe=210,FWe=211,kWe=212,LWe=213,WWe=214,NWe=0,UWe=1,jWe=2,bF=3,BWe=4,YWe=5,OWe=6,_We=7,$L=0,VWe=1,GWe=2,T9=0,XWe=1,JWe=2,KWe=3,b1e=4,qWe=5,_se="attached",$We="detached",nq=300,K6=301,$8=302,SF=303,TF=304,PH=306,Hs=1e3,dh=1001,PF=1002,k0=1003,ZV=1004,Vpt=1004,uE=1005,Gpt=1005,Gs=1006,S1e=1007,Xpt=1007,Q8=1008,Jpt=1008,P9=1009,QWe=1010,ZWe=1011,oq=1012,T1e=1013,b6=1014,v2=1015,jx=1016,P1e=1017,C1e=1018,W8=1020,eNe=1021,Up=1023,tNe=1024,nNe=1025,N8=1026,Bx=1027,oNe=1028,R1e=1029,rNe=1030,H1e=1031,M1e=1033,T_=33776,P_=33777,C_=33778,R_=33779,Vse=35840,Gse=35841,Xse=35842,Jse=35843,iNe=36196,Kse=37492,qse=37496,$se=37808,Qse=37809,Zse=37810,ece=37811,tce=37812,nce=37813,oce=37814,rce=37815,ice=37816,ace=37817,lce=37818,sce=37819,cce=37820,uce=37821,H_=36492,dce=36494,fce=36495,aNe=36283,hce=36284,pce=36285,gce=36286,lNe=2200,sNe=2201,cNe=2202,CF=2300,RF=2301,M_=2302,Mv=2400,Iv=2401,HF=2402,rq=2500,I1e=2501,Kpt=0,qpt=1,$pt=2,z1e=3e3,U8=3001,uNe=3200,D1e=3201,Cw=0,dNe=1,dg="",ru="srgb",L9="srgb-linear",iq="display-p3",QL="display-p3-linear",MF="linear",Ys="srgb",IF="rec709",zF="p3",Qpt=0,sv=7680,Zpt=7681,e1t=7682,t1t=7683,n1t=34055,o1t=34056,r1t=5386,i1t=512,a1t=513,l1t=514,s1t=515,c1t=516,u1t=517,d1t=518,mce=519,fNe=512,hNe=513,pNe=514,gNe=515,mNe=516,yNe=517,ANe=518,wNe=519,DF=35044,f1t=35048,h1t=35040,p1t=35045,g1t=35049,m1t=35041,y1t=35046,A1t=35050,w1t=35042,v1t="100",yce="300 es",eG=1035,g9=2e3,EF=2001;class Z9{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const o=this._listeners;o[e]===void 0&&(o[e]=[]),o[e].indexOf(n)===-1&&o[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const o=this._listeners;return o[e]!==void 0&&o[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const o=this._listeners[e.type];if(o!==void 0){e.target=this;const r=o.slice(0);for(let i=0,a=r.length;i>8&255]+Gf[t>>16&255]+Gf[t>>24&255]+"-"+Gf[e&255]+Gf[e>>8&255]+"-"+Gf[e>>16&15|64]+Gf[e>>24&255]+"-"+Gf[n&63|128]+Gf[n>>8&255]+"-"+Gf[n>>16&255]+Gf[n>>24&255]+Gf[o&255]+Gf[o>>8&255]+Gf[o>>16&255]+Gf[o>>24&255]).toLowerCase()}function h0(t,e,n){return Math.max(e,Math.min(n,t))}function E1e(t,e){return(t%e+e)%e}function x1t(t,e,n,o,r){return o+(t-e)*(r-o)/(n-e)}function b1t(t,e,n){return t!==e?(n-t)/(e-t):0}function dE(t,e,n){return(1-n)*t+n*e}function S1t(t,e,n,o){return dE(t,e,1-Math.exp(-n*o))}function T1t(t,e=1){return e-Math.abs(E1e(t,e*2)-e)}function P1t(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function C1t(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function R1t(t,e){return t+Math.floor(Math.random()*(e-t+1))}function H1t(t,e){return t+Math.random()*(e-t)}function M1t(t){return t*(.5-Math.random())}function I1t(t){t!==void 0&&(u4e=t);let e=u4e+=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 z1t(t){return t*ax}function D1t(t){return t*oR}function Ace(t){return(t&t-1)===0&&t!==0}function vNe(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function tG(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function E1t(t,e,n,o,r){const i=Math.cos,a=Math.sin,l=i(n/2),s=a(n/2),c=i((e+o)/2),u=a((e+o)/2),d=i((e-o)/2),f=a((e-o)/2),p=i((o-e)/2),g=a((o-e)/2);switch(r){case"XYX":t.set(l*u,s*d,s*f,l*c);break;case"YZY":t.set(s*f,l*u,s*d,l*c);break;case"ZXZ":t.set(s*d,s*f,l*u,l*c);break;case"XZX":t.set(l*u,s*g,s*p,l*c);break;case"YXY":t.set(s*p,l*u,s*g,l*c);break;case"ZYZ":t.set(s*g,s*p,l*u,l*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function jp(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Aa(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const xNe={DEG2RAD:ax,RAD2DEG:oR,generateUUID:Tg,clamp:h0,euclideanModulo:E1e,mapLinear:x1t,inverseLerp:b1t,lerp:dE,damp:S1t,pingpong:T1t,smoothstep:P1t,smootherstep:C1t,randInt:R1t,randFloat:H1t,randFloatSpread:M1t,seededRandom:I1t,degToRad:z1t,radToDeg:D1t,isPowerOfTwo:Ace,ceilPowerOfTwo:vNe,floorPowerOfTwo:tG,setQuaternionFromProperEuler:E1t,normalize:Aa,denormalize:jp};class Xt{constructor(e=0,n=0){Xt.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,o=this.y,r=e.elements;return this.x=r[0]*n+r[3]*o+r[6],this.y=r[1]*n+r[4]*o+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const o=this.length();return this.divideScalar(o||1).multiplyScalar(Math.max(e,Math.min(n,o)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const o=this.dot(e)/n;return Math.acos(h0(o,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,o=this.y-e.y;return n*n+o*o}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,o){return this.x=e.x+(n.x-e.x)*o,this.y=e.y+(n.y-e.y)*o,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const o=Math.cos(n),r=Math.sin(n),i=this.x-e.x,a=this.y-e.y;return this.x=i*o-a*r+e.x,this.y=i*r+a*o+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class pa{constructor(e,n,o,r,i,a,l,s,c){pa.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,o,r,i,a,l,s,c)}set(e,n,o,r,i,a,l,s,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=l,u[3]=n,u[4]=i,u[5]=s,u[6]=o,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,o=e.elements;return n[0]=o[0],n[1]=o[1],n[2]=o[2],n[3]=o[3],n[4]=o[4],n[5]=o[5],n[6]=o[6],n[7]=o[7],n[8]=o[8],this}extractBasis(e,n,o){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),o.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const o=e.elements,r=n.elements,i=this.elements,a=o[0],l=o[3],s=o[6],c=o[1],u=o[4],d=o[7],f=o[2],p=o[5],g=o[8],y=r[0],w=r[3],b=r[6],C=r[1],P=r[4],v=r[7],T=r[2],A=r[5],x=r[8];return i[0]=a*y+l*C+s*T,i[3]=a*w+l*P+s*A,i[6]=a*b+l*v+s*x,i[1]=c*y+u*C+d*T,i[4]=c*w+u*P+d*A,i[7]=c*b+u*v+d*x,i[2]=f*y+p*C+g*T,i[5]=f*w+p*P+g*A,i[8]=f*b+p*v+g*x,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],o=e[1],r=e[2],i=e[3],a=e[4],l=e[5],s=e[6],c=e[7],u=e[8];return n*a*u-n*l*c-o*i*u+o*l*s+r*i*c-r*a*s}invert(){const e=this.elements,n=e[0],o=e[1],r=e[2],i=e[3],a=e[4],l=e[5],s=e[6],c=e[7],u=e[8],d=u*a-l*c,f=l*s-u*i,p=c*i-a*s,g=n*d+o*f+r*p;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/g;return e[0]=d*y,e[1]=(r*c-u*o)*y,e[2]=(l*o-r*a)*y,e[3]=f*y,e[4]=(u*n-r*s)*y,e[5]=(r*i-l*n)*y,e[6]=p*y,e[7]=(o*s-c*n)*y,e[8]=(a*n-o*i)*y,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,o,r,i,a,l){const s=Math.cos(i),c=Math.sin(i);return this.set(o*s,o*c,-o*(s*a+c*l)+a+e,-r*c,r*s,-r*(-c*a+s*l)+l+n,0,0,1),this}scale(e,n){return this.premultiply(Soe.makeScale(e,n)),this}rotate(e){return this.premultiply(Soe.makeRotation(-e)),this}translate(e,n){return this.premultiply(Soe.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),o=Math.sin(e);return this.set(n,-o,0,o,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,o=e.elements;for(let r=0;r<9;r++)if(n[r]!==o[r])return!1;return!0}fromArray(e,n=0){for(let o=0;o<9;o++)this.elements[o]=e[o+n];return this}toArray(e=[],n=0){const o=this.elements;return e[n]=o[0],e[n+1]=o[1],e[n+2]=o[2],e[n+3]=o[3],e[n+4]=o[4],e[n+5]=o[5],e[n+6]=o[6],e[n+7]=o[7],e[n+8]=o[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Soe=new pa;function bNe(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const F1t={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function _P(t,e){return new F1t[t](e)}function FF(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function SNe(){const t=FF("canvas");return t.style.display="block",t}const d4e={};function fE(t){t in d4e||(d4e[t]=!0,console.warn(t))}const f4e=new pa().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),h4e=new pa().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),fB={[L9]:{transfer:MF,primaries:IF,toReference:t=>t,fromReference:t=>t},[ru]:{transfer:Ys,primaries:IF,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[QL]:{transfer:MF,primaries:zF,toReference:t=>t.applyMatrix3(h4e),fromReference:t=>t.applyMatrix3(f4e)},[iq]:{transfer:Ys,primaries:zF,toReference:t=>t.convertSRGBToLinear().applyMatrix3(h4e),fromReference:t=>t.applyMatrix3(f4e).convertLinearToSRGB()}},k1t=new Set([L9,QL]),cs={enabled:!0,_workingColorSpace:L9,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!k1t.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(this.enabled===!1||e===n||!e||!n)return t;const o=fB[e].toReference,r=fB[n].fromReference;return r(o(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return fB[t].primaries},getTransfer:function(t){return t===dg?MF:fB[t].transfer}};function bC(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Toe(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let tT;class F1e{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{tT===void 0&&(tT=FF("canvas")),tT.width=e.width,tT.height=e.height;const o=tT.getContext("2d");e instanceof ImageData?o.putImageData(e,0,0):o.drawImage(e,0,0,e.width,e.height),n=tT}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=FF("canvas");n.width=e.width,n.height=e.height;const o=n.getContext("2d");o.drawImage(e,0,0,e.width,e.height);const r=o.getImageData(0,0,e.width,e.height),i=r.data;for(let a=0;a0&&(o.userData=this.userData),n||(e.textures[this.uuid]=o),o}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==nq)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Hs:e.x=e.x-Math.floor(e.x);break;case dh:e.x=e.x<0?0:1;break;case PF: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 Hs:e.y=e.y-Math.floor(e.y);break;case dh:e.y=e.y<0?0:1;break;case PF: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)}get encoding(){return fE("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===ru?U8:z1e}set encoding(e){fE("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===U8?ru:dg}}Vc.DEFAULT_IMAGE=null;Vc.DEFAULT_MAPPING=nq;Vc.DEFAULT_ANISOTROPY=1;class Qa{constructor(e=0,n=0,o=0,r=1){Qa.prototype.isVector4=!0,this.x=e,this.y=n,this.z=o,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,o,r){return this.x=e,this.y=n,this.z=o,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,o=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*n+a[4]*o+a[8]*r+a[12]*i,this.y=a[1]*n+a[5]*o+a[9]*r+a[13]*i,this.z=a[2]*n+a[6]*o+a[10]*r+a[14]*i,this.w=a[3]*n+a[7]*o+a[11]*r+a[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,o,r,i;const s=e.elements,c=s[0],u=s[4],d=s[8],f=s[1],p=s[5],g=s[9],y=s[2],w=s[6],b=s[10];if(Math.abs(u-f)<.01&&Math.abs(d-y)<.01&&Math.abs(g-w)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+y)<.1&&Math.abs(g+w)<.1&&Math.abs(c+p+b-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const P=(c+1)/2,v=(p+1)/2,T=(b+1)/2,A=(u+f)/4,x=(d+y)/4,S=(g+w)/4;return P>v&&P>T?P<.01?(o=0,r=.707106781,i=.707106781):(o=Math.sqrt(P),r=A/o,i=x/o):v>T?v<.01?(o=.707106781,r=0,i=.707106781):(r=Math.sqrt(v),o=A/r,i=S/r):T<.01?(o=.707106781,r=.707106781,i=0):(i=Math.sqrt(T),o=x/i,r=S/i),this.set(o,r,i,n),this}let C=Math.sqrt((w-g)*(w-g)+(d-y)*(d-y)+(f-u)*(f-u));return Math.abs(C)<.001&&(C=1),this.x=(w-g)/C,this.y=(d-y)/C,this.z=(f-u)/C,this.w=Math.acos((c+p+b-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,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const o=this.length();return this.divideScalar(o||1).multiplyScalar(Math.max(e,Math.min(n,o)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,o){return this.x=e.x+(n.x-e.x)*o,this.y=e.y+(n.y-e.y)*o,this.z=e.z+(n.z-e.z)*o,this.w=e.w+(n.w-e.w)*o,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class TNe extends Z9{constructor(e=1,n=1,o={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new Qa(0,0,e,n),this.scissorTest=!1,this.viewport=new Qa(0,0,e,n);const r={width:e,height:n,depth:1};o.encoding!==void 0&&(fE("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),o.colorSpace=o.encoding===U8?ru:dg),o=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Gs,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},o),this.texture=new Vc(r,o.mapping,o.wrapS,o.wrapT,o.magFilter,o.minFilter,o.format,o.type,o.anisotropy,o.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=o.generateMipmaps,this.texture.internalFormat=o.internalFormat,this.depthBuffer=o.depthBuffer,this.stencilBuffer=o.stencilBuffer,this.depthTexture=o.depthTexture,this.samples=o.samples}setSize(e,n,o=1){(this.width!==e||this.height!==n||this.depth!==o)&&(this.width=e,this.height=n,this.depth=o,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=o,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},e.texture.image);return this.texture.source=new zv(n),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 $m extends TNe{constructor(e=1,n=1,o={}){super(e,n,o),this.isWebGLRenderTarget=!0}}class aq extends Vc{constructor(e=null,n=1,o=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:o,depth:r},this.magFilter=k0,this.minFilter=k0,this.wrapR=dh,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class N1t extends $m{constructor(e=1,n=1,o=1){super(e,n),this.isWebGLArrayRenderTarget=!0,this.depth=o,this.texture=new aq(null,e,n,o),this.texture.isRenderTargetTexture=!0}}class k1e extends Vc{constructor(e=null,n=1,o=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:o,depth:r},this.magFilter=k0,this.minFilter=k0,this.wrapR=dh,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class U1t extends $m{constructor(e=1,n=1,o=1){super(e,n),this.isWebGL3DRenderTarget=!0,this.depth=o,this.texture=new k1e(null,e,n,o),this.texture.isRenderTargetTexture=!0}}class j1t extends $m{constructor(e=1,n=1,o=1,r={}){super(e,n,r),this.isWebGLMultipleRenderTargets=!0;const i=this.texture;this.texture=[];for(let a=0;a=0?1:-1,P=1-b*b;if(P>Number.EPSILON){const T=Math.sqrt(P),A=Math.atan2(T,b*C);w=Math.sin(w*A)/T,l=Math.sin(l*A)/T}const v=l*C;if(s=s*w+f*v,c=c*w+p*v,u=u*w+g*v,d=d*w+y*v,w===1-l){const T=1/Math.sqrt(s*s+c*c+u*u+d*d);s*=T,c*=T,u*=T,d*=T}}e[n]=s,e[n+1]=c,e[n+2]=u,e[n+3]=d}static multiplyQuaternionsFlat(e,n,o,r,i,a){const l=o[r],s=o[r+1],c=o[r+2],u=o[r+3],d=i[a],f=i[a+1],p=i[a+2],g=i[a+3];return e[n]=l*g+u*d+s*p-c*f,e[n+1]=s*g+u*f+c*d-l*p,e[n+2]=c*g+u*p+l*f-s*d,e[n+3]=u*g-l*d-s*f-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,o,r){return this._x=e,this._y=n,this._z=o,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n){const o=e._x,r=e._y,i=e._z,a=e._order,l=Math.cos,s=Math.sin,c=l(o/2),u=l(r/2),d=l(i/2),f=s(o/2),p=s(r/2),g=s(i/2);switch(a){case"XYZ":this._x=f*u*d+c*p*g,this._y=c*p*d-f*u*g,this._z=c*u*g+f*p*d,this._w=c*u*d-f*p*g;break;case"YXZ":this._x=f*u*d+c*p*g,this._y=c*p*d-f*u*g,this._z=c*u*g-f*p*d,this._w=c*u*d+f*p*g;break;case"ZXY":this._x=f*u*d-c*p*g,this._y=c*p*d+f*u*g,this._z=c*u*g+f*p*d,this._w=c*u*d-f*p*g;break;case"ZYX":this._x=f*u*d-c*p*g,this._y=c*p*d+f*u*g,this._z=c*u*g-f*p*d,this._w=c*u*d+f*p*g;break;case"YZX":this._x=f*u*d+c*p*g,this._y=c*p*d+f*u*g,this._z=c*u*g-f*p*d,this._w=c*u*d-f*p*g;break;case"XZY":this._x=f*u*d-c*p*g,this._y=c*p*d-f*u*g,this._z=c*u*g+f*p*d,this._w=c*u*d+f*p*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const o=n/2,r=Math.sin(o);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(o),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,o=n[0],r=n[4],i=n[8],a=n[1],l=n[5],s=n[9],c=n[2],u=n[6],d=n[10],f=o+l+d;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-s)*p,this._y=(i-c)*p,this._z=(a-r)*p}else if(o>l&&o>d){const p=2*Math.sqrt(1+o-l-d);this._w=(u-s)/p,this._x=.25*p,this._y=(r+a)/p,this._z=(i+c)/p}else if(l>d){const p=2*Math.sqrt(1+l-o-d);this._w=(i-c)/p,this._x=(r+a)/p,this._y=.25*p,this._z=(s+u)/p}else{const p=2*Math.sqrt(1+d-o-l);this._w=(a-r)/p,this._x=(i+c)/p,this._y=(s+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let o=e.dot(n)+1;return oMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=o):(this._x=0,this._y=-e.z,this._z=e.y,this._w=o)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=o),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(h0(this.dot(e),-1,1)))}rotateTowards(e,n){const o=this.angleTo(e);if(o===0)return this;const r=Math.min(1,n/o);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const o=e._x,r=e._y,i=e._z,a=e._w,l=n._x,s=n._y,c=n._z,u=n._w;return this._x=o*u+a*l+r*c-i*s,this._y=r*u+a*s+i*l-o*c,this._z=i*u+a*c+o*s-r*l,this._w=a*u-o*l-r*s-i*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const o=this._x,r=this._y,i=this._z,a=this._w;let l=a*e._w+o*e._x+r*e._y+i*e._z;if(l<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,l=-l):this.copy(e),l>=1)return this._w=a,this._x=o,this._y=r,this._z=i,this;const s=1-l*l;if(s<=Number.EPSILON){const p=1-n;return this._w=p*a+n*this._w,this._x=p*o+n*this._x,this._y=p*r+n*this._y,this._z=p*i+n*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(s),u=Math.atan2(c,l),d=Math.sin((1-n)*u)/c,f=Math.sin(n*u)/c;return this._w=a*d+this._w*f,this._x=o*d+this._x*f,this._y=r*d+this._y*f,this._z=i*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,n,o){return this.copy(e).slerp(n,o)}random(){const e=Math.random(),n=Math.sqrt(1-e),o=Math.sqrt(e),r=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(n*Math.cos(r),o*Math.sin(i),o*Math.cos(i),n*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ie{constructor(e=0,n=0,o=0){ie.prototype.isVector3=!0,this.x=e,this.y=n,this.z=o}set(e,n,o){return o===void 0&&(o=this.z),this.x=e,this.y=n,this.z=o,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(p4e.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(p4e.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,o=this.y,r=this.z,i=e.elements;return this.x=i[0]*n+i[3]*o+i[6]*r,this.y=i[1]*n+i[4]*o+i[7]*r,this.z=i[2]*n+i[5]*o+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,o=this.y,r=this.z,i=e.elements,a=1/(i[3]*n+i[7]*o+i[11]*r+i[15]);return this.x=(i[0]*n+i[4]*o+i[8]*r+i[12])*a,this.y=(i[1]*n+i[5]*o+i[9]*r+i[13])*a,this.z=(i[2]*n+i[6]*o+i[10]*r+i[14])*a,this}applyQuaternion(e){const n=this.x,o=this.y,r=this.z,i=e.x,a=e.y,l=e.z,s=e.w,c=2*(a*r-l*o),u=2*(l*n-i*r),d=2*(i*o-a*n);return this.x=n+s*c+a*d-l*u,this.y=o+s*u+l*c-i*d,this.z=r+s*d+i*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,o=this.y,r=this.z,i=e.elements;return this.x=i[0]*n+i[4]*o+i[8]*r,this.y=i[1]*n+i[5]*o+i[9]*r,this.z=i[2]*n+i[6]*o+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const o=this.length();return this.divideScalar(o||1).multiplyScalar(Math.max(e,Math.min(n,o)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,o){return this.x=e.x+(n.x-e.x)*o,this.y=e.y+(n.y-e.y)*o,this.z=e.z+(n.z-e.z)*o,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const o=e.x,r=e.y,i=e.z,a=n.x,l=n.y,s=n.z;return this.x=r*s-i*l,this.y=i*a-o*s,this.z=o*l-r*a,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const o=e.dot(this)/n;return this.copy(e).multiplyScalar(o)}projectOnPlane(e){return Coe.copy(this).projectOnVector(e),this.sub(Coe)}reflect(e){return this.sub(Coe.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const o=this.dot(e)/n;return Math.acos(h0(o,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,o=this.y-e.y,r=this.z-e.z;return n*n+o*o+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,o){const r=Math.sin(n)*e;return this.x=r*Math.sin(o),this.y=Math.cos(n)*e,this.z=r*Math.cos(o),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,o){return this.x=e*Math.sin(n),this.y=o,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),o=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=o,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,o=Math.sqrt(1-e**2);return this.x=o*Math.cos(n),this.y=o*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Coe=new ie,p4e=new bs;class bf{constructor(e=new ie(1/0,1/0,1/0),n=new ie(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,o=e.length;nthis.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,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Gy),Gy.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,o;return e.normal.x>0?(n=e.normal.x*this.min.x,o=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,o=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,o+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,o+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,o+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,o+=e.normal.z*this.min.z),n<=-e.constant&&o>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(gz),pB.subVectors(this.max,gz),nT.subVectors(e.a,gz),oT.subVectors(e.b,gz),rT.subVectors(e.c,gz),m4.subVectors(oT,nT),y4.subVectors(rT,oT),E7.subVectors(nT,rT);let n=[0,-m4.z,m4.y,0,-y4.z,y4.y,0,-E7.z,E7.y,m4.z,0,-m4.x,y4.z,0,-y4.x,E7.z,0,-E7.x,-m4.y,m4.x,0,-y4.y,y4.x,0,-E7.y,E7.x,0];return!Roe(n,nT,oT,rT,pB)||(n=[1,0,0,0,1,0,0,0,1],!Roe(n,nT,oT,rT,pB))?!1:(gB.crossVectors(m4,y4),n=[gB.x,gB.y,gB.z],Roe(n,nT,oT,rT,pB))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Gy).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Gy).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:($3[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),$3[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),$3[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),$3[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),$3[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),$3[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),$3[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),$3[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints($3),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 $3=[new ie,new ie,new ie,new ie,new ie,new ie,new ie,new ie],Gy=new ie,hB=new bf,nT=new ie,oT=new ie,rT=new ie,m4=new ie,y4=new ie,E7=new ie,gz=new ie,pB=new ie,gB=new ie,F7=new ie;function Roe(t,e,n,o,r){for(let i=0,a=t.length-3;i<=a;i+=3){F7.fromArray(t,i);const l=r.x*Math.abs(F7.x)+r.y*Math.abs(F7.y)+r.z*Math.abs(F7.z),s=e.dot(F7),c=n.dot(F7),u=o.dot(F7);if(Math.max(-Math.max(s,c,u),Math.min(s,c,u))>l)return!1}return!0}const B1t=new bf,mz=new ie,Hoe=new ie;let s1=class{constructor(e=new ie,n=-1){this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const o=this.center;n!==void 0?o.copy(n):B1t.setFromPoints(e).getCenter(o);let r=0;for(let i=0,a=e.length;ithis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;mz.subVectors(e,this.center);const n=mz.lengthSq();if(n>this.radius*this.radius){const o=Math.sqrt(n),r=(o-this.radius)*.5;this.center.addScaledVector(mz,r/o),this.radius+=r}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):(Hoe.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(mz.copy(e.center).add(Hoe)),this.expandByPoint(mz.copy(e.center).sub(Hoe))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}};const Q3=new ie,Moe=new ie,mB=new ie,A4=new ie,Ioe=new ie,yB=new ie,zoe=new ie;class CH{constructor(e=new ie,n=new ie(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Q3)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const o=n.dot(this.direction);return o<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,o)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Q3.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Q3.copy(this.origin).addScaledVector(this.direction,n),Q3.distanceToSquared(e))}distanceSqToSegment(e,n,o,r){Moe.copy(e).add(n).multiplyScalar(.5),mB.copy(n).sub(e).normalize(),A4.copy(this.origin).sub(Moe);const i=e.distanceTo(n)*.5,a=-this.direction.dot(mB),l=A4.dot(this.direction),s=-A4.dot(mB),c=A4.lengthSq(),u=Math.abs(1-a*a);let d,f,p,g;if(u>0)if(d=a*s-l,f=a*l-s,g=i*u,d>=0)if(f>=-g)if(f<=g){const y=1/u;d*=y,f*=y,p=d*(d+a*f+2*l)+f*(a*d+f+2*s)+c}else f=i,d=Math.max(0,-(a*f+l)),p=-d*d+f*(f+2*s)+c;else f=-i,d=Math.max(0,-(a*f+l)),p=-d*d+f*(f+2*s)+c;else f<=-g?(d=Math.max(0,-(-a*i+l)),f=d>0?-i:Math.min(Math.max(-i,-s),i),p=-d*d+f*(f+2*s)+c):f<=g?(d=0,f=Math.min(Math.max(-i,-s),i),p=f*(f+2*s)+c):(d=Math.max(0,-(a*i+l)),f=d>0?i:Math.min(Math.max(-i,-s),i),p=-d*d+f*(f+2*s)+c);else f=a>0?-i:i,d=Math.max(0,-(a*f+l)),p=-d*d+f*(f+2*s)+c;return o&&o.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(Moe).addScaledVector(mB,f),p}intersectSphere(e,n){Q3.subVectors(e.center,this.origin);const o=Q3.dot(this.direction),r=Q3.dot(Q3)-o*o,i=e.radius*e.radius;if(r>i)return null;const a=Math.sqrt(i-r),l=o-a,s=o+a;return s<0?null:l<0?this.at(s,n):this.at(l,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const o=-(this.origin.dot(e.normal)+e.constant)/n;return o>=0?o:null}intersectPlane(e,n){const o=this.distanceToPlane(e);return o===null?null:this.at(o,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let o,r,i,a,l,s;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(o=(e.min.x-f.x)*c,r=(e.max.x-f.x)*c):(o=(e.max.x-f.x)*c,r=(e.min.x-f.x)*c),u>=0?(i=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(i=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),o>a||i>r||((i>o||isNaN(o))&&(o=i),(a=0?(l=(e.min.z-f.z)*d,s=(e.max.z-f.z)*d):(l=(e.max.z-f.z)*d,s=(e.min.z-f.z)*d),o>s||l>r)||((l>o||o!==o)&&(o=l),(s=0?o:r,n)}intersectsBox(e){return this.intersectBox(e,Q3)!==null}intersectTriangle(e,n,o,r,i){Ioe.subVectors(n,e),yB.subVectors(o,e),zoe.crossVectors(Ioe,yB);let a=this.direction.dot(zoe),l;if(a>0){if(r)return null;l=1}else if(a<0)l=-1,a=-a;else return null;A4.subVectors(this.origin,e);const s=l*this.direction.dot(yB.crossVectors(A4,yB));if(s<0)return null;const c=l*this.direction.dot(Ioe.cross(A4));if(c<0||s+c>a)return null;const u=-l*A4.dot(zoe);return u<0?null:this.at(u/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Ji{constructor(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y,w){Ji.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y,w)}set(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y,w){const b=this.elements;return b[0]=e,b[4]=n,b[8]=o,b[12]=r,b[1]=i,b[5]=a,b[9]=l,b[13]=s,b[2]=c,b[6]=u,b[10]=d,b[14]=f,b[3]=p,b[7]=g,b[11]=y,b[15]=w,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 Ji().fromArray(this.elements)}copy(e){const n=this.elements,o=e.elements;return n[0]=o[0],n[1]=o[1],n[2]=o[2],n[3]=o[3],n[4]=o[4],n[5]=o[5],n[6]=o[6],n[7]=o[7],n[8]=o[8],n[9]=o[9],n[10]=o[10],n[11]=o[11],n[12]=o[12],n[13]=o[13],n[14]=o[14],n[15]=o[15],this}copyPosition(e){const n=this.elements,o=e.elements;return n[12]=o[12],n[13]=o[13],n[14]=o[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,o){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),o.setFromMatrixColumn(this,2),this}makeBasis(e,n,o){return this.set(e.x,n.x,o.x,0,e.y,n.y,o.y,0,e.z,n.z,o.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,o=e.elements,r=1/iT.setFromMatrixColumn(e,0).length(),i=1/iT.setFromMatrixColumn(e,1).length(),a=1/iT.setFromMatrixColumn(e,2).length();return n[0]=o[0]*r,n[1]=o[1]*r,n[2]=o[2]*r,n[3]=0,n[4]=o[4]*i,n[5]=o[5]*i,n[6]=o[6]*i,n[7]=0,n[8]=o[8]*a,n[9]=o[9]*a,n[10]=o[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,o=e.x,r=e.y,i=e.z,a=Math.cos(o),l=Math.sin(o),s=Math.cos(r),c=Math.sin(r),u=Math.cos(i),d=Math.sin(i);if(e.order==="XYZ"){const f=a*u,p=a*d,g=l*u,y=l*d;n[0]=s*u,n[4]=-s*d,n[8]=c,n[1]=p+g*c,n[5]=f-y*c,n[9]=-l*s,n[2]=y-f*c,n[6]=g+p*c,n[10]=a*s}else if(e.order==="YXZ"){const f=s*u,p=s*d,g=c*u,y=c*d;n[0]=f+y*l,n[4]=g*l-p,n[8]=a*c,n[1]=a*d,n[5]=a*u,n[9]=-l,n[2]=p*l-g,n[6]=y+f*l,n[10]=a*s}else if(e.order==="ZXY"){const f=s*u,p=s*d,g=c*u,y=c*d;n[0]=f-y*l,n[4]=-a*d,n[8]=g+p*l,n[1]=p+g*l,n[5]=a*u,n[9]=y-f*l,n[2]=-a*c,n[6]=l,n[10]=a*s}else if(e.order==="ZYX"){const f=a*u,p=a*d,g=l*u,y=l*d;n[0]=s*u,n[4]=g*c-p,n[8]=f*c+y,n[1]=s*d,n[5]=y*c+f,n[9]=p*c-g,n[2]=-c,n[6]=l*s,n[10]=a*s}else if(e.order==="YZX"){const f=a*s,p=a*c,g=l*s,y=l*c;n[0]=s*u,n[4]=y-f*d,n[8]=g*d+p,n[1]=d,n[5]=a*u,n[9]=-l*u,n[2]=-c*u,n[6]=p*d+g,n[10]=f-y*d}else if(e.order==="XZY"){const f=a*s,p=a*c,g=l*s,y=l*c;n[0]=s*u,n[4]=-d,n[8]=c*u,n[1]=f*d+y,n[5]=a*u,n[9]=p*d-g,n[2]=g*d-p,n[6]=l*u,n[10]=y*d+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Y1t,e,O1t)}lookAt(e,n,o){const r=this.elements;return k1.subVectors(e,n),k1.lengthSq()===0&&(k1.z=1),k1.normalize(),w4.crossVectors(o,k1),w4.lengthSq()===0&&(Math.abs(o.z)===1?k1.x+=1e-4:k1.z+=1e-4,k1.normalize(),w4.crossVectors(o,k1)),w4.normalize(),AB.crossVectors(k1,w4),r[0]=w4.x,r[4]=AB.x,r[8]=k1.x,r[1]=w4.y,r[5]=AB.y,r[9]=k1.y,r[2]=w4.z,r[6]=AB.z,r[10]=k1.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const o=e.elements,r=n.elements,i=this.elements,a=o[0],l=o[4],s=o[8],c=o[12],u=o[1],d=o[5],f=o[9],p=o[13],g=o[2],y=o[6],w=o[10],b=o[14],C=o[3],P=o[7],v=o[11],T=o[15],A=r[0],x=r[4],S=r[8],R=r[12],M=r[1],D=r[5],E=r[9],W=r[13],j=r[2],L=r[6],k=r[10],N=r[14],F=r[3],U=r[7],O=r[11],B=r[15];return i[0]=a*A+l*M+s*j+c*F,i[4]=a*x+l*D+s*L+c*U,i[8]=a*S+l*E+s*k+c*O,i[12]=a*R+l*W+s*N+c*B,i[1]=u*A+d*M+f*j+p*F,i[5]=u*x+d*D+f*L+p*U,i[9]=u*S+d*E+f*k+p*O,i[13]=u*R+d*W+f*N+p*B,i[2]=g*A+y*M+w*j+b*F,i[6]=g*x+y*D+w*L+b*U,i[10]=g*S+y*E+w*k+b*O,i[14]=g*R+y*W+w*N+b*B,i[3]=C*A+P*M+v*j+T*F,i[7]=C*x+P*D+v*L+T*U,i[11]=C*S+P*E+v*k+T*O,i[15]=C*R+P*W+v*N+T*B,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],o=e[4],r=e[8],i=e[12],a=e[1],l=e[5],s=e[9],c=e[13],u=e[2],d=e[6],f=e[10],p=e[14],g=e[3],y=e[7],w=e[11],b=e[15];return g*(+i*s*d-r*c*d-i*l*f+o*c*f+r*l*p-o*s*p)+y*(+n*s*p-n*c*f+i*a*f-r*a*p+r*c*u-i*s*u)+w*(+n*c*d-n*l*p-i*a*d+o*a*p+i*l*u-o*c*u)+b*(-r*l*u-n*s*d+n*l*f+r*a*d-o*a*f+o*s*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,o){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=o),this}invert(){const e=this.elements,n=e[0],o=e[1],r=e[2],i=e[3],a=e[4],l=e[5],s=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],g=e[12],y=e[13],w=e[14],b=e[15],C=d*w*c-y*f*c+y*s*p-l*w*p-d*s*b+l*f*b,P=g*f*c-u*w*c-g*s*p+a*w*p+u*s*b-a*f*b,v=u*y*c-g*d*c+g*l*p-a*y*p-u*l*b+a*d*b,T=g*d*s-u*y*s-g*l*f+a*y*f+u*l*w-a*d*w,A=n*C+o*P+r*v+i*T;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const x=1/A;return e[0]=C*x,e[1]=(y*f*i-d*w*i-y*r*p+o*w*p+d*r*b-o*f*b)*x,e[2]=(l*w*i-y*s*i+y*r*c-o*w*c-l*r*b+o*s*b)*x,e[3]=(d*s*i-l*f*i-d*r*c+o*f*c+l*r*p-o*s*p)*x,e[4]=P*x,e[5]=(u*w*i-g*f*i+g*r*p-n*w*p-u*r*b+n*f*b)*x,e[6]=(g*s*i-a*w*i-g*r*c+n*w*c+a*r*b-n*s*b)*x,e[7]=(a*f*i-u*s*i+u*r*c-n*f*c-a*r*p+n*s*p)*x,e[8]=v*x,e[9]=(g*d*i-u*y*i-g*o*p+n*y*p+u*o*b-n*d*b)*x,e[10]=(a*y*i-g*l*i+g*o*c-n*y*c-a*o*b+n*l*b)*x,e[11]=(u*l*i-a*d*i-u*o*c+n*d*c+a*o*p-n*l*p)*x,e[12]=T*x,e[13]=(u*y*r-g*d*r+g*o*f-n*y*f-u*o*w+n*d*w)*x,e[14]=(g*l*r-a*y*r-g*o*s+n*y*s+a*o*w-n*l*w)*x,e[15]=(a*d*r-u*l*r+u*o*s-n*d*s-a*o*f+n*l*f)*x,this}scale(e){const n=this.elements,o=e.x,r=e.y,i=e.z;return n[0]*=o,n[4]*=r,n[8]*=i,n[1]*=o,n[5]*=r,n[9]*=i,n[2]*=o,n[6]*=r,n[10]*=i,n[3]*=o,n[7]*=r,n[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],o=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,o,r))}makeTranslation(e,n,o){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,o,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),o=Math.sin(e);return this.set(1,0,0,0,0,n,-o,0,0,o,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),o=Math.sin(e);return this.set(n,0,o,0,0,1,0,0,-o,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),o=Math.sin(e);return this.set(n,-o,0,0,o,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const o=Math.cos(n),r=Math.sin(n),i=1-o,a=e.x,l=e.y,s=e.z,c=i*a,u=i*l;return this.set(c*a+o,c*l-r*s,c*s+r*l,0,c*l+r*s,u*l+o,u*s-r*a,0,c*s-r*l,u*s+r*a,i*s*s+o,0,0,0,0,1),this}makeScale(e,n,o){return this.set(e,0,0,0,0,n,0,0,0,0,o,0,0,0,0,1),this}makeShear(e,n,o,r,i,a){return this.set(1,o,i,0,e,1,a,0,n,r,1,0,0,0,0,1),this}compose(e,n,o){const r=this.elements,i=n._x,a=n._y,l=n._z,s=n._w,c=i+i,u=a+a,d=l+l,f=i*c,p=i*u,g=i*d,y=a*u,w=a*d,b=l*d,C=s*c,P=s*u,v=s*d,T=o.x,A=o.y,x=o.z;return r[0]=(1-(y+b))*T,r[1]=(p+v)*T,r[2]=(g-P)*T,r[3]=0,r[4]=(p-v)*A,r[5]=(1-(f+b))*A,r[6]=(w+C)*A,r[7]=0,r[8]=(g+P)*x,r[9]=(w-C)*x,r[10]=(1-(f+y))*x,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,o){const r=this.elements;let i=iT.set(r[0],r[1],r[2]).length();const a=iT.set(r[4],r[5],r[6]).length(),l=iT.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Xy.copy(this);const c=1/i,u=1/a,d=1/l;return Xy.elements[0]*=c,Xy.elements[1]*=c,Xy.elements[2]*=c,Xy.elements[4]*=u,Xy.elements[5]*=u,Xy.elements[6]*=u,Xy.elements[8]*=d,Xy.elements[9]*=d,Xy.elements[10]*=d,n.setFromRotationMatrix(Xy),o.x=i,o.y=a,o.z=l,this}makePerspective(e,n,o,r,i,a,l=g9){const s=this.elements,c=2*i/(n-e),u=2*i/(o-r),d=(n+e)/(n-e),f=(o+r)/(o-r);let p,g;if(l===g9)p=-(a+i)/(a-i),g=-2*a*i/(a-i);else if(l===EF)p=-a/(a-i),g=-a*i/(a-i);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);return s[0]=c,s[4]=0,s[8]=d,s[12]=0,s[1]=0,s[5]=u,s[9]=f,s[13]=0,s[2]=0,s[6]=0,s[10]=p,s[14]=g,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,n,o,r,i,a,l=g9){const s=this.elements,c=1/(n-e),u=1/(o-r),d=1/(a-i),f=(n+e)*c,p=(o+r)*u;let g,y;if(l===g9)g=(a+i)*d,y=-2*d;else if(l===EF)g=i*d,y=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);return s[0]=2*c,s[4]=0,s[8]=0,s[12]=-f,s[1]=0,s[5]=2*u,s[9]=0,s[13]=-p,s[2]=0,s[6]=0,s[10]=y,s[14]=-g,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){const n=this.elements,o=e.elements;for(let r=0;r<16;r++)if(n[r]!==o[r])return!1;return!0}fromArray(e,n=0){for(let o=0;o<16;o++)this.elements[o]=e[o+n];return this}toArray(e=[],n=0){const o=this.elements;return e[n]=o[0],e[n+1]=o[1],e[n+2]=o[2],e[n+3]=o[3],e[n+4]=o[4],e[n+5]=o[5],e[n+6]=o[6],e[n+7]=o[7],e[n+8]=o[8],e[n+9]=o[9],e[n+10]=o[10],e[n+11]=o[11],e[n+12]=o[12],e[n+13]=o[13],e[n+14]=o[14],e[n+15]=o[15],e}}const iT=new ie,Xy=new Ji,Y1t=new ie(0,0,0),O1t=new ie(1,1,1),w4=new ie,AB=new ie,k1=new ie,g4e=new Ji,m4e=new bs;class nn{constructor(e=0,n=0,o=0,r=nn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=o,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,o,r=this._order){return this._x=e,this._y=n,this._z=o,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,o=!0){const r=e.elements,i=r[0],a=r[4],l=r[8],s=r[1],c=r[5],u=r[9],d=r[2],f=r[6],p=r[10];switch(n){case"XYZ":this._y=Math.asin(h0(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-h0(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(l,p),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-d,i),this._z=0);break;case"ZXY":this._x=Math.asin(h0(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-h0(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(h0(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,i)):(this._x=0,this._y=Math.atan2(l,p));break;case"XZY":this._z=Math.asin(-h0(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(l,i)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,o===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,o){return g4e.makeRotationFromQuaternion(e),this.setFromRotationMatrix(g4e,n,o)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return m4e.setFromEuler(this),this.setFromQuaternion(m4e,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}nn.DEFAULT_ORDER="XYZ";class lx{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let o=0;o0&&(o=o.concat(a))}return o}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(yz,e,V1t),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(yz,G1t,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let o=0,r=n.length;o0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON()));function i(l,s){return l[s.uuid]===void 0&&(l[s.uuid]=s.toJSON(e)),s.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){const s=l.shapes;if(Array.isArray(s))for(let c=0,u=s.length;c0){r.children=[];for(let l=0;l0){r.animations=[];for(let l=0;l0&&(o.geometries=l),s.length>0&&(o.materials=s),c.length>0&&(o.textures=c),u.length>0&&(o.images=u),d.length>0&&(o.shapes=d),f.length>0&&(o.skeletons=f),p.length>0&&(o.animations=p),g.length>0&&(o.nodes=g)}return o.object=r,o;function a(l){const s=[];for(const c in l){const u=l[c];delete u.metadata,s.push(u)}return s}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let o=0;o0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,n,o,r,i){Jy.subVectors(r,n),e6.subVectors(o,n),Doe.subVectors(e,n);const a=Jy.dot(Jy),l=Jy.dot(e6),s=Jy.dot(Doe),c=e6.dot(e6),u=e6.dot(Doe),d=a*c-l*l;if(d===0)return i.set(-2,-1,-1);const f=1/d,p=(c*s-l*u)*f,g=(a*u-l*s)*f;return i.set(1-p-g,g,p)}static containsPoint(e,n,o,r){return this.getBarycoord(e,n,o,r,t6),t6.x>=0&&t6.y>=0&&t6.x+t6.y<=1}static getUV(e,n,o,r,i,a,l,s){return vB===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),vB=!0),this.getInterpolation(e,n,o,r,i,a,l,s)}static getInterpolation(e,n,o,r,i,a,l,s){return this.getBarycoord(e,n,o,r,t6),s.setScalar(0),s.addScaledVector(i,t6.x),s.addScaledVector(a,t6.y),s.addScaledVector(l,t6.z),s}static isFrontFacing(e,n,o,r){return Jy.subVectors(o,n),e6.subVectors(e,n),Jy.cross(e6).dot(r)<0}set(e,n,o){return this.a.copy(e),this.b.copy(n),this.c.copy(o),this}setFromPointsAndIndices(e,n,o,r){return this.a.copy(e[n]),this.b.copy(e[o]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,o,r){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,o),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Jy.subVectors(this.c,this.b),e6.subVectors(this.a,this.b),Jy.cross(e6).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ah.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return ah.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,o,r,i){return vB===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),vB=!0),ah.getInterpolation(e,this.a,this.b,this.c,n,o,r,i)}getInterpolation(e,n,o,r,i){return ah.getInterpolation(e,this.a,this.b,this.c,n,o,r,i)}containsPoint(e){return ah.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ah.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const o=this.a,r=this.b,i=this.c;let a,l;lT.subVectors(r,o),sT.subVectors(i,o),Eoe.subVectors(e,o);const s=lT.dot(Eoe),c=sT.dot(Eoe);if(s<=0&&c<=0)return n.copy(o);Foe.subVectors(e,r);const u=lT.dot(Foe),d=sT.dot(Foe);if(u>=0&&d<=u)return n.copy(r);const f=s*d-u*c;if(f<=0&&s>=0&&u<=0)return a=s/(s-u),n.copy(o).addScaledVector(lT,a);koe.subVectors(e,i);const p=lT.dot(koe),g=sT.dot(koe);if(g>=0&&p<=g)return n.copy(i);const y=p*c-s*g;if(y<=0&&c>=0&&g<=0)return l=c/(c-g),n.copy(o).addScaledVector(sT,l);const w=u*g-p*d;if(w<=0&&d-u>=0&&p-g>=0)return x4e.subVectors(i,r),l=(d-u)/(d-u+(p-g)),n.copy(r).addScaledVector(x4e,l);const b=1/(w+y+f);return a=y*b,l=f*b,n.copy(o).addScaledVector(lT,a).addScaledVector(sT,l)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const PNe={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},v4={h:0,s:0,l:0},xB={h:0,s:0,l:0};function Loe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let rr=class{constructor(e,n,o){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,o)}set(e,n,o){if(n===void 0&&o===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,n,o);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=ru){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,cs.toWorkingColorSpace(this,n),this}setRGB(e,n,o,r=cs.workingColorSpace){return this.r=e,this.g=n,this.b=o,cs.toWorkingColorSpace(this,r),this}setHSL(e,n,o,r=cs.workingColorSpace){if(e=E1e(e,1),n=h0(n,0,1),o=h0(o,0,1),n===0)this.r=this.g=this.b=o;else{const i=o<=.5?o*(1+n):o+n-o*n,a=2*o-i;this.r=Loe(a,i,e+1/3),this.g=Loe(a,i,e),this.b=Loe(a,i,e-1/3)}return cs.toWorkingColorSpace(this,r),this}setStyle(e,n=ru){function o(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i;const a=r[1],l=r[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return o(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,n);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return o(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,n);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return o(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const i=r[1],a=i.length;if(a===3)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,n);if(a===6)return this.setHex(parseInt(i,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=ru){const o=PNe[e.toLowerCase()];return o!==void 0?this.setHex(o,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=bC(e.r),this.g=bC(e.g),this.b=bC(e.b),this}copyLinearToSRGB(e){return this.r=Toe(e.r),this.g=Toe(e.g),this.b=Toe(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ru){return cs.fromWorkingColorSpace(Xf.copy(this),e),Math.round(h0(Xf.r*255,0,255))*65536+Math.round(h0(Xf.g*255,0,255))*256+Math.round(h0(Xf.b*255,0,255))}getHexString(e=ru){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=cs.workingColorSpace){cs.fromWorkingColorSpace(Xf.copy(this),n);const o=Xf.r,r=Xf.g,i=Xf.b,a=Math.max(o,r,i),l=Math.min(o,r,i);let s,c;const u=(l+a)/2;if(l===a)s=0,c=0;else{const d=a-l;switch(c=u<=.5?d/(a+l):d/(2-a-l),a){case o:s=(r-i)/d+(r0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const o=e[n];if(o===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(o):r&&r.isVector3&&o&&o.isVector3?r.copy(o):this[n]=o}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const o={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};o.uuid=this.uuid,o.type=this.type,this.name!==""&&(o.name=this.name),this.color&&this.color.isColor&&(o.color=this.color.getHex()),this.roughness!==void 0&&(o.roughness=this.roughness),this.metalness!==void 0&&(o.metalness=this.metalness),this.sheen!==void 0&&(o.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(o.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(o.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(o.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(o.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(o.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(o.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(o.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(o.shininess=this.shininess),this.clearcoat!==void 0&&(o.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(o.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(o.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(o.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(o.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,o.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(o.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(o.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(o.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(o.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(o.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(o.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(o.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(o.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(o.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(o.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(o.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(o.lightMap=this.lightMap.toJSON(e).uuid,o.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(o.aoMap=this.aoMap.toJSON(e).uuid,o.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(o.bumpMap=this.bumpMap.toJSON(e).uuid,o.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(o.normalMap=this.normalMap.toJSON(e).uuid,o.normalMapType=this.normalMapType,o.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(o.displacementMap=this.displacementMap.toJSON(e).uuid,o.displacementScale=this.displacementScale,o.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(o.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(o.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(o.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(o.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(o.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(o.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(o.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(o.combine=this.combine)),this.envMapIntensity!==void 0&&(o.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(o.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(o.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(o.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(o.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(o.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(o.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(o.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(o.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(o.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(o.size=this.size),this.shadowSide!==null&&(o.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(o.sizeAttenuation=this.sizeAttenuation),this.blending!==ix&&(o.blending=this.blending),this.side!==Ra&&(o.side=this.side),this.vertexColors===!0&&(o.vertexColors=!0),this.opacity<1&&(o.opacity=this.opacity),this.transparent===!0&&(o.transparent=!0),this.blendSrc!==$V&&(o.blendSrc=this.blendSrc),this.blendDst!==QV&&(o.blendDst=this.blendDst),this.blendEquation!==n8&&(o.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(o.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(o.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(o.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(o.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(o.blendAlpha=this.blendAlpha),this.depthFunc!==bF&&(o.depthFunc=this.depthFunc),this.depthTest===!1&&(o.depthTest=this.depthTest),this.depthWrite===!1&&(o.depthWrite=this.depthWrite),this.colorWrite===!1&&(o.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(o.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==mce&&(o.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(o.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(o.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==sv&&(o.stencilFail=this.stencilFail),this.stencilZFail!==sv&&(o.stencilZFail=this.stencilZFail),this.stencilZPass!==sv&&(o.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(o.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(o.rotation=this.rotation),this.polygonOffset===!0&&(o.polygonOffset=!0),this.polygonOffsetFactor!==0&&(o.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(o.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(o.linewidth=this.linewidth),this.dashSize!==void 0&&(o.dashSize=this.dashSize),this.gapSize!==void 0&&(o.gapSize=this.gapSize),this.scale!==void 0&&(o.scale=this.scale),this.dithering===!0&&(o.dithering=!0),this.alphaTest>0&&(o.alphaTest=this.alphaTest),this.alphaHash===!0&&(o.alphaHash=!0),this.alphaToCoverage===!0&&(o.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(o.premultipliedAlpha=!0),this.forceSinglePass===!0&&(o.forceSinglePass=!0),this.wireframe===!0&&(o.wireframe=!0),this.wireframeLinewidth>1&&(o.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(o.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(o.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(o.flatShading=!0),this.visible===!1&&(o.visible=!1),this.toneMapped===!1&&(o.toneMapped=!1),this.fog===!1&&(o.fog=!1),Object.keys(this.userData).length>0&&(o.userData=this.userData);function r(i){const a=[];for(const l in i){const s=i[l];delete s.metadata,a.push(s)}return a}if(n){const i=r(e.textures),a=r(e.images);i.length>0&&(o.textures=i),a.length>0&&(o.images=a)}return o}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let o=null;if(n!==null){const r=n.length;o=new Array(r);for(let i=0;i!==r;++i)o[i]=n[i].clone()}return this.clippingPlanes=o,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 e3 extends Pf{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new rr(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=$L,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 w6=q1t();function q1t(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),o=new Uint32Array(512),r=new Uint32Array(512);for(let s=0;s<256;++s){const c=s-127;c<-27?(o[s]=0,o[s|256]=32768,r[s]=24,r[s|256]=24):c<-14?(o[s]=1024>>-c-14,o[s|256]=1024>>-c-14|32768,r[s]=-c-1,r[s|256]=-c-1):c<=15?(o[s]=c+15<<10,o[s|256]=c+15<<10|32768,r[s]=13,r[s|256]=13):c<128?(o[s]=31744,o[s|256]=64512,r[s]=24,r[s|256]=24):(o[s]=31744,o[s|256]=64512,r[s]=13,r[s|256]=13)}const i=new Uint32Array(2048),a=new Uint32Array(64),l=new Uint32Array(64);for(let s=1;s<1024;++s){let c=s<<13,u=0;for(;!(c&8388608);)c<<=1,u-=8388608;c&=-8388609,u+=947912704,i[s]=c|u}for(let s=1024;s<2048;++s)i[s]=939524096+(s-1024<<13);for(let s=1;s<31;++s)a[s]=s<<23;a[31]=1199570944,a[32]=2147483648;for(let s=33;s<63;++s)a[s]=2147483648+(s-32<<23);a[63]=3347054592;for(let s=1;s<64;++s)s!==32&&(l[s]=1024);return{floatView:e,uint32View:n,baseTable:o,shiftTable:r,mantissaTable:i,exponentTable:a,offsetTable:l}}function Dp(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=h0(t,-65504,65504),w6.floatView[0]=t;const e=w6.uint32View[0],n=e>>23&511;return w6.baseTable[n]+((e&8388607)>>w6.shiftTable[n])}function TD(t){const e=t>>10;return w6.uint32View[0]=w6.mantissaTable[w6.offsetTable[e]+(t&1023)]+w6.exponentTable[e],w6.floatView[0]}const $1t={toHalfFloat:Dp,fromHalfFloat:TD},eu=new ie,bB=new Xt;class nl{constructor(e,n,o=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=o,this.usage=DF,this.updateRange={offset:0,count:-1},this.gpuType=v2,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.gpuType=e.gpuType,this}copyAt(e,n,o){e*=this.itemSize,o*=n.itemSize;for(let r=0,i=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const s=this.parameters;for(const c in s)s[c]!==void 0&&(e[c]=s[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const o=this.attributes;for(const s in o){const c=o[s];e.data.attributes[s]=c.toJSON(e.data)}const r={};let i=!1;for(const s in this.morphAttributes){const c=this.morphAttributes[s],u=[];for(let d=0,f=c.length;d0&&(r[s]=u,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const l=this.boundingSphere;return l!==null&&(e.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const o=e.index;o!==null&&this.setIndex(o.clone(n));const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(n))}const i=e.morphAttributes;for(const c in i){const u=[],d=i[c];for(let f=0,p=d.length;f0){const r=n[o[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,a=r.length;i(e.far-e.near)**2))&&(b4e.copy(i).invert(),k7.copy(e.ray).applyMatrix4(b4e),!(o.boundingBox!==null&&k7.intersectsBox(o.boundingBox)===!1)&&this._computeIntersections(e,n,k7)))}_computeIntersections(e,n,o){let r;const i=this.geometry,a=this.material,l=i.index,s=i.attributes.position,c=i.attributes.uv,u=i.attributes.uv1,d=i.attributes.normal,f=i.groups,p=i.drawRange;if(l!==null)if(Array.isArray(a))for(let g=0,y=f.length;gn.far?null:{distance:c,point:MB.clone(),object:t}}function IB(t,e,n,o,r,i,a,l,s,c){t.getVertexPosition(l,uT),t.getVertexPosition(s,dT),t.getVertexPosition(c,fT);const u=agt(t,e,n,o,uT,dT,fT,HB);if(u){r&&(PB.fromBufferAttribute(r,l),CB.fromBufferAttribute(r,s),RB.fromBufferAttribute(r,c),u.uv=ah.getInterpolation(HB,uT,dT,fT,PB,CB,RB,new Xt)),i&&(PB.fromBufferAttribute(i,l),CB.fromBufferAttribute(i,s),RB.fromBufferAttribute(i,c),u.uv1=ah.getInterpolation(HB,uT,dT,fT,PB,CB,RB,new Xt),u.uv2=u.uv1),a&&(T4e.fromBufferAttribute(a,l),P4e.fromBufferAttribute(a,s),C4e.fromBufferAttribute(a,c),u.normal=ah.getInterpolation(HB,uT,dT,fT,T4e,P4e,C4e,new ie),u.normal.dot(o.direction)>0&&u.normal.multiplyScalar(-1));const d={a:l,b:s,c,normal:new ie,materialIndex:0};ah.getNormal(uT,dT,fT,d.normal),u.face=d}return u}class t3 extends Ni{constructor(e=1,n=1,o=1,r=1,i=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:o,widthSegments:r,heightSegments:i,depthSegments:a};const l=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);const s=[],c=[],u=[],d=[];let f=0,p=0;g("z","y","x",-1,-1,o,n,e,a,i,0),g("z","y","x",1,-1,o,n,-e,a,i,1),g("x","z","y",1,1,e,o,n,r,a,2),g("x","z","y",1,-1,e,o,-n,r,a,3),g("x","y","z",1,-1,e,n,o,r,i,4),g("x","y","z",-1,-1,e,n,-o,r,i,5),this.setIndex(s),this.setAttribute("position",new gr(c,3)),this.setAttribute("normal",new gr(u,3)),this.setAttribute("uv",new gr(d,2));function g(y,w,b,C,P,v,T,A,x,S,R){const M=v/x,D=T/S,E=v/2,W=T/2,j=A/2,L=x+1,k=S+1;let N=0,F=0;const U=new ie;for(let O=0;O0?1:-1,u.push(U.x,U.y,U.z),d.push(_/x),d.push(1-O/S),N+=1}}for(let O=0;O>8&255]+Gf[t>>16&255]+Gf[t>>24&255]+"-"+Gf[e&255]+Gf[e>>8&255]+"-"+Gf[e>>16&15|64]+Gf[e>>24&255]+"-"+Gf[n&63|128]+Gf[n>>8&255]+"-"+Gf[n>>16&255]+Gf[n>>24&255]+Gf[o&255]+Gf[o>>8&255]+Gf[o>>16&255]+Gf[o>>24&255]).toLowerCase()}function h0(t,e,n){return Math.max(e,Math.min(n,t))}function E1e(t,e){return(t%e+e)%e}function x1t(t,e,n,o,r){return o+(t-e)*(r-o)/(n-e)}function b1t(t,e,n){return t!==e?(n-t)/(e-t):0}function dE(t,e,n){return(1-n)*t+n*e}function S1t(t,e,n,o){return dE(t,e,1-Math.exp(-n*o))}function T1t(t,e=1){return e-Math.abs(E1e(t,e*2)-e)}function P1t(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function C1t(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function R1t(t,e){return t+Math.floor(Math.random()*(e-t+1))}function H1t(t,e){return t+Math.random()*(e-t)}function M1t(t){return t*(.5-Math.random())}function I1t(t){t!==void 0&&(d4e=t);let e=d4e+=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 z1t(t){return t*ax}function D1t(t){return t*oR}function Ace(t){return(t&t-1)===0&&t!==0}function xNe(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function nG(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function E1t(t,e,n,o,r){const i=Math.cos,a=Math.sin,l=i(n/2),s=a(n/2),c=i((e+o)/2),u=a((e+o)/2),d=i((e-o)/2),f=a((e-o)/2),p=i((o-e)/2),g=a((o-e)/2);switch(r){case"XYX":t.set(l*u,s*d,s*f,l*c);break;case"YZY":t.set(s*f,l*u,s*d,l*c);break;case"ZXZ":t.set(s*d,s*f,l*u,l*c);break;case"XZX":t.set(l*u,s*g,s*p,l*c);break;case"YXY":t.set(s*p,l*u,s*g,l*c);break;case"ZYZ":t.set(s*g,s*p,l*u,l*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function jp(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Aa(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const bNe={DEG2RAD:ax,RAD2DEG:oR,generateUUID:Tg,clamp:h0,euclideanModulo:E1e,mapLinear:x1t,inverseLerp:b1t,lerp:dE,damp:S1t,pingpong:T1t,smoothstep:P1t,smootherstep:C1t,randInt:R1t,randFloat:H1t,randFloatSpread:M1t,seededRandom:I1t,degToRad:z1t,radToDeg:D1t,isPowerOfTwo:Ace,ceilPowerOfTwo:xNe,floorPowerOfTwo:nG,setQuaternionFromProperEuler:E1t,normalize:Aa,denormalize:jp};class Xt{constructor(e=0,n=0){Xt.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,o=this.y,r=e.elements;return this.x=r[0]*n+r[3]*o+r[6],this.y=r[1]*n+r[4]*o+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const o=this.length();return this.divideScalar(o||1).multiplyScalar(Math.max(e,Math.min(n,o)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const o=this.dot(e)/n;return Math.acos(h0(o,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,o=this.y-e.y;return n*n+o*o}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,o){return this.x=e.x+(n.x-e.x)*o,this.y=e.y+(n.y-e.y)*o,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const o=Math.cos(n),r=Math.sin(n),i=this.x-e.x,a=this.y-e.y;return this.x=i*o-a*r+e.x,this.y=i*r+a*o+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ga{constructor(e,n,o,r,i,a,l,s,c){ga.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,o,r,i,a,l,s,c)}set(e,n,o,r,i,a,l,s,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=l,u[3]=n,u[4]=i,u[5]=s,u[6]=o,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,o=e.elements;return n[0]=o[0],n[1]=o[1],n[2]=o[2],n[3]=o[3],n[4]=o[4],n[5]=o[5],n[6]=o[6],n[7]=o[7],n[8]=o[8],this}extractBasis(e,n,o){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),o.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const o=e.elements,r=n.elements,i=this.elements,a=o[0],l=o[3],s=o[6],c=o[1],u=o[4],d=o[7],f=o[2],p=o[5],g=o[8],y=r[0],w=r[3],b=r[6],C=r[1],P=r[4],v=r[7],T=r[2],A=r[5],x=r[8];return i[0]=a*y+l*C+s*T,i[3]=a*w+l*P+s*A,i[6]=a*b+l*v+s*x,i[1]=c*y+u*C+d*T,i[4]=c*w+u*P+d*A,i[7]=c*b+u*v+d*x,i[2]=f*y+p*C+g*T,i[5]=f*w+p*P+g*A,i[8]=f*b+p*v+g*x,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],o=e[1],r=e[2],i=e[3],a=e[4],l=e[5],s=e[6],c=e[7],u=e[8];return n*a*u-n*l*c-o*i*u+o*l*s+r*i*c-r*a*s}invert(){const e=this.elements,n=e[0],o=e[1],r=e[2],i=e[3],a=e[4],l=e[5],s=e[6],c=e[7],u=e[8],d=u*a-l*c,f=l*s-u*i,p=c*i-a*s,g=n*d+o*f+r*p;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/g;return e[0]=d*y,e[1]=(r*c-u*o)*y,e[2]=(l*o-r*a)*y,e[3]=f*y,e[4]=(u*n-r*s)*y,e[5]=(r*i-l*n)*y,e[6]=p*y,e[7]=(o*s-c*n)*y,e[8]=(a*n-o*i)*y,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,o,r,i,a,l){const s=Math.cos(i),c=Math.sin(i);return this.set(o*s,o*c,-o*(s*a+c*l)+a+e,-r*c,r*s,-r*(-c*a+s*l)+l+n,0,0,1),this}scale(e,n){return this.premultiply(Soe.makeScale(e,n)),this}rotate(e){return this.premultiply(Soe.makeRotation(-e)),this}translate(e,n){return this.premultiply(Soe.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),o=Math.sin(e);return this.set(n,-o,0,o,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,o=e.elements;for(let r=0;r<9;r++)if(n[r]!==o[r])return!1;return!0}fromArray(e,n=0){for(let o=0;o<9;o++)this.elements[o]=e[o+n];return this}toArray(e=[],n=0){const o=this.elements;return e[n]=o[0],e[n+1]=o[1],e[n+2]=o[2],e[n+3]=o[3],e[n+4]=o[4],e[n+5]=o[5],e[n+6]=o[6],e[n+7]=o[7],e[n+8]=o[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Soe=new ga;function SNe(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const F1t={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function _P(t,e){return new F1t[t](e)}function FF(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function TNe(){const t=FF("canvas");return t.style.display="block",t}const f4e={};function fE(t){t in f4e||(f4e[t]=!0,console.warn(t))}const h4e=new ga().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),p4e=new ga().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),hB={[L9]:{transfer:MF,primaries:IF,toReference:t=>t,fromReference:t=>t},[ru]:{transfer:Ys,primaries:IF,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[QL]:{transfer:MF,primaries:zF,toReference:t=>t.applyMatrix3(p4e),fromReference:t=>t.applyMatrix3(h4e)},[aq]:{transfer:Ys,primaries:zF,toReference:t=>t.convertSRGBToLinear().applyMatrix3(p4e),fromReference:t=>t.applyMatrix3(h4e).convertLinearToSRGB()}},k1t=new Set([L9,QL]),cs={enabled:!0,_workingColorSpace:L9,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!k1t.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(this.enabled===!1||e===n||!e||!n)return t;const o=hB[e].toReference,r=hB[n].fromReference;return r(o(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return hB[t].primaries},getTransfer:function(t){return t===dg?MF:hB[t].transfer}};function bC(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Toe(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let tT;class F1e{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{tT===void 0&&(tT=FF("canvas")),tT.width=e.width,tT.height=e.height;const o=tT.getContext("2d");e instanceof ImageData?o.putImageData(e,0,0):o.drawImage(e,0,0,e.width,e.height),n=tT}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=FF("canvas");n.width=e.width,n.height=e.height;const o=n.getContext("2d");o.drawImage(e,0,0,e.width,e.height);const r=o.getImageData(0,0,e.width,e.height),i=r.data;for(let a=0;a0&&(o.userData=this.userData),n||(e.textures[this.uuid]=o),o}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==oq)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Hs:e.x=e.x-Math.floor(e.x);break;case dh:e.x=e.x<0?0:1;break;case PF: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 Hs:e.y=e.y-Math.floor(e.y);break;case dh:e.y=e.y<0?0:1;break;case PF: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)}get encoding(){return fE("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===ru?U8:z1e}set encoding(e){fE("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===U8?ru:dg}}Vc.DEFAULT_IMAGE=null;Vc.DEFAULT_MAPPING=oq;Vc.DEFAULT_ANISOTROPY=1;class Qa{constructor(e=0,n=0,o=0,r=1){Qa.prototype.isVector4=!0,this.x=e,this.y=n,this.z=o,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,o,r){return this.x=e,this.y=n,this.z=o,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,o=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*n+a[4]*o+a[8]*r+a[12]*i,this.y=a[1]*n+a[5]*o+a[9]*r+a[13]*i,this.z=a[2]*n+a[6]*o+a[10]*r+a[14]*i,this.w=a[3]*n+a[7]*o+a[11]*r+a[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,o,r,i;const s=e.elements,c=s[0],u=s[4],d=s[8],f=s[1],p=s[5],g=s[9],y=s[2],w=s[6],b=s[10];if(Math.abs(u-f)<.01&&Math.abs(d-y)<.01&&Math.abs(g-w)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+y)<.1&&Math.abs(g+w)<.1&&Math.abs(c+p+b-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const P=(c+1)/2,v=(p+1)/2,T=(b+1)/2,A=(u+f)/4,x=(d+y)/4,S=(g+w)/4;return P>v&&P>T?P<.01?(o=0,r=.707106781,i=.707106781):(o=Math.sqrt(P),r=A/o,i=x/o):v>T?v<.01?(o=.707106781,r=0,i=.707106781):(r=Math.sqrt(v),o=A/r,i=S/r):T<.01?(o=.707106781,r=.707106781,i=0):(i=Math.sqrt(T),o=x/i,r=S/i),this.set(o,r,i,n),this}let C=Math.sqrt((w-g)*(w-g)+(d-y)*(d-y)+(f-u)*(f-u));return Math.abs(C)<.001&&(C=1),this.x=(w-g)/C,this.y=(d-y)/C,this.z=(f-u)/C,this.w=Math.acos((c+p+b-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,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const o=this.length();return this.divideScalar(o||1).multiplyScalar(Math.max(e,Math.min(n,o)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,o){return this.x=e.x+(n.x-e.x)*o,this.y=e.y+(n.y-e.y)*o,this.z=e.z+(n.z-e.z)*o,this.w=e.w+(n.w-e.w)*o,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class PNe extends Z9{constructor(e=1,n=1,o={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new Qa(0,0,e,n),this.scissorTest=!1,this.viewport=new Qa(0,0,e,n);const r={width:e,height:n,depth:1};o.encoding!==void 0&&(fE("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),o.colorSpace=o.encoding===U8?ru:dg),o=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Gs,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},o),this.texture=new Vc(r,o.mapping,o.wrapS,o.wrapT,o.magFilter,o.minFilter,o.format,o.type,o.anisotropy,o.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=o.generateMipmaps,this.texture.internalFormat=o.internalFormat,this.depthBuffer=o.depthBuffer,this.stencilBuffer=o.stencilBuffer,this.depthTexture=o.depthTexture,this.samples=o.samples}setSize(e,n,o=1){(this.width!==e||this.height!==n||this.depth!==o)&&(this.width=e,this.height=n,this.depth=o,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=o,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},e.texture.image);return this.texture.source=new zv(n),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 $m extends PNe{constructor(e=1,n=1,o={}){super(e,n,o),this.isWebGLRenderTarget=!0}}class lq extends Vc{constructor(e=null,n=1,o=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:o,depth:r},this.magFilter=k0,this.minFilter=k0,this.wrapR=dh,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class N1t extends $m{constructor(e=1,n=1,o=1){super(e,n),this.isWebGLArrayRenderTarget=!0,this.depth=o,this.texture=new lq(null,e,n,o),this.texture.isRenderTargetTexture=!0}}class k1e extends Vc{constructor(e=null,n=1,o=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:o,depth:r},this.magFilter=k0,this.minFilter=k0,this.wrapR=dh,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class U1t extends $m{constructor(e=1,n=1,o=1){super(e,n),this.isWebGL3DRenderTarget=!0,this.depth=o,this.texture=new k1e(null,e,n,o),this.texture.isRenderTargetTexture=!0}}class j1t extends $m{constructor(e=1,n=1,o=1,r={}){super(e,n,r),this.isWebGLMultipleRenderTargets=!0;const i=this.texture;this.texture=[];for(let a=0;a=0?1:-1,P=1-b*b;if(P>Number.EPSILON){const T=Math.sqrt(P),A=Math.atan2(T,b*C);w=Math.sin(w*A)/T,l=Math.sin(l*A)/T}const v=l*C;if(s=s*w+f*v,c=c*w+p*v,u=u*w+g*v,d=d*w+y*v,w===1-l){const T=1/Math.sqrt(s*s+c*c+u*u+d*d);s*=T,c*=T,u*=T,d*=T}}e[n]=s,e[n+1]=c,e[n+2]=u,e[n+3]=d}static multiplyQuaternionsFlat(e,n,o,r,i,a){const l=o[r],s=o[r+1],c=o[r+2],u=o[r+3],d=i[a],f=i[a+1],p=i[a+2],g=i[a+3];return e[n]=l*g+u*d+s*p-c*f,e[n+1]=s*g+u*f+c*d-l*p,e[n+2]=c*g+u*p+l*f-s*d,e[n+3]=u*g-l*d-s*f-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,o,r){return this._x=e,this._y=n,this._z=o,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n){const o=e._x,r=e._y,i=e._z,a=e._order,l=Math.cos,s=Math.sin,c=l(o/2),u=l(r/2),d=l(i/2),f=s(o/2),p=s(r/2),g=s(i/2);switch(a){case"XYZ":this._x=f*u*d+c*p*g,this._y=c*p*d-f*u*g,this._z=c*u*g+f*p*d,this._w=c*u*d-f*p*g;break;case"YXZ":this._x=f*u*d+c*p*g,this._y=c*p*d-f*u*g,this._z=c*u*g-f*p*d,this._w=c*u*d+f*p*g;break;case"ZXY":this._x=f*u*d-c*p*g,this._y=c*p*d+f*u*g,this._z=c*u*g+f*p*d,this._w=c*u*d-f*p*g;break;case"ZYX":this._x=f*u*d-c*p*g,this._y=c*p*d+f*u*g,this._z=c*u*g-f*p*d,this._w=c*u*d+f*p*g;break;case"YZX":this._x=f*u*d+c*p*g,this._y=c*p*d+f*u*g,this._z=c*u*g-f*p*d,this._w=c*u*d-f*p*g;break;case"XZY":this._x=f*u*d-c*p*g,this._y=c*p*d-f*u*g,this._z=c*u*g+f*p*d,this._w=c*u*d+f*p*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const o=n/2,r=Math.sin(o);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(o),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,o=n[0],r=n[4],i=n[8],a=n[1],l=n[5],s=n[9],c=n[2],u=n[6],d=n[10],f=o+l+d;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-s)*p,this._y=(i-c)*p,this._z=(a-r)*p}else if(o>l&&o>d){const p=2*Math.sqrt(1+o-l-d);this._w=(u-s)/p,this._x=.25*p,this._y=(r+a)/p,this._z=(i+c)/p}else if(l>d){const p=2*Math.sqrt(1+l-o-d);this._w=(i-c)/p,this._x=(r+a)/p,this._y=.25*p,this._z=(s+u)/p}else{const p=2*Math.sqrt(1+d-o-l);this._w=(a-r)/p,this._x=(i+c)/p,this._y=(s+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let o=e.dot(n)+1;return oMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=o):(this._x=0,this._y=-e.z,this._z=e.y,this._w=o)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=o),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(h0(this.dot(e),-1,1)))}rotateTowards(e,n){const o=this.angleTo(e);if(o===0)return this;const r=Math.min(1,n/o);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const o=e._x,r=e._y,i=e._z,a=e._w,l=n._x,s=n._y,c=n._z,u=n._w;return this._x=o*u+a*l+r*c-i*s,this._y=r*u+a*s+i*l-o*c,this._z=i*u+a*c+o*s-r*l,this._w=a*u-o*l-r*s-i*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const o=this._x,r=this._y,i=this._z,a=this._w;let l=a*e._w+o*e._x+r*e._y+i*e._z;if(l<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,l=-l):this.copy(e),l>=1)return this._w=a,this._x=o,this._y=r,this._z=i,this;const s=1-l*l;if(s<=Number.EPSILON){const p=1-n;return this._w=p*a+n*this._w,this._x=p*o+n*this._x,this._y=p*r+n*this._y,this._z=p*i+n*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(s),u=Math.atan2(c,l),d=Math.sin((1-n)*u)/c,f=Math.sin(n*u)/c;return this._w=a*d+this._w*f,this._x=o*d+this._x*f,this._y=r*d+this._y*f,this._z=i*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,n,o){return this.copy(e).slerp(n,o)}random(){const e=Math.random(),n=Math.sqrt(1-e),o=Math.sqrt(e),r=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(n*Math.cos(r),o*Math.sin(i),o*Math.cos(i),n*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ie{constructor(e=0,n=0,o=0){ie.prototype.isVector3=!0,this.x=e,this.y=n,this.z=o}set(e,n,o){return o===void 0&&(o=this.z),this.x=e,this.y=n,this.z=o,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(g4e.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(g4e.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,o=this.y,r=this.z,i=e.elements;return this.x=i[0]*n+i[3]*o+i[6]*r,this.y=i[1]*n+i[4]*o+i[7]*r,this.z=i[2]*n+i[5]*o+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,o=this.y,r=this.z,i=e.elements,a=1/(i[3]*n+i[7]*o+i[11]*r+i[15]);return this.x=(i[0]*n+i[4]*o+i[8]*r+i[12])*a,this.y=(i[1]*n+i[5]*o+i[9]*r+i[13])*a,this.z=(i[2]*n+i[6]*o+i[10]*r+i[14])*a,this}applyQuaternion(e){const n=this.x,o=this.y,r=this.z,i=e.x,a=e.y,l=e.z,s=e.w,c=2*(a*r-l*o),u=2*(l*n-i*r),d=2*(i*o-a*n);return this.x=n+s*c+a*d-l*u,this.y=o+s*u+l*c-i*d,this.z=r+s*d+i*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,o=this.y,r=this.z,i=e.elements;return this.x=i[0]*n+i[4]*o+i[8]*r,this.y=i[1]*n+i[5]*o+i[9]*r,this.z=i[2]*n+i[6]*o+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const o=this.length();return this.divideScalar(o||1).multiplyScalar(Math.max(e,Math.min(n,o)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,o){return this.x=e.x+(n.x-e.x)*o,this.y=e.y+(n.y-e.y)*o,this.z=e.z+(n.z-e.z)*o,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const o=e.x,r=e.y,i=e.z,a=n.x,l=n.y,s=n.z;return this.x=r*s-i*l,this.y=i*a-o*s,this.z=o*l-r*a,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const o=e.dot(this)/n;return this.copy(e).multiplyScalar(o)}projectOnPlane(e){return Coe.copy(this).projectOnVector(e),this.sub(Coe)}reflect(e){return this.sub(Coe.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const o=this.dot(e)/n;return Math.acos(h0(o,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,o=this.y-e.y,r=this.z-e.z;return n*n+o*o+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,o){const r=Math.sin(n)*e;return this.x=r*Math.sin(o),this.y=Math.cos(n)*e,this.z=r*Math.cos(o),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,o){return this.x=e*Math.sin(n),this.y=o,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),o=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=o,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,o=Math.sqrt(1-e**2);return this.x=o*Math.cos(n),this.y=o*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Coe=new ie,g4e=new bs;class bf{constructor(e=new ie(1/0,1/0,1/0),n=new ie(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,o=e.length;nthis.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,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Gy),Gy.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,o;return e.normal.x>0?(n=e.normal.x*this.min.x,o=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,o=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,o+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,o+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,o+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,o+=e.normal.z*this.min.z),n<=-e.constant&&o>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(gz),gB.subVectors(this.max,gz),nT.subVectors(e.a,gz),oT.subVectors(e.b,gz),rT.subVectors(e.c,gz),m4.subVectors(oT,nT),y4.subVectors(rT,oT),E7.subVectors(nT,rT);let n=[0,-m4.z,m4.y,0,-y4.z,y4.y,0,-E7.z,E7.y,m4.z,0,-m4.x,y4.z,0,-y4.x,E7.z,0,-E7.x,-m4.y,m4.x,0,-y4.y,y4.x,0,-E7.y,E7.x,0];return!Roe(n,nT,oT,rT,gB)||(n=[1,0,0,0,1,0,0,0,1],!Roe(n,nT,oT,rT,gB))?!1:(mB.crossVectors(m4,y4),n=[mB.x,mB.y,mB.z],Roe(n,nT,oT,rT,gB))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Gy).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Gy).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:($3[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),$3[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),$3[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),$3[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),$3[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),$3[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),$3[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),$3[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints($3),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 $3=[new ie,new ie,new ie,new ie,new ie,new ie,new ie,new ie],Gy=new ie,pB=new bf,nT=new ie,oT=new ie,rT=new ie,m4=new ie,y4=new ie,E7=new ie,gz=new ie,gB=new ie,mB=new ie,F7=new ie;function Roe(t,e,n,o,r){for(let i=0,a=t.length-3;i<=a;i+=3){F7.fromArray(t,i);const l=r.x*Math.abs(F7.x)+r.y*Math.abs(F7.y)+r.z*Math.abs(F7.z),s=e.dot(F7),c=n.dot(F7),u=o.dot(F7);if(Math.max(-Math.max(s,c,u),Math.min(s,c,u))>l)return!1}return!0}const B1t=new bf,mz=new ie,Hoe=new ie;let s1=class{constructor(e=new ie,n=-1){this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const o=this.center;n!==void 0?o.copy(n):B1t.setFromPoints(e).getCenter(o);let r=0;for(let i=0,a=e.length;ithis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;mz.subVectors(e,this.center);const n=mz.lengthSq();if(n>this.radius*this.radius){const o=Math.sqrt(n),r=(o-this.radius)*.5;this.center.addScaledVector(mz,r/o),this.radius+=r}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):(Hoe.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(mz.copy(e.center).add(Hoe)),this.expandByPoint(mz.copy(e.center).sub(Hoe))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}};const Q3=new ie,Moe=new ie,yB=new ie,A4=new ie,Ioe=new ie,AB=new ie,zoe=new ie;class CH{constructor(e=new ie,n=new ie(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Q3)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const o=n.dot(this.direction);return o<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,o)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Q3.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Q3.copy(this.origin).addScaledVector(this.direction,n),Q3.distanceToSquared(e))}distanceSqToSegment(e,n,o,r){Moe.copy(e).add(n).multiplyScalar(.5),yB.copy(n).sub(e).normalize(),A4.copy(this.origin).sub(Moe);const i=e.distanceTo(n)*.5,a=-this.direction.dot(yB),l=A4.dot(this.direction),s=-A4.dot(yB),c=A4.lengthSq(),u=Math.abs(1-a*a);let d,f,p,g;if(u>0)if(d=a*s-l,f=a*l-s,g=i*u,d>=0)if(f>=-g)if(f<=g){const y=1/u;d*=y,f*=y,p=d*(d+a*f+2*l)+f*(a*d+f+2*s)+c}else f=i,d=Math.max(0,-(a*f+l)),p=-d*d+f*(f+2*s)+c;else f=-i,d=Math.max(0,-(a*f+l)),p=-d*d+f*(f+2*s)+c;else f<=-g?(d=Math.max(0,-(-a*i+l)),f=d>0?-i:Math.min(Math.max(-i,-s),i),p=-d*d+f*(f+2*s)+c):f<=g?(d=0,f=Math.min(Math.max(-i,-s),i),p=f*(f+2*s)+c):(d=Math.max(0,-(a*i+l)),f=d>0?i:Math.min(Math.max(-i,-s),i),p=-d*d+f*(f+2*s)+c);else f=a>0?-i:i,d=Math.max(0,-(a*f+l)),p=-d*d+f*(f+2*s)+c;return o&&o.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(Moe).addScaledVector(yB,f),p}intersectSphere(e,n){Q3.subVectors(e.center,this.origin);const o=Q3.dot(this.direction),r=Q3.dot(Q3)-o*o,i=e.radius*e.radius;if(r>i)return null;const a=Math.sqrt(i-r),l=o-a,s=o+a;return s<0?null:l<0?this.at(s,n):this.at(l,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const o=-(this.origin.dot(e.normal)+e.constant)/n;return o>=0?o:null}intersectPlane(e,n){const o=this.distanceToPlane(e);return o===null?null:this.at(o,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let o,r,i,a,l,s;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(o=(e.min.x-f.x)*c,r=(e.max.x-f.x)*c):(o=(e.max.x-f.x)*c,r=(e.min.x-f.x)*c),u>=0?(i=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(i=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),o>a||i>r||((i>o||isNaN(o))&&(o=i),(a=0?(l=(e.min.z-f.z)*d,s=(e.max.z-f.z)*d):(l=(e.max.z-f.z)*d,s=(e.min.z-f.z)*d),o>s||l>r)||((l>o||o!==o)&&(o=l),(s=0?o:r,n)}intersectsBox(e){return this.intersectBox(e,Q3)!==null}intersectTriangle(e,n,o,r,i){Ioe.subVectors(n,e),AB.subVectors(o,e),zoe.crossVectors(Ioe,AB);let a=this.direction.dot(zoe),l;if(a>0){if(r)return null;l=1}else if(a<0)l=-1,a=-a;else return null;A4.subVectors(this.origin,e);const s=l*this.direction.dot(AB.crossVectors(A4,AB));if(s<0)return null;const c=l*this.direction.dot(Ioe.cross(A4));if(c<0||s+c>a)return null;const u=-l*A4.dot(zoe);return u<0?null:this.at(u/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Ji{constructor(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y,w){Ji.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y,w)}set(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y,w){const b=this.elements;return b[0]=e,b[4]=n,b[8]=o,b[12]=r,b[1]=i,b[5]=a,b[9]=l,b[13]=s,b[2]=c,b[6]=u,b[10]=d,b[14]=f,b[3]=p,b[7]=g,b[11]=y,b[15]=w,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 Ji().fromArray(this.elements)}copy(e){const n=this.elements,o=e.elements;return n[0]=o[0],n[1]=o[1],n[2]=o[2],n[3]=o[3],n[4]=o[4],n[5]=o[5],n[6]=o[6],n[7]=o[7],n[8]=o[8],n[9]=o[9],n[10]=o[10],n[11]=o[11],n[12]=o[12],n[13]=o[13],n[14]=o[14],n[15]=o[15],this}copyPosition(e){const n=this.elements,o=e.elements;return n[12]=o[12],n[13]=o[13],n[14]=o[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,o){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),o.setFromMatrixColumn(this,2),this}makeBasis(e,n,o){return this.set(e.x,n.x,o.x,0,e.y,n.y,o.y,0,e.z,n.z,o.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,o=e.elements,r=1/iT.setFromMatrixColumn(e,0).length(),i=1/iT.setFromMatrixColumn(e,1).length(),a=1/iT.setFromMatrixColumn(e,2).length();return n[0]=o[0]*r,n[1]=o[1]*r,n[2]=o[2]*r,n[3]=0,n[4]=o[4]*i,n[5]=o[5]*i,n[6]=o[6]*i,n[7]=0,n[8]=o[8]*a,n[9]=o[9]*a,n[10]=o[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,o=e.x,r=e.y,i=e.z,a=Math.cos(o),l=Math.sin(o),s=Math.cos(r),c=Math.sin(r),u=Math.cos(i),d=Math.sin(i);if(e.order==="XYZ"){const f=a*u,p=a*d,g=l*u,y=l*d;n[0]=s*u,n[4]=-s*d,n[8]=c,n[1]=p+g*c,n[5]=f-y*c,n[9]=-l*s,n[2]=y-f*c,n[6]=g+p*c,n[10]=a*s}else if(e.order==="YXZ"){const f=s*u,p=s*d,g=c*u,y=c*d;n[0]=f+y*l,n[4]=g*l-p,n[8]=a*c,n[1]=a*d,n[5]=a*u,n[9]=-l,n[2]=p*l-g,n[6]=y+f*l,n[10]=a*s}else if(e.order==="ZXY"){const f=s*u,p=s*d,g=c*u,y=c*d;n[0]=f-y*l,n[4]=-a*d,n[8]=g+p*l,n[1]=p+g*l,n[5]=a*u,n[9]=y-f*l,n[2]=-a*c,n[6]=l,n[10]=a*s}else if(e.order==="ZYX"){const f=a*u,p=a*d,g=l*u,y=l*d;n[0]=s*u,n[4]=g*c-p,n[8]=f*c+y,n[1]=s*d,n[5]=y*c+f,n[9]=p*c-g,n[2]=-c,n[6]=l*s,n[10]=a*s}else if(e.order==="YZX"){const f=a*s,p=a*c,g=l*s,y=l*c;n[0]=s*u,n[4]=y-f*d,n[8]=g*d+p,n[1]=d,n[5]=a*u,n[9]=-l*u,n[2]=-c*u,n[6]=p*d+g,n[10]=f-y*d}else if(e.order==="XZY"){const f=a*s,p=a*c,g=l*s,y=l*c;n[0]=s*u,n[4]=-d,n[8]=c*u,n[1]=f*d+y,n[5]=a*u,n[9]=p*d-g,n[2]=g*d-p,n[6]=l*u,n[10]=y*d+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Y1t,e,O1t)}lookAt(e,n,o){const r=this.elements;return k1.subVectors(e,n),k1.lengthSq()===0&&(k1.z=1),k1.normalize(),w4.crossVectors(o,k1),w4.lengthSq()===0&&(Math.abs(o.z)===1?k1.x+=1e-4:k1.z+=1e-4,k1.normalize(),w4.crossVectors(o,k1)),w4.normalize(),wB.crossVectors(k1,w4),r[0]=w4.x,r[4]=wB.x,r[8]=k1.x,r[1]=w4.y,r[5]=wB.y,r[9]=k1.y,r[2]=w4.z,r[6]=wB.z,r[10]=k1.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const o=e.elements,r=n.elements,i=this.elements,a=o[0],l=o[4],s=o[8],c=o[12],u=o[1],d=o[5],f=o[9],p=o[13],g=o[2],y=o[6],w=o[10],b=o[14],C=o[3],P=o[7],v=o[11],T=o[15],A=r[0],x=r[4],S=r[8],R=r[12],M=r[1],D=r[5],E=r[9],W=r[13],j=r[2],L=r[6],k=r[10],N=r[14],F=r[3],U=r[7],O=r[11],B=r[15];return i[0]=a*A+l*M+s*j+c*F,i[4]=a*x+l*D+s*L+c*U,i[8]=a*S+l*E+s*k+c*O,i[12]=a*R+l*W+s*N+c*B,i[1]=u*A+d*M+f*j+p*F,i[5]=u*x+d*D+f*L+p*U,i[9]=u*S+d*E+f*k+p*O,i[13]=u*R+d*W+f*N+p*B,i[2]=g*A+y*M+w*j+b*F,i[6]=g*x+y*D+w*L+b*U,i[10]=g*S+y*E+w*k+b*O,i[14]=g*R+y*W+w*N+b*B,i[3]=C*A+P*M+v*j+T*F,i[7]=C*x+P*D+v*L+T*U,i[11]=C*S+P*E+v*k+T*O,i[15]=C*R+P*W+v*N+T*B,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],o=e[4],r=e[8],i=e[12],a=e[1],l=e[5],s=e[9],c=e[13],u=e[2],d=e[6],f=e[10],p=e[14],g=e[3],y=e[7],w=e[11],b=e[15];return g*(+i*s*d-r*c*d-i*l*f+o*c*f+r*l*p-o*s*p)+y*(+n*s*p-n*c*f+i*a*f-r*a*p+r*c*u-i*s*u)+w*(+n*c*d-n*l*p-i*a*d+o*a*p+i*l*u-o*c*u)+b*(-r*l*u-n*s*d+n*l*f+r*a*d-o*a*f+o*s*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,o){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=o),this}invert(){const e=this.elements,n=e[0],o=e[1],r=e[2],i=e[3],a=e[4],l=e[5],s=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],g=e[12],y=e[13],w=e[14],b=e[15],C=d*w*c-y*f*c+y*s*p-l*w*p-d*s*b+l*f*b,P=g*f*c-u*w*c-g*s*p+a*w*p+u*s*b-a*f*b,v=u*y*c-g*d*c+g*l*p-a*y*p-u*l*b+a*d*b,T=g*d*s-u*y*s-g*l*f+a*y*f+u*l*w-a*d*w,A=n*C+o*P+r*v+i*T;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const x=1/A;return e[0]=C*x,e[1]=(y*f*i-d*w*i-y*r*p+o*w*p+d*r*b-o*f*b)*x,e[2]=(l*w*i-y*s*i+y*r*c-o*w*c-l*r*b+o*s*b)*x,e[3]=(d*s*i-l*f*i-d*r*c+o*f*c+l*r*p-o*s*p)*x,e[4]=P*x,e[5]=(u*w*i-g*f*i+g*r*p-n*w*p-u*r*b+n*f*b)*x,e[6]=(g*s*i-a*w*i-g*r*c+n*w*c+a*r*b-n*s*b)*x,e[7]=(a*f*i-u*s*i+u*r*c-n*f*c-a*r*p+n*s*p)*x,e[8]=v*x,e[9]=(g*d*i-u*y*i-g*o*p+n*y*p+u*o*b-n*d*b)*x,e[10]=(a*y*i-g*l*i+g*o*c-n*y*c-a*o*b+n*l*b)*x,e[11]=(u*l*i-a*d*i-u*o*c+n*d*c+a*o*p-n*l*p)*x,e[12]=T*x,e[13]=(u*y*r-g*d*r+g*o*f-n*y*f-u*o*w+n*d*w)*x,e[14]=(g*l*r-a*y*r-g*o*s+n*y*s+a*o*w-n*l*w)*x,e[15]=(a*d*r-u*l*r+u*o*s-n*d*s-a*o*f+n*l*f)*x,this}scale(e){const n=this.elements,o=e.x,r=e.y,i=e.z;return n[0]*=o,n[4]*=r,n[8]*=i,n[1]*=o,n[5]*=r,n[9]*=i,n[2]*=o,n[6]*=r,n[10]*=i,n[3]*=o,n[7]*=r,n[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],o=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,o,r))}makeTranslation(e,n,o){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,o,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),o=Math.sin(e);return this.set(1,0,0,0,0,n,-o,0,0,o,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),o=Math.sin(e);return this.set(n,0,o,0,0,1,0,0,-o,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),o=Math.sin(e);return this.set(n,-o,0,0,o,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const o=Math.cos(n),r=Math.sin(n),i=1-o,a=e.x,l=e.y,s=e.z,c=i*a,u=i*l;return this.set(c*a+o,c*l-r*s,c*s+r*l,0,c*l+r*s,u*l+o,u*s-r*a,0,c*s-r*l,u*s+r*a,i*s*s+o,0,0,0,0,1),this}makeScale(e,n,o){return this.set(e,0,0,0,0,n,0,0,0,0,o,0,0,0,0,1),this}makeShear(e,n,o,r,i,a){return this.set(1,o,i,0,e,1,a,0,n,r,1,0,0,0,0,1),this}compose(e,n,o){const r=this.elements,i=n._x,a=n._y,l=n._z,s=n._w,c=i+i,u=a+a,d=l+l,f=i*c,p=i*u,g=i*d,y=a*u,w=a*d,b=l*d,C=s*c,P=s*u,v=s*d,T=o.x,A=o.y,x=o.z;return r[0]=(1-(y+b))*T,r[1]=(p+v)*T,r[2]=(g-P)*T,r[3]=0,r[4]=(p-v)*A,r[5]=(1-(f+b))*A,r[6]=(w+C)*A,r[7]=0,r[8]=(g+P)*x,r[9]=(w-C)*x,r[10]=(1-(f+y))*x,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,o){const r=this.elements;let i=iT.set(r[0],r[1],r[2]).length();const a=iT.set(r[4],r[5],r[6]).length(),l=iT.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Xy.copy(this);const c=1/i,u=1/a,d=1/l;return Xy.elements[0]*=c,Xy.elements[1]*=c,Xy.elements[2]*=c,Xy.elements[4]*=u,Xy.elements[5]*=u,Xy.elements[6]*=u,Xy.elements[8]*=d,Xy.elements[9]*=d,Xy.elements[10]*=d,n.setFromRotationMatrix(Xy),o.x=i,o.y=a,o.z=l,this}makePerspective(e,n,o,r,i,a,l=g9){const s=this.elements,c=2*i/(n-e),u=2*i/(o-r),d=(n+e)/(n-e),f=(o+r)/(o-r);let p,g;if(l===g9)p=-(a+i)/(a-i),g=-2*a*i/(a-i);else if(l===EF)p=-a/(a-i),g=-a*i/(a-i);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);return s[0]=c,s[4]=0,s[8]=d,s[12]=0,s[1]=0,s[5]=u,s[9]=f,s[13]=0,s[2]=0,s[6]=0,s[10]=p,s[14]=g,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,n,o,r,i,a,l=g9){const s=this.elements,c=1/(n-e),u=1/(o-r),d=1/(a-i),f=(n+e)*c,p=(o+r)*u;let g,y;if(l===g9)g=(a+i)*d,y=-2*d;else if(l===EF)g=i*d,y=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);return s[0]=2*c,s[4]=0,s[8]=0,s[12]=-f,s[1]=0,s[5]=2*u,s[9]=0,s[13]=-p,s[2]=0,s[6]=0,s[10]=y,s[14]=-g,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){const n=this.elements,o=e.elements;for(let r=0;r<16;r++)if(n[r]!==o[r])return!1;return!0}fromArray(e,n=0){for(let o=0;o<16;o++)this.elements[o]=e[o+n];return this}toArray(e=[],n=0){const o=this.elements;return e[n]=o[0],e[n+1]=o[1],e[n+2]=o[2],e[n+3]=o[3],e[n+4]=o[4],e[n+5]=o[5],e[n+6]=o[6],e[n+7]=o[7],e[n+8]=o[8],e[n+9]=o[9],e[n+10]=o[10],e[n+11]=o[11],e[n+12]=o[12],e[n+13]=o[13],e[n+14]=o[14],e[n+15]=o[15],e}}const iT=new ie,Xy=new Ji,Y1t=new ie(0,0,0),O1t=new ie(1,1,1),w4=new ie,wB=new ie,k1=new ie,m4e=new Ji,y4e=new bs;class nn{constructor(e=0,n=0,o=0,r=nn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=o,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,o,r=this._order){return this._x=e,this._y=n,this._z=o,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,o=!0){const r=e.elements,i=r[0],a=r[4],l=r[8],s=r[1],c=r[5],u=r[9],d=r[2],f=r[6],p=r[10];switch(n){case"XYZ":this._y=Math.asin(h0(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-h0(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(l,p),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-d,i),this._z=0);break;case"ZXY":this._x=Math.asin(h0(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-h0(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(h0(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,i)):(this._x=0,this._y=Math.atan2(l,p));break;case"XZY":this._z=Math.asin(-h0(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(l,i)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,o===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,o){return m4e.makeRotationFromQuaternion(e),this.setFromRotationMatrix(m4e,n,o)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return y4e.setFromEuler(this),this.setFromQuaternion(y4e,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}nn.DEFAULT_ORDER="XYZ";class lx{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let o=0;o0&&(o=o.concat(a))}return o}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(yz,e,V1t),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(yz,G1t,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let o=0,r=n.length;o0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON()));function i(l,s){return l[s.uuid]===void 0&&(l[s.uuid]=s.toJSON(e)),s.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){const s=l.shapes;if(Array.isArray(s))for(let c=0,u=s.length;c0){r.children=[];for(let l=0;l0){r.animations=[];for(let l=0;l0&&(o.geometries=l),s.length>0&&(o.materials=s),c.length>0&&(o.textures=c),u.length>0&&(o.images=u),d.length>0&&(o.shapes=d),f.length>0&&(o.skeletons=f),p.length>0&&(o.animations=p),g.length>0&&(o.nodes=g)}return o.object=r,o;function a(l){const s=[];for(const c in l){const u=l[c];delete u.metadata,s.push(u)}return s}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let o=0;o0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,n,o,r,i){Jy.subVectors(r,n),e6.subVectors(o,n),Doe.subVectors(e,n);const a=Jy.dot(Jy),l=Jy.dot(e6),s=Jy.dot(Doe),c=e6.dot(e6),u=e6.dot(Doe),d=a*c-l*l;if(d===0)return i.set(-2,-1,-1);const f=1/d,p=(c*s-l*u)*f,g=(a*u-l*s)*f;return i.set(1-p-g,g,p)}static containsPoint(e,n,o,r){return this.getBarycoord(e,n,o,r,t6),t6.x>=0&&t6.y>=0&&t6.x+t6.y<=1}static getUV(e,n,o,r,i,a,l,s){return xB===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),xB=!0),this.getInterpolation(e,n,o,r,i,a,l,s)}static getInterpolation(e,n,o,r,i,a,l,s){return this.getBarycoord(e,n,o,r,t6),s.setScalar(0),s.addScaledVector(i,t6.x),s.addScaledVector(a,t6.y),s.addScaledVector(l,t6.z),s}static isFrontFacing(e,n,o,r){return Jy.subVectors(o,n),e6.subVectors(e,n),Jy.cross(e6).dot(r)<0}set(e,n,o){return this.a.copy(e),this.b.copy(n),this.c.copy(o),this}setFromPointsAndIndices(e,n,o,r){return this.a.copy(e[n]),this.b.copy(e[o]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,o,r){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,o),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Jy.subVectors(this.c,this.b),e6.subVectors(this.a,this.b),Jy.cross(e6).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ah.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return ah.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,o,r,i){return xB===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),xB=!0),ah.getInterpolation(e,this.a,this.b,this.c,n,o,r,i)}getInterpolation(e,n,o,r,i){return ah.getInterpolation(e,this.a,this.b,this.c,n,o,r,i)}containsPoint(e){return ah.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ah.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const o=this.a,r=this.b,i=this.c;let a,l;lT.subVectors(r,o),sT.subVectors(i,o),Eoe.subVectors(e,o);const s=lT.dot(Eoe),c=sT.dot(Eoe);if(s<=0&&c<=0)return n.copy(o);Foe.subVectors(e,r);const u=lT.dot(Foe),d=sT.dot(Foe);if(u>=0&&d<=u)return n.copy(r);const f=s*d-u*c;if(f<=0&&s>=0&&u<=0)return a=s/(s-u),n.copy(o).addScaledVector(lT,a);koe.subVectors(e,i);const p=lT.dot(koe),g=sT.dot(koe);if(g>=0&&p<=g)return n.copy(i);const y=p*c-s*g;if(y<=0&&c>=0&&g<=0)return l=c/(c-g),n.copy(o).addScaledVector(sT,l);const w=u*g-p*d;if(w<=0&&d-u>=0&&p-g>=0)return b4e.subVectors(i,r),l=(d-u)/(d-u+(p-g)),n.copy(r).addScaledVector(b4e,l);const b=1/(w+y+f);return a=y*b,l=f*b,n.copy(o).addScaledVector(lT,a).addScaledVector(sT,l)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const CNe={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},v4={h:0,s:0,l:0},bB={h:0,s:0,l:0};function Loe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let rr=class{constructor(e,n,o){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,o)}set(e,n,o){if(n===void 0&&o===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,n,o);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=ru){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,cs.toWorkingColorSpace(this,n),this}setRGB(e,n,o,r=cs.workingColorSpace){return this.r=e,this.g=n,this.b=o,cs.toWorkingColorSpace(this,r),this}setHSL(e,n,o,r=cs.workingColorSpace){if(e=E1e(e,1),n=h0(n,0,1),o=h0(o,0,1),n===0)this.r=this.g=this.b=o;else{const i=o<=.5?o*(1+n):o+n-o*n,a=2*o-i;this.r=Loe(a,i,e+1/3),this.g=Loe(a,i,e),this.b=Loe(a,i,e-1/3)}return cs.toWorkingColorSpace(this,r),this}setStyle(e,n=ru){function o(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i;const a=r[1],l=r[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return o(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,n);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return o(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,n);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return o(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const i=r[1],a=i.length;if(a===3)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,n);if(a===6)return this.setHex(parseInt(i,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=ru){const o=CNe[e.toLowerCase()];return o!==void 0?this.setHex(o,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=bC(e.r),this.g=bC(e.g),this.b=bC(e.b),this}copyLinearToSRGB(e){return this.r=Toe(e.r),this.g=Toe(e.g),this.b=Toe(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ru){return cs.fromWorkingColorSpace(Xf.copy(this),e),Math.round(h0(Xf.r*255,0,255))*65536+Math.round(h0(Xf.g*255,0,255))*256+Math.round(h0(Xf.b*255,0,255))}getHexString(e=ru){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=cs.workingColorSpace){cs.fromWorkingColorSpace(Xf.copy(this),n);const o=Xf.r,r=Xf.g,i=Xf.b,a=Math.max(o,r,i),l=Math.min(o,r,i);let s,c;const u=(l+a)/2;if(l===a)s=0,c=0;else{const d=a-l;switch(c=u<=.5?d/(a+l):d/(2-a-l),a){case o:s=(r-i)/d+(r0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const o=e[n];if(o===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(o):r&&r.isVector3&&o&&o.isVector3?r.copy(o):this[n]=o}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const o={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};o.uuid=this.uuid,o.type=this.type,this.name!==""&&(o.name=this.name),this.color&&this.color.isColor&&(o.color=this.color.getHex()),this.roughness!==void 0&&(o.roughness=this.roughness),this.metalness!==void 0&&(o.metalness=this.metalness),this.sheen!==void 0&&(o.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(o.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(o.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(o.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(o.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(o.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(o.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(o.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(o.shininess=this.shininess),this.clearcoat!==void 0&&(o.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(o.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(o.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(o.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(o.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,o.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(o.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(o.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(o.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(o.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(o.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(o.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(o.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(o.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(o.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(o.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(o.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(o.lightMap=this.lightMap.toJSON(e).uuid,o.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(o.aoMap=this.aoMap.toJSON(e).uuid,o.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(o.bumpMap=this.bumpMap.toJSON(e).uuid,o.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(o.normalMap=this.normalMap.toJSON(e).uuid,o.normalMapType=this.normalMapType,o.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(o.displacementMap=this.displacementMap.toJSON(e).uuid,o.displacementScale=this.displacementScale,o.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(o.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(o.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(o.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(o.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(o.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(o.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(o.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(o.combine=this.combine)),this.envMapIntensity!==void 0&&(o.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(o.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(o.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(o.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(o.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(o.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(o.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(o.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(o.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(o.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(o.size=this.size),this.shadowSide!==null&&(o.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(o.sizeAttenuation=this.sizeAttenuation),this.blending!==ix&&(o.blending=this.blending),this.side!==Ra&&(o.side=this.side),this.vertexColors===!0&&(o.vertexColors=!0),this.opacity<1&&(o.opacity=this.opacity),this.transparent===!0&&(o.transparent=!0),this.blendSrc!==QV&&(o.blendSrc=this.blendSrc),this.blendDst!==ZV&&(o.blendDst=this.blendDst),this.blendEquation!==n8&&(o.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(o.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(o.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(o.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(o.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(o.blendAlpha=this.blendAlpha),this.depthFunc!==bF&&(o.depthFunc=this.depthFunc),this.depthTest===!1&&(o.depthTest=this.depthTest),this.depthWrite===!1&&(o.depthWrite=this.depthWrite),this.colorWrite===!1&&(o.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(o.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==mce&&(o.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(o.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(o.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==sv&&(o.stencilFail=this.stencilFail),this.stencilZFail!==sv&&(o.stencilZFail=this.stencilZFail),this.stencilZPass!==sv&&(o.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(o.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(o.rotation=this.rotation),this.polygonOffset===!0&&(o.polygonOffset=!0),this.polygonOffsetFactor!==0&&(o.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(o.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(o.linewidth=this.linewidth),this.dashSize!==void 0&&(o.dashSize=this.dashSize),this.gapSize!==void 0&&(o.gapSize=this.gapSize),this.scale!==void 0&&(o.scale=this.scale),this.dithering===!0&&(o.dithering=!0),this.alphaTest>0&&(o.alphaTest=this.alphaTest),this.alphaHash===!0&&(o.alphaHash=!0),this.alphaToCoverage===!0&&(o.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(o.premultipliedAlpha=!0),this.forceSinglePass===!0&&(o.forceSinglePass=!0),this.wireframe===!0&&(o.wireframe=!0),this.wireframeLinewidth>1&&(o.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(o.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(o.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(o.flatShading=!0),this.visible===!1&&(o.visible=!1),this.toneMapped===!1&&(o.toneMapped=!1),this.fog===!1&&(o.fog=!1),Object.keys(this.userData).length>0&&(o.userData=this.userData);function r(i){const a=[];for(const l in i){const s=i[l];delete s.metadata,a.push(s)}return a}if(n){const i=r(e.textures),a=r(e.images);i.length>0&&(o.textures=i),a.length>0&&(o.images=a)}return o}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let o=null;if(n!==null){const r=n.length;o=new Array(r);for(let i=0;i!==r;++i)o[i]=n[i].clone()}return this.clippingPlanes=o,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 e3 extends Pf{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new rr(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=$L,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 w6=q1t();function q1t(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),o=new Uint32Array(512),r=new Uint32Array(512);for(let s=0;s<256;++s){const c=s-127;c<-27?(o[s]=0,o[s|256]=32768,r[s]=24,r[s|256]=24):c<-14?(o[s]=1024>>-c-14,o[s|256]=1024>>-c-14|32768,r[s]=-c-1,r[s|256]=-c-1):c<=15?(o[s]=c+15<<10,o[s|256]=c+15<<10|32768,r[s]=13,r[s|256]=13):c<128?(o[s]=31744,o[s|256]=64512,r[s]=24,r[s|256]=24):(o[s]=31744,o[s|256]=64512,r[s]=13,r[s|256]=13)}const i=new Uint32Array(2048),a=new Uint32Array(64),l=new Uint32Array(64);for(let s=1;s<1024;++s){let c=s<<13,u=0;for(;!(c&8388608);)c<<=1,u-=8388608;c&=-8388609,u+=947912704,i[s]=c|u}for(let s=1024;s<2048;++s)i[s]=939524096+(s-1024<<13);for(let s=1;s<31;++s)a[s]=s<<23;a[31]=1199570944,a[32]=2147483648;for(let s=33;s<63;++s)a[s]=2147483648+(s-32<<23);a[63]=3347054592;for(let s=1;s<64;++s)s!==32&&(l[s]=1024);return{floatView:e,uint32View:n,baseTable:o,shiftTable:r,mantissaTable:i,exponentTable:a,offsetTable:l}}function Dp(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=h0(t,-65504,65504),w6.floatView[0]=t;const e=w6.uint32View[0],n=e>>23&511;return w6.baseTable[n]+((e&8388607)>>w6.shiftTable[n])}function TD(t){const e=t>>10;return w6.uint32View[0]=w6.mantissaTable[w6.offsetTable[e]+(t&1023)]+w6.exponentTable[e],w6.floatView[0]}const $1t={toHalfFloat:Dp,fromHalfFloat:TD},eu=new ie,SB=new Xt;class nl{constructor(e,n,o=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=o,this.usage=DF,this.updateRange={offset:0,count:-1},this.gpuType=v2,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.gpuType=e.gpuType,this}copyAt(e,n,o){e*=this.itemSize,o*=n.itemSize;for(let r=0,i=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const s=this.parameters;for(const c in s)s[c]!==void 0&&(e[c]=s[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const o=this.attributes;for(const s in o){const c=o[s];e.data.attributes[s]=c.toJSON(e.data)}const r={};let i=!1;for(const s in this.morphAttributes){const c=this.morphAttributes[s],u=[];for(let d=0,f=c.length;d0&&(r[s]=u,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const l=this.boundingSphere;return l!==null&&(e.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const o=e.index;o!==null&&this.setIndex(o.clone(n));const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(n))}const i=e.morphAttributes;for(const c in i){const u=[],d=i[c];for(let f=0,p=d.length;f0){const r=n[o[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,a=r.length;i(e.far-e.near)**2))&&(S4e.copy(i).invert(),k7.copy(e.ray).applyMatrix4(S4e),!(o.boundingBox!==null&&k7.intersectsBox(o.boundingBox)===!1)&&this._computeIntersections(e,n,k7)))}_computeIntersections(e,n,o){let r;const i=this.geometry,a=this.material,l=i.index,s=i.attributes.position,c=i.attributes.uv,u=i.attributes.uv1,d=i.attributes.normal,f=i.groups,p=i.drawRange;if(l!==null)if(Array.isArray(a))for(let g=0,y=f.length;gn.far?null:{distance:c,point:IB.clone(),object:t}}function zB(t,e,n,o,r,i,a,l,s,c){t.getVertexPosition(l,uT),t.getVertexPosition(s,dT),t.getVertexPosition(c,fT);const u=agt(t,e,n,o,uT,dT,fT,MB);if(u){r&&(CB.fromBufferAttribute(r,l),RB.fromBufferAttribute(r,s),HB.fromBufferAttribute(r,c),u.uv=ah.getInterpolation(MB,uT,dT,fT,CB,RB,HB,new Xt)),i&&(CB.fromBufferAttribute(i,l),RB.fromBufferAttribute(i,s),HB.fromBufferAttribute(i,c),u.uv1=ah.getInterpolation(MB,uT,dT,fT,CB,RB,HB,new Xt),u.uv2=u.uv1),a&&(P4e.fromBufferAttribute(a,l),C4e.fromBufferAttribute(a,s),R4e.fromBufferAttribute(a,c),u.normal=ah.getInterpolation(MB,uT,dT,fT,P4e,C4e,R4e,new ie),u.normal.dot(o.direction)>0&&u.normal.multiplyScalar(-1));const d={a:l,b:s,c,normal:new ie,materialIndex:0};ah.getNormal(uT,dT,fT,d.normal),u.face=d}return u}class t3 extends Ni{constructor(e=1,n=1,o=1,r=1,i=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:o,widthSegments:r,heightSegments:i,depthSegments:a};const l=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);const s=[],c=[],u=[],d=[];let f=0,p=0;g("z","y","x",-1,-1,o,n,e,a,i,0),g("z","y","x",1,-1,o,n,-e,a,i,1),g("x","z","y",1,1,e,o,n,r,a,2),g("x","z","y",1,-1,e,o,-n,r,a,3),g("x","y","z",1,-1,e,n,o,r,i,4),g("x","y","z",-1,-1,e,n,-o,r,i,5),this.setIndex(s),this.setAttribute("position",new gr(c,3)),this.setAttribute("normal",new gr(u,3)),this.setAttribute("uv",new gr(d,2));function g(y,w,b,C,P,v,T,A,x,S,R){const M=v/x,D=T/S,E=v/2,W=T/2,j=A/2,L=x+1,k=S+1;let N=0,F=0;const U=new ie;for(let O=0;O0?1:-1,u.push(U.x,U.y,U.z),d.push(_/x),d.push(1-O/S),N+=1}}for(let O=0;O0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const o={};for(const r in this.extensions)this.extensions[r]===!0&&(o[r]=!0);return Object.keys(o).length>0&&(n.extensions=o),n}}class ZL extends Wl{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ji,this.projectionMatrix=new Ji,this.projectionMatrixInverse=new Ji,this.coordinateSystem=g9}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let zu=class extends ZL{constructor(e=50,n=1,o=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=o,this.far=r,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=oR*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ax*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return oR*2*Math.atan(Math.tan(ax*.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,n,o,r,i,a){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=o,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(ax*.5*this.fov)/this.zoom,o=2*n,r=this.aspect*o,i=-.5*r;const a=this.view;if(this.view!==null&&this.view.enabled){const s=a.fullWidth,c=a.fullHeight;i+=a.offsetX*r/s,n-=a.offsetY*o/c,r*=a.width/s,o*=a.height/c}const l=this.filmOffset;l!==0&&(i+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,n,n-o,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}};const hT=-90,pT=1;class RNe extends Wl{constructor(e,n,o){super(),this.type="CubeCamera",this.renderTarget=o,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new zu(hT,pT,e,n);r.layers=this.layers,this.add(r);const i=new zu(hT,pT,e,n);i.layers=this.layers,this.add(i);const a=new zu(hT,pT,e,n);a.layers=this.layers,this.add(a);const l=new zu(hT,pT,e,n);l.layers=this.layers,this.add(l);const s=new zu(hT,pT,e,n);s.layers=this.layers,this.add(s);const c=new zu(hT,pT,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[o,r,i,a,l,s]=n;for(const c of n)this.remove(c);if(e===g9)o.up.set(0,1,0),o.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),l.up.set(0,1,0),l.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(e===EF)o.up.set(0,-1,0),o.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),l.up.set(0,-1,0),l.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:o,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[i,a,l,s,c,u]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),g=e.xr.enabled;e.xr.enabled=!1;const y=o.texture.generateMipmaps;o.texture.generateMipmaps=!1,e.setRenderTarget(o,0,r),e.render(n,i),e.setRenderTarget(o,1,r),e.render(n,a),e.setRenderTarget(o,2,r),e.render(n,l),e.setRenderTarget(o,3,r),e.render(n,s),e.setRenderTarget(o,4,r),e.render(n,c),o.texture.generateMipmaps=y,e.setRenderTarget(o,5,r),e.render(n,u),e.setRenderTarget(d,f,p),e.xr.enabled=g,o.texture.needsPMREMUpdate=!0}}class eW extends Vc{constructor(e,n,o,r,i,a,l,s,c,u){e=e!==void 0?e:[],n=n!==void 0?n:K6,super(e,n,o,r,i,a,l,s,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class HNe extends $m{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const o={width:e,height:e,depth:1},r=[o,o,o,o,o,o];n.encoding!==void 0&&(fE("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===U8?ru:dg),this.texture=new eW(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Gs}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const o={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class _2 extends Pf{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=sgt,this.fragmentShader=cgt,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=rR(e.uniforms),this.uniformsGroups=lgt(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 n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const r in this.uniforms){const a=this.uniforms[r].value;a&&a.isTexture?n.uniforms[r]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?n.uniforms[r]={type:"c",value:a.getHex()}:a&&a.isVector2?n.uniforms[r]={type:"v2",value:a.toArray()}:a&&a.isVector3?n.uniforms[r]={type:"v3",value:a.toArray()}:a&&a.isVector4?n.uniforms[r]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?n.uniforms[r]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?n.uniforms[r]={type:"m4",value:a.toArray()}:n.uniforms[r]={value:a}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const o={};for(const r in this.extensions)this.extensions[r]===!0&&(o[r]=!0);return Object.keys(o).length>0&&(n.extensions=o),n}}class ZL extends Wl{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ji,this.projectionMatrix=new Ji,this.projectionMatrixInverse=new Ji,this.coordinateSystem=g9}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let zu=class extends ZL{constructor(e=50,n=1,o=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=o,this.far=r,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=oR*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ax*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return oR*2*Math.atan(Math.tan(ax*.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,n,o,r,i,a){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=o,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(ax*.5*this.fov)/this.zoom,o=2*n,r=this.aspect*o,i=-.5*r;const a=this.view;if(this.view!==null&&this.view.enabled){const s=a.fullWidth,c=a.fullHeight;i+=a.offsetX*r/s,n-=a.offsetY*o/c,r*=a.width/s,o*=a.height/c}const l=this.filmOffset;l!==0&&(i+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,n,n-o,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}};const hT=-90,pT=1;class HNe extends Wl{constructor(e,n,o){super(),this.type="CubeCamera",this.renderTarget=o,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new zu(hT,pT,e,n);r.layers=this.layers,this.add(r);const i=new zu(hT,pT,e,n);i.layers=this.layers,this.add(i);const a=new zu(hT,pT,e,n);a.layers=this.layers,this.add(a);const l=new zu(hT,pT,e,n);l.layers=this.layers,this.add(l);const s=new zu(hT,pT,e,n);s.layers=this.layers,this.add(s);const c=new zu(hT,pT,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[o,r,i,a,l,s]=n;for(const c of n)this.remove(c);if(e===g9)o.up.set(0,1,0),o.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),l.up.set(0,1,0),l.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(e===EF)o.up.set(0,-1,0),o.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),l.up.set(0,-1,0),l.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:o,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[i,a,l,s,c,u]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),g=e.xr.enabled;e.xr.enabled=!1;const y=o.texture.generateMipmaps;o.texture.generateMipmaps=!1,e.setRenderTarget(o,0,r),e.render(n,i),e.setRenderTarget(o,1,r),e.render(n,a),e.setRenderTarget(o,2,r),e.render(n,l),e.setRenderTarget(o,3,r),e.render(n,s),e.setRenderTarget(o,4,r),e.render(n,c),o.texture.generateMipmaps=y,e.setRenderTarget(o,5,r),e.render(n,u),e.setRenderTarget(d,f,p),e.xr.enabled=g,o.texture.needsPMREMUpdate=!0}}class eW extends Vc{constructor(e,n,o,r,i,a,l,s,c,u){e=e!==void 0?e:[],n=n!==void 0?n:K6,super(e,n,o,r,i,a,l,s,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class MNe extends $m{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const o={width:e,height:e,depth:1},r=[o,o,o,o,o,o];n.encoding!==void 0&&(fE("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===U8?ru:dg),this.texture=new eW(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Gs}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const o={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -115,7 +115,7 @@ AC will not run if the highest outside temperature of the day is lower than the gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},r=new t3(5,5,5),i=new _2({name:"CubemapFromEquirect",uniforms:rR(o.uniforms),vertexShader:o.vertexShader,fragmentShader:o.fragmentShader,side:p0,blending:E6});i.uniforms.tEquirect.value=n;const a=new is(r,i),l=n.minFilter;return n.minFilter===Q8&&(n.minFilter=Gs),new RNe(1,10,this).update(e,a),n.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(e,n,o,r){const i=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(n,o,r);e.setRenderTarget(i)}}const Uoe=new ie,ugt=new ie,dgt=new pa;let l9=class{constructor(e=new ie(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,o,r){return this.normal.set(e,n,o),this.constant=r,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,o){const r=Uoe.subVectors(o,n).cross(ugt.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const o=e.delta(Uoe),r=this.normal.dot(o);if(r===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:n.copy(e.start).addScaledVector(o,i)}intersectsLine(e){const n=this.distanceToPoint(e.start),o=this.distanceToPoint(e.end);return n<0&&o>0||o<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const o=n||dgt.getNormalMatrix(e),r=this.coplanarPoint(Uoe).applyMatrix4(e),i=this.normal.applyMatrix3(o).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};const L7=new s1,zB=new ie;class lq{constructor(e=new l9,n=new l9,o=new l9,r=new l9,i=new l9,a=new l9){this.planes=[e,n,o,r,i,a]}set(e,n,o,r,i,a){const l=this.planes;return l[0].copy(e),l[1].copy(n),l[2].copy(o),l[3].copy(r),l[4].copy(i),l[5].copy(a),this}copy(e){const n=this.planes;for(let o=0;o<6;o++)n[o].copy(e.planes[o]);return this}setFromProjectionMatrix(e,n=g9){const o=this.planes,r=e.elements,i=r[0],a=r[1],l=r[2],s=r[3],c=r[4],u=r[5],d=r[6],f=r[7],p=r[8],g=r[9],y=r[10],w=r[11],b=r[12],C=r[13],P=r[14],v=r[15];if(o[0].setComponents(s-i,f-c,w-p,v-b).normalize(),o[1].setComponents(s+i,f+c,w+p,v+b).normalize(),o[2].setComponents(s+a,f+u,w+g,v+C).normalize(),o[3].setComponents(s-a,f-u,w-g,v-C).normalize(),o[4].setComponents(s-l,f-d,w-y,v-P).normalize(),n===g9)o[5].setComponents(s+l,f+d,w+y,v+P).normalize();else if(n===EF)o[5].setComponents(l,d,y,P).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),L7.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),L7.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(L7)}intersectsSprite(e){return L7.center.set(0,0,0),L7.radius=.7071067811865476,L7.applyMatrix4(e.matrixWorld),this.intersectsSphere(L7)}intersectsSphere(e){const n=this.planes,o=e.center,r=-e.radius;for(let i=0;i<6;i++)if(n[i].distanceToPoint(o)0?e.max.x:e.min.x,zB.y=r.normal.y>0?e.max.y:e.min.y,zB.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(zB)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let o=0;o<6;o++)if(n[o].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function MNe(){let t=null,e=!1,n=null,o=null;function r(i,a){n(i,a),o=t.requestAnimationFrame(r)}return{start:function(){e!==!0&&n!==null&&(o=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(o),e=!1},setAnimationLoop:function(i){n=i},setContext:function(i){t=i}}}function fgt(t,e){const n=e.isWebGL2,o=new WeakMap;function r(c,u){const d=c.array,f=c.usage,p=t.createBuffer();t.bindBuffer(u,p),t.bufferData(u,d,f),c.onUploadCallback();let g;if(d instanceof Float32Array)g=t.FLOAT;else if(d instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(n)g=t.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else g=t.UNSIGNED_SHORT;else if(d instanceof Int16Array)g=t.SHORT;else if(d instanceof Uint32Array)g=t.UNSIGNED_INT;else if(d instanceof Int32Array)g=t.INT;else if(d instanceof Int8Array)g=t.BYTE;else if(d instanceof Uint8Array)g=t.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)g=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:p,type:g,bytesPerElement:d.BYTES_PER_ELEMENT,version:c.version}}function i(c,u,d){const f=u.array,p=u.updateRange;t.bindBuffer(d,c),p.count===-1?t.bufferSubData(d,0,f):(n?t.bufferSubData(d,p.offset*f.BYTES_PER_ELEMENT,f,p.offset,p.count):t.bufferSubData(d,p.offset*f.BYTES_PER_ELEMENT,f.subarray(p.offset,p.offset+p.count)),p.count=-1),u.onUploadCallback()}function a(c){return c.isInterleavedBufferAttribute&&(c=c.data),o.get(c)}function l(c){c.isInterleavedBufferAttribute&&(c=c.data);const u=o.get(c);u&&(t.deleteBuffer(u.buffer),o.delete(c))}function s(c,u){if(c.isGLBufferAttribute){const f=o.get(c);(!f||f.version1?null:n.copy(e.start).addScaledVector(o,i)}intersectsLine(e){const n=this.distanceToPoint(e.start),o=this.distanceToPoint(e.end);return n<0&&o>0||o<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const o=n||dgt.getNormalMatrix(e),r=this.coplanarPoint(Uoe).applyMatrix4(e),i=this.normal.applyMatrix3(o).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};const L7=new s1,DB=new ie;class sq{constructor(e=new l9,n=new l9,o=new l9,r=new l9,i=new l9,a=new l9){this.planes=[e,n,o,r,i,a]}set(e,n,o,r,i,a){const l=this.planes;return l[0].copy(e),l[1].copy(n),l[2].copy(o),l[3].copy(r),l[4].copy(i),l[5].copy(a),this}copy(e){const n=this.planes;for(let o=0;o<6;o++)n[o].copy(e.planes[o]);return this}setFromProjectionMatrix(e,n=g9){const o=this.planes,r=e.elements,i=r[0],a=r[1],l=r[2],s=r[3],c=r[4],u=r[5],d=r[6],f=r[7],p=r[8],g=r[9],y=r[10],w=r[11],b=r[12],C=r[13],P=r[14],v=r[15];if(o[0].setComponents(s-i,f-c,w-p,v-b).normalize(),o[1].setComponents(s+i,f+c,w+p,v+b).normalize(),o[2].setComponents(s+a,f+u,w+g,v+C).normalize(),o[3].setComponents(s-a,f-u,w-g,v-C).normalize(),o[4].setComponents(s-l,f-d,w-y,v-P).normalize(),n===g9)o[5].setComponents(s+l,f+d,w+y,v+P).normalize();else if(n===EF)o[5].setComponents(l,d,y,P).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),L7.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),L7.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(L7)}intersectsSprite(e){return L7.center.set(0,0,0),L7.radius=.7071067811865476,L7.applyMatrix4(e.matrixWorld),this.intersectsSphere(L7)}intersectsSphere(e){const n=this.planes,o=e.center,r=-e.radius;for(let i=0;i<6;i++)if(n[i].distanceToPoint(o)0?e.max.x:e.min.x,DB.y=r.normal.y>0?e.max.y:e.min.y,DB.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(DB)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let o=0;o<6;o++)if(n[o].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function INe(){let t=null,e=!1,n=null,o=null;function r(i,a){n(i,a),o=t.requestAnimationFrame(r)}return{start:function(){e!==!0&&n!==null&&(o=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(o),e=!1},setAnimationLoop:function(i){n=i},setContext:function(i){t=i}}}function fgt(t,e){const n=e.isWebGL2,o=new WeakMap;function r(c,u){const d=c.array,f=c.usage,p=t.createBuffer();t.bindBuffer(u,p),t.bufferData(u,d,f),c.onUploadCallback();let g;if(d instanceof Float32Array)g=t.FLOAT;else if(d instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(n)g=t.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else g=t.UNSIGNED_SHORT;else if(d instanceof Int16Array)g=t.SHORT;else if(d instanceof Uint32Array)g=t.UNSIGNED_INT;else if(d instanceof Int32Array)g=t.INT;else if(d instanceof Int8Array)g=t.BYTE;else if(d instanceof Uint8Array)g=t.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)g=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:p,type:g,bytesPerElement:d.BYTES_PER_ELEMENT,version:c.version}}function i(c,u,d){const f=u.array,p=u.updateRange;t.bindBuffer(d,c),p.count===-1?t.bufferSubData(d,0,f):(n?t.bufferSubData(d,p.offset*f.BYTES_PER_ELEMENT,f,p.offset,p.count):t.bufferSubData(d,p.offset*f.BYTES_PER_ELEMENT,f.subarray(p.offset,p.offset+p.count)),p.count=-1),u.onUploadCallback()}function a(c){return c.isInterleavedBufferAttribute&&(c=c.data),o.get(c)}function l(c){c.isInterleavedBufferAttribute&&(c=c.data);const u=o.get(c);u&&(t.deleteBuffer(u.buffer),o.delete(c))}function s(c,u){if(c.isGLBufferAttribute){const f=o.get(c);(!f||f.version #include #include -}`,fa={alphahash_fragment:hgt,alphahash_pars_fragment:pgt,alphamap_fragment:ggt,alphamap_pars_fragment:mgt,alphatest_fragment:ygt,alphatest_pars_fragment:Agt,aomap_fragment:wgt,aomap_pars_fragment:vgt,begin_vertex:xgt,beginnormal_vertex:bgt,bsdfs:Sgt,iridescence_fragment:Tgt,bumpmap_pars_fragment:Pgt,clipping_planes_fragment:Cgt,clipping_planes_pars_fragment:Rgt,clipping_planes_pars_vertex:Hgt,clipping_planes_vertex:Mgt,color_fragment:Igt,color_pars_fragment:zgt,color_pars_vertex:Dgt,color_vertex:Egt,common:Fgt,cube_uv_reflection_fragment:kgt,defaultnormal_vertex:Lgt,displacementmap_pars_vertex:Wgt,displacementmap_vertex:Ngt,emissivemap_fragment:Ugt,emissivemap_pars_fragment:jgt,colorspace_fragment:Bgt,colorspace_pars_fragment:Ygt,envmap_fragment:Ogt,envmap_common_pars_fragment:_gt,envmap_pars_fragment:Vgt,envmap_pars_vertex:Ggt,envmap_physical_pars_fragment:rmt,envmap_vertex:Xgt,fog_vertex:Jgt,fog_pars_vertex:Kgt,fog_fragment:qgt,fog_pars_fragment:$gt,gradientmap_pars_fragment:Qgt,lightmap_fragment:Zgt,lightmap_pars_fragment:emt,lights_lambert_fragment:tmt,lights_lambert_pars_fragment:nmt,lights_pars_begin:omt,lights_toon_fragment:imt,lights_toon_pars_fragment:amt,lights_phong_fragment:lmt,lights_phong_pars_fragment:smt,lights_physical_fragment:cmt,lights_physical_pars_fragment:umt,lights_fragment_begin:dmt,lights_fragment_maps:fmt,lights_fragment_end:hmt,logdepthbuf_fragment:pmt,logdepthbuf_pars_fragment:gmt,logdepthbuf_pars_vertex:mmt,logdepthbuf_vertex:ymt,map_fragment:Amt,map_pars_fragment:wmt,map_particle_fragment:vmt,map_particle_pars_fragment:xmt,metalnessmap_fragment:bmt,metalnessmap_pars_fragment:Smt,morphcolor_vertex:Tmt,morphnormal_vertex:Pmt,morphtarget_pars_vertex:Cmt,morphtarget_vertex:Rmt,normal_fragment_begin:Hmt,normal_fragment_maps:Mmt,normal_pars_fragment:Imt,normal_pars_vertex:zmt,normal_vertex:Dmt,normalmap_pars_fragment:Emt,clearcoat_normal_fragment_begin:Fmt,clearcoat_normal_fragment_maps:kmt,clearcoat_pars_fragment:Lmt,iridescence_pars_fragment:Wmt,opaque_fragment:Nmt,packing:Umt,premultiplied_alpha_fragment:jmt,project_vertex:Bmt,dithering_fragment:Ymt,dithering_pars_fragment:Omt,roughnessmap_fragment:_mt,roughnessmap_pars_fragment:Vmt,shadowmap_pars_fragment:Gmt,shadowmap_pars_vertex:Xmt,shadowmap_vertex:Jmt,shadowmask_pars_fragment:Kmt,skinbase_vertex:qmt,skinning_pars_vertex:$mt,skinning_vertex:Qmt,skinnormal_vertex:Zmt,specularmap_fragment:eyt,specularmap_pars_fragment:tyt,tonemapping_fragment:nyt,tonemapping_pars_fragment:oyt,transmission_fragment:ryt,transmission_pars_fragment:iyt,uv_pars_fragment:ayt,uv_pars_vertex:lyt,uv_vertex:syt,worldpos_vertex:cyt,background_vert:uyt,background_frag:dyt,backgroundCube_vert:fyt,backgroundCube_frag:hyt,cube_vert:pyt,cube_frag:gyt,depth_vert:myt,depth_frag:yyt,distanceRGBA_vert:Ayt,distanceRGBA_frag:wyt,equirect_vert:vyt,equirect_frag:xyt,linedashed_vert:byt,linedashed_frag:Syt,meshbasic_vert:Tyt,meshbasic_frag:Pyt,meshlambert_vert:Cyt,meshlambert_frag:Ryt,meshmatcap_vert:Hyt,meshmatcap_frag:Myt,meshnormal_vert:Iyt,meshnormal_frag:zyt,meshphong_vert:Dyt,meshphong_frag:Eyt,meshphysical_vert:Fyt,meshphysical_frag:kyt,meshtoon_vert:Lyt,meshtoon_frag:Wyt,points_vert:Nyt,points_frag:Uyt,shadow_vert:jyt,shadow_frag:Byt,sprite_vert:Yyt,sprite_frag:Oyt},mr={common:{diffuse:{value:new rr(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new pa},alphaMap:{value:null},alphaMapTransform:{value:new pa},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new pa}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new pa}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new pa}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new pa},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new pa},normalScale:{value:new Xt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new pa},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new pa}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new pa}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new pa}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new rr(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:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{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 rr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new pa},alphaTest:{value:0},uvTransform:{value:new pa}},sprite:{diffuse:{value:new rr(16777215)},opacity:{value:1},center:{value:new Xt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new pa},alphaMap:{value:null},alphaMapTransform:{value:new pa},alphaTest:{value:0}}},m2={basic:{uniforms:_h([mr.common,mr.specularmap,mr.envmap,mr.aomap,mr.lightmap,mr.fog]),vertexShader:fa.meshbasic_vert,fragmentShader:fa.meshbasic_frag},lambert:{uniforms:_h([mr.common,mr.specularmap,mr.envmap,mr.aomap,mr.lightmap,mr.emissivemap,mr.bumpmap,mr.normalmap,mr.displacementmap,mr.fog,mr.lights,{emissive:{value:new rr(0)}}]),vertexShader:fa.meshlambert_vert,fragmentShader:fa.meshlambert_frag},phong:{uniforms:_h([mr.common,mr.specularmap,mr.envmap,mr.aomap,mr.lightmap,mr.emissivemap,mr.bumpmap,mr.normalmap,mr.displacementmap,mr.fog,mr.lights,{emissive:{value:new rr(0)},specular:{value:new rr(1118481)},shininess:{value:30}}]),vertexShader:fa.meshphong_vert,fragmentShader:fa.meshphong_frag},standard:{uniforms:_h([mr.common,mr.envmap,mr.aomap,mr.lightmap,mr.emissivemap,mr.bumpmap,mr.normalmap,mr.displacementmap,mr.roughnessmap,mr.metalnessmap,mr.fog,mr.lights,{emissive:{value:new rr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:fa.meshphysical_vert,fragmentShader:fa.meshphysical_frag},toon:{uniforms:_h([mr.common,mr.aomap,mr.lightmap,mr.emissivemap,mr.bumpmap,mr.normalmap,mr.displacementmap,mr.gradientmap,mr.fog,mr.lights,{emissive:{value:new rr(0)}}]),vertexShader:fa.meshtoon_vert,fragmentShader:fa.meshtoon_frag},matcap:{uniforms:_h([mr.common,mr.bumpmap,mr.normalmap,mr.displacementmap,mr.fog,{matcap:{value:null}}]),vertexShader:fa.meshmatcap_vert,fragmentShader:fa.meshmatcap_frag},points:{uniforms:_h([mr.points,mr.fog]),vertexShader:fa.points_vert,fragmentShader:fa.points_frag},dashed:{uniforms:_h([mr.common,mr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:fa.linedashed_vert,fragmentShader:fa.linedashed_frag},depth:{uniforms:_h([mr.common,mr.displacementmap]),vertexShader:fa.depth_vert,fragmentShader:fa.depth_frag},normal:{uniforms:_h([mr.common,mr.bumpmap,mr.normalmap,mr.displacementmap,{opacity:{value:1}}]),vertexShader:fa.meshnormal_vert,fragmentShader:fa.meshnormal_frag},sprite:{uniforms:_h([mr.sprite,mr.fog]),vertexShader:fa.sprite_vert,fragmentShader:fa.sprite_frag},background:{uniforms:{uvTransform:{value:new pa},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:fa.background_vert,fragmentShader:fa.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:fa.backgroundCube_vert,fragmentShader:fa.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:fa.cube_vert,fragmentShader:fa.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:fa.equirect_vert,fragmentShader:fa.equirect_frag},distanceRGBA:{uniforms:_h([mr.common,mr.displacementmap,{referencePosition:{value:new ie},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:fa.distanceRGBA_vert,fragmentShader:fa.distanceRGBA_frag},shadow:{uniforms:_h([mr.lights,mr.fog,{color:{value:new rr(0)},opacity:{value:1}}]),vertexShader:fa.shadow_vert,fragmentShader:fa.shadow_frag}};m2.physical={uniforms:_h([m2.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new pa},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new pa},clearcoatNormalScale:{value:new Xt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new pa},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new pa},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new pa},sheen:{value:0},sheenColor:{value:new rr(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new pa},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new pa},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new pa},transmissionSamplerSize:{value:new Xt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new pa},attenuationDistance:{value:0},attenuationColor:{value:new rr(0)},specularColor:{value:new rr(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new pa},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new pa},anisotropyVector:{value:new Xt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new pa}}]),vertexShader:fa.meshphysical_vert,fragmentShader:fa.meshphysical_frag};const DB={r:0,b:0,g:0};function _yt(t,e,n,o,r,i,a){const l=new rr(0);let s=i===!0?0:1,c,u,d=null,f=0,p=null;function g(w,b){let C=!1,P=b.isScene===!0?b.background:null;P&&P.isTexture&&(P=(b.backgroundBlurriness>0?n:e).get(P)),P===null?y(l,s):P&&P.isColor&&(y(P,1),C=!0);const v=t.xr.getEnvironmentBlendMode();v==="additive"?o.buffers.color.setClear(0,0,0,1,a):v==="alpha-blend"&&o.buffers.color.setClear(0,0,0,0,a),(t.autoClear||C)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),P&&(P.isCubeTexture||P.mapping===PH)?(u===void 0&&(u=new is(new t3(1,1,1),new _2({name:"BackgroundCubeMaterial",uniforms:rR(m2.backgroundCube.uniforms),vertexShader:m2.backgroundCube.vertexShader,fragmentShader:m2.backgroundCube.fragmentShader,side:p0,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(T,A,x){this.matrixWorld.copyPosition(x.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),u.material.uniforms.envMap.value=P,u.material.uniforms.flipEnvMap.value=P.isCubeTexture&&P.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=b.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,u.material.toneMapped=cs.getTransfer(P.colorSpace)!==Ys,(d!==P||f!==P.version||p!==t.toneMapping)&&(u.material.needsUpdate=!0,d=P,f=P.version,p=t.toneMapping),u.layers.enableAll(),w.unshift(u,u.geometry,u.material,0,0,null)):P&&P.isTexture&&(c===void 0&&(c=new is(new Rw(2,2),new _2({name:"BackgroundMaterial",uniforms:rR(m2.background.uniforms),vertexShader:m2.background.vertexShader,fragmentShader:m2.background.fragmentShader,side:Ra,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=P,c.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,c.material.toneMapped=cs.getTransfer(P.colorSpace)!==Ys,P.matrixAutoUpdate===!0&&P.updateMatrix(),c.material.uniforms.uvTransform.value.copy(P.matrix),(d!==P||f!==P.version||p!==t.toneMapping)&&(c.material.needsUpdate=!0,d=P,f=P.version,p=t.toneMapping),c.layers.enableAll(),w.unshift(c,c.geometry,c.material,0,0,null))}function y(w,b){w.getRGB(DB,CNe(t)),o.buffers.color.setClear(DB.r,DB.g,DB.b,b,a)}return{getClearColor:function(){return l},setClearColor:function(w,b=1){l.set(w),s=b,y(l,s)},getClearAlpha:function(){return s},setClearAlpha:function(w){s=w,y(l,s)},render:g}}function Vyt(t,e,n,o){const r=t.getParameter(t.MAX_VERTEX_ATTRIBS),i=o.isWebGL2?null:e.get("OES_vertex_array_object"),a=o.isWebGL2||i!==null,l={},s=w(null);let c=s,u=!1;function d(j,L,k,N,F){let U=!1;if(a){const O=y(N,k,L);c!==O&&(c=O,p(c.object)),U=b(j,N,k,F),U&&C(j,N,k,F)}else{const O=L.wireframe===!0;(c.geometry!==N.id||c.program!==k.id||c.wireframe!==O)&&(c.geometry=N.id,c.program=k.id,c.wireframe=O,U=!0)}F!==null&&n.update(F,t.ELEMENT_ARRAY_BUFFER),(U||u)&&(u=!1,S(j,L,k,N),F!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(F).buffer))}function f(){return o.isWebGL2?t.createVertexArray():i.createVertexArrayOES()}function p(j){return o.isWebGL2?t.bindVertexArray(j):i.bindVertexArrayOES(j)}function g(j){return o.isWebGL2?t.deleteVertexArray(j):i.deleteVertexArrayOES(j)}function y(j,L,k){const N=k.wireframe===!0;let F=l[j.id];F===void 0&&(F={},l[j.id]=F);let U=F[L.id];U===void 0&&(U={},F[L.id]=U);let O=U[N];return O===void 0&&(O=w(f()),U[N]=O),O}function w(j){const L=[],k=[],N=[];for(let F=0;F=0){const $=F[_];let Q=U[_];if(Q===void 0&&(_==="instanceMatrix"&&j.instanceMatrix&&(Q=j.instanceMatrix),_==="instanceColor"&&j.instanceColor&&(Q=j.instanceColor)),$===void 0||$.attribute!==Q||Q&&$.data!==Q.data)return!0;O++}return c.attributesNum!==O||c.index!==N}function C(j,L,k,N){const F={},U=L.attributes;let O=0;const B=k.getAttributes();for(const _ in B)if(B[_].location>=0){let $=U[_];$===void 0&&(_==="instanceMatrix"&&j.instanceMatrix&&($=j.instanceMatrix),_==="instanceColor"&&j.instanceColor&&($=j.instanceColor));const Q={};Q.attribute=$,$&&$.data&&(Q.data=$.data),F[_]=Q,O++}c.attributes=F,c.attributesNum=O,c.index=N}function P(){const j=c.newAttributes;for(let L=0,k=j.length;L=0){let X=F[B];if(X===void 0&&(B==="instanceMatrix"&&j.instanceMatrix&&(X=j.instanceMatrix),B==="instanceColor"&&j.instanceColor&&(X=j.instanceColor)),X!==void 0){const $=X.normalized,Q=X.itemSize,le=n.get(X);if(le===void 0)continue;const q=le.buffer,te=le.type,re=le.bytesPerElement,ae=o.isWebGL2===!0&&(te===t.INT||te===t.UNSIGNED_INT||X.gpuType===T1e);if(X.isInterleavedBufferAttribute){const se=X.data,ne=se.stride,fe=X.offset;if(se.isInstancedInterleavedBuffer){for(let ge=0;ge<_.locationSize;ge++)T(_.location+ge,se.meshPerAttribute);j.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=se.meshPerAttribute*se.count)}else for(let ge=0;ge<_.locationSize;ge++)v(_.location+ge);t.bindBuffer(t.ARRAY_BUFFER,q);for(let ge=0;ge<_.locationSize;ge++)x(_.location+ge,Q/_.locationSize,te,$,ne*re,(fe+Q/_.locationSize*ge)*re,ae)}else{if(X.isInstancedBufferAttribute){for(let se=0;se<_.locationSize;se++)T(_.location+se,X.meshPerAttribute);j.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=X.meshPerAttribute*X.count)}else for(let se=0;se<_.locationSize;se++)v(_.location+se);t.bindBuffer(t.ARRAY_BUFFER,q);for(let se=0;se<_.locationSize;se++)x(_.location+se,Q/_.locationSize,te,$,Q*re,Q/_.locationSize*se*re,ae)}}else if(O!==void 0){const $=O[B];if($!==void 0)switch($.length){case 2:t.vertexAttrib2fv(_.location,$);break;case 3:t.vertexAttrib3fv(_.location,$);break;case 4:t.vertexAttrib4fv(_.location,$);break;default:t.vertexAttrib1fv(_.location,$)}}}}A()}function R(){E();for(const j in l){const L=l[j];for(const k in L){const N=L[k];for(const F in N)g(N[F].object),delete N[F];delete L[k]}delete l[j]}}function M(j){if(l[j.id]===void 0)return;const L=l[j.id];for(const k in L){const N=L[k];for(const F in N)g(N[F].object),delete N[F];delete L[k]}delete l[j.id]}function D(j){for(const L in l){const k=l[L];if(k[j.id]===void 0)continue;const N=k[j.id];for(const F in N)g(N[F].object),delete N[F];delete k[j.id]}}function E(){W(),u=!0,c!==s&&(c=s,p(c.object))}function W(){s.geometry=null,s.program=null,s.wireframe=!1}return{setup:d,reset:E,resetDefaultState:W,dispose:R,releaseStatesOfGeometry:M,releaseStatesOfProgram:D,initAttributes:P,enableAttribute:v,disableUnusedAttributes:A}}function Gyt(t,e,n,o){const r=o.isWebGL2;let i;function a(c){i=c}function l(c,u){t.drawArrays(i,c,u),n.update(u,i,1)}function s(c,u,d){if(d===0)return;let f,p;if(r)f=t,p="drawArraysInstanced";else if(f=e.get("ANGLE_instanced_arrays"),p="drawArraysInstancedANGLE",f===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}f[p](i,c,u,d),n.update(u,i,d)}this.setMode=a,this.render=l,this.renderInstances=s}function Xyt(t,e,n){let o;function r(){if(o!==void 0)return o;if(e.has("EXT_texture_filter_anisotropic")===!0){const x=e.get("EXT_texture_filter_anisotropic");o=t.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else o=0;return o}function i(x){if(x==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const a=typeof WebGL2RenderingContext<"u"&&t.constructor.name==="WebGL2RenderingContext";let l=n.precision!==void 0?n.precision:"highp";const s=i(l);s!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",s,"instead."),l=s);const c=a||e.has("WEBGL_draw_buffers"),u=n.logarithmicDepthBuffer===!0,d=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),f=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=t.getParameter(t.MAX_TEXTURE_SIZE),g=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),y=t.getParameter(t.MAX_VERTEX_ATTRIBS),w=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),b=t.getParameter(t.MAX_VARYING_VECTORS),C=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),P=f>0,v=a||e.has("OES_texture_float"),T=P&&v,A=a?t.getParameter(t.MAX_SAMPLES):0;return{isWebGL2:a,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:i,precision:l,logarithmicDepthBuffer:u,maxTextures:d,maxVertexTextures:f,maxTextureSize:p,maxCubemapSize:g,maxAttributes:y,maxVertexUniforms:w,maxVaryings:b,maxFragmentUniforms:C,vertexTextures:P,floatFragmentTextures:v,floatVertexTextures:T,maxSamples:A}}function Jyt(t){const e=this;let n=null,o=0,r=!1,i=!1;const a=new l9,l=new pa,s={value:null,needsUpdate:!1};this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const p=d.length!==0||f||o!==0||r;return r=f,o=d.length,p},this.beginShadows=function(){i=!0,u(null)},this.endShadows=function(){i=!1},this.setGlobalState=function(d,f){n=u(d,f,0)},this.setState=function(d,f,p){const g=d.clippingPlanes,y=d.clipIntersection,w=d.clipShadows,b=t.get(d);if(!r||g===null||g.length===0||i&&!w)i?u(null):c();else{const C=i?0:o,P=C*4;let v=b.clippingState||null;s.value=v,v=u(g,f,P,p);for(let T=0;T!==P;++T)v[T]=n[T];b.clippingState=v,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=C}};function c(){s.value!==n&&(s.value=n,s.needsUpdate=o>0),e.numPlanes=o,e.numIntersection=0}function u(d,f,p,g){const y=d!==null?d.length:0;let w=null;if(y!==0){if(w=s.value,g!==!0||w===null){const b=p+y*4,C=f.matrixWorldInverse;l.getNormalMatrix(C),(w===null||w.length0){const c=new HNe(s.height/2);return c.fromEquirectangularTexture(t,a),e.set(a,c),a.addEventListener("dispose",r),n(c.texture,a.mapping)}else return null}}return a}function r(a){const l=a.target;l.removeEventListener("dispose",r);const s=e.get(l);s!==void 0&&(e.delete(l),s.dispose())}function i(){e=new WeakMap}return{get:o,dispose:i}}let tW=class extends ZL{constructor(e=-1,n=1,o=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=o,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,o,r,i,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=o,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),o=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=o-e,a=o+e,l=r+n,s=r-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=c*this.view.offsetX,a=i+c*this.view.width,l-=u*this.view.offsetY,s=l-u*this.view.height}this.projectionMatrix.makeOrthographic(i,a,l,s,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}};const VP=4,R4e=[.125,.215,.35,.446,.526,.582],Av=20,joe=new tW,H4e=new rr;let Boe=null,Yoe=0,Ooe=0;const cv=(1+Math.sqrt(5))/2,gT=1/cv,M4e=[new ie(1,1,1),new ie(-1,1,1),new ie(1,1,-1),new ie(-1,1,-1),new ie(0,cv,gT),new ie(0,cv,-gT),new ie(gT,0,cv),new ie(-gT,0,cv),new ie(cv,gT,0),new ie(-cv,gT,0)];class wce{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,o=.1,r=100){Boe=this._renderer.getRenderTarget(),Yoe=this._renderer.getActiveCubeFace(),Ooe=this._renderer.getActiveMipmapLevel(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,o,r,i),n>0&&this._blur(i,0,0,n),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=D4e(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=z4e(),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?P:0,P,P),u.setRenderTarget(r),y&&u.render(g,l),u.render(e,l)}g.geometry.dispose(),g.material.dispose(),u.toneMapping=f,u.autoClear=d,e.background=w}_textureToCubeUV(e,n){const o=this._renderer,r=e.mapping===K6||e.mapping===$8;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=D4e()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=z4e());const i=r?this._cubemapMaterial:this._equirectMaterial,a=new is(this._lodPlanes[0],i),l=i.uniforms;l.envMap.value=e;const s=this._cubeSize;EB(n,0,0,3*s,2*s),o.setRenderTarget(n),o.render(a,joe)}_applyPMREM(e){const n=this._renderer,o=n.autoClear;n.autoClear=!1;for(let r=1;rAv&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${w} samples when the maximum is set to ${Av}`);const b=[];let C=0;for(let x=0;xP-VP?r-P+VP:0),A=4*(this._cubeSize-v);EB(n,T,A,3*v,2*v),s.setRenderTarget(n),s.render(d,joe)}}function qyt(t){const e=[],n=[],o=[];let r=t;const i=t-VP+1+R4e.length;for(let a=0;at-VP?s=R4e[a-t+VP-1]:a===0&&(s=0),o.push(s);const c=1/(l-2),u=-c,d=1+c,f=[u,u,d,u,d,d,u,u,d,d,u,d],p=6,g=6,y=3,w=2,b=1,C=new Float32Array(y*g*p),P=new Float32Array(w*g*p),v=new Float32Array(b*g*p);for(let A=0;A2?0:-1,R=[x,S,0,x+2/3,S,0,x+2/3,S+1,0,x,S,0,x+2/3,S+1,0,x,S+1,0];C.set(R,y*g*A),P.set(f,w*g*A);const M=[A,A,A,A,A,A];v.set(M,b*g*A)}const T=new Ni;T.setAttribute("position",new nl(C,y)),T.setAttribute("uv",new nl(P,w)),T.setAttribute("faceIndex",new nl(v,b)),e.push(T),r>VP&&r--}return{lodPlanes:e,sizeLods:n,sigmas:o}}function I4e(t,e,n){const o=new $m(t,e,n);return o.texture.mapping=PH,o.texture.name="PMREM.cubeUv",o.scissorTest=!0,o}function EB(t,e,n,o,r){t.viewport.set(e,n,o,r),t.scissor.set(e,n,o,r)}function $yt(t,e,n){const o=new Float32Array(Av),r=new ie(0,1,0);return new _2({name:"SphericalGaussianBlur",defines:{n:Av,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:o},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:N1e(),fragmentShader:` +}`,ha={alphahash_fragment:hgt,alphahash_pars_fragment:pgt,alphamap_fragment:ggt,alphamap_pars_fragment:mgt,alphatest_fragment:ygt,alphatest_pars_fragment:Agt,aomap_fragment:wgt,aomap_pars_fragment:vgt,begin_vertex:xgt,beginnormal_vertex:bgt,bsdfs:Sgt,iridescence_fragment:Tgt,bumpmap_pars_fragment:Pgt,clipping_planes_fragment:Cgt,clipping_planes_pars_fragment:Rgt,clipping_planes_pars_vertex:Hgt,clipping_planes_vertex:Mgt,color_fragment:Igt,color_pars_fragment:zgt,color_pars_vertex:Dgt,color_vertex:Egt,common:Fgt,cube_uv_reflection_fragment:kgt,defaultnormal_vertex:Lgt,displacementmap_pars_vertex:Wgt,displacementmap_vertex:Ngt,emissivemap_fragment:Ugt,emissivemap_pars_fragment:jgt,colorspace_fragment:Bgt,colorspace_pars_fragment:Ygt,envmap_fragment:Ogt,envmap_common_pars_fragment:_gt,envmap_pars_fragment:Vgt,envmap_pars_vertex:Ggt,envmap_physical_pars_fragment:rmt,envmap_vertex:Xgt,fog_vertex:Jgt,fog_pars_vertex:Kgt,fog_fragment:qgt,fog_pars_fragment:$gt,gradientmap_pars_fragment:Qgt,lightmap_fragment:Zgt,lightmap_pars_fragment:emt,lights_lambert_fragment:tmt,lights_lambert_pars_fragment:nmt,lights_pars_begin:omt,lights_toon_fragment:imt,lights_toon_pars_fragment:amt,lights_phong_fragment:lmt,lights_phong_pars_fragment:smt,lights_physical_fragment:cmt,lights_physical_pars_fragment:umt,lights_fragment_begin:dmt,lights_fragment_maps:fmt,lights_fragment_end:hmt,logdepthbuf_fragment:pmt,logdepthbuf_pars_fragment:gmt,logdepthbuf_pars_vertex:mmt,logdepthbuf_vertex:ymt,map_fragment:Amt,map_pars_fragment:wmt,map_particle_fragment:vmt,map_particle_pars_fragment:xmt,metalnessmap_fragment:bmt,metalnessmap_pars_fragment:Smt,morphcolor_vertex:Tmt,morphnormal_vertex:Pmt,morphtarget_pars_vertex:Cmt,morphtarget_vertex:Rmt,normal_fragment_begin:Hmt,normal_fragment_maps:Mmt,normal_pars_fragment:Imt,normal_pars_vertex:zmt,normal_vertex:Dmt,normalmap_pars_fragment:Emt,clearcoat_normal_fragment_begin:Fmt,clearcoat_normal_fragment_maps:kmt,clearcoat_pars_fragment:Lmt,iridescence_pars_fragment:Wmt,opaque_fragment:Nmt,packing:Umt,premultiplied_alpha_fragment:jmt,project_vertex:Bmt,dithering_fragment:Ymt,dithering_pars_fragment:Omt,roughnessmap_fragment:_mt,roughnessmap_pars_fragment:Vmt,shadowmap_pars_fragment:Gmt,shadowmap_pars_vertex:Xmt,shadowmap_vertex:Jmt,shadowmask_pars_fragment:Kmt,skinbase_vertex:qmt,skinning_pars_vertex:$mt,skinning_vertex:Qmt,skinnormal_vertex:Zmt,specularmap_fragment:eyt,specularmap_pars_fragment:tyt,tonemapping_fragment:nyt,tonemapping_pars_fragment:oyt,transmission_fragment:ryt,transmission_pars_fragment:iyt,uv_pars_fragment:ayt,uv_pars_vertex:lyt,uv_vertex:syt,worldpos_vertex:cyt,background_vert:uyt,background_frag:dyt,backgroundCube_vert:fyt,backgroundCube_frag:hyt,cube_vert:pyt,cube_frag:gyt,depth_vert:myt,depth_frag:yyt,distanceRGBA_vert:Ayt,distanceRGBA_frag:wyt,equirect_vert:vyt,equirect_frag:xyt,linedashed_vert:byt,linedashed_frag:Syt,meshbasic_vert:Tyt,meshbasic_frag:Pyt,meshlambert_vert:Cyt,meshlambert_frag:Ryt,meshmatcap_vert:Hyt,meshmatcap_frag:Myt,meshnormal_vert:Iyt,meshnormal_frag:zyt,meshphong_vert:Dyt,meshphong_frag:Eyt,meshphysical_vert:Fyt,meshphysical_frag:kyt,meshtoon_vert:Lyt,meshtoon_frag:Wyt,points_vert:Nyt,points_frag:Uyt,shadow_vert:jyt,shadow_frag:Byt,sprite_vert:Yyt,sprite_frag:Oyt},mr={common:{diffuse:{value:new rr(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ga},alphaMap:{value:null},alphaMapTransform:{value:new ga},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ga}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ga}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ga}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ga},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ga},normalScale:{value:new Xt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ga},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ga}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ga}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ga}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new rr(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:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{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 rr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ga},alphaTest:{value:0},uvTransform:{value:new ga}},sprite:{diffuse:{value:new rr(16777215)},opacity:{value:1},center:{value:new Xt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ga},alphaMap:{value:null},alphaMapTransform:{value:new ga},alphaTest:{value:0}}},m2={basic:{uniforms:_h([mr.common,mr.specularmap,mr.envmap,mr.aomap,mr.lightmap,mr.fog]),vertexShader:ha.meshbasic_vert,fragmentShader:ha.meshbasic_frag},lambert:{uniforms:_h([mr.common,mr.specularmap,mr.envmap,mr.aomap,mr.lightmap,mr.emissivemap,mr.bumpmap,mr.normalmap,mr.displacementmap,mr.fog,mr.lights,{emissive:{value:new rr(0)}}]),vertexShader:ha.meshlambert_vert,fragmentShader:ha.meshlambert_frag},phong:{uniforms:_h([mr.common,mr.specularmap,mr.envmap,mr.aomap,mr.lightmap,mr.emissivemap,mr.bumpmap,mr.normalmap,mr.displacementmap,mr.fog,mr.lights,{emissive:{value:new rr(0)},specular:{value:new rr(1118481)},shininess:{value:30}}]),vertexShader:ha.meshphong_vert,fragmentShader:ha.meshphong_frag},standard:{uniforms:_h([mr.common,mr.envmap,mr.aomap,mr.lightmap,mr.emissivemap,mr.bumpmap,mr.normalmap,mr.displacementmap,mr.roughnessmap,mr.metalnessmap,mr.fog,mr.lights,{emissive:{value:new rr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ha.meshphysical_vert,fragmentShader:ha.meshphysical_frag},toon:{uniforms:_h([mr.common,mr.aomap,mr.lightmap,mr.emissivemap,mr.bumpmap,mr.normalmap,mr.displacementmap,mr.gradientmap,mr.fog,mr.lights,{emissive:{value:new rr(0)}}]),vertexShader:ha.meshtoon_vert,fragmentShader:ha.meshtoon_frag},matcap:{uniforms:_h([mr.common,mr.bumpmap,mr.normalmap,mr.displacementmap,mr.fog,{matcap:{value:null}}]),vertexShader:ha.meshmatcap_vert,fragmentShader:ha.meshmatcap_frag},points:{uniforms:_h([mr.points,mr.fog]),vertexShader:ha.points_vert,fragmentShader:ha.points_frag},dashed:{uniforms:_h([mr.common,mr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ha.linedashed_vert,fragmentShader:ha.linedashed_frag},depth:{uniforms:_h([mr.common,mr.displacementmap]),vertexShader:ha.depth_vert,fragmentShader:ha.depth_frag},normal:{uniforms:_h([mr.common,mr.bumpmap,mr.normalmap,mr.displacementmap,{opacity:{value:1}}]),vertexShader:ha.meshnormal_vert,fragmentShader:ha.meshnormal_frag},sprite:{uniforms:_h([mr.sprite,mr.fog]),vertexShader:ha.sprite_vert,fragmentShader:ha.sprite_frag},background:{uniforms:{uvTransform:{value:new ga},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ha.background_vert,fragmentShader:ha.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:ha.backgroundCube_vert,fragmentShader:ha.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ha.cube_vert,fragmentShader:ha.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ha.equirect_vert,fragmentShader:ha.equirect_frag},distanceRGBA:{uniforms:_h([mr.common,mr.displacementmap,{referencePosition:{value:new ie},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ha.distanceRGBA_vert,fragmentShader:ha.distanceRGBA_frag},shadow:{uniforms:_h([mr.lights,mr.fog,{color:{value:new rr(0)},opacity:{value:1}}]),vertexShader:ha.shadow_vert,fragmentShader:ha.shadow_frag}};m2.physical={uniforms:_h([m2.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ga},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ga},clearcoatNormalScale:{value:new Xt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ga},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ga},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ga},sheen:{value:0},sheenColor:{value:new rr(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ga},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ga},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ga},transmissionSamplerSize:{value:new Xt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ga},attenuationDistance:{value:0},attenuationColor:{value:new rr(0)},specularColor:{value:new rr(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ga},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ga},anisotropyVector:{value:new Xt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ga}}]),vertexShader:ha.meshphysical_vert,fragmentShader:ha.meshphysical_frag};const EB={r:0,b:0,g:0};function _yt(t,e,n,o,r,i,a){const l=new rr(0);let s=i===!0?0:1,c,u,d=null,f=0,p=null;function g(w,b){let C=!1,P=b.isScene===!0?b.background:null;P&&P.isTexture&&(P=(b.backgroundBlurriness>0?n:e).get(P)),P===null?y(l,s):P&&P.isColor&&(y(P,1),C=!0);const v=t.xr.getEnvironmentBlendMode();v==="additive"?o.buffers.color.setClear(0,0,0,1,a):v==="alpha-blend"&&o.buffers.color.setClear(0,0,0,0,a),(t.autoClear||C)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),P&&(P.isCubeTexture||P.mapping===PH)?(u===void 0&&(u=new is(new t3(1,1,1),new _2({name:"BackgroundCubeMaterial",uniforms:rR(m2.backgroundCube.uniforms),vertexShader:m2.backgroundCube.vertexShader,fragmentShader:m2.backgroundCube.fragmentShader,side:p0,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(T,A,x){this.matrixWorld.copyPosition(x.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),u.material.uniforms.envMap.value=P,u.material.uniforms.flipEnvMap.value=P.isCubeTexture&&P.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=b.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,u.material.toneMapped=cs.getTransfer(P.colorSpace)!==Ys,(d!==P||f!==P.version||p!==t.toneMapping)&&(u.material.needsUpdate=!0,d=P,f=P.version,p=t.toneMapping),u.layers.enableAll(),w.unshift(u,u.geometry,u.material,0,0,null)):P&&P.isTexture&&(c===void 0&&(c=new is(new Rw(2,2),new _2({name:"BackgroundMaterial",uniforms:rR(m2.background.uniforms),vertexShader:m2.background.vertexShader,fragmentShader:m2.background.fragmentShader,side:Ra,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=P,c.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,c.material.toneMapped=cs.getTransfer(P.colorSpace)!==Ys,P.matrixAutoUpdate===!0&&P.updateMatrix(),c.material.uniforms.uvTransform.value.copy(P.matrix),(d!==P||f!==P.version||p!==t.toneMapping)&&(c.material.needsUpdate=!0,d=P,f=P.version,p=t.toneMapping),c.layers.enableAll(),w.unshift(c,c.geometry,c.material,0,0,null))}function y(w,b){w.getRGB(EB,RNe(t)),o.buffers.color.setClear(EB.r,EB.g,EB.b,b,a)}return{getClearColor:function(){return l},setClearColor:function(w,b=1){l.set(w),s=b,y(l,s)},getClearAlpha:function(){return s},setClearAlpha:function(w){s=w,y(l,s)},render:g}}function Vyt(t,e,n,o){const r=t.getParameter(t.MAX_VERTEX_ATTRIBS),i=o.isWebGL2?null:e.get("OES_vertex_array_object"),a=o.isWebGL2||i!==null,l={},s=w(null);let c=s,u=!1;function d(j,L,k,N,F){let U=!1;if(a){const O=y(N,k,L);c!==O&&(c=O,p(c.object)),U=b(j,N,k,F),U&&C(j,N,k,F)}else{const O=L.wireframe===!0;(c.geometry!==N.id||c.program!==k.id||c.wireframe!==O)&&(c.geometry=N.id,c.program=k.id,c.wireframe=O,U=!0)}F!==null&&n.update(F,t.ELEMENT_ARRAY_BUFFER),(U||u)&&(u=!1,S(j,L,k,N),F!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(F).buffer))}function f(){return o.isWebGL2?t.createVertexArray():i.createVertexArrayOES()}function p(j){return o.isWebGL2?t.bindVertexArray(j):i.bindVertexArrayOES(j)}function g(j){return o.isWebGL2?t.deleteVertexArray(j):i.deleteVertexArrayOES(j)}function y(j,L,k){const N=k.wireframe===!0;let F=l[j.id];F===void 0&&(F={},l[j.id]=F);let U=F[L.id];U===void 0&&(U={},F[L.id]=U);let O=U[N];return O===void 0&&(O=w(f()),U[N]=O),O}function w(j){const L=[],k=[],N=[];for(let F=0;F=0){const $=F[_];let Q=U[_];if(Q===void 0&&(_==="instanceMatrix"&&j.instanceMatrix&&(Q=j.instanceMatrix),_==="instanceColor"&&j.instanceColor&&(Q=j.instanceColor)),$===void 0||$.attribute!==Q||Q&&$.data!==Q.data)return!0;O++}return c.attributesNum!==O||c.index!==N}function C(j,L,k,N){const F={},U=L.attributes;let O=0;const B=k.getAttributes();for(const _ in B)if(B[_].location>=0){let $=U[_];$===void 0&&(_==="instanceMatrix"&&j.instanceMatrix&&($=j.instanceMatrix),_==="instanceColor"&&j.instanceColor&&($=j.instanceColor));const Q={};Q.attribute=$,$&&$.data&&(Q.data=$.data),F[_]=Q,O++}c.attributes=F,c.attributesNum=O,c.index=N}function P(){const j=c.newAttributes;for(let L=0,k=j.length;L=0){let X=F[B];if(X===void 0&&(B==="instanceMatrix"&&j.instanceMatrix&&(X=j.instanceMatrix),B==="instanceColor"&&j.instanceColor&&(X=j.instanceColor)),X!==void 0){const $=X.normalized,Q=X.itemSize,le=n.get(X);if(le===void 0)continue;const q=le.buffer,te=le.type,re=le.bytesPerElement,ae=o.isWebGL2===!0&&(te===t.INT||te===t.UNSIGNED_INT||X.gpuType===T1e);if(X.isInterleavedBufferAttribute){const se=X.data,ne=se.stride,fe=X.offset;if(se.isInstancedInterleavedBuffer){for(let ge=0;ge<_.locationSize;ge++)T(_.location+ge,se.meshPerAttribute);j.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=se.meshPerAttribute*se.count)}else for(let ge=0;ge<_.locationSize;ge++)v(_.location+ge);t.bindBuffer(t.ARRAY_BUFFER,q);for(let ge=0;ge<_.locationSize;ge++)x(_.location+ge,Q/_.locationSize,te,$,ne*re,(fe+Q/_.locationSize*ge)*re,ae)}else{if(X.isInstancedBufferAttribute){for(let se=0;se<_.locationSize;se++)T(_.location+se,X.meshPerAttribute);j.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=X.meshPerAttribute*X.count)}else for(let se=0;se<_.locationSize;se++)v(_.location+se);t.bindBuffer(t.ARRAY_BUFFER,q);for(let se=0;se<_.locationSize;se++)x(_.location+se,Q/_.locationSize,te,$,Q*re,Q/_.locationSize*se*re,ae)}}else if(O!==void 0){const $=O[B];if($!==void 0)switch($.length){case 2:t.vertexAttrib2fv(_.location,$);break;case 3:t.vertexAttrib3fv(_.location,$);break;case 4:t.vertexAttrib4fv(_.location,$);break;default:t.vertexAttrib1fv(_.location,$)}}}}A()}function R(){E();for(const j in l){const L=l[j];for(const k in L){const N=L[k];for(const F in N)g(N[F].object),delete N[F];delete L[k]}delete l[j]}}function M(j){if(l[j.id]===void 0)return;const L=l[j.id];for(const k in L){const N=L[k];for(const F in N)g(N[F].object),delete N[F];delete L[k]}delete l[j.id]}function D(j){for(const L in l){const k=l[L];if(k[j.id]===void 0)continue;const N=k[j.id];for(const F in N)g(N[F].object),delete N[F];delete k[j.id]}}function E(){W(),u=!0,c!==s&&(c=s,p(c.object))}function W(){s.geometry=null,s.program=null,s.wireframe=!1}return{setup:d,reset:E,resetDefaultState:W,dispose:R,releaseStatesOfGeometry:M,releaseStatesOfProgram:D,initAttributes:P,enableAttribute:v,disableUnusedAttributes:A}}function Gyt(t,e,n,o){const r=o.isWebGL2;let i;function a(c){i=c}function l(c,u){t.drawArrays(i,c,u),n.update(u,i,1)}function s(c,u,d){if(d===0)return;let f,p;if(r)f=t,p="drawArraysInstanced";else if(f=e.get("ANGLE_instanced_arrays"),p="drawArraysInstancedANGLE",f===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}f[p](i,c,u,d),n.update(u,i,d)}this.setMode=a,this.render=l,this.renderInstances=s}function Xyt(t,e,n){let o;function r(){if(o!==void 0)return o;if(e.has("EXT_texture_filter_anisotropic")===!0){const x=e.get("EXT_texture_filter_anisotropic");o=t.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else o=0;return o}function i(x){if(x==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const a=typeof WebGL2RenderingContext<"u"&&t.constructor.name==="WebGL2RenderingContext";let l=n.precision!==void 0?n.precision:"highp";const s=i(l);s!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",s,"instead."),l=s);const c=a||e.has("WEBGL_draw_buffers"),u=n.logarithmicDepthBuffer===!0,d=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),f=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=t.getParameter(t.MAX_TEXTURE_SIZE),g=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),y=t.getParameter(t.MAX_VERTEX_ATTRIBS),w=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),b=t.getParameter(t.MAX_VARYING_VECTORS),C=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),P=f>0,v=a||e.has("OES_texture_float"),T=P&&v,A=a?t.getParameter(t.MAX_SAMPLES):0;return{isWebGL2:a,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:i,precision:l,logarithmicDepthBuffer:u,maxTextures:d,maxVertexTextures:f,maxTextureSize:p,maxCubemapSize:g,maxAttributes:y,maxVertexUniforms:w,maxVaryings:b,maxFragmentUniforms:C,vertexTextures:P,floatFragmentTextures:v,floatVertexTextures:T,maxSamples:A}}function Jyt(t){const e=this;let n=null,o=0,r=!1,i=!1;const a=new l9,l=new ga,s={value:null,needsUpdate:!1};this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const p=d.length!==0||f||o!==0||r;return r=f,o=d.length,p},this.beginShadows=function(){i=!0,u(null)},this.endShadows=function(){i=!1},this.setGlobalState=function(d,f){n=u(d,f,0)},this.setState=function(d,f,p){const g=d.clippingPlanes,y=d.clipIntersection,w=d.clipShadows,b=t.get(d);if(!r||g===null||g.length===0||i&&!w)i?u(null):c();else{const C=i?0:o,P=C*4;let v=b.clippingState||null;s.value=v,v=u(g,f,P,p);for(let T=0;T!==P;++T)v[T]=n[T];b.clippingState=v,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=C}};function c(){s.value!==n&&(s.value=n,s.needsUpdate=o>0),e.numPlanes=o,e.numIntersection=0}function u(d,f,p,g){const y=d!==null?d.length:0;let w=null;if(y!==0){if(w=s.value,g!==!0||w===null){const b=p+y*4,C=f.matrixWorldInverse;l.getNormalMatrix(C),(w===null||w.length0){const c=new MNe(s.height/2);return c.fromEquirectangularTexture(t,a),e.set(a,c),a.addEventListener("dispose",r),n(c.texture,a.mapping)}else return null}}return a}function r(a){const l=a.target;l.removeEventListener("dispose",r);const s=e.get(l);s!==void 0&&(e.delete(l),s.dispose())}function i(){e=new WeakMap}return{get:o,dispose:i}}let tW=class extends ZL{constructor(e=-1,n=1,o=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=o,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,o,r,i,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=o,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),o=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=o-e,a=o+e,l=r+n,s=r-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=c*this.view.offsetX,a=i+c*this.view.width,l-=u*this.view.offsetY,s=l-u*this.view.height}this.projectionMatrix.makeOrthographic(i,a,l,s,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}};const VP=4,H4e=[.125,.215,.35,.446,.526,.582],Av=20,joe=new tW,M4e=new rr;let Boe=null,Yoe=0,Ooe=0;const cv=(1+Math.sqrt(5))/2,gT=1/cv,I4e=[new ie(1,1,1),new ie(-1,1,1),new ie(1,1,-1),new ie(-1,1,-1),new ie(0,cv,gT),new ie(0,cv,-gT),new ie(gT,0,cv),new ie(-gT,0,cv),new ie(cv,gT,0),new ie(-cv,gT,0)];class wce{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,o=.1,r=100){Boe=this._renderer.getRenderTarget(),Yoe=this._renderer.getActiveCubeFace(),Ooe=this._renderer.getActiveMipmapLevel(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,o,r,i),n>0&&this._blur(i,0,0,n),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=E4e(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=D4e(),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?P:0,P,P),u.setRenderTarget(r),y&&u.render(g,l),u.render(e,l)}g.geometry.dispose(),g.material.dispose(),u.toneMapping=f,u.autoClear=d,e.background=w}_textureToCubeUV(e,n){const o=this._renderer,r=e.mapping===K6||e.mapping===$8;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=E4e()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=D4e());const i=r?this._cubemapMaterial:this._equirectMaterial,a=new is(this._lodPlanes[0],i),l=i.uniforms;l.envMap.value=e;const s=this._cubeSize;FB(n,0,0,3*s,2*s),o.setRenderTarget(n),o.render(a,joe)}_applyPMREM(e){const n=this._renderer,o=n.autoClear;n.autoClear=!1;for(let r=1;rAv&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${w} samples when the maximum is set to ${Av}`);const b=[];let C=0;for(let x=0;xP-VP?r-P+VP:0),A=4*(this._cubeSize-v);FB(n,T,A,3*v,2*v),s.setRenderTarget(n),s.render(d,joe)}}function qyt(t){const e=[],n=[],o=[];let r=t;const i=t-VP+1+H4e.length;for(let a=0;at-VP?s=H4e[a-t+VP-1]:a===0&&(s=0),o.push(s);const c=1/(l-2),u=-c,d=1+c,f=[u,u,d,u,d,d,u,u,d,d,u,d],p=6,g=6,y=3,w=2,b=1,C=new Float32Array(y*g*p),P=new Float32Array(w*g*p),v=new Float32Array(b*g*p);for(let A=0;A2?0:-1,R=[x,S,0,x+2/3,S,0,x+2/3,S+1,0,x,S,0,x+2/3,S+1,0,x,S+1,0];C.set(R,y*g*A),P.set(f,w*g*A);const M=[A,A,A,A,A,A];v.set(M,b*g*A)}const T=new Ni;T.setAttribute("position",new nl(C,y)),T.setAttribute("uv",new nl(P,w)),T.setAttribute("faceIndex",new nl(v,b)),e.push(T),r>VP&&r--}return{lodPlanes:e,sizeLods:n,sigmas:o}}function z4e(t,e,n){const o=new $m(t,e,n);return o.texture.mapping=PH,o.texture.name="PMREM.cubeUv",o.scissorTest=!0,o}function FB(t,e,n,o,r){t.viewport.set(e,n,o,r),t.scissor.set(e,n,o,r)}function $yt(t,e,n){const o=new Float32Array(Av),r=new ie(0,1,0);return new _2({name:"SphericalGaussianBlur",defines:{n:Av,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:o},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:N1e(),fragmentShader:` precision mediump float; precision mediump int; @@ -3512,7 +3512,7 @@ void main() { } } - `,blending:E6,depthTest:!1,depthWrite:!1})}function z4e(){return new _2({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:N1e(),fragmentShader:` + `,blending:E6,depthTest:!1,depthWrite:!1})}function D4e(){return new _2({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:N1e(),fragmentShader:` precision mediump float; precision mediump int; @@ -3531,7 +3531,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:E6,depthTest:!1,depthWrite:!1})}function D4e(){return new _2({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:N1e(),fragmentShader:` + `,blending:E6,depthTest:!1,depthWrite:!1})}function E4e(){return new _2({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:N1e(),fragmentShader:` precision mediump float; precision mediump int; @@ -3602,37 +3602,37 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function Qyt(t){let e=new WeakMap,n=null;function o(l){if(l&&l.isTexture){const s=l.mapping,c=s===SF||s===TF,u=s===K6||s===$8;if(c||u)if(l.isRenderTargetTexture&&l.needsPMREMUpdate===!0){l.needsPMREMUpdate=!1;let d=e.get(l);return n===null&&(n=new wce(t)),d=c?n.fromEquirectangular(l,d):n.fromCubemap(l,d),e.set(l,d),d.texture}else{if(e.has(l))return e.get(l).texture;{const d=l.image;if(c&&d&&d.height>0||u&&d&&r(d)){n===null&&(n=new wce(t));const f=c?n.fromEquirectangular(l):n.fromCubemap(l);return e.set(l,f),l.addEventListener("dispose",i),f.texture}else return null}}}return l}function r(l){let s=0;const c=6;for(let u=0;ue.maxTextureSize&&(D=Math.ceil(M/e.maxTextureSize),M=e.maxTextureSize);const E=new Float32Array(M*D*4*y),W=new aq(E,M,D,y);W.type=v2,W.needsUpdate=!0;const j=R*4;for(let k=0;k0)return t;const r=e*n;let i=E4e[r];if(i===void 0&&(i=new Float32Array(r),E4e[r]=i),e!==0){o.toArray(i,0);for(let a=1,l=0;a!==e;++a)l+=n,t[a].toArray(i,l)}return i}function Yu(t,e){if(t.length!==e.length)return!1;for(let n=0,o=t.length;n0||u&&d&&r(d)){n===null&&(n=new wce(t));const f=c?n.fromEquirectangular(l):n.fromCubemap(l);return e.set(l,f),l.addEventListener("dispose",i),f.texture}else return null}}}return l}function r(l){let s=0;const c=6;for(let u=0;ue.maxTextureSize&&(D=Math.ceil(M/e.maxTextureSize),M=e.maxTextureSize);const E=new Float32Array(M*D*4*y),W=new lq(E,M,D,y);W.type=v2,W.needsUpdate=!0;const j=R*4;for(let k=0;k0)return t;const r=e*n;let i=F4e[r];if(i===void 0&&(i=new Float32Array(r),F4e[r]=i),e!==0){o.toArray(i,0);for(let a=1,l=0;a!==e;++a)l+=n,t[a].toArray(i,l)}return i}function Yu(t,e){if(t.length!==e.length)return!1;for(let n=0,o=t.length;n":" "} ${l}: ${n[a]}`)}return o.join(` -`)}function e5t(t){const e=cs.getPrimaries(cs.workingColorSpace),n=cs.getPrimaries(t);let o;switch(e===n?o="":e===zF&&n===IF?o="LinearDisplayP3ToLinearSRGB":e===IF&&n===zF&&(o="LinearSRGBToLinearDisplayP3"),t){case L9:case QL:return[o,"LinearTransferOETF"];case ru:case iq:return[o,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[o,"LinearTransferOETF"]}}function j4e(t,e,n){const o=t.getShaderParameter(e,t.COMPILE_STATUS),r=t.getShaderInfoLog(e).trim();if(o&&r==="")return"";const i=/ERROR: 0:(\d+)/.exec(r);if(i){const a=parseInt(i[1]);return n.toUpperCase()+` +`)}function e5t(t){const e=cs.getPrimaries(cs.workingColorSpace),n=cs.getPrimaries(t);let o;switch(e===n?o="":e===zF&&n===IF?o="LinearDisplayP3ToLinearSRGB":e===IF&&n===zF&&(o="LinearSRGBToLinearDisplayP3"),t){case L9:case QL:return[o,"LinearTransferOETF"];case ru:case aq:return[o,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[o,"LinearTransferOETF"]}}function B4e(t,e,n){const o=t.getShaderParameter(e,t.COMPILE_STATUS),r=t.getShaderInfoLog(e).trim();if(o&&r==="")return"";const i=/ERROR: 0:(\d+)/.exec(r);if(i){const a=parseInt(i[1]);return n.toUpperCase()+` `+r+` -`+Z2t(t.getShaderSource(e),a)}else return r}function t5t(t,e){const n=e5t(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function n5t(t,e){let n;switch(e){case XWe:n="Linear";break;case JWe:n="Reinhard";break;case KWe:n="OptimizedCineon";break;case b1e:n="ACESFilmic";break;case qWe:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function o5t(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(PD).join(` +`+Z2t(t.getShaderSource(e),a)}else return r}function t5t(t,e){const n=e5t(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function n5t(t,e){let n;switch(e){case JWe:n="Linear";break;case KWe:n="Reinhard";break;case qWe:n="OptimizedCineon";break;case b1e:n="ACESFilmic";break;case $We:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function o5t(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(PD).join(` `)}function r5t(t){const e=[];for(const n in t){const o=t[n];o!==!1&&e.push("#define "+n+" "+o)}return e.join(` -`)}function i5t(t,e){const n={},o=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function vce(t){return t.replace(a5t,s5t)}const l5t=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function s5t(t,e){let n=fa[e];if(n===void 0){const o=l5t.get(e);if(o!==void 0)n=fa[o],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,o);else throw new Error("Can not resolve #include <"+e+">")}return vce(n)}const c5t=/#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 O4e(t){return t.replace(c5t,u5t)}function u5t(t,e,n,o){let r="";for(let i=parseInt(e);i/gm;function vce(t){return t.replace(a5t,s5t)}const l5t=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function s5t(t,e){let n=ha[e];if(n===void 0){const o=l5t.get(e);if(o!==void 0)n=ha[o],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,o);else throw new Error("Can not resolve #include <"+e+">")}return vce(n)}const c5t=/#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 _4e(t){return t.replace(c5t,u5t)}function u5t(t,e,n,o){let r="";for(let i=parseInt(e);i0&&(w+=` `),b=[p,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(PD).join(` `),b.length>0&&(b+=` -`)):(w=[_4e(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+s:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#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",` +`)):(w=[V4e(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+s:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#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(PD).join(` -`),b=[p,_4e(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+s:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==T9?"#define TONE_MAPPING":"",n.toneMapping!==T9?fa.tonemapping_pars_fragment:"",n.toneMapping!==T9?n5t("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",fa.colorspace_pars_fragment,t5t("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`),b=[p,V4e(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+s:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==T9?"#define TONE_MAPPING":"",n.toneMapping!==T9?ha.tonemapping_pars_fragment:"",n.toneMapping!==T9?n5t("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",ha.colorspace_pars_fragment,t5t("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` `].filter(PD).join(` -`)),a=vce(a),a=B4e(a,n),a=Y4e(a,n),l=vce(l),l=B4e(l,n),l=Y4e(l,n),a=O4e(a),l=O4e(l),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(C=`#version 300 es +`)),a=vce(a),a=Y4e(a,n),a=O4e(a,n),l=vce(l),l=Y4e(l,n),l=O4e(l,n),a=_4e(a),l=_4e(l),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(C=`#version 300 es `,w=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` `+w,b=["precision mediump sampler2DArray;","#define varying in",n.glslVersion===yce?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===yce?"":"#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(` `)+` -`+b);const P=C+w+a,v=C+b+l,T=U4e(r,r.VERTEX_SHADER,P),A=U4e(r,r.FRAGMENT_SHADER,v);r.attachShader(y,T),r.attachShader(y,A),n.index0AttributeName!==void 0?r.bindAttribLocation(y,0,n.index0AttributeName):n.morphTargets===!0&&r.bindAttribLocation(y,0,"position"),r.linkProgram(y);function x(D){if(t.debug.checkShaderErrors){const E=r.getProgramInfoLog(y).trim(),W=r.getShaderInfoLog(T).trim(),j=r.getShaderInfoLog(A).trim();let L=!0,k=!0;if(r.getProgramParameter(y,r.LINK_STATUS)===!1)if(L=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(r,y,T,A);else{const N=j4e(r,T,"vertex"),F=j4e(r,A,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(y,r.VALIDATE_STATUS)+` +`+b);const P=C+w+a,v=C+b+l,T=j4e(r,r.VERTEX_SHADER,P),A=j4e(r,r.FRAGMENT_SHADER,v);r.attachShader(y,T),r.attachShader(y,A),n.index0AttributeName!==void 0?r.bindAttribLocation(y,0,n.index0AttributeName):n.morphTargets===!0&&r.bindAttribLocation(y,0,"position"),r.linkProgram(y);function x(D){if(t.debug.checkShaderErrors){const E=r.getProgramInfoLog(y).trim(),W=r.getShaderInfoLog(T).trim(),j=r.getShaderInfoLog(A).trim();let L=!0,k=!0;if(r.getProgramParameter(y,r.LINK_STATUS)===!1)if(L=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(r,y,T,A);else{const N=B4e(r,T,"vertex"),F=B4e(r,A,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(y,r.VALIDATE_STATUS)+` Program Info Log: `+E+` `+N+` -`+F)}else E!==""?console.warn("THREE.WebGLProgram: Program Info Log:",E):(W===""||j==="")&&(k=!1);k&&(D.diagnostics={runnable:L,programLog:E,vertexShader:{log:W,prefix:w},fragmentShader:{log:j,prefix:b}})}r.deleteShader(T),r.deleteShader(A),S=new I_(r,y),R=i5t(r,y)}let S;this.getUniforms=function(){return S===void 0&&x(this),S};let R;this.getAttributes=function(){return R===void 0&&x(this),R};let M=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=r.getProgramParameter(y,$2t)),M},this.destroy=function(){o.releaseStatesOfProgram(this),r.deleteProgram(y),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Q2t++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=T,this.fragmentShader=A,this}let y5t=0;class A5t{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,o=e.fragmentShader,r=this._getShaderStage(n),i=this._getShaderStage(o),a=this._getShaderCacheForMaterial(e);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(i)===!1&&(a.add(i),i.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const o of n)o.usedTimes--,o.usedTimes===0&&this.shaderCache.delete(o.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let o=n.get(e);return o===void 0&&(o=new Set,n.set(e,o)),o}_getShaderStage(e){const n=this.shaderCache;let o=n.get(e);return o===void 0&&(o=new w5t(e),n.set(e,o)),o}}class w5t{constructor(e){this.id=y5t++,this.code=e,this.usedTimes=0}}function v5t(t,e,n,o,r,i,a){const l=new lx,s=new A5t,c=[],u=r.isWebGL2,d=r.logarithmicDepthBuffer,f=r.vertexTextures;let p=r.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function y(R){return R===0?"uv":`uv${R}`}function w(R,M,D,E,W){const j=E.fog,L=W.geometry,k=R.isMeshStandardMaterial?E.environment:null,N=(R.isMeshStandardMaterial?n:e).get(R.envMap||k),F=N&&N.mapping===PH?N.image.height:null,U=g[R.type];R.precision!==null&&(p=r.getMaxPrecision(R.precision),p!==R.precision&&console.warn("THREE.WebGLProgram.getParameters:",R.precision,"not supported, using",p,"instead."));const O=L.morphAttributes.position||L.morphAttributes.normal||L.morphAttributes.color,B=O!==void 0?O.length:0;let _=0;L.morphAttributes.position!==void 0&&(_=1),L.morphAttributes.normal!==void 0&&(_=2),L.morphAttributes.color!==void 0&&(_=3);let X,$,Q,le;if(U){const st=m2[U];X=st.vertexShader,$=st.fragmentShader}else X=R.vertexShader,$=R.fragmentShader,s.update(R),Q=s.getVertexShaderID(R),le=s.getFragmentShaderID(R);const q=t.getRenderTarget(),te=W.isInstancedMesh===!0,re=!!R.map,ae=!!R.matcap,se=!!N,ne=!!R.aoMap,fe=!!R.lightMap,ge=!!R.bumpMap,de=!!R.normalMap,Z=!!R.displacementMap,he=!!R.emissiveMap,xe=!!R.metalnessMap,He=!!R.roughnessMap,Se=R.anisotropy>0,ze=R.clearcoat>0,Ie=R.iridescence>0,ye=R.sheen>0,ce=R.transmission>0,pe=Se&&!!R.anisotropyMap,ve=ze&&!!R.clearcoatMap,Ae=ze&&!!R.clearcoatNormalMap,Te=ze&&!!R.clearcoatRoughnessMap,Me=Ie&&!!R.iridescenceMap,Pe=Ie&&!!R.iridescenceThicknessMap,Ee=ye&&!!R.sheenColorMap,Be=ye&&!!R.sheenRoughnessMap,Je=!!R.specularMap,We=!!R.specularColorMap,Ke=!!R.specularIntensityMap,Ne=ce&&!!R.transmissionMap,De=ce&&!!R.thicknessMap,ke=!!R.gradientMap,Ye=!!R.alphaMap,it=R.alphaTest>0,Ve=!!R.alphaHash,yt=!!R.extensions,ct=!!L.attributes.uv1,Xe=!!L.attributes.uv2,ut=!!L.attributes.uv3;let ft=T9;return R.toneMapped&&(q===null||q.isXRRenderTarget===!0)&&(ft=t.toneMapping),{isWebGL2:u,shaderID:U,shaderType:R.type,shaderName:R.name,vertexShader:X,fragmentShader:$,defines:R.defines,customVertexShaderID:Q,customFragmentShaderID:le,isRawShaderMaterial:R.isRawShaderMaterial===!0,glslVersion:R.glslVersion,precision:p,instancing:te,instancingColor:te&&W.instanceColor!==null,supportsVertexTextures:f,outputColorSpace:q===null?t.outputColorSpace:q.isXRRenderTarget===!0?q.texture.colorSpace:L9,map:re,matcap:ae,envMap:se,envMapMode:se&&N.mapping,envMapCubeUVHeight:F,aoMap:ne,lightMap:fe,bumpMap:ge,normalMap:de,displacementMap:f&&Z,emissiveMap:he,normalMapObjectSpace:de&&R.normalMapType===dNe,normalMapTangentSpace:de&&R.normalMapType===Cw,metalnessMap:xe,roughnessMap:He,anisotropy:Se,anisotropyMap:pe,clearcoat:ze,clearcoatMap:ve,clearcoatNormalMap:Ae,clearcoatRoughnessMap:Te,iridescence:Ie,iridescenceMap:Me,iridescenceThicknessMap:Pe,sheen:ye,sheenColorMap:Ee,sheenRoughnessMap:Be,specularMap:Je,specularColorMap:We,specularIntensityMap:Ke,transmission:ce,transmissionMap:Ne,thicknessMap:De,gradientMap:ke,opaque:R.transparent===!1&&R.blending===ix,alphaMap:Ye,alphaTest:it,alphaHash:Ve,combine:R.combine,mapUv:re&&y(R.map.channel),aoMapUv:ne&&y(R.aoMap.channel),lightMapUv:fe&&y(R.lightMap.channel),bumpMapUv:ge&&y(R.bumpMap.channel),normalMapUv:de&&y(R.normalMap.channel),displacementMapUv:Z&&y(R.displacementMap.channel),emissiveMapUv:he&&y(R.emissiveMap.channel),metalnessMapUv:xe&&y(R.metalnessMap.channel),roughnessMapUv:He&&y(R.roughnessMap.channel),anisotropyMapUv:pe&&y(R.anisotropyMap.channel),clearcoatMapUv:ve&&y(R.clearcoatMap.channel),clearcoatNormalMapUv:Ae&&y(R.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Te&&y(R.clearcoatRoughnessMap.channel),iridescenceMapUv:Me&&y(R.iridescenceMap.channel),iridescenceThicknessMapUv:Pe&&y(R.iridescenceThicknessMap.channel),sheenColorMapUv:Ee&&y(R.sheenColorMap.channel),sheenRoughnessMapUv:Be&&y(R.sheenRoughnessMap.channel),specularMapUv:Je&&y(R.specularMap.channel),specularColorMapUv:We&&y(R.specularColorMap.channel),specularIntensityMapUv:Ke&&y(R.specularIntensityMap.channel),transmissionMapUv:Ne&&y(R.transmissionMap.channel),thicknessMapUv:De&&y(R.thicknessMap.channel),alphaMapUv:Ye&&y(R.alphaMap.channel),vertexTangents:!!L.attributes.tangent&&(de||Se),vertexColors:R.vertexColors,vertexAlphas:R.vertexColors===!0&&!!L.attributes.color&&L.attributes.color.itemSize===4,vertexUv1s:ct,vertexUv2s:Xe,vertexUv3s:ut,pointsUvs:W.isPoints===!0&&!!L.attributes.uv&&(re||Ye),fog:!!j,useFog:R.fog===!0,fogExp2:j&&j.isFogExp2,flatShading:R.flatShading===!0,sizeAttenuation:R.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:W.isSkinnedMesh===!0,morphTargets:L.morphAttributes.position!==void 0,morphNormals:L.morphAttributes.normal!==void 0,morphColors:L.morphAttributes.color!==void 0,morphTargetsCount:B,morphTextureStride:_,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:R.dithering,shadowMapEnabled:t.shadowMap.enabled&&D.length>0,shadowMapType:t.shadowMap.type,toneMapping:ft,useLegacyLights:t._useLegacyLights,decodeVideoTexture:re&&R.map.isVideoTexture===!0&&cs.getTransfer(R.map.colorSpace)===Ys,premultipliedAlpha:R.premultipliedAlpha,doubleSided:R.side===$r,flipSided:R.side===p0,useDepthPacking:R.depthPacking>=0,depthPacking:R.depthPacking||0,index0AttributeName:R.index0AttributeName,extensionDerivatives:yt&&R.extensions.derivatives===!0,extensionFragDepth:yt&&R.extensions.fragDepth===!0,extensionDrawBuffers:yt&&R.extensions.drawBuffers===!0,extensionShaderTextureLOD:yt&&R.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:u||o.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||o.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||o.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:o.has("KHR_parallel_shader_compile"),customProgramCacheKey:R.customProgramCacheKey()}}function b(R){const M=[];if(R.shaderID?M.push(R.shaderID):(M.push(R.customVertexShaderID),M.push(R.customFragmentShaderID)),R.defines!==void 0)for(const D in R.defines)M.push(D),M.push(R.defines[D]);return R.isRawShaderMaterial===!1&&(C(M,R),P(M,R),M.push(t.outputColorSpace)),M.push(R.customProgramCacheKey),M.join()}function C(R,M){R.push(M.precision),R.push(M.outputColorSpace),R.push(M.envMapMode),R.push(M.envMapCubeUVHeight),R.push(M.mapUv),R.push(M.alphaMapUv),R.push(M.lightMapUv),R.push(M.aoMapUv),R.push(M.bumpMapUv),R.push(M.normalMapUv),R.push(M.displacementMapUv),R.push(M.emissiveMapUv),R.push(M.metalnessMapUv),R.push(M.roughnessMapUv),R.push(M.anisotropyMapUv),R.push(M.clearcoatMapUv),R.push(M.clearcoatNormalMapUv),R.push(M.clearcoatRoughnessMapUv),R.push(M.iridescenceMapUv),R.push(M.iridescenceThicknessMapUv),R.push(M.sheenColorMapUv),R.push(M.sheenRoughnessMapUv),R.push(M.specularMapUv),R.push(M.specularColorMapUv),R.push(M.specularIntensityMapUv),R.push(M.transmissionMapUv),R.push(M.thicknessMapUv),R.push(M.combine),R.push(M.fogExp2),R.push(M.sizeAttenuation),R.push(M.morphTargetsCount),R.push(M.morphAttributeCount),R.push(M.numDirLights),R.push(M.numPointLights),R.push(M.numSpotLights),R.push(M.numSpotLightMaps),R.push(M.numHemiLights),R.push(M.numRectAreaLights),R.push(M.numDirLightShadows),R.push(M.numPointLightShadows),R.push(M.numSpotLightShadows),R.push(M.numSpotLightShadowsWithMaps),R.push(M.numLightProbes),R.push(M.shadowMapType),R.push(M.toneMapping),R.push(M.numClippingPlanes),R.push(M.numClipIntersection),R.push(M.depthPacking)}function P(R,M){l.disableAll(),M.isWebGL2&&l.enable(0),M.supportsVertexTextures&&l.enable(1),M.instancing&&l.enable(2),M.instancingColor&&l.enable(3),M.matcap&&l.enable(4),M.envMap&&l.enable(5),M.normalMapObjectSpace&&l.enable(6),M.normalMapTangentSpace&&l.enable(7),M.clearcoat&&l.enable(8),M.iridescence&&l.enable(9),M.alphaTest&&l.enable(10),M.vertexColors&&l.enable(11),M.vertexAlphas&&l.enable(12),M.vertexUv1s&&l.enable(13),M.vertexUv2s&&l.enable(14),M.vertexUv3s&&l.enable(15),M.vertexTangents&&l.enable(16),M.anisotropy&&l.enable(17),M.alphaHash&&l.enable(18),R.push(l.mask),l.disableAll(),M.fog&&l.enable(0),M.useFog&&l.enable(1),M.flatShading&&l.enable(2),M.logarithmicDepthBuffer&&l.enable(3),M.skinning&&l.enable(4),M.morphTargets&&l.enable(5),M.morphNormals&&l.enable(6),M.morphColors&&l.enable(7),M.premultipliedAlpha&&l.enable(8),M.shadowMapEnabled&&l.enable(9),M.useLegacyLights&&l.enable(10),M.doubleSided&&l.enable(11),M.flipSided&&l.enable(12),M.useDepthPacking&&l.enable(13),M.dithering&&l.enable(14),M.transmission&&l.enable(15),M.sheen&&l.enable(16),M.opaque&&l.enable(17),M.pointsUvs&&l.enable(18),M.decodeVideoTexture&&l.enable(19),R.push(l.mask)}function v(R){const M=g[R.type];let D;if(M){const E=m2[M];D=kF.clone(E.uniforms)}else D=R.uniforms;return D}function T(R,M){let D;for(let E=0,W=c.length;E0?o.push(b):p.transparent===!0?r.push(b):n.push(b)}function s(d,f,p,g,y,w){const b=a(d,f,p,g,y,w);p.transmission>0?o.unshift(b):p.transparent===!0?r.unshift(b):n.unshift(b)}function c(d,f){n.length>1&&n.sort(d||b5t),o.length>1&&o.sort(f||V4e),r.length>1&&r.sort(f||V4e)}function u(){for(let d=e,f=t.length;d=i.length?(a=new G4e,i.push(a)):a=i[r],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function T5t(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new ie,color:new rr};break;case"SpotLight":n={position:new ie,direction:new ie,color:new rr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ie,color:new rr,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ie,skyColor:new rr,groundColor:new rr};break;case"RectAreaLight":n={color:new rr,position:new ie,halfWidth:new ie,halfHeight:new ie};break}return t[e.id]=n,n}}}function P5t(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xt};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let C5t=0;function R5t(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function H5t(t,e){const n=new T5t,o=P5t(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let u=0;u<9;u++)r.probe.push(new ie);const i=new ie,a=new Ji,l=new Ji;function s(u,d){let f=0,p=0,g=0;for(let E=0;E<9;E++)r.probe[E].set(0,0,0);let y=0,w=0,b=0,C=0,P=0,v=0,T=0,A=0,x=0,S=0,R=0;u.sort(R5t);const M=d===!0?Math.PI:1;for(let E=0,W=u.length;E0&&(e.isWebGL2||t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=mr.LTC_FLOAT_1,r.rectAreaLTC2=mr.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=mr.LTC_HALF_1,r.rectAreaLTC2=mr.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=f,r.ambient[1]=p,r.ambient[2]=g;const D=r.hash;(D.directionalLength!==y||D.pointLength!==w||D.spotLength!==b||D.rectAreaLength!==C||D.hemiLength!==P||D.numDirectionalShadows!==v||D.numPointShadows!==T||D.numSpotShadows!==A||D.numSpotMaps!==x||D.numLightProbes!==R)&&(r.directional.length=y,r.spot.length=b,r.rectArea.length=C,r.point.length=w,r.hemi.length=P,r.directionalShadow.length=v,r.directionalShadowMap.length=v,r.pointShadow.length=T,r.pointShadowMap.length=T,r.spotShadow.length=A,r.spotShadowMap.length=A,r.directionalShadowMatrix.length=v,r.pointShadowMatrix.length=T,r.spotLightMatrix.length=A+x-S,r.spotLightMap.length=x,r.numSpotLightShadowsWithMaps=S,r.numLightProbes=R,D.directionalLength=y,D.pointLength=w,D.spotLength=b,D.rectAreaLength=C,D.hemiLength=P,D.numDirectionalShadows=v,D.numPointShadows=T,D.numSpotShadows=A,D.numSpotMaps=x,D.numLightProbes=R,r.version=C5t++)}function c(u,d){let f=0,p=0,g=0,y=0,w=0;const b=d.matrixWorldInverse;for(let C=0,P=u.length;C=l.length?(s=new X4e(t,e),l.push(s)):s=l[a],s}function r(){n=new WeakMap}return{get:o,dispose:r}}class cq extends Pf{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=uNe,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 uq extends Pf{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const I5t=`void main() { +`+F)}else E!==""?console.warn("THREE.WebGLProgram: Program Info Log:",E):(W===""||j==="")&&(k=!1);k&&(D.diagnostics={runnable:L,programLog:E,vertexShader:{log:W,prefix:w},fragmentShader:{log:j,prefix:b}})}r.deleteShader(T),r.deleteShader(A),S=new z_(r,y),R=i5t(r,y)}let S;this.getUniforms=function(){return S===void 0&&x(this),S};let R;this.getAttributes=function(){return R===void 0&&x(this),R};let M=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=r.getProgramParameter(y,$2t)),M},this.destroy=function(){o.releaseStatesOfProgram(this),r.deleteProgram(y),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Q2t++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=T,this.fragmentShader=A,this}let y5t=0;class A5t{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,o=e.fragmentShader,r=this._getShaderStage(n),i=this._getShaderStage(o),a=this._getShaderCacheForMaterial(e);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(i)===!1&&(a.add(i),i.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const o of n)o.usedTimes--,o.usedTimes===0&&this.shaderCache.delete(o.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let o=n.get(e);return o===void 0&&(o=new Set,n.set(e,o)),o}_getShaderStage(e){const n=this.shaderCache;let o=n.get(e);return o===void 0&&(o=new w5t(e),n.set(e,o)),o}}class w5t{constructor(e){this.id=y5t++,this.code=e,this.usedTimes=0}}function v5t(t,e,n,o,r,i,a){const l=new lx,s=new A5t,c=[],u=r.isWebGL2,d=r.logarithmicDepthBuffer,f=r.vertexTextures;let p=r.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function y(R){return R===0?"uv":`uv${R}`}function w(R,M,D,E,W){const j=E.fog,L=W.geometry,k=R.isMeshStandardMaterial?E.environment:null,N=(R.isMeshStandardMaterial?n:e).get(R.envMap||k),F=N&&N.mapping===PH?N.image.height:null,U=g[R.type];R.precision!==null&&(p=r.getMaxPrecision(R.precision),p!==R.precision&&console.warn("THREE.WebGLProgram.getParameters:",R.precision,"not supported, using",p,"instead."));const O=L.morphAttributes.position||L.morphAttributes.normal||L.morphAttributes.color,B=O!==void 0?O.length:0;let _=0;L.morphAttributes.position!==void 0&&(_=1),L.morphAttributes.normal!==void 0&&(_=2),L.morphAttributes.color!==void 0&&(_=3);let X,$,Q,le;if(U){const st=m2[U];X=st.vertexShader,$=st.fragmentShader}else X=R.vertexShader,$=R.fragmentShader,s.update(R),Q=s.getVertexShaderID(R),le=s.getFragmentShaderID(R);const q=t.getRenderTarget(),te=W.isInstancedMesh===!0,re=!!R.map,ae=!!R.matcap,se=!!N,ne=!!R.aoMap,fe=!!R.lightMap,ge=!!R.bumpMap,de=!!R.normalMap,Z=!!R.displacementMap,he=!!R.emissiveMap,xe=!!R.metalnessMap,He=!!R.roughnessMap,Se=R.anisotropy>0,ze=R.clearcoat>0,Ie=R.iridescence>0,ye=R.sheen>0,ce=R.transmission>0,pe=Se&&!!R.anisotropyMap,ve=ze&&!!R.clearcoatMap,Ae=ze&&!!R.clearcoatNormalMap,Te=ze&&!!R.clearcoatRoughnessMap,Me=Ie&&!!R.iridescenceMap,Pe=Ie&&!!R.iridescenceThicknessMap,Ee=ye&&!!R.sheenColorMap,Be=ye&&!!R.sheenRoughnessMap,Je=!!R.specularMap,We=!!R.specularColorMap,Ke=!!R.specularIntensityMap,Ne=ce&&!!R.transmissionMap,De=ce&&!!R.thicknessMap,ke=!!R.gradientMap,Ye=!!R.alphaMap,it=R.alphaTest>0,Ve=!!R.alphaHash,yt=!!R.extensions,ct=!!L.attributes.uv1,Xe=!!L.attributes.uv2,ut=!!L.attributes.uv3;let ft=T9;return R.toneMapped&&(q===null||q.isXRRenderTarget===!0)&&(ft=t.toneMapping),{isWebGL2:u,shaderID:U,shaderType:R.type,shaderName:R.name,vertexShader:X,fragmentShader:$,defines:R.defines,customVertexShaderID:Q,customFragmentShaderID:le,isRawShaderMaterial:R.isRawShaderMaterial===!0,glslVersion:R.glslVersion,precision:p,instancing:te,instancingColor:te&&W.instanceColor!==null,supportsVertexTextures:f,outputColorSpace:q===null?t.outputColorSpace:q.isXRRenderTarget===!0?q.texture.colorSpace:L9,map:re,matcap:ae,envMap:se,envMapMode:se&&N.mapping,envMapCubeUVHeight:F,aoMap:ne,lightMap:fe,bumpMap:ge,normalMap:de,displacementMap:f&&Z,emissiveMap:he,normalMapObjectSpace:de&&R.normalMapType===fNe,normalMapTangentSpace:de&&R.normalMapType===Cw,metalnessMap:xe,roughnessMap:He,anisotropy:Se,anisotropyMap:pe,clearcoat:ze,clearcoatMap:ve,clearcoatNormalMap:Ae,clearcoatRoughnessMap:Te,iridescence:Ie,iridescenceMap:Me,iridescenceThicknessMap:Pe,sheen:ye,sheenColorMap:Ee,sheenRoughnessMap:Be,specularMap:Je,specularColorMap:We,specularIntensityMap:Ke,transmission:ce,transmissionMap:Ne,thicknessMap:De,gradientMap:ke,opaque:R.transparent===!1&&R.blending===ix,alphaMap:Ye,alphaTest:it,alphaHash:Ve,combine:R.combine,mapUv:re&&y(R.map.channel),aoMapUv:ne&&y(R.aoMap.channel),lightMapUv:fe&&y(R.lightMap.channel),bumpMapUv:ge&&y(R.bumpMap.channel),normalMapUv:de&&y(R.normalMap.channel),displacementMapUv:Z&&y(R.displacementMap.channel),emissiveMapUv:he&&y(R.emissiveMap.channel),metalnessMapUv:xe&&y(R.metalnessMap.channel),roughnessMapUv:He&&y(R.roughnessMap.channel),anisotropyMapUv:pe&&y(R.anisotropyMap.channel),clearcoatMapUv:ve&&y(R.clearcoatMap.channel),clearcoatNormalMapUv:Ae&&y(R.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Te&&y(R.clearcoatRoughnessMap.channel),iridescenceMapUv:Me&&y(R.iridescenceMap.channel),iridescenceThicknessMapUv:Pe&&y(R.iridescenceThicknessMap.channel),sheenColorMapUv:Ee&&y(R.sheenColorMap.channel),sheenRoughnessMapUv:Be&&y(R.sheenRoughnessMap.channel),specularMapUv:Je&&y(R.specularMap.channel),specularColorMapUv:We&&y(R.specularColorMap.channel),specularIntensityMapUv:Ke&&y(R.specularIntensityMap.channel),transmissionMapUv:Ne&&y(R.transmissionMap.channel),thicknessMapUv:De&&y(R.thicknessMap.channel),alphaMapUv:Ye&&y(R.alphaMap.channel),vertexTangents:!!L.attributes.tangent&&(de||Se),vertexColors:R.vertexColors,vertexAlphas:R.vertexColors===!0&&!!L.attributes.color&&L.attributes.color.itemSize===4,vertexUv1s:ct,vertexUv2s:Xe,vertexUv3s:ut,pointsUvs:W.isPoints===!0&&!!L.attributes.uv&&(re||Ye),fog:!!j,useFog:R.fog===!0,fogExp2:j&&j.isFogExp2,flatShading:R.flatShading===!0,sizeAttenuation:R.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:W.isSkinnedMesh===!0,morphTargets:L.morphAttributes.position!==void 0,morphNormals:L.morphAttributes.normal!==void 0,morphColors:L.morphAttributes.color!==void 0,morphTargetsCount:B,morphTextureStride:_,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:R.dithering,shadowMapEnabled:t.shadowMap.enabled&&D.length>0,shadowMapType:t.shadowMap.type,toneMapping:ft,useLegacyLights:t._useLegacyLights,decodeVideoTexture:re&&R.map.isVideoTexture===!0&&cs.getTransfer(R.map.colorSpace)===Ys,premultipliedAlpha:R.premultipliedAlpha,doubleSided:R.side===$r,flipSided:R.side===p0,useDepthPacking:R.depthPacking>=0,depthPacking:R.depthPacking||0,index0AttributeName:R.index0AttributeName,extensionDerivatives:yt&&R.extensions.derivatives===!0,extensionFragDepth:yt&&R.extensions.fragDepth===!0,extensionDrawBuffers:yt&&R.extensions.drawBuffers===!0,extensionShaderTextureLOD:yt&&R.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:u||o.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||o.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||o.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:o.has("KHR_parallel_shader_compile"),customProgramCacheKey:R.customProgramCacheKey()}}function b(R){const M=[];if(R.shaderID?M.push(R.shaderID):(M.push(R.customVertexShaderID),M.push(R.customFragmentShaderID)),R.defines!==void 0)for(const D in R.defines)M.push(D),M.push(R.defines[D]);return R.isRawShaderMaterial===!1&&(C(M,R),P(M,R),M.push(t.outputColorSpace)),M.push(R.customProgramCacheKey),M.join()}function C(R,M){R.push(M.precision),R.push(M.outputColorSpace),R.push(M.envMapMode),R.push(M.envMapCubeUVHeight),R.push(M.mapUv),R.push(M.alphaMapUv),R.push(M.lightMapUv),R.push(M.aoMapUv),R.push(M.bumpMapUv),R.push(M.normalMapUv),R.push(M.displacementMapUv),R.push(M.emissiveMapUv),R.push(M.metalnessMapUv),R.push(M.roughnessMapUv),R.push(M.anisotropyMapUv),R.push(M.clearcoatMapUv),R.push(M.clearcoatNormalMapUv),R.push(M.clearcoatRoughnessMapUv),R.push(M.iridescenceMapUv),R.push(M.iridescenceThicknessMapUv),R.push(M.sheenColorMapUv),R.push(M.sheenRoughnessMapUv),R.push(M.specularMapUv),R.push(M.specularColorMapUv),R.push(M.specularIntensityMapUv),R.push(M.transmissionMapUv),R.push(M.thicknessMapUv),R.push(M.combine),R.push(M.fogExp2),R.push(M.sizeAttenuation),R.push(M.morphTargetsCount),R.push(M.morphAttributeCount),R.push(M.numDirLights),R.push(M.numPointLights),R.push(M.numSpotLights),R.push(M.numSpotLightMaps),R.push(M.numHemiLights),R.push(M.numRectAreaLights),R.push(M.numDirLightShadows),R.push(M.numPointLightShadows),R.push(M.numSpotLightShadows),R.push(M.numSpotLightShadowsWithMaps),R.push(M.numLightProbes),R.push(M.shadowMapType),R.push(M.toneMapping),R.push(M.numClippingPlanes),R.push(M.numClipIntersection),R.push(M.depthPacking)}function P(R,M){l.disableAll(),M.isWebGL2&&l.enable(0),M.supportsVertexTextures&&l.enable(1),M.instancing&&l.enable(2),M.instancingColor&&l.enable(3),M.matcap&&l.enable(4),M.envMap&&l.enable(5),M.normalMapObjectSpace&&l.enable(6),M.normalMapTangentSpace&&l.enable(7),M.clearcoat&&l.enable(8),M.iridescence&&l.enable(9),M.alphaTest&&l.enable(10),M.vertexColors&&l.enable(11),M.vertexAlphas&&l.enable(12),M.vertexUv1s&&l.enable(13),M.vertexUv2s&&l.enable(14),M.vertexUv3s&&l.enable(15),M.vertexTangents&&l.enable(16),M.anisotropy&&l.enable(17),M.alphaHash&&l.enable(18),R.push(l.mask),l.disableAll(),M.fog&&l.enable(0),M.useFog&&l.enable(1),M.flatShading&&l.enable(2),M.logarithmicDepthBuffer&&l.enable(3),M.skinning&&l.enable(4),M.morphTargets&&l.enable(5),M.morphNormals&&l.enable(6),M.morphColors&&l.enable(7),M.premultipliedAlpha&&l.enable(8),M.shadowMapEnabled&&l.enable(9),M.useLegacyLights&&l.enable(10),M.doubleSided&&l.enable(11),M.flipSided&&l.enable(12),M.useDepthPacking&&l.enable(13),M.dithering&&l.enable(14),M.transmission&&l.enable(15),M.sheen&&l.enable(16),M.opaque&&l.enable(17),M.pointsUvs&&l.enable(18),M.decodeVideoTexture&&l.enable(19),R.push(l.mask)}function v(R){const M=g[R.type];let D;if(M){const E=m2[M];D=kF.clone(E.uniforms)}else D=R.uniforms;return D}function T(R,M){let D;for(let E=0,W=c.length;E0?o.push(b):p.transparent===!0?r.push(b):n.push(b)}function s(d,f,p,g,y,w){const b=a(d,f,p,g,y,w);p.transmission>0?o.unshift(b):p.transparent===!0?r.unshift(b):n.unshift(b)}function c(d,f){n.length>1&&n.sort(d||b5t),o.length>1&&o.sort(f||G4e),r.length>1&&r.sort(f||G4e)}function u(){for(let d=e,f=t.length;d=i.length?(a=new X4e,i.push(a)):a=i[r],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function T5t(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new ie,color:new rr};break;case"SpotLight":n={position:new ie,direction:new ie,color:new rr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ie,color:new rr,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ie,skyColor:new rr,groundColor:new rr};break;case"RectAreaLight":n={color:new rr,position:new ie,halfWidth:new ie,halfHeight:new ie};break}return t[e.id]=n,n}}}function P5t(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xt};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let C5t=0;function R5t(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function H5t(t,e){const n=new T5t,o=P5t(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let u=0;u<9;u++)r.probe.push(new ie);const i=new ie,a=new Ji,l=new Ji;function s(u,d){let f=0,p=0,g=0;for(let E=0;E<9;E++)r.probe[E].set(0,0,0);let y=0,w=0,b=0,C=0,P=0,v=0,T=0,A=0,x=0,S=0,R=0;u.sort(R5t);const M=d===!0?Math.PI:1;for(let E=0,W=u.length;E0&&(e.isWebGL2||t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=mr.LTC_FLOAT_1,r.rectAreaLTC2=mr.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=mr.LTC_HALF_1,r.rectAreaLTC2=mr.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=f,r.ambient[1]=p,r.ambient[2]=g;const D=r.hash;(D.directionalLength!==y||D.pointLength!==w||D.spotLength!==b||D.rectAreaLength!==C||D.hemiLength!==P||D.numDirectionalShadows!==v||D.numPointShadows!==T||D.numSpotShadows!==A||D.numSpotMaps!==x||D.numLightProbes!==R)&&(r.directional.length=y,r.spot.length=b,r.rectArea.length=C,r.point.length=w,r.hemi.length=P,r.directionalShadow.length=v,r.directionalShadowMap.length=v,r.pointShadow.length=T,r.pointShadowMap.length=T,r.spotShadow.length=A,r.spotShadowMap.length=A,r.directionalShadowMatrix.length=v,r.pointShadowMatrix.length=T,r.spotLightMatrix.length=A+x-S,r.spotLightMap.length=x,r.numSpotLightShadowsWithMaps=S,r.numLightProbes=R,D.directionalLength=y,D.pointLength=w,D.spotLength=b,D.rectAreaLength=C,D.hemiLength=P,D.numDirectionalShadows=v,D.numPointShadows=T,D.numSpotShadows=A,D.numSpotMaps=x,D.numLightProbes=R,r.version=C5t++)}function c(u,d){let f=0,p=0,g=0,y=0,w=0;const b=d.matrixWorldInverse;for(let C=0,P=u.length;C=l.length?(s=new J4e(t,e),l.push(s)):s=l[a],s}function r(){n=new WeakMap}return{get:o,dispose:r}}class uq extends Pf{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=dNe,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 dq extends Pf{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const I5t=`void main() { gl_Position = vec4( position, 1.0 ); }`,z5t=`uniform sampler2D shadow_pass; uniform vec2 resolution; @@ -3660,7 +3660,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function D5t(t,e,n){let o=new lq;const r=new Xt,i=new Xt,a=new Qa,l=new cq({depthPacking:D1e}),s=new uq,c={},u=n.maxTextureSize,d={[Ra]:p0,[p0]:Ra,[$r]:$r},f=new _2({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Xt},radius:{value:4}},vertexShader:I5t,fragmentShader:z5t}),p=f.clone();p.defines.HORIZONTAL_PASS=1;const g=new Ni;g.setAttribute("position",new nl(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new is(g,f),w=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=tq;let b=this.type;this.render=function(T,A,x){if(w.enabled===!1||w.autoUpdate===!1&&w.needsUpdate===!1||T.length===0)return;const S=t.getRenderTarget(),R=t.getActiveCubeFace(),M=t.getActiveMipmapLevel(),D=t.state;D.setBlending(E6),D.buffers.color.setClear(1,1,1,1),D.buffers.depth.setTest(!0),D.setScissorTest(!1);const E=b!==l2&&this.type===l2,W=b===l2&&this.type!==l2;for(let j=0,L=T.length;ju||r.y>u)&&(r.x>u&&(i.x=Math.floor(u/F.x),r.x=i.x*F.x,N.mapSize.x=i.x),r.y>u&&(i.y=Math.floor(u/F.y),r.y=i.y*F.y,N.mapSize.y=i.y)),N.map===null||E===!0||W===!0){const O=this.type!==l2?{minFilter:k0,magFilter:k0}:{};N.map!==null&&N.map.dispose(),N.map=new $m(r.x,r.y,O),N.map.texture.name=k.name+".shadowMap",N.camera.updateProjectionMatrix()}t.setRenderTarget(N.map),t.clear();const U=N.getViewportCount();for(let O=0;O0||A.map&&A.alphaTest>0){const D=R.uuid,E=A.uuid;let W=c[D];W===void 0&&(W={},c[D]=W);let j=W[E];j===void 0&&(j=R.clone(),W[E]=j),R=j}if(R.visible=A.visible,R.wireframe=A.wireframe,S===l2?R.side=A.shadowSide!==null?A.shadowSide:A.side:R.side=A.shadowSide!==null?A.shadowSide:d[A.side],R.alphaMap=A.alphaMap,R.alphaTest=A.alphaTest,R.map=A.map,R.clipShadows=A.clipShadows,R.clippingPlanes=A.clippingPlanes,R.clipIntersection=A.clipIntersection,R.displacementMap=A.displacementMap,R.displacementScale=A.displacementScale,R.displacementBias=A.displacementBias,R.wireframeLinewidth=A.wireframeLinewidth,R.linewidth=A.linewidth,x.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const D=t.properties.get(R);D.light=x}return R}function v(T,A,x,S,R){if(T.visible===!1)return;if(T.layers.test(A.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&R===l2)&&(!T.frustumCulled||o.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(x.matrixWorldInverse,T.matrixWorld);const E=e.update(T),W=T.material;if(Array.isArray(W)){const j=E.groups;for(let L=0,k=j.length;L=1):O.indexOf("OpenGL ES")!==-1&&(U=parseFloat(/^OpenGL ES (\d)/.exec(O)[1]),F=U>=2);let B=null,_={};const X=t.getParameter(t.SCISSOR_BOX),$=t.getParameter(t.VIEWPORT),Q=new Qa().fromArray(X),le=new Qa().fromArray($);function q(Ve,yt,ct,Xe){const ut=new Uint8Array(4),ft=t.createTexture();t.bindTexture(Ve,ft),t.texParameteri(Ve,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(Ve,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let ot=0;ot"u"?!1:/OculusBrowser/g.test(navigator.userAgent),g=new WeakMap;let y;const w=new WeakMap;let b=!1;try{b=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function C(ye,ce){return b?new OffscreenCanvas(ye,ce):FF("canvas")}function P(ye,ce,pe,ve){let Ae=1;if((ye.width>ve||ye.height>ve)&&(Ae=ve/Math.max(ye.width,ye.height)),Ae<1||ce===!0)if(typeof HTMLImageElement<"u"&&ye instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&ye instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&ye instanceof ImageBitmap){const Te=ce?tG:Math.floor,Me=Te(Ae*ye.width),Pe=Te(Ae*ye.height);y===void 0&&(y=C(Me,Pe));const Ee=pe?C(Me,Pe):y;return Ee.width=Me,Ee.height=Pe,Ee.getContext("2d").drawImage(ye,0,0,Me,Pe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ye.width+"x"+ye.height+") to ("+Me+"x"+Pe+")."),Ee}else return"data"in ye&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ye.width+"x"+ye.height+")."),ye;return ye}function v(ye){return Ace(ye.width)&&Ace(ye.height)}function T(ye){return l?!1:ye.wrapS!==dh||ye.wrapT!==dh||ye.minFilter!==k0&&ye.minFilter!==Gs}function A(ye,ce){return ye.generateMipmaps&&ce&&ye.minFilter!==k0&&ye.minFilter!==Gs}function x(ye){t.generateMipmap(ye)}function S(ye,ce,pe,ve,Ae=!1){if(l===!1)return ce;if(ye!==null){if(t[ye]!==void 0)return t[ye];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ye+"'")}let Te=ce;if(ce===t.RED&&(pe===t.FLOAT&&(Te=t.R32F),pe===t.HALF_FLOAT&&(Te=t.R16F),pe===t.UNSIGNED_BYTE&&(Te=t.R8)),ce===t.RED_INTEGER&&(pe===t.UNSIGNED_BYTE&&(Te=t.R8UI),pe===t.UNSIGNED_SHORT&&(Te=t.R16UI),pe===t.UNSIGNED_INT&&(Te=t.R32UI),pe===t.BYTE&&(Te=t.R8I),pe===t.SHORT&&(Te=t.R16I),pe===t.INT&&(Te=t.R32I)),ce===t.RG&&(pe===t.FLOAT&&(Te=t.RG32F),pe===t.HALF_FLOAT&&(Te=t.RG16F),pe===t.UNSIGNED_BYTE&&(Te=t.RG8)),ce===t.RGBA){const Me=Ae?MF:cs.getTransfer(ve);pe===t.FLOAT&&(Te=t.RGBA32F),pe===t.HALF_FLOAT&&(Te=t.RGBA16F),pe===t.UNSIGNED_BYTE&&(Te=Me===Ys?t.SRGB8_ALPHA8:t.RGBA8),pe===t.UNSIGNED_SHORT_4_4_4_4&&(Te=t.RGBA4),pe===t.UNSIGNED_SHORT_5_5_5_1&&(Te=t.RGB5_A1)}return(Te===t.R16F||Te===t.R32F||Te===t.RG16F||Te===t.RG32F||Te===t.RGBA16F||Te===t.RGBA32F)&&e.get("EXT_color_buffer_float"),Te}function R(ye,ce,pe){return A(ye,pe)===!0||ye.isFramebufferTexture&&ye.minFilter!==k0&&ye.minFilter!==Gs?Math.log2(Math.max(ce.width,ce.height))+1:ye.mipmaps!==void 0&&ye.mipmaps.length>0?ye.mipmaps.length:ye.isCompressedTexture&&Array.isArray(ye.image)?ce.mipmaps.length:1}function M(ye){return ye===k0||ye===ZV||ye===uE?t.NEAREST:t.LINEAR}function D(ye){const ce=ye.target;ce.removeEventListener("dispose",D),W(ce),ce.isVideoTexture&&g.delete(ce)}function E(ye){const ce=ye.target;ce.removeEventListener("dispose",E),L(ce)}function W(ye){const ce=o.get(ye);if(ce.__webglInit===void 0)return;const pe=ye.source,ve=w.get(pe);if(ve){const Ae=ve[ce.__cacheKey];Ae.usedTimes--,Ae.usedTimes===0&&j(ye),Object.keys(ve).length===0&&w.delete(pe)}o.remove(ye)}function j(ye){const ce=o.get(ye);t.deleteTexture(ce.__webglTexture);const pe=ye.source,ve=w.get(pe);delete ve[ce.__cacheKey],a.memory.textures--}function L(ye){const ce=ye.texture,pe=o.get(ye),ve=o.get(ce);if(ve.__webglTexture!==void 0&&(t.deleteTexture(ve.__webglTexture),a.memory.textures--),ye.depthTexture&&ye.depthTexture.dispose(),ye.isWebGLCubeRenderTarget)for(let Ae=0;Ae<6;Ae++){if(Array.isArray(pe.__webglFramebuffer[Ae]))for(let Te=0;Te=s&&console.warn("THREE.WebGLTextures: Trying to use "+ye+" texture units while this GPU supports only "+s),k+=1,ye}function U(ye){const ce=[];return ce.push(ye.wrapS),ce.push(ye.wrapT),ce.push(ye.wrapR||0),ce.push(ye.magFilter),ce.push(ye.minFilter),ce.push(ye.anisotropy),ce.push(ye.internalFormat),ce.push(ye.format),ce.push(ye.type),ce.push(ye.generateMipmaps),ce.push(ye.premultiplyAlpha),ce.push(ye.flipY),ce.push(ye.unpackAlignment),ce.push(ye.colorSpace),ce.join()}function O(ye,ce){const pe=o.get(ye);if(ye.isVideoTexture&&ze(ye),ye.isRenderTargetTexture===!1&&ye.version>0&&pe.__version!==ye.version){const ve=ye.image;if(ve===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ve.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{re(pe,ye,ce);return}}n.bindTexture(t.TEXTURE_2D,pe.__webglTexture,t.TEXTURE0+ce)}function B(ye,ce){const pe=o.get(ye);if(ye.version>0&&pe.__version!==ye.version){re(pe,ye,ce);return}n.bindTexture(t.TEXTURE_2D_ARRAY,pe.__webglTexture,t.TEXTURE0+ce)}function _(ye,ce){const pe=o.get(ye);if(ye.version>0&&pe.__version!==ye.version){re(pe,ye,ce);return}n.bindTexture(t.TEXTURE_3D,pe.__webglTexture,t.TEXTURE0+ce)}function X(ye,ce){const pe=o.get(ye);if(ye.version>0&&pe.__version!==ye.version){ae(pe,ye,ce);return}n.bindTexture(t.TEXTURE_CUBE_MAP,pe.__webglTexture,t.TEXTURE0+ce)}const $={[Hs]:t.REPEAT,[dh]:t.CLAMP_TO_EDGE,[PF]:t.MIRRORED_REPEAT},Q={[k0]:t.NEAREST,[ZV]:t.NEAREST_MIPMAP_NEAREST,[uE]:t.NEAREST_MIPMAP_LINEAR,[Gs]:t.LINEAR,[S1e]:t.LINEAR_MIPMAP_NEAREST,[Q8]:t.LINEAR_MIPMAP_LINEAR},le={[fNe]:t.NEVER,[wNe]:t.ALWAYS,[hNe]:t.LESS,[gNe]:t.LEQUAL,[pNe]:t.EQUAL,[ANe]:t.GEQUAL,[mNe]:t.GREATER,[yNe]:t.NOTEQUAL};function q(ye,ce,pe){if(pe?(t.texParameteri(ye,t.TEXTURE_WRAP_S,$[ce.wrapS]),t.texParameteri(ye,t.TEXTURE_WRAP_T,$[ce.wrapT]),(ye===t.TEXTURE_3D||ye===t.TEXTURE_2D_ARRAY)&&t.texParameteri(ye,t.TEXTURE_WRAP_R,$[ce.wrapR]),t.texParameteri(ye,t.TEXTURE_MAG_FILTER,Q[ce.magFilter]),t.texParameteri(ye,t.TEXTURE_MIN_FILTER,Q[ce.minFilter])):(t.texParameteri(ye,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(ye,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),(ye===t.TEXTURE_3D||ye===t.TEXTURE_2D_ARRAY)&&t.texParameteri(ye,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),(ce.wrapS!==dh||ce.wrapT!==dh)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(ye,t.TEXTURE_MAG_FILTER,M(ce.magFilter)),t.texParameteri(ye,t.TEXTURE_MIN_FILTER,M(ce.minFilter)),ce.minFilter!==k0&&ce.minFilter!==Gs&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),ce.compareFunction&&(t.texParameteri(ye,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(ye,t.TEXTURE_COMPARE_FUNC,le[ce.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ve=e.get("EXT_texture_filter_anisotropic");if(ce.magFilter===k0||ce.minFilter!==uE&&ce.minFilter!==Q8||ce.type===v2&&e.has("OES_texture_float_linear")===!1||l===!1&&ce.type===jx&&e.has("OES_texture_half_float_linear")===!1)return;(ce.anisotropy>1||o.get(ce).__currentAnisotropy)&&(t.texParameterf(ye,ve.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(ce.anisotropy,r.getMaxAnisotropy())),o.get(ce).__currentAnisotropy=ce.anisotropy)}}function te(ye,ce){let pe=!1;ye.__webglInit===void 0&&(ye.__webglInit=!0,ce.addEventListener("dispose",D));const ve=ce.source;let Ae=w.get(ve);Ae===void 0&&(Ae={},w.set(ve,Ae));const Te=U(ce);if(Te!==ye.__cacheKey){Ae[Te]===void 0&&(Ae[Te]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,pe=!0),Ae[Te].usedTimes++;const Me=Ae[ye.__cacheKey];Me!==void 0&&(Ae[ye.__cacheKey].usedTimes--,Me.usedTimes===0&&j(ce)),ye.__cacheKey=Te,ye.__webglTexture=Ae[Te].texture}return pe}function re(ye,ce,pe){let ve=t.TEXTURE_2D;(ce.isDataArrayTexture||ce.isCompressedArrayTexture)&&(ve=t.TEXTURE_2D_ARRAY),ce.isData3DTexture&&(ve=t.TEXTURE_3D);const Ae=te(ye,ce),Te=ce.source;n.bindTexture(ve,ye.__webglTexture,t.TEXTURE0+pe);const Me=o.get(Te);if(Te.version!==Me.__version||Ae===!0){n.activeTexture(t.TEXTURE0+pe);const Pe=cs.getPrimaries(cs.workingColorSpace),Ee=ce.colorSpace===dg?null:cs.getPrimaries(ce.colorSpace),Be=ce.colorSpace===dg||Pe===Ee?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,ce.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ce.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,ce.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Be);const Je=T(ce)&&v(ce.image)===!1;let We=P(ce.image,Je,!1,u);We=Ie(ce,We);const Ke=v(We)||l,Ne=i.convert(ce.format,ce.colorSpace);let De=i.convert(ce.type),ke=S(ce.internalFormat,Ne,De,ce.colorSpace,ce.isVideoTexture);q(ve,ce,Ke);let Ye;const it=ce.mipmaps,Ve=l&&ce.isVideoTexture!==!0,yt=Me.__version===void 0||Ae===!0,ct=R(ce,We,Ke);if(ce.isDepthTexture)ke=t.DEPTH_COMPONENT,l?ce.type===v2?ke=t.DEPTH_COMPONENT32F:ce.type===b6?ke=t.DEPTH_COMPONENT24:ce.type===W8?ke=t.DEPTH24_STENCIL8:ke=t.DEPTH_COMPONENT16:ce.type===v2&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),ce.format===N8&&ke===t.DEPTH_COMPONENT&&ce.type!==oq&&ce.type!==b6&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),ce.type=b6,De=i.convert(ce.type)),ce.format===Bx&&ke===t.DEPTH_COMPONENT&&(ke=t.DEPTH_STENCIL,ce.type!==W8&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),ce.type=W8,De=i.convert(ce.type))),yt&&(Ve?n.texStorage2D(t.TEXTURE_2D,1,ke,We.width,We.height):n.texImage2D(t.TEXTURE_2D,0,ke,We.width,We.height,0,Ne,De,null));else if(ce.isDataTexture)if(it.length>0&&Ke){Ve&&yt&&n.texStorage2D(t.TEXTURE_2D,ct,ke,it[0].width,it[0].height);for(let Xe=0,ut=it.length;Xe>=1,ut>>=1}}else if(it.length>0&&Ke){Ve&&yt&&n.texStorage2D(t.TEXTURE_2D,ct,ke,it[0].width,it[0].height);for(let Xe=0,ut=it.length;Xe0&&yt++,n.texStorage2D(t.TEXTURE_CUBE_MAP,yt,Ye,We[0].width,We[0].height));for(let Xe=0;Xe<6;Xe++)if(Je){it?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Xe,0,0,0,We[Xe].width,We[Xe].height,De,ke,We[Xe].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Xe,0,Ye,We[Xe].width,We[Xe].height,0,De,ke,We[Xe].data);for(let ut=0;ut>Te),We=Math.max(1,ce.height>>Te);Ae===t.TEXTURE_3D||Ae===t.TEXTURE_2D_ARRAY?n.texImage3D(Ae,Te,Ee,Je,We,ce.depth,0,Me,Pe,null):n.texImage2D(Ae,Te,Ee,Je,We,0,Me,Pe,null)}n.bindFramebuffer(t.FRAMEBUFFER,ye),Se(ce)?f.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,ve,Ae,o.get(pe).__webglTexture,0,He(ce)):(Ae===t.TEXTURE_2D||Ae>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&Ae<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,ve,Ae,o.get(pe).__webglTexture,Te),n.bindFramebuffer(t.FRAMEBUFFER,null)}function ne(ye,ce,pe){if(t.bindRenderbuffer(t.RENDERBUFFER,ye),ce.depthBuffer&&!ce.stencilBuffer){let ve=l===!0?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(pe||Se(ce)){const Ae=ce.depthTexture;Ae&&Ae.isDepthTexture&&(Ae.type===v2?ve=t.DEPTH_COMPONENT32F:Ae.type===b6&&(ve=t.DEPTH_COMPONENT24));const Te=He(ce);Se(ce)?f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Te,ve,ce.width,ce.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,Te,ve,ce.width,ce.height)}else t.renderbufferStorage(t.RENDERBUFFER,ve,ce.width,ce.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,ye)}else if(ce.depthBuffer&&ce.stencilBuffer){const ve=He(ce);pe&&Se(ce)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,ve,t.DEPTH24_STENCIL8,ce.width,ce.height):Se(ce)?f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,ve,t.DEPTH24_STENCIL8,ce.width,ce.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,ce.width,ce.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,ye)}else{const ve=ce.isWebGLMultipleRenderTargets===!0?ce.texture:[ce.texture];for(let Ae=0;Ae0){pe.__webglFramebuffer[Pe]=[];for(let Ee=0;Ee0){pe.__webglFramebuffer=[];for(let Pe=0;Pe0&&Se(ye)===!1){const Pe=Te?ce:[ce];pe.__webglMultisampledFramebuffer=t.createFramebuffer(),pe.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,pe.__webglMultisampledFramebuffer);for(let Ee=0;Ee0)for(let Ee=0;Ee0)for(let Ee=0;Ee0&&Se(ye)===!1){const ce=ye.isWebGLMultipleRenderTargets?ye.texture:[ye.texture],pe=ye.width,ve=ye.height;let Ae=t.COLOR_BUFFER_BIT;const Te=[],Me=ye.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Pe=o.get(ye),Ee=ye.isWebGLMultipleRenderTargets===!0;if(Ee)for(let Be=0;Be0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&ce.__useRenderToTexture!==!1}function ze(ye){const ce=a.render.frame;g.get(ye)!==ce&&(g.set(ye,ce),ye.update())}function Ie(ye,ce){const pe=ye.colorSpace,ve=ye.format,Ae=ye.type;return ye.isCompressedTexture===!0||ye.isVideoTexture===!0||ye.format===eG||pe!==L9&&pe!==dg&&(cs.getTransfer(pe)===Ys?l===!1?e.has("EXT_sRGB")===!0&&ve===Up?(ye.format=eG,ye.minFilter=Gs,ye.generateMipmaps=!1):ce=F1e.sRGBToLinear(ce):(ve!==Up||Ae!==P9)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",pe)),ce}this.allocateTextureUnit=F,this.resetTextureUnits=N,this.setTexture2D=O,this.setTexture2DArray=B,this.setTexture3D=_,this.setTextureCube=X,this.rebindTextures=de,this.setupRenderTarget=Z,this.updateRenderTargetMipmap=he,this.updateMultisampleRenderTarget=xe,this.setupDepthRenderbuffer=ge,this.setupFrameBufferTexture=se,this.useMultisampledRTT=Se}function FNe(t,e,n){const o=n.isWebGL2;function r(i,a=dg){let l;const s=cs.getTransfer(a);if(i===P9)return t.UNSIGNED_BYTE;if(i===P1e)return t.UNSIGNED_SHORT_4_4_4_4;if(i===C1e)return t.UNSIGNED_SHORT_5_5_5_1;if(i===QWe)return t.BYTE;if(i===ZWe)return t.SHORT;if(i===oq)return t.UNSIGNED_SHORT;if(i===T1e)return t.INT;if(i===b6)return t.UNSIGNED_INT;if(i===v2)return t.FLOAT;if(i===jx)return o?t.HALF_FLOAT:(l=e.get("OES_texture_half_float"),l!==null?l.HALF_FLOAT_OES:null);if(i===eNe)return t.ALPHA;if(i===Up)return t.RGBA;if(i===tNe)return t.LUMINANCE;if(i===nNe)return t.LUMINANCE_ALPHA;if(i===N8)return t.DEPTH_COMPONENT;if(i===Bx)return t.DEPTH_STENCIL;if(i===eG)return l=e.get("EXT_sRGB"),l!==null?l.SRGB_ALPHA_EXT:null;if(i===oNe)return t.RED;if(i===R1e)return t.RED_INTEGER;if(i===rNe)return t.RG;if(i===H1e)return t.RG_INTEGER;if(i===M1e)return t.RGBA_INTEGER;if(i===T_||i===P_||i===C_||i===R_)if(s===Ys)if(l=e.get("WEBGL_compressed_texture_s3tc_srgb"),l!==null){if(i===T_)return l.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===P_)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===C_)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===R_)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(l=e.get("WEBGL_compressed_texture_s3tc"),l!==null){if(i===T_)return l.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===P_)return l.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===C_)return l.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===R_)return l.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Vse||i===Gse||i===Xse||i===Jse)if(l=e.get("WEBGL_compressed_texture_pvrtc"),l!==null){if(i===Vse)return l.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Gse)return l.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Xse)return l.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Jse)return l.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===iNe)return l=e.get("WEBGL_compressed_texture_etc1"),l!==null?l.COMPRESSED_RGB_ETC1_WEBGL:null;if(i===Kse||i===qse)if(l=e.get("WEBGL_compressed_texture_etc"),l!==null){if(i===Kse)return s===Ys?l.COMPRESSED_SRGB8_ETC2:l.COMPRESSED_RGB8_ETC2;if(i===qse)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:l.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===$se||i===Qse||i===Zse||i===ece||i===tce||i===nce||i===oce||i===rce||i===ice||i===ace||i===lce||i===sce||i===cce||i===uce)if(l=e.get("WEBGL_compressed_texture_astc"),l!==null){if(i===$se)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:l.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Qse)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:l.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Zse)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:l.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===ece)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:l.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===tce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:l.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===nce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:l.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===oce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:l.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===rce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:l.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===ice)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:l.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===ace)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:l.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===lce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:l.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===sce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:l.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===cce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:l.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===uce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:l.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===H_||i===dce||i===fce)if(l=e.get("EXT_texture_compression_bptc"),l!==null){if(i===H_)return s===Ys?l.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:l.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===dce)return l.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===fce)return l.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===aNe||i===hce||i===pce||i===gce)if(l=e.get("EXT_texture_compression_rgtc"),l!==null){if(i===H_)return l.COMPRESSED_RED_RGTC1_EXT;if(i===hce)return l.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===pce)return l.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===gce)return l.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===W8?o?t.UNSIGNED_INT_24_8:(l=e.get("WEBGL_depth_texture"),l!==null?l.UNSIGNED_INT_24_8_WEBGL:null):t[i]!==void 0?t[i]:null}return{convert:r}}class kNe extends zu{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}let GP=class extends Wl{constructor(){super(),this.isGroup=!0,this.type="Group"}};const k5t={type:"move"};class Voe{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new GP,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 GP,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ie,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ie),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new GP,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ie,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ie),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const o of e.hand.values())this._getHandJoint(n,o)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,o){let r=null,i=null,a=null;const l=this._targetRay,s=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const y of e.hand.values()){const w=n.getJointPose(y,o),b=this._getHandJoint(c,y);w!==null&&(b.matrix.fromArray(w.transform.matrix),b.matrix.decompose(b.position,b.rotation,b.scale),b.matrixWorldNeedsUpdate=!0,b.jointRadius=w.radius),b.visible=w!==null}const u=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],f=u.position.distanceTo(d.position),p=.02,g=.005;c.inputState.pinching&&f>p+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=p-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=n.getPose(e.gripSpace,o),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));l!==null&&(r=n.getPose(e.targetRaySpace,o),r===null&&i!==null&&(r=i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(k5t)))}return l!==null&&(l.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const o=new GP;o.matrixAutoUpdate=!1,o.visible=!1,e.joints[n.jointName]=o,e.add(o)}return e.joints[n.jointName]}}class U1e extends Vc{constructor(e,n,o,r,i,a,l,s,c,u){if(u=u!==void 0?u:N8,u!==N8&&u!==Bx)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");o===void 0&&u===N8&&(o=b6),o===void 0&&u===Bx&&(o=W8),super(null,r,i,a,l,s,u,o,c),this.isDepthTexture=!0,this.image={width:e,height:n},this.magFilter=l!==void 0?l:k0,this.minFilter=s!==void 0?s:k0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class L5t extends Z9{constructor(e,n){super();const o=this;let r=null,i=1,a=null,l="local-floor",s=1,c=null,u=null,d=null,f=null,p=null,g=null;const y=n.getContextAttributes();let w=null,b=null;const C=[],P=[],v=new zu;v.layers.enable(1),v.viewport=new Qa;const T=new zu;T.layers.enable(2),T.viewport=new Qa;const A=[v,T],x=new kNe;x.layers.enable(1),x.layers.enable(2);let S=null,R=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let _=C[B];return _===void 0&&(_=new Voe,C[B]=_),_.getTargetRaySpace()},this.getControllerGrip=function(B){let _=C[B];return _===void 0&&(_=new Voe,C[B]=_),_.getGripSpace()},this.getHand=function(B){let _=C[B];return _===void 0&&(_=new Voe,C[B]=_),_.getHandSpace()};function M(B){const _=P.indexOf(B.inputSource);if(_===-1)return;const X=C[_];X!==void 0&&(X.update(B.inputSource,B.frame,c||a),X.dispatchEvent({type:B.type,data:B.inputSource}))}function D(){r.removeEventListener("select",M),r.removeEventListener("selectstart",M),r.removeEventListener("selectend",M),r.removeEventListener("squeeze",M),r.removeEventListener("squeezestart",M),r.removeEventListener("squeezeend",M),r.removeEventListener("end",D),r.removeEventListener("inputsourceschange",E);for(let B=0;B=0&&(P[$]=null,C[$].disconnect(X))}for(let _=0;_=P.length){P.push(X),$=le;break}else if(P[le]===null){P[le]=X,$=le;break}if($===-1)break}const Q=C[$];Q&&Q.connect(X)}}const W=new ie,j=new ie;function L(B,_,X){W.setFromMatrixPosition(_.matrixWorld),j.setFromMatrixPosition(X.matrixWorld);const $=W.distanceTo(j),Q=_.projectionMatrix.elements,le=X.projectionMatrix.elements,q=Q[14]/(Q[10]-1),te=Q[14]/(Q[10]+1),re=(Q[9]+1)/Q[5],ae=(Q[9]-1)/Q[5],se=(Q[8]-1)/Q[0],ne=(le[8]+1)/le[0],fe=q*se,ge=q*ne,de=$/(-se+ne),Z=de*-se;_.matrixWorld.decompose(B.position,B.quaternion,B.scale),B.translateX(Z),B.translateZ(de),B.matrixWorld.compose(B.position,B.quaternion,B.scale),B.matrixWorldInverse.copy(B.matrixWorld).invert();const he=q+de,xe=te+de,He=fe-Z,Se=ge+($-Z),ze=re*te/xe*he,Ie=ae*te/xe*he;B.projectionMatrix.makePerspective(He,Se,ze,Ie,he,xe),B.projectionMatrixInverse.copy(B.projectionMatrix).invert()}function k(B,_){_===null?B.matrixWorld.copy(B.matrix):B.matrixWorld.multiplyMatrices(_.matrixWorld,B.matrix),B.matrixWorldInverse.copy(B.matrixWorld).invert()}this.updateCamera=function(B){if(r===null)return;x.near=T.near=v.near=B.near,x.far=T.far=v.far=B.far,(S!==x.near||R!==x.far)&&(r.updateRenderState({depthNear:x.near,depthFar:x.far}),S=x.near,R=x.far);const _=B.parent,X=x.cameras;k(x,_);for(let $=0;$0&&(w.alphaTest.value=b.alphaTest);const C=e.get(b).envMap;if(C&&(w.envMap.value=C,w.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,w.reflectivity.value=b.reflectivity,w.ior.value=b.ior,w.refractionRatio.value=b.refractionRatio),b.lightMap){w.lightMap.value=b.lightMap;const P=t._useLegacyLights===!0?Math.PI:1;w.lightMapIntensity.value=b.lightMapIntensity*P,n(b.lightMap,w.lightMapTransform)}b.aoMap&&(w.aoMap.value=b.aoMap,w.aoMapIntensity.value=b.aoMapIntensity,n(b.aoMap,w.aoMapTransform))}function a(w,b){w.diffuse.value.copy(b.color),w.opacity.value=b.opacity,b.map&&(w.map.value=b.map,n(b.map,w.mapTransform))}function l(w,b){w.dashSize.value=b.dashSize,w.totalSize.value=b.dashSize+b.gapSize,w.scale.value=b.scale}function s(w,b,C,P){w.diffuse.value.copy(b.color),w.opacity.value=b.opacity,w.size.value=b.size*C,w.scale.value=P*.5,b.map&&(w.map.value=b.map,n(b.map,w.uvTransform)),b.alphaMap&&(w.alphaMap.value=b.alphaMap,n(b.alphaMap,w.alphaMapTransform)),b.alphaTest>0&&(w.alphaTest.value=b.alphaTest)}function c(w,b){w.diffuse.value.copy(b.color),w.opacity.value=b.opacity,w.rotation.value=b.rotation,b.map&&(w.map.value=b.map,n(b.map,w.mapTransform)),b.alphaMap&&(w.alphaMap.value=b.alphaMap,n(b.alphaMap,w.alphaMapTransform)),b.alphaTest>0&&(w.alphaTest.value=b.alphaTest)}function u(w,b){w.specular.value.copy(b.specular),w.shininess.value=Math.max(b.shininess,1e-4)}function d(w,b){b.gradientMap&&(w.gradientMap.value=b.gradientMap)}function f(w,b){w.metalness.value=b.metalness,b.metalnessMap&&(w.metalnessMap.value=b.metalnessMap,n(b.metalnessMap,w.metalnessMapTransform)),w.roughness.value=b.roughness,b.roughnessMap&&(w.roughnessMap.value=b.roughnessMap,n(b.roughnessMap,w.roughnessMapTransform)),e.get(b).envMap&&(w.envMapIntensity.value=b.envMapIntensity)}function p(w,b,C){w.ior.value=b.ior,b.sheen>0&&(w.sheenColor.value.copy(b.sheenColor).multiplyScalar(b.sheen),w.sheenRoughness.value=b.sheenRoughness,b.sheenColorMap&&(w.sheenColorMap.value=b.sheenColorMap,n(b.sheenColorMap,w.sheenColorMapTransform)),b.sheenRoughnessMap&&(w.sheenRoughnessMap.value=b.sheenRoughnessMap,n(b.sheenRoughnessMap,w.sheenRoughnessMapTransform))),b.clearcoat>0&&(w.clearcoat.value=b.clearcoat,w.clearcoatRoughness.value=b.clearcoatRoughness,b.clearcoatMap&&(w.clearcoatMap.value=b.clearcoatMap,n(b.clearcoatMap,w.clearcoatMapTransform)),b.clearcoatRoughnessMap&&(w.clearcoatRoughnessMap.value=b.clearcoatRoughnessMap,n(b.clearcoatRoughnessMap,w.clearcoatRoughnessMapTransform)),b.clearcoatNormalMap&&(w.clearcoatNormalMap.value=b.clearcoatNormalMap,n(b.clearcoatNormalMap,w.clearcoatNormalMapTransform),w.clearcoatNormalScale.value.copy(b.clearcoatNormalScale),b.side===p0&&w.clearcoatNormalScale.value.negate())),b.iridescence>0&&(w.iridescence.value=b.iridescence,w.iridescenceIOR.value=b.iridescenceIOR,w.iridescenceThicknessMinimum.value=b.iridescenceThicknessRange[0],w.iridescenceThicknessMaximum.value=b.iridescenceThicknessRange[1],b.iridescenceMap&&(w.iridescenceMap.value=b.iridescenceMap,n(b.iridescenceMap,w.iridescenceMapTransform)),b.iridescenceThicknessMap&&(w.iridescenceThicknessMap.value=b.iridescenceThicknessMap,n(b.iridescenceThicknessMap,w.iridescenceThicknessMapTransform))),b.transmission>0&&(w.transmission.value=b.transmission,w.transmissionSamplerMap.value=C.texture,w.transmissionSamplerSize.value.set(C.width,C.height),b.transmissionMap&&(w.transmissionMap.value=b.transmissionMap,n(b.transmissionMap,w.transmissionMapTransform)),w.thickness.value=b.thickness,b.thicknessMap&&(w.thicknessMap.value=b.thicknessMap,n(b.thicknessMap,w.thicknessMapTransform)),w.attenuationDistance.value=b.attenuationDistance,w.attenuationColor.value.copy(b.attenuationColor)),b.anisotropy>0&&(w.anisotropyVector.value.set(b.anisotropy*Math.cos(b.anisotropyRotation),b.anisotropy*Math.sin(b.anisotropyRotation)),b.anisotropyMap&&(w.anisotropyMap.value=b.anisotropyMap,n(b.anisotropyMap,w.anisotropyMapTransform))),w.specularIntensity.value=b.specularIntensity,w.specularColor.value.copy(b.specularColor),b.specularColorMap&&(w.specularColorMap.value=b.specularColorMap,n(b.specularColorMap,w.specularColorMapTransform)),b.specularIntensityMap&&(w.specularIntensityMap.value=b.specularIntensityMap,n(b.specularIntensityMap,w.specularIntensityMapTransform))}function g(w,b){b.matcap&&(w.matcap.value=b.matcap)}function y(w,b){const C=e.get(b).light;w.referencePosition.value.setFromMatrixPosition(C.matrixWorld),w.nearDistance.value=C.shadow.camera.near,w.farDistance.value=C.shadow.camera.far}return{refreshFogUniforms:o,refreshMaterialUniforms:r}}function N5t(t,e,n,o){let r={},i={},a=[];const l=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function s(C,P){const v=P.program;o.uniformBlockBinding(C,v)}function c(C,P){let v=r[C.id];v===void 0&&(g(C),v=u(C),r[C.id]=v,C.addEventListener("dispose",w));const T=P.program;o.updateUBOMapping(C,T);const A=e.render.frame;i[C.id]!==A&&(f(C),i[C.id]=A)}function u(C){const P=d();C.__bindingPointIndex=P;const v=t.createBuffer(),T=C.__size,A=C.usage;return t.bindBuffer(t.UNIFORM_BUFFER,v),t.bufferData(t.UNIFORM_BUFFER,T,A),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,P,v),v}function d(){for(let C=0;C0){A=v%T;const E=T-A;A!==0&&E-M.boundary<0&&(v+=T-A,R.__offset=v)}v+=M.storage}return A=v%T,A>0&&(v+=T-A),C.__size=v,C.__cache={},this}function y(C){const P={boundary:0,storage:0};return typeof C=="number"?(P.boundary=4,P.storage=4):C.isVector2?(P.boundary=8,P.storage=8):C.isVector3||C.isColor?(P.boundary=16,P.storage=12):C.isVector4?(P.boundary=16,P.storage=16):C.isMatrix3?(P.boundary=48,P.storage=48):C.isMatrix4?(P.boundary=64,P.storage=64):C.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",C),P}function w(C){const P=C.target;P.removeEventListener("dispose",w);const v=a.indexOf(P.__bindingPointIndex);a.splice(v,1),t.deleteBuffer(r[P.id]),delete r[P.id],delete i[P.id]}function b(){for(const C in r)t.deleteBuffer(r[C]);a=[],r={},i={}}return{bind:s,update:c,dispose:b}}class j1e{constructor(e={}){const{canvas:n=SNe(),context:o=null,depth:r=!0,stencil:i=!0,alpha:a=!1,antialias:l=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let f;o!==null?f=o.getContextAttributes().alpha:f=a;const p=new Uint32Array(4),g=new Int32Array(4);let y=null,w=null;const b=[],C=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=ru,this._useLegacyLights=!1,this.toneMapping=T9,this.toneMappingExposure=1;const P=this;let v=!1,T=0,A=0,x=null,S=-1,R=null;const M=new Qa,D=new Qa;let E=null;const W=new rr(0);let j=0,L=n.width,k=n.height,N=1,F=null,U=null;const O=new Qa(0,0,L,k),B=new Qa(0,0,L,k);let _=!1;const X=new lq;let $=!1,Q=!1,le=null;const q=new Ji,te=new Xt,re=new ie,ae={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function se(){return x===null?N:1}let ne=o;function fe(Fe,qe){for(let je=0;je{function Qe(){if(rt.forEach(function(Tt){xe.get(Tt).currentProgram.isReady()&&rt.delete(Tt)}),rt.size===0){mt(Fe);return}setTimeout(Qe,10)}ge.get("KHR_parallel_shader_compile")!==null?Qe():setTimeout(Qe,10)})};let ot=null;function st(Fe){ot&&ot(Fe)}function at(){Ze.stop()}function Oe(){Ze.start()}const Ze=new MNe;Ze.setAnimationLoop(st),typeof self<"u"&&Ze.setContext(self),this.setAnimationLoop=function(Fe){ot=Fe,Ye.setAnimationLoop(Fe),Fe===null?Ze.stop():Ze.start()},Ye.addEventListener("sessionstart",at),Ye.addEventListener("sessionend",Oe),this.render=function(Fe,qe){if(qe!==void 0&&qe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(v===!0)return;Fe.matrixWorldAutoUpdate===!0&&Fe.updateMatrixWorld(),qe.parent===null&&qe.matrixWorldAutoUpdate===!0&&qe.updateMatrixWorld(),Ye.enabled===!0&&Ye.isPresenting===!0&&(Ye.cameraAutoUpdate===!0&&Ye.updateCamera(qe),qe=Ye.getCamera()),Fe.isScene===!0&&Fe.onBeforeRender(P,Fe,qe,x),w=Te.get(Fe,C.length),w.init(),C.push(w),q.multiplyMatrices(qe.projectionMatrix,qe.matrixWorldInverse),X.setFromProjectionMatrix(q),Q=this.localClippingEnabled,$=Me.init(this.clippingPlanes,Q),y=Ae.get(Fe,b.length),y.init(),b.push(y),St(Fe,qe,0,P.sortObjects),y.finish(),P.sortObjects===!0&&y.sort(F,U),this.info.render.frame++,$===!0&&Me.beginShadows();const je=w.state.shadowsArray;if(Pe.render(je,Fe,qe),$===!0&&Me.endShadows(),this.info.autoReset===!0&&this.info.reset(),Ee.render(y,Fe),w.setupLights(P._useLegacyLights),qe.isArrayCamera){const rt=qe.cameras;for(let mt=0,Qe=rt.length;mt0?w=C[C.length-1]:w=null,b.pop(),b.length>0?y=b[b.length-1]:y=null};function St(Fe,qe,je,rt){if(Fe.visible===!1)return;if(Fe.layers.test(qe.layers)){if(Fe.isGroup)je=Fe.renderOrder;else if(Fe.isLOD)Fe.autoUpdate===!0&&Fe.update(qe);else if(Fe.isLight)w.pushLight(Fe),Fe.castShadow&&w.pushShadow(Fe);else if(Fe.isSprite){if(!Fe.frustumCulled||X.intersectsSprite(Fe)){rt&&re.setFromMatrixPosition(Fe.matrixWorld).applyMatrix4(q);const Tt=ce.update(Fe),Dt=Fe.material;Dt.visible&&y.push(Fe,Tt,Dt,je,re.z,null)}}else if((Fe.isMesh||Fe.isLine||Fe.isPoints)&&(!Fe.frustumCulled||X.intersectsObject(Fe))){const Tt=ce.update(Fe),Dt=Fe.material;if(rt&&(Fe.boundingSphere!==void 0?(Fe.boundingSphere===null&&Fe.computeBoundingSphere(),re.copy(Fe.boundingSphere.center)):(Tt.boundingSphere===null&&Tt.computeBoundingSphere(),re.copy(Tt.boundingSphere.center)),re.applyMatrix4(Fe.matrixWorld).applyMatrix4(q)),Array.isArray(Dt)){const lt=Tt.groups;for(let zt=0,Ft=lt.length;zt0&&Rt(mt,Qe,qe,je),rt&&Z.viewport(M.copy(rt)),mt.length>0&&Ut(mt,qe,je),Qe.length>0&&Ut(Qe,qe,je),Tt.length>0&&Ut(Tt,qe,je),Z.buffers.depth.setTest(!0),Z.buffers.depth.setMask(!0),Z.buffers.color.setMask(!0),Z.setPolygonOffset(!1)}function Rt(Fe,qe,je,rt){if((je.isScene===!0?je.overrideMaterial:null)!==null)return;const Qe=de.isWebGL2;le===null&&(le=new $m(1,1,{generateMipmaps:!0,type:ge.has("EXT_color_buffer_half_float")?jx:P9,minFilter:Q8,samples:Qe?4:0})),P.getDrawingBufferSize(te),Qe?le.setSize(te.x,te.y):le.setSize(tG(te.x),tG(te.y));const Tt=P.getRenderTarget();P.setRenderTarget(le),P.getClearColor(W),j=P.getClearAlpha(),j<1&&P.setClearColor(16777215,.5),P.clear();const Dt=P.toneMapping;P.toneMapping=T9,Ut(Fe,je,rt),He.updateMultisampleRenderTarget(le),He.updateRenderTargetMipmap(le);let lt=!1;for(let zt=0,Ft=qe.length;zt0),_t=!!je.morphAttributes.position,tn=!!je.morphAttributes.normal,Qt=!!je.morphAttributes.color;let gn=T9;rt.toneMapped&&(x===null||x.isXRRenderTarget===!0)&&(gn=P.toneMapping);const an=je.morphAttributes.position||je.morphAttributes.normal||je.morphAttributes.color,mn=an!==void 0?an.length:0,Hn=xe.get(rt),Fo=w.state.lights;if($===!0&&(Q===!0||Fe!==R)){const br=Fe===R&&rt.id===S;Me.setState(rt,Fe,br)}let yo=!1;rt.version===Hn.__version?(Hn.needsLights&&Hn.lightsStateVersion!==Fo.state.version||Hn.outputColorSpace!==Dt||mt.isInstancedMesh&&Hn.instancing===!1||!mt.isInstancedMesh&&Hn.instancing===!0||mt.isSkinnedMesh&&Hn.skinning===!1||!mt.isSkinnedMesh&&Hn.skinning===!0||mt.isInstancedMesh&&Hn.instancingColor===!0&&mt.instanceColor===null||mt.isInstancedMesh&&Hn.instancingColor===!1&&mt.instanceColor!==null||Hn.envMap!==lt||rt.fog===!0&&Hn.fog!==Qe||Hn.numClippingPlanes!==void 0&&(Hn.numClippingPlanes!==Me.numPlanes||Hn.numIntersection!==Me.numIntersection)||Hn.vertexAlphas!==zt||Hn.vertexTangents!==Ft||Hn.morphTargets!==_t||Hn.morphNormals!==tn||Hn.morphColors!==Qt||Hn.toneMapping!==gn||de.isWebGL2===!0&&Hn.morphTargetsCount!==mn)&&(yo=!0):(yo=!0,Hn.__version=rt.version);let So=Hn.currentProgram;yo===!0&&(So=At(rt,qe,mt));let $o=!1,mo=!1,Jn=!1;const uo=So.getUniforms(),ir=Hn.uniforms;if(Z.useProgram(So.program)&&($o=!0,mo=!0,Jn=!0),rt.id!==S&&(S=rt.id,mo=!0),$o||R!==Fe){uo.setValue(ne,"projectionMatrix",Fe.projectionMatrix),uo.setValue(ne,"viewMatrix",Fe.matrixWorldInverse);const br=uo.map.cameraPosition;br!==void 0&&br.setValue(ne,re.setFromMatrixPosition(Fe.matrixWorld)),de.logarithmicDepthBuffer&&uo.setValue(ne,"logDepthBufFC",2/(Math.log(Fe.far+1)/Math.LN2)),(rt.isMeshPhongMaterial||rt.isMeshToonMaterial||rt.isMeshLambertMaterial||rt.isMeshBasicMaterial||rt.isMeshStandardMaterial||rt.isShaderMaterial)&&uo.setValue(ne,"isOrthographic",Fe.isOrthographicCamera===!0),R!==Fe&&(R=Fe,mo=!0,Jn=!0)}if(mt.isSkinnedMesh){uo.setOptional(ne,mt,"bindMatrix"),uo.setOptional(ne,mt,"bindMatrixInverse");const br=mt.skeleton;br&&(de.floatVertexTextures?(br.boneTexture===null&&br.computeBoneTexture(),uo.setValue(ne,"boneTexture",br.boneTexture,He),uo.setValue(ne,"boneTextureSize",br.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const Rr=je.morphAttributes;if((Rr.position!==void 0||Rr.normal!==void 0||Rr.color!==void 0&&de.isWebGL2===!0)&&Be.update(mt,je,So),(mo||Hn.receiveShadow!==mt.receiveShadow)&&(Hn.receiveShadow=mt.receiveShadow,uo.setValue(ne,"receiveShadow",mt.receiveShadow)),rt.isMeshGouraudMaterial&&rt.envMap!==null&&(ir.envMap.value=lt,ir.flipEnvMap.value=lt.isCubeTexture&<.isRenderTargetTexture===!1?-1:1),mo&&(uo.setValue(ne,"toneMappingExposure",P.toneMappingExposure),Hn.needsLights&&Ct(ir,Jn),Qe&&rt.fog===!0&&ve.refreshFogUniforms(ir,Qe),ve.refreshMaterialUniforms(ir,rt,N,k,le),I_.upload(ne,kt(Hn),ir,He)),rt.isShaderMaterial&&rt.uniformsNeedUpdate===!0&&(I_.upload(ne,kt(Hn),ir,He),rt.uniformsNeedUpdate=!1),rt.isSpriteMaterial&&uo.setValue(ne,"center",mt.center),uo.setValue(ne,"modelViewMatrix",mt.modelViewMatrix),uo.setValue(ne,"normalMatrix",mt.normalMatrix),uo.setValue(ne,"modelMatrix",mt.matrixWorld),rt.isShaderMaterial||rt.isRawShaderMaterial){const br=rt.uniformsGroups;for(let Vr=0,Wo=br.length;Vr0&&He.useMultisampledRTT(Fe)===!1?mt=xe.get(Fe).__webglMultisampledFramebuffer:Array.isArray(Ft)?mt=Ft[je]:mt=Ft,M.copy(Fe.viewport),D.copy(Fe.scissor),E=Fe.scissorTest}else M.copy(O).multiplyScalar(N).floor(),D.copy(B).multiplyScalar(N).floor(),E=_;if(Z.bindFramebuffer(ne.FRAMEBUFFER,mt)&&de.drawBuffers&&rt&&Z.drawBuffers(Fe,mt),Z.viewport(M),Z.scissor(D),Z.setScissorTest(E),Qe){const lt=xe.get(Fe.texture);ne.framebufferTexture2D(ne.FRAMEBUFFER,ne.COLOR_ATTACHMENT0,ne.TEXTURE_CUBE_MAP_POSITIVE_X+qe,lt.__webglTexture,je)}else if(Tt){const lt=xe.get(Fe.texture),zt=qe||0;ne.framebufferTextureLayer(ne.FRAMEBUFFER,ne.COLOR_ATTACHMENT0,lt.__webglTexture,je||0,zt)}S=-1},this.readRenderTargetPixels=function(Fe,qe,je,rt,mt,Qe,Tt){if(!(Fe&&Fe.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Dt=xe.get(Fe).__webglFramebuffer;if(Fe.isWebGLCubeRenderTarget&&Tt!==void 0&&(Dt=Dt[Tt]),Dt){Z.bindFramebuffer(ne.FRAMEBUFFER,Dt);try{const lt=Fe.texture,zt=lt.format,Ft=lt.type;if(zt!==Up&&Ke.convert(zt)!==ne.getParameter(ne.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const _t=Ft===jx&&(ge.has("EXT_color_buffer_half_float")||de.isWebGL2&&ge.has("EXT_color_buffer_float"));if(Ft!==P9&&Ke.convert(Ft)!==ne.getParameter(ne.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ft===v2&&(de.isWebGL2||ge.has("OES_texture_float")||ge.has("WEBGL_color_buffer_float")))&&!_t){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}qe>=0&&qe<=Fe.width-rt&&je>=0&&je<=Fe.height-mt&&ne.readPixels(qe,je,rt,mt,Ke.convert(zt),Ke.convert(Ft),Qe)}finally{const lt=x!==null?xe.get(x).__webglFramebuffer:null;Z.bindFramebuffer(ne.FRAMEBUFFER,lt)}}},this.copyFramebufferToTexture=function(Fe,qe,je=0){const rt=Math.pow(2,-je),mt=Math.floor(qe.image.width*rt),Qe=Math.floor(qe.image.height*rt);He.setTexture2D(qe,0),ne.copyTexSubImage2D(ne.TEXTURE_2D,je,0,0,Fe.x,Fe.y,mt,Qe),Z.unbindTexture()},this.copyTextureToTexture=function(Fe,qe,je,rt=0){const mt=qe.image.width,Qe=qe.image.height,Tt=Ke.convert(je.format),Dt=Ke.convert(je.type);He.setTexture2D(je,0),ne.pixelStorei(ne.UNPACK_FLIP_Y_WEBGL,je.flipY),ne.pixelStorei(ne.UNPACK_PREMULTIPLY_ALPHA_WEBGL,je.premultiplyAlpha),ne.pixelStorei(ne.UNPACK_ALIGNMENT,je.unpackAlignment),qe.isDataTexture?ne.texSubImage2D(ne.TEXTURE_2D,rt,Fe.x,Fe.y,mt,Qe,Tt,Dt,qe.image.data):qe.isCompressedTexture?ne.compressedTexSubImage2D(ne.TEXTURE_2D,rt,Fe.x,Fe.y,qe.mipmaps[0].width,qe.mipmaps[0].height,Tt,qe.mipmaps[0].data):ne.texSubImage2D(ne.TEXTURE_2D,rt,Fe.x,Fe.y,Tt,Dt,qe.image),rt===0&&je.generateMipmaps&&ne.generateMipmap(ne.TEXTURE_2D),Z.unbindTexture()},this.copyTextureToTexture3D=function(Fe,qe,je,rt,mt=0){if(P.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Qe=Fe.max.x-Fe.min.x+1,Tt=Fe.max.y-Fe.min.y+1,Dt=Fe.max.z-Fe.min.z+1,lt=Ke.convert(rt.format),zt=Ke.convert(rt.type);let Ft;if(rt.isData3DTexture)He.setTexture3D(rt,0),Ft=ne.TEXTURE_3D;else if(rt.isDataArrayTexture)He.setTexture2DArray(rt,0),Ft=ne.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ne.pixelStorei(ne.UNPACK_FLIP_Y_WEBGL,rt.flipY),ne.pixelStorei(ne.UNPACK_PREMULTIPLY_ALPHA_WEBGL,rt.premultiplyAlpha),ne.pixelStorei(ne.UNPACK_ALIGNMENT,rt.unpackAlignment);const _t=ne.getParameter(ne.UNPACK_ROW_LENGTH),tn=ne.getParameter(ne.UNPACK_IMAGE_HEIGHT),Qt=ne.getParameter(ne.UNPACK_SKIP_PIXELS),gn=ne.getParameter(ne.UNPACK_SKIP_ROWS),an=ne.getParameter(ne.UNPACK_SKIP_IMAGES),mn=je.isCompressedTexture?je.mipmaps[0]:je.image;ne.pixelStorei(ne.UNPACK_ROW_LENGTH,mn.width),ne.pixelStorei(ne.UNPACK_IMAGE_HEIGHT,mn.height),ne.pixelStorei(ne.UNPACK_SKIP_PIXELS,Fe.min.x),ne.pixelStorei(ne.UNPACK_SKIP_ROWS,Fe.min.y),ne.pixelStorei(ne.UNPACK_SKIP_IMAGES,Fe.min.z),je.isDataTexture||je.isData3DTexture?ne.texSubImage3D(Ft,mt,qe.x,qe.y,qe.z,Qe,Tt,Dt,lt,zt,mn.data):je.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ne.compressedTexSubImage3D(Ft,mt,qe.x,qe.y,qe.z,Qe,Tt,Dt,lt,mn.data)):ne.texSubImage3D(Ft,mt,qe.x,qe.y,qe.z,Qe,Tt,Dt,lt,zt,mn),ne.pixelStorei(ne.UNPACK_ROW_LENGTH,_t),ne.pixelStorei(ne.UNPACK_IMAGE_HEIGHT,tn),ne.pixelStorei(ne.UNPACK_SKIP_PIXELS,Qt),ne.pixelStorei(ne.UNPACK_SKIP_ROWS,gn),ne.pixelStorei(ne.UNPACK_SKIP_IMAGES,an),mt===0&&rt.generateMipmaps&&ne.generateMipmap(Ft),Z.unbindTexture()},this.initTexture=function(Fe){Fe.isCubeTexture?He.setTextureCube(Fe,0):Fe.isData3DTexture?He.setTexture3D(Fe,0):Fe.isDataArrayTexture||Fe.isCompressedArrayTexture?He.setTexture2DArray(Fe,0):He.setTexture2D(Fe,0),Z.unbindTexture()},this.resetState=function(){T=0,A=0,x=null,Z.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return g9}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=e===iq?"display-p3":"srgb",n.unpackColorSpace=cs.workingColorSpace===QL?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===ru?U8:z1e}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===U8?ru:L9}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class LNe extends j1e{}LNe.prototype.isWebGL1Renderer=!0;class dq{constructor(e,n=25e-5){this.isFogExp2=!0,this.name="",this.color=new rr(e),this.density=n}clone(){return new dq(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class fq{constructor(e,n=1,o=1e3){this.isFog=!0,this.name="",this.color=new rr(e),this.near=n,this.far=o}clone(){return new fq(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class nG extends Wl{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n}}class hq{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=DF,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Tg()}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,n,o){e*=this.stride,o*=n.stride;for(let r=0,i=this.stride;re.far||n.push({distance:s,point:wz.clone(),uv:ah.getInterpolation(wz,FB,xz,kB,J4e,Goe,K4e,new Xt),face:null,object:this})}copy(e,n){return super.copy(e,n),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function LB(t,e,n,o,r,i){wT.subVectors(t,n).addScalar(.5).multiply(o),r!==void 0?(vz.x=i*wT.x-r*wT.y,vz.y=r*wT.x+i*wT.y):vz.copy(wT),t.copy(e),t.x+=vz.x,t.y+=vz.y,t.applyMatrix4(WNe)}const WB=new ie,q4e=new ie;class NNe extends Wl{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 n=e.levels;for(let o=0,r=n.length;o0){let o,r;for(o=1,r=n.length;o0){WB.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(WB);this.getObjectForDistance(r).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){WB.setFromMatrixPosition(e.matrixWorld),q4e.setFromMatrixPosition(this.matrixWorld);const o=WB.distanceTo(q4e)/e.zoom;n[0].object.visible=!0;let r,i;for(r=1,i=n.length;r=a)n[r-1].object.visible=!1,n[r].object.visible=!0;else break}for(this._currentLevel=r-1;rs)continue;f.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(f);Se.far||n.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:P,face:null,faceIndex:null,object:this})}}else{const b=Math.max(0,a.start),C=Math.min(w.count,a.start+a.count);for(let P=b,v=C-1;Ps)continue;f.applyMatrix4(this.matrixWorld);const A=e.ray.origin.distanceTo(f);Ae.far||n.push({distance:A,point:d.clone().applyMatrix4(this.matrixWorld),index:P,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,o=Object.keys(n);if(o.length>0){const r=n[o[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,a=r.length;i0){const r=n[o[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,a=r.length;ir.far)return;i.push({distance:c,distanceToRay:Math.sqrt(l),point:s,index:e,face:null,object:a})}}class Y5t extends Vc{constructor(e,n,o,r,i,a,l,s,c){super(e,n,o,r,i,a,l,s,c),this.isVideoTexture=!0,this.minFilter=a!==void 0?a:Gs,this.magFilter=i!==void 0?i:Gs,this.generateMipmaps=!1;const u=this;function d(){u.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class O5t extends Vc{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=k0,this.minFilter=k0,this.generateMipmaps=!1,this.needsUpdate=!0}}class mq extends Vc{constructor(e,n,o,r,i,a,l,s,c,u,d,f){super(null,a,l,s,c,u,r,i,d,f),this.isCompressedTexture=!0,this.image={width:n,height:o},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class _5t extends mq{constructor(e,n,o,r,i,a){super(e,n,o,i,a),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=dh}}class V5t extends mq{constructor(e,n,o){super(void 0,e[0].width,e[0].height,n,o,K6),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class XP extends Vc{constructor(e,n,o,r,i,a,l,s,c){super(e,n,o,r,i,a,l,s,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}let Q2=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,n){const o=this.getUtoTmapping(e);return this.getPoint(o,n)}getPoints(e=5){const n=[];for(let o=0;o<=e;o++)n.push(this.getPoint(o/e));return n}getSpacedPoints(e=5){const n=[];for(let o=0;o<=e;o++)n.push(this.getPointAt(o/e));return n}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 n=[];let o,r=this.getPoint(0),i=0;n.push(0);for(let a=1;a<=e;a++)o=this.getPoint(a/e),i+=o.distanceTo(r),n.push(i),r=o;return this.cacheArcLengths=n,n}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,n){const o=this.getLengths();let r=0;const i=o.length;let a;n?a=n:a=e*o[i-1];let l=0,s=i-1,c;for(;l<=s;)if(r=Math.floor(l+(s-l)/2),c=o[r]-a,c<0)l=r+1;else if(c>0)s=r-1;else{s=r;break}if(r=s,o[r]===a)return r/(i-1);const u=o[r],f=o[r+1]-u,p=(a-u)/f;return(r+p)/(i-1)}getTangent(e,n){let r=e-1e-4,i=e+1e-4;r<0&&(r=0),i>1&&(i=1);const a=this.getPoint(r),l=this.getPoint(i),s=n||(a.isVector2?new Xt:new ie);return s.copy(l).sub(a).normalize(),s}getTangentAt(e,n){const o=this.getUtoTmapping(e);return this.getTangent(o,n)}computeFrenetFrames(e,n){const o=new ie,r=[],i=[],a=[],l=new ie,s=new Ji;for(let p=0;p<=e;p++){const g=p/e;r[p]=this.getTangentAt(g,new ie)}i[0]=new ie,a[0]=new ie;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),d=Math.abs(r[0].y),f=Math.abs(r[0].z);u<=c&&(c=u,o.set(1,0,0)),d<=c&&(c=d,o.set(0,1,0)),f<=c&&o.set(0,0,1),l.crossVectors(r[0],o).normalize(),i[0].crossVectors(r[0],l),a[0].crossVectors(r[0],i[0]);for(let p=1;p<=e;p++){if(i[p]=i[p-1].clone(),a[p]=a[p-1].clone(),l.crossVectors(r[p-1],r[p]),l.length()>Number.EPSILON){l.normalize();const g=Math.acos(h0(r[p-1].dot(r[p]),-1,1));i[p].applyMatrix4(s.makeRotationAxis(l,g))}a[p].crossVectors(r[p],i[p])}if(n===!0){let p=Math.acos(h0(i[0].dot(i[e]),-1,1));p/=e,r[0].dot(l.crossVectors(i[0],i[e]))>0&&(p=-p);for(let g=1;g<=e;g++)i[g].applyMatrix4(s.makeRotationAxis(r[g],p*g)),a[g].crossVectors(r[g],i[g])}return{tangents:r,normals:i,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}};class D2 extends Q2{constructor(e=0,n=0,o=1,r=1,i=0,a=Math.PI*2,l=!1,s=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=n,this.xRadius=o,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=l,this.aRotation=s}getPoint(e,n){const o=n||new Xt,r=Math.PI*2;let i=this.aEndAngle-this.aStartAngle;const a=Math.abs(i)r;)i-=r;i0?0:(Math.floor(Math.abs(l)/i)+1)*i:s===0&&l===i-1&&(l=i-2,s=1);let c,u;this.closed||l>0?c=r[(l-1)%i]:(OB.subVectors(r[0],r[1]).add(r[0]),c=OB);const d=r[l%i],f=r[(l+1)%i];if(this.closed||l+2r.length-2?r.length-1:a+1],d=r[a>r.length-3?r.length-1:a+2];return o.set(f8e(l,s.x,c.x,u.x,d.x),f8e(l,s.y,c.y,u.y,d.y)),o}copy(e){super.copy(e),this.points=[];for(let n=0,o=e.points.length;n=o){const a=r[i]-o,l=this.curves[i],s=l.getLength(),c=s===0?0:1-a/s;return l.getPointAt(c,n)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let n=0;for(let o=0,r=this.curves.length;o1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,o=e.curves.length;n0){const d=c.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}};class nW extends Ni{constructor(e=[new Xt(0,-.5),new Xt(.5,0),new Xt(0,.5)],n=12,o=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:n,phiStart:o,phiLength:r},n=Math.floor(n),r=h0(r,0,Math.PI*2);const i=[],a=[],l=[],s=[],c=[],u=1/n,d=new ie,f=new Xt,p=new ie,g=new ie,y=new ie;let w=0,b=0;for(let C=0;C<=e.length-1;C++)switch(C){case 0:w=e[C+1].x-e[C].x,b=e[C+1].y-e[C].y,p.x=b*1,p.y=-w,p.z=b*0,y.copy(p),p.normalize(),s.push(p.x,p.y,p.z);break;case e.length-1:s.push(y.x,y.y,y.z);break;default:w=e[C+1].x-e[C].x,b=e[C+1].y-e[C].y,p.x=b*1,p.y=-w,p.z=b*0,g.copy(p),p.x+=y.x,p.y+=y.y,p.z+=y.z,p.normalize(),s.push(p.x,p.y,p.z),y.copy(g)}for(let C=0;C<=n;C++){const P=o+C*u*r,v=Math.sin(P),T=Math.cos(P);for(let A=0;A<=e.length-1;A++){d.x=e[A].x*v,d.y=e[A].y,d.z=e[A].x*T,a.push(d.x,d.y,d.z),f.x=C/n,f.y=A/(e.length-1),l.push(f.x,f.y);const x=s[3*A+0]*v,S=s[3*A+1],R=s[3*A+0]*T;c.push(x,S,R)}}for(let C=0;C0&&P(!0),n>0&&P(!1)),this.setIndex(u),this.setAttribute("position",new gr(d,3)),this.setAttribute("normal",new gr(f,3)),this.setAttribute("uv",new gr(p,2));function C(){const v=new ie,T=new ie;let A=0;const x=(n-e)/o;for(let S=0;S<=i;S++){const R=[],M=S/i,D=M*(n-e)+e;for(let E=0;E<=r;E++){const W=E/r,j=W*s+l,L=Math.sin(j),k=Math.cos(j);T.x=D*L,T.y=-M*o+w,T.z=D*k,d.push(T.x,T.y,T.z),v.set(L,x,k).normalize(),f.push(v.x,v.y,v.z),p.push(W,1-M),R.push(g++)}y.push(R)}for(let S=0;S.9&&x<.1&&(P<.2&&(a[C+0]+=1),v<.2&&(a[C+2]+=1),T<.2&&(a[C+4]+=1))}}function f(C){i.push(C.x,C.y,C.z)}function p(C,P){const v=C*3;P.x=e[v+0],P.y=e[v+1],P.z=e[v+2]}function g(){const C=new ie,P=new ie,v=new ie,T=new ie,A=new Xt,x=new Xt,S=new Xt;for(let R=0,M=0;R80*n){l=c=t[0],s=u=t[1];for(let g=n;gc&&(c=d),f>u&&(u=f);p=Math.max(c-l,u-s),p=p!==0?32767/p:0}return WF(i,a,n,l,s,p,0),a}};function JNe(t,e,n,o,r){let i,a;if(r===g9t(t,e,n,o)>0)for(i=e;i=e;i-=o)a=h8e(i,t[i],t[i+1],a);return a&&Sq(a,a.next)&&(UF(a),a=a.next),a}function Ox(t,e){if(!t)return t;e||(e=t);let n=t,o;do if(o=!1,!n.steiner&&(Sq(n,n.next)||o0(n.prev,n,n.next)===0)){if(UF(n),n=e=n.prev,n===n.next)break;o=!0}else n=n.next;while(o||n!==e);return e}function WF(t,e,n,o,r,i,a){if(!t)return;!a&&i&&c9t(t,o,r,i);let l=t,s,c;for(;t.prev!==t.next;){if(s=t.prev,c=t.next,i?t9t(t,o,r,i):e9t(t)){e.push(s.i/n|0),e.push(t.i/n|0),e.push(c.i/n|0),UF(t),t=c.next,l=c.next;continue}if(t=c,t===l){a?a===1?(t=n9t(Ox(t),e,n),WF(t,e,n,o,r,i,2)):a===2&&o9t(t,e,n,o,r,i):WF(Ox(t),e,n,o,r,i,1);break}}}function e9t(t){const e=t.prev,n=t,o=t.next;if(o0(e,n,o)>=0)return!1;const r=e.x,i=n.x,a=o.x,l=e.y,s=n.y,c=o.y,u=ri?r>a?r:a:i>a?i:a,p=l>s?l>c?l:c:s>c?s:c;let g=o.next;for(;g!==e;){if(g.x>=u&&g.x<=f&&g.y>=d&&g.y<=p&&JP(r,l,i,s,a,c,g.x,g.y)&&o0(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function t9t(t,e,n,o){const r=t.prev,i=t,a=t.next;if(o0(r,i,a)>=0)return!1;const l=r.x,s=i.x,c=a.x,u=r.y,d=i.y,f=a.y,p=ls?l>c?l:c:s>c?s:c,w=u>d?u>f?u:f:d>f?d:f,b=bce(p,g,e,n,o),C=bce(y,w,e,n,o);let P=t.prevZ,v=t.nextZ;for(;P&&P.z>=b&&v&&v.z<=C;){if(P.x>=p&&P.x<=y&&P.y>=g&&P.y<=w&&P!==r&&P!==a&&JP(l,u,s,d,c,f,P.x,P.y)&&o0(P.prev,P,P.next)>=0||(P=P.prevZ,v.x>=p&&v.x<=y&&v.y>=g&&v.y<=w&&v!==r&&v!==a&&JP(l,u,s,d,c,f,v.x,v.y)&&o0(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;P&&P.z>=b;){if(P.x>=p&&P.x<=y&&P.y>=g&&P.y<=w&&P!==r&&P!==a&&JP(l,u,s,d,c,f,P.x,P.y)&&o0(P.prev,P,P.next)>=0)return!1;P=P.prevZ}for(;v&&v.z<=C;){if(v.x>=p&&v.x<=y&&v.y>=g&&v.y<=w&&v!==r&&v!==a&&JP(l,u,s,d,c,f,v.x,v.y)&&o0(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function n9t(t,e,n){let o=t;do{const r=o.prev,i=o.next.next;!Sq(r,i)&&KNe(r,o,o.next,i)&&NF(r,i)&&NF(i,r)&&(e.push(r.i/n|0),e.push(o.i/n|0),e.push(i.i/n|0),UF(o),UF(o.next),o=t=i),o=o.next}while(o!==t);return Ox(o)}function o9t(t,e,n,o,r,i){let a=t;do{let l=a.next.next;for(;l!==a.prev;){if(a.i!==l.i&&f9t(a,l)){let s=qNe(a,l);a=Ox(a,a.next),s=Ox(s,s.next),WF(a,e,n,o,r,i,0),WF(s,e,n,o,r,i,0);return}l=l.next}a=a.next}while(a!==t)}function r9t(t,e,n,o){const r=[];let i,a,l,s,c;for(i=0,a=e.length;i=n.next.y&&n.next.y!==n.y){const f=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(f<=i&&f>o&&(o=f,r=n.x=n.x&&n.x>=s&&i!==n.x&&JP(ar.x||n.x===r.x&&s9t(r,n)))&&(r=n,u=d)),n=n.next;while(n!==l);return r}function s9t(t,e){return o0(t.prev,t,e.prev)<0&&o0(e.next,t,t.next)<0}function c9t(t,e,n,o){let r=t;do r.z===0&&(r.z=bce(r.x,r.y,e,n,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,u9t(r)}function u9t(t){let e,n,o,r,i,a,l,s,c=1;do{for(n=t,t=null,i=null,a=0;n;){for(a++,o=n,l=0,e=0;e0||s>0&&o;)l!==0&&(s===0||!o||n.z<=o.z)?(r=n,n=n.nextZ,l--):(r=o,o=o.nextZ,s--),i?i.nextZ=r:t=r,r.prevZ=i,i=r;n=o}i.nextZ=null,c*=2}while(a>1);return t}function bce(t,e,n,o,r){return t=(t-n)*r|0,e=(e-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function d9t(t){let e=t,n=t;do(e.x=(t-a)*(i-l)&&(t-a)*(o-l)>=(n-a)*(e-l)&&(n-a)*(i-l)>=(r-a)*(o-l)}function f9t(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!h9t(t,e)&&(NF(t,e)&&NF(e,t)&&p9t(t,e)&&(o0(t.prev,t,e.prev)||o0(t,e.prev,e))||Sq(t,e)&&o0(t.prev,t,t.next)>0&&o0(e.prev,e,e.next)>0)}function o0(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Sq(t,e){return t.x===e.x&&t.y===e.y}function KNe(t,e,n,o){const r=JB(o0(t,e,n)),i=JB(o0(t,e,o)),a=JB(o0(n,o,t)),l=JB(o0(n,o,e));return!!(r!==i&&a!==l||r===0&&XB(t,n,e)||i===0&&XB(t,o,e)||a===0&&XB(n,t,o)||l===0&&XB(n,e,o))}function XB(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function JB(t){return t>0?1:t<0?-1:0}function h9t(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&KNe(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function NF(t,e){return o0(t.prev,t,t.next)<0?o0(t,e,t.next)>=0&&o0(t,t.prev,e)>=0:o0(t,e,t.prev)<0||o0(t,t.next,e)<0}function p9t(t,e){let n=t,o=!1;const r=(t.x+e.x)/2,i=(t.y+e.y)/2;do n.y>i!=n.next.y>i&&n.next.y!==n.y&&r<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(o=!o),n=n.next;while(n!==t);return o}function qNe(t,e){const n=new Sce(t.i,t.x,t.y),o=new Sce(e.i,e.x,e.y),r=t.next,i=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,o.next=n,n.prev=o,i.next=o,o.prev=i,o}function h8e(t,e,n,o){const r=new Sce(t,e,n);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function UF(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Sce(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function g9t(t,e,n,o){let r=0;for(let i=e,a=n-o;i2&&t[e-1].equals(t[0])&&t.pop()}function g8e(t,e){for(let n=0;nNumber.EPSILON){const ce=Math.sqrt(Ie),pe=Math.sqrt(Se*Se+ze*ze),ve=fe.x-He/ce,Ae=fe.y+xe/ce,Te=ge.x-ze/pe,Me=ge.y+Se/pe,Pe=((Te-ve)*ze-(Me-Ae)*Se)/(xe*ze-He*Se);de=ve+xe*Pe-ne.x,Z=Ae+He*Pe-ne.y;const Ee=de*de+Z*Z;if(Ee<=2)return new Xt(de,Z);he=Math.sqrt(Ee/2)}else{let ce=!1;xe>Number.EPSILON?Se>Number.EPSILON&&(ce=!0):xe<-Number.EPSILON?Se<-Number.EPSILON&&(ce=!0):Math.sign(He)===Math.sign(ze)&&(ce=!0),ce?(de=-He,Z=xe,he=Math.sqrt(Ie)):(de=xe,Z=He,he=Math.sqrt(Ie/2))}return new Xt(de/he,Z/he)}const U=[];for(let ne=0,fe=j.length,ge=fe-1,de=ne+1;ne=0;ne--){const fe=ne/w,ge=p*Math.cos(fe*Math.PI/2),de=g*Math.sin(fe*Math.PI/2)+y;for(let Z=0,he=j.length;Z=0;){const de=ge;let Z=ge-1;Z<0&&(Z=ne.length-1);for(let he=0,xe=u+w*2;he0)&&p.push(P,v,A),(b!==o-1||s0!=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}}class q1e extends Pf{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new rr(16777215),this.specular=new rr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cw,this.normalScale=new Xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$L,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 eUe extends Pf{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new rr(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cw,this.normalScale=new Xt(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 tUe extends Pf{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cw,this.normalScale=new Xt(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 nUe extends Pf{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new rr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cw,this.normalScale=new Xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$L,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.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 oUe extends Pf{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new rr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cw,this.normalScale=new Xt(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 rUe extends pp{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 Dv(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function iUe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function aUe(t){function e(r,i){return t[r]-t[i]}const n=t.length,o=new Array(n);for(let r=0;r!==n;++r)o[r]=r;return o.sort(e),o}function Tce(t,e,n){const o=t.length,r=new t.constructor(o);for(let i=0,a=0;a!==o;++i){const l=n[i]*e;for(let s=0;s!==e;++s)r[a++]=t[l+s]}return r}function $1e(t,e,n,o){let r=1,i=t[0];for(;i!==void 0&&i[o]===void 0;)i=t[r++];if(i===void 0)return;let a=i[o];if(a!==void 0)if(Array.isArray(a))do a=i[o],a!==void 0&&(e.push(i.time),n.push.apply(n,a)),i=t[r++];while(i!==void 0);else if(a.toArray!==void 0)do a=i[o],a!==void 0&&(e.push(i.time),a.toArray(n,n.length)),i=t[r++];while(i!==void 0);else do a=i[o],a!==void 0&&(e.push(i.time),n.push(a)),i=t[r++];while(i!==void 0)}function w9t(t,e,n,o,r=30){const i=t.clone();i.name=e;const a=[];for(let s=0;s=o)){d.push(c.times[p]);for(let y=0;yi.tracks[s].times[0]&&(l=i.tracks[s].times[0]);for(let s=0;s=l.times[g]){const b=g*d+u,C=b+d-u;y=l.values.slice(b,C)}else{const b=l.createInterpolant(),C=u,P=d-u;b.evaluate(i),y=b.resultBuffer.slice(C,P)}s==="quaternion"&&new bs().fromArray(y).normalize().conjugate().toArray(y);const w=c.times.length;for(let b=0;b=i)){const l=n[1];e=i)break t}a=o,o=0;break n}break e}for(;o>>1;en;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);const l=this.getValueSize();this.times=o.slice(i,a),this.values=this.values.slice(i*l,a*l)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const o=this.times,r=this.values,i=o.length;i===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let l=0;l!==i;l++){const s=o[l];if(typeof s=="number"&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,s),e=!1;break}if(a!==null&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,s,a),e=!1;break}a=s}if(r!==void 0&&iUe(r))for(let l=0,s=r.length;l!==s;++l){const c=r[l];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),o=this.getValueSize(),r=this.getInterpolation()===M_,i=e.length-1;let a=1;for(let l=1;l0){e[a]=e[i];for(let l=i*o,s=a*o,c=0;c!==o;++c)n[s+c]=n[l+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=n.slice(0,a*o)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),o=this.constructor,r=new o(this.name,e,n);return r.createInterpolant=this.createInterpolant,r}}Z2.prototype.TimeBufferType=Float32Array;Z2.prototype.ValueBufferType=Float32Array;Z2.prototype.DefaultInterpolation=RF;class Ab extends Z2{}Ab.prototype.ValueTypeName="bool";Ab.prototype.ValueBufferType=Array;Ab.prototype.DefaultInterpolation=CF;Ab.prototype.InterpolantFactoryMethodLinear=void 0;Ab.prototype.InterpolantFactoryMethodSmooth=void 0;class Z1e extends Z2{}Z1e.prototype.ValueTypeName="color";class jF extends Z2{}jF.prototype.ValueTypeName="number";class cUe extends iW{constructor(e,n,o,r){super(e,n,o,r)}interpolate_(e,n,o,r){const i=this.resultBuffer,a=this.sampleValues,l=this.valueSize,s=(o-n)/(r-n);let c=e*l;for(let u=c+l;c!==u;c+=4)bs.slerpFlat(i,0,a,c-l,a,c,s);return i}}class MH extends Z2{InterpolantFactoryMethodLinear(e){return new cUe(this.times,this.values,this.getValueSize(),e)}}MH.prototype.ValueTypeName="quaternion";MH.prototype.DefaultInterpolation=RF;MH.prototype.InterpolantFactoryMethodSmooth=void 0;class wb extends Z2{}wb.prototype.ValueTypeName="string";wb.prototype.ValueBufferType=Array;wb.prototype.DefaultInterpolation=CF;wb.prototype.InterpolantFactoryMethodLinear=void 0;wb.prototype.InterpolantFactoryMethodSmooth=void 0;class BF extends Z2{}BF.prototype.ValueTypeName="vector";class YF{constructor(e,n=-1,o,r=rq){this.name=e,this.tracks=o,this.duration=n,this.blendMode=r,this.uuid=Tg(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],o=e.tracks,r=1/(e.fps||1);for(let a=0,l=o.length;a!==l;++a)n.push(S9t(o[a]).scale(r));const i=new this(e.name,e.duration,n,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const n=[],o=e.tracks,r={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let i=0,a=o.length;i!==a;++i)n.push(Z2.toJSON(o[i]));return r}static CreateFromMorphTargetSequence(e,n,o,r){const i=n.length,a=[];for(let l=0;l1){const d=u[1];let f=r[d];f||(r[d]=f=[]),f.push(c)}}const a=[];for(const l in r)a.push(this.CreateFromMorphTargetSequence(l,r[l],n,o));return a}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const o=function(d,f,p,g,y){if(p.length!==0){const w=[],b=[];$1e(p,w,b,g),w.length!==0&&y.push(new d(f,w,b))}},r=[],i=e.name||"default",a=e.fps||30,l=e.blendMode;let s=e.length||-1;const c=e.hierarchy||[];for(let d=0;d{n&&n(i),this.manager.itemEnd(e)},0),i;if(n6[e]!==void 0){n6[e].push({onLoad:n,onProgress:o,onError:r});return}n6[e]=[],n6[e].push({onLoad:n,onProgress:o,onError:r});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),l=this.mimeType,s=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=n6[e],d=c.body.getReader(),f=c.headers.get("Content-Length")||c.headers.get("X-File-Size"),p=f?parseInt(f):0,g=p!==0;let y=0;const w=new ReadableStream({start(b){C();function C(){d.read().then(({done:P,value:v})=>{if(P)b.close();else{y+=v.byteLength;const T=new ProgressEvent("progress",{lengthComputable:g,loaded:y,total:p});for(let A=0,x=u.length;A{switch(s){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,l));case"json":return c.json();default:if(l===void 0)return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(l),f=d&&d[1]?d[1].toLowerCase():void 0,p=new TextDecoder(f);return c.arrayBuffer().then(g=>p.decode(g))}}}).then(c=>{_x.add(e,c);const u=n6[e];delete n6[e];for(let d=0,f=u.length;d{const u=n6[e];if(u===void 0)throw this.manager.itemError(e),c;delete n6[e];for(let d=0,f=u.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class P9t extends gp{constructor(e){super(e)}load(e,n,o,r){const i=this,a=new N9(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){try{n(i.parse(JSON.parse(l)))}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}},o,r)}parse(e){const n=[];for(let o=0;o0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const i in e.uniforms){const a=e.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=o(a.value);break;case"c":r.uniforms[i].value=new rr().setHex(a.value);break;case"v2":r.uniforms[i].value=new Xt().fromArray(a.value);break;case"v3":r.uniforms[i].value=new ie().fromArray(a.value);break;case"v4":r.uniforms[i].value=new Qa().fromArray(a.value);break;case"m3":r.uniforms[i].value=new pa().fromArray(a.value);break;case"m4":r.uniforms[i].value=new Ji().fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const i in e.extensions)r.extensions[i]=e.extensions[i];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=o(e.map)),e.matcap!==void 0&&(r.matcap=o(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=o(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=o(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=o(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let i=e.normalScale;Array.isArray(i)===!1&&(i=[i,i]),r.normalScale=new Xt().fromArray(i)}return e.displacementMap!==void 0&&(r.displacementMap=o(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=o(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=o(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=o(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=o(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=o(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=o(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=o(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=o(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=o(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=o(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=o(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=o(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=o(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Xt().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=o(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=o(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=o(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=o(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=o(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=o(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=o(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const n={ShadowMaterial:$Ne,SpriteMaterial:pq,RawShaderMaterial:QNe,ShaderMaterial:_2,PointsMaterial:O1e,MeshPhysicalMaterial:ZNe,MeshStandardMaterial:mf,MeshPhongMaterial:q1e,MeshToonMaterial:eUe,MeshNormalMaterial:tUe,MeshLambertMaterial:nUe,MeshDepthMaterial:cq,MeshDistanceMaterial:uq,MeshBasicMaterial:e3,MeshMatcapMaterial:oUe,LineDashedMaterial:rUe,LineBasicMaterial:pp,Material:Pf};return new n[e]}}class Pce{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";for(let o=0,r=e.length;o0){const s=new ege(n);i=new OF(s),i.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){r=new OF(this.manager),r.setCrossOrigin(this.crossOrigin);for(let a=0,l=e.length;a"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,n,o,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,a=_x.get(e);if(a!==void 0)return i.manager.itemStart(e),setTimeout(function(){n&&n(a),i.manager.itemEnd(e)},0),a;const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader,fetch(e,l).then(function(s){return s.blob()}).then(function(s){return createImageBitmap(s,Object.assign(i.options,{colorSpaceConversion:"none"}))}).then(function(s){_x.add(e,s),n&&n(s),i.manager.itemEnd(e)}).catch(function(s){r&&r(s),i.manager.itemError(e),i.manager.itemEnd(e)}),i.manager.itemStart(e)}}let KB;class nge{static getContext(){return KB===void 0&&(KB=new(window.AudioContext||window.webkitAudioContext)),KB}static setContext(e){KB=e}}class k9t extends gp{constructor(e){super(e)}load(e,n,o,r){const i=this,a=new N9(this.manager);a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(s){try{const c=s.slice(0);nge.getContext().decodeAudioData(c,function(d){n(d)},l)}catch(c){l(c)}},o,r);function l(s){r?r(s):console.error(s),i.manager.itemError(e)}}}const S8e=new Ji,T8e=new Ji,W7=new Ji;class L9t{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new zu,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new zu,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 n=this._cache;if(n.focus!==e.focus||n.fov!==e.fov||n.aspect!==e.aspect*this.aspect||n.near!==e.near||n.far!==e.far||n.zoom!==e.zoom||n.eyeSep!==this.eyeSep){n.focus=e.focus,n.fov=e.fov,n.aspect=e.aspect*this.aspect,n.near=e.near,n.far=e.far,n.zoom=e.zoom,n.eyeSep=this.eyeSep,W7.copy(e.projectionMatrix);const r=n.eyeSep/2,i=r*n.near/n.focus,a=n.near*Math.tan(ax*n.fov*.5)/n.zoom;let l,s;T8e.elements[12]=-r,S8e.elements[12]=r,l=-a*n.aspect+i,s=a*n.aspect+i,W7.elements[0]=2*n.near/(s-l),W7.elements[8]=(s+l)/(s-l),this.cameraL.projectionMatrix.copy(W7),l=-a*n.aspect-i,s=a*n.aspect-i,W7.elements[0]=2*n.near/(s-l),W7.elements[8]=(s+l)/(s-l),this.cameraR.projectionMatrix.copy(W7)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(T8e),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(S8e)}}class oge{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=P8e(),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 n=P8e();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}function P8e(){return(typeof performance>"u"?Date:performance).now()}const N7=new ie,C8e=new bs,W9t=new ie,U7=new ie;class N9t extends Wl{constructor(){super(),this.type="AudioListener",this.context=nge.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new oge}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 n=this.context.listener,o=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(N7,C8e,W9t),U7.set(0,0,-1).applyQuaternion(C8e),n.positionX){const r=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(N7.x,r),n.positionY.linearRampToValueAtTime(N7.y,r),n.positionZ.linearRampToValueAtTime(N7.z,r),n.forwardX.linearRampToValueAtTime(U7.x,r),n.forwardY.linearRampToValueAtTime(U7.y,r),n.forwardZ.linearRampToValueAtTime(U7.z,r),n.upX.linearRampToValueAtTime(o.x,r),n.upY.linearRampToValueAtTime(o.y,r),n.upZ.linearRampToValueAtTime(o.z,r)}else n.setPosition(N7.x,N7.y,N7.z),n.setOrientation(U7.x,U7.y,U7.z,o.x,o.y,o.z)}}class vUe extends Wl{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 n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=n,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!==null&&(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,n=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,n=this.filters.length;e0&&this._mixBufferRegionAdditive(o,r,this._addIndex*n,1,n);for(let s=n,c=n+n;s!==c;++s)if(o[s]!==o[s+n]){l.setValue(o,r);break}}saveOriginalState(){const e=this.binding,n=this.buffer,o=this.valueSize,r=o*this._origIndex;e.getValue(n,r);for(let i=o,a=r;i!==a;++i)n[i]=n[r+i%o];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,n=e+this.valueSize;for(let o=e;o=.5)for(let a=0;a!==i;++a)e[n+a]=e[o+a]}_slerp(e,n,o,r){bs.slerpFlat(e,n,e,n,e,o,r)}_slerpAdditive(e,n,o,r,i){const a=this._workIndex*i;bs.multiplyQuaternionsFlat(e,a,e,n,e,o),bs.slerpFlat(e,n,e,n,e,a,r)}_lerp(e,n,o,r,i){const a=1-r;for(let l=0;l!==i;++l){const s=n+l;e[s]=e[s]*a+e[o+l]*r}}_lerpAdditive(e,n,o,r,i){for(let a=0;a!==i;++a){const l=n+a;e[l]=e[l]+e[o+a]*r}}}const rge="\\[\\]\\.:\\/",Y9t=new RegExp("["+rge+"]","g"),ige="[^"+rge+"]",O9t="[^"+rge.replace("\\.","")+"]",_9t=/((?:WC+[\/:])*)/.source.replace("WC",ige),V9t=/(WCOD+)?/.source.replace("WCOD",O9t),G9t=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",ige),X9t=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",ige),J9t=new RegExp("^"+_9t+V9t+G9t+X9t+"$"),K9t=["material","materials","bones","map"];class q9t{constructor(e,n,o){const r=o||Cl.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,r)}getValue(e,n){this.bind();const o=this._targetGroup.nCachedObjects_,r=this._bindings[o];r!==void 0&&r.getValue(e,n)}setValue(e,n){const o=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=o.length;r!==i;++r)o[r].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,o=e.length;n!==o;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,o=e.length;n!==o;++n)e[n].unbind()}}class Cl{constructor(e,n,o){this.path=n,this.parsedPath=o||Cl.parseTrackName(n),this.node=Cl.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,o){return e&&e.isAnimationObjectGroup?new Cl.Composite(e,n,o):new Cl(e,n,o)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Y9t,"")}static parseTrackName(e){const n=J9t.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const o={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},r=o.nodeName&&o.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const i=o.nodeName.substring(r+1);K9t.indexOf(i)!==-1&&(o.nodeName=o.nodeName.substring(0,r),o.objectName=i)}if(o.propertyName===null||o.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return o}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const o=e.skeleton.getBoneByName(n);if(o!==void 0)return o}if(e.children){const o=function(i){for(let a=0;a=i){const d=i++,f=e[d];n[f.uuid]=u,e[u]=f,n[c]=d,e[d]=s;for(let p=0,g=r;p!==g;++p){const y=o[p],w=y[d],b=y[u];y[u]=w,y[d]=b}}}this.nCachedObjects_=i}uncache(){const e=this._objects,n=this._indicesByUUID,o=this._bindings,r=o.length;let i=this.nCachedObjects_,a=e.length;for(let l=0,s=arguments.length;l!==s;++l){const c=arguments[l],u=c.uuid,d=n[u];if(d!==void 0)if(delete n[u],d0&&(n[p.uuid]=d),e[d]=p,e.pop();for(let g=0,y=r;g!==y;++g){const w=o[g];w[d]=w[f],w.pop()}}}this.nCachedObjects_=i}subscribe_(e,n){const o=this._bindingsIndicesByPath;let r=o[e];const i=this._bindings;if(r!==void 0)return i[r];const a=this._paths,l=this._parsedPaths,s=this._objects,c=s.length,u=this.nCachedObjects_,d=new Array(c);r=i.length,o[e]=r,a.push(e),l.push(n),i.push(d);for(let f=u,p=s.length;f!==p;++f){const g=s[f];d[f]=new Cl(g,e,n)}return d}unsubscribe_(e){const n=this._bindingsIndicesByPath,o=n[e];if(o!==void 0){const r=this._paths,i=this._parsedPaths,a=this._bindings,l=a.length-1,s=a[l],c=e[l];n[c]=o,a[o]=s,a.pop(),i[o]=i[l],i.pop(),r[o]=r[l],r.pop()}}}class bUe{constructor(e,n,o=null,r=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=o,this.blendMode=r;const i=n.tracks,a=i.length,l=new Array(a),s={endingStart:Mv,endingEnd:Mv};for(let c=0;c!==a;++c){const u=i[c].createInterpolant(null);l[c]=u,u.settings=s}this._interpolantSettings=s,this._interpolants=l,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=sNe,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,n){return this.loop=e,this.repetitions=n,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,n,o){if(e.fadeOut(n),this.fadeIn(n),o){const r=this._clip.duration,i=e._clip.duration,a=i/r,l=r/i;e.warp(1,a,n),this.warp(l,1,n)}return this}crossFadeTo(e,n,o){return e.crossFadeFrom(this,n,o)}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,n,o){const r=this._mixer,i=r.time,a=this.timeScale;let l=this._timeScaleInterpolant;l===null&&(l=r._lendControlInterpolant(),this._timeScaleInterpolant=l);const s=l.parameterPositions,c=l.sampleValues;return s[0]=i,s[1]=i+o,c[0]=e/a,c[1]=n/a,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,n,o,r){if(!this.enabled){this._updateWeight(e);return}const i=this._startTime;if(i!==null){const s=(e-i)*o;s<0||o===0?n=0:(this._startTime=null,n=o*s)}n*=this._updateTimeScale(e);const a=this._updateTime(n),l=this._updateWeight(e);if(l>0){const s=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case I1e:for(let u=0,d=s.length;u!==d;++u)s[u].evaluate(a),c[u].accumulateAdditive(l);break;case rq:default:for(let u=0,d=s.length;u!==d;++u)s[u].evaluate(a),c[u].accumulate(r,l)}}}_updateWeight(e){let n=0;if(this.enabled){n=this.weight;const o=this._weightInterpolant;if(o!==null){const r=o.evaluate(e)[0];n*=r,e>o.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=n,n}_updateTimeScale(e){let n=0;if(!this.paused){n=this.timeScale;const o=this._timeScaleInterpolant;if(o!==null){const r=o.evaluate(e)[0];n*=r,e>o.parameterPositions[1]&&(this.stopWarping(),n===0?this.paused=!0:this.timeScale=n)}}return this._effectiveTimeScale=n,n}_updateTime(e){const n=this._clip.duration,o=this.loop;let r=this.time+e,i=this._loopCount;const a=o===cNe;if(e===0)return i===-1?r:a&&(i&1)===1?n-r:r;if(o===lNe){i===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=n)r=n;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(i===-1&&(e>=0?(i=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),r>=n||r<0){const l=Math.floor(r/n);r-=n*l,i+=Math.abs(l);const s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?n:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(s===1){const c=e<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:l})}}else this.time=r;if(a&&(i&1)===1)return n-r}return r}_setEndings(e,n,o){const r=this._interpolantSettings;o?(r.endingStart=Iv,r.endingEnd=Iv):(e?r.endingStart=this.zeroSlopeAtStart?Iv:Mv:r.endingStart=HF,n?r.endingEnd=this.zeroSlopeAtEnd?Iv:Mv:r.endingEnd=HF)}_scheduleFading(e,n,o){const r=this._mixer,i=r.time;let a=this._weightInterpolant;a===null&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);const l=a.parameterPositions,s=a.sampleValues;return l[0]=i,s[0]=n,l[1]=i+e,s[1]=o,this}}const Q9t=new Float32Array(1);class Z9t extends Z9{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,n){const o=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,l=e._interpolants,s=o.uuid,c=this._bindingsByRootAndName;let u=c[s];u===void 0&&(u={},c[s]=u);for(let d=0;d!==i;++d){const f=r[d],p=f.name;let g=u[p];if(g!==void 0)++g.referenceCount,a[d]=g;else{if(g=a[d],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,s,p));continue}const y=n&&n._propertyBindings[d].binding.parsedPath;g=new xUe(Cl.create(o,p,y),f.ValueTypeName,f.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,s,p),a[d]=g}l[d].resultBuffer=g.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const o=(e._localRoot||this._root).uuid,r=e._clip.uuid,i=this._actionsByClip[r];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,r,o)}const n=e._propertyBindings;for(let o=0,r=n.length;o!==r;++o){const i=n[o];i.useCount++===0&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const n=e._propertyBindings;for(let o=0,r=n.length;o!==r;++o){const i=n[o];--i.useCount===0&&(i.restoreOriginalState(),this._takeBackBinding(i))}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 n=e._cacheIndex;return n!==null&&n=0;--o)e[o].stop();return this}update(e){e*=this.timeScale;const n=this._actions,o=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let c=0;c!==o;++c)n[c]._update(r,e,i,a);const l=this._bindings,s=this._nActiveBindings;for(let c=0;c!==s;++c)l[c].apply(a);return this}setTime(e){this.time=0;for(let n=0;nthis.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,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,M8e).distanceTo(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}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 I8e=new ie,qB=new ie;class lge{constructor(e=new ie,n=new ie){this.start=e,this.end=n}set(e,n){return this.start.copy(e),this.end.copy(n),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,n){return this.delta(n).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,n){I8e.subVectors(e,this.start),qB.subVectors(this.end,this.start);const o=qB.dot(qB);let i=qB.dot(I8e)/o;return n&&(i=h0(i,0,1)),i}closestPointToPoint(e,n,o){const r=this.closestPointToPointParameter(e,n);return this.delta(o).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const z8e=new ie;class i3t extends Wl{constructor(e,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const o=new Ni,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,l=1,s=32;a1)for(let d=0;d.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{L8e.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(L8e,n)}}setLength(e,n=e*.2,o=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(o,n,o),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}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class A3t extends n3{constructor(e=1){const n=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],o=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Ni;r.setAttribute("position",new gr(n,3)),r.setAttribute("color",new gr(o,3));const i=new pp({vertexColors:!0,toneMapped:!1});super(r,i),this.type="AxesHelper"}setColors(e,n,o){const r=new rr,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(n),r.toArray(i,6),r.toArray(i,9),r.set(o),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class TUe{constructor(){this.type="ShapePath",this.color=new rr,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new LF,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,o,r){return this.currentPath.quadraticCurveTo(e,n,o,r),this}bezierCurveTo(e,n,o,r,i,a){return this.currentPath.bezierCurveTo(e,n,o,r,i,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(b){const C=[];for(let P=0,v=b.length;PNumber.EPSILON){if(M<0&&(x=C[A],R=-R,S=C[T],M=-M),b.yS.y)continue;if(b.y===x.y){if(b.x===x.x)return!0}else{const D=M*(b.x-x.x)-R*(b.y-x.y);if(D===0)return!0;if(D<0)continue;v=!v}}else{if(b.y!==x.y)continue;if(S.x<=b.x&&b.x<=x.x||x.x<=b.x&&b.x<=S.x)return!0}}return v}const r=C9.isClockWise,i=this.subPaths;if(i.length===0)return[];let a,l,s;const c=[];if(i.length===1)return l=i[0],s=new Fl,s.curves=l.curves,c.push(s),c;let u=!r(i[0].getPoints());u=e?!u:u;const d=[],f=[];let p=[],g=0,y;f[g]=void 0,p[g]=[];for(let b=0,C=i.length;b1){let b=!1,C=0;for(let P=0,v=f.length;P0&&b===!1&&(p=d)}let w;for(let b=0,C=f.length;bu||r.y>u)&&(r.x>u&&(i.x=Math.floor(u/F.x),r.x=i.x*F.x,N.mapSize.x=i.x),r.y>u&&(i.y=Math.floor(u/F.y),r.y=i.y*F.y,N.mapSize.y=i.y)),N.map===null||E===!0||W===!0){const O=this.type!==l2?{minFilter:k0,magFilter:k0}:{};N.map!==null&&N.map.dispose(),N.map=new $m(r.x,r.y,O),N.map.texture.name=k.name+".shadowMap",N.camera.updateProjectionMatrix()}t.setRenderTarget(N.map),t.clear();const U=N.getViewportCount();for(let O=0;O0||A.map&&A.alphaTest>0){const D=R.uuid,E=A.uuid;let W=c[D];W===void 0&&(W={},c[D]=W);let j=W[E];j===void 0&&(j=R.clone(),W[E]=j),R=j}if(R.visible=A.visible,R.wireframe=A.wireframe,S===l2?R.side=A.shadowSide!==null?A.shadowSide:A.side:R.side=A.shadowSide!==null?A.shadowSide:d[A.side],R.alphaMap=A.alphaMap,R.alphaTest=A.alphaTest,R.map=A.map,R.clipShadows=A.clipShadows,R.clippingPlanes=A.clippingPlanes,R.clipIntersection=A.clipIntersection,R.displacementMap=A.displacementMap,R.displacementScale=A.displacementScale,R.displacementBias=A.displacementBias,R.wireframeLinewidth=A.wireframeLinewidth,R.linewidth=A.linewidth,x.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const D=t.properties.get(R);D.light=x}return R}function v(T,A,x,S,R){if(T.visible===!1)return;if(T.layers.test(A.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&R===l2)&&(!T.frustumCulled||o.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(x.matrixWorldInverse,T.matrixWorld);const E=e.update(T),W=T.material;if(Array.isArray(W)){const j=E.groups;for(let L=0,k=j.length;L=1):O.indexOf("OpenGL ES")!==-1&&(U=parseFloat(/^OpenGL ES (\d)/.exec(O)[1]),F=U>=2);let B=null,_={};const X=t.getParameter(t.SCISSOR_BOX),$=t.getParameter(t.VIEWPORT),Q=new Qa().fromArray(X),le=new Qa().fromArray($);function q(Ve,yt,ct,Xe){const ut=new Uint8Array(4),ft=t.createTexture();t.bindTexture(Ve,ft),t.texParameteri(Ve,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(Ve,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let ot=0;ot"u"?!1:/OculusBrowser/g.test(navigator.userAgent),g=new WeakMap;let y;const w=new WeakMap;let b=!1;try{b=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function C(ye,ce){return b?new OffscreenCanvas(ye,ce):FF("canvas")}function P(ye,ce,pe,ve){let Ae=1;if((ye.width>ve||ye.height>ve)&&(Ae=ve/Math.max(ye.width,ye.height)),Ae<1||ce===!0)if(typeof HTMLImageElement<"u"&&ye instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&ye instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&ye instanceof ImageBitmap){const Te=ce?nG:Math.floor,Me=Te(Ae*ye.width),Pe=Te(Ae*ye.height);y===void 0&&(y=C(Me,Pe));const Ee=pe?C(Me,Pe):y;return Ee.width=Me,Ee.height=Pe,Ee.getContext("2d").drawImage(ye,0,0,Me,Pe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ye.width+"x"+ye.height+") to ("+Me+"x"+Pe+")."),Ee}else return"data"in ye&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ye.width+"x"+ye.height+")."),ye;return ye}function v(ye){return Ace(ye.width)&&Ace(ye.height)}function T(ye){return l?!1:ye.wrapS!==dh||ye.wrapT!==dh||ye.minFilter!==k0&&ye.minFilter!==Gs}function A(ye,ce){return ye.generateMipmaps&&ce&&ye.minFilter!==k0&&ye.minFilter!==Gs}function x(ye){t.generateMipmap(ye)}function S(ye,ce,pe,ve,Ae=!1){if(l===!1)return ce;if(ye!==null){if(t[ye]!==void 0)return t[ye];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ye+"'")}let Te=ce;if(ce===t.RED&&(pe===t.FLOAT&&(Te=t.R32F),pe===t.HALF_FLOAT&&(Te=t.R16F),pe===t.UNSIGNED_BYTE&&(Te=t.R8)),ce===t.RED_INTEGER&&(pe===t.UNSIGNED_BYTE&&(Te=t.R8UI),pe===t.UNSIGNED_SHORT&&(Te=t.R16UI),pe===t.UNSIGNED_INT&&(Te=t.R32UI),pe===t.BYTE&&(Te=t.R8I),pe===t.SHORT&&(Te=t.R16I),pe===t.INT&&(Te=t.R32I)),ce===t.RG&&(pe===t.FLOAT&&(Te=t.RG32F),pe===t.HALF_FLOAT&&(Te=t.RG16F),pe===t.UNSIGNED_BYTE&&(Te=t.RG8)),ce===t.RGBA){const Me=Ae?MF:cs.getTransfer(ve);pe===t.FLOAT&&(Te=t.RGBA32F),pe===t.HALF_FLOAT&&(Te=t.RGBA16F),pe===t.UNSIGNED_BYTE&&(Te=Me===Ys?t.SRGB8_ALPHA8:t.RGBA8),pe===t.UNSIGNED_SHORT_4_4_4_4&&(Te=t.RGBA4),pe===t.UNSIGNED_SHORT_5_5_5_1&&(Te=t.RGB5_A1)}return(Te===t.R16F||Te===t.R32F||Te===t.RG16F||Te===t.RG32F||Te===t.RGBA16F||Te===t.RGBA32F)&&e.get("EXT_color_buffer_float"),Te}function R(ye,ce,pe){return A(ye,pe)===!0||ye.isFramebufferTexture&&ye.minFilter!==k0&&ye.minFilter!==Gs?Math.log2(Math.max(ce.width,ce.height))+1:ye.mipmaps!==void 0&&ye.mipmaps.length>0?ye.mipmaps.length:ye.isCompressedTexture&&Array.isArray(ye.image)?ce.mipmaps.length:1}function M(ye){return ye===k0||ye===eG||ye===uE?t.NEAREST:t.LINEAR}function D(ye){const ce=ye.target;ce.removeEventListener("dispose",D),W(ce),ce.isVideoTexture&&g.delete(ce)}function E(ye){const ce=ye.target;ce.removeEventListener("dispose",E),L(ce)}function W(ye){const ce=o.get(ye);if(ce.__webglInit===void 0)return;const pe=ye.source,ve=w.get(pe);if(ve){const Ae=ve[ce.__cacheKey];Ae.usedTimes--,Ae.usedTimes===0&&j(ye),Object.keys(ve).length===0&&w.delete(pe)}o.remove(ye)}function j(ye){const ce=o.get(ye);t.deleteTexture(ce.__webglTexture);const pe=ye.source,ve=w.get(pe);delete ve[ce.__cacheKey],a.memory.textures--}function L(ye){const ce=ye.texture,pe=o.get(ye),ve=o.get(ce);if(ve.__webglTexture!==void 0&&(t.deleteTexture(ve.__webglTexture),a.memory.textures--),ye.depthTexture&&ye.depthTexture.dispose(),ye.isWebGLCubeRenderTarget)for(let Ae=0;Ae<6;Ae++){if(Array.isArray(pe.__webglFramebuffer[Ae]))for(let Te=0;Te=s&&console.warn("THREE.WebGLTextures: Trying to use "+ye+" texture units while this GPU supports only "+s),k+=1,ye}function U(ye){const ce=[];return ce.push(ye.wrapS),ce.push(ye.wrapT),ce.push(ye.wrapR||0),ce.push(ye.magFilter),ce.push(ye.minFilter),ce.push(ye.anisotropy),ce.push(ye.internalFormat),ce.push(ye.format),ce.push(ye.type),ce.push(ye.generateMipmaps),ce.push(ye.premultiplyAlpha),ce.push(ye.flipY),ce.push(ye.unpackAlignment),ce.push(ye.colorSpace),ce.join()}function O(ye,ce){const pe=o.get(ye);if(ye.isVideoTexture&&ze(ye),ye.isRenderTargetTexture===!1&&ye.version>0&&pe.__version!==ye.version){const ve=ye.image;if(ve===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ve.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{re(pe,ye,ce);return}}n.bindTexture(t.TEXTURE_2D,pe.__webglTexture,t.TEXTURE0+ce)}function B(ye,ce){const pe=o.get(ye);if(ye.version>0&&pe.__version!==ye.version){re(pe,ye,ce);return}n.bindTexture(t.TEXTURE_2D_ARRAY,pe.__webglTexture,t.TEXTURE0+ce)}function _(ye,ce){const pe=o.get(ye);if(ye.version>0&&pe.__version!==ye.version){re(pe,ye,ce);return}n.bindTexture(t.TEXTURE_3D,pe.__webglTexture,t.TEXTURE0+ce)}function X(ye,ce){const pe=o.get(ye);if(ye.version>0&&pe.__version!==ye.version){ae(pe,ye,ce);return}n.bindTexture(t.TEXTURE_CUBE_MAP,pe.__webglTexture,t.TEXTURE0+ce)}const $={[Hs]:t.REPEAT,[dh]:t.CLAMP_TO_EDGE,[PF]:t.MIRRORED_REPEAT},Q={[k0]:t.NEAREST,[eG]:t.NEAREST_MIPMAP_NEAREST,[uE]:t.NEAREST_MIPMAP_LINEAR,[Gs]:t.LINEAR,[S1e]:t.LINEAR_MIPMAP_NEAREST,[Q8]:t.LINEAR_MIPMAP_LINEAR},le={[hNe]:t.NEVER,[vNe]:t.ALWAYS,[pNe]:t.LESS,[mNe]:t.LEQUAL,[gNe]:t.EQUAL,[wNe]:t.GEQUAL,[yNe]:t.GREATER,[ANe]:t.NOTEQUAL};function q(ye,ce,pe){if(pe?(t.texParameteri(ye,t.TEXTURE_WRAP_S,$[ce.wrapS]),t.texParameteri(ye,t.TEXTURE_WRAP_T,$[ce.wrapT]),(ye===t.TEXTURE_3D||ye===t.TEXTURE_2D_ARRAY)&&t.texParameteri(ye,t.TEXTURE_WRAP_R,$[ce.wrapR]),t.texParameteri(ye,t.TEXTURE_MAG_FILTER,Q[ce.magFilter]),t.texParameteri(ye,t.TEXTURE_MIN_FILTER,Q[ce.minFilter])):(t.texParameteri(ye,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(ye,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),(ye===t.TEXTURE_3D||ye===t.TEXTURE_2D_ARRAY)&&t.texParameteri(ye,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),(ce.wrapS!==dh||ce.wrapT!==dh)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(ye,t.TEXTURE_MAG_FILTER,M(ce.magFilter)),t.texParameteri(ye,t.TEXTURE_MIN_FILTER,M(ce.minFilter)),ce.minFilter!==k0&&ce.minFilter!==Gs&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),ce.compareFunction&&(t.texParameteri(ye,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(ye,t.TEXTURE_COMPARE_FUNC,le[ce.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ve=e.get("EXT_texture_filter_anisotropic");if(ce.magFilter===k0||ce.minFilter!==uE&&ce.minFilter!==Q8||ce.type===v2&&e.has("OES_texture_float_linear")===!1||l===!1&&ce.type===jx&&e.has("OES_texture_half_float_linear")===!1)return;(ce.anisotropy>1||o.get(ce).__currentAnisotropy)&&(t.texParameterf(ye,ve.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(ce.anisotropy,r.getMaxAnisotropy())),o.get(ce).__currentAnisotropy=ce.anisotropy)}}function te(ye,ce){let pe=!1;ye.__webglInit===void 0&&(ye.__webglInit=!0,ce.addEventListener("dispose",D));const ve=ce.source;let Ae=w.get(ve);Ae===void 0&&(Ae={},w.set(ve,Ae));const Te=U(ce);if(Te!==ye.__cacheKey){Ae[Te]===void 0&&(Ae[Te]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,pe=!0),Ae[Te].usedTimes++;const Me=Ae[ye.__cacheKey];Me!==void 0&&(Ae[ye.__cacheKey].usedTimes--,Me.usedTimes===0&&j(ce)),ye.__cacheKey=Te,ye.__webglTexture=Ae[Te].texture}return pe}function re(ye,ce,pe){let ve=t.TEXTURE_2D;(ce.isDataArrayTexture||ce.isCompressedArrayTexture)&&(ve=t.TEXTURE_2D_ARRAY),ce.isData3DTexture&&(ve=t.TEXTURE_3D);const Ae=te(ye,ce),Te=ce.source;n.bindTexture(ve,ye.__webglTexture,t.TEXTURE0+pe);const Me=o.get(Te);if(Te.version!==Me.__version||Ae===!0){n.activeTexture(t.TEXTURE0+pe);const Pe=cs.getPrimaries(cs.workingColorSpace),Ee=ce.colorSpace===dg?null:cs.getPrimaries(ce.colorSpace),Be=ce.colorSpace===dg||Pe===Ee?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,ce.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ce.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,ce.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Be);const Je=T(ce)&&v(ce.image)===!1;let We=P(ce.image,Je,!1,u);We=Ie(ce,We);const Ke=v(We)||l,Ne=i.convert(ce.format,ce.colorSpace);let De=i.convert(ce.type),ke=S(ce.internalFormat,Ne,De,ce.colorSpace,ce.isVideoTexture);q(ve,ce,Ke);let Ye;const it=ce.mipmaps,Ve=l&&ce.isVideoTexture!==!0,yt=Me.__version===void 0||Ae===!0,ct=R(ce,We,Ke);if(ce.isDepthTexture)ke=t.DEPTH_COMPONENT,l?ce.type===v2?ke=t.DEPTH_COMPONENT32F:ce.type===b6?ke=t.DEPTH_COMPONENT24:ce.type===W8?ke=t.DEPTH24_STENCIL8:ke=t.DEPTH_COMPONENT16:ce.type===v2&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),ce.format===N8&&ke===t.DEPTH_COMPONENT&&ce.type!==rq&&ce.type!==b6&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),ce.type=b6,De=i.convert(ce.type)),ce.format===Bx&&ke===t.DEPTH_COMPONENT&&(ke=t.DEPTH_STENCIL,ce.type!==W8&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),ce.type=W8,De=i.convert(ce.type))),yt&&(Ve?n.texStorage2D(t.TEXTURE_2D,1,ke,We.width,We.height):n.texImage2D(t.TEXTURE_2D,0,ke,We.width,We.height,0,Ne,De,null));else if(ce.isDataTexture)if(it.length>0&&Ke){Ve&&yt&&n.texStorage2D(t.TEXTURE_2D,ct,ke,it[0].width,it[0].height);for(let Xe=0,ut=it.length;Xe>=1,ut>>=1}}else if(it.length>0&&Ke){Ve&&yt&&n.texStorage2D(t.TEXTURE_2D,ct,ke,it[0].width,it[0].height);for(let Xe=0,ut=it.length;Xe0&&yt++,n.texStorage2D(t.TEXTURE_CUBE_MAP,yt,Ye,We[0].width,We[0].height));for(let Xe=0;Xe<6;Xe++)if(Je){it?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Xe,0,0,0,We[Xe].width,We[Xe].height,De,ke,We[Xe].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Xe,0,Ye,We[Xe].width,We[Xe].height,0,De,ke,We[Xe].data);for(let ut=0;ut>Te),We=Math.max(1,ce.height>>Te);Ae===t.TEXTURE_3D||Ae===t.TEXTURE_2D_ARRAY?n.texImage3D(Ae,Te,Ee,Je,We,ce.depth,0,Me,Pe,null):n.texImage2D(Ae,Te,Ee,Je,We,0,Me,Pe,null)}n.bindFramebuffer(t.FRAMEBUFFER,ye),Se(ce)?f.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,ve,Ae,o.get(pe).__webglTexture,0,He(ce)):(Ae===t.TEXTURE_2D||Ae>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&Ae<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,ve,Ae,o.get(pe).__webglTexture,Te),n.bindFramebuffer(t.FRAMEBUFFER,null)}function ne(ye,ce,pe){if(t.bindRenderbuffer(t.RENDERBUFFER,ye),ce.depthBuffer&&!ce.stencilBuffer){let ve=l===!0?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(pe||Se(ce)){const Ae=ce.depthTexture;Ae&&Ae.isDepthTexture&&(Ae.type===v2?ve=t.DEPTH_COMPONENT32F:Ae.type===b6&&(ve=t.DEPTH_COMPONENT24));const Te=He(ce);Se(ce)?f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Te,ve,ce.width,ce.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,Te,ve,ce.width,ce.height)}else t.renderbufferStorage(t.RENDERBUFFER,ve,ce.width,ce.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,ye)}else if(ce.depthBuffer&&ce.stencilBuffer){const ve=He(ce);pe&&Se(ce)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,ve,t.DEPTH24_STENCIL8,ce.width,ce.height):Se(ce)?f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,ve,t.DEPTH24_STENCIL8,ce.width,ce.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,ce.width,ce.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,ye)}else{const ve=ce.isWebGLMultipleRenderTargets===!0?ce.texture:[ce.texture];for(let Ae=0;Ae0){pe.__webglFramebuffer[Pe]=[];for(let Ee=0;Ee0){pe.__webglFramebuffer=[];for(let Pe=0;Pe0&&Se(ye)===!1){const Pe=Te?ce:[ce];pe.__webglMultisampledFramebuffer=t.createFramebuffer(),pe.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,pe.__webglMultisampledFramebuffer);for(let Ee=0;Ee0)for(let Ee=0;Ee0)for(let Ee=0;Ee0&&Se(ye)===!1){const ce=ye.isWebGLMultipleRenderTargets?ye.texture:[ye.texture],pe=ye.width,ve=ye.height;let Ae=t.COLOR_BUFFER_BIT;const Te=[],Me=ye.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Pe=o.get(ye),Ee=ye.isWebGLMultipleRenderTargets===!0;if(Ee)for(let Be=0;Be0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&ce.__useRenderToTexture!==!1}function ze(ye){const ce=a.render.frame;g.get(ye)!==ce&&(g.set(ye,ce),ye.update())}function Ie(ye,ce){const pe=ye.colorSpace,ve=ye.format,Ae=ye.type;return ye.isCompressedTexture===!0||ye.isVideoTexture===!0||ye.format===tG||pe!==L9&&pe!==dg&&(cs.getTransfer(pe)===Ys?l===!1?e.has("EXT_sRGB")===!0&&ve===Up?(ye.format=tG,ye.minFilter=Gs,ye.generateMipmaps=!1):ce=F1e.sRGBToLinear(ce):(ve!==Up||Ae!==P9)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",pe)),ce}this.allocateTextureUnit=F,this.resetTextureUnits=N,this.setTexture2D=O,this.setTexture2DArray=B,this.setTexture3D=_,this.setTextureCube=X,this.rebindTextures=de,this.setupRenderTarget=Z,this.updateRenderTargetMipmap=he,this.updateMultisampleRenderTarget=xe,this.setupDepthRenderbuffer=ge,this.setupFrameBufferTexture=se,this.useMultisampledRTT=Se}function kNe(t,e,n){const o=n.isWebGL2;function r(i,a=dg){let l;const s=cs.getTransfer(a);if(i===P9)return t.UNSIGNED_BYTE;if(i===P1e)return t.UNSIGNED_SHORT_4_4_4_4;if(i===C1e)return t.UNSIGNED_SHORT_5_5_5_1;if(i===ZWe)return t.BYTE;if(i===eNe)return t.SHORT;if(i===rq)return t.UNSIGNED_SHORT;if(i===T1e)return t.INT;if(i===b6)return t.UNSIGNED_INT;if(i===v2)return t.FLOAT;if(i===jx)return o?t.HALF_FLOAT:(l=e.get("OES_texture_half_float"),l!==null?l.HALF_FLOAT_OES:null);if(i===tNe)return t.ALPHA;if(i===Up)return t.RGBA;if(i===nNe)return t.LUMINANCE;if(i===oNe)return t.LUMINANCE_ALPHA;if(i===N8)return t.DEPTH_COMPONENT;if(i===Bx)return t.DEPTH_STENCIL;if(i===tG)return l=e.get("EXT_sRGB"),l!==null?l.SRGB_ALPHA_EXT:null;if(i===rNe)return t.RED;if(i===R1e)return t.RED_INTEGER;if(i===iNe)return t.RG;if(i===H1e)return t.RG_INTEGER;if(i===M1e)return t.RGBA_INTEGER;if(i===P_||i===C_||i===R_||i===H_)if(s===Ys)if(l=e.get("WEBGL_compressed_texture_s3tc_srgb"),l!==null){if(i===P_)return l.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===C_)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===R_)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===H_)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(l=e.get("WEBGL_compressed_texture_s3tc"),l!==null){if(i===P_)return l.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===C_)return l.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===R_)return l.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===H_)return l.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Vse||i===Gse||i===Xse||i===Jse)if(l=e.get("WEBGL_compressed_texture_pvrtc"),l!==null){if(i===Vse)return l.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Gse)return l.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Xse)return l.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Jse)return l.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===aNe)return l=e.get("WEBGL_compressed_texture_etc1"),l!==null?l.COMPRESSED_RGB_ETC1_WEBGL:null;if(i===Kse||i===qse)if(l=e.get("WEBGL_compressed_texture_etc"),l!==null){if(i===Kse)return s===Ys?l.COMPRESSED_SRGB8_ETC2:l.COMPRESSED_RGB8_ETC2;if(i===qse)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:l.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===$se||i===Qse||i===Zse||i===ece||i===tce||i===nce||i===oce||i===rce||i===ice||i===ace||i===lce||i===sce||i===cce||i===uce)if(l=e.get("WEBGL_compressed_texture_astc"),l!==null){if(i===$se)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:l.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Qse)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:l.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Zse)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:l.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===ece)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:l.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===tce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:l.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===nce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:l.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===oce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:l.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===rce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:l.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===ice)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:l.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===ace)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:l.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===lce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:l.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===sce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:l.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===cce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:l.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===uce)return s===Ys?l.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:l.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===M_||i===dce||i===fce)if(l=e.get("EXT_texture_compression_bptc"),l!==null){if(i===M_)return s===Ys?l.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:l.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===dce)return l.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===fce)return l.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===lNe||i===hce||i===pce||i===gce)if(l=e.get("EXT_texture_compression_rgtc"),l!==null){if(i===M_)return l.COMPRESSED_RED_RGTC1_EXT;if(i===hce)return l.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===pce)return l.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===gce)return l.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===W8?o?t.UNSIGNED_INT_24_8:(l=e.get("WEBGL_depth_texture"),l!==null?l.UNSIGNED_INT_24_8_WEBGL:null):t[i]!==void 0?t[i]:null}return{convert:r}}class LNe extends zu{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}let GP=class extends Wl{constructor(){super(),this.isGroup=!0,this.type="Group"}};const k5t={type:"move"};class Voe{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new GP,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 GP,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ie,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ie),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new GP,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ie,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ie),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const o of e.hand.values())this._getHandJoint(n,o)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,o){let r=null,i=null,a=null;const l=this._targetRay,s=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const y of e.hand.values()){const w=n.getJointPose(y,o),b=this._getHandJoint(c,y);w!==null&&(b.matrix.fromArray(w.transform.matrix),b.matrix.decompose(b.position,b.rotation,b.scale),b.matrixWorldNeedsUpdate=!0,b.jointRadius=w.radius),b.visible=w!==null}const u=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],f=u.position.distanceTo(d.position),p=.02,g=.005;c.inputState.pinching&&f>p+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=p-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=n.getPose(e.gripSpace,o),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));l!==null&&(r=n.getPose(e.targetRaySpace,o),r===null&&i!==null&&(r=i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(k5t)))}return l!==null&&(l.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const o=new GP;o.matrixAutoUpdate=!1,o.visible=!1,e.joints[n.jointName]=o,e.add(o)}return e.joints[n.jointName]}}class U1e extends Vc{constructor(e,n,o,r,i,a,l,s,c,u){if(u=u!==void 0?u:N8,u!==N8&&u!==Bx)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");o===void 0&&u===N8&&(o=b6),o===void 0&&u===Bx&&(o=W8),super(null,r,i,a,l,s,u,o,c),this.isDepthTexture=!0,this.image={width:e,height:n},this.magFilter=l!==void 0?l:k0,this.minFilter=s!==void 0?s:k0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class L5t extends Z9{constructor(e,n){super();const o=this;let r=null,i=1,a=null,l="local-floor",s=1,c=null,u=null,d=null,f=null,p=null,g=null;const y=n.getContextAttributes();let w=null,b=null;const C=[],P=[],v=new zu;v.layers.enable(1),v.viewport=new Qa;const T=new zu;T.layers.enable(2),T.viewport=new Qa;const A=[v,T],x=new LNe;x.layers.enable(1),x.layers.enable(2);let S=null,R=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let _=C[B];return _===void 0&&(_=new Voe,C[B]=_),_.getTargetRaySpace()},this.getControllerGrip=function(B){let _=C[B];return _===void 0&&(_=new Voe,C[B]=_),_.getGripSpace()},this.getHand=function(B){let _=C[B];return _===void 0&&(_=new Voe,C[B]=_),_.getHandSpace()};function M(B){const _=P.indexOf(B.inputSource);if(_===-1)return;const X=C[_];X!==void 0&&(X.update(B.inputSource,B.frame,c||a),X.dispatchEvent({type:B.type,data:B.inputSource}))}function D(){r.removeEventListener("select",M),r.removeEventListener("selectstart",M),r.removeEventListener("selectend",M),r.removeEventListener("squeeze",M),r.removeEventListener("squeezestart",M),r.removeEventListener("squeezeend",M),r.removeEventListener("end",D),r.removeEventListener("inputsourceschange",E);for(let B=0;B=0&&(P[$]=null,C[$].disconnect(X))}for(let _=0;_=P.length){P.push(X),$=le;break}else if(P[le]===null){P[le]=X,$=le;break}if($===-1)break}const Q=C[$];Q&&Q.connect(X)}}const W=new ie,j=new ie;function L(B,_,X){W.setFromMatrixPosition(_.matrixWorld),j.setFromMatrixPosition(X.matrixWorld);const $=W.distanceTo(j),Q=_.projectionMatrix.elements,le=X.projectionMatrix.elements,q=Q[14]/(Q[10]-1),te=Q[14]/(Q[10]+1),re=(Q[9]+1)/Q[5],ae=(Q[9]-1)/Q[5],se=(Q[8]-1)/Q[0],ne=(le[8]+1)/le[0],fe=q*se,ge=q*ne,de=$/(-se+ne),Z=de*-se;_.matrixWorld.decompose(B.position,B.quaternion,B.scale),B.translateX(Z),B.translateZ(de),B.matrixWorld.compose(B.position,B.quaternion,B.scale),B.matrixWorldInverse.copy(B.matrixWorld).invert();const he=q+de,xe=te+de,He=fe-Z,Se=ge+($-Z),ze=re*te/xe*he,Ie=ae*te/xe*he;B.projectionMatrix.makePerspective(He,Se,ze,Ie,he,xe),B.projectionMatrixInverse.copy(B.projectionMatrix).invert()}function k(B,_){_===null?B.matrixWorld.copy(B.matrix):B.matrixWorld.multiplyMatrices(_.matrixWorld,B.matrix),B.matrixWorldInverse.copy(B.matrixWorld).invert()}this.updateCamera=function(B){if(r===null)return;x.near=T.near=v.near=B.near,x.far=T.far=v.far=B.far,(S!==x.near||R!==x.far)&&(r.updateRenderState({depthNear:x.near,depthFar:x.far}),S=x.near,R=x.far);const _=B.parent,X=x.cameras;k(x,_);for(let $=0;$0&&(w.alphaTest.value=b.alphaTest);const C=e.get(b).envMap;if(C&&(w.envMap.value=C,w.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,w.reflectivity.value=b.reflectivity,w.ior.value=b.ior,w.refractionRatio.value=b.refractionRatio),b.lightMap){w.lightMap.value=b.lightMap;const P=t._useLegacyLights===!0?Math.PI:1;w.lightMapIntensity.value=b.lightMapIntensity*P,n(b.lightMap,w.lightMapTransform)}b.aoMap&&(w.aoMap.value=b.aoMap,w.aoMapIntensity.value=b.aoMapIntensity,n(b.aoMap,w.aoMapTransform))}function a(w,b){w.diffuse.value.copy(b.color),w.opacity.value=b.opacity,b.map&&(w.map.value=b.map,n(b.map,w.mapTransform))}function l(w,b){w.dashSize.value=b.dashSize,w.totalSize.value=b.dashSize+b.gapSize,w.scale.value=b.scale}function s(w,b,C,P){w.diffuse.value.copy(b.color),w.opacity.value=b.opacity,w.size.value=b.size*C,w.scale.value=P*.5,b.map&&(w.map.value=b.map,n(b.map,w.uvTransform)),b.alphaMap&&(w.alphaMap.value=b.alphaMap,n(b.alphaMap,w.alphaMapTransform)),b.alphaTest>0&&(w.alphaTest.value=b.alphaTest)}function c(w,b){w.diffuse.value.copy(b.color),w.opacity.value=b.opacity,w.rotation.value=b.rotation,b.map&&(w.map.value=b.map,n(b.map,w.mapTransform)),b.alphaMap&&(w.alphaMap.value=b.alphaMap,n(b.alphaMap,w.alphaMapTransform)),b.alphaTest>0&&(w.alphaTest.value=b.alphaTest)}function u(w,b){w.specular.value.copy(b.specular),w.shininess.value=Math.max(b.shininess,1e-4)}function d(w,b){b.gradientMap&&(w.gradientMap.value=b.gradientMap)}function f(w,b){w.metalness.value=b.metalness,b.metalnessMap&&(w.metalnessMap.value=b.metalnessMap,n(b.metalnessMap,w.metalnessMapTransform)),w.roughness.value=b.roughness,b.roughnessMap&&(w.roughnessMap.value=b.roughnessMap,n(b.roughnessMap,w.roughnessMapTransform)),e.get(b).envMap&&(w.envMapIntensity.value=b.envMapIntensity)}function p(w,b,C){w.ior.value=b.ior,b.sheen>0&&(w.sheenColor.value.copy(b.sheenColor).multiplyScalar(b.sheen),w.sheenRoughness.value=b.sheenRoughness,b.sheenColorMap&&(w.sheenColorMap.value=b.sheenColorMap,n(b.sheenColorMap,w.sheenColorMapTransform)),b.sheenRoughnessMap&&(w.sheenRoughnessMap.value=b.sheenRoughnessMap,n(b.sheenRoughnessMap,w.sheenRoughnessMapTransform))),b.clearcoat>0&&(w.clearcoat.value=b.clearcoat,w.clearcoatRoughness.value=b.clearcoatRoughness,b.clearcoatMap&&(w.clearcoatMap.value=b.clearcoatMap,n(b.clearcoatMap,w.clearcoatMapTransform)),b.clearcoatRoughnessMap&&(w.clearcoatRoughnessMap.value=b.clearcoatRoughnessMap,n(b.clearcoatRoughnessMap,w.clearcoatRoughnessMapTransform)),b.clearcoatNormalMap&&(w.clearcoatNormalMap.value=b.clearcoatNormalMap,n(b.clearcoatNormalMap,w.clearcoatNormalMapTransform),w.clearcoatNormalScale.value.copy(b.clearcoatNormalScale),b.side===p0&&w.clearcoatNormalScale.value.negate())),b.iridescence>0&&(w.iridescence.value=b.iridescence,w.iridescenceIOR.value=b.iridescenceIOR,w.iridescenceThicknessMinimum.value=b.iridescenceThicknessRange[0],w.iridescenceThicknessMaximum.value=b.iridescenceThicknessRange[1],b.iridescenceMap&&(w.iridescenceMap.value=b.iridescenceMap,n(b.iridescenceMap,w.iridescenceMapTransform)),b.iridescenceThicknessMap&&(w.iridescenceThicknessMap.value=b.iridescenceThicknessMap,n(b.iridescenceThicknessMap,w.iridescenceThicknessMapTransform))),b.transmission>0&&(w.transmission.value=b.transmission,w.transmissionSamplerMap.value=C.texture,w.transmissionSamplerSize.value.set(C.width,C.height),b.transmissionMap&&(w.transmissionMap.value=b.transmissionMap,n(b.transmissionMap,w.transmissionMapTransform)),w.thickness.value=b.thickness,b.thicknessMap&&(w.thicknessMap.value=b.thicknessMap,n(b.thicknessMap,w.thicknessMapTransform)),w.attenuationDistance.value=b.attenuationDistance,w.attenuationColor.value.copy(b.attenuationColor)),b.anisotropy>0&&(w.anisotropyVector.value.set(b.anisotropy*Math.cos(b.anisotropyRotation),b.anisotropy*Math.sin(b.anisotropyRotation)),b.anisotropyMap&&(w.anisotropyMap.value=b.anisotropyMap,n(b.anisotropyMap,w.anisotropyMapTransform))),w.specularIntensity.value=b.specularIntensity,w.specularColor.value.copy(b.specularColor),b.specularColorMap&&(w.specularColorMap.value=b.specularColorMap,n(b.specularColorMap,w.specularColorMapTransform)),b.specularIntensityMap&&(w.specularIntensityMap.value=b.specularIntensityMap,n(b.specularIntensityMap,w.specularIntensityMapTransform))}function g(w,b){b.matcap&&(w.matcap.value=b.matcap)}function y(w,b){const C=e.get(b).light;w.referencePosition.value.setFromMatrixPosition(C.matrixWorld),w.nearDistance.value=C.shadow.camera.near,w.farDistance.value=C.shadow.camera.far}return{refreshFogUniforms:o,refreshMaterialUniforms:r}}function N5t(t,e,n,o){let r={},i={},a=[];const l=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function s(C,P){const v=P.program;o.uniformBlockBinding(C,v)}function c(C,P){let v=r[C.id];v===void 0&&(g(C),v=u(C),r[C.id]=v,C.addEventListener("dispose",w));const T=P.program;o.updateUBOMapping(C,T);const A=e.render.frame;i[C.id]!==A&&(f(C),i[C.id]=A)}function u(C){const P=d();C.__bindingPointIndex=P;const v=t.createBuffer(),T=C.__size,A=C.usage;return t.bindBuffer(t.UNIFORM_BUFFER,v),t.bufferData(t.UNIFORM_BUFFER,T,A),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,P,v),v}function d(){for(let C=0;C0){A=v%T;const E=T-A;A!==0&&E-M.boundary<0&&(v+=T-A,R.__offset=v)}v+=M.storage}return A=v%T,A>0&&(v+=T-A),C.__size=v,C.__cache={},this}function y(C){const P={boundary:0,storage:0};return typeof C=="number"?(P.boundary=4,P.storage=4):C.isVector2?(P.boundary=8,P.storage=8):C.isVector3||C.isColor?(P.boundary=16,P.storage=12):C.isVector4?(P.boundary=16,P.storage=16):C.isMatrix3?(P.boundary=48,P.storage=48):C.isMatrix4?(P.boundary=64,P.storage=64):C.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",C),P}function w(C){const P=C.target;P.removeEventListener("dispose",w);const v=a.indexOf(P.__bindingPointIndex);a.splice(v,1),t.deleteBuffer(r[P.id]),delete r[P.id],delete i[P.id]}function b(){for(const C in r)t.deleteBuffer(r[C]);a=[],r={},i={}}return{bind:s,update:c,dispose:b}}class j1e{constructor(e={}){const{canvas:n=TNe(),context:o=null,depth:r=!0,stencil:i=!0,alpha:a=!1,antialias:l=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let f;o!==null?f=o.getContextAttributes().alpha:f=a;const p=new Uint32Array(4),g=new Int32Array(4);let y=null,w=null;const b=[],C=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=ru,this._useLegacyLights=!1,this.toneMapping=T9,this.toneMappingExposure=1;const P=this;let v=!1,T=0,A=0,x=null,S=-1,R=null;const M=new Qa,D=new Qa;let E=null;const W=new rr(0);let j=0,L=n.width,k=n.height,N=1,F=null,U=null;const O=new Qa(0,0,L,k),B=new Qa(0,0,L,k);let _=!1;const X=new sq;let $=!1,Q=!1,le=null;const q=new Ji,te=new Xt,re=new ie,ae={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function se(){return x===null?N:1}let ne=o;function fe(Fe,qe){for(let je=0;je{function Qe(){if(rt.forEach(function(Tt){xe.get(Tt).currentProgram.isReady()&&rt.delete(Tt)}),rt.size===0){mt(Fe);return}setTimeout(Qe,10)}ge.get("KHR_parallel_shader_compile")!==null?Qe():setTimeout(Qe,10)})};let ot=null;function st(Fe){ot&&ot(Fe)}function at(){Ze.stop()}function Oe(){Ze.start()}const Ze=new INe;Ze.setAnimationLoop(st),typeof self<"u"&&Ze.setContext(self),this.setAnimationLoop=function(Fe){ot=Fe,Ye.setAnimationLoop(Fe),Fe===null?Ze.stop():Ze.start()},Ye.addEventListener("sessionstart",at),Ye.addEventListener("sessionend",Oe),this.render=function(Fe,qe){if(qe!==void 0&&qe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(v===!0)return;Fe.matrixWorldAutoUpdate===!0&&Fe.updateMatrixWorld(),qe.parent===null&&qe.matrixWorldAutoUpdate===!0&&qe.updateMatrixWorld(),Ye.enabled===!0&&Ye.isPresenting===!0&&(Ye.cameraAutoUpdate===!0&&Ye.updateCamera(qe),qe=Ye.getCamera()),Fe.isScene===!0&&Fe.onBeforeRender(P,Fe,qe,x),w=Te.get(Fe,C.length),w.init(),C.push(w),q.multiplyMatrices(qe.projectionMatrix,qe.matrixWorldInverse),X.setFromProjectionMatrix(q),Q=this.localClippingEnabled,$=Me.init(this.clippingPlanes,Q),y=Ae.get(Fe,b.length),y.init(),b.push(y),St(Fe,qe,0,P.sortObjects),y.finish(),P.sortObjects===!0&&y.sort(F,U),this.info.render.frame++,$===!0&&Me.beginShadows();const je=w.state.shadowsArray;if(Pe.render(je,Fe,qe),$===!0&&Me.endShadows(),this.info.autoReset===!0&&this.info.reset(),Ee.render(y,Fe),w.setupLights(P._useLegacyLights),qe.isArrayCamera){const rt=qe.cameras;for(let mt=0,Qe=rt.length;mt0?w=C[C.length-1]:w=null,b.pop(),b.length>0?y=b[b.length-1]:y=null};function St(Fe,qe,je,rt){if(Fe.visible===!1)return;if(Fe.layers.test(qe.layers)){if(Fe.isGroup)je=Fe.renderOrder;else if(Fe.isLOD)Fe.autoUpdate===!0&&Fe.update(qe);else if(Fe.isLight)w.pushLight(Fe),Fe.castShadow&&w.pushShadow(Fe);else if(Fe.isSprite){if(!Fe.frustumCulled||X.intersectsSprite(Fe)){rt&&re.setFromMatrixPosition(Fe.matrixWorld).applyMatrix4(q);const Tt=ce.update(Fe),Dt=Fe.material;Dt.visible&&y.push(Fe,Tt,Dt,je,re.z,null)}}else if((Fe.isMesh||Fe.isLine||Fe.isPoints)&&(!Fe.frustumCulled||X.intersectsObject(Fe))){const Tt=ce.update(Fe),Dt=Fe.material;if(rt&&(Fe.boundingSphere!==void 0?(Fe.boundingSphere===null&&Fe.computeBoundingSphere(),re.copy(Fe.boundingSphere.center)):(Tt.boundingSphere===null&&Tt.computeBoundingSphere(),re.copy(Tt.boundingSphere.center)),re.applyMatrix4(Fe.matrixWorld).applyMatrix4(q)),Array.isArray(Dt)){const lt=Tt.groups;for(let zt=0,Ft=lt.length;zt0&&Rt(mt,Qe,qe,je),rt&&Z.viewport(M.copy(rt)),mt.length>0&&Ut(mt,qe,je),Qe.length>0&&Ut(Qe,qe,je),Tt.length>0&&Ut(Tt,qe,je),Z.buffers.depth.setTest(!0),Z.buffers.depth.setMask(!0),Z.buffers.color.setMask(!0),Z.setPolygonOffset(!1)}function Rt(Fe,qe,je,rt){if((je.isScene===!0?je.overrideMaterial:null)!==null)return;const Qe=de.isWebGL2;le===null&&(le=new $m(1,1,{generateMipmaps:!0,type:ge.has("EXT_color_buffer_half_float")?jx:P9,minFilter:Q8,samples:Qe?4:0})),P.getDrawingBufferSize(te),Qe?le.setSize(te.x,te.y):le.setSize(nG(te.x),nG(te.y));const Tt=P.getRenderTarget();P.setRenderTarget(le),P.getClearColor(W),j=P.getClearAlpha(),j<1&&P.setClearColor(16777215,.5),P.clear();const Dt=P.toneMapping;P.toneMapping=T9,Ut(Fe,je,rt),He.updateMultisampleRenderTarget(le),He.updateRenderTargetMipmap(le);let lt=!1;for(let zt=0,Ft=qe.length;zt0),_t=!!je.morphAttributes.position,tn=!!je.morphAttributes.normal,Qt=!!je.morphAttributes.color;let gn=T9;rt.toneMapped&&(x===null||x.isXRRenderTarget===!0)&&(gn=P.toneMapping);const an=je.morphAttributes.position||je.morphAttributes.normal||je.morphAttributes.color,mn=an!==void 0?an.length:0,Hn=xe.get(rt),Fo=w.state.lights;if($===!0&&(Q===!0||Fe!==R)){const br=Fe===R&&rt.id===S;Me.setState(rt,Fe,br)}let yo=!1;rt.version===Hn.__version?(Hn.needsLights&&Hn.lightsStateVersion!==Fo.state.version||Hn.outputColorSpace!==Dt||mt.isInstancedMesh&&Hn.instancing===!1||!mt.isInstancedMesh&&Hn.instancing===!0||mt.isSkinnedMesh&&Hn.skinning===!1||!mt.isSkinnedMesh&&Hn.skinning===!0||mt.isInstancedMesh&&Hn.instancingColor===!0&&mt.instanceColor===null||mt.isInstancedMesh&&Hn.instancingColor===!1&&mt.instanceColor!==null||Hn.envMap!==lt||rt.fog===!0&&Hn.fog!==Qe||Hn.numClippingPlanes!==void 0&&(Hn.numClippingPlanes!==Me.numPlanes||Hn.numIntersection!==Me.numIntersection)||Hn.vertexAlphas!==zt||Hn.vertexTangents!==Ft||Hn.morphTargets!==_t||Hn.morphNormals!==tn||Hn.morphColors!==Qt||Hn.toneMapping!==gn||de.isWebGL2===!0&&Hn.morphTargetsCount!==mn)&&(yo=!0):(yo=!0,Hn.__version=rt.version);let So=Hn.currentProgram;yo===!0&&(So=At(rt,qe,mt));let $o=!1,mo=!1,Jn=!1;const uo=So.getUniforms(),ir=Hn.uniforms;if(Z.useProgram(So.program)&&($o=!0,mo=!0,Jn=!0),rt.id!==S&&(S=rt.id,mo=!0),$o||R!==Fe){uo.setValue(ne,"projectionMatrix",Fe.projectionMatrix),uo.setValue(ne,"viewMatrix",Fe.matrixWorldInverse);const br=uo.map.cameraPosition;br!==void 0&&br.setValue(ne,re.setFromMatrixPosition(Fe.matrixWorld)),de.logarithmicDepthBuffer&&uo.setValue(ne,"logDepthBufFC",2/(Math.log(Fe.far+1)/Math.LN2)),(rt.isMeshPhongMaterial||rt.isMeshToonMaterial||rt.isMeshLambertMaterial||rt.isMeshBasicMaterial||rt.isMeshStandardMaterial||rt.isShaderMaterial)&&uo.setValue(ne,"isOrthographic",Fe.isOrthographicCamera===!0),R!==Fe&&(R=Fe,mo=!0,Jn=!0)}if(mt.isSkinnedMesh){uo.setOptional(ne,mt,"bindMatrix"),uo.setOptional(ne,mt,"bindMatrixInverse");const br=mt.skeleton;br&&(de.floatVertexTextures?(br.boneTexture===null&&br.computeBoneTexture(),uo.setValue(ne,"boneTexture",br.boneTexture,He),uo.setValue(ne,"boneTextureSize",br.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const Rr=je.morphAttributes;if((Rr.position!==void 0||Rr.normal!==void 0||Rr.color!==void 0&&de.isWebGL2===!0)&&Be.update(mt,je,So),(mo||Hn.receiveShadow!==mt.receiveShadow)&&(Hn.receiveShadow=mt.receiveShadow,uo.setValue(ne,"receiveShadow",mt.receiveShadow)),rt.isMeshGouraudMaterial&&rt.envMap!==null&&(ir.envMap.value=lt,ir.flipEnvMap.value=lt.isCubeTexture&<.isRenderTargetTexture===!1?-1:1),mo&&(uo.setValue(ne,"toneMappingExposure",P.toneMappingExposure),Hn.needsLights&&Ct(ir,Jn),Qe&&rt.fog===!0&&ve.refreshFogUniforms(ir,Qe),ve.refreshMaterialUniforms(ir,rt,N,k,le),z_.upload(ne,kt(Hn),ir,He)),rt.isShaderMaterial&&rt.uniformsNeedUpdate===!0&&(z_.upload(ne,kt(Hn),ir,He),rt.uniformsNeedUpdate=!1),rt.isSpriteMaterial&&uo.setValue(ne,"center",mt.center),uo.setValue(ne,"modelViewMatrix",mt.modelViewMatrix),uo.setValue(ne,"normalMatrix",mt.normalMatrix),uo.setValue(ne,"modelMatrix",mt.matrixWorld),rt.isShaderMaterial||rt.isRawShaderMaterial){const br=rt.uniformsGroups;for(let Vr=0,Wo=br.length;Vr0&&He.useMultisampledRTT(Fe)===!1?mt=xe.get(Fe).__webglMultisampledFramebuffer:Array.isArray(Ft)?mt=Ft[je]:mt=Ft,M.copy(Fe.viewport),D.copy(Fe.scissor),E=Fe.scissorTest}else M.copy(O).multiplyScalar(N).floor(),D.copy(B).multiplyScalar(N).floor(),E=_;if(Z.bindFramebuffer(ne.FRAMEBUFFER,mt)&&de.drawBuffers&&rt&&Z.drawBuffers(Fe,mt),Z.viewport(M),Z.scissor(D),Z.setScissorTest(E),Qe){const lt=xe.get(Fe.texture);ne.framebufferTexture2D(ne.FRAMEBUFFER,ne.COLOR_ATTACHMENT0,ne.TEXTURE_CUBE_MAP_POSITIVE_X+qe,lt.__webglTexture,je)}else if(Tt){const lt=xe.get(Fe.texture),zt=qe||0;ne.framebufferTextureLayer(ne.FRAMEBUFFER,ne.COLOR_ATTACHMENT0,lt.__webglTexture,je||0,zt)}S=-1},this.readRenderTargetPixels=function(Fe,qe,je,rt,mt,Qe,Tt){if(!(Fe&&Fe.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Dt=xe.get(Fe).__webglFramebuffer;if(Fe.isWebGLCubeRenderTarget&&Tt!==void 0&&(Dt=Dt[Tt]),Dt){Z.bindFramebuffer(ne.FRAMEBUFFER,Dt);try{const lt=Fe.texture,zt=lt.format,Ft=lt.type;if(zt!==Up&&Ke.convert(zt)!==ne.getParameter(ne.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const _t=Ft===jx&&(ge.has("EXT_color_buffer_half_float")||de.isWebGL2&&ge.has("EXT_color_buffer_float"));if(Ft!==P9&&Ke.convert(Ft)!==ne.getParameter(ne.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ft===v2&&(de.isWebGL2||ge.has("OES_texture_float")||ge.has("WEBGL_color_buffer_float")))&&!_t){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}qe>=0&&qe<=Fe.width-rt&&je>=0&&je<=Fe.height-mt&&ne.readPixels(qe,je,rt,mt,Ke.convert(zt),Ke.convert(Ft),Qe)}finally{const lt=x!==null?xe.get(x).__webglFramebuffer:null;Z.bindFramebuffer(ne.FRAMEBUFFER,lt)}}},this.copyFramebufferToTexture=function(Fe,qe,je=0){const rt=Math.pow(2,-je),mt=Math.floor(qe.image.width*rt),Qe=Math.floor(qe.image.height*rt);He.setTexture2D(qe,0),ne.copyTexSubImage2D(ne.TEXTURE_2D,je,0,0,Fe.x,Fe.y,mt,Qe),Z.unbindTexture()},this.copyTextureToTexture=function(Fe,qe,je,rt=0){const mt=qe.image.width,Qe=qe.image.height,Tt=Ke.convert(je.format),Dt=Ke.convert(je.type);He.setTexture2D(je,0),ne.pixelStorei(ne.UNPACK_FLIP_Y_WEBGL,je.flipY),ne.pixelStorei(ne.UNPACK_PREMULTIPLY_ALPHA_WEBGL,je.premultiplyAlpha),ne.pixelStorei(ne.UNPACK_ALIGNMENT,je.unpackAlignment),qe.isDataTexture?ne.texSubImage2D(ne.TEXTURE_2D,rt,Fe.x,Fe.y,mt,Qe,Tt,Dt,qe.image.data):qe.isCompressedTexture?ne.compressedTexSubImage2D(ne.TEXTURE_2D,rt,Fe.x,Fe.y,qe.mipmaps[0].width,qe.mipmaps[0].height,Tt,qe.mipmaps[0].data):ne.texSubImage2D(ne.TEXTURE_2D,rt,Fe.x,Fe.y,Tt,Dt,qe.image),rt===0&&je.generateMipmaps&&ne.generateMipmap(ne.TEXTURE_2D),Z.unbindTexture()},this.copyTextureToTexture3D=function(Fe,qe,je,rt,mt=0){if(P.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Qe=Fe.max.x-Fe.min.x+1,Tt=Fe.max.y-Fe.min.y+1,Dt=Fe.max.z-Fe.min.z+1,lt=Ke.convert(rt.format),zt=Ke.convert(rt.type);let Ft;if(rt.isData3DTexture)He.setTexture3D(rt,0),Ft=ne.TEXTURE_3D;else if(rt.isDataArrayTexture)He.setTexture2DArray(rt,0),Ft=ne.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ne.pixelStorei(ne.UNPACK_FLIP_Y_WEBGL,rt.flipY),ne.pixelStorei(ne.UNPACK_PREMULTIPLY_ALPHA_WEBGL,rt.premultiplyAlpha),ne.pixelStorei(ne.UNPACK_ALIGNMENT,rt.unpackAlignment);const _t=ne.getParameter(ne.UNPACK_ROW_LENGTH),tn=ne.getParameter(ne.UNPACK_IMAGE_HEIGHT),Qt=ne.getParameter(ne.UNPACK_SKIP_PIXELS),gn=ne.getParameter(ne.UNPACK_SKIP_ROWS),an=ne.getParameter(ne.UNPACK_SKIP_IMAGES),mn=je.isCompressedTexture?je.mipmaps[0]:je.image;ne.pixelStorei(ne.UNPACK_ROW_LENGTH,mn.width),ne.pixelStorei(ne.UNPACK_IMAGE_HEIGHT,mn.height),ne.pixelStorei(ne.UNPACK_SKIP_PIXELS,Fe.min.x),ne.pixelStorei(ne.UNPACK_SKIP_ROWS,Fe.min.y),ne.pixelStorei(ne.UNPACK_SKIP_IMAGES,Fe.min.z),je.isDataTexture||je.isData3DTexture?ne.texSubImage3D(Ft,mt,qe.x,qe.y,qe.z,Qe,Tt,Dt,lt,zt,mn.data):je.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ne.compressedTexSubImage3D(Ft,mt,qe.x,qe.y,qe.z,Qe,Tt,Dt,lt,mn.data)):ne.texSubImage3D(Ft,mt,qe.x,qe.y,qe.z,Qe,Tt,Dt,lt,zt,mn),ne.pixelStorei(ne.UNPACK_ROW_LENGTH,_t),ne.pixelStorei(ne.UNPACK_IMAGE_HEIGHT,tn),ne.pixelStorei(ne.UNPACK_SKIP_PIXELS,Qt),ne.pixelStorei(ne.UNPACK_SKIP_ROWS,gn),ne.pixelStorei(ne.UNPACK_SKIP_IMAGES,an),mt===0&&rt.generateMipmaps&&ne.generateMipmap(Ft),Z.unbindTexture()},this.initTexture=function(Fe){Fe.isCubeTexture?He.setTextureCube(Fe,0):Fe.isData3DTexture?He.setTexture3D(Fe,0):Fe.isDataArrayTexture||Fe.isCompressedArrayTexture?He.setTexture2DArray(Fe,0):He.setTexture2D(Fe,0),Z.unbindTexture()},this.resetState=function(){T=0,A=0,x=null,Z.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return g9}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=e===aq?"display-p3":"srgb",n.unpackColorSpace=cs.workingColorSpace===QL?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===ru?U8:z1e}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===U8?ru:L9}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class WNe extends j1e{}WNe.prototype.isWebGL1Renderer=!0;class fq{constructor(e,n=25e-5){this.isFogExp2=!0,this.name="",this.color=new rr(e),this.density=n}clone(){return new fq(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class hq{constructor(e,n=1,o=1e3){this.isFog=!0,this.name="",this.color=new rr(e),this.near=n,this.far=o}clone(){return new hq(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class oG extends Wl{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n}}class pq{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=DF,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Tg()}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,n,o){e*=this.stride,o*=n.stride;for(let r=0,i=this.stride;re.far||n.push({distance:s,point:wz.clone(),uv:ah.getInterpolation(wz,kB,xz,LB,K4e,Goe,q4e,new Xt),face:null,object:this})}copy(e,n){return super.copy(e,n),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function WB(t,e,n,o,r,i){wT.subVectors(t,n).addScalar(.5).multiply(o),r!==void 0?(vz.x=i*wT.x-r*wT.y,vz.y=r*wT.x+i*wT.y):vz.copy(wT),t.copy(e),t.x+=vz.x,t.y+=vz.y,t.applyMatrix4(NNe)}const NB=new ie,$4e=new ie;class UNe extends Wl{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 n=e.levels;for(let o=0,r=n.length;o0){let o,r;for(o=1,r=n.length;o0){NB.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(NB);this.getObjectForDistance(r).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){NB.setFromMatrixPosition(e.matrixWorld),$4e.setFromMatrixPosition(this.matrixWorld);const o=NB.distanceTo($4e)/e.zoom;n[0].object.visible=!0;let r,i;for(r=1,i=n.length;r=a)n[r-1].object.visible=!1,n[r].object.visible=!0;else break}for(this._currentLevel=r-1;rs)continue;f.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(f);Se.far||n.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:P,face:null,faceIndex:null,object:this})}}else{const b=Math.max(0,a.start),C=Math.min(w.count,a.start+a.count);for(let P=b,v=C-1;Ps)continue;f.applyMatrix4(this.matrixWorld);const A=e.ray.origin.distanceTo(f);Ae.far||n.push({distance:A,point:d.clone().applyMatrix4(this.matrixWorld),index:P,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,o=Object.keys(n);if(o.length>0){const r=n[o[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,a=r.length;i0){const r=n[o[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,a=r.length;ir.far)return;i.push({distance:c,distanceToRay:Math.sqrt(l),point:s,index:e,face:null,object:a})}}class Y5t extends Vc{constructor(e,n,o,r,i,a,l,s,c){super(e,n,o,r,i,a,l,s,c),this.isVideoTexture=!0,this.minFilter=a!==void 0?a:Gs,this.magFilter=i!==void 0?i:Gs,this.generateMipmaps=!1;const u=this;function d(){u.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class O5t extends Vc{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=k0,this.minFilter=k0,this.generateMipmaps=!1,this.needsUpdate=!0}}class yq extends Vc{constructor(e,n,o,r,i,a,l,s,c,u,d,f){super(null,a,l,s,c,u,r,i,d,f),this.isCompressedTexture=!0,this.image={width:n,height:o},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class _5t extends yq{constructor(e,n,o,r,i,a){super(e,n,o,i,a),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=dh}}class V5t extends yq{constructor(e,n,o){super(void 0,e[0].width,e[0].height,n,o,K6),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class XP extends Vc{constructor(e,n,o,r,i,a,l,s,c){super(e,n,o,r,i,a,l,s,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}let Q2=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,n){const o=this.getUtoTmapping(e);return this.getPoint(o,n)}getPoints(e=5){const n=[];for(let o=0;o<=e;o++)n.push(this.getPoint(o/e));return n}getSpacedPoints(e=5){const n=[];for(let o=0;o<=e;o++)n.push(this.getPointAt(o/e));return n}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 n=[];let o,r=this.getPoint(0),i=0;n.push(0);for(let a=1;a<=e;a++)o=this.getPoint(a/e),i+=o.distanceTo(r),n.push(i),r=o;return this.cacheArcLengths=n,n}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,n){const o=this.getLengths();let r=0;const i=o.length;let a;n?a=n:a=e*o[i-1];let l=0,s=i-1,c;for(;l<=s;)if(r=Math.floor(l+(s-l)/2),c=o[r]-a,c<0)l=r+1;else if(c>0)s=r-1;else{s=r;break}if(r=s,o[r]===a)return r/(i-1);const u=o[r],f=o[r+1]-u,p=(a-u)/f;return(r+p)/(i-1)}getTangent(e,n){let r=e-1e-4,i=e+1e-4;r<0&&(r=0),i>1&&(i=1);const a=this.getPoint(r),l=this.getPoint(i),s=n||(a.isVector2?new Xt:new ie);return s.copy(l).sub(a).normalize(),s}getTangentAt(e,n){const o=this.getUtoTmapping(e);return this.getTangent(o,n)}computeFrenetFrames(e,n){const o=new ie,r=[],i=[],a=[],l=new ie,s=new Ji;for(let p=0;p<=e;p++){const g=p/e;r[p]=this.getTangentAt(g,new ie)}i[0]=new ie,a[0]=new ie;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),d=Math.abs(r[0].y),f=Math.abs(r[0].z);u<=c&&(c=u,o.set(1,0,0)),d<=c&&(c=d,o.set(0,1,0)),f<=c&&o.set(0,0,1),l.crossVectors(r[0],o).normalize(),i[0].crossVectors(r[0],l),a[0].crossVectors(r[0],i[0]);for(let p=1;p<=e;p++){if(i[p]=i[p-1].clone(),a[p]=a[p-1].clone(),l.crossVectors(r[p-1],r[p]),l.length()>Number.EPSILON){l.normalize();const g=Math.acos(h0(r[p-1].dot(r[p]),-1,1));i[p].applyMatrix4(s.makeRotationAxis(l,g))}a[p].crossVectors(r[p],i[p])}if(n===!0){let p=Math.acos(h0(i[0].dot(i[e]),-1,1));p/=e,r[0].dot(l.crossVectors(i[0],i[e]))>0&&(p=-p);for(let g=1;g<=e;g++)i[g].applyMatrix4(s.makeRotationAxis(r[g],p*g)),a[g].crossVectors(r[g],i[g])}return{tangents:r,normals:i,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}};class D2 extends Q2{constructor(e=0,n=0,o=1,r=1,i=0,a=Math.PI*2,l=!1,s=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=n,this.xRadius=o,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=l,this.aRotation=s}getPoint(e,n){const o=n||new Xt,r=Math.PI*2;let i=this.aEndAngle-this.aStartAngle;const a=Math.abs(i)r;)i-=r;i0?0:(Math.floor(Math.abs(l)/i)+1)*i:s===0&&l===i-1&&(l=i-2,s=1);let c,u;this.closed||l>0?c=r[(l-1)%i]:(_B.subVectors(r[0],r[1]).add(r[0]),c=_B);const d=r[l%i],f=r[(l+1)%i];if(this.closed||l+2r.length-2?r.length-1:a+1],d=r[a>r.length-3?r.length-1:a+2];return o.set(h8e(l,s.x,c.x,u.x,d.x),h8e(l,s.y,c.y,u.y,d.y)),o}copy(e){super.copy(e),this.points=[];for(let n=0,o=e.points.length;n=o){const a=r[i]-o,l=this.curves[i],s=l.getLength(),c=s===0?0:1-a/s;return l.getPointAt(c,n)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let n=0;for(let o=0,r=this.curves.length;o1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,o=e.curves.length;n0){const d=c.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}};class nW extends Ni{constructor(e=[new Xt(0,-.5),new Xt(.5,0),new Xt(0,.5)],n=12,o=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:n,phiStart:o,phiLength:r},n=Math.floor(n),r=h0(r,0,Math.PI*2);const i=[],a=[],l=[],s=[],c=[],u=1/n,d=new ie,f=new Xt,p=new ie,g=new ie,y=new ie;let w=0,b=0;for(let C=0;C<=e.length-1;C++)switch(C){case 0:w=e[C+1].x-e[C].x,b=e[C+1].y-e[C].y,p.x=b*1,p.y=-w,p.z=b*0,y.copy(p),p.normalize(),s.push(p.x,p.y,p.z);break;case e.length-1:s.push(y.x,y.y,y.z);break;default:w=e[C+1].x-e[C].x,b=e[C+1].y-e[C].y,p.x=b*1,p.y=-w,p.z=b*0,g.copy(p),p.x+=y.x,p.y+=y.y,p.z+=y.z,p.normalize(),s.push(p.x,p.y,p.z),y.copy(g)}for(let C=0;C<=n;C++){const P=o+C*u*r,v=Math.sin(P),T=Math.cos(P);for(let A=0;A<=e.length-1;A++){d.x=e[A].x*v,d.y=e[A].y,d.z=e[A].x*T,a.push(d.x,d.y,d.z),f.x=C/n,f.y=A/(e.length-1),l.push(f.x,f.y);const x=s[3*A+0]*v,S=s[3*A+1],R=s[3*A+0]*T;c.push(x,S,R)}}for(let C=0;C0&&P(!0),n>0&&P(!1)),this.setIndex(u),this.setAttribute("position",new gr(d,3)),this.setAttribute("normal",new gr(f,3)),this.setAttribute("uv",new gr(p,2));function C(){const v=new ie,T=new ie;let A=0;const x=(n-e)/o;for(let S=0;S<=i;S++){const R=[],M=S/i,D=M*(n-e)+e;for(let E=0;E<=r;E++){const W=E/r,j=W*s+l,L=Math.sin(j),k=Math.cos(j);T.x=D*L,T.y=-M*o+w,T.z=D*k,d.push(T.x,T.y,T.z),v.set(L,x,k).normalize(),f.push(v.x,v.y,v.z),p.push(W,1-M),R.push(g++)}y.push(R)}for(let S=0;S.9&&x<.1&&(P<.2&&(a[C+0]+=1),v<.2&&(a[C+2]+=1),T<.2&&(a[C+4]+=1))}}function f(C){i.push(C.x,C.y,C.z)}function p(C,P){const v=C*3;P.x=e[v+0],P.y=e[v+1],P.z=e[v+2]}function g(){const C=new ie,P=new ie,v=new ie,T=new ie,A=new Xt,x=new Xt,S=new Xt;for(let R=0,M=0;R80*n){l=c=t[0],s=u=t[1];for(let g=n;gc&&(c=d),f>u&&(u=f);p=Math.max(c-l,u-s),p=p!==0?32767/p:0}return WF(i,a,n,l,s,p,0),a}};function KNe(t,e,n,o,r){let i,a;if(r===g9t(t,e,n,o)>0)for(i=e;i=e;i-=o)a=p8e(i,t[i],t[i+1],a);return a&&Tq(a,a.next)&&(UF(a),a=a.next),a}function Ox(t,e){if(!t)return t;e||(e=t);let n=t,o;do if(o=!1,!n.steiner&&(Tq(n,n.next)||o0(n.prev,n,n.next)===0)){if(UF(n),n=e=n.prev,n===n.next)break;o=!0}else n=n.next;while(o||n!==e);return e}function WF(t,e,n,o,r,i,a){if(!t)return;!a&&i&&c9t(t,o,r,i);let l=t,s,c;for(;t.prev!==t.next;){if(s=t.prev,c=t.next,i?t9t(t,o,r,i):e9t(t)){e.push(s.i/n|0),e.push(t.i/n|0),e.push(c.i/n|0),UF(t),t=c.next,l=c.next;continue}if(t=c,t===l){a?a===1?(t=n9t(Ox(t),e,n),WF(t,e,n,o,r,i,2)):a===2&&o9t(t,e,n,o,r,i):WF(Ox(t),e,n,o,r,i,1);break}}}function e9t(t){const e=t.prev,n=t,o=t.next;if(o0(e,n,o)>=0)return!1;const r=e.x,i=n.x,a=o.x,l=e.y,s=n.y,c=o.y,u=ri?r>a?r:a:i>a?i:a,p=l>s?l>c?l:c:s>c?s:c;let g=o.next;for(;g!==e;){if(g.x>=u&&g.x<=f&&g.y>=d&&g.y<=p&&JP(r,l,i,s,a,c,g.x,g.y)&&o0(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function t9t(t,e,n,o){const r=t.prev,i=t,a=t.next;if(o0(r,i,a)>=0)return!1;const l=r.x,s=i.x,c=a.x,u=r.y,d=i.y,f=a.y,p=ls?l>c?l:c:s>c?s:c,w=u>d?u>f?u:f:d>f?d:f,b=bce(p,g,e,n,o),C=bce(y,w,e,n,o);let P=t.prevZ,v=t.nextZ;for(;P&&P.z>=b&&v&&v.z<=C;){if(P.x>=p&&P.x<=y&&P.y>=g&&P.y<=w&&P!==r&&P!==a&&JP(l,u,s,d,c,f,P.x,P.y)&&o0(P.prev,P,P.next)>=0||(P=P.prevZ,v.x>=p&&v.x<=y&&v.y>=g&&v.y<=w&&v!==r&&v!==a&&JP(l,u,s,d,c,f,v.x,v.y)&&o0(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;P&&P.z>=b;){if(P.x>=p&&P.x<=y&&P.y>=g&&P.y<=w&&P!==r&&P!==a&&JP(l,u,s,d,c,f,P.x,P.y)&&o0(P.prev,P,P.next)>=0)return!1;P=P.prevZ}for(;v&&v.z<=C;){if(v.x>=p&&v.x<=y&&v.y>=g&&v.y<=w&&v!==r&&v!==a&&JP(l,u,s,d,c,f,v.x,v.y)&&o0(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function n9t(t,e,n){let o=t;do{const r=o.prev,i=o.next.next;!Tq(r,i)&&qNe(r,o,o.next,i)&&NF(r,i)&&NF(i,r)&&(e.push(r.i/n|0),e.push(o.i/n|0),e.push(i.i/n|0),UF(o),UF(o.next),o=t=i),o=o.next}while(o!==t);return Ox(o)}function o9t(t,e,n,o,r,i){let a=t;do{let l=a.next.next;for(;l!==a.prev;){if(a.i!==l.i&&f9t(a,l)){let s=$Ne(a,l);a=Ox(a,a.next),s=Ox(s,s.next),WF(a,e,n,o,r,i,0),WF(s,e,n,o,r,i,0);return}l=l.next}a=a.next}while(a!==t)}function r9t(t,e,n,o){const r=[];let i,a,l,s,c;for(i=0,a=e.length;i=n.next.y&&n.next.y!==n.y){const f=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(f<=i&&f>o&&(o=f,r=n.x=n.x&&n.x>=s&&i!==n.x&&JP(ar.x||n.x===r.x&&s9t(r,n)))&&(r=n,u=d)),n=n.next;while(n!==l);return r}function s9t(t,e){return o0(t.prev,t,e.prev)<0&&o0(e.next,t,t.next)<0}function c9t(t,e,n,o){let r=t;do r.z===0&&(r.z=bce(r.x,r.y,e,n,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,u9t(r)}function u9t(t){let e,n,o,r,i,a,l,s,c=1;do{for(n=t,t=null,i=null,a=0;n;){for(a++,o=n,l=0,e=0;e0||s>0&&o;)l!==0&&(s===0||!o||n.z<=o.z)?(r=n,n=n.nextZ,l--):(r=o,o=o.nextZ,s--),i?i.nextZ=r:t=r,r.prevZ=i,i=r;n=o}i.nextZ=null,c*=2}while(a>1);return t}function bce(t,e,n,o,r){return t=(t-n)*r|0,e=(e-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function d9t(t){let e=t,n=t;do(e.x=(t-a)*(i-l)&&(t-a)*(o-l)>=(n-a)*(e-l)&&(n-a)*(i-l)>=(r-a)*(o-l)}function f9t(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!h9t(t,e)&&(NF(t,e)&&NF(e,t)&&p9t(t,e)&&(o0(t.prev,t,e.prev)||o0(t,e.prev,e))||Tq(t,e)&&o0(t.prev,t,t.next)>0&&o0(e.prev,e,e.next)>0)}function o0(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Tq(t,e){return t.x===e.x&&t.y===e.y}function qNe(t,e,n,o){const r=KB(o0(t,e,n)),i=KB(o0(t,e,o)),a=KB(o0(n,o,t)),l=KB(o0(n,o,e));return!!(r!==i&&a!==l||r===0&&JB(t,n,e)||i===0&&JB(t,o,e)||a===0&&JB(n,t,o)||l===0&&JB(n,e,o))}function JB(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function KB(t){return t>0?1:t<0?-1:0}function h9t(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&qNe(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function NF(t,e){return o0(t.prev,t,t.next)<0?o0(t,e,t.next)>=0&&o0(t,t.prev,e)>=0:o0(t,e,t.prev)<0||o0(t,t.next,e)<0}function p9t(t,e){let n=t,o=!1;const r=(t.x+e.x)/2,i=(t.y+e.y)/2;do n.y>i!=n.next.y>i&&n.next.y!==n.y&&r<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(o=!o),n=n.next;while(n!==t);return o}function $Ne(t,e){const n=new Sce(t.i,t.x,t.y),o=new Sce(e.i,e.x,e.y),r=t.next,i=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,o.next=n,n.prev=o,i.next=o,o.prev=i,o}function p8e(t,e,n,o){const r=new Sce(t,e,n);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function UF(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Sce(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function g9t(t,e,n,o){let r=0;for(let i=e,a=n-o;i2&&t[e-1].equals(t[0])&&t.pop()}function m8e(t,e){for(let n=0;nNumber.EPSILON){const ce=Math.sqrt(Ie),pe=Math.sqrt(Se*Se+ze*ze),ve=fe.x-He/ce,Ae=fe.y+xe/ce,Te=ge.x-ze/pe,Me=ge.y+Se/pe,Pe=((Te-ve)*ze-(Me-Ae)*Se)/(xe*ze-He*Se);de=ve+xe*Pe-ne.x,Z=Ae+He*Pe-ne.y;const Ee=de*de+Z*Z;if(Ee<=2)return new Xt(de,Z);he=Math.sqrt(Ee/2)}else{let ce=!1;xe>Number.EPSILON?Se>Number.EPSILON&&(ce=!0):xe<-Number.EPSILON?Se<-Number.EPSILON&&(ce=!0):Math.sign(He)===Math.sign(ze)&&(ce=!0),ce?(de=-He,Z=xe,he=Math.sqrt(Ie)):(de=xe,Z=He,he=Math.sqrt(Ie/2))}return new Xt(de/he,Z/he)}const U=[];for(let ne=0,fe=j.length,ge=fe-1,de=ne+1;ne=0;ne--){const fe=ne/w,ge=p*Math.cos(fe*Math.PI/2),de=g*Math.sin(fe*Math.PI/2)+y;for(let Z=0,he=j.length;Z=0;){const de=ge;let Z=ge-1;Z<0&&(Z=ne.length-1);for(let he=0,xe=u+w*2;he0)&&p.push(P,v,A),(b!==o-1||s0!=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}}class q1e extends Pf{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new rr(16777215),this.specular=new rr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cw,this.normalScale=new Xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$L,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 tUe extends Pf{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new rr(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cw,this.normalScale=new Xt(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 nUe extends Pf{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cw,this.normalScale=new Xt(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 oUe extends Pf{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new rr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cw,this.normalScale=new Xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$L,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.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 rUe extends Pf{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new rr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Cw,this.normalScale=new Xt(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 iUe extends pp{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 Dv(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function aUe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function lUe(t){function e(r,i){return t[r]-t[i]}const n=t.length,o=new Array(n);for(let r=0;r!==n;++r)o[r]=r;return o.sort(e),o}function Tce(t,e,n){const o=t.length,r=new t.constructor(o);for(let i=0,a=0;a!==o;++i){const l=n[i]*e;for(let s=0;s!==e;++s)r[a++]=t[l+s]}return r}function $1e(t,e,n,o){let r=1,i=t[0];for(;i!==void 0&&i[o]===void 0;)i=t[r++];if(i===void 0)return;let a=i[o];if(a!==void 0)if(Array.isArray(a))do a=i[o],a!==void 0&&(e.push(i.time),n.push.apply(n,a)),i=t[r++];while(i!==void 0);else if(a.toArray!==void 0)do a=i[o],a!==void 0&&(e.push(i.time),a.toArray(n,n.length)),i=t[r++];while(i!==void 0);else do a=i[o],a!==void 0&&(e.push(i.time),n.push(a)),i=t[r++];while(i!==void 0)}function w9t(t,e,n,o,r=30){const i=t.clone();i.name=e;const a=[];for(let s=0;s=o)){d.push(c.times[p]);for(let y=0;yi.tracks[s].times[0]&&(l=i.tracks[s].times[0]);for(let s=0;s=l.times[g]){const b=g*d+u,C=b+d-u;y=l.values.slice(b,C)}else{const b=l.createInterpolant(),C=u,P=d-u;b.evaluate(i),y=b.resultBuffer.slice(C,P)}s==="quaternion"&&new bs().fromArray(y).normalize().conjugate().toArray(y);const w=c.times.length;for(let b=0;b=i)){const l=n[1];e=i)break t}a=o,o=0;break n}break e}for(;o>>1;en;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);const l=this.getValueSize();this.times=o.slice(i,a),this.values=this.values.slice(i*l,a*l)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const o=this.times,r=this.values,i=o.length;i===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let l=0;l!==i;l++){const s=o[l];if(typeof s=="number"&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,s),e=!1;break}if(a!==null&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,s,a),e=!1;break}a=s}if(r!==void 0&&aUe(r))for(let l=0,s=r.length;l!==s;++l){const c=r[l];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),o=this.getValueSize(),r=this.getInterpolation()===I_,i=e.length-1;let a=1;for(let l=1;l0){e[a]=e[i];for(let l=i*o,s=a*o,c=0;c!==o;++c)n[s+c]=n[l+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=n.slice(0,a*o)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),o=this.constructor,r=new o(this.name,e,n);return r.createInterpolant=this.createInterpolant,r}}Z2.prototype.TimeBufferType=Float32Array;Z2.prototype.ValueBufferType=Float32Array;Z2.prototype.DefaultInterpolation=RF;class Ab extends Z2{}Ab.prototype.ValueTypeName="bool";Ab.prototype.ValueBufferType=Array;Ab.prototype.DefaultInterpolation=CF;Ab.prototype.InterpolantFactoryMethodLinear=void 0;Ab.prototype.InterpolantFactoryMethodSmooth=void 0;class Z1e extends Z2{}Z1e.prototype.ValueTypeName="color";class jF extends Z2{}jF.prototype.ValueTypeName="number";class uUe extends iW{constructor(e,n,o,r){super(e,n,o,r)}interpolate_(e,n,o,r){const i=this.resultBuffer,a=this.sampleValues,l=this.valueSize,s=(o-n)/(r-n);let c=e*l;for(let u=c+l;c!==u;c+=4)bs.slerpFlat(i,0,a,c-l,a,c,s);return i}}class MH extends Z2{InterpolantFactoryMethodLinear(e){return new uUe(this.times,this.values,this.getValueSize(),e)}}MH.prototype.ValueTypeName="quaternion";MH.prototype.DefaultInterpolation=RF;MH.prototype.InterpolantFactoryMethodSmooth=void 0;class wb extends Z2{}wb.prototype.ValueTypeName="string";wb.prototype.ValueBufferType=Array;wb.prototype.DefaultInterpolation=CF;wb.prototype.InterpolantFactoryMethodLinear=void 0;wb.prototype.InterpolantFactoryMethodSmooth=void 0;class BF extends Z2{}BF.prototype.ValueTypeName="vector";class YF{constructor(e,n=-1,o,r=iq){this.name=e,this.tracks=o,this.duration=n,this.blendMode=r,this.uuid=Tg(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],o=e.tracks,r=1/(e.fps||1);for(let a=0,l=o.length;a!==l;++a)n.push(S9t(o[a]).scale(r));const i=new this(e.name,e.duration,n,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const n=[],o=e.tracks,r={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let i=0,a=o.length;i!==a;++i)n.push(Z2.toJSON(o[i]));return r}static CreateFromMorphTargetSequence(e,n,o,r){const i=n.length,a=[];for(let l=0;l1){const d=u[1];let f=r[d];f||(r[d]=f=[]),f.push(c)}}const a=[];for(const l in r)a.push(this.CreateFromMorphTargetSequence(l,r[l],n,o));return a}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const o=function(d,f,p,g,y){if(p.length!==0){const w=[],b=[];$1e(p,w,b,g),w.length!==0&&y.push(new d(f,w,b))}},r=[],i=e.name||"default",a=e.fps||30,l=e.blendMode;let s=e.length||-1;const c=e.hierarchy||[];for(let d=0;d{n&&n(i),this.manager.itemEnd(e)},0),i;if(n6[e]!==void 0){n6[e].push({onLoad:n,onProgress:o,onError:r});return}n6[e]=[],n6[e].push({onLoad:n,onProgress:o,onError:r});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),l=this.mimeType,s=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=n6[e],d=c.body.getReader(),f=c.headers.get("Content-Length")||c.headers.get("X-File-Size"),p=f?parseInt(f):0,g=p!==0;let y=0;const w=new ReadableStream({start(b){C();function C(){d.read().then(({done:P,value:v})=>{if(P)b.close();else{y+=v.byteLength;const T=new ProgressEvent("progress",{lengthComputable:g,loaded:y,total:p});for(let A=0,x=u.length;A{switch(s){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,l));case"json":return c.json();default:if(l===void 0)return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(l),f=d&&d[1]?d[1].toLowerCase():void 0,p=new TextDecoder(f);return c.arrayBuffer().then(g=>p.decode(g))}}}).then(c=>{_x.add(e,c);const u=n6[e];delete n6[e];for(let d=0,f=u.length;d{const u=n6[e];if(u===void 0)throw this.manager.itemError(e),c;delete n6[e];for(let d=0,f=u.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class P9t extends gp{constructor(e){super(e)}load(e,n,o,r){const i=this,a=new N9(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){try{n(i.parse(JSON.parse(l)))}catch(s){r?r(s):console.error(s),i.manager.itemError(e)}},o,r)}parse(e){const n=[];for(let o=0;o0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const i in e.uniforms){const a=e.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=o(a.value);break;case"c":r.uniforms[i].value=new rr().setHex(a.value);break;case"v2":r.uniforms[i].value=new Xt().fromArray(a.value);break;case"v3":r.uniforms[i].value=new ie().fromArray(a.value);break;case"v4":r.uniforms[i].value=new Qa().fromArray(a.value);break;case"m3":r.uniforms[i].value=new ga().fromArray(a.value);break;case"m4":r.uniforms[i].value=new Ji().fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const i in e.extensions)r.extensions[i]=e.extensions[i];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=o(e.map)),e.matcap!==void 0&&(r.matcap=o(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=o(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=o(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=o(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let i=e.normalScale;Array.isArray(i)===!1&&(i=[i,i]),r.normalScale=new Xt().fromArray(i)}return e.displacementMap!==void 0&&(r.displacementMap=o(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=o(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=o(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=o(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=o(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=o(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=o(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=o(e.envMap)),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=o(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=o(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=o(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=o(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=o(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=o(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Xt().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=o(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=o(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=o(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=o(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=o(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=o(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=o(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const n={ShadowMaterial:QNe,SpriteMaterial:gq,RawShaderMaterial:ZNe,ShaderMaterial:_2,PointsMaterial:O1e,MeshPhysicalMaterial:eUe,MeshStandardMaterial:mf,MeshPhongMaterial:q1e,MeshToonMaterial:tUe,MeshNormalMaterial:nUe,MeshLambertMaterial:oUe,MeshDepthMaterial:uq,MeshDistanceMaterial:dq,MeshBasicMaterial:e3,MeshMatcapMaterial:rUe,LineDashedMaterial:iUe,LineBasicMaterial:pp,Material:Pf};return new n[e]}}class Pce{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";for(let o=0,r=e.length;o0){const s=new ege(n);i=new OF(s),i.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){r=new OF(this.manager),r.setCrossOrigin(this.crossOrigin);for(let a=0,l=e.length;a"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,n,o,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,a=_x.get(e);if(a!==void 0)return i.manager.itemStart(e),setTimeout(function(){n&&n(a),i.manager.itemEnd(e)},0),a;const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader,fetch(e,l).then(function(s){return s.blob()}).then(function(s){return createImageBitmap(s,Object.assign(i.options,{colorSpaceConversion:"none"}))}).then(function(s){_x.add(e,s),n&&n(s),i.manager.itemEnd(e)}).catch(function(s){r&&r(s),i.manager.itemError(e),i.manager.itemEnd(e)}),i.manager.itemStart(e)}}let qB;class nge{static getContext(){return qB===void 0&&(qB=new(window.AudioContext||window.webkitAudioContext)),qB}static setContext(e){qB=e}}class k9t extends gp{constructor(e){super(e)}load(e,n,o,r){const i=this,a=new N9(this.manager);a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(s){try{const c=s.slice(0);nge.getContext().decodeAudioData(c,function(d){n(d)},l)}catch(c){l(c)}},o,r);function l(s){r?r(s):console.error(s),i.manager.itemError(e)}}}const T8e=new Ji,P8e=new Ji,W7=new Ji;class L9t{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new zu,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new zu,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 n=this._cache;if(n.focus!==e.focus||n.fov!==e.fov||n.aspect!==e.aspect*this.aspect||n.near!==e.near||n.far!==e.far||n.zoom!==e.zoom||n.eyeSep!==this.eyeSep){n.focus=e.focus,n.fov=e.fov,n.aspect=e.aspect*this.aspect,n.near=e.near,n.far=e.far,n.zoom=e.zoom,n.eyeSep=this.eyeSep,W7.copy(e.projectionMatrix);const r=n.eyeSep/2,i=r*n.near/n.focus,a=n.near*Math.tan(ax*n.fov*.5)/n.zoom;let l,s;P8e.elements[12]=-r,T8e.elements[12]=r,l=-a*n.aspect+i,s=a*n.aspect+i,W7.elements[0]=2*n.near/(s-l),W7.elements[8]=(s+l)/(s-l),this.cameraL.projectionMatrix.copy(W7),l=-a*n.aspect-i,s=a*n.aspect-i,W7.elements[0]=2*n.near/(s-l),W7.elements[8]=(s+l)/(s-l),this.cameraR.projectionMatrix.copy(W7)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(P8e),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(T8e)}}class oge{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=C8e(),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 n=C8e();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}function C8e(){return(typeof performance>"u"?Date:performance).now()}const N7=new ie,R8e=new bs,W9t=new ie,U7=new ie;class N9t extends Wl{constructor(){super(),this.type="AudioListener",this.context=nge.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new oge}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 n=this.context.listener,o=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(N7,R8e,W9t),U7.set(0,0,-1).applyQuaternion(R8e),n.positionX){const r=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(N7.x,r),n.positionY.linearRampToValueAtTime(N7.y,r),n.positionZ.linearRampToValueAtTime(N7.z,r),n.forwardX.linearRampToValueAtTime(U7.x,r),n.forwardY.linearRampToValueAtTime(U7.y,r),n.forwardZ.linearRampToValueAtTime(U7.z,r),n.upX.linearRampToValueAtTime(o.x,r),n.upY.linearRampToValueAtTime(o.y,r),n.upZ.linearRampToValueAtTime(o.z,r)}else n.setPosition(N7.x,N7.y,N7.z),n.setOrientation(U7.x,U7.y,U7.z,o.x,o.y,o.z)}}class xUe extends Wl{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 n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=n,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!==null&&(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,n=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,n=this.filters.length;e0&&this._mixBufferRegionAdditive(o,r,this._addIndex*n,1,n);for(let s=n,c=n+n;s!==c;++s)if(o[s]!==o[s+n]){l.setValue(o,r);break}}saveOriginalState(){const e=this.binding,n=this.buffer,o=this.valueSize,r=o*this._origIndex;e.getValue(n,r);for(let i=o,a=r;i!==a;++i)n[i]=n[r+i%o];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,n=e+this.valueSize;for(let o=e;o=.5)for(let a=0;a!==i;++a)e[n+a]=e[o+a]}_slerp(e,n,o,r){bs.slerpFlat(e,n,e,n,e,o,r)}_slerpAdditive(e,n,o,r,i){const a=this._workIndex*i;bs.multiplyQuaternionsFlat(e,a,e,n,e,o),bs.slerpFlat(e,n,e,n,e,a,r)}_lerp(e,n,o,r,i){const a=1-r;for(let l=0;l!==i;++l){const s=n+l;e[s]=e[s]*a+e[o+l]*r}}_lerpAdditive(e,n,o,r,i){for(let a=0;a!==i;++a){const l=n+a;e[l]=e[l]+e[o+a]*r}}}const rge="\\[\\]\\.:\\/",Y9t=new RegExp("["+rge+"]","g"),ige="[^"+rge+"]",O9t="[^"+rge.replace("\\.","")+"]",_9t=/((?:WC+[\/:])*)/.source.replace("WC",ige),V9t=/(WCOD+)?/.source.replace("WCOD",O9t),G9t=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",ige),X9t=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",ige),J9t=new RegExp("^"+_9t+V9t+G9t+X9t+"$"),K9t=["material","materials","bones","map"];class q9t{constructor(e,n,o){const r=o||Cl.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,r)}getValue(e,n){this.bind();const o=this._targetGroup.nCachedObjects_,r=this._bindings[o];r!==void 0&&r.getValue(e,n)}setValue(e,n){const o=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=o.length;r!==i;++r)o[r].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,o=e.length;n!==o;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,o=e.length;n!==o;++n)e[n].unbind()}}class Cl{constructor(e,n,o){this.path=n,this.parsedPath=o||Cl.parseTrackName(n),this.node=Cl.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,o){return e&&e.isAnimationObjectGroup?new Cl.Composite(e,n,o):new Cl(e,n,o)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Y9t,"")}static parseTrackName(e){const n=J9t.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const o={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},r=o.nodeName&&o.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const i=o.nodeName.substring(r+1);K9t.indexOf(i)!==-1&&(o.nodeName=o.nodeName.substring(0,r),o.objectName=i)}if(o.propertyName===null||o.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return o}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const o=e.skeleton.getBoneByName(n);if(o!==void 0)return o}if(e.children){const o=function(i){for(let a=0;a=i){const d=i++,f=e[d];n[f.uuid]=u,e[u]=f,n[c]=d,e[d]=s;for(let p=0,g=r;p!==g;++p){const y=o[p],w=y[d],b=y[u];y[u]=w,y[d]=b}}}this.nCachedObjects_=i}uncache(){const e=this._objects,n=this._indicesByUUID,o=this._bindings,r=o.length;let i=this.nCachedObjects_,a=e.length;for(let l=0,s=arguments.length;l!==s;++l){const c=arguments[l],u=c.uuid,d=n[u];if(d!==void 0)if(delete n[u],d0&&(n[p.uuid]=d),e[d]=p,e.pop();for(let g=0,y=r;g!==y;++g){const w=o[g];w[d]=w[f],w.pop()}}}this.nCachedObjects_=i}subscribe_(e,n){const o=this._bindingsIndicesByPath;let r=o[e];const i=this._bindings;if(r!==void 0)return i[r];const a=this._paths,l=this._parsedPaths,s=this._objects,c=s.length,u=this.nCachedObjects_,d=new Array(c);r=i.length,o[e]=r,a.push(e),l.push(n),i.push(d);for(let f=u,p=s.length;f!==p;++f){const g=s[f];d[f]=new Cl(g,e,n)}return d}unsubscribe_(e){const n=this._bindingsIndicesByPath,o=n[e];if(o!==void 0){const r=this._paths,i=this._parsedPaths,a=this._bindings,l=a.length-1,s=a[l],c=e[l];n[c]=o,a[o]=s,a.pop(),i[o]=i[l],i.pop(),r[o]=r[l],r.pop()}}}class SUe{constructor(e,n,o=null,r=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=o,this.blendMode=r;const i=n.tracks,a=i.length,l=new Array(a),s={endingStart:Mv,endingEnd:Mv};for(let c=0;c!==a;++c){const u=i[c].createInterpolant(null);l[c]=u,u.settings=s}this._interpolantSettings=s,this._interpolants=l,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=cNe,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,n){return this.loop=e,this.repetitions=n,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,n,o){if(e.fadeOut(n),this.fadeIn(n),o){const r=this._clip.duration,i=e._clip.duration,a=i/r,l=r/i;e.warp(1,a,n),this.warp(l,1,n)}return this}crossFadeTo(e,n,o){return e.crossFadeFrom(this,n,o)}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,n,o){const r=this._mixer,i=r.time,a=this.timeScale;let l=this._timeScaleInterpolant;l===null&&(l=r._lendControlInterpolant(),this._timeScaleInterpolant=l);const s=l.parameterPositions,c=l.sampleValues;return s[0]=i,s[1]=i+o,c[0]=e/a,c[1]=n/a,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,n,o,r){if(!this.enabled){this._updateWeight(e);return}const i=this._startTime;if(i!==null){const s=(e-i)*o;s<0||o===0?n=0:(this._startTime=null,n=o*s)}n*=this._updateTimeScale(e);const a=this._updateTime(n),l=this._updateWeight(e);if(l>0){const s=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case I1e:for(let u=0,d=s.length;u!==d;++u)s[u].evaluate(a),c[u].accumulateAdditive(l);break;case iq:default:for(let u=0,d=s.length;u!==d;++u)s[u].evaluate(a),c[u].accumulate(r,l)}}}_updateWeight(e){let n=0;if(this.enabled){n=this.weight;const o=this._weightInterpolant;if(o!==null){const r=o.evaluate(e)[0];n*=r,e>o.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=n,n}_updateTimeScale(e){let n=0;if(!this.paused){n=this.timeScale;const o=this._timeScaleInterpolant;if(o!==null){const r=o.evaluate(e)[0];n*=r,e>o.parameterPositions[1]&&(this.stopWarping(),n===0?this.paused=!0:this.timeScale=n)}}return this._effectiveTimeScale=n,n}_updateTime(e){const n=this._clip.duration,o=this.loop;let r=this.time+e,i=this._loopCount;const a=o===uNe;if(e===0)return i===-1?r:a&&(i&1)===1?n-r:r;if(o===sNe){i===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=n)r=n;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(i===-1&&(e>=0?(i=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),r>=n||r<0){const l=Math.floor(r/n);r-=n*l,i+=Math.abs(l);const s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?n:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(s===1){const c=e<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:l})}}else this.time=r;if(a&&(i&1)===1)return n-r}return r}_setEndings(e,n,o){const r=this._interpolantSettings;o?(r.endingStart=Iv,r.endingEnd=Iv):(e?r.endingStart=this.zeroSlopeAtStart?Iv:Mv:r.endingStart=HF,n?r.endingEnd=this.zeroSlopeAtEnd?Iv:Mv:r.endingEnd=HF)}_scheduleFading(e,n,o){const r=this._mixer,i=r.time;let a=this._weightInterpolant;a===null&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);const l=a.parameterPositions,s=a.sampleValues;return l[0]=i,s[0]=n,l[1]=i+e,s[1]=o,this}}const Q9t=new Float32Array(1);class Z9t extends Z9{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,n){const o=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,l=e._interpolants,s=o.uuid,c=this._bindingsByRootAndName;let u=c[s];u===void 0&&(u={},c[s]=u);for(let d=0;d!==i;++d){const f=r[d],p=f.name;let g=u[p];if(g!==void 0)++g.referenceCount,a[d]=g;else{if(g=a[d],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,s,p));continue}const y=n&&n._propertyBindings[d].binding.parsedPath;g=new bUe(Cl.create(o,p,y),f.ValueTypeName,f.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,s,p),a[d]=g}l[d].resultBuffer=g.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const o=(e._localRoot||this._root).uuid,r=e._clip.uuid,i=this._actionsByClip[r];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,r,o)}const n=e._propertyBindings;for(let o=0,r=n.length;o!==r;++o){const i=n[o];i.useCount++===0&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const n=e._propertyBindings;for(let o=0,r=n.length;o!==r;++o){const i=n[o];--i.useCount===0&&(i.restoreOriginalState(),this._takeBackBinding(i))}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 n=e._cacheIndex;return n!==null&&n=0;--o)e[o].stop();return this}update(e){e*=this.timeScale;const n=this._actions,o=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let c=0;c!==o;++c)n[c]._update(r,e,i,a);const l=this._bindings,s=this._nActiveBindings;for(let c=0;c!==s;++c)l[c].apply(a);return this}setTime(e){this.time=0;for(let n=0;nthis.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,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,I8e).distanceTo(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}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 z8e=new ie,$B=new ie;class lge{constructor(e=new ie,n=new ie){this.start=e,this.end=n}set(e,n){return this.start.copy(e),this.end.copy(n),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,n){return this.delta(n).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,n){z8e.subVectors(e,this.start),$B.subVectors(this.end,this.start);const o=$B.dot($B);let i=$B.dot(z8e)/o;return n&&(i=h0(i,0,1)),i}closestPointToPoint(e,n,o){const r=this.closestPointToPointParameter(e,n);return this.delta(o).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const D8e=new ie;class i3t extends Wl{constructor(e,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const o=new Ni,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,l=1,s=32;a1)for(let d=0;d.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{W8e.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(W8e,n)}}setLength(e,n=e*.2,o=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(o,n,o),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}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class A3t extends n3{constructor(e=1){const n=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],o=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Ni;r.setAttribute("position",new gr(n,3)),r.setAttribute("color",new gr(o,3));const i=new pp({vertexColors:!0,toneMapped:!1});super(r,i),this.type="AxesHelper"}setColors(e,n,o){const r=new rr,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(n),r.toArray(i,6),r.toArray(i,9),r.set(o),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class PUe{constructor(){this.type="ShapePath",this.color=new rr,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new LF,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,o,r){return this.currentPath.quadraticCurveTo(e,n,o,r),this}bezierCurveTo(e,n,o,r,i,a){return this.currentPath.bezierCurveTo(e,n,o,r,i,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(b){const C=[];for(let P=0,v=b.length;PNumber.EPSILON){if(M<0&&(x=C[A],R=-R,S=C[T],M=-M),b.yS.y)continue;if(b.y===x.y){if(b.x===x.x)return!0}else{const D=M*(b.x-x.x)-R*(b.y-x.y);if(D===0)return!0;if(D<0)continue;v=!v}}else{if(b.y!==x.y)continue;if(S.x<=b.x&&b.x<=x.x||x.x<=b.x&&b.x<=S.x)return!0}}return v}const r=C9.isClockWise,i=this.subPaths;if(i.length===0)return[];let a,l,s;const c=[];if(i.length===1)return l=i[0],s=new Fl,s.curves=l.curves,c.push(s),c;let u=!r(i[0].getPoints());u=e?!u:u;const d=[],f=[];let p=[],g=0,y;f[g]=void 0,p[g]=[];for(let b=0,C=i.length;b1){let b=!1,C=0;for(let P=0,v=f.length;P0&&b===!1&&(p=d)}let w;for(let b=0,C=f.length;b{const d=typeof c=="function"?c(e):c;if(d!==e){const f=e;e=u?d:Object.assign({},e,d),n.forEach(p=>p(e,f))}},r=()=>e,i=(c,u=r,d=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let f=u(e);function p(){const g=u(e);if(!d(f,g)){const y=f;c(f=g,y)}}return n.add(p),()=>n.delete(p)},s={setState:o,getState:r,subscribe:(c,u,d)=>u||d?i(c,u,d):(n.add(c),()=>n.delete(c)),destroy:()=>n.clear()};return e=t(o,r,s),s}const x3t=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),W8e=x3t?m.useEffect:m.useLayoutEffect;function b3t(t){const e=typeof t=="function"?v3t(t):t,n=(o=e.getState,r=Object.is)=>{const[,i]=m.useReducer(w=>w+1,0),a=e.getState(),l=m.useRef(a),s=m.useRef(o),c=m.useRef(r),u=m.useRef(!1),d=m.useRef();d.current===void 0&&(d.current=o(a));let f,p=!1;(l.current!==a||s.current!==o||c.current!==r||u.current)&&(f=o(a),p=!r(d.current,f)),W8e(()=>{p&&(d.current=f),l.current=a,s.current=o,c.current=r,u.current=!1});const g=m.useRef(a);W8e(()=>{const w=()=>{try{const C=e.getState(),P=s.current(C);c.current(d.current,P)||(l.current=C,d.current=P,i())}catch{u.current=!0,i()}},b=e.subscribe(w);return e.getState()!==g.current&&w(),b},[]);const y=p?f:d.current;return m.useDebugValue(y),y};return Object.assign(n,e),n[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const o=[n,e];return{next(){const r=o.length<=0;return{value:o.shift(),done:r}}}},n}var CUe={exports:{}},RUe={exports:{}},HUe={};/** + */vb.ConcurrentRoot=1;vb.ContinuousEventPriority=4;vb.DefaultEventPriority=16;vb.DiscreteEventPriority=1;vb.IdleEventPriority=536870912;vb.LegacyRoot=0;CUe.exports=vb;var KP=CUe.exports;function v3t(t){let e;const n=new Set,o=(c,u)=>{const d=typeof c=="function"?c(e):c;if(d!==e){const f=e;e=u?d:Object.assign({},e,d),n.forEach(p=>p(e,f))}},r=()=>e,i=(c,u=r,d=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let f=u(e);function p(){const g=u(e);if(!d(f,g)){const y=f;c(f=g,y)}}return n.add(p),()=>n.delete(p)},s={setState:o,getState:r,subscribe:(c,u,d)=>u||d?i(c,u,d):(n.add(c),()=>n.delete(c)),destroy:()=>n.clear()};return e=t(o,r,s),s}const x3t=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),N8e=x3t?m.useEffect:m.useLayoutEffect;function b3t(t){const e=typeof t=="function"?v3t(t):t,n=(o=e.getState,r=Object.is)=>{const[,i]=m.useReducer(w=>w+1,0),a=e.getState(),l=m.useRef(a),s=m.useRef(o),c=m.useRef(r),u=m.useRef(!1),d=m.useRef();d.current===void 0&&(d.current=o(a));let f,p=!1;(l.current!==a||s.current!==o||c.current!==r||u.current)&&(f=o(a),p=!r(d.current,f)),N8e(()=>{p&&(d.current=f),l.current=a,s.current=o,c.current=r,u.current=!1});const g=m.useRef(a);N8e(()=>{const w=()=>{try{const C=e.getState(),P=s.current(C);c.current(d.current,P)||(l.current=C,d.current=P,i())}catch{u.current=!0,i()}},b=e.subscribe(w);return e.getState()!==g.current&&w(),b},[]);const y=p?f:d.current;return m.useDebugValue(y),y};return Object.assign(n,e),n[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const o=[n,e];return{next(){const r=o.length<=0;return{value:o.shift(),done:r}}}},n}var RUe={exports:{}},HUe={exports:{}},MUe={};/** * @license React * scheduler.production.min.js * @@ -3676,7 +3676,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. - */(function(t){function e(F,U){var O=F.length;F.push(U);e:for(;0>>1,_=F[B];if(0>>1;Br(Q,O))le<_&&0>r(q,Q)?(F[B]=q,F[le]=O,B=le):(F[B]=Q,F[$]=O,B=$);else if(le<_&&0>r(q,O))F[B]=q,F[le]=O,B=le;else break e}}return U}function r(F,U){var O=F.sortIndex-U.sortIndex;return O!==0?O:F.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var s=[],c=[],u=1,d=null,f=3,p=!1,g=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,C=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(F){for(var U=n(c);U!==null;){if(U.callback===null)o(c);else if(U.startTime<=F)o(c),U.sortIndex=U.expirationTime,e(s,U);else break;U=n(c)}}function v(F){if(y=!1,P(F),!g)if(n(s)!==null)g=!0,k(T);else{var U=n(c);U!==null&&N(v,U.startTime-F)}}function T(F,U){g=!1,y&&(y=!1,b(S),S=-1),p=!0;var O=f;try{for(P(U),d=n(s);d!==null&&(!(d.expirationTime>U)||F&&!D());){var B=d.callback;if(typeof B=="function"){d.callback=null,f=d.priorityLevel;var _=B(d.expirationTime<=U);U=t.unstable_now(),typeof _=="function"?d.callback=_:d===n(s)&&o(s),P(U)}else o(s);d=n(s)}if(d!==null)var X=!0;else{var $=n(c);$!==null&&N(v,$.startTime-U),X=!1}return X}finally{d=null,f=O,p=!1}}var A=!1,x=null,S=-1,R=5,M=-1;function D(){return!(t.unstable_now()-MF||125B?(F.sortIndex=O,e(c,F),n(s)===null&&F===n(c)&&(y?(b(S),S=-1):y=!0,N(v,O-B))):(F.sortIndex=_,e(s,F),g||p||(g=!0,k(T))),F},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(F){var U=f;return function(){var O=f;f=U;try{return F.apply(this,arguments)}finally{f=O}}}})(HUe);RUe.exports=HUe;var Hce=RUe.exports;/** + */(function(t){function e(F,U){var O=F.length;F.push(U);e:for(;0>>1,_=F[B];if(0>>1;Br(Q,O))le<_&&0>r(q,Q)?(F[B]=q,F[le]=O,B=le):(F[B]=Q,F[$]=O,B=$);else if(le<_&&0>r(q,O))F[B]=q,F[le]=O,B=le;else break e}}return U}function r(F,U){var O=F.sortIndex-U.sortIndex;return O!==0?O:F.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var s=[],c=[],u=1,d=null,f=3,p=!1,g=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,C=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(F){for(var U=n(c);U!==null;){if(U.callback===null)o(c);else if(U.startTime<=F)o(c),U.sortIndex=U.expirationTime,e(s,U);else break;U=n(c)}}function v(F){if(y=!1,P(F),!g)if(n(s)!==null)g=!0,k(T);else{var U=n(c);U!==null&&N(v,U.startTime-F)}}function T(F,U){g=!1,y&&(y=!1,b(S),S=-1),p=!0;var O=f;try{for(P(U),d=n(s);d!==null&&(!(d.expirationTime>U)||F&&!D());){var B=d.callback;if(typeof B=="function"){d.callback=null,f=d.priorityLevel;var _=B(d.expirationTime<=U);U=t.unstable_now(),typeof _=="function"?d.callback=_:d===n(s)&&o(s),P(U)}else o(s);d=n(s)}if(d!==null)var X=!0;else{var $=n(c);$!==null&&N(v,$.startTime-U),X=!1}return X}finally{d=null,f=O,p=!1}}var A=!1,x=null,S=-1,R=5,M=-1;function D(){return!(t.unstable_now()-MF||125B?(F.sortIndex=O,e(c,F),n(s)===null&&F===n(c)&&(y?(b(S),S=-1):y=!0,N(v,O-B))):(F.sortIndex=_,e(s,F),g||p||(g=!0,k(T))),F},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(F){var U=f;return function(){var O=f;f=U;try{return F.apply(this,arguments)}finally{f=O}}}})(MUe);HUe.exports=MUe;var Hce=HUe.exports;/** * @license React * react-reconciler.production.min.js * @@ -3688,26 +3688,26 @@ void main() { `+lt+J}var Ft=!1;function _t(J,K){if(!J||Ft)return"";Ft=!0;var we=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(K)if(K=function(){throw Error()},Object.defineProperty(K.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(K,[])}catch(Bo){var Le=Bo}Reflect.construct(J,[],K)}else{try{K.call()}catch(Bo){Le=Bo}J.call(K.prototype)}else{try{throw Error()}catch(Bo){Le=Bo}J()}}catch(Bo){if(Bo&&Le&&typeof Bo.stack=="string"){for(var Ge=Bo.stack.split(` `),pt=Le.stack.split(` `),Zt=Ge.length-1,Sn=pt.length-1;1<=Zt&&0<=Sn&&Ge[Zt]!==pt[Sn];)Sn--;for(;1<=Zt&&0<=Sn;Zt--,Sn--)if(Ge[Zt]!==pt[Sn]){if(Zt!==1||Sn!==1)do if(Zt--,Sn--,0>Sn||Ge[Zt]!==pt[Sn]){var Qn=` -`+Ge[Zt].replace(" at new "," at ");return J.displayName&&Qn.includes("")&&(Qn=Qn.replace("",J.displayName)),Qn}while(1<=Zt&&0<=Sn);break}}}finally{Ft=!1,Error.prepareStackTrace=we}return(J=J?J.displayName||J.name:"")?zt(J):""}var tn=Object.prototype.hasOwnProperty,Qt=[],gn=-1;function an(J){return{current:J}}function mn(J){0>gn||(J.current=Qt[gn],Qt[gn]=null,gn--)}function Hn(J,K){gn++,Qt[gn]=J.current,J.current=K}var Fo={},yo=an(Fo),So=an(!1),$o=Fo;function mo(J,K){var we=J.type.contextTypes;if(!we)return Fo;var Le=J.stateNode;if(Le&&Le.__reactInternalMemoizedUnmaskedChildContext===K)return Le.__reactInternalMemoizedMaskedChildContext;var Ge={},pt;for(pt in we)Ge[pt]=K[pt];return Le&&(J=J.stateNode,J.__reactInternalMemoizedUnmaskedChildContext=K,J.__reactInternalMemoizedMaskedChildContext=Ge),Ge}function Jn(J){return J=J.childContextTypes,J!=null}function uo(){mn(So),mn(yo)}function ir(J,K,we){if(yo.current!==Fo)throw Error(a(168));Hn(yo,K),Hn(So,we)}function Rr(J,K,we){var Le=J.stateNode;if(K=K.childContextTypes,typeof Le.getChildContext!="function")return we;Le=Le.getChildContext();for(var Ge in Le)if(!(Ge in K))throw Error(a(108,S(J)||"Unknown",Ge));return i({},we,Le)}function br(J){return J=(J=J.stateNode)&&J.__reactInternalMemoizedMergedChildContext||Fo,$o=yo.current,Hn(yo,J),Hn(So,So.current),!0}function Vr(J,K,we){var Le=J.stateNode;if(!Le)throw Error(a(169));we?(J=Rr(J,K,$o),Le.__reactInternalMemoizedMergedChildContext=J,mn(So),mn(yo),Hn(yo,J)):mn(So),Hn(So,we)}var Wo=Math.clz32?Math.clz32:ar,wn=Math.log,In=Math.LN2;function ar(J){return J>>>=0,J===0?32:31-(wn(J)/In|0)|0}var No=64,eo=4194304;function Xn(J){switch(J&-J){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 J&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return J&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return J}}function Jo(J,K){var we=J.pendingLanes;if(we===0)return 0;var Le=0,Ge=J.suspendedLanes,pt=J.pingedLanes,Zt=we&268435455;if(Zt!==0){var Sn=Zt&~Ge;Sn!==0?Le=Xn(Sn):(pt&=Zt,pt!==0&&(Le=Xn(pt)))}else Zt=we&~Ge,Zt!==0?Le=Xn(Zt):pt!==0&&(Le=Xn(pt));if(Le===0)return 0;if(K!==0&&K!==Le&&!(K&Ge)&&(Ge=Le&-Le,pt=K&-K,Ge>=pt||Ge===16&&(pt&4194240)!==0))return K;if(Le&4&&(Le|=we&16),K=J.entangledLanes,K!==0)for(J=J.entanglements,K&=Le;0we;we++)K.push(J);return K}function fr(J,K,we){J.pendingLanes|=K,K!==536870912&&(J.suspendedLanes=0,J.pingedLanes=0),J=J.eventTimes,K=31-Wo(K),J[K]=we}function ai(J,K){var we=J.pendingLanes&~K;J.pendingLanes=K,J.suspendedLanes=0,J.pingedLanes=0,J.expiredLanes&=K,J.mutableReadLanes&=K,J.entangledLanes&=K,K=J.entanglements;var Le=J.eventTimes;for(J=J.expirationTimes;0>=Zt,Ge-=Zt,A1=1<<32-Wo(K)+Ge|we<oa?(Oa=Bi,Bi=null):Oa=Bi.sibling;var Ta=Gr(kn,Bi,_n[oa],xr);if(Ta===null){Bi===null&&(Bi=Oa);break}J&&Bi&&Ta.alternate===null&&K(kn,Bi),Rn=pt(Ta,Rn,oa),Qi===null?Dr=Ta:Qi.sibling=Ta,Qi=Ta,Bi=Oa}if(oa===_n.length)return we(kn,Bi),xl&&Mh(kn,oa),Dr;if(Bi===null){for(;oa<_n.length;oa++)Bi=zi(kn,_n[oa],xr),Bi!==null&&(Rn=pt(Bi,Rn,oa),Qi===null?Dr=Bi:Qi.sibling=Bi,Qi=Bi);return xl&&Mh(kn,oa),Dr}for(Bi=Le(kn,Bi);oa<_n.length;oa++)Oa=pl(Bi,kn,oa,_n[oa],xr),Oa!==null&&(J&&Oa.alternate!==null&&Bi.delete(Oa.key===null?oa:Oa.key),Rn=pt(Oa,Rn,oa),Qi===null?Dr=Oa:Qi.sibling=Oa,Qi=Oa);return J&&Bi.forEach(function(Hp){return K(kn,Hp)}),xl&&Mh(kn,oa),Dr}function T0(kn,Rn,_n,xr){var Dr=A(_n);if(typeof Dr!="function")throw Error(a(150));if(_n=Dr.call(_n),_n==null)throw Error(a(151));for(var Qi=Dr=null,Bi=Rn,oa=Rn=0,Oa=null,Ta=_n.next();Bi!==null&&!Ta.done;oa++,Ta=_n.next()){Bi.index>oa?(Oa=Bi,Bi=null):Oa=Bi.sibling;var Hp=Gr(kn,Bi,Ta.value,xr);if(Hp===null){Bi===null&&(Bi=Oa);break}J&&Bi&&Hp.alternate===null&&K(kn,Bi),Rn=pt(Hp,Rn,oa),Qi===null?Dr=Hp:Qi.sibling=Hp,Qi=Hp,Bi=Oa}if(Ta.done)return we(kn,Bi),xl&&Mh(kn,oa),Dr;if(Bi===null){for(;!Ta.done;oa++,Ta=_n.next())Ta=zi(kn,Ta.value,xr),Ta!==null&&(Rn=pt(Ta,Rn,oa),Qi===null?Dr=Ta:Qi.sibling=Ta,Qi=Ta);return xl&&Mh(kn,oa),Dr}for(Bi=Le(kn,Bi);!Ta.done;oa++,Ta=_n.next())Ta=pl(Bi,kn,oa,Ta.value,xr),Ta!==null&&(J&&Ta.alternate!==null&&Bi.delete(Ta.key===null?oa:Ta.key),Rn=pt(Ta,Rn,oa),Qi===null?Dr=Ta:Qi.sibling=Ta,Qi=Ta);return J&&Bi.forEach(function(r4){return K(kn,r4)}),xl&&Mh(kn,oa),Dr}function qd(kn,Rn,_n,xr){if(typeof _n=="object"&&_n!==null&&_n.type===u&&_n.key===null&&(_n=_n.props.children),typeof _n=="object"&&_n!==null){switch(_n.$$typeof){case s:e:{for(var Dr=_n.key,Qi=Rn;Qi!==null;){if(Qi.key===Dr){if(Dr=_n.type,Dr===u){if(Qi.tag===7){we(kn,Qi.sibling),Rn=Ge(Qi,_n.props.children),Rn.return=kn,kn=Rn;break e}}else if(Qi.elementType===Dr||typeof Dr=="object"&&Dr!==null&&Dr.$$typeof===P&&P3(Dr)===Qi.type){we(kn,Qi.sibling),Rn=Ge(Qi,_n.props),Rn.ref=g5(kn,Qi,_n),Rn.return=kn,kn=Rn;break e}we(kn,Qi);break}else K(kn,Qi);Qi=Qi.sibling}_n.type===u?(Rn=lm(_n.props.children,kn.mode,xr,_n.key),Rn.return=kn,kn=Rn):(xr=Wy(_n.type,_n.key,_n.props,null,kn.mode,xr),xr.ref=g5(kn,Rn,_n),xr.return=kn,kn=xr)}return Zt(kn);case c:e:{for(Qi=_n.key;Rn!==null;){if(Rn.key===Qi)if(Rn.tag===4&&Rn.stateNode.containerInfo===_n.containerInfo&&Rn.stateNode.implementation===_n.implementation){we(kn,Rn.sibling),Rn=Ge(Rn,_n.children||[]),Rn.return=kn,kn=Rn;break e}else{we(kn,Rn);break}else K(kn,Rn);Rn=Rn.sibling}Rn=Kd(_n,kn.mode,xr),Rn.return=kn,kn=Rn}return Zt(kn);case P:return Qi=_n._init,qd(kn,Rn,Qi(_n._payload),xr)}if(L(_n))return _r(kn,Rn,_n,xr);if(A(_n))return T0(kn,Rn,_n,xr);zh(kn,_n)}return typeof _n=="string"&&_n!==""||typeof _n=="number"?(_n=""+_n,Rn!==null&&Rn.tag===6?(we(kn,Rn.sibling),Rn=Ge(Rn,_n),Rn.return=kn,kn=Rn):(we(kn,Rn),Rn=S0(_n,kn.mode,xr),Rn.return=kn,kn=Rn),Zt(kn)):we(kn,Rn)}return qd}var Bd=Vg(!0),e7=Vg(!1),Xc={},ms=an(Xc),xy=an(Xc),by=an(Xc);function vu(J){if(J===Xc)throw Error(a(174));return J}function t7(J,K){Hn(by,K),Hn(xy,J),Hn(ms,Xc),J=N(K),mn(ms),Hn(ms,J)}function Sy(){mn(ms),mn(xy),mn(by)}function pS(J){var K=vu(by.current),we=vu(ms.current);K=F(we,J.type,K),we!==K&&(Hn(xy,J),Hn(ms,K))}function bp(J){xy.current===J&&(mn(ms),mn(xy))}var vn=an(0);function io(J){for(var K=J;K!==null;){if(K.tag===13){var we=K.memoizedState;if(we!==null&&(we=we.dehydrated,we===null||Pt(we)||Rt(we)))return K}else if(K.tag===19&&K.memoizedProps.revealOrder!==void 0){if(K.flags&128)return K}else if(K.child!==null){K.child.return=K,K=K.child;continue}if(K===J)break;for(;K.sibling===null;){if(K.return===null||K.return===J)return null;K=K.return}K.sibling.return=K.return,K=K.sibling}return null}var Nn=[];function Sr(){for(var J=0;Jwe?we:4,J(!0);var Le=ji.transition;ji.transition={};try{J(!1),K()}finally{tr=we,ji.transition=Le}}function o7(){return Ns().memoizedState}function Kc(J,K,we){var Le=Wf(J);we={lane:Le,action:we,hasEagerState:!1,eagerState:null,next:null},r7(J)?DA(K,we):(M3(J,K,we),we=x0(),J=sd(J,Le,we),J!==null&&EA(J,K,Le))}function X0(J,K,we){var Le=Wf(J),Ge={lane:Le,action:we,hasEagerState:!1,eagerState:null,next:null};if(r7(J))DA(K,Ge);else{M3(J,K,Ge);var pt=J.alternate;if(J.lanes===0&&(pt===null||pt.lanes===0)&&(pt=K.lastRenderedReducer,pt!==null))try{var Zt=K.lastRenderedState,Sn=pt(Zt,we);if(Ge.hasEagerState=!0,Ge.eagerState=Sn,Bl(Sn,Zt))return}catch{}finally{}we=x0(),J=sd(J,Le,we),J!==null&&EA(J,K,Le)}}function r7(J){var K=J.alternate;return J===Si||K!==null&&K===Si}function DA(J,K){Gg=G0=!0;var we=J.pending;we===null?K.next=K:(K.next=we.next,we.next=K),J.pending=K}function M3(J,K,we){zc!==null&&J.mode&1&&!(Ci&2)?(J=K.interleaved,J===null?(we.next=we,Yn===null?Yn=[K]:Yn.push(K)):(we.next=J.next,J.next=we),K.interleaved=we):(J=K.pending,J===null?we.next=we:(we.next=J.next,J.next=we),K.pending=we)}function EA(J,K,we){if(we&4194240){var Le=K.lanes;Le&=J.pendingLanes,we|=Le,K.lanes=we,hr(J,we)}}var Hr={readContext:Ln,useCallback:Ws,useContext:Ws,useEffect:Ws,useImperativeHandle:Ws,useInsertionEffect:Ws,useLayoutEffect:Ws,useMemo:Ws,useReducer:Ws,useRef:Ws,useState:Ws,useDebugValue:Ws,useDeferredValue:Ws,useTransition:Ws,useMutableSource:Ws,useSyncExternalStore:Ws,useId:Ws,unstable_isNewReconciler:!1},qc={readContext:Ln,useCallback:function(J,K){return Hc().memoizedState=[J,K===void 0?null:K],J},useContext:Ln,useEffect:Sp,useImperativeHandle:function(J,K,we){return we=we!=null?we.concat([J]):null,Yd(4194308,4,T5.bind(null,K,J),we)},useLayoutEffect:function(J,K){return Yd(4194308,4,J,K)},useInsertionEffect:function(J,K){return Yd(4,2,J,K)},useMemo:function(J,K){var we=Hc();return K=K===void 0?null:K,J=J(),we.memoizedState=[J,K],J},useReducer:function(J,K,we){var Le=Hc();return K=we!==void 0?we(K):K,Le.memoizedState=Le.baseState=K,J={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:J,lastRenderedState:K},Le.queue=J,J=J.dispatch=Kc.bind(null,Si,J),[Le.memoizedState,J]},useRef:function(J){var K=Hc();return J={current:J},K.memoizedState=J},useState:x5,useDebugValue:Ff,useDeferredValue:function(J){var K=x5(J),we=K[0],Le=K[1];return Sp(function(){var Ge=ji.transition;ji.transition={};try{Le(J)}finally{ji.transition=Ge}},[J]),we},useTransition:function(){var J=x5(!1),K=J[0];return J=H3.bind(null,J[1]),Hc().memoizedState=J,[K,J]},useMutableSource:function(){},useSyncExternalStore:function(J,K,we){var Le=Si,Ge=Hc();if(xl){if(we===void 0)throw Error(a(407));we=we()}else{if(we=K(),zc===null)throw Error(a(349));ss&30||v5(Le,K,we)}Ge.memoizedState=we;var pt={value:we,getSnapshot:K};return Ge.queue=pt,Sp(tc.bind(null,Le,pt,J),[J]),Le.flags|=2048,td(9,Jg.bind(null,Le,pt,we,K),void 0,null),we},useId:function(){var J=Hc(),K=zc.identifierPrefix;if(xl){var we=V0,Le=A1;we=(Le&~(1<<32-Wo(Le)-1)).toString(32)+we,K=":"+K+"R"+we,we=C3++,0")&&(Qn=Qn.replace("",J.displayName)),Qn}while(1<=Zt&&0<=Sn);break}}}finally{Ft=!1,Error.prepareStackTrace=we}return(J=J?J.displayName||J.name:"")?zt(J):""}var tn=Object.prototype.hasOwnProperty,Qt=[],gn=-1;function an(J){return{current:J}}function mn(J){0>gn||(J.current=Qt[gn],Qt[gn]=null,gn--)}function Hn(J,K){gn++,Qt[gn]=J.current,J.current=K}var Fo={},yo=an(Fo),So=an(!1),$o=Fo;function mo(J,K){var we=J.type.contextTypes;if(!we)return Fo;var Le=J.stateNode;if(Le&&Le.__reactInternalMemoizedUnmaskedChildContext===K)return Le.__reactInternalMemoizedMaskedChildContext;var Ge={},pt;for(pt in we)Ge[pt]=K[pt];return Le&&(J=J.stateNode,J.__reactInternalMemoizedUnmaskedChildContext=K,J.__reactInternalMemoizedMaskedChildContext=Ge),Ge}function Jn(J){return J=J.childContextTypes,J!=null}function uo(){mn(So),mn(yo)}function ir(J,K,we){if(yo.current!==Fo)throw Error(a(168));Hn(yo,K),Hn(So,we)}function Rr(J,K,we){var Le=J.stateNode;if(K=K.childContextTypes,typeof Le.getChildContext!="function")return we;Le=Le.getChildContext();for(var Ge in Le)if(!(Ge in K))throw Error(a(108,S(J)||"Unknown",Ge));return i({},we,Le)}function br(J){return J=(J=J.stateNode)&&J.__reactInternalMemoizedMergedChildContext||Fo,$o=yo.current,Hn(yo,J),Hn(So,So.current),!0}function Vr(J,K,we){var Le=J.stateNode;if(!Le)throw Error(a(169));we?(J=Rr(J,K,$o),Le.__reactInternalMemoizedMergedChildContext=J,mn(So),mn(yo),Hn(yo,J)):mn(So),Hn(So,we)}var Wo=Math.clz32?Math.clz32:ar,wn=Math.log,In=Math.LN2;function ar(J){return J>>>=0,J===0?32:31-(wn(J)/In|0)|0}var No=64,eo=4194304;function Xn(J){switch(J&-J){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 J&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return J&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return J}}function Jo(J,K){var we=J.pendingLanes;if(we===0)return 0;var Le=0,Ge=J.suspendedLanes,pt=J.pingedLanes,Zt=we&268435455;if(Zt!==0){var Sn=Zt&~Ge;Sn!==0?Le=Xn(Sn):(pt&=Zt,pt!==0&&(Le=Xn(pt)))}else Zt=we&~Ge,Zt!==0?Le=Xn(Zt):pt!==0&&(Le=Xn(pt));if(Le===0)return 0;if(K!==0&&K!==Le&&!(K&Ge)&&(Ge=Le&-Le,pt=K&-K,Ge>=pt||Ge===16&&(pt&4194240)!==0))return K;if(Le&4&&(Le|=we&16),K=J.entangledLanes,K!==0)for(J=J.entanglements,K&=Le;0we;we++)K.push(J);return K}function fr(J,K,we){J.pendingLanes|=K,K!==536870912&&(J.suspendedLanes=0,J.pingedLanes=0),J=J.eventTimes,K=31-Wo(K),J[K]=we}function ai(J,K){var we=J.pendingLanes&~K;J.pendingLanes=K,J.suspendedLanes=0,J.pingedLanes=0,J.expiredLanes&=K,J.mutableReadLanes&=K,J.entangledLanes&=K,K=J.entanglements;var Le=J.eventTimes;for(J=J.expirationTimes;0>=Zt,Ge-=Zt,A1=1<<32-Wo(K)+Ge|we<oa?(Oa=Bi,Bi=null):Oa=Bi.sibling;var Ta=Gr(kn,Bi,_n[oa],xr);if(Ta===null){Bi===null&&(Bi=Oa);break}J&&Bi&&Ta.alternate===null&&K(kn,Bi),Rn=pt(Ta,Rn,oa),Qi===null?Dr=Ta:Qi.sibling=Ta,Qi=Ta,Bi=Oa}if(oa===_n.length)return we(kn,Bi),xl&&Mh(kn,oa),Dr;if(Bi===null){for(;oa<_n.length;oa++)Bi=zi(kn,_n[oa],xr),Bi!==null&&(Rn=pt(Bi,Rn,oa),Qi===null?Dr=Bi:Qi.sibling=Bi,Qi=Bi);return xl&&Mh(kn,oa),Dr}for(Bi=Le(kn,Bi);oa<_n.length;oa++)Oa=pl(Bi,kn,oa,_n[oa],xr),Oa!==null&&(J&&Oa.alternate!==null&&Bi.delete(Oa.key===null?oa:Oa.key),Rn=pt(Oa,Rn,oa),Qi===null?Dr=Oa:Qi.sibling=Oa,Qi=Oa);return J&&Bi.forEach(function(Hp){return K(kn,Hp)}),xl&&Mh(kn,oa),Dr}function T0(kn,Rn,_n,xr){var Dr=A(_n);if(typeof Dr!="function")throw Error(a(150));if(_n=Dr.call(_n),_n==null)throw Error(a(151));for(var Qi=Dr=null,Bi=Rn,oa=Rn=0,Oa=null,Ta=_n.next();Bi!==null&&!Ta.done;oa++,Ta=_n.next()){Bi.index>oa?(Oa=Bi,Bi=null):Oa=Bi.sibling;var Hp=Gr(kn,Bi,Ta.value,xr);if(Hp===null){Bi===null&&(Bi=Oa);break}J&&Bi&&Hp.alternate===null&&K(kn,Bi),Rn=pt(Hp,Rn,oa),Qi===null?Dr=Hp:Qi.sibling=Hp,Qi=Hp,Bi=Oa}if(Ta.done)return we(kn,Bi),xl&&Mh(kn,oa),Dr;if(Bi===null){for(;!Ta.done;oa++,Ta=_n.next())Ta=zi(kn,Ta.value,xr),Ta!==null&&(Rn=pt(Ta,Rn,oa),Qi===null?Dr=Ta:Qi.sibling=Ta,Qi=Ta);return xl&&Mh(kn,oa),Dr}for(Bi=Le(kn,Bi);!Ta.done;oa++,Ta=_n.next())Ta=pl(Bi,kn,oa,Ta.value,xr),Ta!==null&&(J&&Ta.alternate!==null&&Bi.delete(Ta.key===null?oa:Ta.key),Rn=pt(Ta,Rn,oa),Qi===null?Dr=Ta:Qi.sibling=Ta,Qi=Ta);return J&&Bi.forEach(function(r4){return K(kn,r4)}),xl&&Mh(kn,oa),Dr}function qd(kn,Rn,_n,xr){if(typeof _n=="object"&&_n!==null&&_n.type===u&&_n.key===null&&(_n=_n.props.children),typeof _n=="object"&&_n!==null){switch(_n.$$typeof){case s:e:{for(var Dr=_n.key,Qi=Rn;Qi!==null;){if(Qi.key===Dr){if(Dr=_n.type,Dr===u){if(Qi.tag===7){we(kn,Qi.sibling),Rn=Ge(Qi,_n.props.children),Rn.return=kn,kn=Rn;break e}}else if(Qi.elementType===Dr||typeof Dr=="object"&&Dr!==null&&Dr.$$typeof===P&&P3(Dr)===Qi.type){we(kn,Qi.sibling),Rn=Ge(Qi,_n.props),Rn.ref=g5(kn,Qi,_n),Rn.return=kn,kn=Rn;break e}we(kn,Qi);break}else K(kn,Qi);Qi=Qi.sibling}_n.type===u?(Rn=lm(_n.props.children,kn.mode,xr,_n.key),Rn.return=kn,kn=Rn):(xr=Wy(_n.type,_n.key,_n.props,null,kn.mode,xr),xr.ref=g5(kn,Rn,_n),xr.return=kn,kn=xr)}return Zt(kn);case c:e:{for(Qi=_n.key;Rn!==null;){if(Rn.key===Qi)if(Rn.tag===4&&Rn.stateNode.containerInfo===_n.containerInfo&&Rn.stateNode.implementation===_n.implementation){we(kn,Rn.sibling),Rn=Ge(Rn,_n.children||[]),Rn.return=kn,kn=Rn;break e}else{we(kn,Rn);break}else K(kn,Rn);Rn=Rn.sibling}Rn=Kd(_n,kn.mode,xr),Rn.return=kn,kn=Rn}return Zt(kn);case P:return Qi=_n._init,qd(kn,Rn,Qi(_n._payload),xr)}if(L(_n))return _r(kn,Rn,_n,xr);if(A(_n))return T0(kn,Rn,_n,xr);zh(kn,_n)}return typeof _n=="string"&&_n!==""||typeof _n=="number"?(_n=""+_n,Rn!==null&&Rn.tag===6?(we(kn,Rn.sibling),Rn=Ge(Rn,_n),Rn.return=kn,kn=Rn):(we(kn,Rn),Rn=S0(_n,kn.mode,xr),Rn.return=kn,kn=Rn),Zt(kn)):we(kn,Rn)}return qd}var Bd=Vg(!0),e7=Vg(!1),Xc={},ms=an(Xc),xy=an(Xc),by=an(Xc);function vu(J){if(J===Xc)throw Error(a(174));return J}function t7(J,K){Hn(by,K),Hn(xy,J),Hn(ms,Xc),J=N(K),mn(ms),Hn(ms,J)}function Sy(){mn(ms),mn(xy),mn(by)}function pS(J){var K=vu(by.current),we=vu(ms.current);K=F(we,J.type,K),we!==K&&(Hn(xy,J),Hn(ms,K))}function bp(J){xy.current===J&&(mn(ms),mn(xy))}var vn=an(0);function io(J){for(var K=J;K!==null;){if(K.tag===13){var we=K.memoizedState;if(we!==null&&(we=we.dehydrated,we===null||Pt(we)||Rt(we)))return K}else if(K.tag===19&&K.memoizedProps.revealOrder!==void 0){if(K.flags&128)return K}else if(K.child!==null){K.child.return=K,K=K.child;continue}if(K===J)break;for(;K.sibling===null;){if(K.return===null||K.return===J)return null;K=K.return}K.sibling.return=K.return,K=K.sibling}return null}var Nn=[];function Sr(){for(var J=0;Jwe?we:4,J(!0);var Le=ji.transition;ji.transition={};try{J(!1),K()}finally{tr=we,ji.transition=Le}}function o7(){return Ns().memoizedState}function Kc(J,K,we){var Le=Wf(J);we={lane:Le,action:we,hasEagerState:!1,eagerState:null,next:null},r7(J)?DA(K,we):(M3(J,K,we),we=x0(),J=sd(J,Le,we),J!==null&&EA(J,K,Le))}function X0(J,K,we){var Le=Wf(J),Ge={lane:Le,action:we,hasEagerState:!1,eagerState:null,next:null};if(r7(J))DA(K,Ge);else{M3(J,K,Ge);var pt=J.alternate;if(J.lanes===0&&(pt===null||pt.lanes===0)&&(pt=K.lastRenderedReducer,pt!==null))try{var Zt=K.lastRenderedState,Sn=pt(Zt,we);if(Ge.hasEagerState=!0,Ge.eagerState=Sn,Bl(Sn,Zt))return}catch{}finally{}we=x0(),J=sd(J,Le,we),J!==null&&EA(J,K,Le)}}function r7(J){var K=J.alternate;return J===Si||K!==null&&K===Si}function DA(J,K){Gg=G0=!0;var we=J.pending;we===null?K.next=K:(K.next=we.next,we.next=K),J.pending=K}function M3(J,K,we){zc!==null&&J.mode&1&&!(Ci&2)?(J=K.interleaved,J===null?(we.next=we,Yn===null?Yn=[K]:Yn.push(K)):(we.next=J.next,J.next=we),K.interleaved=we):(J=K.pending,J===null?we.next=we:(we.next=J.next,J.next=we),K.pending=we)}function EA(J,K,we){if(we&4194240){var Le=K.lanes;Le&=J.pendingLanes,we|=Le,K.lanes=we,hr(J,we)}}var Hr={readContext:Ln,useCallback:Ws,useContext:Ws,useEffect:Ws,useImperativeHandle:Ws,useInsertionEffect:Ws,useLayoutEffect:Ws,useMemo:Ws,useReducer:Ws,useRef:Ws,useState:Ws,useDebugValue:Ws,useDeferredValue:Ws,useTransition:Ws,useMutableSource:Ws,useSyncExternalStore:Ws,useId:Ws,unstable_isNewReconciler:!1},qc={readContext:Ln,useCallback:function(J,K){return Hc().memoizedState=[J,K===void 0?null:K],J},useContext:Ln,useEffect:Sp,useImperativeHandle:function(J,K,we){return we=we!=null?we.concat([J]):null,Yd(4194308,4,T5.bind(null,K,J),we)},useLayoutEffect:function(J,K){return Yd(4194308,4,J,K)},useInsertionEffect:function(J,K){return Yd(4,2,J,K)},useMemo:function(J,K){var we=Hc();return K=K===void 0?null:K,J=J(),we.memoizedState=[J,K],J},useReducer:function(J,K,we){var Le=Hc();return K=we!==void 0?we(K):K,Le.memoizedState=Le.baseState=K,J={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:J,lastRenderedState:K},Le.queue=J,J=J.dispatch=Kc.bind(null,Si,J),[Le.memoizedState,J]},useRef:function(J){var K=Hc();return J={current:J},K.memoizedState=J},useState:x5,useDebugValue:Ff,useDeferredValue:function(J){var K=x5(J),we=K[0],Le=K[1];return Sp(function(){var Ge=ji.transition;ji.transition={};try{Le(J)}finally{ji.transition=Ge}},[J]),we},useTransition:function(){var J=x5(!1),K=J[0];return J=H3.bind(null,J[1]),Hc().memoizedState=J,[K,J]},useMutableSource:function(){},useSyncExternalStore:function(J,K,we){var Le=Si,Ge=Hc();if(xl){if(we===void 0)throw Error(a(407));we=we()}else{if(we=K(),zc===null)throw Error(a(349));ss&30||v5(Le,K,we)}Ge.memoizedState=we;var pt={value:we,getSnapshot:K};return Ge.queue=pt,Sp(tc.bind(null,Le,pt,J),[J]),Le.flags|=2048,td(9,Jg.bind(null,Le,pt,we,K),void 0,null),we},useId:function(){var J=Hc(),K=zc.identifierPrefix;if(xl){var we=V0,Le=A1;we=(Le&~(1<<32-Wo(Le)-1)).toString(32)+we,K=":"+K+"R"+we,we=C3++,0W3&&(K.flags|=128,Le=!0,J0(Ge,!1),K.lanes=4194304)}else{if(!Le)if(J=io(pt),J!==null){if(K.flags|=128,Le=!0,J=J.updateQueue,J!==null&&(K.updateQueue=J,K.flags|=4),J0(Ge,!0),Ge.tail===null&&Ge.tailMode==="hidden"&&!pt.alternate&&!xl)return di(K),null}else 2*or()-Ge.renderingStartTime>W3&&we!==1073741824&&(K.flags|=128,Le=!0,J0(Ge,!1),K.lanes=4194304);Ge.isBackwards?(pt.sibling=K.child,K.child=pt):(J=Ge.last,J!==null?J.sibling=pt:K.child=pt,Ge.last=pt)}return Ge.tail!==null?(K=Ge.tail,Ge.rendering=K,Ge.tail=K.sibling,Ge.renderingStartTime=or(),K.sibling=null,J=vn.current,Hn(vn,Le?J&1|2:J&1),K):(di(K),null);case 22:case 23:return B3(),Le=K.memoizedState!==null,J!==null&&J.memoizedState!==null!==Le&&(K.flags|=8192),Le&&K.mode&1?Su&1073741824&&(di(K),se&&K.subtreeFlags&6&&(K.flags|=8192)):di(K),null;case 24:return null;case 25:return null}throw Error(a(156,K.tag))}var mS=l.ReactCurrentOwner,Od=!1;function Us(J,K,we,Le){K.child=J===null?e7(K,null,we,Le):Bd(K,J.child,we,Le)}function yS(J,K,we,Le,Ge){we=we.render;var pt=K.ref;return bn(K,Ge),Le=Ya(J,K,we,Le,pt,Ge),we=R3(),J!==null&&!Od?(K.updateQueue=J.updateQueue,K.flags&=-2053,J.lanes&=~Ge,Mc(J,K,Ge)):(xl&&we&&b3(K),K.flags|=1,Us(J,K,Le,Ge),K.child)}function AS(J,K,we,Le,Ge){if(J===null){var pt=we.type;return typeof pt=="function"&&!kh(pt)&&pt.defaultProps===void 0&&we.compare===null&&we.defaultProps===void 0?(K.tag=15,K.type=pt,WA(J,K,pt,Le,Ge)):(J=Wy(we.type,null,Le,K,K.mode,Ge),J.ref=K.ref,J.return=K,K.child=J)}if(pt=J.child,!(J.lanes&Ge)){var Zt=pt.memoizedProps;if(we=we.compare,we=we!==null?we:pn,we(Zt,Le)&&J.ref===K.ref)return Mc(J,K,Ge)}return K.flags|=1,J=Jd(pt,Le),J.ref=K.ref,J.return=K,K.child=J}function WA(J,K,we,Le,Ge){if(J!==null&&pn(J.memoizedProps,Le)&&J.ref===K.ref)if(Od=!1,(J.lanes&Ge)!==0)J.flags&131072&&(Od=!0);else return K.lanes=J.lanes,Mc(J,K,Ge);return Eh(J,K,we,Le,Ge)}function a7(J,K,we){var Le=K.pendingProps,Ge=Le.children,pt=J!==null?J.memoizedState:null;if(Le.mode==="hidden")if(!(K.mode&1))K.memoizedState={baseLanes:0,cachePool:null},Hn(Gd,Su),Su|=we;else if(we&1073741824)K.memoizedState={baseLanes:0,cachePool:null},Le=pt!==null?pt.baseLanes:we,Hn(Gd,Su),Su|=Le;else return J=pt!==null?pt.baseLanes|we:we,K.lanes=K.childLanes=1073741824,K.memoizedState={baseLanes:J,cachePool:null},K.updateQueue=null,Hn(Gd,Su),Su|=J,null;else pt!==null?(Le=pt.baseLanes|we,K.memoizedState=null):Le=we,Hn(Gd,Su),Su|=Le;return Us(J,K,Ge,we),K.child}function l7(J,K){var we=K.ref;(J===null&&we!==null||J!==null&&J.ref!==we)&&(K.flags|=512,K.flags|=2097152)}function Eh(J,K,we,Le,Ge){var pt=Jn(we)?$o:yo.current;return pt=mo(K,pt),bn(K,Ge),we=Ya(J,K,we,Le,pt,Ge),Le=R3(),J!==null&&!Od?(K.updateQueue=J.updateQueue,K.flags&=-2053,J.lanes&=~Ge,Mc(J,K,Ge)):(xl&&Le&&b3(K),K.flags|=1,Us(J,K,we,Ge),K.child)}function wS(J,K,we,Le,Ge){if(Jn(we)){var pt=!0;br(K)}else pt=!1;if(bn(K,Ge),K.stateNode===null)J!==null&&(J.alternate=null,K.alternate=null,K.flags|=2),Zu(K,we,Le),Xl(K,we,Le,Ge),Le=!0;else if(J===null){var Zt=K.stateNode,Sn=K.memoizedProps;Zt.props=Sn;var Qn=Zt.context,Bo=we.contextType;typeof Bo=="object"&&Bo!==null?Bo=Ln(Bo):(Bo=Jn(we)?$o:yo.current,Bo=mo(K,Bo));var zr=we.getDerivedStateFromProps,zi=typeof zr=="function"||typeof Zt.getSnapshotBeforeUpdate=="function";zi||typeof Zt.UNSAFE_componentWillReceiveProps!="function"&&typeof Zt.componentWillReceiveProps!="function"||(Sn!==Le||Qn!==Bo)&&Ef(K,Zt,Le,Bo),Wn=!1;var Gr=K.memoizedState;Zt.state=Gr,ya(K,Le,Zt,Ge),Qn=K.memoizedState,Sn!==Le||Gr!==Qn||So.current||Wn?(typeof zr=="function"&&(Qu(K,we,zr,Le),Qn=K.memoizedState),(Sn=Wn||Df(K,we,Sn,Le,Gr,Qn,Bo))?(zi||typeof Zt.UNSAFE_componentWillMount!="function"&&typeof Zt.componentWillMount!="function"||(typeof Zt.componentWillMount=="function"&&Zt.componentWillMount(),typeof Zt.UNSAFE_componentWillMount=="function"&&Zt.UNSAFE_componentWillMount()),typeof Zt.componentDidMount=="function"&&(K.flags|=4194308)):(typeof Zt.componentDidMount=="function"&&(K.flags|=4194308),K.memoizedProps=Le,K.memoizedState=Qn),Zt.props=Le,Zt.state=Qn,Zt.context=Bo,Le=Sn):(typeof Zt.componentDidMount=="function"&&(K.flags|=4194308),Le=!1)}else{Zt=K.stateNode,qn(J,K),Sn=K.memoizedProps,Bo=K.type===K.elementType?Sn:$e(K.type,Sn),Zt.props=Bo,zi=K.pendingProps,Gr=Zt.context,Qn=we.contextType,typeof Qn=="object"&&Qn!==null?Qn=Ln(Qn):(Qn=Jn(we)?$o:yo.current,Qn=mo(K,Qn));var pl=we.getDerivedStateFromProps;(zr=typeof pl=="function"||typeof Zt.getSnapshotBeforeUpdate=="function")||typeof Zt.UNSAFE_componentWillReceiveProps!="function"&&typeof Zt.componentWillReceiveProps!="function"||(Sn!==zi||Gr!==Qn)&&Ef(K,Zt,Le,Qn),Wn=!1,Gr=K.memoizedState,Zt.state=Gr,ya(K,Le,Zt,Ge);var _r=K.memoizedState;Sn!==zi||Gr!==_r||So.current||Wn?(typeof pl=="function"&&(Qu(K,we,pl,Le),_r=K.memoizedState),(Bo=Wn||Df(K,we,Bo,Le,Gr,_r,Qn)||!1)?(zr||typeof Zt.UNSAFE_componentWillUpdate!="function"&&typeof Zt.componentWillUpdate!="function"||(typeof Zt.componentWillUpdate=="function"&&Zt.componentWillUpdate(Le,_r,Qn),typeof Zt.UNSAFE_componentWillUpdate=="function"&&Zt.UNSAFE_componentWillUpdate(Le,_r,Qn)),typeof Zt.componentDidUpdate=="function"&&(K.flags|=4),typeof Zt.getSnapshotBeforeUpdate=="function"&&(K.flags|=1024)):(typeof Zt.componentDidUpdate!="function"||Sn===J.memoizedProps&&Gr===J.memoizedState||(K.flags|=4),typeof Zt.getSnapshotBeforeUpdate!="function"||Sn===J.memoizedProps&&Gr===J.memoizedState||(K.flags|=1024),K.memoizedProps=Le,K.memoizedState=_r),Zt.props=Le,Zt.state=_r,Zt.context=Qn,Le=Bo):(typeof Zt.componentDidUpdate!="function"||Sn===J.memoizedProps&&Gr===J.memoizedState||(K.flags|=4),typeof Zt.getSnapshotBeforeUpdate!="function"||Sn===J.memoizedProps&&Gr===J.memoizedState||(K.flags|=1024),Le=!1)}return NA(J,K,we,Le,pt,Ge)}function NA(J,K,we,Le,Ge,pt){l7(J,K);var Zt=(K.flags&128)!==0;if(!Le&&!Zt)return Ge&&Vr(K,we,!1),Mc(J,K,pt);Le=K.stateNode,mS.current=K;var Sn=Zt&&typeof we.getDerivedStateFromError!="function"?null:Le.render();return K.flags|=1,J!==null&&Zt?(K.child=Bd(K,J.child,null,pt),K.child=Bd(K,null,Sn,pt)):Us(J,K,Sn,pt),K.memoizedState=Le.state,Ge&&Vr(K,we,!0),K.child}function vS(J){var K=J.stateNode;K.pendingContext?ir(J,K.pendingContext,K.pendingContext!==K.context):K.context&&ir(J,K.context,!1),t7(J,K.containerInfo)}function xS(J,K,we,Le,Ge){return vy(),T3(Ge),K.flags|=256,Us(J,K,we,Le),K.child}var D3={dehydrated:null,treeContext:null,retryLane:0};function xu(J){return{baseLanes:J,cachePool:null}}function s7(J,K,we){var Le=K.pendingProps,Ge=vn.current,pt=!1,Zt=(K.flags&128)!==0,Sn;if((Sn=Zt)||(Sn=J!==null&&J.memoizedState===null?!1:(Ge&2)!==0),Sn?(pt=!0,K.flags&=-129):(J===null||J.memoizedState!==null)&&(Ge|=1),Hn(vn,Ge&1),J===null)return wy(K),J=K.memoizedState,J!==null&&(J=J.dehydrated,J!==null)?(K.mode&1?Rt(J)?K.lanes=8:K.lanes=1073741824:K.lanes=1,null):(Ge=Le.children,J=Le.fallback,pt?(Le=K.mode,pt=K.child,Ge={mode:"hidden",children:Ge},!(Le&1)&&pt!==null?(pt.childLanes=0,pt.pendingProps=Ge):pt=Ny(Ge,Le,0,null),J=lm(J,Le,we,null),pt.return=K,J.return=K,pt.sibling=J,K.child=pt,K.child.memoizedState=xu(we),K.memoizedState=D3,J):UA(K,Ge));if(Ge=J.memoizedState,Ge!==null){if(Sn=Ge.dehydrated,Sn!==null){if(Zt)return K.flags&256?(K.flags&=-257,BA(J,K,we,Error(a(422)))):K.memoizedState!==null?(K.child=J.child,K.flags|=128,null):(pt=Le.fallback,Ge=K.mode,Le=Ny({mode:"visible",children:Le.children},Ge,0,null),pt=lm(pt,Ge,we,null),pt.flags|=2,Le.return=K,pt.return=K,Le.sibling=pt,K.child=Le,K.mode&1&&Bd(K,J.child,null,we),K.child.memoizedState=xu(we),K.memoizedState=D3,pt);if(!(K.mode&1))K=BA(J,K,we,null);else if(Rt(Sn))K=BA(J,K,we,Error(a(419)));else if(Le=(we&J.childLanes)!==0,Od||Le){if(Le=zc,Le!==null){switch(we&-we){case 4:pt=2;break;case 16:pt=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:pt=32;break;case 536870912:pt=268435456;break;default:pt=0}Le=pt&(Le.suspendedLanes|we)?0:pt,Le!==0&&Le!==Ge.retryLane&&(Ge.retryLane=Le,sd(J,Le,-1))}W5(),K=BA(J,K,we,Error(a(421)))}else Pt(Sn)?(K.flags|=128,K.child=J.child,K=M1.bind(null,J),Ut(Sn,K),K=null):(we=Ge.treeContext,fe&&(ec=gt(Sn),Ls=K,xl=!0,il=null,_g=!1,we!==null&&(Gc[yu++]=A1,Gc[yu++]=V0,Gc[yu++]=y1,A1=we.id,V0=we.overflow,y1=K)),K=UA(K,K.pendingProps.children),K.flags|=4096);return K}return pt?(Le=c7(J,K,Le.children,Le.fallback,we),pt=K.child,Ge=J.child.memoizedState,pt.memoizedState=Ge===null?xu(we):{baseLanes:Ge.baseLanes|we,cachePool:null},pt.childLanes=J.childLanes&~we,K.memoizedState=D3,Le):(we=jA(J,K,Le.children,we),K.memoizedState=null,we)}return pt?(Le=c7(J,K,Le.children,Le.fallback,we),pt=K.child,Ge=J.child.memoizedState,pt.memoizedState=Ge===null?xu(we):{baseLanes:Ge.baseLanes|we,cachePool:null},pt.childLanes=J.childLanes&~we,K.memoizedState=D3,Le):(we=jA(J,K,Le.children,we),K.memoizedState=null,we)}function UA(J,K){return K=Ny({mode:"visible",children:K},J.mode,0,null),K.return=J,J.child=K}function jA(J,K,we,Le){var Ge=J.child;return J=Ge.sibling,we=Jd(Ge,{mode:"visible",children:we}),!(K.mode&1)&&(we.lanes=Le),we.return=K,we.sibling=null,J!==null&&(Le=K.deletions,Le===null?(K.deletions=[J],K.flags|=16):Le.push(J)),K.child=we}function c7(J,K,we,Le,Ge){var pt=K.mode;J=J.child;var Zt=J.sibling,Sn={mode:"hidden",children:we};return!(pt&1)&&K.child!==J?(we=K.child,we.childLanes=0,we.pendingProps=Sn,K.deletions=null):(we=Jd(J,Sn),we.subtreeFlags=J.subtreeFlags&14680064),Zt!==null?Le=Jd(Zt,Le):(Le=lm(Le,pt,Ge,null),Le.flags|=2),Le.return=K,we.return=K,we.sibling=Le,K.child=we,Le}function BA(J,K,we,Le){return Le!==null&&T3(Le),Bd(K,J.child,null,we),J=UA(K,K.pendingProps.children),J.flags|=2,K.memoizedState=null,J}function S1(J,K,we){J.lanes|=K;var Le=J.alternate;Le!==null&&(Le.lanes|=K),An(J.return,K,we)}function YA(J,K,we,Le,Ge){var pt=J.memoizedState;pt===null?J.memoizedState={isBackwards:K,rendering:null,renderingStartTime:0,last:Le,tail:we,tailMode:Ge}:(pt.isBackwards=K,pt.rendering=null,pt.renderingStartTime=0,pt.last=Le,pt.tail=we,pt.tailMode=Ge)}function u7(J,K,we){var Le=K.pendingProps,Ge=Le.revealOrder,pt=Le.tail;if(Us(J,K,Le.children,we),Le=vn.current,Le&2)Le=Le&1|2,K.flags|=128;else{if(J!==null&&J.flags&128)e:for(J=K.child;J!==null;){if(J.tag===13)J.memoizedState!==null&&S1(J,we,K);else if(J.tag===19)S1(J,we,K);else if(J.child!==null){J.child.return=J,J=J.child;continue}if(J===K)break e;for(;J.sibling===null;){if(J.return===null||J.return===K)break e;J=J.return}J.sibling.return=J.return,J=J.sibling}Le&=1}if(Hn(vn,Le),!(K.mode&1))K.memoizedState=null;else switch(Ge){case"forwards":for(we=K.child,Ge=null;we!==null;)J=we.alternate,J!==null&&io(J)===null&&(Ge=we),we=we.sibling;we=Ge,we===null?(Ge=K.child,K.child=null):(Ge=we.sibling,we.sibling=null),YA(K,!1,Ge,we,pt);break;case"backwards":for(we=null,Ge=K.child,K.child=null;Ge!==null;){if(J=Ge.alternate,J!==null&&io(J)===null){K.child=Ge;break}J=Ge.sibling,Ge.sibling=we,we=Ge,Ge=J}YA(K,!0,we,null,pt);break;case"together":YA(K,!1,null,null,void 0);break;default:K.memoizedState=null}return K.child}function Mc(J,K,we){if(J!==null&&(K.dependencies=J.dependencies),ld|=K.lanes,!(we&K.childLanes))return null;if(J!==null&&K.child!==J.child)throw Error(a(153));if(K.child!==null){for(J=K.child,we=Jd(J,J.pendingProps),K.child=we,we.return=K;J.sibling!==null;)J=J.sibling,we=we.sibling=Jd(J,J.pendingProps),we.return=K;we.sibling=null}return K.child}function OA(J,K,we){switch(K.tag){case 3:vS(K),vy();break;case 5:pS(K);break;case 1:Jn(K.type)&&br(K);break;case 4:t7(K,K.stateNode.containerInfo);break;case 10:sn(K,K.type._context,K.memoizedProps.value);break;case 13:var Le=K.memoizedState;if(Le!==null)return Le.dehydrated!==null?(Hn(vn,vn.current&1),K.flags|=128,null):we&K.child.childLanes?s7(J,K,we):(Hn(vn,vn.current&1),J=Mc(J,K,we),J!==null?J.sibling:null);Hn(vn,vn.current&1);break;case 19:if(Le=(we&K.childLanes)!==0,J.flags&128){if(Le)return u7(J,K,we);K.flags|=128}var Ge=K.memoizedState;if(Ge!==null&&(Ge.rendering=null,Ge.tail=null,Ge.lastEffect=null),Hn(vn,vn.current),Le)break;return null;case 22:case 23:return K.lanes=0,a7(J,K,we)}return Mc(J,K,we)}function jM(J,K){switch(Au(K),K.tag){case 1:return Jn(K.type)&&uo(),J=K.flags,J&65536?(K.flags=J&-65537|128,K):null;case 3:return Sy(),mn(So),mn(yo),Sr(),J=K.flags,J&65536&&!(J&128)?(K.flags=J&-65537|128,K):null;case 5:return bp(K),null;case 13:if(mn(vn),J=K.memoizedState,J!==null&&J.dehydrated!==null){if(K.alternate===null)throw Error(a(340));vy()}return J=K.flags,J&65536?(K.flags=J&-65537|128,K):null;case 19:return mn(vn),null;case 4:return Sy(),null;case 10:return yn(K.type._context),null;case 22:case 23:return B3(),null;case 24:return null;default:return null}}var qg=!1,Cy=!1,BM=typeof WeakSet=="function"?WeakSet:Set,Ar=null;function $g(J,K){var we=J.ref;if(we!==null)if(typeof we=="function")try{we(null)}catch(Le){$0(J,K,Le)}else we.current=null}function H5(J,K,we){try{we()}catch(Le){$0(J,K,Le)}}var d7=!1;function _A(J,K){for(U(J.containerInfo),Ar=K;Ar!==null;)if(J=Ar,K=J.child,(J.subtreeFlags&1028)!==0&&K!==null)K.return=J,Ar=K;else for(;Ar!==null;){J=Ar;try{var we=J.alternate;if(J.flags&1024)switch(J.tag){case 0:case 11:case 15:break;case 1:if(we!==null){var Le=we.memoizedProps,Ge=we.memoizedState,pt=J.stateNode,Zt=pt.getSnapshotBeforeUpdate(J.elementType===J.type?Le:$e(J.type,Le),Ge);pt.__reactInternalSnapshotBeforeUpdate=Zt}break;case 3:se&&yt(J.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(Sn){$0(J,J.return,Sn)}if(K=J.sibling,K!==null){K.return=J.return,Ar=K;break}Ar=J.return}return we=d7,d7=!1,we}function rd(J,K,we){var Le=K.updateQueue;if(Le=Le!==null?Le.lastEffect:null,Le!==null){var Ge=Le=Le.next;do{if((Ge.tag&J)===J){var pt=Ge.destroy;Ge.destroy=void 0,pt!==void 0&&H5(K,we,pt)}Ge=Ge.next}while(Ge!==Le)}}function Tp(J,K){if(K=K.updateQueue,K=K!==null?K.lastEffect:null,K!==null){var we=K=K.next;do{if((we.tag&J)===J){var Le=we.create;we.destroy=Le()}we=we.next}while(we!==K)}}function E3(J){var K=J.ref;if(K!==null){var we=J.stateNode;switch(J.tag){case 5:J=k(we);break;default:J=we}typeof K=="function"?K(J):K.current=J}}function VA(J,K,we){if(Zs&&typeof Zs.onCommitFiberUnmount=="function")try{Zs.onCommitFiberUnmount(ks,K)}catch{}switch(K.tag){case 0:case 11:case 14:case 15:if(J=K.updateQueue,J!==null&&(J=J.lastEffect,J!==null)){var Le=J=J.next;do{var Ge=Le,pt=Ge.destroy;Ge=Ge.tag,pt!==void 0&&(Ge&2||Ge&4)&&H5(K,we,pt),Le=Le.next}while(Le!==J)}break;case 1:if($g(K,we),J=K.stateNode,typeof J.componentWillUnmount=="function")try{J.props=K.memoizedProps,J.state=K.memoizedState,J.componentWillUnmount()}catch(Zt){$0(K,we,Zt)}break;case 5:$g(K,we);break;case 4:se?JA(J,K,we):ne&&ne&&(K=K.stateNode.containerInfo,we=Xe(K),ot(K,we))}}function GA(J,K,we){for(var Le=K;;)if(VA(J,Le,we),Le.child===null||se&&Le.tag===4){if(Le===K)break;for(;Le.sibling===null;){if(Le.return===null||Le.return===K)return;Le=Le.return}Le.sibling.return=Le.return,Le=Le.sibling}else Le.child.return=Le,Le=Le.child}function Fh(J){var K=J.alternate;K!==null&&(J.alternate=null,Fh(K)),J.child=null,J.deletions=null,J.sibling=null,J.tag===5&&(K=J.stateNode,K!==null&&he(K)),J.stateNode=null,J.return=null,J.dependencies=null,J.memoizedProps=null,J.memoizedState=null,J.pendingProps=null,J.stateNode=null,J.updateQueue=null}function M5(J){return J.tag===5||J.tag===3||J.tag===4}function v0(J){e:for(;;){for(;J.sibling===null;){if(J.return===null||M5(J.return))return null;J=J.return}for(J.sibling.return=J.return,J=J.sibling;J.tag!==5&&J.tag!==6&&J.tag!==18;){if(J.flags&2||J.child===null||J.tag===4)continue e;J.child.return=J,J=J.child}if(!(J.flags&2))return J.stateNode}}function id(J){if(se){e:{for(var K=J.return;K!==null;){if(M5(K))break e;K=K.return}throw Error(a(160))}var we=K;switch(we.tag){case 5:K=we.stateNode,we.flags&32&&(De(K),we.flags&=-33),we=v0(J),F3(J,we,K);break;case 3:case 4:K=we.stateNode.containerInfo,we=v0(J),XA(J,we,K);break;default:throw Error(a(161))}}}function XA(J,K,we){var Le=J.tag;if(Le===5||Le===6)J=J.stateNode,K?We(we,J,K):Me(we,J);else if(Le!==4&&(J=J.child,J!==null))for(XA(J,K,we),J=J.sibling;J!==null;)XA(J,K,we),J=J.sibling}function F3(J,K,we){var Le=J.tag;if(Le===5||Le===6)J=J.stateNode,K?Je(we,J,K):Te(we,J);else if(Le!==4&&(J=J.child,J!==null))for(F3(J,K,we),J=J.sibling;J!==null;)F3(J,K,we),J=J.sibling}function JA(J,K,we){for(var Le=K,Ge=!1,pt,Zt;;){if(!Ge){Ge=Le.return;e:for(;;){if(Ge===null)throw Error(a(160));switch(pt=Ge.stateNode,Ge.tag){case 5:Zt=!1;break e;case 3:pt=pt.containerInfo,Zt=!0;break e;case 4:pt=pt.containerInfo,Zt=!0;break e}Ge=Ge.return}Ge=!0}if(Le.tag===5||Le.tag===6)GA(J,Le,we),Zt?Ne(pt,Le.stateNode):Ke(pt,Le.stateNode);else if(Le.tag===18)Zt?mt(pt,Le.stateNode):rt(pt,Le.stateNode);else if(Le.tag===4){if(Le.child!==null){pt=Le.stateNode.containerInfo,Zt=!0,Le.child.return=Le,Le=Le.child;continue}}else if(VA(J,Le,we),Le.child!==null){Le.child.return=Le,Le=Le.child;continue}if(Le===K)break;for(;Le.sibling===null;){if(Le.return===null||Le.return===K)return;Le=Le.return,Le.tag===4&&(Ge=!1)}Le.sibling.return=Le.return,Le=Le.sibling}}function Qg(J,K){if(se){switch(K.tag){case 0:case 11:case 14:case 15:rd(3,K,K.return),Tp(3,K),rd(5,K,K.return);return;case 1:return;case 5:var we=K.stateNode;if(we!=null){var Le=K.memoizedProps;J=J!==null?J.memoizedProps:Le;var Ge=K.type,pt=K.updateQueue;K.updateQueue=null,pt!==null&&Be(we,pt,Ge,J,Le,K)}return;case 6:if(K.stateNode===null)throw Error(a(162));we=K.memoizedProps,Pe(K.stateNode,J!==null?J.memoizedProps:we,we);return;case 3:fe&&J!==null&&J.memoizedState.isDehydrated&&qe(K.stateNode.containerInfo);return;case 12:return;case 13:ad(K);return;case 19:ad(K);return;case 17:return}throw Error(a(163))}switch(K.tag){case 0:case 11:case 14:case 15:rd(3,K,K.return),Tp(3,K),rd(5,K,K.return);return;case 12:return;case 13:ad(K);return;case 19:ad(K);return;case 3:fe&&J!==null&&J.memoizedState.isDehydrated&&qe(K.stateNode.containerInfo);break;case 22:case 23:return}e:if(ne){switch(K.tag){case 1:case 5:case 6:break e;case 3:case 4:K=K.stateNode,ot(K.containerInfo,K.pendingChildren);break e}throw Error(a(163))}}function ad(J){var K=J.updateQueue;if(K!==null){J.updateQueue=null;var we=J.stateNode;we===null&&(we=J.stateNode=new BM),K.forEach(function(Le){var Ge=Y3.bind(null,J,Le);we.has(Le)||(we.add(Le),Le.then(Ge,Ge))})}}function I5(J,K){for(Ar=K;Ar!==null;){K=Ar;var we=K.deletions;if(we!==null)for(var Le=0;Le";case _d:return":has("+(E5(J)||"")+")";case bu:return'[role="'+J.value+'"]';case Vd:return'"'+J.value+'"';case D5:return'[data-testname="'+J.value+'"]';default:throw Error(a(365))}}function Zg(J,K){var we=[];J=[J,0];for(var Le=0;LeGe&&(Ge=Zt),Le&=~pt}if(Le=Ge,Le=or()-Le,Le=(120>Le?120:480>Le?480:1080>Le?1080:1920>Le?1920:3e3>Le?3e3:4320>Le?4320:1960*Hy(Le/1960))-Le,10J?16:J,Xd===null)var Le=!1;else{if(J=Xd,Xd=null,k5=0,Ci&6)throw Error(a(331));var Ge=Ci;for(Ci|=4,Ar=J.current;Ar!==null;){var pt=Ar,Zt=pt.child;if(Ar.flags&16){var Sn=pt.deletions;if(Sn!==null){for(var Qn=0;Qnor()-$A?oc(J,0):L3|=we),Zr(J,K)}function p7(J,K){K===0&&(J.mode&1?(K=eo,eo<<=1,!(eo&130023424)&&(eo=4194304)):K=1);var we=x0();J=nm(J,K),J!==null&&(fr(J,K,we),Zr(J,we))}function M1(J){var K=J.memoizedState,we=0;K!==null&&(we=K.retryLane),p7(J,we)}function Y3(J,K){var we=0;switch(J.tag){case 13:var Le=J.stateNode,Ge=J.memoizedState;Ge!==null&&(we=Ge.retryLane);break;case 19:Le=J.stateNode;break;default:throw Error(a(314))}Le!==null&&Le.delete(K),p7(J,we)}var e4;e4=function(J,K,we){if(J!==null)if(J.memoizedProps!==K.pendingProps||So.current)Od=!0;else{if(!(J.lanes&we)&&!(K.flags&128))return Od=!1,OA(J,K,we);Od=!!(J.flags&131072)}else Od=!1,xl&&K.flags&1048576&&Og(K,Ay,K.index);switch(K.lanes=0,K.tag){case 2:var Le=K.type;J!==null&&(J.alternate=null,K.alternate=null,K.flags|=2),J=K.pendingProps;var Ge=mo(K,yo.current);bn(K,we),Ge=Ya(null,K,Le,J,Ge,we);var pt=R3();return K.flags|=1,typeof Ge=="object"&&Ge!==null&&typeof Ge.render=="function"&&Ge.$$typeof===void 0?(K.tag=1,K.memoizedState=null,K.updateQueue=null,Jn(Le)?(pt=!0,br(K)):pt=!1,K.memoizedState=Ge.state!==null&&Ge.state!==void 0?Ge.state:null,oo(K),Ge.updater=Rh,K.stateNode=Ge,Ge._reactInternals=K,Xl(K,Le,J,we),K=NA(null,K,Le,!0,pt,we)):(K.tag=0,xl&&pt&&b3(K),Us(null,K,Ge,we),K=K.child),K;case 16:Le=K.elementType;e:{switch(J!==null&&(J.alternate=null,K.alternate=null,K.flags|=2),J=K.pendingProps,Ge=Le._init,Le=Ge(Le._payload),K.type=Le,Ge=K.tag=am(Le),J=$e(Le,J),Ge){case 0:K=Eh(null,K,Le,J,we);break e;case 1:K=wS(null,K,Le,J,we);break e;case 11:K=yS(null,K,Le,J,we);break e;case 14:K=AS(null,K,Le,$e(Le.type,J),we);break e}throw Error(a(306,Le,""))}return K;case 0:return Le=K.type,Ge=K.pendingProps,Ge=K.elementType===Le?Ge:$e(Le,Ge),Eh(J,K,Le,Ge,we);case 1:return Le=K.type,Ge=K.pendingProps,Ge=K.elementType===Le?Ge:$e(Le,Ge),wS(J,K,Le,Ge,we);case 3:e:{if(vS(K),J===null)throw Error(a(387));Le=K.pendingProps,pt=K.memoizedState,Ge=pt.element,qn(J,K),ya(K,Le,null,we);var Zt=K.memoizedState;if(Le=Zt.element,fe&&pt.isDehydrated)if(pt={element:Le,isDehydrated:!1,cache:Zt.cache,transitions:Zt.transitions},K.updateQueue.baseState=pt,K.memoizedState=pt,K.flags&256){Ge=Error(a(423)),K=xS(J,K,Le,we,Ge);break e}else if(Le!==Ge){Ge=Error(a(424)),K=xS(J,K,Le,we,Ge);break e}else for(fe&&(ec=kt(K.stateNode.containerInfo),Ls=K,xl=!0,il=null,_g=!1),we=e7(K,null,Le,we),K.child=we;we;)we.flags=we.flags&-3|4096,we=we.sibling;else{if(vy(),Le===Ge){K=Mc(J,K,we);break e}Us(J,K,Le,we)}K=K.child}return K;case 5:return pS(K),J===null&&wy(K),Le=K.type,Ge=K.pendingProps,pt=J!==null?J.memoizedProps:null,Zt=Ge.children,Q(Le,Ge)?Zt=null:pt!==null&&Q(Le,pt)&&(K.flags|=32),l7(J,K),Us(J,K,Zt,we),K.child;case 6:return J===null&&wy(K),null;case 13:return s7(J,K,we);case 4:return t7(K,K.stateNode.containerInfo),Le=K.pendingProps,J===null?K.child=Bd(K,null,Le,we):Us(J,K,Le,we),K.child;case 11:return Le=K.type,Ge=K.pendingProps,Ge=K.elementType===Le?Ge:$e(Le,Ge),yS(J,K,Le,Ge,we);case 7:return Us(J,K,K.pendingProps,we),K.child;case 8:return Us(J,K,K.pendingProps.children,we),K.child;case 12:return Us(J,K,K.pendingProps.children,we),K.child;case 10:e:{if(Le=K.type._context,Ge=K.pendingProps,pt=K.memoizedProps,Zt=Ge.value,sn(K,Le,Zt),pt!==null)if(Bl(pt.value,Zt)){if(pt.children===Ge.children&&!So.current){K=Mc(J,K,we);break e}}else for(pt=K.child,pt!==null&&(pt.return=K);pt!==null;){var Sn=pt.dependencies;if(Sn!==null){Zt=pt.child;for(var Qn=Sn.firstContext;Qn!==null;){if(Qn.context===Le){if(pt.tag===1){Qn=Ko(-1,we&-we),Qn.tag=2;var Bo=pt.updateQueue;if(Bo!==null){Bo=Bo.shared;var zr=Bo.pending;zr===null?Qn.next=Qn:(Qn.next=zr.next,zr.next=Qn),Bo.pending=Qn}}pt.lanes|=we,Qn=pt.alternate,Qn!==null&&(Qn.lanes|=we),An(pt.return,we,K),Sn.lanes|=we;break}Qn=Qn.next}}else if(pt.tag===10)Zt=pt.type===K.type?null:pt.child;else if(pt.tag===18){if(Zt=pt.return,Zt===null)throw Error(a(341));Zt.lanes|=we,Sn=Zt.alternate,Sn!==null&&(Sn.lanes|=we),An(Zt,we,K),Zt=pt.sibling}else Zt=pt.child;if(Zt!==null)Zt.return=pt;else for(Zt=pt;Zt!==null;){if(Zt===K){Zt=null;break}if(pt=Zt.sibling,pt!==null){pt.return=Zt.return,Zt=pt;break}Zt=Zt.return}pt=Zt}Us(J,K,Ge.children,we),K=K.child}return K;case 9:return Ge=K.type,Le=K.pendingProps.children,bn(K,we),Ge=Ln(Ge),Le=Le(Ge),K.flags|=1,Us(J,K,Le,we),K.child;case 14:return Le=K.type,Ge=$e(Le,K.pendingProps),Ge=$e(Le.type,Ge),AS(J,K,Le,Ge,we);case 15:return WA(J,K,K.type,K.pendingProps,we);case 17:return Le=K.type,Ge=K.pendingProps,Ge=K.elementType===Le?Ge:$e(Le,Ge),J!==null&&(J.alternate=null,K.alternate=null,K.flags|=2),K.tag=1,Jn(Le)?(J=!0,br(K)):J=!1,bn(K,we),Zu(K,Le,Ge),Xl(K,Le,Ge,we),NA(null,K,Le,!0,J,we);case 19:return u7(J,K,we);case 22:return a7(J,K,we)}throw Error(a(156,K.tag))};function im(J,K){return Eo(J,K)}function t4(J,K,we,Le){this.tag=J,this.key=we,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=K,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=Le,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Uf(J,K,we,Le){return new t4(J,K,we,Le)}function kh(J){return J=J.prototype,!(!J||!J.isReactComponent)}function am(J){if(typeof J=="function")return kh(J)?1:0;if(J!=null){if(J=J.$$typeof,J===y)return 11;if(J===C)return 14}return 2}function Jd(J,K){var we=J.alternate;return we===null?(we=Uf(J.tag,K,J.key,J.mode),we.elementType=J.elementType,we.type=J.type,we.stateNode=J.stateNode,we.alternate=J,J.alternate=we):(we.pendingProps=K,we.type=J.type,we.flags=0,we.subtreeFlags=0,we.deletions=null),we.flags=J.flags&14680064,we.childLanes=J.childLanes,we.lanes=J.lanes,we.child=J.child,we.memoizedProps=J.memoizedProps,we.memoizedState=J.memoizedState,we.updateQueue=J.updateQueue,K=J.dependencies,we.dependencies=K===null?null:{lanes:K.lanes,firstContext:K.firstContext},we.sibling=J.sibling,we.index=J.index,we.ref=J.ref,we}function Wy(J,K,we,Le,Ge,pt){var Zt=2;if(Le=J,typeof J=="function")kh(J)&&(Zt=1);else if(typeof J=="string")Zt=5;else e:switch(J){case u:return lm(we.children,Ge,pt,K);case d:Zt=8,Ge|=8;break;case f:return J=Uf(12,we,K,Ge|2),J.elementType=f,J.lanes=pt,J;case w:return J=Uf(13,we,K,Ge),J.elementType=w,J.lanes=pt,J;case b:return J=Uf(19,we,K,Ge),J.elementType=b,J.lanes=pt,J;case v:return Ny(we,Ge,pt,K);default:if(typeof J=="object"&&J!==null)switch(J.$$typeof){case p:Zt=10;break e;case g:Zt=9;break e;case y:Zt=11;break e;case C:Zt=14;break e;case P:Zt=16,Le=null;break e}throw Error(a(130,J==null?J:typeof J,""))}return K=Uf(Zt,we,K,Ge),K.elementType=J,K.type=Le,K.lanes=pt,K}function lm(J,K,we,Le){return J=Uf(7,J,Le,K),J.lanes=we,J}function Ny(J,K,we,Le){return J=Uf(22,J,Le,K),J.elementType=v,J.lanes=we,J.stateNode={},J}function S0(J,K,we){return J=Uf(6,J,null,K),J.lanes=we,J}function Kd(J,K,we){return K=Uf(4,J.children!==null?J.children:[],J.key,K),K.lanes=we,K.stateNode={containerInfo:J.containerInfo,pendingChildren:null,implementation:J.implementation},K}function n4(J,K,we,Le,Ge){this.tag=K,this.containerInfo=J,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=re,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=lr(0),this.expirationTimes=lr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lr(0),this.identifierPrefix=Le,this.onRecoverableError=Ge,fe&&(this.mutableSourceEagerHydrationData=null)}function U5(J,K,we,Le,Ge,pt,Zt,Sn,Qn){return J=new n4(J,K,we,Sn,Qn),K===1?(K=1,pt===!0&&(K|=8)):K=0,pt=Uf(3,null,null,K),J.current=pt,pt.stateNode=J,pt.memoizedState={element:Le,isDehydrated:we,cache:null,transitions:null},oo(pt),J}function j5(J){if(!J)return Fo;J=J._reactInternals;e:{if(R(J)!==J||J.tag!==1)throw Error(a(170));var K=J;do{switch(K.tag){case 3:K=K.stateNode.context;break e;case 1:if(Jn(K.type)){K=K.stateNode.__reactInternalMemoizedMergedChildContext;break e}}K=K.return}while(K!==null);throw Error(a(171))}if(J.tag===1){var we=J.type;if(Jn(we))return Rr(J,we,K)}return K}function Rp(J){var K=J._reactInternals;if(K===void 0)throw typeof J.render=="function"?Error(a(188)):(J=Object.keys(J).join(","),Error(a(268,J)));return J=E(K),J===null?null:J.stateNode}function O3(J,K){if(J=J.memoizedState,J!==null&&J.dehydrated!==null){var we=J.retryLane;J.retryLane=we!==0&&we=Bo&&pt>=zi&&Ge<=zr&&Zt<=Gr){J.splice(K,1);break}else if(Le!==Bo||we.width!==Qn.width||GrZt){if(!(pt!==zi||we.height!==Qn.height||zrGe)){Bo>Le&&(Qn.width+=Bo-Le,Qn.x=Le),zrpt&&(Qn.height+=zi-pt,Qn.y=pt),Grwe&&(we=Zt)),Zt ")+` No matching component was found for: - `)+J.join(" > ")}return null},n.getPublicRootInstance=function(J){if(J=J.current,!J.child)return null;switch(J.child.tag){case 5:return k(J.child.stateNode);default:return J.child.stateNode}},n.injectIntoDevTools=function(J){if(J={bundleType:J.bundleType,version:J.version,rendererPackageName:J.rendererPackageName,rendererConfig:J.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:YM,findFiberByHostInstance:J.findFiberByHostInstance||_3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")J=!1;else{var K=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(K.isDisabled||!K.supportsFiber)J=!0;else{try{ks=K.inject(J),Zs=K}catch{}J=!!K.checkDCE}}return J},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(J,K,we,Le){if(!Se)throw Error(a(363));J=qA(J,K);var Ge=Ae(J,we,Le).disconnect;return{disconnect:function(){Ge()}}},n.registerMutableSourceForHydration=function(J,K){var we=K._getVersion;we=we(K._source),J.mutableSourceEagerHydrationData==null?J.mutableSourceEagerHydrationData=[K,we]:J.mutableSourceEagerHydrationData.push(K,we)},n.runWithPriority=function(J,K){var we=tr;try{return tr=J,K()}finally{tr=we}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(J,K,we,Le){var Ge=K.current,pt=x0(),Zt=Wf(Ge);return we=j5(we),K.context===null?K.context=we:K.pendingContext=we,K=Ko(pt,Zt),K.payload={element:J},Le=Le===void 0?null:Le,Le!==null&&(K.callback=Le),li(Ge,K),J=sd(Ge,Zt,pt),J!==null&&$i(J,Ge,Zt),Zt},n};CUe.exports=S3t;var T3t=CUe.exports;const P3t=Fi(T3t),C3t=t=>typeof t=="object"&&typeof t.then=="function",Ev=[];function MUe(t,e,n=(o,r)=>o===r){if(t===e)return!0;if(!t||!e)return!1;const o=t.length;if(e.length!==o)return!1;for(let r=0;r0&&(i.timeout&&clearTimeout(i.timeout),i.timeout=setTimeout(i.remove,o.lifespan)),i.response;if(!n)throw i.promise}const r={keys:e,equal:o.equal,remove:()=>{const i=Ev.indexOf(r);i!==-1&&Ev.splice(i,1)},promise:(C3t(t)?t:t(...e)).then(i=>{r.response=i,o.lifespan&&o.lifespan>0&&(r.timeout=setTimeout(r.remove,o.lifespan))}).catch(i=>r.error=i)};if(Ev.push(r),!n)throw r.promise}const zUe=(t,e,n)=>IUe(t,e,!1,n),R3t=(t,e,n)=>void IUe(t,e,!0,n),H3t=t=>{if(t===void 0||t.length===0)Ev.splice(0,Ev.length);else{const e=Ev.find(n=>MUe(t,n.keys,n.equal));e&&e.remove()}},sge={},xb=t=>void Object.assign(sge,t);function M3t(t,e){function n(u,{args:d=[],attach:f,...p},g){let y=`${u[0].toUpperCase()}${u.slice(1)}`,w;if(u==="primitive"){if(p.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const b=p.object;w=oP(b,{type:u,root:g,attach:f,primitive:!0})}else{const b=sge[y];if(!b)throw new Error(`R3F: ${y} 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(d))throw new Error("R3F: The args prop must be an array!");w=oP(new b(...d),{type:u,root:g,attach:f,memoizedProps:{args:d}})}return w.__r3f.attach===void 0&&(w instanceof Ni?w.__r3f.attach="geometry":w instanceof Pf&&(w.__r3f.attach="material")),y!=="inject"&&are(w,p),w}function o(u,d){let f=!1;if(d){var p,g;(p=d.__r3f)!=null&&p.attach?ire(u,d,d.__r3f.attach):d.isObject3D&&u.isObject3D&&(u.add(d),f=!0),f||(g=u.__r3f)==null||g.objects.push(d),d.__r3f||oP(d,{}),d.__r3f.parent=u,Ice(d),rP(d)}}function r(u,d,f){let p=!1;if(d){var g,y;if((g=d.__r3f)!=null&&g.attach)ire(u,d,d.__r3f.attach);else if(d.isObject3D&&u.isObject3D){d.parent=u,d.dispatchEvent({type:"added"});const w=u.children.filter(C=>C!==d),b=w.indexOf(f);u.children=[...w.slice(0,b),d,...w.slice(b)],p=!0}p||(y=u.__r3f)==null||y.objects.push(d),d.__r3f||oP(d,{}),d.__r3f.parent=u,Ice(d),rP(d)}}function i(u,d,f=!1){u&&[...u].forEach(p=>a(d,p,f))}function a(u,d,f){if(d){var p,g,y;if(d.__r3f&&(d.__r3f.parent=null),(p=u.__r3f)!=null&&p.objects&&(u.__r3f.objects=u.__r3f.objects.filter(v=>v!==d)),(g=d.__r3f)!=null&&g.attach)Y8e(u,d,d.__r3f.attach);else if(d.isObject3D&&u.isObject3D){var w;u.remove(d),(w=d.__r3f)!=null&&w.root&&N3t(d.__r3f.root,d)}const C=(y=d.__r3f)==null?void 0:y.primitive,P=f===void 0?d.dispose!==null&&!C:f;if(!C){var b;i((b=d.__r3f)==null?void 0:b.objects,d,P),i(d.children,d,P)}delete d.__r3f,P&&d.dispose&&d.type!=="Scene"&&Hce.unstable_scheduleCallback(Hce.unstable_IdlePriority,()=>{try{d.dispose()}catch{}}),rP(u)}}function l(u,d,f,p){var g;const y=(g=u.__r3f)==null?void 0:g.parent;if(!y)return;const w=n(d,f,u.__r3f.root);if(u.children){for(const b of u.children)b.__r3f&&o(w,b);u.children=u.children.filter(b=>!b.__r3f)}u.__r3f.objects.forEach(b=>o(w,b)),u.__r3f.objects=[],u.__r3f.autoRemovedBeforeAppend||a(y,u),w.parent&&(w.__r3f.autoRemovedBeforeAppend=!0),o(y,w),w.raycast&&w.__r3f.eventCount&&w.__r3f.root.getState().internal.interaction.push(w),[p,p.alternate].forEach(b=>{b!==null&&(b.stateNode=w,b.ref&&(typeof b.ref=="function"?b.ref(w):b.ref.current=w))})}const s=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:P3t({createInstance:n,removeChild:a,appendChild:o,appendInitialChild:o,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(u,d)=>{if(!d)return;const f=u.getState().scene;f.__r3f&&(f.__r3f.root=u,o(f,d))},removeChildFromContainer:(u,d)=>{d&&a(u.getState().scene,d)},insertInContainerBefore:(u,d,f)=>{if(!d||!f)return;const p=u.getState().scene;p.__r3f&&r(p,d,f)},getRootHostContext:()=>null,getChildHostContext:u=>u,finalizeInitialChildren(u){var d;return!!((d=u==null?void 0:u.__r3f)!=null?d:{}).handlers},prepareUpdate(u,d,f,p){var g;if(((g=u==null?void 0:u.__r3f)!=null?g:{}).primitive&&p.object&&p.object!==u)return[!0];{const{args:w=[],children:b,...C}=p,{args:P=[],children:v,...T}=f;if(!Array.isArray(w))throw new Error("R3F: the args prop must be an array!");if(w.some((x,S)=>x!==P[S]))return[!0];const A=NUe(u,C,T,!0);return A.changes.length?[!1,A]:null}},commitUpdate(u,[d,f],p,g,y,w){d?l(u,p,y,w):are(u,f)},commitMount(u,d,f,p){var g;const y=(g=u.__r3f)!=null?g:{};u.raycast&&y.handlers&&y.eventCount&&u.__r3f.root.getState().internal.interaction.push(u)},getPublicInstance:u=>u,prepareForCommit:()=>null,preparePortalMount:u=>oP(u.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(u){var d;const{attach:f,parent:p}=(d=u.__r3f)!=null?d:{};f&&p&&Y8e(p,u,f),u.isObject3D&&(u.visible=!1),rP(u)},unhideInstance(u,d){var f;const{attach:p,parent:g}=(f=u.__r3f)!=null?f:{};p&&g&&ire(g,u,p),(u.isObject3D&&d.visible==null||d.visible)&&(u.visible=!0),rP(u)},createTextInstance:s,hideTextInstance:s,unhideTextInstance:s,getCurrentEventPriority:()=>e?e():KP.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&pc.fun(performance.now)?performance.now:pc.fun(Date.now)?Date.now:()=>0,scheduleTimeout:pc.fun(setTimeout)?setTimeout:void 0,cancelTimeout:pc.fun(clearTimeout)?clearTimeout:void 0}),applyProps:are}}var N8e,U8e;const rre=t=>"colorSpace"in t||"outputColorSpace"in t,DUe=()=>{var t;return(t=sge.ColorManagement)!=null?t:null},EUe=t=>t&&t.isOrthographicCamera,I3t=t=>t&&t.hasOwnProperty("current"),aW=typeof window<"u"&&((N8e=window.document)!=null&&N8e.createElement||((U8e=window.navigator)==null?void 0:U8e.product)==="ReactNative")?m.useLayoutEffect:m.useEffect;function FUe(t){const e=m.useRef(t);return aW(()=>void(e.current=t),[t]),e}function z3t({set:t}){return aW(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}class kUe extends m.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}kUe.getDerivedStateFromError=()=>({error:!0});const LUe="__default",j8e=new Map,D3t=t=>t&&!!t.memoized&&!!t.changes;function WUe(t){var e;const n=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(t)?Math.min(Math.max(t[0],n),t[1]):t}const Pz=t=>{var e;return(e=t.__r3f)==null?void 0:e.root.getState()},pc={obj:t=>t===Object(t)&&!pc.arr(t)&&typeof t!="function",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",boo:t=>typeof t=="boolean",und:t=>t===void 0,arr:t=>Array.isArray(t),equ(t,e,{arrays:n="shallow",objects:o="reference",strict:r=!0}={}){if(typeof t!=typeof e||!!t!=!!e)return!1;if(pc.str(t)||pc.num(t))return t===e;const i=pc.obj(t);if(i&&o==="reference")return t===e;const a=pc.arr(t);if(a&&n==="reference")return t===e;if((a||i)&&t===e)return!0;let l;for(l in t)if(!(l in e))return!1;if(i&&n==="shallow"&&o==="shallow"){for(l in r?e:t)if(!pc.equ(t[l],e[l],{strict:r,objects:"reference"}))return!1}else for(l in r?e:t)if(t[l]!==e[l])return!1;if(pc.und(l)){if(a&&t.length===0&&e.length===0||i&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}};function E3t(t){const e={nodes:{},materials:{}};return t&&t.traverse(n=>{n.name&&(e.nodes[n.name]=n),n.material&&!e.materials[n.material.name]&&(e.materials[n.material.name]=n.material)}),e}function F3t(t){t.dispose&&t.type!=="Scene"&&t.dispose();for(const e in t)e.dispose==null||e.dispose(),delete t[e]}function oP(t,e){const n=t;return n.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},t}function Mce(t,e){let n=t;if(e.includes("-")){const o=e.split("-"),r=o.pop();return n=o.reduce((i,a)=>i[a],t),{target:n,key:r}}else return{target:n,key:e}}const B8e=/-\d+$/;function ire(t,e,n){if(pc.str(n)){if(B8e.test(n)){const i=n.replace(B8e,""),{target:a,key:l}=Mce(t,i);Array.isArray(a[l])||(a[l]=[])}const{target:o,key:r}=Mce(t,n);e.__r3f.previousAttach=o[r],o[r]=e}else e.__r3f.previousAttach=n(t,e)}function Y8e(t,e,n){var o,r;if(pc.str(n)){const{target:i,key:a}=Mce(t,n),l=e.__r3f.previousAttach;l===void 0?delete i[a]:i[a]=l}else(o=e.__r3f)==null||o.previousAttach==null||o.previousAttach(t,e);(r=e.__r3f)==null||delete r.previousAttach}function NUe(t,{children:e,key:n,ref:o,...r},{children:i,key:a,ref:l,...s}={},c=!1){var u;const d=(u=t==null?void 0:t.__r3f)!=null?u:{},f=Object.entries(r),p=[];if(c){const y=Object.keys(s);for(let w=0;w{var b;if((b=t.__r3f)!=null&&b.primitive&&y==="object"||pc.equ(w,s[y]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(y))return p.push([y,w,!0,[]]);let C=[];y.includes("-")&&(C=y.split("-")),p.push([y,w,!1,C]);for(const P in r){const v=r[P];P.startsWith(`${y}-`)&&p.push([P,v,!1,P.split("-")])}});const g={...r};return d.memoizedProps&&d.memoizedProps.args&&(g.args=d.memoizedProps.args),d.memoizedProps&&d.memoizedProps.attach&&(g.attach=d.memoizedProps.attach),{memoized:g,changes:p}}const k3t=typeof process<"u"&&!1;function are(t,e){var n,o,r;const i=(n=t.__r3f)!=null?n:{},a=i.root,l=(o=a==null||a.getState==null?void 0:a.getState())!=null?o:{},{memoized:s,changes:c}=D3t(e)?e:NUe(t,e),u=i.eventCount;t.__r3f&&(t.__r3f.memoizedProps=s);for(let f=0;fP[v],t),!(C&&C.set))){const[P,...v]=w.reverse();b=v.reverse().reduce((T,A)=>T[A],t),p=P}if(g===LUe+"remove")if(b.constructor){let P=j8e.get(b.constructor);P||(P=new b.constructor,j8e.set(b.constructor,P)),g=P[p]}else g=0;if(y)g?i.handlers[p]=g:delete i.handlers[p],i.eventCount=Object.keys(i.handlers).length;else if(C&&C.set&&(C.copy||C instanceof lx)){if(Array.isArray(g))C.fromArray?C.fromArray(g):C.set(...g);else if(C.copy&&g&&g.constructor&&(k3t?C.constructor.name===g.constructor.name:C.constructor===g.constructor))C.copy(g);else if(g!==void 0){const P=C instanceof rr;!P&&C.setScalar?C.setScalar(g):C instanceof lx&&g instanceof lx?C.mask=g.mask:C.set(g),!DUe()&&!l.linear&&P&&C.convertSRGBToLinear()}}else if(b[p]=g,b[p]instanceof Vc&&b[p].format===Up&&b[p].type===P9){const P=b[p];rre(P)&&rre(l.gl)?P.colorSpace=l.gl.outputColorSpace:P.encoding=l.gl.outputEncoding}rP(t)}if(i.parent&&l.internal&&t.raycast&&u!==i.eventCount){const f=l.internal.interaction.indexOf(t);f>-1&&l.internal.interaction.splice(f,1),i.eventCount&&l.internal.interaction.push(t)}return!(c.length===1&&c[0][0]==="onUpdate")&&c.length&&(r=t.__r3f)!=null&&r.parent&&Ice(t),t}function rP(t){var e,n;const o=(e=t.__r3f)==null||(n=e.root)==null||n.getState==null?void 0:n.getState();o&&o.internal.frames===0&&o.invalidate()}function Ice(t){t.onUpdate==null||t.onUpdate(t)}function L3t(t,e){t.manual||(EUe(t)?(t.left=e.width/-2,t.right=e.width/2,t.top=e.height/2,t.bottom=e.height/-2):t.aspect=e.width/e.height,t.updateProjectionMatrix(),t.updateMatrixWorld())}function nY(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function W3t(){var t;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return KP.DefaultEventPriority;switch((t=e.event)==null?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return KP.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return KP.ContinuousEventPriority;default:return KP.DefaultEventPriority}}function UUe(t,e,n,o){const r=n.get(e);r&&(n.delete(e),n.size===0&&(t.delete(o),r.target.releasePointerCapture(o)))}function N3t(t,e){const{internal:n}=t.getState();n.interaction=n.interaction.filter(o=>o!==e),n.initialHits=n.initialHits.filter(o=>o!==e),n.hovered.forEach((o,r)=>{(o.eventObject===e||o.object===e)&&n.hovered.delete(r)}),n.capturedMap.forEach((o,r)=>{UUe(n.capturedMap,e,o,r)})}function U3t(t){function e(s){const{internal:c}=t.getState(),u=s.offsetX-c.initialClick[0],d=s.offsetY-c.initialClick[1];return Math.round(Math.sqrt(u*u+d*d))}function n(s){return s.filter(c=>["Move","Over","Enter","Out","Leave"].some(u=>{var d;return(d=c.__r3f)==null?void 0:d.handlers["onPointer"+u]}))}function o(s,c){const u=t.getState(),d=new Set,f=[],p=c?c(u.internal.interaction):u.internal.interaction;for(let b=0;b{const P=Pz(b.object),v=Pz(C.object);return!P||!v?b.distance-C.distance:v.events.priority-P.events.priority||b.distance-C.distance}).filter(b=>{const C=nY(b);return d.has(C)?!1:(d.add(C),!0)});u.events.filter&&(y=u.events.filter(y,u));for(const b of y){let C=b.object;for(;C;){var w;(w=C.__r3f)!=null&&w.eventCount&&f.push({...b,eventObject:C}),C=C.parent}}if("pointerId"in s&&u.internal.capturedMap.has(s.pointerId))for(let b of u.internal.capturedMap.get(s.pointerId).values())d.has(nY(b.intersection))||f.push(b.intersection);return f}function r(s,c,u,d){const f=t.getState();if(s.length){const p={stopped:!1};for(const g of s){const y=Pz(g.object)||f,{raycaster:w,pointer:b,camera:C,internal:P}=y,v=new ie(b.x,b.y,0).unproject(C),T=M=>{var D,E;return(D=(E=P.capturedMap.get(M))==null?void 0:E.has(g.eventObject))!=null?D:!1},A=M=>{const D={intersection:g,target:c.target};P.capturedMap.has(M)?P.capturedMap.get(M).set(g.eventObject,D):P.capturedMap.set(M,new Map([[g.eventObject,D]])),c.target.setPointerCapture(M)},x=M=>{const D=P.capturedMap.get(M);D&&UUe(P.capturedMap,g.eventObject,D,M)};let S={};for(let M in c){let D=c[M];typeof D!="function"&&(S[M]=D)}let R={...g,...S,pointer:b,intersections:s,stopped:p.stopped,delta:u,unprojectedPoint:v,ray:w.ray,camera:C,stopPropagation(){const M="pointerId"in c&&P.capturedMap.get(c.pointerId);if((!M||M.has(g.eventObject))&&(R.stopped=p.stopped=!0,P.hovered.size&&Array.from(P.hovered.values()).find(D=>D.eventObject===g.eventObject))){const D=s.slice(0,s.indexOf(g));i([...D,g])}},target:{hasPointerCapture:T,setPointerCapture:A,releasePointerCapture:x},currentTarget:{hasPointerCapture:T,setPointerCapture:A,releasePointerCapture:x},nativeEvent:c};if(d(R),p.stopped===!0)break}}return s}function i(s){const{internal:c}=t.getState();for(const u of c.hovered.values())if(!s.length||!s.find(d=>d.object===u.object&&d.index===u.index&&d.instanceId===u.instanceId)){const f=u.eventObject.__r3f,p=f==null?void 0:f.handlers;if(c.hovered.delete(nY(u)),f!=null&&f.eventCount){const g={...u,intersections:s};p.onPointerOut==null||p.onPointerOut(g),p.onPointerLeave==null||p.onPointerLeave(g)}}}function a(s,c){for(let u=0;ui([]);case"onLostPointerCapture":return c=>{const{internal:u}=t.getState();"pointerId"in c&&u.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{u.capturedMap.has(c.pointerId)&&(u.capturedMap.delete(c.pointerId),i([]))})}}return function(u){const{onPointerMissed:d,internal:f}=t.getState();f.lastEvent.current=u;const p=s==="onPointerMove",g=s==="onClick"||s==="onContextMenu"||s==="onDoubleClick",w=o(u,p?n:void 0),b=g?e(u):0;s==="onPointerDown"&&(f.initialClick=[u.offsetX,u.offsetY],f.initialHits=w.map(P=>P.eventObject)),g&&!w.length&&b<=2&&(a(u,f.interaction),d&&d(u)),p&&i(w);function C(P){const v=P.eventObject,T=v.__r3f,A=T==null?void 0:T.handlers;if(T!=null&&T.eventCount)if(p){if(A.onPointerOver||A.onPointerEnter||A.onPointerOut||A.onPointerLeave){const x=nY(P),S=f.hovered.get(x);S?S.stopped&&P.stopPropagation():(f.hovered.set(x,P),A.onPointerOver==null||A.onPointerOver(P),A.onPointerEnter==null||A.onPointerEnter(P))}A.onPointerMove==null||A.onPointerMove(P)}else{const x=A[s];x?(!g||f.initialHits.includes(v))&&(a(u,f.interaction.filter(S=>!f.initialHits.includes(S))),x(P)):g&&f.initialHits.includes(v)&&a(u,f.interaction.filter(S=>!f.initialHits.includes(S)))}}r(w,u,b,C)}}return{handlePointer:l}}const jUe=t=>!!(t!=null&&t.render),BUe=m.createContext(null),j3t=(t,e)=>{const n=b3t((l,s)=>{const c=new ie,u=new ie,d=new ie;function f(b=s().camera,C=u,P=s().size){const{width:v,height:T,top:A,left:x}=P,S=v/T;C instanceof ie?d.copy(C):d.set(...C);const R=b.getWorldPosition(c).distanceTo(d);if(EUe(b))return{width:v/b.zoom,height:T/b.zoom,top:A,left:x,factor:1,distance:R,aspect:S};{const M=b.fov*Math.PI/180,D=2*Math.tan(M/2)*R,E=D*(v/T);return{width:E,height:D,top:A,left:x,factor:v/E,distance:R,aspect:S}}}let p;const g=b=>l(C=>({performance:{...C.performance,current:b}})),y=new Xt;return{set:l,get:s,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(b=1)=>t(s(),b),advance:(b,C)=>e(b,C,s()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new oge,pointer:y,mouse:y,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const b=s();p&&clearTimeout(p),b.performance.current!==b.performance.min&&g(b.performance.min),p=setTimeout(()=>g(s().performance.max),b.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:f},setEvents:b=>l(C=>({...C,events:{...C.events,...b}})),setSize:(b,C,P,v,T)=>{const A=s().camera,x={width:b,height:C,top:v||0,left:T||0,updateStyle:P};l(S=>({size:x,viewport:{...S.viewport,...f(A,u,x)}}))},setDpr:b=>l(C=>{const P=WUe(b);return{viewport:{...C.viewport,dpr:P,initialDpr:C.viewport.initialDpr||P}}}),setFrameloop:(b="always")=>{const C=s().clock;C.stop(),C.elapsedTime=0,b!=="never"&&(C.start(),C.elapsedTime=0),l(()=>({frameloop:b}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:m.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(b,C,P)=>{const v=s().internal;return v.priority=v.priority+(C>0?1:0),v.subscribers.push({ref:b,priority:C,store:P}),v.subscribers=v.subscribers.sort((T,A)=>T.priority-A.priority),()=>{const T=s().internal;T!=null&&T.subscribers&&(T.priority=T.priority-(C>0?1:0),T.subscribers=T.subscribers.filter(A=>A.ref!==b))}}}}}),o=n.getState();let r=o.size,i=o.viewport.dpr,a=o.camera;return n.subscribe(()=>{const{camera:l,size:s,viewport:c,gl:u,set:d}=n.getState();if(s.width!==r.width||s.height!==r.height||c.dpr!==i){var f;r=s,i=c.dpr,L3t(l,s),u.setPixelRatio(c.dpr);const p=(f=s.updateStyle)!=null?f:typeof HTMLCanvasElement<"u"&&u.domElement instanceof HTMLCanvasElement;u.setSize(s.width,s.height,p)}l!==a&&(a=l,d(p=>({viewport:{...p.viewport,...p.viewport.getCurrentViewport(l)}})))}),n.subscribe(l=>t(l)),n};let oY,B3t=new Set,Y3t=new Set,O3t=new Set;function lre(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function Cz(t,e){switch(t){case"before":return lre(B3t,e);case"after":return lre(Y3t,e);case"tail":return lre(O3t,e)}}let sre,cre;function ure(t,e,n){let o=e.clock.getDelta();for(e.frameloop==="never"&&typeof t=="number"&&(o=t-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=t),sre=e.internal.subscribers,oY=0;oY0)&&!((c=r.gl.xr)!=null&&c.isPresenting)&&(n+=ure(s,r))}if(Cz("after",s),n===0)return Cz("tail",s),e=!1,cancelAnimationFrame(o)}function a(s,c=1){var u;if(!s)return t.forEach(d=>a(d.store.getState()),c);(u=s.gl.xr)!=null&&u.isPresenting||!s.internal.active||s.frameloop==="never"||(s.internal.frames=Math.min(60,s.internal.frames+c),e||(e=!0,requestAnimationFrame(i)))}function l(s,c=!0,u,d){if(c&&Cz("before",s),u)ure(s,u,d);else for(const f of t.values())ure(s,f.store.getState());c&&Cz("after",s)}return{loop:i,invalidate:a,advance:l}}function YUe(){const t=m.useContext(BUe);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function oi(t=n=>n,e){return YUe()(t,e)}function ay(t,e=0){const n=YUe(),o=n.getState().internal.subscribe,r=FUe(t);return aW(()=>o(r,e,n),[e,o,n]),null}const O8e=new WeakMap;function OUe(t,e){return function(n,...o){let r=O8e.get(n);return r||(r=new n,O8e.set(n,r)),t&&t(r),Promise.all(o.map(i=>new Promise((a,l)=>r.load(i,s=>{s.scene&&Object.assign(s,E3t(s.scene)),a(s)},e,s=>l(new Error(`Could not load ${i}: ${s==null?void 0:s.message}`)))))).finally(()=>r.dispose==null?void 0:r.dispose())}}function o3(t,e,n,o){const r=Array.isArray(e)?e:[e],i=zUe(OUe(n,o),[t,...r],{equal:pc.equ});return Array.isArray(e)?i:i[0]}o3.preload=function(t,e,n){const o=Array.isArray(e)?e:[e];return R3t(OUe(n),[t,...o])};o3.clear=function(t,e){const n=Array.isArray(e)?e:[e];return H3t([t,...n])};const iR=new Map,{invalidate:np,advance:_8e}=_3t(iR),{reconciler:iG,applyProps:xT}=M3t(iR,W3t),bT={objects:"shallow",strict:!1},V3t=(t,e)=>{const n=typeof t=="function"?t(e):t;return jUe(n)?n:new j1e({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...t})};function G3t(t,e){const n=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement;if(e){const{width:o,height:r,top:i,left:a,updateStyle:l=n}=e;return{width:o,height:r,top:i,left:a,updateStyle:l}}else if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:o,height:r,top:i,left:a}=t.parentElement.getBoundingClientRect();return{width:o,height:r,top:i,left:a,updateStyle:n}}else if(typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas)return{width:t.width,height:t.height,top:0,left:0,updateStyle:n};return{width:0,height:0,top:0,left:0}}function X3t(t){const e=iR.get(t),n=e==null?void 0:e.fiber,o=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,i=o||j3t(np,_8e),a=n||iG.createContainer(i,KP.ConcurrentRoot,null,!1,null,"",r,null);e||iR.set(t,{fiber:a,store:i});let l,s=!1,c;return{configure(u={}){let{gl:d,size:f,scene:p,events:g,onCreated:y,shadows:w=!1,linear:b=!1,flat:C=!1,legacy:P=!1,orthographic:v=!1,frameloop:T="always",dpr:A=[1,2],performance:x,raycaster:S,camera:R,onPointerMissed:M}=u,D=i.getState(),E=D.gl;D.gl||D.set({gl:E=V3t(d,t)});let W=D.raycaster;W||D.set({raycaster:W=new l0});const{params:j,...L}=S||{};if(pc.equ(L,W,bT)||xT(W,{...L}),pc.equ(j,W.params,bT)||xT(W,{params:{...W.params,...j}}),!D.camera||D.camera===c&&!pc.equ(c,R,bT)){c=R;const _=R instanceof ZL,X=_?R:v?new tW(0,0,0,0,.1,1e3):new zu(75,0,.1,1e3);_||(X.position.z=5,R&&xT(X,R),!D.camera&&!(R!=null&&R.rotation)&&X.lookAt(0,0,0)),D.set({camera:X}),W.camera=X}if(!D.scene){let _;p instanceof nG?_=p:(_=new nG,p&&xT(_,p)),D.set({scene:oP(_)})}if(!D.xr){var k;const _=(Q,le)=>{const q=i.getState();q.frameloop!=="never"&&_8e(Q,!0,q,le)},X=()=>{const Q=i.getState();Q.gl.xr.enabled=Q.gl.xr.isPresenting,Q.gl.xr.setAnimationLoop(Q.gl.xr.isPresenting?_:null),Q.gl.xr.isPresenting||np(Q)},$={connect(){const Q=i.getState().gl;Q.xr.addEventListener("sessionstart",X),Q.xr.addEventListener("sessionend",X)},disconnect(){const Q=i.getState().gl;Q.xr.removeEventListener("sessionstart",X),Q.xr.removeEventListener("sessionend",X)}};typeof((k=E.xr)==null?void 0:k.addEventListener)=="function"&&$.connect(),D.set({xr:$})}if(E.shadowMap){const _=E.shadowMap.enabled,X=E.shadowMap.type;if(E.shadowMap.enabled=!!w,pc.boo(w))E.shadowMap.type=cE;else if(pc.str(w)){var N;const $={basic:xWe,percentage:tq,soft:cE,variance:l2};E.shadowMap.type=(N=$[w])!=null?N:cE}else pc.obj(w)&&Object.assign(E.shadowMap,w);(_!==E.shadowMap.enabled||X!==E.shadowMap.type)&&(E.shadowMap.needsUpdate=!0)}const F=DUe();F&&("enabled"in F?F.enabled=!P:"legacyMode"in F&&(F.legacyMode=P)),xT(E,{outputEncoding:b?3e3:3001,toneMapping:C?T9:b1e}),D.legacy!==P&&D.set(()=>({legacy:P})),D.linear!==b&&D.set(()=>({linear:b})),D.flat!==C&&D.set(()=>({flat:C})),d&&!pc.fun(d)&&!jUe(d)&&!pc.equ(d,E,bT)&&xT(E,d),g&&!D.events.handlers&&D.set({events:g(i)});const B=G3t(t,f);return pc.equ(B,D.size,bT)||D.setSize(B.width,B.height,B.updateStyle,B.top,B.left),A&&D.viewport.dpr!==WUe(A)&&D.setDpr(A),D.frameloop!==T&&D.setFrameloop(T),D.onPointerMissed||D.set({onPointerMissed:M}),x&&!pc.equ(x,D.performance,bT)&&D.set(_=>({performance:{..._.performance,...x}})),l=y,s=!0,this},render(u){return s||this.configure(),iG.updateContainer(m.createElement(J3t,{store:i,children:u,onCreated:l,rootElement:t}),a,null,()=>{}),i},unmount(){_Ue(t)}}}function J3t({store:t,children:e,onCreated:n,rootElement:o}){return aW(()=>{const r=t.getState();r.set(i=>({internal:{...i.internal,active:!0}})),n&&n(r),t.getState().events.connected||r.events.connect==null||r.events.connect(o)},[]),m.createElement(BUe.Provider,{value:t},e)}function _Ue(t,e){const n=iR.get(t),o=n==null?void 0:n.fiber;if(o){const r=n==null?void 0:n.store.getState();r&&(r.internal.active=!1),iG.updateContainer(null,o,null,()=>{r&&setTimeout(()=>{try{var i,a,l,s;r.events.disconnect==null||r.events.disconnect(),(i=r.gl)==null||(a=i.renderLists)==null||a.dispose==null||a.dispose(),(l=r.gl)==null||l.forceContextLoss==null||l.forceContextLoss(),(s=r.gl)!=null&&s.xr&&r.xr.disconnect(),F3t(r),iR.delete(t)}catch{}},500)})}}iG.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:m.version});function aG(){return aG=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0?o=setTimeout(s,e-u):(o=null,n||(l=t.apply(i,r),i=r=null))}var c=function(){i=this,r=arguments,a=Date.now();var u=n&&!o;return o||(o=setTimeout(s,e)),u&&(l=t.apply(i,r),i=r=null),l};return c.clear=function(){o&&(clearTimeout(o),o=null)},c.flush=function(){o&&(l=t.apply(i,r),i=r=null,clearTimeout(o),o=null)},c}zce.debounce=zce;var K3t=zce;const V8e=Fi(K3t);function q3t(t){let{debounce:e,scroll:n,polyfill:o,offsetSize:r}=t===void 0?{debounce:0,scroll:!1,offsetSize:!1}:t;const i=o||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)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[a,l]=m.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),s=m.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a}),c=e?typeof e=="number"?e:e.scroll:null,u=e?typeof e=="number"?e:e.resize:null,d=m.useRef(!1);m.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[f,p,g]=m.useMemo(()=>{const C=()=>{if(!s.current.element)return;const{left:P,top:v,width:T,height:A,bottom:x,right:S,x:R,y:M}=s.current.element.getBoundingClientRect(),D={left:P,top:v,width:T,height:A,bottom:x,right:S,x:R,y:M};s.current.element instanceof HTMLElement&&r&&(D.height=s.current.element.offsetHeight,D.width=s.current.element.offsetWidth),Object.freeze(D),d.current&&!e6t(s.current.lastBounds,D)&&l(s.current.lastBounds=D)};return[C,u?V8e(C,u):C,c?V8e(C,c):C]},[l,r,c,u]);function y(){s.current.scrollContainers&&(s.current.scrollContainers.forEach(C=>C.removeEventListener("scroll",g,!0)),s.current.scrollContainers=null),s.current.resizeObserver&&(s.current.resizeObserver.disconnect(),s.current.resizeObserver=null)}function w(){s.current.element&&(s.current.resizeObserver=new i(g),s.current.resizeObserver.observe(s.current.element),n&&s.current.scrollContainers&&s.current.scrollContainers.forEach(C=>C.addEventListener("scroll",g,{capture:!0,passive:!0})))}const b=C=>{!C||C===s.current.element||(y(),s.current.element=C,s.current.scrollContainers=VUe(C),w())};return Q3t(g,!!n),$3t(p),m.useEffect(()=>{y(),w()},[n,g,p]),m.useEffect(()=>y,[]),[b,a,f]}function $3t(t){m.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function Q3t(t,e){m.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function VUe(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:o,overflowY:r}=window.getComputedStyle(t);return[n,o,r].some(i=>i==="auto"||i==="scroll")&&e.push(t),[...e,...VUe(t.parentElement)]}const Z3t=["x","y","top","bottom","left","right","width","height"],e6t=(t,e)=>Z3t.every(n=>t[n]===e[n]);var t6t=Object.defineProperty,n6t=Object.defineProperties,o6t=Object.getOwnPropertyDescriptors,G8e=Object.getOwnPropertySymbols,r6t=Object.prototype.hasOwnProperty,i6t=Object.prototype.propertyIsEnumerable,X8e=(t,e,n)=>e in t?t6t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,J8e=(t,e)=>{for(var n in e||(e={}))r6t.call(e,n)&&X8e(t,n,e[n]);if(G8e)for(var n of G8e(e))i6t.call(e,n)&&X8e(t,n,e[n]);return t},a6t=(t,e)=>n6t(t,o6t(e));function GUe(t,e,n){if(!t)return;if(n(t)===!0)return t;let o=t.child;for(;o;){const r=GUe(o,e,n);if(r)return r;o=o.sibling}}function XUe(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const cge=XUe(m.createContext(null));class JUe extends m.Component{render(){return m.createElement(cge.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:K8e,ReactCurrentDispatcher:q8e}=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function l6t(){const t=m.useContext(cge);if(t===null)throw new Error("its-fine: useFiber must be called within a !");const e=m.useId();return m.useMemo(()=>{for(const o of[K8e==null?void 0:K8e.current,t,t==null?void 0:t.alternate]){if(!o)continue;const r=GUe(o,!1,i=>{let a=i.memoizedState;for(;a;){if(a.memoizedState===e)return!0;a=a.next}});if(r)return r}},[t,e])}function s6t(){var t,e;const n=l6t(),[o]=m.useState(()=>new Map);o.clear();let r=n;for(;r;){const i=(t=r.type)==null?void 0:t._context;i&&i!==cge&&!o.has(i)&&o.set(i,(e=q8e==null?void 0:q8e.current)==null?void 0:e.readContext(XUe(i))),r=r.return}return o}function c6t(){const t=s6t();return m.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>o=>m.createElement(e,null,m.createElement(n.Provider,a6t(J8e({},o),{value:t.get(n)}))),e=>m.createElement(JUe,J8e({},e))),[t])}const dre={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 u6t(t){const{handlePointer:e}=U3t(t);return{priority:1,enabled:!0,compute(n,o,r){o.pointer.set(n.offsetX/o.size.width*2-1,-(n.offsetY/o.size.height)*2+1),o.raycaster.setFromCamera(o.pointer,o.camera)},connected:void 0,handlers:Object.keys(dre).reduce((n,o)=>({...n,[o]:e(o)}),{}),update:()=>{var n;const{events:o,internal:r}=t.getState();(n=r.lastEvent)!=null&&n.current&&o.handlers&&o.handlers.onPointerMove(r.lastEvent.current)},connect:n=>{var o;const{set:r,events:i}=t.getState();i.disconnect==null||i.disconnect(),r(a=>({events:{...a.events,connected:n}})),Object.entries((o=i.handlers)!=null?o:[]).forEach(([a,l])=>{const[s,c]=dre[a];n.addEventListener(s,l,{passive:c})})},disconnect:()=>{const{set:n,events:o}=t.getState();if(o.connected){var r;Object.entries((r=o.handlers)!=null?r:[]).forEach(([i,a])=>{if(o&&o.connected instanceof HTMLElement){const[l]=dre[i];o.connected.removeEventListener(l,a)}}),n(i=>({events:{...i.events,connected:void 0}}))}}}}const d6t=m.forwardRef(function({children:e,fallback:n,resize:o,style:r,gl:i,events:a=u6t,eventSource:l,eventPrefix:s,shadows:c,linear:u,flat:d,legacy:f,orthographic:p,frameloop:g,dpr:y,performance:w,raycaster:b,camera:C,scene:P,onPointerMissed:v,onCreated:T,...A},x){m.useMemo(()=>xb(w3t),[]);const S=c6t(),[R,M]=q3t({scroll:!0,debounce:{scroll:50,resize:0},...o}),D=m.useRef(null),E=m.useRef(null);m.useImperativeHandle(x,()=>D.current);const W=FUe(v),[j,L]=m.useState(!1),[k,N]=m.useState(!1);if(j)throw j;if(k)throw k;const F=m.useRef(null);aW(()=>{const O=D.current;M.width>0&&M.height>0&&O&&(F.current||(F.current=X3t(O)),F.current.configure({gl:i,events:a,shadows:c,linear:u,flat:d,legacy:f,orthographic:p,frameloop:g,dpr:y,performance:w,raycaster:b,camera:C,scene:P,size:M,onPointerMissed:(...B)=>W.current==null?void 0:W.current(...B),onCreated:B=>{B.events.connect==null||B.events.connect(l?I3t(l)?l.current:l:E.current),s&&B.setEvents({compute:(_,X)=>{const $=_[s+"X"],Q=_[s+"Y"];X.pointer.set($/X.size.width*2-1,-(Q/X.size.height)*2+1),X.raycaster.setFromCamera(X.pointer,X.camera)}}),T==null||T(B)}}),F.current.render(m.createElement(S,null,m.createElement(kUe,{set:N},m.createElement(m.Suspense,{fallback:m.createElement(z3t,{set:L})},e)))))}),m.useEffect(()=>{const O=D.current;if(O)return()=>_Ue(O)},[]);const U=l?"none":"auto";return m.createElement("div",aG({ref:E,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:U,...r}},A),m.createElement("div",{ref:R,style:{width:"100%",height:"100%"}},m.createElement("canvas",{ref:D,style:{display:"block"}},n)))}),f6t=m.forwardRef(function(e,n){return m.createElement(JUe,null,m.createElement(d6t,aG({},e,{ref:n})))});function h6t(t,e,n){return e=lG(e),b6t(t,KUe()?Reflect.construct(e,n||[],lG(t).constructor):e.apply(t,n))}function KUe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KUe=function(){return!!t})()}function p6t(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var o,r,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;s=!1}else for(;!(s=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);s=!0);}catch(u){c=!0,r=u}finally{try{if(!s&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}function g6t(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function m6t(t){var e=g6t(t,"string");return typeof e=="symbol"?e:String(e)}function y6t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A6t(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,o=new Array(e);n ")}return null},n.getPublicRootInstance=function(J){if(J=J.current,!J.child)return null;switch(J.child.tag){case 5:return k(J.child.stateNode);default:return J.child.stateNode}},n.injectIntoDevTools=function(J){if(J={bundleType:J.bundleType,version:J.version,rendererPackageName:J.rendererPackageName,rendererConfig:J.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:YM,findFiberByHostInstance:J.findFiberByHostInstance||_3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")J=!1;else{var K=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(K.isDisabled||!K.supportsFiber)J=!0;else{try{ks=K.inject(J),Zs=K}catch{}J=!!K.checkDCE}}return J},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(J,K,we,Le){if(!Se)throw Error(a(363));J=qA(J,K);var Ge=Ae(J,we,Le).disconnect;return{disconnect:function(){Ge()}}},n.registerMutableSourceForHydration=function(J,K){var we=K._getVersion;we=we(K._source),J.mutableSourceEagerHydrationData==null?J.mutableSourceEagerHydrationData=[K,we]:J.mutableSourceEagerHydrationData.push(K,we)},n.runWithPriority=function(J,K){var we=tr;try{return tr=J,K()}finally{tr=we}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(J,K,we,Le){var Ge=K.current,pt=x0(),Zt=Wf(Ge);return we=j5(we),K.context===null?K.context=we:K.pendingContext=we,K=Ko(pt,Zt),K.payload={element:J},Le=Le===void 0?null:Le,Le!==null&&(K.callback=Le),li(Ge,K),J=sd(Ge,Zt,pt),J!==null&&$i(J,Ge,Zt),Zt},n};RUe.exports=S3t;var T3t=RUe.exports;const P3t=Fi(T3t),C3t=t=>typeof t=="object"&&typeof t.then=="function",Ev=[];function IUe(t,e,n=(o,r)=>o===r){if(t===e)return!0;if(!t||!e)return!1;const o=t.length;if(e.length!==o)return!1;for(let r=0;r0&&(i.timeout&&clearTimeout(i.timeout),i.timeout=setTimeout(i.remove,o.lifespan)),i.response;if(!n)throw i.promise}const r={keys:e,equal:o.equal,remove:()=>{const i=Ev.indexOf(r);i!==-1&&Ev.splice(i,1)},promise:(C3t(t)?t:t(...e)).then(i=>{r.response=i,o.lifespan&&o.lifespan>0&&(r.timeout=setTimeout(r.remove,o.lifespan))}).catch(i=>r.error=i)};if(Ev.push(r),!n)throw r.promise}const DUe=(t,e,n)=>zUe(t,e,!1,n),R3t=(t,e,n)=>void zUe(t,e,!0,n),H3t=t=>{if(t===void 0||t.length===0)Ev.splice(0,Ev.length);else{const e=Ev.find(n=>IUe(t,n.keys,n.equal));e&&e.remove()}},sge={},xb=t=>void Object.assign(sge,t);function M3t(t,e){function n(u,{args:d=[],attach:f,...p},g){let y=`${u[0].toUpperCase()}${u.slice(1)}`,w;if(u==="primitive"){if(p.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const b=p.object;w=oP(b,{type:u,root:g,attach:f,primitive:!0})}else{const b=sge[y];if(!b)throw new Error(`R3F: ${y} 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(d))throw new Error("R3F: The args prop must be an array!");w=oP(new b(...d),{type:u,root:g,attach:f,memoizedProps:{args:d}})}return w.__r3f.attach===void 0&&(w instanceof Ni?w.__r3f.attach="geometry":w instanceof Pf&&(w.__r3f.attach="material")),y!=="inject"&&are(w,p),w}function o(u,d){let f=!1;if(d){var p,g;(p=d.__r3f)!=null&&p.attach?ire(u,d,d.__r3f.attach):d.isObject3D&&u.isObject3D&&(u.add(d),f=!0),f||(g=u.__r3f)==null||g.objects.push(d),d.__r3f||oP(d,{}),d.__r3f.parent=u,Ice(d),rP(d)}}function r(u,d,f){let p=!1;if(d){var g,y;if((g=d.__r3f)!=null&&g.attach)ire(u,d,d.__r3f.attach);else if(d.isObject3D&&u.isObject3D){d.parent=u,d.dispatchEvent({type:"added"});const w=u.children.filter(C=>C!==d),b=w.indexOf(f);u.children=[...w.slice(0,b),d,...w.slice(b)],p=!0}p||(y=u.__r3f)==null||y.objects.push(d),d.__r3f||oP(d,{}),d.__r3f.parent=u,Ice(d),rP(d)}}function i(u,d,f=!1){u&&[...u].forEach(p=>a(d,p,f))}function a(u,d,f){if(d){var p,g,y;if(d.__r3f&&(d.__r3f.parent=null),(p=u.__r3f)!=null&&p.objects&&(u.__r3f.objects=u.__r3f.objects.filter(v=>v!==d)),(g=d.__r3f)!=null&&g.attach)O8e(u,d,d.__r3f.attach);else if(d.isObject3D&&u.isObject3D){var w;u.remove(d),(w=d.__r3f)!=null&&w.root&&N3t(d.__r3f.root,d)}const C=(y=d.__r3f)==null?void 0:y.primitive,P=f===void 0?d.dispose!==null&&!C:f;if(!C){var b;i((b=d.__r3f)==null?void 0:b.objects,d,P),i(d.children,d,P)}delete d.__r3f,P&&d.dispose&&d.type!=="Scene"&&Hce.unstable_scheduleCallback(Hce.unstable_IdlePriority,()=>{try{d.dispose()}catch{}}),rP(u)}}function l(u,d,f,p){var g;const y=(g=u.__r3f)==null?void 0:g.parent;if(!y)return;const w=n(d,f,u.__r3f.root);if(u.children){for(const b of u.children)b.__r3f&&o(w,b);u.children=u.children.filter(b=>!b.__r3f)}u.__r3f.objects.forEach(b=>o(w,b)),u.__r3f.objects=[],u.__r3f.autoRemovedBeforeAppend||a(y,u),w.parent&&(w.__r3f.autoRemovedBeforeAppend=!0),o(y,w),w.raycast&&w.__r3f.eventCount&&w.__r3f.root.getState().internal.interaction.push(w),[p,p.alternate].forEach(b=>{b!==null&&(b.stateNode=w,b.ref&&(typeof b.ref=="function"?b.ref(w):b.ref.current=w))})}const s=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:P3t({createInstance:n,removeChild:a,appendChild:o,appendInitialChild:o,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(u,d)=>{if(!d)return;const f=u.getState().scene;f.__r3f&&(f.__r3f.root=u,o(f,d))},removeChildFromContainer:(u,d)=>{d&&a(u.getState().scene,d)},insertInContainerBefore:(u,d,f)=>{if(!d||!f)return;const p=u.getState().scene;p.__r3f&&r(p,d,f)},getRootHostContext:()=>null,getChildHostContext:u=>u,finalizeInitialChildren(u){var d;return!!((d=u==null?void 0:u.__r3f)!=null?d:{}).handlers},prepareUpdate(u,d,f,p){var g;if(((g=u==null?void 0:u.__r3f)!=null?g:{}).primitive&&p.object&&p.object!==u)return[!0];{const{args:w=[],children:b,...C}=p,{args:P=[],children:v,...T}=f;if(!Array.isArray(w))throw new Error("R3F: the args prop must be an array!");if(w.some((x,S)=>x!==P[S]))return[!0];const A=UUe(u,C,T,!0);return A.changes.length?[!1,A]:null}},commitUpdate(u,[d,f],p,g,y,w){d?l(u,p,y,w):are(u,f)},commitMount(u,d,f,p){var g;const y=(g=u.__r3f)!=null?g:{};u.raycast&&y.handlers&&y.eventCount&&u.__r3f.root.getState().internal.interaction.push(u)},getPublicInstance:u=>u,prepareForCommit:()=>null,preparePortalMount:u=>oP(u.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(u){var d;const{attach:f,parent:p}=(d=u.__r3f)!=null?d:{};f&&p&&O8e(p,u,f),u.isObject3D&&(u.visible=!1),rP(u)},unhideInstance(u,d){var f;const{attach:p,parent:g}=(f=u.__r3f)!=null?f:{};p&&g&&ire(g,u,p),(u.isObject3D&&d.visible==null||d.visible)&&(u.visible=!0),rP(u)},createTextInstance:s,hideTextInstance:s,unhideTextInstance:s,getCurrentEventPriority:()=>e?e():KP.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&pc.fun(performance.now)?performance.now:pc.fun(Date.now)?Date.now:()=>0,scheduleTimeout:pc.fun(setTimeout)?setTimeout:void 0,cancelTimeout:pc.fun(clearTimeout)?clearTimeout:void 0}),applyProps:are}}var U8e,j8e;const rre=t=>"colorSpace"in t||"outputColorSpace"in t,EUe=()=>{var t;return(t=sge.ColorManagement)!=null?t:null},FUe=t=>t&&t.isOrthographicCamera,I3t=t=>t&&t.hasOwnProperty("current"),aW=typeof window<"u"&&((U8e=window.document)!=null&&U8e.createElement||((j8e=window.navigator)==null?void 0:j8e.product)==="ReactNative")?m.useLayoutEffect:m.useEffect;function kUe(t){const e=m.useRef(t);return aW(()=>void(e.current=t),[t]),e}function z3t({set:t}){return aW(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}class LUe extends m.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}LUe.getDerivedStateFromError=()=>({error:!0});const WUe="__default",B8e=new Map,D3t=t=>t&&!!t.memoized&&!!t.changes;function NUe(t){var e;const n=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(t)?Math.min(Math.max(t[0],n),t[1]):t}const Pz=t=>{var e;return(e=t.__r3f)==null?void 0:e.root.getState()},pc={obj:t=>t===Object(t)&&!pc.arr(t)&&typeof t!="function",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",boo:t=>typeof t=="boolean",und:t=>t===void 0,arr:t=>Array.isArray(t),equ(t,e,{arrays:n="shallow",objects:o="reference",strict:r=!0}={}){if(typeof t!=typeof e||!!t!=!!e)return!1;if(pc.str(t)||pc.num(t))return t===e;const i=pc.obj(t);if(i&&o==="reference")return t===e;const a=pc.arr(t);if(a&&n==="reference")return t===e;if((a||i)&&t===e)return!0;let l;for(l in t)if(!(l in e))return!1;if(i&&n==="shallow"&&o==="shallow"){for(l in r?e:t)if(!pc.equ(t[l],e[l],{strict:r,objects:"reference"}))return!1}else for(l in r?e:t)if(t[l]!==e[l])return!1;if(pc.und(l)){if(a&&t.length===0&&e.length===0||i&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}};function E3t(t){const e={nodes:{},materials:{}};return t&&t.traverse(n=>{n.name&&(e.nodes[n.name]=n),n.material&&!e.materials[n.material.name]&&(e.materials[n.material.name]=n.material)}),e}function F3t(t){t.dispose&&t.type!=="Scene"&&t.dispose();for(const e in t)e.dispose==null||e.dispose(),delete t[e]}function oP(t,e){const n=t;return n.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},t}function Mce(t,e){let n=t;if(e.includes("-")){const o=e.split("-"),r=o.pop();return n=o.reduce((i,a)=>i[a],t),{target:n,key:r}}else return{target:n,key:e}}const Y8e=/-\d+$/;function ire(t,e,n){if(pc.str(n)){if(Y8e.test(n)){const i=n.replace(Y8e,""),{target:a,key:l}=Mce(t,i);Array.isArray(a[l])||(a[l]=[])}const{target:o,key:r}=Mce(t,n);e.__r3f.previousAttach=o[r],o[r]=e}else e.__r3f.previousAttach=n(t,e)}function O8e(t,e,n){var o,r;if(pc.str(n)){const{target:i,key:a}=Mce(t,n),l=e.__r3f.previousAttach;l===void 0?delete i[a]:i[a]=l}else(o=e.__r3f)==null||o.previousAttach==null||o.previousAttach(t,e);(r=e.__r3f)==null||delete r.previousAttach}function UUe(t,{children:e,key:n,ref:o,...r},{children:i,key:a,ref:l,...s}={},c=!1){var u;const d=(u=t==null?void 0:t.__r3f)!=null?u:{},f=Object.entries(r),p=[];if(c){const y=Object.keys(s);for(let w=0;w{var b;if((b=t.__r3f)!=null&&b.primitive&&y==="object"||pc.equ(w,s[y]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(y))return p.push([y,w,!0,[]]);let C=[];y.includes("-")&&(C=y.split("-")),p.push([y,w,!1,C]);for(const P in r){const v=r[P];P.startsWith(`${y}-`)&&p.push([P,v,!1,P.split("-")])}});const g={...r};return d.memoizedProps&&d.memoizedProps.args&&(g.args=d.memoizedProps.args),d.memoizedProps&&d.memoizedProps.attach&&(g.attach=d.memoizedProps.attach),{memoized:g,changes:p}}const k3t=typeof process<"u"&&!1;function are(t,e){var n,o,r;const i=(n=t.__r3f)!=null?n:{},a=i.root,l=(o=a==null||a.getState==null?void 0:a.getState())!=null?o:{},{memoized:s,changes:c}=D3t(e)?e:UUe(t,e),u=i.eventCount;t.__r3f&&(t.__r3f.memoizedProps=s);for(let f=0;fP[v],t),!(C&&C.set))){const[P,...v]=w.reverse();b=v.reverse().reduce((T,A)=>T[A],t),p=P}if(g===WUe+"remove")if(b.constructor){let P=B8e.get(b.constructor);P||(P=new b.constructor,B8e.set(b.constructor,P)),g=P[p]}else g=0;if(y)g?i.handlers[p]=g:delete i.handlers[p],i.eventCount=Object.keys(i.handlers).length;else if(C&&C.set&&(C.copy||C instanceof lx)){if(Array.isArray(g))C.fromArray?C.fromArray(g):C.set(...g);else if(C.copy&&g&&g.constructor&&(k3t?C.constructor.name===g.constructor.name:C.constructor===g.constructor))C.copy(g);else if(g!==void 0){const P=C instanceof rr;!P&&C.setScalar?C.setScalar(g):C instanceof lx&&g instanceof lx?C.mask=g.mask:C.set(g),!EUe()&&!l.linear&&P&&C.convertSRGBToLinear()}}else if(b[p]=g,b[p]instanceof Vc&&b[p].format===Up&&b[p].type===P9){const P=b[p];rre(P)&&rre(l.gl)?P.colorSpace=l.gl.outputColorSpace:P.encoding=l.gl.outputEncoding}rP(t)}if(i.parent&&l.internal&&t.raycast&&u!==i.eventCount){const f=l.internal.interaction.indexOf(t);f>-1&&l.internal.interaction.splice(f,1),i.eventCount&&l.internal.interaction.push(t)}return!(c.length===1&&c[0][0]==="onUpdate")&&c.length&&(r=t.__r3f)!=null&&r.parent&&Ice(t),t}function rP(t){var e,n;const o=(e=t.__r3f)==null||(n=e.root)==null||n.getState==null?void 0:n.getState();o&&o.internal.frames===0&&o.invalidate()}function Ice(t){t.onUpdate==null||t.onUpdate(t)}function L3t(t,e){t.manual||(FUe(t)?(t.left=e.width/-2,t.right=e.width/2,t.top=e.height/2,t.bottom=e.height/-2):t.aspect=e.width/e.height,t.updateProjectionMatrix(),t.updateMatrixWorld())}function oY(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function W3t(){var t;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return KP.DefaultEventPriority;switch((t=e.event)==null?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return KP.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return KP.ContinuousEventPriority;default:return KP.DefaultEventPriority}}function jUe(t,e,n,o){const r=n.get(e);r&&(n.delete(e),n.size===0&&(t.delete(o),r.target.releasePointerCapture(o)))}function N3t(t,e){const{internal:n}=t.getState();n.interaction=n.interaction.filter(o=>o!==e),n.initialHits=n.initialHits.filter(o=>o!==e),n.hovered.forEach((o,r)=>{(o.eventObject===e||o.object===e)&&n.hovered.delete(r)}),n.capturedMap.forEach((o,r)=>{jUe(n.capturedMap,e,o,r)})}function U3t(t){function e(s){const{internal:c}=t.getState(),u=s.offsetX-c.initialClick[0],d=s.offsetY-c.initialClick[1];return Math.round(Math.sqrt(u*u+d*d))}function n(s){return s.filter(c=>["Move","Over","Enter","Out","Leave"].some(u=>{var d;return(d=c.__r3f)==null?void 0:d.handlers["onPointer"+u]}))}function o(s,c){const u=t.getState(),d=new Set,f=[],p=c?c(u.internal.interaction):u.internal.interaction;for(let b=0;b{const P=Pz(b.object),v=Pz(C.object);return!P||!v?b.distance-C.distance:v.events.priority-P.events.priority||b.distance-C.distance}).filter(b=>{const C=oY(b);return d.has(C)?!1:(d.add(C),!0)});u.events.filter&&(y=u.events.filter(y,u));for(const b of y){let C=b.object;for(;C;){var w;(w=C.__r3f)!=null&&w.eventCount&&f.push({...b,eventObject:C}),C=C.parent}}if("pointerId"in s&&u.internal.capturedMap.has(s.pointerId))for(let b of u.internal.capturedMap.get(s.pointerId).values())d.has(oY(b.intersection))||f.push(b.intersection);return f}function r(s,c,u,d){const f=t.getState();if(s.length){const p={stopped:!1};for(const g of s){const y=Pz(g.object)||f,{raycaster:w,pointer:b,camera:C,internal:P}=y,v=new ie(b.x,b.y,0).unproject(C),T=M=>{var D,E;return(D=(E=P.capturedMap.get(M))==null?void 0:E.has(g.eventObject))!=null?D:!1},A=M=>{const D={intersection:g,target:c.target};P.capturedMap.has(M)?P.capturedMap.get(M).set(g.eventObject,D):P.capturedMap.set(M,new Map([[g.eventObject,D]])),c.target.setPointerCapture(M)},x=M=>{const D=P.capturedMap.get(M);D&&jUe(P.capturedMap,g.eventObject,D,M)};let S={};for(let M in c){let D=c[M];typeof D!="function"&&(S[M]=D)}let R={...g,...S,pointer:b,intersections:s,stopped:p.stopped,delta:u,unprojectedPoint:v,ray:w.ray,camera:C,stopPropagation(){const M="pointerId"in c&&P.capturedMap.get(c.pointerId);if((!M||M.has(g.eventObject))&&(R.stopped=p.stopped=!0,P.hovered.size&&Array.from(P.hovered.values()).find(D=>D.eventObject===g.eventObject))){const D=s.slice(0,s.indexOf(g));i([...D,g])}},target:{hasPointerCapture:T,setPointerCapture:A,releasePointerCapture:x},currentTarget:{hasPointerCapture:T,setPointerCapture:A,releasePointerCapture:x},nativeEvent:c};if(d(R),p.stopped===!0)break}}return s}function i(s){const{internal:c}=t.getState();for(const u of c.hovered.values())if(!s.length||!s.find(d=>d.object===u.object&&d.index===u.index&&d.instanceId===u.instanceId)){const f=u.eventObject.__r3f,p=f==null?void 0:f.handlers;if(c.hovered.delete(oY(u)),f!=null&&f.eventCount){const g={...u,intersections:s};p.onPointerOut==null||p.onPointerOut(g),p.onPointerLeave==null||p.onPointerLeave(g)}}}function a(s,c){for(let u=0;ui([]);case"onLostPointerCapture":return c=>{const{internal:u}=t.getState();"pointerId"in c&&u.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{u.capturedMap.has(c.pointerId)&&(u.capturedMap.delete(c.pointerId),i([]))})}}return function(u){const{onPointerMissed:d,internal:f}=t.getState();f.lastEvent.current=u;const p=s==="onPointerMove",g=s==="onClick"||s==="onContextMenu"||s==="onDoubleClick",w=o(u,p?n:void 0),b=g?e(u):0;s==="onPointerDown"&&(f.initialClick=[u.offsetX,u.offsetY],f.initialHits=w.map(P=>P.eventObject)),g&&!w.length&&b<=2&&(a(u,f.interaction),d&&d(u)),p&&i(w);function C(P){const v=P.eventObject,T=v.__r3f,A=T==null?void 0:T.handlers;if(T!=null&&T.eventCount)if(p){if(A.onPointerOver||A.onPointerEnter||A.onPointerOut||A.onPointerLeave){const x=oY(P),S=f.hovered.get(x);S?S.stopped&&P.stopPropagation():(f.hovered.set(x,P),A.onPointerOver==null||A.onPointerOver(P),A.onPointerEnter==null||A.onPointerEnter(P))}A.onPointerMove==null||A.onPointerMove(P)}else{const x=A[s];x?(!g||f.initialHits.includes(v))&&(a(u,f.interaction.filter(S=>!f.initialHits.includes(S))),x(P)):g&&f.initialHits.includes(v)&&a(u,f.interaction.filter(S=>!f.initialHits.includes(S)))}}r(w,u,b,C)}}return{handlePointer:l}}const BUe=t=>!!(t!=null&&t.render),YUe=m.createContext(null),j3t=(t,e)=>{const n=b3t((l,s)=>{const c=new ie,u=new ie,d=new ie;function f(b=s().camera,C=u,P=s().size){const{width:v,height:T,top:A,left:x}=P,S=v/T;C instanceof ie?d.copy(C):d.set(...C);const R=b.getWorldPosition(c).distanceTo(d);if(FUe(b))return{width:v/b.zoom,height:T/b.zoom,top:A,left:x,factor:1,distance:R,aspect:S};{const M=b.fov*Math.PI/180,D=2*Math.tan(M/2)*R,E=D*(v/T);return{width:E,height:D,top:A,left:x,factor:v/E,distance:R,aspect:S}}}let p;const g=b=>l(C=>({performance:{...C.performance,current:b}})),y=new Xt;return{set:l,get:s,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(b=1)=>t(s(),b),advance:(b,C)=>e(b,C,s()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new oge,pointer:y,mouse:y,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const b=s();p&&clearTimeout(p),b.performance.current!==b.performance.min&&g(b.performance.min),p=setTimeout(()=>g(s().performance.max),b.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:f},setEvents:b=>l(C=>({...C,events:{...C.events,...b}})),setSize:(b,C,P,v,T)=>{const A=s().camera,x={width:b,height:C,top:v||0,left:T||0,updateStyle:P};l(S=>({size:x,viewport:{...S.viewport,...f(A,u,x)}}))},setDpr:b=>l(C=>{const P=NUe(b);return{viewport:{...C.viewport,dpr:P,initialDpr:C.viewport.initialDpr||P}}}),setFrameloop:(b="always")=>{const C=s().clock;C.stop(),C.elapsedTime=0,b!=="never"&&(C.start(),C.elapsedTime=0),l(()=>({frameloop:b}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:m.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(b,C,P)=>{const v=s().internal;return v.priority=v.priority+(C>0?1:0),v.subscribers.push({ref:b,priority:C,store:P}),v.subscribers=v.subscribers.sort((T,A)=>T.priority-A.priority),()=>{const T=s().internal;T!=null&&T.subscribers&&(T.priority=T.priority-(C>0?1:0),T.subscribers=T.subscribers.filter(A=>A.ref!==b))}}}}}),o=n.getState();let r=o.size,i=o.viewport.dpr,a=o.camera;return n.subscribe(()=>{const{camera:l,size:s,viewport:c,gl:u,set:d}=n.getState();if(s.width!==r.width||s.height!==r.height||c.dpr!==i){var f;r=s,i=c.dpr,L3t(l,s),u.setPixelRatio(c.dpr);const p=(f=s.updateStyle)!=null?f:typeof HTMLCanvasElement<"u"&&u.domElement instanceof HTMLCanvasElement;u.setSize(s.width,s.height,p)}l!==a&&(a=l,d(p=>({viewport:{...p.viewport,...p.viewport.getCurrentViewport(l)}})))}),n.subscribe(l=>t(l)),n};let rY,B3t=new Set,Y3t=new Set,O3t=new Set;function lre(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function Cz(t,e){switch(t){case"before":return lre(B3t,e);case"after":return lre(Y3t,e);case"tail":return lre(O3t,e)}}let sre,cre;function ure(t,e,n){let o=e.clock.getDelta();for(e.frameloop==="never"&&typeof t=="number"&&(o=t-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=t),sre=e.internal.subscribers,rY=0;rY0)&&!((c=r.gl.xr)!=null&&c.isPresenting)&&(n+=ure(s,r))}if(Cz("after",s),n===0)return Cz("tail",s),e=!1,cancelAnimationFrame(o)}function a(s,c=1){var u;if(!s)return t.forEach(d=>a(d.store.getState()),c);(u=s.gl.xr)!=null&&u.isPresenting||!s.internal.active||s.frameloop==="never"||(s.internal.frames=Math.min(60,s.internal.frames+c),e||(e=!0,requestAnimationFrame(i)))}function l(s,c=!0,u,d){if(c&&Cz("before",s),u)ure(s,u,d);else for(const f of t.values())ure(s,f.store.getState());c&&Cz("after",s)}return{loop:i,invalidate:a,advance:l}}function OUe(){const t=m.useContext(YUe);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function oi(t=n=>n,e){return OUe()(t,e)}function ay(t,e=0){const n=OUe(),o=n.getState().internal.subscribe,r=kUe(t);return aW(()=>o(r,e,n),[e,o,n]),null}const _8e=new WeakMap;function _Ue(t,e){return function(n,...o){let r=_8e.get(n);return r||(r=new n,_8e.set(n,r)),t&&t(r),Promise.all(o.map(i=>new Promise((a,l)=>r.load(i,s=>{s.scene&&Object.assign(s,E3t(s.scene)),a(s)},e,s=>l(new Error(`Could not load ${i}: ${s==null?void 0:s.message}`)))))).finally(()=>r.dispose==null?void 0:r.dispose())}}function o3(t,e,n,o){const r=Array.isArray(e)?e:[e],i=DUe(_Ue(n,o),[t,...r],{equal:pc.equ});return Array.isArray(e)?i:i[0]}o3.preload=function(t,e,n){const o=Array.isArray(e)?e:[e];return R3t(_Ue(n),[t,...o])};o3.clear=function(t,e){const n=Array.isArray(e)?e:[e];return H3t([t,...n])};const iR=new Map,{invalidate:np,advance:V8e}=_3t(iR),{reconciler:aG,applyProps:xT}=M3t(iR,W3t),bT={objects:"shallow",strict:!1},V3t=(t,e)=>{const n=typeof t=="function"?t(e):t;return BUe(n)?n:new j1e({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...t})};function G3t(t,e){const n=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement;if(e){const{width:o,height:r,top:i,left:a,updateStyle:l=n}=e;return{width:o,height:r,top:i,left:a,updateStyle:l}}else if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:o,height:r,top:i,left:a}=t.parentElement.getBoundingClientRect();return{width:o,height:r,top:i,left:a,updateStyle:n}}else if(typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas)return{width:t.width,height:t.height,top:0,left:0,updateStyle:n};return{width:0,height:0,top:0,left:0}}function X3t(t){const e=iR.get(t),n=e==null?void 0:e.fiber,o=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,i=o||j3t(np,V8e),a=n||aG.createContainer(i,KP.ConcurrentRoot,null,!1,null,"",r,null);e||iR.set(t,{fiber:a,store:i});let l,s=!1,c;return{configure(u={}){let{gl:d,size:f,scene:p,events:g,onCreated:y,shadows:w=!1,linear:b=!1,flat:C=!1,legacy:P=!1,orthographic:v=!1,frameloop:T="always",dpr:A=[1,2],performance:x,raycaster:S,camera:R,onPointerMissed:M}=u,D=i.getState(),E=D.gl;D.gl||D.set({gl:E=V3t(d,t)});let W=D.raycaster;W||D.set({raycaster:W=new l0});const{params:j,...L}=S||{};if(pc.equ(L,W,bT)||xT(W,{...L}),pc.equ(j,W.params,bT)||xT(W,{params:{...W.params,...j}}),!D.camera||D.camera===c&&!pc.equ(c,R,bT)){c=R;const _=R instanceof ZL,X=_?R:v?new tW(0,0,0,0,.1,1e3):new zu(75,0,.1,1e3);_||(X.position.z=5,R&&xT(X,R),!D.camera&&!(R!=null&&R.rotation)&&X.lookAt(0,0,0)),D.set({camera:X}),W.camera=X}if(!D.scene){let _;p instanceof oG?_=p:(_=new oG,p&&xT(_,p)),D.set({scene:oP(_)})}if(!D.xr){var k;const _=(Q,le)=>{const q=i.getState();q.frameloop!=="never"&&V8e(Q,!0,q,le)},X=()=>{const Q=i.getState();Q.gl.xr.enabled=Q.gl.xr.isPresenting,Q.gl.xr.setAnimationLoop(Q.gl.xr.isPresenting?_:null),Q.gl.xr.isPresenting||np(Q)},$={connect(){const Q=i.getState().gl;Q.xr.addEventListener("sessionstart",X),Q.xr.addEventListener("sessionend",X)},disconnect(){const Q=i.getState().gl;Q.xr.removeEventListener("sessionstart",X),Q.xr.removeEventListener("sessionend",X)}};typeof((k=E.xr)==null?void 0:k.addEventListener)=="function"&&$.connect(),D.set({xr:$})}if(E.shadowMap){const _=E.shadowMap.enabled,X=E.shadowMap.type;if(E.shadowMap.enabled=!!w,pc.boo(w))E.shadowMap.type=cE;else if(pc.str(w)){var N;const $={basic:bWe,percentage:nq,soft:cE,variance:l2};E.shadowMap.type=(N=$[w])!=null?N:cE}else pc.obj(w)&&Object.assign(E.shadowMap,w);(_!==E.shadowMap.enabled||X!==E.shadowMap.type)&&(E.shadowMap.needsUpdate=!0)}const F=EUe();F&&("enabled"in F?F.enabled=!P:"legacyMode"in F&&(F.legacyMode=P)),xT(E,{outputEncoding:b?3e3:3001,toneMapping:C?T9:b1e}),D.legacy!==P&&D.set(()=>({legacy:P})),D.linear!==b&&D.set(()=>({linear:b})),D.flat!==C&&D.set(()=>({flat:C})),d&&!pc.fun(d)&&!BUe(d)&&!pc.equ(d,E,bT)&&xT(E,d),g&&!D.events.handlers&&D.set({events:g(i)});const B=G3t(t,f);return pc.equ(B,D.size,bT)||D.setSize(B.width,B.height,B.updateStyle,B.top,B.left),A&&D.viewport.dpr!==NUe(A)&&D.setDpr(A),D.frameloop!==T&&D.setFrameloop(T),D.onPointerMissed||D.set({onPointerMissed:M}),x&&!pc.equ(x,D.performance,bT)&&D.set(_=>({performance:{..._.performance,...x}})),l=y,s=!0,this},render(u){return s||this.configure(),aG.updateContainer(m.createElement(J3t,{store:i,children:u,onCreated:l,rootElement:t}),a,null,()=>{}),i},unmount(){VUe(t)}}}function J3t({store:t,children:e,onCreated:n,rootElement:o}){return aW(()=>{const r=t.getState();r.set(i=>({internal:{...i.internal,active:!0}})),n&&n(r),t.getState().events.connected||r.events.connect==null||r.events.connect(o)},[]),m.createElement(YUe.Provider,{value:t},e)}function VUe(t,e){const n=iR.get(t),o=n==null?void 0:n.fiber;if(o){const r=n==null?void 0:n.store.getState();r&&(r.internal.active=!1),aG.updateContainer(null,o,null,()=>{r&&setTimeout(()=>{try{var i,a,l,s;r.events.disconnect==null||r.events.disconnect(),(i=r.gl)==null||(a=i.renderLists)==null||a.dispose==null||a.dispose(),(l=r.gl)==null||l.forceContextLoss==null||l.forceContextLoss(),(s=r.gl)!=null&&s.xr&&r.xr.disconnect(),F3t(r),iR.delete(t)}catch{}},500)})}}aG.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:m.version});function lG(){return lG=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0?o=setTimeout(s,e-u):(o=null,n||(l=t.apply(i,r),i=r=null))}var c=function(){i=this,r=arguments,a=Date.now();var u=n&&!o;return o||(o=setTimeout(s,e)),u&&(l=t.apply(i,r),i=r=null),l};return c.clear=function(){o&&(clearTimeout(o),o=null)},c.flush=function(){o&&(l=t.apply(i,r),i=r=null,clearTimeout(o),o=null)},c}zce.debounce=zce;var K3t=zce;const G8e=Fi(K3t);function q3t(t){let{debounce:e,scroll:n,polyfill:o,offsetSize:r}=t===void 0?{debounce:0,scroll:!1,offsetSize:!1}:t;const i=o||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)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[a,l]=m.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),s=m.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a}),c=e?typeof e=="number"?e:e.scroll:null,u=e?typeof e=="number"?e:e.resize:null,d=m.useRef(!1);m.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[f,p,g]=m.useMemo(()=>{const C=()=>{if(!s.current.element)return;const{left:P,top:v,width:T,height:A,bottom:x,right:S,x:R,y:M}=s.current.element.getBoundingClientRect(),D={left:P,top:v,width:T,height:A,bottom:x,right:S,x:R,y:M};s.current.element instanceof HTMLElement&&r&&(D.height=s.current.element.offsetHeight,D.width=s.current.element.offsetWidth),Object.freeze(D),d.current&&!e6t(s.current.lastBounds,D)&&l(s.current.lastBounds=D)};return[C,u?G8e(C,u):C,c?G8e(C,c):C]},[l,r,c,u]);function y(){s.current.scrollContainers&&(s.current.scrollContainers.forEach(C=>C.removeEventListener("scroll",g,!0)),s.current.scrollContainers=null),s.current.resizeObserver&&(s.current.resizeObserver.disconnect(),s.current.resizeObserver=null)}function w(){s.current.element&&(s.current.resizeObserver=new i(g),s.current.resizeObserver.observe(s.current.element),n&&s.current.scrollContainers&&s.current.scrollContainers.forEach(C=>C.addEventListener("scroll",g,{capture:!0,passive:!0})))}const b=C=>{!C||C===s.current.element||(y(),s.current.element=C,s.current.scrollContainers=GUe(C),w())};return Q3t(g,!!n),$3t(p),m.useEffect(()=>{y(),w()},[n,g,p]),m.useEffect(()=>y,[]),[b,a,f]}function $3t(t){m.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function Q3t(t,e){m.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function GUe(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:o,overflowY:r}=window.getComputedStyle(t);return[n,o,r].some(i=>i==="auto"||i==="scroll")&&e.push(t),[...e,...GUe(t.parentElement)]}const Z3t=["x","y","top","bottom","left","right","width","height"],e6t=(t,e)=>Z3t.every(n=>t[n]===e[n]);var t6t=Object.defineProperty,n6t=Object.defineProperties,o6t=Object.getOwnPropertyDescriptors,X8e=Object.getOwnPropertySymbols,r6t=Object.prototype.hasOwnProperty,i6t=Object.prototype.propertyIsEnumerable,J8e=(t,e,n)=>e in t?t6t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,K8e=(t,e)=>{for(var n in e||(e={}))r6t.call(e,n)&&J8e(t,n,e[n]);if(X8e)for(var n of X8e(e))i6t.call(e,n)&&J8e(t,n,e[n]);return t},a6t=(t,e)=>n6t(t,o6t(e));function XUe(t,e,n){if(!t)return;if(n(t)===!0)return t;let o=t.child;for(;o;){const r=XUe(o,e,n);if(r)return r;o=o.sibling}}function JUe(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const cge=JUe(m.createContext(null));class KUe extends m.Component{render(){return m.createElement(cge.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:q8e,ReactCurrentDispatcher:$8e}=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function l6t(){const t=m.useContext(cge);if(t===null)throw new Error("its-fine: useFiber must be called within a !");const e=m.useId();return m.useMemo(()=>{for(const o of[q8e==null?void 0:q8e.current,t,t==null?void 0:t.alternate]){if(!o)continue;const r=XUe(o,!1,i=>{let a=i.memoizedState;for(;a;){if(a.memoizedState===e)return!0;a=a.next}});if(r)return r}},[t,e])}function s6t(){var t,e;const n=l6t(),[o]=m.useState(()=>new Map);o.clear();let r=n;for(;r;){const i=(t=r.type)==null?void 0:t._context;i&&i!==cge&&!o.has(i)&&o.set(i,(e=$8e==null?void 0:$8e.current)==null?void 0:e.readContext(JUe(i))),r=r.return}return o}function c6t(){const t=s6t();return m.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>o=>m.createElement(e,null,m.createElement(n.Provider,a6t(K8e({},o),{value:t.get(n)}))),e=>m.createElement(KUe,K8e({},e))),[t])}const dre={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 u6t(t){const{handlePointer:e}=U3t(t);return{priority:1,enabled:!0,compute(n,o,r){o.pointer.set(n.offsetX/o.size.width*2-1,-(n.offsetY/o.size.height)*2+1),o.raycaster.setFromCamera(o.pointer,o.camera)},connected:void 0,handlers:Object.keys(dre).reduce((n,o)=>({...n,[o]:e(o)}),{}),update:()=>{var n;const{events:o,internal:r}=t.getState();(n=r.lastEvent)!=null&&n.current&&o.handlers&&o.handlers.onPointerMove(r.lastEvent.current)},connect:n=>{var o;const{set:r,events:i}=t.getState();i.disconnect==null||i.disconnect(),r(a=>({events:{...a.events,connected:n}})),Object.entries((o=i.handlers)!=null?o:[]).forEach(([a,l])=>{const[s,c]=dre[a];n.addEventListener(s,l,{passive:c})})},disconnect:()=>{const{set:n,events:o}=t.getState();if(o.connected){var r;Object.entries((r=o.handlers)!=null?r:[]).forEach(([i,a])=>{if(o&&o.connected instanceof HTMLElement){const[l]=dre[i];o.connected.removeEventListener(l,a)}}),n(i=>({events:{...i.events,connected:void 0}}))}}}}const d6t=m.forwardRef(function({children:e,fallback:n,resize:o,style:r,gl:i,events:a=u6t,eventSource:l,eventPrefix:s,shadows:c,linear:u,flat:d,legacy:f,orthographic:p,frameloop:g,dpr:y,performance:w,raycaster:b,camera:C,scene:P,onPointerMissed:v,onCreated:T,...A},x){m.useMemo(()=>xb(w3t),[]);const S=c6t(),[R,M]=q3t({scroll:!0,debounce:{scroll:50,resize:0},...o}),D=m.useRef(null),E=m.useRef(null);m.useImperativeHandle(x,()=>D.current);const W=kUe(v),[j,L]=m.useState(!1),[k,N]=m.useState(!1);if(j)throw j;if(k)throw k;const F=m.useRef(null);aW(()=>{const O=D.current;M.width>0&&M.height>0&&O&&(F.current||(F.current=X3t(O)),F.current.configure({gl:i,events:a,shadows:c,linear:u,flat:d,legacy:f,orthographic:p,frameloop:g,dpr:y,performance:w,raycaster:b,camera:C,scene:P,size:M,onPointerMissed:(...B)=>W.current==null?void 0:W.current(...B),onCreated:B=>{B.events.connect==null||B.events.connect(l?I3t(l)?l.current:l:E.current),s&&B.setEvents({compute:(_,X)=>{const $=_[s+"X"],Q=_[s+"Y"];X.pointer.set($/X.size.width*2-1,-(Q/X.size.height)*2+1),X.raycaster.setFromCamera(X.pointer,X.camera)}}),T==null||T(B)}}),F.current.render(m.createElement(S,null,m.createElement(LUe,{set:N},m.createElement(m.Suspense,{fallback:m.createElement(z3t,{set:L})},e)))))}),m.useEffect(()=>{const O=D.current;if(O)return()=>VUe(O)},[]);const U=l?"none":"auto";return m.createElement("div",lG({ref:E,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:U,...r}},A),m.createElement("div",{ref:R,style:{width:"100%",height:"100%"}},m.createElement("canvas",{ref:D,style:{display:"block"}},n)))}),f6t=m.forwardRef(function(e,n){return m.createElement(KUe,null,m.createElement(d6t,lG({},e,{ref:n})))});function h6t(t,e,n){return e=sG(e),b6t(t,qUe()?Reflect.construct(e,n||[],sG(t).constructor):e.apply(t,n))}function qUe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qUe=function(){return!!t})()}function p6t(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var o,r,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;s=!1}else for(;!(s=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);s=!0);}catch(u){c=!0,r=u}finally{try{if(!s&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}function g6t(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function m6t(t){var e=g6t(t,"string");return typeof e=="symbol"?e:String(e)}function y6t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A6t(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,o=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:10,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"rgba(255, 255, 255, 1)";return y6t(this,e),n=h6t(this,e,[new ST.SpriteMaterial]),n._text="".concat(o),n._textHeight=r,n._color=i,n._backgroundColor=!1,n._padding=0,n._borderWidth=0,n._borderRadius=0,n._borderColor="white",n._strokeWidth=0,n._strokeColor="white",n._fontFace="system-ui",n._fontSize=90,n._fontWeight="normal",n._canvas=document.createElement("canvas"),n._genCanvas(),n}return w6t(e,[{key:"text",get:function(){return this._text},set:function(o){this._text=o,this._genCanvas()}},{key:"textHeight",get:function(){return this._textHeight},set:function(o){this._textHeight=o,this._genCanvas()}},{key:"color",get:function(){return this._color},set:function(o){this._color=o,this._genCanvas()}},{key:"backgroundColor",get:function(){return this._backgroundColor},set:function(o){this._backgroundColor=o,this._genCanvas()}},{key:"padding",get:function(){return this._padding},set:function(o){this._padding=o,this._genCanvas()}},{key:"borderWidth",get:function(){return this._borderWidth},set:function(o){this._borderWidth=o,this._genCanvas()}},{key:"borderRadius",get:function(){return this._borderRadius},set:function(o){this._borderRadius=o,this._genCanvas()}},{key:"borderColor",get:function(){return this._borderColor},set:function(o){this._borderColor=o,this._genCanvas()}},{key:"fontFace",get:function(){return this._fontFace},set:function(o){this._fontFace=o,this._genCanvas()}},{key:"fontSize",get:function(){return this._fontSize},set:function(o){this._fontSize=o,this._genCanvas()}},{key:"fontWeight",get:function(){return this._fontWeight},set:function(o){this._fontWeight=o,this._genCanvas()}},{key:"strokeWidth",get:function(){return this._strokeWidth},set:function(o){this._strokeWidth=o,this._genCanvas()}},{key:"strokeColor",get:function(){return this._strokeColor},set:function(o){this._strokeColor=o,this._genCanvas()}},{key:"_genCanvas",value:function(){var o=this,r=this._canvas,i=r.getContext("2d"),a=Array.isArray(this.borderWidth)?this.borderWidth:[this.borderWidth,this.borderWidth],l=a.map(function(x){return x*o.fontSize*.1}),s=Array.isArray(this.borderRadius)?this.borderRadius:[this.borderRadius,this.borderRadius,this.borderRadius,this.borderRadius],c=s.map(function(x){return x*o.fontSize*.1}),u=Array.isArray(this.padding)?this.padding:[this.padding,this.padding],d=u.map(function(x){return x*o.fontSize*.1}),f=this.text.split(` -`),p="".concat(this.fontWeight," ").concat(this.fontSize,"px ").concat(this.fontFace);i.font=p;var g=Math.max.apply(Math,rY(f.map(function(x){return i.measureText(x).width}))),y=this.fontSize*f.length;if(r.width=g+l[0]*2+d[0]*2,r.height=y+l[1]*2+d[1]*2,this.borderWidth){if(i.strokeStyle=this.borderColor,l[0]){var w=l[0]/2;i.lineWidth=l[0],i.beginPath(),i.moveTo(w,c[0]),i.lineTo(w,r.height-c[3]),i.moveTo(r.width-w,c[1]),i.lineTo(r.width-w,r.height-c[2]),i.stroke()}if(l[1]){var b=l[1]/2;i.lineWidth=l[1],i.beginPath(),i.moveTo(Math.max(l[0],c[0]),b),i.lineTo(r.width-Math.max(l[0],c[1]),b),i.moveTo(Math.max(l[0],c[3]),r.height-b),i.lineTo(r.width-Math.max(l[0],c[2]),r.height-b),i.stroke()}if(this.borderRadius){var C=Math.max.apply(Math,rY(l)),P=C/2;i.lineWidth=C,i.beginPath(),[!!c[0]&&[c[0],P,P,c[0]],!!c[1]&&[r.width-c[1],r.width-P,P,c[1]],!!c[2]&&[r.width-c[2],r.width-P,r.height-P,r.height-c[2]],!!c[3]&&[c[3],P,r.height-P,r.height-c[3]]].filter(function(x){return x}).forEach(function(x){var S=$8e(x,4),R=S[0],M=S[1],D=S[2],E=S[3];i.moveTo(R,D),i.quadraticCurveTo(M,D,M,E)}),i.stroke()}}this.backgroundColor&&(i.fillStyle=this.backgroundColor,this.borderRadius?(i.beginPath(),i.moveTo(l[0],c[0]),[[l[0],c[0],r.width-c[1],l[1],l[1],l[1]],[r.width-l[0],r.width-l[0],r.width-l[0],l[1],c[1],r.height-c[2]],[r.width-l[0],r.width-c[2],c[3],r.height-l[1],r.height-l[1],r.height-l[1]],[l[0],l[0],l[0],r.height-l[1],r.height-c[3],c[0]]].forEach(function(x){var S=$8e(x,6),R=S[0],M=S[1],D=S[2],E=S[3],W=S[4],j=S[5];i.quadraticCurveTo(R,E,M,W),i.lineTo(D,j)}),i.closePath(),i.fill()):i.fillRect(l[0],l[1],r.width-l[0]*2,r.height-l[1]*2)),i.translate.apply(i,rY(l)),i.translate.apply(i,rY(d)),i.font=p,i.fillStyle=this.color,i.textBaseline="bottom";var v=this.strokeWidth>0;v&&(i.lineWidth=this.strokeWidth*this.fontSize/10,i.strokeStyle=this.strokeColor),f.forEach(function(x,S){var R=(g-i.measureText(x).width)/2,M=(S+1)*o.fontSize;v&&i.strokeText(x,R,M),i.fillText(x,R,M)}),this.material.map&&this.material.map.dispose();var T=this.material.map=new ST.Texture(r);T.minFilter=ST.LinearFilter,T.colorSpace=ST.SRGBColorSpace,T.needsUpdate=!0;var A=this.textHeight*f.length+a[1]*2+u[1]*2;this.scale.set(A*r.width/r.height,A,0)}},{key:"clone",value:function(){return new this.constructor(this.text,this.textHeight,this.color).copy(this)}},{key:"copy",value:function(o){return ST.Sprite.prototype.copy.call(this,o),this.color=o.color,this.backgroundColor=o.backgroundColor,this.padding=o.padding,this.borderWidth=o.borderWidth,this.borderColor=o.borderColor,this.fontFace=o.fontFace,this.fontSize=o.fontSize,this.fontWeight=o.fontWeight,this.strokeWidth=o.strokeWidth,this.strokeColor=o.strokeColor,this}}]),e}(ST.Sprite);const Y7={type:"change"},fre={type:"start"},O7={type:"end"};class M6t extends Z9{constructor(e,n){super(),n===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),n===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new ie,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.moveSpeed=1,this.turnSpeed=1,this.keys={MOVE_LEFT:"KeyA",MOVE_RIGHT:"KeyD",MOVE_FORWARD:"KeyW",MOVE_BACKWARD:"KeyS",MOVE_UP:"KeyZ",MOVE_DOWN:"KeyX",ROTATE_LEFT:"ArrowLeft",ROTATE_UP:"ArrowUp",ROTATE_RIGHT:"ArrowRight",ROTATE_DOWN:"ArrowDown"},this.mouseButtons={LEFT:av.ROTATE,MIDDLE:av.DOLLY,RIGHT:av.PAN},this.touches={ONE:lv.ROTATE,TWO:lv.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(Ne){Ne.addEventListener("keydown",Te),this._domElementKeyEvents=Ne,x=!1,S=0},this.removeKeyEvents=function(){o._domElementKeyEvents!==null&&o._domElementKeyEvents.removeEventListener("keydown",Te)},this.saveState=function(){o.target0.copy(o.target),o.position0.copy(o.object.position),o.zoom0=o.object.zoom},this.reset=function(){o.target.copy(o.target0),o.object.position.copy(o.position0),o.object.zoom=o.zoom0,o.object.updateProjectionMatrix(),o.dispatchEvent(Y7),o.update(),i=r.NONE},this.update=function(){const Ne=new ie,De=new bs().setFromUnitVectors(e.up,new ie(0,1,0)),ke=De.clone().invert(),Ye=new ie,it=new bs,Ve=2*Math.PI;return function(){const ct=o.object.position;Ne.copy(ct).sub(o.target),Ne.applyQuaternion(De),l.setFromVector3(Ne),o.autoRotate&&i===r.NONE&&D(R()),o.enableDamping?(l.theta+=s.theta*o.dampingFactor,l.phi+=s.phi*o.dampingFactor):(l.theta+=s.theta,l.phi+=s.phi);let Xe=o.minAzimuthAngle,ut=o.maxAzimuthAngle;return isFinite(Xe)&&isFinite(ut)&&(Xe<-Math.PI?Xe+=Ve:Xe>Math.PI&&(Xe-=Ve),ut<-Math.PI?ut+=Ve:ut>Math.PI&&(ut-=Ve),Xe<=ut?l.theta=Math.max(Xe,Math.min(ut,l.theta)):l.theta=l.theta>(Xe+ut)/2?Math.max(Xe,l.theta):Math.min(ut,l.theta)),l.phi=Math.max(o.minPolarAngle,Math.min(o.maxPolarAngle,l.phi)),l.makeSafe(),l.radius*=c,l.radius=Math.max(o.minDistance,Math.min(o.maxDistance,l.radius)),o.enableDamping===!0?o.target.addScaledVector(u,o.dampingFactor):o.target.add(u),Ne.setFromSpherical(l),Ne.applyQuaternion(ke),ct.copy(o.target).add(Ne),o.object.lookAt(o.target),o.enableDamping===!0?(s.theta*=1-o.dampingFactor,s.phi*=1-o.dampingFactor,u.multiplyScalar(1-o.dampingFactor)):(s.set(0,0,0),u.set(0,0,0)),c=1,d||Ye.distanceToSquared(o.object.position)>a||8*(1-it.dot(o.object.quaternion))>a?(o.dispatchEvent(Y7),Ye.copy(o.object.position),it.copy(o.object.quaternion),d=!1,!0):!1}}(),this.dispose=function(){o.domElement.removeEventListener("contextmenu",Ee),o.domElement.removeEventListener("pointerdown",ze),o.domElement.removeEventListener("pointercancel",ce),o.domElement.removeEventListener("wheel",Ae),o.domElement.removeEventListener("pointermove",Ie),o.domElement.removeEventListener("pointerup",ye),o._domElementKeyEvents!==null&&o._domElementKeyEvents.removeEventListener("keydown",Te)};const o=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let i=r.NONE;const a=1e-6,l=new Rce,s=new Rce;let c=1;const u=new ie;let d=!1;const f=new Xt,p=new Xt,g=new Xt,y=new Xt,w=new Xt,b=new Xt,C=new Xt,P=new Xt,v=new Xt,T=[],A={};let x=!1,S=0;function R(){return 2*Math.PI/60/60*o.autoRotateSpeed}function M(){return Math.pow(.95,o.zoomSpeed)}function D(Ne){s.theta-=Ne}function E(Ne){s.phi-=Ne}const W=function(){const Ne=new ie;return function(ke,Ye){Ne.setFromMatrixColumn(Ye,0),Ne.multiplyScalar(-ke),u.add(Ne)}}(),j=function(){const Ne=new ie;return function(ke,Ye){o.screenSpacePanning===!0?Ne.setFromMatrixColumn(Ye,1):(Ne.setFromMatrixColumn(Ye,0),Ne.crossVectors(o.object.up,Ne)),Ne.multiplyScalar(ke),u.add(Ne)}}(),L=function(){const Ne=new ie;return function(ke,Ye){const it=o.domElement;if(o.object.isPerspectiveCamera){const Ve=o.object.position;Ne.copy(Ve).sub(o.target);let yt=Ne.length();yt*=Math.tan(o.object.fov/2*Math.PI/180),W(2*ke*yt/it.clientHeight,o.object.matrix),j(2*Ye*yt/it.clientHeight,o.object.matrix)}else o.object.isOrthographicCamera?(W(ke*(o.object.right-o.object.left)/o.object.zoom/it.clientWidth,o.object.matrix),j(Ye*(o.object.top-o.object.bottom)/o.object.zoom/it.clientHeight,o.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),o.enablePan=!1)}}(),k=function(){const Ne=new ie;return function(ke){const Ye=o.object;Ne.setFromMatrixColumn(Ye.matrix,1),Ne.multiplyScalar(ke*.1),Ye.position.add(Ne),Ye.position.z=Math.max(0,Ye.position.z),o.dispatchEvent(Y7),o.dispatchEvent(O7)}}(),N=function(){const Ne=new ie;return function(ke){const Ye=o.object;Ne.setFromMatrixColumn(Ye.matrix,0),Ne.crossVectors(Ye.up,Ne),Ne.multiplyScalar(ke*.1),Ye.position.add(Ne),o.dispatchEvent(Y7),o.dispatchEvent(O7)}}(),F=function(){const Ne=new ie;return function(ke){const Ye=o.object;Ne.setFromMatrixColumn(Ye.matrix,0),Ne.multiplyScalar(ke*.1),Ye.position.add(Ne),o.dispatchEvent(Y7),o.dispatchEvent(O7)}}(),U=function(){const Ne=new nn(0,0,0,"ZXY");return function(ke){const Ye=o.object;Ne.setFromQuaternion(Ye.quaternion),Math.abs(Math.abs(Ne.z-S)-Math.PI)<.01&&(x=!x),x?Ne.x-=.01*ke:Ne.x+=.01*ke,Ne.x=Math.max(.1,Ne.x),S=Ne.z,Ye.quaternion.setFromEuler(Ne),o.dispatchEvent(Y7),o.dispatchEvent(O7)}}(),O=function(){const Ne=new nn(0,0,0,"ZXY");return function(ke){const Ye=o.object;Ne.setFromQuaternion(Ye.quaternion),Ne.z-=.01*ke,Ye.quaternion.setFromEuler(Ne),o.dispatchEvent(Y7),o.dispatchEvent(O7)}}();function B(Ne){o.object.isPerspectiveCamera?c/=Ne:o.object.isOrthographicCamera?(o.object.zoom=Math.max(o.minZoom,Math.min(o.maxZoom,o.object.zoom*Ne)),o.object.updateProjectionMatrix(),d=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),o.enableZoom=!1)}function _(Ne){o.object.isPerspectiveCamera?c*=Ne:o.object.isOrthographicCamera?(o.object.zoom=Math.max(o.minZoom,Math.min(o.maxZoom,o.object.zoom/Ne)),o.object.updateProjectionMatrix(),d=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),o.enableZoom=!1)}function X(Ne){f.set(Ne.clientX,Ne.clientY)}function $(Ne){C.set(Ne.clientX,Ne.clientY)}function Q(Ne){y.set(Ne.clientX,Ne.clientY)}function le(Ne){p.set(Ne.clientX,Ne.clientY),g.subVectors(p,f).multiplyScalar(o.rotateSpeed);const De=o.domElement;D(2*Math.PI*g.x/De.clientHeight),E(2*Math.PI*g.y/De.clientHeight),f.copy(p),o.update()}function q(Ne){P.set(Ne.clientX,Ne.clientY),v.subVectors(P,C),v.y>0?B(M()):v.y<0&&_(M()),C.copy(P),o.update()}function te(Ne){w.set(Ne.clientX,Ne.clientY),b.subVectors(w,y).multiplyScalar(o.panSpeed),L(b.x,b.y),y.copy(w),o.update()}function re(Ne){Ne.deltaY<0?_(M()):Ne.deltaY>0&&B(M()),o.update()}function ae(Ne){switch(Ne.code){case o.keys.MOVE_FORWARD:N(o.moveSpeed);break;case o.keys.MOVE_BACKWARD:N(-o.moveSpeed);break;case o.keys.MOVE_UP:k(o.moveSpeed);break;case o.keys.MOVE_DOWN:k(-o.moveSpeed);break;case o.keys.MOVE_RIGHT:F(o.moveSpeed);break;case o.keys.MOVE_LEFT:F(-o.moveSpeed);break;case o.keys.ROTATE_UP:U(o.turnSpeed);break;case o.keys.ROTATE_DOWN:U(-o.turnSpeed);break;case o.keys.ROTATE_LEFT:O(-o.turnSpeed);break;case o.keys.ROTATE_RIGHT:O(o.turnSpeed);break}}function se(){if(T.length===1)f.set(T[0].pageX,T[0].pageY);else{const Ne=.5*(T[0].pageX+T[1].pageX),De=.5*(T[0].pageY+T[1].pageY);f.set(Ne,De)}}function ne(){if(T.length===1)y.set(T[0].pageX,T[0].pageY);else{const Ne=.5*(T[0].pageX+T[1].pageX),De=.5*(T[0].pageY+T[1].pageY);y.set(Ne,De)}}function fe(){const Ne=T[0].pageX-T[1].pageX,De=T[0].pageY-T[1].pageY,ke=Math.sqrt(Ne*Ne+De*De);C.set(0,ke)}function ge(){o.enableZoom&&fe(),o.enablePan&&ne()}function de(){o.enableZoom&&fe(),o.enableRotate&&se()}function Z(Ne){if(T.length===1)p.set(Ne.pageX,Ne.pageY);else{const ke=Ke(Ne),Ye=.5*(Ne.pageX+ke.x),it=.5*(Ne.pageY+ke.y);p.set(Ye,it)}g.subVectors(p,f).multiplyScalar(o.rotateSpeed);const De=o.domElement;D(2*Math.PI*g.x/De.clientHeight),E(2*Math.PI*g.y/De.clientHeight),f.copy(p)}function he(Ne){if(T.length===1)w.set(Ne.pageX,Ne.pageY);else{const De=Ke(Ne),ke=.5*(Ne.pageX+De.x),Ye=.5*(Ne.pageY+De.y);w.set(ke,Ye)}b.subVectors(w,y).multiplyScalar(o.panSpeed),L(b.x,b.y),y.copy(w)}function xe(Ne){const De=Ke(Ne),ke=Ne.pageX-De.x,Ye=Ne.pageY-De.y,it=Math.sqrt(ke*ke+Ye*Ye);P.set(0,it),v.set(0,Math.pow(P.y/C.y,o.zoomSpeed)),B(v.y),C.copy(P)}function He(Ne){o.enableZoom&&xe(Ne),o.enablePan&&he(Ne)}function Se(Ne){o.enableZoom&&xe(Ne),o.enableRotate&&Z(Ne)}function ze(Ne){o.enabled!==!1&&(T.length===0&&(o.domElement.setPointerCapture(Ne.pointerId),o.domElement.addEventListener("pointermove",Ie),o.domElement.addEventListener("pointerup",ye)),Be(Ne),Ne.pointerType==="touch"?Me(Ne):pe(Ne))}function Ie(Ne){o.enabled!==!1&&(Ne.pointerType==="touch"?Pe(Ne):ve(Ne))}function ye(Ne){Je(Ne),T.length===0&&(o.domElement.releasePointerCapture(Ne.pointerId),o.domElement.removeEventListener("pointermove",Ie),o.domElement.removeEventListener("pointerup",ye)),o.dispatchEvent(O7),i=r.NONE}function ce(Ne){Je(Ne)}function pe(Ne){let De;switch(Ne.button){case 0:De=o.mouseButtons.LEFT;break;case 1:De=o.mouseButtons.MIDDLE;break;case 2:De=o.mouseButtons.RIGHT;break;default:De=-1}switch(De){case av.DOLLY:if(o.enableZoom===!1)return;$(Ne),i=r.DOLLY;break;case av.ROTATE:if(o.object.isOrthographicCamera){if(o.enablePan===!1)return;Q(Ne),i=r.PAN}else if(Ne.ctrlKey||Ne.metaKey){if(o.enablePan===!1)return;Q(Ne),i=r.PAN}else{if(o.enableRotate===!1)return;X(Ne),i=r.ROTATE}break;case av.PAN:if(Ne.ctrlKey||Ne.metaKey){if(o.enableRotate===!1)return;X(Ne),i=r.ROTATE}else{if(o.enablePan===!1)return;Q(Ne),i=r.PAN}break;default:i=r.NONE}i!==r.NONE&&o.dispatchEvent(fre)}function ve(Ne){if(o.enabled!==!1)switch(i){case r.ROTATE:if(o.enableRotate===!1)return;le(Ne);break;case r.DOLLY:if(o.enableZoom===!1)return;q(Ne);break;case r.PAN:if(o.enablePan===!1)return;te(Ne);break}}function Ae(Ne){o.enabled===!1||o.enableZoom===!1||i!==r.NONE||(Ne.preventDefault(),o.dispatchEvent(fre),re(Ne),o.dispatchEvent(O7))}function Te(Ne){o.enabled===!1||o.enablePan===!1||ae(Ne)}function Me(Ne){switch(We(Ne),T.length){case 1:switch(o.touches.ONE){case lv.ROTATE:if(o.enableRotate===!1)return;se(),i=r.TOUCH_ROTATE;break;case lv.PAN:if(o.enablePan===!1)return;ne(),i=r.TOUCH_PAN;break;default:i=r.NONE}break;case 2:switch(o.touches.TWO){case lv.DOLLY_PAN:if(o.enableZoom===!1&&o.enablePan===!1)return;ge(),i=r.TOUCH_DOLLY_PAN;break;case lv.DOLLY_ROTATE:if(o.enableZoom===!1&&o.enableRotate===!1)return;de(),i=r.TOUCH_DOLLY_ROTATE;break;default:i=r.NONE}break;default:i=r.NONE}i!==r.NONE&&o.dispatchEvent(fre)}function Pe(Ne){switch(We(Ne),i){case r.TOUCH_ROTATE:if(o.enableRotate===!1)return;Z(Ne),o.update();break;case r.TOUCH_PAN:if(o.enablePan===!1)return;he(Ne),o.update();break;case r.TOUCH_DOLLY_PAN:if(o.enableZoom===!1&&o.enablePan===!1)return;He(Ne),o.update();break;case r.TOUCH_DOLLY_ROTATE:if(o.enableZoom===!1&&o.enableRotate===!1)return;Se(Ne),o.update();break;default:i=r.NONE}}function Ee(Ne){o.enabled!==!1&&Ne.preventDefault()}function Be(Ne){T.push(Ne)}function Je(Ne){delete A[Ne.pointerId];for(let De=0;De=4){this.makeEmpty();for(let n=0,o=e.length;nthis.tolerance)return!1;return!0}intersectRay(e,n){const o=this.faces;let r=-1/0,i=1/0;for(let a=0,l=o.length;a0&&u>=0)return null;const d=u!==0?-c/u:0;if(!(d<=0)&&(u>0?i=Math.min(d,i):r=Math.max(d,r),r>i))return null}return r!==-1/0?e.at(r,n):e.at(i,n),n}intersectsRay(e){return this.intersectRay(e,z6t)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(e,n){return e.face=n,n.outside===null?this.assigned.append(e):this.assigned.insertBefore(n.outside,e),n.outside=e,this}removeVertexFromFace(e,n){return e===n.outside&&(e.next!==null&&e.next.face===n?n.outside=e.next:n.outside=null),this.assigned.remove(e),this}removeAllVerticesFromFace(e){if(e.outside!==null){const n=e.outside;let o=e.outside;for(;o.next!==null&&o.next.face===e;)o=o.next;return this.assigned.removeSubList(n,o),n.prev=o.next=null,e.outside=null,n}}deleteFaceVertices(e,n){const o=this.removeAllVerticesFromFace(e);if(o!==void 0)if(n===void 0)this.unassigned.appendChain(o);else{let r=o;do{const i=r.next;n.distanceToPoint(r.point)>this.tolerance?this.addVertexToFace(r,n):this.unassigned.append(r),r=i}while(r!==null)}return this}resolveUnassignedPoints(e){if(this.unassigned.isEmpty()===!1){let n=this.unassigned.first();do{const o=n.next;let r=this.tolerance,i=null;for(let a=0;ar&&(r=s,i=l),r>1e3*this.tolerance)break}}i!==null&&this.addVertexToFace(n,i),n=o}while(n!==null)}return this}computeExtremes(){const e=new ie,n=new ie,o=[],r=[];for(let i=0;i<3;i++)o[i]=r[i]=this.vertices[0];e.copy(this.vertices[0].point),n.copy(this.vertices[0].point);for(let i=0,a=this.vertices.length;in.getComponent(c)&&(n.setComponent(c,s.getComponent(c)),r[c]=l)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(e.x),Math.abs(n.x))+Math.max(Math.abs(e.y),Math.abs(n.y))+Math.max(Math.abs(e.z),Math.abs(n.z))),{min:o,max:r}}computeInitialHull(){const e=this.vertices,n=this.computeExtremes(),o=n.min,r=n.max;let i=0,a=0;for(let f=0;f<3;f++){const p=r[f].point.getComponent(f)-o[f].point.getComponent(f);p>i&&(i=p,a=f)}const l=o[a],s=r[a];let c,u;i=0,Q8e.set(l.point,s.point);for(let f=0,p=this.vertices.length;fi&&(i=y,c=g)}}i=-1,hre.setFromCoplanarPoints(l.point,s.point,c.point);for(let f=0,p=this.vertices.length;fi&&(i=y,u=g)}}const d=[];if(hre.distanceToPoint(u.point)<0){d.push(o2.create(l,s,c),o2.create(u,s,l),o2.create(u,c,s),o2.create(u,l,c));for(let f=0;f<3;f++){const p=(f+1)%3;d[f+1].getEdge(2).setTwin(d[0].getEdge(p)),d[f+1].getEdge(1).setTwin(d[p+1].getEdge(0))}}else{d.push(o2.create(l,c,s),o2.create(u,l,s),o2.create(u,s,c),o2.create(u,c,l));for(let f=0;f<3;f++){const p=(f+1)%3;d[f+1].getEdge(2).setTwin(d[0].getEdge((3-f)%3)),d[f+1].getEdge(0).setTwin(d[p+1].getEdge(1))}}for(let f=0;f<4;f++)this.faces.push(d[f]);for(let f=0,p=e.length;fi&&(i=b,y=this.faces[w])}y!==null&&this.addVertexToFace(g,y)}}return this}reindexFaces(){const e=[];for(let n=0;nn&&(n=i,e=r),r=r.next}while(r!==null&&r.face===o);return e}}computeHorizon(e,n,o,r){this.deleteFaceVertices(o),o.mark=I6t;let i;n===null?i=n=o.getEdge(0):i=n.next;do{const a=i.twin,l=a.face;l.mark===z_&&(l.distanceToPoint(e)>this.tolerance?this.computeHorizon(e,a,l,r):r.push(i)),i=i.next}while(i!==n);return this}addAdjoiningFace(e,n){const o=o2.create(e,n.tail(),n.head());return this.faces.push(o),o.getEdge(-1).setTwin(n.twin),o.getEdge(0)}addNewFaces(e,n){this.newFaces=[];let o=null,r=null;for(let i=0;i0;)n=n.next,e--;for(;e<0;)n=n.prev,e++;return n}compute(){const e=this.edge.tail(),n=this.edge.head(),o=this.edge.next.head();return iY.set(e.point,n.point,o.point),iY.getNormal(this.normal),iY.getMidpoint(this.midpoint),this.area=iY.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(e){return this.normal.dot(e)-this.constant}}class pre{constructor(e,n){this.vertex=e,this.prev=null,this.next=null,this.twin=null,this.face=n}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const e=this.head(),n=this.tail();return n!==null?n.point.distanceTo(e.point):-1}lengthSquared(){const e=this.head(),n=this.tail();return n!==null?n.point.distanceToSquared(e.point):-1}setTwin(e){return this.twin=e,e.twin=this,this}}class E6t{constructor(e){this.point=e,this.prev=null,this.next=null,this.face=null}}class ewe{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,n){return n.prev=e.prev,n.next=e,n.prev===null?this.head=n:n.prev.next=n,e.prev=n,this}insertAfter(e,n){return n.prev=e,n.next=e.next,n.next===null?this.tail=n:n.next.prev=n,e.next=n,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,n){return e.prev===null?this.head=n.next:e.prev.next=n.next,n.next===null?this.tail=e.prev:n.next.prev=e.prev,this}isEmpty(){return this.head===null}}class Fce extends Ni{constructor(e,n,o){super();const r=[],i=[],a=[],l=new nn(0,0,n),c=new D6t().setFromPoints(e).faces;for(let u=0;u(t.FILES="Files",t.LOG_DATA="Log Data",t))(sG||{}),sc=(t=>(t.UNKNOWN="UNKNOWN SCHOOL",t.SCHOOL1="SCHOOL 1",t.SCHOOL2="SCHOOL 2",t.SCHOOL3="SCHOOL 3",t.SCHOOL4="SCHOOL 4",t.SCHOOL5="SCHOOL 5",t))(sc||{}),Va=(t=>(t.UNKNOWN="UNKNOWN CLASS",t.CLASS1="CLASS 1",t.CLASS2="CLASS 2",t.CLASS3="CLASS 3",t.CLASS4="CLASS 4",t.CLASS5="CLASS 5",t.CLASS6="CLASS 6",t.CLASS7="CLASS 7",t.CLASS8="CLASS 8",t.CLASS9="CLASS 9",t))(Va||{}),d9=(t=>(t[t.ALL=0]="ALL",t[t.INDIVIDUALS=1]="INDIVIDUALS",t[t.GROUPS=2]="GROUPS",t))(d9||{}),ha=(t=>(t.UNKNOWN="Unknown",t.UNDER_CONSTRUCTION="Under Construction",t.RESIDENTIAL_BUILDING="Residential Building",t.COMMERCIAL_BUILDING="Commercial Building",t.SCHOOL_BUILDING="School Building",t.TOURIST_ATTRACTION="Tourist Attraction",t.PHOTOVOLTAIC="Photovoltaic",t.PARABOLIC_DISH="Parabolic Dish",t.PARABOLIC_TROUGH="Parabolic Trough",t.FRESNEL_REFLECTOR="Fresnel Reflector",t.SOLAR_POWER_TOWER="Solar Power Tower",t.WIND_TURBINE="Wind Turbine",t.COLOCATION_PROJECTS="Colocation Projects",t))(ha||{}),jc=(t=>(t[t.COMPLETE=0]="COMPLETE",t[t.ROOF_MISSING=1]="ROOF_MISSING",t[t.WALL_DISJOINED=2]="WALL_DISJOINED",t[t.WALL_EMPTY=3]="WALL_EMPTY",t))(jc||{}),Pi=(t=>(t.SOLAR_PANEL_TILT_ANGLE="Solar Panel Tilt Angle",t.SOLAR_PANEL_ARRAY="Solar Panel Array",t))(Pi||{}),To=(t=>(t[t.DAILY_TOTAL_OUTPUT=1]="DAILY_TOTAL_OUTPUT",t[t.YEARLY_TOTAL_OUTPUT=2]="YEARLY_TOTAL_OUTPUT",t[t.DAILY_AVERAGE_OUTPUT=3]="DAILY_AVERAGE_OUTPUT",t[t.YEARLY_AVERAGE_OUTPUT=4]="YEARLY_AVERAGE_OUTPUT",t[t.DAILY_PROFIT=5]="DAILY_PROFIT",t[t.YEARLY_PROFIT=6]="YEARLY_PROFIT",t))(To||{}),Vs=(t=>(t[t.GENETIC_ALGORITHM=1]="GENETIC_ALGORITHM",t[t.PARTICLE_SWARM_OPTIMIZATION=2]="PARTICLE_SWARM_OPTIMIZATION",t))(Vs||{}),Wm=(t=>(t[t.ROULETTE_WHEEL=1]="ROULETTE_WHEEL",t[t.TOURNAMENT=2]="TOURNAMENT",t))(Wm||{}),us=(t=>(t[t.GLOBAL_SEARCH_UNIFORM_SELECTION=1]="GLOBAL_SEARCH_UNIFORM_SELECTION",t[t.LOCAL_SEARCH_RANDOM_OPTIMIZATION=2]="LOCAL_SEARCH_RANDOM_OPTIMIZATION",t[t.GLOBAL_SEARCH_FITNESS_SHARING=3]="GLOBAL_SEARCH_FITNESS_SHARING",t))(us||{}),Gh=(t=>(t[t.Solid=1]="Solid",t[t.Dashed=2]="Dashed",t[t.Dotted=3]="Dotted",t))(Gh||{}),$y=(t=>(t[t.One=1]="One",t[t.Two=2]="Two",t[t.Three=3]="Three",t[t.Four=4]="Four",t[t.Five=5]="Five",t))($y||{}),Ml=(t=>(t[t.Line=1]="Line",t[t.Area=2]="Area",t))(Ml||{}),vi=(t=>(t[t.HourlyTemperatures=1]="HourlyTemperatures",t[t.MonthlyTemperatures=2]="MonthlyTemperatures",t[t.SunshineHours=3]="SunshineHours",t[t.DaylightData=4]="DaylightData",t[t.ClearnessData=5]="ClearnessData",t[t.YearlyRadiationSensorData=6]="YearlyRadiationSensorData",t[t.DailyRadiationSensorData=7]="DailyRadiationSensorData",t[t.YearlyPvYield=8]="YearlyPvYield",t[t.DailyPvYield=9]="DailyPvYield",t[t.YearlyParabolicTroughYield=10]="YearlyParabolicTroughYield",t[t.DailyParabolicTroughYield=11]="DailyParabolicTroughYield",t[t.YearlyParabolicDishYield=12]="YearlyParabolicDishYield",t[t.DailyParabolicDishYield=13]="DailyParabolicDishYield",t[t.YearlyFresnelReflectorYield=14]="YearlyFresnelReflectorYield",t[t.DailyFresnelReflectorYield=15]="DailyFresnelReflectorYield",t[t.YearlyHeliostatYield=16]="YearlyHeliostatYield",t[t.DailyHeliostatYield=17]="DailyHeliostatYield",t[t.YearlyUpdraftTowerYield=18]="YearlyUpdraftTowerYield",t[t.DailyUpdraftTowerYield=19]="DailyUpdraftTowerYield",t[t.YearlyBuildingEnergy=20]="YearlyBuildingEnergy",t[t.DailyBuildingEnergy=21]="DailyBuildingEnergy",t))(vi||{}),Os=(t=>(t.Default="Default",t.Desert="Desert",t.Dune="Dune",t.Forest="Forest",t.Grassland="Grassland",t.Hill="Hill",t.Lake="Lake",t.Mountain="Mountain",t.Rural="Rural",t))(Os||{}),y2=(t=>(t[t.Sinusoidal=1]="Sinusoidal",t[t.PartonLogan=2]="PartonLogan",t))(y2||{}),s9=(t=>(t.English="English",t.ChineseSimplified="简体中文",t.ChineseTraditional="繁体中文",t.Turkish="Türkçe",t.Spanish="Español",t.Ukrainian="Українська",t))(s9||{}),z=(t=>(t.Sky="Sky",t.Ground="Ground",t.Foundation="Foundation",t.Wall="Wall",t.Window="Window",t.Door="Door",t.Roof="Roof",t.PyramidRoof="Pyramid Roof",t.GableRoof="Gable Roof",t.HipRoof="Hip Roof",t.GambrelRoof="Gambrel Roof",t.MansardRoof="Mansard Roof",t.Sensor="Sensor",t.SolarPanel="Solar Panel",t.WaterHeater="Water Heater",t.ParabolicDish="Parabolic Dish",t.ParabolicTrough="Parabolic Trough",t.FresnelReflector="Fresnel Reflector",t.Heliostat="Heliostat",t.WindTurbine="Wind Turbine",t.VerticalAxisWindTurbine="Vertical Axis Wind Turbine",t.Cuboid="Cuboid",t.Human="Human",t.Tree="Tree",t.Flower="Flower",t.Polygon="Polygon",t.PolygonVertex="Polygon Vertex",t.Light="Light",t.BatteryStorage="Power Wall",t.None="None",t))(z||{}),uf=(t=>(t[t.CentralPole=1]="CentralPole",t[t.CentralPoleWithTripod=2]="CentralPoleWithTripod",t[t.Quadrupod=3]="Quadrupod",t))(uf||{}),Dn=(t=>(t[t.None=0]="None",t[t.FocusPipe=1]="FocusPipe",t[t.FocusTower=2]="FocusTower",t[t.UpdraftTower=3]="UpdraftTower",t))(Dn||{}),uc=(t=>(t[t.None=0]="None",t[t.Bicolor=1]="Bicolor",t[t.Striped=2]="Striped",t))(uc||{}),Oo=(t=>(t.Select="Select",t.Move="Move",t.Resize="Resize",t.Rotate="Rotate",t.ContextMenu="ContextMenu",t))(Oo||{}),Ho=(t=>(t.Default="Move Handle",t.Lower="Move Handle Lower",t.Upper="Move Handle Upper",t.Left="Move Handle Left",t.Right="Move Handle Right",t.Top="Move Handle Top",t.Mid="Move Handle Mid",t))(Ho||{}),Sl=(t=>(t.Left="Left",t.Right="Right",t.Up="Up",t.Down="Down",t))(Sl||{}),vt=(t=>(t.LowerLeft="Resize Handle Lower Left",t.UpperLeft="Resize Handle Upper Left",t.LowerRight="Resize Handle Lower Right",t.UpperRight="Resize Handle Upper Right",t.LowerLeftTop="Resize Handle Lower Left Top",t.UpperLeftTop="Resize Handle Upper Left Top",t.LowerRightTop="Resize Handle Lower Right Top",t.UpperRightTop="Resize Handle Upper Right Top",t.Lower="Resize Handle Lower",t.Upper="Resize Handle Upper",t.Left="Resize Handle Left",t.Right="Resize Handle Right",t.Top="Resize Handle Top",t.Default="Resize Handle",t.Arch="Resize Handle Arch",t.WallPartialResizeLeft="Wall Partial Resize Handle Left",t.WallPartialResizeRight="Wall Partial Resize Handle Right",t.WallPartialResizeLeftTop="Wall Partial Resize Handle Left Top",t.WallPartialResizeRightTop="Wall Partial Resize Handle Right Top",t))(vt||{}),Kr=(t=>(t.Lower="Rotate Handle Lower",t.Upper="Rotate Handle Upper",t.Tilt="Rotate Handle Tilt",t))(Kr||{}),sx=(t=>(t.Delete="Delete Vertex",t.InsertBeforeIndex="Insert Vertex Before Index",t.InsertAfterIndex="Insert Vertex After Index",t))(sx||{}),eh=(t=>(t.Horizontal="Horizontal",t.Vertical="Vertical",t.Ground="Ground",t.Sky="Sky",t))(eh||{}),oe=(t=>(t[t.OnlyThisObject=1]="OnlyThisObject",t[t.AllObjectsOfThisTypeOnSurface=2]="AllObjectsOfThisTypeOnSurface",t[t.AllObjectsOfThisTypeAboveFoundation=3]="AllObjectsOfThisTypeAboveFoundation",t[t.AllObjectsOfThisType=4]="AllObjectsOfThisType",t[t.AllConnectedObjects=5]="AllConnectedObjects",t[t.OnlyThisSide=6]="OnlyThisSide",t[t.AllSelectedObjectsOfThisType=7]="AllSelectedObjectsOfThisType",t))(oe||{}),vr=(t=>(t.portrait="Portrait",t.landscape="Landscape",t))(vr||{}),Dl=(t=>(t.eastWest="East-West",t.northSouth="North-South",t.leftRight="Left-Right",t.upDown="Up-Down",t))(Dl||{}),za=(t=>(t.NO_TRACKER="None",t.HORIZONTAL_SINGLE_AXIS_TRACKER="HSAT",t.ALTAZIMUTH_DUAL_AXIS_TRACKER="AADAT",t.VERTICAL_SINGLE_AXIS_TRACKER="VSAT",t.TILTED_SINGLE_AXIS_TRACKER="TSAT",t))(za||{}),Fv=(t=>(t.NONE="None",t.HIGH="High",t.PARTIAL="Partial",t))(Fv||{}),Fm=(t=>(t.EXACT="Exact",t.APPROXIMATE="Approximate",t))(Fm||{}),pr=(t=>(t.Apple="Apple",t.Birch="Birch",t.Coconut="Coconut",t.Dogwood="Dogwood",t.Elm="Elm",t.FanPalm="Fan Palm",t.Linden="Linden",t.Magnolia="Magnolia",t.Maple="Maple",t.Oak="Oak",t.Pine="Pine",t.Spruce="Spruce",t))(pr||{}),ro=(t=>(t.Bellflower="Bellflower",t.Boxwood="Boxwood",t.CactusCombo1="Cactus Combo 1",t.CactusCombo2="Cactus Combo 2",t.CactusCombo3="Cactus Combo 3",t.CactusCombo4="Cactus Combo 4",t.Hibiscus="Hibiscus",t.Hosta="Hosta",t.Hydrangea="Hydrangea",t.Peony="Peony",t.RedRose="Red Rose",t.Spirea="Spirea",t.Sunflower="Sunflower",t.TallBush="Tall Bush",t.Tulip="Tulip",t.WhiteFlower="White Flower",t.YellowFlower="Yellow Flower",t))(ro||{}),Ha=(t=>(t.Male="Male",t.Female="Female",t.Other="Other",t))(Ha||{}),Yt=(t=>(t.Jaah="Jaah",t.Jack="Jack",t.Jacob="Jacob",t.Jacqueline="Jacqueline",t.Jade="Jade",t.Jamelia="Jamelia",t.James="James",t.Jane="Jane",t.Jaya="Jaya",t.Jaye="Jaye",t.Jeanette="Jeanette",t.Jedi="Jedi",t.Jeff="Jeff",t.Jena="Jena",t.Jennifer="Jennifer",t.Jess="Jess",t.Jett="Jett",t.Jill="Jill",t.Jiya="Jiya",t.Jocelyn="Jocelyn",t.Joan="Joan",t.Joel="Joel",t.Joey="Joey",t.John="John",t.Jonathon="Jonathon",t.Joseph="Joseph",t.Jose="Jose",t.Joshua="Joshua",t.Judd="Judd",t.Judy="Judy",t.Julia="Julia",t.Julio="Julio",t.Jumapili="Jumapili",t.June="June",t.Juro="Juro",t.Justin="Justin",t))(Yt||{}),Jr=(t=>(t.Texture01="Polygon Texture #1",t.Texture02="Polygon Texture #2",t.Texture03="Polygon Texture #3",t.Texture04="Polygon Texture #4",t.Texture05="Polygon Texture #5",t.Texture06="Polygon Texture #6",t.Texture07="Polygon Texture #7",t.Texture08="Polygon Texture #8",t.Texture09="Polygon Texture #9",t.Texture10="Polygon Texture #10",t.NoTexture="No Polygon Texture",t))(Jr||{}),Yi=(t=>(t.Texture01="Foundation Texture #1",t.Texture02="Foundation Texture #2",t.Texture03="Foundation Texture #3",t.Texture04="Foundation Texture #4",t.Texture05="Foundation Texture #5",t.Texture06="Foundation Texture #6",t.Texture07="Foundation Texture #7",t.Texture08="Foundation Texture #8",t.Texture09="Foundation Texture #9",t.Texture10="Foundation Texture #10",t.NoTexture="No Foundation Texture",t))(Yi||{}),Co=(t=>(t.Facade01="Facade #1",t.Facade02="Facade #2",t.Facade03="Facade #3",t.Facade04="Facade #4",t.Facade05="Facade #5",t.Facade06="Facade #6",t.Facade07="Facade #7",t.Facade08="Facade #8",t.Facade09="Facade #9",t.Facade10="Facade #10",t.NoTexture="No Facade Texture",t))(Co||{}),Uo=(t=>(t.Default="Wall Texture Default",t.Texture01="Wall Texture #1",t.Texture02="Wall Texture #2",t.Texture03="Wall Texture #3",t.Texture04="Wall Texture #4",t.Texture05="Wall Texture #5",t.Texture06="Wall Texture #6",t.Texture07="Wall Texture #7",t.Texture08="Wall Texture #8",t.Texture09="Wall Texture #9",t.Texture10="Wall Texture #10",t.NoTexture="No Wall Texture",t))(Uo||{}),sr=(t=>(t.Default="Door Texture Default",t.Texture01="Door Texture #1",t.Texture02="Door Texture #2",t.Texture03="Door Texture #3",t.Texture04="Door Texture #4",t.Texture05="Door Texture #5",t.Texture06="Door Texture #6",t.Texture07="Door Texture #7",t.Texture08="Door Texture #8",t.Texture09="Door Texture #9",t.Texture10="Door Texture #10",t.Texture11="Door Texture #11",t.Texture12="Door Texture #12",t.Texture13="Door Texture #13",t.Texture14="Door Texture #14",t.Texture15="Door Texture #15",t.Texture16="Door Texture #16",t.Texture17="Door Texture #17",t.NoTexture="No Door Texture",t))(sr||{}),Ur=(t=>(t.Default="Roof Texture Default",t.Texture01="Roof Texture #1",t.Texture02="Roof Texture #2",t.Texture03="Roof Texture #3",t.Texture04="Roof Texture #4",t.Texture05="Roof Texture #5",t.Texture06="Roof Texture #6",t.Texture07="Roof Texture #7",t.NoTexture="No Roof Texture",t))(Ur||{}),G1=(t=>(t.Left="Left",t.Right="Right",t))(G1||{}),ga=(t=>(t.Valid="Valid",t.OverLap="OverLap",t.OutsideBoundary="OutsideBoundary",t.Invalid="Invalid",t))(ga||{}),Lr=(t=>(t.Mid="Mid",t.Left="Left",t.Right="Right",t.TopMid="TopMid",t.TopLeft="TopLeft",t.TopRight="TopRight",t.FrontLeft="FrontLeft",t.FrontRight="FrontRight",t.BackLeft="BackLeft",t.BackRight="BackRight",t.Top="Top",t.Ridge="Ridge",t.Null="Null",t))(Lr||{}),ns=(t=>(t.BUILDING="Building",t.PV="PV",t.CSP="CSP",t.SUT="SUT",t.WIND="Wind",t))(ns||{}),D_={VITE_MAPS_API_KEY:"AIzaSyCX6AmhM9d6R1ne9E7redd86YEahX_2Scs",VITE_FIREBASE_API_KEY:"AIzaSyD-236qE4ix9TkH2AW_wjKSz8jgK0ukjW0",VITE_FIREBASE_AUTH_DOMAIN:"aladdin-316017.firebaseapp.com",VITE_FIREBASE_DATABASE_URL:"https://aladdin-316017.firebaseio.com",VITE_FIREBASE_PROJECT_ID:"aladdin-316017",VITE_FIREBASE_STORAGE_BUCKET:"aladdin-316017.appspot.com",VITE_FIREBASE_MESSAGING_SENDER_ID:"169516488625",VITE_FIREBASE_APP_ID:"1:169516488625:web:bb0ae3c3f7c6e813250f90",VITE_FIREBASE_MEASUREMENT_ID:"G-G0XPQ7JNYJ",VITE_FIREBASE_LOGGER_DATABASE_URL:"https://aladdin-2024.firebaseio.com",VITE_EXAMPLE_PROJECT_OWNER:"QWecNcxhyvP6j6sBN11hBsfZDau1",BASE_URL:"/aladdin",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const kce=new Map,aY=t=>{const e=kce.get(t);return e?Object.fromEntries(Object.entries(e.stores).map(([n,o])=>[n,o.getState()])):{}},N6t=(t,e,n)=>{if(t===void 0)return{type:"untracked",connection:e.connect(n)};const o=kce.get(n.name);if(o)return{type:"tracked",store:t,...o};const r={connection:e.connect(n),stores:{}};return kce.set(n.name,r),{type:"tracked",store:t,...r}},U6t=(t,e={})=>(n,o,r)=>{const{enabled:i,anonymousActionType:a,store:l,...s}=e;let c;try{c=(i??(D_?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return(D_?"production":void 0)!=="production"&&i&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,o,r);const{connection:u,...d}=N6t(l,c,s);let f=!0;r.setState=(y,w,b)=>{const C=n(y,w);if(!f)return C;const P=b===void 0?{type:a||"anonymous"}:typeof b=="string"?{type:b}:b;return l===void 0?(u==null||u.send(P,o()),C):(u==null||u.send({...P,type:`${l}/${P.type}`},{...aY(s.name),[l]:r.getState()}),C)};const p=(...y)=>{const w=f;f=!1,n(...y),f=w},g=t(r.setState,o,r);if(d.type==="untracked"?u==null||u.init(g):(d.stores[d.store]=r,u==null||u.init(Object.fromEntries(Object.entries(d.stores).map(([y,w])=>[y,y===d.store?g:w.getState()])))),r.dispatchFromDevtools&&typeof r.dispatch=="function"){let y=!1;const w=r.dispatch;r.dispatch=(...b)=>{(D_?"production":void 0)!=="production"&&b[0].type==="__setState"&&!y&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),y=!0),w(...b)}}return u.subscribe(y=>{var w;switch(y.type){case"ACTION":if(typeof y.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return gre(y.payload,b=>{if(b.type==="__setState"){if(l===void 0){p(b.state);return}Object.keys(b.state).length!==1&&console.error(` +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ST=typeof window<"u"&&window.THREE?window.THREE:{LinearFilter:Gs,Sprite:B1e,SpriteMaterial:gq,SRGBColorSpace:ru,Texture:Vc},H6t=function(t){v6t(e,t);function e(){var n,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:10,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"rgba(255, 255, 255, 1)";return y6t(this,e),n=h6t(this,e,[new ST.SpriteMaterial]),n._text="".concat(o),n._textHeight=r,n._color=i,n._backgroundColor=!1,n._padding=0,n._borderWidth=0,n._borderRadius=0,n._borderColor="white",n._strokeWidth=0,n._strokeColor="white",n._fontFace="system-ui",n._fontSize=90,n._fontWeight="normal",n._canvas=document.createElement("canvas"),n._genCanvas(),n}return w6t(e,[{key:"text",get:function(){return this._text},set:function(o){this._text=o,this._genCanvas()}},{key:"textHeight",get:function(){return this._textHeight},set:function(o){this._textHeight=o,this._genCanvas()}},{key:"color",get:function(){return this._color},set:function(o){this._color=o,this._genCanvas()}},{key:"backgroundColor",get:function(){return this._backgroundColor},set:function(o){this._backgroundColor=o,this._genCanvas()}},{key:"padding",get:function(){return this._padding},set:function(o){this._padding=o,this._genCanvas()}},{key:"borderWidth",get:function(){return this._borderWidth},set:function(o){this._borderWidth=o,this._genCanvas()}},{key:"borderRadius",get:function(){return this._borderRadius},set:function(o){this._borderRadius=o,this._genCanvas()}},{key:"borderColor",get:function(){return this._borderColor},set:function(o){this._borderColor=o,this._genCanvas()}},{key:"fontFace",get:function(){return this._fontFace},set:function(o){this._fontFace=o,this._genCanvas()}},{key:"fontSize",get:function(){return this._fontSize},set:function(o){this._fontSize=o,this._genCanvas()}},{key:"fontWeight",get:function(){return this._fontWeight},set:function(o){this._fontWeight=o,this._genCanvas()}},{key:"strokeWidth",get:function(){return this._strokeWidth},set:function(o){this._strokeWidth=o,this._genCanvas()}},{key:"strokeColor",get:function(){return this._strokeColor},set:function(o){this._strokeColor=o,this._genCanvas()}},{key:"_genCanvas",value:function(){var o=this,r=this._canvas,i=r.getContext("2d"),a=Array.isArray(this.borderWidth)?this.borderWidth:[this.borderWidth,this.borderWidth],l=a.map(function(x){return x*o.fontSize*.1}),s=Array.isArray(this.borderRadius)?this.borderRadius:[this.borderRadius,this.borderRadius,this.borderRadius,this.borderRadius],c=s.map(function(x){return x*o.fontSize*.1}),u=Array.isArray(this.padding)?this.padding:[this.padding,this.padding],d=u.map(function(x){return x*o.fontSize*.1}),f=this.text.split(` +`),p="".concat(this.fontWeight," ").concat(this.fontSize,"px ").concat(this.fontFace);i.font=p;var g=Math.max.apply(Math,iY(f.map(function(x){return i.measureText(x).width}))),y=this.fontSize*f.length;if(r.width=g+l[0]*2+d[0]*2,r.height=y+l[1]*2+d[1]*2,this.borderWidth){if(i.strokeStyle=this.borderColor,l[0]){var w=l[0]/2;i.lineWidth=l[0],i.beginPath(),i.moveTo(w,c[0]),i.lineTo(w,r.height-c[3]),i.moveTo(r.width-w,c[1]),i.lineTo(r.width-w,r.height-c[2]),i.stroke()}if(l[1]){var b=l[1]/2;i.lineWidth=l[1],i.beginPath(),i.moveTo(Math.max(l[0],c[0]),b),i.lineTo(r.width-Math.max(l[0],c[1]),b),i.moveTo(Math.max(l[0],c[3]),r.height-b),i.lineTo(r.width-Math.max(l[0],c[2]),r.height-b),i.stroke()}if(this.borderRadius){var C=Math.max.apply(Math,iY(l)),P=C/2;i.lineWidth=C,i.beginPath(),[!!c[0]&&[c[0],P,P,c[0]],!!c[1]&&[r.width-c[1],r.width-P,P,c[1]],!!c[2]&&[r.width-c[2],r.width-P,r.height-P,r.height-c[2]],!!c[3]&&[c[3],P,r.height-P,r.height-c[3]]].filter(function(x){return x}).forEach(function(x){var S=Q8e(x,4),R=S[0],M=S[1],D=S[2],E=S[3];i.moveTo(R,D),i.quadraticCurveTo(M,D,M,E)}),i.stroke()}}this.backgroundColor&&(i.fillStyle=this.backgroundColor,this.borderRadius?(i.beginPath(),i.moveTo(l[0],c[0]),[[l[0],c[0],r.width-c[1],l[1],l[1],l[1]],[r.width-l[0],r.width-l[0],r.width-l[0],l[1],c[1],r.height-c[2]],[r.width-l[0],r.width-c[2],c[3],r.height-l[1],r.height-l[1],r.height-l[1]],[l[0],l[0],l[0],r.height-l[1],r.height-c[3],c[0]]].forEach(function(x){var S=Q8e(x,6),R=S[0],M=S[1],D=S[2],E=S[3],W=S[4],j=S[5];i.quadraticCurveTo(R,E,M,W),i.lineTo(D,j)}),i.closePath(),i.fill()):i.fillRect(l[0],l[1],r.width-l[0]*2,r.height-l[1]*2)),i.translate.apply(i,iY(l)),i.translate.apply(i,iY(d)),i.font=p,i.fillStyle=this.color,i.textBaseline="bottom";var v=this.strokeWidth>0;v&&(i.lineWidth=this.strokeWidth*this.fontSize/10,i.strokeStyle=this.strokeColor),f.forEach(function(x,S){var R=(g-i.measureText(x).width)/2,M=(S+1)*o.fontSize;v&&i.strokeText(x,R,M),i.fillText(x,R,M)}),this.material.map&&this.material.map.dispose();var T=this.material.map=new ST.Texture(r);T.minFilter=ST.LinearFilter,T.colorSpace=ST.SRGBColorSpace,T.needsUpdate=!0;var A=this.textHeight*f.length+a[1]*2+u[1]*2;this.scale.set(A*r.width/r.height,A,0)}},{key:"clone",value:function(){return new this.constructor(this.text,this.textHeight,this.color).copy(this)}},{key:"copy",value:function(o){return ST.Sprite.prototype.copy.call(this,o),this.color=o.color,this.backgroundColor=o.backgroundColor,this.padding=o.padding,this.borderWidth=o.borderWidth,this.borderColor=o.borderColor,this.fontFace=o.fontFace,this.fontSize=o.fontSize,this.fontWeight=o.fontWeight,this.strokeWidth=o.strokeWidth,this.strokeColor=o.strokeColor,this}}]),e}(ST.Sprite);const Y7={type:"change"},fre={type:"start"},O7={type:"end"};class M6t extends Z9{constructor(e,n){super(),n===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),n===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new ie,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.moveSpeed=1,this.turnSpeed=1,this.keys={MOVE_LEFT:"KeyA",MOVE_RIGHT:"KeyD",MOVE_FORWARD:"KeyW",MOVE_BACKWARD:"KeyS",MOVE_UP:"KeyZ",MOVE_DOWN:"KeyX",ROTATE_LEFT:"ArrowLeft",ROTATE_UP:"ArrowUp",ROTATE_RIGHT:"ArrowRight",ROTATE_DOWN:"ArrowDown"},this.mouseButtons={LEFT:av.ROTATE,MIDDLE:av.DOLLY,RIGHT:av.PAN},this.touches={ONE:lv.ROTATE,TWO:lv.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(Ne){Ne.addEventListener("keydown",Te),this._domElementKeyEvents=Ne,x=!1,S=0},this.removeKeyEvents=function(){o._domElementKeyEvents!==null&&o._domElementKeyEvents.removeEventListener("keydown",Te)},this.saveState=function(){o.target0.copy(o.target),o.position0.copy(o.object.position),o.zoom0=o.object.zoom},this.reset=function(){o.target.copy(o.target0),o.object.position.copy(o.position0),o.object.zoom=o.zoom0,o.object.updateProjectionMatrix(),o.dispatchEvent(Y7),o.update(),i=r.NONE},this.update=function(){const Ne=new ie,De=new bs().setFromUnitVectors(e.up,new ie(0,1,0)),ke=De.clone().invert(),Ye=new ie,it=new bs,Ve=2*Math.PI;return function(){const ct=o.object.position;Ne.copy(ct).sub(o.target),Ne.applyQuaternion(De),l.setFromVector3(Ne),o.autoRotate&&i===r.NONE&&D(R()),o.enableDamping?(l.theta+=s.theta*o.dampingFactor,l.phi+=s.phi*o.dampingFactor):(l.theta+=s.theta,l.phi+=s.phi);let Xe=o.minAzimuthAngle,ut=o.maxAzimuthAngle;return isFinite(Xe)&&isFinite(ut)&&(Xe<-Math.PI?Xe+=Ve:Xe>Math.PI&&(Xe-=Ve),ut<-Math.PI?ut+=Ve:ut>Math.PI&&(ut-=Ve),Xe<=ut?l.theta=Math.max(Xe,Math.min(ut,l.theta)):l.theta=l.theta>(Xe+ut)/2?Math.max(Xe,l.theta):Math.min(ut,l.theta)),l.phi=Math.max(o.minPolarAngle,Math.min(o.maxPolarAngle,l.phi)),l.makeSafe(),l.radius*=c,l.radius=Math.max(o.minDistance,Math.min(o.maxDistance,l.radius)),o.enableDamping===!0?o.target.addScaledVector(u,o.dampingFactor):o.target.add(u),Ne.setFromSpherical(l),Ne.applyQuaternion(ke),ct.copy(o.target).add(Ne),o.object.lookAt(o.target),o.enableDamping===!0?(s.theta*=1-o.dampingFactor,s.phi*=1-o.dampingFactor,u.multiplyScalar(1-o.dampingFactor)):(s.set(0,0,0),u.set(0,0,0)),c=1,d||Ye.distanceToSquared(o.object.position)>a||8*(1-it.dot(o.object.quaternion))>a?(o.dispatchEvent(Y7),Ye.copy(o.object.position),it.copy(o.object.quaternion),d=!1,!0):!1}}(),this.dispose=function(){o.domElement.removeEventListener("contextmenu",Ee),o.domElement.removeEventListener("pointerdown",ze),o.domElement.removeEventListener("pointercancel",ce),o.domElement.removeEventListener("wheel",Ae),o.domElement.removeEventListener("pointermove",Ie),o.domElement.removeEventListener("pointerup",ye),o._domElementKeyEvents!==null&&o._domElementKeyEvents.removeEventListener("keydown",Te)};const o=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let i=r.NONE;const a=1e-6,l=new Rce,s=new Rce;let c=1;const u=new ie;let d=!1;const f=new Xt,p=new Xt,g=new Xt,y=new Xt,w=new Xt,b=new Xt,C=new Xt,P=new Xt,v=new Xt,T=[],A={};let x=!1,S=0;function R(){return 2*Math.PI/60/60*o.autoRotateSpeed}function M(){return Math.pow(.95,o.zoomSpeed)}function D(Ne){s.theta-=Ne}function E(Ne){s.phi-=Ne}const W=function(){const Ne=new ie;return function(ke,Ye){Ne.setFromMatrixColumn(Ye,0),Ne.multiplyScalar(-ke),u.add(Ne)}}(),j=function(){const Ne=new ie;return function(ke,Ye){o.screenSpacePanning===!0?Ne.setFromMatrixColumn(Ye,1):(Ne.setFromMatrixColumn(Ye,0),Ne.crossVectors(o.object.up,Ne)),Ne.multiplyScalar(ke),u.add(Ne)}}(),L=function(){const Ne=new ie;return function(ke,Ye){const it=o.domElement;if(o.object.isPerspectiveCamera){const Ve=o.object.position;Ne.copy(Ve).sub(o.target);let yt=Ne.length();yt*=Math.tan(o.object.fov/2*Math.PI/180),W(2*ke*yt/it.clientHeight,o.object.matrix),j(2*Ye*yt/it.clientHeight,o.object.matrix)}else o.object.isOrthographicCamera?(W(ke*(o.object.right-o.object.left)/o.object.zoom/it.clientWidth,o.object.matrix),j(Ye*(o.object.top-o.object.bottom)/o.object.zoom/it.clientHeight,o.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),o.enablePan=!1)}}(),k=function(){const Ne=new ie;return function(ke){const Ye=o.object;Ne.setFromMatrixColumn(Ye.matrix,1),Ne.multiplyScalar(ke*.1),Ye.position.add(Ne),Ye.position.z=Math.max(0,Ye.position.z),o.dispatchEvent(Y7),o.dispatchEvent(O7)}}(),N=function(){const Ne=new ie;return function(ke){const Ye=o.object;Ne.setFromMatrixColumn(Ye.matrix,0),Ne.crossVectors(Ye.up,Ne),Ne.multiplyScalar(ke*.1),Ye.position.add(Ne),o.dispatchEvent(Y7),o.dispatchEvent(O7)}}(),F=function(){const Ne=new ie;return function(ke){const Ye=o.object;Ne.setFromMatrixColumn(Ye.matrix,0),Ne.multiplyScalar(ke*.1),Ye.position.add(Ne),o.dispatchEvent(Y7),o.dispatchEvent(O7)}}(),U=function(){const Ne=new nn(0,0,0,"ZXY");return function(ke){const Ye=o.object;Ne.setFromQuaternion(Ye.quaternion),Math.abs(Math.abs(Ne.z-S)-Math.PI)<.01&&(x=!x),x?Ne.x-=.01*ke:Ne.x+=.01*ke,Ne.x=Math.max(.1,Ne.x),S=Ne.z,Ye.quaternion.setFromEuler(Ne),o.dispatchEvent(Y7),o.dispatchEvent(O7)}}(),O=function(){const Ne=new nn(0,0,0,"ZXY");return function(ke){const Ye=o.object;Ne.setFromQuaternion(Ye.quaternion),Ne.z-=.01*ke,Ye.quaternion.setFromEuler(Ne),o.dispatchEvent(Y7),o.dispatchEvent(O7)}}();function B(Ne){o.object.isPerspectiveCamera?c/=Ne:o.object.isOrthographicCamera?(o.object.zoom=Math.max(o.minZoom,Math.min(o.maxZoom,o.object.zoom*Ne)),o.object.updateProjectionMatrix(),d=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),o.enableZoom=!1)}function _(Ne){o.object.isPerspectiveCamera?c*=Ne:o.object.isOrthographicCamera?(o.object.zoom=Math.max(o.minZoom,Math.min(o.maxZoom,o.object.zoom/Ne)),o.object.updateProjectionMatrix(),d=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),o.enableZoom=!1)}function X(Ne){f.set(Ne.clientX,Ne.clientY)}function $(Ne){C.set(Ne.clientX,Ne.clientY)}function Q(Ne){y.set(Ne.clientX,Ne.clientY)}function le(Ne){p.set(Ne.clientX,Ne.clientY),g.subVectors(p,f).multiplyScalar(o.rotateSpeed);const De=o.domElement;D(2*Math.PI*g.x/De.clientHeight),E(2*Math.PI*g.y/De.clientHeight),f.copy(p),o.update()}function q(Ne){P.set(Ne.clientX,Ne.clientY),v.subVectors(P,C),v.y>0?B(M()):v.y<0&&_(M()),C.copy(P),o.update()}function te(Ne){w.set(Ne.clientX,Ne.clientY),b.subVectors(w,y).multiplyScalar(o.panSpeed),L(b.x,b.y),y.copy(w),o.update()}function re(Ne){Ne.deltaY<0?_(M()):Ne.deltaY>0&&B(M()),o.update()}function ae(Ne){switch(Ne.code){case o.keys.MOVE_FORWARD:N(o.moveSpeed);break;case o.keys.MOVE_BACKWARD:N(-o.moveSpeed);break;case o.keys.MOVE_UP:k(o.moveSpeed);break;case o.keys.MOVE_DOWN:k(-o.moveSpeed);break;case o.keys.MOVE_RIGHT:F(o.moveSpeed);break;case o.keys.MOVE_LEFT:F(-o.moveSpeed);break;case o.keys.ROTATE_UP:U(o.turnSpeed);break;case o.keys.ROTATE_DOWN:U(-o.turnSpeed);break;case o.keys.ROTATE_LEFT:O(-o.turnSpeed);break;case o.keys.ROTATE_RIGHT:O(o.turnSpeed);break}}function se(){if(T.length===1)f.set(T[0].pageX,T[0].pageY);else{const Ne=.5*(T[0].pageX+T[1].pageX),De=.5*(T[0].pageY+T[1].pageY);f.set(Ne,De)}}function ne(){if(T.length===1)y.set(T[0].pageX,T[0].pageY);else{const Ne=.5*(T[0].pageX+T[1].pageX),De=.5*(T[0].pageY+T[1].pageY);y.set(Ne,De)}}function fe(){const Ne=T[0].pageX-T[1].pageX,De=T[0].pageY-T[1].pageY,ke=Math.sqrt(Ne*Ne+De*De);C.set(0,ke)}function ge(){o.enableZoom&&fe(),o.enablePan&&ne()}function de(){o.enableZoom&&fe(),o.enableRotate&&se()}function Z(Ne){if(T.length===1)p.set(Ne.pageX,Ne.pageY);else{const ke=Ke(Ne),Ye=.5*(Ne.pageX+ke.x),it=.5*(Ne.pageY+ke.y);p.set(Ye,it)}g.subVectors(p,f).multiplyScalar(o.rotateSpeed);const De=o.domElement;D(2*Math.PI*g.x/De.clientHeight),E(2*Math.PI*g.y/De.clientHeight),f.copy(p)}function he(Ne){if(T.length===1)w.set(Ne.pageX,Ne.pageY);else{const De=Ke(Ne),ke=.5*(Ne.pageX+De.x),Ye=.5*(Ne.pageY+De.y);w.set(ke,Ye)}b.subVectors(w,y).multiplyScalar(o.panSpeed),L(b.x,b.y),y.copy(w)}function xe(Ne){const De=Ke(Ne),ke=Ne.pageX-De.x,Ye=Ne.pageY-De.y,it=Math.sqrt(ke*ke+Ye*Ye);P.set(0,it),v.set(0,Math.pow(P.y/C.y,o.zoomSpeed)),B(v.y),C.copy(P)}function He(Ne){o.enableZoom&&xe(Ne),o.enablePan&&he(Ne)}function Se(Ne){o.enableZoom&&xe(Ne),o.enableRotate&&Z(Ne)}function ze(Ne){o.enabled!==!1&&(T.length===0&&(o.domElement.setPointerCapture(Ne.pointerId),o.domElement.addEventListener("pointermove",Ie),o.domElement.addEventListener("pointerup",ye)),Be(Ne),Ne.pointerType==="touch"?Me(Ne):pe(Ne))}function Ie(Ne){o.enabled!==!1&&(Ne.pointerType==="touch"?Pe(Ne):ve(Ne))}function ye(Ne){Je(Ne),T.length===0&&(o.domElement.releasePointerCapture(Ne.pointerId),o.domElement.removeEventListener("pointermove",Ie),o.domElement.removeEventListener("pointerup",ye)),o.dispatchEvent(O7),i=r.NONE}function ce(Ne){Je(Ne)}function pe(Ne){let De;switch(Ne.button){case 0:De=o.mouseButtons.LEFT;break;case 1:De=o.mouseButtons.MIDDLE;break;case 2:De=o.mouseButtons.RIGHT;break;default:De=-1}switch(De){case av.DOLLY:if(o.enableZoom===!1)return;$(Ne),i=r.DOLLY;break;case av.ROTATE:if(o.object.isOrthographicCamera){if(o.enablePan===!1)return;Q(Ne),i=r.PAN}else if(Ne.ctrlKey||Ne.metaKey){if(o.enablePan===!1)return;Q(Ne),i=r.PAN}else{if(o.enableRotate===!1)return;X(Ne),i=r.ROTATE}break;case av.PAN:if(Ne.ctrlKey||Ne.metaKey){if(o.enableRotate===!1)return;X(Ne),i=r.ROTATE}else{if(o.enablePan===!1)return;Q(Ne),i=r.PAN}break;default:i=r.NONE}i!==r.NONE&&o.dispatchEvent(fre)}function ve(Ne){if(o.enabled!==!1)switch(i){case r.ROTATE:if(o.enableRotate===!1)return;le(Ne);break;case r.DOLLY:if(o.enableZoom===!1)return;q(Ne);break;case r.PAN:if(o.enablePan===!1)return;te(Ne);break}}function Ae(Ne){o.enabled===!1||o.enableZoom===!1||i!==r.NONE||(Ne.preventDefault(),o.dispatchEvent(fre),re(Ne),o.dispatchEvent(O7))}function Te(Ne){o.enabled===!1||o.enablePan===!1||ae(Ne)}function Me(Ne){switch(We(Ne),T.length){case 1:switch(o.touches.ONE){case lv.ROTATE:if(o.enableRotate===!1)return;se(),i=r.TOUCH_ROTATE;break;case lv.PAN:if(o.enablePan===!1)return;ne(),i=r.TOUCH_PAN;break;default:i=r.NONE}break;case 2:switch(o.touches.TWO){case lv.DOLLY_PAN:if(o.enableZoom===!1&&o.enablePan===!1)return;ge(),i=r.TOUCH_DOLLY_PAN;break;case lv.DOLLY_ROTATE:if(o.enableZoom===!1&&o.enableRotate===!1)return;de(),i=r.TOUCH_DOLLY_ROTATE;break;default:i=r.NONE}break;default:i=r.NONE}i!==r.NONE&&o.dispatchEvent(fre)}function Pe(Ne){switch(We(Ne),i){case r.TOUCH_ROTATE:if(o.enableRotate===!1)return;Z(Ne),o.update();break;case r.TOUCH_PAN:if(o.enablePan===!1)return;he(Ne),o.update();break;case r.TOUCH_DOLLY_PAN:if(o.enableZoom===!1&&o.enablePan===!1)return;He(Ne),o.update();break;case r.TOUCH_DOLLY_ROTATE:if(o.enableZoom===!1&&o.enableRotate===!1)return;Se(Ne),o.update();break;default:i=r.NONE}}function Ee(Ne){o.enabled!==!1&&Ne.preventDefault()}function Be(Ne){T.push(Ne)}function Je(Ne){delete A[Ne.pointerId];for(let De=0;De=4){this.makeEmpty();for(let n=0,o=e.length;nthis.tolerance)return!1;return!0}intersectRay(e,n){const o=this.faces;let r=-1/0,i=1/0;for(let a=0,l=o.length;a0&&u>=0)return null;const d=u!==0?-c/u:0;if(!(d<=0)&&(u>0?i=Math.min(d,i):r=Math.max(d,r),r>i))return null}return r!==-1/0?e.at(r,n):e.at(i,n),n}intersectsRay(e){return this.intersectRay(e,z6t)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(e,n){return e.face=n,n.outside===null?this.assigned.append(e):this.assigned.insertBefore(n.outside,e),n.outside=e,this}removeVertexFromFace(e,n){return e===n.outside&&(e.next!==null&&e.next.face===n?n.outside=e.next:n.outside=null),this.assigned.remove(e),this}removeAllVerticesFromFace(e){if(e.outside!==null){const n=e.outside;let o=e.outside;for(;o.next!==null&&o.next.face===e;)o=o.next;return this.assigned.removeSubList(n,o),n.prev=o.next=null,e.outside=null,n}}deleteFaceVertices(e,n){const o=this.removeAllVerticesFromFace(e);if(o!==void 0)if(n===void 0)this.unassigned.appendChain(o);else{let r=o;do{const i=r.next;n.distanceToPoint(r.point)>this.tolerance?this.addVertexToFace(r,n):this.unassigned.append(r),r=i}while(r!==null)}return this}resolveUnassignedPoints(e){if(this.unassigned.isEmpty()===!1){let n=this.unassigned.first();do{const o=n.next;let r=this.tolerance,i=null;for(let a=0;ar&&(r=s,i=l),r>1e3*this.tolerance)break}}i!==null&&this.addVertexToFace(n,i),n=o}while(n!==null)}return this}computeExtremes(){const e=new ie,n=new ie,o=[],r=[];for(let i=0;i<3;i++)o[i]=r[i]=this.vertices[0];e.copy(this.vertices[0].point),n.copy(this.vertices[0].point);for(let i=0,a=this.vertices.length;in.getComponent(c)&&(n.setComponent(c,s.getComponent(c)),r[c]=l)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(e.x),Math.abs(n.x))+Math.max(Math.abs(e.y),Math.abs(n.y))+Math.max(Math.abs(e.z),Math.abs(n.z))),{min:o,max:r}}computeInitialHull(){const e=this.vertices,n=this.computeExtremes(),o=n.min,r=n.max;let i=0,a=0;for(let f=0;f<3;f++){const p=r[f].point.getComponent(f)-o[f].point.getComponent(f);p>i&&(i=p,a=f)}const l=o[a],s=r[a];let c,u;i=0,Z8e.set(l.point,s.point);for(let f=0,p=this.vertices.length;fi&&(i=y,c=g)}}i=-1,hre.setFromCoplanarPoints(l.point,s.point,c.point);for(let f=0,p=this.vertices.length;fi&&(i=y,u=g)}}const d=[];if(hre.distanceToPoint(u.point)<0){d.push(o2.create(l,s,c),o2.create(u,s,l),o2.create(u,c,s),o2.create(u,l,c));for(let f=0;f<3;f++){const p=(f+1)%3;d[f+1].getEdge(2).setTwin(d[0].getEdge(p)),d[f+1].getEdge(1).setTwin(d[p+1].getEdge(0))}}else{d.push(o2.create(l,c,s),o2.create(u,l,s),o2.create(u,s,c),o2.create(u,c,l));for(let f=0;f<3;f++){const p=(f+1)%3;d[f+1].getEdge(2).setTwin(d[0].getEdge((3-f)%3)),d[f+1].getEdge(0).setTwin(d[p+1].getEdge(1))}}for(let f=0;f<4;f++)this.faces.push(d[f]);for(let f=0,p=e.length;fi&&(i=b,y=this.faces[w])}y!==null&&this.addVertexToFace(g,y)}}return this}reindexFaces(){const e=[];for(let n=0;nn&&(n=i,e=r),r=r.next}while(r!==null&&r.face===o);return e}}computeHorizon(e,n,o,r){this.deleteFaceVertices(o),o.mark=I6t;let i;n===null?i=n=o.getEdge(0):i=n.next;do{const a=i.twin,l=a.face;l.mark===D_&&(l.distanceToPoint(e)>this.tolerance?this.computeHorizon(e,a,l,r):r.push(i)),i=i.next}while(i!==n);return this}addAdjoiningFace(e,n){const o=o2.create(e,n.tail(),n.head());return this.faces.push(o),o.getEdge(-1).setTwin(n.twin),o.getEdge(0)}addNewFaces(e,n){this.newFaces=[];let o=null,r=null;for(let i=0;i0;)n=n.next,e--;for(;e<0;)n=n.prev,e++;return n}compute(){const e=this.edge.tail(),n=this.edge.head(),o=this.edge.next.head();return aY.set(e.point,n.point,o.point),aY.getNormal(this.normal),aY.getMidpoint(this.midpoint),this.area=aY.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(e){return this.normal.dot(e)-this.constant}}class pre{constructor(e,n){this.vertex=e,this.prev=null,this.next=null,this.twin=null,this.face=n}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const e=this.head(),n=this.tail();return n!==null?n.point.distanceTo(e.point):-1}lengthSquared(){const e=this.head(),n=this.tail();return n!==null?n.point.distanceToSquared(e.point):-1}setTwin(e){return this.twin=e,e.twin=this,this}}class E6t{constructor(e){this.point=e,this.prev=null,this.next=null,this.face=null}}class twe{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,n){return n.prev=e.prev,n.next=e,n.prev===null?this.head=n:n.prev.next=n,e.prev=n,this}insertAfter(e,n){return n.prev=e,n.next=e.next,n.next===null?this.tail=n:n.next.prev=n,e.next=n,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,n){return e.prev===null?this.head=n.next:e.prev.next=n.next,n.next===null?this.tail=e.prev:n.next.prev=e.prev,this}isEmpty(){return this.head===null}}class Fce extends Ni{constructor(e,n,o){super();const r=[],i=[],a=[],l=new nn(0,0,n),c=new D6t().setFromPoints(e).faces;for(let u=0;u(t.FILES="Files",t.LOG_DATA="Log Data",t))(cG||{}),sc=(t=>(t.UNKNOWN="UNKNOWN SCHOOL",t.SCHOOL1="SCHOOL 1",t.SCHOOL2="SCHOOL 2",t.SCHOOL3="SCHOOL 3",t.SCHOOL4="SCHOOL 4",t.SCHOOL5="SCHOOL 5",t))(sc||{}),Va=(t=>(t.UNKNOWN="UNKNOWN CLASS",t.CLASS1="CLASS 1",t.CLASS2="CLASS 2",t.CLASS3="CLASS 3",t.CLASS4="CLASS 4",t.CLASS5="CLASS 5",t.CLASS6="CLASS 6",t.CLASS7="CLASS 7",t.CLASS8="CLASS 8",t.CLASS9="CLASS 9",t))(Va||{}),d9=(t=>(t[t.ALL=0]="ALL",t[t.INDIVIDUALS=1]="INDIVIDUALS",t[t.GROUPS=2]="GROUPS",t))(d9||{}),pa=(t=>(t.UNKNOWN="Unknown",t.UNDER_CONSTRUCTION="Under Construction",t.RESIDENTIAL_BUILDING="Residential Building",t.COMMERCIAL_BUILDING="Commercial Building",t.SCHOOL_BUILDING="School Building",t.TOURIST_ATTRACTION="Tourist Attraction",t.PHOTOVOLTAIC="Photovoltaic",t.PARABOLIC_DISH="Parabolic Dish",t.PARABOLIC_TROUGH="Parabolic Trough",t.FRESNEL_REFLECTOR="Fresnel Reflector",t.SOLAR_POWER_TOWER="Solar Power Tower",t.WIND_TURBINE="Wind Turbine",t.COLOCATION_PROJECTS="Colocation Projects",t))(pa||{}),jc=(t=>(t[t.COMPLETE=0]="COMPLETE",t[t.ROOF_MISSING=1]="ROOF_MISSING",t[t.WALL_DISJOINED=2]="WALL_DISJOINED",t[t.WALL_EMPTY=3]="WALL_EMPTY",t))(jc||{}),Pi=(t=>(t.SOLAR_PANEL_TILT_ANGLE="Solar Panel Tilt Angle",t.SOLAR_PANEL_ARRAY="Solar Panel Array",t))(Pi||{}),To=(t=>(t[t.DAILY_TOTAL_OUTPUT=1]="DAILY_TOTAL_OUTPUT",t[t.YEARLY_TOTAL_OUTPUT=2]="YEARLY_TOTAL_OUTPUT",t[t.DAILY_AVERAGE_OUTPUT=3]="DAILY_AVERAGE_OUTPUT",t[t.YEARLY_AVERAGE_OUTPUT=4]="YEARLY_AVERAGE_OUTPUT",t[t.DAILY_PROFIT=5]="DAILY_PROFIT",t[t.YEARLY_PROFIT=6]="YEARLY_PROFIT",t))(To||{}),Vs=(t=>(t[t.GENETIC_ALGORITHM=1]="GENETIC_ALGORITHM",t[t.PARTICLE_SWARM_OPTIMIZATION=2]="PARTICLE_SWARM_OPTIMIZATION",t))(Vs||{}),Wm=(t=>(t[t.ROULETTE_WHEEL=1]="ROULETTE_WHEEL",t[t.TOURNAMENT=2]="TOURNAMENT",t))(Wm||{}),us=(t=>(t[t.GLOBAL_SEARCH_UNIFORM_SELECTION=1]="GLOBAL_SEARCH_UNIFORM_SELECTION",t[t.LOCAL_SEARCH_RANDOM_OPTIMIZATION=2]="LOCAL_SEARCH_RANDOM_OPTIMIZATION",t[t.GLOBAL_SEARCH_FITNESS_SHARING=3]="GLOBAL_SEARCH_FITNESS_SHARING",t))(us||{}),Gh=(t=>(t[t.Solid=1]="Solid",t[t.Dashed=2]="Dashed",t[t.Dotted=3]="Dotted",t))(Gh||{}),$y=(t=>(t[t.One=1]="One",t[t.Two=2]="Two",t[t.Three=3]="Three",t[t.Four=4]="Four",t[t.Five=5]="Five",t))($y||{}),Ml=(t=>(t[t.Line=1]="Line",t[t.Area=2]="Area",t))(Ml||{}),vi=(t=>(t[t.HourlyTemperatures=1]="HourlyTemperatures",t[t.MonthlyTemperatures=2]="MonthlyTemperatures",t[t.SunshineHours=3]="SunshineHours",t[t.DaylightData=4]="DaylightData",t[t.ClearnessData=5]="ClearnessData",t[t.YearlyRadiationSensorData=6]="YearlyRadiationSensorData",t[t.DailyRadiationSensorData=7]="DailyRadiationSensorData",t[t.YearlyPvYield=8]="YearlyPvYield",t[t.DailyPvYield=9]="DailyPvYield",t[t.YearlyParabolicTroughYield=10]="YearlyParabolicTroughYield",t[t.DailyParabolicTroughYield=11]="DailyParabolicTroughYield",t[t.YearlyParabolicDishYield=12]="YearlyParabolicDishYield",t[t.DailyParabolicDishYield=13]="DailyParabolicDishYield",t[t.YearlyFresnelReflectorYield=14]="YearlyFresnelReflectorYield",t[t.DailyFresnelReflectorYield=15]="DailyFresnelReflectorYield",t[t.YearlyHeliostatYield=16]="YearlyHeliostatYield",t[t.DailyHeliostatYield=17]="DailyHeliostatYield",t[t.YearlyUpdraftTowerYield=18]="YearlyUpdraftTowerYield",t[t.DailyUpdraftTowerYield=19]="DailyUpdraftTowerYield",t[t.YearlyBuildingEnergy=20]="YearlyBuildingEnergy",t[t.DailyBuildingEnergy=21]="DailyBuildingEnergy",t))(vi||{}),Os=(t=>(t.Default="Default",t.Desert="Desert",t.Dune="Dune",t.Forest="Forest",t.Grassland="Grassland",t.Hill="Hill",t.Lake="Lake",t.Mountain="Mountain",t.Rural="Rural",t))(Os||{}),y2=(t=>(t[t.Sinusoidal=1]="Sinusoidal",t[t.PartonLogan=2]="PartonLogan",t))(y2||{}),s9=(t=>(t.English="English",t.ChineseSimplified="简体中文",t.ChineseTraditional="繁体中文",t.Turkish="Türkçe",t.Spanish="Español",t.Ukrainian="Українська",t))(s9||{}),z=(t=>(t.Sky="Sky",t.Ground="Ground",t.Foundation="Foundation",t.Wall="Wall",t.Window="Window",t.Door="Door",t.Roof="Roof",t.PyramidRoof="Pyramid Roof",t.GableRoof="Gable Roof",t.HipRoof="Hip Roof",t.GambrelRoof="Gambrel Roof",t.MansardRoof="Mansard Roof",t.Sensor="Sensor",t.SolarPanel="Solar Panel",t.WaterHeater="Water Heater",t.ParabolicDish="Parabolic Dish",t.ParabolicTrough="Parabolic Trough",t.FresnelReflector="Fresnel Reflector",t.Heliostat="Heliostat",t.WindTurbine="Wind Turbine",t.VerticalAxisWindTurbine="Vertical Axis Wind Turbine",t.Cuboid="Cuboid",t.Human="Human",t.Tree="Tree",t.Flower="Flower",t.Polygon="Polygon",t.PolygonVertex="Polygon Vertex",t.Light="Light",t.BatteryStorage="Power Wall",t.None="None",t))(z||{}),uf=(t=>(t[t.CentralPole=1]="CentralPole",t[t.CentralPoleWithTripod=2]="CentralPoleWithTripod",t[t.Quadrupod=3]="Quadrupod",t))(uf||{}),Dn=(t=>(t[t.None=0]="None",t[t.FocusPipe=1]="FocusPipe",t[t.FocusTower=2]="FocusTower",t[t.UpdraftTower=3]="UpdraftTower",t))(Dn||{}),uc=(t=>(t[t.None=0]="None",t[t.Bicolor=1]="Bicolor",t[t.Striped=2]="Striped",t))(uc||{}),Oo=(t=>(t.Select="Select",t.Move="Move",t.Resize="Resize",t.Rotate="Rotate",t.ContextMenu="ContextMenu",t))(Oo||{}),Ho=(t=>(t.Default="Move Handle",t.Lower="Move Handle Lower",t.Upper="Move Handle Upper",t.Left="Move Handle Left",t.Right="Move Handle Right",t.Top="Move Handle Top",t.Mid="Move Handle Mid",t))(Ho||{}),Sl=(t=>(t.Left="Left",t.Right="Right",t.Up="Up",t.Down="Down",t))(Sl||{}),vt=(t=>(t.LowerLeft="Resize Handle Lower Left",t.UpperLeft="Resize Handle Upper Left",t.LowerRight="Resize Handle Lower Right",t.UpperRight="Resize Handle Upper Right",t.LowerLeftTop="Resize Handle Lower Left Top",t.UpperLeftTop="Resize Handle Upper Left Top",t.LowerRightTop="Resize Handle Lower Right Top",t.UpperRightTop="Resize Handle Upper Right Top",t.Lower="Resize Handle Lower",t.Upper="Resize Handle Upper",t.Left="Resize Handle Left",t.Right="Resize Handle Right",t.Top="Resize Handle Top",t.Default="Resize Handle",t.Arch="Resize Handle Arch",t.WallPartialResizeLeft="Wall Partial Resize Handle Left",t.WallPartialResizeRight="Wall Partial Resize Handle Right",t.WallPartialResizeLeftTop="Wall Partial Resize Handle Left Top",t.WallPartialResizeRightTop="Wall Partial Resize Handle Right Top",t))(vt||{}),Kr=(t=>(t.Lower="Rotate Handle Lower",t.Upper="Rotate Handle Upper",t.Tilt="Rotate Handle Tilt",t))(Kr||{}),sx=(t=>(t.Delete="Delete Vertex",t.InsertBeforeIndex="Insert Vertex Before Index",t.InsertAfterIndex="Insert Vertex After Index",t))(sx||{}),eh=(t=>(t.Horizontal="Horizontal",t.Vertical="Vertical",t.Ground="Ground",t.Sky="Sky",t))(eh||{}),oe=(t=>(t[t.OnlyThisObject=1]="OnlyThisObject",t[t.AllObjectsOfThisTypeOnSurface=2]="AllObjectsOfThisTypeOnSurface",t[t.AllObjectsOfThisTypeAboveFoundation=3]="AllObjectsOfThisTypeAboveFoundation",t[t.AllObjectsOfThisType=4]="AllObjectsOfThisType",t[t.AllConnectedObjects=5]="AllConnectedObjects",t[t.OnlyThisSide=6]="OnlyThisSide",t[t.AllSelectedObjectsOfThisType=7]="AllSelectedObjectsOfThisType",t))(oe||{}),vr=(t=>(t.portrait="Portrait",t.landscape="Landscape",t))(vr||{}),Dl=(t=>(t.eastWest="East-West",t.northSouth="North-South",t.leftRight="Left-Right",t.upDown="Up-Down",t))(Dl||{}),za=(t=>(t.NO_TRACKER="None",t.HORIZONTAL_SINGLE_AXIS_TRACKER="HSAT",t.ALTAZIMUTH_DUAL_AXIS_TRACKER="AADAT",t.VERTICAL_SINGLE_AXIS_TRACKER="VSAT",t.TILTED_SINGLE_AXIS_TRACKER="TSAT",t))(za||{}),Fv=(t=>(t.NONE="None",t.HIGH="High",t.PARTIAL="Partial",t))(Fv||{}),Fm=(t=>(t.EXACT="Exact",t.APPROXIMATE="Approximate",t))(Fm||{}),pr=(t=>(t.Apple="Apple",t.Birch="Birch",t.Coconut="Coconut",t.Dogwood="Dogwood",t.Elm="Elm",t.FanPalm="Fan Palm",t.Linden="Linden",t.Magnolia="Magnolia",t.Maple="Maple",t.Oak="Oak",t.Pine="Pine",t.Spruce="Spruce",t))(pr||{}),ro=(t=>(t.Bellflower="Bellflower",t.Boxwood="Boxwood",t.CactusCombo1="Cactus Combo 1",t.CactusCombo2="Cactus Combo 2",t.CactusCombo3="Cactus Combo 3",t.CactusCombo4="Cactus Combo 4",t.Hibiscus="Hibiscus",t.Hosta="Hosta",t.Hydrangea="Hydrangea",t.Peony="Peony",t.RedRose="Red Rose",t.Spirea="Spirea",t.Sunflower="Sunflower",t.TallBush="Tall Bush",t.Tulip="Tulip",t.WhiteFlower="White Flower",t.YellowFlower="Yellow Flower",t))(ro||{}),Ha=(t=>(t.Male="Male",t.Female="Female",t.Other="Other",t))(Ha||{}),Yt=(t=>(t.Jaah="Jaah",t.Jack="Jack",t.Jacob="Jacob",t.Jacqueline="Jacqueline",t.Jade="Jade",t.Jamelia="Jamelia",t.James="James",t.Jane="Jane",t.Jaya="Jaya",t.Jaye="Jaye",t.Jeanette="Jeanette",t.Jedi="Jedi",t.Jeff="Jeff",t.Jena="Jena",t.Jennifer="Jennifer",t.Jess="Jess",t.Jett="Jett",t.Jill="Jill",t.Jiya="Jiya",t.Jocelyn="Jocelyn",t.Joan="Joan",t.Joel="Joel",t.Joey="Joey",t.John="John",t.Jonathon="Jonathon",t.Joseph="Joseph",t.Jose="Jose",t.Joshua="Joshua",t.Judd="Judd",t.Judy="Judy",t.Julia="Julia",t.Julio="Julio",t.Jumapili="Jumapili",t.June="June",t.Juro="Juro",t.Justin="Justin",t))(Yt||{}),Jr=(t=>(t.Texture01="Polygon Texture #1",t.Texture02="Polygon Texture #2",t.Texture03="Polygon Texture #3",t.Texture04="Polygon Texture #4",t.Texture05="Polygon Texture #5",t.Texture06="Polygon Texture #6",t.Texture07="Polygon Texture #7",t.Texture08="Polygon Texture #8",t.Texture09="Polygon Texture #9",t.Texture10="Polygon Texture #10",t.NoTexture="No Polygon Texture",t))(Jr||{}),Yi=(t=>(t.Texture01="Foundation Texture #1",t.Texture02="Foundation Texture #2",t.Texture03="Foundation Texture #3",t.Texture04="Foundation Texture #4",t.Texture05="Foundation Texture #5",t.Texture06="Foundation Texture #6",t.Texture07="Foundation Texture #7",t.Texture08="Foundation Texture #8",t.Texture09="Foundation Texture #9",t.Texture10="Foundation Texture #10",t.NoTexture="No Foundation Texture",t))(Yi||{}),Co=(t=>(t.Facade01="Facade #1",t.Facade02="Facade #2",t.Facade03="Facade #3",t.Facade04="Facade #4",t.Facade05="Facade #5",t.Facade06="Facade #6",t.Facade07="Facade #7",t.Facade08="Facade #8",t.Facade09="Facade #9",t.Facade10="Facade #10",t.NoTexture="No Facade Texture",t))(Co||{}),Uo=(t=>(t.Default="Wall Texture Default",t.Texture01="Wall Texture #1",t.Texture02="Wall Texture #2",t.Texture03="Wall Texture #3",t.Texture04="Wall Texture #4",t.Texture05="Wall Texture #5",t.Texture06="Wall Texture #6",t.Texture07="Wall Texture #7",t.Texture08="Wall Texture #8",t.Texture09="Wall Texture #9",t.Texture10="Wall Texture #10",t.NoTexture="No Wall Texture",t))(Uo||{}),sr=(t=>(t.Default="Door Texture Default",t.Texture01="Door Texture #1",t.Texture02="Door Texture #2",t.Texture03="Door Texture #3",t.Texture04="Door Texture #4",t.Texture05="Door Texture #5",t.Texture06="Door Texture #6",t.Texture07="Door Texture #7",t.Texture08="Door Texture #8",t.Texture09="Door Texture #9",t.Texture10="Door Texture #10",t.Texture11="Door Texture #11",t.Texture12="Door Texture #12",t.Texture13="Door Texture #13",t.Texture14="Door Texture #14",t.Texture15="Door Texture #15",t.Texture16="Door Texture #16",t.Texture17="Door Texture #17",t.NoTexture="No Door Texture",t))(sr||{}),Ur=(t=>(t.Default="Roof Texture Default",t.Texture01="Roof Texture #1",t.Texture02="Roof Texture #2",t.Texture03="Roof Texture #3",t.Texture04="Roof Texture #4",t.Texture05="Roof Texture #5",t.Texture06="Roof Texture #6",t.Texture07="Roof Texture #7",t.NoTexture="No Roof Texture",t))(Ur||{}),G1=(t=>(t.Left="Left",t.Right="Right",t))(G1||{}),ma=(t=>(t.Valid="Valid",t.OverLap="OverLap",t.OutsideBoundary="OutsideBoundary",t.Invalid="Invalid",t))(ma||{}),Lr=(t=>(t.Mid="Mid",t.Left="Left",t.Right="Right",t.TopMid="TopMid",t.TopLeft="TopLeft",t.TopRight="TopRight",t.FrontLeft="FrontLeft",t.FrontRight="FrontRight",t.BackLeft="BackLeft",t.BackRight="BackRight",t.Top="Top",t.Ridge="Ridge",t.Null="Null",t))(Lr||{}),ns=(t=>(t.BUILDING="Building",t.PV="PV",t.CSP="CSP",t.SUT="SUT",t.WIND="Wind",t))(ns||{}),E_={VITE_MAPS_API_KEY:"AIzaSyCX6AmhM9d6R1ne9E7redd86YEahX_2Scs",VITE_FIREBASE_API_KEY:"AIzaSyD-236qE4ix9TkH2AW_wjKSz8jgK0ukjW0",VITE_FIREBASE_AUTH_DOMAIN:"aladdin-316017.firebaseapp.com",VITE_FIREBASE_DATABASE_URL:"https://aladdin-316017.firebaseio.com",VITE_FIREBASE_PROJECT_ID:"aladdin-316017",VITE_FIREBASE_STORAGE_BUCKET:"aladdin-316017.appspot.com",VITE_FIREBASE_MESSAGING_SENDER_ID:"169516488625",VITE_FIREBASE_APP_ID:"1:169516488625:web:bb0ae3c3f7c6e813250f90",VITE_FIREBASE_MEASUREMENT_ID:"G-G0XPQ7JNYJ",VITE_FIREBASE_LOGGER_DATABASE_URL:"https://aladdin-2024.firebaseio.com",VITE_EXAMPLE_PROJECT_OWNER:"QWecNcxhyvP6j6sBN11hBsfZDau1",BASE_URL:"/aladdin",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const kce=new Map,lY=t=>{const e=kce.get(t);return e?Object.fromEntries(Object.entries(e.stores).map(([n,o])=>[n,o.getState()])):{}},N6t=(t,e,n)=>{if(t===void 0)return{type:"untracked",connection:e.connect(n)};const o=kce.get(n.name);if(o)return{type:"tracked",store:t,...o};const r={connection:e.connect(n),stores:{}};return kce.set(n.name,r),{type:"tracked",store:t,...r}},U6t=(t,e={})=>(n,o,r)=>{const{enabled:i,anonymousActionType:a,store:l,...s}=e;let c;try{c=(i??(E_?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return(E_?"production":void 0)!=="production"&&i&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,o,r);const{connection:u,...d}=N6t(l,c,s);let f=!0;r.setState=(y,w,b)=>{const C=n(y,w);if(!f)return C;const P=b===void 0?{type:a||"anonymous"}:typeof b=="string"?{type:b}:b;return l===void 0?(u==null||u.send(P,o()),C):(u==null||u.send({...P,type:`${l}/${P.type}`},{...lY(s.name),[l]:r.getState()}),C)};const p=(...y)=>{const w=f;f=!1,n(...y),f=w},g=t(r.setState,o,r);if(d.type==="untracked"?u==null||u.init(g):(d.stores[d.store]=r,u==null||u.init(Object.fromEntries(Object.entries(d.stores).map(([y,w])=>[y,y===d.store?g:w.getState()])))),r.dispatchFromDevtools&&typeof r.dispatch=="function"){let y=!1;const w=r.dispatch;r.dispatch=(...b)=>{(E_?"production":void 0)!=="production"&&b[0].type==="__setState"&&!y&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),y=!0),w(...b)}}return u.subscribe(y=>{var w;switch(y.type){case"ACTION":if(typeof y.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return gre(y.payload,b=>{if(b.type==="__setState"){if(l===void 0){p(b.state);return}Object.keys(b.state).length!==1&&console.error(` [zustand devtools middleware] Unsupported __setState action format. When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(), and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } } - `);const C=b.state[l];if(C==null)return;JSON.stringify(r.getState())!==JSON.stringify(C)&&p(C);return}r.dispatchFromDevtools&&typeof r.dispatch=="function"&&r.dispatch(b)});case"DISPATCH":switch(y.payload.type){case"RESET":return p(g),l===void 0?u==null?void 0:u.init(r.getState()):u==null?void 0:u.init(aY(s.name));case"COMMIT":if(l===void 0){u==null||u.init(r.getState());return}return u==null?void 0:u.init(aY(s.name));case"ROLLBACK":return gre(y.state,b=>{if(l===void 0){p(b),u==null||u.init(r.getState());return}p(b[l]),u==null||u.init(aY(s.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return gre(y.state,b=>{if(l===void 0){p(b);return}JSON.stringify(r.getState())!==JSON.stringify(b[l])&&p(b[l])});case"IMPORT_STATE":{const{nextLiftedState:b}=y.payload,C=(w=b.computedStates.slice(-1)[0])==null?void 0:w.state;if(!C)return;p(l===void 0?C:C[l]),u==null||u.send(null,b);return}case"PAUSE_RECORDING":return f=!f}return}}),g},j6t=U6t,gre=(t,e)=>{let n;try{n=JSON.parse(t)}catch(o){console.error("[zustand devtools middleware] Could not parse the received json",o)}n!==void 0&&e(n)};function $Ue(t,e){let n;try{n=t()}catch{return}return{getItem:r=>{var i;const a=s=>s===null?null:JSON.parse(s,void 0),l=(i=n.getItem(r))!=null?i:null;return l instanceof Promise?l.then(a):a(l)},setItem:(r,i)=>n.setItem(r,JSON.stringify(i,void 0)),removeItem:r=>n.removeItem(r)}}const _F=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(o){return _F(o)(n)},catch(o){return this}}}catch(n){return{then(o){return this},catch(o){return _F(o)(n)}}}},B6t=(t,e)=>(n,o,r)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:w=>w,version:0,merge:(w,b)=>({...b,...w}),...e},a=!1;const l=new Set,s=new Set;let c;try{c=i.getStorage()}catch{}if(!c)return t((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...w)},o,r);const u=_F(i.serialize),d=()=>{const w=i.partialize({...o()});let b;const C=u({state:w,version:i.version}).then(P=>c.setItem(i.name,P)).catch(P=>{b=P});if(b)throw b;return C},f=r.setState;r.setState=(w,b)=>{f(w,b),d()};const p=t((...w)=>{n(...w),d()},o,r);let g;const y=()=>{var w;if(!c)return;a=!1,l.forEach(C=>C(o()));const b=((w=i.onRehydrateStorage)==null?void 0:w.call(i,o()))||void 0;return _F(c.getItem.bind(c))(i.name).then(C=>{if(C)return i.deserialize(C)}).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==i.version){if(i.migrate)return i.migrate(C.state,C.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return C.state}).then(C=>{var P;return g=i.merge(C,(P=o())!=null?P:p),n(g,!0),d()}).then(()=>{b==null||b(g,void 0),a=!0,s.forEach(C=>C(g))}).catch(C=>{b==null||b(void 0,C)})};return r.persist={setOptions:w=>{i={...i,...w},w.getStorage&&(c=w.getStorage())},clearStorage:()=>{c==null||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>y(),hasHydrated:()=>a,onHydrate:w=>(l.add(w),()=>{l.delete(w)}),onFinishHydration:w=>(s.add(w),()=>{s.delete(w)})},y(),g||p},Y6t=(t,e)=>(n,o,r)=>{let i={storage:$Ue(()=>localStorage),partialize:y=>y,version:0,merge:(y,w)=>({...w,...y}),...e},a=!1;const l=new Set,s=new Set;let c=i.storage;if(!c)return t((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...y)},o,r);const u=()=>{const y=i.partialize({...o()});return c.setItem(i.name,{state:y,version:i.version})},d=r.setState;r.setState=(y,w)=>{d(y,w),u()};const f=t((...y)=>{n(...y),u()},o,r);let p;const g=()=>{var y,w;if(!c)return;a=!1,l.forEach(C=>{var P;return C((P=o())!=null?P:f)});const b=((w=i.onRehydrateStorage)==null?void 0:w.call(i,(y=o())!=null?y:f))||void 0;return _F(c.getItem.bind(c))(i.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==i.version){if(i.migrate)return i.migrate(C.state,C.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return C.state}).then(C=>{var P;return p=i.merge(C,(P=o())!=null?P:f),n(p,!0),u()}).then(()=>{b==null||b(p,void 0),p=o(),a=!0,s.forEach(C=>C(p))}).catch(C=>{b==null||b(void 0,C)})};return r.persist={setOptions:y=>{i={...i,...y},y.storage&&(c=y.storage)},clearStorage:()=>{c==null||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>a,onHydrate:y=>(l.add(y),()=>{l.delete(y)}),onFinishHydration:y=>(s.add(y),()=>{s.delete(y)})},i.skipHydration||g(),p||f},O6t=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((D_?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),B6t(t,e)):Y6t(t,e),_6t=O6t;var cG={exports:{}};/*! + `);const C=b.state[l];if(C==null)return;JSON.stringify(r.getState())!==JSON.stringify(C)&&p(C);return}r.dispatchFromDevtools&&typeof r.dispatch=="function"&&r.dispatch(b)});case"DISPATCH":switch(y.payload.type){case"RESET":return p(g),l===void 0?u==null?void 0:u.init(r.getState()):u==null?void 0:u.init(lY(s.name));case"COMMIT":if(l===void 0){u==null||u.init(r.getState());return}return u==null?void 0:u.init(lY(s.name));case"ROLLBACK":return gre(y.state,b=>{if(l===void 0){p(b),u==null||u.init(r.getState());return}p(b[l]),u==null||u.init(lY(s.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return gre(y.state,b=>{if(l===void 0){p(b);return}JSON.stringify(r.getState())!==JSON.stringify(b[l])&&p(b[l])});case"IMPORT_STATE":{const{nextLiftedState:b}=y.payload,C=(w=b.computedStates.slice(-1)[0])==null?void 0:w.state;if(!C)return;p(l===void 0?C:C[l]),u==null||u.send(null,b);return}case"PAUSE_RECORDING":return f=!f}return}}),g},j6t=U6t,gre=(t,e)=>{let n;try{n=JSON.parse(t)}catch(o){console.error("[zustand devtools middleware] Could not parse the received json",o)}n!==void 0&&e(n)};function QUe(t,e){let n;try{n=t()}catch{return}return{getItem:r=>{var i;const a=s=>s===null?null:JSON.parse(s,void 0),l=(i=n.getItem(r))!=null?i:null;return l instanceof Promise?l.then(a):a(l)},setItem:(r,i)=>n.setItem(r,JSON.stringify(i,void 0)),removeItem:r=>n.removeItem(r)}}const _F=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(o){return _F(o)(n)},catch(o){return this}}}catch(n){return{then(o){return this},catch(o){return _F(o)(n)}}}},B6t=(t,e)=>(n,o,r)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:w=>w,version:0,merge:(w,b)=>({...b,...w}),...e},a=!1;const l=new Set,s=new Set;let c;try{c=i.getStorage()}catch{}if(!c)return t((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...w)},o,r);const u=_F(i.serialize),d=()=>{const w=i.partialize({...o()});let b;const C=u({state:w,version:i.version}).then(P=>c.setItem(i.name,P)).catch(P=>{b=P});if(b)throw b;return C},f=r.setState;r.setState=(w,b)=>{f(w,b),d()};const p=t((...w)=>{n(...w),d()},o,r);let g;const y=()=>{var w;if(!c)return;a=!1,l.forEach(C=>C(o()));const b=((w=i.onRehydrateStorage)==null?void 0:w.call(i,o()))||void 0;return _F(c.getItem.bind(c))(i.name).then(C=>{if(C)return i.deserialize(C)}).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==i.version){if(i.migrate)return i.migrate(C.state,C.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return C.state}).then(C=>{var P;return g=i.merge(C,(P=o())!=null?P:p),n(g,!0),d()}).then(()=>{b==null||b(g,void 0),a=!0,s.forEach(C=>C(g))}).catch(C=>{b==null||b(void 0,C)})};return r.persist={setOptions:w=>{i={...i,...w},w.getStorage&&(c=w.getStorage())},clearStorage:()=>{c==null||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>y(),hasHydrated:()=>a,onHydrate:w=>(l.add(w),()=>{l.delete(w)}),onFinishHydration:w=>(s.add(w),()=>{s.delete(w)})},y(),g||p},Y6t=(t,e)=>(n,o,r)=>{let i={storage:QUe(()=>localStorage),partialize:y=>y,version:0,merge:(y,w)=>({...w,...y}),...e},a=!1;const l=new Set,s=new Set;let c=i.storage;if(!c)return t((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...y)},o,r);const u=()=>{const y=i.partialize({...o()});return c.setItem(i.name,{state:y,version:i.version})},d=r.setState;r.setState=(y,w)=>{d(y,w),u()};const f=t((...y)=>{n(...y),u()},o,r);let p;const g=()=>{var y,w;if(!c)return;a=!1,l.forEach(C=>{var P;return C((P=o())!=null?P:f)});const b=((w=i.onRehydrateStorage)==null?void 0:w.call(i,(y=o())!=null?y:f))||void 0;return _F(c.getItem.bind(c))(i.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==i.version){if(i.migrate)return i.migrate(C.state,C.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return C.state}).then(C=>{var P;return p=i.merge(C,(P=o())!=null?P:f),n(p,!0),u()}).then(()=>{b==null||b(p,void 0),p=o(),a=!0,s.forEach(C=>C(p))}).catch(C=>{b==null||b(void 0,C)})};return r.persist={setOptions:y=>{i={...i,...y},y.storage&&(c=y.storage)},clearStorage:()=>{c==null||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>a,onHydrate:y=>(l.add(y),()=>{l.delete(y)}),onFinishHydration:y=>(s.add(y),()=>{s.delete(y)})},i.skipHydration||g(),p||f},O6t=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((E_?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),B6t(t,e)):Y6t(t,e),_6t=O6t;var uG={exports:{}};/*! * Platform.js v1.3.6 * Copyright 2014-2020 Benjamin Tan * Copyright 2011-2013 John-David Dalton * Available under MIT license - */cG.exports;(function(t,e){(function(){var n={function:!0,object:!0},o=n[typeof window]&&window||this,r=e,i=t&&!t.nodeType&&t,a=r&&i&&typeof Ac=="object"&&Ac;a&&(a.global===a||a.window===a||a.self===a)&&(o=a);var l=Math.pow(2,53)-1,s=/\bOpera/,c=Object.prototype,u=c.hasOwnProperty,d=c.toString;function f(S){return S=String(S),S.charAt(0).toUpperCase()+S.slice(1)}function p(S,R,M){var D={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return R&&M&&/^Win/i.test(S)&&!/^Windows Phone /i.test(S)&&(D=D[/[\d.]+$/.exec(S)])&&(S="Windows "+D),S=String(S),R&&M&&(S=S.replace(RegExp(R,"i"),M)),S=y(S.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0]),S}function g(S,R){var M=-1,D=S?S.length:0;if(typeof D=="number"&&D>-1&&D<=l)for(;++M3&&"WebKit"||/\bOpera\b/.test(ge)&&(/\bOPR\b/.test(S)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(S)&&!/^(?:Trident|EdgeHTML)$/.test(fe)&&"WebKit"||!fe&&/\bMSIE\b/i.test(S)&&(he=="Mac OS"?"Tasman":"Trident")||fe=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(ge)&&"NetFront")&&(fe=[le]),ge=="IE"&&(le=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(S)||0)[1])?(ge+=" Mobile",he="Windows Phone "+(/\+$/.test(le)?le:le+".x"),te.unshift("desktop mode")):/\bWPDesktop\b/i.test(S)?(ge="IE Mobile",he="Windows Phone 8.x",te.unshift("desktop mode"),se||(se=(/\brv:([\d.]+)/.exec(S)||0)[1])):ge!="IE"&&fe=="Trident"&&(le=/\brv:([\d.]+)/.exec(S))&&(ge&&te.push("identifying as "+ge+(se?" "+se:"")),ge="IE",se=le[1]),ae){if(C(R,"global"))if(U&&(le=U.lang.System,q=le.getProperty("os.arch"),he=he||le.getProperty("os.name")+" "+le.getProperty("os.version")),O){try{se=R.require("ringo/engine").version.join("."),ge="RingoJS"}catch{(le=R.system)&&le.global.system==R.system&&(ge="Narwhal",he||(he=le[0].os||null))}ge||(ge="Rhino")}else typeof R.process=="object"&&!R.process.browser&&(le=R.process)&&(typeof le.versions=="object"&&(typeof le.versions.electron=="string"?(te.push("Node "+le.versions.node),ge="Electron",se=le.versions.electron):typeof le.versions.nw=="string"&&(te.push("Chromium "+se,"Node "+le.versions.node),ge="NW.js",se=le.versions.nw)),ge||(ge="Node.js",q=le.arch,he=le.platform,se=/[\d.]+/.exec(le.version),se=se?se[0]:null));else b(le=R.runtime)==L?(ge="Adobe AIR",he=le.flash.system.Capabilities.os):b(le=R.phantom)==F?(ge="PhantomJS",se=(le=le.version||null)&&le.major+"."+le.minor+"."+le.patch):typeof X.documentMode=="number"&&(le=/\bTrident\/(\d+)/i.exec(S))?(se=[se,X.documentMode],(le=+le[1]+4)!=se[1]&&(te.push("IE "+se[1]+" mode"),fe&&(fe[1]=""),se[1]=le),se=ge=="IE"?String(se[1].toFixed(1)):se[0]):typeof X.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(ge)&&(te.push("masking as "+ge+" "+se),ge="IE",se="11.0",fe=["Trident"],he="Windows");he=he&&y(he)}if(se&&(le=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(se)||/(?:alpha|beta)(?: ?\d)?/i.exec(S+";"+(ae&&D.appMinorVersion))||/\bMinefield\b/i.test(S)&&"a")&&(re=/b/i.test(le)?"beta":"alpha",se=se.replace(RegExp(le+"\\+?$"),"")+(re=="beta"?_:B)+(/\d+\+?/.exec(le)||"")),ge=="Fennec"||ge=="Firefox"&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(he))ge="Firefox Mobile";else if(ge=="Maxthon"&&se)se=se.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(de))de=="Xbox 360"&&(he=null),de=="Xbox 360"&&/\bIEMobile\b/.test(S)&&te.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(ge)||ge&&!de&&!/Browser|Mobi/.test(ge))&&(he=="Windows CE"||/Mobi/i.test(S)))ge+=" Mobile";else if(ge=="IE"&&ae)try{R.external===null&&te.unshift("platform preview")}catch{te.unshift("embedded")}else(/\bBlackBerry\b/.test(de)||/\bBB10\b/.test(S))&&(le=(RegExp(de.replace(/ +/g," *")+"/([.\\d]+)","i").exec(S)||0)[1]||se)?(le=[le,/BB10/.test(S)],he=(le[1]?(de=null,Z="BlackBerry"):"Device Software")+" "+le[0],se=null):this!=w&&de!="Wii"&&(ae&&$||/Opera/.test(ge)&&/\b(?:MSIE|Firefox)\b/i.test(S)||ge=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(he)||ge=="IE"&&(he&&!/^Win/.test(he)&&se>5.5||/\bWindows XP\b/.test(he)&&se>8||se==8&&!/\bTrident\b/.test(S)))&&!s.test(le=A.call(w,S.replace(s,"")+";"))&&le.name&&(le="ing as "+le.name+((le=le.version)?" "+le:""),s.test(ge)?(/\bIE\b/.test(le)&&he=="Mac OS"&&(he=null),le="identify"+le):(le="mask"+le,Q?ge=y(Q.replace(/([a-z])([A-Z])/g,"$1 $2")):ge="Opera",/\bIE\b/.test(le)&&(he=null),ae||(se=null)),fe=["Presto"],te.push(le));(le=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(S)||0)[1])&&(le=[parseFloat(le.replace(/\.(\d)$/,".0$1")),le],ge=="Safari"&&le[1].slice(-1)=="+"?(ge="WebKit Nightly",re="alpha",se=le[1].slice(0,-1)):(se==le[1]||se==(le[2]=(/\bSafari\/([\d.]+\+?)/i.exec(S)||0)[1]))&&(se=null),le[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(S)||0)[1],le[0]==537.36&&le[2]==537.36&&parseFloat(le[1])>=28&&fe=="WebKit"&&(fe=["Blink"]),!ae||!W&&!le[1]?(fe&&(fe[1]="like Safari"),le=(le=le[0],le<400?1:le<500?2:le<526?3:le<533?4:le<534?"4+":le<535?5:le<537?6:le<538?7:le<601?8:le<602?9:le<604?10:le<606?11:le<608?12:"12")):(fe&&(fe[1]="like Chrome"),le=le[1]||(le=le[0],le<530?1:le<532?2:le<532.05?3:le<533?4:le<534.03?5:le<534.07?6:le<534.1?7:le<534.13?8:le<534.16?9:le<534.24?10:le<534.3?11:le<535.01?12:le<535.02?"13+":le<535.07?15:le<535.11?16:le<535.19?17:le<536.05?18:le<536.1?19:le<537.01?20:le<537.11?"21+":le<537.13?23:le<537.18?24:le<537.24?25:le<537.36?26:fe!="Blink"?"27":"28")),fe&&(fe[1]+=" "+(le+=typeof le=="number"?".x":/[.+]/.test(le)?"":"+")),ge=="Safari"&&(!se||parseInt(se)>45)?se=le:ge=="Chrome"&&/\bHeadlessChrome/i.test(S)&&te.unshift("headless")),ge=="Opera"&&(le=/\bzbov|zvav$/.exec(he))?(ge+=" ",te.unshift("desktop mode"),le=="zvav"?(ge+="Mini",se=null):ge+="Mobile",he=he.replace(RegExp(" *"+le+"$"),"")):ge=="Safari"&&/\bChrome\b/.exec(fe&&fe[1])?(te.unshift("desktop mode"),ge="Chrome Mobile",se=null,/\bOS X\b/.test(he)?(Z="Apple",he="iOS 4.3+"):he=null):/\bSRWare Iron\b/.test(ge)&&!se&&(se=ye("Chrome")),se&&se.indexOf(le=/[\d.]+$/.exec(he))==0&&S.indexOf("/"+le+"-")>-1&&(he=T(he.replace(le,""))),he&&he.indexOf(ge)!=-1&&!RegExp(ge+" OS").test(he)&&(he=he.replace(RegExp(" *"+P(ge)+" *"),"")),fe&&!/\b(?:Avant|Nook)\b/.test(ge)&&(/Browser|Lunascape|Maxthon/.test(ge)||ge!="Safari"&&/^iOS/.test(he)&&/\bSafari\b/.test(fe[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(ge)&&fe[1])&&(le=fe[fe.length-1])&&te.push(le),te.length&&(te=["("+te.join("; ")+")"]),Z&&de&&de.indexOf(Z)<0&&te.push("on "+Z),de&&te.push((/^on /.test(te[te.length-1])?"":"on ")+de),he&&(le=/ ([\d.+]+)$/.exec(he),ne=le&&he.charAt(he.length-le[0].length-1)=="/",he={architecture:32,family:le&&!ne?he.replace(le[0],""):he,version:le?le[1]:null,toString:function(){var ve=this.version;return this.family+(ve&&!ne?" "+ve:"")+(this.architecture==64?" 64-bit":"")}}),(le=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(q))&&!/\bi686\b/i.test(q)?(he&&(he.architecture=64,he.family=he.family.replace(RegExp(" *"+le),"")),ge&&(/\bWOW64\b/i.test(S)||ae&&/\w(?:86|32)$/.test(D.cpuClass||D.platform)&&!/\bWin64; x64\b/i.test(S))&&te.unshift("32-bit")):he&&/^OS X/.test(he.family)&&ge=="Chrome"&&parseFloat(se)>=39&&(he.architecture=64),S||(S=null);var pe={};return pe.description=S,pe.layout=fe&&fe[0],pe.manufacturer=Z,pe.name=ge,pe.prerelease=re,pe.product=de,pe.ua=S,pe.version=ge&&se,pe.os=he||{architecture:null,family:null,version:null,toString:function(){return"null"}},pe.parse=A,pe.toString=ce,pe.version&&te.unshift(se),pe.name&&te.unshift(ge),he&&ge&&!(he==String(he).split(" ")[0]&&(he==ge.split(" ")[0]||de))&&te.push(de?"("+he+")":"on "+he),te.length&&(pe.description=te.join(" ")),pe}var x=A();r&&i?w(x,function(S,R){r[R]=S}):o.platform=x}).call(Ac)})(cG,cG.exports);var V6t=cG.exports;const QUe=Fi(V6t),TC="1.6.3",G6t="1.5.0",t1="https://institute-for-future-intelligence.github.io/aladdin/",uG="Natick, MA",rg=["#627682","#8884d8","#f97356","#1bc32c","#c6502d","#82ca9d","#3eaec0","#445111"],Sc=15,VF=50,dG=.5,m0=.8,X6t=new rr(0,0,1),J6t=new rr(0,1,0),K6t=new rr(1,1,0),q6t=new rr(1,0,0),Rz=[X6t,J6t,K6t,q6t],Qm=20,g0="gray",Zm=.5,r3=4,o8=2,f6=2,r8=2,y6=2,V4=2,G4=1,ZUe=1,ew=100,fG=200,hG="#3BB9FF",pG="#36454F",t9="#FFFFFF",n9="#404040",eje=10,h8=4,Ms=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],twe=["January","February","March","April","May","June","July","August","September","October","November","December"],Eq=105,Fq=320,$6t=5e3,tje=45,GF=1e4,Q6t=4096,Z6t=.1,c1=.1,Vx=.16,tw="orange",XF="orchid",eAt="pink",Da="white",ta="red",y0="yellow",Z5=5,m9=.1,S6=Z5*m9,nje=1e4,nwe=250,tAt=.01,nAt=.005,oAt="#000",rAt="#01345B",Lce="#fe6f5e",Zo="Ground",Gt=Math.PI/2,la=Math.PI*2,It=1e-4,rs=[0,0,1],iAt=[0,-1,0],Op=new ie(1,0,0),_p=new ie(-1,0,0),Oc=new ie(0,1,0),Vp=new ie(0,-1,0),Io=new ie(0,0,1);new ie(0,0,-1);const si=new Xt(0,0);new ie(0,0,0);const gG=new nn(0,0,Gt),aR=/^[A-Za-z0-9\s-_()!?%&,]*$/,mre=aAt()?"⌘":"Ctrl";function aAt(){var e;const t=(e=QUe.os)==null?void 0:e.family;return t?t.includes("Mac")||t.includes("OS X"):!1}var El=(t=>(t.Full="Full",t.Partial="Partial",t.Empty="Empty",t))(El||{}),gc=(t=>(t.Default="Default",t.Stud="Stud",t.Pillar="Pillar",t))(gc||{});let cr=class{constructor(e,n,o,r){this.x=e,this.y=n,this.width=o,this.height=r}centerX(){return this.x+this.width/2}centerY(){return this.y+this.height/2}minX(){return this.x}maxX(){return this.x+this.width}minY(){return this.y}maxY(){return this.y+this.height}contains(e,n){return e>this.x&&ethis.y&&n(t.Pyramid="Pyramid",t.Gable="Gable",t.Hip="Hip",t.Gambrel="Gambrel",t.Mansard="Mansard",t))(Go||{}),wc=(t=>(t.Default="Default",t.Rafter="Rafter",t.Glass="Glass",t))(wc||{});function U9(){return U9=Object.assign?Object.assign.bind():function(t){for(var e=1;en&&s.add(D)}s.normalize(),g.setXYZ(b+T,s.x,s.y,s.z)}}return u.setAttribute("normal",g),u}const owe=new bf,lY=new ie;class hge extends Dq{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],o=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(o),this.setAttribute("position",new gr(e,3)),this.setAttribute("uv",new gr(n,2))}applyMatrix4(e){const n=this.attributes.instanceStart,o=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(e),o.applyMatrix4(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const o=new rG(n,6,1);return this.setAttribute("instanceStart",new mg(o,3,0)),this.setAttribute("instanceEnd",new mg(o,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const o=new rG(n,6,1);return this.setAttribute("instanceColorStart",new mg(o,3,0)),this.setAttribute("instanceColorEnd",new mg(o,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new K1e(e.geometry)),this}fromLineSegments(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new bf);const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;e!==void 0&&n!==void 0&&(this.boundingBox.setFromBufferAttribute(e),owe.setFromBufferAttribute(n),this.boundingBox.union(owe))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new s1),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(e!==void 0&&n!==void 0){const o=this.boundingSphere.center;this.boundingBox.getCenter(o);let r=0;for(let i=0,a=e.count;i-1&&D<=l)for(;++M3&&"WebKit"||/\bOpera\b/.test(ge)&&(/\bOPR\b/.test(S)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(S)&&!/^(?:Trident|EdgeHTML)$/.test(fe)&&"WebKit"||!fe&&/\bMSIE\b/i.test(S)&&(he=="Mac OS"?"Tasman":"Trident")||fe=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(ge)&&"NetFront")&&(fe=[le]),ge=="IE"&&(le=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(S)||0)[1])?(ge+=" Mobile",he="Windows Phone "+(/\+$/.test(le)?le:le+".x"),te.unshift("desktop mode")):/\bWPDesktop\b/i.test(S)?(ge="IE Mobile",he="Windows Phone 8.x",te.unshift("desktop mode"),se||(se=(/\brv:([\d.]+)/.exec(S)||0)[1])):ge!="IE"&&fe=="Trident"&&(le=/\brv:([\d.]+)/.exec(S))&&(ge&&te.push("identifying as "+ge+(se?" "+se:"")),ge="IE",se=le[1]),ae){if(C(R,"global"))if(U&&(le=U.lang.System,q=le.getProperty("os.arch"),he=he||le.getProperty("os.name")+" "+le.getProperty("os.version")),O){try{se=R.require("ringo/engine").version.join("."),ge="RingoJS"}catch{(le=R.system)&&le.global.system==R.system&&(ge="Narwhal",he||(he=le[0].os||null))}ge||(ge="Rhino")}else typeof R.process=="object"&&!R.process.browser&&(le=R.process)&&(typeof le.versions=="object"&&(typeof le.versions.electron=="string"?(te.push("Node "+le.versions.node),ge="Electron",se=le.versions.electron):typeof le.versions.nw=="string"&&(te.push("Chromium "+se,"Node "+le.versions.node),ge="NW.js",se=le.versions.nw)),ge||(ge="Node.js",q=le.arch,he=le.platform,se=/[\d.]+/.exec(le.version),se=se?se[0]:null));else b(le=R.runtime)==L?(ge="Adobe AIR",he=le.flash.system.Capabilities.os):b(le=R.phantom)==F?(ge="PhantomJS",se=(le=le.version||null)&&le.major+"."+le.minor+"."+le.patch):typeof X.documentMode=="number"&&(le=/\bTrident\/(\d+)/i.exec(S))?(se=[se,X.documentMode],(le=+le[1]+4)!=se[1]&&(te.push("IE "+se[1]+" mode"),fe&&(fe[1]=""),se[1]=le),se=ge=="IE"?String(se[1].toFixed(1)):se[0]):typeof X.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(ge)&&(te.push("masking as "+ge+" "+se),ge="IE",se="11.0",fe=["Trident"],he="Windows");he=he&&y(he)}if(se&&(le=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(se)||/(?:alpha|beta)(?: ?\d)?/i.exec(S+";"+(ae&&D.appMinorVersion))||/\bMinefield\b/i.test(S)&&"a")&&(re=/b/i.test(le)?"beta":"alpha",se=se.replace(RegExp(le+"\\+?$"),"")+(re=="beta"?_:B)+(/\d+\+?/.exec(le)||"")),ge=="Fennec"||ge=="Firefox"&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(he))ge="Firefox Mobile";else if(ge=="Maxthon"&&se)se=se.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(de))de=="Xbox 360"&&(he=null),de=="Xbox 360"&&/\bIEMobile\b/.test(S)&&te.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(ge)||ge&&!de&&!/Browser|Mobi/.test(ge))&&(he=="Windows CE"||/Mobi/i.test(S)))ge+=" Mobile";else if(ge=="IE"&&ae)try{R.external===null&&te.unshift("platform preview")}catch{te.unshift("embedded")}else(/\bBlackBerry\b/.test(de)||/\bBB10\b/.test(S))&&(le=(RegExp(de.replace(/ +/g," *")+"/([.\\d]+)","i").exec(S)||0)[1]||se)?(le=[le,/BB10/.test(S)],he=(le[1]?(de=null,Z="BlackBerry"):"Device Software")+" "+le[0],se=null):this!=w&&de!="Wii"&&(ae&&$||/Opera/.test(ge)&&/\b(?:MSIE|Firefox)\b/i.test(S)||ge=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(he)||ge=="IE"&&(he&&!/^Win/.test(he)&&se>5.5||/\bWindows XP\b/.test(he)&&se>8||se==8&&!/\bTrident\b/.test(S)))&&!s.test(le=A.call(w,S.replace(s,"")+";"))&&le.name&&(le="ing as "+le.name+((le=le.version)?" "+le:""),s.test(ge)?(/\bIE\b/.test(le)&&he=="Mac OS"&&(he=null),le="identify"+le):(le="mask"+le,Q?ge=y(Q.replace(/([a-z])([A-Z])/g,"$1 $2")):ge="Opera",/\bIE\b/.test(le)&&(he=null),ae||(se=null)),fe=["Presto"],te.push(le));(le=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(S)||0)[1])&&(le=[parseFloat(le.replace(/\.(\d)$/,".0$1")),le],ge=="Safari"&&le[1].slice(-1)=="+"?(ge="WebKit Nightly",re="alpha",se=le[1].slice(0,-1)):(se==le[1]||se==(le[2]=(/\bSafari\/([\d.]+\+?)/i.exec(S)||0)[1]))&&(se=null),le[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(S)||0)[1],le[0]==537.36&&le[2]==537.36&&parseFloat(le[1])>=28&&fe=="WebKit"&&(fe=["Blink"]),!ae||!W&&!le[1]?(fe&&(fe[1]="like Safari"),le=(le=le[0],le<400?1:le<500?2:le<526?3:le<533?4:le<534?"4+":le<535?5:le<537?6:le<538?7:le<601?8:le<602?9:le<604?10:le<606?11:le<608?12:"12")):(fe&&(fe[1]="like Chrome"),le=le[1]||(le=le[0],le<530?1:le<532?2:le<532.05?3:le<533?4:le<534.03?5:le<534.07?6:le<534.1?7:le<534.13?8:le<534.16?9:le<534.24?10:le<534.3?11:le<535.01?12:le<535.02?"13+":le<535.07?15:le<535.11?16:le<535.19?17:le<536.05?18:le<536.1?19:le<537.01?20:le<537.11?"21+":le<537.13?23:le<537.18?24:le<537.24?25:le<537.36?26:fe!="Blink"?"27":"28")),fe&&(fe[1]+=" "+(le+=typeof le=="number"?".x":/[.+]/.test(le)?"":"+")),ge=="Safari"&&(!se||parseInt(se)>45)?se=le:ge=="Chrome"&&/\bHeadlessChrome/i.test(S)&&te.unshift("headless")),ge=="Opera"&&(le=/\bzbov|zvav$/.exec(he))?(ge+=" ",te.unshift("desktop mode"),le=="zvav"?(ge+="Mini",se=null):ge+="Mobile",he=he.replace(RegExp(" *"+le+"$"),"")):ge=="Safari"&&/\bChrome\b/.exec(fe&&fe[1])?(te.unshift("desktop mode"),ge="Chrome Mobile",se=null,/\bOS X\b/.test(he)?(Z="Apple",he="iOS 4.3+"):he=null):/\bSRWare Iron\b/.test(ge)&&!se&&(se=ye("Chrome")),se&&se.indexOf(le=/[\d.]+$/.exec(he))==0&&S.indexOf("/"+le+"-")>-1&&(he=T(he.replace(le,""))),he&&he.indexOf(ge)!=-1&&!RegExp(ge+" OS").test(he)&&(he=he.replace(RegExp(" *"+P(ge)+" *"),"")),fe&&!/\b(?:Avant|Nook)\b/.test(ge)&&(/Browser|Lunascape|Maxthon/.test(ge)||ge!="Safari"&&/^iOS/.test(he)&&/\bSafari\b/.test(fe[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(ge)&&fe[1])&&(le=fe[fe.length-1])&&te.push(le),te.length&&(te=["("+te.join("; ")+")"]),Z&&de&&de.indexOf(Z)<0&&te.push("on "+Z),de&&te.push((/^on /.test(te[te.length-1])?"":"on ")+de),he&&(le=/ ([\d.+]+)$/.exec(he),ne=le&&he.charAt(he.length-le[0].length-1)=="/",he={architecture:32,family:le&&!ne?he.replace(le[0],""):he,version:le?le[1]:null,toString:function(){var ve=this.version;return this.family+(ve&&!ne?" "+ve:"")+(this.architecture==64?" 64-bit":"")}}),(le=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(q))&&!/\bi686\b/i.test(q)?(he&&(he.architecture=64,he.family=he.family.replace(RegExp(" *"+le),"")),ge&&(/\bWOW64\b/i.test(S)||ae&&/\w(?:86|32)$/.test(D.cpuClass||D.platform)&&!/\bWin64; x64\b/i.test(S))&&te.unshift("32-bit")):he&&/^OS X/.test(he.family)&&ge=="Chrome"&&parseFloat(se)>=39&&(he.architecture=64),S||(S=null);var pe={};return pe.description=S,pe.layout=fe&&fe[0],pe.manufacturer=Z,pe.name=ge,pe.prerelease=re,pe.product=de,pe.ua=S,pe.version=ge&&se,pe.os=he||{architecture:null,family:null,version:null,toString:function(){return"null"}},pe.parse=A,pe.toString=ce,pe.version&&te.unshift(se),pe.name&&te.unshift(ge),he&&ge&&!(he==String(he).split(" ")[0]&&(he==ge.split(" ")[0]||de))&&te.push(de?"("+he+")":"on "+he),te.length&&(pe.description=te.join(" ")),pe}var x=A();r&&i?w(x,function(S,R){r[R]=S}):o.platform=x}).call(Ac)})(uG,uG.exports);var V6t=uG.exports;const ZUe=Fi(V6t),TC="1.6.4",G6t="1.5.0",t1="https://institute-for-future-intelligence.github.io/aladdin/",dG="Natick, MA",rg=["#627682","#8884d8","#f97356","#1bc32c","#c6502d","#82ca9d","#3eaec0","#445111"],Sc=15,VF=50,fG=.5,m0=.8,X6t=new rr(0,0,1),J6t=new rr(0,1,0),K6t=new rr(1,1,0),q6t=new rr(1,0,0),Rz=[X6t,J6t,K6t,q6t],Qm=20,g0="gray",Zm=.5,r3=4,o8=2,f6=2,r8=2,y6=2,V4=2,G4=1,eje=1,ew=100,hG=200,pG="#3BB9FF",gG="#36454F",t9="#FFFFFF",n9="#404040",tje=10,h8=4,Ms=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],nwe=["January","February","March","April","May","June","July","August","September","October","November","December"],Fq=105,kq=320,$6t=5e3,nje=45,GF=1e4,Q6t=4096,Z6t=.1,c1=.1,Vx=.16,tw="orange",XF="orchid",eAt="pink",Da="white",ta="red",y0="yellow",Z5=5,m9=.1,S6=Z5*m9,oje=1e4,owe=250,tAt=.01,nAt=.005,oAt="#000",rAt="#01345B",Lce="#fe6f5e",Zo="Ground",Gt=Math.PI/2,la=Math.PI*2,It=1e-4,rs=[0,0,1],iAt=[0,-1,0],Op=new ie(1,0,0),_p=new ie(-1,0,0),Oc=new ie(0,1,0),Vp=new ie(0,-1,0),Io=new ie(0,0,1);new ie(0,0,-1);const si=new Xt(0,0);new ie(0,0,0);const mG=new nn(0,0,Gt),aR=/^[A-Za-z0-9\s-_()!?%&,]*$/,mre=aAt()?"⌘":"Ctrl";function aAt(){var e;const t=(e=ZUe.os)==null?void 0:e.family;return t?t.includes("Mac")||t.includes("OS X"):!1}var El=(t=>(t.Full="Full",t.Partial="Partial",t.Empty="Empty",t))(El||{}),gc=(t=>(t.Default="Default",t.Stud="Stud",t.Pillar="Pillar",t))(gc||{});let cr=class{constructor(e,n,o,r){this.x=e,this.y=n,this.width=o,this.height=r}centerX(){return this.x+this.width/2}centerY(){return this.y+this.height/2}minX(){return this.x}maxX(){return this.x+this.width}minY(){return this.y}maxY(){return this.y+this.height}contains(e,n){return e>this.x&&ethis.y&&n(t.Pyramid="Pyramid",t.Gable="Gable",t.Hip="Hip",t.Gambrel="Gambrel",t.Mansard="Mansard",t))(Go||{}),wc=(t=>(t.Default="Default",t.Rafter="Rafter",t.Glass="Glass",t))(wc||{});function U9(){return U9=Object.assign?Object.assign.bind():function(t){for(var e=1;en&&s.add(D)}s.normalize(),g.setXYZ(b+T,s.x,s.y,s.z)}}return u.setAttribute("normal",g),u}const rwe=new bf,sY=new ie;class hge extends Eq{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],o=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(o),this.setAttribute("position",new gr(e,3)),this.setAttribute("uv",new gr(n,2))}applyMatrix4(e){const n=this.attributes.instanceStart,o=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(e),o.applyMatrix4(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const o=new iG(n,6,1);return this.setAttribute("instanceStart",new mg(o,3,0)),this.setAttribute("instanceEnd",new mg(o,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const o=new iG(n,6,1);return this.setAttribute("instanceColorStart",new mg(o,3,0)),this.setAttribute("instanceColorEnd",new mg(o,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new K1e(e.geometry)),this}fromLineSegments(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new bf);const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;e!==void 0&&n!==void 0&&(this.boundingBox.setFromBufferAttribute(e),rwe.setFromBufferAttribute(n),this.boundingBox.union(rwe))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new s1),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(e!==void 0&&n!==void 0){const o=this.boundingSphere.center;this.boundingBox.getCenter(o);let r=0;for(let i=0,a=e.count;i #include #include @@ -4094,15 +4094,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho #include } - `,clipping:!0}),this.isLineMaterial=!0,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(n){this.uniforms.diffuse.value=n}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(n){n===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(n){this.uniforms.linewidth.value=n}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(n){!!n!="USE_DASH"in this.defines&&(this.needsUpdate=!0),n===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(n){this.uniforms.dashScale.value=n}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(n){this.uniforms.dashSize.value=n}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(n){this.uniforms.dashOffset.value=n}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(n){this.uniforms.gapSize.value=n}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(n){this.uniforms.opacity.value=n}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(n){this.uniforms.resolution.value.copy(n)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(n){!!n!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),n===!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 rwe=new ie,iwe=new ie,Qd=new Qa,Zd=new Qa,V5=new Qa,yre=new ie,Are=new Ji,$f=new lge,awe=new ie,sY=new bf,cY=new s1,G5=new Qa;let f9,Wce,rje,cx;function lwe(t,e,n){return G5.set(0,0,-e,1).applyMatrix4(t.projectionMatrix),G5.multiplyScalar(1/G5.w),G5.x=cx/n.width,G5.y=cx/n.height,G5.applyMatrix4(t.projectionMatrixInverse),G5.multiplyScalar(1/G5.w),Math.abs(Math.max(G5.x,G5.y))}function sAt(t,e){for(let n=0,o=Wce.count;nu&&Zd.z>u)continue;if(Qd.z>u){const C=Qd.z-Zd.z,P=(Qd.z-u)/C;Qd.lerp(Zd,P)}else if(Zd.z>u){const C=Zd.z-Qd.z,P=(Zd.z-u)/C;Zd.lerp(Qd,P)}Qd.applyMatrix4(o),Zd.applyMatrix4(o),Qd.multiplyScalar(1/Qd.w),Zd.multiplyScalar(1/Zd.w),Qd.x*=i.x/2,Qd.y*=i.y/2,Zd.x*=i.x/2,Zd.y*=i.y/2,$f.start.copy(Qd),$f.start.z=0,$f.end.copy(Zd),$f.end.z=0;const g=$f.closestPointToPointParameter(yre,!0);$f.at(g,awe);const y=xNe.lerp(Qd.z,Zd.z,g),w=y>=-1&&y<=1,b=yre.distanceTo(awe){if(!e||!l.current)return;const c=l.current.rotation.clone();s.getWorldQuaternion(l.current.quaternion),n&&(l.current.rotation.x=c.x),o&&(l.current.rotation.y=c.y),r&&(l.current.rotation.z=c.z)}),m.createElement("group",U9({ref:fge([l,a])},i))}),jn=m.forwardRef(function({points:e,color:n="black",vertexColors:o,linewidth:r,lineWidth:i,segments:a,dashed:l,...s},c){const u=oi(g=>g.size),d=m.useMemo(()=>a?new ije:new uAt,[a]),[f]=m.useState(()=>new pge),p=m.useMemo(()=>{const g=a?new hge:new oje,y=e.map(w=>{const b=Array.isArray(w);return w instanceof ie?[w.x,w.y,w.z]:w instanceof Xt?[w.x,w.y,0]:b&&w.length===3?[w[0],w[1],w[2]]:b&&w.length===2?[w[0],w[1],0]:w});if(g.setPositions(y.flat()),o){const w=o.map(b=>b instanceof rr?b.toArray():b);g.setColors(w.flat())}return g},[e,a,o]);return m.useLayoutEffect(()=>{d.computeLineDistances()},[e,d]),m.useLayoutEffect(()=>{l?f.defines.USE_DASH="":delete f.defines.USE_DASH,f.needsUpdate=!0},[l,f]),m.useEffect(()=>()=>p.dispose(),[p]),m.createElement("primitive",U9({object:d,ref:c},s),m.createElement("primitive",{object:p,attach:"geometry"}),m.createElement("primitive",U9({object:f,attach:"material",color:n,vertexColors:!!o,resolution:[u.width,u.height],linewidth:r??i,dashed:l},s)))});function dAt(){var t=Object.create(null);function e(r,i){var a=r.id,l=r.name,s=r.dependencies;s===void 0&&(s=[]);var c=r.init;c===void 0&&(c=function(){});var u=r.getTransferables;if(u===void 0&&(u=null),!t[a])try{s=s.map(function(f){return f&&f.isWorkerModule&&(e(f,function(p){if(p instanceof Error)throw p}),f=t[f.id].value),f}),c=o("<"+l+">.init",c),u&&(u=o("<"+l+">.getTransferables",u));var d=null;typeof c=="function"?d=c.apply(void 0,s):console.error("worker module init function failed to rehydrate"),t[a]={id:a,value:d,getTransferables:u},i(d)}catch(f){f&&f.noLog||console.error(f),i(f)}}function n(r,i){var a,l=r.id,s=r.args;(!t[l]||typeof t[l].value!="function")&&i(new Error("Worker module "+l+": not found or its 'init' did not return a function"));try{var c=(a=t[l]).value.apply(a,s);c&&typeof c.then=="function"?c.then(u,function(d){return i(d instanceof Error?d:new Error(""+d))}):u(c)}catch(d){i(d)}function u(d){try{var f=t[l].getTransferables&&t[l].getTransferables(d);(!f||!Array.isArray(f)||!f.length)&&(f=void 0),i(d,f)}catch(p){console.error(p),i(p)}}}function o(r,i){var a=void 0;self.troikaDefine=function(s){return a=s};var l=URL.createObjectURL(new Blob(["/** "+r.replace(/\*/g,"")+` **/ + `,clipping:!0}),this.isLineMaterial=!0,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(n){this.uniforms.diffuse.value=n}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(n){n===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(n){this.uniforms.linewidth.value=n}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(n){!!n!="USE_DASH"in this.defines&&(this.needsUpdate=!0),n===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(n){this.uniforms.dashScale.value=n}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(n){this.uniforms.dashSize.value=n}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(n){this.uniforms.dashOffset.value=n}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(n){this.uniforms.gapSize.value=n}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(n){this.uniforms.opacity.value=n}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(n){this.uniforms.resolution.value.copy(n)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(n){!!n!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),n===!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 iwe=new ie,awe=new ie,Qd=new Qa,Zd=new Qa,V5=new Qa,yre=new ie,Are=new Ji,$f=new lge,lwe=new ie,cY=new bf,uY=new s1,G5=new Qa;let f9,Wce,ije,cx;function swe(t,e,n){return G5.set(0,0,-e,1).applyMatrix4(t.projectionMatrix),G5.multiplyScalar(1/G5.w),G5.x=cx/n.width,G5.y=cx/n.height,G5.applyMatrix4(t.projectionMatrixInverse),G5.multiplyScalar(1/G5.w),Math.abs(Math.max(G5.x,G5.y))}function sAt(t,e){for(let n=0,o=Wce.count;nu&&Zd.z>u)continue;if(Qd.z>u){const C=Qd.z-Zd.z,P=(Qd.z-u)/C;Qd.lerp(Zd,P)}else if(Zd.z>u){const C=Zd.z-Qd.z,P=(Zd.z-u)/C;Zd.lerp(Qd,P)}Qd.applyMatrix4(o),Zd.applyMatrix4(o),Qd.multiplyScalar(1/Qd.w),Zd.multiplyScalar(1/Zd.w),Qd.x*=i.x/2,Qd.y*=i.y/2,Zd.x*=i.x/2,Zd.y*=i.y/2,$f.start.copy(Qd),$f.start.z=0,$f.end.copy(Zd),$f.end.z=0;const g=$f.closestPointToPointParameter(yre,!0);$f.at(g,lwe);const y=bNe.lerp(Qd.z,Zd.z,g),w=y>=-1&&y<=1,b=yre.distanceTo(lwe){if(!e||!l.current)return;const c=l.current.rotation.clone();s.getWorldQuaternion(l.current.quaternion),n&&(l.current.rotation.x=c.x),o&&(l.current.rotation.y=c.y),r&&(l.current.rotation.z=c.z)}),m.createElement("group",U9({ref:fge([l,a])},i))}),jn=m.forwardRef(function({points:e,color:n="black",vertexColors:o,linewidth:r,lineWidth:i,segments:a,dashed:l,...s},c){const u=oi(g=>g.size),d=m.useMemo(()=>a?new aje:new uAt,[a]),[f]=m.useState(()=>new pge),p=m.useMemo(()=>{const g=a?new hge:new rje,y=e.map(w=>{const b=Array.isArray(w);return w instanceof ie?[w.x,w.y,w.z]:w instanceof Xt?[w.x,w.y,0]:b&&w.length===3?[w[0],w[1],w[2]]:b&&w.length===2?[w[0],w[1],0]:w});if(g.setPositions(y.flat()),o){const w=o.map(b=>b instanceof rr?b.toArray():b);g.setColors(w.flat())}return g},[e,a,o]);return m.useLayoutEffect(()=>{d.computeLineDistances()},[e,d]),m.useLayoutEffect(()=>{l?f.defines.USE_DASH="":delete f.defines.USE_DASH,f.needsUpdate=!0},[l,f]),m.useEffect(()=>()=>p.dispose(),[p]),m.createElement("primitive",U9({object:d,ref:c},s),m.createElement("primitive",{object:p,attach:"geometry"}),m.createElement("primitive",U9({object:f,attach:"material",color:n,vertexColors:!!o,resolution:[u.width,u.height],linewidth:r??i,dashed:l},s)))});function dAt(){var t=Object.create(null);function e(r,i){var a=r.id,l=r.name,s=r.dependencies;s===void 0&&(s=[]);var c=r.init;c===void 0&&(c=function(){});var u=r.getTransferables;if(u===void 0&&(u=null),!t[a])try{s=s.map(function(f){return f&&f.isWorkerModule&&(e(f,function(p){if(p instanceof Error)throw p}),f=t[f.id].value),f}),c=o("<"+l+">.init",c),u&&(u=o("<"+l+">.getTransferables",u));var d=null;typeof c=="function"?d=c.apply(void 0,s):console.error("worker module init function failed to rehydrate"),t[a]={id:a,value:d,getTransferables:u},i(d)}catch(f){f&&f.noLog||console.error(f),i(f)}}function n(r,i){var a,l=r.id,s=r.args;(!t[l]||typeof t[l].value!="function")&&i(new Error("Worker module "+l+": not found or its 'init' did not return a function"));try{var c=(a=t[l]).value.apply(a,s);c&&typeof c.then=="function"?c.then(u,function(d){return i(d instanceof Error?d:new Error(""+d))}):u(c)}catch(d){i(d)}function u(d){try{var f=t[l].getTransferables&&t[l].getTransferables(d);(!f||!Array.isArray(f)||!f.length)&&(f=void 0),i(d,f)}catch(p){console.error(p),i(p)}}}function o(r,i){var a=void 0;self.troikaDefine=function(s){return a=s};var l=URL.createObjectURL(new Blob(["/** "+r.replace(/\*/g,"")+` **/ troikaDefine( `+i+` -)`],{type:"application/javascript"}));try{importScripts(l)}catch(s){console.error(s)}return URL.revokeObjectURL(l),delete self.troikaDefine,a}self.addEventListener("message",function(r){var i=r.data,a=i.messageId,l=i.action,s=i.data;try{l==="registerModule"&&e(s,function(c){c instanceof Error?postMessage({messageId:a,success:!1,error:c.message}):postMessage({messageId:a,success:!0,result:{isCallable:typeof c=="function"}})}),l==="callModule"&&n(s,function(c,u){c instanceof Error?postMessage({messageId:a,success:!1,error:c.message}):postMessage({messageId:a,success:!0,result:c},u||void 0)})}catch(c){postMessage({messageId:a,success:!1,error:c.stack})}})}function fAt(t){var e=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];return e._getInitResult().then(function(r){if(typeof r=="function")return r.apply(void 0,n);throw new Error("Worker module function was called but `init` did not return a callable function")})};return e._getInitResult=function(){var n=t.dependencies,o=t.init;n=Array.isArray(n)?n.map(function(i){return i&&i._getInitResult?i._getInitResult():i}):[];var r=Promise.all(n).then(function(i){return o.apply(null,i)});return e._getInitResult=function(){return r},r},e}var aje=function(){var t=!1;if(typeof window<"u"&&typeof window.document<"u")try{var e=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));e.terminate(),t=!0}catch(n){typeof process<"u",console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+n.message+"]")}return aje=function(){return t},t},hAt=0,pAt=0,wre=!1,gE=Object.create(null),mE=Object.create(null),Nce=Object.create(null);function sW(t){if((!t||typeof t.init!="function")&&!wre)throw new Error("requires `options.init` function");var e=t.dependencies,n=t.init,o=t.getTransferables,r=t.workerId;if(!aje())return fAt(t);r==null&&(r="#default");var i="workerModule"+ ++hAt,a=t.name||i,l=null;e=e&&e.map(function(c){return typeof c=="function"&&!c.workerModuleData&&(wre=!0,c=sW({workerId:r,name:"<"+a+"> function dependency: "+c.name,init:`function(){return ( -`+E_(c)+` -)}`}),wre=!1),c&&c.workerModuleData&&(c=c.workerModuleData),c});function s(){for(var c=[],u=arguments.length;u--;)c[u]=arguments[u];if(!l){l=swe(r,"registerModule",s.workerModuleData);var d=function(){l=null,mE[r].delete(d)};(mE[r]||(mE[r]=new Set)).add(d)}return l.then(function(f){var p=f.isCallable;if(p)return swe(r,"callModule",{id:i,args:c});throw new Error("Worker module function was called but `init` did not return a callable function")})}return s.workerModuleData={isWorkerModule:!0,id:i,name:a,dependencies:e,init:E_(n),getTransferables:o&&E_(o)},s}function gAt(t){mE[t]&&mE[t].forEach(function(e){e()}),gE[t]&&(gE[t].terminate(),delete gE[t])}function E_(t){var e=t.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}function mAt(t){var e=gE[t];if(!e){var n=E_(dAt);e=gE[t]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+t.replace(/\*/g,"")+` **/ +)`],{type:"application/javascript"}));try{importScripts(l)}catch(s){console.error(s)}return URL.revokeObjectURL(l),delete self.troikaDefine,a}self.addEventListener("message",function(r){var i=r.data,a=i.messageId,l=i.action,s=i.data;try{l==="registerModule"&&e(s,function(c){c instanceof Error?postMessage({messageId:a,success:!1,error:c.message}):postMessage({messageId:a,success:!0,result:{isCallable:typeof c=="function"}})}),l==="callModule"&&n(s,function(c,u){c instanceof Error?postMessage({messageId:a,success:!1,error:c.message}):postMessage({messageId:a,success:!0,result:c},u||void 0)})}catch(c){postMessage({messageId:a,success:!1,error:c.stack})}})}function fAt(t){var e=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];return e._getInitResult().then(function(r){if(typeof r=="function")return r.apply(void 0,n);throw new Error("Worker module function was called but `init` did not return a callable function")})};return e._getInitResult=function(){var n=t.dependencies,o=t.init;n=Array.isArray(n)?n.map(function(i){return i&&i._getInitResult?i._getInitResult():i}):[];var r=Promise.all(n).then(function(i){return o.apply(null,i)});return e._getInitResult=function(){return r},r},e}var lje=function(){var t=!1;if(typeof window<"u"&&typeof window.document<"u")try{var e=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));e.terminate(),t=!0}catch(n){typeof process<"u",console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+n.message+"]")}return lje=function(){return t},t},hAt=0,pAt=0,wre=!1,gE=Object.create(null),mE=Object.create(null),Nce=Object.create(null);function sW(t){if((!t||typeof t.init!="function")&&!wre)throw new Error("requires `options.init` function");var e=t.dependencies,n=t.init,o=t.getTransferables,r=t.workerId;if(!lje())return fAt(t);r==null&&(r="#default");var i="workerModule"+ ++hAt,a=t.name||i,l=null;e=e&&e.map(function(c){return typeof c=="function"&&!c.workerModuleData&&(wre=!0,c=sW({workerId:r,name:"<"+a+"> function dependency: "+c.name,init:`function(){return ( +`+F_(c)+` +)}`}),wre=!1),c&&c.workerModuleData&&(c=c.workerModuleData),c});function s(){for(var c=[],u=arguments.length;u--;)c[u]=arguments[u];if(!l){l=cwe(r,"registerModule",s.workerModuleData);var d=function(){l=null,mE[r].delete(d)};(mE[r]||(mE[r]=new Set)).add(d)}return l.then(function(f){var p=f.isCallable;if(p)return cwe(r,"callModule",{id:i,args:c});throw new Error("Worker module function was called but `init` did not return a callable function")})}return s.workerModuleData={isWorkerModule:!0,id:i,name:a,dependencies:e,init:F_(n),getTransferables:o&&F_(o)},s}function gAt(t){mE[t]&&mE[t].forEach(function(e){e()}),gE[t]&&(gE[t].terminate(),delete gE[t])}function F_(t){var e=t.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}function mAt(t){var e=gE[t];if(!e){var n=F_(dAt);e=gE[t]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+t.replace(/\*/g,"")+` **/ -;(`+n+")()"],{type:"application/javascript"}))),e.onmessage=function(o){var r=o.data,i=r.messageId,a=Nce[i];if(!a)throw new Error("WorkerModule response with empty or unknown messageId");delete Nce[i],a(r)}}return e}function swe(t,e,n){return new Promise(function(o,r){var i=++pAt;Nce[i]=function(a){a.success?o(a.result):r(new Error("Error in worker "+e+" call: "+a.error))},mAt(t).postMessage({messageId:i,action:e,data:n})})}function lje(){var t=function(e){function n(U,O,B,_,X,$,Q,le){var q=1-Q;le.x=q*q*U+2*q*Q*B+Q*Q*X,le.y=q*q*O+2*q*Q*_+Q*Q*$}function o(U,O,B,_,X,$,Q,le,q,te){var re=1-q;te.x=re*re*re*U+3*re*re*q*B+3*re*q*q*X+q*q*q*Q,te.y=re*re*re*O+3*re*re*q*_+3*re*q*q*$+q*q*q*le}function r(U,O){for(var B=/([MLQCZ])([^MLQCZ]*)/g,_,X,$,Q,le;_=B.exec(U);){var q=_[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(te){return parseFloat(te)});switch(_[1]){case"M":Q=X=q[0],le=$=q[1];break;case"L":(q[0]!==Q||q[1]!==le)&&O("L",Q,le,Q=q[0],le=q[1]);break;case"Q":{O("Q",Q,le,Q=q[2],le=q[3],q[0],q[1]);break}case"C":{O("C",Q,le,Q=q[4],le=q[5],q[0],q[1],q[2],q[3]);break}case"Z":(Q!==X||le!==$)&&O("L",Q,le,X,$);break}}}function i(U,O,B){B===void 0&&(B=16);var _={x:0,y:0};r(U,function(X,$,Q,le,q,te,re,ae,se){switch(X){case"L":O($,Q,le,q);break;case"Q":{for(var ne=$,fe=Q,ge=1;ge0;)Je[We]=arguments[We+2];var Ke=ve[Be]||(ve[Be]=B.getUniformLocation(Ae,Be));B["uniform"+Ee].apply(B,[Ke].concat(Je))},setAttribute:function(Ee,Be,Je,We,Ke){var Ne=pe[Ee];Ne||(Ne=pe[Ee]={buf:B.createBuffer(),loc:B.getAttribLocation(Ae,Ee),data:null}),B.bindBuffer(B.ARRAY_BUFFER,Ne.buf),B.vertexAttribPointer(Ne.loc,Be,B.FLOAT,!1,0,0),B.enableVertexAttribArray(Ne.loc),X?B.vertexAttribDivisor(Ne.loc,We):de("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(Ne.loc,We),Ke!==Ne.data&&(B.bufferData(B.ARRAY_BUFFER,Ke,Je),Ne.data=Ke)}})}}}Q[ze].transaction(ce)},xe=function(ze,Ie){q++;try{B.activeTexture(B.TEXTURE0+q);var ye=le[ze];ye||(ye=le[ze]=B.createTexture(),B.bindTexture(B.TEXTURE_2D,ye),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MIN_FILTER,B.NEAREST),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MAG_FILTER,B.NEAREST)),B.bindTexture(B.TEXTURE_2D,ye),Ie(ye,q)}finally{q--}},He=function(ze,Ie,ye){var ce=B.createFramebuffer();te.push(ce),B.bindFramebuffer(B.FRAMEBUFFER,ce),B.activeTexture(B.TEXTURE0+Ie),B.bindTexture(B.TEXTURE_2D,ze),B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_2D,ze,0);try{ye(ce)}finally{B.deleteFramebuffer(ce),B.bindFramebuffer(B.FRAMEBUFFER,te[--te.length-1]||null)}},Se=function(){$={},Q={},le={},q=-1,te.length=0};var re=de,ae=Z,se=he,ne=xe,fe=He,ge=Se,X=typeof WebGL2RenderingContext<"u"&&B instanceof WebGL2RenderingContext,$={},Q={},le={},q=-1,te=[];B.canvas.addEventListener("webglcontextlost",function(ze){Se(),ze.preventDefault()},!1),s.set(B,_={gl:B,isWebGL2:X,getExtension:de,withProgram:he,withTexture:xe,withTextureFramebuffer:He,handleContextLoss:Se})}O(_)}function d(U,O,B,_,X,$,Q,le){Q===void 0&&(Q=15),le===void 0&&(le=null),u(U,function(q){var te=q.gl,re=q.withProgram,ae=q.withTexture;ae("copy",function(se,ne){te.texImage2D(te.TEXTURE_2D,0,te.RGBA,X,$,0,te.RGBA,te.UNSIGNED_BYTE,O),re("copy",a,l,function(fe){var ge=fe.setUniform,de=fe.setAttribute;de("aUV",2,te.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),ge("1i","image",ne),te.bindFramebuffer(te.FRAMEBUFFER,le||null),te.disable(te.BLEND),te.colorMask(Q&8,Q&4,Q&2,Q&1),te.viewport(B,_,X,$),te.scissor(B,_,X,$),te.drawArrays(te.TRIANGLES,0,3)})})})}function f(U,O,B){var _=U.width,X=U.height;u(U,function($){var Q=$.gl,le=new Uint8Array(_*X*4);Q.readPixels(0,0,_,X,Q.RGBA,Q.UNSIGNED_BYTE,le),U.width=O,U.height=B,d(Q,le,0,0,_,X)})}var p=Object.freeze({__proto__:null,withWebGLContext:u,renderImageData:d,resizeWebGLCanvasWithoutClearing:f});function g(U,O,B,_,X,$){$===void 0&&($=1);var Q=new Uint8Array(U*O),le=_[2]-_[0],q=_[3]-_[1],te=[];i(B,function(de,Z,he,xe){te.push({x1:de,y1:Z,x2:he,y2:xe,minX:Math.min(de,he),minY:Math.min(Z,xe),maxX:Math.max(de,he),maxY:Math.max(Z,xe)})}),te.sort(function(de,Z){return de.maxX-Z.maxX});for(var re=0;reSe.minX&&Z-xeSe.minY){var ze=b(de,Z,Se.x1,Se.y1,Se.x2,Se.y2);zeZ!=He.y2>Z&&de<(He.x2-He.x1)*(Z-He.y1)/(He.y2-He.y1)+He.x1;Se&&(he+=He.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 y(xe,He){var Se=36,ze=0,Ie=new Map,ye=He&&new Map,ce;return xe.split(",").forEach(function pe(ve){if(ve.indexOf("+")!==-1)for(var Ae=+ve;Ae--;)pe(ce);else{ce=ve;var Te=ve.split(">"),Me=Te[0],Pe=Te[1];Me=String.fromCodePoint(ze+=parseInt(Me,Se)),Pe=String.fromCodePoint(ze+=parseInt(Pe,Se)),Ie.set(Me,Pe),He&&ye.set(Pe,Me)}}),{map:Ie,reverseMap:ye}}var w,b,C;function P(){if(!w){var xe=y(g.pairs,!0),He=xe.map,Se=xe.reverseMap;w=He,b=Se,C=y(g.canonical,!1).map}}function v(xe){return P(),w.get(xe)||null}function T(xe){return P(),b.get(xe)||null}function A(xe){return P(),C.get(xe)||null}var x=o.L,S=o.R,R=o.EN,M=o.ES,D=o.ET,E=o.AN,W=o.CS,j=o.B,L=o.S,k=o.ON,N=o.BN,F=o.NSM,U=o.AL,O=o.LRO,B=o.RLO,_=o.LRE,X=o.RLE,$=o.PDF,Q=o.LRI,le=o.RLI,q=o.FSI,te=o.PDI;function re(xe,He){for(var Se=125,ze=new Uint32Array(xe.length),Ie=0;Ie0)Ne--;else if(ke>0){for(De=0;!We[We.length-1]._isolate;)We.pop();var Xe=We[We.length-1]._isolInitIndex;Xe!=null&&(ve.set(Xe,Ye),ve.set(Ye,Xe)),We.pop(),ke--}Ke=We[We.length-1],pe[Ye]=Ke._level,Ke._override&&ce(Ye,Ke._override)}else it&$?(Ne===0&&(De>0?De--:!Ke._isolate&&We.length>1&&(We.pop(),Ke=We[We.length-1])),pe[Ye]=Ke._level):it&j&&(pe[Ye]=Te.level);else pe[Ye]=Ke._level,Ke._override&&it!==N&&ce(Ye,Ke._override)}for(var ut=[],ft=null,ot=Te.start;ot<=Te.end;ot++){var st=ze[ot];if(!(st&s)){var at=pe[ot],Oe=st&i,Ze=st===te;ft&&at===ft._level?(ft._end=ot,ft._endsWithIsolInit=Oe):ut.push(ft={_start:ot,_end:ot,_level:at,_startsWithPDI:Ze,_endsWithIsolInit:Oe})}}for(var St=[],Pt=0;Pt=0;qe--)if(!(ze[qe]&s)){Fe=pe[qe];break}var je=kt[kt.length-1],rt=pe[je],mt=Te.level;if(!(ze[je]&i)){for(var Qe=je+1;Qe<=Te.end;Qe++)if(!(ze[Qe]&s)){mt=pe[Qe];break}}St.push({_seqIndices:kt,_sosType:Math.max(Fe,tt)%2?S:x,_eosType:Math.max(mt,rt)%2?S:x})}}for(var Tt=0;Tt=0;an--)if(!(ze[lt[an]]&s)){gn=ze[lt[an]];break}ce(Qt,gn&(i|te)?k:gn)}}if(ye.get(R))for(var mn=0;mn=-1;Fo--){var yo=Fo===-1?zt:ze[lt[Fo]];if(yo&a){yo===U&&ce(Hn,E);break}}}if(ye.get(U))for(var So=0;So=0&&(uo=ze[lt[Rr]],!!(uo&s));Rr--);for(var br=mo+1;br=0&&ze[lt[wn]]&(D|s);wn--)ce(lt[wn],R);for(Vr++;Vr=0&&ze[lt[No]]&s;No--)ce(lt[No],k);for(var eo=In+1;eo=0;Eo--){var bi=ai[Eo].char;if(bi===xi||bi===T(A(tr))||v(A(bi))===tr){fr.push([ai[Eo].seqIndex,hr]),ai.length=Eo;break}}}fr.sort(function(yn,An){return yn[0]-An[0]})}for(var hl=0;hl=0;Ui--){var da=lt[Ui];if(ze[da]&lr){var Bl=ze[da]&jo?S:x;Bl!==_t?wi=Bl:wi=_t;break}}}if(wi){if(ze[lt[or]]=ze[lt[Ai]]=wi,wi!==_t){for(var Gl=or+1;Gl=0;Bt--)if(ze[lt[Bt]]&s)mu=Bt;else{$t=ze[lt[Bt]]&jo?S:x;break}for(var pn=Ft,Pn=Rc+1;Pn=0&&f(xe[jt])&c;jt--)pe[jt]=Te.level}}return{levels:pe,paragraphs:Ae};function Kt(yn,An){for(var bn=yn;bn=pe&&f(xe[Te])&c;Te--)Ae[Te]=ce.level;for(var Me=ce.level,Pe=1/0,Ee=0;EeMe&&(Me=Be),Be=Pe;Je--)for(var We=0;We=Je){for(var Ke=We;We+1=Je;)We++;We>Ke&&ye.push([Ke+pe,We+pe])}}}),ye}function Z(xe,He,Se,ze){var Ie=he(xe,He,Se,ze),ye=[].concat(xe);return Ie.forEach(function(ce,pe){ye[pe]=(He.levels[ce]&1?fe(xe[ce]):null)||xe[ce]}),ye.join("")}function he(xe,He,Se,ze){for(var Ie=de(xe,He,Se,ze),ye=[],ce=0;ce/gm;function n(o,r){let i=fa[r];return i?Uce(i):o}return t.replace(e,n)}const nf=[];for(let t=0;t<256;t++)nf[t]=(t<16?"0":"")+t.toString(16);function AAt(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,o=Math.random()*4294967295|0;return(nf[t&255]+nf[t>>8&255]+nf[t>>16&255]+nf[t>>24&255]+"-"+nf[e&255]+nf[e>>8&255]+"-"+nf[e>>16&15|64]+nf[e>>24&255]+"-"+nf[n&63|128]+nf[n>>8&255]+"-"+nf[n>>16&255]+nf[n>>24&255]+nf[o&255]+nf[o>>8&255]+nf[o>>16&255]+nf[o>>24&255]).toUpperCase()}const _7=Object.assign||function(){let t=arguments[0];for(let e=1,n=arguments.length;e/gm,` +;(`+n+")()"],{type:"application/javascript"}))),e.onmessage=function(o){var r=o.data,i=r.messageId,a=Nce[i];if(!a)throw new Error("WorkerModule response with empty or unknown messageId");delete Nce[i],a(r)}}return e}function cwe(t,e,n){return new Promise(function(o,r){var i=++pAt;Nce[i]=function(a){a.success?o(a.result):r(new Error("Error in worker "+e+" call: "+a.error))},mAt(t).postMessage({messageId:i,action:e,data:n})})}function sje(){var t=function(e){function n(U,O,B,_,X,$,Q,le){var q=1-Q;le.x=q*q*U+2*q*Q*B+Q*Q*X,le.y=q*q*O+2*q*Q*_+Q*Q*$}function o(U,O,B,_,X,$,Q,le,q,te){var re=1-q;te.x=re*re*re*U+3*re*re*q*B+3*re*q*q*X+q*q*q*Q,te.y=re*re*re*O+3*re*re*q*_+3*re*q*q*$+q*q*q*le}function r(U,O){for(var B=/([MLQCZ])([^MLQCZ]*)/g,_,X,$,Q,le;_=B.exec(U);){var q=_[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(te){return parseFloat(te)});switch(_[1]){case"M":Q=X=q[0],le=$=q[1];break;case"L":(q[0]!==Q||q[1]!==le)&&O("L",Q,le,Q=q[0],le=q[1]);break;case"Q":{O("Q",Q,le,Q=q[2],le=q[3],q[0],q[1]);break}case"C":{O("C",Q,le,Q=q[4],le=q[5],q[0],q[1],q[2],q[3]);break}case"Z":(Q!==X||le!==$)&&O("L",Q,le,X,$);break}}}function i(U,O,B){B===void 0&&(B=16);var _={x:0,y:0};r(U,function(X,$,Q,le,q,te,re,ae,se){switch(X){case"L":O($,Q,le,q);break;case"Q":{for(var ne=$,fe=Q,ge=1;ge0;)Je[We]=arguments[We+2];var Ke=ve[Be]||(ve[Be]=B.getUniformLocation(Ae,Be));B["uniform"+Ee].apply(B,[Ke].concat(Je))},setAttribute:function(Ee,Be,Je,We,Ke){var Ne=pe[Ee];Ne||(Ne=pe[Ee]={buf:B.createBuffer(),loc:B.getAttribLocation(Ae,Ee),data:null}),B.bindBuffer(B.ARRAY_BUFFER,Ne.buf),B.vertexAttribPointer(Ne.loc,Be,B.FLOAT,!1,0,0),B.enableVertexAttribArray(Ne.loc),X?B.vertexAttribDivisor(Ne.loc,We):de("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(Ne.loc,We),Ke!==Ne.data&&(B.bufferData(B.ARRAY_BUFFER,Ke,Je),Ne.data=Ke)}})}}}Q[ze].transaction(ce)},xe=function(ze,Ie){q++;try{B.activeTexture(B.TEXTURE0+q);var ye=le[ze];ye||(ye=le[ze]=B.createTexture(),B.bindTexture(B.TEXTURE_2D,ye),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MIN_FILTER,B.NEAREST),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MAG_FILTER,B.NEAREST)),B.bindTexture(B.TEXTURE_2D,ye),Ie(ye,q)}finally{q--}},He=function(ze,Ie,ye){var ce=B.createFramebuffer();te.push(ce),B.bindFramebuffer(B.FRAMEBUFFER,ce),B.activeTexture(B.TEXTURE0+Ie),B.bindTexture(B.TEXTURE_2D,ze),B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_2D,ze,0);try{ye(ce)}finally{B.deleteFramebuffer(ce),B.bindFramebuffer(B.FRAMEBUFFER,te[--te.length-1]||null)}},Se=function(){$={},Q={},le={},q=-1,te.length=0};var re=de,ae=Z,se=he,ne=xe,fe=He,ge=Se,X=typeof WebGL2RenderingContext<"u"&&B instanceof WebGL2RenderingContext,$={},Q={},le={},q=-1,te=[];B.canvas.addEventListener("webglcontextlost",function(ze){Se(),ze.preventDefault()},!1),s.set(B,_={gl:B,isWebGL2:X,getExtension:de,withProgram:he,withTexture:xe,withTextureFramebuffer:He,handleContextLoss:Se})}O(_)}function d(U,O,B,_,X,$,Q,le){Q===void 0&&(Q=15),le===void 0&&(le=null),u(U,function(q){var te=q.gl,re=q.withProgram,ae=q.withTexture;ae("copy",function(se,ne){te.texImage2D(te.TEXTURE_2D,0,te.RGBA,X,$,0,te.RGBA,te.UNSIGNED_BYTE,O),re("copy",a,l,function(fe){var ge=fe.setUniform,de=fe.setAttribute;de("aUV",2,te.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),ge("1i","image",ne),te.bindFramebuffer(te.FRAMEBUFFER,le||null),te.disable(te.BLEND),te.colorMask(Q&8,Q&4,Q&2,Q&1),te.viewport(B,_,X,$),te.scissor(B,_,X,$),te.drawArrays(te.TRIANGLES,0,3)})})})}function f(U,O,B){var _=U.width,X=U.height;u(U,function($){var Q=$.gl,le=new Uint8Array(_*X*4);Q.readPixels(0,0,_,X,Q.RGBA,Q.UNSIGNED_BYTE,le),U.width=O,U.height=B,d(Q,le,0,0,_,X)})}var p=Object.freeze({__proto__:null,withWebGLContext:u,renderImageData:d,resizeWebGLCanvasWithoutClearing:f});function g(U,O,B,_,X,$){$===void 0&&($=1);var Q=new Uint8Array(U*O),le=_[2]-_[0],q=_[3]-_[1],te=[];i(B,function(de,Z,he,xe){te.push({x1:de,y1:Z,x2:he,y2:xe,minX:Math.min(de,he),minY:Math.min(Z,xe),maxX:Math.max(de,he),maxY:Math.max(Z,xe)})}),te.sort(function(de,Z){return de.maxX-Z.maxX});for(var re=0;reSe.minX&&Z-xeSe.minY){var ze=b(de,Z,Se.x1,Se.y1,Se.x2,Se.y2);zeZ!=He.y2>Z&&de<(He.x2-He.x1)*(Z-He.y1)/(He.y2-He.y1)+He.x1;Se&&(he+=He.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 y(xe,He){var Se=36,ze=0,Ie=new Map,ye=He&&new Map,ce;return xe.split(",").forEach(function pe(ve){if(ve.indexOf("+")!==-1)for(var Ae=+ve;Ae--;)pe(ce);else{ce=ve;var Te=ve.split(">"),Me=Te[0],Pe=Te[1];Me=String.fromCodePoint(ze+=parseInt(Me,Se)),Pe=String.fromCodePoint(ze+=parseInt(Pe,Se)),Ie.set(Me,Pe),He&&ye.set(Pe,Me)}}),{map:Ie,reverseMap:ye}}var w,b,C;function P(){if(!w){var xe=y(g.pairs,!0),He=xe.map,Se=xe.reverseMap;w=He,b=Se,C=y(g.canonical,!1).map}}function v(xe){return P(),w.get(xe)||null}function T(xe){return P(),b.get(xe)||null}function A(xe){return P(),C.get(xe)||null}var x=o.L,S=o.R,R=o.EN,M=o.ES,D=o.ET,E=o.AN,W=o.CS,j=o.B,L=o.S,k=o.ON,N=o.BN,F=o.NSM,U=o.AL,O=o.LRO,B=o.RLO,_=o.LRE,X=o.RLE,$=o.PDF,Q=o.LRI,le=o.RLI,q=o.FSI,te=o.PDI;function re(xe,He){for(var Se=125,ze=new Uint32Array(xe.length),Ie=0;Ie0)Ne--;else if(ke>0){for(De=0;!We[We.length-1]._isolate;)We.pop();var Xe=We[We.length-1]._isolInitIndex;Xe!=null&&(ve.set(Xe,Ye),ve.set(Ye,Xe)),We.pop(),ke--}Ke=We[We.length-1],pe[Ye]=Ke._level,Ke._override&&ce(Ye,Ke._override)}else it&$?(Ne===0&&(De>0?De--:!Ke._isolate&&We.length>1&&(We.pop(),Ke=We[We.length-1])),pe[Ye]=Ke._level):it&j&&(pe[Ye]=Te.level);else pe[Ye]=Ke._level,Ke._override&&it!==N&&ce(Ye,Ke._override)}for(var ut=[],ft=null,ot=Te.start;ot<=Te.end;ot++){var st=ze[ot];if(!(st&s)){var at=pe[ot],Oe=st&i,Ze=st===te;ft&&at===ft._level?(ft._end=ot,ft._endsWithIsolInit=Oe):ut.push(ft={_start:ot,_end:ot,_level:at,_startsWithPDI:Ze,_endsWithIsolInit:Oe})}}for(var St=[],Pt=0;Pt=0;qe--)if(!(ze[qe]&s)){Fe=pe[qe];break}var je=kt[kt.length-1],rt=pe[je],mt=Te.level;if(!(ze[je]&i)){for(var Qe=je+1;Qe<=Te.end;Qe++)if(!(ze[Qe]&s)){mt=pe[Qe];break}}St.push({_seqIndices:kt,_sosType:Math.max(Fe,tt)%2?S:x,_eosType:Math.max(mt,rt)%2?S:x})}}for(var Tt=0;Tt=0;an--)if(!(ze[lt[an]]&s)){gn=ze[lt[an]];break}ce(Qt,gn&(i|te)?k:gn)}}if(ye.get(R))for(var mn=0;mn=-1;Fo--){var yo=Fo===-1?zt:ze[lt[Fo]];if(yo&a){yo===U&&ce(Hn,E);break}}}if(ye.get(U))for(var So=0;So=0&&(uo=ze[lt[Rr]],!!(uo&s));Rr--);for(var br=mo+1;br=0&&ze[lt[wn]]&(D|s);wn--)ce(lt[wn],R);for(Vr++;Vr=0&&ze[lt[No]]&s;No--)ce(lt[No],k);for(var eo=In+1;eo=0;Eo--){var bi=ai[Eo].char;if(bi===xi||bi===T(A(tr))||v(A(bi))===tr){fr.push([ai[Eo].seqIndex,hr]),ai.length=Eo;break}}}fr.sort(function(yn,An){return yn[0]-An[0]})}for(var hl=0;hl=0;Ui--){var fa=lt[Ui];if(ze[fa]&lr){var Bl=ze[fa]&jo?S:x;Bl!==_t?wi=Bl:wi=_t;break}}}if(wi){if(ze[lt[or]]=ze[lt[Ai]]=wi,wi!==_t){for(var Gl=or+1;Gl=0;Bt--)if(ze[lt[Bt]]&s)mu=Bt;else{$t=ze[lt[Bt]]&jo?S:x;break}for(var pn=Ft,Pn=Rc+1;Pn=0&&f(xe[jt])&c;jt--)pe[jt]=Te.level}}return{levels:pe,paragraphs:Ae};function Kt(yn,An){for(var bn=yn;bn=pe&&f(xe[Te])&c;Te--)Ae[Te]=ce.level;for(var Me=ce.level,Pe=1/0,Ee=0;EeMe&&(Me=Be),Be=Pe;Je--)for(var We=0;We=Je){for(var Ke=We;We+1=Je;)We++;We>Ke&&ye.push([Ke+pe,We+pe])}}}),ye}function Z(xe,He,Se,ze){var Ie=he(xe,He,Se,ze),ye=[].concat(xe);return Ie.forEach(function(ce,pe){ye[pe]=(He.levels[ce]&1?fe(xe[ce]):null)||xe[ce]}),ye.join("")}function he(xe,He,Se,ze){for(var Ie=de(xe,He,Se,ze),ye=[],ce=0;ce/gm;function n(o,r){let i=ha[r];return i?Uce(i):o}return t.replace(e,n)}const nf=[];for(let t=0;t<256;t++)nf[t]=(t<16?"0":"")+t.toString(16);function AAt(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,o=Math.random()*4294967295|0;return(nf[t&255]+nf[t>>8&255]+nf[t>>16&255]+nf[t>>24&255]+"-"+nf[e&255]+nf[e>>8&255]+"-"+nf[e>>16&15|64]+nf[e>>24&255]+"-"+nf[n&63|128]+nf[n>>8&255]+"-"+nf[n>>16&255]+nf[n>>24&255]+nf[o&255]+nf[o>>8&255]+nf[o>>16&255]+nf[o>>24&255]).toUpperCase()}const _7=Object.assign||function(){let t=arguments[0];for(let e=1,n=arguments.length;e/gm,` //!BEGIN_POST_CHUNK $1 $& //!END_POST_CHUNK @@ -4125,17 +4125,17 @@ troika_normal_${r} = vec3(normal); troika_uv_${r} = vec2(uv); troikaVertexTransform${r}(troika_position_${r}, troika_normal_${r}, troika_uv_${r}); ${a} -`,e=e.replace(/\b(position|normal|uv)\b/g,(y,w,b,C)=>/\battribute\s+vec[23]\s+$/.test(C.substr(0,b))?w:`troika_${w}_${r}`),t.map&&t.map.channel>0||(e=e.replace(/\bMAP_UV\b/g,`troika_uv_${r}`))),e=dwe(e,r,i,a,l),n=dwe(n,r,c,u,d),{vertexShader:e,fragmentShader:n}}function dwe(t,e,n,o,r){return(o||r||n)&&(t=t.replace(sje,` +`,e=e.replace(/\b(position|normal|uv)\b/g,(y,w,b,C)=>/\battribute\s+vec[23]\s+$/.test(C.substr(0,b))?w:`troika_${w}_${r}`),t.map&&t.map.channel>0||(e=e.replace(/\bMAP_UV\b/g,`troika_uv_${r}`))),e=fwe(e,r,i,a,l),n=fwe(n,r,c,u,d),{vertexShader:e,fragmentShader:n}}function fwe(t,e,n,o,r){return(o||r||n)&&(t=t.replace(cje,` ${n} void troikaOrigMain${e}() {`),t+=` void main() { ${o} troikaOrigMain${e}(); ${r} -}`),t}function bAt(t,e){return t==="uniforms"?void 0:typeof e=="function"?e.toString():e}let SAt=0;const fwe=new Map;function TAt(t){const e=JSON.stringify(t,bAt);let n=fwe.get(e);return n==null&&fwe.set(e,n=++SAt),n}function PAt(t,e,n){const{defaultFontURL:o}=n,r=Object.create(null),i=1/0,a=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,l="[^\\S\\u00A0]",s=new RegExp(`${l}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function c(C,P){function v(){const T=A=>{console.error(`Failure loading font ${C}${C===o?"":"; trying fallback"}`,A),C!==o&&(C=o,v())};try{const A=new XMLHttpRequest;A.open("get",C,!0),A.responseType="arraybuffer",A.onload=function(){if(A.status>=400)T(new Error(A.statusText));else if(A.status>0)try{const x=t(A.response);P(x)}catch(x){T(x)}},A.onerror=T,A.send()}catch(A){T(A)}}v()}function u(C,P){C||(C=o);let v=r[C];v?v.pending?v.pending.push(P):P(v):(r[C]={pending:[P]},c(C,T=>{let A=r[C].pending;r[C]=T,A.forEach(x=>x(T))}))}function d({text:C="",font:P=o,sdfGlyphSize:v=64,fontSize:T=1,letterSpacing:A=0,lineHeight:x="normal",maxWidth:S=i,direction:R,textAlign:M="left",textIndent:D=0,whiteSpace:E="normal",overflowWrap:W="normal",anchorX:j=0,anchorY:L=0,includeCaretPositions:k=!1,chunkedBoundsSize:N=8192,colorRanges:F=null},U,O=!1){const B=y(),_={fontLoad:0,typesetting:0};C.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),C=C.replace(/\r\n/g,` +}`),t}function bAt(t,e){return t==="uniforms"?void 0:typeof e=="function"?e.toString():e}let SAt=0;const hwe=new Map;function TAt(t){const e=JSON.stringify(t,bAt);let n=hwe.get(e);return n==null&&hwe.set(e,n=++SAt),n}function PAt(t,e,n){const{defaultFontURL:o}=n,r=Object.create(null),i=1/0,a=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,l="[^\\S\\u00A0]",s=new RegExp(`${l}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function c(C,P){function v(){const T=A=>{console.error(`Failure loading font ${C}${C===o?"":"; trying fallback"}`,A),C!==o&&(C=o,v())};try{const A=new XMLHttpRequest;A.open("get",C,!0),A.responseType="arraybuffer",A.onload=function(){if(A.status>=400)T(new Error(A.statusText));else if(A.status>0)try{const x=t(A.response);P(x)}catch(x){T(x)}},A.onerror=T,A.send()}catch(A){T(A)}}v()}function u(C,P){C||(C=o);let v=r[C];v?v.pending?v.pending.push(P):P(v):(r[C]={pending:[P]},c(C,T=>{let A=r[C].pending;r[C]=T,A.forEach(x=>x(T))}))}function d({text:C="",font:P=o,sdfGlyphSize:v=64,fontSize:T=1,letterSpacing:A=0,lineHeight:x="normal",maxWidth:S=i,direction:R,textAlign:M="left",textIndent:D=0,whiteSpace:E="normal",overflowWrap:W="normal",anchorX:j=0,anchorY:L=0,includeCaretPositions:k=!1,chunkedBoundsSize:N=8192,colorRanges:F=null},U,O=!1){const B=y(),_={fontLoad:0,typesetting:0};C.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),C=C.replace(/\r\n/g,` `).replace(/\r/g,` `)),T=+T,A=+A,S=+S,x=x||"normal",D=+D,u(P,X=>{const $=isFinite(S);let Q=null,le=null,q=null,te=null,re=null,ae=null,se=null,ne=0,fe=0,ge=E!=="nowrap";const{ascender:de,descender:Z,unitsPerEm:he,lineGap:xe,capHeight:He,xHeight:Se}=X;_.fontLoad=y()-B;const ze=y(),Ie=T/he;x==="normal"&&(x=(de-Z+xe)/he),x=x*T;const ye=(x-(de-Z)*Ie)/2,ce=-(de*Ie+ye),pe=Math.min(x,(de-Z)*Ie),ve=(de+Z)/2*Ie-pe/2;let Ae=D,Te=new w;const Me=[Te];X.forEachGlyph(C,T,A,(Be,Je,We)=>{const Ke=C.charAt(We),Ne=Be.advanceWidth*Ie,De=Te.count;let ke;if("isEmpty"in Be||(Be.isWhitespace=!!Ke&&new RegExp(l).test(Ke),Be.canBreakAfter=!!Ke&&s.test(Ke),Be.isEmpty=Be.xMin===Be.xMax||Be.yMin===Be.yMax||a.test(Ke)),!Be.isWhitespace&&!Be.isEmpty&&fe++,ge&&$&&!Be.isWhitespace&&Je+Ne+Ae>S&&De){if(Te.glyphAt(De-1).glyphObj.canBreakAfter)ke=new w,Ae=-Je;else for(let it=De;it--;)if(it===0&&W==="break-word"){ke=new w,Ae=-Je;break}else if(Te.glyphAt(it).glyphObj.canBreakAfter){ke=Te.splitAt(it+1);const Ve=ke.glyphAt(0).x;Ae-=Ve;for(let yt=ke.count;yt--;)ke.glyphAt(yt).x-=Ve;break}ke&&(Te.isSoftWrapped=!0,Te=ke,Me.push(Te),ne=S)}let Ye=Te.glyphAt(Te.count);Ye.glyphObj=Be,Ye.x=Je+Ae,Ye.width=Ne,Ye.charIndex=We,Ke===` -`&&(Te=new w,Me.push(Te),Ae=-(Je+Ne+A*T)+D)}),Me.forEach(Be=>{for(let Je=Be.count;Je--;){let{glyphObj:We,x:Ke,width:Ne}=Be.glyphAt(Je);if(!We.isWhitespace){Be.width=Ke+Ne,Be.width>ne&&(ne=Be.width);return}}});let Pe=0,Ee=0;if(j&&(typeof j=="number"?Pe=-j:typeof j=="string"&&(Pe=-ne*(j==="left"?0:j==="center"?.5:j==="right"?1:p(j)))),L){if(typeof L=="number")Ee=-L;else if(typeof L=="string"){let Be=Me.length*x;Ee=L==="top"?0:L==="top-baseline"?-ce:L==="top-cap"?-ce-He*Ie:L==="top-ex"?-ce-Se*Ie:L==="middle"?Be/2:L==="bottom"?Be:L==="bottom-baseline"?Be-ye+Z*Ie:p(L)*Be}}if(!O){const Be=e.getEmbeddingLevels(C,R);Q=new Uint16Array(fe),le=new Float32Array(fe*2),q={},ae=[i,i,-i,-i],se=[];let Je=ce;k&&(re=new Float32Array(C.length*3)),F&&(te=new Uint8Array(fe*3));let We=0,Ke=-1,Ne=-1,De,ke;if(Me.forEach((Ye,it)=>{let{count:Ve,width:yt}=Ye;if(Ve>0){let ct=0;for(let at=Ve;at--&&Ye.glyphAt(at).glyphObj.isWhitespace;)ct++;let Xe=0,ut=0;if(M==="center")Xe=(ne-yt)/2;else if(M==="right")Xe=ne-yt;else if(M==="justify"&&Ye.isSoftWrapped){let at=0;for(let Oe=Ve-ct;Oe--;)Ye.glyphAt(Oe).glyphObj.isWhitespace&&at++;ut=(ne-yt)/at}if(ut||Xe){let at=0;for(let Oe=0;Oe=Oe){let Ut=Rt,Ht=Rt;for(;HtZe)break;Htot=at;for(let at=0;at1&&g(re,Ke,Ht),Ke=Pt}if(F){const{charIndex:Pt}=Oe;for(;Pt>Ne;)Ne++,F.hasOwnProperty(Ne)&&(ke=F[Ne])}if(!ot.isWhitespace&&!ot.isEmpty){const Pt=We++;q[Ze]||(q[Ze]={path:ot.path,pathBounds:[ot.xMin,ot.yMin,ot.xMax,ot.yMax]});const Rt=Oe.x+Pe,Ut=Je+Ee;le[Pt*2]=Rt,le[Pt*2+1]=Ut;const Ht=Rt+ot.xMin*Ie,At=Ut+ot.yMin*Ie,kt=Rt+ot.xMax*Ie,gt=Ut+ot.yMax*Ie;Htae[2]&&(ae[2]=kt),gt>ae[3]&&(ae[3]=gt),Pt%N===0&&(De={start:Pt,end:Pt,rect:[i,i,-i,-i]},se.push(De)),De.end++;const dt=De.rect;if(Htdt[2]&&(dt[2]=kt),gt>dt[3]&&(dt[3]=gt),Q[Pt]=Ze,F){const Ct=Pt*3;te[Ct]=ke>>16&255,te[Ct+1]=ke>>8&255,te[Ct+2]=ke&255}}}}Je-=x}),re){const Ye=C.length-Ke;Ye>1&&g(re,Ke,Ye)}}_.typesetting=y()-ze,U({glyphIds:Q,glyphPositions:le,glyphData:q,caretPositions:re,caretHeight:pe,glyphColors:te,chunkedBounds:se,fontSize:T,unitsPerEm:he,ascender:de*Ie,descender:Z*Ie,capHeight:He*Ie,xHeight:Se*Ie,lineHeight:x,topBaseline:ce,blockBounds:[Pe,Ee-Me.length*x,Pe+ne,Ee],visibleBounds:ae,timings:_})})}function f(C,P){d(C,v=>{const[T,A,x,S]=v.blockBounds;P({width:x-T,height:S-A})},{metricsOnly:!0})}function p(C){let P=C.match(/^([\d.]+)%$/),v=P?parseFloat(P[1]):NaN;return isNaN(v)?0:v/100}function g(C,P,v){const T=C[P*3],A=C[P*3+1],x=C[P*3+2],S=(A-T)/v;for(let R=0;R(Object.defineProperty(C,P,{get(){return this.data[this.index*b.length+v]},set(A){this.data[this.index*b.length+v]=A}}),C),{data:null,index:0}),{typeset:d,measure:f,loadFont:u}}const ux=()=>(self.performance||Date).now(),kq=lje();let hwe;function CAt(t,e,n,o,r,i,a,l,s,c,u=!0){return u?HAt(t,e,n,o,r,i,a,l,s,c).then(null,d=>(hwe||(console.warn("WebGL SDF generation failed, falling back to JS",d),hwe=!0),gwe(t,e,n,o,r,i,a,l,s,c))):gwe(t,e,n,o,r,i,a,l,s,c)}const F_=[],RAt=5;let Bce=0;function cje(){const t=ux();for(;F_.length&&ux()-tnew Promise((e,n)=>{F_.push(()=>{const o=ux();try{kq.webgl.generateIntoCanvas(...t),e({timing:ux()-o})}catch(r){n(r)}}),Bce||(Bce=setTimeout(cje,0))}),MAt=4,IAt=2e3,pwe={};let zAt=0;function gwe(t,e,n,o,r,i,a,l,s,c){const u="TroikaTextSDFGenerator_JS_"+zAt++%MAt;let d=pwe[u];return d||(d=pwe[u]={workerModule:sW({name:u,workerId:u,dependencies:[lje,ux],init(f,p){const g=f().javascript.generate;return function(...y){const w=p();return{textureData:g(...y),timing:p()-w}}},getTransferables(f){return[f.textureData.buffer]}}),requests:0,idleTimer:null}),d.requests++,clearTimeout(d.idleTimer),d.workerModule(t,e,n,o,r,i).then(({textureData:f,timing:p})=>{const g=ux(),y=new Uint8Array(f.length*4);for(let w=0;w{gAt(u)},IAt)),{timing:p}})}function DAt(t){t._warm||(kq.webgl.isSupported(t),t._warm=!0)}const EAt=kq.webglUtils.resizeWebGLCanvasWithoutClearing;/*! +`&&(Te=new w,Me.push(Te),Ae=-(Je+Ne+A*T)+D)}),Me.forEach(Be=>{for(let Je=Be.count;Je--;){let{glyphObj:We,x:Ke,width:Ne}=Be.glyphAt(Je);if(!We.isWhitespace){Be.width=Ke+Ne,Be.width>ne&&(ne=Be.width);return}}});let Pe=0,Ee=0;if(j&&(typeof j=="number"?Pe=-j:typeof j=="string"&&(Pe=-ne*(j==="left"?0:j==="center"?.5:j==="right"?1:p(j)))),L){if(typeof L=="number")Ee=-L;else if(typeof L=="string"){let Be=Me.length*x;Ee=L==="top"?0:L==="top-baseline"?-ce:L==="top-cap"?-ce-He*Ie:L==="top-ex"?-ce-Se*Ie:L==="middle"?Be/2:L==="bottom"?Be:L==="bottom-baseline"?Be-ye+Z*Ie:p(L)*Be}}if(!O){const Be=e.getEmbeddingLevels(C,R);Q=new Uint16Array(fe),le=new Float32Array(fe*2),q={},ae=[i,i,-i,-i],se=[];let Je=ce;k&&(re=new Float32Array(C.length*3)),F&&(te=new Uint8Array(fe*3));let We=0,Ke=-1,Ne=-1,De,ke;if(Me.forEach((Ye,it)=>{let{count:Ve,width:yt}=Ye;if(Ve>0){let ct=0;for(let at=Ve;at--&&Ye.glyphAt(at).glyphObj.isWhitespace;)ct++;let Xe=0,ut=0;if(M==="center")Xe=(ne-yt)/2;else if(M==="right")Xe=ne-yt;else if(M==="justify"&&Ye.isSoftWrapped){let at=0;for(let Oe=Ve-ct;Oe--;)Ye.glyphAt(Oe).glyphObj.isWhitespace&&at++;ut=(ne-yt)/at}if(ut||Xe){let at=0;for(let Oe=0;Oe=Oe){let Ut=Rt,Ht=Rt;for(;HtZe)break;Htot=at;for(let at=0;at1&&g(re,Ke,Ht),Ke=Pt}if(F){const{charIndex:Pt}=Oe;for(;Pt>Ne;)Ne++,F.hasOwnProperty(Ne)&&(ke=F[Ne])}if(!ot.isWhitespace&&!ot.isEmpty){const Pt=We++;q[Ze]||(q[Ze]={path:ot.path,pathBounds:[ot.xMin,ot.yMin,ot.xMax,ot.yMax]});const Rt=Oe.x+Pe,Ut=Je+Ee;le[Pt*2]=Rt,le[Pt*2+1]=Ut;const Ht=Rt+ot.xMin*Ie,At=Ut+ot.yMin*Ie,kt=Rt+ot.xMax*Ie,gt=Ut+ot.yMax*Ie;Htae[2]&&(ae[2]=kt),gt>ae[3]&&(ae[3]=gt),Pt%N===0&&(De={start:Pt,end:Pt,rect:[i,i,-i,-i]},se.push(De)),De.end++;const dt=De.rect;if(Htdt[2]&&(dt[2]=kt),gt>dt[3]&&(dt[3]=gt),Q[Pt]=Ze,F){const Ct=Pt*3;te[Ct]=ke>>16&255,te[Ct+1]=ke>>8&255,te[Ct+2]=ke&255}}}}Je-=x}),re){const Ye=C.length-Ke;Ye>1&&g(re,Ke,Ye)}}_.typesetting=y()-ze,U({glyphIds:Q,glyphPositions:le,glyphData:q,caretPositions:re,caretHeight:pe,glyphColors:te,chunkedBounds:se,fontSize:T,unitsPerEm:he,ascender:de*Ie,descender:Z*Ie,capHeight:He*Ie,xHeight:Se*Ie,lineHeight:x,topBaseline:ce,blockBounds:[Pe,Ee-Me.length*x,Pe+ne,Ee],visibleBounds:ae,timings:_})})}function f(C,P){d(C,v=>{const[T,A,x,S]=v.blockBounds;P({width:x-T,height:S-A})},{metricsOnly:!0})}function p(C){let P=C.match(/^([\d.]+)%$/),v=P?parseFloat(P[1]):NaN;return isNaN(v)?0:v/100}function g(C,P,v){const T=C[P*3],A=C[P*3+1],x=C[P*3+2],S=(A-T)/v;for(let R=0;R(Object.defineProperty(C,P,{get(){return this.data[this.index*b.length+v]},set(A){this.data[this.index*b.length+v]=A}}),C),{data:null,index:0}),{typeset:d,measure:f,loadFont:u}}const ux=()=>(self.performance||Date).now(),Lq=sje();let pwe;function CAt(t,e,n,o,r,i,a,l,s,c,u=!0){return u?HAt(t,e,n,o,r,i,a,l,s,c).then(null,d=>(pwe||(console.warn("WebGL SDF generation failed, falling back to JS",d),pwe=!0),mwe(t,e,n,o,r,i,a,l,s,c))):mwe(t,e,n,o,r,i,a,l,s,c)}const k_=[],RAt=5;let Bce=0;function uje(){const t=ux();for(;k_.length&&ux()-tnew Promise((e,n)=>{k_.push(()=>{const o=ux();try{Lq.webgl.generateIntoCanvas(...t),e({timing:ux()-o})}catch(r){n(r)}}),Bce||(Bce=setTimeout(uje,0))}),MAt=4,IAt=2e3,gwe={};let zAt=0;function mwe(t,e,n,o,r,i,a,l,s,c){const u="TroikaTextSDFGenerator_JS_"+zAt++%MAt;let d=gwe[u];return d||(d=gwe[u]={workerModule:sW({name:u,workerId:u,dependencies:[sje,ux],init(f,p){const g=f().javascript.generate;return function(...y){const w=p();return{textureData:g(...y),timing:p()-w}}},getTransferables(f){return[f.textureData.buffer]}}),requests:0,idleTimer:null}),d.requests++,clearTimeout(d.idleTimer),d.workerModule(t,e,n,o,r,i).then(({textureData:f,timing:p})=>{const g=ux(),y=new Uint8Array(f.length*4);for(let w=0;w{gAt(u)},IAt)),{timing:p}})}function DAt(t){t._warm||(Lq.webgl.isSupported(t),t._warm=!0)}const EAt=Lq.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 FAt(){return typeof window>"u"&&(self.window=self),function(t){var e={parse:function(r){var i=e._bin,a=new Uint8Array(r);if(i.readASCII(a,0,4)=="ttcf"){var l=4;i.readUshort(a,l),l+=2,i.readUshort(a,l),l+=2;var s=i.readUint(a,l);l+=4;for(var c=[],u=0;u>>a&1&&i++;return i},e._lctf.readClassDef=function(r,i){var a=e._bin,l=[],s=a.readUshort(r,i);if(i+=2,s==1){var c=a.readUshort(r,i);i+=2;var u=a.readUshort(r,i);i+=2;for(var d=0;d0&&(s.featureParams=l+c);var u=a.readUshort(r,i);i+=2,s.tab=[];for(var d=0;d255?-1:e.CFF.glyphByUnicode(r,e.CFF.tableSE[i])},e.CFF.readEncoding=function(r,i,a){e._bin;var l=[".notdef"],s=r[i];if(i++,s!=0)throw"error: unknown encoding format: "+s;var c=r[i];i++;for(var u=0;u>4,C=15&w;if(b!=15&&y.push(b),C!=15&&y.push(C),C==15)break}for(var P="",v=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],T=0;T=c.xMax||c.yMin>=c.yMax)return null;if(c.noc>0){c.endPts=[];for(var u=0;u=1&&u.fmt<=2){f=s.readUshort(r,a),a+=2;var g=s.readUshort(r,a);a+=2,p=e._lctf.numOfOnes(f);var y=e._lctf.numOfOnes(g);if(u.fmt==1){u.pairsets=[];var w=s.readUshort(r,a);a+=2;for(var b=0;b=1&&u.fmt<=2){if(u.fmt==1)u.delta=s.readShort(r,a),a+=2;else if(u.fmt==2){var f=s.readUshort(r,a);a+=2,u.newg=s.readUshorts(r,a,f),a+=2*u.newg.length}}else if(i==4){u.vals=[],f=s.readUshort(r,a),a+=2;for(var p=0;p>>8;if((g&=15)!=0)throw"unknown kern table format: "+g;i=e.kern.readFormat0(r,i,d)}return d},e.kern.parseV1=function(r,i,a,l){var s=e._bin;s.readFixed(r,i),i+=4;var c=s.readUint(r,i);i+=4;for(var u={glyph1:[],rval:[]},d=0;d>>8;if((p&=15)!=0)throw"unknown kern table format: "+p;i=e.kern.readFormat0(r,i,u)}return u},e.kern.readFormat0=function(r,i,a){var l=e._bin,s=-1,c=l.readUshort(r,i);i+=2,l.readUshort(r,i),i+=2,l.readUshort(r,i),i+=2,l.readUshort(r,i),i+=2;for(var u=0;u=s.map.length?0:s.map[i];if(s.format==4){for(var c=-1,u=0;ui?0:65535&(s.idRangeOffset[c]!=0?s.glyphIdArray[i-s.startCount[c]+(s.idRangeOffset[c]>>1)-(s.idRangeOffset.length-c)]:i+s.idDelta[c])}if(s.format==12){if(i>s.groups[s.groups.length-1][1])return 0;for(u=0;u-1?e.U._simpleGlyph(l,a):e.U._compoGlyph(l,i,a))},e.U._simpleGlyph=function(r,i){for(var a=0;as)){for(var w=!0,b=0,C=0;Cs)){for(w=!0,C=0;C>1,c.length=0,d=!0;else if(E=="o3"||E=="o23")c.length%2!=0&&!d&&(f=c.shift()+l.nominalWidthX),u+=c.length>>1,c.length=0,d=!0;else if(E=="o4")c.length>1&&!d&&(f=c.shift()+l.nominalWidthX,d=!0),p&&e.U.P.closePath(s),w+=c.pop(),e.U.P.moveTo(s,y,w),p=!0;else if(E=="o5")for(;c.length>0;)y+=c.shift(),w+=c.shift(),e.U.P.lineTo(s,y,w);else if(E=="o6"||E=="o7")for(var W=c.length,j=E=="o6",L=0;LMath.abs(S-w)?y=x+c.shift():w=S+c.shift(),e.U.P.curveTo(s,b,C,P,v,R,M),e.U.P.curveTo(s,T,A,x,S,y,w));else if(E=="o14"){if(c.length>0&&!d&&(f=c.shift()+a.nominalWidthX,d=!0),c.length==4){var F=c.shift(),U=c.shift(),O=c.shift(),B=c.shift(),_=e.CFF.glyphBySE(a,O),X=e.CFF.glyphBySE(a,B);e.U._drawCFF(a.CharStrings[_],i,a,l,s),i.x=F,i.y=U,e.U._drawCFF(a.CharStrings[X],i,a,l,s)}p&&(e.U.P.closePath(s),p=!1)}else if(E=="o19"||E=="o20")c.length%2!=0&&!d&&(f=c.shift()+l.nominalWidthX),u+=c.length>>1,c.length=0,d=!0,g+=u+7>>3;else if(E=="o21")c.length>2&&!d&&(f=c.shift()+l.nominalWidthX,d=!0),w+=c.pop(),y+=c.pop(),p&&e.U.P.closePath(s),e.U.P.moveTo(s,y,w),p=!0;else if(E=="o22")c.length>1&&!d&&(f=c.shift()+l.nominalWidthX,d=!0),y+=c.pop(),p&&e.U.P.closePath(s),e.U.P.moveTo(s,y,w),p=!0;else if(E=="o25"){for(;c.length>6;)y+=c.shift(),w+=c.shift(),e.U.P.lineTo(s,y,w);b=y+c.shift(),C=w+c.shift(),P=b+c.shift(),v=C+c.shift(),y=P+c.shift(),w=v+c.shift(),e.U.P.curveTo(s,b,C,P,v,y,w)}else if(E=="o26")for(c.length%2&&(y+=c.shift());c.length>0;)b=y,C=w+c.shift(),y=P=b+c.shift(),w=(v=C+c.shift())+c.shift(),e.U.P.curveTo(s,b,C,P,v,y,w);else if(E=="o27")for(c.length%2&&(w+=c.shift());c.length>0;)C=w,P=(b=y+c.shift())+c.shift(),v=C+c.shift(),y=P+c.shift(),w=v,e.U.P.curveTo(s,b,C,P,v,y,w);else if(E=="o10"||E=="o29"){var $=E=="o10"?l:a;if(c.length==0)console.debug("error: empty stack");else{var Q=c.pop(),le=$.Subrs[Q+$.Bias];i.x=y,i.y=w,i.nStems=u,i.haveWidth=d,i.width=f,i.open=p,e.U._drawCFF(le,i,a,l,s),y=i.x,w=i.y,u=i.nStems,d=i.haveWidth,f=i.width,p=i.open}}else if(E=="o30"||E=="o31"){var q=c.length,te=(N=0,E=="o31");for(N+=q-(W=-3&q);N>>1|(21845&p)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,f[p]=((65280&g)>>>8|(255&g)<<8)>>>1}var y=function(E,W,j){for(var L=E.length,k=0,N=new n(W);k>>O]=B}return F},w=new e(288);for(p=0;p<144;++p)w[p]=8;for(p=144;p<256;++p)w[p]=9;for(p=256;p<280;++p)w[p]=7;for(p=280;p<288;++p)w[p]=8;var b=new e(32);for(p=0;p<32;++p)b[p]=5;var C=y(w,9),P=y(b,5),v=function(E){for(var W=E[0],j=1;jW&&(W=E[j]);return W},T=function(E,W,j){var L=W/8|0;return(E[L]|E[L+1]<<8)>>(7&W)&j},A=function(E,W){var j=W/8|0;return(E[j]|E[j+1]<<8|E[j+2]<<16)>>(7&W)},x=["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"],S=function(E,W,j){var L=new Error(W||x[E]);if(L.code=E,Error.captureStackTrace&&Error.captureStackTrace(L,S),!j)throw L;return L},R=function(E,W,j){var L=E.length;if(!L||j&&!j.l&&L<5)return W||new e(0);var k=!W||j,N=!j||j.i;j||(j={}),W||(W=new e(3*L));var F,U=function(Ke){var Ne=W.length;if(Ke>Ne){var De=new e(Math.max(2*Ne,Ke));De.set(W),W=De}},O=j.f||0,B=j.p||0,_=j.b||0,X=j.l,$=j.d,Q=j.m,le=j.n,q=8*L;do{if(!X){j.f=O=T(E,B,1);var te=T(E,B+1,3);if(B+=3,!te){var re=E[(Se=((F=B)/8|0)+(7&F&&1)+4)-4]|E[Se-3]<<8,ae=Se+re;if(ae>L){N&&S(0);break}k&&U(_+re),W.set(E.subarray(Se,ae),_),j.b=_+=re,j.p=B=8*ae;continue}if(te==1)X=C,$=P,Q=9,le=5;else if(te==2){var se=T(E,B,31)+257,ne=T(E,B+10,15)+4,fe=se+T(E,B+5,31)+1;B+=14;for(var ge=new e(fe),de=new e(19),Z=0;Z>>4)<16)ge[Z++]=Se;else{var Ie=0,ye=0;for(Se==16?(ye=3+T(E,B,3),B+=2,Ie=ge[Z-1]):Se==17?(ye=3+T(E,B,7),B+=3):Se==18&&(ye=11+T(E,B,127),B+=7);ye--;)ge[Z++]=Ie}}var ce=ge.subarray(0,se),pe=ge.subarray(se);Q=v(ce),le=v(pe),X=y(ce,Q),$=y(pe,le)}else S(1);if(B>q){N&&S(0);break}}k&&U(_+131072);for(var ve=(1<>>4;if((B+=15&Ie)>q){N&&S(0);break}if(Ie||S(2),Me<256)W[_++]=Me;else{if(Me==256){Te=B,X=null;break}var Pe=Me-254;if(Me>264){var Ee=r[Z=Me-257];Pe=T(E,B,(1<>>4;if(Be||S(3),B+=15&Be,pe=d[Je],Je>3&&(Ee=i[Je],pe+=A(E,B)&(1<q){N&&S(0);break}k&&U(_+131072);for(var We=_+Pe;_Ke.length)&&(De=Ke.length);var ke=new(Ke instanceof n?n:Ke instanceof o?o:e)(De-Ne);return ke.set(Ke.subarray(Ne,De)),ke}(W,0,_)},M=new e(0),D=typeof TextDecoder<"u"&&new TextDecoder;try{D.decode(M,{stream:!0})}catch{}return t.convert_streams=function(E){var W=new DataView(E),j=0;function L(){var se=W.getUint16(j);return j+=2,se}function k(){var se=W.getUint32(j);return j+=4,se}function N(se){re.setUint16(ae,se),ae+=2}function F(se){re.setUint32(ae,se),ae+=4}for(var U={signature:k(),flavor:k(),length:k(),numTables:L(),reserved:L(),totalSfntSize:k(),majorVersion:L(),minorVersion:L(),metaOffset:k(),metaLength:k(),metaOrigLength:k(),privOffset:k(),privLength:k()},O=0;Math.pow(2,O)<=U.numTables;)O++;O--;for(var B=16*Math.pow(2,O),_=16*U.numTables-B,X=12,$=[],Q=0;Q{let[M,D]=R.split("+");M=parseInt(M,36),D=D?parseInt(D,36):0,u.set(S+=M,A[x]);for(let E=D;E--;)u.set(++S,A[x])})}}return u.get(T)||c}const f=1,p=2,g=3,y=4,w=[null,"isol","init","fina","medi"];function b(T){const A=new Uint8Array(T.length);let x=c,S=f,R=-1;for(let M=0;M65535&&M++)}return A}function C(T,A){const x=[];for(let R=0;R65535&&R++,x.push(t.U.codeToGlyph(T,M))}const S=T.GSUB;if(S){const{lookupList:R,featureList:M}=S;let D;const E=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,W=[];M.forEach(j=>{if(E.test(j.tag))for(let L=0;L{if(B!==-1){let X=A[B];if(!X){const{cmds:$,crds:Q}=t.U.glyphToPath(T,B);let le="",q=0;for(let ne=0,fe=$.length;ne1?",":"")+Q[q++]}let te,re,ae,se;if(Q.length){te=re=1/0,ae=se=-1/0;for(let ne=0,fe=Q.length;neae&&(ae=ge),de>se&&(se=de)}}else te=ae=re=se=0;X=A[B]={index:B,advanceWidth:T.hmtx.aWidth[B],xMin:te,yMin:re,xMax:ae,yMax:se,path:le,pathCommandCount:$.length}}O!==-1&&(k+=t.U.getPairAdjustment(T,O,B)*N),L.call(null,X,k,U),X.advanceWidth&&(k+=X.advanceWidth*N),j&&(k+=j*W),O=B}U+=E.codePointAt(U)>65535?2:1}),k}};return D}return function(A){const x=new Uint8Array(A,0,4),S=t._bin.readASCII(x,0,4);if(S==="wOFF")A=e(A);else if(S==="wOF2")throw new Error("woff2 fonts not supported");return v(t.parse(A)[0])}}const WAt=sW({name:"Typr Font Parser",dependencies:[FAt,kAt,LAt],init(t,e,n){const o=t(),r=e();return n(o,r)}}),qP={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},NAt=new rr;function TT(){return(self.performance||Date).now()}const mwe=Object.create(null);function uje(t,e){t=BAt({},t);const n=TT();if(t.font=YAt(t.font||qP.defaultFontURL),t.text=""+t.text,t.sdfGlyphSize=t.sdfGlyphSize||qP.sdfGlyphSize,t.colorRanges!=null){let d={};for(let f in t.colorRanges)if(t.colorRanges.hasOwnProperty(f)){let p=t.colorRanges[f];typeof p!="number"&&(p=NAt.set(p).getHex()),d[f]=p}t.colorRanges=d}Object.freeze(t);const{textureWidth:o,sdfExponent:r}=qP,{sdfGlyphSize:i}=t,a=o/i*4;let l=mwe[i];if(!l){const d=document.createElement("canvas");d.width=o,d.height=i*256/a,l=mwe[i]={glyphCount:0,sdfGlyphSize:i,sdfCanvas:d,sdfTexture:new Vc(d,void 0,void 0,void 0,Gs,Gs),contextLost:!1,glyphsByFont:new Map},l.sdfTexture.generateMipmaps=!1,UAt(l)}const{sdfTexture:s,sdfCanvas:c}=l;let u=l.glyphsByFont.get(t.font);u||l.glyphsByFont.set(t.font,u=new Map),_At(t).then(d=>{const{glyphIds:f,glyphPositions:p,fontSize:g,unitsPerEm:y,timings:w}=d,b=[],C=new Float32Array(f.length*4),P=g/y;let v=0,T=0;const A=TT();f.forEach((D,E)=>{let W=u.get(D);if(!W){const{path:N,pathBounds:F}=d.glyphData[D],U=Math.max(F[2]-F[0],F[3]-F[1])/i*(qP.sdfMargin*i+.5),O=l.glyphCount++,B=[F[0]-U,F[1]-U,F[2]+U,F[3]+U];u.set(D,W={path:N,atlasIndex:O,sdfViewBox:B}),b.push(W)}const{sdfViewBox:j}=W,L=p[T++],k=p[T++];C[v++]=L+j[0]*P,C[v++]=k+j[1]*P,C[v++]=L+j[2]*P,C[v++]=k+j[3]*P,f[E]=W.atlasIndex}),w.quads=(w.quads||0)+(TT()-A);const x=TT();w.sdf={};const S=c.height,R=Math.ceil(l.glyphCount/a),M=Math.pow(2,Math.ceil(Math.log2(R*i)));M>S&&(console.info(`Increasing SDF texture size ${S}->${M}`),EAt(c,o,M),s.dispose()),Promise.all(b.map(D=>dje(D,l,t.gpuAccelerateSDF).then(({timing:E})=>{w.sdf[D.atlasIndex]=E}))).then(()=>{b.length&&!l.contextLost&&(fje(l),s.needsUpdate=!0),w.sdfTotal=TT()-x,w.total=TT()-n,e(Object.freeze({parameters:t,sdfTexture:s,sdfGlyphSize:i,sdfExponent:r,glyphBounds:C,glyphAtlasIndices:f,glyphColors:d.glyphColors,caretPositions:d.caretPositions,caretHeight:d.caretHeight,chunkedBounds:d.chunkedBounds,ascender:d.ascender,descender:d.descender,lineHeight:d.lineHeight,capHeight:d.capHeight,xHeight:d.xHeight,topBaseline:d.topBaseline,blockBounds:d.blockBounds,visibleBounds:d.visibleBounds,timings:d.timings}))})}),Promise.resolve().then(()=>{l.contextLost||DAt(c)})}function dje({path:t,atlasIndex:e,sdfViewBox:n},{sdfGlyphSize:o,sdfCanvas:r,contextLost:i},a){if(i)return Promise.resolve({timing:-1});const{textureWidth:l,sdfExponent:s}=qP,c=Math.max(n[2]-n[0],n[3]-n[1]),u=Math.floor(e/4),d=u%(l/o)*o,f=Math.floor(u/(l/o))*o,p=e%4;return CAt(o,o,t,n,c,s,r,d,f,p,a)}function UAt(t){const e=t.sdfCanvas;e.addEventListener("webglcontextlost",n=>{console.log("Context Lost",n),n.preventDefault(),t.contextLost=!0}),e.addEventListener("webglcontextrestored",n=>{console.log("Context Restored",n),t.contextLost=!1;const o=[];t.glyphsByFont.forEach(r=>{r.forEach(i=>{o.push(dje(i,t,!0))})}),Promise.all(o).then(()=>{fje(t),t.sdfTexture.needsUpdate=!0})})}function jAt({font:t,characters:e,sdfGlyphSize:n},o){let r=Array.isArray(e)?e.join(` -`):""+e;uje({font:t,sdfGlyphSize:n,text:r},o)}function BAt(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}let uY;function YAt(t){return uY||(uY=typeof document>"u"?{}:document.createElement("a")),uY.href=t,uY.href}function fje(t){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:e,sdfTexture:n}=t,{width:o,height:r}=e,i=t.sdfCanvas.getContext("webgl");let a=n.image.data;(!a||a.length!==o*r*4)&&(a=new Uint8Array(o*r*4),n.image={width:o,height:r,data:a},n.flipY=!1,n.isDataTexture=!0),i.readPixels(0,0,o,r,i.RGBA,i.UNSIGNED_BYTE,a)}}const OAt=sW({name:"Typesetter",dependencies:[qP,WAt,PAt,yAt],init(t,e,n,o){const{defaultFontURL:r}=t;return n(e,o(),{defaultFontURL:r})}}),_At=sW({name:"Typesetter",dependencies:[OAt],init(t){return function(e){return new Promise(n=>{t.typeset(e,n)})}},getTransferables(t){const e=[t.glyphPositions.buffer,t.glyphIds.buffer];return t.caretPositions&&e.push(t.caretPositions.buffer),t.glyphColors&&e.push(t.glyphColors.buffer),e}}),ywe={};function VAt(t){let e=ywe[t];if(!e){const n=new Rw(1,1,t,t),o=n.clone(),r=n.attributes,i=o.attributes,a=new Ni,l=r.uv.count;for(let s=0;s{a.setAttribute(s,new gr([...r[s].array,...i[s].array],r[s].itemSize))}),a.setIndex([...n.index.array,...o.index.array.map(s=>s+l)]),a.translate(.5,.5,0),e=ywe[t]=a}return e}const GAt="aTroikaGlyphBounds",Awe="aTroikaGlyphIndex",XAt="aTroikaGlyphColor";class JAt extends Dq{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 s1,this.boundingBox=new bf}computeBoundingSphere(){}computeBoundingBox(){}setSide(e){const n=this.getIndex().count;this.setDrawRange(e===p0?n/2:0,e===$r?n:n/2)}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!="number"||e<1)&&(e=1);let n=VAt(e);["position","normal","uv"].forEach(o=>{this.attributes[o]=n.attributes[o].clone()}),this.setIndex(n.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,n,o,r,i){vre(this,GAt,e,4),vre(this,Awe,n,1),vre(this,XAt,i,3),this._blockBounds=o,this._chunkedBounds=r,this.instanceCount=n.length,this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:n,boundingBox:o}=this;if(n){const{PI:r,floor:i,min:a,max:l,sin:s,cos:c}=Math,u=r/2,d=r*2,f=Math.abs(n),p=e[0]/f,g=e[2]/f,y=i((p+u)/d)!==i((g+u)/d)?-f:a(s(p)*f,s(g)*f),w=i((p-u)/d)!==i((g-u)/d)?f:l(s(p)*f,s(g)*f),b=i((p+r)/d)!==i((g+r)/d)?f*2:l(f-c(p)*f,f-c(g)*f);o.min.set(y,e[1],n<0?-b:0),o.max.set(w,e[3],n<0?0:b)}else o.min.set(e[0],e[1],0),o.max.set(e[2],e[3],0);o.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let n=this.getAttribute(Awe).count,o=this._chunkedBounds;if(o)for(let r=o.length;r--;){n=o[r].end;let i=o[r].rect;if(i[1]e.y&&i[0]e.x)break}this.instanceCount=n}}function vre(t,e,n,o){const r=t.getAttribute(e);n?r&&r.array.length===n.length?(r.array.set(n),r.needsUpdate=!0):(t.setAttribute(e,new Yx(n,o)),delete t._maxInstanceCount,t.dispose()):r&&t.deleteAttribute(e)}const KAt=` +*/function kAt(){return function(t){var e=Uint8Array,n=Uint16Array,o=Uint32Array,r=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]),i=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]),a=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=function(E,W){for(var j=new n(31),L=0;L<31;++L)j[L]=W+=1<>>1|(21845&p)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,f[p]=((65280&g)>>>8|(255&g)<<8)>>>1}var y=function(E,W,j){for(var L=E.length,k=0,N=new n(W);k>>O]=B}return F},w=new e(288);for(p=0;p<144;++p)w[p]=8;for(p=144;p<256;++p)w[p]=9;for(p=256;p<280;++p)w[p]=7;for(p=280;p<288;++p)w[p]=8;var b=new e(32);for(p=0;p<32;++p)b[p]=5;var C=y(w,9),P=y(b,5),v=function(E){for(var W=E[0],j=1;jW&&(W=E[j]);return W},T=function(E,W,j){var L=W/8|0;return(E[L]|E[L+1]<<8)>>(7&W)&j},A=function(E,W){var j=W/8|0;return(E[j]|E[j+1]<<8|E[j+2]<<16)>>(7&W)},x=["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"],S=function(E,W,j){var L=new Error(W||x[E]);if(L.code=E,Error.captureStackTrace&&Error.captureStackTrace(L,S),!j)throw L;return L},R=function(E,W,j){var L=E.length;if(!L||j&&!j.l&&L<5)return W||new e(0);var k=!W||j,N=!j||j.i;j||(j={}),W||(W=new e(3*L));var F,U=function(Ke){var Ne=W.length;if(Ke>Ne){var De=new e(Math.max(2*Ne,Ke));De.set(W),W=De}},O=j.f||0,B=j.p||0,_=j.b||0,X=j.l,$=j.d,Q=j.m,le=j.n,q=8*L;do{if(!X){j.f=O=T(E,B,1);var te=T(E,B+1,3);if(B+=3,!te){var re=E[(Se=((F=B)/8|0)+(7&F&&1)+4)-4]|E[Se-3]<<8,ae=Se+re;if(ae>L){N&&S(0);break}k&&U(_+re),W.set(E.subarray(Se,ae),_),j.b=_+=re,j.p=B=8*ae;continue}if(te==1)X=C,$=P,Q=9,le=5;else if(te==2){var se=T(E,B,31)+257,ne=T(E,B+10,15)+4,fe=se+T(E,B+5,31)+1;B+=14;for(var ge=new e(fe),de=new e(19),Z=0;Z>>4)<16)ge[Z++]=Se;else{var Ie=0,ye=0;for(Se==16?(ye=3+T(E,B,3),B+=2,Ie=ge[Z-1]):Se==17?(ye=3+T(E,B,7),B+=3):Se==18&&(ye=11+T(E,B,127),B+=7);ye--;)ge[Z++]=Ie}}var ce=ge.subarray(0,se),pe=ge.subarray(se);Q=v(ce),le=v(pe),X=y(ce,Q),$=y(pe,le)}else S(1);if(B>q){N&&S(0);break}}k&&U(_+131072);for(var ve=(1<>>4;if((B+=15&Ie)>q){N&&S(0);break}if(Ie||S(2),Me<256)W[_++]=Me;else{if(Me==256){Te=B,X=null;break}var Pe=Me-254;if(Me>264){var Ee=r[Z=Me-257];Pe=T(E,B,(1<>>4;if(Be||S(3),B+=15&Be,pe=d[Je],Je>3&&(Ee=i[Je],pe+=A(E,B)&(1<q){N&&S(0);break}k&&U(_+131072);for(var We=_+Pe;_Ke.length)&&(De=Ke.length);var ke=new(Ke instanceof n?n:Ke instanceof o?o:e)(De-Ne);return ke.set(Ke.subarray(Ne,De)),ke}(W,0,_)},M=new e(0),D=typeof TextDecoder<"u"&&new TextDecoder;try{D.decode(M,{stream:!0})}catch{}return t.convert_streams=function(E){var W=new DataView(E),j=0;function L(){var se=W.getUint16(j);return j+=2,se}function k(){var se=W.getUint32(j);return j+=4,se}function N(se){re.setUint16(ae,se),ae+=2}function F(se){re.setUint32(ae,se),ae+=4}for(var U={signature:k(),flavor:k(),length:k(),numTables:L(),reserved:L(),totalSfntSize:k(),majorVersion:L(),minorVersion:L(),metaOffset:k(),metaLength:k(),metaOrigLength:k(),privOffset:k(),privLength:k()},O=0;Math.pow(2,O)<=U.numTables;)O++;O--;for(var B=16*Math.pow(2,O),_=16*U.numTables-B,X=12,$=[],Q=0;Q{let[M,D]=R.split("+");M=parseInt(M,36),D=D?parseInt(D,36):0,u.set(S+=M,A[x]);for(let E=D;E--;)u.set(++S,A[x])})}}return u.get(T)||c}const f=1,p=2,g=3,y=4,w=[null,"isol","init","fina","medi"];function b(T){const A=new Uint8Array(T.length);let x=c,S=f,R=-1;for(let M=0;M65535&&M++)}return A}function C(T,A){const x=[];for(let R=0;R65535&&R++,x.push(t.U.codeToGlyph(T,M))}const S=T.GSUB;if(S){const{lookupList:R,featureList:M}=S;let D;const E=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,W=[];M.forEach(j=>{if(E.test(j.tag))for(let L=0;L{if(B!==-1){let X=A[B];if(!X){const{cmds:$,crds:Q}=t.U.glyphToPath(T,B);let le="",q=0;for(let ne=0,fe=$.length;ne1?",":"")+Q[q++]}let te,re,ae,se;if(Q.length){te=re=1/0,ae=se=-1/0;for(let ne=0,fe=Q.length;neae&&(ae=ge),de>se&&(se=de)}}else te=ae=re=se=0;X=A[B]={index:B,advanceWidth:T.hmtx.aWidth[B],xMin:te,yMin:re,xMax:ae,yMax:se,path:le,pathCommandCount:$.length}}O!==-1&&(k+=t.U.getPairAdjustment(T,O,B)*N),L.call(null,X,k,U),X.advanceWidth&&(k+=X.advanceWidth*N),j&&(k+=j*W),O=B}U+=E.codePointAt(U)>65535?2:1}),k}};return D}return function(A){const x=new Uint8Array(A,0,4),S=t._bin.readASCII(x,0,4);if(S==="wOFF")A=e(A);else if(S==="wOF2")throw new Error("woff2 fonts not supported");return v(t.parse(A)[0])}}const WAt=sW({name:"Typr Font Parser",dependencies:[FAt,kAt,LAt],init(t,e,n){const o=t(),r=e();return n(o,r)}}),qP={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},NAt=new rr;function TT(){return(self.performance||Date).now()}const ywe=Object.create(null);function dje(t,e){t=BAt({},t);const n=TT();if(t.font=YAt(t.font||qP.defaultFontURL),t.text=""+t.text,t.sdfGlyphSize=t.sdfGlyphSize||qP.sdfGlyphSize,t.colorRanges!=null){let d={};for(let f in t.colorRanges)if(t.colorRanges.hasOwnProperty(f)){let p=t.colorRanges[f];typeof p!="number"&&(p=NAt.set(p).getHex()),d[f]=p}t.colorRanges=d}Object.freeze(t);const{textureWidth:o,sdfExponent:r}=qP,{sdfGlyphSize:i}=t,a=o/i*4;let l=ywe[i];if(!l){const d=document.createElement("canvas");d.width=o,d.height=i*256/a,l=ywe[i]={glyphCount:0,sdfGlyphSize:i,sdfCanvas:d,sdfTexture:new Vc(d,void 0,void 0,void 0,Gs,Gs),contextLost:!1,glyphsByFont:new Map},l.sdfTexture.generateMipmaps=!1,UAt(l)}const{sdfTexture:s,sdfCanvas:c}=l;let u=l.glyphsByFont.get(t.font);u||l.glyphsByFont.set(t.font,u=new Map),_At(t).then(d=>{const{glyphIds:f,glyphPositions:p,fontSize:g,unitsPerEm:y,timings:w}=d,b=[],C=new Float32Array(f.length*4),P=g/y;let v=0,T=0;const A=TT();f.forEach((D,E)=>{let W=u.get(D);if(!W){const{path:N,pathBounds:F}=d.glyphData[D],U=Math.max(F[2]-F[0],F[3]-F[1])/i*(qP.sdfMargin*i+.5),O=l.glyphCount++,B=[F[0]-U,F[1]-U,F[2]+U,F[3]+U];u.set(D,W={path:N,atlasIndex:O,sdfViewBox:B}),b.push(W)}const{sdfViewBox:j}=W,L=p[T++],k=p[T++];C[v++]=L+j[0]*P,C[v++]=k+j[1]*P,C[v++]=L+j[2]*P,C[v++]=k+j[3]*P,f[E]=W.atlasIndex}),w.quads=(w.quads||0)+(TT()-A);const x=TT();w.sdf={};const S=c.height,R=Math.ceil(l.glyphCount/a),M=Math.pow(2,Math.ceil(Math.log2(R*i)));M>S&&(console.info(`Increasing SDF texture size ${S}->${M}`),EAt(c,o,M),s.dispose()),Promise.all(b.map(D=>fje(D,l,t.gpuAccelerateSDF).then(({timing:E})=>{w.sdf[D.atlasIndex]=E}))).then(()=>{b.length&&!l.contextLost&&(hje(l),s.needsUpdate=!0),w.sdfTotal=TT()-x,w.total=TT()-n,e(Object.freeze({parameters:t,sdfTexture:s,sdfGlyphSize:i,sdfExponent:r,glyphBounds:C,glyphAtlasIndices:f,glyphColors:d.glyphColors,caretPositions:d.caretPositions,caretHeight:d.caretHeight,chunkedBounds:d.chunkedBounds,ascender:d.ascender,descender:d.descender,lineHeight:d.lineHeight,capHeight:d.capHeight,xHeight:d.xHeight,topBaseline:d.topBaseline,blockBounds:d.blockBounds,visibleBounds:d.visibleBounds,timings:d.timings}))})}),Promise.resolve().then(()=>{l.contextLost||DAt(c)})}function fje({path:t,atlasIndex:e,sdfViewBox:n},{sdfGlyphSize:o,sdfCanvas:r,contextLost:i},a){if(i)return Promise.resolve({timing:-1});const{textureWidth:l,sdfExponent:s}=qP,c=Math.max(n[2]-n[0],n[3]-n[1]),u=Math.floor(e/4),d=u%(l/o)*o,f=Math.floor(u/(l/o))*o,p=e%4;return CAt(o,o,t,n,c,s,r,d,f,p,a)}function UAt(t){const e=t.sdfCanvas;e.addEventListener("webglcontextlost",n=>{console.log("Context Lost",n),n.preventDefault(),t.contextLost=!0}),e.addEventListener("webglcontextrestored",n=>{console.log("Context Restored",n),t.contextLost=!1;const o=[];t.glyphsByFont.forEach(r=>{r.forEach(i=>{o.push(fje(i,t,!0))})}),Promise.all(o).then(()=>{hje(t),t.sdfTexture.needsUpdate=!0})})}function jAt({font:t,characters:e,sdfGlyphSize:n},o){let r=Array.isArray(e)?e.join(` +`):""+e;dje({font:t,sdfGlyphSize:n,text:r},o)}function BAt(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}let dY;function YAt(t){return dY||(dY=typeof document>"u"?{}:document.createElement("a")),dY.href=t,dY.href}function hje(t){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:e,sdfTexture:n}=t,{width:o,height:r}=e,i=t.sdfCanvas.getContext("webgl");let a=n.image.data;(!a||a.length!==o*r*4)&&(a=new Uint8Array(o*r*4),n.image={width:o,height:r,data:a},n.flipY=!1,n.isDataTexture=!0),i.readPixels(0,0,o,r,i.RGBA,i.UNSIGNED_BYTE,a)}}const OAt=sW({name:"Typesetter",dependencies:[qP,WAt,PAt,yAt],init(t,e,n,o){const{defaultFontURL:r}=t;return n(e,o(),{defaultFontURL:r})}}),_At=sW({name:"Typesetter",dependencies:[OAt],init(t){return function(e){return new Promise(n=>{t.typeset(e,n)})}},getTransferables(t){const e=[t.glyphPositions.buffer,t.glyphIds.buffer];return t.caretPositions&&e.push(t.caretPositions.buffer),t.glyphColors&&e.push(t.glyphColors.buffer),e}}),Awe={};function VAt(t){let e=Awe[t];if(!e){const n=new Rw(1,1,t,t),o=n.clone(),r=n.attributes,i=o.attributes,a=new Ni,l=r.uv.count;for(let s=0;s{a.setAttribute(s,new gr([...r[s].array,...i[s].array],r[s].itemSize))}),a.setIndex([...n.index.array,...o.index.array.map(s=>s+l)]),a.translate(.5,.5,0),e=Awe[t]=a}return e}const GAt="aTroikaGlyphBounds",wwe="aTroikaGlyphIndex",XAt="aTroikaGlyphColor";class JAt extends Eq{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 s1,this.boundingBox=new bf}computeBoundingSphere(){}computeBoundingBox(){}setSide(e){const n=this.getIndex().count;this.setDrawRange(e===p0?n/2:0,e===$r?n:n/2)}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!="number"||e<1)&&(e=1);let n=VAt(e);["position","normal","uv"].forEach(o=>{this.attributes[o]=n.attributes[o].clone()}),this.setIndex(n.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,n,o,r,i){vre(this,GAt,e,4),vre(this,wwe,n,1),vre(this,XAt,i,3),this._blockBounds=o,this._chunkedBounds=r,this.instanceCount=n.length,this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:n,boundingBox:o}=this;if(n){const{PI:r,floor:i,min:a,max:l,sin:s,cos:c}=Math,u=r/2,d=r*2,f=Math.abs(n),p=e[0]/f,g=e[2]/f,y=i((p+u)/d)!==i((g+u)/d)?-f:a(s(p)*f,s(g)*f),w=i((p-u)/d)!==i((g-u)/d)?f:l(s(p)*f,s(g)*f),b=i((p+r)/d)!==i((g+r)/d)?f*2:l(f-c(p)*f,f-c(g)*f);o.min.set(y,e[1],n<0?-b:0),o.max.set(w,e[3],n<0?0:b)}else o.min.set(e[0],e[1],0),o.max.set(e[2],e[3],0);o.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let n=this.getAttribute(wwe).count,o=this._chunkedBounds;if(o)for(let r=o.length;r--;){n=o[r].end;let i=o[r].rect;if(i[1]e.y&&i[0]e.x)break}this.instanceCount=n}}function vre(t,e,n,o){const r=t.getAttribute(e);n?r&&r.array.length===n.length?(r.array.set(n),r.needsUpdate=!0):(t.setAttribute(e,new Yx(n,o)),delete t._maxInstanceCount,t.dispose()):r&&t.deleteAttribute(e)}const KAt=` uniform vec2 uTroikaSDFTextureSize; uniform float uTroikaSDFGlyphSize; uniform vec4 uTroikaTotalBounds; @@ -4303,10 +4303,10 @@ gl_FragColor.a *= edgeAlpha; if (edgeAlpha == 0.0) { discard; } -`;function ZAt(t){const e=jce(t,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new Xt},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new Qa(0,0,0,0)},uTroikaClipRect:{value:new Qa(0,0,0,0)},uTroikaDistanceOffset:{value:0},uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new Xt},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new rr},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new pa},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:KAt,vertexTransform:qAt,fragmentDefs:$At,fragmentColorTransform:QAt,customRewriter({vertexShader:n,fragmentShader:o}){let r=/\buniform\s+vec3\s+diffuse\b/;return r.test(o)&&(o=o.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),r.test(n)||(n=n.replace(sje,`uniform vec3 diffuse; +`;function ZAt(t){const e=jce(t,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new Xt},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new Qa(0,0,0,0)},uTroikaClipRect:{value:new Qa(0,0,0,0)},uTroikaDistanceOffset:{value:0},uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new Xt},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new rr},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new ga},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:KAt,vertexTransform:qAt,fragmentDefs:$At,fragmentColorTransform:QAt,customRewriter({vertexShader:n,fragmentShader:o}){let r=/\buniform\s+vec3\s+diffuse\b/;return r.test(o)&&(o=o.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),r.test(n)||(n=n.replace(cje,`uniform vec3 diffuse; $& vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse; -`))),{vertexShader:n,fragmentShader:o}}});return e.transparent=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}const gge=new e3({color:16777215,side:$r,transparent:!0}),wwe=8421504,vwe=new Ji,dY=new ie,xre=new ie,Hz=[],e4t=new ie,bre="+x+y";function xwe(t){return Array.isArray(t)?t[0]:t}let hje=()=>{const t=new is(new Rw(1,1),gge);return hje=()=>t,t},pje=()=>{const t=new is(new Rw(1,1,32,1),gge);return pje=()=>t,t};const t4t={type:"syncstart"},n4t={type:"synccomplete"},gje=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],o4t=gje.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");let mje=class extends is{constructor(){const e=new JAt;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=wwe,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=bre,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(t4t),uje({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},n=>{this._isSyncing=!1,this._textRenderInfo=n,this.geometry.updateGlyphs(n.glyphBounds,n.glyphAtlasIndices,n.blockBounds,n.chunkedBounds,n.glyphColors);const o=this._queuedSyncs;o&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{o.forEach(r=>r&&r())})),this.dispatchEvent(n4t),e&&e()})))}onBeforeRender(e,n,o,r,i,a){this.sync(),i.isTroikaTextMaterial&&this._prepareForRender(i),i._hadOwnSide=i.hasOwnProperty("side"),this.geometry.setSide(i._actualSide=i.side),i.side=Ra}onAfterRender(e,n,o,r,i,a){i._hadOwnSide?i.side=i._actualSide:delete i.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let e=this._derivedMaterial;const n=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=gge.clone());if((!e||e.baseMaterial!==n)&&(e=this._derivedMaterial=ZAt(n),n.addEventListener("dispose",function o(){n.removeEventListener("dispose",o),e.dispose()})),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let o=e._outlineMtl;return o||(o=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),o.isTextOutlineMaterial=!0,o.depthWrite=!1,o.map=null,e.addEventListener("dispose",function r(){e.removeEventListener("dispose",r),o.dispose()})),[o,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 xwe(this.material).getDepthMaterial()}get customDistanceMaterial(){return xwe(this.material).getDistanceMaterial()}_prepareForRender(e){const n=e.isTextOutlineMaterial,o=e.uniforms,r=this.textRenderInfo;if(r){const{sdfTexture:l,blockBounds:s}=r;o.uTroikaSDFTexture.value=l,o.uTroikaSDFTextureSize.value.set(l.image.width,l.image.height),o.uTroikaSDFGlyphSize.value=r.sdfGlyphSize,o.uTroikaSDFExponent.value=r.sdfExponent,o.uTroikaTotalBounds.value.fromArray(s),o.uTroikaUseGlyphColors.value=!n&&!!r.glyphColors;let c=0,u=0,d=0,f,p,g,y=0,w=0;if(n){let{outlineWidth:C,outlineOffsetX:P,outlineOffsetY:v,outlineBlur:T,outlineOpacity:A}=this;c=this._parsePercent(C)||0,u=Math.max(0,this._parsePercent(T)||0),f=A,y=this._parsePercent(P)||0,w=this._parsePercent(v)||0}else d=Math.max(0,this._parsePercent(this.strokeWidth)||0),d&&(g=this.strokeColor,o.uTroikaStrokeColor.value.set(g??wwe),p=this.strokeOpacity,p==null&&(p=1)),f=this.fillOpacity;o.uTroikaDistanceOffset.value=c,o.uTroikaPositionOffset.value.set(y,w),o.uTroikaBlurRadius.value=u,o.uTroikaStrokeWidth.value=d,o.uTroikaStrokeOpacity.value=p,o.uTroikaFillOpacity.value=f??1,o.uTroikaCurveRadius.value=this.curveRadius||0;let b=this.clipRect;if(b&&Array.isArray(b)&&b.length===4)o.uTroikaClipRect.value.fromArray(b);else{const C=(this.fontSize||.1)*100;o.uTroikaClipRect.value.set(s[0]-C,s[1]-C,s[2]+C,s[3]+C)}this.geometry.applyClipRect(o.uTroikaClipRect.value)}o.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const i=n?this.outlineColor||0:this.color;if(i==null)delete e.color;else{const l=e.hasOwnProperty("color")?e.color:e.color=new rr;(i!==l._input||typeof i=="object")&&l.set(l._input=i)}let a=this.orientation||bre;if(a!==e._orientation){let l=o.uTroikaOrient.value;a=a.replace(/[^-+xyz]/g,"");let s=a!==bre&&a.match(/^([-+])([xyz])([-+])([xyz])$/);if(s){let[,c,u,d,f]=s;dY.set(0,0,0)[u]=c==="-"?1:-1,xre.set(0,0,0)[f]=d==="-"?-1:1,vwe.lookAt(e4t,dY.cross(xre),xre),l.setFromMatrix4(vwe)}else l.identity();e._orientation=a}}_parsePercent(e){if(typeof e=="string"){let n=e.match(/^(-?[\d.]+)%$/),o=n?parseFloat(n[1]):NaN;e=(isNaN(o)?0:o/100)*this.fontSize}return e}localPositionToTextCoords(e,n=new Xt){n.copy(e);const o=this.curveRadius;return o&&(n.x=Math.atan2(e.x,Math.abs(o)-Math.abs(e.z))*Math.abs(o)),n}worldPositionToTextCoords(e,n=new Xt){return dY.copy(e),this.localPositionToTextCoords(this.worldToLocal(dY),n)}raycast(e,n){const{textRenderInfo:o,curveRadius:r}=this;if(o){const i=o.blockBounds,a=r?pje():hje(),l=a.geometry,{position:s,uv:c}=l.attributes;for(let u=0;u{this[o]=e[o]}),this}clone(){return new this.constructor().copy(this)}};gje.forEach(t=>{const e="_private_"+t;Object.defineProperty(mje.prototype,t,{get(){return this[e]},set(n){n!==this[e]&&(this[e]=n,this._needsSync=!0)}})});const r4t=m.forwardRef(({sdfGlyphSize:t=64,anchorX:e="center",anchorY:n="middle",font:o,fontSize:r=1,children:i,characters:a,onSync:l,...s},c)=>{const u=oi(({invalidate:g})=>g),[d]=m.useState(()=>new mje),[f,p]=m.useMemo(()=>{const g=[];let y="";return m.Children.forEach(i,w=>{typeof w=="string"||typeof w=="number"?y+=w:g.push(w)}),[g,y]},[i]);return zUe(()=>new Promise(g=>jAt({font:o,characters:a},g)),["troika-text",o,a]),m.useLayoutEffect(()=>void d.sync(()=>{u(),l&&l(d)})),m.useEffect(()=>()=>d.dispose(),[d]),m.createElement("primitive",U9({object:d,ref:c,font:o,text:p,anchorX:e,anchorY:n,fontSize:r,sdfGlyphSize:t},s),f)}),bwe=t=>t===Object(t)&&!Array.isArray(t)&&typeof t!="function";function bb(t,e){const n=oi(r=>r.gl),o=o3(df,bwe(t)?Object.values(t):t);if(m.useLayoutEffect(()=>{e==null||e(o)},[e]),m.useEffect(()=>{"initTexture"in n&&(Array.isArray(o)?o:[o]).forEach(n.initTexture)},[n,o]),bwe(t)){const r=Object.keys(t),i={};return r.forEach(a=>Object.assign(i,{[a]:o[r.indexOf(a)]})),i}else return o}bb.preload=t=>o3.preload(df,t);bb.clear=t=>o3.clear(df,t);function yje(t,e,n){const o=oi(f=>f.size),r=oi(f=>f.viewport),i=typeof t=="number"?t:o.width*r.dpr,a=o.height*r.dpr,l=(typeof t=="number"?n:t)||{},{samples:s=0,depth:c,...u}=l,d=m.useMemo(()=>{const f=new $m(i,a,{minFilter:Gs,magFilter:Gs,type:jx,...u});return c&&(f.depthTexture=new U1e(i,a,v2)),f.samples=s,f},[]);return m.useLayoutEffect(()=>{d.setSize(i,a),s&&(d.samples=s)},[s,d,i,a]),m.useEffect(()=>()=>d.dispose(),[]),d}const i4t=t=>typeof t=="function",a4t=m.forwardRef(({envMap:t,resolution:e=256,frames:n=1/0,children:o,makeDefault:r,...i},a)=>{const l=oi(({set:w})=>w),s=oi(({camera:w})=>w),c=oi(({size:w})=>w),u=m.useRef(null),d=m.useRef(null),f=yje(e);m.useLayoutEffect(()=>{i.manual||u.current.updateProjectionMatrix()},[c,i]),m.useLayoutEffect(()=>{u.current.updateProjectionMatrix()}),m.useLayoutEffect(()=>{if(r){const w=s;return l(()=>({camera:u.current})),()=>l(()=>({camera:w}))}},[u,r,l]);let p=0,g=null;const y=i4t(o);return ay(w=>{y&&(n===1/0||ptypeof t=="function",s4t=m.forwardRef(({envMap:t,resolution:e=256,frames:n=1/0,makeDefault:o,children:r,...i},a)=>{const l=oi(({set:w})=>w),s=oi(({camera:w})=>w),c=oi(({size:w})=>w),u=m.useRef(null),d=m.useRef(null),f=yje(e);m.useLayoutEffect(()=>{i.manual||(u.current.aspect=c.width/c.height)},[c,i]),m.useLayoutEffect(()=>{u.current.updateProjectionMatrix()});let p=0,g=null;const y=l4t(r);return ay(w=>{y&&(n===1/0||p{if(o){const w=s;return l(()=>({camera:u.current})),()=>l(()=>({camera:w}))}},[u,o,l]),m.createElement(m.Fragment,null,m.createElement("perspectiveCamera",U9({ref:fge([u,a])},i),!y&&r),m.createElement("group",{ref:d},y&&r(f.texture)))});function fA(t,e){const n=t+"Geometry";return m.forwardRef(({args:o,children:r,...i},a)=>{const l=m.useRef(null);return m.useImperativeHandle(a,()=>l.current),m.useLayoutEffect(()=>void(e==null?void 0:e(l.current))),m.createElement("mesh",U9({ref:l},i),m.createElement(n,{attach:"geometry",args:o}),r)})}const Qr=fA("box"),lR=fA("circle"),Rd=fA("cone"),ca=fA("cylinder"),ds=fA("sphere"),ua=fA("plane"),mge=fA("torus"),sR=fA("ring"),nw=fA("extrude"),K5=1e-5;function c4t(t,e,n){const o=new Fl,r=n-K5;return o.absarc(K5,K5,K5,-Math.PI/2,-Math.PI,!0),o.absarc(K5,e-r*2,K5,Math.PI,Math.PI/2,!0),o.absarc(t-r*2,e-r*2,K5,Math.PI/2,0,!0),o.absarc(t-r*2,K5,K5,0,-Math.PI/2,!0),o}const u4t=m.forwardRef(function({args:[e=1,n=1,o=1]=[],radius:r=.05,steps:i=1,smoothness:a=4,bevelSegments:l=4,creaseAngle:s=.4,children:c,...u},d){const f=m.useMemo(()=>c4t(e,n,r),[e,n,r]),p=m.useMemo(()=>({depth:o-r*2,bevelEnabled:!0,bevelSegments:l*2,steps:i,bevelSize:r-K5,bevelThickness:r,curveSegments:a}),[o,r,a]),g=m.useRef(null);return m.useLayoutEffect(()=>{g.current&&(g.current.center(),lAt(g.current,s))},[f,p]),m.createElement("mesh",U9({ref:d},u),m.createElement("extrudeGeometry",{ref:g,args:[f,p]}),c)});var Aje={exports:{}},d4t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",f4t=d4t,h4t=f4t;function wje(){}function vje(){}vje.resetWarningCache=wje;var p4t=function(){function t(o,r,i,a,l,s){if(s!==h4t){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:vje,resetWarningCache:wje};return n.PropTypes=n,n};Aje.exports=p4t();var Lq=Aje.exports;const go=Fi(Lq),Fn=GK()((t,e)=>({setEnableOrbitController:n=>{H.getState().viewState.navigationView||t(o=>{var r;return(r=o.orbitControlsRef)!=null&&r.current&&(o.orbitControlsRef.current.enabled=n),o})},selectNone:()=>{t({humanRef:null,treeRef:null,foundationRef:null})},contentRef:null,compassRef:null,orbitControlsRef:null,humanRef:null,treeRef:null,flowerRef:null,foundationRef:null,cuboidRef:null,listenToAutoDeletionByCutRef:null,listenToAutoDeletionByDeleteRef:null,setListenToAutoDeletionByCut:n=>{const o=e().listenToAutoDeletionByCutRef;o&&(o.current=n)},setListenToAutoDeletionByDelete:n=>{const o=e().listenToAutoDeletionByDeleteRef;o&&(o.current=n)},canvas:null,pointer:new Xt,solarPanelCountRef:null}));var Ti=(t=>(t.Default="Default",t.Arched="Arched",t.Circular="Circular",t.Polygonal="Polygonal",t))(Ti||{});const xje="/aladdin/assets/jaah-XpG2K-Xo.png",bje="/aladdin/assets/jack-DVed1dhl.png",Sje="/aladdin/assets/jacob-D-6uVZRV.png",Tje="/aladdin/assets/jacqueline-DZtJs4FX.png",Pje="/aladdin/assets/jade-Cxa-afE4.png",Cje="/aladdin/assets/jamelia-Bmq4EsGl.png",Rje="/aladdin/assets/james-QtBSrtsa.png",Hje="/aladdin/assets/jane-ZqCTWK8F.png",Mje="/aladdin/assets/jaya-DD0RNxX8.png",Ije="/aladdin/assets/jaye-DPA2kSta.png",zje="/aladdin/assets/jeanette-D3EEzZKV.png",Dje="/aladdin/assets/jedi-CUm23-QH.png",Eje="/aladdin/assets/jeff-931UF5LC.png",Fje="/aladdin/assets/jena-qnIKFCdf.png",kje="/aladdin/assets/jennifer-Cvadr5-Q.png",Lje="/aladdin/assets/jess-DyGUx_b1.png",Wje="/aladdin/assets/jett-B01M7z86.png",Nje="/aladdin/assets/jill-CxIC2A4v.png",Uje="/aladdin/assets/jiya-CF0SpO2m.png",jje="/aladdin/assets/joan-DWpjHIrM.png",Bje="/aladdin/assets/jocelyn-DGLHmbKA.png",Yje="/aladdin/assets/joel-DhW3d8dZ.png",Oje="/aladdin/assets/joey-Dmd3kcA2.png",_je="/aladdin/assets/john-QF2zQU-p.png",Vje="/aladdin/assets/jonathon-TM1sY2jf.png",Gje="/aladdin/assets/jose-CtYKGQoQ.png",Xje="/aladdin/assets/joseph-C7wga7kl.png",Jje="/aladdin/assets/joshua-CqTzsm-K.png",Kje="/aladdin/assets/judd-C8GabaWl.png",qje="/aladdin/assets/judy-Cv4UEjOl.png",$je="/aladdin/assets/julia-Ckjw2r2H.png",Qje="/aladdin/assets/julio-CPCcOGMU.png",Zje="/aladdin/assets/jumapili-TjSAWyhv.png",eBe="/aladdin/assets/june-Bkxc2WDe.png",tBe="/aladdin/assets/juro-BAi3R6Hw.png",nBe="/aladdin/assets/justin-DLG1o6Q7.png";class Fp{static fetchGender(e){switch(e){case Yt.Jaah:return Ha.Male;case Yt.Jacqueline:return Ha.Female;case Yt.Jade:return Ha.Female;case Yt.Jamelia:return Ha.Female;case Yt.James:return Ha.Male;case Yt.Jane:return Ha.Female;case Yt.Jaya:return Ha.Female;case Yt.Jaye:return Ha.Male;case Yt.Jeanette:return Ha.Female;case Yt.Jedi:return Ha.Male;case Yt.Jeff:return Ha.Male;case Yt.Jena:return Ha.Female;case Yt.Jennifer:return Ha.Female;case Yt.Jess:return Ha.Female;case Yt.Jett:return Ha.Male;case Yt.Jill:return Ha.Female;case Yt.Jiya:return Ha.Female;case Yt.Joan:return Ha.Female;case Yt.Jocelyn:return Ha.Female;case Yt.Joel:return Ha.Male;case Yt.Joey:return Ha.Female;case Yt.John:return Ha.Male;case Yt.Jonathon:return Ha.Male;case Yt.Jose:return Ha.Male;case Yt.Joseph:return Ha.Male;case Yt.Joshua:return Ha.Male;case Yt.Judd:return Ha.Male;case Yt.Judy:return Ha.Female;case Yt.Julia:return Ha.Female;case Yt.Julio:return Ha.Male;case Yt.Jumapili:return Ha.Female;case Yt.June:return Ha.Female;case Yt.Juro:return Ha.Male;case Yt.Justin:return Ha.Male;default:return Ha.Male}}static fetchLabel(e,n){switch(e){case Yt.Jaah:return Y.t("people.Jaah",n);case Yt.Jacob:return Y.t("people.Jacob",n);case Yt.Jacqueline:return Y.t("people.Jacqueline",n);case Yt.Jade:return Y.t("people.Jade",n);case Yt.Jamelia:return Y.t("people.Jamelia",n);case Yt.James:return Y.t("people.James",n);case Yt.Jane:return Y.t("people.Jane",n);case Yt.Jaya:return Y.t("people.Jaya",n);case Yt.Jaye:return Y.t("people.Jaye",n);case Yt.Jeanette:return Y.t("people.Jeanette",n);case Yt.Jedi:return Y.t("people.Jedi",n);case Yt.Jeff:return Y.t("people.Jeff",n);case Yt.Jena:return Y.t("people.Jena",n);case Yt.Jennifer:return Y.t("people.Jennifer",n);case Yt.Jess:return Y.t("people.Jess",n);case Yt.Jett:return Y.t("people.Jett",n);case Yt.Jill:return Y.t("people.Jill",n);case Yt.Jiya:return Y.t("people.Jiya",n);case Yt.Joan:return Y.t("people.Joan",n);case Yt.Jocelyn:return Y.t("people.Jocelyn",n);case Yt.Joel:return Y.t("people.Joel",n);case Yt.Joey:return Y.t("people.Joey",n);case Yt.John:return Y.t("people.John",n);case Yt.Jonathon:return Y.t("people.Jonathon",n);case Yt.Jose:return Y.t("people.Jose",n);case Yt.Joseph:return Y.t("people.Joseph",n);case Yt.Joshua:return Y.t("people.Joshua",n);case Yt.Judd:return Y.t("people.Judd",n);case Yt.Judy:return Y.t("people.Judy",n);case Yt.Julia:return Y.t("people.Julia",n);case Yt.Julio:return Y.t("people.Julio",n);case Yt.Jumapili:return Y.t("people.Jumapili",n);case Yt.June:return Y.t("people.June",n);case Yt.Juro:return Y.t("people.Juro",n);case Yt.Justin:return Y.t("people.Justin",n);default:return Y.t("people.Jack",n)}}static fetchHatOffsetY(e){switch(e){case Yt.Jonathon:return-.22}return 0}static fetchHatOffsetX(e){switch(e){case Yt.Jaah:return-.05;case Yt.Jack:return-.05;case Yt.Jacob:return .09;case Yt.Jade:return-.04;case Yt.Jaya:return .04;case Yt.Jaye:return 0;case Yt.Jamelia:return .05;case Yt.Jane:return .02;case Yt.Jeanette:return .08;case Yt.Jedi:return-.02;case Yt.Jeff:return-.05;case Yt.Jena:return .05;case Yt.Jennifer:return .02;case Yt.Jess:return .01;case Yt.Jett:return-.04;case Yt.Jill:return-.03;case Yt.Jiya:return-.03;case Yt.Joan:return-.45;case Yt.Jocelyn:return-.01;case Yt.Joel:return-.48;case Yt.Joey:return .01;case Yt.John:return .01;case Yt.Jonathon:return .02;case Yt.Jose:return .05;case Yt.Joseph:return .05;case Yt.Joshua:return-.01;case Yt.Judy:return .02;case Yt.Julia:return-.02;case Yt.Jumapili:return-.04;case Yt.June:return-.1;case Yt.Juro:return-.08;case Yt.Justin:return-.06;default:return 0}}static fetchHeight(e){switch(e){case Yt.Jaah:return 1.78;case Yt.Jack:return 1.8;case Yt.Jacob:return 1.82;case Yt.Jacqueline:return 1.78;case Yt.Jade:return 1.6;case Yt.James:return 1.75;case Yt.Jane:return 1.67;case Yt.Jaya:return 1.55;case Yt.Jaye:return 1.65;case Yt.Jamelia:return 1.8;case Yt.Jeanette:return 1.62;case Yt.Jedi:return 1.75;case Yt.Jeff:return 1.65;case Yt.Jena:return 1.6;case Yt.Jennifer:return 1.7;case Yt.Jess:return 1.5;case Yt.Jett:return 1.85;case Yt.Jill:return 1.71;case Yt.Jiya:return 1.74;case Yt.Joan:return 1.68;case Yt.Jocelyn:return 1.72;case Yt.Joel:return 1.75;case Yt.Joey:return 1.72;case Yt.John:return 1.85;case Yt.Jonathon:return 1.9;case Yt.Jose:return 1.6;case Yt.Joseph:return 1.88;case Yt.Joshua:return 1.79;case Yt.Judd:return 1.68;case Yt.Judy:return 1.75;case Yt.Julia:return 1.71;case Yt.Julio:return 1.76;case Yt.Jumapili:return 1.65;case Yt.June:return 1.85;case Yt.Juro:return 1.72;case Yt.Justin:return 1.755;default:return 1.8}}static fetchWidth(e){switch(e){case Yt.Jaah:return .74;case Yt.Jack:return .42;case Yt.Jacqueline:return .43;case Yt.Jacob:return .8;case Yt.Jade:return .48;case Yt.James:return .472;case Yt.Jane:return .4;case Yt.Jaya:return .6;case Yt.Jaye:return .55;case Yt.Jamelia:return .65;case Yt.Jeanette:return .4;case Yt.Jedi:return .56;case Yt.Jena:return .695;case Yt.Jennifer:return .45;case Yt.Jess:return .43;case Yt.Jill:return .42;case Yt.Joan:return 1.7;case Yt.Jocelyn:return .4;case Yt.Joel:return 1.8;case Yt.Joey:return .462;case Yt.John:return .6;case Yt.Jonathon:return .6;case Yt.Jose:return 2;case Yt.Joseph:return .6;case Yt.Joshua:return .5;case Yt.Judd:return .544;case Yt.Judy:return .41;case Yt.Julia:return .43;case Yt.Julio:return .5;case Yt.Jumapili:return .75;case Yt.June:return .65;case Yt.Juro:return .494;case Yt.Justin:return .6;default:return .6}}static fetchTextureImage(e){let n;switch(e){case Yt.Jaah:n=xje;break;case Yt.Jacob:n=Sje;break;case Yt.Jacqueline:n=Tje;break;case Yt.Jade:n=Pje;break;case Yt.Jamelia:n=Cje;break;case Yt.James:n=Rje;break;case Yt.Jane:n=Hje;break;case Yt.Jaya:n=Mje;break;case Yt.Jaye:n=Ije;break;case Yt.Jeanette:n=zje;break;case Yt.Jedi:n=Dje;break;case Yt.Jeff:n=Eje;break;case Yt.Jena:n=Fje;break;case Yt.Jennifer:n=kje;break;case Yt.Jess:n=Lje;break;case Yt.Jett:n=Wje;break;case Yt.Jill:n=Nje;break;case Yt.Jiya:n=Uje;break;case Yt.Joan:n=jje;break;case Yt.Jocelyn:n=Bje;break;case Yt.Joel:n=Yje;break;case Yt.Joey:n=Oje;break;case Yt.John:n=_je;break;case Yt.Jonathon:n=Vje;break;case Yt.Jose:n=Gje;break;case Yt.Joseph:n=Xje;break;case Yt.Joshua:n=Jje;break;case Yt.Judd:n=Kje;break;case Yt.Judy:n=qje;break;case Yt.Julia:n=$je;break;case Yt.Julio:n=Qje;break;case Yt.Jumapili:n=Zje;break;case Yt.June:n=eBe;break;case Yt.Juro:n=tBe;break;case Yt.Justin:n=nBe;break;default:n=bje}return n}}const g4t="/aladdin/assets/no_leaf_flower-CjefG9cq.png",m4t="/aladdin/assets/no_leaf_shrub-DDlKdxg_.png",oBe="/aladdin/assets/bellflower-C5sA-Fge.png",Yce="/aladdin/assets/boxwood-cAqkPwU6.png",Oce="/aladdin/assets/cactus_combo_1-DgrI_pBB.png",_ce="/aladdin/assets/cactus_combo_2-CnD7zsEV.png",Vce="/aladdin/assets/cactus_combo_3-CTLr6iHA.png",Gce="/aladdin/assets/cactus_combo_4-Bv3aYeWB.png",rBe="/aladdin/assets/hibiscus-DqTQjw28.png",iBe="/aladdin/assets/hydrangea-D6uimbNa.png",aBe="/aladdin/assets/hosta-Ds5QIDtm.png",lBe="/aladdin/assets/peony-pnxufFxy.png",sBe="/aladdin/assets/red_rose-BhP67K90.png",cBe="/aladdin/assets/spirea-aOcGALMo.png",uBe="/aladdin/assets/sunflower-l75w306z.png",Xce="/aladdin/assets/tall_bush-g5bJ_GuV.png",dBe="/aladdin/assets/tulip-BqSv3XYD.png",fBe="/aladdin/assets/white_flower-BUfV78a-.png",hBe="/aladdin/assets/yellow_flower-BQ5dOM0H.png";class p8{static fetchSpread(e){switch(e){case ro.Bellflower:return .45;case ro.Boxwood:return 1.6;case ro.CactusCombo1:return 1;case ro.CactusCombo2:return 1;case ro.CactusCombo3:return 1;case ro.CactusCombo4:return 1;case ro.Hosta:return 1;case ro.Hibiscus:return 2;case ro.Hydrangea:return 2;case ro.Peony:return 1.5;case ro.RedRose:return .5;case ro.Spirea:return 1.8;case ro.Sunflower:return 1;case ro.TallBush:return 1;case ro.Tulip:return .4;case ro.YellowFlower:return 2;default:return .8}}static fetchHeight(e){switch(e){case ro.Bellflower:return .4;case ro.Boxwood:return 1.44;case ro.CactusCombo1:return 1.18;case ro.CactusCombo2:return 1.35;case ro.CactusCombo3:return 1.24;case ro.CactusCombo4:return 1.35;case ro.Hosta:return .7;case ro.Hibiscus:return 1.7;case ro.Hydrangea:return 1.5;case ro.Peony:return 1;case ro.RedRose:return .8;case ro.Spirea:return 1.6;case ro.Sunflower:return 2;case ro.TallBush:return 2;case ro.Tulip:return .7;case ro.YellowFlower:return 1.4;default:return .5}}static fetchLabel(e,n){switch(e){case ro.Bellflower:return Y.t("flower.Bellflower",n);case ro.Boxwood:return Y.t("flower.Boxwood",n);case ro.CactusCombo1:return Y.t("flower.CactusCombo1",n);case ro.CactusCombo2:return Y.t("flower.CactusCombo2",n);case ro.CactusCombo3:return Y.t("flower.CactusCombo3",n);case ro.CactusCombo4:return Y.t("flower.CactusCombo4",n);case ro.Hibiscus:return Y.t("flower.Hibiscus",n);case ro.Hydrangea:return Y.t("flower.Hydrangea",n);case ro.Hosta:return Y.t("flower.Hosta",n);case ro.Peony:return Y.t("flower.Peony",n);case ro.RedRose:return Y.t("flower.RedRose",n);case ro.Spirea:return Y.t("flower.Spirea",n);case ro.Sunflower:return Y.t("flower.Sunflower",n);case ro.TallBush:return Y.t("flower.TallBush",n);case ro.Tulip:return Y.t("flower.Tulip",n);case ro.YellowFlower:return Y.t("flower.YellowFlower",n);default:return Y.t("flower.WhiteFlower",n)}}static fetchTextureImage(e,n){if(n)return e===ro.Hibiscus||e===ro.Hydrangea||e===ro.YellowFlower||e===ro.Spirea?m4t:e===ro.Boxwood?Yce:e===ro.TallBush?Xce:e===ro.CactusCombo1?Oce:e===ro.CactusCombo2?_ce:e===ro.CactusCombo3?Vce:e===ro.CactusCombo4?Gce:g4t;let o;switch(e){case ro.Bellflower:o=oBe;break;case ro.Boxwood:o=Yce;break;case ro.CactusCombo1:o=Oce;break;case ro.CactusCombo2:o=_ce;break;case ro.CactusCombo3:o=Vce;break;case ro.CactusCombo4:o=Gce;break;case ro.Hibiscus:o=rBe;break;case ro.Hydrangea:o=iBe;break;case ro.Hosta:o=aBe;break;case ro.Peony:o=lBe;break;case ro.RedRose:o=sBe;break;case ro.Spirea:o=cBe;break;case ro.Sunflower:o=uBe;break;case ro.TallBush:o=Xce;break;case ro.Tulip:o=dBe;break;case ro.YellowFlower:o=hBe;break;default:o=fBe}return o}}class Ga{static makeHuman(e,n,o,r,i){return{type:z.Human,name:e??Yt.Jack,cx:o,cy:r,cz:i,lx:Fp.fetchWidth(e??Yt.Jack),lz:Fp.fetchHeight(e??Yt.Jack),normal:[0,1,0],rotation:[0,0,0],parentId:n,id:Xi.generate()}}static makeTree(e,n,o,r,i,a,l){return{type:z.Tree,name:e??pr.Dogwood,cx:i,cy:a,cz:l,lx:n??3,lz:o??4,normal:[0,1,0],rotation:[0,0,0],parentId:r,id:Xi.generate()}}static makeSolarPanel(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y,w){let b;switch(e.type){case z.Foundation:b=e.id,w=z.Foundation;break;case z.Cuboid:b=e.id,w=z.Cuboid;break;case z.Wall:case z.Roof:b=e.parentId;break}return{type:z.SolarPanel,pvModelName:n.name,trackerType:za.NO_TRACKER,relativeAzimuth:u??0,tiltAngle:c??0,orientation:a??vr.landscape,drawSunBeam:!1,poleHeight:l??1,poleRadius:.05,poleSpacing:s??3,cx:o,cy:r,cz:i,lx:g??(a===vr.landscape?n.length:n.width),ly:y??(a===vr.landscape?n.width:n.length),lz:n.thickness,showLabel:!1,normal:d?d.toArray():[0,0,1],rotation:f||[0,0,0],color:"#fff",frameColor:p??"white",parentType:w??e.type,parentId:e.id,foundationId:b,id:Xi.generate(),version:1}}static makeWaterHeater(e,n,o,r,i,a){return{type:z.WaterHeater,cx:n,cy:o,cz:r,lx:1.5,ly:2,lz:1,relativeAzimuth:0,showLabel:!1,normal:i?i.toArray():[0,0,1],rotation:a||[0,0,0],color:"#fff",parentType:e.type,parentId:e.id,foundationId:e.parentId,id:Xi.generate()}}static makePowerWall(e,n,o,r){return{type:z.BatteryStorage,id:Xi.generate(),parentId:e.id,foundationId:e.parentId,cx:n,cy:o,cz:r,lx:1,ly:.35,lz:1.6,normal:[0,-1,0],rotation:[0,0,0],color:"#C7BABE"}}static makeFlower(e,n,o,r,i){return{type:z.Flower,name:e??ro.YellowFlower,cx:o,cy:r,cz:i,lx:p8.fetchSpread(e??ro.YellowFlower),lz:p8.fetchHeight(e??ro.YellowFlower),normal:[0,1,0],rotation:[0,0,0],parentId:n,id:Xi.generate()}}static makeCuboid(e,n,o,r,i){return{type:z.Cuboid,cx:e,cy:n,cz:o?o/2:2,lx:.1,ly:.1,lz:o??4,color:"#808080",faceColors:r??["#808080","#808080","#808080","#808080","#808080","#808080"],textureTypes:i??[Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture],stackable:H.getState().actionState.cuboidStackable,transparency:H.getState().actionState.cuboidTransparency,normal:[0,0,1],rotation:[0,0,0],parentId:Zo,selected:!1,id:Xi.generate()}}static makeFoundation(e,n,o,r,i){return{type:z.Foundation,cx:e,cy:n,cz:o?o/2:.05,lx:0,ly:0,lz:o??.1,normal:[0,0,1],rotation:[0,0,0],parentId:Zo,selected:!1,color:r??"#808080",textureType:i??Yi.NoTexture,solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},id:Xi.generate()}}static makeParabolicTrough(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y){let w;switch(e.type){case z.Foundation:w=e.id;break}return{type:z.ParabolicTrough,reflectance:n??.9,absorptance:o??.95,opticalEfficiency:r??.7,thermalEfficiency:i??.3,moduleLength:s??3,latusRectum:a??2,relativeAzimuth:0,tiltAngle:0,absorberTubeRadius:.05,drawSunBeam:!1,poleHeight:l??.2,poleRadius:.05,cx:c,cy:u,cz:d,lx:g??2,ly:y??9,lz:.1,showLabel:!1,normal:f?f.toArray():[0,0,1],rotation:p||[0,0,0],parentId:e.id,foundationId:w,id:Xi.generate()}}static makeParabolicDish(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y){let w;switch(e.type){case z.Foundation:w=e.id;break}return{type:z.ParabolicDish,reflectance:n??.9,absorptance:o??.95,opticalEfficiency:r??.7,thermalEfficiency:i??.3,moduleLength:3,latusRectum:a??8,relativeAzimuth:0,tiltAngle:0,structureType:s??uf.CentralPole,receiverRadius:.25,receiverPoleRadius:.1,drawSunBeam:!1,poleHeight:l??.2,poleRadius:.2,cx:c,cy:u,cz:d,lx:g??4,ly:y??4,lz:.1,showLabel:!1,normal:f?f.toArray():[0,0,1],rotation:p||[0,0,0],parentId:e.id,foundationId:w,id:Xi.generate()}}static makeFresnelReflector(e,n,o,r,i,a,l,s,c,u,d,f){let p;switch(e.type){case z.Foundation:p=e.id;break}return{type:z.FresnelReflector,receiverId:n??"None",reflectance:o??.9,moduleLength:i??3,relativeAzimuth:0,tiltAngle:0,drawSunBeam:!1,poleHeight:r??.2,poleRadius:.05,cx:a,cy:l,cz:s,lx:d??2,ly:f??9,lz:.1,showLabel:!1,normal:c?c.toArray():[0,0,1],rotation:u||[0,0,0],parentId:e.id,foundationId:p,id:Xi.generate()}}static makeWindTurbine(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y,w,b,C,P){let v;switch(e.type){case z.Foundation:v=e.id;break}return{type:z.WindTurbine,birdSafe:n,bladeColor:o,stripeColor:r,numberOfBlades:i,initialRotorAngle:a,relativeYawAngle:l,pitchAngle:s,bladeRadius:c,bladeTipWidth:.2,bladeRootRadius:u,maximumChordRadius:f,maximumChordLength:d,towerRadius:p,towerHeight:g,hubRadius:y,hubLength:w,cx:b,cy:C,cz:P,lx:p*4,ly:p*4,lz:g+c,normal:[0,0,1],rotation:[0,0,0],parentId:e.id,foundationId:v,id:Xi.generate()}}static makeHeliostat(e,n,o,r,i,a,l,s,c,u,d){let f;switch(e.type){case z.Foundation:f=e.id;break}return{type:z.Heliostat,towerId:n??"None",reflectance:o??.9,relativeAzimuth:0,tiltAngle:0,drawSunBeam:!1,poleHeight:r??.2,poleRadius:.1,cx:i,cy:a,cz:l,lx:u??2,ly:d??4,lz:.1,showLabel:!1,normal:s?s.toArray():[0,0,1],rotation:c||[0,0,0],parentId:e.id,foundationId:f,id:Xi.generate()}}static makePolygon(e,n,o,r,i,a,l){let s;switch(e.type){case z.Foundation:case z.Cuboid:s=e.id;break;case z.Wall:case z.Roof:s=e.parentId;break}const c=.2,u=.2,d=.2;let f=n,p=o;return e.type===z.Cuboid&&i?me.isUnitVectorX(i)?f=r:me.isUnitVectorY(i)&&(p=r):e.type===z.Wall&&(p=r),{type:z.Polygon,cx:f,cy:p,cz:0,lx:2*c,ly:2*u,lz:2*d,color:"#ffffff",normal:i?i.toArray():[0,0,1],rotation:a||[0,0,0],vertices:[{x:Math.max(-.5,f-c),y:Math.max(-.5,p-u)},{x:Math.max(-.5,f-c),y:Math.min(.5,p+u)},{x:Math.min(.5,f+c),y:Math.min(.5,p+u)},{x:Math.min(.5,f+c),y:Math.max(-.5,p-u)}],parentId:e.id,parentType:l,foundationId:s,selected:!1,filled:!0,selectedIndex:-1,id:Xi.generate()}}static makeWall(e,n,o,r,i){const a=H.getState().actionState;return{type:z.Wall,cx:n,cy:o,cz:r,lx:0,ly:a.wallThickness??.3,lz:a.wallHeight??5,parapet:a.wallParapet,eavesLength:a.wallEavesLength??.3,rValue:a.wallRValue??3,fill:El.Full,leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:a.wallHeight-.5,rightTopPartialHeight:a.wallHeight-.5,relativeAngle:0,leftPoint:[],rightPoint:[],leftJoints:[],rightJoints:[],textureType:a.wallTexture??Uo.Default,color:a.wallColor??"#ffffff",volumetricHeatCapacity:a.wallVolumetricHeatCapacity??.5,wallStructure:a.wallStructure??gc.Default,studSpacing:a.wallStructureSpacing??2,studWidth:a.wallStructureWidth??.1,studColor:a.wallStructureColor??"#ffffff",opacity:a.wallOpacity!==void 0?a.wallOpacity:.5,selected:!1,lineWidth:.2,lineColor:"#000000",windows:[],showLabel:!1,normal:i?i.toArray():[0,0,1],rotation:[0,0,0],parentId:e.id,foundationId:e.id,id:Xi.generate()}}static makeSensor(e,n,o,r,i,a){let l;switch(e.type){case z.Foundation:case z.Cuboid:l=e.id;break;case z.Wall:case z.Roof:l=e.parentId;break}return{type:z.Sensor,cx:n,cy:o,cz:r,lx:.1,ly:.1,lz:.01,showLabel:!1,normal:i?i.toArray():[0,0,1],rotation:a||[0,0,0],parentId:e.id,foundationId:l,parentType:e.type,id:Xi.generate()}}static makeLight(e,n,o,r,i,a,l,s,c,u){let d;switch(e.type){case z.Foundation:case z.Cuboid:d=e.id;break;case z.Wall:case z.Roof:d=e.parentId;break}return{type:z.Light,decay:n??2,distance:o??5,intensity:r??3,color:i??"#ffff99",cx:a,cy:l,cz:s,lx:.16,ly:.16,lz:.08,showLabel:!1,normal:c?c.toArray():[0,0,1],rotation:u||[0,0,0],parentId:e.id,foundationId:d,parentType:e.type,id:Xi.generate()}}static makeWindow(e,n,o,r,i,a,l=0,s=0){let c,u=0;switch(e.type){case z.Cuboid:c=e.id;break;case z.Wall:c=e.parentId,u=e.ly;break;case z.Roof:c=e.parentId,u=e.thickness;break}const d=H.getState().actionState;return{type:z.Window,cx:n,cy:o,cz:r,lx:l,ly:u,lz:s,leftShutter:d.windowShutterLeft,rightShutter:d.windowShutterRight,shutterColor:d.windowShutterColor,shutterWidth:d.windowShutterWidth,horizontalMullion:d.windowHorizontalMullion,verticalMullion:d.windowVerticalMullion,mullionWidth:d.windowMullionWidth,horizontalMullionSpacing:d.windowHorizontalMullionSpacing,verticalMullionSpacing:d.windowVerticalMullionSpacing,mullionColor:d.windowMullionColor,frame:d.windowFrame,frameWidth:d.windowFrameWidth,sillWidth:Cn.isTypeRoof(i)?0:d.windowSillWidth,windowType:d.windowType,empty:d.windowEmpty,interior:d.windowInterior,archHeight:d.windowArchHeight,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,color:d.windowColor??"#ffffff",tint:d.windowTint??"#73D8FF",opacity:d.windowOpacity!==void 0?d.windowOpacity:.5,uValue:d.windowUValue??.5,normal:[0,-1,0],rotation:a?[...a]:[0,0,0],parentId:e.id,parentType:i,foundationId:c,id:Xi.generate()}}static makeDoor(e){let n;switch(e.type){case z.Cuboid:n=e.id;break;case z.Wall:n=e.parentId;break}const o=H.getState().actionState;return{type:z.Door,cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,doorType:o.doorType,filled:o.doorFilled,interior:o.doorInterior,archHeight:o.doorArchHeight,textureType:o.doorTexture??sr.Default,color:o.doorColor??"#ffffff",uValue:o.doorUValue??.5,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:e.id,foundationId:n,id:Xi.generate()}}static makePyramidRoof(e,n){const o=H.getState().actionState;return{type:z.Roof,cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,ceiling:o.roofCeiling??!1,rise:o.roofRise<0?2:o.roofRise,thickness:o.roofThickness??.2,rValue:o.roofRValue??3,color:o.roofColor??"#454769",sideColor:o.roofSideColor??"#ffffff",textureType:o.roofTexture??Ur.Default,roofType:Go.Pyramid,roofStructure:wc.Default,wallsId:[...e],selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:n.id,foundationId:n.id,id:Xi.generate()}}static makeGableRoof(e,n){const o=H.getState().actionState;return{type:z.Roof,cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,ceiling:o.roofCeiling??!1,rise:o.roofRise<0?2:o.roofRise,thickness:o.roofThickness??.2,rValue:o.roofRValue??3,color:o.roofColor??"#454769",sideColor:o.roofSideColor??"#ffffff",textureType:o.roofTexture??Ur.Default,roofType:Go.Gable,roofStructure:wc.Default,wallsId:[...e],selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:n.id,foundationId:n.id,id:Xi.generate(),ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1]}}static makeHipRoof(e,n,o){const r=H.getState().actionState;return{type:z.Roof,cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,ceiling:r.roofCeiling??!1,rise:r.roofRise<0?2:r.roofRise,thickness:r.roofThickness??.2,rValue:r.roofRValue??3,color:r.roofColor??"#454769",sideColor:r.roofSideColor??"#ffffff",textureType:r.roofTexture??Ur.Default,roofType:Go.Hip,roofStructure:wc.Default,wallsId:[...e],selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:n.id,foundationId:n.id,id:Xi.generate(),leftRidgeLength:(o??2)/2,rightRidgeLength:(o??2)/2}}static makeGambrelRoof(e,n){const r=H.getState().actionState;return{type:z.Roof,cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,ceiling:r.roofCeiling??!1,rise:r.roofRise<0?2:r.roofRise,thickness:r.roofThickness??.2,rValue:r.roofRValue??3,color:r.roofColor??"#454769",sideColor:r.roofSideColor??"#ffffff",textureType:r.roofTexture??Ur.Default,roofType:Go.Gambrel,roofStructure:wc.Default,wallsId:[...e],topRidgePoint:[0,1],frontRidgePoint:[.35,.5],backRidgePoint:[.35,.5],selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:n.id,foundationId:n.id,id:Xi.generate()}}static makeMansardRoof(e,n){const o=H.getState().actionState;return{type:z.Roof,cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,ceiling:o.roofCeiling??!1,rise:o.roofRise<0?2:o.roofRise,thickness:o.roofThickness??.2,rValue:o.roofRValue??3,color:o.roofColor??"#454769",sideColor:o.roofSideColor??"#ffffff",textureType:o.roofTexture??Ur.Default,roofType:Go.Mansard,roofStructure:wc.Default,wallsId:[...e],ridgeWidth:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:n.id,foundationId:n.id,id:Xi.generate()}}}const y4t=t=>t.solarPanelArrayLayoutParams.pvModelName,A4t=t=>t.solarPanelArrayLayoutParams.rowAxis,w4t=t=>t.solarPanelArrayLayoutParams.rowsPerRack,v4t=t=>t.solarPanelArrayLayoutParams.interRowSpacing,x4t=t=>t.solarPanelArrayLayoutParams.margin,b4t=t=>t.solarPanelArrayLayoutParams.poleHeight,S4t=t=>t.solarPanelArrayLayoutParams.poleSpacing,T4t=t=>t.solarPanelArrayLayoutParams.tiltAngle,P4t=t=>t.solarPanelArrayLayoutParams.orientation,Wq=t=>t.viewState.navigationView,Ds=t=>t.viewState.shadowEnabled,Nq=t=>t.viewState.shadowCameraFar,pBe=t=>t.viewState.solarPanelShininess,gBe=t=>t.viewState.windowShininess,e5=t=>t.viewState.heatFluxScaleFactor,i3=t=>t.viewState.heatFluxColor,a3=t=>t.viewState.heatFluxWidth,Cf=t=>t.viewState.solarRadiationHeatMapMaxValue,yge=t=>t.viewState.solarRadiationHeatMapReflectionOnly,Age=t=>t.viewState.axes,mBe=t=>t.viewState.ambientLightIntensity,yBe=t=>t.viewState.directLightIntensity,ABe=t=>t.viewState.theme,wBe=t=>t.viewState.showAzimuthAngle,vBe=t=>t.viewState.showElevationAngle,xBe=t=>t.viewState.showZenithAngle,bBe=t=>t.viewState.autoRotate,SBe=t=>t.viewState.hideAddress,hA=t=>t.viewState.groundImage,C4t=t=>t.viewState.groundImageType,TBe=t=>t.viewState.groundColor,PBe=t=>t.viewState.waterSurface,Id=t=>t.viewState.orthographic,R4t=t=>t.viewState.enableRotate,H4t=t=>t.viewState.cameraPosition,M4t=t=>t.viewState.cameraZoom,CBe=t=>t.viewState.heliodon,RBe=t=>t.viewState.showSunAngles,wge=t=>t.viewState.mapZoom,I4t=t=>t.viewState.mapTilt,HBe=t=>t.viewState.mapType,vge=t=>t.viewState.showSiteInfoPanel,Uq=t=>t.viewState.showDesignInfoPanel,MBe=t=>t.viewState.showInstructionPanel,IBe=t=>t.viewState.showHeliodonPanel,z4t=t=>t.viewState.heliodonPanelX,D4t=t=>t.viewState.heliodonPanelY,E4t=t=>t.viewState.showMapPanel,F4t=t=>t.viewState.mapPanelX,k4t=t=>t.viewState.mapPanelY,L4t=t=>t.viewState.showWeatherPanel,W4t=t=>t.viewState.weatherPanelRect,N4t=t=>t.viewState.showDiurnalTemperaturePanel,U4t=t=>t.viewState.diurnalTemperaturePanelRect,zBe=t=>t.viewState.showStickyNotePanel,j4t=t=>t.viewState.stickyNotePanelRect,B4t=t=>t.viewState.showDailyBuildingEnergyPanel,Y4t=t=>t.viewState.dailyBuildingEnergyPanelRect,O4t=t=>t.viewState.showYearlyBuildingEnergyPanel,_4t=t=>t.viewState.yearlyBuildingEnergyPanelRect,DBe=t=>t.viewState.showDailyLightSensorPanel,V4t=t=>t.viewState.dailyLightSensorPanelRect,G4t=t=>t.viewState.showYearlyLightSensorPanel,X4t=t=>t.viewState.yearlyLightSensorPanelRect,J4t=t=>t.viewState.yearlyLightSensorPanelShowDaylight,K4t=t=>t.viewState.yearlyLightSensorPanelShowClearness,EBe=t=>t.viewState.showDailyPvYieldPanel,q4t=t=>t.viewState.dailyPvYieldPanelRect,$4t=t=>t.viewState.showYearlyPvYieldPanel,Q4t=t=>t.viewState.yearlyPvYieldPanelRect,Z4t=t=>t.viewState.showSolarPanelVisibilityResultsPanel,e8t=t=>t.viewState.visibilityResultsPanelRect,FBe=t=>t.viewState.showDailyParabolicTroughYieldPanel,t8t=t=>t.viewState.dailyParabolicTroughYieldPanelRect,n8t=t=>t.viewState.showYearlyParabolicTroughYieldPanel,o8t=t=>t.viewState.yearlyParabolicTroughYieldPanelRect,kBe=t=>t.viewState.showDailyParabolicDishYieldPanel,r8t=t=>t.viewState.dailyParabolicDishYieldPanelRect,i8t=t=>t.viewState.showYearlyParabolicDishYieldPanel,a8t=t=>t.viewState.yearlyParabolicDishYieldPanelRect,LBe=t=>t.viewState.showDailyFresnelReflectorYieldPanel,l8t=t=>t.viewState.dailyFresnelReflectorYieldPanelRect,s8t=t=>t.viewState.showYearlyFresnelReflectorYieldPanel,c8t=t=>t.viewState.yearlyFresnelReflectorYieldPanelRect,WBe=t=>t.viewState.showDailyHeliostatYieldPanel,u8t=t=>t.viewState.dailyHeliostatYieldPanelRect,d8t=t=>t.viewState.showYearlyHeliostatYieldPanel,f8t=t=>t.viewState.yearlyHeliostatYieldPanelRect,NBe=t=>t.viewState.showDailyUpdraftTowerYieldPanel,h8t=t=>t.viewState.dailyUpdraftTowerYieldPanelRect,p8t=t=>t.viewState.showYearlyUpdraftTowerYieldPanel,g8t=t=>t.viewState.yearlyUpdraftTowerYieldPanelRect,m8t=t=>t.viewState.showEvolutionPanel,y8t=t=>t.viewState.evolutionPanelRect,Tc=t=>t.world.latitude,Sb=t=>t.world.longitude,rl=t=>t.world.date,xge=t=>t.world.leafDayOfYear1,bge=t=>t.world.leafDayOfYear2,A8t=t=>t.world.ground,jq=t=>t.world.address,w8t=t=>t.world.countryCode,v8t=t=>t.world.airAttenuationCoefficient,x8t=t=>t.world.airConvectiveCoefficient,UBe=t=>t.world.timesPerHour,IH=t=>t.world.daysPerYear,b8t=t=>t.world.discretization,jBe=t=>t.world.diurnalTemperatureModel,cW=t=>t.world.highestTemperatureTimeInMinutes,S8t=t=>t.world.solarRadiationHeatmapGridCellSize,T8t=t=>t.world.pvGridCellSize,P8t=t=>t.world.solarPanelVisibilityGridCellSize,C8t=t=>t.world.cspTimesPerHour,uW=t=>t.world.cspDaysPerYear,R8t=t=>t.world.cspGridCellSize,H8t=t=>t.world.sutTimesPerHour,BBe=t=>t.world.sutDaysPerYear,M8t=t=>t.world.sutGridCellSize,Sge=t=>t.world.noAnimationForHeatmapSimulation,I8t=t=>t.world.noAnimationForThermalSimulation,Tge=t=>t.world.noAnimationForSensorDataCollection,Pge=t=>t.world.noAnimationForSolarPanelSimulation,YBe=t=>t.world.noAnimationForSolarUpdraftTowerSimulation,fn=t=>t.set,mp=t=>t.user,z8t=t=>t.userCount,D8t=t=>t.showEconomicsPanel,E8t=t=>t.showNavigationPanel,F8t=t=>t.showShadowSettings,k8t=t=>t.minimumNavigationMoveSpeed,L8t=t=>t.minimumNavigationTurnSpeed,W8t=t=>t.navigationMoveSpeed,N8t=t=>t.navigationTurnSpeed,u1=t=>t.getHeatmap,Cge=t=>t.setHeatmap,OBe=t=>t.clearHeatmaps,Rge=t=>t.flagOfDailySimulation,Tb=t=>t.hourlyHeatExchangeArrayMap,U8t=t=>t.setHourlyHeatExchangeArray,j8t=t=>t.hourlySolarHeatGainArrayMap,B8t=t=>t.setHourlySolarHeatGainArray,Y8t=t=>t.hourlySolarPanelOutputArrayMap,O8t=t=>t.setHourlySolarPanelOutputArray,Hge=t=>t.getRoofSegmentVertices,dW=t=>t.getRoofSegmentVerticesWithoutOverhang,_8t=t=>t.latestVersion,_Be=t=>t.changed,V8t=t=>t.setChanged,G8t=t=>t.setSkipChange,no=t=>t.applyCount,Zn=t=>t.setApplyCount,Vi=t=>t.revertApply,Kn=t=>t.elements,X8t=t=>t.notes,fW=t=>t.pvModules,J8t=t=>t.loadPvModules,t5=t=>t.getPvModule,pu=t=>t.floatingWindowOpacity,Pc=t=>t.selectedFloatingWindow,s0=t=>t.language,K8t=t=>t.locale,ma=t=>t.loggable,q8t=t=>t.actionInfo,$8t=t=>t.currentUndoable,Bq=t=>t.openModelsMap,Q8t=t=>t.modelsMapLatitude,Z8t=t=>t.modelsMapLongitude,ewt=t=>t.modelsMapZoom,twt=t=>t.modelsMapTilt,Mge=t=>t.modelsMapType,VBe=t=>t.modelsMapWeatherStations,nwt=t=>t.showCloudFileTitleDialog,GBe=t=>t.showCloudFileTitleDialogFlag,Pb=t=>t.cloudFile,owt=t=>t.latestModelSite,XBe=t=>t.modelSites,JBe=t=>t.peopleModels,rwt=t=>t.saveAccountSettingsFlag,iwt=t=>t.saveCloudFileFlag,awt=t=>t.createProjectFlag,lwt=t=>t.saveProjectAsFlag,swt=t=>t.curateDesignToProjectFlag,cwt=t=>t.showProjectsFlag,uwt=t=>t.updateProjectsFlag,dwt=t=>t.modelsMapFlag,fwt=t=>t.leaderboardFlag,hwt=t=>t.showLeaderboard,pwt=t=>t.publishOnModelsMapFlag,gwt=t=>t.listCloudFilesFlag,mwt=t=>t.refreshCloudFilesFlag,ywt=t=>t.localContentToImportAfterCloudFileUpdate,Awt=t=>t.localFileName,wwt=t=>t.createNewFileFlag,vwt=t=>t.openLocalFileFlag,KBe=t=>t.saveLocalFileDialogVisible,zH=t=>t.fileChanged,xwt=t=>t.undoManager,En=t=>t.addUndoable,Ige=t=>t.importContent,qBe=t=>t.exportContent,bwt=t=>t.clearContent,$Be=t=>t.createEmptyFile,Swt=t=>t.aabb,QBe=t=>t.animateSun,Twt=t=>t.animate24Hours,hW=t=>t.runDailyThermalSimulation,Pwt=t=>t.pauseDailyThermalSimulation,Yq=t=>t.runYearlyThermalSimulation,Cwt=t=>t.pauseYearlyThermalSimulation,Rwt=t=>t.clearDailySimulationResultsFlag,Hwt=t=>t.clearYearlySimulationResultsFlag,pW=t=>t.runDynamicSimulation,zge=t=>t.runStaticSimulation,Mwt=t=>t.pauseSimulation,n5=t=>t.runEvolution,Oq=t=>t.pauseEvolution,_q=t=>t.objectiveEvaluationIndex,DH=t=>t.evolutionMethod,Iwt=t=>t.updateSceneRadiusFlag,ZBe=t=>t.updateSceneRadius,Ug=t=>t.sceneRadius,zwt=t=>t.cameraDirection,Dge=t=>t.getCameraDirection,Gn=t=>t.getElementById,pA=t=>t.getFoundation,qr=t=>t.getParent,EH=t=>t.getChildren,l3=t=>t.getChildrenOfType,s3=t=>t.selectedElement,Dwt=t=>t.selectedElementIdSet,Cb=t=>t.getSelectedElement,Ege=t=>t.overlapWithSibling,eYe=t=>t.selectedSideIndex,c3=t=>t.setElementPosition,Fge=t=>t.setElementSize,Ewt=t=>t.setElementNormal,Fwt=t=>t.updateElementLockById,kwt=t=>t.updateElementReferenceById,Lwt=t=>t.updateElementLabelById,Wwt=t=>t.updateElementShowLabelById,tYe=t=>t.updateElementCxById,nYe=t=>t.updateElementCyById,Nwt=t=>t.updateElementCzById,Uwt=t=>t.updateElementCzForAll,u3=t=>t.updateElementLxById,Vq=t=>t.updateElementLxAboveFoundation,gW=t=>t.updateElementLxForAll,Iw=t=>t.updateElementLyById,Gq=t=>t.updateElementLyAboveFoundation,mW=t=>t.updateElementLyForAll,kge=t=>t.updateElementLzById,jwt=t=>t.updateElementLzForAll,oYe=t=>t.updateElementColorById,Bwt=t=>t.updateElementColorOnSurface,Ywt=t=>t.updateElementColorAboveFoundation,rYe=t=>t.updateElementColorForAll,Owt=t=>t.updateElementLineColorById,_wt=t=>t.updateElementLineColorOnSurface,Vwt=t=>t.updateElementLineColorAboveFoundation,Gwt=t=>t.updateElementLineColorForAll,Xwt=t=>t.updateElementLineWidthById,Jwt=t=>t.updateElementLineWidthOnSurface,Kwt=t=>t.updateElementLineWidthAboveFoundation,qwt=t=>t.updateElementLineWidthForAll,Lge=t=>t.updateElementRotationById,$wt=t=>t.updateElementRotationForAll,$s=t=>t.foundationActionScope,Qwt=t=>t.setFoundationActionScope,FH=t=>t.polygonActionScope,kH=t=>t.setPolygonActionScope,iYe=t=>t.updatePolygonVertexPositionById,zw=t=>t.updatePolygonVerticesById,Rb=t=>t.cuboidActionScope,Hb=t=>t.setCuboidActionScope,zd=t=>t.solarPanelActionScope,Dd=t=>t.setSolarPanelActionScope,yW=t=>t.updateSolarCollectorDailyYieldById,AW=t=>t.updateSolarCollectorYearlyYieldById,aYe=t=>t.updateSolarPanelTiltAngleById,lYe=t=>t.updateSolarCollectorDrawSunBeamById,sYe=t=>t.updateSolarCollectorDrawSunBeamAboveFoundation,cYe=t=>t.updateSolarCollectorDrawSunBeamForAll,Xq=t=>t.updateSolarCollectorRelativeAzimuthById,uYe=t=>t.updateSolarCollectorRelativeAzimuthOnSurface,dYe=t=>t.updateSolarCollectorRelativeAzimuthAboveFoundation,fYe=t=>t.updateSolarCollectorRelativeAzimuthForAll,Zwt=t=>t.updateSolarCollectorXById,e7t=t=>t.updateSolarCollectorXAboveFoundation,t7t=t=>t.updateSolarCollectorXForAll,n7t=t=>t.updateSolarCollectorYById,o7t=t=>t.updateSolarCollectorYAboveFoundation,r7t=t=>t.updateSolarCollectorYForAll,wW=t=>t.updateSolarCollectorPoleHeightById,i7t=t=>t.updateSolarCollectorPoleHeightOnSurface,vW=t=>t.updateSolarCollectorPoleHeightAboveFoundation,xW=t=>t.updateSolarCollectorPoleHeightForAll,hYe=t=>t.updateSolarCollectorPoleRadiusById,pYe=t=>t.updateSolarCollectorPoleRadiusAboveFoundation,gYe=t=>t.updateSolarCollectorPoleRadiusForAll,Jq=t=>t.updateCspReflectanceById,Kq=t=>t.updateCspReflectanceAboveFoundation,qq=t=>t.updateCspReflectanceForAll,mYe=t=>t.updateParabolicCollectorAbsorptanceById,yYe=t=>t.updateParabolicCollectorAbsorptanceAboveFoundation,AYe=t=>t.updateParabolicCollectorAbsorptanceForAll,wYe=t=>t.updateParabolicCollectorOpticalEfficiencyById,vYe=t=>t.updateParabolicCollectorOpticalEfficiencyAboveFoundation,xYe=t=>t.updateParabolicCollectorOpticalEfficiencyForAll,bYe=t=>t.updateParabolicCollectorThermalEfficiencyById,SYe=t=>t.updateParabolicCollectorThermalEfficiencyAboveFoundation,TYe=t=>t.updateParabolicCollectorThermalEfficiencyForAll,gA=t=>t.parabolicTroughActionScope,mA=t=>t.setParabolicTroughActionScope,Mb=t=>t.fresnelReflectorActionScope,Ib=t=>t.setFresnelReflectorActionScope,zb=t=>t.heliostatActionScope,Db=t=>t.setHeliostatActionScope,PYe=t=>t.updateSolarReceiverById,CYe=t=>t.updateSolarReceiverAboveFoundation,RYe=t=>t.updateSolarReceiverForAll,yA=t=>t.parabolicDishActionScope,AA=t=>t.setParabolicDishActionScope,HYe=t=>t.updateParabolaLatusRectumById,MYe=t=>t.updateParabolaLatusRectumAboveFoundation,IYe=t=>t.updateParabolaLatusRectumForAll,zYe=t=>t.updateModuleLengthById,DYe=t=>t.updateModuleLengthAboveFoundation,EYe=t=>t.updateModuleLengthForAll,d3=t=>t.windTurbineActionScope,f3=t=>t.setWindTurbineActionScope,FYe=t=>t.copyElementById,yp=t=>t.removeElementById,a7t=t=>t.clearDeletedElements,l7t=t=>t.countElementsByReferenceId,Wge=t=>t.removeElementsByReferenceId,kYe=t=>t.pasteElementsToPoint,s7t=t=>t.pasteElementsByKey,LYe=t=>t.elementsToPaste,Y0=t=>t.selectMe,bW=t=>t.selectNone,Nge=t=>t.addElement,$q=t=>t.objectTypeToAdd,c7t=t=>t.actionModeLock,jg=t=>t.countElementsByType,WYe=t=>t.countSolarStructuresByType,u7t=t=>t.countObservers,d7t=t=>t.countSolarPanelsOnRack,f7t=t=>t.selectedElementAngle,h7t=t=>t.waiting,Rf=t=>t.simulationInProgress,Uge=t=>t.simulationPaused,NYe=t=>t.evolutionInProgress,UYe=t=>t.evolutionPaused,p7t=t=>t.contextMenuObjectType,g7t=t=>t.enableFineGrid,m7t=t=>t.setEnableFineGrid,y7t=t=>t.showCloudFilePanel,jYe=t=>t.projectState.title,BYe=t=>t.projectState.owner,A7t=t=>t.projectState.description,w7t=t=>t.projectState.designs,v7t=t=>t.projectState.type,YYe=t=>t.projectState.selectedProperty,x7t=t=>t.projectState.dataColoring,b7t=t=>t.projectState.thumbnailWidth,S7t=t=>t.projectState.xAxisNameScatterPlot,T7t=t=>t.projectState.yAxisNameScatterPlot,P7t=t=>t.projectState.dotSizeScatterPlot,C7t=t=>t.projectState.sortDescending,R7t=t=>t.projectState.filters,H7t=t=>t.projectState.ranges,M7t=t=>t.projectState.hiddenParameters,Qq=t=>t.projectView,I7t=t=>t.showProjectListPanel,z7t=t=>t.showModelsGallery,D7t=t=>t.showAccountSettingsPanel,E7t=t=>t.showLikesPanel,F7t=t=>t.showPublishedModelsPanel,k7t=t=>t.weatherModel,OYe=t=>t.setWeatherModel,jge=t=>t.weatherData,L7t=t=>t.loadWeatherData,W7t=t=>t.loadHorizontalSolarRadiationData,N7t=t=>t.getHorizontalSolarRadiation,U7t=t=>t.loadVerticalSolarRadiationData,j7t=t=>t.getVerticalSolarRadiation,_Ye=t=>t.getClosestCity,Dw=t=>t.sunlightDirection,B7t=t=>t.setSunlightDirection,Ss=t=>t.showSolarRadiationHeatmap,Y7t=t=>t.selectButtonClicked,h3=t=>t.showHeatFluxes,O7t=t=>t.runSolarPanelVisibilityAnalysis,_7t=t=>t.solarPanelVisibilityResults,VYe=t=>t.runDailySimulationForSolarPanels,V7t=t=>t.runDailySimulationForSolarPanelsLastStep,GYe=t=>t.runYearlySimulationForSolarPanels,G7t=t=>t.runYearlySimulationForSolarPanelsLastStep,X7t=t=>t.pauseDailySimulationForSolarPanels,J7t=t=>t.pauseYearlySimulationForSolarPanels,K7t=t=>t.dailyPvYield,XYe=t=>{var e;return(e=t.graphState)==null?void 0:e.dailyPvIndividualOutputs},q7t=t=>t.setDailyPvYield,$7t=t=>t.yearlyPvYield,JYe=t=>{var e;return(e=t.graphState)==null?void 0:e.yearlyPvIndividualOutputs},Q7t=t=>t.setYearlyPvYield,KYe=t=>t.solarPanelLabels,Z7t=t=>t.setSolarPanelLabels,qYe=t=>t.setTotalBuildingHeater,$Ye=t=>t.setTotalBuildingAc,QYe=t=>t.setTotalBuildingSolarPanel,evt=t=>t.runDailySimulationForParabolicTroughs,tvt=t=>t.runYearlySimulationForParabolicTroughs,nvt=t=>t.pauseDailySimulationForParabolicTroughs,ovt=t=>t.pauseYearlySimulationForParabolicTroughs,rvt=t=>t.dailyParabolicTroughYield,ZYe=t=>{var e;return(e=t.graphState)==null?void 0:e.dailyParabolicTroughIndividualOutputs},ivt=t=>t.setDailyParabolicTroughYield,avt=t=>t.yearlyParabolicTroughYield,eOe=t=>{var e;return(e=t.graphState)==null?void 0:e.yearlyParabolicTroughIndividualOutputs},lvt=t=>t.setYearlyParabolicTroughYield,tOe=t=>t.parabolicTroughLabels,svt=t=>t.setParabolicTroughLabels,cvt=t=>t.runDailySimulationForFresnelReflectors,uvt=t=>t.runYearlySimulationForFresnelReflectors,dvt=t=>t.pauseDailySimulationForFresnelReflectors,fvt=t=>t.pauseYearlySimulationForFresnelReflectors,hvt=t=>t.dailyFresnelReflectorYield,nOe=t=>{var e;return(e=t.graphState)==null?void 0:e.dailyFresnelReflectorIndividualOutputs},pvt=t=>t.setDailyFresnelReflectorYield,gvt=t=>t.yearlyFresnelReflectorYield,oOe=t=>{var e;return(e=t.graphState)==null?void 0:e.yearlyFresnelReflectorIndividualOutputs},mvt=t=>t.setYearlyFresnelReflectorYield,rOe=t=>t.fresnelReflectorLabels,yvt=t=>t.setFresnelReflectorLabels,Avt=t=>t.runDailySimulationForHeliostats,wvt=t=>t.runYearlySimulationForHeliostats,vvt=t=>t.pauseDailySimulationForHeliostats,xvt=t=>t.pauseYearlySimulationForHeliostats,bvt=t=>t.dailyHeliostatYield,iOe=t=>{var e;return(e=t.graphState)==null?void 0:e.dailyHeliostatIndividualOutputs},Svt=t=>t.setDailyHeliostatYield,Tvt=t=>t.yearlyHeliostatYield,aOe=t=>{var e;return(e=t.graphState)==null?void 0:e.yearlyHeliostatIndividualOutputs},Pvt=t=>t.setYearlyHeliostatYield,lOe=t=>t.heliostatLabels,Cvt=t=>t.setHeliostatLabels,sOe=t=>t.runDailySimulationForUpdraftTower,cOe=t=>t.runYearlySimulationForUpdraftTower,Rvt=t=>t.pauseDailySimulationForUpdraftTower,Hvt=t=>t.pauseYearlySimulationForUpdraftTower,Mvt=t=>t.dailyUpdraftTowerResults,Ivt=t=>t.dailyUpdraftTowerYield,zvt=t=>{var e;return(e=t.graphState)==null?void 0:e.dailyUpdraftTowerIndividualOutputs},Dvt=t=>t.setDailyUpdraftTowerResults,Evt=t=>t.setDailyUpdraftTowerYield,Fvt=t=>t.yearlyUpdraftTowerYield,kvt=t=>{var e;return(e=t.graphState)==null?void 0:e.yearlyUpdraftTowerIndividualOutputs},Lvt=t=>t.setYearlyUpdraftTowerYield,uOe=t=>t.updraftTowerLabels,Wvt=t=>t.setUpdraftTowerLabels,Nvt=t=>t.runDailySimulationForParabolicDishes,Uvt=t=>t.runYearlySimulationForParabolicDishes,jvt=t=>t.pauseDailySimulationForParabolicDishes,Bvt=t=>t.pauseYearlySimulationForParabolicDishes,Yvt=t=>t.dailyParabolicDishYield,dOe=t=>{var e;return(e=t.graphState)==null?void 0:e.dailyParabolicDishIndividualOutputs},Ovt=t=>t.setDailyParabolicDishYield,_vt=t=>t.yearlyParabolicDishYield,fOe=t=>{var e;return(e=t.graphState)==null?void 0:e.yearlyParabolicDishIndividualOutputs},Vvt=t=>t.setYearlyParabolicDishYield,hOe=t=>t.parabolicDishLabels,Gvt=t=>t.setParabolicDishLabels,pOe=t=>t.runDailyLightSensor,Xvt=t=>t.pauseDailyLightSensor,gOe=t=>t.runYearlyLightSensor,Jvt=t=>t.pauseYearlyLightSensor,Kvt=t=>t.dailyLightSensorData,qvt=t=>t.setDailyLightSensorData,$vt=t=>t.yearlyLightSensorData,Qvt=t=>t.setYearlyLightSensorData,mOe=t=>t.sensorLabels,Zvt=t=>t.setSensorLabels,ly=t=>t.hoveredHandle,Eb=t=>t.moveHandleType,d1=t=>t.resizeHandleType,Bge=t=>t.getResizeHandlePosition,Zq=t=>t.rotateHandleType,ext=t=>t.resizeAnchor,Yge=t=>t.isAddingElement,e$=t=>t.addedFoundationId,txt=t=>t.deletedFoundationId,t$=t=>t.addedCuboidId,nxt=t=>t.deletedCuboidId,yOe=t=>t.addedWallId,oxt=t=>t.deletedWallId,rxt=t=>t.deletedRoofId,Oge=t=>t.deletedRoofIdSet,AOe=t=>t.autoDeletedRoofIdSet,ixt=t=>t.autoDeletedRoofs,wOe=t=>t.autoDeletedChild,vOe=t=>t.groupActionMode,axt=t=>t.groupActionUpdateFlag,lxt=t=>t.addedWindowId,sxt=t=>t.addedDoorId,cxt=t=>t.updateWallMapOnFoundationFlag,p3=t=>t.wallActionScope,sy=t=>t.roofActionScope,SW=t=>t.windowActionScope,Ew=t=>t.doorActionScope,xOe=t=>t.setRoofActionScope,_ge=t=>t.updateWallLeftJointsById,Vge=t=>t.updateWallRightJointsById,uxt=t=>t.updateWallLeftPointById,n$=t=>t.economicsParams,dxt=t=>t.fittestIndividualResults,o$=t=>t.setFittestIndividualResults,TW=t=>t.variableLabels,r$=t=>t.setVariableLabels,wA=t=>t.evolutionaryAlgorithmState,i$=t=>t.solarPanelArrayLayoutConstraints,fxt=t=>t.geneticAlgorithmWizardSelectedTab,hxt=t=>t.particleSwarmOptimizationWizardSelectedTab,pxt=t=>t.countHeatmapCells,xh=t=>t.setPrimitiveStore,Gge=be.memo(({hx:t,hy:e,hz:n,position:o,rotation:r})=>{const i=H(g7t),a=H(hA),l=a?"#888888":"#444444",s=Math.max(t,e),[c,u]=m.useState(Math.floor(s/50)+1),[d,f]=m.useState(.5);m.useEffect(()=>{i?(u((Math.floor(s/25)+1)*m9),f(a?.05:.1)):(u((Math.floor(s/25)+1)*S6),f((a?.05:.1)*Z5))},[i,s,a]);const p=m.useMemo(()=>{const y=[0];for(let w=c;w<=t;w+=c)y.push(w),y.push(-w);return y},[c,t]),g=m.useMemo(()=>{const y=[0];for(let w=c;w<=e;w+=c)y.push(w),y.push(-w);return y},[c,e]);return h.jsxs("group",{position:o??[0,0,n+.01],rotation:r,children:[p.map(y=>h.jsx(jn,{points:[[y,-e,0],[y,e,0]],color:l,lineWidth:d,userData:{unintersectable:!0}},y)),g.map(y=>h.jsx(jn,{points:[[-t,y,0],[t,y,0]],color:l,lineWidth:d,userData:{unintersectable:!0}},y))]})}),Sre=.2,gxt=({x:t,z:e,handleType:n,scale:o=[1,1,1]})=>{const r=H(fn),i=H(d1),a=m.useRef(null),[l,s]=m.useState("white"),[c,u,d]=o;return m.useEffect(()=>{s(i===n?"red":"white")},[i]),h.jsx(Qr,{ref:a,name:n,args:[Sre*c,Sre*u,Sre*d],position:[t,0,e],onPointerEnter:()=>{s("red"),r(f=>{f.hoveredHandle=n})},onPointerLeave:()=>{i===null&&s("white"),r(f=>{f.hoveredHandle=null})},children:h.jsx("meshBasicMaterial",{attach:"material",color:l})})},wv=be.memo(gxt),mxt=({handleType:t})=>{const e=H(Eb),n=m.useRef(null),[o,r]=m.useState("white");return m.useEffect(()=>{e===Ho.Mid?r("red"):r("white")},[e]),h.jsx(ds,{ref:n,name:t,args:[.1,6,6],onPointerEnter:()=>{r("red")},onPointerLeave:()=>{e===null&&r("white")},children:h.jsx("meshBasicMaterial",{attach:"material",color:o})})},yxt=be.memo(mxt);class Tre{constructor(e){this.top=0,this.array=new Float32Array(e)}write(e){this.array[this.top++]=e.x,this.array[this.top++]=e.y,this.array[this.top++]=e.z}}class Axt{constructor(e){this.top=0,this.array=new Float32Array(e)}write(e){this.array[this.top++]=e.x,this.array[this.top++]=e.y}}let PT=class k_{constructor(e){this.plane=null,this.front=null,this.back=null,this.polygons=[],e&&this.build(e)}clone(){const e=new k_;return e.plane=this.plane&&this.plane.clone(),e.front=this.front&&this.front.clone(),e.back=this.back&&this.back.clone(),e.polygons=this.polygons.map(n=>n.clone()),e}invert(){for(let n=0;nkv.EPSILON?1:0;u|=g,d.push(g)}switch(u){case 0:(this.normal.dot(e.plane.normal)>0?n:o).push(e);break;case 1:r.push(e);break;case 2:i.push(e);break;case 3:{const f=[],p=[];for(let g=0;g=3&&r.push(new mG(f,e.shared)),p.length>=3&&i.push(new mG(p,e.shared));break}}}static fromPoints(e,n,o){const r=new x2().copy(n).sub(e).cross(new x2().copy(o).sub(e)).normalize();return new kv(r.clone(),r.dot(e))}}kv.EPSILON=1e-5;let mG=class bOe{constructor(e,n){this.vertices=e,this.shared=n,this.plane=kv.fromPoints(e[0].pos,e[1].pos,e[2].pos)}clone(){return new bOe(this.vertices.map(e=>e.clone()),this.shared)}flip(){this.vertices.reverse().map(e=>e.flip()),this.plane.flip()}};class yG{constructor(e,n,o,r){this.pos=new x2().copy(e),this.normal=new x2().copy(n),this.uv=new x2().copy(o),this.uv.z=0,r&&(this.color=new x2().copy(r))}clone(){return new yG(this.pos,this.normal,this.uv,this.color)}flip(){this.normal.negate()}interpolate(e,n){return new yG(this.pos.clone().lerp(e.pos,n),this.normal.clone().lerp(e.normal,n),this.uv.clone().lerp(e.uv,n),this.color&&e.color&&this.color.clone().lerp(e.color,n))}}class cc{constructor(){this.polygons=[]}static fromPolygons(e){const n=new cc;return n.polygons=e,n}static fromGeometry(e,n){let o=[];const r=e.attributes.position,i=e.attributes.normal,a=e.attributes.uv,l=e.attributes.color,s=e.groups;let c;if(e.index)c=e.index.array;else{c=new Array(r.array.length/r.itemSize|0);for(let d=0;d0)for(const y of s)d>=y.start&&d!Number.isNaN(d.plane.normal.x)))}static toGeometry(e,n){let o=0;const r=e.polygons;for(const p of r)o+=p.vertices.length-2;const i=new Ni,a=new Tre(o*3*3),l=new Tre(o*3*3),s=new Axt(o*2*3);let c;const u=[],d=[];for(const p of r){const g=p.vertices,y=g.length;p.shared!==void 0&&(u[p.shared]||(u[p.shared]=[])),y&&g[0].color!==void 0&&(c||(c=new Tre(o*3*3)));for(let w=3;w<=y;w++)(p.shared===void 0?d:u[p.shared]).push(a.top/3,a.top/3+1,a.top/3+2),a.write(g[0].pos),a.write(g[w-2].pos),a.write(g[w-1].pos),l.write(g[0].normal),l.write(g[w-2].normal),l.write(g[w-1].normal),s&&(s.write(g[0].uv),s.write(g[w-2].uv),s.write(g[w-1].uv)),c&&(c.write(g[0].color),c.write(g[w-2].color),c.write(g[w-1].color))}i.setAttribute("position",new nl(a.array,3)),i.setAttribute("normal",new nl(l.array,3)),s&&i.setAttribute("uv",new nl(s.array,2)),c&&i.setAttribute("color",new nl(c.array,3));for(let p=0;pn.clone()).filter(n=>Number.isFinite(n.plane.w)),e}toPolygons(){return this.polygons}union(e){const n=new PT(this.clone().polygons),o=new PT(e.clone().polygons);return n.clipTo(o),o.clipTo(n),o.invert(),o.clipTo(n),o.invert(),n.build(o.allPolygons()),cc.fromPolygons(n.allPolygons())}subtract(e){const n=new PT(this.clone().polygons),o=new PT(e.clone().polygons);return n.invert(),n.clipTo(o),o.clipTo(n),o.invert(),o.clipTo(n),o.invert(),n.build(o.allPolygons()),n.invert(),cc.fromPolygons(n.allPolygons())}intersect(e){const n=new PT(this.clone().polygons),o=new PT(e.clone().polygons);return n.invert(),o.clipTo(n),o.invert(),n.clipTo(o),o.clipTo(n),n.build(o.allPolygons()),n.invert(),cc.fromPolygons(n.allPolygons())}inverse(){const e=this.clone();for(const n of e.polygons)n.flip();return e}toMesh(e,n){return cc.toMesh(this,e,n)}toGeometry(e){return cc.toGeometry(this,e)}}const ht=GK()((t,e)=>{const n=o=>t(OP(o));return{set:o=>{try{n(o)}catch(r){console.log(r)}},setPrimitiveStore(o,r){n(i=>{i[o]!==void 0?i[o]=r:console.error(`key ${o} is not defined in PrimitiveStoreState`)})},latestVersion:void 0,changed:!1,setChanged(o){n(r=>{r.changed=o})},skipChange:!0,setSkipChange(o){n(r=>{r.skipChange=o})},localFileName:"aladdin.ala",createNewFileFlag:!1,setCreateNewFileFlag(o){n(r=>{r.createNewFileFlag=o})},openLocalFileFlag:!1,setOpenLocalFileFlag(o){n(r=>{r.openLocalFileFlag=o})},waiting:!1,contextMenuFlag:!1,updateContextMenu(){n(o=>{o.contextMenuFlag=!o.contextMenuFlag})},showEconomicsPanel:!1,showNavigationPanel:!1,showShadowSettings:!1,saveAccountSettingsFlag:!1,saveCloudFileFlag:!1,setSaveCloudFileFlag(o){n(r=>{r.saveCloudFileFlag=o})},listCloudFilesFlag:!1,refreshCloudFilesFlag:!1,saveLocalFileDialogVisible:!1,modelsMapFlag:!1,leaderboardFlag:!1,showLeaderboard:!1,publishOnModelsMapFlag:!1,modelsMapWeatherStations:!1,createProjectFlag:!1,saveProjectAsFlag:!1,curateDesignToProjectFlag:!1,showProjectsFlag:!1,updateProjectsFlag:!1,showProjectListPanel:!1,projectImagesUpdateFlag:!1,projectType:Pi.SOLAR_PANEL_ARRAY,projectTitle:null,projectDescription:null,userCount:0,showCloudFilePanel:!1,openModelsMap:!1,showModelsGallery:!1,showAccountSettingsPanel:!1,showLikesPanel:!1,showPublishedModelsPanel:!1,animateSun:!1,simulationInProgress:!1,simulationPaused:!1,evolutionInProgress:!1,evolutionPaused:!1,runEvolution:!1,pauseEvolution:!1,objectiveEvaluationIndex:0,runDailyThermalSimulation:!1,pauseDailyThermalSimulation:!1,runYearlyThermalSimulation:!1,pauseYearlyThermalSimulation:!1,clearDailySimulationResultsFlag:!1,clearYearlySimulationResultsFlag:!1,runDynamicSimulation:!1,runStaticSimulation:!1,pauseSimulation:!1,runDailySimulationForParabolicDishes:!1,runYearlySimulationForParabolicDishes:!1,pauseDailySimulationForParabolicDishes:!1,pauseYearlySimulationForParabolicDishes:!1,runDailySimulationForParabolicTroughs:!1,runYearlySimulationForParabolicTroughs:!1,pauseDailySimulationForParabolicTroughs:!1,pauseYearlySimulationForParabolicTroughs:!1,runDailySimulationForFresnelReflectors:!1,runYearlySimulationForFresnelReflectors:!1,pauseDailySimulationForFresnelReflectors:!1,pauseYearlySimulationForFresnelReflectors:!1,runDailySimulationForHeliostats:!1,runYearlySimulationForHeliostats:!1,pauseDailySimulationForHeliostats:!1,pauseYearlySimulationForHeliostats:!1,runSolarPanelVisibilityAnalysis:!1,runDailySimulationForSolarPanels:!1,pauseDailySimulationForSolarPanels:!1,runYearlySimulationForSolarPanels:!1,pauseYearlySimulationForSolarPanels:!1,runDailySimulationForSolarPanelsLastStep:!1,runYearlySimulationForSolarPanelsLastStep:!1,runDailyLightSensor:!1,pauseDailyLightSensor:!1,runYearlyLightSensor:!1,pauseYearlyLightSensor:!1,runDailySimulationForUpdraftTower:!1,runYearlySimulationForUpdraftTower:!1,pauseDailySimulationForUpdraftTower:!1,pauseYearlySimulationForUpdraftTower:!1,flagOfDailySimulation:!1,showSolarRadiationHeatmap:!1,showHeatFluxes:!1,duringCameraInteraction:!1,navigationMoveSpeed:3,navigationTurnSpeed:3,elementBeingCanceledId:null,showWallIntersectionPlaneId:null,oldParentId:null,oldFoundationId:null,selectedElementId:null,foundationMovedFlag:!1,updateFoundationMovedFlag(){n(o=>{o.foundationMovedFlag=!o.foundationMovedFlag})},isCameraUnderGround:!1,selectButtonClicked:!1,setSelectButtonClicked(o){n(r=>{r.selectButtonClicked=o})}}}),Tn=GK()((t,e)=>({roofSegmentVerticesMap:new Map,setRoofSegmentVertices(n,o){t(r=>(r.roofSegmentVerticesMap.set(n,[...o]),r))},getRoofSegmentVertices(n){return e().roofSegmentVerticesMap.get(n)},deleteRoofSegmentVertices(n){t(o=>(o.roofSegmentVerticesMap.delete(n),o))},roofSegmentVerticesWithoutOverhangMap:new Map,setRoofSegmentVerticesWithoutOverhang(n,o){t(r=>(r.roofSegmentVerticesWithoutOverhangMap.set(n,o),r))},getRoofSegmentVerticesWithoutOverhang(n){return e().roofSegmentVerticesWithoutOverhangMap.get(n)},deleteRoofSegmentVerticesWithoutOverhang(n){t(o=>(o.roofSegmentVerticesWithoutOverhangMap.delete(n),o))},dailyLightSensorData:[],setDailyLightSensorData(n){t({dailyLightSensorData:[...n]})},yearlyLightSensorData:[],setYearlyLightSensorData(n){t({yearlyLightSensorData:[...n]})},sensorLabels:[],setSensorLabels(n){t({sensorLabels:[...n]})},dailyPvYield:[],setDailyPvYield(n){t({dailyPvYield:[...n]}),ht.getState().set(o=>{o.runEvolution&&o.objectiveEvaluationIndex++})},sumDailyPvYield(){let n=0;for(const o of this.dailyPvYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Hour"&&(n+=o[r]);return n},getDailyPvProfit(){const n=this.sumDailyPvYield(),o=me.countAllSolarPanels();return n*H.getState().economicsParams.electricitySellingPrice-o*H.getState().economicsParams.operationalCostPerUnit},yearlyPvYield:[],setYearlyPvYield(n){t({yearlyPvYield:[...n]}),ht.getState().set(o=>(o.runEvolution&&o.objectiveEvaluationIndex++,o))},sumYearlyPvYield(){var r;let n=0;for(const i of this.yearlyPvYield)for(const a in i)Object.hasOwn(i,a)&&a!=="Month"&&(n+=i[a]);const o=12/(((r=H.getState().world)==null?void 0:r.daysPerYear)??6);return n*o},getYearlyPvProfit(){const n=me.countAllSolarPanels();return this.sumYearlyPvYield()*H.getState().economicsParams.electricitySellingPrice-n*H.getState().economicsParams.operationalCostPerUnit*365},solarPanelLabels:[],setSolarPanelLabels(n){t({solarPanelLabels:[...n]})},solarPanelVisibilityResults:new Map,setSolarPanelVisibilityResult(n,o){t(r=>(r.solarPanelVisibilityResults.set(n,o),r))},clearSolarPanelVisibilityResults(){t({solarPanelVisibilityResults:new Map})},dailyParabolicDishYield:[],setDailyParabolicDishYield(n){t({dailyParabolicDishYield:[...n]})},sumDailyParabolicDishYield(){let n=0;for(const o of this.dailyParabolicDishYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Hour"&&(n+=o[r]);return n},yearlyParabolicDishYield:[],setYearlyParabolicDishYield(n){t({yearlyParabolicDishYield:[...n]})},sumYearlyParabolicDishYield(){let n=0;for(const o of this.yearlyParabolicDishYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Month"&&(n+=o[r]);return n},parabolicDishLabels:[],setParabolicDishLabels(n){t({parabolicDishLabels:[...n]})},dailyParabolicTroughYield:[],setDailyParabolicTroughYield(n){t({dailyParabolicTroughYield:[...n]})},sumDailyParabolicTroughYield(){let n=0;for(const o of this.dailyParabolicTroughYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Hour"&&(n+=o[r]);return n},yearlyParabolicTroughYield:[],setYearlyParabolicTroughYield(n){t({yearlyParabolicTroughYield:[...n]})},sumYearlyParabolicTroughYield(){let n=0;for(const o of this.yearlyParabolicTroughYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Month"&&(n+=o[r]);return n},parabolicTroughLabels:[],setParabolicTroughLabels(n){t({parabolicTroughLabels:[...n]})},dailyFresnelReflectorYield:[],setDailyFresnelReflectorYield(n){t({dailyFresnelReflectorYield:[...n]})},sumDailyFresnelReflectorYield(){let n=0;for(const o of this.dailyFresnelReflectorYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Hour"&&(n+=o[r]);return n},yearlyFresnelReflectorYield:[],setYearlyFresnelReflectorYield(n){t({yearlyFresnelReflectorYield:[...n]})},sumYearlyFresnelReflectorYield(){let n=0;for(const o of this.yearlyFresnelReflectorYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Month"&&(n+=o[r]);return n},fresnelReflectorLabels:[],setFresnelReflectorLabels(n){t({fresnelReflectorLabels:[...n]})},dailyHeliostatYield:[],setDailyHeliostatYield(n){t({dailyHeliostatYield:[...n]})},sumDailyHeliostatYield(){let n=0;for(const o of this.dailyHeliostatYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Hour"&&(n+=o[r]);return n},yearlyHeliostatYield:[],setYearlyHeliostatYield(n){t({yearlyHeliostatYield:[...n]})},sumYearlyHeliostatYield(){let n=0;for(const o of this.yearlyHeliostatYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Month"&&(n+=o[r]);return n},heliostatLabels:[],setHeliostatLabels(n){t({heliostatLabels:[...n]})},dailyUpdraftTowerResults:[],dailyUpdraftTowerYield:[],setDailyUpdraftTowerResults(n){t({dailyUpdraftTowerResults:[...n]})},setDailyUpdraftTowerYield(n){t({dailyUpdraftTowerYield:[...n]})},sumDailyUpdraftTowerYield(){let n=0;for(const o of this.dailyUpdraftTowerYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Hour"&&(n+=o[r]);return n},yearlyUpdraftTowerYield:[],setYearlyUpdraftTowerYield(n){t({yearlyUpdraftTowerYield:[...n]})},sumYearlyUpdraftTowerYield(){let n=0;for(const o of this.yearlyUpdraftTowerYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Month"&&(n+=o[r]);return n},updraftTowerLabels:[],setUpdraftTowerLabels(n){t({updraftTowerLabels:[...n]})},heatmaps:new Map,setHeatmap(n,o){t(r=>(r.heatmaps.set(n,o),r))},getHeatmap(n){return e().heatmaps.get(n)},hourlyHeatExchangeArrayMap:new Map,setHourlyHeatExchangeArray(n,o){t(r=>(r.hourlyHeatExchangeArrayMap.set(n,o),r))},hourlySolarHeatGainArrayMap:new Map,setHourlySolarHeatGainArray(n,o){t(r=>(r.hourlySolarHeatGainArrayMap.set(n,o),r))},hourlySolarPanelOutputArrayMap:new Map,setHourlySolarPanelOutputArray(n,o){t(r=>(r.hourlySolarPanelOutputArrayMap.set(n,o),r))},totalBuildingHeater:0,setTotalBuildingHeater:n=>{t({totalBuildingHeater:n})},totalBuildingAc:0,setTotalBuildingAc:n=>{t({totalBuildingAc:n})},totalBuildingSolarPanel:0,setTotalBuildingSolarPanel:n=>{t({totalBuildingSolarPanel:n})},clearHeatmaps(){t(n=>(n.heatmaps.clear(),n))},clearDataStore(){t({heatmaps:new Map,hourlyHeatExchangeArrayMap:new Map,hourlySolarHeatGainArrayMap:new Map,hourlySolarPanelOutputArrayMap:new Map,solarPanelVisibilityResults:new Map,dailyLightSensorData:[],yearlyLightSensorData:[],sensorLabels:[],dailyPvYield:[],yearlyPvYield:[],solarPanelLabels:[],dailyParabolicDishYield:[],yearlyParabolicDishYield:[],parabolicDishLabels:[],dailyParabolicTroughYield:[],yearlyParabolicTroughYield:[],parabolicTroughLabels:[],dailyFresnelReflectorYield:[],yearlyFresnelReflectorYield:[],fresnelReflectorLabels:[],dailyHeliostatYield:[],yearlyHeliostatYield:[],heliostatLabels:[],dailyUpdraftTowerYield:[],dailyUpdraftTowerResults:[],yearlyUpdraftTowerYield:[],updraftTowerLabels:[]})},clearRoofVerticesMap(){t(n=>(n.roofSegmentVerticesMap.clear(),n.roofSegmentVerticesWithoutOverhangMap.clear(),n))}})),wxt="/aladdin/assets/roof_edge-DBy_1Q5D.png",ig="/aladdin/assets/tiny_white_square-B_qAXRfa.png",vxt="/aladdin/assets/roof_01-BwuyLpwq.png",xxt="/aladdin/assets/roof_02-DAbYjnV7.png",bxt="/aladdin/assets/roof_03-haZGIixv.png",Sxt="/aladdin/assets/roof_04-DDuwUcDr.png",Txt="/aladdin/assets/roof_05-CtBb5xIW.png",Pxt="/aladdin/assets/roof_06-DuyyebV8.png",Cxt="/aladdin/assets/roof_07-DXWGQN8a.png",Rxt=new mf({color:"white",side:Ra}),Hxt=be.memo(({dimension:t,mullionData:e,shadowEnabled:n})=>{const[o,r,i,a]=t,l=Math.min(a,i,o/2),{width:s,horizontalMullionSpacing:c,verticalMullionSpacing:u,color:d}=e,f=3,p=1,g=s/2,y=m.useMemo(()=>Math.atan2(o/2,l),[o,l]),w=m.useMemo(()=>{if(l===0||o===0)return 0;const S=l/2+o**2/(8*l),R=S-l,M=Math.PI-y,D=R**2,E=S**2,W=D+E-2*D*Math.sin(M)**2-2*R*Math.sqrt((E-D*Math.sin(M)**2)*Math.cos(M)**2);return Math.sqrt(W)},[o,l,y]),b=m.useMemo(()=>h.jsx("meshStandardMaterial",{color:d}),[d]),C=S=>new Fl().moveTo(0,S).quadraticCurveTo(S,S,S,0).quadraticCurveTo(S,-S,0,-S).quadraticCurveTo(-S,-S,-S,0).quadraticCurveTo(-S,S,0,S),P=(S,R)=>{const M=S*R/(o/2),D=M/2+(R*2)**2/(8*M),E=Math.acos(Math.min(1,R/D)),W=Math.PI-E,j=new D2(0,M-D,D,D,E,W,!1,0).getPoints(24).map(L=>new ie(L.x,L.y));return new yq(j)},v=m.useMemo(()=>{const S=[],R=Math.round(o/u)-1;if(R<=0||s===0)return null;const M=o/(R+1);let D=M/2;R%2!==0&&(S.push(0),D=M);for(let E=0;E{const S=[];if(s===0)return S;const R=i/2-l,M=i-l,D=Math.ceil(M/c);let E=R;for(let W=0;W{const S=[],R=Math.round(o/u)-1;if(R<=0||s===0)return null;const M=o/(R+1);let D=M/2;R%2!==0&&(D=M);for(let W=0;Wlh.jsx("group",{position:[0,0,i/2-l],rotation:[0,R,0],children:h.jsx(ca,{position:[0,0,S/2],args:[g,g,S,f,p],rotation:[Gt,Gt,0],receiveShadow:n,castShadow:n,children:b})});return h.jsxs("group",{name:"Window Mullion Group",position:[0,-.001,0],children:[e.horizontalMullion&&T.map((S,R)=>h.jsx(ca,{position:[0,0,S],args:[g,g,o,f,p],rotation:[0,0,Gt],receiveShadow:n,castShadow:n,children:b},R)),e.verticalMullion&&(v==null?void 0:v.map((S,R)=>h.jsx(ca,{position:[S,0,-l/2],args:[g,g,i-l,f,p],rotation:[Gt,Gt,0],receiveShadow:n,castShadow:n,children:b},R))),l>0&&(A==null?void 0:A.map((S,R)=>{if(S===null)return null;const{shape:M,path:D}=S;return h.jsx(nw,{position:[0,g/2,i/2-l],rotation:[Gt,0,0],args:[M,{extrudePath:D,steps:12,bevelEnabled:!1}],castShadow:n,receiveShadow:n,children:b},R)})),w>0&&h.jsxs(h.Fragment,{children:[x(l,0),x(w,y),x(w,-y)]})]})}),Mxt=be.memo(({dimension:t,frameData:e,shadowEnabled:n})=>{const[o,r,i,a]=t,l=o/2,s=Math.min(a,i,l),{color:c,width:u,sillWidth:d}=e,f=m.useMemo(()=>h.jsx("meshStandardMaterial",{color:c}),[c]),p=u/2,g=p/2,y=o+u*3,w=u,b=m.useMemo(()=>{const[C,P]=[l+u,l],v=s+u,T=v/2+(C*2)**2/(8*v),A=Math.acos(Math.min(1,C/T)),x=Math.PI-A,S=v-T,R=s,M=R/2+(P*2)**2/(8*R),D=Math.acos(Math.min(1,P/M)),E=Math.PI-D,W=R-M,j=new D2(0,S,T,T,A,x,!1,0).getPoints(36),L=new D2(0,W,M,M,E,D,!0,0).getPoints(36);return new Fl([...j,...L])},[a,i,o,u]);return h.jsxs("group",{name:"Window Frame Group",position:[0,-g/2,0],children:[s>.1?h.jsx(nw,{position:[0,g/2,i/2-s],rotation:[Gt,0,0],args:[b,{depth:g,steps:1,bevelEnabled:!1}],castShadow:n,receiveShadow:n,children:f}):h.jsx(Qr,{position:[0,0,i/2],args:[o+2*u,g,u],castShadow:n,receiveShadow:n,children:f}),h.jsx(Qr,{position:[-o/2-p,0,-s/2],args:[u,g,i-s],castShadow:n,receiveShadow:n,children:f}),h.jsx(Qr,{position:[o/2+p,0,-s/2],args:[u,g,i-s],castShadow:n,receiveShadow:n,children:f}),h.jsx(Qr,{position:[0,0,-i/2-(d===0?0:w/2)],args:d===0?[o+2*u,g,u]:[y,d??u,w],castShadow:n,receiveShadow:n,children:f})]})}),Kce=be.memo(({cy:t,dimension:e,wireframeData:n,drawBottom:o})=>{const[r,i,a,l]=e,{lineWidth:s,lineColor:c,selected:u,locked:d,opacity:f}=n,p=s/20,g=s/5,y=r/2,w=a/2,b=Math.min(l,a,y),C=6,P=1,v=(R,M)=>{const D=R/2+(M*2)**2/(8*R),E=Math.acos(Math.min(1,M/D)),W=Math.PI-E,j=new D2(0,R-D,D,D,E,W,!1,0).getPoints(24).map(L=>new ie(L.x,L.y));return new yq(j)},T=R=>new Fl().moveTo(0,R).quadraticCurveTo(R,R,R,0).quadraticCurveTo(R,-R,0,-R).quadraticCurveTo(-R,-R,-R,0).quadraticCurveTo(-R,R,0,R),A=m.useMemo(()=>new mf({color:c}),[c]),x=m.useMemo(()=>new mf({color:y0}),[]),S=(R,M)=>h.jsxs(h.Fragment,{children:[b>.1?h.jsx(nw,{position:[0,0,a/2-b],rotation:[Gt,0,0],args:[T(R),{extrudePath:v(b,y),steps:24,bevelEnabled:!1}],material:M}):h.jsx(ca,{args:[R,R,r,C,P],rotation:[0,0,Gt],position:[0,0,w-R/2],material:M}),o&&h.jsx(ca,{args:[R,R,r,C,P],rotation:[0,0,Gt],position:[0,0,-w],material:M}),h.jsx(ca,{args:[R,R,a-b,C,P],rotation:[Gt,Gt,0],position:[y,0,-b/2],material:M}),h.jsx(ca,{args:[R,R,a-b,C,P],rotation:[Gt,Gt,0],position:[-y,0,-b/2],material:M})]});return h.jsxs("group",{name:"Window Wireframe Group",children:[f>0&&h.jsx("group",{position:[0,t,0],children:S(p,A)}),d&&u&&S(g,x)]})}),Ixt=({id:t,dimension:e,position:n,mullionData:o,frameData:r,wireframeData:i,leftShutter:a,rightShutter:l,shutterColor:s,shutterWidth:c,glassMaterial:u,showHeatFluxes:d,area:f,empty:p,interior:g,foundation:y})=>{const w=H.getState().world,b=H(e5),C=H(i3),P=H(a3),v=H(Ds),T=Tn(Tb),A=m.useRef(0),x=m.useRef(),[S,R,M,D]=e,[E,W,j]=n,L=(X,$)=>{if(D>0){const Q=.5*S,le=.5*M,q=Math.min(D,M,Q),te=.5*(q+Q*Q/q);if(Math.abs(X)-le)return!0;const re=$-(M-te-le);return X*X+re*re{if(!d||g||y&&y.notBuilding)return;const X=T.get(t);if(!X)return;const $=X.reduce((ne,fe)=>ne+fe,0);if(f===0)return;const Q=r3*(w.solarRadiationHeatmapGridCellSize??.5),le=Math.max(2,Math.round(S/Q)),q=Math.max(2,Math.round(M/Q)),te=S/le,re=M/q,ae=$/f*(b??Qm);A.current=ae<0?1:0,x.current=me.getEuler(Io,Oc,"YXZ",Math.sign(ae)*Gt);const se=[];if(ae<0)for(let ne=0;nec*S,[S,c]),F=m.useMemo(()=>M-Math.min(D,M,S/2),[S,M,D]),U=m.useMemo(()=>(N+r.width+S)/2*1.025,[S,N,r.width]),O=m.useMemo(()=>-Math.min(D,M,S/2)/2,[M,F]),B=m.useMemo(()=>AG(S,M,D),[S,M,D]),_=(X,$,Q)=>h.jsx(ua,{name:"Window Seal Plane",args:X,position:$,rotation:Q,material:Rxt,receiveShadow:v,castShadow:v});return h.jsxs(h.Fragment,{children:[!p&&h.jsxs("group",{name:"Arched Window Plane Group",position:[0,W,0],children:[h.jsxs("mesh",{name:"Window Glass mesh",rotation:[Gt,0,0],children:[h.jsx("shapeGeometry",{args:[B]}),u]}),(o.horizontalMullion||o.verticalMullion)&&D!==void 0&&h.jsx(Hxt,{dimension:e,mullionData:o,shadowEnabled:v})]}),r.showFrame&&h.jsx(Mxt,{dimension:e,frameData:r,shadowEnabled:v}),h.jsx(Kce,{cy:W,dimension:e,wireframeData:i,drawBottom:!0}),h.jsx(Gye,{cx:U,cz:O,lx:N,lz:F,color:s,showLeft:a,showRight:l,spacing:r.showFrame?r.width/2:0}),_([R,M],[-S/2,R/2,0],[Gt,Gt,0]),_([R,M],[S/2,R/2,0],[Gt,-Gt,0]),_([S,R],[0,R/2,-M/2]),k&&k.map((X,$)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:X,name:"Heat Flux "+$,lineWidth:P??Zm,color:C??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:X[A.current].clone().add(new ie(0,A.current===0?-.1:.1,0)),args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:x.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:C??g0})})]},$))]})},AG=(t,e,n,o=0,r=0)=>{const i=new Fl,a=t/2,l=e/2,s=Math.min(n,e,a);if(i.moveTo(o-a,r-l),i.lineTo(o+a,r-l),i.lineTo(o+a,r+l-s),s>.01){const c=s/2+t**2/(8*s),[u,d]=[o,r+l-c],f=Math.acos(Math.min(1,a/c)),p=Math.PI-f;i.absarc(u,d,c,f,p,!1)}else i.lineTo(o-a,r+l);return i.closePath(),i},zxt=be.memo(Ixt),Dxt=1,Ext=3,Fxt=new mf({color:"white",side:$r}),kxt=new nn(0,0,-Gt),Lxt=be.memo(({dimension:t,polygonTop:e,frameData:n,shadowEnabled:o})=>{const[r,i,a]=t,[l,s]=e,{color:c,width:u,sillWidth:d}=n,f=m.useMemo(()=>h.jsx("meshStandardMaterial",{color:c}),[c]),[p,g]=[r/2,a/2],w=u/2/2,b=r+u*3,C=u,P=m.useMemo(()=>{const A=new ie(p,-g),x=new ie(p,g),S=new ie(-p,g),R=new ie(-p,-g),M=new ie(l*r,s+g);return[A,x,M,S,R]},[p,g,l,s]),v=m.useMemo(()=>{const A=[];for(let R=1;R{const A=new Fl;for(let x=0;x=0;x--){const S=P[x];A.lineTo(S.x,S.y)}return A.closePath(),A},[P,v]);return h.jsxs("group",{name:"Window Frame Group",position:[0,-w/2,0],children:[h.jsx(nw,{position:[0,w/2,0],rotation:[Gt,0,0],args:[T,{steps:1,depth:w,bevelEnabled:!1}],children:f}),h.jsx(Qr,{position:[0,0,-a/2-(d===0?0:C/2)],args:d===0?[r+2*u,w,u]:[b,d??u,C],castShadow:o,receiveShadow:o,children:f})]})}),Wxt=({id:t,dimension:e,polygonTop:n,position:o,glassMaterial:r,empty:i,interior:a,wireframeData:l,frameData:s,leftShutter:c,rightShutter:u,shutterColor:d,shutterWidth:f,area:p,showHeatFluxes:g,foundation:y})=>{const w=H.getState().world,b=H(e5),C=H(i3),P=H(a3),v=Tn(Tb),T=m.useRef(0),A=m.useRef(),[x,S,R]=o,[M,D,E]=e,[W,j,L]=e.map(He=>He/2),[k,N]=n,{lineWidth:F,lineColor:U,selected:O,locked:B,opacity:_}=l,X=k*M,$=Math.hypot(N,W-X),Q=Math.asin(N/$),le=Math.hypot(N,W+X),q=-Math.asin(N/le),te=H(Ds),re=(He,Se)=>{const ze=.5*M,Ie=.5*(E+n[1]),ye=n[1],ce=[{x:-ze,y:-Ie},{x:ze,y:-Ie},{x:ze,y:Ie-ye},{x:M*n[0],y:Ie},{x:-ze,y:Ie-ye}];return me.isPointInside(He,Se,ce)},ae=m.useMemo(()=>{if(!g||a||y&&y.notBuilding)return;const He=v.get(t);if(!He)return;const Se=He.reduce((Pe,Ee)=>Pe+Ee,0);if(p===0)return;const ze=r3*(w.solarRadiationHeatmapGridCellSize??.5),Ie=E+n[1],ye=Math.max(2,Math.round(M/ze)),ce=Math.max(2,Math.round(Ie/ze)),pe=M/ye,ve=Ie/ce,Ae=Se/p*(b??Qm);T.current=Ae<0?1:0,A.current=me.getEuler(Io,Oc,"YXZ",Math.sign(Ae)*Gt);const Te=[],Me=n[1]/2;if(Ae<0)for(let Pe=0;Pef*M,[M,f]),ne=m.useMemo(()=>(se+s.width+M)/2*1.025,[M,se,s.width]),fe=m.useMemo(()=>{const[He,Se]=[M/2,E/2],ze=k*M;return wG(He,Se,ze,N)},[M,E,k,N]),ge=m.useMemo(()=>O&&B?new mf({color:y0}):new mf({color:U}),[U,O,B]),de=m.useMemo(()=>B&&O?F/5:F/20,[F,O,B]),Z=m.useMemo(()=>B&&O?-D/2:-S,[S,D,O,B]),he=(He,Se=0)=>h.jsx(ca,{args:[de,de,He,Ext,Dxt],position:[Se,Z,0],rotation:[0,0,Gt],material:ge}),xe=(He,Se=0)=>h.jsx(ua,{args:[He,D],position:[Se,0,0],material:Fxt,receiveShadow:te,castShadow:te});return h.jsxs(h.Fragment,{children:[!i&&h.jsxs("mesh",{name:"Triangle Glass Plane",position:[0,S,0],rotation:[Gt,0,0],children:[h.jsx("shapeGeometry",{args:[fe]}),r]}),s.showFrame&&h.jsx(Lxt,{dimension:e,polygonTop:n,frameData:s,shadowEnabled:te}),h.jsx(Gye,{cx:ne,lx:se,lz:E,color:d,showLeft:c,showRight:u,spacing:s.showFrame?s.width/2:0}),h.jsxs("group",{position:[0,j,-L+.001],children:[xe(M),he(M)]}),h.jsxs("group",{position:[-W+.001,j,0],rotation:[0,Gt,0],children:[xe(E),he(E)]}),h.jsxs("group",{position:[W-.001,j,0],rotation:[0,-Gt,0],children:[xe(E),he(E)]}),h.jsxs("group",{position:[-W+.001,j,L-.01],rotation:[0,q,0],children:[xe(le,le/2),he(le,le/2)]}),h.jsxs("group",{position:[W-.001,j,L-.01],rotation:[0,Q,0],children:[xe($,-$/2),he($,-$/2)]}),ae&&ae.map((He,Se)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:He,name:"Heat Flux "+Se,lineWidth:P??Zm,color:C??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:He[T.current].clone().add(new ie(0,T.current===0?-.1:.1,0)),args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:A.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:C??g0})})]},Se))]})},wG=(t,e,n,o,r=0,i=0)=>{const a=new Fl;return a.moveTo(r-t,i-e),a.lineTo(r+t,i-e),a.lineTo(r+t,i+e),a.lineTo(r+n,i+e+o),a.lineTo(r-t,i+e),a.closePath(),a},Nxt=be.memo(Wxt),Uxt=({id:t,index:e,foundationModel:n,roofType:o,segment:r,centroid:i,thickness:a,color:l,sideColor:s,texture:c,heatmap:u,windows:d})=>{const f=H(l3),p=ht(h3),g=H(e5),y=H(i3),w=H(a3),b=Tn(dW),{transparent:C,opacity:P}=QH(),v=m.useRef(0),T=m.useRef(),A=m.useRef(),x=H.getState().world,S=Tn.getState().hourlyHeatExchangeArrayMap,{points:R}=r,M=m.useMemo(()=>{if(!p)return;const E=b(t);if(!E)return;const W=[],j=new ie(0,0,a+.1);switch(o){case Go.Hip:case Go.Pyramid:for(const L of E){const k=[];k.push(L[0].clone().sub(i).add(j)),k.push(L[1].clone().sub(i).add(j)),W.push(k)}break;case Go.Mansard:for(const[L,k]of E.entries()){if(L===E.length-1)continue;const N=[];N.push(k[0].clone().sub(i).add(j)),N.push(k[1].clone().sub(i).add(j)),W.push(N)}break;case Go.Gambrel:for(const[L,k]of E.entries()){if(L===0||L===3){const F=[];F.push(k[0].clone().sub(i).add(j)),F.push(k[1].clone().sub(i).add(j)),W.push(F)}let N=[];N.push(k[0].clone().sub(i).add(j)),N.push(k[3].clone().sub(i).add(j)),W.push(N),N=[],N.push(k[1].clone().sub(i).add(j)),N.push(k[2].clone().sub(i).add(j)),W.push(N)}break}return W},[p]),D=m.useMemo(()=>{if(!p||n&&n.notBuilding)return;const E=S.get(t+"-"+e);if(!E)return;const W=E.reduce((pe,ve)=>pe+ve,0),j=b(t);if(!j||!j[e])return;const[L,k,N,F,U]=R,O=U.z-L.z,B=j[e].map(pe=>pe.clone().sub(i).add(new ie(0,0,O)));if(!B)return;const _=[];for(const pe of B)_.push({x:pe.x,y:pe.y});const X=r3*(x.solarRadiationHeatmapGridCellSize??.5),$=B[0].clone(),Q=B[1].clone(),le=B[2].clone(),q=new ie().subVectors(Q,$),te=new ie().subVectors(le,$),re=new ie().subVectors(le,Q),ae=q.length(),se=new ie().crossVectors(te,re).length()/ae,ne=Math.max(2,Math.floor(ae/X)),fe=Math.max(2,Math.floor(se/X));q.normalize(),te.normalize(),re.normalize();const ge=new ie().crossVectors(te,re).normalize(),de=q.multiplyScalar(.5*ae/ne),Z=new ie().crossVectors(ge,q).normalize().multiplyScalar(.5*se/fe),he=$.clone().add(de).add(Z);de.multiplyScalar(2),Z.multiplyScalar(2),T.current=ge.clone().multiplyScalar(.1);const xe=[],He=new ie;let Se=B.length===4?me.getTriangleArea(B[0],B[1],B[2])+me.getTriangleArea(B[2],B[3],B[0]):me.getTriangleArea(B[0],B[1],B[2]);if(Se===0)return;let ze=f(z.Window,t);const Ie=b(t);if(Ie&&Ie[e]&&(ze=ze.filter(pe=>{const ve=pe,Ae=ve.cy+(ve.windowType===Ti.Polygonal&&ve.polygonTop?ve.polygonTop[1]/2:0);return Cn.onSegment(Ie[e],pe.cx,Ae)})),ze&&ze.length>0)for(const pe of ze)Se-=me.getWindowArea(pe);const ye=W/Se*(g??Qm);v.current=ye<0?1:0,A.current=me.getEuler(Io,ge,"YXZ",-Math.sign(ye)*Gt);let ce;for(let pe=0;pe0){const Te=He.x+i.x,Me=He.y+i.y;for(const Pe of ze){const Ee=Cn.getRelativeWindowVerticesOnRoof(Pe),Be=me.getPoints(Ee);if(me.isPointInside(Te,Me,Be)){ce=!1;break}}}if(ce&&me.isPointInside(He.x,He.y,_)){const Te=[];ye<0?(Te.push(He.clone()),Te.push(He.clone().add(ge.clone().multiplyScalar(-ye)))):(Te.push(He.clone()),Te.push(He.clone().add(ge.clone().multiplyScalar(ye)))),xe.push(Te)}}}return xe},[p,g]);return h.jsxs(h.Fragment,{children:[h.jsx(SOe,{id:t,index:e,segment:r,color:l,sideColor:s,texture:c,heatmap:u,transparent:C,opacity:P,windows:d,centroid:i}),M&&M.map((E,W)=>h.jsx(jn,{points:E,color:"gray",lineWidth:.5,dashed:!0,dashSize:.2,gapSize:.1,receiveShadow:!1,castShadow:!1,name:"Overhang Boundary "+W},W)),D&&D.map((E,W)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:E,name:"Heat Flux "+W,lineWidth:w??Zm,color:y??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:T.current?E[v.current].clone().add(T.current):E[0],args:[.06,.2,4,1],name:"Normal Vector Arrow Head "+W,rotation:A.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:y??g0})})]},W))]})},SOe=be.memo(({id:t,index:e,segment:n,color:o,sideColor:r,texture:i,heatmap:a,transparent:l,opacity:s,windows:c,centroid:u})=>{const d=ht(Ss),f=m.useRef(null),{points:p}=n,g=d?a:i,y=p.length===6,w=p.length===8,b=m.useMemo(()=>c.map(R=>{const M=new ie(R.lx,R.lz,R.ly*2),D=new ie(R.cx,R.cy,R.cz).sub(u),E=new nn().fromArray([R.rotation[0],R.rotation[1],R.rotation[2],"ZXY"]);if(R.windowType===Ti.Polygonal){const[W,j]=R.polygonTop??Gp,[L,k,N]=[M.x/2,M.y/2,W*M.x],F=wG(L,k,N,j),U=new is(new W9([F],{steps:1,depth:M.z,bevelEnabled:!1})),O=new ie(0,0,-M.z).applyEuler(E);return U.position.copy(D.clone().add(O)),U.rotation.copy(E),U.updateMatrix(),U}else if(R.windowType===Ti.Arched){const W=AG(M.x,M.y,R.archHeight),j=new is(new W9([W],{steps:1,depth:M.z,bevelEnabled:!1})),L=new ie(0,0,-M.z).applyEuler(E);return j.position.copy(D.clone().add(L)),j.rotation.copy(E),j.updateMatrix(),j}else{const W=new is(new t3(M.x,M.y,M.z));return W.position.copy(D),W.rotation.copy(E),W.updateMatrix(),W}}),[c,u]),C=v()??6,P=m.useMemo(()=>Array(C).fill(0),[C]);if(m.useEffect(()=>{v()},[]),!y&&!w)return null;function v(){if(!f.current||!y&&!w)return;const R=f.current.geometry;R.index=null,R.clearGroups();const M=[],D=[];let E=0,W=0;if(y){const U=p.slice(p.length/2);j(U),d?k():L(U),N(3);const O=p.slice(0,p.length/2).reverse();j(O),D.push(0,0,1,0,0,1),N(3),F([[0,1,4,3],[1,2,5,4],[2,0,3,5]])}else if(w){const U=p.slice(p.length/2),[O,B]=T(U);j(O),j(B);const[_,X,$,Q]=U,le=O[2].equals(Q);if(d)k(le);else{const ae=new ie().subVectors(X,_),se=new ie().subVectors($,_),ne=new ie().subVectors(Q,_),ge=new Xt(X.x-_.x,X.y-_.y).length(),de=ge,Z=0,he=ae.dot(se)/ge,xe=ae.clone().cross(se).length()/ge,He=ae.dot(ne)/ge,Se=ae.clone().cross(ne).length()/ge;le?(D.push(0,0,de,Z,He,Se),D.push(de,Z,he,xe,He,Se)):(D.push(0,0,de,Z,he,xe),D.push(0,0,he,xe,He,Se))}N(6);const q=p.slice(0,p.length/2),[te,re]=T(q);j(te.reverse()),j(re.reverse()),D.push(0,0,1,0,0,1),D.push(0,1,1,0,1,1),N(6),F([[0,1,5,4],[1,2,6,5],[2,3,7,6],[3,0,4,7]])}else throw new Error("segment is neither quad nor tri");if(R.setAttribute("position",new gr(M,3)),R.setAttribute("uv",new gr(D,2)),R.computeVertexNormals(),R.computeBoundingSphere(),c.length>0){const U=[];for(let B=0;Bq.concat(p[te].x,p[te].y,p[te].z),[]),le=[$,_,X].reduce((q,te)=>q.concat(p[te].x,p[te].y,p[te].z),[]);M.push(...Q),M.push(...le),D.push(0,0,1,0,0,1),D.push(0,1,1,0,1,1),N(6)}}}function T(R){const[M,D,E,W]=R,j=me.distanceFromPointToLine2D(W,M,D),L=me.distanceFromPointToLine2D(E,M,D),k=[],N=[];return Math.abs(j-L)<.01?M.z>D.z?(k.push(M,D,E),N.push(M,E,W)):(k.push(M,D,W),N.push(D,E,W)):j<=L?(k.push(M,D,W),N.push(D,E,W)):(k.push(M,D,E),N.push(M,E,W)),[k,N]}const A=({i:R})=>h.jsx("meshBasicMaterial",{attach:`material-${R}`,map:g,transparent:l,opacity:s}),x=({i:R})=>h.jsx("meshStandardMaterial",{attach:`material-${R}`,color:o,map:g,transparent:l,opacity:s}),S=({i:R})=>h.jsx("meshStandardMaterial",{attach:`material-${R}`,color:r,transparent:l,opacity:s});return h.jsx("mesh",{ref:f,name:`Buffer Roof Segment ${e}`,uuid:t+"-"+e,userData:{simulation:!0},receiveShadow:!d,castShadow:!0,frustumCulled:!1,children:P.map((R,M)=>M!==0?h.jsx(S,{i:M},"side"+M):d?h.jsx(A,{i:M},"heatmap"+M):h.jsx(x,{i:M},"texture"+M))})}),a$=be.memo(Uxt),jxt=({cz:t,points:e})=>{const n=new Fl;n.moveTo(e[0].x,e[0].y);for(const{x:o,y:r}of e)n.lineTo(o,r);return n.closePath(),h.jsx(nw,{scale:.99,position:[0,0,t],args:[n,{steps:1,depth:.1,bevelEnabled:!1}],children:h.jsx("meshStandardMaterial",{side:$r,color:"white"})})},PW=be.memo(jxt);function cy(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[o,r]of t)if(!Object.is(r,e.get(o)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const o of t)if(!e.has(o))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let o=0;oH(e=>e.selectedElementIdSet.has(t)&&!e.groupActionMode),Jt=()=>{const t=H(s0);return m.useMemo(()=>({lng:t}),[t])},f1=t=>H.getState().getWeather(t??"Boston MA, USA"),Swe=new ie,Twe=new nn,fY=new ie,Bxt=new ie(0,0,1),Yxt=be.memo(({roofSegments:t,thickness:e,lineWidth:n,lineColor:o})=>{if(t.length===0)return null;const r=[],i=new ie(0,0,e);for(let l=0;l{const[c,u,d]=l.points,f=Math.abs(c.z)<.015,p=[c.clone().sub(i),c];return f||p.push(d),h.jsx(jn,{points:p,lineWidth:n,color:o},s)})]})]})}),Oxt=({roofModel:t,foundationModel:e})=>{let{cx:n,cy:o,lz:r,id:i,wallsId:a,textureType:l,color:s="white",sideColor:c="white",thickness:u=.2,locked:d,lineWidth:f=.2,lineColor:p="black",roofType:g,foundationId:y,rise:w=r,ceiling:b=!1}=t;const C=$H(l),P=Es(i);[p,f]=Cn.getWireframetStyle(p,f,P,d);const v=H(fn),T=H(yp),{camera:A,gl:x}=oi(),S=m.useMemo(()=>new l0,[]),R=m.useMemo(()=>new Xt,[]),[M,D]=m.useState(!1),E=m.useRef(null),W=m.useRef(!1),j=m.useRef(w),L=new Set(a),k=Me=>{R.x=Me.offsetX/x.domElement.clientWidth*2-1,R.y=-(Me.offsetY/x.domElement.clientHeight)*2+1,S.setFromCamera(R,A)},N=Me=>{const Pe=[],Ee=Me.length;for(const Be of Me)Be.leftPoint[0]!==void 0&&Be.leftPoint[1]!==void 0&&Pe.push({x:Be.leftPoint[0],y:Be.leftPoint[1]});return B.current||(Me[Ee-1].rightPoint[0]||Me[Ee-1].rightPoint[0]===0)&&(Me[Ee-1].rightPoint[1]||Me[Ee-1].rightPoint[1]===0)&&Pe.push({x:Me[Ee-1].rightPoint[0],y:Me[Ee-1].rightPoint[1]}),Pe},F=(Me,Pe)=>{if(Me.length!==Pe.size)return!0;for(const Ee of Me)if(!Pe.has(Ee.id))return!0;return!1},U=()=>{let Me=1/0;for(let Pe=0;Pe{if(O.length<2)return{x:0,y:0};const Me=N(O);if(Me.length<3)return{x:0,y:0};const Pe=me.calculatePolygonCentroid(Me);return Number.isNaN(Pe.x)||Number.isNaN(Pe.y)?{x:0,y:0}:Pe},[O,X]),Q=m.useMemo(()=>new ie($.x,$.y,X),[$,X]),le=m.useMemo(()=>{const Me=O.map(Pe=>Cn.getWallNormal(Pe).multiplyScalar(Pe.eavesLength??0));if(!B.current&&Me.length!==0){const Pe=new ie().subVectors(new ie(O[O.length-1].rightPoint[0],O[O.length-1].rightPoint[1]),new ie(O[0].leftPoint[0],O[0].leftPoint[1])).applyEuler(gG).normalize().multiplyScalar(.3);Me.push(Pe)}return Me},[O]),q=m.useMemo(()=>{const Me=O.map((Pe,Ee)=>({leftPoint:new ie(Pe.leftPoint[0],Pe.leftPoint[1]).add(le[Ee]),rightPoint:new ie(Pe.rightPoint[0],Pe.rightPoint[1]).add(le[Ee])}));return!B.current&&Me.length!==0&&Me.push({leftPoint:new ie(O[O.length-1].rightPoint[0],O[O.length-1].rightPoint[1]).add(le[le.length-1]),rightPoint:new ie(O[0].leftPoint[0],O[0].leftPoint[1]).add(le[le.length-1])}),Me},[O,le]),te=m.useMemo(()=>Bxt.clone().multiplyScalar(u),[u]),re=m.useMemo(()=>{const Me=[];if(O.length<2)return Me;const Pe=U();for(let Ee=0;Ee0&&Be.rightPoint.length>0&&(Be.leftPoint[0]!==Be.rightPoint[0]||Be.leftPoint[1]!==Be.rightPoint[1])){const Je=[];let{lh:We,rh:Ke}=Cn.getWallHeight(O,Ee);B.current||(Ee===0&&(We=O[0].lz),Ee===O.length-1&&(Ke=O[O.length-1].lz));const Ne=Cn.getIntersectionPoint(q[(Ee+q.length-1)%q.length].leftPoint,q[(Ee+q.length-1)%q.length].rightPoint,q[Ee].leftPoint,q[Ee].rightPoint).setZ(We-Pe).sub(Q),De=Cn.getIntersectionPoint(q[Ee].leftPoint,q[Ee].rightPoint,q[(Ee+1)%q.length].leftPoint,q[(Ee+1)%q.length].rightPoint).setZ(Ke-Pe).sub(Q),ke=new ie(Be.cx,Be.cy).sub(Q.clone().setZ(0)).length();Je.push(Ne,De,fY),Je.push(Ne.clone().add(te),De.clone().add(te),fY.clone().add(te)),Me.push({points:Je,angle:-Be.relativeAngle,length:ke})}}if(!B.current){const Ee=q.length-1,Be=Cn.getIntersectionPoint(q[Ee-1].leftPoint,q[Ee-1].rightPoint,q[Ee].leftPoint,q[Ee].rightPoint).setZ(O[O.length-1].lz-Pe).sub(Q),Je=Cn.getIntersectionPoint(q[Ee].leftPoint,q[Ee].rightPoint,q[0].leftPoint,q[0].rightPoint).setZ(O[0].lz-Pe).sub(Q);let We=Math.atan2(Je.y-Be.y,Je.x-Be.x);We=We>=0?We:(la+We)%la;const Ke=new ie().addVectors(Be,Je).setZ(0).divideScalar(2).length(),Ne=[];Ne.push(Be,Je,fY),Ne.push(Be.clone().add(te),Je.clone().add(te),fY.clone().add(te)),Me.push({points:Ne,angle:-We,length:Ke})}return Me},[O,$,u]),ae=m.useMemo(()=>{const Me=[];if(O.length===0)return Me;Me.push(new ie().fromArray(O[0].leftPoint));for(const Pe of O)Me.push(new ie().fromArray(Pe.rightPoint));return Me},[O]);let se=0;if(e){n=e.cx,o=e.cy,se=e.rotation[2];const Me=-Math.atan2(A.position.x-n,A.position.y-o)-se;Swe.set($.x,$.y,X),Twe.set(-Gt,0,Me,"ZXY")}const ne=RQ();m.useEffect(()=>{if(ne)return;if(H.getState().addedRoofIdSet.has(i)&&O.length>=2&&F(O,L)){const Pe=O.map(Be=>Be.id),Ee=new Set(Pe);v(Be=>{for(const Je of Be.elements)if(Je.type===z.Roof)Je.id===i&&(Je.wallsId=Pe);else if(Je.type===z.Wall&&L.has(Je.id)&&!Ee.has(Je.id)){const We=Je;We.roofId=null,We.leftRoofHeight=void 0,We.rightRoofHeight=void 0}}),H.getState().deleteAddedRoofId(i)}},[L]),m.useEffect(()=>{if(O.length>1){if(H.getState().addedRoofIdSet.has(i)){for(let Pe=0;Pe{for(const Be of Ee.elements)if(Be.id===O[Pe].id&&Be.type===z.Wall){const Je=Be;Je.roofId=i,Je.leftRoofHeight=void 0,Je.rightRoofHeight=void 0;break}});H.getState().deleteAddedRoofId(i)}}else T(i,!1,!1,!0)},[O]),Lye(e,i,re,Q,X,u);const fe=()=>{if(O.length<2)return!1;const Me=O[0].lz;for(const Pe of O)if(Math.abs(Pe.lz-Me)>.01)return!1;for(const Pe of re){const[Ee,Be]=Pe.points;if(Math.abs(Ee.z)>.01||Math.abs(Be.z)>.01)return!1}return!0},[ge,de]=m.useState(fe);m.useEffect(()=>{de(fe())},[O,X]);const Z=ht(Ss),he=H(Cf),xe=Tn(u1),[He,Se]=m.useState([]),[ze,Ie]=m.useState(null),ye=H(Y0),ce=sN(i,Q,re,ge,Go.Pyramid);m.useEffect(()=>{if(Z)if(ge){const Me=xe(i);if(Me){const Pe=me.fetchHeatmapTexture(Me,he??5);if(Pe){const Ee=ce();if(Ee&&Ee.length>0&&e){const Be=new nn(0,0,e.rotation[2],"ZYX");let Je=Number.MAX_VALUE,We=Number.MAX_VALUE,Ke=-Number.MAX_VALUE,Ne=-Number.MAX_VALUE;for(const yt of Ee)for(const ct of yt){const Xe=ct.clone().applyEuler(Be);Xe.x>Ke&&(Ke=Xe.x),Xe.xNe&&(Ne=Xe.y),Xe.y0){const Pe=[];if(ce()){for(let Be=0;Be{const Me=[];for(let Pe=0;Pe0&&Ee.rightPoint.length>0&&(Ee.leftPoint[0]!==Ee.rightPoint[0]||Ee.leftPoint[1]!==Ee.rightPoint[1])){let{lh:Be,rh:Je}=Cn.getWallHeight(O,Pe);B.current||(Pe===0&&(Be=O[0].lz),Pe===O.length-1&&(Je=O[O.length-1].lz));const We=new ie(Ee.leftPoint[0],Ee.leftPoint[1],Be),Ke=new ie(Ee.rightPoint[0],Ee.rightPoint[1],Je);Me.push([We,Ke,Q.clone()])}}if(!B.current){const Pe=O[0],Ee=O[O.length-1],Be=new ie(Ee.rightPoint[0],Ee.rightPoint[1],Ee.lz),Je=new ie(Pe.leftPoint[0],Pe.leftPoint[1],Pe.lz);Me.push([Be,Je,Q.clone()])}if(ge){const Pe=[];for(const Ee of Me)Pe.push(Ee[0].clone());Tn.getState().setRoofSegmentVerticesWithoutOverhang(i,[Pe])}else Tn.getState().setRoofSegmentVerticesWithoutOverhang(i,Me)});const ve=H(Me=>Me.elements.filter(Pe=>Pe.parentId===i&&Pe.type===z.Window),cy),Ae=dN(i,e,Q,re),Te=l===Ur.Default||l===Ur.NoTexture?s:"white";return h.jsxs("group",{name:`Pyramid Roof Group ${i}`,children:[h.jsx("group",{name:`Pyramid Roof Segments Group ${i}`,userData:Ae,position:[$.x,$.y,X],onPointerDown:Me=>{iN(Me,e.id,i,re,Q)},onPointerMove:Me=>{lN(Me,i)},onPointerUp:Me=>{aN(Me,t)},onContextMenu:Me=>{TR(Me,i)},children:ge?h.jsx(HQ,{id:i,foundationModel:e,roofType:g,roofSegments:re,center:Q,thickness:u,lineWidth:f,lineColor:p,sideColor:c,color:Te,textureType:l,heatmap:ze}):h.jsxs(h.Fragment,{children:[re.map((Me,Pe)=>{const{points:Ee}=Me;if(Ee.length>0){const[Be,Je]=Ee;if(Be.distanceTo(Je)>.1)return h.jsx("group",{name:`Roof segment ${Pe}`,children:h.jsx(a$,{id:i,index:Pe,foundationModel:e,roofType:g,segment:Me,centroid:Q,thickness:u,color:Te,sideColor:c,texture:C,heatmap:He&&Pe0&&h.jsx(PW,{points:ae,cz:O[0].lz}),P&&!d&&h.jsx(oh,{position:[$.x,$.y,X+u+.15],onPointerDown:Me=>{ye(t.id,Me,Oo.Select),D(!0),Fn.getState().setEnableOrbitController(!1),W.current=!0,j.current=w,v(Pe=>{Pe.resizeHandleType=vt.Top,Pe.selectedElementHeight=X+t.thickness})},onPointerUp:()=>{D(!1),Fn.getState().setEnableOrbitController(!0)},onPointerOver:()=>{v(Me=>{Me.hoveredHandle=Lr.Top,Me.selectedElementHeight=X+t.thickness,Me.selectedElementX=$.x,Me.selectedElementY=$.y})}}),M&&h.jsx(ua,{name:"Roof Intersection Plane",ref:E,args:[1e3,100],visible:!1,rotation:Twe,position:Swe,onPointerMove:Me=>{if(E.current&&W.current&&e){k(Me);const Pe=S.intersectObjects([E.current]);if(Pe[0]){const Ee=Pe[0].point;if(Ee.z<.001)return;const Be=Math.max(0,Ee.z-e.lz-.3-_);H.getState().updateRoofRiseById(i,Be,X+t.thickness)}}},onPointerUp:Me=>{rN(i,j.current,w),D(!1),Fn.getState().setEnableOrbitController(!0),W.current=!1}})]})},_xt=be.memo(Oxt,qH),Vxt=(t,e,n)=>{const{left:o,right:r,center:i,centerLeft:a,centerRight:l}=n,[s,c]=[t/2,e/2],u=[{x:-s,y:o-c},{x:-s,y:-c},{x:s,y:-c},{x:s,y:r-c}];if(l){const[d,f]=l;u.push({x:d*t,y:f-c})}if(i){const[d,f]=i;u.push({x:d*t,y:f-c})}if(a){const[d,f]=a;u.push({x:d*t,y:f-c})}return u},o9=(t,e)=>{for(const n of H.getState().elements)if(n.type===z.Wall&&n.foundationId===e&&t.has(n.id)){const o=t.get(n.id);if(o){const r=n,i=Vxt(r.lx,r.lz,o);for(const a of H.getState().elements)if(a.parentId===r.id){let{cx:l,cz:s,lx:c,ly:u,lz:d}=a;if(l*=r.lx,s*=r.lz,a.type!==z.SolarPanel?(c*=r.lx,d*=r.lz):d=u,a.type===z.Window&&a.windowType===Ti.Polygonal){const[f,p]=a.polygonTop??Gp,g=l+f*c,y=s+d/2+p;if(!me.isPointInside(g,y,i))return!1}if(!me.isElementInsideWall(new ie(l,0,s),c,d,i,a.type===z.Door))return!1}}}return!0},Gxt=be.memo(({roofSegments:t,thickness:e,lineWidth:n,lineColor:o})=>{if(t.length===0)return null;const r=[],i=new ie(0,0,e),a=t[0].points,l=t[1].points,s=t[2].points,c=t[3].points;r.push(l[3],l[0],a[0],a[1],a[2],l[2],s[0],c[0],c[1],s[1],l[3]);const u=Math.abs(a[0].z)<.15,d=h.jsx(jn,{points:r,lineWidth:n,color:o}),f=h.jsxs(h.Fragment,{children:[h.jsx(jn,{points:[l[0],l[1]],lineWidth:n,color:o}),h.jsx(jn,{points:[l[2],l[3]],lineWidth:n,color:o}),h.jsx(jn,{points:[s[2],s[3]],lineWidth:n,color:o})]});return h.jsxs(h.Fragment,{children:[d,!u&&f,h.jsxs("group",{position:[0,0,e],children:[d,!u&&f]}),h.jsx(jn,{points:[a[0],a[0].clone().add(i)],lineWidth:n,color:o}),h.jsx(jn,{points:[a[1],a[1].clone().add(i)],lineWidth:n,color:o}),h.jsx(jn,{points:[c[0],c[0].clone().add(i)],lineWidth:n,color:o}),h.jsx(jn,{points:[c[1],c[1].clone().add(i)],lineWidth:n,color:o})]})}),Pre=new ie,Cre=new nn,Pwe=new Xt,Xxt=new ie(0,0,1),Jxt=({roofModel:t,foundationModel:e})=>{let{id:n,cx:o,cy:r,lz:i,wallsId:a,parentId:l,topRidgeLeftPoint:s,frontRidgeLeftPoint:c,backRidgeLeftPoint:u,topRidgePoint:d,frontRidgePoint:f,backRidgePoint:p,textureType:g,color:y="white",sideColor:w="white",thickness:b=.2,locked:C,lineColor:P="black",lineWidth:v=.2,roofType:T,rise:A=i,ceiling:x=!1}=t;d===void 0&&(d=s?[...s]:[0,1]),f===void 0&&(f=c?[...c]:[.35,.5]),p===void 0&&(p=u?[...u]:[.35,.5]);const S=Es(n);[P,v]=Cn.getWireframetStyle(P,v,S,C);const R=H(fn),M=H(yp),D=$H(g),[E,W]=m.useState(Lr.Null),[j,L]=m.useState(!1),k=m.useRef(null),{gl:N,camera:F}=oi(),U=m.useMemo(()=>new l0,[]),O=m.useMemo(()=>new Xt,[]),B=m.useRef([0,0]),_=m.useRef(A),X=m.useRef(!1),$=A<.01,Q=(at,Oe,Ze)=>{R(St=>{for(const Pt of St.elements)if(Pt.id===at&&Pt.type===z.Roof&&Pt.roofType===Go.Gambrel){const Rt=Pt;switch(Oe){case Lr.FrontLeft:case Lr.FrontRight:Rt.frontRidgePoint=[...Ze];break;case Lr.TopLeft:case Lr.TopRight:Rt.topRidgePoint=[...Ze];break;case Lr.BackLeft:case Lr.BackRight:Rt.backRidgePoint=[...Ze];break}break}})},le=(at,Oe,Ze,St)=>{const Pt={name:"Resize Gambrel Roof Ridge",timestamp:Date.now(),resizedElementId:at,resizedElementType:z.Roof,oldVal:[...Ze],newVal:[...St],type:Oe,undo:()=>{Q(Pt.resizedElementId,Pt.type,Pt.oldVal)},redo:()=>{Q(Pt.resizedElementId,Pt.type,Pt.newVal)}};H.getState().addUndoable(Pt)},q=at=>{O.x=at.offsetX/N.domElement.clientWidth*2-1,O.y=-(at.offsetY/N.domElement.clientHeight)*2+1,U.setFromCamera(O,F)},te=(at,Oe)=>{L(!0),Fn.getState().setEnableOrbitController(!1),Pre.set(at.x,at.y,at.z).add(ye),e&&Oe&&Cre.set(Gt,0,Oe.relativeAngle,"ZXY")},re=(at,Oe,Ze)=>{const St=new Xt(at.cx,at.cy),Pt=Cn.getComposedWallCenter(Oe),Rt=Cn.getComposedWallLength(Oe),Ut=new Xt(Pt.x,Pt.y).rotateAround(Pwe,at.rotation[2]).add(St),Ht=at.rotation[2]+Oe.relativeAngle,kt=new Xt(Ze.x,Ze.y).sub(Ut).rotateAround(Pwe,-Ht).x/Rt;return Math.min(Math.abs(kt),.5)*(kt>=0?1:-1)},ae=(at,Oe,Ze,St)=>{if(!at)return new ie;const Pt=Cn.getComposedWallLength(at),Rt=new nn(0,0,at.relativeAngle),Ut=new ie(Oe*Pt,0,0);let Ht=Ie;St&&(Ht=Ze*(Ie-St.lz)+St.lz);const At=Cn.getComposedWallCenter(at);return new ie(At.x,At.y,Ht).add(Ut.applyEuler(Rt))},se=(at,Oe)=>{const Ze=at[Oe];let St,Pt;return Oe===0||Oe===2?(St=Ze.lz,Pt=Ze.lz):Oe===1?(St=at[0].lz,Pt=at[2].lz):(St=at[2].lz,Pt=at[0].lz),{lh:St,rh:Pt}},ne=at=>at.id===n&&at.type===z.Roof&&at.roofType===Go.Gambrel,fe=(at,Oe)=>{const Ze=Oe.x-at.x,Pt=(Oe.y-at.y)/Ze,Rt=at.y-Pt*at.x;return{start:at.x,end:Oe.x,k:Pt,b:Rt}},ge=(at,Oe,Ze,St,Pt,Rt,Ut,Ht)=>{const At=at[Oe],{lh:kt,rh:gt}=se(at,Oe),dt=new ie().subVectors(At.leftPoint,At.rightPoint).length(),Ct=dt/2,tt=rt=>rt*dt+Ct,Fe=(rt,mt)=>rt*(Ze-mt)+mt,qe=[new Xt(tt(-Rt[0]),Fe(Rt[1],St)),new Xt(tt(Ut[0]),Ze),new Xt(tt(Ht[0]),Fe(Ht[1],Pt)),new Xt(dt,gt)];return qe.map((rt,mt)=>{const Qe=mt===0?new Xt(0,kt):qe[mt-1];return fe(Qe,rt)})},de=(at,Oe)=>{for(const Ze of at){const{start:St,end:Pt,k:Rt,b:Ut}=Ze;if(Oe>=St&&Oe<=Pt)return Rt*Oe+Ut}return null},Z=at=>{const Oe=new Set;for(const Ze of at)Ze.wallsId.forEach(St=>Oe.add(St));R(Ze=>{for(const St of Ze.elements)if(St.type===z.Wall&&St.foundationId===l&&Oe.has(St.id)){const Pt=St;Pt.leftRoofHeight=Ie,Pt.rightRoofHeight=Ie,Pt.centerLeftRoofHeight=void 0,Pt.centerRightRoofHeight=void 0,Pt.centerRoofHeight=void 0}})},he=(at,Oe,Ze,St,Pt,Rt,Ut)=>{if(Ze!==1&&Ze!==3)return;const Ht=Ze===3,{lh:At,rh:kt}=se(Oe,Ze),gt=Ht?Ut:Pt,dt=Ht?Pt:Ut,Ct=Ht?Rt:[-Rt[0],Rt[1]],tt=ge(Oe,Ze,St,At,kt,gt,Ct,dt),Fe=tt.slice(1).map(rt=>rt.start),qe=Oe[Ze],je=qe.wallsId.reduce((rt,mt)=>{const Qe=H.getState().elements.find(Tt=>Tt.id===mt);return Qe?[...rt,Qe.lx+rt[rt.length-1]]:rt},[0]);for(let rt=0;rt=Qe&&Qt<=Tt){const gn=(Qt-Ft)/zt,an=de(tt,Qt);an!==null&&(tn===0?_t.centerLeft=[gn,an]:tn===1?_t.center=[gn,an]:tn===2&&(_t.centerRight=[gn,an]))}}at.set(mt,_t)}}return at},xe=(at,Oe,Ze,St,Pt)=>{const Rt=new Map;return he(Rt,at,1,Oe,Ze,St,Pt),he(Rt,at,3,Oe,Ze,St,Pt),Rt},He=(at,Oe,Ze,St,Pt)=>{const Rt=new Set(at[0].wallsId),Ut=new Set(at[2].wallsId),Ht=xe(at,Oe,Ze,St,Pt);R(At=>{for(const kt of At.elements)if(kt.type===z.Wall&&kt.foundationId===l){if(Rt.has(kt.id)){const gt=kt,{lh:dt,rh:Ct}=se(at,0);gt.roofId=n,gt.leftRoofHeight=dt,gt.rightRoofHeight=Ct}else if(Ut.has(kt.id)){const gt=kt,{lh:dt,rh:Ct}=se(at,2);gt.roofId=n,gt.leftRoofHeight=dt,gt.rightRoofHeight=Ct}else if(Ht.has(kt.id)){const gt=Ht.get(kt.id);if(gt){const dt=kt,{left:Ct,right:tt,center:Fe,centerLeft:qe,centerRight:je}=gt;if(dt.roofId=n,dt.leftRoofHeight=Ct,dt.rightRoofHeight=tt,qe){const[rt,mt]=qe;dt.centerLeftRoofHeight?(dt.centerLeftRoofHeight[0]=rt,dt.centerLeftRoofHeight[1]=mt):dt.centerLeftRoofHeight=[rt,mt]}else dt.centerLeftRoofHeight=void 0;if(Fe){const[rt,mt]=Fe;dt.centerRoofHeight?(dt.centerRoofHeight[0]=rt,dt.centerRoofHeight[1]=mt):dt.centerRoofHeight=[rt,mt]}else dt.centerRoofHeight=void 0;if(je){const[rt,mt]=je;dt.centerRightRoofHeight?(dt.centerRightRoofHeight[0]=rt,dt.centerRightRoofHeight[1]=mt):dt.centerRightRoofHeight=[rt,mt]}else dt.centerRightRoofHeight=void 0}}}})},Se=Eye(a[0],l),{highestWallHeight:ze,topZ:Ie}=Fye(Se,A,!0);uN(t,ze);const ye=m.useMemo(()=>{if(!Se||Se.length!==4)return new ie;const at=Se.map(Ze=>({x:Ze.leftPoint.x,y:Ze.leftPoint.y})),Oe=me.calculatePolygonCentroid(at);return new ie(Oe.x,Oe.y,Ie)},[Se,Ie]),ce=m.useMemo(()=>{if(!Se||Se.length!==4)return new ie;const at=Se[3],[Oe,Ze]=d;return ae(at,Oe,Ze).sub(ye)},[Se,ye,d]),pe=m.useMemo(()=>{if(!Se||Se.length!==4)return new ie;const at=Se[1],[Oe,Ze]=d;return ae(at,-Oe,Ze).sub(ye)},[Se,ye,d]),ve=m.useMemo(()=>new ie().addVectors(ce,pe).divideScalar(2),[ce,pe]),Ae=m.useMemo(()=>{if(!Se||Se.length!==4)return new ie;const at=Se[3],[Oe,Ze]=f;return ae(at,Oe,Ze,Se[0]).sub(ye)},[Se,ye,f]),Te=m.useMemo(()=>{if(!Se||Se.length!==4)return new ie;const at=Se[1],[Oe,Ze]=f;return ae(at,-Oe,Ze,Se[0]).sub(ye)},[Se,ye,f]),Me=m.useMemo(()=>{if(!Se||Se.length!==4)return new ie;const at=Se[1],[Oe,Ze]=p;return ae(at,Oe,Ze,Se[2]).sub(ye)},[Se,ye,p]),Pe=m.useMemo(()=>{if(!Se||Se.length!==4)return new ie;const at=Se[3],[Oe,Ze]=p;return ae(at,-Oe,Ze,Se[2]).sub(ye)},[Se,ye,p]),Ee=m.useMemo(()=>!Se||Se.length!==4?[]:Se.map(at=>Cn.getComposedWallNormal(at).multiplyScalar(at.eavesLength)),[Se]),Be=m.useMemo(()=>Xxt.clone().multiplyScalar(b),[b]),Je=m.useMemo(()=>{const at=[];if(!Se||Se.length!==4)return at;const[Oe,Ze,St,Pt]=Se,[Rt,Ut,Ht,At]=Ee,kt=Oe.leftPoint,gt=Oe.rightPoint,dt=St.leftPoint,Ct=St.rightPoint,tt=kt.clone().add(Rt),Fe=gt.clone().add(Rt),qe=Ct.clone().add(At),je=kt.clone().add(At),rt=gt.clone().add(Ut),mt=dt.clone().add(Ut),Qe=dt.clone().add(Ht),Tt=Ct.clone().add(Ht),Dt=[],{lh:lt,rh:zt}=se(Se,0),Ft=Cn.getDistance(kt,gt,Ae.clone().add(ye)),_t=Math.min((Oe.eavesLength??0)/Ft*(Ae.clone().add(ye).z-lt),lt),tn=Cn.getDistance(kt,gt,Te.clone().add(ye)),Qt=Math.min((Oe.eavesLength??0)/tn*(Te.clone().add(ye).z-zt),zt),gn=Cn.getIntersectionPoint(qe,je,tt,Fe).setZ(lt-_t).sub(ye),an=Cn.getIntersectionPoint(tt,Fe,rt,mt).setZ(zt-Qt).sub(ye),mn=Cn.getIntersectionPoint(Ae,Te,qe.clone().sub(ye),je.clone().sub(ye)).setZ(Ae.z),Hn=Cn.getIntersectionPoint(Te,Ae,rt.clone().sub(ye),mt.clone().sub(ye)).setZ(Te.z);Dt.push(gn,an,Hn,mn),Dt.push(gn.clone().add(Be),an.clone().add(Be),Hn.clone().add(Be),mn.clone().add(Be));const Fo=Cn.getComposedWallCenter(Oe),yo=-Oe.relativeAngle,So=new ie(Fo.x,Fo.y).sub(ve.clone().setZ(0)).length();at.push({points:Dt,angle:yo,length:So});const $o=[],mo=Cn.getIntersectionPoint(ce,pe,qe.clone().sub(ye),je.clone().sub(ye)).setZ(ce.z),Jn=Cn.getIntersectionPoint(ce,pe,rt.clone().sub(ye),mt.clone().sub(ye)).setZ(pe.z);$o.push(mn,Hn,Jn,mo),$o.push(mn.clone().add(Be),Hn.clone().add(Be),Jn.clone().add(Be),mo.clone().add(Be)),at.push({points:$o,angle:yo,length:So});const uo=-St.relativeAngle,{lh:ir,rh:Rr}=se(Se,2),br=Cn.getDistance(dt,Ct,Me.clone().add(ye)),Vr=Math.min((St.eavesLength??0)/br*(Me.clone().add(ye).z-ir),ir),Wo=Cn.getDistance(dt,Ct,Pe.clone().add(ye)),wn=Math.min((St.eavesLength??0)/Wo*(Pe.clone().add(ye).z-Rr),Rr),In=Cn.getIntersectionPoint(rt,mt,Qe,Tt).setZ(ir-Vr).sub(ye),ar=Cn.getIntersectionPoint(Qe,Tt,qe,je).setZ(Rr-wn).sub(ye),No=Cn.getIntersectionPoint(Me,Pe,rt.clone().sub(ye),mt.clone().sub(ye)).setZ(Pe.z),eo=Cn.getIntersectionPoint(Pe,Me,qe.clone().sub(ye),je.clone().sub(ye)).setZ(Pe.z),Xn=Cn.getComposedWallCenter(St),Jo=new ie(Xn.x,Xn.y).sub(ve.clone().setZ(0)).length(),xo=[];xo.push(No,eo,mo,Jn),xo.push(No.clone().add(Be),eo.clone().add(Be),mo.clone().add(Be),Jn.clone().add(Be)),at.push({points:xo,angle:uo,length:Jo});const Qo=[];return Qo.push(In,ar,eo,No),Qo.push(In.clone().add(Be),ar.clone().add(Be),eo.clone().add(Be),No.clone().add(Be)),at.push({points:Qo,angle:uo,length:Jo}),at},[Se,Ie,b,d,f,p]),We=m.useMemo(()=>!Se||Se.length!==4?null:Se.map(at=>at.leftPoint),[Se]);m.useEffect(()=>{(!Se||Se.length!==4)&&M(n,!1,!1,!0)},[Se]);const Ke=RQ();m.useEffect(()=>{if((Se==null?void 0:Se.length)!==4)return;(H.getState().addedRoofIdSet.has(n)||!Ke)&&($?Z(Se):He(Se,Ie,f,d,p),CQ(e,n,Je,ye,Ie,b,$),H.getState().deleteAddedRoofId(n))},[Je]),kye(e,n,Je,ye,Ie,b,$);const Ne=()=>{const at=[];if(!Se||Se.length!==4)return at;const Oe=Se.map((At,kt,gt)=>new ie(At.leftPoint.x,At.leftPoint.y,se(gt,kt).lh)),Ze=Ae.clone().add(ye),St=Te.clone().add(ye),Pt=Me.clone().add(ye),Rt=Pe.clone().add(ye),Ut=ce.clone().add(ye),Ht=pe.clone().add(ye);at.push([Oe[0],Oe[1],St,Ze]),at.push([Ze,St,Ht,Ut]),at.push([Ut,Ht,Pt,Rt]),at.push([Oe[2],Oe[3],Rt,Pt]),$?Tn.getState().setRoofSegmentVerticesWithoutOverhang(n,[Oe]):Tn.getState().setRoofSegmentVerticesWithoutOverhang(n,at)},De=sN(n,ye,Je,$,Go.Gambrel);cN(Ne);const ke=H(at=>at.elements.filter(Oe=>Oe.parentId===n&&Oe.type===z.Window),cy),Ye=H(Y0),it=ht(Ss),Ve=H(Cf),yt=Tn(u1),[ct,Xe]=m.useState(null),[ut,ft]=m.useState([]);m.useEffect(()=>{if(it)if($){const at=yt(n);if(at){const Oe=me.fetchHeatmapTexture(at,Ve??5);if(Oe){const Ze=De();if(Ze&&Ze.length>0&&e){const St=new nn(0,0,e.rotation[2],"ZYX");let Pt=Number.MAX_VALUE,Rt=Number.MAX_VALUE,Ut=-Number.MAX_VALUE,Ht=-Number.MAX_VALUE;for(const tt of Ze)for(const Fe of tt){const qe=Fe.clone().applyEuler(St);qe.x>Ut&&(Ut=qe.x),qe.xHt&&(Ht=qe.y),qe.y0){const Oe=[];for(let Ze=0;Ze{iN(at,e.id,n,Je,ye)},onPointerMove:at=>{lN(at,n)},onPointerUp:at=>{aN(at,t)},onContextMenu:at=>{TR(at,n)},children:$?h.jsx(HQ,{id:n,foundationModel:e,roofType:T,roofSegments:Je,center:new ie(ye.x,ye.y,Ie),thickness:b,lineWidth:v,lineColor:P,sideColor:w,color:st,textureType:g,heatmap:ct}):h.jsxs(h.Fragment,{children:[Je.map((at,Oe,Ze)=>h.jsx(a$,{id:n,index:Oe,foundationModel:e,roofType:T,segment:at,centroid:ye,thickness:b,color:st,sideColor:w,texture:D,heatmap:ut&&Oe0&&Se[0].lz===Se[2].lz&&We&&h.jsx(PW,{cz:Se[0].lz,points:We}),S&&!C&&h.jsxs("group",{position:[ye.x,ye.y,ye.z+b],children:[h.jsx(oh,{position:[ve.x,ve.y,ve.z],onPointerDown:at=>{if(Ye(t.id,at,Oo.Select),X.current=!0,_.current=A,L(!0),Pre.set(ve.x,ve.y,Ie).add(ye),e){const Oe=-Math.atan2(F.position.x-o,F.position.y-r)-e.rotation[2];Cre.set(-Gt,0,Oe,"ZXY")}W(Lr.TopMid),Fn.getState().setEnableOrbitController(!1),R(Oe=>{Oe.resizeHandleType=vt.Top,Oe.selectedElementHeight=Ie+t.thickness})},onPointerOver:()=>{R(at=>{at.hoveredHandle=Lr.TopMid,at.selectedElementHeight=Ie+t.thickness,at.selectedElementX=ve.x,at.selectedElementY=ve.y})}}),!$&&h.jsxs(h.Fragment,{children:[h.jsx(oh,{position:[ce.x,ce.y,ce.z],onPointerDown:()=>{X.current=!0,B.current=[...d],te(ce,Se[3]),W(Lr.TopLeft)}}),h.jsx(oh,{position:[pe.x,pe.y,pe.z],onPointerDown:()=>{X.current=!0,B.current=[...d],te(pe,Se[1]),W(Lr.TopRight)}}),h.jsx(oh,{position:[Ae.x,Ae.y,Ae.z],onPointerDown:()=>{X.current=!0,B.current=[...f],te(Ae,Se[3]),W(Lr.FrontLeft)}}),h.jsx(oh,{position:[Te.x,Te.y,Te.z],onPointerDown:()=>{X.current=!0,B.current=[...f],te(Te,Se[1]),W(Lr.FrontRight)}}),h.jsx(oh,{position:[Me.x,Me.y,Me.z],onPointerDown:()=>{X.current=!0,B.current=[...p],te(Me,Se[1]),W(Lr.BackLeft)}}),h.jsx(oh,{position:[Pe.x,Pe.y,Pe.z],onPointerDown:()=>{X.current=!0,B.current=[...p],te(Pe,Se[3]),W(Lr.BackRight)}})]})]}),j&&h.jsx(ua,{name:"Roof Intersection Plane",ref:k,args:[1e3,100],visible:!1,position:Pre,rotation:Cre,onPointerMove:at=>{if(k.current&&X.current&&Se&&Se.length===4){q(at);const Oe=U.intersectObjects([k.current]);if(Oe[0]&&e){const Ze=Oe[0].point;if(Ze.z<.001)return;switch(E){case Lr.TopMid:{const St=Math.max(0,Ze.z-e.lz-.3-ze),Pt=ze+St,Rt=xe(Se,Pt,f,d,p);o9(Rt,l)&&H.getState().updateRoofRiseById(n,St,Pt+t.thickness);break}case Lr.FrontLeft:{if(e&&Se&&Se.length===4){const St=me.clamp(re(e,Se[3],Ze),d[0]+.05,.45),Pt=Ie-Se[0].lz,Rt=me.clamp((Ze.z-e.lz-Se[0].lz)/Pt,0,1),Ut=[St,Rt],Ht=xe(Se,Ie,Ut,d,p);o9(Ht,l)&&R(At=>{const kt=At.elements.find(gt=>ne(gt));kt&&(kt.frontRidgePoint[0]=Ut[0],kt.frontRidgePoint[1]=Ut[1])})}break}case Lr.FrontRight:{if(e&&Se&&Se.length===4){const St=me.clamp(re(e,Se[1],Ze),-.45,-d[0]-.05),Pt=Ie-Se[0].lz,Rt=me.clamp((Ze.z-e.lz-Se[0].lz)/Pt,0,1),Ut=[-St,Rt],Ht=xe(Se,Ie,Ut,d,p);o9(Ht,l)&&R(At=>{const kt=At.elements.find(gt=>ne(gt));kt&&(kt.frontRidgePoint=[...Ut])})}break}case Lr.TopLeft:{if(e&&Se&&Se.length===4){const Pt=[me.clamp(re(e,Se[3],Ze),-p[0]+.05,f[0]-.05),d[1]],Rt=xe(Se,Ie,f,Pt,p);o9(Rt,l)&&R(Ut=>{const Ht=Ut.elements.find(At=>ne(At));Ht&&(Ht.topRidgePoint=[...Pt])})}break}case Lr.TopRight:{if(e&&Se&&Se.length===4){const Pt=[-me.clamp(re(e,Se[1],Ze),-f[0]+.05,p[0]-.05),d[1]],Rt=xe(Se,Ie,f,Pt,p);o9(Rt,l)&&R(Ut=>{const Ht=Ut.elements.find(At=>ne(At));Ht&&(Ht.topRidgePoint=[...Pt])})}break}case Lr.BackLeft:{if(e&&Se&&Se.length===4){const St=me.clamp(re(e,Se[1],Ze),-d[0]+.05,.45),Pt=Ie-Se[2].lz,Rt=me.clamp((Ze.z-e.lz-Se[2].lz)/Pt,0,1),Ut=[St,Rt],Ht=xe(Se,Ie,f,d,Ut);o9(Ht,l)&&R(At=>{const kt=At.elements.find(gt=>ne(gt));kt&&(kt.backRidgePoint=[...Ut])})}break}case Lr.BackRight:{if(e&&Se&&Se.length===4){const St=me.clamp(re(e,Se[3],Ze),-.45,d[0]-.05),Pt=Ie-Se[2].lz,Rt=me.clamp((Ze.z-e.lz-Se[2].lz)/Pt,0,1),Ut=[-St,Rt],Ht=xe(Se,Ie,f,d,Ut);o9(Ht,l)&&R(At=>{const kt=At.elements.find(gt=>ne(gt));kt&&(kt.backRidgePoint=[...Ut])})}break}}}}},onPointerUp:()=>{switch(E){case Lr.TopMid:{rN(n,_.current,A);break}case Lr.TopLeft:case Lr.TopRight:{le(n,E,B.current,d);break}case Lr.FrontLeft:case Lr.FrontRight:{le(n,E,B.current,f);break}case Lr.BackLeft:case Lr.BackRight:{le(n,E,B.current,p);break}}X.current=!1,L(!1),W(Lr.Null),Fn.getState().setEnableOrbitController(!0)},children:h.jsx("meshBasicMaterial",{side:$r,transparent:!0,opacity:.5})})]})},Kxt=be.memo(Jxt,qH),hY=new ie,pY=new nn,Cwe=new Xt,qxt=new ie(0,0,1),Mz=be.memo(({start:t,end:e,width:n,height:o,offset:r,color:i})=>{const a=m.useMemo(()=>new Xt(t.x,t.y),[t]),l=m.useMemo(()=>new Xt(e.x,e.y),[e]),s=m.useMemo(()=>new Xt().subVectors(l,a).angle(),[a,l]),c=m.useMemo(()=>{const u=new Fl,d=a.distanceTo(l),f=t.z-e.z;return u.moveTo(0,0),u.lineTo(d,-f),u.lineTo(d,-f+o),u.lineTo(0,o),u.closePath(),u},[t,e,a,l,o]);return h.jsx("group",{position:r,children:h.jsx(nw,{args:[c,{steps:1,depth:n,bevelEnabled:!1}],position:t,rotation:[Gt,0,s,"ZXY"],castShadow:!0,receiveShadow:!0,children:h.jsx("meshStandardMaterial",{color:i})})})}),$xt=({ridgeLeftPoint:t,ridgeRightPoint:e,wallArray:n,height:o,isShed:r,width:i,spacing:a,color:l})=>{const[s,c,u,d]=n,f=m.useMemo(()=>new ie().subVectors(e,t).normalize(),[]),p=m.useMemo(()=>t.clone().add(f.clone().multiplyScalar(-(d.eavesLength??0)/2)),[t,d.eavesLength]),g=m.useMemo(()=>e.clone().add(f.clone().multiplyScalar((c.eavesLength??0)/2)),[t,c.eavesLength]),y=s.leftPoint.clone().setZ(s.lz),w=u.rightPoint.clone().setZ(u.lz),b=m.useMemo(()=>{if(n.length<4)return[];const T=new ie().subVectors(new ie(s.rightPoint.x,s.rightPoint.y,s.lz),y).normalize(),A=new ie().subVectors(new ie(u.leftPoint.x,u.leftPoint.y,u.lz),w).normalize(),x=t.distanceTo(e),S=new ie().subVectors(s.leftPoint,s.rightPoint).length(),R=new ie().subVectors(u.leftPoint,u.rightPoint).length(),M=i,D=Math.floor((Math.min(x,S,R)-i)/a)+2;return new Array(D).fill(0).map((E,W)=>{let j;W===D-1?j=x:j=W*a+M;const L=t.clone().add(f.clone().multiplyScalar(j)),k=y.clone().add(T.clone().multiplyScalar(j)),N=w.clone().add(A.clone().multiplyScalar(j)),F=new ie().subVectors(k,L).normalize().multiplyScalar(s.eavesLength??0),U=new ie().subVectors(N,L).normalize().multiplyScalar(u.eavesLength??0);return k.add(F),N.add(U),{ridge:L,front:k,back:N}})},[a,t]),C=t.distanceTo(y)>t.distanceTo(w),P=new ie(-i,0,0),v=new ie(0,i/2,0);return h.jsxs(h.Fragment,{children:[b.map((T,A)=>h.jsx(be.Fragment,{children:r?C?h.jsx(Mz,{start:T.ridge,end:T.front,width:i,height:o,color:l}):h.jsx(Mz,{start:T.ridge,end:T.back,width:i,height:o,color:l}):h.jsxs(h.Fragment,{children:[h.jsx(Mz,{start:T.ridge,end:T.front,width:i,height:o,color:l}),h.jsx(Mz,{start:T.ridge,end:T.back,width:i,height:o,color:l,offset:P})]})},A)),h.jsx(Mz,{start:p,end:g,width:i,height:o,color:l,offset:v})]})},Qxt=be.memo(({roofSegments:t,thickness:e,lineWidth:n,lineColor:o})=>{if(t.length===0)return null;const r=[],i=new ie(0,0,e),a=t.length===1;for(const f of t){const[p,g,y,w]=f.points;r.push(w,p,g,y),a&&r.push(w)}const l=Math.abs(t[0].points[0].z)<.015,s=t[0].points[3],c=t[0].points[2],u=h.jsx(jn,{points:r,lineWidth:n,color:o}),d=h.jsx(jn,{points:[s,c],lineWidth:n,color:o});return h.jsxs(h.Fragment,{children:[u,!l&&!a&&d,h.jsxs("group",{position:[0,0,e],children:[u,!l&&!a&&d]}),t.map((f,p)=>{const[g,y,w,b]=f.points;return h.jsxs("group",{children:[h.jsx(jn,{points:[g,g.clone().add(i)],lineWidth:n,color:o}),h.jsx(jn,{points:[y,y.clone().add(i)],lineWidth:n,color:o}),a&&h.jsxs(h.Fragment,{children:[h.jsx(jn,{points:[w,w.clone().add(i)],lineWidth:n,color:o}),h.jsx(jn,{points:[b,b.clone().add(i)],lineWidth:n,color:o})]})]},p)})]})}),Zxt=({roofModel:t,foundationModel:e})=>{let{id:n,parentId:o,wallsId:r,lz:i,rise:a=i,thickness:l=.2,ridgeLeftPoint:s,ridgeRightPoint:c,textureType:u,color:d="white",sideColor:f="white",locked:p,lineColor:g="black",lineWidth:y=.2,roofStructure:w,rafterSpacing:b=2,rafterWidth:C=.1,rafterColor:P="white",glassTint:v="#73D8FF",opacity:T=.5,ceiling:A=!1}=t;const x=H(fn),S=H(yp),R=Es(n);[g,y]=Cn.getWireframetStyle(g,y,R,p);const{gl:M,camera:D}=oi(),E=m.useMemo(()=>new l0,[]),W=m.useMemo(()=>new Xt,[]),[j,L]=m.useState(!1),[k,N]=m.useState(Lr.Null),F=Math.abs(s[0])>.45,U=m.useRef(null),O=m.useRef(s[0]),B=m.useRef(c[0]),_=m.useRef(a),X=m.useRef(!1),$=(De,ke,Ye)=>{x(it=>{for(const Ve of it.elements)if(Ve.id===De&&Ve.type===z.Roof&&Ve.roofType===Go.Gable){Ve.ridgeLeftPoint[0]=ke,Ve.ridgeRightPoint[0]=Ye;break}})},Q=(De,ke,Ye,it,Ve)=>{const yt={name:"Resize Gable Roof Ridge",timestamp:Date.now(),resizedElementId:De,resizedElementType:z.Roof,oldLeft:ke,oldRight:Ye,newLeft:it,newRight:Ve,undo:()=>{$(yt.resizedElementId,ke,Ye)},redo:()=>{$(yt.resizedElementId,it,Ve)}};H.getState().addUndoable(yt)},le=De=>{W.x=De.offsetX/M.domElement.clientWidth*2-1,W.y=-(De.offsetY/M.domElement.clientHeight)*2+1,E.setFromCamera(W,D)},q=(De,ke,Ye)=>{const it=new Xt(De.cx,De.cy),Ve=new ie().addVectors(ke.leftPoint,ke.rightPoint).divideScalar(2),yt=new ie().subVectors(ke.leftPoint,ke.rightPoint).length(),ct=new Xt(Ve.x,Ve.y).rotateAround(Cwe,De.rotation[2]).add(it),Xe=De.rotation[2]+ke.relativeAngle,ft=new Xt(Ye.x,Ye.y).sub(ct).rotateAround(Cwe,-Xe).x/yt;return Math.min(Math.abs(ft),.5)*(ft>=0?1:-1)},te=(De,ke,Ye)=>{if(!De)return new ie;const it=new ie().subVectors(De.leftPoint,De.rightPoint).length(),Ve=new ie().addVectors(De.leftPoint,De.rightPoint).divideScalar(2),yt=new nn(0,0,De.relativeAngle),ct=new ie(ke*it,0,0),Xe=Ye*a+he;return new ie(Ve.x,Ve.y,Xe).add(ct.applyEuler(yt))},re=(De,ke)=>{const Ye=De[ke];let it,Ve;return ke===0||ke===2?(it=Ye.lz,Ve=Ye.lz):ke===1?(it=De[0].lz,Ve=De[2].lz):(it=De[2].lz,Ve=De[0].lz),{lh:it,rh:Ve}},ae=(De,ke)=>{const Ye=De.slice().reverse();return se(Ye,0,ke-1),se(Ye,ke,Ye.length-1),Ye},se=(De,ke,Ye)=>{for(;keDe*Ye+ke,fe=(De,ke,Ye,it,Ve)=>{const yt=ke[Ye],ct=new ie().subVectors(yt.leftPoint,yt.rightPoint).length(),Xe=(Ve[0]+.5)*ct,{lh:ut,rh:ft}=re(ke,Ye),ot=Ve[1]*(it-ut)/Xe,st=ut,at=-(Ve[1]*(it-ft))/(ct-Xe),Oe=ft-at*ct,Ze=yt.wallsId.reduce((St,Pt)=>{const Rt=H.getState().elements.find(Ut=>Ut.id===Pt);return Rt?[...St,Rt.lx+St[St.length-1]]:St},[0]);for(let St=0;StXe&&(At.center=[(Xe-Rt)/Ht-.5,it]),De.set(Pt,At)}return De},ge=(De,ke,Ye,it)=>{const Ve=new Map;return fe(Ve,De,1,ke,it),fe(Ve,De,3,ke,Ye),Ve},de=(De,ke,Ye,it)=>{const[Ve,yt,ct,Xe]=De,ut=new Set(Ve.wallsId),ft=new Set(ct.wallsId),ot=ge(De,ke,Ye,it);x(st=>{for(const at of st.elements)if(at.type===z.Wall&&at.foundationId===o){if(ut.has(at.id)){const Oe=at;if(Oe.roofId=n,Ye[0]===.5)Oe.leftRoofHeight=ke,Oe.rightRoofHeight=ke,Oe.centerRoofHeight=void 0;else{const{lh:Ze,rh:St}=re(De,0);Oe.leftRoofHeight=Ze,Oe.rightRoofHeight=St}}else if(ft.has(at.id)){const Oe=at;if(Oe.roofId=n,Ye[0]===-.5)Oe.leftRoofHeight=ke,Oe.rightRoofHeight=ke,Oe.centerRoofHeight=void 0;else{const{lh:Ze,rh:St}=re(De,2);Oe.leftRoofHeight=Ze,Oe.rightRoofHeight=St}}else if(ot.has(at.id)){const Oe=ot.get(at.id);if(Oe){const Ze=at,{left:St,right:Pt,center:Rt}=Oe;if(Ze.roofId=n,Ze.leftRoofHeight=St,Ze.rightRoofHeight=Pt,Rt){const[Ut,Ht]=Rt;Ze.centerRoofHeight?(Ze.centerRoofHeight[0]=Ut,Ze.centerRoofHeight[1]=Ht):Ze.centerRoofHeight=[Ut,Ht]}else Ze.centerRoofHeight=void 0}}}})},Z=Eye(r[0],o),{highestWallHeight:he,topZ:xe}=Fye(Z,a,!0);uN(t,he);const He=m.useMemo(()=>{if(Z===null||Z.length!==4)return new ie;const De=Z.map(Ye=>({x:Ye.leftPoint.x,y:Ye.leftPoint.y})),ke=me.calculatePolygonCentroid(De);return new ie(ke.x,ke.y,xe)},[Z,xe]),Se=m.useMemo(()=>{if(Z===null)return new ie;const De=Z[3],[ke,Ye]=s;return te(De,ke,Ye)},[Z,xe,s]),ze=m.useMemo(()=>{if(Z===null)return new ie;const De=Z[1],[ke,Ye]=c;return te(De,ke,Ye)},[Z,xe,c]),Ie=m.useMemo(()=>new ie((Se.x+ze.x)/2,(Se.y+ze.y)/2,xe),[Se,ze]),ye=m.useMemo(()=>!Z||Z.length!==4?null:Z.map(De=>Cn.getComposedWallNormal(De).multiplyScalar(De.eavesLength)),[Z]),ce=m.useMemo(()=>qxt.clone().multiplyScalar(l),[l]),pe=m.useMemo(()=>{const De=[];if(!Z||Z.length!==4||!ye)return De;if(F){const ke=[],Ye=s[0]<0?0:2,it=ae(Z,Ye),Ve=ae(ye,Ye),[yt,ct,Xe,ut]=it,[ft,ot,st,at]=Ve,Oe=yt.leftPoint,Ze=yt.rightPoint,St=Xe.leftPoint,Pt=Xe.rightPoint,Rt=Oe.clone().add(ft),Ut=Ze.clone().add(ft),Ht=Pt.clone().add(at),At=Oe.clone().add(at),kt=Ze.clone().add(ot),gt=St.clone().add(ot),dt=St.clone().add(st),Ct=Pt.clone().add(st),{lh:tt,rh:Fe}=re(it,0),{lh:qe,rh:je}=re(it,2),rt=Cn.getDistance(Oe,Ze,Pt),mt=Math.min((yt.eavesLength??0)/rt*(xe-tt),tt),Qe=Cn.getDistance(Oe,Ze,St),Tt=Math.min((yt.eavesLength??0)/Qe*(xe-Fe),Fe),Dt=Cn.getDistance(St,Pt,Ze),lt=Math.min((Xe.eavesLength??0)/Dt*(xe-Fe),qe),zt=Cn.getDistance(St,Pt,Oe),Ft=Math.min((Xe.eavesLength??0)/zt*(xe-tt),je),_t=Cn.getIntersectionPoint(Ht,At,Rt,Ut).setZ(tt-mt).sub(He),tn=Cn.getIntersectionPoint(Rt,Ut,kt,gt).setZ(Fe-Tt).sub(He),Qt=Cn.getIntersectionPoint(kt,gt,dt,Ct).setZ(xe+lt).sub(He),gn=Cn.getIntersectionPoint(dt,Ct,Ht,At).setZ(xe+Ft).sub(He);ke.push(_t,tn,Qt,gn),ke.push(_t.clone().add(ce),tn.clone().add(ce),Qt.clone().add(ce),gn.clone().add(ce));const mn=new ie().addVectors(yt.leftPoint,yt.rightPoint).divideScalar(2).clone().sub(Ie.clone().setZ(0)).length();De.push({points:ke,angle:-yt.relativeAngle,length:mn})}else{const[ke,Ye,it,Ve]=Z,[yt,ct,Xe,ut]=ye,ft=ke.leftPoint.clone().add(yt),ot=ke.rightPoint.clone().add(yt),st=it.rightPoint.clone().add(ut),at=ke.leftPoint.clone().add(ut),Oe=ke.rightPoint.clone().add(ct),Ze=it.leftPoint.clone().add(ct),St=it.leftPoint.clone().add(Xe),Pt=it.rightPoint.clone().add(Xe),Rt=Cn.getIntersectionPoint(Se,ze,st.clone(),at.clone()).setZ(Se.z).sub(He),Ut=Cn.getIntersectionPoint(Se,ze,Oe.clone(),Ze.clone()).setZ(ze.z).sub(He),Ht=[],{lh:At,rh:kt}=re(Z,0),gt=Cn.getDistance(ke.leftPoint,ke.rightPoint,Se),dt=Math.min((ke.eavesLength??0)/gt*(Se.z-At),At),Ct=Cn.getDistance(ke.leftPoint,ke.rightPoint,ze),tt=Math.min((ke.eavesLength??0)/Ct*(ze.z-kt),kt),Fe=Cn.getIntersectionPoint(st,at,ft,ot).setZ(At-dt).sub(He),qe=Cn.getIntersectionPoint(ft,ot,Oe,Ze).setZ(kt-tt).sub(He);Ht.push(Fe,qe,Ut,Rt),Ht.push(Fe.clone().add(ce),qe.clone().add(ce),Ut.clone().add(ce),Rt.clone().add(ce));const rt=new ie().addVectors(ke.leftPoint,ke.rightPoint).divideScalar(2).clone().sub(He.clone().setZ(0)).length();De.push({points:Ht,angle:-ke.relativeAngle,length:rt});const mt=[],{lh:Qe,rh:Tt}=re(Z,2),Dt=Cn.getDistance(it.leftPoint,it.rightPoint,ze),lt=Math.min((it.eavesLength??0)/Dt*(ze.z-Qe),Qe),zt=Cn.getDistance(it.leftPoint,it.rightPoint,Se),Ft=Math.min((it.eavesLength??0)/zt*(Se.z-Tt),Tt),_t=Cn.getIntersectionPoint(Oe,Ze,St,Pt).setZ(Qe-lt).sub(He),tn=Cn.getIntersectionPoint(St,Pt,st,at).setZ(Tt-Ft).sub(He);mt.push(_t,tn,Rt,Ut),mt.push(_t.clone().add(ce),tn.clone().add(ce),Rt.clone().add(ce),Ut.clone().add(ce));const gn=new ie().addVectors(it.leftPoint,it.rightPoint).divideScalar(2).clone().sub(He.clone().setZ(0)).length();De.push({points:mt,angle:-it.relativeAngle,length:gn})}return De},[Z,Se,ze,xe,l]),ve=m.useMemo(()=>!Z||Z.length!==4?null:Z.map(De=>De.leftPoint),[Z]);m.useEffect(()=>{(!Z||Z.length!==4)&&S(n,!1,!1,!0)},[Z]);const Ae=RQ();m.useEffect(()=>{if((Z==null?void 0:Z.length)!==4)return;(H.getState().addedRoofIdSet.has(n)||!Ae)&&(de(Z,xe,s,c),CQ(e,n,pe,He,xe,l),H.getState().deleteAddedRoofId(n))},[pe]),kye(e,n,pe,He,xe,l);const Te=()=>{if(!Z||Z.length!==4)return;const De=[];if(F){const ke=s[0]<0?0:2,it=ae(Z,ke).map((Ve,yt,ct)=>new ie(Ve.leftPoint.x,Ve.leftPoint.y,re(ct,yt).lh));De.push(it)}else{const ke=Z.map((Ye,it,Ve)=>new ie(Ye.leftPoint.x,Ye.leftPoint.y,re(Ve,it).lh));De.push([ke[0],ke[1],ze.clone(),Se.clone()]),De.push([ke[2],ke[3],Se.clone(),ze.clone()])}Tn.getState().setRoofSegmentVerticesWithoutOverhang(n,De)};sN(n,He,pe,!1,Go.Gable),cN(Te);const Me=H(De=>De.elements.filter(ke=>ke.parentId===n&&ke.type===z.Window),cy),Pe=H(Y0),Ee=ht(Ss),Be=H(Cf),Je=Tn(u1),[We,Ke]=m.useState([]);m.useEffect(()=>{if(Ee){const De=pe.length;if(De>0){const ke=[];for(let Ye=0;Ye{iN(De,e.id,n,pe,He)},onPointerMove:De=>{lN(De,n)},onPointerUp:De=>{aN(De,t)},onContextMenu:De=>{TR(De,n)},children:[pe.map((De,ke,Ye)=>{const{points:it,angle:Ve,length:yt}=De,ct=Math.abs(it[0].z)<.1;return Z?h.jsx(ebt,{index:ke,id:n,points:it,centroid:He,angle:ct?Ye[0].angle:Ve,length:ct?1:yt,textureType:u,heatmaps:We,color:d,sideColor:f,roofStructure:w,glassTint:v,opacity:T,relativeAngle:ke===0?Z[0].relativeAngle:Z[2].relativeAngle,foundation:e,windows:Me},ke):null}),T>0&&h.jsx(Qxt,{roofSegments:pe,thickness:l,lineColor:g,lineWidth:w===wc.Rafter?.1:y})]}),A&&a>0&&Z[0].lz===Z[2].lz&&ve&&h.jsx(PW,{cz:Z[0].lz,points:ve}),w===wc.Rafter&&Z&&Z.length===4&&h.jsx("group",{onContextMenu:De=>{TR(De,n)},onPointerDown:De=>{l$e(De,n,o)},children:h.jsx($xt,{ridgeLeftPoint:Se,ridgeRightPoint:ze,wallArray:Z,overhang:0,isShed:F,height:l,spacing:b,color:P,width:C})}),R&&!p&&h.jsxs("group",{position:[0,0,l],children:[h.jsx(oh,{position:[Ie.x,Ie.y,Ie.z+.15],onPointerDown:De=>{if(Pe(t.id,De,Oo.Select),X.current=!0,_.current=a,L(!0),hY.set(Ie.x,Ie.y,xe),e){const ke=-Math.atan2(D.position.x-e.cx,D.position.y-e.cy)-e.rotation[2];pY.set(-Gt,0,ke,"ZXY")}N(Lr.Mid),Fn.getState().setEnableOrbitController(!1),x(ke=>{ke.resizeHandleType=vt.Top,ke.selectedElementHeight=xe+t.thickness})},onPointerOver:()=>{x(De=>{De.hoveredHandle=Lr.Mid,De.selectedElementHeight=xe+t.thickness,De.selectedElementX=Ie.x,De.selectedElementY=Ie.y})}}),h.jsx(oh,{position:[Se.x,Se.y,Se.z+.15],onPointerDown:()=>{if(X.current=!0,O.current=s[0],B.current=c[0],L(!0),hY.set(Se.x,Se.y,xe),e&&Z&&Z[3]){const De=new ie().subVectors(Se,D.position).normalize(),ke=Math.atan2(De.z,Math.hypot(De.x,De.y)),Ye=Z[3].relativeAngle;pY.set(-Gt+ke,0,Ye,"ZXY")}N(Lr.Left),Fn.getState().setEnableOrbitController(!1)}}),h.jsx(oh,{position:[ze.x,ze.y,ze.z+.15],onPointerDown:()=>{if(X.current=!0,O.current=s[0],B.current=c[0],L(!0),hY.set(ze.x,ze.y,xe),e&&Z&&Z[1]){const De=new ie().subVectors(ze,D.position).normalize(),ke=Math.atan2(De.z,Math.hypot(De.x,De.y)),Ye=Z[1].relativeAngle;pY.set(-Gt+ke,0,Ye,"ZXY")}N(Lr.Right),Fn.getState().setEnableOrbitController(!1)}})]}),j&&h.jsx(ua,{name:"Roof Intersection Plane",ref:U,args:[1e3,100],visible:!1,position:hY,rotation:pY,onPointerMove:De=>{if(U.current&&X.current&&e&&Z&&Z.length===4){le(De);const ke=E.intersectObjects([U.current]);if(ke[0]){const Ye=ke[0].point;if(Ye.z<.001)return;switch(k){case Lr.Left:{const it=Z[3];if(it){let Ve=q(e,it,Ye);Math.abs(Ve)>=.45&&Math.abs(Ve)<.5&&(Ve=.45*Math.sign(Ve));const yt=[Ve,s[1]],ct=[-Ve,c[1]],Xe=ge(Z,xe,yt,ct);o9(Xe,o)&&$(n,Ve,-Ve)}break}case Lr.Right:{const it=Z[1];if(it){let Ve=q(e,it,Ye);Math.abs(Ve)>=.45&&Math.abs(Ve)<.5&&(Ve=.45*Math.sign(Ve));const yt=[-Ve,s[1]],ct=[Ve,c[1]],Xe=ge(Z,xe,yt,ct);o9(Xe,o)&&$(n,-Ve,Ve)}break}case Lr.Mid:{let it;F?it=Math.max(0,Ye.z-e.lz-.3-he):it=Math.max(-he+.01,Ye.z-e.lz-.3-he);const Ve=he+it,yt=ge(Z,Ve,s,c);o9(yt,o)&&H.getState().updateRoofRiseById(n,it,xe+t.thickness);break}}}}},onPointerUp:()=>{switch(k){case Lr.Mid:{rN(n,_.current,a);break}case Lr.Left:case Lr.Right:Q(n,O.current,B.current,s[0],c[0])}X.current=!1,L(!1),N(Lr.Null),Fn.getState().setEnableOrbitController(!0)},children:h.jsx("meshBasicMaterial",{side:$r,transparent:!0,opacity:.5})})]})},ebt=({index:t,id:e,points:n,centroid:o,angle:r,length:i,textureType:a,heatmaps:l,color:s="white",sideColor:c,relativeAngle:u,foundation:d,roofStructure:f,glassTint:p,opacity:g=.5,windows:y})=>{const w=H.getState().world;H(Gn);const b=H(l3),C=ht(Ss),P=ht(h3),v=H(e5),T=H(i3),A=H(a3),x=Tn(dW),S=Tn.getState().hourlyHeatExchangeArrayMap,R=$H(f===wc.Rafter?Ur.NoTexture:a),{transparent:M,opacity:D}=QH(f===wc.Rafter,g),{invalidate:E}=oi(),W=m.useRef(null),j=m.useRef(null),L=m.useRef(null),k=m.useRef(null),N=m.useRef(0),F=m.useRef(),U=m.useRef(),[O,B]=m.useState(0),[_,X]=m.useState(0),[$,Q]=m.useState(!0),le=(ne,fe)=>ne.clone().setZ(0).distanceTo(fe.clone().setZ(0))>2,q=ne=>Math.abs(ne){if(!P)return;const ne=x(e);if(!ne)return;const fe=[],[ge,de,Z,he,xe]=n,He=xe.z-ge.z,Se=new ie(0,0,He+.1);for(const ze of ne.values()){let Ie=[];Ie.push(ze[0].clone().sub(o).add(Se)),Ie.push(ze[1].clone().sub(o).add(Se)),fe.push(Ie),Ie=[],Ie.push(ze[0].clone().sub(o).add(Se)),Ie.push(ze[3].clone().sub(o).add(Se)),fe.push(Ie),Ie=[],Ie.push(ze[1].clone().sub(o).add(Se)),Ie.push(ze[2].clone().sub(o).add(Se)),fe.push(Ie)}return fe},[P]),re=m.useMemo(()=>{if(!P||d&&d.notBuilding)return;const ne=S.get(e+"-"+t);if(!ne)return;const fe=ne.reduce((Xe,ut)=>Xe+ut,0),ge=x(e);if(!ge||!ge[t])return;const[de,Z,he,xe,He]=n,Se=He.z-de.z,ze=ge[t].map(Xe=>Xe.clone().sub(o).add(new ie(0,0,Se)));if(!ze)return;let Ie=me.getTriangleArea(ze[0],ze[1],ze[2])+me.getTriangleArea(ze[2],ze[3],ze[0]);if(Ie===0)return;let ye=b(z.Window,e);const ce=x(e);if(ce&&ce[t]&&(ye=ye.filter(Xe=>{const ut=Xe,ft=ut.cy+(ut.windowType===Ti.Polygonal&&ut.polygonTop?ut.polygonTop[1]/2:0);return Cn.onSegment(ce[t],Xe.cx,ft)})),ye&&ye.length>0)for(const Xe of ye)Ie-=me.getWindowArea(Xe);const pe=r3*(w.solarRadiationHeatmapGridCellSize??.5),ve=ze[0].clone(),Ae=ze[1].clone(),Te=ze[2].clone(),Me=new ie().subVectors(Ae,ve),Pe=new ie().subVectors(Te,ve),Ee=new ie().subVectors(Te,Ae),Be=Me.length(),Je=new ie().crossVectors(Pe,Ee).length()/Be,We=Math.max(2,Math.round(Be/pe)),Ke=Math.max(2,Math.round(Je/pe));Me.normalize(),Pe.normalize(),Ee.normalize();const Ne=new ie().crossVectors(Pe,Ee).normalize(),De=Me.multiplyScalar(.5*Be/We),ke=new ie().crossVectors(Ne,Me).normalize().multiplyScalar(.5*Je/Ke),Ye=ve.clone().add(De).add(ke);De.multiplyScalar(2),ke.multiplyScalar(2);const it=fe/Ie*(v??Qm);N.current=it<0?1:0,F.current=Ne.clone().multiplyScalar(.1),U.current=me.getEuler(Io,Ne,"YXZ",-Math.sign(it)*Gt);const Ve=[],yt=new ie;let ct;for(let Xe=0;Xe0){const ot=yt.x+o.x,st=yt.y+o.y;for(const at of ye){const Oe=Cn.getRelativeWindowVerticesOnRoof(at),Ze=me.getPoints(Oe);if(me.isPointInside(ot,st,Ze)){ct=!1;break}}}if(ct){const ot=[];it<0?(ot.push(yt.clone()),ot.push(yt.clone().add(Ne.clone().multiplyScalar(-it)))):(ot.push(yt.clone()),ot.push(yt.clone().add(Ne.clone().multiplyScalar(it)))),Ve.push(ot)}}}return Ve},[P,v,o,n]);m.useEffect(()=>{const[ne,fe,ge,de,Z]=n,he=Z.z-ne.z;if(W.current){const xe=W.current.geometry;if(xe){const He=new Float32Array(18),Se=he+.01;He[0]=n[0].x,He[1]=n[0].y,He[2]=n[0].z+Se,He[3]=n[1].x,He[4]=n[1].y,He[5]=n[1].z+Se,He[6]=n[2].x,He[7]=n[2].y,He[8]=n[2].z+Se,He[9]=n[2].x,He[10]=n[2].y,He[11]=n[2].z+Se,He[12]=n[3].x,He[13]=n[3].y,He[14]=n[3].z+Se,He[15]=n[0].x,He[16]=n[0].y,He[17]=n[0].z+Se,xe.setAttribute("position",new gr(He,3)),xe.computeVertexNormals();const ze=[];ze.push(0,0),ze.push(1,0),ze.push(1,1),ze.push(1,1),ze.push(0,1),ze.push(0,0),xe.setAttribute("uv",new gr(ze,2))}}if(j.current){j.current.geometry=new Fce(n,r,i);const xe=le(ne,de)&&le(fe,ge);if(Q(xe),f===wc.Glass&&xe){const He=me.calculatePolygonCentroid(n.map(me.mapVector3ToPoint2)),Se=new ie(He.x,He.y,0),ze=.25,Ie=new ie().addVectors(ne,Se.clone().sub(ne).setZ(0).normalize().multiplyScalar(ze)),ye=new ie().addVectors(fe,Se.clone().sub(fe).setZ(0).normalize().multiplyScalar(ze)),ce=new ie().addVectors(ge,Se.clone().sub(ge).normalize().multiplyScalar(ze)),pe=new ie().addVectors(de,Se.clone().sub(de).normalize().multiplyScalar(ze)),ve=[];ve.push(Ie),ve.push(ye),ve.push(ce.setZ(ye.z)),ve.push(pe.setZ(Ie.z)),ve.push(Ie.clone().setZ(1)),ve.push(ye.clone().setZ(1)),ve.push(ce.clone().setZ(1)),ve.push(pe.clone().setZ(1));const Ae=new is(new Fce(ve)),Te=cc.subtract(j.current,Ae);if(j.current.geometry=Te.geometry,q(u)){const Pe=Ie.distanceTo(ye),Ee=ne.distanceTo(de);B(Pe),X(Ee);const Be=new ie().subVectors(ne,de).angleTo(new ie(0,-1,0));L.current&&(L.current.scale.set(Pe,Ee,1),L.current.rotation.set(Be,0,0)),k.current&&k.current.rotation.set(Be-Gt,0,0)}else{const Pe=ne.distanceTo(de),Ee=Ie.distanceTo(ye);B(Pe),X(Ee);const Be=new ie().subVectors(ne,de).angleTo(new ie(1,0,0));L.current&&(L.current.scale.set(Pe,Ee,1),L.current.rotation.set(0,Be,0)),k.current&&k.current.rotation.set(Gt,Be,0,"YXZ")}const Me=(ne.z+de.z)/2+he*.75;L.current&&L.current.position.set(He.x,He.y,Me),k.current&&k.current.position.set(He.x,He.y,Me)}}E()},[n,r,i,u,$,C,f]);const ae={points:n,angle:r,length:i},se=a===Ur.Default||a===Ur.NoTexture?s:"white";return h.jsxs(h.Fragment,{children:[(D>0&&f===wc.Rafter||f!==wc.Rafter)&&h.jsx(h.Fragment,{children:h.jsx(SOe,{id:e,index:t,segment:ae,color:se,sideColor:c??"white",texture:R,heatmap:l[t],transparent:M,opacity:D,windows:y,centroid:o})}),te&&te.map((ne,fe)=>h.jsx(jn,{points:ne,color:"gray",lineWidth:.5,dashed:!0,dashSize:.2,gapSize:.1,receiveShadow:!1,castShadow:!1,name:"Overhang Boundary "+fe},fe)),re&&re.map((ne,fe)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:ne,name:"Heat Flux "+fe,lineWidth:A??Zm,color:T??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:F.current?ne[N.current].clone().add(F.current):ne[0],args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:U.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:T??g0})})]},fe))]})},tbt=be.memo(Zxt,qH),nbt=be.memo(({roofSegments:t,thickness:e,lineWidth:n,lineColor:o})=>{if(t.length===0)return null;const r=[],i=new ie(0,0,e);for(let u=0;u{const[f,p,g,y]=u.points,w=[f.clone().sub(i),f];return h.jsx(jn,{points:w,lineWidth:n,color:o},d)})]})]})}),b4=new ie,S4=new nn,obt=new ie(0,0,1),rbt=({roofModel:t,foundationModel:e})=>{let{id:n,parentId:o,cx:r,cy:i,lz:a,wallsId:l,leftRidgeLength:s,rightRidgeLength:c,textureType:u,color:d="white",sideColor:f="white",thickness:p=.2,locked:g,lineColor:y="black",lineWidth:w=.2,roofType:b,rise:C=a,ceiling:P=!1}=t;const v=H(Gn),T=H(fn),A=H(yp),x=Eye(l[0],o),S=$H(u),R=Es(n),[M,D]=m.useState(!1),[E,W]=m.useState(Lr.Null),[j,L]=m.useState(s),[k,N]=m.useState(c),{highestWallHeight:F,topZ:U}=Fye(x,C);uN(t,F);const O=m.useRef(null),{gl:B,camera:_}=oi(),X=m.useMemo(()=>new l0,[]),$=m.useMemo(()=>new Xt,[]),Q=m.useRef(!1),le=m.useRef(C),q=C<.01;[y,w]=Cn.getWireframetStyle(y,w,R,g),m.useEffect(()=>{L(s)},[s]),m.useEffect(()=>{N(c)},[c]);const te=(Ne,De,ke,Ye=!1)=>{T(it=>{for(const Ve of it.elements)if(Ve.id===Ne&&Ve.type===z.Roof&&Ve.roofType===Go.Hip){Ve.leftRidgeLength=De,Ve.rightRidgeLength=ke,Ye&&(it.updateElementOnRoofFlag=!0);break}})},re=(Ne,De,ke,Ye,it)=>{const Ve={name:"Resize Hip Roof Ridge",timestamp:Date.now(),resizedElementId:Ne,resizedElementType:z.Roof,oldLeftRidgeLength:De,oldRightRidgeLength:ke,newLeftRidgeLength:Ye,newRightRidgeLength:it,undo:()=>{te(Ve.resizedElementId,Ve.oldLeftRidgeLength,Ve.oldRightRidgeLength,!0)},redo:()=>{te(Ve.resizedElementId,Ve.newLeftRidgeLength,Ve.newRightRidgeLength,!0)}};H.getState().addUndoable(Ve)},ae=Ne=>{const De=[];for(const ke of Ne)De.push({x:ke.leftPoint.x,y:ke.leftPoint.y});return De},se=Ne=>{$.x=Ne.offsetX/B.domElement.clientWidth*2-1,$.y=-(Ne.offsetY/B.domElement.clientHeight)*2+1,X.setFromCamera($,_)},ne=(Ne,De,ke,Ye,it)=>{Ne.push(De,ke,Ye),it&&Ne.push(it),Ne.push(De.clone().add(He),ke.clone().add(He),Ye.clone().add(He)),it&&Ne.push(it.clone().add(He))},fe=()=>{if(x===null||x.length!==4)return 0;const Ne=x.map(Ye=>Ye.leftPoint),De=[de,Z,Z,de];let ke=1/0;for(let Ye=0;Ye<4;Ye++){const it=x[Ye],Ve=Cn.getDistance(Ne[Ye],Ne[(Ye+1)%4],De[Ye]),yt=Math.min((it.eavesLength??0)/Ve*(De[Ye].z-it.lz),it.lz),ct=Cn.getDistance(Ne[Ye],Ne[(Ye+1)%4],De[(Ye+1)%4]),Xe=Math.min((it.eavesLength??0)/ct*(De[(Ye+1)%4].z-it.lz),it.lz);ke=Math.min(Math.min(yt,Xe),ke)}return Number.isNaN(ke)?0:ke},ge=m.useMemo(()=>{if(x===null||x.length!==4)return new Xt;const Ne=ae(x),De=me.calculatePolygonCentroid(Ne);return new Xt(De.x,De.y)},[x]),de=m.useMemo(()=>{const Ne=new ie,De=new ie(ge.x,ge.y,U),ke=v(l[0]);return ke&&Ne.setX(-j).applyEuler(new nn(0,0,ke.relativeAngle)).add(De),Ne},[ge,U,j]),Z=m.useMemo(()=>{const Ne=new ie,De=new ie(ge.x,ge.y,U),ke=v(l[0]);return ke&&Ne.setX(k).applyEuler(new nn(0,0,ke.relativeAngle)).add(De),Ne},[ge,U,k]),he=m.useMemo(()=>new ie(ge.x,ge.y,U),[ge,U]),xe=m.useMemo(()=>x===null||x.length!==4?[]:x.map(Ne=>Cn.getComposedWallNormal(Ne).multiplyScalar(Ne.eavesLength)),[x]),He=m.useMemo(()=>obt.clone().multiplyScalar(p),[p]),Se=m.useMemo(()=>x===null||x.length!==4?null:x.map((Ne,De)=>({leftPoint:Ne.leftPoint.clone().add(xe[De]),rightPoint:Ne.rightPoint.clone().add(xe[De])})),[x,xe]),ze=m.useMemo(()=>{const Ne=[];if(x===null||x.length!==4||Se===null)return Ne;const De=fe();for(let ke=0;ke<4;ke++){const Ye=[],it=x[ke],{lh:Ve,rh:yt}=Cn.getComposedWallHeight(x,ke),ct=Cn.getIntersectionPoint(Se[(ke+3)%4].leftPoint,Se[(ke+3)%4].rightPoint,Se[ke].leftPoint,Se[ke].rightPoint).setZ(Ve-De).sub(he),Xe=Cn.getIntersectionPoint(Se[ke].leftPoint,Se[ke].rightPoint,Se[(ke+1)%4].leftPoint,Se[(ke+1)%4].rightPoint).setZ(yt-De).sub(he),ut=new ie().addVectors(it.leftPoint,it.rightPoint).divideScalar(2),ft=de.clone().sub(he),ot=Z.clone().sub(he);let st=0;switch(ke){case 0:st=ut.clone().sub(he.clone().setZ(0)).length(),ne(Ye,ct,Xe,ot,ft);break;case 1:st=ut.clone().sub(Z.clone().setZ(0)).length(),ne(Ye,ct,Xe,ot);break;case 2:st=ut.clone().sub(he.clone().setZ(0)).length(),ne(Ye,ct,Xe,ft,ot);break;case 3:st=ut.clone().sub(de.clone().setZ(0)).length(),ne(Ye,ct,Xe,ft);break}Ne.push({points:Ye,angle:-it.relativeAngle,length:st})}return Ne},[x,de,Z,U,p]),Ie=m.useMemo(()=>!x||x.length!==4?null:x.map(Ne=>Ne.leftPoint),[x]);m.useEffect(()=>{if(x===null||x.length!==4)A(n,!1,!1,!0);else if(H.getState().addedRoofIdSet.has(n)){for(let De=0;De{for(const it of Ye.elements)if(it.type===z.Wall&&ke.has(it.id)){const Ve=it;Ve.roofId=n,Ve.leftRoofHeight=void 0,Ve.rightRoofHeight=void 0}})}H.getState().deleteAddedRoofId(n)}},[x]),Lye(e,n,ze,he,U,p);const ye=()=>{if(!x)return;const Ne=[];for(let De=0;De<4;De++){const ke=x[De],{lh:Ye,rh:it}=Cn.getComposedWallHeight(x,De),Ve=ke.leftPoint.clone().setZ(Ye),yt=ke.rightPoint.clone().setZ(it),ct=de.clone(),Xe=Z.clone();switch(De){case 0:Ne.push([Ve,yt,Xe,ct]);break;case 1:Ne.push([Ve,yt,Xe]);break;case 2:Ne.push([Ve,yt,ct,Xe]);break;case 3:Ne.push([Ve,yt,ct]);break}}if(q){const De=[];for(const ke of Ne)De.push(ke[0].clone());Tn.getState().setRoofSegmentVerticesWithoutOverhang(n,[De])}else Tn.getState().setRoofSegmentVerticesWithoutOverhang(n,Ne)},ce=sN(n,new ie(ge.x,ge.y,U),ze,q,Go.Hip);cN(ye);const pe=H(Ne=>Ne.elements.filter(De=>De.parentId===n&&De.type===z.Window),cy),ve=H(Y0),Ae=ht(Ss),Te=H(Cf),Me=Tn(u1),[Pe,Ee]=m.useState(null),[Be,Je]=m.useState([]);m.useEffect(()=>{if(Ae)if(C>0){const Ne=ze.length;if(Ne>0){const De=[];for(let ke=0;ke0&&e){const Ye=new nn(0,0,e.rotation[2],"ZYX");let it=Number.MAX_VALUE,Ve=Number.MAX_VALUE,yt=-Number.MAX_VALUE,ct=-Number.MAX_VALUE;for(const at of ke)for(const Oe of at){const Ze=Oe.clone().applyEuler(Ye);Ze.x>yt&&(yt=Ze.x),Ze.xct&&(ct=Ze.y),Ze.y{iN(Ne,e.id,n,ze,he)},onPointerMove:Ne=>{lN(Ne,n)},onPointerUp:Ne=>{aN(Ne,t)},onContextMenu:Ne=>{TR(Ne,n)},children:q?h.jsx(HQ,{id:n,foundationModel:e,roofType:b,roofSegments:ze,center:new ie(ge.x,ge.y,U),thickness:p,lineWidth:w,lineColor:y,sideColor:f,color:Ke,textureType:u,heatmap:Pe}):h.jsxs(h.Fragment,{children:[ze.map((Ne,De,ke)=>h.jsx(a$,{id:n,index:De,foundationModel:e,roofType:b,segment:Ne,centroid:he,thickness:p,color:Ke,sideColor:f,texture:S,heatmap:Be&&De0&&Ie&&h.jsx(PW,{cz:x[0].lz,points:Ie}),R&&!g&&h.jsxs("group",{position:[0,0,p+.15],children:[h.jsx(oh,{position:[de.x,de.y,de.z],onPointerDown:()=>{if(Q.current=!0,D(!0),b4.set(de.x,de.y,U),e&&x[0]){const Ne=H.getState().cameraDirection,De=Math.atan2(Ne.z,Ne.y),ke=x[0].relativeAngle;S4.set(-Gt-De,0,ke,"ZXY")}W(Lr.Left),Fn.getState().setEnableOrbitController(!1)}}),h.jsx(oh,{position:[he.x,he.y,he.z],onPointerDown:Ne=>{if(ve(t.id,Ne,Oo.Select),Q.current=!0,le.current=C,D(!0),b4.set(he.x,he.y,U),e){const De=-Math.atan2(_.position.x-r,_.position.y-i)-e.rotation[2];S4.set(-Gt,0,De,"ZXY")}W(Lr.Mid),Fn.getState().setEnableOrbitController(!1),T(De=>{De.resizeHandleType=vt.Top,De.selectedElementHeight=U+t.thickness})},onPointerOver:()=>{T(Ne=>{Ne.hoveredHandle=Lr.Mid,Ne.selectedElementHeight=U+t.thickness,Ne.selectedElementX=ge.x,Ne.selectedElementY=ge.y})}}),h.jsx(oh,{position:[Z.x,Z.y,Z.z],onPointerDown:()=>{if(Q.current=!0,D(!0),b4.set(Z.x,Z.y,U),e&&x[0]){const Ne=H.getState().cameraDirection,De=Math.atan2(Ne.z,Ne.y),ke=x[0].relativeAngle;S4.set(-Gt-De,0,ke,"ZXY")}W(Lr.Right),Fn.getState().setEnableOrbitController(!1)}})]}),M&&h.jsx(ua,{name:"Roof Intersection Plane",ref:O,args:[1e3,100],visible:!1,position:b4,rotation:S4,onPointerMove:Ne=>{if(O.current&&Q.current){se(Ne);const De=X.intersectObjects([O.current]);if(De[0]&&e){const ke=De[0].point;if(ke.z<.001)return;const Ye=x[0],it=new ie().subVectors(Ye.rightPoint,Ye.leftPoint).length();switch(E){case Lr.Left:{const Ve=he.clone().sub(b4).applyEuler(new nn(0,0,-S4.z)),yt=ke.clone().sub(new ie(e.cx,e.cy,e.cz)).applyEuler(new nn(0,0,-e.rotation[2])).sub(b4).applyEuler(new nn(0,0,-S4.z)),ct=new ie().subVectors(yt,Ve).x;L(me.clamp(-ct,-k+.1,it/2-.01));break}case Lr.Right:{const Ve=he.clone().sub(b4).applyEuler(new nn(0,0,-S4.z)),yt=ke.clone().sub(new ie(e.cx,e.cy,e.cz)).applyEuler(new nn(0,0,-e.rotation[2])).sub(b4).applyEuler(new nn(0,0,-S4.z)),ct=new ie().subVectors(yt,Ve).x;N(me.clamp(ct,-j+.1,it/2-.01));break}case Lr.Mid:{const Ve=Math.max(0,ke.z-e.lz-.3-F);H.getState().updateRoofRiseById(n,Ve,U+t.thickness);break}}}}},onPointerUp:()=>{switch(E){case Lr.Mid:{rN(n,le.current,C);break}case Lr.Left:case Lr.Right:te(n,j,k),re(n,s,c,j,k)}Q.current=!1,D(!1),W(Lr.Null),Fn.getState().setEnableOrbitController(!0)},children:h.jsx("meshBasicMaterial",{side:$r,transparent:!0,opacity:.5})})]})},ibt=be.memo(rbt,qH),Rre=new ie,Hre=new nn,abt=new ie(0,0,1),lbt=be.memo(({roofSegments:t,thickness:e,lineWidth:n,lineColor:o})=>{const r=m.useMemo(()=>t.reduce((s,c)=>s.concat(c.points[1]),[t[0].points[0]]),[t]),i=m.useMemo(()=>t.reduce((s,c)=>s.concat(c.points[6].clone()),[t[0].points[7].clone()]),[t]),a=m.useMemo(()=>h.jsx(jn,{points:r,lineWidth:n,color:o}),[r,n,o]);if(t.length<2)return null;const l=Math.abs(t[0].points[0].z-t[0].points[3].z)<.1;return h.jsxs(h.Fragment,{children:[!l&&h.jsx(jn,{points:i,lineWidth:n,color:o}),a,h.jsx("group",{position:[0,0,e],children:a}),t.map((s,c)=>h.jsxs(be.Fragment,{children:[!l&&h.jsx(jn,{points:[s.points[7],s.points[4]],lineWidth:n,color:o}),h.jsx(jn,{points:[s.points[4],s.points[0]],lineWidth:n,color:o})]},c))]})}),sbt=({roofModel:t,foundationModel:e})=>{let{id:n,wallsId:o,cx:r,cy:i,lz:a,textureType:l,color:s="white",sideColor:c="white",thickness:u=.2,locked:d,lineColor:f="black",lineWidth:p=.2,roofType:g,foundationId:y,ridgeWidth:w=1,rise:b=a,ceiling:C=!1,frontRidge:P,backRidge:v}=t;const T=$H(l),A=Es(n);[f,p]=Cn.getWireframetStyle(f,p,A,d);const x=H(fn),S=H(yp),R=H(Ds),M=H(gt=>gt.ray),D=H(gt=>gt.mouse),[E,W]=m.useState(w),[j,L]=m.useState(null),[k,N]=m.useState(!1),[F,U]=m.useState(Lr.Null),[O,B]=m.useState(null),_=m.useRef(E),X=m.useRef(b),$=m.useRef(null),Q=m.useRef(!1),{gl:le,camera:q}=oi(),te=b<.01,re=gt=>{const dt=[],Ct=gt.length;for(const tt of gt)tt.leftPoint[0]!==void 0&&tt.leftPoint[1]!==void 0&&dt.push({x:tt.leftPoint[0],y:tt.leftPoint[1]});return Z.current||(gt[Ct-1].rightPoint[0]||gt[Ct-1].rightPoint[0]===0)&&(gt[Ct-1].rightPoint[1]||gt[Ct-1].rightPoint[1]===0)&&dt.push({x:gt[Ct-1].rightPoint[0],y:gt[Ct-1].rightPoint[1]}),dt},ae=gt=>{if(gt{D.x=gt.offsetX/le.domElement.clientWidth*2-1,D.y=-(gt.offsetY/le.domElement.clientHeight)*2+1,M.setFromCamera(D,q)},ne=(gt,dt)=>{x(Ct=>{for(const tt of Ct.elements)if(tt.id===gt&&tt.type===z.Roof&&tt.roofType===Go.Mansard){tt.ridgeWidth=dt;break}})},fe=()=>{let gt=1/0;for(let dt=0;dt{const Fe={name:"Resize Mansard Roof Ridge",timestamp:Date.now(),resizedElementId:gt,resizedElementType:z.Roof,oldVal:Ct,newVal:tt,type:dt,undo:()=>{ne(Fe.resizedElementId,Fe.oldVal)},redo:()=>{ne(Fe.resizedElementId,Fe.newVal)}};H.getState().addUndoable(Fe)},{currentWallArray:de,isLoopRef:Z}=u$e(y,n,o),{highestWallHeight:he,topZ:xe}=d$e(de,b);uN(t,he);const He=m.useMemo(()=>{if(de.length<2)return new ie;const gt=re(de),dt=me.calculatePolygonCentroid(gt);return Number.isNaN(dt.x)||Number.isNaN(dt.y)?new ie:new ie(dt.x,dt.y,xe)},[de,xe]),Se=m.useMemo(()=>{const gt=de.map(dt=>Cn.getWallNormal(dt).multiplyScalar(dt.eavesLength??0));if(!Z.current&>.length!==0){const dt=new ie().subVectors(new ie(de[de.length-1].rightPoint[0],de[de.length-1].rightPoint[1]),new ie(de[0].leftPoint[0],de[0].leftPoint[1])).applyEuler(gG).normalize().multiplyScalar(.3);gt.push(dt)}return gt},[de]),ze=m.useMemo(()=>{const gt=de.map((dt,Ct)=>({leftPoint:new ie(dt.leftPoint[0],dt.leftPoint[1]).add(Se[Ct]),rightPoint:new ie(dt.rightPoint[0],dt.rightPoint[1]).add(Se[Ct])}));return!Z.current&>.length!==0&>.push({leftPoint:new ie(de[de.length-1].rightPoint[0],de[de.length-1].rightPoint[1]).add(Se[Se.length-1]),rightPoint:new ie(de[0].leftPoint[0],de[0].leftPoint[1]).add(Se[Se.length-1])}),gt},[de,Se]),Ie=m.useMemo(()=>{const gt=de.map((dt,Ct)=>{const tt=new ie(dt.leftPoint[0],dt.leftPoint[1]),Fe=new ie(dt.rightPoint[0],dt.rightPoint[1]),qe=new ie().subVectors(He,tt).setZ(0).normalize().multiplyScalar(E),je=new ie().subVectors(He,Fe).setZ(0).normalize().multiplyScalar(E);return tt.add(qe).setZ(xe),Fe.add(je).setZ(xe),{leftPoint:tt,rightPoint:Fe}});return!Z.current&>.length!==0&>.push({leftPoint:gt[gt.length-1].rightPoint,rightPoint:gt[0].leftPoint}),gt},[de,He,E]),ye=m.useMemo(()=>abt.clone().multiplyScalar(u),[u]),ce=m.useMemo(()=>{const gt=[];if(de.length<2)return gt;const dt=fe();for(let Ct=0;Ct0&&tt.rightPoint.length>0&&(tt.leftPoint[0]!==tt.rightPoint[0]||tt.leftPoint[1]!==tt.rightPoint[1])){const Fe=[];let{lh:qe,rh:je}=Cn.getWallHeight(de,Ct);Z.current||(Ct===0&&(qe=de[0].lz),Ct===de.length-1&&(je=de[de.length-1].lz));const rt=Cn.getIntersectionPoint(ze[(Ct+ze.length-1)%ze.length].leftPoint,ze[(Ct+ze.length-1)%ze.length].rightPoint,ze[Ct].leftPoint,ze[Ct].rightPoint).setZ(qe-dt).sub(He),mt=Cn.getIntersectionPoint(ze[Ct].leftPoint,ze[Ct].rightPoint,ze[(Ct+1)%ze.length].leftPoint,ze[(Ct+1)%ze.length].rightPoint).setZ(je-dt).sub(He),Qe=Ie[Ct].leftPoint.clone().sub(He),Tt=Ie[Ct].rightPoint.clone().sub(He),Dt=new ie(tt.cx,tt.cy).sub(He.clone().setZ(0)).length();Fe.push(rt,mt,Tt,Qe),Fe.push(rt.clone().add(ye),mt.clone().add(ye),Tt.clone().add(ye),Qe.clone().add(ye)),gt.push({points:Fe,angle:-tt.relativeAngle,length:Dt})}}if(!Z.current){const Ct=ze.length-1,tt=Cn.getIntersectionPoint(ze[Ct-1].leftPoint,ze[Ct-1].rightPoint,ze[Ct].leftPoint,ze[Ct].rightPoint).setZ(de[de.length-1].lz-dt).sub(He),Fe=Cn.getIntersectionPoint(ze[Ct].leftPoint,ze[Ct].rightPoint,ze[0].leftPoint,ze[0].rightPoint).setZ(de[0].lz-dt).sub(He),qe=Ie[Ct].leftPoint.clone().sub(He),je=Ie[Ct].rightPoint.clone().sub(He);let rt=Math.atan2(Fe.y-tt.y,Fe.x-tt.x);rt=rt>=0?rt:(la+rt)%la;const mt=new ie().addVectors(tt,Fe).setZ(0).divideScalar(2).length(),Qe=[];Qe.push(tt,Fe,je,qe),Qe.push(tt.clone().add(ye),Fe.clone().add(ye),je.clone().add(ye),qe.clone().add(ye)),gt.push({points:Qe,angle:-rt,length:mt})}return gt},[de,xe,E,u]),pe=m.useMemo(()=>{const gt=new Fl;if(Ie.length>0){const dt=Ie[0].leftPoint.clone().sub(He);gt.moveTo(dt.x,dt.y);for(const Ct of Ie){const tt=Ct.rightPoint.clone().sub(He);gt.lineTo(tt.x,tt.y)}gt.closePath()}return gt},[de,Ie]),ve=m.useMemo(()=>{const gt=[];if(de.length===0)return gt;gt.push(new ie().fromArray(de[0].leftPoint));for(const dt of de)gt.push(new ie().fromArray(dt.rightPoint));return gt},[de]);m.useEffect(()=>{w!==E&&W(w)},[w]),m.useEffect(()=>{if(de.length>1){if(H.getState().addedRoofIdSet.has(n)){for(let gt=0;gt{for(const Ct of dt.elements)if(Ct.id===de[gt].id&&Ct.type===z.Wall){const tt=Ct;tt.roofId=n,tt.leftRoofHeight=void 0,tt.rightRoofHeight=void 0;break}});H.getState().deleteAddedRoofId(n)}}else S(n,!1,!1,!0)},[de]),Lye(e,n,ce,He,xe,u),m.useEffect(()=>{(P!==void 0||v!==void 0)&&x(gt=>{for(const dt of gt.elements)if(dt.type===z.Wall){const Ct=dt;Ct.roofId===n&&(Ct.centerLeftRoofHeight=void 0,Ct.centerRightRoofHeight=void 0)}else dt.type===z.Roof&&dt.roofType===Go.Mansard&&dt.id===n&&(dt.frontRidge=void 0,dt.backRidge=void 0)})},[]);const Ae=()=>{const gt=[];for(let Ct=0;Ct0&&tt.rightPoint.length>0&&(tt.leftPoint[0]!==tt.rightPoint[0]||tt.leftPoint[1]!==tt.rightPoint[1])){let{lh:Fe,rh:qe}=Cn.getWallHeight(de,Ct);Z.current||(Ct===0&&(Fe=de[0].lz),Ct===de.length-1&&(qe=de[de.length-1].lz));const je=new ie(tt.leftPoint[0],tt.leftPoint[1],Fe),rt=new ie(tt.rightPoint[0],tt.rightPoint[1],qe),mt=Ie[Ct].leftPoint.clone(),Qe=Ie[Ct].rightPoint.clone();gt.push([je,rt,Qe,mt])}}if(!Z.current){const Ct=de.length-1,tt=de[0],Fe=de[Ct],qe=new ie(Fe.rightPoint[0],Fe.rightPoint[1],Fe.lz),je=new ie(tt.leftPoint[0],tt.leftPoint[1],tt.lz),rt=Ie[Ct].leftPoint.clone(),mt=Ie[Ct].rightPoint.clone();gt.push([qe,je,mt,rt])}const dt=Ie.map(Ct=>Ct.leftPoint.clone());if(gt.push(dt),te){const Ct=[];for(const tt of gt.slice(0,-1))Ct.push(tt[0].clone());Tn.getState().setRoofSegmentVerticesWithoutOverhang(n,[Ct])}else Tn.getState().setRoofSegmentVerticesWithoutOverhang(n,gt)},Te=sN(n,He,ce,te,Go.Mansard,Ie.map(gt=>gt.leftPoint.clone().add(ye)));cN(Ae);const Me=H.getState().world,Pe=H(Y0),Ee=ht(Ss),Be=H(Cf),Je=Tn(u1),[We,Ke]=m.useState([]),[Ne,De]=m.useState(null),[ke,Ye]=m.useState(!1),it=ht(h3),Ve=H(e5),yt=H(i3),ct=H(a3),Xe=Tn(dW),ut=Tn.getState().hourlyHeatExchangeArrayMap,ft=m.useRef(null),ot=m.useRef(0),st=m.useRef(),at=m.useRef(),{transparent:Oe,opacity:Ze}=QH();m.useEffect(()=>{if(Ee)if(te){const gt=Je(n);if(gt){const dt=me.fetchHeatmapTexture(gt,Be??5);if(dt){const Ct=Te();if(Ct&&Ct.length>0&&e){const tt=new nn(0,0,e.rotation[2],"ZYX");let Fe=Number.MAX_VALUE,qe=Number.MAX_VALUE,je=-Number.MAX_VALUE,rt=-Number.MAX_VALUE;for(const zt of Ct)for(const Ft of zt){const _t=Ft.clone().applyEuler(tt);_t.x>je&&(je=_t.x),_t.xrt&&(rt=_t.y),_t.y{if(ft.current){const gt=pe.extractPoints(1).shape,dt=.01,Ct=ft.current.geometry,tt=gt.length-1;if(tt===4){const Fe=new Float32Array(18);Fe[0]=gt[3].x,Fe[1]=gt[3].y,Fe[2]=dt,Fe[3]=gt[0].x,Fe[4]=gt[0].y,Fe[5]=dt,Fe[6]=gt[2].x,Fe[7]=gt[2].y,Fe[8]=dt,Fe[9]=gt[2].x,Fe[10]=gt[2].y,Fe[11]=dt,Fe[12]=gt[0].x,Fe[13]=gt[0].y,Fe[14]=dt,Fe[15]=gt[1].x,Fe[16]=gt[1].y,Fe[17]=dt,Ct.setAttribute("position",new gr(Fe,3)),Ct.computeVertexNormals();const qe=Ee?1:6,je=[];je.push(0,0),je.push(qe,0),je.push(0,qe),je.push(0,qe),je.push(qe,0),je.push(qe,qe),Ct.setAttribute("uv",new gr(je,2))}else{const Fe=ft.current.geometry,qe=new Float32Array(tt*9),je=Ee?1:6,rt=[];let mt=Number.MAX_VALUE,Qe=Number.MAX_VALUE,Tt=-Number.MAX_VALUE,Dt=-Number.MAX_VALUE;for(const Ft of gt)Ft.x>Tt?Tt=Ft.x:Ft.xDt?Dt=Ft.y:Ft.y{if(!it||e&&e.notBuilding)return;const gt=ut.get(n+"-"+ce.length);if(!gt)return;const dt=gt.reduce((So,$o)=>So+$o,0),Ct=Xe(n);if(!Ct||!Ct[ce.length])return;const tt=Ct[ce.length].map(So=>So.clone().sub(He).add(new ie(0,0,He.z+u)));if(!tt)return;const Fe=r3*(Me.solarRadiationHeatmapGridCellSize??.5),qe=tt[0].clone(),je=tt[1].clone(),rt=tt[2].clone(),mt=new ie().subVectors(je,qe),Qe=new ie().subVectors(rt,qe),Tt=new ie().subVectors(rt,je),Dt=mt.length(),lt=new ie().crossVectors(Qe,Tt).length()/Dt,zt=Math.max(2,Math.floor(Dt/Fe)),Ft=Math.max(2,Math.floor(lt/Fe));mt.normalize(),Qe.normalize(),Tt.normalize();const _t=new ie().crossVectors(Qe,Tt).normalize(),tn=mt.multiplyScalar(.5*Dt/zt),Qt=new ie().crossVectors(_t,mt).normalize().multiplyScalar(.5*lt/Ft),gn=qe.clone().add(tn).add(Qt).add(new ie(0,0,u));tn.multiplyScalar(2),Qt.multiplyScalar(2),st.current=_t.clone().multiplyScalar(.1);const an=[],mn=new ie,Hn=new Array;for(const So of tt)Hn.push({x:So.x,y:So.y});const Fo=me.getPolygonArea(Hn);if(Fo===0)return;const yo=dt/Fo*(Ve??Qm);ot.current=yo<0?1:0,at.current=new nn(-Math.sign(yo)*Gt,0,0);for(let So=0;Sogt.elements.filter(dt=>dt.parentId===n&&dt.type===z.Window),cy),Ht=m.useMemo(()=>Ut.map(gt=>{const dt=new ie(gt.lx,gt.lz,gt.ly*2),Ct=new ie(gt.cx,gt.cy,gt.cz).sub(He),tt=new nn().fromArray([gt.rotation[0],gt.rotation[1],gt.rotation[2],"ZXY"]),Fe=new is(new t3(dt.x,dt.y,dt.z));return Fe.position.copy(Ct),Fe.rotation.copy(tt),Fe.updateMatrix(),Fe}),[Ut,He]),At=l===Ur.NoTexture&&s&&s===c,kt=R&&!Oe;return h.jsxs("group",{name:`Mansard Roof Group ${n}`,children:[h.jsx("group",{name:`Mansard Roof Segments Group ${n}`,position:[He.x,He.y,He.z],userData:Pt,onPointerDown:gt=>{iN(gt,e.id,n,ce,He)},onPointerMove:gt=>{lN(gt,n)},onPointerUp:gt=>{aN(gt,t)},onContextMenu:gt=>{TR(gt,n)},children:te?h.jsx(HQ,{id:n,foundationModel:e,roofType:g,roofSegments:ce,center:new ie(He.x,He.y,xe),thickness:u,lineWidth:p,lineColor:f,sideColor:c,color:Rt,textureType:l,heatmap:Ne}):h.jsxs(h.Fragment,{children:[ce.map((gt,dt,Ct)=>h.jsx(a$,{id:n,index:dt,foundationModel:e,roofType:g,segment:gt,centroid:He,thickness:u,color:Rt,sideColor:c,texture:T,heatmap:We&&dt0&&h.jsx(lbt,{roofSegments:ce,thickness:u,lineColor:f,lineWidth:p})]})}),C&&b>0&&h.jsx(PW,{points:ve,cz:de[0].lz}),A&&!d&&h.jsxs("group",{position:[He.x,He.y,He.z+u],children:[h.jsx(oh,{position:[0,0,.3],onPointerDown:gt=>{if(Pe(t.id,gt,Oo.Select),Q.current=!0,X.current=b,N(!0),Rre.set(He.x,He.y,xe),e){const dt=-Math.atan2(q.position.x-r,q.position.y-i)-e.rotation[2];Hre.set(-Gt,0,dt,"ZXY")}U(Lr.Top),Fn.getState().setEnableOrbitController(!1),x(dt=>{dt.resizeHandleType=vt.Top,dt.selectedElementHeight=xe+t.thickness})},onPointerOver:()=>{x(gt=>{gt.hoveredHandle=Lr.Top,gt.selectedElementHeight=xe+t.thickness,gt.selectedElementX=He.x,gt.selectedElementY=He.y})}}),Ie.map((gt,dt)=>{const Ct=gt.leftPoint.clone().sub(He);return h.jsx(oh,{position:[Ct.x,Ct.y,0],onPointerDown:()=>{Q.current=!0,N(!0),Rre.set(Ct.x,Ct.y,xe+.15),Hre.set(0,0,0),U(Lr.Ridge),B(dt),L(de.reduce((tt,Fe)=>Math.min(tt,new ie(Fe.leftPoint[0],Fe.leftPoint[1],xe).distanceTo(He)-1),1/0)),Fn.getState().setEnableOrbitController(!1),_.current=E}},dt)})]}),k&&h.jsx(ua,{name:"Roof Intersection Plane",ref:$,args:[1e3,100],visible:!1,position:Rre,rotation:Hre,onPointerMove:gt=>{if($.current&&Q.current){se(gt);const dt=M.intersectObjects([$.current]);if(dt[0]&&e){const Ct=dt[0].point;if(Ct.z<.001)return;switch(F){case Lr.Top:{const tt=Math.max(0,Ct.z-e.lz-.6-he);H.getState().updateRoofRiseById(n,tt,xe+t.thickness);break}case Lr.Ridge:{if(e&&O!==null){const tt=Ct.clone().applyEuler(new nn(0,0,e.rotation[2])).sub(new ie(e.cx,e.cy)).setZ(0),Fe=ae(O),qe=tt.distanceTo(Fe),je=new ie().subVectors(He.clone().setZ(0),Fe);tt.clone().sub(Fe).angleTo(je){switch(F){case Lr.Top:{rN(n,X.current,b);break}case Lr.Ridge:{ge(n,F,_.current,E);break}}x(gt=>{for(const dt of gt.elements)if(dt.id===n&&dt.type===z.Roof&&dt.roofType===Go.Mansard){dt.ridgeWidth=E;break}}),Q.current=!1,N(!1),U(Lr.Null),B(null),Fn.getState().setEnableOrbitController(!0)},children:h.jsx("meshBasicMaterial",{side:$r,transparent:!0,opacity:.5})}),St&&St.map((gt,dt)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:gt,name:"Heat Flux "+dt,lineWidth:ct??Zm,color:yt??g0}),";",h.jsx(Rd,{userData:{unintersectable:!0},position:st.current?gt[ot.current].clone().add(st.current):gt[0],args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:at.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:yt??g0})})]},dt))]})},cbt=be.memo(sbt,qH);var TOe={exports:{}};/*! +`))),{vertexShader:n,fragmentShader:o}}});return e.transparent=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}const gge=new e3({color:16777215,side:$r,transparent:!0}),vwe=8421504,xwe=new Ji,fY=new ie,xre=new ie,Hz=[],e4t=new ie,bre="+x+y";function bwe(t){return Array.isArray(t)?t[0]:t}let pje=()=>{const t=new is(new Rw(1,1),gge);return pje=()=>t,t},gje=()=>{const t=new is(new Rw(1,1,32,1),gge);return gje=()=>t,t};const t4t={type:"syncstart"},n4t={type:"synccomplete"},mje=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],o4t=mje.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");let yje=class extends is{constructor(){const e=new JAt;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=vwe,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=bre,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(t4t),dje({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},n=>{this._isSyncing=!1,this._textRenderInfo=n,this.geometry.updateGlyphs(n.glyphBounds,n.glyphAtlasIndices,n.blockBounds,n.chunkedBounds,n.glyphColors);const o=this._queuedSyncs;o&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{o.forEach(r=>r&&r())})),this.dispatchEvent(n4t),e&&e()})))}onBeforeRender(e,n,o,r,i,a){this.sync(),i.isTroikaTextMaterial&&this._prepareForRender(i),i._hadOwnSide=i.hasOwnProperty("side"),this.geometry.setSide(i._actualSide=i.side),i.side=Ra}onAfterRender(e,n,o,r,i,a){i._hadOwnSide?i.side=i._actualSide:delete i.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let e=this._derivedMaterial;const n=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=gge.clone());if((!e||e.baseMaterial!==n)&&(e=this._derivedMaterial=ZAt(n),n.addEventListener("dispose",function o(){n.removeEventListener("dispose",o),e.dispose()})),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let o=e._outlineMtl;return o||(o=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),o.isTextOutlineMaterial=!0,o.depthWrite=!1,o.map=null,e.addEventListener("dispose",function r(){e.removeEventListener("dispose",r),o.dispose()})),[o,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 bwe(this.material).getDepthMaterial()}get customDistanceMaterial(){return bwe(this.material).getDistanceMaterial()}_prepareForRender(e){const n=e.isTextOutlineMaterial,o=e.uniforms,r=this.textRenderInfo;if(r){const{sdfTexture:l,blockBounds:s}=r;o.uTroikaSDFTexture.value=l,o.uTroikaSDFTextureSize.value.set(l.image.width,l.image.height),o.uTroikaSDFGlyphSize.value=r.sdfGlyphSize,o.uTroikaSDFExponent.value=r.sdfExponent,o.uTroikaTotalBounds.value.fromArray(s),o.uTroikaUseGlyphColors.value=!n&&!!r.glyphColors;let c=0,u=0,d=0,f,p,g,y=0,w=0;if(n){let{outlineWidth:C,outlineOffsetX:P,outlineOffsetY:v,outlineBlur:T,outlineOpacity:A}=this;c=this._parsePercent(C)||0,u=Math.max(0,this._parsePercent(T)||0),f=A,y=this._parsePercent(P)||0,w=this._parsePercent(v)||0}else d=Math.max(0,this._parsePercent(this.strokeWidth)||0),d&&(g=this.strokeColor,o.uTroikaStrokeColor.value.set(g??vwe),p=this.strokeOpacity,p==null&&(p=1)),f=this.fillOpacity;o.uTroikaDistanceOffset.value=c,o.uTroikaPositionOffset.value.set(y,w),o.uTroikaBlurRadius.value=u,o.uTroikaStrokeWidth.value=d,o.uTroikaStrokeOpacity.value=p,o.uTroikaFillOpacity.value=f??1,o.uTroikaCurveRadius.value=this.curveRadius||0;let b=this.clipRect;if(b&&Array.isArray(b)&&b.length===4)o.uTroikaClipRect.value.fromArray(b);else{const C=(this.fontSize||.1)*100;o.uTroikaClipRect.value.set(s[0]-C,s[1]-C,s[2]+C,s[3]+C)}this.geometry.applyClipRect(o.uTroikaClipRect.value)}o.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const i=n?this.outlineColor||0:this.color;if(i==null)delete e.color;else{const l=e.hasOwnProperty("color")?e.color:e.color=new rr;(i!==l._input||typeof i=="object")&&l.set(l._input=i)}let a=this.orientation||bre;if(a!==e._orientation){let l=o.uTroikaOrient.value;a=a.replace(/[^-+xyz]/g,"");let s=a!==bre&&a.match(/^([-+])([xyz])([-+])([xyz])$/);if(s){let[,c,u,d,f]=s;fY.set(0,0,0)[u]=c==="-"?1:-1,xre.set(0,0,0)[f]=d==="-"?-1:1,xwe.lookAt(e4t,fY.cross(xre),xre),l.setFromMatrix4(xwe)}else l.identity();e._orientation=a}}_parsePercent(e){if(typeof e=="string"){let n=e.match(/^(-?[\d.]+)%$/),o=n?parseFloat(n[1]):NaN;e=(isNaN(o)?0:o/100)*this.fontSize}return e}localPositionToTextCoords(e,n=new Xt){n.copy(e);const o=this.curveRadius;return o&&(n.x=Math.atan2(e.x,Math.abs(o)-Math.abs(e.z))*Math.abs(o)),n}worldPositionToTextCoords(e,n=new Xt){return fY.copy(e),this.localPositionToTextCoords(this.worldToLocal(fY),n)}raycast(e,n){const{textRenderInfo:o,curveRadius:r}=this;if(o){const i=o.blockBounds,a=r?gje():pje(),l=a.geometry,{position:s,uv:c}=l.attributes;for(let u=0;u{this[o]=e[o]}),this}clone(){return new this.constructor().copy(this)}};mje.forEach(t=>{const e="_private_"+t;Object.defineProperty(yje.prototype,t,{get(){return this[e]},set(n){n!==this[e]&&(this[e]=n,this._needsSync=!0)}})});const r4t=m.forwardRef(({sdfGlyphSize:t=64,anchorX:e="center",anchorY:n="middle",font:o,fontSize:r=1,children:i,characters:a,onSync:l,...s},c)=>{const u=oi(({invalidate:g})=>g),[d]=m.useState(()=>new yje),[f,p]=m.useMemo(()=>{const g=[];let y="";return m.Children.forEach(i,w=>{typeof w=="string"||typeof w=="number"?y+=w:g.push(w)}),[g,y]},[i]);return DUe(()=>new Promise(g=>jAt({font:o,characters:a},g)),["troika-text",o,a]),m.useLayoutEffect(()=>void d.sync(()=>{u(),l&&l(d)})),m.useEffect(()=>()=>d.dispose(),[d]),m.createElement("primitive",U9({object:d,ref:c,font:o,text:p,anchorX:e,anchorY:n,fontSize:r,sdfGlyphSize:t},s),f)}),Swe=t=>t===Object(t)&&!Array.isArray(t)&&typeof t!="function";function bb(t,e){const n=oi(r=>r.gl),o=o3(df,Swe(t)?Object.values(t):t);if(m.useLayoutEffect(()=>{e==null||e(o)},[e]),m.useEffect(()=>{"initTexture"in n&&(Array.isArray(o)?o:[o]).forEach(n.initTexture)},[n,o]),Swe(t)){const r=Object.keys(t),i={};return r.forEach(a=>Object.assign(i,{[a]:o[r.indexOf(a)]})),i}else return o}bb.preload=t=>o3.preload(df,t);bb.clear=t=>o3.clear(df,t);function Aje(t,e,n){const o=oi(f=>f.size),r=oi(f=>f.viewport),i=typeof t=="number"?t:o.width*r.dpr,a=o.height*r.dpr,l=(typeof t=="number"?n:t)||{},{samples:s=0,depth:c,...u}=l,d=m.useMemo(()=>{const f=new $m(i,a,{minFilter:Gs,magFilter:Gs,type:jx,...u});return c&&(f.depthTexture=new U1e(i,a,v2)),f.samples=s,f},[]);return m.useLayoutEffect(()=>{d.setSize(i,a),s&&(d.samples=s)},[s,d,i,a]),m.useEffect(()=>()=>d.dispose(),[]),d}const i4t=t=>typeof t=="function",a4t=m.forwardRef(({envMap:t,resolution:e=256,frames:n=1/0,children:o,makeDefault:r,...i},a)=>{const l=oi(({set:w})=>w),s=oi(({camera:w})=>w),c=oi(({size:w})=>w),u=m.useRef(null),d=m.useRef(null),f=Aje(e);m.useLayoutEffect(()=>{i.manual||u.current.updateProjectionMatrix()},[c,i]),m.useLayoutEffect(()=>{u.current.updateProjectionMatrix()}),m.useLayoutEffect(()=>{if(r){const w=s;return l(()=>({camera:u.current})),()=>l(()=>({camera:w}))}},[u,r,l]);let p=0,g=null;const y=i4t(o);return ay(w=>{y&&(n===1/0||ptypeof t=="function",s4t=m.forwardRef(({envMap:t,resolution:e=256,frames:n=1/0,makeDefault:o,children:r,...i},a)=>{const l=oi(({set:w})=>w),s=oi(({camera:w})=>w),c=oi(({size:w})=>w),u=m.useRef(null),d=m.useRef(null),f=Aje(e);m.useLayoutEffect(()=>{i.manual||(u.current.aspect=c.width/c.height)},[c,i]),m.useLayoutEffect(()=>{u.current.updateProjectionMatrix()});let p=0,g=null;const y=l4t(r);return ay(w=>{y&&(n===1/0||p{if(o){const w=s;return l(()=>({camera:u.current})),()=>l(()=>({camera:w}))}},[u,o,l]),m.createElement(m.Fragment,null,m.createElement("perspectiveCamera",U9({ref:fge([u,a])},i),!y&&r),m.createElement("group",{ref:d},y&&r(f.texture)))});function fA(t,e){const n=t+"Geometry";return m.forwardRef(({args:o,children:r,...i},a)=>{const l=m.useRef(null);return m.useImperativeHandle(a,()=>l.current),m.useLayoutEffect(()=>void(e==null?void 0:e(l.current))),m.createElement("mesh",U9({ref:l},i),m.createElement(n,{attach:"geometry",args:o}),r)})}const Qr=fA("box"),lR=fA("circle"),Rd=fA("cone"),ca=fA("cylinder"),ds=fA("sphere"),ua=fA("plane"),mge=fA("torus"),sR=fA("ring"),nw=fA("extrude"),K5=1e-5;function c4t(t,e,n){const o=new Fl,r=n-K5;return o.absarc(K5,K5,K5,-Math.PI/2,-Math.PI,!0),o.absarc(K5,e-r*2,K5,Math.PI,Math.PI/2,!0),o.absarc(t-r*2,e-r*2,K5,Math.PI/2,0,!0),o.absarc(t-r*2,K5,K5,0,-Math.PI/2,!0),o}const u4t=m.forwardRef(function({args:[e=1,n=1,o=1]=[],radius:r=.05,steps:i=1,smoothness:a=4,bevelSegments:l=4,creaseAngle:s=.4,children:c,...u},d){const f=m.useMemo(()=>c4t(e,n,r),[e,n,r]),p=m.useMemo(()=>({depth:o-r*2,bevelEnabled:!0,bevelSegments:l*2,steps:i,bevelSize:r-K5,bevelThickness:r,curveSegments:a}),[o,r,a]),g=m.useRef(null);return m.useLayoutEffect(()=>{g.current&&(g.current.center(),lAt(g.current,s))},[f,p]),m.createElement("mesh",U9({ref:d},u),m.createElement("extrudeGeometry",{ref:g,args:[f,p]}),c)});var wje={exports:{}},d4t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",f4t=d4t,h4t=f4t;function vje(){}function xje(){}xje.resetWarningCache=vje;var p4t=function(){function t(o,r,i,a,l,s){if(s!==h4t){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:xje,resetWarningCache:vje};return n.PropTypes=n,n};wje.exports=p4t();var Wq=wje.exports;const go=Fi(Wq),Fn=XK()((t,e)=>({setEnableOrbitController:n=>{H.getState().viewState.navigationView||t(o=>{var r;return(r=o.orbitControlsRef)!=null&&r.current&&(o.orbitControlsRef.current.enabled=n),o})},selectNone:()=>{t({humanRef:null,treeRef:null,foundationRef:null})},contentRef:null,compassRef:null,orbitControlsRef:null,humanRef:null,treeRef:null,flowerRef:null,foundationRef:null,cuboidRef:null,listenToAutoDeletionByCutRef:null,listenToAutoDeletionByDeleteRef:null,setListenToAutoDeletionByCut:n=>{const o=e().listenToAutoDeletionByCutRef;o&&(o.current=n)},setListenToAutoDeletionByDelete:n=>{const o=e().listenToAutoDeletionByDeleteRef;o&&(o.current=n)},canvas:null,pointer:new Xt,solarPanelCountRef:null}));var Ti=(t=>(t.Default="Default",t.Arched="Arched",t.Circular="Circular",t.Polygonal="Polygonal",t))(Ti||{});const bje="/aladdin/assets/jaah-XpG2K-Xo.png",Sje="/aladdin/assets/jack-DVed1dhl.png",Tje="/aladdin/assets/jacob-D-6uVZRV.png",Pje="/aladdin/assets/jacqueline-DZtJs4FX.png",Cje="/aladdin/assets/jade-Cxa-afE4.png",Rje="/aladdin/assets/jamelia-Bmq4EsGl.png",Hje="/aladdin/assets/james-QtBSrtsa.png",Mje="/aladdin/assets/jane-ZqCTWK8F.png",Ije="/aladdin/assets/jaya-DD0RNxX8.png",zje="/aladdin/assets/jaye-DPA2kSta.png",Dje="/aladdin/assets/jeanette-D3EEzZKV.png",Eje="/aladdin/assets/jedi-CUm23-QH.png",Fje="/aladdin/assets/jeff-931UF5LC.png",kje="/aladdin/assets/jena-qnIKFCdf.png",Lje="/aladdin/assets/jennifer-Cvadr5-Q.png",Wje="/aladdin/assets/jess-DyGUx_b1.png",Nje="/aladdin/assets/jett-B01M7z86.png",Uje="/aladdin/assets/jill-CxIC2A4v.png",jje="/aladdin/assets/jiya-CF0SpO2m.png",Bje="/aladdin/assets/joan-DWpjHIrM.png",Yje="/aladdin/assets/jocelyn-DGLHmbKA.png",Oje="/aladdin/assets/joel-DhW3d8dZ.png",_je="/aladdin/assets/joey-Dmd3kcA2.png",Vje="/aladdin/assets/john-QF2zQU-p.png",Gje="/aladdin/assets/jonathon-TM1sY2jf.png",Xje="/aladdin/assets/jose-CtYKGQoQ.png",Jje="/aladdin/assets/joseph-C7wga7kl.png",Kje="/aladdin/assets/joshua-CqTzsm-K.png",qje="/aladdin/assets/judd-C8GabaWl.png",$je="/aladdin/assets/judy-Cv4UEjOl.png",Qje="/aladdin/assets/julia-Ckjw2r2H.png",Zje="/aladdin/assets/julio-CPCcOGMU.png",eBe="/aladdin/assets/jumapili-TjSAWyhv.png",tBe="/aladdin/assets/june-Bkxc2WDe.png",nBe="/aladdin/assets/juro-BAi3R6Hw.png",oBe="/aladdin/assets/justin-DLG1o6Q7.png";class Fp{static fetchGender(e){switch(e){case Yt.Jaah:return Ha.Male;case Yt.Jacqueline:return Ha.Female;case Yt.Jade:return Ha.Female;case Yt.Jamelia:return Ha.Female;case Yt.James:return Ha.Male;case Yt.Jane:return Ha.Female;case Yt.Jaya:return Ha.Female;case Yt.Jaye:return Ha.Male;case Yt.Jeanette:return Ha.Female;case Yt.Jedi:return Ha.Male;case Yt.Jeff:return Ha.Male;case Yt.Jena:return Ha.Female;case Yt.Jennifer:return Ha.Female;case Yt.Jess:return Ha.Female;case Yt.Jett:return Ha.Male;case Yt.Jill:return Ha.Female;case Yt.Jiya:return Ha.Female;case Yt.Joan:return Ha.Female;case Yt.Jocelyn:return Ha.Female;case Yt.Joel:return Ha.Male;case Yt.Joey:return Ha.Female;case Yt.John:return Ha.Male;case Yt.Jonathon:return Ha.Male;case Yt.Jose:return Ha.Male;case Yt.Joseph:return Ha.Male;case Yt.Joshua:return Ha.Male;case Yt.Judd:return Ha.Male;case Yt.Judy:return Ha.Female;case Yt.Julia:return Ha.Female;case Yt.Julio:return Ha.Male;case Yt.Jumapili:return Ha.Female;case Yt.June:return Ha.Female;case Yt.Juro:return Ha.Male;case Yt.Justin:return Ha.Male;default:return Ha.Male}}static fetchLabel(e,n){switch(e){case Yt.Jaah:return Y.t("people.Jaah",n);case Yt.Jacob:return Y.t("people.Jacob",n);case Yt.Jacqueline:return Y.t("people.Jacqueline",n);case Yt.Jade:return Y.t("people.Jade",n);case Yt.Jamelia:return Y.t("people.Jamelia",n);case Yt.James:return Y.t("people.James",n);case Yt.Jane:return Y.t("people.Jane",n);case Yt.Jaya:return Y.t("people.Jaya",n);case Yt.Jaye:return Y.t("people.Jaye",n);case Yt.Jeanette:return Y.t("people.Jeanette",n);case Yt.Jedi:return Y.t("people.Jedi",n);case Yt.Jeff:return Y.t("people.Jeff",n);case Yt.Jena:return Y.t("people.Jena",n);case Yt.Jennifer:return Y.t("people.Jennifer",n);case Yt.Jess:return Y.t("people.Jess",n);case Yt.Jett:return Y.t("people.Jett",n);case Yt.Jill:return Y.t("people.Jill",n);case Yt.Jiya:return Y.t("people.Jiya",n);case Yt.Joan:return Y.t("people.Joan",n);case Yt.Jocelyn:return Y.t("people.Jocelyn",n);case Yt.Joel:return Y.t("people.Joel",n);case Yt.Joey:return Y.t("people.Joey",n);case Yt.John:return Y.t("people.John",n);case Yt.Jonathon:return Y.t("people.Jonathon",n);case Yt.Jose:return Y.t("people.Jose",n);case Yt.Joseph:return Y.t("people.Joseph",n);case Yt.Joshua:return Y.t("people.Joshua",n);case Yt.Judd:return Y.t("people.Judd",n);case Yt.Judy:return Y.t("people.Judy",n);case Yt.Julia:return Y.t("people.Julia",n);case Yt.Julio:return Y.t("people.Julio",n);case Yt.Jumapili:return Y.t("people.Jumapili",n);case Yt.June:return Y.t("people.June",n);case Yt.Juro:return Y.t("people.Juro",n);case Yt.Justin:return Y.t("people.Justin",n);default:return Y.t("people.Jack",n)}}static fetchHatOffsetY(e){switch(e){case Yt.Jonathon:return-.22}return 0}static fetchHatOffsetX(e){switch(e){case Yt.Jaah:return-.05;case Yt.Jack:return-.05;case Yt.Jacob:return .09;case Yt.Jade:return-.04;case Yt.Jaya:return .04;case Yt.Jaye:return 0;case Yt.Jamelia:return .05;case Yt.Jane:return .02;case Yt.Jeanette:return .08;case Yt.Jedi:return-.02;case Yt.Jeff:return-.05;case Yt.Jena:return .05;case Yt.Jennifer:return .02;case Yt.Jess:return .01;case Yt.Jett:return-.04;case Yt.Jill:return-.03;case Yt.Jiya:return-.03;case Yt.Joan:return-.45;case Yt.Jocelyn:return-.01;case Yt.Joel:return-.48;case Yt.Joey:return .01;case Yt.John:return .01;case Yt.Jonathon:return .02;case Yt.Jose:return .05;case Yt.Joseph:return .05;case Yt.Joshua:return-.01;case Yt.Judy:return .02;case Yt.Julia:return-.02;case Yt.Jumapili:return-.04;case Yt.June:return-.1;case Yt.Juro:return-.08;case Yt.Justin:return-.06;default:return 0}}static fetchHeight(e){switch(e){case Yt.Jaah:return 1.78;case Yt.Jack:return 1.8;case Yt.Jacob:return 1.82;case Yt.Jacqueline:return 1.78;case Yt.Jade:return 1.6;case Yt.James:return 1.75;case Yt.Jane:return 1.67;case Yt.Jaya:return 1.55;case Yt.Jaye:return 1.65;case Yt.Jamelia:return 1.8;case Yt.Jeanette:return 1.62;case Yt.Jedi:return 1.75;case Yt.Jeff:return 1.65;case Yt.Jena:return 1.6;case Yt.Jennifer:return 1.7;case Yt.Jess:return 1.5;case Yt.Jett:return 1.85;case Yt.Jill:return 1.71;case Yt.Jiya:return 1.74;case Yt.Joan:return 1.68;case Yt.Jocelyn:return 1.72;case Yt.Joel:return 1.75;case Yt.Joey:return 1.72;case Yt.John:return 1.85;case Yt.Jonathon:return 1.9;case Yt.Jose:return 1.6;case Yt.Joseph:return 1.88;case Yt.Joshua:return 1.79;case Yt.Judd:return 1.68;case Yt.Judy:return 1.75;case Yt.Julia:return 1.71;case Yt.Julio:return 1.76;case Yt.Jumapili:return 1.65;case Yt.June:return 1.85;case Yt.Juro:return 1.72;case Yt.Justin:return 1.755;default:return 1.8}}static fetchWidth(e){switch(e){case Yt.Jaah:return .74;case Yt.Jack:return .42;case Yt.Jacqueline:return .43;case Yt.Jacob:return .8;case Yt.Jade:return .48;case Yt.James:return .472;case Yt.Jane:return .4;case Yt.Jaya:return .6;case Yt.Jaye:return .55;case Yt.Jamelia:return .65;case Yt.Jeanette:return .4;case Yt.Jedi:return .56;case Yt.Jena:return .695;case Yt.Jennifer:return .45;case Yt.Jess:return .43;case Yt.Jill:return .42;case Yt.Joan:return 1.7;case Yt.Jocelyn:return .4;case Yt.Joel:return 1.8;case Yt.Joey:return .462;case Yt.John:return .6;case Yt.Jonathon:return .6;case Yt.Jose:return 2;case Yt.Joseph:return .6;case Yt.Joshua:return .5;case Yt.Judd:return .544;case Yt.Judy:return .41;case Yt.Julia:return .43;case Yt.Julio:return .5;case Yt.Jumapili:return .75;case Yt.June:return .65;case Yt.Juro:return .494;case Yt.Justin:return .6;default:return .6}}static fetchTextureImage(e){let n;switch(e){case Yt.Jaah:n=bje;break;case Yt.Jacob:n=Tje;break;case Yt.Jacqueline:n=Pje;break;case Yt.Jade:n=Cje;break;case Yt.Jamelia:n=Rje;break;case Yt.James:n=Hje;break;case Yt.Jane:n=Mje;break;case Yt.Jaya:n=Ije;break;case Yt.Jaye:n=zje;break;case Yt.Jeanette:n=Dje;break;case Yt.Jedi:n=Eje;break;case Yt.Jeff:n=Fje;break;case Yt.Jena:n=kje;break;case Yt.Jennifer:n=Lje;break;case Yt.Jess:n=Wje;break;case Yt.Jett:n=Nje;break;case Yt.Jill:n=Uje;break;case Yt.Jiya:n=jje;break;case Yt.Joan:n=Bje;break;case Yt.Jocelyn:n=Yje;break;case Yt.Joel:n=Oje;break;case Yt.Joey:n=_je;break;case Yt.John:n=Vje;break;case Yt.Jonathon:n=Gje;break;case Yt.Jose:n=Xje;break;case Yt.Joseph:n=Jje;break;case Yt.Joshua:n=Kje;break;case Yt.Judd:n=qje;break;case Yt.Judy:n=$je;break;case Yt.Julia:n=Qje;break;case Yt.Julio:n=Zje;break;case Yt.Jumapili:n=eBe;break;case Yt.June:n=tBe;break;case Yt.Juro:n=nBe;break;case Yt.Justin:n=oBe;break;default:n=Sje}return n}}const g4t="/aladdin/assets/no_leaf_flower-CjefG9cq.png",m4t="/aladdin/assets/no_leaf_shrub-DDlKdxg_.png",rBe="/aladdin/assets/bellflower-C5sA-Fge.png",Yce="/aladdin/assets/boxwood-cAqkPwU6.png",Oce="/aladdin/assets/cactus_combo_1-DgrI_pBB.png",_ce="/aladdin/assets/cactus_combo_2-CnD7zsEV.png",Vce="/aladdin/assets/cactus_combo_3-CTLr6iHA.png",Gce="/aladdin/assets/cactus_combo_4-Bv3aYeWB.png",iBe="/aladdin/assets/hibiscus-DqTQjw28.png",aBe="/aladdin/assets/hydrangea-D6uimbNa.png",lBe="/aladdin/assets/hosta-Ds5QIDtm.png",sBe="/aladdin/assets/peony-pnxufFxy.png",cBe="/aladdin/assets/red_rose-BhP67K90.png",uBe="/aladdin/assets/spirea-aOcGALMo.png",dBe="/aladdin/assets/sunflower-l75w306z.png",Xce="/aladdin/assets/tall_bush-g5bJ_GuV.png",fBe="/aladdin/assets/tulip-BqSv3XYD.png",hBe="/aladdin/assets/white_flower-BUfV78a-.png",pBe="/aladdin/assets/yellow_flower-BQ5dOM0H.png";class p8{static fetchSpread(e){switch(e){case ro.Bellflower:return .45;case ro.Boxwood:return 1.6;case ro.CactusCombo1:return 1;case ro.CactusCombo2:return 1;case ro.CactusCombo3:return 1;case ro.CactusCombo4:return 1;case ro.Hosta:return 1;case ro.Hibiscus:return 2;case ro.Hydrangea:return 2;case ro.Peony:return 1.5;case ro.RedRose:return .5;case ro.Spirea:return 1.8;case ro.Sunflower:return 1;case ro.TallBush:return 1;case ro.Tulip:return .4;case ro.YellowFlower:return 2;default:return .8}}static fetchHeight(e){switch(e){case ro.Bellflower:return .4;case ro.Boxwood:return 1.44;case ro.CactusCombo1:return 1.18;case ro.CactusCombo2:return 1.35;case ro.CactusCombo3:return 1.24;case ro.CactusCombo4:return 1.35;case ro.Hosta:return .7;case ro.Hibiscus:return 1.7;case ro.Hydrangea:return 1.5;case ro.Peony:return 1;case ro.RedRose:return .8;case ro.Spirea:return 1.6;case ro.Sunflower:return 2;case ro.TallBush:return 2;case ro.Tulip:return .7;case ro.YellowFlower:return 1.4;default:return .5}}static fetchLabel(e,n){switch(e){case ro.Bellflower:return Y.t("flower.Bellflower",n);case ro.Boxwood:return Y.t("flower.Boxwood",n);case ro.CactusCombo1:return Y.t("flower.CactusCombo1",n);case ro.CactusCombo2:return Y.t("flower.CactusCombo2",n);case ro.CactusCombo3:return Y.t("flower.CactusCombo3",n);case ro.CactusCombo4:return Y.t("flower.CactusCombo4",n);case ro.Hibiscus:return Y.t("flower.Hibiscus",n);case ro.Hydrangea:return Y.t("flower.Hydrangea",n);case ro.Hosta:return Y.t("flower.Hosta",n);case ro.Peony:return Y.t("flower.Peony",n);case ro.RedRose:return Y.t("flower.RedRose",n);case ro.Spirea:return Y.t("flower.Spirea",n);case ro.Sunflower:return Y.t("flower.Sunflower",n);case ro.TallBush:return Y.t("flower.TallBush",n);case ro.Tulip:return Y.t("flower.Tulip",n);case ro.YellowFlower:return Y.t("flower.YellowFlower",n);default:return Y.t("flower.WhiteFlower",n)}}static fetchTextureImage(e,n){if(n)return e===ro.Hibiscus||e===ro.Hydrangea||e===ro.YellowFlower||e===ro.Spirea?m4t:e===ro.Boxwood?Yce:e===ro.TallBush?Xce:e===ro.CactusCombo1?Oce:e===ro.CactusCombo2?_ce:e===ro.CactusCombo3?Vce:e===ro.CactusCombo4?Gce:g4t;let o;switch(e){case ro.Bellflower:o=rBe;break;case ro.Boxwood:o=Yce;break;case ro.CactusCombo1:o=Oce;break;case ro.CactusCombo2:o=_ce;break;case ro.CactusCombo3:o=Vce;break;case ro.CactusCombo4:o=Gce;break;case ro.Hibiscus:o=iBe;break;case ro.Hydrangea:o=aBe;break;case ro.Hosta:o=lBe;break;case ro.Peony:o=sBe;break;case ro.RedRose:o=cBe;break;case ro.Spirea:o=uBe;break;case ro.Sunflower:o=dBe;break;case ro.TallBush:o=Xce;break;case ro.Tulip:o=fBe;break;case ro.YellowFlower:o=pBe;break;default:o=hBe}return o}}class Ga{static makeHuman(e,n,o,r,i){return{type:z.Human,name:e??Yt.Jack,cx:o,cy:r,cz:i,lx:Fp.fetchWidth(e??Yt.Jack),lz:Fp.fetchHeight(e??Yt.Jack),normal:[0,1,0],rotation:[0,0,0],parentId:n,id:Xi.generate()}}static makeTree(e,n,o,r,i,a,l){return{type:z.Tree,name:e??pr.Dogwood,cx:i,cy:a,cz:l,lx:n??3,lz:o??4,normal:[0,1,0],rotation:[0,0,0],parentId:r,id:Xi.generate()}}static makeSolarPanel(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y,w){let b;switch(e.type){case z.Foundation:b=e.id,w=z.Foundation;break;case z.Cuboid:b=e.id,w=z.Cuboid;break;case z.Wall:case z.Roof:b=e.parentId;break}return{type:z.SolarPanel,pvModelName:n.name,trackerType:za.NO_TRACKER,relativeAzimuth:u??0,tiltAngle:c??0,orientation:a??vr.landscape,drawSunBeam:!1,poleHeight:l??1,poleRadius:.05,poleSpacing:s??3,cx:o,cy:r,cz:i,lx:g??(a===vr.landscape?n.length:n.width),ly:y??(a===vr.landscape?n.width:n.length),lz:n.thickness,showLabel:!1,normal:d?d.toArray():[0,0,1],rotation:f||[0,0,0],color:"#fff",frameColor:p??"white",parentType:w??e.type,parentId:e.id,foundationId:b,id:Xi.generate(),version:1}}static makeWaterHeater(e,n,o,r,i,a){return{type:z.WaterHeater,cx:n,cy:o,cz:r,lx:1.5,ly:2,lz:1,relativeAzimuth:0,showLabel:!1,normal:i?i.toArray():[0,0,1],rotation:a||[0,0,0],color:"#fff",parentType:e.type,parentId:e.id,foundationId:e.parentId,id:Xi.generate()}}static makePowerWall(e,n,o,r){return{type:z.BatteryStorage,id:Xi.generate(),parentId:e.id,foundationId:e.parentId,cx:n,cy:o,cz:r,lx:1,ly:.35,lz:1.6,normal:[0,-1,0],rotation:[0,0,0],color:"#C7BABE"}}static makeFlower(e,n,o,r,i){return{type:z.Flower,name:e??ro.YellowFlower,cx:o,cy:r,cz:i,lx:p8.fetchSpread(e??ro.YellowFlower),lz:p8.fetchHeight(e??ro.YellowFlower),normal:[0,1,0],rotation:[0,0,0],parentId:n,id:Xi.generate()}}static makeCuboid(e,n,o,r,i){return{type:z.Cuboid,cx:e,cy:n,cz:o?o/2:2,lx:.1,ly:.1,lz:o??4,color:"#808080",faceColors:r??["#808080","#808080","#808080","#808080","#808080","#808080"],textureTypes:i??[Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture],stackable:H.getState().actionState.cuboidStackable,transparency:H.getState().actionState.cuboidTransparency,normal:[0,0,1],rotation:[0,0,0],parentId:Zo,selected:!1,id:Xi.generate()}}static makeFoundation(e,n,o,r,i){return{type:z.Foundation,cx:e,cy:n,cz:o?o/2:.05,lx:0,ly:0,lz:o??.1,normal:[0,0,1],rotation:[0,0,0],parentId:Zo,selected:!1,color:r??"#808080",textureType:i??Yi.NoTexture,solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},id:Xi.generate()}}static makeParabolicTrough(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y){let w;switch(e.type){case z.Foundation:w=e.id;break}return{type:z.ParabolicTrough,reflectance:n??.9,absorptance:o??.95,opticalEfficiency:r??.7,thermalEfficiency:i??.3,moduleLength:s??3,latusRectum:a??2,relativeAzimuth:0,tiltAngle:0,absorberTubeRadius:.05,drawSunBeam:!1,poleHeight:l??.2,poleRadius:.05,cx:c,cy:u,cz:d,lx:g??2,ly:y??9,lz:.1,showLabel:!1,normal:f?f.toArray():[0,0,1],rotation:p||[0,0,0],parentId:e.id,foundationId:w,id:Xi.generate()}}static makeParabolicDish(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y){let w;switch(e.type){case z.Foundation:w=e.id;break}return{type:z.ParabolicDish,reflectance:n??.9,absorptance:o??.95,opticalEfficiency:r??.7,thermalEfficiency:i??.3,moduleLength:3,latusRectum:a??8,relativeAzimuth:0,tiltAngle:0,structureType:s??uf.CentralPole,receiverRadius:.25,receiverPoleRadius:.1,drawSunBeam:!1,poleHeight:l??.2,poleRadius:.2,cx:c,cy:u,cz:d,lx:g??4,ly:y??4,lz:.1,showLabel:!1,normal:f?f.toArray():[0,0,1],rotation:p||[0,0,0],parentId:e.id,foundationId:w,id:Xi.generate()}}static makeFresnelReflector(e,n,o,r,i,a,l,s,c,u,d,f){let p;switch(e.type){case z.Foundation:p=e.id;break}return{type:z.FresnelReflector,receiverId:n??"None",reflectance:o??.9,moduleLength:i??3,relativeAzimuth:0,tiltAngle:0,drawSunBeam:!1,poleHeight:r??.2,poleRadius:.05,cx:a,cy:l,cz:s,lx:d??2,ly:f??9,lz:.1,showLabel:!1,normal:c?c.toArray():[0,0,1],rotation:u||[0,0,0],parentId:e.id,foundationId:p,id:Xi.generate()}}static makeWindTurbine(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y,w,b,C,P){let v;switch(e.type){case z.Foundation:v=e.id;break}return{type:z.WindTurbine,birdSafe:n,bladeColor:o,stripeColor:r,numberOfBlades:i,initialRotorAngle:a,relativeYawAngle:l,pitchAngle:s,bladeRadius:c,bladeTipWidth:.2,bladeRootRadius:u,maximumChordRadius:f,maximumChordLength:d,towerRadius:p,towerHeight:g,hubRadius:y,hubLength:w,cx:b,cy:C,cz:P,lx:p*4,ly:p*4,lz:g+c,normal:[0,0,1],rotation:[0,0,0],parentId:e.id,foundationId:v,id:Xi.generate()}}static makeHeliostat(e,n,o,r,i,a,l,s,c,u,d){let f;switch(e.type){case z.Foundation:f=e.id;break}return{type:z.Heliostat,towerId:n??"None",reflectance:o??.9,relativeAzimuth:0,tiltAngle:0,drawSunBeam:!1,poleHeight:r??.2,poleRadius:.1,cx:i,cy:a,cz:l,lx:u??2,ly:d??4,lz:.1,showLabel:!1,normal:s?s.toArray():[0,0,1],rotation:c||[0,0,0],parentId:e.id,foundationId:f,id:Xi.generate()}}static makePolygon(e,n,o,r,i,a,l){let s;switch(e.type){case z.Foundation:case z.Cuboid:s=e.id;break;case z.Wall:case z.Roof:s=e.parentId;break}const c=.2,u=.2,d=.2;let f=n,p=o;return e.type===z.Cuboid&&i?me.isUnitVectorX(i)?f=r:me.isUnitVectorY(i)&&(p=r):e.type===z.Wall&&(p=r),{type:z.Polygon,cx:f,cy:p,cz:0,lx:2*c,ly:2*u,lz:2*d,color:"#ffffff",normal:i?i.toArray():[0,0,1],rotation:a||[0,0,0],vertices:[{x:Math.max(-.5,f-c),y:Math.max(-.5,p-u)},{x:Math.max(-.5,f-c),y:Math.min(.5,p+u)},{x:Math.min(.5,f+c),y:Math.min(.5,p+u)},{x:Math.min(.5,f+c),y:Math.max(-.5,p-u)}],parentId:e.id,parentType:l,foundationId:s,selected:!1,filled:!0,selectedIndex:-1,id:Xi.generate()}}static makeWall(e,n,o,r,i){const a=H.getState().actionState;return{type:z.Wall,cx:n,cy:o,cz:r,lx:0,ly:a.wallThickness??.3,lz:a.wallHeight??5,parapet:a.wallParapet,eavesLength:a.wallEavesLength??.3,rValue:a.wallRValue??3,fill:El.Full,leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:a.wallHeight-.5,rightTopPartialHeight:a.wallHeight-.5,relativeAngle:0,leftPoint:[],rightPoint:[],leftJoints:[],rightJoints:[],textureType:a.wallTexture??Uo.Default,color:a.wallColor??"#ffffff",volumetricHeatCapacity:a.wallVolumetricHeatCapacity??.5,wallStructure:a.wallStructure??gc.Default,studSpacing:a.wallStructureSpacing??2,studWidth:a.wallStructureWidth??.1,studColor:a.wallStructureColor??"#ffffff",opacity:a.wallOpacity!==void 0?a.wallOpacity:.5,selected:!1,lineWidth:.2,lineColor:"#000000",windows:[],showLabel:!1,normal:i?i.toArray():[0,0,1],rotation:[0,0,0],parentId:e.id,foundationId:e.id,id:Xi.generate()}}static makeSensor(e,n,o,r,i,a){let l;switch(e.type){case z.Foundation:case z.Cuboid:l=e.id;break;case z.Wall:case z.Roof:l=e.parentId;break}return{type:z.Sensor,cx:n,cy:o,cz:r,lx:.1,ly:.1,lz:.01,showLabel:!1,normal:i?i.toArray():[0,0,1],rotation:a||[0,0,0],parentId:e.id,foundationId:l,parentType:e.type,id:Xi.generate()}}static makeLight(e,n,o,r,i,a,l,s,c,u){let d;switch(e.type){case z.Foundation:case z.Cuboid:d=e.id;break;case z.Wall:case z.Roof:d=e.parentId;break}return{type:z.Light,decay:n??2,distance:o??5,intensity:r??3,color:i??"#ffff99",cx:a,cy:l,cz:s,lx:.16,ly:.16,lz:.08,showLabel:!1,normal:c?c.toArray():[0,0,1],rotation:u||[0,0,0],parentId:e.id,foundationId:d,parentType:e.type,id:Xi.generate()}}static makeWindow(e,n,o,r,i,a,l=0,s=0){let c,u=0;switch(e.type){case z.Cuboid:c=e.id;break;case z.Wall:c=e.parentId,u=e.ly;break;case z.Roof:c=e.parentId,u=e.thickness;break}const d=H.getState().actionState;return{type:z.Window,cx:n,cy:o,cz:r,lx:l,ly:u,lz:s,leftShutter:d.windowShutterLeft,rightShutter:d.windowShutterRight,shutterColor:d.windowShutterColor,shutterWidth:d.windowShutterWidth,horizontalMullion:d.windowHorizontalMullion,verticalMullion:d.windowVerticalMullion,mullionWidth:d.windowMullionWidth,horizontalMullionSpacing:d.windowHorizontalMullionSpacing,verticalMullionSpacing:d.windowVerticalMullionSpacing,mullionColor:d.windowMullionColor,frame:d.windowFrame,frameWidth:d.windowFrameWidth,sillWidth:Cn.isTypeRoof(i)?0:d.windowSillWidth,windowType:d.windowType,empty:d.windowEmpty,interior:d.windowInterior,archHeight:d.windowArchHeight,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,color:d.windowColor??"#ffffff",tint:d.windowTint??"#73D8FF",opacity:d.windowOpacity!==void 0?d.windowOpacity:.5,uValue:d.windowUValue??.5,normal:[0,-1,0],rotation:a?[...a]:[0,0,0],parentId:e.id,parentType:i,foundationId:c,id:Xi.generate()}}static makeDoor(e){let n;switch(e.type){case z.Cuboid:n=e.id;break;case z.Wall:n=e.parentId;break}const o=H.getState().actionState;return{type:z.Door,cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,doorType:o.doorType,filled:o.doorFilled,interior:o.doorInterior,archHeight:o.doorArchHeight,textureType:o.doorTexture??sr.Default,color:o.doorColor??"#ffffff",uValue:o.doorUValue??.5,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:e.id,foundationId:n,id:Xi.generate()}}static makePyramidRoof(e,n){const o=H.getState().actionState;return{type:z.Roof,cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,ceiling:o.roofCeiling??!1,rise:o.roofRise<0?2:o.roofRise,thickness:o.roofThickness??.2,rValue:o.roofRValue??3,color:o.roofColor??"#454769",sideColor:o.roofSideColor??"#ffffff",textureType:o.roofTexture??Ur.Default,roofType:Go.Pyramid,roofStructure:wc.Default,wallsId:[...e],selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:n.id,foundationId:n.id,id:Xi.generate()}}static makeGableRoof(e,n){const o=H.getState().actionState;return{type:z.Roof,cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,ceiling:o.roofCeiling??!1,rise:o.roofRise<0?2:o.roofRise,thickness:o.roofThickness??.2,rValue:o.roofRValue??3,color:o.roofColor??"#454769",sideColor:o.roofSideColor??"#ffffff",textureType:o.roofTexture??Ur.Default,roofType:Go.Gable,roofStructure:wc.Default,wallsId:[...e],selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:n.id,foundationId:n.id,id:Xi.generate(),ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1]}}static makeHipRoof(e,n,o){const r=H.getState().actionState;return{type:z.Roof,cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,ceiling:r.roofCeiling??!1,rise:r.roofRise<0?2:r.roofRise,thickness:r.roofThickness??.2,rValue:r.roofRValue??3,color:r.roofColor??"#454769",sideColor:r.roofSideColor??"#ffffff",textureType:r.roofTexture??Ur.Default,roofType:Go.Hip,roofStructure:wc.Default,wallsId:[...e],selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:n.id,foundationId:n.id,id:Xi.generate(),leftRidgeLength:(o??2)/2,rightRidgeLength:(o??2)/2}}static makeGambrelRoof(e,n){const r=H.getState().actionState;return{type:z.Roof,cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,ceiling:r.roofCeiling??!1,rise:r.roofRise<0?2:r.roofRise,thickness:r.roofThickness??.2,rValue:r.roofRValue??3,color:r.roofColor??"#454769",sideColor:r.roofSideColor??"#ffffff",textureType:r.roofTexture??Ur.Default,roofType:Go.Gambrel,roofStructure:wc.Default,wallsId:[...e],topRidgePoint:[0,1],frontRidgePoint:[.35,.5],backRidgePoint:[.35,.5],selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:n.id,foundationId:n.id,id:Xi.generate()}}static makeMansardRoof(e,n){const o=H.getState().actionState;return{type:z.Roof,cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,ceiling:o.roofCeiling??!1,rise:o.roofRise<0?2:o.roofRise,thickness:o.roofThickness??.2,rValue:o.roofRValue??3,color:o.roofColor??"#454769",sideColor:o.roofSideColor??"#ffffff",textureType:o.roofTexture??Ur.Default,roofType:Go.Mansard,roofStructure:wc.Default,wallsId:[...e],ridgeWidth:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:n.id,foundationId:n.id,id:Xi.generate()}}}const y4t=t=>t.solarPanelArrayLayoutParams.pvModelName,A4t=t=>t.solarPanelArrayLayoutParams.rowAxis,w4t=t=>t.solarPanelArrayLayoutParams.rowsPerRack,v4t=t=>t.solarPanelArrayLayoutParams.interRowSpacing,x4t=t=>t.solarPanelArrayLayoutParams.margin,b4t=t=>t.solarPanelArrayLayoutParams.poleHeight,S4t=t=>t.solarPanelArrayLayoutParams.poleSpacing,T4t=t=>t.solarPanelArrayLayoutParams.tiltAngle,P4t=t=>t.solarPanelArrayLayoutParams.orientation,Nq=t=>t.viewState.navigationView,Ds=t=>t.viewState.shadowEnabled,Uq=t=>t.viewState.shadowCameraFar,gBe=t=>t.viewState.solarPanelShininess,mBe=t=>t.viewState.windowShininess,e5=t=>t.viewState.heatFluxScaleFactor,i3=t=>t.viewState.heatFluxColor,a3=t=>t.viewState.heatFluxWidth,Cf=t=>t.viewState.solarRadiationHeatMapMaxValue,yge=t=>t.viewState.solarRadiationHeatMapReflectionOnly,Age=t=>t.viewState.axes,yBe=t=>t.viewState.ambientLightIntensity,ABe=t=>t.viewState.directLightIntensity,wBe=t=>t.viewState.theme,vBe=t=>t.viewState.showAzimuthAngle,xBe=t=>t.viewState.showElevationAngle,bBe=t=>t.viewState.showZenithAngle,SBe=t=>t.viewState.autoRotate,TBe=t=>t.viewState.hideAddress,hA=t=>t.viewState.groundImage,C4t=t=>t.viewState.groundImageType,PBe=t=>t.viewState.groundColor,CBe=t=>t.viewState.waterSurface,Id=t=>t.viewState.orthographic,R4t=t=>t.viewState.enableRotate,H4t=t=>t.viewState.cameraPosition,M4t=t=>t.viewState.cameraZoom,RBe=t=>t.viewState.heliodon,HBe=t=>t.viewState.showSunAngles,wge=t=>t.viewState.mapZoom,I4t=t=>t.viewState.mapTilt,MBe=t=>t.viewState.mapType,vge=t=>t.viewState.showSiteInfoPanel,jq=t=>t.viewState.showDesignInfoPanel,IBe=t=>t.viewState.showInstructionPanel,zBe=t=>t.viewState.showHeliodonPanel,z4t=t=>t.viewState.heliodonPanelX,D4t=t=>t.viewState.heliodonPanelY,E4t=t=>t.viewState.showMapPanel,F4t=t=>t.viewState.mapPanelX,k4t=t=>t.viewState.mapPanelY,L4t=t=>t.viewState.showWeatherPanel,W4t=t=>t.viewState.weatherPanelRect,N4t=t=>t.viewState.showDiurnalTemperaturePanel,U4t=t=>t.viewState.diurnalTemperaturePanelRect,DBe=t=>t.viewState.showStickyNotePanel,j4t=t=>t.viewState.stickyNotePanelRect,B4t=t=>t.viewState.showDailyBuildingEnergyPanel,Y4t=t=>t.viewState.dailyBuildingEnergyPanelRect,O4t=t=>t.viewState.showYearlyBuildingEnergyPanel,_4t=t=>t.viewState.yearlyBuildingEnergyPanelRect,EBe=t=>t.viewState.showDailyLightSensorPanel,V4t=t=>t.viewState.dailyLightSensorPanelRect,G4t=t=>t.viewState.showYearlyLightSensorPanel,X4t=t=>t.viewState.yearlyLightSensorPanelRect,J4t=t=>t.viewState.yearlyLightSensorPanelShowDaylight,K4t=t=>t.viewState.yearlyLightSensorPanelShowClearness,FBe=t=>t.viewState.showDailyPvYieldPanel,q4t=t=>t.viewState.dailyPvYieldPanelRect,$4t=t=>t.viewState.showYearlyPvYieldPanel,Q4t=t=>t.viewState.yearlyPvYieldPanelRect,Z4t=t=>t.viewState.showSolarPanelVisibilityResultsPanel,e8t=t=>t.viewState.visibilityResultsPanelRect,kBe=t=>t.viewState.showDailyParabolicTroughYieldPanel,t8t=t=>t.viewState.dailyParabolicTroughYieldPanelRect,n8t=t=>t.viewState.showYearlyParabolicTroughYieldPanel,o8t=t=>t.viewState.yearlyParabolicTroughYieldPanelRect,LBe=t=>t.viewState.showDailyParabolicDishYieldPanel,r8t=t=>t.viewState.dailyParabolicDishYieldPanelRect,i8t=t=>t.viewState.showYearlyParabolicDishYieldPanel,a8t=t=>t.viewState.yearlyParabolicDishYieldPanelRect,WBe=t=>t.viewState.showDailyFresnelReflectorYieldPanel,l8t=t=>t.viewState.dailyFresnelReflectorYieldPanelRect,s8t=t=>t.viewState.showYearlyFresnelReflectorYieldPanel,c8t=t=>t.viewState.yearlyFresnelReflectorYieldPanelRect,NBe=t=>t.viewState.showDailyHeliostatYieldPanel,u8t=t=>t.viewState.dailyHeliostatYieldPanelRect,d8t=t=>t.viewState.showYearlyHeliostatYieldPanel,f8t=t=>t.viewState.yearlyHeliostatYieldPanelRect,UBe=t=>t.viewState.showDailyUpdraftTowerYieldPanel,h8t=t=>t.viewState.dailyUpdraftTowerYieldPanelRect,p8t=t=>t.viewState.showYearlyUpdraftTowerYieldPanel,g8t=t=>t.viewState.yearlyUpdraftTowerYieldPanelRect,m8t=t=>t.viewState.showEvolutionPanel,y8t=t=>t.viewState.evolutionPanelRect,Tc=t=>t.world.latitude,Sb=t=>t.world.longitude,rl=t=>t.world.date,xge=t=>t.world.leafDayOfYear1,bge=t=>t.world.leafDayOfYear2,A8t=t=>t.world.ground,Bq=t=>t.world.address,w8t=t=>t.world.countryCode,v8t=t=>t.world.airAttenuationCoefficient,x8t=t=>t.world.airConvectiveCoefficient,jBe=t=>t.world.timesPerHour,IH=t=>t.world.daysPerYear,b8t=t=>t.world.discretization,BBe=t=>t.world.diurnalTemperatureModel,cW=t=>t.world.highestTemperatureTimeInMinutes,S8t=t=>t.world.solarRadiationHeatmapGridCellSize,T8t=t=>t.world.pvGridCellSize,P8t=t=>t.world.solarPanelVisibilityGridCellSize,C8t=t=>t.world.cspTimesPerHour,uW=t=>t.world.cspDaysPerYear,R8t=t=>t.world.cspGridCellSize,H8t=t=>t.world.sutTimesPerHour,YBe=t=>t.world.sutDaysPerYear,M8t=t=>t.world.sutGridCellSize,Sge=t=>t.world.noAnimationForHeatmapSimulation,I8t=t=>t.world.noAnimationForThermalSimulation,Tge=t=>t.world.noAnimationForSensorDataCollection,Pge=t=>t.world.noAnimationForSolarPanelSimulation,OBe=t=>t.world.noAnimationForSolarUpdraftTowerSimulation,fn=t=>t.set,mp=t=>t.user,z8t=t=>t.userCount,D8t=t=>t.showEconomicsPanel,E8t=t=>t.showNavigationPanel,F8t=t=>t.showShadowSettings,k8t=t=>t.minimumNavigationMoveSpeed,L8t=t=>t.minimumNavigationTurnSpeed,W8t=t=>t.navigationMoveSpeed,N8t=t=>t.navigationTurnSpeed,u1=t=>t.getHeatmap,Cge=t=>t.setHeatmap,_Be=t=>t.clearHeatmaps,Rge=t=>t.flagOfDailySimulation,Tb=t=>t.hourlyHeatExchangeArrayMap,U8t=t=>t.setHourlyHeatExchangeArray,j8t=t=>t.hourlySolarHeatGainArrayMap,B8t=t=>t.setHourlySolarHeatGainArray,Y8t=t=>t.hourlySolarPanelOutputArrayMap,O8t=t=>t.setHourlySolarPanelOutputArray,Hge=t=>t.getRoofSegmentVertices,dW=t=>t.getRoofSegmentVerticesWithoutOverhang,_8t=t=>t.latestVersion,VBe=t=>t.changed,V8t=t=>t.setChanged,G8t=t=>t.setSkipChange,no=t=>t.applyCount,Zn=t=>t.setApplyCount,Vi=t=>t.revertApply,Kn=t=>t.elements,X8t=t=>t.notes,fW=t=>t.pvModules,J8t=t=>t.loadPvModules,t5=t=>t.getPvModule,pu=t=>t.floatingWindowOpacity,Pc=t=>t.selectedFloatingWindow,s0=t=>t.language,K8t=t=>t.locale,da=t=>t.loggable,q8t=t=>t.actionInfo,$8t=t=>t.currentUndoable,Yq=t=>t.openModelsMap,Q8t=t=>t.modelsMapLatitude,Z8t=t=>t.modelsMapLongitude,ewt=t=>t.modelsMapZoom,twt=t=>t.modelsMapTilt,Mge=t=>t.modelsMapType,GBe=t=>t.modelsMapWeatherStations,nwt=t=>t.showCloudFileTitleDialog,XBe=t=>t.showCloudFileTitleDialogFlag,Pb=t=>t.cloudFile,owt=t=>t.latestModelSite,JBe=t=>t.modelSites,KBe=t=>t.peopleModels,rwt=t=>t.saveAccountSettingsFlag,iwt=t=>t.saveCloudFileFlag,awt=t=>t.createProjectFlag,lwt=t=>t.saveProjectAsFlag,swt=t=>t.curateDesignToProjectFlag,cwt=t=>t.showProjectsFlag,uwt=t=>t.updateProjectsFlag,dwt=t=>t.modelsMapFlag,fwt=t=>t.leaderboardFlag,hwt=t=>t.showLeaderboard,pwt=t=>t.publishOnModelsMapFlag,gwt=t=>t.listCloudFilesFlag,mwt=t=>t.refreshCloudFilesFlag,ywt=t=>t.localContentToImportAfterCloudFileUpdate,Awt=t=>t.localFileName,wwt=t=>t.createNewFileFlag,vwt=t=>t.openLocalFileFlag,qBe=t=>t.saveLocalFileDialogVisible,zH=t=>t.fileChanged,xwt=t=>t.undoManager,En=t=>t.addUndoable,Ige=t=>t.importContent,$Be=t=>t.exportContent,bwt=t=>t.clearContent,QBe=t=>t.createEmptyFile,Swt=t=>t.aabb,ZBe=t=>t.animateSun,Twt=t=>t.animate24Hours,hW=t=>t.runDailyThermalSimulation,Pwt=t=>t.pauseDailyThermalSimulation,Oq=t=>t.runYearlyThermalSimulation,Cwt=t=>t.pauseYearlyThermalSimulation,Rwt=t=>t.clearDailySimulationResultsFlag,Hwt=t=>t.clearYearlySimulationResultsFlag,pW=t=>t.runDynamicSimulation,zge=t=>t.runStaticSimulation,Mwt=t=>t.pauseSimulation,n5=t=>t.runEvolution,_q=t=>t.pauseEvolution,Vq=t=>t.objectiveEvaluationIndex,DH=t=>t.evolutionMethod,Iwt=t=>t.updateSceneRadiusFlag,eYe=t=>t.updateSceneRadius,Ug=t=>t.sceneRadius,zwt=t=>t.cameraDirection,Dge=t=>t.getCameraDirection,Gn=t=>t.getElementById,pA=t=>t.getFoundation,qr=t=>t.getParent,EH=t=>t.getChildren,l3=t=>t.getChildrenOfType,s3=t=>t.selectedElement,Dwt=t=>t.selectedElementIdSet,Cb=t=>t.getSelectedElement,Ege=t=>t.overlapWithSibling,tYe=t=>t.selectedSideIndex,c3=t=>t.setElementPosition,Fge=t=>t.setElementSize,Ewt=t=>t.setElementNormal,Fwt=t=>t.updateElementLockById,kwt=t=>t.updateElementReferenceById,Lwt=t=>t.updateElementLabelById,Wwt=t=>t.updateElementShowLabelById,nYe=t=>t.updateElementCxById,oYe=t=>t.updateElementCyById,Nwt=t=>t.updateElementCzById,Uwt=t=>t.updateElementCzForAll,u3=t=>t.updateElementLxById,Gq=t=>t.updateElementLxAboveFoundation,gW=t=>t.updateElementLxForAll,Iw=t=>t.updateElementLyById,Xq=t=>t.updateElementLyAboveFoundation,mW=t=>t.updateElementLyForAll,kge=t=>t.updateElementLzById,jwt=t=>t.updateElementLzForAll,rYe=t=>t.updateElementColorById,Bwt=t=>t.updateElementColorOnSurface,Ywt=t=>t.updateElementColorAboveFoundation,iYe=t=>t.updateElementColorForAll,Owt=t=>t.updateElementLineColorById,_wt=t=>t.updateElementLineColorOnSurface,Vwt=t=>t.updateElementLineColorAboveFoundation,Gwt=t=>t.updateElementLineColorForAll,Xwt=t=>t.updateElementLineWidthById,Jwt=t=>t.updateElementLineWidthOnSurface,Kwt=t=>t.updateElementLineWidthAboveFoundation,qwt=t=>t.updateElementLineWidthForAll,Lge=t=>t.updateElementRotationById,$wt=t=>t.updateElementRotationForAll,$s=t=>t.foundationActionScope,Qwt=t=>t.setFoundationActionScope,FH=t=>t.polygonActionScope,kH=t=>t.setPolygonActionScope,aYe=t=>t.updatePolygonVertexPositionById,zw=t=>t.updatePolygonVerticesById,Rb=t=>t.cuboidActionScope,Hb=t=>t.setCuboidActionScope,zd=t=>t.solarPanelActionScope,Dd=t=>t.setSolarPanelActionScope,yW=t=>t.updateSolarCollectorDailyYieldById,AW=t=>t.updateSolarCollectorYearlyYieldById,lYe=t=>t.updateSolarPanelTiltAngleById,sYe=t=>t.updateSolarCollectorDrawSunBeamById,cYe=t=>t.updateSolarCollectorDrawSunBeamAboveFoundation,uYe=t=>t.updateSolarCollectorDrawSunBeamForAll,Jq=t=>t.updateSolarCollectorRelativeAzimuthById,dYe=t=>t.updateSolarCollectorRelativeAzimuthOnSurface,fYe=t=>t.updateSolarCollectorRelativeAzimuthAboveFoundation,hYe=t=>t.updateSolarCollectorRelativeAzimuthForAll,Zwt=t=>t.updateSolarCollectorXById,e7t=t=>t.updateSolarCollectorXAboveFoundation,t7t=t=>t.updateSolarCollectorXForAll,n7t=t=>t.updateSolarCollectorYById,o7t=t=>t.updateSolarCollectorYAboveFoundation,r7t=t=>t.updateSolarCollectorYForAll,wW=t=>t.updateSolarCollectorPoleHeightById,i7t=t=>t.updateSolarCollectorPoleHeightOnSurface,vW=t=>t.updateSolarCollectorPoleHeightAboveFoundation,xW=t=>t.updateSolarCollectorPoleHeightForAll,pYe=t=>t.updateSolarCollectorPoleRadiusById,gYe=t=>t.updateSolarCollectorPoleRadiusAboveFoundation,mYe=t=>t.updateSolarCollectorPoleRadiusForAll,Kq=t=>t.updateCspReflectanceById,qq=t=>t.updateCspReflectanceAboveFoundation,$q=t=>t.updateCspReflectanceForAll,yYe=t=>t.updateParabolicCollectorAbsorptanceById,AYe=t=>t.updateParabolicCollectorAbsorptanceAboveFoundation,wYe=t=>t.updateParabolicCollectorAbsorptanceForAll,vYe=t=>t.updateParabolicCollectorOpticalEfficiencyById,xYe=t=>t.updateParabolicCollectorOpticalEfficiencyAboveFoundation,bYe=t=>t.updateParabolicCollectorOpticalEfficiencyForAll,SYe=t=>t.updateParabolicCollectorThermalEfficiencyById,TYe=t=>t.updateParabolicCollectorThermalEfficiencyAboveFoundation,PYe=t=>t.updateParabolicCollectorThermalEfficiencyForAll,gA=t=>t.parabolicTroughActionScope,mA=t=>t.setParabolicTroughActionScope,Mb=t=>t.fresnelReflectorActionScope,Ib=t=>t.setFresnelReflectorActionScope,zb=t=>t.heliostatActionScope,Db=t=>t.setHeliostatActionScope,CYe=t=>t.updateSolarReceiverById,RYe=t=>t.updateSolarReceiverAboveFoundation,HYe=t=>t.updateSolarReceiverForAll,yA=t=>t.parabolicDishActionScope,AA=t=>t.setParabolicDishActionScope,MYe=t=>t.updateParabolaLatusRectumById,IYe=t=>t.updateParabolaLatusRectumAboveFoundation,zYe=t=>t.updateParabolaLatusRectumForAll,DYe=t=>t.updateModuleLengthById,EYe=t=>t.updateModuleLengthAboveFoundation,FYe=t=>t.updateModuleLengthForAll,d3=t=>t.windTurbineActionScope,f3=t=>t.setWindTurbineActionScope,kYe=t=>t.copyElementById,yp=t=>t.removeElementById,a7t=t=>t.clearDeletedElements,l7t=t=>t.countElementsByReferenceId,Wge=t=>t.removeElementsByReferenceId,LYe=t=>t.pasteElementsToPoint,s7t=t=>t.pasteElementsByKey,WYe=t=>t.elementsToPaste,Y0=t=>t.selectMe,bW=t=>t.selectNone,Nge=t=>t.addElement,Qq=t=>t.objectTypeToAdd,c7t=t=>t.actionModeLock,jg=t=>t.countElementsByType,NYe=t=>t.countSolarStructuresByType,u7t=t=>t.countObservers,d7t=t=>t.countSolarPanelsOnRack,f7t=t=>t.selectedElementAngle,h7t=t=>t.waiting,Rf=t=>t.simulationInProgress,Uge=t=>t.simulationPaused,UYe=t=>t.evolutionInProgress,jYe=t=>t.evolutionPaused,p7t=t=>t.contextMenuObjectType,g7t=t=>t.enableFineGrid,m7t=t=>t.setEnableFineGrid,y7t=t=>t.showCloudFilePanel,jge=t=>t.projectState.title,BYe=t=>t.projectState.owner,A7t=t=>t.projectState.description,w7t=t=>t.projectState.designs,v7t=t=>t.projectState.type,YYe=t=>t.projectState.selectedProperty,x7t=t=>t.projectState.dataColoring,b7t=t=>t.projectState.thumbnailWidth,S7t=t=>t.projectState.xAxisNameScatterPlot,T7t=t=>t.projectState.yAxisNameScatterPlot,P7t=t=>t.projectState.dotSizeScatterPlot,C7t=t=>t.projectState.sortDescending,R7t=t=>t.projectState.filters,H7t=t=>t.projectState.ranges,M7t=t=>t.projectState.hiddenParameters,SW=t=>t.projectView,I7t=t=>t.showProjectListPanel,z7t=t=>t.showModelsGallery,D7t=t=>t.showAccountSettingsPanel,E7t=t=>t.showLikesPanel,F7t=t=>t.showPublishedModelsPanel,k7t=t=>t.weatherModel,OYe=t=>t.setWeatherModel,Bge=t=>t.weatherData,L7t=t=>t.loadWeatherData,W7t=t=>t.loadHorizontalSolarRadiationData,N7t=t=>t.getHorizontalSolarRadiation,U7t=t=>t.loadVerticalSolarRadiationData,j7t=t=>t.getVerticalSolarRadiation,_Ye=t=>t.getClosestCity,Dw=t=>t.sunlightDirection,B7t=t=>t.setSunlightDirection,Ss=t=>t.showSolarRadiationHeatmap,Y7t=t=>t.selectButtonClicked,h3=t=>t.showHeatFluxes,O7t=t=>t.runSolarPanelVisibilityAnalysis,_7t=t=>t.solarPanelVisibilityResults,VYe=t=>t.runDailySimulationForSolarPanels,V7t=t=>t.runDailySimulationForSolarPanelsLastStep,GYe=t=>t.runYearlySimulationForSolarPanels,G7t=t=>t.runYearlySimulationForSolarPanelsLastStep,X7t=t=>t.pauseDailySimulationForSolarPanels,J7t=t=>t.pauseYearlySimulationForSolarPanels,K7t=t=>t.dailyPvYield,XYe=t=>{var e;return(e=t.graphState)==null?void 0:e.dailyPvIndividualOutputs},q7t=t=>t.setDailyPvYield,$7t=t=>t.yearlyPvYield,JYe=t=>{var e;return(e=t.graphState)==null?void 0:e.yearlyPvIndividualOutputs},Q7t=t=>t.setYearlyPvYield,KYe=t=>t.solarPanelLabels,Z7t=t=>t.setSolarPanelLabels,qYe=t=>t.setTotalBuildingHeater,$Ye=t=>t.setTotalBuildingAc,QYe=t=>t.setTotalBuildingSolarPanel,evt=t=>t.runDailySimulationForParabolicTroughs,tvt=t=>t.runYearlySimulationForParabolicTroughs,nvt=t=>t.pauseDailySimulationForParabolicTroughs,ovt=t=>t.pauseYearlySimulationForParabolicTroughs,rvt=t=>t.dailyParabolicTroughYield,ZYe=t=>{var e;return(e=t.graphState)==null?void 0:e.dailyParabolicTroughIndividualOutputs},ivt=t=>t.setDailyParabolicTroughYield,avt=t=>t.yearlyParabolicTroughYield,eOe=t=>{var e;return(e=t.graphState)==null?void 0:e.yearlyParabolicTroughIndividualOutputs},lvt=t=>t.setYearlyParabolicTroughYield,tOe=t=>t.parabolicTroughLabels,svt=t=>t.setParabolicTroughLabels,cvt=t=>t.runDailySimulationForFresnelReflectors,uvt=t=>t.runYearlySimulationForFresnelReflectors,dvt=t=>t.pauseDailySimulationForFresnelReflectors,fvt=t=>t.pauseYearlySimulationForFresnelReflectors,hvt=t=>t.dailyFresnelReflectorYield,nOe=t=>{var e;return(e=t.graphState)==null?void 0:e.dailyFresnelReflectorIndividualOutputs},pvt=t=>t.setDailyFresnelReflectorYield,gvt=t=>t.yearlyFresnelReflectorYield,oOe=t=>{var e;return(e=t.graphState)==null?void 0:e.yearlyFresnelReflectorIndividualOutputs},mvt=t=>t.setYearlyFresnelReflectorYield,rOe=t=>t.fresnelReflectorLabels,yvt=t=>t.setFresnelReflectorLabels,Avt=t=>t.runDailySimulationForHeliostats,wvt=t=>t.runYearlySimulationForHeliostats,vvt=t=>t.pauseDailySimulationForHeliostats,xvt=t=>t.pauseYearlySimulationForHeliostats,bvt=t=>t.dailyHeliostatYield,iOe=t=>{var e;return(e=t.graphState)==null?void 0:e.dailyHeliostatIndividualOutputs},Svt=t=>t.setDailyHeliostatYield,Tvt=t=>t.yearlyHeliostatYield,aOe=t=>{var e;return(e=t.graphState)==null?void 0:e.yearlyHeliostatIndividualOutputs},Pvt=t=>t.setYearlyHeliostatYield,lOe=t=>t.heliostatLabels,Cvt=t=>t.setHeliostatLabels,sOe=t=>t.runDailySimulationForUpdraftTower,cOe=t=>t.runYearlySimulationForUpdraftTower,Rvt=t=>t.pauseDailySimulationForUpdraftTower,Hvt=t=>t.pauseYearlySimulationForUpdraftTower,Mvt=t=>t.dailyUpdraftTowerResults,Ivt=t=>t.dailyUpdraftTowerYield,zvt=t=>{var e;return(e=t.graphState)==null?void 0:e.dailyUpdraftTowerIndividualOutputs},Dvt=t=>t.setDailyUpdraftTowerResults,Evt=t=>t.setDailyUpdraftTowerYield,Fvt=t=>t.yearlyUpdraftTowerYield,kvt=t=>{var e;return(e=t.graphState)==null?void 0:e.yearlyUpdraftTowerIndividualOutputs},Lvt=t=>t.setYearlyUpdraftTowerYield,uOe=t=>t.updraftTowerLabels,Wvt=t=>t.setUpdraftTowerLabels,Nvt=t=>t.runDailySimulationForParabolicDishes,Uvt=t=>t.runYearlySimulationForParabolicDishes,jvt=t=>t.pauseDailySimulationForParabolicDishes,Bvt=t=>t.pauseYearlySimulationForParabolicDishes,Yvt=t=>t.dailyParabolicDishYield,dOe=t=>{var e;return(e=t.graphState)==null?void 0:e.dailyParabolicDishIndividualOutputs},Ovt=t=>t.setDailyParabolicDishYield,_vt=t=>t.yearlyParabolicDishYield,fOe=t=>{var e;return(e=t.graphState)==null?void 0:e.yearlyParabolicDishIndividualOutputs},Vvt=t=>t.setYearlyParabolicDishYield,hOe=t=>t.parabolicDishLabels,Gvt=t=>t.setParabolicDishLabels,pOe=t=>t.runDailyLightSensor,Xvt=t=>t.pauseDailyLightSensor,gOe=t=>t.runYearlyLightSensor,Jvt=t=>t.pauseYearlyLightSensor,Kvt=t=>t.dailyLightSensorData,qvt=t=>t.setDailyLightSensorData,$vt=t=>t.yearlyLightSensorData,Qvt=t=>t.setYearlyLightSensorData,mOe=t=>t.sensorLabels,Zvt=t=>t.setSensorLabels,ly=t=>t.hoveredHandle,Eb=t=>t.moveHandleType,d1=t=>t.resizeHandleType,Yge=t=>t.getResizeHandlePosition,Zq=t=>t.rotateHandleType,ext=t=>t.resizeAnchor,Oge=t=>t.isAddingElement,e$=t=>t.addedFoundationId,txt=t=>t.deletedFoundationId,t$=t=>t.addedCuboidId,nxt=t=>t.deletedCuboidId,yOe=t=>t.addedWallId,oxt=t=>t.deletedWallId,rxt=t=>t.deletedRoofId,_ge=t=>t.deletedRoofIdSet,AOe=t=>t.autoDeletedRoofIdSet,ixt=t=>t.autoDeletedRoofs,wOe=t=>t.autoDeletedChild,vOe=t=>t.groupActionMode,axt=t=>t.groupActionUpdateFlag,lxt=t=>t.addedWindowId,sxt=t=>t.addedDoorId,cxt=t=>t.updateWallMapOnFoundationFlag,p3=t=>t.wallActionScope,sy=t=>t.roofActionScope,TW=t=>t.windowActionScope,Ew=t=>t.doorActionScope,xOe=t=>t.setRoofActionScope,Vge=t=>t.updateWallLeftJointsById,Gge=t=>t.updateWallRightJointsById,uxt=t=>t.updateWallLeftPointById,n$=t=>t.economicsParams,dxt=t=>t.fittestIndividualResults,o$=t=>t.setFittestIndividualResults,PW=t=>t.variableLabels,r$=t=>t.setVariableLabels,wA=t=>t.evolutionaryAlgorithmState,i$=t=>t.solarPanelArrayLayoutConstraints,fxt=t=>t.geneticAlgorithmWizardSelectedTab,hxt=t=>t.particleSwarmOptimizationWizardSelectedTab,pxt=t=>t.countHeatmapCells,xh=t=>t.setPrimitiveStore,Xge=be.memo(({hx:t,hy:e,hz:n,position:o,rotation:r})=>{const i=H(g7t),a=H(hA),l=a?"#888888":"#444444",s=Math.max(t,e),[c,u]=m.useState(Math.floor(s/50)+1),[d,f]=m.useState(.5);m.useEffect(()=>{i?(u((Math.floor(s/25)+1)*m9),f(a?.05:.1)):(u((Math.floor(s/25)+1)*S6),f((a?.05:.1)*Z5))},[i,s,a]);const p=m.useMemo(()=>{const y=[0];for(let w=c;w<=t;w+=c)y.push(w),y.push(-w);return y},[c,t]),g=m.useMemo(()=>{const y=[0];for(let w=c;w<=e;w+=c)y.push(w),y.push(-w);return y},[c,e]);return h.jsxs("group",{position:o??[0,0,n+.01],rotation:r,children:[p.map(y=>h.jsx(jn,{points:[[y,-e,0],[y,e,0]],color:l,lineWidth:d,userData:{unintersectable:!0}},y)),g.map(y=>h.jsx(jn,{points:[[-t,y,0],[t,y,0]],color:l,lineWidth:d,userData:{unintersectable:!0}},y))]})}),Sre=.2,gxt=({x:t,z:e,handleType:n,scale:o=[1,1,1]})=>{const r=H(fn),i=H(d1),a=m.useRef(null),[l,s]=m.useState("white"),[c,u,d]=o;return m.useEffect(()=>{s(i===n?"red":"white")},[i]),h.jsx(Qr,{ref:a,name:n,args:[Sre*c,Sre*u,Sre*d],position:[t,0,e],onPointerEnter:()=>{s("red"),r(f=>{f.hoveredHandle=n})},onPointerLeave:()=>{i===null&&s("white"),r(f=>{f.hoveredHandle=null})},children:h.jsx("meshBasicMaterial",{attach:"material",color:l})})},wv=be.memo(gxt),mxt=({handleType:t})=>{const e=H(Eb),n=m.useRef(null),[o,r]=m.useState("white");return m.useEffect(()=>{e===Ho.Mid?r("red"):r("white")},[e]),h.jsx(ds,{ref:n,name:t,args:[.1,6,6],onPointerEnter:()=>{r("red")},onPointerLeave:()=>{e===null&&r("white")},children:h.jsx("meshBasicMaterial",{attach:"material",color:o})})},yxt=be.memo(mxt);class Tre{constructor(e){this.top=0,this.array=new Float32Array(e)}write(e){this.array[this.top++]=e.x,this.array[this.top++]=e.y,this.array[this.top++]=e.z}}class Axt{constructor(e){this.top=0,this.array=new Float32Array(e)}write(e){this.array[this.top++]=e.x,this.array[this.top++]=e.y}}let PT=class L_{constructor(e){this.plane=null,this.front=null,this.back=null,this.polygons=[],e&&this.build(e)}clone(){const e=new L_;return e.plane=this.plane&&this.plane.clone(),e.front=this.front&&this.front.clone(),e.back=this.back&&this.back.clone(),e.polygons=this.polygons.map(n=>n.clone()),e}invert(){for(let n=0;nkv.EPSILON?1:0;u|=g,d.push(g)}switch(u){case 0:(this.normal.dot(e.plane.normal)>0?n:o).push(e);break;case 1:r.push(e);break;case 2:i.push(e);break;case 3:{const f=[],p=[];for(let g=0;g=3&&r.push(new yG(f,e.shared)),p.length>=3&&i.push(new yG(p,e.shared));break}}}static fromPoints(e,n,o){const r=new x2().copy(n).sub(e).cross(new x2().copy(o).sub(e)).normalize();return new kv(r.clone(),r.dot(e))}}kv.EPSILON=1e-5;let yG=class bOe{constructor(e,n){this.vertices=e,this.shared=n,this.plane=kv.fromPoints(e[0].pos,e[1].pos,e[2].pos)}clone(){return new bOe(this.vertices.map(e=>e.clone()),this.shared)}flip(){this.vertices.reverse().map(e=>e.flip()),this.plane.flip()}};class AG{constructor(e,n,o,r){this.pos=new x2().copy(e),this.normal=new x2().copy(n),this.uv=new x2().copy(o),this.uv.z=0,r&&(this.color=new x2().copy(r))}clone(){return new AG(this.pos,this.normal,this.uv,this.color)}flip(){this.normal.negate()}interpolate(e,n){return new AG(this.pos.clone().lerp(e.pos,n),this.normal.clone().lerp(e.normal,n),this.uv.clone().lerp(e.uv,n),this.color&&e.color&&this.color.clone().lerp(e.color,n))}}class cc{constructor(){this.polygons=[]}static fromPolygons(e){const n=new cc;return n.polygons=e,n}static fromGeometry(e,n){let o=[];const r=e.attributes.position,i=e.attributes.normal,a=e.attributes.uv,l=e.attributes.color,s=e.groups;let c;if(e.index)c=e.index.array;else{c=new Array(r.array.length/r.itemSize|0);for(let d=0;d0)for(const y of s)d>=y.start&&d!Number.isNaN(d.plane.normal.x)))}static toGeometry(e,n){let o=0;const r=e.polygons;for(const p of r)o+=p.vertices.length-2;const i=new Ni,a=new Tre(o*3*3),l=new Tre(o*3*3),s=new Axt(o*2*3);let c;const u=[],d=[];for(const p of r){const g=p.vertices,y=g.length;p.shared!==void 0&&(u[p.shared]||(u[p.shared]=[])),y&&g[0].color!==void 0&&(c||(c=new Tre(o*3*3)));for(let w=3;w<=y;w++)(p.shared===void 0?d:u[p.shared]).push(a.top/3,a.top/3+1,a.top/3+2),a.write(g[0].pos),a.write(g[w-2].pos),a.write(g[w-1].pos),l.write(g[0].normal),l.write(g[w-2].normal),l.write(g[w-1].normal),s&&(s.write(g[0].uv),s.write(g[w-2].uv),s.write(g[w-1].uv)),c&&(c.write(g[0].color),c.write(g[w-2].color),c.write(g[w-1].color))}i.setAttribute("position",new nl(a.array,3)),i.setAttribute("normal",new nl(l.array,3)),s&&i.setAttribute("uv",new nl(s.array,2)),c&&i.setAttribute("color",new nl(c.array,3));for(let p=0;pn.clone()).filter(n=>Number.isFinite(n.plane.w)),e}toPolygons(){return this.polygons}union(e){const n=new PT(this.clone().polygons),o=new PT(e.clone().polygons);return n.clipTo(o),o.clipTo(n),o.invert(),o.clipTo(n),o.invert(),n.build(o.allPolygons()),cc.fromPolygons(n.allPolygons())}subtract(e){const n=new PT(this.clone().polygons),o=new PT(e.clone().polygons);return n.invert(),n.clipTo(o),o.clipTo(n),o.invert(),o.clipTo(n),o.invert(),n.build(o.allPolygons()),n.invert(),cc.fromPolygons(n.allPolygons())}intersect(e){const n=new PT(this.clone().polygons),o=new PT(e.clone().polygons);return n.invert(),o.clipTo(n),o.invert(),n.clipTo(o),o.clipTo(n),n.build(o.allPolygons()),n.invert(),cc.fromPolygons(n.allPolygons())}inverse(){const e=this.clone();for(const n of e.polygons)n.flip();return e}toMesh(e,n){return cc.toMesh(this,e,n)}toGeometry(e){return cc.toGeometry(this,e)}}const ht=XK()((t,e)=>{const n=o=>t(OP(o));return{set:o=>{try{n(o)}catch(r){console.log(r)}},setPrimitiveStore(o,r){n(i=>{i[o]!==void 0?i[o]=r:console.error(`key ${o} is not defined in PrimitiveStoreState`)})},latestVersion:void 0,changed:!1,setChanged(o){n(r=>{r.changed=o})},skipChange:!0,setSkipChange(o){n(r=>{r.skipChange=o})},localFileName:"aladdin.ala",createNewFileFlag:!1,setCreateNewFileFlag(o){n(r=>{r.createNewFileFlag=o})},openLocalFileFlag:!1,setOpenLocalFileFlag(o){n(r=>{r.openLocalFileFlag=o})},waiting:!1,contextMenuFlag:!1,updateContextMenu(){n(o=>{o.contextMenuFlag=!o.contextMenuFlag})},showEconomicsPanel:!1,showNavigationPanel:!1,showShadowSettings:!1,saveAccountSettingsFlag:!1,saveCloudFileFlag:!1,setSaveCloudFileFlag(o){n(r=>{r.saveCloudFileFlag=o})},listCloudFilesFlag:!1,refreshCloudFilesFlag:!1,saveLocalFileDialogVisible:!1,modelsMapFlag:!1,leaderboardFlag:!1,showLeaderboard:!1,publishOnModelsMapFlag:!1,modelsMapWeatherStations:!1,createProjectFlag:!1,saveProjectAsFlag:!1,curateDesignToProjectFlag:!1,showProjectsFlag:!1,updateProjectsFlag:!1,showProjectListPanel:!1,projectImagesUpdateFlag:!1,projectType:Pi.SOLAR_PANEL_ARRAY,projectTitle:null,projectDescription:null,userCount:0,showCloudFilePanel:!1,openModelsMap:!1,showModelsGallery:!1,showAccountSettingsPanel:!1,showLikesPanel:!1,showPublishedModelsPanel:!1,animateSun:!1,simulationInProgress:!1,simulationPaused:!1,evolutionInProgress:!1,evolutionPaused:!1,runEvolution:!1,pauseEvolution:!1,objectiveEvaluationIndex:0,runDailyThermalSimulation:!1,pauseDailyThermalSimulation:!1,runYearlyThermalSimulation:!1,pauseYearlyThermalSimulation:!1,clearDailySimulationResultsFlag:!1,clearYearlySimulationResultsFlag:!1,runDynamicSimulation:!1,runStaticSimulation:!1,pauseSimulation:!1,runDailySimulationForParabolicDishes:!1,runYearlySimulationForParabolicDishes:!1,pauseDailySimulationForParabolicDishes:!1,pauseYearlySimulationForParabolicDishes:!1,runDailySimulationForParabolicTroughs:!1,runYearlySimulationForParabolicTroughs:!1,pauseDailySimulationForParabolicTroughs:!1,pauseYearlySimulationForParabolicTroughs:!1,runDailySimulationForFresnelReflectors:!1,runYearlySimulationForFresnelReflectors:!1,pauseDailySimulationForFresnelReflectors:!1,pauseYearlySimulationForFresnelReflectors:!1,runDailySimulationForHeliostats:!1,runYearlySimulationForHeliostats:!1,pauseDailySimulationForHeliostats:!1,pauseYearlySimulationForHeliostats:!1,runSolarPanelVisibilityAnalysis:!1,runDailySimulationForSolarPanels:!1,pauseDailySimulationForSolarPanels:!1,runYearlySimulationForSolarPanels:!1,pauseYearlySimulationForSolarPanels:!1,runDailySimulationForSolarPanelsLastStep:!1,runYearlySimulationForSolarPanelsLastStep:!1,runDailyLightSensor:!1,pauseDailyLightSensor:!1,runYearlyLightSensor:!1,pauseYearlyLightSensor:!1,runDailySimulationForUpdraftTower:!1,runYearlySimulationForUpdraftTower:!1,pauseDailySimulationForUpdraftTower:!1,pauseYearlySimulationForUpdraftTower:!1,flagOfDailySimulation:!1,showSolarRadiationHeatmap:!1,showHeatFluxes:!1,duringCameraInteraction:!1,navigationMoveSpeed:3,navigationTurnSpeed:3,elementBeingCanceledId:null,showWallIntersectionPlaneId:null,oldParentId:null,oldFoundationId:null,selectedElementId:null,foundationMovedFlag:!1,updateFoundationMovedFlag(){n(o=>{o.foundationMovedFlag=!o.foundationMovedFlag})},isCameraUnderGround:!1,selectButtonClicked:!1,setSelectButtonClicked(o){n(r=>{r.selectButtonClicked=o})}}}),Tn=XK()((t,e)=>({roofSegmentVerticesMap:new Map,setRoofSegmentVertices(n,o){t(r=>(r.roofSegmentVerticesMap.set(n,[...o]),r))},getRoofSegmentVertices(n){return e().roofSegmentVerticesMap.get(n)},deleteRoofSegmentVertices(n){t(o=>(o.roofSegmentVerticesMap.delete(n),o))},roofSegmentVerticesWithoutOverhangMap:new Map,setRoofSegmentVerticesWithoutOverhang(n,o){t(r=>(r.roofSegmentVerticesWithoutOverhangMap.set(n,o),r))},getRoofSegmentVerticesWithoutOverhang(n){return e().roofSegmentVerticesWithoutOverhangMap.get(n)},deleteRoofSegmentVerticesWithoutOverhang(n){t(o=>(o.roofSegmentVerticesWithoutOverhangMap.delete(n),o))},dailyLightSensorData:[],setDailyLightSensorData(n){t({dailyLightSensorData:[...n]})},yearlyLightSensorData:[],setYearlyLightSensorData(n){t({yearlyLightSensorData:[...n]})},sensorLabels:[],setSensorLabels(n){t({sensorLabels:[...n]})},dailyPvYield:[],setDailyPvYield(n){t({dailyPvYield:[...n]}),ht.getState().set(o=>{o.runEvolution&&o.objectiveEvaluationIndex++})},sumDailyPvYield(){let n=0;for(const o of this.dailyPvYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Hour"&&(n+=o[r]);return n},getDailyPvProfit(){const n=this.sumDailyPvYield(),o=me.countAllSolarPanels();return n*H.getState().economicsParams.electricitySellingPrice-o*H.getState().economicsParams.operationalCostPerUnit},yearlyPvYield:[],setYearlyPvYield(n){t({yearlyPvYield:[...n]}),ht.getState().set(o=>(o.runEvolution&&o.objectiveEvaluationIndex++,o))},sumYearlyPvYield(){var r;let n=0;for(const i of this.yearlyPvYield)for(const a in i)Object.hasOwn(i,a)&&a!=="Month"&&(n+=i[a]);const o=12/(((r=H.getState().world)==null?void 0:r.daysPerYear)??6);return n*o},getYearlyPvProfit(){const n=me.countAllSolarPanels();return this.sumYearlyPvYield()*H.getState().economicsParams.electricitySellingPrice-n*H.getState().economicsParams.operationalCostPerUnit*365},solarPanelLabels:[],setSolarPanelLabels(n){t({solarPanelLabels:[...n]})},solarPanelVisibilityResults:new Map,setSolarPanelVisibilityResult(n,o){t(r=>(r.solarPanelVisibilityResults.set(n,o),r))},clearSolarPanelVisibilityResults(){t({solarPanelVisibilityResults:new Map})},dailyParabolicDishYield:[],setDailyParabolicDishYield(n){t({dailyParabolicDishYield:[...n]})},sumDailyParabolicDishYield(){let n=0;for(const o of this.dailyParabolicDishYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Hour"&&(n+=o[r]);return n},yearlyParabolicDishYield:[],setYearlyParabolicDishYield(n){t({yearlyParabolicDishYield:[...n]})},sumYearlyParabolicDishYield(){let n=0;for(const o of this.yearlyParabolicDishYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Month"&&(n+=o[r]);return n},parabolicDishLabels:[],setParabolicDishLabels(n){t({parabolicDishLabels:[...n]})},dailyParabolicTroughYield:[],setDailyParabolicTroughYield(n){t({dailyParabolicTroughYield:[...n]})},sumDailyParabolicTroughYield(){let n=0;for(const o of this.dailyParabolicTroughYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Hour"&&(n+=o[r]);return n},yearlyParabolicTroughYield:[],setYearlyParabolicTroughYield(n){t({yearlyParabolicTroughYield:[...n]})},sumYearlyParabolicTroughYield(){let n=0;for(const o of this.yearlyParabolicTroughYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Month"&&(n+=o[r]);return n},parabolicTroughLabels:[],setParabolicTroughLabels(n){t({parabolicTroughLabels:[...n]})},dailyFresnelReflectorYield:[],setDailyFresnelReflectorYield(n){t({dailyFresnelReflectorYield:[...n]})},sumDailyFresnelReflectorYield(){let n=0;for(const o of this.dailyFresnelReflectorYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Hour"&&(n+=o[r]);return n},yearlyFresnelReflectorYield:[],setYearlyFresnelReflectorYield(n){t({yearlyFresnelReflectorYield:[...n]})},sumYearlyFresnelReflectorYield(){let n=0;for(const o of this.yearlyFresnelReflectorYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Month"&&(n+=o[r]);return n},fresnelReflectorLabels:[],setFresnelReflectorLabels(n){t({fresnelReflectorLabels:[...n]})},dailyHeliostatYield:[],setDailyHeliostatYield(n){t({dailyHeliostatYield:[...n]})},sumDailyHeliostatYield(){let n=0;for(const o of this.dailyHeliostatYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Hour"&&(n+=o[r]);return n},yearlyHeliostatYield:[],setYearlyHeliostatYield(n){t({yearlyHeliostatYield:[...n]})},sumYearlyHeliostatYield(){let n=0;for(const o of this.yearlyHeliostatYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Month"&&(n+=o[r]);return n},heliostatLabels:[],setHeliostatLabels(n){t({heliostatLabels:[...n]})},dailyUpdraftTowerResults:[],dailyUpdraftTowerYield:[],setDailyUpdraftTowerResults(n){t({dailyUpdraftTowerResults:[...n]})},setDailyUpdraftTowerYield(n){t({dailyUpdraftTowerYield:[...n]})},sumDailyUpdraftTowerYield(){let n=0;for(const o of this.dailyUpdraftTowerYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Hour"&&(n+=o[r]);return n},yearlyUpdraftTowerYield:[],setYearlyUpdraftTowerYield(n){t({yearlyUpdraftTowerYield:[...n]})},sumYearlyUpdraftTowerYield(){let n=0;for(const o of this.yearlyUpdraftTowerYield)for(const r in o)Object.hasOwn(o,r)&&r!=="Month"&&(n+=o[r]);return n},updraftTowerLabels:[],setUpdraftTowerLabels(n){t({updraftTowerLabels:[...n]})},heatmaps:new Map,setHeatmap(n,o){t(r=>(r.heatmaps.set(n,o),r))},getHeatmap(n){return e().heatmaps.get(n)},hourlyHeatExchangeArrayMap:new Map,setHourlyHeatExchangeArray(n,o){t(r=>(r.hourlyHeatExchangeArrayMap.set(n,o),r))},hourlySolarHeatGainArrayMap:new Map,setHourlySolarHeatGainArray(n,o){t(r=>(r.hourlySolarHeatGainArrayMap.set(n,o),r))},hourlySolarPanelOutputArrayMap:new Map,setHourlySolarPanelOutputArray(n,o){t(r=>(r.hourlySolarPanelOutputArrayMap.set(n,o),r))},totalBuildingHeater:0,setTotalBuildingHeater:n=>{t({totalBuildingHeater:n})},totalBuildingAc:0,setTotalBuildingAc:n=>{t({totalBuildingAc:n})},totalBuildingSolarPanel:0,setTotalBuildingSolarPanel:n=>{t({totalBuildingSolarPanel:n})},clearHeatmaps(){t(n=>(n.heatmaps.clear(),n))},clearDataStore(){t({heatmaps:new Map,hourlyHeatExchangeArrayMap:new Map,hourlySolarHeatGainArrayMap:new Map,hourlySolarPanelOutputArrayMap:new Map,solarPanelVisibilityResults:new Map,dailyLightSensorData:[],yearlyLightSensorData:[],sensorLabels:[],dailyPvYield:[],yearlyPvYield:[],solarPanelLabels:[],dailyParabolicDishYield:[],yearlyParabolicDishYield:[],parabolicDishLabels:[],dailyParabolicTroughYield:[],yearlyParabolicTroughYield:[],parabolicTroughLabels:[],dailyFresnelReflectorYield:[],yearlyFresnelReflectorYield:[],fresnelReflectorLabels:[],dailyHeliostatYield:[],yearlyHeliostatYield:[],heliostatLabels:[],dailyUpdraftTowerYield:[],dailyUpdraftTowerResults:[],yearlyUpdraftTowerYield:[],updraftTowerLabels:[]})},clearRoofVerticesMap(){t(n=>(n.roofSegmentVerticesMap.clear(),n.roofSegmentVerticesWithoutOverhangMap.clear(),n))}})),wxt="/aladdin/assets/roof_edge-DBy_1Q5D.png",ig="/aladdin/assets/tiny_white_square-B_qAXRfa.png",vxt="/aladdin/assets/roof_01-BwuyLpwq.png",xxt="/aladdin/assets/roof_02-DAbYjnV7.png",bxt="/aladdin/assets/roof_03-haZGIixv.png",Sxt="/aladdin/assets/roof_04-DDuwUcDr.png",Txt="/aladdin/assets/roof_05-CtBb5xIW.png",Pxt="/aladdin/assets/roof_06-DuyyebV8.png",Cxt="/aladdin/assets/roof_07-DXWGQN8a.png",Rxt=new mf({color:"white",side:Ra}),Hxt=be.memo(({dimension:t,mullionData:e,shadowEnabled:n})=>{const[o,r,i,a]=t,l=Math.min(a,i,o/2),{width:s,horizontalMullionSpacing:c,verticalMullionSpacing:u,color:d}=e,f=3,p=1,g=s/2,y=m.useMemo(()=>Math.atan2(o/2,l),[o,l]),w=m.useMemo(()=>{if(l===0||o===0)return 0;const S=l/2+o**2/(8*l),R=S-l,M=Math.PI-y,D=R**2,E=S**2,W=D+E-2*D*Math.sin(M)**2-2*R*Math.sqrt((E-D*Math.sin(M)**2)*Math.cos(M)**2);return Math.sqrt(W)},[o,l,y]),b=m.useMemo(()=>h.jsx("meshStandardMaterial",{color:d}),[d]),C=S=>new Fl().moveTo(0,S).quadraticCurveTo(S,S,S,0).quadraticCurveTo(S,-S,0,-S).quadraticCurveTo(-S,-S,-S,0).quadraticCurveTo(-S,S,0,S),P=(S,R)=>{const M=S*R/(o/2),D=M/2+(R*2)**2/(8*M),E=Math.acos(Math.min(1,R/D)),W=Math.PI-E,j=new D2(0,M-D,D,D,E,W,!1,0).getPoints(24).map(L=>new ie(L.x,L.y));return new Aq(j)},v=m.useMemo(()=>{const S=[],R=Math.round(o/u)-1;if(R<=0||s===0)return null;const M=o/(R+1);let D=M/2;R%2!==0&&(S.push(0),D=M);for(let E=0;E{const S=[];if(s===0)return S;const R=i/2-l,M=i-l,D=Math.ceil(M/c);let E=R;for(let W=0;W{const S=[],R=Math.round(o/u)-1;if(R<=0||s===0)return null;const M=o/(R+1);let D=M/2;R%2!==0&&(D=M);for(let W=0;Wlh.jsx("group",{position:[0,0,i/2-l],rotation:[0,R,0],children:h.jsx(ca,{position:[0,0,S/2],args:[g,g,S,f,p],rotation:[Gt,Gt,0],receiveShadow:n,castShadow:n,children:b})});return h.jsxs("group",{name:"Window Mullion Group",position:[0,-.001,0],children:[e.horizontalMullion&&T.map((S,R)=>h.jsx(ca,{position:[0,0,S],args:[g,g,o,f,p],rotation:[0,0,Gt],receiveShadow:n,castShadow:n,children:b},R)),e.verticalMullion&&(v==null?void 0:v.map((S,R)=>h.jsx(ca,{position:[S,0,-l/2],args:[g,g,i-l,f,p],rotation:[Gt,Gt,0],receiveShadow:n,castShadow:n,children:b},R))),l>0&&(A==null?void 0:A.map((S,R)=>{if(S===null)return null;const{shape:M,path:D}=S;return h.jsx(nw,{position:[0,g/2,i/2-l],rotation:[Gt,0,0],args:[M,{extrudePath:D,steps:12,bevelEnabled:!1}],castShadow:n,receiveShadow:n,children:b},R)})),w>0&&h.jsxs(h.Fragment,{children:[x(l,0),x(w,y),x(w,-y)]})]})}),Mxt=be.memo(({dimension:t,frameData:e,shadowEnabled:n})=>{const[o,r,i,a]=t,l=o/2,s=Math.min(a,i,l),{color:c,width:u,sillWidth:d}=e,f=m.useMemo(()=>h.jsx("meshStandardMaterial",{color:c}),[c]),p=u/2,g=p/2,y=o+u*3,w=u,b=m.useMemo(()=>{const[C,P]=[l+u,l],v=s+u,T=v/2+(C*2)**2/(8*v),A=Math.acos(Math.min(1,C/T)),x=Math.PI-A,S=v-T,R=s,M=R/2+(P*2)**2/(8*R),D=Math.acos(Math.min(1,P/M)),E=Math.PI-D,W=R-M,j=new D2(0,S,T,T,A,x,!1,0).getPoints(36),L=new D2(0,W,M,M,E,D,!0,0).getPoints(36);return new Fl([...j,...L])},[a,i,o,u]);return h.jsxs("group",{name:"Window Frame Group",position:[0,-g/2,0],children:[s>.1?h.jsx(nw,{position:[0,g/2,i/2-s],rotation:[Gt,0,0],args:[b,{depth:g,steps:1,bevelEnabled:!1}],castShadow:n,receiveShadow:n,children:f}):h.jsx(Qr,{position:[0,0,i/2],args:[o+2*u,g,u],castShadow:n,receiveShadow:n,children:f}),h.jsx(Qr,{position:[-o/2-p,0,-s/2],args:[u,g,i-s],castShadow:n,receiveShadow:n,children:f}),h.jsx(Qr,{position:[o/2+p,0,-s/2],args:[u,g,i-s],castShadow:n,receiveShadow:n,children:f}),h.jsx(Qr,{position:[0,0,-i/2-(d===0?0:w/2)],args:d===0?[o+2*u,g,u]:[y,d??u,w],castShadow:n,receiveShadow:n,children:f})]})}),Kce=be.memo(({cy:t,dimension:e,wireframeData:n,drawBottom:o})=>{const[r,i,a,l]=e,{lineWidth:s,lineColor:c,selected:u,locked:d,opacity:f}=n,p=s/20,g=s/5,y=r/2,w=a/2,b=Math.min(l,a,y),C=6,P=1,v=(R,M)=>{const D=R/2+(M*2)**2/(8*R),E=Math.acos(Math.min(1,M/D)),W=Math.PI-E,j=new D2(0,R-D,D,D,E,W,!1,0).getPoints(24).map(L=>new ie(L.x,L.y));return new Aq(j)},T=R=>new Fl().moveTo(0,R).quadraticCurveTo(R,R,R,0).quadraticCurveTo(R,-R,0,-R).quadraticCurveTo(-R,-R,-R,0).quadraticCurveTo(-R,R,0,R),A=m.useMemo(()=>new mf({color:c}),[c]),x=m.useMemo(()=>new mf({color:y0}),[]),S=(R,M)=>h.jsxs(h.Fragment,{children:[b>.1?h.jsx(nw,{position:[0,0,a/2-b],rotation:[Gt,0,0],args:[T(R),{extrudePath:v(b,y),steps:24,bevelEnabled:!1}],material:M}):h.jsx(ca,{args:[R,R,r,C,P],rotation:[0,0,Gt],position:[0,0,w-R/2],material:M}),o&&h.jsx(ca,{args:[R,R,r,C,P],rotation:[0,0,Gt],position:[0,0,-w],material:M}),h.jsx(ca,{args:[R,R,a-b,C,P],rotation:[Gt,Gt,0],position:[y,0,-b/2],material:M}),h.jsx(ca,{args:[R,R,a-b,C,P],rotation:[Gt,Gt,0],position:[-y,0,-b/2],material:M})]});return h.jsxs("group",{name:"Window Wireframe Group",children:[f>0&&h.jsx("group",{position:[0,t,0],children:S(p,A)}),d&&u&&S(g,x)]})}),Ixt=({id:t,dimension:e,position:n,mullionData:o,frameData:r,wireframeData:i,leftShutter:a,rightShutter:l,shutterColor:s,shutterWidth:c,glassMaterial:u,showHeatFluxes:d,area:f,empty:p,interior:g,foundation:y})=>{const w=H.getState().world,b=H(e5),C=H(i3),P=H(a3),v=H(Ds),T=Tn(Tb),A=m.useRef(0),x=m.useRef(),[S,R,M,D]=e,[E,W,j]=n,L=(X,$)=>{if(D>0){const Q=.5*S,le=.5*M,q=Math.min(D,M,Q),te=.5*(q+Q*Q/q);if(Math.abs(X)-le)return!0;const re=$-(M-te-le);return X*X+re*re{if(!d||g||y&&y.notBuilding)return;const X=T.get(t);if(!X)return;const $=X.reduce((ne,fe)=>ne+fe,0);if(f===0)return;const Q=r3*(w.solarRadiationHeatmapGridCellSize??.5),le=Math.max(2,Math.round(S/Q)),q=Math.max(2,Math.round(M/Q)),te=S/le,re=M/q,ae=$/f*(b??Qm);A.current=ae<0?1:0,x.current=me.getEuler(Io,Oc,"YXZ",Math.sign(ae)*Gt);const se=[];if(ae<0)for(let ne=0;nec*S,[S,c]),F=m.useMemo(()=>M-Math.min(D,M,S/2),[S,M,D]),U=m.useMemo(()=>(N+r.width+S)/2*1.025,[S,N,r.width]),O=m.useMemo(()=>-Math.min(D,M,S/2)/2,[M,F]),B=m.useMemo(()=>wG(S,M,D),[S,M,D]),_=(X,$,Q)=>h.jsx(ua,{name:"Window Seal Plane",args:X,position:$,rotation:Q,material:Rxt,receiveShadow:v,castShadow:v});return h.jsxs(h.Fragment,{children:[!p&&h.jsxs("group",{name:"Arched Window Plane Group",position:[0,W,0],children:[h.jsxs("mesh",{name:"Window Glass mesh",rotation:[Gt,0,0],children:[h.jsx("shapeGeometry",{args:[B]}),u]}),(o.horizontalMullion||o.verticalMullion)&&D!==void 0&&h.jsx(Hxt,{dimension:e,mullionData:o,shadowEnabled:v})]}),r.showFrame&&h.jsx(Mxt,{dimension:e,frameData:r,shadowEnabled:v}),h.jsx(Kce,{cy:W,dimension:e,wireframeData:i,drawBottom:!0}),h.jsx(Xye,{cx:U,cz:O,lx:N,lz:F,color:s,showLeft:a,showRight:l,spacing:r.showFrame?r.width/2:0}),_([R,M],[-S/2,R/2,0],[Gt,Gt,0]),_([R,M],[S/2,R/2,0],[Gt,-Gt,0]),_([S,R],[0,R/2,-M/2]),k&&k.map((X,$)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:X,name:"Heat Flux "+$,lineWidth:P??Zm,color:C??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:X[A.current].clone().add(new ie(0,A.current===0?-.1:.1,0)),args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:x.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:C??g0})})]},$))]})},wG=(t,e,n,o=0,r=0)=>{const i=new Fl,a=t/2,l=e/2,s=Math.min(n,e,a);if(i.moveTo(o-a,r-l),i.lineTo(o+a,r-l),i.lineTo(o+a,r+l-s),s>.01){const c=s/2+t**2/(8*s),[u,d]=[o,r+l-c],f=Math.acos(Math.min(1,a/c)),p=Math.PI-f;i.absarc(u,d,c,f,p,!1)}else i.lineTo(o-a,r+l);return i.closePath(),i},zxt=be.memo(Ixt),Dxt=1,Ext=3,Fxt=new mf({color:"white",side:$r}),kxt=new nn(0,0,-Gt),Lxt=be.memo(({dimension:t,polygonTop:e,frameData:n,shadowEnabled:o})=>{const[r,i,a]=t,[l,s]=e,{color:c,width:u,sillWidth:d}=n,f=m.useMemo(()=>h.jsx("meshStandardMaterial",{color:c}),[c]),[p,g]=[r/2,a/2],w=u/2/2,b=r+u*3,C=u,P=m.useMemo(()=>{const A=new ie(p,-g),x=new ie(p,g),S=new ie(-p,g),R=new ie(-p,-g),M=new ie(l*r,s+g);return[A,x,M,S,R]},[p,g,l,s]),v=m.useMemo(()=>{const A=[];for(let R=1;R{const A=new Fl;for(let x=0;x=0;x--){const S=P[x];A.lineTo(S.x,S.y)}return A.closePath(),A},[P,v]);return h.jsxs("group",{name:"Window Frame Group",position:[0,-w/2,0],children:[h.jsx(nw,{position:[0,w/2,0],rotation:[Gt,0,0],args:[T,{steps:1,depth:w,bevelEnabled:!1}],children:f}),h.jsx(Qr,{position:[0,0,-a/2-(d===0?0:C/2)],args:d===0?[r+2*u,w,u]:[b,d??u,C],castShadow:o,receiveShadow:o,children:f})]})}),Wxt=({id:t,dimension:e,polygonTop:n,position:o,glassMaterial:r,empty:i,interior:a,wireframeData:l,frameData:s,leftShutter:c,rightShutter:u,shutterColor:d,shutterWidth:f,area:p,showHeatFluxes:g,foundation:y})=>{const w=H.getState().world,b=H(e5),C=H(i3),P=H(a3),v=Tn(Tb),T=m.useRef(0),A=m.useRef(),[x,S,R]=o,[M,D,E]=e,[W,j,L]=e.map(He=>He/2),[k,N]=n,{lineWidth:F,lineColor:U,selected:O,locked:B,opacity:_}=l,X=k*M,$=Math.hypot(N,W-X),Q=Math.asin(N/$),le=Math.hypot(N,W+X),q=-Math.asin(N/le),te=H(Ds),re=(He,Se)=>{const ze=.5*M,Ie=.5*(E+n[1]),ye=n[1],ce=[{x:-ze,y:-Ie},{x:ze,y:-Ie},{x:ze,y:Ie-ye},{x:M*n[0],y:Ie},{x:-ze,y:Ie-ye}];return me.isPointInside(He,Se,ce)},ae=m.useMemo(()=>{if(!g||a||y&&y.notBuilding)return;const He=v.get(t);if(!He)return;const Se=He.reduce((Pe,Ee)=>Pe+Ee,0);if(p===0)return;const ze=r3*(w.solarRadiationHeatmapGridCellSize??.5),Ie=E+n[1],ye=Math.max(2,Math.round(M/ze)),ce=Math.max(2,Math.round(Ie/ze)),pe=M/ye,ve=Ie/ce,Ae=Se/p*(b??Qm);T.current=Ae<0?1:0,A.current=me.getEuler(Io,Oc,"YXZ",Math.sign(Ae)*Gt);const Te=[],Me=n[1]/2;if(Ae<0)for(let Pe=0;Pef*M,[M,f]),ne=m.useMemo(()=>(se+s.width+M)/2*1.025,[M,se,s.width]),fe=m.useMemo(()=>{const[He,Se]=[M/2,E/2],ze=k*M;return vG(He,Se,ze,N)},[M,E,k,N]),ge=m.useMemo(()=>O&&B?new mf({color:y0}):new mf({color:U}),[U,O,B]),de=m.useMemo(()=>B&&O?F/5:F/20,[F,O,B]),Z=m.useMemo(()=>B&&O?-D/2:-S,[S,D,O,B]),he=(He,Se=0)=>h.jsx(ca,{args:[de,de,He,Ext,Dxt],position:[Se,Z,0],rotation:[0,0,Gt],material:ge}),xe=(He,Se=0)=>h.jsx(ua,{args:[He,D],position:[Se,0,0],material:Fxt,receiveShadow:te,castShadow:te});return h.jsxs(h.Fragment,{children:[!i&&h.jsxs("mesh",{name:"Triangle Glass Plane",position:[0,S,0],rotation:[Gt,0,0],children:[h.jsx("shapeGeometry",{args:[fe]}),r]}),s.showFrame&&h.jsx(Lxt,{dimension:e,polygonTop:n,frameData:s,shadowEnabled:te}),h.jsx(Xye,{cx:ne,lx:se,lz:E,color:d,showLeft:c,showRight:u,spacing:s.showFrame?s.width/2:0}),h.jsxs("group",{position:[0,j,-L+.001],children:[xe(M),he(M)]}),h.jsxs("group",{position:[-W+.001,j,0],rotation:[0,Gt,0],children:[xe(E),he(E)]}),h.jsxs("group",{position:[W-.001,j,0],rotation:[0,-Gt,0],children:[xe(E),he(E)]}),h.jsxs("group",{position:[-W+.001,j,L-.01],rotation:[0,q,0],children:[xe(le,le/2),he(le,le/2)]}),h.jsxs("group",{position:[W-.001,j,L-.01],rotation:[0,Q,0],children:[xe($,-$/2),he($,-$/2)]}),ae&&ae.map((He,Se)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:He,name:"Heat Flux "+Se,lineWidth:P??Zm,color:C??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:He[T.current].clone().add(new ie(0,T.current===0?-.1:.1,0)),args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:A.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:C??g0})})]},Se))]})},vG=(t,e,n,o,r=0,i=0)=>{const a=new Fl;return a.moveTo(r-t,i-e),a.lineTo(r+t,i-e),a.lineTo(r+t,i+e),a.lineTo(r+n,i+e+o),a.lineTo(r-t,i+e),a.closePath(),a},Nxt=be.memo(Wxt),Uxt=({id:t,index:e,foundationModel:n,roofType:o,segment:r,centroid:i,thickness:a,color:l,sideColor:s,texture:c,heatmap:u,windows:d})=>{const f=H(l3),p=ht(h3),g=H(e5),y=H(i3),w=H(a3),b=Tn(dW),{transparent:C,opacity:P}=QH(),v=m.useRef(0),T=m.useRef(),A=m.useRef(),x=H.getState().world,S=Tn.getState().hourlyHeatExchangeArrayMap,{points:R}=r,M=m.useMemo(()=>{if(!p)return;const E=b(t);if(!E)return;const W=[],j=new ie(0,0,a+.1);switch(o){case Go.Hip:case Go.Pyramid:for(const L of E){const k=[];k.push(L[0].clone().sub(i).add(j)),k.push(L[1].clone().sub(i).add(j)),W.push(k)}break;case Go.Mansard:for(const[L,k]of E.entries()){if(L===E.length-1)continue;const N=[];N.push(k[0].clone().sub(i).add(j)),N.push(k[1].clone().sub(i).add(j)),W.push(N)}break;case Go.Gambrel:for(const[L,k]of E.entries()){if(L===0||L===3){const F=[];F.push(k[0].clone().sub(i).add(j)),F.push(k[1].clone().sub(i).add(j)),W.push(F)}let N=[];N.push(k[0].clone().sub(i).add(j)),N.push(k[3].clone().sub(i).add(j)),W.push(N),N=[],N.push(k[1].clone().sub(i).add(j)),N.push(k[2].clone().sub(i).add(j)),W.push(N)}break}return W},[p]),D=m.useMemo(()=>{if(!p||n&&n.notBuilding)return;const E=S.get(t+"-"+e);if(!E)return;const W=E.reduce((pe,ve)=>pe+ve,0),j=b(t);if(!j||!j[e])return;const[L,k,N,F,U]=R,O=U.z-L.z,B=j[e].map(pe=>pe.clone().sub(i).add(new ie(0,0,O)));if(!B)return;const _=[];for(const pe of B)_.push({x:pe.x,y:pe.y});const X=r3*(x.solarRadiationHeatmapGridCellSize??.5),$=B[0].clone(),Q=B[1].clone(),le=B[2].clone(),q=new ie().subVectors(Q,$),te=new ie().subVectors(le,$),re=new ie().subVectors(le,Q),ae=q.length(),se=new ie().crossVectors(te,re).length()/ae,ne=Math.max(2,Math.floor(ae/X)),fe=Math.max(2,Math.floor(se/X));q.normalize(),te.normalize(),re.normalize();const ge=new ie().crossVectors(te,re).normalize(),de=q.multiplyScalar(.5*ae/ne),Z=new ie().crossVectors(ge,q).normalize().multiplyScalar(.5*se/fe),he=$.clone().add(de).add(Z);de.multiplyScalar(2),Z.multiplyScalar(2),T.current=ge.clone().multiplyScalar(.1);const xe=[],He=new ie;let Se=B.length===4?me.getTriangleArea(B[0],B[1],B[2])+me.getTriangleArea(B[2],B[3],B[0]):me.getTriangleArea(B[0],B[1],B[2]);if(Se===0)return;let ze=f(z.Window,t);const Ie=b(t);if(Ie&&Ie[e]&&(ze=ze.filter(pe=>{const ve=pe,Ae=ve.cy+(ve.windowType===Ti.Polygonal&&ve.polygonTop?ve.polygonTop[1]/2:0);return Cn.onSegment(Ie[e],pe.cx,Ae)})),ze&&ze.length>0)for(const pe of ze)Se-=me.getWindowArea(pe);const ye=W/Se*(g??Qm);v.current=ye<0?1:0,A.current=me.getEuler(Io,ge,"YXZ",-Math.sign(ye)*Gt);let ce;for(let pe=0;pe0){const Te=He.x+i.x,Me=He.y+i.y;for(const Pe of ze){const Ee=Cn.getRelativeWindowVerticesOnRoof(Pe),Be=me.getPoints(Ee);if(me.isPointInside(Te,Me,Be)){ce=!1;break}}}if(ce&&me.isPointInside(He.x,He.y,_)){const Te=[];ye<0?(Te.push(He.clone()),Te.push(He.clone().add(ge.clone().multiplyScalar(-ye)))):(Te.push(He.clone()),Te.push(He.clone().add(ge.clone().multiplyScalar(ye)))),xe.push(Te)}}}return xe},[p,g]);return h.jsxs(h.Fragment,{children:[h.jsx(SOe,{id:t,index:e,segment:r,color:l,sideColor:s,texture:c,heatmap:u,transparent:C,opacity:P,windows:d,centroid:i}),M&&M.map((E,W)=>h.jsx(jn,{points:E,color:"gray",lineWidth:.5,dashed:!0,dashSize:.2,gapSize:.1,receiveShadow:!1,castShadow:!1,name:"Overhang Boundary "+W},W)),D&&D.map((E,W)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:E,name:"Heat Flux "+W,lineWidth:w??Zm,color:y??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:T.current?E[v.current].clone().add(T.current):E[0],args:[.06,.2,4,1],name:"Normal Vector Arrow Head "+W,rotation:A.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:y??g0})})]},W))]})},SOe=be.memo(({id:t,index:e,segment:n,color:o,sideColor:r,texture:i,heatmap:a,transparent:l,opacity:s,windows:c,centroid:u})=>{const d=ht(Ss),f=m.useRef(null),{points:p}=n,g=d?a:i,y=p.length===6,w=p.length===8,b=m.useMemo(()=>c.map(R=>{const M=new ie(R.lx,R.lz,R.ly*2),D=new ie(R.cx,R.cy,R.cz).sub(u),E=new nn().fromArray([R.rotation[0],R.rotation[1],R.rotation[2],"ZXY"]);if(R.windowType===Ti.Polygonal){const[W,j]=R.polygonTop??Gp,[L,k,N]=[M.x/2,M.y/2,W*M.x],F=vG(L,k,N,j),U=new is(new W9([F],{steps:1,depth:M.z,bevelEnabled:!1})),O=new ie(0,0,-M.z).applyEuler(E);return U.position.copy(D.clone().add(O)),U.rotation.copy(E),U.updateMatrix(),U}else if(R.windowType===Ti.Arched){const W=wG(M.x,M.y,R.archHeight),j=new is(new W9([W],{steps:1,depth:M.z,bevelEnabled:!1})),L=new ie(0,0,-M.z).applyEuler(E);return j.position.copy(D.clone().add(L)),j.rotation.copy(E),j.updateMatrix(),j}else{const W=new is(new t3(M.x,M.y,M.z));return W.position.copy(D),W.rotation.copy(E),W.updateMatrix(),W}}),[c,u]),C=v()??6,P=m.useMemo(()=>Array(C).fill(0),[C]);if(m.useEffect(()=>{v()},[]),!y&&!w)return null;function v(){if(!f.current||!y&&!w)return;const R=f.current.geometry;R.index=null,R.clearGroups();const M=[],D=[];let E=0,W=0;if(y){const U=p.slice(p.length/2);j(U),d?k():L(U),N(3);const O=p.slice(0,p.length/2).reverse();j(O),D.push(0,0,1,0,0,1),N(3),F([[0,1,4,3],[1,2,5,4],[2,0,3,5]])}else if(w){const U=p.slice(p.length/2),[O,B]=T(U);j(O),j(B);const[_,X,$,Q]=U,le=O[2].equals(Q);if(d)k(le);else{const ae=new ie().subVectors(X,_),se=new ie().subVectors($,_),ne=new ie().subVectors(Q,_),ge=new Xt(X.x-_.x,X.y-_.y).length(),de=ge,Z=0,he=ae.dot(se)/ge,xe=ae.clone().cross(se).length()/ge,He=ae.dot(ne)/ge,Se=ae.clone().cross(ne).length()/ge;le?(D.push(0,0,de,Z,He,Se),D.push(de,Z,he,xe,He,Se)):(D.push(0,0,de,Z,he,xe),D.push(0,0,he,xe,He,Se))}N(6);const q=p.slice(0,p.length/2),[te,re]=T(q);j(te.reverse()),j(re.reverse()),D.push(0,0,1,0,0,1),D.push(0,1,1,0,1,1),N(6),F([[0,1,5,4],[1,2,6,5],[2,3,7,6],[3,0,4,7]])}else throw new Error("segment is neither quad nor tri");if(R.setAttribute("position",new gr(M,3)),R.setAttribute("uv",new gr(D,2)),R.computeVertexNormals(),R.computeBoundingSphere(),c.length>0){const U=[];for(let B=0;Bq.concat(p[te].x,p[te].y,p[te].z),[]),le=[$,_,X].reduce((q,te)=>q.concat(p[te].x,p[te].y,p[te].z),[]);M.push(...Q),M.push(...le),D.push(0,0,1,0,0,1),D.push(0,1,1,0,1,1),N(6)}}}function T(R){const[M,D,E,W]=R,j=me.distanceFromPointToLine2D(W,M,D),L=me.distanceFromPointToLine2D(E,M,D),k=[],N=[];return Math.abs(j-L)<.01?M.z>D.z?(k.push(M,D,E),N.push(M,E,W)):(k.push(M,D,W),N.push(D,E,W)):j<=L?(k.push(M,D,W),N.push(D,E,W)):(k.push(M,D,E),N.push(M,E,W)),[k,N]}const A=({i:R})=>h.jsx("meshBasicMaterial",{attach:`material-${R}`,map:g,transparent:l,opacity:s}),x=({i:R})=>h.jsx("meshStandardMaterial",{attach:`material-${R}`,color:o,map:g,transparent:l,opacity:s}),S=({i:R})=>h.jsx("meshStandardMaterial",{attach:`material-${R}`,color:r,transparent:l,opacity:s});return h.jsx("mesh",{ref:f,name:`Buffer Roof Segment ${e}`,uuid:t+"-"+e,userData:{simulation:!0},receiveShadow:!d,castShadow:!0,frustumCulled:!1,children:P.map((R,M)=>M!==0?h.jsx(S,{i:M},"side"+M):d?h.jsx(A,{i:M},"heatmap"+M):h.jsx(x,{i:M},"texture"+M))})}),a$=be.memo(Uxt),jxt=({cz:t,points:e})=>{const n=new Fl;n.moveTo(e[0].x,e[0].y);for(const{x:o,y:r}of e)n.lineTo(o,r);return n.closePath(),h.jsx(nw,{scale:.99,position:[0,0,t],args:[n,{steps:1,depth:.1,bevelEnabled:!1}],children:h.jsx("meshStandardMaterial",{side:$r,color:"white"})})},CW=be.memo(jxt);function cy(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[o,r]of t)if(!Object.is(r,e.get(o)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const o of t)if(!e.has(o))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let o=0;oH(e=>e.selectedElementIdSet.has(t)&&!e.groupActionMode),Jt=()=>{const t=H(s0);return m.useMemo(()=>({lng:t}),[t])},f1=t=>H.getState().getWeather(t??"Boston MA, USA"),Twe=new ie,Pwe=new nn,hY=new ie,Bxt=new ie(0,0,1),Yxt=be.memo(({roofSegments:t,thickness:e,lineWidth:n,lineColor:o})=>{if(t.length===0)return null;const r=[],i=new ie(0,0,e);for(let l=0;l{const[c,u,d]=l.points,f=Math.abs(c.z)<.015,p=[c.clone().sub(i),c];return f||p.push(d),h.jsx(jn,{points:p,lineWidth:n,color:o},s)})]})]})}),Oxt=({roofModel:t,foundationModel:e})=>{let{cx:n,cy:o,lz:r,id:i,wallsId:a,textureType:l,color:s="white",sideColor:c="white",thickness:u=.2,locked:d,lineWidth:f=.2,lineColor:p="black",roofType:g,foundationId:y,rise:w=r,ceiling:b=!1}=t;const C=$H(l),P=Es(i);[p,f]=Cn.getWireframetStyle(p,f,P,d);const v=H(fn),T=H(yp),{camera:A,gl:x}=oi(),S=m.useMemo(()=>new l0,[]),R=m.useMemo(()=>new Xt,[]),[M,D]=m.useState(!1),E=m.useRef(null),W=m.useRef(!1),j=m.useRef(w),L=new Set(a),k=Me=>{R.x=Me.offsetX/x.domElement.clientWidth*2-1,R.y=-(Me.offsetY/x.domElement.clientHeight)*2+1,S.setFromCamera(R,A)},N=Me=>{const Pe=[],Ee=Me.length;for(const Be of Me)Be.leftPoint[0]!==void 0&&Be.leftPoint[1]!==void 0&&Pe.push({x:Be.leftPoint[0],y:Be.leftPoint[1]});return B.current||(Me[Ee-1].rightPoint[0]||Me[Ee-1].rightPoint[0]===0)&&(Me[Ee-1].rightPoint[1]||Me[Ee-1].rightPoint[1]===0)&&Pe.push({x:Me[Ee-1].rightPoint[0],y:Me[Ee-1].rightPoint[1]}),Pe},F=(Me,Pe)=>{if(Me.length!==Pe.size)return!0;for(const Ee of Me)if(!Pe.has(Ee.id))return!0;return!1},U=()=>{let Me=1/0;for(let Pe=0;Pe{if(O.length<2)return{x:0,y:0};const Me=N(O);if(Me.length<3)return{x:0,y:0};const Pe=me.calculatePolygonCentroid(Me);return Number.isNaN(Pe.x)||Number.isNaN(Pe.y)?{x:0,y:0}:Pe},[O,X]),Q=m.useMemo(()=>new ie($.x,$.y,X),[$,X]),le=m.useMemo(()=>{const Me=O.map(Pe=>Cn.getWallNormal(Pe).multiplyScalar(Pe.eavesLength??0));if(!B.current&&Me.length!==0){const Pe=new ie().subVectors(new ie(O[O.length-1].rightPoint[0],O[O.length-1].rightPoint[1]),new ie(O[0].leftPoint[0],O[0].leftPoint[1])).applyEuler(mG).normalize().multiplyScalar(.3);Me.push(Pe)}return Me},[O]),q=m.useMemo(()=>{const Me=O.map((Pe,Ee)=>({leftPoint:new ie(Pe.leftPoint[0],Pe.leftPoint[1]).add(le[Ee]),rightPoint:new ie(Pe.rightPoint[0],Pe.rightPoint[1]).add(le[Ee])}));return!B.current&&Me.length!==0&&Me.push({leftPoint:new ie(O[O.length-1].rightPoint[0],O[O.length-1].rightPoint[1]).add(le[le.length-1]),rightPoint:new ie(O[0].leftPoint[0],O[0].leftPoint[1]).add(le[le.length-1])}),Me},[O,le]),te=m.useMemo(()=>Bxt.clone().multiplyScalar(u),[u]),re=m.useMemo(()=>{const Me=[];if(O.length<2)return Me;const Pe=U();for(let Ee=0;Ee0&&Be.rightPoint.length>0&&(Be.leftPoint[0]!==Be.rightPoint[0]||Be.leftPoint[1]!==Be.rightPoint[1])){const Je=[];let{lh:We,rh:Ke}=Cn.getWallHeight(O,Ee);B.current||(Ee===0&&(We=O[0].lz),Ee===O.length-1&&(Ke=O[O.length-1].lz));const Ne=Cn.getIntersectionPoint(q[(Ee+q.length-1)%q.length].leftPoint,q[(Ee+q.length-1)%q.length].rightPoint,q[Ee].leftPoint,q[Ee].rightPoint).setZ(We-Pe).sub(Q),De=Cn.getIntersectionPoint(q[Ee].leftPoint,q[Ee].rightPoint,q[(Ee+1)%q.length].leftPoint,q[(Ee+1)%q.length].rightPoint).setZ(Ke-Pe).sub(Q),ke=new ie(Be.cx,Be.cy).sub(Q.clone().setZ(0)).length();Je.push(Ne,De,hY),Je.push(Ne.clone().add(te),De.clone().add(te),hY.clone().add(te)),Me.push({points:Je,angle:-Be.relativeAngle,length:ke})}}if(!B.current){const Ee=q.length-1,Be=Cn.getIntersectionPoint(q[Ee-1].leftPoint,q[Ee-1].rightPoint,q[Ee].leftPoint,q[Ee].rightPoint).setZ(O[O.length-1].lz-Pe).sub(Q),Je=Cn.getIntersectionPoint(q[Ee].leftPoint,q[Ee].rightPoint,q[0].leftPoint,q[0].rightPoint).setZ(O[0].lz-Pe).sub(Q);let We=Math.atan2(Je.y-Be.y,Je.x-Be.x);We=We>=0?We:(la+We)%la;const Ke=new ie().addVectors(Be,Je).setZ(0).divideScalar(2).length(),Ne=[];Ne.push(Be,Je,hY),Ne.push(Be.clone().add(te),Je.clone().add(te),hY.clone().add(te)),Me.push({points:Ne,angle:-We,length:Ke})}return Me},[O,$,u]),ae=m.useMemo(()=>{const Me=[];if(O.length===0)return Me;Me.push(new ie().fromArray(O[0].leftPoint));for(const Pe of O)Me.push(new ie().fromArray(Pe.rightPoint));return Me},[O]);let se=0;if(e){n=e.cx,o=e.cy,se=e.rotation[2];const Me=-Math.atan2(A.position.x-n,A.position.y-o)-se;Twe.set($.x,$.y,X),Pwe.set(-Gt,0,Me,"ZXY")}const ne=RQ();m.useEffect(()=>{if(ne)return;if(H.getState().addedRoofIdSet.has(i)&&O.length>=2&&F(O,L)){const Pe=O.map(Be=>Be.id),Ee=new Set(Pe);v(Be=>{for(const Je of Be.elements)if(Je.type===z.Roof)Je.id===i&&(Je.wallsId=Pe);else if(Je.type===z.Wall&&L.has(Je.id)&&!Ee.has(Je.id)){const We=Je;We.roofId=null,We.leftRoofHeight=void 0,We.rightRoofHeight=void 0}}),H.getState().deleteAddedRoofId(i)}},[L]),m.useEffect(()=>{if(O.length>1){if(H.getState().addedRoofIdSet.has(i)){for(let Pe=0;Pe{for(const Be of Ee.elements)if(Be.id===O[Pe].id&&Be.type===z.Wall){const Je=Be;Je.roofId=i,Je.leftRoofHeight=void 0,Je.rightRoofHeight=void 0;break}});H.getState().deleteAddedRoofId(i)}}else T(i,!1,!1,!0)},[O]),Wye(e,i,re,Q,X,u);const fe=()=>{if(O.length<2)return!1;const Me=O[0].lz;for(const Pe of O)if(Math.abs(Pe.lz-Me)>.01)return!1;for(const Pe of re){const[Ee,Be]=Pe.points;if(Math.abs(Ee.z)>.01||Math.abs(Be.z)>.01)return!1}return!0},[ge,de]=m.useState(fe);m.useEffect(()=>{de(fe())},[O,X]);const Z=ht(Ss),he=H(Cf),xe=Tn(u1),[He,Se]=m.useState([]),[ze,Ie]=m.useState(null),ye=H(Y0),ce=cN(i,Q,re,ge,Go.Pyramid);m.useEffect(()=>{if(Z)if(ge){const Me=xe(i);if(Me){const Pe=me.fetchHeatmapTexture(Me,he??5);if(Pe){const Ee=ce();if(Ee&&Ee.length>0&&e){const Be=new nn(0,0,e.rotation[2],"ZYX");let Je=Number.MAX_VALUE,We=Number.MAX_VALUE,Ke=-Number.MAX_VALUE,Ne=-Number.MAX_VALUE;for(const yt of Ee)for(const ct of yt){const Xe=ct.clone().applyEuler(Be);Xe.x>Ke&&(Ke=Xe.x),Xe.xNe&&(Ne=Xe.y),Xe.y0){const Pe=[];if(ce()){for(let Be=0;Be{const Me=[];for(let Pe=0;Pe0&&Ee.rightPoint.length>0&&(Ee.leftPoint[0]!==Ee.rightPoint[0]||Ee.leftPoint[1]!==Ee.rightPoint[1])){let{lh:Be,rh:Je}=Cn.getWallHeight(O,Pe);B.current||(Pe===0&&(Be=O[0].lz),Pe===O.length-1&&(Je=O[O.length-1].lz));const We=new ie(Ee.leftPoint[0],Ee.leftPoint[1],Be),Ke=new ie(Ee.rightPoint[0],Ee.rightPoint[1],Je);Me.push([We,Ke,Q.clone()])}}if(!B.current){const Pe=O[0],Ee=O[O.length-1],Be=new ie(Ee.rightPoint[0],Ee.rightPoint[1],Ee.lz),Je=new ie(Pe.leftPoint[0],Pe.leftPoint[1],Pe.lz);Me.push([Be,Je,Q.clone()])}if(ge){const Pe=[];for(const Ee of Me)Pe.push(Ee[0].clone());Tn.getState().setRoofSegmentVerticesWithoutOverhang(i,[Pe])}else Tn.getState().setRoofSegmentVerticesWithoutOverhang(i,Me)});const ve=H(Me=>Me.elements.filter(Pe=>Pe.parentId===i&&Pe.type===z.Window),cy),Ae=fN(i,e,Q,re),Te=l===Ur.Default||l===Ur.NoTexture?s:"white";return h.jsxs("group",{name:`Pyramid Roof Group ${i}`,children:[h.jsx("group",{name:`Pyramid Roof Segments Group ${i}`,userData:Ae,position:[$.x,$.y,X],onPointerDown:Me=>{aN(Me,e.id,i,re,Q)},onPointerMove:Me=>{sN(Me,i)},onPointerUp:Me=>{lN(Me,t)},onContextMenu:Me=>{TR(Me,i)},children:ge?h.jsx(HQ,{id:i,foundationModel:e,roofType:g,roofSegments:re,center:Q,thickness:u,lineWidth:f,lineColor:p,sideColor:c,color:Te,textureType:l,heatmap:ze}):h.jsxs(h.Fragment,{children:[re.map((Me,Pe)=>{const{points:Ee}=Me;if(Ee.length>0){const[Be,Je]=Ee;if(Be.distanceTo(Je)>.1)return h.jsx("group",{name:`Roof segment ${Pe}`,children:h.jsx(a$,{id:i,index:Pe,foundationModel:e,roofType:g,segment:Me,centroid:Q,thickness:u,color:Te,sideColor:c,texture:C,heatmap:He&&Pe0&&h.jsx(CW,{points:ae,cz:O[0].lz}),P&&!d&&h.jsx(oh,{position:[$.x,$.y,X+u+.15],onPointerDown:Me=>{ye(t.id,Me,Oo.Select),D(!0),Fn.getState().setEnableOrbitController(!1),W.current=!0,j.current=w,v(Pe=>{Pe.resizeHandleType=vt.Top,Pe.selectedElementHeight=X+t.thickness})},onPointerUp:()=>{D(!1),Fn.getState().setEnableOrbitController(!0)},onPointerOver:()=>{v(Me=>{Me.hoveredHandle=Lr.Top,Me.selectedElementHeight=X+t.thickness,Me.selectedElementX=$.x,Me.selectedElementY=$.y})}}),M&&h.jsx(ua,{name:"Roof Intersection Plane",ref:E,args:[1e3,100],visible:!1,rotation:Pwe,position:Twe,onPointerMove:Me=>{if(E.current&&W.current&&e){k(Me);const Pe=S.intersectObjects([E.current]);if(Pe[0]){const Ee=Pe[0].point;if(Ee.z<.001)return;const Be=Math.max(0,Ee.z-e.lz-.3-_);H.getState().updateRoofRiseById(i,Be,X+t.thickness)}}},onPointerUp:Me=>{iN(i,j.current,w),D(!1),Fn.getState().setEnableOrbitController(!0),W.current=!1}})]})},_xt=be.memo(Oxt,qH),Vxt=(t,e,n)=>{const{left:o,right:r,center:i,centerLeft:a,centerRight:l}=n,[s,c]=[t/2,e/2],u=[{x:-s,y:o-c},{x:-s,y:-c},{x:s,y:-c},{x:s,y:r-c}];if(l){const[d,f]=l;u.push({x:d*t,y:f-c})}if(i){const[d,f]=i;u.push({x:d*t,y:f-c})}if(a){const[d,f]=a;u.push({x:d*t,y:f-c})}return u},o9=(t,e)=>{for(const n of H.getState().elements)if(n.type===z.Wall&&n.foundationId===e&&t.has(n.id)){const o=t.get(n.id);if(o){const r=n,i=Vxt(r.lx,r.lz,o);for(const a of H.getState().elements)if(a.parentId===r.id){let{cx:l,cz:s,lx:c,ly:u,lz:d}=a;if(l*=r.lx,s*=r.lz,a.type!==z.SolarPanel?(c*=r.lx,d*=r.lz):d=u,a.type===z.Window&&a.windowType===Ti.Polygonal){const[f,p]=a.polygonTop??Gp,g=l+f*c,y=s+d/2+p;if(!me.isPointInside(g,y,i))return!1}if(!me.isElementInsideWall(new ie(l,0,s),c,d,i,a.type===z.Door))return!1}}}return!0},Gxt=be.memo(({roofSegments:t,thickness:e,lineWidth:n,lineColor:o})=>{if(t.length===0)return null;const r=[],i=new ie(0,0,e),a=t[0].points,l=t[1].points,s=t[2].points,c=t[3].points;r.push(l[3],l[0],a[0],a[1],a[2],l[2],s[0],c[0],c[1],s[1],l[3]);const u=Math.abs(a[0].z)<.15,d=h.jsx(jn,{points:r,lineWidth:n,color:o}),f=h.jsxs(h.Fragment,{children:[h.jsx(jn,{points:[l[0],l[1]],lineWidth:n,color:o}),h.jsx(jn,{points:[l[2],l[3]],lineWidth:n,color:o}),h.jsx(jn,{points:[s[2],s[3]],lineWidth:n,color:o})]});return h.jsxs(h.Fragment,{children:[d,!u&&f,h.jsxs("group",{position:[0,0,e],children:[d,!u&&f]}),h.jsx(jn,{points:[a[0],a[0].clone().add(i)],lineWidth:n,color:o}),h.jsx(jn,{points:[a[1],a[1].clone().add(i)],lineWidth:n,color:o}),h.jsx(jn,{points:[c[0],c[0].clone().add(i)],lineWidth:n,color:o}),h.jsx(jn,{points:[c[1],c[1].clone().add(i)],lineWidth:n,color:o})]})}),Pre=new ie,Cre=new nn,Cwe=new Xt,Xxt=new ie(0,0,1),Jxt=({roofModel:t,foundationModel:e})=>{let{id:n,cx:o,cy:r,lz:i,wallsId:a,parentId:l,topRidgeLeftPoint:s,frontRidgeLeftPoint:c,backRidgeLeftPoint:u,topRidgePoint:d,frontRidgePoint:f,backRidgePoint:p,textureType:g,color:y="white",sideColor:w="white",thickness:b=.2,locked:C,lineColor:P="black",lineWidth:v=.2,roofType:T,rise:A=i,ceiling:x=!1}=t;d===void 0&&(d=s?[...s]:[0,1]),f===void 0&&(f=c?[...c]:[.35,.5]),p===void 0&&(p=u?[...u]:[.35,.5]);const S=Es(n);[P,v]=Cn.getWireframetStyle(P,v,S,C);const R=H(fn),M=H(yp),D=$H(g),[E,W]=m.useState(Lr.Null),[j,L]=m.useState(!1),k=m.useRef(null),{gl:N,camera:F}=oi(),U=m.useMemo(()=>new l0,[]),O=m.useMemo(()=>new Xt,[]),B=m.useRef([0,0]),_=m.useRef(A),X=m.useRef(!1),$=A<.01,Q=(at,Oe,Ze)=>{R(St=>{for(const Pt of St.elements)if(Pt.id===at&&Pt.type===z.Roof&&Pt.roofType===Go.Gambrel){const Rt=Pt;switch(Oe){case Lr.FrontLeft:case Lr.FrontRight:Rt.frontRidgePoint=[...Ze];break;case Lr.TopLeft:case Lr.TopRight:Rt.topRidgePoint=[...Ze];break;case Lr.BackLeft:case Lr.BackRight:Rt.backRidgePoint=[...Ze];break}break}})},le=(at,Oe,Ze,St)=>{const Pt={name:"Resize Gambrel Roof Ridge",timestamp:Date.now(),resizedElementId:at,resizedElementType:z.Roof,oldVal:[...Ze],newVal:[...St],type:Oe,undo:()=>{Q(Pt.resizedElementId,Pt.type,Pt.oldVal)},redo:()=>{Q(Pt.resizedElementId,Pt.type,Pt.newVal)}};H.getState().addUndoable(Pt)},q=at=>{O.x=at.offsetX/N.domElement.clientWidth*2-1,O.y=-(at.offsetY/N.domElement.clientHeight)*2+1,U.setFromCamera(O,F)},te=(at,Oe)=>{L(!0),Fn.getState().setEnableOrbitController(!1),Pre.set(at.x,at.y,at.z).add(ye),e&&Oe&&Cre.set(Gt,0,Oe.relativeAngle,"ZXY")},re=(at,Oe,Ze)=>{const St=new Xt(at.cx,at.cy),Pt=Cn.getComposedWallCenter(Oe),Rt=Cn.getComposedWallLength(Oe),Ut=new Xt(Pt.x,Pt.y).rotateAround(Cwe,at.rotation[2]).add(St),Ht=at.rotation[2]+Oe.relativeAngle,kt=new Xt(Ze.x,Ze.y).sub(Ut).rotateAround(Cwe,-Ht).x/Rt;return Math.min(Math.abs(kt),.5)*(kt>=0?1:-1)},ae=(at,Oe,Ze,St)=>{if(!at)return new ie;const Pt=Cn.getComposedWallLength(at),Rt=new nn(0,0,at.relativeAngle),Ut=new ie(Oe*Pt,0,0);let Ht=Ie;St&&(Ht=Ze*(Ie-St.lz)+St.lz);const At=Cn.getComposedWallCenter(at);return new ie(At.x,At.y,Ht).add(Ut.applyEuler(Rt))},se=(at,Oe)=>{const Ze=at[Oe];let St,Pt;return Oe===0||Oe===2?(St=Ze.lz,Pt=Ze.lz):Oe===1?(St=at[0].lz,Pt=at[2].lz):(St=at[2].lz,Pt=at[0].lz),{lh:St,rh:Pt}},ne=at=>at.id===n&&at.type===z.Roof&&at.roofType===Go.Gambrel,fe=(at,Oe)=>{const Ze=Oe.x-at.x,Pt=(Oe.y-at.y)/Ze,Rt=at.y-Pt*at.x;return{start:at.x,end:Oe.x,k:Pt,b:Rt}},ge=(at,Oe,Ze,St,Pt,Rt,Ut,Ht)=>{const At=at[Oe],{lh:kt,rh:gt}=se(at,Oe),dt=new ie().subVectors(At.leftPoint,At.rightPoint).length(),Ct=dt/2,tt=rt=>rt*dt+Ct,Fe=(rt,mt)=>rt*(Ze-mt)+mt,qe=[new Xt(tt(-Rt[0]),Fe(Rt[1],St)),new Xt(tt(Ut[0]),Ze),new Xt(tt(Ht[0]),Fe(Ht[1],Pt)),new Xt(dt,gt)];return qe.map((rt,mt)=>{const Qe=mt===0?new Xt(0,kt):qe[mt-1];return fe(Qe,rt)})},de=(at,Oe)=>{for(const Ze of at){const{start:St,end:Pt,k:Rt,b:Ut}=Ze;if(Oe>=St&&Oe<=Pt)return Rt*Oe+Ut}return null},Z=at=>{const Oe=new Set;for(const Ze of at)Ze.wallsId.forEach(St=>Oe.add(St));R(Ze=>{for(const St of Ze.elements)if(St.type===z.Wall&&St.foundationId===l&&Oe.has(St.id)){const Pt=St;Pt.leftRoofHeight=Ie,Pt.rightRoofHeight=Ie,Pt.centerLeftRoofHeight=void 0,Pt.centerRightRoofHeight=void 0,Pt.centerRoofHeight=void 0}})},he=(at,Oe,Ze,St,Pt,Rt,Ut)=>{if(Ze!==1&&Ze!==3)return;const Ht=Ze===3,{lh:At,rh:kt}=se(Oe,Ze),gt=Ht?Ut:Pt,dt=Ht?Pt:Ut,Ct=Ht?Rt:[-Rt[0],Rt[1]],tt=ge(Oe,Ze,St,At,kt,gt,Ct,dt),Fe=tt.slice(1).map(rt=>rt.start),qe=Oe[Ze],je=qe.wallsId.reduce((rt,mt)=>{const Qe=H.getState().elements.find(Tt=>Tt.id===mt);return Qe?[...rt,Qe.lx+rt[rt.length-1]]:rt},[0]);for(let rt=0;rt=Qe&&Qt<=Tt){const gn=(Qt-Ft)/zt,an=de(tt,Qt);an!==null&&(tn===0?_t.centerLeft=[gn,an]:tn===1?_t.center=[gn,an]:tn===2&&(_t.centerRight=[gn,an]))}}at.set(mt,_t)}}return at},xe=(at,Oe,Ze,St,Pt)=>{const Rt=new Map;return he(Rt,at,1,Oe,Ze,St,Pt),he(Rt,at,3,Oe,Ze,St,Pt),Rt},He=(at,Oe,Ze,St,Pt)=>{const Rt=new Set(at[0].wallsId),Ut=new Set(at[2].wallsId),Ht=xe(at,Oe,Ze,St,Pt);R(At=>{for(const kt of At.elements)if(kt.type===z.Wall&&kt.foundationId===l){if(Rt.has(kt.id)){const gt=kt,{lh:dt,rh:Ct}=se(at,0);gt.roofId=n,gt.leftRoofHeight=dt,gt.rightRoofHeight=Ct}else if(Ut.has(kt.id)){const gt=kt,{lh:dt,rh:Ct}=se(at,2);gt.roofId=n,gt.leftRoofHeight=dt,gt.rightRoofHeight=Ct}else if(Ht.has(kt.id)){const gt=Ht.get(kt.id);if(gt){const dt=kt,{left:Ct,right:tt,center:Fe,centerLeft:qe,centerRight:je}=gt;if(dt.roofId=n,dt.leftRoofHeight=Ct,dt.rightRoofHeight=tt,qe){const[rt,mt]=qe;dt.centerLeftRoofHeight?(dt.centerLeftRoofHeight[0]=rt,dt.centerLeftRoofHeight[1]=mt):dt.centerLeftRoofHeight=[rt,mt]}else dt.centerLeftRoofHeight=void 0;if(Fe){const[rt,mt]=Fe;dt.centerRoofHeight?(dt.centerRoofHeight[0]=rt,dt.centerRoofHeight[1]=mt):dt.centerRoofHeight=[rt,mt]}else dt.centerRoofHeight=void 0;if(je){const[rt,mt]=je;dt.centerRightRoofHeight?(dt.centerRightRoofHeight[0]=rt,dt.centerRightRoofHeight[1]=mt):dt.centerRightRoofHeight=[rt,mt]}else dt.centerRightRoofHeight=void 0}}}})},Se=Fye(a[0],l),{highestWallHeight:ze,topZ:Ie}=kye(Se,A,!0);dN(t,ze);const ye=m.useMemo(()=>{if(!Se||Se.length!==4)return new ie;const at=Se.map(Ze=>({x:Ze.leftPoint.x,y:Ze.leftPoint.y})),Oe=me.calculatePolygonCentroid(at);return new ie(Oe.x,Oe.y,Ie)},[Se,Ie]),ce=m.useMemo(()=>{if(!Se||Se.length!==4)return new ie;const at=Se[3],[Oe,Ze]=d;return ae(at,Oe,Ze).sub(ye)},[Se,ye,d]),pe=m.useMemo(()=>{if(!Se||Se.length!==4)return new ie;const at=Se[1],[Oe,Ze]=d;return ae(at,-Oe,Ze).sub(ye)},[Se,ye,d]),ve=m.useMemo(()=>new ie().addVectors(ce,pe).divideScalar(2),[ce,pe]),Ae=m.useMemo(()=>{if(!Se||Se.length!==4)return new ie;const at=Se[3],[Oe,Ze]=f;return ae(at,Oe,Ze,Se[0]).sub(ye)},[Se,ye,f]),Te=m.useMemo(()=>{if(!Se||Se.length!==4)return new ie;const at=Se[1],[Oe,Ze]=f;return ae(at,-Oe,Ze,Se[0]).sub(ye)},[Se,ye,f]),Me=m.useMemo(()=>{if(!Se||Se.length!==4)return new ie;const at=Se[1],[Oe,Ze]=p;return ae(at,Oe,Ze,Se[2]).sub(ye)},[Se,ye,p]),Pe=m.useMemo(()=>{if(!Se||Se.length!==4)return new ie;const at=Se[3],[Oe,Ze]=p;return ae(at,-Oe,Ze,Se[2]).sub(ye)},[Se,ye,p]),Ee=m.useMemo(()=>!Se||Se.length!==4?[]:Se.map(at=>Cn.getComposedWallNormal(at).multiplyScalar(at.eavesLength)),[Se]),Be=m.useMemo(()=>Xxt.clone().multiplyScalar(b),[b]),Je=m.useMemo(()=>{const at=[];if(!Se||Se.length!==4)return at;const[Oe,Ze,St,Pt]=Se,[Rt,Ut,Ht,At]=Ee,kt=Oe.leftPoint,gt=Oe.rightPoint,dt=St.leftPoint,Ct=St.rightPoint,tt=kt.clone().add(Rt),Fe=gt.clone().add(Rt),qe=Ct.clone().add(At),je=kt.clone().add(At),rt=gt.clone().add(Ut),mt=dt.clone().add(Ut),Qe=dt.clone().add(Ht),Tt=Ct.clone().add(Ht),Dt=[],{lh:lt,rh:zt}=se(Se,0),Ft=Cn.getDistance(kt,gt,Ae.clone().add(ye)),_t=Math.min((Oe.eavesLength??0)/Ft*(Ae.clone().add(ye).z-lt),lt),tn=Cn.getDistance(kt,gt,Te.clone().add(ye)),Qt=Math.min((Oe.eavesLength??0)/tn*(Te.clone().add(ye).z-zt),zt),gn=Cn.getIntersectionPoint(qe,je,tt,Fe).setZ(lt-_t).sub(ye),an=Cn.getIntersectionPoint(tt,Fe,rt,mt).setZ(zt-Qt).sub(ye),mn=Cn.getIntersectionPoint(Ae,Te,qe.clone().sub(ye),je.clone().sub(ye)).setZ(Ae.z),Hn=Cn.getIntersectionPoint(Te,Ae,rt.clone().sub(ye),mt.clone().sub(ye)).setZ(Te.z);Dt.push(gn,an,Hn,mn),Dt.push(gn.clone().add(Be),an.clone().add(Be),Hn.clone().add(Be),mn.clone().add(Be));const Fo=Cn.getComposedWallCenter(Oe),yo=-Oe.relativeAngle,So=new ie(Fo.x,Fo.y).sub(ve.clone().setZ(0)).length();at.push({points:Dt,angle:yo,length:So});const $o=[],mo=Cn.getIntersectionPoint(ce,pe,qe.clone().sub(ye),je.clone().sub(ye)).setZ(ce.z),Jn=Cn.getIntersectionPoint(ce,pe,rt.clone().sub(ye),mt.clone().sub(ye)).setZ(pe.z);$o.push(mn,Hn,Jn,mo),$o.push(mn.clone().add(Be),Hn.clone().add(Be),Jn.clone().add(Be),mo.clone().add(Be)),at.push({points:$o,angle:yo,length:So});const uo=-St.relativeAngle,{lh:ir,rh:Rr}=se(Se,2),br=Cn.getDistance(dt,Ct,Me.clone().add(ye)),Vr=Math.min((St.eavesLength??0)/br*(Me.clone().add(ye).z-ir),ir),Wo=Cn.getDistance(dt,Ct,Pe.clone().add(ye)),wn=Math.min((St.eavesLength??0)/Wo*(Pe.clone().add(ye).z-Rr),Rr),In=Cn.getIntersectionPoint(rt,mt,Qe,Tt).setZ(ir-Vr).sub(ye),ar=Cn.getIntersectionPoint(Qe,Tt,qe,je).setZ(Rr-wn).sub(ye),No=Cn.getIntersectionPoint(Me,Pe,rt.clone().sub(ye),mt.clone().sub(ye)).setZ(Pe.z),eo=Cn.getIntersectionPoint(Pe,Me,qe.clone().sub(ye),je.clone().sub(ye)).setZ(Pe.z),Xn=Cn.getComposedWallCenter(St),Jo=new ie(Xn.x,Xn.y).sub(ve.clone().setZ(0)).length(),xo=[];xo.push(No,eo,mo,Jn),xo.push(No.clone().add(Be),eo.clone().add(Be),mo.clone().add(Be),Jn.clone().add(Be)),at.push({points:xo,angle:uo,length:Jo});const Qo=[];return Qo.push(In,ar,eo,No),Qo.push(In.clone().add(Be),ar.clone().add(Be),eo.clone().add(Be),No.clone().add(Be)),at.push({points:Qo,angle:uo,length:Jo}),at},[Se,Ie,b,d,f,p]),We=m.useMemo(()=>!Se||Se.length!==4?null:Se.map(at=>at.leftPoint),[Se]);m.useEffect(()=>{(!Se||Se.length!==4)&&M(n,!1,!1,!0)},[Se]);const Ke=RQ();m.useEffect(()=>{if((Se==null?void 0:Se.length)!==4)return;(H.getState().addedRoofIdSet.has(n)||!Ke)&&($?Z(Se):He(Se,Ie,f,d,p),CQ(e,n,Je,ye,Ie,b,$),H.getState().deleteAddedRoofId(n))},[Je]),Lye(e,n,Je,ye,Ie,b,$);const Ne=()=>{const at=[];if(!Se||Se.length!==4)return at;const Oe=Se.map((At,kt,gt)=>new ie(At.leftPoint.x,At.leftPoint.y,se(gt,kt).lh)),Ze=Ae.clone().add(ye),St=Te.clone().add(ye),Pt=Me.clone().add(ye),Rt=Pe.clone().add(ye),Ut=ce.clone().add(ye),Ht=pe.clone().add(ye);at.push([Oe[0],Oe[1],St,Ze]),at.push([Ze,St,Ht,Ut]),at.push([Ut,Ht,Pt,Rt]),at.push([Oe[2],Oe[3],Rt,Pt]),$?Tn.getState().setRoofSegmentVerticesWithoutOverhang(n,[Oe]):Tn.getState().setRoofSegmentVerticesWithoutOverhang(n,at)},De=cN(n,ye,Je,$,Go.Gambrel);uN(Ne);const ke=H(at=>at.elements.filter(Oe=>Oe.parentId===n&&Oe.type===z.Window),cy),Ye=H(Y0),it=ht(Ss),Ve=H(Cf),yt=Tn(u1),[ct,Xe]=m.useState(null),[ut,ft]=m.useState([]);m.useEffect(()=>{if(it)if($){const at=yt(n);if(at){const Oe=me.fetchHeatmapTexture(at,Ve??5);if(Oe){const Ze=De();if(Ze&&Ze.length>0&&e){const St=new nn(0,0,e.rotation[2],"ZYX");let Pt=Number.MAX_VALUE,Rt=Number.MAX_VALUE,Ut=-Number.MAX_VALUE,Ht=-Number.MAX_VALUE;for(const tt of Ze)for(const Fe of tt){const qe=Fe.clone().applyEuler(St);qe.x>Ut&&(Ut=qe.x),qe.xHt&&(Ht=qe.y),qe.y0){const Oe=[];for(let Ze=0;Ze{aN(at,e.id,n,Je,ye)},onPointerMove:at=>{sN(at,n)},onPointerUp:at=>{lN(at,t)},onContextMenu:at=>{TR(at,n)},children:$?h.jsx(HQ,{id:n,foundationModel:e,roofType:T,roofSegments:Je,center:new ie(ye.x,ye.y,Ie),thickness:b,lineWidth:v,lineColor:P,sideColor:w,color:st,textureType:g,heatmap:ct}):h.jsxs(h.Fragment,{children:[Je.map((at,Oe,Ze)=>h.jsx(a$,{id:n,index:Oe,foundationModel:e,roofType:T,segment:at,centroid:ye,thickness:b,color:st,sideColor:w,texture:D,heatmap:ut&&Oe0&&Se[0].lz===Se[2].lz&&We&&h.jsx(CW,{cz:Se[0].lz,points:We}),S&&!C&&h.jsxs("group",{position:[ye.x,ye.y,ye.z+b],children:[h.jsx(oh,{position:[ve.x,ve.y,ve.z],onPointerDown:at=>{if(Ye(t.id,at,Oo.Select),X.current=!0,_.current=A,L(!0),Pre.set(ve.x,ve.y,Ie).add(ye),e){const Oe=-Math.atan2(F.position.x-o,F.position.y-r)-e.rotation[2];Cre.set(-Gt,0,Oe,"ZXY")}W(Lr.TopMid),Fn.getState().setEnableOrbitController(!1),R(Oe=>{Oe.resizeHandleType=vt.Top,Oe.selectedElementHeight=Ie+t.thickness})},onPointerOver:()=>{R(at=>{at.hoveredHandle=Lr.TopMid,at.selectedElementHeight=Ie+t.thickness,at.selectedElementX=ve.x,at.selectedElementY=ve.y})}}),!$&&h.jsxs(h.Fragment,{children:[h.jsx(oh,{position:[ce.x,ce.y,ce.z],onPointerDown:()=>{X.current=!0,B.current=[...d],te(ce,Se[3]),W(Lr.TopLeft)}}),h.jsx(oh,{position:[pe.x,pe.y,pe.z],onPointerDown:()=>{X.current=!0,B.current=[...d],te(pe,Se[1]),W(Lr.TopRight)}}),h.jsx(oh,{position:[Ae.x,Ae.y,Ae.z],onPointerDown:()=>{X.current=!0,B.current=[...f],te(Ae,Se[3]),W(Lr.FrontLeft)}}),h.jsx(oh,{position:[Te.x,Te.y,Te.z],onPointerDown:()=>{X.current=!0,B.current=[...f],te(Te,Se[1]),W(Lr.FrontRight)}}),h.jsx(oh,{position:[Me.x,Me.y,Me.z],onPointerDown:()=>{X.current=!0,B.current=[...p],te(Me,Se[1]),W(Lr.BackLeft)}}),h.jsx(oh,{position:[Pe.x,Pe.y,Pe.z],onPointerDown:()=>{X.current=!0,B.current=[...p],te(Pe,Se[3]),W(Lr.BackRight)}})]})]}),j&&h.jsx(ua,{name:"Roof Intersection Plane",ref:k,args:[1e3,100],visible:!1,position:Pre,rotation:Cre,onPointerMove:at=>{if(k.current&&X.current&&Se&&Se.length===4){q(at);const Oe=U.intersectObjects([k.current]);if(Oe[0]&&e){const Ze=Oe[0].point;if(Ze.z<.001)return;switch(E){case Lr.TopMid:{const St=Math.max(0,Ze.z-e.lz-.3-ze),Pt=ze+St,Rt=xe(Se,Pt,f,d,p);o9(Rt,l)&&H.getState().updateRoofRiseById(n,St,Pt+t.thickness);break}case Lr.FrontLeft:{if(e&&Se&&Se.length===4){const St=me.clamp(re(e,Se[3],Ze),d[0]+.05,.45),Pt=Ie-Se[0].lz,Rt=me.clamp((Ze.z-e.lz-Se[0].lz)/Pt,0,1),Ut=[St,Rt],Ht=xe(Se,Ie,Ut,d,p);o9(Ht,l)&&R(At=>{const kt=At.elements.find(gt=>ne(gt));kt&&(kt.frontRidgePoint[0]=Ut[0],kt.frontRidgePoint[1]=Ut[1])})}break}case Lr.FrontRight:{if(e&&Se&&Se.length===4){const St=me.clamp(re(e,Se[1],Ze),-.45,-d[0]-.05),Pt=Ie-Se[0].lz,Rt=me.clamp((Ze.z-e.lz-Se[0].lz)/Pt,0,1),Ut=[-St,Rt],Ht=xe(Se,Ie,Ut,d,p);o9(Ht,l)&&R(At=>{const kt=At.elements.find(gt=>ne(gt));kt&&(kt.frontRidgePoint=[...Ut])})}break}case Lr.TopLeft:{if(e&&Se&&Se.length===4){const Pt=[me.clamp(re(e,Se[3],Ze),-p[0]+.05,f[0]-.05),d[1]],Rt=xe(Se,Ie,f,Pt,p);o9(Rt,l)&&R(Ut=>{const Ht=Ut.elements.find(At=>ne(At));Ht&&(Ht.topRidgePoint=[...Pt])})}break}case Lr.TopRight:{if(e&&Se&&Se.length===4){const Pt=[-me.clamp(re(e,Se[1],Ze),-f[0]+.05,p[0]-.05),d[1]],Rt=xe(Se,Ie,f,Pt,p);o9(Rt,l)&&R(Ut=>{const Ht=Ut.elements.find(At=>ne(At));Ht&&(Ht.topRidgePoint=[...Pt])})}break}case Lr.BackLeft:{if(e&&Se&&Se.length===4){const St=me.clamp(re(e,Se[1],Ze),-d[0]+.05,.45),Pt=Ie-Se[2].lz,Rt=me.clamp((Ze.z-e.lz-Se[2].lz)/Pt,0,1),Ut=[St,Rt],Ht=xe(Se,Ie,f,d,Ut);o9(Ht,l)&&R(At=>{const kt=At.elements.find(gt=>ne(gt));kt&&(kt.backRidgePoint=[...Ut])})}break}case Lr.BackRight:{if(e&&Se&&Se.length===4){const St=me.clamp(re(e,Se[3],Ze),-.45,d[0]-.05),Pt=Ie-Se[2].lz,Rt=me.clamp((Ze.z-e.lz-Se[2].lz)/Pt,0,1),Ut=[-St,Rt],Ht=xe(Se,Ie,f,d,Ut);o9(Ht,l)&&R(At=>{const kt=At.elements.find(gt=>ne(gt));kt&&(kt.backRidgePoint=[...Ut])})}break}}}}},onPointerUp:()=>{switch(E){case Lr.TopMid:{iN(n,_.current,A);break}case Lr.TopLeft:case Lr.TopRight:{le(n,E,B.current,d);break}case Lr.FrontLeft:case Lr.FrontRight:{le(n,E,B.current,f);break}case Lr.BackLeft:case Lr.BackRight:{le(n,E,B.current,p);break}}X.current=!1,L(!1),W(Lr.Null),Fn.getState().setEnableOrbitController(!0)},children:h.jsx("meshBasicMaterial",{side:$r,transparent:!0,opacity:.5})})]})},Kxt=be.memo(Jxt,qH),pY=new ie,gY=new nn,Rwe=new Xt,qxt=new ie(0,0,1),Mz=be.memo(({start:t,end:e,width:n,height:o,offset:r,color:i})=>{const a=m.useMemo(()=>new Xt(t.x,t.y),[t]),l=m.useMemo(()=>new Xt(e.x,e.y),[e]),s=m.useMemo(()=>new Xt().subVectors(l,a).angle(),[a,l]),c=m.useMemo(()=>{const u=new Fl,d=a.distanceTo(l),f=t.z-e.z;return u.moveTo(0,0),u.lineTo(d,-f),u.lineTo(d,-f+o),u.lineTo(0,o),u.closePath(),u},[t,e,a,l,o]);return h.jsx("group",{position:r,children:h.jsx(nw,{args:[c,{steps:1,depth:n,bevelEnabled:!1}],position:t,rotation:[Gt,0,s,"ZXY"],castShadow:!0,receiveShadow:!0,children:h.jsx("meshStandardMaterial",{color:i})})})}),$xt=({ridgeLeftPoint:t,ridgeRightPoint:e,wallArray:n,height:o,isShed:r,width:i,spacing:a,color:l})=>{const[s,c,u,d]=n,f=m.useMemo(()=>new ie().subVectors(e,t).normalize(),[]),p=m.useMemo(()=>t.clone().add(f.clone().multiplyScalar(-(d.eavesLength??0)/2)),[t,d.eavesLength]),g=m.useMemo(()=>e.clone().add(f.clone().multiplyScalar((c.eavesLength??0)/2)),[t,c.eavesLength]),y=s.leftPoint.clone().setZ(s.lz),w=u.rightPoint.clone().setZ(u.lz),b=m.useMemo(()=>{if(n.length<4)return[];const T=new ie().subVectors(new ie(s.rightPoint.x,s.rightPoint.y,s.lz),y).normalize(),A=new ie().subVectors(new ie(u.leftPoint.x,u.leftPoint.y,u.lz),w).normalize(),x=t.distanceTo(e),S=new ie().subVectors(s.leftPoint,s.rightPoint).length(),R=new ie().subVectors(u.leftPoint,u.rightPoint).length(),M=i,D=Math.floor((Math.min(x,S,R)-i)/a)+2;return new Array(D).fill(0).map((E,W)=>{let j;W===D-1?j=x:j=W*a+M;const L=t.clone().add(f.clone().multiplyScalar(j)),k=y.clone().add(T.clone().multiplyScalar(j)),N=w.clone().add(A.clone().multiplyScalar(j)),F=new ie().subVectors(k,L).normalize().multiplyScalar(s.eavesLength??0),U=new ie().subVectors(N,L).normalize().multiplyScalar(u.eavesLength??0);return k.add(F),N.add(U),{ridge:L,front:k,back:N}})},[a,t]),C=t.distanceTo(y)>t.distanceTo(w),P=new ie(-i,0,0),v=new ie(0,i/2,0);return h.jsxs(h.Fragment,{children:[b.map((T,A)=>h.jsx(be.Fragment,{children:r?C?h.jsx(Mz,{start:T.ridge,end:T.front,width:i,height:o,color:l}):h.jsx(Mz,{start:T.ridge,end:T.back,width:i,height:o,color:l}):h.jsxs(h.Fragment,{children:[h.jsx(Mz,{start:T.ridge,end:T.front,width:i,height:o,color:l}),h.jsx(Mz,{start:T.ridge,end:T.back,width:i,height:o,color:l,offset:P})]})},A)),h.jsx(Mz,{start:p,end:g,width:i,height:o,color:l,offset:v})]})},Qxt=be.memo(({roofSegments:t,thickness:e,lineWidth:n,lineColor:o})=>{if(t.length===0)return null;const r=[],i=new ie(0,0,e),a=t.length===1;for(const f of t){const[p,g,y,w]=f.points;r.push(w,p,g,y),a&&r.push(w)}const l=Math.abs(t[0].points[0].z)<.015,s=t[0].points[3],c=t[0].points[2],u=h.jsx(jn,{points:r,lineWidth:n,color:o}),d=h.jsx(jn,{points:[s,c],lineWidth:n,color:o});return h.jsxs(h.Fragment,{children:[u,!l&&!a&&d,h.jsxs("group",{position:[0,0,e],children:[u,!l&&!a&&d]}),t.map((f,p)=>{const[g,y,w,b]=f.points;return h.jsxs("group",{children:[h.jsx(jn,{points:[g,g.clone().add(i)],lineWidth:n,color:o}),h.jsx(jn,{points:[y,y.clone().add(i)],lineWidth:n,color:o}),a&&h.jsxs(h.Fragment,{children:[h.jsx(jn,{points:[w,w.clone().add(i)],lineWidth:n,color:o}),h.jsx(jn,{points:[b,b.clone().add(i)],lineWidth:n,color:o})]})]},p)})]})}),Zxt=({roofModel:t,foundationModel:e})=>{let{id:n,parentId:o,wallsId:r,lz:i,rise:a=i,thickness:l=.2,ridgeLeftPoint:s,ridgeRightPoint:c,textureType:u,color:d="white",sideColor:f="white",locked:p,lineColor:g="black",lineWidth:y=.2,roofStructure:w,rafterSpacing:b=2,rafterWidth:C=.1,rafterColor:P="white",glassTint:v="#73D8FF",opacity:T=.5,ceiling:A=!1}=t;const x=H(fn),S=H(yp),R=Es(n);[g,y]=Cn.getWireframetStyle(g,y,R,p);const{gl:M,camera:D}=oi(),E=m.useMemo(()=>new l0,[]),W=m.useMemo(()=>new Xt,[]),[j,L]=m.useState(!1),[k,N]=m.useState(Lr.Null),F=Math.abs(s[0])>.45,U=m.useRef(null),O=m.useRef(s[0]),B=m.useRef(c[0]),_=m.useRef(a),X=m.useRef(!1),$=(De,ke,Ye)=>{x(it=>{for(const Ve of it.elements)if(Ve.id===De&&Ve.type===z.Roof&&Ve.roofType===Go.Gable){Ve.ridgeLeftPoint[0]=ke,Ve.ridgeRightPoint[0]=Ye;break}})},Q=(De,ke,Ye,it,Ve)=>{const yt={name:"Resize Gable Roof Ridge",timestamp:Date.now(),resizedElementId:De,resizedElementType:z.Roof,oldLeft:ke,oldRight:Ye,newLeft:it,newRight:Ve,undo:()=>{$(yt.resizedElementId,ke,Ye)},redo:()=>{$(yt.resizedElementId,it,Ve)}};H.getState().addUndoable(yt)},le=De=>{W.x=De.offsetX/M.domElement.clientWidth*2-1,W.y=-(De.offsetY/M.domElement.clientHeight)*2+1,E.setFromCamera(W,D)},q=(De,ke,Ye)=>{const it=new Xt(De.cx,De.cy),Ve=new ie().addVectors(ke.leftPoint,ke.rightPoint).divideScalar(2),yt=new ie().subVectors(ke.leftPoint,ke.rightPoint).length(),ct=new Xt(Ve.x,Ve.y).rotateAround(Rwe,De.rotation[2]).add(it),Xe=De.rotation[2]+ke.relativeAngle,ft=new Xt(Ye.x,Ye.y).sub(ct).rotateAround(Rwe,-Xe).x/yt;return Math.min(Math.abs(ft),.5)*(ft>=0?1:-1)},te=(De,ke,Ye)=>{if(!De)return new ie;const it=new ie().subVectors(De.leftPoint,De.rightPoint).length(),Ve=new ie().addVectors(De.leftPoint,De.rightPoint).divideScalar(2),yt=new nn(0,0,De.relativeAngle),ct=new ie(ke*it,0,0),Xe=Ye*a+he;return new ie(Ve.x,Ve.y,Xe).add(ct.applyEuler(yt))},re=(De,ke)=>{const Ye=De[ke];let it,Ve;return ke===0||ke===2?(it=Ye.lz,Ve=Ye.lz):ke===1?(it=De[0].lz,Ve=De[2].lz):(it=De[2].lz,Ve=De[0].lz),{lh:it,rh:Ve}},ae=(De,ke)=>{const Ye=De.slice().reverse();return se(Ye,0,ke-1),se(Ye,ke,Ye.length-1),Ye},se=(De,ke,Ye)=>{for(;keDe*Ye+ke,fe=(De,ke,Ye,it,Ve)=>{const yt=ke[Ye],ct=new ie().subVectors(yt.leftPoint,yt.rightPoint).length(),Xe=(Ve[0]+.5)*ct,{lh:ut,rh:ft}=re(ke,Ye),ot=Ve[1]*(it-ut)/Xe,st=ut,at=-(Ve[1]*(it-ft))/(ct-Xe),Oe=ft-at*ct,Ze=yt.wallsId.reduce((St,Pt)=>{const Rt=H.getState().elements.find(Ut=>Ut.id===Pt);return Rt?[...St,Rt.lx+St[St.length-1]]:St},[0]);for(let St=0;StXe&&(At.center=[(Xe-Rt)/Ht-.5,it]),De.set(Pt,At)}return De},ge=(De,ke,Ye,it)=>{const Ve=new Map;return fe(Ve,De,1,ke,it),fe(Ve,De,3,ke,Ye),Ve},de=(De,ke,Ye,it)=>{const[Ve,yt,ct,Xe]=De,ut=new Set(Ve.wallsId),ft=new Set(ct.wallsId),ot=ge(De,ke,Ye,it);x(st=>{for(const at of st.elements)if(at.type===z.Wall&&at.foundationId===o){if(ut.has(at.id)){const Oe=at;if(Oe.roofId=n,Ye[0]===.5)Oe.leftRoofHeight=ke,Oe.rightRoofHeight=ke,Oe.centerRoofHeight=void 0;else{const{lh:Ze,rh:St}=re(De,0);Oe.leftRoofHeight=Ze,Oe.rightRoofHeight=St}}else if(ft.has(at.id)){const Oe=at;if(Oe.roofId=n,Ye[0]===-.5)Oe.leftRoofHeight=ke,Oe.rightRoofHeight=ke,Oe.centerRoofHeight=void 0;else{const{lh:Ze,rh:St}=re(De,2);Oe.leftRoofHeight=Ze,Oe.rightRoofHeight=St}}else if(ot.has(at.id)){const Oe=ot.get(at.id);if(Oe){const Ze=at,{left:St,right:Pt,center:Rt}=Oe;if(Ze.roofId=n,Ze.leftRoofHeight=St,Ze.rightRoofHeight=Pt,Rt){const[Ut,Ht]=Rt;Ze.centerRoofHeight?(Ze.centerRoofHeight[0]=Ut,Ze.centerRoofHeight[1]=Ht):Ze.centerRoofHeight=[Ut,Ht]}else Ze.centerRoofHeight=void 0}}}})},Z=Fye(r[0],o),{highestWallHeight:he,topZ:xe}=kye(Z,a,!0);dN(t,he);const He=m.useMemo(()=>{if(Z===null||Z.length!==4)return new ie;const De=Z.map(Ye=>({x:Ye.leftPoint.x,y:Ye.leftPoint.y})),ke=me.calculatePolygonCentroid(De);return new ie(ke.x,ke.y,xe)},[Z,xe]),Se=m.useMemo(()=>{if(Z===null)return new ie;const De=Z[3],[ke,Ye]=s;return te(De,ke,Ye)},[Z,xe,s]),ze=m.useMemo(()=>{if(Z===null)return new ie;const De=Z[1],[ke,Ye]=c;return te(De,ke,Ye)},[Z,xe,c]),Ie=m.useMemo(()=>new ie((Se.x+ze.x)/2,(Se.y+ze.y)/2,xe),[Se,ze]),ye=m.useMemo(()=>!Z||Z.length!==4?null:Z.map(De=>Cn.getComposedWallNormal(De).multiplyScalar(De.eavesLength)),[Z]),ce=m.useMemo(()=>qxt.clone().multiplyScalar(l),[l]),pe=m.useMemo(()=>{const De=[];if(!Z||Z.length!==4||!ye)return De;if(F){const ke=[],Ye=s[0]<0?0:2,it=ae(Z,Ye),Ve=ae(ye,Ye),[yt,ct,Xe,ut]=it,[ft,ot,st,at]=Ve,Oe=yt.leftPoint,Ze=yt.rightPoint,St=Xe.leftPoint,Pt=Xe.rightPoint,Rt=Oe.clone().add(ft),Ut=Ze.clone().add(ft),Ht=Pt.clone().add(at),At=Oe.clone().add(at),kt=Ze.clone().add(ot),gt=St.clone().add(ot),dt=St.clone().add(st),Ct=Pt.clone().add(st),{lh:tt,rh:Fe}=re(it,0),{lh:qe,rh:je}=re(it,2),rt=Cn.getDistance(Oe,Ze,Pt),mt=Math.min((yt.eavesLength??0)/rt*(xe-tt),tt),Qe=Cn.getDistance(Oe,Ze,St),Tt=Math.min((yt.eavesLength??0)/Qe*(xe-Fe),Fe),Dt=Cn.getDistance(St,Pt,Ze),lt=Math.min((Xe.eavesLength??0)/Dt*(xe-Fe),qe),zt=Cn.getDistance(St,Pt,Oe),Ft=Math.min((Xe.eavesLength??0)/zt*(xe-tt),je),_t=Cn.getIntersectionPoint(Ht,At,Rt,Ut).setZ(tt-mt).sub(He),tn=Cn.getIntersectionPoint(Rt,Ut,kt,gt).setZ(Fe-Tt).sub(He),Qt=Cn.getIntersectionPoint(kt,gt,dt,Ct).setZ(xe+lt).sub(He),gn=Cn.getIntersectionPoint(dt,Ct,Ht,At).setZ(xe+Ft).sub(He);ke.push(_t,tn,Qt,gn),ke.push(_t.clone().add(ce),tn.clone().add(ce),Qt.clone().add(ce),gn.clone().add(ce));const mn=new ie().addVectors(yt.leftPoint,yt.rightPoint).divideScalar(2).clone().sub(Ie.clone().setZ(0)).length();De.push({points:ke,angle:-yt.relativeAngle,length:mn})}else{const[ke,Ye,it,Ve]=Z,[yt,ct,Xe,ut]=ye,ft=ke.leftPoint.clone().add(yt),ot=ke.rightPoint.clone().add(yt),st=it.rightPoint.clone().add(ut),at=ke.leftPoint.clone().add(ut),Oe=ke.rightPoint.clone().add(ct),Ze=it.leftPoint.clone().add(ct),St=it.leftPoint.clone().add(Xe),Pt=it.rightPoint.clone().add(Xe),Rt=Cn.getIntersectionPoint(Se,ze,st.clone(),at.clone()).setZ(Se.z).sub(He),Ut=Cn.getIntersectionPoint(Se,ze,Oe.clone(),Ze.clone()).setZ(ze.z).sub(He),Ht=[],{lh:At,rh:kt}=re(Z,0),gt=Cn.getDistance(ke.leftPoint,ke.rightPoint,Se),dt=Math.min((ke.eavesLength??0)/gt*(Se.z-At),At),Ct=Cn.getDistance(ke.leftPoint,ke.rightPoint,ze),tt=Math.min((ke.eavesLength??0)/Ct*(ze.z-kt),kt),Fe=Cn.getIntersectionPoint(st,at,ft,ot).setZ(At-dt).sub(He),qe=Cn.getIntersectionPoint(ft,ot,Oe,Ze).setZ(kt-tt).sub(He);Ht.push(Fe,qe,Ut,Rt),Ht.push(Fe.clone().add(ce),qe.clone().add(ce),Ut.clone().add(ce),Rt.clone().add(ce));const rt=new ie().addVectors(ke.leftPoint,ke.rightPoint).divideScalar(2).clone().sub(He.clone().setZ(0)).length();De.push({points:Ht,angle:-ke.relativeAngle,length:rt});const mt=[],{lh:Qe,rh:Tt}=re(Z,2),Dt=Cn.getDistance(it.leftPoint,it.rightPoint,ze),lt=Math.min((it.eavesLength??0)/Dt*(ze.z-Qe),Qe),zt=Cn.getDistance(it.leftPoint,it.rightPoint,Se),Ft=Math.min((it.eavesLength??0)/zt*(Se.z-Tt),Tt),_t=Cn.getIntersectionPoint(Oe,Ze,St,Pt).setZ(Qe-lt).sub(He),tn=Cn.getIntersectionPoint(St,Pt,st,at).setZ(Tt-Ft).sub(He);mt.push(_t,tn,Rt,Ut),mt.push(_t.clone().add(ce),tn.clone().add(ce),Rt.clone().add(ce),Ut.clone().add(ce));const gn=new ie().addVectors(it.leftPoint,it.rightPoint).divideScalar(2).clone().sub(He.clone().setZ(0)).length();De.push({points:mt,angle:-it.relativeAngle,length:gn})}return De},[Z,Se,ze,xe,l]),ve=m.useMemo(()=>!Z||Z.length!==4?null:Z.map(De=>De.leftPoint),[Z]);m.useEffect(()=>{(!Z||Z.length!==4)&&S(n,!1,!1,!0)},[Z]);const Ae=RQ();m.useEffect(()=>{if((Z==null?void 0:Z.length)!==4)return;(H.getState().addedRoofIdSet.has(n)||!Ae)&&(de(Z,xe,s,c),CQ(e,n,pe,He,xe,l),H.getState().deleteAddedRoofId(n))},[pe]),Lye(e,n,pe,He,xe,l);const Te=()=>{if(!Z||Z.length!==4)return;const De=[];if(F){const ke=s[0]<0?0:2,it=ae(Z,ke).map((Ve,yt,ct)=>new ie(Ve.leftPoint.x,Ve.leftPoint.y,re(ct,yt).lh));De.push(it)}else{const ke=Z.map((Ye,it,Ve)=>new ie(Ye.leftPoint.x,Ye.leftPoint.y,re(Ve,it).lh));De.push([ke[0],ke[1],ze.clone(),Se.clone()]),De.push([ke[2],ke[3],Se.clone(),ze.clone()])}Tn.getState().setRoofSegmentVerticesWithoutOverhang(n,De)};cN(n,He,pe,!1,Go.Gable),uN(Te);const Me=H(De=>De.elements.filter(ke=>ke.parentId===n&&ke.type===z.Window),cy),Pe=H(Y0),Ee=ht(Ss),Be=H(Cf),Je=Tn(u1),[We,Ke]=m.useState([]);m.useEffect(()=>{if(Ee){const De=pe.length;if(De>0){const ke=[];for(let Ye=0;Ye{aN(De,e.id,n,pe,He)},onPointerMove:De=>{sN(De,n)},onPointerUp:De=>{lN(De,t)},onContextMenu:De=>{TR(De,n)},children:[pe.map((De,ke,Ye)=>{const{points:it,angle:Ve,length:yt}=De,ct=Math.abs(it[0].z)<.1;return Z?h.jsx(ebt,{index:ke,id:n,points:it,centroid:He,angle:ct?Ye[0].angle:Ve,length:ct?1:yt,textureType:u,heatmaps:We,color:d,sideColor:f,roofStructure:w,glassTint:v,opacity:T,relativeAngle:ke===0?Z[0].relativeAngle:Z[2].relativeAngle,foundation:e,windows:Me},ke):null}),T>0&&h.jsx(Qxt,{roofSegments:pe,thickness:l,lineColor:g,lineWidth:w===wc.Rafter?.1:y})]}),A&&a>0&&Z[0].lz===Z[2].lz&&ve&&h.jsx(CW,{cz:Z[0].lz,points:ve}),w===wc.Rafter&&Z&&Z.length===4&&h.jsx("group",{onContextMenu:De=>{TR(De,n)},onPointerDown:De=>{l$e(De,n,o)},children:h.jsx($xt,{ridgeLeftPoint:Se,ridgeRightPoint:ze,wallArray:Z,overhang:0,isShed:F,height:l,spacing:b,color:P,width:C})}),R&&!p&&h.jsxs("group",{position:[0,0,l],children:[h.jsx(oh,{position:[Ie.x,Ie.y,Ie.z+.15],onPointerDown:De=>{if(Pe(t.id,De,Oo.Select),X.current=!0,_.current=a,L(!0),pY.set(Ie.x,Ie.y,xe),e){const ke=-Math.atan2(D.position.x-e.cx,D.position.y-e.cy)-e.rotation[2];gY.set(-Gt,0,ke,"ZXY")}N(Lr.Mid),Fn.getState().setEnableOrbitController(!1),x(ke=>{ke.resizeHandleType=vt.Top,ke.selectedElementHeight=xe+t.thickness})},onPointerOver:()=>{x(De=>{De.hoveredHandle=Lr.Mid,De.selectedElementHeight=xe+t.thickness,De.selectedElementX=Ie.x,De.selectedElementY=Ie.y})}}),h.jsx(oh,{position:[Se.x,Se.y,Se.z+.15],onPointerDown:()=>{if(X.current=!0,O.current=s[0],B.current=c[0],L(!0),pY.set(Se.x,Se.y,xe),e&&Z&&Z[3]){const De=new ie().subVectors(Se,D.position).normalize(),ke=Math.atan2(De.z,Math.hypot(De.x,De.y)),Ye=Z[3].relativeAngle;gY.set(-Gt+ke,0,Ye,"ZXY")}N(Lr.Left),Fn.getState().setEnableOrbitController(!1)}}),h.jsx(oh,{position:[ze.x,ze.y,ze.z+.15],onPointerDown:()=>{if(X.current=!0,O.current=s[0],B.current=c[0],L(!0),pY.set(ze.x,ze.y,xe),e&&Z&&Z[1]){const De=new ie().subVectors(ze,D.position).normalize(),ke=Math.atan2(De.z,Math.hypot(De.x,De.y)),Ye=Z[1].relativeAngle;gY.set(-Gt+ke,0,Ye,"ZXY")}N(Lr.Right),Fn.getState().setEnableOrbitController(!1)}})]}),j&&h.jsx(ua,{name:"Roof Intersection Plane",ref:U,args:[1e3,100],visible:!1,position:pY,rotation:gY,onPointerMove:De=>{if(U.current&&X.current&&e&&Z&&Z.length===4){le(De);const ke=E.intersectObjects([U.current]);if(ke[0]){const Ye=ke[0].point;if(Ye.z<.001)return;switch(k){case Lr.Left:{const it=Z[3];if(it){let Ve=q(e,it,Ye);Math.abs(Ve)>=.45&&Math.abs(Ve)<.5&&(Ve=.45*Math.sign(Ve));const yt=[Ve,s[1]],ct=[-Ve,c[1]],Xe=ge(Z,xe,yt,ct);o9(Xe,o)&&$(n,Ve,-Ve)}break}case Lr.Right:{const it=Z[1];if(it){let Ve=q(e,it,Ye);Math.abs(Ve)>=.45&&Math.abs(Ve)<.5&&(Ve=.45*Math.sign(Ve));const yt=[-Ve,s[1]],ct=[Ve,c[1]],Xe=ge(Z,xe,yt,ct);o9(Xe,o)&&$(n,-Ve,Ve)}break}case Lr.Mid:{let it;F?it=Math.max(0,Ye.z-e.lz-.3-he):it=Math.max(-he+.01,Ye.z-e.lz-.3-he);const Ve=he+it,yt=ge(Z,Ve,s,c);o9(yt,o)&&H.getState().updateRoofRiseById(n,it,xe+t.thickness);break}}}}},onPointerUp:()=>{switch(k){case Lr.Mid:{iN(n,_.current,a);break}case Lr.Left:case Lr.Right:Q(n,O.current,B.current,s[0],c[0])}X.current=!1,L(!1),N(Lr.Null),Fn.getState().setEnableOrbitController(!0)},children:h.jsx("meshBasicMaterial",{side:$r,transparent:!0,opacity:.5})})]})},ebt=({index:t,id:e,points:n,centroid:o,angle:r,length:i,textureType:a,heatmaps:l,color:s="white",sideColor:c,relativeAngle:u,foundation:d,roofStructure:f,glassTint:p,opacity:g=.5,windows:y})=>{const w=H.getState().world;H(Gn);const b=H(l3),C=ht(Ss),P=ht(h3),v=H(e5),T=H(i3),A=H(a3),x=Tn(dW),S=Tn.getState().hourlyHeatExchangeArrayMap,R=$H(f===wc.Rafter?Ur.NoTexture:a),{transparent:M,opacity:D}=QH(f===wc.Rafter,g),{invalidate:E}=oi(),W=m.useRef(null),j=m.useRef(null),L=m.useRef(null),k=m.useRef(null),N=m.useRef(0),F=m.useRef(),U=m.useRef(),[O,B]=m.useState(0),[_,X]=m.useState(0),[$,Q]=m.useState(!0),le=(ne,fe)=>ne.clone().setZ(0).distanceTo(fe.clone().setZ(0))>2,q=ne=>Math.abs(ne){if(!P)return;const ne=x(e);if(!ne)return;const fe=[],[ge,de,Z,he,xe]=n,He=xe.z-ge.z,Se=new ie(0,0,He+.1);for(const ze of ne.values()){let Ie=[];Ie.push(ze[0].clone().sub(o).add(Se)),Ie.push(ze[1].clone().sub(o).add(Se)),fe.push(Ie),Ie=[],Ie.push(ze[0].clone().sub(o).add(Se)),Ie.push(ze[3].clone().sub(o).add(Se)),fe.push(Ie),Ie=[],Ie.push(ze[1].clone().sub(o).add(Se)),Ie.push(ze[2].clone().sub(o).add(Se)),fe.push(Ie)}return fe},[P]),re=m.useMemo(()=>{if(!P||d&&d.notBuilding)return;const ne=S.get(e+"-"+t);if(!ne)return;const fe=ne.reduce((Xe,ut)=>Xe+ut,0),ge=x(e);if(!ge||!ge[t])return;const[de,Z,he,xe,He]=n,Se=He.z-de.z,ze=ge[t].map(Xe=>Xe.clone().sub(o).add(new ie(0,0,Se)));if(!ze)return;let Ie=me.getTriangleArea(ze[0],ze[1],ze[2])+me.getTriangleArea(ze[2],ze[3],ze[0]);if(Ie===0)return;let ye=b(z.Window,e);const ce=x(e);if(ce&&ce[t]&&(ye=ye.filter(Xe=>{const ut=Xe,ft=ut.cy+(ut.windowType===Ti.Polygonal&&ut.polygonTop?ut.polygonTop[1]/2:0);return Cn.onSegment(ce[t],Xe.cx,ft)})),ye&&ye.length>0)for(const Xe of ye)Ie-=me.getWindowArea(Xe);const pe=r3*(w.solarRadiationHeatmapGridCellSize??.5),ve=ze[0].clone(),Ae=ze[1].clone(),Te=ze[2].clone(),Me=new ie().subVectors(Ae,ve),Pe=new ie().subVectors(Te,ve),Ee=new ie().subVectors(Te,Ae),Be=Me.length(),Je=new ie().crossVectors(Pe,Ee).length()/Be,We=Math.max(2,Math.round(Be/pe)),Ke=Math.max(2,Math.round(Je/pe));Me.normalize(),Pe.normalize(),Ee.normalize();const Ne=new ie().crossVectors(Pe,Ee).normalize(),De=Me.multiplyScalar(.5*Be/We),ke=new ie().crossVectors(Ne,Me).normalize().multiplyScalar(.5*Je/Ke),Ye=ve.clone().add(De).add(ke);De.multiplyScalar(2),ke.multiplyScalar(2);const it=fe/Ie*(v??Qm);N.current=it<0?1:0,F.current=Ne.clone().multiplyScalar(.1),U.current=me.getEuler(Io,Ne,"YXZ",-Math.sign(it)*Gt);const Ve=[],yt=new ie;let ct;for(let Xe=0;Xe0){const ot=yt.x+o.x,st=yt.y+o.y;for(const at of ye){const Oe=Cn.getRelativeWindowVerticesOnRoof(at),Ze=me.getPoints(Oe);if(me.isPointInside(ot,st,Ze)){ct=!1;break}}}if(ct){const ot=[];it<0?(ot.push(yt.clone()),ot.push(yt.clone().add(Ne.clone().multiplyScalar(-it)))):(ot.push(yt.clone()),ot.push(yt.clone().add(Ne.clone().multiplyScalar(it)))),Ve.push(ot)}}}return Ve},[P,v,o,n]);m.useEffect(()=>{const[ne,fe,ge,de,Z]=n,he=Z.z-ne.z;if(W.current){const xe=W.current.geometry;if(xe){const He=new Float32Array(18),Se=he+.01;He[0]=n[0].x,He[1]=n[0].y,He[2]=n[0].z+Se,He[3]=n[1].x,He[4]=n[1].y,He[5]=n[1].z+Se,He[6]=n[2].x,He[7]=n[2].y,He[8]=n[2].z+Se,He[9]=n[2].x,He[10]=n[2].y,He[11]=n[2].z+Se,He[12]=n[3].x,He[13]=n[3].y,He[14]=n[3].z+Se,He[15]=n[0].x,He[16]=n[0].y,He[17]=n[0].z+Se,xe.setAttribute("position",new gr(He,3)),xe.computeVertexNormals();const ze=[];ze.push(0,0),ze.push(1,0),ze.push(1,1),ze.push(1,1),ze.push(0,1),ze.push(0,0),xe.setAttribute("uv",new gr(ze,2))}}if(j.current){j.current.geometry=new Fce(n,r,i);const xe=le(ne,de)&&le(fe,ge);if(Q(xe),f===wc.Glass&&xe){const He=me.calculatePolygonCentroid(n.map(me.mapVector3ToPoint2)),Se=new ie(He.x,He.y,0),ze=.25,Ie=new ie().addVectors(ne,Se.clone().sub(ne).setZ(0).normalize().multiplyScalar(ze)),ye=new ie().addVectors(fe,Se.clone().sub(fe).setZ(0).normalize().multiplyScalar(ze)),ce=new ie().addVectors(ge,Se.clone().sub(ge).normalize().multiplyScalar(ze)),pe=new ie().addVectors(de,Se.clone().sub(de).normalize().multiplyScalar(ze)),ve=[];ve.push(Ie),ve.push(ye),ve.push(ce.setZ(ye.z)),ve.push(pe.setZ(Ie.z)),ve.push(Ie.clone().setZ(1)),ve.push(ye.clone().setZ(1)),ve.push(ce.clone().setZ(1)),ve.push(pe.clone().setZ(1));const Ae=new is(new Fce(ve)),Te=cc.subtract(j.current,Ae);if(j.current.geometry=Te.geometry,q(u)){const Pe=Ie.distanceTo(ye),Ee=ne.distanceTo(de);B(Pe),X(Ee);const Be=new ie().subVectors(ne,de).angleTo(new ie(0,-1,0));L.current&&(L.current.scale.set(Pe,Ee,1),L.current.rotation.set(Be,0,0)),k.current&&k.current.rotation.set(Be-Gt,0,0)}else{const Pe=ne.distanceTo(de),Ee=Ie.distanceTo(ye);B(Pe),X(Ee);const Be=new ie().subVectors(ne,de).angleTo(new ie(1,0,0));L.current&&(L.current.scale.set(Pe,Ee,1),L.current.rotation.set(0,Be,0)),k.current&&k.current.rotation.set(Gt,Be,0,"YXZ")}const Me=(ne.z+de.z)/2+he*.75;L.current&&L.current.position.set(He.x,He.y,Me),k.current&&k.current.position.set(He.x,He.y,Me)}}E()},[n,r,i,u,$,C,f]);const ae={points:n,angle:r,length:i},se=a===Ur.Default||a===Ur.NoTexture?s:"white";return h.jsxs(h.Fragment,{children:[(D>0&&f===wc.Rafter||f!==wc.Rafter)&&h.jsx(h.Fragment,{children:h.jsx(SOe,{id:e,index:t,segment:ae,color:se,sideColor:c??"white",texture:R,heatmap:l[t],transparent:M,opacity:D,windows:y,centroid:o})}),te&&te.map((ne,fe)=>h.jsx(jn,{points:ne,color:"gray",lineWidth:.5,dashed:!0,dashSize:.2,gapSize:.1,receiveShadow:!1,castShadow:!1,name:"Overhang Boundary "+fe},fe)),re&&re.map((ne,fe)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:ne,name:"Heat Flux "+fe,lineWidth:A??Zm,color:T??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:F.current?ne[N.current].clone().add(F.current):ne[0],args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:U.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:T??g0})})]},fe))]})},tbt=be.memo(Zxt,qH),nbt=be.memo(({roofSegments:t,thickness:e,lineWidth:n,lineColor:o})=>{if(t.length===0)return null;const r=[],i=new ie(0,0,e);for(let u=0;u{const[f,p,g,y]=u.points,w=[f.clone().sub(i),f];return h.jsx(jn,{points:w,lineWidth:n,color:o},d)})]})]})}),b4=new ie,S4=new nn,obt=new ie(0,0,1),rbt=({roofModel:t,foundationModel:e})=>{let{id:n,parentId:o,cx:r,cy:i,lz:a,wallsId:l,leftRidgeLength:s,rightRidgeLength:c,textureType:u,color:d="white",sideColor:f="white",thickness:p=.2,locked:g,lineColor:y="black",lineWidth:w=.2,roofType:b,rise:C=a,ceiling:P=!1}=t;const v=H(Gn),T=H(fn),A=H(yp),x=Fye(l[0],o),S=$H(u),R=Es(n),[M,D]=m.useState(!1),[E,W]=m.useState(Lr.Null),[j,L]=m.useState(s),[k,N]=m.useState(c),{highestWallHeight:F,topZ:U}=kye(x,C);dN(t,F);const O=m.useRef(null),{gl:B,camera:_}=oi(),X=m.useMemo(()=>new l0,[]),$=m.useMemo(()=>new Xt,[]),Q=m.useRef(!1),le=m.useRef(C),q=C<.01;[y,w]=Cn.getWireframetStyle(y,w,R,g),m.useEffect(()=>{L(s)},[s]),m.useEffect(()=>{N(c)},[c]);const te=(Ne,De,ke,Ye=!1)=>{T(it=>{for(const Ve of it.elements)if(Ve.id===Ne&&Ve.type===z.Roof&&Ve.roofType===Go.Hip){Ve.leftRidgeLength=De,Ve.rightRidgeLength=ke,Ye&&(it.updateElementOnRoofFlag=!0);break}})},re=(Ne,De,ke,Ye,it)=>{const Ve={name:"Resize Hip Roof Ridge",timestamp:Date.now(),resizedElementId:Ne,resizedElementType:z.Roof,oldLeftRidgeLength:De,oldRightRidgeLength:ke,newLeftRidgeLength:Ye,newRightRidgeLength:it,undo:()=>{te(Ve.resizedElementId,Ve.oldLeftRidgeLength,Ve.oldRightRidgeLength,!0)},redo:()=>{te(Ve.resizedElementId,Ve.newLeftRidgeLength,Ve.newRightRidgeLength,!0)}};H.getState().addUndoable(Ve)},ae=Ne=>{const De=[];for(const ke of Ne)De.push({x:ke.leftPoint.x,y:ke.leftPoint.y});return De},se=Ne=>{$.x=Ne.offsetX/B.domElement.clientWidth*2-1,$.y=-(Ne.offsetY/B.domElement.clientHeight)*2+1,X.setFromCamera($,_)},ne=(Ne,De,ke,Ye,it)=>{Ne.push(De,ke,Ye),it&&Ne.push(it),Ne.push(De.clone().add(He),ke.clone().add(He),Ye.clone().add(He)),it&&Ne.push(it.clone().add(He))},fe=()=>{if(x===null||x.length!==4)return 0;const Ne=x.map(Ye=>Ye.leftPoint),De=[de,Z,Z,de];let ke=1/0;for(let Ye=0;Ye<4;Ye++){const it=x[Ye],Ve=Cn.getDistance(Ne[Ye],Ne[(Ye+1)%4],De[Ye]),yt=Math.min((it.eavesLength??0)/Ve*(De[Ye].z-it.lz),it.lz),ct=Cn.getDistance(Ne[Ye],Ne[(Ye+1)%4],De[(Ye+1)%4]),Xe=Math.min((it.eavesLength??0)/ct*(De[(Ye+1)%4].z-it.lz),it.lz);ke=Math.min(Math.min(yt,Xe),ke)}return Number.isNaN(ke)?0:ke},ge=m.useMemo(()=>{if(x===null||x.length!==4)return new Xt;const Ne=ae(x),De=me.calculatePolygonCentroid(Ne);return new Xt(De.x,De.y)},[x]),de=m.useMemo(()=>{const Ne=new ie,De=new ie(ge.x,ge.y,U),ke=v(l[0]);return ke&&Ne.setX(-j).applyEuler(new nn(0,0,ke.relativeAngle)).add(De),Ne},[ge,U,j]),Z=m.useMemo(()=>{const Ne=new ie,De=new ie(ge.x,ge.y,U),ke=v(l[0]);return ke&&Ne.setX(k).applyEuler(new nn(0,0,ke.relativeAngle)).add(De),Ne},[ge,U,k]),he=m.useMemo(()=>new ie(ge.x,ge.y,U),[ge,U]),xe=m.useMemo(()=>x===null||x.length!==4?[]:x.map(Ne=>Cn.getComposedWallNormal(Ne).multiplyScalar(Ne.eavesLength)),[x]),He=m.useMemo(()=>obt.clone().multiplyScalar(p),[p]),Se=m.useMemo(()=>x===null||x.length!==4?null:x.map((Ne,De)=>({leftPoint:Ne.leftPoint.clone().add(xe[De]),rightPoint:Ne.rightPoint.clone().add(xe[De])})),[x,xe]),ze=m.useMemo(()=>{const Ne=[];if(x===null||x.length!==4||Se===null)return Ne;const De=fe();for(let ke=0;ke<4;ke++){const Ye=[],it=x[ke],{lh:Ve,rh:yt}=Cn.getComposedWallHeight(x,ke),ct=Cn.getIntersectionPoint(Se[(ke+3)%4].leftPoint,Se[(ke+3)%4].rightPoint,Se[ke].leftPoint,Se[ke].rightPoint).setZ(Ve-De).sub(he),Xe=Cn.getIntersectionPoint(Se[ke].leftPoint,Se[ke].rightPoint,Se[(ke+1)%4].leftPoint,Se[(ke+1)%4].rightPoint).setZ(yt-De).sub(he),ut=new ie().addVectors(it.leftPoint,it.rightPoint).divideScalar(2),ft=de.clone().sub(he),ot=Z.clone().sub(he);let st=0;switch(ke){case 0:st=ut.clone().sub(he.clone().setZ(0)).length(),ne(Ye,ct,Xe,ot,ft);break;case 1:st=ut.clone().sub(Z.clone().setZ(0)).length(),ne(Ye,ct,Xe,ot);break;case 2:st=ut.clone().sub(he.clone().setZ(0)).length(),ne(Ye,ct,Xe,ft,ot);break;case 3:st=ut.clone().sub(de.clone().setZ(0)).length(),ne(Ye,ct,Xe,ft);break}Ne.push({points:Ye,angle:-it.relativeAngle,length:st})}return Ne},[x,de,Z,U,p]),Ie=m.useMemo(()=>!x||x.length!==4?null:x.map(Ne=>Ne.leftPoint),[x]);m.useEffect(()=>{if(x===null||x.length!==4)A(n,!1,!1,!0);else if(H.getState().addedRoofIdSet.has(n)){for(let De=0;De{for(const it of Ye.elements)if(it.type===z.Wall&&ke.has(it.id)){const Ve=it;Ve.roofId=n,Ve.leftRoofHeight=void 0,Ve.rightRoofHeight=void 0}})}H.getState().deleteAddedRoofId(n)}},[x]),Wye(e,n,ze,he,U,p);const ye=()=>{if(!x)return;const Ne=[];for(let De=0;De<4;De++){const ke=x[De],{lh:Ye,rh:it}=Cn.getComposedWallHeight(x,De),Ve=ke.leftPoint.clone().setZ(Ye),yt=ke.rightPoint.clone().setZ(it),ct=de.clone(),Xe=Z.clone();switch(De){case 0:Ne.push([Ve,yt,Xe,ct]);break;case 1:Ne.push([Ve,yt,Xe]);break;case 2:Ne.push([Ve,yt,ct,Xe]);break;case 3:Ne.push([Ve,yt,ct]);break}}if(q){const De=[];for(const ke of Ne)De.push(ke[0].clone());Tn.getState().setRoofSegmentVerticesWithoutOverhang(n,[De])}else Tn.getState().setRoofSegmentVerticesWithoutOverhang(n,Ne)},ce=cN(n,new ie(ge.x,ge.y,U),ze,q,Go.Hip);uN(ye);const pe=H(Ne=>Ne.elements.filter(De=>De.parentId===n&&De.type===z.Window),cy),ve=H(Y0),Ae=ht(Ss),Te=H(Cf),Me=Tn(u1),[Pe,Ee]=m.useState(null),[Be,Je]=m.useState([]);m.useEffect(()=>{if(Ae)if(C>0){const Ne=ze.length;if(Ne>0){const De=[];for(let ke=0;ke0&&e){const Ye=new nn(0,0,e.rotation[2],"ZYX");let it=Number.MAX_VALUE,Ve=Number.MAX_VALUE,yt=-Number.MAX_VALUE,ct=-Number.MAX_VALUE;for(const at of ke)for(const Oe of at){const Ze=Oe.clone().applyEuler(Ye);Ze.x>yt&&(yt=Ze.x),Ze.xct&&(ct=Ze.y),Ze.y{aN(Ne,e.id,n,ze,he)},onPointerMove:Ne=>{sN(Ne,n)},onPointerUp:Ne=>{lN(Ne,t)},onContextMenu:Ne=>{TR(Ne,n)},children:q?h.jsx(HQ,{id:n,foundationModel:e,roofType:b,roofSegments:ze,center:new ie(ge.x,ge.y,U),thickness:p,lineWidth:w,lineColor:y,sideColor:f,color:Ke,textureType:u,heatmap:Pe}):h.jsxs(h.Fragment,{children:[ze.map((Ne,De,ke)=>h.jsx(a$,{id:n,index:De,foundationModel:e,roofType:b,segment:Ne,centroid:he,thickness:p,color:Ke,sideColor:f,texture:S,heatmap:Be&&De0&&Ie&&h.jsx(CW,{cz:x[0].lz,points:Ie}),R&&!g&&h.jsxs("group",{position:[0,0,p+.15],children:[h.jsx(oh,{position:[de.x,de.y,de.z],onPointerDown:()=>{if(Q.current=!0,D(!0),b4.set(de.x,de.y,U),e&&x[0]){const Ne=H.getState().cameraDirection,De=Math.atan2(Ne.z,Ne.y),ke=x[0].relativeAngle;S4.set(-Gt-De,0,ke,"ZXY")}W(Lr.Left),Fn.getState().setEnableOrbitController(!1)}}),h.jsx(oh,{position:[he.x,he.y,he.z],onPointerDown:Ne=>{if(ve(t.id,Ne,Oo.Select),Q.current=!0,le.current=C,D(!0),b4.set(he.x,he.y,U),e){const De=-Math.atan2(_.position.x-r,_.position.y-i)-e.rotation[2];S4.set(-Gt,0,De,"ZXY")}W(Lr.Mid),Fn.getState().setEnableOrbitController(!1),T(De=>{De.resizeHandleType=vt.Top,De.selectedElementHeight=U+t.thickness})},onPointerOver:()=>{T(Ne=>{Ne.hoveredHandle=Lr.Mid,Ne.selectedElementHeight=U+t.thickness,Ne.selectedElementX=ge.x,Ne.selectedElementY=ge.y})}}),h.jsx(oh,{position:[Z.x,Z.y,Z.z],onPointerDown:()=>{if(Q.current=!0,D(!0),b4.set(Z.x,Z.y,U),e&&x[0]){const Ne=H.getState().cameraDirection,De=Math.atan2(Ne.z,Ne.y),ke=x[0].relativeAngle;S4.set(-Gt-De,0,ke,"ZXY")}W(Lr.Right),Fn.getState().setEnableOrbitController(!1)}})]}),M&&h.jsx(ua,{name:"Roof Intersection Plane",ref:O,args:[1e3,100],visible:!1,position:b4,rotation:S4,onPointerMove:Ne=>{if(O.current&&Q.current){se(Ne);const De=X.intersectObjects([O.current]);if(De[0]&&e){const ke=De[0].point;if(ke.z<.001)return;const Ye=x[0],it=new ie().subVectors(Ye.rightPoint,Ye.leftPoint).length();switch(E){case Lr.Left:{const Ve=he.clone().sub(b4).applyEuler(new nn(0,0,-S4.z)),yt=ke.clone().sub(new ie(e.cx,e.cy,e.cz)).applyEuler(new nn(0,0,-e.rotation[2])).sub(b4).applyEuler(new nn(0,0,-S4.z)),ct=new ie().subVectors(yt,Ve).x;L(me.clamp(-ct,-k+.1,it/2-.01));break}case Lr.Right:{const Ve=he.clone().sub(b4).applyEuler(new nn(0,0,-S4.z)),yt=ke.clone().sub(new ie(e.cx,e.cy,e.cz)).applyEuler(new nn(0,0,-e.rotation[2])).sub(b4).applyEuler(new nn(0,0,-S4.z)),ct=new ie().subVectors(yt,Ve).x;N(me.clamp(ct,-j+.1,it/2-.01));break}case Lr.Mid:{const Ve=Math.max(0,ke.z-e.lz-.3-F);H.getState().updateRoofRiseById(n,Ve,U+t.thickness);break}}}}},onPointerUp:()=>{switch(E){case Lr.Mid:{iN(n,le.current,C);break}case Lr.Left:case Lr.Right:te(n,j,k),re(n,s,c,j,k)}Q.current=!1,D(!1),W(Lr.Null),Fn.getState().setEnableOrbitController(!0)},children:h.jsx("meshBasicMaterial",{side:$r,transparent:!0,opacity:.5})})]})},ibt=be.memo(rbt,qH),Rre=new ie,Hre=new nn,abt=new ie(0,0,1),lbt=be.memo(({roofSegments:t,thickness:e,lineWidth:n,lineColor:o})=>{const r=m.useMemo(()=>t.reduce((s,c)=>s.concat(c.points[1]),[t[0].points[0]]),[t]),i=m.useMemo(()=>t.reduce((s,c)=>s.concat(c.points[6].clone()),[t[0].points[7].clone()]),[t]),a=m.useMemo(()=>h.jsx(jn,{points:r,lineWidth:n,color:o}),[r,n,o]);if(t.length<2)return null;const l=Math.abs(t[0].points[0].z-t[0].points[3].z)<.1;return h.jsxs(h.Fragment,{children:[!l&&h.jsx(jn,{points:i,lineWidth:n,color:o}),a,h.jsx("group",{position:[0,0,e],children:a}),t.map((s,c)=>h.jsxs(be.Fragment,{children:[!l&&h.jsx(jn,{points:[s.points[7],s.points[4]],lineWidth:n,color:o}),h.jsx(jn,{points:[s.points[4],s.points[0]],lineWidth:n,color:o})]},c))]})}),sbt=({roofModel:t,foundationModel:e})=>{let{id:n,wallsId:o,cx:r,cy:i,lz:a,textureType:l,color:s="white",sideColor:c="white",thickness:u=.2,locked:d,lineColor:f="black",lineWidth:p=.2,roofType:g,foundationId:y,ridgeWidth:w=1,rise:b=a,ceiling:C=!1,frontRidge:P,backRidge:v}=t;const T=$H(l),A=Es(n);[f,p]=Cn.getWireframetStyle(f,p,A,d);const x=H(fn),S=H(yp),R=H(Ds),M=H(gt=>gt.ray),D=H(gt=>gt.mouse),[E,W]=m.useState(w),[j,L]=m.useState(null),[k,N]=m.useState(!1),[F,U]=m.useState(Lr.Null),[O,B]=m.useState(null),_=m.useRef(E),X=m.useRef(b),$=m.useRef(null),Q=m.useRef(!1),{gl:le,camera:q}=oi(),te=b<.01,re=gt=>{const dt=[],Ct=gt.length;for(const tt of gt)tt.leftPoint[0]!==void 0&&tt.leftPoint[1]!==void 0&&dt.push({x:tt.leftPoint[0],y:tt.leftPoint[1]});return Z.current||(gt[Ct-1].rightPoint[0]||gt[Ct-1].rightPoint[0]===0)&&(gt[Ct-1].rightPoint[1]||gt[Ct-1].rightPoint[1]===0)&&dt.push({x:gt[Ct-1].rightPoint[0],y:gt[Ct-1].rightPoint[1]}),dt},ae=gt=>{if(gt{D.x=gt.offsetX/le.domElement.clientWidth*2-1,D.y=-(gt.offsetY/le.domElement.clientHeight)*2+1,M.setFromCamera(D,q)},ne=(gt,dt)=>{x(Ct=>{for(const tt of Ct.elements)if(tt.id===gt&&tt.type===z.Roof&&tt.roofType===Go.Mansard){tt.ridgeWidth=dt;break}})},fe=()=>{let gt=1/0;for(let dt=0;dt{const Fe={name:"Resize Mansard Roof Ridge",timestamp:Date.now(),resizedElementId:gt,resizedElementType:z.Roof,oldVal:Ct,newVal:tt,type:dt,undo:()=>{ne(Fe.resizedElementId,Fe.oldVal)},redo:()=>{ne(Fe.resizedElementId,Fe.newVal)}};H.getState().addUndoable(Fe)},{currentWallArray:de,isLoopRef:Z}=u$e(y,n,o),{highestWallHeight:he,topZ:xe}=d$e(de,b);dN(t,he);const He=m.useMemo(()=>{if(de.length<2)return new ie;const gt=re(de),dt=me.calculatePolygonCentroid(gt);return Number.isNaN(dt.x)||Number.isNaN(dt.y)?new ie:new ie(dt.x,dt.y,xe)},[de,xe]),Se=m.useMemo(()=>{const gt=de.map(dt=>Cn.getWallNormal(dt).multiplyScalar(dt.eavesLength??0));if(!Z.current&>.length!==0){const dt=new ie().subVectors(new ie(de[de.length-1].rightPoint[0],de[de.length-1].rightPoint[1]),new ie(de[0].leftPoint[0],de[0].leftPoint[1])).applyEuler(mG).normalize().multiplyScalar(.3);gt.push(dt)}return gt},[de]),ze=m.useMemo(()=>{const gt=de.map((dt,Ct)=>({leftPoint:new ie(dt.leftPoint[0],dt.leftPoint[1]).add(Se[Ct]),rightPoint:new ie(dt.rightPoint[0],dt.rightPoint[1]).add(Se[Ct])}));return!Z.current&>.length!==0&>.push({leftPoint:new ie(de[de.length-1].rightPoint[0],de[de.length-1].rightPoint[1]).add(Se[Se.length-1]),rightPoint:new ie(de[0].leftPoint[0],de[0].leftPoint[1]).add(Se[Se.length-1])}),gt},[de,Se]),Ie=m.useMemo(()=>{const gt=de.map((dt,Ct)=>{const tt=new ie(dt.leftPoint[0],dt.leftPoint[1]),Fe=new ie(dt.rightPoint[0],dt.rightPoint[1]),qe=new ie().subVectors(He,tt).setZ(0).normalize().multiplyScalar(E),je=new ie().subVectors(He,Fe).setZ(0).normalize().multiplyScalar(E);return tt.add(qe).setZ(xe),Fe.add(je).setZ(xe),{leftPoint:tt,rightPoint:Fe}});return!Z.current&>.length!==0&>.push({leftPoint:gt[gt.length-1].rightPoint,rightPoint:gt[0].leftPoint}),gt},[de,He,E]),ye=m.useMemo(()=>abt.clone().multiplyScalar(u),[u]),ce=m.useMemo(()=>{const gt=[];if(de.length<2)return gt;const dt=fe();for(let Ct=0;Ct0&&tt.rightPoint.length>0&&(tt.leftPoint[0]!==tt.rightPoint[0]||tt.leftPoint[1]!==tt.rightPoint[1])){const Fe=[];let{lh:qe,rh:je}=Cn.getWallHeight(de,Ct);Z.current||(Ct===0&&(qe=de[0].lz),Ct===de.length-1&&(je=de[de.length-1].lz));const rt=Cn.getIntersectionPoint(ze[(Ct+ze.length-1)%ze.length].leftPoint,ze[(Ct+ze.length-1)%ze.length].rightPoint,ze[Ct].leftPoint,ze[Ct].rightPoint).setZ(qe-dt).sub(He),mt=Cn.getIntersectionPoint(ze[Ct].leftPoint,ze[Ct].rightPoint,ze[(Ct+1)%ze.length].leftPoint,ze[(Ct+1)%ze.length].rightPoint).setZ(je-dt).sub(He),Qe=Ie[Ct].leftPoint.clone().sub(He),Tt=Ie[Ct].rightPoint.clone().sub(He),Dt=new ie(tt.cx,tt.cy).sub(He.clone().setZ(0)).length();Fe.push(rt,mt,Tt,Qe),Fe.push(rt.clone().add(ye),mt.clone().add(ye),Tt.clone().add(ye),Qe.clone().add(ye)),gt.push({points:Fe,angle:-tt.relativeAngle,length:Dt})}}if(!Z.current){const Ct=ze.length-1,tt=Cn.getIntersectionPoint(ze[Ct-1].leftPoint,ze[Ct-1].rightPoint,ze[Ct].leftPoint,ze[Ct].rightPoint).setZ(de[de.length-1].lz-dt).sub(He),Fe=Cn.getIntersectionPoint(ze[Ct].leftPoint,ze[Ct].rightPoint,ze[0].leftPoint,ze[0].rightPoint).setZ(de[0].lz-dt).sub(He),qe=Ie[Ct].leftPoint.clone().sub(He),je=Ie[Ct].rightPoint.clone().sub(He);let rt=Math.atan2(Fe.y-tt.y,Fe.x-tt.x);rt=rt>=0?rt:(la+rt)%la;const mt=new ie().addVectors(tt,Fe).setZ(0).divideScalar(2).length(),Qe=[];Qe.push(tt,Fe,je,qe),Qe.push(tt.clone().add(ye),Fe.clone().add(ye),je.clone().add(ye),qe.clone().add(ye)),gt.push({points:Qe,angle:-rt,length:mt})}return gt},[de,xe,E,u]),pe=m.useMemo(()=>{const gt=new Fl;if(Ie.length>0){const dt=Ie[0].leftPoint.clone().sub(He);gt.moveTo(dt.x,dt.y);for(const Ct of Ie){const tt=Ct.rightPoint.clone().sub(He);gt.lineTo(tt.x,tt.y)}gt.closePath()}return gt},[de,Ie]),ve=m.useMemo(()=>{const gt=[];if(de.length===0)return gt;gt.push(new ie().fromArray(de[0].leftPoint));for(const dt of de)gt.push(new ie().fromArray(dt.rightPoint));return gt},[de]);m.useEffect(()=>{w!==E&&W(w)},[w]),m.useEffect(()=>{if(de.length>1){if(H.getState().addedRoofIdSet.has(n)){for(let gt=0;gt{for(const Ct of dt.elements)if(Ct.id===de[gt].id&&Ct.type===z.Wall){const tt=Ct;tt.roofId=n,tt.leftRoofHeight=void 0,tt.rightRoofHeight=void 0;break}});H.getState().deleteAddedRoofId(n)}}else S(n,!1,!1,!0)},[de]),Wye(e,n,ce,He,xe,u),m.useEffect(()=>{(P!==void 0||v!==void 0)&&x(gt=>{for(const dt of gt.elements)if(dt.type===z.Wall){const Ct=dt;Ct.roofId===n&&(Ct.centerLeftRoofHeight=void 0,Ct.centerRightRoofHeight=void 0)}else dt.type===z.Roof&&dt.roofType===Go.Mansard&&dt.id===n&&(dt.frontRidge=void 0,dt.backRidge=void 0)})},[]);const Ae=()=>{const gt=[];for(let Ct=0;Ct0&&tt.rightPoint.length>0&&(tt.leftPoint[0]!==tt.rightPoint[0]||tt.leftPoint[1]!==tt.rightPoint[1])){let{lh:Fe,rh:qe}=Cn.getWallHeight(de,Ct);Z.current||(Ct===0&&(Fe=de[0].lz),Ct===de.length-1&&(qe=de[de.length-1].lz));const je=new ie(tt.leftPoint[0],tt.leftPoint[1],Fe),rt=new ie(tt.rightPoint[0],tt.rightPoint[1],qe),mt=Ie[Ct].leftPoint.clone(),Qe=Ie[Ct].rightPoint.clone();gt.push([je,rt,Qe,mt])}}if(!Z.current){const Ct=de.length-1,tt=de[0],Fe=de[Ct],qe=new ie(Fe.rightPoint[0],Fe.rightPoint[1],Fe.lz),je=new ie(tt.leftPoint[0],tt.leftPoint[1],tt.lz),rt=Ie[Ct].leftPoint.clone(),mt=Ie[Ct].rightPoint.clone();gt.push([qe,je,mt,rt])}const dt=Ie.map(Ct=>Ct.leftPoint.clone());if(gt.push(dt),te){const Ct=[];for(const tt of gt.slice(0,-1))Ct.push(tt[0].clone());Tn.getState().setRoofSegmentVerticesWithoutOverhang(n,[Ct])}else Tn.getState().setRoofSegmentVerticesWithoutOverhang(n,gt)},Te=cN(n,He,ce,te,Go.Mansard,Ie.map(gt=>gt.leftPoint.clone().add(ye)));uN(Ae);const Me=H.getState().world,Pe=H(Y0),Ee=ht(Ss),Be=H(Cf),Je=Tn(u1),[We,Ke]=m.useState([]),[Ne,De]=m.useState(null),[ke,Ye]=m.useState(!1),it=ht(h3),Ve=H(e5),yt=H(i3),ct=H(a3),Xe=Tn(dW),ut=Tn.getState().hourlyHeatExchangeArrayMap,ft=m.useRef(null),ot=m.useRef(0),st=m.useRef(),at=m.useRef(),{transparent:Oe,opacity:Ze}=QH();m.useEffect(()=>{if(Ee)if(te){const gt=Je(n);if(gt){const dt=me.fetchHeatmapTexture(gt,Be??5);if(dt){const Ct=Te();if(Ct&&Ct.length>0&&e){const tt=new nn(0,0,e.rotation[2],"ZYX");let Fe=Number.MAX_VALUE,qe=Number.MAX_VALUE,je=-Number.MAX_VALUE,rt=-Number.MAX_VALUE;for(const zt of Ct)for(const Ft of zt){const _t=Ft.clone().applyEuler(tt);_t.x>je&&(je=_t.x),_t.xrt&&(rt=_t.y),_t.y{if(ft.current){const gt=pe.extractPoints(1).shape,dt=.01,Ct=ft.current.geometry,tt=gt.length-1;if(tt===4){const Fe=new Float32Array(18);Fe[0]=gt[3].x,Fe[1]=gt[3].y,Fe[2]=dt,Fe[3]=gt[0].x,Fe[4]=gt[0].y,Fe[5]=dt,Fe[6]=gt[2].x,Fe[7]=gt[2].y,Fe[8]=dt,Fe[9]=gt[2].x,Fe[10]=gt[2].y,Fe[11]=dt,Fe[12]=gt[0].x,Fe[13]=gt[0].y,Fe[14]=dt,Fe[15]=gt[1].x,Fe[16]=gt[1].y,Fe[17]=dt,Ct.setAttribute("position",new gr(Fe,3)),Ct.computeVertexNormals();const qe=Ee?1:6,je=[];je.push(0,0),je.push(qe,0),je.push(0,qe),je.push(0,qe),je.push(qe,0),je.push(qe,qe),Ct.setAttribute("uv",new gr(je,2))}else{const Fe=ft.current.geometry,qe=new Float32Array(tt*9),je=Ee?1:6,rt=[];let mt=Number.MAX_VALUE,Qe=Number.MAX_VALUE,Tt=-Number.MAX_VALUE,Dt=-Number.MAX_VALUE;for(const Ft of gt)Ft.x>Tt?Tt=Ft.x:Ft.xDt?Dt=Ft.y:Ft.y{if(!it||e&&e.notBuilding)return;const gt=ut.get(n+"-"+ce.length);if(!gt)return;const dt=gt.reduce((So,$o)=>So+$o,0),Ct=Xe(n);if(!Ct||!Ct[ce.length])return;const tt=Ct[ce.length].map(So=>So.clone().sub(He).add(new ie(0,0,He.z+u)));if(!tt)return;const Fe=r3*(Me.solarRadiationHeatmapGridCellSize??.5),qe=tt[0].clone(),je=tt[1].clone(),rt=tt[2].clone(),mt=new ie().subVectors(je,qe),Qe=new ie().subVectors(rt,qe),Tt=new ie().subVectors(rt,je),Dt=mt.length(),lt=new ie().crossVectors(Qe,Tt).length()/Dt,zt=Math.max(2,Math.floor(Dt/Fe)),Ft=Math.max(2,Math.floor(lt/Fe));mt.normalize(),Qe.normalize(),Tt.normalize();const _t=new ie().crossVectors(Qe,Tt).normalize(),tn=mt.multiplyScalar(.5*Dt/zt),Qt=new ie().crossVectors(_t,mt).normalize().multiplyScalar(.5*lt/Ft),gn=qe.clone().add(tn).add(Qt).add(new ie(0,0,u));tn.multiplyScalar(2),Qt.multiplyScalar(2),st.current=_t.clone().multiplyScalar(.1);const an=[],mn=new ie,Hn=new Array;for(const So of tt)Hn.push({x:So.x,y:So.y});const Fo=me.getPolygonArea(Hn);if(Fo===0)return;const yo=dt/Fo*(Ve??Qm);ot.current=yo<0?1:0,at.current=new nn(-Math.sign(yo)*Gt,0,0);for(let So=0;Sogt.elements.filter(dt=>dt.parentId===n&&dt.type===z.Window),cy),Ht=m.useMemo(()=>Ut.map(gt=>{const dt=new ie(gt.lx,gt.lz,gt.ly*2),Ct=new ie(gt.cx,gt.cy,gt.cz).sub(He),tt=new nn().fromArray([gt.rotation[0],gt.rotation[1],gt.rotation[2],"ZXY"]),Fe=new is(new t3(dt.x,dt.y,dt.z));return Fe.position.copy(Ct),Fe.rotation.copy(tt),Fe.updateMatrix(),Fe}),[Ut,He]),At=l===Ur.NoTexture&&s&&s===c,kt=R&&!Oe;return h.jsxs("group",{name:`Mansard Roof Group ${n}`,children:[h.jsx("group",{name:`Mansard Roof Segments Group ${n}`,position:[He.x,He.y,He.z],userData:Pt,onPointerDown:gt=>{aN(gt,e.id,n,ce,He)},onPointerMove:gt=>{sN(gt,n)},onPointerUp:gt=>{lN(gt,t)},onContextMenu:gt=>{TR(gt,n)},children:te?h.jsx(HQ,{id:n,foundationModel:e,roofType:g,roofSegments:ce,center:new ie(He.x,He.y,xe),thickness:u,lineWidth:p,lineColor:f,sideColor:c,color:Rt,textureType:l,heatmap:Ne}):h.jsxs(h.Fragment,{children:[ce.map((gt,dt,Ct)=>h.jsx(a$,{id:n,index:dt,foundationModel:e,roofType:g,segment:gt,centroid:He,thickness:u,color:Rt,sideColor:c,texture:T,heatmap:We&&dt0&&h.jsx(lbt,{roofSegments:ce,thickness:u,lineColor:f,lineWidth:p})]})}),C&&b>0&&h.jsx(CW,{points:ve,cz:de[0].lz}),A&&!d&&h.jsxs("group",{position:[He.x,He.y,He.z+u],children:[h.jsx(oh,{position:[0,0,.3],onPointerDown:gt=>{if(Pe(t.id,gt,Oo.Select),Q.current=!0,X.current=b,N(!0),Rre.set(He.x,He.y,xe),e){const dt=-Math.atan2(q.position.x-r,q.position.y-i)-e.rotation[2];Hre.set(-Gt,0,dt,"ZXY")}U(Lr.Top),Fn.getState().setEnableOrbitController(!1),x(dt=>{dt.resizeHandleType=vt.Top,dt.selectedElementHeight=xe+t.thickness})},onPointerOver:()=>{x(gt=>{gt.hoveredHandle=Lr.Top,gt.selectedElementHeight=xe+t.thickness,gt.selectedElementX=He.x,gt.selectedElementY=He.y})}}),Ie.map((gt,dt)=>{const Ct=gt.leftPoint.clone().sub(He);return h.jsx(oh,{position:[Ct.x,Ct.y,0],onPointerDown:()=>{Q.current=!0,N(!0),Rre.set(Ct.x,Ct.y,xe+.15),Hre.set(0,0,0),U(Lr.Ridge),B(dt),L(de.reduce((tt,Fe)=>Math.min(tt,new ie(Fe.leftPoint[0],Fe.leftPoint[1],xe).distanceTo(He)-1),1/0)),Fn.getState().setEnableOrbitController(!1),_.current=E}},dt)})]}),k&&h.jsx(ua,{name:"Roof Intersection Plane",ref:$,args:[1e3,100],visible:!1,position:Rre,rotation:Hre,onPointerMove:gt=>{if($.current&&Q.current){se(gt);const dt=M.intersectObjects([$.current]);if(dt[0]&&e){const Ct=dt[0].point;if(Ct.z<.001)return;switch(F){case Lr.Top:{const tt=Math.max(0,Ct.z-e.lz-.6-he);H.getState().updateRoofRiseById(n,tt,xe+t.thickness);break}case Lr.Ridge:{if(e&&O!==null){const tt=Ct.clone().applyEuler(new nn(0,0,e.rotation[2])).sub(new ie(e.cx,e.cy)).setZ(0),Fe=ae(O),qe=tt.distanceTo(Fe),je=new ie().subVectors(He.clone().setZ(0),Fe);tt.clone().sub(Fe).angleTo(je){switch(F){case Lr.Top:{iN(n,X.current,b);break}case Lr.Ridge:{ge(n,F,_.current,E);break}}x(gt=>{for(const dt of gt.elements)if(dt.id===n&&dt.type===z.Roof&&dt.roofType===Go.Mansard){dt.ridgeWidth=E;break}}),Q.current=!1,N(!1),U(Lr.Null),B(null),Fn.getState().setEnableOrbitController(!0)},children:h.jsx("meshBasicMaterial",{side:$r,transparent:!0,opacity:.5})}),St&&St.map((gt,dt)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:gt,name:"Heat Flux "+dt,lineWidth:ct??Zm,color:yt??g0}),";",h.jsx(Rd,{userData:{unintersectable:!0},position:st.current?gt[ot.current].clone().add(st.current):gt[0],args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:at.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:yt??g0})})]},dt))]})},cbt=be.memo(sbt,qH);var TOe={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames @@ -4318,21 +4318,21 @@ 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 Xge=Symbol.for("react.element"),Jge=Symbol.for("react.portal"),l$=Symbol.for("react.fragment"),s$=Symbol.for("react.strict_mode"),c$=Symbol.for("react.profiler"),u$=Symbol.for("react.provider"),d$=Symbol.for("react.context"),dbt=Symbol.for("react.server_context"),f$=Symbol.for("react.forward_ref"),h$=Symbol.for("react.suspense"),p$=Symbol.for("react.suspense_list"),g$=Symbol.for("react.memo"),m$=Symbol.for("react.lazy"),fbt=Symbol.for("react.offscreen"),COe;COe=Symbol.for("react.module.reference");function uy(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Xge:switch(t=t.type,t){case l$:case c$:case s$:case h$:case p$:return t;default:switch(t=t&&t.$$typeof,t){case dbt:case d$:case f$:case m$:case g$:case u$:return t;default:return e}}case Jge:return e}}}hs.ContextConsumer=d$;hs.ContextProvider=u$;hs.Element=Xge;hs.ForwardRef=f$;hs.Fragment=l$;hs.Lazy=m$;hs.Memo=g$;hs.Portal=Jge;hs.Profiler=c$;hs.StrictMode=s$;hs.Suspense=h$;hs.SuspenseList=p$;hs.isAsyncMode=function(){return!1};hs.isConcurrentMode=function(){return!1};hs.isContextConsumer=function(t){return uy(t)===d$};hs.isContextProvider=function(t){return uy(t)===u$};hs.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Xge};hs.isForwardRef=function(t){return uy(t)===f$};hs.isFragment=function(t){return uy(t)===l$};hs.isLazy=function(t){return uy(t)===m$};hs.isMemo=function(t){return uy(t)===g$};hs.isPortal=function(t){return uy(t)===Jge};hs.isProfiler=function(t){return uy(t)===c$};hs.isStrictMode=function(t){return uy(t)===s$};hs.isSuspense=function(t){return uy(t)===h$};hs.isSuspenseList=function(t){return uy(t)===p$};hs.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===l$||t===c$||t===s$||t===h$||t===p$||t===fbt||typeof t=="object"&&t!==null&&(t.$$typeof===m$||t.$$typeof===g$||t.$$typeof===u$||t.$$typeof===d$||t.$$typeof===f$||t.$$typeof===COe||t.getModuleId!==void 0)};hs.typeOf=uy;POe.exports=hs;var ROe=POe.exports;function ow(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[];return be.Children.forEach(t,function(o){o==null&&!e.keepEmpty||(Array.isArray(o)?n=n.concat(ow(o)):ROe.isFragment(o)&&o.props?n=n.concat(ow(o.props.children,e)):n.push(o))}),n}var qce={},hbt=function(e){};function pbt(t,e){}function gbt(t,e){}function mbt(){qce={}}function HOe(t,e,n){!e&&!qce[n]&&(t(!1,n),qce[n]=!0)}function j0(t,e){HOe(pbt,t,e)}function MOe(t,e){HOe(gbt,t,e)}j0.preMessage=hbt;j0.resetWarned=mbt;j0.noteOnce=MOe;function hi(t){"@babel/helpers - typeof";return hi=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},hi(t)}function ybt(t,e){if(hi(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(hi(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function IOe(t){var e=ybt(t,"string");return hi(e)==="symbol"?e:String(e)}function Vt(t,e,n){return e=IOe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rwe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function qt(t){for(var e=1;e0},t.prototype.connect_=function(){!Qce||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Tbt?(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)},t.prototype.disconnect_=function(){!Qce||!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)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,o=n===void 0?"":n,r=Sbt.some(function(i){return!!~o.indexOf(i)});r&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),DOe=function(t,e){for(var n=0,o=Object.keys(e);n"u"||!(Element instanceof Object))){if(!(e instanceof cR(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new Ebt(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.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 cR(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(o){return new Fbt(o.target,o.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),FOe=typeof WeakMap<"u"?new WeakMap:new zOe,kOe=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Pbt.getInstance(),o=new kbt(e,n,this);FOe.set(this,o)}return t}();["observe","unobserve","disconnect"].forEach(function(t){kOe.prototype[t]=function(){var e;return(e=FOe.get(this))[t].apply(e,arguments)}});var Lbt=function(){return typeof xG.ResizeObserver<"u"?xG.ResizeObserver:kOe}(),g8=new Map;function Wbt(t){t.forEach(function(e){var n,o=e.target;(n=g8.get(o))===null||n===void 0||n.forEach(function(r){return r(o)})})}var LOe=new Lbt(Wbt);function Nbt(t,e){g8.has(t)||(g8.set(t,new Set),LOe.observe(t)),g8.get(t).add(e)}function Ubt(t,e){g8.has(t)&&(g8.get(t).delete(e),g8.get(t).size||(LOe.unobserve(t),g8.delete(t)))}function Ap(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mwe(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Pl(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Bbt(t,e){if(e&&(hi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pl(t)}function HW(t){var e=jbt();return function(){var o=SG(t),r;if(e){var i=SG(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return Bbt(this,r)}}var Ybt=function(t){RW(n,t);var e=HW(n);function n(){return Ap(this,n),e.apply(this,arguments)}return wp(n,[{key:"render",value:function(){return this.props.children}}]),n}(m.Component);function Obt(t,e){var n=t.children,o=t.disabled,r=m.useRef(null),i=m.useRef(null),a=m.useContext($ce),l=typeof n=="function",s=l?n(r):n,c=m.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!l&&m.isValidElement(s)&&rw(s),d=u?s.ref:null,f=Fw(d,r),p=function(){var b;return yE(r.current)||(r.current&&hi(r.current)==="object"?yE((b=r.current)===null||b===void 0?void 0:b.nativeElement):null)||yE(i.current)};m.useImperativeHandle(e,function(){return p()});var g=m.useRef(t);g.current=t;var y=m.useCallback(function(w){var b=g.current,C=b.onResize,P=b.data,v=w.getBoundingClientRect(),T=v.width,A=v.height,x=w.offsetWidth,S=w.offsetHeight,R=Math.floor(T),M=Math.floor(A);if(c.current.width!==R||c.current.height!==M||c.current.offsetWidth!==x||c.current.offsetHeight!==S){var D={width:R,height:M,offsetWidth:x,offsetHeight:S};c.current=D;var E=x===Math.round(T)?T:x,W=S===Math.round(A)?A:S,j=qt(qt({},D),{},{offsetWidth:E,offsetHeight:W});a==null||a(j,w,P),C&&Promise.resolve().then(function(){C(j,w)})}},[]);return m.useEffect(function(){var w=p();return w&&!o&&Nbt(w,y),function(){return Ubt(w,y)}},[r.current,o]),m.createElement(Ybt,{ref:i},u?m.cloneElement(s,{ref:f}):s)}var _bt=m.forwardRef(Obt),Vbt="rc-observer-key";function Gbt(t,e){var n=t.children,o=typeof n=="function"?[n]:ow(n);return o.map(function(r,i){var a=(r==null?void 0:r.key)||"".concat(Vbt,"-").concat(i);return m.createElement(_bt,ho({},t,{key:a,ref:i===0?e:void 0}),r)})}var Td=m.forwardRef(Gbt);Td.Collection=Abt;function zg(t){"@babel/helpers - typeof";return zg=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},zg(t)}function Xbt(t,e){if(zg(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(zg(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jbt(t){var e=Xbt(t,"string");return zg(e)==="symbol"?e:String(e)}function Kbt(t,e,n){return e=Jbt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Iwe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function uR(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:1;zwe+=1;var o=zwe;function r(i){if(i===0)UOe(o),e();else{var a=WOe(function(){r(i-1)});Kge.set(o,a)}}return r(n),o};Dg.cancel=function(t){var e=Kge.get(t);return UOe(t),NOe(e)};function jOe(t){if(Array.isArray(t))return t}function eSt(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var o,r,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;s=!1}else for(;!(s=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);s=!0);}catch(u){c=!0,r=u}finally{try{if(!s&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}function t0e(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n=4;++o,r-=4)n=t.charCodeAt(o)&255|(t.charCodeAt(++o)&255)<<8|(t.charCodeAt(++o)&255)<<16|(t.charCodeAt(++o)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(t.charCodeAt(o+2)&255)<<16;case 2:e^=(t.charCodeAt(o+1)&255)<<8;case 1:e^=t.charCodeAt(o)&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)}function dp(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function n0e(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}var Dwe="data-rc-order",Ewe="data-rc-priority",oSt="rc-util-key",o0e=new Map;function OOe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):oSt}function A$(t){if(t.attachTo)return t.attachTo;var e=document.querySelector("head");return e||document.body}function rSt(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function _Oe(t){return Array.from((o0e.get(t)||t).children).filter(function(e){return e.tagName==="STYLE"})}function VOe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!dp())return null;var n=e.csp,o=e.prepend,r=e.priority,i=r===void 0?0:r,a=rSt(o),l=a==="prependQueue",s=document.createElement("style");s.setAttribute(Dwe,a),l&&i&&s.setAttribute(Ewe,"".concat(i)),n!=null&&n.nonce&&(s.nonce=n==null?void 0:n.nonce),s.innerHTML=t;var c=A$(e),u=c.firstChild;if(o){if(l){var d=_Oe(c).filter(function(f){if(!["prepend","prependQueue"].includes(f.getAttribute(Dwe)))return!1;var p=Number(f.getAttribute(Ewe)||0);return i>=p});if(d.length)return c.insertBefore(s,d[d.length-1].nextSibling),s}c.insertBefore(s,u)}else c.appendChild(s);return s}function GOe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=A$(e);return _Oe(n).find(function(o){return o.getAttribute(OOe(e))===t})}function TG(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=GOe(t,e);if(n){var o=A$(e);o.removeChild(n)}}function iSt(t,e){var n=o0e.get(t);if(!n||!n0e(document,n)){var o=VOe("",e),r=o.parentNode;o0e.set(t,r),t.removeChild(o)}}function dx(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=A$(n);iSt(o,n);var r=GOe(e,n);if(r){var i,a;if((i=n.csp)!==null&&i!==void 0&&i.nonce&&r.nonce!==((a=n.csp)===null||a===void 0?void 0:a.nonce)){var l;r.nonce=(l=n.csp)===null||l===void 0?void 0:l.nonce}return r.innerHTML!==t&&(r.innerHTML=t),r}var s=VOe(t,n);return s.setAttribute(OOe(n),e),s}function aSt(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function ii(t,e){if(t==null)return{};var n=aSt(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function iw(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=new Set;function r(i,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,s=o.has(i);if(j0(!s,"Warning: There may be circular references"),s)return!1;if(i===a)return!0;if(n&&l>1)return!1;o.add(i);var c=l+1;if(Array.isArray(i)){if(!Array.isArray(a)||i.length!==a.length)return!1;for(var u=0;u1&&arguments[1]!==void 0?arguments[1]:!1,a={map:this.cache};return n.forEach(function(l){if(!a)a=void 0;else{var s;a=(s=a)===null||s===void 0||(s=s.map)===null||s===void 0?void 0:s.get(l)}}),(o=a)!==null&&o!==void 0&&o.value&&i&&(a.value[1]=this.cacheCallTimes++),(r=a)===null||r===void 0?void 0:r.value}},{key:"get",value:function(n){var o;return(o=this.internalGet(n,!0))===null||o===void 0?void 0:o[0]}},{key:"has",value:function(n){return!!this.internalGet(n)}},{key:"set",value:function(n,o){var r=this;if(!this.has(n)){if(this.size()+1>t.MAX_CACHE_SIZE+t.MAX_CACHE_OFFSET){var i=this.keys.reduce(function(c,u){var d=ln(c,2),f=d[1];return r.internalGet(u)[1]0,void 0),Fwe+=1}return wp(t,[{key:"getDerivativeToken",value:function(n){return this.derivatives.reduce(function(o,r){return r(n,o)},void 0)}}]),t}(),Mre=new $ge;function i0e(t){var e=Array.isArray(t)?t:[t];return Mre.has(e)||Mre.set(e,new XOe(e)),Mre.get(e)}var dSt=new WeakMap,Ire={};function fSt(t,e){for(var n=dSt,o=0;o1&&arguments[1]!==void 0?arguments[1]:!1,n=kwe.get(t)||"";return n||(Object.keys(t).forEach(function(o){var r=t[o];n+=o,r instanceof XOe?n+=r.id:r&&hi(r)==="object"?n+=AE(r,e):n+=r}),e&&(n=KF(n)),kwe.set(t,n)),n}function Lwe(t,e){return KF("".concat(e,"_").concat(AE(t,!0)))}var a0e=dp();function Nt(t){return typeof t=="number"?"".concat(t,"px"):t}function PG(t,e,n){var o,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(i)return t;var a=qt(qt({},r),{},(o={},Vt(o,dR,e),Vt(o,E2,n),o)),l=Object.keys(a).map(function(s){var c=a[s];return c?"".concat(s,'="').concat(c,'"'):null}).filter(function(s){return s}).join(" ");return"")}var JOe=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(n?"".concat(n,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},hSt=function(e,n,o){return Object.keys(e).length?".".concat(n).concat(o!=null&&o.scope?".".concat(o.scope):"","{").concat(Object.entries(e).map(function(r){var i=ln(r,2),a=i[0],l=i[1];return"".concat(a,":").concat(l,";")}).join(""),"}"):""},KOe=function(e,n,o){var r={},i={};return Object.entries(e).forEach(function(a){var l,s,c=ln(a,2),u=c[0],d=c[1];if(o!=null&&(l=o.preserve)!==null&&l!==void 0&&l[u])i[u]=d;else if((typeof d=="string"||typeof d=="number")&&!(o!=null&&(s=o.ignore)!==null&&s!==void 0&&s[u])){var f,p=JOe(u,o==null?void 0:o.prefix);r[p]=typeof d=="number"&&!(o!=null&&(f=o.unitless)!==null&&f!==void 0&&f[u])?"".concat(d,"px"):String(d),i[u]="var(".concat(p,")")}}),[i,hSt(r,n,{scope:o==null?void 0:o.scope})]},Wwe=dp()?m.useLayoutEffect:m.useEffect,Xa=function(e,n){var o=m.useRef(!0);Wwe(function(){return e(o.current)},n),Wwe(function(){return o.current=!1,function(){o.current=!0}},[])},fx=function(e,n){Xa(function(o){if(!o)return e()},n)},pSt=qt({},MK),Nwe=pSt.useInsertionEffect,gSt=function(e,n,o){m.useMemo(e,o),Xa(function(){return n(!0)},o)},mSt=Nwe?function(t,e,n){return Nwe(function(){return t(),e()},n)}:gSt,ySt=qt({},MK),ASt=ySt.useInsertionEffect,wSt=function(e){var n=[],o=!1;function r(i){o||n.push(i)}return m.useEffect(function(){return o=!1,function(){o=!0,n.length&&n.forEach(function(i){return i()})}},e),r},vSt=function(){return function(e){e()}},xSt=typeof ASt<"u"?wSt:vSt;function Qge(t,e,n,o,r){var i=m.useContext(w$),a=i.cache,l=[t].concat(Lo(e)),s=r0e(l),c=xSt([s]),u=function(g){a.opUpdate(s,function(y){var w=y||[void 0,void 0],b=ln(w,2),C=b[0],P=C===void 0?0:C,v=b[1],T=v,A=T||n(),x=[P,A];return g?g(x):x})};m.useMemo(function(){u()},[s]);var d=a.opGet(s),f=d[1];return mSt(function(){r==null||r(f)},function(p){return u(function(g){var y=ln(g,2),w=y[0],b=y[1];return p&&w===0&&(r==null||r(f)),[w+1,b]}),function(){a.opUpdate(s,function(g){var y=g||[],w=ln(y,2),b=w[0],C=b===void 0?0:b,P=w[1],v=C-1;return v===0?(c(function(){(p||!a.opGet(s))&&(o==null||o(P,!1))}),null):[C-1,P]})}},[s]),f}var bSt={},SSt="css",vv=new Map;function TSt(t){vv.set(t,(vv.get(t)||0)+1)}function PSt(t,e){if(typeof document<"u"){var n=document.querySelectorAll("style[".concat(dR,'="').concat(t,'"]'));n.forEach(function(o){if(o[m8]===e){var r;(r=o.parentNode)===null||r===void 0||r.removeChild(o)}})}}var CSt=0;function RSt(t,e){vv.set(t,(vv.get(t)||0)-1);var n=Array.from(vv.keys()),o=n.filter(function(r){var i=vv.get(r)||0;return i<=0});n.length-o.length>CSt&&o.forEach(function(r){PSt(r,e),vv.delete(r)})}var HSt=function(e,n,o,r){var i=o.getDerivativeToken(e),a=qt(qt({},i),n);return r&&(a=r(a)),a},qOe="token";function MSt(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=m.useContext(w$),r=o.cache.instanceId,i=o.container,a=n.salt,l=a===void 0?"":a,s=n.override,c=s===void 0?bSt:s,u=n.formatToken,d=n.getComputedToken,f=n.cssVar,p=fSt(function(){return Object.assign.apply(Object,[{}].concat(Lo(e)))},e),g=AE(p),y=AE(c),w=f?AE(f):"",b=Qge(qOe,[l,t.id,g,y,w],function(){var C,P=d?d(p,c,t):HSt(p,c,t,u),v=qt({},P),T="";if(f){var A=KOe(P,f.key,{prefix:f.prefix,ignore:f.ignore,unitless:f.unitless,preserve:f.preserve}),x=ln(A,2);P=x[0],T=x[1]}var S=Lwe(P,l);P._tokenKey=S,v._tokenKey=Lwe(v,l);var R=(C=f==null?void 0:f.key)!==null&&C!==void 0?C:S;P._themeKey=R,TSt(R);var M="".concat(SSt,"-").concat(KF(S));return P._hashId=M,[P,M,v,T,(f==null?void 0:f.key)||""]},function(C){RSt(C[0]._themeKey,r)},function(C){var P=ln(C,4),v=P[0],T=P[3];if(f&&T){var A=dx(T,KF("css-variables-".concat(v._themeKey)),{mark:E2,prepend:"queue",attachTo:i,priority:-999});A[m8]=r,A.setAttribute(dR,v._themeKey)}});return b}var ISt=function(e,n,o){var r=ln(e,5),i=r[2],a=r[3],l=r[4],s=o||{},c=s.plain;if(!a)return null;var u=i._tokenKey,d=-999,f={"data-rc-order":"prependQueue","data-rc-priority":"".concat(d)},p=PG(a,l,u,f,c);return[d,u,p]},zSt={animationIterationCount: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},$Oe="comm",QOe="rule",ZOe="decl",DSt="@import",ESt="@keyframes",FSt="@layer",kSt=Math.abs,Zge=String.fromCharCode;function e_e(t){return t.trim()}function L_(t,e,n){return t.replace(e,n)}function LSt(t,e){return t.indexOf(e)}function qF(t,e){return t.charCodeAt(e)|0}function $F(t,e,n){return t.slice(e,n)}function A6(t){return t.length}function WSt(t){return t.length}function gY(t,e){return e.push(t),t}var v$=1,fR=1,t_e=0,ey=0,iu=0,LH="";function eme(t,e,n,o,r,i,a,l){return{value:t,root:e,parent:n,type:o,props:r,children:i,line:v$,column:fR,length:a,return:"",siblings:l}}function NSt(){return iu}function USt(){return iu=ey>0?qF(LH,--ey):0,fR--,iu===10&&(fR=1,v$--),iu}function F2(){return iu=ey2||l0e(iu)>3?"":" "}function OSt(t,e){for(;--e&&F2()&&!(iu<48||iu>102||iu>57&&iu<65||iu>70&&iu<97););return x$(t,W_()+(e<6&&hx()==32&&F2()==32))}function s0e(t){for(;F2();)switch(iu){case t:return ey;case 34:case 39:t!==34&&t!==39&&s0e(iu);break;case 40:t===41&&s0e(t);break;case 92:F2();break}return ey}function _St(t,e){for(;F2()&&t+iu!==57;)if(t+iu===84&&hx()===47)break;return"/*"+x$(e,ey-1)+"*"+Zge(t===47?t:F2())}function VSt(t){for(;!l0e(hx());)F2();return x$(t,ey)}function GSt(t){return BSt(N_("",null,null,null,[""],t=jSt(t),0,[0],t))}function N_(t,e,n,o,r,i,a,l,s){for(var c=0,u=0,d=a,f=0,p=0,g=0,y=1,w=1,b=1,C=0,P="",v=r,T=i,A=o,x=P;w;)switch(g=C,C=F2()){case 40:if(g!=108&&qF(x,d-1)==58){LSt(x+=L_(zre(C),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:x+=zre(C);break;case 9:case 10:case 13:case 32:x+=YSt(g);break;case 92:x+=OSt(W_()-1,7);continue;case 47:switch(hx()){case 42:case 47:gY(XSt(_St(F2(),W_()),e,n,s),s);break;default:x+="/"}break;case 123*y:l[c++]=A6(x)*b;case 125*y:case 59:case 0:switch(C){case 0:case 125:w=0;case 59+u:b==-1&&(x=L_(x,/\f/g,"")),p>0&&A6(x)-d&&gY(p>32?jwe(x+";",o,n,d-1,s):jwe(L_(x," ","")+";",o,n,d-2,s),s);break;case 59:x+=";";default:if(gY(A=Uwe(x,e,n,c,u,r,l,P,v=[],T=[],d,i),i),C===123)if(u===0)N_(x,e,A,A,v,i,d,l,T);else switch(f===99&&qF(x,3)===110?100:f){case 100:case 108:case 109:case 115:N_(t,A,A,o&&gY(Uwe(t,A,A,0,0,r,l,P,r,v=[],d,T),T),r,T,d,l,o?v:T);break;default:N_(x,A,A,A,[""],T,0,l,T)}}c=u=p=0,y=b=1,P=x="",d=a;break;case 58:d=1+A6(x),p=g;default:if(y<1){if(C==123)--y;else if(C==125&&y++==0&&USt()==125)continue}switch(x+=Zge(C),C*y){case 38:b=u>0?1:(x+="\f",-1);break;case 44:l[c++]=(A6(x)-1)*b,b=1;break;case 64:hx()===45&&(x+=zre(F2())),f=hx(),u=d=A6(P=x+=VSt(W_())),C++;break;case 45:g===45&&A6(x)==2&&(y=0)}}return i}function Uwe(t,e,n,o,r,i,a,l,s,c,u,d){for(var f=r-1,p=r===0?i:[""],g=WSt(p),y=0,w=0,b=0;y0?p[C]+" "+P:L_(P,/&\f/g,p[C])))&&(s[b++]=v);return eme(t,e,n,r===0?QOe:l,s,c,u,d)}function XSt(t,e,n,o){return eme(t,e,n,$Oe,Zge(NSt()),$F(t,2,-2),0,o)}function jwe(t,e,n,o,r){return eme(t,e,n,ZOe,$F(t,0,o),$F(t,o+1,-1),o,r)}function c0e(t,e){for(var n="",o=0;o1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},r=o.root,i=o.injectHash,a=o.parentSelectors,l=n.hashId,s=n.layer;n.path;var c=n.hashPriority,u=n.transformers,d=u===void 0?[]:u;n.linters;var f="",p={};function g(b){var C=b.getName(l);if(!p[C]){var P=t(b.style,n,{root:!1,parentSelectors:a}),v=ln(P,1),T=v[0];p[C]="@keyframes ".concat(b.getName(l)).concat(T)}}function y(b){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return b.forEach(function(P){Array.isArray(P)?y(P,C):P&&C.push(P)}),C}var w=y(Array.isArray(e)?e:[e]);return w.forEach(function(b){var C=typeof b=="string"&&!r?{}:b;if(typeof C=="string")f+="".concat(C,` + */var Jge=Symbol.for("react.element"),Kge=Symbol.for("react.portal"),l$=Symbol.for("react.fragment"),s$=Symbol.for("react.strict_mode"),c$=Symbol.for("react.profiler"),u$=Symbol.for("react.provider"),d$=Symbol.for("react.context"),dbt=Symbol.for("react.server_context"),f$=Symbol.for("react.forward_ref"),h$=Symbol.for("react.suspense"),p$=Symbol.for("react.suspense_list"),g$=Symbol.for("react.memo"),m$=Symbol.for("react.lazy"),fbt=Symbol.for("react.offscreen"),COe;COe=Symbol.for("react.module.reference");function uy(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Jge:switch(t=t.type,t){case l$:case c$:case s$:case h$:case p$:return t;default:switch(t=t&&t.$$typeof,t){case dbt:case d$:case f$:case m$:case g$:case u$:return t;default:return e}}case Kge:return e}}}hs.ContextConsumer=d$;hs.ContextProvider=u$;hs.Element=Jge;hs.ForwardRef=f$;hs.Fragment=l$;hs.Lazy=m$;hs.Memo=g$;hs.Portal=Kge;hs.Profiler=c$;hs.StrictMode=s$;hs.Suspense=h$;hs.SuspenseList=p$;hs.isAsyncMode=function(){return!1};hs.isConcurrentMode=function(){return!1};hs.isContextConsumer=function(t){return uy(t)===d$};hs.isContextProvider=function(t){return uy(t)===u$};hs.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Jge};hs.isForwardRef=function(t){return uy(t)===f$};hs.isFragment=function(t){return uy(t)===l$};hs.isLazy=function(t){return uy(t)===m$};hs.isMemo=function(t){return uy(t)===g$};hs.isPortal=function(t){return uy(t)===Kge};hs.isProfiler=function(t){return uy(t)===c$};hs.isStrictMode=function(t){return uy(t)===s$};hs.isSuspense=function(t){return uy(t)===h$};hs.isSuspenseList=function(t){return uy(t)===p$};hs.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===l$||t===c$||t===s$||t===h$||t===p$||t===fbt||typeof t=="object"&&t!==null&&(t.$$typeof===m$||t.$$typeof===g$||t.$$typeof===u$||t.$$typeof===d$||t.$$typeof===f$||t.$$typeof===COe||t.getModuleId!==void 0)};hs.typeOf=uy;POe.exports=hs;var ROe=POe.exports;function ow(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[];return be.Children.forEach(t,function(o){o==null&&!e.keepEmpty||(Array.isArray(o)?n=n.concat(ow(o)):ROe.isFragment(o)&&o.props?n=n.concat(ow(o.props.children,e)):n.push(o))}),n}var qce={},hbt=function(e){};function pbt(t,e){}function gbt(t,e){}function mbt(){qce={}}function HOe(t,e,n){!e&&!qce[n]&&(t(!1,n),qce[n]=!0)}function j0(t,e){HOe(pbt,t,e)}function MOe(t,e){HOe(gbt,t,e)}j0.preMessage=hbt;j0.resetWarned=mbt;j0.noteOnce=MOe;function hi(t){"@babel/helpers - typeof";return hi=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},hi(t)}function ybt(t,e){if(hi(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(hi(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function IOe(t){var e=ybt(t,"string");return hi(e)==="symbol"?e:String(e)}function Vt(t,e,n){return e=IOe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hwe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function qt(t){for(var e=1;e0},t.prototype.connect_=function(){!Qce||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Tbt?(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)},t.prototype.disconnect_=function(){!Qce||!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)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,o=n===void 0?"":n,r=Sbt.some(function(i){return!!~o.indexOf(i)});r&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),DOe=function(t,e){for(var n=0,o=Object.keys(e);n"u"||!(Element instanceof Object))){if(!(e instanceof cR(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new Ebt(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.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 cR(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(o){return new Fbt(o.target,o.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),FOe=typeof WeakMap<"u"?new WeakMap:new zOe,kOe=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Pbt.getInstance(),o=new kbt(e,n,this);FOe.set(this,o)}return t}();["observe","unobserve","disconnect"].forEach(function(t){kOe.prototype[t]=function(){var e;return(e=FOe.get(this))[t].apply(e,arguments)}});var Lbt=function(){return typeof bG.ResizeObserver<"u"?bG.ResizeObserver:kOe}(),g8=new Map;function Wbt(t){t.forEach(function(e){var n,o=e.target;(n=g8.get(o))===null||n===void 0||n.forEach(function(r){return r(o)})})}var LOe=new Lbt(Wbt);function Nbt(t,e){g8.has(t)||(g8.set(t,new Set),LOe.observe(t)),g8.get(t).add(e)}function Ubt(t,e){g8.has(t)&&(g8.get(t).delete(e),g8.get(t).size||(LOe.unobserve(t),g8.delete(t)))}function Ap(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Iwe(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Pl(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Bbt(t,e){if(e&&(hi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pl(t)}function MW(t){var e=jbt();return function(){var o=TG(t),r;if(e){var i=TG(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return Bbt(this,r)}}var Ybt=function(t){HW(n,t);var e=MW(n);function n(){return Ap(this,n),e.apply(this,arguments)}return wp(n,[{key:"render",value:function(){return this.props.children}}]),n}(m.Component);function Obt(t,e){var n=t.children,o=t.disabled,r=m.useRef(null),i=m.useRef(null),a=m.useContext($ce),l=typeof n=="function",s=l?n(r):n,c=m.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!l&&m.isValidElement(s)&&rw(s),d=u?s.ref:null,f=Fw(d,r),p=function(){var b;return yE(r.current)||(r.current&&hi(r.current)==="object"?yE((b=r.current)===null||b===void 0?void 0:b.nativeElement):null)||yE(i.current)};m.useImperativeHandle(e,function(){return p()});var g=m.useRef(t);g.current=t;var y=m.useCallback(function(w){var b=g.current,C=b.onResize,P=b.data,v=w.getBoundingClientRect(),T=v.width,A=v.height,x=w.offsetWidth,S=w.offsetHeight,R=Math.floor(T),M=Math.floor(A);if(c.current.width!==R||c.current.height!==M||c.current.offsetWidth!==x||c.current.offsetHeight!==S){var D={width:R,height:M,offsetWidth:x,offsetHeight:S};c.current=D;var E=x===Math.round(T)?T:x,W=S===Math.round(A)?A:S,j=qt(qt({},D),{},{offsetWidth:E,offsetHeight:W});a==null||a(j,w,P),C&&Promise.resolve().then(function(){C(j,w)})}},[]);return m.useEffect(function(){var w=p();return w&&!o&&Nbt(w,y),function(){return Ubt(w,y)}},[r.current,o]),m.createElement(Ybt,{ref:i},u?m.cloneElement(s,{ref:f}):s)}var _bt=m.forwardRef(Obt),Vbt="rc-observer-key";function Gbt(t,e){var n=t.children,o=typeof n=="function"?[n]:ow(n);return o.map(function(r,i){var a=(r==null?void 0:r.key)||"".concat(Vbt,"-").concat(i);return m.createElement(_bt,ho({},t,{key:a,ref:i===0?e:void 0}),r)})}var Td=m.forwardRef(Gbt);Td.Collection=Abt;function zg(t){"@babel/helpers - typeof";return zg=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},zg(t)}function Xbt(t,e){if(zg(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(zg(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jbt(t){var e=Xbt(t,"string");return zg(e)==="symbol"?e:String(e)}function Kbt(t,e,n){return e=Jbt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zwe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function uR(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:1;Dwe+=1;var o=Dwe;function r(i){if(i===0)UOe(o),e();else{var a=WOe(function(){r(i-1)});qge.set(o,a)}}return r(n),o};Dg.cancel=function(t){var e=qge.get(t);return UOe(t),NOe(e)};function jOe(t){if(Array.isArray(t))return t}function eSt(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var o,r,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;s=!1}else for(;!(s=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);s=!0);}catch(u){c=!0,r=u}finally{try{if(!s&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}function t0e(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n=4;++o,r-=4)n=t.charCodeAt(o)&255|(t.charCodeAt(++o)&255)<<8|(t.charCodeAt(++o)&255)<<16|(t.charCodeAt(++o)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(t.charCodeAt(o+2)&255)<<16;case 2:e^=(t.charCodeAt(o+1)&255)<<8;case 1:e^=t.charCodeAt(o)&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)}function dp(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function n0e(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}var Ewe="data-rc-order",Fwe="data-rc-priority",oSt="rc-util-key",o0e=new Map;function OOe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):oSt}function A$(t){if(t.attachTo)return t.attachTo;var e=document.querySelector("head");return e||document.body}function rSt(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function _Oe(t){return Array.from((o0e.get(t)||t).children).filter(function(e){return e.tagName==="STYLE"})}function VOe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!dp())return null;var n=e.csp,o=e.prepend,r=e.priority,i=r===void 0?0:r,a=rSt(o),l=a==="prependQueue",s=document.createElement("style");s.setAttribute(Ewe,a),l&&i&&s.setAttribute(Fwe,"".concat(i)),n!=null&&n.nonce&&(s.nonce=n==null?void 0:n.nonce),s.innerHTML=t;var c=A$(e),u=c.firstChild;if(o){if(l){var d=_Oe(c).filter(function(f){if(!["prepend","prependQueue"].includes(f.getAttribute(Ewe)))return!1;var p=Number(f.getAttribute(Fwe)||0);return i>=p});if(d.length)return c.insertBefore(s,d[d.length-1].nextSibling),s}c.insertBefore(s,u)}else c.appendChild(s);return s}function GOe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=A$(e);return _Oe(n).find(function(o){return o.getAttribute(OOe(e))===t})}function PG(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=GOe(t,e);if(n){var o=A$(e);o.removeChild(n)}}function iSt(t,e){var n=o0e.get(t);if(!n||!n0e(document,n)){var o=VOe("",e),r=o.parentNode;o0e.set(t,r),t.removeChild(o)}}function dx(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=A$(n);iSt(o,n);var r=GOe(e,n);if(r){var i,a;if((i=n.csp)!==null&&i!==void 0&&i.nonce&&r.nonce!==((a=n.csp)===null||a===void 0?void 0:a.nonce)){var l;r.nonce=(l=n.csp)===null||l===void 0?void 0:l.nonce}return r.innerHTML!==t&&(r.innerHTML=t),r}var s=VOe(t,n);return s.setAttribute(OOe(n),e),s}function aSt(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function ii(t,e){if(t==null)return{};var n=aSt(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function iw(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=new Set;function r(i,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,s=o.has(i);if(j0(!s,"Warning: There may be circular references"),s)return!1;if(i===a)return!0;if(n&&l>1)return!1;o.add(i);var c=l+1;if(Array.isArray(i)){if(!Array.isArray(a)||i.length!==a.length)return!1;for(var u=0;u1&&arguments[1]!==void 0?arguments[1]:!1,a={map:this.cache};return n.forEach(function(l){if(!a)a=void 0;else{var s;a=(s=a)===null||s===void 0||(s=s.map)===null||s===void 0?void 0:s.get(l)}}),(o=a)!==null&&o!==void 0&&o.value&&i&&(a.value[1]=this.cacheCallTimes++),(r=a)===null||r===void 0?void 0:r.value}},{key:"get",value:function(n){var o;return(o=this.internalGet(n,!0))===null||o===void 0?void 0:o[0]}},{key:"has",value:function(n){return!!this.internalGet(n)}},{key:"set",value:function(n,o){var r=this;if(!this.has(n)){if(this.size()+1>t.MAX_CACHE_SIZE+t.MAX_CACHE_OFFSET){var i=this.keys.reduce(function(c,u){var d=ln(c,2),f=d[1];return r.internalGet(u)[1]0,void 0),kwe+=1}return wp(t,[{key:"getDerivativeToken",value:function(n){return this.derivatives.reduce(function(o,r){return r(n,o)},void 0)}}]),t}(),Mre=new Qge;function i0e(t){var e=Array.isArray(t)?t:[t];return Mre.has(e)||Mre.set(e,new XOe(e)),Mre.get(e)}var dSt=new WeakMap,Ire={};function fSt(t,e){for(var n=dSt,o=0;o1&&arguments[1]!==void 0?arguments[1]:!1,n=Lwe.get(t)||"";return n||(Object.keys(t).forEach(function(o){var r=t[o];n+=o,r instanceof XOe?n+=r.id:r&&hi(r)==="object"?n+=AE(r,e):n+=r}),e&&(n=KF(n)),Lwe.set(t,n)),n}function Wwe(t,e){return KF("".concat(e,"_").concat(AE(t,!0)))}var a0e=dp();function Nt(t){return typeof t=="number"?"".concat(t,"px"):t}function CG(t,e,n){var o,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(i)return t;var a=qt(qt({},r),{},(o={},Vt(o,dR,e),Vt(o,E2,n),o)),l=Object.keys(a).map(function(s){var c=a[s];return c?"".concat(s,'="').concat(c,'"'):null}).filter(function(s){return s}).join(" ");return"")}var JOe=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(n?"".concat(n,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},hSt=function(e,n,o){return Object.keys(e).length?".".concat(n).concat(o!=null&&o.scope?".".concat(o.scope):"","{").concat(Object.entries(e).map(function(r){var i=ln(r,2),a=i[0],l=i[1];return"".concat(a,":").concat(l,";")}).join(""),"}"):""},KOe=function(e,n,o){var r={},i={};return Object.entries(e).forEach(function(a){var l,s,c=ln(a,2),u=c[0],d=c[1];if(o!=null&&(l=o.preserve)!==null&&l!==void 0&&l[u])i[u]=d;else if((typeof d=="string"||typeof d=="number")&&!(o!=null&&(s=o.ignore)!==null&&s!==void 0&&s[u])){var f,p=JOe(u,o==null?void 0:o.prefix);r[p]=typeof d=="number"&&!(o!=null&&(f=o.unitless)!==null&&f!==void 0&&f[u])?"".concat(d,"px"):String(d),i[u]="var(".concat(p,")")}}),[i,hSt(r,n,{scope:o==null?void 0:o.scope})]},Nwe=dp()?m.useLayoutEffect:m.useEffect,Xa=function(e,n){var o=m.useRef(!0);Nwe(function(){return e(o.current)},n),Nwe(function(){return o.current=!1,function(){o.current=!0}},[])},fx=function(e,n){Xa(function(o){if(!o)return e()},n)},pSt=qt({},IK),Uwe=pSt.useInsertionEffect,gSt=function(e,n,o){m.useMemo(e,o),Xa(function(){return n(!0)},o)},mSt=Uwe?function(t,e,n){return Uwe(function(){return t(),e()},n)}:gSt,ySt=qt({},IK),ASt=ySt.useInsertionEffect,wSt=function(e){var n=[],o=!1;function r(i){o||n.push(i)}return m.useEffect(function(){return o=!1,function(){o=!0,n.length&&n.forEach(function(i){return i()})}},e),r},vSt=function(){return function(e){e()}},xSt=typeof ASt<"u"?wSt:vSt;function Zge(t,e,n,o,r){var i=m.useContext(w$),a=i.cache,l=[t].concat(Lo(e)),s=r0e(l),c=xSt([s]),u=function(g){a.opUpdate(s,function(y){var w=y||[void 0,void 0],b=ln(w,2),C=b[0],P=C===void 0?0:C,v=b[1],T=v,A=T||n(),x=[P,A];return g?g(x):x})};m.useMemo(function(){u()},[s]);var d=a.opGet(s),f=d[1];return mSt(function(){r==null||r(f)},function(p){return u(function(g){var y=ln(g,2),w=y[0],b=y[1];return p&&w===0&&(r==null||r(f)),[w+1,b]}),function(){a.opUpdate(s,function(g){var y=g||[],w=ln(y,2),b=w[0],C=b===void 0?0:b,P=w[1],v=C-1;return v===0?(c(function(){(p||!a.opGet(s))&&(o==null||o(P,!1))}),null):[C-1,P]})}},[s]),f}var bSt={},SSt="css",vv=new Map;function TSt(t){vv.set(t,(vv.get(t)||0)+1)}function PSt(t,e){if(typeof document<"u"){var n=document.querySelectorAll("style[".concat(dR,'="').concat(t,'"]'));n.forEach(function(o){if(o[m8]===e){var r;(r=o.parentNode)===null||r===void 0||r.removeChild(o)}})}}var CSt=0;function RSt(t,e){vv.set(t,(vv.get(t)||0)-1);var n=Array.from(vv.keys()),o=n.filter(function(r){var i=vv.get(r)||0;return i<=0});n.length-o.length>CSt&&o.forEach(function(r){PSt(r,e),vv.delete(r)})}var HSt=function(e,n,o,r){var i=o.getDerivativeToken(e),a=qt(qt({},i),n);return r&&(a=r(a)),a},qOe="token";function MSt(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=m.useContext(w$),r=o.cache.instanceId,i=o.container,a=n.salt,l=a===void 0?"":a,s=n.override,c=s===void 0?bSt:s,u=n.formatToken,d=n.getComputedToken,f=n.cssVar,p=fSt(function(){return Object.assign.apply(Object,[{}].concat(Lo(e)))},e),g=AE(p),y=AE(c),w=f?AE(f):"",b=Zge(qOe,[l,t.id,g,y,w],function(){var C,P=d?d(p,c,t):HSt(p,c,t,u),v=qt({},P),T="";if(f){var A=KOe(P,f.key,{prefix:f.prefix,ignore:f.ignore,unitless:f.unitless,preserve:f.preserve}),x=ln(A,2);P=x[0],T=x[1]}var S=Wwe(P,l);P._tokenKey=S,v._tokenKey=Wwe(v,l);var R=(C=f==null?void 0:f.key)!==null&&C!==void 0?C:S;P._themeKey=R,TSt(R);var M="".concat(SSt,"-").concat(KF(S));return P._hashId=M,[P,M,v,T,(f==null?void 0:f.key)||""]},function(C){RSt(C[0]._themeKey,r)},function(C){var P=ln(C,4),v=P[0],T=P[3];if(f&&T){var A=dx(T,KF("css-variables-".concat(v._themeKey)),{mark:E2,prepend:"queue",attachTo:i,priority:-999});A[m8]=r,A.setAttribute(dR,v._themeKey)}});return b}var ISt=function(e,n,o){var r=ln(e,5),i=r[2],a=r[3],l=r[4],s=o||{},c=s.plain;if(!a)return null;var u=i._tokenKey,d=-999,f={"data-rc-order":"prependQueue","data-rc-priority":"".concat(d)},p=CG(a,l,u,f,c);return[d,u,p]},zSt={animationIterationCount: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},$Oe="comm",QOe="rule",ZOe="decl",DSt="@import",ESt="@keyframes",FSt="@layer",kSt=Math.abs,eme=String.fromCharCode;function e_e(t){return t.trim()}function W_(t,e,n){return t.replace(e,n)}function LSt(t,e){return t.indexOf(e)}function qF(t,e){return t.charCodeAt(e)|0}function $F(t,e,n){return t.slice(e,n)}function A6(t){return t.length}function WSt(t){return t.length}function mY(t,e){return e.push(t),t}var v$=1,fR=1,t_e=0,ey=0,iu=0,LH="";function tme(t,e,n,o,r,i,a,l){return{value:t,root:e,parent:n,type:o,props:r,children:i,line:v$,column:fR,length:a,return:"",siblings:l}}function NSt(){return iu}function USt(){return iu=ey>0?qF(LH,--ey):0,fR--,iu===10&&(fR=1,v$--),iu}function F2(){return iu=ey2||l0e(iu)>3?"":" "}function OSt(t,e){for(;--e&&F2()&&!(iu<48||iu>102||iu>57&&iu<65||iu>70&&iu<97););return x$(t,N_()+(e<6&&hx()==32&&F2()==32))}function s0e(t){for(;F2();)switch(iu){case t:return ey;case 34:case 39:t!==34&&t!==39&&s0e(iu);break;case 40:t===41&&s0e(t);break;case 92:F2();break}return ey}function _St(t,e){for(;F2()&&t+iu!==57;)if(t+iu===84&&hx()===47)break;return"/*"+x$(e,ey-1)+"*"+eme(t===47?t:F2())}function VSt(t){for(;!l0e(hx());)F2();return x$(t,ey)}function GSt(t){return BSt(U_("",null,null,null,[""],t=jSt(t),0,[0],t))}function U_(t,e,n,o,r,i,a,l,s){for(var c=0,u=0,d=a,f=0,p=0,g=0,y=1,w=1,b=1,C=0,P="",v=r,T=i,A=o,x=P;w;)switch(g=C,C=F2()){case 40:if(g!=108&&qF(x,d-1)==58){LSt(x+=W_(zre(C),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:x+=zre(C);break;case 9:case 10:case 13:case 32:x+=YSt(g);break;case 92:x+=OSt(N_()-1,7);continue;case 47:switch(hx()){case 42:case 47:mY(XSt(_St(F2(),N_()),e,n,s),s);break;default:x+="/"}break;case 123*y:l[c++]=A6(x)*b;case 125*y:case 59:case 0:switch(C){case 0:case 125:w=0;case 59+u:b==-1&&(x=W_(x,/\f/g,"")),p>0&&A6(x)-d&&mY(p>32?Bwe(x+";",o,n,d-1,s):Bwe(W_(x," ","")+";",o,n,d-2,s),s);break;case 59:x+=";";default:if(mY(A=jwe(x,e,n,c,u,r,l,P,v=[],T=[],d,i),i),C===123)if(u===0)U_(x,e,A,A,v,i,d,l,T);else switch(f===99&&qF(x,3)===110?100:f){case 100:case 108:case 109:case 115:U_(t,A,A,o&&mY(jwe(t,A,A,0,0,r,l,P,r,v=[],d,T),T),r,T,d,l,o?v:T);break;default:U_(x,A,A,A,[""],T,0,l,T)}}c=u=p=0,y=b=1,P=x="",d=a;break;case 58:d=1+A6(x),p=g;default:if(y<1){if(C==123)--y;else if(C==125&&y++==0&&USt()==125)continue}switch(x+=eme(C),C*y){case 38:b=u>0?1:(x+="\f",-1);break;case 44:l[c++]=(A6(x)-1)*b,b=1;break;case 64:hx()===45&&(x+=zre(F2())),f=hx(),u=d=A6(P=x+=VSt(N_())),C++;break;case 45:g===45&&A6(x)==2&&(y=0)}}return i}function jwe(t,e,n,o,r,i,a,l,s,c,u,d){for(var f=r-1,p=r===0?i:[""],g=WSt(p),y=0,w=0,b=0;y0?p[C]+" "+P:W_(P,/&\f/g,p[C])))&&(s[b++]=v);return tme(t,e,n,r===0?QOe:l,s,c,u,d)}function XSt(t,e,n,o){return tme(t,e,n,$Oe,eme(NSt()),$F(t,2,-2),0,o)}function Bwe(t,e,n,o,r){return tme(t,e,n,ZOe,$F(t,0,o),$F(t,o+1,-1),o,r)}function c0e(t,e){for(var n="",o=0;o1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},r=o.root,i=o.injectHash,a=o.parentSelectors,l=n.hashId,s=n.layer;n.path;var c=n.hashPriority,u=n.transformers,d=u===void 0?[]:u;n.linters;var f="",p={};function g(b){var C=b.getName(l);if(!p[C]){var P=t(b.style,n,{root:!1,parentSelectors:a}),v=ln(P,1),T=v[0];p[C]="@keyframes ".concat(b.getName(l)).concat(T)}}function y(b){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return b.forEach(function(P){Array.isArray(P)?y(P,C):P&&C.push(P)}),C}var w=y(Array.isArray(e)?e:[e]);return w.forEach(function(b){var C=typeof b=="string"&&!r?{}:b;if(typeof C=="string")f+="".concat(C,` `);else if(C._keyframe)g(C);else{var P=d.reduce(function(v,T){var A;return(T==null||(A=T.visit)===null||A===void 0?void 0:A.call(T,v))||v},C);Object.keys(P).forEach(function(v){var T=P[v];if(hi(T)==="object"&&T&&(v!=="animationName"||!T._keyframe)&&!ZSt(T)){var A=!1,x=v.trim(),S=!1;(r||i)&&l?x.startsWith("@")?A=!0:x=eTt(v,l,c):r&&!l&&(x==="&"||x==="")&&(x="",S=!0);var R=t(T,n,{root:S,injectHash:A,parentSelectors:[].concat(Lo(a),[x])}),M=ln(R,2),D=M[0],E=M[1];p=qt(qt({},p),E),f+="".concat(x).concat(D)}else{let L=function(k,N){var F=k.replace(/[A-Z]/g,function(O){return"-".concat(O.toLowerCase())}),U=N;!zSt[k]&&typeof U=="number"&&U!==0&&(U="".concat(U,"px")),k==="animationName"&&N!==null&&N!==void 0&&N._keyframe&&(g(N),U=N.getName(l)),f+="".concat(F,":").concat(U,";")};var W,j=(W=T==null?void 0:T.value)!==null&&W!==void 0?W:T;hi(T)==="object"&&T!==null&&T!==void 0&&T[r_e]&&Array.isArray(j)?j.forEach(function(k){L(v,k)}):L(v,j)}})}}),r?s&&(f="@layer ".concat(s.name," {").concat(f,"}"),s.dependencies&&(p["@layer ".concat(s.name)]=s.dependencies.map(function(b){return"@layer ".concat(b,", ").concat(s.name,";")}).join(` -`))):f="{".concat(f,"}"),[f,p]};function i_e(t,e){return KF("".concat(t.join("%")).concat(e))}function nTt(){return null}var a_e="style";function u0e(t,e){var n=t.token,o=t.path,r=t.hashId,i=t.layer,a=t.nonce,l=t.clientOnly,s=t.order,c=s===void 0?0:s,u=m.useContext(w$),d=u.autoClear;u.mock;var f=u.defaultCache,p=u.hashPriority,g=u.container,y=u.ssrInline,w=u.transformers,b=u.linters,C=u.cache,P=u.layer,v=n._tokenKey,T=[v];P&&T.push("layer"),T.push.apply(T,Lo(o));var A=a0e,x=Qge(a_e,T,function(){var E=T.join("|");if(qSt(E)){var W=$St(E),j=ln(W,2),L=j[0],k=j[1];if(L)return[L,v,k,{},l,c]}var N=e(),F=tTt(N,{hashId:r,hashPriority:p,layer:P?i:void 0,path:o.join("-"),transformers:w,linters:b}),U=ln(F,2),O=U[0],B=U[1],_=U_(O),X=i_e(T,_);return[_,v,X,B,l,c]},function(E,W){var j=ln(E,3),L=j[2];(W||d)&&a0e&&TG(L,{mark:E2})},function(E){var W=ln(E,4),j=W[0];W[1];var L=W[2],k=W[3];if(A&&j!==n_e){var N={mark:E2,prepend:P?!1:"queue",attachTo:g,priority:c},F=typeof a=="function"?a():a;F&&(N.csp={nonce:F});var U=[],O=[];Object.keys(k).forEach(function(_){_.startsWith("@layer")?U.push(_):O.push(_)}),U.forEach(function(_){dx(U_(k[_]),"_layer-".concat(_),qt(qt({},N),{},{prepend:!0}))});var B=dx(j,L,N);B[m8]=C.instanceId,B.setAttribute(dR,v),O.forEach(function(_){dx(U_(k[_]),"_effect-".concat(_),N)})}}),S=ln(x,3),R=S[0],M=S[1],D=S[2];return function(E){var W;if(!y||A||!f)W=m.createElement(nTt,null);else{var j;W=m.createElement("style",ho({},(j={},Vt(j,dR,M),Vt(j,E2,D),j),{dangerouslySetInnerHTML:{__html:R}}))}return m.createElement(m.Fragment,null,W,E)}}var oTt=function(e,n,o){var r=ln(e,6),i=r[0],a=r[1],l=r[2],s=r[3],c=r[4],u=r[5],d=o||{},f=d.plain;if(c)return null;var p=i,g={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)};return p=PG(i,a,l,g,f),s&&Object.keys(s).forEach(function(y){if(!n[y]){n[y]=!0;var w=U_(s[y]),b=PG(w,a,"_effect-".concat(y),g,f);y.startsWith("@layer")?p=b+p:p+=b}}),[u,l,p]},l_e="cssVar",rTt=function(e,n){var o=e.key,r=e.prefix,i=e.unitless,a=e.ignore,l=e.token,s=e.scope,c=s===void 0?"":s,u=m.useContext(w$),d=u.cache.instanceId,f=u.container,p=l._tokenKey,g=[].concat(Lo(e.path),[o,c,p]),y=Qge(l_e,g,function(){var w=n(),b=KOe(w,o,{prefix:r,unitless:i,ignore:a,scope:c}),C=ln(b,2),P=C[0],v=C[1],T=i_e(g,v);return[P,v,T,o]},function(w){var b=ln(w,3),C=b[2];a0e&&TG(C,{mark:E2})},function(w){var b=ln(w,3),C=b[1],P=b[2];if(C){var v=dx(C,P,{mark:E2,prepend:"queue",attachTo:f,priority:-999});v[m8]=d,v.setAttribute(dR,o)}});return y},iTt=function(e,n,o){var r=ln(e,4),i=r[1],a=r[2],l=r[3],s=o||{},c=s.plain;if(!i)return null;var u=-999,d={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)},f=PG(i,l,a,d,c);return[u,a,f]},Iz;Iz={},Vt(Iz,a_e,oTt),Vt(Iz,qOe,ISt),Vt(Iz,l_e,iTt);var xa=function(){function t(e,n){Ap(this,t),Vt(this,"name",void 0),Vt(this,"style",void 0),Vt(this,"_keyframe",!0),this.name=e,this.style=n}return wp(t,[{key:"getName",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return n?"".concat(n,"-").concat(this.name):this.name}}]),t}();function CT(t){return t.notSplit=!0,t}CT(["borderTop","borderBottom"]),CT(["borderTop"]),CT(["borderBottom"]),CT(["borderLeft","borderRight"]),CT(["borderLeft"]),CT(["borderRight"]);var tme=m.createContext({});function nme(t,e,n){var o=m.useRef({});return(!("value"in o.current)||n(o.current.condition,e))&&(o.current.value=t(),o.current.condition=e),o.current.value}function d0e(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&o&&n===void 0&&!f0e(t,e.slice(0,-1))?t:f_e(t,e,n,o)}function cTt(t){return zg(t)==="object"&&t!==null&&Object.getPrototypeOf(t)===Object.prototype}function Ywe(t){return Array.isArray(t)?[]:{}}var uTt=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function dTt(){for(var t=arguments.length,e=new Array(t),n=0;n{const t=()=>{};return t.deprecated=fTt,t},pTt=m.createContext(void 0);var h_e={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},gTt={locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"};const p_e={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},CG={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},gTt),timePickerLocale:Object.assign({},p_e)},W1="${label} is not a valid ${type}",aw={locale:"en",Pagination:h_e,DatePicker:CG,TimePicker:p_e,Calendar:CG,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:W1,method:W1,array:W1,object:W1,number:W1,date:W1,boolean:W1,integer:W1,float:W1,regexp:W1,email:W1,url:W1,hex:W1},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty"}};let j_=Object.assign({},aw.Modal),B_=[];const Owe=()=>B_.reduce((t,e)=>Object.assign(Object.assign({},t),e),aw.Modal);function mTt(t){if(t){const e=Object.assign({},t);return B_.push(e),j_=Owe(),()=>{B_=B_.filter(n=>n!==e),j_=Owe()}}j_=Object.assign({},aw.Modal)}function g_e(){return j_}const rme=m.createContext(void 0),kw=(t,e)=>{const n=m.useContext(rme),o=m.useMemo(()=>{var i;const a=e||aw[t],l=(i=n==null?void 0:n[t])!==null&&i!==void 0?i:{};return Object.assign(Object.assign({},typeof a=="function"?a():a),l||{})},[t,e,n]),r=m.useMemo(()=>{const i=n==null?void 0:n.locale;return n!=null&&n.exist&&!i?aw.locale:i},[n]);return[o,r]},yTt="internalMark",ATt=t=>{const{locale:e={},children:n,_ANT_MARK__:o}=t;m.useEffect(()=>mTt(e&&e.Modal),[e]);const r=m.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return m.createElement(rme.Provider,{value:r},n)};function yf(t,e){wTt(t)&&(t="100%");var n=vTt(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:(e===360?t=(t<0?t%e+e:t%e)/parseFloat(String(e)):t=t%e/parseFloat(String(e)),t)}function mY(t){return Math.min(1,Math.max(0,t))}function wTt(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function vTt(t){return typeof t=="string"&&t.indexOf("%")!==-1}function m_e(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function yY(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Lv(t){return t.length===1?"0"+t:String(t)}function xTt(t,e,n){return{r:yf(t,255)*255,g:yf(e,255)*255,b:yf(n,255)*255}}function _we(t,e,n){t=yf(t,255),e=yf(e,255),n=yf(n,255);var o=Math.max(t,e,n),r=Math.min(t,e,n),i=0,a=0,l=(o+r)/2;if(o===r)a=0,i=0;else{var s=o-r;switch(a=l>.5?s/(2-o-r):s/(o+r),o){case t:i=(e-n)/s+(e1&&(n-=1),n<1/6?t+(e-t)*(6*n):n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function bTt(t,e,n){var o,r,i;if(t=yf(t,360),e=yf(e,100),n=yf(n,100),e===0)r=n,i=n,o=n;else{var a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;o=Ere(l,a,t+1/3),r=Ere(l,a,t),i=Ere(l,a,t-1/3)}return{r:o*255,g:r*255,b:i*255}}function RG(t,e,n){t=yf(t,255),e=yf(e,255),n=yf(n,255);var o=Math.max(t,e,n),r=Math.min(t,e,n),i=0,a=o,l=o-r,s=o===0?0:l/o;if(o===r)i=0;else{switch(o){case t:i=(e-n)/l+(e>16,g:(t&65280)>>8,b:t&255}}var h0e={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function A2(t){var e={r:0,g:0,b:0},n=1,o=null,r=null,i=null,a=!1,l=!1;return typeof t=="string"&&(t=MTt(t)),typeof t=="object"&&(o6(t.r)&&o6(t.g)&&o6(t.b)?(e=xTt(t.r,t.g,t.b),a=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):o6(t.h)&&o6(t.s)&&o6(t.v)?(o=yY(t.s),r=yY(t.v),e=STt(t.h,o,r),a=!0,l="hsv"):o6(t.h)&&o6(t.s)&&o6(t.l)&&(o=yY(t.s),i=yY(t.l),e=bTt(t.h,o,i),a=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=m_e(n),{ok:a,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var RTt="[-\\+]?\\d+%?",HTt="[-\\+]?\\d*\\.\\d+%?",y8="(?:".concat(HTt,")|(?:").concat(RTt,")"),Fre="[\\s|\\(]+(".concat(y8,")[,|\\s]+(").concat(y8,")[,|\\s]+(").concat(y8,")\\s*\\)?"),kre="[\\s|\\(]+(".concat(y8,")[,|\\s]+(").concat(y8,")[,|\\s]+(").concat(y8,")[,|\\s]+(").concat(y8,")\\s*\\)?"),Qy={CSS_UNIT:new RegExp(y8),rgb:new RegExp("rgb"+Fre),rgba:new RegExp("rgba"+kre),hsl:new RegExp("hsl"+Fre),hsla:new RegExp("hsla"+kre),hsv:new RegExp("hsv"+Fre),hsva:new RegExp("hsva"+kre),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function MTt(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(h0e[t])t=h0e[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Qy.rgb.exec(t);return n?{r:n[1],g:n[2],b:n[3]}:(n=Qy.rgba.exec(t),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Qy.hsl.exec(t),n?{h:n[1],s:n[2],l:n[3]}:(n=Qy.hsla.exec(t),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Qy.hsv.exec(t),n?{h:n[1],s:n[2],v:n[3]}:(n=Qy.hsva.exec(t),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Qy.hex8.exec(t),n?{r:X1(n[1]),g:X1(n[2]),b:X1(n[3]),a:Vwe(n[4]),format:e?"name":"hex8"}:(n=Qy.hex6.exec(t),n?{r:X1(n[1]),g:X1(n[2]),b:X1(n[3]),format:e?"name":"hex"}:(n=Qy.hex4.exec(t),n?{r:X1(n[1]+n[1]),g:X1(n[2]+n[2]),b:X1(n[3]+n[3]),a:Vwe(n[4]+n[4]),format:e?"name":"hex8"}:(n=Qy.hex3.exec(t),n?{r:X1(n[1]+n[1]),g:X1(n[2]+n[2]),b:X1(n[3]+n[3]),format:e?"name":"hex"}:!1)))))))))}function o6(t){return!!Qy.CSS_UNIT.exec(String(t))}var kl=function(){function t(e,n){e===void 0&&(e=""),n===void 0&&(n={});var o;if(e instanceof t)return e;typeof e=="number"&&(e=CTt(e)),this.originalInput=e;var r=A2(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(o=n.format)!==null&&o!==void 0?o:r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},t.prototype.getLuminance=function(){var e=this.toRgb(),n,o,r,i=e.r/255,a=e.g/255,l=e.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),l<=.03928?r=l/12.92:r=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*o+.0722*r},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(e){return this.a=m_e(e),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},t.prototype.toHsv=function(){var e=RG(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},t.prototype.toHsvString=function(){var e=RG(this.r,this.g,this.b),n=Math.round(e.h*360),o=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(n,", ").concat(o,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(o,"%, ").concat(r,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var e=_we(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},t.prototype.toHslString=function(){var e=_we(this.r,this.g,this.b),n=Math.round(e.h*360),o=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(n,", ").concat(o,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(o,"%, ").concat(r,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(e){return e===void 0&&(e=!1),HG(this.r,this.g,this.b,e)},t.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},t.prototype.toHex8=function(e){return e===void 0&&(e=!1),TTt(this.r,this.g,this.b,this.a,e)},t.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},t.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var e=Math.round(this.r),n=Math.round(this.g),o=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(n,", ").concat(o,")"):"rgba(".concat(e,", ").concat(n,", ").concat(o,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var e=function(n){return"".concat(Math.round(yf(n,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var e=function(n){return Math.round(yf(n,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+HG(this.r,this.g,this.b,!1),n=0,o=Object.entries(h0e);n=0,i=!n&&r&&(e.startsWith("hex")||e==="name");return i?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(o=this.toRgbString()),e==="prgb"&&(o=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(o=this.toHexString()),e==="hex3"&&(o=this.toHexString(!0)),e==="hex4"&&(o=this.toHex8String(!0)),e==="hex8"&&(o=this.toHex8String()),e==="name"&&(o=this.toName()),e==="hsl"&&(o=this.toHslString()),e==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l+=e/100,n.l=mY(n.l),new t(n)},t.prototype.brighten=function(e){e===void 0&&(e=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),new t(n)},t.prototype.darken=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l-=e/100,n.l=mY(n.l),new t(n)},t.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},t.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},t.prototype.desaturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s-=e/100,n.s=mY(n.s),new t(n)},t.prototype.saturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s+=e/100,n.s=mY(n.s),new t(n)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var n=this.toHsl(),o=(n.h+e)%360;return n.h=o<0?360+o:o,new t(n)},t.prototype.mix=function(e,n){n===void 0&&(n=50);var o=this.toRgb(),r=new t(e).toRgb(),i=n/100,a={r:(r.r-o.r)*i+o.r,g:(r.g-o.g)*i+o.g,b:(r.b-o.b)*i+o.b,a:(r.a-o.a)*i+o.a};return new t(a)},t.prototype.analogous=function(e,n){e===void 0&&(e=6),n===void 0&&(n=30);var o=this.toHsl(),r=360/n,i=[this];for(o.h=(o.h-(r*e>>1)+720)%360;--e;)o.h=(o.h+r)%360,i.push(new t(o));return i},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var n=this.toHsv(),o=n.h,r=n.s,i=n.v,a=[],l=1/e;e--;)a.push(new t({h:o,s:r,v:i})),i=(i+l)%1;return a},t.prototype.splitcomplement=function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var n=this.toRgb(),o=new t(e).toRgb(),r=n.a+o.a*(1-n.a);return new t({r:(n.r*n.a+o.r*o.a*(1-n.a))/r,g:(n.g*n.a+o.g*o.a*(1-n.a))/r,b:(n.b*n.a+o.b*o.a*(1-n.a))/r,a:r})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var n=this.toHsl(),o=n.h,r=[this],i=360/e,a=1;a=60&&Math.round(t.h)<=240?o=n?Math.round(t.h)-AY*e:Math.round(t.h)+AY*e:o=n?Math.round(t.h)+AY*e:Math.round(t.h)-AY*e,o<0?o+=360:o>=360&&(o-=360),o}function Kwe(t,e,n){if(t.h===0&&t.s===0)return t.s;var o;return n?o=t.s-Gwe*e:e===A_e?o=t.s+Gwe:o=t.s+ITt*e,o>1&&(o=1),n&&e===y_e&&o>.1&&(o=.1),o<.06&&(o=.06),Number(o.toFixed(2))}function qwe(t,e,n){var o;return n?o=t.v+zTt*e:o=t.v-DTt*e,o>1&&(o=1),Number(o.toFixed(2))}function hR(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],o=A2(t),r=y_e;r>0;r-=1){var i=Xwe(o),a=wY(A2({h:Jwe(i,r,!0),s:Kwe(i,r,!0),v:qwe(i,r,!0)}));n.push(a)}n.push(wY(o));for(var l=1;l<=A_e;l+=1){var s=Xwe(o),c=wY(A2({h:Jwe(s,l),s:Kwe(s,l),v:qwe(s,l)}));n.push(c)}return e.theme==="dark"?ETt.map(function(u){var d=u.index,f=u.opacity,p=wY(FTt(A2(e.backgroundColor||"#141414"),A2(n[d]),f*100));return p}):n}var Lre={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Y_={},Wre={};Object.keys(Lre).forEach(function(t){Y_[t]=hR(Lre[t]),Y_[t].primary=Y_[t][5],Wre[t]=hR(Lre[t],{theme:"dark",backgroundColor:"#141414"}),Wre[t].primary=Wre[t][5]});var kTt=Y_.gold;const w_e={blue:"#1677ff",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#eb2f96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},QF=Object.assign(Object.assign({},w_e),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, +`))):f="{".concat(f,"}"),[f,p]};function i_e(t,e){return KF("".concat(t.join("%")).concat(e))}function nTt(){return null}var a_e="style";function u0e(t,e){var n=t.token,o=t.path,r=t.hashId,i=t.layer,a=t.nonce,l=t.clientOnly,s=t.order,c=s===void 0?0:s,u=m.useContext(w$),d=u.autoClear;u.mock;var f=u.defaultCache,p=u.hashPriority,g=u.container,y=u.ssrInline,w=u.transformers,b=u.linters,C=u.cache,P=u.layer,v=n._tokenKey,T=[v];P&&T.push("layer"),T.push.apply(T,Lo(o));var A=a0e,x=Zge(a_e,T,function(){var E=T.join("|");if(qSt(E)){var W=$St(E),j=ln(W,2),L=j[0],k=j[1];if(L)return[L,v,k,{},l,c]}var N=e(),F=tTt(N,{hashId:r,hashPriority:p,layer:P?i:void 0,path:o.join("-"),transformers:w,linters:b}),U=ln(F,2),O=U[0],B=U[1],_=j_(O),X=i_e(T,_);return[_,v,X,B,l,c]},function(E,W){var j=ln(E,3),L=j[2];(W||d)&&a0e&&PG(L,{mark:E2})},function(E){var W=ln(E,4),j=W[0];W[1];var L=W[2],k=W[3];if(A&&j!==n_e){var N={mark:E2,prepend:P?!1:"queue",attachTo:g,priority:c},F=typeof a=="function"?a():a;F&&(N.csp={nonce:F});var U=[],O=[];Object.keys(k).forEach(function(_){_.startsWith("@layer")?U.push(_):O.push(_)}),U.forEach(function(_){dx(j_(k[_]),"_layer-".concat(_),qt(qt({},N),{},{prepend:!0}))});var B=dx(j,L,N);B[m8]=C.instanceId,B.setAttribute(dR,v),O.forEach(function(_){dx(j_(k[_]),"_effect-".concat(_),N)})}}),S=ln(x,3),R=S[0],M=S[1],D=S[2];return function(E){var W;if(!y||A||!f)W=m.createElement(nTt,null);else{var j;W=m.createElement("style",ho({},(j={},Vt(j,dR,M),Vt(j,E2,D),j),{dangerouslySetInnerHTML:{__html:R}}))}return m.createElement(m.Fragment,null,W,E)}}var oTt=function(e,n,o){var r=ln(e,6),i=r[0],a=r[1],l=r[2],s=r[3],c=r[4],u=r[5],d=o||{},f=d.plain;if(c)return null;var p=i,g={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)};return p=CG(i,a,l,g,f),s&&Object.keys(s).forEach(function(y){if(!n[y]){n[y]=!0;var w=j_(s[y]),b=CG(w,a,"_effect-".concat(y),g,f);y.startsWith("@layer")?p=b+p:p+=b}}),[u,l,p]},l_e="cssVar",rTt=function(e,n){var o=e.key,r=e.prefix,i=e.unitless,a=e.ignore,l=e.token,s=e.scope,c=s===void 0?"":s,u=m.useContext(w$),d=u.cache.instanceId,f=u.container,p=l._tokenKey,g=[].concat(Lo(e.path),[o,c,p]),y=Zge(l_e,g,function(){var w=n(),b=KOe(w,o,{prefix:r,unitless:i,ignore:a,scope:c}),C=ln(b,2),P=C[0],v=C[1],T=i_e(g,v);return[P,v,T,o]},function(w){var b=ln(w,3),C=b[2];a0e&&PG(C,{mark:E2})},function(w){var b=ln(w,3),C=b[1],P=b[2];if(C){var v=dx(C,P,{mark:E2,prepend:"queue",attachTo:f,priority:-999});v[m8]=d,v.setAttribute(dR,o)}});return y},iTt=function(e,n,o){var r=ln(e,4),i=r[1],a=r[2],l=r[3],s=o||{},c=s.plain;if(!i)return null;var u=-999,d={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)},f=CG(i,l,a,d,c);return[u,a,f]},Iz;Iz={},Vt(Iz,a_e,oTt),Vt(Iz,qOe,ISt),Vt(Iz,l_e,iTt);var xa=function(){function t(e,n){Ap(this,t),Vt(this,"name",void 0),Vt(this,"style",void 0),Vt(this,"_keyframe",!0),this.name=e,this.style=n}return wp(t,[{key:"getName",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return n?"".concat(n,"-").concat(this.name):this.name}}]),t}();function CT(t){return t.notSplit=!0,t}CT(["borderTop","borderBottom"]),CT(["borderTop"]),CT(["borderBottom"]),CT(["borderLeft","borderRight"]),CT(["borderLeft"]),CT(["borderRight"]);var nme=m.createContext({});function ome(t,e,n){var o=m.useRef({});return(!("value"in o.current)||n(o.current.condition,e))&&(o.current.value=t(),o.current.condition=e),o.current.value}function d0e(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&o&&n===void 0&&!f0e(t,e.slice(0,-1))?t:f_e(t,e,n,o)}function cTt(t){return zg(t)==="object"&&t!==null&&Object.getPrototypeOf(t)===Object.prototype}function Owe(t){return Array.isArray(t)?[]:{}}var uTt=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function dTt(){for(var t=arguments.length,e=new Array(t),n=0;n{const t=()=>{};return t.deprecated=fTt,t},pTt=m.createContext(void 0);var h_e={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},gTt={locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"};const p_e={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},RG={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},gTt),timePickerLocale:Object.assign({},p_e)},W1="${label} is not a valid ${type}",aw={locale:"en",Pagination:h_e,DatePicker:RG,TimePicker:p_e,Calendar:RG,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:W1,method:W1,array:W1,object:W1,number:W1,date:W1,boolean:W1,integer:W1,float:W1,regexp:W1,email:W1,url:W1,hex:W1},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty"}};let B_=Object.assign({},aw.Modal),Y_=[];const _we=()=>Y_.reduce((t,e)=>Object.assign(Object.assign({},t),e),aw.Modal);function mTt(t){if(t){const e=Object.assign({},t);return Y_.push(e),B_=_we(),()=>{Y_=Y_.filter(n=>n!==e),B_=_we()}}B_=Object.assign({},aw.Modal)}function g_e(){return B_}const ime=m.createContext(void 0),kw=(t,e)=>{const n=m.useContext(ime),o=m.useMemo(()=>{var i;const a=e||aw[t],l=(i=n==null?void 0:n[t])!==null&&i!==void 0?i:{};return Object.assign(Object.assign({},typeof a=="function"?a():a),l||{})},[t,e,n]),r=m.useMemo(()=>{const i=n==null?void 0:n.locale;return n!=null&&n.exist&&!i?aw.locale:i},[n]);return[o,r]},yTt="internalMark",ATt=t=>{const{locale:e={},children:n,_ANT_MARK__:o}=t;m.useEffect(()=>mTt(e&&e.Modal),[e]);const r=m.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return m.createElement(ime.Provider,{value:r},n)};function yf(t,e){wTt(t)&&(t="100%");var n=vTt(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:(e===360?t=(t<0?t%e+e:t%e)/parseFloat(String(e)):t=t%e/parseFloat(String(e)),t)}function yY(t){return Math.min(1,Math.max(0,t))}function wTt(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function vTt(t){return typeof t=="string"&&t.indexOf("%")!==-1}function m_e(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function AY(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Lv(t){return t.length===1?"0"+t:String(t)}function xTt(t,e,n){return{r:yf(t,255)*255,g:yf(e,255)*255,b:yf(n,255)*255}}function Vwe(t,e,n){t=yf(t,255),e=yf(e,255),n=yf(n,255);var o=Math.max(t,e,n),r=Math.min(t,e,n),i=0,a=0,l=(o+r)/2;if(o===r)a=0,i=0;else{var s=o-r;switch(a=l>.5?s/(2-o-r):s/(o+r),o){case t:i=(e-n)/s+(e1&&(n-=1),n<1/6?t+(e-t)*(6*n):n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function bTt(t,e,n){var o,r,i;if(t=yf(t,360),e=yf(e,100),n=yf(n,100),e===0)r=n,i=n,o=n;else{var a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;o=Ere(l,a,t+1/3),r=Ere(l,a,t),i=Ere(l,a,t-1/3)}return{r:o*255,g:r*255,b:i*255}}function HG(t,e,n){t=yf(t,255),e=yf(e,255),n=yf(n,255);var o=Math.max(t,e,n),r=Math.min(t,e,n),i=0,a=o,l=o-r,s=o===0?0:l/o;if(o===r)i=0;else{switch(o){case t:i=(e-n)/l+(e>16,g:(t&65280)>>8,b:t&255}}var h0e={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function A2(t){var e={r:0,g:0,b:0},n=1,o=null,r=null,i=null,a=!1,l=!1;return typeof t=="string"&&(t=MTt(t)),typeof t=="object"&&(o6(t.r)&&o6(t.g)&&o6(t.b)?(e=xTt(t.r,t.g,t.b),a=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):o6(t.h)&&o6(t.s)&&o6(t.v)?(o=AY(t.s),r=AY(t.v),e=STt(t.h,o,r),a=!0,l="hsv"):o6(t.h)&&o6(t.s)&&o6(t.l)&&(o=AY(t.s),i=AY(t.l),e=bTt(t.h,o,i),a=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=m_e(n),{ok:a,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var RTt="[-\\+]?\\d+%?",HTt="[-\\+]?\\d*\\.\\d+%?",y8="(?:".concat(HTt,")|(?:").concat(RTt,")"),Fre="[\\s|\\(]+(".concat(y8,")[,|\\s]+(").concat(y8,")[,|\\s]+(").concat(y8,")\\s*\\)?"),kre="[\\s|\\(]+(".concat(y8,")[,|\\s]+(").concat(y8,")[,|\\s]+(").concat(y8,")[,|\\s]+(").concat(y8,")\\s*\\)?"),Qy={CSS_UNIT:new RegExp(y8),rgb:new RegExp("rgb"+Fre),rgba:new RegExp("rgba"+kre),hsl:new RegExp("hsl"+Fre),hsla:new RegExp("hsla"+kre),hsv:new RegExp("hsv"+Fre),hsva:new RegExp("hsva"+kre),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function MTt(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(h0e[t])t=h0e[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Qy.rgb.exec(t);return n?{r:n[1],g:n[2],b:n[3]}:(n=Qy.rgba.exec(t),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Qy.hsl.exec(t),n?{h:n[1],s:n[2],l:n[3]}:(n=Qy.hsla.exec(t),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Qy.hsv.exec(t),n?{h:n[1],s:n[2],v:n[3]}:(n=Qy.hsva.exec(t),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Qy.hex8.exec(t),n?{r:X1(n[1]),g:X1(n[2]),b:X1(n[3]),a:Gwe(n[4]),format:e?"name":"hex8"}:(n=Qy.hex6.exec(t),n?{r:X1(n[1]),g:X1(n[2]),b:X1(n[3]),format:e?"name":"hex"}:(n=Qy.hex4.exec(t),n?{r:X1(n[1]+n[1]),g:X1(n[2]+n[2]),b:X1(n[3]+n[3]),a:Gwe(n[4]+n[4]),format:e?"name":"hex8"}:(n=Qy.hex3.exec(t),n?{r:X1(n[1]+n[1]),g:X1(n[2]+n[2]),b:X1(n[3]+n[3]),format:e?"name":"hex"}:!1)))))))))}function o6(t){return!!Qy.CSS_UNIT.exec(String(t))}var kl=function(){function t(e,n){e===void 0&&(e=""),n===void 0&&(n={});var o;if(e instanceof t)return e;typeof e=="number"&&(e=CTt(e)),this.originalInput=e;var r=A2(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(o=n.format)!==null&&o!==void 0?o:r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},t.prototype.getLuminance=function(){var e=this.toRgb(),n,o,r,i=e.r/255,a=e.g/255,l=e.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),a<=.03928?o=a/12.92:o=Math.pow((a+.055)/1.055,2.4),l<=.03928?r=l/12.92:r=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*o+.0722*r},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(e){return this.a=m_e(e),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},t.prototype.toHsv=function(){var e=HG(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},t.prototype.toHsvString=function(){var e=HG(this.r,this.g,this.b),n=Math.round(e.h*360),o=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(n,", ").concat(o,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(o,"%, ").concat(r,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var e=Vwe(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},t.prototype.toHslString=function(){var e=Vwe(this.r,this.g,this.b),n=Math.round(e.h*360),o=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(n,", ").concat(o,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(o,"%, ").concat(r,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(e){return e===void 0&&(e=!1),MG(this.r,this.g,this.b,e)},t.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},t.prototype.toHex8=function(e){return e===void 0&&(e=!1),TTt(this.r,this.g,this.b,this.a,e)},t.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},t.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var e=Math.round(this.r),n=Math.round(this.g),o=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(n,", ").concat(o,")"):"rgba(".concat(e,", ").concat(n,", ").concat(o,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var e=function(n){return"".concat(Math.round(yf(n,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var e=function(n){return Math.round(yf(n,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+MG(this.r,this.g,this.b,!1),n=0,o=Object.entries(h0e);n=0,i=!n&&r&&(e.startsWith("hex")||e==="name");return i?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(o=this.toRgbString()),e==="prgb"&&(o=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(o=this.toHexString()),e==="hex3"&&(o=this.toHexString(!0)),e==="hex4"&&(o=this.toHex8String(!0)),e==="hex8"&&(o=this.toHex8String()),e==="name"&&(o=this.toName()),e==="hsl"&&(o=this.toHslString()),e==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l+=e/100,n.l=yY(n.l),new t(n)},t.prototype.brighten=function(e){e===void 0&&(e=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),new t(n)},t.prototype.darken=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l-=e/100,n.l=yY(n.l),new t(n)},t.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},t.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},t.prototype.desaturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s-=e/100,n.s=yY(n.s),new t(n)},t.prototype.saturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s+=e/100,n.s=yY(n.s),new t(n)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var n=this.toHsl(),o=(n.h+e)%360;return n.h=o<0?360+o:o,new t(n)},t.prototype.mix=function(e,n){n===void 0&&(n=50);var o=this.toRgb(),r=new t(e).toRgb(),i=n/100,a={r:(r.r-o.r)*i+o.r,g:(r.g-o.g)*i+o.g,b:(r.b-o.b)*i+o.b,a:(r.a-o.a)*i+o.a};return new t(a)},t.prototype.analogous=function(e,n){e===void 0&&(e=6),n===void 0&&(n=30);var o=this.toHsl(),r=360/n,i=[this];for(o.h=(o.h-(r*e>>1)+720)%360;--e;)o.h=(o.h+r)%360,i.push(new t(o));return i},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var n=this.toHsv(),o=n.h,r=n.s,i=n.v,a=[],l=1/e;e--;)a.push(new t({h:o,s:r,v:i})),i=(i+l)%1;return a},t.prototype.splitcomplement=function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var n=this.toRgb(),o=new t(e).toRgb(),r=n.a+o.a*(1-n.a);return new t({r:(n.r*n.a+o.r*o.a*(1-n.a))/r,g:(n.g*n.a+o.g*o.a*(1-n.a))/r,b:(n.b*n.a+o.b*o.a*(1-n.a))/r,a:r})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var n=this.toHsl(),o=n.h,r=[this],i=360/e,a=1;a=60&&Math.round(t.h)<=240?o=n?Math.round(t.h)-wY*e:Math.round(t.h)+wY*e:o=n?Math.round(t.h)+wY*e:Math.round(t.h)-wY*e,o<0?o+=360:o>=360&&(o-=360),o}function qwe(t,e,n){if(t.h===0&&t.s===0)return t.s;var o;return n?o=t.s-Xwe*e:e===A_e?o=t.s+Xwe:o=t.s+ITt*e,o>1&&(o=1),n&&e===y_e&&o>.1&&(o=.1),o<.06&&(o=.06),Number(o.toFixed(2))}function $we(t,e,n){var o;return n?o=t.v+zTt*e:o=t.v-DTt*e,o>1&&(o=1),Number(o.toFixed(2))}function hR(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],o=A2(t),r=y_e;r>0;r-=1){var i=Jwe(o),a=vY(A2({h:Kwe(i,r,!0),s:qwe(i,r,!0),v:$we(i,r,!0)}));n.push(a)}n.push(vY(o));for(var l=1;l<=A_e;l+=1){var s=Jwe(o),c=vY(A2({h:Kwe(s,l),s:qwe(s,l),v:$we(s,l)}));n.push(c)}return e.theme==="dark"?ETt.map(function(u){var d=u.index,f=u.opacity,p=vY(FTt(A2(e.backgroundColor||"#141414"),A2(n[d]),f*100));return p}):n}var Lre={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},O_={},Wre={};Object.keys(Lre).forEach(function(t){O_[t]=hR(Lre[t]),O_[t].primary=O_[t][5],Wre[t]=hR(Lre[t],{theme:"dark",backgroundColor:"#141414"}),Wre[t].primary=Wre[t][5]});var kTt=O_.gold;const w_e={blue:"#1677ff",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#eb2f96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},QF=Object.assign(Object.assign({},w_e),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', -'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0});function LTt(t,e){let{generateColorPalettes:n,generateNeutralColorPalettes:o}=e;const{colorSuccess:r,colorWarning:i,colorError:a,colorInfo:l,colorPrimary:s,colorBgBase:c,colorTextBase:u}=t,d=n(s),f=n(r),p=n(i),g=n(a),y=n(l),w=o(c,u),b=t.colorLink||t.colorInfo,C=n(b);return Object.assign(Object.assign({},w),{colorPrimaryBg:d[1],colorPrimaryBgHover:d[2],colorPrimaryBorder:d[3],colorPrimaryBorderHover:d[4],colorPrimaryHover:d[5],colorPrimary:d[6],colorPrimaryActive:d[7],colorPrimaryTextHover:d[8],colorPrimaryText:d[9],colorPrimaryTextActive:d[10],colorSuccessBg:f[1],colorSuccessBgHover:f[2],colorSuccessBorder:f[3],colorSuccessBorderHover:f[4],colorSuccessHover:f[4],colorSuccess:f[6],colorSuccessActive:f[7],colorSuccessTextHover:f[8],colorSuccessText:f[9],colorSuccessTextActive:f[10],colorErrorBg:g[1],colorErrorBgHover:g[2],colorErrorBorder:g[3],colorErrorBorderHover:g[4],colorErrorHover:g[5],colorError:g[6],colorErrorActive:g[7],colorErrorTextHover:g[8],colorErrorText:g[9],colorErrorTextActive:g[10],colorWarningBg:p[1],colorWarningBgHover:p[2],colorWarningBorder:p[3],colorWarningBorderHover:p[4],colorWarningHover:p[4],colorWarning:p[6],colorWarningActive:p[7],colorWarningTextHover:p[8],colorWarningText:p[9],colorWarningTextActive:p[10],colorInfoBg:y[1],colorInfoBgHover:y[2],colorInfoBorder:y[3],colorInfoBorderHover:y[4],colorInfoHover:y[4],colorInfo:y[6],colorInfoActive:y[7],colorInfoTextHover:y[8],colorInfoText:y[9],colorInfoTextActive:y[10],colorLinkHover:C[4],colorLink:C[6],colorLinkActive:C[7],colorBgMask:new kl("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}const WTt=t=>{let e=t,n=t,o=t,r=t;return t<6&&t>=5?e=t+1:t<16&&t>=6?e=t+2:t>=16&&(e=16),t<7&&t>=5?n=4:t<8&&t>=7?n=5:t<14&&t>=8?n=6:t<16&&t>=14?n=7:t>=16&&(n=8),t<6&&t>=2?o=1:t>=6&&(o=2),t>4&&t<8?r=4:t>=8&&(r=6),{borderRadius:t,borderRadiusXS:o,borderRadiusSM:n,borderRadiusLG:e,borderRadiusOuter:r}};function NTt(t){const{motionUnit:e,motionBase:n,borderRadius:o,lineWidth:r}=t;return Object.assign({motionDurationFast:`${(n+e).toFixed(1)}s`,motionDurationMid:`${(n+e*2).toFixed(1)}s`,motionDurationSlow:`${(n+e*3).toFixed(1)}s`,lineWidthBold:r+1},WTt(o))}const UTt=t=>{const{controlHeight:e}=t;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}};function O_(t){return(t+8)/t}function jTt(t){const e=new Array(10).fill(null).map((n,o)=>{const r=o-1,i=t*Math.pow(2.71828,r/5),a=o>1?Math.floor(i):Math.ceil(i);return Math.floor(a/2)*2});return e[1]=t,e.map(n=>({size:n,lineHeight:O_(n)}))}const BTt=t=>{const e=jTt(t),n=e.map(u=>u.size),o=e.map(u=>u.lineHeight),r=n[1],i=n[0],a=n[2],l=o[1],s=o[0],c=o[2];return{fontSizeSM:i,fontSize:r,fontSizeLG:a,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:l,lineHeightLG:c,lineHeightSM:s,fontHeight:Math.round(l*r),fontHeightLG:Math.round(c*a),fontHeightSM:Math.round(s*i),lineHeightHeading1:o[6],lineHeightHeading2:o[5],lineHeightHeading3:o[4],lineHeightHeading4:o[3],lineHeightHeading5:o[2]}};function YTt(t){const{sizeUnit:e,sizeStep:n}=t;return{sizeXXL:e*(n+8),sizeXL:e*(n+4),sizeLG:e*(n+2),sizeMD:e*(n+1),sizeMS:e*n,size:e*n,sizeSM:e*(n-1),sizeXS:e*(n-2),sizeXXS:e*(n-3)}}const r6=(t,e)=>new kl(t).setAlpha(e).toRgbString(),zz=(t,e)=>new kl(t).darken(e).toHexString(),OTt=t=>{const e=hR(t);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},_Tt=(t,e)=>{const n=t||"#fff",o=e||"#000";return{colorBgBase:n,colorTextBase:o,colorText:r6(o,.88),colorTextSecondary:r6(o,.65),colorTextTertiary:r6(o,.45),colorTextQuaternary:r6(o,.25),colorFill:r6(o,.15),colorFillSecondary:r6(o,.06),colorFillTertiary:r6(o,.04),colorFillQuaternary:r6(o,.02),colorBgLayout:zz(n,4),colorBgContainer:zz(n,0),colorBgElevated:zz(n,0),colorBgSpotlight:r6(o,.85),colorBgBlur:"transparent",colorBorder:zz(n,15),colorBorderSecondary:zz(n,6)}};function VTt(t){const e=Object.keys(w_e).map(n=>{const o=hR(t[n]);return new Array(10).fill(1).reduce((r,i,a)=>(r[`${n}-${a+1}`]=o[a],r[`${n}${a+1}`]=o[a],r),{})}).reduce((n,o)=>(n=Object.assign(Object.assign({},n),o),n),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),e),LTt(t,{generateColorPalettes:OTt,generateNeutralColorPalettes:_Tt})),BTt(t.fontSize)),YTt(t)),UTt(t)),NTt(t))}const v_e=i0e(VTt),p0e={token:QF,override:{override:QF},hashed:!0},x_e=be.createContext(p0e),ime="anticon",GTt=(t,e)=>e||(t?`ant-${t}`:"ant"),Cr=m.createContext({getPrefixCls:GTt,iconPrefixCls:ime});function MW(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function XTt(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}var $we="data-rc-order",Qwe="data-rc-priority",JTt="rc-util-key",g0e=new Map;function b_e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):JTt}function ame(t){if(t.attachTo)return t.attachTo;var e=document.querySelector("head");return e||document.body}function KTt(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function lme(t){return Array.from((g0e.get(t)||t).children).filter(function(e){return e.tagName==="STYLE"})}function S_e(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!MW())return null;var n=e.csp,o=e.prepend,r=e.priority,i=r===void 0?0:r,a=KTt(o),l=a==="prependQueue",s=document.createElement("style");s.setAttribute($we,a),l&&i&&s.setAttribute(Qwe,"".concat(i)),n!=null&&n.nonce&&(s.nonce=n==null?void 0:n.nonce),s.innerHTML=t;var c=ame(e),u=c.firstChild;if(o){if(l){var d=(e.styles||lme(c)).filter(function(f){if(!["prepend","prependQueue"].includes(f.getAttribute($we)))return!1;var p=Number(f.getAttribute(Qwe)||0);return i>=p});if(d.length)return c.insertBefore(s,d[d.length-1].nextSibling),s}c.insertBefore(s,u)}else c.appendChild(s);return s}function qTt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=ame(e);return(e.styles||lme(n)).find(function(o){return o.getAttribute(b_e(e))===t})}function $Tt(t,e){var n=g0e.get(t);if(!n||!XTt(document,n)){var o=S_e("",e),r=o.parentNode;g0e.set(t,r),t.removeChild(o)}}function QTt(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=ame(n),r=lme(o),i=uR(uR({},n),{},{styles:r});$Tt(o,i);var a=qTt(e,i);if(a){var l,s;if((l=i.csp)!==null&&l!==void 0&&l.nonce&&a.nonce!==((s=i.csp)===null||s===void 0?void 0:s.nonce)){var c;a.nonce=(c=i.csp)===null||c===void 0?void 0:c.nonce}return a.innerHTML!==t&&(a.innerHTML=t),a}var u=S_e(t,i);return u.setAttribute(b_e(i),e),u}const ZTt=`-ant-${Date.now()}-${Math.random()}`;function ePt(t,e){const n={},o=(a,l)=>{let s=a.clone();return s=(l==null?void 0:l(s))||s,s.toRgbString()},r=(a,l)=>{const s=new kl(a),c=hR(s.toRgbString());n[`${l}-color`]=o(s),n[`${l}-color-disabled`]=c[1],n[`${l}-color-hover`]=c[4],n[`${l}-color-active`]=c[6],n[`${l}-color-outline`]=s.clone().setAlpha(.2).toRgbString(),n[`${l}-color-deprecated-bg`]=c[0],n[`${l}-color-deprecated-border`]=c[2]};if(e.primaryColor){r(e.primaryColor,"primary");const a=new kl(e.primaryColor),l=hR(a.toRgbString());l.forEach((c,u)=>{n[`primary-${u+1}`]=c}),n["primary-color-deprecated-l-35"]=o(a,c=>c.lighten(35)),n["primary-color-deprecated-l-20"]=o(a,c=>c.lighten(20)),n["primary-color-deprecated-t-20"]=o(a,c=>c.tint(20)),n["primary-color-deprecated-t-50"]=o(a,c=>c.tint(50)),n["primary-color-deprecated-f-12"]=o(a,c=>c.setAlpha(c.getAlpha()*.12));const s=new kl(l[0]);n["primary-color-active-deprecated-f-30"]=o(s,c=>c.setAlpha(c.getAlpha()*.3)),n["primary-color-active-deprecated-d-02"]=o(s,c=>c.darken(2))}return e.successColor&&r(e.successColor,"success"),e.warningColor&&r(e.warningColor,"warning"),e.errorColor&&r(e.errorColor,"error"),e.infoColor&&r(e.infoColor,"info"),` +'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0});function LTt(t,e){let{generateColorPalettes:n,generateNeutralColorPalettes:o}=e;const{colorSuccess:r,colorWarning:i,colorError:a,colorInfo:l,colorPrimary:s,colorBgBase:c,colorTextBase:u}=t,d=n(s),f=n(r),p=n(i),g=n(a),y=n(l),w=o(c,u),b=t.colorLink||t.colorInfo,C=n(b);return Object.assign(Object.assign({},w),{colorPrimaryBg:d[1],colorPrimaryBgHover:d[2],colorPrimaryBorder:d[3],colorPrimaryBorderHover:d[4],colorPrimaryHover:d[5],colorPrimary:d[6],colorPrimaryActive:d[7],colorPrimaryTextHover:d[8],colorPrimaryText:d[9],colorPrimaryTextActive:d[10],colorSuccessBg:f[1],colorSuccessBgHover:f[2],colorSuccessBorder:f[3],colorSuccessBorderHover:f[4],colorSuccessHover:f[4],colorSuccess:f[6],colorSuccessActive:f[7],colorSuccessTextHover:f[8],colorSuccessText:f[9],colorSuccessTextActive:f[10],colorErrorBg:g[1],colorErrorBgHover:g[2],colorErrorBorder:g[3],colorErrorBorderHover:g[4],colorErrorHover:g[5],colorError:g[6],colorErrorActive:g[7],colorErrorTextHover:g[8],colorErrorText:g[9],colorErrorTextActive:g[10],colorWarningBg:p[1],colorWarningBgHover:p[2],colorWarningBorder:p[3],colorWarningBorderHover:p[4],colorWarningHover:p[4],colorWarning:p[6],colorWarningActive:p[7],colorWarningTextHover:p[8],colorWarningText:p[9],colorWarningTextActive:p[10],colorInfoBg:y[1],colorInfoBgHover:y[2],colorInfoBorder:y[3],colorInfoBorderHover:y[4],colorInfoHover:y[4],colorInfo:y[6],colorInfoActive:y[7],colorInfoTextHover:y[8],colorInfoText:y[9],colorInfoTextActive:y[10],colorLinkHover:C[4],colorLink:C[6],colorLinkActive:C[7],colorBgMask:new kl("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}const WTt=t=>{let e=t,n=t,o=t,r=t;return t<6&&t>=5?e=t+1:t<16&&t>=6?e=t+2:t>=16&&(e=16),t<7&&t>=5?n=4:t<8&&t>=7?n=5:t<14&&t>=8?n=6:t<16&&t>=14?n=7:t>=16&&(n=8),t<6&&t>=2?o=1:t>=6&&(o=2),t>4&&t<8?r=4:t>=8&&(r=6),{borderRadius:t,borderRadiusXS:o,borderRadiusSM:n,borderRadiusLG:e,borderRadiusOuter:r}};function NTt(t){const{motionUnit:e,motionBase:n,borderRadius:o,lineWidth:r}=t;return Object.assign({motionDurationFast:`${(n+e).toFixed(1)}s`,motionDurationMid:`${(n+e*2).toFixed(1)}s`,motionDurationSlow:`${(n+e*3).toFixed(1)}s`,lineWidthBold:r+1},WTt(o))}const UTt=t=>{const{controlHeight:e}=t;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}};function __(t){return(t+8)/t}function jTt(t){const e=new Array(10).fill(null).map((n,o)=>{const r=o-1,i=t*Math.pow(2.71828,r/5),a=o>1?Math.floor(i):Math.ceil(i);return Math.floor(a/2)*2});return e[1]=t,e.map(n=>({size:n,lineHeight:__(n)}))}const BTt=t=>{const e=jTt(t),n=e.map(u=>u.size),o=e.map(u=>u.lineHeight),r=n[1],i=n[0],a=n[2],l=o[1],s=o[0],c=o[2];return{fontSizeSM:i,fontSize:r,fontSizeLG:a,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:l,lineHeightLG:c,lineHeightSM:s,fontHeight:Math.round(l*r),fontHeightLG:Math.round(c*a),fontHeightSM:Math.round(s*i),lineHeightHeading1:o[6],lineHeightHeading2:o[5],lineHeightHeading3:o[4],lineHeightHeading4:o[3],lineHeightHeading5:o[2]}};function YTt(t){const{sizeUnit:e,sizeStep:n}=t;return{sizeXXL:e*(n+8),sizeXL:e*(n+4),sizeLG:e*(n+2),sizeMD:e*(n+1),sizeMS:e*n,size:e*n,sizeSM:e*(n-1),sizeXS:e*(n-2),sizeXXS:e*(n-3)}}const r6=(t,e)=>new kl(t).setAlpha(e).toRgbString(),zz=(t,e)=>new kl(t).darken(e).toHexString(),OTt=t=>{const e=hR(t);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},_Tt=(t,e)=>{const n=t||"#fff",o=e||"#000";return{colorBgBase:n,colorTextBase:o,colorText:r6(o,.88),colorTextSecondary:r6(o,.65),colorTextTertiary:r6(o,.45),colorTextQuaternary:r6(o,.25),colorFill:r6(o,.15),colorFillSecondary:r6(o,.06),colorFillTertiary:r6(o,.04),colorFillQuaternary:r6(o,.02),colorBgLayout:zz(n,4),colorBgContainer:zz(n,0),colorBgElevated:zz(n,0),colorBgSpotlight:r6(o,.85),colorBgBlur:"transparent",colorBorder:zz(n,15),colorBorderSecondary:zz(n,6)}};function VTt(t){const e=Object.keys(w_e).map(n=>{const o=hR(t[n]);return new Array(10).fill(1).reduce((r,i,a)=>(r[`${n}-${a+1}`]=o[a],r[`${n}${a+1}`]=o[a],r),{})}).reduce((n,o)=>(n=Object.assign(Object.assign({},n),o),n),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),e),LTt(t,{generateColorPalettes:OTt,generateNeutralColorPalettes:_Tt})),BTt(t.fontSize)),YTt(t)),UTt(t)),NTt(t))}const v_e=i0e(VTt),p0e={token:QF,override:{override:QF},hashed:!0},x_e=be.createContext(p0e),ame="anticon",GTt=(t,e)=>e||(t?`ant-${t}`:"ant"),Cr=m.createContext({getPrefixCls:GTt,iconPrefixCls:ame});function IW(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function XTt(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}var Qwe="data-rc-order",Zwe="data-rc-priority",JTt="rc-util-key",g0e=new Map;function b_e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):JTt}function lme(t){if(t.attachTo)return t.attachTo;var e=document.querySelector("head");return e||document.body}function KTt(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function sme(t){return Array.from((g0e.get(t)||t).children).filter(function(e){return e.tagName==="STYLE"})}function S_e(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!IW())return null;var n=e.csp,o=e.prepend,r=e.priority,i=r===void 0?0:r,a=KTt(o),l=a==="prependQueue",s=document.createElement("style");s.setAttribute(Qwe,a),l&&i&&s.setAttribute(Zwe,"".concat(i)),n!=null&&n.nonce&&(s.nonce=n==null?void 0:n.nonce),s.innerHTML=t;var c=lme(e),u=c.firstChild;if(o){if(l){var d=(e.styles||sme(c)).filter(function(f){if(!["prepend","prependQueue"].includes(f.getAttribute(Qwe)))return!1;var p=Number(f.getAttribute(Zwe)||0);return i>=p});if(d.length)return c.insertBefore(s,d[d.length-1].nextSibling),s}c.insertBefore(s,u)}else c.appendChild(s);return s}function qTt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=lme(e);return(e.styles||sme(n)).find(function(o){return o.getAttribute(b_e(e))===t})}function $Tt(t,e){var n=g0e.get(t);if(!n||!XTt(document,n)){var o=S_e("",e),r=o.parentNode;g0e.set(t,r),t.removeChild(o)}}function QTt(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=lme(n),r=sme(o),i=uR(uR({},n),{},{styles:r});$Tt(o,i);var a=qTt(e,i);if(a){var l,s;if((l=i.csp)!==null&&l!==void 0&&l.nonce&&a.nonce!==((s=i.csp)===null||s===void 0?void 0:s.nonce)){var c;a.nonce=(c=i.csp)===null||c===void 0?void 0:c.nonce}return a.innerHTML!==t&&(a.innerHTML=t),a}var u=S_e(t,i);return u.setAttribute(b_e(i),e),u}const ZTt=`-ant-${Date.now()}-${Math.random()}`;function ePt(t,e){const n={},o=(a,l)=>{let s=a.clone();return s=(l==null?void 0:l(s))||s,s.toRgbString()},r=(a,l)=>{const s=new kl(a),c=hR(s.toRgbString());n[`${l}-color`]=o(s),n[`${l}-color-disabled`]=c[1],n[`${l}-color-hover`]=c[4],n[`${l}-color-active`]=c[6],n[`${l}-color-outline`]=s.clone().setAlpha(.2).toRgbString(),n[`${l}-color-deprecated-bg`]=c[0],n[`${l}-color-deprecated-border`]=c[2]};if(e.primaryColor){r(e.primaryColor,"primary");const a=new kl(e.primaryColor),l=hR(a.toRgbString());l.forEach((c,u)=>{n[`primary-${u+1}`]=c}),n["primary-color-deprecated-l-35"]=o(a,c=>c.lighten(35)),n["primary-color-deprecated-l-20"]=o(a,c=>c.lighten(20)),n["primary-color-deprecated-t-20"]=o(a,c=>c.tint(20)),n["primary-color-deprecated-t-50"]=o(a,c=>c.tint(50)),n["primary-color-deprecated-f-12"]=o(a,c=>c.setAlpha(c.getAlpha()*.12));const s=new kl(l[0]);n["primary-color-active-deprecated-f-30"]=o(s,c=>c.setAlpha(c.getAlpha()*.3)),n["primary-color-active-deprecated-d-02"]=o(s,c=>c.darken(2))}return e.successColor&&r(e.successColor,"success"),e.warningColor&&r(e.warningColor,"warning"),e.errorColor&&r(e.errorColor,"error"),e.infoColor&&r(e.infoColor,"info"),` :root { ${Object.keys(n).map(a=>`--${t}-${a}: ${n[a]};`).join(` `)} } - `.trim()}function tPt(t,e){const n=ePt(t,e);MW()&&QTt(n,`${ZTt}-dynamic-theme`)}const n1=m.createContext(!1),T_e=t=>{let{children:e,disabled:n}=t;const o=m.useContext(n1);return m.createElement(n1.Provider,{value:n??o},e)},pR=m.createContext(void 0),nPt=t=>{let{children:e,size:n}=t;const o=m.useContext(pR);return m.createElement(pR.Provider,{value:n||o},e)};function oPt(){const t=m.useContext(n1),e=m.useContext(pR);return{componentDisabled:t,componentSize:e}}function m0e(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=new Set;function r(i,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,s=o.has(i);if(s)return!1;if(i===a)return!0;if(n&&l>1)return!1;o.add(i);var c=l+1;if(Array.isArray(i)){if(!Array.isArray(a)||i.length!==a.length)return!1;for(var u=0;u=0&&t<=255}function vY(t,e){const{r:n,g:o,b:r,a:i}=new kl(t).toRgb();if(i<1)return t;const{r:a,g:l,b:s}=new kl(e).toRgb();for(let c=.01;c<=1;c+=.01){const u=Math.round((n-a*(1-c))/c),d=Math.round((o-l*(1-c))/c),f=Math.round((r-s*(1-c))/c);if(Nre(u)&&Nre(d)&&Nre(f))return new kl({r:u,g:d,b:f,a:Math.round(c*100)/100}).toRgbString()}return new kl({r:n,g:o,b:r,a:1}).toRgbString()}var iPt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{delete o[f]});const r=Object.assign(Object.assign({},n),o),i=480,a=576,l=768,s=992,c=1200,u=1600;if(r.motion===!1){const f="0s";r.motionDurationFast=f,r.motionDurationMid=f,r.motionDurationSlow=f}return Object.assign(Object.assign(Object.assign({},r),{colorFillContent:r.colorFillSecondary,colorFillContentHover:r.colorFill,colorFillAlter:r.colorFillQuaternary,colorBgContainerDisabled:r.colorFillTertiary,colorBorderBg:r.colorBgContainer,colorSplit:vY(r.colorBorderSecondary,r.colorBgContainer),colorTextPlaceholder:r.colorTextQuaternary,colorTextDisabled:r.colorTextQuaternary,colorTextHeading:r.colorText,colorTextLabel:r.colorTextSecondary,colorTextDescription:r.colorTextTertiary,colorTextLightSolid:r.colorWhite,colorHighlight:r.colorError,colorBgTextHover:r.colorFillSecondary,colorBgTextActive:r.colorFill,colorIcon:r.colorTextTertiary,colorIconHover:r.colorText,colorErrorOutline:vY(r.colorErrorBg,r.colorBgContainer),colorWarningOutline:vY(r.colorWarningBg,r.colorBgContainer),fontSizeIcon:r.fontSizeSM,lineWidthFocus:r.lineWidth*4,lineWidth:r.lineWidth,controlOutlineWidth:r.lineWidth*2,controlInteractiveSize:r.controlHeight/2,controlItemBgHover:r.colorFillTertiary,controlItemBgActive:r.colorPrimaryBg,controlItemBgActiveHover:r.colorPrimaryBgHover,controlItemBgActiveDisabled:r.colorFill,controlTmpOutline:r.colorFillQuaternary,controlOutline:vY(r.colorPrimaryBg,r.colorBgContainer),lineType:r.lineType,borderRadius:r.borderRadius,borderRadiusXS:r.borderRadiusXS,borderRadiusSM:r.borderRadiusSM,borderRadiusLG:r.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:r.sizeXXS,paddingXS:r.sizeXS,paddingSM:r.sizeSM,padding:r.size,paddingMD:r.sizeMD,paddingLG:r.sizeLG,paddingXL:r.sizeXL,paddingContentHorizontalLG:r.sizeLG,paddingContentVerticalLG:r.sizeMS,paddingContentHorizontal:r.sizeMS,paddingContentVertical:r.sizeSM,paddingContentHorizontalSM:r.size,paddingContentVerticalSM:r.sizeXS,marginXXS:r.sizeXXS,marginXS:r.sizeXS,marginSM:r.sizeSM,margin:r.size,marginMD:r.sizeMD,marginLG:r.sizeLG,marginXL:r.sizeXL,marginXXL:r.sizeXXL,boxShadow:` + `.trim()}function tPt(t,e){const n=ePt(t,e);IW()&&QTt(n,`${ZTt}-dynamic-theme`)}const n1=m.createContext(!1),T_e=t=>{let{children:e,disabled:n}=t;const o=m.useContext(n1);return m.createElement(n1.Provider,{value:n??o},e)},pR=m.createContext(void 0),nPt=t=>{let{children:e,size:n}=t;const o=m.useContext(pR);return m.createElement(pR.Provider,{value:n||o},e)};function oPt(){const t=m.useContext(n1),e=m.useContext(pR);return{componentDisabled:t,componentSize:e}}function m0e(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=new Set;function r(i,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,s=o.has(i);if(s)return!1;if(i===a)return!0;if(n&&l>1)return!1;o.add(i);var c=l+1;if(Array.isArray(i)){if(!Array.isArray(a)||i.length!==a.length)return!1;for(var u=0;u=0&&t<=255}function xY(t,e){const{r:n,g:o,b:r,a:i}=new kl(t).toRgb();if(i<1)return t;const{r:a,g:l,b:s}=new kl(e).toRgb();for(let c=.01;c<=1;c+=.01){const u=Math.round((n-a*(1-c))/c),d=Math.round((o-l*(1-c))/c),f=Math.round((r-s*(1-c))/c);if(Nre(u)&&Nre(d)&&Nre(f))return new kl({r:u,g:d,b:f,a:Math.round(c*100)/100}).toRgbString()}return new kl({r:n,g:o,b:r,a:1}).toRgbString()}var iPt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{delete o[f]});const r=Object.assign(Object.assign({},n),o),i=480,a=576,l=768,s=992,c=1200,u=1600;if(r.motion===!1){const f="0s";r.motionDurationFast=f,r.motionDurationMid=f,r.motionDurationSlow=f}return Object.assign(Object.assign(Object.assign({},r),{colorFillContent:r.colorFillSecondary,colorFillContentHover:r.colorFill,colorFillAlter:r.colorFillQuaternary,colorBgContainerDisabled:r.colorFillTertiary,colorBorderBg:r.colorBgContainer,colorSplit:xY(r.colorBorderSecondary,r.colorBgContainer),colorTextPlaceholder:r.colorTextQuaternary,colorTextDisabled:r.colorTextQuaternary,colorTextHeading:r.colorText,colorTextLabel:r.colorTextSecondary,colorTextDescription:r.colorTextTertiary,colorTextLightSolid:r.colorWhite,colorHighlight:r.colorError,colorBgTextHover:r.colorFillSecondary,colorBgTextActive:r.colorFill,colorIcon:r.colorTextTertiary,colorIconHover:r.colorText,colorErrorOutline:xY(r.colorErrorBg,r.colorBgContainer),colorWarningOutline:xY(r.colorWarningBg,r.colorBgContainer),fontSizeIcon:r.fontSizeSM,lineWidthFocus:r.lineWidth*4,lineWidth:r.lineWidth,controlOutlineWidth:r.lineWidth*2,controlInteractiveSize:r.controlHeight/2,controlItemBgHover:r.colorFillTertiary,controlItemBgActive:r.colorPrimaryBg,controlItemBgActiveHover:r.colorPrimaryBgHover,controlItemBgActiveDisabled:r.colorFill,controlTmpOutline:r.colorFillQuaternary,controlOutline:xY(r.colorPrimaryBg,r.colorBgContainer),lineType:r.lineType,borderRadius:r.borderRadius,borderRadiusXS:r.borderRadiusXS,borderRadiusSM:r.borderRadiusSM,borderRadiusLG:r.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:r.sizeXXS,paddingXS:r.sizeXS,paddingSM:r.sizeSM,padding:r.size,paddingMD:r.sizeMD,paddingLG:r.sizeLG,paddingXL:r.sizeXL,paddingContentHorizontalLG:r.sizeLG,paddingContentVerticalLG:r.sizeMS,paddingContentHorizontal:r.sizeMS,paddingContentVertical:r.sizeSM,paddingContentHorizontalSM:r.size,paddingContentVerticalSM:r.sizeXS,marginXXS:r.sizeXXS,marginXS:r.sizeXS,marginSM:r.sizeSM,margin:r.size,marginMD:r.sizeMD,marginLG:r.sizeLG,marginXL:r.sizeXL,marginXXL:r.sizeXXL,boxShadow:` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) @@ -4364,7 +4364,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho 0 -6px 16px 0 rgba(0, 0, 0, 0.08), 0 -3px 6px -4px rgba(0, 0, 0, 0.12), 0 -9px 28px 8px rgba(0, 0, 0, 0.05) - `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),o)}var Zwe=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const o=n.getDerivativeToken(t),{override:r}=e,i=Zwe(e,["override"]);let a=Object.assign(Object.assign({},o),{override:r});return a=P_e(a),i&&Object.entries(i).forEach(l=>{let[s,c]=l;const{theme:u}=c,d=Zwe(c,["theme"]);let f=d;u&&(f=H_e(Object.assign(Object.assign({},a),d),{override:d},u)),a[s]=f}),a};function _u(){const{token:t,hashed:e,theme:n,override:o,cssVar:r}=be.useContext(x_e),i=`${rPt}-${e||""}`,a=n||v_e,[l,s,c]=MSt(a,[QF,t],{salt:i,override:o,getComputedToken:H_e,formatToken:P_e,cssVar:r&&{prefix:r.prefix,key:r.key,unitless:C_e,ignore:R_e,preserve:aPt}});return[a,c,e?s:"",l,r]}function sme(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gR(t){"@babel/helpers - typeof";return gR=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},gR(t)}function lPt(t,e){if(gR(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(gR(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function sPt(t){var e=lPt(t,"string");return gR(e)=="symbol"?e:e+""}function cPt(t,e){for(var n=0;n{const e=t==="css"?hPt:pPt;return n=>new e(n)};function q6(t){var e=m.useRef();e.current=t;var n=m.useCallback(function(){for(var o,r=arguments.length,i=new Array(r),a=0;a{const o=n.getDerivativeToken(t),{override:r}=e,i=e7e(e,["override"]);let a=Object.assign(Object.assign({},o),{override:r});return a=P_e(a),i&&Object.entries(i).forEach(l=>{let[s,c]=l;const{theme:u}=c,d=e7e(c,["theme"]);let f=d;u&&(f=H_e(Object.assign(Object.assign({},a),d),{override:d},u)),a[s]=f}),a};function _u(){const{token:t,hashed:e,theme:n,override:o,cssVar:r}=be.useContext(x_e),i=`${rPt}-${e||""}`,a=n||v_e,[l,s,c]=MSt(a,[QF,t],{salt:i,override:o,getComputedToken:H_e,formatToken:P_e,cssVar:r&&{prefix:r.prefix,key:r.key,unitless:C_e,ignore:R_e,preserve:aPt}});return[a,c,e?s:"",l,r]}function cme(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gR(t){"@babel/helpers - typeof";return gR=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},gR(t)}function lPt(t,e){if(gR(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(gR(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function sPt(t){var e=lPt(t,"string");return gR(e)=="symbol"?e:e+""}function cPt(t,e){for(var n=0;n{const e=t==="css"?hPt:pPt;return n=>new e(n)};function q6(t){var e=m.useRef();e.current=t;var n=m.useCallback(function(){for(var o,r=arguments.length,i=new Array(r),a=0;a({color:t.colorLink,textDecoration:"none",outline:"none",cursor:"pointer",transition:`color ${t.motionDurationSlow}`,"&:focus, &:hover":{color:t.colorLinkHover},"&:active":{color:t.colorLinkActive}}),Gx={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},ja=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return{boxSizing:"border-box",margin:0,padding:0,color:t.colorText,fontSize:t.fontSize,lineHeight:t.lineHeight,listStyle:"none",fontFamily:e?"inherit":t.fontFamily}},WH=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),ek=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),bPt=t=>({a:{color:t.colorLink,textDecoration:t.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${t.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:t.colorLinkHover},"&:active":{color:t.colorLinkActive},"&:active,\n &:hover":{textDecoration:t.linkHoverDecoration,outline:0},"&:focus":{textDecoration:t.linkFocusDecoration,outline:0},"&[disabled]":{color:t.colorTextDisabled,cursor:"not-allowed"}}}),SPt=(t,e,n,o)=>{const r=`[class^="${e}"], [class*=" ${e}"]`,i=n?`.${n}`:r,a={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let l={};return o!==!1&&(l={fontFamily:t.fontFamily,fontSize:t.fontSize}),{[i]:Object.assign(Object.assign(Object.assign({},l),a),{[r]:a})}},lw=t=>({outline:`${Nt(t.lineWidthFocus)} solid ${t.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),Q6=t=>({"&:focus-visible":Object.assign({},lw(t))});function TPt(t){return t==="js"?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,n=new Array(e),o=0;oNt(r)).join(",")})`},min:function(){for(var e=arguments.length,n=new Array(e),o=0;oNt(r)).join(",")})`}}}const W_e=typeof CSSINJS_STATISTIC<"u";let v0e=!0;function Ki(){for(var t=arguments.length,e=new Array(t),n=0;n{Object.keys(r).forEach(a=>{Object.defineProperty(o,a,{configurable:!0,enumerable:!0,get:()=>r[a]})})}),v0e=!0,o}const n7e={};function PPt(){}const CPt=t=>{let e,n=t,o=PPt;return W_e&&typeof Proxy<"u"&&(e=new Set,n=new Proxy(t,{get(r,i){return v0e&&e.add(i),r[i]}}),o=(r,i)=>{var a;n7e[r]={global:Array.from(e),component:Object.assign(Object.assign({},(a=n7e[r])===null||a===void 0?void 0:a.component),i)}}),{token:n,keys:e,flush:o}},N_e=(t,e)=>{const[n,o]=_u();return u0e({theme:n,token:o,hashId:"",path:["ant-design-icons",t],nonce:()=>e==null?void 0:e.nonce,layer:{name:"antd"}},()=>[{[`.${t}`]:Object.assign(Object.assign({},WH()),{[`.${t} .${t}-icon`]:{display:"block"}})}])},U_e=(t,e,n)=>{var o;return typeof n=="function"?n(Ki(e,(o=e[t])!==null&&o!==void 0?o:{})):n??{}},j_e=(t,e,n,o)=>{const r=Object.assign({},e[t]);if(o!=null&&o.deprecatedTokens){const{deprecatedTokens:a}=o;a.forEach(l=>{let[s,c]=l;var u;(r!=null&&r[s]||r!=null&&r[c])&&((u=r[c])!==null&&u!==void 0||(r[c]=r==null?void 0:r[s]))})}const i=Object.assign(Object.assign({},n),r);return Object.keys(i).forEach(a=>{i[a]===e[a]&&delete i[a]}),i},RPt=(t,e)=>`${[e,t.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-")}`;function hme(t,e,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=Array.isArray(t)?t:[t,t],[i]=r,a=r.join("-");return function(l){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;const[c,u,d,f,p]=_u(),{getPrefixCls:g,iconPrefixCls:y,csp:w}=m.useContext(Cr),b=g(),C=p?"css":"js",P=gPt(C),{max:v,min:T}=TPt(C),A={theme:c,token:f,hashId:d,nonce:()=>w==null?void 0:w.nonce,clientOnly:o.clientOnly,layer:{name:"antd"},order:o.order||-999};return u0e(Object.assign(Object.assign({},A),{clientOnly:!1,path:["Shared",b]}),()=>[{"&":bPt(f)}]),N_e(y,w),[u0e(Object.assign(Object.assign({},A),{path:[a,l,y]}),()=>{if(o.injectStyle===!1)return[];const{token:S,flush:R}=CPt(f),M=U_e(i,u,n),D=`.${l}`,E=j_e(i,u,M,{deprecatedTokens:o.deprecatedTokens});p&&Object.keys(M).forEach(L=>{M[L]=`var(${JOe(L,RPt(i,p.prefix))})`});const W=Ki(S,{componentCls:D,prefixCls:l,iconCls:`.${y}`,antCls:`.${b}`,calc:P,max:v,min:T},p?M:E),j=e(W,{hashId:d,prefixCls:l,rootPrefixCls:b,iconPrefixCls:y});return R(i,E),[o.resetStyle===!1?null:SPt(W,l,s,o.resetFont),j]}),d]}}const IW=(t,e,n,o)=>{const r=hme(t,e,n,Object.assign({resetStyle:!1,order:-998},o));return a=>{let{prefixCls:l,rootCls:s=l}=a;return r(l,s),null}},HPt=(t,e,n)=>{function o(c){return`${t}${c.slice(0,1).toUpperCase()}${c.slice(1)}`}const{unitless:r={},injectStyle:i=!0}=n??{},a={[o("zIndexPopup")]:!0};Object.keys(r).forEach(c=>{a[o(c)]=r[c]});const l=c=>{let{rootCls:u,cssVar:d}=c;const[,f]=_u();return rTt({path:[t],prefix:d.prefix,key:d==null?void 0:d.key,unitless:Object.assign(Object.assign({},C_e),a),ignore:R_e,token:f,scope:u},()=>{const p=U_e(t,f,e),g=j_e(t,f,p,{deprecatedTokens:n==null?void 0:n.deprecatedTokens});return Object.keys(p).forEach(y=>{g[o(y)]=g[y],delete g[y]}),g}),null};return c=>{const[,,,,u]=_u();return[d=>i&&u?be.createElement(be.Fragment,null,be.createElement(l,{rootCls:c,cssVar:u,component:t}),d):d,u==null?void 0:u.key]}},wl=(t,e,n,o)=>{const r=hme(t,e,n,o),i=HPt(Array.isArray(t)?t[0]:t,n,o);return function(a){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a;const[,s]=r(a,l),[c,u]=i(l);return[c,s,u]}};function D$(t,e){return ZF.reduce((n,o)=>{const r=t[`${o}1`],i=t[`${o}3`],a=t[`${o}6`],l=t[`${o}7`];return Object.assign(Object.assign({},n),e(o,{lightColor:r,lightBorderColor:i,darkColor:a,textColor:l}))},{})}const MPt=Object.assign({},MK),{useId:o7e}=MPt,IPt=()=>"",zPt=typeof o7e>"u"?IPt:o7e;function DPt(t,e,n){var o;kb();const r=t||{},i=r.inherit===!1||!e?Object.assign(Object.assign({},p0e),{hashed:(o=e==null?void 0:e.hashed)!==null&&o!==void 0?o:p0e.hashed,cssVar:e==null?void 0:e.cssVar}):e,a=zPt();return nme(()=>{var l,s;if(!t)return e;const c=Object.assign({},i.components);Object.keys(t.components||{}).forEach(f=>{c[f]=Object.assign(Object.assign({},c[f]),t.components[f])});const u=`css-var-${a.replace(/:/g,"")}`,d=((l=r.cssVar)!==null&&l!==void 0?l:i.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:n==null?void 0:n.prefixCls},typeof i.cssVar=="object"?i.cssVar:{}),typeof r.cssVar=="object"?r.cssVar:{}),{key:typeof r.cssVar=="object"&&((s=r.cssVar)===null||s===void 0?void 0:s.key)||u});return Object.assign(Object.assign(Object.assign({},i),r),{token:Object.assign(Object.assign({},i.token),r.token),components:c,cssVar:d})},[r,i],(l,s)=>l.some((c,u)=>{const d=s[u];return!m0e(c,d,!0)}))}var B_e={exports:{}};/*! + */var dme=Symbol.for("react.element"),fme=Symbol.for("react.portal"),b$=Symbol.for("react.fragment"),S$=Symbol.for("react.strict_mode"),T$=Symbol.for("react.profiler"),P$=Symbol.for("react.provider"),C$=Symbol.for("react.context"),yPt=Symbol.for("react.server_context"),R$=Symbol.for("react.forward_ref"),H$=Symbol.for("react.suspense"),M$=Symbol.for("react.suspense_list"),I$=Symbol.for("react.memo"),z$=Symbol.for("react.lazy"),APt=Symbol.for("react.offscreen"),k_e;k_e=Symbol.for("react.module.reference");function dy(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case dme:switch(t=t.type,t){case b$:case T$:case S$:case H$:case M$:return t;default:switch(t=t&&t.$$typeof,t){case yPt:case C$:case R$:case z$:case I$:case P$:return t;default:return e}}case fme:return e}}}ps.ContextConsumer=C$;ps.ContextProvider=P$;ps.Element=dme;ps.ForwardRef=R$;ps.Fragment=b$;ps.Lazy=z$;ps.Memo=I$;ps.Portal=fme;ps.Profiler=T$;ps.StrictMode=S$;ps.Suspense=H$;ps.SuspenseList=M$;ps.isAsyncMode=function(){return!1};ps.isConcurrentMode=function(){return!1};ps.isContextConsumer=function(t){return dy(t)===C$};ps.isContextProvider=function(t){return dy(t)===P$};ps.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===dme};ps.isForwardRef=function(t){return dy(t)===R$};ps.isFragment=function(t){return dy(t)===b$};ps.isLazy=function(t){return dy(t)===z$};ps.isMemo=function(t){return dy(t)===I$};ps.isPortal=function(t){return dy(t)===fme};ps.isProfiler=function(t){return dy(t)===T$};ps.isStrictMode=function(t){return dy(t)===S$};ps.isSuspense=function(t){return dy(t)===H$};ps.isSuspenseList=function(t){return dy(t)===M$};ps.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===b$||t===T$||t===S$||t===H$||t===M$||t===APt||typeof t=="object"&&t!==null&&(t.$$typeof===z$||t.$$typeof===I$||t.$$typeof===P$||t.$$typeof===C$||t.$$typeof===R$||t.$$typeof===k_e||t.getModuleId!==void 0)};ps.typeOf=dy;F_e.exports=ps;var CC=F_e.exports,wPt=function(e,n){typeof e=="function"?e(n):zg(e)==="object"&&e&&"current"in e&&(e.current=n)},o5=function(){for(var e=arguments.length,n=new Array(e),o=0;o({color:t.colorLink,textDecoration:"none",outline:"none",cursor:"pointer",transition:`color ${t.motionDurationSlow}`,"&:focus, &:hover":{color:t.colorLinkHover},"&:active":{color:t.colorLinkActive}}),Gx={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},ja=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return{boxSizing:"border-box",margin:0,padding:0,color:t.colorText,fontSize:t.fontSize,lineHeight:t.lineHeight,listStyle:"none",fontFamily:e?"inherit":t.fontFamily}},WH=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),ek=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),bPt=t=>({a:{color:t.colorLink,textDecoration:t.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${t.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:t.colorLinkHover},"&:active":{color:t.colorLinkActive},"&:active,\n &:hover":{textDecoration:t.linkHoverDecoration,outline:0},"&:focus":{textDecoration:t.linkFocusDecoration,outline:0},"&[disabled]":{color:t.colorTextDisabled,cursor:"not-allowed"}}}),SPt=(t,e,n,o)=>{const r=`[class^="${e}"], [class*=" ${e}"]`,i=n?`.${n}`:r,a={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let l={};return o!==!1&&(l={fontFamily:t.fontFamily,fontSize:t.fontSize}),{[i]:Object.assign(Object.assign(Object.assign({},l),a),{[r]:a})}},lw=t=>({outline:`${Nt(t.lineWidthFocus)} solid ${t.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),Q6=t=>({"&:focus-visible":Object.assign({},lw(t))});function TPt(t){return t==="js"?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,n=new Array(e),o=0;oNt(r)).join(",")})`},min:function(){for(var e=arguments.length,n=new Array(e),o=0;oNt(r)).join(",")})`}}}const W_e=typeof CSSINJS_STATISTIC<"u";let v0e=!0;function Ki(){for(var t=arguments.length,e=new Array(t),n=0;n{Object.keys(r).forEach(a=>{Object.defineProperty(o,a,{configurable:!0,enumerable:!0,get:()=>r[a]})})}),v0e=!0,o}const o7e={};function PPt(){}const CPt=t=>{let e,n=t,o=PPt;return W_e&&typeof Proxy<"u"&&(e=new Set,n=new Proxy(t,{get(r,i){return v0e&&e.add(i),r[i]}}),o=(r,i)=>{var a;o7e[r]={global:Array.from(e),component:Object.assign(Object.assign({},(a=o7e[r])===null||a===void 0?void 0:a.component),i)}}),{token:n,keys:e,flush:o}},N_e=(t,e)=>{const[n,o]=_u();return u0e({theme:n,token:o,hashId:"",path:["ant-design-icons",t],nonce:()=>e==null?void 0:e.nonce,layer:{name:"antd"}},()=>[{[`.${t}`]:Object.assign(Object.assign({},WH()),{[`.${t} .${t}-icon`]:{display:"block"}})}])},U_e=(t,e,n)=>{var o;return typeof n=="function"?n(Ki(e,(o=e[t])!==null&&o!==void 0?o:{})):n??{}},j_e=(t,e,n,o)=>{const r=Object.assign({},e[t]);if(o!=null&&o.deprecatedTokens){const{deprecatedTokens:a}=o;a.forEach(l=>{let[s,c]=l;var u;(r!=null&&r[s]||r!=null&&r[c])&&((u=r[c])!==null&&u!==void 0||(r[c]=r==null?void 0:r[s]))})}const i=Object.assign(Object.assign({},n),r);return Object.keys(i).forEach(a=>{i[a]===e[a]&&delete i[a]}),i},RPt=(t,e)=>`${[e,t.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-")}`;function pme(t,e,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=Array.isArray(t)?t:[t,t],[i]=r,a=r.join("-");return function(l){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;const[c,u,d,f,p]=_u(),{getPrefixCls:g,iconPrefixCls:y,csp:w}=m.useContext(Cr),b=g(),C=p?"css":"js",P=gPt(C),{max:v,min:T}=TPt(C),A={theme:c,token:f,hashId:d,nonce:()=>w==null?void 0:w.nonce,clientOnly:o.clientOnly,layer:{name:"antd"},order:o.order||-999};return u0e(Object.assign(Object.assign({},A),{clientOnly:!1,path:["Shared",b]}),()=>[{"&":bPt(f)}]),N_e(y,w),[u0e(Object.assign(Object.assign({},A),{path:[a,l,y]}),()=>{if(o.injectStyle===!1)return[];const{token:S,flush:R}=CPt(f),M=U_e(i,u,n),D=`.${l}`,E=j_e(i,u,M,{deprecatedTokens:o.deprecatedTokens});p&&Object.keys(M).forEach(L=>{M[L]=`var(${JOe(L,RPt(i,p.prefix))})`});const W=Ki(S,{componentCls:D,prefixCls:l,iconCls:`.${y}`,antCls:`.${b}`,calc:P,max:v,min:T},p?M:E),j=e(W,{hashId:d,prefixCls:l,rootPrefixCls:b,iconPrefixCls:y});return R(i,E),[o.resetStyle===!1?null:SPt(W,l,s,o.resetFont),j]}),d]}}const zW=(t,e,n,o)=>{const r=pme(t,e,n,Object.assign({resetStyle:!1,order:-998},o));return a=>{let{prefixCls:l,rootCls:s=l}=a;return r(l,s),null}},HPt=(t,e,n)=>{function o(c){return`${t}${c.slice(0,1).toUpperCase()}${c.slice(1)}`}const{unitless:r={},injectStyle:i=!0}=n??{},a={[o("zIndexPopup")]:!0};Object.keys(r).forEach(c=>{a[o(c)]=r[c]});const l=c=>{let{rootCls:u,cssVar:d}=c;const[,f]=_u();return rTt({path:[t],prefix:d.prefix,key:d==null?void 0:d.key,unitless:Object.assign(Object.assign({},C_e),a),ignore:R_e,token:f,scope:u},()=>{const p=U_e(t,f,e),g=j_e(t,f,p,{deprecatedTokens:n==null?void 0:n.deprecatedTokens});return Object.keys(p).forEach(y=>{g[o(y)]=g[y],delete g[y]}),g}),null};return c=>{const[,,,,u]=_u();return[d=>i&&u?be.createElement(be.Fragment,null,be.createElement(l,{rootCls:c,cssVar:u,component:t}),d):d,u==null?void 0:u.key]}},wl=(t,e,n,o)=>{const r=pme(t,e,n,o),i=HPt(Array.isArray(t)?t[0]:t,n,o);return function(a){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a;const[,s]=r(a,l),[c,u]=i(l);return[c,s,u]}};function D$(t,e){return ZF.reduce((n,o)=>{const r=t[`${o}1`],i=t[`${o}3`],a=t[`${o}6`],l=t[`${o}7`];return Object.assign(Object.assign({},n),e(o,{lightColor:r,lightBorderColor:i,darkColor:a,textColor:l}))},{})}const MPt=Object.assign({},IK),{useId:r7e}=MPt,IPt=()=>"",zPt=typeof r7e>"u"?IPt:r7e;function DPt(t,e,n){var o;kb();const r=t||{},i=r.inherit===!1||!e?Object.assign(Object.assign({},p0e),{hashed:(o=e==null?void 0:e.hashed)!==null&&o!==void 0?o:p0e.hashed,cssVar:e==null?void 0:e.cssVar}):e,a=zPt();return ome(()=>{var l,s;if(!t)return e;const c=Object.assign({},i.components);Object.keys(t.components||{}).forEach(f=>{c[f]=Object.assign(Object.assign({},c[f]),t.components[f])});const u=`css-var-${a.replace(/:/g,"")}`,d=((l=r.cssVar)!==null&&l!==void 0?l:i.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:n==null?void 0:n.prefixCls},typeof i.cssVar=="object"?i.cssVar:{}),typeof r.cssVar=="object"?r.cssVar:{}),{key:typeof r.cssVar=="object"&&((s=r.cssVar)===null||s===void 0?void 0:s.key)||u});return Object.assign(Object.assign(Object.assign({},i),r),{token:Object.assign(Object.assign({},i.token),r.token),components:c,cssVar:d})},[r,i],(l,s)=>l.some((c,u)=>{const d=s[u];return!m0e(c,d,!0)}))}var B_e={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o=[],r=0;r1&&arguments[1]!==void 0?arguments[1]:1;c7e+=1;var o=c7e;function r(i){if(i===0)Q_e(o),e();else{var a=q_e(function(){r(i-1)});gme.set(o,a)}}return r(n),o};Fa.cancel=function(t){var e=gme.get(t);return Q_e(t),$_e(e)};const BPt=function(){var t=m.useRef(null);function e(){Fa.cancel(t.current)}function n(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;e();var i=Fa(function(){r<=1?o({isCanceled:function(){return i!==t.current}}):n(o,r-1)});t.current=i}return m.useEffect(function(){return function(){e()}},[]),[n,e]};var YPt=[u2,$P,QP,pme],OPt=[u2,O_e],Z_e=!1,_Pt=!0;function eVe(t){return t===QP||t===pme}const VPt=function(t,e,n){var o=RC(r7e),r=ln(o,2),i=r[0],a=r[1],l=BPt(),s=ln(l,2),c=s[0],u=s[1];function d(){a(u2,!0)}var f=e?OPt:YPt;return K_e(function(){if(i!==r7e&&i!==pme){var p=f.indexOf(i),g=f[p+1],y=n(i);y===Z_e?a(g,!0):g&&c(function(w){function b(){w.isCanceled()||a(g,!0)}y===!0?b():Promise.resolve(y).then(b)})}},[t,i]),m.useEffect(function(){return function(){u()}},[]),[d,i]};function GPt(t,e,n,o){var r=o.motionEnter,i=r===void 0?!0:r,a=o.motionAppear,l=a===void 0?!0:a,s=o.motionLeave,c=s===void 0?!0:s,u=o.motionDeadline,d=o.motionLeaveImmediately,f=o.onAppearPrepare,p=o.onEnterPrepare,g=o.onLeavePrepare,y=o.onAppearStart,w=o.onEnterStart,b=o.onLeaveStart,C=o.onAppearActive,P=o.onEnterActive,v=o.onLeaveActive,T=o.onAppearEnd,A=o.onEnterEnd,x=o.onLeaveEnd,S=o.onVisibleChanged,R=RC(),M=ln(R,2),D=M[0],E=M[1],W=RC(uv),j=ln(W,2),L=j[0],k=j[1],N=RC(null),F=ln(N,2),U=F[0],O=F[1],B=m.useRef(!1),_=m.useRef(null);function X(){return n()}var $=m.useRef(!1);function Q(){k(uv,!0),O(null,!0)}function le(He){var Se=X();if(!(He&&!He.deadline&&He.target!==Se)){var ze=$.current,Ie;L===xY&&ze?Ie=T==null?void 0:T(Se,He):L===bY&&ze?Ie=A==null?void 0:A(Se,He):L===SY&&ze&&(Ie=x==null?void 0:x(Se,He)),L!==uv&&ze&&Ie!==!1&&Q()}}var q=jPt(le),te=ln(q,1),re=te[0],ae=function(Se){var ze,Ie,ye;switch(Se){case xY:return ze={},Vt(ze,u2,f),Vt(ze,$P,y),Vt(ze,QP,C),ze;case bY:return Ie={},Vt(Ie,u2,p),Vt(Ie,$P,w),Vt(Ie,QP,P),Ie;case SY:return ye={},Vt(ye,u2,g),Vt(ye,$P,b),Vt(ye,QP,v),ye;default:return{}}},se=m.useMemo(function(){return ae(L)},[L]),ne=VPt(L,!t,function(He){if(He===u2){var Se=se[u2];return Se?Se(X()):Z_e}if(de in se){var ze;O(((ze=se[de])===null||ze===void 0?void 0:ze.call(se,X(),null))||null)}return de===QP&&(re(X()),u>0&&(clearTimeout(_.current),_.current=setTimeout(function(){le({deadline:!0})},u))),de===O_e&&Q(),_Pt}),fe=ln(ne,2),ge=fe[0],de=fe[1],Z=eVe(de);$.current=Z,K_e(function(){E(e);var He=B.current;B.current=!0;var Se;!He&&e&&l&&(Se=xY),He&&e&&i&&(Se=bY),(He&&!e&&c||!He&&d&&!e&&c)&&(Se=SY);var ze=ae(Se);Se&&(t||ze[u2])?(k(Se),ge()):k(uv)},[e]),m.useEffect(function(){(L===xY&&!l||L===bY&&!i||L===SY&&!c)&&k(uv)},[l,i,c]),m.useEffect(function(){return function(){B.current=!1,clearTimeout(_.current)}},[]);var he=m.useRef(!1);m.useEffect(function(){D&&(he.current=!0),D!==void 0&&L===uv&&((he.current||D)&&(S==null||S(D)),he.current=!0)},[D,L]);var xe=U;return se[u2]&&de===$P&&(xe=qt({transition:"none"},xe)),[L,de,xe,D??e]}function XPt(t){var e=t;hi(t)==="object"&&(e=t.transitionSupport);function n(r,i){return!!(r.motionName&&e&&i!==!1)}var o=m.forwardRef(function(r,i){var a=r.visible,l=a===void 0?!0:a,s=r.removeOnLeave,c=s===void 0?!0:s,u=r.forceRender,d=r.children,f=r.motionName,p=r.leavedClassName,g=r.eventProps,y=m.useContext(Y_e),w=y.motion,b=n(r,w),C=m.useRef(),P=m.useRef();function v(){try{return C.current instanceof HTMLElement?C.current:yE(P.current)}catch{return null}}var T=GPt(b,l,v,r),A=ln(T,4),x=A[0],S=A[1],R=A[2],M=A[3],D=m.useRef(M);M&&(D.current=!0);var E=m.useCallback(function(O){C.current=O,JF(i,O)},[i]),W,j=qt(qt({},g),{},{visible:l});if(!d)W=null;else if(x===uv)M?W=d(qt({},j),E):!c&&D.current&&p?W=d(qt(qt({},j),{},{className:p}),E):u||!c&&!p?W=d(qt(qt({},j),{},{style:{display:"none"}}),E):W=null;else{var L,k;S===u2?k="prepare":eVe(S)?k="active":S===$P&&(k="start");var N=s7e(f,"".concat(x,"-").concat(k));W=d(qt(qt({},j),{},{className:Vn(s7e(f,x),(L={},Vt(L,N,N&&k),Vt(L,f,typeof f=="string"),L)),style:R}),E)}if(m.isValidElement(W)&&rw(W)){var F=W,U=F.ref;U||(W=m.cloneElement(W,{ref:E}))}return m.createElement(LPt,{ref:P},W)});return o.displayName="CSSMotion",o}const o1=XPt(J_e);var x0e="add",b0e="keep",S0e="remove",Bre="removed";function JPt(t){var e;return t&&hi(t)==="object"&&"key"in t?e=t:e={key:t},qt(qt({},e),{},{key:String(e.key)})}function T0e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return t.map(JPt)}function KPt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],o=0,r=e.length,i=T0e(t),a=T0e(e);i.forEach(function(c){for(var u=!1,d=o;d1});return s.forEach(function(c){n=n.filter(function(u){var d=u.key,f=u.status;return d!==c||f!==S0e}),n.forEach(function(u){u.key===c&&(u.status=b0e)})}),n}var qPt=["component","children","onVisibleChanged","onAllRemoved"],$Pt=["status"],QPt=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function ZPt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o1,n=function(o){RW(i,o);var r=HW(i);function i(){var a;Ap(this,i);for(var l=arguments.length,s=new Array(l),c=0;cnull;var oCt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);re.endsWith("Color"))}const sCt=t=>{const{prefixCls:e,iconPrefixCls:n,theme:o,holderRender:r}=t;e!==void 0&&(IG=e),n!==void 0&&(tVe=n),"holderRender"in t&&(oVe=r),o&&(lCt(o)?tPt(__(),o):nVe=o)},rVe=()=>({getPrefixCls:(t,e)=>e||(t?`${__()}-${t}`:__()),getIconPrefixCls:aCt,getRootPrefixCls:()=>IG||__(),getTheme:()=>nVe,holderRender:oVe}),cCt=t=>{const{children:e,csp:n,autoInsertSpaceInButton:o,alert:r,anchor:i,form:a,locale:l,componentSize:s,direction:c,space:u,virtual:d,dropdownMatchSelectWidth:f,popupMatchSelectWidth:p,popupOverflow:g,legacyLocale:y,parentContext:w,iconPrefixCls:b,theme:C,componentDisabled:P,segmented:v,statistic:T,spin:A,calendar:x,carousel:S,cascader:R,collapse:M,typography:D,checkbox:E,descriptions:W,divider:j,drawer:L,skeleton:k,steps:N,image:F,layout:U,list:O,mentions:B,modal:_,progress:X,result:$,slider:Q,breadcrumb:le,menu:q,pagination:te,input:re,textArea:ae,empty:se,badge:ne,radio:fe,rate:ge,switch:de,transfer:Z,avatar:he,message:xe,tag:He,table:Se,card:ze,tabs:Ie,timeline:ye,timePicker:ce,upload:pe,notification:ve,tree:Ae,colorPicker:Te,datePicker:Me,rangePicker:Pe,flex:Ee,wave:Be,dropdown:Je,warning:We,tour:Ke,floatButtonGroup:Ne}=t,De=m.useCallback((st,at)=>{const{prefixCls:Oe}=t;if(at)return at;const Ze=Oe||w.getPrefixCls("");return st?`${Ze}-${st}`:Ze},[w.getPrefixCls,t.prefixCls]),ke=b||w.iconPrefixCls||ime,Ye=n||w.csp;N_e(ke,Ye);const it=DPt(C,w.theme,{prefixCls:De("")}),Ve={csp:Ye,autoInsertSpaceInButton:o,alert:r,anchor:i,locale:l||y,direction:c,space:u,virtual:d,popupMatchSelectWidth:p??f,popupOverflow:g,getPrefixCls:De,iconPrefixCls:ke,theme:it,segmented:v,statistic:T,spin:A,calendar:x,carousel:S,cascader:R,collapse:M,typography:D,checkbox:E,descriptions:W,divider:j,drawer:L,skeleton:k,steps:N,image:F,input:re,textArea:ae,layout:U,list:O,mentions:B,modal:_,progress:X,result:$,slider:Q,breadcrumb:le,menu:q,pagination:te,empty:se,badge:ne,radio:fe,rate:ge,switch:de,transfer:Z,avatar:he,message:xe,tag:He,table:Se,card:ze,tabs:Ie,timeline:ye,timePicker:ce,upload:pe,notification:ve,tree:Ae,colorPicker:Te,datePicker:Me,rangePicker:Pe,flex:Ee,wave:Be,dropdown:Je,warning:We,tour:Ke,floatButtonGroup:Ne},yt=Object.assign({},w);Object.keys(Ve).forEach(st=>{Ve[st]!==void 0&&(yt[st]=Ve[st])}),rCt.forEach(st=>{const at=t[st];at&&(yt[st]=at)}),typeof o<"u"&&(yt.button=Object.assign({autoInsertSpace:o},yt.button));const ct=nme(()=>yt,yt,(st,at)=>{const Oe=Object.keys(st),Ze=Object.keys(at);return Oe.length!==Ze.length||Oe.some(St=>st[St]!==at[St])}),Xe=m.useMemo(()=>({prefixCls:ke,csp:Ye}),[ke,Ye]);let ut=m.createElement(m.Fragment,null,m.createElement(nCt,{dropdownMatchSelectWidth:f}),e);const ft=m.useMemo(()=>{var st,at,Oe,Ze;return dTt(((st=aw.Form)===null||st===void 0?void 0:st.defaultValidateMessages)||{},((Oe=(at=ct.locale)===null||at===void 0?void 0:at.Form)===null||Oe===void 0?void 0:Oe.defaultValidateMessages)||{},((Ze=ct.form)===null||Ze===void 0?void 0:Ze.validateMessages)||{},(a==null?void 0:a.validateMessages)||{})},[ct,a==null?void 0:a.validateMessages]);Object.keys(ft).length>0&&(ut=m.createElement(pTt.Provider,{value:ft},ut)),l&&(ut=m.createElement(ATt,{locale:l,_ANT_MARK__:yTt},ut)),(ke||Ye)&&(ut=m.createElement(tme.Provider,{value:Xe},ut)),s&&(ut=m.createElement(nPt,{size:s},ut)),ut=m.createElement(tCt,null,ut);const ot=m.useMemo(()=>{const st=it||{},{algorithm:at,token:Oe,components:Ze,cssVar:St}=st,Pt=oCt(st,["algorithm","token","components","cssVar"]),Rt=at&&(!Array.isArray(at)||at.length>0)?i0e(at):v_e,Ut={};Object.entries(Ze||{}).forEach(At=>{let[kt,gt]=At;const dt=Object.assign({},gt);"algorithm"in dt&&(dt.algorithm===!0?dt.theme=Rt:(Array.isArray(dt.algorithm)||typeof dt.algorithm=="function")&&(dt.theme=i0e(dt.algorithm)),delete dt.algorithm),Ut[kt]=dt});const Ht=Object.assign(Object.assign({},QF),Oe);return Object.assign(Object.assign({},Pt),{theme:Rt,token:Ht,components:Ut,override:Object.assign({override:Ht},Ut),cssVar:St})},[it]);return C&&(ut=m.createElement(x_e.Provider,{value:ot},ut)),ct.warning&&(ut=m.createElement(hTt.Provider,{value:ct.warning},ut)),P!==void 0&&(ut=m.createElement(T_e,{disabled:P},ut)),m.createElement(Cr.Provider,{value:ct},ut)},fy=t=>{const e=m.useContext(Cr),n=m.useContext(rme);return m.createElement(cCt,Object.assign({parentContext:e,legacyLocale:n},t))};fy.ConfigContext=Cr;fy.SizeContext=pR;fy.config=sCt;fy.useConfig=oPt;Object.defineProperty(fy,"SizeContext",{get:()=>pR});function Fr(){return Fr=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&(n[r]=t[r]);return n}function aVe(t,e){if(t==null)return{};var n=yCt(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var PY=2,d7e=.16,ACt=.05,wCt=.05,vCt=.15,lVe=5,sVe=4,xCt=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function f7e(t){var e=t.r,n=t.g,o=t.b,r=RG(e,n,o);return{h:r.h*360,s:r.s,v:r.v}}function CY(t){var e=t.r,n=t.g,o=t.b;return"#".concat(HG(e,n,o,!1))}function bCt(t,e,n){var o=n/100,r={r:(e.r-t.r)*o+t.r,g:(e.g-t.g)*o+t.g,b:(e.b-t.b)*o+t.b};return r}function h7e(t,e,n){var o;return Math.round(t.h)>=60&&Math.round(t.h)<=240?o=n?Math.round(t.h)-PY*e:Math.round(t.h)+PY*e:o=n?Math.round(t.h)+PY*e:Math.round(t.h)-PY*e,o<0?o+=360:o>=360&&(o-=360),o}function p7e(t,e,n){if(t.h===0&&t.s===0)return t.s;var o;return n?o=t.s-d7e*e:e===sVe?o=t.s+d7e:o=t.s+ACt*e,o>1&&(o=1),n&&e===lVe&&o>.1&&(o=.1),o<.06&&(o=.06),Number(o.toFixed(2))}function g7e(t,e,n){var o;return n?o=t.v+wCt*e:o=t.v-vCt*e,o>1&&(o=1),Number(o.toFixed(2))}function C0e(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],o=A2(t),r=lVe;r>0;r-=1){var i=f7e(o),a=CY(A2({h:h7e(i,r,!0),s:p7e(i,r,!0),v:g7e(i,r,!0)}));n.push(a)}n.push(CY(o));for(var l=1;l<=sVe;l+=1){var s=f7e(o),c=CY(A2({h:h7e(s,l),s:p7e(s,l),v:g7e(s,l)}));n.push(c)}return e.theme==="dark"?xCt.map(function(u){var d=u.index,f=u.opacity,p=CY(bCt(A2(e.backgroundColor||"#141414"),A2(n[d]),f*100));return p}):n}var Yre={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},V_={},Ore={};Object.keys(Yre).forEach(function(t){V_[t]=C0e(Yre[t]),V_[t].primary=V_[t][5],Ore[t]=C0e(Yre[t],{theme:"dark",backgroundColor:"#141414"}),Ore[t].primary=Ore[t][5]});var SCt=V_.blue;function m7e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function A8(t){for(var e=1;e0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(t).reduce(function(e,n){var o=t[n];switch(n){case"class":e.className=o,delete e.class;break;default:delete e[n],e[PCt(n)]=o}return e},{})}function R0e(t,e,n){return n?be.createElement(t.tag,A8(A8({key:e},A7e(t.attrs)),n),(t.children||[]).map(function(o,r){return R0e(o,"".concat(e,"-").concat(t.tag,"-").concat(r))})):be.createElement(t.tag,A8({key:e},A7e(t.attrs)),(t.children||[]).map(function(o,r){return R0e(o,"".concat(e,"-").concat(t.tag,"-").concat(r))}))}function uVe(t){return C0e(t)[0]}function dVe(t){return t?Array.isArray(t)?t:[t]:[]}var RCt=` +*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o=[],r=0;r1&&arguments[1]!==void 0?arguments[1]:1;u7e+=1;var o=u7e;function r(i){if(i===0)Q_e(o),e();else{var a=q_e(function(){r(i-1)});mme.set(o,a)}}return r(n),o};Fa.cancel=function(t){var e=mme.get(t);return Q_e(t),$_e(e)};const BPt=function(){var t=m.useRef(null);function e(){Fa.cancel(t.current)}function n(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;e();var i=Fa(function(){r<=1?o({isCanceled:function(){return i!==t.current}}):n(o,r-1)});t.current=i}return m.useEffect(function(){return function(){e()}},[]),[n,e]};var YPt=[u2,$P,QP,gme],OPt=[u2,O_e],Z_e=!1,_Pt=!0;function eVe(t){return t===QP||t===gme}const VPt=function(t,e,n){var o=RC(i7e),r=ln(o,2),i=r[0],a=r[1],l=BPt(),s=ln(l,2),c=s[0],u=s[1];function d(){a(u2,!0)}var f=e?OPt:YPt;return K_e(function(){if(i!==i7e&&i!==gme){var p=f.indexOf(i),g=f[p+1],y=n(i);y===Z_e?a(g,!0):g&&c(function(w){function b(){w.isCanceled()||a(g,!0)}y===!0?b():Promise.resolve(y).then(b)})}},[t,i]),m.useEffect(function(){return function(){u()}},[]),[d,i]};function GPt(t,e,n,o){var r=o.motionEnter,i=r===void 0?!0:r,a=o.motionAppear,l=a===void 0?!0:a,s=o.motionLeave,c=s===void 0?!0:s,u=o.motionDeadline,d=o.motionLeaveImmediately,f=o.onAppearPrepare,p=o.onEnterPrepare,g=o.onLeavePrepare,y=o.onAppearStart,w=o.onEnterStart,b=o.onLeaveStart,C=o.onAppearActive,P=o.onEnterActive,v=o.onLeaveActive,T=o.onAppearEnd,A=o.onEnterEnd,x=o.onLeaveEnd,S=o.onVisibleChanged,R=RC(),M=ln(R,2),D=M[0],E=M[1],W=RC(uv),j=ln(W,2),L=j[0],k=j[1],N=RC(null),F=ln(N,2),U=F[0],O=F[1],B=m.useRef(!1),_=m.useRef(null);function X(){return n()}var $=m.useRef(!1);function Q(){k(uv,!0),O(null,!0)}function le(He){var Se=X();if(!(He&&!He.deadline&&He.target!==Se)){var ze=$.current,Ie;L===bY&&ze?Ie=T==null?void 0:T(Se,He):L===SY&&ze?Ie=A==null?void 0:A(Se,He):L===TY&&ze&&(Ie=x==null?void 0:x(Se,He)),L!==uv&&ze&&Ie!==!1&&Q()}}var q=jPt(le),te=ln(q,1),re=te[0],ae=function(Se){var ze,Ie,ye;switch(Se){case bY:return ze={},Vt(ze,u2,f),Vt(ze,$P,y),Vt(ze,QP,C),ze;case SY:return Ie={},Vt(Ie,u2,p),Vt(Ie,$P,w),Vt(Ie,QP,P),Ie;case TY:return ye={},Vt(ye,u2,g),Vt(ye,$P,b),Vt(ye,QP,v),ye;default:return{}}},se=m.useMemo(function(){return ae(L)},[L]),ne=VPt(L,!t,function(He){if(He===u2){var Se=se[u2];return Se?Se(X()):Z_e}if(de in se){var ze;O(((ze=se[de])===null||ze===void 0?void 0:ze.call(se,X(),null))||null)}return de===QP&&(re(X()),u>0&&(clearTimeout(_.current),_.current=setTimeout(function(){le({deadline:!0})},u))),de===O_e&&Q(),_Pt}),fe=ln(ne,2),ge=fe[0],de=fe[1],Z=eVe(de);$.current=Z,K_e(function(){E(e);var He=B.current;B.current=!0;var Se;!He&&e&&l&&(Se=bY),He&&e&&i&&(Se=SY),(He&&!e&&c||!He&&d&&!e&&c)&&(Se=TY);var ze=ae(Se);Se&&(t||ze[u2])?(k(Se),ge()):k(uv)},[e]),m.useEffect(function(){(L===bY&&!l||L===SY&&!i||L===TY&&!c)&&k(uv)},[l,i,c]),m.useEffect(function(){return function(){B.current=!1,clearTimeout(_.current)}},[]);var he=m.useRef(!1);m.useEffect(function(){D&&(he.current=!0),D!==void 0&&L===uv&&((he.current||D)&&(S==null||S(D)),he.current=!0)},[D,L]);var xe=U;return se[u2]&&de===$P&&(xe=qt({transition:"none"},xe)),[L,de,xe,D??e]}function XPt(t){var e=t;hi(t)==="object"&&(e=t.transitionSupport);function n(r,i){return!!(r.motionName&&e&&i!==!1)}var o=m.forwardRef(function(r,i){var a=r.visible,l=a===void 0?!0:a,s=r.removeOnLeave,c=s===void 0?!0:s,u=r.forceRender,d=r.children,f=r.motionName,p=r.leavedClassName,g=r.eventProps,y=m.useContext(Y_e),w=y.motion,b=n(r,w),C=m.useRef(),P=m.useRef();function v(){try{return C.current instanceof HTMLElement?C.current:yE(P.current)}catch{return null}}var T=GPt(b,l,v,r),A=ln(T,4),x=A[0],S=A[1],R=A[2],M=A[3],D=m.useRef(M);M&&(D.current=!0);var E=m.useCallback(function(O){C.current=O,JF(i,O)},[i]),W,j=qt(qt({},g),{},{visible:l});if(!d)W=null;else if(x===uv)M?W=d(qt({},j),E):!c&&D.current&&p?W=d(qt(qt({},j),{},{className:p}),E):u||!c&&!p?W=d(qt(qt({},j),{},{style:{display:"none"}}),E):W=null;else{var L,k;S===u2?k="prepare":eVe(S)?k="active":S===$P&&(k="start");var N=c7e(f,"".concat(x,"-").concat(k));W=d(qt(qt({},j),{},{className:Vn(c7e(f,x),(L={},Vt(L,N,N&&k),Vt(L,f,typeof f=="string"),L)),style:R}),E)}if(m.isValidElement(W)&&rw(W)){var F=W,U=F.ref;U||(W=m.cloneElement(W,{ref:E}))}return m.createElement(LPt,{ref:P},W)});return o.displayName="CSSMotion",o}const o1=XPt(J_e);var x0e="add",b0e="keep",S0e="remove",Bre="removed";function JPt(t){var e;return t&&hi(t)==="object"&&"key"in t?e=t:e={key:t},qt(qt({},e),{},{key:String(e.key)})}function T0e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return t.map(JPt)}function KPt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],o=0,r=e.length,i=T0e(t),a=T0e(e);i.forEach(function(c){for(var u=!1,d=o;d1});return s.forEach(function(c){n=n.filter(function(u){var d=u.key,f=u.status;return d!==c||f!==S0e}),n.forEach(function(u){u.key===c&&(u.status=b0e)})}),n}var qPt=["component","children","onVisibleChanged","onAllRemoved"],$Pt=["status"],QPt=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function ZPt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o1,n=function(o){HW(i,o);var r=MW(i);function i(){var a;Ap(this,i);for(var l=arguments.length,s=new Array(l),c=0;cnull;var oCt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);re.endsWith("Color"))}const sCt=t=>{const{prefixCls:e,iconPrefixCls:n,theme:o,holderRender:r}=t;e!==void 0&&(zG=e),n!==void 0&&(tVe=n),"holderRender"in t&&(oVe=r),o&&(lCt(o)?tPt(V_(),o):nVe=o)},rVe=()=>({getPrefixCls:(t,e)=>e||(t?`${V_()}-${t}`:V_()),getIconPrefixCls:aCt,getRootPrefixCls:()=>zG||V_(),getTheme:()=>nVe,holderRender:oVe}),cCt=t=>{const{children:e,csp:n,autoInsertSpaceInButton:o,alert:r,anchor:i,form:a,locale:l,componentSize:s,direction:c,space:u,virtual:d,dropdownMatchSelectWidth:f,popupMatchSelectWidth:p,popupOverflow:g,legacyLocale:y,parentContext:w,iconPrefixCls:b,theme:C,componentDisabled:P,segmented:v,statistic:T,spin:A,calendar:x,carousel:S,cascader:R,collapse:M,typography:D,checkbox:E,descriptions:W,divider:j,drawer:L,skeleton:k,steps:N,image:F,layout:U,list:O,mentions:B,modal:_,progress:X,result:$,slider:Q,breadcrumb:le,menu:q,pagination:te,input:re,textArea:ae,empty:se,badge:ne,radio:fe,rate:ge,switch:de,transfer:Z,avatar:he,message:xe,tag:He,table:Se,card:ze,tabs:Ie,timeline:ye,timePicker:ce,upload:pe,notification:ve,tree:Ae,colorPicker:Te,datePicker:Me,rangePicker:Pe,flex:Ee,wave:Be,dropdown:Je,warning:We,tour:Ke,floatButtonGroup:Ne}=t,De=m.useCallback((st,at)=>{const{prefixCls:Oe}=t;if(at)return at;const Ze=Oe||w.getPrefixCls("");return st?`${Ze}-${st}`:Ze},[w.getPrefixCls,t.prefixCls]),ke=b||w.iconPrefixCls||ame,Ye=n||w.csp;N_e(ke,Ye);const it=DPt(C,w.theme,{prefixCls:De("")}),Ve={csp:Ye,autoInsertSpaceInButton:o,alert:r,anchor:i,locale:l||y,direction:c,space:u,virtual:d,popupMatchSelectWidth:p??f,popupOverflow:g,getPrefixCls:De,iconPrefixCls:ke,theme:it,segmented:v,statistic:T,spin:A,calendar:x,carousel:S,cascader:R,collapse:M,typography:D,checkbox:E,descriptions:W,divider:j,drawer:L,skeleton:k,steps:N,image:F,input:re,textArea:ae,layout:U,list:O,mentions:B,modal:_,progress:X,result:$,slider:Q,breadcrumb:le,menu:q,pagination:te,empty:se,badge:ne,radio:fe,rate:ge,switch:de,transfer:Z,avatar:he,message:xe,tag:He,table:Se,card:ze,tabs:Ie,timeline:ye,timePicker:ce,upload:pe,notification:ve,tree:Ae,colorPicker:Te,datePicker:Me,rangePicker:Pe,flex:Ee,wave:Be,dropdown:Je,warning:We,tour:Ke,floatButtonGroup:Ne},yt=Object.assign({},w);Object.keys(Ve).forEach(st=>{Ve[st]!==void 0&&(yt[st]=Ve[st])}),rCt.forEach(st=>{const at=t[st];at&&(yt[st]=at)}),typeof o<"u"&&(yt.button=Object.assign({autoInsertSpace:o},yt.button));const ct=ome(()=>yt,yt,(st,at)=>{const Oe=Object.keys(st),Ze=Object.keys(at);return Oe.length!==Ze.length||Oe.some(St=>st[St]!==at[St])}),Xe=m.useMemo(()=>({prefixCls:ke,csp:Ye}),[ke,Ye]);let ut=m.createElement(m.Fragment,null,m.createElement(nCt,{dropdownMatchSelectWidth:f}),e);const ft=m.useMemo(()=>{var st,at,Oe,Ze;return dTt(((st=aw.Form)===null||st===void 0?void 0:st.defaultValidateMessages)||{},((Oe=(at=ct.locale)===null||at===void 0?void 0:at.Form)===null||Oe===void 0?void 0:Oe.defaultValidateMessages)||{},((Ze=ct.form)===null||Ze===void 0?void 0:Ze.validateMessages)||{},(a==null?void 0:a.validateMessages)||{})},[ct,a==null?void 0:a.validateMessages]);Object.keys(ft).length>0&&(ut=m.createElement(pTt.Provider,{value:ft},ut)),l&&(ut=m.createElement(ATt,{locale:l,_ANT_MARK__:yTt},ut)),(ke||Ye)&&(ut=m.createElement(nme.Provider,{value:Xe},ut)),s&&(ut=m.createElement(nPt,{size:s},ut)),ut=m.createElement(tCt,null,ut);const ot=m.useMemo(()=>{const st=it||{},{algorithm:at,token:Oe,components:Ze,cssVar:St}=st,Pt=oCt(st,["algorithm","token","components","cssVar"]),Rt=at&&(!Array.isArray(at)||at.length>0)?i0e(at):v_e,Ut={};Object.entries(Ze||{}).forEach(At=>{let[kt,gt]=At;const dt=Object.assign({},gt);"algorithm"in dt&&(dt.algorithm===!0?dt.theme=Rt:(Array.isArray(dt.algorithm)||typeof dt.algorithm=="function")&&(dt.theme=i0e(dt.algorithm)),delete dt.algorithm),Ut[kt]=dt});const Ht=Object.assign(Object.assign({},QF),Oe);return Object.assign(Object.assign({},Pt),{theme:Rt,token:Ht,components:Ut,override:Object.assign({override:Ht},Ut),cssVar:St})},[it]);return C&&(ut=m.createElement(x_e.Provider,{value:ot},ut)),ct.warning&&(ut=m.createElement(hTt.Provider,{value:ct.warning},ut)),P!==void 0&&(ut=m.createElement(T_e,{disabled:P},ut)),m.createElement(Cr.Provider,{value:ct},ut)},fy=t=>{const e=m.useContext(Cr),n=m.useContext(ime);return m.createElement(cCt,Object.assign({parentContext:e,legacyLocale:n},t))};fy.ConfigContext=Cr;fy.SizeContext=pR;fy.config=sCt;fy.useConfig=oPt;Object.defineProperty(fy,"SizeContext",{get:()=>pR});function Fr(){return Fr=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&(n[r]=t[r]);return n}function aVe(t,e){if(t==null)return{};var n=yCt(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var CY=2,f7e=.16,ACt=.05,wCt=.05,vCt=.15,lVe=5,sVe=4,xCt=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function h7e(t){var e=t.r,n=t.g,o=t.b,r=HG(e,n,o);return{h:r.h*360,s:r.s,v:r.v}}function RY(t){var e=t.r,n=t.g,o=t.b;return"#".concat(MG(e,n,o,!1))}function bCt(t,e,n){var o=n/100,r={r:(e.r-t.r)*o+t.r,g:(e.g-t.g)*o+t.g,b:(e.b-t.b)*o+t.b};return r}function p7e(t,e,n){var o;return Math.round(t.h)>=60&&Math.round(t.h)<=240?o=n?Math.round(t.h)-CY*e:Math.round(t.h)+CY*e:o=n?Math.round(t.h)+CY*e:Math.round(t.h)-CY*e,o<0?o+=360:o>=360&&(o-=360),o}function g7e(t,e,n){if(t.h===0&&t.s===0)return t.s;var o;return n?o=t.s-f7e*e:e===sVe?o=t.s+f7e:o=t.s+ACt*e,o>1&&(o=1),n&&e===lVe&&o>.1&&(o=.1),o<.06&&(o=.06),Number(o.toFixed(2))}function m7e(t,e,n){var o;return n?o=t.v+wCt*e:o=t.v-vCt*e,o>1&&(o=1),Number(o.toFixed(2))}function C0e(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],o=A2(t),r=lVe;r>0;r-=1){var i=h7e(o),a=RY(A2({h:p7e(i,r,!0),s:g7e(i,r,!0),v:m7e(i,r,!0)}));n.push(a)}n.push(RY(o));for(var l=1;l<=sVe;l+=1){var s=h7e(o),c=RY(A2({h:p7e(s,l),s:g7e(s,l),v:m7e(s,l)}));n.push(c)}return e.theme==="dark"?xCt.map(function(u){var d=u.index,f=u.opacity,p=RY(bCt(A2(e.backgroundColor||"#141414"),A2(n[d]),f*100));return p}):n}var Yre={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},G_={},Ore={};Object.keys(Yre).forEach(function(t){G_[t]=C0e(Yre[t]),G_[t].primary=G_[t][5],Ore[t]=C0e(Yre[t],{theme:"dark",backgroundColor:"#141414"}),Ore[t].primary=Ore[t][5]});var SCt=G_.blue;function y7e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function A8(t){for(var e=1;e0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(t).reduce(function(e,n){var o=t[n];switch(n){case"class":e.className=o,delete e.class;break;default:delete e[n],e[PCt(n)]=o}return e},{})}function R0e(t,e,n){return n?be.createElement(t.tag,A8(A8({key:e},w7e(t.attrs)),n),(t.children||[]).map(function(o,r){return R0e(o,"".concat(e,"-").concat(t.tag,"-").concat(r))})):be.createElement(t.tag,A8({key:e},w7e(t.attrs)),(t.children||[]).map(function(o,r){return R0e(o,"".concat(e,"-").concat(t.tag,"-").concat(r))}))}function uVe(t){return C0e(t)[0]}function dVe(t){return t?Array.isArray(t)?t:[t]:[]}var RCt=` .anticon { display: inline-flex; align-items: center; @@ -4432,7 +4432,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho transform: rotate(360deg); } } -`,HCt=function(e){var n=m.useContext(tme),o=n.csp,r=n.prefixCls,i=RCt;r&&(i=i.replace(/anticon/g,r)),m.useEffect(function(){var a=e.current,l=zG(a);dx(i,"@ant-design-icons",{prepend:!0,csp:o,attachTo:l})},[])},MCt=["icon","className","onClick","style","primaryColor","secondaryColor"],wE={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function ICt(t){var e=t.primaryColor,n=t.secondaryColor;wE.primaryColor=e,wE.secondaryColor=n||uVe(e),wE.calculated=!!n}function zCt(){return A8({},wE)}var NH=function(e){var n=e.icon,o=e.className,r=e.onClick,i=e.style,a=e.primaryColor,l=e.secondaryColor,s=aVe(e,MCt),c=m.useRef(),u=wE;if(a&&(u={primaryColor:a,secondaryColor:l||uVe(a)}),HCt(c),CCt(y7e(n),"icon should be icon definiton, but got ".concat(n)),!y7e(n))return null;var d=n;return d&&typeof d.icon=="function"&&(d=A8(A8({},d),{},{icon:d.icon(u.primaryColor,u.secondaryColor)})),R0e(d.icon,"svg-".concat(d.name),A8(A8({className:o,onClick:r,style:i,"data-icon":d.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},s),{},{ref:c}))};NH.displayName="IconReact";NH.getTwoToneColors=zCt;NH.setTwoToneColors=ICt;function fVe(t){var e=dVe(t),n=iVe(e,2),o=n[0],r=n[1];return NH.setTwoToneColors({primaryColor:o,secondaryColor:r})}function DCt(){var t=NH.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor}var ECt=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];fVe(SCt.primary);var kr=m.forwardRef(function(t,e){var n=t.className,o=t.icon,r=t.spin,i=t.rotate,a=t.tabIndex,l=t.onClick,s=t.twoToneColor,c=aVe(t,ECt),u=m.useContext(tme),d=u.prefixCls,f=d===void 0?"anticon":d,p=u.rootClassName,g=Vn(p,f,P0e(P0e({},"".concat(f,"-").concat(o.name),!!o.name),"".concat(f,"-spin"),!!r||o.name==="loading"),n),y=a;y===void 0&&l&&(y=-1);var w=i?{msTransform:"rotate(".concat(i,"deg)"),transform:"rotate(".concat(i,"deg)")}:void 0,b=dVe(s),C=iVe(b,2),P=C[0],v=C[1];return m.createElement("span",Fr({role:"img","aria-label":o.name},c,{ref:e,tabIndex:y,onClick:l,className:g}),m.createElement(NH,{icon:o,primaryColor:P,secondaryColor:v,style:w}))});kr.displayName="AntdIcon";kr.getTwoToneColor=DCt;kr.setTwoToneColor=fVe;var FCt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:uCt}))},mme=m.forwardRef(FCt),kCt={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},LCt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:kCt}))},E$=m.forwardRef(LCt),WCt={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},NCt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:WCt}))},Lw=m.forwardRef(NCt),UCt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},jCt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:UCt}))},hVe=m.forwardRef(jCt),BCt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},YCt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:BCt}))},pVe=m.forwardRef(YCt),OCt=`accept acceptCharset accessKey action allowFullScreen allowTransparency +`,HCt=function(e){var n=m.useContext(nme),o=n.csp,r=n.prefixCls,i=RCt;r&&(i=i.replace(/anticon/g,r)),m.useEffect(function(){var a=e.current,l=DG(a);dx(i,"@ant-design-icons",{prepend:!0,csp:o,attachTo:l})},[])},MCt=["icon","className","onClick","style","primaryColor","secondaryColor"],wE={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function ICt(t){var e=t.primaryColor,n=t.secondaryColor;wE.primaryColor=e,wE.secondaryColor=n||uVe(e),wE.calculated=!!n}function zCt(){return A8({},wE)}var NH=function(e){var n=e.icon,o=e.className,r=e.onClick,i=e.style,a=e.primaryColor,l=e.secondaryColor,s=aVe(e,MCt),c=m.useRef(),u=wE;if(a&&(u={primaryColor:a,secondaryColor:l||uVe(a)}),HCt(c),CCt(A7e(n),"icon should be icon definiton, but got ".concat(n)),!A7e(n))return null;var d=n;return d&&typeof d.icon=="function"&&(d=A8(A8({},d),{},{icon:d.icon(u.primaryColor,u.secondaryColor)})),R0e(d.icon,"svg-".concat(d.name),A8(A8({className:o,onClick:r,style:i,"data-icon":d.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},s),{},{ref:c}))};NH.displayName="IconReact";NH.getTwoToneColors=zCt;NH.setTwoToneColors=ICt;function fVe(t){var e=dVe(t),n=iVe(e,2),o=n[0],r=n[1];return NH.setTwoToneColors({primaryColor:o,secondaryColor:r})}function DCt(){var t=NH.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor}var ECt=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];fVe(SCt.primary);var kr=m.forwardRef(function(t,e){var n=t.className,o=t.icon,r=t.spin,i=t.rotate,a=t.tabIndex,l=t.onClick,s=t.twoToneColor,c=aVe(t,ECt),u=m.useContext(nme),d=u.prefixCls,f=d===void 0?"anticon":d,p=u.rootClassName,g=Vn(p,f,P0e(P0e({},"".concat(f,"-").concat(o.name),!!o.name),"".concat(f,"-spin"),!!r||o.name==="loading"),n),y=a;y===void 0&&l&&(y=-1);var w=i?{msTransform:"rotate(".concat(i,"deg)"),transform:"rotate(".concat(i,"deg)")}:void 0,b=dVe(s),C=iVe(b,2),P=C[0],v=C[1];return m.createElement("span",Fr({role:"img","aria-label":o.name},c,{ref:e,tabIndex:y,onClick:l,className:g}),m.createElement(NH,{icon:o,primaryColor:P,secondaryColor:v,style:w}))});kr.displayName="AntdIcon";kr.getTwoToneColor=DCt;kr.setTwoToneColor=fVe;var FCt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:uCt}))},yme=m.forwardRef(FCt),kCt={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},LCt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:kCt}))},E$=m.forwardRef(LCt),WCt={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},NCt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:WCt}))},Lw=m.forwardRef(NCt),UCt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},jCt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:UCt}))},hVe=m.forwardRef(jCt),BCt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},YCt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:BCt}))},pVe=m.forwardRef(YCt),OCt=`accept acceptCharset accessKey action allowFullScreen allowTransparency alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge charSet checked classID className colSpan cols content contentEditable contextMenu controls coords crossOrigin data dateTime default defer dir disabled download draggable @@ -4449,7 +4449,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata - onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,VCt="".concat(OCt," ").concat(_Ct).split(/[\s\n]+/),GCt="aria-",XCt="data-";function w7e(t,e){return t.indexOf(e)===0}function yme(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;e===!1?n={aria:!0,data:!0,attr:!0}:e===!0?n={aria:!0}:n=uR({},e);var o={};return Object.keys(t).forEach(function(r){(n.aria&&(r==="role"||w7e(r,GCt))||n.data&&w7e(r,XCt)||n.attr&&VCt.includes(r))&&(o[r]=t[r])}),o}function gVe(t){return t&&be.isValidElement(t)&&t.type===be.Fragment}const mVe=(t,e,n)=>be.isValidElement(t)?be.cloneElement(t,typeof n=="function"?n(t.props||{}):n):e;function B0(t,e){return mVe(t,t,e)}function H0e(t){return t!=null&&t===t.window}function JCt(t,e){var n,o;if(typeof window>"u")return 0;const r="scrollTop";let i=0;return H0e(t)?i=t.pageYOffset:t instanceof Document?i=t.documentElement[r]:(t instanceof HTMLElement||t)&&(i=t[r]),t&&!H0e(t)&&typeof i!="number"&&(i=(o=((n=t.ownerDocument)!==null&&n!==void 0?n:t).documentElement)===null||o===void 0?void 0:o[r]),i}function KCt(t,e,n,o){const r=n-e;return t/=o/2,t<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e}function qCt(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{getContainer:n=()=>window,callback:o,duration:r=450}=e,i=n(),a=JCt(i),l=Date.now(),s=()=>{const u=Date.now()-l,d=KCt(u>r?r:u,a,t,r);H0e(i)?i.scrollTo(window.pageXOffset,d):i instanceof Document||i.constructor.name==="HTMLDocument"?i.documentElement.scrollTop=d:i.scrollTop=d,u{const[,,,,e]=_u();return e?`${t}-css-var`:""};var Bn={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var n=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||n>=Bn.F1&&n<=Bn.F12)return!1;switch(n){case Bn.ALT:case Bn.CAPS_LOCK:case Bn.CONTEXT_MENU:case Bn.CTRL:case Bn.DOWN:case Bn.END:case Bn.ESC:case Bn.HOME:case Bn.INSERT:case Bn.LEFT:case Bn.MAC_FF_META:case Bn.META:case Bn.NUMLOCK:case Bn.NUM_CENTER:case Bn.PAGE_DOWN:case Bn.PAGE_UP:case Bn.PAUSE:case Bn.PRINT_SCREEN:case Bn.RIGHT:case Bn.SHIFT:case Bn.UP:case Bn.WIN_KEY:case Bn.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=Bn.ZERO&&e<=Bn.NINE||e>=Bn.NUM_ZERO&&e<=Bn.NUM_MULTIPLY||e>=Bn.A&&e<=Bn.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case Bn.SPACE:case Bn.QUESTION_MARK:case Bn.NUM_PLUS:case Bn.NUM_MINUS:case Bn.NUM_PERIOD:case Bn.NUM_DIVISION:case Bn.SEMICOLON:case Bn.DASH:case Bn.EQUALS:case Bn.COMMA:case Bn.PERIOD:case Bn.SLASH:case Bn.APOSTROPHE:case Bn.SINGLE_QUOTE:case Bn.OPEN_SQUARE_BRACKET:case Bn.BACKSLASH:case Bn.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},$Ct=`accept acceptCharset accessKey action allowFullScreen allowTransparency + onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,VCt="".concat(OCt," ").concat(_Ct).split(/[\s\n]+/),GCt="aria-",XCt="data-";function v7e(t,e){return t.indexOf(e)===0}function Ame(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;e===!1?n={aria:!0,data:!0,attr:!0}:e===!0?n={aria:!0}:n=uR({},e);var o={};return Object.keys(t).forEach(function(r){(n.aria&&(r==="role"||v7e(r,GCt))||n.data&&v7e(r,XCt)||n.attr&&VCt.includes(r))&&(o[r]=t[r])}),o}function gVe(t){return t&&be.isValidElement(t)&&t.type===be.Fragment}const mVe=(t,e,n)=>be.isValidElement(t)?be.cloneElement(t,typeof n=="function"?n(t.props||{}):n):e;function B0(t,e){return mVe(t,t,e)}function H0e(t){return t!=null&&t===t.window}function JCt(t,e){var n,o;if(typeof window>"u")return 0;const r="scrollTop";let i=0;return H0e(t)?i=t.pageYOffset:t instanceof Document?i=t.documentElement[r]:(t instanceof HTMLElement||t)&&(i=t[r]),t&&!H0e(t)&&typeof i!="number"&&(i=(o=((n=t.ownerDocument)!==null&&n!==void 0?n:t).documentElement)===null||o===void 0?void 0:o[r]),i}function KCt(t,e,n,o){const r=n-e;return t/=o/2,t<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e}function qCt(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{getContainer:n=()=>window,callback:o,duration:r=450}=e,i=n(),a=JCt(i),l=Date.now(),s=()=>{const u=Date.now()-l,d=KCt(u>r?r:u,a,t,r);H0e(i)?i.scrollTo(window.pageXOffset,d):i instanceof Document||i.constructor.name==="HTMLDocument"?i.documentElement.scrollTop=d:i.scrollTop=d,u{const[,,,,e]=_u();return e?`${t}-css-var`:""};var Bn={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var n=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||n>=Bn.F1&&n<=Bn.F12)return!1;switch(n){case Bn.ALT:case Bn.CAPS_LOCK:case Bn.CONTEXT_MENU:case Bn.CTRL:case Bn.DOWN:case Bn.END:case Bn.ESC:case Bn.HOME:case Bn.INSERT:case Bn.LEFT:case Bn.MAC_FF_META:case Bn.META:case Bn.NUMLOCK:case Bn.NUM_CENTER:case Bn.PAGE_DOWN:case Bn.PAGE_UP:case Bn.PAUSE:case Bn.PRINT_SCREEN:case Bn.RIGHT:case Bn.SHIFT:case Bn.UP:case Bn.WIN_KEY:case Bn.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=Bn.ZERO&&e<=Bn.NINE||e>=Bn.NUM_ZERO&&e<=Bn.NUM_MULTIPLY||e>=Bn.A&&e<=Bn.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case Bn.SPACE:case Bn.QUESTION_MARK:case Bn.NUM_PLUS:case Bn.NUM_MINUS:case Bn.NUM_PERIOD:case Bn.NUM_DIVISION:case Bn.SEMICOLON:case Bn.DASH:case Bn.EQUALS:case Bn.COMMA:case Bn.PERIOD:case Bn.SLASH:case Bn.APOSTROPHE:case Bn.SINGLE_QUOTE:case Bn.OPEN_SQUARE_BRACKET:case Bn.BACKSLASH:case Bn.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},$Ct=`accept acceptCharset accessKey action allowFullScreen allowTransparency alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge charSet checked classID className colSpan cols content contentEditable contextMenu controls coords crossOrigin data dateTime default defer dir disabled download draggable @@ -4466,19 +4466,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata - onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,ZCt="".concat($Ct," ").concat(QCt).split(/[\s\n]+/),eRt="aria-",tRt="data-";function v7e(t,e){return t.indexOf(e)===0}function Sf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;e===!1?n={aria:!0,data:!0,attr:!0}:e===!0?n={aria:!0}:n=qt({},e);var o={};return Object.keys(t).forEach(function(r){(n.aria&&(r==="role"||v7e(r,eRt))||n.data&&v7e(r,tRt)||n.attr&&ZCt.includes(r))&&(o[r]=t[r])}),o}var yVe=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.style,r=t.className,i=t.duration,a=i===void 0?4.5:i,l=t.eventKey,s=t.content,c=t.closable,u=t.closeIcon,d=u===void 0?"x":u,f=t.props,p=t.onClick,g=t.onNoticeClose,y=t.times,w=t.hovering,b=m.useState(!1),C=ln(b,2),P=C[0],v=C[1],T=w||P,A=function(){g(l)},x=function(E){(E.key==="Enter"||E.code==="Enter"||E.keyCode===Bn.ENTER)&&A()};m.useEffect(function(){if(!T&&a>0){var D=setTimeout(function(){A()},a*1e3);return function(){clearTimeout(D)}}},[a,T,y]);var S=m.useMemo(function(){return hi(c)==="object"&&c!==null?c:c?{closeIcon:d}:{}},[c,d]),R=Sf(S,!0),M="".concat(n,"-notice");return m.createElement("div",ho({},f,{ref:e,className:Vn(M,r,Vt({},"".concat(M,"-closable"),c)),style:o,onMouseEnter:function(E){var W;v(!0),f==null||(W=f.onMouseEnter)===null||W===void 0||W.call(f,E)},onMouseLeave:function(E){var W;v(!1),f==null||(W=f.onMouseLeave)===null||W===void 0||W.call(f,E)},onClick:p}),m.createElement("div",{className:"".concat(M,"-content")},s),c&&m.createElement("a",ho({tabIndex:0,className:"".concat(M,"-close"),onKeyDown:x,"aria-label":"Close"},R,{onClick:function(E){E.preventDefault(),E.stopPropagation(),A()}}),S.closeIcon))}),AVe=be.createContext({}),nRt=function(e){var n=e.children,o=e.classNames;return be.createElement(AVe.Provider,{value:{classNames:o}},n)},x7e=8,b7e=3,S7e=16,oRt=function(e){var n={offset:x7e,threshold:b7e,gap:S7e};if(e&&hi(e)==="object"){var o,r,i;n.offset=(o=e.offset)!==null&&o!==void 0?o:x7e,n.threshold=(r=e.threshold)!==null&&r!==void 0?r:b7e,n.gap=(i=e.gap)!==null&&i!==void 0?i:S7e}return[!!e,n]},rRt=["className","style","classNames","styles"],iRt=function(e){var n=e.configList,o=e.placement,r=e.prefixCls,i=e.className,a=e.style,l=e.motion,s=e.onAllNoticeRemoved,c=e.onNoticeClose,u=e.stack,d=m.useContext(AVe),f=d.classNames,p=m.useRef({}),g=m.useState(null),y=ln(g,2),w=y[0],b=y[1],C=m.useState([]),P=ln(C,2),v=P[0],T=P[1],A=n.map(function(k){return{config:k,key:String(k.key)}}),x=oRt(u),S=ln(x,2),R=S[0],M=S[1],D=M.offset,E=M.threshold,W=M.gap,j=R&&(v.length>0||A.length<=E),L=typeof l=="function"?l(o):l;return m.useEffect(function(){R&&v.length>1&&T(function(k){return k.filter(function(N){return A.some(function(F){var U=F.key;return N===U})})})},[v,A,R]),m.useEffect(function(){var k;if(R&&p.current[(k=A[A.length-1])===null||k===void 0?void 0:k.key]){var N;b(p.current[(N=A[A.length-1])===null||N===void 0?void 0:N.key])}},[A,R]),be.createElement(eCt,ho({key:o,className:Vn(r,"".concat(r,"-").concat(o),f==null?void 0:f.list,i,Vt(Vt({},"".concat(r,"-stack"),!!R),"".concat(r,"-stack-expanded"),j)),style:a,keys:A,motionAppear:!0},L,{onAllRemoved:function(){s(o)}}),function(k,N){var F=k.config,U=k.className,O=k.style,B=k.index,_=F,X=_.key,$=_.times,Q=String(X),le=F,q=le.className,te=le.style,re=le.classNames,ae=le.styles,se=ii(le,rRt),ne=A.findIndex(function(ce){return ce.key===Q}),fe={};if(R){var ge=A.length-1-(ne>-1?ne:B-1),de=o==="top"||o==="bottom"?"-50%":"0";if(ge>0){var Z,he,xe;fe.height=j?(Z=p.current[Q])===null||Z===void 0?void 0:Z.offsetHeight:w==null?void 0:w.offsetHeight;for(var He=0,Se=0;Se-1?p.current[Q]=pe:delete p.current[Q]},prefixCls:r,classNames:re,styles:ae,className:Vn(q,f==null?void 0:f.notice),style:te,times:$,key:X,eventKey:X,onNoticeClose:c,hovering:R&&v.length>0})))})},aRt=m.forwardRef(function(t,e){var n=t.prefixCls,o=n===void 0?"rc-notification":n,r=t.container,i=t.motion,a=t.maxCount,l=t.className,s=t.style,c=t.onAllRemoved,u=t.stack,d=t.renderNotifications,f=m.useState([]),p=ln(f,2),g=p[0],y=p[1],w=function(R){var M,D=g.find(function(E){return E.key===R});D==null||(M=D.onClose)===null||M===void 0||M.call(D),y(function(E){return E.filter(function(W){return W.key!==R})})};m.useImperativeHandle(e,function(){return{open:function(R){y(function(M){var D=Lo(M),E=D.findIndex(function(L){return L.key===R.key}),W=qt({},R);if(E>=0){var j;W.times=(((j=M[E])===null||j===void 0?void 0:j.times)||0)+1,D[E]=W}else W.times=0,D.push(W);return a>0&&D.length>a&&(D=D.slice(-a)),D})},close:function(R){w(R)},destroy:function(){y([])}}});var b=m.useState({}),C=ln(b,2),P=C[0],v=C[1];m.useEffect(function(){var S={};g.forEach(function(R){var M=R.placement,D=M===void 0?"topRight":M;D&&(S[D]=S[D]||[],S[D].push(R))}),Object.keys(P).forEach(function(R){S[R]=S[R]||[]}),v(S)},[g]);var T=function(R){v(function(M){var D=qt({},M),E=D[R]||[];return E.length||delete D[R],D})},A=m.useRef(!1);if(m.useEffect(function(){Object.keys(P).length>0?A.current=!0:A.current&&(c==null||c(),A.current=!1)},[P]),!r)return null;var x=Object.keys(P);return Cd.createPortal(m.createElement(m.Fragment,null,x.map(function(S){var R=P[S],M=m.createElement(iRt,{key:S,configList:R,placement:S,prefixCls:o,className:l==null?void 0:l(S),style:s==null?void 0:s(S),motion:i,onNoticeClose:w,onAllNoticeRemoved:T,stack:u});return d?d(M,{prefixCls:o,key:S}):M})),r)}),lRt=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],sRt=function(){return document.body},T7e=0;function cRt(){for(var t={},e=arguments.length,n=new Array(e),o=0;o0&&arguments[0]!==void 0?arguments[0]:{},e=t.getContainer,n=e===void 0?sRt:e,o=t.motion,r=t.prefixCls,i=t.maxCount,a=t.className,l=t.style,s=t.onAllRemoved,c=t.stack,u=t.renderNotifications,d=ii(t,lRt),f=m.useState(),p=ln(f,2),g=p[0],y=p[1],w=m.useRef(),b=m.createElement(aRt,{container:g,ref:w,prefixCls:r,motion:o,maxCount:i,className:a,style:l,onAllRemoved:s,stack:c,renderNotifications:u}),C=m.useState([]),P=ln(C,2),v=P[0],T=P[1],A=m.useMemo(function(){return{open:function(S){var R=cRt(d,S);(R.key===null||R.key===void 0)&&(R.key="rc-notification-".concat(T7e),T7e+=1),T(function(M){return[].concat(Lo(M),[{type:"open",config:R}])})},close:function(S){T(function(R){return[].concat(Lo(R),[{type:"close",key:S}])})},destroy:function(){T(function(S){return[].concat(Lo(S),[{type:"destroy"}])})}}},[]);return m.useEffect(function(){y(n())}),m.useEffect(function(){w.current&&v.length&&(v.forEach(function(x){switch(x.type){case"open":w.current.open(x.config);break;case"close":w.current.close(x.key);break;case"destroy":w.current.destroy();break}}),T(function(x){return x.filter(function(S){return!v.includes(S)})}))},[v]),[A,b]}var dRt={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},fRt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:dRt}))},UH=m.forwardRef(fRt);const zW=be.createContext(void 0),dv=100,hRt=10,Ame=dv*hRt,wVe={Modal:dv,Drawer:dv,Popover:dv,Popconfirm:dv,Tooltip:dv,Tour:dv},pRt={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function gRt(t){return t in wVe}function Ww(t,e){const[,n]=_u(),o=be.useContext(zW),r=gRt(t);if(e!==void 0)return[e,e];let i=o??0;return r?(i+=(o?0:n.zIndexPopupBase)+wVe[t],i=Math.min(i,n.zIndexPopupBase+Ame)):i+=pRt[t],[o===void 0?e:i,i]}const mRt=t=>{const{componentCls:e,iconCls:n,boxShadow:o,colorText:r,colorSuccess:i,colorError:a,colorWarning:l,colorInfo:s,fontSizeLG:c,motionEaseInOutCirc:u,motionDurationSlow:d,marginXS:f,paddingXS:p,borderRadiusLG:g,zIndexPopup:y,contentPadding:w,contentBg:b}=t,C=`${e}-notice`,P=new xa("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:p,transform:"translateY(0)",opacity:1}}),v=new xa("MessageMoveOut",{"0%":{maxHeight:t.height,padding:p,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),T={padding:p,textAlign:"center",[`${e}-custom-content > ${n}`]:{verticalAlign:"text-bottom",marginInlineEnd:f,fontSize:c},[`${C}-content`]:{display:"inline-block",padding:w,background:b,borderRadius:g,boxShadow:o,pointerEvents:"all"},[`${e}-success > ${n}`]:{color:i},[`${e}-error > ${n}`]:{color:a},[`${e}-warning > ${n}`]:{color:l},[`${e}-info > ${n}, + onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,ZCt="".concat($Ct," ").concat(QCt).split(/[\s\n]+/),eRt="aria-",tRt="data-";function x7e(t,e){return t.indexOf(e)===0}function Sf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;e===!1?n={aria:!0,data:!0,attr:!0}:e===!0?n={aria:!0}:n=qt({},e);var o={};return Object.keys(t).forEach(function(r){(n.aria&&(r==="role"||x7e(r,eRt))||n.data&&x7e(r,tRt)||n.attr&&ZCt.includes(r))&&(o[r]=t[r])}),o}var yVe=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.style,r=t.className,i=t.duration,a=i===void 0?4.5:i,l=t.eventKey,s=t.content,c=t.closable,u=t.closeIcon,d=u===void 0?"x":u,f=t.props,p=t.onClick,g=t.onNoticeClose,y=t.times,w=t.hovering,b=m.useState(!1),C=ln(b,2),P=C[0],v=C[1],T=w||P,A=function(){g(l)},x=function(E){(E.key==="Enter"||E.code==="Enter"||E.keyCode===Bn.ENTER)&&A()};m.useEffect(function(){if(!T&&a>0){var D=setTimeout(function(){A()},a*1e3);return function(){clearTimeout(D)}}},[a,T,y]);var S=m.useMemo(function(){return hi(c)==="object"&&c!==null?c:c?{closeIcon:d}:{}},[c,d]),R=Sf(S,!0),M="".concat(n,"-notice");return m.createElement("div",ho({},f,{ref:e,className:Vn(M,r,Vt({},"".concat(M,"-closable"),c)),style:o,onMouseEnter:function(E){var W;v(!0),f==null||(W=f.onMouseEnter)===null||W===void 0||W.call(f,E)},onMouseLeave:function(E){var W;v(!1),f==null||(W=f.onMouseLeave)===null||W===void 0||W.call(f,E)},onClick:p}),m.createElement("div",{className:"".concat(M,"-content")},s),c&&m.createElement("a",ho({tabIndex:0,className:"".concat(M,"-close"),onKeyDown:x,"aria-label":"Close"},R,{onClick:function(E){E.preventDefault(),E.stopPropagation(),A()}}),S.closeIcon))}),AVe=be.createContext({}),nRt=function(e){var n=e.children,o=e.classNames;return be.createElement(AVe.Provider,{value:{classNames:o}},n)},b7e=8,S7e=3,T7e=16,oRt=function(e){var n={offset:b7e,threshold:S7e,gap:T7e};if(e&&hi(e)==="object"){var o,r,i;n.offset=(o=e.offset)!==null&&o!==void 0?o:b7e,n.threshold=(r=e.threshold)!==null&&r!==void 0?r:S7e,n.gap=(i=e.gap)!==null&&i!==void 0?i:T7e}return[!!e,n]},rRt=["className","style","classNames","styles"],iRt=function(e){var n=e.configList,o=e.placement,r=e.prefixCls,i=e.className,a=e.style,l=e.motion,s=e.onAllNoticeRemoved,c=e.onNoticeClose,u=e.stack,d=m.useContext(AVe),f=d.classNames,p=m.useRef({}),g=m.useState(null),y=ln(g,2),w=y[0],b=y[1],C=m.useState([]),P=ln(C,2),v=P[0],T=P[1],A=n.map(function(k){return{config:k,key:String(k.key)}}),x=oRt(u),S=ln(x,2),R=S[0],M=S[1],D=M.offset,E=M.threshold,W=M.gap,j=R&&(v.length>0||A.length<=E),L=typeof l=="function"?l(o):l;return m.useEffect(function(){R&&v.length>1&&T(function(k){return k.filter(function(N){return A.some(function(F){var U=F.key;return N===U})})})},[v,A,R]),m.useEffect(function(){var k;if(R&&p.current[(k=A[A.length-1])===null||k===void 0?void 0:k.key]){var N;b(p.current[(N=A[A.length-1])===null||N===void 0?void 0:N.key])}},[A,R]),be.createElement(eCt,ho({key:o,className:Vn(r,"".concat(r,"-").concat(o),f==null?void 0:f.list,i,Vt(Vt({},"".concat(r,"-stack"),!!R),"".concat(r,"-stack-expanded"),j)),style:a,keys:A,motionAppear:!0},L,{onAllRemoved:function(){s(o)}}),function(k,N){var F=k.config,U=k.className,O=k.style,B=k.index,_=F,X=_.key,$=_.times,Q=String(X),le=F,q=le.className,te=le.style,re=le.classNames,ae=le.styles,se=ii(le,rRt),ne=A.findIndex(function(ce){return ce.key===Q}),fe={};if(R){var ge=A.length-1-(ne>-1?ne:B-1),de=o==="top"||o==="bottom"?"-50%":"0";if(ge>0){var Z,he,xe;fe.height=j?(Z=p.current[Q])===null||Z===void 0?void 0:Z.offsetHeight:w==null?void 0:w.offsetHeight;for(var He=0,Se=0;Se-1?p.current[Q]=pe:delete p.current[Q]},prefixCls:r,classNames:re,styles:ae,className:Vn(q,f==null?void 0:f.notice),style:te,times:$,key:X,eventKey:X,onNoticeClose:c,hovering:R&&v.length>0})))})},aRt=m.forwardRef(function(t,e){var n=t.prefixCls,o=n===void 0?"rc-notification":n,r=t.container,i=t.motion,a=t.maxCount,l=t.className,s=t.style,c=t.onAllRemoved,u=t.stack,d=t.renderNotifications,f=m.useState([]),p=ln(f,2),g=p[0],y=p[1],w=function(R){var M,D=g.find(function(E){return E.key===R});D==null||(M=D.onClose)===null||M===void 0||M.call(D),y(function(E){return E.filter(function(W){return W.key!==R})})};m.useImperativeHandle(e,function(){return{open:function(R){y(function(M){var D=Lo(M),E=D.findIndex(function(L){return L.key===R.key}),W=qt({},R);if(E>=0){var j;W.times=(((j=M[E])===null||j===void 0?void 0:j.times)||0)+1,D[E]=W}else W.times=0,D.push(W);return a>0&&D.length>a&&(D=D.slice(-a)),D})},close:function(R){w(R)},destroy:function(){y([])}}});var b=m.useState({}),C=ln(b,2),P=C[0],v=C[1];m.useEffect(function(){var S={};g.forEach(function(R){var M=R.placement,D=M===void 0?"topRight":M;D&&(S[D]=S[D]||[],S[D].push(R))}),Object.keys(P).forEach(function(R){S[R]=S[R]||[]}),v(S)},[g]);var T=function(R){v(function(M){var D=qt({},M),E=D[R]||[];return E.length||delete D[R],D})},A=m.useRef(!1);if(m.useEffect(function(){Object.keys(P).length>0?A.current=!0:A.current&&(c==null||c(),A.current=!1)},[P]),!r)return null;var x=Object.keys(P);return Cd.createPortal(m.createElement(m.Fragment,null,x.map(function(S){var R=P[S],M=m.createElement(iRt,{key:S,configList:R,placement:S,prefixCls:o,className:l==null?void 0:l(S),style:s==null?void 0:s(S),motion:i,onNoticeClose:w,onAllNoticeRemoved:T,stack:u});return d?d(M,{prefixCls:o,key:S}):M})),r)}),lRt=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],sRt=function(){return document.body},P7e=0;function cRt(){for(var t={},e=arguments.length,n=new Array(e),o=0;o0&&arguments[0]!==void 0?arguments[0]:{},e=t.getContainer,n=e===void 0?sRt:e,o=t.motion,r=t.prefixCls,i=t.maxCount,a=t.className,l=t.style,s=t.onAllRemoved,c=t.stack,u=t.renderNotifications,d=ii(t,lRt),f=m.useState(),p=ln(f,2),g=p[0],y=p[1],w=m.useRef(),b=m.createElement(aRt,{container:g,ref:w,prefixCls:r,motion:o,maxCount:i,className:a,style:l,onAllRemoved:s,stack:c,renderNotifications:u}),C=m.useState([]),P=ln(C,2),v=P[0],T=P[1],A=m.useMemo(function(){return{open:function(S){var R=cRt(d,S);(R.key===null||R.key===void 0)&&(R.key="rc-notification-".concat(P7e),P7e+=1),T(function(M){return[].concat(Lo(M),[{type:"open",config:R}])})},close:function(S){T(function(R){return[].concat(Lo(R),[{type:"close",key:S}])})},destroy:function(){T(function(S){return[].concat(Lo(S),[{type:"destroy"}])})}}},[]);return m.useEffect(function(){y(n())}),m.useEffect(function(){w.current&&v.length&&(v.forEach(function(x){switch(x.type){case"open":w.current.open(x.config);break;case"close":w.current.close(x.key);break;case"destroy":w.current.destroy();break}}),T(function(x){return x.filter(function(S){return!v.includes(S)})}))},[v]),[A,b]}var dRt={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},fRt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:dRt}))},UH=m.forwardRef(fRt);const DW=be.createContext(void 0),dv=100,hRt=10,wme=dv*hRt,wVe={Modal:dv,Drawer:dv,Popover:dv,Popconfirm:dv,Tooltip:dv,Tour:dv},pRt={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function gRt(t){return t in wVe}function Ww(t,e){const[,n]=_u(),o=be.useContext(DW),r=gRt(t);if(e!==void 0)return[e,e];let i=o??0;return r?(i+=(o?0:n.zIndexPopupBase)+wVe[t],i=Math.min(i,n.zIndexPopupBase+wme)):i+=pRt[t],[o===void 0?e:i,i]}const mRt=t=>{const{componentCls:e,iconCls:n,boxShadow:o,colorText:r,colorSuccess:i,colorError:a,colorWarning:l,colorInfo:s,fontSizeLG:c,motionEaseInOutCirc:u,motionDurationSlow:d,marginXS:f,paddingXS:p,borderRadiusLG:g,zIndexPopup:y,contentPadding:w,contentBg:b}=t,C=`${e}-notice`,P=new xa("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:p,transform:"translateY(0)",opacity:1}}),v=new xa("MessageMoveOut",{"0%":{maxHeight:t.height,padding:p,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),T={padding:p,textAlign:"center",[`${e}-custom-content > ${n}`]:{verticalAlign:"text-bottom",marginInlineEnd:f,fontSize:c},[`${C}-content`]:{display:"inline-block",padding:w,background:b,borderRadius:g,boxShadow:o,pointerEvents:"all"},[`${e}-success > ${n}`]:{color:i},[`${e}-error > ${n}`]:{color:a},[`${e}-warning > ${n}`]:{color:l},[`${e}-info > ${n}, ${e}-loading > ${n}`]:{color:s}};return[{[e]:Object.assign(Object.assign({},ja(t)),{color:r,position:"fixed",top:f,width:"100%",pointerEvents:"none",zIndex:y,[`${e}-move-up`]:{animationFillMode:"forwards"},[` ${e}-move-up-appear, ${e}-move-up-enter `]:{animationName:P,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},[` ${e}-move-up-appear${e}-move-up-appear-active, ${e}-move-up-enter${e}-move-up-enter-active - `]:{animationPlayState:"running"},[`${e}-move-up-leave`]:{animationName:v,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},[`${e}-move-up-leave${e}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[e]:{[`${C}-wrapper`]:Object.assign({},T)}},{[`${e}-notice-pure-panel`]:Object.assign(Object.assign({},T),{padding:0,textAlign:"start"})}]},yRt=t=>({zIndexPopup:t.zIndexPopupBase+Ame+10,contentBg:t.colorBgElevated,contentPadding:`${(t.controlHeightLG-t.fontSize*t.lineHeight)/2}px ${t.paddingSM}px`}),vVe=wl("Message",t=>{const e=Ki(t,{height:150});return[mRt(e)]},yRt);var ARt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{let{prefixCls:e,type:n,icon:o,children:r}=t;return m.createElement("div",{className:Un(`${e}-custom-content`,`${e}-${n}`)},o||wRt[n],m.createElement("span",null,r))},vRt=t=>{const{prefixCls:e,className:n,type:o,icon:r,content:i}=t,a=ARt(t,["prefixCls","className","type","icon","content"]),{getPrefixCls:l}=m.useContext(Cr),s=e||l("message"),c=O0(s),[u,d,f]=vVe(s,c);return u(m.createElement(yVe,Object.assign({},a,{prefixCls:s,className:Un(n,d,`${s}-notice-pure-panel`,f,c),eventKey:"pure",duration:null,content:m.createElement(xVe,{prefixCls:s,type:o,icon:r},i)})))};function xRt(t,e){return{motionName:e??`${t}-move-up`}}function wme(t){let e;const n=new Promise(r=>{e=t(()=>{r(!0)})}),o=()=>{e==null||e()};return o.then=(r,i)=>n.then(r,i),o.promise=n,o}var bRt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{let{children:e,prefixCls:n}=t;const o=O0(n),[r,i,a]=vVe(n,o);return r(m.createElement(nRt,{classNames:{list:Un(i,a,o)}},e))},CRt=(t,e)=>{let{prefixCls:n,key:o}=e;return m.createElement(PRt,{prefixCls:n,key:o},t)},RRt=m.forwardRef((t,e)=>{const{top:n,prefixCls:o,getContainer:r,maxCount:i,duration:a=TRt,rtl:l,transitionName:s,onAllRemoved:c}=t,{getPrefixCls:u,getPopupContainer:d,message:f,direction:p}=m.useContext(Cr),g=o||u("message"),y=()=>({left:"50%",transform:"translateX(-50%)",top:n??SRt}),w=()=>Un({[`${g}-rtl`]:l??p==="rtl"}),b=()=>xRt(g,s),C=m.createElement("span",{className:`${g}-close-x`},m.createElement(Lw,{className:`${g}-close-icon`})),[P,v]=uRt({prefixCls:g,style:y,className:w,motion:b,closable:!1,closeIcon:C,duration:a,getContainer:()=>(r==null?void 0:r())||(d==null?void 0:d())||document.body,maxCount:i,onAllRemoved:c,renderNotifications:CRt});return m.useImperativeHandle(e,()=>Object.assign(Object.assign({},P),{prefixCls:g,message:f})),v});let P7e=0;function bVe(t){const e=m.useRef(null);return kb(),[m.useMemo(()=>{const o=s=>{var c;(c=e.current)===null||c===void 0||c.close(s)},r=s=>{if(!e.current){const A=()=>{};return A.then=()=>{},A}const{open:c,prefixCls:u,message:d}=e.current,f=`${u}-notice`,{content:p,icon:g,type:y,key:w,className:b,style:C,onClose:P}=s,v=bRt(s,["content","icon","type","key","className","style","onClose"]);let T=w;return T==null&&(P7e+=1,T=`antd-message-${P7e}`),wme(A=>(c(Object.assign(Object.assign({},v),{key:T,content:m.createElement(xVe,{prefixCls:u,type:y,icon:g},p),placement:"top",className:Un(y&&`${f}-${y}`,b,d==null?void 0:d.className),style:Object.assign(Object.assign({},d==null?void 0:d.style),C),onClose:()=>{P==null||P(),A()}})),()=>{o(T)}))},a={open:r,destroy:s=>{var c;s!==void 0?o(s):(c=e.current)===null||c===void 0||c.destroy()}};return["info","success","warning","error","loading"].forEach(s=>{const c=(u,d,f)=>{let p;u&&typeof u=="object"&&"content"in u?p=u:p={content:u};let g,y;typeof d=="function"?y=d:(g=d,y=f);const w=Object.assign(Object.assign({onClose:y,duration:g},p),{type:s});return r(w)};a[s]=c}),a},[]),m.createElement(RRt,Object.assign({key:"message-holder"},t,{ref:e}))]}function HRt(t){return bVe(t)}function MRt(){const[t,e]=m.useState([]),n=m.useCallback(o=>(e(r=>[].concat(Za(r),[o])),()=>{e(r=>r.filter(i=>i!==o))}),[]);return[t,n]}function tk(){tk=function(){return e};var t,e={},n=Object.prototype,o=n.hasOwnProperty,r=Object.defineProperty||function(k,N,F){k[N]=F.value},i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(k,N,F){return Object.defineProperty(k,N,{value:F,enumerable:!0,configurable:!0,writable:!0}),k[N]}try{c({},"")}catch{c=function(F,U,O){return F[U]=O}}function u(k,N,F,U){var O=N&&N.prototype instanceof b?N:b,B=Object.create(O.prototype),_=new j(U||[]);return r(B,"_invoke",{value:M(k,F,_)}),B}function d(k,N,F){try{return{type:"normal",arg:k.call(N,F)}}catch(U){return{type:"throw",arg:U}}}e.wrap=u;var f="suspendedStart",p="suspendedYield",g="executing",y="completed",w={};function b(){}function C(){}function P(){}var v={};c(v,a,function(){return this});var T=Object.getPrototypeOf,A=T&&T(T(L([])));A&&A!==n&&o.call(A,a)&&(v=A);var x=P.prototype=b.prototype=Object.create(v);function S(k){["next","throw","return"].forEach(function(N){c(k,N,function(F){return this._invoke(N,F)})})}function R(k,N){function F(O,B,_,X){var $=d(k[O],k,B);if($.type!=="throw"){var Q=$.arg,le=Q.value;return le&&zg(le)=="object"&&o.call(le,"__await")?N.resolve(le.__await).then(function(q){F("next",q,_,X)},function(q){F("throw",q,_,X)}):N.resolve(le).then(function(q){Q.value=q,_(Q)},function(q){return F("throw",q,_,X)})}X($.arg)}var U;r(this,"_invoke",{value:function(B,_){function X(){return new N(function($,Q){F(B,_,$,Q)})}return U=U?U.then(X,X):X()}})}function M(k,N,F){var U=f;return function(O,B){if(U===g)throw new Error("Generator is already running");if(U===y){if(O==="throw")throw B;return{value:t,done:!0}}for(F.method=O,F.arg=B;;){var _=F.delegate;if(_){var X=D(_,F);if(X){if(X===w)continue;return X}}if(F.method==="next")F.sent=F._sent=F.arg;else if(F.method==="throw"){if(U===f)throw U=y,F.arg;F.dispatchException(F.arg)}else F.method==="return"&&F.abrupt("return",F.arg);U=g;var $=d(k,N,F);if($.type==="normal"){if(U=F.done?y:p,$.arg===w)continue;return{value:$.arg,done:F.done}}$.type==="throw"&&(U=y,F.method="throw",F.arg=$.arg)}}}function D(k,N){var F=N.method,U=k.iterator[F];if(U===t)return N.delegate=null,F==="throw"&&k.iterator.return&&(N.method="return",N.arg=t,D(k,N),N.method==="throw")||F!=="return"&&(N.method="throw",N.arg=new TypeError("The iterator does not provide a '"+F+"' method")),w;var O=d(U,k.iterator,N.arg);if(O.type==="throw")return N.method="throw",N.arg=O.arg,N.delegate=null,w;var B=O.arg;return B?B.done?(N[k.resultName]=B.value,N.next=k.nextLoc,N.method!=="return"&&(N.method="next",N.arg=t),N.delegate=null,w):B:(N.method="throw",N.arg=new TypeError("iterator result is not an object"),N.delegate=null,w)}function E(k){var N={tryLoc:k[0]};1 in k&&(N.catchLoc=k[1]),2 in k&&(N.finallyLoc=k[2],N.afterLoc=k[3]),this.tryEntries.push(N)}function W(k){var N=k.completion||{};N.type="normal",delete N.arg,k.completion=N}function j(k){this.tryEntries=[{tryLoc:"root"}],k.forEach(E,this),this.reset(!0)}function L(k){if(k||k===""){var N=k[a];if(N)return N.call(k);if(typeof k.next=="function")return k;if(!isNaN(k.length)){var F=-1,U=function O(){for(;++F=0;--O){var B=this.tryEntries[O],_=B.completion;if(B.tryLoc==="root")return U("end");if(B.tryLoc<=this.prev){var X=o.call(B,"catchLoc"),$=o.call(B,"finallyLoc");if(X&&$){if(this.prev=0;--U){var O=this.tryEntries[U];if(O.tryLoc<=this.prev&&o.call(O,"finallyLoc")&&this.prev=0;--F){var U=this.tryEntries[F];if(U.finallyLoc===N)return this.complete(U.completion,U.afterLoc),W(U),w}},catch:function(N){for(var F=this.tryEntries.length-1;F>=0;--F){var U=this.tryEntries[F];if(U.tryLoc===N){var O=U.completion;if(O.type==="throw"){var B=O.arg;W(U)}return B}}throw new Error("illegal catch attempt")},delegateYield:function(N,F,U){return this.delegate={iterator:L(N),resultName:F,nextLoc:U},this.method==="next"&&(this.arg=t),w}},e}function C7e(t,e,n,o,r,i,a){try{var l=t[i](a),s=l.value}catch(c){n(c);return}l.done?e(s):Promise.resolve(s).then(o,r)}function SVe(t){return function(){var e=this,n=arguments;return new Promise(function(o,r){var i=t.apply(e,n);function a(s){C7e(i,o,r,a,l,"next",s)}function l(s){C7e(i,o,r,a,l,"throw",s)}a(void 0)})}}var DW=uR({},eft),IRt=DW.version,zRt=DW.render,DRt=DW.unmountComponentAtNode,F$;try{var ERt=Number((IRt||"").split(".")[0]);ERt>=18&&(F$=DW.createRoot)}catch{}function R7e(t){var e=DW.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&zg(e)==="object"&&(e.usingClientEntryPoint=t)}var DG="__rc_react_root__";function FRt(t,e){R7e(!0);var n=e[DG]||F$(e);R7e(!1),n.render(t),e[DG]=n}function kRt(t,e){zRt(t,e)}function vme(t,e){if(F$){FRt(t,e);return}kRt(t,e)}function LRt(t){return M0e.apply(this,arguments)}function M0e(){return M0e=SVe(tk().mark(function t(e){return tk().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Promise.resolve().then(function(){var r;(r=e[DG])===null||r===void 0||r.unmount(),delete e[DG]}));case 1:case"end":return o.stop()}},t)})),M0e.apply(this,arguments)}function WRt(t){DRt(t)}function TVe(t){return I0e.apply(this,arguments)}function I0e(){return I0e=SVe(tk().mark(function t(e){return tk().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(F$===void 0){o.next=2;break}return o.abrupt("return",LRt(e));case 2:WRt(e);case 3:case"end":return o.stop()}},t)})),I0e.apply(this,arguments)}const _re=()=>({height:0,opacity:0}),H7e=t=>{const{scrollHeight:e}=t;return{height:e,opacity:1}},NRt=t=>({height:t?t.offsetHeight:0}),Vre=(t,e)=>(e==null?void 0:e.deadline)===!0||e.propertyName==="height",xme=function(){return{motionName:`${arguments.length>0&&arguments[0]!==void 0?arguments[0]:"ant"}-motion-collapse`,onAppearStart:_re,onEnterStart:_re,onAppearActive:H7e,onEnterActive:H7e,onLeaveStart:NRt,onLeaveActive:_re,onAppearEnd:Vre,onEnterEnd:Vre,onLeaveEnd:Vre,motionDeadline:500}},j9=(t,e,n)=>n!==void 0?n:`${t}-${e}`,URt=function(t){if(!t)return!1;if(t instanceof Element){if(t.offsetParent)return!0;if(t.getBBox){var e=t.getBBox(),n=e.width,o=e.height;if(n||o)return!0}if(t.getBoundingClientRect){var r=t.getBoundingClientRect(),i=r.width,a=r.height;if(i||a)return!0}}return!1},jRt=t=>{const{componentCls:e,colorPrimary:n}=t;return{[e]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${n})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${t.motionEaseOutCirc}`,`opacity 2s ${t.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow ${t.motionDurationSlow} ${t.motionEaseInOut}`,`opacity ${t.motionDurationSlow} ${t.motionEaseInOut}`].join(",")}}}}},BRt=hme("Wave",t=>[jRt(t)]),k$="ant-wave-target";function YRt(t){const e=(t||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return e&&e[1]&&e[2]&&e[3]?!(e[1]===e[2]&&e[2]===e[3]):!0}function Gre(t){return t&&t!=="#fff"&&t!=="#ffffff"&&t!=="rgb(255, 255, 255)"&&t!=="rgba(255, 255, 255, 1)"&&YRt(t)&&!/rgba\((?:\d*, ){3}0\)/.test(t)&&t!=="transparent"}function ORt(t){const{borderTopColor:e,borderColor:n,backgroundColor:o}=getComputedStyle(t);return Gre(e)?e:Gre(n)?n:Gre(o)?o:null}function Xre(t){return Number.isNaN(t)?0:t}const _Rt=t=>{const{className:e,target:n,component:o}=t,r=m.useRef(null),[i,a]=m.useState(null),[l,s]=m.useState([]),[c,u]=m.useState(0),[d,f]=m.useState(0),[p,g]=m.useState(0),[y,w]=m.useState(0),[b,C]=m.useState(!1),P={left:c,top:d,width:p,height:y,borderRadius:l.map(A=>`${A}px`).join(" ")};i&&(P["--wave-color"]=i);function v(){const A=getComputedStyle(n);a(ORt(n));const x=A.position==="static",{borderLeftWidth:S,borderTopWidth:R}=A;u(x?n.offsetLeft:Xre(-parseFloat(S))),f(x?n.offsetTop:Xre(-parseFloat(R))),g(n.offsetWidth),w(n.offsetHeight);const{borderTopLeftRadius:M,borderTopRightRadius:D,borderBottomLeftRadius:E,borderBottomRightRadius:W}=A;s([M,D,W,E].map(j=>Xre(parseFloat(j))))}if(m.useEffect(()=>{if(n){const A=Dg(()=>{v(),C(!0)});let x;return typeof ResizeObserver<"u"&&(x=new ResizeObserver(v),x.observe(n)),()=>{Dg.cancel(A),x==null||x.disconnect()}}},[]),!b)return null;const T=(o==="Checkbox"||o==="Radio")&&(n==null?void 0:n.classList.contains(k$));return m.createElement(o1,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(A,x)=>{var S;if(x.deadline||x.propertyName==="opacity"){const R=(S=r.current)===null||S===void 0?void 0:S.parentElement;TVe(R).then(()=>{R==null||R.remove()})}return!1}},A=>{let{className:x}=A;return m.createElement("div",{ref:r,className:Un(e,{"wave-quick":T},x),style:P})})},VRt=(t,e)=>{var n;const{component:o}=e;if(o==="Checkbox"&&!(!((n=t.querySelector("input"))===null||n===void 0)&&n.checked))return;const r=document.createElement("div");r.style.position="absolute",r.style.left="0px",r.style.top="0px",t==null||t.insertBefore(r,t==null?void 0:t.firstChild),vme(m.createElement(_Rt,Object.assign({},e,{target:t})),r)},GRt=(t,e,n)=>{const{wave:o}=m.useContext(Cr),[,r,i]=_u(),a=q6(c=>{const u=t.current;if(o!=null&&o.disabled||!u)return;const d=u.querySelector(`.${k$}`)||u,{showEffect:f}=o||{};(f||VRt)(d,{className:e,token:r,component:n,event:c,hashId:i})}),l=m.useRef();return c=>{Dg.cancel(l.current),l.current=Dg(()=>{a(c)})}},EW=t=>{const{children:e,disabled:n,component:o}=t,{getPrefixCls:r}=m.useContext(Cr),i=m.useRef(null),a=r("wave"),[,l]=BRt(a),s=GRt(i,Un(a,l),o);if(be.useEffect(()=>{const u=i.current;if(!u||u.nodeType!==1||n)return;const d=f=>{!URt(f.target)||!u.getAttribute||u.getAttribute("disabled")||u.disabled||u.className.includes("disabled")||u.className.includes("-leave")||s(f)};return u.addEventListener("click",d,!0),()=>{u.removeEventListener("click",d,!0)}},[n]),!be.isValidElement(e))return e??null;const c=L_e(e)?o5(e.ref,i):i;return B0(e,{ref:c})},Ed=t=>{const e=be.useContext(pR);return be.useMemo(()=>t?typeof t=="string"?t??e:t instanceof Function?t(e):e:e,[t,e])};function B9(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[];return be.Children.forEach(t,function(o){o==null&&!e.keepEmpty||(Array.isArray(o)?n=n.concat(B9(o)):CC.isFragment(o)&&o.props?n=n.concat(B9(o.props.children,e)):n.push(o))}),n}const XRt=t=>{const{componentCls:e}=t;return{[e]:{"&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"}}}},JRt=t=>{const{componentCls:e,antCls:n}=t;return{[e]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${e}-item:empty`]:{display:"none"},[`${e}-item > ${n}-badge-not-a-wrapper:only-child`]:{display:"block"}}}},KRt=t=>{const{componentCls:e}=t;return{[e]:{"&-gap-row-small":{rowGap:t.spaceGapSmallSize},"&-gap-row-middle":{rowGap:t.spaceGapMiddleSize},"&-gap-row-large":{rowGap:t.spaceGapLargeSize},"&-gap-col-small":{columnGap:t.spaceGapSmallSize},"&-gap-col-middle":{columnGap:t.spaceGapMiddleSize},"&-gap-col-large":{columnGap:t.spaceGapLargeSize}}}},PVe=wl("Space",t=>{const e=Ki(t,{spaceGapSmallSize:t.paddingXS,spaceGapMiddleSize:t.padding,spaceGapLargeSize:t.paddingLG});return[JRt(e),KRt(e),XRt(e)]},()=>({}),{resetStyle:!1});var CVe=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const n=m.useContext(L$),o=m.useMemo(()=>{if(!n)return"";const{compactDirection:r,isFirstItem:i,isLastItem:a}=n,l=r==="vertical"?"-vertical-":"-";return Un(`${t}-compact${l}item`,{[`${t}-compact${l}first-item`]:i,[`${t}-compact${l}last-item`]:a,[`${t}-compact${l}item-rtl`]:e==="rtl"})},[t,e,n]);return{compactSize:n==null?void 0:n.compactSize,compactDirection:n==null?void 0:n.compactDirection,compactItemClassnames:o}},Y9=t=>{let{children:e}=t;return m.createElement(L$.Provider,{value:null},e)},qRt=t=>{var{children:e}=t,n=CVe(t,["children"]);return m.createElement(L$.Provider,{value:n},e)},$Rt=t=>{const{getPrefixCls:e,direction:n}=m.useContext(Cr),{size:o,direction:r,block:i,prefixCls:a,className:l,rootClassName:s,children:c}=t,u=CVe(t,["size","direction","block","prefixCls","className","rootClassName","children"]),d=Ed(P=>o??P),f=e("space-compact",a),[p,g]=PVe(f),y=Un(f,g,{[`${f}-rtl`]:n==="rtl",[`${f}-block`]:i,[`${f}-vertical`]:r==="vertical"},l,s),w=m.useContext(L$),b=B9(c),C=m.useMemo(()=>b.map((P,v)=>{const T=P&&P.key||`${f}-item-${v}`;return m.createElement(qRt,{key:T,compactSize:d,compactDirection:r,isFirstItem:v===0&&(!w||(w==null?void 0:w.isFirstItem)),isLastItem:v===b.length-1&&(!w||(w==null?void 0:w.isLastItem))},P)}),[o,b,w]);return b.length===0?null:p(m.createElement("div",Object.assign({className:y},u),C))},QRt=$Rt;var ZRt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{getPrefixCls:e,direction:n}=m.useContext(Cr),{prefixCls:o,size:r,className:i}=t,a=ZRt(t,["prefixCls","size","className"]),l=e("btn-group",o),[,,s]=_u();let c="";switch(r){case"large":c="lg";break;case"small":c="sm";break}const u=Un(l,{[`${l}-${c}`]:c,[`${l}-rtl`]:n==="rtl"},i,s);return m.createElement(RVe.Provider,{value:r},m.createElement("div",Object.assign({},a,{className:u})))},M7e=/^[\u4e00-\u9fa5]{2}$/,z0e=M7e.test.bind(M7e);function HVe(t){return t==="danger"?{danger:!0}:{type:t}}function I7e(t){return typeof t=="string"}function Jre(t){return t==="text"||t==="link"}function tHt(t,e){if(t==null)return;const n=e?" ":"";return typeof t!="string"&&typeof t!="number"&&I7e(t.type)&&z0e(t.props.children)?B0(t,{children:t.props.children.split("").join(n)}):I7e(t)?z0e(t)?be.createElement("span",null,t.split("").join(n)):be.createElement("span",null,t):gVe(t)?be.createElement("span",null,t):t}function nHt(t,e){let n=!1;const o=[];return be.Children.forEach(t,r=>{const i=typeof r,a=i==="string"||i==="number";if(n&&a){const l=o.length-1,s=o[l];o[l]=`${s}${r}`}else o.push(r);n=a}),be.Children.map(o,r=>tHt(r,e))}const MVe=m.forwardRef((t,e)=>{const{className:n,style:o,children:r,prefixCls:i}=t,a=Un(`${i}-icon`,n);return be.createElement("span",{ref:e,className:a,style:o},r)}),z7e=m.forwardRef((t,e)=>{const{prefixCls:n,className:o,style:r,iconClassName:i,iconPosition:a="start"}=t,l=Un(o,{[`${n}-loading-icon-end`]:a==="end",[`${n}-loading-icon`]:a==="start"});return be.createElement(MVe,{prefixCls:n,className:l,style:r,ref:e},be.createElement(UH,{className:i}))}),Kre=()=>({width:0,opacity:0,transform:"scale(0)"}),qre=t=>({width:t.scrollWidth,opacity:1,transform:"scale(1)"}),oHt=t=>{const{prefixCls:e,loading:n,existIcon:o,className:r,style:i,iconPosition:a}=t,l=!!n;return o?be.createElement(z7e,{prefixCls:e,className:r,style:i,iconPosition:a}):be.createElement(o1,{visible:l,motionName:`${e}-loading-icon-motion`,motionLeave:l,removeOnLeave:!0,onAppearStart:Kre,onAppearActive:qre,onEnterStart:Kre,onEnterActive:qre,onLeaveStart:qre,onLeaveActive:Kre},(s,c)=>{let{className:u,style:d}=s;return be.createElement(z7e,{prefixCls:e,className:r,style:Object.assign(Object.assign({},i),d),ref:c,iconClassName:u,iconPosition:a})})},D7e=(t,e)=>({[`> span, > ${t}`]:{"&:not(:last-child)":{[`&, & > ${t}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${t}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),rHt=t=>{const{componentCls:e,fontSize:n,lineWidth:o,groupBorderColor:r,colorErrorHover:i}=t;return{[`${e}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:t.calc(o).mul(-1).equal(),[`&, & > ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[e]:{position:"relative",zIndex:1,"&:hover,\n &:focus,\n &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${e}-icon-only`]:{fontSize:n}},D7e(`${e}-primary`,r),D7e(`${e}-danger`,i)]}},IVe=t=>{const{paddingInline:e,onlyIconSize:n,paddingBlock:o}=t;return Ki(t,{buttonPaddingHorizontal:e,buttonPaddingVertical:o,buttonIconOnlyFontSize:n})},zVe=t=>{var e,n,o,r,i,a;const l=(e=t.contentFontSize)!==null&&e!==void 0?e:t.fontSize,s=(n=t.contentFontSizeSM)!==null&&n!==void 0?n:t.fontSize,c=(o=t.contentFontSizeLG)!==null&&o!==void 0?o:t.fontSizeLG,u=(r=t.contentLineHeight)!==null&&r!==void 0?r:O_(l),d=(i=t.contentLineHeightSM)!==null&&i!==void 0?i:O_(s),f=(a=t.contentLineHeightLG)!==null&&a!==void 0?a:O_(c);return{fontWeight:400,defaultShadow:`0 ${t.controlOutlineWidth}px 0 ${t.controlTmpOutline}`,primaryShadow:`0 ${t.controlOutlineWidth}px 0 ${t.controlOutline}`,dangerShadow:`0 ${t.controlOutlineWidth}px 0 ${t.colorErrorOutline}`,primaryColor:t.colorTextLightSolid,dangerColor:t.colorTextLightSolid,borderColorDisabled:t.colorBorder,defaultGhostColor:t.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:t.colorBgContainer,paddingInline:t.paddingContentHorizontal-t.lineWidth,paddingInlineLG:t.paddingContentHorizontal-t.lineWidth,paddingInlineSM:8-t.lineWidth,onlyIconSize:t.fontSizeLG,onlyIconSizeSM:t.fontSizeLG-2,onlyIconSizeLG:t.fontSizeLG+2,groupBorderColor:t.colorPrimaryHover,linkHoverBg:"transparent",textHoverBg:t.colorBgTextHover,defaultColor:t.colorText,defaultBg:t.colorBgContainer,defaultBorderColor:t.colorBorder,defaultBorderColorDisabled:t.colorBorder,defaultHoverBg:t.colorBgContainer,defaultHoverColor:t.colorPrimaryHover,defaultHoverBorderColor:t.colorPrimaryHover,defaultActiveBg:t.colorBgContainer,defaultActiveColor:t.colorPrimaryActive,defaultActiveBorderColor:t.colorPrimaryActive,contentFontSize:l,contentFontSizeSM:s,contentFontSizeLG:c,contentLineHeight:u,contentLineHeightSM:d,contentLineHeightLG:f,paddingBlock:Math.max((t.controlHeight-l*u)/2-t.lineWidth,0),paddingBlockSM:Math.max((t.controlHeightSM-s*d)/2-t.lineWidth,0),paddingBlockLG:Math.max((t.controlHeightLG-c*f)/2-t.lineWidth,0)}},iHt=t=>{const{componentCls:e,iconCls:n,fontWeight:o}=t;return{[e]:{outline:"none",position:"relative",display:"inline-block",fontWeight:o,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:`${Nt(t.lineWidth)} ${t.lineType} transparent`,cursor:"pointer",transition:`all ${t.motionDurationMid} ${t.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",color:t.colorText,"&:disabled > *":{pointerEvents:"none"},"> span":{display:"inline-block"},[`${e}-icon`]:{lineHeight:0,"&-end":{marginInlineStart:t.marginXS}},[`> ${n} + span, > span + ${n}`]:{marginInlineStart:t.marginXS},[`&:not(${e}-icon-only) > ${e}-icon`]:{[`&${e}-loading-icon, &:not(:last-child)`]:{marginInlineEnd:t.marginXS},[`&${e}-loading-icon-end`]:{marginInlineStart:t.marginXS}},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},Q6(t)),[`&${e}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${e}-two-chinese-chars > *:not(${n})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&-icon-only${e}-compact-item`]:{flex:"none"}}}},Z6=(t,e,n)=>({[`&:not(:disabled):not(${t}-disabled)`]:{"&:hover":e,"&:active":n}}),aHt=t=>({minWidth:t.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),lHt=t=>({borderRadius:t.controlHeight,paddingInlineStart:t.calc(t.controlHeight).div(2).equal(),paddingInlineEnd:t.calc(t.controlHeight).div(2).equal()}),sHt=t=>({cursor:"not-allowed",borderColor:t.borderColorDisabled,color:t.colorTextDisabled,background:t.colorBgContainerDisabled,boxShadow:"none"}),nk=(t,e,n,o,r,i,a,l)=>({[`&${t}-background-ghost`]:Object.assign(Object.assign({color:n||void 0,background:e,borderColor:o||void 0,boxShadow:"none"},Z6(t,Object.assign({background:e},a),Object.assign({background:e},l))),{"&:disabled":{cursor:"not-allowed",color:r||void 0,borderColor:i||void 0}})}),bme=t=>({[`&:disabled, &${t.componentCls}-disabled`]:Object.assign({},sHt(t))}),DVe=t=>Object.assign({},bme(t)),EG=t=>({[`&:disabled, &${t.componentCls}-disabled`]:{cursor:"not-allowed",color:t.colorTextDisabled}}),EVe=t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},DVe(t)),{background:t.defaultBg,borderColor:t.defaultBorderColor,color:t.defaultColor,boxShadow:t.defaultShadow}),Z6(t.componentCls,{color:t.defaultHoverColor,borderColor:t.defaultHoverBorderColor,background:t.defaultHoverBg},{color:t.defaultActiveColor,borderColor:t.defaultActiveBorderColor,background:t.defaultActiveBg})),nk(t.componentCls,t.ghostBg,t.defaultGhostColor,t.defaultGhostBorderColor,t.colorTextDisabled,t.colorBorder)),{[`&${t.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({color:t.colorError,borderColor:t.colorError},Z6(t.componentCls,{color:t.colorErrorHover,borderColor:t.colorErrorBorderHover},{color:t.colorErrorActive,borderColor:t.colorErrorActive})),nk(t.componentCls,t.ghostBg,t.colorError,t.colorError,t.colorTextDisabled,t.colorBorder)),bme(t))}),cHt=t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},DVe(t)),{color:t.primaryColor,background:t.colorPrimary,boxShadow:t.primaryShadow}),Z6(t.componentCls,{color:t.colorTextLightSolid,background:t.colorPrimaryHover},{color:t.colorTextLightSolid,background:t.colorPrimaryActive})),nk(t.componentCls,t.ghostBg,t.colorPrimary,t.colorPrimary,t.colorTextDisabled,t.colorBorder,{color:t.colorPrimaryHover,borderColor:t.colorPrimaryHover},{color:t.colorPrimaryActive,borderColor:t.colorPrimaryActive})),{[`&${t.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({background:t.colorError,boxShadow:t.dangerShadow,color:t.dangerColor},Z6(t.componentCls,{background:t.colorErrorHover},{background:t.colorErrorActive})),nk(t.componentCls,t.ghostBg,t.colorError,t.colorError,t.colorTextDisabled,t.colorBorder,{color:t.colorErrorHover,borderColor:t.colorErrorHover},{color:t.colorErrorActive,borderColor:t.colorErrorActive})),bme(t))}),uHt=t=>Object.assign(Object.assign({},EVe(t)),{borderStyle:"dashed"}),dHt=t=>Object.assign(Object.assign(Object.assign({color:t.colorLink},Z6(t.componentCls,{color:t.colorLinkHover,background:t.linkHoverBg},{color:t.colorLinkActive})),EG(t)),{[`&${t.componentCls}-dangerous`]:Object.assign(Object.assign({color:t.colorError},Z6(t.componentCls,{color:t.colorErrorHover},{color:t.colorErrorActive})),EG(t))}),fHt=t=>Object.assign(Object.assign(Object.assign({},Z6(t.componentCls,{color:t.colorText,background:t.textHoverBg},{color:t.colorText,background:t.colorBgTextActive})),EG(t)),{[`&${t.componentCls}-dangerous`]:Object.assign(Object.assign({color:t.colorError},EG(t)),Z6(t.componentCls,{color:t.colorErrorHover,background:t.colorErrorBg},{color:t.colorErrorHover,background:t.colorErrorBg}))}),hHt=t=>{const{componentCls:e}=t;return{[`${e}-default`]:EVe(t),[`${e}-primary`]:cHt(t),[`${e}-dashed`]:uHt(t),[`${e}-link`]:dHt(t),[`${e}-text`]:fHt(t),[`${e}-ghost`]:nk(t.componentCls,t.ghostBg,t.colorBgContainer,t.colorBgContainer,t.colorTextDisabled,t.colorBorder)}},Sme=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:n,controlHeight:o,fontSize:r,lineHeight:i,borderRadius:a,buttonPaddingHorizontal:l,iconCls:s,buttonPaddingVertical:c}=t,u=`${n}-icon-only`;return[{[`${e}`]:{fontSize:r,lineHeight:i,height:o,padding:`${Nt(c)} ${Nt(l)}`,borderRadius:a,[`&${u}`]:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:o,paddingInlineStart:0,paddingInlineEnd:0,[`&${n}-round`]:{width:"auto"},[s]:{fontSize:t.buttonIconOnlyFontSize}},[`&${n}-loading`]:{opacity:t.opacityLoading,cursor:"default"},[`${n}-loading-icon`]:{transition:`width ${t.motionDurationSlow} ${t.motionEaseInOut}, opacity ${t.motionDurationSlow} ${t.motionEaseInOut}`}}},{[`${n}${n}-circle${e}`]:aHt(t)},{[`${n}${n}-round${e}`]:lHt(t)}]},pHt=t=>{const e=Ki(t,{fontSize:t.contentFontSize,lineHeight:t.contentLineHeight});return Sme(e,t.componentCls)},gHt=t=>{const e=Ki(t,{controlHeight:t.controlHeightSM,fontSize:t.contentFontSizeSM,lineHeight:t.contentLineHeightSM,padding:t.paddingXS,buttonPaddingHorizontal:t.paddingInlineSM,buttonPaddingVertical:t.paddingBlockSM,borderRadius:t.borderRadiusSM,buttonIconOnlyFontSize:t.onlyIconSizeSM});return Sme(e,`${t.componentCls}-sm`)},mHt=t=>{const e=Ki(t,{controlHeight:t.controlHeightLG,fontSize:t.contentFontSizeLG,lineHeight:t.contentLineHeightLG,buttonPaddingHorizontal:t.paddingInlineLG,buttonPaddingVertical:t.paddingBlockLG,borderRadius:t.borderRadiusLG,buttonIconOnlyFontSize:t.onlyIconSizeLG});return Sme(e,`${t.componentCls}-lg`)},yHt=t=>{const{componentCls:e}=t;return{[e]:{[`&${e}-block`]:{width:"100%"}}}},AHt=wl("Button",t=>{const e=IVe(t);return[iHt(e),pHt(e),gHt(e),mHt(e),yHt(e),hHt(e),rHt(e)]},zVe,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function wHt(t,e,n){const{focusElCls:o,focus:r,borderElCls:i}=n,a=i?"> *":"",l=["hover",r?"focus":null,"active"].filter(Boolean).map(s=>`&:${s} ${a}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:t.calc(t.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[l]:{zIndex:2}},o?{[`&${o}`]:{zIndex:2}}:{}),{[`&[disabled] ${a}`]:{zIndex:0}})}}function vHt(t,e,n){const{borderElCls:o}=n,r=o?`> ${o}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${r}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${r}, &${t}-sm ${r}, &${t}-lg ${r}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${r}, &${t}-sm ${r}, &${t}-lg ${r}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function FW(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:n}=t,o=`${n}-compact`;return{[o]:Object.assign(Object.assign({},wHt(t,o,e)),vHt(n,o,e))}}function xHt(t,e){return{[`&-item:not(${e}-last-item)`]:{marginBottom:t.calc(t.lineWidth).mul(-1).equal()},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function bHt(t,e){return{[`&-item:not(${e}-first-item):not(${e}-last-item)`]:{borderRadius:0},[`&-item${e}-first-item:not(${e}-last-item)`]:{[`&, &${t}-sm, &${t}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${e}-last-item:not(${e}-first-item)`]:{[`&, &${t}-sm, &${t}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function SHt(t){const e=`${t.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},xHt(t,e)),bHt(t.componentCls,e))}}const THt=t=>{const{componentCls:e,calc:n}=t;return{[e]:{[`&-compact-item${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:n(t.lineWidth).mul(-1).equal(),insetInlineStart:n(t.lineWidth).mul(-1).equal(),display:"inline-block",width:t.lineWidth,height:`calc(100% + ${Nt(t.lineWidth)} * 2)`,backgroundColor:t.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{[`&${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-vertical-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:n(t.lineWidth).mul(-1).equal(),insetInlineStart:n(t.lineWidth).mul(-1).equal(),display:"inline-block",width:`calc(100% + ${Nt(t.lineWidth)} * 2)`,height:t.lineWidth,backgroundColor:t.colorPrimaryHover,content:'""'}}}}}}},PHt=IW(["Button","compact"],t=>{const e=IVe(t);return[FW(e),SHt(e),THt(e)]},zVe);var CHt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n,o,r;const{loading:i=!1,prefixCls:a,type:l,danger:s,shape:c="default",size:u,styles:d,disabled:f,className:p,rootClassName:g,children:y,icon:w,iconPosition:b="start",ghost:C=!1,block:P=!1,htmlType:v="button",classNames:T,style:A={},autoInsertSpace:x}=t,S=CHt(t,["loading","prefixCls","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","iconPosition","ghost","block","htmlType","classNames","style","autoInsertSpace"]),R=l||"default",{getPrefixCls:M,direction:D,button:E}=m.useContext(Cr),W=(n=x??(E==null?void 0:E.autoInsertSpace))!==null&&n!==void 0?n:!0,j=M("btn",a),[L,k,N]=AHt(j),F=m.useContext(n1),U=f??F,O=m.useContext(RVe),B=m.useMemo(()=>RHt(i),[i]),[_,X]=m.useState(B.loading),[$,Q]=m.useState(!1),q=o5(e,m.createRef()),te=m.Children.count(y)===1&&!w&&!Jre(R);m.useEffect(()=>{let ve=null;B.delay>0?ve=setTimeout(()=>{ve=null,X(!0)},B.delay):X(B.loading);function Ae(){ve&&(clearTimeout(ve),ve=null)}return Ae},[B]),m.useEffect(()=>{if(!q||!q.current||!W)return;const ve=q.current.textContent;te&&z0e(ve)?$||Q(!0):$&&Q(!1)},[q]);const re=ve=>{const{onClick:Ae}=t;if(_||U){ve.preventDefault();return}Ae==null||Ae(ve)},{compactSize:ae,compactItemClassnames:se}=Nw(j,D),ne={large:"lg",small:"sm",middle:void 0},fe=Ed(ve=>{var Ae,Te;return(Te=(Ae=u??ae)!==null&&Ae!==void 0?Ae:O)!==null&&Te!==void 0?Te:ve}),ge=fe&&ne[fe]||"",de=_?"loading":w,Z=up(S,["navigate"]),he=Un(j,k,N,{[`${j}-${c}`]:c!=="default"&&c,[`${j}-${R}`]:R,[`${j}-${ge}`]:ge,[`${j}-icon-only`]:!y&&y!==0&&!!de,[`${j}-background-ghost`]:C&&!Jre(R),[`${j}-loading`]:_,[`${j}-two-chinese-chars`]:$&&W&&!_,[`${j}-block`]:P,[`${j}-dangerous`]:!!s,[`${j}-rtl`]:D==="rtl"},se,p,g,E==null?void 0:E.className),xe=Object.assign(Object.assign({},E==null?void 0:E.style),A),He=b==="end"&&y&&y!==0&&de,Se=Un(T==null?void 0:T.icon,(o=E==null?void 0:E.classNames)===null||o===void 0?void 0:o.icon,{[`${j}-icon-end`]:He}),ze=Object.assign(Object.assign({},(d==null?void 0:d.icon)||{}),((r=E==null?void 0:E.styles)===null||r===void 0?void 0:r.icon)||{}),Ie=w&&!_?be.createElement(MVe,{prefixCls:j,className:Se,style:ze},w):be.createElement(oHt,{existIcon:!!w,prefixCls:j,loading:!!_,iconPosition:b}),ye=y||y===0?nHt(y,te&&W):null,ce=(ve,Ae)=>{const Te=D==="rtl",Me=b==="start"&&!Te||b==="end"&&Te;return be.createElement(be.Fragment,null,Me?ve:Ae,Me?Ae:ve)};if(Z.href!==void 0)return L(be.createElement("a",Object.assign({},Z,{className:Un(he,{[`${j}-disabled`]:U}),href:U?void 0:Z.href,style:xe,onClick:re,ref:q,tabIndex:U?-1:0}),ce(Ie,ye)));let pe=be.createElement("button",Object.assign({},S,{type:v,className:he,style:xe,onClick:re,disabled:U,ref:q}),ce(Ie,ye),!!se&&be.createElement(PHt,{key:"compact",prefixCls:j}));return Jre(R)||(pe=be.createElement(EW,{component:"Button",disabled:!!_},pe)),L(pe)}),lo=HHt;lo.Group=eHt;lo.__ANT_BUTTON=!0;function E7e(t){return!!(t&&t.then)}const FVe=t=>{const{type:e,children:n,prefixCls:o,buttonProps:r,close:i,autoFocus:a,emitEvent:l,isSilent:s,quitOnNullishReturnValue:c,actionFn:u}=t,d=m.useRef(!1),f=m.useRef(null),[p,g]=w0e(!1),y=function(){i==null||i.apply(void 0,arguments)};m.useEffect(()=>{let C=null;return a&&(C=setTimeout(()=>{var P;(P=f.current)===null||P===void 0||P.focus()})),()=>{C&&clearTimeout(C)}},[]);const w=C=>{E7e(C)&&(g(!0),C.then(function(){g(!1,!0),y.apply(void 0,arguments),d.current=!1},P=>{if(g(!1,!0),d.current=!1,!(s!=null&&s()))return Promise.reject(P)}))},b=C=>{if(d.current)return;if(d.current=!0,!u){y();return}let P;if(l){if(P=u(C),c&&!E7e(P)){d.current=!1,y(C);return}}else if(u.length)P=u(i),d.current=!1;else if(P=u(),!P){y();return}w(P)};return m.createElement(lo,Object.assign({},HVe(e),{onClick:b,loading:p,prefixCls:o},r,{ref:f}),n)},kW=be.createContext({}),{Provider:kVe}=kW,F7e=()=>{const{autoFocusButton:t,cancelButtonProps:e,cancelTextLocale:n,isSilent:o,mergedOkCancel:r,rootPrefixCls:i,close:a,onCancel:l,onConfirm:s}=m.useContext(kW);return r?be.createElement(FVe,{isSilent:o,actionFn:l,close:function(){a==null||a.apply(void 0,arguments),s==null||s(!1)},autoFocus:t==="cancel",buttonProps:e,prefixCls:`${i}-btn`},n):null},k7e=()=>{const{autoFocusButton:t,close:e,isSilent:n,okButtonProps:o,rootPrefixCls:r,okTextLocale:i,okType:a,onConfirm:l,onOk:s}=m.useContext(kW);return be.createElement(FVe,{isSilent:n,type:a||"primary",actionFn:s,close:function(){e==null||e.apply(void 0,arguments),l==null||l(!0)},autoFocus:t==="ok",buttonProps:o,prefixCls:`${r}-btn`},i)};var LVe=m.createContext(null),L7e=[];function MHt(t,e){var n=m.useState(function(){if(!dp())return null;var g=document.createElement("div");return g}),o=ln(n,1),r=o[0],i=m.useRef(!1),a=m.useContext(LVe),l=m.useState(L7e),s=ln(l,2),c=s[0],u=s[1],d=a||(i.current?void 0:function(g){u(function(y){var w=[g].concat(Lo(y));return w})});function f(){r.parentElement||document.body.appendChild(r),i.current=!0}function p(){var g;(g=r.parentElement)===null||g===void 0||g.removeChild(r),i.current=!1}return Xa(function(){return t?a?a(f):f():p(),p},[t]),Xa(function(){c.length&&(c.forEach(function(g){return g()}),u(L7e))},[c]),[r,d]}var $re;function D0e(t){if(typeof document>"u")return 0;if($re===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var n=document.createElement("div"),o=n.style;o.position="absolute",o.top="0",o.left="0",o.pointerEvents="none",o.visibility="hidden",o.width="200px",o.height="150px",o.overflow="hidden",n.appendChild(e),document.body.appendChild(n);var r=e.offsetWidth;n.style.overflow="scroll";var i=e.offsetWidth;r===i&&(i=n.clientWidth),document.body.removeChild(n),$re=r-i}return $re}function W7e(t){var e=t.match(/^(.*)px$/),n=Number(e==null?void 0:e[1]);return Number.isNaN(n)?D0e():n}function E0e(t){if(typeof document>"u"||!t||!(t instanceof Element))return{width:0,height:0};var e=getComputedStyle(t,"::-webkit-scrollbar"),n=e.width,o=e.height;return{width:W7e(n),height:W7e(o)}}function IHt(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var zHt="rc-util-locker-".concat(Date.now()),N7e=0;function DHt(t){var e=!!t,n=m.useState(function(){return N7e+=1,"".concat(zHt,"_").concat(N7e)}),o=ln(n,1),r=o[0];Xa(function(){if(e){var i=E0e(document.body).width,a=IHt();dx(` + `]:{animationPlayState:"running"},[`${e}-move-up-leave`]:{animationName:v,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},[`${e}-move-up-leave${e}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[e]:{[`${C}-wrapper`]:Object.assign({},T)}},{[`${e}-notice-pure-panel`]:Object.assign(Object.assign({},T),{padding:0,textAlign:"start"})}]},yRt=t=>({zIndexPopup:t.zIndexPopupBase+wme+10,contentBg:t.colorBgElevated,contentPadding:`${(t.controlHeightLG-t.fontSize*t.lineHeight)/2}px ${t.paddingSM}px`}),vVe=wl("Message",t=>{const e=Ki(t,{height:150});return[mRt(e)]},yRt);var ARt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{let{prefixCls:e,type:n,icon:o,children:r}=t;return m.createElement("div",{className:Un(`${e}-custom-content`,`${e}-${n}`)},o||wRt[n],m.createElement("span",null,r))},vRt=t=>{const{prefixCls:e,className:n,type:o,icon:r,content:i}=t,a=ARt(t,["prefixCls","className","type","icon","content"]),{getPrefixCls:l}=m.useContext(Cr),s=e||l("message"),c=O0(s),[u,d,f]=vVe(s,c);return u(m.createElement(yVe,Object.assign({},a,{prefixCls:s,className:Un(n,d,`${s}-notice-pure-panel`,f,c),eventKey:"pure",duration:null,content:m.createElement(xVe,{prefixCls:s,type:o,icon:r},i)})))};function xRt(t,e){return{motionName:e??`${t}-move-up`}}function vme(t){let e;const n=new Promise(r=>{e=t(()=>{r(!0)})}),o=()=>{e==null||e()};return o.then=(r,i)=>n.then(r,i),o.promise=n,o}var bRt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{let{children:e,prefixCls:n}=t;const o=O0(n),[r,i,a]=vVe(n,o);return r(m.createElement(nRt,{classNames:{list:Un(i,a,o)}},e))},CRt=(t,e)=>{let{prefixCls:n,key:o}=e;return m.createElement(PRt,{prefixCls:n,key:o},t)},RRt=m.forwardRef((t,e)=>{const{top:n,prefixCls:o,getContainer:r,maxCount:i,duration:a=TRt,rtl:l,transitionName:s,onAllRemoved:c}=t,{getPrefixCls:u,getPopupContainer:d,message:f,direction:p}=m.useContext(Cr),g=o||u("message"),y=()=>({left:"50%",transform:"translateX(-50%)",top:n??SRt}),w=()=>Un({[`${g}-rtl`]:l??p==="rtl"}),b=()=>xRt(g,s),C=m.createElement("span",{className:`${g}-close-x`},m.createElement(Lw,{className:`${g}-close-icon`})),[P,v]=uRt({prefixCls:g,style:y,className:w,motion:b,closable:!1,closeIcon:C,duration:a,getContainer:()=>(r==null?void 0:r())||(d==null?void 0:d())||document.body,maxCount:i,onAllRemoved:c,renderNotifications:CRt});return m.useImperativeHandle(e,()=>Object.assign(Object.assign({},P),{prefixCls:g,message:f})),v});let C7e=0;function bVe(t){const e=m.useRef(null);return kb(),[m.useMemo(()=>{const o=s=>{var c;(c=e.current)===null||c===void 0||c.close(s)},r=s=>{if(!e.current){const A=()=>{};return A.then=()=>{},A}const{open:c,prefixCls:u,message:d}=e.current,f=`${u}-notice`,{content:p,icon:g,type:y,key:w,className:b,style:C,onClose:P}=s,v=bRt(s,["content","icon","type","key","className","style","onClose"]);let T=w;return T==null&&(C7e+=1,T=`antd-message-${C7e}`),vme(A=>(c(Object.assign(Object.assign({},v),{key:T,content:m.createElement(xVe,{prefixCls:u,type:y,icon:g},p),placement:"top",className:Un(y&&`${f}-${y}`,b,d==null?void 0:d.className),style:Object.assign(Object.assign({},d==null?void 0:d.style),C),onClose:()=>{P==null||P(),A()}})),()=>{o(T)}))},a={open:r,destroy:s=>{var c;s!==void 0?o(s):(c=e.current)===null||c===void 0||c.destroy()}};return["info","success","warning","error","loading"].forEach(s=>{const c=(u,d,f)=>{let p;u&&typeof u=="object"&&"content"in u?p=u:p={content:u};let g,y;typeof d=="function"?y=d:(g=d,y=f);const w=Object.assign(Object.assign({onClose:y,duration:g},p),{type:s});return r(w)};a[s]=c}),a},[]),m.createElement(RRt,Object.assign({key:"message-holder"},t,{ref:e}))]}function HRt(t){return bVe(t)}function MRt(){const[t,e]=m.useState([]),n=m.useCallback(o=>(e(r=>[].concat(Za(r),[o])),()=>{e(r=>r.filter(i=>i!==o))}),[]);return[t,n]}function tk(){tk=function(){return e};var t,e={},n=Object.prototype,o=n.hasOwnProperty,r=Object.defineProperty||function(k,N,F){k[N]=F.value},i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(k,N,F){return Object.defineProperty(k,N,{value:F,enumerable:!0,configurable:!0,writable:!0}),k[N]}try{c({},"")}catch{c=function(F,U,O){return F[U]=O}}function u(k,N,F,U){var O=N&&N.prototype instanceof b?N:b,B=Object.create(O.prototype),_=new j(U||[]);return r(B,"_invoke",{value:M(k,F,_)}),B}function d(k,N,F){try{return{type:"normal",arg:k.call(N,F)}}catch(U){return{type:"throw",arg:U}}}e.wrap=u;var f="suspendedStart",p="suspendedYield",g="executing",y="completed",w={};function b(){}function C(){}function P(){}var v={};c(v,a,function(){return this});var T=Object.getPrototypeOf,A=T&&T(T(L([])));A&&A!==n&&o.call(A,a)&&(v=A);var x=P.prototype=b.prototype=Object.create(v);function S(k){["next","throw","return"].forEach(function(N){c(k,N,function(F){return this._invoke(N,F)})})}function R(k,N){function F(O,B,_,X){var $=d(k[O],k,B);if($.type!=="throw"){var Q=$.arg,le=Q.value;return le&&zg(le)=="object"&&o.call(le,"__await")?N.resolve(le.__await).then(function(q){F("next",q,_,X)},function(q){F("throw",q,_,X)}):N.resolve(le).then(function(q){Q.value=q,_(Q)},function(q){return F("throw",q,_,X)})}X($.arg)}var U;r(this,"_invoke",{value:function(B,_){function X(){return new N(function($,Q){F(B,_,$,Q)})}return U=U?U.then(X,X):X()}})}function M(k,N,F){var U=f;return function(O,B){if(U===g)throw new Error("Generator is already running");if(U===y){if(O==="throw")throw B;return{value:t,done:!0}}for(F.method=O,F.arg=B;;){var _=F.delegate;if(_){var X=D(_,F);if(X){if(X===w)continue;return X}}if(F.method==="next")F.sent=F._sent=F.arg;else if(F.method==="throw"){if(U===f)throw U=y,F.arg;F.dispatchException(F.arg)}else F.method==="return"&&F.abrupt("return",F.arg);U=g;var $=d(k,N,F);if($.type==="normal"){if(U=F.done?y:p,$.arg===w)continue;return{value:$.arg,done:F.done}}$.type==="throw"&&(U=y,F.method="throw",F.arg=$.arg)}}}function D(k,N){var F=N.method,U=k.iterator[F];if(U===t)return N.delegate=null,F==="throw"&&k.iterator.return&&(N.method="return",N.arg=t,D(k,N),N.method==="throw")||F!=="return"&&(N.method="throw",N.arg=new TypeError("The iterator does not provide a '"+F+"' method")),w;var O=d(U,k.iterator,N.arg);if(O.type==="throw")return N.method="throw",N.arg=O.arg,N.delegate=null,w;var B=O.arg;return B?B.done?(N[k.resultName]=B.value,N.next=k.nextLoc,N.method!=="return"&&(N.method="next",N.arg=t),N.delegate=null,w):B:(N.method="throw",N.arg=new TypeError("iterator result is not an object"),N.delegate=null,w)}function E(k){var N={tryLoc:k[0]};1 in k&&(N.catchLoc=k[1]),2 in k&&(N.finallyLoc=k[2],N.afterLoc=k[3]),this.tryEntries.push(N)}function W(k){var N=k.completion||{};N.type="normal",delete N.arg,k.completion=N}function j(k){this.tryEntries=[{tryLoc:"root"}],k.forEach(E,this),this.reset(!0)}function L(k){if(k||k===""){var N=k[a];if(N)return N.call(k);if(typeof k.next=="function")return k;if(!isNaN(k.length)){var F=-1,U=function O(){for(;++F=0;--O){var B=this.tryEntries[O],_=B.completion;if(B.tryLoc==="root")return U("end");if(B.tryLoc<=this.prev){var X=o.call(B,"catchLoc"),$=o.call(B,"finallyLoc");if(X&&$){if(this.prev=0;--U){var O=this.tryEntries[U];if(O.tryLoc<=this.prev&&o.call(O,"finallyLoc")&&this.prev=0;--F){var U=this.tryEntries[F];if(U.finallyLoc===N)return this.complete(U.completion,U.afterLoc),W(U),w}},catch:function(N){for(var F=this.tryEntries.length-1;F>=0;--F){var U=this.tryEntries[F];if(U.tryLoc===N){var O=U.completion;if(O.type==="throw"){var B=O.arg;W(U)}return B}}throw new Error("illegal catch attempt")},delegateYield:function(N,F,U){return this.delegate={iterator:L(N),resultName:F,nextLoc:U},this.method==="next"&&(this.arg=t),w}},e}function R7e(t,e,n,o,r,i,a){try{var l=t[i](a),s=l.value}catch(c){n(c);return}l.done?e(s):Promise.resolve(s).then(o,r)}function SVe(t){return function(){var e=this,n=arguments;return new Promise(function(o,r){var i=t.apply(e,n);function a(s){R7e(i,o,r,a,l,"next",s)}function l(s){R7e(i,o,r,a,l,"throw",s)}a(void 0)})}}var EW=uR({},eft),IRt=EW.version,zRt=EW.render,DRt=EW.unmountComponentAtNode,F$;try{var ERt=Number((IRt||"").split(".")[0]);ERt>=18&&(F$=EW.createRoot)}catch{}function H7e(t){var e=EW.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&zg(e)==="object"&&(e.usingClientEntryPoint=t)}var EG="__rc_react_root__";function FRt(t,e){H7e(!0);var n=e[EG]||F$(e);H7e(!1),n.render(t),e[EG]=n}function kRt(t,e){zRt(t,e)}function xme(t,e){if(F$){FRt(t,e);return}kRt(t,e)}function LRt(t){return M0e.apply(this,arguments)}function M0e(){return M0e=SVe(tk().mark(function t(e){return tk().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Promise.resolve().then(function(){var r;(r=e[EG])===null||r===void 0||r.unmount(),delete e[EG]}));case 1:case"end":return o.stop()}},t)})),M0e.apply(this,arguments)}function WRt(t){DRt(t)}function TVe(t){return I0e.apply(this,arguments)}function I0e(){return I0e=SVe(tk().mark(function t(e){return tk().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(F$===void 0){o.next=2;break}return o.abrupt("return",LRt(e));case 2:WRt(e);case 3:case"end":return o.stop()}},t)})),I0e.apply(this,arguments)}const _re=()=>({height:0,opacity:0}),M7e=t=>{const{scrollHeight:e}=t;return{height:e,opacity:1}},NRt=t=>({height:t?t.offsetHeight:0}),Vre=(t,e)=>(e==null?void 0:e.deadline)===!0||e.propertyName==="height",bme=function(){return{motionName:`${arguments.length>0&&arguments[0]!==void 0?arguments[0]:"ant"}-motion-collapse`,onAppearStart:_re,onEnterStart:_re,onAppearActive:M7e,onEnterActive:M7e,onLeaveStart:NRt,onLeaveActive:_re,onAppearEnd:Vre,onEnterEnd:Vre,onLeaveEnd:Vre,motionDeadline:500}},j9=(t,e,n)=>n!==void 0?n:`${t}-${e}`,URt=function(t){if(!t)return!1;if(t instanceof Element){if(t.offsetParent)return!0;if(t.getBBox){var e=t.getBBox(),n=e.width,o=e.height;if(n||o)return!0}if(t.getBoundingClientRect){var r=t.getBoundingClientRect(),i=r.width,a=r.height;if(i||a)return!0}}return!1},jRt=t=>{const{componentCls:e,colorPrimary:n}=t;return{[e]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${n})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${t.motionEaseOutCirc}`,`opacity 2s ${t.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow ${t.motionDurationSlow} ${t.motionEaseInOut}`,`opacity ${t.motionDurationSlow} ${t.motionEaseInOut}`].join(",")}}}}},BRt=pme("Wave",t=>[jRt(t)]),k$="ant-wave-target";function YRt(t){const e=(t||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return e&&e[1]&&e[2]&&e[3]?!(e[1]===e[2]&&e[2]===e[3]):!0}function Gre(t){return t&&t!=="#fff"&&t!=="#ffffff"&&t!=="rgb(255, 255, 255)"&&t!=="rgba(255, 255, 255, 1)"&&YRt(t)&&!/rgba\((?:\d*, ){3}0\)/.test(t)&&t!=="transparent"}function ORt(t){const{borderTopColor:e,borderColor:n,backgroundColor:o}=getComputedStyle(t);return Gre(e)?e:Gre(n)?n:Gre(o)?o:null}function Xre(t){return Number.isNaN(t)?0:t}const _Rt=t=>{const{className:e,target:n,component:o}=t,r=m.useRef(null),[i,a]=m.useState(null),[l,s]=m.useState([]),[c,u]=m.useState(0),[d,f]=m.useState(0),[p,g]=m.useState(0),[y,w]=m.useState(0),[b,C]=m.useState(!1),P={left:c,top:d,width:p,height:y,borderRadius:l.map(A=>`${A}px`).join(" ")};i&&(P["--wave-color"]=i);function v(){const A=getComputedStyle(n);a(ORt(n));const x=A.position==="static",{borderLeftWidth:S,borderTopWidth:R}=A;u(x?n.offsetLeft:Xre(-parseFloat(S))),f(x?n.offsetTop:Xre(-parseFloat(R))),g(n.offsetWidth),w(n.offsetHeight);const{borderTopLeftRadius:M,borderTopRightRadius:D,borderBottomLeftRadius:E,borderBottomRightRadius:W}=A;s([M,D,W,E].map(j=>Xre(parseFloat(j))))}if(m.useEffect(()=>{if(n){const A=Dg(()=>{v(),C(!0)});let x;return typeof ResizeObserver<"u"&&(x=new ResizeObserver(v),x.observe(n)),()=>{Dg.cancel(A),x==null||x.disconnect()}}},[]),!b)return null;const T=(o==="Checkbox"||o==="Radio")&&(n==null?void 0:n.classList.contains(k$));return m.createElement(o1,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(A,x)=>{var S;if(x.deadline||x.propertyName==="opacity"){const R=(S=r.current)===null||S===void 0?void 0:S.parentElement;TVe(R).then(()=>{R==null||R.remove()})}return!1}},A=>{let{className:x}=A;return m.createElement("div",{ref:r,className:Un(e,{"wave-quick":T},x),style:P})})},VRt=(t,e)=>{var n;const{component:o}=e;if(o==="Checkbox"&&!(!((n=t.querySelector("input"))===null||n===void 0)&&n.checked))return;const r=document.createElement("div");r.style.position="absolute",r.style.left="0px",r.style.top="0px",t==null||t.insertBefore(r,t==null?void 0:t.firstChild),xme(m.createElement(_Rt,Object.assign({},e,{target:t})),r)},GRt=(t,e,n)=>{const{wave:o}=m.useContext(Cr),[,r,i]=_u(),a=q6(c=>{const u=t.current;if(o!=null&&o.disabled||!u)return;const d=u.querySelector(`.${k$}`)||u,{showEffect:f}=o||{};(f||VRt)(d,{className:e,token:r,component:n,event:c,hashId:i})}),l=m.useRef();return c=>{Dg.cancel(l.current),l.current=Dg(()=>{a(c)})}},FW=t=>{const{children:e,disabled:n,component:o}=t,{getPrefixCls:r}=m.useContext(Cr),i=m.useRef(null),a=r("wave"),[,l]=BRt(a),s=GRt(i,Un(a,l),o);if(be.useEffect(()=>{const u=i.current;if(!u||u.nodeType!==1||n)return;const d=f=>{!URt(f.target)||!u.getAttribute||u.getAttribute("disabled")||u.disabled||u.className.includes("disabled")||u.className.includes("-leave")||s(f)};return u.addEventListener("click",d,!0),()=>{u.removeEventListener("click",d,!0)}},[n]),!be.isValidElement(e))return e??null;const c=L_e(e)?o5(e.ref,i):i;return B0(e,{ref:c})},Ed=t=>{const e=be.useContext(pR);return be.useMemo(()=>t?typeof t=="string"?t??e:t instanceof Function?t(e):e:e,[t,e])};function B9(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[];return be.Children.forEach(t,function(o){o==null&&!e.keepEmpty||(Array.isArray(o)?n=n.concat(B9(o)):CC.isFragment(o)&&o.props?n=n.concat(B9(o.props.children,e)):n.push(o))}),n}const XRt=t=>{const{componentCls:e}=t;return{[e]:{"&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"}}}},JRt=t=>{const{componentCls:e,antCls:n}=t;return{[e]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${e}-item:empty`]:{display:"none"},[`${e}-item > ${n}-badge-not-a-wrapper:only-child`]:{display:"block"}}}},KRt=t=>{const{componentCls:e}=t;return{[e]:{"&-gap-row-small":{rowGap:t.spaceGapSmallSize},"&-gap-row-middle":{rowGap:t.spaceGapMiddleSize},"&-gap-row-large":{rowGap:t.spaceGapLargeSize},"&-gap-col-small":{columnGap:t.spaceGapSmallSize},"&-gap-col-middle":{columnGap:t.spaceGapMiddleSize},"&-gap-col-large":{columnGap:t.spaceGapLargeSize}}}},PVe=wl("Space",t=>{const e=Ki(t,{spaceGapSmallSize:t.paddingXS,spaceGapMiddleSize:t.padding,spaceGapLargeSize:t.paddingLG});return[JRt(e),KRt(e),XRt(e)]},()=>({}),{resetStyle:!1});var CVe=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const n=m.useContext(L$),o=m.useMemo(()=>{if(!n)return"";const{compactDirection:r,isFirstItem:i,isLastItem:a}=n,l=r==="vertical"?"-vertical-":"-";return Un(`${t}-compact${l}item`,{[`${t}-compact${l}first-item`]:i,[`${t}-compact${l}last-item`]:a,[`${t}-compact${l}item-rtl`]:e==="rtl"})},[t,e,n]);return{compactSize:n==null?void 0:n.compactSize,compactDirection:n==null?void 0:n.compactDirection,compactItemClassnames:o}},Y9=t=>{let{children:e}=t;return m.createElement(L$.Provider,{value:null},e)},qRt=t=>{var{children:e}=t,n=CVe(t,["children"]);return m.createElement(L$.Provider,{value:n},e)},$Rt=t=>{const{getPrefixCls:e,direction:n}=m.useContext(Cr),{size:o,direction:r,block:i,prefixCls:a,className:l,rootClassName:s,children:c}=t,u=CVe(t,["size","direction","block","prefixCls","className","rootClassName","children"]),d=Ed(P=>o??P),f=e("space-compact",a),[p,g]=PVe(f),y=Un(f,g,{[`${f}-rtl`]:n==="rtl",[`${f}-block`]:i,[`${f}-vertical`]:r==="vertical"},l,s),w=m.useContext(L$),b=B9(c),C=m.useMemo(()=>b.map((P,v)=>{const T=P&&P.key||`${f}-item-${v}`;return m.createElement(qRt,{key:T,compactSize:d,compactDirection:r,isFirstItem:v===0&&(!w||(w==null?void 0:w.isFirstItem)),isLastItem:v===b.length-1&&(!w||(w==null?void 0:w.isLastItem))},P)}),[o,b,w]);return b.length===0?null:p(m.createElement("div",Object.assign({className:y},u),C))},QRt=$Rt;var ZRt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{getPrefixCls:e,direction:n}=m.useContext(Cr),{prefixCls:o,size:r,className:i}=t,a=ZRt(t,["prefixCls","size","className"]),l=e("btn-group",o),[,,s]=_u();let c="";switch(r){case"large":c="lg";break;case"small":c="sm";break}const u=Un(l,{[`${l}-${c}`]:c,[`${l}-rtl`]:n==="rtl"},i,s);return m.createElement(RVe.Provider,{value:r},m.createElement("div",Object.assign({},a,{className:u})))},I7e=/^[\u4e00-\u9fa5]{2}$/,z0e=I7e.test.bind(I7e);function HVe(t){return t==="danger"?{danger:!0}:{type:t}}function z7e(t){return typeof t=="string"}function Jre(t){return t==="text"||t==="link"}function tHt(t,e){if(t==null)return;const n=e?" ":"";return typeof t!="string"&&typeof t!="number"&&z7e(t.type)&&z0e(t.props.children)?B0(t,{children:t.props.children.split("").join(n)}):z7e(t)?z0e(t)?be.createElement("span",null,t.split("").join(n)):be.createElement("span",null,t):gVe(t)?be.createElement("span",null,t):t}function nHt(t,e){let n=!1;const o=[];return be.Children.forEach(t,r=>{const i=typeof r,a=i==="string"||i==="number";if(n&&a){const l=o.length-1,s=o[l];o[l]=`${s}${r}`}else o.push(r);n=a}),be.Children.map(o,r=>tHt(r,e))}const MVe=m.forwardRef((t,e)=>{const{className:n,style:o,children:r,prefixCls:i}=t,a=Un(`${i}-icon`,n);return be.createElement("span",{ref:e,className:a,style:o},r)}),D7e=m.forwardRef((t,e)=>{const{prefixCls:n,className:o,style:r,iconClassName:i,iconPosition:a="start"}=t,l=Un(o,{[`${n}-loading-icon-end`]:a==="end",[`${n}-loading-icon`]:a==="start"});return be.createElement(MVe,{prefixCls:n,className:l,style:r,ref:e},be.createElement(UH,{className:i}))}),Kre=()=>({width:0,opacity:0,transform:"scale(0)"}),qre=t=>({width:t.scrollWidth,opacity:1,transform:"scale(1)"}),oHt=t=>{const{prefixCls:e,loading:n,existIcon:o,className:r,style:i,iconPosition:a}=t,l=!!n;return o?be.createElement(D7e,{prefixCls:e,className:r,style:i,iconPosition:a}):be.createElement(o1,{visible:l,motionName:`${e}-loading-icon-motion`,motionLeave:l,removeOnLeave:!0,onAppearStart:Kre,onAppearActive:qre,onEnterStart:Kre,onEnterActive:qre,onLeaveStart:qre,onLeaveActive:Kre},(s,c)=>{let{className:u,style:d}=s;return be.createElement(D7e,{prefixCls:e,className:r,style:Object.assign(Object.assign({},i),d),ref:c,iconClassName:u,iconPosition:a})})},E7e=(t,e)=>({[`> span, > ${t}`]:{"&:not(:last-child)":{[`&, & > ${t}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${t}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),rHt=t=>{const{componentCls:e,fontSize:n,lineWidth:o,groupBorderColor:r,colorErrorHover:i}=t;return{[`${e}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:t.calc(o).mul(-1).equal(),[`&, & > ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[e]:{position:"relative",zIndex:1,"&:hover,\n &:focus,\n &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${e}-icon-only`]:{fontSize:n}},E7e(`${e}-primary`,r),E7e(`${e}-danger`,i)]}},IVe=t=>{const{paddingInline:e,onlyIconSize:n,paddingBlock:o}=t;return Ki(t,{buttonPaddingHorizontal:e,buttonPaddingVertical:o,buttonIconOnlyFontSize:n})},zVe=t=>{var e,n,o,r,i,a;const l=(e=t.contentFontSize)!==null&&e!==void 0?e:t.fontSize,s=(n=t.contentFontSizeSM)!==null&&n!==void 0?n:t.fontSize,c=(o=t.contentFontSizeLG)!==null&&o!==void 0?o:t.fontSizeLG,u=(r=t.contentLineHeight)!==null&&r!==void 0?r:__(l),d=(i=t.contentLineHeightSM)!==null&&i!==void 0?i:__(s),f=(a=t.contentLineHeightLG)!==null&&a!==void 0?a:__(c);return{fontWeight:400,defaultShadow:`0 ${t.controlOutlineWidth}px 0 ${t.controlTmpOutline}`,primaryShadow:`0 ${t.controlOutlineWidth}px 0 ${t.controlOutline}`,dangerShadow:`0 ${t.controlOutlineWidth}px 0 ${t.colorErrorOutline}`,primaryColor:t.colorTextLightSolid,dangerColor:t.colorTextLightSolid,borderColorDisabled:t.colorBorder,defaultGhostColor:t.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:t.colorBgContainer,paddingInline:t.paddingContentHorizontal-t.lineWidth,paddingInlineLG:t.paddingContentHorizontal-t.lineWidth,paddingInlineSM:8-t.lineWidth,onlyIconSize:t.fontSizeLG,onlyIconSizeSM:t.fontSizeLG-2,onlyIconSizeLG:t.fontSizeLG+2,groupBorderColor:t.colorPrimaryHover,linkHoverBg:"transparent",textHoverBg:t.colorBgTextHover,defaultColor:t.colorText,defaultBg:t.colorBgContainer,defaultBorderColor:t.colorBorder,defaultBorderColorDisabled:t.colorBorder,defaultHoverBg:t.colorBgContainer,defaultHoverColor:t.colorPrimaryHover,defaultHoverBorderColor:t.colorPrimaryHover,defaultActiveBg:t.colorBgContainer,defaultActiveColor:t.colorPrimaryActive,defaultActiveBorderColor:t.colorPrimaryActive,contentFontSize:l,contentFontSizeSM:s,contentFontSizeLG:c,contentLineHeight:u,contentLineHeightSM:d,contentLineHeightLG:f,paddingBlock:Math.max((t.controlHeight-l*u)/2-t.lineWidth,0),paddingBlockSM:Math.max((t.controlHeightSM-s*d)/2-t.lineWidth,0),paddingBlockLG:Math.max((t.controlHeightLG-c*f)/2-t.lineWidth,0)}},iHt=t=>{const{componentCls:e,iconCls:n,fontWeight:o}=t;return{[e]:{outline:"none",position:"relative",display:"inline-block",fontWeight:o,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:`${Nt(t.lineWidth)} ${t.lineType} transparent`,cursor:"pointer",transition:`all ${t.motionDurationMid} ${t.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",color:t.colorText,"&:disabled > *":{pointerEvents:"none"},"> span":{display:"inline-block"},[`${e}-icon`]:{lineHeight:0,"&-end":{marginInlineStart:t.marginXS}},[`> ${n} + span, > span + ${n}`]:{marginInlineStart:t.marginXS},[`&:not(${e}-icon-only) > ${e}-icon`]:{[`&${e}-loading-icon, &:not(:last-child)`]:{marginInlineEnd:t.marginXS},[`&${e}-loading-icon-end`]:{marginInlineStart:t.marginXS}},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},Q6(t)),[`&${e}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${e}-two-chinese-chars > *:not(${n})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&-icon-only${e}-compact-item`]:{flex:"none"}}}},Z6=(t,e,n)=>({[`&:not(:disabled):not(${t}-disabled)`]:{"&:hover":e,"&:active":n}}),aHt=t=>({minWidth:t.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),lHt=t=>({borderRadius:t.controlHeight,paddingInlineStart:t.calc(t.controlHeight).div(2).equal(),paddingInlineEnd:t.calc(t.controlHeight).div(2).equal()}),sHt=t=>({cursor:"not-allowed",borderColor:t.borderColorDisabled,color:t.colorTextDisabled,background:t.colorBgContainerDisabled,boxShadow:"none"}),nk=(t,e,n,o,r,i,a,l)=>({[`&${t}-background-ghost`]:Object.assign(Object.assign({color:n||void 0,background:e,borderColor:o||void 0,boxShadow:"none"},Z6(t,Object.assign({background:e},a),Object.assign({background:e},l))),{"&:disabled":{cursor:"not-allowed",color:r||void 0,borderColor:i||void 0}})}),Sme=t=>({[`&:disabled, &${t.componentCls}-disabled`]:Object.assign({},sHt(t))}),DVe=t=>Object.assign({},Sme(t)),FG=t=>({[`&:disabled, &${t.componentCls}-disabled`]:{cursor:"not-allowed",color:t.colorTextDisabled}}),EVe=t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},DVe(t)),{background:t.defaultBg,borderColor:t.defaultBorderColor,color:t.defaultColor,boxShadow:t.defaultShadow}),Z6(t.componentCls,{color:t.defaultHoverColor,borderColor:t.defaultHoverBorderColor,background:t.defaultHoverBg},{color:t.defaultActiveColor,borderColor:t.defaultActiveBorderColor,background:t.defaultActiveBg})),nk(t.componentCls,t.ghostBg,t.defaultGhostColor,t.defaultGhostBorderColor,t.colorTextDisabled,t.colorBorder)),{[`&${t.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({color:t.colorError,borderColor:t.colorError},Z6(t.componentCls,{color:t.colorErrorHover,borderColor:t.colorErrorBorderHover},{color:t.colorErrorActive,borderColor:t.colorErrorActive})),nk(t.componentCls,t.ghostBg,t.colorError,t.colorError,t.colorTextDisabled,t.colorBorder)),Sme(t))}),cHt=t=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},DVe(t)),{color:t.primaryColor,background:t.colorPrimary,boxShadow:t.primaryShadow}),Z6(t.componentCls,{color:t.colorTextLightSolid,background:t.colorPrimaryHover},{color:t.colorTextLightSolid,background:t.colorPrimaryActive})),nk(t.componentCls,t.ghostBg,t.colorPrimary,t.colorPrimary,t.colorTextDisabled,t.colorBorder,{color:t.colorPrimaryHover,borderColor:t.colorPrimaryHover},{color:t.colorPrimaryActive,borderColor:t.colorPrimaryActive})),{[`&${t.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({background:t.colorError,boxShadow:t.dangerShadow,color:t.dangerColor},Z6(t.componentCls,{background:t.colorErrorHover},{background:t.colorErrorActive})),nk(t.componentCls,t.ghostBg,t.colorError,t.colorError,t.colorTextDisabled,t.colorBorder,{color:t.colorErrorHover,borderColor:t.colorErrorHover},{color:t.colorErrorActive,borderColor:t.colorErrorActive})),Sme(t))}),uHt=t=>Object.assign(Object.assign({},EVe(t)),{borderStyle:"dashed"}),dHt=t=>Object.assign(Object.assign(Object.assign({color:t.colorLink},Z6(t.componentCls,{color:t.colorLinkHover,background:t.linkHoverBg},{color:t.colorLinkActive})),FG(t)),{[`&${t.componentCls}-dangerous`]:Object.assign(Object.assign({color:t.colorError},Z6(t.componentCls,{color:t.colorErrorHover},{color:t.colorErrorActive})),FG(t))}),fHt=t=>Object.assign(Object.assign(Object.assign({},Z6(t.componentCls,{color:t.colorText,background:t.textHoverBg},{color:t.colorText,background:t.colorBgTextActive})),FG(t)),{[`&${t.componentCls}-dangerous`]:Object.assign(Object.assign({color:t.colorError},FG(t)),Z6(t.componentCls,{color:t.colorErrorHover,background:t.colorErrorBg},{color:t.colorErrorHover,background:t.colorErrorBg}))}),hHt=t=>{const{componentCls:e}=t;return{[`${e}-default`]:EVe(t),[`${e}-primary`]:cHt(t),[`${e}-dashed`]:uHt(t),[`${e}-link`]:dHt(t),[`${e}-text`]:fHt(t),[`${e}-ghost`]:nk(t.componentCls,t.ghostBg,t.colorBgContainer,t.colorBgContainer,t.colorTextDisabled,t.colorBorder)}},Tme=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:n,controlHeight:o,fontSize:r,lineHeight:i,borderRadius:a,buttonPaddingHorizontal:l,iconCls:s,buttonPaddingVertical:c}=t,u=`${n}-icon-only`;return[{[`${e}`]:{fontSize:r,lineHeight:i,height:o,padding:`${Nt(c)} ${Nt(l)}`,borderRadius:a,[`&${u}`]:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:o,paddingInlineStart:0,paddingInlineEnd:0,[`&${n}-round`]:{width:"auto"},[s]:{fontSize:t.buttonIconOnlyFontSize}},[`&${n}-loading`]:{opacity:t.opacityLoading,cursor:"default"},[`${n}-loading-icon`]:{transition:`width ${t.motionDurationSlow} ${t.motionEaseInOut}, opacity ${t.motionDurationSlow} ${t.motionEaseInOut}`}}},{[`${n}${n}-circle${e}`]:aHt(t)},{[`${n}${n}-round${e}`]:lHt(t)}]},pHt=t=>{const e=Ki(t,{fontSize:t.contentFontSize,lineHeight:t.contentLineHeight});return Tme(e,t.componentCls)},gHt=t=>{const e=Ki(t,{controlHeight:t.controlHeightSM,fontSize:t.contentFontSizeSM,lineHeight:t.contentLineHeightSM,padding:t.paddingXS,buttonPaddingHorizontal:t.paddingInlineSM,buttonPaddingVertical:t.paddingBlockSM,borderRadius:t.borderRadiusSM,buttonIconOnlyFontSize:t.onlyIconSizeSM});return Tme(e,`${t.componentCls}-sm`)},mHt=t=>{const e=Ki(t,{controlHeight:t.controlHeightLG,fontSize:t.contentFontSizeLG,lineHeight:t.contentLineHeightLG,buttonPaddingHorizontal:t.paddingInlineLG,buttonPaddingVertical:t.paddingBlockLG,borderRadius:t.borderRadiusLG,buttonIconOnlyFontSize:t.onlyIconSizeLG});return Tme(e,`${t.componentCls}-lg`)},yHt=t=>{const{componentCls:e}=t;return{[e]:{[`&${e}-block`]:{width:"100%"}}}},AHt=wl("Button",t=>{const e=IVe(t);return[iHt(e),pHt(e),gHt(e),mHt(e),yHt(e),hHt(e),rHt(e)]},zVe,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function wHt(t,e,n){const{focusElCls:o,focus:r,borderElCls:i}=n,a=i?"> *":"",l=["hover",r?"focus":null,"active"].filter(Boolean).map(s=>`&:${s} ${a}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:t.calc(t.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[l]:{zIndex:2}},o?{[`&${o}`]:{zIndex:2}}:{}),{[`&[disabled] ${a}`]:{zIndex:0}})}}function vHt(t,e,n){const{borderElCls:o}=n,r=o?`> ${o}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${r}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${r}, &${t}-sm ${r}, &${t}-lg ${r}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${r}, &${t}-sm ${r}, &${t}-lg ${r}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function kW(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:n}=t,o=`${n}-compact`;return{[o]:Object.assign(Object.assign({},wHt(t,o,e)),vHt(n,o,e))}}function xHt(t,e){return{[`&-item:not(${e}-last-item)`]:{marginBottom:t.calc(t.lineWidth).mul(-1).equal()},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function bHt(t,e){return{[`&-item:not(${e}-first-item):not(${e}-last-item)`]:{borderRadius:0},[`&-item${e}-first-item:not(${e}-last-item)`]:{[`&, &${t}-sm, &${t}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${e}-last-item:not(${e}-first-item)`]:{[`&, &${t}-sm, &${t}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function SHt(t){const e=`${t.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},xHt(t,e)),bHt(t.componentCls,e))}}const THt=t=>{const{componentCls:e,calc:n}=t;return{[e]:{[`&-compact-item${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:n(t.lineWidth).mul(-1).equal(),insetInlineStart:n(t.lineWidth).mul(-1).equal(),display:"inline-block",width:t.lineWidth,height:`calc(100% + ${Nt(t.lineWidth)} * 2)`,backgroundColor:t.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{[`&${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-vertical-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:n(t.lineWidth).mul(-1).equal(),insetInlineStart:n(t.lineWidth).mul(-1).equal(),display:"inline-block",width:`calc(100% + ${Nt(t.lineWidth)} * 2)`,height:t.lineWidth,backgroundColor:t.colorPrimaryHover,content:'""'}}}}}}},PHt=zW(["Button","compact"],t=>{const e=IVe(t);return[kW(e),SHt(e),THt(e)]},zVe);var CHt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n,o,r;const{loading:i=!1,prefixCls:a,type:l,danger:s,shape:c="default",size:u,styles:d,disabled:f,className:p,rootClassName:g,children:y,icon:w,iconPosition:b="start",ghost:C=!1,block:P=!1,htmlType:v="button",classNames:T,style:A={},autoInsertSpace:x}=t,S=CHt(t,["loading","prefixCls","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","iconPosition","ghost","block","htmlType","classNames","style","autoInsertSpace"]),R=l||"default",{getPrefixCls:M,direction:D,button:E}=m.useContext(Cr),W=(n=x??(E==null?void 0:E.autoInsertSpace))!==null&&n!==void 0?n:!0,j=M("btn",a),[L,k,N]=AHt(j),F=m.useContext(n1),U=f??F,O=m.useContext(RVe),B=m.useMemo(()=>RHt(i),[i]),[_,X]=m.useState(B.loading),[$,Q]=m.useState(!1),q=o5(e,m.createRef()),te=m.Children.count(y)===1&&!w&&!Jre(R);m.useEffect(()=>{let ve=null;B.delay>0?ve=setTimeout(()=>{ve=null,X(!0)},B.delay):X(B.loading);function Ae(){ve&&(clearTimeout(ve),ve=null)}return Ae},[B]),m.useEffect(()=>{if(!q||!q.current||!W)return;const ve=q.current.textContent;te&&z0e(ve)?$||Q(!0):$&&Q(!1)},[q]);const re=ve=>{const{onClick:Ae}=t;if(_||U){ve.preventDefault();return}Ae==null||Ae(ve)},{compactSize:ae,compactItemClassnames:se}=Nw(j,D),ne={large:"lg",small:"sm",middle:void 0},fe=Ed(ve=>{var Ae,Te;return(Te=(Ae=u??ae)!==null&&Ae!==void 0?Ae:O)!==null&&Te!==void 0?Te:ve}),ge=fe&&ne[fe]||"",de=_?"loading":w,Z=up(S,["navigate"]),he=Un(j,k,N,{[`${j}-${c}`]:c!=="default"&&c,[`${j}-${R}`]:R,[`${j}-${ge}`]:ge,[`${j}-icon-only`]:!y&&y!==0&&!!de,[`${j}-background-ghost`]:C&&!Jre(R),[`${j}-loading`]:_,[`${j}-two-chinese-chars`]:$&&W&&!_,[`${j}-block`]:P,[`${j}-dangerous`]:!!s,[`${j}-rtl`]:D==="rtl"},se,p,g,E==null?void 0:E.className),xe=Object.assign(Object.assign({},E==null?void 0:E.style),A),He=b==="end"&&y&&y!==0&&de,Se=Un(T==null?void 0:T.icon,(o=E==null?void 0:E.classNames)===null||o===void 0?void 0:o.icon,{[`${j}-icon-end`]:He}),ze=Object.assign(Object.assign({},(d==null?void 0:d.icon)||{}),((r=E==null?void 0:E.styles)===null||r===void 0?void 0:r.icon)||{}),Ie=w&&!_?be.createElement(MVe,{prefixCls:j,className:Se,style:ze},w):be.createElement(oHt,{existIcon:!!w,prefixCls:j,loading:!!_,iconPosition:b}),ye=y||y===0?nHt(y,te&&W):null,ce=(ve,Ae)=>{const Te=D==="rtl",Me=b==="start"&&!Te||b==="end"&&Te;return be.createElement(be.Fragment,null,Me?ve:Ae,Me?Ae:ve)};if(Z.href!==void 0)return L(be.createElement("a",Object.assign({},Z,{className:Un(he,{[`${j}-disabled`]:U}),href:U?void 0:Z.href,style:xe,onClick:re,ref:q,tabIndex:U?-1:0}),ce(Ie,ye)));let pe=be.createElement("button",Object.assign({},S,{type:v,className:he,style:xe,onClick:re,disabled:U,ref:q}),ce(Ie,ye),!!se&&be.createElement(PHt,{key:"compact",prefixCls:j}));return Jre(R)||(pe=be.createElement(FW,{component:"Button",disabled:!!_},pe)),L(pe)}),lo=HHt;lo.Group=eHt;lo.__ANT_BUTTON=!0;function F7e(t){return!!(t&&t.then)}const FVe=t=>{const{type:e,children:n,prefixCls:o,buttonProps:r,close:i,autoFocus:a,emitEvent:l,isSilent:s,quitOnNullishReturnValue:c,actionFn:u}=t,d=m.useRef(!1),f=m.useRef(null),[p,g]=w0e(!1),y=function(){i==null||i.apply(void 0,arguments)};m.useEffect(()=>{let C=null;return a&&(C=setTimeout(()=>{var P;(P=f.current)===null||P===void 0||P.focus()})),()=>{C&&clearTimeout(C)}},[]);const w=C=>{F7e(C)&&(g(!0),C.then(function(){g(!1,!0),y.apply(void 0,arguments),d.current=!1},P=>{if(g(!1,!0),d.current=!1,!(s!=null&&s()))return Promise.reject(P)}))},b=C=>{if(d.current)return;if(d.current=!0,!u){y();return}let P;if(l){if(P=u(C),c&&!F7e(P)){d.current=!1,y(C);return}}else if(u.length)P=u(i),d.current=!1;else if(P=u(),!P){y();return}w(P)};return m.createElement(lo,Object.assign({},HVe(e),{onClick:b,loading:p,prefixCls:o},r,{ref:f}),n)},LW=be.createContext({}),{Provider:kVe}=LW,k7e=()=>{const{autoFocusButton:t,cancelButtonProps:e,cancelTextLocale:n,isSilent:o,mergedOkCancel:r,rootPrefixCls:i,close:a,onCancel:l,onConfirm:s}=m.useContext(LW);return r?be.createElement(FVe,{isSilent:o,actionFn:l,close:function(){a==null||a.apply(void 0,arguments),s==null||s(!1)},autoFocus:t==="cancel",buttonProps:e,prefixCls:`${i}-btn`},n):null},L7e=()=>{const{autoFocusButton:t,close:e,isSilent:n,okButtonProps:o,rootPrefixCls:r,okTextLocale:i,okType:a,onConfirm:l,onOk:s}=m.useContext(LW);return be.createElement(FVe,{isSilent:n,type:a||"primary",actionFn:s,close:function(){e==null||e.apply(void 0,arguments),l==null||l(!0)},autoFocus:t==="ok",buttonProps:o,prefixCls:`${r}-btn`},i)};var LVe=m.createContext(null),W7e=[];function MHt(t,e){var n=m.useState(function(){if(!dp())return null;var g=document.createElement("div");return g}),o=ln(n,1),r=o[0],i=m.useRef(!1),a=m.useContext(LVe),l=m.useState(W7e),s=ln(l,2),c=s[0],u=s[1],d=a||(i.current?void 0:function(g){u(function(y){var w=[g].concat(Lo(y));return w})});function f(){r.parentElement||document.body.appendChild(r),i.current=!0}function p(){var g;(g=r.parentElement)===null||g===void 0||g.removeChild(r),i.current=!1}return Xa(function(){return t?a?a(f):f():p(),p},[t]),Xa(function(){c.length&&(c.forEach(function(g){return g()}),u(W7e))},[c]),[r,d]}var $re;function D0e(t){if(typeof document>"u")return 0;if($re===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var n=document.createElement("div"),o=n.style;o.position="absolute",o.top="0",o.left="0",o.pointerEvents="none",o.visibility="hidden",o.width="200px",o.height="150px",o.overflow="hidden",n.appendChild(e),document.body.appendChild(n);var r=e.offsetWidth;n.style.overflow="scroll";var i=e.offsetWidth;r===i&&(i=n.clientWidth),document.body.removeChild(n),$re=r-i}return $re}function N7e(t){var e=t.match(/^(.*)px$/),n=Number(e==null?void 0:e[1]);return Number.isNaN(n)?D0e():n}function E0e(t){if(typeof document>"u"||!t||!(t instanceof Element))return{width:0,height:0};var e=getComputedStyle(t,"::-webkit-scrollbar"),n=e.width,o=e.height;return{width:N7e(n),height:N7e(o)}}function IHt(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var zHt="rc-util-locker-".concat(Date.now()),U7e=0;function DHt(t){var e=!!t,n=m.useState(function(){return U7e+=1,"".concat(zHt,"_").concat(U7e)}),o=ln(n,1),r=o[0];Xa(function(){if(e){var i=E0e(document.body).width,a=IHt();dx(` html body { overflow-y: hidden; `.concat(a?"width: calc(100% - ".concat(i,"px);"):"",` -}`),r)}else TG(r);return function(){TG(r)}},[e,r])}var EHt=!1;function FHt(t){return EHt}var U7e=function(e){return e===!1?!1:!dp()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},W$=m.forwardRef(function(t,e){var n=t.open,o=t.autoLock,r=t.getContainer;t.debug;var i=t.autoDestroy,a=i===void 0?!0:i,l=t.children,s=m.useState(n),c=ln(s,2),u=c[0],d=c[1],f=u||n;m.useEffect(function(){(a||n)&&d(n)},[n,a]);var p=m.useState(function(){return U7e(r)}),g=ln(p,2),y=g[0],w=g[1];m.useEffect(function(){var D=U7e(r);w(D??null)});var b=MHt(f&&!y),C=ln(b,2),P=C[0],v=C[1],T=y??P;DHt(o&&n&&dp()&&(T===P||T===document.body));var A=null;if(l&&rw(l)&&e){var x=l;A=x.ref}var S=Fw(A,e);if(!f||!dp()||y===void 0)return null;var R=T===!1||FHt(),M=l;return e&&(M=m.cloneElement(l,{ref:S})),m.createElement(LVe.Provider,{value:v},R?M:Cd.createPortal(M,T))}),WVe=m.createContext({});function kHt(){var t=qt({},MK);return t.useId}var j7e=0,B7e=kHt();const NVe=B7e?function(e){var n=B7e();return e||n}:function(e){var n=m.useState("ssr-id"),o=ln(n,2),r=o[0],i=o[1];return m.useEffect(function(){var a=j7e;j7e+=1,i("rc_unique_".concat(a))},[]),e||r};function Y7e(t,e,n){var o=e;return!o&&n&&(o="".concat(t,"-").concat(n)),o}function O7e(t,e){var n=t["page".concat(e?"Y":"X","Offset")],o="scroll".concat(e?"Top":"Left");if(typeof n!="number"){var r=t.document;n=r.documentElement[o],typeof n!="number"&&(n=r.body[o])}return n}function LHt(t){var e=t.getBoundingClientRect(),n={left:e.left,top:e.top},o=t.ownerDocument,r=o.defaultView||o.parentWindow;return n.left+=O7e(r),n.top+=O7e(r,!0),n}const WHt=m.memo(function(t){var e=t.children;return e},function(t,e){var n=e.shouldUpdate;return!n});var _7e={width:0,height:0,overflow:"hidden",outline:"none"},NHt={outline:"none"},UVe=be.forwardRef(function(t,e){var n=t.prefixCls,o=t.className,r=t.style,i=t.title,a=t.ariaId,l=t.footer,s=t.closable,c=t.closeIcon,u=t.onClose,d=t.children,f=t.bodyStyle,p=t.bodyProps,g=t.modalRender,y=t.onMouseDown,w=t.onMouseUp,b=t.holderRef,C=t.visible,P=t.forceRender,v=t.width,T=t.height,A=t.classNames,x=t.styles,S=be.useContext(WVe),R=S.panel,M=Fw(b,R),D=m.useRef(),E=m.useRef(),W=m.useRef();be.useImperativeHandle(e,function(){return{focus:function(){var _;(_=W.current)===null||_===void 0||_.focus()},changeActive:function(_){var X=document,$=X.activeElement;_&&$===E.current?D.current.focus():!_&&$===D.current&&E.current.focus()}}});var j={};v!==void 0&&(j.width=v),T!==void 0&&(j.height=T);var L;l&&(L=be.createElement("div",{className:Vn("".concat(n,"-footer"),A==null?void 0:A.footer),style:qt({},x==null?void 0:x.footer)},l));var k;i&&(k=be.createElement("div",{className:Vn("".concat(n,"-header"),A==null?void 0:A.header),style:qt({},x==null?void 0:x.header)},be.createElement("div",{className:"".concat(n,"-title"),id:a},i)));var N=m.useMemo(function(){return hi(s)==="object"&&s!==null?s:s?{closeIcon:c??be.createElement("span",{className:"".concat(n,"-close-x")})}:{}},[s,c]),F=Sf(N,!0),U;s&&(U=be.createElement("button",ho({type:"button",onClick:u,"aria-label":"Close"},F,{className:"".concat(n,"-close")}),N.closeIcon));var O=be.createElement("div",{className:Vn("".concat(n,"-content"),A==null?void 0:A.content),style:x==null?void 0:x.content},U,k,be.createElement("div",ho({className:Vn("".concat(n,"-body"),A==null?void 0:A.body),style:qt(qt({},f),x==null?void 0:x.body)},p),d),L);return be.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":i?a:null,"aria-modal":"true",ref:M,style:qt(qt({},r),j),className:Vn(n,o),onMouseDown:y,onMouseUp:w},be.createElement("div",{tabIndex:0,ref:D,style:_7e,"aria-hidden":"true"}),be.createElement("div",{ref:W,tabIndex:-1,style:NHt},be.createElement(WHt,{shouldUpdate:C||P},g?g(O):O)),be.createElement("div",{tabIndex:0,ref:E,style:_7e,"aria-hidden":"true"}))}),jVe=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.title,r=t.style,i=t.className,a=t.visible,l=t.forceRender,s=t.destroyOnClose,c=t.motionName,u=t.ariaId,d=t.onVisibleChanged,f=t.mousePosition,p=m.useRef(),g=m.useState(),y=ln(g,2),w=y[0],b=y[1],C={};w&&(C.transformOrigin=w);function P(){var v=LHt(p.current);b(f?"".concat(f.x-v.left,"px ").concat(f.y-v.top,"px"):"")}return m.createElement(o1,{visible:a,onVisibleChanged:d,onAppearPrepare:P,onEnterPrepare:P,forceRender:l,motionName:c,removeOnLeave:s,ref:p},function(v,T){var A=v.className,x=v.style;return m.createElement(UVe,ho({},t,{ref:e,title:o,ariaId:u,prefixCls:n,holderRef:T,style:qt(qt(qt({},x),r),C),className:Vn(i,A)}))})});jVe.displayName="Content";function UHt(t){var e=t.prefixCls,n=t.style,o=t.visible,r=t.maskProps,i=t.motionName,a=t.className;return m.createElement(o1,{key:"mask",visible:o,motionName:i,leavedClassName:"".concat(e,"-mask-hidden")},function(l,s){var c=l.className,u=l.style;return m.createElement("div",ho({ref:s,style:qt(qt({},u),n),className:Vn("".concat(e,"-mask"),c,a)},r))})}function jHt(t){var e=t.prefixCls,n=e===void 0?"rc-dialog":e,o=t.zIndex,r=t.visible,i=r===void 0?!1:r,a=t.keyboard,l=a===void 0?!0:a,s=t.focusTriggerAfterClose,c=s===void 0?!0:s,u=t.wrapStyle,d=t.wrapClassName,f=t.wrapProps,p=t.onClose,g=t.afterOpenChange,y=t.afterClose,w=t.transitionName,b=t.animation,C=t.closable,P=C===void 0?!0:C,v=t.mask,T=v===void 0?!0:v,A=t.maskTransitionName,x=t.maskAnimation,S=t.maskClosable,R=S===void 0?!0:S,M=t.maskStyle,D=t.maskProps,E=t.rootClassName,W=t.classNames,j=t.styles,L=m.useRef(),k=m.useRef(),N=m.useRef(),F=m.useState(i),U=ln(F,2),O=U[0],B=U[1],_=NVe();function X(){n0e(k.current,document.activeElement)||(L.current=document.activeElement)}function $(){if(!n0e(k.current,document.activeElement)){var fe;(fe=N.current)===null||fe===void 0||fe.focus()}}function Q(fe){if(fe)$();else{if(B(!1),T&&L.current&&c){try{L.current.focus({preventScroll:!0})}catch{}L.current=null}O&&(y==null||y())}g==null||g(fe)}function le(fe){p==null||p(fe)}var q=m.useRef(!1),te=m.useRef(),re=function(){clearTimeout(te.current),q.current=!0},ae=function(){te.current=setTimeout(function(){q.current=!1})},se=null;R&&(se=function(ge){q.current?q.current=!1:k.current===ge.target&&le(ge)});function ne(fe){if(l&&fe.keyCode===Bn.ESC){fe.stopPropagation(),le(fe);return}i&&fe.keyCode===Bn.TAB&&N.current.changeActive(!fe.shiftKey)}return m.useEffect(function(){i&&(B(!0),X())},[i]),m.useEffect(function(){return function(){clearTimeout(te.current)}},[]),m.createElement("div",ho({className:Vn("".concat(n,"-root"),E)},Sf(t,{data:!0})),m.createElement(UHt,{prefixCls:n,visible:T&&i,motionName:Y7e(n,A,x),style:qt(qt({zIndex:o},M),j==null?void 0:j.mask),maskProps:D,className:W==null?void 0:W.mask}),m.createElement("div",ho({tabIndex:-1,onKeyDown:ne,className:Vn("".concat(n,"-wrap"),d,W==null?void 0:W.wrapper),ref:k,onClick:se,style:qt(qt(qt({zIndex:o},u),j==null?void 0:j.wrapper),{},{display:O?null:"none"})},f),m.createElement(jVe,ho({},t,{onMouseDown:re,onMouseUp:ae,ref:N,closable:P,ariaId:_,prefixCls:n,visible:i&&O,onClose:le,onVisibleChanged:Q,motionName:Y7e(n,w,b)}))))}var BVe=function(e){var n=e.visible,o=e.getContainer,r=e.forceRender,i=e.destroyOnClose,a=i===void 0?!1:i,l=e.afterClose,s=e.panelRef,c=m.useState(n),u=ln(c,2),d=u[0],f=u[1],p=m.useMemo(function(){return{panel:s}},[s]);return m.useEffect(function(){n&&f(!0)},[n]),!r&&a&&!d?null:m.createElement(WVe.Provider,{value:p},m.createElement(W$,{open:n||r||d,autoDestroy:!1,getContainer:o,autoLock:n||d},m.createElement(jHt,ho({},e,{destroyOnClose:a,afterClose:function(){l==null||l(),f(!1)}}))))};BVe.displayName="Dialog";function mR(t){if(t)return{closable:t.closable,closeIcon:t.closeIcon}}function V7e(t){const{closable:e,closeIcon:n}=t||{};return be.useMemo(()=>{if(!e&&(e===!1||n===!1||n===null))return!1;if(e===void 0&&n===void 0)return null;let o={closeIcon:typeof n!="boolean"&&n!==null?n:void 0};return e&&typeof e=="object"&&(o=Object.assign(Object.assign({},o),e)),o},[e,n])}function G7e(){const t={};for(var e=arguments.length,n=new Array(e),o=0;o{r&&Object.keys(r).forEach(i=>{r[i]!==void 0&&(t[i]=r[i])})}),t}const BHt={};function Tme(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:BHt;const o=V7e(t),r=V7e(e),i=be.useMemo(()=>Object.assign({closeIcon:be.createElement(Lw,null)},n),[n]),a=be.useMemo(()=>o===!1?!1:o?G7e(i,r,o):r===!1?!1:r?G7e(i,r):i.closable?i:!1,[o,r,i]);return be.useMemo(()=>{if(a===!1)return[!1,null];const{closeIconRender:l}=i,{closeIcon:s}=a;let c=s;if(c!=null){l&&(c=l(s));const u=yme(a,!0);Object.keys(u).length&&(c=be.isValidElement(c)?be.cloneElement(c,u):be.createElement("span",Object.assign({},u),c))}return[!0,c]},[a,i])}var YVe=function(e){if(MW()&&window.document.documentElement){var n=Array.isArray(e)?e:[e],o=window.document.documentElement;return n.some(function(r){return r in o.style})}return!1},YHt=function(e,n){if(!YVe(e))return!1;var o=document.createElement("div"),r=o.style[e];return o.style[e]=n,o.style[e]!==r};function X7e(t,e){return!Array.isArray(t)&&e!==void 0?YHt(t,e):YVe(t)}const OHt=()=>MW()&&window.document.documentElement;function V2(){V2=function(){return e};var t,e={},n=Object.prototype,o=n.hasOwnProperty,r=Object.defineProperty||function(k,N,F){k[N]=F.value},i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(k,N,F){return Object.defineProperty(k,N,{value:F,enumerable:!0,configurable:!0,writable:!0}),k[N]}try{c({},"")}catch{c=function(F,U,O){return F[U]=O}}function u(k,N,F,U){var O=N&&N.prototype instanceof b?N:b,B=Object.create(O.prototype),_=new j(U||[]);return r(B,"_invoke",{value:M(k,F,_)}),B}function d(k,N,F){try{return{type:"normal",arg:k.call(N,F)}}catch(U){return{type:"throw",arg:U}}}e.wrap=u;var f="suspendedStart",p="suspendedYield",g="executing",y="completed",w={};function b(){}function C(){}function P(){}var v={};c(v,a,function(){return this});var T=Object.getPrototypeOf,A=T&&T(T(L([])));A&&A!==n&&o.call(A,a)&&(v=A);var x=P.prototype=b.prototype=Object.create(v);function S(k){["next","throw","return"].forEach(function(N){c(k,N,function(F){return this._invoke(N,F)})})}function R(k,N){function F(O,B,_,X){var $=d(k[O],k,B);if($.type!=="throw"){var Q=$.arg,le=Q.value;return le&&hi(le)=="object"&&o.call(le,"__await")?N.resolve(le.__await).then(function(q){F("next",q,_,X)},function(q){F("throw",q,_,X)}):N.resolve(le).then(function(q){Q.value=q,_(Q)},function(q){return F("throw",q,_,X)})}X($.arg)}var U;r(this,"_invoke",{value:function(B,_){function X(){return new N(function($,Q){F(B,_,$,Q)})}return U=U?U.then(X,X):X()}})}function M(k,N,F){var U=f;return function(O,B){if(U===g)throw new Error("Generator is already running");if(U===y){if(O==="throw")throw B;return{value:t,done:!0}}for(F.method=O,F.arg=B;;){var _=F.delegate;if(_){var X=D(_,F);if(X){if(X===w)continue;return X}}if(F.method==="next")F.sent=F._sent=F.arg;else if(F.method==="throw"){if(U===f)throw U=y,F.arg;F.dispatchException(F.arg)}else F.method==="return"&&F.abrupt("return",F.arg);U=g;var $=d(k,N,F);if($.type==="normal"){if(U=F.done?y:p,$.arg===w)continue;return{value:$.arg,done:F.done}}$.type==="throw"&&(U=y,F.method="throw",F.arg=$.arg)}}}function D(k,N){var F=N.method,U=k.iterator[F];if(U===t)return N.delegate=null,F==="throw"&&k.iterator.return&&(N.method="return",N.arg=t,D(k,N),N.method==="throw")||F!=="return"&&(N.method="throw",N.arg=new TypeError("The iterator does not provide a '"+F+"' method")),w;var O=d(U,k.iterator,N.arg);if(O.type==="throw")return N.method="throw",N.arg=O.arg,N.delegate=null,w;var B=O.arg;return B?B.done?(N[k.resultName]=B.value,N.next=k.nextLoc,N.method!=="return"&&(N.method="next",N.arg=t),N.delegate=null,w):B:(N.method="throw",N.arg=new TypeError("iterator result is not an object"),N.delegate=null,w)}function E(k){var N={tryLoc:k[0]};1 in k&&(N.catchLoc=k[1]),2 in k&&(N.finallyLoc=k[2],N.afterLoc=k[3]),this.tryEntries.push(N)}function W(k){var N=k.completion||{};N.type="normal",delete N.arg,k.completion=N}function j(k){this.tryEntries=[{tryLoc:"root"}],k.forEach(E,this),this.reset(!0)}function L(k){if(k||k===""){var N=k[a];if(N)return N.call(k);if(typeof k.next=="function")return k;if(!isNaN(k.length)){var F=-1,U=function O(){for(;++F=0;--O){var B=this.tryEntries[O],_=B.completion;if(B.tryLoc==="root")return U("end");if(B.tryLoc<=this.prev){var X=o.call(B,"catchLoc"),$=o.call(B,"finallyLoc");if(X&&$){if(this.prev=0;--U){var O=this.tryEntries[U];if(O.tryLoc<=this.prev&&o.call(O,"finallyLoc")&&this.prev=0;--F){var U=this.tryEntries[F];if(U.finallyLoc===N)return this.complete(U.completion,U.afterLoc),W(U),w}},catch:function(N){for(var F=this.tryEntries.length-1;F>=0;--F){var U=this.tryEntries[F];if(U.tryLoc===N){var O=U.completion;if(O.type==="throw"){var B=O.arg;W(U)}return B}}throw new Error("illegal catch attempt")},delegateYield:function(N,F,U){return this.delegate={iterator:L(N),resultName:F,nextLoc:U},this.method==="next"&&(this.arg=t),w}},e}function J7e(t,e,n,o,r,i,a){try{var l=t[i](a),s=l.value}catch(c){n(c);return}l.done?e(s):Promise.resolve(s).then(o,r)}function LW(t){return function(){var e=this,n=arguments;return new Promise(function(o,r){var i=t.apply(e,n);function a(s){J7e(i,o,r,a,l,"next",s)}function l(s){J7e(i,o,r,a,l,"throw",s)}a(void 0)})}}var Wv="RC_FORM_INTERNAL_HOOKS",ws=function(){j0(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},yR=m.createContext({getFieldValue:ws,getFieldsValue:ws,getFieldError:ws,getFieldWarning:ws,getFieldsError:ws,isFieldsTouched:ws,isFieldTouched:ws,isFieldValidating:ws,isFieldsValidating:ws,resetFields:ws,setFields:ws,setFieldValue:ws,setFieldsValue:ws,validateFields:ws,submit:ws,getInternalHooks:function(){return ws(),{dispatch:ws,initEntityValue:ws,registerField:ws,useSubscribe:ws,setInitialValues:ws,destroyForm:ws,setCallbacks:ws,registerWatch:ws,getFields:ws,setValidateMessages:ws,setPreserve:ws,getInitialValue:ws}}}),FG=m.createContext(null);function F0e(t){return t==null?[]:Array.isArray(t)?t:[t]}function _Ht(t){return t&&!!t._init}function op(t){"@babel/helpers - typeof";return op=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},op(t)}function VHt(t,e){if(op(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(op(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function OVe(t){var e=VHt(t,"string");return op(e)=="symbol"?e:e+""}function eA(t,e,n){return e=OVe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function K7e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function X4(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n1?e-1:0),o=1;o=i)return l;switch(l){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}break;default:return l}});return a}return t}function rMt(t){return t==="string"||t==="url"||t==="hex"||t==="email"||t==="date"||t==="pattern"}function du(t,e){return!!(t==null||e==="array"&&Array.isArray(t)&&!t.length||rMt(e)&&typeof t=="string"&&!t)}function iMt(t,e,n){var o=[],r=0,i=t.length;function a(l){o.push.apply(o,ZP(l||[])),r++,r===i&&n(o)}t.forEach(function(l){e(l,a)})}function q7e(t,e,n){var o=0,r=t.length;function i(a){if(a&&a.length){n(a);return}var l=o;o=o+1,le.max?r.push(yg(i.messages[d].max,e.fullField,e.max)):l&&s&&(ue.max)&&r.push(yg(i.messages[d].range,e.fullField,e.min,e.max))},GVe=function(e,n,o,r,i,a){e.required&&(!o.hasOwnProperty(e.field)||du(n,a||e.type))&&r.push(yg(i.messages.required,e.fullField))},RY;const hMt=function(){if(RY)return RY;var t="[a-fA-F\\d:]",e=function(A){return A&&A.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(t,")|(?<=").concat(t,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",o="[a-fA-F\\d]{1,4}",r=["(?:".concat(o,":){7}(?:").concat(o,"|:)"),"(?:".concat(o,":){6}(?:").concat(n,"|:").concat(o,"|:)"),"(?:".concat(o,":){5}(?::").concat(n,"|(?::").concat(o,"){1,2}|:)"),"(?:".concat(o,":){4}(?:(?::").concat(o,"){0,1}:").concat(n,"|(?::").concat(o,"){1,3}|:)"),"(?:".concat(o,":){3}(?:(?::").concat(o,"){0,2}:").concat(n,"|(?::").concat(o,"){1,4}|:)"),"(?:".concat(o,":){2}(?:(?::").concat(o,"){0,3}:").concat(n,"|(?::").concat(o,"){1,5}|:)"),"(?:".concat(o,":){1}(?:(?::").concat(o,"){0,4}:").concat(n,"|(?::").concat(o,"){1,6}|:)"),"(?::(?:(?::".concat(o,"){0,5}:").concat(n,"|(?::").concat(o,"){1,7}|:))")],i="(?:%[0-9a-zA-Z]{1,})?",a="(?:".concat(r.join("|"),")").concat(i),l=new RegExp("(?:^".concat(n,"$)|(?:^").concat(a,"$)")),s=new RegExp("^".concat(n,"$")),c=new RegExp("^".concat(a,"$")),u=function(A){return A&&A.exact?l:new RegExp("(?:".concat(e(A)).concat(n).concat(e(A),")|(?:").concat(e(A)).concat(a).concat(e(A),")"),"g")};u.v4=function(T){return T&&T.exact?s:new RegExp("".concat(e(T)).concat(n).concat(e(T)),"g")},u.v6=function(T){return T&&T.exact?c:new RegExp("".concat(e(T)).concat(a).concat(e(T)),"g")};var d="(?:(?:[a-z]+:)?//)",f="(?:\\S+(?::\\S*)?@)?",p=u.v4().source,g=u.v6().source,y="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",w="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",b="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",C="(?::\\d{2,5})?",P='(?:[/?#][^\\s"]*)?',v="(?:".concat(d,"|www\\.)").concat(f,"(?:localhost|").concat(p,"|").concat(g,"|").concat(y).concat(w).concat(b,")").concat(C).concat(P);return RY=new RegExp("(?:^".concat(v,"$)"),"i"),RY};var eve={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},CD={integer:function(e){return CD.number(e)&&parseInt(e,10)===e},float:function(e){return CD.number(e)&&!CD.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return op(e)==="object"&&!CD.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(eve.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(hMt())},hex:function(e){return typeof e=="string"&&!!e.match(eve.hex)}},pMt=function(e,n,o,r,i){if(e.required&&n===void 0){GVe(e,n,o,r,i);return}var a=["integer","float","array","regexp","object","method","email","number","date","url","hex"],l=e.type;a.indexOf(l)>-1?CD[l](n)||r.push(yg(i.messages.types[l],e.fullField,e.type)):l&&op(n)!==e.type&&r.push(yg(i.messages.types[l],e.fullField,e.type))},gMt=function(e,n,o,r,i){(/^\s+$/.test(n)||n==="")&&r.push(yg(i.messages.whitespace,e.fullField))};const tl={required:GVe,whitespace:gMt,type:pMt,range:fMt,enum:uMt,pattern:dMt};var mMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i)}o(a)},yMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(n==null&&!e.required)return o();tl.required(e,n,r,a,i,"array"),n!=null&&(tl.type(e,n,r,a,i),tl.range(e,n,r,a,i))}o(a)},AMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i),n!==void 0&&tl.type(e,n,r,a,i)}o(a)},wMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n,"date")&&!e.required)return o();if(tl.required(e,n,r,a,i),!du(n,"date")){var s;n instanceof Date?s=n:s=new Date(n),tl.type(e,s,r,a,i),s&&tl.range(e,s.getTime(),r,a,i)}}o(a)},vMt="enum",xMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i),n!==void 0&&tl[vMt](e,n,r,a,i)}o(a)},bMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i),n!==void 0&&(tl.type(e,n,r,a,i),tl.range(e,n,r,a,i))}o(a)},SMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i),n!==void 0&&(tl.type(e,n,r,a,i),tl.range(e,n,r,a,i))}o(a)},TMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i),n!==void 0&&tl.type(e,n,r,a,i)}o(a)},PMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(n===""&&(n=void 0),du(n)&&!e.required)return o();tl.required(e,n,r,a,i),n!==void 0&&(tl.type(e,n,r,a,i),tl.range(e,n,r,a,i))}o(a)},CMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i),n!==void 0&&tl.type(e,n,r,a,i)}o(a)},RMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n,"string")&&!e.required)return o();tl.required(e,n,r,a,i),du(n,"string")||tl.pattern(e,n,r,a,i)}o(a)},HMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i),du(n)||tl.type(e,n,r,a,i)}o(a)},MMt=function(e,n,o,r,i){var a=[],l=Array.isArray(n)?"array":op(n);tl.required(e,n,r,a,i,l),o(a)},IMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n,"string")&&!e.required)return o();tl.required(e,n,r,a,i,"string"),du(n,"string")||(tl.type(e,n,r,a,i),tl.range(e,n,r,a,i),tl.pattern(e,n,r,a,i),e.whitespace===!0&&tl.whitespace(e,n,r,a,i))}o(a)},Qre=function(e,n,o,r,i){var a=e.type,l=[],s=e.required||!e.required&&r.hasOwnProperty(e.field);if(s){if(du(n,a)&&!e.required)return o();tl.required(e,n,r,l,i,a),du(n,a)||tl.type(e,n,r,l,i)}o(l)};const vE={string:IMt,method:TMt,number:PMt,boolean:AMt,regexp:HMt,integer:SMt,float:bMt,array:yMt,object:CMt,enum:xMt,pattern:RMt,date:wMt,url:Qre,hex:Qre,email:Qre,required:MMt,any:mMt};var WW=function(){function t(e){_Ve(this,t),eA(this,"rules",null),eA(this,"_messages",W0e),this.define(e)}return VVe(t,[{key:"define",value:function(n){var o=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(op(n)!=="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(r){var i=n[r];o.rules[r]=Array.isArray(i)?i:[i]})}},{key:"messages",value:function(n){return n&&(this._messages=Z7e(L0e(),n)),this._messages}},{key:"validate",value:function(n){var o=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},a=n,l=r,s=i;if(typeof l=="function"&&(s=l,l={}),!this.rules||Object.keys(this.rules).length===0)return s&&s(null,a),Promise.resolve(a);function c(g){var y=[],w={};function b(P){if(Array.isArray(P)){var v;y=(v=y).concat.apply(v,ZP(P))}else y.push(P)}for(var C=0;C0&&arguments[0]!==void 0?arguments[0]:[],S=Array.isArray(x)?x:[x];!l.suppressWarning&&S.length&&t.warning("async-validator:",S),S.length&&w.message!==void 0&&(S=[].concat(w.message));var R=S.map(Q7e(w,a));if(l.first&&R.length)return p[w.field]=1,y(R);if(!b)y(R);else{if(w.required&&!g.value)return w.message!==void 0?R=[].concat(w.message).map(Q7e(w,a)):l.error&&(R=[l.error(w,yg(l.messages.required,w.field))]),y(R);var M={};w.defaultField&&Object.keys(g.value).map(function(W){M[W]=w.defaultField}),M=X4(X4({},M),g.rule.fields);var D={};Object.keys(M).forEach(function(W){var j=M[W],L=Array.isArray(j)?j:[j];D[W]=L.map(C.bind(null,W))});var E=new t(D);E.messages(l.messages),g.rule.options&&(g.rule.options.messages=l.messages,g.rule.options.error=l.error),E.validate(g.value,g.rule.options||l,function(W){var j=[];R&&R.length&&j.push.apply(j,ZP(R)),W&&W.length&&j.push.apply(j,ZP(W)),y(j.length?j:null)})}}var v;if(w.asyncValidator)v=w.asyncValidator(w,g.value,P,g.source,l);else if(w.validator){try{v=w.validator(w,g.value,P,g.source,l)}catch(x){var T,A;(T=(A=console).error)===null||T===void 0||T.call(A,x),l.suppressValidatorError||setTimeout(function(){throw x},0),P(x.message)}v===!0?P():v===!1?P(typeof w.message=="function"?w.message(w.fullField||w.field):w.message||"".concat(w.fullField||w.field," fails")):v instanceof Array?P(v):v instanceof Error&&P(v.message)}v&&v.then&&v.then(function(){return P()},function(x){return P(x)})},function(g){c(g)},a)}},{key:"getType",value:function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!vE.hasOwnProperty(n.type))throw new Error(yg("Unknown rule type %s",n.type));return n.type||"string"}},{key:"getValidationMethod",value:function(n){if(typeof n.validator=="function")return n.validator;var o=Object.keys(n),r=o.indexOf("message");return r!==-1&&o.splice(r,1),o.length===1&&o[0]==="required"?vE.required:vE[this.getType(n)]||void 0}}]),t}();eA(WW,"register",function(e,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");vE[e]=n});eA(WW,"warning",oMt);eA(WW,"messages",W0e);eA(WW,"validators",vE);var N1="'${name}' is not a valid ${type}",XVe={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:N1,method:N1,array:N1,object:N1,number:N1,date:N1,boolean:N1,integer:N1,float:N1,regexp:N1,email:N1,url:N1,hex:N1},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}};function JVe(t){return jOe(t)||YOe(t)||qge(t)||BOe()}function Ag(t,e){for(var n=t,o=0;o3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&o&&n===void 0&&!Ag(t,e.slice(0,-1))?t:KVe(t,e,n,o)}function zMt(t){return hi(t)==="object"&&t!==null&&Object.getPrototypeOf(t)===Object.prototype}function tve(t){return Array.isArray(t)?[]:{}}var DMt=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function RD(){for(var t=arguments.length,e=new Array(t),n=0;n2&&arguments[2]!==void 0?arguments[2]:!1;return t&&t.some(function(o){return qVe(e,o,n)})}function qVe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!t||!e||!n&&t.length!==e.length?!1:e.every(function(o,r){return t[r]===o})}function WMt(t,e){if(t===e)return!0;if(!t&&e||t&&!e||!t||!e||hi(t)!=="object"||hi(e)!=="object")return!1;var n=Object.keys(t),o=Object.keys(e),r=new Set([].concat(n,o));return Lo(r).every(function(i){var a=t[i],l=e[i];return typeof a=="function"&&typeof l=="function"?!0:a===l})}function NMt(t){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&hi(e.target)==="object"&&t in e.target?e.target[t]:e}function ive(t,e,n){var o=t.length;if(e<0||e>=o||n<0||n>=o)return t;var r=t[e],i=e-n;return i>0?[].concat(Lo(t.slice(0,n)),[r],Lo(t.slice(n,e)),Lo(t.slice(e+1,o))):i<0?[].concat(Lo(t.slice(0,e)),Lo(t.slice(e+1,n+1)),[r],Lo(t.slice(n+1,o))):t}var UMt=["name"],hm=[];function ave(t,e,n,o,r,i){return typeof t=="function"?t(e,n,"source"in i?{source:i.source}:{}):o!==r}var Cme=function(t){RW(n,t);var e=HW(n);function n(o){var r;if(Ap(this,n),r=e.call(this,o),Vt(Pl(r),"state",{resetCount:0}),Vt(Pl(r),"cancelRegisterFunc",null),Vt(Pl(r),"mounted",!1),Vt(Pl(r),"touched",!1),Vt(Pl(r),"dirty",!1),Vt(Pl(r),"validatePromise",void 0),Vt(Pl(r),"prevValidating",void 0),Vt(Pl(r),"errors",hm),Vt(Pl(r),"warnings",hm),Vt(Pl(r),"cancelRegister",function(){var s=r.props,c=s.preserve,u=s.isListField,d=s.name;r.cancelRegisterFunc&&r.cancelRegisterFunc(u,c,D0(d)),r.cancelRegisterFunc=null}),Vt(Pl(r),"getNamePath",function(){var s=r.props,c=s.name,u=s.fieldContext,d=u.prefixName,f=d===void 0?[]:d;return c!==void 0?[].concat(Lo(f),Lo(c)):[]}),Vt(Pl(r),"getRules",function(){var s=r.props,c=s.rules,u=c===void 0?[]:c,d=s.fieldContext;return u.map(function(f){return typeof f=="function"?f(d):f})}),Vt(Pl(r),"refresh",function(){r.mounted&&r.setState(function(s){var c=s.resetCount;return{resetCount:c+1}})}),Vt(Pl(r),"metaCache",null),Vt(Pl(r),"triggerMetaEvent",function(s){var c=r.props.onMetaChange;if(c){var u=qt(qt({},r.getMeta()),{},{destroy:s});iw(r.metaCache,u)||c(u),r.metaCache=u}else r.metaCache=null}),Vt(Pl(r),"onStoreChange",function(s,c,u){var d=r.props,f=d.shouldUpdate,p=d.dependencies,g=p===void 0?[]:p,y=d.onReset,w=u.store,b=r.getNamePath(),C=r.getValue(s),P=r.getValue(w),v=c&&HC(c,b);switch(u.type==="valueUpdate"&&u.source==="external"&&!iw(C,P)&&(r.touched=!0,r.dirty=!0,r.validatePromise=null,r.errors=hm,r.warnings=hm,r.triggerMetaEvent()),u.type){case"reset":if(!c||v){r.touched=!1,r.dirty=!1,r.validatePromise=void 0,r.errors=hm,r.warnings=hm,r.triggerMetaEvent(),y==null||y(),r.refresh();return}break;case"remove":{if(f){r.reRender();return}break}case"setField":{var T=u.data;if(v){"touched"in T&&(r.touched=T.touched),"validating"in T&&!("originRCField"in T)&&(r.validatePromise=T.validating?Promise.resolve([]):null),"errors"in T&&(r.errors=T.errors||hm),"warnings"in T&&(r.warnings=T.warnings||hm),r.dirty=!0,r.triggerMetaEvent(),r.reRender();return}else if("value"in T&&HC(c,b,!0)){r.reRender();return}if(f&&!b.length&&ave(f,s,w,C,P,u)){r.reRender();return}break}case"dependenciesUpdate":{var A=g.map(D0);if(A.some(function(x){return HC(u.relatedFields,x)})){r.reRender();return}break}default:if(v||(!g.length||b.length||f)&&ave(f,s,w,C,P,u)){r.reRender();return}break}f===!0&&r.reRender()}),Vt(Pl(r),"validateRules",function(s){var c=r.getNamePath(),u=r.getValue(),d=s||{},f=d.triggerName,p=d.validateOnly,g=p===void 0?!1:p,y=Promise.resolve().then(LW(V2().mark(function w(){var b,C,P,v,T,A,x;return V2().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:if(r.mounted){R.next=2;break}return R.abrupt("return",[]);case 2:if(b=r.props,C=b.validateFirst,P=C===void 0?!1:C,v=b.messageVariables,T=b.validateDebounce,A=r.getRules(),f&&(A=A.filter(function(M){return M}).filter(function(M){var D=M.validateTrigger;if(!D)return!0;var E=F0e(D);return E.includes(f)})),!(T&&f)){R.next=10;break}return R.next=8,new Promise(function(M){setTimeout(M,T)});case 8:if(r.validatePromise===y){R.next=10;break}return R.abrupt("return",[]);case 10:return x=FMt(c,u,A,s,P,v),x.catch(function(M){return M}).then(function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hm;if(r.validatePromise===y){var D;r.validatePromise=null;var E=[],W=[];(D=M.forEach)===null||D===void 0||D.call(M,function(j){var L=j.rule.warningOnly,k=j.errors,N=k===void 0?hm:k;L?W.push.apply(W,Lo(N)):E.push.apply(E,Lo(N))}),r.errors=E,r.warnings=W,r.triggerMetaEvent(),r.reRender()}}),R.abrupt("return",x);case 13:case"end":return R.stop()}},w)})));return g||(r.validatePromise=y,r.dirty=!0,r.errors=hm,r.warnings=hm,r.triggerMetaEvent(),r.reRender()),y}),Vt(Pl(r),"isFieldValidating",function(){return!!r.validatePromise}),Vt(Pl(r),"isFieldTouched",function(){return r.touched}),Vt(Pl(r),"isFieldDirty",function(){if(r.dirty||r.props.initialValue!==void 0)return!0;var s=r.props.fieldContext,c=s.getInternalHooks(Wv),u=c.getInitialValue;return u(r.getNamePath())!==void 0}),Vt(Pl(r),"getErrors",function(){return r.errors}),Vt(Pl(r),"getWarnings",function(){return r.warnings}),Vt(Pl(r),"isListField",function(){return r.props.isListField}),Vt(Pl(r),"isList",function(){return r.props.isList}),Vt(Pl(r),"isPreserve",function(){return r.props.preserve}),Vt(Pl(r),"getMeta",function(){r.prevValidating=r.isFieldValidating();var s={touched:r.isFieldTouched(),validating:r.prevValidating,errors:r.errors,warnings:r.warnings,name:r.getNamePath(),validated:r.validatePromise===null};return s}),Vt(Pl(r),"getOnlyChild",function(s){if(typeof s=="function"){var c=r.getMeta();return qt(qt({},r.getOnlyChild(s(r.getControlled(),c,r.props.fieldContext))),{},{isFunction:!0})}var u=ow(s);return u.length!==1||!m.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}}),Vt(Pl(r),"getValue",function(s){var c=r.props.fieldContext.getFieldsValue,u=r.getNamePath();return Ag(s||c(!0),u)}),Vt(Pl(r),"getControlled",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=r.props,u=c.name,d=c.trigger,f=c.validateTrigger,p=c.getValueFromEvent,g=c.normalize,y=c.valuePropName,w=c.getValueProps,b=c.fieldContext,C=f!==void 0?f:b.validateTrigger,P=r.getNamePath(),v=b.getInternalHooks,T=b.getFieldsValue,A=v(Wv),x=A.dispatch,S=r.getValue(),R=w||function(j){return Vt({},y,j)},M=s[d],D=u!==void 0?R(S):{},E=qt(qt({},s),D);E[d]=function(){r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var j,L=arguments.length,k=new Array(L),N=0;N=0&&M<=D.length?(u.keys=[].concat(Lo(u.keys.slice(0,M)),[u.id],Lo(u.keys.slice(M))),P([].concat(Lo(D.slice(0,M)),[R],Lo(D.slice(M))))):(u.keys=[].concat(Lo(u.keys),[u.id]),P([].concat(Lo(D),[R]))),u.id+=1},remove:function(R){var M=T(),D=new Set(Array.isArray(R)?R:[R]);D.size<=0||(u.keys=u.keys.filter(function(E,W){return!D.has(W)}),P(M.filter(function(E,W){return!D.has(W)})))},move:function(R,M){if(R!==M){var D=T();R<0||R>=D.length||M<0||M>=D.length||(u.keys=ive(u.keys,R,M),P(ive(D,R,M)))}}},x=C||[];return Array.isArray(x)||(x=[]),o(x.map(function(S,R){var M=u.keys[R];return M===void 0&&(u.keys[R]=u.id,M=u.keys[R],u.id+=1),{name:R,key:M,isListField:!0}}),A,w)})))}function BMt(t){var e=!1,n=t.length,o=[];return t.length?new Promise(function(r,i){t.forEach(function(a,l){a.catch(function(s){return e=!0,s}).then(function(s){n-=1,o[l]=s,!(n>0)&&(e&&i(o),r(o))})})}):Promise.resolve([])}var QVe="__@field_split__";function Zre(t){return t.map(function(e){return"".concat(hi(e),":").concat(e)}).join(QVe)}var HT=function(){function t(){Ap(this,t),Vt(this,"kvs",new Map)}return wp(t,[{key:"set",value:function(n,o){this.kvs.set(Zre(n),o)}},{key:"get",value:function(n){return this.kvs.get(Zre(n))}},{key:"update",value:function(n,o){var r=this.get(n),i=o(r);i?this.set(n,i):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(Zre(n))}},{key:"map",value:function(n){return Lo(this.kvs.entries()).map(function(o){var r=ln(o,2),i=r[0],a=r[1],l=i.split(QVe);return n({key:l.map(function(s){var c=s.match(/^([^:]*):(.*)$/),u=ln(c,3),d=u[1],f=u[2];return d==="number"?Number(f):f}),value:a})})}},{key:"toJSON",value:function(){var n={};return this.map(function(o){var r=o.key,i=o.value;return n[r.join(".")]=i,null}),n}}]),t}(),YMt=["name"],OMt=wp(function t(e){var n=this;Ap(this,t),Vt(this,"formHooked",!1),Vt(this,"forceRootUpdate",void 0),Vt(this,"subscribable",!0),Vt(this,"store",{}),Vt(this,"fieldEntities",[]),Vt(this,"initialValues",{}),Vt(this,"callbacks",{}),Vt(this,"validateMessages",null),Vt(this,"preserve",null),Vt(this,"lastValidatePromise",null),Vt(this,"getForm",function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}}),Vt(this,"getInternalHooks",function(o){return o===Wv?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(j0(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),Vt(this,"useSubscribe",function(o){n.subscribable=o}),Vt(this,"prevWithoutPreserves",null),Vt(this,"setInitialValues",function(o,r){if(n.initialValues=o||{},r){var i,a=RD(o,n.store);(i=n.prevWithoutPreserves)===null||i===void 0||i.map(function(l){var s=l.key;a=d2(a,s,Ag(o,s))}),n.prevWithoutPreserves=null,n.updateStore(a)}}),Vt(this,"destroyForm",function(){var o=new HT;n.getFieldEntities(!0).forEach(function(r){n.isMergedPreserve(r.isPreserve())||o.set(r.getNamePath(),!0)}),n.prevWithoutPreserves=o}),Vt(this,"getInitialValue",function(o){var r=Ag(n.initialValues,o);return o.length?RD(r):r}),Vt(this,"setCallbacks",function(o){n.callbacks=o}),Vt(this,"setValidateMessages",function(o){n.validateMessages=o}),Vt(this,"setPreserve",function(o){n.preserve=o}),Vt(this,"watchList",[]),Vt(this,"registerWatch",function(o){return n.watchList.push(o),function(){n.watchList=n.watchList.filter(function(r){return r!==o})}}),Vt(this,"notifyWatch",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var r=n.getFieldsValue(),i=n.getFieldsValue(!0);n.watchList.forEach(function(a){a(r,i,o)})}}),Vt(this,"timeoutId",null),Vt(this,"warningUnhooked",function(){}),Vt(this,"updateStore",function(o){n.store=o}),Vt(this,"getFieldEntities",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return o?n.fieldEntities.filter(function(r){return r.getNamePath().length}):n.fieldEntities}),Vt(this,"getFieldsMap",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=new HT;return n.getFieldEntities(o).forEach(function(i){var a=i.getNamePath();r.set(a,i)}),r}),Vt(this,"getFieldEntitiesForNamePathList",function(o){if(!o)return n.getFieldEntities(!0);var r=n.getFieldsMap(!0);return o.map(function(i){var a=D0(i);return r.get(a)||{INVALIDATE_NAME_PATH:D0(i)}})}),Vt(this,"getFieldsValue",function(o,r){n.warningUnhooked();var i,a,l;if(o===!0||Array.isArray(o)?(i=o,a=r):o&&hi(o)==="object"&&(l=o.strict,a=o.filter),i===!0&&!a)return n.store;var s=n.getFieldEntitiesForNamePathList(Array.isArray(i)?i:null),c=[];return s.forEach(function(u){var d,f,p="INVALIDATE_NAME_PATH"in u?u.INVALIDATE_NAME_PATH:u.getNamePath();if(l){var g,y;if((g=(y=u).isList)!==null&&g!==void 0&&g.call(y))return}else if(!i&&(d=(f=u).isListField)!==null&&d!==void 0&&d.call(f))return;if(!a)c.push(p);else{var w="getMeta"in u?u.getMeta():null;a(w)&&c.push(p)}}),rve(n.store,c.map(D0))}),Vt(this,"getFieldValue",function(o){n.warningUnhooked();var r=D0(o);return Ag(n.store,r)}),Vt(this,"getFieldsError",function(o){n.warningUnhooked();var r=n.getFieldEntitiesForNamePathList(o);return r.map(function(i,a){return i&&!("INVALIDATE_NAME_PATH"in i)?{name:i.getNamePath(),errors:i.getErrors(),warnings:i.getWarnings()}:{name:D0(o[a]),errors:[],warnings:[]}})}),Vt(this,"getFieldError",function(o){n.warningUnhooked();var r=D0(o),i=n.getFieldsError([r])[0];return i.errors}),Vt(this,"getFieldWarning",function(o){n.warningUnhooked();var r=D0(o),i=n.getFieldsError([r])[0];return i.warnings}),Vt(this,"isFieldsTouched",function(){n.warningUnhooked();for(var o=arguments.length,r=new Array(o),i=0;i0&&arguments[0]!==void 0?arguments[0]:{},r=new HT,i=n.getFieldEntities(!0);i.forEach(function(s){var c=s.props.initialValue,u=s.getNamePath();if(c!==void 0){var d=r.get(u)||new Set;d.add({entity:s,value:c}),r.set(u,d)}});var a=function(c){c.forEach(function(u){var d=u.props.initialValue;if(d!==void 0){var f=u.getNamePath(),p=n.getInitialValue(f);if(p!==void 0)j0(!1,"Form already set 'initialValues' with path '".concat(f.join("."),"'. Field can not overwrite it."));else{var g=r.get(f);if(g&&g.size>1)j0(!1,"Multiple Field with path '".concat(f.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(g){var y=n.getFieldValue(f),w=u.isListField();!w&&(!o.skipExist||y===void 0)&&n.updateStore(d2(n.store,f,Lo(g)[0].value))}}}})},l;o.entities?l=o.entities:o.namePathList?(l=[],o.namePathList.forEach(function(s){var c=r.get(s);if(c){var u;(u=l).push.apply(u,Lo(Lo(c).map(function(d){return d.entity})))}})):l=i,a(l)}),Vt(this,"resetFields",function(o){n.warningUnhooked();var r=n.store;if(!o){n.updateStore(RD(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(r,null,{type:"reset"}),n.notifyWatch();return}var i=o.map(D0);i.forEach(function(a){var l=n.getInitialValue(a);n.updateStore(d2(n.store,a,l))}),n.resetWithFieldInitialValue({namePathList:i}),n.notifyObservers(r,i,{type:"reset"}),n.notifyWatch(i)}),Vt(this,"setFields",function(o){n.warningUnhooked();var r=n.store,i=[];o.forEach(function(a){var l=a.name,s=ii(a,YMt),c=D0(l);i.push(c),"value"in s&&n.updateStore(d2(n.store,c,s.value)),n.notifyObservers(r,[c],{type:"setField",data:a})}),n.notifyWatch(i)}),Vt(this,"getFields",function(){var o=n.getFieldEntities(!0),r=o.map(function(i){var a=i.getNamePath(),l=i.getMeta(),s=qt(qt({},l),{},{name:a,value:n.getFieldValue(a)});return Object.defineProperty(s,"originRCField",{value:!0}),s});return r}),Vt(this,"initEntityValue",function(o){var r=o.props.initialValue;if(r!==void 0){var i=o.getNamePath(),a=Ag(n.store,i);a===void 0&&n.updateStore(d2(n.store,i,r))}}),Vt(this,"isMergedPreserve",function(o){var r=o!==void 0?o:n.preserve;return r??!0}),Vt(this,"registerField",function(o){n.fieldEntities.push(o);var r=o.getNamePath();if(n.notifyWatch([r]),o.props.initialValue!==void 0){var i=n.store;n.resetWithFieldInitialValue({entities:[o],skipExist:!0}),n.notifyObservers(i,[o.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(a,l){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(d){return d!==o}),!n.isMergedPreserve(l)&&(!a||s.length>1)){var c=a?void 0:n.getInitialValue(r);if(r.length&&n.getFieldValue(r)!==c&&n.fieldEntities.every(function(d){return!qVe(d.getNamePath(),r)})){var u=n.store;n.updateStore(d2(u,r,c,!0)),n.notifyObservers(u,[r],{type:"remove"}),n.triggerDependenciesUpdate(u,r)}}n.notifyWatch([r])}}),Vt(this,"dispatch",function(o){switch(o.type){case"updateValue":{var r=o.namePath,i=o.value;n.updateValue(r,i);break}case"validateField":{var a=o.namePath,l=o.triggerName;n.validateFields([a],{triggerName:l});break}}}),Vt(this,"notifyObservers",function(o,r,i){if(n.subscribable){var a=qt(qt({},i),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(l){var s=l.onStoreChange;s(o,r,a)})}else n.forceRootUpdate()}),Vt(this,"triggerDependenciesUpdate",function(o,r){var i=n.getDependencyChildrenFields(r);return i.length&&n.validateFields(i),n.notifyObservers(o,i,{type:"dependenciesUpdate",relatedFields:[r].concat(Lo(i))}),i}),Vt(this,"updateValue",function(o,r){var i=D0(o),a=n.store;n.updateStore(d2(n.store,i,r)),n.notifyObservers(a,[i],{type:"valueUpdate",source:"internal"}),n.notifyWatch([i]);var l=n.triggerDependenciesUpdate(a,i),s=n.callbacks.onValuesChange;if(s){var c=rve(n.store,[i]);s(c,n.getFieldsValue())}n.triggerOnFieldsChange([i].concat(Lo(l)))}),Vt(this,"setFieldsValue",function(o){n.warningUnhooked();var r=n.store;if(o){var i=RD(n.store,o);n.updateStore(i)}n.notifyObservers(r,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),Vt(this,"setFieldValue",function(o,r){n.setFields([{name:o,value:r}])}),Vt(this,"getDependencyChildrenFields",function(o){var r=new Set,i=[],a=new HT;n.getFieldEntities().forEach(function(s){var c=s.props.dependencies;(c||[]).forEach(function(u){var d=D0(u);a.update(d,function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return f.add(s),f})})});var l=function s(c){var u=a.get(c)||new Set;u.forEach(function(d){if(!r.has(d)){r.add(d);var f=d.getNamePath();d.isFieldDirty()&&f.length&&(i.push(f),s(f))}})};return l(o),i}),Vt(this,"triggerOnFieldsChange",function(o,r){var i=n.callbacks.onFieldsChange;if(i){var a=n.getFields();if(r){var l=new HT;r.forEach(function(c){var u=c.name,d=c.errors;l.set(u,d)}),a.forEach(function(c){c.errors=l.get(c.name)||c.errors})}var s=a.filter(function(c){var u=c.name;return HC(o,u)});s.length&&i(s,a)}}),Vt(this,"validateFields",function(o,r){n.warningUnhooked();var i,a;Array.isArray(o)||typeof o=="string"||typeof r=="string"?(i=o,a=r):a=o;var l=!!i,s=l?i.map(D0):[],c=[],u=String(Date.now()),d=new Set,f=a||{},p=f.recursive,g=f.dirty;n.getFieldEntities(!0).forEach(function(C){if(l||s.push(C.getNamePath()),!(!C.props.rules||!C.props.rules.length)&&!(g&&!C.isFieldDirty())){var P=C.getNamePath();if(d.add(P.join(u)),!l||HC(s,P,p)){var v=C.validateRules(qt({validateMessages:qt(qt({},XVe),n.validateMessages)},a));c.push(v.then(function(){return{name:P,errors:[],warnings:[]}}).catch(function(T){var A,x=[],S=[];return(A=T.forEach)===null||A===void 0||A.call(T,function(R){var M=R.rule.warningOnly,D=R.errors;M?S.push.apply(S,Lo(D)):x.push.apply(x,Lo(D))}),x.length?Promise.reject({name:P,errors:x,warnings:S}):{name:P,errors:x,warnings:S}}))}}});var y=BMt(c);n.lastValidatePromise=y,y.catch(function(C){return C}).then(function(C){var P=C.map(function(v){var T=v.name;return T});n.notifyObservers(n.store,P,{type:"validateFinish"}),n.triggerOnFieldsChange(P,C)});var w=y.then(function(){return n.lastValidatePromise===y?Promise.resolve(n.getFieldsValue(s)):Promise.reject([])}).catch(function(C){var P=C.filter(function(v){return v&&v.errors.length});return Promise.reject({values:n.getFieldsValue(s),errorFields:P,outOfDate:n.lastValidatePromise!==y})});w.catch(function(C){return C});var b=s.filter(function(C){return d.has(C.join(u))});return n.triggerOnFieldsChange(b),w}),Vt(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(o){var r=n.callbacks.onFinish;if(r)try{r(o)}catch(i){console.error(i)}}).catch(function(o){var r=n.callbacks.onFinishFailed;r&&r(o)})}),this.forceRootUpdate=e});function ZVe(t){var e=m.useRef(),n=m.useState({}),o=ln(n,2),r=o[1];if(!e.current)if(t)e.current=t;else{var i=function(){r({})},a=new OMt(i);e.current=a.getForm()}return[e.current]}var V0e=m.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),_Mt=function(e){var n=e.validateMessages,o=e.onFormChange,r=e.onFormFinish,i=e.children,a=m.useContext(V0e),l=m.useRef({});return m.createElement(V0e.Provider,{value:qt(qt({},a),{},{validateMessages:qt(qt({},a.validateMessages),n),triggerFormChange:function(c,u){o&&o(c,{changedFields:u,forms:l.current}),a.triggerFormChange(c,u)},triggerFormFinish:function(c,u){r&&r(c,{values:u,forms:l.current}),a.triggerFormFinish(c,u)},registerForm:function(c,u){c&&(l.current=qt(qt({},l.current),{},Vt({},c,u))),a.registerForm(c,u)},unregisterForm:function(c){var u=qt({},l.current);delete u[c],l.current=u,a.unregisterForm(c)}})},i)},VMt=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],GMt=function(e,n){var o=e.name,r=e.initialValues,i=e.fields,a=e.form,l=e.preserve,s=e.children,c=e.component,u=c===void 0?"form":c,d=e.validateMessages,f=e.validateTrigger,p=f===void 0?"onChange":f,g=e.onValuesChange,y=e.onFieldsChange,w=e.onFinish,b=e.onFinishFailed,C=ii(e,VMt),P=m.useContext(V0e),v=ZVe(a),T=ln(v,1),A=T[0],x=A.getInternalHooks(Wv),S=x.useSubscribe,R=x.setInitialValues,M=x.setCallbacks,D=x.setValidateMessages,E=x.setPreserve,W=x.destroyForm;m.useImperativeHandle(n,function(){return A}),m.useEffect(function(){return P.registerForm(o,A),function(){P.unregisterForm(o)}},[P,A,o]),D(qt(qt({},P.validateMessages),d)),M({onValuesChange:g,onFieldsChange:function(_){if(P.triggerFormChange(o,_),y){for(var X=arguments.length,$=new Array(X>1?X-1:0),Q=1;Q{let{children:e,status:n,override:o}=t;const r=m.useContext(r1),i=m.useMemo(()=>{const a=Object.assign({},r);return o&&delete a.isFormItemInput,n&&(delete a.status,delete a.hasFeedback,delete a.feedbackIcon),a},[n,o,r]);return m.createElement(r1.Provider,{value:i},e)},KMt=m.createContext(void 0);function sve(){}const qMt=m.createContext({add:sve,remove:sve});function eGe(t){const e=m.useContext(qMt),n=m.useRef();return q6(r=>{if(r){const i=t?r.querySelector(t):r;e.add(i),n.current=i}else e.remove(n.current)})}const cve=()=>{const{cancelButtonProps:t,cancelTextLocale:e,onCancel:n}=m.useContext(kW);return be.createElement(lo,Object.assign({onClick:n},t),e)},uve=()=>{const{confirmLoading:t,okButtonProps:e,okType:n,okTextLocale:o,onOk:r}=m.useContext(kW);return be.createElement(lo,Object.assign({},HVe(n),{loading:t,onClick:r},e),o)};function tGe(t,e){return be.createElement("span",{className:`${t}-close-x`},e||be.createElement(Lw,{className:`${t}-close-icon`}))}const nGe=t=>{const{okText:e,okType:n="primary",cancelText:o,confirmLoading:r,onOk:i,onCancel:a,okButtonProps:l,cancelButtonProps:s,footer:c}=t,[u]=kw("Modal",g_e()),d=e||(u==null?void 0:u.okText),f=o||(u==null?void 0:u.cancelText),p={confirmLoading:r,okButtonProps:l,cancelButtonProps:s,okTextLocale:d,cancelTextLocale:f,okType:n,onOk:i,onCancel:a},g=be.useMemo(()=>p,Za(Object.values(p)));let y;return typeof c=="function"||typeof c>"u"?(y=be.createElement(be.Fragment,null,be.createElement(cve,null),be.createElement(uve,null)),typeof c=="function"&&(y=c(y,{OkBtn:uve,CancelBtn:cve})),y=be.createElement(kVe,{value:g},y)):y=c,be.createElement(T_e,{disabled:!1},y)},Rme=t=>({[t.componentCls]:{[`${t.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${t.motionDurationMid} ${t.motionEaseInOut}, +}`),r)}else PG(r);return function(){PG(r)}},[e,r])}var EHt=!1;function FHt(t){return EHt}var j7e=function(e){return e===!1?!1:!dp()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},W$=m.forwardRef(function(t,e){var n=t.open,o=t.autoLock,r=t.getContainer;t.debug;var i=t.autoDestroy,a=i===void 0?!0:i,l=t.children,s=m.useState(n),c=ln(s,2),u=c[0],d=c[1],f=u||n;m.useEffect(function(){(a||n)&&d(n)},[n,a]);var p=m.useState(function(){return j7e(r)}),g=ln(p,2),y=g[0],w=g[1];m.useEffect(function(){var D=j7e(r);w(D??null)});var b=MHt(f&&!y),C=ln(b,2),P=C[0],v=C[1],T=y??P;DHt(o&&n&&dp()&&(T===P||T===document.body));var A=null;if(l&&rw(l)&&e){var x=l;A=x.ref}var S=Fw(A,e);if(!f||!dp()||y===void 0)return null;var R=T===!1||FHt(),M=l;return e&&(M=m.cloneElement(l,{ref:S})),m.createElement(LVe.Provider,{value:v},R?M:Cd.createPortal(M,T))}),WVe=m.createContext({});function kHt(){var t=qt({},IK);return t.useId}var B7e=0,Y7e=kHt();const NVe=Y7e?function(e){var n=Y7e();return e||n}:function(e){var n=m.useState("ssr-id"),o=ln(n,2),r=o[0],i=o[1];return m.useEffect(function(){var a=B7e;B7e+=1,i("rc_unique_".concat(a))},[]),e||r};function O7e(t,e,n){var o=e;return!o&&n&&(o="".concat(t,"-").concat(n)),o}function _7e(t,e){var n=t["page".concat(e?"Y":"X","Offset")],o="scroll".concat(e?"Top":"Left");if(typeof n!="number"){var r=t.document;n=r.documentElement[o],typeof n!="number"&&(n=r.body[o])}return n}function LHt(t){var e=t.getBoundingClientRect(),n={left:e.left,top:e.top},o=t.ownerDocument,r=o.defaultView||o.parentWindow;return n.left+=_7e(r),n.top+=_7e(r,!0),n}const WHt=m.memo(function(t){var e=t.children;return e},function(t,e){var n=e.shouldUpdate;return!n});var V7e={width:0,height:0,overflow:"hidden",outline:"none"},NHt={outline:"none"},UVe=be.forwardRef(function(t,e){var n=t.prefixCls,o=t.className,r=t.style,i=t.title,a=t.ariaId,l=t.footer,s=t.closable,c=t.closeIcon,u=t.onClose,d=t.children,f=t.bodyStyle,p=t.bodyProps,g=t.modalRender,y=t.onMouseDown,w=t.onMouseUp,b=t.holderRef,C=t.visible,P=t.forceRender,v=t.width,T=t.height,A=t.classNames,x=t.styles,S=be.useContext(WVe),R=S.panel,M=Fw(b,R),D=m.useRef(),E=m.useRef(),W=m.useRef();be.useImperativeHandle(e,function(){return{focus:function(){var _;(_=W.current)===null||_===void 0||_.focus()},changeActive:function(_){var X=document,$=X.activeElement;_&&$===E.current?D.current.focus():!_&&$===D.current&&E.current.focus()}}});var j={};v!==void 0&&(j.width=v),T!==void 0&&(j.height=T);var L;l&&(L=be.createElement("div",{className:Vn("".concat(n,"-footer"),A==null?void 0:A.footer),style:qt({},x==null?void 0:x.footer)},l));var k;i&&(k=be.createElement("div",{className:Vn("".concat(n,"-header"),A==null?void 0:A.header),style:qt({},x==null?void 0:x.header)},be.createElement("div",{className:"".concat(n,"-title"),id:a},i)));var N=m.useMemo(function(){return hi(s)==="object"&&s!==null?s:s?{closeIcon:c??be.createElement("span",{className:"".concat(n,"-close-x")})}:{}},[s,c]),F=Sf(N,!0),U;s&&(U=be.createElement("button",ho({type:"button",onClick:u,"aria-label":"Close"},F,{className:"".concat(n,"-close")}),N.closeIcon));var O=be.createElement("div",{className:Vn("".concat(n,"-content"),A==null?void 0:A.content),style:x==null?void 0:x.content},U,k,be.createElement("div",ho({className:Vn("".concat(n,"-body"),A==null?void 0:A.body),style:qt(qt({},f),x==null?void 0:x.body)},p),d),L);return be.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":i?a:null,"aria-modal":"true",ref:M,style:qt(qt({},r),j),className:Vn(n,o),onMouseDown:y,onMouseUp:w},be.createElement("div",{tabIndex:0,ref:D,style:V7e,"aria-hidden":"true"}),be.createElement("div",{ref:W,tabIndex:-1,style:NHt},be.createElement(WHt,{shouldUpdate:C||P},g?g(O):O)),be.createElement("div",{tabIndex:0,ref:E,style:V7e,"aria-hidden":"true"}))}),jVe=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.title,r=t.style,i=t.className,a=t.visible,l=t.forceRender,s=t.destroyOnClose,c=t.motionName,u=t.ariaId,d=t.onVisibleChanged,f=t.mousePosition,p=m.useRef(),g=m.useState(),y=ln(g,2),w=y[0],b=y[1],C={};w&&(C.transformOrigin=w);function P(){var v=LHt(p.current);b(f?"".concat(f.x-v.left,"px ").concat(f.y-v.top,"px"):"")}return m.createElement(o1,{visible:a,onVisibleChanged:d,onAppearPrepare:P,onEnterPrepare:P,forceRender:l,motionName:c,removeOnLeave:s,ref:p},function(v,T){var A=v.className,x=v.style;return m.createElement(UVe,ho({},t,{ref:e,title:o,ariaId:u,prefixCls:n,holderRef:T,style:qt(qt(qt({},x),r),C),className:Vn(i,A)}))})});jVe.displayName="Content";function UHt(t){var e=t.prefixCls,n=t.style,o=t.visible,r=t.maskProps,i=t.motionName,a=t.className;return m.createElement(o1,{key:"mask",visible:o,motionName:i,leavedClassName:"".concat(e,"-mask-hidden")},function(l,s){var c=l.className,u=l.style;return m.createElement("div",ho({ref:s,style:qt(qt({},u),n),className:Vn("".concat(e,"-mask"),c,a)},r))})}function jHt(t){var e=t.prefixCls,n=e===void 0?"rc-dialog":e,o=t.zIndex,r=t.visible,i=r===void 0?!1:r,a=t.keyboard,l=a===void 0?!0:a,s=t.focusTriggerAfterClose,c=s===void 0?!0:s,u=t.wrapStyle,d=t.wrapClassName,f=t.wrapProps,p=t.onClose,g=t.afterOpenChange,y=t.afterClose,w=t.transitionName,b=t.animation,C=t.closable,P=C===void 0?!0:C,v=t.mask,T=v===void 0?!0:v,A=t.maskTransitionName,x=t.maskAnimation,S=t.maskClosable,R=S===void 0?!0:S,M=t.maskStyle,D=t.maskProps,E=t.rootClassName,W=t.classNames,j=t.styles,L=m.useRef(),k=m.useRef(),N=m.useRef(),F=m.useState(i),U=ln(F,2),O=U[0],B=U[1],_=NVe();function X(){n0e(k.current,document.activeElement)||(L.current=document.activeElement)}function $(){if(!n0e(k.current,document.activeElement)){var fe;(fe=N.current)===null||fe===void 0||fe.focus()}}function Q(fe){if(fe)$();else{if(B(!1),T&&L.current&&c){try{L.current.focus({preventScroll:!0})}catch{}L.current=null}O&&(y==null||y())}g==null||g(fe)}function le(fe){p==null||p(fe)}var q=m.useRef(!1),te=m.useRef(),re=function(){clearTimeout(te.current),q.current=!0},ae=function(){te.current=setTimeout(function(){q.current=!1})},se=null;R&&(se=function(ge){q.current?q.current=!1:k.current===ge.target&&le(ge)});function ne(fe){if(l&&fe.keyCode===Bn.ESC){fe.stopPropagation(),le(fe);return}i&&fe.keyCode===Bn.TAB&&N.current.changeActive(!fe.shiftKey)}return m.useEffect(function(){i&&(B(!0),X())},[i]),m.useEffect(function(){return function(){clearTimeout(te.current)}},[]),m.createElement("div",ho({className:Vn("".concat(n,"-root"),E)},Sf(t,{data:!0})),m.createElement(UHt,{prefixCls:n,visible:T&&i,motionName:O7e(n,A,x),style:qt(qt({zIndex:o},M),j==null?void 0:j.mask),maskProps:D,className:W==null?void 0:W.mask}),m.createElement("div",ho({tabIndex:-1,onKeyDown:ne,className:Vn("".concat(n,"-wrap"),d,W==null?void 0:W.wrapper),ref:k,onClick:se,style:qt(qt(qt({zIndex:o},u),j==null?void 0:j.wrapper),{},{display:O?null:"none"})},f),m.createElement(jVe,ho({},t,{onMouseDown:re,onMouseUp:ae,ref:N,closable:P,ariaId:_,prefixCls:n,visible:i&&O,onClose:le,onVisibleChanged:Q,motionName:O7e(n,w,b)}))))}var BVe=function(e){var n=e.visible,o=e.getContainer,r=e.forceRender,i=e.destroyOnClose,a=i===void 0?!1:i,l=e.afterClose,s=e.panelRef,c=m.useState(n),u=ln(c,2),d=u[0],f=u[1],p=m.useMemo(function(){return{panel:s}},[s]);return m.useEffect(function(){n&&f(!0)},[n]),!r&&a&&!d?null:m.createElement(WVe.Provider,{value:p},m.createElement(W$,{open:n||r||d,autoDestroy:!1,getContainer:o,autoLock:n||d},m.createElement(jHt,ho({},e,{destroyOnClose:a,afterClose:function(){l==null||l(),f(!1)}}))))};BVe.displayName="Dialog";function mR(t){if(t)return{closable:t.closable,closeIcon:t.closeIcon}}function G7e(t){const{closable:e,closeIcon:n}=t||{};return be.useMemo(()=>{if(!e&&(e===!1||n===!1||n===null))return!1;if(e===void 0&&n===void 0)return null;let o={closeIcon:typeof n!="boolean"&&n!==null?n:void 0};return e&&typeof e=="object"&&(o=Object.assign(Object.assign({},o),e)),o},[e,n])}function X7e(){const t={};for(var e=arguments.length,n=new Array(e),o=0;o{r&&Object.keys(r).forEach(i=>{r[i]!==void 0&&(t[i]=r[i])})}),t}const BHt={};function Pme(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:BHt;const o=G7e(t),r=G7e(e),i=be.useMemo(()=>Object.assign({closeIcon:be.createElement(Lw,null)},n),[n]),a=be.useMemo(()=>o===!1?!1:o?X7e(i,r,o):r===!1?!1:r?X7e(i,r):i.closable?i:!1,[o,r,i]);return be.useMemo(()=>{if(a===!1)return[!1,null];const{closeIconRender:l}=i,{closeIcon:s}=a;let c=s;if(c!=null){l&&(c=l(s));const u=Ame(a,!0);Object.keys(u).length&&(c=be.isValidElement(c)?be.cloneElement(c,u):be.createElement("span",Object.assign({},u),c))}return[!0,c]},[a,i])}var YVe=function(e){if(IW()&&window.document.documentElement){var n=Array.isArray(e)?e:[e],o=window.document.documentElement;return n.some(function(r){return r in o.style})}return!1},YHt=function(e,n){if(!YVe(e))return!1;var o=document.createElement("div"),r=o.style[e];return o.style[e]=n,o.style[e]!==r};function J7e(t,e){return!Array.isArray(t)&&e!==void 0?YHt(t,e):YVe(t)}const OHt=()=>IW()&&window.document.documentElement;function V2(){V2=function(){return e};var t,e={},n=Object.prototype,o=n.hasOwnProperty,r=Object.defineProperty||function(k,N,F){k[N]=F.value},i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(k,N,F){return Object.defineProperty(k,N,{value:F,enumerable:!0,configurable:!0,writable:!0}),k[N]}try{c({},"")}catch{c=function(F,U,O){return F[U]=O}}function u(k,N,F,U){var O=N&&N.prototype instanceof b?N:b,B=Object.create(O.prototype),_=new j(U||[]);return r(B,"_invoke",{value:M(k,F,_)}),B}function d(k,N,F){try{return{type:"normal",arg:k.call(N,F)}}catch(U){return{type:"throw",arg:U}}}e.wrap=u;var f="suspendedStart",p="suspendedYield",g="executing",y="completed",w={};function b(){}function C(){}function P(){}var v={};c(v,a,function(){return this});var T=Object.getPrototypeOf,A=T&&T(T(L([])));A&&A!==n&&o.call(A,a)&&(v=A);var x=P.prototype=b.prototype=Object.create(v);function S(k){["next","throw","return"].forEach(function(N){c(k,N,function(F){return this._invoke(N,F)})})}function R(k,N){function F(O,B,_,X){var $=d(k[O],k,B);if($.type!=="throw"){var Q=$.arg,le=Q.value;return le&&hi(le)=="object"&&o.call(le,"__await")?N.resolve(le.__await).then(function(q){F("next",q,_,X)},function(q){F("throw",q,_,X)}):N.resolve(le).then(function(q){Q.value=q,_(Q)},function(q){return F("throw",q,_,X)})}X($.arg)}var U;r(this,"_invoke",{value:function(B,_){function X(){return new N(function($,Q){F(B,_,$,Q)})}return U=U?U.then(X,X):X()}})}function M(k,N,F){var U=f;return function(O,B){if(U===g)throw new Error("Generator is already running");if(U===y){if(O==="throw")throw B;return{value:t,done:!0}}for(F.method=O,F.arg=B;;){var _=F.delegate;if(_){var X=D(_,F);if(X){if(X===w)continue;return X}}if(F.method==="next")F.sent=F._sent=F.arg;else if(F.method==="throw"){if(U===f)throw U=y,F.arg;F.dispatchException(F.arg)}else F.method==="return"&&F.abrupt("return",F.arg);U=g;var $=d(k,N,F);if($.type==="normal"){if(U=F.done?y:p,$.arg===w)continue;return{value:$.arg,done:F.done}}$.type==="throw"&&(U=y,F.method="throw",F.arg=$.arg)}}}function D(k,N){var F=N.method,U=k.iterator[F];if(U===t)return N.delegate=null,F==="throw"&&k.iterator.return&&(N.method="return",N.arg=t,D(k,N),N.method==="throw")||F!=="return"&&(N.method="throw",N.arg=new TypeError("The iterator does not provide a '"+F+"' method")),w;var O=d(U,k.iterator,N.arg);if(O.type==="throw")return N.method="throw",N.arg=O.arg,N.delegate=null,w;var B=O.arg;return B?B.done?(N[k.resultName]=B.value,N.next=k.nextLoc,N.method!=="return"&&(N.method="next",N.arg=t),N.delegate=null,w):B:(N.method="throw",N.arg=new TypeError("iterator result is not an object"),N.delegate=null,w)}function E(k){var N={tryLoc:k[0]};1 in k&&(N.catchLoc=k[1]),2 in k&&(N.finallyLoc=k[2],N.afterLoc=k[3]),this.tryEntries.push(N)}function W(k){var N=k.completion||{};N.type="normal",delete N.arg,k.completion=N}function j(k){this.tryEntries=[{tryLoc:"root"}],k.forEach(E,this),this.reset(!0)}function L(k){if(k||k===""){var N=k[a];if(N)return N.call(k);if(typeof k.next=="function")return k;if(!isNaN(k.length)){var F=-1,U=function O(){for(;++F=0;--O){var B=this.tryEntries[O],_=B.completion;if(B.tryLoc==="root")return U("end");if(B.tryLoc<=this.prev){var X=o.call(B,"catchLoc"),$=o.call(B,"finallyLoc");if(X&&$){if(this.prev=0;--U){var O=this.tryEntries[U];if(O.tryLoc<=this.prev&&o.call(O,"finallyLoc")&&this.prev=0;--F){var U=this.tryEntries[F];if(U.finallyLoc===N)return this.complete(U.completion,U.afterLoc),W(U),w}},catch:function(N){for(var F=this.tryEntries.length-1;F>=0;--F){var U=this.tryEntries[F];if(U.tryLoc===N){var O=U.completion;if(O.type==="throw"){var B=O.arg;W(U)}return B}}throw new Error("illegal catch attempt")},delegateYield:function(N,F,U){return this.delegate={iterator:L(N),resultName:F,nextLoc:U},this.method==="next"&&(this.arg=t),w}},e}function K7e(t,e,n,o,r,i,a){try{var l=t[i](a),s=l.value}catch(c){n(c);return}l.done?e(s):Promise.resolve(s).then(o,r)}function WW(t){return function(){var e=this,n=arguments;return new Promise(function(o,r){var i=t.apply(e,n);function a(s){K7e(i,o,r,a,l,"next",s)}function l(s){K7e(i,o,r,a,l,"throw",s)}a(void 0)})}}var Wv="RC_FORM_INTERNAL_HOOKS",ws=function(){j0(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},yR=m.createContext({getFieldValue:ws,getFieldsValue:ws,getFieldError:ws,getFieldWarning:ws,getFieldsError:ws,isFieldsTouched:ws,isFieldTouched:ws,isFieldValidating:ws,isFieldsValidating:ws,resetFields:ws,setFields:ws,setFieldValue:ws,setFieldsValue:ws,validateFields:ws,submit:ws,getInternalHooks:function(){return ws(),{dispatch:ws,initEntityValue:ws,registerField:ws,useSubscribe:ws,setInitialValues:ws,destroyForm:ws,setCallbacks:ws,registerWatch:ws,getFields:ws,setValidateMessages:ws,setPreserve:ws,getInitialValue:ws}}}),kG=m.createContext(null);function F0e(t){return t==null?[]:Array.isArray(t)?t:[t]}function _Ht(t){return t&&!!t._init}function op(t){"@babel/helpers - typeof";return op=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},op(t)}function VHt(t,e){if(op(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(op(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function OVe(t){var e=VHt(t,"string");return op(e)=="symbol"?e:e+""}function eA(t,e,n){return e=OVe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function q7e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function X4(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n1?e-1:0),o=1;o=i)return l;switch(l){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}break;default:return l}});return a}return t}function rMt(t){return t==="string"||t==="url"||t==="hex"||t==="email"||t==="date"||t==="pattern"}function du(t,e){return!!(t==null||e==="array"&&Array.isArray(t)&&!t.length||rMt(e)&&typeof t=="string"&&!t)}function iMt(t,e,n){var o=[],r=0,i=t.length;function a(l){o.push.apply(o,ZP(l||[])),r++,r===i&&n(o)}t.forEach(function(l){e(l,a)})}function $7e(t,e,n){var o=0,r=t.length;function i(a){if(a&&a.length){n(a);return}var l=o;o=o+1,le.max?r.push(yg(i.messages[d].max,e.fullField,e.max)):l&&s&&(ue.max)&&r.push(yg(i.messages[d].range,e.fullField,e.min,e.max))},GVe=function(e,n,o,r,i,a){e.required&&(!o.hasOwnProperty(e.field)||du(n,a||e.type))&&r.push(yg(i.messages.required,e.fullField))},HY;const hMt=function(){if(HY)return HY;var t="[a-fA-F\\d:]",e=function(A){return A&&A.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(t,")|(?<=").concat(t,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",o="[a-fA-F\\d]{1,4}",r=["(?:".concat(o,":){7}(?:").concat(o,"|:)"),"(?:".concat(o,":){6}(?:").concat(n,"|:").concat(o,"|:)"),"(?:".concat(o,":){5}(?::").concat(n,"|(?::").concat(o,"){1,2}|:)"),"(?:".concat(o,":){4}(?:(?::").concat(o,"){0,1}:").concat(n,"|(?::").concat(o,"){1,3}|:)"),"(?:".concat(o,":){3}(?:(?::").concat(o,"){0,2}:").concat(n,"|(?::").concat(o,"){1,4}|:)"),"(?:".concat(o,":){2}(?:(?::").concat(o,"){0,3}:").concat(n,"|(?::").concat(o,"){1,5}|:)"),"(?:".concat(o,":){1}(?:(?::").concat(o,"){0,4}:").concat(n,"|(?::").concat(o,"){1,6}|:)"),"(?::(?:(?::".concat(o,"){0,5}:").concat(n,"|(?::").concat(o,"){1,7}|:))")],i="(?:%[0-9a-zA-Z]{1,})?",a="(?:".concat(r.join("|"),")").concat(i),l=new RegExp("(?:^".concat(n,"$)|(?:^").concat(a,"$)")),s=new RegExp("^".concat(n,"$")),c=new RegExp("^".concat(a,"$")),u=function(A){return A&&A.exact?l:new RegExp("(?:".concat(e(A)).concat(n).concat(e(A),")|(?:").concat(e(A)).concat(a).concat(e(A),")"),"g")};u.v4=function(T){return T&&T.exact?s:new RegExp("".concat(e(T)).concat(n).concat(e(T)),"g")},u.v6=function(T){return T&&T.exact?c:new RegExp("".concat(e(T)).concat(a).concat(e(T)),"g")};var d="(?:(?:[a-z]+:)?//)",f="(?:\\S+(?::\\S*)?@)?",p=u.v4().source,g=u.v6().source,y="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",w="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",b="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",C="(?::\\d{2,5})?",P='(?:[/?#][^\\s"]*)?',v="(?:".concat(d,"|www\\.)").concat(f,"(?:localhost|").concat(p,"|").concat(g,"|").concat(y).concat(w).concat(b,")").concat(C).concat(P);return HY=new RegExp("(?:^".concat(v,"$)"),"i"),HY};var tve={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},CD={integer:function(e){return CD.number(e)&&parseInt(e,10)===e},float:function(e){return CD.number(e)&&!CD.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return op(e)==="object"&&!CD.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(tve.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(hMt())},hex:function(e){return typeof e=="string"&&!!e.match(tve.hex)}},pMt=function(e,n,o,r,i){if(e.required&&n===void 0){GVe(e,n,o,r,i);return}var a=["integer","float","array","regexp","object","method","email","number","date","url","hex"],l=e.type;a.indexOf(l)>-1?CD[l](n)||r.push(yg(i.messages.types[l],e.fullField,e.type)):l&&op(n)!==e.type&&r.push(yg(i.messages.types[l],e.fullField,e.type))},gMt=function(e,n,o,r,i){(/^\s+$/.test(n)||n==="")&&r.push(yg(i.messages.whitespace,e.fullField))};const tl={required:GVe,whitespace:gMt,type:pMt,range:fMt,enum:uMt,pattern:dMt};var mMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i)}o(a)},yMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(n==null&&!e.required)return o();tl.required(e,n,r,a,i,"array"),n!=null&&(tl.type(e,n,r,a,i),tl.range(e,n,r,a,i))}o(a)},AMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i),n!==void 0&&tl.type(e,n,r,a,i)}o(a)},wMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n,"date")&&!e.required)return o();if(tl.required(e,n,r,a,i),!du(n,"date")){var s;n instanceof Date?s=n:s=new Date(n),tl.type(e,s,r,a,i),s&&tl.range(e,s.getTime(),r,a,i)}}o(a)},vMt="enum",xMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i),n!==void 0&&tl[vMt](e,n,r,a,i)}o(a)},bMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i),n!==void 0&&(tl.type(e,n,r,a,i),tl.range(e,n,r,a,i))}o(a)},SMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i),n!==void 0&&(tl.type(e,n,r,a,i),tl.range(e,n,r,a,i))}o(a)},TMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i),n!==void 0&&tl.type(e,n,r,a,i)}o(a)},PMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(n===""&&(n=void 0),du(n)&&!e.required)return o();tl.required(e,n,r,a,i),n!==void 0&&(tl.type(e,n,r,a,i),tl.range(e,n,r,a,i))}o(a)},CMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i),n!==void 0&&tl.type(e,n,r,a,i)}o(a)},RMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n,"string")&&!e.required)return o();tl.required(e,n,r,a,i),du(n,"string")||tl.pattern(e,n,r,a,i)}o(a)},HMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n)&&!e.required)return o();tl.required(e,n,r,a,i),du(n)||tl.type(e,n,r,a,i)}o(a)},MMt=function(e,n,o,r,i){var a=[],l=Array.isArray(n)?"array":op(n);tl.required(e,n,r,a,i,l),o(a)},IMt=function(e,n,o,r,i){var a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(du(n,"string")&&!e.required)return o();tl.required(e,n,r,a,i,"string"),du(n,"string")||(tl.type(e,n,r,a,i),tl.range(e,n,r,a,i),tl.pattern(e,n,r,a,i),e.whitespace===!0&&tl.whitespace(e,n,r,a,i))}o(a)},Qre=function(e,n,o,r,i){var a=e.type,l=[],s=e.required||!e.required&&r.hasOwnProperty(e.field);if(s){if(du(n,a)&&!e.required)return o();tl.required(e,n,r,l,i,a),du(n,a)||tl.type(e,n,r,l,i)}o(l)};const vE={string:IMt,method:TMt,number:PMt,boolean:AMt,regexp:HMt,integer:SMt,float:bMt,array:yMt,object:CMt,enum:xMt,pattern:RMt,date:wMt,url:Qre,hex:Qre,email:Qre,required:MMt,any:mMt};var NW=function(){function t(e){_Ve(this,t),eA(this,"rules",null),eA(this,"_messages",W0e),this.define(e)}return VVe(t,[{key:"define",value:function(n){var o=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(op(n)!=="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(r){var i=n[r];o.rules[r]=Array.isArray(i)?i:[i]})}},{key:"messages",value:function(n){return n&&(this._messages=eve(L0e(),n)),this._messages}},{key:"validate",value:function(n){var o=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},a=n,l=r,s=i;if(typeof l=="function"&&(s=l,l={}),!this.rules||Object.keys(this.rules).length===0)return s&&s(null,a),Promise.resolve(a);function c(g){var y=[],w={};function b(P){if(Array.isArray(P)){var v;y=(v=y).concat.apply(v,ZP(P))}else y.push(P)}for(var C=0;C0&&arguments[0]!==void 0?arguments[0]:[],S=Array.isArray(x)?x:[x];!l.suppressWarning&&S.length&&t.warning("async-validator:",S),S.length&&w.message!==void 0&&(S=[].concat(w.message));var R=S.map(Z7e(w,a));if(l.first&&R.length)return p[w.field]=1,y(R);if(!b)y(R);else{if(w.required&&!g.value)return w.message!==void 0?R=[].concat(w.message).map(Z7e(w,a)):l.error&&(R=[l.error(w,yg(l.messages.required,w.field))]),y(R);var M={};w.defaultField&&Object.keys(g.value).map(function(W){M[W]=w.defaultField}),M=X4(X4({},M),g.rule.fields);var D={};Object.keys(M).forEach(function(W){var j=M[W],L=Array.isArray(j)?j:[j];D[W]=L.map(C.bind(null,W))});var E=new t(D);E.messages(l.messages),g.rule.options&&(g.rule.options.messages=l.messages,g.rule.options.error=l.error),E.validate(g.value,g.rule.options||l,function(W){var j=[];R&&R.length&&j.push.apply(j,ZP(R)),W&&W.length&&j.push.apply(j,ZP(W)),y(j.length?j:null)})}}var v;if(w.asyncValidator)v=w.asyncValidator(w,g.value,P,g.source,l);else if(w.validator){try{v=w.validator(w,g.value,P,g.source,l)}catch(x){var T,A;(T=(A=console).error)===null||T===void 0||T.call(A,x),l.suppressValidatorError||setTimeout(function(){throw x},0),P(x.message)}v===!0?P():v===!1?P(typeof w.message=="function"?w.message(w.fullField||w.field):w.message||"".concat(w.fullField||w.field," fails")):v instanceof Array?P(v):v instanceof Error&&P(v.message)}v&&v.then&&v.then(function(){return P()},function(x){return P(x)})},function(g){c(g)},a)}},{key:"getType",value:function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!vE.hasOwnProperty(n.type))throw new Error(yg("Unknown rule type %s",n.type));return n.type||"string"}},{key:"getValidationMethod",value:function(n){if(typeof n.validator=="function")return n.validator;var o=Object.keys(n),r=o.indexOf("message");return r!==-1&&o.splice(r,1),o.length===1&&o[0]==="required"?vE.required:vE[this.getType(n)]||void 0}}]),t}();eA(NW,"register",function(e,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");vE[e]=n});eA(NW,"warning",oMt);eA(NW,"messages",W0e);eA(NW,"validators",vE);var N1="'${name}' is not a valid ${type}",XVe={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:N1,method:N1,array:N1,object:N1,number:N1,date:N1,boolean:N1,integer:N1,float:N1,regexp:N1,email:N1,url:N1,hex:N1},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}};function JVe(t){return jOe(t)||YOe(t)||$ge(t)||BOe()}function Ag(t,e){for(var n=t,o=0;o3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&o&&n===void 0&&!Ag(t,e.slice(0,-1))?t:KVe(t,e,n,o)}function zMt(t){return hi(t)==="object"&&t!==null&&Object.getPrototypeOf(t)===Object.prototype}function nve(t){return Array.isArray(t)?[]:{}}var DMt=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function RD(){for(var t=arguments.length,e=new Array(t),n=0;n2&&arguments[2]!==void 0?arguments[2]:!1;return t&&t.some(function(o){return qVe(e,o,n)})}function qVe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!t||!e||!n&&t.length!==e.length?!1:e.every(function(o,r){return t[r]===o})}function WMt(t,e){if(t===e)return!0;if(!t&&e||t&&!e||!t||!e||hi(t)!=="object"||hi(e)!=="object")return!1;var n=Object.keys(t),o=Object.keys(e),r=new Set([].concat(n,o));return Lo(r).every(function(i){var a=t[i],l=e[i];return typeof a=="function"&&typeof l=="function"?!0:a===l})}function NMt(t){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&hi(e.target)==="object"&&t in e.target?e.target[t]:e}function ave(t,e,n){var o=t.length;if(e<0||e>=o||n<0||n>=o)return t;var r=t[e],i=e-n;return i>0?[].concat(Lo(t.slice(0,n)),[r],Lo(t.slice(n,e)),Lo(t.slice(e+1,o))):i<0?[].concat(Lo(t.slice(0,e)),Lo(t.slice(e+1,n+1)),[r],Lo(t.slice(n+1,o))):t}var UMt=["name"],hm=[];function lve(t,e,n,o,r,i){return typeof t=="function"?t(e,n,"source"in i?{source:i.source}:{}):o!==r}var Rme=function(t){HW(n,t);var e=MW(n);function n(o){var r;if(Ap(this,n),r=e.call(this,o),Vt(Pl(r),"state",{resetCount:0}),Vt(Pl(r),"cancelRegisterFunc",null),Vt(Pl(r),"mounted",!1),Vt(Pl(r),"touched",!1),Vt(Pl(r),"dirty",!1),Vt(Pl(r),"validatePromise",void 0),Vt(Pl(r),"prevValidating",void 0),Vt(Pl(r),"errors",hm),Vt(Pl(r),"warnings",hm),Vt(Pl(r),"cancelRegister",function(){var s=r.props,c=s.preserve,u=s.isListField,d=s.name;r.cancelRegisterFunc&&r.cancelRegisterFunc(u,c,D0(d)),r.cancelRegisterFunc=null}),Vt(Pl(r),"getNamePath",function(){var s=r.props,c=s.name,u=s.fieldContext,d=u.prefixName,f=d===void 0?[]:d;return c!==void 0?[].concat(Lo(f),Lo(c)):[]}),Vt(Pl(r),"getRules",function(){var s=r.props,c=s.rules,u=c===void 0?[]:c,d=s.fieldContext;return u.map(function(f){return typeof f=="function"?f(d):f})}),Vt(Pl(r),"refresh",function(){r.mounted&&r.setState(function(s){var c=s.resetCount;return{resetCount:c+1}})}),Vt(Pl(r),"metaCache",null),Vt(Pl(r),"triggerMetaEvent",function(s){var c=r.props.onMetaChange;if(c){var u=qt(qt({},r.getMeta()),{},{destroy:s});iw(r.metaCache,u)||c(u),r.metaCache=u}else r.metaCache=null}),Vt(Pl(r),"onStoreChange",function(s,c,u){var d=r.props,f=d.shouldUpdate,p=d.dependencies,g=p===void 0?[]:p,y=d.onReset,w=u.store,b=r.getNamePath(),C=r.getValue(s),P=r.getValue(w),v=c&&HC(c,b);switch(u.type==="valueUpdate"&&u.source==="external"&&!iw(C,P)&&(r.touched=!0,r.dirty=!0,r.validatePromise=null,r.errors=hm,r.warnings=hm,r.triggerMetaEvent()),u.type){case"reset":if(!c||v){r.touched=!1,r.dirty=!1,r.validatePromise=void 0,r.errors=hm,r.warnings=hm,r.triggerMetaEvent(),y==null||y(),r.refresh();return}break;case"remove":{if(f){r.reRender();return}break}case"setField":{var T=u.data;if(v){"touched"in T&&(r.touched=T.touched),"validating"in T&&!("originRCField"in T)&&(r.validatePromise=T.validating?Promise.resolve([]):null),"errors"in T&&(r.errors=T.errors||hm),"warnings"in T&&(r.warnings=T.warnings||hm),r.dirty=!0,r.triggerMetaEvent(),r.reRender();return}else if("value"in T&&HC(c,b,!0)){r.reRender();return}if(f&&!b.length&&lve(f,s,w,C,P,u)){r.reRender();return}break}case"dependenciesUpdate":{var A=g.map(D0);if(A.some(function(x){return HC(u.relatedFields,x)})){r.reRender();return}break}default:if(v||(!g.length||b.length||f)&&lve(f,s,w,C,P,u)){r.reRender();return}break}f===!0&&r.reRender()}),Vt(Pl(r),"validateRules",function(s){var c=r.getNamePath(),u=r.getValue(),d=s||{},f=d.triggerName,p=d.validateOnly,g=p===void 0?!1:p,y=Promise.resolve().then(WW(V2().mark(function w(){var b,C,P,v,T,A,x;return V2().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:if(r.mounted){R.next=2;break}return R.abrupt("return",[]);case 2:if(b=r.props,C=b.validateFirst,P=C===void 0?!1:C,v=b.messageVariables,T=b.validateDebounce,A=r.getRules(),f&&(A=A.filter(function(M){return M}).filter(function(M){var D=M.validateTrigger;if(!D)return!0;var E=F0e(D);return E.includes(f)})),!(T&&f)){R.next=10;break}return R.next=8,new Promise(function(M){setTimeout(M,T)});case 8:if(r.validatePromise===y){R.next=10;break}return R.abrupt("return",[]);case 10:return x=FMt(c,u,A,s,P,v),x.catch(function(M){return M}).then(function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hm;if(r.validatePromise===y){var D;r.validatePromise=null;var E=[],W=[];(D=M.forEach)===null||D===void 0||D.call(M,function(j){var L=j.rule.warningOnly,k=j.errors,N=k===void 0?hm:k;L?W.push.apply(W,Lo(N)):E.push.apply(E,Lo(N))}),r.errors=E,r.warnings=W,r.triggerMetaEvent(),r.reRender()}}),R.abrupt("return",x);case 13:case"end":return R.stop()}},w)})));return g||(r.validatePromise=y,r.dirty=!0,r.errors=hm,r.warnings=hm,r.triggerMetaEvent(),r.reRender()),y}),Vt(Pl(r),"isFieldValidating",function(){return!!r.validatePromise}),Vt(Pl(r),"isFieldTouched",function(){return r.touched}),Vt(Pl(r),"isFieldDirty",function(){if(r.dirty||r.props.initialValue!==void 0)return!0;var s=r.props.fieldContext,c=s.getInternalHooks(Wv),u=c.getInitialValue;return u(r.getNamePath())!==void 0}),Vt(Pl(r),"getErrors",function(){return r.errors}),Vt(Pl(r),"getWarnings",function(){return r.warnings}),Vt(Pl(r),"isListField",function(){return r.props.isListField}),Vt(Pl(r),"isList",function(){return r.props.isList}),Vt(Pl(r),"isPreserve",function(){return r.props.preserve}),Vt(Pl(r),"getMeta",function(){r.prevValidating=r.isFieldValidating();var s={touched:r.isFieldTouched(),validating:r.prevValidating,errors:r.errors,warnings:r.warnings,name:r.getNamePath(),validated:r.validatePromise===null};return s}),Vt(Pl(r),"getOnlyChild",function(s){if(typeof s=="function"){var c=r.getMeta();return qt(qt({},r.getOnlyChild(s(r.getControlled(),c,r.props.fieldContext))),{},{isFunction:!0})}var u=ow(s);return u.length!==1||!m.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}}),Vt(Pl(r),"getValue",function(s){var c=r.props.fieldContext.getFieldsValue,u=r.getNamePath();return Ag(s||c(!0),u)}),Vt(Pl(r),"getControlled",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=r.props,u=c.name,d=c.trigger,f=c.validateTrigger,p=c.getValueFromEvent,g=c.normalize,y=c.valuePropName,w=c.getValueProps,b=c.fieldContext,C=f!==void 0?f:b.validateTrigger,P=r.getNamePath(),v=b.getInternalHooks,T=b.getFieldsValue,A=v(Wv),x=A.dispatch,S=r.getValue(),R=w||function(j){return Vt({},y,j)},M=s[d],D=u!==void 0?R(S):{},E=qt(qt({},s),D);E[d]=function(){r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var j,L=arguments.length,k=new Array(L),N=0;N=0&&M<=D.length?(u.keys=[].concat(Lo(u.keys.slice(0,M)),[u.id],Lo(u.keys.slice(M))),P([].concat(Lo(D.slice(0,M)),[R],Lo(D.slice(M))))):(u.keys=[].concat(Lo(u.keys),[u.id]),P([].concat(Lo(D),[R]))),u.id+=1},remove:function(R){var M=T(),D=new Set(Array.isArray(R)?R:[R]);D.size<=0||(u.keys=u.keys.filter(function(E,W){return!D.has(W)}),P(M.filter(function(E,W){return!D.has(W)})))},move:function(R,M){if(R!==M){var D=T();R<0||R>=D.length||M<0||M>=D.length||(u.keys=ave(u.keys,R,M),P(ave(D,R,M)))}}},x=C||[];return Array.isArray(x)||(x=[]),o(x.map(function(S,R){var M=u.keys[R];return M===void 0&&(u.keys[R]=u.id,M=u.keys[R],u.id+=1),{name:R,key:M,isListField:!0}}),A,w)})))}function BMt(t){var e=!1,n=t.length,o=[];return t.length?new Promise(function(r,i){t.forEach(function(a,l){a.catch(function(s){return e=!0,s}).then(function(s){n-=1,o[l]=s,!(n>0)&&(e&&i(o),r(o))})})}):Promise.resolve([])}var QVe="__@field_split__";function Zre(t){return t.map(function(e){return"".concat(hi(e),":").concat(e)}).join(QVe)}var HT=function(){function t(){Ap(this,t),Vt(this,"kvs",new Map)}return wp(t,[{key:"set",value:function(n,o){this.kvs.set(Zre(n),o)}},{key:"get",value:function(n){return this.kvs.get(Zre(n))}},{key:"update",value:function(n,o){var r=this.get(n),i=o(r);i?this.set(n,i):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(Zre(n))}},{key:"map",value:function(n){return Lo(this.kvs.entries()).map(function(o){var r=ln(o,2),i=r[0],a=r[1],l=i.split(QVe);return n({key:l.map(function(s){var c=s.match(/^([^:]*):(.*)$/),u=ln(c,3),d=u[1],f=u[2];return d==="number"?Number(f):f}),value:a})})}},{key:"toJSON",value:function(){var n={};return this.map(function(o){var r=o.key,i=o.value;return n[r.join(".")]=i,null}),n}}]),t}(),YMt=["name"],OMt=wp(function t(e){var n=this;Ap(this,t),Vt(this,"formHooked",!1),Vt(this,"forceRootUpdate",void 0),Vt(this,"subscribable",!0),Vt(this,"store",{}),Vt(this,"fieldEntities",[]),Vt(this,"initialValues",{}),Vt(this,"callbacks",{}),Vt(this,"validateMessages",null),Vt(this,"preserve",null),Vt(this,"lastValidatePromise",null),Vt(this,"getForm",function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}}),Vt(this,"getInternalHooks",function(o){return o===Wv?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(j0(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),Vt(this,"useSubscribe",function(o){n.subscribable=o}),Vt(this,"prevWithoutPreserves",null),Vt(this,"setInitialValues",function(o,r){if(n.initialValues=o||{},r){var i,a=RD(o,n.store);(i=n.prevWithoutPreserves)===null||i===void 0||i.map(function(l){var s=l.key;a=d2(a,s,Ag(o,s))}),n.prevWithoutPreserves=null,n.updateStore(a)}}),Vt(this,"destroyForm",function(){var o=new HT;n.getFieldEntities(!0).forEach(function(r){n.isMergedPreserve(r.isPreserve())||o.set(r.getNamePath(),!0)}),n.prevWithoutPreserves=o}),Vt(this,"getInitialValue",function(o){var r=Ag(n.initialValues,o);return o.length?RD(r):r}),Vt(this,"setCallbacks",function(o){n.callbacks=o}),Vt(this,"setValidateMessages",function(o){n.validateMessages=o}),Vt(this,"setPreserve",function(o){n.preserve=o}),Vt(this,"watchList",[]),Vt(this,"registerWatch",function(o){return n.watchList.push(o),function(){n.watchList=n.watchList.filter(function(r){return r!==o})}}),Vt(this,"notifyWatch",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var r=n.getFieldsValue(),i=n.getFieldsValue(!0);n.watchList.forEach(function(a){a(r,i,o)})}}),Vt(this,"timeoutId",null),Vt(this,"warningUnhooked",function(){}),Vt(this,"updateStore",function(o){n.store=o}),Vt(this,"getFieldEntities",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return o?n.fieldEntities.filter(function(r){return r.getNamePath().length}):n.fieldEntities}),Vt(this,"getFieldsMap",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=new HT;return n.getFieldEntities(o).forEach(function(i){var a=i.getNamePath();r.set(a,i)}),r}),Vt(this,"getFieldEntitiesForNamePathList",function(o){if(!o)return n.getFieldEntities(!0);var r=n.getFieldsMap(!0);return o.map(function(i){var a=D0(i);return r.get(a)||{INVALIDATE_NAME_PATH:D0(i)}})}),Vt(this,"getFieldsValue",function(o,r){n.warningUnhooked();var i,a,l;if(o===!0||Array.isArray(o)?(i=o,a=r):o&&hi(o)==="object"&&(l=o.strict,a=o.filter),i===!0&&!a)return n.store;var s=n.getFieldEntitiesForNamePathList(Array.isArray(i)?i:null),c=[];return s.forEach(function(u){var d,f,p="INVALIDATE_NAME_PATH"in u?u.INVALIDATE_NAME_PATH:u.getNamePath();if(l){var g,y;if((g=(y=u).isList)!==null&&g!==void 0&&g.call(y))return}else if(!i&&(d=(f=u).isListField)!==null&&d!==void 0&&d.call(f))return;if(!a)c.push(p);else{var w="getMeta"in u?u.getMeta():null;a(w)&&c.push(p)}}),ive(n.store,c.map(D0))}),Vt(this,"getFieldValue",function(o){n.warningUnhooked();var r=D0(o);return Ag(n.store,r)}),Vt(this,"getFieldsError",function(o){n.warningUnhooked();var r=n.getFieldEntitiesForNamePathList(o);return r.map(function(i,a){return i&&!("INVALIDATE_NAME_PATH"in i)?{name:i.getNamePath(),errors:i.getErrors(),warnings:i.getWarnings()}:{name:D0(o[a]),errors:[],warnings:[]}})}),Vt(this,"getFieldError",function(o){n.warningUnhooked();var r=D0(o),i=n.getFieldsError([r])[0];return i.errors}),Vt(this,"getFieldWarning",function(o){n.warningUnhooked();var r=D0(o),i=n.getFieldsError([r])[0];return i.warnings}),Vt(this,"isFieldsTouched",function(){n.warningUnhooked();for(var o=arguments.length,r=new Array(o),i=0;i0&&arguments[0]!==void 0?arguments[0]:{},r=new HT,i=n.getFieldEntities(!0);i.forEach(function(s){var c=s.props.initialValue,u=s.getNamePath();if(c!==void 0){var d=r.get(u)||new Set;d.add({entity:s,value:c}),r.set(u,d)}});var a=function(c){c.forEach(function(u){var d=u.props.initialValue;if(d!==void 0){var f=u.getNamePath(),p=n.getInitialValue(f);if(p!==void 0)j0(!1,"Form already set 'initialValues' with path '".concat(f.join("."),"'. Field can not overwrite it."));else{var g=r.get(f);if(g&&g.size>1)j0(!1,"Multiple Field with path '".concat(f.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(g){var y=n.getFieldValue(f),w=u.isListField();!w&&(!o.skipExist||y===void 0)&&n.updateStore(d2(n.store,f,Lo(g)[0].value))}}}})},l;o.entities?l=o.entities:o.namePathList?(l=[],o.namePathList.forEach(function(s){var c=r.get(s);if(c){var u;(u=l).push.apply(u,Lo(Lo(c).map(function(d){return d.entity})))}})):l=i,a(l)}),Vt(this,"resetFields",function(o){n.warningUnhooked();var r=n.store;if(!o){n.updateStore(RD(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(r,null,{type:"reset"}),n.notifyWatch();return}var i=o.map(D0);i.forEach(function(a){var l=n.getInitialValue(a);n.updateStore(d2(n.store,a,l))}),n.resetWithFieldInitialValue({namePathList:i}),n.notifyObservers(r,i,{type:"reset"}),n.notifyWatch(i)}),Vt(this,"setFields",function(o){n.warningUnhooked();var r=n.store,i=[];o.forEach(function(a){var l=a.name,s=ii(a,YMt),c=D0(l);i.push(c),"value"in s&&n.updateStore(d2(n.store,c,s.value)),n.notifyObservers(r,[c],{type:"setField",data:a})}),n.notifyWatch(i)}),Vt(this,"getFields",function(){var o=n.getFieldEntities(!0),r=o.map(function(i){var a=i.getNamePath(),l=i.getMeta(),s=qt(qt({},l),{},{name:a,value:n.getFieldValue(a)});return Object.defineProperty(s,"originRCField",{value:!0}),s});return r}),Vt(this,"initEntityValue",function(o){var r=o.props.initialValue;if(r!==void 0){var i=o.getNamePath(),a=Ag(n.store,i);a===void 0&&n.updateStore(d2(n.store,i,r))}}),Vt(this,"isMergedPreserve",function(o){var r=o!==void 0?o:n.preserve;return r??!0}),Vt(this,"registerField",function(o){n.fieldEntities.push(o);var r=o.getNamePath();if(n.notifyWatch([r]),o.props.initialValue!==void 0){var i=n.store;n.resetWithFieldInitialValue({entities:[o],skipExist:!0}),n.notifyObservers(i,[o.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(a,l){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(d){return d!==o}),!n.isMergedPreserve(l)&&(!a||s.length>1)){var c=a?void 0:n.getInitialValue(r);if(r.length&&n.getFieldValue(r)!==c&&n.fieldEntities.every(function(d){return!qVe(d.getNamePath(),r)})){var u=n.store;n.updateStore(d2(u,r,c,!0)),n.notifyObservers(u,[r],{type:"remove"}),n.triggerDependenciesUpdate(u,r)}}n.notifyWatch([r])}}),Vt(this,"dispatch",function(o){switch(o.type){case"updateValue":{var r=o.namePath,i=o.value;n.updateValue(r,i);break}case"validateField":{var a=o.namePath,l=o.triggerName;n.validateFields([a],{triggerName:l});break}}}),Vt(this,"notifyObservers",function(o,r,i){if(n.subscribable){var a=qt(qt({},i),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(l){var s=l.onStoreChange;s(o,r,a)})}else n.forceRootUpdate()}),Vt(this,"triggerDependenciesUpdate",function(o,r){var i=n.getDependencyChildrenFields(r);return i.length&&n.validateFields(i),n.notifyObservers(o,i,{type:"dependenciesUpdate",relatedFields:[r].concat(Lo(i))}),i}),Vt(this,"updateValue",function(o,r){var i=D0(o),a=n.store;n.updateStore(d2(n.store,i,r)),n.notifyObservers(a,[i],{type:"valueUpdate",source:"internal"}),n.notifyWatch([i]);var l=n.triggerDependenciesUpdate(a,i),s=n.callbacks.onValuesChange;if(s){var c=ive(n.store,[i]);s(c,n.getFieldsValue())}n.triggerOnFieldsChange([i].concat(Lo(l)))}),Vt(this,"setFieldsValue",function(o){n.warningUnhooked();var r=n.store;if(o){var i=RD(n.store,o);n.updateStore(i)}n.notifyObservers(r,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),Vt(this,"setFieldValue",function(o,r){n.setFields([{name:o,value:r}])}),Vt(this,"getDependencyChildrenFields",function(o){var r=new Set,i=[],a=new HT;n.getFieldEntities().forEach(function(s){var c=s.props.dependencies;(c||[]).forEach(function(u){var d=D0(u);a.update(d,function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return f.add(s),f})})});var l=function s(c){var u=a.get(c)||new Set;u.forEach(function(d){if(!r.has(d)){r.add(d);var f=d.getNamePath();d.isFieldDirty()&&f.length&&(i.push(f),s(f))}})};return l(o),i}),Vt(this,"triggerOnFieldsChange",function(o,r){var i=n.callbacks.onFieldsChange;if(i){var a=n.getFields();if(r){var l=new HT;r.forEach(function(c){var u=c.name,d=c.errors;l.set(u,d)}),a.forEach(function(c){c.errors=l.get(c.name)||c.errors})}var s=a.filter(function(c){var u=c.name;return HC(o,u)});s.length&&i(s,a)}}),Vt(this,"validateFields",function(o,r){n.warningUnhooked();var i,a;Array.isArray(o)||typeof o=="string"||typeof r=="string"?(i=o,a=r):a=o;var l=!!i,s=l?i.map(D0):[],c=[],u=String(Date.now()),d=new Set,f=a||{},p=f.recursive,g=f.dirty;n.getFieldEntities(!0).forEach(function(C){if(l||s.push(C.getNamePath()),!(!C.props.rules||!C.props.rules.length)&&!(g&&!C.isFieldDirty())){var P=C.getNamePath();if(d.add(P.join(u)),!l||HC(s,P,p)){var v=C.validateRules(qt({validateMessages:qt(qt({},XVe),n.validateMessages)},a));c.push(v.then(function(){return{name:P,errors:[],warnings:[]}}).catch(function(T){var A,x=[],S=[];return(A=T.forEach)===null||A===void 0||A.call(T,function(R){var M=R.rule.warningOnly,D=R.errors;M?S.push.apply(S,Lo(D)):x.push.apply(x,Lo(D))}),x.length?Promise.reject({name:P,errors:x,warnings:S}):{name:P,errors:x,warnings:S}}))}}});var y=BMt(c);n.lastValidatePromise=y,y.catch(function(C){return C}).then(function(C){var P=C.map(function(v){var T=v.name;return T});n.notifyObservers(n.store,P,{type:"validateFinish"}),n.triggerOnFieldsChange(P,C)});var w=y.then(function(){return n.lastValidatePromise===y?Promise.resolve(n.getFieldsValue(s)):Promise.reject([])}).catch(function(C){var P=C.filter(function(v){return v&&v.errors.length});return Promise.reject({values:n.getFieldsValue(s),errorFields:P,outOfDate:n.lastValidatePromise!==y})});w.catch(function(C){return C});var b=s.filter(function(C){return d.has(C.join(u))});return n.triggerOnFieldsChange(b),w}),Vt(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(o){var r=n.callbacks.onFinish;if(r)try{r(o)}catch(i){console.error(i)}}).catch(function(o){var r=n.callbacks.onFinishFailed;r&&r(o)})}),this.forceRootUpdate=e});function ZVe(t){var e=m.useRef(),n=m.useState({}),o=ln(n,2),r=o[1];if(!e.current)if(t)e.current=t;else{var i=function(){r({})},a=new OMt(i);e.current=a.getForm()}return[e.current]}var V0e=m.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),_Mt=function(e){var n=e.validateMessages,o=e.onFormChange,r=e.onFormFinish,i=e.children,a=m.useContext(V0e),l=m.useRef({});return m.createElement(V0e.Provider,{value:qt(qt({},a),{},{validateMessages:qt(qt({},a.validateMessages),n),triggerFormChange:function(c,u){o&&o(c,{changedFields:u,forms:l.current}),a.triggerFormChange(c,u)},triggerFormFinish:function(c,u){r&&r(c,{values:u,forms:l.current}),a.triggerFormFinish(c,u)},registerForm:function(c,u){c&&(l.current=qt(qt({},l.current),{},Vt({},c,u))),a.registerForm(c,u)},unregisterForm:function(c){var u=qt({},l.current);delete u[c],l.current=u,a.unregisterForm(c)}})},i)},VMt=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],GMt=function(e,n){var o=e.name,r=e.initialValues,i=e.fields,a=e.form,l=e.preserve,s=e.children,c=e.component,u=c===void 0?"form":c,d=e.validateMessages,f=e.validateTrigger,p=f===void 0?"onChange":f,g=e.onValuesChange,y=e.onFieldsChange,w=e.onFinish,b=e.onFinishFailed,C=ii(e,VMt),P=m.useContext(V0e),v=ZVe(a),T=ln(v,1),A=T[0],x=A.getInternalHooks(Wv),S=x.useSubscribe,R=x.setInitialValues,M=x.setCallbacks,D=x.setValidateMessages,E=x.setPreserve,W=x.destroyForm;m.useImperativeHandle(n,function(){return A}),m.useEffect(function(){return P.registerForm(o,A),function(){P.unregisterForm(o)}},[P,A,o]),D(qt(qt({},P.validateMessages),d)),M({onValuesChange:g,onFieldsChange:function(_){if(P.triggerFormChange(o,_),y){for(var X=arguments.length,$=new Array(X>1?X-1:0),Q=1;Q{let{children:e,status:n,override:o}=t;const r=m.useContext(r1),i=m.useMemo(()=>{const a=Object.assign({},r);return o&&delete a.isFormItemInput,n&&(delete a.status,delete a.hasFeedback,delete a.feedbackIcon),a},[n,o,r]);return m.createElement(r1.Provider,{value:i},e)},KMt=m.createContext(void 0);function cve(){}const qMt=m.createContext({add:cve,remove:cve});function eGe(t){const e=m.useContext(qMt),n=m.useRef();return q6(r=>{if(r){const i=t?r.querySelector(t):r;e.add(i),n.current=i}else e.remove(n.current)})}const uve=()=>{const{cancelButtonProps:t,cancelTextLocale:e,onCancel:n}=m.useContext(LW);return be.createElement(lo,Object.assign({onClick:n},t),e)},dve=()=>{const{confirmLoading:t,okButtonProps:e,okType:n,okTextLocale:o,onOk:r}=m.useContext(LW);return be.createElement(lo,Object.assign({},HVe(n),{loading:t,onClick:r},e),o)};function tGe(t,e){return be.createElement("span",{className:`${t}-close-x`},e||be.createElement(Lw,{className:`${t}-close-icon`}))}const nGe=t=>{const{okText:e,okType:n="primary",cancelText:o,confirmLoading:r,onOk:i,onCancel:a,okButtonProps:l,cancelButtonProps:s,footer:c}=t,[u]=kw("Modal",g_e()),d=e||(u==null?void 0:u.okText),f=o||(u==null?void 0:u.cancelText),p={confirmLoading:r,okButtonProps:l,cancelButtonProps:s,okTextLocale:d,cancelTextLocale:f,okType:n,onOk:i,onCancel:a},g=be.useMemo(()=>p,Za(Object.values(p)));let y;return typeof c=="function"||typeof c>"u"?(y=be.createElement(be.Fragment,null,be.createElement(uve,null),be.createElement(dve,null)),typeof c=="function"&&(y=c(y,{OkBtn:dve,CancelBtn:uve})),y=be.createElement(kVe,{value:g},y)):y=c,be.createElement(T_e,{disabled:!1},y)},Hme=t=>({[t.componentCls]:{[`${t.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${t.motionDurationMid} ${t.motionEaseInOut}, opacity ${t.motionDurationMid} ${t.motionEaseInOut} !important`}},[`${t.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${t.motionDurationMid} ${t.motionEaseInOut}, opacity ${t.motionDurationMid} ${t.motionEaseInOut} !important`}}}),$Mt=t=>({animationDuration:t,animationFillMode:"both"}),QMt=t=>({animationDuration:t,animationFillMode:"both"}),N$=function(t,e,n,o){const i=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[` ${i}${t}-enter, @@ -4495,17 +4495,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `]:{opacity:0,animationTimingFunction:t.motionEaseOutCirc},[`${o}-leave`]:{animationTimingFunction:t.motionEaseInOutCirc}}]},U$=new xa("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),j$=new xa("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),B$=new xa("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),Y$=new xa("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),dIt=new xa("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),fIt=new xa("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),hIt=new xa("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),pIt=new xa("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),gIt={"slide-up":{inKeyframes:U$,outKeyframes:j$},"slide-down":{inKeyframes:B$,outKeyframes:Y$},"slide-left":{inKeyframes:dIt,outKeyframes:fIt},"slide-right":{inKeyframes:hIt,outKeyframes:pIt}},O9=(t,e)=>{const{antCls:n}=t,o=`${n}-${e}`,{inKeyframes:r,outKeyframes:i}=gIt[e];return[N$(o,r,i,t.motionDurationMid),{[` ${o}-enter, ${o}-appear - `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:t.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${o}-leave`]:{animationTimingFunction:t.motionEaseInQuint}}]},mIt=new xa("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),yIt=new xa("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),dve=new xa("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),fve=new xa("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),AIt=new xa("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),wIt=new xa("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),vIt=new xa("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),xIt=new xa("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),bIt=new xa("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),SIt=new xa("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),TIt=new xa("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),PIt=new xa("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}}),CIt={zoom:{inKeyframes:mIt,outKeyframes:yIt},"zoom-big":{inKeyframes:dve,outKeyframes:fve},"zoom-big-fast":{inKeyframes:dve,outKeyframes:fve},"zoom-left":{inKeyframes:vIt,outKeyframes:xIt},"zoom-right":{inKeyframes:bIt,outKeyframes:SIt},"zoom-up":{inKeyframes:AIt,outKeyframes:wIt},"zoom-down":{inKeyframes:TIt,outKeyframes:PIt}},UW=(t,e)=>{const{antCls:n}=t,o=`${n}-${e}`,{inKeyframes:r,outKeyframes:i}=CIt[e];return[N$(o,r,i,e==="zoom-big-fast"?t.motionDurationFast:t.motionDurationMid),{[` + `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:t.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${o}-leave`]:{animationTimingFunction:t.motionEaseInQuint}}]},mIt=new xa("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),yIt=new xa("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),fve=new xa("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),hve=new xa("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),AIt=new xa("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),wIt=new xa("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),vIt=new xa("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),xIt=new xa("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),bIt=new xa("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),SIt=new xa("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),TIt=new xa("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),PIt=new xa("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}}),CIt={zoom:{inKeyframes:mIt,outKeyframes:yIt},"zoom-big":{inKeyframes:fve,outKeyframes:hve},"zoom-big-fast":{inKeyframes:fve,outKeyframes:hve},"zoom-left":{inKeyframes:vIt,outKeyframes:xIt},"zoom-right":{inKeyframes:bIt,outKeyframes:SIt},"zoom-up":{inKeyframes:AIt,outKeyframes:wIt},"zoom-down":{inKeyframes:TIt,outKeyframes:PIt}},jW=(t,e)=>{const{antCls:n}=t,o=`${n}-${e}`,{inKeyframes:r,outKeyframes:i}=CIt[e];return[N$(o,r,i,e==="zoom-big-fast"?t.motionDurationFast:t.motionDurationMid),{[` ${o}-enter, ${o}-appear - `]:{transform:"scale(0)",opacity:0,animationTimingFunction:t.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${o}-leave`]:{animationTimingFunction:t.motionEaseInOutCirc}}]};function hve(t){return{position:t,inset:0}}const RIt=t=>{const{componentCls:e,antCls:n}=t;return[{[`${e}-root`]:{[`${e}${n}-zoom-enter, ${e}${n}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:t.motionDurationSlow,userSelect:"none"},[`${e}${n}-zoom-leave ${e}-content`]:{pointerEvents:"none"},[`${e}-mask`]:Object.assign(Object.assign({},hve("fixed")),{zIndex:t.zIndexPopupBase,height:"100%",backgroundColor:t.colorBgMask,pointerEvents:"none",[`${e}-hidden`]:{display:"none"}}),[`${e}-wrap`]:Object.assign(Object.assign({},hve("fixed")),{zIndex:t.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"})}},{[`${e}-root`]:tIt(t)}]},HIt=t=>{const{componentCls:e}=t;return[{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl"},[`${e}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[e]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${t.screenSMMax}px)`]:{[e]:{maxWidth:"calc(100vw - 16px)",margin:`${Nt(t.marginXS)} auto`},[`${e}-centered`]:{[e]:{flex:1}}}}},{[e]:Object.assign(Object.assign({},ja(t)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${Nt(t.calc(t.margin).mul(2).equal())})`,margin:"0 auto",paddingBottom:t.paddingLG,[`${e}-title`]:{margin:0,color:t.titleColor,fontWeight:t.fontWeightStrong,fontSize:t.titleFontSize,lineHeight:t.titleLineHeight,wordWrap:"break-word"},[`${e}-content`]:{position:"relative",backgroundColor:t.contentBg,backgroundClip:"padding-box",border:0,borderRadius:t.borderRadiusLG,boxShadow:t.boxShadow,pointerEvents:"auto",padding:t.contentPadding},[`${e}-close`]:Object.assign({position:"absolute",top:t.calc(t.modalHeaderHeight).sub(t.modalCloseBtnSize).div(2).equal(),insetInlineEnd:t.calc(t.modalHeaderHeight).sub(t.modalCloseBtnSize).div(2).equal(),zIndex:t.calc(t.zIndexPopupBase).add(10).equal(),padding:0,color:t.modalCloseIconColor,fontWeight:t.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:t.borderRadiusSM,width:t.modalCloseBtnSize,height:t.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:`color ${t.motionDurationMid}, background-color ${t.motionDurationMid}`,"&-x":{display:"flex",fontSize:t.fontSizeLG,fontStyle:"normal",lineHeight:`${Nt(t.modalCloseBtnSize)}`,justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:hover":{color:t.modalCloseIconHoverColor,backgroundColor:t.colorBgTextHover,textDecoration:"none"},"&:active":{backgroundColor:t.colorBgTextActive}},Q6(t)),[`${e}-header`]:{color:t.colorText,background:t.headerBg,borderRadius:`${Nt(t.borderRadiusLG)} ${Nt(t.borderRadiusLG)} 0 0`,marginBottom:t.headerMarginBottom,padding:t.headerPadding,borderBottom:t.headerBorderBottom},[`${e}-body`]:{fontSize:t.fontSize,lineHeight:t.lineHeight,wordWrap:"break-word",padding:t.bodyPadding},[`${e}-footer`]:{textAlign:"end",background:t.footerBg,marginTop:t.footerMarginTop,padding:t.footerPadding,borderTop:t.footerBorderTop,borderRadius:t.footerBorderRadius,[`> ${t.antCls}-btn + ${t.antCls}-btn`]:{marginInlineStart:t.marginXS}},[`${e}-open`]:{overflow:"hidden"}})},{[`${e}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${e}-content, + `]:{transform:"scale(0)",opacity:0,animationTimingFunction:t.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${o}-leave`]:{animationTimingFunction:t.motionEaseInOutCirc}}]};function pve(t){return{position:t,inset:0}}const RIt=t=>{const{componentCls:e,antCls:n}=t;return[{[`${e}-root`]:{[`${e}${n}-zoom-enter, ${e}${n}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:t.motionDurationSlow,userSelect:"none"},[`${e}${n}-zoom-leave ${e}-content`]:{pointerEvents:"none"},[`${e}-mask`]:Object.assign(Object.assign({},pve("fixed")),{zIndex:t.zIndexPopupBase,height:"100%",backgroundColor:t.colorBgMask,pointerEvents:"none",[`${e}-hidden`]:{display:"none"}}),[`${e}-wrap`]:Object.assign(Object.assign({},pve("fixed")),{zIndex:t.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"})}},{[`${e}-root`]:tIt(t)}]},HIt=t=>{const{componentCls:e}=t;return[{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl"},[`${e}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[e]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${t.screenSMMax}px)`]:{[e]:{maxWidth:"calc(100vw - 16px)",margin:`${Nt(t.marginXS)} auto`},[`${e}-centered`]:{[e]:{flex:1}}}}},{[e]:Object.assign(Object.assign({},ja(t)),{pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${Nt(t.calc(t.margin).mul(2).equal())})`,margin:"0 auto",paddingBottom:t.paddingLG,[`${e}-title`]:{margin:0,color:t.titleColor,fontWeight:t.fontWeightStrong,fontSize:t.titleFontSize,lineHeight:t.titleLineHeight,wordWrap:"break-word"},[`${e}-content`]:{position:"relative",backgroundColor:t.contentBg,backgroundClip:"padding-box",border:0,borderRadius:t.borderRadiusLG,boxShadow:t.boxShadow,pointerEvents:"auto",padding:t.contentPadding},[`${e}-close`]:Object.assign({position:"absolute",top:t.calc(t.modalHeaderHeight).sub(t.modalCloseBtnSize).div(2).equal(),insetInlineEnd:t.calc(t.modalHeaderHeight).sub(t.modalCloseBtnSize).div(2).equal(),zIndex:t.calc(t.zIndexPopupBase).add(10).equal(),padding:0,color:t.modalCloseIconColor,fontWeight:t.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:t.borderRadiusSM,width:t.modalCloseBtnSize,height:t.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:`color ${t.motionDurationMid}, background-color ${t.motionDurationMid}`,"&-x":{display:"flex",fontSize:t.fontSizeLG,fontStyle:"normal",lineHeight:`${Nt(t.modalCloseBtnSize)}`,justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:hover":{color:t.modalCloseIconHoverColor,backgroundColor:t.colorBgTextHover,textDecoration:"none"},"&:active":{backgroundColor:t.colorBgTextActive}},Q6(t)),[`${e}-header`]:{color:t.colorText,background:t.headerBg,borderRadius:`${Nt(t.borderRadiusLG)} ${Nt(t.borderRadiusLG)} 0 0`,marginBottom:t.headerMarginBottom,padding:t.headerPadding,borderBottom:t.headerBorderBottom},[`${e}-body`]:{fontSize:t.fontSize,lineHeight:t.lineHeight,wordWrap:"break-word",padding:t.bodyPadding},[`${e}-footer`]:{textAlign:"end",background:t.footerBg,marginTop:t.footerMarginTop,padding:t.footerPadding,borderTop:t.footerBorderTop,borderRadius:t.footerBorderRadius,[`> ${t.antCls}-btn + ${t.antCls}-btn`]:{marginInlineStart:t.marginXS}},[`${e}-open`]:{overflow:"hidden"}})},{[`${e}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${e}-content, ${e}-body, - ${e}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${e}-confirm-body`]:{marginBottom:"auto"}}}]},MIt=t=>{const{componentCls:e}=t;return{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl",[`${e}-confirm-body`]:{direction:"rtl"}}}}},oGe=t=>{const e=t.padding,n=t.fontSizeHeading5,o=t.lineHeightHeading5;return Ki(t,{modalHeaderHeight:t.calc(t.calc(o).mul(n).equal()).add(t.calc(e).mul(2).equal()).equal(),modalFooterBorderColorSplit:t.colorSplit,modalFooterBorderStyle:t.lineType,modalFooterBorderWidth:t.lineWidth,modalCloseIconColor:t.colorIcon,modalCloseIconHoverColor:t.colorIconHover,modalCloseBtnSize:t.controlHeight,modalConfirmIconSize:t.fontHeight,modalTitleHeight:t.calc(t.titleFontSize).mul(t.titleLineHeight).equal()})},rGe=t=>({footerBg:"transparent",headerBg:t.colorBgElevated,titleLineHeight:t.lineHeightHeading5,titleFontSize:t.fontSizeHeading5,contentBg:t.colorBgElevated,titleColor:t.colorTextHeading,contentPadding:t.wireframe?0:`${Nt(t.paddingMD)} ${Nt(t.paddingContentHorizontalLG)}`,headerPadding:t.wireframe?`${Nt(t.padding)} ${Nt(t.paddingLG)}`:0,headerBorderBottom:t.wireframe?`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`:"none",headerMarginBottom:t.wireframe?0:t.marginXS,bodyPadding:t.wireframe?t.paddingLG:0,footerPadding:t.wireframe?`${Nt(t.paddingXS)} ${Nt(t.padding)}`:0,footerBorderTop:t.wireframe?`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`:"none",footerBorderRadius:t.wireframe?`0 0 ${Nt(t.borderRadiusLG)} ${Nt(t.borderRadiusLG)}`:0,footerMarginTop:t.wireframe?0:t.marginSM,confirmBodyPadding:t.wireframe?`${Nt(t.padding*2)} ${Nt(t.padding*2)} ${Nt(t.paddingLG)}`:0,confirmIconMarginInlineEnd:t.wireframe?t.margin:t.marginSM,confirmBtnsMarginTop:t.wireframe?t.marginLG:t.marginSM}),iGe=wl("Modal",t=>{const e=oGe(t);return[HIt(e),MIt(e),RIt(e),UW(e,"zoom")]},rGe,{unitless:{titleLineHeight:!0}});var IIt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{G0e={x:t.pageX,y:t.pageY},setTimeout(()=>{G0e=null},100)};OHt()&&document.documentElement.addEventListener("click",zIt,!0);const aGe=t=>{var e;const{getPopupContainer:n,getPrefixCls:o,direction:r,modal:i}=m.useContext(Cr),a=O=>{const{onCancel:B}=t;B==null||B(O)},l=O=>{const{onOk:B}=t;B==null||B(O)},{prefixCls:s,className:c,rootClassName:u,open:d,wrapClassName:f,centered:p,getContainer:g,focusTriggerAfterClose:y=!0,style:w,visible:b,width:C=520,footer:P,classNames:v,styles:T}=t,A=IIt(t,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","focusTriggerAfterClose","style","visible","width","footer","classNames","styles"]),x=o("modal",s),S=o(),R=O0(x),[M,D,E]=iGe(x,R),W=Un(f,{[`${x}-centered`]:!!p,[`${x}-wrap-rtl`]:r==="rtl"}),j=P!==null&&m.createElement(nGe,Object.assign({},t,{onOk:l,onCancel:a})),[L,k]=Tme(mR(t),mR(i),{closable:!0,closeIcon:m.createElement(Lw,{className:`${x}-close-icon`}),closeIconRender:O=>tGe(x,O)}),N=eGe(`.${x}-content`),[F,U]=Ww("Modal",A.zIndex);return M(m.createElement(Y9,null,m.createElement(AR,{status:!0,override:!0},m.createElement(zW.Provider,{value:U},m.createElement(BVe,Object.assign({width:C},A,{zIndex:F,getContainer:g===void 0?n:g,prefixCls:x,rootClassName:Un(D,u,E,R),footer:j,visible:d??b,mousePosition:(e=A.mousePosition)!==null&&e!==void 0?e:G0e,onClose:a,closable:L,closeIcon:k,focusTriggerAfterClose:y,transitionName:j9(S,"zoom",t.transitionName),maskTransitionName:j9(S,"fade",t.maskTransitionName),className:Un(D,c,i==null?void 0:i.className),style:Object.assign(Object.assign({},i==null?void 0:i.style),w),classNames:Object.assign(Object.assign(Object.assign({},i==null?void 0:i.classNames),v),{wrapper:Un(W,v==null?void 0:v.wrapper)}),styles:Object.assign(Object.assign({},i==null?void 0:i.styles),T),panelRef:N}))))))},DIt=t=>{const{componentCls:e,titleFontSize:n,titleLineHeight:o,modalConfirmIconSize:r,fontSize:i,lineHeight:a,modalTitleHeight:l,fontHeight:s,confirmBodyPadding:c}=t,u=`${e}-confirm`;return{[u]:{"&-rtl":{direction:"rtl"},[`${t.antCls}-modal-header`]:{display:"none"},[`${u}-body-wrapper`]:Object.assign({},ek()),[`&${e} ${e}-body`]:{padding:c},[`${u}-body`]:{display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${t.iconCls}`]:{flex:"none",fontSize:r,marginInlineEnd:t.confirmIconMarginInlineEnd,marginTop:t.calc(t.calc(s).sub(r).equal()).div(2).equal()},[`&-has-title > ${t.iconCls}`]:{marginTop:t.calc(t.calc(l).sub(r).equal()).div(2).equal()}},[`${u}-paragraph`]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:t.marginXS},[`${t.iconCls} + ${u}-paragraph`]:{maxWidth:`calc(100% - ${Nt(t.calc(t.modalConfirmIconSize).add(t.marginSM).equal())})`},[`${u}-title`]:{color:t.colorTextHeading,fontWeight:t.fontWeightStrong,fontSize:n,lineHeight:o},[`${u}-content`]:{color:t.colorText,fontSize:i,lineHeight:a},[`${u}-btns`]:{textAlign:"end",marginTop:t.confirmBtnsMarginTop,[`${t.antCls}-btn + ${t.antCls}-btn`]:{marginBottom:0,marginInlineStart:t.marginXS}}},[`${u}-error ${u}-body > ${t.iconCls}`]:{color:t.colorError},[`${u}-warning ${u}-body > ${t.iconCls}, - ${u}-confirm ${u}-body > ${t.iconCls}`]:{color:t.colorWarning},[`${u}-info ${u}-body > ${t.iconCls}`]:{color:t.colorInfo},[`${u}-success ${u}-body > ${t.iconCls}`]:{color:t.colorSuccess}}},EIt=IW(["Modal","confirm"],t=>{const e=oGe(t);return[DIt(e)]},rGe,{order:-1e3});var FIt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);rC,Za(Object.values(C))),v=m.createElement(m.Fragment,null,m.createElement(F7e,null),m.createElement(k7e,null)),T=t.title!==void 0&&t.title!==null,A=`${i}-body`;return m.createElement("div",{className:`${i}-body-wrapper`},m.createElement("div",{className:Un(A,{[`${A}-has-title`]:T})},d,m.createElement("div",{className:`${i}-paragraph`},T&&m.createElement("span",{className:`${i}-title`},t.title),m.createElement("div",{className:`${i}-content`},t.content))),s===void 0||typeof s=="function"?m.createElement(kVe,{value:P},m.createElement("div",{className:`${i}-btns`},typeof s=="function"?s(v,{OkBtn:k7e,CancelBtn:F7e}):v)):s,m.createElement(EIt,{prefixCls:e}))}const kIt=t=>{const{close:e,zIndex:n,afterClose:o,open:r,keyboard:i,centered:a,getContainer:l,maskStyle:s,direction:c,prefixCls:u,wrapClassName:d,rootPrefixCls:f,bodyStyle:p,closable:g=!1,closeIcon:y,modalRender:w,focusTriggerAfterClose:b,onConfirm:C,styles:P}=t,v=`${u}-confirm`,T=t.width||416,A=t.style||{},x=t.mask===void 0?!0:t.mask,S=t.maskClosable===void 0?!1:t.maskClosable,R=Un(v,`${v}-${t.type}`,{[`${v}-rtl`]:c==="rtl"},t.className),[,M]=_u(),D=m.useMemo(()=>n!==void 0?n:M.zIndexPopupBase+Ame,[n,M]);return m.createElement(aGe,{prefixCls:u,className:R,wrapClassName:Un({[`${v}-centered`]:!!t.centered},d),onCancel:()=>{e==null||e({triggerCancel:!0}),C==null||C(!1)},open:r,title:"",footer:null,transitionName:j9(f||"","zoom",t.transitionName),maskTransitionName:j9(f||"","fade",t.maskTransitionName),mask:x,maskClosable:S,style:A,styles:Object.assign({body:p,mask:s},P),width:T,zIndex:D,afterClose:o,keyboard:i,centered:a,getContainer:l,closable:g,closeIcon:y,modalRender:w,focusTriggerAfterClose:b},m.createElement(lGe,Object.assign({},t,{confirmPrefixCls:v})))},sGe=t=>{const{rootPrefixCls:e,iconPrefixCls:n,direction:o,theme:r}=t;return m.createElement(fy,{prefixCls:e,iconPrefixCls:n,direction:o,theme:r},m.createElement(kIt,Object.assign({},t)))},Nv=[];let cGe="";function uGe(){return cGe}const LIt=t=>{var e,n;const{prefixCls:o,getContainer:r,direction:i}=t,a=g_e(),l=m.useContext(Cr),s=uGe()||l.getPrefixCls(),c=o||`${s}-modal`;let u=r;return u===!1&&(u=void 0),be.createElement(sGe,Object.assign({},t,{rootPrefixCls:s,prefixCls:c,iconPrefixCls:l.iconPrefixCls,theme:l.theme,direction:i??l.direction,locale:(n=(e=l.locale)===null||e===void 0?void 0:e.Modal)!==null&&n!==void 0?n:a,getContainer:u}))};function jW(t){const e=rVe(),n=document.createDocumentFragment();let o=Object.assign(Object.assign({},t),{close:l,open:!0}),r;function i(){for(var c=arguments.length,u=new Array(c),d=0;dp&&p.triggerCancel);t.onCancel&&f&&t.onCancel.apply(t,[()=>{}].concat(Za(u.slice(1))));for(let p=0;p{const u=e.getPrefixCls(void 0,uGe()),d=e.getIconPrefixCls(),f=e.getTheme(),p=be.createElement(LIt,Object.assign({},c));vme(be.createElement(fy,{prefixCls:u,iconPrefixCls:d,theme:f},e.holderRender?e.holderRender(p):p),n)})}function l(){for(var c=arguments.length,u=new Array(c),d=0;d{typeof t.afterClose=="function"&&t.afterClose(),i.apply(this,u)}}),o.visible&&delete o.visible,a(o)}function s(c){typeof c=="function"?o=c(o):o=Object.assign(Object.assign({},o),c),a(o)}return a(o),Nv.push(l),{destroy:l,update:s}}function dGe(t){return Object.assign(Object.assign({},t),{type:"warning"})}function fGe(t){return Object.assign(Object.assign({},t),{type:"info"})}function hGe(t){return Object.assign(Object.assign({},t),{type:"success"})}function pGe(t){return Object.assign(Object.assign({},t),{type:"error"})}function gGe(t){return Object.assign(Object.assign({},t),{type:"confirm"})}function WIt(t){let{rootPrefixCls:e}=t;cGe=e}var NIt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n,{afterClose:o,config:r}=t,i=NIt(t,["afterClose","config"]);const[a,l]=m.useState(!0),[s,c]=m.useState(r),{direction:u,getPrefixCls:d}=m.useContext(Cr),f=d("modal"),p=d(),g=()=>{var C;o(),(C=s.afterClose)===null||C===void 0||C.call(s)},y=function(){l(!1);for(var C=arguments.length,P=new Array(C),v=0;vA&&A.triggerCancel);s.onCancel&&T&&s.onCancel.apply(s,[()=>{}].concat(Za(P.slice(1))))};m.useImperativeHandle(e,()=>({destroy:y,update:C=>{c(P=>Object.assign(Object.assign({},P),C))}}));const w=(n=s.okCancel)!==null&&n!==void 0?n:s.type==="confirm",[b]=kw("Modal",aw.Modal);return m.createElement(sGe,Object.assign({prefixCls:f,rootPrefixCls:p},s,{close:y,open:a,afterClose:g,okText:s.okText||(w?b==null?void 0:b.okText:b==null?void 0:b.justOkText),direction:s.direction||u,cancelText:s.cancelText||(b==null?void 0:b.cancelText)},i))},jIt=m.forwardRef(UIt);let pve=0;const BIt=m.memo(m.forwardRef((t,e)=>{const[n,o]=MRt();return m.useImperativeHandle(e,()=>({patchElement:o}),[]),m.createElement(m.Fragment,null,n)}));function YIt(){const t=m.useRef(null),[e,n]=m.useState([]);m.useEffect(()=>{e.length&&(Za(e).forEach(a=>{a()}),n([]))},[e]);const o=m.useCallback(i=>function(l){var s;pve+=1;const c=m.createRef();let u;const d=new Promise(w=>{u=w});let f=!1,p;const g=m.createElement(jIt,{key:`modal-${pve}`,config:i(l),ref:c,afterClose:()=>{p==null||p()},isSilent:()=>f,onConfirm:w=>{u(w)}});return p=(s=t.current)===null||s===void 0?void 0:s.patchElement(g),p&&Nv.push(p),{destroy:()=>{function w(){var b;(b=c.current)===null||b===void 0||b.destroy()}c.current?w():n(b=>[].concat(Za(b),[w]))},update:w=>{function b(){var C;(C=c.current)===null||C===void 0||C.update(w)}c.current?b():n(C=>[].concat(Za(C),[b]))},then:w=>(f=!0,d.then(w))}},[]);return[m.useMemo(()=>({info:o(fGe),success:o(hGe),error:o(pGe),warning:o(dGe),confirm:o(gGe)}),[]),m.createElement(BIt,{key:"modal-holder",ref:t})]}const OIt=be.createContext({});function mGe(t){return e=>m.createElement(fy,{theme:{token:{motion:!1,zIndexPopupBase:0}}},m.createElement(t,Object.assign({},e)))}const BW=(t,e,n,o)=>mGe(i=>{const{prefixCls:a,style:l}=i,s=m.useRef(null),[c,u]=m.useState(0),[d,f]=m.useState(0),[p,g]=$6(!1,{value:i.open}),{getPrefixCls:y}=m.useContext(Cr),w=y(e||"select",a);m.useEffect(()=>{if(g(!0),typeof ResizeObserver<"u"){const P=new ResizeObserver(T=>{const A=T[0].target;u(A.offsetHeight+8),f(A.offsetWidth)}),v=setInterval(()=>{var T;const A=n?`.${n(w)}`:`.${w}-dropdown`,x=(T=s.current)===null||T===void 0?void 0:T.querySelector(A);x&&(clearInterval(v),P.observe(x))},10);return()=>{clearInterval(v),P.disconnect()}}},[]);let b=Object.assign(Object.assign({},i),{style:Object.assign(Object.assign({},l),{margin:0}),open:p,visible:p,getPopupContainer:()=>s.current});o&&(b=o(b));const C={paddingBottom:c,position:"relative",minWidth:d};return m.createElement("div",{ref:s,style:C},m.createElement(t,Object.assign({},b)))});function Ea(t){var e=m.useRef();e.current=t;var n=m.useCallback(function(){for(var o,r=arguments.length,i=new Array(r),a=0;a"u"||typeof window>"u")return!1;var t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(t==null?void 0:t.substr(0,4))};var _$=function(e){var n=e.className,o=e.customizeIcon,r=e.customizeIconProps,i=e.children,a=e.onMouseDown,l=e.onClick,s=typeof o=="function"?o(r):o;return m.createElement("span",{className:n,onMouseDown:function(u){u.preventDefault(),a==null||a(u)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:l,"aria-hidden":!0},s!==void 0?s:m.createElement("span",{className:Vn(n.split(/\s+/).map(function(c){return"".concat(c,"-icon")}))},i))},_It=function(e,n,o,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,l=arguments.length>6?arguments[6]:void 0,s=arguments.length>7?arguments[7]:void 0,c=be.useMemo(function(){if(hi(r)==="object")return r.clearIcon;if(i)return i},[r,i]),u=be.useMemo(function(){return!!(!a&&r&&(o.length||l)&&!(s==="combobox"&&l===""))},[r,a,o.length,l,s]);return{allowClear:u,clearIcon:be.createElement(_$,{className:"".concat(e,"-clear"),onMouseDown:n,customizeIcon:c},"×")}},yGe=m.createContext(null);function VIt(){return m.useContext(yGe)}function GIt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=m.useState(!1),n=ln(e,2),o=n[0],r=n[1],i=m.useRef(null),a=function(){window.clearTimeout(i.current)};m.useEffect(function(){return a},[]);var l=function(c,u){a(),i.current=window.setTimeout(function(){r(c),u&&u()},t)};return[o,l,a]}function AGe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=m.useRef(null),n=m.useRef(null);m.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]);function o(r){(r||e.current===null)&&(e.current=r),window.clearTimeout(n.current),n.current=window.setTimeout(function(){e.current=null},t)}return[function(){return e.current},o]}function XIt(t,e,n,o){var r=m.useRef(null);r.current={open:e,triggerOpen:n,customizedTrigger:o},m.useEffect(function(){function i(a){var l;if(!((l=r.current)!==null&&l!==void 0&&l.customizedTrigger)){var s=a.target;s.shadowRoot&&a.composed&&(s=a.composedPath()[0]||s),r.current.open&&t().filter(function(c){return c}).every(function(c){return!c.contains(s)&&c!==s})&&r.current.triggerOpen(!1)}}return window.addEventListener("mousedown",i),function(){return window.removeEventListener("mousedown",i)}},[])}function JIt(t){return![Bn.ESC,Bn.SHIFT,Bn.BACKSPACE,Bn.TAB,Bn.WIN_KEY,Bn.ALT,Bn.META,Bn.WIN_KEY_RIGHT,Bn.CTRL,Bn.SEMICOLON,Bn.EQUALS,Bn.CAPS_LOCK,Bn.CONTEXT_MENU,Bn.F1,Bn.F2,Bn.F3,Bn.F4,Bn.F5,Bn.F6,Bn.F7,Bn.F8,Bn.F9,Bn.F10,Bn.F11,Bn.F12].includes(t)}var KIt=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],MT=void 0;function qIt(t,e){var n=t.prefixCls,o=t.invalidate,r=t.item,i=t.renderItem,a=t.responsive,l=t.responsiveDisabled,s=t.registerSize,c=t.itemKey,u=t.className,d=t.style,f=t.children,p=t.display,g=t.order,y=t.component,w=y===void 0?"div":y,b=ii(t,KIt),C=a&&!p;function P(S){s(c,S)}m.useEffect(function(){return function(){P(null)}},[]);var v=i&&r!==MT?i(r):f,T;o||(T={opacity:C?0:1,height:C?0:MT,overflowY:C?"hidden":MT,order:a?g:MT,pointerEvents:C?"none":MT,position:C?"absolute":MT});var A={};C&&(A["aria-hidden"]=!0);var x=m.createElement(w,ho({className:Vn(!o&&n,u),style:qt(qt({},T),d)},A,b,{ref:e}),v);return a&&(x=m.createElement(Td,{onResize:function(R){var M=R.offsetWidth;P(M)},disabled:l},x)),x}var xE=m.forwardRef(qIt);xE.displayName="Item";function $It(t){if(typeof MessageChannel>"u")Fa(t);else{var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(void 0)}}function QIt(){var t=m.useRef(null),e=function(o){t.current||(t.current=[],$It(function(){Cd.unstable_batchedUpdates(function(){t.current.forEach(function(r){r()}),t.current=null})})),t.current.push(o)};return e}function Dz(t,e){var n=m.useState(e),o=ln(n,2),r=o[0],i=o[1],a=Ea(function(l){t(function(){i(l)})});return[r,a]}var kG=be.createContext(null),ZIt=["component"],ezt=["className"],tzt=["className"],nzt=function(e,n){var o=m.useContext(kG);if(!o){var r=e.component,i=r===void 0?"div":r,a=ii(e,ZIt);return m.createElement(i,ho({},a,{ref:n}))}var l=o.className,s=ii(o,ezt),c=e.className,u=ii(e,tzt);return m.createElement(kG.Provider,{value:null},m.createElement(xE,ho({ref:n,className:Vn(l,c)},s,u)))},wGe=m.forwardRef(nzt);wGe.displayName="RawItem";var ozt=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],vGe="responsive",xGe="invalidate";function rzt(t){return"+ ".concat(t.length," ...")}function izt(t,e){var n=t.prefixCls,o=n===void 0?"rc-overflow":n,r=t.data,i=r===void 0?[]:r,a=t.renderItem,l=t.renderRawItem,s=t.itemKey,c=t.itemWidth,u=c===void 0?10:c,d=t.ssr,f=t.style,p=t.className,g=t.maxCount,y=t.renderRest,w=t.renderRawRest,b=t.suffix,C=t.component,P=C===void 0?"div":C,v=t.itemComponent,T=t.onVisibleChange,A=ii(t,ozt),x=d==="full",S=QIt(),R=Dz(S,null),M=ln(R,2),D=M[0],E=M[1],W=D||0,j=Dz(S,new Map),L=ln(j,2),k=L[0],N=L[1],F=Dz(S,0),U=ln(F,2),O=U[0],B=U[1],_=Dz(S,0),X=ln(_,2),$=X[0],Q=X[1],le=Dz(S,0),q=ln(le,2),te=q[0],re=q[1],ae=m.useState(null),se=ln(ae,2),ne=se[0],fe=se[1],ge=m.useState(null),de=ln(ge,2),Z=de[0],he=de[1],xe=m.useMemo(function(){return Z===null&&x?Number.MAX_SAFE_INTEGER:Z||0},[Z,D]),He=m.useState(!1),Se=ln(He,2),ze=Se[0],Ie=Se[1],ye="".concat(o,"-item"),ce=Math.max(O,$),pe=g===vGe,ve=i.length&&pe,Ae=g===xGe,Te=ve||typeof g=="number"&&i.length>g,Me=m.useMemo(function(){var ot=i;return ve?D===null&&x?ot=i:ot=i.slice(0,Math.min(i.length,W/u)):typeof g=="number"&&(ot=i.slice(0,g)),ot},[i,u,D,g,ve]),Pe=m.useMemo(function(){return ve?i.slice(xe+1):i.slice(Me.length)},[i,Me,ve,xe]),Ee=m.useCallback(function(ot,st){var at;return typeof s=="function"?s(ot):(at=s&&(ot==null?void 0:ot[s]))!==null&&at!==void 0?at:st},[s]),Be=m.useCallback(a||function(ot){return ot},[a]);function Je(ot,st,at){Z===ot&&(st===void 0||st===ne)||(he(ot),at||(Ie(otW){Je(Oe-1,ot-Ze-te+$);break}}b&&ke(0)+te>W&&fe(null)}},[W,k,$,te,Ee,Me]);var Ye=ze&&!!Pe.length,it={};ne!==null&&ve&&(it={position:"absolute",left:ne,top:0});var Ve={prefixCls:ye,responsive:ve,component:v,invalidate:Ae},yt=l?function(ot,st){var at=Ee(ot,st);return m.createElement(kG.Provider,{key:at,value:qt(qt({},Ve),{},{order:st,item:ot,itemKey:at,registerSize:Ke,display:st<=xe})},l(ot,st))}:function(ot,st){var at=Ee(ot,st);return m.createElement(xE,ho({},Ve,{order:st,key:at,item:ot,renderItem:Be,itemKey:at,registerSize:Ke,display:st<=xe}))},ct,Xe={order:Ye?xe:Number.MAX_SAFE_INTEGER,className:"".concat(ye,"-rest"),registerSize:Ne,display:Ye};if(w)w&&(ct=m.createElement(kG.Provider,{value:qt(qt({},Ve),Xe)},w(Pe)));else{var ut=y||rzt;ct=m.createElement(xE,ho({},Ve,Xe),typeof ut=="function"?ut(Pe):ut)}var ft=m.createElement(P,ho({className:Vn(!Ae&&o,p),style:f,ref:e},A),Me.map(yt),Te?ct:null,b&&m.createElement(xE,ho({},Ve,{responsive:pe,responsiveDisabled:!ve,order:xe,className:"".concat(ye,"-suffix"),registerSize:De,display:!0,style:it}),b));return pe&&(ft=m.createElement(Td,{onResize:We,disabled:!ve},ft)),ft}var k2=m.forwardRef(izt);k2.displayName="Overflow";k2.Item=wGe;k2.RESPONSIVE=vGe;k2.INVALIDATE=xGe;var azt=function(e,n){var o,r=e.prefixCls,i=e.id,a=e.inputElement,l=e.disabled,s=e.tabIndex,c=e.autoFocus,u=e.autoComplete,d=e.editable,f=e.activeDescendantId,p=e.value,g=e.maxLength,y=e.onKeyDown,w=e.onMouseDown,b=e.onChange,C=e.onPaste,P=e.onCompositionStart,v=e.onCompositionEnd,T=e.open,A=e.attrs,x=a||m.createElement("input",null),S=x,R=S.ref,M=S.props,D=M.onKeyDown,E=M.onChange,W=M.onMouseDown,j=M.onCompositionStart,L=M.onCompositionEnd,k=M.style;return"maxLength"in x.props,x=m.cloneElement(x,qt(qt(qt({type:"search"},M),{},{id:i,ref:Fb(n,R),disabled:l,tabIndex:s,autoComplete:u||"off",autoFocus:c,className:Vn("".concat(r,"-selection-search-input"),(o=x)===null||o===void 0||(o=o.props)===null||o===void 0?void 0:o.className),role:"combobox","aria-expanded":T||!1,"aria-haspopup":"listbox","aria-owns":"".concat(i,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(i,"_list"),"aria-activedescendant":T?f:void 0},A),{},{value:d?p:"",maxLength:g,readOnly:!d,unselectable:d?null:"on",style:qt(qt({},k),{},{opacity:d?null:0}),onKeyDown:function(F){y(F),D&&D(F)},onMouseDown:function(F){w(F),W&&W(F)},onChange:function(F){b(F),E&&E(F)},onCompositionStart:function(F){P(F),j&&j(F)},onCompositionEnd:function(F){v(F),L&&L(F)},onPaste:C})),x},bGe=m.forwardRef(azt);function SGe(t){return Array.isArray(t)?t:t!==void 0?[t]:[]}var lzt=typeof window<"u"&&window.document&&window.document.documentElement,szt=lzt;function czt(t){return t!=null}function uzt(t){return!t&&t!==0}function gve(t){return["string","number"].includes(hi(t))}function TGe(t){var e=void 0;return t&&(gve(t.title)?e=t.title.toString():gve(t.label)&&(e=t.label.toString())),e}function dzt(t,e){szt?m.useLayoutEffect(t,e):m.useEffect(t,e)}function fzt(t){var e;return(e=t.key)!==null&&e!==void 0?e:t.value}var mve=function(e){e.preventDefault(),e.stopPropagation()},hzt=function(e){var n=e.id,o=e.prefixCls,r=e.values,i=e.open,a=e.searchValue,l=e.autoClearSearchValue,s=e.inputRef,c=e.placeholder,u=e.disabled,d=e.mode,f=e.showSearch,p=e.autoFocus,g=e.autoComplete,y=e.activeDescendantId,w=e.tabIndex,b=e.removeIcon,C=e.maxTagCount,P=e.maxTagTextLength,v=e.maxTagPlaceholder,T=v===void 0?function(fe){return"+ ".concat(fe.length," ...")}:v,A=e.tagRender,x=e.onToggleOpen,S=e.onRemove,R=e.onInputChange,M=e.onInputPaste,D=e.onInputKeyDown,E=e.onInputMouseDown,W=e.onInputCompositionStart,j=e.onInputCompositionEnd,L=m.useRef(null),k=m.useState(0),N=ln(k,2),F=N[0],U=N[1],O=m.useState(!1),B=ln(O,2),_=B[0],X=B[1],$="".concat(o,"-selection"),Q=i||d==="multiple"&&l===!1||d==="tags"?a:"",le=d==="tags"||d==="multiple"&&l===!1||f&&(i||_);dzt(function(){U(L.current.scrollWidth)},[Q]);var q=function(ge,de,Z,he,xe){return m.createElement("span",{title:TGe(ge),className:Vn("".concat($,"-item"),Vt({},"".concat($,"-item-disabled"),Z))},m.createElement("span",{className:"".concat($,"-item-content")},de),he&&m.createElement(_$,{className:"".concat($,"-item-remove"),onMouseDown:mve,onClick:xe,customizeIcon:b},"×"))},te=function(ge,de,Z,he,xe,He){var Se=function(Ie){mve(Ie),x(!i)};return m.createElement("span",{onMouseDown:Se},A({label:de,value:ge,disabled:Z,closable:he,onClose:xe,isMaxTag:!!He}))},re=function(ge){var de=ge.disabled,Z=ge.label,he=ge.value,xe=!u&&!de,He=Z;if(typeof P=="number"&&(typeof Z=="string"||typeof Z=="number")){var Se=String(He);Se.length>P&&(He="".concat(Se.slice(0,P),"..."))}var ze=function(ye){ye&&ye.stopPropagation(),S(ge)};return typeof A=="function"?te(he,He,de,xe,ze):q(ge,He,de,xe,ze)},ae=function(ge){var de=typeof T=="function"?T(ge):T;return typeof A=="function"?te(void 0,de,!1,!1,void 0,!0):q({title:de},de,!1)},se=m.createElement("div",{className:"".concat($,"-search"),style:{width:F},onFocus:function(){X(!0)},onBlur:function(){X(!1)}},m.createElement(bGe,{ref:s,open:i,prefixCls:o,id:n,inputElement:null,disabled:u,autoFocus:p,autoComplete:g,editable:le,activeDescendantId:y,value:Q,onKeyDown:D,onMouseDown:E,onChange:R,onPaste:M,onCompositionStart:W,onCompositionEnd:j,tabIndex:w,attrs:Sf(e,!0)}),m.createElement("span",{ref:L,className:"".concat($,"-search-mirror"),"aria-hidden":!0},Q," ")),ne=m.createElement(k2,{prefixCls:"".concat($,"-overflow"),data:r,renderItem:re,renderRest:ae,suffix:se,itemKey:fzt,maxCount:C});return m.createElement(m.Fragment,null,ne,!r.length&&!Q&&m.createElement("span",{className:"".concat($,"-placeholder")},c))},pzt=function(e){var n=e.inputElement,o=e.prefixCls,r=e.id,i=e.inputRef,a=e.disabled,l=e.autoFocus,s=e.autoComplete,c=e.activeDescendantId,u=e.mode,d=e.open,f=e.values,p=e.placeholder,g=e.tabIndex,y=e.showSearch,w=e.searchValue,b=e.activeValue,C=e.maxLength,P=e.onInputKeyDown,v=e.onInputMouseDown,T=e.onInputChange,A=e.onInputPaste,x=e.onInputCompositionStart,S=e.onInputCompositionEnd,R=e.title,M=m.useState(!1),D=ln(M,2),E=D[0],W=D[1],j=u==="combobox",L=j||y,k=f[0],N=w||"";j&&b&&!E&&(N=b),m.useEffect(function(){j&&W(!1)},[j,b]);var F=u!=="combobox"&&!d&&!y?!1:!!N,U=R===void 0?TGe(k):R,O=m.useMemo(function(){return k?null:m.createElement("span",{className:"".concat(o,"-selection-placeholder"),style:F?{visibility:"hidden"}:void 0},p)},[k,F,p,o]);return m.createElement(m.Fragment,null,m.createElement("span",{className:"".concat(o,"-selection-search")},m.createElement(bGe,{ref:i,prefixCls:o,id:r,open:d,inputElement:n,disabled:a,autoFocus:l,autoComplete:s,editable:L,activeDescendantId:c,value:N,onKeyDown:P,onMouseDown:v,onChange:function(_){W(!0),T(_)},onPaste:A,onCompositionStart:x,onCompositionEnd:S,tabIndex:g,attrs:Sf(e,!0),maxLength:j?C:void 0})),!j&&k?m.createElement("span",{className:"".concat(o,"-selection-item"),title:U,style:F?{visibility:"hidden"}:void 0},k.label):null,O)},gzt=function(e,n){var o=m.useRef(null),r=m.useRef(!1),i=e.prefixCls,a=e.open,l=e.mode,s=e.showSearch,c=e.tokenWithEnter,u=e.disabled,d=e.autoClearSearchValue,f=e.onSearch,p=e.onSearchSubmit,g=e.onToggleOpen,y=e.onInputKeyDown,w=e.domRef;m.useImperativeHandle(n,function(){return{focus:function(F){o.current.focus(F)},blur:function(){o.current.blur()}}});var b=AGe(0),C=ln(b,2),P=C[0],v=C[1],T=function(F){var U=F.which;(U===Bn.UP||U===Bn.DOWN)&&F.preventDefault(),y&&y(F),U===Bn.ENTER&&l==="tags"&&!r.current&&!a&&(p==null||p(F.target.value)),JIt(U)&&g(!0)},A=function(){v(!0)},x=m.useRef(null),S=function(F){f(F,!0,r.current)!==!1&&g(!0)},R=function(){r.current=!0},M=function(F){r.current=!1,l!=="combobox"&&S(F.target.value)},D=function(F){var U=F.target.value;if(c&&x.current&&/[\r\n]/.test(x.current)){var O=x.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");U=U.replace(O,x.current)}x.current=null,S(U)},E=function(F){var U=F.clipboardData,O=U==null?void 0:U.getData("text");x.current=O||""},W=function(F){var U=F.target;if(U!==o.current){var O=document.body.style.msTouchAction!==void 0;O?setTimeout(function(){o.current.focus()}):o.current.focus()}},j=function(F){var U=P();F.target!==o.current&&!U&&!(l==="combobox"&&u)&&F.preventDefault(),(l!=="combobox"&&(!s||!U)||!a)&&(a&&d!==!1&&f("",!0,!1),g())},L={inputRef:o,onInputKeyDown:T,onInputMouseDown:A,onInputChange:D,onInputPaste:E,onInputCompositionStart:R,onInputCompositionEnd:M},k=l==="multiple"||l==="tags"?m.createElement(hzt,ho({},e,L)):m.createElement(pzt,ho({},e,L));return m.createElement("div",{ref:w,className:"".concat(i,"-selector"),onClick:W,onMouseDown:j},k)},mzt=m.forwardRef(gzt);function ik(t){"@babel/helpers - typeof";return ik=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},ik(t)}function yzt(t,e){if(ik(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(ik(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Azt(t){var e=yzt(t,"string");return ik(e)==="symbol"?e:String(e)}function wzt(t,e,n){return e=Azt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yve(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function ep(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&(n[r]=t[r]);return n}function Tzt(t,e){if(t==null)return{};var n=Szt(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function LG(){return LG=Object.assign?Object.assign.bind():function(t){for(var e=1;e0,X=m.useState(!P||!_),$=af(X,2),Q=$[0],le=$[1];if(Xa(function(){!Q&&_&&a&&le(!0)},[Q,_,a]),!Q)return null;var q="auto",te={left:"-1000vw",top:"-1000vh",right:q,bottom:q};if(M||!s){var re,ae=y.points,se=y.dynamicInset||((re=y._experimental)===null||re===void 0?void 0:re.dynamicInset),ne=se&&ae[0][1]==="r",fe=se&&ae[0][0]==="b";ne?(te.right=W,te.left=q):(te.left=D,te.right=q),fe?(te.bottom=j,te.top=q):(te.top=E,te.bottom=q)}var ge={};return N&&(N.includes("height")&&U?ge.height=U:N.includes("minHeight")&&U&&(ge.minHeight=U),N.includes("width")&&F?ge.width=F:N.includes("minWidth")&&F&&(ge.minWidth=F)),s||(ge.pointerEvents="none"),m.createElement(T,{open:C||B,getContainer:P&&function(){return P(a)},autoDestroy:v},m.createElement(Czt,{prefixCls:r,open:s,zIndex:A,mask:f,motion:b}),m.createElement(Td,{onResize:L,disabled:!s},function(de){return m.createElement(o1,LG({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:C,leavedClassName:"".concat(r,"-hidden")},w,{onAppearPrepare:k,onEnterPrepare:k,visible:s,onVisibleChanged:function(he){var xe;w==null||(xe=w.onVisibleChanged)===null||xe===void 0||xe.call(w,he),l(he)}}),function(Z,he){var xe=Z.className,He=Z.style,Se=Vn(r,xe,o);return m.createElement("div",{ref:Fb(de,e,he),className:Se,style:ep(ep(ep(ep({"--arrow-x":"".concat(g.x||0,"px"),"--arrow-y":"".concat(g.y||0,"px")},te),ge),He),{},{boxSizing:"border-box",zIndex:A},i),onMouseEnter:x,onMouseLeave:S,onPointerEnter:R,onClick:d},p&&m.createElement(Pzt,{prefixCls:r,arrow:p,arrowPos:g,align:y}),m.createElement(Rzt,{cache:!s&&!u},O))})}))}),Mzt=m.forwardRef(function(t,e){var n=t.children,o=t.getTriggerDOMNode,r=rw(n),i=m.useCallback(function(l){JF(e,o?o(l):l)},[o]),a=Fw(i,n.ref);return r?m.cloneElement(n,{ref:a}):n}),Ave=m.createContext(null);function wve(t){return t?Array.isArray(t)?t:[t]:[]}function Izt(t,e,n,o){return m.useMemo(function(){var r=wve(n??e),i=wve(o??e),a=new Set(r),l=new Set(i);return t&&(a.has("hover")&&(a.delete("hover"),a.add("click")),l.has("hover")&&(l.delete("hover"),l.add("click"))),[a,l]},[t,e,n,o])}const V$=function(t){if(!t)return!1;if(t instanceof Element){if(t.offsetParent)return!0;if(t.getBBox){var e=t.getBBox(),n=e.width,o=e.height;if(n||o)return!0}if(t.getBoundingClientRect){var r=t.getBoundingClientRect(),i=r.width,a=r.height;if(i||a)return!0}}return!1};function zzt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?t[0]===e[0]:t[0]===e[0]&&t[1]===e[1]}function Dzt(t,e,n,o){for(var r=n.points,i=Object.keys(t),a=0;a1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(t)?e:t}function Ez(t){return ak(parseFloat(t),0)}function xve(t,e){var n=ep({},t);return(e||[]).forEach(function(o){if(!(o instanceof HTMLBodyElement||o instanceof HTMLHtmlElement)){var r=YW(o).getComputedStyle(o),i=r.overflow,a=r.overflowClipMargin,l=r.borderTopWidth,s=r.borderBottomWidth,c=r.borderLeftWidth,u=r.borderRightWidth,d=o.getBoundingClientRect(),f=o.offsetHeight,p=o.clientHeight,g=o.offsetWidth,y=o.clientWidth,w=Ez(l),b=Ez(s),C=Ez(c),P=Ez(u),v=ak(Math.round(d.width/g*1e3)/1e3),T=ak(Math.round(d.height/f*1e3)/1e3),A=(g-y-C-P)*v,x=(f-p-w-b)*T,S=w*T,R=b*T,M=C*v,D=P*v,E=0,W=0;if(i==="clip"){var j=Ez(a);E=j*v,W=j*T}var L=d.x+M-E,k=d.y+S-W,N=L+d.width+2*E-M-D-A,F=k+d.height+2*W-S-R-x;n.left=Math.max(n.left,L),n.top=Math.max(n.top,k),n.right=Math.min(n.right,N),n.bottom=Math.min(n.bottom,F)}}),n}function bve(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n="".concat(e),o=n.match(/^(.*)\%$/);return o?t*(parseFloat(o[1])/100):parseFloat(n)}function Sve(t,e){var n=e||[],o=af(n,2),r=o[0],i=o[1];return[bve(t.width,r),bve(t.height,i)]}function Tve(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[t[0],t[1]]}function IT(t,e){var n=e[0],o=e[1],r,i;return n==="t"?i=t.y:n==="b"?i=t.y+t.height:i=t.y+t.height/2,o==="l"?r=t.x:o==="r"?r=t.x+t.width:r=t.x+t.width/2,{x:r,y:i}}function T4(t,e){var n={t:"b",b:"t",l:"r",r:"l"};return t.map(function(o,r){return r===e?n[o]||"c":o}).join("")}function Ezt(t,e,n,o,r,i,a){var l=m.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:r[o]||{}}),s=af(l,2),c=s[0],u=s[1],d=m.useRef(0),f=m.useMemo(function(){return e?J0e(e):[]},[e]),p=m.useRef({}),g=function(){p.current={}};t||g();var y=Ea(function(){if(e&&n&&t){let xo=function(jo,lr){var fr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Se,ai=O.x+jo,hr=O.y+lr,tr=ai+re,xi=hr+te,Eo=Math.max(ai,fr.left),bi=Math.max(hr,fr.top),hl=Math.min(tr,fr.right),nr=Math.min(xi,fr.bottom);return Math.max(0,(hl-Eo)*(nr-bi))},Qo=function(){kt=O.y+ut,gt=kt+te,dt=O.x+Xe,Ct=dt+re};var Xn=xo,Jo=Qo,C,P,v=e,T=v.ownerDocument,A=YW(v),x=A.getComputedStyle(v),S=x.width,R=x.height,M=x.position,D=v.style.left,E=v.style.top,W=v.style.right,j=v.style.bottom,L=v.style.overflow,k=ep(ep({},r[o]),i),N=T.createElement("div");(C=v.parentElement)===null||C===void 0||C.appendChild(N),N.style.left="".concat(v.offsetLeft,"px"),N.style.top="".concat(v.offsetTop,"px"),N.style.position=M,N.style.height="".concat(v.offsetHeight,"px"),N.style.width="".concat(v.offsetWidth,"px"),v.style.left="0",v.style.top="0",v.style.right="auto",v.style.bottom="auto",v.style.overflow="hidden";var F;if(Array.isArray(n))F={x:n[0],y:n[1],width:0,height:0};else{var U=n.getBoundingClientRect();F={x:U.x,y:U.y,width:U.width,height:U.height}}var O=v.getBoundingClientRect(),B=T.documentElement,_=B.clientWidth,X=B.clientHeight,$=B.scrollWidth,Q=B.scrollHeight,le=B.scrollTop,q=B.scrollLeft,te=O.height,re=O.width,ae=F.height,se=F.width,ne={left:0,top:0,right:_,bottom:X},fe={left:-q,top:-le,right:$-q,bottom:Q-le},ge=k.htmlRegion,de="visible",Z="visibleFirst";ge!=="scroll"&&ge!==Z&&(ge=de);var he=ge===Z,xe=xve(fe,f),He=xve(ne,f),Se=ge===de?He:xe,ze=he?He:Se;v.style.left="auto",v.style.top="auto",v.style.right="0",v.style.bottom="0";var Ie=v.getBoundingClientRect();v.style.left=D,v.style.top=E,v.style.right=W,v.style.bottom=j,v.style.overflow=L,(P=v.parentElement)===null||P===void 0||P.removeChild(N);var ye=ak(Math.round(re/parseFloat(S)*1e3)/1e3),ce=ak(Math.round(te/parseFloat(R)*1e3)/1e3);if(ye===0||ce===0||vG(n)&&!V$(n))return;var pe=k.offset,ve=k.targetOffset,Ae=Sve(O,pe),Te=af(Ae,2),Me=Te[0],Pe=Te[1],Ee=Sve(F,ve),Be=af(Ee,2),Je=Be[0],We=Be[1];F.x-=Je,F.y-=We;var Ke=k.points||[],Ne=af(Ke,2),De=Ne[0],ke=Ne[1],Ye=Tve(ke),it=Tve(De),Ve=IT(F,Ye),yt=IT(O,it),ct=ep({},k),Xe=Ve.x-yt.x+Me,ut=Ve.y-yt.y+Pe,ft=xo(Xe,ut),ot=xo(Xe,ut,He),st=IT(F,["t","l"]),at=IT(O,["t","l"]),Oe=IT(F,["b","r"]),Ze=IT(O,["b","r"]),St=k.overflow||{},Pt=St.adjustX,Rt=St.adjustY,Ut=St.shiftX,Ht=St.shiftY,At=function(lr){return typeof lr=="boolean"?lr:lr>=0},kt,gt,dt,Ct;Qo();var tt=At(Rt),Fe=it[0]===Ye[0];if(tt&&it[0]==="t"&&(gt>ze.bottom||p.current.bt)){var qe=ut;Fe?qe-=te-ae:qe=st.y-Ze.y-Pe;var je=xo(Xe,qe),rt=xo(Xe,qe,He);je>ft||je===ft&&(!he||rt>=ot)?(p.current.bt=!0,ut=qe,Pe=-Pe,ct.points=[T4(it,0),T4(Ye,0)]):p.current.bt=!1}if(tt&&it[0]==="b"&&(ktft||Qe===ft&&(!he||Tt>=ot)?(p.current.tb=!0,ut=mt,Pe=-Pe,ct.points=[T4(it,0),T4(Ye,0)]):p.current.tb=!1}var Dt=At(Pt),lt=it[1]===Ye[1];if(Dt&&it[1]==="l"&&(Ct>ze.right||p.current.rl)){var zt=Xe;lt?zt-=re-se:zt=st.x-Ze.x-Me;var Ft=xo(zt,ut),_t=xo(zt,ut,He);Ft>ft||Ft===ft&&(!he||_t>=ot)?(p.current.rl=!0,Xe=zt,Me=-Me,ct.points=[T4(it,1),T4(Ye,1)]):p.current.rl=!1}if(Dt&&it[1]==="r"&&(dtft||Qt===ft&&(!he||gn>=ot)?(p.current.lr=!0,Xe=tn,Me=-Me,ct.points=[T4(it,1),T4(Ye,1)]):p.current.lr=!1}Qo();var an=Ut===!0?0:Ut;typeof an=="number"&&(dtHe.right&&(Xe-=Ct-He.right-Me,F.x>He.right-an&&(Xe+=F.x-He.right+an)));var mn=Ht===!0?0:Ht;typeof mn=="number"&&(ktHe.bottom&&(ut-=gt-He.bottom-Pe,F.y>He.bottom-mn&&(ut+=F.y-He.bottom+mn)));var Hn=O.x+Xe,Fo=Hn+re,yo=O.y+ut,So=yo+te,$o=F.x,mo=$o+se,Jn=F.y,uo=Jn+ae,ir=Math.max(Hn,$o),Rr=Math.min(Fo,mo),br=(ir+Rr)/2,Vr=br-Hn,Wo=Math.max(yo,Jn),wn=Math.min(So,uo),In=(Wo+wn)/2,ar=In-yo;a==null||a(e,ct);var No=Ie.right-O.x-(Xe+O.width),eo=Ie.bottom-O.y-(ut+O.height);u({ready:!0,offsetX:Xe/ye,offsetY:ut/ce,offsetR:No/ye,offsetB:eo/ce,arrowX:Vr/ye,arrowY:ar/ce,scaleX:ye,scaleY:ce,align:ct})}}),w=function(){d.current+=1;var P=d.current;Promise.resolve().then(function(){d.current===P&&y()})},b=function(){u(function(P){return ep(ep({},P),{},{ready:!1})})};return Xa(b,[o]),Xa(function(){t||b()},[t]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,w]}function Fzt(t){if(Array.isArray(t))return X0e(t)}function kzt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Lzt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pve(t){return Fzt(t)||kzt(t)||PGe(t)||Lzt()}function Wzt(t,e,n,o,r){Xa(function(){if(t&&e&&n){let f=function(){o(),r()};var d=f,i=e,a=n,l=J0e(i),s=J0e(a),c=YW(a),u=new Set([c].concat(Pve(l),Pve(s)));return u.forEach(function(p){p.addEventListener("scroll",f,{passive:!0})}),c.addEventListener("resize",f,{passive:!0}),o(),function(){u.forEach(function(p){p.removeEventListener("scroll",f),c.removeEventListener("resize",f)})}}},[t,e,n])}function Nzt(t,e,n,o,r,i,a,l){var s=m.useRef(t);s.current=t,m.useEffect(function(){if(e&&o&&(!r||i)){var c=function(p){var g=p.target;s.current&&!a(g)&&l(!1)},u=YW(o);u.addEventListener("mousedown",c,!0),u.addEventListener("contextmenu",c,!0);var d=zG(n);return d&&(d.addEventListener("mousedown",c,!0),d.addEventListener("contextmenu",c,!0)),function(){u.removeEventListener("mousedown",c,!0),u.removeEventListener("contextmenu",c,!0),d&&(d.removeEventListener("mousedown",c,!0),d.removeEventListener("contextmenu",c,!0))}}},[e,n,o,r,i])}var Uzt=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function jzt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W$,e=m.forwardRef(function(n,o){var r=n.prefixCls,i=r===void 0?"rc-trigger-popup":r,a=n.children,l=n.action,s=l===void 0?"hover":l,c=n.showAction,u=n.hideAction,d=n.popupVisible,f=n.defaultPopupVisible,p=n.onPopupVisibleChange,g=n.afterPopupVisibleChange,y=n.mouseEnterDelay,w=n.mouseLeaveDelay,b=w===void 0?.1:w,C=n.focusDelay,P=n.blurDelay,v=n.mask,T=n.maskClosable,A=T===void 0?!0:T,x=n.getPopupContainer,S=n.forceRender,R=n.autoDestroy,M=n.destroyPopupOnHide,D=n.popup,E=n.popupClassName,W=n.popupStyle,j=n.popupPlacement,L=n.builtinPlacements,k=L===void 0?{}:L,N=n.popupAlign,F=n.zIndex,U=n.stretch,O=n.getPopupClassNameFromAlign,B=n.fresh,_=n.alignPoint,X=n.onPopupClick,$=n.onPopupAlign,Q=n.arrow,le=n.popupMotion,q=n.maskMotion,te=n.popupTransitionName,re=n.popupAnimation,ae=n.maskTransitionName,se=n.maskAnimation,ne=n.className,fe=n.getTriggerDOMNode,ge=Tzt(n,Uzt),de=R||M||!1,Z=m.useState(!1),he=af(Z,2),xe=he[0],He=he[1];Xa(function(){He(O$())},[]);var Se=m.useRef({}),ze=m.useContext(Ave),Ie=m.useMemo(function(){return{registerSubPopup:function(or,Ai){Se.current[or]=Ai,ze==null||ze.registerSubPopup(or,Ai)}}},[ze]),ye=NVe(),ce=m.useState(null),pe=af(ce,2),ve=pe[0],Ae=pe[1],Te=m.useRef(null),Me=Ea(function(nr){Te.current=nr,vG(nr)&&ve!==nr&&Ae(nr),ze==null||ze.registerSubPopup(ye,nr)}),Pe=m.useState(null),Ee=af(Pe,2),Be=Ee[0],Je=Ee[1],We=m.useRef(null),Ke=Ea(function(nr){vG(nr)&&Be!==nr&&(Je(nr),We.current=nr)}),Ne=m.Children.only(a),De=(Ne==null?void 0:Ne.props)||{},ke={},Ye=Ea(function(nr){var or,Ai,ka=Be;return(ka==null?void 0:ka.contains(nr))||((or=zG(ka))===null||or===void 0?void 0:or.host)===nr||nr===ka||(ve==null?void 0:ve.contains(nr))||((Ai=zG(ve))===null||Ai===void 0?void 0:Ai.host)===nr||nr===ve||Object.values(Se.current).some(function(wi){return(wi==null?void 0:wi.contains(nr))||nr===wi})}),it=vve(i,le,re,te),Ve=vve(i,q,se,ae),yt=m.useState(f||!1),ct=af(yt,2),Xe=ct[0],ut=ct[1],ft=d??Xe,ot=Ea(function(nr){d===void 0&&ut(nr)});Xa(function(){ut(d||!1)},[d]);var st=m.useRef(ft);st.current=ft;var at=m.useRef([]);at.current=[];var Oe=Ea(function(nr){var or;ot(nr),((or=at.current[at.current.length-1])!==null&&or!==void 0?or:ft)!==nr&&(at.current.push(nr),p==null||p(nr))}),Ze=m.useRef(),St=function(){clearTimeout(Ze.current)},Pt=function(or){var Ai=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;St(),Ai===0?Oe(or):Ze.current=setTimeout(function(){Oe(or)},Ai*1e3)};m.useEffect(function(){return St},[]);var Rt=m.useState(!1),Ut=af(Rt,2),Ht=Ut[0],At=Ut[1];Xa(function(nr){(!nr||ft)&&At(!0)},[ft]);var kt=m.useState(null),gt=af(kt,2),dt=gt[0],Ct=gt[1],tt=m.useState([0,0]),Fe=af(tt,2),qe=Fe[0],je=Fe[1],rt=function(or){je([or.clientX,or.clientY])},mt=Ezt(ft,ve,_?qe:Be,j,k,N,$),Qe=af(mt,11),Tt=Qe[0],Dt=Qe[1],lt=Qe[2],zt=Qe[3],Ft=Qe[4],_t=Qe[5],tn=Qe[6],Qt=Qe[7],gn=Qe[8],an=Qe[9],mn=Qe[10],Hn=Izt(xe,s,c,u),Fo=af(Hn,2),yo=Fo[0],So=Fo[1],$o=yo.has("click"),mo=So.has("click")||So.has("contextMenu"),Jn=Ea(function(){Ht||mn()}),uo=function(){st.current&&_&&mo&&Pt(!1)};Wzt(ft,Be,ve,Jn,uo),Xa(function(){Jn()},[qe,j]),Xa(function(){ft&&!(k!=null&&k[j])&&Jn()},[JSON.stringify(N)]);var ir=m.useMemo(function(){var nr=Dzt(k,i,an,_);return Vn(nr,O==null?void 0:O(an))},[an,O,k,i,_]);m.useImperativeHandle(o,function(){return{nativeElement:We.current,popupElement:Te.current,forceAlign:Jn}});var Rr=m.useState(0),br=af(Rr,2),Vr=br[0],Wo=br[1],wn=m.useState(0),In=af(wn,2),ar=In[0],No=In[1],eo=function(){if(U&&Be){var or=Be.getBoundingClientRect();Wo(or.width),No(or.height)}},Xn=function(){eo(),Jn()},Jo=function(or){At(!1),mn(),g==null||g(or)},xo=function(){return new Promise(function(or){eo(),Ct(function(){return or})})};Xa(function(){dt&&(mn(),dt(),Ct(null))},[dt]);function Qo(nr,or,Ai,ka){ke[nr]=function(wi){var Fs;ka==null||ka(wi),Pt(or,Ai);for(var ks=arguments.length,Zs=new Array(ks>1?ks-1:0),Ui=1;Ui1?Ai-1:0),wi=1;wi1?Ai-1:0),wi=1;wi1&&arguments[1]!==void 0?arguments[1]:{},n=e.fieldNames,o=e.childrenAsData,r=[],i=CGe(n,!1),a=i.label,l=i.value,s=i.options,c=i.groupLabel;function u(d,f){Array.isArray(d)&&d.forEach(function(p){if(f||!(s in p)){var g=p[l];r.push({key:Cve(p,r.length),groupOption:f,data:p,label:p[a],value:g})}else{var y=p[c];y===void 0&&o&&(y=p.label),r.push({key:Cve(p,r.length),group:!0,data:p,label:y}),u(p[s],!0)}})}return u(t,!1),r}function q0e(t){var e=qt({},t);return"props"in e||Object.defineProperty(e,"props",{get:function(){return j0(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}var Gzt=function(e,n,o){if(!n||!n.length)return null;var r=!1,i=function l(s,c){var u=JVe(c),d=u[0],f=u.slice(1);if(!d)return[s];var p=s.split(d);return r=r||p.length>1,p.reduce(function(g,y){return[].concat(Lo(g),Lo(l(y,f)))},[]).filter(Boolean)},a=i(e,n);return r?typeof o<"u"?a.slice(0,o):a:null},Hme=m.createContext(null),Xzt=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Jzt=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],$0e=function(e){return e==="tags"||e==="multiple"},Kzt=m.forwardRef(function(t,e){var n,o=t.id,r=t.prefixCls,i=t.className,a=t.showSearch,l=t.tagRender,s=t.direction,c=t.omitDomProps,u=t.displayValues,d=t.onDisplayValuesChange,f=t.emptyOptions,p=t.notFoundContent,g=p===void 0?"Not Found":p,y=t.onClear,w=t.mode,b=t.disabled,C=t.loading,P=t.getInputElement,v=t.getRawInputElement,T=t.open,A=t.defaultOpen,x=t.onDropdownVisibleChange,S=t.activeValue,R=t.onActiveValueChange,M=t.activeDescendantId,D=t.searchValue,E=t.autoClearSearchValue,W=t.onSearch,j=t.onSearchSplit,L=t.tokenSeparators,k=t.allowClear,N=t.suffixIcon,F=t.clearIcon,U=t.OptionList,O=t.animation,B=t.transitionName,_=t.dropdownStyle,X=t.dropdownClassName,$=t.dropdownMatchSelectWidth,Q=t.dropdownRender,le=t.dropdownAlign,q=t.placement,te=t.builtinPlacements,re=t.getPopupContainer,ae=t.showAction,se=ae===void 0?[]:ae,ne=t.onFocus,fe=t.onBlur,ge=t.onKeyUp,de=t.onKeyDown,Z=t.onMouseDown,he=ii(t,Xzt),xe=$0e(w),He=(a!==void 0?a:xe)||w==="combobox",Se=qt({},he);Jzt.forEach(function(Jn){delete Se[Jn]}),c==null||c.forEach(function(Jn){delete Se[Jn]});var ze=m.useState(!1),Ie=ln(ze,2),ye=Ie[0],ce=Ie[1];m.useEffect(function(){ce(O$())},[]);var pe=m.useRef(null),ve=m.useRef(null),Ae=m.useRef(null),Te=m.useRef(null),Me=m.useRef(null),Pe=m.useRef(!1),Ee=GIt(),Be=ln(Ee,3),Je=Be[0],We=Be[1],Ke=Be[2];m.useImperativeHandle(e,function(){var Jn,uo;return{focus:(Jn=Te.current)===null||Jn===void 0?void 0:Jn.focus,blur:(uo=Te.current)===null||uo===void 0?void 0:uo.blur,scrollTo:function(Rr){var br;return(br=Me.current)===null||br===void 0?void 0:br.scrollTo(Rr)}}});var Ne=m.useMemo(function(){var Jn;if(w!=="combobox")return D;var uo=(Jn=u[0])===null||Jn===void 0?void 0:Jn.value;return typeof uo=="string"||typeof uo=="number"?String(uo):""},[D,w,u]),De=w==="combobox"&&typeof P=="function"&&P()||null,ke=typeof v=="function"&&v(),Ye=Fw(ve,ke==null||(n=ke.props)===null||n===void 0?void 0:n.ref),it=m.useState(!1),Ve=ln(it,2),yt=Ve[0],ct=Ve[1];Xa(function(){ct(!0)},[]);var Xe=zs(!1,{defaultValue:A,value:T}),ut=ln(Xe,2),ft=ut[0],ot=ut[1],st=yt?ft:!1,at=!g&&f;(b||at&&st&&w==="combobox")&&(st=!1);var Oe=at?!1:st,Ze=m.useCallback(function(Jn){var uo=Jn!==void 0?Jn:!st;b||(ot(uo),st!==uo&&(x==null||x(uo)))},[b,st,ot,x]),St=m.useMemo(function(){return(L||[]).some(function(Jn){return[` + ${e}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${e}-confirm-body`]:{marginBottom:"auto"}}}]},MIt=t=>{const{componentCls:e}=t;return{[`${e}-root`]:{[`${e}-wrap-rtl`]:{direction:"rtl",[`${e}-confirm-body`]:{direction:"rtl"}}}}},oGe=t=>{const e=t.padding,n=t.fontSizeHeading5,o=t.lineHeightHeading5;return Ki(t,{modalHeaderHeight:t.calc(t.calc(o).mul(n).equal()).add(t.calc(e).mul(2).equal()).equal(),modalFooterBorderColorSplit:t.colorSplit,modalFooterBorderStyle:t.lineType,modalFooterBorderWidth:t.lineWidth,modalCloseIconColor:t.colorIcon,modalCloseIconHoverColor:t.colorIconHover,modalCloseBtnSize:t.controlHeight,modalConfirmIconSize:t.fontHeight,modalTitleHeight:t.calc(t.titleFontSize).mul(t.titleLineHeight).equal()})},rGe=t=>({footerBg:"transparent",headerBg:t.colorBgElevated,titleLineHeight:t.lineHeightHeading5,titleFontSize:t.fontSizeHeading5,contentBg:t.colorBgElevated,titleColor:t.colorTextHeading,contentPadding:t.wireframe?0:`${Nt(t.paddingMD)} ${Nt(t.paddingContentHorizontalLG)}`,headerPadding:t.wireframe?`${Nt(t.padding)} ${Nt(t.paddingLG)}`:0,headerBorderBottom:t.wireframe?`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`:"none",headerMarginBottom:t.wireframe?0:t.marginXS,bodyPadding:t.wireframe?t.paddingLG:0,footerPadding:t.wireframe?`${Nt(t.paddingXS)} ${Nt(t.padding)}`:0,footerBorderTop:t.wireframe?`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`:"none",footerBorderRadius:t.wireframe?`0 0 ${Nt(t.borderRadiusLG)} ${Nt(t.borderRadiusLG)}`:0,footerMarginTop:t.wireframe?0:t.marginSM,confirmBodyPadding:t.wireframe?`${Nt(t.padding*2)} ${Nt(t.padding*2)} ${Nt(t.paddingLG)}`:0,confirmIconMarginInlineEnd:t.wireframe?t.margin:t.marginSM,confirmBtnsMarginTop:t.wireframe?t.marginLG:t.marginSM}),iGe=wl("Modal",t=>{const e=oGe(t);return[HIt(e),MIt(e),RIt(e),jW(e,"zoom")]},rGe,{unitless:{titleLineHeight:!0}});var IIt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{G0e={x:t.pageX,y:t.pageY},setTimeout(()=>{G0e=null},100)};OHt()&&document.documentElement.addEventListener("click",zIt,!0);const aGe=t=>{var e;const{getPopupContainer:n,getPrefixCls:o,direction:r,modal:i}=m.useContext(Cr),a=O=>{const{onCancel:B}=t;B==null||B(O)},l=O=>{const{onOk:B}=t;B==null||B(O)},{prefixCls:s,className:c,rootClassName:u,open:d,wrapClassName:f,centered:p,getContainer:g,focusTriggerAfterClose:y=!0,style:w,visible:b,width:C=520,footer:P,classNames:v,styles:T}=t,A=IIt(t,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","focusTriggerAfterClose","style","visible","width","footer","classNames","styles"]),x=o("modal",s),S=o(),R=O0(x),[M,D,E]=iGe(x,R),W=Un(f,{[`${x}-centered`]:!!p,[`${x}-wrap-rtl`]:r==="rtl"}),j=P!==null&&m.createElement(nGe,Object.assign({},t,{onOk:l,onCancel:a})),[L,k]=Pme(mR(t),mR(i),{closable:!0,closeIcon:m.createElement(Lw,{className:`${x}-close-icon`}),closeIconRender:O=>tGe(x,O)}),N=eGe(`.${x}-content`),[F,U]=Ww("Modal",A.zIndex);return M(m.createElement(Y9,null,m.createElement(AR,{status:!0,override:!0},m.createElement(DW.Provider,{value:U},m.createElement(BVe,Object.assign({width:C},A,{zIndex:F,getContainer:g===void 0?n:g,prefixCls:x,rootClassName:Un(D,u,E,R),footer:j,visible:d??b,mousePosition:(e=A.mousePosition)!==null&&e!==void 0?e:G0e,onClose:a,closable:L,closeIcon:k,focusTriggerAfterClose:y,transitionName:j9(S,"zoom",t.transitionName),maskTransitionName:j9(S,"fade",t.maskTransitionName),className:Un(D,c,i==null?void 0:i.className),style:Object.assign(Object.assign({},i==null?void 0:i.style),w),classNames:Object.assign(Object.assign(Object.assign({},i==null?void 0:i.classNames),v),{wrapper:Un(W,v==null?void 0:v.wrapper)}),styles:Object.assign(Object.assign({},i==null?void 0:i.styles),T),panelRef:N}))))))},DIt=t=>{const{componentCls:e,titleFontSize:n,titleLineHeight:o,modalConfirmIconSize:r,fontSize:i,lineHeight:a,modalTitleHeight:l,fontHeight:s,confirmBodyPadding:c}=t,u=`${e}-confirm`;return{[u]:{"&-rtl":{direction:"rtl"},[`${t.antCls}-modal-header`]:{display:"none"},[`${u}-body-wrapper`]:Object.assign({},ek()),[`&${e} ${e}-body`]:{padding:c},[`${u}-body`]:{display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${t.iconCls}`]:{flex:"none",fontSize:r,marginInlineEnd:t.confirmIconMarginInlineEnd,marginTop:t.calc(t.calc(s).sub(r).equal()).div(2).equal()},[`&-has-title > ${t.iconCls}`]:{marginTop:t.calc(t.calc(l).sub(r).equal()).div(2).equal()}},[`${u}-paragraph`]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:t.marginXS},[`${t.iconCls} + ${u}-paragraph`]:{maxWidth:`calc(100% - ${Nt(t.calc(t.modalConfirmIconSize).add(t.marginSM).equal())})`},[`${u}-title`]:{color:t.colorTextHeading,fontWeight:t.fontWeightStrong,fontSize:n,lineHeight:o},[`${u}-content`]:{color:t.colorText,fontSize:i,lineHeight:a},[`${u}-btns`]:{textAlign:"end",marginTop:t.confirmBtnsMarginTop,[`${t.antCls}-btn + ${t.antCls}-btn`]:{marginBottom:0,marginInlineStart:t.marginXS}}},[`${u}-error ${u}-body > ${t.iconCls}`]:{color:t.colorError},[`${u}-warning ${u}-body > ${t.iconCls}, + ${u}-confirm ${u}-body > ${t.iconCls}`]:{color:t.colorWarning},[`${u}-info ${u}-body > ${t.iconCls}`]:{color:t.colorInfo},[`${u}-success ${u}-body > ${t.iconCls}`]:{color:t.colorSuccess}}},EIt=zW(["Modal","confirm"],t=>{const e=oGe(t);return[DIt(e)]},rGe,{order:-1e3});var FIt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);rC,Za(Object.values(C))),v=m.createElement(m.Fragment,null,m.createElement(k7e,null),m.createElement(L7e,null)),T=t.title!==void 0&&t.title!==null,A=`${i}-body`;return m.createElement("div",{className:`${i}-body-wrapper`},m.createElement("div",{className:Un(A,{[`${A}-has-title`]:T})},d,m.createElement("div",{className:`${i}-paragraph`},T&&m.createElement("span",{className:`${i}-title`},t.title),m.createElement("div",{className:`${i}-content`},t.content))),s===void 0||typeof s=="function"?m.createElement(kVe,{value:P},m.createElement("div",{className:`${i}-btns`},typeof s=="function"?s(v,{OkBtn:L7e,CancelBtn:k7e}):v)):s,m.createElement(EIt,{prefixCls:e}))}const kIt=t=>{const{close:e,zIndex:n,afterClose:o,open:r,keyboard:i,centered:a,getContainer:l,maskStyle:s,direction:c,prefixCls:u,wrapClassName:d,rootPrefixCls:f,bodyStyle:p,closable:g=!1,closeIcon:y,modalRender:w,focusTriggerAfterClose:b,onConfirm:C,styles:P}=t,v=`${u}-confirm`,T=t.width||416,A=t.style||{},x=t.mask===void 0?!0:t.mask,S=t.maskClosable===void 0?!1:t.maskClosable,R=Un(v,`${v}-${t.type}`,{[`${v}-rtl`]:c==="rtl"},t.className),[,M]=_u(),D=m.useMemo(()=>n!==void 0?n:M.zIndexPopupBase+wme,[n,M]);return m.createElement(aGe,{prefixCls:u,className:R,wrapClassName:Un({[`${v}-centered`]:!!t.centered},d),onCancel:()=>{e==null||e({triggerCancel:!0}),C==null||C(!1)},open:r,title:"",footer:null,transitionName:j9(f||"","zoom",t.transitionName),maskTransitionName:j9(f||"","fade",t.maskTransitionName),mask:x,maskClosable:S,style:A,styles:Object.assign({body:p,mask:s},P),width:T,zIndex:D,afterClose:o,keyboard:i,centered:a,getContainer:l,closable:g,closeIcon:y,modalRender:w,focusTriggerAfterClose:b},m.createElement(lGe,Object.assign({},t,{confirmPrefixCls:v})))},sGe=t=>{const{rootPrefixCls:e,iconPrefixCls:n,direction:o,theme:r}=t;return m.createElement(fy,{prefixCls:e,iconPrefixCls:n,direction:o,theme:r},m.createElement(kIt,Object.assign({},t)))},Nv=[];let cGe="";function uGe(){return cGe}const LIt=t=>{var e,n;const{prefixCls:o,getContainer:r,direction:i}=t,a=g_e(),l=m.useContext(Cr),s=uGe()||l.getPrefixCls(),c=o||`${s}-modal`;let u=r;return u===!1&&(u=void 0),be.createElement(sGe,Object.assign({},t,{rootPrefixCls:s,prefixCls:c,iconPrefixCls:l.iconPrefixCls,theme:l.theme,direction:i??l.direction,locale:(n=(e=l.locale)===null||e===void 0?void 0:e.Modal)!==null&&n!==void 0?n:a,getContainer:u}))};function BW(t){const e=rVe(),n=document.createDocumentFragment();let o=Object.assign(Object.assign({},t),{close:l,open:!0}),r;function i(){for(var c=arguments.length,u=new Array(c),d=0;dp&&p.triggerCancel);t.onCancel&&f&&t.onCancel.apply(t,[()=>{}].concat(Za(u.slice(1))));for(let p=0;p{const u=e.getPrefixCls(void 0,uGe()),d=e.getIconPrefixCls(),f=e.getTheme(),p=be.createElement(LIt,Object.assign({},c));xme(be.createElement(fy,{prefixCls:u,iconPrefixCls:d,theme:f},e.holderRender?e.holderRender(p):p),n)})}function l(){for(var c=arguments.length,u=new Array(c),d=0;d{typeof t.afterClose=="function"&&t.afterClose(),i.apply(this,u)}}),o.visible&&delete o.visible,a(o)}function s(c){typeof c=="function"?o=c(o):o=Object.assign(Object.assign({},o),c),a(o)}return a(o),Nv.push(l),{destroy:l,update:s}}function dGe(t){return Object.assign(Object.assign({},t),{type:"warning"})}function fGe(t){return Object.assign(Object.assign({},t),{type:"info"})}function hGe(t){return Object.assign(Object.assign({},t),{type:"success"})}function pGe(t){return Object.assign(Object.assign({},t),{type:"error"})}function gGe(t){return Object.assign(Object.assign({},t),{type:"confirm"})}function WIt(t){let{rootPrefixCls:e}=t;cGe=e}var NIt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n,{afterClose:o,config:r}=t,i=NIt(t,["afterClose","config"]);const[a,l]=m.useState(!0),[s,c]=m.useState(r),{direction:u,getPrefixCls:d}=m.useContext(Cr),f=d("modal"),p=d(),g=()=>{var C;o(),(C=s.afterClose)===null||C===void 0||C.call(s)},y=function(){l(!1);for(var C=arguments.length,P=new Array(C),v=0;vA&&A.triggerCancel);s.onCancel&&T&&s.onCancel.apply(s,[()=>{}].concat(Za(P.slice(1))))};m.useImperativeHandle(e,()=>({destroy:y,update:C=>{c(P=>Object.assign(Object.assign({},P),C))}}));const w=(n=s.okCancel)!==null&&n!==void 0?n:s.type==="confirm",[b]=kw("Modal",aw.Modal);return m.createElement(sGe,Object.assign({prefixCls:f,rootPrefixCls:p},s,{close:y,open:a,afterClose:g,okText:s.okText||(w?b==null?void 0:b.okText:b==null?void 0:b.justOkText),direction:s.direction||u,cancelText:s.cancelText||(b==null?void 0:b.cancelText)},i))},jIt=m.forwardRef(UIt);let gve=0;const BIt=m.memo(m.forwardRef((t,e)=>{const[n,o]=MRt();return m.useImperativeHandle(e,()=>({patchElement:o}),[]),m.createElement(m.Fragment,null,n)}));function YIt(){const t=m.useRef(null),[e,n]=m.useState([]);m.useEffect(()=>{e.length&&(Za(e).forEach(a=>{a()}),n([]))},[e]);const o=m.useCallback(i=>function(l){var s;gve+=1;const c=m.createRef();let u;const d=new Promise(w=>{u=w});let f=!1,p;const g=m.createElement(jIt,{key:`modal-${gve}`,config:i(l),ref:c,afterClose:()=>{p==null||p()},isSilent:()=>f,onConfirm:w=>{u(w)}});return p=(s=t.current)===null||s===void 0?void 0:s.patchElement(g),p&&Nv.push(p),{destroy:()=>{function w(){var b;(b=c.current)===null||b===void 0||b.destroy()}c.current?w():n(b=>[].concat(Za(b),[w]))},update:w=>{function b(){var C;(C=c.current)===null||C===void 0||C.update(w)}c.current?b():n(C=>[].concat(Za(C),[b]))},then:w=>(f=!0,d.then(w))}},[]);return[m.useMemo(()=>({info:o(fGe),success:o(hGe),error:o(pGe),warning:o(dGe),confirm:o(gGe)}),[]),m.createElement(BIt,{key:"modal-holder",ref:t})]}const OIt=be.createContext({});function mGe(t){return e=>m.createElement(fy,{theme:{token:{motion:!1,zIndexPopupBase:0}}},m.createElement(t,Object.assign({},e)))}const YW=(t,e,n,o)=>mGe(i=>{const{prefixCls:a,style:l}=i,s=m.useRef(null),[c,u]=m.useState(0),[d,f]=m.useState(0),[p,g]=$6(!1,{value:i.open}),{getPrefixCls:y}=m.useContext(Cr),w=y(e||"select",a);m.useEffect(()=>{if(g(!0),typeof ResizeObserver<"u"){const P=new ResizeObserver(T=>{const A=T[0].target;u(A.offsetHeight+8),f(A.offsetWidth)}),v=setInterval(()=>{var T;const A=n?`.${n(w)}`:`.${w}-dropdown`,x=(T=s.current)===null||T===void 0?void 0:T.querySelector(A);x&&(clearInterval(v),P.observe(x))},10);return()=>{clearInterval(v),P.disconnect()}}},[]);let b=Object.assign(Object.assign({},i),{style:Object.assign(Object.assign({},l),{margin:0}),open:p,visible:p,getPopupContainer:()=>s.current});o&&(b=o(b));const C={paddingBottom:c,position:"relative",minWidth:d};return m.createElement("div",{ref:s,style:C},m.createElement(t,Object.assign({},b)))});function Ea(t){var e=m.useRef();e.current=t;var n=m.useCallback(function(){for(var o,r=arguments.length,i=new Array(r),a=0;a"u"||typeof window>"u")return!1;var t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(t==null?void 0:t.substr(0,4))};var _$=function(e){var n=e.className,o=e.customizeIcon,r=e.customizeIconProps,i=e.children,a=e.onMouseDown,l=e.onClick,s=typeof o=="function"?o(r):o;return m.createElement("span",{className:n,onMouseDown:function(u){u.preventDefault(),a==null||a(u)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:l,"aria-hidden":!0},s!==void 0?s:m.createElement("span",{className:Vn(n.split(/\s+/).map(function(c){return"".concat(c,"-icon")}))},i))},_It=function(e,n,o,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,l=arguments.length>6?arguments[6]:void 0,s=arguments.length>7?arguments[7]:void 0,c=be.useMemo(function(){if(hi(r)==="object")return r.clearIcon;if(i)return i},[r,i]),u=be.useMemo(function(){return!!(!a&&r&&(o.length||l)&&!(s==="combobox"&&l===""))},[r,a,o.length,l,s]);return{allowClear:u,clearIcon:be.createElement(_$,{className:"".concat(e,"-clear"),onMouseDown:n,customizeIcon:c},"×")}},yGe=m.createContext(null);function VIt(){return m.useContext(yGe)}function GIt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=m.useState(!1),n=ln(e,2),o=n[0],r=n[1],i=m.useRef(null),a=function(){window.clearTimeout(i.current)};m.useEffect(function(){return a},[]);var l=function(c,u){a(),i.current=window.setTimeout(function(){r(c),u&&u()},t)};return[o,l,a]}function AGe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=m.useRef(null),n=m.useRef(null);m.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]);function o(r){(r||e.current===null)&&(e.current=r),window.clearTimeout(n.current),n.current=window.setTimeout(function(){e.current=null},t)}return[function(){return e.current},o]}function XIt(t,e,n,o){var r=m.useRef(null);r.current={open:e,triggerOpen:n,customizedTrigger:o},m.useEffect(function(){function i(a){var l;if(!((l=r.current)!==null&&l!==void 0&&l.customizedTrigger)){var s=a.target;s.shadowRoot&&a.composed&&(s=a.composedPath()[0]||s),r.current.open&&t().filter(function(c){return c}).every(function(c){return!c.contains(s)&&c!==s})&&r.current.triggerOpen(!1)}}return window.addEventListener("mousedown",i),function(){return window.removeEventListener("mousedown",i)}},[])}function JIt(t){return![Bn.ESC,Bn.SHIFT,Bn.BACKSPACE,Bn.TAB,Bn.WIN_KEY,Bn.ALT,Bn.META,Bn.WIN_KEY_RIGHT,Bn.CTRL,Bn.SEMICOLON,Bn.EQUALS,Bn.CAPS_LOCK,Bn.CONTEXT_MENU,Bn.F1,Bn.F2,Bn.F3,Bn.F4,Bn.F5,Bn.F6,Bn.F7,Bn.F8,Bn.F9,Bn.F10,Bn.F11,Bn.F12].includes(t)}var KIt=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],MT=void 0;function qIt(t,e){var n=t.prefixCls,o=t.invalidate,r=t.item,i=t.renderItem,a=t.responsive,l=t.responsiveDisabled,s=t.registerSize,c=t.itemKey,u=t.className,d=t.style,f=t.children,p=t.display,g=t.order,y=t.component,w=y===void 0?"div":y,b=ii(t,KIt),C=a&&!p;function P(S){s(c,S)}m.useEffect(function(){return function(){P(null)}},[]);var v=i&&r!==MT?i(r):f,T;o||(T={opacity:C?0:1,height:C?0:MT,overflowY:C?"hidden":MT,order:a?g:MT,pointerEvents:C?"none":MT,position:C?"absolute":MT});var A={};C&&(A["aria-hidden"]=!0);var x=m.createElement(w,ho({className:Vn(!o&&n,u),style:qt(qt({},T),d)},A,b,{ref:e}),v);return a&&(x=m.createElement(Td,{onResize:function(R){var M=R.offsetWidth;P(M)},disabled:l},x)),x}var xE=m.forwardRef(qIt);xE.displayName="Item";function $It(t){if(typeof MessageChannel>"u")Fa(t);else{var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(void 0)}}function QIt(){var t=m.useRef(null),e=function(o){t.current||(t.current=[],$It(function(){Cd.unstable_batchedUpdates(function(){t.current.forEach(function(r){r()}),t.current=null})})),t.current.push(o)};return e}function Dz(t,e){var n=m.useState(e),o=ln(n,2),r=o[0],i=o[1],a=Ea(function(l){t(function(){i(l)})});return[r,a]}var LG=be.createContext(null),ZIt=["component"],ezt=["className"],tzt=["className"],nzt=function(e,n){var o=m.useContext(LG);if(!o){var r=e.component,i=r===void 0?"div":r,a=ii(e,ZIt);return m.createElement(i,ho({},a,{ref:n}))}var l=o.className,s=ii(o,ezt),c=e.className,u=ii(e,tzt);return m.createElement(LG.Provider,{value:null},m.createElement(xE,ho({ref:n,className:Vn(l,c)},s,u)))},wGe=m.forwardRef(nzt);wGe.displayName="RawItem";var ozt=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],vGe="responsive",xGe="invalidate";function rzt(t){return"+ ".concat(t.length," ...")}function izt(t,e){var n=t.prefixCls,o=n===void 0?"rc-overflow":n,r=t.data,i=r===void 0?[]:r,a=t.renderItem,l=t.renderRawItem,s=t.itemKey,c=t.itemWidth,u=c===void 0?10:c,d=t.ssr,f=t.style,p=t.className,g=t.maxCount,y=t.renderRest,w=t.renderRawRest,b=t.suffix,C=t.component,P=C===void 0?"div":C,v=t.itemComponent,T=t.onVisibleChange,A=ii(t,ozt),x=d==="full",S=QIt(),R=Dz(S,null),M=ln(R,2),D=M[0],E=M[1],W=D||0,j=Dz(S,new Map),L=ln(j,2),k=L[0],N=L[1],F=Dz(S,0),U=ln(F,2),O=U[0],B=U[1],_=Dz(S,0),X=ln(_,2),$=X[0],Q=X[1],le=Dz(S,0),q=ln(le,2),te=q[0],re=q[1],ae=m.useState(null),se=ln(ae,2),ne=se[0],fe=se[1],ge=m.useState(null),de=ln(ge,2),Z=de[0],he=de[1],xe=m.useMemo(function(){return Z===null&&x?Number.MAX_SAFE_INTEGER:Z||0},[Z,D]),He=m.useState(!1),Se=ln(He,2),ze=Se[0],Ie=Se[1],ye="".concat(o,"-item"),ce=Math.max(O,$),pe=g===vGe,ve=i.length&&pe,Ae=g===xGe,Te=ve||typeof g=="number"&&i.length>g,Me=m.useMemo(function(){var ot=i;return ve?D===null&&x?ot=i:ot=i.slice(0,Math.min(i.length,W/u)):typeof g=="number"&&(ot=i.slice(0,g)),ot},[i,u,D,g,ve]),Pe=m.useMemo(function(){return ve?i.slice(xe+1):i.slice(Me.length)},[i,Me,ve,xe]),Ee=m.useCallback(function(ot,st){var at;return typeof s=="function"?s(ot):(at=s&&(ot==null?void 0:ot[s]))!==null&&at!==void 0?at:st},[s]),Be=m.useCallback(a||function(ot){return ot},[a]);function Je(ot,st,at){Z===ot&&(st===void 0||st===ne)||(he(ot),at||(Ie(otW){Je(Oe-1,ot-Ze-te+$);break}}b&&ke(0)+te>W&&fe(null)}},[W,k,$,te,Ee,Me]);var Ye=ze&&!!Pe.length,it={};ne!==null&&ve&&(it={position:"absolute",left:ne,top:0});var Ve={prefixCls:ye,responsive:ve,component:v,invalidate:Ae},yt=l?function(ot,st){var at=Ee(ot,st);return m.createElement(LG.Provider,{key:at,value:qt(qt({},Ve),{},{order:st,item:ot,itemKey:at,registerSize:Ke,display:st<=xe})},l(ot,st))}:function(ot,st){var at=Ee(ot,st);return m.createElement(xE,ho({},Ve,{order:st,key:at,item:ot,renderItem:Be,itemKey:at,registerSize:Ke,display:st<=xe}))},ct,Xe={order:Ye?xe:Number.MAX_SAFE_INTEGER,className:"".concat(ye,"-rest"),registerSize:Ne,display:Ye};if(w)w&&(ct=m.createElement(LG.Provider,{value:qt(qt({},Ve),Xe)},w(Pe)));else{var ut=y||rzt;ct=m.createElement(xE,ho({},Ve,Xe),typeof ut=="function"?ut(Pe):ut)}var ft=m.createElement(P,ho({className:Vn(!Ae&&o,p),style:f,ref:e},A),Me.map(yt),Te?ct:null,b&&m.createElement(xE,ho({},Ve,{responsive:pe,responsiveDisabled:!ve,order:xe,className:"".concat(ye,"-suffix"),registerSize:De,display:!0,style:it}),b));return pe&&(ft=m.createElement(Td,{onResize:We,disabled:!ve},ft)),ft}var k2=m.forwardRef(izt);k2.displayName="Overflow";k2.Item=wGe;k2.RESPONSIVE=vGe;k2.INVALIDATE=xGe;var azt=function(e,n){var o,r=e.prefixCls,i=e.id,a=e.inputElement,l=e.disabled,s=e.tabIndex,c=e.autoFocus,u=e.autoComplete,d=e.editable,f=e.activeDescendantId,p=e.value,g=e.maxLength,y=e.onKeyDown,w=e.onMouseDown,b=e.onChange,C=e.onPaste,P=e.onCompositionStart,v=e.onCompositionEnd,T=e.open,A=e.attrs,x=a||m.createElement("input",null),S=x,R=S.ref,M=S.props,D=M.onKeyDown,E=M.onChange,W=M.onMouseDown,j=M.onCompositionStart,L=M.onCompositionEnd,k=M.style;return"maxLength"in x.props,x=m.cloneElement(x,qt(qt(qt({type:"search"},M),{},{id:i,ref:Fb(n,R),disabled:l,tabIndex:s,autoComplete:u||"off",autoFocus:c,className:Vn("".concat(r,"-selection-search-input"),(o=x)===null||o===void 0||(o=o.props)===null||o===void 0?void 0:o.className),role:"combobox","aria-expanded":T||!1,"aria-haspopup":"listbox","aria-owns":"".concat(i,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(i,"_list"),"aria-activedescendant":T?f:void 0},A),{},{value:d?p:"",maxLength:g,readOnly:!d,unselectable:d?null:"on",style:qt(qt({},k),{},{opacity:d?null:0}),onKeyDown:function(F){y(F),D&&D(F)},onMouseDown:function(F){w(F),W&&W(F)},onChange:function(F){b(F),E&&E(F)},onCompositionStart:function(F){P(F),j&&j(F)},onCompositionEnd:function(F){v(F),L&&L(F)},onPaste:C})),x},bGe=m.forwardRef(azt);function SGe(t){return Array.isArray(t)?t:t!==void 0?[t]:[]}var lzt=typeof window<"u"&&window.document&&window.document.documentElement,szt=lzt;function czt(t){return t!=null}function uzt(t){return!t&&t!==0}function mve(t){return["string","number"].includes(hi(t))}function TGe(t){var e=void 0;return t&&(mve(t.title)?e=t.title.toString():mve(t.label)&&(e=t.label.toString())),e}function dzt(t,e){szt?m.useLayoutEffect(t,e):m.useEffect(t,e)}function fzt(t){var e;return(e=t.key)!==null&&e!==void 0?e:t.value}var yve=function(e){e.preventDefault(),e.stopPropagation()},hzt=function(e){var n=e.id,o=e.prefixCls,r=e.values,i=e.open,a=e.searchValue,l=e.autoClearSearchValue,s=e.inputRef,c=e.placeholder,u=e.disabled,d=e.mode,f=e.showSearch,p=e.autoFocus,g=e.autoComplete,y=e.activeDescendantId,w=e.tabIndex,b=e.removeIcon,C=e.maxTagCount,P=e.maxTagTextLength,v=e.maxTagPlaceholder,T=v===void 0?function(fe){return"+ ".concat(fe.length," ...")}:v,A=e.tagRender,x=e.onToggleOpen,S=e.onRemove,R=e.onInputChange,M=e.onInputPaste,D=e.onInputKeyDown,E=e.onInputMouseDown,W=e.onInputCompositionStart,j=e.onInputCompositionEnd,L=m.useRef(null),k=m.useState(0),N=ln(k,2),F=N[0],U=N[1],O=m.useState(!1),B=ln(O,2),_=B[0],X=B[1],$="".concat(o,"-selection"),Q=i||d==="multiple"&&l===!1||d==="tags"?a:"",le=d==="tags"||d==="multiple"&&l===!1||f&&(i||_);dzt(function(){U(L.current.scrollWidth)},[Q]);var q=function(ge,de,Z,he,xe){return m.createElement("span",{title:TGe(ge),className:Vn("".concat($,"-item"),Vt({},"".concat($,"-item-disabled"),Z))},m.createElement("span",{className:"".concat($,"-item-content")},de),he&&m.createElement(_$,{className:"".concat($,"-item-remove"),onMouseDown:yve,onClick:xe,customizeIcon:b},"×"))},te=function(ge,de,Z,he,xe,He){var Se=function(Ie){yve(Ie),x(!i)};return m.createElement("span",{onMouseDown:Se},A({label:de,value:ge,disabled:Z,closable:he,onClose:xe,isMaxTag:!!He}))},re=function(ge){var de=ge.disabled,Z=ge.label,he=ge.value,xe=!u&&!de,He=Z;if(typeof P=="number"&&(typeof Z=="string"||typeof Z=="number")){var Se=String(He);Se.length>P&&(He="".concat(Se.slice(0,P),"..."))}var ze=function(ye){ye&&ye.stopPropagation(),S(ge)};return typeof A=="function"?te(he,He,de,xe,ze):q(ge,He,de,xe,ze)},ae=function(ge){var de=typeof T=="function"?T(ge):T;return typeof A=="function"?te(void 0,de,!1,!1,void 0,!0):q({title:de},de,!1)},se=m.createElement("div",{className:"".concat($,"-search"),style:{width:F},onFocus:function(){X(!0)},onBlur:function(){X(!1)}},m.createElement(bGe,{ref:s,open:i,prefixCls:o,id:n,inputElement:null,disabled:u,autoFocus:p,autoComplete:g,editable:le,activeDescendantId:y,value:Q,onKeyDown:D,onMouseDown:E,onChange:R,onPaste:M,onCompositionStart:W,onCompositionEnd:j,tabIndex:w,attrs:Sf(e,!0)}),m.createElement("span",{ref:L,className:"".concat($,"-search-mirror"),"aria-hidden":!0},Q," ")),ne=m.createElement(k2,{prefixCls:"".concat($,"-overflow"),data:r,renderItem:re,renderRest:ae,suffix:se,itemKey:fzt,maxCount:C});return m.createElement(m.Fragment,null,ne,!r.length&&!Q&&m.createElement("span",{className:"".concat($,"-placeholder")},c))},pzt=function(e){var n=e.inputElement,o=e.prefixCls,r=e.id,i=e.inputRef,a=e.disabled,l=e.autoFocus,s=e.autoComplete,c=e.activeDescendantId,u=e.mode,d=e.open,f=e.values,p=e.placeholder,g=e.tabIndex,y=e.showSearch,w=e.searchValue,b=e.activeValue,C=e.maxLength,P=e.onInputKeyDown,v=e.onInputMouseDown,T=e.onInputChange,A=e.onInputPaste,x=e.onInputCompositionStart,S=e.onInputCompositionEnd,R=e.title,M=m.useState(!1),D=ln(M,2),E=D[0],W=D[1],j=u==="combobox",L=j||y,k=f[0],N=w||"";j&&b&&!E&&(N=b),m.useEffect(function(){j&&W(!1)},[j,b]);var F=u!=="combobox"&&!d&&!y?!1:!!N,U=R===void 0?TGe(k):R,O=m.useMemo(function(){return k?null:m.createElement("span",{className:"".concat(o,"-selection-placeholder"),style:F?{visibility:"hidden"}:void 0},p)},[k,F,p,o]);return m.createElement(m.Fragment,null,m.createElement("span",{className:"".concat(o,"-selection-search")},m.createElement(bGe,{ref:i,prefixCls:o,id:r,open:d,inputElement:n,disabled:a,autoFocus:l,autoComplete:s,editable:L,activeDescendantId:c,value:N,onKeyDown:P,onMouseDown:v,onChange:function(_){W(!0),T(_)},onPaste:A,onCompositionStart:x,onCompositionEnd:S,tabIndex:g,attrs:Sf(e,!0),maxLength:j?C:void 0})),!j&&k?m.createElement("span",{className:"".concat(o,"-selection-item"),title:U,style:F?{visibility:"hidden"}:void 0},k.label):null,O)},gzt=function(e,n){var o=m.useRef(null),r=m.useRef(!1),i=e.prefixCls,a=e.open,l=e.mode,s=e.showSearch,c=e.tokenWithEnter,u=e.disabled,d=e.autoClearSearchValue,f=e.onSearch,p=e.onSearchSubmit,g=e.onToggleOpen,y=e.onInputKeyDown,w=e.domRef;m.useImperativeHandle(n,function(){return{focus:function(F){o.current.focus(F)},blur:function(){o.current.blur()}}});var b=AGe(0),C=ln(b,2),P=C[0],v=C[1],T=function(F){var U=F.which;(U===Bn.UP||U===Bn.DOWN)&&F.preventDefault(),y&&y(F),U===Bn.ENTER&&l==="tags"&&!r.current&&!a&&(p==null||p(F.target.value)),JIt(U)&&g(!0)},A=function(){v(!0)},x=m.useRef(null),S=function(F){f(F,!0,r.current)!==!1&&g(!0)},R=function(){r.current=!0},M=function(F){r.current=!1,l!=="combobox"&&S(F.target.value)},D=function(F){var U=F.target.value;if(c&&x.current&&/[\r\n]/.test(x.current)){var O=x.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");U=U.replace(O,x.current)}x.current=null,S(U)},E=function(F){var U=F.clipboardData,O=U==null?void 0:U.getData("text");x.current=O||""},W=function(F){var U=F.target;if(U!==o.current){var O=document.body.style.msTouchAction!==void 0;O?setTimeout(function(){o.current.focus()}):o.current.focus()}},j=function(F){var U=P();F.target!==o.current&&!U&&!(l==="combobox"&&u)&&F.preventDefault(),(l!=="combobox"&&(!s||!U)||!a)&&(a&&d!==!1&&f("",!0,!1),g())},L={inputRef:o,onInputKeyDown:T,onInputMouseDown:A,onInputChange:D,onInputPaste:E,onInputCompositionStart:R,onInputCompositionEnd:M},k=l==="multiple"||l==="tags"?m.createElement(hzt,ho({},e,L)):m.createElement(pzt,ho({},e,L));return m.createElement("div",{ref:w,className:"".concat(i,"-selector"),onClick:W,onMouseDown:j},k)},mzt=m.forwardRef(gzt);function ik(t){"@babel/helpers - typeof";return ik=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},ik(t)}function yzt(t,e){if(ik(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(ik(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Azt(t){var e=yzt(t,"string");return ik(e)==="symbol"?e:String(e)}function wzt(t,e,n){return e=Azt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ave(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function ep(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&(n[r]=t[r]);return n}function Tzt(t,e){if(t==null)return{};var n=Szt(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function WG(){return WG=Object.assign?Object.assign.bind():function(t){for(var e=1;e0,X=m.useState(!P||!_),$=af(X,2),Q=$[0],le=$[1];if(Xa(function(){!Q&&_&&a&&le(!0)},[Q,_,a]),!Q)return null;var q="auto",te={left:"-1000vw",top:"-1000vh",right:q,bottom:q};if(M||!s){var re,ae=y.points,se=y.dynamicInset||((re=y._experimental)===null||re===void 0?void 0:re.dynamicInset),ne=se&&ae[0][1]==="r",fe=se&&ae[0][0]==="b";ne?(te.right=W,te.left=q):(te.left=D,te.right=q),fe?(te.bottom=j,te.top=q):(te.top=E,te.bottom=q)}var ge={};return N&&(N.includes("height")&&U?ge.height=U:N.includes("minHeight")&&U&&(ge.minHeight=U),N.includes("width")&&F?ge.width=F:N.includes("minWidth")&&F&&(ge.minWidth=F)),s||(ge.pointerEvents="none"),m.createElement(T,{open:C||B,getContainer:P&&function(){return P(a)},autoDestroy:v},m.createElement(Czt,{prefixCls:r,open:s,zIndex:A,mask:f,motion:b}),m.createElement(Td,{onResize:L,disabled:!s},function(de){return m.createElement(o1,WG({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:C,leavedClassName:"".concat(r,"-hidden")},w,{onAppearPrepare:k,onEnterPrepare:k,visible:s,onVisibleChanged:function(he){var xe;w==null||(xe=w.onVisibleChanged)===null||xe===void 0||xe.call(w,he),l(he)}}),function(Z,he){var xe=Z.className,He=Z.style,Se=Vn(r,xe,o);return m.createElement("div",{ref:Fb(de,e,he),className:Se,style:ep(ep(ep(ep({"--arrow-x":"".concat(g.x||0,"px"),"--arrow-y":"".concat(g.y||0,"px")},te),ge),He),{},{boxSizing:"border-box",zIndex:A},i),onMouseEnter:x,onMouseLeave:S,onPointerEnter:R,onClick:d},p&&m.createElement(Pzt,{prefixCls:r,arrow:p,arrowPos:g,align:y}),m.createElement(Rzt,{cache:!s&&!u},O))})}))}),Mzt=m.forwardRef(function(t,e){var n=t.children,o=t.getTriggerDOMNode,r=rw(n),i=m.useCallback(function(l){JF(e,o?o(l):l)},[o]),a=Fw(i,n.ref);return r?m.cloneElement(n,{ref:a}):n}),wve=m.createContext(null);function vve(t){return t?Array.isArray(t)?t:[t]:[]}function Izt(t,e,n,o){return m.useMemo(function(){var r=vve(n??e),i=vve(o??e),a=new Set(r),l=new Set(i);return t&&(a.has("hover")&&(a.delete("hover"),a.add("click")),l.has("hover")&&(l.delete("hover"),l.add("click"))),[a,l]},[t,e,n,o])}const V$=function(t){if(!t)return!1;if(t instanceof Element){if(t.offsetParent)return!0;if(t.getBBox){var e=t.getBBox(),n=e.width,o=e.height;if(n||o)return!0}if(t.getBoundingClientRect){var r=t.getBoundingClientRect(),i=r.width,a=r.height;if(i||a)return!0}}return!1};function zzt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?t[0]===e[0]:t[0]===e[0]&&t[1]===e[1]}function Dzt(t,e,n,o){for(var r=n.points,i=Object.keys(t),a=0;a1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(t)?e:t}function Ez(t){return ak(parseFloat(t),0)}function bve(t,e){var n=ep({},t);return(e||[]).forEach(function(o){if(!(o instanceof HTMLBodyElement||o instanceof HTMLHtmlElement)){var r=OW(o).getComputedStyle(o),i=r.overflow,a=r.overflowClipMargin,l=r.borderTopWidth,s=r.borderBottomWidth,c=r.borderLeftWidth,u=r.borderRightWidth,d=o.getBoundingClientRect(),f=o.offsetHeight,p=o.clientHeight,g=o.offsetWidth,y=o.clientWidth,w=Ez(l),b=Ez(s),C=Ez(c),P=Ez(u),v=ak(Math.round(d.width/g*1e3)/1e3),T=ak(Math.round(d.height/f*1e3)/1e3),A=(g-y-C-P)*v,x=(f-p-w-b)*T,S=w*T,R=b*T,M=C*v,D=P*v,E=0,W=0;if(i==="clip"){var j=Ez(a);E=j*v,W=j*T}var L=d.x+M-E,k=d.y+S-W,N=L+d.width+2*E-M-D-A,F=k+d.height+2*W-S-R-x;n.left=Math.max(n.left,L),n.top=Math.max(n.top,k),n.right=Math.min(n.right,N),n.bottom=Math.min(n.bottom,F)}}),n}function Sve(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n="".concat(e),o=n.match(/^(.*)\%$/);return o?t*(parseFloat(o[1])/100):parseFloat(n)}function Tve(t,e){var n=e||[],o=af(n,2),r=o[0],i=o[1];return[Sve(t.width,r),Sve(t.height,i)]}function Pve(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[t[0],t[1]]}function IT(t,e){var n=e[0],o=e[1],r,i;return n==="t"?i=t.y:n==="b"?i=t.y+t.height:i=t.y+t.height/2,o==="l"?r=t.x:o==="r"?r=t.x+t.width:r=t.x+t.width/2,{x:r,y:i}}function T4(t,e){var n={t:"b",b:"t",l:"r",r:"l"};return t.map(function(o,r){return r===e?n[o]||"c":o}).join("")}function Ezt(t,e,n,o,r,i,a){var l=m.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:r[o]||{}}),s=af(l,2),c=s[0],u=s[1],d=m.useRef(0),f=m.useMemo(function(){return e?J0e(e):[]},[e]),p=m.useRef({}),g=function(){p.current={}};t||g();var y=Ea(function(){if(e&&n&&t){let xo=function(jo,lr){var fr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Se,ai=O.x+jo,hr=O.y+lr,tr=ai+re,xi=hr+te,Eo=Math.max(ai,fr.left),bi=Math.max(hr,fr.top),hl=Math.min(tr,fr.right),nr=Math.min(xi,fr.bottom);return Math.max(0,(hl-Eo)*(nr-bi))},Qo=function(){kt=O.y+ut,gt=kt+te,dt=O.x+Xe,Ct=dt+re};var Xn=xo,Jo=Qo,C,P,v=e,T=v.ownerDocument,A=OW(v),x=A.getComputedStyle(v),S=x.width,R=x.height,M=x.position,D=v.style.left,E=v.style.top,W=v.style.right,j=v.style.bottom,L=v.style.overflow,k=ep(ep({},r[o]),i),N=T.createElement("div");(C=v.parentElement)===null||C===void 0||C.appendChild(N),N.style.left="".concat(v.offsetLeft,"px"),N.style.top="".concat(v.offsetTop,"px"),N.style.position=M,N.style.height="".concat(v.offsetHeight,"px"),N.style.width="".concat(v.offsetWidth,"px"),v.style.left="0",v.style.top="0",v.style.right="auto",v.style.bottom="auto",v.style.overflow="hidden";var F;if(Array.isArray(n))F={x:n[0],y:n[1],width:0,height:0};else{var U=n.getBoundingClientRect();F={x:U.x,y:U.y,width:U.width,height:U.height}}var O=v.getBoundingClientRect(),B=T.documentElement,_=B.clientWidth,X=B.clientHeight,$=B.scrollWidth,Q=B.scrollHeight,le=B.scrollTop,q=B.scrollLeft,te=O.height,re=O.width,ae=F.height,se=F.width,ne={left:0,top:0,right:_,bottom:X},fe={left:-q,top:-le,right:$-q,bottom:Q-le},ge=k.htmlRegion,de="visible",Z="visibleFirst";ge!=="scroll"&&ge!==Z&&(ge=de);var he=ge===Z,xe=bve(fe,f),He=bve(ne,f),Se=ge===de?He:xe,ze=he?He:Se;v.style.left="auto",v.style.top="auto",v.style.right="0",v.style.bottom="0";var Ie=v.getBoundingClientRect();v.style.left=D,v.style.top=E,v.style.right=W,v.style.bottom=j,v.style.overflow=L,(P=v.parentElement)===null||P===void 0||P.removeChild(N);var ye=ak(Math.round(re/parseFloat(S)*1e3)/1e3),ce=ak(Math.round(te/parseFloat(R)*1e3)/1e3);if(ye===0||ce===0||xG(n)&&!V$(n))return;var pe=k.offset,ve=k.targetOffset,Ae=Tve(O,pe),Te=af(Ae,2),Me=Te[0],Pe=Te[1],Ee=Tve(F,ve),Be=af(Ee,2),Je=Be[0],We=Be[1];F.x-=Je,F.y-=We;var Ke=k.points||[],Ne=af(Ke,2),De=Ne[0],ke=Ne[1],Ye=Pve(ke),it=Pve(De),Ve=IT(F,Ye),yt=IT(O,it),ct=ep({},k),Xe=Ve.x-yt.x+Me,ut=Ve.y-yt.y+Pe,ft=xo(Xe,ut),ot=xo(Xe,ut,He),st=IT(F,["t","l"]),at=IT(O,["t","l"]),Oe=IT(F,["b","r"]),Ze=IT(O,["b","r"]),St=k.overflow||{},Pt=St.adjustX,Rt=St.adjustY,Ut=St.shiftX,Ht=St.shiftY,At=function(lr){return typeof lr=="boolean"?lr:lr>=0},kt,gt,dt,Ct;Qo();var tt=At(Rt),Fe=it[0]===Ye[0];if(tt&&it[0]==="t"&&(gt>ze.bottom||p.current.bt)){var qe=ut;Fe?qe-=te-ae:qe=st.y-Ze.y-Pe;var je=xo(Xe,qe),rt=xo(Xe,qe,He);je>ft||je===ft&&(!he||rt>=ot)?(p.current.bt=!0,ut=qe,Pe=-Pe,ct.points=[T4(it,0),T4(Ye,0)]):p.current.bt=!1}if(tt&&it[0]==="b"&&(ktft||Qe===ft&&(!he||Tt>=ot)?(p.current.tb=!0,ut=mt,Pe=-Pe,ct.points=[T4(it,0),T4(Ye,0)]):p.current.tb=!1}var Dt=At(Pt),lt=it[1]===Ye[1];if(Dt&&it[1]==="l"&&(Ct>ze.right||p.current.rl)){var zt=Xe;lt?zt-=re-se:zt=st.x-Ze.x-Me;var Ft=xo(zt,ut),_t=xo(zt,ut,He);Ft>ft||Ft===ft&&(!he||_t>=ot)?(p.current.rl=!0,Xe=zt,Me=-Me,ct.points=[T4(it,1),T4(Ye,1)]):p.current.rl=!1}if(Dt&&it[1]==="r"&&(dtft||Qt===ft&&(!he||gn>=ot)?(p.current.lr=!0,Xe=tn,Me=-Me,ct.points=[T4(it,1),T4(Ye,1)]):p.current.lr=!1}Qo();var an=Ut===!0?0:Ut;typeof an=="number"&&(dtHe.right&&(Xe-=Ct-He.right-Me,F.x>He.right-an&&(Xe+=F.x-He.right+an)));var mn=Ht===!0?0:Ht;typeof mn=="number"&&(ktHe.bottom&&(ut-=gt-He.bottom-Pe,F.y>He.bottom-mn&&(ut+=F.y-He.bottom+mn)));var Hn=O.x+Xe,Fo=Hn+re,yo=O.y+ut,So=yo+te,$o=F.x,mo=$o+se,Jn=F.y,uo=Jn+ae,ir=Math.max(Hn,$o),Rr=Math.min(Fo,mo),br=(ir+Rr)/2,Vr=br-Hn,Wo=Math.max(yo,Jn),wn=Math.min(So,uo),In=(Wo+wn)/2,ar=In-yo;a==null||a(e,ct);var No=Ie.right-O.x-(Xe+O.width),eo=Ie.bottom-O.y-(ut+O.height);u({ready:!0,offsetX:Xe/ye,offsetY:ut/ce,offsetR:No/ye,offsetB:eo/ce,arrowX:Vr/ye,arrowY:ar/ce,scaleX:ye,scaleY:ce,align:ct})}}),w=function(){d.current+=1;var P=d.current;Promise.resolve().then(function(){d.current===P&&y()})},b=function(){u(function(P){return ep(ep({},P),{},{ready:!1})})};return Xa(b,[o]),Xa(function(){t||b()},[t]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,w]}function Fzt(t){if(Array.isArray(t))return X0e(t)}function kzt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Lzt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cve(t){return Fzt(t)||kzt(t)||PGe(t)||Lzt()}function Wzt(t,e,n,o,r){Xa(function(){if(t&&e&&n){let f=function(){o(),r()};var d=f,i=e,a=n,l=J0e(i),s=J0e(a),c=OW(a),u=new Set([c].concat(Cve(l),Cve(s)));return u.forEach(function(p){p.addEventListener("scroll",f,{passive:!0})}),c.addEventListener("resize",f,{passive:!0}),o(),function(){u.forEach(function(p){p.removeEventListener("scroll",f),c.removeEventListener("resize",f)})}}},[t,e,n])}function Nzt(t,e,n,o,r,i,a,l){var s=m.useRef(t);s.current=t,m.useEffect(function(){if(e&&o&&(!r||i)){var c=function(p){var g=p.target;s.current&&!a(g)&&l(!1)},u=OW(o);u.addEventListener("mousedown",c,!0),u.addEventListener("contextmenu",c,!0);var d=DG(n);return d&&(d.addEventListener("mousedown",c,!0),d.addEventListener("contextmenu",c,!0)),function(){u.removeEventListener("mousedown",c,!0),u.removeEventListener("contextmenu",c,!0),d&&(d.removeEventListener("mousedown",c,!0),d.removeEventListener("contextmenu",c,!0))}}},[e,n,o,r,i])}var Uzt=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function jzt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W$,e=m.forwardRef(function(n,o){var r=n.prefixCls,i=r===void 0?"rc-trigger-popup":r,a=n.children,l=n.action,s=l===void 0?"hover":l,c=n.showAction,u=n.hideAction,d=n.popupVisible,f=n.defaultPopupVisible,p=n.onPopupVisibleChange,g=n.afterPopupVisibleChange,y=n.mouseEnterDelay,w=n.mouseLeaveDelay,b=w===void 0?.1:w,C=n.focusDelay,P=n.blurDelay,v=n.mask,T=n.maskClosable,A=T===void 0?!0:T,x=n.getPopupContainer,S=n.forceRender,R=n.autoDestroy,M=n.destroyPopupOnHide,D=n.popup,E=n.popupClassName,W=n.popupStyle,j=n.popupPlacement,L=n.builtinPlacements,k=L===void 0?{}:L,N=n.popupAlign,F=n.zIndex,U=n.stretch,O=n.getPopupClassNameFromAlign,B=n.fresh,_=n.alignPoint,X=n.onPopupClick,$=n.onPopupAlign,Q=n.arrow,le=n.popupMotion,q=n.maskMotion,te=n.popupTransitionName,re=n.popupAnimation,ae=n.maskTransitionName,se=n.maskAnimation,ne=n.className,fe=n.getTriggerDOMNode,ge=Tzt(n,Uzt),de=R||M||!1,Z=m.useState(!1),he=af(Z,2),xe=he[0],He=he[1];Xa(function(){He(O$())},[]);var Se=m.useRef({}),ze=m.useContext(wve),Ie=m.useMemo(function(){return{registerSubPopup:function(or,Ai){Se.current[or]=Ai,ze==null||ze.registerSubPopup(or,Ai)}}},[ze]),ye=NVe(),ce=m.useState(null),pe=af(ce,2),ve=pe[0],Ae=pe[1],Te=m.useRef(null),Me=Ea(function(nr){Te.current=nr,xG(nr)&&ve!==nr&&Ae(nr),ze==null||ze.registerSubPopup(ye,nr)}),Pe=m.useState(null),Ee=af(Pe,2),Be=Ee[0],Je=Ee[1],We=m.useRef(null),Ke=Ea(function(nr){xG(nr)&&Be!==nr&&(Je(nr),We.current=nr)}),Ne=m.Children.only(a),De=(Ne==null?void 0:Ne.props)||{},ke={},Ye=Ea(function(nr){var or,Ai,ka=Be;return(ka==null?void 0:ka.contains(nr))||((or=DG(ka))===null||or===void 0?void 0:or.host)===nr||nr===ka||(ve==null?void 0:ve.contains(nr))||((Ai=DG(ve))===null||Ai===void 0?void 0:Ai.host)===nr||nr===ve||Object.values(Se.current).some(function(wi){return(wi==null?void 0:wi.contains(nr))||nr===wi})}),it=xve(i,le,re,te),Ve=xve(i,q,se,ae),yt=m.useState(f||!1),ct=af(yt,2),Xe=ct[0],ut=ct[1],ft=d??Xe,ot=Ea(function(nr){d===void 0&&ut(nr)});Xa(function(){ut(d||!1)},[d]);var st=m.useRef(ft);st.current=ft;var at=m.useRef([]);at.current=[];var Oe=Ea(function(nr){var or;ot(nr),((or=at.current[at.current.length-1])!==null&&or!==void 0?or:ft)!==nr&&(at.current.push(nr),p==null||p(nr))}),Ze=m.useRef(),St=function(){clearTimeout(Ze.current)},Pt=function(or){var Ai=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;St(),Ai===0?Oe(or):Ze.current=setTimeout(function(){Oe(or)},Ai*1e3)};m.useEffect(function(){return St},[]);var Rt=m.useState(!1),Ut=af(Rt,2),Ht=Ut[0],At=Ut[1];Xa(function(nr){(!nr||ft)&&At(!0)},[ft]);var kt=m.useState(null),gt=af(kt,2),dt=gt[0],Ct=gt[1],tt=m.useState([0,0]),Fe=af(tt,2),qe=Fe[0],je=Fe[1],rt=function(or){je([or.clientX,or.clientY])},mt=Ezt(ft,ve,_?qe:Be,j,k,N,$),Qe=af(mt,11),Tt=Qe[0],Dt=Qe[1],lt=Qe[2],zt=Qe[3],Ft=Qe[4],_t=Qe[5],tn=Qe[6],Qt=Qe[7],gn=Qe[8],an=Qe[9],mn=Qe[10],Hn=Izt(xe,s,c,u),Fo=af(Hn,2),yo=Fo[0],So=Fo[1],$o=yo.has("click"),mo=So.has("click")||So.has("contextMenu"),Jn=Ea(function(){Ht||mn()}),uo=function(){st.current&&_&&mo&&Pt(!1)};Wzt(ft,Be,ve,Jn,uo),Xa(function(){Jn()},[qe,j]),Xa(function(){ft&&!(k!=null&&k[j])&&Jn()},[JSON.stringify(N)]);var ir=m.useMemo(function(){var nr=Dzt(k,i,an,_);return Vn(nr,O==null?void 0:O(an))},[an,O,k,i,_]);m.useImperativeHandle(o,function(){return{nativeElement:We.current,popupElement:Te.current,forceAlign:Jn}});var Rr=m.useState(0),br=af(Rr,2),Vr=br[0],Wo=br[1],wn=m.useState(0),In=af(wn,2),ar=In[0],No=In[1],eo=function(){if(U&&Be){var or=Be.getBoundingClientRect();Wo(or.width),No(or.height)}},Xn=function(){eo(),Jn()},Jo=function(or){At(!1),mn(),g==null||g(or)},xo=function(){return new Promise(function(or){eo(),Ct(function(){return or})})};Xa(function(){dt&&(mn(),dt(),Ct(null))},[dt]);function Qo(nr,or,Ai,ka){ke[nr]=function(wi){var Fs;ka==null||ka(wi),Pt(or,Ai);for(var ks=arguments.length,Zs=new Array(ks>1?ks-1:0),Ui=1;Ui1?Ai-1:0),wi=1;wi1?Ai-1:0),wi=1;wi1&&arguments[1]!==void 0?arguments[1]:{},n=e.fieldNames,o=e.childrenAsData,r=[],i=CGe(n,!1),a=i.label,l=i.value,s=i.options,c=i.groupLabel;function u(d,f){Array.isArray(d)&&d.forEach(function(p){if(f||!(s in p)){var g=p[l];r.push({key:Rve(p,r.length),groupOption:f,data:p,label:p[a],value:g})}else{var y=p[c];y===void 0&&o&&(y=p.label),r.push({key:Rve(p,r.length),group:!0,data:p,label:y}),u(p[s],!0)}})}return u(t,!1),r}function q0e(t){var e=qt({},t);return"props"in e||Object.defineProperty(e,"props",{get:function(){return j0(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}var Gzt=function(e,n,o){if(!n||!n.length)return null;var r=!1,i=function l(s,c){var u=JVe(c),d=u[0],f=u.slice(1);if(!d)return[s];var p=s.split(d);return r=r||p.length>1,p.reduce(function(g,y){return[].concat(Lo(g),Lo(l(y,f)))},[]).filter(Boolean)},a=i(e,n);return r?typeof o<"u"?a.slice(0,o):a:null},Mme=m.createContext(null),Xzt=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Jzt=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],$0e=function(e){return e==="tags"||e==="multiple"},Kzt=m.forwardRef(function(t,e){var n,o=t.id,r=t.prefixCls,i=t.className,a=t.showSearch,l=t.tagRender,s=t.direction,c=t.omitDomProps,u=t.displayValues,d=t.onDisplayValuesChange,f=t.emptyOptions,p=t.notFoundContent,g=p===void 0?"Not Found":p,y=t.onClear,w=t.mode,b=t.disabled,C=t.loading,P=t.getInputElement,v=t.getRawInputElement,T=t.open,A=t.defaultOpen,x=t.onDropdownVisibleChange,S=t.activeValue,R=t.onActiveValueChange,M=t.activeDescendantId,D=t.searchValue,E=t.autoClearSearchValue,W=t.onSearch,j=t.onSearchSplit,L=t.tokenSeparators,k=t.allowClear,N=t.suffixIcon,F=t.clearIcon,U=t.OptionList,O=t.animation,B=t.transitionName,_=t.dropdownStyle,X=t.dropdownClassName,$=t.dropdownMatchSelectWidth,Q=t.dropdownRender,le=t.dropdownAlign,q=t.placement,te=t.builtinPlacements,re=t.getPopupContainer,ae=t.showAction,se=ae===void 0?[]:ae,ne=t.onFocus,fe=t.onBlur,ge=t.onKeyUp,de=t.onKeyDown,Z=t.onMouseDown,he=ii(t,Xzt),xe=$0e(w),He=(a!==void 0?a:xe)||w==="combobox",Se=qt({},he);Jzt.forEach(function(Jn){delete Se[Jn]}),c==null||c.forEach(function(Jn){delete Se[Jn]});var ze=m.useState(!1),Ie=ln(ze,2),ye=Ie[0],ce=Ie[1];m.useEffect(function(){ce(O$())},[]);var pe=m.useRef(null),ve=m.useRef(null),Ae=m.useRef(null),Te=m.useRef(null),Me=m.useRef(null),Pe=m.useRef(!1),Ee=GIt(),Be=ln(Ee,3),Je=Be[0],We=Be[1],Ke=Be[2];m.useImperativeHandle(e,function(){var Jn,uo;return{focus:(Jn=Te.current)===null||Jn===void 0?void 0:Jn.focus,blur:(uo=Te.current)===null||uo===void 0?void 0:uo.blur,scrollTo:function(Rr){var br;return(br=Me.current)===null||br===void 0?void 0:br.scrollTo(Rr)}}});var Ne=m.useMemo(function(){var Jn;if(w!=="combobox")return D;var uo=(Jn=u[0])===null||Jn===void 0?void 0:Jn.value;return typeof uo=="string"||typeof uo=="number"?String(uo):""},[D,w,u]),De=w==="combobox"&&typeof P=="function"&&P()||null,ke=typeof v=="function"&&v(),Ye=Fw(ve,ke==null||(n=ke.props)===null||n===void 0?void 0:n.ref),it=m.useState(!1),Ve=ln(it,2),yt=Ve[0],ct=Ve[1];Xa(function(){ct(!0)},[]);var Xe=zs(!1,{defaultValue:A,value:T}),ut=ln(Xe,2),ft=ut[0],ot=ut[1],st=yt?ft:!1,at=!g&&f;(b||at&&st&&w==="combobox")&&(st=!1);var Oe=at?!1:st,Ze=m.useCallback(function(Jn){var uo=Jn!==void 0?Jn:!st;b||(ot(uo),st!==uo&&(x==null||x(uo)))},[b,st,ot,x]),St=m.useMemo(function(){return(L||[]).some(function(Jn){return[` `,`\r -`].includes(Jn)})},[L]),Pt=m.useContext(Hme)||{},Rt=Pt.maxCount,Ut=Pt.rawValues,Ht=function(uo,ir,Rr){if(!(xe&&K0e(Rt)&&(Ut==null?void 0:Ut.size)>=Rt)){var br=!0,Vr=uo;R==null||R(null);var Wo=Gzt(uo,L,K0e(Rt)?Rt-Ut.size:void 0),wn=Rr?null:Wo;return w!=="combobox"&&wn&&(Vr="",j==null||j(wn),Ze(!1),br=!1),W&&Ne!==Vr&&W(Vr,{source:ir?"typing":"effect"}),br}},At=function(uo){!uo||!uo.trim()||W(uo,{source:"submit"})};m.useEffect(function(){!st&&!xe&&w!=="combobox"&&Ht("",!1,!1)},[st]),m.useEffect(function(){ft&&b&&ot(!1),b&&!Pe.current&&We(!1)},[b]);var kt=AGe(),gt=ln(kt,2),dt=gt[0],Ct=gt[1],tt=function(uo){var ir=dt(),Rr=uo.which;if(Rr===Bn.ENTER&&(w!=="combobox"&&uo.preventDefault(),st||Ze(!0)),Ct(!!Ne),Rr===Bn.BACKSPACE&&!ir&&xe&&!Ne&&u.length){for(var br=Lo(u),Vr=null,Wo=br.length-1;Wo>=0;Wo-=1){var wn=br[Wo];if(!wn.disabled){br.splice(Wo,1),Vr=wn;break}}Vr&&d(br,{type:"remove",values:[Vr]})}for(var In=arguments.length,ar=new Array(In>1?In-1:0),No=1;No1?ir-1:0),br=1;br1?Wo-1:0),In=1;In0,X=m.useMemo(function(){if(i===0||O===0)return 0;var ne=i/O;return ne*B},[i,O,B]),$=function(fe){fe.stopPropagation(),fe.preventDefault()},Q=m.useRef({top:X,dragging:b,pageY:T,startTop:R});Q.current={top:X,dragging:b,pageY:T,startTop:R};var le=function(fe){C(!0),A(Rve(fe,u)),M(Q.current.top),l(),fe.stopPropagation(),fe.preventDefault()};m.useEffect(function(){var ne=function(Z){Z.preventDefault()},fe=E.current,ge=W.current;return fe.addEventListener("touchstart",ne),ge.addEventListener("touchstart",le),function(){fe.removeEventListener("touchstart",ne),ge.removeEventListener("touchstart",le)}},[]);var q=m.useRef();q.current=O;var te=m.useRef();te.current=B,m.useEffect(function(){if(b){var ne,fe=function(Z){var he=Q.current,xe=he.dragging,He=he.pageY,Se=he.startTop;if(Fa.cancel(ne),xe){var ze=Rve(Z,u)-He,Ie=Se;!D&&u?Ie-=ze:Ie+=ze;var ye=q.current,ce=te.current,pe=ce?Ie/ce:0,ve=Math.ceil(pe*ye);ve=Math.max(ve,0),ve=Math.min(ve,ye),ne=Fa(function(){c(ve,u)})}},ge=function(){C(!1),s()};return window.addEventListener("mousemove",fe),window.addEventListener("touchmove",fe),window.addEventListener("mouseup",ge),window.addEventListener("touchend",ge),function(){window.removeEventListener("mousemove",fe),window.removeEventListener("touchmove",fe),window.removeEventListener("mouseup",ge),window.removeEventListener("touchend",ge),Fa.cancel(ne)}}},[b]),m.useEffect(function(){U()},[i]),m.useImperativeHandle(e,function(){return{delayHidden:U}});var re="".concat(o,"-scrollbar"),ae={position:"absolute",visibility:k&&_?null:"hidden"},se={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return u?(ae.height=8,ae.left=0,ae.right=0,ae.bottom=0,se.height="100%",se.width=d,D?se.left=X:se.right=X):(ae.width=8,ae.top=0,ae.bottom=0,D?ae.right=0:ae.left=0,se.width="100%",se.height=d,se.top=X),m.createElement("div",{ref:E,className:Vn(re,(n={},Vt(n,"".concat(re,"-horizontal"),u),Vt(n,"".concat(re,"-vertical"),!u),Vt(n,"".concat(re,"-visible"),k),n)),style:qt(qt({},ae),p),onMouseDown:$,onMouseMove:U},m.createElement("div",{ref:W,className:Vn("".concat(re,"-thumb"),Vt({},"".concat(re,"-thumb-moving"),b)),style:qt(qt({},se),g),onMouseDown:le}))});function qzt(t){var e=t.children,n=t.setRef,o=m.useCallback(function(r){n(r)},[]);return m.cloneElement(e,{ref:o})}function $zt(t,e,n,o,r,i,a){var l=a.getKey;return t.slice(e,n+1).map(function(s,c){var u=e+c,d=i(s,u,{style:{width:o}}),f=l(s);return m.createElement(qzt,{key:f,setRef:function(g){return r(s,g)}},d)})}var Qzt=function(){function t(){Ap(this,t),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return wp(t,[{key:"set",value:function(n,o){this.maps[n]=o,this.id+=1}},{key:"get",value:function(n){return this.maps[n]}}]),t}();function Zzt(t,e,n){var o=m.useState(0),r=ln(o,2),i=r[0],a=r[1],l=m.useRef(new Map),s=m.useRef(new Qzt),c=m.useRef();function u(){Fa.cancel(c.current)}function d(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;u();var g=function(){l.current.forEach(function(w,b){if(w&&w.offsetParent){var C=yE(w),P=C.offsetHeight;s.current.get(b)!==P&&s.current.set(b,C.offsetHeight)}}),a(function(w){return w+1})};p?g():c.current=Fa(g)}function f(p,g){var y=t(p);l.current.get(y),g?(l.current.set(y,g),d()):l.current.delete(y)}return m.useEffect(function(){return u},[]),[f,d,s.current,i]}var eDt=10;function tDt(t,e,n,o,r,i,a,l){var s=m.useRef(),c=m.useState(null),u=ln(c,2),d=u[0],f=u[1];return Xa(function(){if(d&&d.times=0;j-=1){var L=r(e[j]),k=n.get(L);if(k===void 0){C=!0;break}if(W-=k,W<=0)break}switch(T){case"top":v=x-w;break;case"bottom":v=S-b+w;break;default:{var N=t.current.scrollTop,F=N+b;xF&&(P="bottom")}}v!==null&&a(v),v!==d.lastTop&&(C=!0)}C&&f(qt(qt({},d),{},{times:d.times+1,targetAlign:P,lastTop:v}))}},[d,t.current]),function(p){if(p==null){l();return}if(Fa.cancel(s.current),typeof p=="number")a(p);else if(p&&hi(p)==="object"){var g,y=p.align;"index"in p?g=p.index:g=e.findIndex(function(C){return r(C)===p.key});var w=p.offset,b=w===void 0?0:w;f({times:0,index:g,offset:b,originAlign:y})}}}function nDt(t,e,n){var o=t.length,r=e.length,i,a;if(o===0&&r===0)return null;o"u"?"undefined":hi(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const HGe=function(t,e){var n=m.useRef(!1),o=m.useRef(null);function r(){clearTimeout(o.current),n.current=!0,o.current=setTimeout(function(){n.current=!1},50)}var i=m.useRef({top:t,bottom:e});return i.current.top=t,i.current.bottom=e,function(a){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=a<0&&i.current.top||a>0&&i.current.bottom;return l&&s?(clearTimeout(o.current),n.current=!1):(!s||n.current)&&r(),!n.current&&s}};function rDt(t,e,n,o,r){var i=m.useRef(0),a=m.useRef(null),l=m.useRef(null),s=m.useRef(!1),c=HGe(e,n);function u(w,b){Fa.cancel(a.current),i.current+=b,l.current=b,!c(b)&&(Mve||w.preventDefault(),a.current=Fa(function(){var C=s.current?10:1;r(i.current*C),i.current=0}))}function d(w,b){r(b,!0),Mve||w.preventDefault()}var f=m.useRef(null),p=m.useRef(null);function g(w){if(t){Fa.cancel(p.current),p.current=Fa(function(){f.current=null},2);var b=w.deltaX,C=w.deltaY,P=w.shiftKey,v=b,T=C;(f.current==="sx"||!f.current&&P&&C&&!b)&&(v=C,T=0,f.current="sx");var A=Math.abs(v),x=Math.abs(T);f.current===null&&(f.current=o&&A>x?"x":"y"),f.current==="y"?u(w,T):d(w,v)}}function y(w){t&&(s.current=w.detail===l.current)}return[g,y]}var iDt=14/15;function aDt(t,e,n){var o=m.useRef(!1),r=m.useRef(0),i=m.useRef(null),a=m.useRef(null),l,s=function(f){if(o.current){var p=Math.ceil(f.touches[0].pageY),g=r.current-p;r.current=p,n(g)&&f.preventDefault(),clearInterval(a.current),a.current=setInterval(function(){g*=iDt,(!n(g,!0)||Math.abs(g)<=.1)&&clearInterval(a.current)},16)}},c=function(){o.current=!1,l()},u=function(f){l(),f.touches.length===1&&!o.current&&(o.current=!0,r.current=Math.ceil(f.touches[0].pageY),i.current=f.target,i.current.addEventListener("touchmove",s),i.current.addEventListener("touchend",c))};l=function(){i.current&&(i.current.removeEventListener("touchmove",s),i.current.removeEventListener("touchend",c))},Xa(function(){return t&&e.current.addEventListener("touchstart",u),function(){var d;(d=e.current)===null||d===void 0||d.removeEventListener("touchstart",u),l(),clearInterval(a.current)}},[t])}var lDt=20;function Ive(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=t/e*100;return isNaN(n)&&(n=0),n=Math.max(n,lDt),n=Math.min(n,t/2),Math.floor(n)}function sDt(t,e,n,o){var r=m.useMemo(function(){return[new Map,[]]},[t,n.id,o]),i=ln(r,2),a=i[0],l=i[1],s=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,f=a.get(u),p=a.get(d);if(f===void 0||p===void 0)for(var g=t.length,y=l.length;yi||!!y),D=g==="rtl",E=Vn(o,Vt({},"".concat(o,"-rtl"),D),r),W=u||uDt,j=m.useRef(),L=m.useRef(),k=m.useState(0),N=ln(k,2),F=N[0],U=N[1],O=m.useState(0),B=ln(O,2),_=B[0],X=B[1],$=m.useState(!1),Q=ln($,2),le=Q[0],q=Q[1],te=function(){q(!0)},re=function(){q(!1)},ae=m.useCallback(function(tt){return typeof f=="function"?f(tt):tt==null?void 0:tt[f]},[f]),se={getKey:ae};function ne(tt){U(function(Fe){var qe;typeof tt=="function"?qe=tt(Fe):qe=tt;var je=it(qe);return j.current.scrollTop=je,je})}var fe=m.useRef({start:0,end:W.length}),ge=m.useRef(),de=oDt(W,ae),Z=ln(de,1),he=Z[0];ge.current=he;var xe=Zzt(ae),He=ln(xe,4),Se=He[0],ze=He[1],Ie=He[2],ye=He[3],ce=m.useMemo(function(){if(!R)return{scrollHeight:void 0,start:0,end:W.length-1,offset:void 0};if(!M){var tt;return{scrollHeight:((tt=L.current)===null||tt===void 0?void 0:tt.offsetHeight)||0,start:0,end:W.length-1,offset:void 0}}for(var Fe=0,qe,je,rt,mt=W.length,Qe=0;Qe=F&&qe===void 0&&(qe=Qe,je=Fe),zt>F+i&&rt===void 0&&(rt=Qe),Fe=zt}return qe===void 0&&(qe=0,je=0,rt=Math.ceil(i/a)),rt===void 0&&(rt=W.length-1),rt=Math.min(rt+1,W.length-1),{scrollHeight:Fe,start:qe,end:rt,offset:je}},[M,R,F,W,ye,i]),pe=ce.scrollHeight,ve=ce.start,Ae=ce.end,Te=ce.offset;fe.current.start=ve,fe.current.end=Ae;var Me=m.useState({width:0,height:i}),Pe=ln(Me,2),Ee=Pe[0],Be=Pe[1],Je=function(Fe){Be({width:Fe.width||Fe.offsetWidth,height:Fe.height||Fe.offsetHeight})},We=m.useRef(),Ke=m.useRef(),Ne=m.useMemo(function(){return Ive(Ee.width,y)},[Ee.width,y]),De=m.useMemo(function(){return Ive(Ee.height,pe)},[Ee.height,pe]),ke=pe-i,Ye=m.useRef(ke);Ye.current=ke;function it(tt){var Fe=tt;return Number.isNaN(Ye.current)||(Fe=Math.min(Fe,Ye.current)),Fe=Math.max(Fe,0),Fe}var Ve=F<=0,yt=F>=ke,ct=HGe(Ve,yt),Xe=function(){return{x:D?-_:_,y:F}},ut=m.useRef(Xe()),ft=Ea(function(){if(P){var tt=Xe();(ut.current.x!==tt.x||ut.current.y!==tt.y)&&(P(tt),ut.current=tt)}});function ot(tt,Fe){var qe=tt;Fe?(Cd.flushSync(function(){X(qe)}),ft()):ne(qe)}function st(tt){var Fe=tt.currentTarget.scrollTop;Fe!==F&&ne(Fe),C==null||C(tt),ft()}var at=function(Fe){var qe=Fe,je=y-Ee.width;return qe=Math.max(qe,0),qe=Math.min(qe,je),qe},Oe=Ea(function(tt,Fe){Fe?(Cd.flushSync(function(){X(function(qe){var je=qe+(D?-tt:tt);return at(je)})}),ft()):ne(function(qe){var je=qe+tt;return je})}),Ze=rDt(R,Ve,yt,!!y,Oe),St=ln(Ze,2),Pt=St[0],Rt=St[1];aDt(R,j,function(tt,Fe){return ct(tt,Fe)?!1:(Pt({preventDefault:function(){},deltaY:tt}),!0)}),Xa(function(){function tt(qe){R&&qe.preventDefault()}var Fe=j.current;return Fe.addEventListener("wheel",Pt),Fe.addEventListener("DOMMouseScroll",Rt),Fe.addEventListener("MozMousePixelScroll",tt),function(){Fe.removeEventListener("wheel",Pt),Fe.removeEventListener("DOMMouseScroll",Rt),Fe.removeEventListener("MozMousePixelScroll",tt)}},[R]),Xa(function(){y&&X(function(tt){return at(tt)})},[Ee.width,y]);var Ut=function(){var Fe,qe;(Fe=We.current)===null||Fe===void 0||Fe.delayHidden(),(qe=Ke.current)===null||qe===void 0||qe.delayHidden()},Ht=tDt(j,W,Ie,a,ae,function(){return ze(!0)},ne,Ut);m.useImperativeHandle(e,function(){return{getScrollInfo:Xe,scrollTo:function(Fe){function qe(je){return je&&hi(je)==="object"&&("left"in je||"top"in je)}qe(Fe)?(Fe.left!==void 0&&X(at(Fe.left)),Ht(Fe.top)):Ht(Fe)}}}),Xa(function(){if(v){var tt=W.slice(ve,Ae+1);v(tt,W)}},[ve,Ae,W]);var At=sDt(W,ae,Ie,a),kt=A==null?void 0:A({start:ve,end:Ae,virtual:M,offsetX:_,offsetY:Te,rtl:D,getSize:At}),gt=$zt(W,ve,Ae,y,Se,d,se),dt=null;i&&(dt=qt(Vt({},s?"height":"maxHeight",i),dDt),R&&(dt.overflowY="hidden",y&&(dt.overflowX="hidden"),le&&(dt.pointerEvents="none")));var Ct={};return D&&(Ct.dir="rtl"),m.createElement("div",ho({style:qt(qt({},c),{},{position:"relative"}),className:E},Ct,S),m.createElement(Td,{onResize:Je},m.createElement(b,{className:"".concat(o,"-holder"),style:dt,ref:j,onScroll:st,onMouseEnter:Ut},m.createElement(RGe,{prefixCls:o,height:pe,offsetX:_,offsetY:Te,scrollWidth:y,onInnerResize:ze,ref:L,innerProps:T,rtl:D,extra:kt},gt))),M&&pe>i&&m.createElement(Hve,{ref:We,prefixCls:o,scrollOffset:F,scrollRange:pe,rtl:D,onScroll:ot,onStartMove:te,onStopMove:re,spinSize:De,containerSize:Ee.height,style:x==null?void 0:x.verticalScrollBar,thumbStyle:x==null?void 0:x.verticalScrollBarThumb}),M&&y&&m.createElement(Hve,{ref:Ke,prefixCls:o,scrollOffset:_,scrollRange:y,rtl:D,onScroll:ot,onStartMove:te,onStopMove:re,spinSize:Ne,containerSize:Ee.width,horizontal:!0,style:x==null?void 0:x.horizontalScrollBar,thumbStyle:x==null?void 0:x.horizontalScrollBarThumb}))}var G$=m.forwardRef(fDt);G$.displayName="List";function hDt(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var pDt=["disabled","title","children","style","className"];function zve(t){return typeof t=="string"||typeof t=="number"}var gDt=function(e,n){var o=VIt(),r=o.prefixCls,i=o.id,a=o.open,l=o.multiple,s=o.mode,c=o.searchValue,u=o.toggleOpen,d=o.notFoundContent,f=o.onPopupScroll,p=m.useContext(Hme),g=p.maxCount,y=p.flattenOptions,w=p.onActiveValue,b=p.defaultActiveFirstOption,C=p.onSelect,P=p.menuItemSelectedIcon,v=p.rawValues,T=p.fieldNames,A=p.virtual,x=p.direction,S=p.listHeight,R=p.listItemHeight,M=p.optionRender,D="".concat(r,"-item"),E=CW(function(){return y},[a,y],function(ae,se){return se[0]&&ae[1]!==se[1]}),W=m.useRef(null),j=m.useMemo(function(){return l&&K0e(g)&&(v==null?void 0:v.size)>=g},[l,g,v==null?void 0:v.size]),L=function(se){se.preventDefault()},k=function(se){var ne;(ne=W.current)===null||ne===void 0||ne.scrollTo(typeof se=="number"?{index:se}:se)},N=function(se){for(var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,fe=E.length,ge=0;ge1&&arguments[1]!==void 0?arguments[1]:!1;B(se);var fe={source:ne?"keyboard":"mouse"},ge=E[se];if(!ge){w(null,-1,fe);return}w(ge.value,se,fe)};m.useEffect(function(){_(b!==!1?N(0):-1)},[E.length,c]);var X=m.useCallback(function(ae){return v.has(ae)&&s!=="combobox"},[s,Lo(v).toString(),v.size]);m.useEffect(function(){var ae=setTimeout(function(){if(!l&&a&&v.size===1){var ne=Array.from(v)[0],fe=E.findIndex(function(ge){var de=ge.data;return de.value===ne});fe!==-1&&(_(fe),k(fe))}});if(a){var se;(se=W.current)===null||se===void 0||se.scrollTo(void 0)}return function(){return clearTimeout(ae)}},[a,c]);var $=function(se){se!==void 0&&C(se,{selected:!v.has(se)}),l||u(!1)};if(m.useImperativeHandle(n,function(){return{onKeyDown:function(se){var ne=se.which,fe=se.ctrlKey;switch(ne){case Bn.N:case Bn.P:case Bn.UP:case Bn.DOWN:{var ge=0;if(ne===Bn.UP?ge=-1:ne===Bn.DOWN?ge=1:hDt()&&fe&&(ne===Bn.N?ge=1:ne===Bn.P&&(ge=-1)),ge!==0){var de=N(O+ge,ge);k(de),_(de,!0)}break}case Bn.ENTER:{var Z,he=E[O];he&&!(he!=null&&(Z=he.data)!==null&&Z!==void 0&&Z.disabled)&&!j?$(he.value):$(void 0),a&&se.preventDefault();break}case Bn.ESC:u(!1),a&&se.stopPropagation()}},onKeyUp:function(){},scrollTo:function(se){k(se)}}}),E.length===0)return m.createElement("div",{role:"listbox",id:"".concat(i,"_list"),className:"".concat(D,"-empty"),onMouseDown:L},d);var Q=Object.keys(T).map(function(ae){return T[ae]}),le=function(se){return se.label};function q(ae,se){var ne=ae.group;return{role:ne?"presentation":"option",id:"".concat(i,"_list_").concat(se)}}var te=function(se){var ne=E[se];if(!ne)return null;var fe=ne.data||{},ge=fe.value,de=ne.group,Z=Sf(fe,!0),he=le(ne);return ne?m.createElement("div",ho({"aria-label":typeof he=="string"&&!de?he:null},Z,{key:se},q(ne,se),{"aria-selected":X(ge)}),ge):null},re={role:"listbox",id:"".concat(i,"_list")};return m.createElement(m.Fragment,null,A&&m.createElement("div",ho({},re,{style:{height:0,width:0,overflow:"hidden"}}),te(O-1),te(O),te(O+1)),m.createElement(G$,{itemKey:"key",ref:W,data:E,height:S,itemHeight:R,fullHeight:!1,onMouseDown:L,onScroll:f,virtual:A,direction:x,innerProps:A?null:re},function(ae,se){var ne=ae.group,fe=ae.groupOption,ge=ae.data,de=ae.label,Z=ae.value,he=ge.key;if(ne){var xe,He=(xe=ge.title)!==null&&xe!==void 0?xe:zve(de)?de.toString():void 0;return m.createElement("div",{className:Vn(D,"".concat(D,"-group"),ge.className),title:He},de!==void 0?de:he)}var Se=ge.disabled,ze=ge.title;ge.children;var Ie=ge.style,ye=ge.className,ce=ii(ge,pDt),pe=jH(ce,Q),ve=X(Z),Ae=Se||!ve&&j,Te="".concat(D,"-option"),Me=Vn(D,Te,ye,Vt(Vt(Vt(Vt({},"".concat(Te,"-grouped"),fe),"".concat(Te,"-active"),O===se&&!Ae),"".concat(Te,"-disabled"),Ae),"".concat(Te,"-selected"),ve)),Pe=le(ae),Ee=!P||typeof P=="function"||ve,Be=typeof Pe=="number"?Pe:Pe||Z,Je=zve(Be)?Be.toString():void 0;return ze!==void 0&&(Je=ze),m.createElement("div",ho({},Sf(pe),A?{}:q(ae,se),{"aria-selected":ve,className:Me,title:Je,onMouseMove:function(){O===se||Ae||_(se)},onClick:function(){Ae||$(Z)},style:Ie}),m.createElement("div",{className:"".concat(Te,"-content")},typeof M=="function"?M(ae,{index:se}):Be),m.isValidElement(P)||ve,Ee&&m.createElement(_$,{className:"".concat(D,"-option-state"),customizeIcon:P,customizeIconProps:{value:Z,disabled:Ae,isSelected:ve}},ve?"✓":null))}))},mDt=m.forwardRef(gDt);const yDt=function(t,e){var n=m.useRef({values:new Map,options:new Map}),o=m.useMemo(function(){var i=n.current,a=i.values,l=i.options,s=t.map(function(d){if(d.label===void 0){var f;return qt(qt({},d),{},{label:(f=a.get(d.value))===null||f===void 0?void 0:f.label})}return d}),c=new Map,u=new Map;return s.forEach(function(d){c.set(d.value,d),u.set(d.value,e.get(d.value)||l.get(d.value))}),n.current.values=c,n.current.options=u,s},[t,e]),r=m.useCallback(function(i){return e.get(i)||n.current.options.get(i)},[e]);return[o,r]};function tie(t,e){return SGe(t).join("").toUpperCase().includes(e)}const ADt=function(t,e,n,o,r){return m.useMemo(function(){if(!n||o===!1)return t;var i=e.options,a=e.label,l=e.value,s=[],c=typeof o=="function",u=n.toUpperCase(),d=c?o:function(p,g){return r?tie(g[r],u):g[i]?tie(g[a!=="children"?a:"label"],u):tie(g[l],u)},f=c?function(p){return q0e(p)}:function(p){return p};return t.forEach(function(p){if(p[i]){var g=d(n,f(p));if(g)s.push(p);else{var y=p[i].filter(function(w){return d(n,f(w))});y.length&&s.push(qt(qt({},p),{},Vt({},i,y)))}return}d(n,f(p))&&s.push(p)}),s},[t,o,r,n,e])};var Dve=0,wDt=dp();function vDt(){var t;return wDt?(t=Dve,Dve+=1):t="TEST_OR_SSR",t}function xDt(t){var e=m.useState(),n=ln(e,2),o=n[0],r=n[1];return m.useEffect(function(){r("rc_select_".concat(vDt()))},[]),t||o}var bDt=["children","value"],SDt=["children"];function TDt(t){var e=t,n=e.key,o=e.props,r=o.children,i=o.value,a=ii(o,bDt);return qt({key:n,value:i!==void 0?i:n,children:r},a)}function MGe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return ow(t).map(function(n,o){if(!m.isValidElement(n)||!n.type)return null;var r=n,i=r.type.isSelectOptGroup,a=r.key,l=r.props,s=l.children,c=ii(l,SDt);return e||!i?TDt(n):qt(qt({key:"__RC_SELECT_GRP__".concat(a===null?o:a,"__"),label:a},c),{},{options:MGe(s)})}).filter(function(n){return n})}var PDt=function(e,n,o,r,i){return m.useMemo(function(){var a=e,l=!e;l&&(a=MGe(n));var s=new Map,c=new Map,u=function(p,g,y){y&&typeof y=="string"&&p.set(g[y],g)},d=function f(p){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,y=0;y2&&arguments[2]!==void 0?arguments[2]:{},Rt=Pt.source,Ut=Rt===void 0?"keyboard":Rt;yt(St),a&&o==="combobox"&&Ze!==null&&Ut==="keyboard"&&ke(String(Ze))},[a,o]),ut=function(St,Pt,Rt){var Ut=function(){var je,rt=pe(St);return[U?{label:rt==null?void 0:rt[q.label],value:St,key:(je=rt==null?void 0:rt.key)!==null&&je!==void 0?je:St}:St,q0e(rt)]};if(Pt&&p){var Ht=Ut(),At=ln(Ht,2),kt=At[0],gt=At[1];p(kt,gt)}else if(!Pt&&g&&Rt!=="clear"){var dt=Ut(),Ct=ln(dt,2),tt=Ct[0],Fe=Ct[1];g(tt,Fe)}},ft=Eve(function(Ze,St){var Pt,Rt=$?St.selected:!0;Rt?Pt=$?[].concat(Lo(ce),[Ze]):[Ze]:Pt=ce.filter(function(Ut){return Ut.value!==Ze}),We(Pt),ut(Ze,Rt),o==="combobox"?ke(""):(!$0e||f)&&(se(""),ke(""))}),ot=function(St,Pt){We(St);var Rt=Pt.type,Ut=Pt.values;(Rt==="remove"||Rt==="clear")&&Ut.forEach(function(Ht){ut(Ht.value,!1,Rt)})},st=function(St,Pt){if(se(St),ke(null),Pt.source==="submit"){var Rt=(St||"").trim();if(Rt){var Ut=Array.from(new Set([].concat(Lo(Ae),[Rt])));We(Ut),ut(Rt,!0),se("")}return}Pt.source!=="blur"&&(o==="combobox"&&We(St),u==null||u(St))},at=function(St){var Pt=St;o!=="tags"&&(Pt=St.map(function(Ut){var Ht=ge.get(Ut);return Ht==null?void 0:Ht.value}).filter(function(Ut){return Ut!==void 0}));var Rt=Array.from(new Set([].concat(Lo(Ae),Lo(Pt))));We(Rt),Rt.forEach(function(Ut){ut(Ut,!0)})},Oe=m.useMemo(function(){var Ze=M!==!1&&w!==!1;return qt(qt({},ne),{},{flattenOptions:Je,onActiveValue:Xe,defaultActiveFirstOption:ct,onSelect:ft,menuItemSelectedIcon:R,rawValues:Ae,fieldNames:q,virtual:Ze,direction:D,listHeight:W,listItemHeight:L,childrenAsData:Q,maxCount:B,optionRender:A})},[B,ne,Je,Xe,ct,ft,R,Ae,q,M,w,D,W,L,Q,A]);return m.createElement(Hme.Provider,{value:Oe},m.createElement(Kzt,ho({},_,{id:X,prefixCls:i,ref:e,omitDomProps:RDt,mode:o,displayValues:ve,onDisplayValuesChange:ot,direction:D,searchValue:ae,onSearch:st,autoClearSearchValue:f,onSearchSplit:at,dropdownMatchSelectWidth:w,OptionList:mDt,emptyOptions:!Je.length,activeValue:De,activeDescendantId:"".concat(X,"_list_").concat(Ve)})))}),zme=MDt;zme.Option=Ime;zme.OptGroup=Mme;function sw(t,e,n){return Un({[`${t}-status-success`]:e==="success",[`${t}-status-warning`]:e==="warning",[`${t}-status-error`]:e==="error",[`${t}-status-validating`]:e==="validating",[`${t}-has-feedback`]:n})}const Lb=(t,e)=>e||t,IDt=()=>{const[,t]=_u(),n=new kl(t.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return m.createElement("svg",{style:n,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},m.createElement("g",{fill:"none",fillRule:"evenodd"},m.createElement("g",{transform:"translate(24 31.67)"},m.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),m.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),m.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),m.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),m.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),m.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),m.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},m.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),m.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},zDt=()=>{const[,t]=_u(),{colorFill:e,colorFillTertiary:n,colorFillQuaternary:o,colorBgContainer:r}=t,{borderColor:i,shadowColor:a,contentColor:l}=m.useMemo(()=>({borderColor:new kl(e).onBackground(r).toHexShortString(),shadowColor:new kl(n).onBackground(r).toHexShortString(),contentColor:new kl(o).onBackground(r).toHexShortString()}),[e,n,o,r]);return m.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},m.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},m.createElement("ellipse",{fill:a,cx:"32",cy:"33",rx:"32",ry:"7"}),m.createElement("g",{fillRule:"nonzero",stroke:i},m.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),m.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:l}))))},DDt=t=>{const{componentCls:e,margin:n,marginXS:o,marginXL:r,fontSize:i,lineHeight:a}=t;return{[e]:{marginInline:o,fontSize:i,lineHeight:a,textAlign:"center",[`${e}-image`]:{height:t.emptyImgHeight,marginBottom:o,opacity:t.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:t.colorText},[`${e}-footer`]:{marginTop:n},"&-normal":{marginBlock:r,color:t.colorTextDescription,[`${e}-description`]:{color:t.colorTextDescription},[`${e}-image`]:{height:t.emptyImgHeightMD}},"&-small":{marginBlock:o,color:t.colorTextDescription,[`${e}-image`]:{height:t.emptyImgHeightSM}}}}},EDt=wl("Empty",t=>{const{componentCls:e,controlHeightLG:n,calc:o}=t,r=Ki(t,{emptyImgCls:`${e}-img`,emptyImgHeight:o(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:o(n).mul(.875).equal()});return[DDt(r)]});var FDt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var{className:e,rootClassName:n,prefixCls:o,image:r=IGe,description:i,children:a,imageStyle:l,style:s}=t,c=FDt(t,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:u,direction:d,empty:f}=m.useContext(Cr),p=u("empty",o),[g,y,w]=EDt(p),[b]=kw("Empty"),C=typeof i<"u"?i:b==null?void 0:b.description,P=typeof C=="string"?C:"empty";let v=null;return typeof r=="string"?v=m.createElement("img",{alt:P,src:r}):v=r,g(m.createElement("div",Object.assign({className:Un(y,w,p,f==null?void 0:f.className,{[`${p}-normal`]:r===zGe,[`${p}-rtl`]:d==="rtl"},e,n),style:Object.assign(Object.assign({},f==null?void 0:f.style),s)},c),m.createElement("div",{className:`${p}-image`,style:l},v),C&&m.createElement("div",{className:`${p}-description`},C),a&&m.createElement("div",{className:`${p}-footer`},a)))};fg.PRESENTED_IMAGE_DEFAULT=IGe;fg.PRESENTED_IMAGE_SIMPLE=zGe;const Dme=t=>{const{componentName:e}=t,{getPrefixCls:n}=m.useContext(Cr),o=n("empty");switch(e){case"Table":case"List":return be.createElement(fg,{image:fg.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return be.createElement(fg,{image:fg.PRESENTED_IMAGE_SIMPLE,className:`${o}-small`});default:return be.createElement(fg,null)}},kDt=["outlined","borderless","filled"],BH=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;const n=m.useContext(KMt);let o;typeof t<"u"?o=t:e===!1?o="borderless":o=n??"outlined";const r=kDt.includes(o);return[o,r]},LDt=t=>{const n={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:t==="scroll"?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},n),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},n),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},n),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},n),{points:["br","tr"],offset:[0,-4]})}};function WDt(t,e){return t||LDt(e)}const Fve=t=>{const{optionHeight:e,optionFontSize:n,optionLineHeight:o,optionPadding:r}=t;return{position:"relative",display:"block",minHeight:e,padding:r,color:t.colorText,fontWeight:"normal",fontSize:n,lineHeight:o,boxSizing:"border-box"}},NDt=t=>{const{antCls:e,componentCls:n}=t,o=`${n}-item`,r=`&${e}-slide-up-enter${e}-slide-up-enter-active`,i=`&${e}-slide-up-appear${e}-slide-up-appear-active`,a=`&${e}-slide-up-leave${e}-slide-up-leave-active`,l=`${n}-dropdown-placement-`;return[{[`${n}-dropdown`]:Object.assign(Object.assign({},ja(t)),{position:"absolute",top:-9999,zIndex:t.zIndexPopup,boxSizing:"border-box",padding:t.paddingXXS,overflow:"hidden",fontSize:t.fontSize,fontVariant:"initial",backgroundColor:t.colorBgElevated,borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,[` +`].includes(Jn)})},[L]),Pt=m.useContext(Mme)||{},Rt=Pt.maxCount,Ut=Pt.rawValues,Ht=function(uo,ir,Rr){if(!(xe&&K0e(Rt)&&(Ut==null?void 0:Ut.size)>=Rt)){var br=!0,Vr=uo;R==null||R(null);var Wo=Gzt(uo,L,K0e(Rt)?Rt-Ut.size:void 0),wn=Rr?null:Wo;return w!=="combobox"&&wn&&(Vr="",j==null||j(wn),Ze(!1),br=!1),W&&Ne!==Vr&&W(Vr,{source:ir?"typing":"effect"}),br}},At=function(uo){!uo||!uo.trim()||W(uo,{source:"submit"})};m.useEffect(function(){!st&&!xe&&w!=="combobox"&&Ht("",!1,!1)},[st]),m.useEffect(function(){ft&&b&&ot(!1),b&&!Pe.current&&We(!1)},[b]);var kt=AGe(),gt=ln(kt,2),dt=gt[0],Ct=gt[1],tt=function(uo){var ir=dt(),Rr=uo.which;if(Rr===Bn.ENTER&&(w!=="combobox"&&uo.preventDefault(),st||Ze(!0)),Ct(!!Ne),Rr===Bn.BACKSPACE&&!ir&&xe&&!Ne&&u.length){for(var br=Lo(u),Vr=null,Wo=br.length-1;Wo>=0;Wo-=1){var wn=br[Wo];if(!wn.disabled){br.splice(Wo,1),Vr=wn;break}}Vr&&d(br,{type:"remove",values:[Vr]})}for(var In=arguments.length,ar=new Array(In>1?In-1:0),No=1;No1?ir-1:0),br=1;br1?Wo-1:0),In=1;In0,X=m.useMemo(function(){if(i===0||O===0)return 0;var ne=i/O;return ne*B},[i,O,B]),$=function(fe){fe.stopPropagation(),fe.preventDefault()},Q=m.useRef({top:X,dragging:b,pageY:T,startTop:R});Q.current={top:X,dragging:b,pageY:T,startTop:R};var le=function(fe){C(!0),A(Hve(fe,u)),M(Q.current.top),l(),fe.stopPropagation(),fe.preventDefault()};m.useEffect(function(){var ne=function(Z){Z.preventDefault()},fe=E.current,ge=W.current;return fe.addEventListener("touchstart",ne),ge.addEventListener("touchstart",le),function(){fe.removeEventListener("touchstart",ne),ge.removeEventListener("touchstart",le)}},[]);var q=m.useRef();q.current=O;var te=m.useRef();te.current=B,m.useEffect(function(){if(b){var ne,fe=function(Z){var he=Q.current,xe=he.dragging,He=he.pageY,Se=he.startTop;if(Fa.cancel(ne),xe){var ze=Hve(Z,u)-He,Ie=Se;!D&&u?Ie-=ze:Ie+=ze;var ye=q.current,ce=te.current,pe=ce?Ie/ce:0,ve=Math.ceil(pe*ye);ve=Math.max(ve,0),ve=Math.min(ve,ye),ne=Fa(function(){c(ve,u)})}},ge=function(){C(!1),s()};return window.addEventListener("mousemove",fe),window.addEventListener("touchmove",fe),window.addEventListener("mouseup",ge),window.addEventListener("touchend",ge),function(){window.removeEventListener("mousemove",fe),window.removeEventListener("touchmove",fe),window.removeEventListener("mouseup",ge),window.removeEventListener("touchend",ge),Fa.cancel(ne)}}},[b]),m.useEffect(function(){U()},[i]),m.useImperativeHandle(e,function(){return{delayHidden:U}});var re="".concat(o,"-scrollbar"),ae={position:"absolute",visibility:k&&_?null:"hidden"},se={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return u?(ae.height=8,ae.left=0,ae.right=0,ae.bottom=0,se.height="100%",se.width=d,D?se.left=X:se.right=X):(ae.width=8,ae.top=0,ae.bottom=0,D?ae.right=0:ae.left=0,se.width="100%",se.height=d,se.top=X),m.createElement("div",{ref:E,className:Vn(re,(n={},Vt(n,"".concat(re,"-horizontal"),u),Vt(n,"".concat(re,"-vertical"),!u),Vt(n,"".concat(re,"-visible"),k),n)),style:qt(qt({},ae),p),onMouseDown:$,onMouseMove:U},m.createElement("div",{ref:W,className:Vn("".concat(re,"-thumb"),Vt({},"".concat(re,"-thumb-moving"),b)),style:qt(qt({},se),g),onMouseDown:le}))});function qzt(t){var e=t.children,n=t.setRef,o=m.useCallback(function(r){n(r)},[]);return m.cloneElement(e,{ref:o})}function $zt(t,e,n,o,r,i,a){var l=a.getKey;return t.slice(e,n+1).map(function(s,c){var u=e+c,d=i(s,u,{style:{width:o}}),f=l(s);return m.createElement(qzt,{key:f,setRef:function(g){return r(s,g)}},d)})}var Qzt=function(){function t(){Ap(this,t),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return wp(t,[{key:"set",value:function(n,o){this.maps[n]=o,this.id+=1}},{key:"get",value:function(n){return this.maps[n]}}]),t}();function Zzt(t,e,n){var o=m.useState(0),r=ln(o,2),i=r[0],a=r[1],l=m.useRef(new Map),s=m.useRef(new Qzt),c=m.useRef();function u(){Fa.cancel(c.current)}function d(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;u();var g=function(){l.current.forEach(function(w,b){if(w&&w.offsetParent){var C=yE(w),P=C.offsetHeight;s.current.get(b)!==P&&s.current.set(b,C.offsetHeight)}}),a(function(w){return w+1})};p?g():c.current=Fa(g)}function f(p,g){var y=t(p);l.current.get(y),g?(l.current.set(y,g),d()):l.current.delete(y)}return m.useEffect(function(){return u},[]),[f,d,s.current,i]}var eDt=10;function tDt(t,e,n,o,r,i,a,l){var s=m.useRef(),c=m.useState(null),u=ln(c,2),d=u[0],f=u[1];return Xa(function(){if(d&&d.times=0;j-=1){var L=r(e[j]),k=n.get(L);if(k===void 0){C=!0;break}if(W-=k,W<=0)break}switch(T){case"top":v=x-w;break;case"bottom":v=S-b+w;break;default:{var N=t.current.scrollTop,F=N+b;xF&&(P="bottom")}}v!==null&&a(v),v!==d.lastTop&&(C=!0)}C&&f(qt(qt({},d),{},{times:d.times+1,targetAlign:P,lastTop:v}))}},[d,t.current]),function(p){if(p==null){l();return}if(Fa.cancel(s.current),typeof p=="number")a(p);else if(p&&hi(p)==="object"){var g,y=p.align;"index"in p?g=p.index:g=e.findIndex(function(C){return r(C)===p.key});var w=p.offset,b=w===void 0?0:w;f({times:0,index:g,offset:b,originAlign:y})}}}function nDt(t,e,n){var o=t.length,r=e.length,i,a;if(o===0&&r===0)return null;o"u"?"undefined":hi(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const HGe=function(t,e){var n=m.useRef(!1),o=m.useRef(null);function r(){clearTimeout(o.current),n.current=!0,o.current=setTimeout(function(){n.current=!1},50)}var i=m.useRef({top:t,bottom:e});return i.current.top=t,i.current.bottom=e,function(a){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=a<0&&i.current.top||a>0&&i.current.bottom;return l&&s?(clearTimeout(o.current),n.current=!1):(!s||n.current)&&r(),!n.current&&s}};function rDt(t,e,n,o,r){var i=m.useRef(0),a=m.useRef(null),l=m.useRef(null),s=m.useRef(!1),c=HGe(e,n);function u(w,b){Fa.cancel(a.current),i.current+=b,l.current=b,!c(b)&&(Ive||w.preventDefault(),a.current=Fa(function(){var C=s.current?10:1;r(i.current*C),i.current=0}))}function d(w,b){r(b,!0),Ive||w.preventDefault()}var f=m.useRef(null),p=m.useRef(null);function g(w){if(t){Fa.cancel(p.current),p.current=Fa(function(){f.current=null},2);var b=w.deltaX,C=w.deltaY,P=w.shiftKey,v=b,T=C;(f.current==="sx"||!f.current&&P&&C&&!b)&&(v=C,T=0,f.current="sx");var A=Math.abs(v),x=Math.abs(T);f.current===null&&(f.current=o&&A>x?"x":"y"),f.current==="y"?u(w,T):d(w,v)}}function y(w){t&&(s.current=w.detail===l.current)}return[g,y]}var iDt=14/15;function aDt(t,e,n){var o=m.useRef(!1),r=m.useRef(0),i=m.useRef(null),a=m.useRef(null),l,s=function(f){if(o.current){var p=Math.ceil(f.touches[0].pageY),g=r.current-p;r.current=p,n(g)&&f.preventDefault(),clearInterval(a.current),a.current=setInterval(function(){g*=iDt,(!n(g,!0)||Math.abs(g)<=.1)&&clearInterval(a.current)},16)}},c=function(){o.current=!1,l()},u=function(f){l(),f.touches.length===1&&!o.current&&(o.current=!0,r.current=Math.ceil(f.touches[0].pageY),i.current=f.target,i.current.addEventListener("touchmove",s),i.current.addEventListener("touchend",c))};l=function(){i.current&&(i.current.removeEventListener("touchmove",s),i.current.removeEventListener("touchend",c))},Xa(function(){return t&&e.current.addEventListener("touchstart",u),function(){var d;(d=e.current)===null||d===void 0||d.removeEventListener("touchstart",u),l(),clearInterval(a.current)}},[t])}var lDt=20;function zve(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=t/e*100;return isNaN(n)&&(n=0),n=Math.max(n,lDt),n=Math.min(n,t/2),Math.floor(n)}function sDt(t,e,n,o){var r=m.useMemo(function(){return[new Map,[]]},[t,n.id,o]),i=ln(r,2),a=i[0],l=i[1],s=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,f=a.get(u),p=a.get(d);if(f===void 0||p===void 0)for(var g=t.length,y=l.length;yi||!!y),D=g==="rtl",E=Vn(o,Vt({},"".concat(o,"-rtl"),D),r),W=u||uDt,j=m.useRef(),L=m.useRef(),k=m.useState(0),N=ln(k,2),F=N[0],U=N[1],O=m.useState(0),B=ln(O,2),_=B[0],X=B[1],$=m.useState(!1),Q=ln($,2),le=Q[0],q=Q[1],te=function(){q(!0)},re=function(){q(!1)},ae=m.useCallback(function(tt){return typeof f=="function"?f(tt):tt==null?void 0:tt[f]},[f]),se={getKey:ae};function ne(tt){U(function(Fe){var qe;typeof tt=="function"?qe=tt(Fe):qe=tt;var je=it(qe);return j.current.scrollTop=je,je})}var fe=m.useRef({start:0,end:W.length}),ge=m.useRef(),de=oDt(W,ae),Z=ln(de,1),he=Z[0];ge.current=he;var xe=Zzt(ae),He=ln(xe,4),Se=He[0],ze=He[1],Ie=He[2],ye=He[3],ce=m.useMemo(function(){if(!R)return{scrollHeight:void 0,start:0,end:W.length-1,offset:void 0};if(!M){var tt;return{scrollHeight:((tt=L.current)===null||tt===void 0?void 0:tt.offsetHeight)||0,start:0,end:W.length-1,offset:void 0}}for(var Fe=0,qe,je,rt,mt=W.length,Qe=0;Qe=F&&qe===void 0&&(qe=Qe,je=Fe),zt>F+i&&rt===void 0&&(rt=Qe),Fe=zt}return qe===void 0&&(qe=0,je=0,rt=Math.ceil(i/a)),rt===void 0&&(rt=W.length-1),rt=Math.min(rt+1,W.length-1),{scrollHeight:Fe,start:qe,end:rt,offset:je}},[M,R,F,W,ye,i]),pe=ce.scrollHeight,ve=ce.start,Ae=ce.end,Te=ce.offset;fe.current.start=ve,fe.current.end=Ae;var Me=m.useState({width:0,height:i}),Pe=ln(Me,2),Ee=Pe[0],Be=Pe[1],Je=function(Fe){Be({width:Fe.width||Fe.offsetWidth,height:Fe.height||Fe.offsetHeight})},We=m.useRef(),Ke=m.useRef(),Ne=m.useMemo(function(){return zve(Ee.width,y)},[Ee.width,y]),De=m.useMemo(function(){return zve(Ee.height,pe)},[Ee.height,pe]),ke=pe-i,Ye=m.useRef(ke);Ye.current=ke;function it(tt){var Fe=tt;return Number.isNaN(Ye.current)||(Fe=Math.min(Fe,Ye.current)),Fe=Math.max(Fe,0),Fe}var Ve=F<=0,yt=F>=ke,ct=HGe(Ve,yt),Xe=function(){return{x:D?-_:_,y:F}},ut=m.useRef(Xe()),ft=Ea(function(){if(P){var tt=Xe();(ut.current.x!==tt.x||ut.current.y!==tt.y)&&(P(tt),ut.current=tt)}});function ot(tt,Fe){var qe=tt;Fe?(Cd.flushSync(function(){X(qe)}),ft()):ne(qe)}function st(tt){var Fe=tt.currentTarget.scrollTop;Fe!==F&&ne(Fe),C==null||C(tt),ft()}var at=function(Fe){var qe=Fe,je=y-Ee.width;return qe=Math.max(qe,0),qe=Math.min(qe,je),qe},Oe=Ea(function(tt,Fe){Fe?(Cd.flushSync(function(){X(function(qe){var je=qe+(D?-tt:tt);return at(je)})}),ft()):ne(function(qe){var je=qe+tt;return je})}),Ze=rDt(R,Ve,yt,!!y,Oe),St=ln(Ze,2),Pt=St[0],Rt=St[1];aDt(R,j,function(tt,Fe){return ct(tt,Fe)?!1:(Pt({preventDefault:function(){},deltaY:tt}),!0)}),Xa(function(){function tt(qe){R&&qe.preventDefault()}var Fe=j.current;return Fe.addEventListener("wheel",Pt),Fe.addEventListener("DOMMouseScroll",Rt),Fe.addEventListener("MozMousePixelScroll",tt),function(){Fe.removeEventListener("wheel",Pt),Fe.removeEventListener("DOMMouseScroll",Rt),Fe.removeEventListener("MozMousePixelScroll",tt)}},[R]),Xa(function(){y&&X(function(tt){return at(tt)})},[Ee.width,y]);var Ut=function(){var Fe,qe;(Fe=We.current)===null||Fe===void 0||Fe.delayHidden(),(qe=Ke.current)===null||qe===void 0||qe.delayHidden()},Ht=tDt(j,W,Ie,a,ae,function(){return ze(!0)},ne,Ut);m.useImperativeHandle(e,function(){return{getScrollInfo:Xe,scrollTo:function(Fe){function qe(je){return je&&hi(je)==="object"&&("left"in je||"top"in je)}qe(Fe)?(Fe.left!==void 0&&X(at(Fe.left)),Ht(Fe.top)):Ht(Fe)}}}),Xa(function(){if(v){var tt=W.slice(ve,Ae+1);v(tt,W)}},[ve,Ae,W]);var At=sDt(W,ae,Ie,a),kt=A==null?void 0:A({start:ve,end:Ae,virtual:M,offsetX:_,offsetY:Te,rtl:D,getSize:At}),gt=$zt(W,ve,Ae,y,Se,d,se),dt=null;i&&(dt=qt(Vt({},s?"height":"maxHeight",i),dDt),R&&(dt.overflowY="hidden",y&&(dt.overflowX="hidden"),le&&(dt.pointerEvents="none")));var Ct={};return D&&(Ct.dir="rtl"),m.createElement("div",ho({style:qt(qt({},c),{},{position:"relative"}),className:E},Ct,S),m.createElement(Td,{onResize:Je},m.createElement(b,{className:"".concat(o,"-holder"),style:dt,ref:j,onScroll:st,onMouseEnter:Ut},m.createElement(RGe,{prefixCls:o,height:pe,offsetX:_,offsetY:Te,scrollWidth:y,onInnerResize:ze,ref:L,innerProps:T,rtl:D,extra:kt},gt))),M&&pe>i&&m.createElement(Mve,{ref:We,prefixCls:o,scrollOffset:F,scrollRange:pe,rtl:D,onScroll:ot,onStartMove:te,onStopMove:re,spinSize:De,containerSize:Ee.height,style:x==null?void 0:x.verticalScrollBar,thumbStyle:x==null?void 0:x.verticalScrollBarThumb}),M&&y&&m.createElement(Mve,{ref:Ke,prefixCls:o,scrollOffset:_,scrollRange:y,rtl:D,onScroll:ot,onStartMove:te,onStopMove:re,spinSize:Ne,containerSize:Ee.width,horizontal:!0,style:x==null?void 0:x.horizontalScrollBar,thumbStyle:x==null?void 0:x.horizontalScrollBarThumb}))}var G$=m.forwardRef(fDt);G$.displayName="List";function hDt(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var pDt=["disabled","title","children","style","className"];function Dve(t){return typeof t=="string"||typeof t=="number"}var gDt=function(e,n){var o=VIt(),r=o.prefixCls,i=o.id,a=o.open,l=o.multiple,s=o.mode,c=o.searchValue,u=o.toggleOpen,d=o.notFoundContent,f=o.onPopupScroll,p=m.useContext(Mme),g=p.maxCount,y=p.flattenOptions,w=p.onActiveValue,b=p.defaultActiveFirstOption,C=p.onSelect,P=p.menuItemSelectedIcon,v=p.rawValues,T=p.fieldNames,A=p.virtual,x=p.direction,S=p.listHeight,R=p.listItemHeight,M=p.optionRender,D="".concat(r,"-item"),E=RW(function(){return y},[a,y],function(ae,se){return se[0]&&ae[1]!==se[1]}),W=m.useRef(null),j=m.useMemo(function(){return l&&K0e(g)&&(v==null?void 0:v.size)>=g},[l,g,v==null?void 0:v.size]),L=function(se){se.preventDefault()},k=function(se){var ne;(ne=W.current)===null||ne===void 0||ne.scrollTo(typeof se=="number"?{index:se}:se)},N=function(se){for(var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,fe=E.length,ge=0;ge1&&arguments[1]!==void 0?arguments[1]:!1;B(se);var fe={source:ne?"keyboard":"mouse"},ge=E[se];if(!ge){w(null,-1,fe);return}w(ge.value,se,fe)};m.useEffect(function(){_(b!==!1?N(0):-1)},[E.length,c]);var X=m.useCallback(function(ae){return v.has(ae)&&s!=="combobox"},[s,Lo(v).toString(),v.size]);m.useEffect(function(){var ae=setTimeout(function(){if(!l&&a&&v.size===1){var ne=Array.from(v)[0],fe=E.findIndex(function(ge){var de=ge.data;return de.value===ne});fe!==-1&&(_(fe),k(fe))}});if(a){var se;(se=W.current)===null||se===void 0||se.scrollTo(void 0)}return function(){return clearTimeout(ae)}},[a,c]);var $=function(se){se!==void 0&&C(se,{selected:!v.has(se)}),l||u(!1)};if(m.useImperativeHandle(n,function(){return{onKeyDown:function(se){var ne=se.which,fe=se.ctrlKey;switch(ne){case Bn.N:case Bn.P:case Bn.UP:case Bn.DOWN:{var ge=0;if(ne===Bn.UP?ge=-1:ne===Bn.DOWN?ge=1:hDt()&&fe&&(ne===Bn.N?ge=1:ne===Bn.P&&(ge=-1)),ge!==0){var de=N(O+ge,ge);k(de),_(de,!0)}break}case Bn.ENTER:{var Z,he=E[O];he&&!(he!=null&&(Z=he.data)!==null&&Z!==void 0&&Z.disabled)&&!j?$(he.value):$(void 0),a&&se.preventDefault();break}case Bn.ESC:u(!1),a&&se.stopPropagation()}},onKeyUp:function(){},scrollTo:function(se){k(se)}}}),E.length===0)return m.createElement("div",{role:"listbox",id:"".concat(i,"_list"),className:"".concat(D,"-empty"),onMouseDown:L},d);var Q=Object.keys(T).map(function(ae){return T[ae]}),le=function(se){return se.label};function q(ae,se){var ne=ae.group;return{role:ne?"presentation":"option",id:"".concat(i,"_list_").concat(se)}}var te=function(se){var ne=E[se];if(!ne)return null;var fe=ne.data||{},ge=fe.value,de=ne.group,Z=Sf(fe,!0),he=le(ne);return ne?m.createElement("div",ho({"aria-label":typeof he=="string"&&!de?he:null},Z,{key:se},q(ne,se),{"aria-selected":X(ge)}),ge):null},re={role:"listbox",id:"".concat(i,"_list")};return m.createElement(m.Fragment,null,A&&m.createElement("div",ho({},re,{style:{height:0,width:0,overflow:"hidden"}}),te(O-1),te(O),te(O+1)),m.createElement(G$,{itemKey:"key",ref:W,data:E,height:S,itemHeight:R,fullHeight:!1,onMouseDown:L,onScroll:f,virtual:A,direction:x,innerProps:A?null:re},function(ae,se){var ne=ae.group,fe=ae.groupOption,ge=ae.data,de=ae.label,Z=ae.value,he=ge.key;if(ne){var xe,He=(xe=ge.title)!==null&&xe!==void 0?xe:Dve(de)?de.toString():void 0;return m.createElement("div",{className:Vn(D,"".concat(D,"-group"),ge.className),title:He},de!==void 0?de:he)}var Se=ge.disabled,ze=ge.title;ge.children;var Ie=ge.style,ye=ge.className,ce=ii(ge,pDt),pe=jH(ce,Q),ve=X(Z),Ae=Se||!ve&&j,Te="".concat(D,"-option"),Me=Vn(D,Te,ye,Vt(Vt(Vt(Vt({},"".concat(Te,"-grouped"),fe),"".concat(Te,"-active"),O===se&&!Ae),"".concat(Te,"-disabled"),Ae),"".concat(Te,"-selected"),ve)),Pe=le(ae),Ee=!P||typeof P=="function"||ve,Be=typeof Pe=="number"?Pe:Pe||Z,Je=Dve(Be)?Be.toString():void 0;return ze!==void 0&&(Je=ze),m.createElement("div",ho({},Sf(pe),A?{}:q(ae,se),{"aria-selected":ve,className:Me,title:Je,onMouseMove:function(){O===se||Ae||_(se)},onClick:function(){Ae||$(Z)},style:Ie}),m.createElement("div",{className:"".concat(Te,"-content")},typeof M=="function"?M(ae,{index:se}):Be),m.isValidElement(P)||ve,Ee&&m.createElement(_$,{className:"".concat(D,"-option-state"),customizeIcon:P,customizeIconProps:{value:Z,disabled:Ae,isSelected:ve}},ve?"✓":null))}))},mDt=m.forwardRef(gDt);const yDt=function(t,e){var n=m.useRef({values:new Map,options:new Map}),o=m.useMemo(function(){var i=n.current,a=i.values,l=i.options,s=t.map(function(d){if(d.label===void 0){var f;return qt(qt({},d),{},{label:(f=a.get(d.value))===null||f===void 0?void 0:f.label})}return d}),c=new Map,u=new Map;return s.forEach(function(d){c.set(d.value,d),u.set(d.value,e.get(d.value)||l.get(d.value))}),n.current.values=c,n.current.options=u,s},[t,e]),r=m.useCallback(function(i){return e.get(i)||n.current.options.get(i)},[e]);return[o,r]};function tie(t,e){return SGe(t).join("").toUpperCase().includes(e)}const ADt=function(t,e,n,o,r){return m.useMemo(function(){if(!n||o===!1)return t;var i=e.options,a=e.label,l=e.value,s=[],c=typeof o=="function",u=n.toUpperCase(),d=c?o:function(p,g){return r?tie(g[r],u):g[i]?tie(g[a!=="children"?a:"label"],u):tie(g[l],u)},f=c?function(p){return q0e(p)}:function(p){return p};return t.forEach(function(p){if(p[i]){var g=d(n,f(p));if(g)s.push(p);else{var y=p[i].filter(function(w){return d(n,f(w))});y.length&&s.push(qt(qt({},p),{},Vt({},i,y)))}return}d(n,f(p))&&s.push(p)}),s},[t,o,r,n,e])};var Eve=0,wDt=dp();function vDt(){var t;return wDt?(t=Eve,Eve+=1):t="TEST_OR_SSR",t}function xDt(t){var e=m.useState(),n=ln(e,2),o=n[0],r=n[1];return m.useEffect(function(){r("rc_select_".concat(vDt()))},[]),t||o}var bDt=["children","value"],SDt=["children"];function TDt(t){var e=t,n=e.key,o=e.props,r=o.children,i=o.value,a=ii(o,bDt);return qt({key:n,value:i!==void 0?i:n,children:r},a)}function MGe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return ow(t).map(function(n,o){if(!m.isValidElement(n)||!n.type)return null;var r=n,i=r.type.isSelectOptGroup,a=r.key,l=r.props,s=l.children,c=ii(l,SDt);return e||!i?TDt(n):qt(qt({key:"__RC_SELECT_GRP__".concat(a===null?o:a,"__"),label:a},c),{},{options:MGe(s)})}).filter(function(n){return n})}var PDt=function(e,n,o,r,i){return m.useMemo(function(){var a=e,l=!e;l&&(a=MGe(n));var s=new Map,c=new Map,u=function(p,g,y){y&&typeof y=="string"&&p.set(g[y],g)},d=function f(p){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,y=0;y2&&arguments[2]!==void 0?arguments[2]:{},Rt=Pt.source,Ut=Rt===void 0?"keyboard":Rt;yt(St),a&&o==="combobox"&&Ze!==null&&Ut==="keyboard"&&ke(String(Ze))},[a,o]),ut=function(St,Pt,Rt){var Ut=function(){var je,rt=pe(St);return[U?{label:rt==null?void 0:rt[q.label],value:St,key:(je=rt==null?void 0:rt.key)!==null&&je!==void 0?je:St}:St,q0e(rt)]};if(Pt&&p){var Ht=Ut(),At=ln(Ht,2),kt=At[0],gt=At[1];p(kt,gt)}else if(!Pt&&g&&Rt!=="clear"){var dt=Ut(),Ct=ln(dt,2),tt=Ct[0],Fe=Ct[1];g(tt,Fe)}},ft=Fve(function(Ze,St){var Pt,Rt=$?St.selected:!0;Rt?Pt=$?[].concat(Lo(ce),[Ze]):[Ze]:Pt=ce.filter(function(Ut){return Ut.value!==Ze}),We(Pt),ut(Ze,Rt),o==="combobox"?ke(""):(!$0e||f)&&(se(""),ke(""))}),ot=function(St,Pt){We(St);var Rt=Pt.type,Ut=Pt.values;(Rt==="remove"||Rt==="clear")&&Ut.forEach(function(Ht){ut(Ht.value,!1,Rt)})},st=function(St,Pt){if(se(St),ke(null),Pt.source==="submit"){var Rt=(St||"").trim();if(Rt){var Ut=Array.from(new Set([].concat(Lo(Ae),[Rt])));We(Ut),ut(Rt,!0),se("")}return}Pt.source!=="blur"&&(o==="combobox"&&We(St),u==null||u(St))},at=function(St){var Pt=St;o!=="tags"&&(Pt=St.map(function(Ut){var Ht=ge.get(Ut);return Ht==null?void 0:Ht.value}).filter(function(Ut){return Ut!==void 0}));var Rt=Array.from(new Set([].concat(Lo(Ae),Lo(Pt))));We(Rt),Rt.forEach(function(Ut){ut(Ut,!0)})},Oe=m.useMemo(function(){var Ze=M!==!1&&w!==!1;return qt(qt({},ne),{},{flattenOptions:Je,onActiveValue:Xe,defaultActiveFirstOption:ct,onSelect:ft,menuItemSelectedIcon:R,rawValues:Ae,fieldNames:q,virtual:Ze,direction:D,listHeight:W,listItemHeight:L,childrenAsData:Q,maxCount:B,optionRender:A})},[B,ne,Je,Xe,ct,ft,R,Ae,q,M,w,D,W,L,Q,A]);return m.createElement(Mme.Provider,{value:Oe},m.createElement(Kzt,ho({},_,{id:X,prefixCls:i,ref:e,omitDomProps:RDt,mode:o,displayValues:ve,onDisplayValuesChange:ot,direction:D,searchValue:ae,onSearch:st,autoClearSearchValue:f,onSearchSplit:at,dropdownMatchSelectWidth:w,OptionList:mDt,emptyOptions:!Je.length,activeValue:De,activeDescendantId:"".concat(X,"_list_").concat(Ve)})))}),Dme=MDt;Dme.Option=zme;Dme.OptGroup=Ime;function sw(t,e,n){return Un({[`${t}-status-success`]:e==="success",[`${t}-status-warning`]:e==="warning",[`${t}-status-error`]:e==="error",[`${t}-status-validating`]:e==="validating",[`${t}-has-feedback`]:n})}const Lb=(t,e)=>e||t,IDt=()=>{const[,t]=_u(),n=new kl(t.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return m.createElement("svg",{style:n,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},m.createElement("g",{fill:"none",fillRule:"evenodd"},m.createElement("g",{transform:"translate(24 31.67)"},m.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),m.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),m.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),m.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),m.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),m.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),m.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},m.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),m.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},zDt=()=>{const[,t]=_u(),{colorFill:e,colorFillTertiary:n,colorFillQuaternary:o,colorBgContainer:r}=t,{borderColor:i,shadowColor:a,contentColor:l}=m.useMemo(()=>({borderColor:new kl(e).onBackground(r).toHexShortString(),shadowColor:new kl(n).onBackground(r).toHexShortString(),contentColor:new kl(o).onBackground(r).toHexShortString()}),[e,n,o,r]);return m.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},m.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},m.createElement("ellipse",{fill:a,cx:"32",cy:"33",rx:"32",ry:"7"}),m.createElement("g",{fillRule:"nonzero",stroke:i},m.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),m.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:l}))))},DDt=t=>{const{componentCls:e,margin:n,marginXS:o,marginXL:r,fontSize:i,lineHeight:a}=t;return{[e]:{marginInline:o,fontSize:i,lineHeight:a,textAlign:"center",[`${e}-image`]:{height:t.emptyImgHeight,marginBottom:o,opacity:t.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:t.colorText},[`${e}-footer`]:{marginTop:n},"&-normal":{marginBlock:r,color:t.colorTextDescription,[`${e}-description`]:{color:t.colorTextDescription},[`${e}-image`]:{height:t.emptyImgHeightMD}},"&-small":{marginBlock:o,color:t.colorTextDescription,[`${e}-image`]:{height:t.emptyImgHeightSM}}}}},EDt=wl("Empty",t=>{const{componentCls:e,controlHeightLG:n,calc:o}=t,r=Ki(t,{emptyImgCls:`${e}-img`,emptyImgHeight:o(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:o(n).mul(.875).equal()});return[DDt(r)]});var FDt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var{className:e,rootClassName:n,prefixCls:o,image:r=IGe,description:i,children:a,imageStyle:l,style:s}=t,c=FDt(t,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:u,direction:d,empty:f}=m.useContext(Cr),p=u("empty",o),[g,y,w]=EDt(p),[b]=kw("Empty"),C=typeof i<"u"?i:b==null?void 0:b.description,P=typeof C=="string"?C:"empty";let v=null;return typeof r=="string"?v=m.createElement("img",{alt:P,src:r}):v=r,g(m.createElement("div",Object.assign({className:Un(y,w,p,f==null?void 0:f.className,{[`${p}-normal`]:r===zGe,[`${p}-rtl`]:d==="rtl"},e,n),style:Object.assign(Object.assign({},f==null?void 0:f.style),s)},c),m.createElement("div",{className:`${p}-image`,style:l},v),C&&m.createElement("div",{className:`${p}-description`},C),a&&m.createElement("div",{className:`${p}-footer`},a)))};fg.PRESENTED_IMAGE_DEFAULT=IGe;fg.PRESENTED_IMAGE_SIMPLE=zGe;const Eme=t=>{const{componentName:e}=t,{getPrefixCls:n}=m.useContext(Cr),o=n("empty");switch(e){case"Table":case"List":return be.createElement(fg,{image:fg.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return be.createElement(fg,{image:fg.PRESENTED_IMAGE_SIMPLE,className:`${o}-small`});default:return be.createElement(fg,null)}},kDt=["outlined","borderless","filled"],BH=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;const n=m.useContext(KMt);let o;typeof t<"u"?o=t:e===!1?o="borderless":o=n??"outlined";const r=kDt.includes(o);return[o,r]},LDt=t=>{const n={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:t==="scroll"?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},n),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},n),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},n),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},n),{points:["br","tr"],offset:[0,-4]})}};function WDt(t,e){return t||LDt(e)}const kve=t=>{const{optionHeight:e,optionFontSize:n,optionLineHeight:o,optionPadding:r}=t;return{position:"relative",display:"block",minHeight:e,padding:r,color:t.colorText,fontWeight:"normal",fontSize:n,lineHeight:o,boxSizing:"border-box"}},NDt=t=>{const{antCls:e,componentCls:n}=t,o=`${n}-item`,r=`&${e}-slide-up-enter${e}-slide-up-enter-active`,i=`&${e}-slide-up-appear${e}-slide-up-appear-active`,a=`&${e}-slide-up-leave${e}-slide-up-leave-active`,l=`${n}-dropdown-placement-`;return[{[`${n}-dropdown`]:Object.assign(Object.assign({},ja(t)),{position:"absolute",top:-9999,zIndex:t.zIndexPopup,boxSizing:"border-box",padding:t.paddingXXS,overflow:"hidden",fontSize:t.fontSize,fontVariant:"initial",backgroundColor:t.colorBgElevated,borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,[` ${r}${l}bottomLeft, ${i}${l}bottomLeft `]:{animationName:U$},[` @@ -4516,7 +4516,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `]:{animationName:B$},[`${a}${l}bottomLeft`]:{animationName:j$},[` ${a}${l}topLeft, ${a}${l}topRight - `]:{animationName:Y$},"&-hidden":{display:"none"},[`${o}`]:Object.assign(Object.assign({},Fve(t)),{cursor:"pointer",transition:`background ${t.motionDurationSlow} ease`,borderRadius:t.borderRadiusSM,"&-group":{color:t.colorTextDescription,fontSize:t.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},Gx),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${o}-option-disabled)`]:{backgroundColor:t.optionActiveBg},[`&-selected:not(${o}-option-disabled)`]:{color:t.optionSelectedColor,fontWeight:t.optionSelectedFontWeight,backgroundColor:t.optionSelectedBg,[`${o}-option-state`]:{color:t.colorPrimary},[`&:has(+ ${o}-option-selected:not(${o}-option-disabled))`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${o}-option-selected:not(${o}-option-disabled)`]:{borderStartStartRadius:0,borderStartEndRadius:0}}},"&-disabled":{[`&${o}-option-selected`]:{backgroundColor:t.colorBgContainerDisabled},color:t.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:t.calc(t.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},Fve(t)),{color:t.colorTextDisabled})}),"&-rtl":{direction:"rtl"}})},O9(t,"slide-up"),O9(t,"slide-down"),wR(t,"move-up"),wR(t,"move-down")]},DGe=t=>{const{multipleSelectItemHeight:e,paddingXXS:n,lineWidth:o,INTERNAL_FIXED_ITEM_MARGIN:r}=t,i=t.max(t.calc(n).sub(o).equal(),0),a=t.max(t.calc(i).sub(r).equal(),0);return{basePadding:i,containerPadding:a,itemHeight:Nt(e),itemLineHeight:Nt(t.calc(e).sub(t.calc(t.lineWidth).mul(2)).equal())}},UDt=t=>{const{multipleSelectItemHeight:e,selectHeight:n,lineWidth:o}=t;return t.calc(n).sub(e).div(2).sub(o).equal()},EGe=t=>{const{componentCls:e,iconCls:n,borderRadiusSM:o,motionDurationSlow:r,paddingXS:i,multipleItemColorDisabled:a,multipleItemBorderColorDisabled:l,colorIcon:s,colorIconHover:c,INTERNAL_FIXED_ITEM_MARGIN:u}=t;return{[`${e}-selection-overflow`]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"},[`${e}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",marginBlock:u,borderRadius:o,cursor:"default",transition:`font-size ${r}, line-height ${r}, height ${r}`,marginInlineEnd:t.calc(u).mul(2).equal(),paddingInlineStart:i,paddingInlineEnd:t.calc(i).div(2).equal(),[`${e}-disabled&`]:{color:a,borderColor:l,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:t.calc(i).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},WH()),{display:"inline-flex",alignItems:"center",color:s,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:c}})}}}},jDt=(t,e)=>{const{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:o}=t,r=`${n}-selection-overflow`,i=t.multipleSelectItemHeight,a=UDt(t),l=e?`${n}-${e}`:"",s=DGe(t);return{[`${n}-multiple${l}`]:Object.assign(Object.assign({},EGe(t)),{[`${n}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",height:"100%",paddingInline:s.basePadding,paddingBlock:s.containerPadding,borderRadius:t.borderRadius,[`${n}-disabled&`]:{background:t.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Nt(o)} 0`,lineHeight:Nt(i),visibility:"hidden",content:'"\\a0"'}},[`${n}-selection-item`]:{height:s.itemHeight,lineHeight:Nt(s.itemLineHeight)},[`${r}-item + ${r}-item`]:{[`${n}-selection-search`]:{marginInlineStart:0}},[`${r}-item-suffix`]:{height:"100%"},[`${n}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(a).equal(),"\n &-input,\n &-mirror\n ":{height:i,fontFamily:t.fontFamily,lineHeight:Nt(i),transition:`all ${t.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${n}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:t.inputPaddingHorizontalBase,insetInlineEnd:t.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${t.motionDurationSlow}`}})}};function nie(t,e){const{componentCls:n}=t,o=e?`${n}-${e}`:"",r={[`${n}-multiple${o}`]:{fontSize:t.fontSize,[`${n}-selector`]:{[`${n}-show-search&`]:{cursor:"text"}},[` + `]:{animationName:Y$},"&-hidden":{display:"none"},[`${o}`]:Object.assign(Object.assign({},kve(t)),{cursor:"pointer",transition:`background ${t.motionDurationSlow} ease`,borderRadius:t.borderRadiusSM,"&-group":{color:t.colorTextDescription,fontSize:t.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},Gx),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${o}-option-disabled)`]:{backgroundColor:t.optionActiveBg},[`&-selected:not(${o}-option-disabled)`]:{color:t.optionSelectedColor,fontWeight:t.optionSelectedFontWeight,backgroundColor:t.optionSelectedBg,[`${o}-option-state`]:{color:t.colorPrimary},[`&:has(+ ${o}-option-selected:not(${o}-option-disabled))`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${o}-option-selected:not(${o}-option-disabled)`]:{borderStartStartRadius:0,borderStartEndRadius:0}}},"&-disabled":{[`&${o}-option-selected`]:{backgroundColor:t.colorBgContainerDisabled},color:t.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:t.calc(t.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},kve(t)),{color:t.colorTextDisabled})}),"&-rtl":{direction:"rtl"}})},O9(t,"slide-up"),O9(t,"slide-down"),wR(t,"move-up"),wR(t,"move-down")]},DGe=t=>{const{multipleSelectItemHeight:e,paddingXXS:n,lineWidth:o,INTERNAL_FIXED_ITEM_MARGIN:r}=t,i=t.max(t.calc(n).sub(o).equal(),0),a=t.max(t.calc(i).sub(r).equal(),0);return{basePadding:i,containerPadding:a,itemHeight:Nt(e),itemLineHeight:Nt(t.calc(e).sub(t.calc(t.lineWidth).mul(2)).equal())}},UDt=t=>{const{multipleSelectItemHeight:e,selectHeight:n,lineWidth:o}=t;return t.calc(n).sub(e).div(2).sub(o).equal()},EGe=t=>{const{componentCls:e,iconCls:n,borderRadiusSM:o,motionDurationSlow:r,paddingXS:i,multipleItemColorDisabled:a,multipleItemBorderColorDisabled:l,colorIcon:s,colorIconHover:c,INTERNAL_FIXED_ITEM_MARGIN:u}=t;return{[`${e}-selection-overflow`]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"},[`${e}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",marginBlock:u,borderRadius:o,cursor:"default",transition:`font-size ${r}, line-height ${r}, height ${r}`,marginInlineEnd:t.calc(u).mul(2).equal(),paddingInlineStart:i,paddingInlineEnd:t.calc(i).div(2).equal(),[`${e}-disabled&`]:{color:a,borderColor:l,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:t.calc(i).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},WH()),{display:"inline-flex",alignItems:"center",color:s,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:c}})}}}},jDt=(t,e)=>{const{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:o}=t,r=`${n}-selection-overflow`,i=t.multipleSelectItemHeight,a=UDt(t),l=e?`${n}-${e}`:"",s=DGe(t);return{[`${n}-multiple${l}`]:Object.assign(Object.assign({},EGe(t)),{[`${n}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",height:"100%",paddingInline:s.basePadding,paddingBlock:s.containerPadding,borderRadius:t.borderRadius,[`${n}-disabled&`]:{background:t.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Nt(o)} 0`,lineHeight:Nt(i),visibility:"hidden",content:'"\\a0"'}},[`${n}-selection-item`]:{height:s.itemHeight,lineHeight:Nt(s.itemLineHeight)},[`${r}-item + ${r}-item`]:{[`${n}-selection-search`]:{marginInlineStart:0}},[`${r}-item-suffix`]:{height:"100%"},[`${n}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(a).equal(),"\n &-input,\n &-mirror\n ":{height:i,fontFamily:t.fontFamily,lineHeight:Nt(i),transition:`all ${t.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${n}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:t.inputPaddingHorizontalBase,insetInlineEnd:t.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${t.motionDurationSlow}`}})}};function nie(t,e){const{componentCls:n}=t,o=e?`${n}-${e}`:"",r={[`${n}-multiple${o}`]:{fontSize:t.fontSize,[`${n}-selector`]:{[`${n}-show-search&`]:{cursor:"text"}},[` &${n}-show-arrow ${n}-selector, &${n}-allow-clear ${n}-selector `]:{paddingInlineEnd:t.calc(t.fontSizeIcon).add(t.controlPaddingHorizontal).equal()}}};return[jDt(t,e),r]}const BDt=t=>{const{componentCls:e}=t,n=Ki(t,{selectHeight:t.controlHeightSM,multipleSelectItemHeight:t.multipleItemHeightSM,borderRadius:t.borderRadiusSM,borderRadiusSM:t.borderRadiusXS}),o=Ki(t,{fontSize:t.fontSizeLG,selectHeight:t.controlHeightLG,multipleSelectItemHeight:t.multipleItemHeightLG,borderRadius:t.borderRadiusLG,borderRadiusSM:t.borderRadius});return[nie(t),nie(n,"sm"),{[`${e}-multiple${e}-sm`]:{[`${e}-selection-placeholder`]:{insetInline:t.calc(t.controlPaddingHorizontalSM).sub(t.lineWidth).equal()},[`${e}-selection-search`]:{marginInlineStart:2}}},nie(o,"lg")]};function oie(t,e){const{componentCls:n,inputPaddingHorizontalBase:o,borderRadius:r}=t,i=t.calc(t.controlHeight).sub(t.calc(t.lineWidth).mul(2)).equal(),a=e?`${n}-${e}`:"";return{[`${n}-single${a}`]:{fontSize:t.fontSize,height:t.controlHeight,[`${n}-selector`]:Object.assign(Object.assign({},ja(t,!0)),{display:"flex",borderRadius:r,[`${n}-selection-search`]:{position:"absolute",top:0,insetInlineStart:o,insetInlineEnd:o,bottom:0,"&-input":{width:"100%",WebkitAppearance:"textfield"}},[` @@ -4528,19 +4528,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `]:{paddingInlineEnd:t.showArrowPaddingInlineEnd},[`&${n}-open ${n}-selection-item`]:{color:t.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:"100%",height:"100%",padding:`0 ${Nt(o)}`,[`${n}-selection-search-input`]:{height:i},"&:after":{lineHeight:Nt(i)}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:"none"},[`${n}-selection-search`]:{position:"static",width:"100%"},[`${n}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Nt(o)}`,"&:after":{display:"none"}}}}}}}function YDt(t){const{componentCls:e}=t,n=t.calc(t.controlPaddingHorizontalSM).sub(t.lineWidth).equal();return[oie(t),oie(Ki(t,{controlHeight:t.controlHeightSM,borderRadius:t.borderRadiusSM}),"sm"),{[`${e}-single${e}-sm`]:{[`&:not(${e}-customize-input)`]:{[`${e}-selection-search`]:{insetInlineStart:n,insetInlineEnd:n},[`${e}-selector`]:{padding:`0 ${Nt(n)}`},[`&${e}-show-arrow ${e}-selection-search`]:{insetInlineEnd:t.calc(n).add(t.calc(t.fontSize).mul(1.5)).equal()},[` &${e}-show-arrow ${e}-selection-item, &${e}-show-arrow ${e}-selection-placeholder - `]:{paddingInlineEnd:t.calc(t.fontSize).mul(1.5).equal()}}}},oie(Ki(t,{controlHeight:t.singleItemHeightLG,fontSize:t.fontSizeLG,borderRadius:t.borderRadiusLG}),"lg")]}const ODt=t=>{const{fontSize:e,lineHeight:n,lineWidth:o,controlHeight:r,controlHeightSM:i,controlHeightLG:a,paddingXXS:l,controlPaddingHorizontal:s,zIndexPopupBase:c,colorText:u,fontWeightStrong:d,controlItemBgActive:f,controlItemBgHover:p,colorBgContainer:g,colorFillSecondary:y,colorBgContainerDisabled:w,colorTextDisabled:b}=t,C=l*2,P=o*2,v=Math.min(r-C,r-P),T=Math.min(i-C,i-P),A=Math.min(a-C,a-P);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(l/2),zIndexPopup:c+50,optionSelectedColor:u,optionSelectedFontWeight:d,optionSelectedBg:f,optionActiveBg:p,optionPadding:`${(r-e*n)/2}px ${s}px`,optionFontSize:e,optionLineHeight:n,optionHeight:r,selectorBg:g,clearBg:g,singleItemHeightLG:a,multipleItemBg:y,multipleItemBorderColor:"transparent",multipleItemHeight:v,multipleItemHeightSM:T,multipleItemHeightLG:A,multipleSelectorBgDisabled:w,multipleItemColorDisabled:b,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(t.fontSize*1.25)}},FGe=(t,e)=>{const{componentCls:n,antCls:o,controlOutlineWidth:r}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{border:`${Nt(t.lineWidth)} ${t.lineType} ${e.borderColor}`,background:t.selectorBg},[`&:not(${n}-disabled):not(${n}-customize-input):not(${o}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:e.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:e.activeBorderColor,boxShadow:`0 0 0 ${Nt(r)} ${e.activeShadowColor}`,outline:0}}}},kve=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},FGe(t,e))}),_Dt=t=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},FGe(t,{borderColor:t.colorBorder,hoverBorderHover:t.colorPrimaryHover,activeBorderColor:t.colorPrimary,activeShadowColor:t.controlOutline})),kve(t,{status:"error",borderColor:t.colorError,hoverBorderHover:t.colorErrorHover,activeBorderColor:t.colorError,activeShadowColor:t.colorErrorOutline})),kve(t,{status:"warning",borderColor:t.colorWarning,hoverBorderHover:t.colorWarningHover,activeBorderColor:t.colorWarning,activeShadowColor:t.colorWarningOutline})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{background:t.colorBgContainerDisabled,color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}})}),kGe=(t,e)=>{const{componentCls:n,antCls:o}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{background:e.bg,border:`${Nt(t.lineWidth)} ${t.lineType} transparent`,color:e.color},[`&:not(${n}-disabled):not(${n}-customize-input):not(${o}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{background:e.hoverBg},[`${n}-focused& ${n}-selector`]:{background:t.selectorBg,borderColor:e.activeBorderColor,outline:0}}}},Lve=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},kGe(t,e))}),VDt=t=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},kGe(t,{bg:t.colorFillTertiary,hoverBg:t.colorFillSecondary,activeBorderColor:t.colorPrimary,color:t.colorText})),Lve(t,{status:"error",bg:t.colorErrorBg,hoverBg:t.colorErrorBgHover,activeBorderColor:t.colorError,color:t.colorError})),Lve(t,{status:"warning",bg:t.colorWarningBg,hoverBg:t.colorWarningBgHover,activeBorderColor:t.colorWarning,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{borderColor:t.colorBorder,background:t.colorBgContainerDisabled,color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.colorBgContainer,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`}})}),GDt=t=>({"&-borderless":{[`${t.componentCls}-selector`]:{background:"transparent",borderColor:"transparent"},[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}}}),XDt=t=>({[t.componentCls]:Object.assign(Object.assign(Object.assign({},_Dt(t)),VDt(t)),GDt(t))}),JDt=t=>{const{componentCls:e}=t;return{position:"relative",transition:`all ${t.motionDurationMid} ${t.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},[`${e}-disabled&`]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},KDt=t=>{const{componentCls:e}=t;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},qDt=t=>{const{antCls:e,componentCls:n,inputPaddingHorizontalBase:o,iconCls:r}=t;return{[n]:Object.assign(Object.assign({},ja(t)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${n}-customize-input) ${n}-selector`]:Object.assign(Object.assign({},JDt(t)),KDt(t)),[`${n}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},Gx),{[`> ${e}-typography`]:{display:"inline"}}),[`${n}-selection-placeholder`]:Object.assign(Object.assign({},Gx),{flex:1,color:t.colorTextPlaceholder,pointerEvents:"none"}),[`${n}-arrow`]:Object.assign(Object.assign({},WH()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:o,height:t.fontSizeIcon,marginTop:t.calc(t.fontSizeIcon).mul(-1).div(2).equal(),color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:`opacity ${t.motionDurationSlow} ease`,[r]:{verticalAlign:"top",transition:`transform ${t.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${n}-suffix)`]:{pointerEvents:"auto"}},[`${n}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${n}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:o,zIndex:1,display:"inline-block",width:t.fontSizeIcon,height:t.fontSizeIcon,marginTop:t.calc(t.fontSizeIcon).mul(-1).div(2).equal(),color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${t.motionDurationMid} ease, opacity ${t.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:t.colorTextTertiary}},"&:hover":{[`${n}-clear`]:{opacity:1},[`${n}-arrow:not(:last-child)`]:{opacity:0}}}),[`${n}-has-feedback`]:{[`${n}-clear`]:{insetInlineEnd:t.calc(o).add(t.fontSize).add(t.paddingXS).equal()}}}},$Dt=t=>{const{componentCls:e}=t;return[{[e]:{[`&${e}-in-form-item`]:{width:"100%"}}},qDt(t),YDt(t),BDt(t),NDt(t),{[`${e}-rtl`]:{direction:"rtl"}},FW(t,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]},QDt=wl("Select",(t,e)=>{let{rootPrefixCls:n}=e;const o=Ki(t,{rootPrefixCls:n,inputPaddingHorizontalBase:t.calc(t.paddingSM).sub(1).equal(),multipleSelectItemHeight:t.multipleItemHeight,selectHeight:t.controlHeight});return[$Dt(o),XDt(o)]},ODt,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}});var ZDt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},eEt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:ZDt}))},LGe=m.forwardRef(eEt),tEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},nEt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:tEt}))},Eme=m.forwardRef(nEt),oEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},rEt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:oEt}))},Fme=m.forwardRef(rEt);function WGe(t){let{suffixIcon:e,clearIcon:n,menuItemSelectedIcon:o,removeIcon:r,loading:i,multiple:a,hasFeedback:l,prefixCls:s,showSuffixIcon:c,feedbackIcon:u,showArrow:d,componentName:f}=t;const p=n??m.createElement(E$,null),g=C=>e===null&&!l&&!d?null:m.createElement(m.Fragment,null,c!==!1&&C,l&&u);let y=null;if(e!==void 0)y=g(e);else if(i)y=g(m.createElement(UH,{spin:!0}));else{const C=`${s}-suffix`;y=P=>{let{open:v,showSearch:T}=P;return g(v&&T?m.createElement(Fme,{className:C}):m.createElement(Eme,{className:C}))}}let w=null;o!==void 0?w=o:a?w=m.createElement(LGe,null):w=null;let b=null;return r!==void 0?b=r:b=m.createElement(Lw,null),{clearIcon:p,suffixIcon:y,itemIcon:w,removeIcon:b}}function iEt(t,e){return e!==void 0?e:t!==null}var aEt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n;const{prefixCls:o,bordered:r,className:i,rootClassName:a,getPopupContainer:l,popupClassName:s,dropdownClassName:c,listHeight:u=256,placement:d,listItemHeight:f,size:p,disabled:g,notFoundContent:y,status:w,builtinPlacements:b,dropdownMatchSelectWidth:C,popupMatchSelectWidth:P,direction:v,style:T,allowClear:A,variant:x,dropdownStyle:S,transitionName:R,tagRender:M,maxCount:D}=t,E=aEt(t,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount"]),{getPopupContainer:W,getPrefixCls:j,renderEmpty:L,direction:k,virtual:N,popupMatchSelectWidth:F,popupOverflow:U,select:O}=m.useContext(Cr),[,B]=_u(),_=f??(B==null?void 0:B.controlHeight),X=j("select",o),$=j(),Q=v??k,{compactSize:le,compactItemClassnames:q}=Nw(X,Q),[te,re]=BH(x,r),ae=O0(X),[se,ne,fe]=QDt(X,ae),ge=m.useMemo(()=>{const{mode:De}=t;if(De!=="combobox")return De===NGe?"combobox":De},[t.mode]),de=ge==="multiple"||ge==="tags",Z=iEt(t.suffixIcon,t.showArrow),he=(n=P??C)!==null&&n!==void 0?n:F,{status:xe,hasFeedback:He,isFormItemInput:Se,feedbackIcon:ze}=m.useContext(r1),Ie=Lb(xe,w);let ye;y!==void 0?ye=y:ge==="combobox"?ye=null:ye=(L==null?void 0:L("Select"))||m.createElement(Dme,{componentName:"Select"});const{suffixIcon:ce,itemIcon:pe,removeIcon:ve,clearIcon:Ae}=WGe(Object.assign(Object.assign({},E),{multiple:de,hasFeedback:He,feedbackIcon:ze,showSuffixIcon:Z,prefixCls:X,componentName:"Select"})),Te=A===!0?{clearIcon:Ae}:A,Me=up(E,["suffixIcon","itemIcon"]),Pe=Un(s||c,{[`${X}-dropdown-${Q}`]:Q==="rtl"},a,fe,ae,ne),Ee=Ed(De=>{var ke;return(ke=p??le)!==null&&ke!==void 0?ke:De}),Be=m.useContext(n1),Je=g??Be,We=Un({[`${X}-lg`]:Ee==="large",[`${X}-sm`]:Ee==="small",[`${X}-rtl`]:Q==="rtl",[`${X}-${te}`]:re,[`${X}-in-form-item`]:Se},sw(X,Ie,He),q,O==null?void 0:O.className,i,a,fe,ae,ne),Ke=m.useMemo(()=>d!==void 0?d:Q==="rtl"?"bottomRight":"bottomLeft",[d,Q]),[Ne]=Ww("SelectLike",S==null?void 0:S.zIndex);return se(m.createElement(zme,Object.assign({ref:e,virtual:N,showSearch:O==null?void 0:O.showSearch},Me,{style:Object.assign(Object.assign({},O==null?void 0:O.style),T),dropdownMatchSelectWidth:he,transitionName:j9($,"slide-up",R),builtinPlacements:WDt(b,U),listHeight:u,listItemHeight:_,mode:ge,prefixCls:X,placement:Ke,direction:Q,suffixIcon:ce,menuItemSelectedIcon:pe,removeIcon:ve,allowClear:Te,notFoundContent:ye,className:We,getPopupContainer:l||W,dropdownClassName:Pe,disabled:Je,dropdownStyle:Object.assign(Object.assign({},S),{zIndex:Ne}),maxCount:de?D:void 0,tagRender:de?M:void 0})))},_o=m.forwardRef(lEt),sEt=BW(_o);_o.SECRET_COMBOBOX_MODE_DO_NOT_USE=NGe;_o.Option=Ime;_o.OptGroup=Mme;_o._InternalPanelDoNotUseOrYouWillBeFired=sEt;const cw=["xxl","xl","lg","md","sm","xs"],cEt=t=>({xs:`(max-width: ${t.screenXSMax}px)`,sm:`(min-width: ${t.screenSM}px)`,md:`(min-width: ${t.screenMD}px)`,lg:`(min-width: ${t.screenLG}px)`,xl:`(min-width: ${t.screenXL}px)`,xxl:`(min-width: ${t.screenXXL}px)`}),uEt=t=>{const e=t,n=[].concat(cw).reverse();return n.forEach((o,r)=>{const i=o.toUpperCase(),a=`screen${i}Min`,l=`screen${i}`;if(!(e[a]<=e[l]))throw new Error(`${a}<=${l} fails : !(${e[a]}<=${e[l]})`);if(r{const n=new Map;let o=-1,r={};return{matchHandlers:{},dispatch(i){return r=i,n.forEach(a=>a(r)),n.size>=1},subscribe(i){return n.size||this.register(),o+=1,n.set(o,i),i(r),o},unsubscribe(i){n.delete(i),n.size||this.unregister()},unregister(){Object.keys(e).forEach(i=>{const a=e[i],l=this.matchHandlers[a];l==null||l.mql.removeListener(l==null?void 0:l.listener)}),n.clear()},register(){Object.keys(e).forEach(i=>{const a=e[i],l=c=>{let{matches:u}=c;this.dispatch(Object.assign(Object.assign({},r),{[i]:u}))},s=window.matchMedia(a);s.addListener(l),this.matchHandlers[a]={mql:s,listener:l},l(s)})},responsiveMap:e}},[t])}function jGe(){const[,t]=m.useReducer(e=>e+1,0);return t}function X$(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const e=m.useRef({}),n=jGe(),o=UGe();return gx(()=>{const r=o.subscribe(i=>{e.current=i,t&&n()});return()=>o.unsubscribe(r)},[]),e.current}const Q0e=m.createContext({}),dEt=t=>{const{antCls:e,componentCls:n,iconCls:o,avatarBg:r,avatarColor:i,containerSize:a,containerSizeLG:l,containerSizeSM:s,textFontSize:c,textFontSizeLG:u,textFontSizeSM:d,borderRadius:f,borderRadiusLG:p,borderRadiusSM:g,lineWidth:y,lineType:w}=t,b=(C,P,v)=>({width:C,height:C,borderRadius:"50%",[`&${n}-square`]:{borderRadius:v},[`&${n}-icon`]:{fontSize:P,[`> ${o}`]:{margin:0}}});return{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",overflow:"hidden",color:i,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:r,border:`${Nt(y)} ${w} transparent`,"&-image":{background:"transparent"},[`${e}-image-img`]:{display:"block"}}),b(a,c,f)),{"&-lg":Object.assign({},b(l,u,p)),"&-sm":Object.assign({},b(s,d,g)),"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}})}},fEt=t=>{const{componentCls:e,groupBorderColor:n,groupOverlapping:o,groupSpace:r}=t;return{[`${e}-group`]:{display:"inline-flex",[`${e}`]:{borderColor:n},"> *:not(:first-child)":{marginInlineStart:o}},[`${e}-group-popover`]:{[`${e} + ${e}`]:{marginInlineStart:r}}}},hEt=t=>{const{controlHeight:e,controlHeightLG:n,controlHeightSM:o,fontSize:r,fontSizeLG:i,fontSizeXL:a,fontSizeHeading3:l,marginXS:s,marginXXS:c,colorBorderBg:u}=t;return{containerSize:e,containerSizeLG:n,containerSizeSM:o,textFontSize:Math.round((i+a)/2),textFontSizeLG:l,textFontSizeSM:r,groupSpace:c,groupOverlapping:-s,groupBorderColor:u}},BGe=wl("Avatar",t=>{const{colorTextLightSolid:e,colorTextPlaceholder:n}=t,o=Ki(t,{avatarBg:n,avatarColor:e});return[dEt(o),fEt(o)]},hEt);var pEt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const[n,o]=m.useState(1),[r,i]=m.useState(!1),[a,l]=m.useState(!0),s=m.useRef(null),c=m.useRef(null),u=o5(e,s),{getPrefixCls:d,avatar:f}=m.useContext(Cr),p=m.useContext(Q0e),g=()=>{if(!c.current||!s.current)return;const te=c.current.offsetWidth,re=s.current.offsetWidth;if(te!==0&&re!==0){const{gap:ae=4}=t;ae*2{i(!0)},[]),m.useEffect(()=>{l(!0),o(1)},[t.src]),m.useEffect(g,[t.gap]);const y=()=>{const{onError:te}=t;(te==null?void 0:te())!==!1&&l(!1)},{prefixCls:w,shape:b,size:C,src:P,srcSet:v,icon:T,className:A,rootClassName:x,alt:S,draggable:R,children:M,crossOrigin:D}=t,E=pEt(t,["prefixCls","shape","size","src","srcSet","icon","className","rootClassName","alt","draggable","children","crossOrigin"]),W=Ed(te=>{var re,ae;return(ae=(re=C??(p==null?void 0:p.size))!==null&&re!==void 0?re:te)!==null&&ae!==void 0?ae:"default"}),j=Object.keys(typeof W=="object"?W||{}:{}).some(te=>["xs","sm","md","lg","xl","xxl"].includes(te)),L=X$(j),k=m.useMemo(()=>{if(typeof W!="object")return{};const te=cw.find(ae=>L[ae]),re=W[te];return re?{width:re,height:re,fontSize:re&&(T||M)?re/2:18}:{}},[L,W]),N=d("avatar",w),F=O0(N),[U,O,B]=BGe(N,F),_=Un({[`${N}-lg`]:W==="large",[`${N}-sm`]:W==="small"}),X=m.isValidElement(P),$=b||(p==null?void 0:p.shape)||"circle",Q=Un(N,_,f==null?void 0:f.className,`${N}-${$}`,{[`${N}-image`]:X||P&&a,[`${N}-icon`]:!!T},B,F,A,x,O),le=typeof W=="number"?{width:W,height:W,fontSize:T?W/2:18}:{};let q;if(typeof P=="string"&&a)q=m.createElement("img",{src:P,draggable:R,srcSet:v,onError:y,alt:S,crossOrigin:D});else if(X)q=P;else if(T)q=T;else if(r||n!==1){const te=`scale(${n})`,re={msTransform:te,WebkitTransform:te,transform:te};q=m.createElement(Td,{onResize:g},m.createElement("span",{className:`${N}-string`,ref:c,style:Object.assign({},re)},M))}else q=m.createElement("span",{className:`${N}-string`,style:{opacity:0},ref:c},M);return delete E.onError,delete E.gap,U(m.createElement("span",Object.assign({},E,{style:Object.assign(Object.assign(Object.assign(Object.assign({},le),k),f==null?void 0:f.style),E.style),className:Q,ref:u}),q))},YGe=m.forwardRef(gEt);var fi={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var n=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||n>=fi.F1&&n<=fi.F12)return!1;switch(n){case fi.ALT:case fi.CAPS_LOCK:case fi.CONTEXT_MENU:case fi.CTRL:case fi.DOWN:case fi.END:case fi.ESC:case fi.HOME:case fi.INSERT:case fi.LEFT:case fi.MAC_FF_META:case fi.META:case fi.NUMLOCK:case fi.NUM_CENTER:case fi.PAGE_DOWN:case fi.PAGE_UP:case fi.PAUSE:case fi.PRINT_SCREEN:case fi.RIGHT:case fi.SHIFT:case fi.UP:case fi.WIN_KEY:case fi.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=fi.ZERO&&e<=fi.NINE||e>=fi.NUM_ZERO&&e<=fi.NUM_MULTIPLY||e>=fi.A&&e<=fi.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case fi.SPACE:case fi.QUESTION_MARK:case fi.NUM_PLUS:case fi.NUM_MINUS:case fi.NUM_PERIOD:case fi.NUM_DIVISION:case fi.SEMICOLON:case fi.DASH:case fi.EQUALS:case fi.COMMA:case fi.PERIOD:case fi.SLASH:case fi.APOSTROPHE:case fi.SINGLE_QUOTE:case fi.OPEN_SQUARE_BRACKET:case fi.BACKSLASH:case fi.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};const WG=t=>t?typeof t=="function"?t():t:null;function kme(t){var e=t.children,n=t.prefixCls,o=t.id,r=t.overlayInnerStyle,i=t.className,a=t.style;return m.createElement("div",{className:Vn("".concat(n,"-content"),i),style:a},m.createElement("div",{className:"".concat(n,"-inner"),id:o,role:"tooltip",style:r},typeof e=="function"?e():e))}function Z0e(){return Z0e=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[r]=t[r]);return n}function xEt(t,e){if(t==null)return{};var n=vEt(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var zT={shiftX:64,adjustY:1},DT={adjustX:1,shiftY:!0},pm=[0,0],bEt={left:{points:["cr","cl"],overflow:DT,offset:[-4,0],targetOffset:pm},right:{points:["cl","cr"],overflow:DT,offset:[4,0],targetOffset:pm},top:{points:["bc","tc"],overflow:zT,offset:[0,-4],targetOffset:pm},bottom:{points:["tc","bc"],overflow:zT,offset:[0,4],targetOffset:pm},topLeft:{points:["bl","tl"],overflow:zT,offset:[0,-4],targetOffset:pm},leftTop:{points:["tr","tl"],overflow:DT,offset:[-4,0],targetOffset:pm},topRight:{points:["br","tr"],overflow:zT,offset:[0,-4],targetOffset:pm},rightTop:{points:["tl","tr"],overflow:DT,offset:[4,0],targetOffset:pm},bottomRight:{points:["tr","br"],overflow:zT,offset:[0,4],targetOffset:pm},rightBottom:{points:["bl","br"],overflow:DT,offset:[4,0],targetOffset:pm},bottomLeft:{points:["tl","bl"],overflow:zT,offset:[0,4],targetOffset:pm},leftBottom:{points:["br","bl"],overflow:DT,offset:[-4,0],targetOffset:pm}},SEt=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],TEt=function(e,n){var o=e.overlayClassName,r=e.trigger,i=r===void 0?["hover"]:r,a=e.mouseEnterDelay,l=a===void 0?0:a,s=e.mouseLeaveDelay,c=s===void 0?.1:s,u=e.overlayStyle,d=e.prefixCls,f=d===void 0?"rc-tooltip":d,p=e.children,g=e.onVisibleChange,y=e.afterVisibleChange,w=e.transitionName,b=e.animation,C=e.motion,P=e.placement,v=P===void 0?"right":P,T=e.align,A=T===void 0?{}:T,x=e.destroyTooltipOnHide,S=x===void 0?!1:x,R=e.defaultVisible,M=e.getTooltipContainer,D=e.overlayInnerStyle;e.arrowContent;var E=e.overlay,W=e.id,j=e.showArrow,L=j===void 0?!0:j,k=xEt(e,SEt),N=m.useRef(null);m.useImperativeHandle(n,function(){return N.current});var F=wEt({},k);"visible"in e&&(F.popupVisible=e.visible);var U=function(){return m.createElement(kme,{key:"content",prefixCls:f,id:W,overlayInnerStyle:D},E)};return m.createElement(OW,Z0e({popupClassName:o,prefixCls:f,popup:U,action:i,builtinPlacements:bEt,popupPlacement:v,ref:N,popupAlign:A,getPopupContainer:M,onPopupVisibleChange:g,afterPopupVisibleChange:y,popupTransitionName:w,popupAnimation:b,popupMotion:C,defaultPopupVisible:R,autoDestroy:S,mouseLeaveDelay:c,popupStyle:u,mouseEnterDelay:l,arrow:L},F),p)};const PEt=m.forwardRef(TEt);function J$(t){const{sizePopupArrow:e,borderRadiusXS:n,borderRadiusOuter:o}=t,r=e/2,i=0,a=r,l=o*1/Math.sqrt(2),s=r-o*(1-1/Math.sqrt(2)),c=r-n*(1/Math.sqrt(2)),u=o*(Math.sqrt(2)-1)+n*(1/Math.sqrt(2)),d=2*r-c,f=u,p=2*r-l,g=s,y=2*r-i,w=a,b=r*Math.sqrt(2)+o*(Math.sqrt(2)-2),C=o*(Math.sqrt(2)-1),P=`polygon(${C}px 100%, 50% ${C}px, ${2*r-C}px 100%, ${C}px 100%)`,v=`path('M ${i} ${a} A ${o} ${o} 0 0 0 ${l} ${s} L ${c} ${u} A ${n} ${n} 0 0 1 ${d} ${f} L ${p} ${g} A ${o} ${o} 0 0 0 ${y} ${w} Z')`;return{arrowShadowWidth:b,arrowPath:v,arrowPolygon:P}}const OGe=(t,e,n)=>{const{sizePopupArrow:o,arrowPolygon:r,arrowPath:i,arrowShadowWidth:a,borderRadiusXS:l,calc:s}=t;return{pointerEvents:"none",width:o,height:o,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:o,height:s(o).div(2).equal(),background:e,clipPath:{_multi_value_:!0,value:[r,i]},content:'""'},"&::after":{content:'""',position:"absolute",width:a,height:a,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Nt(l)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}},_Ge=8;function K$(t){const{contentRadius:e,limitVerticalRadius:n}=t,o=e>12?e+2:12;return{arrowOffsetHorizontal:o,arrowOffsetVertical:n?_Ge:o}}function HY(t,e){return t?e:{}}function Lme(t,e,n){const{componentCls:o,boxShadowPopoverArrow:r,arrowOffsetVertical:i,arrowOffsetHorizontal:a}=t,{arrowDistance:l=0,arrowPlacement:s={left:!0,right:!0,top:!0,bottom:!0}}=n||{};return{[o]:Object.assign(Object.assign(Object.assign(Object.assign({[`${o}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},OGe(t,e,r)),{"&:before":{background:e}})]},HY(!!s.top,{[[`&-placement-top > ${o}-arrow`,`&-placement-topLeft > ${o}-arrow`,`&-placement-topRight > ${o}-arrow`].join(",")]:{bottom:l,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${o}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft > ${o}-arrow`]:{left:{_skip_check_:!0,value:a}},[`&-placement-topRight > ${o}-arrow`]:{right:{_skip_check_:!0,value:a}}})),HY(!!s.bottom,{[[`&-placement-bottom > ${o}-arrow`,`&-placement-bottomLeft > ${o}-arrow`,`&-placement-bottomRight > ${o}-arrow`].join(",")]:{top:l,transform:"translateY(-100%)"},[`&-placement-bottom > ${o}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft > ${o}-arrow`]:{left:{_skip_check_:!0,value:a}},[`&-placement-bottomRight > ${o}-arrow`]:{right:{_skip_check_:!0,value:a}}})),HY(!!s.left,{[[`&-placement-left > ${o}-arrow`,`&-placement-leftTop > ${o}-arrow`,`&-placement-leftBottom > ${o}-arrow`].join(",")]:{right:{_skip_check_:!0,value:l},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${o}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${o}-arrow`]:{top:i},[`&-placement-leftBottom > ${o}-arrow`]:{bottom:i}})),HY(!!s.right,{[[`&-placement-right > ${o}-arrow`,`&-placement-rightTop > ${o}-arrow`,`&-placement-rightBottom > ${o}-arrow`].join(",")]:{left:{_skip_check_:!0,value:l},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${o}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${o}-arrow`]:{top:i},[`&-placement-rightBottom > ${o}-arrow`]:{bottom:i}}))}}function CEt(t,e,n,o){if(o===!1)return{adjustX:!1,adjustY:!1};const r=o&&typeof o=="object"?o:{},i={};switch(t){case"top":case"bottom":i.shiftX=e.arrowOffsetHorizontal*2+n,i.shiftY=!0,i.adjustY=!0;break;case"left":case"right":i.shiftY=e.arrowOffsetVertical*2+n,i.shiftX=!0,i.adjustX=!0;break}const a=Object.assign(Object.assign({},i),r);return a.shiftX||(a.adjustX=!0),a.shiftY||(a.adjustY=!0),a}const Nve={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},REt={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},HEt=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function VGe(t){const{arrowWidth:e,autoAdjustOverflow:n,arrowPointAtCenter:o,offset:r,borderRadius:i,visibleFirst:a}=t,l=e/2,s={};return Object.keys(Nve).forEach(c=>{const u=o&&REt[c]||Nve[c],d=Object.assign(Object.assign({},u),{offset:[0,0],dynamicInset:!0});switch(s[c]=d,HEt.has(c)&&(d.autoArrow=!1),c){case"top":case"topLeft":case"topRight":d.offset[1]=-l-r;break;case"bottom":case"bottomLeft":case"bottomRight":d.offset[1]=l+r;break;case"left":case"leftTop":case"leftBottom":d.offset[0]=-l-r;break;case"right":case"rightTop":case"rightBottom":d.offset[0]=l+r;break}const f=K$({contentRadius:i,limitVerticalRadius:!0});if(o)switch(c){case"topLeft":case"bottomLeft":d.offset[0]=-f.arrowOffsetHorizontal-l;break;case"topRight":case"bottomRight":d.offset[0]=f.arrowOffsetHorizontal+l;break;case"leftTop":case"rightTop":d.offset[1]=-f.arrowOffsetHorizontal-l;break;case"leftBottom":case"rightBottom":d.offset[1]=f.arrowOffsetHorizontal+l;break}d.overflow=CEt(c,f,e,n),a&&(d.htmlRegion="visibleFirst")}),s}const MEt=t=>{const{componentCls:e,tooltipMaxWidth:n,tooltipColor:o,tooltipBg:r,tooltipBorderRadius:i,zIndexPopup:a,controlHeight:l,boxShadowSecondary:s,paddingSM:c,paddingXS:u}=t;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{position:"absolute",zIndex:a,display:"block",width:"max-content",maxWidth:n,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":r,[`${e}-inner`]:{minWidth:l,minHeight:l,padding:`${Nt(t.calc(c).div(2).equal())} ${Nt(u)}`,color:o,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:r,borderRadius:i,boxShadow:s,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${e}-inner`]:{borderRadius:t.min(i,_Ge)}},[`${e}-content`]:{position:"relative"}}),D$(t,(d,f)=>{let{darkColor:p}=f;return{[`&${e}-${d}`]:{[`${e}-inner`]:{backgroundColor:p},[`${e}-arrow`]:{"--antd-arrow-background-color":p}}}})),{"&-rtl":{direction:"rtl"}})},Lme(t,"var(--antd-arrow-background-color)"),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:t.sizePopupArrow}}]},IEt=t=>Object.assign(Object.assign({zIndexPopup:t.zIndexPopupBase+70},K$({contentRadius:t.borderRadius,limitVerticalRadius:!0})),J$(Ki(t,{borderRadiusOuter:Math.min(t.borderRadiusOuter,4)}))),GGe=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return wl("Tooltip",o=>{const{borderRadius:r,colorTextLightSolid:i,colorBgSpotlight:a}=o,l=Ki(o,{tooltipMaxWidth:250,tooltipColor:i,tooltipBorderRadius:r,tooltipBg:a});return[MEt(l),UW(o,"zoom-big-fast")]},IEt,{resetStyle:!1,injectStyle:e})(t)},zEt=ZF.map(t=>`${t}-inverse`),DEt=["success","processing","error","default","warning"];function q$(t){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(Za(zEt),Za(ZF)).includes(t):ZF.includes(t)}function EEt(t){return DEt.includes(t)}function XGe(t,e){const n=q$(e),o=Un({[`${t}-${e}`]:e&&n}),r={},i={};return e&&!n&&(r.background=e,i["--antd-arrow-background-color"]=e),{className:o,overlayStyle:r,arrowStyle:i}}const FEt=t=>{const{prefixCls:e,className:n,placement:o="top",title:r,color:i,overlayInnerStyle:a}=t,{getPrefixCls:l}=m.useContext(Cr),s=l("tooltip",e),[c,u,d]=GGe(s),f=XGe(s,i),p=f.arrowStyle,g=Object.assign(Object.assign({},a),f.overlayStyle),y=Un(u,d,s,`${s}-pure`,`${s}-placement-${o}`,n,f.className);return c(m.createElement("div",{className:y,style:p},m.createElement("div",{className:`${s}-arrow`}),m.createElement(kme,Object.assign({},t,{className:u,prefixCls:s,overlayInnerStyle:g}),r)))};var kEt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n,o;const{prefixCls:r,openClassName:i,getTooltipContainer:a,overlayClassName:l,color:s,overlayInnerStyle:c,children:u,afterOpenChange:d,afterVisibleChange:f,destroyTooltipOnHide:p,arrow:g=!0,title:y,overlay:w,builtinPlacements:b,arrowPointAtCenter:C=!1,autoAdjustOverflow:P=!0}=t,v=!!g,[,T]=_u(),{getPopupContainer:A,getPrefixCls:x,direction:S}=m.useContext(Cr),R=kb(),M=m.useRef(null),D=()=>{var ye;(ye=M.current)===null||ye===void 0||ye.forceAlign()};m.useImperativeHandle(e,()=>({forceAlign:D,forcePopupAlign:()=>{R.deprecated(!1,"forcePopupAlign","forceAlign"),D()}}));const[E,W]=$6(!1,{value:(n=t.open)!==null&&n!==void 0?n:t.visible,defaultValue:(o=t.defaultOpen)!==null&&o!==void 0?o:t.defaultVisible}),j=!y&&!w&&y!==0,L=ye=>{var ce,pe;W(j?!1:ye),j||((ce=t.onOpenChange)===null||ce===void 0||ce.call(t,ye),(pe=t.onVisibleChange)===null||pe===void 0||pe.call(t,ye))},k=m.useMemo(()=>{var ye,ce;let pe=C;return typeof g=="object"&&(pe=(ce=(ye=g.pointAtCenter)!==null&&ye!==void 0?ye:g.arrowPointAtCenter)!==null&&ce!==void 0?ce:C),b||VGe({arrowPointAtCenter:pe,autoAdjustOverflow:P,arrowWidth:v?T.sizePopupArrow:0,borderRadius:T.borderRadius,offset:T.marginXXS,visibleFirst:!0})},[C,g,b,T]),N=m.useMemo(()=>y===0?y:w||y||"",[w,y]),F=m.createElement(Y9,null,typeof N=="function"?N():N),{getPopupContainer:U,placement:O="top",mouseEnterDelay:B=.1,mouseLeaveDelay:_=.1,overlayStyle:X,rootClassName:$}=t,Q=kEt(t,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),le=x("tooltip",r),q=x(),te=t["data-popover-inject"];let re=E;!("open"in t)&&!("visible"in t)&&j&&(re=!1);const ae=m.isValidElement(u)&&!gVe(u)?u:m.createElement("span",null,u),se=ae.props,ne=!se.className||typeof se.className=="string"?Un(se.className,i||`${le}-open`):se.className,[fe,ge,de]=GGe(le,!te),Z=XGe(le,s),he=Z.arrowStyle,xe=Object.assign(Object.assign({},c),Z.overlayStyle),He=Un(l,{[`${le}-rtl`]:S==="rtl"},Z.className,$,ge,de),[Se,ze]=Ww("Tooltip",Q.zIndex),Ie=m.createElement(PEt,Object.assign({},Q,{zIndex:Se,showArrow:v,placement:O,mouseEnterDelay:B,mouseLeaveDelay:_,prefixCls:le,overlayClassName:He,overlayStyle:Object.assign(Object.assign({},he),X),getTooltipContainer:U||a||A,ref:M,builtinPlacements:k,overlay:F,visible:re,onVisibleChange:L,afterVisibleChange:d??f,overlayInnerStyle:xe,arrowContent:m.createElement("span",{className:`${le}-arrow-content`}),motion:{motionName:j9(q,"zoom-big-fast",t.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!p}),re?B0(ae,{className:ne}):ae);return fe(m.createElement(zW.Provider,{value:ze},Ie))}),tA=LEt;tA._InternalPanelDoNotUseOrYouWillBeFired=FEt;const WEt=t=>{const{componentCls:e,popoverColor:n,titleMinWidth:o,fontWeightStrong:r,innerPadding:i,boxShadowSecondary:a,colorTextHeading:l,borderRadiusLG:s,zIndexPopup:c,titleMarginBottom:u,colorBgElevated:d,popoverBg:f,titleBorderBottom:p,innerContentPadding:g,titlePadding:y}=t;return[{[e]:Object.assign(Object.assign({},ja(t)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":d,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${e}-content`]:{position:"relative"},[`${e}-inner`]:{backgroundColor:f,backgroundClip:"padding-box",borderRadius:s,boxShadow:a,padding:i},[`${e}-title`]:{minWidth:o,marginBottom:u,color:l,fontWeight:r,borderBottom:p,padding:y},[`${e}-inner-content`]:{color:n,padding:g}})},Lme(t,"var(--antd-arrow-background-color)"),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:t.sizePopupArrow,display:"inline-block",[`${e}-content`]:{display:"inline-block"}}}]},NEt=t=>{const{componentCls:e}=t;return{[e]:ZF.map(n=>{const o=t[`${n}6`];return{[`&${e}-${n}`]:{"--antd-arrow-background-color":o,[`${e}-inner`]:{backgroundColor:o},[`${e}-arrow`]:{background:"transparent"}}}})}},UEt=t=>{const{lineWidth:e,controlHeight:n,fontHeight:o,padding:r,wireframe:i,zIndexPopupBase:a,borderRadiusLG:l,marginXS:s,lineType:c,colorSplit:u,paddingSM:d}=t,f=n-o,p=f/2,g=f/2-e,y=r;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:a+30},J$(t)),K$({contentRadius:l,limitVerticalRadius:!0})),{innerPadding:i?0:12,titleMarginBottom:i?0:s,titlePadding:i?`${p}px ${y}px ${g}px`:0,titleBorderBottom:i?`${e}px ${c} ${u}`:"none",innerContentPadding:i?`${d}px ${y}px`:0})},JGe=wl("Popover",t=>{const{colorBgElevated:e,colorText:n}=t,o=Ki(t,{popoverBg:e,popoverColor:n});return[WEt(o),NEt(o),UW(o,"zoom-big")]},UEt,{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});var jEt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r!e&&!n?null:m.createElement(m.Fragment,null,e&&m.createElement("div",{className:`${t}-title`},WG(e)),m.createElement("div",{className:`${t}-inner-content`},WG(n))),YEt=t=>{const{hashId:e,prefixCls:n,className:o,style:r,placement:i="top",title:a,content:l,children:s}=t;return m.createElement("div",{className:Un(e,n,`${n}-pure`,`${n}-placement-${i}`,o),style:r},m.createElement("div",{className:`${n}-arrow`}),m.createElement(kme,Object.assign({},t,{className:e,prefixCls:n}),s||BEt(n,a,l)))},OEt=t=>{const{prefixCls:e,className:n}=t,o=jEt(t,["prefixCls","className"]),{getPrefixCls:r}=m.useContext(Cr),i=r("popover",e),[a,l,s]=JGe(i);return a(m.createElement(YEt,Object.assign({},o,{prefixCls:i,hashId:l,className:Un(n,s)})))};var _Et=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{let{title:e,content:n,prefixCls:o}=t;return m.createElement(m.Fragment,null,e&&m.createElement("div",{className:`${o}-title`},WG(e)),m.createElement("div",{className:`${o}-inner-content`},WG(n)))},GEt=m.forwardRef((t,e)=>{var n,o;const{prefixCls:r,title:i,content:a,overlayClassName:l,placement:s="top",trigger:c="hover",children:u,mouseEnterDelay:d=.1,mouseLeaveDelay:f=.1,onOpenChange:p,overlayStyle:g={}}=t,y=_Et(t,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle"]),{getPrefixCls:w}=m.useContext(Cr),b=w("popover",r),[C,P,v]=JGe(b),T=w(),A=Un(l,P,v),[x,S]=$6(!1,{value:(n=t.open)!==null&&n!==void 0?n:t.visible,defaultValue:(o=t.defaultOpen)!==null&&o!==void 0?o:t.defaultVisible}),R=(E,W)=>{S(E,!0),p==null||p(E,W)},M=E=>{E.keyCode===fi.ESC&&R(!1,E)},D=E=>{R(E)};return C(m.createElement(tA,Object.assign({placement:s,trigger:c,mouseEnterDelay:d,mouseLeaveDelay:f,overlayStyle:g},y,{prefixCls:b,overlayClassName:A,ref:e,open:x,onOpenChange:D,overlay:i||a?m.createElement(VEt,{prefixCls:b,title:i,content:a}):null,transitionName:j9(T,"zoom-big",y.transitionName),"data-popover-inject":!0}),B0(u,{onKeyDown:E=>{var W,j;m.isValidElement(u)&&((j=u==null?void 0:(W=u.props).onKeyDown)===null||j===void 0||j.call(W,E)),M(E)}})))}),Al=GEt;Al._InternalPanelDoNotUseOrYouWillBeFired=OEt;const Uve=t=>{const{size:e,shape:n}=m.useContext(Q0e),o=m.useMemo(()=>({size:t.size||e,shape:t.shape||n}),[t.size,t.shape,e,n]);return m.createElement(Q0e.Provider,{value:o},t.children)},XEt=t=>{const{getPrefixCls:e,direction:n}=m.useContext(Cr),{prefixCls:o,className:r,rootClassName:i,style:a,maxCount:l,maxStyle:s,size:c,shape:u,maxPopoverPlacement:d="top",maxPopoverTrigger:f="hover",children:p}=t,g=e("avatar",o),y=`${g}-group`,w=O0(g),[b,C,P]=BGe(g,w),v=Un(y,{[`${y}-rtl`]:n==="rtl"},P,w,r,i,C),T=B9(p).map((x,S)=>B0(x,{key:`avatar-key-${S}`})),A=T.length;if(l&&l{const{componentCls:e,iconCls:n,antCls:o,badgeShadowSize:r,motionDurationSlow:i,textFontSize:a,textFontSizeSM:l,statusSize:s,dotSize:c,textFontWeight:u,indicatorHeight:d,indicatorHeightSM:f,marginXS:p,calc:g}=t,y=`${o}-scroll-number`,w=D$(t,(b,C)=>{let{darkColor:P}=C;return{[`&${e} ${e}-color-${b}`]:{background:P,[`&:not(${e}-count)`]:{color:P},"a:hover &":{background:P}}}});return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${e}-count`]:{display:"inline-flex",justifyContent:"center",zIndex:t.indicatorZIndex,minWidth:d,height:d,color:t.badgeTextColor,fontWeight:u,fontSize:a,lineHeight:Nt(d),whiteSpace:"nowrap",textAlign:"center",background:t.badgeColor,borderRadius:g(d).div(2).equal(),boxShadow:`0 0 0 ${Nt(r)} ${t.badgeShadowColor}`,transition:`background ${t.motionDurationMid}`,a:{color:t.badgeTextColor},"a:hover":{color:t.badgeTextColor},"a:hover &":{background:t.badgeColorHover}},[`${e}-count-sm`]:{minWidth:f,height:f,fontSize:l,lineHeight:Nt(f),borderRadius:g(f).div(2).equal()},[`${e}-multiple-words`]:{padding:`0 ${Nt(t.paddingXS)}`,bdi:{unicodeBidi:"plaintext"}},[`${e}-dot`]:{zIndex:t.indicatorZIndex,width:c,minWidth:c,height:c,background:t.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${Nt(r)} ${t.badgeShadowColor}`},[`${e}-dot${y}`]:{transition:`background ${i}`},[`${e}-count, ${e}-dot, ${y}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${n}-spin`]:{animationName:nFt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${e}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${e}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:s,height:s,verticalAlign:"middle",borderRadius:"50%"},[`${e}-status-success`]:{backgroundColor:t.colorSuccess},[`${e}-status-processing`]:{overflow:"visible",color:t.colorInfo,backgroundColor:t.colorInfo,"&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:r,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:$Et,animationDuration:t.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${e}-status-default`]:{backgroundColor:t.colorTextPlaceholder},[`${e}-status-error`]:{backgroundColor:t.colorError},[`${e}-status-warning`]:{backgroundColor:t.colorWarning},[`${e}-status-text`]:{marginInlineStart:p,color:t.colorText,fontSize:t.fontSize}}}),w),{[`${e}-zoom-appear, ${e}-zoom-enter`]:{animationName:QEt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`${e}-zoom-leave`]:{animationName:ZEt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`&${e}-not-a-wrapper`]:{[`${e}-zoom-appear, ${e}-zoom-enter`]:{animationName:eFt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`${e}-zoom-leave`]:{animationName:tFt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`&:not(${e}-status)`]:{verticalAlign:"middle"},[`${y}-custom-component, ${e}-count`]:{transform:"none"},[`${y}-custom-component, ${y}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[`${y}`]:{overflow:"hidden",[`${y}-only`]:{position:"relative",display:"inline-block",height:d,transition:`all ${t.motionDurationSlow} ${t.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${y}-only-unit`]:{height:d,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${y}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${e}-count, ${e}-dot, ${y}-custom-component`]:{transform:"translate(-50%, -50%)"}}})}},qGe=t=>{const{fontHeight:e,lineWidth:n,marginXS:o,colorBorderBg:r}=t,i=e,a=n,l=t.colorBgContainer,s=t.colorError,c=t.colorErrorHover;return Ki(t,{badgeFontHeight:i,badgeShadowSize:a,badgeTextColor:l,badgeColor:s,badgeColorHover:c,badgeShadowColor:r,badgeProcessingDuration:"1.2s",badgeRibbonOffset:o,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},$Ge=t=>{const{fontSize:e,lineHeight:n,fontSizeSM:o,lineWidth:r}=t;return{indicatorZIndex:"auto",indicatorHeight:Math.round(e*n)-2*r,indicatorHeightSM:e,dotSize:o/2,textFontSize:o,textFontSizeSM:o,textFontWeight:"normal",statusSize:o/2}},rFt=wl("Badge",t=>{const e=qGe(t);return oFt(e)},$Ge),iFt=t=>{const{antCls:e,badgeFontHeight:n,marginXS:o,badgeRibbonOffset:r,calc:i}=t,a=`${e}-ribbon`,l=`${e}-ribbon-wrapper`,s=D$(t,(c,u)=>{let{darkColor:d}=u;return{[`&${a}-color-${c}`]:{background:d,color:d}}});return{[`${l}`]:{position:"relative"},[`${a}`]:Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{position:"absolute",top:o,padding:`0 ${Nt(t.paddingXS)}`,color:t.colorPrimary,lineHeight:Nt(n),whiteSpace:"nowrap",backgroundColor:t.colorPrimary,borderRadius:t.borderRadiusSM,[`${a}-text`]:{color:t.colorTextLightSolid},[`${a}-corner`]:{position:"absolute",top:"100%",width:r,height:r,color:"currentcolor",border:`${Nt(i(r).div(2).equal())} solid`,transform:t.badgeRibbonCornerTransform,transformOrigin:"top",filter:t.badgeRibbonCornerFilter}}),s),{[`&${a}-placement-end`]:{insetInlineEnd:i(r).mul(-1).equal(),borderEndEndRadius:0,[`${a}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${a}-placement-start`]:{insetInlineStart:i(r).mul(-1).equal(),borderEndStartRadius:0,[`${a}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}},aFt=wl(["Badge","Ribbon"],t=>{const e=qGe(t);return iFt(e)},$Ge),lFt=t=>{const{className:e,prefixCls:n,style:o,color:r,children:i,text:a,placement:l="end",rootClassName:s}=t,{getPrefixCls:c,direction:u}=m.useContext(Cr),d=c("ribbon",n),f=`${d}-wrapper`,[p,g,y]=aFt(d,f),w=q$(r,!1),b=Un(d,`${d}-placement-${l}`,{[`${d}-rtl`]:u==="rtl",[`${d}-color-${r}`]:w},e),C={},P={};return r&&!w&&(C.background=r,P.color=r),p(m.createElement("div",{className:Un(f,s,g,y)},i,m.createElement("div",{className:Un(b,g),style:Object.assign(Object.assign({},C),o)},m.createElement("span",{className:`${d}-text`},a),m.createElement("div",{className:`${d}-corner`,style:P}))))};function jve(t){let{prefixCls:e,value:n,current:o,offset:r=0}=t,i;return r&&(i={position:"absolute",top:`${r}00%`,left:0}),m.createElement("span",{style:i,className:Un(`${e}-only-unit`,{current:o})},n)}function sFt(t,e,n){let o=t,r=0;for(;(o+10)%10!==e;)o+=n,r+=n;return r}function cFt(t){const{prefixCls:e,count:n,value:o}=t,r=Number(o),i=Math.abs(n),[a,l]=m.useState(r),[s,c]=m.useState(i),u=()=>{l(r),c(i)};m.useEffect(()=>{const p=setTimeout(()=>{u()},1e3);return()=>{clearTimeout(p)}},[r]);let d,f;if(a===r||Number.isNaN(r)||Number.isNaN(a))d=[m.createElement(jve,Object.assign({},t,{key:r,current:!0}))],f={transition:"none"};else{d=[];const p=r+10,g=[];for(let b=r;b<=p;b+=1)g.push(b);const y=g.findIndex(b=>b%10===a);d=g.map((b,C)=>{const P=b%10;return m.createElement(jve,Object.assign({},t,{key:b,value:P,offset:C-y,current:C===y}))});const w=s{const{prefixCls:n,count:o,className:r,motionClassName:i,style:a,title:l,show:s,component:c="sup",children:u}=t,d=uFt(t,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:f}=m.useContext(Cr),p=f("scroll-number",n),g=Object.assign(Object.assign({},d),{"data-show":s,style:a,className:Un(p,r,i),title:l});let y=o;if(o&&Number(o)%1===0){const w=String(o).split("");y=m.createElement("bdi",null,w.map((b,C)=>m.createElement(cFt,{prefixCls:p,count:Number(o),value:b,key:w.length-C})))}return a&&a.borderColor&&(g.style=Object.assign(Object.assign({},a),{boxShadow:`0 0 0 1px ${a.borderColor} inset`})),u?B0(u,w=>({className:Un(`${p}-custom-component`,w==null?void 0:w.className,i)})):m.createElement(c,Object.assign({},g,{ref:e}),y)});var fFt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n,o,r,i,a;const{prefixCls:l,scrollNumberPrefixCls:s,children:c,status:u,text:d,color:f,count:p=null,overflowCount:g=99,dot:y=!1,size:w="default",title:b,offset:C,style:P,className:v,rootClassName:T,classNames:A,styles:x,showZero:S=!1}=t,R=fFt(t,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:M,direction:D,badge:E}=m.useContext(Cr),W=M("badge",l),[j,L,k]=rFt(W),N=p>g?`${g}+`:p,F=N==="0"||N===0,U=p===null||F&&!S,O=(u!=null||f!=null)&&U,B=y&&!F,_=B?"":N,X=m.useMemo(()=>(_==null||_===""||F&&!S)&&!B,[_,F,S,B]),$=m.useRef(p);X||($.current=p);const Q=$.current,le=m.useRef(_);X||(le.current=_);const q=le.current,te=m.useRef(B);X||(te.current=B);const re=m.useMemo(()=>{if(!C)return Object.assign(Object.assign({},E==null?void 0:E.style),P);const he={marginTop:C[1]};return D==="rtl"?he.left=parseInt(C[0],10):he.right=-parseInt(C[0],10),Object.assign(Object.assign(Object.assign({},he),E==null?void 0:E.style),P)},[D,C,P,E==null?void 0:E.style]),ae=b??(typeof Q=="string"||typeof Q=="number"?Q:void 0),se=X||!d?null:m.createElement("span",{className:`${W}-status-text`},d),ne=!Q||typeof Q!="object"?void 0:B0(Q,he=>({style:Object.assign(Object.assign({},re),he.style)})),fe=q$(f,!1),ge=Un(A==null?void 0:A.indicator,(n=E==null?void 0:E.classNames)===null||n===void 0?void 0:n.indicator,{[`${W}-status-dot`]:O,[`${W}-status-${u}`]:!!u,[`${W}-color-${f}`]:fe}),de={};f&&!fe&&(de.color=f,de.background=f);const Z=Un(W,{[`${W}-status`]:O,[`${W}-not-a-wrapper`]:!c,[`${W}-rtl`]:D==="rtl"},v,T,E==null?void 0:E.className,(o=E==null?void 0:E.classNames)===null||o===void 0?void 0:o.root,A==null?void 0:A.root,L,k);if(!c&&O){const he=re.color;return j(m.createElement("span",Object.assign({},R,{className:Z,style:Object.assign(Object.assign(Object.assign({},x==null?void 0:x.root),(r=E==null?void 0:E.styles)===null||r===void 0?void 0:r.root),re)}),m.createElement("span",{className:ge,style:Object.assign(Object.assign(Object.assign({},x==null?void 0:x.indicator),(i=E==null?void 0:E.styles)===null||i===void 0?void 0:i.indicator),de)}),d&&m.createElement("span",{style:{color:he},className:`${W}-status-text`},d)))}return j(m.createElement("span",Object.assign({ref:e},R,{className:Z,style:Object.assign(Object.assign({},(a=E==null?void 0:E.styles)===null||a===void 0?void 0:a.root),x==null?void 0:x.root)}),c,m.createElement(o1,{visible:!X,motionName:`${W}-zoom`,motionAppear:!1,motionDeadline:1e3},he=>{let{className:xe,ref:He}=he;var Se,ze;const Ie=M("scroll-number",s),ye=te.current,ce=Un(A==null?void 0:A.indicator,(Se=E==null?void 0:E.classNames)===null||Se===void 0?void 0:Se.indicator,{[`${W}-dot`]:ye,[`${W}-count`]:!ye,[`${W}-count-sm`]:w==="small",[`${W}-multiple-words`]:!ye&&q&&q.toString().length>1,[`${W}-status-${u}`]:!!u,[`${W}-color-${f}`]:fe});let pe=Object.assign(Object.assign(Object.assign({},x==null?void 0:x.indicator),(ze=E==null?void 0:E.styles)===null||ze===void 0?void 0:ze.indicator),re);return f&&!fe&&(pe=pe||{},pe.background=f),m.createElement(dFt,{prefixCls:Ie,show:!X,motionClassName:xe,className:ce,count:q,title:ae,style:pe,key:"scrollNumber",ref:He},ne)}),se))}),QGe=hFt;QGe.Ribbon=lFt;var pFt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},gFt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:pFt}))},NG=m.forwardRef(gFt),mFt=Bn.ESC,yFt=Bn.TAB;function AFt(t){var e=t.visible,n=t.triggerRef,o=t.onVisibleChange,r=t.autoFocus,i=t.overlayRef,a=m.useRef(!1),l=function(){if(e){var d,f;(d=n.current)===null||d===void 0||(f=d.focus)===null||f===void 0||f.call(d),o==null||o(!1)}},s=function(){var d;return(d=i.current)!==null&&d!==void 0&&d.focus?(i.current.focus(),a.current=!0,!0):!1},c=function(d){switch(d.keyCode){case mFt:l();break;case yFt:{var f=!1;a.current||(f=s()),f?d.preventDefault():l();break}}};m.useEffect(function(){return e?(window.addEventListener("keydown",c),r&&Fa(s,3),function(){window.removeEventListener("keydown",c),a.current=!1}):function(){a.current=!1}},[e])}var wFt=m.forwardRef(function(t,e){var n=t.overlay,o=t.arrow,r=t.prefixCls,i=m.useMemo(function(){var l;return typeof n=="function"?l=n():l=n,l},[n]),a=Fb(e,i==null?void 0:i.ref);return be.createElement(be.Fragment,null,o&&be.createElement("div",{className:"".concat(r,"-arrow")}),be.cloneElement(i,{ref:rw(i)?a:void 0}))}),ET={adjustX:1,adjustY:1},FT=[0,0],vFt={topLeft:{points:["bl","tl"],overflow:ET,offset:[0,-4],targetOffset:FT},top:{points:["bc","tc"],overflow:ET,offset:[0,-4],targetOffset:FT},topRight:{points:["br","tr"],overflow:ET,offset:[0,-4],targetOffset:FT},bottomLeft:{points:["tl","bl"],overflow:ET,offset:[0,4],targetOffset:FT},bottom:{points:["tc","bc"],overflow:ET,offset:[0,4],targetOffset:FT},bottomRight:{points:["tr","br"],overflow:ET,offset:[0,4],targetOffset:FT}},xFt=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function bFt(t,e){var n,o=t.arrow,r=o===void 0?!1:o,i=t.prefixCls,a=i===void 0?"rc-dropdown":i,l=t.transitionName,s=t.animation,c=t.align,u=t.placement,d=u===void 0?"bottomLeft":u,f=t.placements,p=f===void 0?vFt:f,g=t.getPopupContainer,y=t.showAction,w=t.hideAction,b=t.overlayClassName,C=t.overlayStyle,P=t.visible,v=t.trigger,T=v===void 0?["hover"]:v,A=t.autoFocus,x=t.overlay,S=t.children,R=t.onVisibleChange,M=ii(t,xFt),D=be.useState(),E=ln(D,2),W=E[0],j=E[1],L="visible"in t?P:W,k=be.useRef(null),N=be.useRef(null),F=be.useRef(null);be.useImperativeHandle(e,function(){return k.current});var U=function(te){j(te),R==null||R(te)};AFt({visible:L,triggerRef:F,onVisibleChange:U,autoFocus:A,overlayRef:N});var O=function(te){var re=t.onOverlayClick;j(!1),re&&re(te)},B=function(){return be.createElement(wFt,{ref:N,overlay:x,prefixCls:a,arrow:r})},_=function(){return typeof x=="function"?B:B()},X=function(){var te=t.minOverlayWidthMatchTrigger,re=t.alignPoint;return"minOverlayWidthMatchTrigger"in t?te:!re},$=function(){var te=t.openClassName;return te!==void 0?te:"".concat(a,"-open")},Q=be.cloneElement(S,{className:Vn((n=S.props)===null||n===void 0?void 0:n.className,L&&$()),ref:rw(S)?Fb(F,S.ref):void 0}),le=w;return!le&&T.indexOf("contextMenu")!==-1&&(le=["click"]),be.createElement(OW,ho({builtinPlacements:p},M,{prefixCls:a,ref:k,popupClassName:Vn(b,Vt({},"".concat(a,"-show-arrow"),r)),popupStyle:C,action:T,showAction:y,hideAction:le,popupPlacement:d,popupAlign:c,popupTransitionName:l,popupAnimation:s,popupVisible:L,stretch:X()?"minWidth":"",popup:_(),onPopupVisibleChange:U,onPopupClick:O,getPopupContainer:g}),Q)}const ZGe=be.forwardRef(bFt);var eXe=m.createContext(null);function tXe(t,e){return t===void 0?null:"".concat(t,"-").concat(e)}function nXe(t){var e=m.useContext(eXe);return tXe(e,t)}var SFt=["children","locked"],G2=m.createContext(null);function TFt(t,e){var n=qt({},t);return Object.keys(e).forEach(function(o){var r=e[o];r!==void 0&&(n[o]=r)}),n}function sk(t){var e=t.children,n=t.locked,o=ii(t,SFt),r=m.useContext(G2),i=CW(function(){return TFt(r,o)},[r,o],function(a,l){return!n&&(a[0]!==l[0]||!iw(a[1],l[1],!0))});return m.createElement(G2.Provider,{value:i},e)}var PFt=[],oXe=m.createContext(null);function $$(){return m.useContext(oXe)}var rXe=m.createContext(PFt);function YH(t){var e=m.useContext(rXe);return m.useMemo(function(){return t!==void 0?[].concat(Lo(e),[t]):e},[e,t])}var iXe=m.createContext(null),Wme=m.createContext({});function Bve(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(V$(t)){var n=t.nodeName.toLowerCase(),o=["input","select","textarea","button"].includes(n)||t.isContentEditable||n==="a"&&!!t.getAttribute("href"),r=t.getAttribute("tabindex"),i=Number(r),a=null;return r&&!Number.isNaN(i)?a=i:o&&a===null&&(a=0),o&&t.disabled&&(a=null),a!==null&&(a>=0||e&&a<0)}return!1}function CFt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=Lo(t.querySelectorAll("*")).filter(function(o){return Bve(o,e)});return Bve(t,e)&&n.unshift(t),n}var eue=Bn.LEFT,tue=Bn.RIGHT,nue=Bn.UP,G_=Bn.DOWN,X_=Bn.ENTER,aXe=Bn.ESC,Fz=Bn.HOME,kz=Bn.END,Yve=[nue,G_,eue,tue];function RFt(t,e,n,o){var r,i="prev",a="next",l="children",s="parent";if(t==="inline"&&o===X_)return{inlineTrigger:!0};var c=Vt(Vt({},nue,i),G_,a),u=Vt(Vt(Vt(Vt({},eue,n?a:i),tue,n?i:a),G_,l),X_,l),d=Vt(Vt(Vt(Vt(Vt(Vt({},nue,i),G_,a),X_,l),aXe,s),eue,n?l:s),tue,n?s:l),f={inline:c,horizontal:u,vertical:d,inlineSub:c,horizontalSub:d,verticalSub:d},p=(r=f["".concat(t).concat(e?"":"Sub")])===null||r===void 0?void 0:r[o];switch(p){case i:return{offset:-1,sibling:!0};case a:return{offset:1,sibling:!0};case s:return{offset:-1,sibling:!1};case l:return{offset:1,sibling:!1};default:return null}}function HFt(t){for(var e=t;e;){if(e.getAttribute("data-menu-list"))return e;e=e.parentElement}return null}function MFt(t,e){for(var n=t||document.activeElement;n;){if(e.has(n))return n;n=n.parentElement}return null}function Nme(t,e){var n=CFt(t,!0);return n.filter(function(o){return e.has(o)})}function Ove(t,e,n){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!t)return null;var r=Nme(t,e),i=r.length,a=r.findIndex(function(l){return n===l});return o<0?a===-1?a=i-1:a-=1:o>0&&(a+=1),a=(a+i)%i,r[a]}var oue=function(e,n){var o=new Set,r=new Map,i=new Map;return e.forEach(function(a){var l=document.querySelector("[data-menu-id='".concat(tXe(n,a),"']"));l&&(o.add(l),i.set(l,a),r.set(a,l))}),{elements:o,key2element:r,element2key:i}};function IFt(t,e,n,o,r,i,a,l,s,c){var u=m.useRef(),d=m.useRef();d.current=e;var f=function(){Fa.cancel(u.current)};return m.useEffect(function(){return function(){f()}},[]),function(p){var g=p.which;if([].concat(Yve,[X_,aXe,Fz,kz]).includes(g)){var y=i(),w=oue(y,o),b=w,C=b.elements,P=b.key2element,v=b.element2key,T=P.get(e),A=MFt(T,C),x=v.get(A),S=RFt(t,a(x,!0).length===1,n,g);if(!S&&g!==Fz&&g!==kz)return;(Yve.includes(g)||[Fz,kz].includes(g))&&p.preventDefault();var R=function(N){if(N){var F=N,U=N.querySelector("a");U!=null&&U.getAttribute("href")&&(F=U);var O=v.get(N);l(O),f(),u.current=Fa(function(){d.current===O&&F.focus()})}};if([Fz,kz].includes(g)||S.sibling||!A){var M;!A||t==="inline"?M=r.current:M=HFt(A);var D,E=Nme(M,C);g===Fz?D=E[0]:g===kz?D=E[E.length-1]:D=Ove(M,C,A,S.offset),R(D)}else if(S.inlineTrigger)s(x);else if(S.offset>0)s(x,!0),f(),u.current=Fa(function(){w=oue(y,o);var k=A.getAttribute("aria-controls"),N=document.getElementById(k),F=Ove(N,w.elements);R(F)},5);else if(S.offset<0){var W=a(x,!0),j=W[W.length-2],L=P.get(j);s(j,!1),R(L)}}c==null||c(p)}}function zFt(t){Promise.resolve().then(t)}var Ume="__RC_UTIL_PATH_SPLIT__",_ve=function(e){return e.join(Ume)},DFt=function(e){return e.split(Ume)},rue="rc-menu-more";function EFt(){var t=m.useState({}),e=ln(t,2),n=e[1],o=m.useRef(new Map),r=m.useRef(new Map),i=m.useState([]),a=ln(i,2),l=a[0],s=a[1],c=m.useRef(0),u=m.useRef(!1),d=function(){u.current||n({})},f=m.useCallback(function(P,v){var T=_ve(v);r.current.set(T,P),o.current.set(P,T),c.current+=1;var A=c.current;zFt(function(){A===c.current&&d()})},[]),p=m.useCallback(function(P,v){var T=_ve(v);r.current.delete(T),o.current.delete(P)},[]),g=m.useCallback(function(P){s(P)},[]),y=m.useCallback(function(P,v){var T=o.current.get(P)||"",A=DFt(T);return v&&l.includes(A[0])&&A.unshift(rue),A},[l]),w=m.useCallback(function(P,v){return P.some(function(T){var A=y(T,!0);return A.includes(v)})},[y]),b=function(){var v=Lo(o.current.keys());return l.length&&v.push(rue),v},C=m.useCallback(function(P){var v="".concat(o.current.get(P)).concat(Ume),T=new Set;return Lo(r.current.keys()).forEach(function(A){A.startsWith(v)&&T.add(r.current.get(A))}),T},[]);return m.useEffect(function(){return function(){u.current=!0}},[]),{registerPath:f,unregisterPath:p,refreshOverflowKeys:g,isSubPathKey:w,getKeyPath:y,getKeys:b,getSubPathKeys:C}}function HD(t){var e=m.useRef(t);e.current=t;var n=m.useCallback(function(){for(var o,r=arguments.length,i=new Array(r),a=0;a1&&(C.motionAppear=!1);var P=C.onVisibleChanged;return C.onVisibleChanged=function(v){return!f.current&&!v&&w(!0),P==null?void 0:P(v)},y?null:m.createElement(sk,{mode:i,locked:!f.current},m.createElement(o1,ho({visible:b},C,{forceRender:s,removeOnLeave:!1,leavedClassName:"".concat(l,"-hidden")}),function(v){var T=v.className,A=v.style;return m.createElement(jme,{id:e,className:T,style:A},r)}))}var qFt=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],$Ft=["active"],QFt=function(e){var n=e.style,o=e.className,r=e.title,i=e.eventKey;e.warnKey;var a=e.disabled,l=e.internalPopupClose,s=e.children,c=e.itemIcon,u=e.expandIcon,d=e.popupClassName,f=e.popupOffset,p=e.popupStyle,g=e.onClick,y=e.onMouseEnter,w=e.onMouseLeave,b=e.onTitleClick,C=e.onTitleMouseEnter,P=e.onTitleMouseLeave,v=ii(e,qFt),T=nXe(i),A=m.useContext(G2),x=A.prefixCls,S=A.mode,R=A.openKeys,M=A.disabled,D=A.overflowDisabled,E=A.activeKey,W=A.selectedKeys,j=A.itemIcon,L=A.expandIcon,k=A.onItemClick,N=A.onOpenChange,F=A.onActive,U=m.useContext(Wme),O=U._internalRenderSubMenuItem,B=m.useContext(iXe),_=B.isSubPathKey,X=YH(),$="".concat(x,"-submenu"),Q=M||a,le=m.useRef(),q=m.useRef(),te=c??j,re=u??L,ae=R.includes(i),se=!D&&ae,ne=_(W,i),fe=lXe(i,Q,C,P),ge=fe.active,de=ii(fe,$Ft),Z=m.useState(!1),he=ln(Z,2),xe=he[0],He=he[1],Se=function(Ke){Q||He(Ke)},ze=function(Ke){Se(!0),y==null||y({key:i,domEvent:Ke})},Ie=function(Ke){Se(!1),w==null||w({key:i,domEvent:Ke})},ye=m.useMemo(function(){return ge||(S!=="inline"?xe||_([E],i):!1)},[S,ge,E,xe,i,_]),ce=sXe(X.length),pe=function(Ke){Q||(b==null||b({key:i,domEvent:Ke}),S==="inline"&&N(i,!ae))},ve=HD(function(We){g==null||g(UG(We)),k(We)}),Ae=function(Ke){S!=="inline"&&N(i,Ke)},Te=function(){F(i)},Me=T&&"".concat(T,"-popup"),Pe=m.createElement("div",ho({role:"menuitem",style:ce,className:"".concat($,"-title"),tabIndex:Q?null:-1,ref:le,title:typeof r=="string"?r:null,"data-menu-id":D&&T?null:T,"aria-expanded":se,"aria-haspopup":!0,"aria-controls":Me,"aria-disabled":Q,onClick:pe,onFocus:Te},de),r,m.createElement(cXe,{icon:S!=="horizontal"?re:void 0,props:qt(qt({},e),{},{isOpen:se,isSubMenu:!0})},m.createElement("i",{className:"".concat($,"-arrow")}))),Ee=m.useRef(S);if(S!=="inline"&&X.length>1?Ee.current="vertical":Ee.current=S,!D){var Be=Ee.current;Pe=m.createElement(JFt,{mode:Be,prefixCls:$,visible:!l&&se&&S!=="inline",popupClassName:d,popupOffset:f,popupStyle:p,popup:m.createElement(sk,{mode:Be==="horizontal"?"vertical":Be},m.createElement(jme,{id:Me,ref:q},s)),disabled:Q,onVisibleChange:Ae},Pe)}var Je=m.createElement(k2.Item,ho({role:"none"},v,{component:"li",style:n,className:Vn($,"".concat($,"-").concat(S),o,Vt(Vt(Vt(Vt({},"".concat($,"-open"),se),"".concat($,"-active"),ye),"".concat($,"-selected"),ne),"".concat($,"-disabled"),Q)),onMouseEnter:ze,onMouseLeave:Ie}),Pe,!D&&m.createElement(KFt,{id:Me,open:se,keyPath:X},s));return O&&(Je=O(Je,e,{selected:ne,active:ye,open:se,disabled:Q})),m.createElement(sk,{onItemClick:ve,mode:S==="horizontal"?"vertical":S,itemIcon:te,expandIcon:re},Je)};function Q$(t){var e=t.eventKey,n=t.children,o=YH(e),r=Bme(n,o),i=$$();m.useEffect(function(){if(i)return i.registerPath(e,o),function(){i.unregisterPath(e,o)}},[o]);var a;return i?a=r:a=m.createElement(QFt,t,r),m.createElement(rXe.Provider,{value:o},a)}var ZFt=["className","title","eventKey","children"],ekt=["children"],tkt=function(e){var n=e.className,o=e.title;e.eventKey;var r=e.children,i=ii(e,ZFt),a=m.useContext(G2),l=a.prefixCls,s="".concat(l,"-item-group");return m.createElement("li",ho({role:"presentation"},i,{onClick:function(u){return u.stopPropagation()},className:Vn(s,n)}),m.createElement("div",{role:"presentation",className:"".concat(s,"-title"),title:typeof o=="string"?o:void 0},o),m.createElement("ul",{role:"group",className:"".concat(s,"-list")},r))};function Z$(t){var e=t.children,n=ii(t,ekt),o=YH(n.eventKey),r=Bme(e,o),i=$$();return i?r:m.createElement(tkt,jH(n,["warnKey"]),r)}function Yme(t){var e=t.className,n=t.style,o=m.useContext(G2),r=o.prefixCls,i=$$();return i?null:m.createElement("li",{role:"separator",className:Vn("".concat(r,"-item-divider"),e),style:n})}var nkt=["label","children","key","type"];function iue(t){return(t||[]).map(function(e,n){if(e&&hi(e)==="object"){var o=e,r=o.label,i=o.children,a=o.key,l=o.type,s=ii(o,nkt),c=a??"tmp-".concat(n);return i||l==="group"?l==="group"?m.createElement(Z$,ho({key:c},s,{title:r}),iue(i)):m.createElement(Q$,ho({key:c},s,{title:r}),iue(i)):l==="divider"?m.createElement(Yme,ho({key:c},s)):m.createElement(_W,ho({key:c},s),r)}return null}).filter(function(e){return e})}function okt(t,e,n){var o=t;return e&&(o=iue(e)),Bme(o,n)}var rkt=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],kT=[],ikt=m.forwardRef(function(t,e){var n,o=t,r=o.prefixCls,i=r===void 0?"rc-menu":r,a=o.rootClassName,l=o.style,s=o.className,c=o.tabIndex,u=c===void 0?0:c,d=o.items,f=o.children,p=o.direction,g=o.id,y=o.mode,w=y===void 0?"vertical":y,b=o.inlineCollapsed,C=o.disabled,P=o.disabledOverflow,v=o.subMenuOpenDelay,T=v===void 0?.1:v,A=o.subMenuCloseDelay,x=A===void 0?.1:A,S=o.forceSubMenuRender,R=o.defaultOpenKeys,M=o.openKeys,D=o.activeKey,E=o.defaultActiveFirst,W=o.selectable,j=W===void 0?!0:W,L=o.multiple,k=L===void 0?!1:L,N=o.defaultSelectedKeys,F=o.selectedKeys,U=o.onSelect,O=o.onDeselect,B=o.inlineIndent,_=B===void 0?24:B,X=o.motion,$=o.defaultMotions,Q=o.triggerSubMenuAction,le=Q===void 0?"hover":Q,q=o.builtinPlacements,te=o.itemIcon,re=o.expandIcon,ae=o.overflowedIndicator,se=ae===void 0?"...":ae,ne=o.overflowedIndicatorPopupClassName,fe=o.getPopupContainer,ge=o.onClick,de=o.onOpenChange,Z=o.onKeyDown;o.openAnimation,o.openTransitionName;var he=o._internalRenderMenuItem,xe=o._internalRenderSubMenuItem,He=ii(o,rkt),Se=m.useMemo(function(){return okt(f,d,kT)},[f,d]),ze=m.useState(!1),Ie=ln(ze,2),ye=Ie[0],ce=Ie[1],pe=m.useRef(),ve=kFt(g),Ae=p==="rtl",Te=zs(R,{value:M,postState:function(mo){return mo||kT}}),Me=ln(Te,2),Pe=Me[0],Ee=Me[1],Be=function(mo){var Jn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function uo(){Ee(mo),de==null||de(mo)}Jn?Cd.flushSync(uo):uo()},Je=m.useState(Pe),We=ln(Je,2),Ke=We[0],Ne=We[1],De=m.useRef(!1),ke=m.useMemo(function(){return(w==="inline"||w==="vertical")&&b?["vertical",b]:[w,!1]},[w,b]),Ye=ln(ke,2),it=Ye[0],Ve=Ye[1],yt=it==="inline",ct=m.useState(it),Xe=ln(ct,2),ut=Xe[0],ft=Xe[1],ot=m.useState(Ve),st=ln(ot,2),at=st[0],Oe=st[1];m.useEffect(function(){ft(it),Oe(Ve),De.current&&(yt?Ee(Ke):Be(kT))},[it,Ve]);var Ze=m.useState(0),St=ln(Ze,2),Pt=St[0],Rt=St[1],Ut=Pt>=Se.length-1||ut!=="horizontal"||P;m.useEffect(function(){yt&&Ne(Pe)},[Pe]),m.useEffect(function(){return De.current=!0,function(){De.current=!1}},[]);var Ht=EFt(),At=Ht.registerPath,kt=Ht.unregisterPath,gt=Ht.refreshOverflowKeys,dt=Ht.isSubPathKey,Ct=Ht.getKeyPath,tt=Ht.getKeys,Fe=Ht.getSubPathKeys,qe=m.useMemo(function(){return{registerPath:At,unregisterPath:kt}},[At,kt]),je=m.useMemo(function(){return{isSubPathKey:dt}},[dt]);m.useEffect(function(){gt(Ut?kT:Se.slice(Pt+1).map(function($o){return $o.key}))},[Pt,Ut]);var rt=zs(D||E&&((n=Se[0])===null||n===void 0?void 0:n.key),{value:D}),mt=ln(rt,2),Qe=mt[0],Tt=mt[1],Dt=HD(function($o){Tt($o)}),lt=HD(function(){Tt(void 0)});m.useImperativeHandle(e,function(){return{list:pe.current,focus:function(mo){var Jn,uo=tt(),ir=oue(uo,ve),Rr=ir.elements,br=ir.key2element,Vr=ir.element2key,Wo=Nme(pe.current,Rr),wn=Qe??(Wo[0]?Vr.get(Wo[0]):(Jn=Se.find(function(No){return!No.props.disabled}))===null||Jn===void 0?void 0:Jn.key),In=br.get(wn);if(wn&&In){var ar;In==null||(ar=In.focus)===null||ar===void 0||ar.call(In,mo)}}}});var zt=zs(N||[],{value:F,postState:function(mo){return Array.isArray(mo)?mo:mo==null?kT:[mo]}}),Ft=ln(zt,2),_t=Ft[0],tn=Ft[1],Qt=function(mo){if(j){var Jn=mo.key,uo=_t.includes(Jn),ir;k?uo?ir=_t.filter(function(br){return br!==Jn}):ir=[].concat(Lo(_t),[Jn]):ir=[Jn],tn(ir);var Rr=qt(qt({},mo),{},{selectedKeys:ir});uo?O==null||O(Rr):U==null||U(Rr)}!k&&Pe.length&&ut!=="inline"&&Be(kT)},gn=HD(function($o){ge==null||ge(UG($o)),Qt($o)}),an=HD(function($o,mo){var Jn=Pe.filter(function(ir){return ir!==$o});if(mo)Jn.push($o);else if(ut!=="inline"){var uo=Fe($o);Jn=Jn.filter(function(ir){return!uo.has(ir)})}iw(Pe,Jn,!0)||Be(Jn,!0)}),mn=function(mo,Jn){var uo=Jn??!Pe.includes(mo);an(mo,uo)},Hn=IFt(ut,Qe,Ae,ve,pe,tt,Ct,Tt,mn,Z);m.useEffect(function(){ce(!0)},[]);var Fo=m.useMemo(function(){return{_internalRenderMenuItem:he,_internalRenderSubMenuItem:xe}},[he,xe]),yo=ut!=="horizontal"||P?Se:Se.map(function($o,mo){return m.createElement(sk,{key:$o.key,overflowDisabled:mo>Pt},$o)}),So=m.createElement(k2,ho({id:g,ref:pe,prefixCls:"".concat(i,"-overflow"),component:"ul",itemComponent:_W,className:Vn(i,"".concat(i,"-root"),"".concat(i,"-").concat(ut),s,Vt(Vt({},"".concat(i,"-inline-collapsed"),at),"".concat(i,"-rtl"),Ae),a),dir:p,style:l,role:"menu",tabIndex:u,data:yo,renderRawItem:function(mo){return mo},renderRawRest:function(mo){var Jn=mo.length,uo=Jn?Se.slice(-Jn):null;return m.createElement(Q$,{eventKey:rue,title:se,disabled:Ut,internalPopupClose:Jn===0,popupClassName:ne},uo)},maxCount:ut!=="horizontal"||P?k2.INVALIDATE:k2.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(mo){Rt(mo)},onKeyDown:Hn},He));return m.createElement(Wme.Provider,{value:Fo},m.createElement(eXe.Provider,{value:ve},m.createElement(sk,{prefixCls:i,rootClassName:a,mode:ut,openKeys:Pe,rtl:Ae,disabled:C,motion:ye?X:null,defaultMotions:ye?$:null,activeKey:Qe,onActive:Dt,onInactive:lt,selectedKeys:_t,inlineIndent:_,subMenuOpenDelay:T,subMenuCloseDelay:x,forceSubMenuRender:S,builtinPlacements:q,triggerSubMenuAction:le,getPopupContainer:fe,itemIcon:te,expandIcon:re,onItemClick:gn,onOpenChange:an},m.createElement(iXe.Provider,{value:je},So),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(oXe.Provider,{value:qe},Se)))))}),OH=ikt;OH.Item=_W;OH.SubMenu=Q$;OH.ItemGroup=Z$;OH.Divider=Yme;var akt={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},lkt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:akt}))},Ome=m.forwardRef(lkt),skt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},ckt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:skt}))},Gve=m.forwardRef(ckt);const dXe=m.createContext({});var ukt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},dkt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:ukt}))},_me=m.forwardRef(dkt),fkt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:e,className:n,dashed:o}=t,r=fkt(t,["prefixCls","className","dashed"]),{getPrefixCls:i}=m.useContext(Cr),a=i("menu",e),l=Un({[`${a}-item-divider-dashed`]:!!o},n);return m.createElement(Yme,Object.assign({className:l},r))},jG=m.createContext({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),hXe=t=>{var e;const{className:n,children:o,icon:r,title:i,danger:a}=t,{prefixCls:l,firstLevel:s,direction:c,disableMenuItemTitleTooltip:u,inlineCollapsed:d}=m.useContext(jG),f=C=>{const P=m.createElement("span",{className:`${l}-title-content`},o);return(!r||m.isValidElement(o)&&o.type==="span")&&o&&C&&s&&typeof o=="string"?m.createElement("div",{className:`${l}-inline-collapsed-noicon`},o.charAt(0)):P},{siderCollapsed:p}=m.useContext(dXe);let g=i;typeof i>"u"?g=s?o:"":i===!1&&(g="");const y={title:g};!p&&!d&&(y.title=null,y.open=!1);const w=B9(o).length;let b=m.createElement(_W,Object.assign({},up(t,["title","icon","danger"]),{className:Un({[`${l}-item-danger`]:a,[`${l}-item-only-child`]:(r?w+1:w)===1},n),title:typeof i=="string"?i:void 0}),B0(r,{className:Un(m.isValidElement(r)?(e=r.props)===null||e===void 0?void 0:e.className:"",`${l}-item-icon`)}),f(d));return u||(b=m.createElement(tA,Object.assign({},y,{placement:c==="rtl"?"left":"right",overlayClassName:`${l}-inline-collapsed-tooltip`}),b)),b},pXe=t=>{var e;const{popupClassName:n,icon:o,title:r,theme:i}=t,a=m.useContext(jG),{prefixCls:l,inlineCollapsed:s,theme:c}=a,u=YH();let d;if(!o)d=s&&!u.length&&r&&typeof r=="string"?m.createElement("div",{className:`${l}-inline-collapsed-noicon`},r.charAt(0)):m.createElement("span",{className:`${l}-title-content`},r);else{const g=m.isValidElement(r)&&r.type==="span";d=m.createElement(m.Fragment,null,B0(o,{className:Un(m.isValidElement(o)?(e=o.props)===null||e===void 0?void 0:e.className:"",`${l}-item-icon`)}),g?r:m.createElement("span",{className:`${l}-title-content`},r))}const f=m.useMemo(()=>Object.assign(Object.assign({},a),{firstLevel:!1}),[a]),[p]=Ww("Menu");return m.createElement(jG.Provider,{value:f},m.createElement(Q$,Object.assign({},up(t,["icon"]),{title:d,popupClassName:Un(l,n,`${l}-${i||c}`),popupStyle:{zIndex:p}})))};var hkt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{if(e&&typeof e=="object"){const o=e,{label:r,children:i,key:a,type:l}=o,s=hkt(o,["label","children","key","type"]),c=a??`tmp-${n}`;return i||l==="group"?l==="group"?m.createElement(Z$,Object.assign({key:c},s,{title:r}),aue(i)):m.createElement(pXe,Object.assign({key:c},s,{title:r}),aue(i)):l==="divider"?m.createElement(fXe,Object.assign({key:c},s)):m.createElement(hXe,Object.assign({key:c},s),r)}return null}).filter(e=>e)}function pkt(t){return m.useMemo(()=>t&&aue(t),[t])}var gkt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{children:n}=t,o=gkt(t,["children"]),r=m.useContext(BG),i=m.useMemo(()=>Object.assign(Object.assign({},r),o),[r,o.prefixCls,o.mode,o.selectable,o.rootClassName]),a=xPt(n),l=vPt(e,a?n.ref:null);return m.createElement(BG.Provider,{value:i},m.createElement(Y9,null,a?m.cloneElement(n,{ref:l}):n))}),mkt=t=>{const{componentCls:e,motionDurationSlow:n,horizontalLineHeight:o,colorSplit:r,lineWidth:i,lineType:a,itemPaddingInline:l}=t;return{[`${e}-horizontal`]:{lineHeight:o,border:0,borderBottom:`${Nt(i)} ${a} ${r}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${e}-item, ${e}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:l},[`> ${e}-item:hover, + `]:{paddingInlineEnd:t.calc(t.fontSize).mul(1.5).equal()}}}},oie(Ki(t,{controlHeight:t.singleItemHeightLG,fontSize:t.fontSizeLG,borderRadius:t.borderRadiusLG}),"lg")]}const ODt=t=>{const{fontSize:e,lineHeight:n,lineWidth:o,controlHeight:r,controlHeightSM:i,controlHeightLG:a,paddingXXS:l,controlPaddingHorizontal:s,zIndexPopupBase:c,colorText:u,fontWeightStrong:d,controlItemBgActive:f,controlItemBgHover:p,colorBgContainer:g,colorFillSecondary:y,colorBgContainerDisabled:w,colorTextDisabled:b}=t,C=l*2,P=o*2,v=Math.min(r-C,r-P),T=Math.min(i-C,i-P),A=Math.min(a-C,a-P);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(l/2),zIndexPopup:c+50,optionSelectedColor:u,optionSelectedFontWeight:d,optionSelectedBg:f,optionActiveBg:p,optionPadding:`${(r-e*n)/2}px ${s}px`,optionFontSize:e,optionLineHeight:n,optionHeight:r,selectorBg:g,clearBg:g,singleItemHeightLG:a,multipleItemBg:y,multipleItemBorderColor:"transparent",multipleItemHeight:v,multipleItemHeightSM:T,multipleItemHeightLG:A,multipleSelectorBgDisabled:w,multipleItemColorDisabled:b,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(t.fontSize*1.25)}},FGe=(t,e)=>{const{componentCls:n,antCls:o,controlOutlineWidth:r}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{border:`${Nt(t.lineWidth)} ${t.lineType} ${e.borderColor}`,background:t.selectorBg},[`&:not(${n}-disabled):not(${n}-customize-input):not(${o}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:e.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:e.activeBorderColor,boxShadow:`0 0 0 ${Nt(r)} ${e.activeShadowColor}`,outline:0}}}},Lve=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},FGe(t,e))}),_Dt=t=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},FGe(t,{borderColor:t.colorBorder,hoverBorderHover:t.colorPrimaryHover,activeBorderColor:t.colorPrimary,activeShadowColor:t.controlOutline})),Lve(t,{status:"error",borderColor:t.colorError,hoverBorderHover:t.colorErrorHover,activeBorderColor:t.colorError,activeShadowColor:t.colorErrorOutline})),Lve(t,{status:"warning",borderColor:t.colorWarning,hoverBorderHover:t.colorWarningHover,activeBorderColor:t.colorWarning,activeShadowColor:t.colorWarningOutline})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{background:t.colorBgContainerDisabled,color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}})}),kGe=(t,e)=>{const{componentCls:n,antCls:o}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{background:e.bg,border:`${Nt(t.lineWidth)} ${t.lineType} transparent`,color:e.color},[`&:not(${n}-disabled):not(${n}-customize-input):not(${o}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{background:e.hoverBg},[`${n}-focused& ${n}-selector`]:{background:t.selectorBg,borderColor:e.activeBorderColor,outline:0}}}},Wve=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},kGe(t,e))}),VDt=t=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},kGe(t,{bg:t.colorFillTertiary,hoverBg:t.colorFillSecondary,activeBorderColor:t.colorPrimary,color:t.colorText})),Wve(t,{status:"error",bg:t.colorErrorBg,hoverBg:t.colorErrorBgHover,activeBorderColor:t.colorError,color:t.colorError})),Wve(t,{status:"warning",bg:t.colorWarningBg,hoverBg:t.colorWarningBgHover,activeBorderColor:t.colorWarning,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{borderColor:t.colorBorder,background:t.colorBgContainerDisabled,color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.colorBgContainer,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`}})}),GDt=t=>({"&-borderless":{[`${t.componentCls}-selector`]:{background:"transparent",borderColor:"transparent"},[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}}}),XDt=t=>({[t.componentCls]:Object.assign(Object.assign(Object.assign({},_Dt(t)),VDt(t)),GDt(t))}),JDt=t=>{const{componentCls:e}=t;return{position:"relative",transition:`all ${t.motionDurationMid} ${t.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},[`${e}-disabled&`]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},KDt=t=>{const{componentCls:e}=t;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},qDt=t=>{const{antCls:e,componentCls:n,inputPaddingHorizontalBase:o,iconCls:r}=t;return{[n]:Object.assign(Object.assign({},ja(t)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${n}-customize-input) ${n}-selector`]:Object.assign(Object.assign({},JDt(t)),KDt(t)),[`${n}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},Gx),{[`> ${e}-typography`]:{display:"inline"}}),[`${n}-selection-placeholder`]:Object.assign(Object.assign({},Gx),{flex:1,color:t.colorTextPlaceholder,pointerEvents:"none"}),[`${n}-arrow`]:Object.assign(Object.assign({},WH()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:o,height:t.fontSizeIcon,marginTop:t.calc(t.fontSizeIcon).mul(-1).div(2).equal(),color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:`opacity ${t.motionDurationSlow} ease`,[r]:{verticalAlign:"top",transition:`transform ${t.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${n}-suffix)`]:{pointerEvents:"auto"}},[`${n}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${n}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:o,zIndex:1,display:"inline-block",width:t.fontSizeIcon,height:t.fontSizeIcon,marginTop:t.calc(t.fontSizeIcon).mul(-1).div(2).equal(),color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${t.motionDurationMid} ease, opacity ${t.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:t.colorTextTertiary}},"&:hover":{[`${n}-clear`]:{opacity:1},[`${n}-arrow:not(:last-child)`]:{opacity:0}}}),[`${n}-has-feedback`]:{[`${n}-clear`]:{insetInlineEnd:t.calc(o).add(t.fontSize).add(t.paddingXS).equal()}}}},$Dt=t=>{const{componentCls:e}=t;return[{[e]:{[`&${e}-in-form-item`]:{width:"100%"}}},qDt(t),YDt(t),BDt(t),NDt(t),{[`${e}-rtl`]:{direction:"rtl"}},kW(t,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]},QDt=wl("Select",(t,e)=>{let{rootPrefixCls:n}=e;const o=Ki(t,{rootPrefixCls:n,inputPaddingHorizontalBase:t.calc(t.paddingSM).sub(1).equal(),multipleSelectItemHeight:t.multipleItemHeight,selectHeight:t.controlHeight});return[$Dt(o),XDt(o)]},ODt,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}});var ZDt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},eEt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:ZDt}))},LGe=m.forwardRef(eEt),tEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},nEt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:tEt}))},Fme=m.forwardRef(nEt),oEt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},rEt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:oEt}))},kme=m.forwardRef(rEt);function WGe(t){let{suffixIcon:e,clearIcon:n,menuItemSelectedIcon:o,removeIcon:r,loading:i,multiple:a,hasFeedback:l,prefixCls:s,showSuffixIcon:c,feedbackIcon:u,showArrow:d,componentName:f}=t;const p=n??m.createElement(E$,null),g=C=>e===null&&!l&&!d?null:m.createElement(m.Fragment,null,c!==!1&&C,l&&u);let y=null;if(e!==void 0)y=g(e);else if(i)y=g(m.createElement(UH,{spin:!0}));else{const C=`${s}-suffix`;y=P=>{let{open:v,showSearch:T}=P;return g(v&&T?m.createElement(kme,{className:C}):m.createElement(Fme,{className:C}))}}let w=null;o!==void 0?w=o:a?w=m.createElement(LGe,null):w=null;let b=null;return r!==void 0?b=r:b=m.createElement(Lw,null),{clearIcon:p,suffixIcon:y,itemIcon:w,removeIcon:b}}function iEt(t,e){return e!==void 0?e:t!==null}var aEt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n;const{prefixCls:o,bordered:r,className:i,rootClassName:a,getPopupContainer:l,popupClassName:s,dropdownClassName:c,listHeight:u=256,placement:d,listItemHeight:f,size:p,disabled:g,notFoundContent:y,status:w,builtinPlacements:b,dropdownMatchSelectWidth:C,popupMatchSelectWidth:P,direction:v,style:T,allowClear:A,variant:x,dropdownStyle:S,transitionName:R,tagRender:M,maxCount:D}=t,E=aEt(t,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount"]),{getPopupContainer:W,getPrefixCls:j,renderEmpty:L,direction:k,virtual:N,popupMatchSelectWidth:F,popupOverflow:U,select:O}=m.useContext(Cr),[,B]=_u(),_=f??(B==null?void 0:B.controlHeight),X=j("select",o),$=j(),Q=v??k,{compactSize:le,compactItemClassnames:q}=Nw(X,Q),[te,re]=BH(x,r),ae=O0(X),[se,ne,fe]=QDt(X,ae),ge=m.useMemo(()=>{const{mode:De}=t;if(De!=="combobox")return De===NGe?"combobox":De},[t.mode]),de=ge==="multiple"||ge==="tags",Z=iEt(t.suffixIcon,t.showArrow),he=(n=P??C)!==null&&n!==void 0?n:F,{status:xe,hasFeedback:He,isFormItemInput:Se,feedbackIcon:ze}=m.useContext(r1),Ie=Lb(xe,w);let ye;y!==void 0?ye=y:ge==="combobox"?ye=null:ye=(L==null?void 0:L("Select"))||m.createElement(Eme,{componentName:"Select"});const{suffixIcon:ce,itemIcon:pe,removeIcon:ve,clearIcon:Ae}=WGe(Object.assign(Object.assign({},E),{multiple:de,hasFeedback:He,feedbackIcon:ze,showSuffixIcon:Z,prefixCls:X,componentName:"Select"})),Te=A===!0?{clearIcon:Ae}:A,Me=up(E,["suffixIcon","itemIcon"]),Pe=Un(s||c,{[`${X}-dropdown-${Q}`]:Q==="rtl"},a,fe,ae,ne),Ee=Ed(De=>{var ke;return(ke=p??le)!==null&&ke!==void 0?ke:De}),Be=m.useContext(n1),Je=g??Be,We=Un({[`${X}-lg`]:Ee==="large",[`${X}-sm`]:Ee==="small",[`${X}-rtl`]:Q==="rtl",[`${X}-${te}`]:re,[`${X}-in-form-item`]:Se},sw(X,Ie,He),q,O==null?void 0:O.className,i,a,fe,ae,ne),Ke=m.useMemo(()=>d!==void 0?d:Q==="rtl"?"bottomRight":"bottomLeft",[d,Q]),[Ne]=Ww("SelectLike",S==null?void 0:S.zIndex);return se(m.createElement(Dme,Object.assign({ref:e,virtual:N,showSearch:O==null?void 0:O.showSearch},Me,{style:Object.assign(Object.assign({},O==null?void 0:O.style),T),dropdownMatchSelectWidth:he,transitionName:j9($,"slide-up",R),builtinPlacements:WDt(b,U),listHeight:u,listItemHeight:_,mode:ge,prefixCls:X,placement:Ke,direction:Q,suffixIcon:ce,menuItemSelectedIcon:pe,removeIcon:ve,allowClear:Te,notFoundContent:ye,className:We,getPopupContainer:l||W,dropdownClassName:Pe,disabled:Je,dropdownStyle:Object.assign(Object.assign({},S),{zIndex:Ne}),maxCount:de?D:void 0,tagRender:de?M:void 0})))},_o=m.forwardRef(lEt),sEt=YW(_o);_o.SECRET_COMBOBOX_MODE_DO_NOT_USE=NGe;_o.Option=zme;_o.OptGroup=Ime;_o._InternalPanelDoNotUseOrYouWillBeFired=sEt;const cw=["xxl","xl","lg","md","sm","xs"],cEt=t=>({xs:`(max-width: ${t.screenXSMax}px)`,sm:`(min-width: ${t.screenSM}px)`,md:`(min-width: ${t.screenMD}px)`,lg:`(min-width: ${t.screenLG}px)`,xl:`(min-width: ${t.screenXL}px)`,xxl:`(min-width: ${t.screenXXL}px)`}),uEt=t=>{const e=t,n=[].concat(cw).reverse();return n.forEach((o,r)=>{const i=o.toUpperCase(),a=`screen${i}Min`,l=`screen${i}`;if(!(e[a]<=e[l]))throw new Error(`${a}<=${l} fails : !(${e[a]}<=${e[l]})`);if(r{const n=new Map;let o=-1,r={};return{matchHandlers:{},dispatch(i){return r=i,n.forEach(a=>a(r)),n.size>=1},subscribe(i){return n.size||this.register(),o+=1,n.set(o,i),i(r),o},unsubscribe(i){n.delete(i),n.size||this.unregister()},unregister(){Object.keys(e).forEach(i=>{const a=e[i],l=this.matchHandlers[a];l==null||l.mql.removeListener(l==null?void 0:l.listener)}),n.clear()},register(){Object.keys(e).forEach(i=>{const a=e[i],l=c=>{let{matches:u}=c;this.dispatch(Object.assign(Object.assign({},r),{[i]:u}))},s=window.matchMedia(a);s.addListener(l),this.matchHandlers[a]={mql:s,listener:l},l(s)})},responsiveMap:e}},[t])}function jGe(){const[,t]=m.useReducer(e=>e+1,0);return t}function X$(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const e=m.useRef({}),n=jGe(),o=UGe();return gx(()=>{const r=o.subscribe(i=>{e.current=i,t&&n()});return()=>o.unsubscribe(r)},[]),e.current}const Q0e=m.createContext({}),dEt=t=>{const{antCls:e,componentCls:n,iconCls:o,avatarBg:r,avatarColor:i,containerSize:a,containerSizeLG:l,containerSizeSM:s,textFontSize:c,textFontSizeLG:u,textFontSizeSM:d,borderRadius:f,borderRadiusLG:p,borderRadiusSM:g,lineWidth:y,lineType:w}=t,b=(C,P,v)=>({width:C,height:C,borderRadius:"50%",[`&${n}-square`]:{borderRadius:v},[`&${n}-icon`]:{fontSize:P,[`> ${o}`]:{margin:0}}});return{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",overflow:"hidden",color:i,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:r,border:`${Nt(y)} ${w} transparent`,"&-image":{background:"transparent"},[`${e}-image-img`]:{display:"block"}}),b(a,c,f)),{"&-lg":Object.assign({},b(l,u,p)),"&-sm":Object.assign({},b(s,d,g)),"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}})}},fEt=t=>{const{componentCls:e,groupBorderColor:n,groupOverlapping:o,groupSpace:r}=t;return{[`${e}-group`]:{display:"inline-flex",[`${e}`]:{borderColor:n},"> *:not(:first-child)":{marginInlineStart:o}},[`${e}-group-popover`]:{[`${e} + ${e}`]:{marginInlineStart:r}}}},hEt=t=>{const{controlHeight:e,controlHeightLG:n,controlHeightSM:o,fontSize:r,fontSizeLG:i,fontSizeXL:a,fontSizeHeading3:l,marginXS:s,marginXXS:c,colorBorderBg:u}=t;return{containerSize:e,containerSizeLG:n,containerSizeSM:o,textFontSize:Math.round((i+a)/2),textFontSizeLG:l,textFontSizeSM:r,groupSpace:c,groupOverlapping:-s,groupBorderColor:u}},BGe=wl("Avatar",t=>{const{colorTextLightSolid:e,colorTextPlaceholder:n}=t,o=Ki(t,{avatarBg:n,avatarColor:e});return[dEt(o),fEt(o)]},hEt);var pEt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const[n,o]=m.useState(1),[r,i]=m.useState(!1),[a,l]=m.useState(!0),s=m.useRef(null),c=m.useRef(null),u=o5(e,s),{getPrefixCls:d,avatar:f}=m.useContext(Cr),p=m.useContext(Q0e),g=()=>{if(!c.current||!s.current)return;const te=c.current.offsetWidth,re=s.current.offsetWidth;if(te!==0&&re!==0){const{gap:ae=4}=t;ae*2{i(!0)},[]),m.useEffect(()=>{l(!0),o(1)},[t.src]),m.useEffect(g,[t.gap]);const y=()=>{const{onError:te}=t;(te==null?void 0:te())!==!1&&l(!1)},{prefixCls:w,shape:b,size:C,src:P,srcSet:v,icon:T,className:A,rootClassName:x,alt:S,draggable:R,children:M,crossOrigin:D}=t,E=pEt(t,["prefixCls","shape","size","src","srcSet","icon","className","rootClassName","alt","draggable","children","crossOrigin"]),W=Ed(te=>{var re,ae;return(ae=(re=C??(p==null?void 0:p.size))!==null&&re!==void 0?re:te)!==null&&ae!==void 0?ae:"default"}),j=Object.keys(typeof W=="object"?W||{}:{}).some(te=>["xs","sm","md","lg","xl","xxl"].includes(te)),L=X$(j),k=m.useMemo(()=>{if(typeof W!="object")return{};const te=cw.find(ae=>L[ae]),re=W[te];return re?{width:re,height:re,fontSize:re&&(T||M)?re/2:18}:{}},[L,W]),N=d("avatar",w),F=O0(N),[U,O,B]=BGe(N,F),_=Un({[`${N}-lg`]:W==="large",[`${N}-sm`]:W==="small"}),X=m.isValidElement(P),$=b||(p==null?void 0:p.shape)||"circle",Q=Un(N,_,f==null?void 0:f.className,`${N}-${$}`,{[`${N}-image`]:X||P&&a,[`${N}-icon`]:!!T},B,F,A,x,O),le=typeof W=="number"?{width:W,height:W,fontSize:T?W/2:18}:{};let q;if(typeof P=="string"&&a)q=m.createElement("img",{src:P,draggable:R,srcSet:v,onError:y,alt:S,crossOrigin:D});else if(X)q=P;else if(T)q=T;else if(r||n!==1){const te=`scale(${n})`,re={msTransform:te,WebkitTransform:te,transform:te};q=m.createElement(Td,{onResize:g},m.createElement("span",{className:`${N}-string`,ref:c,style:Object.assign({},re)},M))}else q=m.createElement("span",{className:`${N}-string`,style:{opacity:0},ref:c},M);return delete E.onError,delete E.gap,U(m.createElement("span",Object.assign({},E,{style:Object.assign(Object.assign(Object.assign(Object.assign({},le),k),f==null?void 0:f.style),E.style),className:Q,ref:u}),q))},YGe=m.forwardRef(gEt);var fi={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var n=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||n>=fi.F1&&n<=fi.F12)return!1;switch(n){case fi.ALT:case fi.CAPS_LOCK:case fi.CONTEXT_MENU:case fi.CTRL:case fi.DOWN:case fi.END:case fi.ESC:case fi.HOME:case fi.INSERT:case fi.LEFT:case fi.MAC_FF_META:case fi.META:case fi.NUMLOCK:case fi.NUM_CENTER:case fi.PAGE_DOWN:case fi.PAGE_UP:case fi.PAUSE:case fi.PRINT_SCREEN:case fi.RIGHT:case fi.SHIFT:case fi.UP:case fi.WIN_KEY:case fi.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=fi.ZERO&&e<=fi.NINE||e>=fi.NUM_ZERO&&e<=fi.NUM_MULTIPLY||e>=fi.A&&e<=fi.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case fi.SPACE:case fi.QUESTION_MARK:case fi.NUM_PLUS:case fi.NUM_MINUS:case fi.NUM_PERIOD:case fi.NUM_DIVISION:case fi.SEMICOLON:case fi.DASH:case fi.EQUALS:case fi.COMMA:case fi.PERIOD:case fi.SLASH:case fi.APOSTROPHE:case fi.SINGLE_QUOTE:case fi.OPEN_SQUARE_BRACKET:case fi.BACKSLASH:case fi.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};const NG=t=>t?typeof t=="function"?t():t:null;function Lme(t){var e=t.children,n=t.prefixCls,o=t.id,r=t.overlayInnerStyle,i=t.className,a=t.style;return m.createElement("div",{className:Vn("".concat(n,"-content"),i),style:a},m.createElement("div",{className:"".concat(n,"-inner"),id:o,role:"tooltip",style:r},typeof e=="function"?e():e))}function Z0e(){return Z0e=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[r]=t[r]);return n}function xEt(t,e){if(t==null)return{};var n=vEt(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var zT={shiftX:64,adjustY:1},DT={adjustX:1,shiftY:!0},pm=[0,0],bEt={left:{points:["cr","cl"],overflow:DT,offset:[-4,0],targetOffset:pm},right:{points:["cl","cr"],overflow:DT,offset:[4,0],targetOffset:pm},top:{points:["bc","tc"],overflow:zT,offset:[0,-4],targetOffset:pm},bottom:{points:["tc","bc"],overflow:zT,offset:[0,4],targetOffset:pm},topLeft:{points:["bl","tl"],overflow:zT,offset:[0,-4],targetOffset:pm},leftTop:{points:["tr","tl"],overflow:DT,offset:[-4,0],targetOffset:pm},topRight:{points:["br","tr"],overflow:zT,offset:[0,-4],targetOffset:pm},rightTop:{points:["tl","tr"],overflow:DT,offset:[4,0],targetOffset:pm},bottomRight:{points:["tr","br"],overflow:zT,offset:[0,4],targetOffset:pm},rightBottom:{points:["bl","br"],overflow:DT,offset:[4,0],targetOffset:pm},bottomLeft:{points:["tl","bl"],overflow:zT,offset:[0,4],targetOffset:pm},leftBottom:{points:["br","bl"],overflow:DT,offset:[-4,0],targetOffset:pm}},SEt=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],TEt=function(e,n){var o=e.overlayClassName,r=e.trigger,i=r===void 0?["hover"]:r,a=e.mouseEnterDelay,l=a===void 0?0:a,s=e.mouseLeaveDelay,c=s===void 0?.1:s,u=e.overlayStyle,d=e.prefixCls,f=d===void 0?"rc-tooltip":d,p=e.children,g=e.onVisibleChange,y=e.afterVisibleChange,w=e.transitionName,b=e.animation,C=e.motion,P=e.placement,v=P===void 0?"right":P,T=e.align,A=T===void 0?{}:T,x=e.destroyTooltipOnHide,S=x===void 0?!1:x,R=e.defaultVisible,M=e.getTooltipContainer,D=e.overlayInnerStyle;e.arrowContent;var E=e.overlay,W=e.id,j=e.showArrow,L=j===void 0?!0:j,k=xEt(e,SEt),N=m.useRef(null);m.useImperativeHandle(n,function(){return N.current});var F=wEt({},k);"visible"in e&&(F.popupVisible=e.visible);var U=function(){return m.createElement(Lme,{key:"content",prefixCls:f,id:W,overlayInnerStyle:D},E)};return m.createElement(_W,Z0e({popupClassName:o,prefixCls:f,popup:U,action:i,builtinPlacements:bEt,popupPlacement:v,ref:N,popupAlign:A,getPopupContainer:M,onPopupVisibleChange:g,afterPopupVisibleChange:y,popupTransitionName:w,popupAnimation:b,popupMotion:C,defaultPopupVisible:R,autoDestroy:S,mouseLeaveDelay:c,popupStyle:u,mouseEnterDelay:l,arrow:L},F),p)};const PEt=m.forwardRef(TEt);function J$(t){const{sizePopupArrow:e,borderRadiusXS:n,borderRadiusOuter:o}=t,r=e/2,i=0,a=r,l=o*1/Math.sqrt(2),s=r-o*(1-1/Math.sqrt(2)),c=r-n*(1/Math.sqrt(2)),u=o*(Math.sqrt(2)-1)+n*(1/Math.sqrt(2)),d=2*r-c,f=u,p=2*r-l,g=s,y=2*r-i,w=a,b=r*Math.sqrt(2)+o*(Math.sqrt(2)-2),C=o*(Math.sqrt(2)-1),P=`polygon(${C}px 100%, 50% ${C}px, ${2*r-C}px 100%, ${C}px 100%)`,v=`path('M ${i} ${a} A ${o} ${o} 0 0 0 ${l} ${s} L ${c} ${u} A ${n} ${n} 0 0 1 ${d} ${f} L ${p} ${g} A ${o} ${o} 0 0 0 ${y} ${w} Z')`;return{arrowShadowWidth:b,arrowPath:v,arrowPolygon:P}}const OGe=(t,e,n)=>{const{sizePopupArrow:o,arrowPolygon:r,arrowPath:i,arrowShadowWidth:a,borderRadiusXS:l,calc:s}=t;return{pointerEvents:"none",width:o,height:o,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:o,height:s(o).div(2).equal(),background:e,clipPath:{_multi_value_:!0,value:[r,i]},content:'""'},"&::after":{content:'""',position:"absolute",width:a,height:a,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Nt(l)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}},_Ge=8;function K$(t){const{contentRadius:e,limitVerticalRadius:n}=t,o=e>12?e+2:12;return{arrowOffsetHorizontal:o,arrowOffsetVertical:n?_Ge:o}}function MY(t,e){return t?e:{}}function Wme(t,e,n){const{componentCls:o,boxShadowPopoverArrow:r,arrowOffsetVertical:i,arrowOffsetHorizontal:a}=t,{arrowDistance:l=0,arrowPlacement:s={left:!0,right:!0,top:!0,bottom:!0}}=n||{};return{[o]:Object.assign(Object.assign(Object.assign(Object.assign({[`${o}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},OGe(t,e,r)),{"&:before":{background:e}})]},MY(!!s.top,{[[`&-placement-top > ${o}-arrow`,`&-placement-topLeft > ${o}-arrow`,`&-placement-topRight > ${o}-arrow`].join(",")]:{bottom:l,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${o}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft > ${o}-arrow`]:{left:{_skip_check_:!0,value:a}},[`&-placement-topRight > ${o}-arrow`]:{right:{_skip_check_:!0,value:a}}})),MY(!!s.bottom,{[[`&-placement-bottom > ${o}-arrow`,`&-placement-bottomLeft > ${o}-arrow`,`&-placement-bottomRight > ${o}-arrow`].join(",")]:{top:l,transform:"translateY(-100%)"},[`&-placement-bottom > ${o}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft > ${o}-arrow`]:{left:{_skip_check_:!0,value:a}},[`&-placement-bottomRight > ${o}-arrow`]:{right:{_skip_check_:!0,value:a}}})),MY(!!s.left,{[[`&-placement-left > ${o}-arrow`,`&-placement-leftTop > ${o}-arrow`,`&-placement-leftBottom > ${o}-arrow`].join(",")]:{right:{_skip_check_:!0,value:l},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${o}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${o}-arrow`]:{top:i},[`&-placement-leftBottom > ${o}-arrow`]:{bottom:i}})),MY(!!s.right,{[[`&-placement-right > ${o}-arrow`,`&-placement-rightTop > ${o}-arrow`,`&-placement-rightBottom > ${o}-arrow`].join(",")]:{left:{_skip_check_:!0,value:l},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${o}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${o}-arrow`]:{top:i},[`&-placement-rightBottom > ${o}-arrow`]:{bottom:i}}))}}function CEt(t,e,n,o){if(o===!1)return{adjustX:!1,adjustY:!1};const r=o&&typeof o=="object"?o:{},i={};switch(t){case"top":case"bottom":i.shiftX=e.arrowOffsetHorizontal*2+n,i.shiftY=!0,i.adjustY=!0;break;case"left":case"right":i.shiftY=e.arrowOffsetVertical*2+n,i.shiftX=!0,i.adjustX=!0;break}const a=Object.assign(Object.assign({},i),r);return a.shiftX||(a.adjustX=!0),a.shiftY||(a.adjustY=!0),a}const Uve={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},REt={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},HEt=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function VGe(t){const{arrowWidth:e,autoAdjustOverflow:n,arrowPointAtCenter:o,offset:r,borderRadius:i,visibleFirst:a}=t,l=e/2,s={};return Object.keys(Uve).forEach(c=>{const u=o&&REt[c]||Uve[c],d=Object.assign(Object.assign({},u),{offset:[0,0],dynamicInset:!0});switch(s[c]=d,HEt.has(c)&&(d.autoArrow=!1),c){case"top":case"topLeft":case"topRight":d.offset[1]=-l-r;break;case"bottom":case"bottomLeft":case"bottomRight":d.offset[1]=l+r;break;case"left":case"leftTop":case"leftBottom":d.offset[0]=-l-r;break;case"right":case"rightTop":case"rightBottom":d.offset[0]=l+r;break}const f=K$({contentRadius:i,limitVerticalRadius:!0});if(o)switch(c){case"topLeft":case"bottomLeft":d.offset[0]=-f.arrowOffsetHorizontal-l;break;case"topRight":case"bottomRight":d.offset[0]=f.arrowOffsetHorizontal+l;break;case"leftTop":case"rightTop":d.offset[1]=-f.arrowOffsetHorizontal-l;break;case"leftBottom":case"rightBottom":d.offset[1]=f.arrowOffsetHorizontal+l;break}d.overflow=CEt(c,f,e,n),a&&(d.htmlRegion="visibleFirst")}),s}const MEt=t=>{const{componentCls:e,tooltipMaxWidth:n,tooltipColor:o,tooltipBg:r,tooltipBorderRadius:i,zIndexPopup:a,controlHeight:l,boxShadowSecondary:s,paddingSM:c,paddingXS:u}=t;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{position:"absolute",zIndex:a,display:"block",width:"max-content",maxWidth:n,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":r,[`${e}-inner`]:{minWidth:l,minHeight:l,padding:`${Nt(t.calc(c).div(2).equal())} ${Nt(u)}`,color:o,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:r,borderRadius:i,boxShadow:s,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${e}-inner`]:{borderRadius:t.min(i,_Ge)}},[`${e}-content`]:{position:"relative"}}),D$(t,(d,f)=>{let{darkColor:p}=f;return{[`&${e}-${d}`]:{[`${e}-inner`]:{backgroundColor:p},[`${e}-arrow`]:{"--antd-arrow-background-color":p}}}})),{"&-rtl":{direction:"rtl"}})},Wme(t,"var(--antd-arrow-background-color)"),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:t.sizePopupArrow}}]},IEt=t=>Object.assign(Object.assign({zIndexPopup:t.zIndexPopupBase+70},K$({contentRadius:t.borderRadius,limitVerticalRadius:!0})),J$(Ki(t,{borderRadiusOuter:Math.min(t.borderRadiusOuter,4)}))),GGe=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return wl("Tooltip",o=>{const{borderRadius:r,colorTextLightSolid:i,colorBgSpotlight:a}=o,l=Ki(o,{tooltipMaxWidth:250,tooltipColor:i,tooltipBorderRadius:r,tooltipBg:a});return[MEt(l),jW(o,"zoom-big-fast")]},IEt,{resetStyle:!1,injectStyle:e})(t)},zEt=ZF.map(t=>`${t}-inverse`),DEt=["success","processing","error","default","warning"];function q$(t){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(Za(zEt),Za(ZF)).includes(t):ZF.includes(t)}function EEt(t){return DEt.includes(t)}function XGe(t,e){const n=q$(e),o=Un({[`${t}-${e}`]:e&&n}),r={},i={};return e&&!n&&(r.background=e,i["--antd-arrow-background-color"]=e),{className:o,overlayStyle:r,arrowStyle:i}}const FEt=t=>{const{prefixCls:e,className:n,placement:o="top",title:r,color:i,overlayInnerStyle:a}=t,{getPrefixCls:l}=m.useContext(Cr),s=l("tooltip",e),[c,u,d]=GGe(s),f=XGe(s,i),p=f.arrowStyle,g=Object.assign(Object.assign({},a),f.overlayStyle),y=Un(u,d,s,`${s}-pure`,`${s}-placement-${o}`,n,f.className);return c(m.createElement("div",{className:y,style:p},m.createElement("div",{className:`${s}-arrow`}),m.createElement(Lme,Object.assign({},t,{className:u,prefixCls:s,overlayInnerStyle:g}),r)))};var kEt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n,o;const{prefixCls:r,openClassName:i,getTooltipContainer:a,overlayClassName:l,color:s,overlayInnerStyle:c,children:u,afterOpenChange:d,afterVisibleChange:f,destroyTooltipOnHide:p,arrow:g=!0,title:y,overlay:w,builtinPlacements:b,arrowPointAtCenter:C=!1,autoAdjustOverflow:P=!0}=t,v=!!g,[,T]=_u(),{getPopupContainer:A,getPrefixCls:x,direction:S}=m.useContext(Cr),R=kb(),M=m.useRef(null),D=()=>{var ye;(ye=M.current)===null||ye===void 0||ye.forceAlign()};m.useImperativeHandle(e,()=>({forceAlign:D,forcePopupAlign:()=>{R.deprecated(!1,"forcePopupAlign","forceAlign"),D()}}));const[E,W]=$6(!1,{value:(n=t.open)!==null&&n!==void 0?n:t.visible,defaultValue:(o=t.defaultOpen)!==null&&o!==void 0?o:t.defaultVisible}),j=!y&&!w&&y!==0,L=ye=>{var ce,pe;W(j?!1:ye),j||((ce=t.onOpenChange)===null||ce===void 0||ce.call(t,ye),(pe=t.onVisibleChange)===null||pe===void 0||pe.call(t,ye))},k=m.useMemo(()=>{var ye,ce;let pe=C;return typeof g=="object"&&(pe=(ce=(ye=g.pointAtCenter)!==null&&ye!==void 0?ye:g.arrowPointAtCenter)!==null&&ce!==void 0?ce:C),b||VGe({arrowPointAtCenter:pe,autoAdjustOverflow:P,arrowWidth:v?T.sizePopupArrow:0,borderRadius:T.borderRadius,offset:T.marginXXS,visibleFirst:!0})},[C,g,b,T]),N=m.useMemo(()=>y===0?y:w||y||"",[w,y]),F=m.createElement(Y9,null,typeof N=="function"?N():N),{getPopupContainer:U,placement:O="top",mouseEnterDelay:B=.1,mouseLeaveDelay:_=.1,overlayStyle:X,rootClassName:$}=t,Q=kEt(t,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),le=x("tooltip",r),q=x(),te=t["data-popover-inject"];let re=E;!("open"in t)&&!("visible"in t)&&j&&(re=!1);const ae=m.isValidElement(u)&&!gVe(u)?u:m.createElement("span",null,u),se=ae.props,ne=!se.className||typeof se.className=="string"?Un(se.className,i||`${le}-open`):se.className,[fe,ge,de]=GGe(le,!te),Z=XGe(le,s),he=Z.arrowStyle,xe=Object.assign(Object.assign({},c),Z.overlayStyle),He=Un(l,{[`${le}-rtl`]:S==="rtl"},Z.className,$,ge,de),[Se,ze]=Ww("Tooltip",Q.zIndex),Ie=m.createElement(PEt,Object.assign({},Q,{zIndex:Se,showArrow:v,placement:O,mouseEnterDelay:B,mouseLeaveDelay:_,prefixCls:le,overlayClassName:He,overlayStyle:Object.assign(Object.assign({},he),X),getTooltipContainer:U||a||A,ref:M,builtinPlacements:k,overlay:F,visible:re,onVisibleChange:L,afterVisibleChange:d??f,overlayInnerStyle:xe,arrowContent:m.createElement("span",{className:`${le}-arrow-content`}),motion:{motionName:j9(q,"zoom-big-fast",t.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!p}),re?B0(ae,{className:ne}):ae);return fe(m.createElement(DW.Provider,{value:ze},Ie))}),tA=LEt;tA._InternalPanelDoNotUseOrYouWillBeFired=FEt;const WEt=t=>{const{componentCls:e,popoverColor:n,titleMinWidth:o,fontWeightStrong:r,innerPadding:i,boxShadowSecondary:a,colorTextHeading:l,borderRadiusLG:s,zIndexPopup:c,titleMarginBottom:u,colorBgElevated:d,popoverBg:f,titleBorderBottom:p,innerContentPadding:g,titlePadding:y}=t;return[{[e]:Object.assign(Object.assign({},ja(t)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":d,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${e}-content`]:{position:"relative"},[`${e}-inner`]:{backgroundColor:f,backgroundClip:"padding-box",borderRadius:s,boxShadow:a,padding:i},[`${e}-title`]:{minWidth:o,marginBottom:u,color:l,fontWeight:r,borderBottom:p,padding:y},[`${e}-inner-content`]:{color:n,padding:g}})},Wme(t,"var(--antd-arrow-background-color)"),{[`${e}-pure`]:{position:"relative",maxWidth:"none",margin:t.sizePopupArrow,display:"inline-block",[`${e}-content`]:{display:"inline-block"}}}]},NEt=t=>{const{componentCls:e}=t;return{[e]:ZF.map(n=>{const o=t[`${n}6`];return{[`&${e}-${n}`]:{"--antd-arrow-background-color":o,[`${e}-inner`]:{backgroundColor:o},[`${e}-arrow`]:{background:"transparent"}}}})}},UEt=t=>{const{lineWidth:e,controlHeight:n,fontHeight:o,padding:r,wireframe:i,zIndexPopupBase:a,borderRadiusLG:l,marginXS:s,lineType:c,colorSplit:u,paddingSM:d}=t,f=n-o,p=f/2,g=f/2-e,y=r;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:a+30},J$(t)),K$({contentRadius:l,limitVerticalRadius:!0})),{innerPadding:i?0:12,titleMarginBottom:i?0:s,titlePadding:i?`${p}px ${y}px ${g}px`:0,titleBorderBottom:i?`${e}px ${c} ${u}`:"none",innerContentPadding:i?`${d}px ${y}px`:0})},JGe=wl("Popover",t=>{const{colorBgElevated:e,colorText:n}=t,o=Ki(t,{popoverBg:e,popoverColor:n});return[WEt(o),NEt(o),jW(o,"zoom-big")]},UEt,{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});var jEt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r!e&&!n?null:m.createElement(m.Fragment,null,e&&m.createElement("div",{className:`${t}-title`},NG(e)),m.createElement("div",{className:`${t}-inner-content`},NG(n))),YEt=t=>{const{hashId:e,prefixCls:n,className:o,style:r,placement:i="top",title:a,content:l,children:s}=t;return m.createElement("div",{className:Un(e,n,`${n}-pure`,`${n}-placement-${i}`,o),style:r},m.createElement("div",{className:`${n}-arrow`}),m.createElement(Lme,Object.assign({},t,{className:e,prefixCls:n}),s||BEt(n,a,l)))},OEt=t=>{const{prefixCls:e,className:n}=t,o=jEt(t,["prefixCls","className"]),{getPrefixCls:r}=m.useContext(Cr),i=r("popover",e),[a,l,s]=JGe(i);return a(m.createElement(YEt,Object.assign({},o,{prefixCls:i,hashId:l,className:Un(n,s)})))};var _Et=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{let{title:e,content:n,prefixCls:o}=t;return m.createElement(m.Fragment,null,e&&m.createElement("div",{className:`${o}-title`},NG(e)),m.createElement("div",{className:`${o}-inner-content`},NG(n)))},GEt=m.forwardRef((t,e)=>{var n,o;const{prefixCls:r,title:i,content:a,overlayClassName:l,placement:s="top",trigger:c="hover",children:u,mouseEnterDelay:d=.1,mouseLeaveDelay:f=.1,onOpenChange:p,overlayStyle:g={}}=t,y=_Et(t,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle"]),{getPrefixCls:w}=m.useContext(Cr),b=w("popover",r),[C,P,v]=JGe(b),T=w(),A=Un(l,P,v),[x,S]=$6(!1,{value:(n=t.open)!==null&&n!==void 0?n:t.visible,defaultValue:(o=t.defaultOpen)!==null&&o!==void 0?o:t.defaultVisible}),R=(E,W)=>{S(E,!0),p==null||p(E,W)},M=E=>{E.keyCode===fi.ESC&&R(!1,E)},D=E=>{R(E)};return C(m.createElement(tA,Object.assign({placement:s,trigger:c,mouseEnterDelay:d,mouseLeaveDelay:f,overlayStyle:g},y,{prefixCls:b,overlayClassName:A,ref:e,open:x,onOpenChange:D,overlay:i||a?m.createElement(VEt,{prefixCls:b,title:i,content:a}):null,transitionName:j9(T,"zoom-big",y.transitionName),"data-popover-inject":!0}),B0(u,{onKeyDown:E=>{var W,j;m.isValidElement(u)&&((j=u==null?void 0:(W=u.props).onKeyDown)===null||j===void 0||j.call(W,E)),M(E)}})))}),Al=GEt;Al._InternalPanelDoNotUseOrYouWillBeFired=OEt;const jve=t=>{const{size:e,shape:n}=m.useContext(Q0e),o=m.useMemo(()=>({size:t.size||e,shape:t.shape||n}),[t.size,t.shape,e,n]);return m.createElement(Q0e.Provider,{value:o},t.children)},XEt=t=>{const{getPrefixCls:e,direction:n}=m.useContext(Cr),{prefixCls:o,className:r,rootClassName:i,style:a,maxCount:l,maxStyle:s,size:c,shape:u,maxPopoverPlacement:d="top",maxPopoverTrigger:f="hover",children:p}=t,g=e("avatar",o),y=`${g}-group`,w=O0(g),[b,C,P]=BGe(g,w),v=Un(y,{[`${y}-rtl`]:n==="rtl"},P,w,r,i,C),T=B9(p).map((x,S)=>B0(x,{key:`avatar-key-${S}`})),A=T.length;if(l&&l{const{componentCls:e,iconCls:n,antCls:o,badgeShadowSize:r,motionDurationSlow:i,textFontSize:a,textFontSizeSM:l,statusSize:s,dotSize:c,textFontWeight:u,indicatorHeight:d,indicatorHeightSM:f,marginXS:p,calc:g}=t,y=`${o}-scroll-number`,w=D$(t,(b,C)=>{let{darkColor:P}=C;return{[`&${e} ${e}-color-${b}`]:{background:P,[`&:not(${e}-count)`]:{color:P},"a:hover &":{background:P}}}});return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${e}-count`]:{display:"inline-flex",justifyContent:"center",zIndex:t.indicatorZIndex,minWidth:d,height:d,color:t.badgeTextColor,fontWeight:u,fontSize:a,lineHeight:Nt(d),whiteSpace:"nowrap",textAlign:"center",background:t.badgeColor,borderRadius:g(d).div(2).equal(),boxShadow:`0 0 0 ${Nt(r)} ${t.badgeShadowColor}`,transition:`background ${t.motionDurationMid}`,a:{color:t.badgeTextColor},"a:hover":{color:t.badgeTextColor},"a:hover &":{background:t.badgeColorHover}},[`${e}-count-sm`]:{minWidth:f,height:f,fontSize:l,lineHeight:Nt(f),borderRadius:g(f).div(2).equal()},[`${e}-multiple-words`]:{padding:`0 ${Nt(t.paddingXS)}`,bdi:{unicodeBidi:"plaintext"}},[`${e}-dot`]:{zIndex:t.indicatorZIndex,width:c,minWidth:c,height:c,background:t.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${Nt(r)} ${t.badgeShadowColor}`},[`${e}-dot${y}`]:{transition:`background ${i}`},[`${e}-count, ${e}-dot, ${y}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${n}-spin`]:{animationName:nFt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${e}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${e}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:s,height:s,verticalAlign:"middle",borderRadius:"50%"},[`${e}-status-success`]:{backgroundColor:t.colorSuccess},[`${e}-status-processing`]:{overflow:"visible",color:t.colorInfo,backgroundColor:t.colorInfo,"&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:r,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:$Et,animationDuration:t.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${e}-status-default`]:{backgroundColor:t.colorTextPlaceholder},[`${e}-status-error`]:{backgroundColor:t.colorError},[`${e}-status-warning`]:{backgroundColor:t.colorWarning},[`${e}-status-text`]:{marginInlineStart:p,color:t.colorText,fontSize:t.fontSize}}}),w),{[`${e}-zoom-appear, ${e}-zoom-enter`]:{animationName:QEt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`${e}-zoom-leave`]:{animationName:ZEt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},[`&${e}-not-a-wrapper`]:{[`${e}-zoom-appear, ${e}-zoom-enter`]:{animationName:eFt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`${e}-zoom-leave`]:{animationName:tFt,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},[`&:not(${e}-status)`]:{verticalAlign:"middle"},[`${y}-custom-component, ${e}-count`]:{transform:"none"},[`${y}-custom-component, ${y}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[`${y}`]:{overflow:"hidden",[`${y}-only`]:{position:"relative",display:"inline-block",height:d,transition:`all ${t.motionDurationSlow} ${t.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${y}-only-unit`]:{height:d,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${y}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${e}-count, ${e}-dot, ${y}-custom-component`]:{transform:"translate(-50%, -50%)"}}})}},qGe=t=>{const{fontHeight:e,lineWidth:n,marginXS:o,colorBorderBg:r}=t,i=e,a=n,l=t.colorBgContainer,s=t.colorError,c=t.colorErrorHover;return Ki(t,{badgeFontHeight:i,badgeShadowSize:a,badgeTextColor:l,badgeColor:s,badgeColorHover:c,badgeShadowColor:r,badgeProcessingDuration:"1.2s",badgeRibbonOffset:o,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},$Ge=t=>{const{fontSize:e,lineHeight:n,fontSizeSM:o,lineWidth:r}=t;return{indicatorZIndex:"auto",indicatorHeight:Math.round(e*n)-2*r,indicatorHeightSM:e,dotSize:o/2,textFontSize:o,textFontSizeSM:o,textFontWeight:"normal",statusSize:o/2}},rFt=wl("Badge",t=>{const e=qGe(t);return oFt(e)},$Ge),iFt=t=>{const{antCls:e,badgeFontHeight:n,marginXS:o,badgeRibbonOffset:r,calc:i}=t,a=`${e}-ribbon`,l=`${e}-ribbon-wrapper`,s=D$(t,(c,u)=>{let{darkColor:d}=u;return{[`&${a}-color-${c}`]:{background:d,color:d}}});return{[`${l}`]:{position:"relative"},[`${a}`]:Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{position:"absolute",top:o,padding:`0 ${Nt(t.paddingXS)}`,color:t.colorPrimary,lineHeight:Nt(n),whiteSpace:"nowrap",backgroundColor:t.colorPrimary,borderRadius:t.borderRadiusSM,[`${a}-text`]:{color:t.colorTextLightSolid},[`${a}-corner`]:{position:"absolute",top:"100%",width:r,height:r,color:"currentcolor",border:`${Nt(i(r).div(2).equal())} solid`,transform:t.badgeRibbonCornerTransform,transformOrigin:"top",filter:t.badgeRibbonCornerFilter}}),s),{[`&${a}-placement-end`]:{insetInlineEnd:i(r).mul(-1).equal(),borderEndEndRadius:0,[`${a}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${a}-placement-start`]:{insetInlineStart:i(r).mul(-1).equal(),borderEndStartRadius:0,[`${a}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}},aFt=wl(["Badge","Ribbon"],t=>{const e=qGe(t);return iFt(e)},$Ge),lFt=t=>{const{className:e,prefixCls:n,style:o,color:r,children:i,text:a,placement:l="end",rootClassName:s}=t,{getPrefixCls:c,direction:u}=m.useContext(Cr),d=c("ribbon",n),f=`${d}-wrapper`,[p,g,y]=aFt(d,f),w=q$(r,!1),b=Un(d,`${d}-placement-${l}`,{[`${d}-rtl`]:u==="rtl",[`${d}-color-${r}`]:w},e),C={},P={};return r&&!w&&(C.background=r,P.color=r),p(m.createElement("div",{className:Un(f,s,g,y)},i,m.createElement("div",{className:Un(b,g),style:Object.assign(Object.assign({},C),o)},m.createElement("span",{className:`${d}-text`},a),m.createElement("div",{className:`${d}-corner`,style:P}))))};function Bve(t){let{prefixCls:e,value:n,current:o,offset:r=0}=t,i;return r&&(i={position:"absolute",top:`${r}00%`,left:0}),m.createElement("span",{style:i,className:Un(`${e}-only-unit`,{current:o})},n)}function sFt(t,e,n){let o=t,r=0;for(;(o+10)%10!==e;)o+=n,r+=n;return r}function cFt(t){const{prefixCls:e,count:n,value:o}=t,r=Number(o),i=Math.abs(n),[a,l]=m.useState(r),[s,c]=m.useState(i),u=()=>{l(r),c(i)};m.useEffect(()=>{const p=setTimeout(()=>{u()},1e3);return()=>{clearTimeout(p)}},[r]);let d,f;if(a===r||Number.isNaN(r)||Number.isNaN(a))d=[m.createElement(Bve,Object.assign({},t,{key:r,current:!0}))],f={transition:"none"};else{d=[];const p=r+10,g=[];for(let b=r;b<=p;b+=1)g.push(b);const y=g.findIndex(b=>b%10===a);d=g.map((b,C)=>{const P=b%10;return m.createElement(Bve,Object.assign({},t,{key:b,value:P,offset:C-y,current:C===y}))});const w=s{const{prefixCls:n,count:o,className:r,motionClassName:i,style:a,title:l,show:s,component:c="sup",children:u}=t,d=uFt(t,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:f}=m.useContext(Cr),p=f("scroll-number",n),g=Object.assign(Object.assign({},d),{"data-show":s,style:a,className:Un(p,r,i),title:l});let y=o;if(o&&Number(o)%1===0){const w=String(o).split("");y=m.createElement("bdi",null,w.map((b,C)=>m.createElement(cFt,{prefixCls:p,count:Number(o),value:b,key:w.length-C})))}return a&&a.borderColor&&(g.style=Object.assign(Object.assign({},a),{boxShadow:`0 0 0 1px ${a.borderColor} inset`})),u?B0(u,w=>({className:Un(`${p}-custom-component`,w==null?void 0:w.className,i)})):m.createElement(c,Object.assign({},g,{ref:e}),y)});var fFt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n,o,r,i,a;const{prefixCls:l,scrollNumberPrefixCls:s,children:c,status:u,text:d,color:f,count:p=null,overflowCount:g=99,dot:y=!1,size:w="default",title:b,offset:C,style:P,className:v,rootClassName:T,classNames:A,styles:x,showZero:S=!1}=t,R=fFt(t,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:M,direction:D,badge:E}=m.useContext(Cr),W=M("badge",l),[j,L,k]=rFt(W),N=p>g?`${g}+`:p,F=N==="0"||N===0,U=p===null||F&&!S,O=(u!=null||f!=null)&&U,B=y&&!F,_=B?"":N,X=m.useMemo(()=>(_==null||_===""||F&&!S)&&!B,[_,F,S,B]),$=m.useRef(p);X||($.current=p);const Q=$.current,le=m.useRef(_);X||(le.current=_);const q=le.current,te=m.useRef(B);X||(te.current=B);const re=m.useMemo(()=>{if(!C)return Object.assign(Object.assign({},E==null?void 0:E.style),P);const he={marginTop:C[1]};return D==="rtl"?he.left=parseInt(C[0],10):he.right=-parseInt(C[0],10),Object.assign(Object.assign(Object.assign({},he),E==null?void 0:E.style),P)},[D,C,P,E==null?void 0:E.style]),ae=b??(typeof Q=="string"||typeof Q=="number"?Q:void 0),se=X||!d?null:m.createElement("span",{className:`${W}-status-text`},d),ne=!Q||typeof Q!="object"?void 0:B0(Q,he=>({style:Object.assign(Object.assign({},re),he.style)})),fe=q$(f,!1),ge=Un(A==null?void 0:A.indicator,(n=E==null?void 0:E.classNames)===null||n===void 0?void 0:n.indicator,{[`${W}-status-dot`]:O,[`${W}-status-${u}`]:!!u,[`${W}-color-${f}`]:fe}),de={};f&&!fe&&(de.color=f,de.background=f);const Z=Un(W,{[`${W}-status`]:O,[`${W}-not-a-wrapper`]:!c,[`${W}-rtl`]:D==="rtl"},v,T,E==null?void 0:E.className,(o=E==null?void 0:E.classNames)===null||o===void 0?void 0:o.root,A==null?void 0:A.root,L,k);if(!c&&O){const he=re.color;return j(m.createElement("span",Object.assign({},R,{className:Z,style:Object.assign(Object.assign(Object.assign({},x==null?void 0:x.root),(r=E==null?void 0:E.styles)===null||r===void 0?void 0:r.root),re)}),m.createElement("span",{className:ge,style:Object.assign(Object.assign(Object.assign({},x==null?void 0:x.indicator),(i=E==null?void 0:E.styles)===null||i===void 0?void 0:i.indicator),de)}),d&&m.createElement("span",{style:{color:he},className:`${W}-status-text`},d)))}return j(m.createElement("span",Object.assign({ref:e},R,{className:Z,style:Object.assign(Object.assign({},(a=E==null?void 0:E.styles)===null||a===void 0?void 0:a.root),x==null?void 0:x.root)}),c,m.createElement(o1,{visible:!X,motionName:`${W}-zoom`,motionAppear:!1,motionDeadline:1e3},he=>{let{className:xe,ref:He}=he;var Se,ze;const Ie=M("scroll-number",s),ye=te.current,ce=Un(A==null?void 0:A.indicator,(Se=E==null?void 0:E.classNames)===null||Se===void 0?void 0:Se.indicator,{[`${W}-dot`]:ye,[`${W}-count`]:!ye,[`${W}-count-sm`]:w==="small",[`${W}-multiple-words`]:!ye&&q&&q.toString().length>1,[`${W}-status-${u}`]:!!u,[`${W}-color-${f}`]:fe});let pe=Object.assign(Object.assign(Object.assign({},x==null?void 0:x.indicator),(ze=E==null?void 0:E.styles)===null||ze===void 0?void 0:ze.indicator),re);return f&&!fe&&(pe=pe||{},pe.background=f),m.createElement(dFt,{prefixCls:Ie,show:!X,motionClassName:xe,className:ce,count:q,title:ae,style:pe,key:"scrollNumber",ref:He},ne)}),se))}),QGe=hFt;QGe.Ribbon=lFt;var pFt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},gFt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:pFt}))},UG=m.forwardRef(gFt),mFt=Bn.ESC,yFt=Bn.TAB;function AFt(t){var e=t.visible,n=t.triggerRef,o=t.onVisibleChange,r=t.autoFocus,i=t.overlayRef,a=m.useRef(!1),l=function(){if(e){var d,f;(d=n.current)===null||d===void 0||(f=d.focus)===null||f===void 0||f.call(d),o==null||o(!1)}},s=function(){var d;return(d=i.current)!==null&&d!==void 0&&d.focus?(i.current.focus(),a.current=!0,!0):!1},c=function(d){switch(d.keyCode){case mFt:l();break;case yFt:{var f=!1;a.current||(f=s()),f?d.preventDefault():l();break}}};m.useEffect(function(){return e?(window.addEventListener("keydown",c),r&&Fa(s,3),function(){window.removeEventListener("keydown",c),a.current=!1}):function(){a.current=!1}},[e])}var wFt=m.forwardRef(function(t,e){var n=t.overlay,o=t.arrow,r=t.prefixCls,i=m.useMemo(function(){var l;return typeof n=="function"?l=n():l=n,l},[n]),a=Fb(e,i==null?void 0:i.ref);return be.createElement(be.Fragment,null,o&&be.createElement("div",{className:"".concat(r,"-arrow")}),be.cloneElement(i,{ref:rw(i)?a:void 0}))}),ET={adjustX:1,adjustY:1},FT=[0,0],vFt={topLeft:{points:["bl","tl"],overflow:ET,offset:[0,-4],targetOffset:FT},top:{points:["bc","tc"],overflow:ET,offset:[0,-4],targetOffset:FT},topRight:{points:["br","tr"],overflow:ET,offset:[0,-4],targetOffset:FT},bottomLeft:{points:["tl","bl"],overflow:ET,offset:[0,4],targetOffset:FT},bottom:{points:["tc","bc"],overflow:ET,offset:[0,4],targetOffset:FT},bottomRight:{points:["tr","br"],overflow:ET,offset:[0,4],targetOffset:FT}},xFt=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function bFt(t,e){var n,o=t.arrow,r=o===void 0?!1:o,i=t.prefixCls,a=i===void 0?"rc-dropdown":i,l=t.transitionName,s=t.animation,c=t.align,u=t.placement,d=u===void 0?"bottomLeft":u,f=t.placements,p=f===void 0?vFt:f,g=t.getPopupContainer,y=t.showAction,w=t.hideAction,b=t.overlayClassName,C=t.overlayStyle,P=t.visible,v=t.trigger,T=v===void 0?["hover"]:v,A=t.autoFocus,x=t.overlay,S=t.children,R=t.onVisibleChange,M=ii(t,xFt),D=be.useState(),E=ln(D,2),W=E[0],j=E[1],L="visible"in t?P:W,k=be.useRef(null),N=be.useRef(null),F=be.useRef(null);be.useImperativeHandle(e,function(){return k.current});var U=function(te){j(te),R==null||R(te)};AFt({visible:L,triggerRef:F,onVisibleChange:U,autoFocus:A,overlayRef:N});var O=function(te){var re=t.onOverlayClick;j(!1),re&&re(te)},B=function(){return be.createElement(wFt,{ref:N,overlay:x,prefixCls:a,arrow:r})},_=function(){return typeof x=="function"?B:B()},X=function(){var te=t.minOverlayWidthMatchTrigger,re=t.alignPoint;return"minOverlayWidthMatchTrigger"in t?te:!re},$=function(){var te=t.openClassName;return te!==void 0?te:"".concat(a,"-open")},Q=be.cloneElement(S,{className:Vn((n=S.props)===null||n===void 0?void 0:n.className,L&&$()),ref:rw(S)?Fb(F,S.ref):void 0}),le=w;return!le&&T.indexOf("contextMenu")!==-1&&(le=["click"]),be.createElement(_W,ho({builtinPlacements:p},M,{prefixCls:a,ref:k,popupClassName:Vn(b,Vt({},"".concat(a,"-show-arrow"),r)),popupStyle:C,action:T,showAction:y,hideAction:le,popupPlacement:d,popupAlign:c,popupTransitionName:l,popupAnimation:s,popupVisible:L,stretch:X()?"minWidth":"",popup:_(),onPopupVisibleChange:U,onPopupClick:O,getPopupContainer:g}),Q)}const ZGe=be.forwardRef(bFt);var eXe=m.createContext(null);function tXe(t,e){return t===void 0?null:"".concat(t,"-").concat(e)}function nXe(t){var e=m.useContext(eXe);return tXe(e,t)}var SFt=["children","locked"],G2=m.createContext(null);function TFt(t,e){var n=qt({},t);return Object.keys(e).forEach(function(o){var r=e[o];r!==void 0&&(n[o]=r)}),n}function sk(t){var e=t.children,n=t.locked,o=ii(t,SFt),r=m.useContext(G2),i=RW(function(){return TFt(r,o)},[r,o],function(a,l){return!n&&(a[0]!==l[0]||!iw(a[1],l[1],!0))});return m.createElement(G2.Provider,{value:i},e)}var PFt=[],oXe=m.createContext(null);function $$(){return m.useContext(oXe)}var rXe=m.createContext(PFt);function YH(t){var e=m.useContext(rXe);return m.useMemo(function(){return t!==void 0?[].concat(Lo(e),[t]):e},[e,t])}var iXe=m.createContext(null),Nme=m.createContext({});function Yve(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(V$(t)){var n=t.nodeName.toLowerCase(),o=["input","select","textarea","button"].includes(n)||t.isContentEditable||n==="a"&&!!t.getAttribute("href"),r=t.getAttribute("tabindex"),i=Number(r),a=null;return r&&!Number.isNaN(i)?a=i:o&&a===null&&(a=0),o&&t.disabled&&(a=null),a!==null&&(a>=0||e&&a<0)}return!1}function CFt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=Lo(t.querySelectorAll("*")).filter(function(o){return Yve(o,e)});return Yve(t,e)&&n.unshift(t),n}var eue=Bn.LEFT,tue=Bn.RIGHT,nue=Bn.UP,X_=Bn.DOWN,J_=Bn.ENTER,aXe=Bn.ESC,Fz=Bn.HOME,kz=Bn.END,Ove=[nue,X_,eue,tue];function RFt(t,e,n,o){var r,i="prev",a="next",l="children",s="parent";if(t==="inline"&&o===J_)return{inlineTrigger:!0};var c=Vt(Vt({},nue,i),X_,a),u=Vt(Vt(Vt(Vt({},eue,n?a:i),tue,n?i:a),X_,l),J_,l),d=Vt(Vt(Vt(Vt(Vt(Vt({},nue,i),X_,a),J_,l),aXe,s),eue,n?l:s),tue,n?s:l),f={inline:c,horizontal:u,vertical:d,inlineSub:c,horizontalSub:d,verticalSub:d},p=(r=f["".concat(t).concat(e?"":"Sub")])===null||r===void 0?void 0:r[o];switch(p){case i:return{offset:-1,sibling:!0};case a:return{offset:1,sibling:!0};case s:return{offset:-1,sibling:!1};case l:return{offset:1,sibling:!1};default:return null}}function HFt(t){for(var e=t;e;){if(e.getAttribute("data-menu-list"))return e;e=e.parentElement}return null}function MFt(t,e){for(var n=t||document.activeElement;n;){if(e.has(n))return n;n=n.parentElement}return null}function Ume(t,e){var n=CFt(t,!0);return n.filter(function(o){return e.has(o)})}function _ve(t,e,n){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!t)return null;var r=Ume(t,e),i=r.length,a=r.findIndex(function(l){return n===l});return o<0?a===-1?a=i-1:a-=1:o>0&&(a+=1),a=(a+i)%i,r[a]}var oue=function(e,n){var o=new Set,r=new Map,i=new Map;return e.forEach(function(a){var l=document.querySelector("[data-menu-id='".concat(tXe(n,a),"']"));l&&(o.add(l),i.set(l,a),r.set(a,l))}),{elements:o,key2element:r,element2key:i}};function IFt(t,e,n,o,r,i,a,l,s,c){var u=m.useRef(),d=m.useRef();d.current=e;var f=function(){Fa.cancel(u.current)};return m.useEffect(function(){return function(){f()}},[]),function(p){var g=p.which;if([].concat(Ove,[J_,aXe,Fz,kz]).includes(g)){var y=i(),w=oue(y,o),b=w,C=b.elements,P=b.key2element,v=b.element2key,T=P.get(e),A=MFt(T,C),x=v.get(A),S=RFt(t,a(x,!0).length===1,n,g);if(!S&&g!==Fz&&g!==kz)return;(Ove.includes(g)||[Fz,kz].includes(g))&&p.preventDefault();var R=function(N){if(N){var F=N,U=N.querySelector("a");U!=null&&U.getAttribute("href")&&(F=U);var O=v.get(N);l(O),f(),u.current=Fa(function(){d.current===O&&F.focus()})}};if([Fz,kz].includes(g)||S.sibling||!A){var M;!A||t==="inline"?M=r.current:M=HFt(A);var D,E=Ume(M,C);g===Fz?D=E[0]:g===kz?D=E[E.length-1]:D=_ve(M,C,A,S.offset),R(D)}else if(S.inlineTrigger)s(x);else if(S.offset>0)s(x,!0),f(),u.current=Fa(function(){w=oue(y,o);var k=A.getAttribute("aria-controls"),N=document.getElementById(k),F=_ve(N,w.elements);R(F)},5);else if(S.offset<0){var W=a(x,!0),j=W[W.length-2],L=P.get(j);s(j,!1),R(L)}}c==null||c(p)}}function zFt(t){Promise.resolve().then(t)}var jme="__RC_UTIL_PATH_SPLIT__",Vve=function(e){return e.join(jme)},DFt=function(e){return e.split(jme)},rue="rc-menu-more";function EFt(){var t=m.useState({}),e=ln(t,2),n=e[1],o=m.useRef(new Map),r=m.useRef(new Map),i=m.useState([]),a=ln(i,2),l=a[0],s=a[1],c=m.useRef(0),u=m.useRef(!1),d=function(){u.current||n({})},f=m.useCallback(function(P,v){var T=Vve(v);r.current.set(T,P),o.current.set(P,T),c.current+=1;var A=c.current;zFt(function(){A===c.current&&d()})},[]),p=m.useCallback(function(P,v){var T=Vve(v);r.current.delete(T),o.current.delete(P)},[]),g=m.useCallback(function(P){s(P)},[]),y=m.useCallback(function(P,v){var T=o.current.get(P)||"",A=DFt(T);return v&&l.includes(A[0])&&A.unshift(rue),A},[l]),w=m.useCallback(function(P,v){return P.some(function(T){var A=y(T,!0);return A.includes(v)})},[y]),b=function(){var v=Lo(o.current.keys());return l.length&&v.push(rue),v},C=m.useCallback(function(P){var v="".concat(o.current.get(P)).concat(jme),T=new Set;return Lo(r.current.keys()).forEach(function(A){A.startsWith(v)&&T.add(r.current.get(A))}),T},[]);return m.useEffect(function(){return function(){u.current=!0}},[]),{registerPath:f,unregisterPath:p,refreshOverflowKeys:g,isSubPathKey:w,getKeyPath:y,getKeys:b,getSubPathKeys:C}}function HD(t){var e=m.useRef(t);e.current=t;var n=m.useCallback(function(){for(var o,r=arguments.length,i=new Array(r),a=0;a1&&(C.motionAppear=!1);var P=C.onVisibleChanged;return C.onVisibleChanged=function(v){return!f.current&&!v&&w(!0),P==null?void 0:P(v)},y?null:m.createElement(sk,{mode:i,locked:!f.current},m.createElement(o1,ho({visible:b},C,{forceRender:s,removeOnLeave:!1,leavedClassName:"".concat(l,"-hidden")}),function(v){var T=v.className,A=v.style;return m.createElement(Bme,{id:e,className:T,style:A},r)}))}var qFt=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],$Ft=["active"],QFt=function(e){var n=e.style,o=e.className,r=e.title,i=e.eventKey;e.warnKey;var a=e.disabled,l=e.internalPopupClose,s=e.children,c=e.itemIcon,u=e.expandIcon,d=e.popupClassName,f=e.popupOffset,p=e.popupStyle,g=e.onClick,y=e.onMouseEnter,w=e.onMouseLeave,b=e.onTitleClick,C=e.onTitleMouseEnter,P=e.onTitleMouseLeave,v=ii(e,qFt),T=nXe(i),A=m.useContext(G2),x=A.prefixCls,S=A.mode,R=A.openKeys,M=A.disabled,D=A.overflowDisabled,E=A.activeKey,W=A.selectedKeys,j=A.itemIcon,L=A.expandIcon,k=A.onItemClick,N=A.onOpenChange,F=A.onActive,U=m.useContext(Nme),O=U._internalRenderSubMenuItem,B=m.useContext(iXe),_=B.isSubPathKey,X=YH(),$="".concat(x,"-submenu"),Q=M||a,le=m.useRef(),q=m.useRef(),te=c??j,re=u??L,ae=R.includes(i),se=!D&&ae,ne=_(W,i),fe=lXe(i,Q,C,P),ge=fe.active,de=ii(fe,$Ft),Z=m.useState(!1),he=ln(Z,2),xe=he[0],He=he[1],Se=function(Ke){Q||He(Ke)},ze=function(Ke){Se(!0),y==null||y({key:i,domEvent:Ke})},Ie=function(Ke){Se(!1),w==null||w({key:i,domEvent:Ke})},ye=m.useMemo(function(){return ge||(S!=="inline"?xe||_([E],i):!1)},[S,ge,E,xe,i,_]),ce=sXe(X.length),pe=function(Ke){Q||(b==null||b({key:i,domEvent:Ke}),S==="inline"&&N(i,!ae))},ve=HD(function(We){g==null||g(jG(We)),k(We)}),Ae=function(Ke){S!=="inline"&&N(i,Ke)},Te=function(){F(i)},Me=T&&"".concat(T,"-popup"),Pe=m.createElement("div",ho({role:"menuitem",style:ce,className:"".concat($,"-title"),tabIndex:Q?null:-1,ref:le,title:typeof r=="string"?r:null,"data-menu-id":D&&T?null:T,"aria-expanded":se,"aria-haspopup":!0,"aria-controls":Me,"aria-disabled":Q,onClick:pe,onFocus:Te},de),r,m.createElement(cXe,{icon:S!=="horizontal"?re:void 0,props:qt(qt({},e),{},{isOpen:se,isSubMenu:!0})},m.createElement("i",{className:"".concat($,"-arrow")}))),Ee=m.useRef(S);if(S!=="inline"&&X.length>1?Ee.current="vertical":Ee.current=S,!D){var Be=Ee.current;Pe=m.createElement(JFt,{mode:Be,prefixCls:$,visible:!l&&se&&S!=="inline",popupClassName:d,popupOffset:f,popupStyle:p,popup:m.createElement(sk,{mode:Be==="horizontal"?"vertical":Be},m.createElement(Bme,{id:Me,ref:q},s)),disabled:Q,onVisibleChange:Ae},Pe)}var Je=m.createElement(k2.Item,ho({role:"none"},v,{component:"li",style:n,className:Vn($,"".concat($,"-").concat(S),o,Vt(Vt(Vt(Vt({},"".concat($,"-open"),se),"".concat($,"-active"),ye),"".concat($,"-selected"),ne),"".concat($,"-disabled"),Q)),onMouseEnter:ze,onMouseLeave:Ie}),Pe,!D&&m.createElement(KFt,{id:Me,open:se,keyPath:X},s));return O&&(Je=O(Je,e,{selected:ne,active:ye,open:se,disabled:Q})),m.createElement(sk,{onItemClick:ve,mode:S==="horizontal"?"vertical":S,itemIcon:te,expandIcon:re},Je)};function Q$(t){var e=t.eventKey,n=t.children,o=YH(e),r=Yme(n,o),i=$$();m.useEffect(function(){if(i)return i.registerPath(e,o),function(){i.unregisterPath(e,o)}},[o]);var a;return i?a=r:a=m.createElement(QFt,t,r),m.createElement(rXe.Provider,{value:o},a)}var ZFt=["className","title","eventKey","children"],ekt=["children"],tkt=function(e){var n=e.className,o=e.title;e.eventKey;var r=e.children,i=ii(e,ZFt),a=m.useContext(G2),l=a.prefixCls,s="".concat(l,"-item-group");return m.createElement("li",ho({role:"presentation"},i,{onClick:function(u){return u.stopPropagation()},className:Vn(s,n)}),m.createElement("div",{role:"presentation",className:"".concat(s,"-title"),title:typeof o=="string"?o:void 0},o),m.createElement("ul",{role:"group",className:"".concat(s,"-list")},r))};function Z$(t){var e=t.children,n=ii(t,ekt),o=YH(n.eventKey),r=Yme(e,o),i=$$();return i?r:m.createElement(tkt,jH(n,["warnKey"]),r)}function Ome(t){var e=t.className,n=t.style,o=m.useContext(G2),r=o.prefixCls,i=$$();return i?null:m.createElement("li",{role:"separator",className:Vn("".concat(r,"-item-divider"),e),style:n})}var nkt=["label","children","key","type"];function iue(t){return(t||[]).map(function(e,n){if(e&&hi(e)==="object"){var o=e,r=o.label,i=o.children,a=o.key,l=o.type,s=ii(o,nkt),c=a??"tmp-".concat(n);return i||l==="group"?l==="group"?m.createElement(Z$,ho({key:c},s,{title:r}),iue(i)):m.createElement(Q$,ho({key:c},s,{title:r}),iue(i)):l==="divider"?m.createElement(Ome,ho({key:c},s)):m.createElement(VW,ho({key:c},s),r)}return null}).filter(function(e){return e})}function okt(t,e,n){var o=t;return e&&(o=iue(e)),Yme(o,n)}var rkt=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],kT=[],ikt=m.forwardRef(function(t,e){var n,o=t,r=o.prefixCls,i=r===void 0?"rc-menu":r,a=o.rootClassName,l=o.style,s=o.className,c=o.tabIndex,u=c===void 0?0:c,d=o.items,f=o.children,p=o.direction,g=o.id,y=o.mode,w=y===void 0?"vertical":y,b=o.inlineCollapsed,C=o.disabled,P=o.disabledOverflow,v=o.subMenuOpenDelay,T=v===void 0?.1:v,A=o.subMenuCloseDelay,x=A===void 0?.1:A,S=o.forceSubMenuRender,R=o.defaultOpenKeys,M=o.openKeys,D=o.activeKey,E=o.defaultActiveFirst,W=o.selectable,j=W===void 0?!0:W,L=o.multiple,k=L===void 0?!1:L,N=o.defaultSelectedKeys,F=o.selectedKeys,U=o.onSelect,O=o.onDeselect,B=o.inlineIndent,_=B===void 0?24:B,X=o.motion,$=o.defaultMotions,Q=o.triggerSubMenuAction,le=Q===void 0?"hover":Q,q=o.builtinPlacements,te=o.itemIcon,re=o.expandIcon,ae=o.overflowedIndicator,se=ae===void 0?"...":ae,ne=o.overflowedIndicatorPopupClassName,fe=o.getPopupContainer,ge=o.onClick,de=o.onOpenChange,Z=o.onKeyDown;o.openAnimation,o.openTransitionName;var he=o._internalRenderMenuItem,xe=o._internalRenderSubMenuItem,He=ii(o,rkt),Se=m.useMemo(function(){return okt(f,d,kT)},[f,d]),ze=m.useState(!1),Ie=ln(ze,2),ye=Ie[0],ce=Ie[1],pe=m.useRef(),ve=kFt(g),Ae=p==="rtl",Te=zs(R,{value:M,postState:function(mo){return mo||kT}}),Me=ln(Te,2),Pe=Me[0],Ee=Me[1],Be=function(mo){var Jn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function uo(){Ee(mo),de==null||de(mo)}Jn?Cd.flushSync(uo):uo()},Je=m.useState(Pe),We=ln(Je,2),Ke=We[0],Ne=We[1],De=m.useRef(!1),ke=m.useMemo(function(){return(w==="inline"||w==="vertical")&&b?["vertical",b]:[w,!1]},[w,b]),Ye=ln(ke,2),it=Ye[0],Ve=Ye[1],yt=it==="inline",ct=m.useState(it),Xe=ln(ct,2),ut=Xe[0],ft=Xe[1],ot=m.useState(Ve),st=ln(ot,2),at=st[0],Oe=st[1];m.useEffect(function(){ft(it),Oe(Ve),De.current&&(yt?Ee(Ke):Be(kT))},[it,Ve]);var Ze=m.useState(0),St=ln(Ze,2),Pt=St[0],Rt=St[1],Ut=Pt>=Se.length-1||ut!=="horizontal"||P;m.useEffect(function(){yt&&Ne(Pe)},[Pe]),m.useEffect(function(){return De.current=!0,function(){De.current=!1}},[]);var Ht=EFt(),At=Ht.registerPath,kt=Ht.unregisterPath,gt=Ht.refreshOverflowKeys,dt=Ht.isSubPathKey,Ct=Ht.getKeyPath,tt=Ht.getKeys,Fe=Ht.getSubPathKeys,qe=m.useMemo(function(){return{registerPath:At,unregisterPath:kt}},[At,kt]),je=m.useMemo(function(){return{isSubPathKey:dt}},[dt]);m.useEffect(function(){gt(Ut?kT:Se.slice(Pt+1).map(function($o){return $o.key}))},[Pt,Ut]);var rt=zs(D||E&&((n=Se[0])===null||n===void 0?void 0:n.key),{value:D}),mt=ln(rt,2),Qe=mt[0],Tt=mt[1],Dt=HD(function($o){Tt($o)}),lt=HD(function(){Tt(void 0)});m.useImperativeHandle(e,function(){return{list:pe.current,focus:function(mo){var Jn,uo=tt(),ir=oue(uo,ve),Rr=ir.elements,br=ir.key2element,Vr=ir.element2key,Wo=Ume(pe.current,Rr),wn=Qe??(Wo[0]?Vr.get(Wo[0]):(Jn=Se.find(function(No){return!No.props.disabled}))===null||Jn===void 0?void 0:Jn.key),In=br.get(wn);if(wn&&In){var ar;In==null||(ar=In.focus)===null||ar===void 0||ar.call(In,mo)}}}});var zt=zs(N||[],{value:F,postState:function(mo){return Array.isArray(mo)?mo:mo==null?kT:[mo]}}),Ft=ln(zt,2),_t=Ft[0],tn=Ft[1],Qt=function(mo){if(j){var Jn=mo.key,uo=_t.includes(Jn),ir;k?uo?ir=_t.filter(function(br){return br!==Jn}):ir=[].concat(Lo(_t),[Jn]):ir=[Jn],tn(ir);var Rr=qt(qt({},mo),{},{selectedKeys:ir});uo?O==null||O(Rr):U==null||U(Rr)}!k&&Pe.length&&ut!=="inline"&&Be(kT)},gn=HD(function($o){ge==null||ge(jG($o)),Qt($o)}),an=HD(function($o,mo){var Jn=Pe.filter(function(ir){return ir!==$o});if(mo)Jn.push($o);else if(ut!=="inline"){var uo=Fe($o);Jn=Jn.filter(function(ir){return!uo.has(ir)})}iw(Pe,Jn,!0)||Be(Jn,!0)}),mn=function(mo,Jn){var uo=Jn??!Pe.includes(mo);an(mo,uo)},Hn=IFt(ut,Qe,Ae,ve,pe,tt,Ct,Tt,mn,Z);m.useEffect(function(){ce(!0)},[]);var Fo=m.useMemo(function(){return{_internalRenderMenuItem:he,_internalRenderSubMenuItem:xe}},[he,xe]),yo=ut!=="horizontal"||P?Se:Se.map(function($o,mo){return m.createElement(sk,{key:$o.key,overflowDisabled:mo>Pt},$o)}),So=m.createElement(k2,ho({id:g,ref:pe,prefixCls:"".concat(i,"-overflow"),component:"ul",itemComponent:VW,className:Vn(i,"".concat(i,"-root"),"".concat(i,"-").concat(ut),s,Vt(Vt({},"".concat(i,"-inline-collapsed"),at),"".concat(i,"-rtl"),Ae),a),dir:p,style:l,role:"menu",tabIndex:u,data:yo,renderRawItem:function(mo){return mo},renderRawRest:function(mo){var Jn=mo.length,uo=Jn?Se.slice(-Jn):null;return m.createElement(Q$,{eventKey:rue,title:se,disabled:Ut,internalPopupClose:Jn===0,popupClassName:ne},uo)},maxCount:ut!=="horizontal"||P?k2.INVALIDATE:k2.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(mo){Rt(mo)},onKeyDown:Hn},He));return m.createElement(Nme.Provider,{value:Fo},m.createElement(eXe.Provider,{value:ve},m.createElement(sk,{prefixCls:i,rootClassName:a,mode:ut,openKeys:Pe,rtl:Ae,disabled:C,motion:ye?X:null,defaultMotions:ye?$:null,activeKey:Qe,onActive:Dt,onInactive:lt,selectedKeys:_t,inlineIndent:_,subMenuOpenDelay:T,subMenuCloseDelay:x,forceSubMenuRender:S,builtinPlacements:q,triggerSubMenuAction:le,getPopupContainer:fe,itemIcon:te,expandIcon:re,onItemClick:gn,onOpenChange:an},m.createElement(iXe.Provider,{value:je},So),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(oXe.Provider,{value:qe},Se)))))}),OH=ikt;OH.Item=VW;OH.SubMenu=Q$;OH.ItemGroup=Z$;OH.Divider=Ome;var akt={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},lkt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:akt}))},_me=m.forwardRef(lkt),skt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},ckt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:skt}))},Xve=m.forwardRef(ckt);const dXe=m.createContext({});var ukt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},dkt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:ukt}))},Vme=m.forwardRef(dkt),fkt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:e,className:n,dashed:o}=t,r=fkt(t,["prefixCls","className","dashed"]),{getPrefixCls:i}=m.useContext(Cr),a=i("menu",e),l=Un({[`${a}-item-divider-dashed`]:!!o},n);return m.createElement(Ome,Object.assign({className:l},r))},BG=m.createContext({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),hXe=t=>{var e;const{className:n,children:o,icon:r,title:i,danger:a}=t,{prefixCls:l,firstLevel:s,direction:c,disableMenuItemTitleTooltip:u,inlineCollapsed:d}=m.useContext(BG),f=C=>{const P=m.createElement("span",{className:`${l}-title-content`},o);return(!r||m.isValidElement(o)&&o.type==="span")&&o&&C&&s&&typeof o=="string"?m.createElement("div",{className:`${l}-inline-collapsed-noicon`},o.charAt(0)):P},{siderCollapsed:p}=m.useContext(dXe);let g=i;typeof i>"u"?g=s?o:"":i===!1&&(g="");const y={title:g};!p&&!d&&(y.title=null,y.open=!1);const w=B9(o).length;let b=m.createElement(VW,Object.assign({},up(t,["title","icon","danger"]),{className:Un({[`${l}-item-danger`]:a,[`${l}-item-only-child`]:(r?w+1:w)===1},n),title:typeof i=="string"?i:void 0}),B0(r,{className:Un(m.isValidElement(r)?(e=r.props)===null||e===void 0?void 0:e.className:"",`${l}-item-icon`)}),f(d));return u||(b=m.createElement(tA,Object.assign({},y,{placement:c==="rtl"?"left":"right",overlayClassName:`${l}-inline-collapsed-tooltip`}),b)),b},pXe=t=>{var e;const{popupClassName:n,icon:o,title:r,theme:i}=t,a=m.useContext(BG),{prefixCls:l,inlineCollapsed:s,theme:c}=a,u=YH();let d;if(!o)d=s&&!u.length&&r&&typeof r=="string"?m.createElement("div",{className:`${l}-inline-collapsed-noicon`},r.charAt(0)):m.createElement("span",{className:`${l}-title-content`},r);else{const g=m.isValidElement(r)&&r.type==="span";d=m.createElement(m.Fragment,null,B0(o,{className:Un(m.isValidElement(o)?(e=o.props)===null||e===void 0?void 0:e.className:"",`${l}-item-icon`)}),g?r:m.createElement("span",{className:`${l}-title-content`},r))}const f=m.useMemo(()=>Object.assign(Object.assign({},a),{firstLevel:!1}),[a]),[p]=Ww("Menu");return m.createElement(BG.Provider,{value:f},m.createElement(Q$,Object.assign({},up(t,["icon"]),{title:d,popupClassName:Un(l,n,`${l}-${i||c}`),popupStyle:{zIndex:p}})))};var hkt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{if(e&&typeof e=="object"){const o=e,{label:r,children:i,key:a,type:l}=o,s=hkt(o,["label","children","key","type"]),c=a??`tmp-${n}`;return i||l==="group"?l==="group"?m.createElement(Z$,Object.assign({key:c},s,{title:r}),aue(i)):m.createElement(pXe,Object.assign({key:c},s,{title:r}),aue(i)):l==="divider"?m.createElement(fXe,Object.assign({key:c},s)):m.createElement(hXe,Object.assign({key:c},s),r)}return null}).filter(e=>e)}function pkt(t){return m.useMemo(()=>t&&aue(t),[t])}var gkt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{children:n}=t,o=gkt(t,["children"]),r=m.useContext(YG),i=m.useMemo(()=>Object.assign(Object.assign({},r),o),[r,o.prefixCls,o.mode,o.selectable,o.rootClassName]),a=xPt(n),l=vPt(e,a?n.ref:null);return m.createElement(YG.Provider,{value:i},m.createElement(Y9,null,a?m.cloneElement(n,{ref:l}):n))}),mkt=t=>{const{componentCls:e,motionDurationSlow:n,horizontalLineHeight:o,colorSplit:r,lineWidth:i,lineType:a,itemPaddingInline:l}=t;return{[`${e}-horizontal`]:{lineHeight:o,border:0,borderBottom:`${Nt(i)} ${a} ${r}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${e}-item, ${e}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:l},[`> ${e}-item:hover, > ${e}-item-active, > ${e}-submenu ${e}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${e}-item, ${e}-submenu-title`]:{transition:[`border-color ${n}`,`background ${n}`].join(",")},[`${e}-submenu-arrow`]:{display:"none"}}}},ykt=t=>{let{componentCls:e,menuArrowOffset:n,calc:o}=t;return{[`${e}-rtl`]:{direction:"rtl"},[`${e}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${e}-rtl${e}-vertical, - ${e}-submenu-rtl ${e}-vertical`]:{[`${e}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(${Nt(o(n).mul(-1).equal())})`},"&::after":{transform:`rotate(45deg) translateY(${Nt(n)})`}}}}},Xve=t=>Object.assign({},lw(t)),Jve=(t,e)=>{const{componentCls:n,itemColor:o,itemSelectedColor:r,groupTitleColor:i,itemBg:a,subMenuItemBg:l,itemSelectedBg:s,activeBarHeight:c,activeBarWidth:u,activeBarBorderWidth:d,motionDurationSlow:f,motionEaseInOut:p,motionEaseOut:g,itemPaddingInline:y,motionDurationMid:w,itemHoverColor:b,lineType:C,colorSplit:P,itemDisabledColor:v,dangerItemColor:T,dangerItemHoverColor:A,dangerItemSelectedColor:x,dangerItemActiveBg:S,dangerItemSelectedBg:R,popupBg:M,itemHoverBg:D,itemActiveBg:E,menuSubMenuBg:W,horizontalItemSelectedColor:j,horizontalItemSelectedBg:L,horizontalItemBorderRadius:k,horizontalItemHoverBg:N}=t;return{[`${n}-${e}, ${n}-${e} > ${n}`]:{color:o,background:a,[`&${n}-root:focus-visible`]:Object.assign({},Xve(t)),[`${n}-item-group-title`]:{color:i},[`${n}-submenu-selected`]:{[`> ${n}-submenu-title`]:{color:r}},[`${n}-item, ${n}-submenu-title`]:{color:o,[`&:not(${n}-item-disabled):focus-visible`]:Object.assign({},Xve(t))},[`${n}-item-disabled, ${n}-submenu-disabled`]:{color:`${v} !important`},[`${n}-item:not(${n}-item-selected):not(${n}-submenu-selected)`]:{[`&:hover, > ${n}-submenu-title:hover`]:{color:b}},[`&:not(${n}-horizontal)`]:{[`${n}-item:not(${n}-item-selected)`]:{"&:hover":{backgroundColor:D},"&:active":{backgroundColor:E}},[`${n}-submenu-title`]:{"&:hover":{backgroundColor:D},"&:active":{backgroundColor:E}}},[`${n}-item-danger`]:{color:T,[`&${n}-item:hover`]:{[`&:not(${n}-item-selected):not(${n}-submenu-selected)`]:{color:A}},[`&${n}-item:active`]:{background:S}},[`${n}-item a`]:{"&, &:hover":{color:"inherit"}},[`${n}-item-selected`]:{color:r,[`&${n}-item-danger`]:{color:x},"a, a:hover":{color:"inherit"}},[`& ${n}-item-selected`]:{backgroundColor:s,[`&${n}-item-danger`]:{backgroundColor:R}},[`&${n}-submenu > ${n}`]:{backgroundColor:W},[`&${n}-popup > ${n}`]:{backgroundColor:M},[`&${n}-submenu-popup > ${n}`]:{backgroundColor:M},[`&${n}-horizontal`]:Object.assign(Object.assign({},e==="dark"?{borderBottom:0}:{}),{[`> ${n}-item, > ${n}-submenu`]:{top:d,marginTop:t.calc(d).mul(-1).equal(),marginBottom:0,borderRadius:k,"&::after":{position:"absolute",insetInline:y,bottom:0,borderBottom:`${Nt(c)} solid transparent`,transition:`border-color ${f} ${p}`,content:'""'},"&:hover, &-active, &-open":{background:N,"&::after":{borderBottomWidth:c,borderBottomColor:j}},"&-selected":{color:j,backgroundColor:L,"&:hover":{backgroundColor:L},"&::after":{borderBottomWidth:c,borderBottomColor:j}}}}),[`&${n}-root`]:{[`&${n}-inline, &${n}-vertical`]:{borderInlineEnd:`${Nt(d)} ${C} ${P}`}},[`&${n}-inline`]:{[`${n}-sub${n}-inline`]:{background:l},[`${n}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${Nt(u)} solid ${r}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${w} ${g}`,`opacity ${w} ${g}`].join(","),content:'""'},[`&${n}-item-danger`]:{"&::after":{borderInlineEndColor:x}}},[`${n}-selected, ${n}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${w} ${p}`,`opacity ${w} ${p}`].join(",")}}}}}},Kve=t=>{const{componentCls:e,itemHeight:n,itemMarginInline:o,padding:r,menuArrowSize:i,marginXS:a,itemMarginBlock:l,itemWidth:s}=t,c=t.calc(i).add(r).add(a).equal();return{[`${e}-item`]:{position:"relative",overflow:"hidden"},[`${e}-item, ${e}-submenu-title`]:{height:n,lineHeight:Nt(n),paddingInline:r,overflow:"hidden",textOverflow:"ellipsis",marginInline:o,marginBlock:l,width:s},[`> ${e}-item, + ${e}-submenu-rtl ${e}-vertical`]:{[`${e}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(${Nt(o(n).mul(-1).equal())})`},"&::after":{transform:`rotate(45deg) translateY(${Nt(n)})`}}}}},Jve=t=>Object.assign({},lw(t)),Kve=(t,e)=>{const{componentCls:n,itemColor:o,itemSelectedColor:r,groupTitleColor:i,itemBg:a,subMenuItemBg:l,itemSelectedBg:s,activeBarHeight:c,activeBarWidth:u,activeBarBorderWidth:d,motionDurationSlow:f,motionEaseInOut:p,motionEaseOut:g,itemPaddingInline:y,motionDurationMid:w,itemHoverColor:b,lineType:C,colorSplit:P,itemDisabledColor:v,dangerItemColor:T,dangerItemHoverColor:A,dangerItemSelectedColor:x,dangerItemActiveBg:S,dangerItemSelectedBg:R,popupBg:M,itemHoverBg:D,itemActiveBg:E,menuSubMenuBg:W,horizontalItemSelectedColor:j,horizontalItemSelectedBg:L,horizontalItemBorderRadius:k,horizontalItemHoverBg:N}=t;return{[`${n}-${e}, ${n}-${e} > ${n}`]:{color:o,background:a,[`&${n}-root:focus-visible`]:Object.assign({},Jve(t)),[`${n}-item-group-title`]:{color:i},[`${n}-submenu-selected`]:{[`> ${n}-submenu-title`]:{color:r}},[`${n}-item, ${n}-submenu-title`]:{color:o,[`&:not(${n}-item-disabled):focus-visible`]:Object.assign({},Jve(t))},[`${n}-item-disabled, ${n}-submenu-disabled`]:{color:`${v} !important`},[`${n}-item:not(${n}-item-selected):not(${n}-submenu-selected)`]:{[`&:hover, > ${n}-submenu-title:hover`]:{color:b}},[`&:not(${n}-horizontal)`]:{[`${n}-item:not(${n}-item-selected)`]:{"&:hover":{backgroundColor:D},"&:active":{backgroundColor:E}},[`${n}-submenu-title`]:{"&:hover":{backgroundColor:D},"&:active":{backgroundColor:E}}},[`${n}-item-danger`]:{color:T,[`&${n}-item:hover`]:{[`&:not(${n}-item-selected):not(${n}-submenu-selected)`]:{color:A}},[`&${n}-item:active`]:{background:S}},[`${n}-item a`]:{"&, &:hover":{color:"inherit"}},[`${n}-item-selected`]:{color:r,[`&${n}-item-danger`]:{color:x},"a, a:hover":{color:"inherit"}},[`& ${n}-item-selected`]:{backgroundColor:s,[`&${n}-item-danger`]:{backgroundColor:R}},[`&${n}-submenu > ${n}`]:{backgroundColor:W},[`&${n}-popup > ${n}`]:{backgroundColor:M},[`&${n}-submenu-popup > ${n}`]:{backgroundColor:M},[`&${n}-horizontal`]:Object.assign(Object.assign({},e==="dark"?{borderBottom:0}:{}),{[`> ${n}-item, > ${n}-submenu`]:{top:d,marginTop:t.calc(d).mul(-1).equal(),marginBottom:0,borderRadius:k,"&::after":{position:"absolute",insetInline:y,bottom:0,borderBottom:`${Nt(c)} solid transparent`,transition:`border-color ${f} ${p}`,content:'""'},"&:hover, &-active, &-open":{background:N,"&::after":{borderBottomWidth:c,borderBottomColor:j}},"&-selected":{color:j,backgroundColor:L,"&:hover":{backgroundColor:L},"&::after":{borderBottomWidth:c,borderBottomColor:j}}}}),[`&${n}-root`]:{[`&${n}-inline, &${n}-vertical`]:{borderInlineEnd:`${Nt(d)} ${C} ${P}`}},[`&${n}-inline`]:{[`${n}-sub${n}-inline`]:{background:l},[`${n}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${Nt(u)} solid ${r}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${w} ${g}`,`opacity ${w} ${g}`].join(","),content:'""'},[`&${n}-item-danger`]:{"&::after":{borderInlineEndColor:x}}},[`${n}-selected, ${n}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${w} ${p}`,`opacity ${w} ${p}`].join(",")}}}}}},qve=t=>{const{componentCls:e,itemHeight:n,itemMarginInline:o,padding:r,menuArrowSize:i,marginXS:a,itemMarginBlock:l,itemWidth:s}=t,c=t.calc(i).add(r).add(a).equal();return{[`${e}-item`]:{position:"relative",overflow:"hidden"},[`${e}-item, ${e}-submenu-title`]:{height:n,lineHeight:Nt(n),paddingInline:r,overflow:"hidden",textOverflow:"ellipsis",marginInline:o,marginBlock:l,width:s},[`> ${e}-item, > ${e}-submenu > ${e}-submenu-title`]:{height:n,lineHeight:Nt(n)},[`${e}-item-group-list ${e}-submenu-title, - ${e}-submenu-title`]:{paddingInlineEnd:c}}},Akt=t=>{const{componentCls:e,iconCls:n,itemHeight:o,colorTextLightSolid:r,dropdownWidth:i,controlHeightLG:a,motionDurationMid:l,motionEaseOut:s,paddingXL:c,itemMarginInline:u,fontSizeLG:d,motionDurationSlow:f,paddingXS:p,boxShadowSecondary:g,collapsedWidth:y,collapsedIconSize:w}=t,b={height:o,lineHeight:Nt(o),listStylePosition:"inside",listStyleType:"disc"};return[{[e]:{"&-inline, &-vertical":Object.assign({[`&${e}-root`]:{boxShadow:"none"}},Kve(t))},[`${e}-submenu-popup`]:{[`${e}-vertical`]:Object.assign(Object.assign({},Kve(t)),{boxShadow:g})}},{[`${e}-submenu-popup ${e}-vertical${e}-sub`]:{minWidth:i,maxHeight:`calc(100vh - ${Nt(t.calc(a).mul(2.5).equal())})`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${e}-inline`]:{width:"100%",[`&${e}-root`]:{[`${e}-item, ${e}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${f}`,`background ${f}`,`padding ${l} ${s}`,`padding-inline calc(50% - ${Nt(t.calc(d).div(2).equal())} - ${Nt(u)})`].join(","),[`> ${e}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${e}-sub${e}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${e}-submenu > ${e}-submenu-title`]:b,[`& ${e}-item-group-title`]:{paddingInlineStart:c}},[`${e}-item`]:b}},{[`${e}-inline-collapsed`]:{width:y,[`&${e}-root`]:{[`${e}-item, ${e}-submenu ${e}-submenu-title`]:{[`> ${e}-inline-collapsed-noicon`]:{fontSize:d,textAlign:"center"}}},[`> ${e}-item, + ${e}-submenu-title`]:{paddingInlineEnd:c}}},Akt=t=>{const{componentCls:e,iconCls:n,itemHeight:o,colorTextLightSolid:r,dropdownWidth:i,controlHeightLG:a,motionDurationMid:l,motionEaseOut:s,paddingXL:c,itemMarginInline:u,fontSizeLG:d,motionDurationSlow:f,paddingXS:p,boxShadowSecondary:g,collapsedWidth:y,collapsedIconSize:w}=t,b={height:o,lineHeight:Nt(o),listStylePosition:"inside",listStyleType:"disc"};return[{[e]:{"&-inline, &-vertical":Object.assign({[`&${e}-root`]:{boxShadow:"none"}},qve(t))},[`${e}-submenu-popup`]:{[`${e}-vertical`]:Object.assign(Object.assign({},qve(t)),{boxShadow:g})}},{[`${e}-submenu-popup ${e}-vertical${e}-sub`]:{minWidth:i,maxHeight:`calc(100vh - ${Nt(t.calc(a).mul(2.5).equal())})`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${e}-inline`]:{width:"100%",[`&${e}-root`]:{[`${e}-item, ${e}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${f}`,`background ${f}`,`padding ${l} ${s}`,`padding-inline calc(50% - ${Nt(t.calc(d).div(2).equal())} - ${Nt(u)})`].join(","),[`> ${e}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${e}-sub${e}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${e}-submenu > ${e}-submenu-title`]:b,[`& ${e}-item-group-title`]:{paddingInlineStart:c}},[`${e}-item`]:b}},{[`${e}-inline-collapsed`]:{width:y,[`&${e}-root`]:{[`${e}-item, ${e}-submenu ${e}-submenu-title`]:{[`> ${e}-inline-collapsed-noicon`]:{fontSize:d,textAlign:"center"}}},[`> ${e}-item, > ${e}-item-group > ${e}-item-group-list > ${e}-item, > ${e}-item-group > ${e}-item-group-list > ${e}-submenu > ${e}-submenu-title, > ${e}-submenu > ${e}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${Nt(t.calc(d).div(2).equal())} - ${Nt(u)})`,textOverflow:"clip",[` ${e}-submenu-arrow, ${e}-submenu-expand-icon - `]:{opacity:0},[`${e}-item-icon, ${n}`]:{margin:0,fontSize:w,lineHeight:Nt(o),"+ span":{display:"inline-block",opacity:0}}},[`${e}-item-icon, ${n}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${e}-item-icon, ${n}`]:{display:"none"},"a, a:hover":{color:r}},[`${e}-item-group-title`]:Object.assign(Object.assign({},Gx),{paddingInline:p})}}]},qve=t=>{const{componentCls:e,motionDurationSlow:n,motionDurationMid:o,motionEaseInOut:r,motionEaseOut:i,iconCls:a,iconSize:l,iconMarginInlineEnd:s}=t;return{[`${e}-item, ${e}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${n}`,`background ${n}`,`padding ${n} ${r}`].join(","),[`${e}-item-icon, ${a}`]:{minWidth:l,fontSize:l,transition:[`font-size ${o} ${i}`,`margin ${n} ${r}`,`color ${n}`].join(","),"+ span":{marginInlineStart:s,opacity:1,transition:[`opacity ${n} ${r}`,`margin ${n}`,`color ${n}`].join(",")}},[`${e}-item-icon`]:Object.assign({},WH()),[`&${e}-item-only-child`]:{[`> ${a}, > ${e}-item-icon`]:{marginInlineEnd:0}}},[`${e}-item-disabled, ${e}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${e}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},$ve=t=>{const{componentCls:e,motionDurationSlow:n,motionEaseInOut:o,borderRadius:r,menuArrowSize:i,menuArrowOffset:a}=t;return{[`${e}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:t.margin,width:i,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${n} ${o}, opacity ${n}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:t.calc(i).mul(.6).equal(),height:t.calc(i).mul(.15).equal(),backgroundColor:"currentcolor",borderRadius:r,transition:[`background ${n} ${o}`,`transform ${n} ${o}`,`top ${n} ${o}`,`color ${n} ${o}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(${Nt(t.calc(a).mul(-1).equal())})`},"&::after":{transform:`rotate(-45deg) translateY(${Nt(a)})`}}}}},wkt=t=>{const{antCls:e,componentCls:n,fontSize:o,motionDurationSlow:r,motionDurationMid:i,motionEaseInOut:a,paddingXS:l,padding:s,colorSplit:c,lineWidth:u,zIndexPopup:d,borderRadiusLG:f,subMenuItemBorderRadius:p,menuArrowSize:g,menuArrowOffset:y,lineType:w,groupTitleLineHeight:b,groupTitleFontSize:C}=t;return[{"":{[`${n}`]:Object.assign(Object.assign({},ek()),{"&-hidden":{display:"none"}})},[`${n}-submenu-hidden`]:{display:"none"}},{[n]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),ek()),{marginBottom:0,paddingInlineStart:0,fontSize:o,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${r} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${n}-item`]:{flex:"none"}},[`${n}-item, ${n}-submenu, ${n}-submenu-title`]:{borderRadius:t.itemBorderRadius},[`${n}-item-group-title`]:{padding:`${Nt(l)} ${Nt(s)}`,fontSize:C,lineHeight:b,transition:`all ${r}`},[`&-horizontal ${n}-submenu`]:{transition:[`border-color ${r} ${a}`,`background ${r} ${a}`].join(",")},[`${n}-submenu, ${n}-submenu-inline`]:{transition:[`border-color ${r} ${a}`,`background ${r} ${a}`,`padding ${i} ${a}`].join(",")},[`${n}-submenu ${n}-sub`]:{cursor:"initial",transition:[`background ${r} ${a}`,`padding ${r} ${a}`].join(",")},[`${n}-title-content`]:{transition:`color ${r}`,[`> ${e}-typography-ellipsis-single-line`]:{display:"inline",verticalAlign:"unset"}},[`${n}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${n}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:c,borderStyle:w,borderWidth:0,borderTopWidth:u,marginBlock:u,padding:0,"&-dashed":{borderStyle:"dashed"}}}),qve(t)),{[`${n}-item-group`]:{[`${n}-item-group-list`]:{margin:0,padding:0,[`${n}-item, ${n}-submenu-title`]:{paddingInline:`${Nt(t.calc(o).mul(2).equal())} ${Nt(s)}`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:d,borderRadius:f,boxShadow:"none",transformOrigin:"0 0",[`&${n}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:0,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'},[`> ${n}`]:Object.assign(Object.assign(Object.assign({borderRadius:f},qve(t)),$ve(t)),{[`${n}-item, ${n}-submenu > ${n}-submenu-title`]:{borderRadius:p},[`${n}-submenu-title::after`]:{transition:`transform ${r} ${a}`}})},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:t.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:t.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:t.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:t.paddingXS}}}),$ve(t)),{[`&-inline-collapsed ${n}-submenu-arrow, - &-inline ${n}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${Nt(y)})`},"&::after":{transform:`rotate(45deg) translateX(${Nt(t.calc(y).mul(-1).equal())})`}},[`${n}-submenu-open${n}-submenu-inline > ${n}-submenu-title > ${n}-submenu-arrow`]:{transform:`translateY(${Nt(t.calc(g).mul(.2).mul(-1).equal())})`,"&::after":{transform:`rotate(-45deg) translateX(${Nt(t.calc(y).mul(-1).equal())})`},"&::before":{transform:`rotate(45deg) translateX(${Nt(y)})`}}})},{[`${e}-layout-header`]:{[n]:{lineHeight:"inherit"}}}]},vkt=t=>{var e,n,o;const{colorPrimary:r,colorError:i,colorTextDisabled:a,colorErrorBg:l,colorText:s,colorTextDescription:c,colorBgContainer:u,colorFillAlter:d,colorFillContent:f,lineWidth:p,lineWidthBold:g,controlItemBgActive:y,colorBgTextHover:w,controlHeightLG:b,lineHeight:C,colorBgElevated:P,marginXXS:v,padding:T,fontSize:A,controlHeightSM:x,fontSizeLG:S,colorTextLightSolid:R,colorErrorHover:M}=t,D=(e=t.activeBarWidth)!==null&&e!==void 0?e:0,E=(n=t.activeBarBorderWidth)!==null&&n!==void 0?n:p,W=(o=t.itemMarginInline)!==null&&o!==void 0?o:t.marginXXS,j=new kl(R).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:t.zIndexPopupBase+50,radiusItem:t.borderRadiusLG,itemBorderRadius:t.borderRadiusLG,radiusSubMenuItem:t.borderRadiusSM,subMenuItemBorderRadius:t.borderRadiusSM,colorItemText:s,itemColor:s,colorItemTextHover:s,itemHoverColor:s,colorItemTextHoverHorizontal:r,horizontalItemHoverColor:r,colorGroupTitle:c,groupTitleColor:c,colorItemTextSelected:r,itemSelectedColor:r,colorItemTextSelectedHorizontal:r,horizontalItemSelectedColor:r,colorItemBg:u,itemBg:u,colorItemBgHover:w,itemHoverBg:w,colorItemBgActive:f,itemActiveBg:y,colorSubItemBg:d,subMenuItemBg:d,colorItemBgSelected:y,itemSelectedBg:y,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:D,colorActiveBarHeight:g,activeBarHeight:g,colorActiveBarBorderSize:p,activeBarBorderWidth:E,colorItemTextDisabled:a,itemDisabledColor:a,colorDangerItemText:i,dangerItemColor:i,colorDangerItemTextHover:i,dangerItemHoverColor:i,colorDangerItemTextSelected:i,dangerItemSelectedColor:i,colorDangerItemBgActive:l,dangerItemActiveBg:l,colorDangerItemBgSelected:l,dangerItemSelectedBg:l,itemMarginInline:W,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:b,groupTitleLineHeight:C,collapsedWidth:b*2,popupBg:P,itemMarginBlock:v,itemPaddingInline:T,horizontalLineHeight:`${b*1.15}px`,iconSize:A,iconMarginInlineEnd:x-A,collapsedIconSize:S,groupTitleFontSize:A,darkItemDisabledColor:new kl(R).setAlpha(.25).toRgbString(),darkItemColor:j,darkDangerItemColor:i,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:R,darkItemSelectedBg:r,darkDangerItemSelectedBg:i,darkItemHoverBg:"transparent",darkGroupTitleColor:j,darkItemHoverColor:R,darkDangerItemHoverColor:M,darkDangerItemSelectedColor:R,darkDangerItemActiveBg:i,itemWidth:D?`calc(100% + ${E}px)`:`calc(100% - ${W*2}px)`}},xkt=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return wl("Menu",r=>{const{colorBgElevated:i,controlHeightLG:a,fontSize:l,darkItemColor:s,darkDangerItemColor:c,darkItemBg:u,darkSubMenuItemBg:d,darkItemSelectedColor:f,darkItemSelectedBg:p,darkDangerItemSelectedBg:g,darkItemHoverBg:y,darkGroupTitleColor:w,darkItemHoverColor:b,darkItemDisabledColor:C,darkDangerItemHoverColor:P,darkDangerItemSelectedColor:v,darkDangerItemActiveBg:T,popupBg:A,darkPopupBg:x}=r,S=r.calc(l).div(7).mul(5).equal(),R=Ki(r,{menuArrowSize:S,menuHorizontalHeight:r.calc(a).mul(1.15).equal(),menuArrowOffset:r.calc(S).mul(.25).equal(),menuSubMenuBg:i,calc:r.calc,popupBg:A}),M=Ki(R,{itemColor:s,itemHoverColor:b,groupTitleColor:w,itemSelectedColor:f,itemBg:u,popupBg:x,subMenuItemBg:d,itemActiveBg:"transparent",itemSelectedBg:p,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:y,itemDisabledColor:C,dangerItemColor:c,dangerItemHoverColor:P,dangerItemSelectedColor:v,dangerItemActiveBg:T,dangerItemSelectedBg:g,menuSubMenuBg:d,horizontalItemSelectedColor:f,horizontalItemSelectedBg:p});return[wkt(R),mkt(R),Akt(R),Jve(R,"light"),Jve(M,"dark"),ykt(R),Rme(R),O9(R,"slide-up"),O9(R,"slide-down"),UW(R,"zoom-big")]},vkt,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:n,unitless:{groupTitleLineHeight:!0}})(t,e)};var bkt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n;const o=m.useContext(BG),r=o||{},{getPrefixCls:i,getPopupContainer:a,direction:l,menu:s}=m.useContext(Cr),c=i(),{prefixCls:u,className:d,style:f,theme:p="light",expandIcon:g,_internalDisableMenuItemTitleTooltip:y,inlineCollapsed:w,siderCollapsed:b,items:C,children:P,rootClassName:v,mode:T,selectable:A,onClick:x,overflowedIndicatorPopupClassName:S}=t,R=bkt(t,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),M=up(R,["collapsedWidth"]),D=pkt(C)||P;(n=r.validator)===null||n===void 0||n.call(r,{mode:T});const E=q6(function(){var Q;x==null||x.apply(void 0,arguments),(Q=r.onClick)===null||Q===void 0||Q.call(r)}),W=r.mode||T,j=A??r.selectable,L=m.useMemo(()=>b!==void 0?b:w,[w,b]),k={horizontal:{motionName:`${c}-slide-up`},inline:xme(c),other:{motionName:`${c}-zoom-big`}},N=i("menu",u||r.prefixCls),F=O0(N),[U,O,B]=xkt(N,F,!o),_=Un(`${N}-${p}`,s==null?void 0:s.className,d),X=m.useMemo(()=>{var Q,le;if(typeof g=="function"||rie(g))return g||null;if(typeof r.expandIcon=="function"||rie(r.expandIcon))return r.expandIcon||null;if(typeof(s==null?void 0:s.expandIcon)=="function"||rie(s==null?void 0:s.expandIcon))return(s==null?void 0:s.expandIcon)||null;const q=(Q=g??(r==null?void 0:r.expandIcon))!==null&&Q!==void 0?Q:s==null?void 0:s.expandIcon;return B0(q,{className:Un(`${N}-submenu-expand-icon`,m.isValidElement(q)?(le=q.props)===null||le===void 0?void 0:le.className:void 0)})},[g,r==null?void 0:r.expandIcon,s==null?void 0:s.expandIcon,N]),$=m.useMemo(()=>({prefixCls:N,inlineCollapsed:L||!1,direction:l,firstLevel:!0,theme:p,mode:W,disableMenuItemTitleTooltip:y}),[N,L,l,y,p]);return U(m.createElement(BG.Provider,{value:null},m.createElement(jG.Provider,{value:$},m.createElement(OH,Object.assign({getPopupContainer:a,overflowedIndicator:m.createElement(_me,null),overflowedIndicatorPopupClassName:Un(N,`${N}-${p}`,S),mode:W,selectable:j,onClick:E},M,{inlineCollapsed:L,style:Object.assign(Object.assign({},s==null?void 0:s.style),f),className:_,prefixCls:N,direction:l,defaultMotions:k,expandIcon:X,ref:e,rootClassName:Un(v,O,r.rootClassName,B,F)}),D))))}),_H=m.forwardRef((t,e)=>{const n=m.useRef(null),o=m.useContext(dXe);return m.useImperativeHandle(e,()=>({menu:n.current,focus:r=>{var i;(i=n.current)===null||i===void 0||i.focus(r)}})),m.createElement(Skt,Object.assign({ref:n},t,o))});_H.Item=hXe;_H.SubMenu=pXe;_H.Divider=fXe;_H.ItemGroup=Z$;const Tkt=t=>{const{componentCls:e,menuCls:n,colorError:o,colorTextLightSolid:r}=t,i=`${n}-item`;return{[`${e}, ${e}-menu-submenu`]:{[`${n} ${i}`]:{[`&${i}-danger:not(${i}-disabled)`]:{color:o,"&:hover":{color:r,backgroundColor:o}}}}}},Pkt=t=>{const{componentCls:e,menuCls:n,zIndexPopup:o,dropdownArrowDistance:r,sizePopupArrow:i,antCls:a,iconCls:l,motionDurationMid:s,paddingBlock:c,fontSize:u,dropdownEdgeChildPadding:d,colorTextDisabled:f,fontSizeIcon:p,controlPaddingHorizontal:g,colorBgElevated:y}=t;return[{[e]:Object.assign(Object.assign({},ja(t)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:o,display:"block","&::before":{position:"absolute",insetBlock:t.calc(i).div(2).sub(r).equal(),zIndex:-9999,opacity:1e-4,content:'""'},[`&-trigger${a}-btn`]:{[`& > ${l}-down, & > ${a}-btn-icon > ${l}-down`]:{fontSize:p}},[`${e}-wrap`]:{position:"relative",[`${a}-btn > ${l}-down`]:{fontSize:p},[`${l}-down::before`]:{transition:`transform ${s}`}},[`${e}-wrap-open`]:{[`${l}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${a}-slide-down-enter${a}-slide-down-enter-active${e}-placement-bottomLeft, + `]:{opacity:0},[`${e}-item-icon, ${n}`]:{margin:0,fontSize:w,lineHeight:Nt(o),"+ span":{display:"inline-block",opacity:0}}},[`${e}-item-icon, ${n}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${e}-item-icon, ${n}`]:{display:"none"},"a, a:hover":{color:r}},[`${e}-item-group-title`]:Object.assign(Object.assign({},Gx),{paddingInline:p})}}]},$ve=t=>{const{componentCls:e,motionDurationSlow:n,motionDurationMid:o,motionEaseInOut:r,motionEaseOut:i,iconCls:a,iconSize:l,iconMarginInlineEnd:s}=t;return{[`${e}-item, ${e}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${n}`,`background ${n}`,`padding ${n} ${r}`].join(","),[`${e}-item-icon, ${a}`]:{minWidth:l,fontSize:l,transition:[`font-size ${o} ${i}`,`margin ${n} ${r}`,`color ${n}`].join(","),"+ span":{marginInlineStart:s,opacity:1,transition:[`opacity ${n} ${r}`,`margin ${n}`,`color ${n}`].join(",")}},[`${e}-item-icon`]:Object.assign({},WH()),[`&${e}-item-only-child`]:{[`> ${a}, > ${e}-item-icon`]:{marginInlineEnd:0}}},[`${e}-item-disabled, ${e}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${e}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},Qve=t=>{const{componentCls:e,motionDurationSlow:n,motionEaseInOut:o,borderRadius:r,menuArrowSize:i,menuArrowOffset:a}=t;return{[`${e}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:t.margin,width:i,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${n} ${o}, opacity ${n}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:t.calc(i).mul(.6).equal(),height:t.calc(i).mul(.15).equal(),backgroundColor:"currentcolor",borderRadius:r,transition:[`background ${n} ${o}`,`transform ${n} ${o}`,`top ${n} ${o}`,`color ${n} ${o}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(${Nt(t.calc(a).mul(-1).equal())})`},"&::after":{transform:`rotate(-45deg) translateY(${Nt(a)})`}}}}},wkt=t=>{const{antCls:e,componentCls:n,fontSize:o,motionDurationSlow:r,motionDurationMid:i,motionEaseInOut:a,paddingXS:l,padding:s,colorSplit:c,lineWidth:u,zIndexPopup:d,borderRadiusLG:f,subMenuItemBorderRadius:p,menuArrowSize:g,menuArrowOffset:y,lineType:w,groupTitleLineHeight:b,groupTitleFontSize:C}=t;return[{"":{[`${n}`]:Object.assign(Object.assign({},ek()),{"&-hidden":{display:"none"}})},[`${n}-submenu-hidden`]:{display:"none"}},{[n]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),ek()),{marginBottom:0,paddingInlineStart:0,fontSize:o,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${r} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${n}-item`]:{flex:"none"}},[`${n}-item, ${n}-submenu, ${n}-submenu-title`]:{borderRadius:t.itemBorderRadius},[`${n}-item-group-title`]:{padding:`${Nt(l)} ${Nt(s)}`,fontSize:C,lineHeight:b,transition:`all ${r}`},[`&-horizontal ${n}-submenu`]:{transition:[`border-color ${r} ${a}`,`background ${r} ${a}`].join(",")},[`${n}-submenu, ${n}-submenu-inline`]:{transition:[`border-color ${r} ${a}`,`background ${r} ${a}`,`padding ${i} ${a}`].join(",")},[`${n}-submenu ${n}-sub`]:{cursor:"initial",transition:[`background ${r} ${a}`,`padding ${r} ${a}`].join(",")},[`${n}-title-content`]:{transition:`color ${r}`,[`> ${e}-typography-ellipsis-single-line`]:{display:"inline",verticalAlign:"unset"}},[`${n}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${n}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:c,borderStyle:w,borderWidth:0,borderTopWidth:u,marginBlock:u,padding:0,"&-dashed":{borderStyle:"dashed"}}}),$ve(t)),{[`${n}-item-group`]:{[`${n}-item-group-list`]:{margin:0,padding:0,[`${n}-item, ${n}-submenu-title`]:{paddingInline:`${Nt(t.calc(o).mul(2).equal())} ${Nt(s)}`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:d,borderRadius:f,boxShadow:"none",transformOrigin:"0 0",[`&${n}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:0,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'},[`> ${n}`]:Object.assign(Object.assign(Object.assign({borderRadius:f},$ve(t)),Qve(t)),{[`${n}-item, ${n}-submenu > ${n}-submenu-title`]:{borderRadius:p},[`${n}-submenu-title::after`]:{transition:`transform ${r} ${a}`}})},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:t.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:t.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:t.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:t.paddingXS}}}),Qve(t)),{[`&-inline-collapsed ${n}-submenu-arrow, + &-inline ${n}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${Nt(y)})`},"&::after":{transform:`rotate(45deg) translateX(${Nt(t.calc(y).mul(-1).equal())})`}},[`${n}-submenu-open${n}-submenu-inline > ${n}-submenu-title > ${n}-submenu-arrow`]:{transform:`translateY(${Nt(t.calc(g).mul(.2).mul(-1).equal())})`,"&::after":{transform:`rotate(-45deg) translateX(${Nt(t.calc(y).mul(-1).equal())})`},"&::before":{transform:`rotate(45deg) translateX(${Nt(y)})`}}})},{[`${e}-layout-header`]:{[n]:{lineHeight:"inherit"}}}]},vkt=t=>{var e,n,o;const{colorPrimary:r,colorError:i,colorTextDisabled:a,colorErrorBg:l,colorText:s,colorTextDescription:c,colorBgContainer:u,colorFillAlter:d,colorFillContent:f,lineWidth:p,lineWidthBold:g,controlItemBgActive:y,colorBgTextHover:w,controlHeightLG:b,lineHeight:C,colorBgElevated:P,marginXXS:v,padding:T,fontSize:A,controlHeightSM:x,fontSizeLG:S,colorTextLightSolid:R,colorErrorHover:M}=t,D=(e=t.activeBarWidth)!==null&&e!==void 0?e:0,E=(n=t.activeBarBorderWidth)!==null&&n!==void 0?n:p,W=(o=t.itemMarginInline)!==null&&o!==void 0?o:t.marginXXS,j=new kl(R).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:t.zIndexPopupBase+50,radiusItem:t.borderRadiusLG,itemBorderRadius:t.borderRadiusLG,radiusSubMenuItem:t.borderRadiusSM,subMenuItemBorderRadius:t.borderRadiusSM,colorItemText:s,itemColor:s,colorItemTextHover:s,itemHoverColor:s,colorItemTextHoverHorizontal:r,horizontalItemHoverColor:r,colorGroupTitle:c,groupTitleColor:c,colorItemTextSelected:r,itemSelectedColor:r,colorItemTextSelectedHorizontal:r,horizontalItemSelectedColor:r,colorItemBg:u,itemBg:u,colorItemBgHover:w,itemHoverBg:w,colorItemBgActive:f,itemActiveBg:y,colorSubItemBg:d,subMenuItemBg:d,colorItemBgSelected:y,itemSelectedBg:y,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:D,colorActiveBarHeight:g,activeBarHeight:g,colorActiveBarBorderSize:p,activeBarBorderWidth:E,colorItemTextDisabled:a,itemDisabledColor:a,colorDangerItemText:i,dangerItemColor:i,colorDangerItemTextHover:i,dangerItemHoverColor:i,colorDangerItemTextSelected:i,dangerItemSelectedColor:i,colorDangerItemBgActive:l,dangerItemActiveBg:l,colorDangerItemBgSelected:l,dangerItemSelectedBg:l,itemMarginInline:W,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:b,groupTitleLineHeight:C,collapsedWidth:b*2,popupBg:P,itemMarginBlock:v,itemPaddingInline:T,horizontalLineHeight:`${b*1.15}px`,iconSize:A,iconMarginInlineEnd:x-A,collapsedIconSize:S,groupTitleFontSize:A,darkItemDisabledColor:new kl(R).setAlpha(.25).toRgbString(),darkItemColor:j,darkDangerItemColor:i,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:R,darkItemSelectedBg:r,darkDangerItemSelectedBg:i,darkItemHoverBg:"transparent",darkGroupTitleColor:j,darkItemHoverColor:R,darkDangerItemHoverColor:M,darkDangerItemSelectedColor:R,darkDangerItemActiveBg:i,itemWidth:D?`calc(100% + ${E}px)`:`calc(100% - ${W*2}px)`}},xkt=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return wl("Menu",r=>{const{colorBgElevated:i,controlHeightLG:a,fontSize:l,darkItemColor:s,darkDangerItemColor:c,darkItemBg:u,darkSubMenuItemBg:d,darkItemSelectedColor:f,darkItemSelectedBg:p,darkDangerItemSelectedBg:g,darkItemHoverBg:y,darkGroupTitleColor:w,darkItemHoverColor:b,darkItemDisabledColor:C,darkDangerItemHoverColor:P,darkDangerItemSelectedColor:v,darkDangerItemActiveBg:T,popupBg:A,darkPopupBg:x}=r,S=r.calc(l).div(7).mul(5).equal(),R=Ki(r,{menuArrowSize:S,menuHorizontalHeight:r.calc(a).mul(1.15).equal(),menuArrowOffset:r.calc(S).mul(.25).equal(),menuSubMenuBg:i,calc:r.calc,popupBg:A}),M=Ki(R,{itemColor:s,itemHoverColor:b,groupTitleColor:w,itemSelectedColor:f,itemBg:u,popupBg:x,subMenuItemBg:d,itemActiveBg:"transparent",itemSelectedBg:p,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:y,itemDisabledColor:C,dangerItemColor:c,dangerItemHoverColor:P,dangerItemSelectedColor:v,dangerItemActiveBg:T,dangerItemSelectedBg:g,menuSubMenuBg:d,horizontalItemSelectedColor:f,horizontalItemSelectedBg:p});return[wkt(R),mkt(R),Akt(R),Kve(R,"light"),Kve(M,"dark"),ykt(R),Hme(R),O9(R,"slide-up"),O9(R,"slide-down"),jW(R,"zoom-big")]},vkt,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:n,unitless:{groupTitleLineHeight:!0}})(t,e)};var bkt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n;const o=m.useContext(YG),r=o||{},{getPrefixCls:i,getPopupContainer:a,direction:l,menu:s}=m.useContext(Cr),c=i(),{prefixCls:u,className:d,style:f,theme:p="light",expandIcon:g,_internalDisableMenuItemTitleTooltip:y,inlineCollapsed:w,siderCollapsed:b,items:C,children:P,rootClassName:v,mode:T,selectable:A,onClick:x,overflowedIndicatorPopupClassName:S}=t,R=bkt(t,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),M=up(R,["collapsedWidth"]),D=pkt(C)||P;(n=r.validator)===null||n===void 0||n.call(r,{mode:T});const E=q6(function(){var Q;x==null||x.apply(void 0,arguments),(Q=r.onClick)===null||Q===void 0||Q.call(r)}),W=r.mode||T,j=A??r.selectable,L=m.useMemo(()=>b!==void 0?b:w,[w,b]),k={horizontal:{motionName:`${c}-slide-up`},inline:bme(c),other:{motionName:`${c}-zoom-big`}},N=i("menu",u||r.prefixCls),F=O0(N),[U,O,B]=xkt(N,F,!o),_=Un(`${N}-${p}`,s==null?void 0:s.className,d),X=m.useMemo(()=>{var Q,le;if(typeof g=="function"||rie(g))return g||null;if(typeof r.expandIcon=="function"||rie(r.expandIcon))return r.expandIcon||null;if(typeof(s==null?void 0:s.expandIcon)=="function"||rie(s==null?void 0:s.expandIcon))return(s==null?void 0:s.expandIcon)||null;const q=(Q=g??(r==null?void 0:r.expandIcon))!==null&&Q!==void 0?Q:s==null?void 0:s.expandIcon;return B0(q,{className:Un(`${N}-submenu-expand-icon`,m.isValidElement(q)?(le=q.props)===null||le===void 0?void 0:le.className:void 0)})},[g,r==null?void 0:r.expandIcon,s==null?void 0:s.expandIcon,N]),$=m.useMemo(()=>({prefixCls:N,inlineCollapsed:L||!1,direction:l,firstLevel:!0,theme:p,mode:W,disableMenuItemTitleTooltip:y}),[N,L,l,y,p]);return U(m.createElement(YG.Provider,{value:null},m.createElement(BG.Provider,{value:$},m.createElement(OH,Object.assign({getPopupContainer:a,overflowedIndicator:m.createElement(Vme,null),overflowedIndicatorPopupClassName:Un(N,`${N}-${p}`,S),mode:W,selectable:j,onClick:E},M,{inlineCollapsed:L,style:Object.assign(Object.assign({},s==null?void 0:s.style),f),className:_,prefixCls:N,direction:l,defaultMotions:k,expandIcon:X,ref:e,rootClassName:Un(v,O,r.rootClassName,B,F)}),D))))}),_H=m.forwardRef((t,e)=>{const n=m.useRef(null),o=m.useContext(dXe);return m.useImperativeHandle(e,()=>({menu:n.current,focus:r=>{var i;(i=n.current)===null||i===void 0||i.focus(r)}})),m.createElement(Skt,Object.assign({ref:n},t,o))});_H.Item=hXe;_H.SubMenu=pXe;_H.Divider=fXe;_H.ItemGroup=Z$;const Tkt=t=>{const{componentCls:e,menuCls:n,colorError:o,colorTextLightSolid:r}=t,i=`${n}-item`;return{[`${e}, ${e}-menu-submenu`]:{[`${n} ${i}`]:{[`&${i}-danger:not(${i}-disabled)`]:{color:o,"&:hover":{color:r,backgroundColor:o}}}}}},Pkt=t=>{const{componentCls:e,menuCls:n,zIndexPopup:o,dropdownArrowDistance:r,sizePopupArrow:i,antCls:a,iconCls:l,motionDurationMid:s,paddingBlock:c,fontSize:u,dropdownEdgeChildPadding:d,colorTextDisabled:f,fontSizeIcon:p,controlPaddingHorizontal:g,colorBgElevated:y}=t;return[{[e]:Object.assign(Object.assign({},ja(t)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:o,display:"block","&::before":{position:"absolute",insetBlock:t.calc(i).div(2).sub(r).equal(),zIndex:-9999,opacity:1e-4,content:'""'},[`&-trigger${a}-btn`]:{[`& > ${l}-down, & > ${a}-btn-icon > ${l}-down`]:{fontSize:p}},[`${e}-wrap`]:{position:"relative",[`${a}-btn > ${l}-down`]:{fontSize:p},[`${l}-down::before`]:{transition:`transform ${s}`}},[`${e}-wrap-open`]:{[`${l}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${a}-slide-down-enter${a}-slide-down-enter-active${e}-placement-bottomLeft, &${a}-slide-down-appear${a}-slide-down-appear-active${e}-placement-bottomLeft, &${a}-slide-down-enter${a}-slide-down-enter-active${e}-placement-bottom, &${a}-slide-down-appear${a}-slide-down-appear-active${e}-placement-bottom, @@ -4554,8 +4554,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho &${a}-slide-down-leave${a}-slide-down-leave-active${e}-placement-bottom, &${a}-slide-down-leave${a}-slide-down-leave-active${e}-placement-bottomRight`]:{animationName:j$},[`&${a}-slide-up-leave${a}-slide-up-leave-active${e}-placement-topLeft, &${a}-slide-up-leave${a}-slide-up-leave-active${e}-placement-top, - &${a}-slide-up-leave${a}-slide-up-leave-active${e}-placement-topRight`]:{animationName:Y$}})},Lme(t,y,{arrowPlacement:{top:!0,bottom:!0}}),{[`${e} ${n}`]:{position:"relative",margin:0},[`${n}-submenu-popup`]:{position:"absolute",zIndex:o,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${e}, ${e}-menu-submenu`]:{[n]:Object.assign(Object.assign({padding:d,listStyleType:"none",backgroundColor:y,backgroundClip:"padding-box",borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary},Q6(t)),{"&:empty":{padding:0,boxShadow:"none"},[`${n}-item-group-title`]:{padding:`${Nt(c)} ${Nt(g)}`,color:t.colorTextDescription,transition:`all ${s}`},[`${n}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${n}-item-icon`]:{minWidth:u,marginInlineEnd:t.marginXS,fontSize:t.fontSizeSM},[`${n}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${s}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${n}-item, ${n}-submenu-title`]:Object.assign(Object.assign({clear:"both",margin:0,padding:`${Nt(c)} ${Nt(g)}`,color:t.colorText,fontWeight:"normal",fontSize:u,lineHeight:t.lineHeight,cursor:"pointer",transition:`all ${s}`,borderRadius:t.borderRadiusSM,"&:hover, &-active":{backgroundColor:t.controlItemBgHover}},Q6(t)),{"&-selected":{color:t.colorPrimary,backgroundColor:t.controlItemBgActive,"&:hover, &-active":{backgroundColor:t.controlItemBgActiveHover}},"&-disabled":{color:f,cursor:"not-allowed","&:hover":{color:f,backgroundColor:y,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${Nt(t.marginXXS)} 0`,overflow:"hidden",lineHeight:0,backgroundColor:t.colorSplit},[`${e}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:t.paddingXS,[`${e}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:t.colorTextDescription,fontSize:p,fontStyle:"normal"}}}),[`${n}-item-group-list`]:{margin:`0 ${Nt(t.marginXS)}`,padding:0,listStyle:"none"},[`${n}-submenu-title`]:{paddingInlineEnd:t.calc(g).add(t.fontSizeSM).equal()},[`${n}-submenu-vertical`]:{position:"relative"},[`${n}-submenu${n}-submenu-disabled ${e}-menu-submenu-title`]:{[`&, ${e}-menu-submenu-arrow-icon`]:{color:f,backgroundColor:y,cursor:"not-allowed"}},[`${n}-submenu-selected ${e}-menu-submenu-title`]:{color:t.colorPrimary}})}},[O9(t,"slide-up"),O9(t,"slide-down"),wR(t,"move-up"),wR(t,"move-down"),UW(t,"zoom-big")]]},Ckt=t=>Object.assign(Object.assign({zIndexPopup:t.zIndexPopupBase+50,paddingBlock:(t.controlHeight-t.fontSize*t.lineHeight)/2},K$({contentRadius:t.borderRadiusLG,limitVerticalRadius:!0})),J$(t)),Rkt=wl("Dropdown",t=>{const{marginXXS:e,sizePopupArrow:n,paddingXXS:o,componentCls:r}=t,i=Ki(t,{menuCls:`${r}-menu`,dropdownArrowDistance:t.calc(n).div(2).add(e).equal(),dropdownEdgeChildPadding:o});return[Pkt(i),Tkt(i)]},Ckt),eQ=t=>{const{menu:e,arrow:n,prefixCls:o,children:r,trigger:i,disabled:a,dropdownRender:l,getPopupContainer:s,overlayClassName:c,rootClassName:u,overlayStyle:d,open:f,onOpenChange:p,visible:g,onVisibleChange:y,mouseEnterDelay:w=.15,mouseLeaveDelay:b=.1,autoAdjustOverflow:C=!0,placement:P="",overlay:v,transitionName:T}=t,{getPopupContainer:A,getPrefixCls:x,direction:S,dropdown:R}=m.useContext(Cr);kb();const M=m.useMemo(()=>{const ne=x();return T!==void 0?T:P.includes("top")?`${ne}-slide-down`:`${ne}-slide-up`},[x,P,T]),D=m.useMemo(()=>P?P.includes("Center")?P.slice(0,P.indexOf("Center")):P:S==="rtl"?"bottomRight":"bottomLeft",[P,S]),E=x("dropdown",o),W=O0(E),[j,L,k]=Rkt(E,W),[,N]=_u(),F=m.Children.only(r),U=B0(F,{className:Un(`${E}-trigger`,{[`${E}-rtl`]:S==="rtl"},F.props.className),disabled:a}),O=a?[]:i;let B;O&&O.includes("contextMenu")&&(B=!0);const[_,X]=$6(!1,{value:f??g}),$=q6(ne=>{p==null||p(ne,{source:"trigger"}),y==null||y(ne),X(ne)}),Q=Un(c,u,L,k,W,R==null?void 0:R.className,{[`${E}-rtl`]:S==="rtl"}),le=VGe({arrowPointAtCenter:typeof n=="object"&&n.pointAtCenter,autoAdjustOverflow:C,offset:N.marginXXS,arrowWidth:n?N.sizePopupArrow:0,borderRadius:N.borderRadius}),q=m.useCallback(()=>{e!=null&&e.selectable&&(e!=null&&e.multiple)||(p==null||p(!1,{source:"menu"}),X(!1))},[e==null?void 0:e.selectable,e==null?void 0:e.multiple]),te=()=>{let ne;return e!=null&&e.items?ne=m.createElement(_H,Object.assign({},e)):typeof v=="function"?ne=v():ne=v,l&&(ne=l(ne)),ne=m.Children.only(typeof ne=="string"?m.createElement("span",null,ne):ne),m.createElement(gXe,{prefixCls:`${E}-menu`,rootClassName:Un(k,W),expandIcon:m.createElement("span",{className:`${E}-menu-submenu-arrow`},m.createElement(NG,{className:`${E}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:q,validator:fe=>{}},ne)},[re,ae]=Ww("Dropdown",d==null?void 0:d.zIndex);let se=m.createElement(ZGe,Object.assign({alignPoint:B},up(t,["rootClassName"]),{mouseEnterDelay:w,mouseLeaveDelay:b,visible:_,builtinPlacements:le,arrow:!!n,overlayClassName:Q,prefixCls:E,getPopupContainer:s||A,transitionName:M,trigger:O,overlay:te,placement:D,onVisibleChange:$,overlayStyle:Object.assign(Object.assign(Object.assign({},R==null?void 0:R.style),d),{zIndex:re})}),U);return re&&(se=m.createElement(zW.Provider,{value:ae},se)),j(se)};function Hkt(t){return Object.assign(Object.assign({},t),{align:{overflow:{adjustX:!1,adjustY:!1}}})}const Mkt=BW(eQ,"dropdown",t=>t,Hkt),Ikt=t=>m.createElement(Mkt,Object.assign({},t),m.createElement("span",null));eQ._InternalPanelDoNotUseOrYouWillBeFired=Ikt;var mXe={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Ac,function(){return function(n,o){o.prototype.weekday=function(r){var i=this.$locale().weekStart||0,a=this.$W,l=(a25){var u=a(this).startOf(o).add(1,o).date(c),d=a(this).endOf(n);if(u.isBefore(d))return 1}var f=a(this).startOf(o).date(c).startOf(n).subtract(1,"millisecond"),p=this.diff(f,n,!0);return p<0?a(this).startOf("week").week():Math.ceil(p)},l.weeks=function(s){return s===void 0&&(s=null),this.week(s)}}})})(AXe);var kkt=AXe.exports;const Lkt=Fi(kkt);var wXe={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Ac,function(){return function(n,o){o.prototype.weekYear=function(){var r=this.month(),i=this.week(),a=this.year();return i===1&&r===11?a+1:r===0&&i>=52?a-1:a}}})})(wXe);var Wkt=wXe.exports;const Nkt=Fi(Wkt);var vXe={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Ac,function(){return function(n,o){var r=o.prototype,i=r.format;r.format=function(a){var l=this,s=this.$locale();if(!this.isValid())return i.bind(this)(a);var c=this.$utils(),u=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(d){switch(d){case"Q":return Math.ceil((l.$M+1)/3);case"Do":return s.ordinal(l.$D);case"gggg":return l.weekYear();case"GGGG":return l.isoWeekYear();case"wo":return s.ordinal(l.week(),"W");case"w":case"ww":return c.s(l.week(),d==="w"?1:2,"0");case"W":case"WW":return c.s(l.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return c.s(String(l.$H===0?24:l.$H),d==="k"?1:2,"0");case"X":return Math.floor(l.$d.getTime()/1e3);case"x":return l.$d.getTime();case"z":return"["+l.offsetName()+"]";case"zzz":return"["+l.offsetName("long")+"]";default:return d}});return i.bind(this)(u)}}})})(vXe);var Ukt=vXe.exports;const jkt=Fi(Ukt);var xXe={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Ac,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},o=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},s=function(y){return(y=+y)+(y>68?1900:2e3)},c=function(y){return function(w){this[y]=+w}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=function(w){if(!w||w==="Z")return 0;var b=w.match(/([+-]|\d\d)/g),C=60*b[1]+(+b[2]||0);return C===0?0:b[0]==="+"?-C:C}(y)}],d=function(y){var w=l[y];return w&&(w.indexOf?w:w.s.concat(w.f))},f=function(y,w){var b,C=l.meridiem;if(C){for(var P=1;P<=24;P+=1)if(y.indexOf(C(P,0,w))>-1){b=P>12;break}}else b=y===(w?"pm":"PM");return b},p={A:[a,function(y){this.afternoon=f(y,!1)}],a:[a,function(y){this.afternoon=f(y,!0)}],S:[/\d/,function(y){this.milliseconds=100*+y}],SS:[r,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[i,c("seconds")],ss:[i,c("seconds")],m:[i,c("minutes")],mm:[i,c("minutes")],H:[i,c("hours")],h:[i,c("hours")],HH:[i,c("hours")],hh:[i,c("hours")],D:[i,c("day")],DD:[r,c("day")],Do:[a,function(y){var w=l.ordinal,b=y.match(/\d+/);if(this.day=b[0],w)for(var C=1;C<=31;C+=1)w(C).replace(/\[|\]/g,"")===y&&(this.day=C)}],M:[i,c("month")],MM:[r,c("month")],MMM:[a,function(y){var w=d("months"),b=(d("monthsShort")||w.map(function(C){return C.slice(0,3)})).indexOf(y)+1;if(b<1)throw new Error;this.month=b%12||b}],MMMM:[a,function(y){var w=d("months").indexOf(y)+1;if(w<1)throw new Error;this.month=w%12||w}],Y:[/[+-]?\d+/,c("year")],YY:[r,function(y){this.year=s(y)}],YYYY:[/\d{4}/,c("year")],Z:u,ZZ:u};function g(y){var w,b;w=y,b=l&&l.formats;for(var C=(y=w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(R,M,D){var E=D&&D.toUpperCase();return M||b[D]||n[D]||b[E].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(W,j,L){return j||L.slice(1)})})).match(o),P=C.length,v=0;v-1)return new Date((N==="X"?1e3:1)*k);var U=g(N)(k),O=U.year,B=U.month,_=U.day,X=U.hours,$=U.minutes,Q=U.seconds,le=U.milliseconds,q=U.zone,te=new Date,re=_||(O||B?1:te.getDate()),ae=O||te.getFullYear(),se=0;O&&!B||(se=B>0?B-1:te.getMonth());var ne=X||0,fe=$||0,ge=Q||0,de=le||0;return q?new Date(Date.UTC(ae,se,re,ne,fe,ge,de+60*q.offset*1e3)):F?new Date(Date.UTC(ae,se,re,ne,fe,ge,de)):new Date(ae,se,re,ne,fe,ge,de)}catch{return new Date("")}}(T,S,A),this.init(),E&&E!==!0&&(this.$L=this.locale(E).$L),D&&T!=this.format(S)&&(this.$d=new Date("")),l={}}else if(S instanceof Array)for(var W=S.length,j=1;j<=W;j+=1){x[1]=S[j-1];var L=b.apply(this,x);if(L.isValid()){this.$d=L.$d,this.$L=L.$L,this.init();break}j===W&&(this.$d=new Date(""))}else P.call(this,v)}}})})(xXe);var Bkt=xXe.exports;const Ykt=Fi(Bkt);yc.extend(Ykt);yc.extend(jkt);yc.extend(Dkt);yc.extend(Fkt);yc.extend(Lkt);yc.extend(Nkt);yc.extend(function(t,e){var n=e.prototype,o=n.format;n.format=function(i){var a=(i||"").replace("Wo","wo");return o.bind(this)(a)}});var Okt={bn_BD:"bn-bd",by_BY:"be",en_GB:"en-gb",en_US:"en",fr_BE:"fr",fr_CA:"fr-ca",hy_AM:"hy-am",kmr_IQ:"ku",nl_BE:"nl-be",pt_BR:"pt-br",zh_CN:"zh-cn",zh_HK:"zh-hk",zh_TW:"zh-tw"},V7=function(e){var n=Okt[e];return n||e.split("_")[0]},Qve=function(){MOe(!1,"Not match any format. Please help to fire a issue about this.")},_kt={getNow:function(){return yc()},getFixedDate:function(e){return yc(e,["YYYY-M-DD","YYYY-MM-DD"])},getEndDate:function(e){return e.endOf("month")},getWeekDay:function(e){var n=e.locale("en");return n.weekday()+n.localeData().firstDayOfWeek()},getYear:function(e){return e.year()},getMonth:function(e){return e.month()},getDate:function(e){return e.date()},getHour:function(e){return e.hour()},getMinute:function(e){return e.minute()},getSecond:function(e){return e.second()},getMillisecond:function(e){return e.millisecond()},addYear:function(e,n){return e.add(n,"year")},addMonth:function(e,n){return e.add(n,"month")},addDate:function(e,n){return e.add(n,"day")},setYear:function(e,n){return e.year(n)},setMonth:function(e,n){return e.month(n)},setDate:function(e,n){return e.date(n)},setHour:function(e,n){return e.hour(n)},setMinute:function(e,n){return e.minute(n)},setSecond:function(e,n){return e.second(n)},setMillisecond:function(e,n){return e.millisecond(n)},isAfter:function(e,n){return e.isAfter(n)},isValidate:function(e){return e.isValid()},locale:{getWeekFirstDay:function(e){return yc().locale(V7(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,n){return n.locale(V7(e)).weekday(0)},getWeek:function(e,n){return n.locale(V7(e)).week()},getShortWeekDays:function(e){return yc().locale(V7(e)).localeData().weekdaysMin()},getShortMonths:function(e){return yc().locale(V7(e)).localeData().monthsShort()},format:function(e,n,o){return n.locale(V7(e)).format(o)},parse:function(e,n,o){for(var r=V7(e),i=0;i2&&arguments[2]!==void 0?arguments[2]:"0",o=String(t);o.length2&&arguments[2]!==void 0?arguments[2]:[],o=m.useState([!1,!1]),r=ln(o,2),i=r[0],a=r[1],l=function(u,d){a(function(f){return bE(f,d,u)})},s=m.useMemo(function(){return i.map(function(c,u){if(c)return!0;var d=t[u];return d?!!(!n[u]&&!d||d&&e(d,{activeIndex:u})):!1})},[t,i,e,n]);return[s,l]}function RXe(t,e,n,o,r){var i="",a=[];return t&&a.push(r?"hh":"HH"),e&&a.push("mm"),n&&a.push("ss"),i=a.join(":"),o&&(i+=".SSS"),r&&(i+=" A"),i}function Gkt(t,e,n,o,r,i){var a=t.fieldDateTimeFormat,l=t.fieldDateFormat,s=t.fieldTimeFormat,c=t.fieldMonthFormat,u=t.fieldYearFormat,d=t.fieldWeekFormat,f=t.fieldQuarterFormat,p=t.yearFormat,g=t.cellYearFormat,y=t.cellQuarterFormat,w=t.dayFormat,b=t.cellDateFormat,C=RXe(e,n,o,r,i);return qt(qt({},t),{},{fieldDateTimeFormat:a||"YYYY-MM-DD ".concat(C),fieldDateFormat:l||"YYYY-MM-DD",fieldTimeFormat:s||C,fieldMonthFormat:c||"YYYY-MM",fieldYearFormat:u||"YYYY",fieldWeekFormat:d||"gggg-wo",fieldQuarterFormat:f||"YYYY-[Q]Q",yearFormat:p||"YYYY",cellYearFormat:g||"YYYY",cellQuarterFormat:y||"[Q]Q",cellDateFormat:b||w||"D"})}function HXe(t,e){var n=e.showHour,o=e.showMinute,r=e.showSecond,i=e.showMillisecond,a=e.use12Hours;return be.useMemo(function(){return Gkt(t,n,o,r,i,a)},[t,n,o,r,i,a])}function Lz(t,e,n){return n??e.some(function(o){return t.includes(o)})}var Xkt=["showNow","showHour","showMinute","showSecond","showMillisecond","use12Hours","hourStep","minuteStep","secondStep","millisecondStep","hideDisabledOptions","defaultValue","disabledHours","disabledMinutes","disabledSeconds","disabledMilliseconds","disabledTime","changeOnScroll","defaultOpenValue"];function Jkt(t){var e=tQ(t,Xkt),n=t.format,o=t.picker,r=null;return n&&(r=n,Array.isArray(r)&&(r=r[0]),r=hi(r)==="object"?r.format:r),o==="time"&&(e.format=r),[e,r]}function Kkt(t){return t&&typeof t=="string"}function MXe(t,e,n,o){return[t,e,n,o].some(function(r){return r!==void 0})}function IXe(t,e,n,o,r){var i=e,a=n,l=o;if(!t&&!i&&!a&&!l&&!r)i=!0,a=!0,l=!0;else if(t){var s,c,u,d=[i,a,l].some(function(g){return g===!1}),f=[i,a,l].some(function(g){return g===!0}),p=d?!0:!f;i=(s=i)!==null&&s!==void 0?s:p,a=(c=a)!==null&&c!==void 0?c:p,l=(u=l)!==null&&u!==void 0?u:p}return[i,a,l,r]}function zXe(t){var e=t.showTime,n=Jkt(t),o=ln(n,2),r=o[0],i=o[1],a=e&&hi(e)==="object"?e:{},l=qt(qt({defaultOpenValue:a.defaultOpenValue||a.defaultValue},r),a),s=l.showMillisecond,c=l.showHour,u=l.showMinute,d=l.showSecond,f=MXe(c,u,d,s),p=IXe(f,c,u,d,s),g=ln(p,3);return c=g[0],u=g[1],d=g[2],[l,qt(qt({},l),{},{showHour:c,showMinute:u,showSecond:d,showMillisecond:s}),l.format,i]}function DXe(t,e,n,o,r){var i=t==="time";if(t==="datetime"||i){for(var a=o,l=SXe(t,r,null),s=l,c=[e,n],u=0;u1&&(a=e.addDate(a,-7)),a}function Lu(t,e){var n=e.generateConfig,o=e.locale,r=e.format;return t?typeof r=="function"?r(t):n.locale.format(o.locale,t,r):""}function YG(t,e,n){var o=e,r=["getHour","getMinute","getSecond","getMillisecond"],i=["setHour","setMinute","setSecond","setMillisecond"];return i.forEach(function(a,l){n?o=t[a](o,t[r[l]](n)):o=t[a](o,0)}),o}function Zkt(t,e,n,o,r){var i=Ea(function(a,l){return!!(n&&n(a,l)||o&&t.isAfter(o,a)&&!fh(t,e,o,a,l.type)||r&&t.isAfter(a,r)&&!fh(t,e,r,a,l.type))});return i}function eLt(t,e,n){return m.useMemo(function(){var o=SXe(t,e,n),r=Wb(o),i=r[0],a=hi(i)==="object"&&i.type==="mask"?i.format:null;return[r.map(function(l){return typeof l=="string"||typeof l=="function"?l:l.format}),a]},[t,e,n])}function tLt(t,e,n){return typeof t[0]=="function"||n?!0:e}function nLt(t,e,n,o){var r=Ea(function(i,a){var l=qt({type:e},a);if(delete l.activeIndex,!t.isValidate(i)||n&&n(i,l))return!0;if((e==="date"||e==="time")&&o){var s,c=a&&a.activeIndex===1?"end":"start",u=((s=o.disabledTime)===null||s===void 0?void 0:s.call(o,i,c,{from:l.from}))||{},d=u.disabledHours,f=u.disabledMinutes,p=u.disabledSeconds,g=u.disabledMilliseconds,y=o.disabledHours,w=o.disabledMinutes,b=o.disabledSeconds,C=d||y,P=f||w,v=p||b,T=t.getHour(i),A=t.getMinute(i),x=t.getSecond(i),S=t.getMillisecond(i);if(C&&C().includes(T)||P&&P(T).includes(A)||v&&v(T,A).includes(x)||g&&g(T,A,x).includes(S))return!0}return!1});return r}function IY(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=m.useMemo(function(){var o=t&&Wb(t);return e&&o&&(o[1]=o[1]||o[0]),o},[t,e]);return n}function kXe(t,e){var n=t.generateConfig,o=t.locale,r=t.picker,i=r===void 0?"date":r,a=t.prefixCls,l=a===void 0?"rc-picker":a,s=t.styles,c=s===void 0?{}:s,u=t.classNames,d=u===void 0?{}:u,f=t.order,p=f===void 0?!0:f,g=t.components,y=g===void 0?{}:g,w=t.inputRender,b=t.allowClear,C=t.clearIcon,P=t.needConfirm,v=t.multiple,T=t.format,A=t.inputReadOnly,x=t.disabledDate,S=t.minDate,R=t.maxDate,M=t.showTime,D=t.value,E=t.defaultValue,W=t.pickerValue,j=t.defaultPickerValue,L=IY(D),k=IY(E),N=IY(W),F=IY(j),U=i==="date"&&M?"datetime":i,O=U==="time"||U==="datetime",B=O||v,_=P??O,X=zXe(t),$=ln(X,4),Q=$[0],le=$[1],q=$[2],te=$[3],re=HXe(o,le),ae=m.useMemo(function(){return DXe(U,q,te,Q,re)},[U,q,te,Q,re]),se=m.useMemo(function(){return qt(qt({},t),{},{prefixCls:l,locale:re,picker:i,styles:c,classNames:d,order:p,components:qt({input:w},y),clearIcon:qkt(l,b,C),showTime:ae,value:L,defaultValue:k,pickerValue:N,defaultPickerValue:F},e==null?void 0:e())},[t]),ne=eLt(U,re,T),fe=ln(ne,2),ge=fe[0],de=fe[1],Z=tLt(ge,A,v),he=Zkt(n,o,x,S,R),xe=nLt(n,i,he,ae),He=m.useMemo(function(){return qt(qt({},se),{},{needConfirm:_,inputReadOnly:Z,disabledDate:he})},[se,_,Z,he]);return[He,U,B,ge,de,xe]}function oLt(t,e,n){var o=zs(e,{value:t}),r=ln(o,2),i=r[0],a=r[1],l=be.useRef(t),s=be.useRef(),c=function(){Fa.cancel(s.current)},u=Ea(function(){a(l.current),n&&i!==l.current&&n(l.current)}),d=Ea(function(f,p){c(),l.current=f,f||p?u():s.current=Fa(u)});return be.useEffect(function(){return c},[]),[i,d]}function LXe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],o=arguments.length>3?arguments[3]:void 0,r=n.every(function(u){return u})?!1:t,i=oLt(r,e||!1,o),a=ln(i,2),l=a[0],s=a[1];function c(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(!d.inherit||l)&&s(u,d.force)}return[l,c]}function WXe(t){var e=m.useRef();return m.useImperativeHandle(t,function(){var n;return{nativeElement:(n=e.current)===null||n===void 0?void 0:n.nativeElement,focus:function(r){var i;(i=e.current)===null||i===void 0||i.focus(r)},blur:function(){var r;(r=e.current)===null||r===void 0||r.blur()}}}),e}function NXe(t,e){return m.useMemo(function(){return t||(e?(j0(!1,"`ranges` is deprecated. Please use `presets` instead."),Object.entries(e).map(function(n){var o=ln(n,2),r=o[0],i=o[1];return{label:r,value:i}})):[])},[t,e])}function Kme(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,o=m.useRef(e);o.current=e,fx(function(){if(t)o.current(t);else{var r=Fa(function(){o.current(t)},n);return function(){Fa.cancel(r)}}},[t])}function UXe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=m.useState(0),o=ln(n,2),r=o[0],i=o[1],a=m.useState(!1),l=ln(a,2),s=l[0],c=l[1],u=m.useRef([]),d=m.useRef(null),f=function(w){c(w)},p=function(w){return w&&(d.current=w),d.current},g=function(w){var b=u.current,C=new Set(b.filter(function(v){return w[v]||e[v]})),P=b[b.length-1]===0?1:0;return C.size>=2||t[P]?null:P};return Kme(s,function(){s||(u.current=[])}),m.useEffect(function(){s&&u.current.push(r)},[s,r]),[s,f,p,r,i,g,u.current]}function rLt(t,e,n,o,r,i){var a=n[n.length-1],l=function(c,u){var d=ln(t,2),f=d[0],p=d[1],g=qt(qt({},u),{},{from:TXe(t,n)});return a===1&&e[0]&&f&&!fh(o,r,f,c,g.type)&&o.isAfter(f,c)||a===0&&e[1]&&p&&!fh(o,r,p,c,g.type)&&o.isAfter(c,p)?!0:i==null?void 0:i(c,g)};return l}function ID(t,e,n,o){switch(e){case"date":case"week":return t.addMonth(n,o);case"month":case"quarter":return t.addYear(n,o);case"year":return t.addYear(n,o*10);case"decade":return t.addYear(n,o*100);default:return n}}var aie=[];function jXe(t,e,n,o,r,i,a,l){var s=arguments.length>8&&arguments[8]!==void 0?arguments[8]:aie,c=arguments.length>9&&arguments[9]!==void 0?arguments[9]:aie,u=arguments.length>10&&arguments[10]!==void 0?arguments[10]:aie,d=arguments.length>11?arguments[11]:void 0,f=arguments.length>12?arguments[12]:void 0,p=arguments.length>13?arguments[13]:void 0,g=a==="time",y=i||0,w=function(N){var F=t.getNow();return g&&(F=YG(t,F)),s[N]||n[N]||F},b=ln(c,2),C=b[0],P=b[1],v=zs(function(){return w(0)},{value:C}),T=ln(v,2),A=T[0],x=T[1],S=zs(function(){return w(1)},{value:P}),R=ln(S,2),M=R[0],D=R[1],E=m.useMemo(function(){var k=[A,M][y];return g?k:YG(t,k,u[y])},[g,A,M,y,t,u]),W=function(N){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"panel",U=[x,D][y];U(N);var O=[A,M];O[y]=N,d&&(!fh(t,e,A,O[0],a)||!fh(t,e,M,O[1],a))&&d(O,{source:F,range:y===1?"end":"start",mode:o})},j=function(N,F){if(l){var U={date:"month",week:"month",month:"year",quarter:"year"},O=U[a];if(O&&!fh(t,e,N,F,O))return ID(t,a,F,-1);if(a==="year"){var B=Math.floor(t.getYear(N)/10),_=Math.floor(t.getYear(F)/10);if(B!==_)return ID(t,a,F,-1)}}return F},L=m.useRef(null);return Xa(function(){if(r&&!s[y]){var k=g?null:t.getNow();if(L.current!==null&&L.current!==y?k=[A,M][y^1]:n[y]?k=y===0?n[0]:j(n[0],n[1]):n[y^1]&&(k=n[y^1]),k){f&&t.isAfter(f,k)&&(k=f);var N=l?ID(t,a,k,1):k;p&&t.isAfter(N,p)&&(k=l?ID(t,a,p,-1):p),W(k,"reset")}}},[r,y,n[y]]),m.useEffect(function(){r?L.current=y:L.current=null},[r,y]),Xa(function(){r&&s&&s[y]&&W(s[y],"reset")},[r,y]),[E,W]}function BXe(t,e){var n=m.useRef(t),o=m.useState({}),r=ln(o,2),i=r[1],a=function(c){return c&&e!==void 0?e:n.current},l=function(c){n.current=c,i({})};return[a,l,a(!0)]}var iLt=[];function YXe(t,e,n){var o=function(a){return a.map(function(l){return Lu(l,{generateConfig:t,locale:e,format:n[0]})})},r=function(a,l){for(var s=Math.max(a.length,l.length),c=-1,u=0;u2&&arguments[2]!==void 0?arguments[2]:1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:2,a=[],l=n>=1?n|0:1,s=t;s<=e;s+=l){var c=r.includes(s);(!c||!o)&&a.push({label:Vme(s,i),value:s,disabled:c})}return a}function qme(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=e||{},r=o.use12Hours,i=o.hourStep,a=i===void 0?1:i,l=o.minuteStep,s=l===void 0?1:l,c=o.secondStep,u=c===void 0?1:c,d=o.millisecondStep,f=d===void 0?100:d,p=o.hideDisabledOptions,g=o.disabledTime,y=o.disabledHours,w=o.disabledMinutes,b=o.disabledSeconds,C=m.useMemo(function(){return n||t.getNow()},[n,t]),P=m.useCallback(function(F){var U=(g==null?void 0:g(F))||{};return[U.disabledHours||y||zY,U.disabledMinutes||w||zY,U.disabledSeconds||b||zY,U.disabledMilliseconds||zY]},[g,y,w,b]),v=m.useMemo(function(){return P(C)},[C,P]),T=ln(v,4),A=T[0],x=T[1],S=T[2],R=T[3],M=m.useCallback(function(F,U,O,B){var _=DY(0,23,a,p,F()),X=r?_.map(function(q){return qt(qt({},q),{},{label:Vme(q.value%12||12,2)})}):_,$=function(te){return DY(0,59,s,p,U(te))},Q=function(te,re){return DY(0,59,u,p,O(te,re))},le=function(te,re,ae){return DY(0,999,f,p,B(te,re,ae),3)};return[X,$,Q,le]},[p,a,r,f,s,u]),D=m.useMemo(function(){return M(A,x,S,R)},[M,A,x,S,R]),E=ln(D,4),W=E[0],j=E[1],L=E[2],k=E[3],N=function(U,O){var B=function(){return W},_=j,X=L,$=k;if(O){var Q=P(O),le=ln(Q,4),q=le[0],te=le[1],re=le[2],ae=le[3],se=M(q,te,re,ae),ne=ln(se,4),fe=ne[0],ge=ne[1],de=ne[2],Z=ne[3];B=function(){return fe},_=ge,X=de,$=Z}var he=lLt(U,B,_,X,$,t);return he};return[N,W,j,L,k]}function sLt(t){var e=t.mode,n=t.internalMode,o=t.renderExtraFooter,r=t.showNow,i=t.showTime,a=t.onSubmit,l=t.onNow,s=t.invalid,c=t.needConfirm,u=t.generateConfig,d=t.disabledDate,f=m.useContext(r5),p=f.prefixCls,g=f.locale,y=f.button,w=y===void 0?"button":y,b=u.getNow(),C=qme(u,i,b),P=ln(C,1),v=P[0],T=o==null?void 0:o(e),A=d(b,{type:e}),x=function(){if(!A){var j=v(b);l(j)}},S="".concat(p,"-now"),R="".concat(S,"-btn"),M=r&&m.createElement("li",{className:S},m.createElement("a",{className:Vn(R,A&&"".concat(R,"-disabled")),"aria-disabled":A,onClick:x},n==="date"?g.today:g.now)),D=c&&m.createElement("li",{className:"".concat(p,"-ok")},m.createElement(w,{disabled:s,onClick:a},g.ok)),E=(M||D)&&m.createElement("ul",{className:"".concat(p,"-ranges")},M,D);return!T&&!E?null:m.createElement("div",{className:"".concat(p,"-footer")},T&&m.createElement("div",{className:"".concat(p,"-footer-extra")},T),E)}function XXe(t,e,n){function o(r,i){var a=r.findIndex(function(s){return fh(t,e,s,i,n)});if(a===-1)return[].concat(Lo(r),[i]);var l=Lo(r);return l.splice(a,1),l}return o}var Nb=m.createContext(null);function oQ(){return m.useContext(Nb)}function VH(t,e){var n=t.prefixCls,o=t.generateConfig,r=t.locale,i=t.disabledDate,a=t.minDate,l=t.maxDate,s=t.cellRender,c=t.hoverValue,u=t.hoverRangeValue,d=t.onHover,f=t.values,p=t.pickerValue,g=t.onSelect,y=t.prevIcon,w=t.nextIcon,b=t.superPrevIcon,C=t.superNextIcon,P=o.getNow(),v={now:P,values:f,pickerValue:p,prefixCls:n,disabledDate:i,minDate:a,maxDate:l,cellRender:s,hoverValue:c,hoverRangeValue:u,onHover:d,locale:r,generateConfig:o,onSelect:g,panelType:e,prevIcon:y,nextIcon:w,superPrevIcon:b,superNextIcon:C};return[v,P]}var j8=m.createContext({});function VW(t){for(var e=t.rowNum,n=t.colNum,o=t.baseDate,r=t.getCellDate,i=t.prefixColumn,a=t.rowClassName,l=t.titleFormat,s=t.getCellText,c=t.getCellClassName,u=t.headerCells,d=t.cellSelection,f=d===void 0?!0:d,p=t.disabledDate,g=oQ(),y=g.prefixCls,w=g.panelType,b=g.now,C=g.disabledDate,P=g.cellRender,v=g.onHover,T=g.hoverValue,A=g.hoverRangeValue,x=g.generateConfig,S=g.values,R=g.locale,M=g.onSelect,D=p||C,E="".concat(y,"-cell"),W=m.useContext(j8),j=W.onCellDblClick,L=function(X){return S.some(function($){return $&&fh(x,R,X,$,w)})},k=[],N=0;N1&&arguments[1]!==void 0?arguments[1]:!1;Ie(Ke),w==null||w(Ke),Ne&&ye(Ke)},pe=function(Ke,Ne){re(Ke),Ne&&ce(Ne),ye(Ne,Ke)},ve=function(Ke){if(xe(Ke),ce(Ke),te!==v){var Ne=["decade","year"],De=[].concat(Ne,["month"]),ke={quarter:[].concat(Ne,["quarter"]),week:[].concat(Lo(De),["week"]),date:[].concat(Lo(De),["date"])},Ye=ke[v]||De,it=Ye.indexOf(te),Ve=Ye[it+1];Ve&&pe(Ve,Ke)}},Ae=m.useMemo(function(){var We,Ke;if(Array.isArray(x)){var Ne=ln(x,2);We=Ne[0],Ke=Ne[1]}else We=x;return!We&&!Ke?null:(We=We||Ke,Ke=Ke||We,r.isAfter(We,Ke)?[Ke,We]:[We,Ke])},[x,r]),Te=Gme(S,R,M),Me=E[ae]||wLt[ae]||rQ,Pe=m.useContext(j8),Ee=m.useMemo(function(){return qt(qt({},Pe),{},{hideHeader:W})},[Pe,W]),Be="".concat(j,"-panel"),Je=tQ(t,["showWeek","prevIcon","nextIcon","superPrevIcon","superNextIcon","disabledDate","minDate","maxDate","onHover"]);return m.createElement(j8.Provider,{value:Ee},m.createElement("div",{ref:L,tabIndex:s,className:Vn(Be,Vt({},"".concat(Be,"-rtl"),i==="rtl"))},m.createElement(Me,ho({},Je,{showTime:$,prefixCls:j,locale:_,generateConfig:r,onModeChange:pe,pickerValue:ze,onPickerValueChange:function(Ke){ce(Ke,!0)},value:Z[0],onSelect:ve,values:Z,cellRender:Te,hoverRangeValue:Ae,hoverValue:A}))))}var lie=m.memo(m.forwardRef(vLt));function xLt(t){var e=t.picker,n=t.multiplePanel,o=t.pickerValue,r=t.onPickerValueChange,i=t.needConfirm,a=t.onSubmit,l=t.range,s=t.hoverValue,c=m.useContext(r5),u=c.prefixCls,d=c.generateConfig,f=m.useCallback(function(C,P){return ID(d,e,C,P)},[d,e]),p=m.useMemo(function(){return f(o,1)},[o,f]),g=function(P){r(f(P,-1))},y={onCellDblClick:function(){i&&a()}},w=e==="time",b=qt(qt({},t),{},{hoverValue:null,hoverRangeValue:null,hideHeader:w});return l?b.hoverRangeValue=s:b.hoverValue=s,n?m.createElement("div",{className:"".concat(u,"-panels")},m.createElement(j8.Provider,{value:qt(qt({},y),{},{hideNext:!0})},m.createElement(lie,b)),m.createElement(j8.Provider,{value:qt(qt({},y),{},{hidePrev:!0})},m.createElement(lie,ho({},b,{pickerValue:p,onPickerValueChange:g})))):m.createElement(j8.Provider,{value:qt({},y)},m.createElement(lie,b))}function exe(t){return typeof t=="function"?t():t}function bLt(t){var e=t.prefixCls,n=t.presets,o=t.onClick,r=t.onHover;return n.length?m.createElement("div",{className:"".concat(e,"-presets")},m.createElement("ul",null,n.map(function(i,a){var l=i.label,s=i.value;return m.createElement("li",{key:a,onClick:function(){o(exe(s))},onMouseEnter:function(){r(exe(s))},onMouseLeave:function(){r(null)}},l)}))):null}function KXe(t){var e=t.panelRender,n=t.internalMode,o=t.picker,r=t.showNow,i=t.range,a=t.multiple,l=t.activeOffset,s=l===void 0?0:l,c=t.presets,u=t.onPresetHover,d=t.onPresetSubmit,f=t.onFocus,p=t.onBlur,g=t.direction,y=t.value,w=t.onSelect,b=t.isInvalid,C=t.defaultOpenValue,P=t.onOk,v=t.onSubmit,T=m.useContext(r5),A=T.prefixCls,x="".concat(A,"-panel"),S=g==="rtl",R=m.useRef(null),M=m.useRef(null),D=m.useState(0),E=ln(D,2),W=E[0],j=E[1],L=m.useState(0),k=ln(L,2),N=k[0],F=k[1],U=function(fe){fe.offsetWidth&&j(fe.offsetWidth)};m.useEffect(function(){if(i){var ne,fe=((ne=R.current)===null||ne===void 0?void 0:ne.offsetWidth)||0,ge=W-fe;s<=ge?F(0):F(s+fe-W)}},[W,s,i]);function O(ne){return ne.filter(function(fe){return fe})}var B=m.useMemo(function(){return O(Wb(y))},[y]),_=o==="time"&&!B.length,X=m.useMemo(function(){return _?O([C]):B},[_,B,C]),$=_?C:B,Q=m.useMemo(function(){return X.length?X.some(function(ne){return b(ne)}):!0},[X,b]),le=function(){_&&w(C),P(),v()},q=m.createElement("div",{className:"".concat(A,"-panel-layout")},m.createElement(bLt,{prefixCls:A,presets:c,onClick:d,onHover:u}),m.createElement("div",null,m.createElement(xLt,ho({},t,{value:$})),m.createElement(sLt,ho({},t,{showNow:a?!1:r,invalid:Q,onSubmit:le}))));e&&(q=e(q));var te="".concat(x,"-container"),re="marginLeft",ae="marginRight",se=m.createElement("div",{tabIndex:-1,className:Vn(te,"".concat(A,"-").concat(n,"-panel-container")),style:Vt(Vt({},S?ae:re,N),S?re:ae,"auto"),onFocus:f,onBlur:p},q);return i&&(se=m.createElement("div",{ref:M,className:Vn("".concat(A,"-range-wrapper"),"".concat(A,"-").concat(o,"-range-wrapper"))},m.createElement("div",{ref:R,className:"".concat(A,"-range-arrow"),style:Vt({},S?"right":"left",s)}),m.createElement(Td,{onResize:U},se))),se}function qXe(t,e){var n=t.format,o=t.maskFormat,r=t.generateConfig,i=t.locale,a=t.preserveInvalidOnBlur,l=t.inputReadOnly,s=t.required,c=t["aria-required"],u=t.onSubmit,d=t.onFocus,f=t.onBlur,p=t.onInputChange,g=t.onInvalid,y=t.open,w=t.onOpenChange,b=t.onKeyDown,C=t.onChange,P=t.activeHelp,v=t.name,T=t.autoComplete,A=t.id,x=t.value,S=t.invalid,R=t.placeholder,M=t.disabled,D=t.activeIndex,E=t.allHelp,W=t.picker,j=function(_,X){var $=r.locale.parse(i.locale,_,[X]);return $&&r.isValidate($)?$:null},L=n[0],k=m.useCallback(function(B){return Lu(B,{locale:i,format:L,generateConfig:r})},[i,r,L]),N=m.useMemo(function(){return x.map(k)},[x,k]),F=m.useMemo(function(){var B=W==="time"?8:10,_=typeof L=="function"?L(r.getNow()).length:L.length;return Math.max(B,_)+2},[L,W,r]),U=function(_){for(var X=0;X=l&&n<=s)return i;var c=Math.min(Math.abs(n-l),Math.abs(n-s));c0?ot:st));var St=Ze+Xe,Pt=st-ot+1;return String(ot+(Pt+St-ot)%Pt)};switch(Ke){case"Backspace":case"Delete":Ne="",De=Ye;break;case"ArrowLeft":Ne="",it(-1);break;case"ArrowRight":Ne="",it(1);break;case"ArrowUp":Ne="",De=Ve(1);break;case"ArrowDown":Ne="",De=Ve(-1);break;default:isNaN(Number(Ke))||(Ne=B+Ke,De=Ne);break}if(Ne!==null&&(_(Ne),Ne.length>=ke&&(it(1),_(""))),De!==null){var yt=se.slice(0,he)+Vme(De,ke)+se.slice(xe);Se(yt.slice(0,a.length))}ae({})},Ee=m.useRef();Xa(function(){if(!(!W||!a||ye.current)){if(!ge.match(se)){Se(a);return}return fe.current.setSelectionRange(he,xe),Ee.current=Fa(function(){fe.current.setSelectionRange(he,xe)}),function(){Fa.cancel(Ee.current)}}},[ge,a,W,se,Q,he,xe,re,Se]);var Be=a?{onFocus:ve,onBlur:Te,onKeyDown:Pe,onMouseDown:ce,onMouseUp:pe,onPaste:Ie}:{};return m.createElement("div",{ref:ne,className:Vn(M,Vt(Vt({},"".concat(M,"-active"),n&&r),"".concat(M,"-placeholder"),c))},m.createElement(R,ho({ref:fe,"aria-invalid":y,autoComplete:"off"},b,{onKeyDown:Me,onBlur:Ae},Be,{value:se,onChange:ze})),m.createElement(iQ,{type:"suffix",icon:i}),w)}),MLt=["id","clearIcon","suffixIcon","separator","activeIndex","activeHelp","allHelp","focused","onFocus","onBlur","onKeyDown","locale","generateConfig","placeholder","className","style","onClick","onClear","value","onChange","onSubmit","onInputChange","format","maskFormat","preserveInvalidOnBlur","onInvalid","disabled","invalid","inputReadOnly","direction","onOpenChange","onActiveOffset","onMouseDown","required","aria-required","autoFocus"],ILt=["index"];function zLt(t,e){var n=t.id,o=t.clearIcon,r=t.suffixIcon,i=t.separator,a=i===void 0?"~":i,l=t.activeIndex;t.activeHelp,t.allHelp;var s=t.focused;t.onFocus,t.onBlur,t.onKeyDown,t.locale,t.generateConfig;var c=t.placeholder,u=t.className,d=t.style,f=t.onClick,p=t.onClear,g=t.value;t.onChange,t.onSubmit,t.onInputChange,t.format,t.maskFormat,t.preserveInvalidOnBlur,t.onInvalid;var y=t.disabled,w=t.invalid;t.inputReadOnly;var b=t.direction;t.onOpenChange;var C=t.onActiveOffset,P=t.onMouseDown;t.required,t["aria-required"];var v=t.autoFocus,T=ii(t,MLt),A=b==="rtl",x=m.useContext(r5),S=x.prefixCls,R=m.useMemo(function(){if(typeof n=="string")return[n];var te=n||{};return[te.start,te.end]},[n]),M=m.useRef(),D=m.useRef(),E=m.useRef(),W=function(re){var ae;return(ae=[D,E][re])===null||ae===void 0?void 0:ae.current};m.useImperativeHandle(e,function(){return{nativeElement:M.current,focus:function(re){if(hi(re)==="object"){var ae,se=re||{},ne=se.index,fe=ne===void 0?0:ne,ge=ii(se,ILt);(ae=W(fe))===null||ae===void 0||ae.focus(ge)}else{var de;(de=W(re??0))===null||de===void 0||de.focus()}},blur:function(){var re,ae;(re=W(0))===null||re===void 0||re.blur(),(ae=W(1))===null||ae===void 0||ae.blur()}}});var j=$Xe(T),L=m.useMemo(function(){return Array.isArray(c)?c:[c,c]},[c]),k=qXe(qt(qt({},t),{},{id:R,placeholder:L})),N=ln(k,1),F=N[0],U=A?"right":"left",O=m.useState(Vt({position:"absolute",width:0},U,0)),B=ln(O,2),_=B[0],X=B[1],$=Ea(function(){var te=W(l);if(te){var re=te.nativeElement,ae=re.offsetWidth,se=re.offsetLeft,ne=re.offsetParent,fe=se;if(A){var ge=ne,de=getComputedStyle(ge);fe=ge.offsetWidth-parseFloat(de.borderRightWidth)-parseFloat(de.borderLeftWidth)-se-ae}X(function(Z){return qt(qt({},Z),{},Vt({width:ae},U,fe))}),C(l===0?0:fe)}});m.useEffect(function(){$()},[l]);var Q=o&&(g[0]&&!y[0]||g[1]&&!y[1]),le=v&&!y[0],q=v&&!le&&!y[1];return m.createElement(Td,{onResize:$},m.createElement("div",ho({},j,{className:Vn(S,"".concat(S,"-range"),Vt(Vt(Vt(Vt({},"".concat(S,"-focused"),s),"".concat(S,"-disabled"),y.every(function(te){return te})),"".concat(S,"-invalid"),w.some(function(te){return te})),"".concat(S,"-rtl"),A),u),style:d,ref:M,onClick:f,onMouseDown:function(re){var ae=re.target;ae!==D.current.inputElement&&ae!==E.current.inputElement&&re.preventDefault(),P==null||P(re)}}),m.createElement(cue,ho({ref:D},F(0),{autoFocus:le,"date-range":"start"})),m.createElement("div",{className:"".concat(S,"-range-separator")},a),m.createElement(cue,ho({ref:E},F(1),{autoFocus:q,"date-range":"end"})),m.createElement("div",{className:"".concat(S,"-active-bar"),style:_}),m.createElement(iQ,{type:"suffix",icon:r}),Q&&m.createElement(sue,{icon:o,onClear:p})))}var DLt=m.forwardRef(zLt);function nxe(t,e){var n=t??e;return Array.isArray(n)?n:[n,n]}function FY(t){return t===1?"end":"start"}function ELt(t,e){var n=kXe(t,function(){var eo=t.disabled,Xn=t.allowEmpty,Jo=nxe(eo,!1),xo=nxe(Xn,!1);return{disabled:Jo,allowEmpty:xo}}),o=ln(n,6),r=o[0],i=o[1],a=o[2],l=o[3],s=o[4],c=o[5],u=r.prefixCls,d=r.styles,f=r.classNames,p=r.defaultValue,g=r.value,y=r.needConfirm,w=r.onKeyDown,b=r.disabled,C=r.allowEmpty,P=r.disabledDate,v=r.minDate,T=r.maxDate,A=r.defaultOpen,x=r.open,S=r.onOpenChange,R=r.locale,M=r.generateConfig,D=r.picker,E=r.showNow,W=r.showToday,j=r.showTime,L=r.mode,k=r.onPanelChange,N=r.onCalendarChange,F=r.onOk,U=r.defaultPickerValue,O=r.pickerValue,B=r.onPickerValueChange,_=r.inputReadOnly,X=r.suffixIcon,$=r.onFocus,Q=r.onBlur,le=r.presets,q=r.ranges,te=r.components,re=r.cellRender,ae=r.dateRender,se=r.monthCellRender,ne=r.onClick,fe=WXe(e),ge=LXe(x,A,b,S),de=ln(ge,2),Z=de[0],he=de[1],xe=function(Xn,Jo){(b.some(function(xo){return!xo})||!Xn)&&he(Xn,Jo)},He=_Xe(M,R,l,!0,!1,p,g,N,F),Se=ln(He,5),ze=Se[0],Ie=Se[1],ye=Se[2],ce=Se[3],pe=Se[4],ve=ye(),Ae=UXe(b,C),Te=ln(Ae,7),Me=Te[0],Pe=Te[1],Ee=Te[2],Be=Te[3],Je=Te[4],We=Te[5],Ke=Te[6],Ne=function(Xn,Jo){Pe(!0),$==null||$(Xn,{range:FY(Jo??Be)})},De=function(Xn,Jo){Pe(!1),Q==null||Q(Xn,{range:FY(Jo??Be)})},ke=m.useMemo(function(){if(!j)return null;var eo=j.disabledTime,Xn=eo?function(Jo){var xo=FY(Be),Qo=TXe(ve,Ke,Be);return eo(Jo,xo,{from:Qo})}:void 0;return qt(qt({},j),{},{disabledTime:Xn})},[j,Be,ve,Ke]),Ye=zs([D,D],{value:L}),it=ln(Ye,2),Ve=it[0],yt=it[1],ct=Ve[Be]||D,Xe=ct==="date"&&ke?"datetime":ct,ut=Xe===D&&Xe!=="time",ft=GXe(D,ct,E,W,!0),ot=VXe(r,ze,Ie,ye,ce,b,l,Me,Z,c),st=ln(ot,2),at=st[0],Oe=st[1],Ze=rLt(ve,b,Ke,M,R,P),St=CXe(ve,c,C),Pt=ln(St,2),Rt=Pt[0],Ut=Pt[1],Ht=jXe(M,R,ve,Ve,Z,Be,i,ut,U,O,ke==null?void 0:ke.defaultOpenValue,B,v,T),At=ln(Ht,2),kt=At[0],gt=At[1],dt=Ea(function(eo,Xn,Jo){var xo=bE(Ve,Be,Xn);if((xo[0]!==Ve[0]||xo[1]!==Ve[1])&&yt(xo),k&&Jo!==!1){var Qo=Lo(ve);eo&&(Qo[Be]=eo),k(Qo,xo)}}),Ct=function(Xn,Jo){return bE(ve,Jo,Xn)},tt=function(Xn,Jo){var xo=ve;Xn&&(xo=Ct(Xn,Be));var Qo=We(xo);ce(xo),at(Be,Qo===null),Qo===null?xe(!1,{force:!0}):Jo||fe.current.focus({index:Qo})},Fe=function(Xn){if(!fe.current.nativeElement.contains(document.activeElement)){var Jo=b.findIndex(function(xo){return!xo});Jo>=0&&fe.current.focus({index:Jo})}xe(!0),ne==null||ne(Xn)},qe=function(){Oe(null),xe(!1,{force:!0})},je=m.useState(null),rt=ln(je,2),mt=rt[0],Qe=rt[1],Tt=m.useState(null),Dt=ln(Tt,2),lt=Dt[0],zt=Dt[1],Ft=m.useMemo(function(){return lt||ve},[ve,lt]);m.useEffect(function(){Z||zt(null)},[Z]);var _t=m.useState(0),tn=ln(_t,2),Qt=tn[0],gn=tn[1],an=NXe(le,q),mn=function(Xn){zt(Xn),Qe("preset")},Hn=function(Xn){var Jo=Oe(Xn);Jo&&xe(!1,{force:!0})},Fo=function(Xn){tt(Xn)},yo=function(Xn){zt(Xn?Ct(Xn,Be):null),Qe("cell")},So=function(Xn){xe(!0),Ne(Xn)},$o=function(Xn){Ee("panel");var Jo=bE(ve,Be,Xn);ce(Jo),!y&&!a&&i===Xe&&tt(Xn)},mo=function(){xe(!1)},Jn=Gme(re,ae,se,FY(Be)),uo=ve[Be]||null,ir=Ea(function(eo){return c(eo,{activeIndex:Be})}),Rr=m.useMemo(function(){var eo=Sf(r,!1),Xn=jH(r,[].concat(Lo(Object.keys(eo)),["onChange","onCalendarChange","style","className","onPanelChange","disabledTime"]));return Xn},[r]),br=m.createElement(KXe,ho({},Rr,{showNow:ft,showTime:ke,range:!0,multiplePanel:ut,activeOffset:Qt,disabledDate:Ze,onFocus:So,onBlur:De,picker:D,mode:ct,internalMode:Xe,onPanelChange:dt,format:s,value:uo,isInvalid:ir,onChange:null,onSelect:$o,pickerValue:kt,defaultOpenValue:Wb(j==null?void 0:j.defaultOpenValue)[Be],onPickerValueChange:gt,hoverValue:Ft,onHover:yo,needConfirm:y,onSubmit:tt,onOk:pe,presets:an,onPresetHover:mn,onPresetSubmit:Hn,onNow:Fo,cellRender:Jn})),Vr=function(Xn,Jo){var xo=Ct(Xn,Jo);ce(xo)},Wo=function(){Ee("input")},wn=function(Xn,Jo){Ee("input"),xe(!0,{inherit:!0}),Je(Jo),Ne(Xn,Jo)},In=function(Xn,Jo){xe(!1),De(Xn,Jo)},ar=function(Xn,Jo){Xn.key==="Tab"&&tt(null,!0),w==null||w(Xn,Jo)},No=m.useMemo(function(){return{prefixCls:u,locale:R,generateConfig:M,button:te.button,input:te.input}},[u,R,M,te.button,te.input]);return Xa(function(){Z&&Be!==void 0&&dt(null,D,!1)},[Z,Be,D]),Xa(function(){var eo=Ee();!Z&&eo==="input"&&(xe(!1),tt(null,!0)),!Z&&a&&!y&&eo==="panel"&&(xe(!0),tt())},[Z]),m.createElement(r5.Provider,{value:No},m.createElement(bXe,ho({},PXe(r),{popupElement:br,popupStyle:d.popup,popupClassName:f.popup,visible:Z,onClose:mo,range:!0}),m.createElement(DLt,ho({},r,{ref:fe,suffixIcon:X,activeIndex:Me||Z?Be:null,activeHelp:!!lt,allHelp:!!lt&&mt==="preset",focused:Me,onFocus:wn,onBlur:In,onKeyDown:ar,onSubmit:tt,value:Ft,maskFormat:s,onChange:Vr,onInputChange:Wo,format:l,inputReadOnly:_,disabled:b,open:Z,onOpenChange:xe,onClick:Fe,onClear:qe,invalid:Rt,onInvalid:Ut,onActiveOffset:gn}))))}var FLt=m.forwardRef(ELt);function kLt(t){var e=t.prefixCls,n=t.value,o=t.onRemove,r=t.removeIcon,i=r===void 0?"×":r,a=t.formatDate,l=t.disabled,s=t.maxTagCount,c=t.placeholder,u="".concat(e,"-selector"),d="".concat(e,"-selection"),f="".concat(d,"-overflow");function p(w,b){return m.createElement("span",{className:Vn("".concat(d,"-item")),title:typeof w=="string"?w:null},m.createElement("span",{className:"".concat(d,"-item-content")},w),!l&&b&&m.createElement("span",{onMouseDown:function(P){P.preventDefault()},onClick:b,className:"".concat(d,"-item-remove")},i))}function g(w){var b=a(w),C=function(v){v&&v.stopPropagation(),o(w)};return p(b,C)}function y(w){var b="+ ".concat(w.length," ...");return p(b)}return m.createElement("div",{className:u},m.createElement(k2,{prefixCls:f,data:n,renderItem:g,renderRest:y,itemKey:function(b){return a(b)},maxCount:s}),!n.length&&m.createElement("span",{className:"".concat(e,"-selection-placeholder")},c))}var LLt=["id","open","clearIcon","suffixIcon","activeHelp","allHelp","focused","onFocus","onBlur","onKeyDown","locale","generateConfig","placeholder","className","style","onClick","onClear","internalPicker","value","onChange","onSubmit","onInputChange","multiple","maxTagCount","format","maskFormat","preserveInvalidOnBlur","onInvalid","disabled","invalid","inputReadOnly","direction","onOpenChange","onMouseDown","required","aria-required","autoFocus","removeIcon"];function WLt(t,e){t.id;var n=t.open,o=t.clearIcon,r=t.suffixIcon;t.activeHelp,t.allHelp;var i=t.focused;t.onFocus,t.onBlur,t.onKeyDown;var a=t.locale,l=t.generateConfig,s=t.placeholder,c=t.className,u=t.style,d=t.onClick,f=t.onClear,p=t.internalPicker,g=t.value,y=t.onChange,w=t.onSubmit;t.onInputChange;var b=t.multiple,C=t.maxTagCount;t.format,t.maskFormat,t.preserveInvalidOnBlur,t.onInvalid;var P=t.disabled,v=t.invalid;t.inputReadOnly;var T=t.direction;t.onOpenChange;var A=t.onMouseDown;t.required,t["aria-required"];var x=t.autoFocus,S=t.removeIcon,R=ii(t,LLt),M=T==="rtl",D=m.useContext(r5),E=D.prefixCls,W=m.useRef(),j=m.useRef();m.useImperativeHandle(e,function(){return{nativeElement:W.current,focus:function(Q){var le;(le=j.current)===null||le===void 0||le.focus(Q)},blur:function(){var Q;(Q=j.current)===null||Q===void 0||Q.blur()}}});var L=$Xe(R),k=function(Q){y([Q])},N=function(Q){var le=g.filter(function(q){return q&&!fh(l,a,q,Q,p)});y(le),n||w()},F=qXe(qt(qt({},t),{},{onChange:k}),function($){var Q=$.valueTexts;return{value:Q[0]||"",active:i}}),U=ln(F,2),O=U[0],B=U[1],_=!!(o&&g.length&&!P),X=b?m.createElement(m.Fragment,null,m.createElement(kLt,{prefixCls:E,value:g,onRemove:N,formatDate:B,maxTagCount:C,disabled:P,removeIcon:S,placeholder:s}),m.createElement("input",{className:"".concat(E,"-multiple-input"),value:g.map(B).join(","),ref:j,readOnly:!0,autoFocus:x}),m.createElement(iQ,{type:"suffix",icon:r}),_&&m.createElement(sue,{icon:o,onClear:f})):m.createElement(cue,ho({ref:j},O(),{autoFocus:x,suffixIcon:r,clearIcon:_&&m.createElement(sue,{icon:o,onClear:f}),showActiveCls:!1}));return m.createElement("div",ho({},L,{className:Vn(E,Vt(Vt(Vt(Vt(Vt({},"".concat(E,"-multiple"),b),"".concat(E,"-focused"),i),"".concat(E,"-disabled"),P),"".concat(E,"-invalid"),v),"".concat(E,"-rtl"),M),c),style:u,ref:W,onClick:d,onMouseDown:function(Q){var le,q=Q.target;q!==((le=j.current)===null||le===void 0?void 0:le.inputElement)&&Q.preventDefault(),A==null||A(Q)}}),X)}var NLt=m.forwardRef(WLt);function ULt(t,e){var n=kXe(t),o=ln(n,6),r=o[0],i=o[1],a=o[2],l=o[3],s=o[4],c=o[5],u=r,d=u.prefixCls,f=u.styles,p=u.classNames,g=u.order,y=u.defaultValue,w=u.value,b=u.needConfirm,C=u.onChange,P=u.onKeyDown,v=u.disabled,T=u.disabledDate,A=u.minDate,x=u.maxDate,S=u.defaultOpen,R=u.open,M=u.onOpenChange,D=u.locale,E=u.generateConfig,W=u.picker,j=u.showNow,L=u.showToday,k=u.showTime,N=u.mode,F=u.onPanelChange,U=u.onCalendarChange,O=u.onOk,B=u.multiple,_=u.defaultPickerValue,X=u.pickerValue,$=u.onPickerValueChange,Q=u.inputReadOnly,le=u.suffixIcon,q=u.removeIcon,te=u.onFocus,re=u.onBlur,ae=u.presets,se=u.components,ne=u.cellRender,fe=u.dateRender,ge=u.monthCellRender,de=u.onClick,Z=WXe(e);function he(Wo){return Wo===null?null:B?Wo:Wo[0]}var xe=XXe(E,D,i),He=LXe(R,S,[v],M),Se=ln(He,2),ze=Se[0],Ie=Se[1],ye=function(wn,In,ar){if(U){var No=qt({},ar);delete No.range,U(he(wn),he(In),No)}},ce=function(wn){O==null||O(he(wn))},pe=_Xe(E,D,l,!1,g,y,w,ye,ce),ve=ln(pe,5),Ae=ve[0],Te=ve[1],Me=ve[2],Pe=ve[3],Ee=ve[4],Be=Me(),Je=UXe([v]),We=ln(Je,4),Ke=We[0],Ne=We[1],De=We[2],ke=We[3],Ye=function(wn){Ne(!0),te==null||te(wn,{})},it=function(wn){Ne(!1),re==null||re(wn,{})},Ve=zs(W,{value:N}),yt=ln(Ve,2),ct=yt[0],Xe=yt[1],ut=ct==="date"&&k?"datetime":ct,ft=GXe(W,ct,j,L),ot=C&&function(Wo,wn){C(he(Wo),he(wn))},st=VXe(qt(qt({},r),{},{onChange:ot}),Ae,Te,Me,Pe,[],l,Ke,ze,c),at=ln(st,2),Oe=at[1],Ze=CXe(Be,c),St=ln(Ze,2),Pt=St[0],Rt=St[1],Ut=m.useMemo(function(){return Pt.some(function(Wo){return Wo})},[Pt]),Ht=function(wn,In){if($){var ar=qt(qt({},In),{},{mode:In.mode[0]});delete ar.range,$(wn[0],ar)}},At=jXe(E,D,Be,[ct],ze,ke,i,!1,_,X,Wb(k==null?void 0:k.defaultOpenValue),Ht,A,x),kt=ln(At,2),gt=kt[0],dt=kt[1],Ct=Ea(function(Wo,wn,In){if(Xe(wn),F&&In!==!1){var ar=Wo||Be[Be.length-1];F(ar,wn)}}),tt=function(){Oe(Me()),Ie(!1,{force:!0})},Fe=function(wn){!v&&!Z.current.nativeElement.contains(document.activeElement)&&Z.current.focus(),Ie(!0),de==null||de(wn)},qe=function(){Oe(null),Ie(!1,{force:!0})},je=m.useState(null),rt=ln(je,2),mt=rt[0],Qe=rt[1],Tt=m.useState(null),Dt=ln(Tt,2),lt=Dt[0],zt=Dt[1],Ft=m.useMemo(function(){var Wo=[lt].concat(Lo(Be)).filter(function(wn){return wn});return B?Wo:Wo.slice(0,1)},[Be,lt,B]),_t=m.useMemo(function(){return!B&<?[lt]:Be.filter(function(Wo){return Wo})},[Be,lt,B]);m.useEffect(function(){ze||zt(null)},[ze]);var tn=NXe(ae),Qt=function(wn){zt(wn),Qe("preset")},gn=function(wn){var In=B?xe(Me(),wn):[wn],ar=Oe(In);ar&&!B&&Ie(!1,{force:!0})},an=function(wn){gn(wn)},mn=function(wn){zt(wn),Qe("cell")},Hn=function(wn){Ie(!0),Ye(wn)},Fo=function(wn){De("panel");var In=B?xe(Me(),wn):[wn];Pe(In),!b&&!a&&i===ut&&tt()},yo=function(){Ie(!1)},So=Gme(ne,fe,ge),$o=m.useMemo(function(){var Wo=Sf(r,!1),wn=jH(r,[].concat(Lo(Object.keys(Wo)),["onChange","onCalendarChange","style","className","onPanelChange"]));return qt(qt({},wn),{},{multiple:r.multiple})},[r]),mo=m.createElement(KXe,ho({},$o,{showNow:ft,showTime:k,disabledDate:T,onFocus:Hn,onBlur:it,picker:W,mode:ct,internalMode:ut,onPanelChange:Ct,format:s,value:Be,isInvalid:c,onChange:null,onSelect:Fo,pickerValue:gt,defaultOpenValue:k==null?void 0:k.defaultOpenValue,onPickerValueChange:dt,hoverValue:Ft,onHover:mn,needConfirm:b,onSubmit:tt,onOk:Ee,presets:tn,onPresetHover:Qt,onPresetSubmit:gn,onNow:an,cellRender:So})),Jn=function(wn){Pe(wn)},uo=function(){De("input")},ir=function(wn){De("input"),Ie(!0,{inherit:!0}),Ye(wn)},Rr=function(wn){Ie(!1),it(wn)},br=function(wn,In){wn.key==="Tab"&&tt(),P==null||P(wn,In)},Vr=m.useMemo(function(){return{prefixCls:d,locale:D,generateConfig:E,button:se.button,input:se.input}},[d,D,E,se.button,se.input]);return Xa(function(){ze&&ke!==void 0&&Ct(null,W,!1)},[ze,ke,W]),Xa(function(){var Wo=De();!ze&&Wo==="input"&&(Ie(!1),tt()),!ze&&a&&!b&&Wo==="panel"&&(Ie(!0),tt())},[ze]),m.createElement(r5.Provider,{value:Vr},m.createElement(bXe,ho({},PXe(r),{popupElement:mo,popupStyle:f.popup,popupClassName:p.popup,visible:ze,onClose:yo}),m.createElement(NLt,ho({},r,{ref:Z,suffixIcon:le,removeIcon:q,activeHelp:!!lt,allHelp:!!lt&&mt==="preset",focused:Ke,onFocus:ir,onBlur:Rr,onKeyDown:br,onSubmit:tt,value:_t,maskFormat:s,onChange:Jn,onInputChange:uo,internalPicker:i,format:l,inputReadOnly:Q,disabled:v,open:ze,onOpenChange:Ie,onClick:Fe,onClear:qe,invalid:Ut,onInvalid:function(wn){Rt(wn,0)}}))))}var jLt=m.forwardRef(ULt);const QXe=m.createContext(null),BLt=QXe.Provider,ZXe=m.createContext(null),YLt=ZXe.Provider;var OLt=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],eJe=m.forwardRef(function(t,e){var n=t.prefixCls,o=n===void 0?"rc-checkbox":n,r=t.className,i=t.style,a=t.checked,l=t.disabled,s=t.defaultChecked,c=s===void 0?!1:s,u=t.type,d=u===void 0?"checkbox":u,f=t.title,p=t.onChange,g=ii(t,OLt),y=m.useRef(null),w=zs(c,{value:a}),b=ln(w,2),C=b[0],P=b[1];m.useImperativeHandle(e,function(){return{focus:function(x){var S;(S=y.current)===null||S===void 0||S.focus(x)},blur:function(){var x;(x=y.current)===null||x===void 0||x.blur()},input:y.current}});var v=Vn(o,r,Vt(Vt({},"".concat(o,"-checked"),C),"".concat(o,"-disabled"),l)),T=function(x){l||("checked"in t||P(x.target.checked),p==null||p({target:qt(qt({},t),{},{type:d,checked:x.target.checked}),stopPropagation:function(){x.stopPropagation()},preventDefault:function(){x.preventDefault()},nativeEvent:x.nativeEvent}))};return m.createElement("span",{className:v,title:f,style:i},m.createElement("input",ho({},g,{className:"".concat(o,"-input"),ref:y,onChange:T,disabled:l,checked:!!C,type:d})),m.createElement("span",{className:"".concat(o,"-inner")}))});const _Lt=t=>{const{componentCls:e,antCls:n}=t,o=`${e}-group`;return{[o]:Object.assign(Object.assign({},ja(t)),{display:"inline-block",fontSize:0,[`&${o}-rtl`]:{direction:"rtl"},[`${n}-badge ${n}-badge-count`]:{zIndex:1},[`> ${n}-badge:not(:first-child) > ${n}-button-wrapper`]:{borderInlineStart:"none"}})}},VLt=t=>{const{componentCls:e,wrapperMarginInlineEnd:n,colorPrimary:o,radioSize:r,motionDurationSlow:i,motionDurationMid:a,motionEaseInOutCirc:l,colorBgContainer:s,colorBorder:c,lineWidth:u,colorBgContainerDisabled:d,colorTextDisabled:f,paddingXS:p,dotColorDisabled:g,lineType:y,radioColor:w,radioBgColor:b,calc:C}=t,P=`${e}-inner`,T=C(r).sub(C(4).mul(2)),A=C(1).mul(r).equal();return{[`${e}-wrapper`]:Object.assign(Object.assign({},ja(t)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer",[`&${e}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:t.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${e}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${Nt(u)} ${y} ${o}`,borderRadius:"50%",visibility:"hidden",opacity:0,content:'""'},[e]:Object.assign(Object.assign({},ja(t)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${e}-wrapper:hover &, - &:hover ${P}`]:{borderColor:o},[`${e}-input:focus-visible + ${P}`]:Object.assign({},lw(t)),[`${e}:hover::after, ${e}-wrapper:hover &::after`]:{visibility:"visible"},[`${e}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:A,height:A,marginBlockStart:C(1).mul(r).div(-2).equal(),marginInlineStart:C(1).mul(r).div(-2).equal(),backgroundColor:w,borderBlockStart:0,borderInlineStart:0,borderRadius:A,transform:"scale(0)",opacity:0,transition:`all ${i} ${l}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:A,height:A,backgroundColor:s,borderColor:c,borderStyle:"solid",borderWidth:u,borderRadius:"50%",transition:`all ${a}`},[`${e}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${e}-checked`]:{[P]:{borderColor:o,backgroundColor:b,"&::after":{transform:`scale(${t.calc(t.dotSize).div(r).equal()})`,opacity:1,transition:`all ${i} ${l}`}}},[`${e}-disabled`]:{cursor:"not-allowed",[P]:{backgroundColor:d,borderColor:c,cursor:"not-allowed","&::after":{backgroundColor:g}},[`${e}-input`]:{cursor:"not-allowed"},[`${e}-disabled + span`]:{color:f,cursor:"not-allowed"},[`&${e}-checked`]:{[P]:{"&::after":{transform:`scale(${C(T).div(r).equal({unit:!1})})`}}}},[`span${e} + *`]:{paddingInlineStart:p,paddingInlineEnd:p}})}},GLt=t=>{const{buttonColor:e,controlHeight:n,componentCls:o,lineWidth:r,lineType:i,colorBorder:a,motionDurationSlow:l,motionDurationMid:s,buttonPaddingInline:c,fontSize:u,buttonBg:d,fontSizeLG:f,controlHeightLG:p,controlHeightSM:g,paddingXS:y,borderRadius:w,borderRadiusSM:b,borderRadiusLG:C,buttonCheckedBg:P,buttonSolidCheckedColor:v,colorTextDisabled:T,colorBgContainerDisabled:A,buttonCheckedBgDisabled:x,buttonCheckedColorDisabled:S,colorPrimary:R,colorPrimaryHover:M,colorPrimaryActive:D,buttonSolidCheckedBg:E,buttonSolidCheckedHoverBg:W,buttonSolidCheckedActiveBg:j,calc:L}=t;return{[`${o}-button-wrapper`]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:c,paddingBlock:0,color:e,fontSize:u,lineHeight:Nt(L(n).sub(L(r).mul(2)).equal()),background:d,border:`${Nt(r)} ${i} ${a}`,borderBlockStartWidth:L(r).add(.02).equal(),borderInlineStartWidth:0,borderInlineEndWidth:r,cursor:"pointer",transition:[`color ${s}`,`background ${s}`,`box-shadow ${s}`].join(","),a:{color:e},[`> ${o}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:L(r).mul(-1).equal(),insetInlineStart:L(r).mul(-1).equal(),display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:r,paddingInline:0,backgroundColor:a,transition:`background-color ${l}`,content:'""'}},"&:first-child":{borderInlineStart:`${Nt(r)} ${i} ${a}`,borderStartStartRadius:w,borderEndStartRadius:w},"&:last-child":{borderStartEndRadius:w,borderEndEndRadius:w},"&:first-child:last-child":{borderRadius:w},[`${o}-group-large &`]:{height:p,fontSize:f,lineHeight:Nt(L(p).sub(L(r).mul(2)).equal()),"&:first-child":{borderStartStartRadius:C,borderEndStartRadius:C},"&:last-child":{borderStartEndRadius:C,borderEndEndRadius:C}},[`${o}-group-small &`]:{height:g,paddingInline:L(y).sub(r).equal(),paddingBlock:0,lineHeight:Nt(L(g).sub(L(r).mul(2)).equal()),"&:first-child":{borderStartStartRadius:b,borderEndStartRadius:b},"&:last-child":{borderStartEndRadius:b,borderEndEndRadius:b}},"&:hover":{position:"relative",color:R},"&:has(:focus-visible)":Object.assign({},lw(t)),[`${o}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${o}-button-wrapper-disabled)`]:{zIndex:1,color:R,background:P,borderColor:R,"&::before":{backgroundColor:R},"&:first-child":{borderColor:R},"&:hover":{color:M,borderColor:M,"&::before":{backgroundColor:M}},"&:active":{color:D,borderColor:D,"&::before":{backgroundColor:D}}},[`${o}-group-solid &-checked:not(${o}-button-wrapper-disabled)`]:{color:v,background:E,borderColor:E,"&:hover":{color:v,background:W,borderColor:W},"&:active":{color:v,background:j,borderColor:j}},"&-disabled":{color:T,backgroundColor:A,borderColor:a,cursor:"not-allowed","&:first-child, &:hover":{color:T,backgroundColor:A,borderColor:a}},[`&-disabled${o}-button-wrapper-checked`]:{color:S,backgroundColor:x,borderColor:a,boxShadow:"none"}}}},XLt=t=>{const{wireframe:e,padding:n,marginXS:o,lineWidth:r,fontSizeLG:i,colorText:a,colorBgContainer:l,colorTextDisabled:s,controlItemBgActiveDisabled:c,colorTextLightSolid:u,colorPrimary:d,colorPrimaryHover:f,colorPrimaryActive:p,colorWhite:g}=t,y=4,w=i,b=e?w-y*2:w-(y+r)*2;return{radioSize:w,dotSize:b,dotColorDisabled:s,buttonSolidCheckedColor:u,buttonSolidCheckedBg:d,buttonSolidCheckedHoverBg:f,buttonSolidCheckedActiveBg:p,buttonBg:l,buttonCheckedBg:l,buttonColor:a,buttonCheckedBgDisabled:c,buttonCheckedColorDisabled:s,buttonPaddingInline:n-r,wrapperMarginInlineEnd:o,radioColor:e?d:g,radioBgColor:e?l:d}},tJe=wl("Radio",t=>{const{controlOutline:e,controlOutlineWidth:n}=t,o=`0 0 0 ${Nt(n)} ${e}`,i=Ki(t,{radioFocusShadow:o,radioButtonFocusShadow:o});return[_Lt(i),VLt(i),GLt(i)]},XLt,{unitless:{radioSize:!0,dotSize:!0}});var JLt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n,o;const r=m.useContext(QXe),i=m.useContext(ZXe),{getPrefixCls:a,direction:l,radio:s}=m.useContext(Cr),c=m.useRef(null),u=o5(e,c),{isFormItemInput:d}=m.useContext(r1),f=j=>{var L,k;(L=t.onChange)===null||L===void 0||L.call(t,j),(k=r==null?void 0:r.onChange)===null||k===void 0||k.call(r,j)},{prefixCls:p,className:g,rootClassName:y,children:w,style:b,title:C}=t,P=JLt(t,["prefixCls","className","rootClassName","children","style","title"]),v=a("radio",p),T=((r==null?void 0:r.optionType)||i)==="button",A=T?`${v}-button`:v,x=O0(v),[S,R,M]=tJe(v,x),D=Object.assign({},P),E=m.useContext(n1);r&&(D.name=r.name,D.onChange=f,D.checked=t.value===r.value,D.disabled=(n=D.disabled)!==null&&n!==void 0?n:r.disabled),D.disabled=(o=D.disabled)!==null&&o!==void 0?o:E;const W=Un(`${A}-wrapper`,{[`${A}-wrapper-checked`]:D.checked,[`${A}-wrapper-disabled`]:D.disabled,[`${A}-wrapper-rtl`]:l==="rtl",[`${A}-wrapper-in-form-item`]:d},s==null?void 0:s.className,g,y,R,M,x);return S(m.createElement(EW,{component:"Radio",disabled:D.disabled},m.createElement("label",{className:W,style:Object.assign(Object.assign({},s==null?void 0:s.style),b),onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,title:C},m.createElement(eJe,Object.assign({},D,{className:Un(D.className,!T&&k$),type:"radio",prefixCls:A,ref:u})),w!==void 0?m.createElement("span",null,w):null)))},OG=m.forwardRef(KLt),qLt=m.forwardRef((t,e)=>{const{getPrefixCls:n,direction:o}=m.useContext(Cr),[r,i]=$6(t.defaultValue,{value:t.value}),a=j=>{const L=r,k=j.target.value;"value"in t||i(k);const{onChange:N}=t;N&&k!==L&&N(j)},{prefixCls:l,className:s,rootClassName:c,options:u,buttonStyle:d="outline",disabled:f,children:p,size:g,style:y,id:w,onMouseEnter:b,onMouseLeave:C,onFocus:P,onBlur:v}=t,T=n("radio",l),A=`${T}-group`,x=O0(T),[S,R,M]=tJe(T,x);let D=p;u&&u.length>0&&(D=u.map(j=>typeof j=="string"||typeof j=="number"?m.createElement(OG,{key:j.toString(),prefixCls:T,disabled:f,value:j,checked:r===j},j):m.createElement(OG,{key:`radio-group-value-options-${j.value}`,prefixCls:T,disabled:j.disabled||f,value:j.value,checked:r===j.value,title:j.title,style:j.style,id:j.id,required:j.required},j.label)));const E=Ed(g),W=Un(A,`${A}-${d}`,{[`${A}-${E}`]:E,[`${A}-rtl`]:o==="rtl"},s,c,R,M,x);return S(m.createElement("div",Object.assign({},yme(t,{aria:!0,data:!0}),{className:W,style:y,onMouseEnter:b,onMouseLeave:C,onFocus:P,onBlur:v,id:w,ref:e}),m.createElement(BLt,{value:{onChange:a,value:r,disabled:t.disabled,name:t.name,optionType:t.optionType}},D)))}),$Lt=m.memo(qLt);var QLt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{getPrefixCls:n}=m.useContext(Cr),{prefixCls:o}=t,r=QLt(t,["prefixCls"]),i=n("radio",o);return m.createElement(YLt,{value:"button"},m.createElement(OG,Object.assign({prefixCls:i},r,{type:"radio",ref:e})))},eWt=m.forwardRef(ZLt),Ue=OG;Ue.Button=eWt;Ue.Group=$Lt;Ue.__ANT_RADIO=!0;function GW(t){return Ki(t,{inputAffixPadding:t.paddingXXS})}const XW=t=>{const{controlHeight:e,fontSize:n,lineHeight:o,lineWidth:r,controlHeightSM:i,controlHeightLG:a,fontSizeLG:l,lineHeightLG:s,paddingSM:c,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:f,colorPrimaryHover:p,colorPrimary:g,controlOutlineWidth:y,controlOutline:w,colorErrorOutline:b,colorWarningOutline:C,colorBgContainer:P}=t;return{paddingBlock:Math.max(Math.round((e-n*o)/2*10)/10-r,0),paddingBlockSM:Math.max(Math.round((i-n*o)/2*10)/10-r,0),paddingBlockLG:Math.ceil((a-l*s)/2*10)/10-r,paddingInline:c-r,paddingInlineSM:u-r,paddingInlineLG:d-r,addonBg:f,activeBorderColor:g,hoverBorderColor:p,activeShadow:`0 0 0 ${y}px ${w}`,errorActiveShadow:`0 0 0 ${y}px ${b}`,warningActiveShadow:`0 0 0 ${y}px ${C}`,hoverBg:P,activeBg:P,inputFontSize:n,inputFontSizeLG:l,inputFontSizeSM:n}},tWt=t=>({borderColor:t.hoverBorderColor,backgroundColor:t.hoverBg}),aQ=t=>({color:t.colorTextDisabled,backgroundColor:t.colorBgContainerDisabled,borderColor:t.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":Object.assign({},tWt(Ki(t,{hoverBorderColor:t.colorBorder,hoverBg:t.colorBgContainerDisabled})))}),$me=(t,e)=>({background:t.colorBgContainer,borderWidth:t.lineWidth,borderStyle:t.lineType,borderColor:e.borderColor,"&:hover":{borderColor:e.hoverBorderColor,backgroundColor:t.hoverBg},"&:focus, &:focus-within":{borderColor:e.activeBorderColor,boxShadow:e.activeShadow,outline:0,backgroundColor:t.activeBg}}),oxe=(t,e)=>({[`&${t.componentCls}-status-${e.status}:not(${t.componentCls}-disabled)`]:Object.assign(Object.assign({},$me(t,e)),{[`${t.componentCls}-prefix, ${t.componentCls}-suffix`]:{color:e.affixColor}}),[`&${t.componentCls}-status-${e.status}${t.componentCls}-disabled`]:{borderColor:e.borderColor}}),Qme=(t,e)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},$me(t,{borderColor:t.colorBorder,hoverBorderColor:t.hoverBorderColor,activeBorderColor:t.activeBorderColor,activeShadow:t.activeShadow})),{[`&${t.componentCls}-disabled, &[disabled]`]:Object.assign({},aQ(t))}),oxe(t,{status:"error",borderColor:t.colorError,hoverBorderColor:t.colorErrorBorderHover,activeBorderColor:t.colorError,activeShadow:t.errorActiveShadow,affixColor:t.colorError})),oxe(t,{status:"warning",borderColor:t.colorWarning,hoverBorderColor:t.colorWarningBorderHover,activeBorderColor:t.colorWarning,activeShadow:t.warningActiveShadow,affixColor:t.colorWarning})),e)}),rxe=(t,e)=>({[`&${t.componentCls}-group-wrapper-status-${e.status}`]:{[`${t.componentCls}-group-addon`]:{borderColor:e.addonBorderColor,color:e.addonColor}}}),nJe=t=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${t.componentCls}-group`]:{"&-addon":{background:t.addonBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},rxe(t,{status:"error",addonBorderColor:t.colorError,addonColor:t.colorErrorText})),rxe(t,{status:"warning",addonBorderColor:t.colorWarning,addonColor:t.colorWarningText})),{[`&${t.componentCls}-group-wrapper-disabled`]:{[`${t.componentCls}-group-addon`]:Object.assign({},aQ(t))}})}),Zme=(t,e)=>({"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${t.componentCls}-disabled, &[disabled]`]:{color:t.colorTextDisabled}},e)}),oJe=(t,e)=>({background:e.bg,borderWidth:t.lineWidth,borderStyle:t.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:e==null?void 0:e.inputColor},"&:hover":{background:e.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:e.activeBorderColor,backgroundColor:t.activeBg}}),ixe=(t,e)=>({[`&${t.componentCls}-status-${e.status}:not(${t.componentCls}-disabled)`]:Object.assign(Object.assign({},oJe(t,e)),{[`${t.componentCls}-prefix, ${t.componentCls}-suffix`]:{color:e.affixColor}})}),eye=(t,e)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},oJe(t,{bg:t.colorFillTertiary,hoverBg:t.colorFillSecondary,activeBorderColor:t.colorPrimary})),{[`&${t.componentCls}-disabled, &[disabled]`]:Object.assign({},aQ(t))}),ixe(t,{status:"error",bg:t.colorErrorBg,hoverBg:t.colorErrorBgHover,activeBorderColor:t.colorError,inputColor:t.colorErrorText,affixColor:t.colorError})),ixe(t,{status:"warning",bg:t.colorWarningBg,hoverBg:t.colorWarningBgHover,activeBorderColor:t.colorWarning,inputColor:t.colorWarningText,affixColor:t.colorWarning})),e)}),axe=(t,e)=>({[`&${t.componentCls}-group-wrapper-status-${e.status}`]:{[`${t.componentCls}-group-addon`]:{background:e.addonBg,color:e.addonColor}}}),rJe=t=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${t.componentCls}-group`]:{"&-addon":{background:t.colorFillTertiary},[`${t.componentCls}-filled:not(:focus):not(:focus-within)`]:{"&:not(:first-child)":{borderInlineStart:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},"&:not(:last-child)":{borderInlineEnd:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`}}}},axe(t,{status:"error",addonBg:t.colorErrorBg,addonColor:t.colorErrorText})),axe(t,{status:"warning",addonBg:t.colorWarningBg,addonColor:t.colorWarningText})),{[`&${t.componentCls}-group-wrapper-disabled`]:{[`${t.componentCls}-group`]:{"&-addon":{background:t.colorFillTertiary,color:t.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderTop:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderBottom:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderTop:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderBottom:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`}}}})}),tye=t=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:t,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),iJe=t=>{const{paddingBlockLG:e,lineHeightLG:n,borderRadiusLG:o,paddingInlineLG:r}=t;return{padding:`${Nt(e)} ${Nt(r)}`,fontSize:t.inputFontSizeLG,lineHeight:n,borderRadius:o}},nye=t=>({padding:`${Nt(t.paddingBlockSM)} ${Nt(t.paddingInlineSM)}`,fontSize:t.inputFontSizeSM,borderRadius:t.borderRadiusSM}),JW=t=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Nt(t.paddingBlock)} ${Nt(t.paddingInline)}`,color:t.colorText,fontSize:t.inputFontSize,lineHeight:t.lineHeight,borderRadius:t.borderRadius,transition:`all ${t.motionDurationMid}`},tye(t.colorTextPlaceholder)),{"textarea&":{maxWidth:"100%",height:"auto",minHeight:t.controlHeight,lineHeight:t.lineHeight,verticalAlign:"bottom",transition:`all ${t.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},iJe(t)),"&-sm":Object.assign({},nye(t)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),aJe=t=>{const{componentCls:e,antCls:n}=t;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:t.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${e}, &-lg > ${e}-group-addon`]:Object.assign({},iJe(t)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},nye(t)),[`&-lg ${n}-select-single ${n}-select-selector`]:{height:t.controlHeightLG},[`&-sm ${n}-select-single ${n}-select-selector`]:{height:t.controlHeightSM},[`> ${e}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${e}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${Nt(t.paddingInline)}`,color:t.colorText,fontWeight:"normal",fontSize:t.inputFontSize,textAlign:"center",borderRadius:t.borderRadius,transition:`all ${t.motionDurationSlow}`,lineHeight:1,[`${n}-select`]:{margin:`${Nt(t.calc(t.paddingBlock).add(1).mul(-1).equal())} ${Nt(t.calc(t.paddingInline).mul(-1).equal())}`,[`&${n}-select-single:not(${n}-select-customize-input):not(${n}-pagination-size-changer)`]:{[`${n}-select-selector`]:{backgroundColor:"inherit",border:`${Nt(t.lineWidth)} ${t.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${n}-select-selector`]:{color:t.colorPrimary}}},[`${n}-cascader-picker`]:{margin:`-9px ${Nt(t.calc(t.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${n}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[`${e}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${e}-search-with-button &`]:{zIndex:0}}},[`> ${e}:first-child, ${e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}-affix-wrapper`]:{[`&:not(:first-child) ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}:last-child, ${e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-search &`]:{borderStartStartRadius:t.borderRadius,borderEndStartRadius:t.borderRadius}},[`&:not(:first-child), ${e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${e}-group-compact`]:Object.assign(Object.assign({display:"block"},ek()),{[`${e}-group-addon, ${e}-group-wrap, > ${e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:t.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[` + &${a}-slide-up-leave${a}-slide-up-leave-active${e}-placement-topRight`]:{animationName:Y$}})},Wme(t,y,{arrowPlacement:{top:!0,bottom:!0}}),{[`${e} ${n}`]:{position:"relative",margin:0},[`${n}-submenu-popup`]:{position:"absolute",zIndex:o,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${e}, ${e}-menu-submenu`]:{[n]:Object.assign(Object.assign({padding:d,listStyleType:"none",backgroundColor:y,backgroundClip:"padding-box",borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary},Q6(t)),{"&:empty":{padding:0,boxShadow:"none"},[`${n}-item-group-title`]:{padding:`${Nt(c)} ${Nt(g)}`,color:t.colorTextDescription,transition:`all ${s}`},[`${n}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${n}-item-icon`]:{minWidth:u,marginInlineEnd:t.marginXS,fontSize:t.fontSizeSM},[`${n}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${s}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${n}-item, ${n}-submenu-title`]:Object.assign(Object.assign({clear:"both",margin:0,padding:`${Nt(c)} ${Nt(g)}`,color:t.colorText,fontWeight:"normal",fontSize:u,lineHeight:t.lineHeight,cursor:"pointer",transition:`all ${s}`,borderRadius:t.borderRadiusSM,"&:hover, &-active":{backgroundColor:t.controlItemBgHover}},Q6(t)),{"&-selected":{color:t.colorPrimary,backgroundColor:t.controlItemBgActive,"&:hover, &-active":{backgroundColor:t.controlItemBgActiveHover}},"&-disabled":{color:f,cursor:"not-allowed","&:hover":{color:f,backgroundColor:y,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${Nt(t.marginXXS)} 0`,overflow:"hidden",lineHeight:0,backgroundColor:t.colorSplit},[`${e}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:t.paddingXS,[`${e}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:t.colorTextDescription,fontSize:p,fontStyle:"normal"}}}),[`${n}-item-group-list`]:{margin:`0 ${Nt(t.marginXS)}`,padding:0,listStyle:"none"},[`${n}-submenu-title`]:{paddingInlineEnd:t.calc(g).add(t.fontSizeSM).equal()},[`${n}-submenu-vertical`]:{position:"relative"},[`${n}-submenu${n}-submenu-disabled ${e}-menu-submenu-title`]:{[`&, ${e}-menu-submenu-arrow-icon`]:{color:f,backgroundColor:y,cursor:"not-allowed"}},[`${n}-submenu-selected ${e}-menu-submenu-title`]:{color:t.colorPrimary}})}},[O9(t,"slide-up"),O9(t,"slide-down"),wR(t,"move-up"),wR(t,"move-down"),jW(t,"zoom-big")]]},Ckt=t=>Object.assign(Object.assign({zIndexPopup:t.zIndexPopupBase+50,paddingBlock:(t.controlHeight-t.fontSize*t.lineHeight)/2},K$({contentRadius:t.borderRadiusLG,limitVerticalRadius:!0})),J$(t)),Rkt=wl("Dropdown",t=>{const{marginXXS:e,sizePopupArrow:n,paddingXXS:o,componentCls:r}=t,i=Ki(t,{menuCls:`${r}-menu`,dropdownArrowDistance:t.calc(n).div(2).add(e).equal(),dropdownEdgeChildPadding:o});return[Pkt(i),Tkt(i)]},Ckt),eQ=t=>{const{menu:e,arrow:n,prefixCls:o,children:r,trigger:i,disabled:a,dropdownRender:l,getPopupContainer:s,overlayClassName:c,rootClassName:u,overlayStyle:d,open:f,onOpenChange:p,visible:g,onVisibleChange:y,mouseEnterDelay:w=.15,mouseLeaveDelay:b=.1,autoAdjustOverflow:C=!0,placement:P="",overlay:v,transitionName:T}=t,{getPopupContainer:A,getPrefixCls:x,direction:S,dropdown:R}=m.useContext(Cr);kb();const M=m.useMemo(()=>{const ne=x();return T!==void 0?T:P.includes("top")?`${ne}-slide-down`:`${ne}-slide-up`},[x,P,T]),D=m.useMemo(()=>P?P.includes("Center")?P.slice(0,P.indexOf("Center")):P:S==="rtl"?"bottomRight":"bottomLeft",[P,S]),E=x("dropdown",o),W=O0(E),[j,L,k]=Rkt(E,W),[,N]=_u(),F=m.Children.only(r),U=B0(F,{className:Un(`${E}-trigger`,{[`${E}-rtl`]:S==="rtl"},F.props.className),disabled:a}),O=a?[]:i;let B;O&&O.includes("contextMenu")&&(B=!0);const[_,X]=$6(!1,{value:f??g}),$=q6(ne=>{p==null||p(ne,{source:"trigger"}),y==null||y(ne),X(ne)}),Q=Un(c,u,L,k,W,R==null?void 0:R.className,{[`${E}-rtl`]:S==="rtl"}),le=VGe({arrowPointAtCenter:typeof n=="object"&&n.pointAtCenter,autoAdjustOverflow:C,offset:N.marginXXS,arrowWidth:n?N.sizePopupArrow:0,borderRadius:N.borderRadius}),q=m.useCallback(()=>{e!=null&&e.selectable&&(e!=null&&e.multiple)||(p==null||p(!1,{source:"menu"}),X(!1))},[e==null?void 0:e.selectable,e==null?void 0:e.multiple]),te=()=>{let ne;return e!=null&&e.items?ne=m.createElement(_H,Object.assign({},e)):typeof v=="function"?ne=v():ne=v,l&&(ne=l(ne)),ne=m.Children.only(typeof ne=="string"?m.createElement("span",null,ne):ne),m.createElement(gXe,{prefixCls:`${E}-menu`,rootClassName:Un(k,W),expandIcon:m.createElement("span",{className:`${E}-menu-submenu-arrow`},m.createElement(UG,{className:`${E}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:q,validator:fe=>{}},ne)},[re,ae]=Ww("Dropdown",d==null?void 0:d.zIndex);let se=m.createElement(ZGe,Object.assign({alignPoint:B},up(t,["rootClassName"]),{mouseEnterDelay:w,mouseLeaveDelay:b,visible:_,builtinPlacements:le,arrow:!!n,overlayClassName:Q,prefixCls:E,getPopupContainer:s||A,transitionName:M,trigger:O,overlay:te,placement:D,onVisibleChange:$,overlayStyle:Object.assign(Object.assign(Object.assign({},R==null?void 0:R.style),d),{zIndex:re})}),U);return re&&(se=m.createElement(DW.Provider,{value:ae},se)),j(se)};function Hkt(t){return Object.assign(Object.assign({},t),{align:{overflow:{adjustX:!1,adjustY:!1}}})}const Mkt=YW(eQ,"dropdown",t=>t,Hkt),Ikt=t=>m.createElement(Mkt,Object.assign({},t),m.createElement("span",null));eQ._InternalPanelDoNotUseOrYouWillBeFired=Ikt;var mXe={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Ac,function(){return function(n,o){o.prototype.weekday=function(r){var i=this.$locale().weekStart||0,a=this.$W,l=(a25){var u=a(this).startOf(o).add(1,o).date(c),d=a(this).endOf(n);if(u.isBefore(d))return 1}var f=a(this).startOf(o).date(c).startOf(n).subtract(1,"millisecond"),p=this.diff(f,n,!0);return p<0?a(this).startOf("week").week():Math.ceil(p)},l.weeks=function(s){return s===void 0&&(s=null),this.week(s)}}})})(AXe);var kkt=AXe.exports;const Lkt=Fi(kkt);var wXe={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Ac,function(){return function(n,o){o.prototype.weekYear=function(){var r=this.month(),i=this.week(),a=this.year();return i===1&&r===11?a+1:r===0&&i>=52?a-1:a}}})})(wXe);var Wkt=wXe.exports;const Nkt=Fi(Wkt);var vXe={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Ac,function(){return function(n,o){var r=o.prototype,i=r.format;r.format=function(a){var l=this,s=this.$locale();if(!this.isValid())return i.bind(this)(a);var c=this.$utils(),u=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(d){switch(d){case"Q":return Math.ceil((l.$M+1)/3);case"Do":return s.ordinal(l.$D);case"gggg":return l.weekYear();case"GGGG":return l.isoWeekYear();case"wo":return s.ordinal(l.week(),"W");case"w":case"ww":return c.s(l.week(),d==="w"?1:2,"0");case"W":case"WW":return c.s(l.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return c.s(String(l.$H===0?24:l.$H),d==="k"?1:2,"0");case"X":return Math.floor(l.$d.getTime()/1e3);case"x":return l.$d.getTime();case"z":return"["+l.offsetName()+"]";case"zzz":return"["+l.offsetName("long")+"]";default:return d}});return i.bind(this)(u)}}})})(vXe);var Ukt=vXe.exports;const jkt=Fi(Ukt);var xXe={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Ac,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},o=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},s=function(y){return(y=+y)+(y>68?1900:2e3)},c=function(y){return function(w){this[y]=+w}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=function(w){if(!w||w==="Z")return 0;var b=w.match(/([+-]|\d\d)/g),C=60*b[1]+(+b[2]||0);return C===0?0:b[0]==="+"?-C:C}(y)}],d=function(y){var w=l[y];return w&&(w.indexOf?w:w.s.concat(w.f))},f=function(y,w){var b,C=l.meridiem;if(C){for(var P=1;P<=24;P+=1)if(y.indexOf(C(P,0,w))>-1){b=P>12;break}}else b=y===(w?"pm":"PM");return b},p={A:[a,function(y){this.afternoon=f(y,!1)}],a:[a,function(y){this.afternoon=f(y,!0)}],S:[/\d/,function(y){this.milliseconds=100*+y}],SS:[r,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[i,c("seconds")],ss:[i,c("seconds")],m:[i,c("minutes")],mm:[i,c("minutes")],H:[i,c("hours")],h:[i,c("hours")],HH:[i,c("hours")],hh:[i,c("hours")],D:[i,c("day")],DD:[r,c("day")],Do:[a,function(y){var w=l.ordinal,b=y.match(/\d+/);if(this.day=b[0],w)for(var C=1;C<=31;C+=1)w(C).replace(/\[|\]/g,"")===y&&(this.day=C)}],M:[i,c("month")],MM:[r,c("month")],MMM:[a,function(y){var w=d("months"),b=(d("monthsShort")||w.map(function(C){return C.slice(0,3)})).indexOf(y)+1;if(b<1)throw new Error;this.month=b%12||b}],MMMM:[a,function(y){var w=d("months").indexOf(y)+1;if(w<1)throw new Error;this.month=w%12||w}],Y:[/[+-]?\d+/,c("year")],YY:[r,function(y){this.year=s(y)}],YYYY:[/\d{4}/,c("year")],Z:u,ZZ:u};function g(y){var w,b;w=y,b=l&&l.formats;for(var C=(y=w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(R,M,D){var E=D&&D.toUpperCase();return M||b[D]||n[D]||b[E].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(W,j,L){return j||L.slice(1)})})).match(o),P=C.length,v=0;v-1)return new Date((N==="X"?1e3:1)*k);var U=g(N)(k),O=U.year,B=U.month,_=U.day,X=U.hours,$=U.minutes,Q=U.seconds,le=U.milliseconds,q=U.zone,te=new Date,re=_||(O||B?1:te.getDate()),ae=O||te.getFullYear(),se=0;O&&!B||(se=B>0?B-1:te.getMonth());var ne=X||0,fe=$||0,ge=Q||0,de=le||0;return q?new Date(Date.UTC(ae,se,re,ne,fe,ge,de+60*q.offset*1e3)):F?new Date(Date.UTC(ae,se,re,ne,fe,ge,de)):new Date(ae,se,re,ne,fe,ge,de)}catch{return new Date("")}}(T,S,A),this.init(),E&&E!==!0&&(this.$L=this.locale(E).$L),D&&T!=this.format(S)&&(this.$d=new Date("")),l={}}else if(S instanceof Array)for(var W=S.length,j=1;j<=W;j+=1){x[1]=S[j-1];var L=b.apply(this,x);if(L.isValid()){this.$d=L.$d,this.$L=L.$L,this.init();break}j===W&&(this.$d=new Date(""))}else P.call(this,v)}}})})(xXe);var Bkt=xXe.exports;const Ykt=Fi(Bkt);yc.extend(Ykt);yc.extend(jkt);yc.extend(Dkt);yc.extend(Fkt);yc.extend(Lkt);yc.extend(Nkt);yc.extend(function(t,e){var n=e.prototype,o=n.format;n.format=function(i){var a=(i||"").replace("Wo","wo");return o.bind(this)(a)}});var Okt={bn_BD:"bn-bd",by_BY:"be",en_GB:"en-gb",en_US:"en",fr_BE:"fr",fr_CA:"fr-ca",hy_AM:"hy-am",kmr_IQ:"ku",nl_BE:"nl-be",pt_BR:"pt-br",zh_CN:"zh-cn",zh_HK:"zh-hk",zh_TW:"zh-tw"},V7=function(e){var n=Okt[e];return n||e.split("_")[0]},Zve=function(){MOe(!1,"Not match any format. Please help to fire a issue about this.")},_kt={getNow:function(){return yc()},getFixedDate:function(e){return yc(e,["YYYY-M-DD","YYYY-MM-DD"])},getEndDate:function(e){return e.endOf("month")},getWeekDay:function(e){var n=e.locale("en");return n.weekday()+n.localeData().firstDayOfWeek()},getYear:function(e){return e.year()},getMonth:function(e){return e.month()},getDate:function(e){return e.date()},getHour:function(e){return e.hour()},getMinute:function(e){return e.minute()},getSecond:function(e){return e.second()},getMillisecond:function(e){return e.millisecond()},addYear:function(e,n){return e.add(n,"year")},addMonth:function(e,n){return e.add(n,"month")},addDate:function(e,n){return e.add(n,"day")},setYear:function(e,n){return e.year(n)},setMonth:function(e,n){return e.month(n)},setDate:function(e,n){return e.date(n)},setHour:function(e,n){return e.hour(n)},setMinute:function(e,n){return e.minute(n)},setSecond:function(e,n){return e.second(n)},setMillisecond:function(e,n){return e.millisecond(n)},isAfter:function(e,n){return e.isAfter(n)},isValidate:function(e){return e.isValid()},locale:{getWeekFirstDay:function(e){return yc().locale(V7(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,n){return n.locale(V7(e)).weekday(0)},getWeek:function(e,n){return n.locale(V7(e)).week()},getShortWeekDays:function(e){return yc().locale(V7(e)).localeData().weekdaysMin()},getShortMonths:function(e){return yc().locale(V7(e)).localeData().monthsShort()},format:function(e,n,o){return n.locale(V7(e)).format(o)},parse:function(e,n,o){for(var r=V7(e),i=0;i2&&arguments[2]!==void 0?arguments[2]:"0",o=String(t);o.length2&&arguments[2]!==void 0?arguments[2]:[],o=m.useState([!1,!1]),r=ln(o,2),i=r[0],a=r[1],l=function(u,d){a(function(f){return bE(f,d,u)})},s=m.useMemo(function(){return i.map(function(c,u){if(c)return!0;var d=t[u];return d?!!(!n[u]&&!d||d&&e(d,{activeIndex:u})):!1})},[t,i,e,n]);return[s,l]}function RXe(t,e,n,o,r){var i="",a=[];return t&&a.push(r?"hh":"HH"),e&&a.push("mm"),n&&a.push("ss"),i=a.join(":"),o&&(i+=".SSS"),r&&(i+=" A"),i}function Gkt(t,e,n,o,r,i){var a=t.fieldDateTimeFormat,l=t.fieldDateFormat,s=t.fieldTimeFormat,c=t.fieldMonthFormat,u=t.fieldYearFormat,d=t.fieldWeekFormat,f=t.fieldQuarterFormat,p=t.yearFormat,g=t.cellYearFormat,y=t.cellQuarterFormat,w=t.dayFormat,b=t.cellDateFormat,C=RXe(e,n,o,r,i);return qt(qt({},t),{},{fieldDateTimeFormat:a||"YYYY-MM-DD ".concat(C),fieldDateFormat:l||"YYYY-MM-DD",fieldTimeFormat:s||C,fieldMonthFormat:c||"YYYY-MM",fieldYearFormat:u||"YYYY",fieldWeekFormat:d||"gggg-wo",fieldQuarterFormat:f||"YYYY-[Q]Q",yearFormat:p||"YYYY",cellYearFormat:g||"YYYY",cellQuarterFormat:y||"[Q]Q",cellDateFormat:b||w||"D"})}function HXe(t,e){var n=e.showHour,o=e.showMinute,r=e.showSecond,i=e.showMillisecond,a=e.use12Hours;return be.useMemo(function(){return Gkt(t,n,o,r,i,a)},[t,n,o,r,i,a])}function Lz(t,e,n){return n??e.some(function(o){return t.includes(o)})}var Xkt=["showNow","showHour","showMinute","showSecond","showMillisecond","use12Hours","hourStep","minuteStep","secondStep","millisecondStep","hideDisabledOptions","defaultValue","disabledHours","disabledMinutes","disabledSeconds","disabledMilliseconds","disabledTime","changeOnScroll","defaultOpenValue"];function Jkt(t){var e=tQ(t,Xkt),n=t.format,o=t.picker,r=null;return n&&(r=n,Array.isArray(r)&&(r=r[0]),r=hi(r)==="object"?r.format:r),o==="time"&&(e.format=r),[e,r]}function Kkt(t){return t&&typeof t=="string"}function MXe(t,e,n,o){return[t,e,n,o].some(function(r){return r!==void 0})}function IXe(t,e,n,o,r){var i=e,a=n,l=o;if(!t&&!i&&!a&&!l&&!r)i=!0,a=!0,l=!0;else if(t){var s,c,u,d=[i,a,l].some(function(g){return g===!1}),f=[i,a,l].some(function(g){return g===!0}),p=d?!0:!f;i=(s=i)!==null&&s!==void 0?s:p,a=(c=a)!==null&&c!==void 0?c:p,l=(u=l)!==null&&u!==void 0?u:p}return[i,a,l,r]}function zXe(t){var e=t.showTime,n=Jkt(t),o=ln(n,2),r=o[0],i=o[1],a=e&&hi(e)==="object"?e:{},l=qt(qt({defaultOpenValue:a.defaultOpenValue||a.defaultValue},r),a),s=l.showMillisecond,c=l.showHour,u=l.showMinute,d=l.showSecond,f=MXe(c,u,d,s),p=IXe(f,c,u,d,s),g=ln(p,3);return c=g[0],u=g[1],d=g[2],[l,qt(qt({},l),{},{showHour:c,showMinute:u,showSecond:d,showMillisecond:s}),l.format,i]}function DXe(t,e,n,o,r){var i=t==="time";if(t==="datetime"||i){for(var a=o,l=SXe(t,r,null),s=l,c=[e,n],u=0;u1&&(a=e.addDate(a,-7)),a}function Lu(t,e){var n=e.generateConfig,o=e.locale,r=e.format;return t?typeof r=="function"?r(t):n.locale.format(o.locale,t,r):""}function OG(t,e,n){var o=e,r=["getHour","getMinute","getSecond","getMillisecond"],i=["setHour","setMinute","setSecond","setMillisecond"];return i.forEach(function(a,l){n?o=t[a](o,t[r[l]](n)):o=t[a](o,0)}),o}function Zkt(t,e,n,o,r){var i=Ea(function(a,l){return!!(n&&n(a,l)||o&&t.isAfter(o,a)&&!fh(t,e,o,a,l.type)||r&&t.isAfter(a,r)&&!fh(t,e,r,a,l.type))});return i}function eLt(t,e,n){return m.useMemo(function(){var o=SXe(t,e,n),r=Wb(o),i=r[0],a=hi(i)==="object"&&i.type==="mask"?i.format:null;return[r.map(function(l){return typeof l=="string"||typeof l=="function"?l:l.format}),a]},[t,e,n])}function tLt(t,e,n){return typeof t[0]=="function"||n?!0:e}function nLt(t,e,n,o){var r=Ea(function(i,a){var l=qt({type:e},a);if(delete l.activeIndex,!t.isValidate(i)||n&&n(i,l))return!0;if((e==="date"||e==="time")&&o){var s,c=a&&a.activeIndex===1?"end":"start",u=((s=o.disabledTime)===null||s===void 0?void 0:s.call(o,i,c,{from:l.from}))||{},d=u.disabledHours,f=u.disabledMinutes,p=u.disabledSeconds,g=u.disabledMilliseconds,y=o.disabledHours,w=o.disabledMinutes,b=o.disabledSeconds,C=d||y,P=f||w,v=p||b,T=t.getHour(i),A=t.getMinute(i),x=t.getSecond(i),S=t.getMillisecond(i);if(C&&C().includes(T)||P&&P(T).includes(A)||v&&v(T,A).includes(x)||g&&g(T,A,x).includes(S))return!0}return!1});return r}function zY(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=m.useMemo(function(){var o=t&&Wb(t);return e&&o&&(o[1]=o[1]||o[0]),o},[t,e]);return n}function kXe(t,e){var n=t.generateConfig,o=t.locale,r=t.picker,i=r===void 0?"date":r,a=t.prefixCls,l=a===void 0?"rc-picker":a,s=t.styles,c=s===void 0?{}:s,u=t.classNames,d=u===void 0?{}:u,f=t.order,p=f===void 0?!0:f,g=t.components,y=g===void 0?{}:g,w=t.inputRender,b=t.allowClear,C=t.clearIcon,P=t.needConfirm,v=t.multiple,T=t.format,A=t.inputReadOnly,x=t.disabledDate,S=t.minDate,R=t.maxDate,M=t.showTime,D=t.value,E=t.defaultValue,W=t.pickerValue,j=t.defaultPickerValue,L=zY(D),k=zY(E),N=zY(W),F=zY(j),U=i==="date"&&M?"datetime":i,O=U==="time"||U==="datetime",B=O||v,_=P??O,X=zXe(t),$=ln(X,4),Q=$[0],le=$[1],q=$[2],te=$[3],re=HXe(o,le),ae=m.useMemo(function(){return DXe(U,q,te,Q,re)},[U,q,te,Q,re]),se=m.useMemo(function(){return qt(qt({},t),{},{prefixCls:l,locale:re,picker:i,styles:c,classNames:d,order:p,components:qt({input:w},y),clearIcon:qkt(l,b,C),showTime:ae,value:L,defaultValue:k,pickerValue:N,defaultPickerValue:F},e==null?void 0:e())},[t]),ne=eLt(U,re,T),fe=ln(ne,2),ge=fe[0],de=fe[1],Z=tLt(ge,A,v),he=Zkt(n,o,x,S,R),xe=nLt(n,i,he,ae),He=m.useMemo(function(){return qt(qt({},se),{},{needConfirm:_,inputReadOnly:Z,disabledDate:he})},[se,_,Z,he]);return[He,U,B,ge,de,xe]}function oLt(t,e,n){var o=zs(e,{value:t}),r=ln(o,2),i=r[0],a=r[1],l=be.useRef(t),s=be.useRef(),c=function(){Fa.cancel(s.current)},u=Ea(function(){a(l.current),n&&i!==l.current&&n(l.current)}),d=Ea(function(f,p){c(),l.current=f,f||p?u():s.current=Fa(u)});return be.useEffect(function(){return c},[]),[i,d]}function LXe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],o=arguments.length>3?arguments[3]:void 0,r=n.every(function(u){return u})?!1:t,i=oLt(r,e||!1,o),a=ln(i,2),l=a[0],s=a[1];function c(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(!d.inherit||l)&&s(u,d.force)}return[l,c]}function WXe(t){var e=m.useRef();return m.useImperativeHandle(t,function(){var n;return{nativeElement:(n=e.current)===null||n===void 0?void 0:n.nativeElement,focus:function(r){var i;(i=e.current)===null||i===void 0||i.focus(r)},blur:function(){var r;(r=e.current)===null||r===void 0||r.blur()}}}),e}function NXe(t,e){return m.useMemo(function(){return t||(e?(j0(!1,"`ranges` is deprecated. Please use `presets` instead."),Object.entries(e).map(function(n){var o=ln(n,2),r=o[0],i=o[1];return{label:r,value:i}})):[])},[t,e])}function qme(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,o=m.useRef(e);o.current=e,fx(function(){if(t)o.current(t);else{var r=Fa(function(){o.current(t)},n);return function(){Fa.cancel(r)}}},[t])}function UXe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=m.useState(0),o=ln(n,2),r=o[0],i=o[1],a=m.useState(!1),l=ln(a,2),s=l[0],c=l[1],u=m.useRef([]),d=m.useRef(null),f=function(w){c(w)},p=function(w){return w&&(d.current=w),d.current},g=function(w){var b=u.current,C=new Set(b.filter(function(v){return w[v]||e[v]})),P=b[b.length-1]===0?1:0;return C.size>=2||t[P]?null:P};return qme(s,function(){s||(u.current=[])}),m.useEffect(function(){s&&u.current.push(r)},[s,r]),[s,f,p,r,i,g,u.current]}function rLt(t,e,n,o,r,i){var a=n[n.length-1],l=function(c,u){var d=ln(t,2),f=d[0],p=d[1],g=qt(qt({},u),{},{from:TXe(t,n)});return a===1&&e[0]&&f&&!fh(o,r,f,c,g.type)&&o.isAfter(f,c)||a===0&&e[1]&&p&&!fh(o,r,p,c,g.type)&&o.isAfter(c,p)?!0:i==null?void 0:i(c,g)};return l}function ID(t,e,n,o){switch(e){case"date":case"week":return t.addMonth(n,o);case"month":case"quarter":return t.addYear(n,o);case"year":return t.addYear(n,o*10);case"decade":return t.addYear(n,o*100);default:return n}}var aie=[];function jXe(t,e,n,o,r,i,a,l){var s=arguments.length>8&&arguments[8]!==void 0?arguments[8]:aie,c=arguments.length>9&&arguments[9]!==void 0?arguments[9]:aie,u=arguments.length>10&&arguments[10]!==void 0?arguments[10]:aie,d=arguments.length>11?arguments[11]:void 0,f=arguments.length>12?arguments[12]:void 0,p=arguments.length>13?arguments[13]:void 0,g=a==="time",y=i||0,w=function(N){var F=t.getNow();return g&&(F=OG(t,F)),s[N]||n[N]||F},b=ln(c,2),C=b[0],P=b[1],v=zs(function(){return w(0)},{value:C}),T=ln(v,2),A=T[0],x=T[1],S=zs(function(){return w(1)},{value:P}),R=ln(S,2),M=R[0],D=R[1],E=m.useMemo(function(){var k=[A,M][y];return g?k:OG(t,k,u[y])},[g,A,M,y,t,u]),W=function(N){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"panel",U=[x,D][y];U(N);var O=[A,M];O[y]=N,d&&(!fh(t,e,A,O[0],a)||!fh(t,e,M,O[1],a))&&d(O,{source:F,range:y===1?"end":"start",mode:o})},j=function(N,F){if(l){var U={date:"month",week:"month",month:"year",quarter:"year"},O=U[a];if(O&&!fh(t,e,N,F,O))return ID(t,a,F,-1);if(a==="year"){var B=Math.floor(t.getYear(N)/10),_=Math.floor(t.getYear(F)/10);if(B!==_)return ID(t,a,F,-1)}}return F},L=m.useRef(null);return Xa(function(){if(r&&!s[y]){var k=g?null:t.getNow();if(L.current!==null&&L.current!==y?k=[A,M][y^1]:n[y]?k=y===0?n[0]:j(n[0],n[1]):n[y^1]&&(k=n[y^1]),k){f&&t.isAfter(f,k)&&(k=f);var N=l?ID(t,a,k,1):k;p&&t.isAfter(N,p)&&(k=l?ID(t,a,p,-1):p),W(k,"reset")}}},[r,y,n[y]]),m.useEffect(function(){r?L.current=y:L.current=null},[r,y]),Xa(function(){r&&s&&s[y]&&W(s[y],"reset")},[r,y]),[E,W]}function BXe(t,e){var n=m.useRef(t),o=m.useState({}),r=ln(o,2),i=r[1],a=function(c){return c&&e!==void 0?e:n.current},l=function(c){n.current=c,i({})};return[a,l,a(!0)]}var iLt=[];function YXe(t,e,n){var o=function(a){return a.map(function(l){return Lu(l,{generateConfig:t,locale:e,format:n[0]})})},r=function(a,l){for(var s=Math.max(a.length,l.length),c=-1,u=0;u2&&arguments[2]!==void 0?arguments[2]:1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:2,a=[],l=n>=1?n|0:1,s=t;s<=e;s+=l){var c=r.includes(s);(!c||!o)&&a.push({label:Gme(s,i),value:s,disabled:c})}return a}function $me(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=e||{},r=o.use12Hours,i=o.hourStep,a=i===void 0?1:i,l=o.minuteStep,s=l===void 0?1:l,c=o.secondStep,u=c===void 0?1:c,d=o.millisecondStep,f=d===void 0?100:d,p=o.hideDisabledOptions,g=o.disabledTime,y=o.disabledHours,w=o.disabledMinutes,b=o.disabledSeconds,C=m.useMemo(function(){return n||t.getNow()},[n,t]),P=m.useCallback(function(F){var U=(g==null?void 0:g(F))||{};return[U.disabledHours||y||DY,U.disabledMinutes||w||DY,U.disabledSeconds||b||DY,U.disabledMilliseconds||DY]},[g,y,w,b]),v=m.useMemo(function(){return P(C)},[C,P]),T=ln(v,4),A=T[0],x=T[1],S=T[2],R=T[3],M=m.useCallback(function(F,U,O,B){var _=EY(0,23,a,p,F()),X=r?_.map(function(q){return qt(qt({},q),{},{label:Gme(q.value%12||12,2)})}):_,$=function(te){return EY(0,59,s,p,U(te))},Q=function(te,re){return EY(0,59,u,p,O(te,re))},le=function(te,re,ae){return EY(0,999,f,p,B(te,re,ae),3)};return[X,$,Q,le]},[p,a,r,f,s,u]),D=m.useMemo(function(){return M(A,x,S,R)},[M,A,x,S,R]),E=ln(D,4),W=E[0],j=E[1],L=E[2],k=E[3],N=function(U,O){var B=function(){return W},_=j,X=L,$=k;if(O){var Q=P(O),le=ln(Q,4),q=le[0],te=le[1],re=le[2],ae=le[3],se=M(q,te,re,ae),ne=ln(se,4),fe=ne[0],ge=ne[1],de=ne[2],Z=ne[3];B=function(){return fe},_=ge,X=de,$=Z}var he=lLt(U,B,_,X,$,t);return he};return[N,W,j,L,k]}function sLt(t){var e=t.mode,n=t.internalMode,o=t.renderExtraFooter,r=t.showNow,i=t.showTime,a=t.onSubmit,l=t.onNow,s=t.invalid,c=t.needConfirm,u=t.generateConfig,d=t.disabledDate,f=m.useContext(r5),p=f.prefixCls,g=f.locale,y=f.button,w=y===void 0?"button":y,b=u.getNow(),C=$me(u,i,b),P=ln(C,1),v=P[0],T=o==null?void 0:o(e),A=d(b,{type:e}),x=function(){if(!A){var j=v(b);l(j)}},S="".concat(p,"-now"),R="".concat(S,"-btn"),M=r&&m.createElement("li",{className:S},m.createElement("a",{className:Vn(R,A&&"".concat(R,"-disabled")),"aria-disabled":A,onClick:x},n==="date"?g.today:g.now)),D=c&&m.createElement("li",{className:"".concat(p,"-ok")},m.createElement(w,{disabled:s,onClick:a},g.ok)),E=(M||D)&&m.createElement("ul",{className:"".concat(p,"-ranges")},M,D);return!T&&!E?null:m.createElement("div",{className:"".concat(p,"-footer")},T&&m.createElement("div",{className:"".concat(p,"-footer-extra")},T),E)}function XXe(t,e,n){function o(r,i){var a=r.findIndex(function(s){return fh(t,e,s,i,n)});if(a===-1)return[].concat(Lo(r),[i]);var l=Lo(r);return l.splice(a,1),l}return o}var Nb=m.createContext(null);function oQ(){return m.useContext(Nb)}function VH(t,e){var n=t.prefixCls,o=t.generateConfig,r=t.locale,i=t.disabledDate,a=t.minDate,l=t.maxDate,s=t.cellRender,c=t.hoverValue,u=t.hoverRangeValue,d=t.onHover,f=t.values,p=t.pickerValue,g=t.onSelect,y=t.prevIcon,w=t.nextIcon,b=t.superPrevIcon,C=t.superNextIcon,P=o.getNow(),v={now:P,values:f,pickerValue:p,prefixCls:n,disabledDate:i,minDate:a,maxDate:l,cellRender:s,hoverValue:c,hoverRangeValue:u,onHover:d,locale:r,generateConfig:o,onSelect:g,panelType:e,prevIcon:y,nextIcon:w,superPrevIcon:b,superNextIcon:C};return[v,P]}var j8=m.createContext({});function GW(t){for(var e=t.rowNum,n=t.colNum,o=t.baseDate,r=t.getCellDate,i=t.prefixColumn,a=t.rowClassName,l=t.titleFormat,s=t.getCellText,c=t.getCellClassName,u=t.headerCells,d=t.cellSelection,f=d===void 0?!0:d,p=t.disabledDate,g=oQ(),y=g.prefixCls,w=g.panelType,b=g.now,C=g.disabledDate,P=g.cellRender,v=g.onHover,T=g.hoverValue,A=g.hoverRangeValue,x=g.generateConfig,S=g.values,R=g.locale,M=g.onSelect,D=p||C,E="".concat(y,"-cell"),W=m.useContext(j8),j=W.onCellDblClick,L=function(X){return S.some(function($){return $&&fh(x,R,X,$,w)})},k=[],N=0;N1&&arguments[1]!==void 0?arguments[1]:!1;Ie(Ke),w==null||w(Ke),Ne&&ye(Ke)},pe=function(Ke,Ne){re(Ke),Ne&&ce(Ne),ye(Ne,Ke)},ve=function(Ke){if(xe(Ke),ce(Ke),te!==v){var Ne=["decade","year"],De=[].concat(Ne,["month"]),ke={quarter:[].concat(Ne,["quarter"]),week:[].concat(Lo(De),["week"]),date:[].concat(Lo(De),["date"])},Ye=ke[v]||De,it=Ye.indexOf(te),Ve=Ye[it+1];Ve&&pe(Ve,Ke)}},Ae=m.useMemo(function(){var We,Ke;if(Array.isArray(x)){var Ne=ln(x,2);We=Ne[0],Ke=Ne[1]}else We=x;return!We&&!Ke?null:(We=We||Ke,Ke=Ke||We,r.isAfter(We,Ke)?[Ke,We]:[We,Ke])},[x,r]),Te=Xme(S,R,M),Me=E[ae]||wLt[ae]||rQ,Pe=m.useContext(j8),Ee=m.useMemo(function(){return qt(qt({},Pe),{},{hideHeader:W})},[Pe,W]),Be="".concat(j,"-panel"),Je=tQ(t,["showWeek","prevIcon","nextIcon","superPrevIcon","superNextIcon","disabledDate","minDate","maxDate","onHover"]);return m.createElement(j8.Provider,{value:Ee},m.createElement("div",{ref:L,tabIndex:s,className:Vn(Be,Vt({},"".concat(Be,"-rtl"),i==="rtl"))},m.createElement(Me,ho({},Je,{showTime:$,prefixCls:j,locale:_,generateConfig:r,onModeChange:pe,pickerValue:ze,onPickerValueChange:function(Ke){ce(Ke,!0)},value:Z[0],onSelect:ve,values:Z,cellRender:Te,hoverRangeValue:Ae,hoverValue:A}))))}var lie=m.memo(m.forwardRef(vLt));function xLt(t){var e=t.picker,n=t.multiplePanel,o=t.pickerValue,r=t.onPickerValueChange,i=t.needConfirm,a=t.onSubmit,l=t.range,s=t.hoverValue,c=m.useContext(r5),u=c.prefixCls,d=c.generateConfig,f=m.useCallback(function(C,P){return ID(d,e,C,P)},[d,e]),p=m.useMemo(function(){return f(o,1)},[o,f]),g=function(P){r(f(P,-1))},y={onCellDblClick:function(){i&&a()}},w=e==="time",b=qt(qt({},t),{},{hoverValue:null,hoverRangeValue:null,hideHeader:w});return l?b.hoverRangeValue=s:b.hoverValue=s,n?m.createElement("div",{className:"".concat(u,"-panels")},m.createElement(j8.Provider,{value:qt(qt({},y),{},{hideNext:!0})},m.createElement(lie,b)),m.createElement(j8.Provider,{value:qt(qt({},y),{},{hidePrev:!0})},m.createElement(lie,ho({},b,{pickerValue:p,onPickerValueChange:g})))):m.createElement(j8.Provider,{value:qt({},y)},m.createElement(lie,b))}function txe(t){return typeof t=="function"?t():t}function bLt(t){var e=t.prefixCls,n=t.presets,o=t.onClick,r=t.onHover;return n.length?m.createElement("div",{className:"".concat(e,"-presets")},m.createElement("ul",null,n.map(function(i,a){var l=i.label,s=i.value;return m.createElement("li",{key:a,onClick:function(){o(txe(s))},onMouseEnter:function(){r(txe(s))},onMouseLeave:function(){r(null)}},l)}))):null}function KXe(t){var e=t.panelRender,n=t.internalMode,o=t.picker,r=t.showNow,i=t.range,a=t.multiple,l=t.activeOffset,s=l===void 0?0:l,c=t.presets,u=t.onPresetHover,d=t.onPresetSubmit,f=t.onFocus,p=t.onBlur,g=t.direction,y=t.value,w=t.onSelect,b=t.isInvalid,C=t.defaultOpenValue,P=t.onOk,v=t.onSubmit,T=m.useContext(r5),A=T.prefixCls,x="".concat(A,"-panel"),S=g==="rtl",R=m.useRef(null),M=m.useRef(null),D=m.useState(0),E=ln(D,2),W=E[0],j=E[1],L=m.useState(0),k=ln(L,2),N=k[0],F=k[1],U=function(fe){fe.offsetWidth&&j(fe.offsetWidth)};m.useEffect(function(){if(i){var ne,fe=((ne=R.current)===null||ne===void 0?void 0:ne.offsetWidth)||0,ge=W-fe;s<=ge?F(0):F(s+fe-W)}},[W,s,i]);function O(ne){return ne.filter(function(fe){return fe})}var B=m.useMemo(function(){return O(Wb(y))},[y]),_=o==="time"&&!B.length,X=m.useMemo(function(){return _?O([C]):B},[_,B,C]),$=_?C:B,Q=m.useMemo(function(){return X.length?X.some(function(ne){return b(ne)}):!0},[X,b]),le=function(){_&&w(C),P(),v()},q=m.createElement("div",{className:"".concat(A,"-panel-layout")},m.createElement(bLt,{prefixCls:A,presets:c,onClick:d,onHover:u}),m.createElement("div",null,m.createElement(xLt,ho({},t,{value:$})),m.createElement(sLt,ho({},t,{showNow:a?!1:r,invalid:Q,onSubmit:le}))));e&&(q=e(q));var te="".concat(x,"-container"),re="marginLeft",ae="marginRight",se=m.createElement("div",{tabIndex:-1,className:Vn(te,"".concat(A,"-").concat(n,"-panel-container")),style:Vt(Vt({},S?ae:re,N),S?re:ae,"auto"),onFocus:f,onBlur:p},q);return i&&(se=m.createElement("div",{ref:M,className:Vn("".concat(A,"-range-wrapper"),"".concat(A,"-").concat(o,"-range-wrapper"))},m.createElement("div",{ref:R,className:"".concat(A,"-range-arrow"),style:Vt({},S?"right":"left",s)}),m.createElement(Td,{onResize:U},se))),se}function qXe(t,e){var n=t.format,o=t.maskFormat,r=t.generateConfig,i=t.locale,a=t.preserveInvalidOnBlur,l=t.inputReadOnly,s=t.required,c=t["aria-required"],u=t.onSubmit,d=t.onFocus,f=t.onBlur,p=t.onInputChange,g=t.onInvalid,y=t.open,w=t.onOpenChange,b=t.onKeyDown,C=t.onChange,P=t.activeHelp,v=t.name,T=t.autoComplete,A=t.id,x=t.value,S=t.invalid,R=t.placeholder,M=t.disabled,D=t.activeIndex,E=t.allHelp,W=t.picker,j=function(_,X){var $=r.locale.parse(i.locale,_,[X]);return $&&r.isValidate($)?$:null},L=n[0],k=m.useCallback(function(B){return Lu(B,{locale:i,format:L,generateConfig:r})},[i,r,L]),N=m.useMemo(function(){return x.map(k)},[x,k]),F=m.useMemo(function(){var B=W==="time"?8:10,_=typeof L=="function"?L(r.getNow()).length:L.length;return Math.max(B,_)+2},[L,W,r]),U=function(_){for(var X=0;X=l&&n<=s)return i;var c=Math.min(Math.abs(n-l),Math.abs(n-s));c0?ot:st));var St=Ze+Xe,Pt=st-ot+1;return String(ot+(Pt+St-ot)%Pt)};switch(Ke){case"Backspace":case"Delete":Ne="",De=Ye;break;case"ArrowLeft":Ne="",it(-1);break;case"ArrowRight":Ne="",it(1);break;case"ArrowUp":Ne="",De=Ve(1);break;case"ArrowDown":Ne="",De=Ve(-1);break;default:isNaN(Number(Ke))||(Ne=B+Ke,De=Ne);break}if(Ne!==null&&(_(Ne),Ne.length>=ke&&(it(1),_(""))),De!==null){var yt=se.slice(0,he)+Gme(De,ke)+se.slice(xe);Se(yt.slice(0,a.length))}ae({})},Ee=m.useRef();Xa(function(){if(!(!W||!a||ye.current)){if(!ge.match(se)){Se(a);return}return fe.current.setSelectionRange(he,xe),Ee.current=Fa(function(){fe.current.setSelectionRange(he,xe)}),function(){Fa.cancel(Ee.current)}}},[ge,a,W,se,Q,he,xe,re,Se]);var Be=a?{onFocus:ve,onBlur:Te,onKeyDown:Pe,onMouseDown:ce,onMouseUp:pe,onPaste:Ie}:{};return m.createElement("div",{ref:ne,className:Vn(M,Vt(Vt({},"".concat(M,"-active"),n&&r),"".concat(M,"-placeholder"),c))},m.createElement(R,ho({ref:fe,"aria-invalid":y,autoComplete:"off"},b,{onKeyDown:Me,onBlur:Ae},Be,{value:se,onChange:ze})),m.createElement(iQ,{type:"suffix",icon:i}),w)}),MLt=["id","clearIcon","suffixIcon","separator","activeIndex","activeHelp","allHelp","focused","onFocus","onBlur","onKeyDown","locale","generateConfig","placeholder","className","style","onClick","onClear","value","onChange","onSubmit","onInputChange","format","maskFormat","preserveInvalidOnBlur","onInvalid","disabled","invalid","inputReadOnly","direction","onOpenChange","onActiveOffset","onMouseDown","required","aria-required","autoFocus"],ILt=["index"];function zLt(t,e){var n=t.id,o=t.clearIcon,r=t.suffixIcon,i=t.separator,a=i===void 0?"~":i,l=t.activeIndex;t.activeHelp,t.allHelp;var s=t.focused;t.onFocus,t.onBlur,t.onKeyDown,t.locale,t.generateConfig;var c=t.placeholder,u=t.className,d=t.style,f=t.onClick,p=t.onClear,g=t.value;t.onChange,t.onSubmit,t.onInputChange,t.format,t.maskFormat,t.preserveInvalidOnBlur,t.onInvalid;var y=t.disabled,w=t.invalid;t.inputReadOnly;var b=t.direction;t.onOpenChange;var C=t.onActiveOffset,P=t.onMouseDown;t.required,t["aria-required"];var v=t.autoFocus,T=ii(t,MLt),A=b==="rtl",x=m.useContext(r5),S=x.prefixCls,R=m.useMemo(function(){if(typeof n=="string")return[n];var te=n||{};return[te.start,te.end]},[n]),M=m.useRef(),D=m.useRef(),E=m.useRef(),W=function(re){var ae;return(ae=[D,E][re])===null||ae===void 0?void 0:ae.current};m.useImperativeHandle(e,function(){return{nativeElement:M.current,focus:function(re){if(hi(re)==="object"){var ae,se=re||{},ne=se.index,fe=ne===void 0?0:ne,ge=ii(se,ILt);(ae=W(fe))===null||ae===void 0||ae.focus(ge)}else{var de;(de=W(re??0))===null||de===void 0||de.focus()}},blur:function(){var re,ae;(re=W(0))===null||re===void 0||re.blur(),(ae=W(1))===null||ae===void 0||ae.blur()}}});var j=$Xe(T),L=m.useMemo(function(){return Array.isArray(c)?c:[c,c]},[c]),k=qXe(qt(qt({},t),{},{id:R,placeholder:L})),N=ln(k,1),F=N[0],U=A?"right":"left",O=m.useState(Vt({position:"absolute",width:0},U,0)),B=ln(O,2),_=B[0],X=B[1],$=Ea(function(){var te=W(l);if(te){var re=te.nativeElement,ae=re.offsetWidth,se=re.offsetLeft,ne=re.offsetParent,fe=se;if(A){var ge=ne,de=getComputedStyle(ge);fe=ge.offsetWidth-parseFloat(de.borderRightWidth)-parseFloat(de.borderLeftWidth)-se-ae}X(function(Z){return qt(qt({},Z),{},Vt({width:ae},U,fe))}),C(l===0?0:fe)}});m.useEffect(function(){$()},[l]);var Q=o&&(g[0]&&!y[0]||g[1]&&!y[1]),le=v&&!y[0],q=v&&!le&&!y[1];return m.createElement(Td,{onResize:$},m.createElement("div",ho({},j,{className:Vn(S,"".concat(S,"-range"),Vt(Vt(Vt(Vt({},"".concat(S,"-focused"),s),"".concat(S,"-disabled"),y.every(function(te){return te})),"".concat(S,"-invalid"),w.some(function(te){return te})),"".concat(S,"-rtl"),A),u),style:d,ref:M,onClick:f,onMouseDown:function(re){var ae=re.target;ae!==D.current.inputElement&&ae!==E.current.inputElement&&re.preventDefault(),P==null||P(re)}}),m.createElement(cue,ho({ref:D},F(0),{autoFocus:le,"date-range":"start"})),m.createElement("div",{className:"".concat(S,"-range-separator")},a),m.createElement(cue,ho({ref:E},F(1),{autoFocus:q,"date-range":"end"})),m.createElement("div",{className:"".concat(S,"-active-bar"),style:_}),m.createElement(iQ,{type:"suffix",icon:r}),Q&&m.createElement(sue,{icon:o,onClear:p})))}var DLt=m.forwardRef(zLt);function oxe(t,e){var n=t??e;return Array.isArray(n)?n:[n,n]}function kY(t){return t===1?"end":"start"}function ELt(t,e){var n=kXe(t,function(){var eo=t.disabled,Xn=t.allowEmpty,Jo=oxe(eo,!1),xo=oxe(Xn,!1);return{disabled:Jo,allowEmpty:xo}}),o=ln(n,6),r=o[0],i=o[1],a=o[2],l=o[3],s=o[4],c=o[5],u=r.prefixCls,d=r.styles,f=r.classNames,p=r.defaultValue,g=r.value,y=r.needConfirm,w=r.onKeyDown,b=r.disabled,C=r.allowEmpty,P=r.disabledDate,v=r.minDate,T=r.maxDate,A=r.defaultOpen,x=r.open,S=r.onOpenChange,R=r.locale,M=r.generateConfig,D=r.picker,E=r.showNow,W=r.showToday,j=r.showTime,L=r.mode,k=r.onPanelChange,N=r.onCalendarChange,F=r.onOk,U=r.defaultPickerValue,O=r.pickerValue,B=r.onPickerValueChange,_=r.inputReadOnly,X=r.suffixIcon,$=r.onFocus,Q=r.onBlur,le=r.presets,q=r.ranges,te=r.components,re=r.cellRender,ae=r.dateRender,se=r.monthCellRender,ne=r.onClick,fe=WXe(e),ge=LXe(x,A,b,S),de=ln(ge,2),Z=de[0],he=de[1],xe=function(Xn,Jo){(b.some(function(xo){return!xo})||!Xn)&&he(Xn,Jo)},He=_Xe(M,R,l,!0,!1,p,g,N,F),Se=ln(He,5),ze=Se[0],Ie=Se[1],ye=Se[2],ce=Se[3],pe=Se[4],ve=ye(),Ae=UXe(b,C),Te=ln(Ae,7),Me=Te[0],Pe=Te[1],Ee=Te[2],Be=Te[3],Je=Te[4],We=Te[5],Ke=Te[6],Ne=function(Xn,Jo){Pe(!0),$==null||$(Xn,{range:kY(Jo??Be)})},De=function(Xn,Jo){Pe(!1),Q==null||Q(Xn,{range:kY(Jo??Be)})},ke=m.useMemo(function(){if(!j)return null;var eo=j.disabledTime,Xn=eo?function(Jo){var xo=kY(Be),Qo=TXe(ve,Ke,Be);return eo(Jo,xo,{from:Qo})}:void 0;return qt(qt({},j),{},{disabledTime:Xn})},[j,Be,ve,Ke]),Ye=zs([D,D],{value:L}),it=ln(Ye,2),Ve=it[0],yt=it[1],ct=Ve[Be]||D,Xe=ct==="date"&&ke?"datetime":ct,ut=Xe===D&&Xe!=="time",ft=GXe(D,ct,E,W,!0),ot=VXe(r,ze,Ie,ye,ce,b,l,Me,Z,c),st=ln(ot,2),at=st[0],Oe=st[1],Ze=rLt(ve,b,Ke,M,R,P),St=CXe(ve,c,C),Pt=ln(St,2),Rt=Pt[0],Ut=Pt[1],Ht=jXe(M,R,ve,Ve,Z,Be,i,ut,U,O,ke==null?void 0:ke.defaultOpenValue,B,v,T),At=ln(Ht,2),kt=At[0],gt=At[1],dt=Ea(function(eo,Xn,Jo){var xo=bE(Ve,Be,Xn);if((xo[0]!==Ve[0]||xo[1]!==Ve[1])&&yt(xo),k&&Jo!==!1){var Qo=Lo(ve);eo&&(Qo[Be]=eo),k(Qo,xo)}}),Ct=function(Xn,Jo){return bE(ve,Jo,Xn)},tt=function(Xn,Jo){var xo=ve;Xn&&(xo=Ct(Xn,Be));var Qo=We(xo);ce(xo),at(Be,Qo===null),Qo===null?xe(!1,{force:!0}):Jo||fe.current.focus({index:Qo})},Fe=function(Xn){if(!fe.current.nativeElement.contains(document.activeElement)){var Jo=b.findIndex(function(xo){return!xo});Jo>=0&&fe.current.focus({index:Jo})}xe(!0),ne==null||ne(Xn)},qe=function(){Oe(null),xe(!1,{force:!0})},je=m.useState(null),rt=ln(je,2),mt=rt[0],Qe=rt[1],Tt=m.useState(null),Dt=ln(Tt,2),lt=Dt[0],zt=Dt[1],Ft=m.useMemo(function(){return lt||ve},[ve,lt]);m.useEffect(function(){Z||zt(null)},[Z]);var _t=m.useState(0),tn=ln(_t,2),Qt=tn[0],gn=tn[1],an=NXe(le,q),mn=function(Xn){zt(Xn),Qe("preset")},Hn=function(Xn){var Jo=Oe(Xn);Jo&&xe(!1,{force:!0})},Fo=function(Xn){tt(Xn)},yo=function(Xn){zt(Xn?Ct(Xn,Be):null),Qe("cell")},So=function(Xn){xe(!0),Ne(Xn)},$o=function(Xn){Ee("panel");var Jo=bE(ve,Be,Xn);ce(Jo),!y&&!a&&i===Xe&&tt(Xn)},mo=function(){xe(!1)},Jn=Xme(re,ae,se,kY(Be)),uo=ve[Be]||null,ir=Ea(function(eo){return c(eo,{activeIndex:Be})}),Rr=m.useMemo(function(){var eo=Sf(r,!1),Xn=jH(r,[].concat(Lo(Object.keys(eo)),["onChange","onCalendarChange","style","className","onPanelChange","disabledTime"]));return Xn},[r]),br=m.createElement(KXe,ho({},Rr,{showNow:ft,showTime:ke,range:!0,multiplePanel:ut,activeOffset:Qt,disabledDate:Ze,onFocus:So,onBlur:De,picker:D,mode:ct,internalMode:Xe,onPanelChange:dt,format:s,value:uo,isInvalid:ir,onChange:null,onSelect:$o,pickerValue:kt,defaultOpenValue:Wb(j==null?void 0:j.defaultOpenValue)[Be],onPickerValueChange:gt,hoverValue:Ft,onHover:yo,needConfirm:y,onSubmit:tt,onOk:pe,presets:an,onPresetHover:mn,onPresetSubmit:Hn,onNow:Fo,cellRender:Jn})),Vr=function(Xn,Jo){var xo=Ct(Xn,Jo);ce(xo)},Wo=function(){Ee("input")},wn=function(Xn,Jo){Ee("input"),xe(!0,{inherit:!0}),Je(Jo),Ne(Xn,Jo)},In=function(Xn,Jo){xe(!1),De(Xn,Jo)},ar=function(Xn,Jo){Xn.key==="Tab"&&tt(null,!0),w==null||w(Xn,Jo)},No=m.useMemo(function(){return{prefixCls:u,locale:R,generateConfig:M,button:te.button,input:te.input}},[u,R,M,te.button,te.input]);return Xa(function(){Z&&Be!==void 0&&dt(null,D,!1)},[Z,Be,D]),Xa(function(){var eo=Ee();!Z&&eo==="input"&&(xe(!1),tt(null,!0)),!Z&&a&&!y&&eo==="panel"&&(xe(!0),tt())},[Z]),m.createElement(r5.Provider,{value:No},m.createElement(bXe,ho({},PXe(r),{popupElement:br,popupStyle:d.popup,popupClassName:f.popup,visible:Z,onClose:mo,range:!0}),m.createElement(DLt,ho({},r,{ref:fe,suffixIcon:X,activeIndex:Me||Z?Be:null,activeHelp:!!lt,allHelp:!!lt&&mt==="preset",focused:Me,onFocus:wn,onBlur:In,onKeyDown:ar,onSubmit:tt,value:Ft,maskFormat:s,onChange:Vr,onInputChange:Wo,format:l,inputReadOnly:_,disabled:b,open:Z,onOpenChange:xe,onClick:Fe,onClear:qe,invalid:Rt,onInvalid:Ut,onActiveOffset:gn}))))}var FLt=m.forwardRef(ELt);function kLt(t){var e=t.prefixCls,n=t.value,o=t.onRemove,r=t.removeIcon,i=r===void 0?"×":r,a=t.formatDate,l=t.disabled,s=t.maxTagCount,c=t.placeholder,u="".concat(e,"-selector"),d="".concat(e,"-selection"),f="".concat(d,"-overflow");function p(w,b){return m.createElement("span",{className:Vn("".concat(d,"-item")),title:typeof w=="string"?w:null},m.createElement("span",{className:"".concat(d,"-item-content")},w),!l&&b&&m.createElement("span",{onMouseDown:function(P){P.preventDefault()},onClick:b,className:"".concat(d,"-item-remove")},i))}function g(w){var b=a(w),C=function(v){v&&v.stopPropagation(),o(w)};return p(b,C)}function y(w){var b="+ ".concat(w.length," ...");return p(b)}return m.createElement("div",{className:u},m.createElement(k2,{prefixCls:f,data:n,renderItem:g,renderRest:y,itemKey:function(b){return a(b)},maxCount:s}),!n.length&&m.createElement("span",{className:"".concat(e,"-selection-placeholder")},c))}var LLt=["id","open","clearIcon","suffixIcon","activeHelp","allHelp","focused","onFocus","onBlur","onKeyDown","locale","generateConfig","placeholder","className","style","onClick","onClear","internalPicker","value","onChange","onSubmit","onInputChange","multiple","maxTagCount","format","maskFormat","preserveInvalidOnBlur","onInvalid","disabled","invalid","inputReadOnly","direction","onOpenChange","onMouseDown","required","aria-required","autoFocus","removeIcon"];function WLt(t,e){t.id;var n=t.open,o=t.clearIcon,r=t.suffixIcon;t.activeHelp,t.allHelp;var i=t.focused;t.onFocus,t.onBlur,t.onKeyDown;var a=t.locale,l=t.generateConfig,s=t.placeholder,c=t.className,u=t.style,d=t.onClick,f=t.onClear,p=t.internalPicker,g=t.value,y=t.onChange,w=t.onSubmit;t.onInputChange;var b=t.multiple,C=t.maxTagCount;t.format,t.maskFormat,t.preserveInvalidOnBlur,t.onInvalid;var P=t.disabled,v=t.invalid;t.inputReadOnly;var T=t.direction;t.onOpenChange;var A=t.onMouseDown;t.required,t["aria-required"];var x=t.autoFocus,S=t.removeIcon,R=ii(t,LLt),M=T==="rtl",D=m.useContext(r5),E=D.prefixCls,W=m.useRef(),j=m.useRef();m.useImperativeHandle(e,function(){return{nativeElement:W.current,focus:function(Q){var le;(le=j.current)===null||le===void 0||le.focus(Q)},blur:function(){var Q;(Q=j.current)===null||Q===void 0||Q.blur()}}});var L=$Xe(R),k=function(Q){y([Q])},N=function(Q){var le=g.filter(function(q){return q&&!fh(l,a,q,Q,p)});y(le),n||w()},F=qXe(qt(qt({},t),{},{onChange:k}),function($){var Q=$.valueTexts;return{value:Q[0]||"",active:i}}),U=ln(F,2),O=U[0],B=U[1],_=!!(o&&g.length&&!P),X=b?m.createElement(m.Fragment,null,m.createElement(kLt,{prefixCls:E,value:g,onRemove:N,formatDate:B,maxTagCount:C,disabled:P,removeIcon:S,placeholder:s}),m.createElement("input",{className:"".concat(E,"-multiple-input"),value:g.map(B).join(","),ref:j,readOnly:!0,autoFocus:x}),m.createElement(iQ,{type:"suffix",icon:r}),_&&m.createElement(sue,{icon:o,onClear:f})):m.createElement(cue,ho({ref:j},O(),{autoFocus:x,suffixIcon:r,clearIcon:_&&m.createElement(sue,{icon:o,onClear:f}),showActiveCls:!1}));return m.createElement("div",ho({},L,{className:Vn(E,Vt(Vt(Vt(Vt(Vt({},"".concat(E,"-multiple"),b),"".concat(E,"-focused"),i),"".concat(E,"-disabled"),P),"".concat(E,"-invalid"),v),"".concat(E,"-rtl"),M),c),style:u,ref:W,onClick:d,onMouseDown:function(Q){var le,q=Q.target;q!==((le=j.current)===null||le===void 0?void 0:le.inputElement)&&Q.preventDefault(),A==null||A(Q)}}),X)}var NLt=m.forwardRef(WLt);function ULt(t,e){var n=kXe(t),o=ln(n,6),r=o[0],i=o[1],a=o[2],l=o[3],s=o[4],c=o[5],u=r,d=u.prefixCls,f=u.styles,p=u.classNames,g=u.order,y=u.defaultValue,w=u.value,b=u.needConfirm,C=u.onChange,P=u.onKeyDown,v=u.disabled,T=u.disabledDate,A=u.minDate,x=u.maxDate,S=u.defaultOpen,R=u.open,M=u.onOpenChange,D=u.locale,E=u.generateConfig,W=u.picker,j=u.showNow,L=u.showToday,k=u.showTime,N=u.mode,F=u.onPanelChange,U=u.onCalendarChange,O=u.onOk,B=u.multiple,_=u.defaultPickerValue,X=u.pickerValue,$=u.onPickerValueChange,Q=u.inputReadOnly,le=u.suffixIcon,q=u.removeIcon,te=u.onFocus,re=u.onBlur,ae=u.presets,se=u.components,ne=u.cellRender,fe=u.dateRender,ge=u.monthCellRender,de=u.onClick,Z=WXe(e);function he(Wo){return Wo===null?null:B?Wo:Wo[0]}var xe=XXe(E,D,i),He=LXe(R,S,[v],M),Se=ln(He,2),ze=Se[0],Ie=Se[1],ye=function(wn,In,ar){if(U){var No=qt({},ar);delete No.range,U(he(wn),he(In),No)}},ce=function(wn){O==null||O(he(wn))},pe=_Xe(E,D,l,!1,g,y,w,ye,ce),ve=ln(pe,5),Ae=ve[0],Te=ve[1],Me=ve[2],Pe=ve[3],Ee=ve[4],Be=Me(),Je=UXe([v]),We=ln(Je,4),Ke=We[0],Ne=We[1],De=We[2],ke=We[3],Ye=function(wn){Ne(!0),te==null||te(wn,{})},it=function(wn){Ne(!1),re==null||re(wn,{})},Ve=zs(W,{value:N}),yt=ln(Ve,2),ct=yt[0],Xe=yt[1],ut=ct==="date"&&k?"datetime":ct,ft=GXe(W,ct,j,L),ot=C&&function(Wo,wn){C(he(Wo),he(wn))},st=VXe(qt(qt({},r),{},{onChange:ot}),Ae,Te,Me,Pe,[],l,Ke,ze,c),at=ln(st,2),Oe=at[1],Ze=CXe(Be,c),St=ln(Ze,2),Pt=St[0],Rt=St[1],Ut=m.useMemo(function(){return Pt.some(function(Wo){return Wo})},[Pt]),Ht=function(wn,In){if($){var ar=qt(qt({},In),{},{mode:In.mode[0]});delete ar.range,$(wn[0],ar)}},At=jXe(E,D,Be,[ct],ze,ke,i,!1,_,X,Wb(k==null?void 0:k.defaultOpenValue),Ht,A,x),kt=ln(At,2),gt=kt[0],dt=kt[1],Ct=Ea(function(Wo,wn,In){if(Xe(wn),F&&In!==!1){var ar=Wo||Be[Be.length-1];F(ar,wn)}}),tt=function(){Oe(Me()),Ie(!1,{force:!0})},Fe=function(wn){!v&&!Z.current.nativeElement.contains(document.activeElement)&&Z.current.focus(),Ie(!0),de==null||de(wn)},qe=function(){Oe(null),Ie(!1,{force:!0})},je=m.useState(null),rt=ln(je,2),mt=rt[0],Qe=rt[1],Tt=m.useState(null),Dt=ln(Tt,2),lt=Dt[0],zt=Dt[1],Ft=m.useMemo(function(){var Wo=[lt].concat(Lo(Be)).filter(function(wn){return wn});return B?Wo:Wo.slice(0,1)},[Be,lt,B]),_t=m.useMemo(function(){return!B&<?[lt]:Be.filter(function(Wo){return Wo})},[Be,lt,B]);m.useEffect(function(){ze||zt(null)},[ze]);var tn=NXe(ae),Qt=function(wn){zt(wn),Qe("preset")},gn=function(wn){var In=B?xe(Me(),wn):[wn],ar=Oe(In);ar&&!B&&Ie(!1,{force:!0})},an=function(wn){gn(wn)},mn=function(wn){zt(wn),Qe("cell")},Hn=function(wn){Ie(!0),Ye(wn)},Fo=function(wn){De("panel");var In=B?xe(Me(),wn):[wn];Pe(In),!b&&!a&&i===ut&&tt()},yo=function(){Ie(!1)},So=Xme(ne,fe,ge),$o=m.useMemo(function(){var Wo=Sf(r,!1),wn=jH(r,[].concat(Lo(Object.keys(Wo)),["onChange","onCalendarChange","style","className","onPanelChange"]));return qt(qt({},wn),{},{multiple:r.multiple})},[r]),mo=m.createElement(KXe,ho({},$o,{showNow:ft,showTime:k,disabledDate:T,onFocus:Hn,onBlur:it,picker:W,mode:ct,internalMode:ut,onPanelChange:Ct,format:s,value:Be,isInvalid:c,onChange:null,onSelect:Fo,pickerValue:gt,defaultOpenValue:k==null?void 0:k.defaultOpenValue,onPickerValueChange:dt,hoverValue:Ft,onHover:mn,needConfirm:b,onSubmit:tt,onOk:Ee,presets:tn,onPresetHover:Qt,onPresetSubmit:gn,onNow:an,cellRender:So})),Jn=function(wn){Pe(wn)},uo=function(){De("input")},ir=function(wn){De("input"),Ie(!0,{inherit:!0}),Ye(wn)},Rr=function(wn){Ie(!1),it(wn)},br=function(wn,In){wn.key==="Tab"&&tt(),P==null||P(wn,In)},Vr=m.useMemo(function(){return{prefixCls:d,locale:D,generateConfig:E,button:se.button,input:se.input}},[d,D,E,se.button,se.input]);return Xa(function(){ze&&ke!==void 0&&Ct(null,W,!1)},[ze,ke,W]),Xa(function(){var Wo=De();!ze&&Wo==="input"&&(Ie(!1),tt()),!ze&&a&&!b&&Wo==="panel"&&(Ie(!0),tt())},[ze]),m.createElement(r5.Provider,{value:Vr},m.createElement(bXe,ho({},PXe(r),{popupElement:mo,popupStyle:f.popup,popupClassName:p.popup,visible:ze,onClose:yo}),m.createElement(NLt,ho({},r,{ref:Z,suffixIcon:le,removeIcon:q,activeHelp:!!lt,allHelp:!!lt&&mt==="preset",focused:Ke,onFocus:ir,onBlur:Rr,onKeyDown:br,onSubmit:tt,value:_t,maskFormat:s,onChange:Jn,onInputChange:uo,internalPicker:i,format:l,inputReadOnly:Q,disabled:v,open:ze,onOpenChange:Ie,onClick:Fe,onClear:qe,invalid:Ut,onInvalid:function(wn){Rt(wn,0)}}))))}var jLt=m.forwardRef(ULt);const QXe=m.createContext(null),BLt=QXe.Provider,ZXe=m.createContext(null),YLt=ZXe.Provider;var OLt=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],eJe=m.forwardRef(function(t,e){var n=t.prefixCls,o=n===void 0?"rc-checkbox":n,r=t.className,i=t.style,a=t.checked,l=t.disabled,s=t.defaultChecked,c=s===void 0?!1:s,u=t.type,d=u===void 0?"checkbox":u,f=t.title,p=t.onChange,g=ii(t,OLt),y=m.useRef(null),w=zs(c,{value:a}),b=ln(w,2),C=b[0],P=b[1];m.useImperativeHandle(e,function(){return{focus:function(x){var S;(S=y.current)===null||S===void 0||S.focus(x)},blur:function(){var x;(x=y.current)===null||x===void 0||x.blur()},input:y.current}});var v=Vn(o,r,Vt(Vt({},"".concat(o,"-checked"),C),"".concat(o,"-disabled"),l)),T=function(x){l||("checked"in t||P(x.target.checked),p==null||p({target:qt(qt({},t),{},{type:d,checked:x.target.checked}),stopPropagation:function(){x.stopPropagation()},preventDefault:function(){x.preventDefault()},nativeEvent:x.nativeEvent}))};return m.createElement("span",{className:v,title:f,style:i},m.createElement("input",ho({},g,{className:"".concat(o,"-input"),ref:y,onChange:T,disabled:l,checked:!!C,type:d})),m.createElement("span",{className:"".concat(o,"-inner")}))});const _Lt=t=>{const{componentCls:e,antCls:n}=t,o=`${e}-group`;return{[o]:Object.assign(Object.assign({},ja(t)),{display:"inline-block",fontSize:0,[`&${o}-rtl`]:{direction:"rtl"},[`${n}-badge ${n}-badge-count`]:{zIndex:1},[`> ${n}-badge:not(:first-child) > ${n}-button-wrapper`]:{borderInlineStart:"none"}})}},VLt=t=>{const{componentCls:e,wrapperMarginInlineEnd:n,colorPrimary:o,radioSize:r,motionDurationSlow:i,motionDurationMid:a,motionEaseInOutCirc:l,colorBgContainer:s,colorBorder:c,lineWidth:u,colorBgContainerDisabled:d,colorTextDisabled:f,paddingXS:p,dotColorDisabled:g,lineType:y,radioColor:w,radioBgColor:b,calc:C}=t,P=`${e}-inner`,T=C(r).sub(C(4).mul(2)),A=C(1).mul(r).equal();return{[`${e}-wrapper`]:Object.assign(Object.assign({},ja(t)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer",[`&${e}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:t.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${e}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${Nt(u)} ${y} ${o}`,borderRadius:"50%",visibility:"hidden",opacity:0,content:'""'},[e]:Object.assign(Object.assign({},ja(t)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${e}-wrapper:hover &, + &:hover ${P}`]:{borderColor:o},[`${e}-input:focus-visible + ${P}`]:Object.assign({},lw(t)),[`${e}:hover::after, ${e}-wrapper:hover &::after`]:{visibility:"visible"},[`${e}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:A,height:A,marginBlockStart:C(1).mul(r).div(-2).equal(),marginInlineStart:C(1).mul(r).div(-2).equal(),backgroundColor:w,borderBlockStart:0,borderInlineStart:0,borderRadius:A,transform:"scale(0)",opacity:0,transition:`all ${i} ${l}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:A,height:A,backgroundColor:s,borderColor:c,borderStyle:"solid",borderWidth:u,borderRadius:"50%",transition:`all ${a}`},[`${e}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${e}-checked`]:{[P]:{borderColor:o,backgroundColor:b,"&::after":{transform:`scale(${t.calc(t.dotSize).div(r).equal()})`,opacity:1,transition:`all ${i} ${l}`}}},[`${e}-disabled`]:{cursor:"not-allowed",[P]:{backgroundColor:d,borderColor:c,cursor:"not-allowed","&::after":{backgroundColor:g}},[`${e}-input`]:{cursor:"not-allowed"},[`${e}-disabled + span`]:{color:f,cursor:"not-allowed"},[`&${e}-checked`]:{[P]:{"&::after":{transform:`scale(${C(T).div(r).equal({unit:!1})})`}}}},[`span${e} + *`]:{paddingInlineStart:p,paddingInlineEnd:p}})}},GLt=t=>{const{buttonColor:e,controlHeight:n,componentCls:o,lineWidth:r,lineType:i,colorBorder:a,motionDurationSlow:l,motionDurationMid:s,buttonPaddingInline:c,fontSize:u,buttonBg:d,fontSizeLG:f,controlHeightLG:p,controlHeightSM:g,paddingXS:y,borderRadius:w,borderRadiusSM:b,borderRadiusLG:C,buttonCheckedBg:P,buttonSolidCheckedColor:v,colorTextDisabled:T,colorBgContainerDisabled:A,buttonCheckedBgDisabled:x,buttonCheckedColorDisabled:S,colorPrimary:R,colorPrimaryHover:M,colorPrimaryActive:D,buttonSolidCheckedBg:E,buttonSolidCheckedHoverBg:W,buttonSolidCheckedActiveBg:j,calc:L}=t;return{[`${o}-button-wrapper`]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:c,paddingBlock:0,color:e,fontSize:u,lineHeight:Nt(L(n).sub(L(r).mul(2)).equal()),background:d,border:`${Nt(r)} ${i} ${a}`,borderBlockStartWidth:L(r).add(.02).equal(),borderInlineStartWidth:0,borderInlineEndWidth:r,cursor:"pointer",transition:[`color ${s}`,`background ${s}`,`box-shadow ${s}`].join(","),a:{color:e},[`> ${o}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:L(r).mul(-1).equal(),insetInlineStart:L(r).mul(-1).equal(),display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:r,paddingInline:0,backgroundColor:a,transition:`background-color ${l}`,content:'""'}},"&:first-child":{borderInlineStart:`${Nt(r)} ${i} ${a}`,borderStartStartRadius:w,borderEndStartRadius:w},"&:last-child":{borderStartEndRadius:w,borderEndEndRadius:w},"&:first-child:last-child":{borderRadius:w},[`${o}-group-large &`]:{height:p,fontSize:f,lineHeight:Nt(L(p).sub(L(r).mul(2)).equal()),"&:first-child":{borderStartStartRadius:C,borderEndStartRadius:C},"&:last-child":{borderStartEndRadius:C,borderEndEndRadius:C}},[`${o}-group-small &`]:{height:g,paddingInline:L(y).sub(r).equal(),paddingBlock:0,lineHeight:Nt(L(g).sub(L(r).mul(2)).equal()),"&:first-child":{borderStartStartRadius:b,borderEndStartRadius:b},"&:last-child":{borderStartEndRadius:b,borderEndEndRadius:b}},"&:hover":{position:"relative",color:R},"&:has(:focus-visible)":Object.assign({},lw(t)),[`${o}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${o}-button-wrapper-disabled)`]:{zIndex:1,color:R,background:P,borderColor:R,"&::before":{backgroundColor:R},"&:first-child":{borderColor:R},"&:hover":{color:M,borderColor:M,"&::before":{backgroundColor:M}},"&:active":{color:D,borderColor:D,"&::before":{backgroundColor:D}}},[`${o}-group-solid &-checked:not(${o}-button-wrapper-disabled)`]:{color:v,background:E,borderColor:E,"&:hover":{color:v,background:W,borderColor:W},"&:active":{color:v,background:j,borderColor:j}},"&-disabled":{color:T,backgroundColor:A,borderColor:a,cursor:"not-allowed","&:first-child, &:hover":{color:T,backgroundColor:A,borderColor:a}},[`&-disabled${o}-button-wrapper-checked`]:{color:S,backgroundColor:x,borderColor:a,boxShadow:"none"}}}},XLt=t=>{const{wireframe:e,padding:n,marginXS:o,lineWidth:r,fontSizeLG:i,colorText:a,colorBgContainer:l,colorTextDisabled:s,controlItemBgActiveDisabled:c,colorTextLightSolid:u,colorPrimary:d,colorPrimaryHover:f,colorPrimaryActive:p,colorWhite:g}=t,y=4,w=i,b=e?w-y*2:w-(y+r)*2;return{radioSize:w,dotSize:b,dotColorDisabled:s,buttonSolidCheckedColor:u,buttonSolidCheckedBg:d,buttonSolidCheckedHoverBg:f,buttonSolidCheckedActiveBg:p,buttonBg:l,buttonCheckedBg:l,buttonColor:a,buttonCheckedBgDisabled:c,buttonCheckedColorDisabled:s,buttonPaddingInline:n-r,wrapperMarginInlineEnd:o,radioColor:e?d:g,radioBgColor:e?l:d}},tJe=wl("Radio",t=>{const{controlOutline:e,controlOutlineWidth:n}=t,o=`0 0 0 ${Nt(n)} ${e}`,i=Ki(t,{radioFocusShadow:o,radioButtonFocusShadow:o});return[_Lt(i),VLt(i),GLt(i)]},XLt,{unitless:{radioSize:!0,dotSize:!0}});var JLt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n,o;const r=m.useContext(QXe),i=m.useContext(ZXe),{getPrefixCls:a,direction:l,radio:s}=m.useContext(Cr),c=m.useRef(null),u=o5(e,c),{isFormItemInput:d}=m.useContext(r1),f=j=>{var L,k;(L=t.onChange)===null||L===void 0||L.call(t,j),(k=r==null?void 0:r.onChange)===null||k===void 0||k.call(r,j)},{prefixCls:p,className:g,rootClassName:y,children:w,style:b,title:C}=t,P=JLt(t,["prefixCls","className","rootClassName","children","style","title"]),v=a("radio",p),T=((r==null?void 0:r.optionType)||i)==="button",A=T?`${v}-button`:v,x=O0(v),[S,R,M]=tJe(v,x),D=Object.assign({},P),E=m.useContext(n1);r&&(D.name=r.name,D.onChange=f,D.checked=t.value===r.value,D.disabled=(n=D.disabled)!==null&&n!==void 0?n:r.disabled),D.disabled=(o=D.disabled)!==null&&o!==void 0?o:E;const W=Un(`${A}-wrapper`,{[`${A}-wrapper-checked`]:D.checked,[`${A}-wrapper-disabled`]:D.disabled,[`${A}-wrapper-rtl`]:l==="rtl",[`${A}-wrapper-in-form-item`]:d},s==null?void 0:s.className,g,y,R,M,x);return S(m.createElement(FW,{component:"Radio",disabled:D.disabled},m.createElement("label",{className:W,style:Object.assign(Object.assign({},s==null?void 0:s.style),b),onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,title:C},m.createElement(eJe,Object.assign({},D,{className:Un(D.className,!T&&k$),type:"radio",prefixCls:A,ref:u})),w!==void 0?m.createElement("span",null,w):null)))},_G=m.forwardRef(KLt),qLt=m.forwardRef((t,e)=>{const{getPrefixCls:n,direction:o}=m.useContext(Cr),[r,i]=$6(t.defaultValue,{value:t.value}),a=j=>{const L=r,k=j.target.value;"value"in t||i(k);const{onChange:N}=t;N&&k!==L&&N(j)},{prefixCls:l,className:s,rootClassName:c,options:u,buttonStyle:d="outline",disabled:f,children:p,size:g,style:y,id:w,onMouseEnter:b,onMouseLeave:C,onFocus:P,onBlur:v}=t,T=n("radio",l),A=`${T}-group`,x=O0(T),[S,R,M]=tJe(T,x);let D=p;u&&u.length>0&&(D=u.map(j=>typeof j=="string"||typeof j=="number"?m.createElement(_G,{key:j.toString(),prefixCls:T,disabled:f,value:j,checked:r===j},j):m.createElement(_G,{key:`radio-group-value-options-${j.value}`,prefixCls:T,disabled:j.disabled||f,value:j.value,checked:r===j.value,title:j.title,style:j.style,id:j.id,required:j.required},j.label)));const E=Ed(g),W=Un(A,`${A}-${d}`,{[`${A}-${E}`]:E,[`${A}-rtl`]:o==="rtl"},s,c,R,M,x);return S(m.createElement("div",Object.assign({},Ame(t,{aria:!0,data:!0}),{className:W,style:y,onMouseEnter:b,onMouseLeave:C,onFocus:P,onBlur:v,id:w,ref:e}),m.createElement(BLt,{value:{onChange:a,value:r,disabled:t.disabled,name:t.name,optionType:t.optionType}},D)))}),$Lt=m.memo(qLt);var QLt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{getPrefixCls:n}=m.useContext(Cr),{prefixCls:o}=t,r=QLt(t,["prefixCls"]),i=n("radio",o);return m.createElement(YLt,{value:"button"},m.createElement(_G,Object.assign({prefixCls:i},r,{type:"radio",ref:e})))},eWt=m.forwardRef(ZLt),Ue=_G;Ue.Button=eWt;Ue.Group=$Lt;Ue.__ANT_RADIO=!0;function XW(t){return Ki(t,{inputAffixPadding:t.paddingXXS})}const JW=t=>{const{controlHeight:e,fontSize:n,lineHeight:o,lineWidth:r,controlHeightSM:i,controlHeightLG:a,fontSizeLG:l,lineHeightLG:s,paddingSM:c,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:f,colorPrimaryHover:p,colorPrimary:g,controlOutlineWidth:y,controlOutline:w,colorErrorOutline:b,colorWarningOutline:C,colorBgContainer:P}=t;return{paddingBlock:Math.max(Math.round((e-n*o)/2*10)/10-r,0),paddingBlockSM:Math.max(Math.round((i-n*o)/2*10)/10-r,0),paddingBlockLG:Math.ceil((a-l*s)/2*10)/10-r,paddingInline:c-r,paddingInlineSM:u-r,paddingInlineLG:d-r,addonBg:f,activeBorderColor:g,hoverBorderColor:p,activeShadow:`0 0 0 ${y}px ${w}`,errorActiveShadow:`0 0 0 ${y}px ${b}`,warningActiveShadow:`0 0 0 ${y}px ${C}`,hoverBg:P,activeBg:P,inputFontSize:n,inputFontSizeLG:l,inputFontSizeSM:n}},tWt=t=>({borderColor:t.hoverBorderColor,backgroundColor:t.hoverBg}),aQ=t=>({color:t.colorTextDisabled,backgroundColor:t.colorBgContainerDisabled,borderColor:t.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":Object.assign({},tWt(Ki(t,{hoverBorderColor:t.colorBorder,hoverBg:t.colorBgContainerDisabled})))}),Qme=(t,e)=>({background:t.colorBgContainer,borderWidth:t.lineWidth,borderStyle:t.lineType,borderColor:e.borderColor,"&:hover":{borderColor:e.hoverBorderColor,backgroundColor:t.hoverBg},"&:focus, &:focus-within":{borderColor:e.activeBorderColor,boxShadow:e.activeShadow,outline:0,backgroundColor:t.activeBg}}),rxe=(t,e)=>({[`&${t.componentCls}-status-${e.status}:not(${t.componentCls}-disabled)`]:Object.assign(Object.assign({},Qme(t,e)),{[`${t.componentCls}-prefix, ${t.componentCls}-suffix`]:{color:e.affixColor}}),[`&${t.componentCls}-status-${e.status}${t.componentCls}-disabled`]:{borderColor:e.borderColor}}),Zme=(t,e)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Qme(t,{borderColor:t.colorBorder,hoverBorderColor:t.hoverBorderColor,activeBorderColor:t.activeBorderColor,activeShadow:t.activeShadow})),{[`&${t.componentCls}-disabled, &[disabled]`]:Object.assign({},aQ(t))}),rxe(t,{status:"error",borderColor:t.colorError,hoverBorderColor:t.colorErrorBorderHover,activeBorderColor:t.colorError,activeShadow:t.errorActiveShadow,affixColor:t.colorError})),rxe(t,{status:"warning",borderColor:t.colorWarning,hoverBorderColor:t.colorWarningBorderHover,activeBorderColor:t.colorWarning,activeShadow:t.warningActiveShadow,affixColor:t.colorWarning})),e)}),ixe=(t,e)=>({[`&${t.componentCls}-group-wrapper-status-${e.status}`]:{[`${t.componentCls}-group-addon`]:{borderColor:e.addonBorderColor,color:e.addonColor}}}),nJe=t=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${t.componentCls}-group`]:{"&-addon":{background:t.addonBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},ixe(t,{status:"error",addonBorderColor:t.colorError,addonColor:t.colorErrorText})),ixe(t,{status:"warning",addonBorderColor:t.colorWarning,addonColor:t.colorWarningText})),{[`&${t.componentCls}-group-wrapper-disabled`]:{[`${t.componentCls}-group-addon`]:Object.assign({},aQ(t))}})}),eye=(t,e)=>({"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${t.componentCls}-disabled, &[disabled]`]:{color:t.colorTextDisabled}},e)}),oJe=(t,e)=>({background:e.bg,borderWidth:t.lineWidth,borderStyle:t.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:e==null?void 0:e.inputColor},"&:hover":{background:e.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:e.activeBorderColor,backgroundColor:t.activeBg}}),axe=(t,e)=>({[`&${t.componentCls}-status-${e.status}:not(${t.componentCls}-disabled)`]:Object.assign(Object.assign({},oJe(t,e)),{[`${t.componentCls}-prefix, ${t.componentCls}-suffix`]:{color:e.affixColor}})}),tye=(t,e)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},oJe(t,{bg:t.colorFillTertiary,hoverBg:t.colorFillSecondary,activeBorderColor:t.colorPrimary})),{[`&${t.componentCls}-disabled, &[disabled]`]:Object.assign({},aQ(t))}),axe(t,{status:"error",bg:t.colorErrorBg,hoverBg:t.colorErrorBgHover,activeBorderColor:t.colorError,inputColor:t.colorErrorText,affixColor:t.colorError})),axe(t,{status:"warning",bg:t.colorWarningBg,hoverBg:t.colorWarningBgHover,activeBorderColor:t.colorWarning,inputColor:t.colorWarningText,affixColor:t.colorWarning})),e)}),lxe=(t,e)=>({[`&${t.componentCls}-group-wrapper-status-${e.status}`]:{[`${t.componentCls}-group-addon`]:{background:e.addonBg,color:e.addonColor}}}),rJe=t=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${t.componentCls}-group`]:{"&-addon":{background:t.colorFillTertiary},[`${t.componentCls}-filled:not(:focus):not(:focus-within)`]:{"&:not(:first-child)":{borderInlineStart:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},"&:not(:last-child)":{borderInlineEnd:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`}}}},lxe(t,{status:"error",addonBg:t.colorErrorBg,addonColor:t.colorErrorText})),lxe(t,{status:"warning",addonBg:t.colorWarningBg,addonColor:t.colorWarningText})),{[`&${t.componentCls}-group-wrapper-disabled`]:{[`${t.componentCls}-group`]:{"&-addon":{background:t.colorFillTertiary,color:t.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderTop:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderBottom:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderTop:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderBottom:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`}}}})}),nye=t=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:t,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),iJe=t=>{const{paddingBlockLG:e,lineHeightLG:n,borderRadiusLG:o,paddingInlineLG:r}=t;return{padding:`${Nt(e)} ${Nt(r)}`,fontSize:t.inputFontSizeLG,lineHeight:n,borderRadius:o}},oye=t=>({padding:`${Nt(t.paddingBlockSM)} ${Nt(t.paddingInlineSM)}`,fontSize:t.inputFontSizeSM,borderRadius:t.borderRadiusSM}),KW=t=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Nt(t.paddingBlock)} ${Nt(t.paddingInline)}`,color:t.colorText,fontSize:t.inputFontSize,lineHeight:t.lineHeight,borderRadius:t.borderRadius,transition:`all ${t.motionDurationMid}`},nye(t.colorTextPlaceholder)),{"textarea&":{maxWidth:"100%",height:"auto",minHeight:t.controlHeight,lineHeight:t.lineHeight,verticalAlign:"bottom",transition:`all ${t.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},iJe(t)),"&-sm":Object.assign({},oye(t)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),aJe=t=>{const{componentCls:e,antCls:n}=t;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:t.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${e}, &-lg > ${e}-group-addon`]:Object.assign({},iJe(t)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},oye(t)),[`&-lg ${n}-select-single ${n}-select-selector`]:{height:t.controlHeightLG},[`&-sm ${n}-select-single ${n}-select-selector`]:{height:t.controlHeightSM},[`> ${e}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${e}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${Nt(t.paddingInline)}`,color:t.colorText,fontWeight:"normal",fontSize:t.inputFontSize,textAlign:"center",borderRadius:t.borderRadius,transition:`all ${t.motionDurationSlow}`,lineHeight:1,[`${n}-select`]:{margin:`${Nt(t.calc(t.paddingBlock).add(1).mul(-1).equal())} ${Nt(t.calc(t.paddingInline).mul(-1).equal())}`,[`&${n}-select-single:not(${n}-select-customize-input):not(${n}-pagination-size-changer)`]:{[`${n}-select-selector`]:{backgroundColor:"inherit",border:`${Nt(t.lineWidth)} ${t.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${n}-select-selector`]:{color:t.colorPrimary}}},[`${n}-cascader-picker`]:{margin:`-9px ${Nt(t.calc(t.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${n}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[`${e}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${e}-search-with-button &`]:{zIndex:0}}},[`> ${e}:first-child, ${e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}-affix-wrapper`]:{[`&:not(:first-child) ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}:last-child, ${e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${n}-select ${n}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-search &`]:{borderStartStartRadius:t.borderRadius,borderEndStartRadius:t.borderRadius}},[`&:not(:first-child), ${e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${e}-group-compact`]:Object.assign(Object.assign({display:"block"},ek()),{[`${e}-group-addon, ${e}-group-wrap, > ${e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:t.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[` & > ${e}-affix-wrapper, & > ${e}-number-affix-wrapper, & > ${n}-picker-range @@ -4568,9 +4568,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho & > ${n}-cascader-picker:first-child ${e}`]:{borderStartStartRadius:t.borderRadius,borderEndStartRadius:t.borderRadius},[`& > *:last-child, & > ${n}-select:last-child > ${n}-select-selector, & > ${n}-cascader-picker:last-child ${e}, - & > ${n}-cascader-picker-focused:last-child ${e}`]:{borderInlineEndWidth:t.lineWidth,borderStartEndRadius:t.borderRadius,borderEndEndRadius:t.borderRadius},[`& > ${n}-select-auto-complete ${e}`]:{verticalAlign:"top"},[`${e}-group-wrapper + ${e}-group-wrapper`]:{marginInlineStart:t.calc(t.lineWidth).mul(-1).equal(),[`${e}-affix-wrapper`]:{borderRadius:0}},[`${e}-group-wrapper:not(:last-child)`]:{[`&${e}-search > ${e}-group`]:{[`& > ${e}-group-addon > ${e}-search-button`]:{borderRadius:0},[`& > ${e}`]:{borderStartStartRadius:t.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:t.borderRadius}}}})}},nWt=t=>{const{componentCls:e,controlHeightSM:n,lineWidth:o,calc:r}=t,a=r(n).sub(r(o).mul(2)).sub(16).div(2).equal();return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),JW(t)),Qme(t)),eye(t)),Zme(t)),{'&[type="color"]':{height:t.controlHeight,[`&${e}-lg`]:{height:t.controlHeightLG},[`&${e}-sm`]:{height:n,paddingTop:a,paddingBottom:a}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},oWt=t=>{const{componentCls:e}=t;return{[`${e}-clear-icon`]:{margin:0,color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${t.motionDurationSlow}`,"&:hover":{color:t.colorTextTertiary},"&:active":{color:t.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Nt(t.inputAffixPadding)}`}}}},rWt=t=>{const{componentCls:e,inputAffixPadding:n,colorTextDescription:o,motionDurationSlow:r,colorIcon:i,colorIconHover:a,iconCls:l}=t;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign({},JW(t)),{display:"inline-flex",[`&:not(${e}-disabled):hover`]:{zIndex:1,[`${e}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${e}`]:{padding:0},[`> input${e}, > textarea${e}`]:{fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${e}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:t.paddingXS}},"&-show-count-suffix":{color:o},"&-show-count-has-suffix":{marginInlineEnd:t.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),oWt(t)),{[`${l}${e}-password-icon`]:{color:i,cursor:"pointer",transition:`all ${r}`,"&:hover":{color:a}}})}},iWt=t=>{const{componentCls:e,borderRadiusLG:n,borderRadiusSM:o}=t;return{[`${e}-group`]:Object.assign(Object.assign(Object.assign({},ja(t)),aJe(t)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${e}-group-addon`]:{borderRadius:n,fontSize:t.inputFontSizeLG}},"&-sm":{[`${e}-group-addon`]:{borderRadius:o}}},nJe(t)),rJe(t)),{[`&:not(${e}-compact-first-item):not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}, ${e}-group-addon`]:{borderRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-first-item`]:{[`${e}, ${e}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${e}-compact-first-item)${e}-compact-last-item`]:{[`${e}, ${e}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}}})})}},aWt=t=>{const{componentCls:e,antCls:n}=t,o=`${e}-search`;return{[o]:{[`${e}`]:{"&:hover, &:focus":{borderColor:t.colorPrimaryHover,[`+ ${e}-group-addon ${o}-button:not(${n}-btn-primary)`]:{borderInlineStartColor:t.colorPrimaryHover}}},[`${e}-affix-wrapper`]:{borderRadius:0},[`${e}-lg`]:{lineHeight:t.calc(t.lineHeightLG).sub(2e-4).equal({unit:!1})},[`> ${e}-group`]:{[`> ${e}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${o}-button`]:{marginInlineEnd:-1,paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:t.borderRadius,borderEndEndRadius:t.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${o}-button:not(${n}-btn-primary)`]:{color:t.colorTextDescription,"&:hover":{color:t.colorPrimaryHover},"&:active":{color:t.colorPrimaryActive},[`&${n}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${o}-button`]:{height:t.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${o}-button`]:{height:t.controlHeightLG},[`&-small ${o}-button`]:{height:t.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${e}-compact-item`]:{[`&:not(${e}-compact-last-item)`]:{[`${e}-group-addon`]:{[`${e}-search-button`]:{marginInlineEnd:t.calc(t.lineWidth).mul(-1).equal(),borderRadius:0}}},[`&:not(${e}-compact-first-item)`]:{[`${e},${e}-affix-wrapper`]:{borderRadius:0}},[`> ${e}-group-addon ${e}-search-button, + & > ${n}-cascader-picker-focused:last-child ${e}`]:{borderInlineEndWidth:t.lineWidth,borderStartEndRadius:t.borderRadius,borderEndEndRadius:t.borderRadius},[`& > ${n}-select-auto-complete ${e}`]:{verticalAlign:"top"},[`${e}-group-wrapper + ${e}-group-wrapper`]:{marginInlineStart:t.calc(t.lineWidth).mul(-1).equal(),[`${e}-affix-wrapper`]:{borderRadius:0}},[`${e}-group-wrapper:not(:last-child)`]:{[`&${e}-search > ${e}-group`]:{[`& > ${e}-group-addon > ${e}-search-button`]:{borderRadius:0},[`& > ${e}`]:{borderStartStartRadius:t.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:t.borderRadius}}}})}},nWt=t=>{const{componentCls:e,controlHeightSM:n,lineWidth:o,calc:r}=t,a=r(n).sub(r(o).mul(2)).sub(16).div(2).equal();return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),KW(t)),Zme(t)),tye(t)),eye(t)),{'&[type="color"]':{height:t.controlHeight,[`&${e}-lg`]:{height:t.controlHeightLG},[`&${e}-sm`]:{height:n,paddingTop:a,paddingBottom:a}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},oWt=t=>{const{componentCls:e}=t;return{[`${e}-clear-icon`]:{margin:0,color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${t.motionDurationSlow}`,"&:hover":{color:t.colorTextTertiary},"&:active":{color:t.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Nt(t.inputAffixPadding)}`}}}},rWt=t=>{const{componentCls:e,inputAffixPadding:n,colorTextDescription:o,motionDurationSlow:r,colorIcon:i,colorIconHover:a,iconCls:l}=t;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign({},KW(t)),{display:"inline-flex",[`&:not(${e}-disabled):hover`]:{zIndex:1,[`${e}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${e}`]:{padding:0},[`> input${e}, > textarea${e}`]:{fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${e}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:t.paddingXS}},"&-show-count-suffix":{color:o},"&-show-count-has-suffix":{marginInlineEnd:t.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),oWt(t)),{[`${l}${e}-password-icon`]:{color:i,cursor:"pointer",transition:`all ${r}`,"&:hover":{color:a}}})}},iWt=t=>{const{componentCls:e,borderRadiusLG:n,borderRadiusSM:o}=t;return{[`${e}-group`]:Object.assign(Object.assign(Object.assign({},ja(t)),aJe(t)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${e}-group-addon`]:{borderRadius:n,fontSize:t.inputFontSizeLG}},"&-sm":{[`${e}-group-addon`]:{borderRadius:o}}},nJe(t)),rJe(t)),{[`&:not(${e}-compact-first-item):not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}, ${e}-group-addon`]:{borderRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-first-item`]:{[`${e}, ${e}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${e}-compact-first-item)${e}-compact-last-item`]:{[`${e}, ${e}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}}})})}},aWt=t=>{const{componentCls:e,antCls:n}=t,o=`${e}-search`;return{[o]:{[`${e}`]:{"&:hover, &:focus":{borderColor:t.colorPrimaryHover,[`+ ${e}-group-addon ${o}-button:not(${n}-btn-primary)`]:{borderInlineStartColor:t.colorPrimaryHover}}},[`${e}-affix-wrapper`]:{borderRadius:0},[`${e}-lg`]:{lineHeight:t.calc(t.lineHeightLG).sub(2e-4).equal({unit:!1})},[`> ${e}-group`]:{[`> ${e}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${o}-button`]:{marginInlineEnd:-1,paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:t.borderRadius,borderEndEndRadius:t.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${o}-button:not(${n}-btn-primary)`]:{color:t.colorTextDescription,"&:hover":{color:t.colorPrimaryHover},"&:active":{color:t.colorPrimaryActive},[`&${n}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${o}-button`]:{height:t.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${o}-button`]:{height:t.controlHeightLG},[`&-small ${o}-button`]:{height:t.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${e}-compact-item`]:{[`&:not(${e}-compact-last-item)`]:{[`${e}-group-addon`]:{[`${e}-search-button`]:{marginInlineEnd:t.calc(t.lineWidth).mul(-1).equal(),borderRadius:0}}},[`&:not(${e}-compact-first-item)`]:{[`${e},${e}-affix-wrapper`]:{borderRadius:0}},[`> ${e}-group-addon ${e}-search-button, > ${e}, - ${e}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${e}-affix-wrapper-focused`]:{zIndex:2}}}}},lWt=t=>{const{componentCls:e,paddingLG:n}=t,o=`${e}-textarea`;return{[o]:{position:"relative","&-show-count":{[`> ${e}`]:{height:"100%"},[`${e}-data-count`]:{position:"absolute",bottom:t.calc(t.fontSize).mul(t.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:t.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${e}`]:{paddingInlineEnd:n}},[`&-affix-wrapper${o}-has-feedback`]:{[`${e}`]:{paddingInlineEnd:n}},[`&-affix-wrapper${e}-affix-wrapper`]:{padding:0,[`> textarea${e}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent","&:focus":{boxShadow:"none !important"}},[`${e}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${e}-clear-icon`]:{position:"absolute",insetInlineEnd:t.paddingXS,insetBlockStart:t.paddingXS},[`${o}-suffix`]:{position:"absolute",top:0,insetInlineEnd:t.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}},sWt=t=>{const{componentCls:e}=t;return{[`${e}-out-of-range`]:{[`&, & input, & textarea, ${e}-show-count-suffix, ${e}-data-count`]:{color:t.colorError}}}},oye=wl("Input",t=>{const e=Ki(t,GW(t));return[nWt(e),lWt(e),rWt(e),iWt(e),aWt(e),sWt(e),FW(e)]},XW,{resetFont:!1}),cie=(t,e)=>{const{componentCls:n,controlHeight:o}=t,r=e?`${n}-${e}`:"",i=DGe(t);return[{[`${n}-multiple${r}`]:{paddingBlock:i.containerPadding,paddingInlineStart:i.basePadding,minHeight:o,[`${n}-selection-item`]:{height:i.itemHeight,lineHeight:Nt(i.itemLineHeight)}}}]},cWt=t=>{const{componentCls:e,calc:n,lineWidth:o}=t,r=Ki(t,{fontHeight:t.fontSize,selectHeight:t.controlHeightSM,multipleSelectItemHeight:t.multipleItemHeightSM,borderRadius:t.borderRadiusSM,borderRadiusSM:t.borderRadiusXS,controlHeight:t.controlHeightSM}),i=Ki(t,{fontHeight:n(t.multipleItemHeightLG).sub(n(o).mul(2).equal()).equal(),fontSize:t.fontSizeLG,selectHeight:t.controlHeightLG,multipleSelectItemHeight:t.multipleItemHeightLG,borderRadius:t.borderRadiusLG,borderRadiusSM:t.borderRadius,controlHeight:t.controlHeightLG});return[cie(r,"small"),cie(t),cie(i,"large"),{[`${e}${e}-multiple`]:Object.assign(Object.assign({width:"100%",cursor:"text",[`${e}-selector`]:{flex:"auto",padding:0,position:"relative","&:after":{margin:0},[`${e}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:t.inputPaddingHorizontalBase,insetInlineEnd:0,transform:"translateY(-50%)",transition:`all ${t.motionDurationSlow}`,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,color:t.colorTextPlaceholder,pointerEvents:"none"}}},EGe(t)),{[`${e}-multiple-input`]:{width:0,height:0,border:0,visibility:"hidden",position:"absolute",zIndex:-1}})}]},uWt=t=>{const{pickerCellCls:e,pickerCellInnerCls:n,cellHeight:o,borderRadiusSM:r,motionDurationMid:i,cellHoverBg:a,lineWidth:l,lineType:s,colorPrimary:c,cellActiveWithRangeBg:u,colorTextLightSolid:d,colorTextDisabled:f,cellBgDisabled:p,colorFillSecondary:g}=t;return{"&::before":{position:"absolute",top:"50%",insetInlineStart:0,insetInlineEnd:0,zIndex:1,height:o,transform:"translateY(-50%)",content:'""'},[n]:{position:"relative",zIndex:2,display:"inline-block",minWidth:o,height:o,lineHeight:Nt(o),borderRadius:r,transition:`background ${i}`},[`&:hover:not(${e}-in-view), + ${e}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${e}-affix-wrapper-focused`]:{zIndex:2}}}}},lWt=t=>{const{componentCls:e,paddingLG:n}=t,o=`${e}-textarea`;return{[o]:{position:"relative","&-show-count":{[`> ${e}`]:{height:"100%"},[`${e}-data-count`]:{position:"absolute",bottom:t.calc(t.fontSize).mul(t.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:t.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${e}`]:{paddingInlineEnd:n}},[`&-affix-wrapper${o}-has-feedback`]:{[`${e}`]:{paddingInlineEnd:n}},[`&-affix-wrapper${e}-affix-wrapper`]:{padding:0,[`> textarea${e}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent","&:focus":{boxShadow:"none !important"}},[`${e}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${e}-clear-icon`]:{position:"absolute",insetInlineEnd:t.paddingXS,insetBlockStart:t.paddingXS},[`${o}-suffix`]:{position:"absolute",top:0,insetInlineEnd:t.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}},sWt=t=>{const{componentCls:e}=t;return{[`${e}-out-of-range`]:{[`&, & input, & textarea, ${e}-show-count-suffix, ${e}-data-count`]:{color:t.colorError}}}},rye=wl("Input",t=>{const e=Ki(t,XW(t));return[nWt(e),lWt(e),rWt(e),iWt(e),aWt(e),sWt(e),kW(e)]},JW,{resetFont:!1}),cie=(t,e)=>{const{componentCls:n,controlHeight:o}=t,r=e?`${n}-${e}`:"",i=DGe(t);return[{[`${n}-multiple${r}`]:{paddingBlock:i.containerPadding,paddingInlineStart:i.basePadding,minHeight:o,[`${n}-selection-item`]:{height:i.itemHeight,lineHeight:Nt(i.itemLineHeight)}}}]},cWt=t=>{const{componentCls:e,calc:n,lineWidth:o}=t,r=Ki(t,{fontHeight:t.fontSize,selectHeight:t.controlHeightSM,multipleSelectItemHeight:t.multipleItemHeightSM,borderRadius:t.borderRadiusSM,borderRadiusSM:t.borderRadiusXS,controlHeight:t.controlHeightSM}),i=Ki(t,{fontHeight:n(t.multipleItemHeightLG).sub(n(o).mul(2).equal()).equal(),fontSize:t.fontSizeLG,selectHeight:t.controlHeightLG,multipleSelectItemHeight:t.multipleItemHeightLG,borderRadius:t.borderRadiusLG,borderRadiusSM:t.borderRadius,controlHeight:t.controlHeightLG});return[cie(r,"small"),cie(t),cie(i,"large"),{[`${e}${e}-multiple`]:Object.assign(Object.assign({width:"100%",cursor:"text",[`${e}-selector`]:{flex:"auto",padding:0,position:"relative","&:after":{margin:0},[`${e}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:t.inputPaddingHorizontalBase,insetInlineEnd:0,transform:"translateY(-50%)",transition:`all ${t.motionDurationSlow}`,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,color:t.colorTextPlaceholder,pointerEvents:"none"}}},EGe(t)),{[`${e}-multiple-input`]:{width:0,height:0,border:0,visibility:"hidden",position:"absolute",zIndex:-1}})}]},uWt=t=>{const{pickerCellCls:e,pickerCellInnerCls:n,cellHeight:o,borderRadiusSM:r,motionDurationMid:i,cellHoverBg:a,lineWidth:l,lineType:s,colorPrimary:c,cellActiveWithRangeBg:u,colorTextLightSolid:d,colorTextDisabled:f,cellBgDisabled:p,colorFillSecondary:g}=t;return{"&::before":{position:"absolute",top:"50%",insetInlineStart:0,insetInlineEnd:0,zIndex:1,height:o,transform:"translateY(-50%)",content:'""'},[n]:{position:"relative",zIndex:2,display:"inline-block",minWidth:o,height:o,lineHeight:Nt(o),borderRadius:r,transition:`background ${i}`},[`&:hover:not(${e}-in-view), &:hover:not(${e}-selected):not(${e}-range-start):not(${e}-range-end)`]:{[n]:{background:a}},[`&-in-view${e}-today ${n}`]:{"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:1,border:`${Nt(l)} ${s} ${c}`,borderRadius:r,content:'""'}},[`&-in-view${e}-in-range, &-in-view${e}-range-start, &-in-view${e}-range-end`]:{position:"relative",[`&:not(${e}-disabled):before`]:{background:u}},[`&-in-view${e}-selected, @@ -4581,7 +4581,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho &-selected ${o}, ${o}`]:{background:"transparent !important"}},"&-row":{td:{"&:before":{transition:`background ${v}`},"&:first-child:before":{borderStartStartRadius:L,borderEndStartRadius:L},"&:last-child:before":{borderStartEndRadius:L,borderEndEndRadius:L}},"&:hover td":{"&:before":{background:N}},"&-range-start td,\n &-range-end td,\n &-selected td,\n &-hover td":{[`&${n}`]:{"&:before":{background:g},[`&${e}-cell-week`]:{color:new kl(k).setAlpha(.5).toHexString()},[o]:{color:k}}},"&-range-hover td:before":{background:B}}},"&-week-panel, &-date-panel-show-week":{[`${e}-body`]:{padding:`${Nt(s)} ${Nt(l)}`},[`${e}-content th`]:{width:"auto"}},"&-datetime-panel":{display:"flex",[`${e}-time-panel`]:{borderInlineStart:`${Nt(d)} ${f} ${w}`},[`${e}-date-panel, ${e}-time-panel`]:{transition:`opacity ${E}`},"&-active":{[`${e}-date-panel, - ${e}-time-panel`]:{opacity:.3,"&-active":{opacity:1}}}},"&-time-panel":{width:"auto",minWidth:"auto",direction:"ltr",[`${e}-content`]:{display:"flex",flex:"auto",height:F},"&-column":{flex:"1 0 auto",width:U,margin:`${Nt(c)} 0`,padding:0,overflowY:"hidden",textAlign:"start",listStyle:"none",transition:`background ${v}`,overflowX:"hidden","&::-webkit-scrollbar":{width:8,backgroundColor:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:t.colorTextTertiary,borderRadius:t.borderRadiusSM},"&":{scrollbarWidth:"thin",scrollbarColor:`${t.colorTextTertiary} transparent`},"&::after":{display:"block",height:t.calc("100%").sub(O).equal(),content:'""'},"&:not(:first-child)":{borderInlineStart:`${Nt(d)} ${f} ${w}`},"&-active":{background:new kl(B).setAlpha(.2).toHexString()},"&:hover":{overflowY:"auto"},"> li":{margin:0,padding:0,[`&${e}-time-panel-cell`]:{marginInline:_,[`${e}-time-panel-cell-inner`]:{display:"block",width:t.calc(U).sub(t.calc(_).mul(2)).equal(),height:O,margin:0,paddingBlock:0,paddingInlineEnd:0,paddingInlineStart:t.calc(U).sub(O).div(2).equal(),color:M,lineHeight:Nt(O),borderRadius:L,cursor:"pointer",transition:`background ${v}`,"&:hover":{background:N}},"&-selected":{[`${e}-time-panel-cell-inner`]:{background:B}},"&-disabled":{[`${e}-time-panel-cell-inner`]:{color:R,background:"transparent",cursor:"not-allowed"}}}}}}}}},fWt=t=>{const{componentCls:e,textHeight:n,lineWidth:o,paddingSM:r,antCls:i,colorPrimary:a,cellActiveWithRangeBg:l,colorPrimaryBorder:s,lineType:c,colorSplit:u}=t;return{[`${e}-dropdown`]:{[`${e}-footer`]:{borderTop:`${Nt(o)} ${c} ${u}`,"&-extra":{padding:`0 ${Nt(r)}`,lineHeight:Nt(t.calc(n).sub(t.calc(o).mul(2)).equal()),textAlign:"start","&:not(:last-child)":{borderBottom:`${Nt(o)} ${c} ${u}`}}},[`${e}-panels + ${e}-footer ${e}-ranges`]:{justifyContent:"space-between"},[`${e}-ranges`]:{marginBlock:0,paddingInline:Nt(r),overflow:"hidden",textAlign:"start",listStyle:"none",display:"flex",justifyContent:"center",alignItems:"center","> li":{lineHeight:Nt(t.calc(n).sub(t.calc(o).mul(2)).equal()),display:"inline-block"},[`${e}-now-btn-disabled`]:{pointerEvents:"none",color:t.colorTextDisabled},[`${e}-preset > ${i}-tag-blue`]:{color:a,background:l,borderColor:s,cursor:"pointer"},[`${e}-ok`]:{paddingBlock:t.calc(o).mul(2).equal(),marginInlineStart:"auto"}}}}},hWt=t=>{const{componentCls:e,controlHeightLG:n,paddingXXS:o,padding:r}=t;return{pickerCellCls:`${e}-cell`,pickerCellInnerCls:`${e}-cell-inner`,pickerYearMonthCellWidth:t.calc(n).mul(1.5).equal(),pickerQuarterPanelContentHeight:t.calc(n).mul(1.4).equal(),pickerCellPaddingVertical:t.calc(o).add(t.calc(o).div(2)).equal(),pickerCellBorderGap:2,pickerControlIconSize:7,pickerControlIconMargin:4,pickerControlIconBorderWidth:1.5,pickerDatePanelPaddingHorizontal:t.calc(r).add(t.calc(o).div(2)).equal()}},pWt=t=>{const{colorBgContainerDisabled:e,controlHeight:n,controlHeightSM:o,controlHeightLG:r,paddingXXS:i,lineWidth:a}=t,l=i*2,s=a*2,c=Math.min(n-l,n-s),u=Math.min(o-l,o-s),d=Math.min(r-l,r-s);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(i/2),cellHoverBg:t.controlItemBgHover,cellActiveWithRangeBg:t.controlItemBgActive,cellHoverWithRangeBg:new kl(t.colorPrimary).lighten(35).toHexString(),cellRangeBorderColor:new kl(t.colorPrimary).lighten(20).toHexString(),cellBgDisabled:e,timeColumnWidth:r*1.4,timeColumnHeight:28*8,timeCellHeight:28,cellWidth:o*1.5,cellHeight:o,textHeight:r,withoutTimeCellHeight:r*1.65,multipleItemBg:t.colorFillSecondary,multipleItemBorderColor:"transparent",multipleItemHeight:c,multipleItemHeightSM:u,multipleItemHeightLG:d,multipleSelectorBgDisabled:e,multipleItemColorDisabled:t.colorTextDisabled,multipleItemBorderColorDisabled:"transparent"}},gWt=t=>Object.assign(Object.assign(Object.assign(Object.assign({},XW(t)),pWt(t)),J$(t)),{presetsWidth:120,presetsMaxWidth:200,zIndexPopup:t.zIndexPopupBase+50}),mWt=t=>{const{componentCls:e}=t;return{[e]:[Object.assign(Object.assign(Object.assign({},Qme(t)),eye(t)),Zme(t)),{"&-outlined":{[`&${e}-multiple ${e}-selection-item`]:{background:t.multipleItemBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}},"&-filled":{[`&${e}-multiple ${e}-selection-item`]:{background:t.colorBgContainer,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`}},"&-borderless":{[`&${e}-multiple ${e}-selection-item`]:{background:t.multipleItemBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}}}]}},uie=(t,e,n,o)=>{const r=t.calc(n).add(2).equal(),i=t.max(t.calc(e).sub(r).div(2).equal(),0),a=t.max(t.calc(e).sub(r).sub(i).equal(),0);return{padding:`${Nt(i)} ${Nt(o)} ${Nt(a)}`}},yWt=t=>{const{componentCls:e,colorError:n,colorWarning:o}=t;return{[`${e}:not(${e}-disabled):not([disabled])`]:{[`&${e}-status-error`]:{[`${e}-active-bar`]:{background:n}},[`&${e}-status-warning`]:{[`${e}-active-bar`]:{background:o}}}}},AWt=t=>{const{componentCls:e,antCls:n,controlHeight:o,paddingInline:r,lineWidth:i,lineType:a,colorBorder:l,borderRadius:s,motionDurationMid:c,colorTextDisabled:u,colorTextPlaceholder:d,controlHeightLG:f,fontSizeLG:p,controlHeightSM:g,paddingInlineSM:y,paddingXS:w,marginXS:b,colorTextDescription:C,lineWidthBold:P,colorPrimary:v,motionDurationSlow:T,zIndexPopup:A,paddingXXS:x,sizePopupArrow:S,colorBgElevated:R,borderRadiusLG:M,boxShadowSecondary:D,borderRadiusSM:E,colorSplit:W,cellHoverBg:j,presetsWidth:L,presetsMaxWidth:k,boxShadowPopoverArrow:N,fontHeight:F,fontHeightLG:U,lineHeightLG:O}=t;return[{[e]:Object.assign(Object.assign(Object.assign({},ja(t)),uie(t,o,F,r)),{position:"relative",display:"inline-flex",alignItems:"center",lineHeight:1,borderRadius:s,transition:`border ${c}, box-shadow ${c}, background ${c}`,[`${e}-input`]:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%","> input":Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",color:"inherit",fontSize:t.fontSize,lineHeight:t.lineHeight,transition:`all ${c}`},tye(d)),{flex:"auto",minWidth:1,height:"auto",padding:0,background:"transparent",border:0,fontFamily:"inherit","&:focus":{boxShadow:"none",outline:0},"&[disabled]":{background:"transparent",color:u,cursor:"not-allowed"}}),"&-placeholder":{"> input":{color:d}}},"&-large":Object.assign(Object.assign({},uie(t,f,U,r)),{[`${e}-input > input`]:{fontSize:p,lineHeight:O}}),"&-small":Object.assign({},uie(t,g,F,y)),[`${e}-suffix`]:{display:"flex",flex:"none",alignSelf:"center",marginInlineStart:t.calc(w).div(2).equal(),color:u,lineHeight:1,pointerEvents:"none",transition:`opacity ${c}, color ${c}`,"> *":{verticalAlign:"top","&:not(:last-child)":{marginInlineEnd:b}}},[`${e}-clear`]:{position:"absolute",top:"50%",insetInlineEnd:0,color:u,lineHeight:1,transform:"translateY(-50%)",cursor:"pointer",opacity:0,transition:`opacity ${c}, color ${c}`,"> *":{verticalAlign:"top"},"&:hover":{color:C}},"&:hover":{[`${e}-clear`]:{opacity:1},[`${e}-suffix:not(:last-child)`]:{opacity:0}},[`${e}-separator`]:{position:"relative",display:"inline-block",width:"1em",height:p,color:u,fontSize:p,verticalAlign:"top",cursor:"default",[`${e}-focused &`]:{color:C},[`${e}-range-separator &`]:{[`${e}-disabled &`]:{cursor:"not-allowed"}}},"&-range":{position:"relative",display:"inline-flex",[`${e}-active-bar`]:{bottom:t.calc(i).mul(-1).equal(),height:P,background:v,opacity:0,transition:`all ${T} ease-out`,pointerEvents:"none"},[`&${e}-focused`]:{[`${e}-active-bar`]:{opacity:1}},[`${e}-range-separator`]:{alignItems:"center",padding:`0 ${Nt(w)}`,lineHeight:1}},"&-range, &-multiple":{[`${e}-clear`]:{insetInlineEnd:r},[`&${e}-small`]:{[`${e}-clear`]:{insetInlineEnd:y}}},"&-dropdown":Object.assign(Object.assign(Object.assign({},ja(t)),dWt(t)),{pointerEvents:"none",position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:A,[`&${e}-dropdown-hidden`]:{display:"none"},[`&${e}-dropdown-placement-bottomLeft`]:{[`${e}-range-arrow`]:{top:0,display:"block",transform:"translateY(-100%)"}},[`&${e}-dropdown-placement-topLeft`]:{[`${e}-range-arrow`]:{bottom:0,display:"block",transform:"translateY(100%) rotate(180deg)"}},[`&${n}-slide-up-enter${n}-slide-up-enter-active${e}-dropdown-placement-topLeft, + ${e}-time-panel`]:{opacity:.3,"&-active":{opacity:1}}}},"&-time-panel":{width:"auto",minWidth:"auto",direction:"ltr",[`${e}-content`]:{display:"flex",flex:"auto",height:F},"&-column":{flex:"1 0 auto",width:U,margin:`${Nt(c)} 0`,padding:0,overflowY:"hidden",textAlign:"start",listStyle:"none",transition:`background ${v}`,overflowX:"hidden","&::-webkit-scrollbar":{width:8,backgroundColor:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:t.colorTextTertiary,borderRadius:t.borderRadiusSM},"&":{scrollbarWidth:"thin",scrollbarColor:`${t.colorTextTertiary} transparent`},"&::after":{display:"block",height:t.calc("100%").sub(O).equal(),content:'""'},"&:not(:first-child)":{borderInlineStart:`${Nt(d)} ${f} ${w}`},"&-active":{background:new kl(B).setAlpha(.2).toHexString()},"&:hover":{overflowY:"auto"},"> li":{margin:0,padding:0,[`&${e}-time-panel-cell`]:{marginInline:_,[`${e}-time-panel-cell-inner`]:{display:"block",width:t.calc(U).sub(t.calc(_).mul(2)).equal(),height:O,margin:0,paddingBlock:0,paddingInlineEnd:0,paddingInlineStart:t.calc(U).sub(O).div(2).equal(),color:M,lineHeight:Nt(O),borderRadius:L,cursor:"pointer",transition:`background ${v}`,"&:hover":{background:N}},"&-selected":{[`${e}-time-panel-cell-inner`]:{background:B}},"&-disabled":{[`${e}-time-panel-cell-inner`]:{color:R,background:"transparent",cursor:"not-allowed"}}}}}}}}},fWt=t=>{const{componentCls:e,textHeight:n,lineWidth:o,paddingSM:r,antCls:i,colorPrimary:a,cellActiveWithRangeBg:l,colorPrimaryBorder:s,lineType:c,colorSplit:u}=t;return{[`${e}-dropdown`]:{[`${e}-footer`]:{borderTop:`${Nt(o)} ${c} ${u}`,"&-extra":{padding:`0 ${Nt(r)}`,lineHeight:Nt(t.calc(n).sub(t.calc(o).mul(2)).equal()),textAlign:"start","&:not(:last-child)":{borderBottom:`${Nt(o)} ${c} ${u}`}}},[`${e}-panels + ${e}-footer ${e}-ranges`]:{justifyContent:"space-between"},[`${e}-ranges`]:{marginBlock:0,paddingInline:Nt(r),overflow:"hidden",textAlign:"start",listStyle:"none",display:"flex",justifyContent:"center",alignItems:"center","> li":{lineHeight:Nt(t.calc(n).sub(t.calc(o).mul(2)).equal()),display:"inline-block"},[`${e}-now-btn-disabled`]:{pointerEvents:"none",color:t.colorTextDisabled},[`${e}-preset > ${i}-tag-blue`]:{color:a,background:l,borderColor:s,cursor:"pointer"},[`${e}-ok`]:{paddingBlock:t.calc(o).mul(2).equal(),marginInlineStart:"auto"}}}}},hWt=t=>{const{componentCls:e,controlHeightLG:n,paddingXXS:o,padding:r}=t;return{pickerCellCls:`${e}-cell`,pickerCellInnerCls:`${e}-cell-inner`,pickerYearMonthCellWidth:t.calc(n).mul(1.5).equal(),pickerQuarterPanelContentHeight:t.calc(n).mul(1.4).equal(),pickerCellPaddingVertical:t.calc(o).add(t.calc(o).div(2)).equal(),pickerCellBorderGap:2,pickerControlIconSize:7,pickerControlIconMargin:4,pickerControlIconBorderWidth:1.5,pickerDatePanelPaddingHorizontal:t.calc(r).add(t.calc(o).div(2)).equal()}},pWt=t=>{const{colorBgContainerDisabled:e,controlHeight:n,controlHeightSM:o,controlHeightLG:r,paddingXXS:i,lineWidth:a}=t,l=i*2,s=a*2,c=Math.min(n-l,n-s),u=Math.min(o-l,o-s),d=Math.min(r-l,r-s);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(i/2),cellHoverBg:t.controlItemBgHover,cellActiveWithRangeBg:t.controlItemBgActive,cellHoverWithRangeBg:new kl(t.colorPrimary).lighten(35).toHexString(),cellRangeBorderColor:new kl(t.colorPrimary).lighten(20).toHexString(),cellBgDisabled:e,timeColumnWidth:r*1.4,timeColumnHeight:28*8,timeCellHeight:28,cellWidth:o*1.5,cellHeight:o,textHeight:r,withoutTimeCellHeight:r*1.65,multipleItemBg:t.colorFillSecondary,multipleItemBorderColor:"transparent",multipleItemHeight:c,multipleItemHeightSM:u,multipleItemHeightLG:d,multipleSelectorBgDisabled:e,multipleItemColorDisabled:t.colorTextDisabled,multipleItemBorderColorDisabled:"transparent"}},gWt=t=>Object.assign(Object.assign(Object.assign(Object.assign({},JW(t)),pWt(t)),J$(t)),{presetsWidth:120,presetsMaxWidth:200,zIndexPopup:t.zIndexPopupBase+50}),mWt=t=>{const{componentCls:e}=t;return{[e]:[Object.assign(Object.assign(Object.assign({},Zme(t)),tye(t)),eye(t)),{"&-outlined":{[`&${e}-multiple ${e}-selection-item`]:{background:t.multipleItemBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}},"&-filled":{[`&${e}-multiple ${e}-selection-item`]:{background:t.colorBgContainer,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`}},"&-borderless":{[`&${e}-multiple ${e}-selection-item`]:{background:t.multipleItemBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}}}]}},uie=(t,e,n,o)=>{const r=t.calc(n).add(2).equal(),i=t.max(t.calc(e).sub(r).div(2).equal(),0),a=t.max(t.calc(e).sub(r).sub(i).equal(),0);return{padding:`${Nt(i)} ${Nt(o)} ${Nt(a)}`}},yWt=t=>{const{componentCls:e,colorError:n,colorWarning:o}=t;return{[`${e}:not(${e}-disabled):not([disabled])`]:{[`&${e}-status-error`]:{[`${e}-active-bar`]:{background:n}},[`&${e}-status-warning`]:{[`${e}-active-bar`]:{background:o}}}}},AWt=t=>{const{componentCls:e,antCls:n,controlHeight:o,paddingInline:r,lineWidth:i,lineType:a,colorBorder:l,borderRadius:s,motionDurationMid:c,colorTextDisabled:u,colorTextPlaceholder:d,controlHeightLG:f,fontSizeLG:p,controlHeightSM:g,paddingInlineSM:y,paddingXS:w,marginXS:b,colorTextDescription:C,lineWidthBold:P,colorPrimary:v,motionDurationSlow:T,zIndexPopup:A,paddingXXS:x,sizePopupArrow:S,colorBgElevated:R,borderRadiusLG:M,boxShadowSecondary:D,borderRadiusSM:E,colorSplit:W,cellHoverBg:j,presetsWidth:L,presetsMaxWidth:k,boxShadowPopoverArrow:N,fontHeight:F,fontHeightLG:U,lineHeightLG:O}=t;return[{[e]:Object.assign(Object.assign(Object.assign({},ja(t)),uie(t,o,F,r)),{position:"relative",display:"inline-flex",alignItems:"center",lineHeight:1,borderRadius:s,transition:`border ${c}, box-shadow ${c}, background ${c}`,[`${e}-input`]:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%","> input":Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",color:"inherit",fontSize:t.fontSize,lineHeight:t.lineHeight,transition:`all ${c}`},nye(d)),{flex:"auto",minWidth:1,height:"auto",padding:0,background:"transparent",border:0,fontFamily:"inherit","&:focus":{boxShadow:"none",outline:0},"&[disabled]":{background:"transparent",color:u,cursor:"not-allowed"}}),"&-placeholder":{"> input":{color:d}}},"&-large":Object.assign(Object.assign({},uie(t,f,U,r)),{[`${e}-input > input`]:{fontSize:p,lineHeight:O}}),"&-small":Object.assign({},uie(t,g,F,y)),[`${e}-suffix`]:{display:"flex",flex:"none",alignSelf:"center",marginInlineStart:t.calc(w).div(2).equal(),color:u,lineHeight:1,pointerEvents:"none",transition:`opacity ${c}, color ${c}`,"> *":{verticalAlign:"top","&:not(:last-child)":{marginInlineEnd:b}}},[`${e}-clear`]:{position:"absolute",top:"50%",insetInlineEnd:0,color:u,lineHeight:1,transform:"translateY(-50%)",cursor:"pointer",opacity:0,transition:`opacity ${c}, color ${c}`,"> *":{verticalAlign:"top"},"&:hover":{color:C}},"&:hover":{[`${e}-clear`]:{opacity:1},[`${e}-suffix:not(:last-child)`]:{opacity:0}},[`${e}-separator`]:{position:"relative",display:"inline-block",width:"1em",height:p,color:u,fontSize:p,verticalAlign:"top",cursor:"default",[`${e}-focused &`]:{color:C},[`${e}-range-separator &`]:{[`${e}-disabled &`]:{cursor:"not-allowed"}}},"&-range":{position:"relative",display:"inline-flex",[`${e}-active-bar`]:{bottom:t.calc(i).mul(-1).equal(),height:P,background:v,opacity:0,transition:`all ${T} ease-out`,pointerEvents:"none"},[`&${e}-focused`]:{[`${e}-active-bar`]:{opacity:1}},[`${e}-range-separator`]:{alignItems:"center",padding:`0 ${Nt(w)}`,lineHeight:1}},"&-range, &-multiple":{[`${e}-clear`]:{insetInlineEnd:r},[`&${e}-small`]:{[`${e}-clear`]:{insetInlineEnd:y}}},"&-dropdown":Object.assign(Object.assign(Object.assign({},ja(t)),dWt(t)),{pointerEvents:"none",position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:A,[`&${e}-dropdown-hidden`]:{display:"none"},[`&${e}-dropdown-placement-bottomLeft`]:{[`${e}-range-arrow`]:{top:0,display:"block",transform:"translateY(-100%)"}},[`&${e}-dropdown-placement-topLeft`]:{[`${e}-range-arrow`]:{bottom:0,display:"block",transform:"translateY(100%) rotate(180deg)"}},[`&${n}-slide-up-enter${n}-slide-up-enter-active${e}-dropdown-placement-topLeft, &${n}-slide-up-enter${n}-slide-up-enter-active${e}-dropdown-placement-topRight, &${n}-slide-up-appear${n}-slide-up-appear-active${e}-dropdown-placement-topLeft, &${n}-slide-up-appear${n}-slide-up-appear-active${e}-dropdown-placement-topRight`]:{animationName:B$},[`&${n}-slide-up-enter${n}-slide-up-enter-active${e}-dropdown-placement-bottomLeft, @@ -4590,34 +4590,34 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho &${n}-slide-up-appear${n}-slide-up-appear-active${e}-dropdown-placement-bottomRight`]:{animationName:U$},[`&${n}-slide-up-leave ${e}-panel-container`]:{pointerEvents:"none"},[`&${n}-slide-up-leave${n}-slide-up-leave-active${e}-dropdown-placement-topLeft, &${n}-slide-up-leave${n}-slide-up-leave-active${e}-dropdown-placement-topRight`]:{animationName:Y$},[`&${n}-slide-up-leave${n}-slide-up-leave-active${e}-dropdown-placement-bottomLeft, &${n}-slide-up-leave${n}-slide-up-leave-active${e}-dropdown-placement-bottomRight`]:{animationName:j$},[`${e}-panel > ${e}-time-panel`]:{paddingTop:x},[`${e}-range-wrapper`]:{display:"flex",position:"relative"},[`${e}-range-arrow`]:Object.assign(Object.assign({position:"absolute",zIndex:1,display:"none",paddingInline:t.calc(r).mul(1.5).equal(),boxSizing:"content-box",transition:`left ${T} ease-out`},OGe(t,R,N)),{"&:before":{insetInlineStart:t.calc(r).mul(1.5).equal()}}),[`${e}-panel-container`]:{overflow:"hidden",verticalAlign:"top",background:R,borderRadius:M,boxShadow:D,transition:`margin ${T}`,display:"inline-block",pointerEvents:"auto",[`${e}-panel-layout`]:{display:"flex",flexWrap:"nowrap",alignItems:"stretch"},[`${e}-presets`]:{display:"flex",flexDirection:"column",minWidth:L,maxWidth:k,ul:{height:0,flex:"auto",listStyle:"none",overflow:"auto",margin:0,padding:w,borderInlineEnd:`${Nt(i)} ${a} ${W}`,li:Object.assign(Object.assign({},Gx),{borderRadius:E,paddingInline:w,paddingBlock:t.calc(g).sub(F).div(2).equal(),cursor:"pointer",transition:`all ${T}`,"+ li":{marginTop:b},"&:hover":{background:j}})}},[`${e}-panels`]:{display:"inline-flex",flexWrap:"nowrap",direction:"ltr","&:last-child":{[`${e}-panel`]:{borderWidth:0}}},[`${e}-panel`]:{verticalAlign:"top",background:"transparent",borderRadius:0,borderWidth:0,[`${e}-content, - table`]:{textAlign:"center"},"&-focused":{borderColor:l}}}}),"&-dropdown-range":{padding:`${Nt(t.calc(S).mul(2).div(3).equal())} 0`,"&-hidden":{display:"none"}},"&-rtl":{direction:"rtl",[`${e}-separator`]:{transform:"rotate(180deg)"},[`${e}-footer`]:{"&-extra":{direction:"rtl"}}}})},O9(t,"slide-up"),O9(t,"slide-down"),wR(t,"move-up"),wR(t,"move-down")]},lJe=wl("DatePicker",t=>{const e=Ki(GW(t),hWt(t),{inputPaddingHorizontalBase:t.calc(t.paddingSM).sub(1).equal(),multipleSelectItemHeight:t.multipleItemHeight,selectHeight:t.controlHeight});return[fWt(e),AWt(e),mWt(e),yWt(e),cWt(e),FW(t,{focusElCls:`${t.componentCls}-focused`})]},gWt);var wWt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM288 604a64 64 0 10128 0 64 64 0 10-128 0zm118-224a48 48 0 1096 0 48 48 0 10-96 0zm158 228a96 96 0 10192 0 96 96 0 10-192 0zm148-314a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"dot-chart",theme:"outlined"},vWt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:wWt}))},xWt=m.forwardRef(vWt),bWt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},SWt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:bWt}))},TWt=m.forwardRef(SWt);function R9(){return R9=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&(n[r]=t[r]);return n}function _G(t,e){if(t==null)return{};var n=IWt(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}const lQ=m.createContext(null);function zWt(t){if(Array.isArray(t))return uue(t)}function DWt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function EWt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sxe(t){return zWt(t)||DWt(t)||sJe(t)||EWt()}var FWt=function(e){var n=e.activeTabOffset,o=e.horizontal,r=e.rtl,i=e.indicator,a=i===void 0?{}:i,l=a.size,s=a.align,c=s===void 0?"center":s,u=m.useState(),d=Wc(u,2),f=d[0],p=d[1],g=m.useRef(),y=be.useCallback(function(b){return typeof l=="function"?l(b):typeof l=="number"?l:b},[l]);function w(){Fa.cancel(g.current)}return m.useEffect(function(){var b={};if(n)if(o){b.width=y(n.width);var C=r?"right":"left";c==="start"&&(b[C]=n[C]),c==="center"&&(b[C]=n[C]+n.width/2,b.transform=r?"translateX(50%)":"translateX(-50%)"),c==="end"&&(b[C]=n[C]+n.width,b.transform="translateX(-100%)")}else b.height=y(n.height),c==="start"&&(b.top=n.top),c==="center"&&(b.top=n.top+n.height/2,b.transform="translateY(-50%)"),c==="end"&&(b.top=n.top+n.height,b.transform="translateY(-100%)");return w(),g.current=Fa(function(){p(b)}),w},[n,o,r,c,y]),{style:f}},cxe={width:0,height:0,left:0,top:0};function kWt(t,e,n){return m.useMemo(function(){for(var o,r=new Map,i=e.get((o=t[0])===null||o===void 0?void 0:o.key)||cxe,a=i.left+i.width,l=0;lj?(E=M,A.current="x"):(E=D,A.current="y"),e(-E,-E)&&R.preventDefault()}var S=m.useRef(null);S.current={onTouchStart:P,onTouchMove:v,onTouchEnd:T,onWheel:x},m.useEffect(function(){function R(W){S.current.onTouchStart(W)}function M(W){S.current.onTouchMove(W)}function D(W){S.current.onTouchEnd(W)}function E(W){S.current.onWheel(W)}return document.addEventListener("touchmove",M,{passive:!1}),document.addEventListener("touchend",D,{passive:!1}),t.current.addEventListener("touchstart",R,{passive:!1}),t.current.addEventListener("wheel",E),function(){document.removeEventListener("touchmove",M),document.removeEventListener("touchend",D)}},[])}function cJe(t){var e=m.useState(0),n=Wc(e,2),o=n[0],r=n[1],i=m.useRef(0),a=m.useRef();return a.current=t,fx(function(){var l;(l=a.current)===null||l===void 0||l.call(a)},[o]),function(){i.current===o&&(i.current+=1,r(i.current))}}function NWt(t){var e=m.useRef([]),n=m.useState({}),o=Wc(n,2),r=o[1],i=m.useRef(typeof t=="function"?t():t),a=cJe(function(){var s=i.current;e.current.forEach(function(c){s=c(s)}),e.current=[],i.current=s,r({})});function l(s){e.current.push(s),a()}return[i.current,l]}var hxe={width:0,height:0,left:0,top:0,right:0};function UWt(t,e,n,o,r,i,a){var l=a.tabs,s=a.tabPosition,c=a.rtl,u,d,f;return["top","bottom"].includes(s)?(u="width",d=c?"right":"left",f=Math.abs(n)):(u="height",d="top",f=-n),m.useMemo(function(){if(!l.length)return[0,0];for(var p=l.length,g=p,y=0;yf+e){g=y-1;break}}for(var b=0,C=p-1;C>=0;C-=1){var P=t.get(l[C].key)||hxe;if(P[d]=g?[0,0]:[b,g]},[t,e,o,r,i,f,s,l.map(function(p){return p.key}).join("_"),c])}function pxe(t){var e;return t instanceof Map?(e={},t.forEach(function(n,o){e[o]=n})):e=t,JSON.stringify(e)}var jWt="TABS_DQ";function uJe(t){return String(t).replace(/"/g,jWt)}function dJe(t,e,n,o){return!(!n||o||t===!1||t===void 0&&(e===!1||e===null))}var fJe=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.editable,r=t.locale,i=t.style;return!o||o.showAdd===!1?null:m.createElement("button",{ref:e,type:"button",className:"".concat(n,"-nav-add"),style:i,"aria-label":(r==null?void 0:r.addAriaLabel)||"Add tab",onClick:function(l){o.onEdit("add",{event:l})}},o.addIcon||"+")}),gxe=m.forwardRef(function(t,e){var n=t.position,o=t.prefixCls,r=t.extra;if(!r)return null;var i,a={};return uw(r)==="object"&&!m.isValidElement(r)?a=r:a.right=r,n==="right"&&(i=a.right),n==="left"&&(i=a.left),i?m.createElement("div",{className:"".concat(o,"-extra-content"),ref:e},i):null}),BWt=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.id,r=t.tabs,i=t.locale,a=t.mobile,l=t.more,s=l===void 0?{}:l,c=t.style,u=t.className,d=t.editable,f=t.tabBarGutter,p=t.rtl,g=t.removeAriaLabel,y=t.onTabClick,w=t.getPopupContainer,b=t.popupClassName,C=m.useState(!1),P=Wc(C,2),v=P[0],T=P[1],A=m.useState(null),x=Wc(A,2),S=x[0],R=x[1],M=s.icon,D=M===void 0?"More":M,E="".concat(o,"-more-popup"),W="".concat(n,"-dropdown"),j=S!==null?"".concat(E,"-").concat(S):null,L=i==null?void 0:i.dropdownAriaLabel;function k(X,$){X.preventDefault(),X.stopPropagation(),d.onEdit("remove",{key:$,event:X})}var N=m.createElement(OH,{onClick:function($){var Q=$.key,le=$.domEvent;y(Q,le),T(!1)},prefixCls:"".concat(W,"-menu"),id:E,tabIndex:-1,role:"listbox","aria-activedescendant":j,selectedKeys:[S],"aria-label":L!==void 0?L:"expanded dropdown"},r.map(function(X){var $=X.closable,Q=X.disabled,le=X.closeIcon,q=X.key,te=X.label,re=dJe($,le,d,Q);return m.createElement(_W,{key:q,id:"".concat(E,"-").concat(q),role:"option","aria-controls":o&&"".concat(o,"-panel-").concat(q),disabled:Q},m.createElement("span",null,te),re&&m.createElement("button",{type:"button","aria-label":g||"remove",tabIndex:0,className:"".concat(W,"-menu-item-remove"),onClick:function(se){se.stopPropagation(),k(se,q)}},le||d.removeIcon||"×"))}));function F(X){for(var $=r.filter(function(re){return!re.disabled}),Q=$.findIndex(function(re){return re.key===S})||0,le=$.length,q=0;qdt?"left":"right"})}),W=Wc(E,2),j=W[0],L=W[1],k=uxe(0,function(gt,dt){!D&&y&&y({direction:gt>dt?"top":"bottom"})}),N=Wc(k,2),F=N[0],U=N[1],O=m.useState([0,0]),B=Wc(O,2),_=B[0],X=B[1],$=m.useState([0,0]),Q=Wc($,2),le=Q[0],q=Q[1],te=m.useState([0,0]),re=Wc(te,2),ae=re[0],se=re[1],ne=m.useState([0,0]),fe=Wc(ne,2),ge=fe[0],de=fe[1],Z=NWt(new Map),he=Wc(Z,2),xe=he[0],He=he[1],Se=kWt(P,xe,le[0]),ze=kY(_,D),Ie=kY(le,D),ye=kY(ae,D),ce=kY(ge,D),pe=zeMe?Me:gt}var Ee=m.useRef(null),Be=m.useState(),Je=Wc(Be,2),We=Je[0],Ke=Je[1];function Ne(){Ke(Date.now())}function De(){Ee.current&&clearTimeout(Ee.current)}WWt(x,function(gt,dt){function Ct(tt,Fe){tt(function(qe){var je=Pe(qe+Fe);return je})}return pe?(D?Ct(L,gt):Ct(U,dt),De(),Ne(),!0):!1}),m.useEffect(function(){return De(),We&&(Ee.current=setTimeout(function(){Ke(0)},100)),De},[We]);var ke=UWt(Se,ve,D?j:F,Ie,ye,ce,Nm(Nm({},t),{},{tabs:P})),Ye=Wc(ke,2),it=Ye[0],Ve=Ye[1],yt=Ea(function(){var gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:a,dt=Se.get(gt)||{width:0,height:0,left:0,right:0,top:0};if(D){var Ct=j;l?dt.rightj+ve&&(Ct=dt.right+dt.width-ve):dt.left<-j?Ct=-dt.left:dt.left+dt.width>-j+ve&&(Ct=-(dt.left+dt.width-ve)),U(0),L(Pe(Ct))}else{var tt=F;dt.top<-F?tt=-dt.top:dt.top+dt.height>-F+ve&&(tt=-(dt.top+dt.height-ve)),L(0),U(Pe(tt))}}),ct={};d==="top"||d==="bottom"?ct[l?"marginRight":"marginLeft"]=f:ct.marginTop=f;var Xe=P.map(function(gt,dt){var Ct=gt.key;return m.createElement(OWt,{id:r,prefixCls:C,key:Ct,tab:gt,style:dt===0?void 0:ct,closable:gt.closable,editable:c,active:Ct===a,renderWrapper:p,removeAriaLabel:u==null?void 0:u.removeAriaLabel,onClick:function(Fe){g(Ct,Fe)},onFocus:function(){yt(Ct),Ne(),x.current&&(l||(x.current.scrollLeft=0),x.current.scrollTop=0)}})}),ut=function(){return He(function(){var dt,Ct=new Map,tt=(dt=S.current)===null||dt===void 0?void 0:dt.getBoundingClientRect();return P.forEach(function(Fe){var qe,je=Fe.key,rt=(qe=S.current)===null||qe===void 0?void 0:qe.querySelector('[data-node-key="'.concat(uJe(je),'"]'));if(rt){var mt=_Wt(rt,tt),Qe=Wc(mt,4),Tt=Qe[0],Dt=Qe[1],lt=Qe[2],zt=Qe[3];Ct.set(je,{width:Tt,height:Dt,left:lt,top:zt})}}),Ct})};m.useEffect(function(){ut()},[P.map(function(gt){return gt.key}).join("_")]);var ft=cJe(function(){var gt=LT(v),dt=LT(T),Ct=LT(A);X([gt[0]-dt[0]-Ct[0],gt[1]-dt[1]-Ct[1]]);var tt=LT(M);se(tt);var Fe=LT(R);de(Fe);var qe=LT(S);q([qe[0]-tt[0],qe[1]-tt[1]]),ut()}),ot=P.slice(0,it),st=P.slice(Ve+1),at=[].concat(sxe(ot),sxe(st)),Oe=Se.get(a),Ze=FWt({activeTabOffset:Oe,horizontal:D,indicator:w,rtl:l}),St=Ze.style;m.useEffect(function(){yt()},[a,Te,Me,pxe(Oe),pxe(Se),D]),m.useEffect(function(){ft()},[l]);var Pt=!!at.length,Rt="".concat(C,"-nav-wrap"),Ut,Ht,At,kt;return D?l?(Ht=j>0,Ut=j!==Me):(Ut=j<0,Ht=j!==Te):(At=F<0,kt=F!==Te),m.createElement(Td,{onResize:ft},m.createElement("div",{ref:Fw(e,v),role:"tablist",className:Vn("".concat(C,"-nav"),n),style:o,onKeyDown:function(){Ne()}},m.createElement(gxe,{ref:T,position:"left",extra:s,prefixCls:C}),m.createElement(Td,{onResize:ft},m.createElement("div",{className:Vn(Rt,tp(tp(tp(tp({},"".concat(Rt,"-ping-left"),Ut),"".concat(Rt,"-ping-right"),Ht),"".concat(Rt,"-ping-top"),At),"".concat(Rt,"-ping-bottom"),kt)),ref:x},m.createElement(Td,{onResize:ft},m.createElement("div",{ref:S,className:"".concat(C,"-nav-list"),style:{transform:"translate(".concat(j,"px, ").concat(F,"px)"),transition:We?"none":void 0}},Xe,m.createElement(fJe,{ref:M,prefixCls:C,locale:u,editable:c,style:Nm(Nm({},Xe.length===0?void 0:ct),{},{visibility:Pt?"hidden":null})}),m.createElement("div",{className:Vn("".concat(C,"-ink-bar"),tp({},"".concat(C,"-ink-bar-animated"),i.inkBar)),style:St}))))),m.createElement(YWt,R9({},t,{removeAriaLabel:u==null?void 0:u.removeAriaLabel,ref:R,prefixCls:C,tabs:at,className:!Pt&&Ae,tabMoving:!!We})),m.createElement(gxe,{ref:A,position:"right",extra:s,prefixCls:C})))}),hJe=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.className,r=t.style,i=t.id,a=t.active,l=t.tabKey,s=t.children;return m.createElement("div",{id:i&&"".concat(i,"-panel-").concat(l),role:"tabpanel",tabIndex:a?0:-1,"aria-labelledby":i&&"".concat(i,"-tab-").concat(l),"aria-hidden":!a,style:r,className:Vn(n,a&&"".concat(n,"-active"),o),ref:e},s)}),VWt=["renderTabBar"],GWt=["label","key"],XWt=function(e){var n=e.renderTabBar,o=_G(e,VWt),r=m.useContext(lQ),i=r.tabs;if(n){var a=Nm(Nm({},o),{},{panes:i.map(function(l){var s=l.label,c=l.key,u=_G(l,GWt);return m.createElement(hJe,R9({tab:s,key:c,tabKey:c},u))})});return n(a,mxe)}return m.createElement(mxe,o)},JWt=["key","forceRender","style","className","destroyInactiveTabPane"],KWt=function(e){var n=e.id,o=e.activeKey,r=e.animated,i=e.tabPosition,a=e.destroyInactiveTabPane,l=m.useContext(lQ),s=l.prefixCls,c=l.tabs,u=r.tabPane,d="".concat(s,"-tabpane");return m.createElement("div",{className:Vn("".concat(s,"-content-holder"))},m.createElement("div",{className:Vn("".concat(s,"-content"),"".concat(s,"-content-").concat(i),tp({},"".concat(s,"-content-animated"),u))},c.map(function(f){var p=f.key,g=f.forceRender,y=f.style,w=f.className,b=f.destroyInactiveTabPane,C=_G(f,JWt),P=p===o;return m.createElement(o1,R9({key:p,visible:P,forceRender:g,removeOnLeave:!!(a||b),leavedClassName:"".concat(d,"-hidden")},r.tabPaneMotion),function(v,T){var A=v.style,x=v.className;return m.createElement(hJe,R9({},C,{prefixCls:d,id:n,tabKey:p,animated:u,active:P,style:Nm(Nm({},y),A),className:Vn(w,x),ref:T}))})})))};function qWt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},e;return t===!1?e={inkBar:!1,tabPane:!1}:t===!0?e={inkBar:!0,tabPane:!1}:e=Nm({inkBar:!0},uw(t)==="object"?t:{}),e.tabPaneMotion&&e.tabPane===void 0&&(e.tabPane=!0),!e.tabPaneMotion&&e.tabPane&&(e.tabPane=!1),e}var $Wt=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","more","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],yxe=0,QWt=m.forwardRef(function(t,e){var n=t.id,o=t.prefixCls,r=o===void 0?"rc-tabs":o,i=t.className,a=t.items,l=t.direction,s=t.activeKey,c=t.defaultActiveKey,u=t.editable,d=t.animated,f=t.tabPosition,p=f===void 0?"top":f,g=t.tabBarGutter,y=t.tabBarStyle,w=t.tabBarExtraContent,b=t.locale,C=t.more,P=t.destroyInactiveTabPane,v=t.renderTabBar,T=t.onChange,A=t.onTabClick,x=t.onTabScroll,S=t.getPopupContainer,R=t.popupClassName,M=t.indicator,D=_G(t,$Wt),E=m.useMemo(function(){return(a||[]).filter(function(ge){return ge&&uw(ge)==="object"&&"key"in ge})},[a]),W=l==="rtl",j=qWt(d),L=m.useState(!1),k=Wc(L,2),N=k[0],F=k[1];m.useEffect(function(){F(O$())},[]);var U=zs(function(){var ge;return(ge=E[0])===null||ge===void 0?void 0:ge.key},{value:s,defaultValue:c}),O=Wc(U,2),B=O[0],_=O[1],X=m.useState(function(){return E.findIndex(function(ge){return ge.key===B})}),$=Wc(X,2),Q=$[0],le=$[1];m.useEffect(function(){var ge=E.findIndex(function(Z){return Z.key===B});if(ge===-1){var de;ge=Math.max(0,Math.min(Q,E.length-1)),_((de=E[ge])===null||de===void 0?void 0:de.key)}le(ge)},[E.map(function(ge){return ge.key}).join("_"),B,Q]);var q=zs(null,{value:n}),te=Wc(q,2),re=te[0],ae=te[1];m.useEffect(function(){n||(ae("rc-tabs-".concat(yxe)),yxe+=1)},[]);function se(ge,de){A==null||A(ge,de);var Z=ge!==B;_(ge),Z&&(T==null||T(ge))}var ne={id:re,activeKey:B,animated:j,tabPosition:p,rtl:W,mobile:N},fe=Nm(Nm({},ne),{},{editable:u,locale:b,more:C,tabBarGutter:g,onTabClick:se,onTabScroll:x,extra:w,style:y,panes:null,getPopupContainer:S,popupClassName:R,indicator:M});return m.createElement(lQ.Provider,{value:{tabs:E,prefixCls:r}},m.createElement("div",R9({ref:e,id:n,className:Vn(r,"".concat(r,"-").concat(p),tp(tp(tp({},"".concat(r,"-mobile"),N),"".concat(r,"-editable"),u),"".concat(r,"-rtl"),W),i)},D),m.createElement(XWt,R9({},fe,{renderTabBar:v})),m.createElement(KWt,R9({destroyInactiveTabPane:P},ne,{animated:j}))))});const ZWt={motionAppear:!1,motionEnter:!0,motionLeave:!0};function eNt(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},n;return e===!1?n={inkBar:!1,tabPane:!1}:e===!0?n={inkBar:!0,tabPane:!0}:n=Object.assign({inkBar:!0},typeof e=="object"?e:{}),n.tabPane&&(n.tabPaneMotion=Object.assign(Object.assign({},ZWt),{motionName:j9(t,"switch")})),n}var tNt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);re)}function oNt(t,e){if(t)return t;const n=B9(e).map(o=>{if(m.isValidElement(o)){const{key:r,props:i}=o,a=i||{},{tab:l}=a,s=tNt(a,["tab"]);return Object.assign(Object.assign({key:String(r)},s),{label:l})}return null});return nNt(n)}const rNt=t=>{const{componentCls:e,motionDurationSlow:n}=t;return[{[e]:{[`${e}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${n}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${n}`}}}}},[O9(t,"slide-up"),O9(t,"slide-down")]]},iNt=t=>{const{componentCls:e,tabsCardPadding:n,cardBg:o,cardGutter:r,colorBorderSecondary:i,itemSelectedColor:a}=t;return{[`${e}-card`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{margin:0,padding:n,background:o,border:`${Nt(t.lineWidth)} ${t.lineType} ${i}`,transition:`all ${t.motionDurationSlow} ${t.motionEaseInOut}`},[`${e}-tab-active`]:{color:a,background:t.colorBgContainer},[`${e}-ink-bar`]:{visibility:"hidden"}},[`&${e}-top, &${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginLeft:{_skip_check_:!0,value:Nt(r)}}}},[`&${e}-top`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:`${Nt(t.borderRadiusLG)} ${Nt(t.borderRadiusLG)} 0 0`},[`${e}-tab-active`]:{borderBottomColor:t.colorBgContainer}}},[`&${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:`0 0 ${Nt(t.borderRadiusLG)} ${Nt(t.borderRadiusLG)}`},[`${e}-tab-active`]:{borderTopColor:t.colorBgContainer}}},[`&${e}-left, &${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginTop:Nt(r)}}},[`&${e}-left`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Nt(t.borderRadiusLG)} 0 0 ${Nt(t.borderRadiusLG)}`}},[`${e}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:t.colorBgContainer}}}},[`&${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Nt(t.borderRadiusLG)} ${Nt(t.borderRadiusLG)} 0`}},[`${e}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:t.colorBgContainer}}}}}}},aNt=t=>{const{componentCls:e,itemHoverColor:n,dropdownEdgeChildVerticalPadding:o}=t;return{[`${e}-dropdown`]:Object.assign(Object.assign({},ja(t)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:t.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${e}-dropdown-menu`]:{maxHeight:t.tabsDropdownHeight,margin:0,padding:`${Nt(o)} 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:t.colorBgContainer,backgroundClip:"padding-box",borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,"&-item":Object.assign(Object.assign({},Gx),{display:"flex",alignItems:"center",minWidth:t.tabsDropdownWidth,margin:0,padding:`${Nt(t.paddingXXS)} ${Nt(t.paddingSM)}`,color:t.colorText,fontWeight:"normal",fontSize:t.fontSize,lineHeight:t.lineHeight,cursor:"pointer",transition:`all ${t.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:t.marginSM},color:t.colorTextDescription,fontSize:t.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:n}},"&:hover":{background:t.controlItemBgHover},"&-disabled":{"&, &:hover":{color:t.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},lNt=t=>{const{componentCls:e,margin:n,colorBorderSecondary:o,horizontalMargin:r,verticalItemPadding:i,verticalItemMargin:a,calc:l}=t;return{[`${e}-top, ${e}-bottom`]:{flexDirection:"column",[`> ${e}-nav, > div > ${e}-nav`]:{margin:r,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${Nt(t.lineWidth)} ${t.lineType} ${o}`,content:"''"},[`${e}-ink-bar`]:{height:t.lineWidthBold,"&-animated":{transition:`width ${t.motionDurationSlow}, left ${t.motionDurationSlow}, + table`]:{textAlign:"center"},"&-focused":{borderColor:l}}}}),"&-dropdown-range":{padding:`${Nt(t.calc(S).mul(2).div(3).equal())} 0`,"&-hidden":{display:"none"}},"&-rtl":{direction:"rtl",[`${e}-separator`]:{transform:"rotate(180deg)"},[`${e}-footer`]:{"&-extra":{direction:"rtl"}}}})},O9(t,"slide-up"),O9(t,"slide-down"),wR(t,"move-up"),wR(t,"move-down")]},lJe=wl("DatePicker",t=>{const e=Ki(XW(t),hWt(t),{inputPaddingHorizontalBase:t.calc(t.paddingSM).sub(1).equal(),multipleSelectItemHeight:t.multipleItemHeight,selectHeight:t.controlHeight});return[fWt(e),AWt(e),mWt(e),yWt(e),cWt(e),kW(t,{focusElCls:`${t.componentCls}-focused`})]},gWt);var wWt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM288 604a64 64 0 10128 0 64 64 0 10-128 0zm118-224a48 48 0 1096 0 48 48 0 10-96 0zm158 228a96 96 0 10192 0 96 96 0 10-192 0zm148-314a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"dot-chart",theme:"outlined"},vWt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:wWt}))},xWt=m.forwardRef(vWt),bWt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},SWt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:bWt}))},TWt=m.forwardRef(SWt);function R9(){return R9=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&(n[r]=t[r]);return n}function VG(t,e){if(t==null)return{};var n=IWt(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}const lQ=m.createContext(null);function zWt(t){if(Array.isArray(t))return uue(t)}function DWt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function EWt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cxe(t){return zWt(t)||DWt(t)||sJe(t)||EWt()}var FWt=function(e){var n=e.activeTabOffset,o=e.horizontal,r=e.rtl,i=e.indicator,a=i===void 0?{}:i,l=a.size,s=a.align,c=s===void 0?"center":s,u=m.useState(),d=Wc(u,2),f=d[0],p=d[1],g=m.useRef(),y=be.useCallback(function(b){return typeof l=="function"?l(b):typeof l=="number"?l:b},[l]);function w(){Fa.cancel(g.current)}return m.useEffect(function(){var b={};if(n)if(o){b.width=y(n.width);var C=r?"right":"left";c==="start"&&(b[C]=n[C]),c==="center"&&(b[C]=n[C]+n.width/2,b.transform=r?"translateX(50%)":"translateX(-50%)"),c==="end"&&(b[C]=n[C]+n.width,b.transform="translateX(-100%)")}else b.height=y(n.height),c==="start"&&(b.top=n.top),c==="center"&&(b.top=n.top+n.height/2,b.transform="translateY(-50%)"),c==="end"&&(b.top=n.top+n.height,b.transform="translateY(-100%)");return w(),g.current=Fa(function(){p(b)}),w},[n,o,r,c,y]),{style:f}},uxe={width:0,height:0,left:0,top:0};function kWt(t,e,n){return m.useMemo(function(){for(var o,r=new Map,i=e.get((o=t[0])===null||o===void 0?void 0:o.key)||uxe,a=i.left+i.width,l=0;lj?(E=M,A.current="x"):(E=D,A.current="y"),e(-E,-E)&&R.preventDefault()}var S=m.useRef(null);S.current={onTouchStart:P,onTouchMove:v,onTouchEnd:T,onWheel:x},m.useEffect(function(){function R(W){S.current.onTouchStart(W)}function M(W){S.current.onTouchMove(W)}function D(W){S.current.onTouchEnd(W)}function E(W){S.current.onWheel(W)}return document.addEventListener("touchmove",M,{passive:!1}),document.addEventListener("touchend",D,{passive:!1}),t.current.addEventListener("touchstart",R,{passive:!1}),t.current.addEventListener("wheel",E),function(){document.removeEventListener("touchmove",M),document.removeEventListener("touchend",D)}},[])}function cJe(t){var e=m.useState(0),n=Wc(e,2),o=n[0],r=n[1],i=m.useRef(0),a=m.useRef();return a.current=t,fx(function(){var l;(l=a.current)===null||l===void 0||l.call(a)},[o]),function(){i.current===o&&(i.current+=1,r(i.current))}}function NWt(t){var e=m.useRef([]),n=m.useState({}),o=Wc(n,2),r=o[1],i=m.useRef(typeof t=="function"?t():t),a=cJe(function(){var s=i.current;e.current.forEach(function(c){s=c(s)}),e.current=[],i.current=s,r({})});function l(s){e.current.push(s),a()}return[i.current,l]}var pxe={width:0,height:0,left:0,top:0,right:0};function UWt(t,e,n,o,r,i,a){var l=a.tabs,s=a.tabPosition,c=a.rtl,u,d,f;return["top","bottom"].includes(s)?(u="width",d=c?"right":"left",f=Math.abs(n)):(u="height",d="top",f=-n),m.useMemo(function(){if(!l.length)return[0,0];for(var p=l.length,g=p,y=0;yf+e){g=y-1;break}}for(var b=0,C=p-1;C>=0;C-=1){var P=t.get(l[C].key)||pxe;if(P[d]=g?[0,0]:[b,g]},[t,e,o,r,i,f,s,l.map(function(p){return p.key}).join("_"),c])}function gxe(t){var e;return t instanceof Map?(e={},t.forEach(function(n,o){e[o]=n})):e=t,JSON.stringify(e)}var jWt="TABS_DQ";function uJe(t){return String(t).replace(/"/g,jWt)}function dJe(t,e,n,o){return!(!n||o||t===!1||t===void 0&&(e===!1||e===null))}var fJe=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.editable,r=t.locale,i=t.style;return!o||o.showAdd===!1?null:m.createElement("button",{ref:e,type:"button",className:"".concat(n,"-nav-add"),style:i,"aria-label":(r==null?void 0:r.addAriaLabel)||"Add tab",onClick:function(l){o.onEdit("add",{event:l})}},o.addIcon||"+")}),mxe=m.forwardRef(function(t,e){var n=t.position,o=t.prefixCls,r=t.extra;if(!r)return null;var i,a={};return uw(r)==="object"&&!m.isValidElement(r)?a=r:a.right=r,n==="right"&&(i=a.right),n==="left"&&(i=a.left),i?m.createElement("div",{className:"".concat(o,"-extra-content"),ref:e},i):null}),BWt=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.id,r=t.tabs,i=t.locale,a=t.mobile,l=t.more,s=l===void 0?{}:l,c=t.style,u=t.className,d=t.editable,f=t.tabBarGutter,p=t.rtl,g=t.removeAriaLabel,y=t.onTabClick,w=t.getPopupContainer,b=t.popupClassName,C=m.useState(!1),P=Wc(C,2),v=P[0],T=P[1],A=m.useState(null),x=Wc(A,2),S=x[0],R=x[1],M=s.icon,D=M===void 0?"More":M,E="".concat(o,"-more-popup"),W="".concat(n,"-dropdown"),j=S!==null?"".concat(E,"-").concat(S):null,L=i==null?void 0:i.dropdownAriaLabel;function k(X,$){X.preventDefault(),X.stopPropagation(),d.onEdit("remove",{key:$,event:X})}var N=m.createElement(OH,{onClick:function($){var Q=$.key,le=$.domEvent;y(Q,le),T(!1)},prefixCls:"".concat(W,"-menu"),id:E,tabIndex:-1,role:"listbox","aria-activedescendant":j,selectedKeys:[S],"aria-label":L!==void 0?L:"expanded dropdown"},r.map(function(X){var $=X.closable,Q=X.disabled,le=X.closeIcon,q=X.key,te=X.label,re=dJe($,le,d,Q);return m.createElement(VW,{key:q,id:"".concat(E,"-").concat(q),role:"option","aria-controls":o&&"".concat(o,"-panel-").concat(q),disabled:Q},m.createElement("span",null,te),re&&m.createElement("button",{type:"button","aria-label":g||"remove",tabIndex:0,className:"".concat(W,"-menu-item-remove"),onClick:function(se){se.stopPropagation(),k(se,q)}},le||d.removeIcon||"×"))}));function F(X){for(var $=r.filter(function(re){return!re.disabled}),Q=$.findIndex(function(re){return re.key===S})||0,le=$.length,q=0;qdt?"left":"right"})}),W=Wc(E,2),j=W[0],L=W[1],k=dxe(0,function(gt,dt){!D&&y&&y({direction:gt>dt?"top":"bottom"})}),N=Wc(k,2),F=N[0],U=N[1],O=m.useState([0,0]),B=Wc(O,2),_=B[0],X=B[1],$=m.useState([0,0]),Q=Wc($,2),le=Q[0],q=Q[1],te=m.useState([0,0]),re=Wc(te,2),ae=re[0],se=re[1],ne=m.useState([0,0]),fe=Wc(ne,2),ge=fe[0],de=fe[1],Z=NWt(new Map),he=Wc(Z,2),xe=he[0],He=he[1],Se=kWt(P,xe,le[0]),ze=LY(_,D),Ie=LY(le,D),ye=LY(ae,D),ce=LY(ge,D),pe=zeMe?Me:gt}var Ee=m.useRef(null),Be=m.useState(),Je=Wc(Be,2),We=Je[0],Ke=Je[1];function Ne(){Ke(Date.now())}function De(){Ee.current&&clearTimeout(Ee.current)}WWt(x,function(gt,dt){function Ct(tt,Fe){tt(function(qe){var je=Pe(qe+Fe);return je})}return pe?(D?Ct(L,gt):Ct(U,dt),De(),Ne(),!0):!1}),m.useEffect(function(){return De(),We&&(Ee.current=setTimeout(function(){Ke(0)},100)),De},[We]);var ke=UWt(Se,ve,D?j:F,Ie,ye,ce,Nm(Nm({},t),{},{tabs:P})),Ye=Wc(ke,2),it=Ye[0],Ve=Ye[1],yt=Ea(function(){var gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:a,dt=Se.get(gt)||{width:0,height:0,left:0,right:0,top:0};if(D){var Ct=j;l?dt.rightj+ve&&(Ct=dt.right+dt.width-ve):dt.left<-j?Ct=-dt.left:dt.left+dt.width>-j+ve&&(Ct=-(dt.left+dt.width-ve)),U(0),L(Pe(Ct))}else{var tt=F;dt.top<-F?tt=-dt.top:dt.top+dt.height>-F+ve&&(tt=-(dt.top+dt.height-ve)),L(0),U(Pe(tt))}}),ct={};d==="top"||d==="bottom"?ct[l?"marginRight":"marginLeft"]=f:ct.marginTop=f;var Xe=P.map(function(gt,dt){var Ct=gt.key;return m.createElement(OWt,{id:r,prefixCls:C,key:Ct,tab:gt,style:dt===0?void 0:ct,closable:gt.closable,editable:c,active:Ct===a,renderWrapper:p,removeAriaLabel:u==null?void 0:u.removeAriaLabel,onClick:function(Fe){g(Ct,Fe)},onFocus:function(){yt(Ct),Ne(),x.current&&(l||(x.current.scrollLeft=0),x.current.scrollTop=0)}})}),ut=function(){return He(function(){var dt,Ct=new Map,tt=(dt=S.current)===null||dt===void 0?void 0:dt.getBoundingClientRect();return P.forEach(function(Fe){var qe,je=Fe.key,rt=(qe=S.current)===null||qe===void 0?void 0:qe.querySelector('[data-node-key="'.concat(uJe(je),'"]'));if(rt){var mt=_Wt(rt,tt),Qe=Wc(mt,4),Tt=Qe[0],Dt=Qe[1],lt=Qe[2],zt=Qe[3];Ct.set(je,{width:Tt,height:Dt,left:lt,top:zt})}}),Ct})};m.useEffect(function(){ut()},[P.map(function(gt){return gt.key}).join("_")]);var ft=cJe(function(){var gt=LT(v),dt=LT(T),Ct=LT(A);X([gt[0]-dt[0]-Ct[0],gt[1]-dt[1]-Ct[1]]);var tt=LT(M);se(tt);var Fe=LT(R);de(Fe);var qe=LT(S);q([qe[0]-tt[0],qe[1]-tt[1]]),ut()}),ot=P.slice(0,it),st=P.slice(Ve+1),at=[].concat(cxe(ot),cxe(st)),Oe=Se.get(a),Ze=FWt({activeTabOffset:Oe,horizontal:D,indicator:w,rtl:l}),St=Ze.style;m.useEffect(function(){yt()},[a,Te,Me,gxe(Oe),gxe(Se),D]),m.useEffect(function(){ft()},[l]);var Pt=!!at.length,Rt="".concat(C,"-nav-wrap"),Ut,Ht,At,kt;return D?l?(Ht=j>0,Ut=j!==Me):(Ut=j<0,Ht=j!==Te):(At=F<0,kt=F!==Te),m.createElement(Td,{onResize:ft},m.createElement("div",{ref:Fw(e,v),role:"tablist",className:Vn("".concat(C,"-nav"),n),style:o,onKeyDown:function(){Ne()}},m.createElement(mxe,{ref:T,position:"left",extra:s,prefixCls:C}),m.createElement(Td,{onResize:ft},m.createElement("div",{className:Vn(Rt,tp(tp(tp(tp({},"".concat(Rt,"-ping-left"),Ut),"".concat(Rt,"-ping-right"),Ht),"".concat(Rt,"-ping-top"),At),"".concat(Rt,"-ping-bottom"),kt)),ref:x},m.createElement(Td,{onResize:ft},m.createElement("div",{ref:S,className:"".concat(C,"-nav-list"),style:{transform:"translate(".concat(j,"px, ").concat(F,"px)"),transition:We?"none":void 0}},Xe,m.createElement(fJe,{ref:M,prefixCls:C,locale:u,editable:c,style:Nm(Nm({},Xe.length===0?void 0:ct),{},{visibility:Pt?"hidden":null})}),m.createElement("div",{className:Vn("".concat(C,"-ink-bar"),tp({},"".concat(C,"-ink-bar-animated"),i.inkBar)),style:St}))))),m.createElement(YWt,R9({},t,{removeAriaLabel:u==null?void 0:u.removeAriaLabel,ref:R,prefixCls:C,tabs:at,className:!Pt&&Ae,tabMoving:!!We})),m.createElement(mxe,{ref:A,position:"right",extra:s,prefixCls:C})))}),hJe=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.className,r=t.style,i=t.id,a=t.active,l=t.tabKey,s=t.children;return m.createElement("div",{id:i&&"".concat(i,"-panel-").concat(l),role:"tabpanel",tabIndex:a?0:-1,"aria-labelledby":i&&"".concat(i,"-tab-").concat(l),"aria-hidden":!a,style:r,className:Vn(n,a&&"".concat(n,"-active"),o),ref:e},s)}),VWt=["renderTabBar"],GWt=["label","key"],XWt=function(e){var n=e.renderTabBar,o=VG(e,VWt),r=m.useContext(lQ),i=r.tabs;if(n){var a=Nm(Nm({},o),{},{panes:i.map(function(l){var s=l.label,c=l.key,u=VG(l,GWt);return m.createElement(hJe,R9({tab:s,key:c,tabKey:c},u))})});return n(a,yxe)}return m.createElement(yxe,o)},JWt=["key","forceRender","style","className","destroyInactiveTabPane"],KWt=function(e){var n=e.id,o=e.activeKey,r=e.animated,i=e.tabPosition,a=e.destroyInactiveTabPane,l=m.useContext(lQ),s=l.prefixCls,c=l.tabs,u=r.tabPane,d="".concat(s,"-tabpane");return m.createElement("div",{className:Vn("".concat(s,"-content-holder"))},m.createElement("div",{className:Vn("".concat(s,"-content"),"".concat(s,"-content-").concat(i),tp({},"".concat(s,"-content-animated"),u))},c.map(function(f){var p=f.key,g=f.forceRender,y=f.style,w=f.className,b=f.destroyInactiveTabPane,C=VG(f,JWt),P=p===o;return m.createElement(o1,R9({key:p,visible:P,forceRender:g,removeOnLeave:!!(a||b),leavedClassName:"".concat(d,"-hidden")},r.tabPaneMotion),function(v,T){var A=v.style,x=v.className;return m.createElement(hJe,R9({},C,{prefixCls:d,id:n,tabKey:p,animated:u,active:P,style:Nm(Nm({},y),A),className:Vn(w,x),ref:T}))})})))};function qWt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},e;return t===!1?e={inkBar:!1,tabPane:!1}:t===!0?e={inkBar:!0,tabPane:!1}:e=Nm({inkBar:!0},uw(t)==="object"?t:{}),e.tabPaneMotion&&e.tabPane===void 0&&(e.tabPane=!0),!e.tabPaneMotion&&e.tabPane&&(e.tabPane=!1),e}var $Wt=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","more","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],Axe=0,QWt=m.forwardRef(function(t,e){var n=t.id,o=t.prefixCls,r=o===void 0?"rc-tabs":o,i=t.className,a=t.items,l=t.direction,s=t.activeKey,c=t.defaultActiveKey,u=t.editable,d=t.animated,f=t.tabPosition,p=f===void 0?"top":f,g=t.tabBarGutter,y=t.tabBarStyle,w=t.tabBarExtraContent,b=t.locale,C=t.more,P=t.destroyInactiveTabPane,v=t.renderTabBar,T=t.onChange,A=t.onTabClick,x=t.onTabScroll,S=t.getPopupContainer,R=t.popupClassName,M=t.indicator,D=VG(t,$Wt),E=m.useMemo(function(){return(a||[]).filter(function(ge){return ge&&uw(ge)==="object"&&"key"in ge})},[a]),W=l==="rtl",j=qWt(d),L=m.useState(!1),k=Wc(L,2),N=k[0],F=k[1];m.useEffect(function(){F(O$())},[]);var U=zs(function(){var ge;return(ge=E[0])===null||ge===void 0?void 0:ge.key},{value:s,defaultValue:c}),O=Wc(U,2),B=O[0],_=O[1],X=m.useState(function(){return E.findIndex(function(ge){return ge.key===B})}),$=Wc(X,2),Q=$[0],le=$[1];m.useEffect(function(){var ge=E.findIndex(function(Z){return Z.key===B});if(ge===-1){var de;ge=Math.max(0,Math.min(Q,E.length-1)),_((de=E[ge])===null||de===void 0?void 0:de.key)}le(ge)},[E.map(function(ge){return ge.key}).join("_"),B,Q]);var q=zs(null,{value:n}),te=Wc(q,2),re=te[0],ae=te[1];m.useEffect(function(){n||(ae("rc-tabs-".concat(Axe)),Axe+=1)},[]);function se(ge,de){A==null||A(ge,de);var Z=ge!==B;_(ge),Z&&(T==null||T(ge))}var ne={id:re,activeKey:B,animated:j,tabPosition:p,rtl:W,mobile:N},fe=Nm(Nm({},ne),{},{editable:u,locale:b,more:C,tabBarGutter:g,onTabClick:se,onTabScroll:x,extra:w,style:y,panes:null,getPopupContainer:S,popupClassName:R,indicator:M});return m.createElement(lQ.Provider,{value:{tabs:E,prefixCls:r}},m.createElement("div",R9({ref:e,id:n,className:Vn(r,"".concat(r,"-").concat(p),tp(tp(tp({},"".concat(r,"-mobile"),N),"".concat(r,"-editable"),u),"".concat(r,"-rtl"),W),i)},D),m.createElement(XWt,R9({},fe,{renderTabBar:v})),m.createElement(KWt,R9({destroyInactiveTabPane:P},ne,{animated:j}))))});const ZWt={motionAppear:!1,motionEnter:!0,motionLeave:!0};function eNt(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},n;return e===!1?n={inkBar:!1,tabPane:!1}:e===!0?n={inkBar:!0,tabPane:!0}:n=Object.assign({inkBar:!0},typeof e=="object"?e:{}),n.tabPane&&(n.tabPaneMotion=Object.assign(Object.assign({},ZWt),{motionName:j9(t,"switch")})),n}var tNt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);re)}function oNt(t,e){if(t)return t;const n=B9(e).map(o=>{if(m.isValidElement(o)){const{key:r,props:i}=o,a=i||{},{tab:l}=a,s=tNt(a,["tab"]);return Object.assign(Object.assign({key:String(r)},s),{label:l})}return null});return nNt(n)}const rNt=t=>{const{componentCls:e,motionDurationSlow:n}=t;return[{[e]:{[`${e}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${n}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${n}`}}}}},[O9(t,"slide-up"),O9(t,"slide-down")]]},iNt=t=>{const{componentCls:e,tabsCardPadding:n,cardBg:o,cardGutter:r,colorBorderSecondary:i,itemSelectedColor:a}=t;return{[`${e}-card`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{margin:0,padding:n,background:o,border:`${Nt(t.lineWidth)} ${t.lineType} ${i}`,transition:`all ${t.motionDurationSlow} ${t.motionEaseInOut}`},[`${e}-tab-active`]:{color:a,background:t.colorBgContainer},[`${e}-ink-bar`]:{visibility:"hidden"}},[`&${e}-top, &${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginLeft:{_skip_check_:!0,value:Nt(r)}}}},[`&${e}-top`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:`${Nt(t.borderRadiusLG)} ${Nt(t.borderRadiusLG)} 0 0`},[`${e}-tab-active`]:{borderBottomColor:t.colorBgContainer}}},[`&${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:`0 0 ${Nt(t.borderRadiusLG)} ${Nt(t.borderRadiusLG)}`},[`${e}-tab-active`]:{borderTopColor:t.colorBgContainer}}},[`&${e}-left, &${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginTop:Nt(r)}}},[`&${e}-left`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Nt(t.borderRadiusLG)} 0 0 ${Nt(t.borderRadiusLG)}`}},[`${e}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:t.colorBgContainer}}}},[`&${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Nt(t.borderRadiusLG)} ${Nt(t.borderRadiusLG)} 0`}},[`${e}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:t.colorBgContainer}}}}}}},aNt=t=>{const{componentCls:e,itemHoverColor:n,dropdownEdgeChildVerticalPadding:o}=t;return{[`${e}-dropdown`]:Object.assign(Object.assign({},ja(t)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:t.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${e}-dropdown-menu`]:{maxHeight:t.tabsDropdownHeight,margin:0,padding:`${Nt(o)} 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:t.colorBgContainer,backgroundClip:"padding-box",borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,"&-item":Object.assign(Object.assign({},Gx),{display:"flex",alignItems:"center",minWidth:t.tabsDropdownWidth,margin:0,padding:`${Nt(t.paddingXXS)} ${Nt(t.paddingSM)}`,color:t.colorText,fontWeight:"normal",fontSize:t.fontSize,lineHeight:t.lineHeight,cursor:"pointer",transition:`all ${t.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:t.marginSM},color:t.colorTextDescription,fontSize:t.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:n}},"&:hover":{background:t.controlItemBgHover},"&-disabled":{"&, &:hover":{color:t.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},lNt=t=>{const{componentCls:e,margin:n,colorBorderSecondary:o,horizontalMargin:r,verticalItemPadding:i,verticalItemMargin:a,calc:l}=t;return{[`${e}-top, ${e}-bottom`]:{flexDirection:"column",[`> ${e}-nav, > div > ${e}-nav`]:{margin:r,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${Nt(t.lineWidth)} ${t.lineType} ${o}`,content:"''"},[`${e}-ink-bar`]:{height:t.lineWidthBold,"&-animated":{transition:`width ${t.motionDurationSlow}, left ${t.motionDurationSlow}, right ${t.motionDurationSlow}`}},[`${e}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:t.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:t.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:t.boxShadowTabsOverflowRight},[`&${e}-nav-wrap-ping-left::before`]:{opacity:1},[`&${e}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${e}-top`]:{[`> ${e}-nav, - > div > ${e}-nav`]:{"&::before":{bottom:0},[`${e}-ink-bar`]:{bottom:0}}},[`${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},[`${e}-ink-bar`]:{top:0}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{order:0}},[`${e}-left, ${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{flexDirection:"column",minWidth:l(t.controlHeight).mul(1.25).equal(),[`${e}-tab`]:{padding:i,textAlign:"center"},[`${e}-tab + ${e}-tab`]:{margin:a},[`${e}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:t.controlHeight},"&::before":{top:0,boxShadow:t.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:t.boxShadowTabsOverflowBottom},[`&${e}-nav-wrap-ping-top::before`]:{opacity:1},[`&${e}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${e}-ink-bar`]:{width:t.lineWidthBold,"&-animated":{transition:`height ${t.motionDurationSlow}, top ${t.motionDurationSlow}`}},[`${e}-nav-list, ${e}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${e}-left`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{marginLeft:{_skip_check_:!0,value:Nt(l(t.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`},[`> ${e}-content > ${e}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:t.paddingLG}}}},[`${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{order:1,[`${e}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:l(t.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`},[`> ${e}-content > ${e}-tabpane`]:{paddingRight:{_skip_check_:!0,value:t.paddingLG}}}}}},sNt=t=>{const{componentCls:e,cardPaddingSM:n,cardPaddingLG:o,horizontalItemPaddingSM:r,horizontalItemPaddingLG:i}=t;return{[e]:{"&-small":{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:r,fontSize:t.titleFontSizeSM}}},"&-large":{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:i,fontSize:t.titleFontSizeLG}}}},[`${e}-card`]:{[`&${e}-small`]:{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:n}},[`&${e}-bottom`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:`0 0 ${Nt(t.borderRadius)} ${Nt(t.borderRadius)}`}},[`&${e}-top`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:`${Nt(t.borderRadius)} ${Nt(t.borderRadius)} 0 0`}},[`&${e}-right`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Nt(t.borderRadius)} ${Nt(t.borderRadius)} 0`}}},[`&${e}-left`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Nt(t.borderRadius)} 0 0 ${Nt(t.borderRadius)}`}}}},[`&${e}-large`]:{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:o}}}}}},cNt=t=>{const{componentCls:e,itemActiveColor:n,itemHoverColor:o,iconCls:r,tabsHorizontalItemMargin:i,horizontalItemPadding:a,itemSelectedColor:l,itemColor:s}=t,c=`${e}-tab`;return{[c]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:a,fontSize:t.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:s,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:n}},Q6(t)),"&-btn":{outline:"none",transition:`all ${t.motionDurationSlow}`,[`${c}-icon:not(:last-child)`]:{marginInlineEnd:t.marginSM}},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:t.calc(t.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:t.marginXS},color:t.colorTextDescription,fontSize:t.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${t.motionDurationSlow}`,"&:hover":{color:t.colorTextHeading}},"&:hover":{color:o},[`&${c}-active ${c}-btn`]:{color:l,textShadow:t.tabsActiveTextShadow},[`&${c}-disabled`]:{color:t.colorTextDisabled,cursor:"not-allowed"},[`&${c}-disabled ${c}-btn, &${c}-disabled ${e}-remove`]:{"&:focus, &:active":{color:t.colorTextDisabled}},[`& ${c}-remove ${r}`]:{margin:0},[`${r}:not(:last-child)`]:{marginRight:{_skip_check_:!0,value:t.marginSM}}},[`${c} + ${c}`]:{margin:{_skip_check_:!0,value:i}}}},uNt=t=>{const{componentCls:e,tabsHorizontalItemMarginRTL:n,iconCls:o,cardGutter:r,calc:i}=t;return{[`${e}-rtl`]:{direction:"rtl",[`${e}-nav`]:{[`${e}-tab`]:{margin:{_skip_check_:!0,value:n},[`${e}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[o]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:Nt(t.marginSM)}},[`${e}-tab-remove`]:{marginRight:{_skip_check_:!0,value:Nt(t.marginXS)},marginLeft:{_skip_check_:!0,value:Nt(i(t.marginXXS).mul(-1).equal())},[o]:{margin:0}}}},[`&${e}-left`]:{[`> ${e}-nav`]:{order:1},[`> ${e}-content-holder`]:{order:0}},[`&${e}-right`]:{[`> ${e}-nav`]:{order:0},[`> ${e}-content-holder`]:{order:1}},[`&${e}-card${e}-top, &${e}-card${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginRight:{_skip_check_:!0,value:r},marginLeft:{_skip_check_:!0,value:0}}}}},[`${e}-dropdown-rtl`]:{direction:"rtl"},[`${e}-menu-item`]:{[`${e}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},dNt=t=>{const{componentCls:e,tabsCardPadding:n,cardHeight:o,cardGutter:r,itemHoverColor:i,itemActiveColor:a,colorBorderSecondary:l}=t;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{display:"flex",[`> ${e}-nav, > div > ${e}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${e}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${t.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${e}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${t.motionDurationSlow}`},[`${e}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${e}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${e}-nav-more`]:{position:"relative",padding:n,background:"transparent",border:0,color:t.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:t.calc(t.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},[`${e}-nav-add`]:Object.assign({minWidth:o,minHeight:o,marginLeft:{_skip_check_:!0,value:r},padding:`0 ${Nt(t.paddingXS)}`,background:"transparent",border:`${Nt(t.lineWidth)} ${t.lineType} ${l}`,borderRadius:`${Nt(t.borderRadiusLG)} ${Nt(t.borderRadiusLG)} 0 0`,outline:"none",cursor:"pointer",color:t.colorText,transition:`all ${t.motionDurationSlow} ${t.motionEaseInOut}`,"&:hover":{color:i},"&:active, &:focus:not(:focus-visible)":{color:a}},Q6(t))},[`${e}-extra-content`]:{flex:"none"},[`${e}-ink-bar`]:{position:"absolute",background:t.inkBarColor,pointerEvents:"none"}}),cNt(t)),{[`${e}-content`]:{position:"relative",width:"100%"},[`${e}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${e}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${e}-centered`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-nav-wrap`]:{[`&:not([class*='${e}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}},fNt=t=>{const e=t.controlHeightLG;return{zIndexPopup:t.zIndexPopupBase+50,cardBg:t.colorFillAlter,cardHeight:e,cardPadding:`${(e-Math.round(t.fontSize*t.lineHeight))/2-t.lineWidth}px ${t.padding}px`,cardPaddingSM:`${t.paddingXXS*1.5}px ${t.padding}px`,cardPaddingLG:`${t.paddingXS}px ${t.padding}px ${t.paddingXXS*1.5}px`,titleFontSize:t.fontSize,titleFontSizeLG:t.fontSizeLG,titleFontSizeSM:t.fontSize,inkBarColor:t.colorPrimary,horizontalMargin:`0 0 ${t.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${t.paddingSM}px 0`,horizontalItemPaddingSM:`${t.paddingXS}px 0`,horizontalItemPaddingLG:`${t.padding}px 0`,verticalItemPadding:`${t.paddingXS}px ${t.paddingLG}px`,verticalItemMargin:`${t.margin}px 0 0 0`,itemColor:t.colorText,itemSelectedColor:t.colorPrimary,itemHoverColor:t.colorPrimaryHover,itemActiveColor:t.colorPrimaryActive,cardGutter:t.marginXXS/2}},hNt=wl("Tabs",t=>{const e=Ki(t,{tabsCardPadding:t.cardPadding,dropdownEdgeChildVerticalPadding:t.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${Nt(t.horizontalItemGutter)}`,tabsHorizontalItemMarginRTL:`0 0 0 ${Nt(t.horizontalItemGutter)}`});return[sNt(e),uNt(e),lNt(e),aNt(e),iNt(e),dNt(e),rNt(e)]},fNt),pNt=()=>null;var gNt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var e,n,o,r,i,a,l,s,c,u,d;const{type:f,className:p,rootClassName:g,size:y,onEdit:w,hideAdd:b,centered:C,addIcon:P,removeIcon:v,moreIcon:T,more:A,popupClassName:x,children:S,items:R,animated:M,style:D,indicatorSize:E,indicator:W}=t,j=gNt(t,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","removeIcon","moreIcon","more","popupClassName","children","items","animated","style","indicatorSize","indicator"]),{prefixCls:L}=j,{direction:k,tabs:N,getPrefixCls:F,getPopupContainer:U}=m.useContext(Cr),O=F("tabs",L),B=O0(O),[_,X,$]=hNt(O,B);let Q;f==="editable-card"&&(Q={onEdit:(ne,fe)=>{let{key:ge,event:de}=fe;w==null||w(ne==="add"?de:ge,ne)},removeIcon:(e=v??(N==null?void 0:N.removeIcon))!==null&&e!==void 0?e:m.createElement(Lw,null),addIcon:(P??(N==null?void 0:N.addIcon))||m.createElement(TWt,null),showAdd:b!==!0});const le=F(),q=Ed(y),te=oNt(R,S),re=eNt(O,M),ae=Object.assign(Object.assign({},N==null?void 0:N.style),D),se={align:(n=W==null?void 0:W.align)!==null&&n!==void 0?n:(o=N==null?void 0:N.indicator)===null||o===void 0?void 0:o.align,size:(l=(i=(r=W==null?void 0:W.size)!==null&&r!==void 0?r:E)!==null&&i!==void 0?i:(a=N==null?void 0:N.indicator)===null||a===void 0?void 0:a.size)!==null&&l!==void 0?l:N==null?void 0:N.indicatorSize};return _(m.createElement(QWt,Object.assign({direction:k,getPopupContainer:U},j,{items:te,className:Un({[`${O}-${q}`]:q,[`${O}-card`]:["card","editable-card"].includes(f),[`${O}-editable-card`]:f==="editable-card",[`${O}-centered`]:C},N==null?void 0:N.className,p,g,X,$,B),popupClassName:Un(x,X,$,B),style:ae,editable:Q,more:Object.assign({icon:(d=(u=(c=(s=N==null?void 0:N.more)===null||s===void 0?void 0:s.icon)!==null&&c!==void 0?c:N==null?void 0:N.moreIcon)!==null&&u!==void 0?u:T)!==null&&d!==void 0?d:m.createElement(_me,null),transitionName:`${le}-slide-up`},A),prefixCls:O,animated:re,indicator:se})))};KW.TabPane=pNt;function mNt(t,e,n){var o=n||{},r=o.noTrailing,i=r===void 0?!1:r,a=o.noLeading,l=a===void 0?!1:a,s=o.debounceMode,c=s===void 0?void 0:s,u,d=!1,f=0;function p(){u&&clearTimeout(u)}function g(w){var b=w||{},C=b.upcomingOnly,P=C===void 0?!1:C;p(),d=!P}function y(){for(var w=arguments.length,b=new Array(w),C=0;Ct?l?(f=Date.now(),i||(u=setTimeout(c?A:T,t))):T():i!==!0&&(u=setTimeout(c?A:T,c===void 0?t-v:t))}return y.cancel=g,y}function yNt(t,e,n){var o={},r=o.atBegin,i=r===void 0?!1:r;return mNt(t,e,{debounceMode:i!==!1})}const ANt=t=>{const{checkboxCls:e}=t,n=`${e}-wrapper`;return[{[`${e}-group`]:Object.assign(Object.assign({},ja(t)),{display:"inline-flex",flexWrap:"wrap",columnGap:t.marginXS,[`> ${t.antCls}-row`]:{flex:1}}),[n]:Object.assign(Object.assign({},ja(t)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${n}`]:{marginInlineStart:0},[`&${n}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[e]:Object.assign(Object.assign({},ja(t)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:t.borderRadiusSM,alignSelf:"center",[`${e}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${e}-inner`]:Object.assign({},lw(t))},[`${e}-inner`]:{boxSizing:"border-box",display:"block",width:t.checkboxSize,height:t.checkboxSize,direction:"ltr",backgroundColor:t.colorBgContainer,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderRadius:t.borderRadiusSM,borderCollapse:"separate",transition:`all ${t.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:t.calc(t.checkboxSize).div(14).mul(5).equal(),height:t.calc(t.checkboxSize).div(14).mul(8).equal(),border:`${Nt(t.lineWidthBold)} solid ${t.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${t.motionDurationFast} ${t.motionEaseInBack}, opacity ${t.motionDurationFast}`}},"& + span":{paddingInlineStart:t.paddingXS,paddingInlineEnd:t.paddingXS}})},{[` + > div > ${e}-nav`]:{"&::before":{bottom:0},[`${e}-ink-bar`]:{bottom:0}}},[`${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},[`${e}-ink-bar`]:{top:0}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{order:0}},[`${e}-left, ${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{flexDirection:"column",minWidth:l(t.controlHeight).mul(1.25).equal(),[`${e}-tab`]:{padding:i,textAlign:"center"},[`${e}-tab + ${e}-tab`]:{margin:a},[`${e}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:t.controlHeight},"&::before":{top:0,boxShadow:t.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:t.boxShadowTabsOverflowBottom},[`&${e}-nav-wrap-ping-top::before`]:{opacity:1},[`&${e}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${e}-ink-bar`]:{width:t.lineWidthBold,"&-animated":{transition:`height ${t.motionDurationSlow}, top ${t.motionDurationSlow}`}},[`${e}-nav-list, ${e}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${e}-left`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{marginLeft:{_skip_check_:!0,value:Nt(l(t.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`},[`> ${e}-content > ${e}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:t.paddingLG}}}},[`${e}-right`]:{[`> ${e}-nav, > div > ${e}-nav`]:{order:1,[`${e}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${e}-content-holder, > div > ${e}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:l(t.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`},[`> ${e}-content > ${e}-tabpane`]:{paddingRight:{_skip_check_:!0,value:t.paddingLG}}}}}},sNt=t=>{const{componentCls:e,cardPaddingSM:n,cardPaddingLG:o,horizontalItemPaddingSM:r,horizontalItemPaddingLG:i}=t;return{[e]:{"&-small":{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:r,fontSize:t.titleFontSizeSM}}},"&-large":{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:i,fontSize:t.titleFontSizeLG}}}},[`${e}-card`]:{[`&${e}-small`]:{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:n}},[`&${e}-bottom`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:`0 0 ${Nt(t.borderRadius)} ${Nt(t.borderRadius)}`}},[`&${e}-top`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:`${Nt(t.borderRadius)} ${Nt(t.borderRadius)} 0 0`}},[`&${e}-right`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Nt(t.borderRadius)} ${Nt(t.borderRadius)} 0`}}},[`&${e}-left`]:{[`> ${e}-nav ${e}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Nt(t.borderRadius)} 0 0 ${Nt(t.borderRadius)}`}}}},[`&${e}-large`]:{[`> ${e}-nav`]:{[`${e}-tab`]:{padding:o}}}}}},cNt=t=>{const{componentCls:e,itemActiveColor:n,itemHoverColor:o,iconCls:r,tabsHorizontalItemMargin:i,horizontalItemPadding:a,itemSelectedColor:l,itemColor:s}=t,c=`${e}-tab`;return{[c]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:a,fontSize:t.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:s,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:n}},Q6(t)),"&-btn":{outline:"none",transition:`all ${t.motionDurationSlow}`,[`${c}-icon:not(:last-child)`]:{marginInlineEnd:t.marginSM}},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:t.calc(t.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:t.marginXS},color:t.colorTextDescription,fontSize:t.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${t.motionDurationSlow}`,"&:hover":{color:t.colorTextHeading}},"&:hover":{color:o},[`&${c}-active ${c}-btn`]:{color:l,textShadow:t.tabsActiveTextShadow},[`&${c}-disabled`]:{color:t.colorTextDisabled,cursor:"not-allowed"},[`&${c}-disabled ${c}-btn, &${c}-disabled ${e}-remove`]:{"&:focus, &:active":{color:t.colorTextDisabled}},[`& ${c}-remove ${r}`]:{margin:0},[`${r}:not(:last-child)`]:{marginRight:{_skip_check_:!0,value:t.marginSM}}},[`${c} + ${c}`]:{margin:{_skip_check_:!0,value:i}}}},uNt=t=>{const{componentCls:e,tabsHorizontalItemMarginRTL:n,iconCls:o,cardGutter:r,calc:i}=t;return{[`${e}-rtl`]:{direction:"rtl",[`${e}-nav`]:{[`${e}-tab`]:{margin:{_skip_check_:!0,value:n},[`${e}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[o]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:Nt(t.marginSM)}},[`${e}-tab-remove`]:{marginRight:{_skip_check_:!0,value:Nt(t.marginXS)},marginLeft:{_skip_check_:!0,value:Nt(i(t.marginXXS).mul(-1).equal())},[o]:{margin:0}}}},[`&${e}-left`]:{[`> ${e}-nav`]:{order:1},[`> ${e}-content-holder`]:{order:0}},[`&${e}-right`]:{[`> ${e}-nav`]:{order:0},[`> ${e}-content-holder`]:{order:1}},[`&${e}-card${e}-top, &${e}-card${e}-bottom`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-tab + ${e}-tab`]:{marginRight:{_skip_check_:!0,value:r},marginLeft:{_skip_check_:!0,value:0}}}}},[`${e}-dropdown-rtl`]:{direction:"rtl"},[`${e}-menu-item`]:{[`${e}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},dNt=t=>{const{componentCls:e,tabsCardPadding:n,cardHeight:o,cardGutter:r,itemHoverColor:i,itemActiveColor:a,colorBorderSecondary:l}=t;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{display:"flex",[`> ${e}-nav, > div > ${e}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${e}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${t.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${e}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${t.motionDurationSlow}`},[`${e}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${e}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${e}-nav-more`]:{position:"relative",padding:n,background:"transparent",border:0,color:t.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:t.calc(t.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},[`${e}-nav-add`]:Object.assign({minWidth:o,minHeight:o,marginLeft:{_skip_check_:!0,value:r},padding:`0 ${Nt(t.paddingXS)}`,background:"transparent",border:`${Nt(t.lineWidth)} ${t.lineType} ${l}`,borderRadius:`${Nt(t.borderRadiusLG)} ${Nt(t.borderRadiusLG)} 0 0`,outline:"none",cursor:"pointer",color:t.colorText,transition:`all ${t.motionDurationSlow} ${t.motionEaseInOut}`,"&:hover":{color:i},"&:active, &:focus:not(:focus-visible)":{color:a}},Q6(t))},[`${e}-extra-content`]:{flex:"none"},[`${e}-ink-bar`]:{position:"absolute",background:t.inkBarColor,pointerEvents:"none"}}),cNt(t)),{[`${e}-content`]:{position:"relative",width:"100%"},[`${e}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${e}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${e}-centered`]:{[`> ${e}-nav, > div > ${e}-nav`]:{[`${e}-nav-wrap`]:{[`&:not([class*='${e}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}},fNt=t=>{const e=t.controlHeightLG;return{zIndexPopup:t.zIndexPopupBase+50,cardBg:t.colorFillAlter,cardHeight:e,cardPadding:`${(e-Math.round(t.fontSize*t.lineHeight))/2-t.lineWidth}px ${t.padding}px`,cardPaddingSM:`${t.paddingXXS*1.5}px ${t.padding}px`,cardPaddingLG:`${t.paddingXS}px ${t.padding}px ${t.paddingXXS*1.5}px`,titleFontSize:t.fontSize,titleFontSizeLG:t.fontSizeLG,titleFontSizeSM:t.fontSize,inkBarColor:t.colorPrimary,horizontalMargin:`0 0 ${t.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${t.paddingSM}px 0`,horizontalItemPaddingSM:`${t.paddingXS}px 0`,horizontalItemPaddingLG:`${t.padding}px 0`,verticalItemPadding:`${t.paddingXS}px ${t.paddingLG}px`,verticalItemMargin:`${t.margin}px 0 0 0`,itemColor:t.colorText,itemSelectedColor:t.colorPrimary,itemHoverColor:t.colorPrimaryHover,itemActiveColor:t.colorPrimaryActive,cardGutter:t.marginXXS/2}},hNt=wl("Tabs",t=>{const e=Ki(t,{tabsCardPadding:t.cardPadding,dropdownEdgeChildVerticalPadding:t.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${Nt(t.horizontalItemGutter)}`,tabsHorizontalItemMarginRTL:`0 0 0 ${Nt(t.horizontalItemGutter)}`});return[sNt(e),uNt(e),lNt(e),aNt(e),iNt(e),dNt(e),rNt(e)]},fNt),pNt=()=>null;var gNt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var e,n,o,r,i,a,l,s,c,u,d;const{type:f,className:p,rootClassName:g,size:y,onEdit:w,hideAdd:b,centered:C,addIcon:P,removeIcon:v,moreIcon:T,more:A,popupClassName:x,children:S,items:R,animated:M,style:D,indicatorSize:E,indicator:W}=t,j=gNt(t,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","removeIcon","moreIcon","more","popupClassName","children","items","animated","style","indicatorSize","indicator"]),{prefixCls:L}=j,{direction:k,tabs:N,getPrefixCls:F,getPopupContainer:U}=m.useContext(Cr),O=F("tabs",L),B=O0(O),[_,X,$]=hNt(O,B);let Q;f==="editable-card"&&(Q={onEdit:(ne,fe)=>{let{key:ge,event:de}=fe;w==null||w(ne==="add"?de:ge,ne)},removeIcon:(e=v??(N==null?void 0:N.removeIcon))!==null&&e!==void 0?e:m.createElement(Lw,null),addIcon:(P??(N==null?void 0:N.addIcon))||m.createElement(TWt,null),showAdd:b!==!0});const le=F(),q=Ed(y),te=oNt(R,S),re=eNt(O,M),ae=Object.assign(Object.assign({},N==null?void 0:N.style),D),se={align:(n=W==null?void 0:W.align)!==null&&n!==void 0?n:(o=N==null?void 0:N.indicator)===null||o===void 0?void 0:o.align,size:(l=(i=(r=W==null?void 0:W.size)!==null&&r!==void 0?r:E)!==null&&i!==void 0?i:(a=N==null?void 0:N.indicator)===null||a===void 0?void 0:a.size)!==null&&l!==void 0?l:N==null?void 0:N.indicatorSize};return _(m.createElement(QWt,Object.assign({direction:k,getPopupContainer:U},j,{items:te,className:Un({[`${O}-${q}`]:q,[`${O}-card`]:["card","editable-card"].includes(f),[`${O}-editable-card`]:f==="editable-card",[`${O}-centered`]:C},N==null?void 0:N.className,p,g,X,$,B),popupClassName:Un(x,X,$,B),style:ae,editable:Q,more:Object.assign({icon:(d=(u=(c=(s=N==null?void 0:N.more)===null||s===void 0?void 0:s.icon)!==null&&c!==void 0?c:N==null?void 0:N.moreIcon)!==null&&u!==void 0?u:T)!==null&&d!==void 0?d:m.createElement(Vme,null),transitionName:`${le}-slide-up`},A),prefixCls:O,animated:re,indicator:se})))};qW.TabPane=pNt;function mNt(t,e,n){var o=n||{},r=o.noTrailing,i=r===void 0?!1:r,a=o.noLeading,l=a===void 0?!1:a,s=o.debounceMode,c=s===void 0?void 0:s,u,d=!1,f=0;function p(){u&&clearTimeout(u)}function g(w){var b=w||{},C=b.upcomingOnly,P=C===void 0?!1:C;p(),d=!P}function y(){for(var w=arguments.length,b=new Array(w),C=0;Ct?l?(f=Date.now(),i||(u=setTimeout(c?A:T,t))):T():i!==!0&&(u=setTimeout(c?A:T,c===void 0?t-v:t))}return y.cancel=g,y}function yNt(t,e,n){var o={},r=o.atBegin,i=r===void 0?!1:r;return mNt(t,e,{debounceMode:i!==!1})}const ANt=t=>{const{checkboxCls:e}=t,n=`${e}-wrapper`;return[{[`${e}-group`]:Object.assign(Object.assign({},ja(t)),{display:"inline-flex",flexWrap:"wrap",columnGap:t.marginXS,[`> ${t.antCls}-row`]:{flex:1}}),[n]:Object.assign(Object.assign({},ja(t)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${n}`]:{marginInlineStart:0},[`&${n}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[e]:Object.assign(Object.assign({},ja(t)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:t.borderRadiusSM,alignSelf:"center",[`${e}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${e}-inner`]:Object.assign({},lw(t))},[`${e}-inner`]:{boxSizing:"border-box",display:"block",width:t.checkboxSize,height:t.checkboxSize,direction:"ltr",backgroundColor:t.colorBgContainer,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderRadius:t.borderRadiusSM,borderCollapse:"separate",transition:`all ${t.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:t.calc(t.checkboxSize).div(14).mul(5).equal(),height:t.calc(t.checkboxSize).div(14).mul(8).equal(),border:`${Nt(t.lineWidthBold)} solid ${t.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${t.motionDurationFast} ${t.motionEaseInBack}, opacity ${t.motionDurationFast}`}},"& + span":{paddingInlineStart:t.paddingXS,paddingInlineEnd:t.paddingXS}})},{[` ${n}:not(${n}-disabled), ${e}:not(${e}-disabled) `]:{[`&:hover ${e}-inner`]:{borderColor:t.colorPrimary}},[`${n}:not(${n}-disabled)`]:{[`&:hover ${e}-checked:not(${e}-disabled) ${e}-inner`]:{backgroundColor:t.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${e}-checked:not(${e}-disabled):after`]:{borderColor:t.colorPrimaryHover}}},{[`${e}-checked`]:{[`${e}-inner`]:{backgroundColor:t.colorPrimary,borderColor:t.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${t.motionDurationMid} ${t.motionEaseOutBack} ${t.motionDurationFast}`}}},[` ${n}-checked:not(${n}-disabled), ${e}-checked:not(${e}-disabled) - `]:{[`&:hover ${e}-inner`]:{backgroundColor:t.colorPrimaryHover,borderColor:"transparent"}}},{[e]:{"&-indeterminate":{[`${e}-inner`]:{backgroundColor:t.colorBgContainer,borderColor:t.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:t.calc(t.fontSizeLG).div(2).equal(),height:t.calc(t.fontSizeLG).div(2).equal(),backgroundColor:t.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${n}-disabled`]:{cursor:"not-allowed"},[`${e}-disabled`]:{[`&, ${e}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${e}-inner`]:{background:t.colorBgContainerDisabled,borderColor:t.colorBorder,"&:after":{borderColor:t.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:t.colorTextDisabled},[`&${e}-indeterminate ${e}-inner::after`]:{background:t.colorTextDisabled}}}]};function pJe(t,e){const n=Ki(e,{checkboxCls:`.${t}`,checkboxSize:e.controlInteractiveSize});return[ANt(n)]}const gJe=wl("Checkbox",(t,e)=>{let{prefixCls:n}=e;return[pJe(n,t)]}),mJe=be.createContext(null);var wNt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n;const{prefixCls:o,className:r,rootClassName:i,children:a,indeterminate:l=!1,style:s,onMouseEnter:c,onMouseLeave:u,skipGroup:d=!1,disabled:f}=t,p=wNt(t,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:g,direction:y,checkbox:w}=m.useContext(Cr),b=m.useContext(mJe),{isFormItemInput:C}=m.useContext(r1),P=m.useContext(n1),v=(n=(b==null?void 0:b.disabled)||f)!==null&&n!==void 0?n:P,T=m.useRef(p.value);m.useEffect(()=>{b==null||b.registerValue(p.value)},[]),m.useEffect(()=>{if(!d)return p.value!==T.current&&(b==null||b.cancelValue(T.current),b==null||b.registerValue(p.value),T.current=p.value),()=>b==null?void 0:b.cancelValue(p.value)},[p.value]);const A=g("checkbox",o),x=O0(A),[S,R,M]=gJe(A,x),D=Object.assign({},p);b&&!d&&(D.onChange=function(){p.onChange&&p.onChange.apply(p,arguments),b.toggleOption&&b.toggleOption({label:a,value:p.value})},D.name=b.name,D.checked=b.value.includes(p.value));const E=Un(`${A}-wrapper`,{[`${A}-rtl`]:y==="rtl",[`${A}-wrapper-checked`]:D.checked,[`${A}-wrapper-disabled`]:v,[`${A}-wrapper-in-form-item`]:C},w==null?void 0:w.className,r,i,M,x,R),W=Un({[`${A}-indeterminate`]:l},k$,R),j=l?"mixed":void 0;return S(m.createElement(EW,{component:"Checkbox",disabled:v},m.createElement("label",{className:E,style:Object.assign(Object.assign({},w==null?void 0:w.style),s),onMouseEnter:c,onMouseLeave:u},m.createElement(eJe,Object.assign({"aria-checked":j},D,{prefixCls:A,className:W,disabled:v,ref:e})),a!==void 0&&m.createElement("span",null,a))))},yJe=m.forwardRef(vNt);var xNt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{defaultValue:n,children:o,options:r=[],prefixCls:i,className:a,rootClassName:l,style:s,onChange:c}=t,u=xNt(t,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:d,direction:f}=m.useContext(Cr),[p,g]=m.useState(u.value||n||[]),[y,w]=m.useState([]);m.useEffect(()=>{"value"in u&&g(u.value||[])},[u.value]);const b=m.useMemo(()=>r.map(L=>typeof L=="string"||typeof L=="number"?{label:L,value:L}:L),[r]),C=L=>{w(k=>k.filter(N=>N!==L))},P=L=>{w(k=>[].concat(Za(k),[L]))},v=L=>{const k=p.indexOf(L.value),N=Za(p);k===-1?N.push(L.value):N.splice(k,1),"value"in u||g(N),c==null||c(N.filter(F=>y.includes(F)).sort((F,U)=>{const O=b.findIndex(_=>_.value===F),B=b.findIndex(_=>_.value===U);return O-B}))},T=d("checkbox",i),A=`${T}-group`,x=O0(T),[S,R,M]=gJe(T,x),D=up(u,["value","disabled"]),E=r.length?b.map(L=>m.createElement(yJe,{prefixCls:T,key:L.value.toString(),disabled:"disabled"in L?L.disabled:u.disabled,value:L.value,checked:p.includes(L.value),onChange:L.onChange,className:`${A}-item`,style:L.style,title:L.title,id:L.id,required:L.required},L.label)):o,W={toggleOption:v,value:p,disabled:u.disabled,name:u.name,registerValue:P,cancelValue:C},j=Un(A,{[`${A}-rtl`]:f==="rtl"},a,l,M,x,R);return S(m.createElement("div",Object.assign({className:j,style:s},D,{ref:e}),m.createElement(mJe.Provider,{value:W},E)))}),Li=yJe;Li.Group=bNt;Li.__ANT_CHECKBOX=!0;const AJe=m.createContext({}),SNt=t=>{const{componentCls:e}=t;return{[e]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},TNt=t=>{const{componentCls:e}=t;return{[e]:{position:"relative",maxWidth:"100%",minHeight:1}}},PNt=(t,e)=>{const{prefixCls:n,componentCls:o,gridColumns:r}=t,i={};for(let a=r;a>=0;a--)a===0?(i[`${o}${e}-${a}`]={display:"none"},i[`${o}-push-${a}`]={insetInlineStart:"auto"},i[`${o}-pull-${a}`]={insetInlineEnd:"auto"},i[`${o}${e}-push-${a}`]={insetInlineStart:"auto"},i[`${o}${e}-pull-${a}`]={insetInlineEnd:"auto"},i[`${o}${e}-offset-${a}`]={marginInlineStart:0},i[`${o}${e}-order-${a}`]={order:0}):(i[`${o}${e}-${a}`]=[{"--ant-display":"block",display:"block"},{display:"var(--ant-display)",flex:`0 0 ${a/r*100}%`,maxWidth:`${a/r*100}%`}],i[`${o}${e}-push-${a}`]={insetInlineStart:`${a/r*100}%`},i[`${o}${e}-pull-${a}`]={insetInlineEnd:`${a/r*100}%`},i[`${o}${e}-offset-${a}`]={marginInlineStart:`${a/r*100}%`},i[`${o}${e}-order-${a}`]={order:a});return i[`${o}${e}-flex`]={flex:`var(--${n}${e}-flex)`},i},due=(t,e)=>PNt(t,e),CNt=(t,e,n)=>({[`@media (min-width: ${Nt(e)})`]:Object.assign({},due(t,n))}),RNt=()=>({}),HNt=()=>({}),MNt=wl("Grid",SNt,RNt),INt=wl("Grid",t=>{const e=Ki(t,{gridColumns:24}),n={"-sm":e.screenSMMin,"-md":e.screenMDMin,"-lg":e.screenLGMin,"-xl":e.screenXLMin,"-xxl":e.screenXXLMin};return[TNt(e),due(e,""),due(e,"-xs"),Object.keys(n).map(o=>CNt(e,n[o],o)).reduce((o,r)=>Object.assign(Object.assign({},o),r),{})]},HNt);var zNt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{getPrefixCls:n,direction:o}=m.useContext(Cr),{gutter:r,wrap:i}=m.useContext(AJe),{prefixCls:a,span:l,order:s,offset:c,push:u,pull:d,className:f,children:p,flex:g,style:y}=t,w=zNt(t,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),b=n("col",a),[C,P,v]=INt(b),T={};let A={};DNt.forEach(R=>{let M={};const D=t[R];typeof D=="number"?M.span=D:typeof D=="object"&&(M=D||{}),delete w[R],A=Object.assign(Object.assign({},A),{[`${b}-${R}-${M.span}`]:M.span!==void 0,[`${b}-${R}-order-${M.order}`]:M.order||M.order===0,[`${b}-${R}-offset-${M.offset}`]:M.offset||M.offset===0,[`${b}-${R}-push-${M.push}`]:M.push||M.push===0,[`${b}-${R}-pull-${M.pull}`]:M.pull||M.pull===0,[`${b}-rtl`]:o==="rtl"}),M.flex&&(A[`${b}-${R}-flex`]=!0,T[`--${b}-${R}-flex`]=Axe(M.flex))});const x=Un(b,{[`${b}-${l}`]:l!==void 0,[`${b}-order-${s}`]:s,[`${b}-offset-${c}`]:c,[`${b}-push-${u}`]:u,[`${b}-pull-${d}`]:d},f,A,P,v),S={};if(r&&r[0]>0){const R=r[0]/2;S.paddingLeft=R,S.paddingRight=R}return g&&(S.flex=Axe(g),i===!1&&!S.minWidth&&(S.minWidth=0)),C(m.createElement("div",Object.assign({},w,{style:Object.assign(Object.assign(Object.assign({},S),y),T),className:x,ref:e}),p))});var ENt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{if(typeof t=="string"&&o(t),typeof t=="object")for(let i=0;i{r()},[JSON.stringify(t),e]),n}const on=m.forwardRef((t,e)=>{const{prefixCls:n,justify:o,align:r,className:i,style:a,children:l,gutter:s=0,wrap:c}=t,u=ENt(t,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:d,direction:f}=m.useContext(Cr),[p,g]=m.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),[y,w]=m.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),b=wxe(r,y),C=wxe(o,y),P=m.useRef(s),v=UGe();m.useEffect(()=>{const N=v.subscribe(F=>{w(F);const U=P.current||0;(!Array.isArray(U)&&typeof U=="object"||Array.isArray(U)&&(typeof U[0]=="object"||typeof U[1]=="object"))&&g(F)});return()=>v.unsubscribe(N)},[]);const T=()=>{const N=[void 0,void 0];return(Array.isArray(s)?s:[s,void 0]).forEach((U,O)=>{if(typeof U=="object")for(let B=0;B0?M[0]/-2:void 0;W&&(E.marginLeft=W,E.marginRight=W);const[j,L]=M;E.rowGap=L;const k=m.useMemo(()=>({gutter:[j,L],wrap:c}),[j,L,c]);return x(m.createElement(AJe.Provider,{value:k},m.createElement("div",Object.assign({},u,{className:D,style:Object.assign(Object.assign({},E),a),ref:e}),l)))});var wJe=be.forwardRef(function(t,e){var n=t.prefixCls,o=t.forceRender,r=t.className,i=t.style,a=t.children,l=t.isActive,s=t.role,c=be.useState(l||o),u=ln(c,2),d=u[0],f=u[1];return be.useEffect(function(){(o||l)&&f(!0)},[o,l]),d?be.createElement("div",{ref:e,className:Vn("".concat(n,"-content"),Vt(Vt({},"".concat(n,"-content-active"),l),"".concat(n,"-content-inactive"),!l),r),style:i,role:s},be.createElement("div",{className:"".concat(n,"-content-box")},a)):null});wJe.displayName="PanelContent";var FNt=["showArrow","headerClass","isActive","onItemClick","forceRender","className","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],vJe=be.forwardRef(function(t,e){var n=t.showArrow,o=n===void 0?!0:n,r=t.headerClass,i=t.isActive,a=t.onItemClick,l=t.forceRender,s=t.className,c=t.prefixCls,u=t.collapsible,d=t.accordion,f=t.panelKey,p=t.extra,g=t.header,y=t.expandIcon,w=t.openMotion,b=t.destroyInactivePanel,C=t.children,P=ii(t,FNt),v=u==="disabled",T=u==="header",A=u==="icon",x=p!=null&&typeof p!="boolean",S=function(){a==null||a(f)},R=function(L){(L.key==="Enter"||L.keyCode===Bn.ENTER||L.which===Bn.ENTER)&&S()},M=typeof y=="function"?y(t):be.createElement("i",{className:"arrow"});M&&(M=be.createElement("div",{className:"".concat(c,"-expand-icon"),onClick:["header","icon"].includes(u)?S:void 0},M));var D=Vn(Vt(Vt(Vt({},"".concat(c,"-item"),!0),"".concat(c,"-item-active"),i),"".concat(c,"-item-disabled"),v),s),E=Vn(r,Vt(Vt(Vt({},"".concat(c,"-header"),!0),"".concat(c,"-header-collapsible-only"),T),"".concat(c,"-icon-collapsible-only"),A)),W={className:E,"aria-expanded":i,"aria-disabled":v,onKeyDown:R};return!T&&!A&&(W.onClick=S,W.role=d?"tab":"button",W.tabIndex=v?-1:0),be.createElement("div",ho({},P,{ref:e,className:D}),be.createElement("div",W,o&&M,be.createElement("span",{className:"".concat(c,"-header-text"),onClick:u==="header"?S:void 0},g),x&&be.createElement("div",{className:"".concat(c,"-extra")},p)),be.createElement(o1,ho({visible:i,leavedClassName:"".concat(c,"-content-hidden")},w,{forceRender:l,removeOnLeave:b}),function(j,L){var k=j.className,N=j.style;return be.createElement(wJe,{ref:L,prefixCls:c,className:k,style:N,isActive:i,forceRender:l,role:d?"tabpanel":void 0},C)}))}),kNt=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],LNt=function(e,n){var o=n.prefixCls,r=n.accordion,i=n.collapsible,a=n.destroyInactivePanel,l=n.onItemClick,s=n.activeKey,c=n.openMotion,u=n.expandIcon;return e.map(function(d,f){var p=d.children,g=d.label,y=d.key,w=d.collapsible,b=d.onItemClick,C=d.destroyInactivePanel,P=ii(d,kNt),v=String(y??f),T=w??i,A=C??a,x=function(M){T!=="disabled"&&(l(M),b==null||b(M))},S=!1;return r?S=s[0]===v:S=s.indexOf(v)>-1,be.createElement(vJe,ho({},P,{prefixCls:o,key:v,panelKey:v,isActive:S,accordion:r,openMotion:c,expandIcon:u,header:g,collapsible:T,onItemClick:x,destroyInactivePanel:A}),p)})},WNt=function(e,n,o){if(!e)return null;var r=o.prefixCls,i=o.accordion,a=o.collapsible,l=o.destroyInactivePanel,s=o.onItemClick,c=o.activeKey,u=o.openMotion,d=o.expandIcon,f=e.key||String(n),p=e.props,g=p.header,y=p.headerClass,w=p.destroyInactivePanel,b=p.collapsible,C=p.onItemClick,P=!1;i?P=c[0]===f:P=c.indexOf(f)>-1;var v=b??a,T=function(S){v!=="disabled"&&(s(S),C==null||C(S))},A={key:f,panelKey:f,header:g,headerClass:y,isActive:P,prefixCls:r,destroyInactivePanel:w??l,openMotion:u,accordion:i,children:e.props.children,onItemClick:T,expandIcon:d,collapsible:v};return typeof e.type=="string"?e:(Object.keys(A).forEach(function(x){typeof A[x]>"u"&&delete A[x]}),be.cloneElement(e,A))};function NNt(t,e,n){return Array.isArray(t)?LNt(t,n):ow(e).map(function(o,r){return WNt(o,r,n)})}function UNt(t){var e=t;if(!Array.isArray(e)){var n=hi(e);e=n==="number"||n==="string"?[e]:[]}return e.map(function(o){return String(o)})}var jNt=be.forwardRef(function(t,e){var n=t.prefixCls,o=n===void 0?"rc-collapse":n,r=t.destroyInactivePanel,i=r===void 0?!1:r,a=t.style,l=t.accordion,s=t.className,c=t.children,u=t.collapsible,d=t.openMotion,f=t.expandIcon,p=t.activeKey,g=t.defaultActiveKey,y=t.onChange,w=t.items,b=Vn(o,s),C=zs([],{value:p,onChange:function(R){return y==null?void 0:y(R)},defaultValue:g,postState:UNt}),P=ln(C,2),v=P[0],T=P[1],A=function(R){return T(function(){if(l)return v[0]===R?[]:[R];var M=v.indexOf(R),D=M>-1;return D?v.filter(function(E){return E!==R}):[].concat(Lo(v),[R])})};j0(!c,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var x=NNt(w,c,{prefixCls:o,accordion:l,openMotion:d,expandIcon:f,collapsible:u,destroyInactivePanel:i,onItemClick:A,activeKey:v});return be.createElement("div",ho({ref:e,className:b,style:a,role:l?"tablist":void 0},Sf(t,{aria:!0,data:!0})),x)});const rye=Object.assign(jNt,{Panel:vJe});rye.Panel;const BNt=m.forwardRef((t,e)=>{const{getPrefixCls:n}=m.useContext(Cr),{prefixCls:o,className:r,showArrow:i=!0}=t,a=n("collapse",o),l=Un({[`${a}-no-arrow`]:!i},r);return m.createElement(rye.Panel,Object.assign({ref:e},t,{prefixCls:a,className:l}))}),YNt=t=>{const{componentCls:e,contentBg:n,padding:o,headerBg:r,headerPadding:i,collapseHeaderPaddingSM:a,collapseHeaderPaddingLG:l,collapsePanelBorderRadius:s,lineWidth:c,lineType:u,colorBorder:d,colorText:f,colorTextHeading:p,colorTextDisabled:g,fontSizeLG:y,lineHeight:w,lineHeightLG:b,marginSM:C,paddingSM:P,paddingLG:v,paddingXS:T,motionDurationSlow:A,fontSizeIcon:x,contentPadding:S,fontHeight:R,fontHeightLG:M}=t,D=`${Nt(c)} ${u} ${d}`;return{[e]:Object.assign(Object.assign({},ja(t)),{backgroundColor:r,border:D,borderRadius:s,"&-rtl":{direction:"rtl"},[`& > ${e}-item`]:{borderBottom:D,"&:last-child":{[` + `]:{[`&:hover ${e}-inner`]:{backgroundColor:t.colorPrimaryHover,borderColor:"transparent"}}},{[e]:{"&-indeterminate":{[`${e}-inner`]:{backgroundColor:t.colorBgContainer,borderColor:t.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:t.calc(t.fontSizeLG).div(2).equal(),height:t.calc(t.fontSizeLG).div(2).equal(),backgroundColor:t.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${n}-disabled`]:{cursor:"not-allowed"},[`${e}-disabled`]:{[`&, ${e}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${e}-inner`]:{background:t.colorBgContainerDisabled,borderColor:t.colorBorder,"&:after":{borderColor:t.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:t.colorTextDisabled},[`&${e}-indeterminate ${e}-inner::after`]:{background:t.colorTextDisabled}}}]};function pJe(t,e){const n=Ki(e,{checkboxCls:`.${t}`,checkboxSize:e.controlInteractiveSize});return[ANt(n)]}const gJe=wl("Checkbox",(t,e)=>{let{prefixCls:n}=e;return[pJe(n,t)]}),mJe=be.createContext(null);var wNt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n;const{prefixCls:o,className:r,rootClassName:i,children:a,indeterminate:l=!1,style:s,onMouseEnter:c,onMouseLeave:u,skipGroup:d=!1,disabled:f}=t,p=wNt(t,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:g,direction:y,checkbox:w}=m.useContext(Cr),b=m.useContext(mJe),{isFormItemInput:C}=m.useContext(r1),P=m.useContext(n1),v=(n=(b==null?void 0:b.disabled)||f)!==null&&n!==void 0?n:P,T=m.useRef(p.value);m.useEffect(()=>{b==null||b.registerValue(p.value)},[]),m.useEffect(()=>{if(!d)return p.value!==T.current&&(b==null||b.cancelValue(T.current),b==null||b.registerValue(p.value),T.current=p.value),()=>b==null?void 0:b.cancelValue(p.value)},[p.value]);const A=g("checkbox",o),x=O0(A),[S,R,M]=gJe(A,x),D=Object.assign({},p);b&&!d&&(D.onChange=function(){p.onChange&&p.onChange.apply(p,arguments),b.toggleOption&&b.toggleOption({label:a,value:p.value})},D.name=b.name,D.checked=b.value.includes(p.value));const E=Un(`${A}-wrapper`,{[`${A}-rtl`]:y==="rtl",[`${A}-wrapper-checked`]:D.checked,[`${A}-wrapper-disabled`]:v,[`${A}-wrapper-in-form-item`]:C},w==null?void 0:w.className,r,i,M,x,R),W=Un({[`${A}-indeterminate`]:l},k$,R),j=l?"mixed":void 0;return S(m.createElement(FW,{component:"Checkbox",disabled:v},m.createElement("label",{className:E,style:Object.assign(Object.assign({},w==null?void 0:w.style),s),onMouseEnter:c,onMouseLeave:u},m.createElement(eJe,Object.assign({"aria-checked":j},D,{prefixCls:A,className:W,disabled:v,ref:e})),a!==void 0&&m.createElement("span",null,a))))},yJe=m.forwardRef(vNt);var xNt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{defaultValue:n,children:o,options:r=[],prefixCls:i,className:a,rootClassName:l,style:s,onChange:c}=t,u=xNt(t,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:d,direction:f}=m.useContext(Cr),[p,g]=m.useState(u.value||n||[]),[y,w]=m.useState([]);m.useEffect(()=>{"value"in u&&g(u.value||[])},[u.value]);const b=m.useMemo(()=>r.map(L=>typeof L=="string"||typeof L=="number"?{label:L,value:L}:L),[r]),C=L=>{w(k=>k.filter(N=>N!==L))},P=L=>{w(k=>[].concat(Za(k),[L]))},v=L=>{const k=p.indexOf(L.value),N=Za(p);k===-1?N.push(L.value):N.splice(k,1),"value"in u||g(N),c==null||c(N.filter(F=>y.includes(F)).sort((F,U)=>{const O=b.findIndex(_=>_.value===F),B=b.findIndex(_=>_.value===U);return O-B}))},T=d("checkbox",i),A=`${T}-group`,x=O0(T),[S,R,M]=gJe(T,x),D=up(u,["value","disabled"]),E=r.length?b.map(L=>m.createElement(yJe,{prefixCls:T,key:L.value.toString(),disabled:"disabled"in L?L.disabled:u.disabled,value:L.value,checked:p.includes(L.value),onChange:L.onChange,className:`${A}-item`,style:L.style,title:L.title,id:L.id,required:L.required},L.label)):o,W={toggleOption:v,value:p,disabled:u.disabled,name:u.name,registerValue:P,cancelValue:C},j=Un(A,{[`${A}-rtl`]:f==="rtl"},a,l,M,x,R);return S(m.createElement("div",Object.assign({className:j,style:s},D,{ref:e}),m.createElement(mJe.Provider,{value:W},E)))}),Li=yJe;Li.Group=bNt;Li.__ANT_CHECKBOX=!0;const AJe=m.createContext({}),SNt=t=>{const{componentCls:e}=t;return{[e]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},TNt=t=>{const{componentCls:e}=t;return{[e]:{position:"relative",maxWidth:"100%",minHeight:1}}},PNt=(t,e)=>{const{prefixCls:n,componentCls:o,gridColumns:r}=t,i={};for(let a=r;a>=0;a--)a===0?(i[`${o}${e}-${a}`]={display:"none"},i[`${o}-push-${a}`]={insetInlineStart:"auto"},i[`${o}-pull-${a}`]={insetInlineEnd:"auto"},i[`${o}${e}-push-${a}`]={insetInlineStart:"auto"},i[`${o}${e}-pull-${a}`]={insetInlineEnd:"auto"},i[`${o}${e}-offset-${a}`]={marginInlineStart:0},i[`${o}${e}-order-${a}`]={order:0}):(i[`${o}${e}-${a}`]=[{"--ant-display":"block",display:"block"},{display:"var(--ant-display)",flex:`0 0 ${a/r*100}%`,maxWidth:`${a/r*100}%`}],i[`${o}${e}-push-${a}`]={insetInlineStart:`${a/r*100}%`},i[`${o}${e}-pull-${a}`]={insetInlineEnd:`${a/r*100}%`},i[`${o}${e}-offset-${a}`]={marginInlineStart:`${a/r*100}%`},i[`${o}${e}-order-${a}`]={order:a});return i[`${o}${e}-flex`]={flex:`var(--${n}${e}-flex)`},i},due=(t,e)=>PNt(t,e),CNt=(t,e,n)=>({[`@media (min-width: ${Nt(e)})`]:Object.assign({},due(t,n))}),RNt=()=>({}),HNt=()=>({}),MNt=wl("Grid",SNt,RNt),INt=wl("Grid",t=>{const e=Ki(t,{gridColumns:24}),n={"-sm":e.screenSMMin,"-md":e.screenMDMin,"-lg":e.screenLGMin,"-xl":e.screenXLMin,"-xxl":e.screenXXLMin};return[TNt(e),due(e,""),due(e,"-xs"),Object.keys(n).map(o=>CNt(e,n[o],o)).reduce((o,r)=>Object.assign(Object.assign({},o),r),{})]},HNt);var zNt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{getPrefixCls:n,direction:o}=m.useContext(Cr),{gutter:r,wrap:i}=m.useContext(AJe),{prefixCls:a,span:l,order:s,offset:c,push:u,pull:d,className:f,children:p,flex:g,style:y}=t,w=zNt(t,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),b=n("col",a),[C,P,v]=INt(b),T={};let A={};DNt.forEach(R=>{let M={};const D=t[R];typeof D=="number"?M.span=D:typeof D=="object"&&(M=D||{}),delete w[R],A=Object.assign(Object.assign({},A),{[`${b}-${R}-${M.span}`]:M.span!==void 0,[`${b}-${R}-order-${M.order}`]:M.order||M.order===0,[`${b}-${R}-offset-${M.offset}`]:M.offset||M.offset===0,[`${b}-${R}-push-${M.push}`]:M.push||M.push===0,[`${b}-${R}-pull-${M.pull}`]:M.pull||M.pull===0,[`${b}-rtl`]:o==="rtl"}),M.flex&&(A[`${b}-${R}-flex`]=!0,T[`--${b}-${R}-flex`]=wxe(M.flex))});const x=Un(b,{[`${b}-${l}`]:l!==void 0,[`${b}-order-${s}`]:s,[`${b}-offset-${c}`]:c,[`${b}-push-${u}`]:u,[`${b}-pull-${d}`]:d},f,A,P,v),S={};if(r&&r[0]>0){const R=r[0]/2;S.paddingLeft=R,S.paddingRight=R}return g&&(S.flex=wxe(g),i===!1&&!S.minWidth&&(S.minWidth=0)),C(m.createElement("div",Object.assign({},w,{style:Object.assign(Object.assign(Object.assign({},S),y),T),className:x,ref:e}),p))});var ENt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{if(typeof t=="string"&&o(t),typeof t=="object")for(let i=0;i{r()},[JSON.stringify(t),e]),n}const on=m.forwardRef((t,e)=>{const{prefixCls:n,justify:o,align:r,className:i,style:a,children:l,gutter:s=0,wrap:c}=t,u=ENt(t,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:d,direction:f}=m.useContext(Cr),[p,g]=m.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),[y,w]=m.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),b=vxe(r,y),C=vxe(o,y),P=m.useRef(s),v=UGe();m.useEffect(()=>{const N=v.subscribe(F=>{w(F);const U=P.current||0;(!Array.isArray(U)&&typeof U=="object"||Array.isArray(U)&&(typeof U[0]=="object"||typeof U[1]=="object"))&&g(F)});return()=>v.unsubscribe(N)},[]);const T=()=>{const N=[void 0,void 0];return(Array.isArray(s)?s:[s,void 0]).forEach((U,O)=>{if(typeof U=="object")for(let B=0;B0?M[0]/-2:void 0;W&&(E.marginLeft=W,E.marginRight=W);const[j,L]=M;E.rowGap=L;const k=m.useMemo(()=>({gutter:[j,L],wrap:c}),[j,L,c]);return x(m.createElement(AJe.Provider,{value:k},m.createElement("div",Object.assign({},u,{className:D,style:Object.assign(Object.assign({},E),a),ref:e}),l)))});var wJe=be.forwardRef(function(t,e){var n=t.prefixCls,o=t.forceRender,r=t.className,i=t.style,a=t.children,l=t.isActive,s=t.role,c=be.useState(l||o),u=ln(c,2),d=u[0],f=u[1];return be.useEffect(function(){(o||l)&&f(!0)},[o,l]),d?be.createElement("div",{ref:e,className:Vn("".concat(n,"-content"),Vt(Vt({},"".concat(n,"-content-active"),l),"".concat(n,"-content-inactive"),!l),r),style:i,role:s},be.createElement("div",{className:"".concat(n,"-content-box")},a)):null});wJe.displayName="PanelContent";var FNt=["showArrow","headerClass","isActive","onItemClick","forceRender","className","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],vJe=be.forwardRef(function(t,e){var n=t.showArrow,o=n===void 0?!0:n,r=t.headerClass,i=t.isActive,a=t.onItemClick,l=t.forceRender,s=t.className,c=t.prefixCls,u=t.collapsible,d=t.accordion,f=t.panelKey,p=t.extra,g=t.header,y=t.expandIcon,w=t.openMotion,b=t.destroyInactivePanel,C=t.children,P=ii(t,FNt),v=u==="disabled",T=u==="header",A=u==="icon",x=p!=null&&typeof p!="boolean",S=function(){a==null||a(f)},R=function(L){(L.key==="Enter"||L.keyCode===Bn.ENTER||L.which===Bn.ENTER)&&S()},M=typeof y=="function"?y(t):be.createElement("i",{className:"arrow"});M&&(M=be.createElement("div",{className:"".concat(c,"-expand-icon"),onClick:["header","icon"].includes(u)?S:void 0},M));var D=Vn(Vt(Vt(Vt({},"".concat(c,"-item"),!0),"".concat(c,"-item-active"),i),"".concat(c,"-item-disabled"),v),s),E=Vn(r,Vt(Vt(Vt({},"".concat(c,"-header"),!0),"".concat(c,"-header-collapsible-only"),T),"".concat(c,"-icon-collapsible-only"),A)),W={className:E,"aria-expanded":i,"aria-disabled":v,onKeyDown:R};return!T&&!A&&(W.onClick=S,W.role=d?"tab":"button",W.tabIndex=v?-1:0),be.createElement("div",ho({},P,{ref:e,className:D}),be.createElement("div",W,o&&M,be.createElement("span",{className:"".concat(c,"-header-text"),onClick:u==="header"?S:void 0},g),x&&be.createElement("div",{className:"".concat(c,"-extra")},p)),be.createElement(o1,ho({visible:i,leavedClassName:"".concat(c,"-content-hidden")},w,{forceRender:l,removeOnLeave:b}),function(j,L){var k=j.className,N=j.style;return be.createElement(wJe,{ref:L,prefixCls:c,className:k,style:N,isActive:i,forceRender:l,role:d?"tabpanel":void 0},C)}))}),kNt=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],LNt=function(e,n){var o=n.prefixCls,r=n.accordion,i=n.collapsible,a=n.destroyInactivePanel,l=n.onItemClick,s=n.activeKey,c=n.openMotion,u=n.expandIcon;return e.map(function(d,f){var p=d.children,g=d.label,y=d.key,w=d.collapsible,b=d.onItemClick,C=d.destroyInactivePanel,P=ii(d,kNt),v=String(y??f),T=w??i,A=C??a,x=function(M){T!=="disabled"&&(l(M),b==null||b(M))},S=!1;return r?S=s[0]===v:S=s.indexOf(v)>-1,be.createElement(vJe,ho({},P,{prefixCls:o,key:v,panelKey:v,isActive:S,accordion:r,openMotion:c,expandIcon:u,header:g,collapsible:T,onItemClick:x,destroyInactivePanel:A}),p)})},WNt=function(e,n,o){if(!e)return null;var r=o.prefixCls,i=o.accordion,a=o.collapsible,l=o.destroyInactivePanel,s=o.onItemClick,c=o.activeKey,u=o.openMotion,d=o.expandIcon,f=e.key||String(n),p=e.props,g=p.header,y=p.headerClass,w=p.destroyInactivePanel,b=p.collapsible,C=p.onItemClick,P=!1;i?P=c[0]===f:P=c.indexOf(f)>-1;var v=b??a,T=function(S){v!=="disabled"&&(s(S),C==null||C(S))},A={key:f,panelKey:f,header:g,headerClass:y,isActive:P,prefixCls:r,destroyInactivePanel:w??l,openMotion:u,accordion:i,children:e.props.children,onItemClick:T,expandIcon:d,collapsible:v};return typeof e.type=="string"?e:(Object.keys(A).forEach(function(x){typeof A[x]>"u"&&delete A[x]}),be.cloneElement(e,A))};function NNt(t,e,n){return Array.isArray(t)?LNt(t,n):ow(e).map(function(o,r){return WNt(o,r,n)})}function UNt(t){var e=t;if(!Array.isArray(e)){var n=hi(e);e=n==="number"||n==="string"?[e]:[]}return e.map(function(o){return String(o)})}var jNt=be.forwardRef(function(t,e){var n=t.prefixCls,o=n===void 0?"rc-collapse":n,r=t.destroyInactivePanel,i=r===void 0?!1:r,a=t.style,l=t.accordion,s=t.className,c=t.children,u=t.collapsible,d=t.openMotion,f=t.expandIcon,p=t.activeKey,g=t.defaultActiveKey,y=t.onChange,w=t.items,b=Vn(o,s),C=zs([],{value:p,onChange:function(R){return y==null?void 0:y(R)},defaultValue:g,postState:UNt}),P=ln(C,2),v=P[0],T=P[1],A=function(R){return T(function(){if(l)return v[0]===R?[]:[R];var M=v.indexOf(R),D=M>-1;return D?v.filter(function(E){return E!==R}):[].concat(Lo(v),[R])})};j0(!c,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var x=NNt(w,c,{prefixCls:o,accordion:l,openMotion:d,expandIcon:f,collapsible:u,destroyInactivePanel:i,onItemClick:A,activeKey:v});return be.createElement("div",ho({ref:e,className:b,style:a,role:l?"tablist":void 0},Sf(t,{aria:!0,data:!0})),x)});const iye=Object.assign(jNt,{Panel:vJe});iye.Panel;const BNt=m.forwardRef((t,e)=>{const{getPrefixCls:n}=m.useContext(Cr),{prefixCls:o,className:r,showArrow:i=!0}=t,a=n("collapse",o),l=Un({[`${a}-no-arrow`]:!i},r);return m.createElement(iye.Panel,Object.assign({ref:e},t,{prefixCls:a,className:l}))}),YNt=t=>{const{componentCls:e,contentBg:n,padding:o,headerBg:r,headerPadding:i,collapseHeaderPaddingSM:a,collapseHeaderPaddingLG:l,collapsePanelBorderRadius:s,lineWidth:c,lineType:u,colorBorder:d,colorText:f,colorTextHeading:p,colorTextDisabled:g,fontSizeLG:y,lineHeight:w,lineHeightLG:b,marginSM:C,paddingSM:P,paddingLG:v,paddingXS:T,motionDurationSlow:A,fontSizeIcon:x,contentPadding:S,fontHeight:R,fontHeightLG:M}=t,D=`${Nt(c)} ${u} ${d}`;return{[e]:Object.assign(Object.assign({},ja(t)),{backgroundColor:r,border:D,borderRadius:s,"&-rtl":{direction:"rtl"},[`& > ${e}-item`]:{borderBottom:D,"&:last-child":{[` &, & > ${e}-header`]:{borderRadius:`0 0 ${Nt(s)} ${Nt(s)}`}},[`> ${e}-header`]:{position:"relative",display:"flex",flexWrap:"nowrap",alignItems:"flex-start",padding:i,color:p,lineHeight:w,cursor:"pointer",transition:`all ${A}, visibility 0s`,[`> ${e}-header-text`]:{flex:"auto"},"&:focus":{outline:"none"},[`${e}-expand-icon`]:{height:R,display:"flex",alignItems:"center",paddingInlineEnd:C},[`${e}-arrow`]:Object.assign(Object.assign({},WH()),{fontSize:x,transition:`transform ${A}`,svg:{transition:`transform ${A}`}}),[`${e}-header-text`]:{marginInlineEnd:"auto"}},[`${e}-icon-collapsible-only`]:{cursor:"unset",[`${e}-expand-icon`]:{cursor:"pointer"}}},[`${e}-content`]:{color:f,backgroundColor:n,borderTop:D,[`& > ${e}-content-box`]:{padding:S},"&-hidden":{display:"none"}},"&-small":{[`> ${e}-item`]:{[`> ${e}-header`]:{padding:a,paddingInlineStart:T,[`> ${e}-expand-icon`]:{marginInlineStart:t.calc(P).sub(T).equal()}},[`> ${e}-content > ${e}-content-box`]:{padding:P}}},"&-large":{[`> ${e}-item`]:{fontSize:y,lineHeight:b,[`> ${e}-header`]:{padding:l,paddingInlineStart:o,[`> ${e}-expand-icon`]:{height:M,marginInlineStart:t.calc(v).sub(o).equal()}},[`> ${e}-content > ${e}-content-box`]:{padding:v}}},[`${e}-item:last-child`]:{borderBottom:0,[`> ${e}-content`]:{borderRadius:`0 0 ${Nt(s)} ${Nt(s)}`}},[`& ${e}-item-disabled > ${e}-header`]:{"\n &,\n & > .arrow\n ":{color:g,cursor:"not-allowed"}},[`&${e}-icon-position-end`]:{[`& > ${e}-item`]:{[`> ${e}-header`]:{[`${e}-expand-icon`]:{order:1,paddingInlineEnd:0,paddingInlineStart:C}}}}})}},ONt=t=>{const{componentCls:e}=t,n=`> ${e}-item > ${e}-header ${e}-arrow`;return{[`${e}-rtl`]:{[n]:{transform:"rotate(180deg)"}}}},_Nt=t=>{const{componentCls:e,headerBg:n,paddingXXS:o,colorBorder:r}=t;return{[`${e}-borderless`]:{backgroundColor:n,border:0,[`> ${e}-item`]:{borderBottom:`1px solid ${r}`},[` > ${e}-item:last-child, > ${e}-item:last-child ${e}-header - `]:{borderRadius:0},[`> ${e}-item:last-child`]:{borderBottom:0},[`> ${e}-item > ${e}-content`]:{backgroundColor:"transparent",borderTop:0},[`> ${e}-item > ${e}-content > ${e}-content-box`]:{paddingTop:o}}}},VNt=t=>{const{componentCls:e,paddingSM:n}=t;return{[`${e}-ghost`]:{backgroundColor:"transparent",border:0,[`> ${e}-item`]:{borderBottom:0,[`> ${e}-content`]:{backgroundColor:"transparent",border:0,[`> ${e}-content-box`]:{paddingBlock:n}}}}}},GNt=t=>({headerPadding:`${t.paddingSM}px ${t.padding}px`,headerBg:t.colorFillAlter,contentPadding:`${t.padding}px 16px`,contentBg:t.colorBgContainer}),XNt=wl("Collapse",t=>{const e=Ki(t,{collapseHeaderPaddingSM:`${Nt(t.paddingXS)} ${Nt(t.paddingSM)}`,collapseHeaderPaddingLG:`${Nt(t.padding)} ${Nt(t.paddingLG)}`,collapsePanelBorderRadius:t.borderRadiusLG});return[YNt(e),_Nt(e),VNt(e),ONt(e),Rme(e)]},GNt),JNt=m.forwardRef((t,e)=>{const{getPrefixCls:n,direction:o,collapse:r}=m.useContext(Cr),{prefixCls:i,className:a,rootClassName:l,style:s,bordered:c=!0,ghost:u,size:d,expandIconPosition:f="start",children:p,expandIcon:g}=t,y=Ed(D=>{var E;return(E=d??D)!==null&&E!==void 0?E:"middle"}),w=n("collapse",i),b=n(),[C,P,v]=XNt(w),T=m.useMemo(()=>f==="left"?"start":f==="right"?"end":f,[f]),A=g??(r==null?void 0:r.expandIcon),x=m.useCallback(function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const E=typeof A=="function"?A(D):m.createElement(NG,{rotate:D.isActive?90:void 0});return B0(E,()=>{var W;return{className:Un((W=E==null?void 0:E.props)===null||W===void 0?void 0:W.className,`${w}-arrow`)}})},[A,w]),S=Un(`${w}-icon-position-${T}`,{[`${w}-borderless`]:!c,[`${w}-rtl`]:o==="rtl",[`${w}-ghost`]:!!u,[`${w}-${y}`]:y!=="middle"},r==null?void 0:r.className,a,l,P,v),R=Object.assign(Object.assign({},xme(b)),{motionAppear:!1,leavedClassName:`${w}-content-hidden`}),M=m.useMemo(()=>p?B9(p).map((D,E)=>{var W,j;if(!((W=D.props)===null||W===void 0)&&W.disabled){const L=(j=D.key)!==null&&j!==void 0?j:String(E),{disabled:k,collapsible:N}=D.props,F=Object.assign(Object.assign({},up(D.props,["disabled"])),{key:L,collapsible:N??(k?"disabled":void 0)});return B0(D,F)}return D}):null,[p]);return C(m.createElement(rye,Object.assign({ref:e,openMotion:R},up(t,["rootClassName"]),{expandIcon:x,prefixCls:w,className:S,style:Object.assign(Object.assign({},r==null?void 0:r.style),s)}),M))}),iye=Object.assign(JNt,{Panel:BNt}),KNt=t=>{const{componentCls:e,sizePaddingEdgeHorizontal:n,colorSplit:o,lineWidth:r,textPaddingInline:i,orientationMargin:a,verticalMarginInline:l}=t;return{[e]:Object.assign(Object.assign({},ja(t)),{borderBlockStart:`${Nt(r)} solid ${o}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:l,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${Nt(r)} solid ${o}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${Nt(t.dividerHorizontalGutterMargin)} 0`},[`&-horizontal${e}-with-text`]:{display:"flex",alignItems:"center",margin:`${Nt(t.dividerHorizontalWithTextGutterMargin)} 0`,color:t.colorTextHeading,fontWeight:500,fontSize:t.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${o}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${Nt(r)} solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${e}-with-text-left`]:{"&::before":{width:`calc(${a} * 100%)`},"&::after":{width:`calc(100% - ${a} * 100%)`}},[`&-horizontal${e}-with-text-right`]:{"&::before":{width:`calc(100% - ${a} * 100%)`},"&::after":{width:`calc(${a} * 100%)`}},[`${e}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:i},"&-dashed":{background:"none",borderColor:o,borderStyle:"dashed",borderWidth:`${Nt(r)} 0 0`},[`&-horizontal${e}-with-text${e}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${e}-dashed`]:{borderInlineStartWidth:r,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${e}-with-text`]:{color:t.colorText,fontWeight:"normal",fontSize:t.fontSize},[`&-horizontal${e}-with-text-left${e}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${e}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${e}-with-text-right${e}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${e}-inner-text`]:{paddingInlineEnd:n}}})}},qNt=t=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:t.marginXS}),$Nt=wl("Divider",t=>{const e=Ki(t,{dividerHorizontalWithTextGutterMargin:t.margin,dividerHorizontalGutterMargin:t.marginLG,sizePaddingEdgeHorizontal:0});return[KNt(e)]},qNt,{unitless:{orientationMargin:!0}});var QNt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{getPrefixCls:e,direction:n,divider:o}=m.useContext(Cr),{prefixCls:r,type:i="horizontal",orientation:a="center",orientationMargin:l,className:s,rootClassName:c,children:u,dashed:d,plain:f,style:p}=t,g=QNt(t,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),y=e("divider",r),[w,b,C]=$Nt(y),P=a.length>0?`-${a}`:a,v=!!u,T=a==="left"&&l!=null,A=a==="right"&&l!=null,x=Un(y,o==null?void 0:o.className,b,C,`${y}-${i}`,{[`${y}-with-text`]:v,[`${y}-with-text${P}`]:v,[`${y}-dashed`]:!!d,[`${y}-plain`]:!!f,[`${y}-rtl`]:n==="rtl",[`${y}-no-default-orientation-margin-left`]:T,[`${y}-no-default-orientation-margin-right`]:A},s,c),S=m.useMemo(()=>typeof l=="number"?l:/^\d+$/.test(l)?Number(l):l,[l]),R=Object.assign(Object.assign({},T&&{marginLeft:S}),A&&{marginRight:S});return w(m.createElement("div",Object.assign({className:x,style:Object.assign(Object.assign({},o==null?void 0:o.style),p)},g,{role:"separator"}),u&&i!=="vertical"&&m.createElement("span",{className:`${y}-inner-text`,style:R},u)))};var ZNt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},eUt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:ZNt}))},tUt=m.forwardRef(eUt);function fue(){return typeof BigInt=="function"}function xJe(t){return!t&&t!==0&&!Number.isNaN(t)||!String(t).trim()}function mx(t){var e=t.trim(),n=e.startsWith("-");n&&(e=e.slice(1)),e=e.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),e.startsWith(".")&&(e="0".concat(e));var o=e||"0",r=o.split("."),i=r[0]||"0",a=r[1]||"0";i==="0"&&a==="0"&&(n=!1);var l=n?"-":"";return{negative:n,negativeStr:l,trimStr:o,integerStr:i,decimalStr:a,fullStr:"".concat(l).concat(o)}}function aye(t){var e=String(t);return!Number.isNaN(Number(e))&&e.includes("e")}function Uv(t){var e=String(t);if(aye(t)){var n=Number(e.slice(e.indexOf("e-")+2)),o=e.match(/\.(\d+)/);return o!=null&&o[1]&&(n+=o[1].length),n}return e.includes(".")&&lye(e)?e.length-e.indexOf(".")-1:0}function sQ(t){var e=String(t);if(aye(t)){if(t>Number.MAX_SAFE_INTEGER)return String(fue()?BigInt(t).toString():Number.MAX_SAFE_INTEGER);if(t0&&arguments[0]!==void 0?arguments[0]:!0;return n?this.isInvalidate()?"":mx("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),t}(),oUt=function(){function t(e){if(Ap(this,t),Vt(this,"origin",""),Vt(this,"number",void 0),Vt(this,"empty",void 0),xJe(e)){this.empty=!0;return}this.origin=String(e),this.number=Number(e)}return wp(t,[{key:"negate",value:function(){return new t(-this.toNumber())}},{key:"add",value:function(n){if(this.isInvalidate())return new t(n);var o=Number(n);if(Number.isNaN(o))return this;var r=this.number+o;if(r>Number.MAX_SAFE_INTEGER)return new t(Number.MAX_SAFE_INTEGER);if(rNumber.MAX_SAFE_INTEGER)return new t(Number.MAX_SAFE_INTEGER);if(r0&&arguments[0]!==void 0?arguments[0]:!0;return n?this.isInvalidate()?"":sQ(this.number):this.origin}}]),t}();function r2(t){return fue()?new nUt(t):new oUt(t)}function K_(t,e,n){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(t==="")return"";var r=mx(t),i=r.negativeStr,a=r.integerStr,l=r.decimalStr,s="".concat(e).concat(l),c="".concat(i).concat(a);if(n>=0){var u=Number(l[n]);if(u>=5&&!o){var d=r2(t).add("".concat(i,"0.").concat("0".repeat(n)).concat(10-u));return K_(d.toString(),e,n,o)}return n===0?c:"".concat(c).concat(e).concat(l.padEnd(n,"0").slice(0,n))}return s===".0"?c:"".concat(c).concat(s)}function rUt(t){return!!(t.addonBefore||t.addonAfter)}function iUt(t){return!!(t.prefix||t.suffix||t.allowClear)}function xxe(t,e,n){var o=e.cloneNode(!0),r=Object.create(t,{target:{value:o},currentTarget:{value:o}});return o.value=n,typeof e.selectionStart=="number"&&typeof e.selectionEnd=="number"&&(o.selectionStart=e.selectionStart,o.selectionEnd=e.selectionEnd),r}function VG(t,e,n,o){if(n){var r=e;if(e.type==="click"){r=xxe(e,t,""),n(r);return}if(t.type!=="file"&&o!==void 0){r=xxe(e,t,o),n(r);return}n(r)}}function bJe(t,e){if(t){t.focus(e);var n=e||{},o=n.cursor;if(o){var r=t.value.length;switch(o){case"start":t.setSelectionRange(0,0);break;case"end":t.setSelectionRange(r,r);break;default:t.setSelectionRange(0,r)}}}}var sye=function(e){var n,o,r=e.inputElement,i=e.children,a=e.prefixCls,l=e.prefix,s=e.suffix,c=e.addonBefore,u=e.addonAfter,d=e.className,f=e.style,p=e.disabled,g=e.readOnly,y=e.focused,w=e.triggerFocus,b=e.allowClear,C=e.value,P=e.handleReset,v=e.hidden,T=e.classes,A=e.classNames,x=e.dataAttrs,S=e.styles,R=e.components,M=i??r,D=(R==null?void 0:R.affixWrapper)||"span",E=(R==null?void 0:R.groupWrapper)||"span",W=(R==null?void 0:R.wrapper)||"span",j=(R==null?void 0:R.groupAddon)||"span",L=m.useRef(null),k=function(ge){var de;(de=L.current)!==null&&de!==void 0&&de.contains(ge.target)&&(w==null||w())},N=iUt(e),F=m.cloneElement(M,{value:C,className:Vn(M.props.className,!N&&(A==null?void 0:A.variant))||null});if(N){var U,O=null;if(b){var B,_=!p&&!g&&C,X="".concat(a,"-clear-icon"),$=hi(b)==="object"&&b!==null&&b!==void 0&&b.clearIcon?b.clearIcon:"✖";O=be.createElement("span",{onClick:P,onMouseDown:function(ge){return ge.preventDefault()},className:Vn(X,(B={},Vt(B,"".concat(X,"-hidden"),!_),Vt(B,"".concat(X,"-has-suffix"),!!s),B)),role:"button",tabIndex:-1},$)}var Q="".concat(a,"-affix-wrapper"),le=Vn(Q,(U={},Vt(U,"".concat(a,"-disabled"),p),Vt(U,"".concat(Q,"-disabled"),p),Vt(U,"".concat(Q,"-focused"),y),Vt(U,"".concat(Q,"-readonly"),g),Vt(U,"".concat(Q,"-input-with-clear-btn"),s&&b&&C),U),T==null?void 0:T.affixWrapper,A==null?void 0:A.affixWrapper,A==null?void 0:A.variant),q=(s||b)&&be.createElement("span",{className:Vn("".concat(a,"-suffix"),A==null?void 0:A.suffix),style:S==null?void 0:S.suffix},O,s);F=be.createElement(D,ho({className:le,style:S==null?void 0:S.affixWrapper,onClick:k},x==null?void 0:x.affixWrapper,{ref:L}),l&&be.createElement("span",{className:Vn("".concat(a,"-prefix"),A==null?void 0:A.prefix),style:S==null?void 0:S.prefix},l),F,q)}if(rUt(e)){var te="".concat(a,"-group"),re="".concat(te,"-addon"),ae="".concat(te,"-wrapper"),se=Vn("".concat(a,"-wrapper"),te,T==null?void 0:T.wrapper,A==null?void 0:A.wrapper),ne=Vn(ae,Vt({},"".concat(ae,"-disabled"),p),T==null?void 0:T.group,A==null?void 0:A.groupWrapper);F=be.createElement(E,{className:ne},be.createElement(W,{className:se},c&&be.createElement(j,{className:re},c),F,u&&be.createElement(j,{className:re},u)))}return be.cloneElement(F,{className:Vn((n=F.props)===null||n===void 0?void 0:n.className,d)||null,style:qt(qt({},(o=F.props)===null||o===void 0?void 0:o.style),f),hidden:v})},aUt=["show"];function SJe(t,e){return m.useMemo(function(){var n={};e&&(n.show=hi(e)==="object"&&e.formatter?e.formatter:!!e),n=qt(qt({},n),t);var o=n,r=o.show,i=ii(o,aUt);return qt(qt({},i),{},{show:!!r,showFormatter:typeof r=="function"?r:void 0,strategy:i.strategy||function(a){return a.length}})},[t,e])}var lUt=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],sUt=m.forwardRef(function(t,e){var n=t.autoComplete,o=t.onChange,r=t.onFocus,i=t.onBlur,a=t.onPressEnter,l=t.onKeyDown,s=t.prefixCls,c=s===void 0?"rc-input":s,u=t.disabled,d=t.htmlSize,f=t.className,p=t.maxLength,g=t.suffix,y=t.showCount,w=t.count,b=t.type,C=b===void 0?"text":b,P=t.classes,v=t.classNames,T=t.styles,A=t.onCompositionStart,x=t.onCompositionEnd,S=ii(t,lUt),R=m.useState(!1),M=ln(R,2),D=M[0],E=M[1],W=m.useRef(!1),j=m.useRef(null),L=function(Se){j.current&&bJe(j.current,Se)},k=zs(t.defaultValue,{value:t.value}),N=ln(k,2),F=N[0],U=N[1],O=F==null?"":String(F),B=m.useState(null),_=ln(B,2),X=_[0],$=_[1],Q=SJe(w,y),le=Q.max||p,q=Q.strategy(O),te=!!le&&q>le;m.useImperativeHandle(e,function(){return{focus:L,blur:function(){var Se;(Se=j.current)===null||Se===void 0||Se.blur()},setSelectionRange:function(Se,ze,Ie){var ye;(ye=j.current)===null||ye===void 0||ye.setSelectionRange(Se,ze,Ie)},select:function(){var Se;(Se=j.current)===null||Se===void 0||Se.select()},input:j.current}}),m.useEffect(function(){E(function(He){return He&&u?!1:He})},[u]);var re=function(Se,ze,Ie){var ye=ze;if(!W.current&&Q.exceedFormatter&&Q.max&&Q.strategy(ze)>Q.max){if(ye=Q.exceedFormatter(ze,{max:Q.max}),ze!==ye){var ce,pe;$([((ce=j.current)===null||ce===void 0?void 0:ce.selectionStart)||0,((pe=j.current)===null||pe===void 0?void 0:pe.selectionEnd)||0])}}else if(Ie.source==="compositionEnd")return;U(ye),j.current&&VG(j.current,Se,o,ye)};m.useEffect(function(){if(X){var He;(He=j.current)===null||He===void 0||He.setSelectionRange.apply(He,Lo(X))}},[X]);var ae=function(Se){re(Se,Se.target.value,{source:"change"})},se=function(Se){W.current=!1,re(Se,Se.currentTarget.value,{source:"compositionEnd"}),x==null||x(Se)},ne=function(Se){a&&Se.key==="Enter"&&a(Se),l==null||l(Se)},fe=function(Se){E(!0),r==null||r(Se)},ge=function(Se){E(!1),i==null||i(Se)},de=function(Se){U(""),L(),j.current&&VG(j.current,Se,o)},Z=te&&"".concat(c,"-out-of-range"),he=function(){var Se=jH(t,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames"]);return be.createElement("input",ho({autoComplete:n},Se,{onChange:ae,onFocus:fe,onBlur:ge,onKeyDown:ne,className:Vn(c,Vt({},"".concat(c,"-disabled"),u),v==null?void 0:v.input),style:T==null?void 0:T.input,ref:j,size:d,type:C,onCompositionStart:function(Ie){W.current=!0,A==null||A(Ie)},onCompositionEnd:se}))},xe=function(){var Se=Number(le)>0;if(g||Q.show){var ze=Q.showFormatter?Q.showFormatter({value:O,count:q,maxLength:le}):"".concat(q).concat(Se?" / ".concat(le):"");return be.createElement(be.Fragment,null,Q.show&&be.createElement("span",{className:Vn("".concat(c,"-show-count-suffix"),Vt({},"".concat(c,"-show-count-has-suffix"),!!g),v==null?void 0:v.count),style:qt({},T==null?void 0:T.count)},ze),g)}return null};return be.createElement(sye,ho({},S,{prefixCls:c,className:Vn(f,Z),handleReset:de,value:O,focused:D,triggerFocus:L,suffix:xe(),disabled:u,classes:P,classNames:v,styles:T}),he())});function cUt(t,e){var n=m.useRef(null);function o(){try{var i=t.selectionStart,a=t.selectionEnd,l=t.value,s=l.substring(0,i),c=l.substring(a);n.current={start:i,end:a,value:l,beforeTxt:s,afterTxt:c}}catch{}}function r(){if(t&&n.current&&e)try{var i=t.value,a=n.current,l=a.beforeTxt,s=a.afterTxt,c=a.start,u=i.length;if(i.endsWith(s))u=i.length-n.current.afterTxt.length;else if(i.startsWith(l))u=l.length;else{var d=l[c-1],f=i.indexOf(d,c-1);f!==-1&&(u=f+1)}t.setSelectionRange(u,u)}catch(p){j0(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(p.message))}}return[o,r]}var uUt=function(){var e=m.useState(!1),n=ln(e,2),o=n[0],r=n[1];return Xa(function(){r(O$())},[]),o},dUt=200,fUt=600;function hUt(t){var e=t.prefixCls,n=t.upNode,o=t.downNode,r=t.upDisabled,i=t.downDisabled,a=t.onStep,l=m.useRef(),s=m.useRef([]),c=m.useRef();c.current=a;var u=function(){clearTimeout(l.current)},d=function(P,v){P.preventDefault(),u(),c.current(v);function T(){c.current(v),l.current=setTimeout(T,dUt)}l.current=setTimeout(T,fUt)};m.useEffect(function(){return function(){u(),s.current.forEach(function(C){return Fa.cancel(C)})}},[]);var f=uUt();if(f)return null;var p="".concat(e,"-handler"),g=Vn(p,"".concat(p,"-up"),Vt({},"".concat(p,"-up-disabled"),r)),y=Vn(p,"".concat(p,"-down"),Vt({},"".concat(p,"-down-disabled"),i)),w=function(){return s.current.push(Fa(u))},b={unselectable:"on",role:"button",onMouseUp:w,onMouseLeave:w};return m.createElement("div",{className:"".concat(p,"-wrap")},m.createElement("span",ho({},b,{onMouseDown:function(P){d(P,!0)},"aria-label":"Increase Value","aria-disabled":r,className:g}),n||m.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-up-inner")})),m.createElement("span",ho({},b,{onMouseDown:function(P){d(P,!1)},"aria-label":"Decrease Value","aria-disabled":i,className:y}),o||m.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-down-inner")})))}function bxe(t){var e=typeof t=="number"?sQ(t):mx(t).fullStr,n=e.includes(".");return n?mx(e.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:t+"0"}const pUt=function(){var t=m.useRef(0),e=function(){Fa.cancel(t.current)};return m.useEffect(function(){return e},[]),function(n){e(),t.current=Fa(function(){n()})}};var gUt=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","changeOnWheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur"],mUt=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],Sxe=function(e,n){return e||n.isEmpty()?n.toString():n.toNumber()},Txe=function(e){var n=r2(e);return n.isInvalidate()?null:n},yUt=m.forwardRef(function(t,e){var n,o=t.prefixCls,r=o===void 0?"rc-input-number":o,i=t.className,a=t.style,l=t.min,s=t.max,c=t.step,u=c===void 0?1:c,d=t.defaultValue,f=t.value,p=t.disabled,g=t.readOnly,y=t.upHandler,w=t.downHandler,b=t.keyboard,C=t.changeOnWheel,P=C===void 0?!1:C,v=t.controls,T=v===void 0?!0:v;t.classNames;var A=t.stringMode,x=t.parser,S=t.formatter,R=t.precision,M=t.decimalSeparator,D=t.onChange,E=t.onInput,W=t.onPressEnter,j=t.onStep,L=t.changeOnBlur,k=L===void 0?!0:L,N=ii(t,gUt),F="".concat(r,"-input"),U=m.useRef(null),O=m.useState(!1),B=ln(O,2),_=B[0],X=B[1],$=m.useRef(!1),Q=m.useRef(!1),le=m.useRef(!1),q=m.useState(function(){return r2(f??d)}),te=ln(q,2),re=te[0],ae=te[1];function se(ct){f===void 0&&ae(ct)}var ne=m.useCallback(function(ct,Xe){if(!Xe)return R>=0?R:Math.max(Uv(ct),Uv(u))},[R,u]),fe=m.useCallback(function(ct){var Xe=String(ct);if(x)return x(Xe);var ut=Xe;return M&&(ut=ut.replace(M,".")),ut.replace(/[^\w.-]+/g,"")},[x,M]),ge=m.useRef(""),de=m.useCallback(function(ct,Xe){if(S)return S(ct,{userTyping:Xe,input:String(ge.current)});var ut=typeof ct=="number"?sQ(ct):ct;if(!Xe){var ft=ne(ut,Xe);if(lye(ut)&&(M||ft>=0)){var ot=M||".";ut=K_(ut,ot,ft)}}return ut},[S,ne,M]),Z=m.useState(function(){var ct=d??f;return re.isInvalidate()&&["string","number"].includes(hi(ct))?Number.isNaN(ct)?"":ct:de(re.toString(),!1)}),he=ln(Z,2),xe=he[0],He=he[1];ge.current=xe;function Se(ct,Xe){He(de(ct.isInvalidate()?ct.toString(!1):ct.toString(!Xe),Xe))}var ze=m.useMemo(function(){return Txe(s)},[s,R]),Ie=m.useMemo(function(){return Txe(l)},[l,R]),ye=m.useMemo(function(){return!ze||!re||re.isInvalidate()?!1:ze.lessEquals(re)},[ze,re]),ce=m.useMemo(function(){return!Ie||!re||re.isInvalidate()?!1:re.lessEquals(Ie)},[Ie,re]),pe=cUt(U.current,_),ve=ln(pe,2),Ae=ve[0],Te=ve[1],Me=function(Xe){return ze&&!Xe.lessEquals(ze)?ze:Ie&&!Ie.lessEquals(Xe)?Ie:null},Pe=function(Xe){return!Me(Xe)},Ee=function(Xe,ut){var ft=Xe,ot=Pe(ft)||ft.isEmpty();if(!ft.isEmpty()&&!ut&&(ft=Me(ft)||ft,ot=!0),!g&&!p&&ot){var st=ft.toString(),at=ne(st,ut);return at>=0&&(ft=r2(K_(st,".",at)),Pe(ft)||(ft=r2(K_(st,".",at,!0)))),ft.equals(re)||(se(ft),D==null||D(ft.isEmpty()?null:Sxe(A,ft)),f===void 0&&Se(ft,ut)),ft}return re},Be=pUt(),Je=function ct(Xe){if(Ae(),ge.current=Xe,He(Xe),!Q.current){var ut=fe(Xe),ft=r2(ut);ft.isNaN()||Ee(ft,!0)}E==null||E(Xe),Be(function(){var ot=Xe;x||(ot=Xe.replace(/。/g,".")),ot!==Xe&&ct(ot)})},We=function(){Q.current=!0},Ke=function(){Q.current=!1,Je(U.current.value)},Ne=function(Xe){Je(Xe.target.value)},De=function(Xe){var ut;if(!(Xe&&ye||!Xe&&ce)){$.current=!1;var ft=r2(le.current?bxe(u):u);Xe||(ft=ft.negate());var ot=(re||r2(0)).add(ft.toString()),st=Ee(ot,!1);j==null||j(Sxe(A,st),{offset:le.current?bxe(u):u,type:Xe?"up":"down"}),(ut=U.current)===null||ut===void 0||ut.focus()}},ke=function(Xe){var ut=r2(fe(xe)),ft=ut;ut.isNaN()?ft=Ee(re,Xe):ft=Ee(ut,Xe),f!==void 0?Se(re,!1):ft.isNaN()||Se(ft,!1)},Ye=function(){$.current=!0},it=function(Xe){var ut=Xe.key,ft=Xe.shiftKey;$.current=!0,le.current=ft,ut==="Enter"&&(Q.current||($.current=!1),ke(!1),W==null||W(Xe)),b!==!1&&!Q.current&&["Up","ArrowUp","Down","ArrowDown"].includes(ut)&&(De(ut==="Up"||ut==="ArrowUp"),Xe.preventDefault())},Ve=function(){$.current=!1,le.current=!1};m.useEffect(function(){if(P&&_){var ct=function(ft){De(ft.deltaY<0),ft.preventDefault()},Xe=U.current;if(Xe)return Xe.addEventListener("wheel",ct,{passive:!1}),function(){return Xe.removeEventListener("wheel",ct)}}});var yt=function(){k&&ke(!1),X(!1),$.current=!1};return fx(function(){re.isInvalidate()||Se(re,!1)},[R,S]),fx(function(){var ct=r2(f);ae(ct);var Xe=r2(fe(xe));(!ct.equals(Xe)||!$.current||S)&&Se(ct,$.current)},[f]),fx(function(){S&&Te()},[xe]),m.createElement("div",{className:Vn(r,i,(n={},Vt(n,"".concat(r,"-focused"),_),Vt(n,"".concat(r,"-disabled"),p),Vt(n,"".concat(r,"-readonly"),g),Vt(n,"".concat(r,"-not-a-number"),re.isNaN()),Vt(n,"".concat(r,"-out-of-range"),!re.isInvalidate()&&!Pe(re)),n)),style:a,onFocus:function(){X(!0)},onBlur:yt,onKeyDown:it,onKeyUp:Ve,onCompositionStart:We,onCompositionEnd:Ke,onBeforeInput:Ye},T&&m.createElement(hUt,{prefixCls:r,upNode:y,downNode:w,upDisabled:ye,downDisabled:ce,onStep:De}),m.createElement("div",{className:"".concat(F,"-wrap")},m.createElement("input",ho({autoComplete:"off",role:"spinbutton","aria-valuemin":l,"aria-valuemax":s,"aria-valuenow":re.isInvalidate()?null:re.toString(),step:u},N,{ref:Fb(U,e),className:F,value:xe,onChange:Ne,disabled:p,readOnly:g}))))}),TJe=m.forwardRef(function(t,e){var n=t.disabled,o=t.style,r=t.prefixCls,i=t.value,a=t.prefix,l=t.suffix,s=t.addonBefore,c=t.addonAfter,u=t.className,d=t.classNames,f=ii(t,mUt),p=m.useRef(null),g=function(w){p.current&&bJe(p.current,w)};return m.createElement(sye,{className:u,triggerFocus:g,prefixCls:r,value:i,disabled:n,style:o,prefix:a,suffix:l,addonAfter:c,addonBefore:s,classNames:d,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}},m.createElement(yUt,ho({prefixCls:r,disabled:n,ref:Fb(p,e),className:d==null?void 0:d.input},f)))});TJe.displayName="InputNumber";const AUt=t=>{var e;const n=(e=t.handleVisible)!==null&&e!==void 0?e:"auto";return Object.assign(Object.assign({},XW(t)),{controlWidth:90,handleWidth:t.controlHeightSM-t.lineWidth*2,handleFontSize:t.fontSize/2,handleVisible:n,handleActiveBg:t.colorFillAlter,handleBg:t.colorBgContainer,filledHandleBg:new kl(t.colorFillSecondary).onBackground(t.colorBgContainer).toHexString(),handleHoverColor:t.colorPrimary,handleBorderColor:t.colorBorder,handleOpacity:n===!0?1:0})},Pxe=(t,e)=>{let{componentCls:n,borderRadiusSM:o,borderRadiusLG:r}=t;const i=e==="lg"?r:o;return{[`&-${e}`]:{[`${n}-handler-wrap`]:{borderStartEndRadius:i,borderEndEndRadius:i},[`${n}-handler-up`]:{borderStartEndRadius:i},[`${n}-handler-down`]:{borderEndEndRadius:i}}}},wUt=t=>{const{componentCls:e,lineWidth:n,lineType:o,borderRadius:r,fontSizeLG:i,controlHeightLG:a,controlHeightSM:l,colorError:s,paddingInlineSM:c,paddingBlockSM:u,paddingBlockLG:d,paddingInlineLG:f,colorTextDescription:p,motionDurationMid:g,handleHoverColor:y,paddingInline:w,paddingBlock:b,handleBg:C,handleActiveBg:P,colorTextDisabled:v,borderRadiusSM:T,borderRadiusLG:A,controlWidth:x,handleOpacity:S,handleBorderColor:R,filledHandleBg:M,lineHeightLG:D,calc:E}=t;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),JW(t)),{display:"inline-block",width:x,margin:0,padding:0,borderRadius:r}),Qme(t,{[`${e}-handler-wrap`]:{background:C,[`${e}-handler-down`]:{borderBlockStart:`${Nt(n)} ${o} ${R}`}}})),eye(t,{[`${e}-handler-wrap`]:{background:M,[`${e}-handler-down`]:{borderBlockStart:`${Nt(n)} ${o} ${R}`}},"&:focus-within":{[`${e}-handler-wrap`]:{background:C}}})),Zme(t)),{"&-rtl":{direction:"rtl",[`${e}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:i,lineHeight:D,borderRadius:A,[`input${e}-input`]:{height:E(a).sub(E(n).mul(2)).equal(),padding:`${Nt(d)} ${Nt(f)}`}},"&-sm":{padding:0,borderRadius:T,[`input${e}-input`]:{height:E(l).sub(E(n).mul(2)).equal(),padding:`${Nt(u)} ${Nt(c)}`}},"&-out-of-range":{[`${e}-input-wrap`]:{input:{color:s}}},"&-group":Object.assign(Object.assign(Object.assign({},ja(t)),aJe(t)),{"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",textAlign:"start",verticalAlign:"top",[`${e}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${e}-group-addon`]:{borderRadius:A,fontSize:t.fontSizeLG}},"&-sm":{[`${e}-group-addon`]:{borderRadius:T}}},nJe(t)),rJe(t)),{[`&:not(${e}-compact-first-item):not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}, ${e}-group-addon`]:{borderRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-first-item`]:{[`${e}, ${e}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${e}-compact-first-item)${e}-compact-last-item`]:{[`${e}, ${e}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})}),[`&-disabled ${e}-input`]:{cursor:"not-allowed"},[e]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{width:"100%",padding:`${Nt(b)} ${Nt(w)}`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:r,outline:0,transition:`all ${g} linear`,appearance:"textfield",fontSize:"inherit"}),tye(t.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[e]:Object.assign(Object.assign(Object.assign({[`&:hover ${e}-handler-wrap, &-focused ${e}-handler-wrap`]:{opacity:1},[`${e}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:t.handleWidth,height:"100%",borderStartStartRadius:0,borderStartEndRadius:r,borderEndEndRadius:r,borderEndStartRadius:0,opacity:S,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${g} linear ${g}`,[`${e}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[` + `]:{borderRadius:0},[`> ${e}-item:last-child`]:{borderBottom:0},[`> ${e}-item > ${e}-content`]:{backgroundColor:"transparent",borderTop:0},[`> ${e}-item > ${e}-content > ${e}-content-box`]:{paddingTop:o}}}},VNt=t=>{const{componentCls:e,paddingSM:n}=t;return{[`${e}-ghost`]:{backgroundColor:"transparent",border:0,[`> ${e}-item`]:{borderBottom:0,[`> ${e}-content`]:{backgroundColor:"transparent",border:0,[`> ${e}-content-box`]:{paddingBlock:n}}}}}},GNt=t=>({headerPadding:`${t.paddingSM}px ${t.padding}px`,headerBg:t.colorFillAlter,contentPadding:`${t.padding}px 16px`,contentBg:t.colorBgContainer}),XNt=wl("Collapse",t=>{const e=Ki(t,{collapseHeaderPaddingSM:`${Nt(t.paddingXS)} ${Nt(t.paddingSM)}`,collapseHeaderPaddingLG:`${Nt(t.padding)} ${Nt(t.paddingLG)}`,collapsePanelBorderRadius:t.borderRadiusLG});return[YNt(e),_Nt(e),VNt(e),ONt(e),Hme(e)]},GNt),JNt=m.forwardRef((t,e)=>{const{getPrefixCls:n,direction:o,collapse:r}=m.useContext(Cr),{prefixCls:i,className:a,rootClassName:l,style:s,bordered:c=!0,ghost:u,size:d,expandIconPosition:f="start",children:p,expandIcon:g}=t,y=Ed(D=>{var E;return(E=d??D)!==null&&E!==void 0?E:"middle"}),w=n("collapse",i),b=n(),[C,P,v]=XNt(w),T=m.useMemo(()=>f==="left"?"start":f==="right"?"end":f,[f]),A=g??(r==null?void 0:r.expandIcon),x=m.useCallback(function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const E=typeof A=="function"?A(D):m.createElement(UG,{rotate:D.isActive?90:void 0});return B0(E,()=>{var W;return{className:Un((W=E==null?void 0:E.props)===null||W===void 0?void 0:W.className,`${w}-arrow`)}})},[A,w]),S=Un(`${w}-icon-position-${T}`,{[`${w}-borderless`]:!c,[`${w}-rtl`]:o==="rtl",[`${w}-ghost`]:!!u,[`${w}-${y}`]:y!=="middle"},r==null?void 0:r.className,a,l,P,v),R=Object.assign(Object.assign({},bme(b)),{motionAppear:!1,leavedClassName:`${w}-content-hidden`}),M=m.useMemo(()=>p?B9(p).map((D,E)=>{var W,j;if(!((W=D.props)===null||W===void 0)&&W.disabled){const L=(j=D.key)!==null&&j!==void 0?j:String(E),{disabled:k,collapsible:N}=D.props,F=Object.assign(Object.assign({},up(D.props,["disabled"])),{key:L,collapsible:N??(k?"disabled":void 0)});return B0(D,F)}return D}):null,[p]);return C(m.createElement(iye,Object.assign({ref:e,openMotion:R},up(t,["rootClassName"]),{expandIcon:x,prefixCls:w,className:S,style:Object.assign(Object.assign({},r==null?void 0:r.style),s)}),M))}),aye=Object.assign(JNt,{Panel:BNt}),KNt=t=>{const{componentCls:e,sizePaddingEdgeHorizontal:n,colorSplit:o,lineWidth:r,textPaddingInline:i,orientationMargin:a,verticalMarginInline:l}=t;return{[e]:Object.assign(Object.assign({},ja(t)),{borderBlockStart:`${Nt(r)} solid ${o}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:l,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${Nt(r)} solid ${o}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${Nt(t.dividerHorizontalGutterMargin)} 0`},[`&-horizontal${e}-with-text`]:{display:"flex",alignItems:"center",margin:`${Nt(t.dividerHorizontalWithTextGutterMargin)} 0`,color:t.colorTextHeading,fontWeight:500,fontSize:t.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${o}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${Nt(r)} solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${e}-with-text-left`]:{"&::before":{width:`calc(${a} * 100%)`},"&::after":{width:`calc(100% - ${a} * 100%)`}},[`&-horizontal${e}-with-text-right`]:{"&::before":{width:`calc(100% - ${a} * 100%)`},"&::after":{width:`calc(${a} * 100%)`}},[`${e}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:i},"&-dashed":{background:"none",borderColor:o,borderStyle:"dashed",borderWidth:`${Nt(r)} 0 0`},[`&-horizontal${e}-with-text${e}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${e}-dashed`]:{borderInlineStartWidth:r,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${e}-with-text`]:{color:t.colorText,fontWeight:"normal",fontSize:t.fontSize},[`&-horizontal${e}-with-text-left${e}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${e}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${e}-with-text-right${e}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${e}-inner-text`]:{paddingInlineEnd:n}}})}},qNt=t=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:t.marginXS}),$Nt=wl("Divider",t=>{const e=Ki(t,{dividerHorizontalWithTextGutterMargin:t.margin,dividerHorizontalGutterMargin:t.marginLG,sizePaddingEdgeHorizontal:0});return[KNt(e)]},qNt,{unitless:{orientationMargin:!0}});var QNt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{getPrefixCls:e,direction:n,divider:o}=m.useContext(Cr),{prefixCls:r,type:i="horizontal",orientation:a="center",orientationMargin:l,className:s,rootClassName:c,children:u,dashed:d,plain:f,style:p}=t,g=QNt(t,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),y=e("divider",r),[w,b,C]=$Nt(y),P=a.length>0?`-${a}`:a,v=!!u,T=a==="left"&&l!=null,A=a==="right"&&l!=null,x=Un(y,o==null?void 0:o.className,b,C,`${y}-${i}`,{[`${y}-with-text`]:v,[`${y}-with-text${P}`]:v,[`${y}-dashed`]:!!d,[`${y}-plain`]:!!f,[`${y}-rtl`]:n==="rtl",[`${y}-no-default-orientation-margin-left`]:T,[`${y}-no-default-orientation-margin-right`]:A},s,c),S=m.useMemo(()=>typeof l=="number"?l:/^\d+$/.test(l)?Number(l):l,[l]),R=Object.assign(Object.assign({},T&&{marginLeft:S}),A&&{marginRight:S});return w(m.createElement("div",Object.assign({className:x,style:Object.assign(Object.assign({},o==null?void 0:o.style),p)},g,{role:"separator"}),u&&i!=="vertical"&&m.createElement("span",{className:`${y}-inner-text`,style:R},u)))};var ZNt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},eUt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:ZNt}))},tUt=m.forwardRef(eUt);function fue(){return typeof BigInt=="function"}function xJe(t){return!t&&t!==0&&!Number.isNaN(t)||!String(t).trim()}function mx(t){var e=t.trim(),n=e.startsWith("-");n&&(e=e.slice(1)),e=e.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),e.startsWith(".")&&(e="0".concat(e));var o=e||"0",r=o.split("."),i=r[0]||"0",a=r[1]||"0";i==="0"&&a==="0"&&(n=!1);var l=n?"-":"";return{negative:n,negativeStr:l,trimStr:o,integerStr:i,decimalStr:a,fullStr:"".concat(l).concat(o)}}function lye(t){var e=String(t);return!Number.isNaN(Number(e))&&e.includes("e")}function Uv(t){var e=String(t);if(lye(t)){var n=Number(e.slice(e.indexOf("e-")+2)),o=e.match(/\.(\d+)/);return o!=null&&o[1]&&(n+=o[1].length),n}return e.includes(".")&&sye(e)?e.length-e.indexOf(".")-1:0}function sQ(t){var e=String(t);if(lye(t)){if(t>Number.MAX_SAFE_INTEGER)return String(fue()?BigInt(t).toString():Number.MAX_SAFE_INTEGER);if(t0&&arguments[0]!==void 0?arguments[0]:!0;return n?this.isInvalidate()?"":mx("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),t}(),oUt=function(){function t(e){if(Ap(this,t),Vt(this,"origin",""),Vt(this,"number",void 0),Vt(this,"empty",void 0),xJe(e)){this.empty=!0;return}this.origin=String(e),this.number=Number(e)}return wp(t,[{key:"negate",value:function(){return new t(-this.toNumber())}},{key:"add",value:function(n){if(this.isInvalidate())return new t(n);var o=Number(n);if(Number.isNaN(o))return this;var r=this.number+o;if(r>Number.MAX_SAFE_INTEGER)return new t(Number.MAX_SAFE_INTEGER);if(rNumber.MAX_SAFE_INTEGER)return new t(Number.MAX_SAFE_INTEGER);if(r0&&arguments[0]!==void 0?arguments[0]:!0;return n?this.isInvalidate()?"":sQ(this.number):this.origin}}]),t}();function r2(t){return fue()?new nUt(t):new oUt(t)}function q_(t,e,n){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(t==="")return"";var r=mx(t),i=r.negativeStr,a=r.integerStr,l=r.decimalStr,s="".concat(e).concat(l),c="".concat(i).concat(a);if(n>=0){var u=Number(l[n]);if(u>=5&&!o){var d=r2(t).add("".concat(i,"0.").concat("0".repeat(n)).concat(10-u));return q_(d.toString(),e,n,o)}return n===0?c:"".concat(c).concat(e).concat(l.padEnd(n,"0").slice(0,n))}return s===".0"?c:"".concat(c).concat(s)}function rUt(t){return!!(t.addonBefore||t.addonAfter)}function iUt(t){return!!(t.prefix||t.suffix||t.allowClear)}function bxe(t,e,n){var o=e.cloneNode(!0),r=Object.create(t,{target:{value:o},currentTarget:{value:o}});return o.value=n,typeof e.selectionStart=="number"&&typeof e.selectionEnd=="number"&&(o.selectionStart=e.selectionStart,o.selectionEnd=e.selectionEnd),r}function GG(t,e,n,o){if(n){var r=e;if(e.type==="click"){r=bxe(e,t,""),n(r);return}if(t.type!=="file"&&o!==void 0){r=bxe(e,t,o),n(r);return}n(r)}}function bJe(t,e){if(t){t.focus(e);var n=e||{},o=n.cursor;if(o){var r=t.value.length;switch(o){case"start":t.setSelectionRange(0,0);break;case"end":t.setSelectionRange(r,r);break;default:t.setSelectionRange(0,r)}}}}var cye=function(e){var n,o,r=e.inputElement,i=e.children,a=e.prefixCls,l=e.prefix,s=e.suffix,c=e.addonBefore,u=e.addonAfter,d=e.className,f=e.style,p=e.disabled,g=e.readOnly,y=e.focused,w=e.triggerFocus,b=e.allowClear,C=e.value,P=e.handleReset,v=e.hidden,T=e.classes,A=e.classNames,x=e.dataAttrs,S=e.styles,R=e.components,M=i??r,D=(R==null?void 0:R.affixWrapper)||"span",E=(R==null?void 0:R.groupWrapper)||"span",W=(R==null?void 0:R.wrapper)||"span",j=(R==null?void 0:R.groupAddon)||"span",L=m.useRef(null),k=function(ge){var de;(de=L.current)!==null&&de!==void 0&&de.contains(ge.target)&&(w==null||w())},N=iUt(e),F=m.cloneElement(M,{value:C,className:Vn(M.props.className,!N&&(A==null?void 0:A.variant))||null});if(N){var U,O=null;if(b){var B,_=!p&&!g&&C,X="".concat(a,"-clear-icon"),$=hi(b)==="object"&&b!==null&&b!==void 0&&b.clearIcon?b.clearIcon:"✖";O=be.createElement("span",{onClick:P,onMouseDown:function(ge){return ge.preventDefault()},className:Vn(X,(B={},Vt(B,"".concat(X,"-hidden"),!_),Vt(B,"".concat(X,"-has-suffix"),!!s),B)),role:"button",tabIndex:-1},$)}var Q="".concat(a,"-affix-wrapper"),le=Vn(Q,(U={},Vt(U,"".concat(a,"-disabled"),p),Vt(U,"".concat(Q,"-disabled"),p),Vt(U,"".concat(Q,"-focused"),y),Vt(U,"".concat(Q,"-readonly"),g),Vt(U,"".concat(Q,"-input-with-clear-btn"),s&&b&&C),U),T==null?void 0:T.affixWrapper,A==null?void 0:A.affixWrapper,A==null?void 0:A.variant),q=(s||b)&&be.createElement("span",{className:Vn("".concat(a,"-suffix"),A==null?void 0:A.suffix),style:S==null?void 0:S.suffix},O,s);F=be.createElement(D,ho({className:le,style:S==null?void 0:S.affixWrapper,onClick:k},x==null?void 0:x.affixWrapper,{ref:L}),l&&be.createElement("span",{className:Vn("".concat(a,"-prefix"),A==null?void 0:A.prefix),style:S==null?void 0:S.prefix},l),F,q)}if(rUt(e)){var te="".concat(a,"-group"),re="".concat(te,"-addon"),ae="".concat(te,"-wrapper"),se=Vn("".concat(a,"-wrapper"),te,T==null?void 0:T.wrapper,A==null?void 0:A.wrapper),ne=Vn(ae,Vt({},"".concat(ae,"-disabled"),p),T==null?void 0:T.group,A==null?void 0:A.groupWrapper);F=be.createElement(E,{className:ne},be.createElement(W,{className:se},c&&be.createElement(j,{className:re},c),F,u&&be.createElement(j,{className:re},u)))}return be.cloneElement(F,{className:Vn((n=F.props)===null||n===void 0?void 0:n.className,d)||null,style:qt(qt({},(o=F.props)===null||o===void 0?void 0:o.style),f),hidden:v})},aUt=["show"];function SJe(t,e){return m.useMemo(function(){var n={};e&&(n.show=hi(e)==="object"&&e.formatter?e.formatter:!!e),n=qt(qt({},n),t);var o=n,r=o.show,i=ii(o,aUt);return qt(qt({},i),{},{show:!!r,showFormatter:typeof r=="function"?r:void 0,strategy:i.strategy||function(a){return a.length}})},[t,e])}var lUt=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],sUt=m.forwardRef(function(t,e){var n=t.autoComplete,o=t.onChange,r=t.onFocus,i=t.onBlur,a=t.onPressEnter,l=t.onKeyDown,s=t.prefixCls,c=s===void 0?"rc-input":s,u=t.disabled,d=t.htmlSize,f=t.className,p=t.maxLength,g=t.suffix,y=t.showCount,w=t.count,b=t.type,C=b===void 0?"text":b,P=t.classes,v=t.classNames,T=t.styles,A=t.onCompositionStart,x=t.onCompositionEnd,S=ii(t,lUt),R=m.useState(!1),M=ln(R,2),D=M[0],E=M[1],W=m.useRef(!1),j=m.useRef(null),L=function(Se){j.current&&bJe(j.current,Se)},k=zs(t.defaultValue,{value:t.value}),N=ln(k,2),F=N[0],U=N[1],O=F==null?"":String(F),B=m.useState(null),_=ln(B,2),X=_[0],$=_[1],Q=SJe(w,y),le=Q.max||p,q=Q.strategy(O),te=!!le&&q>le;m.useImperativeHandle(e,function(){return{focus:L,blur:function(){var Se;(Se=j.current)===null||Se===void 0||Se.blur()},setSelectionRange:function(Se,ze,Ie){var ye;(ye=j.current)===null||ye===void 0||ye.setSelectionRange(Se,ze,Ie)},select:function(){var Se;(Se=j.current)===null||Se===void 0||Se.select()},input:j.current}}),m.useEffect(function(){E(function(He){return He&&u?!1:He})},[u]);var re=function(Se,ze,Ie){var ye=ze;if(!W.current&&Q.exceedFormatter&&Q.max&&Q.strategy(ze)>Q.max){if(ye=Q.exceedFormatter(ze,{max:Q.max}),ze!==ye){var ce,pe;$([((ce=j.current)===null||ce===void 0?void 0:ce.selectionStart)||0,((pe=j.current)===null||pe===void 0?void 0:pe.selectionEnd)||0])}}else if(Ie.source==="compositionEnd")return;U(ye),j.current&&GG(j.current,Se,o,ye)};m.useEffect(function(){if(X){var He;(He=j.current)===null||He===void 0||He.setSelectionRange.apply(He,Lo(X))}},[X]);var ae=function(Se){re(Se,Se.target.value,{source:"change"})},se=function(Se){W.current=!1,re(Se,Se.currentTarget.value,{source:"compositionEnd"}),x==null||x(Se)},ne=function(Se){a&&Se.key==="Enter"&&a(Se),l==null||l(Se)},fe=function(Se){E(!0),r==null||r(Se)},ge=function(Se){E(!1),i==null||i(Se)},de=function(Se){U(""),L(),j.current&&GG(j.current,Se,o)},Z=te&&"".concat(c,"-out-of-range"),he=function(){var Se=jH(t,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames"]);return be.createElement("input",ho({autoComplete:n},Se,{onChange:ae,onFocus:fe,onBlur:ge,onKeyDown:ne,className:Vn(c,Vt({},"".concat(c,"-disabled"),u),v==null?void 0:v.input),style:T==null?void 0:T.input,ref:j,size:d,type:C,onCompositionStart:function(Ie){W.current=!0,A==null||A(Ie)},onCompositionEnd:se}))},xe=function(){var Se=Number(le)>0;if(g||Q.show){var ze=Q.showFormatter?Q.showFormatter({value:O,count:q,maxLength:le}):"".concat(q).concat(Se?" / ".concat(le):"");return be.createElement(be.Fragment,null,Q.show&&be.createElement("span",{className:Vn("".concat(c,"-show-count-suffix"),Vt({},"".concat(c,"-show-count-has-suffix"),!!g),v==null?void 0:v.count),style:qt({},T==null?void 0:T.count)},ze),g)}return null};return be.createElement(cye,ho({},S,{prefixCls:c,className:Vn(f,Z),handleReset:de,value:O,focused:D,triggerFocus:L,suffix:xe(),disabled:u,classes:P,classNames:v,styles:T}),he())});function cUt(t,e){var n=m.useRef(null);function o(){try{var i=t.selectionStart,a=t.selectionEnd,l=t.value,s=l.substring(0,i),c=l.substring(a);n.current={start:i,end:a,value:l,beforeTxt:s,afterTxt:c}}catch{}}function r(){if(t&&n.current&&e)try{var i=t.value,a=n.current,l=a.beforeTxt,s=a.afterTxt,c=a.start,u=i.length;if(i.endsWith(s))u=i.length-n.current.afterTxt.length;else if(i.startsWith(l))u=l.length;else{var d=l[c-1],f=i.indexOf(d,c-1);f!==-1&&(u=f+1)}t.setSelectionRange(u,u)}catch(p){j0(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(p.message))}}return[o,r]}var uUt=function(){var e=m.useState(!1),n=ln(e,2),o=n[0],r=n[1];return Xa(function(){r(O$())},[]),o},dUt=200,fUt=600;function hUt(t){var e=t.prefixCls,n=t.upNode,o=t.downNode,r=t.upDisabled,i=t.downDisabled,a=t.onStep,l=m.useRef(),s=m.useRef([]),c=m.useRef();c.current=a;var u=function(){clearTimeout(l.current)},d=function(P,v){P.preventDefault(),u(),c.current(v);function T(){c.current(v),l.current=setTimeout(T,dUt)}l.current=setTimeout(T,fUt)};m.useEffect(function(){return function(){u(),s.current.forEach(function(C){return Fa.cancel(C)})}},[]);var f=uUt();if(f)return null;var p="".concat(e,"-handler"),g=Vn(p,"".concat(p,"-up"),Vt({},"".concat(p,"-up-disabled"),r)),y=Vn(p,"".concat(p,"-down"),Vt({},"".concat(p,"-down-disabled"),i)),w=function(){return s.current.push(Fa(u))},b={unselectable:"on",role:"button",onMouseUp:w,onMouseLeave:w};return m.createElement("div",{className:"".concat(p,"-wrap")},m.createElement("span",ho({},b,{onMouseDown:function(P){d(P,!0)},"aria-label":"Increase Value","aria-disabled":r,className:g}),n||m.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-up-inner")})),m.createElement("span",ho({},b,{onMouseDown:function(P){d(P,!1)},"aria-label":"Decrease Value","aria-disabled":i,className:y}),o||m.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-down-inner")})))}function Sxe(t){var e=typeof t=="number"?sQ(t):mx(t).fullStr,n=e.includes(".");return n?mx(e.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:t+"0"}const pUt=function(){var t=m.useRef(0),e=function(){Fa.cancel(t.current)};return m.useEffect(function(){return e},[]),function(n){e(),t.current=Fa(function(){n()})}};var gUt=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","changeOnWheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur"],mUt=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],Txe=function(e,n){return e||n.isEmpty()?n.toString():n.toNumber()},Pxe=function(e){var n=r2(e);return n.isInvalidate()?null:n},yUt=m.forwardRef(function(t,e){var n,o=t.prefixCls,r=o===void 0?"rc-input-number":o,i=t.className,a=t.style,l=t.min,s=t.max,c=t.step,u=c===void 0?1:c,d=t.defaultValue,f=t.value,p=t.disabled,g=t.readOnly,y=t.upHandler,w=t.downHandler,b=t.keyboard,C=t.changeOnWheel,P=C===void 0?!1:C,v=t.controls,T=v===void 0?!0:v;t.classNames;var A=t.stringMode,x=t.parser,S=t.formatter,R=t.precision,M=t.decimalSeparator,D=t.onChange,E=t.onInput,W=t.onPressEnter,j=t.onStep,L=t.changeOnBlur,k=L===void 0?!0:L,N=ii(t,gUt),F="".concat(r,"-input"),U=m.useRef(null),O=m.useState(!1),B=ln(O,2),_=B[0],X=B[1],$=m.useRef(!1),Q=m.useRef(!1),le=m.useRef(!1),q=m.useState(function(){return r2(f??d)}),te=ln(q,2),re=te[0],ae=te[1];function se(ct){f===void 0&&ae(ct)}var ne=m.useCallback(function(ct,Xe){if(!Xe)return R>=0?R:Math.max(Uv(ct),Uv(u))},[R,u]),fe=m.useCallback(function(ct){var Xe=String(ct);if(x)return x(Xe);var ut=Xe;return M&&(ut=ut.replace(M,".")),ut.replace(/[^\w.-]+/g,"")},[x,M]),ge=m.useRef(""),de=m.useCallback(function(ct,Xe){if(S)return S(ct,{userTyping:Xe,input:String(ge.current)});var ut=typeof ct=="number"?sQ(ct):ct;if(!Xe){var ft=ne(ut,Xe);if(sye(ut)&&(M||ft>=0)){var ot=M||".";ut=q_(ut,ot,ft)}}return ut},[S,ne,M]),Z=m.useState(function(){var ct=d??f;return re.isInvalidate()&&["string","number"].includes(hi(ct))?Number.isNaN(ct)?"":ct:de(re.toString(),!1)}),he=ln(Z,2),xe=he[0],He=he[1];ge.current=xe;function Se(ct,Xe){He(de(ct.isInvalidate()?ct.toString(!1):ct.toString(!Xe),Xe))}var ze=m.useMemo(function(){return Pxe(s)},[s,R]),Ie=m.useMemo(function(){return Pxe(l)},[l,R]),ye=m.useMemo(function(){return!ze||!re||re.isInvalidate()?!1:ze.lessEquals(re)},[ze,re]),ce=m.useMemo(function(){return!Ie||!re||re.isInvalidate()?!1:re.lessEquals(Ie)},[Ie,re]),pe=cUt(U.current,_),ve=ln(pe,2),Ae=ve[0],Te=ve[1],Me=function(Xe){return ze&&!Xe.lessEquals(ze)?ze:Ie&&!Ie.lessEquals(Xe)?Ie:null},Pe=function(Xe){return!Me(Xe)},Ee=function(Xe,ut){var ft=Xe,ot=Pe(ft)||ft.isEmpty();if(!ft.isEmpty()&&!ut&&(ft=Me(ft)||ft,ot=!0),!g&&!p&&ot){var st=ft.toString(),at=ne(st,ut);return at>=0&&(ft=r2(q_(st,".",at)),Pe(ft)||(ft=r2(q_(st,".",at,!0)))),ft.equals(re)||(se(ft),D==null||D(ft.isEmpty()?null:Txe(A,ft)),f===void 0&&Se(ft,ut)),ft}return re},Be=pUt(),Je=function ct(Xe){if(Ae(),ge.current=Xe,He(Xe),!Q.current){var ut=fe(Xe),ft=r2(ut);ft.isNaN()||Ee(ft,!0)}E==null||E(Xe),Be(function(){var ot=Xe;x||(ot=Xe.replace(/。/g,".")),ot!==Xe&&ct(ot)})},We=function(){Q.current=!0},Ke=function(){Q.current=!1,Je(U.current.value)},Ne=function(Xe){Je(Xe.target.value)},De=function(Xe){var ut;if(!(Xe&&ye||!Xe&&ce)){$.current=!1;var ft=r2(le.current?Sxe(u):u);Xe||(ft=ft.negate());var ot=(re||r2(0)).add(ft.toString()),st=Ee(ot,!1);j==null||j(Txe(A,st),{offset:le.current?Sxe(u):u,type:Xe?"up":"down"}),(ut=U.current)===null||ut===void 0||ut.focus()}},ke=function(Xe){var ut=r2(fe(xe)),ft=ut;ut.isNaN()?ft=Ee(re,Xe):ft=Ee(ut,Xe),f!==void 0?Se(re,!1):ft.isNaN()||Se(ft,!1)},Ye=function(){$.current=!0},it=function(Xe){var ut=Xe.key,ft=Xe.shiftKey;$.current=!0,le.current=ft,ut==="Enter"&&(Q.current||($.current=!1),ke(!1),W==null||W(Xe)),b!==!1&&!Q.current&&["Up","ArrowUp","Down","ArrowDown"].includes(ut)&&(De(ut==="Up"||ut==="ArrowUp"),Xe.preventDefault())},Ve=function(){$.current=!1,le.current=!1};m.useEffect(function(){if(P&&_){var ct=function(ft){De(ft.deltaY<0),ft.preventDefault()},Xe=U.current;if(Xe)return Xe.addEventListener("wheel",ct,{passive:!1}),function(){return Xe.removeEventListener("wheel",ct)}}});var yt=function(){k&&ke(!1),X(!1),$.current=!1};return fx(function(){re.isInvalidate()||Se(re,!1)},[R,S]),fx(function(){var ct=r2(f);ae(ct);var Xe=r2(fe(xe));(!ct.equals(Xe)||!$.current||S)&&Se(ct,$.current)},[f]),fx(function(){S&&Te()},[xe]),m.createElement("div",{className:Vn(r,i,(n={},Vt(n,"".concat(r,"-focused"),_),Vt(n,"".concat(r,"-disabled"),p),Vt(n,"".concat(r,"-readonly"),g),Vt(n,"".concat(r,"-not-a-number"),re.isNaN()),Vt(n,"".concat(r,"-out-of-range"),!re.isInvalidate()&&!Pe(re)),n)),style:a,onFocus:function(){X(!0)},onBlur:yt,onKeyDown:it,onKeyUp:Ve,onCompositionStart:We,onCompositionEnd:Ke,onBeforeInput:Ye},T&&m.createElement(hUt,{prefixCls:r,upNode:y,downNode:w,upDisabled:ye,downDisabled:ce,onStep:De}),m.createElement("div",{className:"".concat(F,"-wrap")},m.createElement("input",ho({autoComplete:"off",role:"spinbutton","aria-valuemin":l,"aria-valuemax":s,"aria-valuenow":re.isInvalidate()?null:re.toString(),step:u},N,{ref:Fb(U,e),className:F,value:xe,onChange:Ne,disabled:p,readOnly:g}))))}),TJe=m.forwardRef(function(t,e){var n=t.disabled,o=t.style,r=t.prefixCls,i=t.value,a=t.prefix,l=t.suffix,s=t.addonBefore,c=t.addonAfter,u=t.className,d=t.classNames,f=ii(t,mUt),p=m.useRef(null),g=function(w){p.current&&bJe(p.current,w)};return m.createElement(cye,{className:u,triggerFocus:g,prefixCls:r,value:i,disabled:n,style:o,prefix:a,suffix:l,addonAfter:c,addonBefore:s,classNames:d,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}},m.createElement(yUt,ho({prefixCls:r,disabled:n,ref:Fb(p,e),className:d==null?void 0:d.input},f)))});TJe.displayName="InputNumber";const AUt=t=>{var e;const n=(e=t.handleVisible)!==null&&e!==void 0?e:"auto";return Object.assign(Object.assign({},JW(t)),{controlWidth:90,handleWidth:t.controlHeightSM-t.lineWidth*2,handleFontSize:t.fontSize/2,handleVisible:n,handleActiveBg:t.colorFillAlter,handleBg:t.colorBgContainer,filledHandleBg:new kl(t.colorFillSecondary).onBackground(t.colorBgContainer).toHexString(),handleHoverColor:t.colorPrimary,handleBorderColor:t.colorBorder,handleOpacity:n===!0?1:0})},Cxe=(t,e)=>{let{componentCls:n,borderRadiusSM:o,borderRadiusLG:r}=t;const i=e==="lg"?r:o;return{[`&-${e}`]:{[`${n}-handler-wrap`]:{borderStartEndRadius:i,borderEndEndRadius:i},[`${n}-handler-up`]:{borderStartEndRadius:i},[`${n}-handler-down`]:{borderEndEndRadius:i}}}},wUt=t=>{const{componentCls:e,lineWidth:n,lineType:o,borderRadius:r,fontSizeLG:i,controlHeightLG:a,controlHeightSM:l,colorError:s,paddingInlineSM:c,paddingBlockSM:u,paddingBlockLG:d,paddingInlineLG:f,colorTextDescription:p,motionDurationMid:g,handleHoverColor:y,paddingInline:w,paddingBlock:b,handleBg:C,handleActiveBg:P,colorTextDisabled:v,borderRadiusSM:T,borderRadiusLG:A,controlWidth:x,handleOpacity:S,handleBorderColor:R,filledHandleBg:M,lineHeightLG:D,calc:E}=t;return[{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),KW(t)),{display:"inline-block",width:x,margin:0,padding:0,borderRadius:r}),Zme(t,{[`${e}-handler-wrap`]:{background:C,[`${e}-handler-down`]:{borderBlockStart:`${Nt(n)} ${o} ${R}`}}})),tye(t,{[`${e}-handler-wrap`]:{background:M,[`${e}-handler-down`]:{borderBlockStart:`${Nt(n)} ${o} ${R}`}},"&:focus-within":{[`${e}-handler-wrap`]:{background:C}}})),eye(t)),{"&-rtl":{direction:"rtl",[`${e}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:i,lineHeight:D,borderRadius:A,[`input${e}-input`]:{height:E(a).sub(E(n).mul(2)).equal(),padding:`${Nt(d)} ${Nt(f)}`}},"&-sm":{padding:0,borderRadius:T,[`input${e}-input`]:{height:E(l).sub(E(n).mul(2)).equal(),padding:`${Nt(u)} ${Nt(c)}`}},"&-out-of-range":{[`${e}-input-wrap`]:{input:{color:s}}},"&-group":Object.assign(Object.assign(Object.assign({},ja(t)),aJe(t)),{"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",textAlign:"start",verticalAlign:"top",[`${e}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${e}-group-addon`]:{borderRadius:A,fontSize:t.fontSizeLG}},"&-sm":{[`${e}-group-addon`]:{borderRadius:T}}},nJe(t)),rJe(t)),{[`&:not(${e}-compact-first-item):not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}, ${e}-group-addon`]:{borderRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-first-item`]:{[`${e}, ${e}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${e}-compact-first-item)${e}-compact-last-item`]:{[`${e}, ${e}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})}),[`&-disabled ${e}-input`]:{cursor:"not-allowed"},[e]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{width:"100%",padding:`${Nt(b)} ${Nt(w)}`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:r,outline:0,transition:`all ${g} linear`,appearance:"textfield",fontSize:"inherit"}),nye(t.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[e]:Object.assign(Object.assign(Object.assign({[`&:hover ${e}-handler-wrap, &-focused ${e}-handler-wrap`]:{opacity:1},[`${e}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:t.handleWidth,height:"100%",borderStartStartRadius:0,borderStartEndRadius:r,borderEndEndRadius:r,borderEndStartRadius:0,opacity:S,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${g} linear ${g}`,[`${e}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[` ${e}-handler-up-inner, ${e}-handler-down-inner `]:{marginInlineEnd:0,fontSize:t.handleFontSize}}},[`${e}-handler`]:{height:"50%",overflow:"hidden",color:p,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${Nt(n)} ${o} ${R}`,transition:`all ${g} linear`,"&:active":{background:P},"&:hover":{height:"60%",[` ${e}-handler-up-inner, ${e}-handler-down-inner - `]:{color:y}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},WH()),{color:p,transition:`all ${g} linear`,userSelect:"none"})},[`${e}-handler-up`]:{borderStartEndRadius:r},[`${e}-handler-down`]:{borderEndEndRadius:r}},Pxe(t,"lg")),Pxe(t,"sm")),{"&-disabled, &-readonly":{[`${e}-handler-wrap`]:{display:"none"},[`${e}-input`]:{color:"inherit"}},[` + `]:{color:y}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},WH()),{color:p,transition:`all ${g} linear`,userSelect:"none"})},[`${e}-handler-up`]:{borderStartEndRadius:r},[`${e}-handler-down`]:{borderEndEndRadius:r}},Cxe(t,"lg")),Cxe(t,"sm")),{"&-disabled, &-readonly":{[`${e}-handler-wrap`]:{display:"none"},[`${e}-input`]:{color:"inherit"}},[` ${e}-handler-up-disabled, ${e}-handler-down-disabled `]:{cursor:"not-allowed"},[` ${e}-handler-up-disabled:hover &-handler-up-inner, ${e}-handler-down-disabled:hover &-handler-down-inner - `]:{color:v}})}]},vUt=t=>{const{componentCls:e,paddingBlock:n,paddingInline:o,inputAffixPadding:r,controlWidth:i,borderRadiusLG:a,borderRadiusSM:l,paddingInlineLG:s,paddingInlineSM:c,paddingBlockLG:u,paddingBlockSM:d}=t;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign({[`input${e}-input`]:{padding:`${Nt(n)} 0`}},JW(t)),{position:"relative",display:"inline-flex",width:i,padding:0,paddingInlineStart:o,"&-lg":{borderRadius:a,paddingInlineStart:s,[`input${e}-input`]:{padding:`${Nt(u)} 0`}},"&-sm":{borderRadius:l,paddingInlineStart:c,[`input${e}-input`]:{padding:`${Nt(d)} 0`}},[`&:not(${e}-disabled):hover`]:{zIndex:1},"&-focused, &:focus":{zIndex:1},[`&-disabled > ${e}-disabled`]:{background:"transparent"},[`> div${e}`]:{width:"100%",border:"none",outline:"none",[`&${e}-focused`]:{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${e}-handler-wrap`]:{zIndex:2},[e]:{color:"inherit","&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:r},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:o,marginInlineStart:r}}})}},xUt=wl("InputNumber",t=>{const e=Ki(t,GW(t));return[wUt(e),vUt(e),FW(e)]},AUt,{unitless:{handleOpacity:!0}});var bUt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{getPrefixCls:n,direction:o}=m.useContext(Cr),r=m.useRef(null);m.useImperativeHandle(e,()=>r.current);const{className:i,rootClassName:a,size:l,disabled:s,prefixCls:c,addonBefore:u,addonAfter:d,prefix:f,bordered:p,readOnly:g,status:y,controls:w,variant:b}=t,C=bUt(t,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls","variant"]),P=n("input-number",c),v=O0(P),[T,A,x]=xUt(P,v),{compactSize:S,compactItemClassnames:R}=Nw(P,o);let M=m.createElement(tUt,{className:`${P}-handler-up-inner`}),D=m.createElement(Eme,{className:`${P}-handler-down-inner`});const E=typeof w=="boolean"?w:void 0;typeof w=="object"&&(M=typeof w.upIcon>"u"?M:m.createElement("span",{className:`${P}-handler-up-inner`},w.upIcon),D=typeof w.downIcon>"u"?D:m.createElement("span",{className:`${P}-handler-down-inner`},w.downIcon));const{hasFeedback:W,status:j,isFormItemInput:L,feedbackIcon:k}=m.useContext(r1),N=Lb(j,y),F=Ed(q=>{var te;return(te=l??S)!==null&&te!==void 0?te:q}),U=m.useContext(n1),O=s??U,[B,_]=BH(b,p),X=W&&m.createElement(m.Fragment,null,k),$=Un({[`${P}-lg`]:F==="large",[`${P}-sm`]:F==="small",[`${P}-rtl`]:o==="rtl",[`${P}-in-form-item`]:L},A),Q=`${P}-group`,le=m.createElement(TJe,Object.assign({ref:r,disabled:O,className:Un(x,v,i,a,R),upHandler:M,downHandler:D,prefixCls:P,readOnly:g,controls:E,prefix:f,suffix:X,addonAfter:d&&m.createElement(Y9,null,m.createElement(AR,{override:!0,status:!0},d)),addonBefore:u&&m.createElement(Y9,null,m.createElement(AR,{override:!0,status:!0},u)),classNames:{input:$,variant:Un({[`${P}-${B}`]:_},sw(P,N,W)),affixWrapper:Un({[`${P}-affix-wrapper-sm`]:F==="small",[`${P}-affix-wrapper-lg`]:F==="large",[`${P}-affix-wrapper-rtl`]:o==="rtl"},A),wrapper:Un({[`${Q}-rtl`]:o==="rtl"},A),groupWrapper:Un({[`${P}-group-wrapper-sm`]:F==="small",[`${P}-group-wrapper-lg`]:F==="large",[`${P}-group-wrapper-rtl`]:o==="rtl",[`${P}-group-wrapper-${B}`]:_},sw(`${P}-group-wrapper`,N,W),A)}},C));return T(le)}),Mn=PJe,SUt=t=>m.createElement(fy,{theme:{components:{InputNumber:{handleVisible:!0}}}},m.createElement(PJe,Object.assign({},t)));Mn._InternalPanelDoNotUseOrYouWillBeFired=SUt;const TUt=t=>{const{getPrefixCls:e,direction:n}=m.useContext(Cr),{prefixCls:o,className:r}=t,i=e("input-group",o),a=e("input"),[l,s]=oye(a),c=Un(i,{[`${i}-lg`]:t.size==="large",[`${i}-sm`]:t.size==="small",[`${i}-compact`]:t.compact,[`${i}-rtl`]:n==="rtl"},s,r),u=m.useContext(r1),d=m.useMemo(()=>Object.assign(Object.assign({},u),{isFormItemInput:!1}),[u]);return l(m.createElement("span",{className:c,style:t.style,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onFocus:t.onFocus,onBlur:t.onBlur},m.createElement(r1.Provider,{value:d},t.children)))},CJe=t=>{let e;return typeof t=="object"&&(t!=null&&t.clearIcon)?e=t:t&&(e={clearIcon:be.createElement(E$,null)}),e};function RJe(t,e){const n=m.useRef([]),o=()=>{n.current.push(setTimeout(()=>{var r,i,a,l;!((r=t.current)===null||r===void 0)&&r.input&&((i=t.current)===null||i===void 0?void 0:i.input.getAttribute("type"))==="password"&&(!((a=t.current)===null||a===void 0)&&a.input.hasAttribute("value"))&&((l=t.current)===null||l===void 0||l.input.removeAttribute("value"))}))};return m.useEffect(()=>(e&&o(),()=>n.current.forEach(r=>{r&&clearTimeout(r)})),[]),o}function PUt(t){return!!(t.prefix||t.suffix||t.allowClear||t.showCount)}var CUt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n;const{prefixCls:o,bordered:r=!0,status:i,size:a,disabled:l,onBlur:s,onFocus:c,suffix:u,allowClear:d,addonAfter:f,addonBefore:p,className:g,style:y,styles:w,rootClassName:b,onChange:C,classNames:P,variant:v}=t,T=CUt(t,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:A,direction:x,input:S}=be.useContext(Cr),R=A("input",o),M=m.useRef(null),D=O0(R),[E,W,j]=oye(R,D),{compactSize:L,compactItemClassnames:k}=Nw(R,x),N=Ed(fe=>{var ge;return(ge=a??L)!==null&&ge!==void 0?ge:fe}),F=be.useContext(n1),U=l??F,{status:O,hasFeedback:B,feedbackIcon:_}=m.useContext(r1),X=Lb(O,i),$=PUt(t)||!!B;m.useRef($);const Q=RJe(M,!0),le=fe=>{Q(),s==null||s(fe)},q=fe=>{Q(),c==null||c(fe)},te=fe=>{Q(),C==null||C(fe)},re=(B||u)&&be.createElement(be.Fragment,null,u,B&&_),ae=CJe(d??(S==null?void 0:S.allowClear)),[se,ne]=BH(v,r);return E(be.createElement(sUt,Object.assign({ref:o5(e,M),prefixCls:R,autoComplete:S==null?void 0:S.autoComplete},T,{disabled:U,onBlur:le,onFocus:q,style:Object.assign(Object.assign({},S==null?void 0:S.style),y),styles:Object.assign(Object.assign({},S==null?void 0:S.styles),w),suffix:re,allowClear:ae,className:Un(g,b,j,D,k,S==null?void 0:S.className),onChange:te,addonAfter:f&&be.createElement(Y9,null,be.createElement(AR,{override:!0,status:!0},f)),addonBefore:p&&be.createElement(Y9,null,be.createElement(AR,{override:!0,status:!0},p)),classNames:Object.assign(Object.assign(Object.assign({},P),S==null?void 0:S.classNames),{input:Un({[`${R}-sm`]:N==="small",[`${R}-lg`]:N==="large",[`${R}-rtl`]:x==="rtl"},P==null?void 0:P.input,(n=S==null?void 0:S.classNames)===null||n===void 0?void 0:n.input,W),variant:Un({[`${R}-${se}`]:ne},sw(R,X)),affixWrapper:Un({[`${R}-affix-wrapper-sm`]:N==="small",[`${R}-affix-wrapper-lg`]:N==="large",[`${R}-affix-wrapper-rtl`]:x==="rtl"},W),wrapper:Un({[`${R}-group-rtl`]:x==="rtl"},W),groupWrapper:Un({[`${R}-group-wrapper-sm`]:N==="small",[`${R}-group-wrapper-lg`]:N==="large",[`${R}-group-wrapper-rtl`]:x==="rtl",[`${R}-group-wrapper-${se}`]:ne},sw(`${R}-group-wrapper`,X,B),W)})})))}),HUt=t=>{const{componentCls:e,paddingXS:n}=t;return{[`${e}`]:{display:"inline-flex",alignItems:"center",flexWrap:"nowrap",columnGap:n,"&-rtl":{direction:"rtl"},[`${e}-input`]:{textAlign:"center",paddingInline:t.paddingXXS},[`&${e}-sm ${e}-input`]:{paddingInline:t.calc(t.paddingXXS).div(2).equal()},[`&${e}-lg ${e}-input`]:{paddingInline:t.paddingXS}}}},MUt=wl(["Input","OTP"],t=>{const e=Ki(t,GW(t));return[HUt(e)]},XW);var IUt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{value:n,onChange:o,onActiveChange:r,index:i,mask:a}=t,l=IUt(t,["value","onChange","onActiveChange","index","mask"]),s=n&&typeof a=="string"?a:n,c=g=>{o(i,g.target.value)},u=m.useRef(null);m.useImperativeHandle(e,()=>u.current);const d=()=>{Dg(()=>{var g;const y=(g=u.current)===null||g===void 0?void 0:g.input;document.activeElement===y&&y&&y.select()})},f=g=>{let{key:y}=g;y==="ArrowLeft"?r(i-1):y==="ArrowRight"&&r(i+1),d()},p=g=>{g.key==="Backspace"&&!n&&r(i-1),d()};return m.createElement(cQ,Object.assign({},l,{ref:u,value:s,onInput:c,onFocus:d,onKeyDown:f,onKeyUp:p,onMouseDown:d,onMouseUp:d,type:a===!0?"password":"text"}))});var DUt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:n,length:o=6,size:r,defaultValue:i,value:a,onChange:l,formatter:s,variant:c,disabled:u,status:d,autoFocus:f,mask:p}=t,g=DUt(t,["prefixCls","length","size","defaultValue","value","onChange","formatter","variant","disabled","status","autoFocus","mask"]),{getPrefixCls:y,direction:w}=m.useContext(Cr),b=y("otp",n),C=yme(g,{aria:!0,data:!0,attr:!0}),P=O0(b),[v,T,A]=MUt(b,P),x=Ed(B=>r??B),S=m.useContext(r1),R=Lb(S.status,d),M=m.useMemo(()=>Object.assign(Object.assign({},S),{status:R,hasFeedback:!1,feedbackIcon:null}),[S,R]),D=m.useRef(null),E=m.useRef({});m.useImperativeHandle(e,()=>({focus:()=>{var B;(B=E.current[0])===null||B===void 0||B.focus()},blur:()=>{var B;for(let _=0;_s?s(B):B,[j,L]=m.useState(LY(W(i||"")));m.useEffect(()=>{a!==void 0&&L(LY(a))},[a]);const k=q6(B=>{L(B),l&&B.length===o&&B.every(_=>_)&&B.some((_,X)=>j[X]!==_)&&l(B.join(""))}),N=q6((B,_)=>{let X=Za(j);for(let Q=0;Q=0&&!X[Q];Q-=1)X.pop();const $=W(X.map(Q=>Q||" ").join(""));return X=LY($).map((Q,le)=>Q===" "&&!X[le]?X[le]:Q),X}),F=(B,_)=>{var X;const $=N(B,_),Q=Math.min(B+_.length,o-1);Q!==B&&((X=E.current[Q])===null||X===void 0||X.focus()),k($)},U=B=>{var _;(_=E.current[B])===null||_===void 0||_.focus()},O={variant:c,disabled:u,status:R,mask:p};return v(m.createElement("div",Object.assign({},C,{ref:D,className:Un(b,{[`${b}-sm`]:x==="small",[`${b}-lg`]:x==="large",[`${b}-rtl`]:w==="rtl"},A,T)}),m.createElement(r1.Provider,{value:M},Array.from({length:o}).map((B,_)=>{const X=`otp-${_}`,$=j[_]||"";return m.createElement(zUt,Object.assign({ref:Q=>{E.current[_]=Q},key:X,index:_,size:x,htmlSize:1,className:`${b}-input`,onChange:F,value:$,onActiveChange:U,autoFocus:_===0&&f},O))}))))});var FUt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},kUt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:FUt}))},LUt=m.forwardRef(kUt),WUt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},NUt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:WUt}))},UUt=m.forwardRef(NUt),jUt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);rt?m.createElement(UUt,null):m.createElement(LUt,null),YUt={click:"onClick",hover:"onMouseOver"},OUt=m.forwardRef((t,e)=>{const{disabled:n,action:o="click",visibilityToggle:r=!0,iconRender:i=BUt}=t,a=typeof r=="object"&&r.visible!==void 0,[l,s]=m.useState(()=>a?r.visible:!1),c=m.useRef(null);m.useEffect(()=>{a&&s(r.visible)},[a,r]);const u=RJe(c),d=()=>{n||(l&&u(),s(S=>{var R;const M=!S;return typeof r=="object"&&((R=r.onVisibleChange)===null||R===void 0||R.call(r,M)),M}))},f=S=>{const R=YUt[o]||"",M=i(l),D={[R]:d,className:`${S}-icon`,key:"passwordIcon",onMouseDown:E=>{E.preventDefault()},onMouseUp:E=>{E.preventDefault()}};return m.cloneElement(m.isValidElement(M)?M:m.createElement("span",null,M),D)},{className:p,prefixCls:g,inputPrefixCls:y,size:w}=t,b=jUt(t,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:C}=m.useContext(Cr),P=C("input",y),v=C("input-password",g),T=r&&f(v),A=Un(v,p,{[`${v}-${w}`]:!!w}),x=Object.assign(Object.assign({},up(b,["suffix","iconRender","visibilityToggle"])),{type:l?"text":"password",className:A,prefixCls:P,suffix:T});return w&&(x.size=w),m.createElement(cQ,Object.assign({ref:o5(e,c)},x))});var _Ut=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:n,inputPrefixCls:o,className:r,size:i,suffix:a,enterButton:l=!1,addonAfter:s,loading:c,disabled:u,onSearch:d,onChange:f,onCompositionStart:p,onCompositionEnd:g}=t,y=_Ut(t,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:w,direction:b}=m.useContext(Cr),C=m.useRef(!1),P=w("input-search",n),v=w("input",o),{compactSize:T}=Nw(P,b),A=Ed(O=>{var B;return(B=i??T)!==null&&B!==void 0?B:O}),x=m.useRef(null),S=O=>{O&&O.target&&O.type==="click"&&d&&d(O.target.value,O,{source:"clear"}),f&&f(O)},R=O=>{var B;document.activeElement===((B=x.current)===null||B===void 0?void 0:B.input)&&O.preventDefault()},M=O=>{var B,_;d&&d((_=(B=x.current)===null||B===void 0?void 0:B.input)===null||_===void 0?void 0:_.value,O,{source:"input"})},D=O=>{C.current||c||M(O)},E=typeof l=="boolean"?m.createElement(Fme,null):null,W=`${P}-button`;let j;const L=l||{},k=L.type&&L.type.__ANT_BUTTON===!0;k||L.type==="button"?j=B0(L,Object.assign({onMouseDown:R,onClick:O=>{var B,_;(_=(B=L==null?void 0:L.props)===null||B===void 0?void 0:B.onClick)===null||_===void 0||_.call(B,O),M(O)},key:"enterButton"},k?{className:W,size:A}:{})):j=m.createElement(lo,{className:W,type:l?"primary":void 0,size:A,disabled:u,key:"enterButton",onMouseDown:R,onClick:M,loading:c,icon:E},l),s&&(j=[j,B0(s,{key:"addonAfter"})]);const N=Un(P,{[`${P}-rtl`]:b==="rtl",[`${P}-${A}`]:!!A,[`${P}-with-button`]:!!l},r),F=O=>{C.current=!0,p==null||p(O)},U=O=>{C.current=!1,g==null||g(O)};return m.createElement(cQ,Object.assign({ref:o5(x,e),onPressEnter:D},y,{size:A,onCompositionStart:F,onCompositionEnd:U,prefixCls:v,addonAfter:j,suffix:a,onChange:S,className:N,disabled:u}))});var GUt=` + `]:{color:v}})}]},vUt=t=>{const{componentCls:e,paddingBlock:n,paddingInline:o,inputAffixPadding:r,controlWidth:i,borderRadiusLG:a,borderRadiusSM:l,paddingInlineLG:s,paddingInlineSM:c,paddingBlockLG:u,paddingBlockSM:d}=t;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign({[`input${e}-input`]:{padding:`${Nt(n)} 0`}},KW(t)),{position:"relative",display:"inline-flex",width:i,padding:0,paddingInlineStart:o,"&-lg":{borderRadius:a,paddingInlineStart:s,[`input${e}-input`]:{padding:`${Nt(u)} 0`}},"&-sm":{borderRadius:l,paddingInlineStart:c,[`input${e}-input`]:{padding:`${Nt(d)} 0`}},[`&:not(${e}-disabled):hover`]:{zIndex:1},"&-focused, &:focus":{zIndex:1},[`&-disabled > ${e}-disabled`]:{background:"transparent"},[`> div${e}`]:{width:"100%",border:"none",outline:"none",[`&${e}-focused`]:{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${e}-handler-wrap`]:{zIndex:2},[e]:{color:"inherit","&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:r},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:o,marginInlineStart:r}}})}},xUt=wl("InputNumber",t=>{const e=Ki(t,XW(t));return[wUt(e),vUt(e),kW(e)]},AUt,{unitless:{handleOpacity:!0}});var bUt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{getPrefixCls:n,direction:o}=m.useContext(Cr),r=m.useRef(null);m.useImperativeHandle(e,()=>r.current);const{className:i,rootClassName:a,size:l,disabled:s,prefixCls:c,addonBefore:u,addonAfter:d,prefix:f,bordered:p,readOnly:g,status:y,controls:w,variant:b}=t,C=bUt(t,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls","variant"]),P=n("input-number",c),v=O0(P),[T,A,x]=xUt(P,v),{compactSize:S,compactItemClassnames:R}=Nw(P,o);let M=m.createElement(tUt,{className:`${P}-handler-up-inner`}),D=m.createElement(Fme,{className:`${P}-handler-down-inner`});const E=typeof w=="boolean"?w:void 0;typeof w=="object"&&(M=typeof w.upIcon>"u"?M:m.createElement("span",{className:`${P}-handler-up-inner`},w.upIcon),D=typeof w.downIcon>"u"?D:m.createElement("span",{className:`${P}-handler-down-inner`},w.downIcon));const{hasFeedback:W,status:j,isFormItemInput:L,feedbackIcon:k}=m.useContext(r1),N=Lb(j,y),F=Ed(q=>{var te;return(te=l??S)!==null&&te!==void 0?te:q}),U=m.useContext(n1),O=s??U,[B,_]=BH(b,p),X=W&&m.createElement(m.Fragment,null,k),$=Un({[`${P}-lg`]:F==="large",[`${P}-sm`]:F==="small",[`${P}-rtl`]:o==="rtl",[`${P}-in-form-item`]:L},A),Q=`${P}-group`,le=m.createElement(TJe,Object.assign({ref:r,disabled:O,className:Un(x,v,i,a,R),upHandler:M,downHandler:D,prefixCls:P,readOnly:g,controls:E,prefix:f,suffix:X,addonAfter:d&&m.createElement(Y9,null,m.createElement(AR,{override:!0,status:!0},d)),addonBefore:u&&m.createElement(Y9,null,m.createElement(AR,{override:!0,status:!0},u)),classNames:{input:$,variant:Un({[`${P}-${B}`]:_},sw(P,N,W)),affixWrapper:Un({[`${P}-affix-wrapper-sm`]:F==="small",[`${P}-affix-wrapper-lg`]:F==="large",[`${P}-affix-wrapper-rtl`]:o==="rtl"},A),wrapper:Un({[`${Q}-rtl`]:o==="rtl"},A),groupWrapper:Un({[`${P}-group-wrapper-sm`]:F==="small",[`${P}-group-wrapper-lg`]:F==="large",[`${P}-group-wrapper-rtl`]:o==="rtl",[`${P}-group-wrapper-${B}`]:_},sw(`${P}-group-wrapper`,N,W),A)}},C));return T(le)}),Mn=PJe,SUt=t=>m.createElement(fy,{theme:{components:{InputNumber:{handleVisible:!0}}}},m.createElement(PJe,Object.assign({},t)));Mn._InternalPanelDoNotUseOrYouWillBeFired=SUt;const TUt=t=>{const{getPrefixCls:e,direction:n}=m.useContext(Cr),{prefixCls:o,className:r}=t,i=e("input-group",o),a=e("input"),[l,s]=rye(a),c=Un(i,{[`${i}-lg`]:t.size==="large",[`${i}-sm`]:t.size==="small",[`${i}-compact`]:t.compact,[`${i}-rtl`]:n==="rtl"},s,r),u=m.useContext(r1),d=m.useMemo(()=>Object.assign(Object.assign({},u),{isFormItemInput:!1}),[u]);return l(m.createElement("span",{className:c,style:t.style,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onFocus:t.onFocus,onBlur:t.onBlur},m.createElement(r1.Provider,{value:d},t.children)))},CJe=t=>{let e;return typeof t=="object"&&(t!=null&&t.clearIcon)?e=t:t&&(e={clearIcon:be.createElement(E$,null)}),e};function RJe(t,e){const n=m.useRef([]),o=()=>{n.current.push(setTimeout(()=>{var r,i,a,l;!((r=t.current)===null||r===void 0)&&r.input&&((i=t.current)===null||i===void 0?void 0:i.input.getAttribute("type"))==="password"&&(!((a=t.current)===null||a===void 0)&&a.input.hasAttribute("value"))&&((l=t.current)===null||l===void 0||l.input.removeAttribute("value"))}))};return m.useEffect(()=>(e&&o(),()=>n.current.forEach(r=>{r&&clearTimeout(r)})),[]),o}function PUt(t){return!!(t.prefix||t.suffix||t.allowClear||t.showCount)}var CUt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n;const{prefixCls:o,bordered:r=!0,status:i,size:a,disabled:l,onBlur:s,onFocus:c,suffix:u,allowClear:d,addonAfter:f,addonBefore:p,className:g,style:y,styles:w,rootClassName:b,onChange:C,classNames:P,variant:v}=t,T=CUt(t,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:A,direction:x,input:S}=be.useContext(Cr),R=A("input",o),M=m.useRef(null),D=O0(R),[E,W,j]=rye(R,D),{compactSize:L,compactItemClassnames:k}=Nw(R,x),N=Ed(fe=>{var ge;return(ge=a??L)!==null&&ge!==void 0?ge:fe}),F=be.useContext(n1),U=l??F,{status:O,hasFeedback:B,feedbackIcon:_}=m.useContext(r1),X=Lb(O,i),$=PUt(t)||!!B;m.useRef($);const Q=RJe(M,!0),le=fe=>{Q(),s==null||s(fe)},q=fe=>{Q(),c==null||c(fe)},te=fe=>{Q(),C==null||C(fe)},re=(B||u)&&be.createElement(be.Fragment,null,u,B&&_),ae=CJe(d??(S==null?void 0:S.allowClear)),[se,ne]=BH(v,r);return E(be.createElement(sUt,Object.assign({ref:o5(e,M),prefixCls:R,autoComplete:S==null?void 0:S.autoComplete},T,{disabled:U,onBlur:le,onFocus:q,style:Object.assign(Object.assign({},S==null?void 0:S.style),y),styles:Object.assign(Object.assign({},S==null?void 0:S.styles),w),suffix:re,allowClear:ae,className:Un(g,b,j,D,k,S==null?void 0:S.className),onChange:te,addonAfter:f&&be.createElement(Y9,null,be.createElement(AR,{override:!0,status:!0},f)),addonBefore:p&&be.createElement(Y9,null,be.createElement(AR,{override:!0,status:!0},p)),classNames:Object.assign(Object.assign(Object.assign({},P),S==null?void 0:S.classNames),{input:Un({[`${R}-sm`]:N==="small",[`${R}-lg`]:N==="large",[`${R}-rtl`]:x==="rtl"},P==null?void 0:P.input,(n=S==null?void 0:S.classNames)===null||n===void 0?void 0:n.input,W),variant:Un({[`${R}-${se}`]:ne},sw(R,X)),affixWrapper:Un({[`${R}-affix-wrapper-sm`]:N==="small",[`${R}-affix-wrapper-lg`]:N==="large",[`${R}-affix-wrapper-rtl`]:x==="rtl"},W),wrapper:Un({[`${R}-group-rtl`]:x==="rtl"},W),groupWrapper:Un({[`${R}-group-wrapper-sm`]:N==="small",[`${R}-group-wrapper-lg`]:N==="large",[`${R}-group-wrapper-rtl`]:x==="rtl",[`${R}-group-wrapper-${se}`]:ne},sw(`${R}-group-wrapper`,X,B),W)})})))}),HUt=t=>{const{componentCls:e,paddingXS:n}=t;return{[`${e}`]:{display:"inline-flex",alignItems:"center",flexWrap:"nowrap",columnGap:n,"&-rtl":{direction:"rtl"},[`${e}-input`]:{textAlign:"center",paddingInline:t.paddingXXS},[`&${e}-sm ${e}-input`]:{paddingInline:t.calc(t.paddingXXS).div(2).equal()},[`&${e}-lg ${e}-input`]:{paddingInline:t.paddingXS}}}},MUt=wl(["Input","OTP"],t=>{const e=Ki(t,XW(t));return[HUt(e)]},JW);var IUt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{value:n,onChange:o,onActiveChange:r,index:i,mask:a}=t,l=IUt(t,["value","onChange","onActiveChange","index","mask"]),s=n&&typeof a=="string"?a:n,c=g=>{o(i,g.target.value)},u=m.useRef(null);m.useImperativeHandle(e,()=>u.current);const d=()=>{Dg(()=>{var g;const y=(g=u.current)===null||g===void 0?void 0:g.input;document.activeElement===y&&y&&y.select()})},f=g=>{let{key:y}=g;y==="ArrowLeft"?r(i-1):y==="ArrowRight"&&r(i+1),d()},p=g=>{g.key==="Backspace"&&!n&&r(i-1),d()};return m.createElement(cQ,Object.assign({},l,{ref:u,value:s,onInput:c,onFocus:d,onKeyDown:f,onKeyUp:p,onMouseDown:d,onMouseUp:d,type:a===!0?"password":"text"}))});var DUt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:n,length:o=6,size:r,defaultValue:i,value:a,onChange:l,formatter:s,variant:c,disabled:u,status:d,autoFocus:f,mask:p}=t,g=DUt(t,["prefixCls","length","size","defaultValue","value","onChange","formatter","variant","disabled","status","autoFocus","mask"]),{getPrefixCls:y,direction:w}=m.useContext(Cr),b=y("otp",n),C=Ame(g,{aria:!0,data:!0,attr:!0}),P=O0(b),[v,T,A]=MUt(b,P),x=Ed(B=>r??B),S=m.useContext(r1),R=Lb(S.status,d),M=m.useMemo(()=>Object.assign(Object.assign({},S),{status:R,hasFeedback:!1,feedbackIcon:null}),[S,R]),D=m.useRef(null),E=m.useRef({});m.useImperativeHandle(e,()=>({focus:()=>{var B;(B=E.current[0])===null||B===void 0||B.focus()},blur:()=>{var B;for(let _=0;_s?s(B):B,[j,L]=m.useState(WY(W(i||"")));m.useEffect(()=>{a!==void 0&&L(WY(a))},[a]);const k=q6(B=>{L(B),l&&B.length===o&&B.every(_=>_)&&B.some((_,X)=>j[X]!==_)&&l(B.join(""))}),N=q6((B,_)=>{let X=Za(j);for(let Q=0;Q=0&&!X[Q];Q-=1)X.pop();const $=W(X.map(Q=>Q||" ").join(""));return X=WY($).map((Q,le)=>Q===" "&&!X[le]?X[le]:Q),X}),F=(B,_)=>{var X;const $=N(B,_),Q=Math.min(B+_.length,o-1);Q!==B&&((X=E.current[Q])===null||X===void 0||X.focus()),k($)},U=B=>{var _;(_=E.current[B])===null||_===void 0||_.focus()},O={variant:c,disabled:u,status:R,mask:p};return v(m.createElement("div",Object.assign({},C,{ref:D,className:Un(b,{[`${b}-sm`]:x==="small",[`${b}-lg`]:x==="large",[`${b}-rtl`]:w==="rtl"},A,T)}),m.createElement(r1.Provider,{value:M},Array.from({length:o}).map((B,_)=>{const X=`otp-${_}`,$=j[_]||"";return m.createElement(zUt,Object.assign({ref:Q=>{E.current[_]=Q},key:X,index:_,size:x,htmlSize:1,className:`${b}-input`,onChange:F,value:$,onActiveChange:U,autoFocus:_===0&&f},O))}))))});var FUt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},kUt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:FUt}))},LUt=m.forwardRef(kUt),WUt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},NUt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:WUt}))},UUt=m.forwardRef(NUt),jUt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);rt?m.createElement(UUt,null):m.createElement(LUt,null),YUt={click:"onClick",hover:"onMouseOver"},OUt=m.forwardRef((t,e)=>{const{disabled:n,action:o="click",visibilityToggle:r=!0,iconRender:i=BUt}=t,a=typeof r=="object"&&r.visible!==void 0,[l,s]=m.useState(()=>a?r.visible:!1),c=m.useRef(null);m.useEffect(()=>{a&&s(r.visible)},[a,r]);const u=RJe(c),d=()=>{n||(l&&u(),s(S=>{var R;const M=!S;return typeof r=="object"&&((R=r.onVisibleChange)===null||R===void 0||R.call(r,M)),M}))},f=S=>{const R=YUt[o]||"",M=i(l),D={[R]:d,className:`${S}-icon`,key:"passwordIcon",onMouseDown:E=>{E.preventDefault()},onMouseUp:E=>{E.preventDefault()}};return m.cloneElement(m.isValidElement(M)?M:m.createElement("span",null,M),D)},{className:p,prefixCls:g,inputPrefixCls:y,size:w}=t,b=jUt(t,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:C}=m.useContext(Cr),P=C("input",y),v=C("input-password",g),T=r&&f(v),A=Un(v,p,{[`${v}-${w}`]:!!w}),x=Object.assign(Object.assign({},up(b,["suffix","iconRender","visibilityToggle"])),{type:l?"text":"password",className:A,prefixCls:P,suffix:T});return w&&(x.size=w),m.createElement(cQ,Object.assign({ref:o5(e,c)},x))});var _Ut=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:n,inputPrefixCls:o,className:r,size:i,suffix:a,enterButton:l=!1,addonAfter:s,loading:c,disabled:u,onSearch:d,onChange:f,onCompositionStart:p,onCompositionEnd:g}=t,y=_Ut(t,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:w,direction:b}=m.useContext(Cr),C=m.useRef(!1),P=w("input-search",n),v=w("input",o),{compactSize:T}=Nw(P,b),A=Ed(O=>{var B;return(B=i??T)!==null&&B!==void 0?B:O}),x=m.useRef(null),S=O=>{O&&O.target&&O.type==="click"&&d&&d(O.target.value,O,{source:"clear"}),f&&f(O)},R=O=>{var B;document.activeElement===((B=x.current)===null||B===void 0?void 0:B.input)&&O.preventDefault()},M=O=>{var B,_;d&&d((_=(B=x.current)===null||B===void 0?void 0:B.input)===null||_===void 0?void 0:_.value,O,{source:"input"})},D=O=>{C.current||c||M(O)},E=typeof l=="boolean"?m.createElement(kme,null):null,W=`${P}-button`;let j;const L=l||{},k=L.type&&L.type.__ANT_BUTTON===!0;k||L.type==="button"?j=B0(L,Object.assign({onMouseDown:R,onClick:O=>{var B,_;(_=(B=L==null?void 0:L.props)===null||B===void 0?void 0:B.onClick)===null||_===void 0||_.call(B,O),M(O)},key:"enterButton"},k?{className:W,size:A}:{})):j=m.createElement(lo,{className:W,type:l?"primary":void 0,size:A,disabled:u,key:"enterButton",onMouseDown:R,onClick:M,loading:c,icon:E},l),s&&(j=[j,B0(s,{key:"addonAfter"})]);const N=Un(P,{[`${P}-rtl`]:b==="rtl",[`${P}-${A}`]:!!A,[`${P}-with-button`]:!!l},r),F=O=>{C.current=!0,p==null||p(O)},U=O=>{C.current=!1,g==null||g(O)};return m.createElement(cQ,Object.assign({ref:o5(x,e),onPressEnter:D},y,{size:A,onCompositionStart:F,onCompositionEnd:U,prefixCls:v,addonAfter:j,suffix:a,onChange:S,className:N,disabled:u}))});var GUt=` min-height:0 !important; max-height:none !important; height:0 !important; @@ -4628,11 +4628,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho top:0 !important; right:0 !important; pointer-events: none !important; -`,XUt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],die={},gm;function JUt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=t.getAttribute("id")||t.getAttribute("data-reactid")||t.getAttribute("name");if(e&&die[n])return die[n];var o=window.getComputedStyle(t),r=o.getPropertyValue("box-sizing")||o.getPropertyValue("-moz-box-sizing")||o.getPropertyValue("-webkit-box-sizing"),i=parseFloat(o.getPropertyValue("padding-bottom"))+parseFloat(o.getPropertyValue("padding-top")),a=parseFloat(o.getPropertyValue("border-bottom-width"))+parseFloat(o.getPropertyValue("border-top-width")),l=XUt.map(function(c){return"".concat(c,":").concat(o.getPropertyValue(c))}).join(";"),s={sizingStyle:l,paddingSize:i,borderSize:a,boxSizing:r};return e&&n&&(die[n]=s),s}function KUt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;gm||(gm=document.createElement("textarea"),gm.setAttribute("tab-index","-1"),gm.setAttribute("aria-hidden","true"),document.body.appendChild(gm)),t.getAttribute("wrap")?gm.setAttribute("wrap",t.getAttribute("wrap")):gm.removeAttribute("wrap");var r=JUt(t,e),i=r.paddingSize,a=r.borderSize,l=r.boxSizing,s=r.sizingStyle;gm.setAttribute("style","".concat(s,";").concat(GUt)),gm.value=t.value||t.placeholder||"";var c=void 0,u=void 0,d,f=gm.scrollHeight;if(l==="border-box"?f+=a:l==="content-box"&&(f-=i),n!==null||o!==null){gm.value=" ";var p=gm.scrollHeight-i;n!==null&&(c=p*n,l==="border-box"&&(c=c+i+a),f=Math.max(c,f)),o!==null&&(u=p*o,l==="border-box"&&(u=u+i+a),d=f>u?"":"hidden",f=Math.min(u,f))}var g={height:f,overflowY:d,resize:"none"};return c&&(g.minHeight=c),u&&(g.maxHeight=u),g}var qUt=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],fie=0,hie=1,pie=2,$Ut=m.forwardRef(function(t,e){var n=t,o=n.prefixCls;n.onPressEnter;var r=n.defaultValue,i=n.value,a=n.autoSize,l=n.onResize,s=n.className,c=n.style,u=n.disabled,d=n.onChange;n.onInternalAutoSize;var f=ii(n,qUt),p=zs(r,{value:i,postState:function($){return $??""}}),g=ln(p,2),y=g[0],w=g[1],b=function($){w($.target.value),d==null||d($)},C=m.useRef();m.useImperativeHandle(e,function(){return{textArea:C.current}});var P=m.useMemo(function(){return a&&hi(a)==="object"?[a.minRows,a.maxRows]:[]},[a]),v=ln(P,2),T=v[0],A=v[1],x=!!a,S=function(){try{if(document.activeElement===C.current){var $=C.current,Q=$.selectionStart,le=$.selectionEnd,q=$.scrollTop;C.current.setSelectionRange(Q,le),C.current.scrollTop=q}}catch{}},R=m.useState(pie),M=ln(R,2),D=M[0],E=M[1],W=m.useState(),j=ln(W,2),L=j[0],k=j[1],N=function(){E(fie)};Xa(function(){x&&N()},[i,T,A,x]),Xa(function(){if(D===fie)E(hie);else if(D===hie){var X=KUt(C.current,!1,T,A);E(pie),k(X)}else S()},[D]);var F=m.useRef(),U=function(){Fa.cancel(F.current)},O=function($){D===pie&&(l==null||l($),a&&(U(),F.current=Fa(function(){N()})))};m.useEffect(function(){return U},[]);var B=x?L:null,_=qt(qt({},c),B);return(D===fie||D===hie)&&(_.overflowY="hidden",_.overflowX="hidden"),m.createElement(Td,{onResize:O,disabled:!(a||l)},m.createElement("textarea",ho({},f,{ref:C,style:_,className:Vn(o,s,Vt({},"".concat(o,"-disabled"),u)),disabled:u,value:y,onChange:b})))}),QUt=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize"],ZUt=be.forwardRef(function(t,e){var n,o,r=t.defaultValue,i=t.value,a=t.onFocus,l=t.onBlur,s=t.onChange,c=t.allowClear,u=t.maxLength,d=t.onCompositionStart,f=t.onCompositionEnd,p=t.suffix,g=t.prefixCls,y=g===void 0?"rc-textarea":g,w=t.showCount,b=t.count,C=t.className,P=t.style,v=t.disabled,T=t.hidden,A=t.classNames,x=t.styles,S=t.onResize,R=ii(t,QUt),M=zs(r,{value:i,defaultValue:r}),D=ln(M,2),E=D[0],W=D[1],j=E==null?"":String(E),L=be.useState(!1),k=ln(L,2),N=k[0],F=k[1],U=be.useRef(!1),O=be.useState(null),B=ln(O,2),_=B[0],X=B[1],$=m.useRef(null),Q=function(){var Me;return(Me=$.current)===null||Me===void 0?void 0:Me.textArea},le=function(){Q().focus()};m.useImperativeHandle(e,function(){return{resizableTextArea:$.current,focus:le,blur:function(){Q().blur()}}}),m.useEffect(function(){F(function(Te){return!v&&Te})},[v]);var q=be.useState(null),te=ln(q,2),re=te[0],ae=te[1];be.useEffect(function(){if(re){var Te;(Te=Q()).setSelectionRange.apply(Te,Lo(re))}},[re]);var se=SJe(b,w),ne=(n=se.max)!==null&&n!==void 0?n:u,fe=Number(ne)>0,ge=se.strategy(j),de=!!ne&&ge>ne,Z=function(Me,Pe){var Ee=Pe;!U.current&&se.exceedFormatter&&se.max&&se.strategy(Pe)>se.max&&(Ee=se.exceedFormatter(Pe,{max:se.max}),Pe!==Ee&&ae([Q().selectionStart||0,Q().selectionEnd||0])),W(Ee),VG(Me.currentTarget,Me,s,Ee)},he=function(Me){U.current=!0,d==null||d(Me)},xe=function(Me){U.current=!1,Z(Me,Me.currentTarget.value),f==null||f(Me)},He=function(Me){Z(Me,Me.target.value)},Se=function(Me){var Pe=R.onPressEnter,Ee=R.onKeyDown;Me.key==="Enter"&&Pe&&Pe(Me),Ee==null||Ee(Me)},ze=function(Me){F(!0),a==null||a(Me)},Ie=function(Me){F(!1),l==null||l(Me)},ye=function(Me){W(""),le(),VG(Q(),Me,s)},ce=p,pe;se.show&&(se.showFormatter?pe=se.showFormatter({value:j,count:ge,maxLength:ne}):pe="".concat(ge).concat(fe?" / ".concat(ne):""),ce=be.createElement(be.Fragment,null,ce,be.createElement("span",{className:Vn("".concat(y,"-data-count"),A==null?void 0:A.count),style:x==null?void 0:x.count},pe)));var ve=function(Me){var Pe;S==null||S(Me),(Pe=Q())!==null&&Pe!==void 0&&Pe.style.height&&X(!0)},Ae=!R.autoSize&&!w&&!c;return be.createElement(sye,{value:j,allowClear:c,handleReset:ye,suffix:ce,prefixCls:y,classNames:qt(qt({},A),{},{affixWrapper:Vn(A==null?void 0:A.affixWrapper,(o={},Vt(o,"".concat(y,"-show-count"),w),Vt(o,"".concat(y,"-textarea-allow-clear"),c),o))}),disabled:v,focused:N,className:Vn(C,de&&"".concat(y,"-out-of-range")),style:qt(qt({},P),_&&!Ae?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof pe=="string"?pe:void 0}},hidden:T},be.createElement($Ut,ho({},R,{maxLength:u,onKeyDown:Se,onChange:He,onFocus:ze,onBlur:Ie,onCompositionStart:he,onCompositionEnd:xe,className:Vn(A==null?void 0:A.textarea),style:qt(qt({},x==null?void 0:x.textarea),{},{resize:P==null?void 0:P.resize}),disabled:v,prefixCls:y,onResize:ve,ref:$})))}),ejt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n,o;const{prefixCls:r,bordered:i=!0,size:a,disabled:l,status:s,allowClear:c,classNames:u,rootClassName:d,className:f,style:p,styles:g,variant:y}=t,w=ejt(t,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","style","styles","variant"]),{getPrefixCls:b,direction:C,textArea:P}=m.useContext(Cr),v=Ed(a),T=m.useContext(n1),A=l??T,{status:x,hasFeedback:S,feedbackIcon:R}=m.useContext(r1),M=Lb(x,s),D=m.useRef(null);m.useImperativeHandle(e,()=>{var O;return{resizableTextArea:(O=D.current)===null||O===void 0?void 0:O.resizableTextArea,focus:B=>{var _,X;RUt((X=(_=D.current)===null||_===void 0?void 0:_.resizableTextArea)===null||X===void 0?void 0:X.textArea,B)},blur:()=>{var B;return(B=D.current)===null||B===void 0?void 0:B.blur()}}});const E=b("input",r),W=O0(E),[j,L,k]=oye(E,W),[N,F]=BH(y,i),U=CJe(c??(P==null?void 0:P.allowClear));return j(m.createElement(ZUt,Object.assign({autoComplete:P==null?void 0:P.autoComplete},w,{style:Object.assign(Object.assign({},P==null?void 0:P.style),p),styles:Object.assign(Object.assign({},P==null?void 0:P.styles),g),disabled:A,allowClear:U,className:Un(k,W,f,d,P==null?void 0:P.className),classNames:Object.assign(Object.assign(Object.assign({},u),P==null?void 0:P.classNames),{textarea:Un({[`${E}-sm`]:v==="small",[`${E}-lg`]:v==="large"},L,u==null?void 0:u.textarea,(n=P==null?void 0:P.classNames)===null||n===void 0?void 0:n.textarea),variant:Un({[`${E}-${N}`]:F},sw(E,M)),affixWrapper:Un(`${E}-textarea-affix-wrapper`,{[`${E}-affix-wrapper-rtl`]:C==="rtl",[`${E}-affix-wrapper-sm`]:v==="small",[`${E}-affix-wrapper-lg`]:v==="large",[`${E}-textarea-show-count`]:t.showCount||((o=t.count)===null||o===void 0?void 0:o.show)},L)}),prefixCls:E,suffix:S&&m.createElement("span",{className:`${E}-textarea-suffix`},R),ref:D})))}),as=cQ;as.Group=TUt;as.Search=VUt;as.TextArea=HJe;as.Password=OUt;as.OTP=EUt;var tjt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"},njt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:tjt}))},MJe=m.forwardRef(njt),ojt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},rjt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:ojt}))},IJe=m.forwardRef(rjt),ijt={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z"}}]},name:"swap-right",theme:"outlined"},ajt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:ijt}))},ljt=m.forwardRef(ajt);function sjt(t,e,n){return n!==void 0?n:e==="year"&&t.lang.yearPlaceholder?t.lang.yearPlaceholder:e==="quarter"&&t.lang.quarterPlaceholder?t.lang.quarterPlaceholder:e==="month"&&t.lang.monthPlaceholder?t.lang.monthPlaceholder:e==="week"&&t.lang.weekPlaceholder?t.lang.weekPlaceholder:e==="time"&&t.timePickerLocale.placeholder?t.timePickerLocale.placeholder:t.lang.placeholder}function cjt(t,e,n){return n!==void 0?n:e==="year"&&t.lang.yearPlaceholder?t.lang.rangeYearPlaceholder:e==="quarter"&&t.lang.quarterPlaceholder?t.lang.rangeQuarterPlaceholder:e==="month"&&t.lang.monthPlaceholder?t.lang.rangeMonthPlaceholder:e==="week"&&t.lang.weekPlaceholder?t.lang.rangeWeekPlaceholder:e==="time"&&t.timePickerLocale.placeholder?t.timePickerLocale.rangePlaceholder:t.lang.rangePlaceholder}function cye(t,e){const n={adjustX:1,adjustY:1};switch(e){case"bottomLeft":return{points:["tl","bl"],offset:[0,4],overflow:n};case"bottomRight":return{points:["tr","br"],offset:[0,4],overflow:n};case"topLeft":return{points:["bl","tl"],offset:[0,-4],overflow:n};case"topRight":return{points:["br","tr"],offset:[0,-4],overflow:n};default:return{points:t==="rtl"?["tr","br"]:["tl","bl"],offset:[0,4],overflow:n}}}function zJe(t,e){const{allowClear:n=!0}=t,{clearIcon:o,removeIcon:r}=WGe(Object.assign(Object.assign({},t),{prefixCls:e,componentName:"DatePicker"}));return[m.useMemo(()=>n===!1?!1:Object.assign({clearIcon:o},n===!0?{}:n),[n,o]),r]}function ujt(t){return m.createElement(lo,Object.assign({size:"small",type:"primary"},t))}function DJe(t){return m.useMemo(()=>Object.assign({button:ujt},t),[t])}var djt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var r;const{prefixCls:i,getPopupContainer:a,components:l,className:s,style:c,placement:u,size:d,disabled:f,bordered:p=!0,placeholder:g,popupClassName:y,dropdownClassName:w,status:b,rootClassName:C,variant:P}=n,v=djt(n,["prefixCls","getPopupContainer","components","className","style","placement","size","disabled","bordered","placeholder","popupClassName","dropdownClassName","status","rootClassName","variant"]),T=m.useRef(null),{getPrefixCls:A,direction:x,getPopupContainer:S,rangePicker:R}=m.useContext(Cr),M=A("picker",i),{compactSize:D,compactItemClassnames:E}=Nw(M,x),{picker:W}=n,j=A(),[L,k]=BH(P,p),N=O0(M),[F,U,O]=lJe(M,N),[B]=zJe(n,M),_=DJe(l),X=Ed(ge=>{var de;return(de=d??D)!==null&&de!==void 0?de:ge}),$=m.useContext(n1),Q=f??$,le=m.useContext(r1),{hasFeedback:q,status:te,feedbackIcon:re}=le,ae=m.createElement(m.Fragment,null,W==="time"?m.createElement(IJe,null):m.createElement(MJe,null),q&&re);m.useImperativeHandle(o,()=>T.current);const[se]=kw("Calendar",CG),ne=Object.assign(Object.assign({},se),n.locale),[fe]=Ww("DatePicker",(r=n.popupStyle)===null||r===void 0?void 0:r.zIndex);return F(m.createElement(Y9,null,m.createElement(FLt,Object.assign({separator:m.createElement("span",{"aria-label":"to",className:`${M}-separator`},m.createElement(ljt,null)),disabled:Q,ref:T,popupAlign:cye(x,u),placeholder:cjt(ne,W,g),suffixIcon:ae,prevIcon:m.createElement("span",{className:`${M}-prev-icon`}),nextIcon:m.createElement("span",{className:`${M}-next-icon`}),superPrevIcon:m.createElement("span",{className:`${M}-super-prev-icon`}),superNextIcon:m.createElement("span",{className:`${M}-super-next-icon`}),transitionName:`${j}-slide-up`},v,{className:Un({[`${M}-${X}`]:X,[`${M}-${L}`]:k},sw(M,Lb(te,b),q),U,E,s,R==null?void 0:R.className,O,N,C),style:Object.assign(Object.assign({},R==null?void 0:R.style),c),locale:ne.lang,prefixCls:M,getPopupContainer:a||S,generateConfig:t,components:_,direction:x,classNames:{popup:Un(U,y||w,O,N,C)},styles:{popup:Object.assign(Object.assign({},n.popupStyle),{zIndex:fe})},allowClear:B}))))})}var hjt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var g;const{prefixCls:y,getPopupContainer:w,components:b,style:C,className:P,rootClassName:v,size:T,bordered:A,placement:x,placeholder:S,popupClassName:R,dropdownClassName:M,disabled:D,status:E,variant:W,onCalendarChange:j}=f,L=hjt(f,["prefixCls","getPopupContainer","components","style","className","rootClassName","size","bordered","placement","placeholder","popupClassName","dropdownClassName","disabled","status","variant","onCalendarChange"]),{getPrefixCls:k,direction:N,getPopupContainer:F,[u]:U}=m.useContext(Cr),O=k("picker",y),{compactSize:B,compactItemClassnames:_}=Nw(O,N),X=m.useRef(null),[$,Q]=BH(W,A),le=O0(O),[q,te,re]=lJe(O,le);m.useImperativeHandle(p,()=>X.current);const ae={showToday:!0},se=s||f.picker,ne=k(),{onSelect:fe,multiple:ge}=L,de=fe&&s==="time"&&!ge,Z=(Ee,Be,Je)=>{j==null||j(Ee,Be,Je),de&&fe(Ee)},[he,xe]=zJe(f,O),He=DJe(b),Se=Ed(Ee=>{var Be;return(Be=T??B)!==null&&Be!==void 0?Be:Ee}),ze=m.useContext(n1),Ie=D??ze,ye=m.useContext(r1),{hasFeedback:ce,status:pe,feedbackIcon:ve}=ye,Ae=m.createElement(m.Fragment,null,se==="time"?m.createElement(IJe,null):m.createElement(MJe,null),ce&&ve),[Te]=kw("DatePicker",CG),Me=Object.assign(Object.assign({},Te),f.locale),[Pe]=Ww("DatePicker",(g=f.popupStyle)===null||g===void 0?void 0:g.zIndex);return q(m.createElement(Y9,null,m.createElement(jLt,Object.assign({ref:X,placeholder:sjt(Me,se,S),suffixIcon:Ae,dropdownAlign:cye(N,x),prevIcon:m.createElement("span",{className:`${O}-prev-icon`}),nextIcon:m.createElement("span",{className:`${O}-next-icon`}),superPrevIcon:m.createElement("span",{className:`${O}-super-prev-icon`}),superNextIcon:m.createElement("span",{className:`${O}-super-next-icon`}),transitionName:`${ne}-slide-up`,picker:s,onCalendarChange:Z},ae,L,{locale:Me.lang,className:Un({[`${O}-${Se}`]:Se,[`${O}-${$}`]:Q},sw(O,Lb(pe,E),ce),te,_,U==null?void 0:U.className,P,re,le,v),style:Object.assign(Object.assign({},U==null?void 0:U.style),C),prefixCls:O,getPopupContainer:w||F,generateConfig:t,components:He,direction:N,disabled:Ie,classNames:{popup:Un(te,re,le,v,R||M)},styles:{popup:Object.assign(Object.assign({},f.popupStyle),{zIndex:Pe})},allowClear:he,removeIcon:xe}))))})}const n=e(),o=e("week","WeekPicker"),r=e("month","MonthPicker"),i=e("year","YearPicker"),a=e("quarter","QuarterPicker"),l=e("time","TimePicker");return{DatePicker:n,WeekPicker:o,MonthPicker:r,YearPicker:i,TimePicker:l,QuarterPicker:a}}function EJe(t){const{DatePicker:e,WeekPicker:n,MonthPicker:o,YearPicker:r,TimePicker:i,QuarterPicker:a}=pjt(t),l=fjt(t),s=e;return s.WeekPicker=n,s.MonthPicker=o,s.YearPicker=r,s.RangePicker=l,s.TimePicker=i,s.QuarterPicker=a,s}const Ub=EJe(_kt);function FJe(t){const e=cye(t.direction,t.placement);return e.overflow.adjustY=!1,e.overflow.adjustX=!1,Object.assign(Object.assign({},t),{dropdownAlign:e})}const gjt=BW(Ub,"picker",null,FJe);Ub._InternalPanelDoNotUseOrYouWillBeFired=gjt;const mjt=BW(Ub.RangePicker,"picker",null,FJe);Ub._InternalRangePanelDoNotUseOrYouWillBeFired=mjt;Ub.generatePicker=EJe;function ck(t){"@babel/helpers - typeof";return ck=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},ck(t)}function yjt(t,e){if(ck(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(ck(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ajt(t){var e=yjt(t,"string");return ck(e)=="symbol"?e:e+""}function hue(t,e,n){return e=Ajt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cxe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function i2(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)continue;n[o]=t[o]}return n}function Tjt(t,e){if(t==null)return{};var n=Sjt(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var Pjt=["prefixCls","className","containerRef"],Cjt=function(e){var n=e.prefixCls,o=e.className,r=e.containerRef,i=Tjt(e,Pjt),a=m.useContext(kJe),l=a.panel,s=Fw(l,r);return m.createElement("div",jv({className:Vn("".concat(n,"-content"),o),role:"dialog",ref:s},Sf(e,{aria:!0}),{"aria-modal":"true"},i))};function Mxe(t){return typeof t=="string"&&String(Number(t))===t?(j0(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(t)):t}var Ixe={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function Rjt(t,e){var n,o,r,i=t.prefixCls,a=t.open,l=t.placement,s=t.inline,c=t.push,u=t.forceRender,d=t.autoFocus,f=t.keyboard,p=t.classNames,g=t.rootClassName,y=t.rootStyle,w=t.zIndex,b=t.className,C=t.id,P=t.style,v=t.motion,T=t.width,A=t.height,x=t.children,S=t.mask,R=t.maskClosable,M=t.maskMotion,D=t.maskClassName,E=t.maskStyle,W=t.afterOpenChange,j=t.onClose,L=t.onMouseEnter,k=t.onMouseOver,N=t.onMouseLeave,F=t.onClick,U=t.onKeyDown,O=t.onKeyUp,B=t.styles,_=m.useRef(),X=m.useRef(),$=m.useRef();m.useImperativeHandle(e,function(){return _.current});var Q=function(ze){var Ie=ze.keyCode,ye=ze.shiftKey;switch(Ie){case Bn.TAB:{if(Ie===Bn.TAB){if(!ye&&document.activeElement===$.current){var ce;(ce=X.current)===null||ce===void 0||ce.focus({preventScroll:!0})}else if(ye&&document.activeElement===X.current){var pe;(pe=$.current)===null||pe===void 0||pe.focus({preventScroll:!0})}}break}case Bn.ESC:{j&&f&&(ze.stopPropagation(),j(ze));break}}};m.useEffect(function(){if(a&&d){var Se;(Se=_.current)===null||Se===void 0||Se.focus({preventScroll:!0})}},[a]);var le=m.useState(!1),q=pue(le,2),te=q[0],re=q[1],ae=m.useContext(Hxe),se;typeof c=="boolean"?se=c?{}:{distance:0}:se=c||{};var ne=(n=(o=(r=se)===null||r===void 0?void 0:r.distance)!==null&&o!==void 0?o:ae==null?void 0:ae.pushDistance)!==null&&n!==void 0?n:180,fe=m.useMemo(function(){return{pushDistance:ne,push:function(){re(!0)},pull:function(){re(!1)}}},[ne]);m.useEffect(function(){if(a){var Se;ae==null||(Se=ae.push)===null||Se===void 0||Se.call(ae)}else{var ze;ae==null||(ze=ae.pull)===null||ze===void 0||ze.call(ae)}},[a]),m.useEffect(function(){return function(){var Se;ae==null||(Se=ae.pull)===null||Se===void 0||Se.call(ae)}},[]);var ge=S&&m.createElement(o1,jv({key:"mask"},M,{visible:a}),function(Se,ze){var Ie=Se.className,ye=Se.style;return m.createElement("div",{className:Vn("".concat(i,"-mask"),Ie,p==null?void 0:p.mask,D),style:i2(i2(i2({},ye),E),B==null?void 0:B.mask),onClick:R&&a?j:void 0,ref:ze})}),de=typeof v=="function"?v(l):v,Z={};if(te&&ne)switch(l){case"top":Z.transform="translateY(".concat(ne,"px)");break;case"bottom":Z.transform="translateY(".concat(-ne,"px)");break;case"left":Z.transform="translateX(".concat(ne,"px)");break;default:Z.transform="translateX(".concat(-ne,"px)");break}l==="left"||l==="right"?Z.width=Mxe(T):Z.height=Mxe(A);var he={onMouseEnter:L,onMouseOver:k,onMouseLeave:N,onClick:F,onKeyDown:U,onKeyUp:O},xe=m.createElement(o1,jv({key:"panel"},de,{visible:a,forceRender:u,onVisibleChanged:function(ze){W==null||W(ze)},removeOnLeave:!1,leavedClassName:"".concat(i,"-content-wrapper-hidden")}),function(Se,ze){var Ie=Se.className,ye=Se.style;return m.createElement("div",jv({className:Vn("".concat(i,"-content-wrapper"),p==null?void 0:p.wrapper,Ie),style:i2(i2(i2({},Z),ye),B==null?void 0:B.wrapper)},Sf(t,{data:!0})),m.createElement(Cjt,jv({id:C,containerRef:ze,prefixCls:i,className:Vn(b,p==null?void 0:p.content),style:i2(i2({},P),B==null?void 0:B.content)},Sf(t,{aria:!0}),he),x))}),He=i2({},y);return w&&(He.zIndex=w),m.createElement(Hxe.Provider,{value:fe},m.createElement("div",{className:Vn(i,"".concat(i,"-").concat(l),g,hue(hue({},"".concat(i,"-open"),a),"".concat(i,"-inline"),s)),style:He,tabIndex:-1,ref:_,onKeyDown:Q},ge,m.createElement("div",{tabIndex:0,ref:X,style:Ixe,"aria-hidden":"true","data-sentinel":"start"}),xe,m.createElement("div",{tabIndex:0,ref:$,style:Ixe,"aria-hidden":"true","data-sentinel":"end"})))}var Hjt=m.forwardRef(Rjt),Mjt=function(e){var n=e.open,o=n===void 0?!1:n,r=e.prefixCls,i=r===void 0?"rc-drawer":r,a=e.placement,l=a===void 0?"right":a,s=e.autoFocus,c=s===void 0?!0:s,u=e.keyboard,d=u===void 0?!0:u,f=e.width,p=f===void 0?378:f,g=e.mask,y=g===void 0?!0:g,w=e.maskClosable,b=w===void 0?!0:w,C=e.getContainer,P=e.forceRender,v=e.afterOpenChange,T=e.destroyOnClose,A=e.onMouseEnter,x=e.onMouseOver,S=e.onMouseLeave,R=e.onClick,M=e.onKeyDown,D=e.onKeyUp,E=e.panelRef,W=m.useState(!1),j=pue(W,2),L=j[0],k=j[1],N=m.useState(!1),F=pue(N,2),U=F[0],O=F[1];Xa(function(){O(!0)},[]);var B=U?o:!1,_=m.useRef(),X=m.useRef();Xa(function(){B&&(X.current=document.activeElement)},[B]);var $=function(re){var ae;if(k(re),v==null||v(re),!re&&X.current&&!((ae=_.current)!==null&&ae!==void 0&&ae.contains(X.current))){var se;(se=X.current)===null||se===void 0||se.focus({preventScroll:!0})}},Q=m.useMemo(function(){return{panel:E}},[E]);if(!P&&!L&&!B&&T)return null;var le={onMouseEnter:A,onMouseOver:x,onMouseLeave:S,onClick:R,onKeyDown:M,onKeyUp:D},q=i2(i2({},e),{},{open:B,prefixCls:i,placement:l,autoFocus:c,keyboard:d,width:p,mask:y,maskClosable:b,inline:C===!1,afterOpenChange:$,ref:_},le);return m.createElement(kJe.Provider,{value:Q},m.createElement(W$,{open:B||P||L,autoDestroy:!1,getContainer:C,autoLock:y&&(B||L)},m.createElement(Hjt,q)))};const Ijt=new xa("antSpinMove",{to:{opacity:1}}),zjt=new xa("antRotate",{to:{transform:"rotate(405deg)"}}),Djt=t=>{const{componentCls:e,calc:n}=t;return{[`${e}`]:Object.assign(Object.assign({},ja(t)),{position:"absolute",display:"none",color:t.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${t.motionDurationSlow} ${t.motionEaseInOutCirc}`,"&-spinning":{position:"static",display:"inline-block",opacity:1},[`${e}-text`]:{fontSize:t.fontSize,paddingTop:n(n(t.dotSize).sub(t.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:t.colorBgMask,zIndex:t.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${t.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[`${e}-dot ${e}-dot-item`]:{backgroundColor:t.colorWhite},[`${e}-text`]:{color:t.colorTextLightSolid}},"&-nested-loading":{position:"relative",[`> div > ${e}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:t.contentHeight,[`${e}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(t.dotSize).mul(-1).div(2).equal()},[`${e}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${t.colorBgContainer}`},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${e}-dot`]:{margin:n(t.dotSizeSM).mul(-1).div(2).equal()},[`${e}-text`]:{paddingTop:n(n(t.dotSizeSM).sub(t.fontSize)).div(2).add(2).equal()},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${e}-dot`]:{margin:n(t.dotSizeLG).mul(-1).div(2).equal()},[`${e}-text`]:{paddingTop:n(n(t.dotSizeLG).sub(t.fontSize)).div(2).add(2).equal()},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${e}-container`]:{position:"relative",transition:`opacity ${t.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:t.colorBgContainer,opacity:0,transition:`all ${t.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${e}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:t.spinDotDefault},[`${e}-dot`]:{position:"relative",display:"inline-block",fontSize:t.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(t.dotSize).sub(n(t.marginXXS).div(2)).div(2).equal(),height:n(t.dotSize).sub(n(t.marginXXS).div(2)).div(2).equal(),backgroundColor:t.colorPrimary,borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:Ijt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:zjt,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&-sm ${e}-dot`]:{fontSize:t.dotSizeSM,i:{width:n(n(t.dotSizeSM).sub(n(t.marginXXS).div(2))).div(2).equal(),height:n(n(t.dotSizeSM).sub(n(t.marginXXS).div(2))).div(2).equal()}},[`&-lg ${e}-dot`]:{fontSize:t.dotSizeLG,i:{width:n(n(t.dotSizeLG).sub(t.marginXXS)).div(2).equal(),height:n(n(t.dotSizeLG).sub(t.marginXXS)).div(2).equal()}},[`&${e}-show-text ${e}-text`]:{display:"block"}})}},Ejt=t=>{const{controlHeightLG:e,controlHeight:n}=t;return{contentHeight:400,dotSize:e/2,dotSizeSM:e*.35,dotSizeLG:n}},Fjt=wl("Spin",t=>{const e=Ki(t,{spinDotDefault:t.colorTextDescription});return[Djt(e)]},Ejt);var kjt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:e,spinning:n=!0,delay:o=0,className:r,rootClassName:i,size:a="default",tip:l,wrapperClassName:s,style:c,children:u,fullscreen:d=!1}=t,f=kjt(t,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen"]),{getPrefixCls:p}=m.useContext(Cr),g=p("spin",e),[y,w,b]=Fjt(g),[C,P]=m.useState(()=>n&&!Wjt(n,o));m.useEffect(()=>{if(n){const E=yNt(o,()=>{P(!0)});return E(),()=>{var W;(W=E==null?void 0:E.cancel)===null||W===void 0||W.call(E)}}P(!1)},[o,n]);const v=m.useMemo(()=>typeof u<"u"&&!d,[u,d]),{direction:T,spin:A}=m.useContext(Cr),x=Un(g,A==null?void 0:A.className,{[`${g}-sm`]:a==="small",[`${g}-lg`]:a==="large",[`${g}-spinning`]:C,[`${g}-show-text`]:!!l,[`${g}-fullscreen`]:d,[`${g}-fullscreen-show`]:d&&C,[`${g}-rtl`]:T==="rtl"},r,i,w,b),S=Un(`${g}-container`,{[`${g}-blur`]:C}),R=up(f,["indicator"]),M=Object.assign(Object.assign({},A==null?void 0:A.style),c),D=m.createElement("div",Object.assign({},R,{style:M,className:x,"aria-live":"polite","aria-busy":C}),Ljt(g,t),l&&(v||d)?m.createElement("div",{className:`${g}-text`},l):null);return y(v?m.createElement("div",Object.assign({},R,{className:Un(`${g}-nested-loading`,s,w,b)}),C&&m.createElement("div",{key:"loading"},D),m.createElement("div",{className:S,key:"container"},u)):D)};qW.setDefaultIndicator=t=>{q_=t};const LJe=t=>{var e,n;const{prefixCls:o,title:r,footer:i,extra:a,loading:l,onClose:s,headerStyle:c,bodyStyle:u,footerStyle:d,children:f,classNames:p,styles:g}=t,{drawer:y}=m.useContext(Cr),w=m.useCallback(A=>m.createElement("button",{type:"button",onClick:s,"aria-label":"Close",className:`${o}-close`},A),[s]),[b,C]=Tme(mR(t),mR(y),{closable:!0,closeIconRender:w});let P;typeof l=="boolean"?P={spinning:l}:typeof l=="object"&&(P=Object.assign({spinning:!0},l));const v=m.useMemo(()=>{var A,x;return!r&&!b?null:m.createElement("div",{style:Object.assign(Object.assign(Object.assign({},(A=y==null?void 0:y.styles)===null||A===void 0?void 0:A.header),c),g==null?void 0:g.header),className:Un(`${o}-header`,{[`${o}-header-close-only`]:b&&!r&&!a},(x=y==null?void 0:y.classNames)===null||x===void 0?void 0:x.header,p==null?void 0:p.header)},m.createElement("div",{className:`${o}-header-title`},C,r&&m.createElement("div",{className:`${o}-title`},r)),a&&m.createElement("div",{className:`${o}-extra`},a))},[b,C,a,c,o,r]),T=m.useMemo(()=>{var A,x;if(!i)return null;const S=`${o}-footer`;return m.createElement("div",{className:Un(S,(A=y==null?void 0:y.classNames)===null||A===void 0?void 0:A.footer,p==null?void 0:p.footer),style:Object.assign(Object.assign(Object.assign({},(x=y==null?void 0:y.styles)===null||x===void 0?void 0:x.footer),d),g==null?void 0:g.footer)},i)},[i,d,o]);return P!=null&&P.spinning?m.createElement(qW,Object.assign({spinning:!1,style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},P)):m.createElement(m.Fragment,null,v,m.createElement("div",{className:Un(`${o}-body`,p==null?void 0:p.body,(e=y==null?void 0:y.classNames)===null||e===void 0?void 0:e.body),style:Object.assign(Object.assign(Object.assign({},(n=y==null?void 0:y.styles)===null||n===void 0?void 0:n.body),u),g==null?void 0:g.body)},f),T)},Njt=t=>{const e="100%";return{left:`translateX(-${e})`,right:`translateX(${e})`,top:`translateY(-${e})`,bottom:`translateY(${e})`}[t]},WJe=(t,e)=>({"&-enter, &-appear":Object.assign(Object.assign({},t),{"&-active":e}),"&-leave":Object.assign(Object.assign({},e),{"&-active":t})}),NJe=(t,e)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${e}`}}},WJe({opacity:t},{opacity:1})),Ujt=(t,e)=>[NJe(.7,e),WJe({transform:Njt(t)},{transform:"none"})],jjt=t=>{const{componentCls:e,motionDurationSlow:n}=t;return{[e]:{[`${e}-mask-motion`]:NJe(0,n),[`${e}-panel-motion`]:["left","right","top","bottom"].reduce((o,r)=>Object.assign(Object.assign({},o),{[`&-${r}`]:Ujt(r,n)}),{})}}},Bjt=t=>{const{borderRadiusSM:e,componentCls:n,zIndexPopup:o,colorBgMask:r,colorBgElevated:i,motionDurationSlow:a,motionDurationMid:l,paddingXS:s,padding:c,paddingLG:u,fontSizeLG:d,lineHeightLG:f,lineWidth:p,lineType:g,colorSplit:y,marginXS:w,colorIcon:b,colorIconHover:C,colorBgTextHover:P,colorBgTextActive:v,colorText:T,fontWeightStrong:A,footerPaddingBlock:x,footerPaddingInline:S,calc:R}=t,M=`${n}-content-wrapper`;return{[n]:{position:"fixed",inset:0,zIndex:o,pointerEvents:"none","&-pure":{position:"relative",background:i,display:"flex",flexDirection:"column",[`&${n}-left`]:{boxShadow:t.boxShadowDrawerLeft},[`&${n}-right`]:{boxShadow:t.boxShadowDrawerRight},[`&${n}-top`]:{boxShadow:t.boxShadowDrawerUp},[`&${n}-bottom`]:{boxShadow:t.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${n}-mask`]:{position:"absolute",inset:0,zIndex:o,background:r,pointerEvents:"auto"},[M]:{position:"absolute",zIndex:o,maxWidth:"100vw",transition:`all ${a}`,"&-hidden":{display:"none"}},[`&-left > ${M}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:t.boxShadowDrawerLeft},[`&-right > ${M}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:t.boxShadowDrawerRight},[`&-top > ${M}`]:{top:0,insetInline:0,boxShadow:t.boxShadowDrawerUp},[`&-bottom > ${M}`]:{bottom:0,insetInline:0,boxShadow:t.boxShadowDrawerDown},[`${n}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:i,pointerEvents:"auto"},[`${n}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Nt(c)} ${Nt(u)}`,fontSize:d,lineHeight:f,borderBottom:`${Nt(p)} ${g} ${y}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${n}-extra`]:{flex:"none"},[`${n}-close`]:Object.assign({display:"inline-flex",width:R(d).add(s).equal(),height:R(d).add(s).equal(),borderRadius:e,justifyContent:"center",alignItems:"center",marginInlineEnd:w,color:b,fontWeight:A,fontSize:d,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${l}`,textRendering:"auto","&:hover":{color:C,backgroundColor:P,textDecoration:"none"},"&:active":{backgroundColor:v}},Q6(t)),[`${n}-title`]:{flex:1,margin:0,color:T,fontWeight:t.fontWeightStrong,fontSize:d,lineHeight:f},[`${n}-body`]:{flex:1,minWidth:0,minHeight:0,padding:u,overflow:"auto"},[`${n}-footer`]:{flexShrink:0,padding:`${Nt(x)} ${Nt(S)}`,borderTop:`${Nt(p)} ${g} ${y}`},"&-rtl":{direction:"rtl"}}}},Yjt=t=>({zIndexPopup:t.zIndexPopupBase,footerPaddingBlock:t.paddingXS,footerPaddingInline:t.padding}),UJe=wl("Drawer",t=>{const e=Ki(t,{});return[Bjt(e),jjt(e)]},Yjt);var jJe=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{rootClassName:e,width:n,height:o,size:r="default",mask:i=!0,push:a=Ojt,open:l,afterOpenChange:s,onClose:c,prefixCls:u,getContainer:d,style:f,className:p,visible:g,afterVisibleChange:y,maskStyle:w,drawerStyle:b,contentWrapperStyle:C}=t,P=jJe(t,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle"]),{getPopupContainer:v,getPrefixCls:T,direction:A,drawer:x}=m.useContext(Cr),S=T("drawer",u),[R,M,D]=UJe(S),E=d===void 0&&v?()=>v(document.body):d,W=Un({"no-mask":!i,[`${S}-rtl`]:A==="rtl"},e,M,D),j=m.useMemo(()=>n??(r==="large"?736:378),[n,r]),L=m.useMemo(()=>o??(r==="large"?736:378),[o,r]),k={motionName:j9(S,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},N=Q=>({motionName:j9(S,`panel-motion-${Q}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),F=eGe(),[U,O]=Ww("Drawer",P.zIndex),{classNames:B={},styles:_={}}=P,{classNames:X={},styles:$={}}=x||{};return R(m.createElement(Y9,null,m.createElement(AR,{status:!0,override:!0},m.createElement(zW.Provider,{value:O},m.createElement(Mjt,Object.assign({prefixCls:S,onClose:c,maskMotion:k,motion:N},P,{classNames:{mask:Un(B.mask,X.mask),content:Un(B.content,X.content),wrapper:Un(B.wrapper,X.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},_.mask),w),$.mask),content:Object.assign(Object.assign(Object.assign({},_.content),b),$.content),wrapper:Object.assign(Object.assign(Object.assign({},_.wrapper),C),$.wrapper)},open:l??g,mask:i,push:a,width:j,height:L,style:Object.assign(Object.assign({},x==null?void 0:x.style),f),className:Un(x==null?void 0:x.className,p),rootClassName:W,getContainer:E,afterOpenChange:s??y,panelRef:F,zIndex:U}),m.createElement(LJe,Object.assign({prefixCls:S},P,{onClose:c})))))))},_jt=t=>{const{prefixCls:e,style:n,className:o,placement:r="right"}=t,i=jJe(t,["prefixCls","style","className","placement"]),{getPrefixCls:a}=m.useContext(Cr),l=a("drawer",e),[s,c,u]=UJe(l),d=Un(l,`${l}-pure`,`${l}-${r}`,c,u,o);return s(m.createElement("div",{className:d,style:n},m.createElement(LJe,Object.assign({prefixCls:l},i))))};gue._InternalPanelDoNotUseOrYouWillBeFired=_jt;function zxe(t){return["small","middle","large"].includes(t)}function Dxe(t){return t?typeof t=="number"&&!Number.isNaN(t):!1}const BJe=be.createContext({latestIndex:0}),Vjt=BJe.Provider,Gjt=t=>{let{className:e,index:n,children:o,split:r,style:i}=t;const{latestIndex:a}=m.useContext(BJe);return o==null?null:m.createElement(m.Fragment,null,m.createElement("div",{className:e,style:i},o),n{var n,o;const{getPrefixCls:r,space:i,direction:a}=m.useContext(Cr),{size:l=(i==null?void 0:i.size)||"small",align:s,className:c,rootClassName:u,children:d,direction:f="horizontal",prefixCls:p,split:g,style:y,wrap:w=!1,classNames:b,styles:C}=t,P=Xjt(t,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[v,T]=Array.isArray(l)?l:[l,l],A=zxe(T),x=zxe(v),S=Dxe(T),R=Dxe(v),M=B9(d,{keepEmpty:!0}),D=s===void 0&&f==="horizontal"?"center":s,E=r("space",p),[W,j,L]=PVe(E),k=Un(E,i==null?void 0:i.className,j,`${E}-${f}`,{[`${E}-rtl`]:a==="rtl",[`${E}-align-${D}`]:D,[`${E}-gap-row-${T}`]:A,[`${E}-gap-col-${v}`]:x},c,u,L),N=Un(`${E}-item`,(n=b==null?void 0:b.item)!==null&&n!==void 0?n:(o=i==null?void 0:i.classNames)===null||o===void 0?void 0:o.item);let F=0;const U=M.map((_,X)=>{var $,Q;_!=null&&(F=X);const le=_&&_.key||`${N}-${X}`;return m.createElement(Gjt,{className:N,key:le,index:X,split:g,style:($=C==null?void 0:C.item)!==null&&$!==void 0?$:(Q=i==null?void 0:i.styles)===null||Q===void 0?void 0:Q.item},_)}),O=m.useMemo(()=>({latestIndex:F}),[F]);if(M.length===0)return null;const B={};return w&&(B.flexWrap="wrap"),!x&&R&&(B.columnGap=v),!A&&S&&(B.rowGap=T),W(m.createElement("div",Object.assign({ref:e,className:k,style:Object.assign(Object.assign(Object.assign({},B),i==null?void 0:i.style),y)},P),m.createElement(Vjt,{value:O},U)))}),en=Jjt;en.Compact=QRt;var Kjt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{getPopupContainer:e,getPrefixCls:n,direction:o}=m.useContext(Cr),{prefixCls:r,type:i="default",danger:a,disabled:l,loading:s,onClick:c,htmlType:u,children:d,className:f,menu:p,arrow:g,autoFocus:y,overlay:w,trigger:b,align:C,open:P,onOpenChange:v,placement:T,getPopupContainer:A,href:x,icon:S=m.createElement(_me,null),title:R,buttonsRender:M=te=>te,mouseEnterDelay:D,mouseLeaveDelay:E,overlayClassName:W,overlayStyle:j,destroyPopupOnHide:L,dropdownRender:k}=t,N=Kjt(t,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","dropdownRender"]),F=n("dropdown",r),U=`${F}-button`,O={menu:p,arrow:g,autoFocus:y,align:C,disabled:l,trigger:l?[]:b,onOpenChange:v,getPopupContainer:A||e,mouseEnterDelay:D,mouseLeaveDelay:E,overlayClassName:W,overlayStyle:j,destroyPopupOnHide:L,dropdownRender:k},{compactSize:B,compactItemClassnames:_}=Nw(F,o),X=Un(U,_,f);"overlay"in t&&(O.overlay=w),"open"in t&&(O.open=P),"placement"in t?O.placement=T:O.placement=o==="rtl"?"bottomLeft":"bottomRight";const $=m.createElement(lo,{type:i,danger:a,disabled:l,loading:s,onClick:c,htmlType:u,href:x,title:R},d),Q=m.createElement(lo,{type:i,danger:a,icon:S}),[le,q]=M([$,Q]);return m.createElement(en.Compact,Object.assign({className:X,size:B,block:!0},N),le,m.createElement(eQ,Object.assign({},O),q))};YJe.__ANT_BUTTON=!0;const jw=eQ;jw.Button=YJe;var qjt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},$jt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:qjt}))},$W=m.forwardRef($jt);function Exe(t){var e=t.getBoundingClientRect(),n=document.documentElement;return{left:e.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:e.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}function WY(t,e,n,o){var r=OV.unstable_batchedUpdates?function(a){OV.unstable_batchedUpdates(n,a)}:n;return t!=null&&t.addEventListener&&t.addEventListener(e,r,o),{remove:function(){t!=null&&t.removeEventListener&&t.removeEventListener(e,r,o)}}}const OJe=function(){const t=Object.assign({},arguments.length<=0?void 0:arguments[0]);for(let e=1;e{const r=n[o];r!==void 0&&(t[o]=r)})}return t};var Qjt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},Zjt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Qjt}))},Fxe=m.forwardRef(Zjt),eBt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},tBt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:eBt}))},kxe=m.forwardRef(tBt),nBt={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},oBt=["10","20","50","100"],rBt=function(e){var n=e.pageSizeOptions,o=n===void 0?oBt:n,r=e.locale,i=e.changeSize,a=e.pageSize,l=e.goButton,s=e.quickGo,c=e.rootPrefixCls,u=e.selectComponentClass,d=e.selectPrefixCls,f=e.disabled,p=e.buildOptionText,g=be.useState(""),y=ln(g,2),w=y[0],b=y[1],C=function(){return!w||Number.isNaN(w)?void 0:Number(w)},P=typeof p=="function"?p:function(j){return"".concat(j," ").concat(r.items_per_page)},v=function(L){i==null||i(Number(L))},T=function(L){b(L.target.value)},A=function(L){l||w===""||(b(""),!(L.relatedTarget&&(L.relatedTarget.className.indexOf("".concat(c,"-item-link"))>=0||L.relatedTarget.className.indexOf("".concat(c,"-item"))>=0))&&(s==null||s(C())))},x=function(L){w!==""&&(L.keyCode===Bn.ENTER||L.type==="click")&&(b(""),s==null||s(C()))},S=function(){return o.some(function(L){return L.toString()===a.toString()})?o:o.concat([a.toString()]).sort(function(L,k){var N=Number.isNaN(Number(L))?0:Number(L),F=Number.isNaN(Number(k))?0:Number(k);return N-F})},R="".concat(c,"-options");if(!i&&!s)return null;var M=null,D=null,E=null;if(i&&u){var W=S().map(function(j,L){return be.createElement(u.Option,{key:L,value:j.toString()},P(j))});M=be.createElement(u,{disabled:f,prefixCls:d,showSearch:!1,className:"".concat(R,"-size-changer"),optionLabelProp:"children",popupMatchSelectWidth:!1,value:(a||o[0]).toString(),onChange:v,getPopupContainer:function(L){return L.parentNode},"aria-label":r.page_size,defaultOpen:!1},W)}return s&&(l&&(E=typeof l=="boolean"?be.createElement("button",{type:"button",onClick:x,onKeyUp:x,disabled:f,className:"".concat(R,"-quick-jumper-button")},r.jump_to_confirm):be.createElement("span",{onClick:x,onKeyUp:x},l)),D=be.createElement("div",{className:"".concat(R,"-quick-jumper")},r.jump_to,be.createElement("input",{disabled:f,type:"text",value:w,onChange:T,onKeyUp:x,onBlur:A,"aria-label":r.page}),r.page,E)),be.createElement("li",{className:R},M,D)},Nz=function(e){var n,o=e.rootPrefixCls,r=e.page,i=e.active,a=e.className,l=e.showTitle,s=e.onClick,c=e.onKeyPress,u=e.itemRender,d="".concat(o,"-item"),f=Vn(d,"".concat(d,"-").concat(r),(n={},Vt(n,"".concat(d,"-active"),i),Vt(n,"".concat(d,"-disabled"),!r),n),a),p=function(){s(r)},g=function(b){c(b,s,r)},y=u(r,"page",be.createElement("a",{rel:"nofollow"},r));return y?be.createElement("li",{title:l?String(r):null,className:f,onClick:p,onKeyDown:g,tabIndex:0},y):null},iBt=function(e,n,o){return o};function Lxe(){}function Wxe(t){var e=Number(t);return typeof e=="number"&&!Number.isNaN(e)&&isFinite(e)&&Math.floor(e)===e}function G7(t,e,n){var o=typeof t>"u"?e:t;return Math.floor((n-1)/o)+1}var aBt=function(e){var n,o=e.prefixCls,r=o===void 0?"rc-pagination":o,i=e.selectPrefixCls,a=i===void 0?"rc-select":i,l=e.className,s=e.selectComponentClass,c=e.current,u=e.defaultCurrent,d=u===void 0?1:u,f=e.total,p=f===void 0?0:f,g=e.pageSize,y=e.defaultPageSize,w=y===void 0?10:y,b=e.onChange,C=b===void 0?Lxe:b,P=e.hideOnSinglePage,v=e.showPrevNextJumpers,T=v===void 0?!0:v,A=e.showQuickJumper,x=e.showLessItems,S=e.showTitle,R=S===void 0?!0:S,M=e.onShowSizeChange,D=M===void 0?Lxe:M,E=e.locale,W=E===void 0?nBt:E,j=e.style,L=e.totalBoundaryShowSizeChanger,k=L===void 0?50:L,N=e.disabled,F=e.simple,U=e.showTotal,O=e.showSizeChanger,B=e.pageSizeOptions,_=e.itemRender,X=_===void 0?iBt:_,$=e.jumpPrevIcon,Q=e.jumpNextIcon,le=e.prevIcon,q=e.nextIcon,te=be.useRef(null),re=zs(10,{value:g,defaultValue:w}),ae=ln(re,2),se=ae[0],ne=ae[1],fe=zs(1,{value:c,defaultValue:d,postState:function(Qt){return Math.max(1,Math.min(Qt,G7(void 0,se,p)))}}),ge=ln(fe,2),de=ge[0],Z=ge[1],he=be.useState(de),xe=ln(he,2),He=xe[0],Se=xe[1];m.useEffect(function(){Se(de)},[de]);var ze=Math.max(1,de-(x?3:5)),Ie=Math.min(G7(void 0,se,p),de+(x?3:5));function ye(tn,Qt){var gn=tn||be.createElement("button",{type:"button","aria-label":Qt,className:"".concat(r,"-item-link")});return typeof tn=="function"&&(gn=be.createElement(tn,qt({},e))),gn}function ce(tn){var Qt=tn.target.value,gn=G7(void 0,se,p),an;return Qt===""?an=Qt:Number.isNaN(Number(Qt))?an=He:Qt>=gn?an=gn:an=Number(Qt),an}function pe(tn){return Wxe(tn)&&tn!==de&&Wxe(p)&&p>0}var ve=p>se?A:!1;function Ae(tn){(tn.keyCode===Bn.UP||tn.keyCode===Bn.DOWN)&&tn.preventDefault()}function Te(tn){var Qt=ce(tn);switch(Qt!==He&&Se(Qt),tn.keyCode){case Bn.ENTER:Ee(Qt);break;case Bn.UP:Ee(Qt-1);break;case Bn.DOWN:Ee(Qt+1);break}}function Me(tn){Ee(ce(tn))}function Pe(tn){var Qt=G7(tn,se,p),gn=de>Qt&&Qt!==0?Qt:de;ne(tn),Se(gn),D==null||D(de,tn),Z(gn),C==null||C(gn,tn)}function Ee(tn){if(pe(tn)&&!N){var Qt=G7(void 0,se,p),gn=tn;return tn>Qt?gn=Qt:tn<1&&(gn=1),gn!==He&&Se(gn),Z(gn),C==null||C(gn,se),gn}return de}var Be=de>1,Je=dek;function Ke(){Be&&Ee(de-1)}function Ne(){Je&&Ee(de+1)}function De(){Ee(ze)}function ke(){Ee(Ie)}function Ye(tn,Qt){if(tn.key==="Enter"||tn.charCode===Bn.ENTER||tn.keyCode===Bn.ENTER){for(var gn=arguments.length,an=new Array(gn>2?gn-2:0),mn=2;mnp?p:de*se])),Oe=null,Ze=G7(void 0,se,p);if(P&&p<=se)return null;var St=[],Pt={rootPrefixCls:r,onClick:Ee,onKeyPress:Ye,showTitle:R,itemRender:X,page:-1},Rt=de-1>0?de-1:0,Ut=de+1=gt*2&&de!==3&&(St[0]=be.cloneElement(St[0],{className:Vn("".concat(r,"-item-after-jump-prev"),St[0].props.className)}),St.unshift(ot)),Ze-de>=gt*2&&de!==Ze-2){var Qe=St[St.length-1];St[St.length-1]=be.cloneElement(Qe,{className:Vn("".concat(r,"-item-before-jump-next"),Qe.props.className)}),St.push(Oe)}je!==1&&St.unshift(be.createElement(Nz,ho({},Pt,{key:1,page:1}))),rt!==Ze&&St.push(be.createElement(Nz,ho({},Pt,{key:Ze,page:Ze})))}var Tt=Xe(Rt);if(Tt){var Dt=!Be||!Ze;Tt=be.createElement("li",{title:R?W.prev_page:null,onClick:Ke,tabIndex:Dt?null:0,onKeyDown:it,className:Vn("".concat(r,"-prev"),Vt({},"".concat(r,"-disabled"),Dt)),"aria-disabled":Dt},Tt)}var lt=ut(Ut);if(lt){var zt,Ft;F?(zt=!Je,Ft=Be?0:null):(zt=!Je||!Ze,Ft=zt?null:0),lt=be.createElement("li",{title:R?W.next_page:null,onClick:Ne,tabIndex:Ft,onKeyDown:Ve,className:Vn("".concat(r,"-next"),Vt({},"".concat(r,"-disabled"),zt)),"aria-disabled":zt},lt)}var _t=Vn(r,l,(n={},Vt(n,"".concat(r,"-simple"),F),Vt(n,"".concat(r,"-disabled"),N),n));return be.createElement("ul",ho({className:_t,style:j,ref:te},st),at,Tt,F?kt:St,lt,be.createElement(rBt,{locale:W,rootPrefixCls:r,disabled:N,selectComponentClass:s,selectPrefixCls:a,changeSize:We?Pe:null,pageSize:se,pageSizeOptions:B,quickGo:ve?Ee:null,goButton:At}))};const _Je=t=>m.createElement(_o,Object.assign({},t,{showSearch:!0,size:"small"})),VJe=t=>m.createElement(_o,Object.assign({},t,{showSearch:!0,size:"middle"}));_Je.Option=_o.Option;VJe.Option=_o.Option;const lBt=t=>{const{componentCls:e}=t;return{[`${e}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${e}-item-link`]:{color:t.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${e}-item-link`]:{color:t.colorTextDisabled,cursor:"not-allowed"}}},[`&${e}-disabled`]:{cursor:"not-allowed",[`${e}-item`]:{cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},a:{color:t.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:t.colorBorder,backgroundColor:t.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:t.itemActiveBgDisabled},a:{color:t.itemActiveColorDisabled}}},[`${e}-item-link`]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},[`${e}-simple&`]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},[`${e}-simple-pager`]:{color:t.colorTextDisabled},[`${e}-jump-prev, ${e}-jump-next`]:{[`${e}-item-link-icon`]:{opacity:0},[`${e}-item-ellipsis`]:{opacity:1}}},[`&${e}-simple`]:{[`${e}-prev, ${e}-next`]:{[`&${e}-disabled ${e}-item-link`]:{"&:hover, &:active":{backgroundColor:"transparent"}}}}}},sBt=t=>{const{componentCls:e}=t;return{[`&${e}-mini ${e}-total-text, &${e}-mini ${e}-simple-pager`]:{height:t.itemSizeSM,lineHeight:Nt(t.itemSizeSM)},[`&${e}-mini ${e}-item`]:{minWidth:t.itemSizeSM,height:t.itemSizeSM,margin:0,lineHeight:Nt(t.calc(t.itemSizeSM).sub(2).equal())},[`&${e}-mini:not(${e}-disabled) ${e}-item:not(${e}-item-active)`]:{backgroundColor:"transparent",borderColor:"transparent","&:hover":{backgroundColor:t.colorBgTextHover},"&:active":{backgroundColor:t.colorBgTextActive}},[`&${e}-mini ${e}-prev, &${e}-mini ${e}-next`]:{minWidth:t.itemSizeSM,height:t.itemSizeSM,margin:0,lineHeight:Nt(t.itemSizeSM)},[`&${e}-mini:not(${e}-disabled)`]:{[`${e}-prev, ${e}-next`]:{[`&:hover ${e}-item-link`]:{backgroundColor:t.colorBgTextHover},[`&:active ${e}-item-link`]:{backgroundColor:t.colorBgTextActive},[`&${e}-disabled:hover ${e}-item-link`]:{backgroundColor:"transparent"}}},[` +`,XUt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],die={},gm;function JUt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=t.getAttribute("id")||t.getAttribute("data-reactid")||t.getAttribute("name");if(e&&die[n])return die[n];var o=window.getComputedStyle(t),r=o.getPropertyValue("box-sizing")||o.getPropertyValue("-moz-box-sizing")||o.getPropertyValue("-webkit-box-sizing"),i=parseFloat(o.getPropertyValue("padding-bottom"))+parseFloat(o.getPropertyValue("padding-top")),a=parseFloat(o.getPropertyValue("border-bottom-width"))+parseFloat(o.getPropertyValue("border-top-width")),l=XUt.map(function(c){return"".concat(c,":").concat(o.getPropertyValue(c))}).join(";"),s={sizingStyle:l,paddingSize:i,borderSize:a,boxSizing:r};return e&&n&&(die[n]=s),s}function KUt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;gm||(gm=document.createElement("textarea"),gm.setAttribute("tab-index","-1"),gm.setAttribute("aria-hidden","true"),document.body.appendChild(gm)),t.getAttribute("wrap")?gm.setAttribute("wrap",t.getAttribute("wrap")):gm.removeAttribute("wrap");var r=JUt(t,e),i=r.paddingSize,a=r.borderSize,l=r.boxSizing,s=r.sizingStyle;gm.setAttribute("style","".concat(s,";").concat(GUt)),gm.value=t.value||t.placeholder||"";var c=void 0,u=void 0,d,f=gm.scrollHeight;if(l==="border-box"?f+=a:l==="content-box"&&(f-=i),n!==null||o!==null){gm.value=" ";var p=gm.scrollHeight-i;n!==null&&(c=p*n,l==="border-box"&&(c=c+i+a),f=Math.max(c,f)),o!==null&&(u=p*o,l==="border-box"&&(u=u+i+a),d=f>u?"":"hidden",f=Math.min(u,f))}var g={height:f,overflowY:d,resize:"none"};return c&&(g.minHeight=c),u&&(g.maxHeight=u),g}var qUt=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],fie=0,hie=1,pie=2,$Ut=m.forwardRef(function(t,e){var n=t,o=n.prefixCls;n.onPressEnter;var r=n.defaultValue,i=n.value,a=n.autoSize,l=n.onResize,s=n.className,c=n.style,u=n.disabled,d=n.onChange;n.onInternalAutoSize;var f=ii(n,qUt),p=zs(r,{value:i,postState:function($){return $??""}}),g=ln(p,2),y=g[0],w=g[1],b=function($){w($.target.value),d==null||d($)},C=m.useRef();m.useImperativeHandle(e,function(){return{textArea:C.current}});var P=m.useMemo(function(){return a&&hi(a)==="object"?[a.minRows,a.maxRows]:[]},[a]),v=ln(P,2),T=v[0],A=v[1],x=!!a,S=function(){try{if(document.activeElement===C.current){var $=C.current,Q=$.selectionStart,le=$.selectionEnd,q=$.scrollTop;C.current.setSelectionRange(Q,le),C.current.scrollTop=q}}catch{}},R=m.useState(pie),M=ln(R,2),D=M[0],E=M[1],W=m.useState(),j=ln(W,2),L=j[0],k=j[1],N=function(){E(fie)};Xa(function(){x&&N()},[i,T,A,x]),Xa(function(){if(D===fie)E(hie);else if(D===hie){var X=KUt(C.current,!1,T,A);E(pie),k(X)}else S()},[D]);var F=m.useRef(),U=function(){Fa.cancel(F.current)},O=function($){D===pie&&(l==null||l($),a&&(U(),F.current=Fa(function(){N()})))};m.useEffect(function(){return U},[]);var B=x?L:null,_=qt(qt({},c),B);return(D===fie||D===hie)&&(_.overflowY="hidden",_.overflowX="hidden"),m.createElement(Td,{onResize:O,disabled:!(a||l)},m.createElement("textarea",ho({},f,{ref:C,style:_,className:Vn(o,s,Vt({},"".concat(o,"-disabled"),u)),disabled:u,value:y,onChange:b})))}),QUt=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize"],ZUt=be.forwardRef(function(t,e){var n,o,r=t.defaultValue,i=t.value,a=t.onFocus,l=t.onBlur,s=t.onChange,c=t.allowClear,u=t.maxLength,d=t.onCompositionStart,f=t.onCompositionEnd,p=t.suffix,g=t.prefixCls,y=g===void 0?"rc-textarea":g,w=t.showCount,b=t.count,C=t.className,P=t.style,v=t.disabled,T=t.hidden,A=t.classNames,x=t.styles,S=t.onResize,R=ii(t,QUt),M=zs(r,{value:i,defaultValue:r}),D=ln(M,2),E=D[0],W=D[1],j=E==null?"":String(E),L=be.useState(!1),k=ln(L,2),N=k[0],F=k[1],U=be.useRef(!1),O=be.useState(null),B=ln(O,2),_=B[0],X=B[1],$=m.useRef(null),Q=function(){var Me;return(Me=$.current)===null||Me===void 0?void 0:Me.textArea},le=function(){Q().focus()};m.useImperativeHandle(e,function(){return{resizableTextArea:$.current,focus:le,blur:function(){Q().blur()}}}),m.useEffect(function(){F(function(Te){return!v&&Te})},[v]);var q=be.useState(null),te=ln(q,2),re=te[0],ae=te[1];be.useEffect(function(){if(re){var Te;(Te=Q()).setSelectionRange.apply(Te,Lo(re))}},[re]);var se=SJe(b,w),ne=(n=se.max)!==null&&n!==void 0?n:u,fe=Number(ne)>0,ge=se.strategy(j),de=!!ne&&ge>ne,Z=function(Me,Pe){var Ee=Pe;!U.current&&se.exceedFormatter&&se.max&&se.strategy(Pe)>se.max&&(Ee=se.exceedFormatter(Pe,{max:se.max}),Pe!==Ee&&ae([Q().selectionStart||0,Q().selectionEnd||0])),W(Ee),GG(Me.currentTarget,Me,s,Ee)},he=function(Me){U.current=!0,d==null||d(Me)},xe=function(Me){U.current=!1,Z(Me,Me.currentTarget.value),f==null||f(Me)},He=function(Me){Z(Me,Me.target.value)},Se=function(Me){var Pe=R.onPressEnter,Ee=R.onKeyDown;Me.key==="Enter"&&Pe&&Pe(Me),Ee==null||Ee(Me)},ze=function(Me){F(!0),a==null||a(Me)},Ie=function(Me){F(!1),l==null||l(Me)},ye=function(Me){W(""),le(),GG(Q(),Me,s)},ce=p,pe;se.show&&(se.showFormatter?pe=se.showFormatter({value:j,count:ge,maxLength:ne}):pe="".concat(ge).concat(fe?" / ".concat(ne):""),ce=be.createElement(be.Fragment,null,ce,be.createElement("span",{className:Vn("".concat(y,"-data-count"),A==null?void 0:A.count),style:x==null?void 0:x.count},pe)));var ve=function(Me){var Pe;S==null||S(Me),(Pe=Q())!==null&&Pe!==void 0&&Pe.style.height&&X(!0)},Ae=!R.autoSize&&!w&&!c;return be.createElement(cye,{value:j,allowClear:c,handleReset:ye,suffix:ce,prefixCls:y,classNames:qt(qt({},A),{},{affixWrapper:Vn(A==null?void 0:A.affixWrapper,(o={},Vt(o,"".concat(y,"-show-count"),w),Vt(o,"".concat(y,"-textarea-allow-clear"),c),o))}),disabled:v,focused:N,className:Vn(C,de&&"".concat(y,"-out-of-range")),style:qt(qt({},P),_&&!Ae?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof pe=="string"?pe:void 0}},hidden:T},be.createElement($Ut,ho({},R,{maxLength:u,onKeyDown:Se,onChange:He,onFocus:ze,onBlur:Ie,onCompositionStart:he,onCompositionEnd:xe,className:Vn(A==null?void 0:A.textarea),style:qt(qt({},x==null?void 0:x.textarea),{},{resize:P==null?void 0:P.resize}),disabled:v,prefixCls:y,onResize:ve,ref:$})))}),ejt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n,o;const{prefixCls:r,bordered:i=!0,size:a,disabled:l,status:s,allowClear:c,classNames:u,rootClassName:d,className:f,style:p,styles:g,variant:y}=t,w=ejt(t,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","style","styles","variant"]),{getPrefixCls:b,direction:C,textArea:P}=m.useContext(Cr),v=Ed(a),T=m.useContext(n1),A=l??T,{status:x,hasFeedback:S,feedbackIcon:R}=m.useContext(r1),M=Lb(x,s),D=m.useRef(null);m.useImperativeHandle(e,()=>{var O;return{resizableTextArea:(O=D.current)===null||O===void 0?void 0:O.resizableTextArea,focus:B=>{var _,X;RUt((X=(_=D.current)===null||_===void 0?void 0:_.resizableTextArea)===null||X===void 0?void 0:X.textArea,B)},blur:()=>{var B;return(B=D.current)===null||B===void 0?void 0:B.blur()}}});const E=b("input",r),W=O0(E),[j,L,k]=rye(E,W),[N,F]=BH(y,i),U=CJe(c??(P==null?void 0:P.allowClear));return j(m.createElement(ZUt,Object.assign({autoComplete:P==null?void 0:P.autoComplete},w,{style:Object.assign(Object.assign({},P==null?void 0:P.style),p),styles:Object.assign(Object.assign({},P==null?void 0:P.styles),g),disabled:A,allowClear:U,className:Un(k,W,f,d,P==null?void 0:P.className),classNames:Object.assign(Object.assign(Object.assign({},u),P==null?void 0:P.classNames),{textarea:Un({[`${E}-sm`]:v==="small",[`${E}-lg`]:v==="large"},L,u==null?void 0:u.textarea,(n=P==null?void 0:P.classNames)===null||n===void 0?void 0:n.textarea),variant:Un({[`${E}-${N}`]:F},sw(E,M)),affixWrapper:Un(`${E}-textarea-affix-wrapper`,{[`${E}-affix-wrapper-rtl`]:C==="rtl",[`${E}-affix-wrapper-sm`]:v==="small",[`${E}-affix-wrapper-lg`]:v==="large",[`${E}-textarea-show-count`]:t.showCount||((o=t.count)===null||o===void 0?void 0:o.show)},L)}),prefixCls:E,suffix:S&&m.createElement("span",{className:`${E}-textarea-suffix`},R),ref:D})))}),as=cQ;as.Group=TUt;as.Search=VUt;as.TextArea=HJe;as.Password=OUt;as.OTP=EUt;var tjt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"},njt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:tjt}))},MJe=m.forwardRef(njt),ojt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},rjt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:ojt}))},IJe=m.forwardRef(rjt),ijt={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z"}}]},name:"swap-right",theme:"outlined"},ajt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:ijt}))},ljt=m.forwardRef(ajt);function sjt(t,e,n){return n!==void 0?n:e==="year"&&t.lang.yearPlaceholder?t.lang.yearPlaceholder:e==="quarter"&&t.lang.quarterPlaceholder?t.lang.quarterPlaceholder:e==="month"&&t.lang.monthPlaceholder?t.lang.monthPlaceholder:e==="week"&&t.lang.weekPlaceholder?t.lang.weekPlaceholder:e==="time"&&t.timePickerLocale.placeholder?t.timePickerLocale.placeholder:t.lang.placeholder}function cjt(t,e,n){return n!==void 0?n:e==="year"&&t.lang.yearPlaceholder?t.lang.rangeYearPlaceholder:e==="quarter"&&t.lang.quarterPlaceholder?t.lang.rangeQuarterPlaceholder:e==="month"&&t.lang.monthPlaceholder?t.lang.rangeMonthPlaceholder:e==="week"&&t.lang.weekPlaceholder?t.lang.rangeWeekPlaceholder:e==="time"&&t.timePickerLocale.placeholder?t.timePickerLocale.rangePlaceholder:t.lang.rangePlaceholder}function uye(t,e){const n={adjustX:1,adjustY:1};switch(e){case"bottomLeft":return{points:["tl","bl"],offset:[0,4],overflow:n};case"bottomRight":return{points:["tr","br"],offset:[0,4],overflow:n};case"topLeft":return{points:["bl","tl"],offset:[0,-4],overflow:n};case"topRight":return{points:["br","tr"],offset:[0,-4],overflow:n};default:return{points:t==="rtl"?["tr","br"]:["tl","bl"],offset:[0,4],overflow:n}}}function zJe(t,e){const{allowClear:n=!0}=t,{clearIcon:o,removeIcon:r}=WGe(Object.assign(Object.assign({},t),{prefixCls:e,componentName:"DatePicker"}));return[m.useMemo(()=>n===!1?!1:Object.assign({clearIcon:o},n===!0?{}:n),[n,o]),r]}function ujt(t){return m.createElement(lo,Object.assign({size:"small",type:"primary"},t))}function DJe(t){return m.useMemo(()=>Object.assign({button:ujt},t),[t])}var djt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var r;const{prefixCls:i,getPopupContainer:a,components:l,className:s,style:c,placement:u,size:d,disabled:f,bordered:p=!0,placeholder:g,popupClassName:y,dropdownClassName:w,status:b,rootClassName:C,variant:P}=n,v=djt(n,["prefixCls","getPopupContainer","components","className","style","placement","size","disabled","bordered","placeholder","popupClassName","dropdownClassName","status","rootClassName","variant"]),T=m.useRef(null),{getPrefixCls:A,direction:x,getPopupContainer:S,rangePicker:R}=m.useContext(Cr),M=A("picker",i),{compactSize:D,compactItemClassnames:E}=Nw(M,x),{picker:W}=n,j=A(),[L,k]=BH(P,p),N=O0(M),[F,U,O]=lJe(M,N),[B]=zJe(n,M),_=DJe(l),X=Ed(ge=>{var de;return(de=d??D)!==null&&de!==void 0?de:ge}),$=m.useContext(n1),Q=f??$,le=m.useContext(r1),{hasFeedback:q,status:te,feedbackIcon:re}=le,ae=m.createElement(m.Fragment,null,W==="time"?m.createElement(IJe,null):m.createElement(MJe,null),q&&re);m.useImperativeHandle(o,()=>T.current);const[se]=kw("Calendar",RG),ne=Object.assign(Object.assign({},se),n.locale),[fe]=Ww("DatePicker",(r=n.popupStyle)===null||r===void 0?void 0:r.zIndex);return F(m.createElement(Y9,null,m.createElement(FLt,Object.assign({separator:m.createElement("span",{"aria-label":"to",className:`${M}-separator`},m.createElement(ljt,null)),disabled:Q,ref:T,popupAlign:uye(x,u),placeholder:cjt(ne,W,g),suffixIcon:ae,prevIcon:m.createElement("span",{className:`${M}-prev-icon`}),nextIcon:m.createElement("span",{className:`${M}-next-icon`}),superPrevIcon:m.createElement("span",{className:`${M}-super-prev-icon`}),superNextIcon:m.createElement("span",{className:`${M}-super-next-icon`}),transitionName:`${j}-slide-up`},v,{className:Un({[`${M}-${X}`]:X,[`${M}-${L}`]:k},sw(M,Lb(te,b),q),U,E,s,R==null?void 0:R.className,O,N,C),style:Object.assign(Object.assign({},R==null?void 0:R.style),c),locale:ne.lang,prefixCls:M,getPopupContainer:a||S,generateConfig:t,components:_,direction:x,classNames:{popup:Un(U,y||w,O,N,C)},styles:{popup:Object.assign(Object.assign({},n.popupStyle),{zIndex:fe})},allowClear:B}))))})}var hjt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var g;const{prefixCls:y,getPopupContainer:w,components:b,style:C,className:P,rootClassName:v,size:T,bordered:A,placement:x,placeholder:S,popupClassName:R,dropdownClassName:M,disabled:D,status:E,variant:W,onCalendarChange:j}=f,L=hjt(f,["prefixCls","getPopupContainer","components","style","className","rootClassName","size","bordered","placement","placeholder","popupClassName","dropdownClassName","disabled","status","variant","onCalendarChange"]),{getPrefixCls:k,direction:N,getPopupContainer:F,[u]:U}=m.useContext(Cr),O=k("picker",y),{compactSize:B,compactItemClassnames:_}=Nw(O,N),X=m.useRef(null),[$,Q]=BH(W,A),le=O0(O),[q,te,re]=lJe(O,le);m.useImperativeHandle(p,()=>X.current);const ae={showToday:!0},se=s||f.picker,ne=k(),{onSelect:fe,multiple:ge}=L,de=fe&&s==="time"&&!ge,Z=(Ee,Be,Je)=>{j==null||j(Ee,Be,Je),de&&fe(Ee)},[he,xe]=zJe(f,O),He=DJe(b),Se=Ed(Ee=>{var Be;return(Be=T??B)!==null&&Be!==void 0?Be:Ee}),ze=m.useContext(n1),Ie=D??ze,ye=m.useContext(r1),{hasFeedback:ce,status:pe,feedbackIcon:ve}=ye,Ae=m.createElement(m.Fragment,null,se==="time"?m.createElement(IJe,null):m.createElement(MJe,null),ce&&ve),[Te]=kw("DatePicker",RG),Me=Object.assign(Object.assign({},Te),f.locale),[Pe]=Ww("DatePicker",(g=f.popupStyle)===null||g===void 0?void 0:g.zIndex);return q(m.createElement(Y9,null,m.createElement(jLt,Object.assign({ref:X,placeholder:sjt(Me,se,S),suffixIcon:Ae,dropdownAlign:uye(N,x),prevIcon:m.createElement("span",{className:`${O}-prev-icon`}),nextIcon:m.createElement("span",{className:`${O}-next-icon`}),superPrevIcon:m.createElement("span",{className:`${O}-super-prev-icon`}),superNextIcon:m.createElement("span",{className:`${O}-super-next-icon`}),transitionName:`${ne}-slide-up`,picker:s,onCalendarChange:Z},ae,L,{locale:Me.lang,className:Un({[`${O}-${Se}`]:Se,[`${O}-${$}`]:Q},sw(O,Lb(pe,E),ce),te,_,U==null?void 0:U.className,P,re,le,v),style:Object.assign(Object.assign({},U==null?void 0:U.style),C),prefixCls:O,getPopupContainer:w||F,generateConfig:t,components:He,direction:N,disabled:Ie,classNames:{popup:Un(te,re,le,v,R||M)},styles:{popup:Object.assign(Object.assign({},f.popupStyle),{zIndex:Pe})},allowClear:he,removeIcon:xe}))))})}const n=e(),o=e("week","WeekPicker"),r=e("month","MonthPicker"),i=e("year","YearPicker"),a=e("quarter","QuarterPicker"),l=e("time","TimePicker");return{DatePicker:n,WeekPicker:o,MonthPicker:r,YearPicker:i,TimePicker:l,QuarterPicker:a}}function EJe(t){const{DatePicker:e,WeekPicker:n,MonthPicker:o,YearPicker:r,TimePicker:i,QuarterPicker:a}=pjt(t),l=fjt(t),s=e;return s.WeekPicker=n,s.MonthPicker=o,s.YearPicker=r,s.RangePicker=l,s.TimePicker=i,s.QuarterPicker=a,s}const Ub=EJe(_kt);function FJe(t){const e=uye(t.direction,t.placement);return e.overflow.adjustY=!1,e.overflow.adjustX=!1,Object.assign(Object.assign({},t),{dropdownAlign:e})}const gjt=YW(Ub,"picker",null,FJe);Ub._InternalPanelDoNotUseOrYouWillBeFired=gjt;const mjt=YW(Ub.RangePicker,"picker",null,FJe);Ub._InternalRangePanelDoNotUseOrYouWillBeFired=mjt;Ub.generatePicker=EJe;function ck(t){"@babel/helpers - typeof";return ck=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},ck(t)}function yjt(t,e){if(ck(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(ck(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ajt(t){var e=yjt(t,"string");return ck(e)=="symbol"?e:e+""}function hue(t,e,n){return e=Ajt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rxe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function i2(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)continue;n[o]=t[o]}return n}function Tjt(t,e){if(t==null)return{};var n=Sjt(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var Pjt=["prefixCls","className","containerRef"],Cjt=function(e){var n=e.prefixCls,o=e.className,r=e.containerRef,i=Tjt(e,Pjt),a=m.useContext(kJe),l=a.panel,s=Fw(l,r);return m.createElement("div",jv({className:Vn("".concat(n,"-content"),o),role:"dialog",ref:s},Sf(e,{aria:!0}),{"aria-modal":"true"},i))};function Ixe(t){return typeof t=="string"&&String(Number(t))===t?(j0(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(t)):t}var zxe={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function Rjt(t,e){var n,o,r,i=t.prefixCls,a=t.open,l=t.placement,s=t.inline,c=t.push,u=t.forceRender,d=t.autoFocus,f=t.keyboard,p=t.classNames,g=t.rootClassName,y=t.rootStyle,w=t.zIndex,b=t.className,C=t.id,P=t.style,v=t.motion,T=t.width,A=t.height,x=t.children,S=t.mask,R=t.maskClosable,M=t.maskMotion,D=t.maskClassName,E=t.maskStyle,W=t.afterOpenChange,j=t.onClose,L=t.onMouseEnter,k=t.onMouseOver,N=t.onMouseLeave,F=t.onClick,U=t.onKeyDown,O=t.onKeyUp,B=t.styles,_=m.useRef(),X=m.useRef(),$=m.useRef();m.useImperativeHandle(e,function(){return _.current});var Q=function(ze){var Ie=ze.keyCode,ye=ze.shiftKey;switch(Ie){case Bn.TAB:{if(Ie===Bn.TAB){if(!ye&&document.activeElement===$.current){var ce;(ce=X.current)===null||ce===void 0||ce.focus({preventScroll:!0})}else if(ye&&document.activeElement===X.current){var pe;(pe=$.current)===null||pe===void 0||pe.focus({preventScroll:!0})}}break}case Bn.ESC:{j&&f&&(ze.stopPropagation(),j(ze));break}}};m.useEffect(function(){if(a&&d){var Se;(Se=_.current)===null||Se===void 0||Se.focus({preventScroll:!0})}},[a]);var le=m.useState(!1),q=pue(le,2),te=q[0],re=q[1],ae=m.useContext(Mxe),se;typeof c=="boolean"?se=c?{}:{distance:0}:se=c||{};var ne=(n=(o=(r=se)===null||r===void 0?void 0:r.distance)!==null&&o!==void 0?o:ae==null?void 0:ae.pushDistance)!==null&&n!==void 0?n:180,fe=m.useMemo(function(){return{pushDistance:ne,push:function(){re(!0)},pull:function(){re(!1)}}},[ne]);m.useEffect(function(){if(a){var Se;ae==null||(Se=ae.push)===null||Se===void 0||Se.call(ae)}else{var ze;ae==null||(ze=ae.pull)===null||ze===void 0||ze.call(ae)}},[a]),m.useEffect(function(){return function(){var Se;ae==null||(Se=ae.pull)===null||Se===void 0||Se.call(ae)}},[]);var ge=S&&m.createElement(o1,jv({key:"mask"},M,{visible:a}),function(Se,ze){var Ie=Se.className,ye=Se.style;return m.createElement("div",{className:Vn("".concat(i,"-mask"),Ie,p==null?void 0:p.mask,D),style:i2(i2(i2({},ye),E),B==null?void 0:B.mask),onClick:R&&a?j:void 0,ref:ze})}),de=typeof v=="function"?v(l):v,Z={};if(te&&ne)switch(l){case"top":Z.transform="translateY(".concat(ne,"px)");break;case"bottom":Z.transform="translateY(".concat(-ne,"px)");break;case"left":Z.transform="translateX(".concat(ne,"px)");break;default:Z.transform="translateX(".concat(-ne,"px)");break}l==="left"||l==="right"?Z.width=Ixe(T):Z.height=Ixe(A);var he={onMouseEnter:L,onMouseOver:k,onMouseLeave:N,onClick:F,onKeyDown:U,onKeyUp:O},xe=m.createElement(o1,jv({key:"panel"},de,{visible:a,forceRender:u,onVisibleChanged:function(ze){W==null||W(ze)},removeOnLeave:!1,leavedClassName:"".concat(i,"-content-wrapper-hidden")}),function(Se,ze){var Ie=Se.className,ye=Se.style;return m.createElement("div",jv({className:Vn("".concat(i,"-content-wrapper"),p==null?void 0:p.wrapper,Ie),style:i2(i2(i2({},Z),ye),B==null?void 0:B.wrapper)},Sf(t,{data:!0})),m.createElement(Cjt,jv({id:C,containerRef:ze,prefixCls:i,className:Vn(b,p==null?void 0:p.content),style:i2(i2({},P),B==null?void 0:B.content)},Sf(t,{aria:!0}),he),x))}),He=i2({},y);return w&&(He.zIndex=w),m.createElement(Mxe.Provider,{value:fe},m.createElement("div",{className:Vn(i,"".concat(i,"-").concat(l),g,hue(hue({},"".concat(i,"-open"),a),"".concat(i,"-inline"),s)),style:He,tabIndex:-1,ref:_,onKeyDown:Q},ge,m.createElement("div",{tabIndex:0,ref:X,style:zxe,"aria-hidden":"true","data-sentinel":"start"}),xe,m.createElement("div",{tabIndex:0,ref:$,style:zxe,"aria-hidden":"true","data-sentinel":"end"})))}var Hjt=m.forwardRef(Rjt),Mjt=function(e){var n=e.open,o=n===void 0?!1:n,r=e.prefixCls,i=r===void 0?"rc-drawer":r,a=e.placement,l=a===void 0?"right":a,s=e.autoFocus,c=s===void 0?!0:s,u=e.keyboard,d=u===void 0?!0:u,f=e.width,p=f===void 0?378:f,g=e.mask,y=g===void 0?!0:g,w=e.maskClosable,b=w===void 0?!0:w,C=e.getContainer,P=e.forceRender,v=e.afterOpenChange,T=e.destroyOnClose,A=e.onMouseEnter,x=e.onMouseOver,S=e.onMouseLeave,R=e.onClick,M=e.onKeyDown,D=e.onKeyUp,E=e.panelRef,W=m.useState(!1),j=pue(W,2),L=j[0],k=j[1],N=m.useState(!1),F=pue(N,2),U=F[0],O=F[1];Xa(function(){O(!0)},[]);var B=U?o:!1,_=m.useRef(),X=m.useRef();Xa(function(){B&&(X.current=document.activeElement)},[B]);var $=function(re){var ae;if(k(re),v==null||v(re),!re&&X.current&&!((ae=_.current)!==null&&ae!==void 0&&ae.contains(X.current))){var se;(se=X.current)===null||se===void 0||se.focus({preventScroll:!0})}},Q=m.useMemo(function(){return{panel:E}},[E]);if(!P&&!L&&!B&&T)return null;var le={onMouseEnter:A,onMouseOver:x,onMouseLeave:S,onClick:R,onKeyDown:M,onKeyUp:D},q=i2(i2({},e),{},{open:B,prefixCls:i,placement:l,autoFocus:c,keyboard:d,width:p,mask:y,maskClosable:b,inline:C===!1,afterOpenChange:$,ref:_},le);return m.createElement(kJe.Provider,{value:Q},m.createElement(W$,{open:B||P||L,autoDestroy:!1,getContainer:C,autoLock:y&&(B||L)},m.createElement(Hjt,q)))};const Ijt=new xa("antSpinMove",{to:{opacity:1}}),zjt=new xa("antRotate",{to:{transform:"rotate(405deg)"}}),Djt=t=>{const{componentCls:e,calc:n}=t;return{[`${e}`]:Object.assign(Object.assign({},ja(t)),{position:"absolute",display:"none",color:t.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${t.motionDurationSlow} ${t.motionEaseInOutCirc}`,"&-spinning":{position:"static",display:"inline-block",opacity:1},[`${e}-text`]:{fontSize:t.fontSize,paddingTop:n(n(t.dotSize).sub(t.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:t.colorBgMask,zIndex:t.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${t.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[`${e}-dot ${e}-dot-item`]:{backgroundColor:t.colorWhite},[`${e}-text`]:{color:t.colorTextLightSolid}},"&-nested-loading":{position:"relative",[`> div > ${e}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:t.contentHeight,[`${e}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(t.dotSize).mul(-1).div(2).equal()},[`${e}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${t.colorBgContainer}`},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${e}-dot`]:{margin:n(t.dotSizeSM).mul(-1).div(2).equal()},[`${e}-text`]:{paddingTop:n(n(t.dotSizeSM).sub(t.fontSize)).div(2).add(2).equal()},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${e}-dot`]:{margin:n(t.dotSizeLG).mul(-1).div(2).equal()},[`${e}-text`]:{paddingTop:n(n(t.dotSizeLG).sub(t.fontSize)).div(2).add(2).equal()},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${e}-container`]:{position:"relative",transition:`opacity ${t.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:t.colorBgContainer,opacity:0,transition:`all ${t.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${e}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:t.spinDotDefault},[`${e}-dot`]:{position:"relative",display:"inline-block",fontSize:t.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(t.dotSize).sub(n(t.marginXXS).div(2)).div(2).equal(),height:n(t.dotSize).sub(n(t.marginXXS).div(2)).div(2).equal(),backgroundColor:t.colorPrimary,borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:Ijt,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:zjt,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&-sm ${e}-dot`]:{fontSize:t.dotSizeSM,i:{width:n(n(t.dotSizeSM).sub(n(t.marginXXS).div(2))).div(2).equal(),height:n(n(t.dotSizeSM).sub(n(t.marginXXS).div(2))).div(2).equal()}},[`&-lg ${e}-dot`]:{fontSize:t.dotSizeLG,i:{width:n(n(t.dotSizeLG).sub(t.marginXXS)).div(2).equal(),height:n(n(t.dotSizeLG).sub(t.marginXXS)).div(2).equal()}},[`&${e}-show-text ${e}-text`]:{display:"block"}})}},Ejt=t=>{const{controlHeightLG:e,controlHeight:n}=t;return{contentHeight:400,dotSize:e/2,dotSizeSM:e*.35,dotSizeLG:n}},Fjt=wl("Spin",t=>{const e=Ki(t,{spinDotDefault:t.colorTextDescription});return[Djt(e)]},Ejt);var kjt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:e,spinning:n=!0,delay:o=0,className:r,rootClassName:i,size:a="default",tip:l,wrapperClassName:s,style:c,children:u,fullscreen:d=!1}=t,f=kjt(t,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen"]),{getPrefixCls:p}=m.useContext(Cr),g=p("spin",e),[y,w,b]=Fjt(g),[C,P]=m.useState(()=>n&&!Wjt(n,o));m.useEffect(()=>{if(n){const E=yNt(o,()=>{P(!0)});return E(),()=>{var W;(W=E==null?void 0:E.cancel)===null||W===void 0||W.call(E)}}P(!1)},[o,n]);const v=m.useMemo(()=>typeof u<"u"&&!d,[u,d]),{direction:T,spin:A}=m.useContext(Cr),x=Un(g,A==null?void 0:A.className,{[`${g}-sm`]:a==="small",[`${g}-lg`]:a==="large",[`${g}-spinning`]:C,[`${g}-show-text`]:!!l,[`${g}-fullscreen`]:d,[`${g}-fullscreen-show`]:d&&C,[`${g}-rtl`]:T==="rtl"},r,i,w,b),S=Un(`${g}-container`,{[`${g}-blur`]:C}),R=up(f,["indicator"]),M=Object.assign(Object.assign({},A==null?void 0:A.style),c),D=m.createElement("div",Object.assign({},R,{style:M,className:x,"aria-live":"polite","aria-busy":C}),Ljt(g,t),l&&(v||d)?m.createElement("div",{className:`${g}-text`},l):null);return y(v?m.createElement("div",Object.assign({},R,{className:Un(`${g}-nested-loading`,s,w,b)}),C&&m.createElement("div",{key:"loading"},D),m.createElement("div",{className:S,key:"container"},u)):D)};$W.setDefaultIndicator=t=>{$_=t};const LJe=t=>{var e,n;const{prefixCls:o,title:r,footer:i,extra:a,loading:l,onClose:s,headerStyle:c,bodyStyle:u,footerStyle:d,children:f,classNames:p,styles:g}=t,{drawer:y}=m.useContext(Cr),w=m.useCallback(A=>m.createElement("button",{type:"button",onClick:s,"aria-label":"Close",className:`${o}-close`},A),[s]),[b,C]=Pme(mR(t),mR(y),{closable:!0,closeIconRender:w});let P;typeof l=="boolean"?P={spinning:l}:typeof l=="object"&&(P=Object.assign({spinning:!0},l));const v=m.useMemo(()=>{var A,x;return!r&&!b?null:m.createElement("div",{style:Object.assign(Object.assign(Object.assign({},(A=y==null?void 0:y.styles)===null||A===void 0?void 0:A.header),c),g==null?void 0:g.header),className:Un(`${o}-header`,{[`${o}-header-close-only`]:b&&!r&&!a},(x=y==null?void 0:y.classNames)===null||x===void 0?void 0:x.header,p==null?void 0:p.header)},m.createElement("div",{className:`${o}-header-title`},C,r&&m.createElement("div",{className:`${o}-title`},r)),a&&m.createElement("div",{className:`${o}-extra`},a))},[b,C,a,c,o,r]),T=m.useMemo(()=>{var A,x;if(!i)return null;const S=`${o}-footer`;return m.createElement("div",{className:Un(S,(A=y==null?void 0:y.classNames)===null||A===void 0?void 0:A.footer,p==null?void 0:p.footer),style:Object.assign(Object.assign(Object.assign({},(x=y==null?void 0:y.styles)===null||x===void 0?void 0:x.footer),d),g==null?void 0:g.footer)},i)},[i,d,o]);return P!=null&&P.spinning?m.createElement($W,Object.assign({spinning:!1,style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},P)):m.createElement(m.Fragment,null,v,m.createElement("div",{className:Un(`${o}-body`,p==null?void 0:p.body,(e=y==null?void 0:y.classNames)===null||e===void 0?void 0:e.body),style:Object.assign(Object.assign(Object.assign({},(n=y==null?void 0:y.styles)===null||n===void 0?void 0:n.body),u),g==null?void 0:g.body)},f),T)},Njt=t=>{const e="100%";return{left:`translateX(-${e})`,right:`translateX(${e})`,top:`translateY(-${e})`,bottom:`translateY(${e})`}[t]},WJe=(t,e)=>({"&-enter, &-appear":Object.assign(Object.assign({},t),{"&-active":e}),"&-leave":Object.assign(Object.assign({},e),{"&-active":t})}),NJe=(t,e)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${e}`}}},WJe({opacity:t},{opacity:1})),Ujt=(t,e)=>[NJe(.7,e),WJe({transform:Njt(t)},{transform:"none"})],jjt=t=>{const{componentCls:e,motionDurationSlow:n}=t;return{[e]:{[`${e}-mask-motion`]:NJe(0,n),[`${e}-panel-motion`]:["left","right","top","bottom"].reduce((o,r)=>Object.assign(Object.assign({},o),{[`&-${r}`]:Ujt(r,n)}),{})}}},Bjt=t=>{const{borderRadiusSM:e,componentCls:n,zIndexPopup:o,colorBgMask:r,colorBgElevated:i,motionDurationSlow:a,motionDurationMid:l,paddingXS:s,padding:c,paddingLG:u,fontSizeLG:d,lineHeightLG:f,lineWidth:p,lineType:g,colorSplit:y,marginXS:w,colorIcon:b,colorIconHover:C,colorBgTextHover:P,colorBgTextActive:v,colorText:T,fontWeightStrong:A,footerPaddingBlock:x,footerPaddingInline:S,calc:R}=t,M=`${n}-content-wrapper`;return{[n]:{position:"fixed",inset:0,zIndex:o,pointerEvents:"none","&-pure":{position:"relative",background:i,display:"flex",flexDirection:"column",[`&${n}-left`]:{boxShadow:t.boxShadowDrawerLeft},[`&${n}-right`]:{boxShadow:t.boxShadowDrawerRight},[`&${n}-top`]:{boxShadow:t.boxShadowDrawerUp},[`&${n}-bottom`]:{boxShadow:t.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${n}-mask`]:{position:"absolute",inset:0,zIndex:o,background:r,pointerEvents:"auto"},[M]:{position:"absolute",zIndex:o,maxWidth:"100vw",transition:`all ${a}`,"&-hidden":{display:"none"}},[`&-left > ${M}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:t.boxShadowDrawerLeft},[`&-right > ${M}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:t.boxShadowDrawerRight},[`&-top > ${M}`]:{top:0,insetInline:0,boxShadow:t.boxShadowDrawerUp},[`&-bottom > ${M}`]:{bottom:0,insetInline:0,boxShadow:t.boxShadowDrawerDown},[`${n}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:i,pointerEvents:"auto"},[`${n}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Nt(c)} ${Nt(u)}`,fontSize:d,lineHeight:f,borderBottom:`${Nt(p)} ${g} ${y}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${n}-extra`]:{flex:"none"},[`${n}-close`]:Object.assign({display:"inline-flex",width:R(d).add(s).equal(),height:R(d).add(s).equal(),borderRadius:e,justifyContent:"center",alignItems:"center",marginInlineEnd:w,color:b,fontWeight:A,fontSize:d,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${l}`,textRendering:"auto","&:hover":{color:C,backgroundColor:P,textDecoration:"none"},"&:active":{backgroundColor:v}},Q6(t)),[`${n}-title`]:{flex:1,margin:0,color:T,fontWeight:t.fontWeightStrong,fontSize:d,lineHeight:f},[`${n}-body`]:{flex:1,minWidth:0,minHeight:0,padding:u,overflow:"auto"},[`${n}-footer`]:{flexShrink:0,padding:`${Nt(x)} ${Nt(S)}`,borderTop:`${Nt(p)} ${g} ${y}`},"&-rtl":{direction:"rtl"}}}},Yjt=t=>({zIndexPopup:t.zIndexPopupBase,footerPaddingBlock:t.paddingXS,footerPaddingInline:t.padding}),UJe=wl("Drawer",t=>{const e=Ki(t,{});return[Bjt(e),jjt(e)]},Yjt);var jJe=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{rootClassName:e,width:n,height:o,size:r="default",mask:i=!0,push:a=Ojt,open:l,afterOpenChange:s,onClose:c,prefixCls:u,getContainer:d,style:f,className:p,visible:g,afterVisibleChange:y,maskStyle:w,drawerStyle:b,contentWrapperStyle:C}=t,P=jJe(t,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle"]),{getPopupContainer:v,getPrefixCls:T,direction:A,drawer:x}=m.useContext(Cr),S=T("drawer",u),[R,M,D]=UJe(S),E=d===void 0&&v?()=>v(document.body):d,W=Un({"no-mask":!i,[`${S}-rtl`]:A==="rtl"},e,M,D),j=m.useMemo(()=>n??(r==="large"?736:378),[n,r]),L=m.useMemo(()=>o??(r==="large"?736:378),[o,r]),k={motionName:j9(S,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},N=Q=>({motionName:j9(S,`panel-motion-${Q}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),F=eGe(),[U,O]=Ww("Drawer",P.zIndex),{classNames:B={},styles:_={}}=P,{classNames:X={},styles:$={}}=x||{};return R(m.createElement(Y9,null,m.createElement(AR,{status:!0,override:!0},m.createElement(DW.Provider,{value:O},m.createElement(Mjt,Object.assign({prefixCls:S,onClose:c,maskMotion:k,motion:N},P,{classNames:{mask:Un(B.mask,X.mask),content:Un(B.content,X.content),wrapper:Un(B.wrapper,X.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},_.mask),w),$.mask),content:Object.assign(Object.assign(Object.assign({},_.content),b),$.content),wrapper:Object.assign(Object.assign(Object.assign({},_.wrapper),C),$.wrapper)},open:l??g,mask:i,push:a,width:j,height:L,style:Object.assign(Object.assign({},x==null?void 0:x.style),f),className:Un(x==null?void 0:x.className,p),rootClassName:W,getContainer:E,afterOpenChange:s??y,panelRef:F,zIndex:U}),m.createElement(LJe,Object.assign({prefixCls:S},P,{onClose:c})))))))},_jt=t=>{const{prefixCls:e,style:n,className:o,placement:r="right"}=t,i=jJe(t,["prefixCls","style","className","placement"]),{getPrefixCls:a}=m.useContext(Cr),l=a("drawer",e),[s,c,u]=UJe(l),d=Un(l,`${l}-pure`,`${l}-${r}`,c,u,o);return s(m.createElement("div",{className:d,style:n},m.createElement(LJe,Object.assign({prefixCls:l},i))))};gue._InternalPanelDoNotUseOrYouWillBeFired=_jt;function Dxe(t){return["small","middle","large"].includes(t)}function Exe(t){return t?typeof t=="number"&&!Number.isNaN(t):!1}const BJe=be.createContext({latestIndex:0}),Vjt=BJe.Provider,Gjt=t=>{let{className:e,index:n,children:o,split:r,style:i}=t;const{latestIndex:a}=m.useContext(BJe);return o==null?null:m.createElement(m.Fragment,null,m.createElement("div",{className:e,style:i},o),n{var n,o;const{getPrefixCls:r,space:i,direction:a}=m.useContext(Cr),{size:l=(i==null?void 0:i.size)||"small",align:s,className:c,rootClassName:u,children:d,direction:f="horizontal",prefixCls:p,split:g,style:y,wrap:w=!1,classNames:b,styles:C}=t,P=Xjt(t,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[v,T]=Array.isArray(l)?l:[l,l],A=Dxe(T),x=Dxe(v),S=Exe(T),R=Exe(v),M=B9(d,{keepEmpty:!0}),D=s===void 0&&f==="horizontal"?"center":s,E=r("space",p),[W,j,L]=PVe(E),k=Un(E,i==null?void 0:i.className,j,`${E}-${f}`,{[`${E}-rtl`]:a==="rtl",[`${E}-align-${D}`]:D,[`${E}-gap-row-${T}`]:A,[`${E}-gap-col-${v}`]:x},c,u,L),N=Un(`${E}-item`,(n=b==null?void 0:b.item)!==null&&n!==void 0?n:(o=i==null?void 0:i.classNames)===null||o===void 0?void 0:o.item);let F=0;const U=M.map((_,X)=>{var $,Q;_!=null&&(F=X);const le=_&&_.key||`${N}-${X}`;return m.createElement(Gjt,{className:N,key:le,index:X,split:g,style:($=C==null?void 0:C.item)!==null&&$!==void 0?$:(Q=i==null?void 0:i.styles)===null||Q===void 0?void 0:Q.item},_)}),O=m.useMemo(()=>({latestIndex:F}),[F]);if(M.length===0)return null;const B={};return w&&(B.flexWrap="wrap"),!x&&R&&(B.columnGap=v),!A&&S&&(B.rowGap=T),W(m.createElement("div",Object.assign({ref:e,className:k,style:Object.assign(Object.assign(Object.assign({},B),i==null?void 0:i.style),y)},P),m.createElement(Vjt,{value:O},U)))}),en=Jjt;en.Compact=QRt;var Kjt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{getPopupContainer:e,getPrefixCls:n,direction:o}=m.useContext(Cr),{prefixCls:r,type:i="default",danger:a,disabled:l,loading:s,onClick:c,htmlType:u,children:d,className:f,menu:p,arrow:g,autoFocus:y,overlay:w,trigger:b,align:C,open:P,onOpenChange:v,placement:T,getPopupContainer:A,href:x,icon:S=m.createElement(Vme,null),title:R,buttonsRender:M=te=>te,mouseEnterDelay:D,mouseLeaveDelay:E,overlayClassName:W,overlayStyle:j,destroyPopupOnHide:L,dropdownRender:k}=t,N=Kjt(t,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","dropdownRender"]),F=n("dropdown",r),U=`${F}-button`,O={menu:p,arrow:g,autoFocus:y,align:C,disabled:l,trigger:l?[]:b,onOpenChange:v,getPopupContainer:A||e,mouseEnterDelay:D,mouseLeaveDelay:E,overlayClassName:W,overlayStyle:j,destroyPopupOnHide:L,dropdownRender:k},{compactSize:B,compactItemClassnames:_}=Nw(F,o),X=Un(U,_,f);"overlay"in t&&(O.overlay=w),"open"in t&&(O.open=P),"placement"in t?O.placement=T:O.placement=o==="rtl"?"bottomLeft":"bottomRight";const $=m.createElement(lo,{type:i,danger:a,disabled:l,loading:s,onClick:c,htmlType:u,href:x,title:R},d),Q=m.createElement(lo,{type:i,danger:a,icon:S}),[le,q]=M([$,Q]);return m.createElement(en.Compact,Object.assign({className:X,size:B,block:!0},N),le,m.createElement(eQ,Object.assign({},O),q))};YJe.__ANT_BUTTON=!0;const jw=eQ;jw.Button=YJe;var qjt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},$jt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:qjt}))},QW=m.forwardRef($jt);function Fxe(t){var e=t.getBoundingClientRect(),n=document.documentElement;return{left:e.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:e.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}function NY(t,e,n,o){var r=_V.unstable_batchedUpdates?function(a){_V.unstable_batchedUpdates(n,a)}:n;return t!=null&&t.addEventListener&&t.addEventListener(e,r,o),{remove:function(){t!=null&&t.removeEventListener&&t.removeEventListener(e,r,o)}}}const OJe=function(){const t=Object.assign({},arguments.length<=0?void 0:arguments[0]);for(let e=1;e{const r=n[o];r!==void 0&&(t[o]=r)})}return t};var Qjt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},Zjt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Qjt}))},kxe=m.forwardRef(Zjt),eBt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},tBt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:eBt}))},Lxe=m.forwardRef(tBt),nBt={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},oBt=["10","20","50","100"],rBt=function(e){var n=e.pageSizeOptions,o=n===void 0?oBt:n,r=e.locale,i=e.changeSize,a=e.pageSize,l=e.goButton,s=e.quickGo,c=e.rootPrefixCls,u=e.selectComponentClass,d=e.selectPrefixCls,f=e.disabled,p=e.buildOptionText,g=be.useState(""),y=ln(g,2),w=y[0],b=y[1],C=function(){return!w||Number.isNaN(w)?void 0:Number(w)},P=typeof p=="function"?p:function(j){return"".concat(j," ").concat(r.items_per_page)},v=function(L){i==null||i(Number(L))},T=function(L){b(L.target.value)},A=function(L){l||w===""||(b(""),!(L.relatedTarget&&(L.relatedTarget.className.indexOf("".concat(c,"-item-link"))>=0||L.relatedTarget.className.indexOf("".concat(c,"-item"))>=0))&&(s==null||s(C())))},x=function(L){w!==""&&(L.keyCode===Bn.ENTER||L.type==="click")&&(b(""),s==null||s(C()))},S=function(){return o.some(function(L){return L.toString()===a.toString()})?o:o.concat([a.toString()]).sort(function(L,k){var N=Number.isNaN(Number(L))?0:Number(L),F=Number.isNaN(Number(k))?0:Number(k);return N-F})},R="".concat(c,"-options");if(!i&&!s)return null;var M=null,D=null,E=null;if(i&&u){var W=S().map(function(j,L){return be.createElement(u.Option,{key:L,value:j.toString()},P(j))});M=be.createElement(u,{disabled:f,prefixCls:d,showSearch:!1,className:"".concat(R,"-size-changer"),optionLabelProp:"children",popupMatchSelectWidth:!1,value:(a||o[0]).toString(),onChange:v,getPopupContainer:function(L){return L.parentNode},"aria-label":r.page_size,defaultOpen:!1},W)}return s&&(l&&(E=typeof l=="boolean"?be.createElement("button",{type:"button",onClick:x,onKeyUp:x,disabled:f,className:"".concat(R,"-quick-jumper-button")},r.jump_to_confirm):be.createElement("span",{onClick:x,onKeyUp:x},l)),D=be.createElement("div",{className:"".concat(R,"-quick-jumper")},r.jump_to,be.createElement("input",{disabled:f,type:"text",value:w,onChange:T,onKeyUp:x,onBlur:A,"aria-label":r.page}),r.page,E)),be.createElement("li",{className:R},M,D)},Nz=function(e){var n,o=e.rootPrefixCls,r=e.page,i=e.active,a=e.className,l=e.showTitle,s=e.onClick,c=e.onKeyPress,u=e.itemRender,d="".concat(o,"-item"),f=Vn(d,"".concat(d,"-").concat(r),(n={},Vt(n,"".concat(d,"-active"),i),Vt(n,"".concat(d,"-disabled"),!r),n),a),p=function(){s(r)},g=function(b){c(b,s,r)},y=u(r,"page",be.createElement("a",{rel:"nofollow"},r));return y?be.createElement("li",{title:l?String(r):null,className:f,onClick:p,onKeyDown:g,tabIndex:0},y):null},iBt=function(e,n,o){return o};function Wxe(){}function Nxe(t){var e=Number(t);return typeof e=="number"&&!Number.isNaN(e)&&isFinite(e)&&Math.floor(e)===e}function G7(t,e,n){var o=typeof t>"u"?e:t;return Math.floor((n-1)/o)+1}var aBt=function(e){var n,o=e.prefixCls,r=o===void 0?"rc-pagination":o,i=e.selectPrefixCls,a=i===void 0?"rc-select":i,l=e.className,s=e.selectComponentClass,c=e.current,u=e.defaultCurrent,d=u===void 0?1:u,f=e.total,p=f===void 0?0:f,g=e.pageSize,y=e.defaultPageSize,w=y===void 0?10:y,b=e.onChange,C=b===void 0?Wxe:b,P=e.hideOnSinglePage,v=e.showPrevNextJumpers,T=v===void 0?!0:v,A=e.showQuickJumper,x=e.showLessItems,S=e.showTitle,R=S===void 0?!0:S,M=e.onShowSizeChange,D=M===void 0?Wxe:M,E=e.locale,W=E===void 0?nBt:E,j=e.style,L=e.totalBoundaryShowSizeChanger,k=L===void 0?50:L,N=e.disabled,F=e.simple,U=e.showTotal,O=e.showSizeChanger,B=e.pageSizeOptions,_=e.itemRender,X=_===void 0?iBt:_,$=e.jumpPrevIcon,Q=e.jumpNextIcon,le=e.prevIcon,q=e.nextIcon,te=be.useRef(null),re=zs(10,{value:g,defaultValue:w}),ae=ln(re,2),se=ae[0],ne=ae[1],fe=zs(1,{value:c,defaultValue:d,postState:function(Qt){return Math.max(1,Math.min(Qt,G7(void 0,se,p)))}}),ge=ln(fe,2),de=ge[0],Z=ge[1],he=be.useState(de),xe=ln(he,2),He=xe[0],Se=xe[1];m.useEffect(function(){Se(de)},[de]);var ze=Math.max(1,de-(x?3:5)),Ie=Math.min(G7(void 0,se,p),de+(x?3:5));function ye(tn,Qt){var gn=tn||be.createElement("button",{type:"button","aria-label":Qt,className:"".concat(r,"-item-link")});return typeof tn=="function"&&(gn=be.createElement(tn,qt({},e))),gn}function ce(tn){var Qt=tn.target.value,gn=G7(void 0,se,p),an;return Qt===""?an=Qt:Number.isNaN(Number(Qt))?an=He:Qt>=gn?an=gn:an=Number(Qt),an}function pe(tn){return Nxe(tn)&&tn!==de&&Nxe(p)&&p>0}var ve=p>se?A:!1;function Ae(tn){(tn.keyCode===Bn.UP||tn.keyCode===Bn.DOWN)&&tn.preventDefault()}function Te(tn){var Qt=ce(tn);switch(Qt!==He&&Se(Qt),tn.keyCode){case Bn.ENTER:Ee(Qt);break;case Bn.UP:Ee(Qt-1);break;case Bn.DOWN:Ee(Qt+1);break}}function Me(tn){Ee(ce(tn))}function Pe(tn){var Qt=G7(tn,se,p),gn=de>Qt&&Qt!==0?Qt:de;ne(tn),Se(gn),D==null||D(de,tn),Z(gn),C==null||C(gn,tn)}function Ee(tn){if(pe(tn)&&!N){var Qt=G7(void 0,se,p),gn=tn;return tn>Qt?gn=Qt:tn<1&&(gn=1),gn!==He&&Se(gn),Z(gn),C==null||C(gn,se),gn}return de}var Be=de>1,Je=dek;function Ke(){Be&&Ee(de-1)}function Ne(){Je&&Ee(de+1)}function De(){Ee(ze)}function ke(){Ee(Ie)}function Ye(tn,Qt){if(tn.key==="Enter"||tn.charCode===Bn.ENTER||tn.keyCode===Bn.ENTER){for(var gn=arguments.length,an=new Array(gn>2?gn-2:0),mn=2;mnp?p:de*se])),Oe=null,Ze=G7(void 0,se,p);if(P&&p<=se)return null;var St=[],Pt={rootPrefixCls:r,onClick:Ee,onKeyPress:Ye,showTitle:R,itemRender:X,page:-1},Rt=de-1>0?de-1:0,Ut=de+1=gt*2&&de!==3&&(St[0]=be.cloneElement(St[0],{className:Vn("".concat(r,"-item-after-jump-prev"),St[0].props.className)}),St.unshift(ot)),Ze-de>=gt*2&&de!==Ze-2){var Qe=St[St.length-1];St[St.length-1]=be.cloneElement(Qe,{className:Vn("".concat(r,"-item-before-jump-next"),Qe.props.className)}),St.push(Oe)}je!==1&&St.unshift(be.createElement(Nz,ho({},Pt,{key:1,page:1}))),rt!==Ze&&St.push(be.createElement(Nz,ho({},Pt,{key:Ze,page:Ze})))}var Tt=Xe(Rt);if(Tt){var Dt=!Be||!Ze;Tt=be.createElement("li",{title:R?W.prev_page:null,onClick:Ke,tabIndex:Dt?null:0,onKeyDown:it,className:Vn("".concat(r,"-prev"),Vt({},"".concat(r,"-disabled"),Dt)),"aria-disabled":Dt},Tt)}var lt=ut(Ut);if(lt){var zt,Ft;F?(zt=!Je,Ft=Be?0:null):(zt=!Je||!Ze,Ft=zt?null:0),lt=be.createElement("li",{title:R?W.next_page:null,onClick:Ne,tabIndex:Ft,onKeyDown:Ve,className:Vn("".concat(r,"-next"),Vt({},"".concat(r,"-disabled"),zt)),"aria-disabled":zt},lt)}var _t=Vn(r,l,(n={},Vt(n,"".concat(r,"-simple"),F),Vt(n,"".concat(r,"-disabled"),N),n));return be.createElement("ul",ho({className:_t,style:j,ref:te},st),at,Tt,F?kt:St,lt,be.createElement(rBt,{locale:W,rootPrefixCls:r,disabled:N,selectComponentClass:s,selectPrefixCls:a,changeSize:We?Pe:null,pageSize:se,pageSizeOptions:B,quickGo:ve?Ee:null,goButton:At}))};const _Je=t=>m.createElement(_o,Object.assign({},t,{showSearch:!0,size:"small"})),VJe=t=>m.createElement(_o,Object.assign({},t,{showSearch:!0,size:"middle"}));_Je.Option=_o.Option;VJe.Option=_o.Option;const lBt=t=>{const{componentCls:e}=t;return{[`${e}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${e}-item-link`]:{color:t.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${e}-item-link`]:{color:t.colorTextDisabled,cursor:"not-allowed"}}},[`&${e}-disabled`]:{cursor:"not-allowed",[`${e}-item`]:{cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},a:{color:t.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:t.colorBorder,backgroundColor:t.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:t.itemActiveBgDisabled},a:{color:t.itemActiveColorDisabled}}},[`${e}-item-link`]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},[`${e}-simple&`]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},[`${e}-simple-pager`]:{color:t.colorTextDisabled},[`${e}-jump-prev, ${e}-jump-next`]:{[`${e}-item-link-icon`]:{opacity:0},[`${e}-item-ellipsis`]:{opacity:1}}},[`&${e}-simple`]:{[`${e}-prev, ${e}-next`]:{[`&${e}-disabled ${e}-item-link`]:{"&:hover, &:active":{backgroundColor:"transparent"}}}}}},sBt=t=>{const{componentCls:e}=t;return{[`&${e}-mini ${e}-total-text, &${e}-mini ${e}-simple-pager`]:{height:t.itemSizeSM,lineHeight:Nt(t.itemSizeSM)},[`&${e}-mini ${e}-item`]:{minWidth:t.itemSizeSM,height:t.itemSizeSM,margin:0,lineHeight:Nt(t.calc(t.itemSizeSM).sub(2).equal())},[`&${e}-mini:not(${e}-disabled) ${e}-item:not(${e}-item-active)`]:{backgroundColor:"transparent",borderColor:"transparent","&:hover":{backgroundColor:t.colorBgTextHover},"&:active":{backgroundColor:t.colorBgTextActive}},[`&${e}-mini ${e}-prev, &${e}-mini ${e}-next`]:{minWidth:t.itemSizeSM,height:t.itemSizeSM,margin:0,lineHeight:Nt(t.itemSizeSM)},[`&${e}-mini:not(${e}-disabled)`]:{[`${e}-prev, ${e}-next`]:{[`&:hover ${e}-item-link`]:{backgroundColor:t.colorBgTextHover},[`&:active ${e}-item-link`]:{backgroundColor:t.colorBgTextActive},[`&${e}-disabled:hover ${e}-item-link`]:{backgroundColor:"transparent"}}},[` &${e}-mini ${e}-prev ${e}-item-link, &${e}-mini ${e}-next ${e}-item-link - `]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:t.itemSizeSM,lineHeight:Nt(t.itemSizeSM)}},[`&${e}-mini ${e}-jump-prev, &${e}-mini ${e}-jump-next`]:{height:t.itemSizeSM,marginInlineEnd:0,lineHeight:Nt(t.itemSizeSM)},[`&${e}-mini ${e}-options`]:{marginInlineStart:t.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:t.miniOptionsSizeChangerTop},"&-quick-jumper":{height:t.itemSizeSM,lineHeight:Nt(t.itemSizeSM),input:Object.assign(Object.assign({},nye(t)),{width:t.paginationMiniQuickJumperInputWidth,height:t.controlHeightSM})}}}},cBt=t=>{const{componentCls:e}=t;return{[` + `]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:t.itemSizeSM,lineHeight:Nt(t.itemSizeSM)}},[`&${e}-mini ${e}-jump-prev, &${e}-mini ${e}-jump-next`]:{height:t.itemSizeSM,marginInlineEnd:0,lineHeight:Nt(t.itemSizeSM)},[`&${e}-mini ${e}-options`]:{marginInlineStart:t.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:t.miniOptionsSizeChangerTop},"&-quick-jumper":{height:t.itemSizeSM,lineHeight:Nt(t.itemSizeSM),input:Object.assign(Object.assign({},oye(t)),{width:t.paginationMiniQuickJumperInputWidth,height:t.controlHeightSM})}}}},cBt=t=>{const{componentCls:e}=t;return{[` &${e}-simple ${e}-prev, &${e}-simple ${e}-next `]:{height:t.itemSizeSM,lineHeight:Nt(t.itemSizeSM),verticalAlign:"top",[`${e}-item-link`]:{height:t.itemSizeSM,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:t.colorBgTextHover},"&:active":{backgroundColor:t.colorBgTextActive},"&::after":{height:t.itemSizeSM,lineHeight:Nt(t.itemSizeSM)}}},[`&${e}-simple ${e}-simple-pager`]:{display:"inline-block",height:t.itemSizeSM,marginInlineEnd:t.marginXS,input:{boxSizing:"border-box",height:"100%",marginInlineEnd:t.marginXS,padding:`0 ${Nt(t.paginationItemPaddingInline)}`,textAlign:"center",backgroundColor:t.itemInputBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderRadius:t.borderRadius,outline:"none",transition:`border-color ${t.motionDurationMid}`,color:"inherit","&:hover":{borderColor:t.colorPrimary},"&:focus":{borderColor:t.colorPrimaryHover,boxShadow:`${Nt(t.inputOutlineOffset)} 0 ${Nt(t.controlOutlineWidth)} ${t.controlOutline}`},"&[disabled]":{color:t.colorTextDisabled,backgroundColor:t.colorBgContainerDisabled,borderColor:t.colorBorder,cursor:"not-allowed"}}}}},uBt=t=>{const{componentCls:e}=t;return{[`${e}-jump-prev, ${e}-jump-next`]:{outline:0,[`${e}-item-container`]:{position:"relative",[`${e}-item-link-icon`]:{color:t.colorPrimary,fontSize:t.fontSizeSM,opacity:0,transition:`all ${t.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},[`${e}-item-ellipsis`]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:t.colorTextDisabled,fontFamily:"Arial, Helvetica, sans-serif",letterSpacing:t.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:t.paginationEllipsisTextIndent,opacity:1,transition:`all ${t.motionDurationMid}`}},"&:hover":{[`${e}-item-link-icon`]:{opacity:1},[`${e}-item-ellipsis`]:{opacity:0}}},[` @@ -4644,7 +4644,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho ${e}-next, ${e}-jump-prev, ${e}-jump-next - `]:{display:"inline-block",minWidth:t.itemSize,height:t.itemSize,color:t.colorText,fontFamily:t.fontFamily,lineHeight:`${Nt(t.itemSize)}`,textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:t.borderRadius,cursor:"pointer",transition:`all ${t.motionDurationMid}`},[`${e}-prev, ${e}-next`]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:t.colorText,cursor:"pointer",userSelect:"none"},[`${e}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:t.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${Nt(t.lineWidth)} ${t.lineType} transparent`,borderRadius:t.borderRadius,outline:"none",transition:`all ${t.motionDurationMid}`},[`&:hover ${e}-item-link`]:{backgroundColor:t.colorBgTextHover},[`&:active ${e}-item-link`]:{backgroundColor:t.colorBgTextActive},[`&${e}-disabled:hover`]:{[`${e}-item-link`]:{backgroundColor:"transparent"}}},[`${e}-slash`]:{marginInlineEnd:t.paginationSlashMarginInlineEnd,marginInlineStart:t.paginationSlashMarginInlineStart},[`${e}-options`]:{display:"inline-block",marginInlineStart:t.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:t.controlHeight,marginInlineStart:t.marginXS,lineHeight:Nt(t.controlHeight),verticalAlign:"top",input:Object.assign(Object.assign(Object.assign({},JW(t)),$me(t,{borderColor:t.colorBorder,hoverBorderColor:t.colorPrimaryHover,activeBorderColor:t.colorPrimary,activeShadow:t.activeShadow})),{"&[disabled]":Object.assign({},aQ(t)),width:t.calc(t.controlHeightLG).mul(1.25).equal(),height:t.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:t.marginXS,marginInlineEnd:t.marginXS})}}}},dBt=t=>{const{componentCls:e}=t;return{[`${e}-item`]:{display:"inline-block",minWidth:t.itemSize,height:t.itemSize,marginInlineEnd:t.marginXS,fontFamily:t.fontFamily,lineHeight:Nt(t.calc(t.itemSize).sub(2).equal()),textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:`${Nt(t.lineWidth)} ${t.lineType} transparent`,borderRadius:t.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${Nt(t.paginationItemPaddingInline)}`,color:t.colorText,"&:hover":{textDecoration:"none"}},[`&:not(${e}-item-active)`]:{"&:hover":{transition:`all ${t.motionDurationMid}`,backgroundColor:t.colorBgTextHover},"&:active":{backgroundColor:t.colorBgTextActive}},"&-active":{fontWeight:t.fontWeightStrong,backgroundColor:t.itemActiveBg,borderColor:t.colorPrimary,a:{color:t.colorPrimary},"&:hover":{borderColor:t.colorPrimaryHover},"&:hover a":{color:t.colorPrimaryHover}}}}},fBt=t=>{const{componentCls:e}=t;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${e}-total-text`]:{display:"inline-block",height:t.itemSize,marginInlineEnd:t.marginXS,lineHeight:Nt(t.calc(t.itemSize).sub(2).equal()),verticalAlign:"middle"}}),dBt(t)),uBt(t)),cBt(t)),sBt(t)),lBt(t)),{[`@media only screen and (max-width: ${t.screenLG}px)`]:{[`${e}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${t.screenSM}px)`]:{[`${e}-options`]:{display:"none"}}}),[`&${t.componentCls}-rtl`]:{direction:"rtl"}}},hBt=t=>{const{componentCls:e}=t;return{[`${e}:not(${e}-disabled)`]:{[`${e}-item`]:Object.assign({},Q6(t)),[`${e}-jump-prev, ${e}-jump-next`]:{"&:focus-visible":Object.assign({[`${e}-item-link-icon`]:{opacity:1},[`${e}-item-ellipsis`]:{opacity:0}},lw(t))},[`${e}-prev, ${e}-next`]:{[`&:focus-visible ${e}-item-link`]:Object.assign({},lw(t))}}}},GJe=t=>Object.assign({itemBg:t.colorBgContainer,itemSize:t.controlHeight,itemSizeSM:t.controlHeightSM,itemActiveBg:t.colorBgContainer,itemLinkBg:t.colorBgContainer,itemActiveColorDisabled:t.colorTextDisabled,itemActiveBgDisabled:t.controlItemBgActiveDisabled,itemInputBg:t.colorBgContainer,miniOptionsSizeChangerTop:0},XW(t)),XJe=t=>Ki(t,{inputOutlineOffset:0,paginationMiniOptionsMarginInlineStart:t.calc(t.marginXXS).div(2).equal(),paginationMiniQuickJumperInputWidth:t.calc(t.controlHeightLG).mul(1.1).equal(),paginationItemPaddingInline:t.calc(t.marginXXS).mul(1.5).equal(),paginationEllipsisLetterSpacing:t.calc(t.marginXXS).div(2).equal(),paginationSlashMarginInlineStart:t.marginXXS,paginationSlashMarginInlineEnd:t.marginSM,paginationEllipsisTextIndent:"0.13em"},GW(t)),pBt=wl("Pagination",t=>{const e=XJe(t);return[fBt(e),hBt(e)]},GJe),gBt=t=>{const{componentCls:e}=t;return{[`${e}${e}-bordered${e}-disabled:not(${e}-mini)`]:{"&, &:hover":{[`${e}-item-link`]:{borderColor:t.colorBorder}},"&:focus-visible":{[`${e}-item-link`]:{borderColor:t.colorBorder}},[`${e}-item, ${e}-item-link`]:{backgroundColor:t.colorBgContainerDisabled,borderColor:t.colorBorder,[`&:hover:not(${e}-item-active)`]:{backgroundColor:t.colorBgContainerDisabled,borderColor:t.colorBorder,a:{color:t.colorTextDisabled}},[`&${e}-item-active`]:{backgroundColor:t.itemActiveBgDisabled}},[`${e}-prev, ${e}-next`]:{"&:hover button":{backgroundColor:t.colorBgContainerDisabled,borderColor:t.colorBorder,color:t.colorTextDisabled},[`${e}-item-link`]:{backgroundColor:t.colorBgContainerDisabled,borderColor:t.colorBorder}}},[`${e}${e}-bordered:not(${e}-mini)`]:{[`${e}-prev, ${e}-next`]:{"&:hover button":{borderColor:t.colorPrimaryHover,backgroundColor:t.itemBg},[`${e}-item-link`]:{backgroundColor:t.itemLinkBg,borderColor:t.colorBorder},[`&:hover ${e}-item-link`]:{borderColor:t.colorPrimary,backgroundColor:t.itemBg,color:t.colorPrimary},[`&${e}-disabled`]:{[`${e}-item-link`]:{borderColor:t.colorBorder,color:t.colorTextDisabled}}},[`${e}-item`]:{backgroundColor:t.itemBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,[`&:hover:not(${e}-item-active)`]:{borderColor:t.colorPrimary,backgroundColor:t.itemBg,a:{color:t.colorPrimary}},"&-active":{borderColor:t.colorPrimary}}}}},mBt=IW(["Pagination","bordered"],t=>{const e=XJe(t);return[gBt(e)]},GJe);var yBt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:e,selectPrefixCls:n,className:o,rootClassName:r,style:i,size:a,locale:l,selectComponentClass:s,responsive:c,showSizeChanger:u}=t,d=yBt(t,["prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","selectComponentClass","responsive","showSizeChanger"]),{xs:f}=X$(c),[,p]=_u(),{getPrefixCls:g,direction:y,pagination:w={}}=m.useContext(Cr),b=g("pagination",e),[C,P,v]=pBt(b),T=u??w.showSizeChanger,A=m.useMemo(()=>{const j=m.createElement("span",{className:`${b}-item-ellipsis`},"•••"),L=m.createElement("button",{className:`${b}-item-link`,type:"button",tabIndex:-1},y==="rtl"?m.createElement(NG,null):m.createElement(Gve,null)),k=m.createElement("button",{className:`${b}-item-link`,type:"button",tabIndex:-1},y==="rtl"?m.createElement(Gve,null):m.createElement(NG,null)),N=m.createElement("a",{className:`${b}-item-link`},m.createElement("div",{className:`${b}-item-container`},y==="rtl"?m.createElement(kxe,{className:`${b}-item-link-icon`}):m.createElement(Fxe,{className:`${b}-item-link-icon`}),j)),F=m.createElement("a",{className:`${b}-item-link`},m.createElement("div",{className:`${b}-item-container`},y==="rtl"?m.createElement(Fxe,{className:`${b}-item-link-icon`}):m.createElement(kxe,{className:`${b}-item-link-icon`}),j));return{prevIcon:L,nextIcon:k,jumpPrevIcon:N,jumpNextIcon:F}},[y,b]),[x]=kw("Pagination",h_e),S=Object.assign(Object.assign({},x),l),R=Ed(a),M=R==="small"||!!(f&&!R&&c),D=g("select",n),E=Un({[`${b}-mini`]:M,[`${b}-rtl`]:y==="rtl",[`${b}-bordered`]:p.wireframe},w==null?void 0:w.className,o,r,P,v),W=Object.assign(Object.assign({},w==null?void 0:w.style),i);return C(m.createElement(m.Fragment,null,p.wireframe&&m.createElement(mBt,{prefixCls:b}),m.createElement(aBt,Object.assign({},A,d,{style:W,prefixCls:b,selectPrefixCls:D,className:E,selectComponentClass:s||(M?_Je:VJe),locale:S,showSizeChanger:T}))))},uye=be.createContext({});uye.Consumer;var KJe=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var{prefixCls:e,className:n,avatar:o,title:r,description:i}=t,a=KJe(t,["prefixCls","className","avatar","title","description"]);const{getPrefixCls:l}=m.useContext(Cr),s=l("list",e),c=Un(`${s}-item-meta`,n),u=be.createElement("div",{className:`${s}-item-meta-content`},r&&be.createElement("h4",{className:`${s}-item-meta-title`},r),i&&be.createElement("div",{className:`${s}-item-meta-description`},i));return be.createElement("div",Object.assign({},a,{className:c}),o&&be.createElement("div",{className:`${s}-item-meta-avatar`},o),(r||i)&&u)},wBt=be.forwardRef((t,e)=>{const{prefixCls:n,children:o,actions:r,extra:i,className:a,colStyle:l}=t,s=KJe(t,["prefixCls","children","actions","extra","className","colStyle"]),{grid:c,itemLayout:u}=m.useContext(uye),{getPrefixCls:d}=m.useContext(Cr),f=()=>{let C;return m.Children.forEach(o,P=>{typeof P=="string"&&(C=!0)}),C&&m.Children.count(o)>1},p=()=>u==="vertical"?!!i:!f(),g=d("list",n),y=r&&r.length>0&&be.createElement("ul",{className:`${g}-item-action`,key:"actions"},r.map((C,P)=>be.createElement("li",{key:`${g}-item-action-${P}`},C,P!==r.length-1&&be.createElement("em",{className:`${g}-item-action-split`})))),w=c?"div":"li",b=be.createElement(w,Object.assign({},s,c?{}:{ref:e},{className:Un(`${g}-item`,{[`${g}-item-no-flex`]:!p()},a)}),u==="vertical"&&i?[be.createElement("div",{className:`${g}-item-main`,key:"content"},o,y),be.createElement("div",{className:`${g}-item-extra`,key:"extra"},i)]:[o,y,B0(i,{key:"extra"})]);return c?be.createElement(nt,{ref:e,flex:1,style:l},b):b}),qJe=wBt;qJe.Meta=ABt;const vBt=t=>{const{listBorderedCls:e,componentCls:n,paddingLG:o,margin:r,itemPaddingSM:i,itemPaddingLG:a,marginLG:l,borderRadiusLG:s}=t;return{[`${e}`]:{border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderRadius:s,[`${n}-header,${n}-footer,${n}-item`]:{paddingInline:o},[`${n}-pagination`]:{margin:`${Nt(r)} ${Nt(l)}`}},[`${e}${n}-sm`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:i}},[`${e}${n}-lg`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:a}}}},xBt=t=>{const{componentCls:e,screenSM:n,screenMD:o,marginLG:r,marginSM:i,margin:a}=t;return{[`@media screen and (max-width:${o}px)`]:{[`${e}`]:{[`${e}-item`]:{[`${e}-item-action`]:{marginInlineStart:r}}},[`${e}-vertical`]:{[`${e}-item`]:{[`${e}-item-extra`]:{marginInlineStart:r}}}},[`@media screen and (max-width: ${n}px)`]:{[`${e}`]:{[`${e}-item`]:{flexWrap:"wrap",[`${e}-action`]:{marginInlineStart:i}}},[`${e}-vertical`]:{[`${e}-item`]:{flexWrap:"wrap-reverse",[`${e}-item-main`]:{minWidth:t.contentWidth},[`${e}-item-extra`]:{margin:`auto auto ${Nt(a)}`}}}}}},bBt=t=>{const{componentCls:e,antCls:n,controlHeight:o,minHeight:r,paddingSM:i,marginLG:a,padding:l,itemPadding:s,colorPrimary:c,itemPaddingSM:u,itemPaddingLG:d,paddingXS:f,margin:p,colorText:g,colorTextDescription:y,motionDurationSlow:w,lineWidth:b,headerBg:C,footerBg:P,emptyTextPadding:v,metaMarginBottom:T,avatarMarginRight:A,titleMarginBottom:x,descriptionFontSize:S}=t,R={};return["start","center","end"].forEach(M=>{R[`&-align-${M}`]={textAlign:M}}),{[`${e}`]:Object.assign(Object.assign({},ja(t)),{position:"relative","*":{outline:"none"},[`${e}-header`]:{background:C},[`${e}-footer`]:{background:P},[`${e}-header, ${e}-footer`]:{paddingBlock:i},[`${e}-pagination`]:Object.assign(Object.assign({marginBlockStart:a},R),{[`${n}-pagination-options`]:{textAlign:"start"}}),[`${e}-spin`]:{minHeight:r,textAlign:"center"},[`${e}-items`]:{margin:0,padding:0,listStyle:"none"},[`${e}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:s,color:g,[`${e}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${e}-item-meta-avatar`]:{marginInlineEnd:A},[`${e}-item-meta-content`]:{flex:"1 0",width:0,color:g},[`${e}-item-meta-title`]:{margin:`0 0 ${Nt(t.marginXXS)} 0`,color:g,fontSize:t.fontSize,lineHeight:t.lineHeight,"> a":{color:g,transition:`all ${w}`,"&:hover":{color:c}}},[`${e}-item-meta-description`]:{color:y,fontSize:S,lineHeight:t.lineHeight}},[`${e}-item-action`]:{flex:"0 0 auto",marginInlineStart:t.marginXXL,padding:0,fontSize:0,listStyle:"none","& > li":{position:"relative",display:"inline-block",padding:`0 ${Nt(f)}`,color:y,fontSize:t.fontSize,lineHeight:t.lineHeight,textAlign:"center","&:first-child":{paddingInlineStart:0}},[`${e}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:b,height:t.calc(t.fontHeight).sub(t.calc(t.marginXXS).mul(2)).equal(),transform:"translateY(-50%)",backgroundColor:t.colorSplit}}},[`${e}-empty`]:{padding:`${Nt(l)} 0`,color:y,fontSize:t.fontSizeSM,textAlign:"center"},[`${e}-empty-text`]:{padding:v,color:t.colorTextDisabled,fontSize:t.fontSize,textAlign:"center"},[`${e}-item-no-flex`]:{display:"block"}}),[`${e}-grid ${n}-col > ${e}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:p,paddingBlock:0,borderBlockEnd:"none"},[`${e}-vertical ${e}-item`]:{alignItems:"initial",[`${e}-item-main`]:{display:"block",flex:1},[`${e}-item-extra`]:{marginInlineStart:a},[`${e}-item-meta`]:{marginBlockEnd:T,[`${e}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:x,color:g,fontSize:t.fontSizeLG,lineHeight:t.lineHeightLG}},[`${e}-item-action`]:{marginBlockStart:l,marginInlineStart:"auto","> li":{padding:`0 ${Nt(l)}`,"&:first-child":{paddingInlineStart:0}}}},[`${e}-split ${e}-item`]:{borderBlockEnd:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`,"&:last-child":{borderBlockEnd:"none"}},[`${e}-split ${e}-header`]:{borderBlockEnd:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-split${e}-empty ${e}-footer`]:{borderTop:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-loading ${e}-spin-nested-loading`]:{minHeight:o},[`${e}-split${e}-something-after-last-item ${n}-spin-container > ${e}-items > ${e}-item:last-child`]:{borderBlockEnd:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-lg ${e}-item`]:{padding:d},[`${e}-sm ${e}-item`]:{padding:u},[`${e}:not(${e}-vertical)`]:{[`${e}-item-no-flex`]:{[`${e}-item-action`]:{float:"right"}}}}},SBt=t=>({contentWidth:220,itemPadding:`${Nt(t.paddingContentVertical)} 0`,itemPaddingSM:`${Nt(t.paddingContentVerticalSM)} ${Nt(t.paddingContentHorizontal)}`,itemPaddingLG:`${Nt(t.paddingContentVerticalLG)} ${Nt(t.paddingContentHorizontalLG)}`,headerBg:"transparent",footerBg:"transparent",emptyTextPadding:t.padding,metaMarginBottom:t.padding,avatarMarginRight:t.padding,titleMarginBottom:t.paddingSM,descriptionFontSize:t.fontSize}),TBt=wl("List",t=>{const e=Ki(t,{listBorderedCls:`${t.componentCls}-bordered`,minHeight:t.controlHeightLG});return[bBt(e),vBt(e),xBt(e)]},SBt);var PBt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r(Ie,ye)=>{var ce;S(Ie),M(ye),n&&n[ze]&&((ce=n==null?void 0:n[ze])===null||ce===void 0||ce.call(n,Ie,ye))},N=k("onChange"),F=k("onShowSizeChange"),U=(ze,Ie)=>{if(!P)return null;let ye;return typeof C=="function"?ye=C(ze):C?ye=ze[C]:ye=ze.key,ye||(ye=`list-item-${Ie}`),m.createElement(m.Fragment,{key:ye},P(ze,Ie))},O=()=>!!(d||n||w),B=D("list",o),[_,X,$]=TBt(B);let Q=b;typeof Q=="boolean"&&(Q={spinning:Q});const le=Q&&Q.spinning,q=Ed(g);let te="";switch(q){case"large":te="lg";break;case"small":te="sm";break}const re=Un(B,{[`${B}-vertical`]:u==="vertical",[`${B}-${te}`]:te,[`${B}-split`]:i,[`${B}-bordered`]:r,[`${B}-loading`]:le,[`${B}-grid`]:!!f,[`${B}-something-after-last-item`]:O(),[`${B}-rtl`]:W==="rtl"},j==null?void 0:j.className,a,l,X,$),ae=OJe(L,{total:p.length,current:x,pageSize:R},n||{}),se=Math.ceil(ae.total/ae.pageSize);ae.current>se&&(ae.current=se);const ne=n?m.createElement("div",{className:Un(`${B}-pagination`,`${B}-pagination-align-${(e=ae==null?void 0:ae.align)!==null&&e!==void 0?e:"end"}`)},m.createElement(JJe,Object.assign({},ae,{onChange:N,onShowSizeChange:F}))):null;let fe=Za(p);n&&p.length>(ae.current-1)*ae.pageSize&&(fe=Za(p).splice((ae.current-1)*ae.pageSize,ae.pageSize));const ge=Object.keys(f||{}).some(ze=>["xs","sm","md","lg","xl","xxl"].includes(ze)),de=X$(ge),Z=m.useMemo(()=>{for(let ze=0;ze{if(!f)return;const ze=Z&&f[Z]?f[Z]:f.column;if(ze)return{width:`${100/ze}%`,maxWidth:`${100/ze}%`}},[JSON.stringify(f),Z]);let xe=le&&m.createElement("div",{style:{minHeight:53}});if(fe.length>0){const ze=fe.map((Ie,ye)=>U(Ie,ye));xe=f?m.createElement(on,{gutter:f.gutter},m.Children.map(ze,Ie=>m.createElement("div",{key:Ie==null?void 0:Ie.key,style:he},Ie))):m.createElement("ul",{className:`${B}-items`},ze)}else!c&&!le&&(xe=m.createElement("div",{className:`${B}-empty-text`},v&&v.emptyText||(E==null?void 0:E("List"))||m.createElement(Dme,{componentName:"List"})));const He=ae.position||"bottom",Se=m.useMemo(()=>({grid:f,itemLayout:u}),[JSON.stringify(f),u]);return _(m.createElement(uye.Provider,{value:Se},m.createElement("div",Object.assign({style:Object.assign(Object.assign({},j==null?void 0:j.style),s),className:re},T),(He==="top"||He==="both")&&ne,y&&m.createElement("div",{className:`${B}-header`},y),m.createElement(qW,Object.assign({},Q),xe,c),w&&m.createElement("div",{className:`${B}-footer`},w),d||(He==="bottom"||He==="both")&&ne)))}mue.Item=qJe;let Cm=null,Bv=t=>t(),uk=[],dk={};function Nxe(){const{getContainer:t,duration:e,rtl:n,maxCount:o,top:r}=dk,i=(t==null?void 0:t())||document.body;return{getContainer:()=>i,duration:e,rtl:n,maxCount:o,top:r}}const CBt=be.forwardRef((t,e)=>{const{messageConfig:n,sync:o}=t,{getPrefixCls:r}=m.useContext(Cr),i=dk.prefixCls||r("message"),a=m.useContext(OIt),[l,s]=bVe(Object.assign(Object.assign(Object.assign({},n),{prefixCls:i}),a.message));return be.useImperativeHandle(e,()=>{const c=Object.assign({},l);return Object.keys(c).forEach(u=>{c[u]=function(){return o(),l[u].apply(l,arguments)}}),{instance:c,sync:o}}),s}),RBt=be.forwardRef((t,e)=>{const[n,o]=be.useState(Nxe),r=()=>{o(Nxe)};be.useEffect(r,[]);const i=rVe(),a=i.getRootPrefixCls(),l=i.getIconPrefixCls(),s=i.getTheme(),c=be.createElement(CBt,{ref:e,sync:r,messageConfig:n});return be.createElement(fy,{prefixCls:a,iconPrefixCls:l,theme:s},i.holderRender?i.holderRender(c):c)});function uQ(){if(!Cm){const t=document.createDocumentFragment(),e={fragment:t};Cm=e,Bv(()=>{vme(be.createElement(RBt,{ref:n=>{const{instance:o,sync:r}=n||{};Promise.resolve().then(()=>{!e.instance&&o&&(e.instance=o,e.sync=r,uQ())})}}),t)});return}Cm.instance&&(uk.forEach(t=>{const{type:e,skipped:n}=t;if(!n)switch(e){case"open":{Bv(()=>{const o=Cm.instance.open(Object.assign(Object.assign({},dk),t.config));o==null||o.then(t.resolve),t.setCloseFn(o)});break}case"destroy":Bv(()=>{Cm==null||Cm.instance.destroy(t.key)});break;default:Bv(()=>{var o;const r=(o=Cm.instance)[e].apply(o,Za(t.args));r==null||r.then(t.resolve),t.setCloseFn(r)})}}),uk=[])}function HBt(t){dk=Object.assign(Object.assign({},dk),t),Bv(()=>{var e;(e=Cm==null?void 0:Cm.sync)===null||e===void 0||e.call(Cm)})}function MBt(t){const e=wme(n=>{let o;const r={type:"open",config:t,resolve:n,setCloseFn:i=>{o=i}};return uk.push(r),()=>{o?Bv(()=>{o()}):r.skipped=!0}});return uQ(),e}function IBt(t,e){const n=wme(o=>{let r;const i={type:t,args:e,resolve:o,setCloseFn:a=>{r=a}};return uk.push(i),()=>{r?Bv(()=>{r()}):i.skipped=!0}});return uQ(),n}const zBt=t=>{uk.push({type:"destroy",key:t}),uQ()},DBt=["success","info","warning","error","loading"],EBt={open:MBt,destroy:zBt,config:HBt,useMessage:HRt,_InternalPanelDoNotUseOrYouWillBeFired:vRt},nA=EBt;DBt.forEach(t=>{nA[t]=function(){for(var e=arguments.length,n=new Array(e),o=0;o{const{prefixCls:e,className:n,closeIcon:o,closable:r,type:i,title:a,children:l,footer:s}=t,c=FBt(t,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:u}=m.useContext(Cr),d=u(),f=e||u("modal"),p=O0(d),[g,y,w]=iGe(f,p),b=`${f}-confirm`;let C={};return i?C={closable:r??!1,title:"",footer:"",children:m.createElement(lGe,Object.assign({},t,{prefixCls:f,confirmPrefixCls:b,rootPrefixCls:d,content:l}))}:C={closable:r??!0,title:a,footer:s!==null&&m.createElement(nGe,Object.assign({},t)),children:l},g(m.createElement(UVe,Object.assign({prefixCls:f,className:Un(y,`${f}-pure-panel`,i&&b,i&&`${b}-${i}`,n,w,p)},c,{closeIcon:tGe(f,o),closable:r},C)))},LBt=mGe(kBt);function $Je(t){return jW(dGe(t))}const Oi=aGe;Oi.useModal=YIt;Oi.info=function(e){return jW(fGe(e))};Oi.success=function(e){return jW(hGe(e))};Oi.error=function(e){return jW(pGe(e))};Oi.warning=$Je;Oi.warn=$Je;Oi.confirm=function(e){return jW(gGe(e))};Oi.destroyAll=function(){for(;Nv.length;){const e=Nv.pop();e&&e()}};Oi.config=WIt;Oi._InternalPanelDoNotUseOrYouWillBeFired=LBt;var WBt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"},NBt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:WBt}))},Hf=m.forwardRef(NBt);function yue(t,e,n){return(t-e)/(n-e)}function dye(t,e,n,o){var r=yue(e,n,o),i={};switch(t){case"rtl":i.right="".concat(r*100,"%"),i.transform="translateX(50%)";break;case"btt":i.bottom="".concat(r*100,"%"),i.transform="translateY(50%)";break;case"ttb":i.top="".concat(r*100,"%"),i.transform="translateY(-50%)";break;default:i.left="".concat(r*100,"%"),i.transform="translateX(-50%)";break}return i}function eC(t,e){return Array.isArray(t)?t[e]:t}var jb=m.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0,styles:{},classNames:{}}),UBt=["prefixCls","value","valueIndex","onStartMove","style","render","dragging","onOffsetChange","onChangeComplete","onFocus","onMouseEnter"],Uxe=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.value,r=t.valueIndex,i=t.onStartMove,a=t.style,l=t.render,s=t.dragging,c=t.onOffsetChange,u=t.onChangeComplete,d=t.onFocus,f=t.onMouseEnter,p=ii(t,UBt),g=m.useContext(jb),y=g.min,w=g.max,b=g.direction,C=g.disabled,P=g.keyboard,v=g.range,T=g.tabIndex,A=g.ariaLabelForHandle,x=g.ariaLabelledByForHandle,S=g.ariaValueTextFormatterForHandle,R=g.styles,M=g.classNames,D="".concat(n,"-handle"),E=function(_){C||i(_,r)},W=function(_){d==null||d(_,r)},j=function(_){f(_,r)},L=function(_){if(!C&&P){var X=null;switch(_.which||_.keyCode){case Bn.LEFT:X=b==="ltr"||b==="btt"?-1:1;break;case Bn.RIGHT:X=b==="ltr"||b==="btt"?1:-1;break;case Bn.UP:X=b!=="ttb"?1:-1;break;case Bn.DOWN:X=b!=="ttb"?-1:1;break;case Bn.HOME:X="min";break;case Bn.END:X="max";break;case Bn.PAGE_UP:X=2;break;case Bn.PAGE_DOWN:X=-2;break}X!==null&&(_.preventDefault(),c(X,r))}},k=function(_){switch(_.which||_.keyCode){case Bn.LEFT:case Bn.RIGHT:case Bn.UP:case Bn.DOWN:case Bn.HOME:case Bn.END:case Bn.PAGE_UP:case Bn.PAGE_DOWN:u==null||u();break}},N=dye(b,o,y,w),F={};if(r!==null){var U;F={tabIndex:C?null:eC(T,r),role:"slider","aria-valuemin":y,"aria-valuemax":w,"aria-valuenow":o,"aria-disabled":C,"aria-label":eC(A,r),"aria-labelledby":eC(x,r),"aria-valuetext":(U=eC(S,r))===null||U===void 0?void 0:U(o),"aria-orientation":b==="ltr"||b==="rtl"?"horizontal":"vertical",onMouseDown:E,onTouchStart:E,onFocus:W,onMouseEnter:j,onKeyDown:L,onKeyUp:k}}var O=m.createElement("div",ho({ref:e,className:Vn(D,Vt(Vt({},"".concat(D,"-").concat(r+1),r!==null&&v),"".concat(D,"-dragging"),s),M.handle),style:qt(qt(qt({},N),a),R.handle)},F,p));return l&&(O=l(O,{index:r,prefixCls:n,value:o,dragging:s})),O}),jBt=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","activeHandleRender","draggingIndex","onFocus"],BBt=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.style,r=t.onStartMove,i=t.onOffsetChange,a=t.values,l=t.handleRender,s=t.activeHandleRender,c=t.draggingIndex,u=t.onFocus,d=ii(t,jBt),f=m.useRef({});m.useImperativeHandle(e,function(){return{focus:function(T){var A;(A=f.current[T])===null||A===void 0||A.focus()}}});var p=m.useState(-1),g=ln(p,2),y=g[0],w=g[1],b=function(T,A){w(A),u==null||u(T)},C=function(T,A){w(A)},P=qt({prefixCls:n,onStartMove:r,onOffsetChange:i,render:l,onFocus:b,onMouseEnter:C},d);return m.createElement(m.Fragment,null,a.map(function(v,T){return m.createElement(Uxe,ho({ref:function(x){x?f.current[T]=x:delete f.current[T]},dragging:c===T,style:eC(o,T),key:T,value:v,valueIndex:T},P))}),s&&m.createElement(Uxe,ho({key:"a11y"},P,{value:a[y],valueIndex:null,dragging:c!==-1,render:s,style:{pointerEvents:"none"},tabIndex:null,"aria-hidden":!0})))}),YBt=function(e){var n=e.prefixCls,o=e.style,r=e.children,i=e.value,a=e.onClick,l=m.useContext(jb),s=l.min,c=l.max,u=l.direction,d=l.includedStart,f=l.includedEnd,p=l.included,g="".concat(n,"-text"),y=dye(u,i,s,c);return m.createElement("span",{className:Vn(g,Vt({},"".concat(g,"-active"),p&&d<=i&&i<=f)),style:qt(qt({},y),o),onMouseDown:function(b){b.stopPropagation()},onClick:function(){a(i)}},r)},OBt=function(e){var n=e.prefixCls,o=e.marks,r=e.onClick,i="".concat(n,"-mark");return o.length?m.createElement("div",{className:i},o.map(function(a){var l=a.value,s=a.style,c=a.label;return m.createElement(YBt,{key:l,prefixCls:i,style:s,value:l,onClick:r},c)})):null},_Bt=function(e){var n=e.prefixCls,o=e.value,r=e.style,i=e.activeStyle,a=m.useContext(jb),l=a.min,s=a.max,c=a.direction,u=a.included,d=a.includedStart,f=a.includedEnd,p="".concat(n,"-dot"),g=u&&d<=o&&o<=f,y=qt(qt({},dye(c,o,l,s)),typeof r=="function"?r(o):r);return g&&(y=qt(qt({},y),typeof i=="function"?i(o):i)),m.createElement("span",{className:Vn(p,Vt({},"".concat(p,"-active"),g)),style:y})},VBt=function(e){var n=e.prefixCls,o=e.marks,r=e.dots,i=e.style,a=e.activeStyle,l=m.useContext(jb),s=l.min,c=l.max,u=l.step,d=m.useMemo(function(){var f=new Set;if(o.forEach(function(g){f.add(g.value)}),r&&u!==null)for(var p=s;p<=c;)f.add(p),p+=u;return Array.from(f)},[s,c,u,r,o]);return m.createElement("div",{className:"".concat(n,"-step")},d.map(function(f){return m.createElement(_Bt,{prefixCls:n,key:f,value:f,style:i,activeStyle:a})}))},jxe=function(e){var n=e.prefixCls,o=e.style,r=e.start,i=e.end,a=e.index,l=e.onStartMove,s=e.replaceCls,c=m.useContext(jb),u=c.direction,d=c.min,f=c.max,p=c.disabled,g=c.range,y=c.classNames,w="".concat(n,"-track"),b=yue(r,d,f),C=yue(i,d,f),P=function(x){!p&&l&&l(x,-1)},v={};switch(u){case"rtl":v.right="".concat(b*100,"%"),v.width="".concat(C*100-b*100,"%");break;case"btt":v.bottom="".concat(b*100,"%"),v.height="".concat(C*100-b*100,"%");break;case"ttb":v.top="".concat(b*100,"%"),v.height="".concat(C*100-b*100,"%");break;default:v.left="".concat(b*100,"%"),v.width="".concat(C*100-b*100,"%")}var T=s||Vn(w,Vt(Vt({},"".concat(w,"-").concat(a+1),a!==null&&g),"".concat(n,"-track-draggable"),l),y.track);return m.createElement("div",{className:T,style:qt(qt({},v),o),onMouseDown:P,onTouchStart:P})},GBt=function(e){var n=e.prefixCls,o=e.style,r=e.values,i=e.startPoint,a=e.onStartMove,l=m.useContext(jb),s=l.included,c=l.range,u=l.min,d=l.styles,f=l.classNames,p=m.useMemo(function(){if(!c){if(r.length===0)return[];var y=i??u,w=r[0];return[{start:Math.min(y,w),end:Math.max(y,w)}]}for(var b=[],C=0;C3&&arguments[3]!==void 0?arguments[3]:"unit";if(typeof y=="number"){var C,P=g[w],v=P+y,T=[];o.forEach(function(M){T.push(M.value)}),T.push(t,e),T.push(l(P));var A=y>0?1:-1;b==="unit"?T.push(l(P+A*n)):T.push(l(v)),T=T.filter(function(M){return M!==null}).filter(function(M){return y<0?M<=P:M>=P}),b==="unit"&&(T=T.filter(function(M){return M!==P}));var x=b==="unit"?P:v;C=T[0];var S=Math.abs(C-x);if(T.forEach(function(M){var D=Math.abs(M-x);D1){var R=Lo(g);return R[w]=C,p(R,y-A,w,b)}return C}else{if(y==="min")return t;if(y==="max")return e}},u=function(g,y,w){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",C=g[w],P=c(g,y,w,b);return{value:P,changed:P!==C}},d=function(g){return i===null&&g===0||typeof i=="number"&&g3&&arguments[3]!==void 0?arguments[3]:"unit",C=g.map(s),P=C[w],v=c(C,y,w,b);if(C[w]=v,r===!1){var T=i||0;w>0&&C[w-1]!==P&&(C[w]=Math.max(C[w],C[w-1]+T)),w0;R-=1)for(var M=!0;d(C[R]-C[R-1])&&M;){var D=u(C,-1,R-1);C[R-1]=D.value,M=D.changed}for(var E=C.length-1;E>0;E-=1)for(var W=!0;d(C[E]-C[E-1])&&W;){var j=u(C,-1,E-1);C[E-1]=j.value,W=j.changed}for(var L=0;L=0?k:!1},[k,Ie]),ce=m.useMemo(function(){return Object.keys(te||{}).map(function(dt){var Ct=te[dt],tt={value:Number(dt)};return Ct&&hi(Ct)==="object"&&!m.isValidElement(Ct)&&("label"in Ct||"style"in Ct)?(tt.style=Ct.style,tt.label=Ct.label):tt.label=Ct,tt}).filter(function(dt){var Ct=dt.label;return Ct||typeof Ct=="number"}).sort(function(dt,Ct){return dt.value-Ct.value})},[te]),pe=JBt(Se,ze,Ie,ce,j,ye),ve=ln(pe,2),Ae=ve[0],Te=ve[1],Me=zs(A,{value:T}),Pe=ln(Me,2),Ee=Pe[0],Be=Pe[1],Je=m.useMemo(function(){var dt=Ee==null?[]:Array.isArray(Ee)?Ee:[Ee],Ct=ln(dt,1),tt=Ct[0],Fe=tt===void 0?Se:tt,qe=Ee===null?[]:[Fe];if(x){if(qe=Lo(dt),S||Ee===void 0){var je=S>=0?S+1:2;for(qe=qe.slice(0,je);qe.length=0&&he.current.focus(dt)}at(null)},[st]);var Ze=m.useMemo(function(){return N&&Ie===null?!1:N},[N,Ie]),St=function(Ct,tt){ct(Ct,tt),M==null||M(Ke(We.current))},Pt=it!==-1;m.useEffect(function(){if(!Pt){var dt=Je.lastIndexOf(Ve);he.current.focus(dt)}},[Pt]);var Rt=m.useMemo(function(){return Lo(yt).sort(function(dt,Ct){return dt-Ct})},[yt]),Ut=m.useMemo(function(){return x?[Rt[0],Rt[Rt.length-1]]:[Se,Rt[0]]},[Rt,x,Se]),Ht=ln(Ut,2),At=Ht[0],kt=Ht[1];m.useImperativeHandle(e,function(){return{focus:function(){he.current.focus(0)},blur:function(){var Ct,tt=document,Fe=tt.activeElement;(Ct=xe.current)!==null&&Ct!==void 0&&Ct.contains(Fe)&&(Fe==null||Fe.blur())}}}),m.useEffect(function(){f&&he.current.focus(0)},[]);var gt=m.useMemo(function(){return{min:Se,max:ze,direction:He,disabled:c,keyboard:d,step:Ie,included:B,includedStart:At,includedEnd:kt,range:x,tabIndex:fe,ariaLabelForHandle:ge,ariaLabelledByForHandle:de,ariaValueTextFormatterForHandle:Z,styles:l||{},classNames:a||{}}},[Se,ze,He,c,d,Ie,B,At,kt,x,fe,ge,de,Z,l,a]);return m.createElement(jb.Provider,{value:gt},m.createElement("div",{ref:xe,className:Vn(o,r,Vt(Vt(Vt(Vt({},"".concat(o,"-disabled"),c),"".concat(o,"-vertical"),U),"".concat(o,"-horizontal"),!U),"".concat(o,"-with-marks"),ce.length)),style:i,onMouseDown:ut},m.createElement("div",{className:Vn("".concat(o,"-rail"),a==null?void 0:a.rail),style:qt(qt({},Q),l==null?void 0:l.rail)}),m.createElement(GBt,{prefixCls:o,style:X,values:Rt,startPoint:_,onStartMove:Ze?St:void 0}),m.createElement(VBt,{prefixCls:o,marks:ce,dots:re,style:le,activeStyle:q}),m.createElement(BBt,{ref:he,prefixCls:o,style:$,values:yt,draggingIndex:it,onStartMove:St,onOffsetChange:Oe,onFocus:p,onBlur:g,handleRender:ae,activeHandleRender:se,onChangeComplete:De}),m.createElement(OBt,{prefixCls:o,marks:ce,onClick:Xe})))});const Yxe=m.forwardRef((t,e)=>{const{open:n}=t,o=m.useRef(null),r=m.useRef(null);function i(){Dg.cancel(r.current),r.current=null}function a(){r.current=Dg(()=>{var l;(l=o.current)===null||l===void 0||l.forceAlign(),r.current=null})}return m.useEffect(()=>(n?a():i(),i),[n,t.title]),m.createElement(tA,Object.assign({ref:o5(o,e)},t))}),qBt=t=>{const{componentCls:e,antCls:n,controlSize:o,dotSize:r,marginFull:i,marginPart:a,colorFillContentHover:l,handleColorDisabled:s,calc:c}=t;return{[e]:Object.assign(Object.assign({},ja(t)),{position:"relative",height:o,margin:`${Nt(a)} ${Nt(i)}`,padding:0,cursor:"pointer",touchAction:"none","&-vertical":{margin:`${Nt(i)} ${Nt(a)}`},[`${e}-rail`]:{position:"absolute",backgroundColor:t.railBg,borderRadius:t.borderRadiusXS,transition:`background-color ${t.motionDurationMid}`},[`${e}-track,${e}-tracks`]:{position:"absolute",transition:`background-color ${t.motionDurationMid}`},[`${e}-track`]:{backgroundColor:t.trackBg,borderRadius:t.borderRadiusXS},[`${e}-track-draggable`]:{boxSizing:"content-box",backgroundClip:"content-box",border:"solid rgba(0,0,0,0)"},"&:hover":{[`${e}-rail`]:{backgroundColor:t.railHoverBg},[`${e}-track`]:{backgroundColor:t.trackHoverBg},[`${e}-dot`]:{borderColor:l},[`${e}-handle::after`]:{boxShadow:`0 0 0 ${Nt(t.handleLineWidth)} ${t.colorPrimaryBorderHover}`},[`${e}-dot-active`]:{borderColor:t.dotActiveBorderColor}},[`${e}-handle`]:{position:"absolute",width:t.handleSize,height:t.handleSize,outline:"none","&::before":{content:'""',position:"absolute",insetInlineStart:c(t.handleLineWidth).mul(-1).equal(),insetBlockStart:c(t.handleLineWidth).mul(-1).equal(),width:c(t.handleSize).add(c(t.handleLineWidth).mul(2)).equal(),height:c(t.handleSize).add(c(t.handleLineWidth).mul(2)).equal(),backgroundColor:"transparent"},"&::after":{content:'""',position:"absolute",insetBlockStart:0,insetInlineStart:0,width:t.handleSize,height:t.handleSize,backgroundColor:t.colorBgElevated,boxShadow:`0 0 0 ${Nt(t.handleLineWidth)} ${t.handleColor}`,borderRadius:"50%",cursor:"pointer",transition:` + `]:{display:"inline-block",minWidth:t.itemSize,height:t.itemSize,color:t.colorText,fontFamily:t.fontFamily,lineHeight:`${Nt(t.itemSize)}`,textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:t.borderRadius,cursor:"pointer",transition:`all ${t.motionDurationMid}`},[`${e}-prev, ${e}-next`]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:t.colorText,cursor:"pointer",userSelect:"none"},[`${e}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:t.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${Nt(t.lineWidth)} ${t.lineType} transparent`,borderRadius:t.borderRadius,outline:"none",transition:`all ${t.motionDurationMid}`},[`&:hover ${e}-item-link`]:{backgroundColor:t.colorBgTextHover},[`&:active ${e}-item-link`]:{backgroundColor:t.colorBgTextActive},[`&${e}-disabled:hover`]:{[`${e}-item-link`]:{backgroundColor:"transparent"}}},[`${e}-slash`]:{marginInlineEnd:t.paginationSlashMarginInlineEnd,marginInlineStart:t.paginationSlashMarginInlineStart},[`${e}-options`]:{display:"inline-block",marginInlineStart:t.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:t.controlHeight,marginInlineStart:t.marginXS,lineHeight:Nt(t.controlHeight),verticalAlign:"top",input:Object.assign(Object.assign(Object.assign({},KW(t)),Qme(t,{borderColor:t.colorBorder,hoverBorderColor:t.colorPrimaryHover,activeBorderColor:t.colorPrimary,activeShadow:t.activeShadow})),{"&[disabled]":Object.assign({},aQ(t)),width:t.calc(t.controlHeightLG).mul(1.25).equal(),height:t.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:t.marginXS,marginInlineEnd:t.marginXS})}}}},dBt=t=>{const{componentCls:e}=t;return{[`${e}-item`]:{display:"inline-block",minWidth:t.itemSize,height:t.itemSize,marginInlineEnd:t.marginXS,fontFamily:t.fontFamily,lineHeight:Nt(t.calc(t.itemSize).sub(2).equal()),textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:`${Nt(t.lineWidth)} ${t.lineType} transparent`,borderRadius:t.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${Nt(t.paginationItemPaddingInline)}`,color:t.colorText,"&:hover":{textDecoration:"none"}},[`&:not(${e}-item-active)`]:{"&:hover":{transition:`all ${t.motionDurationMid}`,backgroundColor:t.colorBgTextHover},"&:active":{backgroundColor:t.colorBgTextActive}},"&-active":{fontWeight:t.fontWeightStrong,backgroundColor:t.itemActiveBg,borderColor:t.colorPrimary,a:{color:t.colorPrimary},"&:hover":{borderColor:t.colorPrimaryHover},"&:hover a":{color:t.colorPrimaryHover}}}}},fBt=t=>{const{componentCls:e}=t;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${e}-total-text`]:{display:"inline-block",height:t.itemSize,marginInlineEnd:t.marginXS,lineHeight:Nt(t.calc(t.itemSize).sub(2).equal()),verticalAlign:"middle"}}),dBt(t)),uBt(t)),cBt(t)),sBt(t)),lBt(t)),{[`@media only screen and (max-width: ${t.screenLG}px)`]:{[`${e}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${t.screenSM}px)`]:{[`${e}-options`]:{display:"none"}}}),[`&${t.componentCls}-rtl`]:{direction:"rtl"}}},hBt=t=>{const{componentCls:e}=t;return{[`${e}:not(${e}-disabled)`]:{[`${e}-item`]:Object.assign({},Q6(t)),[`${e}-jump-prev, ${e}-jump-next`]:{"&:focus-visible":Object.assign({[`${e}-item-link-icon`]:{opacity:1},[`${e}-item-ellipsis`]:{opacity:0}},lw(t))},[`${e}-prev, ${e}-next`]:{[`&:focus-visible ${e}-item-link`]:Object.assign({},lw(t))}}}},GJe=t=>Object.assign({itemBg:t.colorBgContainer,itemSize:t.controlHeight,itemSizeSM:t.controlHeightSM,itemActiveBg:t.colorBgContainer,itemLinkBg:t.colorBgContainer,itemActiveColorDisabled:t.colorTextDisabled,itemActiveBgDisabled:t.controlItemBgActiveDisabled,itemInputBg:t.colorBgContainer,miniOptionsSizeChangerTop:0},JW(t)),XJe=t=>Ki(t,{inputOutlineOffset:0,paginationMiniOptionsMarginInlineStart:t.calc(t.marginXXS).div(2).equal(),paginationMiniQuickJumperInputWidth:t.calc(t.controlHeightLG).mul(1.1).equal(),paginationItemPaddingInline:t.calc(t.marginXXS).mul(1.5).equal(),paginationEllipsisLetterSpacing:t.calc(t.marginXXS).div(2).equal(),paginationSlashMarginInlineStart:t.marginXXS,paginationSlashMarginInlineEnd:t.marginSM,paginationEllipsisTextIndent:"0.13em"},XW(t)),pBt=wl("Pagination",t=>{const e=XJe(t);return[fBt(e),hBt(e)]},GJe),gBt=t=>{const{componentCls:e}=t;return{[`${e}${e}-bordered${e}-disabled:not(${e}-mini)`]:{"&, &:hover":{[`${e}-item-link`]:{borderColor:t.colorBorder}},"&:focus-visible":{[`${e}-item-link`]:{borderColor:t.colorBorder}},[`${e}-item, ${e}-item-link`]:{backgroundColor:t.colorBgContainerDisabled,borderColor:t.colorBorder,[`&:hover:not(${e}-item-active)`]:{backgroundColor:t.colorBgContainerDisabled,borderColor:t.colorBorder,a:{color:t.colorTextDisabled}},[`&${e}-item-active`]:{backgroundColor:t.itemActiveBgDisabled}},[`${e}-prev, ${e}-next`]:{"&:hover button":{backgroundColor:t.colorBgContainerDisabled,borderColor:t.colorBorder,color:t.colorTextDisabled},[`${e}-item-link`]:{backgroundColor:t.colorBgContainerDisabled,borderColor:t.colorBorder}}},[`${e}${e}-bordered:not(${e}-mini)`]:{[`${e}-prev, ${e}-next`]:{"&:hover button":{borderColor:t.colorPrimaryHover,backgroundColor:t.itemBg},[`${e}-item-link`]:{backgroundColor:t.itemLinkBg,borderColor:t.colorBorder},[`&:hover ${e}-item-link`]:{borderColor:t.colorPrimary,backgroundColor:t.itemBg,color:t.colorPrimary},[`&${e}-disabled`]:{[`${e}-item-link`]:{borderColor:t.colorBorder,color:t.colorTextDisabled}}},[`${e}-item`]:{backgroundColor:t.itemBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,[`&:hover:not(${e}-item-active)`]:{borderColor:t.colorPrimary,backgroundColor:t.itemBg,a:{color:t.colorPrimary}},"&-active":{borderColor:t.colorPrimary}}}}},mBt=zW(["Pagination","bordered"],t=>{const e=XJe(t);return[gBt(e)]},GJe);var yBt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:e,selectPrefixCls:n,className:o,rootClassName:r,style:i,size:a,locale:l,selectComponentClass:s,responsive:c,showSizeChanger:u}=t,d=yBt(t,["prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","selectComponentClass","responsive","showSizeChanger"]),{xs:f}=X$(c),[,p]=_u(),{getPrefixCls:g,direction:y,pagination:w={}}=m.useContext(Cr),b=g("pagination",e),[C,P,v]=pBt(b),T=u??w.showSizeChanger,A=m.useMemo(()=>{const j=m.createElement("span",{className:`${b}-item-ellipsis`},"•••"),L=m.createElement("button",{className:`${b}-item-link`,type:"button",tabIndex:-1},y==="rtl"?m.createElement(UG,null):m.createElement(Xve,null)),k=m.createElement("button",{className:`${b}-item-link`,type:"button",tabIndex:-1},y==="rtl"?m.createElement(Xve,null):m.createElement(UG,null)),N=m.createElement("a",{className:`${b}-item-link`},m.createElement("div",{className:`${b}-item-container`},y==="rtl"?m.createElement(Lxe,{className:`${b}-item-link-icon`}):m.createElement(kxe,{className:`${b}-item-link-icon`}),j)),F=m.createElement("a",{className:`${b}-item-link`},m.createElement("div",{className:`${b}-item-container`},y==="rtl"?m.createElement(kxe,{className:`${b}-item-link-icon`}):m.createElement(Lxe,{className:`${b}-item-link-icon`}),j));return{prevIcon:L,nextIcon:k,jumpPrevIcon:N,jumpNextIcon:F}},[y,b]),[x]=kw("Pagination",h_e),S=Object.assign(Object.assign({},x),l),R=Ed(a),M=R==="small"||!!(f&&!R&&c),D=g("select",n),E=Un({[`${b}-mini`]:M,[`${b}-rtl`]:y==="rtl",[`${b}-bordered`]:p.wireframe},w==null?void 0:w.className,o,r,P,v),W=Object.assign(Object.assign({},w==null?void 0:w.style),i);return C(m.createElement(m.Fragment,null,p.wireframe&&m.createElement(mBt,{prefixCls:b}),m.createElement(aBt,Object.assign({},A,d,{style:W,prefixCls:b,selectPrefixCls:D,className:E,selectComponentClass:s||(M?_Je:VJe),locale:S,showSizeChanger:T}))))},dye=be.createContext({});dye.Consumer;var KJe=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var{prefixCls:e,className:n,avatar:o,title:r,description:i}=t,a=KJe(t,["prefixCls","className","avatar","title","description"]);const{getPrefixCls:l}=m.useContext(Cr),s=l("list",e),c=Un(`${s}-item-meta`,n),u=be.createElement("div",{className:`${s}-item-meta-content`},r&&be.createElement("h4",{className:`${s}-item-meta-title`},r),i&&be.createElement("div",{className:`${s}-item-meta-description`},i));return be.createElement("div",Object.assign({},a,{className:c}),o&&be.createElement("div",{className:`${s}-item-meta-avatar`},o),(r||i)&&u)},wBt=be.forwardRef((t,e)=>{const{prefixCls:n,children:o,actions:r,extra:i,className:a,colStyle:l}=t,s=KJe(t,["prefixCls","children","actions","extra","className","colStyle"]),{grid:c,itemLayout:u}=m.useContext(dye),{getPrefixCls:d}=m.useContext(Cr),f=()=>{let C;return m.Children.forEach(o,P=>{typeof P=="string"&&(C=!0)}),C&&m.Children.count(o)>1},p=()=>u==="vertical"?!!i:!f(),g=d("list",n),y=r&&r.length>0&&be.createElement("ul",{className:`${g}-item-action`,key:"actions"},r.map((C,P)=>be.createElement("li",{key:`${g}-item-action-${P}`},C,P!==r.length-1&&be.createElement("em",{className:`${g}-item-action-split`})))),w=c?"div":"li",b=be.createElement(w,Object.assign({},s,c?{}:{ref:e},{className:Un(`${g}-item`,{[`${g}-item-no-flex`]:!p()},a)}),u==="vertical"&&i?[be.createElement("div",{className:`${g}-item-main`,key:"content"},o,y),be.createElement("div",{className:`${g}-item-extra`,key:"extra"},i)]:[o,y,B0(i,{key:"extra"})]);return c?be.createElement(nt,{ref:e,flex:1,style:l},b):b}),qJe=wBt;qJe.Meta=ABt;const vBt=t=>{const{listBorderedCls:e,componentCls:n,paddingLG:o,margin:r,itemPaddingSM:i,itemPaddingLG:a,marginLG:l,borderRadiusLG:s}=t;return{[`${e}`]:{border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderRadius:s,[`${n}-header,${n}-footer,${n}-item`]:{paddingInline:o},[`${n}-pagination`]:{margin:`${Nt(r)} ${Nt(l)}`}},[`${e}${n}-sm`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:i}},[`${e}${n}-lg`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:a}}}},xBt=t=>{const{componentCls:e,screenSM:n,screenMD:o,marginLG:r,marginSM:i,margin:a}=t;return{[`@media screen and (max-width:${o}px)`]:{[`${e}`]:{[`${e}-item`]:{[`${e}-item-action`]:{marginInlineStart:r}}},[`${e}-vertical`]:{[`${e}-item`]:{[`${e}-item-extra`]:{marginInlineStart:r}}}},[`@media screen and (max-width: ${n}px)`]:{[`${e}`]:{[`${e}-item`]:{flexWrap:"wrap",[`${e}-action`]:{marginInlineStart:i}}},[`${e}-vertical`]:{[`${e}-item`]:{flexWrap:"wrap-reverse",[`${e}-item-main`]:{minWidth:t.contentWidth},[`${e}-item-extra`]:{margin:`auto auto ${Nt(a)}`}}}}}},bBt=t=>{const{componentCls:e,antCls:n,controlHeight:o,minHeight:r,paddingSM:i,marginLG:a,padding:l,itemPadding:s,colorPrimary:c,itemPaddingSM:u,itemPaddingLG:d,paddingXS:f,margin:p,colorText:g,colorTextDescription:y,motionDurationSlow:w,lineWidth:b,headerBg:C,footerBg:P,emptyTextPadding:v,metaMarginBottom:T,avatarMarginRight:A,titleMarginBottom:x,descriptionFontSize:S}=t,R={};return["start","center","end"].forEach(M=>{R[`&-align-${M}`]={textAlign:M}}),{[`${e}`]:Object.assign(Object.assign({},ja(t)),{position:"relative","*":{outline:"none"},[`${e}-header`]:{background:C},[`${e}-footer`]:{background:P},[`${e}-header, ${e}-footer`]:{paddingBlock:i},[`${e}-pagination`]:Object.assign(Object.assign({marginBlockStart:a},R),{[`${n}-pagination-options`]:{textAlign:"start"}}),[`${e}-spin`]:{minHeight:r,textAlign:"center"},[`${e}-items`]:{margin:0,padding:0,listStyle:"none"},[`${e}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:s,color:g,[`${e}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${e}-item-meta-avatar`]:{marginInlineEnd:A},[`${e}-item-meta-content`]:{flex:"1 0",width:0,color:g},[`${e}-item-meta-title`]:{margin:`0 0 ${Nt(t.marginXXS)} 0`,color:g,fontSize:t.fontSize,lineHeight:t.lineHeight,"> a":{color:g,transition:`all ${w}`,"&:hover":{color:c}}},[`${e}-item-meta-description`]:{color:y,fontSize:S,lineHeight:t.lineHeight}},[`${e}-item-action`]:{flex:"0 0 auto",marginInlineStart:t.marginXXL,padding:0,fontSize:0,listStyle:"none","& > li":{position:"relative",display:"inline-block",padding:`0 ${Nt(f)}`,color:y,fontSize:t.fontSize,lineHeight:t.lineHeight,textAlign:"center","&:first-child":{paddingInlineStart:0}},[`${e}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:b,height:t.calc(t.fontHeight).sub(t.calc(t.marginXXS).mul(2)).equal(),transform:"translateY(-50%)",backgroundColor:t.colorSplit}}},[`${e}-empty`]:{padding:`${Nt(l)} 0`,color:y,fontSize:t.fontSizeSM,textAlign:"center"},[`${e}-empty-text`]:{padding:v,color:t.colorTextDisabled,fontSize:t.fontSize,textAlign:"center"},[`${e}-item-no-flex`]:{display:"block"}}),[`${e}-grid ${n}-col > ${e}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:p,paddingBlock:0,borderBlockEnd:"none"},[`${e}-vertical ${e}-item`]:{alignItems:"initial",[`${e}-item-main`]:{display:"block",flex:1},[`${e}-item-extra`]:{marginInlineStart:a},[`${e}-item-meta`]:{marginBlockEnd:T,[`${e}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:x,color:g,fontSize:t.fontSizeLG,lineHeight:t.lineHeightLG}},[`${e}-item-action`]:{marginBlockStart:l,marginInlineStart:"auto","> li":{padding:`0 ${Nt(l)}`,"&:first-child":{paddingInlineStart:0}}}},[`${e}-split ${e}-item`]:{borderBlockEnd:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`,"&:last-child":{borderBlockEnd:"none"}},[`${e}-split ${e}-header`]:{borderBlockEnd:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-split${e}-empty ${e}-footer`]:{borderTop:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-loading ${e}-spin-nested-loading`]:{minHeight:o},[`${e}-split${e}-something-after-last-item ${n}-spin-container > ${e}-items > ${e}-item:last-child`]:{borderBlockEnd:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-lg ${e}-item`]:{padding:d},[`${e}-sm ${e}-item`]:{padding:u},[`${e}:not(${e}-vertical)`]:{[`${e}-item-no-flex`]:{[`${e}-item-action`]:{float:"right"}}}}},SBt=t=>({contentWidth:220,itemPadding:`${Nt(t.paddingContentVertical)} 0`,itemPaddingSM:`${Nt(t.paddingContentVerticalSM)} ${Nt(t.paddingContentHorizontal)}`,itemPaddingLG:`${Nt(t.paddingContentVerticalLG)} ${Nt(t.paddingContentHorizontalLG)}`,headerBg:"transparent",footerBg:"transparent",emptyTextPadding:t.padding,metaMarginBottom:t.padding,avatarMarginRight:t.padding,titleMarginBottom:t.paddingSM,descriptionFontSize:t.fontSize}),TBt=wl("List",t=>{const e=Ki(t,{listBorderedCls:`${t.componentCls}-bordered`,minHeight:t.controlHeightLG});return[bBt(e),vBt(e),xBt(e)]},SBt);var PBt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r(Ie,ye)=>{var ce;S(Ie),M(ye),n&&n[ze]&&((ce=n==null?void 0:n[ze])===null||ce===void 0||ce.call(n,Ie,ye))},N=k("onChange"),F=k("onShowSizeChange"),U=(ze,Ie)=>{if(!P)return null;let ye;return typeof C=="function"?ye=C(ze):C?ye=ze[C]:ye=ze.key,ye||(ye=`list-item-${Ie}`),m.createElement(m.Fragment,{key:ye},P(ze,Ie))},O=()=>!!(d||n||w),B=D("list",o),[_,X,$]=TBt(B);let Q=b;typeof Q=="boolean"&&(Q={spinning:Q});const le=Q&&Q.spinning,q=Ed(g);let te="";switch(q){case"large":te="lg";break;case"small":te="sm";break}const re=Un(B,{[`${B}-vertical`]:u==="vertical",[`${B}-${te}`]:te,[`${B}-split`]:i,[`${B}-bordered`]:r,[`${B}-loading`]:le,[`${B}-grid`]:!!f,[`${B}-something-after-last-item`]:O(),[`${B}-rtl`]:W==="rtl"},j==null?void 0:j.className,a,l,X,$),ae=OJe(L,{total:p.length,current:x,pageSize:R},n||{}),se=Math.ceil(ae.total/ae.pageSize);ae.current>se&&(ae.current=se);const ne=n?m.createElement("div",{className:Un(`${B}-pagination`,`${B}-pagination-align-${(e=ae==null?void 0:ae.align)!==null&&e!==void 0?e:"end"}`)},m.createElement(JJe,Object.assign({},ae,{onChange:N,onShowSizeChange:F}))):null;let fe=Za(p);n&&p.length>(ae.current-1)*ae.pageSize&&(fe=Za(p).splice((ae.current-1)*ae.pageSize,ae.pageSize));const ge=Object.keys(f||{}).some(ze=>["xs","sm","md","lg","xl","xxl"].includes(ze)),de=X$(ge),Z=m.useMemo(()=>{for(let ze=0;ze{if(!f)return;const ze=Z&&f[Z]?f[Z]:f.column;if(ze)return{width:`${100/ze}%`,maxWidth:`${100/ze}%`}},[JSON.stringify(f),Z]);let xe=le&&m.createElement("div",{style:{minHeight:53}});if(fe.length>0){const ze=fe.map((Ie,ye)=>U(Ie,ye));xe=f?m.createElement(on,{gutter:f.gutter},m.Children.map(ze,Ie=>m.createElement("div",{key:Ie==null?void 0:Ie.key,style:he},Ie))):m.createElement("ul",{className:`${B}-items`},ze)}else!c&&!le&&(xe=m.createElement("div",{className:`${B}-empty-text`},v&&v.emptyText||(E==null?void 0:E("List"))||m.createElement(Eme,{componentName:"List"})));const He=ae.position||"bottom",Se=m.useMemo(()=>({grid:f,itemLayout:u}),[JSON.stringify(f),u]);return _(m.createElement(dye.Provider,{value:Se},m.createElement("div",Object.assign({style:Object.assign(Object.assign({},j==null?void 0:j.style),s),className:re},T),(He==="top"||He==="both")&&ne,y&&m.createElement("div",{className:`${B}-header`},y),m.createElement($W,Object.assign({},Q),xe,c),w&&m.createElement("div",{className:`${B}-footer`},w),d||(He==="bottom"||He==="both")&&ne)))}mue.Item=qJe;let Cm=null,Bv=t=>t(),uk=[],dk={};function Uxe(){const{getContainer:t,duration:e,rtl:n,maxCount:o,top:r}=dk,i=(t==null?void 0:t())||document.body;return{getContainer:()=>i,duration:e,rtl:n,maxCount:o,top:r}}const CBt=be.forwardRef((t,e)=>{const{messageConfig:n,sync:o}=t,{getPrefixCls:r}=m.useContext(Cr),i=dk.prefixCls||r("message"),a=m.useContext(OIt),[l,s]=bVe(Object.assign(Object.assign(Object.assign({},n),{prefixCls:i}),a.message));return be.useImperativeHandle(e,()=>{const c=Object.assign({},l);return Object.keys(c).forEach(u=>{c[u]=function(){return o(),l[u].apply(l,arguments)}}),{instance:c,sync:o}}),s}),RBt=be.forwardRef((t,e)=>{const[n,o]=be.useState(Uxe),r=()=>{o(Uxe)};be.useEffect(r,[]);const i=rVe(),a=i.getRootPrefixCls(),l=i.getIconPrefixCls(),s=i.getTheme(),c=be.createElement(CBt,{ref:e,sync:r,messageConfig:n});return be.createElement(fy,{prefixCls:a,iconPrefixCls:l,theme:s},i.holderRender?i.holderRender(c):c)});function uQ(){if(!Cm){const t=document.createDocumentFragment(),e={fragment:t};Cm=e,Bv(()=>{xme(be.createElement(RBt,{ref:n=>{const{instance:o,sync:r}=n||{};Promise.resolve().then(()=>{!e.instance&&o&&(e.instance=o,e.sync=r,uQ())})}}),t)});return}Cm.instance&&(uk.forEach(t=>{const{type:e,skipped:n}=t;if(!n)switch(e){case"open":{Bv(()=>{const o=Cm.instance.open(Object.assign(Object.assign({},dk),t.config));o==null||o.then(t.resolve),t.setCloseFn(o)});break}case"destroy":Bv(()=>{Cm==null||Cm.instance.destroy(t.key)});break;default:Bv(()=>{var o;const r=(o=Cm.instance)[e].apply(o,Za(t.args));r==null||r.then(t.resolve),t.setCloseFn(r)})}}),uk=[])}function HBt(t){dk=Object.assign(Object.assign({},dk),t),Bv(()=>{var e;(e=Cm==null?void 0:Cm.sync)===null||e===void 0||e.call(Cm)})}function MBt(t){const e=vme(n=>{let o;const r={type:"open",config:t,resolve:n,setCloseFn:i=>{o=i}};return uk.push(r),()=>{o?Bv(()=>{o()}):r.skipped=!0}});return uQ(),e}function IBt(t,e){const n=vme(o=>{let r;const i={type:t,args:e,resolve:o,setCloseFn:a=>{r=a}};return uk.push(i),()=>{r?Bv(()=>{r()}):i.skipped=!0}});return uQ(),n}const zBt=t=>{uk.push({type:"destroy",key:t}),uQ()},DBt=["success","info","warning","error","loading"],EBt={open:MBt,destroy:zBt,config:HBt,useMessage:HRt,_InternalPanelDoNotUseOrYouWillBeFired:vRt},nA=EBt;DBt.forEach(t=>{nA[t]=function(){for(var e=arguments.length,n=new Array(e),o=0;o{const{prefixCls:e,className:n,closeIcon:o,closable:r,type:i,title:a,children:l,footer:s}=t,c=FBt(t,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:u}=m.useContext(Cr),d=u(),f=e||u("modal"),p=O0(d),[g,y,w]=iGe(f,p),b=`${f}-confirm`;let C={};return i?C={closable:r??!1,title:"",footer:"",children:m.createElement(lGe,Object.assign({},t,{prefixCls:f,confirmPrefixCls:b,rootPrefixCls:d,content:l}))}:C={closable:r??!0,title:a,footer:s!==null&&m.createElement(nGe,Object.assign({},t)),children:l},g(m.createElement(UVe,Object.assign({prefixCls:f,className:Un(y,`${f}-pure-panel`,i&&b,i&&`${b}-${i}`,n,w,p)},c,{closeIcon:tGe(f,o),closable:r},C)))},LBt=mGe(kBt);function $Je(t){return BW(dGe(t))}const Oi=aGe;Oi.useModal=YIt;Oi.info=function(e){return BW(fGe(e))};Oi.success=function(e){return BW(hGe(e))};Oi.error=function(e){return BW(pGe(e))};Oi.warning=$Je;Oi.warn=$Je;Oi.confirm=function(e){return BW(gGe(e))};Oi.destroyAll=function(){for(;Nv.length;){const e=Nv.pop();e&&e()}};Oi.config=WIt;Oi._InternalPanelDoNotUseOrYouWillBeFired=LBt;var WBt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"},NBt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:WBt}))},Hf=m.forwardRef(NBt);function yue(t,e,n){return(t-e)/(n-e)}function fye(t,e,n,o){var r=yue(e,n,o),i={};switch(t){case"rtl":i.right="".concat(r*100,"%"),i.transform="translateX(50%)";break;case"btt":i.bottom="".concat(r*100,"%"),i.transform="translateY(50%)";break;case"ttb":i.top="".concat(r*100,"%"),i.transform="translateY(-50%)";break;default:i.left="".concat(r*100,"%"),i.transform="translateX(-50%)";break}return i}function eC(t,e){return Array.isArray(t)?t[e]:t}var jb=m.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0,styles:{},classNames:{}}),UBt=["prefixCls","value","valueIndex","onStartMove","style","render","dragging","onOffsetChange","onChangeComplete","onFocus","onMouseEnter"],jxe=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.value,r=t.valueIndex,i=t.onStartMove,a=t.style,l=t.render,s=t.dragging,c=t.onOffsetChange,u=t.onChangeComplete,d=t.onFocus,f=t.onMouseEnter,p=ii(t,UBt),g=m.useContext(jb),y=g.min,w=g.max,b=g.direction,C=g.disabled,P=g.keyboard,v=g.range,T=g.tabIndex,A=g.ariaLabelForHandle,x=g.ariaLabelledByForHandle,S=g.ariaValueTextFormatterForHandle,R=g.styles,M=g.classNames,D="".concat(n,"-handle"),E=function(_){C||i(_,r)},W=function(_){d==null||d(_,r)},j=function(_){f(_,r)},L=function(_){if(!C&&P){var X=null;switch(_.which||_.keyCode){case Bn.LEFT:X=b==="ltr"||b==="btt"?-1:1;break;case Bn.RIGHT:X=b==="ltr"||b==="btt"?1:-1;break;case Bn.UP:X=b!=="ttb"?1:-1;break;case Bn.DOWN:X=b!=="ttb"?-1:1;break;case Bn.HOME:X="min";break;case Bn.END:X="max";break;case Bn.PAGE_UP:X=2;break;case Bn.PAGE_DOWN:X=-2;break}X!==null&&(_.preventDefault(),c(X,r))}},k=function(_){switch(_.which||_.keyCode){case Bn.LEFT:case Bn.RIGHT:case Bn.UP:case Bn.DOWN:case Bn.HOME:case Bn.END:case Bn.PAGE_UP:case Bn.PAGE_DOWN:u==null||u();break}},N=fye(b,o,y,w),F={};if(r!==null){var U;F={tabIndex:C?null:eC(T,r),role:"slider","aria-valuemin":y,"aria-valuemax":w,"aria-valuenow":o,"aria-disabled":C,"aria-label":eC(A,r),"aria-labelledby":eC(x,r),"aria-valuetext":(U=eC(S,r))===null||U===void 0?void 0:U(o),"aria-orientation":b==="ltr"||b==="rtl"?"horizontal":"vertical",onMouseDown:E,onTouchStart:E,onFocus:W,onMouseEnter:j,onKeyDown:L,onKeyUp:k}}var O=m.createElement("div",ho({ref:e,className:Vn(D,Vt(Vt({},"".concat(D,"-").concat(r+1),r!==null&&v),"".concat(D,"-dragging"),s),M.handle),style:qt(qt(qt({},N),a),R.handle)},F,p));return l&&(O=l(O,{index:r,prefixCls:n,value:o,dragging:s})),O}),jBt=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","activeHandleRender","draggingIndex","onFocus"],BBt=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.style,r=t.onStartMove,i=t.onOffsetChange,a=t.values,l=t.handleRender,s=t.activeHandleRender,c=t.draggingIndex,u=t.onFocus,d=ii(t,jBt),f=m.useRef({});m.useImperativeHandle(e,function(){return{focus:function(T){var A;(A=f.current[T])===null||A===void 0||A.focus()}}});var p=m.useState(-1),g=ln(p,2),y=g[0],w=g[1],b=function(T,A){w(A),u==null||u(T)},C=function(T,A){w(A)},P=qt({prefixCls:n,onStartMove:r,onOffsetChange:i,render:l,onFocus:b,onMouseEnter:C},d);return m.createElement(m.Fragment,null,a.map(function(v,T){return m.createElement(jxe,ho({ref:function(x){x?f.current[T]=x:delete f.current[T]},dragging:c===T,style:eC(o,T),key:T,value:v,valueIndex:T},P))}),s&&m.createElement(jxe,ho({key:"a11y"},P,{value:a[y],valueIndex:null,dragging:c!==-1,render:s,style:{pointerEvents:"none"},tabIndex:null,"aria-hidden":!0})))}),YBt=function(e){var n=e.prefixCls,o=e.style,r=e.children,i=e.value,a=e.onClick,l=m.useContext(jb),s=l.min,c=l.max,u=l.direction,d=l.includedStart,f=l.includedEnd,p=l.included,g="".concat(n,"-text"),y=fye(u,i,s,c);return m.createElement("span",{className:Vn(g,Vt({},"".concat(g,"-active"),p&&d<=i&&i<=f)),style:qt(qt({},y),o),onMouseDown:function(b){b.stopPropagation()},onClick:function(){a(i)}},r)},OBt=function(e){var n=e.prefixCls,o=e.marks,r=e.onClick,i="".concat(n,"-mark");return o.length?m.createElement("div",{className:i},o.map(function(a){var l=a.value,s=a.style,c=a.label;return m.createElement(YBt,{key:l,prefixCls:i,style:s,value:l,onClick:r},c)})):null},_Bt=function(e){var n=e.prefixCls,o=e.value,r=e.style,i=e.activeStyle,a=m.useContext(jb),l=a.min,s=a.max,c=a.direction,u=a.included,d=a.includedStart,f=a.includedEnd,p="".concat(n,"-dot"),g=u&&d<=o&&o<=f,y=qt(qt({},fye(c,o,l,s)),typeof r=="function"?r(o):r);return g&&(y=qt(qt({},y),typeof i=="function"?i(o):i)),m.createElement("span",{className:Vn(p,Vt({},"".concat(p,"-active"),g)),style:y})},VBt=function(e){var n=e.prefixCls,o=e.marks,r=e.dots,i=e.style,a=e.activeStyle,l=m.useContext(jb),s=l.min,c=l.max,u=l.step,d=m.useMemo(function(){var f=new Set;if(o.forEach(function(g){f.add(g.value)}),r&&u!==null)for(var p=s;p<=c;)f.add(p),p+=u;return Array.from(f)},[s,c,u,r,o]);return m.createElement("div",{className:"".concat(n,"-step")},d.map(function(f){return m.createElement(_Bt,{prefixCls:n,key:f,value:f,style:i,activeStyle:a})}))},Bxe=function(e){var n=e.prefixCls,o=e.style,r=e.start,i=e.end,a=e.index,l=e.onStartMove,s=e.replaceCls,c=m.useContext(jb),u=c.direction,d=c.min,f=c.max,p=c.disabled,g=c.range,y=c.classNames,w="".concat(n,"-track"),b=yue(r,d,f),C=yue(i,d,f),P=function(x){!p&&l&&l(x,-1)},v={};switch(u){case"rtl":v.right="".concat(b*100,"%"),v.width="".concat(C*100-b*100,"%");break;case"btt":v.bottom="".concat(b*100,"%"),v.height="".concat(C*100-b*100,"%");break;case"ttb":v.top="".concat(b*100,"%"),v.height="".concat(C*100-b*100,"%");break;default:v.left="".concat(b*100,"%"),v.width="".concat(C*100-b*100,"%")}var T=s||Vn(w,Vt(Vt({},"".concat(w,"-").concat(a+1),a!==null&&g),"".concat(n,"-track-draggable"),l),y.track);return m.createElement("div",{className:T,style:qt(qt({},v),o),onMouseDown:P,onTouchStart:P})},GBt=function(e){var n=e.prefixCls,o=e.style,r=e.values,i=e.startPoint,a=e.onStartMove,l=m.useContext(jb),s=l.included,c=l.range,u=l.min,d=l.styles,f=l.classNames,p=m.useMemo(function(){if(!c){if(r.length===0)return[];var y=i??u,w=r[0];return[{start:Math.min(y,w),end:Math.max(y,w)}]}for(var b=[],C=0;C3&&arguments[3]!==void 0?arguments[3]:"unit";if(typeof y=="number"){var C,P=g[w],v=P+y,T=[];o.forEach(function(M){T.push(M.value)}),T.push(t,e),T.push(l(P));var A=y>0?1:-1;b==="unit"?T.push(l(P+A*n)):T.push(l(v)),T=T.filter(function(M){return M!==null}).filter(function(M){return y<0?M<=P:M>=P}),b==="unit"&&(T=T.filter(function(M){return M!==P}));var x=b==="unit"?P:v;C=T[0];var S=Math.abs(C-x);if(T.forEach(function(M){var D=Math.abs(M-x);D1){var R=Lo(g);return R[w]=C,p(R,y-A,w,b)}return C}else{if(y==="min")return t;if(y==="max")return e}},u=function(g,y,w){var b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",C=g[w],P=c(g,y,w,b);return{value:P,changed:P!==C}},d=function(g){return i===null&&g===0||typeof i=="number"&&g3&&arguments[3]!==void 0?arguments[3]:"unit",C=g.map(s),P=C[w],v=c(C,y,w,b);if(C[w]=v,r===!1){var T=i||0;w>0&&C[w-1]!==P&&(C[w]=Math.max(C[w],C[w-1]+T)),w0;R-=1)for(var M=!0;d(C[R]-C[R-1])&&M;){var D=u(C,-1,R-1);C[R-1]=D.value,M=D.changed}for(var E=C.length-1;E>0;E-=1)for(var W=!0;d(C[E]-C[E-1])&&W;){var j=u(C,-1,E-1);C[E-1]=j.value,W=j.changed}for(var L=0;L=0?k:!1},[k,Ie]),ce=m.useMemo(function(){return Object.keys(te||{}).map(function(dt){var Ct=te[dt],tt={value:Number(dt)};return Ct&&hi(Ct)==="object"&&!m.isValidElement(Ct)&&("label"in Ct||"style"in Ct)?(tt.style=Ct.style,tt.label=Ct.label):tt.label=Ct,tt}).filter(function(dt){var Ct=dt.label;return Ct||typeof Ct=="number"}).sort(function(dt,Ct){return dt.value-Ct.value})},[te]),pe=JBt(Se,ze,Ie,ce,j,ye),ve=ln(pe,2),Ae=ve[0],Te=ve[1],Me=zs(A,{value:T}),Pe=ln(Me,2),Ee=Pe[0],Be=Pe[1],Je=m.useMemo(function(){var dt=Ee==null?[]:Array.isArray(Ee)?Ee:[Ee],Ct=ln(dt,1),tt=Ct[0],Fe=tt===void 0?Se:tt,qe=Ee===null?[]:[Fe];if(x){if(qe=Lo(dt),S||Ee===void 0){var je=S>=0?S+1:2;for(qe=qe.slice(0,je);qe.length=0&&he.current.focus(dt)}at(null)},[st]);var Ze=m.useMemo(function(){return N&&Ie===null?!1:N},[N,Ie]),St=function(Ct,tt){ct(Ct,tt),M==null||M(Ke(We.current))},Pt=it!==-1;m.useEffect(function(){if(!Pt){var dt=Je.lastIndexOf(Ve);he.current.focus(dt)}},[Pt]);var Rt=m.useMemo(function(){return Lo(yt).sort(function(dt,Ct){return dt-Ct})},[yt]),Ut=m.useMemo(function(){return x?[Rt[0],Rt[Rt.length-1]]:[Se,Rt[0]]},[Rt,x,Se]),Ht=ln(Ut,2),At=Ht[0],kt=Ht[1];m.useImperativeHandle(e,function(){return{focus:function(){he.current.focus(0)},blur:function(){var Ct,tt=document,Fe=tt.activeElement;(Ct=xe.current)!==null&&Ct!==void 0&&Ct.contains(Fe)&&(Fe==null||Fe.blur())}}}),m.useEffect(function(){f&&he.current.focus(0)},[]);var gt=m.useMemo(function(){return{min:Se,max:ze,direction:He,disabled:c,keyboard:d,step:Ie,included:B,includedStart:At,includedEnd:kt,range:x,tabIndex:fe,ariaLabelForHandle:ge,ariaLabelledByForHandle:de,ariaValueTextFormatterForHandle:Z,styles:l||{},classNames:a||{}}},[Se,ze,He,c,d,Ie,B,At,kt,x,fe,ge,de,Z,l,a]);return m.createElement(jb.Provider,{value:gt},m.createElement("div",{ref:xe,className:Vn(o,r,Vt(Vt(Vt(Vt({},"".concat(o,"-disabled"),c),"".concat(o,"-vertical"),U),"".concat(o,"-horizontal"),!U),"".concat(o,"-with-marks"),ce.length)),style:i,onMouseDown:ut},m.createElement("div",{className:Vn("".concat(o,"-rail"),a==null?void 0:a.rail),style:qt(qt({},Q),l==null?void 0:l.rail)}),m.createElement(GBt,{prefixCls:o,style:X,values:Rt,startPoint:_,onStartMove:Ze?St:void 0}),m.createElement(VBt,{prefixCls:o,marks:ce,dots:re,style:le,activeStyle:q}),m.createElement(BBt,{ref:he,prefixCls:o,style:$,values:yt,draggingIndex:it,onStartMove:St,onOffsetChange:Oe,onFocus:p,onBlur:g,handleRender:ae,activeHandleRender:se,onChangeComplete:De}),m.createElement(OBt,{prefixCls:o,marks:ce,onClick:Xe})))});const Oxe=m.forwardRef((t,e)=>{const{open:n}=t,o=m.useRef(null),r=m.useRef(null);function i(){Dg.cancel(r.current),r.current=null}function a(){r.current=Dg(()=>{var l;(l=o.current)===null||l===void 0||l.forceAlign(),r.current=null})}return m.useEffect(()=>(n?a():i(),i),[n,t.title]),m.createElement(tA,Object.assign({ref:o5(o,e)},t))}),qBt=t=>{const{componentCls:e,antCls:n,controlSize:o,dotSize:r,marginFull:i,marginPart:a,colorFillContentHover:l,handleColorDisabled:s,calc:c}=t;return{[e]:Object.assign(Object.assign({},ja(t)),{position:"relative",height:o,margin:`${Nt(a)} ${Nt(i)}`,padding:0,cursor:"pointer",touchAction:"none","&-vertical":{margin:`${Nt(i)} ${Nt(a)}`},[`${e}-rail`]:{position:"absolute",backgroundColor:t.railBg,borderRadius:t.borderRadiusXS,transition:`background-color ${t.motionDurationMid}`},[`${e}-track,${e}-tracks`]:{position:"absolute",transition:`background-color ${t.motionDurationMid}`},[`${e}-track`]:{backgroundColor:t.trackBg,borderRadius:t.borderRadiusXS},[`${e}-track-draggable`]:{boxSizing:"content-box",backgroundClip:"content-box",border:"solid rgba(0,0,0,0)"},"&:hover":{[`${e}-rail`]:{backgroundColor:t.railHoverBg},[`${e}-track`]:{backgroundColor:t.trackHoverBg},[`${e}-dot`]:{borderColor:l},[`${e}-handle::after`]:{boxShadow:`0 0 0 ${Nt(t.handleLineWidth)} ${t.colorPrimaryBorderHover}`},[`${e}-dot-active`]:{borderColor:t.dotActiveBorderColor}},[`${e}-handle`]:{position:"absolute",width:t.handleSize,height:t.handleSize,outline:"none","&::before":{content:'""',position:"absolute",insetInlineStart:c(t.handleLineWidth).mul(-1).equal(),insetBlockStart:c(t.handleLineWidth).mul(-1).equal(),width:c(t.handleSize).add(c(t.handleLineWidth).mul(2)).equal(),height:c(t.handleSize).add(c(t.handleLineWidth).mul(2)).equal(),backgroundColor:"transparent"},"&::after":{content:'""',position:"absolute",insetBlockStart:0,insetInlineStart:0,width:t.handleSize,height:t.handleSize,backgroundColor:t.colorBgElevated,boxShadow:`0 0 0 ${Nt(t.handleLineWidth)} ${t.handleColor}`,borderRadius:"50%",cursor:"pointer",transition:` inset-inline-start ${t.motionDurationMid}, inset-block-start ${t.motionDurationMid}, width ${t.motionDurationMid}, @@ -4655,8 +4655,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `]:{backgroundColor:t.colorBgElevated,borderColor:t.trackBgDisabled,boxShadow:"none",cursor:"not-allowed"},[`${e}-handle::after`]:{backgroundColor:t.colorBgElevated,cursor:"not-allowed",width:t.handleSize,height:t.handleSize,boxShadow:`0 0 0 ${Nt(t.handleLineWidth)} ${s}`,insetInlineStart:0,insetBlockStart:0},[` ${e}-mark-text, ${e}-dot - `]:{cursor:"not-allowed !important"}},[`&-tooltip ${n}-tooltip-inner`]:{minWidth:"unset"}})}},QJe=(t,e)=>{const{componentCls:n,railSize:o,handleSize:r,dotSize:i,marginFull:a,calc:l}=t,s=e?"paddingBlock":"paddingInline",c=e?"width":"height",u=e?"height":"width",d=e?"insetBlockStart":"insetInlineStart",f=e?"top":"insetInlineStart",p=l(o).mul(3).sub(r).div(2).equal(),g=l(r).sub(o).div(2).equal(),y=e?{borderWidth:`${Nt(g)} 0`,transform:`translateY(${Nt(l(g).mul(-1).equal())})`}:{borderWidth:`0 ${Nt(g)}`,transform:`translateX(${Nt(t.calc(g).mul(-1).equal())})`};return{[s]:o,[u]:l(o).mul(3).equal(),[`${n}-rail`]:{[c]:"100%",[u]:o},[`${n}-track,${n}-tracks`]:{[u]:o},[`${n}-track-draggable`]:Object.assign({},y),[`${n}-handle`]:{[d]:p},[`${n}-mark`]:{insetInlineStart:0,top:0,[f]:l(o).mul(3).add(e?0:a).equal(),[c]:"100%"},[`${n}-step`]:{insetInlineStart:0,top:0,[f]:o,[c]:"100%",[u]:o},[`${n}-dot`]:{position:"absolute",[d]:l(o).sub(i).div(2).equal()}}},$Bt=t=>{const{componentCls:e,marginPartWithMark:n}=t;return{[`${e}-horizontal`]:Object.assign(Object.assign({},QJe(t,!0)),{[`&${e}-with-marks`]:{marginBottom:n}})}},QBt=t=>{const{componentCls:e}=t;return{[`${e}-vertical`]:Object.assign(Object.assign({},QJe(t,!1)),{height:"100%"})}},ZBt=t=>{const n=t.controlHeightLG/4,o=t.controlHeightSM/2,r=t.lineWidth+1,i=t.lineWidth+1*3;return{controlSize:n,railSize:4,handleSize:n,handleSizeHover:o,dotSize:8,handleLineWidth:r,handleLineWidthHover:i,railBg:t.colorFillTertiary,railHoverBg:t.colorFillSecondary,trackBg:t.colorPrimaryBorder,trackHoverBg:t.colorPrimaryBorderHover,handleColor:t.colorPrimaryBorder,handleActiveColor:t.colorPrimary,handleColorDisabled:new kl(t.colorTextDisabled).onBackground(t.colorBgContainer).toHexShortString(),dotBorderColor:t.colorBorderSecondary,dotActiveBorderColor:t.colorPrimaryBorder,trackBgDisabled:t.colorBgContainerDisabled}},eYt=wl("Slider",t=>{const e=Ki(t,{marginPart:t.calc(t.controlHeight).sub(t.controlSize).div(2).equal(),marginFull:t.calc(t.controlSize).div(2).equal(),marginPartWithMark:t.calc(t.controlHeightLG).sub(t.controlSize).equal()});return[qBt(e),$Bt(e),QBt(e)]},ZBt);function gie(){const[t,e]=m.useState(!1),n=m.useRef(),o=()=>{Dg.cancel(n.current)},r=i=>{o(),i?e(i):n.current=Dg(()=>{e(i)})};return m.useEffect(()=>o,[]),[t,r]}var tYt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);rtypeof n=="number"?n.toString():""}const Iu=be.forwardRef((t,e)=>{const{prefixCls:n,range:o,className:r,rootClassName:i,style:a,disabled:l,tooltipPrefixCls:s,tipFormatter:c,tooltipVisible:u,getTooltipPopupContainer:d,tooltipPlacement:f,tooltip:p={},onChangeComplete:g}=t,y=tYt(t,["prefixCls","range","className","rootClassName","style","disabled","tooltipPrefixCls","tipFormatter","tooltipVisible","getTooltipPopupContainer","tooltipPlacement","tooltip","onChangeComplete"]),{vertical:w}=t,{direction:b,slider:C,getPrefixCls:P,getPopupContainer:v}=be.useContext(Cr),T=be.useContext(n1),A=l??T,[x,S]=gie(),[R,M]=gie(),D=Object.assign({},p),{open:E,placement:W,getPopupContainer:j,prefixCls:L,formatter:k}=D,N=E??u,F=(x||R)&&N!==!1,U=nYt(k,c),[O,B]=gie(),_=de=>{g==null||g(de),B(!1)},X=(de,Z)=>de||(Z?b==="rtl"?"left":"right":"top"),$=P("slider",n),[Q,le,q]=eYt($),te=Un(r,C==null?void 0:C.className,i,{[`${$}-rtl`]:b==="rtl",[`${$}-lock`]:O},le,q);b==="rtl"&&!y.vertical&&(y.reverse=!y.reverse);const[re,ae]=be.useMemo(()=>o?typeof o=="object"?[!0,o.draggableTrack]:[!0,!1]:[!1],[o]);be.useEffect(()=>{const de=()=>{Dg(()=>{M(!1)},1)};return document.addEventListener("mouseup",de),()=>{document.removeEventListener("mouseup",de)}},[]);const se=re&&!N,ne=(de,Z)=>{const{index:he}=Z,xe=de.props,He=Object.assign(Object.assign({},xe),{onMouseEnter:Ie=>{var ye;S(!0),(ye=xe.onMouseEnter)===null||ye===void 0||ye.call(xe,Ie)},onMouseLeave:Ie=>{var ye;S(!1),(ye=xe.onMouseLeave)===null||ye===void 0||ye.call(xe,Ie)},onMouseDown:Ie=>{var ye;M(!0),B(!0),(ye=xe.onMouseDown)===null||ye===void 0||ye.call(xe,Ie)},onFocus:Ie=>{var ye,ce;M(!0),(ye=y.onFocus)===null||ye===void 0||ye.call(y,Ie),(ce=xe.onFocus)===null||ce===void 0||ce.call(xe,Ie)},onBlur:Ie=>{var ye,ce;M(!1),(ye=y.onBlur)===null||ye===void 0||ye.call(y,Ie),(ce=xe.onBlur)===null||ce===void 0||ce.call(xe,Ie)}}),Se=be.cloneElement(de,He),ze=(!!N||F)&&U!==null;return se?Se:be.createElement(Yxe,Object.assign({},D,{prefixCls:P("tooltip",L??s),title:U?U(Z.value):"",open:ze,placement:X(W??f,w),key:he,overlayClassName:`${$}-tooltip`,getPopupContainer:j||d||v}),Se)},fe=se?(de,Z)=>{const he=be.cloneElement(de,{style:Object.assign(Object.assign({},de.props.style),{visibility:"hidden"})});return be.createElement(Yxe,Object.assign({},D,{prefixCls:P("tooltip",L??s),title:U?U(Z.value):"",open:U!==null&&F,placement:X(W??f,w),key:"tooltip",overlayClassName:`${$}-tooltip`,getPopupContainer:j||d||v}),he)}:void 0,ge=Object.assign(Object.assign({},C==null?void 0:C.style),a);return Q(be.createElement(KBt,Object.assign({},y,{step:y.step,range:re,draggableTrack:ae,className:te,style:ge,disabled:A,ref:e,prefixCls:$,handleRender:ne,activeHandleRender:fe,onChangeComplete:_})))});var oYt=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],ZJe=m.forwardRef(function(t,e){var n,o=t.prefixCls,r=o===void 0?"rc-switch":o,i=t.className,a=t.checked,l=t.defaultChecked,s=t.disabled,c=t.loadingIcon,u=t.checkedChildren,d=t.unCheckedChildren,f=t.onClick,p=t.onChange,g=t.onKeyDown,y=ii(t,oYt),w=zs(!1,{value:a,defaultValue:l}),b=ln(w,2),C=b[0],P=b[1];function v(S,R){var M=C;return s||(M=S,P(M),p==null||p(M,R)),M}function T(S){S.which===Bn.LEFT?v(!1,S):S.which===Bn.RIGHT&&v(!0,S),g==null||g(S)}function A(S){var R=v(!C,S);f==null||f(R,S)}var x=Vn(r,i,(n={},Vt(n,"".concat(r,"-checked"),C),Vt(n,"".concat(r,"-disabled"),s),n));return m.createElement("button",ho({},y,{type:"button",role:"switch","aria-checked":C,disabled:s,className:x,ref:e,onKeyDown:T,onClick:A}),c,m.createElement("span",{className:"".concat(r,"-inner")},m.createElement("span",{className:"".concat(r,"-inner-checked")},u),m.createElement("span",{className:"".concat(r,"-inner-unchecked")},d)))});ZJe.displayName="Switch";const rYt=t=>{const{componentCls:e,trackHeightSM:n,trackPadding:o,trackMinWidthSM:r,innerMinMarginSM:i,innerMaxMarginSM:a,handleSizeSM:l,calc:s}=t,c=`${e}-inner`,u=Nt(s(l).add(s(o).mul(2)).equal()),d=Nt(s(a).mul(2).equal());return{[e]:{[`&${e}-small`]:{minWidth:r,height:n,lineHeight:Nt(n),[`${e}-inner`]:{paddingInlineStart:a,paddingInlineEnd:i,[`${c}-checked, ${c}-unchecked`]:{minHeight:n},[`${c}-checked`]:{marginInlineStart:`calc(-100% + ${u} - ${d})`,marginInlineEnd:`calc(100% - ${u} + ${d})`},[`${c}-unchecked`]:{marginTop:s(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`${e}-handle`]:{width:l,height:l},[`${e}-loading-icon`]:{top:s(s(l).sub(t.switchLoadingIconSize)).div(2).equal(),fontSize:t.switchLoadingIconSize},[`&${e}-checked`]:{[`${e}-inner`]:{paddingInlineStart:i,paddingInlineEnd:a,[`${c}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${c}-unchecked`]:{marginInlineStart:`calc(100% - ${u} + ${d})`,marginInlineEnd:`calc(-100% + ${u} - ${d})`}},[`${e}-handle`]:{insetInlineStart:`calc(100% - ${Nt(s(l).add(o).equal())})`}},[`&:not(${e}-disabled):active`]:{[`&:not(${e}-checked) ${c}`]:{[`${c}-unchecked`]:{marginInlineStart:s(t.marginXXS).div(2).equal(),marginInlineEnd:s(t.marginXXS).mul(-1).div(2).equal()}},[`&${e}-checked ${c}`]:{[`${c}-checked`]:{marginInlineStart:s(t.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:s(t.marginXXS).div(2).equal()}}}}}}},iYt=t=>{const{componentCls:e,handleSize:n,calc:o}=t;return{[e]:{[`${e}-loading-icon${t.iconCls}`]:{position:"relative",top:o(o(n).sub(t.fontSize)).div(2).equal(),color:t.switchLoadingIconColor,verticalAlign:"top"},[`&${e}-checked ${e}-loading-icon`]:{color:t.switchColor}}}},aYt=t=>{const{componentCls:e,trackPadding:n,handleBg:o,handleShadow:r,handleSize:i,calc:a}=t,l=`${e}-handle`;return{[e]:{[l]:{position:"absolute",top:n,insetInlineStart:n,width:i,height:i,transition:`all ${t.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:o,borderRadius:a(i).div(2).equal(),boxShadow:r,transition:`all ${t.switchDuration} ease-in-out`,content:'""'}},[`&${e}-checked ${l}`]:{insetInlineStart:`calc(100% - ${Nt(a(i).add(n).equal())})`},[`&:not(${e}-disabled):active`]:{[`${l}::before`]:{insetInlineEnd:t.switchHandleActiveInset,insetInlineStart:0},[`&${e}-checked ${l}::before`]:{insetInlineEnd:0,insetInlineStart:t.switchHandleActiveInset}}}}},lYt=t=>{const{componentCls:e,trackHeight:n,trackPadding:o,innerMinMargin:r,innerMaxMargin:i,handleSize:a,calc:l}=t,s=`${e}-inner`,c=Nt(l(a).add(l(o).mul(2)).equal()),u=Nt(l(i).mul(2).equal());return{[e]:{[s]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:i,paddingInlineEnd:r,transition:`padding-inline-start ${t.switchDuration} ease-in-out, padding-inline-end ${t.switchDuration} ease-in-out`,[`${s}-checked, ${s}-unchecked`]:{display:"block",color:t.colorTextLightSolid,fontSize:t.fontSizeSM,transition:`margin-inline-start ${t.switchDuration} ease-in-out, margin-inline-end ${t.switchDuration} ease-in-out`,pointerEvents:"none",minHeight:n},[`${s}-checked`]:{marginInlineStart:`calc(-100% + ${c} - ${u})`,marginInlineEnd:`calc(100% - ${c} + ${u})`},[`${s}-unchecked`]:{marginTop:l(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`&${e}-checked ${s}`]:{paddingInlineStart:r,paddingInlineEnd:i,[`${s}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${s}-unchecked`]:{marginInlineStart:`calc(100% - ${c} + ${u})`,marginInlineEnd:`calc(-100% + ${c} - ${u})`}},[`&:not(${e}-disabled):active`]:{[`&:not(${e}-checked) ${s}`]:{[`${s}-unchecked`]:{marginInlineStart:l(o).mul(2).equal(),marginInlineEnd:l(o).mul(-1).mul(2).equal()}},[`&${e}-checked ${s}`]:{[`${s}-checked`]:{marginInlineStart:l(o).mul(-1).mul(2).equal(),marginInlineEnd:l(o).mul(2).equal()}}}}}},sYt=t=>{const{componentCls:e,trackHeight:n,trackMinWidth:o}=t;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:o,height:n,lineHeight:`${Nt(n)}`,verticalAlign:"middle",background:t.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${t.motionDurationMid}`,userSelect:"none",[`&:hover:not(${e}-disabled)`]:{background:t.colorTextTertiary}}),Q6(t)),{[`&${e}-checked`]:{background:t.switchColor,[`&:hover:not(${e}-disabled)`]:{background:t.colorPrimaryHover}},[`&${e}-loading, &${e}-disabled`]:{cursor:"not-allowed",opacity:t.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${e}-rtl`]:{direction:"rtl"}})}},cYt=t=>{const{fontSize:e,lineHeight:n,controlHeight:o,colorWhite:r}=t,i=e*n,a=o/2,l=2,s=i-l*2,c=a-l*2;return{trackHeight:i,trackHeightSM:a,trackMinWidth:s*2+l*4,trackMinWidthSM:c*2+l*2,trackPadding:l,handleBg:r,handleSize:s,handleSizeSM:c,handleShadow:`0 2px 4px 0 ${new kl("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:s/2,innerMaxMargin:s+l+l*2,innerMinMarginSM:c/2,innerMaxMarginSM:c+l+l*2}},uYt=wl("Switch",t=>{const e=Ki(t,{switchDuration:t.motionDurationMid,switchColor:t.colorPrimary,switchDisabledOpacity:t.opacityLoading,switchLoadingIconSize:t.calc(t.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:`rgba(0, 0, 0, ${t.opacityLoading})`,switchHandleActiveInset:"-30%"});return[sYt(e),lYt(e),aYt(e),iYt(e),rYt(e)]},cYt);var dYt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:n,size:o,disabled:r,loading:i,className:a,rootClassName:l,style:s,checked:c,value:u,defaultChecked:d,defaultValue:f,onChange:p}=t,g=dYt(t,["prefixCls","size","disabled","loading","className","rootClassName","style","checked","value","defaultChecked","defaultValue","onChange"]),[y,w]=$6(!1,{value:c??u,defaultValue:d??f}),{getPrefixCls:b,direction:C,switch:P}=m.useContext(Cr),v=m.useContext(n1),T=(r??v)||i,A=b("switch",n),x=m.createElement("div",{className:`${A}-handle`},i&&m.createElement(UH,{className:`${A}-loading-icon`})),[S,R,M]=uYt(A),D=Ed(o),E=Un(P==null?void 0:P.className,{[`${A}-small`]:D==="small",[`${A}-loading`]:i,[`${A}-rtl`]:C==="rtl"},a,l,R,M),W=Object.assign(Object.assign({},P==null?void 0:P.style),s),j=function(){w(arguments.length<=0?void 0:arguments[0]),p==null||p.apply(void 0,arguments)};return S(m.createElement(EW,{component:"Switch"},m.createElement(ZJe,Object.assign({},g,{checked:y,onChange:j,prefixCls:A,className:E,style:W,disabled:T,ref:e,loadingIcon:x}))))}),xc=fYt;xc.__ANT_SWITCH=!0;var J4={},QW="rc-table-internal-hook";function fye(t){var e=m.createContext(void 0),n=function(r){var i=r.value,a=r.children,l=m.useRef(i);l.current=i;var s=m.useState(function(){return{getValue:function(){return l.current},listeners:new Set}}),c=ln(s,1),u=c[0];return Xa(function(){Cd.unstable_batchedUpdates(function(){u.listeners.forEach(function(d){d(i)})})},[i]),m.createElement(e.Provider,{value:u},a)};return{Context:e,Provider:n,defaultValue:t}}function Ah(t,e){var n=Ea(typeof e=="function"?e:function(d){if(e===void 0)return d;if(!Array.isArray(e))return d[e];var f={};return e.forEach(function(p){f[p]=d[p]}),f}),o=m.useContext(t==null?void 0:t.Context),r=o||{},i=r.listeners,a=r.getValue,l=m.useRef();l.current=n(o?a():t==null?void 0:t.defaultValue);var s=m.useState({}),c=ln(s,2),u=c[1];return Xa(function(){if(!o)return;function d(f){var p=n(f);iw(l.current,p,!0)||u({})}return i.add(d),function(){i.delete(d)}},[o]),l.current}function hYt(){var t=m.createContext(null);function e(){return m.useContext(t)}function n(r,i){var a=rw(r),l=function(c,u){var d=a?{ref:u}:{},f=m.useRef(0),p=m.useRef(c),g=e();return g!==null?m.createElement(r,ho({},c,d)):((!i||i(p.current,c))&&(f.current+=1),p.current=c,m.createElement(t.Provider,{value:f.current},m.createElement(r,ho({},c,d))))};return a?m.forwardRef(l):l}function o(r,i){var a=rw(r),l=function(c,u){var d=a?{ref:u}:{};return e(),m.createElement(r,ho({},c,d))};return a?m.memo(m.forwardRef(l),i):m.memo(l,i)}return{makeImmutable:n,responseImmutable:o,useImmutableMark:e}}var hye=hYt(),eKe=hye.makeImmutable,XH=hye.responseImmutable,pYt=hye.useImmutableMark,h1=fye(),tKe=m.createContext({renderWithProps:!1}),gYt="RC_TABLE_KEY";function mYt(t){return t==null?[]:Array.isArray(t)?t:[t]}function dQ(t){var e=[],n={};return t.forEach(function(o){for(var r=o||{},i=r.key,a=r.dataIndex,l=i||mYt(a).join("-")||gYt;n[l];)l="".concat(l,"_next");n[l]=!0,e.push(l)}),e}function Aue(t){return t!=null}function yYt(t){return t&&hi(t)==="object"&&!Array.isArray(t)&&!m.isValidElement(t)}function AYt(t,e,n,o,r,i){var a=m.useContext(tKe),l=pYt(),s=CW(function(){if(Aue(o))return[o];var c=e==null||e===""?[]:Array.isArray(e)?e:[e],u=Ag(t,c),d=u,f=void 0;if(r){var p=r(u,t,n);yYt(p)?(d=p.children,f=p.props,a.renderWithProps=!0):d=p}return[d,f]},[l,t,o,e,r,n],function(c,u){if(i){var d=ln(c,2),f=d[1],p=ln(u,2),g=p[1];return i(g,f)}return a.renderWithProps?!0:!iw(c,u,!0)});return s}function wYt(t,e,n,o){var r=t+e-1;return t<=o&&r>=n}function vYt(t,e){return Ah(h1,function(n){var o=wYt(t,e||1,n.hoverStartRow,n.hoverEndRow);return[o,n.onHover]})}var xYt=function(e){var n=e.ellipsis,o=e.rowType,r=e.children,i,a=n===!0?{showTitle:!0}:n;return a&&(a.showTitle||o==="header")&&(typeof r=="string"||typeof r=="number"?i=r.toString():m.isValidElement(r)&&typeof r.props.children=="string"&&(i=r.props.children)),i};function bYt(t){var e,n,o,r,i,a,l,s,c=t.component,u=t.children,d=t.ellipsis,f=t.scope,p=t.prefixCls,g=t.className,y=t.align,w=t.record,b=t.render,C=t.dataIndex,P=t.renderIndex,v=t.shouldCellUpdate,T=t.index,A=t.rowType,x=t.colSpan,S=t.rowSpan,R=t.fixLeft,M=t.fixRight,D=t.firstFixLeft,E=t.lastFixLeft,W=t.firstFixRight,j=t.lastFixRight,L=t.appendNode,k=t.additionalProps,N=k===void 0?{}:k,F=t.isSticky,U="".concat(p,"-cell"),O=Ah(h1,["supportSticky","allColumnsFixedLeft","rowHoverable"]),B=O.supportSticky,_=O.allColumnsFixedLeft,X=O.rowHoverable,$=AYt(w,C,P,u,b,v),Q=ln($,2),le=Q[0],q=Q[1],te={},re=typeof R=="number"&&B,ae=typeof M=="number"&&B;re&&(te.position="sticky",te.left=R),ae&&(te.position="sticky",te.right=M);var se=(e=(n=(o=q==null?void 0:q.colSpan)!==null&&o!==void 0?o:N.colSpan)!==null&&n!==void 0?n:x)!==null&&e!==void 0?e:1,ne=(r=(i=(a=q==null?void 0:q.rowSpan)!==null&&a!==void 0?a:N.rowSpan)!==null&&i!==void 0?i:S)!==null&&r!==void 0?r:1,fe=vYt(T,ne),ge=ln(fe,2),de=ge[0],Z=ge[1],he=Ea(function(ce){var pe;w&&Z(T,T+ne-1),N==null||(pe=N.onMouseEnter)===null||pe===void 0||pe.call(N,ce)}),xe=Ea(function(ce){var pe;w&&Z(-1,-1),N==null||(pe=N.onMouseLeave)===null||pe===void 0||pe.call(N,ce)});if(se===0||ne===0)return null;var He=(l=N.title)!==null&&l!==void 0?l:xYt({rowType:A,ellipsis:d,children:le}),Se=Vn(U,g,(s={},Vt(Vt(Vt(Vt(Vt(Vt(Vt(Vt(Vt(Vt(s,"".concat(U,"-fix-left"),re&&B),"".concat(U,"-fix-left-first"),D&&B),"".concat(U,"-fix-left-last"),E&&B),"".concat(U,"-fix-left-all"),E&&_&&B),"".concat(U,"-fix-right"),ae&&B),"".concat(U,"-fix-right-first"),W&&B),"".concat(U,"-fix-right-last"),j&&B),"".concat(U,"-ellipsis"),d),"".concat(U,"-with-append"),L),"".concat(U,"-fix-sticky"),(re||ae)&&F&&B),Vt(s,"".concat(U,"-row-hover"),!q&&de)),N.className,q==null?void 0:q.className),ze={};y&&(ze.textAlign=y);var Ie=qt(qt(qt(qt({},te),N.style),ze),q==null?void 0:q.style),ye=le;return hi(ye)==="object"&&!Array.isArray(ye)&&!m.isValidElement(ye)&&(ye=null),d&&(E||W)&&(ye=m.createElement("span",{className:"".concat(U,"-content")},ye)),m.createElement(c,ho({},q,N,{className:Se,style:Ie,title:He,scope:f,onMouseEnter:X?he:void 0,onMouseLeave:X?xe:void 0,colSpan:se!==1?se:null,rowSpan:ne!==1?ne:null}),L,ye)}const Bb=m.memo(bYt);function pye(t,e,n,o,r){var i=n[t]||{},a=n[e]||{},l,s;i.fixed==="left"?l=o.left[r==="rtl"?e:t]:a.fixed==="right"&&(s=o.right[r==="rtl"?t:e]);var c=!1,u=!1,d=!1,f=!1,p=n[e+1],g=n[t-1],y=p&&!p.fixed||g&&!g.fixed||n.every(function(v){return v.fixed==="left"});if(r==="rtl"){if(l!==void 0){var w=g&&g.fixed==="left";f=!w&&y}else if(s!==void 0){var b=p&&p.fixed==="right";d=!b&&y}}else if(l!==void 0){var C=p&&p.fixed==="left";c=!C&&y}else if(s!==void 0){var P=g&&g.fixed==="right";u=!P&&y}return{fixLeft:l,fixRight:s,lastFixLeft:c,firstFixRight:u,lastFixRight:d,firstFixLeft:f,isSticky:o.isSticky}}var nKe=m.createContext({});function SYt(t){var e=t.className,n=t.index,o=t.children,r=t.colSpan,i=r===void 0?1:r,a=t.rowSpan,l=t.align,s=Ah(h1,["prefixCls","direction"]),c=s.prefixCls,u=s.direction,d=m.useContext(nKe),f=d.scrollColumnIndex,p=d.stickyOffsets,g=d.flattenColumns,y=n+i-1,w=y+1===f?i+1:i,b=pye(n,n+w-1,g,p,u);return m.createElement(Bb,ho({className:e,index:n,component:"td",prefixCls:c,record:null,dataIndex:null,align:l,colSpan:w,rowSpan:a,render:function(){return o}},b))}var TYt=["children"];function PYt(t){var e=t.children,n=ii(t,TYt);return m.createElement("tr",n,e)}function fQ(t){var e=t.children;return e}fQ.Row=PYt;fQ.Cell=SYt;function CYt(t){var e=t.children,n=t.stickyOffsets,o=t.flattenColumns,r=Ah(h1,"prefixCls"),i=o.length-1,a=o[i],l=m.useMemo(function(){return{stickyOffsets:n,flattenColumns:o,scrollColumnIndex:a!=null&&a.scrollbar?i:null}},[a,o,i,n]);return m.createElement(nKe.Provider,{value:l},m.createElement("tfoot",{className:"".concat(r,"-summary")},e))}const NY=XH(CYt);var oKe=fQ;function RYt(t){return null}function HYt(t){return null}var rKe=function(e){if(dp()&&window.document.documentElement){var n=Array.isArray(e)?e:[e],o=window.document.documentElement;return n.some(function(r){return r in o.style})}return!1},MYt=function(e,n){if(!rKe(e))return!1;var o=document.createElement("div"),r=o.style[e];return o.style[e]=n,o.style[e]!==r};function IYt(t,e){return!Array.isArray(t)&&e!==void 0?MYt(t,e):rKe(t)}function iKe(t,e,n,o,r,i,a){t.push({record:e,indent:n,index:a});var l=i(e),s=r==null?void 0:r.has(l);if(e&&Array.isArray(e[o])&&s)for(var c=0;c1?D-1:0),W=1;W=1?T:""),style:qt(qt({},n),b==null?void 0:b.style)}),g.map(function(R,M){var D=R.render,E=R.dataIndex,W=R.className,j=cKe(f,R,M,s,r),L=j.key,k=j.fixedInfo,N=j.appendCellNode,F=j.additionalCellProps;return m.createElement(Bb,ho({className:W,ellipsis:R.ellipsis,align:R.align,scope:R.rowScope,component:R.rowScope?d:u,prefixCls:p,key:L,record:o,index:r,renderIndex:i,dataIndex:E,render:D,shouldCellUpdate:R.shouldCellUpdate},k,{appendNode:N,additionalProps:F}))})),x;if(P&&(v.current||C)){var S=w(o,r,s+1,C);x=m.createElement(sKe,{expanded:C,className:Vn("".concat(p,"-expanded-row"),"".concat(p,"-expanded-row-level-").concat(s+1),T),prefixCls:p,component:c,cellComponent:u,colSpan:g.length,isEmpty:!1},S)}return m.createElement(m.Fragment,null,A,x)}const DYt=XH(zYt);function EYt(t){var e=t.columnKey,n=t.onColumnResize,o=m.useRef();return m.useEffect(function(){o.current&&n(e,o.current.offsetWidth)},[]),m.createElement(Td,{data:e},m.createElement("td",{ref:o,style:{padding:0,border:0,height:0}},m.createElement("div",{style:{height:0,overflow:"hidden"}}," ")))}function FYt(t){var e=t.prefixCls,n=t.columnsKey,o=t.onColumnResize;return m.createElement("tr",{"aria-hidden":"true",className:"".concat(e,"-measure-row"),style:{height:0,fontSize:0}},m.createElement(Td.Collection,{onBatchResize:function(i){i.forEach(function(a){var l=a.data,s=a.size;o(l,s.offsetWidth)})}},n.map(function(r){return m.createElement(EYt,{key:r,columnKey:r,onColumnResize:o})})))}function kYt(t){var e=t.data,n=t.measureColumnWidth,o=Ah(h1,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode"]),r=o.prefixCls,i=o.getComponent,a=o.onColumnResize,l=o.flattenColumns,s=o.getRowKey,c=o.expandedKeys,u=o.childrenColumnName,d=o.emptyNode,f=aKe(e,u,c,s),p=m.useRef({renderWithProps:!1}),g=i(["body","wrapper"],"tbody"),y=i(["body","row"],"tr"),w=i(["body","cell"],"td"),b=i(["body","cell"],"th"),C;e.length?C=f.map(function(v,T){var A=v.record,x=v.indent,S=v.index,R=s(A,T);return m.createElement(DYt,{key:R,rowKey:R,record:A,index:T,renderIndex:S,rowComponent:y,cellComponent:w,scopeCellComponent:b,getRowKey:s,indent:x})}):C=m.createElement(sKe,{expanded:!0,className:"".concat(r,"-placeholder"),prefixCls:r,component:y,cellComponent:w,colSpan:l.length,isEmpty:!0},d);var P=dQ(l);return m.createElement(tKe.Provider,{value:p.current},m.createElement(g,{className:"".concat(r,"-tbody")},n&&m.createElement(FYt,{prefixCls:r,columnsKey:P,onColumnResize:a}),C))}const LYt=XH(kYt);var WYt=["expandable"],SE="RC_TABLE_INTERNAL_COL_DEFINE";function NYt(t){var e=t.expandable,n=ii(t,WYt),o;return"expandable"in t?o=qt(qt({},n),e):o=n,o.showExpandColumn===!1&&(o.expandIconColumnIndex=-1),o}var UYt=["columnType"];function uKe(t){for(var e=t.colWidths,n=t.columns,o=t.columCount,r=[],i=o||n.length,a=!1,l=i-1;l>=0;l-=1){var s=e[l],c=n&&n[l],u=c&&c[SE];if(s||u||a){var d=u||{};d.columnType;var f=ii(d,UYt);r.unshift(m.createElement("col",ho({key:l,style:{width:s}},f))),a=!0}}return m.createElement("colgroup",null,r)}var jYt=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function BYt(t,e){return m.useMemo(function(){for(var n=[],o=0;o1?"colgroup":"col":null,ellipsis:w.ellipsis,align:w.align,component:a,prefixCls:u,key:p[y]},b,{additionalProps:C,rowType:"header"}))}))};function _Yt(t){var e=[];function n(a,l){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;e[s]=e[s]||[];var c=l,u=a.filter(Boolean).map(function(d){var f={key:d.key,className:d.className||"",children:d.title,column:d,colStart:c},p=1,g=d.children;return g&&g.length>0&&(p=n(g,c,s+1).reduce(function(y,w){return y+w},0),f.hasSubColumns=!0),"colSpan"in d&&(p=d.colSpan),"rowSpan"in d&&(f.rowSpan=d.rowSpan),f.colSpan=p,f.colEnd=f.colStart+p-1,e[s].push(f),c+=p,p});return u}n(t,0);for(var o=e.length,r=function(l){e[l].forEach(function(s){!("rowSpan"in s)&&!s.hasSubColumns&&(s.rowSpan=o-l)})},i=0;i1&&arguments[1]!==void 0?arguments[1]:"";return typeof e=="number"?e:e.endsWith("%")?t*parseFloat(e)/100:null}function GYt(t,e,n){return m.useMemo(function(){if(e&&e>0){var o=0,r=0;t.forEach(function(f){var p=Vxe(e,f.width);p?o+=p:r+=1});var i=Math.max(e,n),a=Math.max(i-o,r),l=r,s=a/r,c=0,u=t.map(function(f){var p=qt({},f),g=Vxe(e,p.width);if(g)p.width=g;else{var y=Math.floor(s);p.width=l===1?a:y,a-=y,l-=1}return c+=p.width,p});if(c0?qt(qt({},e),{},{children:dKe(n)}):e})}function wue(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key";return t.filter(function(n){return n&&hi(n)==="object"}).reduce(function(n,o,r){var i=o.fixed,a=i===!0?"left":i,l="".concat(e,"-").concat(r),s=o.children;return s&&s.length>0?[].concat(Lo(n),Lo(wue(s,l).map(function(c){return qt({fixed:a},c)}))):[].concat(Lo(n),[qt(qt({key:l},o),{},{fixed:a})])},[])}function KYt(t){return t.map(function(e){var n=e.fixed,o=ii(e,JYt),r=n;return n==="left"?r="right":n==="right"&&(r="left"),qt({fixed:r},o)})}function qYt(t,e){var n=t.prefixCls,o=t.columns,r=t.children,i=t.expandable,a=t.expandedKeys,l=t.columnTitle,s=t.getRowKey,c=t.onTriggerExpand,u=t.expandIcon,d=t.rowExpandable,f=t.expandIconColumnIndex,p=t.direction,g=t.expandRowByClick,y=t.columnWidth,w=t.fixed,b=t.scrollWidth,C=t.clientWidth,P=m.useMemo(function(){var E=o||gye(r)||[];return dKe(E.slice())},[o,r]),v=m.useMemo(function(){if(i){var E=P.slice();if(!E.includes(J4)){var W=f||0;W>=0&&E.splice(W,0,J4)}var j=E.indexOf(J4);E=E.filter(function(F,U){return F!==J4||U===j});var L=P[j],k;(w==="left"||w)&&!f?k="left":(w==="right"||w)&&f===P.length?k="right":k=L?L.fixed:null;var N=Vt(Vt(Vt(Vt(Vt(Vt({},SE,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",l),"fixed",k),"className","".concat(n,"-row-expand-icon-cell")),"width",y),"render",function(U,O,B){var _=s(O,B),X=a.has(_),$=d?d(O):!0,Q=u({prefixCls:n,expanded:X,expandable:$,record:O,onExpand:c});return g?m.createElement("span",{onClick:function(q){return q.stopPropagation()}},Q):Q});return E.map(function(F){return F===J4?N:F})}return P.filter(function(F){return F!==J4})},[i,P,s,a,u,p]),T=m.useMemo(function(){var E=v;return e&&(E=e(E)),E.length||(E=[{render:function(){return null}}]),E},[e,v,p]),A=m.useMemo(function(){return p==="rtl"?KYt(wue(T)):wue(T)},[T,p,b]),x=m.useMemo(function(){for(var E=-1,W=A.length-1;W>=0;W-=1){var j=A[W].fixed;if(j==="left"||j===!0){E=W;break}}if(E>=0)for(var L=0;L<=E;L+=1){var k=A[L].fixed;if(k!=="left"&&k!==!0)return!0}var N=A.findIndex(function(O){var B=O.fixed;return B==="right"});if(N>=0)for(var F=N;F=d&&(F=d-f),a({scrollLeft:F/d*(u+2)}),C.current.x=j.pageX},D=function(){x.current=Fa(function(){if(i.current){var j=Exe(i.current).top,L=j+i.current.offsetHeight,k=s===window?document.documentElement.scrollTop+window.innerHeight:Exe(s).top+s.clientHeight;L-D0e()<=k||j>=k-l?b(function(N){return qt(qt({},N),{},{isHiddenScrollBar:!0})}):b(function(N){return qt(qt({},N),{},{isHiddenScrollBar:!1})})}})},E=function(j){b(function(L){return qt(qt({},L),{},{scrollLeft:j/u*d||0})})};return m.useImperativeHandle(n,function(){return{setScrollLeft:E,checkScrollBarVisible:D}}),m.useEffect(function(){var W=WY(document.body,"mouseup",S,!1),j=WY(document.body,"mousemove",M,!1);return D(),function(){W.remove(),j.remove()}},[f,T]),m.useEffect(function(){var W=WY(s,"scroll",D,!1),j=WY(window,"resize",D,!1);return function(){W.remove(),j.remove()}},[s]),m.useEffect(function(){w.isHiddenScrollBar||b(function(W){var j=i.current;return j?qt(qt({},W),{},{scrollLeft:j.scrollLeft/j.scrollWidth*j.clientWidth}):W})},[w.isHiddenScrollBar]),u<=d||!f||w.isHiddenScrollBar?null:m.createElement("div",{style:{height:D0e(),width:d,bottom:l},className:"".concat(c,"-sticky-scroll")},m.createElement("div",{onMouseDown:R,ref:p,className:Vn("".concat(c,"-sticky-scroll-bar"),Vt({},"".concat(c,"-sticky-scroll-bar-active"),T)),style:{width:"".concat(f,"px"),transform:"translate3d(".concat(w.scrollLeft,"px, 0, 0)")}}))};const aOt=m.forwardRef(iOt);var hKe="rc-table",lOt=[],sOt={};function cOt(){return"No Data"}function uOt(t,e){var n=qt({rowKey:"key",prefixCls:hKe,emptyText:cOt},t),o=n.prefixCls,r=n.className,i=n.rowClassName,a=n.style,l=n.data,s=n.rowKey,c=n.scroll,u=n.tableLayout,d=n.direction,f=n.title,p=n.footer,g=n.summary,y=n.caption,w=n.id,b=n.showHeader,C=n.components,P=n.emptyText,v=n.onRow,T=n.onHeaderRow,A=n.onScroll,x=n.internalHooks,S=n.transformColumns,R=n.internalRefs,M=n.tailor,D=n.getContainerWidth,E=n.sticky,W=n.rowHoverable,j=W===void 0?!0:W,L=l||lOt,k=!!L.length,N=x===QW,F=m.useCallback(function(xo,Qo){return Ag(C,xo)||Qo},[C]),U=m.useMemo(function(){return typeof s=="function"?s:function(xo){var Qo=xo&&xo[s];return Qo}},[s]),O=F(["body"]),B=nOt(),_=ln(B,3),X=_[0],$=_[1],Q=_[2],le=ZYt(n,L,U),q=ln(le,6),te=q[0],re=q[1],ae=q[2],se=q[3],ne=q[4],fe=q[5],ge=c==null?void 0:c.x,de=m.useState(0),Z=ln(de,2),he=Z[0],xe=Z[1],He=qYt(qt(qt(qt({},n),te),{},{expandable:!!te.expandedRowRender,columnTitle:te.columnTitle,expandedKeys:ae,getRowKey:U,onTriggerExpand:fe,expandIcon:se,expandIconColumnIndex:te.expandIconColumnIndex,direction:d,scrollWidth:N&&M&&typeof ge=="number"?ge:null,clientWidth:he}),N?S:null),Se=ln(He,4),ze=Se[0],Ie=Se[1],ye=Se[2],ce=Se[3],pe=ye??ge,ve=m.useMemo(function(){return{columns:ze,flattenColumns:Ie}},[ze,Ie]),Ae=m.useRef(),Te=m.useRef(),Me=m.useRef(),Pe=m.useRef();m.useImperativeHandle(e,function(){return{nativeElement:Ae.current,scrollTo:function(Qo){var jo;if(Me.current instanceof HTMLElement){var lr=Qo.index,fr=Qo.top,ai=Qo.key;if(fr){var hr;(hr=Me.current)===null||hr===void 0||hr.scrollTo({top:fr})}else{var tr,xi=ai??U(L[lr]);(tr=Me.current.querySelector('[data-row-key="'.concat(xi,'"]')))===null||tr===void 0||tr.scrollIntoView()}}else(jo=Me.current)!==null&&jo!==void 0&&jo.scrollTo&&Me.current.scrollTo(Qo)}}});var Ee=m.useRef(),Be=m.useState(!1),Je=ln(Be,2),We=Je[0],Ke=Je[1],Ne=m.useState(!1),De=ln(Ne,2),ke=De[0],Ye=De[1],it=fKe(new Map),Ve=ln(it,2),yt=Ve[0],ct=Ve[1],Xe=dQ(Ie),ut=Xe.map(function(xo){return yt.get(xo)}),ft=m.useMemo(function(){return ut},[ut.join("_")]),ot=rOt(ft,Ie,d),st=c&&Aue(c.y),at=c&&Aue(pe)||!!te.fixed,Oe=at&&Ie.some(function(xo){var Qo=xo.fixed;return Qo}),Ze=m.useRef(),St=oOt(E,o),Pt=St.isSticky,Rt=St.offsetHeader,Ut=St.offsetSummary,Ht=St.offsetScroll,At=St.stickyClassName,kt=St.container,gt=m.useMemo(function(){return g==null?void 0:g(L)},[g,L]),dt=(st||Pt)&&m.isValidElement(gt)&>.type===fQ&>.props.fixed,Ct,tt,Fe;st&&(tt={overflowY:"scroll",maxHeight:c.y}),at&&(Ct={overflowX:"auto"},st||(tt={overflowY:"hidden"}),Fe={width:pe===!0?"auto":pe,minWidth:"100%"});var qe=m.useCallback(function(xo,Qo){V$(Ae.current)&&ct(function(jo){if(jo.get(xo)!==Qo){var lr=new Map(jo);return lr.set(xo,Qo),lr}return jo})},[]),je=tOt(),rt=ln(je,2),mt=rt[0],Qe=rt[1];function Tt(xo,Qo){Qo&&(typeof Qo=="function"?Qo(xo):Qo.scrollLeft!==xo&&(Qo.scrollLeft=xo,Qo.scrollLeft!==xo&&setTimeout(function(){Qo.scrollLeft=xo},0)))}var Dt=Ea(function(xo){var Qo=xo.currentTarget,jo=xo.scrollLeft,lr=d==="rtl",fr=typeof jo=="number"?jo:Qo.scrollLeft,ai=Qo||sOt;if(!Qe()||Qe()===ai){var hr;mt(ai),Tt(fr,Te.current),Tt(fr,Me.current),Tt(fr,Ee.current),Tt(fr,(hr=Ze.current)===null||hr===void 0?void 0:hr.setScrollLeft)}var tr=Qo||Te.current;if(tr){var xi=tr.scrollWidth,Eo=tr.clientWidth;if(xi===Eo){Ke(!1),Ye(!1);return}lr?(Ke(-fr0)):(Ke(fr>0),Ye(fr1?w-j:0,k=qt(qt(qt({},S),c),{},{flex:"0 0 ".concat(j,"px"),width:"".concat(j,"px"),marginRight:L,pointerEvents:"auto"}),N=m.useMemo(function(){return d?E<=1:M===0||E===0||E>1},[E,M,d]);N?k.visibility="hidden":d&&(k.height=f==null?void 0:f(E));var F=N?function(){return null}:p,U={};return(E===0||M===0)&&(U.rowSpan=1,U.colSpan=1),m.createElement(Bb,ho({className:Vn(y,u),ellipsis:n.ellipsis,align:n.align,scope:n.rowScope,component:a,prefixCls:e.prefixCls,key:v,record:s,index:i,renderIndex:l,dataIndex:g,render:F,shouldCellUpdate:n.shouldCellUpdate},T,{appendNode:A,additionalProps:qt(qt({},x),{},{style:k},U)}))}var pOt=["data","index","className","rowKey","style","extra","getHeight"],gOt=m.forwardRef(function(t,e){var n=t.data,o=t.index,r=t.className,i=t.rowKey,a=t.style,l=t.extra,s=t.getHeight,c=ii(t,pOt),u=n.record,d=n.indent,f=n.index,p=Ah(h1,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),g=p.scrollX,y=p.flattenColumns,w=p.prefixCls,b=p.fixColumn,C=p.componentWidth,P=Ah(mye,["getComponent"]),v=P.getComponent,T=lKe(u,i,o,d),A=v(["body","row"],"div"),x=v(["body","cell"],"div"),S=T.rowSupportExpand,R=T.expanded,M=T.rowProps,D=T.expandedRowRender,E=T.expandedRowClassName,W;if(S&&R){var j=D(u,o,d+1,R),L=E==null?void 0:E(u,o,d),k={};b&&(k={style:Vt({},"--virtual-width","".concat(C,"px"))});var N="".concat(w,"-expanded-row-cell");W=m.createElement(A,{className:Vn("".concat(w,"-expanded-row"),"".concat(w,"-expanded-row-level-").concat(d+1),L)},m.createElement(Bb,{component:x,prefixCls:w,className:Vn(N,Vt({},"".concat(N,"-fixed"),b)),additionalProps:k},j))}var F=qt(qt({},a),{},{width:g});l&&(F.position="absolute",F.pointerEvents="none");var U=m.createElement(A,ho({},M,c,{"data-row-key":i,ref:S?null:e,className:Vn(r,"".concat(w,"-row"),M==null?void 0:M.className,Vt({},"".concat(w,"-row-extra"),l)),style:qt(qt({},F),M==null?void 0:M.style)}),y.map(function(O,B){return m.createElement(hOt,{key:B,component:x,rowInfo:T,column:O,colIndex:B,indent:d,index:o,renderIndex:f,record:u,inverse:l,getHeight:s})}));return S?m.createElement("div",{ref:e},U,W):U}),Jxe=XH(gOt),mOt=m.forwardRef(function(t,e){var n=t.data,o=t.onScroll,r=Ah(h1,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","emptyNode","scrollX"]),i=r.flattenColumns,a=r.onColumnResize,l=r.getRowKey,s=r.expandedKeys,c=r.prefixCls,u=r.childrenColumnName,d=r.emptyNode,f=r.scrollX,p=Ah(mye),g=p.sticky,y=p.scrollY,w=p.listItemHeight,b=p.getComponent,C=p.onScroll,P=m.useRef(),v=aKe(n,u,s,l),T=m.useMemo(function(){var k=0;return i.map(function(N){var F=N.width,U=N.key;return k+=F,[U,F,k]})},[i]),A=m.useMemo(function(){return T.map(function(k){return k[2]})},[T]);m.useEffect(function(){T.forEach(function(k){var N=ln(k,2),F=N[0],U=N[1];a(F,U)})},[T]),m.useImperativeHandle(e,function(){var k={scrollTo:function(F){var U;(U=P.current)===null||U===void 0||U.scrollTo(F)}};return Object.defineProperty(k,"scrollLeft",{get:function(){var F;return((F=P.current)===null||F===void 0?void 0:F.getScrollInfo().x)||0},set:function(F){var U;(U=P.current)===null||U===void 0||U.scrollTo({left:F})}}),k});var x=function(N,F){var U,O=(U=v[F])===null||U===void 0?void 0:U.record,B=N.onCell;if(B){var _,X=B(O,F);return(_=X==null?void 0:X.rowSpan)!==null&&_!==void 0?_:1}return 1},S=function(N){var F=N.start,U=N.end,O=N.getSize,B=N.offsetY;if(U<0)return null;for(var _=i.filter(function(ge){return x(ge,F)===0}),X=F,$=function(de){if(_=_.filter(function(Z){return x(Z,de)===0}),!_.length)return X=de,1},Q=F;Q>=0&&!$(Q);Q-=1);for(var le=i.filter(function(ge){return x(ge,U)!==1}),q=U,te=function(de){if(le=le.filter(function(Z){return x(Z,de)!==1}),!le.length)return q=Math.max(de-1,U),1},re=U;re1})&&ae.push(de)},ne=X;ne<=q;ne+=1)se(ne);var fe=ae.map(function(ge){var de=v[ge],Z=l(de.record,ge),he=function(Se){var ze=ge+Se-1,Ie=l(v[ze].record,ze),ye=O(Z,Ie);return ye.bottom-ye.top},xe=O(Z);return m.createElement(Jxe,{key:ge,data:de,rowKey:Z,index:ge,style:{top:-B+xe.top},extra:!0,getHeight:he})});return fe},R=m.useMemo(function(){return{columnsOffset:A}},[A]),M="".concat(c,"-tbody"),D=b(["body","wrapper"]),E=b(["body","row"],"div"),W=b(["body","cell"],"div"),j;if(v.length){var L={};g&&(L.position="sticky",L.bottom=0,hi(g)==="object"&&g.offsetScroll&&(L.bottom=g.offsetScroll)),j=m.createElement(G$,{fullHeight:!1,ref:P,prefixCls:"".concat(M,"-virtual"),styles:{horizontalScrollBar:L},className:M,height:y,itemHeight:w||24,data:v,itemKey:function(N){return l(N.record)},component:D,scrollWidth:f,onVirtualScroll:function(N){var F=N.x;o({scrollLeft:F})},onScroll:C,extraRender:S},function(k,N,F){var U=l(k.record,N);return m.createElement(Jxe,ho({data:k,rowKey:U,index:N},F))})}else j=m.createElement(E,{className:Vn("".concat(c,"-placeholder"))},m.createElement(Bb,{component:W,prefixCls:c},d));return m.createElement(gKe.Provider,{value:R},j)}),yOt=XH(mOt),AOt=function(e,n){var o=n.ref,r=n.onScroll;return m.createElement(yOt,{ref:o,data:e,onScroll:r})};function wOt(t,e){var n=t.columns,o=t.scroll,r=t.sticky,i=t.prefixCls,a=i===void 0?hKe:i,l=t.className,s=t.listItemHeight,c=t.components,u=t.onScroll,d=o||{},f=d.x,p=d.y;typeof f!="number"&&(f=1),typeof p!="number"&&(p=500);var g=Ea(function(b,C){return Ag(c,b)||C}),y=Ea(u),w=m.useMemo(function(){return{sticky:r,scrollY:p,listItemHeight:s,getComponent:g,onScroll:y}},[r,p,s,g,y]);return m.createElement(mye.Provider,{value:w},m.createElement(JH,ho({},t,{className:Vn(l,"".concat(a,"-virtual")),scroll:qt(qt({},o),{},{x:f}),components:qt(qt({},c),{},{body:AOt}),columns:n,internalHooks:QW,tailor:!0,ref:e})))}var vOt=m.forwardRef(wOt);function mKe(t){return eKe(vOt,t)}mKe();function xOt(t){return null}function bOt(t){return null}function vue(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&(n[r]=t[r]);return n}function hQ(t,e){if(t==null)return{};var n=COt(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var xue={},ROt=function(e){};function HOt(t,e){}function MOt(t,e){}function IOt(){xue={}}function AKe(t,e,n){!e&&!xue[n]&&(t(!1,n),xue[n]=!0)}function b2(t,e){AKe(HOt,t,e)}function zOt(t,e){AKe(MOt,t,e)}b2.preMessage=ROt;b2.resetWarned=IOt;b2.noteOnce=zOt;function DOt(t,e){if(oA(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(oA(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wKe(t){var e=DOt(t,"string");return oA(e)==="symbol"?e:String(e)}function Yo(t,e,n){return e=wKe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kxe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Ru(t){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function FOt(t,e){if(e&&(oA(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wr(t)}function SKe(t){var e=EOt();return function(){var o=GG(t),r;if(e){var i=GG(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return FOt(this,r)}}var TKe={exports:{}};/*! + `]:{cursor:"not-allowed !important"}},[`&-tooltip ${n}-tooltip-inner`]:{minWidth:"unset"}})}},QJe=(t,e)=>{const{componentCls:n,railSize:o,handleSize:r,dotSize:i,marginFull:a,calc:l}=t,s=e?"paddingBlock":"paddingInline",c=e?"width":"height",u=e?"height":"width",d=e?"insetBlockStart":"insetInlineStart",f=e?"top":"insetInlineStart",p=l(o).mul(3).sub(r).div(2).equal(),g=l(r).sub(o).div(2).equal(),y=e?{borderWidth:`${Nt(g)} 0`,transform:`translateY(${Nt(l(g).mul(-1).equal())})`}:{borderWidth:`0 ${Nt(g)}`,transform:`translateX(${Nt(t.calc(g).mul(-1).equal())})`};return{[s]:o,[u]:l(o).mul(3).equal(),[`${n}-rail`]:{[c]:"100%",[u]:o},[`${n}-track,${n}-tracks`]:{[u]:o},[`${n}-track-draggable`]:Object.assign({},y),[`${n}-handle`]:{[d]:p},[`${n}-mark`]:{insetInlineStart:0,top:0,[f]:l(o).mul(3).add(e?0:a).equal(),[c]:"100%"},[`${n}-step`]:{insetInlineStart:0,top:0,[f]:o,[c]:"100%",[u]:o},[`${n}-dot`]:{position:"absolute",[d]:l(o).sub(i).div(2).equal()}}},$Bt=t=>{const{componentCls:e,marginPartWithMark:n}=t;return{[`${e}-horizontal`]:Object.assign(Object.assign({},QJe(t,!0)),{[`&${e}-with-marks`]:{marginBottom:n}})}},QBt=t=>{const{componentCls:e}=t;return{[`${e}-vertical`]:Object.assign(Object.assign({},QJe(t,!1)),{height:"100%"})}},ZBt=t=>{const n=t.controlHeightLG/4,o=t.controlHeightSM/2,r=t.lineWidth+1,i=t.lineWidth+1*3;return{controlSize:n,railSize:4,handleSize:n,handleSizeHover:o,dotSize:8,handleLineWidth:r,handleLineWidthHover:i,railBg:t.colorFillTertiary,railHoverBg:t.colorFillSecondary,trackBg:t.colorPrimaryBorder,trackHoverBg:t.colorPrimaryBorderHover,handleColor:t.colorPrimaryBorder,handleActiveColor:t.colorPrimary,handleColorDisabled:new kl(t.colorTextDisabled).onBackground(t.colorBgContainer).toHexShortString(),dotBorderColor:t.colorBorderSecondary,dotActiveBorderColor:t.colorPrimaryBorder,trackBgDisabled:t.colorBgContainerDisabled}},eYt=wl("Slider",t=>{const e=Ki(t,{marginPart:t.calc(t.controlHeight).sub(t.controlSize).div(2).equal(),marginFull:t.calc(t.controlSize).div(2).equal(),marginPartWithMark:t.calc(t.controlHeightLG).sub(t.controlSize).equal()});return[qBt(e),$Bt(e),QBt(e)]},ZBt);function gie(){const[t,e]=m.useState(!1),n=m.useRef(),o=()=>{Dg.cancel(n.current)},r=i=>{o(),i?e(i):n.current=Dg(()=>{e(i)})};return m.useEffect(()=>o,[]),[t,r]}var tYt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);rtypeof n=="number"?n.toString():""}const Iu=be.forwardRef((t,e)=>{const{prefixCls:n,range:o,className:r,rootClassName:i,style:a,disabled:l,tooltipPrefixCls:s,tipFormatter:c,tooltipVisible:u,getTooltipPopupContainer:d,tooltipPlacement:f,tooltip:p={},onChangeComplete:g}=t,y=tYt(t,["prefixCls","range","className","rootClassName","style","disabled","tooltipPrefixCls","tipFormatter","tooltipVisible","getTooltipPopupContainer","tooltipPlacement","tooltip","onChangeComplete"]),{vertical:w}=t,{direction:b,slider:C,getPrefixCls:P,getPopupContainer:v}=be.useContext(Cr),T=be.useContext(n1),A=l??T,[x,S]=gie(),[R,M]=gie(),D=Object.assign({},p),{open:E,placement:W,getPopupContainer:j,prefixCls:L,formatter:k}=D,N=E??u,F=(x||R)&&N!==!1,U=nYt(k,c),[O,B]=gie(),_=de=>{g==null||g(de),B(!1)},X=(de,Z)=>de||(Z?b==="rtl"?"left":"right":"top"),$=P("slider",n),[Q,le,q]=eYt($),te=Un(r,C==null?void 0:C.className,i,{[`${$}-rtl`]:b==="rtl",[`${$}-lock`]:O},le,q);b==="rtl"&&!y.vertical&&(y.reverse=!y.reverse);const[re,ae]=be.useMemo(()=>o?typeof o=="object"?[!0,o.draggableTrack]:[!0,!1]:[!1],[o]);be.useEffect(()=>{const de=()=>{Dg(()=>{M(!1)},1)};return document.addEventListener("mouseup",de),()=>{document.removeEventListener("mouseup",de)}},[]);const se=re&&!N,ne=(de,Z)=>{const{index:he}=Z,xe=de.props,He=Object.assign(Object.assign({},xe),{onMouseEnter:Ie=>{var ye;S(!0),(ye=xe.onMouseEnter)===null||ye===void 0||ye.call(xe,Ie)},onMouseLeave:Ie=>{var ye;S(!1),(ye=xe.onMouseLeave)===null||ye===void 0||ye.call(xe,Ie)},onMouseDown:Ie=>{var ye;M(!0),B(!0),(ye=xe.onMouseDown)===null||ye===void 0||ye.call(xe,Ie)},onFocus:Ie=>{var ye,ce;M(!0),(ye=y.onFocus)===null||ye===void 0||ye.call(y,Ie),(ce=xe.onFocus)===null||ce===void 0||ce.call(xe,Ie)},onBlur:Ie=>{var ye,ce;M(!1),(ye=y.onBlur)===null||ye===void 0||ye.call(y,Ie),(ce=xe.onBlur)===null||ce===void 0||ce.call(xe,Ie)}}),Se=be.cloneElement(de,He),ze=(!!N||F)&&U!==null;return se?Se:be.createElement(Oxe,Object.assign({},D,{prefixCls:P("tooltip",L??s),title:U?U(Z.value):"",open:ze,placement:X(W??f,w),key:he,overlayClassName:`${$}-tooltip`,getPopupContainer:j||d||v}),Se)},fe=se?(de,Z)=>{const he=be.cloneElement(de,{style:Object.assign(Object.assign({},de.props.style),{visibility:"hidden"})});return be.createElement(Oxe,Object.assign({},D,{prefixCls:P("tooltip",L??s),title:U?U(Z.value):"",open:U!==null&&F,placement:X(W??f,w),key:"tooltip",overlayClassName:`${$}-tooltip`,getPopupContainer:j||d||v}),he)}:void 0,ge=Object.assign(Object.assign({},C==null?void 0:C.style),a);return Q(be.createElement(KBt,Object.assign({},y,{step:y.step,range:re,draggableTrack:ae,className:te,style:ge,disabled:A,ref:e,prefixCls:$,handleRender:ne,activeHandleRender:fe,onChangeComplete:_})))});var oYt=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],ZJe=m.forwardRef(function(t,e){var n,o=t.prefixCls,r=o===void 0?"rc-switch":o,i=t.className,a=t.checked,l=t.defaultChecked,s=t.disabled,c=t.loadingIcon,u=t.checkedChildren,d=t.unCheckedChildren,f=t.onClick,p=t.onChange,g=t.onKeyDown,y=ii(t,oYt),w=zs(!1,{value:a,defaultValue:l}),b=ln(w,2),C=b[0],P=b[1];function v(S,R){var M=C;return s||(M=S,P(M),p==null||p(M,R)),M}function T(S){S.which===Bn.LEFT?v(!1,S):S.which===Bn.RIGHT&&v(!0,S),g==null||g(S)}function A(S){var R=v(!C,S);f==null||f(R,S)}var x=Vn(r,i,(n={},Vt(n,"".concat(r,"-checked"),C),Vt(n,"".concat(r,"-disabled"),s),n));return m.createElement("button",ho({},y,{type:"button",role:"switch","aria-checked":C,disabled:s,className:x,ref:e,onKeyDown:T,onClick:A}),c,m.createElement("span",{className:"".concat(r,"-inner")},m.createElement("span",{className:"".concat(r,"-inner-checked")},u),m.createElement("span",{className:"".concat(r,"-inner-unchecked")},d)))});ZJe.displayName="Switch";const rYt=t=>{const{componentCls:e,trackHeightSM:n,trackPadding:o,trackMinWidthSM:r,innerMinMarginSM:i,innerMaxMarginSM:a,handleSizeSM:l,calc:s}=t,c=`${e}-inner`,u=Nt(s(l).add(s(o).mul(2)).equal()),d=Nt(s(a).mul(2).equal());return{[e]:{[`&${e}-small`]:{minWidth:r,height:n,lineHeight:Nt(n),[`${e}-inner`]:{paddingInlineStart:a,paddingInlineEnd:i,[`${c}-checked, ${c}-unchecked`]:{minHeight:n},[`${c}-checked`]:{marginInlineStart:`calc(-100% + ${u} - ${d})`,marginInlineEnd:`calc(100% - ${u} + ${d})`},[`${c}-unchecked`]:{marginTop:s(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`${e}-handle`]:{width:l,height:l},[`${e}-loading-icon`]:{top:s(s(l).sub(t.switchLoadingIconSize)).div(2).equal(),fontSize:t.switchLoadingIconSize},[`&${e}-checked`]:{[`${e}-inner`]:{paddingInlineStart:i,paddingInlineEnd:a,[`${c}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${c}-unchecked`]:{marginInlineStart:`calc(100% - ${u} + ${d})`,marginInlineEnd:`calc(-100% + ${u} - ${d})`}},[`${e}-handle`]:{insetInlineStart:`calc(100% - ${Nt(s(l).add(o).equal())})`}},[`&:not(${e}-disabled):active`]:{[`&:not(${e}-checked) ${c}`]:{[`${c}-unchecked`]:{marginInlineStart:s(t.marginXXS).div(2).equal(),marginInlineEnd:s(t.marginXXS).mul(-1).div(2).equal()}},[`&${e}-checked ${c}`]:{[`${c}-checked`]:{marginInlineStart:s(t.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:s(t.marginXXS).div(2).equal()}}}}}}},iYt=t=>{const{componentCls:e,handleSize:n,calc:o}=t;return{[e]:{[`${e}-loading-icon${t.iconCls}`]:{position:"relative",top:o(o(n).sub(t.fontSize)).div(2).equal(),color:t.switchLoadingIconColor,verticalAlign:"top"},[`&${e}-checked ${e}-loading-icon`]:{color:t.switchColor}}}},aYt=t=>{const{componentCls:e,trackPadding:n,handleBg:o,handleShadow:r,handleSize:i,calc:a}=t,l=`${e}-handle`;return{[e]:{[l]:{position:"absolute",top:n,insetInlineStart:n,width:i,height:i,transition:`all ${t.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:o,borderRadius:a(i).div(2).equal(),boxShadow:r,transition:`all ${t.switchDuration} ease-in-out`,content:'""'}},[`&${e}-checked ${l}`]:{insetInlineStart:`calc(100% - ${Nt(a(i).add(n).equal())})`},[`&:not(${e}-disabled):active`]:{[`${l}::before`]:{insetInlineEnd:t.switchHandleActiveInset,insetInlineStart:0},[`&${e}-checked ${l}::before`]:{insetInlineEnd:0,insetInlineStart:t.switchHandleActiveInset}}}}},lYt=t=>{const{componentCls:e,trackHeight:n,trackPadding:o,innerMinMargin:r,innerMaxMargin:i,handleSize:a,calc:l}=t,s=`${e}-inner`,c=Nt(l(a).add(l(o).mul(2)).equal()),u=Nt(l(i).mul(2).equal());return{[e]:{[s]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:i,paddingInlineEnd:r,transition:`padding-inline-start ${t.switchDuration} ease-in-out, padding-inline-end ${t.switchDuration} ease-in-out`,[`${s}-checked, ${s}-unchecked`]:{display:"block",color:t.colorTextLightSolid,fontSize:t.fontSizeSM,transition:`margin-inline-start ${t.switchDuration} ease-in-out, margin-inline-end ${t.switchDuration} ease-in-out`,pointerEvents:"none",minHeight:n},[`${s}-checked`]:{marginInlineStart:`calc(-100% + ${c} - ${u})`,marginInlineEnd:`calc(100% - ${c} + ${u})`},[`${s}-unchecked`]:{marginTop:l(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`&${e}-checked ${s}`]:{paddingInlineStart:r,paddingInlineEnd:i,[`${s}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${s}-unchecked`]:{marginInlineStart:`calc(100% - ${c} + ${u})`,marginInlineEnd:`calc(-100% + ${c} - ${u})`}},[`&:not(${e}-disabled):active`]:{[`&:not(${e}-checked) ${s}`]:{[`${s}-unchecked`]:{marginInlineStart:l(o).mul(2).equal(),marginInlineEnd:l(o).mul(-1).mul(2).equal()}},[`&${e}-checked ${s}`]:{[`${s}-checked`]:{marginInlineStart:l(o).mul(-1).mul(2).equal(),marginInlineEnd:l(o).mul(2).equal()}}}}}},sYt=t=>{const{componentCls:e,trackHeight:n,trackMinWidth:o}=t;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},ja(t)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:o,height:n,lineHeight:`${Nt(n)}`,verticalAlign:"middle",background:t.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${t.motionDurationMid}`,userSelect:"none",[`&:hover:not(${e}-disabled)`]:{background:t.colorTextTertiary}}),Q6(t)),{[`&${e}-checked`]:{background:t.switchColor,[`&:hover:not(${e}-disabled)`]:{background:t.colorPrimaryHover}},[`&${e}-loading, &${e}-disabled`]:{cursor:"not-allowed",opacity:t.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${e}-rtl`]:{direction:"rtl"}})}},cYt=t=>{const{fontSize:e,lineHeight:n,controlHeight:o,colorWhite:r}=t,i=e*n,a=o/2,l=2,s=i-l*2,c=a-l*2;return{trackHeight:i,trackHeightSM:a,trackMinWidth:s*2+l*4,trackMinWidthSM:c*2+l*2,trackPadding:l,handleBg:r,handleSize:s,handleSizeSM:c,handleShadow:`0 2px 4px 0 ${new kl("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:s/2,innerMaxMargin:s+l+l*2,innerMinMarginSM:c/2,innerMaxMarginSM:c+l+l*2}},uYt=wl("Switch",t=>{const e=Ki(t,{switchDuration:t.motionDurationMid,switchColor:t.colorPrimary,switchDisabledOpacity:t.opacityLoading,switchLoadingIconSize:t.calc(t.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:`rgba(0, 0, 0, ${t.opacityLoading})`,switchHandleActiveInset:"-30%"});return[sYt(e),lYt(e),aYt(e),iYt(e),rYt(e)]},cYt);var dYt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:n,size:o,disabled:r,loading:i,className:a,rootClassName:l,style:s,checked:c,value:u,defaultChecked:d,defaultValue:f,onChange:p}=t,g=dYt(t,["prefixCls","size","disabled","loading","className","rootClassName","style","checked","value","defaultChecked","defaultValue","onChange"]),[y,w]=$6(!1,{value:c??u,defaultValue:d??f}),{getPrefixCls:b,direction:C,switch:P}=m.useContext(Cr),v=m.useContext(n1),T=(r??v)||i,A=b("switch",n),x=m.createElement("div",{className:`${A}-handle`},i&&m.createElement(UH,{className:`${A}-loading-icon`})),[S,R,M]=uYt(A),D=Ed(o),E=Un(P==null?void 0:P.className,{[`${A}-small`]:D==="small",[`${A}-loading`]:i,[`${A}-rtl`]:C==="rtl"},a,l,R,M),W=Object.assign(Object.assign({},P==null?void 0:P.style),s),j=function(){w(arguments.length<=0?void 0:arguments[0]),p==null||p.apply(void 0,arguments)};return S(m.createElement(FW,{component:"Switch"},m.createElement(ZJe,Object.assign({},g,{checked:y,onChange:j,prefixCls:A,className:E,style:W,disabled:T,ref:e,loadingIcon:x}))))}),xc=fYt;xc.__ANT_SWITCH=!0;var J4={},ZW="rc-table-internal-hook";function hye(t){var e=m.createContext(void 0),n=function(r){var i=r.value,a=r.children,l=m.useRef(i);l.current=i;var s=m.useState(function(){return{getValue:function(){return l.current},listeners:new Set}}),c=ln(s,1),u=c[0];return Xa(function(){Cd.unstable_batchedUpdates(function(){u.listeners.forEach(function(d){d(i)})})},[i]),m.createElement(e.Provider,{value:u},a)};return{Context:e,Provider:n,defaultValue:t}}function Ah(t,e){var n=Ea(typeof e=="function"?e:function(d){if(e===void 0)return d;if(!Array.isArray(e))return d[e];var f={};return e.forEach(function(p){f[p]=d[p]}),f}),o=m.useContext(t==null?void 0:t.Context),r=o||{},i=r.listeners,a=r.getValue,l=m.useRef();l.current=n(o?a():t==null?void 0:t.defaultValue);var s=m.useState({}),c=ln(s,2),u=c[1];return Xa(function(){if(!o)return;function d(f){var p=n(f);iw(l.current,p,!0)||u({})}return i.add(d),function(){i.delete(d)}},[o]),l.current}function hYt(){var t=m.createContext(null);function e(){return m.useContext(t)}function n(r,i){var a=rw(r),l=function(c,u){var d=a?{ref:u}:{},f=m.useRef(0),p=m.useRef(c),g=e();return g!==null?m.createElement(r,ho({},c,d)):((!i||i(p.current,c))&&(f.current+=1),p.current=c,m.createElement(t.Provider,{value:f.current},m.createElement(r,ho({},c,d))))};return a?m.forwardRef(l):l}function o(r,i){var a=rw(r),l=function(c,u){var d=a?{ref:u}:{};return e(),m.createElement(r,ho({},c,d))};return a?m.memo(m.forwardRef(l),i):m.memo(l,i)}return{makeImmutable:n,responseImmutable:o,useImmutableMark:e}}var pye=hYt(),eKe=pye.makeImmutable,XH=pye.responseImmutable,pYt=pye.useImmutableMark,h1=hye(),tKe=m.createContext({renderWithProps:!1}),gYt="RC_TABLE_KEY";function mYt(t){return t==null?[]:Array.isArray(t)?t:[t]}function dQ(t){var e=[],n={};return t.forEach(function(o){for(var r=o||{},i=r.key,a=r.dataIndex,l=i||mYt(a).join("-")||gYt;n[l];)l="".concat(l,"_next");n[l]=!0,e.push(l)}),e}function Aue(t){return t!=null}function yYt(t){return t&&hi(t)==="object"&&!Array.isArray(t)&&!m.isValidElement(t)}function AYt(t,e,n,o,r,i){var a=m.useContext(tKe),l=pYt(),s=RW(function(){if(Aue(o))return[o];var c=e==null||e===""?[]:Array.isArray(e)?e:[e],u=Ag(t,c),d=u,f=void 0;if(r){var p=r(u,t,n);yYt(p)?(d=p.children,f=p.props,a.renderWithProps=!0):d=p}return[d,f]},[l,t,o,e,r,n],function(c,u){if(i){var d=ln(c,2),f=d[1],p=ln(u,2),g=p[1];return i(g,f)}return a.renderWithProps?!0:!iw(c,u,!0)});return s}function wYt(t,e,n,o){var r=t+e-1;return t<=o&&r>=n}function vYt(t,e){return Ah(h1,function(n){var o=wYt(t,e||1,n.hoverStartRow,n.hoverEndRow);return[o,n.onHover]})}var xYt=function(e){var n=e.ellipsis,o=e.rowType,r=e.children,i,a=n===!0?{showTitle:!0}:n;return a&&(a.showTitle||o==="header")&&(typeof r=="string"||typeof r=="number"?i=r.toString():m.isValidElement(r)&&typeof r.props.children=="string"&&(i=r.props.children)),i};function bYt(t){var e,n,o,r,i,a,l,s,c=t.component,u=t.children,d=t.ellipsis,f=t.scope,p=t.prefixCls,g=t.className,y=t.align,w=t.record,b=t.render,C=t.dataIndex,P=t.renderIndex,v=t.shouldCellUpdate,T=t.index,A=t.rowType,x=t.colSpan,S=t.rowSpan,R=t.fixLeft,M=t.fixRight,D=t.firstFixLeft,E=t.lastFixLeft,W=t.firstFixRight,j=t.lastFixRight,L=t.appendNode,k=t.additionalProps,N=k===void 0?{}:k,F=t.isSticky,U="".concat(p,"-cell"),O=Ah(h1,["supportSticky","allColumnsFixedLeft","rowHoverable"]),B=O.supportSticky,_=O.allColumnsFixedLeft,X=O.rowHoverable,$=AYt(w,C,P,u,b,v),Q=ln($,2),le=Q[0],q=Q[1],te={},re=typeof R=="number"&&B,ae=typeof M=="number"&&B;re&&(te.position="sticky",te.left=R),ae&&(te.position="sticky",te.right=M);var se=(e=(n=(o=q==null?void 0:q.colSpan)!==null&&o!==void 0?o:N.colSpan)!==null&&n!==void 0?n:x)!==null&&e!==void 0?e:1,ne=(r=(i=(a=q==null?void 0:q.rowSpan)!==null&&a!==void 0?a:N.rowSpan)!==null&&i!==void 0?i:S)!==null&&r!==void 0?r:1,fe=vYt(T,ne),ge=ln(fe,2),de=ge[0],Z=ge[1],he=Ea(function(ce){var pe;w&&Z(T,T+ne-1),N==null||(pe=N.onMouseEnter)===null||pe===void 0||pe.call(N,ce)}),xe=Ea(function(ce){var pe;w&&Z(-1,-1),N==null||(pe=N.onMouseLeave)===null||pe===void 0||pe.call(N,ce)});if(se===0||ne===0)return null;var He=(l=N.title)!==null&&l!==void 0?l:xYt({rowType:A,ellipsis:d,children:le}),Se=Vn(U,g,(s={},Vt(Vt(Vt(Vt(Vt(Vt(Vt(Vt(Vt(Vt(s,"".concat(U,"-fix-left"),re&&B),"".concat(U,"-fix-left-first"),D&&B),"".concat(U,"-fix-left-last"),E&&B),"".concat(U,"-fix-left-all"),E&&_&&B),"".concat(U,"-fix-right"),ae&&B),"".concat(U,"-fix-right-first"),W&&B),"".concat(U,"-fix-right-last"),j&&B),"".concat(U,"-ellipsis"),d),"".concat(U,"-with-append"),L),"".concat(U,"-fix-sticky"),(re||ae)&&F&&B),Vt(s,"".concat(U,"-row-hover"),!q&&de)),N.className,q==null?void 0:q.className),ze={};y&&(ze.textAlign=y);var Ie=qt(qt(qt(qt({},te),N.style),ze),q==null?void 0:q.style),ye=le;return hi(ye)==="object"&&!Array.isArray(ye)&&!m.isValidElement(ye)&&(ye=null),d&&(E||W)&&(ye=m.createElement("span",{className:"".concat(U,"-content")},ye)),m.createElement(c,ho({},q,N,{className:Se,style:Ie,title:He,scope:f,onMouseEnter:X?he:void 0,onMouseLeave:X?xe:void 0,colSpan:se!==1?se:null,rowSpan:ne!==1?ne:null}),L,ye)}const Bb=m.memo(bYt);function gye(t,e,n,o,r){var i=n[t]||{},a=n[e]||{},l,s;i.fixed==="left"?l=o.left[r==="rtl"?e:t]:a.fixed==="right"&&(s=o.right[r==="rtl"?t:e]);var c=!1,u=!1,d=!1,f=!1,p=n[e+1],g=n[t-1],y=p&&!p.fixed||g&&!g.fixed||n.every(function(v){return v.fixed==="left"});if(r==="rtl"){if(l!==void 0){var w=g&&g.fixed==="left";f=!w&&y}else if(s!==void 0){var b=p&&p.fixed==="right";d=!b&&y}}else if(l!==void 0){var C=p&&p.fixed==="left";c=!C&&y}else if(s!==void 0){var P=g&&g.fixed==="right";u=!P&&y}return{fixLeft:l,fixRight:s,lastFixLeft:c,firstFixRight:u,lastFixRight:d,firstFixLeft:f,isSticky:o.isSticky}}var nKe=m.createContext({});function SYt(t){var e=t.className,n=t.index,o=t.children,r=t.colSpan,i=r===void 0?1:r,a=t.rowSpan,l=t.align,s=Ah(h1,["prefixCls","direction"]),c=s.prefixCls,u=s.direction,d=m.useContext(nKe),f=d.scrollColumnIndex,p=d.stickyOffsets,g=d.flattenColumns,y=n+i-1,w=y+1===f?i+1:i,b=gye(n,n+w-1,g,p,u);return m.createElement(Bb,ho({className:e,index:n,component:"td",prefixCls:c,record:null,dataIndex:null,align:l,colSpan:w,rowSpan:a,render:function(){return o}},b))}var TYt=["children"];function PYt(t){var e=t.children,n=ii(t,TYt);return m.createElement("tr",n,e)}function fQ(t){var e=t.children;return e}fQ.Row=PYt;fQ.Cell=SYt;function CYt(t){var e=t.children,n=t.stickyOffsets,o=t.flattenColumns,r=Ah(h1,"prefixCls"),i=o.length-1,a=o[i],l=m.useMemo(function(){return{stickyOffsets:n,flattenColumns:o,scrollColumnIndex:a!=null&&a.scrollbar?i:null}},[a,o,i,n]);return m.createElement(nKe.Provider,{value:l},m.createElement("tfoot",{className:"".concat(r,"-summary")},e))}const UY=XH(CYt);var oKe=fQ;function RYt(t){return null}function HYt(t){return null}var rKe=function(e){if(dp()&&window.document.documentElement){var n=Array.isArray(e)?e:[e],o=window.document.documentElement;return n.some(function(r){return r in o.style})}return!1},MYt=function(e,n){if(!rKe(e))return!1;var o=document.createElement("div"),r=o.style[e];return o.style[e]=n,o.style[e]!==r};function IYt(t,e){return!Array.isArray(t)&&e!==void 0?MYt(t,e):rKe(t)}function iKe(t,e,n,o,r,i,a){t.push({record:e,indent:n,index:a});var l=i(e),s=r==null?void 0:r.has(l);if(e&&Array.isArray(e[o])&&s)for(var c=0;c1?D-1:0),W=1;W=1?T:""),style:qt(qt({},n),b==null?void 0:b.style)}),g.map(function(R,M){var D=R.render,E=R.dataIndex,W=R.className,j=cKe(f,R,M,s,r),L=j.key,k=j.fixedInfo,N=j.appendCellNode,F=j.additionalCellProps;return m.createElement(Bb,ho({className:W,ellipsis:R.ellipsis,align:R.align,scope:R.rowScope,component:R.rowScope?d:u,prefixCls:p,key:L,record:o,index:r,renderIndex:i,dataIndex:E,render:D,shouldCellUpdate:R.shouldCellUpdate},k,{appendNode:N,additionalProps:F}))})),x;if(P&&(v.current||C)){var S=w(o,r,s+1,C);x=m.createElement(sKe,{expanded:C,className:Vn("".concat(p,"-expanded-row"),"".concat(p,"-expanded-row-level-").concat(s+1),T),prefixCls:p,component:c,cellComponent:u,colSpan:g.length,isEmpty:!1},S)}return m.createElement(m.Fragment,null,A,x)}const DYt=XH(zYt);function EYt(t){var e=t.columnKey,n=t.onColumnResize,o=m.useRef();return m.useEffect(function(){o.current&&n(e,o.current.offsetWidth)},[]),m.createElement(Td,{data:e},m.createElement("td",{ref:o,style:{padding:0,border:0,height:0}},m.createElement("div",{style:{height:0,overflow:"hidden"}}," ")))}function FYt(t){var e=t.prefixCls,n=t.columnsKey,o=t.onColumnResize;return m.createElement("tr",{"aria-hidden":"true",className:"".concat(e,"-measure-row"),style:{height:0,fontSize:0}},m.createElement(Td.Collection,{onBatchResize:function(i){i.forEach(function(a){var l=a.data,s=a.size;o(l,s.offsetWidth)})}},n.map(function(r){return m.createElement(EYt,{key:r,columnKey:r,onColumnResize:o})})))}function kYt(t){var e=t.data,n=t.measureColumnWidth,o=Ah(h1,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode"]),r=o.prefixCls,i=o.getComponent,a=o.onColumnResize,l=o.flattenColumns,s=o.getRowKey,c=o.expandedKeys,u=o.childrenColumnName,d=o.emptyNode,f=aKe(e,u,c,s),p=m.useRef({renderWithProps:!1}),g=i(["body","wrapper"],"tbody"),y=i(["body","row"],"tr"),w=i(["body","cell"],"td"),b=i(["body","cell"],"th"),C;e.length?C=f.map(function(v,T){var A=v.record,x=v.indent,S=v.index,R=s(A,T);return m.createElement(DYt,{key:R,rowKey:R,record:A,index:T,renderIndex:S,rowComponent:y,cellComponent:w,scopeCellComponent:b,getRowKey:s,indent:x})}):C=m.createElement(sKe,{expanded:!0,className:"".concat(r,"-placeholder"),prefixCls:r,component:y,cellComponent:w,colSpan:l.length,isEmpty:!0},d);var P=dQ(l);return m.createElement(tKe.Provider,{value:p.current},m.createElement(g,{className:"".concat(r,"-tbody")},n&&m.createElement(FYt,{prefixCls:r,columnsKey:P,onColumnResize:a}),C))}const LYt=XH(kYt);var WYt=["expandable"],SE="RC_TABLE_INTERNAL_COL_DEFINE";function NYt(t){var e=t.expandable,n=ii(t,WYt),o;return"expandable"in t?o=qt(qt({},n),e):o=n,o.showExpandColumn===!1&&(o.expandIconColumnIndex=-1),o}var UYt=["columnType"];function uKe(t){for(var e=t.colWidths,n=t.columns,o=t.columCount,r=[],i=o||n.length,a=!1,l=i-1;l>=0;l-=1){var s=e[l],c=n&&n[l],u=c&&c[SE];if(s||u||a){var d=u||{};d.columnType;var f=ii(d,UYt);r.unshift(m.createElement("col",ho({key:l,style:{width:s}},f))),a=!0}}return m.createElement("colgroup",null,r)}var jYt=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function BYt(t,e){return m.useMemo(function(){for(var n=[],o=0;o1?"colgroup":"col":null,ellipsis:w.ellipsis,align:w.align,component:a,prefixCls:u,key:p[y]},b,{additionalProps:C,rowType:"header"}))}))};function _Yt(t){var e=[];function n(a,l){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;e[s]=e[s]||[];var c=l,u=a.filter(Boolean).map(function(d){var f={key:d.key,className:d.className||"",children:d.title,column:d,colStart:c},p=1,g=d.children;return g&&g.length>0&&(p=n(g,c,s+1).reduce(function(y,w){return y+w},0),f.hasSubColumns=!0),"colSpan"in d&&(p=d.colSpan),"rowSpan"in d&&(f.rowSpan=d.rowSpan),f.colSpan=p,f.colEnd=f.colStart+p-1,e[s].push(f),c+=p,p});return u}n(t,0);for(var o=e.length,r=function(l){e[l].forEach(function(s){!("rowSpan"in s)&&!s.hasSubColumns&&(s.rowSpan=o-l)})},i=0;i1&&arguments[1]!==void 0?arguments[1]:"";return typeof e=="number"?e:e.endsWith("%")?t*parseFloat(e)/100:null}function GYt(t,e,n){return m.useMemo(function(){if(e&&e>0){var o=0,r=0;t.forEach(function(f){var p=Gxe(e,f.width);p?o+=p:r+=1});var i=Math.max(e,n),a=Math.max(i-o,r),l=r,s=a/r,c=0,u=t.map(function(f){var p=qt({},f),g=Gxe(e,p.width);if(g)p.width=g;else{var y=Math.floor(s);p.width=l===1?a:y,a-=y,l-=1}return c+=p.width,p});if(c0?qt(qt({},e),{},{children:dKe(n)}):e})}function wue(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key";return t.filter(function(n){return n&&hi(n)==="object"}).reduce(function(n,o,r){var i=o.fixed,a=i===!0?"left":i,l="".concat(e,"-").concat(r),s=o.children;return s&&s.length>0?[].concat(Lo(n),Lo(wue(s,l).map(function(c){return qt({fixed:a},c)}))):[].concat(Lo(n),[qt(qt({key:l},o),{},{fixed:a})])},[])}function KYt(t){return t.map(function(e){var n=e.fixed,o=ii(e,JYt),r=n;return n==="left"?r="right":n==="right"&&(r="left"),qt({fixed:r},o)})}function qYt(t,e){var n=t.prefixCls,o=t.columns,r=t.children,i=t.expandable,a=t.expandedKeys,l=t.columnTitle,s=t.getRowKey,c=t.onTriggerExpand,u=t.expandIcon,d=t.rowExpandable,f=t.expandIconColumnIndex,p=t.direction,g=t.expandRowByClick,y=t.columnWidth,w=t.fixed,b=t.scrollWidth,C=t.clientWidth,P=m.useMemo(function(){var E=o||mye(r)||[];return dKe(E.slice())},[o,r]),v=m.useMemo(function(){if(i){var E=P.slice();if(!E.includes(J4)){var W=f||0;W>=0&&E.splice(W,0,J4)}var j=E.indexOf(J4);E=E.filter(function(F,U){return F!==J4||U===j});var L=P[j],k;(w==="left"||w)&&!f?k="left":(w==="right"||w)&&f===P.length?k="right":k=L?L.fixed:null;var N=Vt(Vt(Vt(Vt(Vt(Vt({},SE,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",l),"fixed",k),"className","".concat(n,"-row-expand-icon-cell")),"width",y),"render",function(U,O,B){var _=s(O,B),X=a.has(_),$=d?d(O):!0,Q=u({prefixCls:n,expanded:X,expandable:$,record:O,onExpand:c});return g?m.createElement("span",{onClick:function(q){return q.stopPropagation()}},Q):Q});return E.map(function(F){return F===J4?N:F})}return P.filter(function(F){return F!==J4})},[i,P,s,a,u,p]),T=m.useMemo(function(){var E=v;return e&&(E=e(E)),E.length||(E=[{render:function(){return null}}]),E},[e,v,p]),A=m.useMemo(function(){return p==="rtl"?KYt(wue(T)):wue(T)},[T,p,b]),x=m.useMemo(function(){for(var E=-1,W=A.length-1;W>=0;W-=1){var j=A[W].fixed;if(j==="left"||j===!0){E=W;break}}if(E>=0)for(var L=0;L<=E;L+=1){var k=A[L].fixed;if(k!=="left"&&k!==!0)return!0}var N=A.findIndex(function(O){var B=O.fixed;return B==="right"});if(N>=0)for(var F=N;F=d&&(F=d-f),a({scrollLeft:F/d*(u+2)}),C.current.x=j.pageX},D=function(){x.current=Fa(function(){if(i.current){var j=Fxe(i.current).top,L=j+i.current.offsetHeight,k=s===window?document.documentElement.scrollTop+window.innerHeight:Fxe(s).top+s.clientHeight;L-D0e()<=k||j>=k-l?b(function(N){return qt(qt({},N),{},{isHiddenScrollBar:!0})}):b(function(N){return qt(qt({},N),{},{isHiddenScrollBar:!1})})}})},E=function(j){b(function(L){return qt(qt({},L),{},{scrollLeft:j/u*d||0})})};return m.useImperativeHandle(n,function(){return{setScrollLeft:E,checkScrollBarVisible:D}}),m.useEffect(function(){var W=NY(document.body,"mouseup",S,!1),j=NY(document.body,"mousemove",M,!1);return D(),function(){W.remove(),j.remove()}},[f,T]),m.useEffect(function(){var W=NY(s,"scroll",D,!1),j=NY(window,"resize",D,!1);return function(){W.remove(),j.remove()}},[s]),m.useEffect(function(){w.isHiddenScrollBar||b(function(W){var j=i.current;return j?qt(qt({},W),{},{scrollLeft:j.scrollLeft/j.scrollWidth*j.clientWidth}):W})},[w.isHiddenScrollBar]),u<=d||!f||w.isHiddenScrollBar?null:m.createElement("div",{style:{height:D0e(),width:d,bottom:l},className:"".concat(c,"-sticky-scroll")},m.createElement("div",{onMouseDown:R,ref:p,className:Vn("".concat(c,"-sticky-scroll-bar"),Vt({},"".concat(c,"-sticky-scroll-bar-active"),T)),style:{width:"".concat(f,"px"),transform:"translate3d(".concat(w.scrollLeft,"px, 0, 0)")}}))};const aOt=m.forwardRef(iOt);var hKe="rc-table",lOt=[],sOt={};function cOt(){return"No Data"}function uOt(t,e){var n=qt({rowKey:"key",prefixCls:hKe,emptyText:cOt},t),o=n.prefixCls,r=n.className,i=n.rowClassName,a=n.style,l=n.data,s=n.rowKey,c=n.scroll,u=n.tableLayout,d=n.direction,f=n.title,p=n.footer,g=n.summary,y=n.caption,w=n.id,b=n.showHeader,C=n.components,P=n.emptyText,v=n.onRow,T=n.onHeaderRow,A=n.onScroll,x=n.internalHooks,S=n.transformColumns,R=n.internalRefs,M=n.tailor,D=n.getContainerWidth,E=n.sticky,W=n.rowHoverable,j=W===void 0?!0:W,L=l||lOt,k=!!L.length,N=x===ZW,F=m.useCallback(function(xo,Qo){return Ag(C,xo)||Qo},[C]),U=m.useMemo(function(){return typeof s=="function"?s:function(xo){var Qo=xo&&xo[s];return Qo}},[s]),O=F(["body"]),B=nOt(),_=ln(B,3),X=_[0],$=_[1],Q=_[2],le=ZYt(n,L,U),q=ln(le,6),te=q[0],re=q[1],ae=q[2],se=q[3],ne=q[4],fe=q[5],ge=c==null?void 0:c.x,de=m.useState(0),Z=ln(de,2),he=Z[0],xe=Z[1],He=qYt(qt(qt(qt({},n),te),{},{expandable:!!te.expandedRowRender,columnTitle:te.columnTitle,expandedKeys:ae,getRowKey:U,onTriggerExpand:fe,expandIcon:se,expandIconColumnIndex:te.expandIconColumnIndex,direction:d,scrollWidth:N&&M&&typeof ge=="number"?ge:null,clientWidth:he}),N?S:null),Se=ln(He,4),ze=Se[0],Ie=Se[1],ye=Se[2],ce=Se[3],pe=ye??ge,ve=m.useMemo(function(){return{columns:ze,flattenColumns:Ie}},[ze,Ie]),Ae=m.useRef(),Te=m.useRef(),Me=m.useRef(),Pe=m.useRef();m.useImperativeHandle(e,function(){return{nativeElement:Ae.current,scrollTo:function(Qo){var jo;if(Me.current instanceof HTMLElement){var lr=Qo.index,fr=Qo.top,ai=Qo.key;if(fr){var hr;(hr=Me.current)===null||hr===void 0||hr.scrollTo({top:fr})}else{var tr,xi=ai??U(L[lr]);(tr=Me.current.querySelector('[data-row-key="'.concat(xi,'"]')))===null||tr===void 0||tr.scrollIntoView()}}else(jo=Me.current)!==null&&jo!==void 0&&jo.scrollTo&&Me.current.scrollTo(Qo)}}});var Ee=m.useRef(),Be=m.useState(!1),Je=ln(Be,2),We=Je[0],Ke=Je[1],Ne=m.useState(!1),De=ln(Ne,2),ke=De[0],Ye=De[1],it=fKe(new Map),Ve=ln(it,2),yt=Ve[0],ct=Ve[1],Xe=dQ(Ie),ut=Xe.map(function(xo){return yt.get(xo)}),ft=m.useMemo(function(){return ut},[ut.join("_")]),ot=rOt(ft,Ie,d),st=c&&Aue(c.y),at=c&&Aue(pe)||!!te.fixed,Oe=at&&Ie.some(function(xo){var Qo=xo.fixed;return Qo}),Ze=m.useRef(),St=oOt(E,o),Pt=St.isSticky,Rt=St.offsetHeader,Ut=St.offsetSummary,Ht=St.offsetScroll,At=St.stickyClassName,kt=St.container,gt=m.useMemo(function(){return g==null?void 0:g(L)},[g,L]),dt=(st||Pt)&&m.isValidElement(gt)&>.type===fQ&>.props.fixed,Ct,tt,Fe;st&&(tt={overflowY:"scroll",maxHeight:c.y}),at&&(Ct={overflowX:"auto"},st||(tt={overflowY:"hidden"}),Fe={width:pe===!0?"auto":pe,minWidth:"100%"});var qe=m.useCallback(function(xo,Qo){V$(Ae.current)&&ct(function(jo){if(jo.get(xo)!==Qo){var lr=new Map(jo);return lr.set(xo,Qo),lr}return jo})},[]),je=tOt(),rt=ln(je,2),mt=rt[0],Qe=rt[1];function Tt(xo,Qo){Qo&&(typeof Qo=="function"?Qo(xo):Qo.scrollLeft!==xo&&(Qo.scrollLeft=xo,Qo.scrollLeft!==xo&&setTimeout(function(){Qo.scrollLeft=xo},0)))}var Dt=Ea(function(xo){var Qo=xo.currentTarget,jo=xo.scrollLeft,lr=d==="rtl",fr=typeof jo=="number"?jo:Qo.scrollLeft,ai=Qo||sOt;if(!Qe()||Qe()===ai){var hr;mt(ai),Tt(fr,Te.current),Tt(fr,Me.current),Tt(fr,Ee.current),Tt(fr,(hr=Ze.current)===null||hr===void 0?void 0:hr.setScrollLeft)}var tr=Qo||Te.current;if(tr){var xi=tr.scrollWidth,Eo=tr.clientWidth;if(xi===Eo){Ke(!1),Ye(!1);return}lr?(Ke(-fr0)):(Ke(fr>0),Ye(fr1?w-j:0,k=qt(qt(qt({},S),c),{},{flex:"0 0 ".concat(j,"px"),width:"".concat(j,"px"),marginRight:L,pointerEvents:"auto"}),N=m.useMemo(function(){return d?E<=1:M===0||E===0||E>1},[E,M,d]);N?k.visibility="hidden":d&&(k.height=f==null?void 0:f(E));var F=N?function(){return null}:p,U={};return(E===0||M===0)&&(U.rowSpan=1,U.colSpan=1),m.createElement(Bb,ho({className:Vn(y,u),ellipsis:n.ellipsis,align:n.align,scope:n.rowScope,component:a,prefixCls:e.prefixCls,key:v,record:s,index:i,renderIndex:l,dataIndex:g,render:F,shouldCellUpdate:n.shouldCellUpdate},T,{appendNode:A,additionalProps:qt(qt({},x),{},{style:k},U)}))}var pOt=["data","index","className","rowKey","style","extra","getHeight"],gOt=m.forwardRef(function(t,e){var n=t.data,o=t.index,r=t.className,i=t.rowKey,a=t.style,l=t.extra,s=t.getHeight,c=ii(t,pOt),u=n.record,d=n.indent,f=n.index,p=Ah(h1,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),g=p.scrollX,y=p.flattenColumns,w=p.prefixCls,b=p.fixColumn,C=p.componentWidth,P=Ah(yye,["getComponent"]),v=P.getComponent,T=lKe(u,i,o,d),A=v(["body","row"],"div"),x=v(["body","cell"],"div"),S=T.rowSupportExpand,R=T.expanded,M=T.rowProps,D=T.expandedRowRender,E=T.expandedRowClassName,W;if(S&&R){var j=D(u,o,d+1,R),L=E==null?void 0:E(u,o,d),k={};b&&(k={style:Vt({},"--virtual-width","".concat(C,"px"))});var N="".concat(w,"-expanded-row-cell");W=m.createElement(A,{className:Vn("".concat(w,"-expanded-row"),"".concat(w,"-expanded-row-level-").concat(d+1),L)},m.createElement(Bb,{component:x,prefixCls:w,className:Vn(N,Vt({},"".concat(N,"-fixed"),b)),additionalProps:k},j))}var F=qt(qt({},a),{},{width:g});l&&(F.position="absolute",F.pointerEvents="none");var U=m.createElement(A,ho({},M,c,{"data-row-key":i,ref:S?null:e,className:Vn(r,"".concat(w,"-row"),M==null?void 0:M.className,Vt({},"".concat(w,"-row-extra"),l)),style:qt(qt({},F),M==null?void 0:M.style)}),y.map(function(O,B){return m.createElement(hOt,{key:B,component:x,rowInfo:T,column:O,colIndex:B,indent:d,index:o,renderIndex:f,record:u,inverse:l,getHeight:s})}));return S?m.createElement("div",{ref:e},U,W):U}),Kxe=XH(gOt),mOt=m.forwardRef(function(t,e){var n=t.data,o=t.onScroll,r=Ah(h1,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","emptyNode","scrollX"]),i=r.flattenColumns,a=r.onColumnResize,l=r.getRowKey,s=r.expandedKeys,c=r.prefixCls,u=r.childrenColumnName,d=r.emptyNode,f=r.scrollX,p=Ah(yye),g=p.sticky,y=p.scrollY,w=p.listItemHeight,b=p.getComponent,C=p.onScroll,P=m.useRef(),v=aKe(n,u,s,l),T=m.useMemo(function(){var k=0;return i.map(function(N){var F=N.width,U=N.key;return k+=F,[U,F,k]})},[i]),A=m.useMemo(function(){return T.map(function(k){return k[2]})},[T]);m.useEffect(function(){T.forEach(function(k){var N=ln(k,2),F=N[0],U=N[1];a(F,U)})},[T]),m.useImperativeHandle(e,function(){var k={scrollTo:function(F){var U;(U=P.current)===null||U===void 0||U.scrollTo(F)}};return Object.defineProperty(k,"scrollLeft",{get:function(){var F;return((F=P.current)===null||F===void 0?void 0:F.getScrollInfo().x)||0},set:function(F){var U;(U=P.current)===null||U===void 0||U.scrollTo({left:F})}}),k});var x=function(N,F){var U,O=(U=v[F])===null||U===void 0?void 0:U.record,B=N.onCell;if(B){var _,X=B(O,F);return(_=X==null?void 0:X.rowSpan)!==null&&_!==void 0?_:1}return 1},S=function(N){var F=N.start,U=N.end,O=N.getSize,B=N.offsetY;if(U<0)return null;for(var _=i.filter(function(ge){return x(ge,F)===0}),X=F,$=function(de){if(_=_.filter(function(Z){return x(Z,de)===0}),!_.length)return X=de,1},Q=F;Q>=0&&!$(Q);Q-=1);for(var le=i.filter(function(ge){return x(ge,U)!==1}),q=U,te=function(de){if(le=le.filter(function(Z){return x(Z,de)!==1}),!le.length)return q=Math.max(de-1,U),1},re=U;re1})&&ae.push(de)},ne=X;ne<=q;ne+=1)se(ne);var fe=ae.map(function(ge){var de=v[ge],Z=l(de.record,ge),he=function(Se){var ze=ge+Se-1,Ie=l(v[ze].record,ze),ye=O(Z,Ie);return ye.bottom-ye.top},xe=O(Z);return m.createElement(Kxe,{key:ge,data:de,rowKey:Z,index:ge,style:{top:-B+xe.top},extra:!0,getHeight:he})});return fe},R=m.useMemo(function(){return{columnsOffset:A}},[A]),M="".concat(c,"-tbody"),D=b(["body","wrapper"]),E=b(["body","row"],"div"),W=b(["body","cell"],"div"),j;if(v.length){var L={};g&&(L.position="sticky",L.bottom=0,hi(g)==="object"&&g.offsetScroll&&(L.bottom=g.offsetScroll)),j=m.createElement(G$,{fullHeight:!1,ref:P,prefixCls:"".concat(M,"-virtual"),styles:{horizontalScrollBar:L},className:M,height:y,itemHeight:w||24,data:v,itemKey:function(N){return l(N.record)},component:D,scrollWidth:f,onVirtualScroll:function(N){var F=N.x;o({scrollLeft:F})},onScroll:C,extraRender:S},function(k,N,F){var U=l(k.record,N);return m.createElement(Kxe,ho({data:k,rowKey:U,index:N},F))})}else j=m.createElement(E,{className:Vn("".concat(c,"-placeholder"))},m.createElement(Bb,{component:W,prefixCls:c},d));return m.createElement(gKe.Provider,{value:R},j)}),yOt=XH(mOt),AOt=function(e,n){var o=n.ref,r=n.onScroll;return m.createElement(yOt,{ref:o,data:e,onScroll:r})};function wOt(t,e){var n=t.columns,o=t.scroll,r=t.sticky,i=t.prefixCls,a=i===void 0?hKe:i,l=t.className,s=t.listItemHeight,c=t.components,u=t.onScroll,d=o||{},f=d.x,p=d.y;typeof f!="number"&&(f=1),typeof p!="number"&&(p=500);var g=Ea(function(b,C){return Ag(c,b)||C}),y=Ea(u),w=m.useMemo(function(){return{sticky:r,scrollY:p,listItemHeight:s,getComponent:g,onScroll:y}},[r,p,s,g,y]);return m.createElement(yye.Provider,{value:w},m.createElement(JH,ho({},t,{className:Vn(l,"".concat(a,"-virtual")),scroll:qt(qt({},o),{},{x:f}),components:qt(qt({},c),{},{body:AOt}),columns:n,internalHooks:ZW,tailor:!0,ref:e})))}var vOt=m.forwardRef(wOt);function mKe(t){return eKe(vOt,t)}mKe();function xOt(t){return null}function bOt(t){return null}function vue(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&(n[r]=t[r]);return n}function hQ(t,e){if(t==null)return{};var n=COt(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var xue={},ROt=function(e){};function HOt(t,e){}function MOt(t,e){}function IOt(){xue={}}function AKe(t,e,n){!e&&!xue[n]&&(t(!1,n),xue[n]=!0)}function b2(t,e){AKe(HOt,t,e)}function zOt(t,e){AKe(MOt,t,e)}b2.preMessage=ROt;b2.resetWarned=IOt;b2.noteOnce=zOt;function DOt(t,e){if(oA(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(oA(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wKe(t){var e=DOt(t,"string");return oA(e)==="symbol"?e:String(e)}function Yo(t,e,n){return e=wKe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qxe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Ru(t){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function FOt(t,e){if(e&&(oA(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wr(t)}function SKe(t){var e=EOt();return function(){var o=XG(t),r;if(e){var i=XG(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return FOt(this,r)}}var TKe={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames @@ -4677,8 +4677,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata - onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,NOt="".concat(LOt," ").concat(WOt).split(/[\s\n]+/),UOt="aria-",jOt="data-";function $xe(t,e){return t.indexOf(e)===0}function PKe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;e===!1?n={aria:!0,data:!0,attr:!0}:e===!0?n={aria:!0}:n=Ru({},e);var o={};return Object.keys(t).forEach(function(r){(n.aria&&(r==="role"||$xe(r,UOt))||n.data&&$xe(r,jOt)||n.attr&&NOt.includes(r))&&(o[r]=t[r])}),o}var yye=m.createContext(null),BOt=function(e){for(var n=e.prefixCls,o=e.level,r=e.isStart,i=e.isEnd,a="".concat(n,"-indent-unit"),l=[],s=0;s1&&arguments[1]!==void 0?arguments[1]:{},n=[];return be.Children.forEach(t,function(o){o==null&&!e.keepEmpty||(Array.isArray(o)?n=n.concat(Sue(o)):CC.isFragment(o)&&o.props?n=n.concat(Sue(o.props.children,e)):n.push(o))}),n}function OOt(t,e){var n=Ru({},t);return Array.isArray(e)&&e.forEach(function(o){delete n[o]}),n}var _Ot=["children"];function CKe(t,e){return"".concat(t,"-").concat(e)}function VOt(t){return t&&t.type&&t.type.isTreeNode}function ZW(t,e){return t??e}function vR(t){var e=t||{},n=e.title,o=e._title,r=e.key,i=e.children,a=n||"title";return{title:a,_title:o||[a],key:r||"key",children:i||"children"}}function RKe(t){function e(n){var o=Sue(n);return o.map(function(r){if(!VOt(r))return b2(!r,"Tree/TreeNode can only accept TreeNode as children."),null;var i=r.key,a=r.props,l=a.children,s=hQ(a,_Ot),c=Ru({key:i},s),u=e(l);return u.length&&(c.children=u),c}).filter(function(r){return r})}return e(t)}function mie(t,e,n){var o=vR(n),r=o._title,i=o.key,a=o.children,l=new Set(e===!0?[]:e),s=[];function c(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return u.map(function(f,p){for(var g=CKe(d?d.pos:"0",p),y=ZW(f[i],g),w,b=0;b1&&arguments[1]!==void 0?arguments[1]:{},n=e.initWrapper,o=e.processEntity,r=e.onProcessFinished,i=e.externalGetKey,a=e.childrenPropName,l=e.fieldNames,s=arguments.length>2?arguments[2]:void 0,c=i||s,u={},d={},f={posEntities:u,keyEntities:d};return n&&(f=n(f)||f),GOt(t,function(p){var g=p.node,y=p.index,w=p.pos,b=p.key,C=p.parentPos,P=p.level,v=p.nodes,T={node:g,nodes:v,index:y,key:b,pos:w,level:P},A=ZW(b,w);u[w]=T,d[A]=T,T.parent=u[C],T.parent&&(T.parent.children=T.parent.children||[],T.parent.children.push(T)),o&&o(T,f)},{externalGetKey:c,childrenPropName:a,fieldNames:l}),r&&r(f),f}function TE(t,e){var n=e.expandedKeys,o=e.selectedKeys,r=e.loadedKeys,i=e.loadingKeys,a=e.checkedKeys,l=e.halfCheckedKeys,s=e.dragOverNodeKey,c=e.dropPosition,u=e.keyEntities,d=Np(u,t),f={eventKey:t,expanded:n.indexOf(t)!==-1,selected:o.indexOf(t)!==-1,loaded:r.indexOf(t)!==-1,loading:i.indexOf(t)!==-1,checked:a.indexOf(t)!==-1,halfChecked:l.indexOf(t)!==-1,pos:String(d?d.pos:""),dragOver:s===t&&c===0,dragOverGapTop:s===t&&c===-1,dragOverGapBottom:s===t&&c===1};return f}function nu(t){var e=t.data,n=t.expanded,o=t.selected,r=t.checked,i=t.loaded,a=t.loading,l=t.halfChecked,s=t.dragOver,c=t.dragOverGapTop,u=t.dragOverGapBottom,d=t.pos,f=t.active,p=t.eventKey,g=Ru(Ru({},e),{},{expanded:n,selected:o,checked:r,loaded:i,loading:a,halfChecked:l,dragOver:s,dragOverGapTop:c,dragOverGapBottom:u,pos:d,active:f,key:p});return"props"in g||Object.defineProperty(g,"props",{get:function(){return b2(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),t}}),g}var XOt=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],Qxe="open",Zxe="close",JOt="---",KOt=function(t){bKe(n,t);var e=SKe(n);function n(){var o;vKe(this,n);for(var r=arguments.length,i=new Array(r),a=0;a=0&&n.splice(o,1),n}function u6(t,e){var n=(t||[]).slice();return n.indexOf(e)===-1&&n.push(e),n}function wye(t){return t.split("-")}function qOt(t,e){var n=[],o=Np(e,t);function r(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];i.forEach(function(a){var l=a.key,s=a.children;n.push(l),r(s)})}return r(o.children),n}function $Ot(t){if(t.parent){var e=wye(t.pos);return Number(e[e.length-1])===t.parent.children.length-1}return!1}function QOt(t){var e=wye(t.pos);return Number(e[e.length-1])===0}function ebe(t,e,n,o,r,i,a,l,s,c){var u,d=t.clientX,f=t.clientY,p=t.target.getBoundingClientRect(),g=p.top,y=p.height,w=(c==="rtl"?-1:1)*(((r==null?void 0:r.x)||0)-d),b=(w-12)/o,C=s.filter(function(k){var N;return(N=l[k])===null||N===void 0||(N=N.children)===null||N===void 0?void 0:N.length}),P=Np(l,n.props.eventKey);if(f-1.5?i({dragNode:W,dropNode:j,dropPosition:1})?M=1:L=!1:i({dragNode:W,dropNode:j,dropPosition:0})?M=0:i({dragNode:W,dropNode:j,dropPosition:1})?M=1:L=!1:i({dragNode:W,dropNode:j,dropPosition:1})?M=1:L=!1,{dropPosition:M,dropLevelOffset:D,dropTargetKey:P.key,dropTargetPos:P.pos,dragOverNodeKey:R,dropContainerKey:M===0?null:((u=P.parent)===null||u===void 0?void 0:u.key)||null,dropAllowed:L}}function tbe(t,e){if(t){var n=e.multiple;return n?t.slice():t.length?[t[0]]:t}}function yie(t){if(!t)return null;var e;if(Array.isArray(t))e={checkedKeys:t,halfCheckedKeys:void 0};else if(oA(t)==="object")e={checkedKeys:t.checked||void 0,halfCheckedKeys:t.halfChecked||void 0};else return b2(!1,"`checkedKeys` is not an array or an object"),null;return e}function Tue(t,e){var n=new Set;function o(r){if(!n.has(r)){var i=Np(e,r);if(i){n.add(r);var a=i.parent,l=i.node;l.disabled||a&&o(a.key)}}}return(t||[]).forEach(function(r){o(r)}),yx(n)}function HKe(t,e){var n=new Set;return t.forEach(function(o){e.has(o)||n.add(o)}),n}function ZOt(t){var e=t||{},n=e.disabled,o=e.disableCheckbox,r=e.checkable;return!!(n||o)||r===!1}function e_t(t,e,n,o){for(var r=new Set(t),i=new Set,a=0;a<=n;a+=1){var l=e.get(a)||new Set;l.forEach(function(d){var f=d.key,p=d.node,g=d.children,y=g===void 0?[]:g;r.has(f)&&!o(p)&&y.filter(function(w){return!o(w.node)}).forEach(function(w){r.add(w.key)})})}for(var s=new Set,c=n;c>=0;c-=1){var u=e.get(c)||new Set;u.forEach(function(d){var f=d.parent,p=d.node;if(!(o(p)||!d.parent||s.has(d.parent.key))){if(o(d.parent.node)){s.add(f.key);return}var g=!0,y=!1;(f.children||[]).filter(function(w){return!o(w.node)}).forEach(function(w){var b=w.key,C=r.has(b);g&&!C&&(g=!1),!y&&(C||i.has(b))&&(y=!0)}),g&&r.add(f.key),y&&i.add(f.key),s.add(f.key)}})}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(HKe(i,r))}}function t_t(t,e,n,o,r){for(var i=new Set(t),a=new Set(e),l=0;l<=o;l+=1){var s=n.get(l)||new Set;s.forEach(function(f){var p=f.key,g=f.node,y=f.children,w=y===void 0?[]:y;!i.has(p)&&!a.has(p)&&!r(g)&&w.filter(function(b){return!r(b.node)}).forEach(function(b){i.delete(b.key)})})}a=new Set;for(var c=new Set,u=o;u>=0;u-=1){var d=n.get(u)||new Set;d.forEach(function(f){var p=f.parent,g=f.node;if(!(r(g)||!f.parent||c.has(f.parent.key))){if(r(f.parent.node)){c.add(p.key);return}var y=!0,w=!1;(p.children||[]).filter(function(b){return!r(b.node)}).forEach(function(b){var C=b.key,P=i.has(C);y&&!P&&(y=!1),!w&&(P||a.has(C))&&(w=!0)}),y||i.delete(p.key),w&&a.add(p.key),c.add(p.key)}})}return{checkedKeys:Array.from(i),halfCheckedKeys:Array.from(HKe(a,i))}}function MC(t,e,n,o){var r=[],i;o?i=o:i=ZOt;var a=new Set(t.filter(function(u){var d=!!Np(n,u);return d||r.push(u),d})),l=new Map,s=0;Object.keys(n).forEach(function(u){var d=n[u],f=d.level,p=l.get(f);p||(p=new Set,l.set(f,p)),p.add(d),s=Math.max(s,f)}),b2(!r.length,"Tree missing follow keys: ".concat(r.slice(0,100).map(function(u){return"'".concat(u,"'")}).join(", ")));var c;return e===!0?c=e_t(a,l,s,i):c=t_t(a,e.halfCheckedKeys,l,s,i),c}function n_t(t){const[e,n]=m.useState(null);return[m.useCallback((i,a,l)=>{const s=e??i,c=Math.min(s||0,i),u=Math.max(s||0,i),d=a.slice(c,u+1).map(g=>t(g)),f=d.some(g=>!l.has(g)),p=[];return d.forEach(g=>{f?(l.has(g)||p.push(g),l.add(g)):(l.delete(g),p.push(g))}),n(f?u:null),p},[e]),i=>{n(i)}]}const L4={},Pue="SELECT_ALL",Cue="SELECT_INVERT",Rue="SELECT_NONE",nbe=[],MKe=(t,e)=>{let n=[];return(e||[]).forEach(o=>{n.push(o),o&&typeof o=="object"&&t in o&&(n=[].concat(Za(n),Za(MKe(t,o[t]))))}),n},o_t=(t,e)=>{const{preserveSelectedRowKeys:n,selectedRowKeys:o,defaultSelectedRowKeys:r,getCheckboxProps:i,onChange:a,onSelect:l,onSelectAll:s,onSelectInvert:c,onSelectNone:u,onSelectMultiple:d,columnWidth:f,type:p,selections:g,fixed:y,renderCell:w,hideSelectAll:b,checkStrictly:C=!0}=e||{},{prefixCls:P,data:v,pageData:T,getRecordByKey:A,getRowKey:x,expandType:S,childrenColumnName:R,locale:M,getPopupContainer:D}=t,E=kb(),[W,j]=n_t(se=>se),[L,k]=$6(o||r||nbe,{value:o}),N=m.useRef(new Map),F=m.useCallback(se=>{if(n){const ne=new Map;se.forEach(fe=>{let ge=A(fe);!ge&&N.current.has(fe)&&(ge=N.current.get(fe)),ne.set(fe,ge)}),N.current=ne}},[A,n]);m.useEffect(()=>{F(L)},[L]);const{keyEntities:U}=m.useMemo(()=>{if(C)return{keyEntities:null};let se=v;if(n){const ne=new Set(v.map((ge,de)=>x(ge,de))),fe=Array.from(N.current).reduce((ge,de)=>{let[Z,he]=de;return ne.has(Z)?ge:ge.concat(he)},[]);se=[].concat(Za(se),Za(fe))}return Aye(se,{externalGetKey:x,childrenPropName:R})},[v,x,C,R,n]),O=m.useMemo(()=>MKe(R,T),[R,T]),B=m.useMemo(()=>{const se=new Map;return O.forEach((ne,fe)=>{const ge=x(ne,fe),de=(i?i(ne):null)||{};se.set(ge,de)}),se},[O,x,i]),_=m.useCallback(se=>{var ne;return!!(!((ne=B.get(x(se)))===null||ne===void 0)&&ne.disabled)},[B,x]),[X,$]=m.useMemo(()=>{if(C)return[L||[],[]];const{checkedKeys:se,halfCheckedKeys:ne}=MC(L,!0,U,_);return[se||[],ne]},[L,C,U,_]),Q=m.useMemo(()=>{const se=p==="radio"?X.slice(0,1):X;return new Set(se)},[X,p]),le=m.useMemo(()=>p==="radio"?new Set:new Set($),[$,p]);m.useEffect(()=>{e||k(nbe)},[!!e]);const q=m.useCallback((se,ne)=>{let fe,ge;F(se),n?(fe=se,ge=se.map(de=>N.current.get(de))):(fe=[],ge=[],se.forEach(de=>{const Z=A(de);Z!==void 0&&(fe.push(de),ge.push(Z))})),k(fe),a==null||a(fe,ge,{type:ne})},[k,A,a,n]),te=m.useCallback((se,ne,fe,ge)=>{if(l){const de=fe.map(Z=>A(Z));l(A(se),ne,de,ge)}q(fe,"single")},[l,A,q]),re=m.useMemo(()=>!g||b?null:(g===!0?[Pue,Cue,Rue]:g).map(ne=>ne===Pue?{key:"all",text:M.selectionAll,onSelect(){q(v.map((fe,ge)=>x(fe,ge)).filter(fe=>{const ge=B.get(fe);return!(ge!=null&&ge.disabled)||Q.has(fe)}),"all")}}:ne===Cue?{key:"invert",text:M.selectInvert,onSelect(){const fe=new Set(Q);T.forEach((de,Z)=>{const he=x(de,Z),xe=B.get(he);xe!=null&&xe.disabled||(fe.has(he)?fe.delete(he):fe.add(he))});const ge=Array.from(fe);c&&(E.deprecated(!1,"onSelectInvert","onChange"),c(ge)),q(ge,"invert")}}:ne===Rue?{key:"none",text:M.selectNone,onSelect(){u==null||u(),q(Array.from(Q).filter(fe=>{const ge=B.get(fe);return ge==null?void 0:ge.disabled}),"none")}}:ne).map(ne=>Object.assign(Object.assign({},ne),{onSelect:function(){for(var fe,ge,de=arguments.length,Z=new Array(de),he=0;he{var ne;if(!e)return se.filter(Pe=>Pe!==L4);let fe=Za(se);const ge=new Set(Q),de=O.map(x).filter(Pe=>!B.get(Pe).disabled),Z=de.every(Pe=>ge.has(Pe)),he=de.some(Pe=>ge.has(Pe)),xe=()=>{const Pe=[];Z?de.forEach(Be=>{ge.delete(Be),Pe.push(Be)}):de.forEach(Be=>{ge.has(Be)||(ge.add(Be),Pe.push(Be))});const Ee=Array.from(ge);s==null||s(!Z,Ee.map(Be=>A(Be)),Pe.map(Be=>A(Be))),q(Ee,"all"),j(null)};let He,Se;if(p!=="radio"){let Pe;if(re){const Ke={getPopupContainer:D,items:re.map((Ne,De)=>{const{key:ke,text:Ye,onSelect:it}=Ne;return{key:ke??De,onClick:()=>{it==null||it(de)},label:Ye}})};Pe=m.createElement("div",{className:`${P}-selection-extra`},m.createElement(jw,{menu:Ke,getPopupContainer:D},m.createElement("span",null,m.createElement(Eme,null))))}const Ee=O.map((Ke,Ne)=>{const De=x(Ke,Ne),ke=B.get(De)||{};return Object.assign({checked:ge.has(De)},ke)}).filter(Ke=>{let{disabled:Ne}=Ke;return Ne}),Be=!!Ee.length&&Ee.length===O.length,Je=Be&&Ee.every(Ke=>{let{checked:Ne}=Ke;return Ne}),We=Be&&Ee.some(Ke=>{let{checked:Ne}=Ke;return Ne});Se=m.createElement(Li,{checked:Be?Je:!!O.length&&Z,indeterminate:Be?!Je&&We:!Z&&he,onChange:xe,disabled:O.length===0||Be,"aria-label":Pe?"Custom selection":"Select all",skipGroup:!0}),He=!b&&m.createElement("div",{className:`${P}-selection`},Se,Pe)}let ze;p==="radio"?ze=(Pe,Ee,Be)=>{const Je=x(Ee,Be),We=ge.has(Je);return{node:m.createElement(Ue,Object.assign({},B.get(Je),{checked:We,onClick:Ke=>Ke.stopPropagation(),onChange:Ke=>{ge.has(Je)||te(Je,!0,[Je],Ke.nativeEvent)}})),checked:We}}:ze=(Pe,Ee,Be)=>{var Je;const We=x(Ee,Be),Ke=ge.has(We),Ne=le.has(We),De=B.get(We);let ke;return S==="nest"?ke=Ne:ke=(Je=De==null?void 0:De.indeterminate)!==null&&Je!==void 0?Je:Ne,{node:m.createElement(Li,Object.assign({},De,{indeterminate:ke,checked:Ke,skipGroup:!0,onClick:Ye=>Ye.stopPropagation(),onChange:Ye=>{let{nativeEvent:it}=Ye;const{shiftKey:Ve}=it,yt=de.findIndex(Xe=>Xe===We),ct=X.some(Xe=>de.includes(Xe));if(Ve&&C&&ct){const Xe=W(yt,de,ge),ut=Array.from(ge);d==null||d(!Ke,ut.map(ft=>A(ft)),Xe.map(ft=>A(ft))),q(ut,"multiple")}else{const Xe=X;if(C){const ut=Ke?q5(Xe,We):u6(Xe,We);te(We,!Ke,ut,it)}else{const ut=MC([].concat(Za(Xe),[We]),!0,U,_),{checkedKeys:ft,halfCheckedKeys:ot}=ut;let st=ft;if(Ke){const at=new Set(ft);at.delete(We),st=MC(Array.from(at),{checked:!1,halfCheckedKeys:ot},U,_).checkedKeys}te(We,!Ke,st,it)}}j(Ke?null:yt)}})),checked:Ke}};const Ie=(Pe,Ee,Be)=>{const{node:Je,checked:We}=ze(Pe,Ee,Be);return w?w(We,Ee,Be,Je):Je};if(!fe.includes(L4))if(fe.findIndex(Pe=>{var Ee;return((Ee=Pe[SE])===null||Ee===void 0?void 0:Ee.columnType)==="EXPAND_COLUMN"})===0){const[Pe,...Ee]=fe;fe=[Pe,L4].concat(Za(Ee))}else fe=[L4].concat(Za(fe));const ye=fe.indexOf(L4);fe=fe.filter((Pe,Ee)=>Pe!==L4||Ee===ye);const ce=fe[ye-1],pe=fe[ye+1];let ve=y;ve===void 0&&((pe==null?void 0:pe.fixed)!==void 0?ve=pe.fixed:(ce==null?void 0:ce.fixed)!==void 0&&(ve=ce.fixed)),ve&&ce&&((ne=ce[SE])===null||ne===void 0?void 0:ne.columnType)==="EXPAND_COLUMN"&&ce.fixed===void 0&&(ce.fixed=ve);const Ae=Un(`${P}-selection-col`,{[`${P}-selection-col-with-dropdown`]:g&&p==="checkbox"}),Te=()=>e!=null&&e.columnTitle?typeof e.columnTitle=="function"?e.columnTitle(Se):e.columnTitle:He,Me={fixed:ve,width:f,className:`${P}-selection-column`,title:Te(),render:Ie,onCell:e.onCell,[SE]:{className:Ae}};return fe.map(Pe=>Pe===L4?Me:Pe)},[x,O,e,X,Q,le,f,re,S,B,d,te,_]),Q]};function r_t(t,e){return t._antProxy=t._antProxy||{},Object.keys(e).forEach(n=>{if(!(n in t._antProxy)){const o=t[n];t._antProxy[n]=o,t[n]=e[n]}}),t}function i_t(t,e){return m.useImperativeHandle(t,()=>{const n=e(),{nativeElement:o}=n;return typeof Proxy<"u"?new Proxy(o,{get(r,i){return n[i]?n[i]:Reflect.get(r,i)}}):r_t(o,n)})}function a_t(t){return function(n){let{prefixCls:o,onExpand:r,record:i,expanded:a,expandable:l}=n;const s=`${o}-row-expand-icon`;return m.createElement("button",{type:"button",onClick:c=>{r(i,c),c.stopPropagation()},className:Un(s,{[`${s}-spaced`]:!l,[`${s}-expanded`]:l&&a,[`${s}-collapsed`]:l&&!a}),"aria-label":a?t.collapse:t.expand,"aria-expanded":a})}}function l_t(t){return(n,o)=>{const r=n.querySelector(`.${t}-container`);let i=o;if(r){const a=getComputedStyle(r),l=parseInt(a.borderLeftWidth,10),s=parseInt(a.borderRightWidth,10);i=o-l-s}return i}}function Kx(t,e){return"key"in t&&t.key!==void 0&&t.key!==null?t.key:t.dataIndex?Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex:e}function eN(t,e){return e?`${e}-${t}`:`${t}`}function pQ(t,e){return typeof t=="function"?t(e):t}function s_t(t,e){const n=pQ(t,e);return Object.prototype.toString.call(n)==="[object Object]"?"":n}var c_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"},u_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:c_t}))},d_t=m.forwardRef(u_t);function f_t(t){const e=m.useRef(t),n=jGe();return[()=>e.current,o=>{e.current=o,n()}]}var mi={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var n=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||n>=mi.F1&&n<=mi.F12)return!1;switch(n){case mi.ALT:case mi.CAPS_LOCK:case mi.CONTEXT_MENU:case mi.CTRL:case mi.DOWN:case mi.END:case mi.ESC:case mi.HOME:case mi.INSERT:case mi.LEFT:case mi.MAC_FF_META:case mi.META:case mi.NUMLOCK:case mi.NUM_CENTER:case mi.PAGE_DOWN:case mi.PAGE_UP:case mi.PAUSE:case mi.PRINT_SCREEN:case mi.RIGHT:case mi.SHIFT:case mi.UP:case mi.WIN_KEY:case mi.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=mi.ZERO&&e<=mi.NINE||e>=mi.NUM_ZERO&&e<=mi.NUM_MULTIPLY||e>=mi.A&&e<=mi.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case mi.SPACE:case mi.QUESTION_MARK:case mi.NUM_PLUS:case mi.NUM_MINUS:case mi.NUM_PERIOD:case mi.NUM_DIVISION:case mi.SEMICOLON:case mi.DASH:case mi.EQUALS:case mi.COMMA:case mi.PERIOD:case mi.SLASH:case mi.APOSTROPHE:case mi.SINGLE_QUOTE:case mi.OPEN_SQUARE_BRACKET:case mi.BACKSLASH:case mi.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};function h_t(t){var e=t.dropPosition,n=t.dropLevelOffset,o=t.indent,r={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(e){case-1:r.top=0,r.left=-n*o;break;case 1:r.bottom=0,r.left=-n*o;break;case 0:r.bottom=0,r.left=o;break}return m.createElement("div",{style:r})}function IKe(t){if(t==null)throw new TypeError("Cannot destructure "+t)}function p_t(t){if(Array.isArray(t))return t}function g_t(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var o,r,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(t)).next,e!==0)for(;!(s=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);s=!0);}catch(u){c=!0,r=u}finally{try{if(!s&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}function m_t(){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 xv(t,e){return p_t(t)||g_t(t,e)||yKe(t,e)||m_t()}function y_t(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var obe=y_t()?m.useLayoutEffect:m.useEffect,XG=function(e,n){var o=m.useRef(!0);obe(function(){return e(o.current)},n),obe(function(){return o.current=!1,function(){o.current=!0}},[])};function A_t(t,e){var n=m.useState(!1),o=xv(n,2),r=o[0],i=o[1];XG(function(){if(r)return t(),function(){e()}},[r]),XG(function(){return i(!0),function(){i(!1)}},[])}var w_t=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],zKe=function(e,n){var o=e.className,r=e.style,i=e.motion,a=e.motionNodes,l=e.motionType,s=e.onMotionStart,c=e.onMotionEnd,u=e.active,d=e.treeNodeRequiredProps,f=hQ(e,w_t),p=m.useState(!0),g=xv(p,2),y=g[0],w=g[1],b=m.useContext(yye),C=b.prefixCls,P=a&&l!=="hide";XG(function(){a&&P!==y&&w(P)},[a]);var v=function(){a&&s()},T=m.useRef(!1),A=function(){a&&!T.current&&(T.current=!0,c())};A_t(v,A);var x=function(R){P===R&&A()};return a?m.createElement(o1,H9({ref:n,visible:y},i,{motionAppear:l==="show",onVisibleChanged:x}),function(S,R){var M=S.className,D=S.style;return m.createElement("div",{ref:R,className:r9("".concat(C,"-treenode-motion"),M),style:D},a.map(function(E){var W=Object.assign({},(IKe(E.data),E.data)),j=E.title,L=E.key,k=E.isStart,N=E.isEnd;delete W.children;var F=TE(L,d);return m.createElement(xR,H9({},W,F,{title:j,active:u,data:E.data,key:L,isStart:k,isEnd:N}))}))}):m.createElement(xR,H9({domRef:n,className:o,style:r},f,{active:u}))};zKe.displayName="MotionTreeNode";var v_t=m.forwardRef(zKe);function x_t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=t.length,o=e.length;if(Math.abs(n-o)!==1)return{add:!1,key:null};function r(i,a){var l=new Map;i.forEach(function(c){l.set(c,!0)});var s=a.filter(function(c){return!l.has(c)});return s.length===1?s[0]:null}return n ").concat(e);return e}var EKe=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.data;t.selectable,t.checkable;var r=t.expandedKeys,i=t.selectedKeys,a=t.checkedKeys,l=t.loadedKeys,s=t.loadingKeys,c=t.halfCheckedKeys,u=t.keyEntities,d=t.disabled,f=t.dragging,p=t.dragOverNodeKey,g=t.dropPosition,y=t.motion,w=t.height,b=t.itemHeight,C=t.virtual,P=t.focusable,v=t.activeItem,T=t.focused,A=t.tabIndex,x=t.onKeyDown,S=t.onFocus,R=t.onBlur,M=t.onActiveChange,D=t.onListChangeStart,E=t.onListChangeEnd,W=hQ(t,b_t),j=m.useRef(null),L=m.useRef(null);m.useImperativeHandle(e,function(){return{scrollTo:function(ze){j.current.scrollTo(ze)},getIndentWidth:function(){return L.current.offsetWidth}}});var k=m.useState(r),N=xv(k,2),F=N[0],U=N[1],O=m.useState(o),B=xv(O,2),_=B[0],X=B[1],$=m.useState(o),Q=xv($,2),le=Q[0],q=Q[1],te=m.useState([]),re=xv(te,2),ae=re[0],se=re[1],ne=m.useState(null),fe=xv(ne,2),ge=fe[0],de=fe[1],Z=m.useRef(o);Z.current=o;function he(){var Se=Z.current;X(Se),q(Se),se([]),de(null),E()}XG(function(){U(r);var Se=x_t(F,r);if(Se.key!==null)if(Se.add){var ze=_.findIndex(function(Ae){var Te=Ae.key;return Te===Se.key}),Ie=lbe(rbe(_,o,Se.key),C,w,b),ye=_.slice();ye.splice(ze+1,0,abe),q(ye),se(Ie),de("show")}else{var ce=o.findIndex(function(Ae){var Te=Ae.key;return Te===Se.key}),pe=lbe(rbe(o,_,Se.key),C,w,b),ve=o.slice();ve.splice(ce+1,0,abe),q(ve),se(pe),de("hide")}else _!==o&&(X(o),q(o))},[r,o]),m.useEffect(function(){f||he()},[f]);var xe=y?le:o,He={expandedKeys:r,selectedKeys:i,loadedKeys:l,loadingKeys:s,checkedKeys:a,halfCheckedKeys:c,dragOverNodeKey:p,dropPosition:g,keyEntities:u};return m.createElement(m.Fragment,null,T&&v&&m.createElement("span",{style:ibe,"aria-live":"assertive"},T_t(v)),m.createElement("div",null,m.createElement("input",{style:ibe,disabled:P===!1||d,tabIndex:P!==!1?A:null,onKeyDown:x,onFocus:S,onBlur:R,value:"",onChange:S_t,"aria-label":"for screen reader"})),m.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},m.createElement("div",{className:"".concat(n,"-indent")},m.createElement("div",{ref:L,className:"".concat(n,"-indent-unit")}))),m.createElement(G$,H9({},W,{data:xe,itemKey:sbe,height:w,fullHeight:!1,virtual:C,itemHeight:b,prefixCls:"".concat(n,"-list"),ref:j,onVisibleChange:function(ze,Ie){var ye=new Set(ze),ce=Ie.filter(function(pe){return!ye.has(pe)});ce.some(function(pe){return sbe(pe)===qx})&&he()}}),function(Se){var ze=Se.pos,Ie=Object.assign({},(IKe(Se.data),Se.data)),ye=Se.title,ce=Se.key,pe=Se.isStart,ve=Se.isEnd,Ae=ZW(ce,ze);delete Ie.key,delete Ie.children;var Te=TE(Ae,He);return m.createElement(v_t,H9({},Ie,Te,{title:ye,active:!!v&&ce===v.key,pos:ze,data:Se.data,isStart:pe,isEnd:ve,motion:y,motionNodes:ce===qx?ae:null,motionType:ge,onMotionStart:D,onMotionEnd:he,treeNodeRequiredProps:He,onMouseMove:function(){M(null)}}))}))});EKe.displayName="NodeList";var P_t=10,vye=function(t){bKe(n,t);var e=SKe(n);function n(){var o;vKe(this,n);for(var r=arguments.length,i=new Array(r),a=0;a2&&arguments[2]!==void 0?arguments[2]:!1,d=o.state,f=d.dragChildrenKeys,p=d.dropPosition,g=d.dropTargetKey,y=d.dropTargetPos,w=d.dropAllowed;if(w){var b=o.props.onDrop;if(o.setState({dragOverNodeKey:null}),o.cleanDragState(),g!==null){var C=Ru(Ru({},TE(g,o.getTreeNodeRequiredProps())),{},{active:((c=o.getActiveItem())===null||c===void 0?void 0:c.key)===g,data:Np(o.state.keyEntities,g).node}),P=f.indexOf(g)!==-1;b2(!P,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var v=wye(y),T={event:l,node:nu(C),dragNode:o.dragNode?nu(o.dragNode.props):null,dragNodesKeys:[o.dragNode.props.eventKey].concat(f),dropToGap:p!==0,dropPosition:p+Number(v[v.length-1])};u||b==null||b(T),o.dragNode=null}}}),Yo(wr(o),"cleanDragState",function(){var l=o.state.draggingNodeKey;l!==null&&o.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),o.dragStartMousePosition=null,o.currentMouseOverDroppableNodeKey=null}),Yo(wr(o),"triggerExpandActionExpand",function(l,s){var c=o.state,u=c.expandedKeys,d=c.flattenNodes,f=s.expanded,p=s.key,g=s.isLeaf;if(!(g||l.shiftKey||l.metaKey||l.ctrlKey)){var y=d.filter(function(b){return b.key===p})[0],w=nu(Ru(Ru({},TE(p,o.getTreeNodeRequiredProps())),{},{data:y.data}));o.setExpandedKeys(f?q5(u,p):u6(u,p)),o.onNodeExpand(l,w)}}),Yo(wr(o),"onNodeClick",function(l,s){var c=o.props,u=c.onClick,d=c.expandAction;d==="click"&&o.triggerExpandActionExpand(l,s),u==null||u(l,s)}),Yo(wr(o),"onNodeDoubleClick",function(l,s){var c=o.props,u=c.onDoubleClick,d=c.expandAction;d==="doubleClick"&&o.triggerExpandActionExpand(l,s),u==null||u(l,s)}),Yo(wr(o),"onNodeSelect",function(l,s){var c=o.state.selectedKeys,u=o.state,d=u.keyEntities,f=u.fieldNames,p=o.props,g=p.onSelect,y=p.multiple,w=s.selected,b=s[f.key],C=!w;C?y?c=u6(c,b):c=[b]:c=q5(c,b);var P=c.map(function(v){var T=Np(d,v);return T?T.node:null}).filter(function(v){return v});o.setUncontrolledState({selectedKeys:c}),g==null||g(c,{event:"select",selected:C,node:s,selectedNodes:P,nativeEvent:l.nativeEvent})}),Yo(wr(o),"onNodeCheck",function(l,s,c){var u=o.state,d=u.keyEntities,f=u.checkedKeys,p=u.halfCheckedKeys,g=o.props,y=g.checkStrictly,w=g.onCheck,b=s.key,C,P={event:"check",node:s,checked:c,nativeEvent:l.nativeEvent};if(y){var v=c?u6(f,b):q5(f,b),T=q5(p,b);C={checked:v,halfChecked:T},P.checkedNodes=v.map(function(D){return Np(d,D)}).filter(function(D){return D}).map(function(D){return D.node}),o.setUncontrolledState({checkedKeys:v})}else{var A=MC([].concat(yx(f),[b]),!0,d),x=A.checkedKeys,S=A.halfCheckedKeys;if(!c){var R=new Set(x);R.delete(b);var M=MC(Array.from(R),{checked:!1,halfCheckedKeys:S},d);x=M.checkedKeys,S=M.halfCheckedKeys}C=x,P.checkedNodes=[],P.checkedNodesPositions=[],P.halfCheckedKeys=S,x.forEach(function(D){var E=Np(d,D);if(E){var W=E.node,j=E.pos;P.checkedNodes.push(W),P.checkedNodesPositions.push({node:W,pos:j})}}),o.setUncontrolledState({checkedKeys:x},!1,{halfCheckedKeys:S})}w==null||w(C,P)}),Yo(wr(o),"onNodeLoad",function(l){var s,c=l.key,u=o.state.keyEntities,d=Np(u,c);if(!(d!=null&&(s=d.children)!==null&&s!==void 0&&s.length)){var f=new Promise(function(p,g){o.setState(function(y){var w=y.loadedKeys,b=w===void 0?[]:w,C=y.loadingKeys,P=C===void 0?[]:C,v=o.props,T=v.loadData,A=v.onLoad;if(!T||b.indexOf(c)!==-1||P.indexOf(c)!==-1)return null;var x=T(l);return x.then(function(){var S=o.state.loadedKeys,R=u6(S,c);A==null||A(R,{event:"load",node:l}),o.setUncontrolledState({loadedKeys:R}),o.setState(function(M){return{loadingKeys:q5(M.loadingKeys,c)}}),p()}).catch(function(S){if(o.setState(function(M){return{loadingKeys:q5(M.loadingKeys,c)}}),o.loadingRetryTimes[c]=(o.loadingRetryTimes[c]||0)+1,o.loadingRetryTimes[c]>=P_t){var R=o.state.loadedKeys;b2(!1,"Retry for `loadData` many times but still failed. No more retry."),o.setUncontrolledState({loadedKeys:u6(R,c)}),p()}g(S)}),{loadingKeys:u6(P,c)}})});return f.catch(function(){}),f}}),Yo(wr(o),"onNodeMouseEnter",function(l,s){var c=o.props.onMouseEnter;c==null||c({event:l,node:s})}),Yo(wr(o),"onNodeMouseLeave",function(l,s){var c=o.props.onMouseLeave;c==null||c({event:l,node:s})}),Yo(wr(o),"onNodeContextMenu",function(l,s){var c=o.props.onRightClick;c&&(l.preventDefault(),c({event:l,node:s}))}),Yo(wr(o),"onFocus",function(){var l=o.props.onFocus;o.setState({focused:!0});for(var s=arguments.length,c=new Array(s),u=0;u1&&arguments[1]!==void 0?arguments[1]:!1,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!o.destroyed){var u=!1,d=!0,f={};Object.keys(l).forEach(function(p){if(p in o.props){d=!1;return}u=!0,f[p]=l[p]}),u&&(!s||d)&&o.setState(Ru(Ru({},f),c))}}),Yo(wr(o),"scrollTo",function(l){o.listRef.current.scrollTo(l)}),o}return xKe(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var r=this.props,i=r.activeKey,a=r.itemScrollOffset,l=a===void 0?0:a;i!==void 0&&i!==this.state.activeKey&&(this.setState({activeKey:i}),i!==null&&this.scrollTo({key:i,offset:l}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var r=this.state,i=r.focused,a=r.flattenNodes,l=r.keyEntities,s=r.draggingNodeKey,c=r.activeKey,u=r.dropLevelOffset,d=r.dropContainerKey,f=r.dropTargetKey,p=r.dropPosition,g=r.dragOverNodeKey,y=r.indent,w=this.props,b=w.prefixCls,C=w.className,P=w.style,v=w.showLine,T=w.focusable,A=w.tabIndex,x=A===void 0?0:A,S=w.selectable,R=w.showIcon,M=w.icon,D=w.switcherIcon,E=w.draggable,W=w.checkable,j=w.checkStrictly,L=w.disabled,k=w.motion,N=w.loadData,F=w.filterTreeNode,U=w.height,O=w.itemHeight,B=w.virtual,_=w.titleRender,X=w.dropIndicatorRender,$=w.onContextMenu,Q=w.onScroll,le=w.direction,q=w.rootClassName,te=w.rootStyle,re=PKe(this.props,{aria:!0,data:!0}),ae;return E&&(oA(E)==="object"?ae=E:typeof E=="function"?ae={nodeDraggable:E}:ae={}),m.createElement(yye.Provider,{value:{prefixCls:b,selectable:S,showIcon:R,icon:M,switcherIcon:D,draggable:ae,draggingNodeKey:s,checkable:W,checkStrictly:j,disabled:L,keyEntities:l,dropLevelOffset:u,dropContainerKey:d,dropTargetKey:f,dropPosition:p,dragOverNodeKey:g,indent:y,direction:le,dropIndicatorRender:X,loadData:N,filterTreeNode:F,titleRender:_,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},m.createElement("div",{role:"tree",className:r9(b,C,q,Yo(Yo(Yo({},"".concat(b,"-show-line"),v),"".concat(b,"-focused"),i),"".concat(b,"-active-focused"),c!==null)),style:te},m.createElement(EKe,H9({ref:this.listRef,prefixCls:b,style:P,data:a,disabled:L,selectable:S,checkable:!!W,motion:k,dragging:s!==null,height:U,itemHeight:O,virtual:B,focusable:T,focused:i,tabIndex:x,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:$,onScroll:Q},this.getTreeNodeRequiredProps(),re))))}}],[{key:"getDerivedStateFromProps",value:function(r,i){var a=i.prevProps,l={prevProps:r};function s(A){return!a&&A in r||a&&a[A]!==r[A]}var c,u=i.fieldNames;if(s("fieldNames")&&(u=vR(r.fieldNames),l.fieldNames=u),s("treeData")?c=r.treeData:s("children")&&(b2(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),c=RKe(r.children)),c){l.treeData=c;var d=Aye(c,{fieldNames:u});l.keyEntities=Ru(Yo({},qx,DKe),d.keyEntities)}var f=l.keyEntities||i.keyEntities;if(s("expandedKeys")||a&&s("autoExpandParent"))l.expandedKeys=r.autoExpandParent||!a&&r.defaultExpandParent?Tue(r.expandedKeys,f):r.expandedKeys;else if(!a&&r.defaultExpandAll){var p=Ru({},f);delete p[qx],l.expandedKeys=Object.keys(p).map(function(A){return p[A].key})}else!a&&r.defaultExpandedKeys&&(l.expandedKeys=r.autoExpandParent||r.defaultExpandParent?Tue(r.defaultExpandedKeys,f):r.defaultExpandedKeys);if(l.expandedKeys||delete l.expandedKeys,c||l.expandedKeys){var g=mie(c||i.treeData,l.expandedKeys||i.expandedKeys,u);l.flattenNodes=g}if(r.selectable&&(s("selectedKeys")?l.selectedKeys=tbe(r.selectedKeys,r):!a&&r.defaultSelectedKeys&&(l.selectedKeys=tbe(r.defaultSelectedKeys,r))),r.checkable){var y;if(s("checkedKeys")?y=yie(r.checkedKeys)||{}:!a&&r.defaultCheckedKeys?y=yie(r.defaultCheckedKeys)||{}:c&&(y=yie(r.checkedKeys)||{checkedKeys:i.checkedKeys,halfCheckedKeys:i.halfCheckedKeys}),y){var w=y,b=w.checkedKeys,C=b===void 0?[]:b,P=w.halfCheckedKeys,v=P===void 0?[]:P;if(!r.checkStrictly){var T=MC(C,!0,f);C=T.checkedKeys,v=T.halfCheckedKeys}l.checkedKeys=C,l.halfCheckedKeys=v}}return s("loadedKeys")&&(l.loadedKeys=r.loadedKeys),l}}]),n}(m.Component);Yo(vye,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:h_t,allowDrop:function(){return!0},expandAction:!1});Yo(vye,"TreeNode",xR);var C_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},R_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:C_t}))},FKe=m.forwardRef(R_t),H_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},M_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:H_t}))},kKe=m.forwardRef(M_t),I_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},z_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:I_t}))},D_t=m.forwardRef(z_t),E_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},F_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:E_t}))},k_t=m.forwardRef(F_t);const L_t=new xa("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),W_t=(t,e)=>({[`.${t}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${e.motionDurationSlow}`}}}),N_t=(t,e)=>({[`.${t}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:e.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${Nt(e.lineWidthBold)} solid ${e.colorPrimary}`,borderRadius:"50%",content:'""'}}}),U_t=(t,e)=>{const{treeCls:n,treeNodeCls:o,treeNodePadding:r,titleHeight:i,nodeSelectedBg:a,nodeHoverBg:l}=e,s=e.paddingXS;return{[n]:Object.assign(Object.assign({},ja(e)),{background:e.colorBgContainer,borderRadius:e.borderRadius,transition:`background-color ${e.motionDurationSlow}`,[`&${n}-rtl`]:{[`${n}-switcher`]:{"&_close":{[`${n}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${n}-active-focused)`]:Object.assign({},lw(e)),[`${n}-list-holder-inner`]:{alignItems:"flex-start"},[`&${n}-block-node`]:{[`${n}-list-holder-inner`]:{alignItems:"stretch",[`${n}-node-content-wrapper`]:{flex:"auto"},[`${o}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,border:`1px solid ${e.colorPrimary}`,opacity:0,animationName:L_t,animationDuration:e.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${o}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${Nt(r)} 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${n}-node-content-wrapper`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${n}-node-content-wrapper`]:{background:e.controlItemBgHover},[`&:not(${o}-disabled).filter-node ${n}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{cursor:"grab",[`${n}-draggable-icon`]:{flexShrink:0,width:i,lineHeight:`${Nt(i)}`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${e.motionDurationSlow}`,[`${o}:hover &`]:{opacity:.45}},[`&${o}-disabled`]:{[`${n}-draggable-icon`]:{visibility:"hidden"}}}},[`${n}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:i}},[`${n}-draggable-icon`]:{visibility:"hidden"},[`${n}-switcher`]:Object.assign(Object.assign({},W_t(t,e)),{position:"relative",flex:"none",alignSelf:"stretch",width:i,margin:0,lineHeight:`${Nt(i)}`,textAlign:"center",cursor:"pointer",userSelect:"none",transition:`all ${e.motionDurationSlow}`,borderRadius:e.borderRadius,"&-noop":{cursor:"unset"},[`&:not(${n}-switcher-noop):hover`]:{backgroundColor:e.colorBgTextHover},"&_close":{[`${n}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:e.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:e.calc(i).div(2).equal(),bottom:e.calc(r).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:e.calc(e.calc(i).div(2).equal()).mul(.8).equal(),height:e.calc(i).div(2).equal(),borderBottom:`1px solid ${e.colorBorder}`,content:'""'}}}),[`${n}-checkbox`]:{top:"initial",marginInlineEnd:s,alignSelf:"flex-start",marginTop:e.marginXXS},[`${n}-node-content-wrapper, ${n}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:i,margin:0,padding:`0 ${Nt(e.calc(e.paddingXS).div(2).equal())}`,color:"inherit",lineHeight:`${Nt(i)}`,background:"transparent",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:l},[`&${n}-node-selected`]:{backgroundColor:a},[`${n}-iconEle`]:{display:"inline-block",width:i,height:i,lineHeight:`${Nt(i)}`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${n}-unselectable ${n}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${n}-node-content-wrapper`]:Object.assign({lineHeight:`${Nt(i)}`,userSelect:"none"},N_t(t,e)),[`${o}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${e.colorPrimary}`}},"&-show-line":{[`${n}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:e.calc(i).div(2).equal(),bottom:e.calc(r).mul(-1).equal(),borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${n}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${o}-leaf-last`]:{[`${n}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${Nt(e.calc(i).div(2).equal())} !important`}}}}})}},j_t=t=>{const{treeCls:e,treeNodeCls:n,treeNodePadding:o,directoryNodeSelectedBg:r,directoryNodeSelectedColor:i}=t;return{[`${e}${e}-directory`]:{[n]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:o,insetInlineStart:0,transition:`background-color ${t.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:t.controlItemBgHover}},"> *":{zIndex:1},[`${e}-switcher`]:{transition:`color ${t.motionDurationMid}`},[`${e}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${e}-node-selected`]:{color:i,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:r},[`${e}-switcher`]:{color:i},[`${e}-node-content-wrapper`]:{color:i,background:"transparent"}}}}}},B_t=(t,e)=>{const n=`.${t}`,o=`${n}-treenode`,r=e.calc(e.paddingXS).div(2).equal(),i=Ki(e,{treeCls:n,treeNodeCls:o,treeNodePadding:r});return[U_t(t,i),j_t(i)]},Y_t=t=>{const{controlHeightSM:e}=t;return{titleHeight:e,nodeHoverBg:t.controlItemBgHover,nodeSelectedBg:t.controlItemBgActive}},O_t=t=>{const{colorTextLightSolid:e,colorPrimary:n}=t;return Object.assign(Object.assign({},Y_t(t)),{directoryNodeSelectedColor:e,directoryNodeSelectedBg:n})},__t=wl("Tree",(t,e)=>{let{prefixCls:n}=e;return[{[t.componentCls]:pJe(`${n}-checkbox`,t)},B_t(n,t),Rme(t)]},O_t),cbe=4;function V_t(t){const{dropPosition:e,dropLevelOffset:n,prefixCls:o,indent:r,direction:i="ltr"}=t,a=i==="ltr"?"left":"right",l=i==="ltr"?"right":"left",s={[a]:-n*r+cbe,[l]:0};switch(e){case-1:s.top=-3;break;case 1:s.bottom=-3;break;default:s.bottom=-3,s[a]=r+cbe;break}return be.createElement("div",{style:s,className:`${o}-drop-indicator`})}var G_t={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},X_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:G_t}))},J_t=m.forwardRef(X_t),K_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},q_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:K_t}))},$_t=m.forwardRef(q_t),Q_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},Z_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Q_t}))},eVt=m.forwardRef(Z_t);const tVt=t=>{const{prefixCls:e,switcherIcon:n,treeNodeProps:o,showLine:r}=t,{isLeaf:i,expanded:a,loading:l}=o;if(l)return m.createElement(UH,{className:`${e}-switcher-loading-icon`});let s;if(r&&typeof r=="object"&&(s=r.showLeafIcon),i){if(!r)return null;if(typeof s!="boolean"&&s){const d=typeof s=="function"?s(o):s,f=`${e}-switcher-line-custom-icon`;return m.isValidElement(d)?B0(d,{className:Un(d.props.className||"",f)}):d}return s?m.createElement(FKe,{className:`${e}-switcher-line-icon`}):m.createElement("span",{className:`${e}-switcher-leaf-line`})}const c=`${e}-switcher-icon`,u=typeof n=="function"?n(o):n;return m.isValidElement(u)?B0(u,{className:Un(u.props.className||"",c)}):u!==void 0?u:r?a?m.createElement($_t,{className:`${e}-switcher-line-icon`}):m.createElement(eVt,{className:`${e}-switcher-line-icon`}):m.createElement(J_t,{className:c})},LKe=be.forwardRef((t,e)=>{var n;const{getPrefixCls:o,direction:r,virtual:i,tree:a}=be.useContext(Cr),{prefixCls:l,className:s,showIcon:c=!1,showLine:u,switcherIcon:d,blockNode:f=!1,children:p,checkable:g=!1,selectable:y=!0,draggable:w,motion:b,style:C}=t,P=o("tree",l),v=o(),T=b??Object.assign(Object.assign({},xme(v)),{motionAppear:!1}),A=Object.assign(Object.assign({},t),{checkable:g,selectable:y,showIcon:c,motion:T,blockNode:f,showLine:!!u,dropIndicatorRender:V_t}),[x,S,R]=__t(P),[,M]=_u(),D=M.paddingXS/2+(((n=M.Tree)===null||n===void 0?void 0:n.titleHeight)||M.controlHeightSM),E=be.useMemo(()=>{if(!w)return!1;let j={};switch(typeof w){case"function":j.nodeDraggable=w;break;case"object":j=Object.assign({},w);break}return j.icon!==!1&&(j.icon=j.icon||be.createElement(k_t,null)),j},[w]),W=j=>be.createElement(tVt,{prefixCls:P,switcherIcon:d,treeNodeProps:j,showLine:u});return x(be.createElement(vye,Object.assign({itemHeight:D,ref:e,virtual:i},A,{style:Object.assign(Object.assign({},a==null?void 0:a.style),C),prefixCls:P,className:Un({[`${P}-icon-hide`]:!c,[`${P}-block-node`]:f,[`${P}-unselectable`]:!y,[`${P}-rtl`]:r==="rtl"},a==null?void 0:a.className,s,S,R),direction:r,checkable:g&&be.createElement("span",{className:`${P}-checkbox-inner`}),selectable:y,switcherIcon:W,draggable:E}),p))}),ube=0,Aie=1,dbe=2;function xye(t,e,n){const{key:o,children:r}=n;function i(a){const l=a[o],s=a[r];e(l,a)!==!1&&xye(s||[],e,n)}t.forEach(i)}function nVt(t){let{treeData:e,expandedKeys:n,startKey:o,endKey:r,fieldNames:i}=t;const a=[];let l=ube;if(o&&o===r)return[o];if(!o||!r)return[];function s(c){return c===o||c===r}return xye(e,c=>{if(l===dbe)return!1;if(s(c)){if(a.push(c),l===ube)l=Aie;else if(l===Aie)return l=dbe,!1}else l===Aie&&a.push(c);return n.includes(c)},vR(i)),a}function wie(t,e,n){const o=Za(e),r=[];return xye(t,(i,a)=>{const l=o.indexOf(i);return l!==-1&&(r.push(a),o.splice(l,1)),!!o.length},vR(n)),r}var fbe=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var{defaultExpandAll:n,defaultExpandParent:o,defaultExpandedKeys:r}=t,i=fbe(t,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const a=m.useRef(),l=m.useRef(),s=()=>{const{keyEntities:S}=Aye(hbe(i));let R;return n?R=Object.keys(S):o?R=Tue(i.expandedKeys||r||[],S):R=i.expandedKeys||r||[],R},[c,u]=m.useState(i.selectedKeys||i.defaultSelectedKeys||[]),[d,f]=m.useState(()=>s());m.useEffect(()=>{"selectedKeys"in i&&u(i.selectedKeys)},[i.selectedKeys]),m.useEffect(()=>{"expandedKeys"in i&&f(i.expandedKeys)},[i.expandedKeys]);const p=(S,R)=>{var M;return"expandedKeys"in i||f(S),(M=i.onExpand)===null||M===void 0?void 0:M.call(i,S,R)},g=(S,R)=>{var M;const{multiple:D,fieldNames:E}=i,{node:W,nativeEvent:j}=R,{key:L=""}=W,k=hbe(i),N=Object.assign(Object.assign({},R),{selected:!0}),F=(j==null?void 0:j.ctrlKey)||(j==null?void 0:j.metaKey),U=j==null?void 0:j.shiftKey;let O;D&&F?(O=S,a.current=L,l.current=O,N.selectedNodes=wie(k,O,E)):D&&U?(O=Array.from(new Set([].concat(Za(l.current||[]),Za(nVt({treeData:k,expandedKeys:d,startKey:L,endKey:a.current,fieldNames:E}))))),N.selectedNodes=wie(k,O,E)):(O=[L],a.current=L,l.current=O,N.selectedNodes=wie(k,O,E)),(M=i.onSelect)===null||M===void 0||M.call(i,O,N),"selectedKeys"in i||u(O)},{getPrefixCls:y,direction:w}=m.useContext(Cr),{prefixCls:b,className:C,showIcon:P=!0,expandAction:v="click"}=i,T=fbe(i,["prefixCls","className","showIcon","expandAction"]),A=y("tree",b),x=Un(`${A}-directory`,{[`${A}-directory-rtl`]:w==="rtl"},C);return m.createElement(LKe,Object.assign({icon:oVt,ref:e,blockNode:!0},T,{showIcon:P,expandAction:v,prefixCls:A,className:x,expandedKeys:d,selectedKeys:c,onSelect:g,onExpand:p}))},iVt=m.forwardRef(rVt),bye=LKe;bye.DirectoryTree=iVt;bye.TreeNode=xR;function pbe(t){let{value:e,onChange:n,filterSearch:o,tablePrefixCls:r,locale:i}=t;return o?m.createElement("div",{className:`${r}-filter-dropdown-search`},m.createElement(as,{prefix:m.createElement(Fme,null),placeholder:i.filterSearchPlaceholder,onChange:n,value:e,htmlSize:1,className:`${r}-filter-dropdown-search-input`})):null}const aVt=t=>{const{keyCode:e}=t;e===fi.ENTER&&t.stopPropagation()},lVt=m.forwardRef((t,e)=>m.createElement("div",{className:t.className,onClick:n=>n.stopPropagation(),onKeyDown:aVt,ref:e},t.children));function IC(t){let e=[];return(t||[]).forEach(n=>{let{value:o,children:r}=n;e.push(o),r&&(e=[].concat(Za(e),Za(IC(r))))}),e}function sVt(t){return t.some(e=>{let{children:n}=e;return n})}function WKe(t,e){return typeof e=="string"||typeof e=="number"?e==null?void 0:e.toString().toLowerCase().includes(t.trim().toLowerCase()):!1}function NKe(t){let{filters:e,prefixCls:n,filteredKeys:o,filterMultiple:r,searchValue:i,filterSearch:a}=t;return e.map((l,s)=>{const c=String(l.value);if(l.children)return{key:c||s,label:l.text,popupClassName:`${n}-dropdown-submenu`,children:NKe({filters:l.children,prefixCls:n,filteredKeys:o,filterMultiple:r,searchValue:i,filterSearch:a})};const u=r?Li:Ue,d={key:l.value!==void 0?c:s,label:m.createElement(m.Fragment,null,m.createElement(u,{checked:o.includes(c)}),m.createElement("span",null,l.text))};return i.trim()?typeof a=="function"?a(i,l)?d:null:WKe(i,l.text)?d:null:d})}function vie(t){return t||[]}function cVt(t){var e,n;const{tablePrefixCls:o,prefixCls:r,column:i,dropdownPrefixCls:a,columnKey:l,filterOnClose:s,filterMultiple:c,filterMode:u="menu",filterSearch:d=!1,filterState:f,triggerFilter:p,locale:g,children:y,getPopupContainer:w,rootClassName:b}=t,{filterDropdownOpen:C,onFilterDropdownOpenChange:P,filterResetToDefaultFilteredValue:v,defaultFilteredValue:T,filterDropdownVisible:A,onFilterDropdownVisibleChange:x}=i,[S,R]=m.useState(!1),M=!!(f&&(!((e=f.filteredKeys)===null||e===void 0)&&e.length||f.forceFiltered)),D=he=>{R(he),P==null||P(he),x==null||x(he)},E=(n=C??A)!==null&&n!==void 0?n:S,W=f==null?void 0:f.filteredKeys,[j,L]=f_t(vie(W)),k=he=>{let{selectedKeys:xe}=he;L(xe)},N=(he,xe)=>{let{node:He,checked:Se}=xe;k(c?{selectedKeys:he}:{selectedKeys:Se&&He.key?[He.key]:[]})};m.useEffect(()=>{S&&k({selectedKeys:vie(W)})},[W]);const[F,U]=m.useState([]),O=he=>{U(he)},[B,_]=m.useState(""),X=he=>{const{value:xe}=he.target;_(xe)};m.useEffect(()=>{S||_("")},[S]);const $=he=>{const xe=he&&he.length?he:null;if(xe===null&&(!f||!f.filteredKeys)||m0e(xe,f==null?void 0:f.filteredKeys,!0))return null;p({column:i,key:l,filteredKeys:xe})},Q=()=>{D(!1),$(j())},le=function(){let{confirm:he,closeDropdown:xe}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{confirm:!1,closeDropdown:!1};he&&$([]),xe&&D(!1),_(""),L(v?(T||[]).map(He=>String(He)):[])},q=function(){let{closeDropdown:he}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{closeDropdown:!0};he&&D(!1),$(j())},te=(he,xe)=>{xe.source==="trigger"&&(he&&W!==void 0&&L(vie(W)),D(he),!he&&!i.filterDropdown&&s&&Q())},re=Un({[`${a}-menu-without-submenu`]:!sVt(i.filters||[])}),ae=he=>{if(he.target.checked){const xe=IC(i==null?void 0:i.filters).map(He=>String(He));L(xe)}else L([])},se=he=>{let{filters:xe}=he;return(xe||[]).map((He,Se)=>{const ze=String(He.value),Ie={title:He.text,key:He.value!==void 0?ze:String(Se)};return He.children&&(Ie.children=se({filters:He.children})),Ie})},ne=he=>{var xe;return Object.assign(Object.assign({},he),{text:he.title,value:he.key,children:((xe=he.children)===null||xe===void 0?void 0:xe.map(He=>ne(He)))||[]})};let fe;if(typeof i.filterDropdown=="function")fe=i.filterDropdown({prefixCls:`${a}-custom`,setSelectedKeys:he=>k({selectedKeys:he}),selectedKeys:j(),confirm:q,clearFilters:le,filters:i.filters,visible:E,close:()=>{D(!1)}});else if(i.filterDropdown)fe=i.filterDropdown;else{const he=j()||[],xe=()=>{const Se=m.createElement(fg,{image:fg.PRESENTED_IMAGE_SIMPLE,description:g.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}});if((i.filters||[]).length===0)return Se;if(u==="tree")return m.createElement(m.Fragment,null,m.createElement(pbe,{filterSearch:d,value:B,onChange:X,tablePrefixCls:o,locale:g}),m.createElement("div",{className:`${o}-filter-dropdown-tree`},c?m.createElement(Li,{checked:he.length===IC(i.filters).length,indeterminate:he.length>0&&he.lengthtypeof d=="function"?d(B,ne(ye)):WKe(B,ye.title):void 0})));const ze=NKe({filters:i.filters||[],filterSearch:d,prefixCls:r,filteredKeys:j(),filterMultiple:c,searchValue:B}),Ie=ze.every(ye=>ye===null);return m.createElement(m.Fragment,null,m.createElement(pbe,{filterSearch:d,value:B,onChange:X,tablePrefixCls:o,locale:g}),Ie?Se:m.createElement(_H,{selectable:!0,multiple:c,prefixCls:`${a}-menu`,className:re,onSelect:k,onDeselect:k,selectedKeys:he,getPopupContainer:w,openKeys:F,onOpenChange:O,items:ze}))},He=()=>v?m0e((T||[]).map(Se=>String(Se)),he,!0):he.length===0;fe=m.createElement(m.Fragment,null,xe(),m.createElement("div",{className:`${r}-dropdown-btns`},m.createElement(lo,{type:"link",size:"small",disabled:He(),onClick:()=>le()},g.filterReset),m.createElement(lo,{type:"primary",size:"small",onClick:Q},g.filterConfirm)))}i.filterDropdown&&(fe=m.createElement(gXe,{selectable:void 0},fe));const ge=()=>m.createElement(lVt,{className:`${r}-dropdown`},fe);let de;typeof i.filterIcon=="function"?de=i.filterIcon(M):i.filterIcon?de=i.filterIcon:de=m.createElement(d_t,null);const{direction:Z}=m.useContext(Cr);return m.createElement("div",{className:`${r}-column`},m.createElement("span",{className:`${o}-column-title`},y),m.createElement(jw,{dropdownRender:ge,trigger:["click"],open:E,onOpenChange:te,getPopupContainer:w,placement:Z==="rtl"?"bottomLeft":"bottomRight",rootClassName:b},m.createElement("span",{role:"button",tabIndex:-1,className:Un(`${r}-trigger`,{active:M}),onClick:he=>{he.stopPropagation()}},de)))}function Mue(t,e,n){let o=[];return(t||[]).forEach((r,i)=>{var a;const l=eN(i,n);if(r.filters||"filterDropdown"in r||"onFilter"in r)if("filteredValue"in r){let s=r.filteredValue;"filterDropdown"in r||(s=(a=s==null?void 0:s.map(String))!==null&&a!==void 0?a:s),o.push({column:r,key:Kx(r,l),filteredKeys:s,forceFiltered:r.filtered})}else o.push({column:r,key:Kx(r,l),filteredKeys:e&&r.defaultFilteredValue?r.defaultFilteredValue:void 0,forceFiltered:r.filtered});"children"in r&&(o=[].concat(Za(o),Za(Mue(r.children,e,l))))}),o}function UKe(t,e,n,o,r,i,a,l,s){return n.map((c,u)=>{const d=eN(u,l),{filterOnClose:f=!0,filterMultiple:p=!0,filterMode:g,filterSearch:y}=c;let w=c;if(w.filters||w.filterDropdown){const b=Kx(w,d),C=o.find(P=>{let{key:v}=P;return b===v});w=Object.assign(Object.assign({},w),{title:P=>m.createElement(cVt,{tablePrefixCls:t,prefixCls:`${t}-filter`,dropdownPrefixCls:e,column:w,columnKey:b,filterState:C,filterOnClose:f,filterMultiple:p,filterMode:g,filterSearch:y,triggerFilter:i,locale:r,getPopupContainer:a,rootClassName:s},pQ(c.title,P))})}return"children"in w&&(w=Object.assign(Object.assign({},w),{children:UKe(t,e,w.children,o,r,i,a,d,s)})),w})}function gbe(t){const e={};return t.forEach(n=>{let{key:o,filteredKeys:r,column:i}=n;const a=o,{filters:l,filterDropdown:s}=i;if(s)e[a]=r||null;else if(Array.isArray(r)){const c=IC(l);e[a]=c.filter(u=>r.includes(String(u)))}else e[a]=null}),e}function Iue(t,e,n){return e.reduce((o,r)=>{const{column:{onFilter:i,filters:a},filteredKeys:l}=r;return i&&l&&l.length?o.map(s=>Object.assign({},s)).filter(s=>l.some(c=>{const u=IC(a),d=u.findIndex(p=>String(p)===String(c)),f=d!==-1?u[d]:c;return s[n]&&(s[n]=Iue(s[n],e,n)),i(f,s)})):o},t)}const jKe=t=>t.flatMap(e=>"children"in e?[e].concat(Za(jKe(e.children||[]))):[e]);function uVt(t){let{prefixCls:e,dropdownPrefixCls:n,mergedColumns:o,onFilterChange:r,getPopupContainer:i,locale:a,rootClassName:l}=t;kb();const s=m.useMemo(()=>jKe(o||[]),[o]),[c,u]=m.useState(()=>Mue(s,!0)),d=m.useMemo(()=>{const y=Mue(s,!1);if(y.length===0)return y;let w=!0;if(y.forEach(b=>{let{filteredKeys:C}=b;C!==void 0&&(w=!1)}),w){const b=(s||[]).map((C,P)=>Kx(C,eN(P)));return c.filter(C=>{let{key:P}=C;return b.includes(P)}).map(C=>{const P=s[b.findIndex(v=>v===C.key)];return Object.assign(Object.assign({},C),{column:Object.assign(Object.assign({},C.column),P),forceFiltered:P.filtered})})}return y},[s,c]),f=m.useMemo(()=>gbe(d),[d]),p=y=>{const w=d.filter(b=>{let{key:C}=b;return C!==y.key});w.push(y),u(w),r(gbe(w),w)};return[y=>UKe(e,n,y,d,a,p,i,void 0,l),d,f]}function dVt(t,e,n){const o=m.useRef({});function r(i){if(!o.current||o.current.data!==t||o.current.childrenColumnName!==e||o.current.getRowKey!==n){let s=function(c){c.forEach((u,d)=>{const f=n(u,d);l.set(f,u),u&&typeof u=="object"&&e in u&&s(u[e]||[])})};var a=s;const l=new Map;s(t),o.current={data:t,childrenColumnName:e,kvMap:l,getRowKey:n}}return o.current.kvMap.get(i)}return[r]}var fVt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const i=t[r];typeof i!="function"&&(n[r]=i)}),n}function pVt(t,e,n){const o=n&&typeof n=="object"?n:{},{total:r=0}=o,i=fVt(o,["total"]),[a,l]=m.useState(()=>({current:"defaultCurrent"in i?i.defaultCurrent:1,pageSize:"defaultPageSize"in i?i.defaultPageSize:BKe})),s=OJe(a,i,{total:r>0?r:t}),c=Math.ceil((r||t)/s.pageSize);s.current>c&&(s.current=c||1);const u=(f,p)=>{l({current:f??1,pageSize:p||s.pageSize})},d=(f,p)=>{var g;n&&((g=n.onChange)===null||g===void 0||g.call(n,f,p)),u(f,p),e(f,p||(s==null?void 0:s.pageSize))};return n===!1?[{},()=>{}]:[Object.assign(Object.assign({},s),{onChange:d}),u]}var gVt={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},mVt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:gVt}))},YKe=m.forwardRef(mVt),yVt={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},AVt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:yVt}))},wVt=m.forwardRef(AVt);const $_="ascend",xie="descend";function JG(t){return typeof t.sorter=="object"&&typeof t.sorter.multiple=="number"?t.sorter.multiple:!1}function mbe(t){return typeof t=="function"?t:t&&typeof t=="object"&&t.compare?t.compare:!1}function vVt(t,e){return e?t[t.indexOf(e)+1]:t[0]}function zue(t,e,n){let o=[];function r(i,a){o.push({column:i,key:Kx(i,a),multiplePriority:JG(i),sortOrder:i.sortOrder})}return(t||[]).forEach((i,a)=>{const l=eN(a,n);i.children?("sortOrder"in i&&r(i,l),o=[].concat(Za(o),Za(zue(i.children,e,l)))):i.sorter&&("sortOrder"in i?r(i,l):e&&i.defaultSortOrder&&o.push({column:i,key:Kx(i,l),multiplePriority:JG(i),sortOrder:i.defaultSortOrder}))}),o}function OKe(t,e,n,o,r,i,a,l){return(e||[]).map((s,c)=>{const u=eN(c,l);let d=s;if(d.sorter){const f=d.sortDirections||r,p=d.showSorterTooltip===void 0?a:d.showSorterTooltip,g=Kx(d,u),y=n.find(S=>{let{key:R}=S;return R===g}),w=y?y.sortOrder:null,b=vVt(f,w);let C;if(s.sortIcon)C=s.sortIcon({sortOrder:w});else{const S=f.includes($_)&&m.createElement(wVt,{className:Un(`${t}-column-sorter-up`,{active:w===$_})}),R=f.includes(xie)&&m.createElement(YKe,{className:Un(`${t}-column-sorter-down`,{active:w===xie})});C=m.createElement("span",{className:Un(`${t}-column-sorter`,{[`${t}-column-sorter-full`]:!!(S&&R)})},m.createElement("span",{className:`${t}-column-sorter-inner`,"aria-hidden":"true"},S,R))}const{cancelSort:P,triggerAsc:v,triggerDesc:T}=i||{};let A=P;b===xie?A=T:b===$_&&(A=v);const x=typeof p=="object"?Object.assign({title:A},p):{title:A};d=Object.assign(Object.assign({},d),{className:Un(d.className,{[`${t}-column-sort`]:w}),title:S=>{const R=`${t}-column-sorters`,M=m.createElement("span",{className:`${t}-column-title`},pQ(s.title,S)),D=m.createElement("div",{className:R},M,C);return p?typeof p!="boolean"&&(p==null?void 0:p.target)==="sorter-icon"?m.createElement("div",{className:`${R} ${t}-column-sorters-tooltip-target-sorter`},M,m.createElement(tA,Object.assign({},x),C)):m.createElement(tA,Object.assign({},x),D):D},onHeaderCell:S=>{const R=s.onHeaderCell&&s.onHeaderCell(S)||{},M=R.onClick,D=R.onKeyDown;R.onClick=j=>{o({column:s,key:g,sortOrder:b,multiplePriority:JG(s)}),M==null||M(j)},R.onKeyDown=j=>{j.keyCode===fi.ENTER&&(o({column:s,key:g,sortOrder:b,multiplePriority:JG(s)}),D==null||D(j))};const E=s_t(s.title,{}),W=E==null?void 0:E.toString();return w?R["aria-sort"]=w==="ascend"?"ascending":"descending":R["aria-label"]=W||"",R.className=Un(R.className,`${t}-column-has-sorters`),R.tabIndex=0,s.ellipsis&&(R.title=(E??"").toString()),R}})}return"children"in d&&(d=Object.assign(Object.assign({},d),{children:OKe(t,d.children,n,o,r,i,a,u)})),d})}const ybe=t=>{const{column:e,sortOrder:n}=t;return{column:e,order:n,field:e.dataIndex,columnKey:e.key}},Abe=t=>{const e=t.filter(n=>{let{sortOrder:o}=n;return o}).map(ybe);if(e.length===0&&t.length){const n=t.length-1;return Object.assign(Object.assign({},ybe(t[n])),{column:void 0})}return e.length<=1?e[0]||{}:e};function Due(t,e,n){const o=e.slice().sort((a,l)=>l.multiplePriority-a.multiplePriority),r=t.slice(),i=o.filter(a=>{let{column:{sorter:l},sortOrder:s}=a;return mbe(l)&&s});return i.length?r.sort((a,l)=>{for(let s=0;s{const l=a[n];return l?Object.assign(Object.assign({},a),{[n]:Due(l,e,n)}):a}):r}function xVt(t){let{prefixCls:e,mergedColumns:n,onSorterChange:o,sortDirections:r,tableLocale:i,showSorterTooltip:a}=t;const[l,s]=m.useState(zue(n,!0)),c=m.useMemo(()=>{let g=!0;const y=zue(n,!1);if(!y.length)return l;const w=[];function b(P){g?w.push(P):w.push(Object.assign(Object.assign({},P),{sortOrder:null}))}let C=null;return y.forEach(P=>{C===null?(b(P),P.sortOrder&&(P.multiplePriority===!1?g=!1:C=!0)):(C&&P.multiplePriority!==!1||(g=!1),b(P))}),w},[n,l]),u=m.useMemo(()=>{const g=c.map(y=>{let{column:w,sortOrder:b}=y;return{column:w,order:b}});return{sortColumns:g,sortColumn:g[0]&&g[0].column,sortOrder:g[0]&&g[0].order}},[c]),d=g=>{let y;g.multiplePriority===!1||!c.length||c[0].multiplePriority===!1?y=[g]:y=[].concat(Za(c.filter(w=>{let{key:b}=w;return b!==g.key})),[g]),s(y),o(Abe(y),y)};return[g=>OKe(e,g,c,d,r,i,a),c,u,()=>Abe(c)]}function _Ke(t,e){return t.map(n=>{const o=Object.assign({},n);return o.title=pQ(n.title,e),"children"in o&&(o.children=_Ke(o.children,e)),o})}function bVt(t){return[m.useCallback(n=>_Ke(n,t),[t])]}const SVt=pKe((t,e)=>{const{_renderTimes:n}=t,{_renderTimes:o}=e;return n!==o}),TVt=mKe((t,e)=>{const{_renderTimes:n}=t,{_renderTimes:o}=e;return n!==o}),PVt=t=>{const{componentCls:e,lineWidth:n,lineType:o,tableBorderColor:r,tableHeaderBg:i,tablePaddingVertical:a,tablePaddingHorizontal:l,calc:s}=t,c=`${Nt(n)} ${o} ${r}`,u=(d,f,p)=>({[`&${e}-${d}`]:{[`> ${e}-container`]:{[`> ${e}-content, > ${e}-body`]:{"\n > table > tbody > tr > th,\n > table > tbody > tr > td\n ":{[`> ${e}-expanded-row-fixed`]:{margin:`${Nt(s(f).mul(-1).equal())} + onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,NOt="".concat(LOt," ").concat(WOt).split(/[\s\n]+/),UOt="aria-",jOt="data-";function Qxe(t,e){return t.indexOf(e)===0}function PKe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;e===!1?n={aria:!0,data:!0,attr:!0}:e===!0?n={aria:!0}:n=Ru({},e);var o={};return Object.keys(t).forEach(function(r){(n.aria&&(r==="role"||Qxe(r,UOt))||n.data&&Qxe(r,jOt)||n.attr&&NOt.includes(r))&&(o[r]=t[r])}),o}var Aye=m.createContext(null),BOt=function(e){for(var n=e.prefixCls,o=e.level,r=e.isStart,i=e.isEnd,a="".concat(n,"-indent-unit"),l=[],s=0;s1&&arguments[1]!==void 0?arguments[1]:{},n=[];return be.Children.forEach(t,function(o){o==null&&!e.keepEmpty||(Array.isArray(o)?n=n.concat(Sue(o)):CC.isFragment(o)&&o.props?n=n.concat(Sue(o.props.children,e)):n.push(o))}),n}function OOt(t,e){var n=Ru({},t);return Array.isArray(e)&&e.forEach(function(o){delete n[o]}),n}var _Ot=["children"];function CKe(t,e){return"".concat(t,"-").concat(e)}function VOt(t){return t&&t.type&&t.type.isTreeNode}function eN(t,e){return t??e}function vR(t){var e=t||{},n=e.title,o=e._title,r=e.key,i=e.children,a=n||"title";return{title:a,_title:o||[a],key:r||"key",children:i||"children"}}function RKe(t){function e(n){var o=Sue(n);return o.map(function(r){if(!VOt(r))return b2(!r,"Tree/TreeNode can only accept TreeNode as children."),null;var i=r.key,a=r.props,l=a.children,s=hQ(a,_Ot),c=Ru({key:i},s),u=e(l);return u.length&&(c.children=u),c}).filter(function(r){return r})}return e(t)}function mie(t,e,n){var o=vR(n),r=o._title,i=o.key,a=o.children,l=new Set(e===!0?[]:e),s=[];function c(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return u.map(function(f,p){for(var g=CKe(d?d.pos:"0",p),y=eN(f[i],g),w,b=0;b1&&arguments[1]!==void 0?arguments[1]:{},n=e.initWrapper,o=e.processEntity,r=e.onProcessFinished,i=e.externalGetKey,a=e.childrenPropName,l=e.fieldNames,s=arguments.length>2?arguments[2]:void 0,c=i||s,u={},d={},f={posEntities:u,keyEntities:d};return n&&(f=n(f)||f),GOt(t,function(p){var g=p.node,y=p.index,w=p.pos,b=p.key,C=p.parentPos,P=p.level,v=p.nodes,T={node:g,nodes:v,index:y,key:b,pos:w,level:P},A=eN(b,w);u[w]=T,d[A]=T,T.parent=u[C],T.parent&&(T.parent.children=T.parent.children||[],T.parent.children.push(T)),o&&o(T,f)},{externalGetKey:c,childrenPropName:a,fieldNames:l}),r&&r(f),f}function TE(t,e){var n=e.expandedKeys,o=e.selectedKeys,r=e.loadedKeys,i=e.loadingKeys,a=e.checkedKeys,l=e.halfCheckedKeys,s=e.dragOverNodeKey,c=e.dropPosition,u=e.keyEntities,d=Np(u,t),f={eventKey:t,expanded:n.indexOf(t)!==-1,selected:o.indexOf(t)!==-1,loaded:r.indexOf(t)!==-1,loading:i.indexOf(t)!==-1,checked:a.indexOf(t)!==-1,halfChecked:l.indexOf(t)!==-1,pos:String(d?d.pos:""),dragOver:s===t&&c===0,dragOverGapTop:s===t&&c===-1,dragOverGapBottom:s===t&&c===1};return f}function nu(t){var e=t.data,n=t.expanded,o=t.selected,r=t.checked,i=t.loaded,a=t.loading,l=t.halfChecked,s=t.dragOver,c=t.dragOverGapTop,u=t.dragOverGapBottom,d=t.pos,f=t.active,p=t.eventKey,g=Ru(Ru({},e),{},{expanded:n,selected:o,checked:r,loaded:i,loading:a,halfChecked:l,dragOver:s,dragOverGapTop:c,dragOverGapBottom:u,pos:d,active:f,key:p});return"props"in g||Object.defineProperty(g,"props",{get:function(){return b2(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),t}}),g}var XOt=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],Zxe="open",ebe="close",JOt="---",KOt=function(t){bKe(n,t);var e=SKe(n);function n(){var o;vKe(this,n);for(var r=arguments.length,i=new Array(r),a=0;a=0&&n.splice(o,1),n}function u6(t,e){var n=(t||[]).slice();return n.indexOf(e)===-1&&n.push(e),n}function vye(t){return t.split("-")}function qOt(t,e){var n=[],o=Np(e,t);function r(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];i.forEach(function(a){var l=a.key,s=a.children;n.push(l),r(s)})}return r(o.children),n}function $Ot(t){if(t.parent){var e=vye(t.pos);return Number(e[e.length-1])===t.parent.children.length-1}return!1}function QOt(t){var e=vye(t.pos);return Number(e[e.length-1])===0}function tbe(t,e,n,o,r,i,a,l,s,c){var u,d=t.clientX,f=t.clientY,p=t.target.getBoundingClientRect(),g=p.top,y=p.height,w=(c==="rtl"?-1:1)*(((r==null?void 0:r.x)||0)-d),b=(w-12)/o,C=s.filter(function(k){var N;return(N=l[k])===null||N===void 0||(N=N.children)===null||N===void 0?void 0:N.length}),P=Np(l,n.props.eventKey);if(f-1.5?i({dragNode:W,dropNode:j,dropPosition:1})?M=1:L=!1:i({dragNode:W,dropNode:j,dropPosition:0})?M=0:i({dragNode:W,dropNode:j,dropPosition:1})?M=1:L=!1:i({dragNode:W,dropNode:j,dropPosition:1})?M=1:L=!1,{dropPosition:M,dropLevelOffset:D,dropTargetKey:P.key,dropTargetPos:P.pos,dragOverNodeKey:R,dropContainerKey:M===0?null:((u=P.parent)===null||u===void 0?void 0:u.key)||null,dropAllowed:L}}function nbe(t,e){if(t){var n=e.multiple;return n?t.slice():t.length?[t[0]]:t}}function yie(t){if(!t)return null;var e;if(Array.isArray(t))e={checkedKeys:t,halfCheckedKeys:void 0};else if(oA(t)==="object")e={checkedKeys:t.checked||void 0,halfCheckedKeys:t.halfChecked||void 0};else return b2(!1,"`checkedKeys` is not an array or an object"),null;return e}function Tue(t,e){var n=new Set;function o(r){if(!n.has(r)){var i=Np(e,r);if(i){n.add(r);var a=i.parent,l=i.node;l.disabled||a&&o(a.key)}}}return(t||[]).forEach(function(r){o(r)}),yx(n)}function HKe(t,e){var n=new Set;return t.forEach(function(o){e.has(o)||n.add(o)}),n}function ZOt(t){var e=t||{},n=e.disabled,o=e.disableCheckbox,r=e.checkable;return!!(n||o)||r===!1}function e_t(t,e,n,o){for(var r=new Set(t),i=new Set,a=0;a<=n;a+=1){var l=e.get(a)||new Set;l.forEach(function(d){var f=d.key,p=d.node,g=d.children,y=g===void 0?[]:g;r.has(f)&&!o(p)&&y.filter(function(w){return!o(w.node)}).forEach(function(w){r.add(w.key)})})}for(var s=new Set,c=n;c>=0;c-=1){var u=e.get(c)||new Set;u.forEach(function(d){var f=d.parent,p=d.node;if(!(o(p)||!d.parent||s.has(d.parent.key))){if(o(d.parent.node)){s.add(f.key);return}var g=!0,y=!1;(f.children||[]).filter(function(w){return!o(w.node)}).forEach(function(w){var b=w.key,C=r.has(b);g&&!C&&(g=!1),!y&&(C||i.has(b))&&(y=!0)}),g&&r.add(f.key),y&&i.add(f.key),s.add(f.key)}})}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(HKe(i,r))}}function t_t(t,e,n,o,r){for(var i=new Set(t),a=new Set(e),l=0;l<=o;l+=1){var s=n.get(l)||new Set;s.forEach(function(f){var p=f.key,g=f.node,y=f.children,w=y===void 0?[]:y;!i.has(p)&&!a.has(p)&&!r(g)&&w.filter(function(b){return!r(b.node)}).forEach(function(b){i.delete(b.key)})})}a=new Set;for(var c=new Set,u=o;u>=0;u-=1){var d=n.get(u)||new Set;d.forEach(function(f){var p=f.parent,g=f.node;if(!(r(g)||!f.parent||c.has(f.parent.key))){if(r(f.parent.node)){c.add(p.key);return}var y=!0,w=!1;(p.children||[]).filter(function(b){return!r(b.node)}).forEach(function(b){var C=b.key,P=i.has(C);y&&!P&&(y=!1),!w&&(P||a.has(C))&&(w=!0)}),y||i.delete(p.key),w&&a.add(p.key),c.add(p.key)}})}return{checkedKeys:Array.from(i),halfCheckedKeys:Array.from(HKe(a,i))}}function MC(t,e,n,o){var r=[],i;o?i=o:i=ZOt;var a=new Set(t.filter(function(u){var d=!!Np(n,u);return d||r.push(u),d})),l=new Map,s=0;Object.keys(n).forEach(function(u){var d=n[u],f=d.level,p=l.get(f);p||(p=new Set,l.set(f,p)),p.add(d),s=Math.max(s,f)}),b2(!r.length,"Tree missing follow keys: ".concat(r.slice(0,100).map(function(u){return"'".concat(u,"'")}).join(", ")));var c;return e===!0?c=e_t(a,l,s,i):c=t_t(a,e.halfCheckedKeys,l,s,i),c}function n_t(t){const[e,n]=m.useState(null);return[m.useCallback((i,a,l)=>{const s=e??i,c=Math.min(s||0,i),u=Math.max(s||0,i),d=a.slice(c,u+1).map(g=>t(g)),f=d.some(g=>!l.has(g)),p=[];return d.forEach(g=>{f?(l.has(g)||p.push(g),l.add(g)):(l.delete(g),p.push(g))}),n(f?u:null),p},[e]),i=>{n(i)}]}const L4={},Pue="SELECT_ALL",Cue="SELECT_INVERT",Rue="SELECT_NONE",obe=[],MKe=(t,e)=>{let n=[];return(e||[]).forEach(o=>{n.push(o),o&&typeof o=="object"&&t in o&&(n=[].concat(Za(n),Za(MKe(t,o[t]))))}),n},o_t=(t,e)=>{const{preserveSelectedRowKeys:n,selectedRowKeys:o,defaultSelectedRowKeys:r,getCheckboxProps:i,onChange:a,onSelect:l,onSelectAll:s,onSelectInvert:c,onSelectNone:u,onSelectMultiple:d,columnWidth:f,type:p,selections:g,fixed:y,renderCell:w,hideSelectAll:b,checkStrictly:C=!0}=e||{},{prefixCls:P,data:v,pageData:T,getRecordByKey:A,getRowKey:x,expandType:S,childrenColumnName:R,locale:M,getPopupContainer:D}=t,E=kb(),[W,j]=n_t(se=>se),[L,k]=$6(o||r||obe,{value:o}),N=m.useRef(new Map),F=m.useCallback(se=>{if(n){const ne=new Map;se.forEach(fe=>{let ge=A(fe);!ge&&N.current.has(fe)&&(ge=N.current.get(fe)),ne.set(fe,ge)}),N.current=ne}},[A,n]);m.useEffect(()=>{F(L)},[L]);const{keyEntities:U}=m.useMemo(()=>{if(C)return{keyEntities:null};let se=v;if(n){const ne=new Set(v.map((ge,de)=>x(ge,de))),fe=Array.from(N.current).reduce((ge,de)=>{let[Z,he]=de;return ne.has(Z)?ge:ge.concat(he)},[]);se=[].concat(Za(se),Za(fe))}return wye(se,{externalGetKey:x,childrenPropName:R})},[v,x,C,R,n]),O=m.useMemo(()=>MKe(R,T),[R,T]),B=m.useMemo(()=>{const se=new Map;return O.forEach((ne,fe)=>{const ge=x(ne,fe),de=(i?i(ne):null)||{};se.set(ge,de)}),se},[O,x,i]),_=m.useCallback(se=>{var ne;return!!(!((ne=B.get(x(se)))===null||ne===void 0)&&ne.disabled)},[B,x]),[X,$]=m.useMemo(()=>{if(C)return[L||[],[]];const{checkedKeys:se,halfCheckedKeys:ne}=MC(L,!0,U,_);return[se||[],ne]},[L,C,U,_]),Q=m.useMemo(()=>{const se=p==="radio"?X.slice(0,1):X;return new Set(se)},[X,p]),le=m.useMemo(()=>p==="radio"?new Set:new Set($),[$,p]);m.useEffect(()=>{e||k(obe)},[!!e]);const q=m.useCallback((se,ne)=>{let fe,ge;F(se),n?(fe=se,ge=se.map(de=>N.current.get(de))):(fe=[],ge=[],se.forEach(de=>{const Z=A(de);Z!==void 0&&(fe.push(de),ge.push(Z))})),k(fe),a==null||a(fe,ge,{type:ne})},[k,A,a,n]),te=m.useCallback((se,ne,fe,ge)=>{if(l){const de=fe.map(Z=>A(Z));l(A(se),ne,de,ge)}q(fe,"single")},[l,A,q]),re=m.useMemo(()=>!g||b?null:(g===!0?[Pue,Cue,Rue]:g).map(ne=>ne===Pue?{key:"all",text:M.selectionAll,onSelect(){q(v.map((fe,ge)=>x(fe,ge)).filter(fe=>{const ge=B.get(fe);return!(ge!=null&&ge.disabled)||Q.has(fe)}),"all")}}:ne===Cue?{key:"invert",text:M.selectInvert,onSelect(){const fe=new Set(Q);T.forEach((de,Z)=>{const he=x(de,Z),xe=B.get(he);xe!=null&&xe.disabled||(fe.has(he)?fe.delete(he):fe.add(he))});const ge=Array.from(fe);c&&(E.deprecated(!1,"onSelectInvert","onChange"),c(ge)),q(ge,"invert")}}:ne===Rue?{key:"none",text:M.selectNone,onSelect(){u==null||u(),q(Array.from(Q).filter(fe=>{const ge=B.get(fe);return ge==null?void 0:ge.disabled}),"none")}}:ne).map(ne=>Object.assign(Object.assign({},ne),{onSelect:function(){for(var fe,ge,de=arguments.length,Z=new Array(de),he=0;he{var ne;if(!e)return se.filter(Pe=>Pe!==L4);let fe=Za(se);const ge=new Set(Q),de=O.map(x).filter(Pe=>!B.get(Pe).disabled),Z=de.every(Pe=>ge.has(Pe)),he=de.some(Pe=>ge.has(Pe)),xe=()=>{const Pe=[];Z?de.forEach(Be=>{ge.delete(Be),Pe.push(Be)}):de.forEach(Be=>{ge.has(Be)||(ge.add(Be),Pe.push(Be))});const Ee=Array.from(ge);s==null||s(!Z,Ee.map(Be=>A(Be)),Pe.map(Be=>A(Be))),q(Ee,"all"),j(null)};let He,Se;if(p!=="radio"){let Pe;if(re){const Ke={getPopupContainer:D,items:re.map((Ne,De)=>{const{key:ke,text:Ye,onSelect:it}=Ne;return{key:ke??De,onClick:()=>{it==null||it(de)},label:Ye}})};Pe=m.createElement("div",{className:`${P}-selection-extra`},m.createElement(jw,{menu:Ke,getPopupContainer:D},m.createElement("span",null,m.createElement(Fme,null))))}const Ee=O.map((Ke,Ne)=>{const De=x(Ke,Ne),ke=B.get(De)||{};return Object.assign({checked:ge.has(De)},ke)}).filter(Ke=>{let{disabled:Ne}=Ke;return Ne}),Be=!!Ee.length&&Ee.length===O.length,Je=Be&&Ee.every(Ke=>{let{checked:Ne}=Ke;return Ne}),We=Be&&Ee.some(Ke=>{let{checked:Ne}=Ke;return Ne});Se=m.createElement(Li,{checked:Be?Je:!!O.length&&Z,indeterminate:Be?!Je&&We:!Z&&he,onChange:xe,disabled:O.length===0||Be,"aria-label":Pe?"Custom selection":"Select all",skipGroup:!0}),He=!b&&m.createElement("div",{className:`${P}-selection`},Se,Pe)}let ze;p==="radio"?ze=(Pe,Ee,Be)=>{const Je=x(Ee,Be),We=ge.has(Je);return{node:m.createElement(Ue,Object.assign({},B.get(Je),{checked:We,onClick:Ke=>Ke.stopPropagation(),onChange:Ke=>{ge.has(Je)||te(Je,!0,[Je],Ke.nativeEvent)}})),checked:We}}:ze=(Pe,Ee,Be)=>{var Je;const We=x(Ee,Be),Ke=ge.has(We),Ne=le.has(We),De=B.get(We);let ke;return S==="nest"?ke=Ne:ke=(Je=De==null?void 0:De.indeterminate)!==null&&Je!==void 0?Je:Ne,{node:m.createElement(Li,Object.assign({},De,{indeterminate:ke,checked:Ke,skipGroup:!0,onClick:Ye=>Ye.stopPropagation(),onChange:Ye=>{let{nativeEvent:it}=Ye;const{shiftKey:Ve}=it,yt=de.findIndex(Xe=>Xe===We),ct=X.some(Xe=>de.includes(Xe));if(Ve&&C&&ct){const Xe=W(yt,de,ge),ut=Array.from(ge);d==null||d(!Ke,ut.map(ft=>A(ft)),Xe.map(ft=>A(ft))),q(ut,"multiple")}else{const Xe=X;if(C){const ut=Ke?q5(Xe,We):u6(Xe,We);te(We,!Ke,ut,it)}else{const ut=MC([].concat(Za(Xe),[We]),!0,U,_),{checkedKeys:ft,halfCheckedKeys:ot}=ut;let st=ft;if(Ke){const at=new Set(ft);at.delete(We),st=MC(Array.from(at),{checked:!1,halfCheckedKeys:ot},U,_).checkedKeys}te(We,!Ke,st,it)}}j(Ke?null:yt)}})),checked:Ke}};const Ie=(Pe,Ee,Be)=>{const{node:Je,checked:We}=ze(Pe,Ee,Be);return w?w(We,Ee,Be,Je):Je};if(!fe.includes(L4))if(fe.findIndex(Pe=>{var Ee;return((Ee=Pe[SE])===null||Ee===void 0?void 0:Ee.columnType)==="EXPAND_COLUMN"})===0){const[Pe,...Ee]=fe;fe=[Pe,L4].concat(Za(Ee))}else fe=[L4].concat(Za(fe));const ye=fe.indexOf(L4);fe=fe.filter((Pe,Ee)=>Pe!==L4||Ee===ye);const ce=fe[ye-1],pe=fe[ye+1];let ve=y;ve===void 0&&((pe==null?void 0:pe.fixed)!==void 0?ve=pe.fixed:(ce==null?void 0:ce.fixed)!==void 0&&(ve=ce.fixed)),ve&&ce&&((ne=ce[SE])===null||ne===void 0?void 0:ne.columnType)==="EXPAND_COLUMN"&&ce.fixed===void 0&&(ce.fixed=ve);const Ae=Un(`${P}-selection-col`,{[`${P}-selection-col-with-dropdown`]:g&&p==="checkbox"}),Te=()=>e!=null&&e.columnTitle?typeof e.columnTitle=="function"?e.columnTitle(Se):e.columnTitle:He,Me={fixed:ve,width:f,className:`${P}-selection-column`,title:Te(),render:Ie,onCell:e.onCell,[SE]:{className:Ae}};return fe.map(Pe=>Pe===L4?Me:Pe)},[x,O,e,X,Q,le,f,re,S,B,d,te,_]),Q]};function r_t(t,e){return t._antProxy=t._antProxy||{},Object.keys(e).forEach(n=>{if(!(n in t._antProxy)){const o=t[n];t._antProxy[n]=o,t[n]=e[n]}}),t}function i_t(t,e){return m.useImperativeHandle(t,()=>{const n=e(),{nativeElement:o}=n;return typeof Proxy<"u"?new Proxy(o,{get(r,i){return n[i]?n[i]:Reflect.get(r,i)}}):r_t(o,n)})}function a_t(t){return function(n){let{prefixCls:o,onExpand:r,record:i,expanded:a,expandable:l}=n;const s=`${o}-row-expand-icon`;return m.createElement("button",{type:"button",onClick:c=>{r(i,c),c.stopPropagation()},className:Un(s,{[`${s}-spaced`]:!l,[`${s}-expanded`]:l&&a,[`${s}-collapsed`]:l&&!a}),"aria-label":a?t.collapse:t.expand,"aria-expanded":a})}}function l_t(t){return(n,o)=>{const r=n.querySelector(`.${t}-container`);let i=o;if(r){const a=getComputedStyle(r),l=parseInt(a.borderLeftWidth,10),s=parseInt(a.borderRightWidth,10);i=o-l-s}return i}}function Kx(t,e){return"key"in t&&t.key!==void 0&&t.key!==null?t.key:t.dataIndex?Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex:e}function tN(t,e){return e?`${e}-${t}`:`${t}`}function pQ(t,e){return typeof t=="function"?t(e):t}function s_t(t,e){const n=pQ(t,e);return Object.prototype.toString.call(n)==="[object Object]"?"":n}var c_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"},u_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:c_t}))},d_t=m.forwardRef(u_t);function f_t(t){const e=m.useRef(t),n=jGe();return[()=>e.current,o=>{e.current=o,n()}]}var mi={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var n=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||n>=mi.F1&&n<=mi.F12)return!1;switch(n){case mi.ALT:case mi.CAPS_LOCK:case mi.CONTEXT_MENU:case mi.CTRL:case mi.DOWN:case mi.END:case mi.ESC:case mi.HOME:case mi.INSERT:case mi.LEFT:case mi.MAC_FF_META:case mi.META:case mi.NUMLOCK:case mi.NUM_CENTER:case mi.PAGE_DOWN:case mi.PAGE_UP:case mi.PAUSE:case mi.PRINT_SCREEN:case mi.RIGHT:case mi.SHIFT:case mi.UP:case mi.WIN_KEY:case mi.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=mi.ZERO&&e<=mi.NINE||e>=mi.NUM_ZERO&&e<=mi.NUM_MULTIPLY||e>=mi.A&&e<=mi.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case mi.SPACE:case mi.QUESTION_MARK:case mi.NUM_PLUS:case mi.NUM_MINUS:case mi.NUM_PERIOD:case mi.NUM_DIVISION:case mi.SEMICOLON:case mi.DASH:case mi.EQUALS:case mi.COMMA:case mi.PERIOD:case mi.SLASH:case mi.APOSTROPHE:case mi.SINGLE_QUOTE:case mi.OPEN_SQUARE_BRACKET:case mi.BACKSLASH:case mi.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};function h_t(t){var e=t.dropPosition,n=t.dropLevelOffset,o=t.indent,r={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(e){case-1:r.top=0,r.left=-n*o;break;case 1:r.bottom=0,r.left=-n*o;break;case 0:r.bottom=0,r.left=o;break}return m.createElement("div",{style:r})}function IKe(t){if(t==null)throw new TypeError("Cannot destructure "+t)}function p_t(t){if(Array.isArray(t))return t}function g_t(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var o,r,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(t)).next,e!==0)for(;!(s=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);s=!0);}catch(u){c=!0,r=u}finally{try{if(!s&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}function m_t(){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 xv(t,e){return p_t(t)||g_t(t,e)||yKe(t,e)||m_t()}function y_t(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var rbe=y_t()?m.useLayoutEffect:m.useEffect,JG=function(e,n){var o=m.useRef(!0);rbe(function(){return e(o.current)},n),rbe(function(){return o.current=!1,function(){o.current=!0}},[])};function A_t(t,e){var n=m.useState(!1),o=xv(n,2),r=o[0],i=o[1];JG(function(){if(r)return t(),function(){e()}},[r]),JG(function(){return i(!0),function(){i(!1)}},[])}var w_t=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],zKe=function(e,n){var o=e.className,r=e.style,i=e.motion,a=e.motionNodes,l=e.motionType,s=e.onMotionStart,c=e.onMotionEnd,u=e.active,d=e.treeNodeRequiredProps,f=hQ(e,w_t),p=m.useState(!0),g=xv(p,2),y=g[0],w=g[1],b=m.useContext(Aye),C=b.prefixCls,P=a&&l!=="hide";JG(function(){a&&P!==y&&w(P)},[a]);var v=function(){a&&s()},T=m.useRef(!1),A=function(){a&&!T.current&&(T.current=!0,c())};A_t(v,A);var x=function(R){P===R&&A()};return a?m.createElement(o1,H9({ref:n,visible:y},i,{motionAppear:l==="show",onVisibleChanged:x}),function(S,R){var M=S.className,D=S.style;return m.createElement("div",{ref:R,className:r9("".concat(C,"-treenode-motion"),M),style:D},a.map(function(E){var W=Object.assign({},(IKe(E.data),E.data)),j=E.title,L=E.key,k=E.isStart,N=E.isEnd;delete W.children;var F=TE(L,d);return m.createElement(xR,H9({},W,F,{title:j,active:u,data:E.data,key:L,isStart:k,isEnd:N}))}))}):m.createElement(xR,H9({domRef:n,className:o,style:r},f,{active:u}))};zKe.displayName="MotionTreeNode";var v_t=m.forwardRef(zKe);function x_t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=t.length,o=e.length;if(Math.abs(n-o)!==1)return{add:!1,key:null};function r(i,a){var l=new Map;i.forEach(function(c){l.set(c,!0)});var s=a.filter(function(c){return!l.has(c)});return s.length===1?s[0]:null}return n ").concat(e);return e}var EKe=m.forwardRef(function(t,e){var n=t.prefixCls,o=t.data;t.selectable,t.checkable;var r=t.expandedKeys,i=t.selectedKeys,a=t.checkedKeys,l=t.loadedKeys,s=t.loadingKeys,c=t.halfCheckedKeys,u=t.keyEntities,d=t.disabled,f=t.dragging,p=t.dragOverNodeKey,g=t.dropPosition,y=t.motion,w=t.height,b=t.itemHeight,C=t.virtual,P=t.focusable,v=t.activeItem,T=t.focused,A=t.tabIndex,x=t.onKeyDown,S=t.onFocus,R=t.onBlur,M=t.onActiveChange,D=t.onListChangeStart,E=t.onListChangeEnd,W=hQ(t,b_t),j=m.useRef(null),L=m.useRef(null);m.useImperativeHandle(e,function(){return{scrollTo:function(ze){j.current.scrollTo(ze)},getIndentWidth:function(){return L.current.offsetWidth}}});var k=m.useState(r),N=xv(k,2),F=N[0],U=N[1],O=m.useState(o),B=xv(O,2),_=B[0],X=B[1],$=m.useState(o),Q=xv($,2),le=Q[0],q=Q[1],te=m.useState([]),re=xv(te,2),ae=re[0],se=re[1],ne=m.useState(null),fe=xv(ne,2),ge=fe[0],de=fe[1],Z=m.useRef(o);Z.current=o;function he(){var Se=Z.current;X(Se),q(Se),se([]),de(null),E()}JG(function(){U(r);var Se=x_t(F,r);if(Se.key!==null)if(Se.add){var ze=_.findIndex(function(Ae){var Te=Ae.key;return Te===Se.key}),Ie=sbe(ibe(_,o,Se.key),C,w,b),ye=_.slice();ye.splice(ze+1,0,lbe),q(ye),se(Ie),de("show")}else{var ce=o.findIndex(function(Ae){var Te=Ae.key;return Te===Se.key}),pe=sbe(ibe(o,_,Se.key),C,w,b),ve=o.slice();ve.splice(ce+1,0,lbe),q(ve),se(pe),de("hide")}else _!==o&&(X(o),q(o))},[r,o]),m.useEffect(function(){f||he()},[f]);var xe=y?le:o,He={expandedKeys:r,selectedKeys:i,loadedKeys:l,loadingKeys:s,checkedKeys:a,halfCheckedKeys:c,dragOverNodeKey:p,dropPosition:g,keyEntities:u};return m.createElement(m.Fragment,null,T&&v&&m.createElement("span",{style:abe,"aria-live":"assertive"},T_t(v)),m.createElement("div",null,m.createElement("input",{style:abe,disabled:P===!1||d,tabIndex:P!==!1?A:null,onKeyDown:x,onFocus:S,onBlur:R,value:"",onChange:S_t,"aria-label":"for screen reader"})),m.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},m.createElement("div",{className:"".concat(n,"-indent")},m.createElement("div",{ref:L,className:"".concat(n,"-indent-unit")}))),m.createElement(G$,H9({},W,{data:xe,itemKey:cbe,height:w,fullHeight:!1,virtual:C,itemHeight:b,prefixCls:"".concat(n,"-list"),ref:j,onVisibleChange:function(ze,Ie){var ye=new Set(ze),ce=Ie.filter(function(pe){return!ye.has(pe)});ce.some(function(pe){return cbe(pe)===qx})&&he()}}),function(Se){var ze=Se.pos,Ie=Object.assign({},(IKe(Se.data),Se.data)),ye=Se.title,ce=Se.key,pe=Se.isStart,ve=Se.isEnd,Ae=eN(ce,ze);delete Ie.key,delete Ie.children;var Te=TE(Ae,He);return m.createElement(v_t,H9({},Ie,Te,{title:ye,active:!!v&&ce===v.key,pos:ze,data:Se.data,isStart:pe,isEnd:ve,motion:y,motionNodes:ce===qx?ae:null,motionType:ge,onMotionStart:D,onMotionEnd:he,treeNodeRequiredProps:He,onMouseMove:function(){M(null)}}))}))});EKe.displayName="NodeList";var P_t=10,xye=function(t){bKe(n,t);var e=SKe(n);function n(){var o;vKe(this,n);for(var r=arguments.length,i=new Array(r),a=0;a2&&arguments[2]!==void 0?arguments[2]:!1,d=o.state,f=d.dragChildrenKeys,p=d.dropPosition,g=d.dropTargetKey,y=d.dropTargetPos,w=d.dropAllowed;if(w){var b=o.props.onDrop;if(o.setState({dragOverNodeKey:null}),o.cleanDragState(),g!==null){var C=Ru(Ru({},TE(g,o.getTreeNodeRequiredProps())),{},{active:((c=o.getActiveItem())===null||c===void 0?void 0:c.key)===g,data:Np(o.state.keyEntities,g).node}),P=f.indexOf(g)!==-1;b2(!P,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var v=vye(y),T={event:l,node:nu(C),dragNode:o.dragNode?nu(o.dragNode.props):null,dragNodesKeys:[o.dragNode.props.eventKey].concat(f),dropToGap:p!==0,dropPosition:p+Number(v[v.length-1])};u||b==null||b(T),o.dragNode=null}}}),Yo(wr(o),"cleanDragState",function(){var l=o.state.draggingNodeKey;l!==null&&o.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),o.dragStartMousePosition=null,o.currentMouseOverDroppableNodeKey=null}),Yo(wr(o),"triggerExpandActionExpand",function(l,s){var c=o.state,u=c.expandedKeys,d=c.flattenNodes,f=s.expanded,p=s.key,g=s.isLeaf;if(!(g||l.shiftKey||l.metaKey||l.ctrlKey)){var y=d.filter(function(b){return b.key===p})[0],w=nu(Ru(Ru({},TE(p,o.getTreeNodeRequiredProps())),{},{data:y.data}));o.setExpandedKeys(f?q5(u,p):u6(u,p)),o.onNodeExpand(l,w)}}),Yo(wr(o),"onNodeClick",function(l,s){var c=o.props,u=c.onClick,d=c.expandAction;d==="click"&&o.triggerExpandActionExpand(l,s),u==null||u(l,s)}),Yo(wr(o),"onNodeDoubleClick",function(l,s){var c=o.props,u=c.onDoubleClick,d=c.expandAction;d==="doubleClick"&&o.triggerExpandActionExpand(l,s),u==null||u(l,s)}),Yo(wr(o),"onNodeSelect",function(l,s){var c=o.state.selectedKeys,u=o.state,d=u.keyEntities,f=u.fieldNames,p=o.props,g=p.onSelect,y=p.multiple,w=s.selected,b=s[f.key],C=!w;C?y?c=u6(c,b):c=[b]:c=q5(c,b);var P=c.map(function(v){var T=Np(d,v);return T?T.node:null}).filter(function(v){return v});o.setUncontrolledState({selectedKeys:c}),g==null||g(c,{event:"select",selected:C,node:s,selectedNodes:P,nativeEvent:l.nativeEvent})}),Yo(wr(o),"onNodeCheck",function(l,s,c){var u=o.state,d=u.keyEntities,f=u.checkedKeys,p=u.halfCheckedKeys,g=o.props,y=g.checkStrictly,w=g.onCheck,b=s.key,C,P={event:"check",node:s,checked:c,nativeEvent:l.nativeEvent};if(y){var v=c?u6(f,b):q5(f,b),T=q5(p,b);C={checked:v,halfChecked:T},P.checkedNodes=v.map(function(D){return Np(d,D)}).filter(function(D){return D}).map(function(D){return D.node}),o.setUncontrolledState({checkedKeys:v})}else{var A=MC([].concat(yx(f),[b]),!0,d),x=A.checkedKeys,S=A.halfCheckedKeys;if(!c){var R=new Set(x);R.delete(b);var M=MC(Array.from(R),{checked:!1,halfCheckedKeys:S},d);x=M.checkedKeys,S=M.halfCheckedKeys}C=x,P.checkedNodes=[],P.checkedNodesPositions=[],P.halfCheckedKeys=S,x.forEach(function(D){var E=Np(d,D);if(E){var W=E.node,j=E.pos;P.checkedNodes.push(W),P.checkedNodesPositions.push({node:W,pos:j})}}),o.setUncontrolledState({checkedKeys:x},!1,{halfCheckedKeys:S})}w==null||w(C,P)}),Yo(wr(o),"onNodeLoad",function(l){var s,c=l.key,u=o.state.keyEntities,d=Np(u,c);if(!(d!=null&&(s=d.children)!==null&&s!==void 0&&s.length)){var f=new Promise(function(p,g){o.setState(function(y){var w=y.loadedKeys,b=w===void 0?[]:w,C=y.loadingKeys,P=C===void 0?[]:C,v=o.props,T=v.loadData,A=v.onLoad;if(!T||b.indexOf(c)!==-1||P.indexOf(c)!==-1)return null;var x=T(l);return x.then(function(){var S=o.state.loadedKeys,R=u6(S,c);A==null||A(R,{event:"load",node:l}),o.setUncontrolledState({loadedKeys:R}),o.setState(function(M){return{loadingKeys:q5(M.loadingKeys,c)}}),p()}).catch(function(S){if(o.setState(function(M){return{loadingKeys:q5(M.loadingKeys,c)}}),o.loadingRetryTimes[c]=(o.loadingRetryTimes[c]||0)+1,o.loadingRetryTimes[c]>=P_t){var R=o.state.loadedKeys;b2(!1,"Retry for `loadData` many times but still failed. No more retry."),o.setUncontrolledState({loadedKeys:u6(R,c)}),p()}g(S)}),{loadingKeys:u6(P,c)}})});return f.catch(function(){}),f}}),Yo(wr(o),"onNodeMouseEnter",function(l,s){var c=o.props.onMouseEnter;c==null||c({event:l,node:s})}),Yo(wr(o),"onNodeMouseLeave",function(l,s){var c=o.props.onMouseLeave;c==null||c({event:l,node:s})}),Yo(wr(o),"onNodeContextMenu",function(l,s){var c=o.props.onRightClick;c&&(l.preventDefault(),c({event:l,node:s}))}),Yo(wr(o),"onFocus",function(){var l=o.props.onFocus;o.setState({focused:!0});for(var s=arguments.length,c=new Array(s),u=0;u1&&arguments[1]!==void 0?arguments[1]:!1,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!o.destroyed){var u=!1,d=!0,f={};Object.keys(l).forEach(function(p){if(p in o.props){d=!1;return}u=!0,f[p]=l[p]}),u&&(!s||d)&&o.setState(Ru(Ru({},f),c))}}),Yo(wr(o),"scrollTo",function(l){o.listRef.current.scrollTo(l)}),o}return xKe(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var r=this.props,i=r.activeKey,a=r.itemScrollOffset,l=a===void 0?0:a;i!==void 0&&i!==this.state.activeKey&&(this.setState({activeKey:i}),i!==null&&this.scrollTo({key:i,offset:l}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var r=this.state,i=r.focused,a=r.flattenNodes,l=r.keyEntities,s=r.draggingNodeKey,c=r.activeKey,u=r.dropLevelOffset,d=r.dropContainerKey,f=r.dropTargetKey,p=r.dropPosition,g=r.dragOverNodeKey,y=r.indent,w=this.props,b=w.prefixCls,C=w.className,P=w.style,v=w.showLine,T=w.focusable,A=w.tabIndex,x=A===void 0?0:A,S=w.selectable,R=w.showIcon,M=w.icon,D=w.switcherIcon,E=w.draggable,W=w.checkable,j=w.checkStrictly,L=w.disabled,k=w.motion,N=w.loadData,F=w.filterTreeNode,U=w.height,O=w.itemHeight,B=w.virtual,_=w.titleRender,X=w.dropIndicatorRender,$=w.onContextMenu,Q=w.onScroll,le=w.direction,q=w.rootClassName,te=w.rootStyle,re=PKe(this.props,{aria:!0,data:!0}),ae;return E&&(oA(E)==="object"?ae=E:typeof E=="function"?ae={nodeDraggable:E}:ae={}),m.createElement(Aye.Provider,{value:{prefixCls:b,selectable:S,showIcon:R,icon:M,switcherIcon:D,draggable:ae,draggingNodeKey:s,checkable:W,checkStrictly:j,disabled:L,keyEntities:l,dropLevelOffset:u,dropContainerKey:d,dropTargetKey:f,dropPosition:p,dragOverNodeKey:g,indent:y,direction:le,dropIndicatorRender:X,loadData:N,filterTreeNode:F,titleRender:_,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},m.createElement("div",{role:"tree",className:r9(b,C,q,Yo(Yo(Yo({},"".concat(b,"-show-line"),v),"".concat(b,"-focused"),i),"".concat(b,"-active-focused"),c!==null)),style:te},m.createElement(EKe,H9({ref:this.listRef,prefixCls:b,style:P,data:a,disabled:L,selectable:S,checkable:!!W,motion:k,dragging:s!==null,height:U,itemHeight:O,virtual:B,focusable:T,focused:i,tabIndex:x,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:$,onScroll:Q},this.getTreeNodeRequiredProps(),re))))}}],[{key:"getDerivedStateFromProps",value:function(r,i){var a=i.prevProps,l={prevProps:r};function s(A){return!a&&A in r||a&&a[A]!==r[A]}var c,u=i.fieldNames;if(s("fieldNames")&&(u=vR(r.fieldNames),l.fieldNames=u),s("treeData")?c=r.treeData:s("children")&&(b2(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),c=RKe(r.children)),c){l.treeData=c;var d=wye(c,{fieldNames:u});l.keyEntities=Ru(Yo({},qx,DKe),d.keyEntities)}var f=l.keyEntities||i.keyEntities;if(s("expandedKeys")||a&&s("autoExpandParent"))l.expandedKeys=r.autoExpandParent||!a&&r.defaultExpandParent?Tue(r.expandedKeys,f):r.expandedKeys;else if(!a&&r.defaultExpandAll){var p=Ru({},f);delete p[qx],l.expandedKeys=Object.keys(p).map(function(A){return p[A].key})}else!a&&r.defaultExpandedKeys&&(l.expandedKeys=r.autoExpandParent||r.defaultExpandParent?Tue(r.defaultExpandedKeys,f):r.defaultExpandedKeys);if(l.expandedKeys||delete l.expandedKeys,c||l.expandedKeys){var g=mie(c||i.treeData,l.expandedKeys||i.expandedKeys,u);l.flattenNodes=g}if(r.selectable&&(s("selectedKeys")?l.selectedKeys=nbe(r.selectedKeys,r):!a&&r.defaultSelectedKeys&&(l.selectedKeys=nbe(r.defaultSelectedKeys,r))),r.checkable){var y;if(s("checkedKeys")?y=yie(r.checkedKeys)||{}:!a&&r.defaultCheckedKeys?y=yie(r.defaultCheckedKeys)||{}:c&&(y=yie(r.checkedKeys)||{checkedKeys:i.checkedKeys,halfCheckedKeys:i.halfCheckedKeys}),y){var w=y,b=w.checkedKeys,C=b===void 0?[]:b,P=w.halfCheckedKeys,v=P===void 0?[]:P;if(!r.checkStrictly){var T=MC(C,!0,f);C=T.checkedKeys,v=T.halfCheckedKeys}l.checkedKeys=C,l.halfCheckedKeys=v}}return s("loadedKeys")&&(l.loadedKeys=r.loadedKeys),l}}]),n}(m.Component);Yo(xye,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:h_t,allowDrop:function(){return!0},expandAction:!1});Yo(xye,"TreeNode",xR);var C_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},R_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:C_t}))},FKe=m.forwardRef(R_t),H_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},M_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:H_t}))},kKe=m.forwardRef(M_t),I_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},z_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:I_t}))},D_t=m.forwardRef(z_t),E_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},F_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:E_t}))},k_t=m.forwardRef(F_t);const L_t=new xa("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),W_t=(t,e)=>({[`.${t}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${e.motionDurationSlow}`}}}),N_t=(t,e)=>({[`.${t}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:e.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${Nt(e.lineWidthBold)} solid ${e.colorPrimary}`,borderRadius:"50%",content:'""'}}}),U_t=(t,e)=>{const{treeCls:n,treeNodeCls:o,treeNodePadding:r,titleHeight:i,nodeSelectedBg:a,nodeHoverBg:l}=e,s=e.paddingXS;return{[n]:Object.assign(Object.assign({},ja(e)),{background:e.colorBgContainer,borderRadius:e.borderRadius,transition:`background-color ${e.motionDurationSlow}`,[`&${n}-rtl`]:{[`${n}-switcher`]:{"&_close":{[`${n}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${n}-active-focused)`]:Object.assign({},lw(e)),[`${n}-list-holder-inner`]:{alignItems:"flex-start"},[`&${n}-block-node`]:{[`${n}-list-holder-inner`]:{alignItems:"stretch",[`${n}-node-content-wrapper`]:{flex:"auto"},[`${o}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,border:`1px solid ${e.colorPrimary}`,opacity:0,animationName:L_t,animationDuration:e.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${o}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${Nt(r)} 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${n}-node-content-wrapper`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${n}-node-content-wrapper`]:{background:e.controlItemBgHover},[`&:not(${o}-disabled).filter-node ${n}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{cursor:"grab",[`${n}-draggable-icon`]:{flexShrink:0,width:i,lineHeight:`${Nt(i)}`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${e.motionDurationSlow}`,[`${o}:hover &`]:{opacity:.45}},[`&${o}-disabled`]:{[`${n}-draggable-icon`]:{visibility:"hidden"}}}},[`${n}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:i}},[`${n}-draggable-icon`]:{visibility:"hidden"},[`${n}-switcher`]:Object.assign(Object.assign({},W_t(t,e)),{position:"relative",flex:"none",alignSelf:"stretch",width:i,margin:0,lineHeight:`${Nt(i)}`,textAlign:"center",cursor:"pointer",userSelect:"none",transition:`all ${e.motionDurationSlow}`,borderRadius:e.borderRadius,"&-noop":{cursor:"unset"},[`&:not(${n}-switcher-noop):hover`]:{backgroundColor:e.colorBgTextHover},"&_close":{[`${n}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:e.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:e.calc(i).div(2).equal(),bottom:e.calc(r).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:e.calc(e.calc(i).div(2).equal()).mul(.8).equal(),height:e.calc(i).div(2).equal(),borderBottom:`1px solid ${e.colorBorder}`,content:'""'}}}),[`${n}-checkbox`]:{top:"initial",marginInlineEnd:s,alignSelf:"flex-start",marginTop:e.marginXXS},[`${n}-node-content-wrapper, ${n}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:i,margin:0,padding:`0 ${Nt(e.calc(e.paddingXS).div(2).equal())}`,color:"inherit",lineHeight:`${Nt(i)}`,background:"transparent",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:l},[`&${n}-node-selected`]:{backgroundColor:a},[`${n}-iconEle`]:{display:"inline-block",width:i,height:i,lineHeight:`${Nt(i)}`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${n}-unselectable ${n}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${n}-node-content-wrapper`]:Object.assign({lineHeight:`${Nt(i)}`,userSelect:"none"},N_t(t,e)),[`${o}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${e.colorPrimary}`}},"&-show-line":{[`${n}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:e.calc(i).div(2).equal(),bottom:e.calc(r).mul(-1).equal(),borderInlineEnd:`1px solid ${e.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${n}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${o}-leaf-last`]:{[`${n}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${Nt(e.calc(i).div(2).equal())} !important`}}}}})}},j_t=t=>{const{treeCls:e,treeNodeCls:n,treeNodePadding:o,directoryNodeSelectedBg:r,directoryNodeSelectedColor:i}=t;return{[`${e}${e}-directory`]:{[n]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:o,insetInlineStart:0,transition:`background-color ${t.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:t.controlItemBgHover}},"> *":{zIndex:1},[`${e}-switcher`]:{transition:`color ${t.motionDurationMid}`},[`${e}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${e}-node-selected`]:{color:i,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:r},[`${e}-switcher`]:{color:i},[`${e}-node-content-wrapper`]:{color:i,background:"transparent"}}}}}},B_t=(t,e)=>{const n=`.${t}`,o=`${n}-treenode`,r=e.calc(e.paddingXS).div(2).equal(),i=Ki(e,{treeCls:n,treeNodeCls:o,treeNodePadding:r});return[U_t(t,i),j_t(i)]},Y_t=t=>{const{controlHeightSM:e}=t;return{titleHeight:e,nodeHoverBg:t.controlItemBgHover,nodeSelectedBg:t.controlItemBgActive}},O_t=t=>{const{colorTextLightSolid:e,colorPrimary:n}=t;return Object.assign(Object.assign({},Y_t(t)),{directoryNodeSelectedColor:e,directoryNodeSelectedBg:n})},__t=wl("Tree",(t,e)=>{let{prefixCls:n}=e;return[{[t.componentCls]:pJe(`${n}-checkbox`,t)},B_t(n,t),Hme(t)]},O_t),ube=4;function V_t(t){const{dropPosition:e,dropLevelOffset:n,prefixCls:o,indent:r,direction:i="ltr"}=t,a=i==="ltr"?"left":"right",l=i==="ltr"?"right":"left",s={[a]:-n*r+ube,[l]:0};switch(e){case-1:s.top=-3;break;case 1:s.bottom=-3;break;default:s.bottom=-3,s[a]=r+ube;break}return be.createElement("div",{style:s,className:`${o}-drop-indicator`})}var G_t={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},X_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:G_t}))},J_t=m.forwardRef(X_t),K_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},q_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:K_t}))},$_t=m.forwardRef(q_t),Q_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},Z_t=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Q_t}))},eVt=m.forwardRef(Z_t);const tVt=t=>{const{prefixCls:e,switcherIcon:n,treeNodeProps:o,showLine:r}=t,{isLeaf:i,expanded:a,loading:l}=o;if(l)return m.createElement(UH,{className:`${e}-switcher-loading-icon`});let s;if(r&&typeof r=="object"&&(s=r.showLeafIcon),i){if(!r)return null;if(typeof s!="boolean"&&s){const d=typeof s=="function"?s(o):s,f=`${e}-switcher-line-custom-icon`;return m.isValidElement(d)?B0(d,{className:Un(d.props.className||"",f)}):d}return s?m.createElement(FKe,{className:`${e}-switcher-line-icon`}):m.createElement("span",{className:`${e}-switcher-leaf-line`})}const c=`${e}-switcher-icon`,u=typeof n=="function"?n(o):n;return m.isValidElement(u)?B0(u,{className:Un(u.props.className||"",c)}):u!==void 0?u:r?a?m.createElement($_t,{className:`${e}-switcher-line-icon`}):m.createElement(eVt,{className:`${e}-switcher-line-icon`}):m.createElement(J_t,{className:c})},LKe=be.forwardRef((t,e)=>{var n;const{getPrefixCls:o,direction:r,virtual:i,tree:a}=be.useContext(Cr),{prefixCls:l,className:s,showIcon:c=!1,showLine:u,switcherIcon:d,blockNode:f=!1,children:p,checkable:g=!1,selectable:y=!0,draggable:w,motion:b,style:C}=t,P=o("tree",l),v=o(),T=b??Object.assign(Object.assign({},bme(v)),{motionAppear:!1}),A=Object.assign(Object.assign({},t),{checkable:g,selectable:y,showIcon:c,motion:T,blockNode:f,showLine:!!u,dropIndicatorRender:V_t}),[x,S,R]=__t(P),[,M]=_u(),D=M.paddingXS/2+(((n=M.Tree)===null||n===void 0?void 0:n.titleHeight)||M.controlHeightSM),E=be.useMemo(()=>{if(!w)return!1;let j={};switch(typeof w){case"function":j.nodeDraggable=w;break;case"object":j=Object.assign({},w);break}return j.icon!==!1&&(j.icon=j.icon||be.createElement(k_t,null)),j},[w]),W=j=>be.createElement(tVt,{prefixCls:P,switcherIcon:d,treeNodeProps:j,showLine:u});return x(be.createElement(xye,Object.assign({itemHeight:D,ref:e,virtual:i},A,{style:Object.assign(Object.assign({},a==null?void 0:a.style),C),prefixCls:P,className:Un({[`${P}-icon-hide`]:!c,[`${P}-block-node`]:f,[`${P}-unselectable`]:!y,[`${P}-rtl`]:r==="rtl"},a==null?void 0:a.className,s,S,R),direction:r,checkable:g&&be.createElement("span",{className:`${P}-checkbox-inner`}),selectable:y,switcherIcon:W,draggable:E}),p))}),dbe=0,Aie=1,fbe=2;function bye(t,e,n){const{key:o,children:r}=n;function i(a){const l=a[o],s=a[r];e(l,a)!==!1&&bye(s||[],e,n)}t.forEach(i)}function nVt(t){let{treeData:e,expandedKeys:n,startKey:o,endKey:r,fieldNames:i}=t;const a=[];let l=dbe;if(o&&o===r)return[o];if(!o||!r)return[];function s(c){return c===o||c===r}return bye(e,c=>{if(l===fbe)return!1;if(s(c)){if(a.push(c),l===dbe)l=Aie;else if(l===Aie)return l=fbe,!1}else l===Aie&&a.push(c);return n.includes(c)},vR(i)),a}function wie(t,e,n){const o=Za(e),r=[];return bye(t,(i,a)=>{const l=o.indexOf(i);return l!==-1&&(r.push(a),o.splice(l,1)),!!o.length},vR(n)),r}var hbe=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var{defaultExpandAll:n,defaultExpandParent:o,defaultExpandedKeys:r}=t,i=hbe(t,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const a=m.useRef(),l=m.useRef(),s=()=>{const{keyEntities:S}=wye(pbe(i));let R;return n?R=Object.keys(S):o?R=Tue(i.expandedKeys||r||[],S):R=i.expandedKeys||r||[],R},[c,u]=m.useState(i.selectedKeys||i.defaultSelectedKeys||[]),[d,f]=m.useState(()=>s());m.useEffect(()=>{"selectedKeys"in i&&u(i.selectedKeys)},[i.selectedKeys]),m.useEffect(()=>{"expandedKeys"in i&&f(i.expandedKeys)},[i.expandedKeys]);const p=(S,R)=>{var M;return"expandedKeys"in i||f(S),(M=i.onExpand)===null||M===void 0?void 0:M.call(i,S,R)},g=(S,R)=>{var M;const{multiple:D,fieldNames:E}=i,{node:W,nativeEvent:j}=R,{key:L=""}=W,k=pbe(i),N=Object.assign(Object.assign({},R),{selected:!0}),F=(j==null?void 0:j.ctrlKey)||(j==null?void 0:j.metaKey),U=j==null?void 0:j.shiftKey;let O;D&&F?(O=S,a.current=L,l.current=O,N.selectedNodes=wie(k,O,E)):D&&U?(O=Array.from(new Set([].concat(Za(l.current||[]),Za(nVt({treeData:k,expandedKeys:d,startKey:L,endKey:a.current,fieldNames:E}))))),N.selectedNodes=wie(k,O,E)):(O=[L],a.current=L,l.current=O,N.selectedNodes=wie(k,O,E)),(M=i.onSelect)===null||M===void 0||M.call(i,O,N),"selectedKeys"in i||u(O)},{getPrefixCls:y,direction:w}=m.useContext(Cr),{prefixCls:b,className:C,showIcon:P=!0,expandAction:v="click"}=i,T=hbe(i,["prefixCls","className","showIcon","expandAction"]),A=y("tree",b),x=Un(`${A}-directory`,{[`${A}-directory-rtl`]:w==="rtl"},C);return m.createElement(LKe,Object.assign({icon:oVt,ref:e,blockNode:!0},T,{showIcon:P,expandAction:v,prefixCls:A,className:x,expandedKeys:d,selectedKeys:c,onSelect:g,onExpand:p}))},iVt=m.forwardRef(rVt),Sye=LKe;Sye.DirectoryTree=iVt;Sye.TreeNode=xR;function gbe(t){let{value:e,onChange:n,filterSearch:o,tablePrefixCls:r,locale:i}=t;return o?m.createElement("div",{className:`${r}-filter-dropdown-search`},m.createElement(as,{prefix:m.createElement(kme,null),placeholder:i.filterSearchPlaceholder,onChange:n,value:e,htmlSize:1,className:`${r}-filter-dropdown-search-input`})):null}const aVt=t=>{const{keyCode:e}=t;e===fi.ENTER&&t.stopPropagation()},lVt=m.forwardRef((t,e)=>m.createElement("div",{className:t.className,onClick:n=>n.stopPropagation(),onKeyDown:aVt,ref:e},t.children));function IC(t){let e=[];return(t||[]).forEach(n=>{let{value:o,children:r}=n;e.push(o),r&&(e=[].concat(Za(e),Za(IC(r))))}),e}function sVt(t){return t.some(e=>{let{children:n}=e;return n})}function WKe(t,e){return typeof e=="string"||typeof e=="number"?e==null?void 0:e.toString().toLowerCase().includes(t.trim().toLowerCase()):!1}function NKe(t){let{filters:e,prefixCls:n,filteredKeys:o,filterMultiple:r,searchValue:i,filterSearch:a}=t;return e.map((l,s)=>{const c=String(l.value);if(l.children)return{key:c||s,label:l.text,popupClassName:`${n}-dropdown-submenu`,children:NKe({filters:l.children,prefixCls:n,filteredKeys:o,filterMultiple:r,searchValue:i,filterSearch:a})};const u=r?Li:Ue,d={key:l.value!==void 0?c:s,label:m.createElement(m.Fragment,null,m.createElement(u,{checked:o.includes(c)}),m.createElement("span",null,l.text))};return i.trim()?typeof a=="function"?a(i,l)?d:null:WKe(i,l.text)?d:null:d})}function vie(t){return t||[]}function cVt(t){var e,n;const{tablePrefixCls:o,prefixCls:r,column:i,dropdownPrefixCls:a,columnKey:l,filterOnClose:s,filterMultiple:c,filterMode:u="menu",filterSearch:d=!1,filterState:f,triggerFilter:p,locale:g,children:y,getPopupContainer:w,rootClassName:b}=t,{filterDropdownOpen:C,onFilterDropdownOpenChange:P,filterResetToDefaultFilteredValue:v,defaultFilteredValue:T,filterDropdownVisible:A,onFilterDropdownVisibleChange:x}=i,[S,R]=m.useState(!1),M=!!(f&&(!((e=f.filteredKeys)===null||e===void 0)&&e.length||f.forceFiltered)),D=he=>{R(he),P==null||P(he),x==null||x(he)},E=(n=C??A)!==null&&n!==void 0?n:S,W=f==null?void 0:f.filteredKeys,[j,L]=f_t(vie(W)),k=he=>{let{selectedKeys:xe}=he;L(xe)},N=(he,xe)=>{let{node:He,checked:Se}=xe;k(c?{selectedKeys:he}:{selectedKeys:Se&&He.key?[He.key]:[]})};m.useEffect(()=>{S&&k({selectedKeys:vie(W)})},[W]);const[F,U]=m.useState([]),O=he=>{U(he)},[B,_]=m.useState(""),X=he=>{const{value:xe}=he.target;_(xe)};m.useEffect(()=>{S||_("")},[S]);const $=he=>{const xe=he&&he.length?he:null;if(xe===null&&(!f||!f.filteredKeys)||m0e(xe,f==null?void 0:f.filteredKeys,!0))return null;p({column:i,key:l,filteredKeys:xe})},Q=()=>{D(!1),$(j())},le=function(){let{confirm:he,closeDropdown:xe}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{confirm:!1,closeDropdown:!1};he&&$([]),xe&&D(!1),_(""),L(v?(T||[]).map(He=>String(He)):[])},q=function(){let{closeDropdown:he}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{closeDropdown:!0};he&&D(!1),$(j())},te=(he,xe)=>{xe.source==="trigger"&&(he&&W!==void 0&&L(vie(W)),D(he),!he&&!i.filterDropdown&&s&&Q())},re=Un({[`${a}-menu-without-submenu`]:!sVt(i.filters||[])}),ae=he=>{if(he.target.checked){const xe=IC(i==null?void 0:i.filters).map(He=>String(He));L(xe)}else L([])},se=he=>{let{filters:xe}=he;return(xe||[]).map((He,Se)=>{const ze=String(He.value),Ie={title:He.text,key:He.value!==void 0?ze:String(Se)};return He.children&&(Ie.children=se({filters:He.children})),Ie})},ne=he=>{var xe;return Object.assign(Object.assign({},he),{text:he.title,value:he.key,children:((xe=he.children)===null||xe===void 0?void 0:xe.map(He=>ne(He)))||[]})};let fe;if(typeof i.filterDropdown=="function")fe=i.filterDropdown({prefixCls:`${a}-custom`,setSelectedKeys:he=>k({selectedKeys:he}),selectedKeys:j(),confirm:q,clearFilters:le,filters:i.filters,visible:E,close:()=>{D(!1)}});else if(i.filterDropdown)fe=i.filterDropdown;else{const he=j()||[],xe=()=>{const Se=m.createElement(fg,{image:fg.PRESENTED_IMAGE_SIMPLE,description:g.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}});if((i.filters||[]).length===0)return Se;if(u==="tree")return m.createElement(m.Fragment,null,m.createElement(gbe,{filterSearch:d,value:B,onChange:X,tablePrefixCls:o,locale:g}),m.createElement("div",{className:`${o}-filter-dropdown-tree`},c?m.createElement(Li,{checked:he.length===IC(i.filters).length,indeterminate:he.length>0&&he.lengthtypeof d=="function"?d(B,ne(ye)):WKe(B,ye.title):void 0})));const ze=NKe({filters:i.filters||[],filterSearch:d,prefixCls:r,filteredKeys:j(),filterMultiple:c,searchValue:B}),Ie=ze.every(ye=>ye===null);return m.createElement(m.Fragment,null,m.createElement(gbe,{filterSearch:d,value:B,onChange:X,tablePrefixCls:o,locale:g}),Ie?Se:m.createElement(_H,{selectable:!0,multiple:c,prefixCls:`${a}-menu`,className:re,onSelect:k,onDeselect:k,selectedKeys:he,getPopupContainer:w,openKeys:F,onOpenChange:O,items:ze}))},He=()=>v?m0e((T||[]).map(Se=>String(Se)),he,!0):he.length===0;fe=m.createElement(m.Fragment,null,xe(),m.createElement("div",{className:`${r}-dropdown-btns`},m.createElement(lo,{type:"link",size:"small",disabled:He(),onClick:()=>le()},g.filterReset),m.createElement(lo,{type:"primary",size:"small",onClick:Q},g.filterConfirm)))}i.filterDropdown&&(fe=m.createElement(gXe,{selectable:void 0},fe));const ge=()=>m.createElement(lVt,{className:`${r}-dropdown`},fe);let de;typeof i.filterIcon=="function"?de=i.filterIcon(M):i.filterIcon?de=i.filterIcon:de=m.createElement(d_t,null);const{direction:Z}=m.useContext(Cr);return m.createElement("div",{className:`${r}-column`},m.createElement("span",{className:`${o}-column-title`},y),m.createElement(jw,{dropdownRender:ge,trigger:["click"],open:E,onOpenChange:te,getPopupContainer:w,placement:Z==="rtl"?"bottomLeft":"bottomRight",rootClassName:b},m.createElement("span",{role:"button",tabIndex:-1,className:Un(`${r}-trigger`,{active:M}),onClick:he=>{he.stopPropagation()}},de)))}function Mue(t,e,n){let o=[];return(t||[]).forEach((r,i)=>{var a;const l=tN(i,n);if(r.filters||"filterDropdown"in r||"onFilter"in r)if("filteredValue"in r){let s=r.filteredValue;"filterDropdown"in r||(s=(a=s==null?void 0:s.map(String))!==null&&a!==void 0?a:s),o.push({column:r,key:Kx(r,l),filteredKeys:s,forceFiltered:r.filtered})}else o.push({column:r,key:Kx(r,l),filteredKeys:e&&r.defaultFilteredValue?r.defaultFilteredValue:void 0,forceFiltered:r.filtered});"children"in r&&(o=[].concat(Za(o),Za(Mue(r.children,e,l))))}),o}function UKe(t,e,n,o,r,i,a,l,s){return n.map((c,u)=>{const d=tN(u,l),{filterOnClose:f=!0,filterMultiple:p=!0,filterMode:g,filterSearch:y}=c;let w=c;if(w.filters||w.filterDropdown){const b=Kx(w,d),C=o.find(P=>{let{key:v}=P;return b===v});w=Object.assign(Object.assign({},w),{title:P=>m.createElement(cVt,{tablePrefixCls:t,prefixCls:`${t}-filter`,dropdownPrefixCls:e,column:w,columnKey:b,filterState:C,filterOnClose:f,filterMultiple:p,filterMode:g,filterSearch:y,triggerFilter:i,locale:r,getPopupContainer:a,rootClassName:s},pQ(c.title,P))})}return"children"in w&&(w=Object.assign(Object.assign({},w),{children:UKe(t,e,w.children,o,r,i,a,d,s)})),w})}function mbe(t){const e={};return t.forEach(n=>{let{key:o,filteredKeys:r,column:i}=n;const a=o,{filters:l,filterDropdown:s}=i;if(s)e[a]=r||null;else if(Array.isArray(r)){const c=IC(l);e[a]=c.filter(u=>r.includes(String(u)))}else e[a]=null}),e}function Iue(t,e,n){return e.reduce((o,r)=>{const{column:{onFilter:i,filters:a},filteredKeys:l}=r;return i&&l&&l.length?o.map(s=>Object.assign({},s)).filter(s=>l.some(c=>{const u=IC(a),d=u.findIndex(p=>String(p)===String(c)),f=d!==-1?u[d]:c;return s[n]&&(s[n]=Iue(s[n],e,n)),i(f,s)})):o},t)}const jKe=t=>t.flatMap(e=>"children"in e?[e].concat(Za(jKe(e.children||[]))):[e]);function uVt(t){let{prefixCls:e,dropdownPrefixCls:n,mergedColumns:o,onFilterChange:r,getPopupContainer:i,locale:a,rootClassName:l}=t;kb();const s=m.useMemo(()=>jKe(o||[]),[o]),[c,u]=m.useState(()=>Mue(s,!0)),d=m.useMemo(()=>{const y=Mue(s,!1);if(y.length===0)return y;let w=!0;if(y.forEach(b=>{let{filteredKeys:C}=b;C!==void 0&&(w=!1)}),w){const b=(s||[]).map((C,P)=>Kx(C,tN(P)));return c.filter(C=>{let{key:P}=C;return b.includes(P)}).map(C=>{const P=s[b.findIndex(v=>v===C.key)];return Object.assign(Object.assign({},C),{column:Object.assign(Object.assign({},C.column),P),forceFiltered:P.filtered})})}return y},[s,c]),f=m.useMemo(()=>mbe(d),[d]),p=y=>{const w=d.filter(b=>{let{key:C}=b;return C!==y.key});w.push(y),u(w),r(mbe(w),w)};return[y=>UKe(e,n,y,d,a,p,i,void 0,l),d,f]}function dVt(t,e,n){const o=m.useRef({});function r(i){if(!o.current||o.current.data!==t||o.current.childrenColumnName!==e||o.current.getRowKey!==n){let s=function(c){c.forEach((u,d)=>{const f=n(u,d);l.set(f,u),u&&typeof u=="object"&&e in u&&s(u[e]||[])})};var a=s;const l=new Map;s(t),o.current={data:t,childrenColumnName:e,kvMap:l,getRowKey:n}}return o.current.kvMap.get(i)}return[r]}var fVt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const i=t[r];typeof i!="function"&&(n[r]=i)}),n}function pVt(t,e,n){const o=n&&typeof n=="object"?n:{},{total:r=0}=o,i=fVt(o,["total"]),[a,l]=m.useState(()=>({current:"defaultCurrent"in i?i.defaultCurrent:1,pageSize:"defaultPageSize"in i?i.defaultPageSize:BKe})),s=OJe(a,i,{total:r>0?r:t}),c=Math.ceil((r||t)/s.pageSize);s.current>c&&(s.current=c||1);const u=(f,p)=>{l({current:f??1,pageSize:p||s.pageSize})},d=(f,p)=>{var g;n&&((g=n.onChange)===null||g===void 0||g.call(n,f,p)),u(f,p),e(f,p||(s==null?void 0:s.pageSize))};return n===!1?[{},()=>{}]:[Object.assign(Object.assign({},s),{onChange:d}),u]}var gVt={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},mVt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:gVt}))},YKe=m.forwardRef(mVt),yVt={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},AVt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:yVt}))},wVt=m.forwardRef(AVt);const Q_="ascend",xie="descend";function KG(t){return typeof t.sorter=="object"&&typeof t.sorter.multiple=="number"?t.sorter.multiple:!1}function ybe(t){return typeof t=="function"?t:t&&typeof t=="object"&&t.compare?t.compare:!1}function vVt(t,e){return e?t[t.indexOf(e)+1]:t[0]}function zue(t,e,n){let o=[];function r(i,a){o.push({column:i,key:Kx(i,a),multiplePriority:KG(i),sortOrder:i.sortOrder})}return(t||[]).forEach((i,a)=>{const l=tN(a,n);i.children?("sortOrder"in i&&r(i,l),o=[].concat(Za(o),Za(zue(i.children,e,l)))):i.sorter&&("sortOrder"in i?r(i,l):e&&i.defaultSortOrder&&o.push({column:i,key:Kx(i,l),multiplePriority:KG(i),sortOrder:i.defaultSortOrder}))}),o}function OKe(t,e,n,o,r,i,a,l){return(e||[]).map((s,c)=>{const u=tN(c,l);let d=s;if(d.sorter){const f=d.sortDirections||r,p=d.showSorterTooltip===void 0?a:d.showSorterTooltip,g=Kx(d,u),y=n.find(S=>{let{key:R}=S;return R===g}),w=y?y.sortOrder:null,b=vVt(f,w);let C;if(s.sortIcon)C=s.sortIcon({sortOrder:w});else{const S=f.includes(Q_)&&m.createElement(wVt,{className:Un(`${t}-column-sorter-up`,{active:w===Q_})}),R=f.includes(xie)&&m.createElement(YKe,{className:Un(`${t}-column-sorter-down`,{active:w===xie})});C=m.createElement("span",{className:Un(`${t}-column-sorter`,{[`${t}-column-sorter-full`]:!!(S&&R)})},m.createElement("span",{className:`${t}-column-sorter-inner`,"aria-hidden":"true"},S,R))}const{cancelSort:P,triggerAsc:v,triggerDesc:T}=i||{};let A=P;b===xie?A=T:b===Q_&&(A=v);const x=typeof p=="object"?Object.assign({title:A},p):{title:A};d=Object.assign(Object.assign({},d),{className:Un(d.className,{[`${t}-column-sort`]:w}),title:S=>{const R=`${t}-column-sorters`,M=m.createElement("span",{className:`${t}-column-title`},pQ(s.title,S)),D=m.createElement("div",{className:R},M,C);return p?typeof p!="boolean"&&(p==null?void 0:p.target)==="sorter-icon"?m.createElement("div",{className:`${R} ${t}-column-sorters-tooltip-target-sorter`},M,m.createElement(tA,Object.assign({},x),C)):m.createElement(tA,Object.assign({},x),D):D},onHeaderCell:S=>{const R=s.onHeaderCell&&s.onHeaderCell(S)||{},M=R.onClick,D=R.onKeyDown;R.onClick=j=>{o({column:s,key:g,sortOrder:b,multiplePriority:KG(s)}),M==null||M(j)},R.onKeyDown=j=>{j.keyCode===fi.ENTER&&(o({column:s,key:g,sortOrder:b,multiplePriority:KG(s)}),D==null||D(j))};const E=s_t(s.title,{}),W=E==null?void 0:E.toString();return w?R["aria-sort"]=w==="ascend"?"ascending":"descending":R["aria-label"]=W||"",R.className=Un(R.className,`${t}-column-has-sorters`),R.tabIndex=0,s.ellipsis&&(R.title=(E??"").toString()),R}})}return"children"in d&&(d=Object.assign(Object.assign({},d),{children:OKe(t,d.children,n,o,r,i,a,u)})),d})}const Abe=t=>{const{column:e,sortOrder:n}=t;return{column:e,order:n,field:e.dataIndex,columnKey:e.key}},wbe=t=>{const e=t.filter(n=>{let{sortOrder:o}=n;return o}).map(Abe);if(e.length===0&&t.length){const n=t.length-1;return Object.assign(Object.assign({},Abe(t[n])),{column:void 0})}return e.length<=1?e[0]||{}:e};function Due(t,e,n){const o=e.slice().sort((a,l)=>l.multiplePriority-a.multiplePriority),r=t.slice(),i=o.filter(a=>{let{column:{sorter:l},sortOrder:s}=a;return ybe(l)&&s});return i.length?r.sort((a,l)=>{for(let s=0;s{const l=a[n];return l?Object.assign(Object.assign({},a),{[n]:Due(l,e,n)}):a}):r}function xVt(t){let{prefixCls:e,mergedColumns:n,onSorterChange:o,sortDirections:r,tableLocale:i,showSorterTooltip:a}=t;const[l,s]=m.useState(zue(n,!0)),c=m.useMemo(()=>{let g=!0;const y=zue(n,!1);if(!y.length)return l;const w=[];function b(P){g?w.push(P):w.push(Object.assign(Object.assign({},P),{sortOrder:null}))}let C=null;return y.forEach(P=>{C===null?(b(P),P.sortOrder&&(P.multiplePriority===!1?g=!1:C=!0)):(C&&P.multiplePriority!==!1||(g=!1),b(P))}),w},[n,l]),u=m.useMemo(()=>{const g=c.map(y=>{let{column:w,sortOrder:b}=y;return{column:w,order:b}});return{sortColumns:g,sortColumn:g[0]&&g[0].column,sortOrder:g[0]&&g[0].order}},[c]),d=g=>{let y;g.multiplePriority===!1||!c.length||c[0].multiplePriority===!1?y=[g]:y=[].concat(Za(c.filter(w=>{let{key:b}=w;return b!==g.key})),[g]),s(y),o(wbe(y),y)};return[g=>OKe(e,g,c,d,r,i,a),c,u,()=>wbe(c)]}function _Ke(t,e){return t.map(n=>{const o=Object.assign({},n);return o.title=pQ(n.title,e),"children"in o&&(o.children=_Ke(o.children,e)),o})}function bVt(t){return[m.useCallback(n=>_Ke(n,t),[t])]}const SVt=pKe((t,e)=>{const{_renderTimes:n}=t,{_renderTimes:o}=e;return n!==o}),TVt=mKe((t,e)=>{const{_renderTimes:n}=t,{_renderTimes:o}=e;return n!==o}),PVt=t=>{const{componentCls:e,lineWidth:n,lineType:o,tableBorderColor:r,tableHeaderBg:i,tablePaddingVertical:a,tablePaddingHorizontal:l,calc:s}=t,c=`${Nt(n)} ${o} ${r}`,u=(d,f,p)=>({[`&${e}-${d}`]:{[`> ${e}-container`]:{[`> ${e}-content, > ${e}-body`]:{"\n > table > tbody > tr > th,\n > table > tbody > tr > td\n ":{[`> ${e}-expanded-row-fixed`]:{margin:`${Nt(s(f).mul(-1).equal())} ${Nt(s(s(p).add(n)).mul(-1).equal())}`}}}}}});return{[`${e}-wrapper`]:{[`${e}${e}-bordered`]:Object.assign(Object.assign(Object.assign({[`> ${e}-title`]:{border:c,borderBottom:0},[`> ${e}-container`]:{borderInlineStart:c,borderTop:c,[` > ${e}-content, > ${e}-header, @@ -4690,7 +4690,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `]:{"> th, > td":{borderInlineEnd:0}}}}}},u("middle",t.tablePaddingVerticalMiddle,t.tablePaddingHorizontalMiddle)),u("small",t.tablePaddingVerticalSmall,t.tablePaddingHorizontalSmall)),{[`> ${e}-footer`]:{border:c,borderTop:0}}),[`${e}-cell`]:{[`${e}-container:first-child`]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:`0 ${Nt(n)} 0 ${Nt(n)} ${i}`}},[`${e}-bordered ${e}-cell-scrollbar`]:{borderInlineEnd:c}}}},CVt=t=>{const{componentCls:e}=t;return{[`${e}-wrapper`]:{[`${e}-cell-ellipsis`]:Object.assign(Object.assign({},Gx),{wordBreak:"keep-all",[` &${e}-cell-fix-left-last, &${e}-cell-fix-right-first - `]:{overflow:"visible",[`${e}-cell-content`]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},[`${e}-column-title`]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},RVt=t=>{const{componentCls:e}=t;return{[`${e}-wrapper`]:{[`${e}-tbody > tr${e}-placeholder`]:{textAlign:"center",color:t.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:t.colorBgContainer}}}}},HVt=t=>{const{componentCls:e,antCls:n,motionDurationSlow:o,lineWidth:r,paddingXS:i,lineType:a,tableBorderColor:l,tableExpandIconBg:s,tableExpandColumnWidth:c,borderRadius:u,tablePaddingVertical:d,tablePaddingHorizontal:f,tableExpandedRowBg:p,paddingXXS:g,expandIconMarginTop:y,expandIconSize:w,expandIconHalfInner:b,expandIconScale:C,calc:P}=t,v=`${Nt(r)} ${a} ${l}`,T=P(g).sub(r).equal();return{[`${e}-wrapper`]:{[`${e}-expand-icon-col`]:{width:c},[`${e}-row-expand-icon-cell`]:{textAlign:"center",[`${e}-row-expand-icon`]:{display:"inline-flex",float:"none",verticalAlign:"sub"}},[`${e}-row-indent`]:{height:1,float:"left"},[`${e}-row-expand-icon`]:Object.assign(Object.assign({},fme(t)),{position:"relative",float:"left",boxSizing:"border-box",width:w,height:w,padding:0,color:"inherit",lineHeight:Nt(w),background:s,border:v,borderRadius:u,transform:`scale(${C})`,transition:`all ${o}`,userSelect:"none","&:focus, &:hover, &:active":{borderColor:"currentcolor"},"&::before, &::after":{position:"absolute",background:"currentcolor",transition:`transform ${o} ease-out`,content:'""'},"&::before":{top:b,insetInlineEnd:T,insetInlineStart:T,height:r},"&::after":{top:T,bottom:T,insetInlineStart:b,width:r,transform:"rotate(90deg)"},"&-collapsed::before":{transform:"rotate(-180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"},"&-spaced":{"&::before, &::after":{display:"none",content:"none"},background:"transparent",border:0,visibility:"hidden"}}),[`${e}-row-indent + ${e}-row-expand-icon`]:{marginTop:y,marginInlineEnd:i},[`tr${e}-expanded-row`]:{"&, &:hover":{"> th, > td":{background:p}},[`${n}-descriptions-view`]:{display:"flex",table:{flex:"auto",width:"auto"}}},[`${e}-expanded-row-fixed`]:{position:"relative",margin:`${Nt(P(d).mul(-1).equal())} ${Nt(P(f).mul(-1).equal())}`,padding:`${Nt(d)} ${Nt(f)}`}}}},MVt=t=>{const{componentCls:e,antCls:n,iconCls:o,tableFilterDropdownWidth:r,tableFilterDropdownSearchWidth:i,paddingXXS:a,paddingXS:l,colorText:s,lineWidth:c,lineType:u,tableBorderColor:d,headerIconColor:f,fontSizeSM:p,tablePaddingHorizontal:g,borderRadius:y,motionDurationSlow:w,colorTextDescription:b,colorPrimary:C,tableHeaderFilterActiveBg:P,colorTextDisabled:v,tableFilterDropdownBg:T,tableFilterDropdownHeight:A,controlItemBgHover:x,controlItemBgActive:S,boxShadowSecondary:R,filterDropdownMenuBg:M,calc:D}=t,E=`${n}-dropdown`,W=`${e}-filter-dropdown`,j=`${n}-tree`,L=`${Nt(c)} ${u} ${d}`;return[{[`${e}-wrapper`]:{[`${e}-filter-column`]:{display:"flex",justifyContent:"space-between"},[`${e}-filter-trigger`]:{position:"relative",display:"flex",alignItems:"center",marginBlock:D(a).mul(-1).equal(),marginInline:`${Nt(a)} ${Nt(D(g).div(2).mul(-1).equal())}`,padding:`0 ${Nt(a)}`,color:f,fontSize:p,borderRadius:y,cursor:"pointer",transition:`all ${w}`,"&:hover":{color:b,background:P},"&.active":{color:C}}}},{[`${n}-dropdown`]:{[W]:Object.assign(Object.assign({},ja(t)),{minWidth:r,backgroundColor:T,borderRadius:y,boxShadow:R,overflow:"hidden",[`${E}-menu`]:{maxHeight:A,overflowX:"hidden",border:0,boxShadow:"none",borderRadius:"unset",backgroundColor:M,"&:empty::after":{display:"block",padding:`${Nt(l)} 0`,color:v,fontSize:p,textAlign:"center",content:'"Not Found"'}},[`${W}-tree`]:{paddingBlock:`${Nt(l)} 0`,paddingInline:l,[j]:{padding:0},[`${j}-treenode ${j}-node-content-wrapper:hover`]:{backgroundColor:x},[`${j}-treenode-checkbox-checked ${j}-node-content-wrapper`]:{"&, &:hover":{backgroundColor:S}}},[`${W}-search`]:{padding:l,borderBottom:L,"&-input":{input:{minWidth:i},[o]:{color:v}}},[`${W}-checkall`]:{width:"100%",marginBottom:a,marginInlineStart:a},[`${W}-btns`]:{display:"flex",justifyContent:"space-between",padding:`${Nt(D(l).sub(c).equal())} ${Nt(l)}`,overflow:"hidden",borderTop:L}})}},{[`${n}-dropdown ${W}, ${W}-submenu`]:{[`${n}-checkbox-wrapper + span`]:{paddingInlineStart:l,color:s},"> ul":{maxHeight:"calc(100vh - 130px)",overflowX:"hidden",overflowY:"auto"}}}]},IVt=t=>{const{componentCls:e,lineWidth:n,colorSplit:o,motionDurationSlow:r,zIndexTableFixed:i,tableBg:a,zIndexTableSticky:l,calc:s}=t,c=o;return{[`${e}-wrapper`]:{[` + `]:{overflow:"visible",[`${e}-cell-content`]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},[`${e}-column-title`]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},RVt=t=>{const{componentCls:e}=t;return{[`${e}-wrapper`]:{[`${e}-tbody > tr${e}-placeholder`]:{textAlign:"center",color:t.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:t.colorBgContainer}}}}},HVt=t=>{const{componentCls:e,antCls:n,motionDurationSlow:o,lineWidth:r,paddingXS:i,lineType:a,tableBorderColor:l,tableExpandIconBg:s,tableExpandColumnWidth:c,borderRadius:u,tablePaddingVertical:d,tablePaddingHorizontal:f,tableExpandedRowBg:p,paddingXXS:g,expandIconMarginTop:y,expandIconSize:w,expandIconHalfInner:b,expandIconScale:C,calc:P}=t,v=`${Nt(r)} ${a} ${l}`,T=P(g).sub(r).equal();return{[`${e}-wrapper`]:{[`${e}-expand-icon-col`]:{width:c},[`${e}-row-expand-icon-cell`]:{textAlign:"center",[`${e}-row-expand-icon`]:{display:"inline-flex",float:"none",verticalAlign:"sub"}},[`${e}-row-indent`]:{height:1,float:"left"},[`${e}-row-expand-icon`]:Object.assign(Object.assign({},hme(t)),{position:"relative",float:"left",boxSizing:"border-box",width:w,height:w,padding:0,color:"inherit",lineHeight:Nt(w),background:s,border:v,borderRadius:u,transform:`scale(${C})`,transition:`all ${o}`,userSelect:"none","&:focus, &:hover, &:active":{borderColor:"currentcolor"},"&::before, &::after":{position:"absolute",background:"currentcolor",transition:`transform ${o} ease-out`,content:'""'},"&::before":{top:b,insetInlineEnd:T,insetInlineStart:T,height:r},"&::after":{top:T,bottom:T,insetInlineStart:b,width:r,transform:"rotate(90deg)"},"&-collapsed::before":{transform:"rotate(-180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"},"&-spaced":{"&::before, &::after":{display:"none",content:"none"},background:"transparent",border:0,visibility:"hidden"}}),[`${e}-row-indent + ${e}-row-expand-icon`]:{marginTop:y,marginInlineEnd:i},[`tr${e}-expanded-row`]:{"&, &:hover":{"> th, > td":{background:p}},[`${n}-descriptions-view`]:{display:"flex",table:{flex:"auto",width:"auto"}}},[`${e}-expanded-row-fixed`]:{position:"relative",margin:`${Nt(P(d).mul(-1).equal())} ${Nt(P(f).mul(-1).equal())}`,padding:`${Nt(d)} ${Nt(f)}`}}}},MVt=t=>{const{componentCls:e,antCls:n,iconCls:o,tableFilterDropdownWidth:r,tableFilterDropdownSearchWidth:i,paddingXXS:a,paddingXS:l,colorText:s,lineWidth:c,lineType:u,tableBorderColor:d,headerIconColor:f,fontSizeSM:p,tablePaddingHorizontal:g,borderRadius:y,motionDurationSlow:w,colorTextDescription:b,colorPrimary:C,tableHeaderFilterActiveBg:P,colorTextDisabled:v,tableFilterDropdownBg:T,tableFilterDropdownHeight:A,controlItemBgHover:x,controlItemBgActive:S,boxShadowSecondary:R,filterDropdownMenuBg:M,calc:D}=t,E=`${n}-dropdown`,W=`${e}-filter-dropdown`,j=`${n}-tree`,L=`${Nt(c)} ${u} ${d}`;return[{[`${e}-wrapper`]:{[`${e}-filter-column`]:{display:"flex",justifyContent:"space-between"},[`${e}-filter-trigger`]:{position:"relative",display:"flex",alignItems:"center",marginBlock:D(a).mul(-1).equal(),marginInline:`${Nt(a)} ${Nt(D(g).div(2).mul(-1).equal())}`,padding:`0 ${Nt(a)}`,color:f,fontSize:p,borderRadius:y,cursor:"pointer",transition:`all ${w}`,"&:hover":{color:b,background:P},"&.active":{color:C}}}},{[`${n}-dropdown`]:{[W]:Object.assign(Object.assign({},ja(t)),{minWidth:r,backgroundColor:T,borderRadius:y,boxShadow:R,overflow:"hidden",[`${E}-menu`]:{maxHeight:A,overflowX:"hidden",border:0,boxShadow:"none",borderRadius:"unset",backgroundColor:M,"&:empty::after":{display:"block",padding:`${Nt(l)} 0`,color:v,fontSize:p,textAlign:"center",content:'"Not Found"'}},[`${W}-tree`]:{paddingBlock:`${Nt(l)} 0`,paddingInline:l,[j]:{padding:0},[`${j}-treenode ${j}-node-content-wrapper:hover`]:{backgroundColor:x},[`${j}-treenode-checkbox-checked ${j}-node-content-wrapper`]:{"&, &:hover":{backgroundColor:S}}},[`${W}-search`]:{padding:l,borderBottom:L,"&-input":{input:{minWidth:i},[o]:{color:v}}},[`${W}-checkall`]:{width:"100%",marginBottom:a,marginInlineStart:a},[`${W}-btns`]:{display:"flex",justifyContent:"space-between",padding:`${Nt(D(l).sub(c).equal())} ${Nt(l)}`,overflow:"hidden",borderTop:L}})}},{[`${n}-dropdown ${W}, ${W}-submenu`]:{[`${n}-checkbox-wrapper + span`]:{paddingInlineStart:l,color:s},"> ul":{maxHeight:"calc(100vh - 130px)",overflowX:"hidden",overflowY:"auto"}}}]},IVt=t=>{const{componentCls:e,lineWidth:n,colorSplit:o,motionDurationSlow:r,zIndexTableFixed:i,tableBg:a,zIndexTableSticky:l,calc:s}=t,c=o;return{[`${e}-wrapper`]:{[` ${e}-cell-fix-left, ${e}-cell-fix-right `]:{position:"sticky !important",zIndex:i,background:a},[` @@ -4726,7 +4726,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `]:{padding:`${Nt(a)} ${Nt(l)}`},[`${e}-filter-trigger`]:{marginInlineEnd:Nt(o(l).div(2).mul(-1).equal())},[`${e}-expanded-row-fixed`]:{margin:`${Nt(o(a).mul(-1).equal())} ${Nt(o(l).mul(-1).equal())}`},[`${e}-tbody`]:{[`${e}-wrapper:only-child ${e}`]:{marginBlock:Nt(o(a).mul(-1).equal()),marginInline:`${Nt(o(n).sub(l).equal())} ${Nt(o(l).mul(-1).equal())}`}},[`${e}-selection-extra`]:{paddingInlineStart:Nt(o(l).div(4).equal())}}});return{[`${e}-wrapper`]:Object.assign(Object.assign({},r("middle",t.tablePaddingVerticalMiddle,t.tablePaddingHorizontalMiddle,t.tableFontSizeMiddle)),r("small",t.tablePaddingVerticalSmall,t.tablePaddingHorizontalSmall,t.tableFontSizeSmall))}},LVt=t=>{const{componentCls:e,marginXXS:n,fontSizeIcon:o,headerIconColor:r,headerIconHoverColor:i}=t;return{[`${e}-wrapper`]:{[`${e}-thead th${e}-column-has-sorters`]:{outline:"none",cursor:"pointer",transition:`all ${t.motionDurationSlow}`,"&:hover":{background:t.tableHeaderSortHoverBg,"&::before":{backgroundColor:"transparent !important"}},"&:focus-visible":{color:t.colorPrimary},[` &${e}-cell-fix-left:hover, &${e}-cell-fix-right:hover - `]:{background:t.tableFixedHeaderSortActiveBg}},[`${e}-thead th${e}-column-sort`]:{background:t.tableHeaderSortBg,"&::before":{backgroundColor:"transparent !important"}},[`td${e}-column-sort`]:{background:t.tableBodySortBg},[`${e}-column-title`]:{position:"relative",zIndex:1,flex:1},[`${e}-column-sorters`]:{display:"flex",flex:"auto",alignItems:"center",justifyContent:"space-between","&::after":{position:"absolute",inset:0,width:"100%",height:"100%",content:'""'}},[`${e}-column-sorters-tooltip-target-sorter`]:{"&::after":{content:"none"}},[`${e}-column-sorter`]:{marginInlineStart:n,color:r,fontSize:0,transition:`color ${t.motionDurationSlow}`,"&-inner":{display:"inline-flex",flexDirection:"column",alignItems:"center"},"&-up, &-down":{fontSize:o,"&.active":{color:t.colorPrimary}},[`${e}-column-sorter-up + ${e}-column-sorter-down`]:{marginTop:"-0.3em"}},[`${e}-column-sorters:hover ${e}-column-sorter`]:{color:i}}}},WVt=t=>{const{componentCls:e,opacityLoading:n,tableScrollThumbBg:o,tableScrollThumbBgHover:r,tableScrollThumbSize:i,tableScrollBg:a,zIndexTableSticky:l,stickyScrollBarBorderRadius:s,lineWidth:c,lineType:u,tableBorderColor:d}=t,f=`${Nt(c)} ${u} ${d}`;return{[`${e}-wrapper`]:{[`${e}-sticky`]:{"&-holder":{position:"sticky",zIndex:l,background:t.colorBgContainer},"&-scroll":{position:"sticky",bottom:0,height:`${Nt(i)} !important`,zIndex:l,display:"flex",alignItems:"center",background:a,borderTop:f,opacity:n,"&:hover":{transformOrigin:"center bottom"},"&-bar":{height:i,backgroundColor:o,borderRadius:s,transition:`all ${t.motionDurationSlow}, transform none`,position:"absolute",bottom:0,"&:hover, &-active":{backgroundColor:r}}}}}}},wbe=t=>{const{componentCls:e,lineWidth:n,tableBorderColor:o,calc:r}=t,i=`${Nt(n)} ${t.lineType} ${o}`;return{[`${e}-wrapper`]:{[`${e}-summary`]:{position:"relative",zIndex:t.zIndexTableFixed,background:t.tableBg,"> tr":{"> th, > td":{borderBottom:i}}},[`div${e}-summary`]:{boxShadow:`0 ${Nt(r(n).mul(-1).equal())} 0 ${o}`}}}},NVt=t=>{const{componentCls:e,motionDurationMid:n,lineWidth:o,lineType:r,tableBorderColor:i,calc:a}=t,l=`${Nt(o)} ${r} ${i}`,s=`${e}-expanded-row-cell`;return{[`${e}-wrapper`]:{[`${e}-tbody-virtual`]:{[`${e}-row:not(tr)`]:{display:"flex",boxSizing:"border-box",width:"100%"},[`${e}-cell`]:{borderBottom:l,transition:`background ${n}`},[`${e}-expanded-row`]:{[`${s}${s}-fixed`]:{position:"sticky",insetInlineStart:0,overflow:"hidden",width:`calc(var(--virtual-width) - ${Nt(o)})`,borderInlineEnd:"none"}}},[`${e}-bordered`]:{[`${e}-tbody-virtual`]:{"&:after":{content:'""',insetInline:0,bottom:0,borderBottom:l,position:"absolute"},[`${e}-cell`]:{borderInlineEnd:l,[`&${e}-cell-fix-right-first:before`]:{content:'""',position:"absolute",insetBlock:0,insetInlineStart:a(o).mul(-1).equal(),borderInlineStart:l}}},[`&${e}-virtual`]:{[`${e}-placeholder ${e}-cell`]:{borderInlineEnd:l,borderBottom:l}}}}}},UVt=t=>{const{componentCls:e,fontWeightStrong:n,tablePaddingVertical:o,tablePaddingHorizontal:r,tableExpandColumnWidth:i,lineWidth:a,lineType:l,tableBorderColor:s,tableFontSize:c,tableBg:u,tableRadius:d,tableHeaderTextColor:f,motionDurationMid:p,tableHeaderBg:g,tableHeaderCellSplitColor:y,tableFooterTextColor:w,tableFooterBg:b,calc:C}=t,P=`${Nt(a)} ${l} ${s}`;return{[`${e}-wrapper`]:Object.assign(Object.assign({clear:"both",maxWidth:"100%"},ek()),{[e]:Object.assign(Object.assign({},ja(t)),{fontSize:c,background:u,borderRadius:`${Nt(d)} ${Nt(d)} 0 0`,scrollbarColor:`${t.tableScrollThumbBg} ${t.tableScrollBg}`}),table:{width:"100%",textAlign:"start",borderRadius:`${Nt(d)} ${Nt(d)} 0 0`,borderCollapse:"separate",borderSpacing:0},[` + `]:{background:t.tableFixedHeaderSortActiveBg}},[`${e}-thead th${e}-column-sort`]:{background:t.tableHeaderSortBg,"&::before":{backgroundColor:"transparent !important"}},[`td${e}-column-sort`]:{background:t.tableBodySortBg},[`${e}-column-title`]:{position:"relative",zIndex:1,flex:1},[`${e}-column-sorters`]:{display:"flex",flex:"auto",alignItems:"center",justifyContent:"space-between","&::after":{position:"absolute",inset:0,width:"100%",height:"100%",content:'""'}},[`${e}-column-sorters-tooltip-target-sorter`]:{"&::after":{content:"none"}},[`${e}-column-sorter`]:{marginInlineStart:n,color:r,fontSize:0,transition:`color ${t.motionDurationSlow}`,"&-inner":{display:"inline-flex",flexDirection:"column",alignItems:"center"},"&-up, &-down":{fontSize:o,"&.active":{color:t.colorPrimary}},[`${e}-column-sorter-up + ${e}-column-sorter-down`]:{marginTop:"-0.3em"}},[`${e}-column-sorters:hover ${e}-column-sorter`]:{color:i}}}},WVt=t=>{const{componentCls:e,opacityLoading:n,tableScrollThumbBg:o,tableScrollThumbBgHover:r,tableScrollThumbSize:i,tableScrollBg:a,zIndexTableSticky:l,stickyScrollBarBorderRadius:s,lineWidth:c,lineType:u,tableBorderColor:d}=t,f=`${Nt(c)} ${u} ${d}`;return{[`${e}-wrapper`]:{[`${e}-sticky`]:{"&-holder":{position:"sticky",zIndex:l,background:t.colorBgContainer},"&-scroll":{position:"sticky",bottom:0,height:`${Nt(i)} !important`,zIndex:l,display:"flex",alignItems:"center",background:a,borderTop:f,opacity:n,"&:hover":{transformOrigin:"center bottom"},"&-bar":{height:i,backgroundColor:o,borderRadius:s,transition:`all ${t.motionDurationSlow}, transform none`,position:"absolute",bottom:0,"&:hover, &-active":{backgroundColor:r}}}}}}},vbe=t=>{const{componentCls:e,lineWidth:n,tableBorderColor:o,calc:r}=t,i=`${Nt(n)} ${t.lineType} ${o}`;return{[`${e}-wrapper`]:{[`${e}-summary`]:{position:"relative",zIndex:t.zIndexTableFixed,background:t.tableBg,"> tr":{"> th, > td":{borderBottom:i}}},[`div${e}-summary`]:{boxShadow:`0 ${Nt(r(n).mul(-1).equal())} 0 ${o}`}}}},NVt=t=>{const{componentCls:e,motionDurationMid:n,lineWidth:o,lineType:r,tableBorderColor:i,calc:a}=t,l=`${Nt(o)} ${r} ${i}`,s=`${e}-expanded-row-cell`;return{[`${e}-wrapper`]:{[`${e}-tbody-virtual`]:{[`${e}-row:not(tr)`]:{display:"flex",boxSizing:"border-box",width:"100%"},[`${e}-cell`]:{borderBottom:l,transition:`background ${n}`},[`${e}-expanded-row`]:{[`${s}${s}-fixed`]:{position:"sticky",insetInlineStart:0,overflow:"hidden",width:`calc(var(--virtual-width) - ${Nt(o)})`,borderInlineEnd:"none"}}},[`${e}-bordered`]:{[`${e}-tbody-virtual`]:{"&:after":{content:'""',insetInline:0,bottom:0,borderBottom:l,position:"absolute"},[`${e}-cell`]:{borderInlineEnd:l,[`&${e}-cell-fix-right-first:before`]:{content:'""',position:"absolute",insetBlock:0,insetInlineStart:a(o).mul(-1).equal(),borderInlineStart:l}}},[`&${e}-virtual`]:{[`${e}-placeholder ${e}-cell`]:{borderInlineEnd:l,borderBottom:l}}}}}},UVt=t=>{const{componentCls:e,fontWeightStrong:n,tablePaddingVertical:o,tablePaddingHorizontal:r,tableExpandColumnWidth:i,lineWidth:a,lineType:l,tableBorderColor:s,tableFontSize:c,tableBg:u,tableRadius:d,tableHeaderTextColor:f,motionDurationMid:p,tableHeaderBg:g,tableHeaderCellSplitColor:y,tableFooterTextColor:w,tableFooterBg:b,calc:C}=t,P=`${Nt(a)} ${l} ${s}`;return{[`${e}-wrapper`]:Object.assign(Object.assign({clear:"both",maxWidth:"100%"},ek()),{[e]:Object.assign(Object.assign({},ja(t)),{fontSize:c,background:u,borderRadius:`${Nt(d)} ${Nt(d)} 0 0`,scrollbarColor:`${t.tableScrollThumbBg} ${t.tableScrollBg}`}),table:{width:"100%",textAlign:"start",borderRadius:`${Nt(d)} ${Nt(d)} 0 0`,borderCollapse:"separate",borderSpacing:0},[` ${e}-cell, ${e}-thead > tr > th, ${e}-tbody > tr > th, @@ -4737,12 +4737,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho > ${e}-wrapper:only-child, > ${e}-expanded-row-fixed > ${e}-wrapper:only-child `]:{[e]:{marginBlock:Nt(C(o).mul(-1).equal()),marginInline:`${Nt(C(i).sub(r).equal())} - ${Nt(C(r).mul(-1).equal())}`,[`${e}-tbody > tr:last-child > td`]:{borderBottom:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:g,borderBottom:P,transition:`background ${p} ease`}}},[`${e}-footer`]:{padding:`${Nt(o)} ${Nt(r)}`,color:w,background:b}})}},jVt=t=>{const{colorFillAlter:e,colorBgContainer:n,colorTextHeading:o,colorFillSecondary:r,colorFillContent:i,controlItemBgActive:a,controlItemBgActiveHover:l,padding:s,paddingSM:c,paddingXS:u,colorBorderSecondary:d,borderRadiusLG:f,controlHeight:p,colorTextPlaceholder:g,fontSize:y,fontSizeSM:w,lineHeight:b,lineWidth:C,colorIcon:P,colorIconHover:v,opacityLoading:T,controlInteractiveSize:A}=t,x=new kl(r).onBackground(n).toHexShortString(),S=new kl(i).onBackground(n).toHexShortString(),R=new kl(e).onBackground(n).toHexShortString(),M=new kl(P),D=new kl(v),E=A/2-C,W=E*2+C*3;return{headerBg:R,headerColor:o,headerSortActiveBg:x,headerSortHoverBg:S,bodySortBg:R,rowHoverBg:R,rowSelectedBg:a,rowSelectedHoverBg:l,rowExpandedBg:e,cellPaddingBlock:s,cellPaddingInline:s,cellPaddingBlockMD:c,cellPaddingInlineMD:u,cellPaddingBlockSM:u,cellPaddingInlineSM:u,borderColor:d,headerBorderRadius:f,footerBg:R,footerColor:o,cellFontSize:y,cellFontSizeMD:y,cellFontSizeSM:y,headerSplitColor:d,fixedHeaderSortActiveBg:x,headerFilterHoverBg:i,filterDropdownMenuBg:n,filterDropdownBg:n,expandIconBg:n,selectionColumnWidth:p,stickyScrollBarBg:g,stickyScrollBarBorderRadius:100,expandIconMarginTop:(y*b-C*3)/2-Math.ceil((w*1.4-C*3)/2),headerIconColor:M.clone().setAlpha(M.getAlpha()*T).toRgbString(),headerIconHoverColor:D.clone().setAlpha(D.getAlpha()*T).toRgbString(),expandIconHalfInner:E,expandIconSize:W,expandIconScale:A/W}},BVt=wl("Table",t=>{const{colorTextHeading:e,colorSplit:n,colorBgContainer:o,controlInteractiveSize:r,headerBg:i,headerColor:a,headerSortActiveBg:l,headerSortHoverBg:s,bodySortBg:c,rowHoverBg:u,rowSelectedBg:d,rowSelectedHoverBg:f,rowExpandedBg:p,cellPaddingBlock:g,cellPaddingInline:y,cellPaddingBlockMD:w,cellPaddingInlineMD:b,cellPaddingBlockSM:C,cellPaddingInlineSM:P,borderColor:v,footerBg:T,footerColor:A,headerBorderRadius:x,cellFontSize:S,cellFontSizeMD:R,cellFontSizeSM:M,headerSplitColor:D,fixedHeaderSortActiveBg:E,headerFilterHoverBg:W,filterDropdownBg:j,expandIconBg:L,selectionColumnWidth:k,stickyScrollBarBg:N,calc:F}=t,U=2,O=Ki(t,{tableFontSize:S,tableBg:o,tableRadius:x,tablePaddingVertical:g,tablePaddingHorizontal:y,tablePaddingVerticalMiddle:w,tablePaddingHorizontalMiddle:b,tablePaddingVerticalSmall:C,tablePaddingHorizontalSmall:P,tableBorderColor:v,tableHeaderTextColor:a,tableHeaderBg:i,tableFooterTextColor:A,tableFooterBg:T,tableHeaderCellSplitColor:D,tableHeaderSortBg:l,tableHeaderSortHoverBg:s,tableBodySortBg:c,tableFixedHeaderSortActiveBg:E,tableHeaderFilterActiveBg:W,tableFilterDropdownBg:j,tableRowHoverBg:u,tableSelectedRowBg:d,tableSelectedRowHoverBg:f,zIndexTableFixed:U,zIndexTableSticky:U+1,tableFontSizeMiddle:R,tableFontSizeSmall:M,tableSelectionColumnWidth:k,tableExpandIconBg:L,tableExpandColumnWidth:F(r).add(F(t.padding).mul(2)).equal(),tableExpandedRowBg:p,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:N,tableScrollThumbBgHover:e,tableScrollBg:n});return[UVt(O),zVt(O),wbe(O),LVt(O),MVt(O),PVt(O),DVt(O),HVt(O),wbe(O),RVt(O),FVt(O),IVt(O),WVt(O),CVt(O),kVt(O),EVt(O),NVt(O)]},jVt,{unitless:{expandIconScale:!0}}),YVt=[],OVt=(t,e)=>{var n,o;const{prefixCls:r,className:i,rootClassName:a,style:l,size:s,bordered:c,dropdownPrefixCls:u,dataSource:d,pagination:f,rowSelection:p,rowKey:g="key",rowClassName:y,columns:w,children:b,childrenColumnName:C,onChange:P,getPopupContainer:v,loading:T,expandIcon:A,expandable:x,expandedRowRender:S,expandIconColumnIndex:R,indentSize:M,scroll:D,sortDirections:E,locale:W,showSorterTooltip:j={target:"full-header"},virtual:L}=t;kb();const k=m.useMemo(()=>w||gye(b),[w,b]),N=m.useMemo(()=>k.some(kt=>kt.responsive),[k]),F=X$(N),U=m.useMemo(()=>{const kt=new Set(Object.keys(F).filter(gt=>F[gt]));return k.filter(gt=>!gt.responsive||gt.responsive.some(dt=>kt.has(dt)))},[k,F]),O=up(t,["className","style","columns"]),{locale:B=aw,direction:_,table:X,renderEmpty:$,getPrefixCls:Q,getPopupContainer:le}=m.useContext(Cr),q=Ed(s),te=Object.assign(Object.assign({},B.Table),W),re=d||YVt,ae=Q("table",r),se=Q("dropdown",u),[,ne]=_u(),fe=O0(ae),[ge,de,Z]=BVt(ae,fe),he=Object.assign(Object.assign({childrenColumnName:C,expandIconColumnIndex:R},x),{expandIcon:(n=x==null?void 0:x.expandIcon)!==null&&n!==void 0?n:(o=X==null?void 0:X.expandable)===null||o===void 0?void 0:o.expandIcon}),{childrenColumnName:xe="children"}=he,He=m.useMemo(()=>re.some(kt=>kt==null?void 0:kt[xe])?"nest":S||x&&x.expandedRowRender?"row":null,[re]),Se={body:m.useRef()},ze=l_t(ae),Ie=m.useRef(null),ye=m.useRef(null);i_t(e,()=>Object.assign(Object.assign({},ye.current),{nativeElement:Ie.current}));const ce=m.useMemo(()=>typeof g=="function"?g:kt=>kt==null?void 0:kt[g],[g]),[pe]=dVt(re,xe,ce),ve={},Ae=function(kt,gt){let dt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var Ct,tt,Fe;const qe=Object.assign(Object.assign({},ve),kt);dt&&((Ct=ve.resetPagination)===null||Ct===void 0||Ct.call(ve),!((tt=qe.pagination)===null||tt===void 0)&&tt.current&&(qe.pagination.current=1),f&&f.onChange&&f.onChange(1,(Fe=qe.pagination)===null||Fe===void 0?void 0:Fe.pageSize)),D&&D.scrollToFirstRowOnChange!==!1&&Se.body.current&&qCt(0,{getContainer:()=>Se.body.current}),P==null||P(qe.pagination,qe.filters,qe.sorter,{currentDataSource:Iue(Due(re,qe.sorterStates,xe),qe.filterStates,xe),action:gt})},Te=(kt,gt)=>{Ae({sorter:kt,sorterStates:gt},"sort",!1)},[Me,Pe,Ee,Be]=xVt({prefixCls:ae,mergedColumns:U,onSorterChange:Te,sortDirections:E||["ascend","descend"],tableLocale:te,showSorterTooltip:j}),Je=m.useMemo(()=>Due(re,Pe,xe),[re,Pe]);ve.sorter=Be(),ve.sorterStates=Pe;const We=(kt,gt)=>{Ae({filters:kt,filterStates:gt},"filter",!0)},[Ke,Ne,De]=uVt({prefixCls:ae,locale:te,dropdownPrefixCls:se,mergedColumns:U,onFilterChange:We,getPopupContainer:v||le,rootClassName:Un(a,fe)}),ke=Iue(Je,Ne,xe);ve.filters=De,ve.filterStates=Ne;const Ye=m.useMemo(()=>{const kt={};return Object.keys(De).forEach(gt=>{De[gt]!==null&&(kt[gt]=De[gt])}),Object.assign(Object.assign({},Ee),{filters:kt})},[Ee,De]),[it]=bVt(Ye),Ve=(kt,gt)=>{Ae({pagination:Object.assign(Object.assign({},ve.pagination),{current:kt,pageSize:gt})},"paginate")},[yt,ct]=pVt(ke.length,Ve,f);ve.pagination=f===!1?{}:hVt(yt,f),ve.resetPagination=ct;const Xe=m.useMemo(()=>{if(f===!1||!yt.pageSize)return ke;const{current:kt=1,total:gt,pageSize:dt=BKe}=yt;return ke.lengthdt?ke.slice((kt-1)*dt,kt*dt):ke:ke.slice((kt-1)*dt,kt*dt)},[!!f,ke,yt&&yt.current,yt&&yt.pageSize,yt&&yt.total]),[ut,ft]=o_t({prefixCls:ae,data:ke,pageData:Xe,getRowKey:ce,getRecordByKey:pe,expandType:He,childrenColumnName:xe,locale:te,getPopupContainer:v||le},p),ot=(kt,gt,dt)=>{let Ct;return typeof y=="function"?Ct=Un(y(kt,gt,dt)):Ct=Un(y),Un({[`${ae}-row-selected`]:ft.has(ce(kt,gt))},Ct)};he.__PARENT_RENDER_ICON__=he.expandIcon,he.expandIcon=he.expandIcon||A||a_t(te),He==="nest"&&he.expandIconColumnIndex===void 0?he.expandIconColumnIndex=p?1:0:he.expandIconColumnIndex>0&&p&&(he.expandIconColumnIndex-=1),typeof he.indentSize!="number"&&(he.indentSize=typeof M=="number"?M:15);const st=m.useCallback(kt=>it(ut(Ke(Me(kt)))),[Me,Ke,ut]);let at,Oe;if(f!==!1&&(yt!=null&&yt.total)){let kt;yt.size?kt=yt.size:kt=q==="small"||q==="middle"?"small":void 0;const gt=tt=>m.createElement(JJe,Object.assign({},yt,{className:Un(`${ae}-pagination ${ae}-pagination-${tt}`,yt.className),size:kt})),dt=_==="rtl"?"left":"right",{position:Ct}=yt;if(Ct!==null&&Array.isArray(Ct)){const tt=Ct.find(je=>je.includes("top")),Fe=Ct.find(je=>je.includes("bottom")),qe=Ct.every(je=>`${je}`=="none");!tt&&!Fe&&!qe&&(Oe=gt(dt)),tt&&(at=gt(tt.toLowerCase().replace("top",""))),Fe&&(Oe=gt(Fe.toLowerCase().replace("bottom","")))}else Oe=gt(dt)}let Ze;typeof T=="boolean"?Ze={spinning:T}:typeof T=="object"&&(Ze=Object.assign({spinning:!0},T));const St=Un(Z,fe,`${ae}-wrapper`,X==null?void 0:X.className,{[`${ae}-wrapper-rtl`]:_==="rtl"},i,a,de),Pt=Object.assign(Object.assign({},X==null?void 0:X.style),l),Rt=W&&W.emptyText||($==null?void 0:$("Table"))||m.createElement(Dme,{componentName:"Table"}),Ut=L?TVt:SVt,Ht={},At=m.useMemo(()=>{const{fontSize:kt,lineHeight:gt,padding:dt,paddingXS:Ct,paddingSM:tt}=ne,Fe=Math.floor(kt*gt);switch(q){case"large":return dt*2+Fe;case"small":return Ct*2+Fe;default:return tt*2+Fe}},[ne,q]);return L&&(Ht.listItemHeight=At),ge(m.createElement("div",{ref:Ie,className:St,style:Pt},m.createElement(qW,Object.assign({spinning:!1},Ze),at,m.createElement(Ut,Object.assign({},Ht,O,{ref:ye,columns:U,direction:_,expandable:he,prefixCls:ae,className:Un({[`${ae}-middle`]:q==="middle",[`${ae}-small`]:q==="small",[`${ae}-bordered`]:c,[`${ae}-empty`]:re.length===0},Z,fe,de),data:Xe,rowKey:ce,rowClassName:ot,emptyText:Rt,internalHooks:QW,internalRefs:Se,transformColumns:st,getContainerWidth:ze})),Oe)))},_Vt=m.forwardRef(OVt),VVt=(t,e)=>{const n=m.useRef(0);return n.current+=1,m.createElement(_Vt,Object.assign({},t,{ref:e,_renderTimes:n.current}))},Fd=m.forwardRef(VVt);Fd.SELECTION_COLUMN=L4;Fd.EXPAND_COLUMN=J4;Fd.SELECTION_ALL=Pue;Fd.SELECTION_INVERT=Cue;Fd.SELECTION_NONE=Rue;Fd.Column=xOt;Fd.ColumnGroup=bOt;Fd.Summary=oKe;const GVt=t=>{const{paddingXXS:e,lineWidth:n,tagPaddingHorizontal:o,componentCls:r,calc:i}=t,a=i(o).sub(n).equal(),l=i(e).sub(n).equal();return{[r]:Object.assign(Object.assign({},ja(t)),{display:"inline-block",height:"auto",marginInlineEnd:t.marginXS,paddingInline:a,fontSize:t.tagFontSize,lineHeight:t.tagLineHeight,whiteSpace:"nowrap",background:t.defaultBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderRadius:t.borderRadiusSM,opacity:1,transition:`all ${t.motionDurationMid}`,textAlign:"start",position:"relative",[`&${r}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:t.defaultColor},[`${r}-close-icon`]:{marginInlineStart:l,fontSize:t.tagIconSize,color:t.colorTextDescription,cursor:"pointer",transition:`all ${t.motionDurationMid}`,"&:hover":{color:t.colorTextHeading}},[`&${r}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${t.iconCls}-close, ${t.iconCls}-close:hover`]:{color:t.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${r}-checkable-checked):hover`]:{color:t.colorPrimary,backgroundColor:t.colorFillSecondary},"&:active, &-checked":{color:t.colorTextLightSolid},"&-checked":{backgroundColor:t.colorPrimary,"&:hover":{backgroundColor:t.colorPrimaryHover}},"&:active":{backgroundColor:t.colorPrimaryActive}},"&-hidden":{display:"none"},[`> ${t.iconCls} + span, > span + ${t.iconCls}`]:{marginInlineStart:a}}),[`${r}-borderless`]:{borderColor:"transparent",background:t.tagBorderlessBg}}},Sye=t=>{const{lineWidth:e,fontSizeIcon:n,calc:o}=t,r=t.fontSizeSM;return Ki(t,{tagFontSize:r,tagLineHeight:Nt(o(t.lineHeightSM).mul(r).equal()),tagIconSize:o(n).sub(o(e).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:t.defaultBg})},Tye=t=>({defaultBg:new kl(t.colorFillQuaternary).onBackground(t.colorBgContainer).toHexString(),defaultColor:t.colorText}),VKe=wl("Tag",t=>{const e=Sye(t);return GVt(e)},Tye);var XVt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:n,style:o,className:r,checked:i,onChange:a,onClick:l}=t,s=XVt(t,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:c,tag:u}=m.useContext(Cr),d=b=>{a==null||a(!i),l==null||l(b)},f=c("tag",n),[p,g,y]=VKe(f),w=Un(f,`${f}-checkable`,{[`${f}-checkable-checked`]:i},u==null?void 0:u.className,r,g,y);return p(m.createElement("span",Object.assign({},s,{ref:e,style:Object.assign(Object.assign({},o),u==null?void 0:u.style),className:w,onClick:d})))}),KVt=t=>D$(t,(e,n)=>{let{textColor:o,lightBorderColor:r,lightColor:i,darkColor:a}=n;return{[`${t.componentCls}${t.componentCls}-${e}`]:{color:o,background:i,borderColor:r,"&-inverse":{color:t.colorTextLightSolid,background:a,borderColor:a},[`&${t.componentCls}-borderless`]:{borderColor:"transparent"}}}}),qVt=IW(["Tag","preset"],t=>{const e=Sye(t);return KVt(e)},Tye);function $Vt(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.slice(1)}const UY=(t,e,n)=>{const o=$Vt(n);return{[`${t.componentCls}${t.componentCls}-${e}`]:{color:t[`color${n}`],background:t[`color${o}Bg`],borderColor:t[`color${o}Border`],[`&${t.componentCls}-borderless`]:{borderColor:"transparent"}}}},QVt=IW(["Tag","status"],t=>{const e=Sye(t);return[UY(e,"success","Success"),UY(e,"processing","Info"),UY(e,"error","Error"),UY(e,"warning","Warning")]},Tye);var ZVt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:n,className:o,rootClassName:r,style:i,children:a,icon:l,color:s,onClose:c,bordered:u=!0,visible:d}=t,f=ZVt(t,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:p,direction:g,tag:y}=m.useContext(Cr),[w,b]=m.useState(!0),C=up(f,["closeIcon","closable"]);m.useEffect(()=>{d!==void 0&&b(d)},[d]);const P=q$(s),v=EEt(s),T=P||v,A=Object.assign(Object.assign({backgroundColor:s&&!T?s:void 0},y==null?void 0:y.style),i),x=p("tag",n),[S,R,M]=VKe(x),D=Un(x,y==null?void 0:y.className,{[`${x}-${s}`]:T,[`${x}-has-color`]:s&&!T,[`${x}-hidden`]:!w,[`${x}-rtl`]:g==="rtl",[`${x}-borderless`]:!u},o,r,R,M),E=F=>{F.stopPropagation(),c==null||c(F),!F.defaultPrevented&&b(!1)},[,W]=Tme(mR(t),mR(y),{closable:!1,closeIconRender:F=>{const U=m.createElement("span",{className:`${x}-close-icon`,onClick:E},F);return mVe(F,U,O=>({onClick:B=>{var _;(_=O==null?void 0:O.onClick)===null||_===void 0||_.call(O,B),E(B)},className:Un(O==null?void 0:O.className,`${x}-close-icon`)}))}}),j=typeof f.onClick=="function"||a&&a.type==="a",L=l||null,k=L?m.createElement(m.Fragment,null,L,a&&m.createElement("span",null,a)):a,N=m.createElement("span",Object.assign({},C,{ref:e,className:D,style:A}),k,W,P&&m.createElement(qVt,{key:"preset",prefixCls:x}),v&&m.createElement(QVt,{key:"status",prefixCls:x}));return S(j?m.createElement(EW,{component:"Tag"},N):N)}),GKe=eGt;GKe.CheckableTag=JVt;var tGt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);rm.createElement(oGt,Object.assign({},t,{picker:"time",mode:void 0,ref:e}))),tN=m.forwardRef((t,e)=>{var{addon:n,renderExtraFooter:o}=t,r=tGt(t,["addon","renderExtraFooter"]);const i=m.useMemo(()=>{if(o)return o;if(n)return n},[n,o]);return m.createElement(nGt,Object.assign({},r,{mode:void 0,ref:e,renderExtraFooter:i}))}),XKe=BW(tN,"picker");tN._InternalPanelDoNotUseOrYouWillBeFired=XKe;tN.RangePicker=rGt;tN._InternalPanelDoNotUseOrYouWillBeFired=XKe;var iGt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},aGt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:iGt}))},lGt=m.forwardRef(aGt),sGt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const n=u=>{const{keyCode:d}=u;d===fi.ENTER&&u.preventDefault()},o=u=>{const{keyCode:d}=u,{onClick:f}=t;d===fi.ENTER&&f&&f()},{style:r,noStyle:i,disabled:a,tabIndex:l=0}=t,s=sGt(t,["style","noStyle","disabled","tabIndex"]);let c={};return i||(c=Object.assign({},cGt)),a&&(c.pointerEvents="none"),c=Object.assign(Object.assign({},c),r),m.createElement("div",Object.assign({role:"button",tabIndex:l,ref:e},s,{onKeyDown:n,onKeyUp:o,style:c}))});var uGt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},dGt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:uGt}))},KKe=m.forwardRef(dGt),fGt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"},hGt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:fGt}))},pGt=m.forwardRef(hGt);const gGt=(t,e,n,o)=>{const{titleMarginBottom:r,fontWeightStrong:i}=o;return{marginBottom:r,color:n,fontWeight:i,fontSize:t,lineHeight:e}},mGt=t=>{const e=[1,2,3,4,5],n={};return e.forEach(o=>{n[` + ${Nt(C(r).mul(-1).equal())}`,[`${e}-tbody > tr:last-child > td`]:{borderBottom:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:g,borderBottom:P,transition:`background ${p} ease`}}},[`${e}-footer`]:{padding:`${Nt(o)} ${Nt(r)}`,color:w,background:b}})}},jVt=t=>{const{colorFillAlter:e,colorBgContainer:n,colorTextHeading:o,colorFillSecondary:r,colorFillContent:i,controlItemBgActive:a,controlItemBgActiveHover:l,padding:s,paddingSM:c,paddingXS:u,colorBorderSecondary:d,borderRadiusLG:f,controlHeight:p,colorTextPlaceholder:g,fontSize:y,fontSizeSM:w,lineHeight:b,lineWidth:C,colorIcon:P,colorIconHover:v,opacityLoading:T,controlInteractiveSize:A}=t,x=new kl(r).onBackground(n).toHexShortString(),S=new kl(i).onBackground(n).toHexShortString(),R=new kl(e).onBackground(n).toHexShortString(),M=new kl(P),D=new kl(v),E=A/2-C,W=E*2+C*3;return{headerBg:R,headerColor:o,headerSortActiveBg:x,headerSortHoverBg:S,bodySortBg:R,rowHoverBg:R,rowSelectedBg:a,rowSelectedHoverBg:l,rowExpandedBg:e,cellPaddingBlock:s,cellPaddingInline:s,cellPaddingBlockMD:c,cellPaddingInlineMD:u,cellPaddingBlockSM:u,cellPaddingInlineSM:u,borderColor:d,headerBorderRadius:f,footerBg:R,footerColor:o,cellFontSize:y,cellFontSizeMD:y,cellFontSizeSM:y,headerSplitColor:d,fixedHeaderSortActiveBg:x,headerFilterHoverBg:i,filterDropdownMenuBg:n,filterDropdownBg:n,expandIconBg:n,selectionColumnWidth:p,stickyScrollBarBg:g,stickyScrollBarBorderRadius:100,expandIconMarginTop:(y*b-C*3)/2-Math.ceil((w*1.4-C*3)/2),headerIconColor:M.clone().setAlpha(M.getAlpha()*T).toRgbString(),headerIconHoverColor:D.clone().setAlpha(D.getAlpha()*T).toRgbString(),expandIconHalfInner:E,expandIconSize:W,expandIconScale:A/W}},BVt=wl("Table",t=>{const{colorTextHeading:e,colorSplit:n,colorBgContainer:o,controlInteractiveSize:r,headerBg:i,headerColor:a,headerSortActiveBg:l,headerSortHoverBg:s,bodySortBg:c,rowHoverBg:u,rowSelectedBg:d,rowSelectedHoverBg:f,rowExpandedBg:p,cellPaddingBlock:g,cellPaddingInline:y,cellPaddingBlockMD:w,cellPaddingInlineMD:b,cellPaddingBlockSM:C,cellPaddingInlineSM:P,borderColor:v,footerBg:T,footerColor:A,headerBorderRadius:x,cellFontSize:S,cellFontSizeMD:R,cellFontSizeSM:M,headerSplitColor:D,fixedHeaderSortActiveBg:E,headerFilterHoverBg:W,filterDropdownBg:j,expandIconBg:L,selectionColumnWidth:k,stickyScrollBarBg:N,calc:F}=t,U=2,O=Ki(t,{tableFontSize:S,tableBg:o,tableRadius:x,tablePaddingVertical:g,tablePaddingHorizontal:y,tablePaddingVerticalMiddle:w,tablePaddingHorizontalMiddle:b,tablePaddingVerticalSmall:C,tablePaddingHorizontalSmall:P,tableBorderColor:v,tableHeaderTextColor:a,tableHeaderBg:i,tableFooterTextColor:A,tableFooterBg:T,tableHeaderCellSplitColor:D,tableHeaderSortBg:l,tableHeaderSortHoverBg:s,tableBodySortBg:c,tableFixedHeaderSortActiveBg:E,tableHeaderFilterActiveBg:W,tableFilterDropdownBg:j,tableRowHoverBg:u,tableSelectedRowBg:d,tableSelectedRowHoverBg:f,zIndexTableFixed:U,zIndexTableSticky:U+1,tableFontSizeMiddle:R,tableFontSizeSmall:M,tableSelectionColumnWidth:k,tableExpandIconBg:L,tableExpandColumnWidth:F(r).add(F(t.padding).mul(2)).equal(),tableExpandedRowBg:p,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:N,tableScrollThumbBgHover:e,tableScrollBg:n});return[UVt(O),zVt(O),vbe(O),LVt(O),MVt(O),PVt(O),DVt(O),HVt(O),vbe(O),RVt(O),FVt(O),IVt(O),WVt(O),CVt(O),kVt(O),EVt(O),NVt(O)]},jVt,{unitless:{expandIconScale:!0}}),YVt=[],OVt=(t,e)=>{var n,o;const{prefixCls:r,className:i,rootClassName:a,style:l,size:s,bordered:c,dropdownPrefixCls:u,dataSource:d,pagination:f,rowSelection:p,rowKey:g="key",rowClassName:y,columns:w,children:b,childrenColumnName:C,onChange:P,getPopupContainer:v,loading:T,expandIcon:A,expandable:x,expandedRowRender:S,expandIconColumnIndex:R,indentSize:M,scroll:D,sortDirections:E,locale:W,showSorterTooltip:j={target:"full-header"},virtual:L}=t;kb();const k=m.useMemo(()=>w||mye(b),[w,b]),N=m.useMemo(()=>k.some(kt=>kt.responsive),[k]),F=X$(N),U=m.useMemo(()=>{const kt=new Set(Object.keys(F).filter(gt=>F[gt]));return k.filter(gt=>!gt.responsive||gt.responsive.some(dt=>kt.has(dt)))},[k,F]),O=up(t,["className","style","columns"]),{locale:B=aw,direction:_,table:X,renderEmpty:$,getPrefixCls:Q,getPopupContainer:le}=m.useContext(Cr),q=Ed(s),te=Object.assign(Object.assign({},B.Table),W),re=d||YVt,ae=Q("table",r),se=Q("dropdown",u),[,ne]=_u(),fe=O0(ae),[ge,de,Z]=BVt(ae,fe),he=Object.assign(Object.assign({childrenColumnName:C,expandIconColumnIndex:R},x),{expandIcon:(n=x==null?void 0:x.expandIcon)!==null&&n!==void 0?n:(o=X==null?void 0:X.expandable)===null||o===void 0?void 0:o.expandIcon}),{childrenColumnName:xe="children"}=he,He=m.useMemo(()=>re.some(kt=>kt==null?void 0:kt[xe])?"nest":S||x&&x.expandedRowRender?"row":null,[re]),Se={body:m.useRef()},ze=l_t(ae),Ie=m.useRef(null),ye=m.useRef(null);i_t(e,()=>Object.assign(Object.assign({},ye.current),{nativeElement:Ie.current}));const ce=m.useMemo(()=>typeof g=="function"?g:kt=>kt==null?void 0:kt[g],[g]),[pe]=dVt(re,xe,ce),ve={},Ae=function(kt,gt){let dt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var Ct,tt,Fe;const qe=Object.assign(Object.assign({},ve),kt);dt&&((Ct=ve.resetPagination)===null||Ct===void 0||Ct.call(ve),!((tt=qe.pagination)===null||tt===void 0)&&tt.current&&(qe.pagination.current=1),f&&f.onChange&&f.onChange(1,(Fe=qe.pagination)===null||Fe===void 0?void 0:Fe.pageSize)),D&&D.scrollToFirstRowOnChange!==!1&&Se.body.current&&qCt(0,{getContainer:()=>Se.body.current}),P==null||P(qe.pagination,qe.filters,qe.sorter,{currentDataSource:Iue(Due(re,qe.sorterStates,xe),qe.filterStates,xe),action:gt})},Te=(kt,gt)=>{Ae({sorter:kt,sorterStates:gt},"sort",!1)},[Me,Pe,Ee,Be]=xVt({prefixCls:ae,mergedColumns:U,onSorterChange:Te,sortDirections:E||["ascend","descend"],tableLocale:te,showSorterTooltip:j}),Je=m.useMemo(()=>Due(re,Pe,xe),[re,Pe]);ve.sorter=Be(),ve.sorterStates=Pe;const We=(kt,gt)=>{Ae({filters:kt,filterStates:gt},"filter",!0)},[Ke,Ne,De]=uVt({prefixCls:ae,locale:te,dropdownPrefixCls:se,mergedColumns:U,onFilterChange:We,getPopupContainer:v||le,rootClassName:Un(a,fe)}),ke=Iue(Je,Ne,xe);ve.filters=De,ve.filterStates=Ne;const Ye=m.useMemo(()=>{const kt={};return Object.keys(De).forEach(gt=>{De[gt]!==null&&(kt[gt]=De[gt])}),Object.assign(Object.assign({},Ee),{filters:kt})},[Ee,De]),[it]=bVt(Ye),Ve=(kt,gt)=>{Ae({pagination:Object.assign(Object.assign({},ve.pagination),{current:kt,pageSize:gt})},"paginate")},[yt,ct]=pVt(ke.length,Ve,f);ve.pagination=f===!1?{}:hVt(yt,f),ve.resetPagination=ct;const Xe=m.useMemo(()=>{if(f===!1||!yt.pageSize)return ke;const{current:kt=1,total:gt,pageSize:dt=BKe}=yt;return ke.lengthdt?ke.slice((kt-1)*dt,kt*dt):ke:ke.slice((kt-1)*dt,kt*dt)},[!!f,ke,yt&&yt.current,yt&&yt.pageSize,yt&&yt.total]),[ut,ft]=o_t({prefixCls:ae,data:ke,pageData:Xe,getRowKey:ce,getRecordByKey:pe,expandType:He,childrenColumnName:xe,locale:te,getPopupContainer:v||le},p),ot=(kt,gt,dt)=>{let Ct;return typeof y=="function"?Ct=Un(y(kt,gt,dt)):Ct=Un(y),Un({[`${ae}-row-selected`]:ft.has(ce(kt,gt))},Ct)};he.__PARENT_RENDER_ICON__=he.expandIcon,he.expandIcon=he.expandIcon||A||a_t(te),He==="nest"&&he.expandIconColumnIndex===void 0?he.expandIconColumnIndex=p?1:0:he.expandIconColumnIndex>0&&p&&(he.expandIconColumnIndex-=1),typeof he.indentSize!="number"&&(he.indentSize=typeof M=="number"?M:15);const st=m.useCallback(kt=>it(ut(Ke(Me(kt)))),[Me,Ke,ut]);let at,Oe;if(f!==!1&&(yt!=null&&yt.total)){let kt;yt.size?kt=yt.size:kt=q==="small"||q==="middle"?"small":void 0;const gt=tt=>m.createElement(JJe,Object.assign({},yt,{className:Un(`${ae}-pagination ${ae}-pagination-${tt}`,yt.className),size:kt})),dt=_==="rtl"?"left":"right",{position:Ct}=yt;if(Ct!==null&&Array.isArray(Ct)){const tt=Ct.find(je=>je.includes("top")),Fe=Ct.find(je=>je.includes("bottom")),qe=Ct.every(je=>`${je}`=="none");!tt&&!Fe&&!qe&&(Oe=gt(dt)),tt&&(at=gt(tt.toLowerCase().replace("top",""))),Fe&&(Oe=gt(Fe.toLowerCase().replace("bottom","")))}else Oe=gt(dt)}let Ze;typeof T=="boolean"?Ze={spinning:T}:typeof T=="object"&&(Ze=Object.assign({spinning:!0},T));const St=Un(Z,fe,`${ae}-wrapper`,X==null?void 0:X.className,{[`${ae}-wrapper-rtl`]:_==="rtl"},i,a,de),Pt=Object.assign(Object.assign({},X==null?void 0:X.style),l),Rt=W&&W.emptyText||($==null?void 0:$("Table"))||m.createElement(Eme,{componentName:"Table"}),Ut=L?TVt:SVt,Ht={},At=m.useMemo(()=>{const{fontSize:kt,lineHeight:gt,padding:dt,paddingXS:Ct,paddingSM:tt}=ne,Fe=Math.floor(kt*gt);switch(q){case"large":return dt*2+Fe;case"small":return Ct*2+Fe;default:return tt*2+Fe}},[ne,q]);return L&&(Ht.listItemHeight=At),ge(m.createElement("div",{ref:Ie,className:St,style:Pt},m.createElement($W,Object.assign({spinning:!1},Ze),at,m.createElement(Ut,Object.assign({},Ht,O,{ref:ye,columns:U,direction:_,expandable:he,prefixCls:ae,className:Un({[`${ae}-middle`]:q==="middle",[`${ae}-small`]:q==="small",[`${ae}-bordered`]:c,[`${ae}-empty`]:re.length===0},Z,fe,de),data:Xe,rowKey:ce,rowClassName:ot,emptyText:Rt,internalHooks:ZW,internalRefs:Se,transformColumns:st,getContainerWidth:ze})),Oe)))},_Vt=m.forwardRef(OVt),VVt=(t,e)=>{const n=m.useRef(0);return n.current+=1,m.createElement(_Vt,Object.assign({},t,{ref:e,_renderTimes:n.current}))},Fd=m.forwardRef(VVt);Fd.SELECTION_COLUMN=L4;Fd.EXPAND_COLUMN=J4;Fd.SELECTION_ALL=Pue;Fd.SELECTION_INVERT=Cue;Fd.SELECTION_NONE=Rue;Fd.Column=xOt;Fd.ColumnGroup=bOt;Fd.Summary=oKe;const GVt=t=>{const{paddingXXS:e,lineWidth:n,tagPaddingHorizontal:o,componentCls:r,calc:i}=t,a=i(o).sub(n).equal(),l=i(e).sub(n).equal();return{[r]:Object.assign(Object.assign({},ja(t)),{display:"inline-block",height:"auto",marginInlineEnd:t.marginXS,paddingInline:a,fontSize:t.tagFontSize,lineHeight:t.tagLineHeight,whiteSpace:"nowrap",background:t.defaultBg,border:`${Nt(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderRadius:t.borderRadiusSM,opacity:1,transition:`all ${t.motionDurationMid}`,textAlign:"start",position:"relative",[`&${r}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:t.defaultColor},[`${r}-close-icon`]:{marginInlineStart:l,fontSize:t.tagIconSize,color:t.colorTextDescription,cursor:"pointer",transition:`all ${t.motionDurationMid}`,"&:hover":{color:t.colorTextHeading}},[`&${r}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${t.iconCls}-close, ${t.iconCls}-close:hover`]:{color:t.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${r}-checkable-checked):hover`]:{color:t.colorPrimary,backgroundColor:t.colorFillSecondary},"&:active, &-checked":{color:t.colorTextLightSolid},"&-checked":{backgroundColor:t.colorPrimary,"&:hover":{backgroundColor:t.colorPrimaryHover}},"&:active":{backgroundColor:t.colorPrimaryActive}},"&-hidden":{display:"none"},[`> ${t.iconCls} + span, > span + ${t.iconCls}`]:{marginInlineStart:a}}),[`${r}-borderless`]:{borderColor:"transparent",background:t.tagBorderlessBg}}},Tye=t=>{const{lineWidth:e,fontSizeIcon:n,calc:o}=t,r=t.fontSizeSM;return Ki(t,{tagFontSize:r,tagLineHeight:Nt(o(t.lineHeightSM).mul(r).equal()),tagIconSize:o(n).sub(o(e).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:t.defaultBg})},Pye=t=>({defaultBg:new kl(t.colorFillQuaternary).onBackground(t.colorBgContainer).toHexString(),defaultColor:t.colorText}),VKe=wl("Tag",t=>{const e=Tye(t);return GVt(e)},Pye);var XVt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:n,style:o,className:r,checked:i,onChange:a,onClick:l}=t,s=XVt(t,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:c,tag:u}=m.useContext(Cr),d=b=>{a==null||a(!i),l==null||l(b)},f=c("tag",n),[p,g,y]=VKe(f),w=Un(f,`${f}-checkable`,{[`${f}-checkable-checked`]:i},u==null?void 0:u.className,r,g,y);return p(m.createElement("span",Object.assign({},s,{ref:e,style:Object.assign(Object.assign({},o),u==null?void 0:u.style),className:w,onClick:d})))}),KVt=t=>D$(t,(e,n)=>{let{textColor:o,lightBorderColor:r,lightColor:i,darkColor:a}=n;return{[`${t.componentCls}${t.componentCls}-${e}`]:{color:o,background:i,borderColor:r,"&-inverse":{color:t.colorTextLightSolid,background:a,borderColor:a},[`&${t.componentCls}-borderless`]:{borderColor:"transparent"}}}}),qVt=zW(["Tag","preset"],t=>{const e=Tye(t);return KVt(e)},Pye);function $Vt(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.slice(1)}const jY=(t,e,n)=>{const o=$Vt(n);return{[`${t.componentCls}${t.componentCls}-${e}`]:{color:t[`color${n}`],background:t[`color${o}Bg`],borderColor:t[`color${o}Border`],[`&${t.componentCls}-borderless`]:{borderColor:"transparent"}}}},QVt=zW(["Tag","status"],t=>{const e=Tye(t);return[jY(e,"success","Success"),jY(e,"processing","Info"),jY(e,"error","Error"),jY(e,"warning","Warning")]},Pye);var ZVt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:n,className:o,rootClassName:r,style:i,children:a,icon:l,color:s,onClose:c,bordered:u=!0,visible:d}=t,f=ZVt(t,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:p,direction:g,tag:y}=m.useContext(Cr),[w,b]=m.useState(!0),C=up(f,["closeIcon","closable"]);m.useEffect(()=>{d!==void 0&&b(d)},[d]);const P=q$(s),v=EEt(s),T=P||v,A=Object.assign(Object.assign({backgroundColor:s&&!T?s:void 0},y==null?void 0:y.style),i),x=p("tag",n),[S,R,M]=VKe(x),D=Un(x,y==null?void 0:y.className,{[`${x}-${s}`]:T,[`${x}-has-color`]:s&&!T,[`${x}-hidden`]:!w,[`${x}-rtl`]:g==="rtl",[`${x}-borderless`]:!u},o,r,R,M),E=F=>{F.stopPropagation(),c==null||c(F),!F.defaultPrevented&&b(!1)},[,W]=Pme(mR(t),mR(y),{closable:!1,closeIconRender:F=>{const U=m.createElement("span",{className:`${x}-close-icon`,onClick:E},F);return mVe(F,U,O=>({onClick:B=>{var _;(_=O==null?void 0:O.onClick)===null||_===void 0||_.call(O,B),E(B)},className:Un(O==null?void 0:O.className,`${x}-close-icon`)}))}}),j=typeof f.onClick=="function"||a&&a.type==="a",L=l||null,k=L?m.createElement(m.Fragment,null,L,a&&m.createElement("span",null,a)):a,N=m.createElement("span",Object.assign({},C,{ref:e,className:D,style:A}),k,W,P&&m.createElement(qVt,{key:"preset",prefixCls:x}),v&&m.createElement(QVt,{key:"status",prefixCls:x}));return S(j?m.createElement(FW,{component:"Tag"},N):N)}),GKe=eGt;GKe.CheckableTag=JVt;var tGt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);rm.createElement(oGt,Object.assign({},t,{picker:"time",mode:void 0,ref:e}))),nN=m.forwardRef((t,e)=>{var{addon:n,renderExtraFooter:o}=t,r=tGt(t,["addon","renderExtraFooter"]);const i=m.useMemo(()=>{if(o)return o;if(n)return n},[n,o]);return m.createElement(nGt,Object.assign({},r,{mode:void 0,ref:e,renderExtraFooter:i}))}),XKe=YW(nN,"picker");nN._InternalPanelDoNotUseOrYouWillBeFired=XKe;nN.RangePicker=rGt;nN._InternalPanelDoNotUseOrYouWillBeFired=XKe;var iGt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},aGt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:iGt}))},lGt=m.forwardRef(aGt),sGt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const n=u=>{const{keyCode:d}=u;d===fi.ENTER&&u.preventDefault()},o=u=>{const{keyCode:d}=u,{onClick:f}=t;d===fi.ENTER&&f&&f()},{style:r,noStyle:i,disabled:a,tabIndex:l=0}=t,s=sGt(t,["style","noStyle","disabled","tabIndex"]);let c={};return i||(c=Object.assign({},cGt)),a&&(c.pointerEvents="none"),c=Object.assign(Object.assign({},c),r),m.createElement("div",Object.assign({role:"button",tabIndex:l,ref:e},s,{onKeyDown:n,onKeyUp:o,style:c}))});var uGt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},dGt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:uGt}))},KKe=m.forwardRef(dGt),fGt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"},hGt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:fGt}))},pGt=m.forwardRef(hGt);const gGt=(t,e,n,o)=>{const{titleMarginBottom:r,fontWeightStrong:i}=o;return{marginBottom:r,color:n,fontWeight:i,fontSize:t,lineHeight:e}},mGt=t=>{const e=[1,2,3,4,5],n={};return e.forEach(o=>{n[` h${o}&, div&-h${o}, div&-h${o} > textarea, h${o} - `]=gGt(t[`fontSizeHeading${o}`],t[`lineHeightHeading${o}`],t.colorTextHeading,t)}),n},yGt=t=>{const{componentCls:e}=t;return{"a&, a":Object.assign(Object.assign({},fme(t)),{textDecoration:t.linkDecoration,"&:active, &:hover":{textDecoration:t.linkHoverDecoration},[`&[disabled], &${e}-disabled`]:{color:t.colorTextDisabled,cursor:"not-allowed","&:active, &:hover":{color:t.colorTextDisabled},"&:active":{pointerEvents:"none"}}})}},AGt=t=>({code:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.2em 0.1em",fontSize:"85%",fontFamily:t.fontFamilyCode,background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3},kbd:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.15em 0.1em",fontSize:"90%",fontFamily:t.fontFamilyCode,background:"rgba(150, 150, 150, 0.06)",border:"1px solid rgba(100, 100, 100, 0.2)",borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:kTt[2]},"u, ins":{textDecoration:"underline",textDecorationSkipInk:"auto"},"s, del":{textDecoration:"line-through"},strong:{fontWeight:600},"ul, ol":{marginInline:0,marginBlock:"0 1em",padding:0,li:{marginInline:"20px 0",marginBlock:0,paddingInline:"4px 0",paddingBlock:0}},ul:{listStyleType:"circle",ul:{listStyleType:"disc"}},ol:{listStyleType:"decimal"},"pre, blockquote":{margin:"1em 0"},pre:{padding:"0.4em 0.6em",whiteSpace:"pre-wrap",wordWrap:"break-word",background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3,fontFamily:t.fontFamilyCode,code:{display:"inline",margin:0,padding:0,fontSize:"inherit",fontFamily:"inherit",background:"transparent",border:0}},blockquote:{paddingInline:"0.6em 0",paddingBlock:0,borderInlineStart:"4px solid rgba(100, 100, 100, 0.2)",opacity:.85}}),wGt=t=>{const{componentCls:e,paddingSM:n}=t,o=n;return{"&-edit-content":{position:"relative","div&":{insetInlineStart:t.calc(t.paddingSM).mul(-1).equal(),marginTop:t.calc(o).mul(-1).equal(),marginBottom:`calc(1em - ${Nt(o)})`},[`${e}-edit-content-confirm`]:{position:"absolute",insetInlineEnd:t.calc(t.marginXS).add(2).equal(),insetBlockEnd:t.marginXS,color:t.colorTextDescription,fontWeight:"normal",fontSize:t.fontSize,fontStyle:"normal",pointerEvents:"none"},textarea:{margin:"0!important",MozTransition:"none",height:"1em"}}}},vGt=t=>({[`${t.componentCls}-copy-success`]:{"\n &,\n &:hover,\n &:focus":{color:t.colorSuccess}},[`${t.componentCls}-copy-icon-only`]:{marginInlineStart:0}}),xGt=()=>({"\n a&-ellipsis,\n span&-ellipsis\n ":{display:"inline-block",maxWidth:"100%"},"&-single-line":{whiteSpace:"nowrap"},"&-ellipsis-single-line":{overflow:"hidden",textOverflow:"ellipsis","a&, span&":{verticalAlign:"bottom"},"> code":{paddingBlock:0,maxWidth:"calc(100% - 1.2em)",display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"bottom",boxSizing:"content-box"}},"&-ellipsis-multiple-line":{display:"-webkit-box",overflow:"hidden",WebkitLineClamp:3,WebkitBoxOrient:"vertical"}}),bGt=t=>{const{componentCls:e,titleMarginTop:n}=t;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:t.colorText,wordBreak:"break-word",lineHeight:t.lineHeight,[`&${e}-secondary`]:{color:t.colorTextDescription},[`&${e}-success`]:{color:t.colorSuccess},[`&${e}-warning`]:{color:t.colorWarning},[`&${e}-danger`]:{color:t.colorError,"a&:active, a&:focus":{color:t.colorErrorActive},"a&:hover":{color:t.colorErrorHover}},[`&${e}-disabled`]:{color:t.colorTextDisabled,cursor:"not-allowed",userSelect:"none"},"\n div&,\n p\n ":{marginBottom:"1em"}},mGt(t)),{[` + `]=gGt(t[`fontSizeHeading${o}`],t[`lineHeightHeading${o}`],t.colorTextHeading,t)}),n},yGt=t=>{const{componentCls:e}=t;return{"a&, a":Object.assign(Object.assign({},hme(t)),{textDecoration:t.linkDecoration,"&:active, &:hover":{textDecoration:t.linkHoverDecoration},[`&[disabled], &${e}-disabled`]:{color:t.colorTextDisabled,cursor:"not-allowed","&:active, &:hover":{color:t.colorTextDisabled},"&:active":{pointerEvents:"none"}}})}},AGt=t=>({code:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.2em 0.1em",fontSize:"85%",fontFamily:t.fontFamilyCode,background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3},kbd:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.15em 0.1em",fontSize:"90%",fontFamily:t.fontFamilyCode,background:"rgba(150, 150, 150, 0.06)",border:"1px solid rgba(100, 100, 100, 0.2)",borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:kTt[2]},"u, ins":{textDecoration:"underline",textDecorationSkipInk:"auto"},"s, del":{textDecoration:"line-through"},strong:{fontWeight:600},"ul, ol":{marginInline:0,marginBlock:"0 1em",padding:0,li:{marginInline:"20px 0",marginBlock:0,paddingInline:"4px 0",paddingBlock:0}},ul:{listStyleType:"circle",ul:{listStyleType:"disc"}},ol:{listStyleType:"decimal"},"pre, blockquote":{margin:"1em 0"},pre:{padding:"0.4em 0.6em",whiteSpace:"pre-wrap",wordWrap:"break-word",background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3,fontFamily:t.fontFamilyCode,code:{display:"inline",margin:0,padding:0,fontSize:"inherit",fontFamily:"inherit",background:"transparent",border:0}},blockquote:{paddingInline:"0.6em 0",paddingBlock:0,borderInlineStart:"4px solid rgba(100, 100, 100, 0.2)",opacity:.85}}),wGt=t=>{const{componentCls:e,paddingSM:n}=t,o=n;return{"&-edit-content":{position:"relative","div&":{insetInlineStart:t.calc(t.paddingSM).mul(-1).equal(),marginTop:t.calc(o).mul(-1).equal(),marginBottom:`calc(1em - ${Nt(o)})`},[`${e}-edit-content-confirm`]:{position:"absolute",insetInlineEnd:t.calc(t.marginXS).add(2).equal(),insetBlockEnd:t.marginXS,color:t.colorTextDescription,fontWeight:"normal",fontSize:t.fontSize,fontStyle:"normal",pointerEvents:"none"},textarea:{margin:"0!important",MozTransition:"none",height:"1em"}}}},vGt=t=>({[`${t.componentCls}-copy-success`]:{"\n &,\n &:hover,\n &:focus":{color:t.colorSuccess}},[`${t.componentCls}-copy-icon-only`]:{marginInlineStart:0}}),xGt=()=>({"\n a&-ellipsis,\n span&-ellipsis\n ":{display:"inline-block",maxWidth:"100%"},"&-single-line":{whiteSpace:"nowrap"},"&-ellipsis-single-line":{overflow:"hidden",textOverflow:"ellipsis","a&, span&":{verticalAlign:"bottom"},"> code":{paddingBlock:0,maxWidth:"calc(100% - 1.2em)",display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"bottom",boxSizing:"content-box"}},"&-ellipsis-multiple-line":{display:"-webkit-box",overflow:"hidden",WebkitLineClamp:3,WebkitBoxOrient:"vertical"}}),bGt=t=>{const{componentCls:e,titleMarginTop:n}=t;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:t.colorText,wordBreak:"break-word",lineHeight:t.lineHeight,[`&${e}-secondary`]:{color:t.colorTextDescription},[`&${e}-success`]:{color:t.colorSuccess},[`&${e}-warning`]:{color:t.colorWarning},[`&${e}-danger`]:{color:t.colorError,"a&:active, a&:focus":{color:t.colorErrorActive},"a&:hover":{color:t.colorErrorHover}},[`&${e}-disabled`]:{color:t.colorTextDisabled,cursor:"not-allowed",userSelect:"none"},"\n div&,\n p\n ":{marginBottom:"1em"}},mGt(t)),{[` & + h1${e}, & + h2${e}, & + h3${e}, @@ -4753,7 +4753,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho ${e}-collapse, ${e}-edit, ${e}-copy - `]:Object.assign(Object.assign({},fme(t)),{marginInlineStart:t.marginXXS})}),wGt(t)),vGt(t)),xGt()),{"&-rtl":{direction:"rtl"}})}},SGt=()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"}),qKe=wl("Typography",t=>[bGt(t)],SGt),TGt=t=>{const{prefixCls:e,"aria-label":n,className:o,style:r,direction:i,maxLength:a,autoSize:l=!0,value:s,onSave:c,onCancel:u,onEnd:d,component:f,enterIcon:p=m.createElement(pGt,null)}=t,g=m.useRef(null),y=m.useRef(!1),w=m.useRef(),[b,C]=m.useState(s);m.useEffect(()=>{C(s)},[s]),m.useEffect(()=>{if(g.current&&g.current.resizableTextArea){const{textArea:L}=g.current.resizableTextArea;L.focus();const{length:k}=L.value;L.setSelectionRange(k,k)}},[]);const P=L=>{let{target:k}=L;C(k.value.replace(/[\n\r]/g,""))},v=()=>{y.current=!0},T=()=>{y.current=!1},A=L=>{let{keyCode:k}=L;y.current||(w.current=k)},x=()=>{c(b.trim())},S=L=>{let{keyCode:k,ctrlKey:N,altKey:F,metaKey:U,shiftKey:O}=L;w.current===k&&!y.current&&!N&&!F&&!U&&!O&&(k===fi.ENTER?(x(),d==null||d()):k===fi.ESC&&u())},R=()=>{x()},M=f?`${e}-${f}`:"",[D,E,W]=qKe(e),j=Un(e,`${e}-edit-content`,{[`${e}-rtl`]:i==="rtl"},o,M,E,W);return D(m.createElement("div",{className:j,style:r},m.createElement(HJe,{ref:g,maxLength:a,value:b,onChange:P,onKeyDown:A,onKeyUp:S,onCompositionStart:v,onCompositionEnd:T,onBlur:R,"aria-label":n,rows:1,autoSize:l}),p!==null?B0(p,{className:`${e}-edit-content-confirm`}):null))};var PGt=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,n=[],o=0;o"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var d=vbe[e.format]||vbe.default;window.clipboardData.setData(d,t)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,t);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(l),i.selectNodeContents(l),a.addRange(i);var c=document.execCommand("copy");if(!c)throw new Error("copy command was unsuccessful");s=!0}catch(u){n&&console.error("unable to copy using execCommand: ",u),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),s=!0}catch(d){n&&console.error("unable to copy using clipboardData: ",d),n&&console.error("falling back to prompt"),o=HGt("message"in e?e.message:RGt),window.prompt(o,t)}}finally{a&&(typeof a.removeRange=="function"?a.removeRange(i):a.removeAllRanges()),l&&document.body.removeChild(l),r()}return s}var IGt=MGt;const zGt=Fi(IGt);var DGt=function(t,e,n,o){function r(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function l(u){try{c(o.next(u))}catch(d){a(d)}}function s(u){try{c(o.throw(u))}catch(d){a(d)}}function c(u){u.done?i(u.value):r(u.value).then(l,s)}c((o=o.apply(t,e||[])).next())})};const EGt=t=>{let{copyConfig:e,children:n}=t;const[o,r]=m.useState(!1),[i,a]=m.useState(!1),l=m.useRef(null),s=()=>{l.current&&clearTimeout(l.current)},c={};e.format&&(c.format=e.format),m.useEffect(()=>s,[]);const u=q6(d=>DGt(void 0,void 0,void 0,function*(){var f;d==null||d.preventDefault(),d==null||d.stopPropagation(),a(!0);try{const p=typeof e.text=="function"?yield e.text():e.text;zGt(p||String(n)||"",c),a(!1),r(!0),s(),l.current=setTimeout(()=>{r(!1)},3e3),(f=e.onCopy)===null||f===void 0||f.call(e,d)}catch(p){throw a(!1),p}}));return{copied:o,copyLoading:i,onClick:u}};function bie(t,e){return m.useMemo(()=>{const n=!!t;return[n,Object.assign(Object.assign({},e),n&&typeof t=="object"?t:null)]},[t])}const FGt=(t,e)=>{const n=m.useRef(!1);m.useEffect(()=>{n.current?t():n.current=!0},e)},kGt=t=>{const e=m.useRef();return m.useEffect(()=>{e.current=t}),e.current};var LGt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:n,component:o="article",className:r,rootClassName:i,setContentRef:a,children:l,direction:s,style:c}=t,u=LGt(t,["prefixCls","component","className","rootClassName","setContentRef","children","direction","style"]),{getPrefixCls:d,direction:f,typography:p}=m.useContext(Cr),g=s??f;let y=e;a&&(y=o5(e,a));const w=d("typography",n),[b,C,P]=qKe(w),v=Un(w,p==null?void 0:p.className,{[`${w}-rtl`]:g==="rtl"},r,i,C,P),T=Object.assign(Object.assign({},p==null?void 0:p.style),c);return b(m.createElement(o,Object.assign({className:v,style:T,ref:y},u),l))});var WGt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},NGt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:WGt}))},QKe=m.forwardRef(NGt);function xbe(t){return t===!1?[!1,!1]:Array.isArray(t)?t:[t]}function jY(t,e,n){return t===!0||t===void 0?e:t||n&&e}const UGt=t=>{const{prefixCls:e,copied:n,locale:o,iconOnly:r,tooltips:i,icon:a,loading:l,tabIndex:s,onCopy:c}=t,u=xbe(i),d=xbe(a),{copied:f,copy:p}=o??{},g=n?jY(u[1],f):jY(u[0],p),w=typeof g=="string"?g:n?f:p;return m.createElement(tA,{key:"copy",title:g},m.createElement(JKe,{className:Un(`${e}-copy`,{[`${e}-copy-success`]:n,[`${e}-copy-icon-only`]:r}),onClick:c,"aria-label":w,tabIndex:s},n?jY(d[1],m.createElement(LGe,null),!0):jY(d[0],l?m.createElement(UH,null):m.createElement(QKe,null),!0)))},BY=m.forwardRef((t,e)=>{let{style:n,children:o}=t;const r=m.useRef(null);return m.useImperativeHandle(e,()=>({isExceed:()=>{const i=r.current;return i.scrollHeight>i.clientHeight},getHeight:()=>r.current.clientHeight})),m.createElement("span",{"aria-hidden":!0,ref:r,style:Object.assign({position:"fixed",display:"block",left:0,top:0,pointerEvents:"none",backgroundColor:"rgba(255, 0, 0, 0.65)"},n)},o)});function ZKe(t){const e=typeof t;return e==="string"||e==="number"}function jGt(t){let e=0;return t.forEach(n=>{ZKe(n)?e+=String(n).length:e+=1}),e}function bbe(t,e){let n=0;const o=[];for(let r=0;re){const c=e-n;return o.push(String(i).slice(0,c)),o}o.push(i),n=s}return t}const Sie=0,Tie=1,Pie=2,Sbe=3,YY={display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical"};function BGt(t){const{enableMeasure:e,width:n,text:o,children:r,rows:i,expanded:a,miscDeps:l,onEllipsis:s}=t,c=m.useMemo(()=>B9(o),[o]),u=m.useMemo(()=>jGt(c),[o]),d=m.useMemo(()=>r(c,!1),[o]),[f,p]=m.useState(null),g=m.useRef(null),y=m.useRef(null),w=m.useRef(null),b=m.useRef(null),[C,P]=m.useState(!1),[v,T]=m.useState(Sie),[A,x]=m.useState(0);gx(()=>{T(e&&n&&u?Tie:Sie)},[n,o,i,e,c]),gx(()=>{var D,E,W,j;if(v===Tie){const L=!!(!((D=y.current)===null||D===void 0)&&D.isExceed());T(L?Pie:Sbe),p(L?[0,u]:null),P(L);const k=((E=y.current)===null||E===void 0?void 0:E.getHeight())||0,N=i===1?0:((W=w.current)===null||W===void 0?void 0:W.getHeight())||0,F=((j=b.current)===null||j===void 0?void 0:j.getHeight())||0,U=N+F,O=Math.max(k,U);x(O+1),s(L)}},[v]);const S=f?Math.ceil((f[0]+f[1])/2):0;gx(()=>{var D;const[E,W]=f||[0,0];if(E!==W){const L=(((D=g.current)===null||D===void 0?void 0:D.getHeight())||0)>A;let k=S;W-E===1&&(k=L?E:W),p(L?[E,k]:[k,W])}},[f,S]);const R=m.useMemo(()=>{if(v!==Pie||!f||f[0]!==f[1]){const D=r(c,!1);return v!==Sbe&&v!==Sie?m.createElement("span",{style:Object.assign(Object.assign({},YY),{WebkitLineClamp:i})},D):D}return r(a?c:bbe(c,f[0]),C)},[a,v,f,c].concat(Za(l))),M={width:n,whiteSpace:"normal",margin:0,padding:0};return m.createElement(m.Fragment,null,R,v===Tie&&m.createElement(m.Fragment,null,m.createElement(BY,{style:Object.assign(Object.assign(Object.assign({},M),YY),{WebkitLineClamp:i}),ref:y},d),m.createElement(BY,{style:Object.assign(Object.assign(Object.assign({},M),YY),{WebkitLineClamp:i-1}),ref:w},d),m.createElement(BY,{style:Object.assign(Object.assign(Object.assign({},M),YY),{WebkitLineClamp:1}),ref:b},r([],!0))),v===Pie&&f&&f[0]!==f[1]&&m.createElement(BY,{style:Object.assign(Object.assign({},M),{top:400}),ref:g},r(bbe(c,S),!0)))}const YGt=t=>{let{enableEllipsis:e,isEllipsis:n,children:o,tooltipProps:r}=t;return!(r!=null&&r.title)||!e?o:m.createElement(tA,Object.assign({open:n?void 0:!1},r),o)};var OGt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n,o,r;const{prefixCls:i,className:a,style:l,type:s,disabled:c,children:u,ellipsis:d,editable:f,copyable:p,component:g,title:y}=t,w=OGt(t,["prefixCls","className","style","type","disabled","children","ellipsis","editable","copyable","component","title"]),{getPrefixCls:b,direction:C}=m.useContext(Cr),[P]=kw("Text"),v=m.useRef(null),T=m.useRef(null),A=b("typography",i),x=up(w,["mark","code","delete","underline","strong","keyboard","italic"]),[S,R]=bie(f),[M,D]=$6(!1,{value:R.editing}),{triggerType:E=["icon"]}=R,W=ke=>{var Ye;ke&&((Ye=R.onStart)===null||Ye===void 0||Ye.call(R)),D(ke)},j=kGt(M);FGt(()=>{var ke;!M&&j&&((ke=T.current)===null||ke===void 0||ke.focus())},[M]);const L=ke=>{ke==null||ke.preventDefault(),W(!0)},k=ke=>{var Ye;(Ye=R.onChange)===null||Ye===void 0||Ye.call(R,ke),W(!1)},N=()=>{var ke;(ke=R.onCancel)===null||ke===void 0||ke.call(R),W(!1)},[F,U]=bie(p),{copied:O,copyLoading:B,onClick:_}=EGt({copyConfig:U,children:u}),[X,$]=m.useState(!1),[Q,le]=m.useState(!1),[q,te]=m.useState(!1),[re,ae]=m.useState(!1),[se,ne]=m.useState(!0),[fe,ge]=bie(d,{expandable:!1,symbol:ke=>ke?P==null?void 0:P.collapse:P==null?void 0:P.expand}),[de,Z]=$6(ge.defaultExpanded||!1,{value:ge.expanded}),he=fe&&(!de||ge.expandable==="collapsible"),{rows:xe=1}=ge,He=m.useMemo(()=>he&&(ge.suffix!==void 0||ge.onEllipsis||ge.expandable||S||F),[he,ge,S,F]);gx(()=>{fe&&!He&&($(X7e("webkitLineClamp")),le(X7e("textOverflow")))},[He,fe]);const[Se,ze]=m.useState(he),Ie=m.useMemo(()=>He?!1:xe===1?Q:X,[He,Q,X]);gx(()=>{ze(Ie&&he)},[Ie,he]);const ye=he&&(Se?re:q),ce=he&&xe===1&&Se,pe=he&&xe>1&&Se,ve=(ke,Ye)=>{var it;Z(Ye.expanded),(it=ge.onExpand)===null||it===void 0||it.call(ge,ke,Ye)},[Ae,Te]=m.useState(0),Me=ke=>{let{offsetWidth:Ye}=ke;Te(Ye)},Pe=ke=>{var Ye;te(ke),q!==ke&&((Ye=ge.onEllipsis)===null||Ye===void 0||Ye.call(ge,ke))};m.useEffect(()=>{const ke=v.current;if(fe&&Se&&ke){const Ye=pe?ke.offsetHeight{const ke=v.current;if(typeof IntersectionObserver>"u"||!ke||!Se||!he)return;const Ye=new IntersectionObserver(()=>{ne(!!ke.offsetParent)});return Ye.observe(ke),()=>{Ye.disconnect()}},[Se,he]);let Ee={};ge.tooltip===!0?Ee={title:(n=R.text)!==null&&n!==void 0?n:u}:m.isValidElement(ge.tooltip)?Ee={title:ge.tooltip}:typeof ge.tooltip=="object"?Ee=Object.assign({title:(o=R.text)!==null&&o!==void 0?o:u},ge.tooltip):Ee={title:ge.tooltip};const Be=m.useMemo(()=>{const ke=Ye=>["string","number"].includes(typeof Ye);if(!(!fe||Se)){if(ke(R.text))return R.text;if(ke(u))return u;if(ke(y))return y;if(ke(Ee.title))return Ee.title}},[fe,Se,y,Ee.title,ye]);if(M)return m.createElement(TGt,{value:(r=R.text)!==null&&r!==void 0?r:typeof u=="string"?u:"",onSave:k,onCancel:N,onEnd:R.onEnd,prefixCls:A,className:a,style:l,direction:C,component:g,maxLength:R.maxLength,autoSize:R.autoSize,enterIcon:R.enterIcon});const Je=()=>{const{expandable:ke,symbol:Ye}=ge;return!ke||de&&ke!=="collapsible"?null:m.createElement("a",{key:"expand",className:`${A}-${de?"collapse":"expand"}`,onClick:it=>ve(it,{expanded:!de}),"aria-label":de?P.collapse:P==null?void 0:P.expand},typeof Ye=="function"?Ye(de):Ye)},We=()=>{if(!S)return;const{icon:ke,tooltip:Ye,tabIndex:it}=R,Ve=B9(Ye)[0]||(P==null?void 0:P.edit),yt=typeof Ve=="string"?Ve:"";return E.includes("icon")?m.createElement(tA,{key:"edit",title:Ye===!1?"":Ve},m.createElement(JKe,{ref:T,className:`${A}-edit`,onClick:L,"aria-label":yt,tabIndex:it},ke||m.createElement(KKe,{role:"button"}))):null},Ke=()=>F?m.createElement(UGt,Object.assign({key:"copy"},U,{prefixCls:A,copied:O,locale:P,onCopy:_,loading:B,iconOnly:u==null})):null,Ne=ke=>[ke&&Je(),We(),Ke()],De=ke=>[ke&&!de&&m.createElement("span",{"aria-hidden":!0,key:"ellipsis"},VGt),ge.suffix,Ne(ke)];return m.createElement(Td,{onResize:Me,disabled:!he},ke=>m.createElement(YGt,{tooltipProps:Ee,enableEllipsis:he,isEllipsis:ye},m.createElement($Ke,Object.assign({className:Un({[`${A}-${s}`]:s,[`${A}-disabled`]:c,[`${A}-ellipsis`]:fe,[`${A}-single-line`]:he&&xe===1&&!de,[`${A}-ellipsis-single-line`]:ce,[`${A}-ellipsis-multiple-line`]:pe},a),prefixCls:i,style:Object.assign(Object.assign({},l),{WebkitLineClamp:pe?xe:void 0}),component:g,ref:o5(ke,v,e),direction:C,onClick:E.includes("text")?L:void 0,"aria-label":Be==null?void 0:Be.toString(),title:y},x),m.createElement(BGt,{enableMeasure:he&&!Se,text:u,rows:xe,width:Ae,onEllipsis:Pe,expanded:de,miscDeps:[O,de,B,S,F]},(Ye,it)=>_Gt(t,m.createElement(m.Fragment,null,Ye.length>0&&it&&!de&&Be?m.createElement("span",{key:"show-content","aria-hidden":!0},Ye):Ye,De(it)))))))});var GGt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var{ellipsis:n,rel:o}=t,r=GGt(t,["ellipsis","rel"]);const i=Object.assign(Object.assign({},r),{rel:o===void 0&&r.target==="_blank"?"noopener noreferrer":o});return delete i.navigate,m.createElement(gQ,Object.assign({},i,{ref:e,ellipsis:!!n,component:"a"}))}),JGt=m.forwardRef((t,e)=>m.createElement(gQ,Object.assign({ref:e},t,{component:"div"})));var KGt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var{ellipsis:n}=t,o=KGt(t,["ellipsis"]);const r=m.useMemo(()=>n&&typeof n=="object"?up(n,["expandable","rows"]):n,[n]);return m.createElement(gQ,Object.assign({ref:e},o,{ellipsis:r,component:"span"}))},$Gt=m.forwardRef(qGt);var QGt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{level:n=1}=t,o=QGt(t,["level"]);let r;return ZGt.includes(n)?r=`h${n}`:r="h1",m.createElement(gQ,Object.assign({ref:e},o,{component:r}))}),F6=$Ke;F6.Text=$Gt;F6.Link=XGt;F6.Title=eXt;F6.Paragraph=JGt;/*! + `]:Object.assign(Object.assign({},hme(t)),{marginInlineStart:t.marginXXS})}),wGt(t)),vGt(t)),xGt()),{"&-rtl":{direction:"rtl"}})}},SGt=()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"}),qKe=wl("Typography",t=>[bGt(t)],SGt),TGt=t=>{const{prefixCls:e,"aria-label":n,className:o,style:r,direction:i,maxLength:a,autoSize:l=!0,value:s,onSave:c,onCancel:u,onEnd:d,component:f,enterIcon:p=m.createElement(pGt,null)}=t,g=m.useRef(null),y=m.useRef(!1),w=m.useRef(),[b,C]=m.useState(s);m.useEffect(()=>{C(s)},[s]),m.useEffect(()=>{if(g.current&&g.current.resizableTextArea){const{textArea:L}=g.current.resizableTextArea;L.focus();const{length:k}=L.value;L.setSelectionRange(k,k)}},[]);const P=L=>{let{target:k}=L;C(k.value.replace(/[\n\r]/g,""))},v=()=>{y.current=!0},T=()=>{y.current=!1},A=L=>{let{keyCode:k}=L;y.current||(w.current=k)},x=()=>{c(b.trim())},S=L=>{let{keyCode:k,ctrlKey:N,altKey:F,metaKey:U,shiftKey:O}=L;w.current===k&&!y.current&&!N&&!F&&!U&&!O&&(k===fi.ENTER?(x(),d==null||d()):k===fi.ESC&&u())},R=()=>{x()},M=f?`${e}-${f}`:"",[D,E,W]=qKe(e),j=Un(e,`${e}-edit-content`,{[`${e}-rtl`]:i==="rtl"},o,M,E,W);return D(m.createElement("div",{className:j,style:r},m.createElement(HJe,{ref:g,maxLength:a,value:b,onChange:P,onKeyDown:A,onKeyUp:S,onCompositionStart:v,onCompositionEnd:T,onBlur:R,"aria-label":n,rows:1,autoSize:l}),p!==null?B0(p,{className:`${e}-edit-content-confirm`}):null))};var PGt=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,n=[],o=0;o"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var d=xbe[e.format]||xbe.default;window.clipboardData.setData(d,t)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,t);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(l),i.selectNodeContents(l),a.addRange(i);var c=document.execCommand("copy");if(!c)throw new Error("copy command was unsuccessful");s=!0}catch(u){n&&console.error("unable to copy using execCommand: ",u),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),s=!0}catch(d){n&&console.error("unable to copy using clipboardData: ",d),n&&console.error("falling back to prompt"),o=HGt("message"in e?e.message:RGt),window.prompt(o,t)}}finally{a&&(typeof a.removeRange=="function"?a.removeRange(i):a.removeAllRanges()),l&&document.body.removeChild(l),r()}return s}var IGt=MGt;const zGt=Fi(IGt);var DGt=function(t,e,n,o){function r(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function l(u){try{c(o.next(u))}catch(d){a(d)}}function s(u){try{c(o.throw(u))}catch(d){a(d)}}function c(u){u.done?i(u.value):r(u.value).then(l,s)}c((o=o.apply(t,e||[])).next())})};const EGt=t=>{let{copyConfig:e,children:n}=t;const[o,r]=m.useState(!1),[i,a]=m.useState(!1),l=m.useRef(null),s=()=>{l.current&&clearTimeout(l.current)},c={};e.format&&(c.format=e.format),m.useEffect(()=>s,[]);const u=q6(d=>DGt(void 0,void 0,void 0,function*(){var f;d==null||d.preventDefault(),d==null||d.stopPropagation(),a(!0);try{const p=typeof e.text=="function"?yield e.text():e.text;zGt(p||String(n)||"",c),a(!1),r(!0),s(),l.current=setTimeout(()=>{r(!1)},3e3),(f=e.onCopy)===null||f===void 0||f.call(e,d)}catch(p){throw a(!1),p}}));return{copied:o,copyLoading:i,onClick:u}};function bie(t,e){return m.useMemo(()=>{const n=!!t;return[n,Object.assign(Object.assign({},e),n&&typeof t=="object"?t:null)]},[t])}const FGt=(t,e)=>{const n=m.useRef(!1);m.useEffect(()=>{n.current?t():n.current=!0},e)},kGt=t=>{const e=m.useRef();return m.useEffect(()=>{e.current=t}),e.current};var LGt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{prefixCls:n,component:o="article",className:r,rootClassName:i,setContentRef:a,children:l,direction:s,style:c}=t,u=LGt(t,["prefixCls","component","className","rootClassName","setContentRef","children","direction","style"]),{getPrefixCls:d,direction:f,typography:p}=m.useContext(Cr),g=s??f;let y=e;a&&(y=o5(e,a));const w=d("typography",n),[b,C,P]=qKe(w),v=Un(w,p==null?void 0:p.className,{[`${w}-rtl`]:g==="rtl"},r,i,C,P),T=Object.assign(Object.assign({},p==null?void 0:p.style),c);return b(m.createElement(o,Object.assign({className:v,style:T,ref:y},u),l))});var WGt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},NGt=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:WGt}))},QKe=m.forwardRef(NGt);function bbe(t){return t===!1?[!1,!1]:Array.isArray(t)?t:[t]}function BY(t,e,n){return t===!0||t===void 0?e:t||n&&e}const UGt=t=>{const{prefixCls:e,copied:n,locale:o,iconOnly:r,tooltips:i,icon:a,loading:l,tabIndex:s,onCopy:c}=t,u=bbe(i),d=bbe(a),{copied:f,copy:p}=o??{},g=n?BY(u[1],f):BY(u[0],p),w=typeof g=="string"?g:n?f:p;return m.createElement(tA,{key:"copy",title:g},m.createElement(JKe,{className:Un(`${e}-copy`,{[`${e}-copy-success`]:n,[`${e}-copy-icon-only`]:r}),onClick:c,"aria-label":w,tabIndex:s},n?BY(d[1],m.createElement(LGe,null),!0):BY(d[0],l?m.createElement(UH,null):m.createElement(QKe,null),!0)))},YY=m.forwardRef((t,e)=>{let{style:n,children:o}=t;const r=m.useRef(null);return m.useImperativeHandle(e,()=>({isExceed:()=>{const i=r.current;return i.scrollHeight>i.clientHeight},getHeight:()=>r.current.clientHeight})),m.createElement("span",{"aria-hidden":!0,ref:r,style:Object.assign({position:"fixed",display:"block",left:0,top:0,pointerEvents:"none",backgroundColor:"rgba(255, 0, 0, 0.65)"},n)},o)});function ZKe(t){const e=typeof t;return e==="string"||e==="number"}function jGt(t){let e=0;return t.forEach(n=>{ZKe(n)?e+=String(n).length:e+=1}),e}function Sbe(t,e){let n=0;const o=[];for(let r=0;re){const c=e-n;return o.push(String(i).slice(0,c)),o}o.push(i),n=s}return t}const Sie=0,Tie=1,Pie=2,Tbe=3,OY={display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical"};function BGt(t){const{enableMeasure:e,width:n,text:o,children:r,rows:i,expanded:a,miscDeps:l,onEllipsis:s}=t,c=m.useMemo(()=>B9(o),[o]),u=m.useMemo(()=>jGt(c),[o]),d=m.useMemo(()=>r(c,!1),[o]),[f,p]=m.useState(null),g=m.useRef(null),y=m.useRef(null),w=m.useRef(null),b=m.useRef(null),[C,P]=m.useState(!1),[v,T]=m.useState(Sie),[A,x]=m.useState(0);gx(()=>{T(e&&n&&u?Tie:Sie)},[n,o,i,e,c]),gx(()=>{var D,E,W,j;if(v===Tie){const L=!!(!((D=y.current)===null||D===void 0)&&D.isExceed());T(L?Pie:Tbe),p(L?[0,u]:null),P(L);const k=((E=y.current)===null||E===void 0?void 0:E.getHeight())||0,N=i===1?0:((W=w.current)===null||W===void 0?void 0:W.getHeight())||0,F=((j=b.current)===null||j===void 0?void 0:j.getHeight())||0,U=N+F,O=Math.max(k,U);x(O+1),s(L)}},[v]);const S=f?Math.ceil((f[0]+f[1])/2):0;gx(()=>{var D;const[E,W]=f||[0,0];if(E!==W){const L=(((D=g.current)===null||D===void 0?void 0:D.getHeight())||0)>A;let k=S;W-E===1&&(k=L?E:W),p(L?[E,k]:[k,W])}},[f,S]);const R=m.useMemo(()=>{if(v!==Pie||!f||f[0]!==f[1]){const D=r(c,!1);return v!==Tbe&&v!==Sie?m.createElement("span",{style:Object.assign(Object.assign({},OY),{WebkitLineClamp:i})},D):D}return r(a?c:Sbe(c,f[0]),C)},[a,v,f,c].concat(Za(l))),M={width:n,whiteSpace:"normal",margin:0,padding:0};return m.createElement(m.Fragment,null,R,v===Tie&&m.createElement(m.Fragment,null,m.createElement(YY,{style:Object.assign(Object.assign(Object.assign({},M),OY),{WebkitLineClamp:i}),ref:y},d),m.createElement(YY,{style:Object.assign(Object.assign(Object.assign({},M),OY),{WebkitLineClamp:i-1}),ref:w},d),m.createElement(YY,{style:Object.assign(Object.assign(Object.assign({},M),OY),{WebkitLineClamp:1}),ref:b},r([],!0))),v===Pie&&f&&f[0]!==f[1]&&m.createElement(YY,{style:Object.assign(Object.assign({},M),{top:400}),ref:g},r(Sbe(c,S),!0)))}const YGt=t=>{let{enableEllipsis:e,isEllipsis:n,children:o,tooltipProps:r}=t;return!(r!=null&&r.title)||!e?o:m.createElement(tA,Object.assign({open:n?void 0:!1},r),o)};var OGt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var n,o,r;const{prefixCls:i,className:a,style:l,type:s,disabled:c,children:u,ellipsis:d,editable:f,copyable:p,component:g,title:y}=t,w=OGt(t,["prefixCls","className","style","type","disabled","children","ellipsis","editable","copyable","component","title"]),{getPrefixCls:b,direction:C}=m.useContext(Cr),[P]=kw("Text"),v=m.useRef(null),T=m.useRef(null),A=b("typography",i),x=up(w,["mark","code","delete","underline","strong","keyboard","italic"]),[S,R]=bie(f),[M,D]=$6(!1,{value:R.editing}),{triggerType:E=["icon"]}=R,W=ke=>{var Ye;ke&&((Ye=R.onStart)===null||Ye===void 0||Ye.call(R)),D(ke)},j=kGt(M);FGt(()=>{var ke;!M&&j&&((ke=T.current)===null||ke===void 0||ke.focus())},[M]);const L=ke=>{ke==null||ke.preventDefault(),W(!0)},k=ke=>{var Ye;(Ye=R.onChange)===null||Ye===void 0||Ye.call(R,ke),W(!1)},N=()=>{var ke;(ke=R.onCancel)===null||ke===void 0||ke.call(R),W(!1)},[F,U]=bie(p),{copied:O,copyLoading:B,onClick:_}=EGt({copyConfig:U,children:u}),[X,$]=m.useState(!1),[Q,le]=m.useState(!1),[q,te]=m.useState(!1),[re,ae]=m.useState(!1),[se,ne]=m.useState(!0),[fe,ge]=bie(d,{expandable:!1,symbol:ke=>ke?P==null?void 0:P.collapse:P==null?void 0:P.expand}),[de,Z]=$6(ge.defaultExpanded||!1,{value:ge.expanded}),he=fe&&(!de||ge.expandable==="collapsible"),{rows:xe=1}=ge,He=m.useMemo(()=>he&&(ge.suffix!==void 0||ge.onEllipsis||ge.expandable||S||F),[he,ge,S,F]);gx(()=>{fe&&!He&&($(J7e("webkitLineClamp")),le(J7e("textOverflow")))},[He,fe]);const[Se,ze]=m.useState(he),Ie=m.useMemo(()=>He?!1:xe===1?Q:X,[He,Q,X]);gx(()=>{ze(Ie&&he)},[Ie,he]);const ye=he&&(Se?re:q),ce=he&&xe===1&&Se,pe=he&&xe>1&&Se,ve=(ke,Ye)=>{var it;Z(Ye.expanded),(it=ge.onExpand)===null||it===void 0||it.call(ge,ke,Ye)},[Ae,Te]=m.useState(0),Me=ke=>{let{offsetWidth:Ye}=ke;Te(Ye)},Pe=ke=>{var Ye;te(ke),q!==ke&&((Ye=ge.onEllipsis)===null||Ye===void 0||Ye.call(ge,ke))};m.useEffect(()=>{const ke=v.current;if(fe&&Se&&ke){const Ye=pe?ke.offsetHeight{const ke=v.current;if(typeof IntersectionObserver>"u"||!ke||!Se||!he)return;const Ye=new IntersectionObserver(()=>{ne(!!ke.offsetParent)});return Ye.observe(ke),()=>{Ye.disconnect()}},[Se,he]);let Ee={};ge.tooltip===!0?Ee={title:(n=R.text)!==null&&n!==void 0?n:u}:m.isValidElement(ge.tooltip)?Ee={title:ge.tooltip}:typeof ge.tooltip=="object"?Ee=Object.assign({title:(o=R.text)!==null&&o!==void 0?o:u},ge.tooltip):Ee={title:ge.tooltip};const Be=m.useMemo(()=>{const ke=Ye=>["string","number"].includes(typeof Ye);if(!(!fe||Se)){if(ke(R.text))return R.text;if(ke(u))return u;if(ke(y))return y;if(ke(Ee.title))return Ee.title}},[fe,Se,y,Ee.title,ye]);if(M)return m.createElement(TGt,{value:(r=R.text)!==null&&r!==void 0?r:typeof u=="string"?u:"",onSave:k,onCancel:N,onEnd:R.onEnd,prefixCls:A,className:a,style:l,direction:C,component:g,maxLength:R.maxLength,autoSize:R.autoSize,enterIcon:R.enterIcon});const Je=()=>{const{expandable:ke,symbol:Ye}=ge;return!ke||de&&ke!=="collapsible"?null:m.createElement("a",{key:"expand",className:`${A}-${de?"collapse":"expand"}`,onClick:it=>ve(it,{expanded:!de}),"aria-label":de?P.collapse:P==null?void 0:P.expand},typeof Ye=="function"?Ye(de):Ye)},We=()=>{if(!S)return;const{icon:ke,tooltip:Ye,tabIndex:it}=R,Ve=B9(Ye)[0]||(P==null?void 0:P.edit),yt=typeof Ve=="string"?Ve:"";return E.includes("icon")?m.createElement(tA,{key:"edit",title:Ye===!1?"":Ve},m.createElement(JKe,{ref:T,className:`${A}-edit`,onClick:L,"aria-label":yt,tabIndex:it},ke||m.createElement(KKe,{role:"button"}))):null},Ke=()=>F?m.createElement(UGt,Object.assign({key:"copy"},U,{prefixCls:A,copied:O,locale:P,onCopy:_,loading:B,iconOnly:u==null})):null,Ne=ke=>[ke&&Je(),We(),Ke()],De=ke=>[ke&&!de&&m.createElement("span",{"aria-hidden":!0,key:"ellipsis"},VGt),ge.suffix,Ne(ke)];return m.createElement(Td,{onResize:Me,disabled:!he},ke=>m.createElement(YGt,{tooltipProps:Ee,enableEllipsis:he,isEllipsis:ye},m.createElement($Ke,Object.assign({className:Un({[`${A}-${s}`]:s,[`${A}-disabled`]:c,[`${A}-ellipsis`]:fe,[`${A}-single-line`]:he&&xe===1&&!de,[`${A}-ellipsis-single-line`]:ce,[`${A}-ellipsis-multiple-line`]:pe},a),prefixCls:i,style:Object.assign(Object.assign({},l),{WebkitLineClamp:pe?xe:void 0}),component:g,ref:o5(ke,v,e),direction:C,onClick:E.includes("text")?L:void 0,"aria-label":Be==null?void 0:Be.toString(),title:y},x),m.createElement(BGt,{enableMeasure:he&&!Se,text:u,rows:xe,width:Ae,onEllipsis:Pe,expanded:de,miscDeps:[O,de,B,S,F]},(Ye,it)=>_Gt(t,m.createElement(m.Fragment,null,Ye.length>0&&it&&!de&&Be?m.createElement("span",{key:"show-content","aria-hidden":!0},Ye):Ye,De(it)))))))});var GGt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var{ellipsis:n,rel:o}=t,r=GGt(t,["ellipsis","rel"]);const i=Object.assign(Object.assign({},r),{rel:o===void 0&&r.target==="_blank"?"noopener noreferrer":o});return delete i.navigate,m.createElement(gQ,Object.assign({},i,{ref:e,ellipsis:!!n,component:"a"}))}),JGt=m.forwardRef((t,e)=>m.createElement(gQ,Object.assign({ref:e},t,{component:"div"})));var KGt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{var{ellipsis:n}=t,o=KGt(t,["ellipsis"]);const r=m.useMemo(()=>n&&typeof n=="object"?up(n,["expandable","rows"]):n,[n]);return m.createElement(gQ,Object.assign({ref:e},o,{ellipsis:r,component:"span"}))},$Gt=m.forwardRef(qGt);var QGt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r{const{level:n=1}=t,o=QGt(t,["level"]);let r;return ZGt.includes(n)?r=`h${n}`:r="h1",m.createElement(gQ,Object.assign({ref:e},o,{component:r}))}),F6=$Ke;F6.Text=$Gt;F6.Link=XGt;F6.Title=eXt;F6.Paragraph=JGt;/*! * html2canvas 1.4.1 * Copyright (c) 2022 Niklas von Hertzen * Released under MIT License @@ -4770,22 +4770,22 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Eue=function(t,e){return Eue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])},Eue(t,e)};function i5(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Eue(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Fue=function(){return Fue=Object.assign||function(e){for(var n,o=1,r=arguments.length;o0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=55296&&r<=56319&&n>10)+55296,a%1024+56320)),(r+1===n||o.length>16384)&&(i+=String.fromCharCode.apply(String,o),o.length=0)}return i},Tbe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nXt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var _Y=0;_Y"u"?[]:new Uint8Array(256);for(var VY=0;VY>4,u[r++]=(a&15)<<4|l>>2,u[r++]=(l&3)<<6|s&63;return c},rXt=function(t){for(var e=t.length,n=[],o=0;o>Ax,lXt=1<>Ax,cXt=eqe+sXt,uXt=cXt,dXt=32,fXt=uXt+dXt,hXt=65536>>Pye,pXt=1<=0){if(e<55296||e>56319&&e<=65535)return n=this.index[e>>Ax],n=(n<>Ax)],n=(n<>Pye),n=this.index[n],n+=e>>Ax&gXt,n=this.index[n],n=(n<"u"?[]:new Uint8Array(256);for(var GY=0;GYHbe?(r.push(!0),l-=Hbe):r.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(i)!==-1)return o.push(a),n.push(Wue);if(l===bXt||l===kue){if(a===0)return o.push(a),n.push(bv);var s=n[a-1];return IXt.indexOf(s)===-1?(o.push(o[a-1]),n.push(s)):(o.push(a),n.push(bv))}if(o.push(a),l===RXt)return n.push(e==="strict"?Nue:fk);if(l===rqe||l===CXt)return n.push(bv);if(l===HXt)return i>=131072&&i<=196605||i>=196608&&i<=262141?n.push(fk):n.push(bv);n.push(l)}),[o,n,r]},Iie=function(t,e,n,o){var r=o[n];if(Array.isArray(t)?t.indexOf(r)!==-1:t===r)for(var i=n;i<=o.length;){i++;var a=o[i];if(a===e)return!0;if(a!==w8)break}if(r===w8)for(var i=n;i>0;){i--;var l=o[i];if(Array.isArray(t)?t.indexOf(l)!==-1:t===l)for(var s=n;s<=o.length;){s++;var a=o[s];if(a===e)return!0;if(a!==w8)break}if(l!==w8)break}return!1},kbe=function(t,e){for(var n=t;n>=0;){var o=e[n];if(o===w8)n--;else return o}return 0},EXt=function(t,e,n,o,r){if(n[o]===0)return qa;var i=o-1;if(Array.isArray(r)&&r[i]===!0)return qa;var a=i-1,l=i+1,s=e[i],c=a>=0?e[a]:0,u=e[l];if(s===tqe&&u===nqe)return qa;if(_ue.indexOf(s)!==-1)return iqe;if(_ue.indexOf(u)!==-1||aqe.indexOf(u)!==-1)return qa;if(kbe(i,e)===oqe)return qY;if(Oue.get(t[i])===kue||(s===JY||s===KY)&&Oue.get(t[l])===kue||s===Mbe||u===Mbe||s===Ibe||[w8,Lue,DD].indexOf(s)===-1&&u===Ibe||[XY,Uz,PXt,WT,NT].indexOf(u)!==-1||kbe(i,e)===jz||Iie(Hie,jz,i,e)||Iie([XY,Uz],Nue,i,e)||Iie(zbe,zbe,i,e))return qa;if(s===w8)return qY;if(s===Hie||u===Hie)return qa;if(u===Wue||s===Wue)return qY;if([Lue,DD,Nue].indexOf(u)!==-1||s===TXt||c===Bue&&zXt.indexOf(s)!==-1||s===NT&&u===Bue||u===Dbe||i6.indexOf(u)!==-1&&s===J1||i6.indexOf(s)!==-1&&u===J1||s===FD&&[fk,JY,KY].indexOf(u)!==-1||[fk,JY,KY].indexOf(s)!==-1&&u===ED||i6.indexOf(s)!==-1&&Ebe.indexOf(u)!==-1||Ebe.indexOf(s)!==-1&&i6.indexOf(u)!==-1||[FD,ED].indexOf(s)!==-1&&(u===J1||[jz,DD].indexOf(u)!==-1&&e[l+1]===J1)||[jz,DD].indexOf(s)!==-1&&u===J1||s===J1&&[J1,NT,WT].indexOf(u)!==-1)return qa;if([J1,NT,WT,XY,Uz].indexOf(u)!==-1)for(var d=i;d>=0;){var f=e[d];if(f===J1)return qa;if([NT,WT].indexOf(f)!==-1)d--;else break}if([FD,ED].indexOf(u)!==-1)for(var d=[XY,Uz].indexOf(s)!==-1?a:i;d>=0;){var f=e[d];if(f===J1)return qa;if([NT,WT].indexOf(f)!==-1)d--;else break}if(Yue===s&&[Yue,Q_,Uue,jue].indexOf(u)!==-1||[Q_,Uue].indexOf(s)!==-1&&[Q_,Z_].indexOf(u)!==-1||[Z_,jue].indexOf(s)!==-1&&u===Z_||Fbe.indexOf(s)!==-1&&[Dbe,ED].indexOf(u)!==-1||Fbe.indexOf(u)!==-1&&s===FD||i6.indexOf(s)!==-1&&i6.indexOf(u)!==-1||s===WT&&i6.indexOf(u)!==-1||i6.concat(J1).indexOf(s)!==-1&&u===jz&&MXt.indexOf(t[l])===-1||i6.concat(J1).indexOf(u)!==-1&&s===Uz)return qa;if(s===Mie&&u===Mie){for(var p=n[i],g=1;p>0&&(p--,e[p]===Mie);)g++;if(g%2!==0)return qa}return s===JY&&u===KY?qa:qY},FXt=function(t,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var n=DXt(t,e.lineBreak),o=n[0],r=n[1],i=n[2];(e.wordBreak==="break-all"||e.wordBreak==="break-word")&&(r=r.map(function(l){return[J1,bv,rqe].indexOf(l)!==-1?fk:l}));var a=e.wordBreak==="keep-all"?i.map(function(l,s){return l&&t[s]>=19968&&t[s]<=40959}):void 0;return[o,r,a]},kXt=function(){function t(e,n,o,r){this.codePoints=e,this.required=n===iqe,this.start=o,this.end=r}return t.prototype.slice=function(){return E0.apply(void 0,this.codePoints.slice(this.start,this.end))},t}(),LXt=function(t,e){var n=yQ(t),o=FXt(n,e),r=o[0],i=o[1],a=o[2],l=n.length,s=0,c=0;return{next:function(){if(c>=l)return{done:!0,value:null};for(var u=qa;c=lqe&&t<=57},mJt=function(t){return t>=55296&&t<=57343},UT=function(t){return nh(t)||t>=uqe&&t<=fqe||t>=sqe&&t<=dJt},yJt=function(t){return t>=sqe&&t<=hJt},AJt=function(t){return t>=uqe&&t<=gJt},wJt=function(t){return yJt(t)||AJt(t)},vJt=function(t){return t>=tJt},tO=function(t){return t===KG||t===UXt||t===jXt},qG=function(t){return wJt(t)||vJt(t)||t===_Xt},jbe=function(t){return qG(t)||nh(t)||t===kp},xJt=function(t){return t>=iJt&&t<=aJt||t===lJt||t>=sJt&&t<=cJt||t===uJt},K4=function(t,e){return t!==PE?!1:e!==KG},nO=function(t,e,n){return t===kp?qG(e)||K4(e,n):qG(t)?!0:!!(t===PE&&K4(t,e))},Die=function(t,e,n){return t===Yv||t===kp?nh(e)?!0:e===hk&&nh(n):nh(t===hk?e:t)},bJt=function(t){var e=0,n=1;(t[e]===Yv||t[e]===kp)&&(t[e]===kp&&(n=-1),e++);for(var o=[];nh(t[e]);)o.push(t[e++]);var r=o.length?parseInt(E0.apply(void 0,o),10):0;t[e]===hk&&e++;for(var i=[];nh(t[e]);)i.push(t[e++]);var a=i.length,l=a?parseInt(E0.apply(void 0,i),10):0;(t[e]===dqe||t[e]===cqe)&&e++;var s=1;(t[e]===Yv||t[e]===kp)&&(t[e]===kp&&(s=-1),e++);for(var c=[];nh(t[e]);)c.push(t[e++]);var u=c.length?parseInt(E0.apply(void 0,c),10):0;return n*(r+l*Math.pow(10,-a))*Math.pow(10,s*u)},SJt={type:2},TJt={type:3},PJt={type:4},CJt={type:13},RJt={type:8},HJt={type:21},MJt={type:9},IJt={type:10},zJt={type:11},DJt={type:12},EJt={type:14},oO={type:23},FJt={type:1},kJt={type:25},LJt={type:24},WJt={type:26},NJt={type:27},UJt={type:28},jJt={type:29},BJt={type:31},Vue={type:32},hqe=function(){function t(){this._value=[]}return t.prototype.write=function(e){this._value=this._value.concat(yQ(e))},t.prototype.read=function(){for(var e=[],n=this.consumeToken();n!==Vue;)e.push(n),n=this.consumeToken();return e},t.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case $Y:return this.consumeStringToken($Y);case BXt:var n=this.peekCodePoint(0),o=this.peekCodePoint(1),r=this.peekCodePoint(2);if(jbe(n)||K4(o,r)){var i=nO(n,o,r)?NXt:WXt,a=this.consumeName();return{type:5,value:a,flags:i}}break;case YXt:if(this.peekCodePoint(0)===Bz)return this.consumeCodePoint(),CJt;break;case QY:return this.consumeStringToken(QY);case ZY:return SJt;case Yz:return TJt;case zie:if(this.peekCodePoint(0)===Bz)return this.consumeCodePoint(),EJt;break;case Yv:if(Die(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case nJt:return PJt;case kp:var l=e,s=this.peekCodePoint(0),c=this.peekCodePoint(1);if(Die(l,s,c))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(nO(l,s,c))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(s===kp&&c===XXt)return this.consumeCodePoint(),this.consumeCodePoint(),LJt;break;case hk:if(Die(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Wbe:if(this.peekCodePoint(0)===zie)for(this.consumeCodePoint();;){var u=this.consumeCodePoint();if(u===zie&&(u=this.consumeCodePoint(),u===Wbe))return this.consumeToken();if(u===X5)return this.consumeToken()}break;case oJt:return WJt;case rJt:return NJt;case GXt:if(this.peekCodePoint(0)===VXt&&this.peekCodePoint(1)===kp&&this.peekCodePoint(2)===kp)return this.consumeCodePoint(),this.consumeCodePoint(),kJt;break;case JXt:var d=this.peekCodePoint(0),f=this.peekCodePoint(1),p=this.peekCodePoint(2);if(nO(d,f,p)){var a=this.consumeName();return{type:7,value:a}}break;case KXt:return UJt;case PE:if(K4(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case qXt:return jJt;case $Xt:if(this.peekCodePoint(0)===Bz)return this.consumeCodePoint(),RJt;break;case QXt:return zJt;case ZXt:return DJt;case fJt:case pJt:var g=this.peekCodePoint(0),y=this.peekCodePoint(1);return g===Yv&&(UT(y)||y===eO)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case Nbe:if(this.peekCodePoint(0)===Bz)return this.consumeCodePoint(),MJt;if(this.peekCodePoint(0)===Nbe)return this.consumeCodePoint(),HJt;break;case eJt:if(this.peekCodePoint(0)===Bz)return this.consumeCodePoint(),IJt;break;case X5:return Vue}return tO(e)?(this.consumeWhiteSpace(),BJt):nh(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):qG(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:E0(e)}},t.prototype.consumeCodePoint=function(){var e=this._value.shift();return typeof e>"u"?-1:e},t.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},t.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},t.prototype.consumeUnicodeRangeToken=function(){for(var e=[],n=this.consumeCodePoint();UT(n)&&e.length<6;)e.push(n),n=this.consumeCodePoint();for(var o=!1;n===eO&&e.length<6;)e.push(n),n=this.consumeCodePoint(),o=!0;if(o){var r=parseInt(E0.apply(void 0,e.map(function(s){return s===eO?lqe:s})),16),i=parseInt(E0.apply(void 0,e.map(function(s){return s===eO?fqe:s})),16);return{type:30,start:r,end:i}}var a=parseInt(E0.apply(void 0,e),16);if(this.peekCodePoint(0)===kp&&UT(this.peekCodePoint(1))){this.consumeCodePoint(),n=this.consumeCodePoint();for(var l=[];UT(n)&&l.length<6;)l.push(n),n=this.consumeCodePoint();var i=parseInt(E0.apply(void 0,l),16);return{type:30,start:a,end:i}}else return{type:30,start:a,end:a}},t.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return e.toLowerCase()==="url"&&this.peekCodePoint(0)===ZY?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===ZY?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},t.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===X5)return{type:22,value:""};var n=this.peekCodePoint(0);if(n===QY||n===$Y){var o=this.consumeStringToken(this.consumeCodePoint());return o.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===X5||this.peekCodePoint(0)===Yz)?(this.consumeCodePoint(),{type:22,value:o.value}):(this.consumeBadUrlRemnants(),oO)}for(;;){var r=this.consumeCodePoint();if(r===X5||r===Yz)return{type:22,value:E0.apply(void 0,e)};if(tO(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===X5||this.peekCodePoint(0)===Yz?(this.consumeCodePoint(),{type:22,value:E0.apply(void 0,e)}):(this.consumeBadUrlRemnants(),oO);if(r===$Y||r===QY||r===ZY||xJt(r))return this.consumeBadUrlRemnants(),oO;if(r===PE)if(K4(r,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),oO;else e.push(r)}},t.prototype.consumeWhiteSpace=function(){for(;tO(this.peekCodePoint(0));)this.consumeCodePoint()},t.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===Yz||e===X5)return;K4(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},t.prototype.consumeStringSlice=function(e){for(var n=5e4,o="";e>0;){var r=Math.min(n,e);o+=E0.apply(void 0,this._value.splice(0,r)),e-=r}return this._value.shift(),o},t.prototype.consumeStringToken=function(e){var n="",o=0;do{var r=this._value[o];if(r===X5||r===void 0||r===e)return n+=this.consumeStringSlice(o),{type:0,value:n};if(r===KG)return this._value.splice(0,o),FJt;if(r===PE){var i=this._value[o+1];i!==X5&&i!==void 0&&(i===KG?(n+=this.consumeStringSlice(o),o=-1,this._value.shift()):K4(r,i)&&(n+=this.consumeStringSlice(o),n+=E0(this.consumeEscapedCodePoint()),o=-1))}o++}while(!0)},t.prototype.consumeNumber=function(){var e=[],n=nN,o=this.peekCodePoint(0);for((o===Yv||o===kp)&&e.push(this.consumeCodePoint());nh(this.peekCodePoint(0));)e.push(this.consumeCodePoint());o=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(o===hk&&nh(r))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),n=Lbe;nh(this.peekCodePoint(0));)e.push(this.consumeCodePoint());o=this.peekCodePoint(0),r=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((o===dqe||o===cqe)&&((r===Yv||r===kp)&&nh(i)||nh(r)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),n=Lbe;nh(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[bJt(e),n]},t.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),n=e[0],o=e[1],r=this.peekCodePoint(0),i=this.peekCodePoint(1),a=this.peekCodePoint(2);if(nO(r,i,a)){var l=this.consumeName();return{type:15,number:n,flags:o,unit:l}}return r===OXt?(this.consumeCodePoint(),{type:16,number:n,flags:o}):{type:17,number:n,flags:o}},t.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(UT(e)){for(var n=E0(e);UT(this.peekCodePoint(0))&&n.length<6;)n+=E0(this.consumeCodePoint());tO(this.peekCodePoint(0))&&this.consumeCodePoint();var o=parseInt(n,16);return o===0||mJt(o)||o>1114111?Ube:o}return e===X5?Ube:e},t.prototype.consumeName=function(){for(var e="";;){var n=this.consumeCodePoint();if(jbe(n))e+=E0(n);else if(K4(n,this.peekCodePoint(0)))e+=E0(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(n),e}},t}(),pqe=function(){function t(e){this._tokens=e}return t.create=function(e){var n=new hqe;return n.write(e),new t(n.read())},t.parseValue=function(e){return t.create(e).parseComponentValue()},t.parseValues=function(e){return t.create(e).parseComponentValues()},t.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===31;)e=this.consumeToken();if(e.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var n=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return n;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},t.prototype.parseComponentValues=function(){for(var e=[];;){var n=this.consumeComponentValue();if(n.type===32)return e;e.push(n),e.push()}},t.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},t.prototype.consumeSimpleBlock=function(e){for(var n={type:e,values:[]},o=this.consumeToken();;){if(o.type===32||OJt(o,e))return n;this.reconsumeToken(o),n.values.push(this.consumeComponentValue()),o=this.consumeToken()}},t.prototype.consumeFunction=function(e){for(var n={name:e.value,values:[],type:18};;){var o=this.consumeToken();if(o.type===32||o.type===3)return n;this.reconsumeToken(o),n.values.push(this.consumeComponentValue())}},t.prototype.consumeToken=function(){var e=this._tokens.shift();return typeof e>"u"?Vue:e},t.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},t}(),oN=function(t){return t.type===15},KH=function(t){return t.type===17},xs=function(t){return t.type===20},YJt=function(t){return t.type===0},Gue=function(t,e){return xs(t)&&t.value===e},gqe=function(t){return t.type!==31},bR=function(t){return t.type!==31&&t.type!==4},g3=function(t){var e=[],n=[];return t.forEach(function(o){if(o.type===4){if(n.length===0)throw new Error("Error parsing function args, zero tokens for arg");e.push(n),n=[];return}o.type!==31&&n.push(o)}),n.length&&e.push(n),e},OJt=function(t,e){return e===11&&t.type===12||e===28&&t.type===29?!0:e===2&&t.type===3},dw=function(t){return t.type===17||t.type===15},au=function(t){return t.type===16||dw(t)},mqe=function(t){return t.length>1?[t[0],t[1]]:[t[0]]},ff={type:17,number:0,flags:nN},Cye={type:16,number:50,flags:nN},v8={type:16,number:100,flags:nN},kD=function(t,e,n){var o=t[0],r=t[1];return[Xs(o,e),Xs(typeof r<"u"?r:o,n)]},Xs=function(t,e){if(t.type===16)return t.number/100*e;if(oN(t))switch(t.unit){case"rem":case"em":return 16*t.number;case"px":default:return t.number}return t.number},yqe="deg",Aqe="grad",wqe="rad",vqe="turn",AQ={name:"angle",parse:function(t,e){if(e.type===15)switch(e.unit){case yqe:return Math.PI*e.number/180;case Aqe:return Math.PI/200*e.number;case wqe:return e.number;case vqe:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},xqe=function(t){return t.type===15&&(t.unit===yqe||t.unit===Aqe||t.unit===wqe||t.unit===vqe)},bqe=function(t){var e=t.filter(xs).map(function(n){return n.value}).join(" ");switch(e){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ff,ff];case"to top":case"bottom":return Um(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ff,v8];case"to right":case"left":return Um(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[v8,v8];case"to bottom":case"top":return Um(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[v8,ff];case"to left":case"right":return Um(270)}return 0},Um=function(t){return Math.PI*t/180},B8={name:"color",parse:function(t,e){if(e.type===18){var n=_Jt[e.name];if(typeof n>"u")throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return n(t,e.values)}if(e.type===5){if(e.value.length===3){var o=e.value.substring(0,1),r=e.value.substring(1,2),i=e.value.substring(2,3);return x8(parseInt(o+o,16),parseInt(r+r,16),parseInt(i+i,16),1)}if(e.value.length===4){var o=e.value.substring(0,1),r=e.value.substring(1,2),i=e.value.substring(2,3),a=e.value.substring(3,4);return x8(parseInt(o+o,16),parseInt(r+r,16),parseInt(i+i,16),parseInt(a+a,16)/255)}if(e.value.length===6){var o=e.value.substring(0,2),r=e.value.substring(2,4),i=e.value.substring(4,6);return x8(parseInt(o,16),parseInt(r,16),parseInt(i,16),1)}if(e.value.length===8){var o=e.value.substring(0,2),r=e.value.substring(2,4),i=e.value.substring(4,6),a=e.value.substring(6,8);return x8(parseInt(o,16),parseInt(r,16),parseInt(i,16),parseInt(a,16)/255)}}if(e.type===20){var l=k6[e.value.toUpperCase()];if(typeof l<"u")return l}return k6.TRANSPARENT}},Y8=function(t){return(255&t)===0},fd=function(t){var e=255&t,n=255&t>>8,o=255&t>>16,r=255&t>>24;return e<255?"rgba("+r+","+o+","+n+","+e/255+")":"rgb("+r+","+o+","+n+")"},x8=function(t,e,n,o){return(t<<24|e<<16|n<<8|Math.round(o*255)<<0)>>>0},Bbe=function(t,e){if(t.type===17)return t.number;if(t.type===16){var n=e===3?1:255;return e===3?t.number/100*n:Math.round(t.number/100*n)}return 0},Ybe=function(t,e){var n=e.filter(bR);if(n.length===3){var o=n.map(Bbe),r=o[0],i=o[1],a=o[2];return x8(r,i,a,1)}if(n.length===4){var l=n.map(Bbe),r=l[0],i=l[1],a=l[2],s=l[3];return x8(r,i,a,s)}return 0};function Eie(t,e,n){return n<0&&(n+=1),n>=1&&(n-=1),n<1/6?(e-t)*n*6+t:n<1/2?e:n<2/3?(e-t)*6*(2/3-n)+t:t}var Obe=function(t,e){var n=e.filter(bR),o=n[0],r=n[1],i=n[2],a=n[3],l=(o.type===17?Um(o.number):AQ.parse(t,o))/(Math.PI*2),s=au(r)?r.number/100:0,c=au(i)?i.number/100:0,u=typeof a<"u"&&au(a)?Xs(a,1):1;if(s===0)return x8(c*255,c*255,c*255,1);var d=c<=.5?c*(s+1):c+s-c*s,f=c*2-d,p=Eie(f,d,l+1/3),g=Eie(f,d,l),y=Eie(f,d,l-1/3);return x8(p*255,g*255,y*255,u)},_Jt={hsl:Obe,hsla:Obe,rgb:Ybe,rgba:Ybe},CE=function(t,e){return B8.parse(t,pqe.create(e).parseComponentValue())},k6={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},VJt={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(t,e){return e.map(function(n){if(xs(n))switch(n.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},GJt={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},wQ=function(t,e){var n=B8.parse(t,e[0]),o=e[1];return o&&au(o)?{color:n,stop:o}:{color:n,stop:null}},_be=function(t,e){var n=t[0],o=t[t.length-1];n.stop===null&&(n.stop=ff),o.stop===null&&(o.stop=v8);for(var r=[],i=0,a=0;ai?r.push(s):r.push(i),i=s}else r.push(null)}for(var c=null,a=0;aa.optimumDistance)?{optimumCorner:l,optimumDistance:u}:a},{optimumDistance:r?1/0:-1/0,optimumCorner:null}).optimumCorner},KJt=function(t,e,n,o,r){var i=0,a=0;switch(t.size){case 0:t.shape===0?i=a=Math.min(Math.abs(e),Math.abs(e-o),Math.abs(n),Math.abs(n-r)):t.shape===1&&(i=Math.min(Math.abs(e),Math.abs(e-o)),a=Math.min(Math.abs(n),Math.abs(n-r)));break;case 2:if(t.shape===0)i=a=Math.min(Zy(e,n),Zy(e,n-r),Zy(e-o,n),Zy(e-o,n-r));else if(t.shape===1){var l=Math.min(Math.abs(n),Math.abs(n-r))/Math.min(Math.abs(e),Math.abs(e-o)),s=Vbe(o,r,e,n,!0),c=s[0],u=s[1];i=Zy(c-e,(u-n)/l),a=l*i}break;case 1:t.shape===0?i=a=Math.max(Math.abs(e),Math.abs(e-o),Math.abs(n),Math.abs(n-r)):t.shape===1&&(i=Math.max(Math.abs(e),Math.abs(e-o)),a=Math.max(Math.abs(n),Math.abs(n-r)));break;case 3:if(t.shape===0)i=a=Math.max(Zy(e,n),Zy(e,n-r),Zy(e-o,n),Zy(e-o,n-r));else if(t.shape===1){var l=Math.max(Math.abs(n),Math.abs(n-r))/Math.max(Math.abs(e),Math.abs(e-o)),d=Vbe(o,r,e,n,!1),c=d[0],u=d[1];i=Zy(c-e,(u-n)/l),a=l*i}break}return Array.isArray(t.size)&&(i=Xs(t.size[0],o),a=t.size.length===2?Xs(t.size[1],r):i),[i,a]},qJt=function(t,e){var n=Um(180),o=[];return g3(e).forEach(function(r,i){if(i===0){var a=r[0];if(a.type===20&&a.value==="to"){n=bqe(r);return}else if(xqe(a)){n=AQ.parse(t,a);return}}var l=wQ(t,r);o.push(l)}),{angle:n,stops:o,type:1}},rO=function(t,e){var n=Um(180),o=[];return g3(e).forEach(function(r,i){if(i===0){var a=r[0];if(a.type===20&&["top","left","right","bottom"].indexOf(a.value)!==-1){n=bqe(r);return}else if(xqe(a)){n=(AQ.parse(t,a)+Um(270))%Um(360);return}}var l=wQ(t,r);o.push(l)}),{angle:n,stops:o,type:1}},$Jt=function(t,e){var n=Um(180),o=[],r=1,i=0,a=3,l=[];return g3(e).forEach(function(s,c){var u=s[0];if(c===0){if(xs(u)&&u.value==="linear"){r=1;return}else if(xs(u)&&u.value==="radial"){r=2;return}}if(u.type===18){if(u.name==="from"){var d=B8.parse(t,u.values[0]);o.push({stop:ff,color:d})}else if(u.name==="to"){var d=B8.parse(t,u.values[0]);o.push({stop:v8,color:d})}else if(u.name==="color-stop"){var f=u.values.filter(bR);if(f.length===2){var d=B8.parse(t,f[1]),p=f[0];KH(p)&&o.push({stop:{type:16,number:p.number*100,flags:p.flags},color:d})}}}}),r===1?{angle:(n+Um(180))%Um(360),stops:o,type:r}:{size:a,shape:i,stops:o,position:l,type:r}},Sqe="closest-side",Tqe="farthest-side",Pqe="closest-corner",Cqe="farthest-corner",Rqe="circle",Hqe="ellipse",Mqe="cover",Iqe="contain",QJt=function(t,e){var n=0,o=3,r=[],i=[];return g3(e).forEach(function(a,l){var s=!0;if(l===0){var c=!1;s=a.reduce(function(d,f){if(c)if(xs(f))switch(f.value){case"center":return i.push(Cye),d;case"top":case"left":return i.push(ff),d;case"right":case"bottom":return i.push(v8),d}else(au(f)||dw(f))&&i.push(f);else if(xs(f))switch(f.value){case Rqe:return n=0,!1;case Hqe:return n=1,!1;case"at":return c=!0,!1;case Sqe:return o=0,!1;case Mqe:case Tqe:return o=1,!1;case Iqe:case Pqe:return o=2,!1;case Cqe:return o=3,!1}else if(dw(f)||au(f))return Array.isArray(o)||(o=[]),o.push(f),!1;return d},s)}if(s){var u=wQ(t,a);r.push(u)}}),{size:o,shape:n,stops:r,position:i,type:2}},iO=function(t,e){var n=0,o=3,r=[],i=[];return g3(e).forEach(function(a,l){var s=!0;if(l===0?s=a.reduce(function(u,d){if(xs(d))switch(d.value){case"center":return i.push(Cye),!1;case"top":case"left":return i.push(ff),!1;case"right":case"bottom":return i.push(v8),!1}else if(au(d)||dw(d))return i.push(d),!1;return u},s):l===1&&(s=a.reduce(function(u,d){if(xs(d))switch(d.value){case Rqe:return n=0,!1;case Hqe:return n=1,!1;case Iqe:case Sqe:return o=0,!1;case Tqe:return o=1,!1;case Pqe:return o=2,!1;case Mqe:case Cqe:return o=3,!1}else if(dw(d)||au(d))return Array.isArray(o)||(o=[]),o.push(d),!1;return u},s)),s){var c=wQ(t,a);r.push(c)}}),{size:o,shape:n,stops:r,position:i,type:2}},ZJt=function(t){return t.type===1},eKt=function(t){return t.type===2},Rye={name:"image",parse:function(t,e){if(e.type===22){var n={url:e.value,type:0};return t.cache.addImage(e.value),n}if(e.type===18){var o=zqe[e.name];if(typeof o>"u")throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return o(t,e.values)}throw new Error("Unsupported image type "+e.type)}};function tKt(t){return!(t.type===20&&t.value==="none")&&(t.type!==18||!!zqe[t.name])}var zqe={"linear-gradient":qJt,"-moz-linear-gradient":rO,"-ms-linear-gradient":rO,"-o-linear-gradient":rO,"-webkit-linear-gradient":rO,"radial-gradient":QJt,"-moz-radial-gradient":iO,"-ms-radial-gradient":iO,"-o-radial-gradient":iO,"-webkit-radial-gradient":iO,"-webkit-gradient":$Jt},nKt={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(t,e){if(e.length===0)return[];var n=e[0];return n.type===20&&n.value==="none"?[]:e.filter(function(o){return bR(o)&&tKt(o)}).map(function(o){return Rye.parse(t,o)})}},oKt={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(t,e){return e.map(function(n){if(xs(n))switch(n.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},rKt={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(t,e){return g3(e).map(function(n){return n.filter(au)}).map(mqe)}},iKt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(t,e){return g3(e).map(function(n){return n.filter(xs).map(function(o){return o.value}).join(" ")}).map(aKt)}},aKt=function(t){switch(t){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},zC;(function(t){t.AUTO="auto",t.CONTAIN="contain",t.COVER="cover"})(zC||(zC={}));var lKt={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(t,e){return g3(e).map(function(n){return n.filter(sKt)})}},sKt=function(t){return xs(t)||au(t)},vQ=function(t){return{name:"border-"+t+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},cKt=vQ("top"),uKt=vQ("right"),dKt=vQ("bottom"),fKt=vQ("left"),xQ=function(t){return{name:"border-radius-"+t,initialValue:"0 0",prefix:!1,type:1,parse:function(e,n){return mqe(n.filter(au))}}},hKt=xQ("top-left"),pKt=xQ("top-right"),gKt=xQ("bottom-right"),mKt=xQ("bottom-left"),bQ=function(t){return{name:"border-"+t+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,n){switch(n){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},yKt=bQ("top"),AKt=bQ("right"),wKt=bQ("bottom"),vKt=bQ("left"),SQ=function(t){return{name:"border-"+t+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,n){return oN(n)?n.number:0}}},xKt=SQ("top"),bKt=SQ("right"),SKt=SQ("bottom"),TKt=SQ("left"),PKt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},CKt={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(t,e){switch(e){case"rtl":return 1;case"ltr":default:return 0}}},RKt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(t,e){return e.filter(xs).reduce(function(n,o){return n|HKt(o.value)},0)}},HKt=function(t){switch(t){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},MKt={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},IKt={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(t,e){return e.type===20&&e.value==="normal"?0:e.type===17||e.type===15?e.number:0}},$G;(function(t){t.NORMAL="normal",t.STRICT="strict"})($G||($G={}));var zKt={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"strict":return $G.STRICT;case"normal":default:return $G.NORMAL}}},DKt={name:"line-height",initialValue:"normal",prefix:!1,type:4},Gbe=function(t,e){return xs(t)&&t.value==="normal"?1.2*e:t.type===17?e*t.number:au(t)?Xs(t,e):e},EKt={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(t,e){return e.type===20&&e.value==="none"?null:Rye.parse(t,e)}},FKt={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(t,e){switch(e){case"inside":return 0;case"outside":default:return 1}}},Xue={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},TQ=function(t){return{name:"margin-"+t,initialValue:"0",prefix:!1,type:4}},kKt=TQ("top"),LKt=TQ("right"),WKt=TQ("bottom"),NKt=TQ("left"),UKt={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(t,e){return e.filter(xs).map(function(n){switch(n.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},jKt={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"break-word":return"break-word";case"normal":default:return"normal"}}},PQ=function(t){return{name:"padding-"+t,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},BKt=PQ("top"),YKt=PQ("right"),OKt=PQ("bottom"),_Kt=PQ("left"),VKt={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(t,e){switch(e){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},GKt={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(t,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},XKt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return e.length===1&&Gue(e[0],"none")?[]:g3(e).map(function(n){for(var o={color:k6.TRANSPARENT,offsetX:ff,offsetY:ff,blur:ff},r=0,i=0;i"u")throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return n(e.values)}return null}},qKt=function(t){var e=t.filter(function(n){return n.type===17}).map(function(n){return n.number});return e.length===6?e:null},$Kt=function(t){var e=t.filter(function(s){return s.type===17}).map(function(s){return s.number}),n=e[0],o=e[1];e[2],e[3];var r=e[4],i=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var a=e[12],l=e[13];return e[14],e[15],e.length===16?[n,o,r,i,a,l]:null},QKt={matrix:qKt,matrix3d:$Kt},Xbe={type:16,number:50,flags:nN},ZKt=[Xbe,Xbe],eqt={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(t,e){var n=e.filter(au);return n.length!==2?ZKt:[n[0],n[1]]}},tqt={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},RE;(function(t){t.NORMAL="normal",t.BREAK_ALL="break-all",t.KEEP_ALL="keep-all"})(RE||(RE={}));var nqt={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"break-all":return RE.BREAK_ALL;case"keep-all":return RE.KEEP_ALL;case"normal":default:return RE.NORMAL}}},oqt={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(t,e){if(e.type===20)return{auto:!0,order:0};if(KH(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},Dqe={name:"time",parse:function(t,e){if(e.type===15)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},rqt={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(t,e){return KH(e)?e.number:1}},iqt={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},aqt={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(t,e){return e.filter(xs).map(function(n){switch(n.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(n){return n!==0})}},lqt={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(t,e){var n=[],o=[];return e.forEach(function(r){switch(r.type){case 20:case 0:n.push(r.value);break;case 17:n.push(r.number.toString());break;case 4:o.push(n.join(" ")),n.length=0;break}}),n.length&&o.push(n.join(" ")),o.map(function(r){return r.indexOf(" ")===-1?r:"'"+r+"'"})}},sqt={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},cqt={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(t,e){if(KH(e))return e.number;if(xs(e))switch(e.value){case"bold":return 700;case"normal":default:return 400}return 400}},uqt={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return e.filter(xs).map(function(n){return n.value})}},dqt={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},Du=function(t,e){return(t&e)!==0},fqt={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(t,e){if(e.length===0)return[];var n=e[0];return n.type===20&&n.value==="none"?[]:e}},hqt={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(t,e){if(e.length===0)return null;var n=e[0];if(n.type===20&&n.value==="none")return null;for(var o=[],r=e.filter(gqe),i=0;i1?1:0],this.overflowWrap=Er(e,jKt,n.overflowWrap),this.paddingTop=Er(e,BKt,n.paddingTop),this.paddingRight=Er(e,YKt,n.paddingRight),this.paddingBottom=Er(e,OKt,n.paddingBottom),this.paddingLeft=Er(e,_Kt,n.paddingLeft),this.paintOrder=Er(e,Aqt,n.paintOrder),this.position=Er(e,GKt,n.position),this.textAlign=Er(e,VKt,n.textAlign),this.textDecorationColor=Er(e,iqt,(o=n.textDecorationColor)!==null&&o!==void 0?o:n.color),this.textDecorationLine=Er(e,aqt,(r=n.textDecorationLine)!==null&&r!==void 0?r:n.textDecoration),this.textShadow=Er(e,XKt,n.textShadow),this.textTransform=Er(e,JKt,n.textTransform),this.transform=Er(e,KKt,n.transform),this.transformOrigin=Er(e,eqt,n.transformOrigin),this.visibility=Er(e,tqt,n.visibility),this.webkitTextStrokeColor=Er(e,wqt,n.webkitTextStrokeColor),this.webkitTextStrokeWidth=Er(e,vqt,n.webkitTextStrokeWidth),this.wordBreak=Er(e,nqt,n.wordBreak),this.zIndex=Er(e,oqt,n.zIndex)}return t.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},t.prototype.isTransparent=function(){return Y8(this.backgroundColor)},t.prototype.isTransformed=function(){return this.transform!==null},t.prototype.isPositioned=function(){return this.position!==0},t.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},t.prototype.isFloating=function(){return this.float!==0},t.prototype.isInlineLevel=function(){return Du(this.display,4)||Du(this.display,33554432)||Du(this.display,268435456)||Du(this.display,536870912)||Du(this.display,67108864)||Du(this.display,134217728)},t}(),bqt=function(){function t(e,n){this.content=Er(e,fqt,n.content),this.quotes=Er(e,mqt,n.quotes)}return t}(),Kbe=function(){function t(e,n){this.counterIncrement=Er(e,hqt,n.counterIncrement),this.counterReset=Er(e,pqt,n.counterReset)}return t}(),Er=function(t,e,n){var o=new hqe,r=n!==null&&typeof n<"u"?n.toString():e.initialValue;o.write(r);var i=new pqe(o.read());switch(e.type){case 2:var a=i.parseComponentValue();return e.parse(t,xs(a)?a.value:e.initialValue);case 0:return e.parse(t,i.parseComponentValue());case 1:return e.parse(t,i.parseComponentValues());case 4:return i.parseComponentValue();case 3:switch(e.format){case"angle":return AQ.parse(t,i.parseComponentValue());case"color":return B8.parse(t,i.parseComponentValue());case"image":return Rye.parse(t,i.parseComponentValue());case"length":var l=i.parseComponentValue();return dw(l)?l:ff;case"length-percentage":var s=i.parseComponentValue();return au(s)?s:ff;case"time":return Dqe.parse(t,i.parseComponentValue())}break}},Sqt="data-html2canvas-debug",Tqt=function(t){var e=t.getAttribute(Sqt);switch(e){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Jue=function(t,e){var n=Tqt(t);return n===1||e===n},m3=function(){function t(e,n){if(this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Jue(n,3))debugger;this.styles=new xqt(e,window.getComputedStyle(n,null)),$ue(n)&&(this.styles.animationDuration.some(function(o){return o>0})&&(n.style.animationDuration="0s"),this.styles.transform!==null&&(n.style.transform="none")),this.bounds=mQ(this.context,n),Jue(n,4)&&(this.flags|=16)}return t}(),Pqt="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",qbe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",LD=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var aO=0;aO>4,u[r++]=(a&15)<<4|l>>2,u[r++]=(l&3)<<6|s&63;return c},Rqt=function(t){for(var e=t.length,n=[],o=0;o>wx,Iqt=1<>wx,Dqt=Eqe+zqt,Eqt=Dqt,Fqt=32,kqt=Eqt+Fqt,Lqt=65536>>Hye,Wqt=1<=0){if(e<55296||e>56319&&e<=65535)return n=this.index[e>>wx],n=(n<>wx)],n=(n<>Hye),n=this.index[n],n+=e>>wx&Nqt,n=this.index[n],n=(n<"u"?[]:new Uint8Array(256);for(var lO=0;lO=55296&&r<=56319&&n>10)+55296,a%1024+56320)),(r+1===n||o.length>16384)&&(i+=String.fromCharCode.apply(String,o),o.length=0)}return i},Xqt=jqt(Pqt),Tm="×",Bie="÷",Jqt=function(t){return Xqt.get(t)},Kqt=function(t,e,n){var o=n-2,r=e[o],i=e[n-1],a=e[n];if(i===Lie&&a===Wie)return Tm;if(i===Lie||i===Wie||i===Zbe||a===Lie||a===Wie||a===Zbe)return Bie;if(i===tSe&&[tSe,Nie,nSe,oSe].indexOf(a)!==-1||(i===nSe||i===Nie)&&(a===Nie||a===Uie)||(i===oSe||i===Uie)&&a===Uie||a===rSe||a===eSe||a===_qt||i===Oqt)return Tm;if(i===rSe&&a===iSe){for(;r===eSe;)r=e[--o];if(r===iSe)return Tm}if(i===jie&&a===jie){for(var l=0;r===jie;)l++,r=e[--o];if(l%2===0)return Tm}return Bie},qqt=function(t){var e=Vqt(t),n=e.length,o=0,r=0,i=e.map(Jqt);return{next:function(){if(o>=n)return{done:!0,value:null};for(var a=Tm;oa.x||u.y>a.y;return a=u,c===0?!0:d});return t.body.removeChild(e),l},e$t=function(){return typeof new Image().crossOrigin<"u"},t$t=function(){return typeof new XMLHttpRequest().responseType=="string"},n$t=function(t){var e=new Image,n=t.createElement("canvas"),o=n.getContext("2d");if(!o)return!1;e.src="data:image/svg+xml,";try{o.drawImage(e,0,0),n.toDataURL()}catch{return!1}return!0},aSe=function(t){return t[0]===0&&t[1]===255&&t[2]===0&&t[3]===255},o$t=function(t){var e=t.createElement("canvas"),n=100;e.width=n,e.height=n;var o=e.getContext("2d");if(!o)return Promise.reject(!1);o.fillStyle="rgb(0, 255, 0)",o.fillRect(0,0,n,n);var r=new Image,i=e.toDataURL();r.src=i;var a=Kue(n,n,0,0,r);return o.fillStyle="red",o.fillRect(0,0,n,n),lSe(a).then(function(l){o.drawImage(l,0,0);var s=o.getImageData(0,0,n,n).data;o.fillStyle="red",o.fillRect(0,0,n,n);var c=t.createElement("div");return c.style.backgroundImage="url("+i+")",c.style.height=n+"px",aSe(s)?lSe(Kue(n,n,0,0,c)):Promise.reject(!1)}).then(function(l){return o.drawImage(l,0,0),aSe(o.getImageData(0,0,n,n).data)}).catch(function(){return!1})},Kue=function(t,e,n,o,r){var i="http://www.w3.org/2000/svg",a=document.createElementNS(i,"svg"),l=document.createElementNS(i,"foreignObject");return a.setAttributeNS(null,"width",t.toString()),a.setAttributeNS(null,"height",e.toString()),l.setAttributeNS(null,"width","100%"),l.setAttributeNS(null,"height","100%"),l.setAttributeNS(null,"x",n.toString()),l.setAttributeNS(null,"y",o.toString()),l.setAttributeNS(null,"externalResourcesRequired","true"),a.appendChild(l),l.appendChild(r),a},lSe=function(t){return new Promise(function(e,n){var o=new Image;o.onload=function(){return e(o)},o.onerror=n,o.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(t))})},sf={get SUPPORT_RANGE_BOUNDS(){var t=Qqt(document);return Object.defineProperty(sf,"SUPPORT_RANGE_BOUNDS",{value:t}),t},get SUPPORT_WORD_BREAKING(){var t=sf.SUPPORT_RANGE_BOUNDS&&Zqt(document);return Object.defineProperty(sf,"SUPPORT_WORD_BREAKING",{value:t}),t},get SUPPORT_SVG_DRAWING(){var t=n$t(document);return Object.defineProperty(sf,"SUPPORT_SVG_DRAWING",{value:t}),t},get SUPPORT_FOREIGNOBJECT_DRAWING(){var t=typeof Array.from=="function"&&typeof window.fetch=="function"?o$t(document):Promise.resolve(!1);return Object.defineProperty(sf,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:t}),t},get SUPPORT_CORS_IMAGES(){var t=e$t();return Object.defineProperty(sf,"SUPPORT_CORS_IMAGES",{value:t}),t},get SUPPORT_RESPONSE_TYPE(){var t=t$t();return Object.defineProperty(sf,"SUPPORT_RESPONSE_TYPE",{value:t}),t},get SUPPORT_CORS_XHR(){var t="withCredentials"in new XMLHttpRequest;return Object.defineProperty(sf,"SUPPORT_CORS_XHR",{value:t}),t},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var t=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(sf,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:t}),t}},HE=function(){function t(e,n){this.text=e,this.bounds=n}return t}(),r$t=function(t,e,n,o){var r=l$t(e,n),i=[],a=0;return r.forEach(function(l){if(n.textDecorationLine.length||l.trim().length>0)if(sf.SUPPORT_RANGE_BOUNDS){var s=sSe(o,a,l.length).getClientRects();if(s.length>1){var c=Mye(l),u=0;c.forEach(function(f){i.push(new HE(f,rA.fromDOMRectList(t,sSe(o,u+a,f.length).getClientRects()))),u+=f.length})}else i.push(new HE(l,rA.fromDOMRectList(t,s)))}else{var d=o.splitText(l.length);i.push(new HE(l,i$t(t,o))),o=d}else sf.SUPPORT_RANGE_BOUNDS||(o=o.splitText(l.length));a+=l.length}),i},i$t=function(t,e){var n=e.ownerDocument;if(n){var o=n.createElement("html2canvaswrapper");o.appendChild(e.cloneNode(!0));var r=e.parentNode;if(r){r.replaceChild(o,e);var i=mQ(t,o);return o.firstChild&&r.replaceChild(o.firstChild,o),i}}return rA.EMPTY},sSe=function(t,e,n){var o=t.ownerDocument;if(!o)throw new Error("Node has no owner document");var r=o.createRange();return r.setStart(t,e),r.setEnd(t,e+n),r},Mye=function(t){if(sf.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(t)).map(function(n){return n.segment})}return $qt(t)},a$t=function(t,e){if(sf.SUPPORT_NATIVE_TEXT_SEGMENTATION){var n=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(n.segment(t)).map(function(o){return o.segment})}return c$t(t,e)},l$t=function(t,e){return e.letterSpacing!==0?Mye(t):a$t(t,e)},s$t=[32,160,4961,65792,65793,4153,4241],c$t=function(t,e){for(var n=LXt(t,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap==="break-word"?"break-word":e.wordBreak}),o=[],r,i=function(){if(r.value){var a=r.value.slice(),l=yQ(a),s="";l.forEach(function(c){s$t.indexOf(c)===-1?s+=E0(c):(s.length&&o.push(s),o.push(E0(c)),s="")}),s.length&&o.push(s)}};!(r=n.next()).done;)i();return o},u$t=function(){function t(e,n,o){this.text=d$t(n.data,o.textTransform),this.textBounds=r$t(e,this.text,o,n)}return t}(),d$t=function(t,e){switch(e){case 1:return t.toLowerCase();case 3:return t.replace(f$t,h$t);case 2:return t.toUpperCase();default:return t}},f$t=/(^|\s|:|-|\(|\))([a-z])/g,h$t=function(t,e,n){return t.length>0?e+n.toUpperCase():t},Fqe=function(t){i5(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.src=o.currentSrc||o.src,r.intrinsicWidth=o.naturalWidth,r.intrinsicHeight=o.naturalHeight,r.context.cache.addImage(r.src),r}return e}(m3),kqe=function(t){i5(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.canvas=o,r.intrinsicWidth=o.width,r.intrinsicHeight=o.height,r}return e}(m3),Lqe=function(t){i5(e,t);function e(n,o){var r=t.call(this,n,o)||this,i=new XMLSerializer,a=mQ(n,o);return o.setAttribute("width",a.width+"px"),o.setAttribute("height",a.height+"px"),r.svg="data:image/svg+xml,"+encodeURIComponent(i.serializeToString(o)),r.intrinsicWidth=o.width.baseVal.value,r.intrinsicHeight=o.height.baseVal.value,r.context.cache.addImage(r.svg),r}return e}(m3),Wqe=function(t){i5(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.value=o.value,r}return e}(m3),que=function(t){i5(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.start=o.start,r.reversed=typeof o.reversed=="boolean"&&o.reversed===!0,r}return e}(m3),p$t=[{type:15,flags:0,unit:"px",number:3}],g$t=[{type:16,flags:0,number:50}],m$t=function(t){return t.width>t.height?new rA(t.left+(t.width-t.height)/2,t.top,t.height,t.height):t.width0)n.textNodes.push(new u$t(t,r,n.styles));else if(tC(r))if(Xqe(r)&&r.assignedNodes)r.assignedNodes().forEach(function(l){return eV(t,l,n,o)});else{var a=Bqe(t,r);a.styles.isVisible()&&(v$t(r,a,o)?a.flags|=4:x$t(a.styles)&&(a.flags|=2),w$t.indexOf(r.tagName)!==-1&&(a.flags|=8),n.elements.push(a),r.slot,r.shadowRoot?eV(t,r.shadowRoot,a,o):!eX(r)&&!_qe(r)&&!tX(r)&&eV(t,r,a,o))}},Bqe=function(t,e){return Que(e)?new Fqe(t,e):Vqe(e)?new kqe(t,e):_qe(e)?new Lqe(t,e):b$t(e)?new Wqe(t,e):S$t(e)?new que(t,e):T$t(e)?new Iye(t,e):tX(e)?new Nqe(t,e):eX(e)?new Uqe(t,e):Gqe(e)?new jqe(t,e):new m3(t,e)},Yqe=function(t,e){var n=Bqe(t,e);return n.flags|=4,eV(t,e,n,n),n},v$t=function(t,e,n){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||zye(t)&&n.styles.isTransparent()},x$t=function(t){return t.isPositioned()||t.isFloating()},Oqe=function(t){return t.nodeType===Node.TEXT_NODE},tC=function(t){return t.nodeType===Node.ELEMENT_NODE},$ue=function(t){return tC(t)&&typeof t.style<"u"&&!tV(t)},tV=function(t){return typeof t.className=="object"},b$t=function(t){return t.tagName==="LI"},S$t=function(t){return t.tagName==="OL"},T$t=function(t){return t.tagName==="INPUT"},P$t=function(t){return t.tagName==="HTML"},_qe=function(t){return t.tagName==="svg"},zye=function(t){return t.tagName==="BODY"},Vqe=function(t){return t.tagName==="CANVAS"},uSe=function(t){return t.tagName==="VIDEO"},Que=function(t){return t.tagName==="IMG"},Gqe=function(t){return t.tagName==="IFRAME"},dSe=function(t){return t.tagName==="STYLE"},C$t=function(t){return t.tagName==="SCRIPT"},eX=function(t){return t.tagName==="TEXTAREA"},tX=function(t){return t.tagName==="SELECT"},Xqe=function(t){return t.tagName==="SLOT"},fSe=function(t){return t.tagName.indexOf("-")>0},R$t=function(){function t(){this.counters={}}return t.prototype.getCounterValue=function(e){var n=this.counters[e];return n&&n.length?n[n.length-1]:1},t.prototype.getCounterValues=function(e){var n=this.counters[e];return n||[]},t.prototype.pop=function(e){var n=this;e.forEach(function(o){return n.counters[o].pop()})},t.prototype.parse=function(e){var n=this,o=e.counterIncrement,r=e.counterReset,i=!0;o!==null&&o.forEach(function(l){var s=n.counters[l.counter];s&&l.increment!==0&&(i=!1,s.length||s.push(1),s[Math.max(0,s.length-1)]+=l.increment)});var a=[];return i&&r.forEach(function(l){var s=n.counters[l.counter];a.push(l.counter),s||(s=n.counters[l.counter]=[]),s.push(l.reset)}),a},t}(),hSe={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},pSe={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},H$t={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},M$t={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},jT=function(t,e,n,o,r,i){return tn?pk(t,r,i.length>0):o.integers.reduce(function(a,l,s){for(;t>=l;)t-=l,a+=o.values[s];return a},"")+i},Jqe=function(t,e,n,o){var r="";do n||t--,r=o(t)+r,t/=e;while(t*e>=e);return r},z0=function(t,e,n,o,r){var i=n-e+1;return(t<0?"-":"")+(Jqe(Math.abs(t),i,o,function(a){return E0(Math.floor(a%i)+e)})+r)},X7=function(t,e,n){n===void 0&&(n=". ");var o=e.length;return Jqe(Math.abs(t),o,!1,function(r){return e[Math.floor(r%o)]})+n},iP=1,W4=2,N4=4,WD=8,a6=function(t,e,n,o,r,i){if(t<-9999||t>9999)return pk(t,4,r.length>0);var a=Math.abs(t),l=r;if(a===0)return e[0]+l;for(var s=0;a>0&&s<=4;s++){var c=a%10;c===0&&Du(i,iP)&&l!==""?l=e[c]+l:c>1||c===1&&s===0||c===1&&s===1&&Du(i,W4)||c===1&&s===1&&Du(i,N4)&&t>100||c===1&&s>1&&Du(i,WD)?l=e[c]+(s>0?n[s-1]:"")+l:c===1&&s>0&&(l=n[s-1]+l),a=Math.floor(a/10)}return(t<0?o:"")+l},gSe="十百千萬",mSe="拾佰仟萬",ySe="マイナス",Yie="마이너스",pk=function(t,e,n){var o=n?". ":"",r=n?"、":"",i=n?", ":"",a=n?" ":"";switch(e){case 0:return"•"+a;case 1:return"◦"+a;case 2:return"◾"+a;case 5:var l=z0(t,48,57,!0,o);return l.length<4?"0"+l:l;case 4:return X7(t,"〇一二三四五六七八九",r);case 6:return jT(t,1,3999,hSe,3,o).toLowerCase();case 7:return jT(t,1,3999,hSe,3,o);case 8:return z0(t,945,969,!1,o);case 9:return z0(t,97,122,!1,o);case 10:return z0(t,65,90,!1,o);case 11:return z0(t,1632,1641,!0,o);case 12:case 49:return jT(t,1,9999,pSe,3,o);case 35:return jT(t,1,9999,pSe,3,o).toLowerCase();case 13:return z0(t,2534,2543,!0,o);case 14:case 30:return z0(t,6112,6121,!0,o);case 15:return X7(t,"子丑寅卯辰巳午未申酉戌亥",r);case 16:return X7(t,"甲乙丙丁戊己庚辛壬癸",r);case 17:case 48:return a6(t,"零一二三四五六七八九",gSe,"負",r,W4|N4|WD);case 47:return a6(t,"零壹貳參肆伍陸柒捌玖",mSe,"負",r,iP|W4|N4|WD);case 42:return a6(t,"零一二三四五六七八九",gSe,"负",r,W4|N4|WD);case 41:return a6(t,"零壹贰叁肆伍陆柒捌玖",mSe,"负",r,iP|W4|N4|WD);case 26:return a6(t,"〇一二三四五六七八九","十百千万",ySe,r,0);case 25:return a6(t,"零壱弐参四伍六七八九","拾百千万",ySe,r,iP|W4|N4);case 31:return a6(t,"영일이삼사오육칠팔구","십백천만",Yie,i,iP|W4|N4);case 33:return a6(t,"零一二三四五六七八九","十百千萬",Yie,i,0);case 32:return a6(t,"零壹貳參四五六七八九","拾百千",Yie,i,iP|W4|N4);case 18:return z0(t,2406,2415,!0,o);case 20:return jT(t,1,19999,M$t,3,o);case 21:return z0(t,2790,2799,!0,o);case 22:return z0(t,2662,2671,!0,o);case 22:return jT(t,1,10999,H$t,3,o);case 23:return X7(t,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return X7(t,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return z0(t,3302,3311,!0,o);case 28:return X7(t,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",r);case 29:return X7(t,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",r);case 34:return z0(t,3792,3801,!0,o);case 37:return z0(t,6160,6169,!0,o);case 38:return z0(t,4160,4169,!0,o);case 39:return z0(t,2918,2927,!0,o);case 40:return z0(t,1776,1785,!0,o);case 43:return z0(t,3046,3055,!0,o);case 44:return z0(t,3174,3183,!0,o);case 45:return z0(t,3664,3673,!0,o);case 46:return z0(t,3872,3881,!0,o);case 3:default:return z0(t,48,57,!0,o)}},Kqe="data-html2canvas-ignore",ASe=function(){function t(e,n,o){if(this.context=e,this.options=o,this.scrolledElements=[],this.referenceElement=n,this.counters=new R$t,this.quoteDepth=0,!n.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(n.ownerDocument.documentElement,!1)}return t.prototype.toIFrame=function(e,n){var o=this,r=I$t(e,n);if(!r.contentWindow)return Promise.reject("Unable to find iframe window");var i=e.defaultView.pageXOffset,a=e.defaultView.pageYOffset,l=r.contentWindow,s=l.document,c=E$t(r).then(function(){return Xh(o,void 0,void 0,function(){var u,d;return Qf(this,function(f){switch(f.label){case 0:return this.scrolledElements.forEach(W$t),l&&(l.scrollTo(n.left,n.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(l.scrollY!==n.top||l.scrollX!==n.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(l.scrollX-n.left,l.scrollY-n.top,0,0))),u=this.options.onclone,d=this.clonedReferenceElement,typeof d>"u"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:s.fonts&&s.fonts.ready?[4,s.fonts.ready]:[3,2];case 1:f.sent(),f.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,D$t(s)]:[3,4];case 3:f.sent(),f.label=4;case 4:return typeof u=="function"?[2,Promise.resolve().then(function(){return u(s,d)}).then(function(){return r})]:[2,r]}})})});return s.open(),s.write(k$t(document.doctype)+""),L$t(this.referenceElement.ownerDocument,i,a),s.replaceChild(s.adoptNode(this.documentElement),s.documentElement),s.close(),c},t.prototype.createElementClone=function(e){if(Jue(e,2))debugger;if(Vqe(e))return this.createCanvasClone(e);if(uSe(e))return this.createVideoClone(e);if(dSe(e))return this.createStyleClone(e);var n=e.cloneNode(!1);return Que(n)&&(Que(e)&&e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc,n.srcset=""),n.loading==="lazy"&&(n.loading="eager")),fSe(n)?this.createCustomElementClone(n):n},t.prototype.createCustomElementClone=function(e){var n=document.createElement("html2canvascustomelement");return Oie(e.style,n),n},t.prototype.createStyleClone=function(e){try{var n=e.sheet;if(n&&n.cssRules){var o=[].slice.call(n.cssRules,0).reduce(function(i,a){return a&&typeof a.cssText=="string"?i+a.cssText:i},""),r=e.cloneNode(!1);return r.textContent=o,r}}catch(i){if(this.context.logger.error("Unable to access cssRules property",i),i.name!=="SecurityError")throw i}return e.cloneNode(!1)},t.prototype.createCanvasClone=function(e){var n;if(this.options.inlineImages&&e.ownerDocument){var o=e.ownerDocument.createElement("img");try{return o.src=e.toDataURL(),o}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var r=e.cloneNode(!1);try{r.width=e.width,r.height=e.height;var i=e.getContext("2d"),a=r.getContext("2d");if(a)if(!this.options.allowTaint&&i)a.putImageData(i.getImageData(0,0,e.width,e.height),0,0);else{var l=(n=e.getContext("webgl2"))!==null&&n!==void 0?n:e.getContext("webgl");if(l){var s=l.getContextAttributes();(s==null?void 0:s.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}a.drawImage(e,0,0)}return r}catch{this.context.logger.info("Unable to clone canvas as it is tainted",e)}return r},t.prototype.createVideoClone=function(e){var n=e.ownerDocument.createElement("canvas");n.width=e.offsetWidth,n.height=e.offsetHeight;var o=n.getContext("2d");try{return o&&(o.drawImage(e,0,0,n.width,n.height),this.options.allowTaint||o.getImageData(0,0,n.width,n.height)),n}catch{this.context.logger.info("Unable to clone video as it is tainted",e)}var r=e.ownerDocument.createElement("canvas");return r.width=e.offsetWidth,r.height=e.offsetHeight,r},t.prototype.appendChildNode=function(e,n,o){(!tC(n)||!C$t(n)&&!n.hasAttribute(Kqe)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(n)))&&(!this.options.copyStyles||!tC(n)||!dSe(n))&&e.appendChild(this.cloneNode(n,o))},t.prototype.cloneChildNodes=function(e,n,o){for(var r=this,i=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;i;i=i.nextSibling)if(tC(i)&&Xqe(i)&&typeof i.assignedNodes=="function"){var a=i.assignedNodes();a.length&&a.forEach(function(l){return r.appendChildNode(n,l,o)})}else this.appendChildNode(n,i,o)},t.prototype.cloneNode=function(e,n){if(Oqe(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var o=e.ownerDocument.defaultView;if(o&&tC(e)&&($ue(e)||tV(e))){var r=this.createElementClone(e);r.style.transitionProperty="none";var i=o.getComputedStyle(e),a=o.getComputedStyle(e,":before"),l=o.getComputedStyle(e,":after");this.referenceElement===e&&$ue(r)&&(this.clonedReferenceElement=r),zye(r)&&j$t(r);var s=this.counters.parse(new Kbe(this.context,i)),c=this.resolvePseudoContent(e,r,a,ME.BEFORE);fSe(e)&&(n=!0),uSe(e)||this.cloneChildNodes(e,r,n),c&&r.insertBefore(c,r.firstChild);var u=this.resolvePseudoContent(e,r,l,ME.AFTER);return u&&r.appendChild(u),this.counters.pop(s),(i&&(this.options.copyStyles||tV(e))&&!Gqe(e)||n)&&Oie(i,r),(e.scrollTop!==0||e.scrollLeft!==0)&&this.scrolledElements.push([r,e.scrollLeft,e.scrollTop]),(eX(e)||tX(e))&&(eX(r)||tX(r))&&(r.value=e.value),r}return e.cloneNode(!1)},t.prototype.resolvePseudoContent=function(e,n,o,r){var i=this;if(o){var a=o.content,l=n.ownerDocument;if(!(!l||!a||a==="none"||a==="-moz-alt-content"||o.display==="none")){this.counters.parse(new Kbe(this.context,o));var s=new bqt(this.context,o),c=l.createElement("html2canvaspseudoelement");Oie(o,c),s.content.forEach(function(d){if(d.type===0)c.appendChild(l.createTextNode(d.value));else if(d.type===22){var f=l.createElement("img");f.src=d.value,f.style.opacity="1",c.appendChild(f)}else if(d.type===18){if(d.name==="attr"){var p=d.values.filter(xs);p.length&&c.appendChild(l.createTextNode(e.getAttribute(p[0].value)||""))}else if(d.name==="counter"){var g=d.values.filter(bR),y=g[0],w=g[1];if(y&&xs(y)){var b=i.counters.getCounterValue(y.value),C=w&&xs(w)?Xue.parse(i.context,w.value):3;c.appendChild(l.createTextNode(pk(b,C,!1)))}}else if(d.name==="counters"){var P=d.values.filter(bR),y=P[0],v=P[1],w=P[2];if(y&&xs(y)){var T=i.counters.getCounterValues(y.value),A=w&&xs(w)?Xue.parse(i.context,w.value):3,x=v&&v.type===0?v.value:"",S=T.map(function(D){return pk(D,A,!1)}).join(x);c.appendChild(l.createTextNode(S))}}}else if(d.type===20)switch(d.value){case"open-quote":c.appendChild(l.createTextNode(Jbe(s.quotes,i.quoteDepth++,!0)));break;case"close-quote":c.appendChild(l.createTextNode(Jbe(s.quotes,--i.quoteDepth,!1)));break;default:c.appendChild(l.createTextNode(d.value))}}),c.className=Zue+" "+ede;var u=r===ME.BEFORE?" "+Zue:" "+ede;return tV(n)?n.className.baseValue+=u:n.className+=u,c}}},t.destroy=function(e){return e.parentNode?(e.parentNode.removeChild(e),!0):!1},t}(),ME;(function(t){t[t.BEFORE=0]="BEFORE",t[t.AFTER=1]="AFTER"})(ME||(ME={}));var I$t=function(t,e){var n=t.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=e.width.toString(),n.height=e.height.toString(),n.scrolling="no",n.setAttribute(Kqe,"true"),t.body.appendChild(n),n},z$t=function(t){return new Promise(function(e){if(t.complete){e();return}if(!t.src){e();return}t.onload=e,t.onerror=e})},D$t=function(t){return Promise.all([].slice.call(t.images,0).map(z$t))},E$t=function(t){return new Promise(function(e,n){var o=t.contentWindow;if(!o)return n("No window assigned for iframe");var r=o.document;o.onload=t.onload=function(){o.onload=t.onload=null;var i=setInterval(function(){r.body.childNodes.length>0&&r.readyState==="complete"&&(clearInterval(i),e(t))},50)}})},F$t=["all","d","content"],Oie=function(t,e){for(var n=t.length-1;n>=0;n--){var o=t.item(n);F$t.indexOf(o)===-1&&e.style.setProperty(o,t.getPropertyValue(o))}return e},k$t=function(t){var e="";return t&&(e+=""),e},L$t=function(t,e,n){t&&t.defaultView&&(e!==t.defaultView.pageXOffset||n!==t.defaultView.pageYOffset)&&t.defaultView.scrollTo(e,n)},W$t=function(t){var e=t[0],n=t[1],o=t[2];e.scrollLeft=n,e.scrollTop=o},N$t=":before",U$t=":after",Zue="___html2canvas___pseudoelement_before",ede="___html2canvas___pseudoelement_after",wSe=`{ +***************************************************************************** */var Eue=function(t,e){return Eue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])},Eue(t,e)};function i5(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Eue(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Fue=function(){return Fue=Object.assign||function(e){for(var n,o=1,r=arguments.length;o0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=55296&&r<=56319&&n>10)+55296,a%1024+56320)),(r+1===n||o.length>16384)&&(i+=String.fromCharCode.apply(String,o),o.length=0)}return i},Pbe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nXt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var VY=0;VY"u"?[]:new Uint8Array(256);for(var GY=0;GY>4,u[r++]=(a&15)<<4|l>>2,u[r++]=(l&3)<<6|s&63;return c},rXt=function(t){for(var e=t.length,n=[],o=0;o>Ax,lXt=1<>Ax,cXt=eqe+sXt,uXt=cXt,dXt=32,fXt=uXt+dXt,hXt=65536>>Cye,pXt=1<=0){if(e<55296||e>56319&&e<=65535)return n=this.index[e>>Ax],n=(n<>Ax)],n=(n<>Cye),n=this.index[n],n+=e>>Ax&gXt,n=this.index[n],n=(n<"u"?[]:new Uint8Array(256);for(var XY=0;XYMbe?(r.push(!0),l-=Mbe):r.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(i)!==-1)return o.push(a),n.push(Wue);if(l===bXt||l===kue){if(a===0)return o.push(a),n.push(bv);var s=n[a-1];return IXt.indexOf(s)===-1?(o.push(o[a-1]),n.push(s)):(o.push(a),n.push(bv))}if(o.push(a),l===RXt)return n.push(e==="strict"?Nue:fk);if(l===rqe||l===CXt)return n.push(bv);if(l===HXt)return i>=131072&&i<=196605||i>=196608&&i<=262141?n.push(fk):n.push(bv);n.push(l)}),[o,n,r]},Iie=function(t,e,n,o){var r=o[n];if(Array.isArray(t)?t.indexOf(r)!==-1:t===r)for(var i=n;i<=o.length;){i++;var a=o[i];if(a===e)return!0;if(a!==w8)break}if(r===w8)for(var i=n;i>0;){i--;var l=o[i];if(Array.isArray(t)?t.indexOf(l)!==-1:t===l)for(var s=n;s<=o.length;){s++;var a=o[s];if(a===e)return!0;if(a!==w8)break}if(l!==w8)break}return!1},Lbe=function(t,e){for(var n=t;n>=0;){var o=e[n];if(o===w8)n--;else return o}return 0},EXt=function(t,e,n,o,r){if(n[o]===0)return qa;var i=o-1;if(Array.isArray(r)&&r[i]===!0)return qa;var a=i-1,l=i+1,s=e[i],c=a>=0?e[a]:0,u=e[l];if(s===tqe&&u===nqe)return qa;if(_ue.indexOf(s)!==-1)return iqe;if(_ue.indexOf(u)!==-1||aqe.indexOf(u)!==-1)return qa;if(Lbe(i,e)===oqe)return $Y;if(Oue.get(t[i])===kue||(s===KY||s===qY)&&Oue.get(t[l])===kue||s===Ibe||u===Ibe||s===zbe||[w8,Lue,DD].indexOf(s)===-1&&u===zbe||[JY,Uz,PXt,WT,NT].indexOf(u)!==-1||Lbe(i,e)===jz||Iie(Hie,jz,i,e)||Iie([JY,Uz],Nue,i,e)||Iie(Dbe,Dbe,i,e))return qa;if(s===w8)return $Y;if(s===Hie||u===Hie)return qa;if(u===Wue||s===Wue)return $Y;if([Lue,DD,Nue].indexOf(u)!==-1||s===TXt||c===Bue&&zXt.indexOf(s)!==-1||s===NT&&u===Bue||u===Ebe||i6.indexOf(u)!==-1&&s===J1||i6.indexOf(s)!==-1&&u===J1||s===FD&&[fk,KY,qY].indexOf(u)!==-1||[fk,KY,qY].indexOf(s)!==-1&&u===ED||i6.indexOf(s)!==-1&&Fbe.indexOf(u)!==-1||Fbe.indexOf(s)!==-1&&i6.indexOf(u)!==-1||[FD,ED].indexOf(s)!==-1&&(u===J1||[jz,DD].indexOf(u)!==-1&&e[l+1]===J1)||[jz,DD].indexOf(s)!==-1&&u===J1||s===J1&&[J1,NT,WT].indexOf(u)!==-1)return qa;if([J1,NT,WT,JY,Uz].indexOf(u)!==-1)for(var d=i;d>=0;){var f=e[d];if(f===J1)return qa;if([NT,WT].indexOf(f)!==-1)d--;else break}if([FD,ED].indexOf(u)!==-1)for(var d=[JY,Uz].indexOf(s)!==-1?a:i;d>=0;){var f=e[d];if(f===J1)return qa;if([NT,WT].indexOf(f)!==-1)d--;else break}if(Yue===s&&[Yue,Z_,Uue,jue].indexOf(u)!==-1||[Z_,Uue].indexOf(s)!==-1&&[Z_,eV].indexOf(u)!==-1||[eV,jue].indexOf(s)!==-1&&u===eV||kbe.indexOf(s)!==-1&&[Ebe,ED].indexOf(u)!==-1||kbe.indexOf(u)!==-1&&s===FD||i6.indexOf(s)!==-1&&i6.indexOf(u)!==-1||s===WT&&i6.indexOf(u)!==-1||i6.concat(J1).indexOf(s)!==-1&&u===jz&&MXt.indexOf(t[l])===-1||i6.concat(J1).indexOf(u)!==-1&&s===Uz)return qa;if(s===Mie&&u===Mie){for(var p=n[i],g=1;p>0&&(p--,e[p]===Mie);)g++;if(g%2!==0)return qa}return s===KY&&u===qY?qa:$Y},FXt=function(t,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var n=DXt(t,e.lineBreak),o=n[0],r=n[1],i=n[2];(e.wordBreak==="break-all"||e.wordBreak==="break-word")&&(r=r.map(function(l){return[J1,bv,rqe].indexOf(l)!==-1?fk:l}));var a=e.wordBreak==="keep-all"?i.map(function(l,s){return l&&t[s]>=19968&&t[s]<=40959}):void 0;return[o,r,a]},kXt=function(){function t(e,n,o,r){this.codePoints=e,this.required=n===iqe,this.start=o,this.end=r}return t.prototype.slice=function(){return E0.apply(void 0,this.codePoints.slice(this.start,this.end))},t}(),LXt=function(t,e){var n=yQ(t),o=FXt(n,e),r=o[0],i=o[1],a=o[2],l=n.length,s=0,c=0;return{next:function(){if(c>=l)return{done:!0,value:null};for(var u=qa;c=lqe&&t<=57},mJt=function(t){return t>=55296&&t<=57343},UT=function(t){return nh(t)||t>=uqe&&t<=fqe||t>=sqe&&t<=dJt},yJt=function(t){return t>=sqe&&t<=hJt},AJt=function(t){return t>=uqe&&t<=gJt},wJt=function(t){return yJt(t)||AJt(t)},vJt=function(t){return t>=tJt},nO=function(t){return t===qG||t===UXt||t===jXt},$G=function(t){return wJt(t)||vJt(t)||t===_Xt},Bbe=function(t){return $G(t)||nh(t)||t===kp},xJt=function(t){return t>=iJt&&t<=aJt||t===lJt||t>=sJt&&t<=cJt||t===uJt},K4=function(t,e){return t!==PE?!1:e!==qG},oO=function(t,e,n){return t===kp?$G(e)||K4(e,n):$G(t)?!0:!!(t===PE&&K4(t,e))},Die=function(t,e,n){return t===Yv||t===kp?nh(e)?!0:e===hk&&nh(n):nh(t===hk?e:t)},bJt=function(t){var e=0,n=1;(t[e]===Yv||t[e]===kp)&&(t[e]===kp&&(n=-1),e++);for(var o=[];nh(t[e]);)o.push(t[e++]);var r=o.length?parseInt(E0.apply(void 0,o),10):0;t[e]===hk&&e++;for(var i=[];nh(t[e]);)i.push(t[e++]);var a=i.length,l=a?parseInt(E0.apply(void 0,i),10):0;(t[e]===dqe||t[e]===cqe)&&e++;var s=1;(t[e]===Yv||t[e]===kp)&&(t[e]===kp&&(s=-1),e++);for(var c=[];nh(t[e]);)c.push(t[e++]);var u=c.length?parseInt(E0.apply(void 0,c),10):0;return n*(r+l*Math.pow(10,-a))*Math.pow(10,s*u)},SJt={type:2},TJt={type:3},PJt={type:4},CJt={type:13},RJt={type:8},HJt={type:21},MJt={type:9},IJt={type:10},zJt={type:11},DJt={type:12},EJt={type:14},rO={type:23},FJt={type:1},kJt={type:25},LJt={type:24},WJt={type:26},NJt={type:27},UJt={type:28},jJt={type:29},BJt={type:31},Vue={type:32},hqe=function(){function t(){this._value=[]}return t.prototype.write=function(e){this._value=this._value.concat(yQ(e))},t.prototype.read=function(){for(var e=[],n=this.consumeToken();n!==Vue;)e.push(n),n=this.consumeToken();return e},t.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case QY:return this.consumeStringToken(QY);case BXt:var n=this.peekCodePoint(0),o=this.peekCodePoint(1),r=this.peekCodePoint(2);if(Bbe(n)||K4(o,r)){var i=oO(n,o,r)?NXt:WXt,a=this.consumeName();return{type:5,value:a,flags:i}}break;case YXt:if(this.peekCodePoint(0)===Bz)return this.consumeCodePoint(),CJt;break;case ZY:return this.consumeStringToken(ZY);case eO:return SJt;case Yz:return TJt;case zie:if(this.peekCodePoint(0)===Bz)return this.consumeCodePoint(),EJt;break;case Yv:if(Die(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case nJt:return PJt;case kp:var l=e,s=this.peekCodePoint(0),c=this.peekCodePoint(1);if(Die(l,s,c))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(oO(l,s,c))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(s===kp&&c===XXt)return this.consumeCodePoint(),this.consumeCodePoint(),LJt;break;case hk:if(Die(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Nbe:if(this.peekCodePoint(0)===zie)for(this.consumeCodePoint();;){var u=this.consumeCodePoint();if(u===zie&&(u=this.consumeCodePoint(),u===Nbe))return this.consumeToken();if(u===X5)return this.consumeToken()}break;case oJt:return WJt;case rJt:return NJt;case GXt:if(this.peekCodePoint(0)===VXt&&this.peekCodePoint(1)===kp&&this.peekCodePoint(2)===kp)return this.consumeCodePoint(),this.consumeCodePoint(),kJt;break;case JXt:var d=this.peekCodePoint(0),f=this.peekCodePoint(1),p=this.peekCodePoint(2);if(oO(d,f,p)){var a=this.consumeName();return{type:7,value:a}}break;case KXt:return UJt;case PE:if(K4(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case qXt:return jJt;case $Xt:if(this.peekCodePoint(0)===Bz)return this.consumeCodePoint(),RJt;break;case QXt:return zJt;case ZXt:return DJt;case fJt:case pJt:var g=this.peekCodePoint(0),y=this.peekCodePoint(1);return g===Yv&&(UT(y)||y===tO)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case Ube:if(this.peekCodePoint(0)===Bz)return this.consumeCodePoint(),MJt;if(this.peekCodePoint(0)===Ube)return this.consumeCodePoint(),HJt;break;case eJt:if(this.peekCodePoint(0)===Bz)return this.consumeCodePoint(),IJt;break;case X5:return Vue}return nO(e)?(this.consumeWhiteSpace(),BJt):nh(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):$G(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:E0(e)}},t.prototype.consumeCodePoint=function(){var e=this._value.shift();return typeof e>"u"?-1:e},t.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},t.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},t.prototype.consumeUnicodeRangeToken=function(){for(var e=[],n=this.consumeCodePoint();UT(n)&&e.length<6;)e.push(n),n=this.consumeCodePoint();for(var o=!1;n===tO&&e.length<6;)e.push(n),n=this.consumeCodePoint(),o=!0;if(o){var r=parseInt(E0.apply(void 0,e.map(function(s){return s===tO?lqe:s})),16),i=parseInt(E0.apply(void 0,e.map(function(s){return s===tO?fqe:s})),16);return{type:30,start:r,end:i}}var a=parseInt(E0.apply(void 0,e),16);if(this.peekCodePoint(0)===kp&&UT(this.peekCodePoint(1))){this.consumeCodePoint(),n=this.consumeCodePoint();for(var l=[];UT(n)&&l.length<6;)l.push(n),n=this.consumeCodePoint();var i=parseInt(E0.apply(void 0,l),16);return{type:30,start:a,end:i}}else return{type:30,start:a,end:a}},t.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return e.toLowerCase()==="url"&&this.peekCodePoint(0)===eO?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===eO?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},t.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===X5)return{type:22,value:""};var n=this.peekCodePoint(0);if(n===ZY||n===QY){var o=this.consumeStringToken(this.consumeCodePoint());return o.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===X5||this.peekCodePoint(0)===Yz)?(this.consumeCodePoint(),{type:22,value:o.value}):(this.consumeBadUrlRemnants(),rO)}for(;;){var r=this.consumeCodePoint();if(r===X5||r===Yz)return{type:22,value:E0.apply(void 0,e)};if(nO(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===X5||this.peekCodePoint(0)===Yz?(this.consumeCodePoint(),{type:22,value:E0.apply(void 0,e)}):(this.consumeBadUrlRemnants(),rO);if(r===QY||r===ZY||r===eO||xJt(r))return this.consumeBadUrlRemnants(),rO;if(r===PE)if(K4(r,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),rO;else e.push(r)}},t.prototype.consumeWhiteSpace=function(){for(;nO(this.peekCodePoint(0));)this.consumeCodePoint()},t.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===Yz||e===X5)return;K4(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},t.prototype.consumeStringSlice=function(e){for(var n=5e4,o="";e>0;){var r=Math.min(n,e);o+=E0.apply(void 0,this._value.splice(0,r)),e-=r}return this._value.shift(),o},t.prototype.consumeStringToken=function(e){var n="",o=0;do{var r=this._value[o];if(r===X5||r===void 0||r===e)return n+=this.consumeStringSlice(o),{type:0,value:n};if(r===qG)return this._value.splice(0,o),FJt;if(r===PE){var i=this._value[o+1];i!==X5&&i!==void 0&&(i===qG?(n+=this.consumeStringSlice(o),o=-1,this._value.shift()):K4(r,i)&&(n+=this.consumeStringSlice(o),n+=E0(this.consumeEscapedCodePoint()),o=-1))}o++}while(!0)},t.prototype.consumeNumber=function(){var e=[],n=oN,o=this.peekCodePoint(0);for((o===Yv||o===kp)&&e.push(this.consumeCodePoint());nh(this.peekCodePoint(0));)e.push(this.consumeCodePoint());o=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(o===hk&&nh(r))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),n=Wbe;nh(this.peekCodePoint(0));)e.push(this.consumeCodePoint());o=this.peekCodePoint(0),r=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((o===dqe||o===cqe)&&((r===Yv||r===kp)&&nh(i)||nh(r)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),n=Wbe;nh(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[bJt(e),n]},t.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),n=e[0],o=e[1],r=this.peekCodePoint(0),i=this.peekCodePoint(1),a=this.peekCodePoint(2);if(oO(r,i,a)){var l=this.consumeName();return{type:15,number:n,flags:o,unit:l}}return r===OXt?(this.consumeCodePoint(),{type:16,number:n,flags:o}):{type:17,number:n,flags:o}},t.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(UT(e)){for(var n=E0(e);UT(this.peekCodePoint(0))&&n.length<6;)n+=E0(this.consumeCodePoint());nO(this.peekCodePoint(0))&&this.consumeCodePoint();var o=parseInt(n,16);return o===0||mJt(o)||o>1114111?jbe:o}return e===X5?jbe:e},t.prototype.consumeName=function(){for(var e="";;){var n=this.consumeCodePoint();if(Bbe(n))e+=E0(n);else if(K4(n,this.peekCodePoint(0)))e+=E0(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(n),e}},t}(),pqe=function(){function t(e){this._tokens=e}return t.create=function(e){var n=new hqe;return n.write(e),new t(n.read())},t.parseValue=function(e){return t.create(e).parseComponentValue()},t.parseValues=function(e){return t.create(e).parseComponentValues()},t.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===31;)e=this.consumeToken();if(e.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var n=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return n;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},t.prototype.parseComponentValues=function(){for(var e=[];;){var n=this.consumeComponentValue();if(n.type===32)return e;e.push(n),e.push()}},t.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},t.prototype.consumeSimpleBlock=function(e){for(var n={type:e,values:[]},o=this.consumeToken();;){if(o.type===32||OJt(o,e))return n;this.reconsumeToken(o),n.values.push(this.consumeComponentValue()),o=this.consumeToken()}},t.prototype.consumeFunction=function(e){for(var n={name:e.value,values:[],type:18};;){var o=this.consumeToken();if(o.type===32||o.type===3)return n;this.reconsumeToken(o),n.values.push(this.consumeComponentValue())}},t.prototype.consumeToken=function(){var e=this._tokens.shift();return typeof e>"u"?Vue:e},t.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},t}(),rN=function(t){return t.type===15},KH=function(t){return t.type===17},xs=function(t){return t.type===20},YJt=function(t){return t.type===0},Gue=function(t,e){return xs(t)&&t.value===e},gqe=function(t){return t.type!==31},bR=function(t){return t.type!==31&&t.type!==4},g3=function(t){var e=[],n=[];return t.forEach(function(o){if(o.type===4){if(n.length===0)throw new Error("Error parsing function args, zero tokens for arg");e.push(n),n=[];return}o.type!==31&&n.push(o)}),n.length&&e.push(n),e},OJt=function(t,e){return e===11&&t.type===12||e===28&&t.type===29?!0:e===2&&t.type===3},dw=function(t){return t.type===17||t.type===15},au=function(t){return t.type===16||dw(t)},mqe=function(t){return t.length>1?[t[0],t[1]]:[t[0]]},ff={type:17,number:0,flags:oN},Rye={type:16,number:50,flags:oN},v8={type:16,number:100,flags:oN},kD=function(t,e,n){var o=t[0],r=t[1];return[Xs(o,e),Xs(typeof r<"u"?r:o,n)]},Xs=function(t,e){if(t.type===16)return t.number/100*e;if(rN(t))switch(t.unit){case"rem":case"em":return 16*t.number;case"px":default:return t.number}return t.number},yqe="deg",Aqe="grad",wqe="rad",vqe="turn",AQ={name:"angle",parse:function(t,e){if(e.type===15)switch(e.unit){case yqe:return Math.PI*e.number/180;case Aqe:return Math.PI/200*e.number;case wqe:return e.number;case vqe:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},xqe=function(t){return t.type===15&&(t.unit===yqe||t.unit===Aqe||t.unit===wqe||t.unit===vqe)},bqe=function(t){var e=t.filter(xs).map(function(n){return n.value}).join(" ");switch(e){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ff,ff];case"to top":case"bottom":return Um(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ff,v8];case"to right":case"left":return Um(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[v8,v8];case"to bottom":case"top":return Um(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[v8,ff];case"to left":case"right":return Um(270)}return 0},Um=function(t){return Math.PI*t/180},B8={name:"color",parse:function(t,e){if(e.type===18){var n=_Jt[e.name];if(typeof n>"u")throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return n(t,e.values)}if(e.type===5){if(e.value.length===3){var o=e.value.substring(0,1),r=e.value.substring(1,2),i=e.value.substring(2,3);return x8(parseInt(o+o,16),parseInt(r+r,16),parseInt(i+i,16),1)}if(e.value.length===4){var o=e.value.substring(0,1),r=e.value.substring(1,2),i=e.value.substring(2,3),a=e.value.substring(3,4);return x8(parseInt(o+o,16),parseInt(r+r,16),parseInt(i+i,16),parseInt(a+a,16)/255)}if(e.value.length===6){var o=e.value.substring(0,2),r=e.value.substring(2,4),i=e.value.substring(4,6);return x8(parseInt(o,16),parseInt(r,16),parseInt(i,16),1)}if(e.value.length===8){var o=e.value.substring(0,2),r=e.value.substring(2,4),i=e.value.substring(4,6),a=e.value.substring(6,8);return x8(parseInt(o,16),parseInt(r,16),parseInt(i,16),parseInt(a,16)/255)}}if(e.type===20){var l=k6[e.value.toUpperCase()];if(typeof l<"u")return l}return k6.TRANSPARENT}},Y8=function(t){return(255&t)===0},fd=function(t){var e=255&t,n=255&t>>8,o=255&t>>16,r=255&t>>24;return e<255?"rgba("+r+","+o+","+n+","+e/255+")":"rgb("+r+","+o+","+n+")"},x8=function(t,e,n,o){return(t<<24|e<<16|n<<8|Math.round(o*255)<<0)>>>0},Ybe=function(t,e){if(t.type===17)return t.number;if(t.type===16){var n=e===3?1:255;return e===3?t.number/100*n:Math.round(t.number/100*n)}return 0},Obe=function(t,e){var n=e.filter(bR);if(n.length===3){var o=n.map(Ybe),r=o[0],i=o[1],a=o[2];return x8(r,i,a,1)}if(n.length===4){var l=n.map(Ybe),r=l[0],i=l[1],a=l[2],s=l[3];return x8(r,i,a,s)}return 0};function Eie(t,e,n){return n<0&&(n+=1),n>=1&&(n-=1),n<1/6?(e-t)*n*6+t:n<1/2?e:n<2/3?(e-t)*6*(2/3-n)+t:t}var _be=function(t,e){var n=e.filter(bR),o=n[0],r=n[1],i=n[2],a=n[3],l=(o.type===17?Um(o.number):AQ.parse(t,o))/(Math.PI*2),s=au(r)?r.number/100:0,c=au(i)?i.number/100:0,u=typeof a<"u"&&au(a)?Xs(a,1):1;if(s===0)return x8(c*255,c*255,c*255,1);var d=c<=.5?c*(s+1):c+s-c*s,f=c*2-d,p=Eie(f,d,l+1/3),g=Eie(f,d,l),y=Eie(f,d,l-1/3);return x8(p*255,g*255,y*255,u)},_Jt={hsl:_be,hsla:_be,rgb:Obe,rgba:Obe},CE=function(t,e){return B8.parse(t,pqe.create(e).parseComponentValue())},k6={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},VJt={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(t,e){return e.map(function(n){if(xs(n))switch(n.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},GJt={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},wQ=function(t,e){var n=B8.parse(t,e[0]),o=e[1];return o&&au(o)?{color:n,stop:o}:{color:n,stop:null}},Vbe=function(t,e){var n=t[0],o=t[t.length-1];n.stop===null&&(n.stop=ff),o.stop===null&&(o.stop=v8);for(var r=[],i=0,a=0;ai?r.push(s):r.push(i),i=s}else r.push(null)}for(var c=null,a=0;aa.optimumDistance)?{optimumCorner:l,optimumDistance:u}:a},{optimumDistance:r?1/0:-1/0,optimumCorner:null}).optimumCorner},KJt=function(t,e,n,o,r){var i=0,a=0;switch(t.size){case 0:t.shape===0?i=a=Math.min(Math.abs(e),Math.abs(e-o),Math.abs(n),Math.abs(n-r)):t.shape===1&&(i=Math.min(Math.abs(e),Math.abs(e-o)),a=Math.min(Math.abs(n),Math.abs(n-r)));break;case 2:if(t.shape===0)i=a=Math.min(Zy(e,n),Zy(e,n-r),Zy(e-o,n),Zy(e-o,n-r));else if(t.shape===1){var l=Math.min(Math.abs(n),Math.abs(n-r))/Math.min(Math.abs(e),Math.abs(e-o)),s=Gbe(o,r,e,n,!0),c=s[0],u=s[1];i=Zy(c-e,(u-n)/l),a=l*i}break;case 1:t.shape===0?i=a=Math.max(Math.abs(e),Math.abs(e-o),Math.abs(n),Math.abs(n-r)):t.shape===1&&(i=Math.max(Math.abs(e),Math.abs(e-o)),a=Math.max(Math.abs(n),Math.abs(n-r)));break;case 3:if(t.shape===0)i=a=Math.max(Zy(e,n),Zy(e,n-r),Zy(e-o,n),Zy(e-o,n-r));else if(t.shape===1){var l=Math.max(Math.abs(n),Math.abs(n-r))/Math.max(Math.abs(e),Math.abs(e-o)),d=Gbe(o,r,e,n,!1),c=d[0],u=d[1];i=Zy(c-e,(u-n)/l),a=l*i}break}return Array.isArray(t.size)&&(i=Xs(t.size[0],o),a=t.size.length===2?Xs(t.size[1],r):i),[i,a]},qJt=function(t,e){var n=Um(180),o=[];return g3(e).forEach(function(r,i){if(i===0){var a=r[0];if(a.type===20&&a.value==="to"){n=bqe(r);return}else if(xqe(a)){n=AQ.parse(t,a);return}}var l=wQ(t,r);o.push(l)}),{angle:n,stops:o,type:1}},iO=function(t,e){var n=Um(180),o=[];return g3(e).forEach(function(r,i){if(i===0){var a=r[0];if(a.type===20&&["top","left","right","bottom"].indexOf(a.value)!==-1){n=bqe(r);return}else if(xqe(a)){n=(AQ.parse(t,a)+Um(270))%Um(360);return}}var l=wQ(t,r);o.push(l)}),{angle:n,stops:o,type:1}},$Jt=function(t,e){var n=Um(180),o=[],r=1,i=0,a=3,l=[];return g3(e).forEach(function(s,c){var u=s[0];if(c===0){if(xs(u)&&u.value==="linear"){r=1;return}else if(xs(u)&&u.value==="radial"){r=2;return}}if(u.type===18){if(u.name==="from"){var d=B8.parse(t,u.values[0]);o.push({stop:ff,color:d})}else if(u.name==="to"){var d=B8.parse(t,u.values[0]);o.push({stop:v8,color:d})}else if(u.name==="color-stop"){var f=u.values.filter(bR);if(f.length===2){var d=B8.parse(t,f[1]),p=f[0];KH(p)&&o.push({stop:{type:16,number:p.number*100,flags:p.flags},color:d})}}}}),r===1?{angle:(n+Um(180))%Um(360),stops:o,type:r}:{size:a,shape:i,stops:o,position:l,type:r}},Sqe="closest-side",Tqe="farthest-side",Pqe="closest-corner",Cqe="farthest-corner",Rqe="circle",Hqe="ellipse",Mqe="cover",Iqe="contain",QJt=function(t,e){var n=0,o=3,r=[],i=[];return g3(e).forEach(function(a,l){var s=!0;if(l===0){var c=!1;s=a.reduce(function(d,f){if(c)if(xs(f))switch(f.value){case"center":return i.push(Rye),d;case"top":case"left":return i.push(ff),d;case"right":case"bottom":return i.push(v8),d}else(au(f)||dw(f))&&i.push(f);else if(xs(f))switch(f.value){case Rqe:return n=0,!1;case Hqe:return n=1,!1;case"at":return c=!0,!1;case Sqe:return o=0,!1;case Mqe:case Tqe:return o=1,!1;case Iqe:case Pqe:return o=2,!1;case Cqe:return o=3,!1}else if(dw(f)||au(f))return Array.isArray(o)||(o=[]),o.push(f),!1;return d},s)}if(s){var u=wQ(t,a);r.push(u)}}),{size:o,shape:n,stops:r,position:i,type:2}},aO=function(t,e){var n=0,o=3,r=[],i=[];return g3(e).forEach(function(a,l){var s=!0;if(l===0?s=a.reduce(function(u,d){if(xs(d))switch(d.value){case"center":return i.push(Rye),!1;case"top":case"left":return i.push(ff),!1;case"right":case"bottom":return i.push(v8),!1}else if(au(d)||dw(d))return i.push(d),!1;return u},s):l===1&&(s=a.reduce(function(u,d){if(xs(d))switch(d.value){case Rqe:return n=0,!1;case Hqe:return n=1,!1;case Iqe:case Sqe:return o=0,!1;case Tqe:return o=1,!1;case Pqe:return o=2,!1;case Mqe:case Cqe:return o=3,!1}else if(dw(d)||au(d))return Array.isArray(o)||(o=[]),o.push(d),!1;return u},s)),s){var c=wQ(t,a);r.push(c)}}),{size:o,shape:n,stops:r,position:i,type:2}},ZJt=function(t){return t.type===1},eKt=function(t){return t.type===2},Hye={name:"image",parse:function(t,e){if(e.type===22){var n={url:e.value,type:0};return t.cache.addImage(e.value),n}if(e.type===18){var o=zqe[e.name];if(typeof o>"u")throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return o(t,e.values)}throw new Error("Unsupported image type "+e.type)}};function tKt(t){return!(t.type===20&&t.value==="none")&&(t.type!==18||!!zqe[t.name])}var zqe={"linear-gradient":qJt,"-moz-linear-gradient":iO,"-ms-linear-gradient":iO,"-o-linear-gradient":iO,"-webkit-linear-gradient":iO,"radial-gradient":QJt,"-moz-radial-gradient":aO,"-ms-radial-gradient":aO,"-o-radial-gradient":aO,"-webkit-radial-gradient":aO,"-webkit-gradient":$Jt},nKt={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(t,e){if(e.length===0)return[];var n=e[0];return n.type===20&&n.value==="none"?[]:e.filter(function(o){return bR(o)&&tKt(o)}).map(function(o){return Hye.parse(t,o)})}},oKt={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(t,e){return e.map(function(n){if(xs(n))switch(n.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},rKt={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(t,e){return g3(e).map(function(n){return n.filter(au)}).map(mqe)}},iKt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(t,e){return g3(e).map(function(n){return n.filter(xs).map(function(o){return o.value}).join(" ")}).map(aKt)}},aKt=function(t){switch(t){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},zC;(function(t){t.AUTO="auto",t.CONTAIN="contain",t.COVER="cover"})(zC||(zC={}));var lKt={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(t,e){return g3(e).map(function(n){return n.filter(sKt)})}},sKt=function(t){return xs(t)||au(t)},vQ=function(t){return{name:"border-"+t+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},cKt=vQ("top"),uKt=vQ("right"),dKt=vQ("bottom"),fKt=vQ("left"),xQ=function(t){return{name:"border-radius-"+t,initialValue:"0 0",prefix:!1,type:1,parse:function(e,n){return mqe(n.filter(au))}}},hKt=xQ("top-left"),pKt=xQ("top-right"),gKt=xQ("bottom-right"),mKt=xQ("bottom-left"),bQ=function(t){return{name:"border-"+t+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,n){switch(n){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},yKt=bQ("top"),AKt=bQ("right"),wKt=bQ("bottom"),vKt=bQ("left"),SQ=function(t){return{name:"border-"+t+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,n){return rN(n)?n.number:0}}},xKt=SQ("top"),bKt=SQ("right"),SKt=SQ("bottom"),TKt=SQ("left"),PKt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},CKt={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(t,e){switch(e){case"rtl":return 1;case"ltr":default:return 0}}},RKt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(t,e){return e.filter(xs).reduce(function(n,o){return n|HKt(o.value)},0)}},HKt=function(t){switch(t){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},MKt={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},IKt={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(t,e){return e.type===20&&e.value==="normal"?0:e.type===17||e.type===15?e.number:0}},QG;(function(t){t.NORMAL="normal",t.STRICT="strict"})(QG||(QG={}));var zKt={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"strict":return QG.STRICT;case"normal":default:return QG.NORMAL}}},DKt={name:"line-height",initialValue:"normal",prefix:!1,type:4},Xbe=function(t,e){return xs(t)&&t.value==="normal"?1.2*e:t.type===17?e*t.number:au(t)?Xs(t,e):e},EKt={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(t,e){return e.type===20&&e.value==="none"?null:Hye.parse(t,e)}},FKt={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(t,e){switch(e){case"inside":return 0;case"outside":default:return 1}}},Xue={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},TQ=function(t){return{name:"margin-"+t,initialValue:"0",prefix:!1,type:4}},kKt=TQ("top"),LKt=TQ("right"),WKt=TQ("bottom"),NKt=TQ("left"),UKt={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(t,e){return e.filter(xs).map(function(n){switch(n.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},jKt={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"break-word":return"break-word";case"normal":default:return"normal"}}},PQ=function(t){return{name:"padding-"+t,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},BKt=PQ("top"),YKt=PQ("right"),OKt=PQ("bottom"),_Kt=PQ("left"),VKt={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(t,e){switch(e){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},GKt={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(t,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},XKt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return e.length===1&&Gue(e[0],"none")?[]:g3(e).map(function(n){for(var o={color:k6.TRANSPARENT,offsetX:ff,offsetY:ff,blur:ff},r=0,i=0;i"u")throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return n(e.values)}return null}},qKt=function(t){var e=t.filter(function(n){return n.type===17}).map(function(n){return n.number});return e.length===6?e:null},$Kt=function(t){var e=t.filter(function(s){return s.type===17}).map(function(s){return s.number}),n=e[0],o=e[1];e[2],e[3];var r=e[4],i=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var a=e[12],l=e[13];return e[14],e[15],e.length===16?[n,o,r,i,a,l]:null},QKt={matrix:qKt,matrix3d:$Kt},Jbe={type:16,number:50,flags:oN},ZKt=[Jbe,Jbe],eqt={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(t,e){var n=e.filter(au);return n.length!==2?ZKt:[n[0],n[1]]}},tqt={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},RE;(function(t){t.NORMAL="normal",t.BREAK_ALL="break-all",t.KEEP_ALL="keep-all"})(RE||(RE={}));var nqt={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"break-all":return RE.BREAK_ALL;case"keep-all":return RE.KEEP_ALL;case"normal":default:return RE.NORMAL}}},oqt={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(t,e){if(e.type===20)return{auto:!0,order:0};if(KH(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},Dqe={name:"time",parse:function(t,e){if(e.type===15)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},rqt={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(t,e){return KH(e)?e.number:1}},iqt={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},aqt={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(t,e){return e.filter(xs).map(function(n){switch(n.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(n){return n!==0})}},lqt={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(t,e){var n=[],o=[];return e.forEach(function(r){switch(r.type){case 20:case 0:n.push(r.value);break;case 17:n.push(r.number.toString());break;case 4:o.push(n.join(" ")),n.length=0;break}}),n.length&&o.push(n.join(" ")),o.map(function(r){return r.indexOf(" ")===-1?r:"'"+r+"'"})}},sqt={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},cqt={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(t,e){if(KH(e))return e.number;if(xs(e))switch(e.value){case"bold":return 700;case"normal":default:return 400}return 400}},uqt={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return e.filter(xs).map(function(n){return n.value})}},dqt={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},Du=function(t,e){return(t&e)!==0},fqt={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(t,e){if(e.length===0)return[];var n=e[0];return n.type===20&&n.value==="none"?[]:e}},hqt={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(t,e){if(e.length===0)return null;var n=e[0];if(n.type===20&&n.value==="none")return null;for(var o=[],r=e.filter(gqe),i=0;i1?1:0],this.overflowWrap=Er(e,jKt,n.overflowWrap),this.paddingTop=Er(e,BKt,n.paddingTop),this.paddingRight=Er(e,YKt,n.paddingRight),this.paddingBottom=Er(e,OKt,n.paddingBottom),this.paddingLeft=Er(e,_Kt,n.paddingLeft),this.paintOrder=Er(e,Aqt,n.paintOrder),this.position=Er(e,GKt,n.position),this.textAlign=Er(e,VKt,n.textAlign),this.textDecorationColor=Er(e,iqt,(o=n.textDecorationColor)!==null&&o!==void 0?o:n.color),this.textDecorationLine=Er(e,aqt,(r=n.textDecorationLine)!==null&&r!==void 0?r:n.textDecoration),this.textShadow=Er(e,XKt,n.textShadow),this.textTransform=Er(e,JKt,n.textTransform),this.transform=Er(e,KKt,n.transform),this.transformOrigin=Er(e,eqt,n.transformOrigin),this.visibility=Er(e,tqt,n.visibility),this.webkitTextStrokeColor=Er(e,wqt,n.webkitTextStrokeColor),this.webkitTextStrokeWidth=Er(e,vqt,n.webkitTextStrokeWidth),this.wordBreak=Er(e,nqt,n.wordBreak),this.zIndex=Er(e,oqt,n.zIndex)}return t.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},t.prototype.isTransparent=function(){return Y8(this.backgroundColor)},t.prototype.isTransformed=function(){return this.transform!==null},t.prototype.isPositioned=function(){return this.position!==0},t.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},t.prototype.isFloating=function(){return this.float!==0},t.prototype.isInlineLevel=function(){return Du(this.display,4)||Du(this.display,33554432)||Du(this.display,268435456)||Du(this.display,536870912)||Du(this.display,67108864)||Du(this.display,134217728)},t}(),bqt=function(){function t(e,n){this.content=Er(e,fqt,n.content),this.quotes=Er(e,mqt,n.quotes)}return t}(),qbe=function(){function t(e,n){this.counterIncrement=Er(e,hqt,n.counterIncrement),this.counterReset=Er(e,pqt,n.counterReset)}return t}(),Er=function(t,e,n){var o=new hqe,r=n!==null&&typeof n<"u"?n.toString():e.initialValue;o.write(r);var i=new pqe(o.read());switch(e.type){case 2:var a=i.parseComponentValue();return e.parse(t,xs(a)?a.value:e.initialValue);case 0:return e.parse(t,i.parseComponentValue());case 1:return e.parse(t,i.parseComponentValues());case 4:return i.parseComponentValue();case 3:switch(e.format){case"angle":return AQ.parse(t,i.parseComponentValue());case"color":return B8.parse(t,i.parseComponentValue());case"image":return Hye.parse(t,i.parseComponentValue());case"length":var l=i.parseComponentValue();return dw(l)?l:ff;case"length-percentage":var s=i.parseComponentValue();return au(s)?s:ff;case"time":return Dqe.parse(t,i.parseComponentValue())}break}},Sqt="data-html2canvas-debug",Tqt=function(t){var e=t.getAttribute(Sqt);switch(e){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Jue=function(t,e){var n=Tqt(t);return n===1||e===n},m3=function(){function t(e,n){if(this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Jue(n,3))debugger;this.styles=new xqt(e,window.getComputedStyle(n,null)),$ue(n)&&(this.styles.animationDuration.some(function(o){return o>0})&&(n.style.animationDuration="0s"),this.styles.transform!==null&&(n.style.transform="none")),this.bounds=mQ(this.context,n),Jue(n,4)&&(this.flags|=16)}return t}(),Pqt="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",$be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",LD=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var lO=0;lO<$be.length;lO++)LD[$be.charCodeAt(lO)]=lO;var Cqt=function(t){var e=t.length*.75,n=t.length,o,r=0,i,a,l,s;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);var c=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),u=Array.isArray(c)?c:new Uint8Array(c);for(o=0;o>4,u[r++]=(a&15)<<4|l>>2,u[r++]=(l&3)<<6|s&63;return c},Rqt=function(t){for(var e=t.length,n=[],o=0;o>wx,Iqt=1<>wx,Dqt=Eqe+zqt,Eqt=Dqt,Fqt=32,kqt=Eqt+Fqt,Lqt=65536>>Mye,Wqt=1<=0){if(e<55296||e>56319&&e<=65535)return n=this.index[e>>wx],n=(n<>wx)],n=(n<>Mye),n=this.index[n],n+=e>>wx&Nqt,n=this.index[n],n=(n<"u"?[]:new Uint8Array(256);for(var sO=0;sO=55296&&r<=56319&&n>10)+55296,a%1024+56320)),(r+1===n||o.length>16384)&&(i+=String.fromCharCode.apply(String,o),o.length=0)}return i},Xqt=jqt(Pqt),Tm="×",Bie="÷",Jqt=function(t){return Xqt.get(t)},Kqt=function(t,e,n){var o=n-2,r=e[o],i=e[n-1],a=e[n];if(i===Lie&&a===Wie)return Tm;if(i===Lie||i===Wie||i===eSe||a===Lie||a===Wie||a===eSe)return Bie;if(i===nSe&&[nSe,Nie,oSe,rSe].indexOf(a)!==-1||(i===oSe||i===Nie)&&(a===Nie||a===Uie)||(i===rSe||i===Uie)&&a===Uie||a===iSe||a===tSe||a===_qt||i===Oqt)return Tm;if(i===iSe&&a===aSe){for(;r===tSe;)r=e[--o];if(r===aSe)return Tm}if(i===jie&&a===jie){for(var l=0;r===jie;)l++,r=e[--o];if(l%2===0)return Tm}return Bie},qqt=function(t){var e=Vqt(t),n=e.length,o=0,r=0,i=e.map(Jqt);return{next:function(){if(o>=n)return{done:!0,value:null};for(var a=Tm;oa.x||u.y>a.y;return a=u,c===0?!0:d});return t.body.removeChild(e),l},e$t=function(){return typeof new Image().crossOrigin<"u"},t$t=function(){return typeof new XMLHttpRequest().responseType=="string"},n$t=function(t){var e=new Image,n=t.createElement("canvas"),o=n.getContext("2d");if(!o)return!1;e.src="data:image/svg+xml,";try{o.drawImage(e,0,0),n.toDataURL()}catch{return!1}return!0},lSe=function(t){return t[0]===0&&t[1]===255&&t[2]===0&&t[3]===255},o$t=function(t){var e=t.createElement("canvas"),n=100;e.width=n,e.height=n;var o=e.getContext("2d");if(!o)return Promise.reject(!1);o.fillStyle="rgb(0, 255, 0)",o.fillRect(0,0,n,n);var r=new Image,i=e.toDataURL();r.src=i;var a=Kue(n,n,0,0,r);return o.fillStyle="red",o.fillRect(0,0,n,n),sSe(a).then(function(l){o.drawImage(l,0,0);var s=o.getImageData(0,0,n,n).data;o.fillStyle="red",o.fillRect(0,0,n,n);var c=t.createElement("div");return c.style.backgroundImage="url("+i+")",c.style.height=n+"px",lSe(s)?sSe(Kue(n,n,0,0,c)):Promise.reject(!1)}).then(function(l){return o.drawImage(l,0,0),lSe(o.getImageData(0,0,n,n).data)}).catch(function(){return!1})},Kue=function(t,e,n,o,r){var i="http://www.w3.org/2000/svg",a=document.createElementNS(i,"svg"),l=document.createElementNS(i,"foreignObject");return a.setAttributeNS(null,"width",t.toString()),a.setAttributeNS(null,"height",e.toString()),l.setAttributeNS(null,"width","100%"),l.setAttributeNS(null,"height","100%"),l.setAttributeNS(null,"x",n.toString()),l.setAttributeNS(null,"y",o.toString()),l.setAttributeNS(null,"externalResourcesRequired","true"),a.appendChild(l),l.appendChild(r),a},sSe=function(t){return new Promise(function(e,n){var o=new Image;o.onload=function(){return e(o)},o.onerror=n,o.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(t))})},sf={get SUPPORT_RANGE_BOUNDS(){var t=Qqt(document);return Object.defineProperty(sf,"SUPPORT_RANGE_BOUNDS",{value:t}),t},get SUPPORT_WORD_BREAKING(){var t=sf.SUPPORT_RANGE_BOUNDS&&Zqt(document);return Object.defineProperty(sf,"SUPPORT_WORD_BREAKING",{value:t}),t},get SUPPORT_SVG_DRAWING(){var t=n$t(document);return Object.defineProperty(sf,"SUPPORT_SVG_DRAWING",{value:t}),t},get SUPPORT_FOREIGNOBJECT_DRAWING(){var t=typeof Array.from=="function"&&typeof window.fetch=="function"?o$t(document):Promise.resolve(!1);return Object.defineProperty(sf,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:t}),t},get SUPPORT_CORS_IMAGES(){var t=e$t();return Object.defineProperty(sf,"SUPPORT_CORS_IMAGES",{value:t}),t},get SUPPORT_RESPONSE_TYPE(){var t=t$t();return Object.defineProperty(sf,"SUPPORT_RESPONSE_TYPE",{value:t}),t},get SUPPORT_CORS_XHR(){var t="withCredentials"in new XMLHttpRequest;return Object.defineProperty(sf,"SUPPORT_CORS_XHR",{value:t}),t},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var t=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(sf,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:t}),t}},HE=function(){function t(e,n){this.text=e,this.bounds=n}return t}(),r$t=function(t,e,n,o){var r=l$t(e,n),i=[],a=0;return r.forEach(function(l){if(n.textDecorationLine.length||l.trim().length>0)if(sf.SUPPORT_RANGE_BOUNDS){var s=cSe(o,a,l.length).getClientRects();if(s.length>1){var c=Iye(l),u=0;c.forEach(function(f){i.push(new HE(f,rA.fromDOMRectList(t,cSe(o,u+a,f.length).getClientRects()))),u+=f.length})}else i.push(new HE(l,rA.fromDOMRectList(t,s)))}else{var d=o.splitText(l.length);i.push(new HE(l,i$t(t,o))),o=d}else sf.SUPPORT_RANGE_BOUNDS||(o=o.splitText(l.length));a+=l.length}),i},i$t=function(t,e){var n=e.ownerDocument;if(n){var o=n.createElement("html2canvaswrapper");o.appendChild(e.cloneNode(!0));var r=e.parentNode;if(r){r.replaceChild(o,e);var i=mQ(t,o);return o.firstChild&&r.replaceChild(o.firstChild,o),i}}return rA.EMPTY},cSe=function(t,e,n){var o=t.ownerDocument;if(!o)throw new Error("Node has no owner document");var r=o.createRange();return r.setStart(t,e),r.setEnd(t,e+n),r},Iye=function(t){if(sf.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(t)).map(function(n){return n.segment})}return $qt(t)},a$t=function(t,e){if(sf.SUPPORT_NATIVE_TEXT_SEGMENTATION){var n=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(n.segment(t)).map(function(o){return o.segment})}return c$t(t,e)},l$t=function(t,e){return e.letterSpacing!==0?Iye(t):a$t(t,e)},s$t=[32,160,4961,65792,65793,4153,4241],c$t=function(t,e){for(var n=LXt(t,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap==="break-word"?"break-word":e.wordBreak}),o=[],r,i=function(){if(r.value){var a=r.value.slice(),l=yQ(a),s="";l.forEach(function(c){s$t.indexOf(c)===-1?s+=E0(c):(s.length&&o.push(s),o.push(E0(c)),s="")}),s.length&&o.push(s)}};!(r=n.next()).done;)i();return o},u$t=function(){function t(e,n,o){this.text=d$t(n.data,o.textTransform),this.textBounds=r$t(e,this.text,o,n)}return t}(),d$t=function(t,e){switch(e){case 1:return t.toLowerCase();case 3:return t.replace(f$t,h$t);case 2:return t.toUpperCase();default:return t}},f$t=/(^|\s|:|-|\(|\))([a-z])/g,h$t=function(t,e,n){return t.length>0?e+n.toUpperCase():t},Fqe=function(t){i5(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.src=o.currentSrc||o.src,r.intrinsicWidth=o.naturalWidth,r.intrinsicHeight=o.naturalHeight,r.context.cache.addImage(r.src),r}return e}(m3),kqe=function(t){i5(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.canvas=o,r.intrinsicWidth=o.width,r.intrinsicHeight=o.height,r}return e}(m3),Lqe=function(t){i5(e,t);function e(n,o){var r=t.call(this,n,o)||this,i=new XMLSerializer,a=mQ(n,o);return o.setAttribute("width",a.width+"px"),o.setAttribute("height",a.height+"px"),r.svg="data:image/svg+xml,"+encodeURIComponent(i.serializeToString(o)),r.intrinsicWidth=o.width.baseVal.value,r.intrinsicHeight=o.height.baseVal.value,r.context.cache.addImage(r.svg),r}return e}(m3),Wqe=function(t){i5(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.value=o.value,r}return e}(m3),que=function(t){i5(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.start=o.start,r.reversed=typeof o.reversed=="boolean"&&o.reversed===!0,r}return e}(m3),p$t=[{type:15,flags:0,unit:"px",number:3}],g$t=[{type:16,flags:0,number:50}],m$t=function(t){return t.width>t.height?new rA(t.left+(t.width-t.height)/2,t.top,t.height,t.height):t.width0)n.textNodes.push(new u$t(t,r,n.styles));else if(tC(r))if(Xqe(r)&&r.assignedNodes)r.assignedNodes().forEach(function(l){return tV(t,l,n,o)});else{var a=Bqe(t,r);a.styles.isVisible()&&(v$t(r,a,o)?a.flags|=4:x$t(a.styles)&&(a.flags|=2),w$t.indexOf(r.tagName)!==-1&&(a.flags|=8),n.elements.push(a),r.slot,r.shadowRoot?tV(t,r.shadowRoot,a,o):!tX(r)&&!_qe(r)&&!nX(r)&&tV(t,r,a,o))}},Bqe=function(t,e){return Que(e)?new Fqe(t,e):Vqe(e)?new kqe(t,e):_qe(e)?new Lqe(t,e):b$t(e)?new Wqe(t,e):S$t(e)?new que(t,e):T$t(e)?new zye(t,e):nX(e)?new Nqe(t,e):tX(e)?new Uqe(t,e):Gqe(e)?new jqe(t,e):new m3(t,e)},Yqe=function(t,e){var n=Bqe(t,e);return n.flags|=4,tV(t,e,n,n),n},v$t=function(t,e,n){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Dye(t)&&n.styles.isTransparent()},x$t=function(t){return t.isPositioned()||t.isFloating()},Oqe=function(t){return t.nodeType===Node.TEXT_NODE},tC=function(t){return t.nodeType===Node.ELEMENT_NODE},$ue=function(t){return tC(t)&&typeof t.style<"u"&&!nV(t)},nV=function(t){return typeof t.className=="object"},b$t=function(t){return t.tagName==="LI"},S$t=function(t){return t.tagName==="OL"},T$t=function(t){return t.tagName==="INPUT"},P$t=function(t){return t.tagName==="HTML"},_qe=function(t){return t.tagName==="svg"},Dye=function(t){return t.tagName==="BODY"},Vqe=function(t){return t.tagName==="CANVAS"},dSe=function(t){return t.tagName==="VIDEO"},Que=function(t){return t.tagName==="IMG"},Gqe=function(t){return t.tagName==="IFRAME"},fSe=function(t){return t.tagName==="STYLE"},C$t=function(t){return t.tagName==="SCRIPT"},tX=function(t){return t.tagName==="TEXTAREA"},nX=function(t){return t.tagName==="SELECT"},Xqe=function(t){return t.tagName==="SLOT"},hSe=function(t){return t.tagName.indexOf("-")>0},R$t=function(){function t(){this.counters={}}return t.prototype.getCounterValue=function(e){var n=this.counters[e];return n&&n.length?n[n.length-1]:1},t.prototype.getCounterValues=function(e){var n=this.counters[e];return n||[]},t.prototype.pop=function(e){var n=this;e.forEach(function(o){return n.counters[o].pop()})},t.prototype.parse=function(e){var n=this,o=e.counterIncrement,r=e.counterReset,i=!0;o!==null&&o.forEach(function(l){var s=n.counters[l.counter];s&&l.increment!==0&&(i=!1,s.length||s.push(1),s[Math.max(0,s.length-1)]+=l.increment)});var a=[];return i&&r.forEach(function(l){var s=n.counters[l.counter];a.push(l.counter),s||(s=n.counters[l.counter]=[]),s.push(l.reset)}),a},t}(),pSe={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},gSe={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},H$t={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},M$t={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},jT=function(t,e,n,o,r,i){return tn?pk(t,r,i.length>0):o.integers.reduce(function(a,l,s){for(;t>=l;)t-=l,a+=o.values[s];return a},"")+i},Jqe=function(t,e,n,o){var r="";do n||t--,r=o(t)+r,t/=e;while(t*e>=e);return r},z0=function(t,e,n,o,r){var i=n-e+1;return(t<0?"-":"")+(Jqe(Math.abs(t),i,o,function(a){return E0(Math.floor(a%i)+e)})+r)},X7=function(t,e,n){n===void 0&&(n=". ");var o=e.length;return Jqe(Math.abs(t),o,!1,function(r){return e[Math.floor(r%o)]})+n},iP=1,W4=2,N4=4,WD=8,a6=function(t,e,n,o,r,i){if(t<-9999||t>9999)return pk(t,4,r.length>0);var a=Math.abs(t),l=r;if(a===0)return e[0]+l;for(var s=0;a>0&&s<=4;s++){var c=a%10;c===0&&Du(i,iP)&&l!==""?l=e[c]+l:c>1||c===1&&s===0||c===1&&s===1&&Du(i,W4)||c===1&&s===1&&Du(i,N4)&&t>100||c===1&&s>1&&Du(i,WD)?l=e[c]+(s>0?n[s-1]:"")+l:c===1&&s>0&&(l=n[s-1]+l),a=Math.floor(a/10)}return(t<0?o:"")+l},mSe="十百千萬",ySe="拾佰仟萬",ASe="マイナス",Yie="마이너스",pk=function(t,e,n){var o=n?". ":"",r=n?"、":"",i=n?", ":"",a=n?" ":"";switch(e){case 0:return"•"+a;case 1:return"◦"+a;case 2:return"◾"+a;case 5:var l=z0(t,48,57,!0,o);return l.length<4?"0"+l:l;case 4:return X7(t,"〇一二三四五六七八九",r);case 6:return jT(t,1,3999,pSe,3,o).toLowerCase();case 7:return jT(t,1,3999,pSe,3,o);case 8:return z0(t,945,969,!1,o);case 9:return z0(t,97,122,!1,o);case 10:return z0(t,65,90,!1,o);case 11:return z0(t,1632,1641,!0,o);case 12:case 49:return jT(t,1,9999,gSe,3,o);case 35:return jT(t,1,9999,gSe,3,o).toLowerCase();case 13:return z0(t,2534,2543,!0,o);case 14:case 30:return z0(t,6112,6121,!0,o);case 15:return X7(t,"子丑寅卯辰巳午未申酉戌亥",r);case 16:return X7(t,"甲乙丙丁戊己庚辛壬癸",r);case 17:case 48:return a6(t,"零一二三四五六七八九",mSe,"負",r,W4|N4|WD);case 47:return a6(t,"零壹貳參肆伍陸柒捌玖",ySe,"負",r,iP|W4|N4|WD);case 42:return a6(t,"零一二三四五六七八九",mSe,"负",r,W4|N4|WD);case 41:return a6(t,"零壹贰叁肆伍陆柒捌玖",ySe,"负",r,iP|W4|N4|WD);case 26:return a6(t,"〇一二三四五六七八九","十百千万",ASe,r,0);case 25:return a6(t,"零壱弐参四伍六七八九","拾百千万",ASe,r,iP|W4|N4);case 31:return a6(t,"영일이삼사오육칠팔구","십백천만",Yie,i,iP|W4|N4);case 33:return a6(t,"零一二三四五六七八九","十百千萬",Yie,i,0);case 32:return a6(t,"零壹貳參四五六七八九","拾百千",Yie,i,iP|W4|N4);case 18:return z0(t,2406,2415,!0,o);case 20:return jT(t,1,19999,M$t,3,o);case 21:return z0(t,2790,2799,!0,o);case 22:return z0(t,2662,2671,!0,o);case 22:return jT(t,1,10999,H$t,3,o);case 23:return X7(t,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return X7(t,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return z0(t,3302,3311,!0,o);case 28:return X7(t,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",r);case 29:return X7(t,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",r);case 34:return z0(t,3792,3801,!0,o);case 37:return z0(t,6160,6169,!0,o);case 38:return z0(t,4160,4169,!0,o);case 39:return z0(t,2918,2927,!0,o);case 40:return z0(t,1776,1785,!0,o);case 43:return z0(t,3046,3055,!0,o);case 44:return z0(t,3174,3183,!0,o);case 45:return z0(t,3664,3673,!0,o);case 46:return z0(t,3872,3881,!0,o);case 3:default:return z0(t,48,57,!0,o)}},Kqe="data-html2canvas-ignore",wSe=function(){function t(e,n,o){if(this.context=e,this.options=o,this.scrolledElements=[],this.referenceElement=n,this.counters=new R$t,this.quoteDepth=0,!n.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(n.ownerDocument.documentElement,!1)}return t.prototype.toIFrame=function(e,n){var o=this,r=I$t(e,n);if(!r.contentWindow)return Promise.reject("Unable to find iframe window");var i=e.defaultView.pageXOffset,a=e.defaultView.pageYOffset,l=r.contentWindow,s=l.document,c=E$t(r).then(function(){return Xh(o,void 0,void 0,function(){var u,d;return Qf(this,function(f){switch(f.label){case 0:return this.scrolledElements.forEach(W$t),l&&(l.scrollTo(n.left,n.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(l.scrollY!==n.top||l.scrollX!==n.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(l.scrollX-n.left,l.scrollY-n.top,0,0))),u=this.options.onclone,d=this.clonedReferenceElement,typeof d>"u"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:s.fonts&&s.fonts.ready?[4,s.fonts.ready]:[3,2];case 1:f.sent(),f.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,D$t(s)]:[3,4];case 3:f.sent(),f.label=4;case 4:return typeof u=="function"?[2,Promise.resolve().then(function(){return u(s,d)}).then(function(){return r})]:[2,r]}})})});return s.open(),s.write(k$t(document.doctype)+""),L$t(this.referenceElement.ownerDocument,i,a),s.replaceChild(s.adoptNode(this.documentElement),s.documentElement),s.close(),c},t.prototype.createElementClone=function(e){if(Jue(e,2))debugger;if(Vqe(e))return this.createCanvasClone(e);if(dSe(e))return this.createVideoClone(e);if(fSe(e))return this.createStyleClone(e);var n=e.cloneNode(!1);return Que(n)&&(Que(e)&&e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc,n.srcset=""),n.loading==="lazy"&&(n.loading="eager")),hSe(n)?this.createCustomElementClone(n):n},t.prototype.createCustomElementClone=function(e){var n=document.createElement("html2canvascustomelement");return Oie(e.style,n),n},t.prototype.createStyleClone=function(e){try{var n=e.sheet;if(n&&n.cssRules){var o=[].slice.call(n.cssRules,0).reduce(function(i,a){return a&&typeof a.cssText=="string"?i+a.cssText:i},""),r=e.cloneNode(!1);return r.textContent=o,r}}catch(i){if(this.context.logger.error("Unable to access cssRules property",i),i.name!=="SecurityError")throw i}return e.cloneNode(!1)},t.prototype.createCanvasClone=function(e){var n;if(this.options.inlineImages&&e.ownerDocument){var o=e.ownerDocument.createElement("img");try{return o.src=e.toDataURL(),o}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var r=e.cloneNode(!1);try{r.width=e.width,r.height=e.height;var i=e.getContext("2d"),a=r.getContext("2d");if(a)if(!this.options.allowTaint&&i)a.putImageData(i.getImageData(0,0,e.width,e.height),0,0);else{var l=(n=e.getContext("webgl2"))!==null&&n!==void 0?n:e.getContext("webgl");if(l){var s=l.getContextAttributes();(s==null?void 0:s.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}a.drawImage(e,0,0)}return r}catch{this.context.logger.info("Unable to clone canvas as it is tainted",e)}return r},t.prototype.createVideoClone=function(e){var n=e.ownerDocument.createElement("canvas");n.width=e.offsetWidth,n.height=e.offsetHeight;var o=n.getContext("2d");try{return o&&(o.drawImage(e,0,0,n.width,n.height),this.options.allowTaint||o.getImageData(0,0,n.width,n.height)),n}catch{this.context.logger.info("Unable to clone video as it is tainted",e)}var r=e.ownerDocument.createElement("canvas");return r.width=e.offsetWidth,r.height=e.offsetHeight,r},t.prototype.appendChildNode=function(e,n,o){(!tC(n)||!C$t(n)&&!n.hasAttribute(Kqe)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(n)))&&(!this.options.copyStyles||!tC(n)||!fSe(n))&&e.appendChild(this.cloneNode(n,o))},t.prototype.cloneChildNodes=function(e,n,o){for(var r=this,i=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;i;i=i.nextSibling)if(tC(i)&&Xqe(i)&&typeof i.assignedNodes=="function"){var a=i.assignedNodes();a.length&&a.forEach(function(l){return r.appendChildNode(n,l,o)})}else this.appendChildNode(n,i,o)},t.prototype.cloneNode=function(e,n){if(Oqe(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var o=e.ownerDocument.defaultView;if(o&&tC(e)&&($ue(e)||nV(e))){var r=this.createElementClone(e);r.style.transitionProperty="none";var i=o.getComputedStyle(e),a=o.getComputedStyle(e,":before"),l=o.getComputedStyle(e,":after");this.referenceElement===e&&$ue(r)&&(this.clonedReferenceElement=r),Dye(r)&&j$t(r);var s=this.counters.parse(new qbe(this.context,i)),c=this.resolvePseudoContent(e,r,a,ME.BEFORE);hSe(e)&&(n=!0),dSe(e)||this.cloneChildNodes(e,r,n),c&&r.insertBefore(c,r.firstChild);var u=this.resolvePseudoContent(e,r,l,ME.AFTER);return u&&r.appendChild(u),this.counters.pop(s),(i&&(this.options.copyStyles||nV(e))&&!Gqe(e)||n)&&Oie(i,r),(e.scrollTop!==0||e.scrollLeft!==0)&&this.scrolledElements.push([r,e.scrollLeft,e.scrollTop]),(tX(e)||nX(e))&&(tX(r)||nX(r))&&(r.value=e.value),r}return e.cloneNode(!1)},t.prototype.resolvePseudoContent=function(e,n,o,r){var i=this;if(o){var a=o.content,l=n.ownerDocument;if(!(!l||!a||a==="none"||a==="-moz-alt-content"||o.display==="none")){this.counters.parse(new qbe(this.context,o));var s=new bqt(this.context,o),c=l.createElement("html2canvaspseudoelement");Oie(o,c),s.content.forEach(function(d){if(d.type===0)c.appendChild(l.createTextNode(d.value));else if(d.type===22){var f=l.createElement("img");f.src=d.value,f.style.opacity="1",c.appendChild(f)}else if(d.type===18){if(d.name==="attr"){var p=d.values.filter(xs);p.length&&c.appendChild(l.createTextNode(e.getAttribute(p[0].value)||""))}else if(d.name==="counter"){var g=d.values.filter(bR),y=g[0],w=g[1];if(y&&xs(y)){var b=i.counters.getCounterValue(y.value),C=w&&xs(w)?Xue.parse(i.context,w.value):3;c.appendChild(l.createTextNode(pk(b,C,!1)))}}else if(d.name==="counters"){var P=d.values.filter(bR),y=P[0],v=P[1],w=P[2];if(y&&xs(y)){var T=i.counters.getCounterValues(y.value),A=w&&xs(w)?Xue.parse(i.context,w.value):3,x=v&&v.type===0?v.value:"",S=T.map(function(D){return pk(D,A,!1)}).join(x);c.appendChild(l.createTextNode(S))}}}else if(d.type===20)switch(d.value){case"open-quote":c.appendChild(l.createTextNode(Kbe(s.quotes,i.quoteDepth++,!0)));break;case"close-quote":c.appendChild(l.createTextNode(Kbe(s.quotes,--i.quoteDepth,!1)));break;default:c.appendChild(l.createTextNode(d.value))}}),c.className=Zue+" "+ede;var u=r===ME.BEFORE?" "+Zue:" "+ede;return nV(n)?n.className.baseValue+=u:n.className+=u,c}}},t.destroy=function(e){return e.parentNode?(e.parentNode.removeChild(e),!0):!1},t}(),ME;(function(t){t[t.BEFORE=0]="BEFORE",t[t.AFTER=1]="AFTER"})(ME||(ME={}));var I$t=function(t,e){var n=t.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=e.width.toString(),n.height=e.height.toString(),n.scrolling="no",n.setAttribute(Kqe,"true"),t.body.appendChild(n),n},z$t=function(t){return new Promise(function(e){if(t.complete){e();return}if(!t.src){e();return}t.onload=e,t.onerror=e})},D$t=function(t){return Promise.all([].slice.call(t.images,0).map(z$t))},E$t=function(t){return new Promise(function(e,n){var o=t.contentWindow;if(!o)return n("No window assigned for iframe");var r=o.document;o.onload=t.onload=function(){o.onload=t.onload=null;var i=setInterval(function(){r.body.childNodes.length>0&&r.readyState==="complete"&&(clearInterval(i),e(t))},50)}})},F$t=["all","d","content"],Oie=function(t,e){for(var n=t.length-1;n>=0;n--){var o=t.item(n);F$t.indexOf(o)===-1&&e.style.setProperty(o,t.getPropertyValue(o))}return e},k$t=function(t){var e="";return t&&(e+=""),e},L$t=function(t,e,n){t&&t.defaultView&&(e!==t.defaultView.pageXOffset||n!==t.defaultView.pageYOffset)&&t.defaultView.scrollTo(e,n)},W$t=function(t){var e=t[0],n=t[1],o=t[2];e.scrollLeft=n,e.scrollTop=o},N$t=":before",U$t=":after",Zue="___html2canvas___pseudoelement_before",ede="___html2canvas___pseudoelement_after",vSe=`{ content: "" !important; display: none !important; -}`,j$t=function(t){B$t(t,"."+Zue+N$t+wSe+` - .`+ede+U$t+wSe)},B$t=function(t,e){var n=t.ownerDocument;if(n){var o=n.createElement("style");o.textContent=e,t.appendChild(o)}},qqe=function(){function t(){}return t.getOrigin=function(e){var n=t._link;return n?(n.href=e,n.href=n.href,n.protocol+n.hostname+n.port):"about:blank"},t.isSameOrigin=function(e){return t.getOrigin(e)===t._origin},t.setContext=function(e){t._link=e.document.createElement("a"),t._origin=t.getOrigin(e.location.href)},t._origin="about:blank",t}(),Y$t=function(){function t(e,n){this.context=e,this._options=n,this._cache={}}return t.prototype.addImage=function(e){var n=Promise.resolve();return this.has(e)||(Vie(e)||G$t(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),n},t.prototype.match=function(e){return this._cache[e]},t.prototype.loadImage=function(e){return Xh(this,void 0,void 0,function(){var n,o,r,i,a=this;return Qf(this,function(l){switch(l.label){case 0:return n=qqe.isSameOrigin(e),o=!_ie(e)&&this._options.useCORS===!0&&sf.SUPPORT_CORS_IMAGES&&!n,r=!_ie(e)&&!n&&!Vie(e)&&typeof this._options.proxy=="string"&&sf.SUPPORT_CORS_XHR&&!o,!n&&this._options.allowTaint===!1&&!_ie(e)&&!Vie(e)&&!r&&!o?[2]:(i=e,r?[4,this.proxy(i)]:[3,2]);case 1:i=l.sent(),l.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(s,c){var u=new Image;u.onload=function(){return s(u)},u.onerror=c,(X$t(i)||o)&&(u.crossOrigin="anonymous"),u.src=i,u.complete===!0&&setTimeout(function(){return s(u)},500),a._options.imageTimeout>0&&setTimeout(function(){return c("Timed out ("+a._options.imageTimeout+"ms) loading image")},a._options.imageTimeout)})];case 3:return[2,l.sent()]}})})},t.prototype.has=function(e){return typeof this._cache[e]<"u"},t.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},t.prototype.proxy=function(e){var n=this,o=this._options.proxy;if(!o)throw new Error("No proxy defined");var r=e.substring(0,256);return new Promise(function(i,a){var l=sf.SUPPORT_RESPONSE_TYPE?"blob":"text",s=new XMLHttpRequest;s.onload=function(){if(s.status===200)if(l==="text")i(s.response);else{var d=new FileReader;d.addEventListener("load",function(){return i(d.result)},!1),d.addEventListener("error",function(f){return a(f)},!1),d.readAsDataURL(s.response)}else a("Failed to proxy resource "+r+" with status code "+s.status)},s.onerror=a;var c=o.indexOf("?")>-1?"&":"?";if(s.open("GET",""+o+c+"url="+encodeURIComponent(e)+"&responseType="+l),l!=="text"&&s instanceof XMLHttpRequest&&(s.responseType=l),n._options.imageTimeout){var u=n._options.imageTimeout;s.timeout=u,s.ontimeout=function(){return a("Timed out ("+u+"ms) proxying "+r)}}s.send()})},t}(),O$t=/^data:image\/svg\+xml/i,_$t=/^data:image\/.*;base64,/i,V$t=/^data:image\/.*/i,G$t=function(t){return sf.SUPPORT_SVG_DRAWING||!J$t(t)},_ie=function(t){return V$t.test(t)},X$t=function(t){return _$t.test(t)},Vie=function(t){return t.substr(0,4)==="blob"},J$t=function(t){return t.substr(-3).toLowerCase()==="svg"||O$t.test(t)},Mr=function(){function t(e,n){this.type=0,this.x=e,this.y=n}return t.prototype.add=function(e,n){return new t(this.x+e,this.y+n)},t}(),BT=function(t,e,n){return new Mr(t.x+(e.x-t.x)*n,t.y+(e.y-t.y)*n)},sO=function(){function t(e,n,o,r){this.type=1,this.start=e,this.startControl=n,this.endControl=o,this.end=r}return t.prototype.subdivide=function(e,n){var o=BT(this.start,this.startControl,e),r=BT(this.startControl,this.endControl,e),i=BT(this.endControl,this.end,e),a=BT(o,r,e),l=BT(r,i,e),s=BT(a,l,e);return n?new t(this.start,o,a,s):new t(s,l,i,this.end)},t.prototype.add=function(e,n){return new t(this.start.add(e,n),this.startControl.add(e,n),this.endControl.add(e,n),this.end.add(e,n))},t.prototype.reverse=function(){return new t(this.end,this.endControl,this.startControl,this.start)},t}(),Mm=function(t){return t.type===1},K$t=function(){function t(e){var n=e.styles,o=e.bounds,r=kD(n.borderTopLeftRadius,o.width,o.height),i=r[0],a=r[1],l=kD(n.borderTopRightRadius,o.width,o.height),s=l[0],c=l[1],u=kD(n.borderBottomRightRadius,o.width,o.height),d=u[0],f=u[1],p=kD(n.borderBottomLeftRadius,o.width,o.height),g=p[0],y=p[1],w=[];w.push((i+s)/o.width),w.push((g+d)/o.width),w.push((a+y)/o.height),w.push((c+f)/o.height);var b=Math.max.apply(Math,w);b>1&&(i/=b,a/=b,s/=b,c/=b,d/=b,f/=b,g/=b,y/=b);var C=o.width-s,P=o.height-f,v=o.width-d,T=o.height-y,A=n.borderTopWidth,x=n.borderRightWidth,S=n.borderBottomWidth,R=n.borderLeftWidth,M=Xs(n.paddingTop,e.bounds.width),D=Xs(n.paddingRight,e.bounds.width),E=Xs(n.paddingBottom,e.bounds.width),W=Xs(n.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||a>0?kc(o.left+R/3,o.top+A/3,i-R/3,a-A/3,Zl.TOP_LEFT):new Mr(o.left+R/3,o.top+A/3),this.topRightBorderDoubleOuterBox=i>0||a>0?kc(o.left+C,o.top+A/3,s-x/3,c-A/3,Zl.TOP_RIGHT):new Mr(o.left+o.width-x/3,o.top+A/3),this.bottomRightBorderDoubleOuterBox=d>0||f>0?kc(o.left+v,o.top+P,d-x/3,f-S/3,Zl.BOTTOM_RIGHT):new Mr(o.left+o.width-x/3,o.top+o.height-S/3),this.bottomLeftBorderDoubleOuterBox=g>0||y>0?kc(o.left+R/3,o.top+T,g-R/3,y-S/3,Zl.BOTTOM_LEFT):new Mr(o.left+R/3,o.top+o.height-S/3),this.topLeftBorderDoubleInnerBox=i>0||a>0?kc(o.left+R*2/3,o.top+A*2/3,i-R*2/3,a-A*2/3,Zl.TOP_LEFT):new Mr(o.left+R*2/3,o.top+A*2/3),this.topRightBorderDoubleInnerBox=i>0||a>0?kc(o.left+C,o.top+A*2/3,s-x*2/3,c-A*2/3,Zl.TOP_RIGHT):new Mr(o.left+o.width-x*2/3,o.top+A*2/3),this.bottomRightBorderDoubleInnerBox=d>0||f>0?kc(o.left+v,o.top+P,d-x*2/3,f-S*2/3,Zl.BOTTOM_RIGHT):new Mr(o.left+o.width-x*2/3,o.top+o.height-S*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||y>0?kc(o.left+R*2/3,o.top+T,g-R*2/3,y-S*2/3,Zl.BOTTOM_LEFT):new Mr(o.left+R*2/3,o.top+o.height-S*2/3),this.topLeftBorderStroke=i>0||a>0?kc(o.left+R/2,o.top+A/2,i-R/2,a-A/2,Zl.TOP_LEFT):new Mr(o.left+R/2,o.top+A/2),this.topRightBorderStroke=i>0||a>0?kc(o.left+C,o.top+A/2,s-x/2,c-A/2,Zl.TOP_RIGHT):new Mr(o.left+o.width-x/2,o.top+A/2),this.bottomRightBorderStroke=d>0||f>0?kc(o.left+v,o.top+P,d-x/2,f-S/2,Zl.BOTTOM_RIGHT):new Mr(o.left+o.width-x/2,o.top+o.height-S/2),this.bottomLeftBorderStroke=g>0||y>0?kc(o.left+R/2,o.top+T,g-R/2,y-S/2,Zl.BOTTOM_LEFT):new Mr(o.left+R/2,o.top+o.height-S/2),this.topLeftBorderBox=i>0||a>0?kc(o.left,o.top,i,a,Zl.TOP_LEFT):new Mr(o.left,o.top),this.topRightBorderBox=s>0||c>0?kc(o.left+C,o.top,s,c,Zl.TOP_RIGHT):new Mr(o.left+o.width,o.top),this.bottomRightBorderBox=d>0||f>0?kc(o.left+v,o.top+P,d,f,Zl.BOTTOM_RIGHT):new Mr(o.left+o.width,o.top+o.height),this.bottomLeftBorderBox=g>0||y>0?kc(o.left,o.top+T,g,y,Zl.BOTTOM_LEFT):new Mr(o.left,o.top+o.height),this.topLeftPaddingBox=i>0||a>0?kc(o.left+R,o.top+A,Math.max(0,i-R),Math.max(0,a-A),Zl.TOP_LEFT):new Mr(o.left+R,o.top+A),this.topRightPaddingBox=s>0||c>0?kc(o.left+Math.min(C,o.width-x),o.top+A,C>o.width+x?0:Math.max(0,s-x),Math.max(0,c-A),Zl.TOP_RIGHT):new Mr(o.left+o.width-x,o.top+A),this.bottomRightPaddingBox=d>0||f>0?kc(o.left+Math.min(v,o.width-R),o.top+Math.min(P,o.height-S),Math.max(0,d-x),Math.max(0,f-S),Zl.BOTTOM_RIGHT):new Mr(o.left+o.width-x,o.top+o.height-S),this.bottomLeftPaddingBox=g>0||y>0?kc(o.left+R,o.top+Math.min(T,o.height-S),Math.max(0,g-R),Math.max(0,y-S),Zl.BOTTOM_LEFT):new Mr(o.left+R,o.top+o.height-S),this.topLeftContentBox=i>0||a>0?kc(o.left+R+W,o.top+A+M,Math.max(0,i-(R+W)),Math.max(0,a-(A+M)),Zl.TOP_LEFT):new Mr(o.left+R+W,o.top+A+M),this.topRightContentBox=s>0||c>0?kc(o.left+Math.min(C,o.width+R+W),o.top+A+M,C>o.width+R+W?0:s-R+W,c-(A+M),Zl.TOP_RIGHT):new Mr(o.left+o.width-(x+D),o.top+A+M),this.bottomRightContentBox=d>0||f>0?kc(o.left+Math.min(v,o.width-(R+W)),o.top+Math.min(P,o.height+A+M),Math.max(0,d-(x+D)),f-(S+E),Zl.BOTTOM_RIGHT):new Mr(o.left+o.width-(x+D),o.top+o.height-(S+E)),this.bottomLeftContentBox=g>0||y>0?kc(o.left+R+W,o.top+T,Math.max(0,g-(R+W)),y-(S+E),Zl.BOTTOM_LEFT):new Mr(o.left+R+W,o.top+o.height-(S+E))}return t}(),Zl;(function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=1]="TOP_RIGHT",t[t.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",t[t.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Zl||(Zl={}));var kc=function(t,e,n,o,r){var i=4*((Math.sqrt(2)-1)/3),a=n*i,l=o*i,s=t+n,c=e+o;switch(r){case Zl.TOP_LEFT:return new sO(new Mr(t,c),new Mr(t,c-l),new Mr(s-a,e),new Mr(s,e));case Zl.TOP_RIGHT:return new sO(new Mr(t,e),new Mr(t+a,e),new Mr(s,c-l),new Mr(s,c));case Zl.BOTTOM_RIGHT:return new sO(new Mr(s,e),new Mr(s,e+l),new Mr(t+a,c),new Mr(t,c));case Zl.BOTTOM_LEFT:default:return new sO(new Mr(s,c),new Mr(s-a,c),new Mr(t,e+l),new Mr(t,e))}},nX=function(t){return[t.topLeftBorderBox,t.topRightBorderBox,t.bottomRightBorderBox,t.bottomLeftBorderBox]},q$t=function(t){return[t.topLeftContentBox,t.topRightContentBox,t.bottomRightContentBox,t.bottomLeftContentBox]},oX=function(t){return[t.topLeftPaddingBox,t.topRightPaddingBox,t.bottomRightPaddingBox,t.bottomLeftPaddingBox]},$$t=function(){function t(e,n,o){this.offsetX=e,this.offsetY=n,this.matrix=o,this.type=0,this.target=6}return t}(),cO=function(){function t(e,n){this.path=e,this.target=n,this.type=1}return t}(),Q$t=function(){function t(e){this.opacity=e,this.type=2,this.target=6}return t}(),Z$t=function(t){return t.type===0},$qe=function(t){return t.type===1},eQt=function(t){return t.type===2},vSe=function(t,e){return t.length===e.length?t.some(function(n,o){return n===e[o]}):!1},tQt=function(t,e,n,o,r){return t.map(function(i,a){switch(a){case 0:return i.add(e,n);case 1:return i.add(e+o,n);case 2:return i.add(e+o,n+r);case 3:return i.add(e,n+r)}return i})},Qqe=function(){function t(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return t}(),Zqe=function(){function t(e,n){if(this.container=e,this.parent=n,this.effects=[],this.curves=new K$t(this.container),this.container.styles.opacity<1&&this.effects.push(new Q$t(this.container.styles.opacity)),this.container.styles.transform!==null){var o=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new $$t(o,r,i))}if(this.container.styles.overflowX!==0){var a=nX(this.curves),l=oX(this.curves);vSe(a,l)?this.effects.push(new cO(a,6)):(this.effects.push(new cO(a,2)),this.effects.push(new cO(l,4)))}}return t.prototype.getEffects=function(e){for(var n=[2,3].indexOf(this.container.styles.position)===-1,o=this.parent,r=this.effects.slice(0);o;){var i=o.effects.filter(function(s){return!$qe(s)});if(n||o.container.styles.position!==0||!o.parent){if(r.unshift.apply(r,i),n=[2,3].indexOf(o.container.styles.position)===-1,o.container.styles.overflowX!==0){var a=nX(o.curves),l=oX(o.curves);vSe(a,l)||r.unshift(new cO(l,6))}}else r.unshift.apply(r,i);o=o.parent}return r.filter(function(s){return Du(s.target,e)})},t}(),tde=function(t,e,n,o){t.container.elements.forEach(function(r){var i=Du(r.flags,4),a=Du(r.flags,2),l=new Zqe(r,t);Du(r.styles.display,2048)&&o.push(l);var s=Du(r.flags,8)?[]:o;if(i||a){var c=i||r.styles.isPositioned()?n:e,u=new Qqe(l);if(r.styles.isPositioned()||r.styles.opacity<1||r.styles.isTransformed()){var d=r.styles.zIndex.order;if(d<0){var f=0;c.negativeZIndex.some(function(g,y){return d>g.element.container.styles.zIndex.order?(f=y,!1):f>0}),c.negativeZIndex.splice(f,0,u)}else if(d>0){var p=0;c.positiveZIndex.some(function(g,y){return d>=g.element.container.styles.zIndex.order?(p=y+1,!1):p>0}),c.positiveZIndex.splice(p,0,u)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else r.styles.isFloating()?c.nonPositionedFloats.push(u):c.nonPositionedInlineLevel.push(u);tde(l,u,i?u:n,s)}else r.styles.isInlineLevel()?e.inlineLevel.push(l):e.nonInlineLevel.push(l),tde(l,e,n,s);Du(r.flags,8)&&e$e(r,s)})},e$e=function(t,e){for(var n=t instanceof que?t.start:1,o=t instanceof que?t.reversed:!1,r=0;r"u"?t[0]:n},cQt=function(t,e,n,o,r){var i=e[0],a=e[1],l=n[0],s=n[1];switch(t){case 2:return[new Mr(Math.round(o.left),Math.round(o.top+a)),new Mr(Math.round(o.left+o.width),Math.round(o.top+a)),new Mr(Math.round(o.left+o.width),Math.round(s+o.top+a)),new Mr(Math.round(o.left),Math.round(s+o.top+a))];case 3:return[new Mr(Math.round(o.left+i),Math.round(o.top)),new Mr(Math.round(o.left+i+l),Math.round(o.top)),new Mr(Math.round(o.left+i+l),Math.round(o.height+o.top)),new Mr(Math.round(o.left+i),Math.round(o.height+o.top))];case 1:return[new Mr(Math.round(o.left+i),Math.round(o.top+a)),new Mr(Math.round(o.left+i+l),Math.round(o.top+a)),new Mr(Math.round(o.left+i+l),Math.round(o.top+a+s)),new Mr(Math.round(o.left+i),Math.round(o.top+a+s))];default:return[new Mr(Math.round(r.left),Math.round(r.top)),new Mr(Math.round(r.left+r.width),Math.round(r.top)),new Mr(Math.round(r.left+r.width),Math.round(r.height+r.top)),new Mr(Math.round(r.left),Math.round(r.height+r.top))]}},uQt="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bSe="Hidden Text",dQt=function(){function t(e){this._data={},this._document=e}return t.prototype.parseMetrics=function(e,n){var o=this._document.createElement("div"),r=this._document.createElement("img"),i=this._document.createElement("span"),a=this._document.body;o.style.visibility="hidden",o.style.fontFamily=e,o.style.fontSize=n,o.style.margin="0",o.style.padding="0",o.style.whiteSpace="nowrap",a.appendChild(o),r.src=uQt,r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",i.style.fontFamily=e,i.style.fontSize=n,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(bSe)),o.appendChild(i),o.appendChild(r);var l=r.offsetTop-i.offsetTop+2;o.removeChild(i),o.appendChild(this._document.createTextNode(bSe)),o.style.lineHeight="normal",r.style.verticalAlign="super";var s=r.offsetTop-o.offsetTop+2;return a.removeChild(o),{baseline:l,middle:s}},t.prototype.getMetrics=function(e,n){var o=e+" "+n;return typeof this._data[o]>"u"&&(this._data[o]=this.parseMetrics(e,n)),this._data[o]},t}(),n$e=function(){function t(e,n){this.context=e,this.options=n}return t}(),fQt=1e4,hQt=function(t){i5(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r._activeEffects=[],r.canvas=o.canvas?o.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),o.canvas||(r.canvas.width=Math.floor(o.width*o.scale),r.canvas.height=Math.floor(o.height*o.scale),r.canvas.style.width=o.width+"px",r.canvas.style.height=o.height+"px"),r.fontMetrics=new dQt(document),r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-o.x,-o.y),r.ctx.textBaseline="bottom",r._activeEffects=[],r.context.logger.debug("Canvas renderer initialized ("+o.width+"x"+o.height+") with scale "+o.scale),r}return e.prototype.applyEffects=function(n){for(var o=this;this._activeEffects.length;)this.popEffect();n.forEach(function(r){return o.applyEffect(r)})},e.prototype.applyEffect=function(n){this.ctx.save(),eQt(n)&&(this.ctx.globalAlpha=n.opacity),Z$t(n)&&(this.ctx.translate(n.offsetX,n.offsetY),this.ctx.transform(n.matrix[0],n.matrix[1],n.matrix[2],n.matrix[3],n.matrix[4],n.matrix[5]),this.ctx.translate(-n.offsetX,-n.offsetY)),$qe(n)&&(this.path(n.path),this.ctx.clip()),this._activeEffects.push(n)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(n){return Xh(this,void 0,void 0,function(){var o;return Qf(this,function(r){switch(r.label){case 0:return o=n.element.container.styles,o.isVisible()?[4,this.renderStackContent(n)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(n){return Xh(this,void 0,void 0,function(){return Qf(this,function(o){switch(o.label){case 0:if(Du(n.container.flags,16))debugger;return n.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(n)]:[3,3];case 1:return o.sent(),[4,this.renderNodeContent(n)];case 2:o.sent(),o.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(n,o,r){var i=this;if(o===0)this.ctx.fillText(n.text,n.bounds.left,n.bounds.top+r);else{var a=Mye(n.text);a.reduce(function(l,s){return i.ctx.fillText(s,l,n.bounds.top+r),l+i.ctx.measureText(s).width},n.bounds.left)}},e.prototype.createFontStyle=function(n){var o=n.fontVariant.filter(function(a){return a==="normal"||a==="small-caps"}).join(""),r=AQt(n.fontFamily).join(", "),i=oN(n.fontSize)?""+n.fontSize.number+n.fontSize.unit:n.fontSize.number+"px";return[[n.fontStyle,o,n.fontWeight,i,r].join(" "),r,i]},e.prototype.renderTextNode=function(n,o){return Xh(this,void 0,void 0,function(){var r,i,a,l,s,c,u,d,f=this;return Qf(this,function(p){return r=this.createFontStyle(o),i=r[0],a=r[1],l=r[2],this.ctx.font=i,this.ctx.direction=o.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",s=this.fontMetrics.getMetrics(a,l),c=s.baseline,u=s.middle,d=o.paintOrder,n.textBounds.forEach(function(g){d.forEach(function(y){switch(y){case 0:f.ctx.fillStyle=fd(o.color),f.renderTextWithLetterSpacing(g,o.letterSpacing,c);var w=o.textShadow;w.length&&g.text.trim().length&&(w.slice(0).reverse().forEach(function(b){f.ctx.shadowColor=fd(b.color),f.ctx.shadowOffsetX=b.offsetX.number*f.options.scale,f.ctx.shadowOffsetY=b.offsetY.number*f.options.scale,f.ctx.shadowBlur=b.blur.number,f.renderTextWithLetterSpacing(g,o.letterSpacing,c)}),f.ctx.shadowColor="",f.ctx.shadowOffsetX=0,f.ctx.shadowOffsetY=0,f.ctx.shadowBlur=0),o.textDecorationLine.length&&(f.ctx.fillStyle=fd(o.textDecorationColor||o.color),o.textDecorationLine.forEach(function(b){switch(b){case 1:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top+c),g.bounds.width,1);break;case 2:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top),g.bounds.width,1);break;case 3:f.ctx.fillRect(g.bounds.left,Math.ceil(g.bounds.top+u),g.bounds.width,1);break}}));break;case 1:o.webkitTextStrokeWidth&&g.text.trim().length&&(f.ctx.strokeStyle=fd(o.webkitTextStrokeColor),f.ctx.lineWidth=o.webkitTextStrokeWidth,f.ctx.lineJoin=window.chrome?"miter":"round",f.ctx.strokeText(g.text,g.bounds.left,g.bounds.top+c)),f.ctx.strokeStyle="",f.ctx.lineWidth=0,f.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(n,o,r){if(r&&n.intrinsicWidth>0&&n.intrinsicHeight>0){var i=rX(n),a=oX(o);this.path(a),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(r,0,0,n.intrinsicWidth,n.intrinsicHeight,i.left,i.top,i.width,i.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(n){return Xh(this,void 0,void 0,function(){var o,r,i,a,l,s,C,C,c,u,d,f,v,p,g,T,y,w,b,C,P,v,T;return Qf(this,function(A){switch(A.label){case 0:this.applyEffects(n.getEffects(4)),o=n.container,r=n.curves,i=o.styles,a=0,l=o.textNodes,A.label=1;case 1:return a0&&j>0&&(S=i.ctx.createPattern(T,"repeat"),i.renderRepeat(M,S,k,N))):eKt(u)&&(R=Gie(n,o,[null,null,null]),M=R[0],D=R[1],E=R[2],W=R[3],j=R[4],L=u.position.length===0?[Cye]:u.position,k=Xs(L[0],W),N=Xs(L[L.length-1],j),F=KJt(u,k,N,W,j),U=F[0],O=F[1],U>0&&O>0&&(B=i.ctx.createRadialGradient(D+k,E+N,0,D+k,E+N,U),_be(u.stops,U*2).forEach(function(q){return B.addColorStop(q.stop,fd(q.color))}),i.path(M),i.ctx.fillStyle=B,U!==O?(_=n.bounds.left+.5*n.bounds.width,X=n.bounds.top+.5*n.bounds.height,$=O/U,Q=1/$,i.ctx.save(),i.ctx.translate(_,X),i.ctx.transform(1,0,0,$,0,0),i.ctx.translate(-_,-X),i.ctx.fillRect(D,Q*(E-X)+X,W,j*Q),i.ctx.restore()):i.ctx.fill())),le.label=6;case 6:return o--,[2]}})},i=this,a=0,l=n.styles.backgroundImage.slice(0).reverse(),c.label=1;case 1:return a0?u.style!==2?[3,5]:[4,this.renderDashedDottedBorder(u.color,u.width,l,n.curves,2)]:[3,11]):[3,13];case 4:return f.sent(),[3,11];case 5:return u.style!==3?[3,7]:[4,this.renderDashedDottedBorder(u.color,u.width,l,n.curves,3)];case 6:return f.sent(),[3,11];case 7:return u.style!==4?[3,9]:[4,this.renderDoubleBorder(u.color,u.width,l,n.curves)];case 8:return f.sent(),[3,11];case 9:return[4,this.renderSolidBorder(u.color,l,n.curves)];case 10:f.sent(),f.label=11;case 11:l++,f.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(n,o,r,i,a){return Xh(this,void 0,void 0,function(){var l,s,c,u,d,f,p,g,y,w,b,C,P,v,T,A,T,A;return Qf(this,function(x){return this.ctx.save(),l=iQt(i,r),s=xSe(i,r),a===2&&(this.path(s),this.ctx.clip()),Mm(s[0])?(c=s[0].start.x,u=s[0].start.y):(c=s[0].x,u=s[0].y),Mm(s[1])?(d=s[1].end.x,f=s[1].end.y):(d=s[1].x,f=s[1].y),r===0||r===2?p=Math.abs(c-d):p=Math.abs(u-f),this.ctx.beginPath(),a===3?this.formatPath(l):this.formatPath(s.slice(0,2)),g=o<3?o*3:o*2,y=o<3?o*2:o,a===3&&(g=o,y=o),w=!0,p<=g*2?w=!1:p<=g*2+y?(b=p/(2*g+y),g*=b,y*=b):(C=Math.floor((p+y)/(g+y)),P=(p-C*g)/(C-1),v=(p-(C+1)*g)/C,y=v<=0||Math.abs(y-P)"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function o(c,u,d){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){s(f.response,u,d)},f.onerror=function(){console.error("could not download file")},f.send()}function r(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function i(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ac=="object"&&Ac.global===Ac?Ac:void 0,l=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(c,u,d){var f=a.URL||a.webkitURL,p=document.createElement("a");u=u||c.name||"download",p.download=u,p.rel="noopener",typeof c=="string"?(p.href=c,p.origin===location.origin?i(p):r(p.href)?o(c,u,d):i(p,p.target="_blank")):(p.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(p.href)},4e4),setTimeout(function(){i(p)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,d){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(c,d),u);else if(r(c))o(c,u,d);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){i(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return o(c,u,d);var p=c.type==="application/octet-stream",g=/constructor/i.test(a.HTMLElement)||a.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||p&&g||l)&&typeof FileReader<"u"){var w=new FileReader;w.onloadend=function(){var P=w.result;P=y?P:P.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=P:location=P,f=null},w.readAsDataURL(c)}else{var b=a.URL||a.webkitURL,C=b.createObjectURL(c);f?f.location=C:location.href=C,f=null,setTimeout(function(){b.revokeObjectURL(C)},4e4)}});a.saveAs=s.saveAs=s,t.exports=s})})(o$e);var r$e=o$e.exports;const SSe=()=>{window.open("https://intofuture.org","_blank")},CQt=()=>{window.open("https://intofuture.org/aladdin.html","_blank")},RQt=(t,e,n,o)=>"https://maps.googleapis.com/maps/api/staticmap?maptype=satellite¢er="+e+","+n+"&zoom="+o+"&size="+t+"x"+t+"&scale=2&key=AIzaSyCX6AmhM9d6R1ne9E7redd86YEahX_2Scs",HQt=(t,e,n,o)=>"https://maps.googleapis.com/maps/api/staticmap?maptype=roadmap&style=feature:poi|element:labels|visibility:off¢er="+e+","+n+"&zoom="+o+"&size="+t+"x"+t+"&scale=2&key=AIzaSyCX6AmhM9d6R1ne9E7redd86YEahX_2Scs",S2=(t,e)=>{nA.success({duration:2,content:t,className:"custom-class",style:{marginTop:"20vh"},onClick:()=>{nA.destroy()}})},hn=(t,e)=>{nA.info({duration:e??2,content:t,className:"custom-class",style:{marginTop:"20vh"},onClick:()=>{nA.destroy()}})},SR=(t,e)=>{nA.warning({duration:2,content:t,className:"custom-class",style:{marginTop:"20vh"},onClick:()=>{nA.destroy()}})},po=(t,e)=>{nA.error({duration:e??2,content:t,className:"custom-class",style:{marginTop:"20vh"},onClick:()=>{nA.destroy()}})},MQt=(t,e)=>{const n=document.createElement("a");n.download=t,n.href=e,n.click()},kd=async(t,e,n)=>{const o=window.document.getElementById(t);if(o){const r=await SQt(o,{...n,removeContainer:!0}),i=document.createElement("a");i.href=r.toDataURL("image/png",1),i.download=`${e}.png`,i.click()}else throw new Error(`Cannot find element with ID ${t}`)},bh=(t,e)=>{let n="";for(const r of Object.keys(t[0]))n+=r+", ";n+=` +}`,j$t=function(t){B$t(t,"."+Zue+N$t+vSe+` + .`+ede+U$t+vSe)},B$t=function(t,e){var n=t.ownerDocument;if(n){var o=n.createElement("style");o.textContent=e,t.appendChild(o)}},qqe=function(){function t(){}return t.getOrigin=function(e){var n=t._link;return n?(n.href=e,n.href=n.href,n.protocol+n.hostname+n.port):"about:blank"},t.isSameOrigin=function(e){return t.getOrigin(e)===t._origin},t.setContext=function(e){t._link=e.document.createElement("a"),t._origin=t.getOrigin(e.location.href)},t._origin="about:blank",t}(),Y$t=function(){function t(e,n){this.context=e,this._options=n,this._cache={}}return t.prototype.addImage=function(e){var n=Promise.resolve();return this.has(e)||(Vie(e)||G$t(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),n},t.prototype.match=function(e){return this._cache[e]},t.prototype.loadImage=function(e){return Xh(this,void 0,void 0,function(){var n,o,r,i,a=this;return Qf(this,function(l){switch(l.label){case 0:return n=qqe.isSameOrigin(e),o=!_ie(e)&&this._options.useCORS===!0&&sf.SUPPORT_CORS_IMAGES&&!n,r=!_ie(e)&&!n&&!Vie(e)&&typeof this._options.proxy=="string"&&sf.SUPPORT_CORS_XHR&&!o,!n&&this._options.allowTaint===!1&&!_ie(e)&&!Vie(e)&&!r&&!o?[2]:(i=e,r?[4,this.proxy(i)]:[3,2]);case 1:i=l.sent(),l.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(s,c){var u=new Image;u.onload=function(){return s(u)},u.onerror=c,(X$t(i)||o)&&(u.crossOrigin="anonymous"),u.src=i,u.complete===!0&&setTimeout(function(){return s(u)},500),a._options.imageTimeout>0&&setTimeout(function(){return c("Timed out ("+a._options.imageTimeout+"ms) loading image")},a._options.imageTimeout)})];case 3:return[2,l.sent()]}})})},t.prototype.has=function(e){return typeof this._cache[e]<"u"},t.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},t.prototype.proxy=function(e){var n=this,o=this._options.proxy;if(!o)throw new Error("No proxy defined");var r=e.substring(0,256);return new Promise(function(i,a){var l=sf.SUPPORT_RESPONSE_TYPE?"blob":"text",s=new XMLHttpRequest;s.onload=function(){if(s.status===200)if(l==="text")i(s.response);else{var d=new FileReader;d.addEventListener("load",function(){return i(d.result)},!1),d.addEventListener("error",function(f){return a(f)},!1),d.readAsDataURL(s.response)}else a("Failed to proxy resource "+r+" with status code "+s.status)},s.onerror=a;var c=o.indexOf("?")>-1?"&":"?";if(s.open("GET",""+o+c+"url="+encodeURIComponent(e)+"&responseType="+l),l!=="text"&&s instanceof XMLHttpRequest&&(s.responseType=l),n._options.imageTimeout){var u=n._options.imageTimeout;s.timeout=u,s.ontimeout=function(){return a("Timed out ("+u+"ms) proxying "+r)}}s.send()})},t}(),O$t=/^data:image\/svg\+xml/i,_$t=/^data:image\/.*;base64,/i,V$t=/^data:image\/.*/i,G$t=function(t){return sf.SUPPORT_SVG_DRAWING||!J$t(t)},_ie=function(t){return V$t.test(t)},X$t=function(t){return _$t.test(t)},Vie=function(t){return t.substr(0,4)==="blob"},J$t=function(t){return t.substr(-3).toLowerCase()==="svg"||O$t.test(t)},Mr=function(){function t(e,n){this.type=0,this.x=e,this.y=n}return t.prototype.add=function(e,n){return new t(this.x+e,this.y+n)},t}(),BT=function(t,e,n){return new Mr(t.x+(e.x-t.x)*n,t.y+(e.y-t.y)*n)},cO=function(){function t(e,n,o,r){this.type=1,this.start=e,this.startControl=n,this.endControl=o,this.end=r}return t.prototype.subdivide=function(e,n){var o=BT(this.start,this.startControl,e),r=BT(this.startControl,this.endControl,e),i=BT(this.endControl,this.end,e),a=BT(o,r,e),l=BT(r,i,e),s=BT(a,l,e);return n?new t(this.start,o,a,s):new t(s,l,i,this.end)},t.prototype.add=function(e,n){return new t(this.start.add(e,n),this.startControl.add(e,n),this.endControl.add(e,n),this.end.add(e,n))},t.prototype.reverse=function(){return new t(this.end,this.endControl,this.startControl,this.start)},t}(),Mm=function(t){return t.type===1},K$t=function(){function t(e){var n=e.styles,o=e.bounds,r=kD(n.borderTopLeftRadius,o.width,o.height),i=r[0],a=r[1],l=kD(n.borderTopRightRadius,o.width,o.height),s=l[0],c=l[1],u=kD(n.borderBottomRightRadius,o.width,o.height),d=u[0],f=u[1],p=kD(n.borderBottomLeftRadius,o.width,o.height),g=p[0],y=p[1],w=[];w.push((i+s)/o.width),w.push((g+d)/o.width),w.push((a+y)/o.height),w.push((c+f)/o.height);var b=Math.max.apply(Math,w);b>1&&(i/=b,a/=b,s/=b,c/=b,d/=b,f/=b,g/=b,y/=b);var C=o.width-s,P=o.height-f,v=o.width-d,T=o.height-y,A=n.borderTopWidth,x=n.borderRightWidth,S=n.borderBottomWidth,R=n.borderLeftWidth,M=Xs(n.paddingTop,e.bounds.width),D=Xs(n.paddingRight,e.bounds.width),E=Xs(n.paddingBottom,e.bounds.width),W=Xs(n.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||a>0?kc(o.left+R/3,o.top+A/3,i-R/3,a-A/3,Zl.TOP_LEFT):new Mr(o.left+R/3,o.top+A/3),this.topRightBorderDoubleOuterBox=i>0||a>0?kc(o.left+C,o.top+A/3,s-x/3,c-A/3,Zl.TOP_RIGHT):new Mr(o.left+o.width-x/3,o.top+A/3),this.bottomRightBorderDoubleOuterBox=d>0||f>0?kc(o.left+v,o.top+P,d-x/3,f-S/3,Zl.BOTTOM_RIGHT):new Mr(o.left+o.width-x/3,o.top+o.height-S/3),this.bottomLeftBorderDoubleOuterBox=g>0||y>0?kc(o.left+R/3,o.top+T,g-R/3,y-S/3,Zl.BOTTOM_LEFT):new Mr(o.left+R/3,o.top+o.height-S/3),this.topLeftBorderDoubleInnerBox=i>0||a>0?kc(o.left+R*2/3,o.top+A*2/3,i-R*2/3,a-A*2/3,Zl.TOP_LEFT):new Mr(o.left+R*2/3,o.top+A*2/3),this.topRightBorderDoubleInnerBox=i>0||a>0?kc(o.left+C,o.top+A*2/3,s-x*2/3,c-A*2/3,Zl.TOP_RIGHT):new Mr(o.left+o.width-x*2/3,o.top+A*2/3),this.bottomRightBorderDoubleInnerBox=d>0||f>0?kc(o.left+v,o.top+P,d-x*2/3,f-S*2/3,Zl.BOTTOM_RIGHT):new Mr(o.left+o.width-x*2/3,o.top+o.height-S*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||y>0?kc(o.left+R*2/3,o.top+T,g-R*2/3,y-S*2/3,Zl.BOTTOM_LEFT):new Mr(o.left+R*2/3,o.top+o.height-S*2/3),this.topLeftBorderStroke=i>0||a>0?kc(o.left+R/2,o.top+A/2,i-R/2,a-A/2,Zl.TOP_LEFT):new Mr(o.left+R/2,o.top+A/2),this.topRightBorderStroke=i>0||a>0?kc(o.left+C,o.top+A/2,s-x/2,c-A/2,Zl.TOP_RIGHT):new Mr(o.left+o.width-x/2,o.top+A/2),this.bottomRightBorderStroke=d>0||f>0?kc(o.left+v,o.top+P,d-x/2,f-S/2,Zl.BOTTOM_RIGHT):new Mr(o.left+o.width-x/2,o.top+o.height-S/2),this.bottomLeftBorderStroke=g>0||y>0?kc(o.left+R/2,o.top+T,g-R/2,y-S/2,Zl.BOTTOM_LEFT):new Mr(o.left+R/2,o.top+o.height-S/2),this.topLeftBorderBox=i>0||a>0?kc(o.left,o.top,i,a,Zl.TOP_LEFT):new Mr(o.left,o.top),this.topRightBorderBox=s>0||c>0?kc(o.left+C,o.top,s,c,Zl.TOP_RIGHT):new Mr(o.left+o.width,o.top),this.bottomRightBorderBox=d>0||f>0?kc(o.left+v,o.top+P,d,f,Zl.BOTTOM_RIGHT):new Mr(o.left+o.width,o.top+o.height),this.bottomLeftBorderBox=g>0||y>0?kc(o.left,o.top+T,g,y,Zl.BOTTOM_LEFT):new Mr(o.left,o.top+o.height),this.topLeftPaddingBox=i>0||a>0?kc(o.left+R,o.top+A,Math.max(0,i-R),Math.max(0,a-A),Zl.TOP_LEFT):new Mr(o.left+R,o.top+A),this.topRightPaddingBox=s>0||c>0?kc(o.left+Math.min(C,o.width-x),o.top+A,C>o.width+x?0:Math.max(0,s-x),Math.max(0,c-A),Zl.TOP_RIGHT):new Mr(o.left+o.width-x,o.top+A),this.bottomRightPaddingBox=d>0||f>0?kc(o.left+Math.min(v,o.width-R),o.top+Math.min(P,o.height-S),Math.max(0,d-x),Math.max(0,f-S),Zl.BOTTOM_RIGHT):new Mr(o.left+o.width-x,o.top+o.height-S),this.bottomLeftPaddingBox=g>0||y>0?kc(o.left+R,o.top+Math.min(T,o.height-S),Math.max(0,g-R),Math.max(0,y-S),Zl.BOTTOM_LEFT):new Mr(o.left+R,o.top+o.height-S),this.topLeftContentBox=i>0||a>0?kc(o.left+R+W,o.top+A+M,Math.max(0,i-(R+W)),Math.max(0,a-(A+M)),Zl.TOP_LEFT):new Mr(o.left+R+W,o.top+A+M),this.topRightContentBox=s>0||c>0?kc(o.left+Math.min(C,o.width+R+W),o.top+A+M,C>o.width+R+W?0:s-R+W,c-(A+M),Zl.TOP_RIGHT):new Mr(o.left+o.width-(x+D),o.top+A+M),this.bottomRightContentBox=d>0||f>0?kc(o.left+Math.min(v,o.width-(R+W)),o.top+Math.min(P,o.height+A+M),Math.max(0,d-(x+D)),f-(S+E),Zl.BOTTOM_RIGHT):new Mr(o.left+o.width-(x+D),o.top+o.height-(S+E)),this.bottomLeftContentBox=g>0||y>0?kc(o.left+R+W,o.top+T,Math.max(0,g-(R+W)),y-(S+E),Zl.BOTTOM_LEFT):new Mr(o.left+R+W,o.top+o.height-(S+E))}return t}(),Zl;(function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=1]="TOP_RIGHT",t[t.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",t[t.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Zl||(Zl={}));var kc=function(t,e,n,o,r){var i=4*((Math.sqrt(2)-1)/3),a=n*i,l=o*i,s=t+n,c=e+o;switch(r){case Zl.TOP_LEFT:return new cO(new Mr(t,c),new Mr(t,c-l),new Mr(s-a,e),new Mr(s,e));case Zl.TOP_RIGHT:return new cO(new Mr(t,e),new Mr(t+a,e),new Mr(s,c-l),new Mr(s,c));case Zl.BOTTOM_RIGHT:return new cO(new Mr(s,e),new Mr(s,e+l),new Mr(t+a,c),new Mr(t,c));case Zl.BOTTOM_LEFT:default:return new cO(new Mr(s,c),new Mr(s-a,c),new Mr(t,e+l),new Mr(t,e))}},oX=function(t){return[t.topLeftBorderBox,t.topRightBorderBox,t.bottomRightBorderBox,t.bottomLeftBorderBox]},q$t=function(t){return[t.topLeftContentBox,t.topRightContentBox,t.bottomRightContentBox,t.bottomLeftContentBox]},rX=function(t){return[t.topLeftPaddingBox,t.topRightPaddingBox,t.bottomRightPaddingBox,t.bottomLeftPaddingBox]},$$t=function(){function t(e,n,o){this.offsetX=e,this.offsetY=n,this.matrix=o,this.type=0,this.target=6}return t}(),uO=function(){function t(e,n){this.path=e,this.target=n,this.type=1}return t}(),Q$t=function(){function t(e){this.opacity=e,this.type=2,this.target=6}return t}(),Z$t=function(t){return t.type===0},$qe=function(t){return t.type===1},eQt=function(t){return t.type===2},xSe=function(t,e){return t.length===e.length?t.some(function(n,o){return n===e[o]}):!1},tQt=function(t,e,n,o,r){return t.map(function(i,a){switch(a){case 0:return i.add(e,n);case 1:return i.add(e+o,n);case 2:return i.add(e+o,n+r);case 3:return i.add(e,n+r)}return i})},Qqe=function(){function t(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return t}(),Zqe=function(){function t(e,n){if(this.container=e,this.parent=n,this.effects=[],this.curves=new K$t(this.container),this.container.styles.opacity<1&&this.effects.push(new Q$t(this.container.styles.opacity)),this.container.styles.transform!==null){var o=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new $$t(o,r,i))}if(this.container.styles.overflowX!==0){var a=oX(this.curves),l=rX(this.curves);xSe(a,l)?this.effects.push(new uO(a,6)):(this.effects.push(new uO(a,2)),this.effects.push(new uO(l,4)))}}return t.prototype.getEffects=function(e){for(var n=[2,3].indexOf(this.container.styles.position)===-1,o=this.parent,r=this.effects.slice(0);o;){var i=o.effects.filter(function(s){return!$qe(s)});if(n||o.container.styles.position!==0||!o.parent){if(r.unshift.apply(r,i),n=[2,3].indexOf(o.container.styles.position)===-1,o.container.styles.overflowX!==0){var a=oX(o.curves),l=rX(o.curves);xSe(a,l)||r.unshift(new uO(l,6))}}else r.unshift.apply(r,i);o=o.parent}return r.filter(function(s){return Du(s.target,e)})},t}(),tde=function(t,e,n,o){t.container.elements.forEach(function(r){var i=Du(r.flags,4),a=Du(r.flags,2),l=new Zqe(r,t);Du(r.styles.display,2048)&&o.push(l);var s=Du(r.flags,8)?[]:o;if(i||a){var c=i||r.styles.isPositioned()?n:e,u=new Qqe(l);if(r.styles.isPositioned()||r.styles.opacity<1||r.styles.isTransformed()){var d=r.styles.zIndex.order;if(d<0){var f=0;c.negativeZIndex.some(function(g,y){return d>g.element.container.styles.zIndex.order?(f=y,!1):f>0}),c.negativeZIndex.splice(f,0,u)}else if(d>0){var p=0;c.positiveZIndex.some(function(g,y){return d>=g.element.container.styles.zIndex.order?(p=y+1,!1):p>0}),c.positiveZIndex.splice(p,0,u)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else r.styles.isFloating()?c.nonPositionedFloats.push(u):c.nonPositionedInlineLevel.push(u);tde(l,u,i?u:n,s)}else r.styles.isInlineLevel()?e.inlineLevel.push(l):e.nonInlineLevel.push(l),tde(l,e,n,s);Du(r.flags,8)&&e$e(r,s)})},e$e=function(t,e){for(var n=t instanceof que?t.start:1,o=t instanceof que?t.reversed:!1,r=0;r"u"?t[0]:n},cQt=function(t,e,n,o,r){var i=e[0],a=e[1],l=n[0],s=n[1];switch(t){case 2:return[new Mr(Math.round(o.left),Math.round(o.top+a)),new Mr(Math.round(o.left+o.width),Math.round(o.top+a)),new Mr(Math.round(o.left+o.width),Math.round(s+o.top+a)),new Mr(Math.round(o.left),Math.round(s+o.top+a))];case 3:return[new Mr(Math.round(o.left+i),Math.round(o.top)),new Mr(Math.round(o.left+i+l),Math.round(o.top)),new Mr(Math.round(o.left+i+l),Math.round(o.height+o.top)),new Mr(Math.round(o.left+i),Math.round(o.height+o.top))];case 1:return[new Mr(Math.round(o.left+i),Math.round(o.top+a)),new Mr(Math.round(o.left+i+l),Math.round(o.top+a)),new Mr(Math.round(o.left+i+l),Math.round(o.top+a+s)),new Mr(Math.round(o.left+i),Math.round(o.top+a+s))];default:return[new Mr(Math.round(r.left),Math.round(r.top)),new Mr(Math.round(r.left+r.width),Math.round(r.top)),new Mr(Math.round(r.left+r.width),Math.round(r.height+r.top)),new Mr(Math.round(r.left),Math.round(r.height+r.top))]}},uQt="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",SSe="Hidden Text",dQt=function(){function t(e){this._data={},this._document=e}return t.prototype.parseMetrics=function(e,n){var o=this._document.createElement("div"),r=this._document.createElement("img"),i=this._document.createElement("span"),a=this._document.body;o.style.visibility="hidden",o.style.fontFamily=e,o.style.fontSize=n,o.style.margin="0",o.style.padding="0",o.style.whiteSpace="nowrap",a.appendChild(o),r.src=uQt,r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",i.style.fontFamily=e,i.style.fontSize=n,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(SSe)),o.appendChild(i),o.appendChild(r);var l=r.offsetTop-i.offsetTop+2;o.removeChild(i),o.appendChild(this._document.createTextNode(SSe)),o.style.lineHeight="normal",r.style.verticalAlign="super";var s=r.offsetTop-o.offsetTop+2;return a.removeChild(o),{baseline:l,middle:s}},t.prototype.getMetrics=function(e,n){var o=e+" "+n;return typeof this._data[o]>"u"&&(this._data[o]=this.parseMetrics(e,n)),this._data[o]},t}(),n$e=function(){function t(e,n){this.context=e,this.options=n}return t}(),fQt=1e4,hQt=function(t){i5(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r._activeEffects=[],r.canvas=o.canvas?o.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),o.canvas||(r.canvas.width=Math.floor(o.width*o.scale),r.canvas.height=Math.floor(o.height*o.scale),r.canvas.style.width=o.width+"px",r.canvas.style.height=o.height+"px"),r.fontMetrics=new dQt(document),r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-o.x,-o.y),r.ctx.textBaseline="bottom",r._activeEffects=[],r.context.logger.debug("Canvas renderer initialized ("+o.width+"x"+o.height+") with scale "+o.scale),r}return e.prototype.applyEffects=function(n){for(var o=this;this._activeEffects.length;)this.popEffect();n.forEach(function(r){return o.applyEffect(r)})},e.prototype.applyEffect=function(n){this.ctx.save(),eQt(n)&&(this.ctx.globalAlpha=n.opacity),Z$t(n)&&(this.ctx.translate(n.offsetX,n.offsetY),this.ctx.transform(n.matrix[0],n.matrix[1],n.matrix[2],n.matrix[3],n.matrix[4],n.matrix[5]),this.ctx.translate(-n.offsetX,-n.offsetY)),$qe(n)&&(this.path(n.path),this.ctx.clip()),this._activeEffects.push(n)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(n){return Xh(this,void 0,void 0,function(){var o;return Qf(this,function(r){switch(r.label){case 0:return o=n.element.container.styles,o.isVisible()?[4,this.renderStackContent(n)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(n){return Xh(this,void 0,void 0,function(){return Qf(this,function(o){switch(o.label){case 0:if(Du(n.container.flags,16))debugger;return n.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(n)]:[3,3];case 1:return o.sent(),[4,this.renderNodeContent(n)];case 2:o.sent(),o.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(n,o,r){var i=this;if(o===0)this.ctx.fillText(n.text,n.bounds.left,n.bounds.top+r);else{var a=Iye(n.text);a.reduce(function(l,s){return i.ctx.fillText(s,l,n.bounds.top+r),l+i.ctx.measureText(s).width},n.bounds.left)}},e.prototype.createFontStyle=function(n){var o=n.fontVariant.filter(function(a){return a==="normal"||a==="small-caps"}).join(""),r=AQt(n.fontFamily).join(", "),i=rN(n.fontSize)?""+n.fontSize.number+n.fontSize.unit:n.fontSize.number+"px";return[[n.fontStyle,o,n.fontWeight,i,r].join(" "),r,i]},e.prototype.renderTextNode=function(n,o){return Xh(this,void 0,void 0,function(){var r,i,a,l,s,c,u,d,f=this;return Qf(this,function(p){return r=this.createFontStyle(o),i=r[0],a=r[1],l=r[2],this.ctx.font=i,this.ctx.direction=o.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",s=this.fontMetrics.getMetrics(a,l),c=s.baseline,u=s.middle,d=o.paintOrder,n.textBounds.forEach(function(g){d.forEach(function(y){switch(y){case 0:f.ctx.fillStyle=fd(o.color),f.renderTextWithLetterSpacing(g,o.letterSpacing,c);var w=o.textShadow;w.length&&g.text.trim().length&&(w.slice(0).reverse().forEach(function(b){f.ctx.shadowColor=fd(b.color),f.ctx.shadowOffsetX=b.offsetX.number*f.options.scale,f.ctx.shadowOffsetY=b.offsetY.number*f.options.scale,f.ctx.shadowBlur=b.blur.number,f.renderTextWithLetterSpacing(g,o.letterSpacing,c)}),f.ctx.shadowColor="",f.ctx.shadowOffsetX=0,f.ctx.shadowOffsetY=0,f.ctx.shadowBlur=0),o.textDecorationLine.length&&(f.ctx.fillStyle=fd(o.textDecorationColor||o.color),o.textDecorationLine.forEach(function(b){switch(b){case 1:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top+c),g.bounds.width,1);break;case 2:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top),g.bounds.width,1);break;case 3:f.ctx.fillRect(g.bounds.left,Math.ceil(g.bounds.top+u),g.bounds.width,1);break}}));break;case 1:o.webkitTextStrokeWidth&&g.text.trim().length&&(f.ctx.strokeStyle=fd(o.webkitTextStrokeColor),f.ctx.lineWidth=o.webkitTextStrokeWidth,f.ctx.lineJoin=window.chrome?"miter":"round",f.ctx.strokeText(g.text,g.bounds.left,g.bounds.top+c)),f.ctx.strokeStyle="",f.ctx.lineWidth=0,f.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(n,o,r){if(r&&n.intrinsicWidth>0&&n.intrinsicHeight>0){var i=iX(n),a=rX(o);this.path(a),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(r,0,0,n.intrinsicWidth,n.intrinsicHeight,i.left,i.top,i.width,i.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(n){return Xh(this,void 0,void 0,function(){var o,r,i,a,l,s,C,C,c,u,d,f,v,p,g,T,y,w,b,C,P,v,T;return Qf(this,function(A){switch(A.label){case 0:this.applyEffects(n.getEffects(4)),o=n.container,r=n.curves,i=o.styles,a=0,l=o.textNodes,A.label=1;case 1:return a0&&j>0&&(S=i.ctx.createPattern(T,"repeat"),i.renderRepeat(M,S,k,N))):eKt(u)&&(R=Gie(n,o,[null,null,null]),M=R[0],D=R[1],E=R[2],W=R[3],j=R[4],L=u.position.length===0?[Rye]:u.position,k=Xs(L[0],W),N=Xs(L[L.length-1],j),F=KJt(u,k,N,W,j),U=F[0],O=F[1],U>0&&O>0&&(B=i.ctx.createRadialGradient(D+k,E+N,0,D+k,E+N,U),Vbe(u.stops,U*2).forEach(function(q){return B.addColorStop(q.stop,fd(q.color))}),i.path(M),i.ctx.fillStyle=B,U!==O?(_=n.bounds.left+.5*n.bounds.width,X=n.bounds.top+.5*n.bounds.height,$=O/U,Q=1/$,i.ctx.save(),i.ctx.translate(_,X),i.ctx.transform(1,0,0,$,0,0),i.ctx.translate(-_,-X),i.ctx.fillRect(D,Q*(E-X)+X,W,j*Q),i.ctx.restore()):i.ctx.fill())),le.label=6;case 6:return o--,[2]}})},i=this,a=0,l=n.styles.backgroundImage.slice(0).reverse(),c.label=1;case 1:return a0?u.style!==2?[3,5]:[4,this.renderDashedDottedBorder(u.color,u.width,l,n.curves,2)]:[3,11]):[3,13];case 4:return f.sent(),[3,11];case 5:return u.style!==3?[3,7]:[4,this.renderDashedDottedBorder(u.color,u.width,l,n.curves,3)];case 6:return f.sent(),[3,11];case 7:return u.style!==4?[3,9]:[4,this.renderDoubleBorder(u.color,u.width,l,n.curves)];case 8:return f.sent(),[3,11];case 9:return[4,this.renderSolidBorder(u.color,l,n.curves)];case 10:f.sent(),f.label=11;case 11:l++,f.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(n,o,r,i,a){return Xh(this,void 0,void 0,function(){var l,s,c,u,d,f,p,g,y,w,b,C,P,v,T,A,T,A;return Qf(this,function(x){return this.ctx.save(),l=iQt(i,r),s=bSe(i,r),a===2&&(this.path(s),this.ctx.clip()),Mm(s[0])?(c=s[0].start.x,u=s[0].start.y):(c=s[0].x,u=s[0].y),Mm(s[1])?(d=s[1].end.x,f=s[1].end.y):(d=s[1].x,f=s[1].y),r===0||r===2?p=Math.abs(c-d):p=Math.abs(u-f),this.ctx.beginPath(),a===3?this.formatPath(l):this.formatPath(s.slice(0,2)),g=o<3?o*3:o*2,y=o<3?o*2:o,a===3&&(g=o,y=o),w=!0,p<=g*2?w=!1:p<=g*2+y?(b=p/(2*g+y),g*=b,y*=b):(C=Math.floor((p+y)/(g+y)),P=(p-C*g)/(C-1),v=(p-(C+1)*g)/C,y=v<=0||Math.abs(y-P)"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function o(c,u,d){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){s(f.response,u,d)},f.onerror=function(){console.error("could not download file")},f.send()}function r(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function i(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ac=="object"&&Ac.global===Ac?Ac:void 0,l=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(c,u,d){var f=a.URL||a.webkitURL,p=document.createElement("a");u=u||c.name||"download",p.download=u,p.rel="noopener",typeof c=="string"?(p.href=c,p.origin===location.origin?i(p):r(p.href)?o(c,u,d):i(p,p.target="_blank")):(p.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(p.href)},4e4),setTimeout(function(){i(p)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,d){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(c,d),u);else if(r(c))o(c,u,d);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){i(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return o(c,u,d);var p=c.type==="application/octet-stream",g=/constructor/i.test(a.HTMLElement)||a.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||p&&g||l)&&typeof FileReader<"u"){var w=new FileReader;w.onloadend=function(){var P=w.result;P=y?P:P.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=P:location=P,f=null},w.readAsDataURL(c)}else{var b=a.URL||a.webkitURL,C=b.createObjectURL(c);f?f.location=C:location.href=C,f=null,setTimeout(function(){b.revokeObjectURL(C)},4e4)}});a.saveAs=s.saveAs=s,t.exports=s})})(o$e);var r$e=o$e.exports;const TSe=()=>{window.open("https://intofuture.org","_blank")},CQt=()=>{window.open("https://intofuture.org/aladdin.html","_blank")},RQt=(t,e,n,o)=>"https://maps.googleapis.com/maps/api/staticmap?maptype=satellite¢er="+e+","+n+"&zoom="+o+"&size="+t+"x"+t+"&scale=2&key=AIzaSyCX6AmhM9d6R1ne9E7redd86YEahX_2Scs",HQt=(t,e,n,o)=>"https://maps.googleapis.com/maps/api/staticmap?maptype=roadmap&style=feature:poi|element:labels|visibility:off¢er="+e+","+n+"&zoom="+o+"&size="+t+"x"+t+"&scale=2&key=AIzaSyCX6AmhM9d6R1ne9E7redd86YEahX_2Scs",S2=(t,e)=>{nA.success({duration:2,content:t,className:"custom-class",style:{marginTop:"20vh"},onClick:()=>{nA.destroy()}})},hn=(t,e)=>{nA.info({duration:e??2,content:t,className:"custom-class",style:{marginTop:"20vh"},onClick:()=>{nA.destroy()}})},SR=(t,e)=>{nA.warning({duration:2,content:t,className:"custom-class",style:{marginTop:"20vh"},onClick:()=>{nA.destroy()}})},po=(t,e)=>{nA.error({duration:e??2,content:t,className:"custom-class",style:{marginTop:"20vh"},onClick:()=>{nA.destroy()}})},MQt=(t,e)=>{const n=document.createElement("a");n.download=t,n.href=e,n.click()},kd=async(t,e,n)=>{const o=window.document.getElementById(t);if(o){const r=await SQt(o,{...n,removeContainer:!0}),i=document.createElement("a");i.href=r.toDataURL("image/png",1),i.download=`${e}.png`,i.click()}else throw new Error(`Cannot find element with ID ${t}`)},bh=(t,e)=>{let n="";for(const r of Object.keys(t[0]))n+=r+", ";n+=` `;for(const r of t){for(const i of Object.values(r))n+=i+", ";n+=` -`}const o=new Blob([n],{type:"text/csv;charset=utf-8"});r$e.saveAs(o,e)},zl=new ie,i9=new ie,nde=new ie,ode=new ie,Hu=new nn,lf=new bs,Dye="/aladdin/assets/wall_edge-B4PmTeCj.png",IQt="/aladdin/assets/wall_01-B-g_tqAI.png",zQt="/aladdin/assets/wall_02-9M_qG3R_.png",DQt="/aladdin/assets/wall_03-ChpvVFgd.png",EQt="/aladdin/assets/wall_04-BkmmH41c.png",FQt="/aladdin/assets/wall_05-DFi74_0h.png",kQt="/aladdin/assets/wall_06-CtX-9FCz.png",LQt="/aladdin/assets/wall_07-CJgSaJ5B.png",WQt="/aladdin/assets/wall_08-DwhD-VRH.png",NQt="/aladdin/assets/wall_09-D3ncCSYQ.png",UQt="/aladdin/assets/wall_10-RK6QVYt5.png",jQt=(t,e,n,o)=>{const r=c=>c.parentId===t||c.id===o,i=H(c=>{if(e){for(const u of c.elements)if(u.id===e)return u}return null}),a=H(c=>{if(n){for(const u of c.elements)if(u.id===n)return u}return null}),l=H(c=>JSON.stringify(c.elements.filter(r)));return{elementsOnWall:m.useMemo(()=>H.getState().elements.filter(c=>r(c)&&me.isLegalOnWall(c.type)),[l]),leftWall:i,rightWall:a}},a5=(t=.3)=>{const e=H(i=>i.viewState.orthographic),n=H(i=>i.viewState.cameraPosition),o=H(i=>i.viewState.cameraZoom);let r;if(e)r=Math.max(t,15/o);else{const i=H.getState().viewState.panCenter,a=new ie(...i),s=new ie(...n).distanceTo(a);r=Math.max(t,s/100)}return r},i$e=(t,e)=>{const n=m.useMemo(()=>new df,[]);return m.useMemo(()=>{let o;switch(t){case Uo.Default:o=Dye;break;case Uo.NoTexture:o=ig;break;case Uo.Texture01:o=IQt;break;case Uo.Texture02:o=zQt;break;case Uo.Texture03:o=DQt;break;case Uo.Texture04:o=EQt;break;case Uo.Texture05:o=FQt;break;case Uo.Texture06:o=kQt;break;case Uo.Texture07:o=LQt;break;case Uo.Texture08:o=WQt;break;case Uo.Texture09:o=NQt;break;case Uo.Texture10:o=UQt;break;default:o=ig}return e===gc.Stud&&(o=ig),n.load(o,r=>{r.wrapS=r.wrapT=Hs,r.offset.set(0,0);let i=.6,a=.6;switch(t){case Uo.Default:i=2,a=2;break;case Uo.Texture03:i=2,a=1;break;case Uo.Texture06:i=1,a=1;break}r.repeat.set(i,a),np()})},[t,e])},a$e=t=>{const e=m.useRef(!0);ht(o=>o.foundationMovedFlag);let n=t;if(!e.current){const o=H.getState().elements.find(r=>r.id===t.id&&r.type===z.Foundation);o&&(n=o)}return e.current=!1,n},CK=class CK{static getIntersectionObjects(e){return e.intersections.filter(n=>n.eventObject.name.includes("Cuboid")||n.eventObject.name==="Foundation"||n.eventObject.name.includes("Roof")||n.eventObject.name.includes(CK.WALL_OUTSIDE_SURFACE_MESH_NAME))}static addUndoableMove(){const e=H.getState().selectedElement;if(!e)return;const n=H.getState().getElementById(e.id),o=ht.getState().oldParentId,r=ht.getState().oldFoundationId;if(!n||!o||!r)return;const i=e.type===z.SolarPanel,a=e.type===z.Polygon,l={name:"Move",timestamp:Date.now(),movedElementId:n.id,movedElementType:n.type,oldCx:e.cx,oldCy:e.cy,oldCz:e.cz,newCx:n.cx,newCy:n.cy,newCz:n.cz,oldParentType:i?e.parentType:void 0,newParentType:i?n.parentType:void 0,oldParentId:o,newParentId:n.parentId,oldFoundationId:r,newFoundationId:n.foundationId,oldNormal:new ie().fromArray(e.normal),newNormal:new ie().fromArray(n.normal),oldRotation:[...e.rotation],newRotation:[...n.rotation],undo(){s(this.movedElementId,[this.oldCx,this.oldCy,this.oldCz],this.oldParentId,this.newParentId,this.oldFoundationId,this.oldParentType,this.oldRotation,this.oldNormal,a?e.vertices:void 0)},redo(){s(this.movedElementId,[this.newCx,this.newCy,this.newCz],this.newParentId,this.oldParentId,this.newFoundationId,this.newParentType,this.newRotation,this.newNormal,a?n.vertices:void 0)}};H.getState().addUndoable(l);const s=(c,u,d,f,p,g,y,w,b)=>{H.getState().set(C=>{const P=C.elements.find(v=>v.id===c);if(P){if(P.type===z.Polygon){if(b){const v=P;v.vertices=[...b]}}else[P.cx,P.cy,P.cz]=[...u];if(d&&f&&p&&(P.parentId=d,P.foundationId=p,g&&P.type===z.SolarPanel&&(P.parentType=g),y&&(P.rotation=[...y]),w&&(P.normal=[w.x,w.y,w.z]),P.type===z.Window)){const v=C.elements.find(S=>S.id===d),T=C.elements.find(S=>S.id===f);if(!v||!T)return;const A=P.lx*T.lx,x=P.lz*T.lz;P.lx=A/v.lx,P.lz=x/v.lz}}})}}static undoInvalidOperation(){H.getState().set(e=>{var n;if(e.selectedElement){for(let o=0;o{const e={name:`Add ${t.type} on Roof`,timestamp:Date.now(),addedElement:t,undo:()=>{H.getState().removeElementById(t.id,!1)},redo:()=>{H.getState().set(n=>{n.elements.push(e.addedElement),n.selectedElement=e.addedElement})}};H.getState().addUndoable(e)},BQt=t=>{for(const e of t.intersections)if(e.eventObject.name.includes("Roof Segments Group"))return e.object.name.includes("Flat roof")?e.point.clone().setZ(e.point.z-.01):e.point;return t.intersections[0].point},YQt=(t,e,n,o,r)=>{if(t.intersections.length===0)return;const i=H.getState().objectTypeToAdd;if(i===z.None)return;const a=H.getState().getElementById(n),l=H.getState().getElementById(e);if(!a||!l)return;const s=BQt(t),c=new ie().subVectors(s,new ie(l.cx,l.cy,l.lz/2)).applyEuler(new nn(0,0,-l.rotation[2])),u=c.clone().sub(r);switch(i){case z.SolarPanel:{const{normal:d,rotation:f}=Cn.computeState(o,u),p=H.getState().actionState,g=Ga.makeSolarPanel(a,H.getState().getPvModule(p.solarPanelModelName??"SPR-X21-335-BLK"),c.x,c.y,c.z,p.solarPanelOrientation??vr.landscape,p.solarPanelPoleHeight??1,p.solarPanelPoleSpacing??3,p.solarPanelTiltAngle??0,p.solarPanelRelativeAzimuth??0,d,f??[0,0,1],p.solarPanelFrameColor);H.getState().set(y=>{y.elements.push(g),y.selectedElementIdSet.clear(),y.selectedElementIdSet.add(g.id),y.actionModeLock||(y.objectTypeToAdd=z.None)}),Oz(g);break}case z.WaterHeater:{const{normal:d,rotation:f}=Cn.computeState(o,u);H.getState().actionState;const p=Ga.makeWaterHeater(a,c.x,c.y,c.z,d,f??[0,0,1]);H.getState().set(g=>{g.elements.push(p),g.selectedElementIdSet.clear(),g.selectedElementIdSet.add(p.id),g.actionModeLock||(g.objectTypeToAdd=z.None)}),Oz(p);break}case z.Window:{const{normal:d,rotation:f}=Cn.computeState(o,u),p=Ga.makeWindow(a,c.x,c.y,c.z,z.Roof,f,.5,.5);H.getState().set(g=>{g.elements.push(p),g.selectedElementIdSet.clear(),g.selectedElementIdSet.add(p.id),g.actionModeLock||(g.objectTypeToAdd=z.None)}),Oz(p);break}case z.Sensor:{const{normal:d,rotation:f}=Cn.computeState(o,u),p=Ga.makeSensor(a,c.x/l.lx,c.y/l.ly,c.z,d,f??[0,0,1]);H.getState().set(g=>{g.elements.push(p),g.selectedElementIdSet.clear(),g.selectedElementIdSet.add(p.id),g.actionModeLock||(g.objectTypeToAdd=z.None)}),Oz(p);break}case z.Light:{const{normal:d,rotation:f}=Cn.computeState(o,u),p=H.getState().actionState,g=Ga.makeLight(a,2,p.lightDistance,p.lightIntensity,p.lightColor,c.x/l.lx,c.y/l.ly,c.z,d,f??[0,0,1]);H.getState().set(y=>{y.elements.push(g),y.selectedElementIdSet.clear(),y.selectedElementIdSet.add(g.id),y.actionModeLock||(y.objectTypeToAdd=z.None)}),Oz(g);break}}},l$e=(t,e,n)=>{H.getState().isAddingElement()||H.getState().objectTypeToAdd!==z.None||t.intersections.length>0&&t.intersections[0].eventObject.name===t.eventObject.name&&(t.stopPropagation(),H.getState().set(o=>{if(o.contextMenuObjectType=null,o.groupActionMode)o.multiSelectionsMode||o.selectedElementIdSet.clear(),o.selectedElementIdSet.has(n)?o.selectedElementIdSet.delete(n):o.selectedElementIdSet.add(n);else for(const r of o.elements)r.id===e?(r.selected=!0,o.selectedElement=r,o.multiSelectionsMode?o.selectedElementIdSet.has(e)?o.selectedElementIdSet.delete(e):o.selectedElementIdSet.add(e):(o.selectedElementIdSet.clear(),o.selectedElementIdSet.add(e))):r.selected=!1}))},rN=(t,e,n)=>{const o={name:"Resize Roof Rise",timestamp:Date.now(),resizedElementId:t,resizedElementType:z.Roof,oldRise:e,newRise:n,undo:()=>{H.getState().updateRoofRiseById(o.resizedElementId,o.oldRise,0)},redo:()=>{H.getState().updateRoofRiseById(o.resizedElementId,o.newRise,0)}};H.getState().addUndoable(o)},s$e=(t,e)=>{const n={lng:H.getState().language};return Cn.rooftopElementBoundaryCheck(t,e)?!0:(H.getState().moveHandleType||H.getState().viewState.orthographic?po(Y.t("message.MoveOutsideBoundaryCancelled",n)):H.getState().resizeHandleType?po(Y.t("message.ResizingOutsideBoundaryCancelled",n)):H.getState().rotateHandleType&&po(Y.t("message.RotationOutsideBoundaryCancelled",n)),!1)},c$e=(t,e,n)=>{const o={lng:H.getState().language};return Cn.rooftopSPCollisionCheck(t,e,n)?!0:(H.getState().moveHandleType||H.getState().viewState.orthographic?po(Y.t("message.MoveCancelledBecauseOfOverlap",o)):H.getState().resizeHandleType?po(Y.t("message.ResizingCancelledBecauseOfOverlap",o)):H.getState().rotateHandleType&&po(Y.t("message.RotationCancelledBecauseOfOverlap",o)),!1)},CQ=(t,e,n,o,r,i,a)=>{t!==null&&H.getState().set(l=>{if(t!==null){for(const s of l.elements)if(s.parentId===e&&s.foundationId){if(s.type===z.SolarPanel){const u=new ie(s.cx,s.cy,s.cz).clone().sub(o),{segmentVertices:d,normal:f,rotation:p}=Cn.computeState(n,u,a);let g;d?g=Cn.getRooftopElementZ(d,u,r+i):g=r+i,f&&p&&g!==void 0&&(s.normal=f.toArray(),s.rotation=[...p],s.cz=g+t.lz/2)}else if(s.type===z.Window){const u=new ie(s.cx,s.cy,s.cz+t.lz).clone().sub(o),{segmentVertices:d,normal:f,rotation:p}=Cn.computeState(n,u,a);let g;d?g=Cn.getRooftopElementZ(d,u,r+i):g=r+i,f&&p&&g!==void 0&&(s.rotation=[...p],s.cz=g)}else if(s.type===z.Sensor||s.type===z.Light){const u=new ie(s.cx*t.lx,s.cy*t.ly,s.cz+t.lz).clone().sub(o),{segmentVertices:d,normal:f,rotation:p}=Cn.computeState(n,u,a);let g;d?g=Cn.getRooftopElementZ(d,u,r+i):g=r+i,f&&p&&g!==void 0&&(s.normal=f.toArray(),s.rotation=[...p],s.cz=g)}}}})},iN=(t,e,n,o,r)=>{t.button!==2&&(t.intersections[0].eventObject.name!==t.eventObject.name||(l$e(t,n,e),YQt(t,e,n,o,r)))},aN=(t,e)=>{const n=H.getState().selectedElement;if(!n||!Cn.isValidOnRoof(n))return;const o=H.getState().getElementById(n.id);if(o&&H.getState().moveHandleType&&Eu.getIntersectionObjects(t)[0].eventObject.userData.roofId===e.id&&o.foundationId){const a=H.getState().getElementById(o.foundationId);if(a)switch(o.type){case z.SolarPanel:{const l=o,s=Cn.getRoofBoundaryVertices(e),c=Cn.getSolarPanelVerticesOnRoof(l,a);!s$e(c,s)||!c$e(l,a,c)?Eu.undoInvalidOperation():Eu.addUndoableMove();break}case z.Sensor:Eu.addUndoableMove();break;case z.Light:Eu.addUndoableMove();break}}H.getState().set(r=>{r.moveHandleType=null})},lN=(t,e)=>{const n=H.getState().getSelectedElement();if(!(!n||!Cn.isValidOnRoof(n)))switch(n.type){case z.Sensor:case z.Light:case z.SolarPanel:{if(n.type===z.SolarPanel&&n.parentType===void 0)return;if(H.getState().moveHandleType){const o=Eu.getIntersectionObjects(t);o[0].eventObject.userData.roofId===e&&H.getState().set(i=>{for(const a of i.elements)if(a.id===n.id){const{roofId:l,foundation:s,centroid:c,roofSegments:u}=o[0].eventObject.userData;if(s&&c&&u&&l){const d=o[0].point,f=new ie().subVectors(d,new ie(s.cx,s.cy)).applyEuler(new nn(0,0,-s.rotation[2])),p=f.clone().sub(c),{normal:g,rotation:y}=Cn.computeState(u,p);a.cx=f.x/s.lx,a.cy=f.y/s.ly,a.cz=f.z-s.lz,a.rotation=[...y],a.normal=g.toArray(),a.parentId=l,a.foundationId=s.id,a.type===z.SolarPanel&&(a.parentType=z.Roof,a.color="#fff"),i.selectedElement&&(i.selectedElement.parentId=l,i.selectedElement.foundationId=s.id),ht.getState().setPrimitiveStore("showWallIntersectionPlaneId",null)}break}})}}}},TR=(t,e)=>{t.intersections.length>0&&t.intersections[0].eventObject.name===t.eventObject.name&&(t.stopPropagation(),H.getState().set(n=>{n.contextMenuObjectType=z.Roof,n.pastePoint.copy(t.intersections[0].point);for(const o of n.elements)if(o.id===e)if(o.selected=!0,n.selectedElement=o,n.selectedElementIdSet.has(e))for(const r of n.elements)n.selectedElementIdSet.has(r.id)&&r.type!==n.selectedElement.type&&n.selectedElementIdSet.delete(r.id);else if(n.multiSelectionsMode){n.selectedElementIdSet.add(e);for(const r of n.elements)n.selectedElementIdSet.has(r.id)&&r.type!==n.selectedElement.type&&n.selectedElementIdSet.delete(r.id)}else n.selectedElementIdSet.clear(),n.selectedElementIdSet.add(e);else o.selected=!1}))},oh=({position:t,onPointerDown:e,onPointerUp:n,onPointerOver:o})=>{const r=H(fn),i=a5(),{gl:a}=oi(),l=m.useRef(!1),s=m.useRef(!1),c=m.useRef(!1),u=m.useRef(null),[d,f]=m.useState("white"),p=y=>{y?(f(ta),a.domElement.style.cursor="pointer"):(f("white"),a.domElement.style.cursor="default")};m.useEffect(()=>{const y=()=>{s.current&&(c.current=!0),!s.current&&l.current&&p(!1),l.current=!1};return window.addEventListener("pointerup",y),()=>{window.removeEventListener("pointerup",y)}},[]);const g=y=>{if(y.intersections.length>0){for(const{eventObject:w}of y.intersections)if(w.name==="Roof Handle")return w===u.current}return!1};return h.jsx(ds,{name:"Roof Handle",ref:u,args:[i],position:t,onPointerMove:y=>{g(y)?(c.current=!1,s.current||(s.current=!0,p(!0))):f("white")},onPointerOut:y=>{c.current||(l.current||(y.intersections.length>0&&y.intersections[0].eventObject.name==="Roof Handle"?f("white"):p(!1)),s.current=!1,r(w=>{w.hoveredHandle=null}))},onPointerDown:y=>{g(y)&&(e&&e(y),l.current=!0)},onPointerUp:y=>{g(y)&&n&&n(y)},onPointerOver:y=>{g(y)&&o&&o(y)},onPointerLeave:y=>{g(y)&&r(w=>{w.hoveredHandle=null})},children:h.jsx("meshBasicMaterial",{attach:"material",color:d})})},OQt=({roofModel:t,foundationModel:e})=>{const n=H(yp),{id:o,wallsId:r,roofType:i}=t;return m.useEffect(()=>{r.length===0&&n(o,!1)},[r]),(()=>{switch(i){case Go.Pyramid:return h.jsx(_xt,{roofModel:t,foundationModel:e});case Go.Gable:return h.jsx(tbt,{roofModel:t,foundationModel:e});case Go.Hip:return h.jsx(ibt,{roofModel:t,foundationModel:e});case Go.Gambrel:return h.jsx(Kxt,{roofModel:t,foundationModel:e});case Go.Mansard:return h.jsx(cbt,{roofModel:t,foundationModel:e});default:return null}})()};function qH(t,e){return t.roofModel===e.roofModel&&t.foundationModel.lx===e.foundationModel.lx&&t.foundationModel.ly===e.foundationModel.ly&&t.foundationModel.lz===e.foundationModel.lz}const _Qt=be.memo(OQt,qH),$H=t=>{const e=m.useMemo(()=>{let i;switch(t){case Ur.NoTexture:i=ig;break;case Ur.Texture01:i=vxt;break;case Ur.Texture02:i=xxt;break;case Ur.Texture03:i=bxt;break;case Ur.Texture04:i=Sxt;break;case Ur.Texture05:i=Txt;break;case Ur.Texture06:i=Pxt;break;case Ur.Texture07:i=Cxt;break;default:i=wxt}return new df().load(i,a=>{switch(a.wrapS=a.wrapT=Hs,t){case Ur.NoTexture:case Ur.Default:a.repeat.set(5,3);break;case Ur.Texture01:a.repeat.set(.5,.25);break;case Ur.Texture03:a.repeat.set(.9,.9);break;case Ur.Texture04:case Ur.Texture05:case Ur.Texture06:a.repeat.set(.75,.75);break;default:a.repeat.set(.5,.5)}o(a),r()})},[t]),[n,o]=m.useState(e),{invalidate:r}=oi();return n},QH=(t,e)=>{const n=H(hA),o=H(Id);return{transparent:t||n&&o,opacity:Math.min(e!==void 0?e:1,n&&o||t?.25:1)}},u$e=(t,e,n)=>{const o=H(l=>l.elements.filter(s=>s.foundationId===t&&s.type===z.Wall),cy),r=l=>o.find(s=>s.id===l),i=m.useRef(!1);return{currentWallArray:m.useMemo(()=>{for(const l of n){let s=r(l);if(!s)return[];const c=[],u=s;let d=0;for(;s&&(!s.roofId||s.roofId===e)&&d++<100&&(c.push(s),s.leftJoints[0]);)if(s.leftJoints[0]!==u.id)s=r(s.leftJoints[0]);else return c.reverse(),i.current=!0,c;for(c.reverse(),s=r(u.rightJoints[0]),d=0;s&&(!s.roofId||s.roofId===e)&&d++<100&&(c.push(s),s.rightJoints[0]&&s.rightJoints[0]!==u.id);)s=r(s.rightJoints[0]);if(i.current=!1,c.length>1)return c}return[]},[n,o]),isLoopRef:i}},Eye=(t,e)=>{const n=H(r=>r.elements.filter(i=>i.foundationId===e&&i.type===z.Wall),cy);return m.useMemo(()=>{var f;const r=p=>n.find(g=>g.id===p),i=new Map,a=new Map,l=r(t);let s=l,c=0,u=!1;for(;s&&s.type===z.Wall&&c<100;){i.set(s.id,s);const p=s.relativeAngle.toFixed(1);if(a.has(p)?(f=a.get(p))==null||f.push(s):a.set(p,[s]),s.rightJoints.length!==0){if(s=r(s.rightJoints[0]),s&&s.id===l.id){u=!0;break}c++}else s=null}if(!u||a.size!==4)return null;const d=[];for(const[p,g]of a){let y=0;for(const v of g){const T=i.get(v.leftJoints[0]),A=i.get(v.rightJoints[0]);if(T&&T.relativeAngle.toFixed(1)!==p&&y++,A&&A.relativeAngle.toFixed(1)!==p&&y++,y>2)break}if(y!==2)return null;let w=null,b=null,C=0,P=-1;for(const v of g){const T=i.get(v.leftJoints[0]),A=i.get(v.rightJoints[0]);C=Math.max(C,v.lz),P=Math.max(P,v.eavesLength),T&&T.relativeAngle.toFixed(1)!==p&&(w=v),A&&A.relativeAngle.toFixed(1)!==p&&(b=v)}w&&b&&C>0&&P!==-1&&d.push({leftPoint:new ie().fromArray(w.leftPoint),rightPoint:new ie().fromArray(b.rightPoint),relativeAngle:w.relativeAngle,lz:C,eavesLength:P,wallsId:g.map(v=>v.id)})}return d.length!==4?null:d},[n])},Fye=(t,e,n)=>{const o=m.useMemo(()=>Cn.getHighestComposedWallHeight(t,n),[t]),r=m.useMemo(()=>o+e,[o,e]);return{highestWallHeight:o,topZ:r}},d$e=(t,e,n)=>{const o=m.useMemo(()=>Cn.getHighestWallHeight(t,n),[t]),[r,i]=m.useState(e),a=o+r;return m.useEffect(()=>{e!==r&&i(e)},[e]),{highestWallHeight:o,topZ:a,riseInnerState:r,setRiseInnerState:i}},sN=(t,e,n,o,r,i)=>{const a=ht(pW),l=ht(zge),s=ht(hW),c=()=>{const u=f=>f.clone().add(e),d=[];if(o)if(r===Go.Gambrel)d.push(Wye(n).map(u));else{const f=[];for(const p of n)f.push(p.points[1].clone().add(e));d.push(f)}else{for(const f of n){const p=f.points;if(p.length===6)d.push(p.slice(3).map(u));else if(p.length===8)d.push(p.slice(4).map(u));else throw new Error("Invalid Roof segment data")}i&&d.push(i)}return Tn.getState().setRoofSegmentVertices(t,d),d};return(a||l||s)&&c(),m.useEffect(()=>{c()},[n]),c},cN=t=>{const e=ht(hW),n=ht(Yq);(e||n)&&t()},uN=(t,e)=>{const n=H(zH);m.useEffect(()=>{t.rise===void 0&&H.getState().set(o=>{for(const r of o.elements)if(r.id===t.id&&r.type===z.Roof){const i=r;i.rise===void 0&&(i.rise=i.lz-e,i.lz=0);break}})},[n])},VQt=()=>{const[,t]=m.useState(!1);m.useEffect(()=>{t(e=>!e)},[])},RQ=()=>{const t=m.useRef(!0);return t.current?(t.current=!1,!0):!1},kye=(t,e,n,o,r,i,a)=>{const l=H(s=>s.updateElementOnRoofFlag);m.useEffect(()=>{l&&(CQ(t,e,n,o,r,i,a),H.getState().setUpdateElementOnRoofFlag(!1))},[r,i,l])},GQt=(t,e,n,o,r,i,a)=>{const l=RQ();m.useEffect(()=>{l||CQ(t,e,n,o,r,i,a)},[n])},Lye=(t,e,n,o,r,i,a)=>{GQt(t,e,n,o,r,i,a),kye(t,e,n,o,r,i,a)},dN=(t,e,n,o)=>{const r=a$e(e);return m.useMemo(()=>({roofId:t,foundation:r,centroid:n,roofSegments:o}),[t,n,o,r])},TSe=(t,e)=>{const[n,o,r,i]=e;t.moveTo(n.points[0].x,n.points[0].y),t.lineTo(n.points[1].x,n.points[1].y),t.lineTo(i.points[0].x,i.points[0].y),t.lineTo(i.points[1].x,i.points[1].y),t.closePath()},Wye=(t,e)=>{const n=[],[o,r,i,a]=t;return n.push(o.points[0].clone()),n.push(o.points[1].clone()),n.push(a.points[0].clone()),n.push(a.points[1].clone()),e?(e.push(...n),e):n},iX=({uuid:t,shape:e,thickness:n,holeMeshes:o,simulation:r,castShadow:i,receiveShadow:a,children:l})=>{const s=m.useRef(null);if(s.current&&(s.current.geometry=new W9(e,{steps:1,depth:n,bevelEnabled:!1}),s.current.updateMatrix(),o.length>0)){const c=[];for(let d=0;d{const f=H.getState().world,p=H(Ds),g=ht(Ss),y=ht(h3),w=H(e5),b=H(i3),C=H(a3),P=Tn(dW),v=Tn.getState().hourlyHeatExchangeArrayMap,T=m.useRef(0),A=m.useRef(),x=m.useRef(),{transparent:S,opacity:R}=QH(),M=H(_=>_.elements.filter(X=>X.type===z.Window&&X.parentId===t),cy),D=m.useMemo(()=>{if(!y||e&&e.notBuilding)return;const _=v.get(t);if(!_)return;const X=_.reduce((ve,Ae)=>ve+Ae,0),$=P(t);if(!$||!$[0])return;const Q=[],le=$[0].map(ve=>ve.clone().sub(r)),q=r3*(f.solarRadiationHeatmapGridCellSize??.5),te=le[0].clone(),re=le[1].clone(),ae=le[2].clone(),se=new ie().subVectors(re,te),ne=new ie().subVectors(ae,te),fe=new ie().subVectors(ae,re),ge=se.length(),de=new ie().crossVectors(ne,fe).length()/ge,Z=Math.max(2,Math.floor(ge/q)),he=Math.max(2,Math.floor(de/q));se.normalize(),ne.normalize(),fe.normalize();const xe=new ie().crossVectors(ne,fe).normalize(),He=se.multiplyScalar(.5*ge/Z),Se=new ie().crossVectors(xe,se).normalize().multiplyScalar(.5*de/he),ze=te.clone().add(He).add(Se).add(new ie(0,0,i));He.multiplyScalar(2),Se.multiplyScalar(2),A.current=xe.clone().multiplyScalar(.1);const Ie=new ie,ye=new Array;for(const ve of le)ye.push({x:ve.x,y:ve.y});const ce=me.getPolygonArea(ye);if(ce===0)return;const pe=X/ce*(w??Qm);T.current=pe<0?1:0,x.current=new nn(-Math.sign(pe)*Gt,0,0);for(let ve=0;ve{if(o.length===0)return[new ie];const _=[];if(n===Go.Gambrel){Wye(o,_);const X=_.reduce(($,Q)=>Math.max($,Q.z),0);_.forEach($=>$.setZ(X))}else{_.push(o[0].points[0]);for(const X of o){const $=X.points[1];_.push($)}}return _},[o,n]),W=m.useMemo(()=>new ie(0,0,i),[i]),j=h.jsx(jn,{points:E,lineWidth:l,color:a}),L=$H(u),k=m.useMemo(()=>{const _=new Fl;if(o.length===0)return _;if(n===Go.Gambrel)TSe(_,o);else{const X=o[0].points[0];_.moveTo(X.x,X.y);for(const $ of o){const Q=$.points[1];_.lineTo(Q.x,Q.y)}_.closePath()}return _},[o,r,n]),N=m.useMemo(()=>{const _=new Fl;if(o.length===0)return _;if(n===Go.Gambrel)TSe(_,o);else{const X=o[0].points[0];_.moveTo(X.x,X.y);for(const $ of o){const Q=$.points[1];_.lineTo(Q.x,Q.y)}_.closePath()}if(M.length>0)for(const X of M){const $=new ie(X.cx,X.cy,X.cz).sub(r);switch(X.windowType){case Ti.Polygonal:{const[Q,le]=X.polygonTop??Gp,[q,te,re]=[X.lx/2,X.lz/2,Q*X.lx],ae=wG(q,te,re,le,$.x,$.y);_.holes.push(ae);break}case Ti.Arched:{const Q=AG(X.lx,X.lz,X.archHeight,$.x,$.y);_.holes.push(Q);break}default:{const Q=new Fl,[le,q]=[X.lx/2,X.lz/2];Q.moveTo($.x-le,$.y-q),Q.lineTo($.x+le,$.y-q),Q.lineTo($.x+le,$.y+q),Q.lineTo($.x-le,$.y+q),Q.closePath(),_.holes.push(Q)}}}return _},[o,r,M,n]),F=m.useMemo(()=>M.map(_=>{const[X,$,Q]=_.rotation,le=new ie(_.cx,_.cy,_.cz).sub(r),q=new nn().fromArray([_.rotation[0],_.rotation[1],_.rotation[2],"ZXY"]);switch(_.windowType){case Ti.Polygonal:{const[te,re]=_.polygonTop??Gp,[ae,se,ne]=[_.lx/2,_.lz/2,te*_.lx],fe=wG(ae,se,ne,re),ge=new is(new W9([fe],{steps:1,depth:_.ly,bevelEnabled:!1})),de=new ie(0,0,-_.ly).applyEuler(q);return ge.position.copy(le.clone().add(de)),ge.rotation.copy(q),ge.updateMatrix(),ge}case Ti.Arched:{const te=AG(_.lx,_.lz,_.archHeight),re=new is(new W9([te],{steps:1,depth:_.ly,bevelEnabled:!1})),ae=new ie(0,0,-_.ly).applyEuler(q);return re.position.copy(le.clone().add(ae)),re.rotation.copy(q),re.updateMatrix(),re}default:{const te=new is(new t3(_.lx,_.lz,_.ly*2));return te.position.copy(le),te.rotation.set(X,$,Q),te.updateMatrix(),te}}}),[M,i]),U=u===Ur.NoTexture&&c&&c===s,O=p&&!S,B=g&&d;return h.jsxs(h.Fragment,{children:[U&&!B?h.jsx(iX,{uuid:t,simulation:!0,shape:k,holeMeshes:F,thickness:i,castShadow:O,receiveShadow:p,children:h.jsx("meshStandardMaterial",{color:c,transparent:S,opacity:R})}):h.jsxs(h.Fragment,{children:[h.jsxs("mesh",{uuid:t,userData:{simulation:!0},name:"Flat roof top shape",position:[0,0,i+.001],receiveShadow:p,children:[h.jsx("shapeGeometry",{args:[N]}),B?h.jsx("meshBasicMaterial",{map:d,side:Ra}):h.jsx("meshStandardMaterial",{map:L,color:c,transparent:S,opacity:R,side:Ra})]}),h.jsx(iX,{shape:k,holeMeshes:F,thickness:i,castShadow:O,receiveShadow:p,children:h.jsx("meshStandardMaterial",{color:s??"white",transparent:S,opacity:R})})]}),j,h.jsxs("group",{position:[0,0,i],children:[j,E.map((_,X)=>{const $=[_.clone().sub(W),_];return h.jsx(jn,{points:$,lineWidth:l,color:a},X)})]}),D&&D.map((_,X)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:_,name:"Heat Flux "+X,lineWidth:C??Zm,color:b??g0}),";",h.jsx(Rd,{userData:{unintersectable:!0},position:A.current?_[T.current].clone().add(A.current):_[0],args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:x.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:b??g0})})]},X))]})},f$e="/aladdin/assets/foundation_01--kFbnI98.png",h$e="/aladdin/assets/foundation_02-wZzxF61c.png",p$e="/aladdin/assets/foundation_03-CrR6CCyr.png",g$e="/aladdin/assets/foundation_04-k0ozbTjk.png",m$e="/aladdin/assets/foundation_05-Bwrj98Mu.png",y$e="/aladdin/assets/foundation_06-BOa0J0il.png",A$e="/aladdin/assets/foundation_07-C9gRAfER.png",fN="/aladdin/assets/helvetiker_regular.typeface-B9JafPRX.fnt",Nye=be.memo(({element:t,height:e})=>{const n=H(Zq),o=H(ly),r=H(f7t),i=H(qr),a=H(hA),[l,s]=m.useState(),[c,u]=m.useState(10),[d,f]=m.useState(0);m.useEffect(()=>{if(n||o){const{cx:P,cy:v,lx:T,ly:A,type:x}=t;switch(x){case z.SolarPanel:{const S=i(t);if(S){const R=P*S.lx,M=v*S.ly;s(new ie(R,M,e??S.lz))}break}case z.Foundation:{s(new ie(P,v,a?.1:0));break}case z.Cuboid:{const{pos:S}=me.getWorldDataById(t.id),{rot:R}=me.getWorldDataById(t.parentId);s(new ie(S.x,S.y,S.z-t.lz/2+.2)),f(R);break}default:{s(new ie(P,v,a?.2:0));break}}u(Math.max(5,Math.hypot(T,A)*.75))}},[t,n,o,a,e]);const p=o3(lW,fN),g=c*.05,y={font:p,height:0,size:g},w=new Array(25).fill(0),b=P=>P===0?-g*.3:P>0&&P<7?-g*.8:-g*1.2,C=a?"#222":"#ccc";return h.jsx(h.Fragment,{children:l&&h.jsxs("group",{position:l,rotation:[Gt,d,0],name:"Polar Auxiliary",children:[h.jsx("polarGridHelper",{args:[c,24,6,120,C,C],userData:{unintersectable:!0}}),h.jsx(sR,{args:[c*.98,c,24,1,Gt,r],userData:{unintersectable:!0},rotation:[-Gt,0,0],children:h.jsx("meshBasicMaterial",{side:$r,color:"yellow"})}),h.jsx("group",{rotation:[0,r,0],children:h.jsx("mesh",{position:[-.5,0,-c*.9],rotation:[-Gt,0,0],userData:{unintersectable:!0},children:h.jsx("textGeometry",{args:[`${-me.toDegrees(r).toFixed(1)}°`,y]})})}),w.map((P,v)=>{let T=Math.ceil(v/2)*(v%2===0?1:-1);T===-12&&(T=12);const A=b(Math.abs(T));return h.jsx("group",{rotation:[0,T*Math.PI/12,0],children:h.jsxs("mesh",{position:[A,0,-c*1.05],rotation:[-Gt,0,0],userData:{unintersectable:!0},children:[h.jsx("textGeometry",{args:[`${-15*T}°`,y]}),h.jsx("meshStandardMaterial",{attach:"material",color:"lightGray"})]})},v)})]})})}),PR=be.memo(({id:t,position:e,ratio:n,handleType:o,hoverHandle:r,noHoverHandle:i})=>{const a=H(Y0),l=H(Zq),c=H(ly)===o||l===o?ta:Da,u=h.jsx("meshBasicMaterial",{color:c});return h.jsxs("group",{position:e,rotation:[Gt,0,0],scale:n,name:o,children:[h.jsxs("group",{children:[h.jsx(mge,{args:[.15,.05,6,8,3/2*Math.PI],rotation:[Gt,0,Gt],children:u}),h.jsx(Rd,{args:[.1,.1,6],rotation:[Gt,0,0],position:[.15,0,.05],children:u}),h.jsx(lR,{args:[.05,6],rotation:[0,Gt,0],position:[0,0,.15],children:u})]}),h.jsx(ua,{name:o,args:[.35,.35],position:[0,.05,0],rotation:[-Gt,0,0],visible:!1,onPointerDown:d=>{a(t,d,Oo.Rotate)},onPointerOver:d=>{r(d,o)},onPointerOut:i})]})}),fw=be.memo(({hx:t,hy:e,hz:n,lineColor:o="black",lineWidth:r=.2})=>h.jsx(jn,{points:[[-t,-e,-n],[t,-e,-n],[t,-e,n],[t,-e,-n],[t,e,-n],[t,e,n],[t,e,-n],[-t,e,-n],[-t,e,n],[-t,e,-n],[-t,-e,-n],[-t,-e,n],[t,-e,n],[t,e,n],[-t,e,n],[-t,-e,n]],name:"Wireframe",userData:{unintersectable:!0},lineWidth:r,color:o}));var Xr=(t=>(t.left="Left",t.right="Right",t.loop="Loop",t.null="Null",t))(Xr||{});const Uye=be.memo(({element:t,verticalLift:e})=>{const n=H(s0),o=H(Id),r=H(d1),i=H(ly),a=t.lx/2,l=t.ly/2,s=.2,c=1,u=.5,d=t.lineColor??"white",f="darkorchid",p=Math.max(1,(a+l)/32),g=m.useMemo(()=>({lng:n}),[n]),y=m.useMemo(()=>{switch(t.type){case z.Cuboid:return Math.max(.5,Math.max(a,l)*.1)}return .5},[t.type,a,l]),w=m.useMemo(()=>{switch(t.type){case z.Cuboid:return o?t.lz/2+.1:-t.lz/2+.1;case z.Foundation:return t.lz+.1}return .1},[o,t.type,t.lz]),b=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:f,text:t.ly.toFixed(1)+Y.t("word.MeterAbbreviation",g),fontSize:80,fontFace:"Times Roman",textHeight:p,position:[-a-y,0,w+e]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a-y,-l,w],[-a-y,l,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a-y+s,-l+3*s,w],[-a-y,-l,w],[-a-y-s,-l+3*s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a-y+s,l-3*s,w],[-a-y,l,w],[-a-y-s,l-3*s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a,-l,w],[-a-y*2,-l,w]],color:d,linewidth:u}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a,l,w],[-a-y*2,l,w]],color:d,linewidth:u})]}),[a,l,w,g,d,e]),C=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:f,text:t.ly.toFixed(1)+Y.t("word.MeterAbbreviation",g),fontSize:80,fontFace:"Times Roman",textHeight:p,position:[a+y,0,w+e]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a+y,-l,w],[a+y,l,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a+y+s,-l+3*s,w],[a+y,-l,w],[a+y-s,-l+3*s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a+y+s,l-3*s,w],[a+y,l,w],[a+y-s,l-3*s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a,-l,w],[a+y*2,-l,w]],color:d,linewidth:u}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a,l,w],[a+y*2,l,w]],color:d,linewidth:u})]}),[a,l,w,g,d,e]),P=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:f,text:t.lx.toFixed(1)+Y.t("word.MeterAbbreviation",g),fontSize:80,fontFace:"Times Roman",textHeight:p,position:[0,-l-y,w+e]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a,-l-y,w],[a,-l-y,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a+3*s,-l-y-s,w],[-a,-l-y,w],[-a+3*s,-l-y+s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a-3*s,-l-y-s,w],[a,-l-y,w],[a-3*s,-l-y+s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a,-l,w],[-a,-l-y*2,w]],color:d,linewidth:u}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a,-l,w],[a,-l-y*2,w]],color:d,linewidth:u})]}),[a,l,w,g,d,e]),v=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:f,text:t.lx.toFixed(1)+Y.t("word.MeterAbbreviation",g),fontSize:80,fontFace:"Times Roman",textHeight:p,position:[0,l+y,w+e]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a,l+y,w],[a,l+y,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a+3*s,l+y-s,w],[-a,l+y,w],[-a+3*s,l+y+s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a-3*s,l+y-s,w],[a,l+y,w],[a-3*s,l+y+s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a,l,w],[-a,l+y*2,w]],color:d,linewidth:u}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a,l,w],[a,l+y*2,w]],color:d,linewidth:u})]}),[a,l,w,g,d,e]);if(r)if(t.type===z.Wall)switch(r){case vt.LowerLeft:return P;case vt.LowerRight:return P}else switch(r){case vt.LowerLeft:return h.jsxs(h.Fragment,{children:[b,P]});case vt.LowerRight:return h.jsxs(h.Fragment,{children:[C,P]});case vt.UpperLeft:return h.jsxs(h.Fragment,{children:[b,v]});case vt.UpperRight:return h.jsxs(h.Fragment,{children:[C,v]})}if(i)if(t.type===z.Wall)switch(i){case vt.LowerLeft:return P;case vt.LowerRight:return P}else switch(i){case vt.LowerLeft:return h.jsxs(h.Fragment,{children:[b,P]});case vt.LowerRight:return h.jsxs(h.Fragment,{children:[C,P]});case vt.UpperLeft:return h.jsxs(h.Fragment,{children:[b,v]});case vt.UpperRight:return h.jsxs(h.Fragment,{children:[C,v]})}return h.jsx(h.Fragment,{})}),XQt=1.361,PSe=9.8067,CSe=1012,fO=1.225,C4=273.15,RSe=567e-10,JQt=[.103,.104,.109,.12,.13,.137,.138,.134,.121,.111,.106,.103];var yi=(t=>(t[t.NONE=0]="NONE",t[t.KASTEN_YOUNG=1]="KASTEN_YOUNG",t[t.SPHERE_MODEL=2]="SPHERE_MODEL",t))(yi||{});const T2=1440,rde=Math.PI/720,Xie=Math.PI/182.5,HSe=30,KQt=120;class MSe{constructor(e,n){this.sunrise=e,this.sunset=n}daylight(){return this.sunset-this.sunrise}}const l6=.5,L0=.1,lP=23.45/180*Math.PI,qQt=1e3*60*60*24,DC=720,hN=t=>{const e=Math.floor((t.getTime()-new Date(t.getFullYear(),0,0).getTime())/qQt);return lP*Math.sin(la*(284+e)/365.25)},dl=(t,e)=>{const n=Math.tan(me.toRadians(e))*Math.tan(hN(t));if(Math.abs(n)>1)return new MSe(0,n>0?DC*2:0);const o=60*Math.acos(-n)/me.toRadians(15);return new MSe(DC-o,DC+o)},jye=t=>(t.getHours()*60+t.getMinutes()-DC)/DC*Math.PI,hO=t=>(t/DC-1)*Math.PI,Ei=(t,e)=>a9(1,jye(t),hN(t),me.toRadians(e)).normalize(),a9=(t,e,n,o)=>{const r=Math.cos(n),i=Math.sin(n),a=Math.cos(o),l=Math.sin(o),s=Math.cos(e),c=Math.sin(e),u=Math.asin(i*l+r*s*a),d=c*r,f=a*i-s*r*l,p=Math.atan2(f,d),g=new ie(t,p,u);return me.sphericalToCartesianZ(g),g.x=-g.x,g},$Qt=t=>{const e=la*t/365,n=1.00011+.034221*Math.cos(e)+.00128*Math.sin(e)+719e-6*Math.cos(2*e)+77e-6*Math.sin(2*e);return XQt*n},QQt=(t,e,n)=>{let o;switch(t){case yi.NONE:return 1;case yi.KASTEN_YOUNG:return o=e.angleTo(Io),1/(Math.cos(o)+.50572*Math.pow(96.07995-o/Math.PI*180,-1.6364));default:{o=e.angleTo(Io);const r=Math.cos(o),i=708,a=n/9e3;return Math.sqrt((i+a)*(i+a)*r*r+(2*i+1+a)*(1-a))-(i+a)*r}}},Ri=(t,e,n,o)=>$Qt(e)*Math.pow(.7,Math.pow(QQt(o,t,n),.678)),ni=(t,e,n,o)=>{let r=0;const i=n.dot(Io),a=.5*(1+i);a>0&&(r+=JQt[e]*a*o);const l=.5*Math.abs(1-i);return me.isZero(l)||(r+=t.albedo*l*o),r},ZQt=be.memo(({foundation:t})=>{const e=H(rl),n=H(Tc),o=ht(QBe),r=ht(Rf),i=ht(Uge),a=ht(Ss),l=H(Cf),s=Tn(u1),[c,u]=m.useState(null),d=m.useRef(null),{lx:f,ly:p,lz:g,solarUpdraftTower:y}=t,w=((y==null?void 0:y.collectorRadius)??100)*.016,b=m.useMemo(()=>Ei(new Date(e),n),[e,n]),C=m.useMemo(()=>{const v=[],T=(((y==null?void 0:y.collectorHeight)??Math.max(3,10*g))+g)/2,A=(y==null?void 0:y.chimneyHeight)??Math.max(f,p),x=(y==null?void 0:y.collectorRadius)??Math.min(f,p)/2,S=(y==null?void 0:y.chimneyRadius)??Math.max(1,.025*Math.min(f,p)),R=x*1.15,M=S*.5,D=S,E=S*2,W=S*4,j=6;for(let L=0;L{const v=[],T=((y==null?void 0:y.collectorHeight)??Math.max(3,10*g))+g,A=(y==null?void 0:y.collectorRadius)??Math.min(f,p)/2,x=25,S=2*A/x;for(let R=0;R<=x;R++){const M=[],D=-A+R*S,E=Math.sqrt(A*A-D*D);M.push(new ie(-E,D,T)),M.push(new ie(E,D,T)),v.push({points:M})}for(let R=0;R<=x;R++){const M=[],D=-A+R*S,E=Math.sqrt(A*A-D*D);M.push(new ie(D,-E,T)),M.push(new ie(D,E,T)),v.push({points:M})}return v},[f,p,g,y==null?void 0:y.collectorRadius,y==null?void 0:y.collectorHeight]);return m.useEffect(()=>{if(t&&a){const v=s(t.id+"-sut");v&&u(me.fetchHeatmapTexture(v,l??5))}},[a,l]),ay((v,T)=>{(o||r&&!i)&&b.z>0&&d.current&&d.current.children.forEach(A=>{if(A.name==="Streamlines"){const x=A;x.material.uniforms.dashOffset.value-=T*w*10}})}),h.jsxs("group",{children:[h.jsx(ca,{userData:{unintersectable:!0,simulation:!0},name:"Chimney",castShadow:!0,receiveShadow:!1,args:[(y==null?void 0:y.chimneyRadius)??Math.max(1,.025*Math.min(f,p)),(y==null?void 0:y.chimneyRadius)??Math.max(1,.025*Math.min(f,p)),(y==null?void 0:y.chimneyHeight)??Math.max(f,p),16,2,!0],position:[0,0,((y==null?void 0:y.chimneyHeight)??Math.max(f,p))/2+g],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white",side:$r})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Chimney Base",castShadow:!0,receiveShadow:!1,args:[(y==null?void 0:y.chimneyRadius)??Math.max(1,.025*Math.min(f,p)),((y==null?void 0:y.chimneyRadius)??Math.max(1,.025*Math.min(f,p)))*1.6,((y==null?void 0:y.collectorHeight)??Math.max(3,10*g))*4,16,2,!0],position:[0,0,((y==null?void 0:y.collectorHeight)??Math.max(3,10*g))*2+g],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white",side:$r})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Greenhouse Wall",castShadow:!0,receiveShadow:!0,args:[(y==null?void 0:y.collectorRadius)??Math.min(f,p)/2,(y==null?void 0:y.collectorRadius)??Math.min(f,p)/2,(y==null?void 0:y.collectorHeight)??Math.max(3,10*g),50,2,!0],position:[0,0,((y==null?void 0:y.collectorHeight)??Math.max(3,10*g))/2+g],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white",side:$r})}),h.jsx(lR,{uuid:t.id+"-sut",userData:{unintersectable:!0,simulation:!0},name:"Greenhouse Ceiling",castShadow:!1,receiveShadow:!1,args:[(y==null?void 0:y.collectorRadius)??Math.min(f,p)/2,50,0,la],position:[0,0,g+((y==null?void 0:y.collectorHeight)??Math.max(3,10*g))],children:a&&c?h.jsx("meshBasicMaterial",{attach:"material",side:Ra,map:c}):h.jsx("meshPhongMaterial",{attach:"material",specular:new rr("white"),shininess:50,side:Ra,color:"lightskyblue",transparent:!0,opacity:.75})}),h.jsx(lR,{userData:{unintersectable:!0},name:"Greenhouse Ground",castShadow:!1,receiveShadow:!0,args:[(y==null?void 0:y.collectorRadius)??Math.min(f,p)/2,50,0,la],position:[0,0,.1],children:h.jsx("meshStandardMaterial",{attach:"material",color:"dimgray"})}),P&&P.map((v,T)=>h.jsx(jn,{name:"Greenhouse Roof Grid Lines",userData:{unintersectable:!0},points:v.points,castShadow:!1,receiveShadow:!1,lineWidth:.2,color:"gray"},T)),b.z>0&&C&&h.jsx("group",{ref:d,children:C.map((v,T)=>{const A=v.points[0].x+v.points[1].x,x=v.points[0].y+v.points[1].y,S=new nn(0,0,la*T/C.length+Gt),R=w,M=w;return h.jsxs(be.Fragment,{children:[h.jsx(jn,{name:"Streamlines",userData:{unintersectable:!0},points:v.points,castShadow:!1,receiveShadow:!1,lineWidth:.5,dashed:!0,dashSize:R,gapSize:M,color:"white"}),h.jsx(Rd,{userData:{unintersectable:!0},args:[w,w*4,4,2],name:"Streamline Inlet Arrow Head",position:[A*.1,x*.1,v.points[0].z],rotation:S,children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})}),h.jsx(Rd,{userData:{unintersectable:!0},args:[w,w*4,4,2],name:"Streamline Inlet Arrow Head",position:[A*.9,x*.9,v.points[0].z],rotation:S,children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})})]},T)})})]})}),Bye="/aladdin/assets/glow-CV5NAijT.png",eZt=be.memo(({foundation:t})=>{const e=H(rl),n=H(Tc),o=bb(Bye),r=m.useMemo(()=>Ei(new Date(e),n),[e,n]),{lz:i,solarPowerTower:a}=t,l=(a==null?void 0:a.towerRadius)??1,s=(a==null?void 0:a.towerHeight)??20,c=s/10,u=l*1.5,d=Math.max(c,u)*2.4;return h.jsxs("group",{children:[h.jsx(ca,{userData:{unintersectable:!0},name:"Focus Tower",castShadow:!0,receiveShadow:!1,args:[l,l,s,6,2],position:[0,0,s/2+i/2],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Center Receiver",castShadow:!0,receiveShadow:!1,args:[u,u,c,10,2],position:[0,0,s+i/2],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})}),r.z>0&&h.jsx("mesh",{position:[0,0,s+i/2],children:h.jsx("sprite",{scale:[d,d,d],children:h.jsx("spriteMaterial",{map:o,transparent:!1,color:16777215,blending:nR,depthWrite:!1})})})]})}),tZt=be.memo(({foundation:t})=>{const{ly:e,lz:n,solarAbsorberPipe:o}=t,r=(o==null?void 0:o.absorberHeight)??10,i=(o==null?void 0:o.apertureWidth)??.6,a=(o==null?void 0:o.relativeLength)??.9,l=(o==null?void 0:o.poleNumber)??5,s=m.useMemo(()=>{const c=[],u=a*e/(l+1);for(let d=1;d<=l;d++)c.push(new ie(0,d*u-a*e/2,r/2+n/2));return c},[e,n,l,r,a]);return h.jsxs("group",{children:[h.jsx(ca,{userData:{unintersectable:!0},name:"Receiver Vertical Pipe 1",castShadow:!1,receiveShadow:!1,args:[i/4,i/4,r,6,2],position:[0,-a*e/2,r/2+n/2],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Receiver Vertical Pipe 2",castShadow:!1,receiveShadow:!1,args:[i/4,i/4,r,6,2],position:[0,a*e/2,r/2+n/2],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Receiver Horizontal Pipe",castShadow:!1,receiveShadow:!1,args:[i/2,i/2,a*e+i/2,6,2,!1,3*Gt,Math.PI],position:[0,0,r+n/2-i/4],rotation:[0,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white",side:$r})}),s&&s.map((c,u)=>h.jsx(ca,{userData:{unintersectable:!0},name:"Solar Receiver Pole "+u,castShadow:!1,receiveShadow:!1,args:[i/8,i/8,r,4,2],position:c,rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})},u))]})});class vx{static selectMe(e,n,o,r){var i,a,l;if(o.intersections.length>0&&o.intersections.filter(c=>!c.eventObject.name.startsWith("Wall Intersection Plane"))[0].object===o.eventObject){for(const c of e.elements)c.id===n?(c.selected=!0,e.selectedElement=c,e.selectedElementHeight=c.lz):c.selected=!1;if(!e.selectedElement)return;if(r===Oo.ContextMenu)if(e.selectedElementIdSet.has(n))for(const c of e.elements)e.selectedElementIdSet.has(c.id)&&c.type!==e.selectedElement.type&&e.selectedElementIdSet.delete(c.id);else if(e.multiSelectionsMode){e.selectedElementIdSet.add(n);for(const c of e.elements)e.selectedElementIdSet.has(c.id)&&c.type!==e.selectedElement.type&&e.selectedElementIdSet.delete(c.id)}else e.selectedElementIdSet.clear(),e.selectedElementIdSet.add(n);else e.multiSelectionsMode?e.selectedElementIdSet.has(n)?e.selectedElementIdSet.delete(n):e.selectedElementIdSet.add(n):(e.selectedElementIdSet.clear(),e.selectedElementIdSet.add(n));if(e.moveHandleType=null,e.resizeHandleType=null,e.rotateHandleType=null,r)switch(r){case Oo.Move:((i=e.selectedElement)==null?void 0:i.type)===z.Tree||((a=e.selectedElement)==null?void 0:a.type)===z.Human?e.moveHandleType=Ho.Default:e.moveHandleType=o.eventObject.name;break;case Oo.Resize:e.resizeHandleType=o.eventObject.name;break;case Oo.Rotate:e.rotateHandleType=o.eventObject.name;break;case Oo.Select:e.selectedElementAngle=((l=o.object.parent)==null?void 0:l.rotation.z)??0;break}}}static selectNone(e){e.selectedElementIdSet.clear();for(const n of e.elements)n.selected=!1;e.selectedElement=null,e.selectedElementIdSet.clear()}static clearThenAddSelectedElementIdSet(e,n){e.selectedElementIdSet.clear(),e.selectedElementIdSet.add(n)}}var aX={exports:{}};/** +`}const o=new Blob([n],{type:"text/csv;charset=utf-8"});r$e.saveAs(o,e)},zl=new ie,i9=new ie,nde=new ie,ode=new ie,Hu=new nn,lf=new bs,Eye="/aladdin/assets/wall_edge-B4PmTeCj.png",IQt="/aladdin/assets/wall_01-B-g_tqAI.png",zQt="/aladdin/assets/wall_02-9M_qG3R_.png",DQt="/aladdin/assets/wall_03-ChpvVFgd.png",EQt="/aladdin/assets/wall_04-BkmmH41c.png",FQt="/aladdin/assets/wall_05-DFi74_0h.png",kQt="/aladdin/assets/wall_06-CtX-9FCz.png",LQt="/aladdin/assets/wall_07-CJgSaJ5B.png",WQt="/aladdin/assets/wall_08-DwhD-VRH.png",NQt="/aladdin/assets/wall_09-D3ncCSYQ.png",UQt="/aladdin/assets/wall_10-RK6QVYt5.png",jQt=(t,e,n,o)=>{const r=c=>c.parentId===t||c.id===o,i=H(c=>{if(e){for(const u of c.elements)if(u.id===e)return u}return null}),a=H(c=>{if(n){for(const u of c.elements)if(u.id===n)return u}return null}),l=H(c=>JSON.stringify(c.elements.filter(r)));return{elementsOnWall:m.useMemo(()=>H.getState().elements.filter(c=>r(c)&&me.isLegalOnWall(c.type)),[l]),leftWall:i,rightWall:a}},a5=(t=.3)=>{const e=H(i=>i.viewState.orthographic),n=H(i=>i.viewState.cameraPosition),o=H(i=>i.viewState.cameraZoom);let r;if(e)r=Math.max(t,15/o);else{const i=H.getState().viewState.panCenter,a=new ie(...i),s=new ie(...n).distanceTo(a);r=Math.max(t,s/100)}return r},i$e=(t,e)=>{const n=m.useMemo(()=>new df,[]);return m.useMemo(()=>{let o;switch(t){case Uo.Default:o=Eye;break;case Uo.NoTexture:o=ig;break;case Uo.Texture01:o=IQt;break;case Uo.Texture02:o=zQt;break;case Uo.Texture03:o=DQt;break;case Uo.Texture04:o=EQt;break;case Uo.Texture05:o=FQt;break;case Uo.Texture06:o=kQt;break;case Uo.Texture07:o=LQt;break;case Uo.Texture08:o=WQt;break;case Uo.Texture09:o=NQt;break;case Uo.Texture10:o=UQt;break;default:o=ig}return e===gc.Stud&&(o=ig),n.load(o,r=>{r.wrapS=r.wrapT=Hs,r.offset.set(0,0);let i=.6,a=.6;switch(t){case Uo.Default:i=2,a=2;break;case Uo.Texture03:i=2,a=1;break;case Uo.Texture06:i=1,a=1;break}r.repeat.set(i,a),np()})},[t,e])},a$e=t=>{const e=m.useRef(!0);ht(o=>o.foundationMovedFlag);let n=t;if(!e.current){const o=H.getState().elements.find(r=>r.id===t.id&&r.type===z.Foundation);o&&(n=o)}return e.current=!1,n},RK=class RK{static getIntersectionObjects(e){return e.intersections.filter(n=>n.eventObject.name.includes("Cuboid")||n.eventObject.name==="Foundation"||n.eventObject.name.includes("Roof")||n.eventObject.name.includes(RK.WALL_OUTSIDE_SURFACE_MESH_NAME))}static addUndoableMove(){const e=H.getState().selectedElement;if(!e)return;const n=H.getState().getElementById(e.id),o=ht.getState().oldParentId,r=ht.getState().oldFoundationId;if(!n||!o||!r)return;const i=e.type===z.SolarPanel,a=e.type===z.Polygon,l={name:"Move",timestamp:Date.now(),movedElementId:n.id,movedElementType:n.type,oldCx:e.cx,oldCy:e.cy,oldCz:e.cz,newCx:n.cx,newCy:n.cy,newCz:n.cz,oldParentType:i?e.parentType:void 0,newParentType:i?n.parentType:void 0,oldParentId:o,newParentId:n.parentId,oldFoundationId:r,newFoundationId:n.foundationId,oldNormal:new ie().fromArray(e.normal),newNormal:new ie().fromArray(n.normal),oldRotation:[...e.rotation],newRotation:[...n.rotation],undo(){s(this.movedElementId,[this.oldCx,this.oldCy,this.oldCz],this.oldParentId,this.newParentId,this.oldFoundationId,this.oldParentType,this.oldRotation,this.oldNormal,a?e.vertices:void 0)},redo(){s(this.movedElementId,[this.newCx,this.newCy,this.newCz],this.newParentId,this.oldParentId,this.newFoundationId,this.newParentType,this.newRotation,this.newNormal,a?n.vertices:void 0)}};H.getState().addUndoable(l);const s=(c,u,d,f,p,g,y,w,b)=>{H.getState().set(C=>{const P=C.elements.find(v=>v.id===c);if(P){if(P.type===z.Polygon){if(b){const v=P;v.vertices=[...b]}}else[P.cx,P.cy,P.cz]=[...u];if(d&&f&&p&&(P.parentId=d,P.foundationId=p,g&&P.type===z.SolarPanel&&(P.parentType=g),y&&(P.rotation=[...y]),w&&(P.normal=[w.x,w.y,w.z]),P.type===z.Window)){const v=C.elements.find(S=>S.id===d),T=C.elements.find(S=>S.id===f);if(!v||!T)return;const A=P.lx*T.lx,x=P.lz*T.lz;P.lx=A/v.lx,P.lz=x/v.lz}}})}}static undoInvalidOperation(){H.getState().set(e=>{var n;if(e.selectedElement){for(let o=0;o{const e={name:`Add ${t.type} on Roof`,timestamp:Date.now(),addedElement:t,undo:()=>{H.getState().removeElementById(t.id,!1)},redo:()=>{H.getState().set(n=>{n.elements.push(e.addedElement),n.selectedElement=e.addedElement})}};H.getState().addUndoable(e)},BQt=t=>{for(const e of t.intersections)if(e.eventObject.name.includes("Roof Segments Group"))return e.object.name.includes("Flat roof")?e.point.clone().setZ(e.point.z-.01):e.point;return t.intersections[0].point},YQt=(t,e,n,o,r)=>{if(t.intersections.length===0)return;const i=H.getState().objectTypeToAdd;if(i===z.None)return;const a=H.getState().getElementById(n),l=H.getState().getElementById(e);if(!a||!l)return;const s=BQt(t),c=new ie().subVectors(s,new ie(l.cx,l.cy,l.lz/2)).applyEuler(new nn(0,0,-l.rotation[2])),u=c.clone().sub(r);switch(i){case z.SolarPanel:{const{normal:d,rotation:f}=Cn.computeState(o,u),p=H.getState().actionState,g=Ga.makeSolarPanel(a,H.getState().getPvModule(p.solarPanelModelName??"SPR-X21-335-BLK"),c.x,c.y,c.z,p.solarPanelOrientation??vr.landscape,p.solarPanelPoleHeight??1,p.solarPanelPoleSpacing??3,p.solarPanelTiltAngle??0,p.solarPanelRelativeAzimuth??0,d,f??[0,0,1],p.solarPanelFrameColor);H.getState().set(y=>{y.elements.push(g),y.selectedElementIdSet.clear(),y.selectedElementIdSet.add(g.id),y.actionModeLock||(y.objectTypeToAdd=z.None)}),Oz(g);break}case z.WaterHeater:{const{normal:d,rotation:f}=Cn.computeState(o,u);H.getState().actionState;const p=Ga.makeWaterHeater(a,c.x,c.y,c.z,d,f??[0,0,1]);H.getState().set(g=>{g.elements.push(p),g.selectedElementIdSet.clear(),g.selectedElementIdSet.add(p.id),g.actionModeLock||(g.objectTypeToAdd=z.None)}),Oz(p);break}case z.Window:{const{normal:d,rotation:f}=Cn.computeState(o,u),p=Ga.makeWindow(a,c.x,c.y,c.z,z.Roof,f,.5,.5);H.getState().set(g=>{g.elements.push(p),g.selectedElementIdSet.clear(),g.selectedElementIdSet.add(p.id),g.actionModeLock||(g.objectTypeToAdd=z.None)}),Oz(p);break}case z.Sensor:{const{normal:d,rotation:f}=Cn.computeState(o,u),p=Ga.makeSensor(a,c.x/l.lx,c.y/l.ly,c.z,d,f??[0,0,1]);H.getState().set(g=>{g.elements.push(p),g.selectedElementIdSet.clear(),g.selectedElementIdSet.add(p.id),g.actionModeLock||(g.objectTypeToAdd=z.None)}),Oz(p);break}case z.Light:{const{normal:d,rotation:f}=Cn.computeState(o,u),p=H.getState().actionState,g=Ga.makeLight(a,2,p.lightDistance,p.lightIntensity,p.lightColor,c.x/l.lx,c.y/l.ly,c.z,d,f??[0,0,1]);H.getState().set(y=>{y.elements.push(g),y.selectedElementIdSet.clear(),y.selectedElementIdSet.add(g.id),y.actionModeLock||(y.objectTypeToAdd=z.None)}),Oz(g);break}}},l$e=(t,e,n)=>{H.getState().isAddingElement()||H.getState().objectTypeToAdd!==z.None||t.intersections.length>0&&t.intersections[0].eventObject.name===t.eventObject.name&&(t.stopPropagation(),H.getState().set(o=>{if(o.contextMenuObjectType=null,o.groupActionMode)o.multiSelectionsMode||o.selectedElementIdSet.clear(),o.selectedElementIdSet.has(n)?o.selectedElementIdSet.delete(n):o.selectedElementIdSet.add(n);else for(const r of o.elements)r.id===e?(r.selected=!0,o.selectedElement=r,o.multiSelectionsMode?o.selectedElementIdSet.has(e)?o.selectedElementIdSet.delete(e):o.selectedElementIdSet.add(e):(o.selectedElementIdSet.clear(),o.selectedElementIdSet.add(e))):r.selected=!1}))},iN=(t,e,n)=>{const o={name:"Resize Roof Rise",timestamp:Date.now(),resizedElementId:t,resizedElementType:z.Roof,oldRise:e,newRise:n,undo:()=>{H.getState().updateRoofRiseById(o.resizedElementId,o.oldRise,0)},redo:()=>{H.getState().updateRoofRiseById(o.resizedElementId,o.newRise,0)}};H.getState().addUndoable(o)},s$e=(t,e)=>{const n={lng:H.getState().language};return Cn.rooftopElementBoundaryCheck(t,e)?!0:(H.getState().moveHandleType||H.getState().viewState.orthographic?po(Y.t("message.MoveOutsideBoundaryCancelled",n)):H.getState().resizeHandleType?po(Y.t("message.ResizingOutsideBoundaryCancelled",n)):H.getState().rotateHandleType&&po(Y.t("message.RotationOutsideBoundaryCancelled",n)),!1)},c$e=(t,e,n)=>{const o={lng:H.getState().language};return Cn.rooftopSPCollisionCheck(t,e,n)?!0:(H.getState().moveHandleType||H.getState().viewState.orthographic?po(Y.t("message.MoveCancelledBecauseOfOverlap",o)):H.getState().resizeHandleType?po(Y.t("message.ResizingCancelledBecauseOfOverlap",o)):H.getState().rotateHandleType&&po(Y.t("message.RotationCancelledBecauseOfOverlap",o)),!1)},CQ=(t,e,n,o,r,i,a)=>{t!==null&&H.getState().set(l=>{if(t!==null){for(const s of l.elements)if(s.parentId===e&&s.foundationId){if(s.type===z.SolarPanel){const u=new ie(s.cx,s.cy,s.cz).clone().sub(o),{segmentVertices:d,normal:f,rotation:p}=Cn.computeState(n,u,a);let g;d?g=Cn.getRooftopElementZ(d,u,r+i):g=r+i,f&&p&&g!==void 0&&(s.normal=f.toArray(),s.rotation=[...p],s.cz=g+t.lz/2)}else if(s.type===z.Window){const u=new ie(s.cx,s.cy,s.cz+t.lz).clone().sub(o),{segmentVertices:d,normal:f,rotation:p}=Cn.computeState(n,u,a);let g;d?g=Cn.getRooftopElementZ(d,u,r+i):g=r+i,f&&p&&g!==void 0&&(s.rotation=[...p],s.cz=g)}else if(s.type===z.Sensor||s.type===z.Light){const u=new ie(s.cx*t.lx,s.cy*t.ly,s.cz+t.lz).clone().sub(o),{segmentVertices:d,normal:f,rotation:p}=Cn.computeState(n,u,a);let g;d?g=Cn.getRooftopElementZ(d,u,r+i):g=r+i,f&&p&&g!==void 0&&(s.normal=f.toArray(),s.rotation=[...p],s.cz=g)}}}})},aN=(t,e,n,o,r)=>{t.button!==2&&(t.intersections[0].eventObject.name!==t.eventObject.name||(l$e(t,n,e),YQt(t,e,n,o,r)))},lN=(t,e)=>{const n=H.getState().selectedElement;if(!n||!Cn.isValidOnRoof(n))return;const o=H.getState().getElementById(n.id);if(o&&H.getState().moveHandleType&&Eu.getIntersectionObjects(t)[0].eventObject.userData.roofId===e.id&&o.foundationId){const a=H.getState().getElementById(o.foundationId);if(a)switch(o.type){case z.SolarPanel:{const l=o,s=Cn.getRoofBoundaryVertices(e),c=Cn.getSolarPanelVerticesOnRoof(l,a);!s$e(c,s)||!c$e(l,a,c)?Eu.undoInvalidOperation():Eu.addUndoableMove();break}case z.Sensor:Eu.addUndoableMove();break;case z.Light:Eu.addUndoableMove();break}}H.getState().set(r=>{r.moveHandleType=null})},sN=(t,e)=>{const n=H.getState().getSelectedElement();if(!(!n||!Cn.isValidOnRoof(n)))switch(n.type){case z.Sensor:case z.Light:case z.SolarPanel:{if(n.type===z.SolarPanel&&n.parentType===void 0)return;if(H.getState().moveHandleType){const o=Eu.getIntersectionObjects(t);o[0].eventObject.userData.roofId===e&&H.getState().set(i=>{for(const a of i.elements)if(a.id===n.id){const{roofId:l,foundation:s,centroid:c,roofSegments:u}=o[0].eventObject.userData;if(s&&c&&u&&l){const d=o[0].point,f=new ie().subVectors(d,new ie(s.cx,s.cy)).applyEuler(new nn(0,0,-s.rotation[2])),p=f.clone().sub(c),{normal:g,rotation:y}=Cn.computeState(u,p);a.cx=f.x/s.lx,a.cy=f.y/s.ly,a.cz=f.z-s.lz,a.rotation=[...y],a.normal=g.toArray(),a.parentId=l,a.foundationId=s.id,a.type===z.SolarPanel&&(a.parentType=z.Roof,a.color="#fff"),i.selectedElement&&(i.selectedElement.parentId=l,i.selectedElement.foundationId=s.id),ht.getState().setPrimitiveStore("showWallIntersectionPlaneId",null)}break}})}}}},TR=(t,e)=>{t.intersections.length>0&&t.intersections[0].eventObject.name===t.eventObject.name&&(t.stopPropagation(),H.getState().set(n=>{n.contextMenuObjectType=z.Roof,n.pastePoint.copy(t.intersections[0].point);for(const o of n.elements)if(o.id===e)if(o.selected=!0,n.selectedElement=o,n.selectedElementIdSet.has(e))for(const r of n.elements)n.selectedElementIdSet.has(r.id)&&r.type!==n.selectedElement.type&&n.selectedElementIdSet.delete(r.id);else if(n.multiSelectionsMode){n.selectedElementIdSet.add(e);for(const r of n.elements)n.selectedElementIdSet.has(r.id)&&r.type!==n.selectedElement.type&&n.selectedElementIdSet.delete(r.id)}else n.selectedElementIdSet.clear(),n.selectedElementIdSet.add(e);else o.selected=!1}))},oh=({position:t,onPointerDown:e,onPointerUp:n,onPointerOver:o})=>{const r=H(fn),i=a5(),{gl:a}=oi(),l=m.useRef(!1),s=m.useRef(!1),c=m.useRef(!1),u=m.useRef(null),[d,f]=m.useState("white"),p=y=>{y?(f(ta),a.domElement.style.cursor="pointer"):(f("white"),a.domElement.style.cursor="default")};m.useEffect(()=>{const y=()=>{s.current&&(c.current=!0),!s.current&&l.current&&p(!1),l.current=!1};return window.addEventListener("pointerup",y),()=>{window.removeEventListener("pointerup",y)}},[]);const g=y=>{if(y.intersections.length>0){for(const{eventObject:w}of y.intersections)if(w.name==="Roof Handle")return w===u.current}return!1};return h.jsx(ds,{name:"Roof Handle",ref:u,args:[i],position:t,onPointerMove:y=>{g(y)?(c.current=!1,s.current||(s.current=!0,p(!0))):f("white")},onPointerOut:y=>{c.current||(l.current||(y.intersections.length>0&&y.intersections[0].eventObject.name==="Roof Handle"?f("white"):p(!1)),s.current=!1,r(w=>{w.hoveredHandle=null}))},onPointerDown:y=>{g(y)&&(e&&e(y),l.current=!0)},onPointerUp:y=>{g(y)&&n&&n(y)},onPointerOver:y=>{g(y)&&o&&o(y)},onPointerLeave:y=>{g(y)&&r(w=>{w.hoveredHandle=null})},children:h.jsx("meshBasicMaterial",{attach:"material",color:d})})},OQt=({roofModel:t,foundationModel:e})=>{const n=H(yp),{id:o,wallsId:r,roofType:i}=t;return m.useEffect(()=>{r.length===0&&n(o,!1)},[r]),(()=>{switch(i){case Go.Pyramid:return h.jsx(_xt,{roofModel:t,foundationModel:e});case Go.Gable:return h.jsx(tbt,{roofModel:t,foundationModel:e});case Go.Hip:return h.jsx(ibt,{roofModel:t,foundationModel:e});case Go.Gambrel:return h.jsx(Kxt,{roofModel:t,foundationModel:e});case Go.Mansard:return h.jsx(cbt,{roofModel:t,foundationModel:e});default:return null}})()};function qH(t,e){return t.roofModel===e.roofModel&&t.foundationModel.lx===e.foundationModel.lx&&t.foundationModel.ly===e.foundationModel.ly&&t.foundationModel.lz===e.foundationModel.lz}const _Qt=be.memo(OQt,qH),$H=t=>{const e=m.useMemo(()=>{let i;switch(t){case Ur.NoTexture:i=ig;break;case Ur.Texture01:i=vxt;break;case Ur.Texture02:i=xxt;break;case Ur.Texture03:i=bxt;break;case Ur.Texture04:i=Sxt;break;case Ur.Texture05:i=Txt;break;case Ur.Texture06:i=Pxt;break;case Ur.Texture07:i=Cxt;break;default:i=wxt}return new df().load(i,a=>{switch(a.wrapS=a.wrapT=Hs,t){case Ur.NoTexture:case Ur.Default:a.repeat.set(5,3);break;case Ur.Texture01:a.repeat.set(.5,.25);break;case Ur.Texture03:a.repeat.set(.9,.9);break;case Ur.Texture04:case Ur.Texture05:case Ur.Texture06:a.repeat.set(.75,.75);break;default:a.repeat.set(.5,.5)}o(a),r()})},[t]),[n,o]=m.useState(e),{invalidate:r}=oi();return n},QH=(t,e)=>{const n=H(hA),o=H(Id);return{transparent:t||n&&o,opacity:Math.min(e!==void 0?e:1,n&&o||t?.25:1)}},u$e=(t,e,n)=>{const o=H(l=>l.elements.filter(s=>s.foundationId===t&&s.type===z.Wall),cy),r=l=>o.find(s=>s.id===l),i=m.useRef(!1);return{currentWallArray:m.useMemo(()=>{for(const l of n){let s=r(l);if(!s)return[];const c=[],u=s;let d=0;for(;s&&(!s.roofId||s.roofId===e)&&d++<100&&(c.push(s),s.leftJoints[0]);)if(s.leftJoints[0]!==u.id)s=r(s.leftJoints[0]);else return c.reverse(),i.current=!0,c;for(c.reverse(),s=r(u.rightJoints[0]),d=0;s&&(!s.roofId||s.roofId===e)&&d++<100&&(c.push(s),s.rightJoints[0]&&s.rightJoints[0]!==u.id);)s=r(s.rightJoints[0]);if(i.current=!1,c.length>1)return c}return[]},[n,o]),isLoopRef:i}},Fye=(t,e)=>{const n=H(r=>r.elements.filter(i=>i.foundationId===e&&i.type===z.Wall),cy);return m.useMemo(()=>{var f;const r=p=>n.find(g=>g.id===p),i=new Map,a=new Map,l=r(t);let s=l,c=0,u=!1;for(;s&&s.type===z.Wall&&c<100;){i.set(s.id,s);const p=s.relativeAngle.toFixed(1);if(a.has(p)?(f=a.get(p))==null||f.push(s):a.set(p,[s]),s.rightJoints.length!==0){if(s=r(s.rightJoints[0]),s&&s.id===l.id){u=!0;break}c++}else s=null}if(!u||a.size!==4)return null;const d=[];for(const[p,g]of a){let y=0;for(const v of g){const T=i.get(v.leftJoints[0]),A=i.get(v.rightJoints[0]);if(T&&T.relativeAngle.toFixed(1)!==p&&y++,A&&A.relativeAngle.toFixed(1)!==p&&y++,y>2)break}if(y!==2)return null;let w=null,b=null,C=0,P=-1;for(const v of g){const T=i.get(v.leftJoints[0]),A=i.get(v.rightJoints[0]);C=Math.max(C,v.lz),P=Math.max(P,v.eavesLength),T&&T.relativeAngle.toFixed(1)!==p&&(w=v),A&&A.relativeAngle.toFixed(1)!==p&&(b=v)}w&&b&&C>0&&P!==-1&&d.push({leftPoint:new ie().fromArray(w.leftPoint),rightPoint:new ie().fromArray(b.rightPoint),relativeAngle:w.relativeAngle,lz:C,eavesLength:P,wallsId:g.map(v=>v.id)})}return d.length!==4?null:d},[n])},kye=(t,e,n)=>{const o=m.useMemo(()=>Cn.getHighestComposedWallHeight(t,n),[t]),r=m.useMemo(()=>o+e,[o,e]);return{highestWallHeight:o,topZ:r}},d$e=(t,e,n)=>{const o=m.useMemo(()=>Cn.getHighestWallHeight(t,n),[t]),[r,i]=m.useState(e),a=o+r;return m.useEffect(()=>{e!==r&&i(e)},[e]),{highestWallHeight:o,topZ:a,riseInnerState:r,setRiseInnerState:i}},cN=(t,e,n,o,r,i)=>{const a=ht(pW),l=ht(zge),s=ht(hW),c=()=>{const u=f=>f.clone().add(e),d=[];if(o)if(r===Go.Gambrel)d.push(Nye(n).map(u));else{const f=[];for(const p of n)f.push(p.points[1].clone().add(e));d.push(f)}else{for(const f of n){const p=f.points;if(p.length===6)d.push(p.slice(3).map(u));else if(p.length===8)d.push(p.slice(4).map(u));else throw new Error("Invalid Roof segment data")}i&&d.push(i)}return Tn.getState().setRoofSegmentVertices(t,d),d};return(a||l||s)&&c(),m.useEffect(()=>{c()},[n]),c},uN=t=>{const e=ht(hW),n=ht(Oq);(e||n)&&t()},dN=(t,e)=>{const n=H(zH);m.useEffect(()=>{t.rise===void 0&&H.getState().set(o=>{for(const r of o.elements)if(r.id===t.id&&r.type===z.Roof){const i=r;i.rise===void 0&&(i.rise=i.lz-e,i.lz=0);break}})},[n])},VQt=()=>{const[,t]=m.useState(!1);m.useEffect(()=>{t(e=>!e)},[])},RQ=()=>{const t=m.useRef(!0);return t.current?(t.current=!1,!0):!1},Lye=(t,e,n,o,r,i,a)=>{const l=H(s=>s.updateElementOnRoofFlag);m.useEffect(()=>{l&&(CQ(t,e,n,o,r,i,a),H.getState().setUpdateElementOnRoofFlag(!1))},[r,i,l])},GQt=(t,e,n,o,r,i,a)=>{const l=RQ();m.useEffect(()=>{l||CQ(t,e,n,o,r,i,a)},[n])},Wye=(t,e,n,o,r,i,a)=>{GQt(t,e,n,o,r,i,a),Lye(t,e,n,o,r,i,a)},fN=(t,e,n,o)=>{const r=a$e(e);return m.useMemo(()=>({roofId:t,foundation:r,centroid:n,roofSegments:o}),[t,n,o,r])},PSe=(t,e)=>{const[n,o,r,i]=e;t.moveTo(n.points[0].x,n.points[0].y),t.lineTo(n.points[1].x,n.points[1].y),t.lineTo(i.points[0].x,i.points[0].y),t.lineTo(i.points[1].x,i.points[1].y),t.closePath()},Nye=(t,e)=>{const n=[],[o,r,i,a]=t;return n.push(o.points[0].clone()),n.push(o.points[1].clone()),n.push(a.points[0].clone()),n.push(a.points[1].clone()),e?(e.push(...n),e):n},aX=({uuid:t,shape:e,thickness:n,holeMeshes:o,simulation:r,castShadow:i,receiveShadow:a,children:l})=>{const s=m.useRef(null);if(s.current&&(s.current.geometry=new W9(e,{steps:1,depth:n,bevelEnabled:!1}),s.current.updateMatrix(),o.length>0)){const c=[];for(let d=0;d{const f=H.getState().world,p=H(Ds),g=ht(Ss),y=ht(h3),w=H(e5),b=H(i3),C=H(a3),P=Tn(dW),v=Tn.getState().hourlyHeatExchangeArrayMap,T=m.useRef(0),A=m.useRef(),x=m.useRef(),{transparent:S,opacity:R}=QH(),M=H(_=>_.elements.filter(X=>X.type===z.Window&&X.parentId===t),cy),D=m.useMemo(()=>{if(!y||e&&e.notBuilding)return;const _=v.get(t);if(!_)return;const X=_.reduce((ve,Ae)=>ve+Ae,0),$=P(t);if(!$||!$[0])return;const Q=[],le=$[0].map(ve=>ve.clone().sub(r)),q=r3*(f.solarRadiationHeatmapGridCellSize??.5),te=le[0].clone(),re=le[1].clone(),ae=le[2].clone(),se=new ie().subVectors(re,te),ne=new ie().subVectors(ae,te),fe=new ie().subVectors(ae,re),ge=se.length(),de=new ie().crossVectors(ne,fe).length()/ge,Z=Math.max(2,Math.floor(ge/q)),he=Math.max(2,Math.floor(de/q));se.normalize(),ne.normalize(),fe.normalize();const xe=new ie().crossVectors(ne,fe).normalize(),He=se.multiplyScalar(.5*ge/Z),Se=new ie().crossVectors(xe,se).normalize().multiplyScalar(.5*de/he),ze=te.clone().add(He).add(Se).add(new ie(0,0,i));He.multiplyScalar(2),Se.multiplyScalar(2),A.current=xe.clone().multiplyScalar(.1);const Ie=new ie,ye=new Array;for(const ve of le)ye.push({x:ve.x,y:ve.y});const ce=me.getPolygonArea(ye);if(ce===0)return;const pe=X/ce*(w??Qm);T.current=pe<0?1:0,x.current=new nn(-Math.sign(pe)*Gt,0,0);for(let ve=0;ve{if(o.length===0)return[new ie];const _=[];if(n===Go.Gambrel){Nye(o,_);const X=_.reduce(($,Q)=>Math.max($,Q.z),0);_.forEach($=>$.setZ(X))}else{_.push(o[0].points[0]);for(const X of o){const $=X.points[1];_.push($)}}return _},[o,n]),W=m.useMemo(()=>new ie(0,0,i),[i]),j=h.jsx(jn,{points:E,lineWidth:l,color:a}),L=$H(u),k=m.useMemo(()=>{const _=new Fl;if(o.length===0)return _;if(n===Go.Gambrel)PSe(_,o);else{const X=o[0].points[0];_.moveTo(X.x,X.y);for(const $ of o){const Q=$.points[1];_.lineTo(Q.x,Q.y)}_.closePath()}return _},[o,r,n]),N=m.useMemo(()=>{const _=new Fl;if(o.length===0)return _;if(n===Go.Gambrel)PSe(_,o);else{const X=o[0].points[0];_.moveTo(X.x,X.y);for(const $ of o){const Q=$.points[1];_.lineTo(Q.x,Q.y)}_.closePath()}if(M.length>0)for(const X of M){const $=new ie(X.cx,X.cy,X.cz).sub(r);switch(X.windowType){case Ti.Polygonal:{const[Q,le]=X.polygonTop??Gp,[q,te,re]=[X.lx/2,X.lz/2,Q*X.lx],ae=vG(q,te,re,le,$.x,$.y);_.holes.push(ae);break}case Ti.Arched:{const Q=wG(X.lx,X.lz,X.archHeight,$.x,$.y);_.holes.push(Q);break}default:{const Q=new Fl,[le,q]=[X.lx/2,X.lz/2];Q.moveTo($.x-le,$.y-q),Q.lineTo($.x+le,$.y-q),Q.lineTo($.x+le,$.y+q),Q.lineTo($.x-le,$.y+q),Q.closePath(),_.holes.push(Q)}}}return _},[o,r,M,n]),F=m.useMemo(()=>M.map(_=>{const[X,$,Q]=_.rotation,le=new ie(_.cx,_.cy,_.cz).sub(r),q=new nn().fromArray([_.rotation[0],_.rotation[1],_.rotation[2],"ZXY"]);switch(_.windowType){case Ti.Polygonal:{const[te,re]=_.polygonTop??Gp,[ae,se,ne]=[_.lx/2,_.lz/2,te*_.lx],fe=vG(ae,se,ne,re),ge=new is(new W9([fe],{steps:1,depth:_.ly,bevelEnabled:!1})),de=new ie(0,0,-_.ly).applyEuler(q);return ge.position.copy(le.clone().add(de)),ge.rotation.copy(q),ge.updateMatrix(),ge}case Ti.Arched:{const te=wG(_.lx,_.lz,_.archHeight),re=new is(new W9([te],{steps:1,depth:_.ly,bevelEnabled:!1})),ae=new ie(0,0,-_.ly).applyEuler(q);return re.position.copy(le.clone().add(ae)),re.rotation.copy(q),re.updateMatrix(),re}default:{const te=new is(new t3(_.lx,_.lz,_.ly*2));return te.position.copy(le),te.rotation.set(X,$,Q),te.updateMatrix(),te}}}),[M,i]),U=u===Ur.NoTexture&&c&&c===s,O=p&&!S,B=g&&d;return h.jsxs(h.Fragment,{children:[U&&!B?h.jsx(aX,{uuid:t,simulation:!0,shape:k,holeMeshes:F,thickness:i,castShadow:O,receiveShadow:p,children:h.jsx("meshStandardMaterial",{color:c,transparent:S,opacity:R})}):h.jsxs(h.Fragment,{children:[h.jsxs("mesh",{uuid:t,userData:{simulation:!0},name:"Flat roof top shape",position:[0,0,i+.001],receiveShadow:p,children:[h.jsx("shapeGeometry",{args:[N]}),B?h.jsx("meshBasicMaterial",{map:d,side:Ra}):h.jsx("meshStandardMaterial",{map:L,color:c,transparent:S,opacity:R,side:Ra})]}),h.jsx(aX,{shape:k,holeMeshes:F,thickness:i,castShadow:O,receiveShadow:p,children:h.jsx("meshStandardMaterial",{color:s??"white",transparent:S,opacity:R})})]}),j,h.jsxs("group",{position:[0,0,i],children:[j,E.map((_,X)=>{const $=[_.clone().sub(W),_];return h.jsx(jn,{points:$,lineWidth:l,color:a},X)})]}),D&&D.map((_,X)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:_,name:"Heat Flux "+X,lineWidth:C??Zm,color:b??g0}),";",h.jsx(Rd,{userData:{unintersectable:!0},position:A.current?_[T.current].clone().add(A.current):_[0],args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:x.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:b??g0})})]},X))]})},f$e="/aladdin/assets/foundation_01--kFbnI98.png",h$e="/aladdin/assets/foundation_02-wZzxF61c.png",p$e="/aladdin/assets/foundation_03-CrR6CCyr.png",g$e="/aladdin/assets/foundation_04-k0ozbTjk.png",m$e="/aladdin/assets/foundation_05-Bwrj98Mu.png",y$e="/aladdin/assets/foundation_06-BOa0J0il.png",A$e="/aladdin/assets/foundation_07-C9gRAfER.png",hN="/aladdin/assets/helvetiker_regular.typeface-B9JafPRX.fnt",Uye=be.memo(({element:t,height:e})=>{const n=H(Zq),o=H(ly),r=H(f7t),i=H(qr),a=H(hA),[l,s]=m.useState(),[c,u]=m.useState(10),[d,f]=m.useState(0);m.useEffect(()=>{if(n||o){const{cx:P,cy:v,lx:T,ly:A,type:x}=t;switch(x){case z.SolarPanel:{const S=i(t);if(S){const R=P*S.lx,M=v*S.ly;s(new ie(R,M,e??S.lz))}break}case z.Foundation:{s(new ie(P,v,a?.1:0));break}case z.Cuboid:{const{pos:S}=me.getWorldDataById(t.id),{rot:R}=me.getWorldDataById(t.parentId);s(new ie(S.x,S.y,S.z-t.lz/2+.2)),f(R);break}default:{s(new ie(P,v,a?.2:0));break}}u(Math.max(5,Math.hypot(T,A)*.75))}},[t,n,o,a,e]);const p=o3(lW,hN),g=c*.05,y={font:p,height:0,size:g},w=new Array(25).fill(0),b=P=>P===0?-g*.3:P>0&&P<7?-g*.8:-g*1.2,C=a?"#222":"#ccc";return h.jsx(h.Fragment,{children:l&&h.jsxs("group",{position:l,rotation:[Gt,d,0],name:"Polar Auxiliary",children:[h.jsx("polarGridHelper",{args:[c,24,6,120,C,C],userData:{unintersectable:!0}}),h.jsx(sR,{args:[c*.98,c,24,1,Gt,r],userData:{unintersectable:!0},rotation:[-Gt,0,0],children:h.jsx("meshBasicMaterial",{side:$r,color:"yellow"})}),h.jsx("group",{rotation:[0,r,0],children:h.jsx("mesh",{position:[-.5,0,-c*.9],rotation:[-Gt,0,0],userData:{unintersectable:!0},children:h.jsx("textGeometry",{args:[`${-me.toDegrees(r).toFixed(1)}°`,y]})})}),w.map((P,v)=>{let T=Math.ceil(v/2)*(v%2===0?1:-1);T===-12&&(T=12);const A=b(Math.abs(T));return h.jsx("group",{rotation:[0,T*Math.PI/12,0],children:h.jsxs("mesh",{position:[A,0,-c*1.05],rotation:[-Gt,0,0],userData:{unintersectable:!0},children:[h.jsx("textGeometry",{args:[`${-15*T}°`,y]}),h.jsx("meshStandardMaterial",{attach:"material",color:"lightGray"})]})},v)})]})})}),PR=be.memo(({id:t,position:e,ratio:n,handleType:o,hoverHandle:r,noHoverHandle:i})=>{const a=H(Y0),l=H(Zq),c=H(ly)===o||l===o?ta:Da,u=h.jsx("meshBasicMaterial",{color:c});return h.jsxs("group",{position:e,rotation:[Gt,0,0],scale:n,name:o,children:[h.jsxs("group",{children:[h.jsx(mge,{args:[.15,.05,6,8,3/2*Math.PI],rotation:[Gt,0,Gt],children:u}),h.jsx(Rd,{args:[.1,.1,6],rotation:[Gt,0,0],position:[.15,0,.05],children:u}),h.jsx(lR,{args:[.05,6],rotation:[0,Gt,0],position:[0,0,.15],children:u})]}),h.jsx(ua,{name:o,args:[.35,.35],position:[0,.05,0],rotation:[-Gt,0,0],visible:!1,onPointerDown:d=>{a(t,d,Oo.Rotate)},onPointerOver:d=>{r(d,o)},onPointerOut:i})]})}),fw=be.memo(({hx:t,hy:e,hz:n,lineColor:o="black",lineWidth:r=.2})=>h.jsx(jn,{points:[[-t,-e,-n],[t,-e,-n],[t,-e,n],[t,-e,-n],[t,e,-n],[t,e,n],[t,e,-n],[-t,e,-n],[-t,e,n],[-t,e,-n],[-t,-e,-n],[-t,-e,n],[t,-e,n],[t,e,n],[-t,e,n],[-t,-e,n]],name:"Wireframe",userData:{unintersectable:!0},lineWidth:r,color:o}));var Xr=(t=>(t.left="Left",t.right="Right",t.loop="Loop",t.null="Null",t))(Xr||{});const jye=be.memo(({element:t,verticalLift:e})=>{const n=H(s0),o=H(Id),r=H(d1),i=H(ly),a=t.lx/2,l=t.ly/2,s=.2,c=1,u=.5,d=t.lineColor??"white",f="darkorchid",p=Math.max(1,(a+l)/32),g=m.useMemo(()=>({lng:n}),[n]),y=m.useMemo(()=>{switch(t.type){case z.Cuboid:return Math.max(.5,Math.max(a,l)*.1)}return .5},[t.type,a,l]),w=m.useMemo(()=>{switch(t.type){case z.Cuboid:return o?t.lz/2+.1:-t.lz/2+.1;case z.Foundation:return t.lz+.1}return .1},[o,t.type,t.lz]),b=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:f,text:t.ly.toFixed(1)+Y.t("word.MeterAbbreviation",g),fontSize:80,fontFace:"Times Roman",textHeight:p,position:[-a-y,0,w+e]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a-y,-l,w],[-a-y,l,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a-y+s,-l+3*s,w],[-a-y,-l,w],[-a-y-s,-l+3*s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a-y+s,l-3*s,w],[-a-y,l,w],[-a-y-s,l-3*s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a,-l,w],[-a-y*2,-l,w]],color:d,linewidth:u}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a,l,w],[-a-y*2,l,w]],color:d,linewidth:u})]}),[a,l,w,g,d,e]),C=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:f,text:t.ly.toFixed(1)+Y.t("word.MeterAbbreviation",g),fontSize:80,fontFace:"Times Roman",textHeight:p,position:[a+y,0,w+e]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a+y,-l,w],[a+y,l,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a+y+s,-l+3*s,w],[a+y,-l,w],[a+y-s,-l+3*s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a+y+s,l-3*s,w],[a+y,l,w],[a+y-s,l-3*s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a,-l,w],[a+y*2,-l,w]],color:d,linewidth:u}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a,l,w],[a+y*2,l,w]],color:d,linewidth:u})]}),[a,l,w,g,d,e]),P=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:f,text:t.lx.toFixed(1)+Y.t("word.MeterAbbreviation",g),fontSize:80,fontFace:"Times Roman",textHeight:p,position:[0,-l-y,w+e]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a,-l-y,w],[a,-l-y,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a+3*s,-l-y-s,w],[-a,-l-y,w],[-a+3*s,-l-y+s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a-3*s,-l-y-s,w],[a,-l-y,w],[a-3*s,-l-y+s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a,-l,w],[-a,-l-y*2,w]],color:d,linewidth:u}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a,-l,w],[a,-l-y*2,w]],color:d,linewidth:u})]}),[a,l,w,g,d,e]),v=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:f,text:t.lx.toFixed(1)+Y.t("word.MeterAbbreviation",g),fontSize:80,fontFace:"Times Roman",textHeight:p,position:[0,l+y,w+e]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a,l+y,w],[a,l+y,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a+3*s,l+y-s,w],[-a,l+y,w],[-a+3*s,l+y+s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a-3*s,l+y-s,w],[a,l+y,w],[a-3*s,l+y+s,w]],color:d,linewidth:c}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-a,l,w],[-a,l+y*2,w]],color:d,linewidth:u}),h.jsx(jn,{userData:{unintersectable:!0},points:[[a,l,w],[a,l+y*2,w]],color:d,linewidth:u})]}),[a,l,w,g,d,e]);if(r)if(t.type===z.Wall)switch(r){case vt.LowerLeft:return P;case vt.LowerRight:return P}else switch(r){case vt.LowerLeft:return h.jsxs(h.Fragment,{children:[b,P]});case vt.LowerRight:return h.jsxs(h.Fragment,{children:[C,P]});case vt.UpperLeft:return h.jsxs(h.Fragment,{children:[b,v]});case vt.UpperRight:return h.jsxs(h.Fragment,{children:[C,v]})}if(i)if(t.type===z.Wall)switch(i){case vt.LowerLeft:return P;case vt.LowerRight:return P}else switch(i){case vt.LowerLeft:return h.jsxs(h.Fragment,{children:[b,P]});case vt.LowerRight:return h.jsxs(h.Fragment,{children:[C,P]});case vt.UpperLeft:return h.jsxs(h.Fragment,{children:[b,v]});case vt.UpperRight:return h.jsxs(h.Fragment,{children:[C,v]})}return h.jsx(h.Fragment,{})}),XQt=1.361,CSe=9.8067,RSe=1012,hO=1.225,C4=273.15,HSe=567e-10,JQt=[.103,.104,.109,.12,.13,.137,.138,.134,.121,.111,.106,.103];var yi=(t=>(t[t.NONE=0]="NONE",t[t.KASTEN_YOUNG=1]="KASTEN_YOUNG",t[t.SPHERE_MODEL=2]="SPHERE_MODEL",t))(yi||{});const T2=1440,rde=Math.PI/720,Xie=Math.PI/182.5,MSe=30,KQt=120;class ISe{constructor(e,n){this.sunrise=e,this.sunset=n}daylight(){return this.sunset-this.sunrise}}const l6=.5,L0=.1,lP=23.45/180*Math.PI,qQt=1e3*60*60*24,DC=720,pN=t=>{const e=Math.floor((t.getTime()-new Date(t.getFullYear(),0,0).getTime())/qQt);return lP*Math.sin(la*(284+e)/365.25)},dl=(t,e)=>{const n=Math.tan(me.toRadians(e))*Math.tan(pN(t));if(Math.abs(n)>1)return new ISe(0,n>0?DC*2:0);const o=60*Math.acos(-n)/me.toRadians(15);return new ISe(DC-o,DC+o)},Bye=t=>(t.getHours()*60+t.getMinutes()-DC)/DC*Math.PI,pO=t=>(t/DC-1)*Math.PI,Ei=(t,e)=>a9(1,Bye(t),pN(t),me.toRadians(e)).normalize(),a9=(t,e,n,o)=>{const r=Math.cos(n),i=Math.sin(n),a=Math.cos(o),l=Math.sin(o),s=Math.cos(e),c=Math.sin(e),u=Math.asin(i*l+r*s*a),d=c*r,f=a*i-s*r*l,p=Math.atan2(f,d),g=new ie(t,p,u);return me.sphericalToCartesianZ(g),g.x=-g.x,g},$Qt=t=>{const e=la*t/365,n=1.00011+.034221*Math.cos(e)+.00128*Math.sin(e)+719e-6*Math.cos(2*e)+77e-6*Math.sin(2*e);return XQt*n},QQt=(t,e,n)=>{let o;switch(t){case yi.NONE:return 1;case yi.KASTEN_YOUNG:return o=e.angleTo(Io),1/(Math.cos(o)+.50572*Math.pow(96.07995-o/Math.PI*180,-1.6364));default:{o=e.angleTo(Io);const r=Math.cos(o),i=708,a=n/9e3;return Math.sqrt((i+a)*(i+a)*r*r+(2*i+1+a)*(1-a))-(i+a)*r}}},Ri=(t,e,n,o)=>$Qt(e)*Math.pow(.7,Math.pow(QQt(o,t,n),.678)),ni=(t,e,n,o)=>{let r=0;const i=n.dot(Io),a=.5*(1+i);a>0&&(r+=JQt[e]*a*o);const l=.5*Math.abs(1-i);return me.isZero(l)||(r+=t.albedo*l*o),r},ZQt=be.memo(({foundation:t})=>{const e=H(rl),n=H(Tc),o=ht(ZBe),r=ht(Rf),i=ht(Uge),a=ht(Ss),l=H(Cf),s=Tn(u1),[c,u]=m.useState(null),d=m.useRef(null),{lx:f,ly:p,lz:g,solarUpdraftTower:y}=t,w=((y==null?void 0:y.collectorRadius)??100)*.016,b=m.useMemo(()=>Ei(new Date(e),n),[e,n]),C=m.useMemo(()=>{const v=[],T=(((y==null?void 0:y.collectorHeight)??Math.max(3,10*g))+g)/2,A=(y==null?void 0:y.chimneyHeight)??Math.max(f,p),x=(y==null?void 0:y.collectorRadius)??Math.min(f,p)/2,S=(y==null?void 0:y.chimneyRadius)??Math.max(1,.025*Math.min(f,p)),R=x*1.15,M=S*.5,D=S,E=S*2,W=S*4,j=6;for(let L=0;L{const v=[],T=((y==null?void 0:y.collectorHeight)??Math.max(3,10*g))+g,A=(y==null?void 0:y.collectorRadius)??Math.min(f,p)/2,x=25,S=2*A/x;for(let R=0;R<=x;R++){const M=[],D=-A+R*S,E=Math.sqrt(A*A-D*D);M.push(new ie(-E,D,T)),M.push(new ie(E,D,T)),v.push({points:M})}for(let R=0;R<=x;R++){const M=[],D=-A+R*S,E=Math.sqrt(A*A-D*D);M.push(new ie(D,-E,T)),M.push(new ie(D,E,T)),v.push({points:M})}return v},[f,p,g,y==null?void 0:y.collectorRadius,y==null?void 0:y.collectorHeight]);return m.useEffect(()=>{if(t&&a){const v=s(t.id+"-sut");v&&u(me.fetchHeatmapTexture(v,l??5))}},[a,l]),ay((v,T)=>{(o||r&&!i)&&b.z>0&&d.current&&d.current.children.forEach(A=>{if(A.name==="Streamlines"){const x=A;x.material.uniforms.dashOffset.value-=T*w*10}})}),h.jsxs("group",{children:[h.jsx(ca,{userData:{unintersectable:!0,simulation:!0},name:"Chimney",castShadow:!0,receiveShadow:!1,args:[(y==null?void 0:y.chimneyRadius)??Math.max(1,.025*Math.min(f,p)),(y==null?void 0:y.chimneyRadius)??Math.max(1,.025*Math.min(f,p)),(y==null?void 0:y.chimneyHeight)??Math.max(f,p),16,2,!0],position:[0,0,((y==null?void 0:y.chimneyHeight)??Math.max(f,p))/2+g],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white",side:$r})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Chimney Base",castShadow:!0,receiveShadow:!1,args:[(y==null?void 0:y.chimneyRadius)??Math.max(1,.025*Math.min(f,p)),((y==null?void 0:y.chimneyRadius)??Math.max(1,.025*Math.min(f,p)))*1.6,((y==null?void 0:y.collectorHeight)??Math.max(3,10*g))*4,16,2,!0],position:[0,0,((y==null?void 0:y.collectorHeight)??Math.max(3,10*g))*2+g],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white",side:$r})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Greenhouse Wall",castShadow:!0,receiveShadow:!0,args:[(y==null?void 0:y.collectorRadius)??Math.min(f,p)/2,(y==null?void 0:y.collectorRadius)??Math.min(f,p)/2,(y==null?void 0:y.collectorHeight)??Math.max(3,10*g),50,2,!0],position:[0,0,((y==null?void 0:y.collectorHeight)??Math.max(3,10*g))/2+g],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white",side:$r})}),h.jsx(lR,{uuid:t.id+"-sut",userData:{unintersectable:!0,simulation:!0},name:"Greenhouse Ceiling",castShadow:!1,receiveShadow:!1,args:[(y==null?void 0:y.collectorRadius)??Math.min(f,p)/2,50,0,la],position:[0,0,g+((y==null?void 0:y.collectorHeight)??Math.max(3,10*g))],children:a&&c?h.jsx("meshBasicMaterial",{attach:"material",side:Ra,map:c}):h.jsx("meshPhongMaterial",{attach:"material",specular:new rr("white"),shininess:50,side:Ra,color:"lightskyblue",transparent:!0,opacity:.75})}),h.jsx(lR,{userData:{unintersectable:!0},name:"Greenhouse Ground",castShadow:!1,receiveShadow:!0,args:[(y==null?void 0:y.collectorRadius)??Math.min(f,p)/2,50,0,la],position:[0,0,.1],children:h.jsx("meshStandardMaterial",{attach:"material",color:"dimgray"})}),P&&P.map((v,T)=>h.jsx(jn,{name:"Greenhouse Roof Grid Lines",userData:{unintersectable:!0},points:v.points,castShadow:!1,receiveShadow:!1,lineWidth:.2,color:"gray"},T)),b.z>0&&C&&h.jsx("group",{ref:d,children:C.map((v,T)=>{const A=v.points[0].x+v.points[1].x,x=v.points[0].y+v.points[1].y,S=new nn(0,0,la*T/C.length+Gt),R=w,M=w;return h.jsxs(be.Fragment,{children:[h.jsx(jn,{name:"Streamlines",userData:{unintersectable:!0},points:v.points,castShadow:!1,receiveShadow:!1,lineWidth:.5,dashed:!0,dashSize:R,gapSize:M,color:"white"}),h.jsx(Rd,{userData:{unintersectable:!0},args:[w,w*4,4,2],name:"Streamline Inlet Arrow Head",position:[A*.1,x*.1,v.points[0].z],rotation:S,children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})}),h.jsx(Rd,{userData:{unintersectable:!0},args:[w,w*4,4,2],name:"Streamline Inlet Arrow Head",position:[A*.9,x*.9,v.points[0].z],rotation:S,children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})})]},T)})})]})}),Yye="/aladdin/assets/glow-CV5NAijT.png",eZt=be.memo(({foundation:t})=>{const e=H(rl),n=H(Tc),o=bb(Yye),r=m.useMemo(()=>Ei(new Date(e),n),[e,n]),{lz:i,solarPowerTower:a}=t,l=(a==null?void 0:a.towerRadius)??1,s=(a==null?void 0:a.towerHeight)??20,c=s/10,u=l*1.5,d=Math.max(c,u)*2.4;return h.jsxs("group",{children:[h.jsx(ca,{userData:{unintersectable:!0},name:"Focus Tower",castShadow:!0,receiveShadow:!1,args:[l,l,s,6,2],position:[0,0,s/2+i/2],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Center Receiver",castShadow:!0,receiveShadow:!1,args:[u,u,c,10,2],position:[0,0,s+i/2],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})}),r.z>0&&h.jsx("mesh",{position:[0,0,s+i/2],children:h.jsx("sprite",{scale:[d,d,d],children:h.jsx("spriteMaterial",{map:o,transparent:!1,color:16777215,blending:nR,depthWrite:!1})})})]})}),tZt=be.memo(({foundation:t})=>{const{ly:e,lz:n,solarAbsorberPipe:o}=t,r=(o==null?void 0:o.absorberHeight)??10,i=(o==null?void 0:o.apertureWidth)??.6,a=(o==null?void 0:o.relativeLength)??.9,l=(o==null?void 0:o.poleNumber)??5,s=m.useMemo(()=>{const c=[],u=a*e/(l+1);for(let d=1;d<=l;d++)c.push(new ie(0,d*u-a*e/2,r/2+n/2));return c},[e,n,l,r,a]);return h.jsxs("group",{children:[h.jsx(ca,{userData:{unintersectable:!0},name:"Receiver Vertical Pipe 1",castShadow:!1,receiveShadow:!1,args:[i/4,i/4,r,6,2],position:[0,-a*e/2,r/2+n/2],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Receiver Vertical Pipe 2",castShadow:!1,receiveShadow:!1,args:[i/4,i/4,r,6,2],position:[0,a*e/2,r/2+n/2],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Receiver Horizontal Pipe",castShadow:!1,receiveShadow:!1,args:[i/2,i/2,a*e+i/2,6,2,!1,3*Gt,Math.PI],position:[0,0,r+n/2-i/4],rotation:[0,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white",side:$r})}),s&&s.map((c,u)=>h.jsx(ca,{userData:{unintersectable:!0},name:"Solar Receiver Pole "+u,castShadow:!1,receiveShadow:!1,args:[i/8,i/8,r,4,2],position:c,rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})},u))]})});class vx{static selectMe(e,n,o,r){var i,a,l;if(o.intersections.length>0&&o.intersections.filter(c=>!c.eventObject.name.startsWith("Wall Intersection Plane"))[0].object===o.eventObject){for(const c of e.elements)c.id===n?(c.selected=!0,e.selectedElement=c,e.selectedElementHeight=c.lz):c.selected=!1;if(!e.selectedElement)return;if(r===Oo.ContextMenu)if(e.selectedElementIdSet.has(n))for(const c of e.elements)e.selectedElementIdSet.has(c.id)&&c.type!==e.selectedElement.type&&e.selectedElementIdSet.delete(c.id);else if(e.multiSelectionsMode){e.selectedElementIdSet.add(n);for(const c of e.elements)e.selectedElementIdSet.has(c.id)&&c.type!==e.selectedElement.type&&e.selectedElementIdSet.delete(c.id)}else e.selectedElementIdSet.clear(),e.selectedElementIdSet.add(n);else e.multiSelectionsMode?e.selectedElementIdSet.has(n)?e.selectedElementIdSet.delete(n):e.selectedElementIdSet.add(n):(e.selectedElementIdSet.clear(),e.selectedElementIdSet.add(n));if(e.moveHandleType=null,e.resizeHandleType=null,e.rotateHandleType=null,r)switch(r){case Oo.Move:((i=e.selectedElement)==null?void 0:i.type)===z.Tree||((a=e.selectedElement)==null?void 0:a.type)===z.Human?e.moveHandleType=Ho.Default:e.moveHandleType=o.eventObject.name;break;case Oo.Resize:e.resizeHandleType=o.eventObject.name;break;case Oo.Rotate:e.rotateHandleType=o.eventObject.name;break;case Oo.Select:e.selectedElementAngle=((l=o.object.parent)==null?void 0:l.rotation.z)??0;break}}}static selectNone(e){e.selectedElementIdSet.clear();for(const n of e.elements)n.selected=!1;e.selectedElement=null,e.selectedElementIdSet.clear()}static clearThenAddSelectedElementIdSet(e,n){e.selectedElementIdSet.clear(),e.selectedElementIdSet.add(n)}}var lX={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 - */aX.exports;(function(t,e){(function(){var n,o="4.17.21",r=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",s="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,f=2,p=4,g=1,y=2,w=1,b=2,C=4,P=8,v=16,T=32,A=64,x=128,S=256,R=512,M=30,D="...",E=800,W=16,j=1,L=2,k=3,N=1/0,F=9007199254740991,U=17976931348623157e292,O=NaN,B=4294967295,_=B-1,X=B>>>1,$=[["ary",x],["bind",w],["bindKey",b],["curry",P],["curryRight",v],["flip",R],["partial",T],["partialRight",A],["rearg",S]],Q="[object Arguments]",le="[object Array]",q="[object AsyncFunction]",te="[object Boolean]",re="[object Date]",ae="[object DOMException]",se="[object Error]",ne="[object Function]",fe="[object GeneratorFunction]",ge="[object Map]",de="[object Number]",Z="[object Null]",he="[object Object]",xe="[object Promise]",He="[object Proxy]",Se="[object RegExp]",ze="[object Set]",Ie="[object String]",ye="[object Symbol]",ce="[object Undefined]",pe="[object WeakMap]",ve="[object WeakSet]",Ae="[object ArrayBuffer]",Te="[object DataView]",Me="[object Float32Array]",Pe="[object Float64Array]",Ee="[object Int8Array]",Be="[object Int16Array]",Je="[object Int32Array]",We="[object Uint8Array]",Ke="[object Uint8ClampedArray]",Ne="[object Uint16Array]",De="[object Uint32Array]",ke=/\b__p \+= '';/g,Ye=/\b(__p \+=) '' \+/g,it=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ve=/&(?:amp|lt|gt|quot|#39);/g,yt=/[&<>"']/g,ct=RegExp(Ve.source),Xe=RegExp(yt.source),ut=/<%-([\s\S]+?)%>/g,ft=/<%([\s\S]+?)%>/g,ot=/<%=([\s\S]+?)%>/g,st=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,at=/^\w*$/,Oe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ze=/[\\^$.*+?()[\]{}|]/g,St=RegExp(Ze.source),Pt=/^\s+/,Rt=/\s/,Ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ht=/\{\n\/\* \[wrapped with (.+)\] \*/,At=/,? & /,kt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gt=/[()=,{}\[\]\/\s]/,dt=/\\(\\)?/g,Ct=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tt=/\w*$/,Fe=/^[-+]0x[0-9a-f]+$/i,qe=/^0b[01]+$/i,je=/^\[object .+?Constructor\]$/,rt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,Qe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tt=/($^)/,Dt=/['\n\r\u2028\u2029\\]/g,lt="\\ud800-\\udfff",zt="\\u0300-\\u036f",Ft="\\ufe20-\\ufe2f",_t="\\u20d0-\\u20ff",tn=zt+Ft+_t,Qt="\\u2700-\\u27bf",gn="a-z\\xdf-\\xf6\\xf8-\\xff",an="\\xac\\xb1\\xd7\\xf7",mn="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Hn="\\u2000-\\u206f",Fo=" \\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",yo="A-Z\\xc0-\\xd6\\xd8-\\xde",So="\\ufe0e\\ufe0f",$o=an+mn+Hn+Fo,mo="['’]",Jn="["+lt+"]",uo="["+$o+"]",ir="["+tn+"]",Rr="\\d+",br="["+Qt+"]",Vr="["+gn+"]",Wo="[^"+lt+$o+Rr+Qt+gn+yo+"]",wn="\\ud83c[\\udffb-\\udfff]",In="(?:"+ir+"|"+wn+")",ar="[^"+lt+"]",No="(?:\\ud83c[\\udde6-\\uddff]){2}",eo="[\\ud800-\\udbff][\\udc00-\\udfff]",Xn="["+yo+"]",Jo="\\u200d",xo="(?:"+Vr+"|"+Wo+")",Qo="(?:"+Xn+"|"+Wo+")",jo="(?:"+mo+"(?:d|ll|m|re|s|t|ve))?",lr="(?:"+mo+"(?:D|LL|M|RE|S|T|VE))?",fr=In+"?",ai="["+So+"]?",hr="(?:"+Jo+"(?:"+[ar,No,eo].join("|")+")"+ai+fr+")*",tr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xi="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Eo=ai+fr+hr,bi="(?:"+[br,No,eo].join("|")+")"+Eo,hl="(?:"+[ar+ir+"?",ir,No,eo,Jn].join("|")+")",nr=RegExp(mo,"g"),or=RegExp(ir,"g"),Ai=RegExp(wn+"(?="+wn+")|"+hl+Eo,"g"),ka=RegExp([Xn+"?"+Vr+"+"+jo+"(?="+[uo,Xn,"$"].join("|")+")",Qo+"+"+lr+"(?="+[uo,Xn+xo,"$"].join("|")+")",Xn+"?"+xo+"+"+jo,Xn+"+"+lr,xi,tr,Rr,bi].join("|"),"g"),wi=RegExp("["+Jo+lt+tn+So+"]"),Fs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ks=["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"],Zs=-1,Ui={};Ui[Me]=Ui[Pe]=Ui[Ee]=Ui[Be]=Ui[Je]=Ui[We]=Ui[Ke]=Ui[Ne]=Ui[De]=!0,Ui[Q]=Ui[le]=Ui[Ae]=Ui[te]=Ui[Te]=Ui[re]=Ui[se]=Ui[ne]=Ui[ge]=Ui[de]=Ui[he]=Ui[Se]=Ui[ze]=Ui[Ie]=Ui[pe]=!1;var da={};da[Q]=da[le]=da[Ae]=da[Te]=da[te]=da[re]=da[Me]=da[Pe]=da[Ee]=da[Be]=da[Je]=da[ge]=da[de]=da[he]=da[Se]=da[ze]=da[Ie]=da[ye]=da[We]=da[Ke]=da[Ne]=da[De]=!0,da[se]=da[ne]=da[pe]=!1;var Bl={À:"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"},Gl={"&":"&","<":"<",">":">",'"':""","'":"'"},qu={"&":"&","<":"<",">":">",""":'"',"'":"'"},Rc={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},mu=parseFloat,un=parseInt,$t=typeof Ac=="object"&&Ac&&Ac.Object===Object&&Ac,Bt=typeof self=="object"&&self&&self.Object===Object&&self,pn=$t||Bt||Function("return this")(),Pn=e&&!e.nodeType&&e,$e=Pn&&!0&&t&&!t.nodeType&&t,bt=$e&&$e.exports===Pn,Lt=bt&&$t.process,xt=function(){try{var vn=$e&&$e.require&&$e.require("util").types;return vn||Lt&&Lt.binding&&Lt.binding("util")}catch{}}(),jt=xt&&xt.isArrayBuffer,Kt=xt&&xt.isDate,sn=xt&&xt.isMap,yn=xt&&xt.isRegExp,An=xt&&xt.isSet,bn=xt&&xt.isTypedArray;function Ln(vn,io,Nn){switch(Nn.length){case 0:return vn.call(io);case 1:return vn.call(io,Nn[0]);case 2:return vn.call(io,Nn[0],Nn[1]);case 3:return vn.call(io,Nn[0],Nn[1],Nn[2])}return vn.apply(io,Nn)}function Yn(vn,io,Nn,Sr){for(var ui=-1,ji=vn==null?0:vn.length;++ui-1}function $i(vn,io,Nn){for(var Sr=-1,ui=vn==null?0:vn.length;++Sr-1;);return Nn}function _g(vn,io){for(var Nn=vn.length;Nn--&&_0(io,vn[Nn],0)>-1;);return Nn}function il(vn,io){for(var Nn=vn.length,Sr=0;Nn--;)vn[Nn]===io&&++Sr;return Sr}var jd=yu(Bl),wu=yu(Gl);function p5(vn){return"\\"+Rc[vn]}function wy(vn,io){return vn==null?n:vn[io]}function Ih(vn){return wi.test(vn)}function S3(vn){return Fs.test(vn)}function vy(vn){for(var io,Nn=[];!(io=vn.next()).done;)Nn.push(io.value);return Nn}function T3(vn){var io=-1,Nn=Array(vn.size);return vn.forEach(function(Sr,ui){Nn[++io]=[ui,Sr]}),Nn}function g5(vn,io){return function(Nn){return vn(io(Nn))}}function zh(vn,io){for(var Nn=-1,Sr=vn.length,ui=0,ji=[];++Nn-1}function D3(G,ee){var Re=this.__data__,et=Tp(Re,G);return et<0?(++this.size,Re.push([G,ee])):Re[et][1]=ee,this}Eh.prototype.clear=wS,Eh.prototype.delete=NA,Eh.prototype.get=vS,Eh.prototype.has=xS,Eh.prototype.set=D3;function xu(G){var ee=-1,Re=G==null?0:G.length;for(this.clear();++ee=ee?G:ee)),G}function id(G,ee,Re,et,Mt,Ot){var dn,xn=ee&d,zn=ee&f,wo=ee&p;if(Re&&(dn=Mt?Re(G,et,Mt,Ot):Re(G)),dn!==n)return dn;if(!As(G))return G;var bo=Zi(G);if(bo){if(dn=bte(G),!xn)return S0(G,dn)}else{var zo=Q0(G),Tr=zo==ne||zo==fe;if(cm(G))return e4(G,xn);if(zo==he||zo==Q||Tr&&!Mt){if(dn=zn||Tr?{}:SU(G),!xn)return zn?U5(G,GA(dn,G)):n4(G,VA(dn,G))}else{if(!da[zo])return Mt?G:{};dn=Ste(G,zo,xn)}}Ot||(Ot=new Mc);var ei=Ot.get(G);if(ei)return ei;Ot.set(G,dn),_S(G)?G.forEach(function(Ii){dn.add(id(Ii,ee,Re,Ii,G,Ot))}):yj(G)&&G.forEach(function(Ii,_a){dn.set(_a,id(Ii,ee,Re,_a,G,Ot))});var Mi=wo?zn?Ta:Oa:zn?H0:R0,Pa=bo?n:Mi(G);return Wn(Pa||G,function(Ii,_a){Pa&&(_a=Ii,Ii=G[_a]),rd(dn,_a,id(Ii,ee,Re,_a,G,Ot))}),dn}function XA(G){var ee=R0(G);return function(Re){return F3(Re,G,ee)}}function F3(G,ee,Re){var et=Re.length;if(G==null)return!et;for(G=Si(G);et--;){var Mt=Re[et],Ot=ee[Mt],dn=G[Mt];if(dn===n&&!(Mt in G)||!Ot(dn))return!1}return!0}function JA(G,ee,Re){if(typeof G!="function")throw new G0(a);return m7(function(){G.apply(n,Re)},ee)}function Qg(G,ee,Re,et){var Mt=-1,Ot=li,dn=!0,xn=G.length,zn=[],wo=ee.length;if(!xn)return zn;Re&&(ee=Or(ee,Au(Re))),et?(Ot=$i,dn=!1):ee.length>=r&&(Ot=ec,dn=!1,ee=new S1(ee));e:for(;++MtMt?0:Mt+Re),et=et===n||et>Mt?Mt:Gi(et),et<0&&(et+=Mt),et=Re>et?0:GS(et);Re0&&Re(xn)?ee>1?Ic(xn,ee-1,Re,et,Mt):ya(Mt,xn):et||(Mt[Mt.length]=xn)}return Mt}var z5=o4(),_d=o4(!0);function bu(G,ee){return G&&z5(G,ee,R0)}function D5(G,ee){return G&&_d(G,ee,R0)}function Vd(G,ee){return Ko(ee,function(Re){return um(G[Re])})}function Lf(G,ee){ee=H1(ee,G);for(var Re=0,et=ee.length;G!=null&&Reee}function Zg(G,ee){return G!=null&&Ya.call(G,ee)}function qA(G,ee){return G!=null&&ee in Si(G)}function Hy(G,ee,Re){return G>=X0(ee,Re)&&G=120&&bo.length>=120)?new S1(dn&&bo):n}bo=G[0];var zo=-1,Tr=xn[0];e:for(;++zo-1;)xn!==G&&td.call(xn,zn,1),td.call(G,zn,1);return G}function x0(G,ee){for(var Re=G?ee.length:0,et=Re-1;Re--;){var Mt=ee[Re];if(Re==et||Mt!==Ot){var Ot=Mt;jy(Mt)?td.call(G,Mt,1):ky(G,Mt)}}return G}function Wf(G,ee){return G+P5(M3()*(ee-G+1))}function sd(G,ee,Re,et){for(var Mt=-1,Ot=Kc(T5((ee-G)/(Re||1)),0),dn=Nn(Ot);Ot--;)dn[et?Ot:++Mt]=G,G+=Re;return dn}function nm(G,ee){var Re="";if(!G||ee<1||ee>F)return Re;do ee%2&&(Re+=G),ee=P5(ee/2),ee&&(G+=G);while(ee);return Re}function Zr(G,ee){return $M(KM(G,ee,Pu),G+"")}function f7(G){return $g(Yy(G))}function j3(G,ee){var Re=Yy(G);return CS(Re,v0(ee,0,Re.length))}function Ey(G,ee,Re,et){if(!As(G))return G;ee=H1(ee,G);for(var Mt=-1,Ot=ee.length,dn=Ot-1,xn=G;xn!=null&&++MtMt?0:Mt+ee),Re=Re>Mt?Mt:Re,Re<0&&(Re+=Mt),Mt=ee>Re?0:Re-ee>>>0,ee>>>=0;for(var Ot=Nn(Mt);++et>>1,dn=G[Ot];dn!==null&&!P0(dn)&&(Re?dn<=ee:dn=r){var wo=ee?null:T0(G);if(wo)return P3(wo);dn=!1,Mt=ec,zn=new S1}else zn=ee?[]:xn;e:for(;++et=et?G:q0(G,ee,Re)}var Y3=S5||function(G){return pn.clearTimeout(G)};function e4(G,ee){if(ee)return G.slice();var Re=G.length,et=Jg?Jg(Re):new G.constructor(Re);return G.copy(et),et}function im(G){var ee=new G.constructor(G.byteLength);return new v5(ee).set(new v5(G)),ee}function t4(G,ee){var Re=ee?im(G.buffer):G.buffer;return new G.constructor(Re,G.byteOffset,G.byteLength)}function Uf(G){var ee=new G.constructor(G.source,tt.exec(G));return ee.lastIndex=G.lastIndex,ee}function kh(G){return Dh?Si(Dh.call(G)):{}}function am(G,ee){var Re=ee?im(G.buffer):G.buffer;return new G.constructor(Re,G.byteOffset,G.length)}function Jd(G,ee){if(G!==ee){var Re=G!==n,et=G===null,Mt=G===G,Ot=P0(G),dn=ee!==n,xn=ee===null,zn=ee===ee,wo=P0(ee);if(!xn&&!wo&&!Ot&&G>ee||Ot&&dn&&zn&&!xn&&!wo||et&&dn&&zn||!Re&&zn||!Mt)return 1;if(!et&&!Ot&&!wo&&G=xn)return zn;var wo=Re[et];return zn*(wo=="desc"?-1:1)}}return G.index-ee.index}function lm(G,ee,Re,et){for(var Mt=-1,Ot=G.length,dn=Re.length,xn=-1,zn=ee.length,wo=Kc(Ot-dn,0),bo=Nn(zn+wo),zo=!et;++xn1?Re[Mt-1]:n,dn=Mt>2?Re[2]:n;for(Ot=G.length>3&&typeof Ot=="function"?(Mt--,Ot):n,dn&&$d(Re[0],Re[1],dn)&&(Ot=Mt<3?n:Ot,Mt=1),ee=Si(ee);++et-1?Mt[Ot?ee[dn]:dn]:n}}function Ge(G){return oa(function(ee){var Re=ee.length,et=Re,Mt=J0.prototype.thru;for(G&&ee.reverse();et--;){var Ot=ee[et];if(typeof Ot!="function")throw new G0(a);if(Mt&&!dn&&r4(Ot)=="wrapper")var dn=new J0([],!0)}for(et=dn?et:Re;++et1&&sl.reverse(),bo&&zn<_a&&(sl.length=zn),this&&this!==pn&&this instanceof Ii&&(q3=Pa||K(q3)),q3.apply(_y,sl)}return Ii}function Zt(G,ee){return function(Re,et){return em(Re,G,ee(et),{})}}function Sn(G,ee){return function(Re,et){var Mt;if(Re===n&&et===n)return ee;if(Re!==n&&(Mt=Re),et!==n){if(Mt===n)return et;typeof Re=="string"||typeof et=="string"?(Re=b0(Re),et=b0(et)):(Re=W5(Re),et=W5(et)),Mt=G(Re,et)}return Mt}}function Qn(G){return oa(function(ee){return ee=Or(ee,Au(gi())),Zr(function(Re){var et=this;return G(ee,function(Mt){return Ln(Mt,et,Re)})})})}function Bo(G,ee){ee=ee===n?" ":b0(ee);var Re=ee.length;if(Re<2)return Re?nm(ee,G):ee;var et=nm(ee,T5(G/Xc(ee)));return Ih(ee)?M1(ms(et),0,G).join(""):et.slice(0,G)}function zr(G,ee,Re,et){var Mt=ee&w,Ot=K(G);function dn(){for(var xn=-1,zn=arguments.length,wo=-1,bo=et.length,zo=Nn(bo+zn),Tr=this&&this!==pn&&this instanceof dn?Ot:G;++woxn))return!1;var wo=Ot.get(G),bo=Ot.get(ee);if(wo&&bo)return wo==ee&&bo==G;var zo=-1,Tr=!0,ei=Re&y?new S1:n;for(Ot.set(G,ee),Ot.set(ee,G);++zo1?"& ":"")+ee[et],ee=ee.join(Re>2?", ":" "),G.replace(Ut,`{ + */lX.exports;(function(t,e){(function(){var n,o="4.17.21",r=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",s="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,f=2,p=4,g=1,y=2,w=1,b=2,C=4,P=8,v=16,T=32,A=64,x=128,S=256,R=512,M=30,D="...",E=800,W=16,j=1,L=2,k=3,N=1/0,F=9007199254740991,U=17976931348623157e292,O=NaN,B=4294967295,_=B-1,X=B>>>1,$=[["ary",x],["bind",w],["bindKey",b],["curry",P],["curryRight",v],["flip",R],["partial",T],["partialRight",A],["rearg",S]],Q="[object Arguments]",le="[object Array]",q="[object AsyncFunction]",te="[object Boolean]",re="[object Date]",ae="[object DOMException]",se="[object Error]",ne="[object Function]",fe="[object GeneratorFunction]",ge="[object Map]",de="[object Number]",Z="[object Null]",he="[object Object]",xe="[object Promise]",He="[object Proxy]",Se="[object RegExp]",ze="[object Set]",Ie="[object String]",ye="[object Symbol]",ce="[object Undefined]",pe="[object WeakMap]",ve="[object WeakSet]",Ae="[object ArrayBuffer]",Te="[object DataView]",Me="[object Float32Array]",Pe="[object Float64Array]",Ee="[object Int8Array]",Be="[object Int16Array]",Je="[object Int32Array]",We="[object Uint8Array]",Ke="[object Uint8ClampedArray]",Ne="[object Uint16Array]",De="[object Uint32Array]",ke=/\b__p \+= '';/g,Ye=/\b(__p \+=) '' \+/g,it=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ve=/&(?:amp|lt|gt|quot|#39);/g,yt=/[&<>"']/g,ct=RegExp(Ve.source),Xe=RegExp(yt.source),ut=/<%-([\s\S]+?)%>/g,ft=/<%([\s\S]+?)%>/g,ot=/<%=([\s\S]+?)%>/g,st=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,at=/^\w*$/,Oe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ze=/[\\^$.*+?()[\]{}|]/g,St=RegExp(Ze.source),Pt=/^\s+/,Rt=/\s/,Ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ht=/\{\n\/\* \[wrapped with (.+)\] \*/,At=/,? & /,kt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gt=/[()=,{}\[\]\/\s]/,dt=/\\(\\)?/g,Ct=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tt=/\w*$/,Fe=/^[-+]0x[0-9a-f]+$/i,qe=/^0b[01]+$/i,je=/^\[object .+?Constructor\]$/,rt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,Qe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tt=/($^)/,Dt=/['\n\r\u2028\u2029\\]/g,lt="\\ud800-\\udfff",zt="\\u0300-\\u036f",Ft="\\ufe20-\\ufe2f",_t="\\u20d0-\\u20ff",tn=zt+Ft+_t,Qt="\\u2700-\\u27bf",gn="a-z\\xdf-\\xf6\\xf8-\\xff",an="\\xac\\xb1\\xd7\\xf7",mn="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Hn="\\u2000-\\u206f",Fo=" \\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",yo="A-Z\\xc0-\\xd6\\xd8-\\xde",So="\\ufe0e\\ufe0f",$o=an+mn+Hn+Fo,mo="['’]",Jn="["+lt+"]",uo="["+$o+"]",ir="["+tn+"]",Rr="\\d+",br="["+Qt+"]",Vr="["+gn+"]",Wo="[^"+lt+$o+Rr+Qt+gn+yo+"]",wn="\\ud83c[\\udffb-\\udfff]",In="(?:"+ir+"|"+wn+")",ar="[^"+lt+"]",No="(?:\\ud83c[\\udde6-\\uddff]){2}",eo="[\\ud800-\\udbff][\\udc00-\\udfff]",Xn="["+yo+"]",Jo="\\u200d",xo="(?:"+Vr+"|"+Wo+")",Qo="(?:"+Xn+"|"+Wo+")",jo="(?:"+mo+"(?:d|ll|m|re|s|t|ve))?",lr="(?:"+mo+"(?:D|LL|M|RE|S|T|VE))?",fr=In+"?",ai="["+So+"]?",hr="(?:"+Jo+"(?:"+[ar,No,eo].join("|")+")"+ai+fr+")*",tr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xi="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Eo=ai+fr+hr,bi="(?:"+[br,No,eo].join("|")+")"+Eo,hl="(?:"+[ar+ir+"?",ir,No,eo,Jn].join("|")+")",nr=RegExp(mo,"g"),or=RegExp(ir,"g"),Ai=RegExp(wn+"(?="+wn+")|"+hl+Eo,"g"),ka=RegExp([Xn+"?"+Vr+"+"+jo+"(?="+[uo,Xn,"$"].join("|")+")",Qo+"+"+lr+"(?="+[uo,Xn+xo,"$"].join("|")+")",Xn+"?"+xo+"+"+jo,Xn+"+"+lr,xi,tr,Rr,bi].join("|"),"g"),wi=RegExp("["+Jo+lt+tn+So+"]"),Fs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ks=["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"],Zs=-1,Ui={};Ui[Me]=Ui[Pe]=Ui[Ee]=Ui[Be]=Ui[Je]=Ui[We]=Ui[Ke]=Ui[Ne]=Ui[De]=!0,Ui[Q]=Ui[le]=Ui[Ae]=Ui[te]=Ui[Te]=Ui[re]=Ui[se]=Ui[ne]=Ui[ge]=Ui[de]=Ui[he]=Ui[Se]=Ui[ze]=Ui[Ie]=Ui[pe]=!1;var fa={};fa[Q]=fa[le]=fa[Ae]=fa[Te]=fa[te]=fa[re]=fa[Me]=fa[Pe]=fa[Ee]=fa[Be]=fa[Je]=fa[ge]=fa[de]=fa[he]=fa[Se]=fa[ze]=fa[Ie]=fa[ye]=fa[We]=fa[Ke]=fa[Ne]=fa[De]=!0,fa[se]=fa[ne]=fa[pe]=!1;var Bl={À:"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"},Gl={"&":"&","<":"<",">":">",'"':""","'":"'"},qu={"&":"&","<":"<",">":">",""":'"',"'":"'"},Rc={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},mu=parseFloat,un=parseInt,$t=typeof Ac=="object"&&Ac&&Ac.Object===Object&&Ac,Bt=typeof self=="object"&&self&&self.Object===Object&&self,pn=$t||Bt||Function("return this")(),Pn=e&&!e.nodeType&&e,$e=Pn&&!0&&t&&!t.nodeType&&t,bt=$e&&$e.exports===Pn,Lt=bt&&$t.process,xt=function(){try{var vn=$e&&$e.require&&$e.require("util").types;return vn||Lt&&Lt.binding&&Lt.binding("util")}catch{}}(),jt=xt&&xt.isArrayBuffer,Kt=xt&&xt.isDate,sn=xt&&xt.isMap,yn=xt&&xt.isRegExp,An=xt&&xt.isSet,bn=xt&&xt.isTypedArray;function Ln(vn,io,Nn){switch(Nn.length){case 0:return vn.call(io);case 1:return vn.call(io,Nn[0]);case 2:return vn.call(io,Nn[0],Nn[1]);case 3:return vn.call(io,Nn[0],Nn[1],Nn[2])}return vn.apply(io,Nn)}function Yn(vn,io,Nn,Sr){for(var ui=-1,ji=vn==null?0:vn.length;++ui-1}function $i(vn,io,Nn){for(var Sr=-1,ui=vn==null?0:vn.length;++Sr-1;);return Nn}function _g(vn,io){for(var Nn=vn.length;Nn--&&_0(io,vn[Nn],0)>-1;);return Nn}function il(vn,io){for(var Nn=vn.length,Sr=0;Nn--;)vn[Nn]===io&&++Sr;return Sr}var jd=yu(Bl),wu=yu(Gl);function p5(vn){return"\\"+Rc[vn]}function wy(vn,io){return vn==null?n:vn[io]}function Ih(vn){return wi.test(vn)}function S3(vn){return Fs.test(vn)}function vy(vn){for(var io,Nn=[];!(io=vn.next()).done;)Nn.push(io.value);return Nn}function T3(vn){var io=-1,Nn=Array(vn.size);return vn.forEach(function(Sr,ui){Nn[++io]=[ui,Sr]}),Nn}function g5(vn,io){return function(Nn){return vn(io(Nn))}}function zh(vn,io){for(var Nn=-1,Sr=vn.length,ui=0,ji=[];++Nn-1}function D3(G,ee){var Re=this.__data__,et=Tp(Re,G);return et<0?(++this.size,Re.push([G,ee])):Re[et][1]=ee,this}Eh.prototype.clear=wS,Eh.prototype.delete=NA,Eh.prototype.get=vS,Eh.prototype.has=xS,Eh.prototype.set=D3;function xu(G){var ee=-1,Re=G==null?0:G.length;for(this.clear();++ee=ee?G:ee)),G}function id(G,ee,Re,et,Mt,Ot){var dn,xn=ee&d,zn=ee&f,wo=ee&p;if(Re&&(dn=Mt?Re(G,et,Mt,Ot):Re(G)),dn!==n)return dn;if(!As(G))return G;var bo=Zi(G);if(bo){if(dn=bte(G),!xn)return S0(G,dn)}else{var zo=Q0(G),Tr=zo==ne||zo==fe;if(cm(G))return e4(G,xn);if(zo==he||zo==Q||Tr&&!Mt){if(dn=zn||Tr?{}:TU(G),!xn)return zn?U5(G,GA(dn,G)):n4(G,VA(dn,G))}else{if(!fa[zo])return Mt?G:{};dn=Ste(G,zo,xn)}}Ot||(Ot=new Mc);var ei=Ot.get(G);if(ei)return ei;Ot.set(G,dn),_S(G)?G.forEach(function(Ii){dn.add(id(Ii,ee,Re,Ii,G,Ot))}):Aj(G)&&G.forEach(function(Ii,_a){dn.set(_a,id(Ii,ee,Re,_a,G,Ot))});var Mi=wo?zn?Ta:Oa:zn?H0:R0,Pa=bo?n:Mi(G);return Wn(Pa||G,function(Ii,_a){Pa&&(_a=Ii,Ii=G[_a]),rd(dn,_a,id(Ii,ee,Re,_a,G,Ot))}),dn}function XA(G){var ee=R0(G);return function(Re){return F3(Re,G,ee)}}function F3(G,ee,Re){var et=Re.length;if(G==null)return!et;for(G=Si(G);et--;){var Mt=Re[et],Ot=ee[Mt],dn=G[Mt];if(dn===n&&!(Mt in G)||!Ot(dn))return!1}return!0}function JA(G,ee,Re){if(typeof G!="function")throw new G0(a);return m7(function(){G.apply(n,Re)},ee)}function Qg(G,ee,Re,et){var Mt=-1,Ot=li,dn=!0,xn=G.length,zn=[],wo=ee.length;if(!xn)return zn;Re&&(ee=Or(ee,Au(Re))),et?(Ot=$i,dn=!1):ee.length>=r&&(Ot=ec,dn=!1,ee=new S1(ee));e:for(;++MtMt?0:Mt+Re),et=et===n||et>Mt?Mt:Gi(et),et<0&&(et+=Mt),et=Re>et?0:GS(et);Re0&&Re(xn)?ee>1?Ic(xn,ee-1,Re,et,Mt):ya(Mt,xn):et||(Mt[Mt.length]=xn)}return Mt}var z5=o4(),_d=o4(!0);function bu(G,ee){return G&&z5(G,ee,R0)}function D5(G,ee){return G&&_d(G,ee,R0)}function Vd(G,ee){return Ko(ee,function(Re){return um(G[Re])})}function Lf(G,ee){ee=H1(ee,G);for(var Re=0,et=ee.length;G!=null&&Reee}function Zg(G,ee){return G!=null&&Ya.call(G,ee)}function qA(G,ee){return G!=null&&ee in Si(G)}function Hy(G,ee,Re){return G>=X0(ee,Re)&&G=120&&bo.length>=120)?new S1(dn&&bo):n}bo=G[0];var zo=-1,Tr=xn[0];e:for(;++zo-1;)xn!==G&&td.call(xn,zn,1),td.call(G,zn,1);return G}function x0(G,ee){for(var Re=G?ee.length:0,et=Re-1;Re--;){var Mt=ee[Re];if(Re==et||Mt!==Ot){var Ot=Mt;jy(Mt)?td.call(G,Mt,1):ky(G,Mt)}}return G}function Wf(G,ee){return G+P5(M3()*(ee-G+1))}function sd(G,ee,Re,et){for(var Mt=-1,Ot=Kc(T5((ee-G)/(Re||1)),0),dn=Nn(Ot);Ot--;)dn[et?Ot:++Mt]=G,G+=Re;return dn}function nm(G,ee){var Re="";if(!G||ee<1||ee>F)return Re;do ee%2&&(Re+=G),ee=P5(ee/2),ee&&(G+=G);while(ee);return Re}function Zr(G,ee){return $M(KM(G,ee,Pu),G+"")}function f7(G){return $g(Yy(G))}function j3(G,ee){var Re=Yy(G);return CS(Re,v0(ee,0,Re.length))}function Ey(G,ee,Re,et){if(!As(G))return G;ee=H1(ee,G);for(var Mt=-1,Ot=ee.length,dn=Ot-1,xn=G;xn!=null&&++MtMt?0:Mt+ee),Re=Re>Mt?Mt:Re,Re<0&&(Re+=Mt),Mt=ee>Re?0:Re-ee>>>0,ee>>>=0;for(var Ot=Nn(Mt);++et>>1,dn=G[Ot];dn!==null&&!P0(dn)&&(Re?dn<=ee:dn=r){var wo=ee?null:T0(G);if(wo)return P3(wo);dn=!1,Mt=ec,zn=new S1}else zn=ee?[]:xn;e:for(;++et=et?G:q0(G,ee,Re)}var Y3=S5||function(G){return pn.clearTimeout(G)};function e4(G,ee){if(ee)return G.slice();var Re=G.length,et=Jg?Jg(Re):new G.constructor(Re);return G.copy(et),et}function im(G){var ee=new G.constructor(G.byteLength);return new v5(ee).set(new v5(G)),ee}function t4(G,ee){var Re=ee?im(G.buffer):G.buffer;return new G.constructor(Re,G.byteOffset,G.byteLength)}function Uf(G){var ee=new G.constructor(G.source,tt.exec(G));return ee.lastIndex=G.lastIndex,ee}function kh(G){return Dh?Si(Dh.call(G)):{}}function am(G,ee){var Re=ee?im(G.buffer):G.buffer;return new G.constructor(Re,G.byteOffset,G.length)}function Jd(G,ee){if(G!==ee){var Re=G!==n,et=G===null,Mt=G===G,Ot=P0(G),dn=ee!==n,xn=ee===null,zn=ee===ee,wo=P0(ee);if(!xn&&!wo&&!Ot&&G>ee||Ot&&dn&&zn&&!xn&&!wo||et&&dn&&zn||!Re&&zn||!Mt)return 1;if(!et&&!Ot&&!wo&&G=xn)return zn;var wo=Re[et];return zn*(wo=="desc"?-1:1)}}return G.index-ee.index}function lm(G,ee,Re,et){for(var Mt=-1,Ot=G.length,dn=Re.length,xn=-1,zn=ee.length,wo=Kc(Ot-dn,0),bo=Nn(zn+wo),zo=!et;++xn1?Re[Mt-1]:n,dn=Mt>2?Re[2]:n;for(Ot=G.length>3&&typeof Ot=="function"?(Mt--,Ot):n,dn&&$d(Re[0],Re[1],dn)&&(Ot=Mt<3?n:Ot,Mt=1),ee=Si(ee);++et-1?Mt[Ot?ee[dn]:dn]:n}}function Ge(G){return oa(function(ee){var Re=ee.length,et=Re,Mt=J0.prototype.thru;for(G&&ee.reverse();et--;){var Ot=ee[et];if(typeof Ot!="function")throw new G0(a);if(Mt&&!dn&&r4(Ot)=="wrapper")var dn=new J0([],!0)}for(et=dn?et:Re;++et1&&sl.reverse(),bo&&zn<_a&&(sl.length=zn),this&&this!==pn&&this instanceof Ii&&(q3=Pa||K(q3)),q3.apply(_y,sl)}return Ii}function Zt(G,ee){return function(Re,et){return em(Re,G,ee(et),{})}}function Sn(G,ee){return function(Re,et){var Mt;if(Re===n&&et===n)return ee;if(Re!==n&&(Mt=Re),et!==n){if(Mt===n)return et;typeof Re=="string"||typeof et=="string"?(Re=b0(Re),et=b0(et)):(Re=W5(Re),et=W5(et)),Mt=G(Re,et)}return Mt}}function Qn(G){return oa(function(ee){return ee=Or(ee,Au(gi())),Zr(function(Re){var et=this;return G(ee,function(Mt){return Ln(Mt,et,Re)})})})}function Bo(G,ee){ee=ee===n?" ":b0(ee);var Re=ee.length;if(Re<2)return Re?nm(ee,G):ee;var et=nm(ee,T5(G/Xc(ee)));return Ih(ee)?M1(ms(et),0,G).join(""):et.slice(0,G)}function zr(G,ee,Re,et){var Mt=ee&w,Ot=K(G);function dn(){for(var xn=-1,zn=arguments.length,wo=-1,bo=et.length,zo=Nn(bo+zn),Tr=this&&this!==pn&&this instanceof dn?Ot:G;++woxn))return!1;var wo=Ot.get(G),bo=Ot.get(ee);if(wo&&bo)return wo==ee&&bo==G;var zo=-1,Tr=!0,ei=Re&y?new S1:n;for(Ot.set(G,ee),Ot.set(ee,G);++zo1?"& ":"")+ee[et],ee=ee.join(Re>2?", ":" "),G.replace(Ut,`{ /* [wrapped with `+ee+`] */ -`)}function Pte(G){return Zi(G)||B5(G)||!!(b5&&G&&G[b5])}function jy(G,ee){var Re=typeof G;return ee=ee??F,!!ee&&(Re=="number"||Re!="symbol"&&mt.test(G))&&G>-1&&G%1==0&&G0){if(++ee>=E)return arguments[0]}else ee=0;return G.apply(n,arguments)}}function CS(G,ee){var Re=-1,et=G.length,Mt=et-1;for(ee=ee===n?et:ee;++Re1?G[ee-1]:n;return Re=typeof Re=="function"?(G.pop(),Re):n,KU(G,Re)});function X3(G){var ee=Wt(G);return ee.__chain__=!0,ee}function Qte(G,ee){return ee(G),G}function By(G,ee){return ee(G)}var Zte=oa(function(G){var ee=G.length,Re=ee?G[0]:0,et=this.__wrapped__,Mt=function(Ot){return M5(Ot,G)};return ee>1||this.__actions__.length||!(et instanceof di)||!jy(Re)?this.thru(Mt):(et=et.slice(Re,+Re+(ee?1:0)),et.__actions__.push({func:By,args:[Mt],thisArg:n}),new J0(et,this.__chain__).thru(function(Ot){return ee&&!Ot.length&&Ot.push(n),Ot}))});function cI(){return X3(this)}function ene(){return new J0(this.value(),this.__chain__)}function uI(){this.__values__===n&&(this.__values__=LI(this.value()));var G=this.__index__>=this.__values__.length,ee=G?n:this.__values__[this.__index__++];return{done:G,value:ee}}function tne(){return this}function nne(G){for(var ee,Re=this;Re instanceof z3;){var et=ZM(Re);et.__index__=0,et.__values__=n,ee?Mt.__wrapped__=et:ee=et;var Mt=et;Re=Re.__wrapped__}return Mt.__wrapped__=G,ee}function one(){var G=this.__wrapped__;if(G instanceof di){var ee=G;return this.__actions__.length&&(ee=new di(this)),ee=ee.reverse(),ee.__actions__.push({func:By,args:[y7],thisArg:n}),new J0(ee,this.__chain__)}return this.thru(y7)}function ES(){return om(this.__wrapped__,this.__actions__)}var FS=j5(function(G,ee,Re){Ya.call(G,Re)?++G[Re]:Fh(G,Re,1)});function $U(G,ee,Re){var et=Zi(G)?qn:KA;return Re&&$d(G,ee,Re)&&(ee=n),et(G,gi(ee,3))}function rne(G,ee){var Re=Zi(G)?Ko:T1;return Re(G,gi(ee,3))}var QU=Le(HS),dI=Le(MS);function ZU(G,ee){return Ic(LS(G,ee),1)}function fI(G,ee){return Ic(LS(G,ee),N)}function hI(G,ee,Re){return Re=Re===n?1:Gi(Re),Ic(LS(G,ee),Re)}function pI(G,ee){var Re=Zi(G)?Wn:ad;return Re(G,gi(ee,3))}function gI(G,ee){var Re=Zi(G)?oo:I5;return Re(G,gi(ee,3))}var ine=j5(function(G,ee,Re){Ya.call(G,Re)?G[Re].push(ee):Fh(G,Re,[ee])});function ej(G,ee,Re,et){G=cd(G)?G:Yy(G),Re=Re&&!et?Gi(Re):0;var Mt=G.length;return Re<0&&(Re=Kc(Mt+Re,0)),VS(G)?Re<=Mt&&G.indexOf(ee,Re)>-1:!!Mt&&_0(G,ee,Re)>-1}var kS=Zr(function(G,ee,Re){var et=-1,Mt=typeof ee=="function",Ot=cd(G)?Nn(G.length):[];return ad(G,function(dn){Ot[++et]=Mt?Ln(ee,dn,Re):Kl(dn,ee,Re)}),Ot}),ane=j5(function(G,ee,Re){Fh(G,Re,ee)});function LS(G,ee){var Re=Zi(G)?Or:P1;return Re(G,gi(ee,3))}function lne(G,ee,Re,et){return G==null?[]:(Zi(ee)||(ee=ee==null?[]:[ee]),Re=et?n:Re,Zi(Re)||(Re=Re==null?[]:[Re]),k5(G,ee,Re))}var tj=j5(function(G,ee,Re){G[Re?0:1].push(ee)},function(){return[[],[]]});function nj(G,ee,Re){var et=Zi(G)?Ps:y1,Mt=arguments.length<3;return et(G,gi(ee,4),Re,Mt,ad)}function mI(G,ee,Re){var et=Zi(G)?$u:y1,Mt=arguments.length<3;return et(G,gi(ee,4),Re,Mt,I5)}function sne(G,ee){var Re=Zi(G)?Ko:T1;return Re(G,c4(gi(ee,3)))}function cne(G){var ee=Zi(G)?$g:f7;return ee(G)}function yI(G,ee,Re){(Re?$d(G,ee,Re):ee===n)?ee=1:ee=Gi(ee);var et=Zi(G)?H5:j3;return et(G,ee)}function une(G){var ee=Zi(G)?d7:QA;return ee(G)}function AI(G){if(G==null)return 0;if(cd(G))return VS(G)?Xc(G):G.length;var ee=Q0(G);return ee==ge||ee==ze?G.size:ql(G).length}function dne(G,ee,Re){var et=Zi(G)?Qu:B3;return Re&&$d(G,ee,Re)&&(ee=n),et(G,gi(ee,3))}var WS=Zr(function(G,ee){if(G==null)return[];var Re=ee.length;return Re>1&&$d(G,ee[0],ee[1])?ee=[]:Re>2&&$d(ee[0],ee[1],ee[2])&&(ee=[ee[0]]),k5(G,Ic(ee,1),[])}),b7=Ty||function(){return pn.Date.now()};function oj(G,ee){if(typeof ee!="function")throw new G0(a);return G=Gi(G),function(){if(--G<1)return ee.apply(this,arguments)}}function wI(G,ee,Re){return ee=Re?n:ee,ee=G&&ee==null?G.length:ee,kn(G,x,n,n,n,n,ee)}function S7(G,ee){var Re;if(typeof ee!="function")throw new G0(a);return G=Gi(G),function(){return--G>0&&(Re=ee.apply(this,arguments)),G<=1&&(ee=n),Re}}var T7=Zr(function(G,ee,Re){var et=w;if(Re.length){var Mt=zh(Re,i4(T7));et|=T}return kn(G,et,ee,Re,Mt)}),rj=Zr(function(G,ee,Re){var et=w|b;if(Re.length){var Mt=zh(Re,i4(rj));et|=T}return kn(ee,et,G,Re,Mt)});function ij(G,ee,Re){ee=Re?n:ee;var et=kn(G,P,n,n,n,n,n,ee);return et.placeholder=ij.placeholder,et}function vI(G,ee,Re){ee=Re?n:ee;var et=kn(G,v,n,n,n,n,n,ee);return et.placeholder=vI.placeholder,et}function NS(G,ee,Re){var et,Mt,Ot,dn,xn,zn,wo=0,bo=!1,zo=!1,Tr=!0;if(typeof G!="function")throw new G0(a);ee=$c(ee)||0,As(Re)&&(bo=!!Re.leading,zo="maxWait"in Re,Ot=zo?Kc($c(Re.maxWait)||0,ee):Ot,Tr="trailing"in Re?!!Re.trailing:Tr);function ei(M0){var _y=et,q3=Mt;return et=Mt=n,wo=M0,dn=G.apply(q3,_y),dn}function Mi(M0){return wo=M0,xn=m7(_a,ee),bo?ei(M0):dn}function Pa(M0){var _y=M0-zn,q3=M0-wo,M6e=ee-_y;return zo?X0(M6e,Ot-q3):M6e}function Ii(M0){var _y=M0-zn,q3=M0-wo;return zn===n||_y>=ee||_y<0||zo&&q3>=Ot}function _a(){var M0=b7();if(Ii(M0))return sl(M0);xn=m7(_a,Pa(M0))}function sl(M0){return xn=n,Tr&&et?ei(M0):(et=Mt=n,dn)}function D1(){xn!==n&&Y3(xn),wo=0,et=zn=Mt=xn=n}function Nh(){return xn===n?dn:sl(b7())}function E1(){var M0=b7(),_y=Ii(M0);if(et=arguments,Mt=this,zn=M0,_y){if(xn===n)return Mi(zn);if(zo)return Y3(xn),xn=m7(_a,ee),ei(zn)}return xn===n&&(xn=m7(_a,ee)),dn}return E1.cancel=D1,E1.flush=Nh,E1}var aj=Zr(function(G,ee){return JA(G,1,ee)}),lj=Zr(function(G,ee,Re){return JA(G,$c(ee)||0,Re)});function xI(G){return kn(G,R)}function P7(G,ee){if(typeof G!="function"||ee!=null&&typeof ee!="function")throw new G0(a);var Re=function(){var et=arguments,Mt=ee?ee.apply(this,et):et[0],Ot=Re.cache;if(Ot.has(Mt))return Ot.get(Mt);var dn=G.apply(this,et);return Re.cache=Ot.set(Mt,dn)||Ot,dn};return Re.cache=new(P7.Cache||xu),Re}P7.Cache=xu;function c4(G){if(typeof G!="function")throw new G0(a);return function(){var ee=arguments;switch(ee.length){case 0:return!G.call(this);case 1:return!G.call(this,ee[0]);case 2:return!G.call(this,ee[0],ee[1]);case 3:return!G.call(this,ee[0],ee[1],ee[2])}return!G.apply(this,ee)}}function US(G){return S7(2,G)}var sj=p7(function(G,ee){ee=ee.length==1&&Zi(ee[0])?Or(ee[0],Au(gi())):Or(Ic(ee,1),Au(gi()));var Re=ee.length;return Zr(function(et){for(var Mt=-1,Ot=X0(et.length,Re);++Mt=ee}),B5=Ci(function(){return arguments}())?Ci:function(G){return Ec(G)&&Ya.call(G,"callee")&&!x5.call(G,"callee")},Zi=Nn.isArray,mne=jt?Au(jt):zc;function cd(G){return G!=null&&BS(G.length)&&!um(G)}function Dc(G){return Ec(G)&&cd(G)}function d4(G){return G===!0||G===!1||Ec(G)&&Cs(G)==te}var cm=zA||bl,yne=Kt?Au(Kt):al;function jS(G){return Ec(G)&&G.nodeType===1&&!H7(G)}function CI(G){if(G==null)return!0;if(cd(G)&&(Zi(G)||typeof G=="string"||typeof G.splice=="function"||cm(G)||dm(G)||B5(G)))return!G.length;var ee=Q0(G);if(ee==ge||ee==ze)return!G.size;if(g7(G))return!ql(G).length;for(var Re in G)if(Ya.call(G,Re))return!1;return!0}function Ane(G,ee){return js(G,ee)}function RI(G,ee,Re){Re=typeof Re=="function"?Re:n;var et=Re?Re(G,ee):n;return et===n?js(G,ee,n,Re):!!et}function C7(G){if(!Ec(G))return!1;var ee=Cs(G);return ee==se||ee==ae||typeof G.message=="string"&&typeof G.name=="string"&&!H7(G)}function gj(G){return typeof G=="number"&&n7(G)}function um(G){if(!As(G))return!1;var ee=Cs(G);return ee==ne||ee==fe||ee==q||ee==He}function mj(G){return typeof G=="number"&&G==Gi(G)}function BS(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=F}function As(G){var ee=typeof G;return G!=null&&(ee=="object"||ee=="function")}function Ec(G){return G!=null&&typeof G=="object"}var yj=sn?Au(sn):Gd;function Wh(G,ee){return G===ee||nc(G,ee,OM(ee))}function HI(G,ee,Re){return Re=typeof Re=="function"?Re:n,nc(G,ee,OM(ee),Re)}function MI(G){return YS(G)&&G!=+G}function II(G){if(Hte(G))throw new ui(i);return Cp(G)}function R7(G){return G===null}function zI(G){return G==null}function YS(G){return typeof G=="number"||Ec(G)&&Cs(G)==de}function H7(G){if(!Ec(G)||Cs(G)!=he)return!1;var ee=tc(G);if(ee===null)return!0;var Re=Ya.call(ee,"constructor")&&ee.constructor;return typeof Re=="function"&&Re instanceof Re&&y5.call(Re)==Xg}var OS=yn?Au(yn):ld;function DI(G){return mj(G)&&G>=-F&&G<=F}var _S=An?Au(An):k3;function VS(G){return typeof G=="string"||!Zi(G)&&Ec(G)&&Cs(G)==Ie}function P0(G){return typeof G=="symbol"||Ec(G)&&Cs(G)==ye}var dm=bn?Au(bn):L3;function Aj(G){return G===n}function wj(G){return Ec(G)&&Q0(G)==pe}function EI(G){return Ec(G)&&Cs(G)==ve}var FI=Gr(W3),kI=Gr(function(G,ee){return G<=ee});function LI(G){if(!G)return[];if(cd(G))return VS(G)?ms(G):S0(G);if(Yd&&G[Yd])return vy(G[Yd]());var ee=Q0(G),Re=ee==ge?T3:ee==ze?P3:Yy;return Re(G)}function ud(G){if(!G)return G===0?G:0;if(G=$c(G),G===N||G===-N){var ee=G<0?-1:1;return ee*U}return G===G?G:0}function Gi(G){var ee=ud(G),Re=ee%1;return ee===ee?Re?ee-Re:ee:0}function GS(G){return G?v0(Gi(G),0,B):0}function $c(G){if(typeof G=="number")return G;if(P0(G))return O;if(As(G)){var ee=typeof G.valueOf=="function"?G.valueOf():G;G=As(ee)?ee+"":ee}if(typeof G!="string")return G===0?G:+G;G=b3(G);var Re=qe.test(G);return Re||rt.test(G)?un(G.slice(2),Re?2:8):Fe.test(G)?O:+G}function vj(G){return Kd(G,H0(G))}function wne(G){return G?v0(Gi(G),-F,F):G===0?G:0}function ll(G){return G==null?"":b0(G)}var M7=Rp(function(G,ee){if(g7(ee)||cd(ee)){Kd(ee,R0(ee),G);return}for(var Re in ee)Ya.call(ee,Re)&&rd(G,Re,ee[Re])}),WI=Rp(function(G,ee){Kd(ee,H0(ee),G)}),I7=Rp(function(G,ee,Re,et){Kd(ee,H0(ee),G,et)}),xj=Rp(function(G,ee,Re,et){Kd(ee,R0(ee),G,et)}),bj=oa(M5);function C0(G,ee){var Re=b1(G);return ee==null?Re:VA(Re,ee)}var vne=Zr(function(G,ee){G=Si(G);var Re=-1,et=ee.length,Mt=et>2?ee[2]:n;for(Mt&&$d(ee[0],ee[1],Mt)&&(et=1);++Re1),Ot}),Kd(G,Ta(G),Re),et&&(Re=id(Re,d|f|p,xr));for(var Mt=ee.length;Mt--;)ky(Re,ee[Mt]);return Re});function Rne(G,ee){return Mj(G,c4(gi(ee)))}var _I=oa(function(G,ee){return G==null?{}:zy(G,ee)});function Mj(G,ee){if(G==null)return{};var Re=Or(Ta(G),function(et){return[et]});return ee=gi(ee),Dy(G,Re,function(et,Mt){return ee(et,Mt[0])})}function Ij(G,ee,Re){ee=H1(ee,G);var et=-1,Mt=ee.length;for(Mt||(Mt=1,G=n);++etee){var et=G;G=ee,ee=et}if(Re||G%1||ee%1){var Mt=M3();return X0(G+Mt*(ee-G+mu("1e-"+((Mt+"").length-1))),ee)}return Wf(G,ee)}var h4=J(function(G,ee,Re){return ee=ee.toLowerCase(),G+(Re?XS(ee):ee)});function XS(G){return Y5(ll(G).toLowerCase())}function JS(G){return G=ll(G),G&&G.replace(Qe,jd).replace(or,"")}function Ej(G,ee,Re){G=ll(G),ee=b0(ee);var et=G.length;Re=Re===n?et:v0(Gi(Re),0,et);var Mt=Re;return Re-=ee.length,Re>=0&&G.slice(Re,Mt)==ee}function KS(G){return G=ll(G),G&&Xe.test(G)?G.replace(yt,wu):G}function VI(G){return G=ll(G),G&&St.test(G)?G.replace(Ze,"\\$&"):G}var GI=J(function(G,ee,Re){return G+(Re?"-":"")+ee.toLowerCase()}),XI=J(function(G,ee,Re){return G+(Re?" ":"")+ee.toLowerCase()}),JI=_3("toLowerCase");function KI(G,ee,Re){G=ll(G),ee=Gi(ee);var et=ee?Xc(G):0;if(!ee||et>=ee)return G;var Mt=(ee-et)/2;return Bo(P5(Mt),Re)+G+Bo(T5(Mt),Re)}function zne(G,ee,Re){G=ll(G),ee=Gi(ee);var et=ee?Xc(G):0;return ee&&et>>0,Re?(G=ll(G),G&&(typeof ee=="string"||ee!=null&&!OS(ee))&&(ee=b0(ee),!ee&&Ih(G))?M1(ms(G),0,Re):G.split(ee,Re)):[]}var Ene=J(function(G,ee,Re){return G+(Re?" ":"")+Y5(ee)});function Wj(G,ee,Re){return G=ll(G),Re=Re==null?0:v0(Gi(Re),0,G.length),ee=b0(ee),G.slice(Re,Re+ee.length)==ee}function Fne(G,ee,Re){var et=Wt.templateSettings;Re&&$d(G,ee,Re)&&(ee=n),G=ll(G),ee=I7({},ee,et,Rn);var Mt=I7({},ee.imports,et.imports,Rn),Ot=R0(Mt),dn=Ls(Mt,Ot),xn,zn,wo=0,bo=ee.interpolate||Tt,zo="__p += '",Tr=Jc((ee.escape||Tt).source+"|"+bo.source+"|"+(bo===ot?Ct:Tt).source+"|"+(ee.evaluate||Tt).source+"|$","g"),ei="//# sourceURL="+(Ya.call(ee,"sourceURL")?(ee.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Zs+"]")+` +`)}function Pte(G){return Zi(G)||B5(G)||!!(b5&&G&&G[b5])}function jy(G,ee){var Re=typeof G;return ee=ee??F,!!ee&&(Re=="number"||Re!="symbol"&&mt.test(G))&&G>-1&&G%1==0&&G0){if(++ee>=E)return arguments[0]}else ee=0;return G.apply(n,arguments)}}function CS(G,ee){var Re=-1,et=G.length,Mt=et-1;for(ee=ee===n?et:ee;++Re1?G[ee-1]:n;return Re=typeof Re=="function"?(G.pop(),Re):n,qU(G,Re)});function X3(G){var ee=Wt(G);return ee.__chain__=!0,ee}function Qte(G,ee){return ee(G),G}function By(G,ee){return ee(G)}var Zte=oa(function(G){var ee=G.length,Re=ee?G[0]:0,et=this.__wrapped__,Mt=function(Ot){return M5(Ot,G)};return ee>1||this.__actions__.length||!(et instanceof di)||!jy(Re)?this.thru(Mt):(et=et.slice(Re,+Re+(ee?1:0)),et.__actions__.push({func:By,args:[Mt],thisArg:n}),new J0(et,this.__chain__).thru(function(Ot){return ee&&!Ot.length&&Ot.push(n),Ot}))});function cI(){return X3(this)}function ene(){return new J0(this.value(),this.__chain__)}function uI(){this.__values__===n&&(this.__values__=LI(this.value()));var G=this.__index__>=this.__values__.length,ee=G?n:this.__values__[this.__index__++];return{done:G,value:ee}}function tne(){return this}function nne(G){for(var ee,Re=this;Re instanceof z3;){var et=ZM(Re);et.__index__=0,et.__values__=n,ee?Mt.__wrapped__=et:ee=et;var Mt=et;Re=Re.__wrapped__}return Mt.__wrapped__=G,ee}function one(){var G=this.__wrapped__;if(G instanceof di){var ee=G;return this.__actions__.length&&(ee=new di(this)),ee=ee.reverse(),ee.__actions__.push({func:By,args:[y7],thisArg:n}),new J0(ee,this.__chain__)}return this.thru(y7)}function ES(){return om(this.__wrapped__,this.__actions__)}var FS=j5(function(G,ee,Re){Ya.call(G,Re)?++G[Re]:Fh(G,Re,1)});function QU(G,ee,Re){var et=Zi(G)?qn:KA;return Re&&$d(G,ee,Re)&&(ee=n),et(G,gi(ee,3))}function rne(G,ee){var Re=Zi(G)?Ko:T1;return Re(G,gi(ee,3))}var ZU=Le(HS),dI=Le(MS);function ej(G,ee){return Ic(LS(G,ee),1)}function fI(G,ee){return Ic(LS(G,ee),N)}function hI(G,ee,Re){return Re=Re===n?1:Gi(Re),Ic(LS(G,ee),Re)}function pI(G,ee){var Re=Zi(G)?Wn:ad;return Re(G,gi(ee,3))}function gI(G,ee){var Re=Zi(G)?oo:I5;return Re(G,gi(ee,3))}var ine=j5(function(G,ee,Re){Ya.call(G,Re)?G[Re].push(ee):Fh(G,Re,[ee])});function tj(G,ee,Re,et){G=cd(G)?G:Yy(G),Re=Re&&!et?Gi(Re):0;var Mt=G.length;return Re<0&&(Re=Kc(Mt+Re,0)),VS(G)?Re<=Mt&&G.indexOf(ee,Re)>-1:!!Mt&&_0(G,ee,Re)>-1}var kS=Zr(function(G,ee,Re){var et=-1,Mt=typeof ee=="function",Ot=cd(G)?Nn(G.length):[];return ad(G,function(dn){Ot[++et]=Mt?Ln(ee,dn,Re):Kl(dn,ee,Re)}),Ot}),ane=j5(function(G,ee,Re){Fh(G,Re,ee)});function LS(G,ee){var Re=Zi(G)?Or:P1;return Re(G,gi(ee,3))}function lne(G,ee,Re,et){return G==null?[]:(Zi(ee)||(ee=ee==null?[]:[ee]),Re=et?n:Re,Zi(Re)||(Re=Re==null?[]:[Re]),k5(G,ee,Re))}var nj=j5(function(G,ee,Re){G[Re?0:1].push(ee)},function(){return[[],[]]});function oj(G,ee,Re){var et=Zi(G)?Ps:y1,Mt=arguments.length<3;return et(G,gi(ee,4),Re,Mt,ad)}function mI(G,ee,Re){var et=Zi(G)?$u:y1,Mt=arguments.length<3;return et(G,gi(ee,4),Re,Mt,I5)}function sne(G,ee){var Re=Zi(G)?Ko:T1;return Re(G,c4(gi(ee,3)))}function cne(G){var ee=Zi(G)?$g:f7;return ee(G)}function yI(G,ee,Re){(Re?$d(G,ee,Re):ee===n)?ee=1:ee=Gi(ee);var et=Zi(G)?H5:j3;return et(G,ee)}function une(G){var ee=Zi(G)?d7:QA;return ee(G)}function AI(G){if(G==null)return 0;if(cd(G))return VS(G)?Xc(G):G.length;var ee=Q0(G);return ee==ge||ee==ze?G.size:ql(G).length}function dne(G,ee,Re){var et=Zi(G)?Qu:B3;return Re&&$d(G,ee,Re)&&(ee=n),et(G,gi(ee,3))}var WS=Zr(function(G,ee){if(G==null)return[];var Re=ee.length;return Re>1&&$d(G,ee[0],ee[1])?ee=[]:Re>2&&$d(ee[0],ee[1],ee[2])&&(ee=[ee[0]]),k5(G,Ic(ee,1),[])}),b7=Ty||function(){return pn.Date.now()};function rj(G,ee){if(typeof ee!="function")throw new G0(a);return G=Gi(G),function(){if(--G<1)return ee.apply(this,arguments)}}function wI(G,ee,Re){return ee=Re?n:ee,ee=G&&ee==null?G.length:ee,kn(G,x,n,n,n,n,ee)}function S7(G,ee){var Re;if(typeof ee!="function")throw new G0(a);return G=Gi(G),function(){return--G>0&&(Re=ee.apply(this,arguments)),G<=1&&(ee=n),Re}}var T7=Zr(function(G,ee,Re){var et=w;if(Re.length){var Mt=zh(Re,i4(T7));et|=T}return kn(G,et,ee,Re,Mt)}),ij=Zr(function(G,ee,Re){var et=w|b;if(Re.length){var Mt=zh(Re,i4(ij));et|=T}return kn(ee,et,G,Re,Mt)});function aj(G,ee,Re){ee=Re?n:ee;var et=kn(G,P,n,n,n,n,n,ee);return et.placeholder=aj.placeholder,et}function vI(G,ee,Re){ee=Re?n:ee;var et=kn(G,v,n,n,n,n,n,ee);return et.placeholder=vI.placeholder,et}function NS(G,ee,Re){var et,Mt,Ot,dn,xn,zn,wo=0,bo=!1,zo=!1,Tr=!0;if(typeof G!="function")throw new G0(a);ee=$c(ee)||0,As(Re)&&(bo=!!Re.leading,zo="maxWait"in Re,Ot=zo?Kc($c(Re.maxWait)||0,ee):Ot,Tr="trailing"in Re?!!Re.trailing:Tr);function ei(M0){var _y=et,q3=Mt;return et=Mt=n,wo=M0,dn=G.apply(q3,_y),dn}function Mi(M0){return wo=M0,xn=m7(_a,ee),bo?ei(M0):dn}function Pa(M0){var _y=M0-zn,q3=M0-wo,I6e=ee-_y;return zo?X0(I6e,Ot-q3):I6e}function Ii(M0){var _y=M0-zn,q3=M0-wo;return zn===n||_y>=ee||_y<0||zo&&q3>=Ot}function _a(){var M0=b7();if(Ii(M0))return sl(M0);xn=m7(_a,Pa(M0))}function sl(M0){return xn=n,Tr&&et?ei(M0):(et=Mt=n,dn)}function D1(){xn!==n&&Y3(xn),wo=0,et=zn=Mt=xn=n}function Nh(){return xn===n?dn:sl(b7())}function E1(){var M0=b7(),_y=Ii(M0);if(et=arguments,Mt=this,zn=M0,_y){if(xn===n)return Mi(zn);if(zo)return Y3(xn),xn=m7(_a,ee),ei(zn)}return xn===n&&(xn=m7(_a,ee)),dn}return E1.cancel=D1,E1.flush=Nh,E1}var lj=Zr(function(G,ee){return JA(G,1,ee)}),sj=Zr(function(G,ee,Re){return JA(G,$c(ee)||0,Re)});function xI(G){return kn(G,R)}function P7(G,ee){if(typeof G!="function"||ee!=null&&typeof ee!="function")throw new G0(a);var Re=function(){var et=arguments,Mt=ee?ee.apply(this,et):et[0],Ot=Re.cache;if(Ot.has(Mt))return Ot.get(Mt);var dn=G.apply(this,et);return Re.cache=Ot.set(Mt,dn)||Ot,dn};return Re.cache=new(P7.Cache||xu),Re}P7.Cache=xu;function c4(G){if(typeof G!="function")throw new G0(a);return function(){var ee=arguments;switch(ee.length){case 0:return!G.call(this);case 1:return!G.call(this,ee[0]);case 2:return!G.call(this,ee[0],ee[1]);case 3:return!G.call(this,ee[0],ee[1],ee[2])}return!G.apply(this,ee)}}function US(G){return S7(2,G)}var cj=p7(function(G,ee){ee=ee.length==1&&Zi(ee[0])?Or(ee[0],Au(gi())):Or(Ic(ee,1),Au(gi()));var Re=ee.length;return Zr(function(et){for(var Mt=-1,Ot=X0(et.length,Re);++Mt=ee}),B5=Ci(function(){return arguments}())?Ci:function(G){return Ec(G)&&Ya.call(G,"callee")&&!x5.call(G,"callee")},Zi=Nn.isArray,mne=jt?Au(jt):zc;function cd(G){return G!=null&&BS(G.length)&&!um(G)}function Dc(G){return Ec(G)&&cd(G)}function d4(G){return G===!0||G===!1||Ec(G)&&Cs(G)==te}var cm=zA||bl,yne=Kt?Au(Kt):al;function jS(G){return Ec(G)&&G.nodeType===1&&!H7(G)}function CI(G){if(G==null)return!0;if(cd(G)&&(Zi(G)||typeof G=="string"||typeof G.splice=="function"||cm(G)||dm(G)||B5(G)))return!G.length;var ee=Q0(G);if(ee==ge||ee==ze)return!G.size;if(g7(G))return!ql(G).length;for(var Re in G)if(Ya.call(G,Re))return!1;return!0}function Ane(G,ee){return js(G,ee)}function RI(G,ee,Re){Re=typeof Re=="function"?Re:n;var et=Re?Re(G,ee):n;return et===n?js(G,ee,n,Re):!!et}function C7(G){if(!Ec(G))return!1;var ee=Cs(G);return ee==se||ee==ae||typeof G.message=="string"&&typeof G.name=="string"&&!H7(G)}function mj(G){return typeof G=="number"&&n7(G)}function um(G){if(!As(G))return!1;var ee=Cs(G);return ee==ne||ee==fe||ee==q||ee==He}function yj(G){return typeof G=="number"&&G==Gi(G)}function BS(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=F}function As(G){var ee=typeof G;return G!=null&&(ee=="object"||ee=="function")}function Ec(G){return G!=null&&typeof G=="object"}var Aj=sn?Au(sn):Gd;function Wh(G,ee){return G===ee||nc(G,ee,OM(ee))}function HI(G,ee,Re){return Re=typeof Re=="function"?Re:n,nc(G,ee,OM(ee),Re)}function MI(G){return YS(G)&&G!=+G}function II(G){if(Hte(G))throw new ui(i);return Cp(G)}function R7(G){return G===null}function zI(G){return G==null}function YS(G){return typeof G=="number"||Ec(G)&&Cs(G)==de}function H7(G){if(!Ec(G)||Cs(G)!=he)return!1;var ee=tc(G);if(ee===null)return!0;var Re=Ya.call(ee,"constructor")&&ee.constructor;return typeof Re=="function"&&Re instanceof Re&&y5.call(Re)==Xg}var OS=yn?Au(yn):ld;function DI(G){return yj(G)&&G>=-F&&G<=F}var _S=An?Au(An):k3;function VS(G){return typeof G=="string"||!Zi(G)&&Ec(G)&&Cs(G)==Ie}function P0(G){return typeof G=="symbol"||Ec(G)&&Cs(G)==ye}var dm=bn?Au(bn):L3;function wj(G){return G===n}function vj(G){return Ec(G)&&Q0(G)==pe}function EI(G){return Ec(G)&&Cs(G)==ve}var FI=Gr(W3),kI=Gr(function(G,ee){return G<=ee});function LI(G){if(!G)return[];if(cd(G))return VS(G)?ms(G):S0(G);if(Yd&&G[Yd])return vy(G[Yd]());var ee=Q0(G),Re=ee==ge?T3:ee==ze?P3:Yy;return Re(G)}function ud(G){if(!G)return G===0?G:0;if(G=$c(G),G===N||G===-N){var ee=G<0?-1:1;return ee*U}return G===G?G:0}function Gi(G){var ee=ud(G),Re=ee%1;return ee===ee?Re?ee-Re:ee:0}function GS(G){return G?v0(Gi(G),0,B):0}function $c(G){if(typeof G=="number")return G;if(P0(G))return O;if(As(G)){var ee=typeof G.valueOf=="function"?G.valueOf():G;G=As(ee)?ee+"":ee}if(typeof G!="string")return G===0?G:+G;G=b3(G);var Re=qe.test(G);return Re||rt.test(G)?un(G.slice(2),Re?2:8):Fe.test(G)?O:+G}function xj(G){return Kd(G,H0(G))}function wne(G){return G?v0(Gi(G),-F,F):G===0?G:0}function ll(G){return G==null?"":b0(G)}var M7=Rp(function(G,ee){if(g7(ee)||cd(ee)){Kd(ee,R0(ee),G);return}for(var Re in ee)Ya.call(ee,Re)&&rd(G,Re,ee[Re])}),WI=Rp(function(G,ee){Kd(ee,H0(ee),G)}),I7=Rp(function(G,ee,Re,et){Kd(ee,H0(ee),G,et)}),bj=Rp(function(G,ee,Re,et){Kd(ee,R0(ee),G,et)}),Sj=oa(M5);function C0(G,ee){var Re=b1(G);return ee==null?Re:VA(Re,ee)}var vne=Zr(function(G,ee){G=Si(G);var Re=-1,et=ee.length,Mt=et>2?ee[2]:n;for(Mt&&$d(ee[0],ee[1],Mt)&&(et=1);++Re1),Ot}),Kd(G,Ta(G),Re),et&&(Re=id(Re,d|f|p,xr));for(var Mt=ee.length;Mt--;)ky(Re,ee[Mt]);return Re});function Rne(G,ee){return Ij(G,c4(gi(ee)))}var _I=oa(function(G,ee){return G==null?{}:zy(G,ee)});function Ij(G,ee){if(G==null)return{};var Re=Or(Ta(G),function(et){return[et]});return ee=gi(ee),Dy(G,Re,function(et,Mt){return ee(et,Mt[0])})}function zj(G,ee,Re){ee=H1(ee,G);var et=-1,Mt=ee.length;for(Mt||(Mt=1,G=n);++etee){var et=G;G=ee,ee=et}if(Re||G%1||ee%1){var Mt=M3();return X0(G+Mt*(ee-G+mu("1e-"+((Mt+"").length-1))),ee)}return Wf(G,ee)}var h4=J(function(G,ee,Re){return ee=ee.toLowerCase(),G+(Re?XS(ee):ee)});function XS(G){return Y5(ll(G).toLowerCase())}function JS(G){return G=ll(G),G&&G.replace(Qe,jd).replace(or,"")}function Fj(G,ee,Re){G=ll(G),ee=b0(ee);var et=G.length;Re=Re===n?et:v0(Gi(Re),0,et);var Mt=Re;return Re-=ee.length,Re>=0&&G.slice(Re,Mt)==ee}function KS(G){return G=ll(G),G&&Xe.test(G)?G.replace(yt,wu):G}function VI(G){return G=ll(G),G&&St.test(G)?G.replace(Ze,"\\$&"):G}var GI=J(function(G,ee,Re){return G+(Re?"-":"")+ee.toLowerCase()}),XI=J(function(G,ee,Re){return G+(Re?" ":"")+ee.toLowerCase()}),JI=_3("toLowerCase");function KI(G,ee,Re){G=ll(G),ee=Gi(ee);var et=ee?Xc(G):0;if(!ee||et>=ee)return G;var Mt=(ee-et)/2;return Bo(P5(Mt),Re)+G+Bo(T5(Mt),Re)}function zne(G,ee,Re){G=ll(G),ee=Gi(ee);var et=ee?Xc(G):0;return ee&&et>>0,Re?(G=ll(G),G&&(typeof ee=="string"||ee!=null&&!OS(ee))&&(ee=b0(ee),!ee&&Ih(G))?M1(ms(G),0,Re):G.split(ee,Re)):[]}var Ene=J(function(G,ee,Re){return G+(Re?" ":"")+Y5(ee)});function Nj(G,ee,Re){return G=ll(G),Re=Re==null?0:v0(Gi(Re),0,G.length),ee=b0(ee),G.slice(Re,Re+ee.length)==ee}function Fne(G,ee,Re){var et=Wt.templateSettings;Re&&$d(G,ee,Re)&&(ee=n),G=ll(G),ee=I7({},ee,et,Rn);var Mt=I7({},ee.imports,et.imports,Rn),Ot=R0(Mt),dn=Ls(Mt,Ot),xn,zn,wo=0,bo=ee.interpolate||Tt,zo="__p += '",Tr=Jc((ee.escape||Tt).source+"|"+bo.source+"|"+(bo===ot?Ct:Tt).source+"|"+(ee.evaluate||Tt).source+"|$","g"),ei="//# sourceURL="+(Ya.call(ee,"sourceURL")?(ee.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Zs+"]")+` `;G.replace(Tr,function(Ii,_a,sl,D1,Nh,E1){return sl||(sl=D1),zo+=G.slice(wo,E1).replace(Dt,p5),_a&&(xn=!0,zo+=`' + __e(`+_a+`) + '`),Nh&&(zn=!0,zo+=`'; @@ -4802,20 +4802,20 @@ __p += '`),sl&&(zo+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+zo+`return __p -}`;var Pa=jj(function(){return ji(Ot,ei+"return "+zo).apply(n,dn)});if(Pa.source=zo,C7(Pa))throw Pa;return Pa}function QI(G){return ll(G).toLowerCase()}function qS(G){return ll(G).toUpperCase()}function ZI(G,ee,Re){if(G=ll(G),G&&(Re||ee===n))return b3(G);if(!G||!(ee=b0(ee)))return G;var et=ms(G),Mt=ms(ee),Ot=xl(et,Mt),dn=_g(et,Mt)+1;return M1(et,Ot,dn).join("")}function Nj(G,ee,Re){if(G=ll(G),G&&(Re||ee===n))return G.slice(0,xy(G)+1);if(!G||!(ee=b0(ee)))return G;var et=ms(G),Mt=_g(et,ms(ee))+1;return M1(et,0,Mt).join("")}function Uj(G,ee,Re){if(G=ll(G),G&&(Re||ee===n))return G.replace(Pt,"");if(!G||!(ee=b0(ee)))return G;var et=ms(G),Mt=xl(et,ms(ee));return M1(et,Mt).join("")}function Nr(G,ee){var Re=M,et=D;if(As(ee)){var Mt="separator"in ee?ee.separator:Mt;Re="length"in ee?Gi(ee.length):Re,et="omission"in ee?b0(ee.omission):et}G=ll(G);var Ot=G.length;if(Ih(G)){var dn=ms(G);Ot=dn.length}if(Re>=Ot)return G;var xn=Re-Xc(et);if(xn<1)return et;var zn=dn?M1(dn,0,xn).join(""):G.slice(0,xn);if(Mt===n)return zn+et;if(dn&&(xn+=zn.length-xn),OS(Mt)){if(G.slice(xn).search(Mt)){var wo,bo=zn;for(Mt.global||(Mt=Jc(Mt.source,ll(tt.exec(Mt))+"g")),Mt.lastIndex=0;wo=Mt.exec(bo);)var zo=wo.index;zn=zn.slice(0,zo===n?xn:zo)}}else if(G.indexOf(b0(Mt),xn)!=xn){var Tr=zn.lastIndexOf(Mt);Tr>-1&&(zn=zn.slice(0,Tr))}return zn+et}function ez(G){return G=ll(G),G&&ct.test(G)?G.replace(Ve,by):G}var c0=J(function(G,ee,Re){return G+(Re?" ":"")+ee.toUpperCase()}),Y5=_3("toUpperCase");function z1(G,ee,Re){return G=ll(G),ee=Re?n:ee,ee===n?S3(G)?Sy(G):Zu(G):G.match(ee)||[]}var jj=Zr(function(G,ee){try{return Ln(G,n,ee)}catch(Re){return C7(Re)?Re:new ui(Re)}}),kne=oa(function(G,ee){return Wn(ee,function(Re){Re=sm(Re),Fh(G,Re,T7(G[Re],G))}),G});function Lne(G){var ee=G==null?0:G.length,Re=gi();return G=ee?Or(G,function(et){if(typeof et[1]!="function")throw new G0(a);return[Re(et[0]),et[1]]}):[],Zr(function(et){for(var Mt=-1;++MtF)return[];var Re=B,et=X0(G,B);ee=gi(ee),G-=B;for(var Mt=Mh(et,ee);++Re0||ee<0)?new di(Re):(G<0?Re=Re.takeRight(-G):G&&(Re=Re.drop(G)),ee!==n&&(ee=Gi(ee),Re=ee<0?Re.dropRight(-ee):Re.take(ee-G)),Re)},di.prototype.takeRightWhile=function(G){return this.reverse().takeWhile(G).reverse()},di.prototype.toArray=function(){return this.take(B)},bu(di.prototype,function(G,ee){var Re=/^(?:filter|find|map|reject)|While$/.test(ee),et=/^(?:head|last)$/.test(ee),Mt=Wt[et?"take"+(ee=="last"?"Right":""):ee],Ot=et||/^find/.test(ee);Mt&&(Wt.prototype[ee]=function(){var dn=this.__wrapped__,xn=et?[1]:arguments,zn=dn instanceof di,wo=xn[0],bo=zn||Zi(dn),zo=function(_a){var sl=Mt.apply(Wt,ya([_a],xn));return et&&Tr?sl[0]:sl};bo&&Re&&typeof wo=="function"&&wo.length!=1&&(zn=bo=!1);var Tr=this.__chain__,ei=!!this.__actions__.length,Mi=Ot&&!Tr,Pa=zn&&!ei;if(!Ot&&bo){dn=Pa?dn:new di(this);var Ii=G.apply(dn,xn);return Ii.__actions__.push({func:By,args:[zo],thisArg:n}),new J0(Ii,Tr)}return Mi&&Pa?G.apply(this,xn):(Ii=this.thru(zo),Mi?et?Ii.value()[0]:Ii.value():Ii)})}),Wn(["pop","push","shift","sort","splice","unshift"],function(G){var ee=Gg[G],Re=/^(?:push|sort|unshift)$/.test(G)?"tap":"thru",et=/^(?:pop|shift)$/.test(G);Wt.prototype[G]=function(){var Mt=arguments;if(et&&!this.__chain__){var Ot=this.value();return ee.apply(Zi(Ot)?Ot:[],Mt)}return this[Re](function(dn){return ee.apply(Zi(dn)?dn:[],Mt)})}}),bu(di.prototype,function(G,ee){var Re=Wt[ee];if(Re){var et=Re.name+"";Ya.call(v1,et)||(v1[et]=[]),v1[et].push({name:ee,func:Re})}}),v1[pt(n,b).name]=[{name:"wrapper",func:n}],di.prototype.clone=gS,di.prototype.reverse=mS,di.prototype.value=Od,Wt.prototype.at=Zte,Wt.prototype.chain=cI,Wt.prototype.commit=ene,Wt.prototype.next=uI,Wt.prototype.plant=nne,Wt.prototype.reverse=one,Wt.prototype.toJSON=Wt.prototype.valueOf=Wt.prototype.value=ES,Wt.prototype.first=Wt.prototype.head,Yd&&(Wt.prototype[Yd]=tne),Wt},bp=pS();$e?(($e.exports=bp)._=bp,Pn._=bp):pn._=bp}).call(Ac)})(aX,aX.exports);var L2=aX.exports;const nZt=t=>{const{lx:e,lz:n,parentId:o,id:r,roofId:i}=t,a=H(rxt),l=H(Oge);m.useEffect(()=>{i&&(a===i||l.has(i))&&H.getState().set(d=>{for(const f of d.elements)if(f.id===r&&f.type===z.Wall){const p=f;p.roofId=null,p.leftRoofHeight=void 0,p.rightRoofHeight=void 0,p.centerRoofHeight=void 0,p.centerLeftRoofHeight=void 0,p.centerRightRoofHeight=void 0;break}})},[i,a,l]);const s=d=>!(d.button===2||H.getState().moveHandleType||H.getState().resizeHandleType||H.getState().objectTypeToAdd!==z.None||H.getState().isAddingElement()),c=d=>{s(d)&&(H.getState().set(f=>{f.contextMenuObjectType=null}),H.getState().selectMe(r,d,Oo.Select))},u=d=>{H.getState().selectMe(r,d,Oo.ContextMenu),H.getState().set(f=>{d.intersections.length>0&&d.intersections[0].object===d.eventObject&&(f.contextMenuObjectType=z.Wall)})};return h.jsx(ua,{args:[e,n],rotation:[Gt,0,0],visible:!1,onPointerDown:c,onContextMenu:u,children:h.jsx("meshBasicMaterial",{side:$r})})},oZt=be.memo(nZt),ISe=({cy:t,size:e,type:n})=>{const[o,r]=m.useState(XF),i=()=>{r(ta)},a=()=>{r(XF)};return h.jsx(ds,{name:n,args:[e],position:[0,t,0],onPointerEnter:i,onPointerOut:a,children:h.jsx("meshBasicMaterial",{attach:"material",color:o})})},rZt=({ply:t,phz:e})=>{const n=a5(),o=r=>{r.intersections.length>0&&r.intersections[0].eventObject.parent===r.eventObject&&(H.getState().set(i=>{i.moveHandleType=r.object.name}),Fn.getState().setEnableOrbitController(!1))};return h.jsxs("group",{name:"Move Handle Group",position:[0,0,-e],onPointerDown:o,children:[h.jsx(ISe,{cy:-n,size:n,type:Ho.Lower}),h.jsx(ISe,{cy:t+n,size:n,type:Ho.Upper})]})},iZt=be.memo(rZt),aZt="#ADD8E6",R4=be.memo(({x:t,z:e,handleType:n,highLight:o,handleSize:r,partial:i})=>{const a=H(fn),l=H(d1),s=H(yOe),[c,u]=m.useState(!1),d=o||c||n===l||s&&(n===vt.LowerRight||n===vt.UpperRight)?ta:i?aZt:Da;let f=r,p=r,g=r;if(n===vt.LowerRight||n===vt.LowerLeft)f=r*1.7;else if(i){f*=.75,p=r/2,g=r*2.5;const y=g/4;n===vt.WallPartialResizeLeft||n===vt.WallPartialResizeRight?e-=y:(n===vt.WallPartialResizeLeftTop||n===vt.WallPartialResizeRightTop)&&(e+=y)}else p=r/2,g=r*1.7;return h.jsx(Qr,{name:n,args:[f,p,g],position:[t,0,e],onPointerOver:()=>{u(!0),a(y=>{y.hoveredHandle=n})},onPointerLeave:()=>{u(!1),a(y=>{y.hoveredHandle=null})},children:h.jsx("meshBasicMaterial",{color:d})})}),lZt=be.memo(({id:t,parentLz:e,roofId:n,x:o,z:r,absAngle:i,leftUnfilledHeight:a,rightUnfilledHeight:l,leftTopPartialResizeHandleHeight:s,rightTopPartialResizeHandleHeight:c,fill:u,wallLeftHeight:d,wallRightHeight:f,highLight:p,leftJoints:g,rightJoints:y})=>{const w=H(fn),b=H(Id),C=a5(),[P,v]=m.useState(!1),[T,A]=m.useState(new ie),[x,S]=m.useState(new nn),R=m.useRef(null),M=m.useRef(!1),D=m.useRef([r*2,a,l]),E=m.useRef(new Map),W=m.useRef(null),j=m.useRef(null),L=m.useRef([]),k=m.useMemo(()=>{if(!n)return null;const q=H.getState().elements.find(te=>te.id===n&&te.type===z.Roof);return q?q.roofType:null},[n]);b&&(r=-r);const N=q=>{const te=H.getState().cameraDirection,re=Math.atan2(te.x,te.y);A(new ie(q,0,0)),S(new nn(Gt,0,-re-i,"ZXY")),v(!0)},F=(q,te,re)=>{const[ae,se,ne,fe,ge]=te;w(de=>{for(const Z of de.elements)if(Z.id===q&&Z.type===z.Wall){const he=Z;Z.lz=ae,he.leftUnfilledHeight=se,he.rightUnfilledHeight=ne,he.leftTopPartialHeight=fe,he.rightTopPartialHeight=ge}else if(Z.type===z.Wall&&re.has(Z.id)){const he=re.get(Z.id);he!==void 0&&(Z.lz=he,Z.cz=he/2)}})},U=()=>{n&&(g.length>0||y.length>0)&&(k===Go.Gable||k===Go.Gambrel?H.getState().elements.forEach(q=>{q.id===g[0]&&(W.current=q.lz),q.id===y[0]&&(j.current=q.lz)}):(E.current.clear(),H.getState().elements.forEach(q=>{q.type===z.Wall&&q.roofId===n&&E.current.set(q.id,q.lz)})))},O=()=>{L.current=H.getState().elements.filter(q=>q.parentId===t)},B=(q,te,re,ae,se)=>{const{lx:ne,lz:fe,roofId:ge,leftRoofHeight:de,rightRoofHeight:Z,centerLeftRoofHeight:he,centerRightRoofHeight:xe,centerRoofHeight:He}=q,Se=u===El.Partial,ze=Se?Math.min(d,ae):d,Ie=Se?Math.min(f,se):f,ye=Se&&(!me.isZero(d-ze)||!me.isZero(f-Ie)),[ce,pe]=[ne/2,fe/2],ve=[];return ve.push({x:-ce,y:-pe+te},{x:ce,y:-pe+re}),ye?ve.push({x:ce,y:-pe+Ie},{x:-ce,y:-pe+ze}):ge?(Z?ve.push({x:ce,y:-pe+Z}):ve.push({x:ce,y:pe}),xe&&ve.push({x:xe[0]*ne,y:-pe+xe[1]}),He&&ve.push({x:He[0]*ne,y:-pe+He[1]}),he&&ve.push({x:he[0]*ne,y:-pe+he[1]}),de?ve.push({x:-ce,y:-pe+de}):ve.push({x:-ce,y:pe})):ve.push({x:ce,y:pe},{x:-ce,y:pe}),ve},_=(q,te,re,ae,se)=>{const ne=B(q,te,re,ae,se);if(L.current.length>0)for(const fe of L.current){let{cx:ge,cz:de,lx:Z,ly:he,lz:xe}=fe;if(ge*=q.lx,de*=q.lz,fe.type!==z.SolarPanel?(Z*=q.lx,xe*=q.lz):xe=he,fe.type===z.Window&&fe.windowType===Ti.Polygonal){const[He,Se]=fe.polygonTop??Gp,ze=ge+He*Z,Ie=de+xe/2+Se;if(!me.isPointInside(ze,Ie,ne))return!1}if(!me.isElementInsideWall(new ie(ge,0,de),Z,xe,ne,fe.type===z.Door))return!1}return!0},X=()=>{W.current=null,j.current=null},$=q=>{var re;if(H.getState().addedWallId||q.object!==((re=q.intersections[0])==null?void 0:re.object))return;const te=q.object;switch(te.name){case vt.LowerLeft:{w(ae=>{ae.resizeAnchor.copy(te.localToWorld(new ie(o*2,0,0)))});break}case vt.LowerRight:{w(ae=>{ae.resizeAnchor.copy(te.localToWorld(new ie(-o*2,0,0)))});break}case vt.UpperLeft:case vt.WallPartialResizeLeft:case vt.WallPartialResizeLeftTop:{N(-o),U(),O();break}case vt.UpperRight:case vt.WallPartialResizeRight:case vt.WallPartialResizeRightTop:{N(o),U(),O();break}default:console.error("Wall resize handle unknown");return}w(ae=>{ae.resizeHandleType=te.name}),Fn.getState().setEnableOrbitController(!1),M.current=!0,D.current=[r*2,a,l,s,c]},Q=q=>{if(q.intersections.length===0||!M.current)return;const te=q.intersections[0].point;switch(H.getState().resizeHandleType){case vt.UpperLeft:case vt.UpperRight:{w(re=>{const ae=u===El.Partial?Math.max(a,l):0;let se=Math.max(ae+C,te.z-e);if(k===null||k===Go.Gable||k===Go.Gambrel){if(W.current||j.current){const ne=Math.abs(se-(W.current??1/0)),fe=Math.abs(se-(j.current??1/0));ne{for(const ae of re.elements)if(ae.id===t&&ae.type===z.Wall){const se=ae;let ne=me.clamp(te.z-e,0,se.leftTopPartialHeight);if(se.leftJoints.length>0){const fe=re.elements.find(ge=>ge.id===se.leftJoints[0]&&ge.type===z.Wall);if(fe&&fe.fill===El.Partial){const ge=fe.rightUnfilledHeight;Math.abs(ne-ge)<.5&&(ne=ge)}}_(se,ne,re.enableFineGrid?ne:se.rightUnfilledHeight,se.leftTopPartialHeight,se.rightTopPartialHeight)&&(se.leftUnfilledHeight=ne,re.enableFineGrid&&(se.rightUnfilledHeight=ne));break}});break}case vt.WallPartialResizeRight:{w(re=>{for(const ae of re.elements)if(ae.id===t&&ae.type===z.Wall){const se=ae;let ne=me.clamp(te.z-e,0,se.rightTopPartialHeight);if(se.rightJoints.length>0){const fe=re.elements.find(ge=>ge.id===se.rightJoints[0]&&ge.type===z.Wall);if(fe&&fe.fill===El.Partial){const ge=fe.leftUnfilledHeight;Math.abs(ne-ge)<.5&&(ne=ge)}}_(se,re.enableFineGrid?ne:se.leftUnfilledHeight,ne,se.leftTopPartialHeight,se.rightTopPartialHeight)&&(se.rightUnfilledHeight=ne,re.enableFineGrid&&(se.leftUnfilledHeight=ne));break}});break}case vt.WallPartialResizeLeftTop:{w(re=>{const ae=re.elements.find(se=>se.id===t&&se.type===z.Wall);if(ae){let se=me.clamp(te.z-e,ae.leftUnfilledHeight,ae.lz);if(ae.leftJoints.length>0){const ne=re.elements.find(fe=>fe.id===ae.leftJoints[0]&&fe.type===z.Wall);if(ne&&ne.fill===El.Partial){const fe=ne.rightTopPartialHeight;Math.abs(se-fe)<.5&&(se=fe)}}_(ae,ae.leftUnfilledHeight,ae.rightUnfilledHeight,se,re.enableFineGrid?se:ae.rightTopPartialHeight)&&(ae.leftTopPartialHeight=se,re.enableFineGrid&&(ae.rightTopPartialHeight=se))}});break}case vt.WallPartialResizeRightTop:{w(re=>{const ae=re.elements.find(se=>se.id===t&&se.type===z.Wall);if(ae){let se=me.clamp(te.z-e,ae.rightUnfilledHeight,ae.lz);if(ae.rightJoints.length>0){const ne=re.elements.find(fe=>fe.id===ae.rightJoints[0]&&fe.type===z.Wall);if(ne&&ne.fill===El.Partial){const fe=ne.leftTopPartialHeight;Math.abs(se-fe)<.5&&(se=fe)}}_(ae,ae.leftUnfilledHeight,ae.rightUnfilledHeight,re.enableFineGrid?se:ae.leftTopPartialHeight,se)&&(ae.rightTopPartialHeight=se,re.enableFineGrid&&(ae.leftTopPartialHeight=se))}});break}}},le=()=>{Fn.getState().setEnableOrbitController(!0),v(!1),X(),M.current=!1;const q=new Map;n&&k!==Go.Gable&&k!==Go.Gambrel&&H.getState().elements.forEach(re=>{re.type===z.Wall&&re.roofId===n&&q.set(re.id,re.lz)});const te={name:"Change Wall Height",timestamp:Date.now(),resizedElementId:t,resizedElementType:z.Wall,oldHeights:[...D.current],newHeights:[r*2,a,l,s,c],oldSameBuildingWallsHeightMap:new Map(E.current),newSameBuildingWallsHeightMap:q,undo(){F(this.resizedElementId,this.oldHeights,this.oldSameBuildingWallsHeightMap)},redo(){F(this.resizedElementId,this.newHeights,this.newSameBuildingWallsHeightMap)}};H.getState().addUndoable(te),w(re=>{re.actionState.wallHeight=r*2,re.resizeHandleType=null})};return h.jsxs(h.Fragment,{children:[h.jsxs("group",{name:"Wall Resize Handle Group",onPointerDown:$,children:[h.jsx(R4,{x:-o,z:-r,handleType:vt.LowerLeft,highLight:p,handleSize:C}),h.jsx(R4,{x:o,z:-r,handleType:vt.LowerRight,highLight:p,handleSize:C}),!b&&h.jsxs(h.Fragment,{children:[h.jsx(R4,{x:-o,z:r,handleType:vt.UpperLeft,highLight:p,handleSize:C}),h.jsx(R4,{x:o,z:r,handleType:vt.UpperRight,highLight:p,handleSize:C}),u===El.Partial&&h.jsxs(h.Fragment,{children:[h.jsx(R4,{x:-o,z:-r+a,handleType:vt.WallPartialResizeLeft,highLight:p,handleSize:C,partial:!0}),h.jsx(R4,{x:o,z:-r+l,handleType:vt.WallPartialResizeRight,highLight:p,handleSize:C,partial:!0}),h.jsx(R4,{x:-o,z:-r+s,handleType:vt.WallPartialResizeLeftTop,highLight:p,handleSize:C,partial:!0}),h.jsx(R4,{x:o,z:-r+c,handleType:vt.WallPartialResizeRightTop,highLight:p,handleSize:C,partial:!0})]})]})]}),P&&h.jsx(ua,{ref:R,position:T,rotation:x,args:[1e4,1e4],visible:!1,onPointerMove:Q,onPointerUp:le,children:h.jsx("meshBasicMaterial",{side:$r})})]})});function w$e(t){return t.type===z.Cuboid}const sZt="/aladdin/assets/building_facade_01-PU9ju7d_.png",cZt="/aladdin/assets/building_facade_02-x--kz-oN.png",uZt="/aladdin/assets/building_facade_03-BYNjzj26.png",dZt="/aladdin/assets/building_facade_04-VGO1xPmk.png",fZt="/aladdin/assets/building_facade_05-D5uzq3D-.png",hZt="/aladdin/assets/building_facade_06-ClFD4NV8.png",pZt="/aladdin/assets/building_facade_07-XvrQxWV-.png",gZt="/aladdin/assets/building_facade_08-D0kjh0Oz.png",mZt="/aladdin/assets/building_facade_09-y8kFBOu-.png",yZt="/aladdin/assets/building_facade_10-B2-exMft.png",_z=be.memo(({handleType:t,position:e,size:n,onPointerDown:o,onPointerOver:r,onPointerOut:i})=>{const a=H(Eb),l=H(ly),s=m.useRef(null),[c,u,d]=e;let f=tw;c===0&&u===0?f=eAt:c===0?f=XF:u===0&&(f=tw);const p=l===t||a===t?ta:f;return h.jsx(ds,{ref:s,name:t,args:[n/2,6,6,0,Math.PI],position:[c,u,d],onPointerDown:o,onPointerOver:g=>{r(g,t)},onPointerOut:i,children:h.jsx("meshBasicMaterial",{color:p})})}),mm=be.memo(({handleType:t,position:e,size:n,onPointerOver:o,onPointerOut:r})=>{const i=H(d1),a=H(ly),l=m.useRef(null),[s,c,u]=e,d=a===t||i===t?ta:Da,f=()=>{if(l.current){const p=l.current.localToWorld(new ie(-s*2,-c*2,0));H.getState().set(g=>{g.resizeAnchor.copy(p),g.resizeHandleType=t}),Fn.getState().setEnableOrbitController(!1)}};return h.jsx(Qr,{ref:l,name:t,args:[n,n,n],position:[s,c,u],onPointerDown:f,onPointerOver:p=>{o(p,t)},onPointerOut:r,children:h.jsx("meshBasicMaterial",{color:d})})}),AZt=({id:t,args:e})=>{const[n,o,r]=e,i=H(fn),a=H(Gn),l=H(Id),s=H(t$),[c,u]=m.useState(null),{gl:d,raycaster:f}=oi(),p=a5(),g=m.useRef(null),y=m.useRef(null),w=m.useRef(null),b=m.useRef(null),C=m.useRef(null),P=m.useRef(new Map),v=m.useRef(new Map),T=m.useRef(null),A=m.useMemo(()=>[0,Math.min(-1.2*o,-o-.75)-p*2,Vx/2-r],[o,r,p]),x=m.useMemo(()=>[0,Math.max(1.2*o,o+.75)+p*2,Vx/2-r],[o,r,p]),S=c!==null,R=!l,M=!s,D=m.useCallback((q,te)=>{ht.getState().duringCameraInteraction||q.intersections.length>0&&(q.intersections[0].object===q.eventObject||q.intersections.length>1&&q.intersections[1].object===q.eventObject)&&(i(ae=>{ae.hoveredHandle=te;const se=a(t);se&&(ae.selectedElementAngle=se.rotation[2],ae.selectedElementHeight=se.lz)}),me.isMoveHandle(te)?d.domElement.style.cursor="move":te===Kr.Upper||te===Kr.Lower?d.domElement.style.cursor="grab":d.domElement.style.cursor=H.getState().addedCuboidId?"crosshair":"pointer")},[]),E=m.useCallback(()=>{i(q=>{q.hoveredHandle=null}),d.domElement.style.cursor=H.getState().addedCuboidId?"crosshair":"default"},[]),W=q=>{const te=a(q);if(!te)return 0;const re=te.rotation[2];return te.parentId===Zo?re:re+W(te.parentId)},j=q=>{switch(q){case z.SolarPanel:case z.Human:case z.Flower:case z.Tree:return!0}return!1},L=q=>j(q)||q===z.Cuboid,k=q=>{i(te=>{const re=te.elements.find(ze=>ze.id===t);if(!re)return;const ae=q.clone().setZ(0),se=H.getState().resizeAnchor.clone().setZ(0),ne=new ie().subVectors(ae,se).applyEuler(new nn(0,0,-(w.current??0))),fe=new ie().addVectors(ae,se).multiplyScalar(.5),{pos:ge,rot:de}=me.getWorldDataById(re.parentId),Z=new ie().subVectors(fe,ge).applyEuler(new nn(0,0,-de));re.cx=Z.x,re.cy=Z.y;const he=Math.abs(ne.x),xe=Math.abs(ne.y);re.lx=he,re.ly=xe;const He=new ie(Z.x,Z.y,re.cz).applyEuler(new nn(0,0,de)).add(ge),Se=re.rotation[2]+de;if(P.current.size>0)for(const ze of te.elements){const Ie=P.current.get(ze.id);if(Ie){const ye=Ie.clone().sub(He).applyEuler(new nn(0,0,-Se));if(j(ze.type)){const ce=v.current.get(ze.id);if(ce){const[pe,ve]=ce;pe==="Top"?(ze.cx=ye.x,ze.cy=ye.y):pe==="NS"?(ze.cx=ye.x,ze.cy=Math.sign(ve)*(xe/2)):pe==="EW"&&(ze.cx=Math.sign(ve)*(he/2),ze.cy=ye.y)}}else ze.type===z.Cuboid?(ze.cx=ye.x,ze.cy=ye.y):(ze.cx=ye.x/he,ze.cy=ye.y/xe)}}})},N=q=>{i(te=>{const re=te.elements.find(Se=>Se.id===t);if(!re)return;const ae=q.clone().setZ(0),se=H.getState().resizeAnchor.clone().setZ(0),ne=new ie().subVectors(ae,se).applyEuler(new nn(0,0,-(w.current??0))),fe=new ie().addVectors(ae,se).multiplyScalar(.5),{pos:ge,rot:de}=me.getWorldDataById(re.parentId),Z=new ie().subVectors(fe,ge).applyEuler(new nn(0,0,-de));re.cx=Z.x;const he=Math.abs(ne.x);re.lx=he;const xe=new ie(Z.x,Z.y,re.cz).applyEuler(new nn(0,0,de)).add(ge),He=re.rotation[2]+de;if(P.current.size>0)for(const Se of te.elements){const ze=P.current.get(Se.id);if(ze){const Ie=ze.clone().sub(xe).applyEuler(new nn(0,0,-He));if(j(Se.type)){const ye=v.current.get(Se.id);if(ye){const[ce,pe]=ye;ce==="Top"||ce==="NS"?Se.cx=Ie.x:ce==="EW"&&(Se.cx=Math.sign(pe)*(he/2))}}else Se.type===z.Cuboid?Se.cx=Ie.x:Se.cx=Ie.x/he}}})},F=q=>{i(te=>{const re=te.elements.find(Se=>Se.id===t);if(!re)return;const ae=q.clone().setZ(0),se=H.getState().resizeAnchor.clone().setZ(0),ne=new ie().subVectors(ae,se).applyEuler(new nn(0,0,-(w.current??0))),fe=new ie().addVectors(ae,se).multiplyScalar(.5),{pos:ge,rot:de}=me.getWorldDataById(re.parentId),Z=new ie().subVectors(fe,ge).applyEuler(new nn(0,0,-de));re.cy=Z.y;const he=Math.abs(ne.y);re.ly=he;const xe=new ie(Z.x,Z.y,re.cz).applyEuler(new nn(0,0,de)).add(ge),He=re.rotation[2]+de;if(P.current.size>0)for(const Se of te.elements){const ze=P.current.get(Se.id);if(ze){const Ie=ze.clone().sub(xe).applyEuler(new nn(0,0,-He));if(j(Se.type)){const ye=v.current.get(Se.id);if(ye){const[ce,pe]=ye;ce==="Top"?Se.cy=Ie.y:ce==="NS"?Se.cy=Math.sign(pe)*(he/2):ce==="EW"&&(Se.cy=Ie.y)}}else Se.type===z.Cuboid?Se.cy=Ie.y:Se.cy=Ie.y/he}}})},U=q=>{if(g.current!==null){const te=Math.max(1,q.z-g.current);i(re=>{for(const ae of re.elements)if(ae.id===t&&(ae.lz=te,ae.cz=te/2,re.selectedElementHeight=te),ae.parentId===t&&j(ae.type)){const se=v.current.get(ae.id);se&&se[0]==="Top"&&(ae.cz=te/2)}})}},O=q=>{if(y.current){const[te,re]=y.current;let ae=Math.atan2(te-q.x,q.y-re)+(H.getState().rotateHandleType===Kr.Upper?0:Math.PI);const se=Math.abs(ae)>Math.PI?-Math.sign(ae)*la:0;b.current&&(ae-=b.current),H.getState().updateElementRotationById(t,0,0,ae+se)}},B=q=>{if(q.intersections.length>0&&q.intersections[0].object.name===q.object.name||H.getState().addedCuboidId){const te=a(t);if(te&&te.parentId!==Zo){u({position:new ie(0,0,-r),rotation:new nn});const{pos:re,rot:ae}=me.getWorldDataById(te.parentId);C.current=re,b.current=ae,w.current=ae+te.rotation[2];const se=new ie(te.cx,te.cy,te.cz).applyEuler(new nn(0,0,ae)).add(re),ne=H.getState().elements.filter(fe=>fe.parentId===te.id&&(L(fe.type)||me.isIdentical(fe.normal,[0,0,1])));P.current.clear(),v.current.clear();for(const fe of ne){const ge=new ie;j(fe.type)?(ge.set(fe.cx,fe.cy,fe.cz),Math.abs(fe.cz-r)<.01?v.current.set(fe.id,["Top",1]):Math.abs(Math.abs(fe.cx)-n)<.01?v.current.set(fe.id,["EW",Math.sign(fe.cx)]):v.current.set(fe.id,["NS",Math.sign(fe.cy)])):fe.type===z.Cuboid?ge.set(fe.cx,fe.cy,fe.cz):ge.set(fe.cx*te.lx,fe.cy*te.ly,0),ge.applyEuler(new nn(0,0,w.current)).add(se),P.current.set(fe.id,ge)}}i(re=>{re.selectedElementIdSet.clear(),re.selectedElementIdSet.add(t),re.selectedElement=re.elements.find(ae=>ae.id===t)??null})}},_=q=>{if(q.intersections.length>0&&q.intersections[0].object.name===q.object.name){const te=q.intersections[0].object,re=H.getState().cameraDirection,ae=Math.atan2(re.x,re.y)+W(t);u({position:te.position.clone(),rotation:new nn(-Gt,ae,0)});const se=te.localToWorld(new ie);g.current=se.z-r*2;const ne=H.getState().elements.filter(fe=>fe.parentId===t&&j(fe.type));v.current.clear();for(const fe of ne)new ie().set(fe.cx,fe.cy,fe.cz),Math.abs(fe.cz-r)<.01&&v.current.set(fe.id,["Top",1]);i(fe=>{fe.selectedElementIdSet.clear(),fe.selectedElementIdSet.add(t),fe.selectedElement=fe.elements.find(ge=>ge.id===t)??null})}},X=q=>{if(q.intersections.length>0&&q.intersections[0].object.name===q.object.name){u({position:new ie(0,0,-r),rotation:new nn(0,0,0)});const te=q.eventObject;y.current=te.localToWorld(new ie).toArray();const re=a(t);re&&(b.current=W(re.parentId))}},$=q=>{if(q.intersections.length>0){const te=q.intersections[0].eventObject.name;switch(te){case Ho.Lower:case Ho.Upper:case Ho.Left:case Ho.Right:case Ho.Top:{H.getState().set(re=>{const ae=re.elements.find(se=>se.id===t)??null;if(ae){if(re.selectedElement=ae,ae.parentId===Zo)for(const se of re.elements)re.selectedElementIdSet.has(se.id)&&!me.isElementAllowedMultipleMoveOnGround(se)&&re.selectedElementIdSet.delete(se.id);else re.selectedElementIdSet.clear(),re.selectedElementIdSet.add(ae.id);re.moveHandleType=te}}),Fn.getState().setEnableOrbitController(!1);break}}}},Q=q=>{if(T.current){const te=f.intersectObject(T.current);if(te.length){const re=te[0].point,ae=H.getState().resizeHandleType;ae?me.isTopResizeHandle(ae)?U(re):me.isXResizeHandle(ae)?N(re):me.isYResizeHandle(ae)?F(re):k(re):H.getState().rotateHandleType&&O(re)}}},le=()=>{u(null),g.current=null,y.current=null,w.current=null,b.current=null,C.current=null};return h.jsxs(h.Fragment,{children:[S&&h.jsx(ua,{name:"Cuboid Intersection Plane",ref:T,args:[1e4,1e4],position:c.position,rotation:c.rotation,visible:!1,onPointerMove:Q,onPointerUp:le}),h.jsxs("group",{name:"Bottom Resize Handle Group",position:[0,0,-r+p/2],onPointerDown:B,children:[h.jsx(mm,{handleType:vt.UpperLeft,position:[-n,o,0],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.UpperRight,position:[n,o,0],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.LowerLeft,position:[-n,-o,0],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.LowerRight,position:[n,-o,0],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.Left,position:[-n,0,0],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.Right,position:[n,0,0],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.Upper,position:[0,o,0],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.Lower,position:[0,-o,0],size:p,onPointerOver:D,onPointerOut:E})]}),R&&h.jsxs("group",{name:"Cuboid Top Resize Handle Group",onPointerDown:_,children:[h.jsx(mm,{handleType:vt.LowerLeftTop,position:[-n,-o,r],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.UpperLeftTop,position:[-n,o,r],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.LowerRightTop,position:[n,-o,r],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.UpperRightTop,position:[n,o,r],size:p,onPointerOver:D,onPointerOut:E})]}),M&&h.jsxs(h.Fragment,{children:[h.jsxs("group",{name:"Cuboid Move Handle Group",onPointerDown:$,children:[h.jsx(_z,{handleType:Ho.Lower,position:[0,-o-p*1.2,-r],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(_z,{handleType:Ho.Upper,position:[0,o+p*1.2,-r],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(_z,{handleType:Ho.Left,position:[-n-p*1.2,0,-r],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(_z,{handleType:Ho.Right,position:[n+p*1.2,0,-r],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(_z,{handleType:Ho.Top,position:[0,0,r],size:p,onPointerOver:D,onPointerOut:E})]}),h.jsxs("group",{name:"Cuboid Rotate Handle Group",onPointerDown:X,children:[h.jsx(PR,{id:t,handleType:Kr.Lower,position:A,ratio:p*4,hoverHandle:D,noHoverHandle:E}),h.jsx(PR,{id:t,position:x,handleType:Kr.Upper,ratio:p*4,hoverHandle:D,noHoverHandle:E})]})]})]})},wZt=be.memo(AZt);class ea{static isNewPositionOk(e){const n=H.getState().elements.find(o=>o.id===e.parentId);if(!n)return!1;switch(n.type){case z.Foundation:{if(!me.isSolarCollectorWithinHorizontalSurface(e,n))return po(Y.t("message.MoveOutsideBoundaryCancelled",{lng:H.getState().language})),!1;if(H.getState().overlapWithSibling(e))return po(Y.t("message.MoveCancelledBecauseOfOverlap",{lng:H.getState().language})),!1;break}case z.Cuboid:{const o=me.checkElementOnCuboidState(e,n);if(o===ga.OutsideBoundary)return po(Y.t("message.MoveOutsideBoundaryCancelled",{lng:H.getState().language})),!1;if(o===ga.OverLap)return po(Y.t("message.MoveCancelledBecauseOfOverlap",{lng:H.getState().language})),!1;break}case z.Wall:{const o=me.checkElementOnWallState(e,n);if(o===ga.OutsideBoundary)return po(Y.t("message.MoveOutsideBoundaryCancelled",{lng:H.getState().language})),!1;if(o===ga.OverLap)return po(Y.t("message.MoveCancelledBecauseOfOverlap",{lng:H.getState().language})),!1;break}case z.Roof:{const o=me.checkElementOnRoofState(e,n);if(o===ga.OutsideBoundary)return po(Y.t("message.MoveOutsideBoundaryCancelled",{lng:H.getState().language})),!1;if(o===ga.OverLap)return po(Y.t("message.MoveCancelledBecauseOfOverlap",{lng:H.getState().language})),!1;break}}return!0}static getRackCount(e,n,o,r,i){if(e===vr.portrait){const a=Math.max(1,Math.round(n/i)),l=Math.max(1,Math.round(o/r));return a*l}else{const a=Math.max(1,Math.round(n/r)),l=Math.max(1,Math.round(o/i));return a*l}}static setSelected(e,n){H.getState().set(o=>{var r;o.multiSelectionsMode||(n?(o.selectedElement=o.elements.find(i=>i.id===e)??null,o.selectedElementIdSet.clear(),o.selectedElementIdSet.add(e)):(((r=o.selectedElement)==null?void 0:r.id)===e&&(o.selectedElement=null),o.selectedElementIdSet.has(e)&&o.selectedElementIdSet.delete(e)))})}static getSurfaceType(e,n){return!n||!e||e===z.Foundation?Lp.Horizontal:e===z.Wall?Lp.Vertical:me.isEqual(n.z,1)?Lp.Horizontal:e===z.Cuboid?Lp.Vertical:Lp.Inclined}static findParentGroup(e,n){const o=e.parent;if(!o)return null;for(const r of n)if(o.name.includes(r))return o;return ea.findParentGroup(o,n)}static getRoofId(e){if(!e)return null;const n=e.userData.roofId;return n||ea.getRoofId(e.parent)}static getRoofSegmentData(e){if(!e)return null;const{roofId:n,foundation:o,centroid:r,roofSegments:i}=e.userData;return!n||!o||!r||!i?ea.getRoofSegmentData(e.parent):{roofId:n,foundation:o,centroid:r,roofSegments:i}}static getRelativeAzimuth(e){return e>Math.PI?e-Math.PI*2:e<-Math.PI?e+Math.PI*2:e}static isTrackerEnabled(e,n){return e===Lp.Horizontal&&n!==za.NO_TRACKER}static getUnitSize(e,n,o){return e===vr.landscape?{length:n,width:o}:{length:o,width:n}}static getRotationOnCuboid(e){const{x:n,y:o,z:r}=e;return me.isEqual(r,1)?[0,0,0]:me.isEqual(n,0)&&me.isEqual(o,1)?[Gt,0,Math.PI]:me.isEqual(n,0)&&me.isEqual(o,-1)?[Gt,0,0]:me.isEqual(n,-1)&&me.isEqual(o,0)?[Gt,0,-Gt]:me.isEqual(n,1)&&me.isEqual(o,0)?[Gt,0,Gt]:[0,0,0]}static getPVModel(e){const n=H.getState().pvModules[e];return n||(console.warn("pvModel undefined. Using default model: SPR-X21-335-BLK"),{name:"SPR-X21-335-BLK",brand:"SunPower",cellType:"Monocrystalline",efficiency:.21,length:1.558,nominalLength:1.56,width:1.046,nominalWidth:1.05,thickness:.046,m:12,n:8,pmax:335,vmpp:57.3,impp:5.85,voc:67.9,isc:6.23,pmaxTC:-.0029,noct:41.5,weight:18.6,color:"Black",shadeTolerance:"High",bifacialityFactor:0})}static addUndoable(e,n){if(e)switch(n){case Wa.Move:{ea.addUndoableMove(e);break}case Wa.ResizeX:case Wa.ResizeY:{ea.addUndoableResize(e);break}case Wa.RotateLower:case Wa.RotateUpper:{ea.addUndoableRotate(e);break}case Wa.Tilt:{ea.addUndoableTilt(e);break}}}static addUndoableMove(e){const n=H.getState().elements.find(i=>i.id===e.id&&i.type===z.SolarPanel);if(!n)return;const o={name:"Move",timestamp:Date.now(),movedElementId:n.id,movedElementType:n.type,oldCx:e.cx,oldCy:e.cy,oldCz:e.cz,newCx:n.cx,newCy:n.cy,newCz:n.cz,oldParentType:e.parentType,newParentType:n.parentType,oldParentId:e.parentId,newParentId:n.parentId,oldFoundationId:e.foundationId,newFoundationId:n.foundationId,oldNormal:new ie().fromArray(e.normal),newNormal:new ie().fromArray(n.normal),oldRotation:[...e.rotation],newRotation:[...n.rotation],undo(){r(this.movedElementId,[this.oldCx,this.oldCy,this.oldCz],this.oldParentId,this.oldFoundationId,this.oldParentType,this.oldRotation,this.oldNormal)},redo(){r(this.movedElementId,[this.newCx,this.newCy,this.newCz],this.newParentId,this.newFoundationId,this.newParentType,this.newRotation,this.newNormal)}};H.getState().addUndoable(o);const r=(i,a,l,s,c,u,d)=>{H.getState().set(f=>{const p=f.elements.find(g=>g.id===i);!p||p.type!==z.SolarPanel||([p.cx,p.cy,p.cz]=[...a],l&&(p.parentId=l),s&&(p.foundationId=s),c&&(p.parentType=c),u&&(p.rotation=[...u]),d&&(p.normal=[d.x,d.y,d.z]))})}}static addUndoableResize(e){const n=H.getState().elements.find(r=>r.id===e.id&&r.type===z.SolarPanel);if(!n)return;const o={name:"Resize Solar Panel",timestamp:Date.now(),id:n.id,oldPos:[e.cx,e.cy,e.cz],oldDms:[e.lx,e.ly,e.lz],oldRot:[...e.rotation],oldNor:[...e.normal],newPos:[n.cx,n.cy,n.cz],newDms:[n.lx,n.ly,n.lz],newRot:[...n.rotation],newNor:[...n.normal],undo(){H.getState().set(r=>{for(const i of r.elements)if(i.id===o.id){[i.cx,i.cy,i.cz]=[...o.oldPos],[i.lx,i.ly,i.lz]=[...o.oldDms],i.normal=[...o.oldNor],i.rotation=[...o.oldRot];break}})},redo(){H.getState().set(r=>{for(const i of r.elements)if(i.id===o.id){[i.cx,i.cy,i.cz]=[...o.newPos],[i.lx,i.ly,i.lz]=[...o.newDms],i.normal=[...o.newNor],i.rotation=[...o.newRot];break}})}};H.getState().addUndoable(o)}static addUndoableRotate(e){const n=H.getState().elements.find(i=>i.id===e.id&&i.type===z.SolarPanel);if(!n)return;const o={name:"Set Solar Panel Relative Azimuth",timestamp:Date.now(),changedElementId:n.id,oldValue:e.relativeAzimuth,newValue:n.relativeAzimuth,changedElementType:z.SolarPanel,undo:()=>{r(o.oldValue)},redo:()=>{r(o.newValue)}};H.getState().addUndoable(o);const r=i=>{H.getState().set(a=>{const l=a.elements.find(s=>s.id===o.changedElementId&&s.type===z.SolarPanel);l&&(l.relativeAzimuth=i)})}}static addUndoableTilt(e){const n=H.getState().elements.find(i=>i.id===e.id&&i.type===z.SolarPanel);if(!n)return;const o={name:"Set Solar Panel Tilt",timestamp:Date.now(),changedElementId:n.id,oldValue:e.tiltAngle,newValue:n.tiltAngle,changedElementType:z.SolarPanel,undo:()=>{r(o.oldValue)},redo:()=>{r(o.newValue)}};H.getState().addUndoable(o);const r=i=>{H.getState().set(a=>{const l=a.elements.find(s=>s.id===o.changedElementId&&s.type===z.SolarPanel);l&&(l.tiltAngle=i)})}}}const vZt=t=>{const{id:e,cx:n,cy:o,lx:r=1,ly:i=1,lz:a=1,color:l="silver",lineColor:s="black",lineWidth:c=.1,locked:u=!1,showLabel:d=!1,textureTypes:f=[Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture],stackable:p,transparency:g}=t,y=Es(e),w=H(fn),b=H(s0),C=H(Id),P=H(Gn),v=H(Cb),T=H(Nge),A=H(yp),x=H(u3),S=H(Iw),R=H(c3),M=H(Fge),D=H(Ewt),E=H(Y0),W=H(Xq),j=H(t5),L=H(Ds),k=H(En),N=H(Yge),F=H(zw),U=H(iYe),O=H(Ege),B=ht(Ss),_=H(Cf),X=Tn(u1),$=H(hA),{camera:Q,gl:{domElement:le},raycaster:q,mouse:te}=oi(),[re,ae]=m.useState(null),[se,ne]=m.useState(null),[fe,ge]=m.useState(null),[de,Z]=m.useState(null),[he,xe]=m.useState(null),[He,Se]=m.useState(!1),[ze,Ie]=m.useState(!1),ye=m.useRef(null),ce=m.useRef(null),pe=m.useRef(null),ve=m.useRef(Io),[Ae,Te]=m.useState(new ie(0,0,0)),Me=m.useRef(new nn(0,0,0)),Pe=m.useRef(new ie(1,1,1)),Ee=m.useRef(new ie),Be=m.useRef(new ie),Je=m.useRef(new ie),We=m.useRef(new ie),Ke=m.useRef(new ie(1,1,1)),Ne=m.useRef(new ie(1,1,1)),De=m.useRef(0),ke=m.useRef(0),Ye=m.useRef([]),it=m.useRef([]),Ve=m.useRef(null),yt=m.useRef(new ie),ct=m.useRef(0),Xe=m.useMemo(()=>({lng:b}),[b]),ut=r/2,ft=i/2,ot=a/2,st=m.useMemo(()=>new ie,[]),at=m.useMemo(()=>(t!=null&&t.label?t.label:Y.t("shared.CuboidElement",Xe))+(t!=null&&t.locked?" ("+Y.t("shared.ElementLocked",Xe)+")":"")+(t!=null&&t.label?"":` -`+Y.t("word.Coordinates",Xe)+": ("+n.toFixed(1)+", "+o.toFixed(1)+", "+(a/2).toFixed(1)+") "+Y.t("word.MeterAbbreviation",Xe)),[t==null?void 0:t.label,t==null?void 0:t.locked,Xe,n,o,a]);m.useEffect(()=>{const wn=()=>{pe.current=null,Ie(!1),Fn.getState().setEnableOrbitController(!0)};return window.addEventListener("pointerup",wn),()=>{window.removeEventListener("pointerup",wn)}},[]),m.useEffect(()=>{H.getState().tempHumanPlant.length>0&&w(wn=>{wn.elements.push(...wn.tempHumanPlant),wn.tempHumanPlant=[]})},[]),m.useEffect(()=>{if(t&&B){const wn=_??5,In=X(t.id+"-top");In&&ae(me.fetchHeatmapTexture(In,wn));const ar=X(t.id+"-south");ar&&ne(me.fetchHeatmapTexture(ar,wn));const No=X(t.id+"-north");No&&ge(me.fetchHeatmapTexture(No,wn));const eo=X(t.id+"-west");eo&&Z(me.fetchHeatmapTexture(eo,wn));const Xn=X(t.id+"-east");Xn&&xe(me.fetchHeatmapTexture(Xn,wn,!0))}},[B,_]);const Oe=wn=>{switch(wn){case Co.Facade01:return sZt;case Co.Facade02:return cZt;case Co.Facade03:return uZt;case Co.Facade04:return dZt;case Co.Facade05:return fZt;case Co.Facade06:return hZt;case Co.Facade07:return pZt;case Co.Facade08:return gZt;case Co.Facade09:return mZt;case Co.Facade10:return yZt;default:return ig}},Ze=wn=>{switch(wn){case Co.Facade01:return{x:14,y:6.5};case Co.Facade02:return{x:14,y:6.5};case Co.Facade03:return{x:10,y:12};case Co.Facade04:return{x:20,y:11};case Co.Facade05:return{x:15,y:10};case Co.Facade06:return{x:11,y:3.5};case Co.Facade07:return{x:11,y:10};case Co.Facade08:return{x:16,y:9};case Co.Facade09:return{x:10,y:9};case Co.Facade10:return{x:12,y:9};default:return{x:1,y:1}}},St=m.useMemo(()=>new df().load(f?Oe(f[0]):ig,wn=>{const In=Ze(f[0]);wn.repeat.set(i/In.x,a/In.y),wn.rotation=Gt,wn.center.x=1,wn.center.y=0,wn.wrapS=wn.wrapT=Hs,Rt(wn)}),[f[0],i,a]),[Pt,Rt]=m.useState(St),Ut=m.useMemo(()=>new df().load(f?Oe(f[1]):ig,wn=>{const In=Ze(f[1]);wn.repeat.set(i/In.x,a/In.y),wn.rotation=-Gt,wn.wrapS=wn.wrapT=Hs,At(wn)}),[f[1],i,a]),[Ht,At]=m.useState(Ut),kt=m.useMemo(()=>new df().load(f?Oe(f[2]):ig,wn=>{const In=Ze(f[2]);wn.repeat.set(r/In.x,a/In.y),wn.rotation=Math.PI,wn.center.x=0,wn.center.y=1,wn.wrapS=wn.wrapT=Hs,dt(wn)}),[f[2],r,a]),[gt,dt]=m.useState(kt),Ct=m.useMemo(()=>new df().load(f?Oe(f[3]):ig,wn=>{const In=Ze(f[3]);wn.repeat.set(r/In.x,a/In.y),wn.wrapS=wn.wrapT=Hs,Fe(wn)}),[f[3],r,a]),[tt,Fe]=m.useState(Ct),qe=m.useMemo(()=>new df().load(f?Oe(f[4]):ig,wn=>{const In=Ze(f[4]);wn.repeat.set(r/In.x,i/In.y),wn.wrapS=wn.wrapT=Hs,rt(wn)}),[f[4],r,i]),[je,rt]=m.useState(qe);m.useEffect(()=>{np()},[f]);const mt=wn=>{switch(wn){case z.Polygon:case z.Sensor:case z.Light:case z.SolarPanel:return!0}return!1},Qe=wn=>{switch(wn){case z.Polygon:case z.Sensor:case z.Light:case z.SolarPanel:case z.Human:case z.Tree:case z.Flower:return!0}return!1},Tt=wn=>{ve.current=wn;const In=.01;me.isSame(ve.current,Io)?(Te(new ie(0,0,ot+In)),Me.current=new nn(0,0,0),Pe.current.set(ut,ft,ot)):me.isSame(ve.current,Op)?(Te(new ie(ut+In,0,0)),Me.current=new nn(0,Gt,0),Pe.current.set(ot,ft,ut)):me.isSame(ve.current,_p)?(Te(new ie(-ut-In,0,0)),Me.current=new nn(0,-Gt,0),Pe.current.set(ot,ft,ut)):me.isSame(ve.current,Vp)?(Te(new ie(0,-ft-In,0)),Me.current=new nn(Gt,0,0),Pe.current.set(ut,ot,ft)):me.isSame(ve.current,Oc)&&(Te(new ie(0,ft+In,0)),Me.current=new nn(-Gt,0,0),Pe.current.set(ut,ot,ft))},Dt=Math.max(1,Math.max(r,i)/8),lt=c1*Dt,zt=wn=>{var No,eo;const In=wn.intersections[0];if(H.getState().objectTypeToAdd===z.SolarPanel){const Xn=In.point,{pos:Jo,rot:xo}=me.getWorldDataById(e),Qo=new ie().subVectors(Xn,Jo).applyEuler(new nn(0,0,-xo)),jo=((No=In.face)==null?void 0:No.normal)??new ie(0,0,1),lr=Ga.makeSolarPanel(t,H.getState().getPvModule(H.getState().actionState.solarPanelModelName??"SPR-X21-335-BLK"),Qo.x,Qo.y,Qo.z,H.getState().actionState.solarPanelOrientation??vr.landscape,H.getState().actionState.solarPanelPoleHeight??1,H.getState().actionState.solarPanelPoleSpacing??3,H.getState().actionState.solarPanelTiltAngle??0,H.getState().actionState.solarPanelRelativeAzimuth??0,jo,ea.getRotationOnCuboid(jo),H.getState().actionState.solarPanelFrameColor??"white");return w(fr=>{fr.elements.push(lr)}),lr}else return T(t,In.point,(eo=In.face)==null?void 0:eo.normal)},Ft=wn=>{if(wn.button===2)return;N()||E(e,wn,Oo.Select);const In=v();let ar=!1;if(wn.intersections[0].object.name===z.Polygon&&H.getState().objectTypeToAdd!==z.None&&(ar=!0),(In==null?void 0:In.id)===e||ar)if(Qe(H.getState().objectTypeToAdd)&&t){Ie(!0);const No=zt(wn);if(No){const eo={name:"Add",timestamp:Date.now(),addedElement:No,undo:()=>{A(eo.addedElement.id,!1)},redo:()=>{w(Xn=>{Xn.elements.push(eo.addedElement),Xn.selectedElement=eo.addedElement})}};k(eo),w(Xn=>{Xn.objectTypeToAdd=z.None})}}else Fn.getState().selectNone(),Fn.setState({cuboidRef:ye});else if(In&&In.parentId===e&&mt(In.type)){Ie(!0);const{rot:No,pos:eo}=me.getWorldDataById(e);yt.current.copy(eo),ct.current=No,pe.current=In;let Xn;for(const Jo of wn.intersections)if(Jo.object===ce.current){Xn=Jo.face;break}switch(Xn&&Tt(Xn.normal),Fn.getState().setEnableOrbitController(!1),Ee.current.x=In.cx,Ee.current.y=In.cy,Ee.current.z=In.cz,Je.current.fromArray(In.normal),Ke.current.x=In.lx,Ke.current.y=In.ly,Ke.current.z=In.lz,In.type){case z.SolarPanel:De.current=In.relativeAzimuth,ht.getState().setPrimitiveStore("oldParentId",e),ht.getState().setPrimitiveStore("oldFoundationId",e);break;case z.Polygon:Ye.current=In.vertices.map(Jo=>({...Jo}));break}}},_t=wn=>{var xo,Qo;if(!ce.current)return;const In=q.intersectObjects([ce.current]);if(In.length===0)return;const ar=In[0].face;if(!ar)return;const No=Eu.getIntersectionObjects(wn);if(No.length===0||No[0].eventObject.userData.id!==e){Wo(!1),pe.current=null;return}const eo=H.getState().selectedElement;if(!!(eo&&!eo.locked&&eo.type===z.SolarPanel&&H.getState().moveHandleType)&&(pe.current=eo),ar.normal.z===1&&((xo=pe.current)==null?void 0:xo.type)!==z.Polygon){const jo=!!(((Qo=pe.current)==null?void 0:Qo.type)===z.SolarPanel&&(H.getState().moveHandleType||H.getState().rotateHandleType||H.getState().resizeHandleType)&&!pe.current.locked);Wo(jo),jo&&(st.set(0,0,pe.current.poleHeight+a/2),Tt(new ie(0,0,1)),Ie(!0));return}else if(Wo(!1),pe.current&&t&&!pe.current.locked){const jo=new Xt(wn.offsetX/le.clientWidth*2-1,1-wn.offsetY/le.clientHeight*2);q.setFromCamera(jo,Q);let lr=In[0].point;if(H.getState().moveHandleType){const fr=ar.normal;if(Tt(fr),lr=me.relativeCoordinates(lr.x,lr.y,lr.z,t),pe.current.type===z.Polygon){const ai=pe.current;if(H.getState().moveHandleType===Ho.Default){const hr=me.calculatePolygonCentroid(Ye.current),tr=new ie().fromArray(ai.normal);let xi,Eo;me.isSame(tr,Op)?(xi=-(hr.x+lr.z),Eo=lr.y-hr.y):me.isSame(tr,_p)?(xi=lr.z-hr.x,Eo=lr.y-hr.y):me.isSame(tr,Oc)?(xi=lr.x-hr.x,Eo=-(hr.y+lr.z)):me.isSame(tr,Vp)?(xi=lr.x-hr.x,Eo=lr.z-hr.y):(xi=lr.x-hr.x,Eo=lr.y-hr.y);const bi=Ye.current.map(hl=>({...hl}));bi.forEach(hl=>{hl.x+=xi,hl.y+=Eo}),F(ai.id,bi)}}else R(pe.current.id,lr.x,lr.y,lr.z),D(pe.current.id,fr.x,fr.y,fr.z),pe.current.parentId!==e&&H.getState().set(ai=>{const hr=ai.elements.find(tr=>{var xi;return tr.id===((xi=pe.current)==null?void 0:xi.id)&&tr.type===z.SolarPanel});hr&&(hr.parentId!==e||hr.foundationId!==e)&&(hr.parentId=e,hr.foundationId=e,hr.parentType=z.Cuboid,ai.selectedElement&&(ai.selectedElement.parentId=e,hr.color=ai.selectedElement.color))})}else if(H.getState().resizeHandleType)switch(pe.current.type){case z.SolarPanel:{const fr=pe.current;if(fr.normal[2]===1)break;const[ai,hr]=tQe(fr),tr=H.getState().resizeAnchor,xi=H.getState().resizeHandleType;if(xi===vt.Lower||xi===vt.Upper){const bi=Math.max(1,Math.round(Math.abs(lr.z-tr.z)/hr))*hr,hl=new ie(0,0,lr.z-tr.z).normalize().multiplyScalar(bi),nr=new ie().addVectors(tr,hl.clone().divideScalar(2));w(or=>{const Ai=or.elements.find(ka=>ka.id===fr.id);Ai&&(Ai.cz=(nr.z-yt.current.z)/a,Ai.ly=Math.abs(hl.z))})}else if(xi===vt.Left||xi===vt.Right){const Eo=new ie().subVectors(lr,tr).setZ(0),hl=Math.max(1,Math.round(Eo.length()/ai))*ai,nr=Eo.clone().normalize().multiplyScalar(hl),or=new ie().addVectors(tr,nr.clone().divideScalar(2)),Ai=new ie().subVectors(or,yt.current).applyEuler(new nn(0,0,-ct.current));w(ka=>{const wi=ka.elements.find(Fs=>Fs.id===fr.id);wi&&(Math.abs(Math.abs(wi.normal[1])-1)<.01?wi.cx=Ai.x/r:wi.cy=Ai.y/i,wi.lx=nr.length())})}break}case z.Polygon:{if(H.getState().resizeHandleType===vt.Default){let fr=new ie(lr.x-yt.current.x,lr.y-yt.current.y,0).applyEuler(new nn(0,0,-ct.current,"ZXY"));const ai=pe.current,hr=new ie().fromArray(ai.normal);let tr,xi;me.isSame(hr,Op)?(tr=t.lz,xi=t.ly,fr.x=-lr.z+yt.current.z):me.isSame(hr,_p)?(tr=t.lz,xi=t.ly,fr.x=lr.z-yt.current.z):me.isSame(hr,Oc)?(tr=t.lx,xi=t.lz,fr.y=-lr.z+yt.current.z):me.isSame(hr,Vp)?(tr=t.lx,xi=t.lz,fr.y=lr.z-yt.current.z):(tr=t.lx,xi=t.ly),fr=H.getState().enableFineGrid?me.snapToFineGrid(fr):me.snapToNormalGrid(fr),fr.x/=tr,fr.y/=xi,U(ai.id,ai.selectedIndex,fr.x,fr.y)}break}}Ie(!0)}},tn=wn=>{if(Ve.current&&pe.current&&t){if(pe.current.type!==z.SolarPanel)return;const In=pe.current;if(In.locked)return;q.setFromCamera(te,Q);const ar=q.intersectObjects([Ve.current]);if(ar.length>0){let No=ar[0].point.clone();if(H.getState().moveHandleType)No=me.relativeCoordinates(No.x,No.y,No.z-In.poleHeight,t),R(In.id,No.x,No.y,No.z),D(pe.current.id,0,0,1),pe.current.parentId!==e&&H.getState().set(eo=>{const Xn=eo.elements.find(Jo=>{var xo;return Jo.id===((xo=pe.current)==null?void 0:xo.id)&&Jo.type===z.SolarPanel});Xn&&(Xn.parentId!==e||Xn.foundationId!==e)&&(Xn.parentId=e,Xn.foundationId=e,Xn.parentType=z.Cuboid,eo.selectedElement&&(eo.selectedElement.parentId=e,Xn.color=eo.selectedElement.color))});else if(H.getState().rotateHandleType&&H.getState().rotateHandleType!==Kr.Tilt){const eo=ct.current,Xn=new Xt(yt.current.x,yt.current.y),Jo=new Xt(t.lx*In.cx,t.ly*In.cy).rotateAround(si,eo),xo=new Xt().addVectors(Jo,Xn),Qo=-eo+Math.atan2(-No.x+xo.x,No.y-xo.y)+(H.getState().rotateHandleType===Kr.Lower?0:Math.PI),jo=Math.abs(Qo)>Math.PI?-Math.sign(Qo)*la:0,lr=Qo+jo;W(In.id,lr),ke.current=lr}else if(H.getState().resizeHandleType){const eo=H.getState().resizeAnchor,Xn=j(In.pvModelName),Jo=new Xt(No.x,No.y),xo=new Xt(eo.x,eo.y),Qo=Jo.distanceTo(xo),jo=In.relativeAzimuth+ct.current,lr=new Xt().subVectors(Jo,xo);switch(H.getState().resizeHandleType){case vt.Lower:case vt.Upper:{const fr=H.getState().resizeHandleType===vt.Lower?1:-1,ai=lr.angle()-jo+fr*Gt;let hr=Qo*Math.cos(ai);In.orientation===vr.portrait?hr=Math.max(1,Math.ceil((hr-Xn.length/2)/Xn.length))*Xn.length:hr=Math.max(1,Math.ceil((hr-Xn.width/2)/Xn.width))*Xn.width;const tr=eo.x+fr*(hr*Math.sin(jo))/2,xi=eo.y-fr*(hr*Math.cos(jo))/2,Eo=new Xt(tr,xi),bi=new Xt(yt.current.x,yt.current.y),hl=new Xt().subVectors(Eo,bi).rotateAround(si,-ct.current),nr=hl.x/r,or=hl.y/i;an(In,nr,or,In.lx,hr)&&(S(In.id,hr),R(In.id,nr,or));break}case vt.Left:case vt.Right:{const fr=H.getState().resizeHandleType===vt.Left?-1:1,ai=lr.angle()-jo+(H.getState().resizeHandleType===vt.Left?Math.PI:0);let hr=Qo*Math.cos(ai);In.orientation===vr.portrait?hr=Math.max(1,Math.ceil((hr-Xn.width/2)/Xn.width))*Xn.width:hr=Math.max(1,Math.ceil((hr-Xn.length/2)/Xn.length))*Xn.length;const tr=eo.x+fr*(hr*Math.cos(jo))/2,xi=eo.y+fr*(hr*Math.sin(jo))/2,Eo=new Xt(tr,xi),bi=new Xt(yt.current.x,yt.current.y),hl=new Xt().subVectors(Eo,bi).rotateAround(si,-ct.current),nr=hl.x/r,or=hl.y/i;an(In,nr,or,hr,In.ly)&&(x(In.id,hr),R(In.id,nr,or));break}}}}}},Qt=(wn,In,ar)=>{const No=JSON.parse(JSON.stringify(wn));return No.cx=In,No.cy=ar,O(No)?(po(Y.t("message.MoveCancelledBecauseOfOverlap",Xe)),!1):me.isIdentical(wn.normal,rs)&&!me.isSolarCollectorWithinHorizontalSurface(No,t)?(po(Y.t("message.MoveOutsideBoundaryCancelled",Xe)),!1):!0},gn=(wn,In)=>{const ar=JSON.parse(JSON.stringify(wn));return ar.relativeAzimuth=In,O(ar)?(po(Y.t("message.RotationCancelledBecauseOfOverlap",Xe)),!1):me.isSolarCollectorWithinHorizontalSurface(ar,t)?!0:(po(Y.t("message.RotationOutsideBoundaryCancelled",Xe)),!1)},an=(wn,In,ar,No,eo)=>{if(wn.tiltAngle!==0&&.5*eo*Math.abs(Math.sin(wn.tiltAngle))>wn.poleHeight)return!1;const Xn=JSON.parse(JSON.stringify(wn));return Xn.cx=In,Xn.cy=ar,Xn.lx=No,Xn.ly=eo,!!me.isSolarCollectorWithinHorizontalSurface(Xn,t)},mn=()=>{if(!pe.current)return;const wn=P(pe.current.id);if(wn){if(wn.type===z.Polygon){if(H.getState().moveHandleType||H.getState().resizeHandleType){it.current=wn.vertices.map(ar=>({...ar}));const In={name:H.getState().moveHandleType?"Move Polygon":"Resize Polygon",timestamp:Date.now(),oldValue:Ye.current,newValue:it.current,changedElementId:wn.id,changedElementType:wn.type,undo:()=>{F(In.changedElementId,In.oldValue)},redo:()=>{F(In.changedElementId,In.newValue)}};k(In)}}else if(H.getState().resizeHandleType){if(Be.current.x=wn.cx,Be.current.y=wn.cy,Be.current.z=wn.cz,Ne.current.x=wn.lx,Ne.current.y=wn.ly,Ne.current.z=wn.lz,Be.current.distanceToSquared(Ee.current)>It&&Ne.current.distanceToSquared(Ke.current)>It){const In={name:"Resize",timestamp:Date.now(),resizedElementId:pe.current.id,resizedElementType:pe.current.type,oldCx:Ee.current.x,oldCy:Ee.current.y,oldCz:Ee.current.z,newCx:Be.current.x,newCy:Be.current.y,newCz:Be.current.z,oldLx:Ke.current.x,oldLy:Ke.current.y,oldLz:Ke.current.z,newLx:Ne.current.x,newLy:Ne.current.y,newLz:Ne.current.z,undo:()=>{R(In.resizedElementId,In.oldCx,In.oldCy,In.oldCz),M(In.resizedElementId,In.oldLx,In.oldLy,In.oldLz)},redo:()=>{R(In.resizedElementId,In.newCx,In.newCy,In.newCz),M(In.resizedElementId,In.newLx,In.newLy,In.newLz)}};k(In)}}else if(H.getState().rotateHandleType){if(pe.current.type===z.SolarPanel){const In=pe.current;if(Math.abs(ke.current-De.current)>It)if(gn(In,ke.current)){w(No=>{No.selectedElementAngle=ke.current});const ar={name:"Rotate",timestamp:Date.now(),oldValue:De.current,newValue:ke.current,changedElementId:In.id,changedElementType:In.type,undo:()=>{W(ar.changedElementId,ar.oldValue)},redo:()=>{W(ar.changedElementId,ar.newValue)}};k(ar)}else W(In.id,De.current)}}else if(Be.current.x=wn.cx,Be.current.y=wn.cy,Be.current.z=wn.cz,We.current.fromArray(wn.normal),Be.current.distanceToSquared(Ee.current)>It){let In=!0;wn.type===z.SolarPanel&&(In=Qt(wn,wn.cx,wn.cy)),In?Eu.addUndoableMove():w(ar=>{const No=ar.elements.find(xo=>xo.id===wn.id);if(!No||!ar.selectedElement)return;const eo=ar.selectedElement;No.cx=eo.cx,No.cy=eo.cy,No.cz=eo.cz,No.rotation=[...eo.rotation],No.normal=[...eo.normal];const Xn=ht.getState().oldParentId,Jo=ht.getState().oldFoundationId;Xn&&(No.parentId=Xn),Jo&&(No.foundationId=Jo)})}pe.current=null}},Hn=wn=>{wn.intersections.length>0&&wn.intersections[0].object===ce.current&&Se(!0)},Fo=wn=>{pe.current&&me.isPlantOrHuman(pe.current)&&wn.intersections[0].object===ce.current&&Ie(!0)},yo=()=>{Se(!1),Ie(!1)},So=wn=>{E(e,wn,Oo.ContextMenu),w(In=>{In.pastePoint.copy(wn.intersections[0].point);const ar=wn.intersections[0].face;ar&&(In.pasteNormal=ar.normal.clone(),me.isSame(ar.normal,Op)?In.selectedSideIndex=0:me.isSame(ar.normal,_p)?In.selectedSideIndex=1:me.isSame(ar.normal,Oc)?In.selectedSideIndex=2:me.isSame(ar.normal,Vp)?In.selectedSideIndex=3:me.isSame(ar.normal,Io)&&(In.selectedSideIndex=4)),In.clickObjectType=z.Cuboid,wn.intersections.length>0&&wn.intersections[0].object===ce.current&&(In.contextMenuObjectType=z.Cuboid)})},{transparent:$o,opacity:mo}=QH(g!==void 0&&g>0,1-(g??0));m.useEffect(()=>{if(ce.current)for(let wn=0;wn<6;wn++)ce.current.material[wn].needsUpdate=!0},[$o]);const Jn=[0,1,2,3,4,5],uo=[B&&he?he:Pt,B&&de?de:Ht,B&&fe?fe:gt,B&&se?se:tt,B&&re?re:je,null],ir=t&&t.faceColors?Jn.map(wn=>f&&f[wn]!==Co.NoTexture?B?h.jsx("meshBasicMaterial",{side:Ra,attach:`material-${wn}`,color:"white",map:uo[wn],transparent:$o,opacity:mo},wn):h.jsx("meshStandardMaterial",{side:Ra,attach:`material-${wn}`,color:"white",map:uo[wn],transparent:$o,opacity:mo},wn):B?h.jsx("meshBasicMaterial",{side:Ra,attach:`material-${wn}`,color:"white",map:uo[wn],transparent:$o,opacity:mo},wn):h.jsx("meshStandardMaterial",{side:Ra,attach:`material-${wn}`,color:t.faceColors?t.faceColors[wn]:l,map:uo[wn],transparent:$o,opacity:mo},wn)):h.jsx("meshStandardMaterial",{side:Ra,color:l,transparent:$o,opacity:mo}),Rr=m.useMemo(()=>[ut,ft,ot],[ut,ft,ot]),br=y&&!u,[Vr,Wo]=m.useState(!1);return h.jsxs("group",{ref:ye,name:"Cuboid Group "+e,children:[h.jsx(Qr,{castShadow:L,receiveShadow:L,userData:{simulation:!0,stand:!0,stackable:p,id:e,aabb:!0},uuid:e,ref:ce,args:[r,i,a],name:"Cuboid "+e,onContextMenu:So,onPointerDown:Ft,onPointerMove:_t,onPointerUp:mn,onPointerOver:Hn,onPointerOut:yo,onPointerEnter:Fo,children:ir}),Vr&&h.jsx(ua,{ref:Ve,name:"Intersection Plane",position:st,args:[r,i],visible:!1,onPointerMove:tn}),ze&&h.jsxs(h.Fragment,{children:[(H.getState().moveHandleType||H.getState().resizeHandleType)&&h.jsx(Gge,{hx:Pe.current.x,hy:Pe.current.y,hz:Pe.current.z,position:Ae,rotation:Me.current}),H.getState().rotateHandleType&&pe.current&&pe.current.type===z.SolarPanel&&h.jsx(Nye,{element:pe.current,height:pe.current.poleHeight+ot})]}),y&&h.jsx(Uye,{element:t,verticalLift:lt}),(g||!y||$)&&h.jsx(fw,{hx:ut,hy:ft,hz:ot,lineColor:g||$&&C?"white":s,lineWidth:g?c*15:$&&C?c*5:c}),y&&u&&h.jsx(fw,{hx:ut,hy:ft,hz:ot,lineColor:y0,lineWidth:c*5}),br&&h.jsx(wZt,{id:e,args:Rr}),(He||d)&&!y&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",text:at,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,fontFace:"Roboto",textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,ot+((t==null?void 0:t.labelHeight)??.2)]})]})},xZt=be.memo(vZt),nC=t=>{const[e,n]=m.useState(t);return m.useEffect(()=>{t!==e&&n(t)},[t]),[e,n]},MQ=(t,e)=>{const{gl:n}=oi(),[o,r]=m.useState(t),i=m.useRef(!1),a=m.useRef(!1);return m.useEffect(()=>{const u=()=>{i.current&&(i.current=!1,a.current||(r(t),n.domElement.style.cursor="default"))};return window.addEventListener("pointerup",u),()=>window.removeEventListener("pointerup",u)},[]),{_color:o,_onPointerDown:()=>{i.current=!0,setTimeout(()=>{n.domElement.style.cursor=e},10)},_onPointerMove:u=>{u.intersections.length==0||u.intersections[0].object!==u.object?(a.current=!1,r(t),n.domElement.style.cursor="default"):(a.current=!0,r(ta),n.domElement.style.cursor=e)},_onPointerLeave:()=>{a.current=!1,i.current||(r(t),n.domElement.style.cursor="default")}}},bZt=(t,e)=>{const[n,o]=m.useState(t),[r,i]=m.useState(e);return m.useEffect(()=>{o(t),i(e)},[t,e]),{materialLx:n,materialLy:r,setMaterialSize:(l,s)=>{l===Wa.ResizeX?s!==n&&o(Math.abs(s)):s!==r&&i(Math.abs(s))}}},v$e=t=>{const e=ht(Ss),n=H(Cf),[o,r]=m.useState(null);return m.useEffect(()=>{if(e){const i=Tn.getState().getHeatmap(t);i&&r(me.fetchHeatmapTexture(i,n??5))}},[e,n]),o},x$e=(t,e,n,o,r,i)=>{const a=r??((n==null?void 0:n.color)==="Black"&&(n==null?void 0:n.cellType)==="Monocrystalline"?"silver":"white"),l=i??"gray",s=m.useMemo(()=>{if(!n)return null;const{cellType:d,length:f,width:p,m:g,n:y,color:w}=n;return o===vr.portrait?zSe(d,p,f,y,g,w,a,l):zSe(d,f,p,g,y,w,a,l)},[n,o,a,l]),[c,u]=m.useState(s);return m.useEffect(()=>{if(s&&n){const{length:d,width:f}=n,p=Math.max(1,Math.round(t/(o===vr.landscape?d:f))),g=Math.max(1,Math.round(e/(o===vr.landscape?f:d)));s.repeat.set(p,g),s.wrapS=s.wrapT=Hs,u(s.clone())}},[s,t,e]),c},zSe=(t,e,n,o,r,i,a,l)=>{e*=nwe,n*=nwe;const s=document.createElement("canvas");[s.width,s.height]=[e,n];const c=s.getContext("2d");if(c){c.fillStyle=a,c.fillRect(0,0,e,n);const u=Math.max(e,n)*tAt;if(c.fillStyle=l,c.fillRect(u,u,e-2*u,n-2*u),c.fillStyle=i==="Black"?oAt:rAt,t==="Thin Film"){const d=u*.6;c.fillRect(d,d,e-d*2,n-d*2)}else{const d=Math.max(e,n)*nAt,f=u+d,p=(e-f*2-d*(o-1))/o,g=(n-f*2-d*(r-1))/r,y=p*.1,w=g*.1;if(t==="Monocrystalline")for(let b=0;b{const{id:e,parentId:n,cx:o,cy:r,cz:i,lx:a,ly:l,lz:s,normal:c,locked:u,trackerType:d,tiltAngle:f,relativeAzimuth:p,poleHeight:g,poleRadius:y,poleSpacing:w,color:b="white"}=t,C=Es(e),P=b$e(c),v=l/2,T=P?g:0,A=Math.max(1,(a+l)/16),x=A*2/3,S=A*2/3,R=-g/2-s/2,M=H(fn),D=H(aYe),E=H(En),W=H(rl),j=H(Tc),{gl:{domElement:L},camera:k,raycaster:N,mouse:F}=oi(),[U,O]=m.useState(null),[B,_]=m.useState(!1),X=m.useRef(!1),$=m.useRef(0),Q=m.useRef(0),le=m.useRef(null),q=m.useRef(null),te=m.useMemo(()=>new Array(13).fill(0),[]),re=m.useMemo(()=>new Date(W),[W]),ae=m.useMemo(()=>{const He=[],Se=Math.floor(.5*a/w),ze=Math.floor(.5*l*Math.abs(Math.cos(f))/w),Ie=.5*Math.sin(f),ye=Math.cos(p)*w,ce=Math.sin(p)*w;for(let pe=-Se;pe<=Se;pe++)for(let ve=-ze;ve<=ze;ve++){const Ae=pe*ye-ve*ce,Te=pe*ce+ve*ye;He.push(new ie(Ae,Te,R+Ie*w*ve))}return He},[p,f,w,a,l,R]),se=m.useMemo(()=>Yye(c),[c]),ne=m.useMemo(()=>{if(P){if(d===za.NO_TRACKER)return new nn(f,0,p,"ZXY");const He=Ei(re,j),Se=S$e(n,se.z)-se.z;switch(d){case za.ALTAZIMUTH_DUAL_AXIS_TRACKER:const ze=Math.hypot(He.x,He.y);return new nn(Math.atan2(ze,He.z),0,Math.atan2(He.y,He.x)+Gt-Se,"ZXY");case za.HORIZONTAL_SINGLE_AXIS_TRACKER:return new nn(0,Math.atan2(He.x,He.z),-Se+(a.1,de=T>0&&P;m.useEffect(()=>{const He=()=>{Fn.getState().setEnableOrbitController(!0),X.current=!1,_(!1),(H.getState().rotateHandleType||H.getState().moveHandleType||H.getState().resizeHandleType)&&M(Se=>{Se.rotateHandleType=null,Se.moveHandleType=null,Se.resizeHandleType=null})};return window.addEventListener("pointerup",He),()=>{window.removeEventListener("pointerup",He)}},[]);const Z=(He,Se)=>{He.intersections.length>0&&He.intersections[0].object===He.eventObject&&(O(Se),Se===Ho.Top?L.style.cursor="move":Se===Kr.Lower||Se===Kr.Upper||Se===Kr.Tilt?L.style.cursor="grab":L.style.cursor="pointer")},he=()=>{O(null),L.style.cursor="default"},xe=He=>U===He||H.getState().rotateHandleType===He?ta:Da;return h.jsxs("group",{name:"Solar Panel Group",position:[o,r,T+i],rotation:se,children:[h.jsx(TZt,{solarPanelModel:t,groupRotation:se,panelRotation:ne}),fe&&h.jsxs("group",{position:[0,0,-T],rotation:[0,0,ne.z],children:[h.jsx(PR,{id:e,position:[0,-v-x/2,T],color:xe(Kr.Upper),ratio:x,handleType:Kr.Upper,hoverHandle:Z,noHoverHandle:he}),h.jsx(PR,{id:e,position:[0,v+x/2,T],color:xe(Kr.Lower),ratio:x,handleType:Kr.Lower,hoverHandle:Z,noHoverHandle:he})]}),ge&&h.jsxs(h.Fragment,{children:[h.jsx(sR,{name:Kr.Tilt,args:[S,1.1*S,18,2,-Gt,Math.PI],rotation:[0,-Gt,ne.z,"ZXY"],onPointerOver:He=>{Z(He,Kr.Tilt)},onPointerOut:He=>{he()},onPointerDown:He=>{if(_(!0),U){Fn.getState().setEnableOrbitController(!1),X.current=!0,$.current=f;const{rot:Se}=me.getWorldDataById(n);le.current=Se}M(Se=>{Se.rotateHandleType=Kr.Tilt})},children:h.jsx("meshBasicMaterial",{attach:"material",side:$r,color:U===Kr.Tilt||B?ta:Da})}),B&&h.jsxs(h.Fragment,{children:[h.jsx(sR,{ref:q,name:"Solar panel tilt handle",args:[S,2*S,18,2,-Gt,Math.PI],rotation:[0,-Gt,ne.z,"ZXY"],onPointerUp:He=>{if(Math.abs(Q.current-$.current)>It){const Se={name:"Set Solar Panel Tilt Angle",timestamp:Date.now(),oldValue:$.current,newValue:Q.current,changedElementId:e,changedElementType:z.SolarPanel,undo:()=>{D(Se.changedElementId,Se.oldValue)},redo:()=>{D(Se.changedElementId,Se.newValue)}};E(Se)}},onPointerMove:He=>{if(X.current&&(N.setFromCamera(F,k),q.current)){const Se=N.intersectObjects([q.current]);if(Se.length>0){const ze=Se[0].point,Ie=q.current.parent;if(Ie){const ye=Ie.localToWorld(new ie),ce=new ie().subVectors(ze,ye);let pe=ce.angleTo(Io);if(!(.5*l*Math.abs(Math.sin(pe))>T)){const Ae=p+(le.current??0),Te=Ae%Math.PI===0?Math.sign(-ce.y)*Math.sign(Math.cos(Ae)):Math.sign(ce.x)*Math.sign(Math.sin(Ae));pe*=Te,D(e,pe),Q.current=pe}}}}},children:h.jsx("meshBasicMaterial",{attach:"material",depthTest:!1,transparent:!0,opacity:.5,side:$r})}),h.jsx(jn,{points:[[0,0,S],[0,0,1.75*S]],rotation:new nn(f,0,ne.z,"ZXY"),lineWidth:1}),te.map((He,Se)=>h.jsxs("group",{rotation:new nn(Math.PI/12*Se-Gt,0,ne.z,"ZXY"),children:[h.jsx(jn,{points:[[0,0,1.8*S],[0,0,2*S]],color:"white",transparent:!0,opacity:.5}),h.jsx("textSprite",{userData:{unintersectable:!0},text:`${Se*15-90}°`,fontSize:20*S,fontFace:"Times Roman",textHeight:.15*S,position:[0,0,1.6*S]})]},Se)),h.jsx("group",{rotation:new nn(f,0,ne.z,"ZXY"),children:h.jsx("textSprite",{userData:{unintersectable:!0},text:`${Math.floor(f/Math.PI*180)}°`,fontSize:20*S,fontFace:"Times Roman",textHeight:.2*S,position:[0,0,.75*S]})})]})]}),de&&ae.map((He,Se)=>h.jsx(ca,{userData:{unintersectable:!0},name:"Pole "+Se,castShadow:!1,receiveShadow:!1,args:[y,y,g+(He.z-R)*2+s,4,1],position:He,rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:b})},Se))]})},TZt=({solarPanelModel:t,groupRotation:e,panelRotation:n})=>{let{id:o,parentId:r,lx:i,ly:a,lz:l,cx:s,cy:c,cz:u,normal:d,tiltAngle:f,relativeAzimuth:p,trackerType:g,drawSunBeam:y,locked:w,showLabel:b,label:C,pvModelName:P,orientation:v,frameColor:T,backsheetColor:A,color:x,poleHeight:S}=t;const R=Es(o),M=H(fn),D=H(Y0),E=H(rl),W=H(Tc),j=H(d1),L=H(s0),k=ht(Ss),N=H(fW),F=H(pBe),U=H(Id)??!1,O=m.useMemo(()=>({lng:L}),[L]),B=b$e(d),_=B?f:0,X=B?p:0,$=Math.max(1,(i+a)/16),Q=Vx*$*1.5,le=c1*$*2,[q,te,re]=[i,a,l].map(Je=>Je/2),ae=[Q,Q,l*1.2],se=N[P];se&&(l=Math.max(se.thickness,.02));const ne=m.useMemo(()=>new Date(E),[E]),fe=m.useMemo(()=>(C||Y.t("shared.SolarPanelElement",O))+(w?" ("+Y.t("shared.ElementLocked",O)+")":"")+(C?"":` -`+Y.t("word.Coordinates",O)+": ("+s.toFixed(1)+", "+c.toFixed(1)+", "+u.toFixed(1)+") "+Y.t("word.MeterAbbreviation",O)),[C,w,O,s,c,u]),ge=m.useMemo(()=>{const Je=[];if(se){let We,Ke;v===vr.portrait?(We=Math.max(1,Math.round(i/se.width)),Ke=Math.max(1,Math.round(a/se.length))):(We=Math.max(1,Math.round(i/se.length)),Ke=Math.max(1,Math.round(a/se.width)));const Ne=i/We,De=a/Ke;for(let ke=0;ke<=We;ke++)Je.push({points:[new ie(-q+ke*Ne,-te,l),new ie(-q+ke*Ne,te,l)]});for(let ke=0;ke<=Ke;ke++)Je.push({points:[new ie(-q,-te+ke*De,l),new ie(q,-te+ke*De,l)]})}return Je},[se,v,P,i,a,l]),[de,Z]=m.useState(pe()),[he,xe]=m.useState(!1),[He,Se]=m.useState(null),ze=m.useRef(null),{gl:Ie}=oi(),ye=x$e(i,a,se,v,T,A),ce=v$e(o);ay(()=>{const Je=pe();Je.equals(de)||Z(Je)});function pe(){const Je=new nn,We=S$e(r,e.z);return g===za.NO_TRACKER?Je.set(-e.x-_,0,-We-X):Je.set(-e.x-n.x,-n.y,-We-n.z),Ei(ne,W).applyEuler(Je)}function ve(Je){return He===Je||j===Je?ta:Da}function Ae(Je){if(Je.intersections.length>0&&Je.eventObject.name.includes(Jie)){const Ke=Je.object.name;Se(Ke),Ke===Ho.Top?Ie.domElement.style.cursor="move":Ke===Kr.Lower||Ke===Kr.Upper||Ke===Kr.Tilt?Ie.domElement.style.cursor="grab":Ie.domElement.style.cursor="pointer"}}function Te(){Se(null),Ie.domElement.style.cursor="default"}function Me(Je,We){Fn.getState().setEnableOrbitController(!1),M(Ke=>{Ke.resizeHandleType=Je,Ke.resizeAnchor.copy(We)})}function Pe(Je){if(Je.intersections.length>0&&Je.intersections[0].eventObject.name===Jie){const We=Je.object.name;switch(We){case Ho.Default:{Fn.getState().setEnableOrbitController(!1),M(Ke=>{Ke.moveHandleType=We,Ke.selectedElement=Ke.elements.find(Ne=>{var De;return Ne.id===((De=Ke.selectedElement)==null?void 0:De.id)})});break}case vt.Left:{const Ke=Je.object.localToWorld(new ie(i,0,0));Me(We,Ke);break}case vt.Right:{const Ke=Je.object.localToWorld(new ie(-i,0,0));Me(We,Ke);break}case vt.Lower:{const Ke=Je.object.localToWorld(new ie(0,a,0));Me(We,Ke);break}case vt.Upper:{const Ke=Je.object.localToWorld(new ie(0,-a,0));Me(We,Ke);break}}}}function Ee(){return k&&ce?h.jsx("meshBasicMaterial",{attach:"material-4",map:ce}):ye?U||F===0?h.jsx("meshStandardMaterial",{attach:"material-4",map:ye,color:x}):h.jsx("meshPhongMaterial",{attach:"material-4",specular:new rr((se==null?void 0:se.color)==="Blue"?hG:pG),shininess:F??ew,side:Ra,map:ye,color:x}):h.jsx("meshStandardMaterial",{attach:"material-4",color:x})}function Be(){return(se==null?void 0:se.bifacialityFactor)===0||U||S===0&&f===0?h.jsx("meshStandardMaterial",{attach:"material-5",color:x}):ye?h.jsx("meshPhongMaterial",{attach:"material-5",specular:new rr((se==null?void 0:se.color)==="Blue"?hG:pG),shininess:F??ew,side:Ra,map:ye,color:x}):null}return h.jsxs(h.Fragment,{children:[h.jsxs("group",{name:"Solar Panel Box Group",rotation:n,children:[h.jsxs(Qr,{uuid:o,ref:ze,args:[i,a,l],position:[0,0,re],onPointerDown:Je=>{Je.button!==2&&D(o,Je,Oo.Select)},onContextMenu:Je=>{D(o,Je,Oo.ContextMenu),M(We=>{Je.intersections.length>0&&Je.intersections[0].object===ze.current&&(We.contextMenuObjectType=z.SolarPanel)})},onPointerOver:Je=>{Je.intersections.length>0&&Je.intersections[0].object===ze.current&&(xe(!0),Ie.domElement.style.cursor="move")},onPointerOut:Je=>{xe(!1),Ie.domElement.style.cursor="default"},children:[h.jsx("meshStandardMaterial",{attach:"material-0",color:"white"}),h.jsx("meshStandardMaterial",{attach:"material-1",color:"white"}),h.jsx("meshStandardMaterial",{attach:"material-2",color:"white"}),h.jsx("meshStandardMaterial",{attach:"material-3",color:"white"}),Ee(),Be()]}),R&&!w&&h.jsxs("group",{name:Jie,onPointerDown:Pe,onPointerOver:Ae,onPointerOut:Te,children:[h.jsx(ds,{args:[le,6,6],name:Ho.Default,children:h.jsx("meshBasicMaterial",{color:"orange"})}),h.jsx(Qr,{position:[0,-te,re],args:ae,name:vt.Lower,children:h.jsx("meshBasicMaterial",{color:ve(vt.Lower)})}),h.jsx(Qr,{position:[0,te,re],args:ae,name:vt.Upper,children:h.jsx("meshBasicMaterial",{color:ve(vt.Upper)})}),h.jsx(Qr,{position:[-q,0,re],args:ae,name:vt.Left,children:h.jsx("meshBasicMaterial",{color:ve(vt.Left)})}),h.jsx(Qr,{position:[q,0,re],args:ae,name:vt.Right,children:h.jsx("meshBasicMaterial",{color:ve(vt.Right)})})]}),y&&de.z>0&&h.jsx(PZt,{sunDirection:de}),k&&ce&&ge.map((Je,We)=>h.jsx(jn,{name:"Solar Panel Lines",userData:{unintersectable:!0},points:Je.points,castShadow:!1,receiveShadow:!1,lineWidth:.2,color:"black"},We)),h.jsx(ua,{name:"Solar Panel Simulation Plane",uuid:o,args:[i,a],userData:{simulation:!0},receiveShadow:!1,castShadow:!1,visible:!1,children:h.jsx("meshBasicMaterial",{side:$r})}),R&&w&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-q,-te,0],[-q,te,0],[q,te,0],[q,-te,0],[-q,-te,0]],castShadow:!1,receiveShadow:!1,lineWidth:2,color:y0})]}),(he||b)&&!R&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:fe,color:t.labelColor??"white",fontSize:t.labelFontSize??20,textHeight:t.labelSize??.2,position:[0,0,t.labelHeight??Math.max(te*Math.abs(Math.sin(f))+.1,.2)]})]})},PZt=be.memo(({sunDirection:t})=>{const e=H(Ug),n=m.useMemo(()=>Math.max(100,10*e),[e]);return h.jsxs("group",{name:"Sun Beam Group",children:[h.jsx(jn,{userData:{unintersectable:!0},points:[Io.clone().multiplyScalar(.75),[0,0,0],t.clone().multiplyScalar(n)],name:"Sun Beam",lineWidth:.5,color:"white"}),h.jsx(jn,{userData:{unintersectable:!0},points:[t.clone().multiplyScalar(.5),Io.clone().multiplyScalar(.5)],name:"Angle",lineWidth:.5,color:"white"}),h.jsx("textSprite",{userData:{unintersectable:!0},name:"Angle Value",text:me.toDegrees(t.angleTo(Io)).toFixed(1)+"°",fontSize:20,fontFace:"Times Roman",textHeight:.1,position:t.clone().multiplyScalar(.75).add(Io.clone().multiplyScalar(.75)).multiplyScalar(.5)}),h.jsx("group",{position:Io.clone().multiplyScalar(.75),rotation:[Gt,0,0],children:h.jsx(Rd,{userData:{unintersectable:!0},args:[.04,.2,4,2],name:"Normal Vector Arrow Head",children:h.jsx("meshBasicMaterial",{attach:"material",color:"white"})})})]})});function Yye(t){const[e,n,o]=t;return o===1?new nn(0,0,0):e!==0?new nn(Gt,0,e*Gt,"ZXY"):n!==0?new nn(-n*Gt,0,0):new nn}function b$e(t){return Math.abs(t[2]-1)<.01}function S$e(t,e){const{rot:n}=me.getWorldDataById(t);return n+e}be.memo(SZt);const T$e=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i=1,ly:a=1,lz:l=.1,rotation:s=[0,0,0],normal:c=[0,0,1],color:u="white",lineColor:d="black",lineWidth:f=.1,locked:p=!1,label:g,showLabel:y=!1,parentId:w,foundationId:b,light:C=!0,heatFlux:P=!1}=t,v=H(fn),T=H(Ds),A=H(Y0),x=Es(e),{gl:{domElement:S}}=oi(),[R,M]=m.useState(!1),D=m.useRef(null),E=m.useRef(null),W=Jt(),j=H(_=>{for(const X of _.elements)if(X.id===w)return X}),L=H(_=>{for(const X of _.elements)if(X.id===b)return X});let k=n,N=o,F=r;if(w&&j)switch(j.type){case z.Foundation:{if(F=j.cz+j.lz/2,me.isZero(s[2]))k=j.cx+n*j.lx,N=j.cy+o*j.ly;else{const _=new ie(n*j.lx,o*j.ly,0);_.applyAxisAngle(Io,s[2]),k=j.cx+_.x,N=j.cy+_.y}break}case z.Wall:{if((L==null?void 0:L.type)===z.Foundation){const _=me.absoluteCoordinates(n,o,r,j,L);k=_.x,N=_.y,F=_.z}break}case z.Roof:{if((L==null?void 0:L.type)===z.Foundation){const _=me.absoluteCoordinates(n,o,r,j,L);k=_.x,N=_.y,F=_.z}break}}const U=l/2,O=m.useMemo(()=>{if((j==null?void 0:j.type)===z.Wall){const X=j,$=L?L.rotation[2]+X.relativeAngle:X.relativeAngle;return new nn(Gt,0,$,"ZXY")}if((j==null?void 0:j.type)===z.Roof)return new nn(s[0],s[1],L?L.rotation[2]+s[2]:s[2],"ZXY");if((j==null?void 0:j.type)===z.Cuboid)return Yye(c);const _=new ie().fromArray(c);return me.isSame(_,Op)?new nn(0,Gt,s[2],"ZXY"):me.isSame(_,_p)?new nn(0,-Gt,s[2],"ZXY"):me.isSame(_,Oc)?new nn(-Gt,0,s[2],"ZXY"):me.isSame(_,Vp)?new nn(Gt,0,s[2],"ZXY"):new nn(0,0,s[2])},[c,s,L==null?void 0:L.rotation]),B=m.useMemo(()=>(g||Y.t("shared.SensorElement",W))+(p?" ("+Y.t("shared.ElementLocked",W)+")":"")+` -`+Y.t("word.Coordinates",W)+": ("+k.toFixed(1)+", "+N.toFixed(1)+", "+F.toFixed(1)+") "+Y.t("word.MeterAbbreviation",W),[g,p,W,k,N,F]);return h.jsxs("group",{name:"Sensor Group "+e,rotation:O,position:[k,N,F+U],children:[h.jsx(Qr,{receiveShadow:T,uuid:e,ref:D,args:[i,a,l],name:"Sensor",onPointerDown:_=>{_.button!==2&&(A(e,_,Oo.Move),Fn.getState().setEnableOrbitController(!1),ht.getState().set(X=>{X.showWallIntersectionPlaneId=w,X.oldParentId=w,X.oldFoundationId=b}),v(X=>{X.moveHandleType=Ho.Default}))},onContextMenu:_=>{A(e,_,Oo.ContextMenu),v(X=>{_.intersections.length>0&&_.intersections[0].object===D.current&&(X.contextMenuObjectType=z.Sensor)})},onPointerOver:_=>{_.intersections.length>0&&_.intersections[0].object===D.current&&(M(!0),S.style.cursor="move")},onPointerOut:()=>{M(!1),S.style.cursor="default"},children:h.jsx("meshStandardMaterial",{attach:"material",color:t!=null&&t.lit?ta:u})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Meter",castShadow:!1,receiveShadow:!1,args:[i*.3,a*.3,U,8,1],position:new ie(0,0,U),rotation:[Gt,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:"black"})}),!x&&h.jsx(fw,{hx:i/2,hy:a/2,hz:l/2,lineColor:d,lineWidth:f}),x&&p&&h.jsx(fw,{hx:i/2,hy:a/2,hz:l/2,lineColor:y0,lineWidth:f*10}),x&&!p&&h.jsx(ds,{ref:E,position:new ie(0,0,0),args:[c1,6,6,0,Math.PI],name:Ho.Default,onPointerDown:_=>{_.button===2?(A(e,_,Oo.ContextMenu),v(X=>{_.intersections.length>0&&_.intersections[0].object===E.current&&(X.contextMenuObjectType=z.Sensor)})):A(e,_,Oo.Move),Fn.getState().setEnableOrbitController(!1),ht.getState().set(X=>{X.showWallIntersectionPlaneId=w,X.oldParentId=w,X.oldFoundationId=b}),v(X=>{X.moveHandleType=Ho.Default})},children:h.jsx("meshBasicMaterial",{attach:"material",color:"orange"})}),(R||y)&&!x&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:B,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,l+((t==null?void 0:t.labelHeight)??.2)]})]})}),P$e=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i=1,ly:a=1,lz:l=.1,rotation:s=[0,0,0],normal:c=[0,0,1],color:u="#ffff99",lineWidth:d=.1,locked:f=!1,label:p,showLabel:g=!1,parentId:y,foundationId:w,decay:b=2,distance:C=5,intensity:P=3,inside:v=!1}=t,T=H(fn),A=H(Ds),x=H(Y0),R=H(Dw).z<=0,M=Es(e),{gl:{domElement:D}}=oi(),[E,W]=m.useState(!1),j=m.useRef(null),L=m.useRef(null),k=Jt(),N=H(le=>{for(const q of le.elements)if(q.id===y)return q}),F=H(le=>{for(const q of le.elements)if(q.id===w)return q});let U=.1,O=n,B=o,_=r;if(y&&N)switch(N.type){case z.Foundation:if(_=N.cz+N.lz/2,me.isZero(s[2]))O=N.cx+n*N.lx,B=N.cy+o*N.ly;else{const le=new ie(n*N.lx,o*N.ly,0);le.applyAxisAngle(Io,s[2]),O=N.cx+le.x,B=N.cy+le.y}break;case z.Wall:if((F==null?void 0:F.type)===z.Foundation){const le=me.absoluteCoordinates(n,o,r,N,F);O=le.x,B=le.y,_=le.z}U=N.ly;break;case z.Roof:if((F==null?void 0:F.type)===z.Foundation){const le=me.absoluteCoordinates(n,o,r,N,F);O=le.x,B=le.y,_=le.z}U=N.thickness;break}const X=l/2,$=m.useMemo(()=>{if((N==null?void 0:N.type)===z.Wall){const q=N,te=F?F.rotation[2]+q.relativeAngle:q.relativeAngle;return new nn(Gt,0,te,"ZXY")}if((N==null?void 0:N.type)===z.Roof)return new nn(s[0],s[1],F?F.rotation[2]+s[2]:s[2],"ZXY");if((N==null?void 0:N.type)===z.Cuboid)return Yye(c);const le=new ie().fromArray(c);return me.isSame(le,Op)?new nn(0,Gt,s[2],"ZXY"):me.isSame(le,_p)?new nn(0,-Gt,s[2],"ZXY"):me.isSame(le,Oc)?new nn(-Gt,0,s[2],"ZXY"):me.isSame(le,Vp)?new nn(Gt,0,s[2],"ZXY"):new nn(0,0,s[2])},[c,s,F,N]),Q=m.useMemo(()=>(p||Y.t("shared.LightElement",k))+(f?" ("+Y.t("shared.ElementLocked",k)+")":"")+` -`+Y.t("word.Coordinates",k)+": ("+O.toFixed(1)+", "+B.toFixed(1)+", "+_.toFixed(1)+") "+Y.t("word.MeterAbbreviation",k),[p,f,k,O,B,_]);return h.jsxs("group",{name:"Light Group "+e,rotation:$,position:[O,B,_],children:[R&&h.jsx("pointLight",{color:u,name:"Point Light "+e,position:[0,0,v?-U-X:X],decay:b*.2,distance:C,intensity:P,castShadow:!0}),h.jsx(ca,{receiveShadow:A,userData:{unintersectable:!0},uuid:e,ref:j,position:[0,0,v?-U:0],rotation:[Gt,0,0],args:[i*.5,a*.5,X,16,1],name:"Light Base",onPointerDown:le=>{le.button!==2&&(x(e,le,Oo.Move),Fn.getState().setEnableOrbitController(!1),ht.getState().set(q=>{q.showWallIntersectionPlaneId=y,q.oldParentId=y,q.oldFoundationId=w}))},onContextMenu:le=>{x(e,le,Oo.ContextMenu),T(q=>{le.intersections.length>0&&le.intersections[0].object===j.current&&(q.contextMenuObjectType=z.Light)})},onPointerOver:le=>{le.intersections.length>0&&le.intersections[0].object===j.current&&(W(!0),D.style.cursor="move")},onPointerOut:()=>{W(!1),D.style.cursor="default"},children:h.jsx("meshStandardMaterial",{attach:"material",color:"lightgray"})}),h.jsx(ds,{userData:{unintersectable:!0},name:"Light Bulb",castShadow:!1,receiveShadow:A,args:[i*.3,8,8,0,la,0,Math.PI],position:new ie(0,0,v?-U-X:X),rotation:[Gt,0,0],children:R?h.jsx("meshBasicMaterial",{attach:"material",color:"white"}):h.jsx("meshStandardMaterial",{attach:"material",color:"white"})}),M&&f&&h.jsx(fw,{hx:i/2,hy:a/2,hz:l/2,lineColor:y0,lineWidth:d*10}),M&&!f&&h.jsx(ds,{ref:L,position:new ie(0,0,v?-U-X:X),args:[c1,6,6,v?Math.PI:0,Math.PI],name:Ho.Default,onPointerDown:le=>{le.button===2?(x(e,le,Oo.ContextMenu),T(q=>{le.intersections.length>0&&le.intersections[0].object===L.current&&(q.contextMenuObjectType=z.Light)})):x(e,le,Oo.Move),Fn.getState().setEnableOrbitController(!1),ht.getState().set(q=>{q.showWallIntersectionPlaneId=y,q.oldParentId=y,q.oldFoundationId=w})},children:h.jsx("meshBasicMaterial",{attach:"material",color:"orange"})}),(E||g)&&!M&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:Q,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,(v?-U:0)+l+((t==null?void 0:t.labelHeight)??.2)]})]})}),Ov="Cuboid Wrapper",C$e="Cuboid Stackable Child",R$e=({elements:t,cuboidModel:e})=>{const{id:n,cx:o,cy:r,lx:i,ly:a,lz:l,rotation:s}=e,c=l/2,u=d=>w$e(d)&&d.parentId===n;return h.jsxs("group",{name:Ov,position:[o,r,c],rotation:[0,0,s[2]],userData:{id:n,fId:n},children:[h.jsx(xZt,{...e}),h.jsx(Oye,{parentId:n,foundationId:n,wrapperType:z.Cuboid,plx:i,ply:a,plz:l}),t.map(d=>{if(u(d))return h.jsx("group",{name:C$e,position:[0,0,c],children:h.jsx(R$e,{elements:t,cuboidModel:d})},d.id);if(d.parentId===n){const{lx:f,ly:p,lz:g}=e;switch(d.type){case z.Sensor:return h.jsx(T$e,{...d,cx:d.cx*f,cy:d.cy*p,cz:d.cz*g},d.id);case z.Light:return h.jsx(P$e,{...d,cx:d.cx*f,cy:d.cy*p,cz:d.cz*g},d.id);default:return null}}else return null})]})},lX=be.memo(({positionY:t,name:e,onPointerDown:n})=>{const o=a5(),{_color:r,_onPointerDown:i,_onPointerMove:a,_onPointerLeave:l}=MQ(Da,"grab"),s=c=>{n(c),i()};return h.jsxs("group",{name:e,position:[0,t,0],rotation:[Gt,0,0],scale:o*3,onPointerDown:s,onPointerMove:a,onPointerLeave:l,children:[h.jsx(mge,{args:[.15,.05,6,8,3/2*Math.PI],rotation:[Gt,0,Gt],children:h.jsx("meshBasicMaterial",{color:r})}),h.jsx(Rd,{args:[.1,.1,6],rotation:[Gt,0,0],position:[.15,0,.05],children:h.jsx("meshBasicMaterial",{color:r})}),h.jsx(lR,{args:[.05,6],rotation:[0,Gt,0],position:[0,0,.15],children:h.jsx("meshBasicMaterial",{color:r})}),h.jsx(ua,{args:[.35,.35],position:[0,.05,0],rotation:[-Gt,0,0],visible:!1})]})}),CZt=be.memo(m.forwardRef(({tiltAngle:t,positionZ:e,isOnVerticalSurface:n,onPointerDown:o,onPointerMove:r},i)=>{const a=a5()*3,l=Math.PI/12,s=m.useMemo(()=>n?Gt:Math.PI,[n]),c=m.useMemo(()=>n?new Array(7).fill(0):new Array(13).fill(0),[n]),u=m.useMemo(()=>n?e:0,[n,e]),[d,f]=m.useState(!1),p=m.useRef(null),g=m.useRef(null),y=m.useRef(null),{_color:w,_onPointerDown:b,_onPointerMove:C,_onPointerLeave:P}=MQ(Da,"grab");m.useImperativeHandle(i,()=>({setVisiable(x){p.current&&(p.current.visible=x)},update(x,S){g.current&&g.current.rotation.set(x,0,0),y.current&&(y.current.text=v(x)),p.current&&(p.current.position.z=S)}}),[]);const v=x=>{const S=n?-x:x;return`${Math.floor(S/Math.PI*180)}°`},T=x=>{f(!0),o(x),b()},A=x=>{r(x)};return m.useEffect(()=>{const x=()=>{f(!1)};return window.addEventListener("pointerup",x),()=>window.addEventListener("pointerup",x)},[]),h.jsxs("group",{name:"Tilt_Handle_Group",ref:p,position:[0,0,u],children:[h.jsx(sR,{name:Kr.Tilt,args:[a,1.125*a,18,2,0,s],rotation:[Gt,0,Gt,"ZXY"],onPointerDown:T,onPointerMove:C,onPointerLeave:P,children:h.jsx("meshBasicMaterial",{side:$r,color:w})}),d&&h.jsxs(h.Fragment,{children:[h.jsx(sR,{name:"Tilt_Handle_Intersection_Plane",args:[a,2*a,18,2,0,s],rotation:[Gt,0,Gt,"ZXY"],onPointerMove:A,children:h.jsx("meshBasicMaterial",{transparent:!0,depthTest:!1,opacity:.5,side:$r})}),h.jsx("group",{rotation:[-Gt,0,0],children:c.map((x,S)=>{const R=n?`${90-S*15}°`:`${S*15-90}°`;return h.jsxs("group",{rotation:[l*S,0,0,"ZXY"],children:[h.jsx(jn,{points:[[0,0,1.8*a],[0,0,2*a]],color:"white",transparent:!0,opacity:.5}),h.jsx("textSprite",{userData:{unintersectable:!0},text:R,fontSize:20*a,fontFace:"Times Roman",textHeight:.15*a,position:[0,0,1.6*a]})]},S)})}),h.jsxs("group",{ref:g,rotation:[t,0,0],children:[h.jsx(jn,{points:[[0,0,a],[0,0,1.75*a]]}),h.jsx("textSprite",{ref:y,userData:{unintersectable:!0},text:v(t),fontSize:20*a,fontFace:"Times Roman",textHeight:.2*a,position:[0,0,.75*a]})]})]})]})})),RZt=be.memo(()=>h.jsxs("group",{name:"Normal Pointer Group",children:[h.jsx(jn,{points:[[0,0,0],[0,0,1]],userData:{unintersectable:!0},lineWidth:.5,color:"white"}),h.jsx(Rd,{position:[0,0,1],rotation:[Gt,0,0],userData:{unintersectable:!0},args:[.04,.2,4,2],children:h.jsx("meshBasicMaterial",{color:"white"})})]})),HZt=be.memo(be.forwardRef(({positionZ:t,rotationX:e,topTiltGroupRef:n},o)=>{const r=H(Ug),i=H(rl),a=H(Tc),l=m.useMemo(()=>Math.max(100,10*r),[r]),s=m.useMemo(()=>Ei(new Date(i),a),[i,a]),c=m.useRef(null),u=m.useRef(null),d=m.useRef(null),[f,p]=m.useState(null),[g,y]=m.useState(null),[w,b]=m.useState(new ie),[C,P]=m.useState(!1),v=M=>{M?C||P(!0):C&&P(!1)},T=M=>!(s.z<0||M<0||M>90),A=()=>n.current?n.current.getWorldDirection(zl).angleTo(s)/Math.PI*180:-1,x=M=>M.toFixed(1)+"°",S=()=>{if(!n.current||!c.current)return null;const M=Hu.setFromQuaternion(c.current.getWorldQuaternion(lf)).z;Hu.set(0,0,-M);const D=c.current.getWorldPosition(nde),E=n.current.localToWorld(zl.set(0,0,.5)).sub(D).applyEuler(Hu),W=u.current.localToWorld(i9.set(0,0,.5)).sub(D).applyEuler(Hu);return[E.clone(),W.clone()]},R=M=>{if(!f||f.length!==2||!M||M.length!==2)return!1;const[D,E]=M,[W,j]=f;return me.isSame(D,W)&&me.isSame(E,j)};return m.useImperativeHandle(o,()=>({setPositionZ(M){c.current&&(c.current.position.z=M)},setRotationX(M){c.current&&(c.current.rotation.x=M)}}),[]),m.useEffect(()=>{if(!n.current)return;const M=A();if(T(M))v(!0);else{v(!1);return}y(x(M));const E=S();if(p(E),E&&E.length===2){const[W,j]=E,L=new ie().addVectors(W,j).divideScalar(2).multiplyScalar(1.5);b(L)}},[]),ay(()=>{if(!n.current)return;const M=A();if(T(M))v(!0);else{v(!1);return}u.current&&u.current.lookAt(u.current.getWorldPosition(zl).add(s));const E=S();if(R(E)||p(E),d.current&&(E==null?void 0:E.length)===2){const[W,j]=E;d.current.position.addVectors(W,j).divideScalar(2).multiplyScalar(1.5),d.current.text=x(M)}}),C?h.jsxs("group",{ref:c,position:[0,0,t],rotation:[e,0,0],children:[h.jsx(jn,{name:"Sun Beam",ref:u,points:[[0,0,0],[0,0,l]],userData:{unintersectable:!0},lineWidth:.5,color:"white"}),f&&w&&g&&h.jsxs(h.Fragment,{children:[h.jsx(jn,{name:"Angle Line",points:f,userData:{unintersectable:!0},lineWidth:1,color:"white"}),h.jsx("textSprite",{ref:d,position:w,text:g,userData:{unintersectable:!0},fontSize:20,fontFace:"Times Roman",textHeight:.1})]})]}):null})),MZt=be.memo(m.forwardRef(({tiltAngle:t,trackerType:e,surfaceType:n,children:o},r)=>{const i=m.useRef(null),a=H(rl),l=H(Tc),s=m.useRef(new ie),c=m.useMemo(()=>{const f=Ei(new Date(a),l);return s.current.copy(f),f},[a,l]),u=()=>{i.current&&i.current.rotation.set(0,0,0)},d=(f,p)=>{if(i.current)switch(f){case za.ALTAZIMUTH_DUAL_AXIS_TRACKER:{i.current.rotation.set(Math.atan2(Math.hypot(s.current.x,s.current.y),s.current.z),0,Math.atan2(s.current.y,s.current.x)+Gt-p,"ZXY");break}case za.VERTICAL_SINGLE_AXIS_TRACKER:{i.current.rotation.set(t,0,Math.atan2(s.current.y,s.current.x)+Gt-p,"ZXY");break}case za.HORIZONTAL_SINGLE_AXIS_TRACKER:{const g=new ie().copy(s.current).applyEuler(Hu.set(0,0,-p));i.current.rotation.set(0,Math.atan2(g.x,g.z),0,"ZXY");break}}};return m.useImperativeHandle(r,()=>({reset(){u()},update(f,p){d(f,p)}}),[]),m.useEffect(()=>{if(!i.current)return;if(e===za.NO_TRACKER||n!==Lp.Horizontal){u();return}const f=ea.findParentGroup(i.current,[P2,Ov]);f&&d(e,Hu.setFromQuaternion(f.getWorldQuaternion(lf)).z)},[c,e,n]),h.jsx("group",{ref:i,children:o})})),IZt=({solarPanel:t,lx:e,ly:n})=>{const{id:o,tiltAngle:r,pvModelName:i,orientation:a,color:l}=t,s=ht(Ss),c=H(Id)??!1,u=H(pBe),d=H.getState().pvModules[i],f=x$e(e,n,d,a,t.frameColor,t.backsheetColor),p=v$e(o),g=()=>s&&p?h.jsx("meshBasicMaterial",{attach:"material-4",map:p}):f?c||u===0?h.jsx("meshStandardMaterial",{attach:"material-4",map:f,color:l}):h.jsx("meshPhongMaterial",{attach:"material-4",specular:new rr((d==null?void 0:d.color)==="Blue"?hG:pG),shininess:u??ew,side:Ra,map:f,color:l}):null,y=()=>(d==null?void 0:d.bifacialityFactor)===0||c?h.jsx("meshStandardMaterial",{attach:"material-5",color:l}):f?h.jsx("meshPhongMaterial",{attach:"material-5",specular:new rr((d==null?void 0:d.color)==="Blue"?hG:pG),shininess:u??ew,side:Ra,map:f,color:l}):null;return h.jsxs(h.Fragment,{children:[h.jsx("meshStandardMaterial",{attach:"material-0",color:l}),h.jsx("meshStandardMaterial",{attach:"material-1",color:l}),h.jsx("meshStandardMaterial",{attach:"material-2",color:l}),h.jsx("meshStandardMaterial",{attach:"material-3",color:l}),g(),y()]})},zZt=be.memo(m.forwardRef(({lx:t,ly:e,poleRadius:n,poleHeight:o,poleSpacing:r,tiltAngle:i,color:a,visiable:l},s)=>{const c=H(v=>v.elements.length>100?2:4),[u,d]=nC(t),[f,p]=nC(e),[g,y]=nC(i),[w,b]=nC(l),C=m.useRef(null);m.useImperativeHandle(s,()=>({update({lx:v,ly:T,tilt:A}){v!==void 0&&d(v),T!==void 0&&p(T),A!==void 0&&y(A)},setVisiable(v){b(v)}}),[]);const P=m.useMemo(()=>{const v=[],T=Math.floor(.5*u/r),A=Math.floor(.5*f*Math.abs(Math.cos(g))/r),x=Math.tan(g);for(let S=-T;S<=T;S++)for(let R=-A;R<=A;R++){const M=S*r,D=R*r,E=x*D+o,W=(E-o)/2;v.push(new Qa(M,D,W,E))}return v},[u,f,g,r,o]);return w?h.jsx("group",{name:"Poles group",ref:C,position:[0,0,-o/2],children:P.map((v,T)=>v.w<0?null:h.jsx(ca,{userData:{unintersectable:!0},name:"Pole "+T,args:[n,n,v.w,c,1],position:[v.x,v.y,v.z],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{color:a})},T))}):null})),DZt=be.memo(({hlx:t,hly:e})=>h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-t,-e,0],[-t,e,0],[t,e,0],[t,-e,0],[-t,-e,0]],lineWidth:3,color:y0})),EZt=be.memo(({solarPanel:t,boxRef:e})=>{const{ly:n,tiltAngle:o,label:r,locked:i,labelColor:a="white",labelFontSize:l=20,labelSize:s=.2,labelHeight:c}=t,u=n/2,d=Jt(),[f,p]=m.useState("");m.useEffect(()=>{if(!e.current)return;const{x:y,y:w,z:b}=e.current.getWorldPosition(zl);p((r??Y.t("shared.SolarPanelElement",d))+(i?" ("+Y.t("shared.ElementLocked",d)+")":"")+(r?"":` -`+Y.t("word.Coordinates",d)+": ("+y.toFixed(1)+", "+w.toFixed(1)+", "+b.toFixed(1)+") "+Y.t("word.MeterAbbreviation",d)))},[r,i,d]);const g=c??Math.max(u*Math.abs(Math.sin(o))+.1,.2);return h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:f,color:a,fontSize:l,textHeight:s,position:[0,0,g]})}),H$e=be.memo(({onPointerDown:t})=>{const{_color:e,_onPointerDown:n,_onPointerMove:o,_onPointerLeave:r}=MQ(tw,"move"),i=a5()*.75,{gl:a}=oi();return h.jsx(ds,{name:"Move_Handle",args:[i],onPointerDown:l=>{t(l),n(),a.domElement.style.cursor="move"},onPointerMove:o,onPointerLeave:r,children:h.jsx("meshBasicMaterial",{color:e})})}),oC=be.memo(({cx:t,cy:e,size:n,type:o})=>{const{_color:r,_onPointerDown:i,_onPointerMove:a,_onPointerLeave:l}=MQ(Da,"pointer");return h.jsx(Qr,{name:o,position:[t,e,.1],args:[n,n,.1],onPointerDown:i,onPointerMove:a,onPointerLeave:l,children:h.jsx("meshBasicMaterial",{color:r})})}),FZt=be.memo(m.forwardRef(({hlx:t,hly:e,onPointerDown:n},o)=>{const r=a5();return h.jsxs("group",{name:"Resize_Handles_Group",ref:o,onPointerDown:n,children:[h.jsx(oC,{type:vt.Left,cx:-t,cy:0,size:r}),h.jsx(oC,{type:vt.Right,cx:t,cy:0,size:r}),h.jsx(oC,{type:vt.Lower,cx:0,cy:-e,size:r}),h.jsx(oC,{type:vt.Upper,cx:0,cy:e,size:r})]})})),M$e=be.memo(({children:t,onPointerOut:e,onPointerOver:n})=>{const o=H(Ds);return h.jsx(Qr,{name:"Box_Mesh",receiveShadow:o,castShadow:o,onPointerOver:n,onPointerOut:e,children:t})}),kZt=({lx:t,ly:e,lz:n,orientation:o,modelLength:r,modelWidth:i})=>{const a=[],[l,s,c]=[t/2,e/2,n/2];let u,d;o===vr.portrait?(u=Math.max(1,Math.round(t/i)),d=Math.max(1,Math.round(e/r))):(u=Math.max(1,Math.round(t/r)),d=Math.max(1,Math.round(e/i)));const f=t/u,p=e/d;for(let g=0;g<=u;g++)a.push({points:[new ie(-l+g*f,-s,c),new ie(-l+g*f,s,c)]});for(let g=0;g<=d;g++)a.push({points:[new ie(-l,-s+g*p,c),new ie(l,-s+g*p,c)]});return h.jsx("group",{name:"Solar Panel Heatmap Lines Group",position:[0,0,.005],children:a.map((g,y)=>h.jsx(jn,{name:"Solar Panel Lines",userData:{unintersectable:!0},points:g.points,lineWidth:.2},y))})},LZt=be.memo(({lx:t,ly:e,lz:n,orientation:o,modelLength:r,modelWidth:i})=>ht(Ss)?h.jsx(kZt,{lx:t,ly:e,lz:n,orientation:o,modelLength:r,modelWidth:i}):null),I$e=be.memo(m.forwardRef(({lx:t,ly:e,relativeAzimuth:n},o)=>{const r=Math.max(5,Math.hypot(t,e)*.75),i=m.useMemo(()=>new Array(25).fill(0),[]),a=o3(lW,fN),l=r*.05,s={font:a,height:0,size:l},c=f=>f===0?-l*.3:f>0&&f<7?-l*.8:-l*1.2,[u,d]=m.useState(n);return m.useImperativeHandle(o,()=>({setAzimuth:f=>{f<-Math.PI?d(f+Math.PI*2):f>Math.PI?d(f-Math.PI*2):d(f)}})),h.jsxs("group",{rotation:[Gt,0,0],position:[0,0,.1],name:"Solar Panel Polar Grid Group",children:[h.jsx("polarGridHelper",{args:[r,24,6,120,"white","white"],userData:{unintersectable:!0}}),h.jsx(sR,{args:[r*.98,r,24,1,Gt,u],userData:{unintersectable:!0},rotation:[-Gt,0,0],children:h.jsx("meshBasicMaterial",{side:$r,color:"yellow"})}),h.jsx("group",{rotation:[0,u,0],children:h.jsx("mesh",{position:[-.5,0,-r*.9],rotation:[-Gt,0,0],userData:{unintersectable:!0},children:h.jsx("textGeometry",{args:[`${-me.toDegrees(u).toFixed(1)}°`,s]})})}),i.map((f,p)=>{let g=Math.ceil(p/2)*(p%2===0?1:-1);g===-12&&(g=12);const y=c(Math.abs(g));return h.jsx("group",{rotation:[0,g*Math.PI/12,0],children:h.jsxs("mesh",{position:[y,0,-r*1.05],rotation:[-Gt,0,0],userData:{unintersectable:!0},children:[h.jsx("textGeometry",{args:[`${-15*g}°`,s]}),h.jsx("meshStandardMaterial",{attach:"material",color:"lightGray"})]})},p)})]})})),WZt=be.memo(m.forwardRef(({lx:t,ly:e,tiltAngle:n,modelLength:o,visiable:r},i)=>{const a=H(Ds),l=.75,s=(v,T)=>{const A=T*l,x=Math.cos(v),S=v/2,R=A*Math.sin(S)*2,M=S;return{cz:(A-T/2)*x+R*Math.sin(M),mountAngle:M,length:R}},{cz:c,mountAngle:u,length:d}=m.useMemo(()=>s(n,e),[n,e]),[f,p]=nC(t),[g,y]=nC(r),w=m.useMemo(()=>{const v=[];let A=Math.round(f/o)%2===0?o/2:0;for(;A({update(v,T){if(b.current&&C.current&&P.current){const{cz:A,mountAngle:x,length:S}=s(-v,T);b.current.position.y=-A,C.current.rotation.x=-x,P.current.position.z=S/2,P.current.scale.z=S-.025}},resizeX(v){p(v)},setVisiable(v){y(v)}}));const b=m.useRef(null),C=m.useRef(null),P=m.useRef(null);return g?h.jsx("group",{ref:b,position:[0,-c,0],castShadow:a,receiveShadow:a,children:h.jsx("group",{ref:C,rotation:[-u,0,0],children:h.jsx("group",{ref:P,position:[0,0,d/2],scale:[1,1,d-.025],children:w.map((v,T)=>h.jsx(Qr,{position:[v,0,0],args:[.05,.05,1],children:h.jsx("meshStandardMaterial",{color:"#BFBFBF"})},T))})})}):null}));var Wa=(t=>(t.Move="Move",t.RotateUpper="RotateUpper",t.RotateLower="RotateLower",t.ResizeX="ResizeX",t.ResizeY="ResizeY",t.ResizeHeight="ResizeHeight",t.Tilt="Tilt",t.None="None",t))(Wa||{}),Lp=(t=>(t.Vertical="Vertical",t.Horizontal="Horizontal",t.Inclined="Inclined",t))(Lp||{});const NZt="Intersection Plane XY",pO=1,DSe=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i,ly:a,rotation:l,normal:s,relativeAzimuth:c,tiltAngle:u,parentType:d,drawSunBeam:f,trackerType:p=za.NO_TRACKER,pvModelName:g="SPR-X21-335-BLK",orientation:y=vr.landscape,poleHeight:w,poleRadius:b,poleSpacing:C,color:P="white",locked:v}=t,T=m.useMemo(()=>ea.getPVModel(g),[g]),A=Math.max(T.thickness,.02),[x,S,R]=[i/2,a/2,A/2],M=Es(e),{materialLx:D,materialLy:E,setMaterialSize:W}=bZt(i,a),{set:j,get:L,raycaster:k}=oi(),N=H(fn),[F,U]=m.useState(!1),[O,B]=m.useState(!1),[_,X]=m.useState(!1),$=m.useRef(null),Q=m.useRef(null),le=m.useRef(null),q=m.useRef(null),te=m.useRef(null),re=m.useRef(null),ae=m.useRef(null),se=m.useRef(null),ne=m.useRef(null),fe=m.useRef(null),ge=m.useRef(null),de=m.useRef(null),Z=m.useRef(null),he=m.useRef(null),xe=m.useRef(new ie),He=m.useRef(new ie),Se=m.useRef(null),ze=m.useRef(null),Ie=m.useRef(null),ye=m.useRef(null),ce=m.useRef(null),pe=m.useMemo(()=>ea.getSurfaceType(d,new ie().fromArray(s)),[d,s]),ve=m.useMemo(()=>ea.isTrackerEnabled(pe,p),[pe,p]),Ae=m.useMemo(()=>-S*Math.sin(Math.min(0,u)),[u,S]),Te=m.useMemo(()=>{switch(pe){case"Horizontal":return R+w;case"Vertical":return R+Ae;case"Inclined":return R}},[w,R,pe,Ae]),Me=m.useMemo(()=>M&&!v,[M,v]),Pe=m.useMemo(()=>M&&pe==="Horizontal"&&!ve&&!v,[M,pe,p,ve,v]),Ee=m.useMemo(()=>!M||ve||v?!1:pe==="Vertical"||pe==="Horizontal"&&w>0,[M,pe,w,ve,v]),Be=m.useMemo(()=>w>0&&pe==="Horizontal",[w,pe]),Je=m.useMemo(()=>pe==="Vertical",[pe]),We=At=>{j({frameloop:At})},Ke=()=>{if(!te.current)return;const[At,kt]=te.current.scale.toArray().map(gt=>gt/2);if(re.current)for(const gt of re.current.children)switch(gt.name){case vt.Left:{gt.position.x=-At;break}case vt.Right:{gt.position.x=At;break}case vt.Upper:{gt.position.y=kt;break}case vt.Lower:{gt.position.y=-kt;break}}if(ae.current)for(const gt of ae.current.children)switch(gt.name){case Kr.Lower:{gt.position.y=-kt-pO;break}case Kr.Upper:{gt.position.y=kt+pO;break}}},Ne=At=>{if(!At)return;const[kt,gt,dt]=ea.getRotationOnCuboid(At);De(kt,gt,dt),me.isEqual(At.z,1)?he.current!==null?le.current.rotation.z=he.current-Hu.z:le.current.rotation.z=c:le.current.rotation.set(0,0,0)},De=(At,kt,gt)=>{$.current&&$.current.rotation.set(At,kt,gt,"ZXY"),ne.current&&ne.current.setRotationX(-At)},ke=At=>{le.current&&(le.current.position.z=At),ne.current&&ne.current.setPositionZ(At)},Ye=(At,kt)=>{q.current&&(q.current.rotation.x=At),se.current&&se.current.update(At,kt),fe.current&&fe.current.update({tilt:At}),Z.current&&Z.current.update(At,a)},it=(At,kt)=>{const gt=Fn.getState().solarPanelCountRef;gt&>.current&&(gt.current.textContent=`${ea.getRackCount(y,At,kt,T.length,T.width)}`)},Ve=At=>{de.current&&de.current.setAzimuth(At)},yt=At=>{Z.current&&Z.current.resizeX(Math.abs(At))},ct=At=>{Z.current&&Z.current.update(u,Math.abs(At))},Xe=(At,kt,gt)=>{switch(gt){case"Move":{const dt=At.intersectObjects(kt.children);for(const Ct of dt){if(Ct.object.name===sX){const tt=Ct.object.parent;return tt?{intersection:Ct,parentGroup:tt,parentType:z.Foundation}:null}if(Ct.object.name.includes(Eu.WALL_OUTSIDE_SURFACE_MESH_NAME)){const tt=Ct.object.parent;return tt?{intersection:Ct,parentGroup:tt,parentType:z.Wall}:null}if(Ct.object.name.includes("Roof")){const tt=ea.findParentGroup(Ct.object,[sX]);return tt?{intersection:Ct,parentGroup:tt,parentType:z.Roof}:null}if(Ct.object.name.includes("Cuboid")){const tt=ea.findParentGroup(Ct.object,[Ov]);return tt?{intersection:Ct,parentGroup:tt,parentType:z.Cuboid}:null}}break}case"ResizeX":case"ResizeY":case"RotateLower":case"RotateUpper":{if(!O||!ge.current||!ce.current)return null;const dt=At.intersectObjects([ge.current]),Ct=dt[0];return!Ct||me.isEqual(Ct.point.z,0)?null:{intersection:dt[0],parentGroup:ce.current,parentType:d}}}return null},ut=(At,kt)=>{const{length:gt,width:dt}=ea.getUnitSize(y,T.length,T.width);return At==="ResizeX"?(kt-gt&&(kt=gt),Math.round(kt/gt)*gt):At==="ResizeY"?(kt-dt&&(kt=dt),Math.round(kt/dt)*dt):kt},ft=(At,kt)=>{if(kt==="ResizeX")return At;{const gt=Math.abs(2*w/Math.sin(u));return me.clamp(At,-gt,gt)}},ot=(At,kt,gt,dt)=>{var tt;const Ct=kt.children.find(Fe=>Fe.name===ide);if(Ct&&At&&Ct!==At){At.children=At.children.filter(qe=>qe!==$.current),Ct.children.push($.current),$.current.parent=Ct;const Fe=(tt=Ct.parent)==null?void 0:tt.userData;if(Fe&&Fe.id&&Fe.fId&&(Se.current=Fe.id,ze.current=Fe.fId),gt===z.Roof){const qe=ea.getRoofId(dt);qe&&(Se.current=qe)}}Ie.current=gt},st=At=>{At.intersections.length==0||At.intersections[0].object!==At.object||(At.stopPropagation(),ea.setSelected(e,!0),At.button===2&&N(kt=>{kt.contextMenuObjectType=z.SolarPanel}))},at=At=>{if(!M||!$.current||!le.current||At.intersections.length==0||At.intersections[0].object!==At.object)return;We("always"),Fn.getState().setEnableOrbitController(!1),ye.current="Move";const kt=ea.findParentGroup($.current,[P2,Ov]);kt&&(he.current=Hu.setFromQuaternion(kt.getWorldQuaternion(lf.set(0,0,0,0))).z+c)},Oe=At=>{if(!(!M||!$.current||!le.current)&&!(At.intersections.length==0||At.intersections[0].object!==At.object)){switch(We("always"),Fn.getState().setEnableOrbitController(!1),At.object.name){case vt.Left:case vt.Right:{ye.current="ResizeX";break}case vt.Upper:case vt.Lower:{ye.current="ResizeY";break}}pe==="Horizontal"?(le.current.localToWorld(xe.current.set(-At.object.position.x,-At.object.position.y*Math.abs(Math.cos(u)),-R-w)),$.current.getWorldPosition(He.current).sub(xe.current).normalize()):(le.current.localToWorld(xe.current.set(-At.object.position.x,-At.object.position.y,0)),le.current.getWorldPosition(He.current).sub(xe.current).normalize()),B(!0),ce.current=ea.findParentGroup($.current,[z$e,P2,Ov])}},Ze=At=>{if(!(!le.current||!ae.current)&&!(At.intersections.length==0||At.intersections[0].object!==At.object)){switch(We("always"),Fn.getState().setEnableOrbitController(!1),At.eventObject.name){case Kr.Upper:{ye.current="RotateUpper";break}case Kr.Lower:{ye.current="RotateLower";break}}le.current.getWorldPosition(xe.current),xe.current.z=0,B(!0),X(!0),ce.current=ea.findParentGroup($.current,[P2,Ov])}},St=At=>{At.intersections.length==0||At.intersections[0].object!==At.object||(ye.current="Tilt",We("always"),Fn.getState().setEnableOrbitController(!1),pe==="Vertical"?$.current.getWorldPosition(xe.current):le.current.getWorldPosition(xe.current))},Pt=At=>{if(!le.current||!q.current||!se.current)return;const kt=zl.subVectors(At.point,xe.current),gt=le.current.localToWorld(i9.set(0,-1,0)).sub(xe.current),dt=kt.angleTo(gt),tt=Math.sign(Gt-dt)*kt.angleTo(le.current.getWorldDirection(nde));if(pe==="Vertical"){const Fe=tt>0?-tt:tt,qe=R-S*Math.sin(Fe);ke(qe),Ye(Fe,-qe)}else{const Fe=w>=S?Gt:Math.asin(w/S);Ye(me.clamp(tt,-Fe,Fe),0)}},Rt=m.useCallback(()=>{if(!ye.current)return;const At=H.getState().elements.find(gt=>gt.id===e);switch(ye.current){case"Move":{N(gt=>{if(!$.current||!ye.current)return;const dt=Fn.getState().pointer;k.setFromCamera(dt,L().camera);const Ct=Xe(k,L().scene,ye.current),tt=gt.elements.find(Fe=>Fe.id===e);if(tt)if(tt.parentId!==Se.current&&Se.current&&ze.current&&(tt.parentId=Se.current,tt.foundationId=ze.current),Ie.current&&Ie.current!==tt.parentType&&(tt.parentType=Ie.current),tt.parentType===z.Wall){const Fe=gt.elements.find(qe=>qe.id===tt.parentId);Fe&&(tt.cx=$.current.position.x/Fe.lx,tt.cy=0,tt.cz=$.current.position.z/Fe.lz,tt.rotation=[Gt,0,0],tt.normal=[0,-1,0])}else if(tt.cx=$.current.position.x,tt.cy=$.current.position.y,tt.cz=$.current.position.z,he.current!==null&&(Ct!=null&&Ct.parentGroup)&&(tt.relativeAzimuth=he.current-Hu.setFromQuaternion(Ct.parentGroup.getWorldQuaternion(lf.set(0,0,0,0))).z),Ct!=null&&Ct.intersection)if(ea.getSurfaceType(Ct.parentType,Ct.intersection.normal)==="Horizontal")tt.rotation=[0,0,0],tt.normal=[0,0,1];else{const{x:qe,y:je,z:rt}=$.current.rotation,mt=zl.set(0,0,1).applyEuler($.current.rotation);tt.rotation=[qe,je,rt],tt.normal=[mt.x,mt.y,mt.z]}else{const{x:Fe,y:qe,z:je}=$.current.rotation,rt=zl.set(0,0,1).applyEuler($.current.rotation);tt.rotation=[Fe,qe,je],tt.normal=[rt.x,rt.y,rt.z]}});break}case"ResizeX":case"ResizeY":{N(gt=>{if(!te.current||!$.current)return;const dt=gt.elements.find(Ct=>Ct.id===e);if(dt)if(dt.lx=te.current.scale.x,dt.ly=te.current.scale.y,dt.parentType===z.Wall){const Ct=gt.elements.find(tt=>tt.id===dt.parentId);Ct&&(dt.cx=$.current.position.x/Ct.lx,dt.cy=0,dt.cz=$.current.position.z/Ct.lz)}else dt.parentType===z.Roof&&(gt.updateElementOnRoofFlag=!gt.updateElementOnRoofFlag),[dt.cx,dt.cy,dt.cz]=$.current.position});break}case"RotateLower":case"RotateUpper":{N(gt=>{if(!le.current)return;const dt=gt.elements.find(tt=>tt.id===e);if(!dt)return;const Ct=ea.getRelativeAzimuth(le.current.rotation.z);dt.relativeAzimuth=Ct});break}case"Tilt":{N(gt=>{if(!q.current)return;const dt=gt.elements.find(Ct=>Ct.id===e);dt&&(dt.tiltAngle=q.current.rotation.x)});break}}const kt=H.getState().elements.find(gt=>gt.id===e);At&&kt&&(ea.isNewPositionOk(kt)?ea.addUndoable(At,ye.current):setTimeout(()=>{N(gt=>{const dt=gt.elements.findIndex(Ct=>Ct.id===e);dt!==-1&&(gt.elements[dt]=At)})},10)),L().frameloop!=="demand"&&We("demand"),Fn.getState().setEnableOrbitController(!0),ye.current=null,he.current=null,Se.current=null,ze.current=null,Ie.current=null,ce.current=null,B(!1),X(!1)},[]);m.useEffect(()=>(window.addEventListener("pointerup",Rt),()=>window.removeEventListener("pointerup",Rt)),[Rt]),ay(({camera:At,scene:kt,raycaster:gt})=>{if(!$.current||!le.current||!M||!ye.current||ye.current==="Tilt")return;const dt=Fn.getState().pointer;gt.setFromCamera(dt,At);const Ct=Xe(gt,kt,ye.current);if(!Ct)return;const{intersection:tt,parentGroup:Fe,parentType:qe}=Ct,je=tt.point;switch(ye.current){case"Move":{if(!qe)break;switch(ot($.current.parent,Fe,qe,tt.object),qe){case z.Foundation:{$.current.position.x=je.x-Fe.position.x,$.current.position.y=je.y-Fe.position.y,$.current.position.z=je.z-Fe.position.z,$.current.position.applyEuler(Hu.set(0,0,-Fe.rotation.z)),De(0,0,0),he.current!==null?le.current.rotation.z=he.current-Fe.rotation.z:le.current.rotation.z=c;break}case z.Wall:{const mt=ea.findParentGroup(Fe,[P2]);mt&&(Fe.localToWorld(zl.set(0,0,0)),i9.set(0,0,0).subVectors(je,zl).applyEuler(Hu.set(0,0,-mt.rotation.z-Fe.rotation.z)),$.current.position.x=i9.x,$.current.position.y=0,$.current.position.z=i9.z,De(Gt,0,0),le.current.rotation.set(0,0,0));break}case z.Roof:{const mt=ea.getRoofSegmentData(tt.object);if(mt){const{roofId:Qe,foundation:Tt,centroid:Dt,roofSegments:lt}=mt;if(Tt&&Dt&<&&Qe){const zt=new ie().subVectors(je,new ie(Tt.cx,Tt.cy,Tt.cz)).applyEuler(new nn(0,0,-Tt.rotation[2])),Ft=zt.clone().sub(Dt),{normal:_t,rotation:tn}=Cn.computeState(lt,Ft);$.current.position.x=zt.x,$.current.position.y=zt.y,$.current.position.z=zt.z,me.isEqual(tn[0],0)?(De(0,0,0),he.current!==null?le.current.rotation.set(0,0,he.current-Fe.rotation.z):le.current.rotation.set(0,0,c)):(De(tn[0],tn[1],tn[2]),le.current.rotation.set(0,0,0))}}break}case z.Cuboid:Fe.getWorldPosition(zl),Fe.getWorldQuaternion(lf),Hu.setFromQuaternion(lf),$.current.position.subVectors(je,zl).applyQuaternion(lf.invert()),Ne(tt.normal)}const rt=ea.getSurfaceType(qe,tt.normal);switch(rt==="Horizontal"?(fe.current&&fe.current.setVisiable(!0),Z.current&&Z.current.setVisiable(!1),ke(w+R)):(fe.current&&fe.current.setVisiable(!1),Z.current&&Z.current.setVisiable(!0),ke(R)),rt){case"Horizontal":{Ye(u,0);break}case"Vertical":{const mt=Math.min(0,u),Qe=R-S*Math.sin(mt);ke(Qe),Ye(mt,-Qe);break}case"Inclined":{Ye(0,0);break}}ea.isTrackerEnabled(rt,p)?(le.current.rotation.set(0,0,0),q.current.rotation.set(0,0,0),Q.current.update(p,Hu.setFromQuaternion(Fe.getWorldQuaternion(lf)).z)):Q.current.reset();break}case"ResizeX":case"ResizeY":{const rt=xe.current,mt=zl.subVectors(je,rt),Qe=He.current,Tt=mt.angleTo(Qe),Dt=mt.length()*Math.cos(Tt),lt=ut(ye.current,Dt);if(pe==="Vertical"){const zt=$.current.getWorldPosition(zl).sub(le.current.getWorldPosition(i9)),Ft=nde.copy(Qe).multiplyScalar(lt/2).add(rt).add(zt).sub(Fe.getWorldPosition(ode)).applyQuaternion(Fe.getWorldQuaternion(lf).invert());$.current.position.x=Ft.x,$.current.position.z=Ft.z,qe===z.Cuboid&&($.current.position.y=Ft.y),ye.current==="ResizeX"?(te.current.scale.x=Math.abs(lt),yt(lt)):ye.current==="ResizeY"&&(te.current.scale.y=Math.abs(lt),ct(lt),qe===z.Wall&&ke(Math.abs(lt/2*Math.sin(Math.min(0,u))))),W(ye.current,lt)}else{const zt=ft(lt,ye.current),Ft=zl.copy(Qe).multiplyScalar(zt/2).add(rt).sub(Fe.getWorldPosition(ode)).applyQuaternion(Fe.getWorldQuaternion(lf).invert()),_t=Math.abs(zt);ye.current==="ResizeX"?(te.current.scale.x=_t,fe.current&&fe.current.update({lx:_t})):ye.current==="ResizeY"&&(te.current.scale.y=_t,fe.current&&fe.current.update({ly:_t})),$.current.position.x=Ft.x,$.current.position.y=Ft.y,$.current.position.z=Ft.z,W(ye.current,zt)}Ke(),it(te.current.scale.x,te.current.scale.y);break}case"RotateUpper":{zl.subVectors(je,xe.current).setZ(0);let rt=zl.angleTo(i9.set(0,1,0));zl.x>0&&(rt=-rt),le.current.rotation.z=rt-Hu.setFromQuaternion(Fe.getWorldQuaternion(lf)).z,Ve(le.current.rotation.z);break}case"RotateLower":{zl.subVectors(je,xe.current).setZ(0);let rt=zl.angleTo(i9.set(0,-1,0));zl.x<0&&(rt=-rt),le.current.rotation.z=rt-Hu.setFromQuaternion(Fe.getWorldQuaternion(lf)).z,Ve(le.current.rotation.z);break}}});const Ut=m.useMemo(()=>pe==="Horizontal"&&!ve?new nn(0,0,c,"ZXY"):new nn(0,0,0,"ZXY"),[pe,c,ve]),Ht=m.useMemo(()=>ve?new nn(0,0,0,"ZXY"):pe==="Horizontal"&&w>0?new nn(u,0,0,"ZXY"):pe==="Vertical"?new nn(Math.min(0,u),0,0,"ZXY"):new nn(0,0,0,"ZXY"),[w,pe,u,ve]);return h.jsxs("group",{name:`Ref_Solar_Panel_Group ${e}`,ref:$,position:[n,o,r],rotation:[l[0],l[1],l[2],"ZXY"],onPointerDown:st,onPointerMissed:()=>{M&&ea.setSelected(e,!1)},children:[h.jsxs("group",{name:"Top_Azimuth_Group",ref:le,position:[0,0,Te],rotation:Ut,children:[h.jsx(MZt,{ref:Q,tiltAngle:u,trackerType:p,surfaceType:pe,children:h.jsxs("group",{name:"Top_Tilt_Group",ref:q,rotation:Ht,children:[h.jsxs("group",{ref:te,scale:[i,a,A],children:[h.jsx(M$e,{onPointerOver:()=>U(!0),onPointerOut:()=>U(!1),children:h.jsx(IZt,{solarPanel:t,lx:D,ly:E})}),h.jsx(ua,{name:"Solar Panel Simulation Plane",uuid:e,userData:{simulation:!0},visible:!1,children:h.jsx("meshBasicMaterial",{side:$r})})]}),M&&v&&h.jsx(DZt,{hlx:x,hly:S}),h.jsx(LZt,{lx:D,ly:E,lz:A,orientation:y,modelLength:T.length,modelWidth:T.width}),Me&&h.jsxs(h.Fragment,{children:[h.jsx(H$e,{onPointerDown:at}),h.jsx(FZt,{ref:re,hlx:x,hly:S,onPointerDown:Oe})]}),f&&h.jsx(RZt,{})]})}),O&&h.jsx(ua,{name:NZt,ref:ge,args:[1e4,1e4],visible:!1,children:h.jsx("meshBasicMaterial",{color:"darkgrey"})}),Pe&&h.jsxs("group",{name:"Rotate_Handles_Group",ref:ae,children:[h.jsx(lX,{name:Kr.Upper,positionY:S+pO,onPointerDown:Ze}),h.jsx(lX,{name:Kr.Lower,positionY:-S-pO,onPointerDown:Ze})]}),Ee&&h.jsx(CZt,{ref:se,tiltAngle:u,positionZ:-Ae,isOnVerticalSurface:pe==="Vertical",onPointerDown:St,onPointerMove:Pt}),h.jsx(zZt,{ref:fe,lx:i,ly:a,tiltAngle:u,poleHeight:w,poleRadius:b,poleSpacing:C,color:P,visiable:Be}),(F||t.showLabel)&&!M&&h.jsx(EZt,{solarPanel:t,boxRef:te})]}),f&&h.jsx(HZt,{ref:ne,topTiltGroupRef:q,positionZ:Te,rotationX:-l[0]}),h.jsx(WZt,{ref:Z,tiltAngle:-u,lx:i,ly:a,modelLength:T.length,visiable:Je}),_&&h.jsx(I$e,{ref:de,lx:i,ly:a,relativeAzimuth:c})]})}),ide="Solar_Panels_Wrapper_Group",Oye=be.memo(({parentId:t,foundationId:e,wrapperType:n,plx:o,ply:r,plz:i})=>{const a=m.useCallback(s=>{if(s.type!==z.SolarPanel)return!1;const c=s;switch(n){case z.Foundation:return c.foundationId===e&&(c.parentType===z.Foundation||c.parentType===z.Roof);case z.Cuboid:return c.foundationId===e&&c.parentType===z.Cuboid;case z.Wall:return s.parentId===t&&c.parentType===z.Wall}return!1},[t,e,n]),l=H(s=>s.elements.filter(a),cy);switch(n){case z.Foundation:case z.Cuboid:return h.jsx("group",{name:ide,children:l.map(s=>h.jsx(DSe,{...s},s.id))});case z.Wall:return h.jsx("group",{name:ide,children:l.map(s=>h.jsx(DSe,{...s,cx:s.cx*o,cz:s.cz*i},s.id))});default:return null}}),UZt=be.memo(({parentId:t,foundationId:e,parentLx:n,parentLz:o})=>{const r=a=>a.type!==z.BatteryStorage?!1:a.parentId===t;return H(a=>a.elements.filter(r),cy).map(a=>h.jsx(jZt,{...a,cx:a.cx*n,cz:a.cz*o},a.id))}),jZt=t=>{const{id:e,cx:n,cz:o,lx:r,ly:i,lz:a,color:l}=t,s=i/2,c=H(fn),u=Es(e),d=f=>{f.intersections.length==0||f.intersections[0].object!==f.object||(f.stopPropagation(),ea.setSelected(e,!0),f.button===2&&c(p=>{p.contextMenuObjectType=z.SolarPanel}))};return h.jsxs("group",{name:`Power_Wall_Group ${e}`,position:[n,0,o],onPointerDown:d,children:[h.jsx(Qr,{args:[r,i,a],position:[0,-s,0],children:h.jsx("meshStandardMaterial",{color:l})}),u&&h.jsx(ds,{args:[.2],position:[0,-i,0]})]})},z$e="Wall_Group",BZt=({wallModel:t,foundationModel:e})=>{const{id:n,roofId:o,cx:r,cy:i,lx:a,ly:l,lz:s,relativeAngle:c,fill:u,locked:d,leftUnfilledHeight:f,rightUnfilledHeight:p,leftTopPartialHeight:g,rightTopPartialHeight:y,leftJoints:w,rightJoints:b,parentId:C}=t,P=Es(n),[v,T]=[a/2,s/2],A=u===El.Partial,x=w.length>0?t.leftRoofHeight:s,S=b.length>0?t.rightRoofHeight:s,R=x??s,M=S??s,D=A?Math.min(R,g):R,E=A?Math.min(M,y):M,W=a===0,j=()=>u===El.Empty?h.jsx(oZt,{...t}):h.jsx(Een,{wallModel:t,foundationModel:e});return h.jsxs("group",{name:`${z$e} ${n}`,position:[r,i,T],rotation:[0,0,c],userData:{aabb:!0,id:n,fId:C},children:[h.jsx(Oye,{parentId:n,foundationId:C,wrapperType:z.Wall,plx:a,ply:l,plz:s}),h.jsx(UZt,{parentId:n,foundationId:C,parentLx:a,parentLz:s}),j(),P&&!d&&h.jsxs(h.Fragment,{children:[a>.5&&h.jsx(iZt,{ply:l,phz:T}),h.jsx(lZt,{id:n,parentLz:e.lz,roofId:o,absAngle:c+e.rotation[2],x:v,z:T,leftUnfilledHeight:f,rightUnfilledHeight:p,leftTopPartialResizeHandleHeight:D,rightTopPartialResizeHandleHeight:E,fill:u,wallLeftHeight:R,wallRightHeight:M,highLight:W,leftJoints:w,rightJoints:b})]})]})},YZt=(t,e)=>t.wallModel===e.wallModel,OZt=be.memo(BZt,YZt),D$e="Building Group",_Zt=t=>{const{id:e,lx:n,ly:o,lz:r}=t,i=l=>l.foundationId!==e?!1:l.type===z.Wall||l.type===z.Roof||l.type===z.SolarPanel&&l.parentType===z.Roof||l.type===z.Window&&l.parentType===z.Roof,a=H(l=>l.elements.filter(i),cy);return a.length===0?null:h.jsx("group",{name:D$e,position:[0,0,r/2],children:a.map(l=>{switch(l.type){case z.Wall:return h.jsx(OZt,{wallModel:l,foundationModel:t},l.id);case z.Roof:return h.jsx(_Qt,{roofModel:l,foundationModel:t},l.id);case z.Window:return h.jsx(L$e,{...l,cz:l.cz},l.id);default:return null}})})},VZt=(t,e)=>t.lx===e.lx&&t.ly===e.ly&&t.lz===e.lz&&t.rotation===e.rotation,GZt=be.memo(_Zt,VZt),ESe=be.memo(({hx:t,hy:e,position:n,direction:o,color:r})=>{if(n===null)return null;const[i,a]=n,l=[];if(o==="x")l.push([-t,a,0]),l.push([t,a,0]);else if(o==="y")l.push([i,-e,0]),l.push([i,e,0]);else return o==="xy"?h.jsxs(h.Fragment,{children:[h.jsx(jn,{points:[[-t,a,0],[t,a,0]],color:r}),h.jsx(jn,{points:[[i,-e,0],[i,e,0]],color:r})]}):null;return h.jsx(jn,{points:l,color:r})});class rC{static addUndoable(e,n){if(e)switch(n){case Wa.Move:{rC.addUndoableMove(e);break}case Wa.ResizeX:{rC.addUndoableResizeX(e);break}case Wa.ResizeHeight:{rC.addUndoablResizeHeight(e);break}case Wa.RotateLower:case Wa.RotateUpper:{rC.addUndoableRotate(e);break}}}static addUndoableMove(e){const n=H.getState().elements.find(i=>i.id===e.id&&i.type===z.WaterHeater);if(!n)return;const o={name:"Move Water Heater",timestamp:Date.now(),movedElementId:n.id,movedElementType:n.type,oldCx:e.cx,oldCy:e.cy,oldCz:e.cz,newCx:n.cx,newCy:n.cy,newCz:n.cz,oldParentType:e.parentType,newParentType:n.parentType,oldParentId:e.parentId,newParentId:n.parentId,oldFoundationId:e.foundationId,newFoundationId:n.foundationId,oldNormal:new ie().fromArray(e.normal),newNormal:new ie().fromArray(n.normal),oldRotation:[...e.rotation],newRotation:[...n.rotation],undo(){r(this.movedElementId,[this.oldCx,this.oldCy,this.oldCz],this.oldParentId,this.oldFoundationId,this.oldParentType,this.oldRotation,this.oldNormal)},redo(){r(this.movedElementId,[this.newCx,this.newCy,this.newCz],this.newParentId,this.newFoundationId,this.newParentType,this.newRotation,this.newNormal)}};H.getState().addUndoable(o);const r=(i,a,l,s,c,u,d)=>{H.getState().set(f=>{const p=f.elements.find(g=>g.id===i);!p||p.type!==z.WaterHeater||([p.cx,p.cy,p.cz]=[...a],l&&(p.parentId=l),s&&(p.foundationId=s),c&&(p.parentType=c),u&&(p.rotation=[...u]),d&&(p.normal=[d.x,d.y,d.z]))})}}static addUndoableResizeX(e){const n=H.getState().elements.find(r=>r.id===e.id&&r.type===z.WaterHeater);if(!n)return;const o={name:"Resize Water Heater X",timestamp:Date.now(),id:n.id,oldPos:[e.cx,e.cy,e.cz],oldDms:[e.lx,e.ly,e.lz],oldRot:[...e.rotation],oldNor:[...e.normal],newPos:[n.cx,n.cy,n.cz],newDms:[n.lx,n.ly,n.lz],newRot:[...n.rotation],newNor:[...n.normal],undo(){H.getState().set(r=>{for(const i of r.elements)if(i.id===o.id){[i.cx,i.cy,i.cz]=[...o.oldPos],[i.lx,i.ly,i.lz]=[...o.oldDms],i.normal=[...o.oldNor],i.rotation=[...o.oldRot];break}})},redo(){H.getState().set(r=>{for(const i of r.elements)if(i.id===o.id){[i.cx,i.cy,i.cz]=[...o.newPos],[i.lx,i.ly,i.lz]=[...o.newDms],i.normal=[...o.newNor],i.rotation=[...o.newRot];break}})}};H.getState().addUndoable(o)}static addUndoablResizeHeight(e){const n=H.getState().elements.find(r=>r.id===e.id&&r.type===z.WaterHeater);if(!n)return;const o={name:"Resize Water Heater Height",timestamp:Date.now(),id:n.id,oldHeight:e.lz,newHeight:n.lz,undo(){H.getState().set(r=>{for(const i of r.elements)if(i.id===o.id){i.lz=o.oldHeight;break}})},redo(){H.getState().set(r=>{for(const i of r.elements)if(i.id===o.id){i.lz=o.newHeight;break}})}};H.getState().addUndoable(o)}static addUndoableRotate(e){const n=H.getState().elements.find(i=>i.id===e.id&&i.type===z.WaterHeater);if(!n)return;const o={name:"Rotate Water Heater",timestamp:Date.now(),changedElementId:n.id,oldValue:e.relativeAzimuth,newValue:n.relativeAzimuth,changedElementType:z.WaterHeater,undo:()=>{r(o.oldValue)},redo:()=>{r(o.newValue)}};H.getState().addUndoable(o);const r=i=>{H.getState().set(a=>{const l=a.elements.find(s=>s.id===o.changedElementId&&s.type===z.WaterHeater);l&&(l.relativeAzimuth=i)})}}}const XZt=be.memo(({waterTankLength:t,waterTankRadius:e,panelWidth:n})=>{const o=t/2,r=n/2,i=r+e;return h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-o,-r,0],[-o,i,0],[o,i,0],[o,-r,0],[-o,-r,0]],lineWidth:3,color:y0})}),FSe="Mount Left",kSe="Mount Right",JZt=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i,ly:a,lz:l,rotation:s,normal:c,relativeAzimuth:u,parentType:d,locked:f}=t,p=i,g=a,y=.05,w=.3,b=p+.25,C=l-w*2,P=Math.asin(Math.min(1,(C+w)/g)),v=.5,T=m.useRef(null),A=m.useRef(null),x=m.useRef(null),S=m.useRef(null),R=m.useRef(new ie),M=m.useRef(new ie),D=m.useRef(null),E=m.useRef(null),W=m.useRef(null),j=m.useRef(null),L=m.useRef(null),k=m.useRef(null),N=m.useRef(null),F=m.useRef(null),U=m.useRef(null),O=m.useRef(null),B=m.useRef(null),_=m.useRef(null),X=m.useRef(null),$=m.useRef(null),[Q,le]=m.useState(!1),[q,te]=m.useState(!1),[re,ae]=m.useState(!1),[se,ne]=m.useState(!1),fe=Es(e),ge=a5(),{set:de,get:Z,raycaster:he}=oi(),xe=m.useMemo(()=>ea.getSurfaceType(d,new ie().fromArray(c)),[d,c]),He=m.useMemo(()=>xe===Lp.Horizontal?new nn(0,0,u,"ZXY"):new nn(0,0,0,"ZXY"),[xe,u]),Se=m.useMemo(()=>fe&&xe===Lp.Horizontal&&!f,[fe,xe,f]),ze=H(fn),Ie=We=>{de({frameloop:We})},ye=(We,Ke,Ne)=>{switch(Ne){case Wa.Move:{const De=We.intersectObjects(Ke.children);for(const ke of De)if(ke.object.name.includes("Roof")){const Ye=ea.findParentGroup(ke.object,[sX]);return Ye?{intersection:ke,parentGroup:Ye,parentType:z.Roof}:null}break}case Wa.ResizeX:case Wa.ResizeY:case Wa.RotateLower:case Wa.RotateUpper:{if(!Q||!F.current||!D.current)return null;const De=We.intersectObjects([F.current]),ke=De[0];return!ke||me.isEqual(ke.point.z,0)?null:{intersection:De[0],parentGroup:D.current,parentType:d}}case Wa.ResizeHeight:{if(!q||!U.current||!D.current)return null;const De=We.intersectObjects([U.current]),ke=De[0];return!ke||me.isEqual(ke.point.z,0)?null:{intersection:De[0],parentGroup:D.current,parentType:d}}}return null},ce=(We,Ke,Ne)=>{E.current&&E.current.rotation.set(We,Ke,Ne,"ZXY")},pe=(We,Ke,Ne,De)=>{var Ye;const ke=Ke.children.find(it=>it.name===E$e);if(ke&&We&&ke!==We){We.children=We.children.filter(Ve=>Ve!==E.current),ke.children.push(E.current),E.current.parent=ke;const it=(Ye=ke.parent)==null?void 0:Ye.userData;if(it&&it.id&&it.fId&&(x.current=it.id,S.current=it.fId),Ne===z.Roof){const Ve=ea.getRoofId(De);Ve&&(x.current=Ve)}}},ve=()=>{if(!j.current)return;const[We,Ke]=j.current.scale.toArray().map(Ne=>Ne/2);if(k.current)for(const Ne of k.current.children)switch(Ne.name){case vt.Left:{Ne.position.x=-We;break}case vt.Right:{Ne.position.x=We;break}case vt.Upper:{Ne.position.y=Ke;break}case vt.Lower:{Ne.position.y=-Ke;break}}if(L.current&&(L.current.scale.y=j.current.scale.x+.25),O.current)for(const Ne of O.current.children)switch(Ne.name){case FSe:{Ne.position.x=-j.current.scale.x*.4;break}case kSe:{Ne.position.x=j.current.scale.x*.4;break}}},Ae=We=>{B.current&&B.current.setAzimuth(We)},Te=We=>{We.intersections.length==0||We.intersections[0].object!==We.object||(We.stopPropagation(),ea.setSelected(e,!0),We.button===2&&ze(Ke=>{Ke.contextMenuObjectType=z.WaterHeater}))},Me=We=>{if(!fe||!E.current||We.intersections.length==0||We.intersections[0].object!==We.object)return;Ie("always"),Fn.getState().setEnableOrbitController(!1),T.current=Wa.Move;const Ke=ea.findParentGroup(E.current,[P2]);Ke&&(A.current=Hu.setFromQuaternion(Ke.getWorldQuaternion(lf.set(0,0,0,0))).z+u)},Pe=We=>{if(!(!fe||!E.current||!W.current)&&!(We.intersections.length==0||We.intersections[0].object!==We.object)){switch(Ie("always"),Fn.getState().setEnableOrbitController(!1),We.object.name){case vt.Left:case vt.Right:{T.current=Wa.ResizeX;break}case vt.Upper:case vt.Lower:{T.current=Wa.ResizeY;break}}xe===Lp.Horizontal?(W.current.localToWorld(R.current.set(-We.object.position.x,-We.object.position.y,0)),E.current.getWorldPosition(M.current).sub(R.current).normalize()):(W.current.localToWorld(R.current.set(-We.object.position.x,-We.object.position.y,0)),W.current.getWorldPosition(M.current).sub(R.current).normalize()),le(!0),D.current=ea.findParentGroup(E.current,[P2])}},Ee=We=>{!fe||!E.current||!W.current||We.intersections.length==0||We.intersections[0].object!==We.object||(Ie("always"),Fn.getState().setEnableOrbitController(!1),T.current=Wa.ResizeHeight,D.current=ea.findParentGroup(E.current,[P2]),te(!0),setTimeout(()=>{if(U.current){const Ke=Z().camera.position;We.intersections[0].object.localToWorld(zl.set(0,0,0)),U.current.lookAt(Ke.x,Ke.y,zl.z),We.intersections[0].object.localToWorld(R.current.set(0,0,-l)),setTimeout(()=>{U.current.userData.state=!0},10)}},0))},Be=We=>{if(!(!W.current||!N.current)&&!(We.intersections.length==0||We.intersections[0].object!==We.object)){switch(Ie("always"),Fn.getState().setEnableOrbitController(!1),We.eventObject.name){case Kr.Upper:{T.current=Wa.RotateUpper;break}case Kr.Lower:{T.current=Wa.RotateLower;break}}W.current.getWorldPosition(R.current),R.current.z=0,le(!0),ne(!0),D.current=ea.findParentGroup(E.current,[P2])}},Je=m.useCallback(()=>{if(!T.current)return;const We=H.getState().elements.find(Ke=>Ke.id===e);switch(T.current){case Wa.Move:{ze(Ke=>{if(!E.current||!T.current)return;const Ne=Fn.getState().pointer;he.setFromCamera(Ne,Z().camera);const De=ye(he,Z().scene,T.current),ke=Ke.elements.find(Ye=>Ye.id===e);if(ke)if(ke.parentId!==x.current&&x.current&&S.current&&(ke.parentId=x.current,ke.foundationId=S.current),ke.cx=E.current.position.x,ke.cy=E.current.position.y,ke.cz=E.current.position.z,A.current!==null&&(De!=null&&De.parentGroup)&&(ke.relativeAzimuth=A.current-Hu.setFromQuaternion(De.parentGroup.getWorldQuaternion(lf.set(0,0,0,0))).z),De!=null&&De.intersection)if(ea.getSurfaceType(De.parentType,De.intersection.normal)===Lp.Horizontal)ke.rotation=[0,0,0],ke.normal=[0,0,1];else{const{x:it,y:Ve,z:yt}=E.current.rotation,ct=zl.set(0,0,1).applyEuler(E.current.rotation);ke.rotation=[it,Ve,yt],ke.normal=[ct.x,ct.y,ct.z]}else{const{x:Ye,y:it,z:Ve}=E.current.rotation,yt=zl.set(0,0,1).applyEuler(E.current.rotation);ke.rotation=[Ye,it,Ve],ke.normal=[yt.x,yt.y,yt.z]}});break}case Wa.ResizeX:{ze(Ke=>{if(!j.current||!E.current)return;const Ne=Ke.elements.find(De=>De.id===e);Ne&&(Ne.lx=j.current.scale.x,Ne.ly=j.current.scale.y,Ne.parentType===z.Roof&&(Ke.updateElementOnRoofFlag=!Ke.updateElementOnRoofFlag),[Ne.cx,Ne.cy,Ne.cz]=E.current.position)});break}case Wa.ResizeHeight:{ze(Ke=>{if(!X.current)return;const Ne=Ke.elements.find(De=>De.id===e);Ne&&(Ne.lz=X.current.position.z+w)});break}case Wa.RotateLower:case Wa.RotateUpper:{ze(Ke=>{if(!W.current)return;const Ne=Ke.elements.find(ke=>ke.id===e);if(!Ne)return;const De=ea.getRelativeAzimuth(W.current.rotation.z);Ne.relativeAzimuth=De});break}}rC.addUndoable(We,T.current),Z().frameloop!=="demand"&&Ie("demand"),Fn.getState().setEnableOrbitController(!0),T.current=null,A.current=null,x.current=null,S.current=null,D.current=null,le(!1),te(!1),ne(!1)},[]);return m.useEffect(()=>(window.addEventListener("pointerup",Je),()=>window.removeEventListener("pointerup",Je)),[Je]),ay(({camera:We,scene:Ke,raycaster:Ne})=>{if(!E.current||!W.current||!fe||!T.current)return;const De=Fn.getState().pointer;Ne.setFromCamera(De,We);const ke=ye(Ne,Ke,T.current);if(!ke)return;const{intersection:Ye,parentGroup:it,parentType:Ve}=ke,yt=Ye.point;switch(T.current){case Wa.Move:{if(!Ve)break;switch(pe(E.current.parent,it,Ve,Ye.object),Ve){case z.Roof:{const ct=ea.getRoofSegmentData(Ye.object);if(ct){const{roofId:Xe,foundation:ut,centroid:ft,roofSegments:ot}=ct;if(ut&&ft&&ot&&Xe){const st=new ie().subVectors(yt,new ie(ut.cx,ut.cy,ut.cz)).applyEuler(new nn(0,0,-ut.rotation[2])),at=st.clone().sub(ft),{normal:Oe,rotation:Ze}=Cn.computeState(ot,at);E.current.position.x=st.x,E.current.position.y=st.y,E.current.position.z=st.z,me.isEqual(Ze[0],0)?(ce(0,0,0),A.current!==null?W.current.rotation.set(0,0,A.current-it.rotation.z):W.current.rotation.set(0,0,u)):(ce(Ze[0],Ze[1],Ze[2]),W.current.rotation.set(0,0,0))}}break}}break}case Wa.ResizeX:case Wa.ResizeY:{const ct=R.current,Xe=zl.subVectors(yt,ct),ut=M.current,ft=Xe.angleTo(ut),st=Xe.length()*Math.cos(ft);if(xe!==Lp.Vertical){const at=st,Oe=zl.copy(ut).multiplyScalar(at/2).add(ct).sub(it.getWorldPosition(ode)).applyQuaternion(it.getWorldQuaternion(lf).invert()),Ze=Math.abs(at);T.current===Wa.ResizeX?j.current.scale.x=Ze:(T.current,Wa.ResizeY),E.current.position.x=Oe.x,E.current.position.y=Oe.y,E.current.position.z=Oe.z}ve();break}case Wa.RotateUpper:{zl.subVectors(yt,R.current).setZ(0);let ct=zl.angleTo(i9.set(0,1,0));zl.x>0&&(ct=-ct),W.current.rotation.z=ct-Hu.setFromQuaternion(it.getWorldQuaternion(lf)).z,Ae(W.current.rotation.z);break}case Wa.RotateLower:{zl.subVectors(yt,R.current).setZ(0);let ct=zl.angleTo(i9.set(0,-1,0));zl.x<0&&(ct=-ct),W.current.rotation.z=ct-Hu.setFromQuaternion(it.getWorldQuaternion(lf)).z,Ae(W.current.rotation.z);break}case Wa.ResizeHeight:{if(U.current.userData.state&&X.current){const ct=me.clamp(yt.z-R.current.z,w*2,g+w),Xe=ct-w,ut=ct-w*2;X.current.position.z=Xe,$.current&&O.current&&(O.current.scale.y=ut,O.current.position.z=ut/2,$.current.position.z=Xe,$.current.rotation.x=Math.asin(Xe/g))}break}}}),h.jsxs("group",{ref:E,position:[n,o,r],rotation:[s[0],s[1],s[2],"ZXY"],onPointerDown:Te,children:[h.jsxs("group",{ref:W,rotation:He,children:[h.jsxs("group",{ref:X,position:[0,g/2,w+C],children:[h.jsx(ca,{ref:L,args:[w,w,1],rotation:[0,0,Gt],scale:[1,b,1],children:h.jsx("meshStandardMaterial",{color:"grey"})}),fe&&h.jsx(Qr,{ref:_,args:[ge,.1,ge],position:[0,0,w],onPointerDown:Ee,children:h.jsx("meshBasicMaterial",{color:"white"})})]}),h.jsx("group",{ref:$,position:[0,g/2,w+C],rotation:[P,0,0],children:h.jsxs("group",{position:[0,-g/2,y/2],children:[h.jsxs("group",{ref:j,scale:[p,g,y],children:[h.jsx(M$e,{onPointerOver:()=>ae(!0),onPointerOut:()=>ae(!1),children:h.jsx("meshStandardMaterial",{color:"grey"})}),h.jsx(ua,{name:"Water Heater Simulation Plane",uuid:e,userData:{simulation:!0},visible:!1,children:h.jsx("meshBasicMaterial",{side:$r})})]}),fe&&!f&&h.jsxs(h.Fragment,{children:[h.jsx(H$e,{onPointerDown:Me}),h.jsxs("group",{name:"Resize_Handles_Group",ref:k,onPointerDown:Pe,children:[h.jsx(oC,{cx:p/2,cy:0,type:vt.Right,size:ge}),h.jsx(oC,{cx:-p/2,cy:0,type:vt.Left,size:ge})]})]}),fe&&f&&h.jsx(XZt,{waterTankLength:b,waterTankRadius:w,panelWidth:g})]})}),h.jsxs("group",{ref:O,position:[0,g/2,C/2],rotation:[Gt,0,0],scale:[1,C+.1,1],children:[h.jsx(ca,{name:FSe,args:[.05,.05,1],position:[-p*.4,0,0],children:h.jsx("meshStandardMaterial",{color:"grey"})}),h.jsx(ca,{name:kSe,args:[.05,.05,1],position:[p*.4,0,0],children:h.jsx("meshStandardMaterial",{color:"grey"})})]}),Se&&h.jsxs("group",{name:"Rotate_Handles_Group",ref:N,position:[0,0,C/2],children:[h.jsx(lX,{name:Kr.Upper,positionY:g/2+w+v,onPointerDown:Be}),h.jsx(lX,{name:Kr.Lower,positionY:-g/2-v,onPointerDown:Be})]}),q&&h.jsx(ua,{ref:U,args:[1e4,1e4],position:[0,g/2,0],rotation:[Gt,0,0,"ZXY"],visible:!1,children:h.jsx("meshBasicMaterial",{color:"darkgrey"})})]}),Q&&h.jsx(ua,{ref:F,args:[1e4,1e4],position:[0,0,C/2],visible:!1,children:h.jsx("meshBasicMaterial",{color:"darkgrey"})}),se&&h.jsx(I$e,{ref:B,lx:i,ly:a,relativeAzimuth:u})]})}),E$e="Water_Heater_Wrapper_Group",KZt=be.memo(({foundationId:t,wrapperType:e})=>{const n=m.useCallback(r=>{if(r.type!==z.WaterHeater)return!1;const i=r;switch(e){case z.Foundation:return i.foundationId===t&&i.parentType===z.Roof;case z.Cuboid:case z.Wall:}return!1},[t,e]),o=H(r=>r.elements.filter(n),cy);switch(e){case z.Foundation:return h.jsx("group",{name:E$e,children:o.map(r=>h.jsx(JZt,{...r},r.id))});default:return null}}),P2="Foundation_Group",sX="Foundation",qZt=be.memo(t=>{const{id:e,cx:n,cy:o,lx:r=1,ly:i=1,lz:a=.1,rotation:l=[0,0,0],color:s="gray",lineColor:c="black",lineWidth:u=.2,locked:d=!1,showLabel:f=!1,textureType:p=Yi.NoTexture,solarStructure:g}=t,y=Es(e),w=H(s0),b=H(Id),C=H(Gn),P=H(Cb),v=H(fn),T=H(c3),A=H(Fge),x=H(u3),S=H(Iw),R=H(_ge),M=H(Vge),D=H(uxt),E=H(Xq),W=H(iYe),j=H(zw),L=H(kYe),k=H(LYe),N=H(yp),F=H(Y0),U=H(Nge),O=H(t5),B=H(oxt),_=H(cxt),X=H(Ds),$=H(hA),Q=H(e$),le=H(En),q=H(Yge),te=H(Ege),re=H(ly),ae=ht(Ss),se=H(Cf),ne=H(yge),fe=Tn(u1),{camera:ge,gl:{domElement:de}}=oi(),[Z,he]=m.useState(!1),[xe,He]=m.useState(null),[Se,ze]=m.useState(!1),[Ie,ye]=m.useState({show:!1,direction:null,position:null}),[ce,pe]=m.useState([{show:!1,direction:null,position:null},{show:!1,direction:null,position:null}]),ve=m.useRef(null),Ae=m.useRef(!1),Te=m.useRef(!1),Me=m.useRef(null),Pe=m.useRef(Xr.null),Ee=m.useRef(new Map),Be=m.useRef(null),Je=m.useRef(null),We=m.useRef(null),Ke=m.useRef(null),Ne=m.useRef(null),De=m.useRef(null),ke=m.useRef(null),Ye=m.useRef(null),it=m.useRef(null),Ve=m.useRef(null),yt=m.useRef(null),ct=m.useRef(null),Xe=m.useRef(new ie),ut=m.useRef(new ie),ft=m.useRef(new ie(1,1,1)),ot=m.useRef(new ie(1,1,1)),st=m.useRef(0),at=m.useRef(0),Oe=m.useRef([]),Ze=m.useRef([]),St=m.useRef([]),Pt=m.useRef([]),Rt=m.useRef([]),Ut=m.useRef([]),Ht=m.useMemo(()=>({lng:w}),[w]),At=m.useMemo(()=>new Xt,[]),kt=m.useMemo(()=>new l0,[]),gt=r/2,dt=i/2,Ct=a/2,tt=m.useMemo(()=>new ie(-gt,-dt,Ct),[gt,dt,Ct]),Fe=m.useMemo(()=>new ie(-gt,dt,Ct),[gt,dt,Ct]),qe=m.useMemo(()=>new ie(gt,-dt,Ct),[gt,dt,Ct]),je=m.useMemo(()=>new ie(gt,dt,Ct),[gt,dt,Ct]),rt=a5(),mt=rt,Qe=rt,Tt=rt*4,Dt=dt+Tt,lt=m.useRef(!1),zt=m.useRef(null),Ft=H(ixt),_t=H(wOe),tn=m.useMemo(()=>new ie,[]);if(We.current){let un=-1;switch(We.current.type){case z.SolarPanel:{un=We.current.poleHeight;break}case z.ParabolicTrough:{const $t=We.current;un=$t.poleHeight+$t.lx/2;break}case z.ParabolicDish:{const $t=We.current;un=$t.poleHeight+$t.lx/2+$t.lx*$t.lx/(4*$t.latusRectum);break}case z.FresnelReflector:{const $t=We.current;un=$t.poleHeight+$t.lx/2;break}}un>=0&&tn.set(0,0,(t==null?void 0:t.lz)/2+un)}m.useEffect(()=>{Ee.current.clear();for(const un of H.getState().elements)un.type===z.Wall&&un.parentId===e&&Ee.current.set(un.id,un)},[e,_]),m.useEffect(()=>{B&&B===ve.current&&(Ee.current.delete(B),Ae.current=!1,Te.current=!1,ve.current=null,v(un=>{un.addedWallId===un.deletedWallId&&(un.addedWallId=null),un.deletedWallId=null}),Fn.getState().setEnableOrbitController(!0),ye({show:!1,direction:null,position:null}),pe([{show:!1,direction:null,position:null},{show:!1,direction:null,position:null}]))},[B]),m.useEffect(()=>{if(t&&ae){const un=fe(t.id);He(un?me.fetchHeatmapTexture(un,se??5):null)}},[ae,se,ne]),m.useEffect(()=>{!lt.current||!H.getState().getAutoDeletedElements()||Qt()},[Ft,_t]);const Qt=L2.debounce(()=>{if(!zt.current)return;const un=H.getState().getAutoDeletedElements();if(!un)return;const{wall:$t,newAngle:Bt,newJoints:pn}=zt.current,Pn={name:"Move Wall",timestamp:Date.now(),id:$t.id,oldPoints:[[...Rt.current[0]],[...Rt.current[1]]],newPoints:[[...$t.leftPoint],[...$t.rightPoint]],oldJoints:[[...St.current[0]],[...St.current[1]]],newJoints:[[...pn[0]],[...pn[1]]],oldAngle:st.current,newAngle:Bt,flippedWallSide:Pe.current,autoDeletedElements:[...un],undo(){switch(this.flippedWallSide){case Xr.loop:{uo(this.id);break}case Xr.left:{const jt=C(this.newJoints[0][0]);jt&&ir(jt);break}case Xr.right:{const jt=C(this.newJoints[1][0]);jt&&Rr(jt);break}}const[$e,bt]=this.oldJoints,[Lt,xt]=this.newJoints;v(jt=>{for(const Kt of jt.elements)if(Kt.id===this.id){const[sn,yn]=this.oldPoints;Kt.cx=(sn[0]+yn[0])/2,Kt.cy=(sn[1]+yn[1])/2,Kt.lx=Math.hypot(sn[0]-yn[0],sn[1]-yn[1]);const An=Kt;An.relativeAngle=this.oldAngle,An.leftPoint=[...sn],An.rightPoint=[...yn],An.leftJoints=[...$e],An.rightJoints=[...bt];break}jt.resizeHandleType=null,jt.elements.push(...this.autoDeletedElements),jt.deletedRoofId=null,jt.autoDeletedChild=null,jt.autoDeletedRoofs=null,jt.autoDeletedRoofIdSet.clear()}),$e[0]!==Lt[0]&&v(jt=>{for(const Kt of jt.elements)Kt.type===z.Wall&&(Kt.id===$e[0]&&(Kt.rightJoints=[this.id]),Kt.id===Lt[0]&&(this.flippedWallSide!==Xr.left?Kt.rightJoints=[]:Kt.leftJoints=[]))}),bt[0]!==xt[0]&&v(jt=>{for(const Kt of jt.elements)Kt.type===z.Wall&&(Kt.id===bt[0]&&(Kt.leftJoints=[this.id]),Kt.id===xt[0]&&(this.flippedWallSide!==Xr.right?Kt.leftJoints=[]:Kt.rightJoints=[]))}),Pe.current=Xr.null},redo(){const[$e,bt]=this.oldJoints,[Lt,xt]=this.newJoints;switch(v(Kt=>{for(const sn of Kt.elements)if(sn.id===this.id&&sn.type===z.Wall){const[yn,An]=this.newPoints;sn.cx=(yn[0]+An[0])/2,sn.cy=(yn[1]+An[1])/2,sn.lx=Math.hypot(yn[0]-An[0],yn[1]-An[1]);const bn=sn;bn.relativeAngle=this.newAngle,bn.leftPoint=[...yn],bn.rightPoint=[...An],bn.leftJoints=[...Lt],bn.rightJoints=[...xt];break}}),$e[0]!==Lt[0]&&v(Kt=>{for(const sn of Kt.elements)sn.type===z.Wall&&(sn.id===$e[0]&&(sn.rightJoints=[]),sn.id===Lt[0]&&(this.flippedWallSide===Xr.right?sn.leftJoints=[this.id]:sn.rightJoints=[this.id]))}),bt[0]!==xt[0]&&v(Kt=>{for(const sn of Kt.elements)sn.type===z.Wall&&(sn.id===bt[0]&&(sn.leftJoints=[]),sn.id===xt[0]&&(this.flippedWallSide===Xr.right?sn.rightJoints=[this.id]:sn.leftJoints=[this.id]))}),this.flippedWallSide){case Xr.loop:{uo(this.id);break}case Xr.left:{const Kt=C(this.newJoints[0][0]);Kt&&Rr(Kt);break}case Xr.right:{const Kt=C(this.newJoints[1][0]);Kt&&ir(Kt);break}}const jt=new Set(this.autoDeletedElements.map(Kt=>Kt.id));v(Kt=>{Kt.resizeHandleType=null,Kt.elements=Kt.elements.filter(yn=>!jt.has(yn.id));const sn=this.autoDeletedElements.find(yn=>yn.type===z.Roof);sn&&(Kt.deletedRoofId=sn.id)}),Pe.current=Xr.null}};le(Pn),lt.current=!1,v($e=>{$e.autoDeletedRoofs=null,$e.autoDeletedRoofIdSet.clear(),$e.autoDeletedChild=null})},100),gn=un=>{At.x=un.offsetX/de.clientWidth*2-1,At.y=-(un.offsetY/de.clientHeight)*2+1,kt.setFromCamera(At,ge)},an=un=>{switch(un){case Yi.Texture01:return{x:1,y:1};case Yi.Texture02:return{x:2,y:2};case Yi.Texture03:return{x:.4,y:.4};case Yi.Texture04:return{x:.25,y:.25};case Yi.Texture05:return{x:5,y:5};case Yi.Texture06:return{x:1,y:1};case Yi.Texture07:return{x:1,y:1};default:return{x:1,y:1}}},mn=m.useMemo(()=>{let un;switch(p){case Yi.Texture01:un=f$e;break;case Yi.Texture02:un=h$e;break;case Yi.Texture03:un=p$e;break;case Yi.Texture04:un=g$e;break;case Yi.Texture05:un=m$e;break;case Yi.Texture06:un=y$e;break;case Yi.Texture07:un=A$e;break;default:un=ig}return new df().load(un,$t=>{$t.wrapS=$t.wrapT=Hs;const Bt=an(p);$t.repeat.set(r/Bt.x,i/Bt.y),Fo($t)})},[p,r,i]),[Hn,Fo]=m.useState(mn),yo=m.useCallback((un,$t)=>{ht.getState().duringCameraInteraction||un.intersections.length>0&&(un.intersections[0].object===un.eventObject||un.intersections.length>1&&un.intersections[1].object===un.eventObject)&&(v(pn=>{pn.hoveredHandle=$t}),me.isMoveHandle($t)?de.style.cursor="move":$t===Kr.Lower||$t===Kr.Upper?de.style.cursor="grab":de.style.cursor=H.getState().addedFoundationId?"crosshair":"pointer")},[]),So=m.useCallback(()=>{v(un=>{un.hoveredHandle=null}),de.style.cursor=H.getState().addedFoundationId?"crosshair":"default"},[]),$o=un=>{switch(un){case z.Human:case z.Tree:case z.Flower:case z.Polygon:case z.Sensor:case z.Light:case z.SolarPanel:case z.ParabolicDish:case z.ParabolicTrough:case z.FresnelReflector:case z.Heliostat:case z.WindTurbine:case z.Wall:return!0;default:return!1}},mo=(un,$t)=>{let Bt=$t,pn=null,Pn=null,$e=null,bt;if(!H.getState().enableFineGrid)for(const[Lt,xt]of Ee.current){if(Lt===ve.current||We.current&&Lt===We.current.id)continue;const jt=new ie(xt.leftPoint[0],xt.leftPoint[1],0),Kt=new ie(xt.rightPoint[0],xt.rightPoint[1],0),sn=(jt==null?void 0:jt.distanceTo(un))??Number.MAX_VALUE,yn=(Kt==null?void 0:Kt.distanceTo(un))??Number.MAX_VALUE,An=sn<=yn,bn=An?sn:yn,Ln=An?jt:Kt;bn<=Bt+.01&&(Bt=bn,pn=Ln,bt=An?xt.leftJoints[0]:xt.rightJoints[0],Pn=Lt,$e=An?G1.Left:G1.Right)}return{id:Pn,point:pn,side:$e,jointId:bt}},Jn=(un,$t)=>(H.getState().enableFineGrid?(un=me.snapToFineGrid(un),$t=null):$t?un=$t:un=me.snapToNormalGrid(un),un),uo=un=>{Ee.current.clear();for(const Bt of H.getState().elements)Bt.type===z.Wall&&Bt.parentId===e&&Ee.current.set(Bt.id,Bt);let $t=Ee.current.get(un);for(;$t&&$t.leftJoints.length>0;){const Bt=Ee.current.get($t.id);if(!Bt||(v(pn=>{for(const Pn of pn.elements)if(Pn.id===Bt.id){const $e=Pn;$e.relativeAngle=(Bt.relativeAngle+Math.PI)%la,$e.leftPoint=[...Bt.rightPoint],$e.rightPoint=[...Bt.leftPoint],$e.leftJoints=[Bt.rightJoints[0]],$e.rightJoints=[Bt.leftJoints[0]];break}}),$t=Ee.current.get($t.leftJoints[0]),$t&&$t.id===un))break}v(Bt=>{Bt.updateWallMapOnFoundationFlag=!Bt.updateWallMapOnFoundationFlag,H.getState().resizeHandleType&&(Bt.resizeHandleType=H.getState().resizeHandleType===vt.LowerLeft?vt.LowerRight:vt.LowerLeft)}),Pe.current=Pe.current===Xr.null?Xr.loop:Xr.null},ir=(un,$t)=>{Ee.current.clear();for(const Pn of H.getState().elements)Pn.type===z.Wall&&Pn.parentId===e&&Ee.current.set(Pn.id,Pn);const Bt=un;let pn=un;for(;pn;){const Pn=Ee.current.get(pn.id);if(!Pn)break;v(bt=>{for(const Lt of bt.elements)if(Pn&&Lt.id===Pn.id){const xt=Lt;xt.relativeAngle=(Pn.relativeAngle+Math.PI)%la,xt.leftPoint=[...Pn.rightPoint],xt.rightPoint=[...Pn.leftPoint],xt.leftJoints=Pn.rightJoints.length>0?[Pn.rightJoints[0]]:[],xt.rightJoints=Pn.leftJoints.length>0?[Pn.leftJoints[0]]:[];break}});let $e;if(Pn.leftJoints.length>0&&($e=Ee.current.get(Pn.leftJoints[0])),$e&&$e.id!==Bt.id)pn=$e;else break}v(Pn=>{if($t)for(const $e of Pn.elements)$e.type===z.Wall&&($e.id===Bt.id&&($e.leftJoints=[$t.id]),$e.id===$t.id&&($e.rightJoints=[Bt.id]));Pn.updateWallMapOnFoundationFlag=!Pn.updateWallMapOnFoundationFlag,Pn.resizeHandleType=vt.LowerLeft}),Pe.current=Pe.current===Xr.null?Xr.right:Xr.null},Rr=(un,$t)=>{Ee.current.clear();for(const Pn of H.getState().elements)Pn.type===z.Wall&&Pn.parentId===e&&Ee.current.set(Pn.id,Pn);const Bt=un;let pn=un;for(;pn;){const Pn=Ee.current.get(pn.id);if(!Pn)break;v(bt=>{for(const Lt of bt.elements)if(Pn&&Lt.id===Pn.id){const xt=Lt;xt.relativeAngle=(Pn.relativeAngle+Math.PI)%la,xt.leftPoint=[...Pn.rightPoint],xt.rightPoint=[...Pn.leftPoint],xt.leftJoints=Pn.rightJoints.length>0?[Pn.rightJoints[0]]:[],xt.rightJoints=Pn.leftJoints.length>0?[Pn.leftJoints[0]]:[];break}});let $e;if(Pn.rightJoints.length>0&&($e=Ee.current.get(Pn.rightJoints[0])),$e&&$e.id!==Bt.id)pn=$e;else break}v(Pn=>{if($t)for(const $e of Pn.elements)$e.type===z.Wall&&($e.id===Bt.id&&($e.rightJoints=[$t.id]),$e.id===$t.id&&($e.leftJoints=[Bt.id]));Pn.updateWallMapOnFoundationFlag=!Pn.updateWallMapOnFoundationFlag,Pn.resizeHandleType=vt.LowerRight}),Pe.current=Pe.current===Xr.null?Xr.left:Xr.null},br=un=>{let $t;Ee.current.clear();for(const pn of H.getState().elements)pn.id===un&&($t=pn),pn.type===z.Wall&&pn.parentId===e&&Ee.current.set(pn.id,pn);let Bt=!1;for(;$t&&$t.leftJoints.length>0;)if($t=Ee.current.get($t.leftJoints[0]),($t==null?void 0:$t.id)===un){Bt=!0;break}if(Bt){let pn=0,Pn=0;for(;$t&&$t.leftJoints.length>0;){const $e=Ee.current.get($t.leftJoints[0]),bt=(Math.PI*3-($t.relativeAngle-$e.relativeAngle))%la;if(pn+=bt,Pn+=1,$t=$e,$t.id===un)break}pn>(Pn-2)*Math.PI+.1?uo(un):Pe.current!==Xr.null&&(Pe.current=Xr.loop)}return Bt},Vr=un=>{const $t={name:"Add",timestamp:Date.now(),addedElement:un,undo:()=>{N($t.addedElement.id,!1)},redo:()=>{v(Bt=>{Bt.elements.push($t.addedElement),Bt.selectedElement=$t.addedElement})}};le($t)},Wo=un=>{const $t={name:"Add",timestamp:Date.now(),addedElement:un,flippedWallSide:Pe.current,undo:()=>{const Bt=$t.addedElement;if(N(Bt.id,!1),($t.flippedWallSide===Xr.right||$t.flippedWallSide===Xr.loop)&&Bt.rightJoints.length>0){const pn=C(Bt.rightJoints[0]);pn&&Rr(pn)}else if($t.flippedWallSide===Xr.left&&Bt.leftJoints.length>0){const pn=C(Bt.leftJoints[0]);pn&&ir(pn)}},redo:()=>{const Bt=$t.addedElement;if($t.flippedWallSide===Xr.right||$t.flippedWallSide===Xr.loop&&Bt.rightJoints.length>0){const pn=C(Bt.rightJoints[0]);pn&&ir(pn)}else if($t.flippedWallSide===Xr.left&&Bt.leftJoints.length>0){const pn=C(Bt.leftJoints[0]);pn&&Rr(pn)}Bt.rightJoints.length>0&&R(Bt.rightJoints[0],[Bt.id]),Bt.leftJoints.length>0&&M(Bt.leftJoints[0],[Bt.id]),v(pn=>{pn.elements.push(Bt),pn.selectedElement=Bt,pn.updateWallMapOnFoundationFlag=!pn.updateWallMapOnFoundationFlag})}};le($t)},wn=un=>{const $t=H.getState().getAutoDeletedElements(),Bt={name:"Resize Wall",timestamp:Date.now(),resizedElementId:un.id,resizedElementType:un.type,oldPosition:Xe.current.clone(),newPosition:ut.current.clone(),oldDimension:ft.current.clone(),newDimension:ot.current.clone(),oldAngle:st.current,newAngle:at.current,oldJoints:[[...St.current[0]],[...St.current[1]]],newJoints:[[...Pt.current[0]],[...Pt.current[1]]],oldPoint:[[...Rt.current[0]],[...Rt.current[1]]],newPoint:[[...Ut.current[0]],[...Ut.current[1]]],flippedWallSide:Pe.current,autoDeletedElement:$t?[...$t]:[],undo:()=>{switch(Bt.flippedWallSide){case Xr.right:if(Bt.newJoints[1]){const pn=C(Bt.newJoints[1][0]);pn&&Rr(pn)}break;case Xr.left:if(Bt.newJoints[0]){const pn=C(Bt.newJoints[0][0]);pn&&ir(pn)}break;case Xr.loop:if(Bt.newJoints[0]&&Bt.newJoints[1])uo(Bt.resizedElementId);else if(Bt.newJoints[1]){const pn=C(Bt.newJoints[1][0]);pn&&Rr(pn)}else if(Bt.newJoints[0]){const pn=C(Bt.newJoints[0][0]);pn&&ir(pn)}break}v(pn=>{for(const Pn of pn.elements)if(Pn.id===Bt.resizedElementId){const $e=Pn;switch($e.cx=Bt.oldPosition.x,$e.cy=Bt.oldPosition.y,$e.cz=Bt.oldPosition.z,$e.lx=Bt.oldDimension.x,$e.ly=Bt.oldDimension.y,$e.lz=Bt.oldDimension.z,$e.relativeAngle=Bt.oldAngle,$e.leftJoints=[...Bt.oldJoints[0]],$e.rightJoints=[...Bt.oldJoints[1]],$e.leftPoint=[...Bt.oldPoint[0]],$e.rightPoint=[...Bt.oldPoint[1]],Bt.flippedWallSide){case Xr.loop:{if(Bt.oldJoints[0]!==Bt.newJoints[1])for(const bt of pn.elements)bt.type===z.Wall&&(bt.id===Bt.newJoints[1][0]&&(bt.rightJoints=[]),bt.id===Bt.oldJoints[0][0]&&(bt.rightJoints=[Bt.resizedElementId]));else if(Bt.oldJoints[1]!==Bt.newJoints[0])for(const bt of pn.elements)bt.type===z.Wall&&(bt.id===Bt.newJoints[0][0]&&(bt.leftJoints=[]),bt.id===Bt.oldJoints[1][0]&&(bt.leftJoints=[Bt.resizedElementId]));break}case Xr.left:case Xr.right:{if(!Bt.oldJoints[0]&&Bt.newJoints[1]){for(const bt of pn.elements)if(bt.type===z.Wall&&bt.id===Bt.newJoints[1][0]){bt.leftJoints=[];break}}else if(!Bt.oldJoints[1]&&Bt.newJoints[0]){for(const bt of pn.elements)if(bt.type===z.Wall&&bt.id===Bt.newJoints[0][0]){bt.rightJoints=[];break}}else if(Bt.flippedWallSide===Xr.left&&Bt.oldJoints[0])for(const bt of pn.elements)bt.type===z.Wall&&(bt.id===Bt.newJoints[1][0]&&(bt.leftJoints=[]),bt.id===Bt.oldJoints[0][0]&&(bt.rightJoints=[$e.id]));else if(Bt.flippedWallSide===Xr.right&&Bt.oldJoints[1])for(const bt of pn.elements)bt.type===z.Wall&&(bt.id===Bt.newJoints[0][0]&&(bt.rightJoints=[]),bt.id===Bt.oldJoints[1][0]&&(bt.leftJoints=[$e.id]));break}case Xr.null:{if(Bt.oldJoints[0]!==Bt.newJoints[0])for(const bt of pn.elements)bt.type===z.Wall&&(bt.id===Bt.newJoints[0][0]&&(bt.rightJoints=[]),bt.id===Bt.oldJoints[0][0]&&(bt.rightJoints=[$e.id]));if(Bt.oldJoints[1]!==Bt.newJoints[1])for(const bt of pn.elements)bt.type===z.Wall&&(bt.id===Bt.newJoints[1][0]&&(bt.leftJoints=[]),bt.id===Bt.oldJoints[1][0]&&(bt.leftJoints=[$e.id]));pn.updateWallMapOnFoundationFlag=!pn.updateWallMapOnFoundationFlag;break}}break}pn.elements.push(...Bt.autoDeletedElement),pn.resizeHandleType=null,pn.deletedRoofId=null,pn.autoDeletedRoofs=null,pn.autoDeletedRoofIdSet.clear(),pn.autoDeletedChild=null}),Pe.current=Xr.null},redo:()=>{Bt.autoDeletedElement.length>0&&N(Bt.autoDeletedElement[0].id,!1,!1,!0);const pn=new Set(Bt.autoDeletedElement.map(Pn=>Pn.id));switch(v(Pn=>{Pn.elements=Pn.elements.filter($e=>!pn.has($e.id));for(const $e of Pn.elements)if($e.id===Bt.resizedElementId){const bt=$e;switch(bt.cx=Bt.newPosition.x,bt.cy=Bt.newPosition.y,bt.cz=Bt.newPosition.z,bt.lx=Bt.newDimension.x,bt.ly=Bt.newDimension.y,bt.lz=Bt.newDimension.z,Bt.flippedWallSide){case Xr.left:bt.relativeAngle=(Bt.newAngle+Math.PI)%la;for(const Lt of Pn.elements)if(Lt.type===z.Wall&&Lt.id===Bt.oldJoints[0][0]){Lt.rightJoints=[];break}break;case Xr.right:bt.relativeAngle=(Bt.newAngle+Math.PI)%la;for(const Lt of Pn.elements)if(Lt.type===z.Wall&&Lt.id===Bt.oldJoints[1][0]){Lt.leftJoints=[];break}break;case Xr.loop:bt.relativeAngle=(Bt.newAngle+Math.PI)%la,bt.leftJoints=[...Bt.newJoints[1]],bt.rightJoints=[...Bt.newJoints[0]],bt.leftPoint=[...Bt.newPoint[1]],bt.rightPoint=[...Bt.newPoint[0]];for(const Lt of Pn.elements)Lt.type===z.Wall&&(Lt.id===Bt.newJoints[0][0]&&(Lt.leftJoints=[bt.id]),Lt.id===Bt.newJoints[1][0]&&(Lt.rightJoints=[bt.id]));break;case Xr.null:if(bt.relativeAngle=Bt.newAngle,bt.leftJoints=[...Bt.newJoints[0]],bt.rightJoints=[...Bt.newJoints[1]],bt.leftPoint=[...Bt.newPoint[0]],bt.rightPoint=[...Bt.newPoint[1]],Bt.oldJoints[0][0]!==Bt.newJoints[0][0])for(const Lt of Pn.elements)Lt.type===z.Wall&&(Lt.id===Bt.newJoints[0][0]&&(Lt.rightJoints=[bt.id]),Lt.id===Bt.oldJoints[0][0]&&(Lt.rightJoints=[]));if(Bt.oldJoints[1][0]!==Bt.newJoints[1][0])for(const Lt of Pn.elements)Lt.type===z.Wall&&(Lt.id===Bt.newJoints[1][0]&&(Lt.leftJoints=[bt.id]),Lt.id===Bt.oldJoints[1][0]&&(Lt.leftJoints=[]));Pn.updateWallMapOnFoundationFlag=!Pn.updateWallMapOnFoundationFlag;break}break}Pn.resizeHandleType=null}),setTimeout(()=>{v(Pn=>{Pn.deletedRoofId=null,Pn.autoDeletedRoofs=null,Pn.autoDeletedRoofIdSet.clear()})}),Bt.flippedWallSide){case Xr.left:{const Pn=C(Bt.resizedElementId),$e=C(Bt.newJoints[1][0]);Rr(Pn,$e);break}case Xr.right:{const Pn=C(Bt.resizedElementId),$e=C(Bt.newJoints[0][0]);ir(Pn,$e);break}case Xr.loop:Ee.current.clear();for(const Pn of H.getState().elements)Pn.type===z.Wall&&Pn.parentId===e&&Ee.current.set(Pn.id,Pn);uo(Bt.resizedElementId);break}Pe.current=Xr.null}};le(Bt),v(pn=>{pn.actionState.wallHeight=un.lz,pn.deletedRoofId=null,pn.autoDeletedRoofs=null,pn.autoDeletedRoofIdSet.clear(),pn.autoDeletedChild=[]})},In=(un,$t,Bt)=>{if(un.roofId)lt.current=!0,zt.current={wall:un,newAngle:$t,newJoints:[[...Bt[0]],[...Bt[1]]]};else{const pn={name:"Move Wall",timestamp:Date.now(),id:un.id,oldPoints:[[...Rt.current[0]],[...Rt.current[1]]],newPoints:[[...un.leftPoint],[...un.rightPoint]],oldJoints:[[...St.current[0]],[...St.current[1]]],newJoints:[[...Bt[0]],[...Bt[1]]],oldAngle:st.current,newAngle:$t,flippedWallSide:Pe.current,undo(){switch(this.flippedWallSide){case Xr.loop:{uo(this.id);break}case Xr.left:{const xt=C(this.newJoints[0][0]);xt&&ir(xt);break}case Xr.right:{const xt=C(this.newJoints[1][0]);xt&&Rr(xt);break}}const[Pn,$e]=this.oldJoints,[bt,Lt]=this.newJoints;v(xt=>{for(const jt of xt.elements)if(jt.id===this.id){const[Kt,sn]=this.oldPoints;jt.cx=(Kt[0]+sn[0])/2,jt.cy=(Kt[1]+sn[1])/2,jt.lx=Math.hypot(Kt[0]-sn[0],Kt[1]-sn[1]);const yn=jt;yn.relativeAngle=this.oldAngle,yn.leftPoint=[...Kt],yn.rightPoint=[...sn],yn.leftJoints=[...Pn],yn.rightJoints=[...$e];break}xt.resizeHandleType=null}),Pn[0]!==bt[0]&&v(xt=>{for(const jt of xt.elements)jt.type===z.Wall&&(jt.id===Pn[0]&&(jt.rightJoints=[this.id]),jt.id===bt[0]&&(this.flippedWallSide!==Xr.left?jt.rightJoints=[]:jt.leftJoints=[]))}),$e[0]!==Lt[0]&&v(xt=>{for(const jt of xt.elements)jt.type===z.Wall&&(jt.id===$e[0]&&(jt.leftJoints=[this.id]),jt.id===Lt[0]&&(this.flippedWallSide!==Xr.right?jt.leftJoints=[]:jt.rightJoints=[]))}),Pe.current=Xr.null},redo(){const[Pn,$e]=this.oldJoints,[bt,Lt]=this.newJoints;switch(v(xt=>{for(const jt of xt.elements)if(jt.id===this.id&&jt.type===z.Wall){const[Kt,sn]=this.newPoints;jt.cx=(Kt[0]+sn[0])/2,jt.cy=(Kt[1]+sn[1])/2,jt.lx=Math.hypot(Kt[0]-sn[0],Kt[1]-sn[1]);const yn=jt;yn.relativeAngle=this.newAngle,yn.leftPoint=[...Kt],yn.rightPoint=[...sn],yn.leftJoints=[...bt],yn.rightJoints=[...Lt];break}}),Pn[0]!==bt[0]&&v(xt=>{for(const jt of xt.elements)jt.type===z.Wall&&(jt.id===Pn[0]&&(jt.rightJoints=[]),jt.id===bt[0]&&(this.flippedWallSide===Xr.right?jt.leftJoints=[this.id]:jt.rightJoints=[this.id]))}),$e[0]!==Lt[0]&&v(xt=>{for(const jt of xt.elements)jt.type===z.Wall&&(jt.id===$e[0]&&(jt.leftJoints=[]),jt.id===Lt[0]&&(this.flippedWallSide===Xr.right?jt.rightJoints=[this.id]:jt.leftJoints=[this.id]))}),this.flippedWallSide){case Xr.loop:{uo(this.id);break}case Xr.left:{const xt=C(this.newJoints[0][0]);xt&&Rr(xt);break}case Xr.right:{const xt=C(this.newJoints[1][0]);xt&&ir(xt);break}}v(xt=>{xt.resizeHandleType=null}),Pe.current=Xr.null}};le(pn)}},ar=un=>{if(un.button===2){un.altKey&&F(e,un,Oo.Select);return}v(pn=>{pn.contextMenuObjectType=null}),H.getState().objectTypeToAdd!==z.Window&&!q()&&F(e,un,Oo.Select);const $t=P();let Bt=!1;if(un.intersections[0].object.name===z.Polygon&&H.getState().objectTypeToAdd!==z.None&&(Bt=!0),($t==null?void 0:$t.id)===e||Bt)if($o(H.getState().objectTypeToAdd)){if(t){ze(!0);const pn=un.intersections.filter($e=>!$e.eventObject.name.startsWith("Wall Intersection Plane"))[0].point,Pn=U(t,pn);Pn&&Vr(Pn),v($e=>{$e.actionModeLock||($e.objectTypeToAdd=z.None)})}}else Fn.getState().selectNone(),Fn.setState({foundationRef:Be});else if($t&&$t.parentId===e&&$o($t.type))switch(We.current=$t,$t.type===z.Wall&&!Ae.current&&(Me.current=[...H.getState().elements]),ze(!0),Xe.current.set($t.cx,$t.cy,$t.cz),ft.current.set($t.lx,$t.ly,$t.lz),ht.getState().setPrimitiveStore("oldParentId",e),ht.getState().setPrimitiveStore("oldFoundationId",e),$t.type){case z.SolarPanel:case z.ParabolicTrough:case z.FresnelReflector:{st.current=$t.relativeAzimuth;break}case z.Polygon:{Oe.current=$t.vertices.map(pn=>({...pn}));break}case z.Wall:{const pn=$t;st.current=pn.relativeAngle,St.current=[[...pn.leftJoints],[...pn.rightJoints]],Rt.current=[[...pn.leftPoint],[...pn.rightPoint]],eo.current=pn.leftJoints[0],Xn.current=pn.rightJoints[0],Ee.current.clear();for(const Pn of H.getState().elements)Pn.type===z.Wall&&Pn.parentId===e&&Ee.current.set(Pn.id,Pn);break}}if(Ae.current&&ve.current&&Je.current){const pn=kt.intersectObjects([Je.current]);if(pn.length===0)return;let Pn=me.wallRelativePosition(pn[0].point,t);ce[0].position&&(Pn.setX(ce[0].position[0]),Pn.setY(ce[0].position[1]));const{id:$e,point:bt,side:Lt,jointId:xt}=mo(Pn,1.5);Pn=Jn(Pn,bt);let jt=vt.LowerRight;if($e){const Kt=C($e);Lt===G1.Right?v(sn=>{for(const yn of sn.elements)if(yn.type===z.Wall){if(yn.id===ve.current){const An=yn;An.cx=Pn.x,An.cy=Pn.y,Kt.rightJoints.length===0&&(An.leftJoints=[Kt.id])}yn.id===$e&&Kt.rightJoints.length===0&&(yn.rightJoints=ve.current?[ve.current]:[])}}):Lt===G1.Left&&!xt&&(v(sn=>{for(const yn of sn.elements)if(yn.type===z.Wall){if(yn.id===ve.current){const An=yn;An.cx=Pn.x,An.cy=Pn.y,Kt.leftJoints.length===0&&(An.rightJoints=[Kt.id])}yn.id===$e&&Kt.leftJoints.length===0&&(yn.leftJoints=ve.current?[ve.current]:[])}}),jt=vt.LowerLeft)}else T(ve.current,Pn.x,Pn.y);Ae.current=!1,Te.current=!0,D(ve.current,[Pn.x,Pn.y,Pn.z]),v(Kt=>{Kt.resizeHandleType=jt,Kt.resizeAnchor=me.wallAbsolutePosition(Pn,t)}),Fn.getState().setEnableOrbitController(!1),We.current=$t}},No=un=>{if(Bl&&Rc(!1),un.altKey&&un.button===2&&k&&k.length>0){v(pn=>{pn.pastePoint.copy(un.intersections[0].point),pn.clickObjectType=z.Foundation,pn.pasteNormal=Io});const Bt=L();if(Bt.length>0){const pn={name:"Paste to Point",timestamp:Date.now(),pastedElements:Bt.map(Pn=>({...Pn})),undo:()=>{for(const Pn of pn.pastedElements)N(Pn.id,!1)},redo:()=>{v(Pn=>{Pn.elements.push(...pn.pastedElements),Pn.selectedElement=pn.pastedElements[0]})}};le(pn)}}if(!We.current||We.current.type===z.Tree||We.current.type===z.Flower||We.current.type===z.Human)return;const $t=C(We.current.id);if($t){switch($t.type){case z.Wall:{const Bt=$t;if(Ae.current)v(pn=>{pn.elements.pop(),pn.addedWallId=null,pn.actionModeLock&&(pn.objectTypeToAdd=z.Wall,vx.selectNone(pn))}),ve.current&&Ee.current.delete(ve.current),ve.current=null,Ae.current=!1,Te.current=!1;else if(Te.current&&ve.current&&Je.current)Fn.getState().setEnableOrbitController(!0),v(pn=>{pn.actionModeLock&&(pn.objectTypeToAdd=z.Wall,vx.selectNone(pn)),pn.addedWallId=null,Bt.lx===0&&Me.current?(pn.elements=[...Me.current],ve.current&&Ee.current.delete(ve.current)):(Wo(Bt),Ee.current.set(Bt.id,Bt))}),ve.current=null,Te.current=!1;else if(H.getState().resizeHandleType)Bt.lx>.45?(Ee.current.set(Bt.id,Bt),ut.current.set(Bt.cx,Bt.cy,Bt.cz),ot.current.set(Bt.lx,Bt.ly,Bt.lz),at.current=Bt.relativeAngle,Pt.current=[[...Bt.leftJoints],[...Bt.rightJoints]],Ut.current=[[...Bt.leftPoint],[...Bt.rightPoint]],wn(Bt)):v(pn=>{Me.current&&(pn.elements=[...Me.current],Me.current=null)});else if(H.getState().moveHandleType){let pn=Bt.relativeAngle,Pn=[],$e=[];if(eo.current)if(Bt.leftJoints.length>0&&(eo.current!==Bt.leftJoints[0]||eo.current===Bt.leftJoints[0]&&Jo.current)&&M(Bt.leftJoints[0],[]),Jo.current)R(eo.current,[Bt.id]),$e=[eo.current];else if(Pn=[eo.current],Qo.current){R(eo.current,[Bt.id]);const bt=C(eo.current);bt&&Rr(bt)}else M(eo.current,[Bt.id]);else Bt.leftJoints.length>0&&Bt.leftJoints[0]!==Xn.current&&(Pn=[],M(Bt.leftJoints[0],[]));if(Xn.current)if(Bt.rightJoints.length>0&&(Xn.current!==Bt.rightJoints[0]||Xn.current===Bt.rightJoints[0]&&Jo.current)&&Bt.rightJoints[0]!==eo.current&&R(Bt.rightJoints[0],[]),Jo.current)M(Xn.current,[Bt.id]),Pn=[Xn.current];else if($e=[Xn.current],xo.current){M(Xn.current,[Bt.id]);const bt=C(Xn.current);bt&&ir(bt)}else R(Xn.current,[Bt.id]);else Bt.rightJoints.length>0&&Bt.rightJoints[0]!==eo.current&&($e=[],R(Bt.rightJoints[0],[]));v(bt=>{for(const Lt of bt.elements)if(Lt.id===Bt.id&&Lt.type===z.Wall){const xt=Lt;if(Jo.current&&(pn=(xt.relativeAngle+Math.PI)%la,xt.relativeAngle=pn,[xt.leftPoint,xt.rightPoint]=[[...xt.rightPoint],[...xt.leftPoint]]),Pn.length===0&&$e.length===0)xt.roofId=null;else if(Pn.length>0){const jt=bt.elements.find(Kt=>Kt.id===Pn[0]);jt&&(xt.roofId=jt.roofId)}else if($e.length>0){const jt=bt.elements.find(Kt=>Kt.id===$e[0]);jt&&(xt.roofId=jt.roofId)}xt.leftJoints=[...Pn],xt.rightJoints=[...$e];break}bt.updateWallMapOnFoundationFlag=!bt.updateWallMapOnFoundationFlag}),br(Bt.id),In(Bt,pn,[[...Pn],[...$e]]),Jo.current=!1,Qo.current=!1,xo.current=!1,eo.current=null,Xn.current=null}Pe.current=Xr.null,v(pn=>{pn.updateWallMapOnFoundationFlag=!pn.updateWallMapOnFoundationFlag}),ye({show:!1,direction:null,position:null}),pe([{show:!1,direction:null,position:null},{show:!1,direction:null,position:null}]);break}case z.Polygon:{if(H.getState().moveHandleType||H.getState().resizeHandleType){Ze.current=$t.vertices.map(pn=>({...pn}));const Bt={name:H.getState().moveHandleType?"Move Polygon":"Resize Polygon",timestamp:Date.now(),oldValue:Oe.current,newValue:Ze.current,changedElementId:$t.id,changedElementType:$t.type,undo:()=>{j(Bt.changedElementId,Bt.oldValue)},redo:()=>{j(Bt.changedElementId,Bt.newValue)}};le(Bt)}break}default:if(H.getState().resizeHandleType){if(ut.current.set($t.cx,$t.cy,$t.cz),ot.current.set($t.lx,$t.ly,$t.lz),ut.current.distanceToSquared(Xe.current)>It||ot.current.distanceToSquared(ft.current)>It){const Bt={name:"Resize",timestamp:Date.now(),resizedElementId:We.current.id,resizedElementType:We.current.type,oldCx:Xe.current.x,oldCy:Xe.current.y,oldCz:Xe.current.z,newCx:ut.current.x,newCy:ut.current.y,newCz:ut.current.z,oldLx:ft.current.x,oldLy:ft.current.y,oldLz:ft.current.z,newLx:ot.current.x,newLy:ot.current.y,newLz:ot.current.z,undo:()=>{T(Bt.resizedElementId,Bt.oldCx,Bt.oldCy,Bt.oldCz),A(Bt.resizedElementId,Bt.oldLx,Bt.oldLy,Bt.oldLz)},redo:()=>{T(Bt.resizedElementId,Bt.newCx,Bt.newCy,Bt.newCz),A(Bt.resizedElementId,Bt.newLx,Bt.newLy,Bt.newLz)}};le(Bt)}}else if(H.getState().rotateHandleType){if(me.isSolarCollector(We.current)){const Bt=We.current;if(Math.abs(at.current-st.current)>It)if(Fs(Bt,at.current)){v(Pn=>{Pn.selectedElementAngle=at.current});const pn={name:"Rotate",timestamp:Date.now(),oldValue:st.current,newValue:at.current,changedElementId:Bt.id,changedElementType:Bt.type,undo:()=>{E(pn.changedElementId,pn.oldValue)},redo:()=>{E(pn.changedElementId,pn.newValue)}};le(pn)}else E(Bt.id,st.current)}}else if(ut.current.set($t.cx,$t.cy,$t.cz),ut.current.distanceToSquared(Xe.current)>It){let Bt=!0;me.isSolarCollector($t)&&(Bt=wi($t,$t.cx,$t.cy)),Bt?Eu.addUndoableMove():v(pn=>{const Pn=pn.elements.find(xt=>xt.id===$t.id);if(!Pn||!pn.selectedElement)return;const $e=pn.selectedElement;Pn.cx=$e.cx,Pn.cy=$e.cy,Pn.cz=$e.cz,Pn.rotation=[...$e.rotation],Pn.normal=[...$e.normal];const bt=ht.getState().oldParentId,Lt=ht.getState().oldFoundationId;bt&&(Pn.parentId=bt),Lt&&(Pn.foundationId=Lt)})}}ze(!1),We.current=null,v(Bt=>{Bt.resizeHandleType=null,Bt.moveHandleType=null})}},eo=m.useRef(null),Xn=m.useRef(null),Jo=m.useRef(!1),xo=m.useRef(!1),Qo=m.useRef(!1),jo=(un,$t,Bt)=>{let pn=Math.atan2($t.y-un.y,$t.x-un.x)-(Bt===vt.LowerLeft?Math.PI:0);return pn=pn>=0?pn:(la+pn)%la,pn},lr=(un,$t)=>{let pn=null,Pn=null,$e=1/0,bt=1/0;for(const[Lt,xt]of Ee.current)if(We.current!==null&&xt.id!==We.current.id&&xt.id!==$t){const jt=Math.abs(un.x-xt.leftPoint[0]),Kt=Math.abs(un.x-xt.rightPoint[0]),sn=Math.abs(un.y-xt.leftPoint[1]),yn=Math.abs(un.y-xt.rightPoint[1]);jt<1&&jt<$e&&($e=jt,pn=xt.leftPoint[0]),Kt<1&&Kt<$e&&($e=Kt,pn=xt.rightPoint[0]),sn<1&&sn{const $e=jo(un,$t,Bt);let bt=null,Lt=null;return $e<.05||$e>la-.05||Math.abs($e-Math.PI)<.05||Math.abs($t.y-un.y)<1?Lt=un.y:(Math.abs($e-Math.PI/2)<.05||Math.abs($e-3*Math.PI/2)<.05||Math.abs($t.x-un.x)<1)&&(bt=un.x),[bt,Lt]},ai=(un,$t,Bt,pn)=>{const[Pn,$e]=lr($t),[bt,Lt]=fr(un,$t,Bt),xt=hr($t.x,Pn,bt),jt=hr($t.y,$e,Lt);return new ie(xt,jt,$t.z)},hr=(un,$t,Bt)=>$t!==null&&Bt!==null?Math.abs($t-un){let[pn,Pn]=[1/0,1/0],$e=null,bt=null;for(const[Lt,xt]of Ee.current)if(We.current!==null&&xt.id!==We.current.id&&xt.id!==Bt){const jt=Math.abs(un.x-xt.leftPoint[0]),Kt=Math.abs(un.x-xt.rightPoint[0]);jt<.01&&jt{$e!==null&&bt!==null?(Lt[$t].direction="xy",Lt[$t].position=[$e,bt]):$e!==null?(Lt[$t].direction="y",Lt[$t].position=[$e,un.y]):bt!==null?(Lt[$t].direction="x",Lt[$t].position=[un.x,bt]):(Lt[$t].direction=null,Lt[$t].position=null)})),[$e!==null,bt!==null]},xi=(un,$t)=>Math.abs($t)<.01||Math.abs($t-Math.PI)<.01?(ye(Bt=>({...Bt,direction:"x",position:[un.x,un.y]})),[!0,!1]):Math.abs($t-Math.PI/2)<.01||Math.abs($t-3*Math.PI/2)<.01?(ye(Bt=>({...Bt,direction:"y",position:[un.x,un.y]})),[!1,!0]):(ye(Bt=>({...Bt,direction:null,position:null})),[!1,!1]),Eo=(un,$t)=>{pe(OP(Bt=>{Bt[0].show=un})),ye(Bt=>({...Bt,show:$t}))},bi=(un,$t)=>{const[Bt,pn]=tr(un),[Pn,$e]=xi(un,$t);Bt&&pn?Eo(!0,!1):Bt?Eo(!0,!$e&&Pn):pn?Eo(!0,!Pn&&$e):Eo(!1,Pn||$e)},hl=un=>{var $e,bt;if(!t||(qu(un),We.current&&me.isSolarCollector(We.current)))return;const $t=H.getState().objectTypeToAdd;if(!We.current&&!ve.current&&$t!==z.Wall||(($e=We.current)==null?void 0:$e.parentId)!==e&&$t===z.None)return;const Bt=H.getState().moveHandleType,pn=H.getState().resizeHandleType,Pn=H.getState().resizeAnchor;if(gn(un),Je.current){const Lt=kt.intersectObjects([Je.current]);if(Lt.length===0)return;let xt=Lt[0].point;if(We.current&&We.current.type&&!We.current.locked&&Lt.length>0)switch(ze(!0),We.current.type){case z.Sensor:case z.Light:case z.WindTurbine:{xt=me.relativeCoordinates(xt.x,xt.y,xt.z,t),T(We.current.id,xt.x,xt.y);break}case z.Polygon:{const jt=We.current;if(Bt===Ho.Default){xt=me.relativeCoordinates(xt.x,xt.y,xt.z,t);const Kt=me.calculatePolygonCentroid(jt.vertices),sn=xt.x-Kt.x,yn=xt.y-Kt.y,An=jt.vertices.map(bn=>({...bn}));An.forEach(bn=>{bn.x+=sn,bn.y+=yn}),j(jt.id,An)}else pn===vt.Default&&(xt.x-=t.cx,xt.y-=t.cy,xt.applyEuler(new nn().fromArray(t.rotation.map(Kt=>-Kt))),xt=H.getState().enableFineGrid?me.snapToFineGrid(xt):me.snapToNormalGrid(xt),xt.x/=t.lx,xt.y/=t.ly,W(jt.id,jt.selectedIndex,xt.x,xt.y));break}case z.Wall:{if(((bt=H.getState().selectedElement)==null?void 0:bt.type)!==z.Wall)break;if(pn&&(pn===vt.LowerLeft||pn===vt.LowerRight)){const jt=me.wallRelativePosition(Pn,t);xt=me.wallRelativePosition(xt,t);let Kt=null;H.getState().enableFineGrid?xt=me.snapToFineGrid(xt):(Kt=mo(xt,1.5),Kt!=null&&Kt.point?xt=Kt.point:(xt=me.snapToNormalGrid(xt),xt=ai(jt,xt,pn),Kt=mo(xt,1.5),Kt!=null&&Kt.point&&(xt=Kt.point)));const sn=jo(jt,xt,pn);bi(xt,sn);const yn=xt.distanceTo(jt),An=new ie().addVectors(xt,jt).divideScalar(2),bn=pn===vt.LowerLeft?xt:jt,Ln=pn===vt.LowerLeft?jt:xt;v(Wn=>{for(const oo of Wn.elements)if(oo.id===We.current.id&&oo.type===z.Wall){const qn=oo;qn.cx=An.x,qn.cy=An.y,qn.lx=yn,qn.relativeAngle=sn,qn.leftPoint=[bn.x,bn.y,0],qn.rightPoint=[Ln.x,Ln.y,0];break}});const Yn=C(We.current.id);if(Yn){if(Kt&&Kt.point){if(Kt.id&&Kt.side&&!Kt.jointId){const Wn=C(Kt.id);if(Wn){if(pn===vt.LowerLeft&&Wn.leftJoints.length===0&&Kt.side===G1.Left){if(Yn.leftJoints.length>0&&Yn.leftJoints[0]!==Kt.id){const oo=Yn.leftJoints[0];v(qn=>{for(const Ko of qn.elements)if(Ko.id===oo&&Ko.type===z.Wall){Ko.rightJoints=[];break}})}Rr(Yn,Wn)}else if(pn===vt.LowerRight&&Wn.rightJoints.length===0&&Kt.side===G1.Right){if(Yn.rightJoints.length>0&&Yn.rightJoints[0]!==Kt.id){const oo=Yn.rightJoints[0];v(qn=>{for(const Ko of qn.elements)if(Ko.id===oo&&Ko.type===z.Wall){Ko.leftJoints=[];break}})}ir(Yn,Wn)}else pn===vt.LowerRight&&Kt.side===G1.Left&&Wn.leftJoints.length===0&&Wn.rightJoints[0]!==Yn.id?v(oo=>{let qn=null;Yn.rightJoints.length>0&&Yn.rightJoints[0]!==(Kt==null?void 0:Kt.id)&&(qn=Yn.rightJoints[0]);for(const Ko of oo.elements)Ko.type===z.Wall&&(Ko.id===Yn.id&&(Ko.rightJoints=[Wn.id]),Ko.id===Wn.id&&(Ko.leftJoints=[Yn.id]),Ko.id===qn&&(Ko.leftJoints=[]))}):pn===vt.LowerLeft&&Kt.side===G1.Right&&Wn.rightJoints.length===0&&Wn.leftJoints[0]!==Yn.id&&v(oo=>{let qn=null;Yn.leftJoints.length>0&&Yn.leftJoints[0]!==(Kt==null?void 0:Kt.id)&&(qn=Yn.leftJoints[0]);for(const Ko of oo.elements)Ko.type===z.Wall&&(Ko.id===Yn.id&&(Ko.leftJoints=[Wn.id]),Ko.id===Wn.id&&(Ko.rightJoints=[Yn.id]),Ko.id===qn&&(Ko.rightJoints=[]))});br(Yn.id)}}}else if(pn===vt.LowerRight&&Yn.rightJoints.length>0){const Wn=Yn.rightJoints[0];v(oo=>{for(const qn of oo.elements)qn.type===z.Wall&&(qn.id===Yn.id&&(qn.rightJoints=[]),qn.id===Wn&&(qn.leftJoints=[]));oo.updateWallMapOnFoundationFlag=!oo.updateWallMapOnFoundationFlag})}else if(pn===vt.LowerLeft&&Yn.leftJoints.length>0){const Wn=Yn.leftJoints[0];v(oo=>{for(const qn of oo.elements)qn.type===z.Wall&&(qn.id===Yn.id&&(qn.leftJoints=[]),qn.id===Wn&&(qn.rightJoints=[]));oo.updateWallMapOnFoundationFlag=!oo.updateWallMapOnFoundationFlag})}}}else if(Bt){const jt=C(We.current.id);if(jt){xt=me.wallRelativePosition(xt,t);const Kt=new ie,sn=new nn(0,0,jt.relativeAngle);Bt===Ho.Lower?Kt.setY(rt):Bt===Ho.Upper&&Kt.setY(-rt-jt.ly),xt.add(Kt.applyEuler(sn));const yn=new ie().addVectors(xt,new ie(-jt.lx/2,0,0).applyEuler(sn)),An=new ie().addVectors(xt,new ie(jt.lx/2,0,0).applyEuler(sn));let bn=null,Ln=null,Yn=!1;Jo.current=!1,Qo.current=!1,xo.current=!1,eo.current=null,Xn.current=null;const Wn=(oo,qn)=>{const Ko=qn==="left"?yn:An,li=new ie().subVectors(oo,Ko);xt.add(li),yn.add(li),An.add(li)};if(!H.getState().enableFineGrid){let oo=mo(yn,1);oo.point?(Wn(oo.point,"left"),oo.id&&(!oo.jointId||oo.jointId===jt.id)&&(eo.current=oo.id,bn=oo.side===G1.Left)):eo.current=null;let qn=mo(An,1);if(qn.point?(oo.id||Wn(qn.point,"right"),qn.id&&(!qn.jointId||qn.jointId===jt.id)&&(oo.id!==qn.id||oo.side!==qn.side)&&(Xn.current=qn.id,Ln=qn.side===G1.Right)):Xn.current=null,!oo.point&&!qn.point){const[ya,Ps]=lr(yn),[$u,Qu]=lr(An);if(ya!==null||$u!==null){const Rh=(ya??1/0)-yn.x,Df=($u??1/0)-An.x,Zu=Math.min(Rh,Df);yn.setX(yn.x+Zu),An.setX(An.x+Zu),xt.setX(xt.x+Zu),oo=mo(yn,1),oo.point?(Wn(oo.point,"left"),oo.id&&(!oo.jointId||oo.jointId===jt.id)&&(eo.current=oo.id,bn=oo.side===G1.Left)):eo.current=null}if(Ps!==null||Qu!==null){const Rh=(Ps??1/0)-yn.y,Df=(Qu??1/0)-An.y,Zu=Math.min(Rh,Df);yn.setY(yn.y+Zu),An.setY(An.y+Zu),xt.setY(xt.y+Zu),qn=mo(An,1),qn.point?(oo.id||Wn(qn.point,"right"),qn.id&&(!qn.jointId||qn.jointId===jt.id)&&(oo.id!==qn.id||oo.side!==qn.side)&&(Xn.current=qn.id,Ln=qn.side===G1.Right)):Xn.current=null}}const[Ko,li]=tr(yn,0),[$i,Or]=tr(An,1);pe(OP(ya=>{ya[0].show=Ko||li,ya[1].show=$i||Or})),bn&&Ln===null||Ln&&bn===null||bn&&Ln?Jo.current=!0:(bn&&Ln===!1||Ln&&bn===!1)&&(Qo.current=bn,xo.current=Ln),oo.point&&qn.point&&(oo.id!==qn.id||oo.side!==qn.side)&&(yn.copy(oo.point),An.copy(qn.point),Yn=!0)}v(oo=>{var qn;for(const Ko of oo.elements)if(Ko.id===((qn=We.current)==null?void 0:qn.id)&&Ko.type===z.Wall){const li=Ko;if(Yn){li.cx=(yn.x+An.x)/2,li.cy=(yn.y+An.y)/2,li.lx=yn.distanceTo(An);let $i=Math.atan2(An.y-yn.y,An.x-yn.x);$i=$i>=0?$i:(la+$i)%la,li.relativeAngle=$i}else li.cx=xt.x,li.cy=xt.y;li.leftPoint=yn.toArray(),li.rightPoint=An.toArray();break}})}}break}}if($t===z.Wall&&!Ae.current){Me.current=[...H.getState().elements];const jt=U(t,xt);We.current=jt,ve.current=jt.id,Ae.current=!0,ze(!0),Fn.getState().setEnableOrbitController(!1),v(Kt=>{Kt.addedWallId=jt.id,Kt.objectTypeToAdd=z.None})}if(ve.current&&Ae.current){xt=me.wallRelativePosition(Lt[0].point,t);let jt=null;if(H.getState().enableFineGrid)xt=me.snapToFineGrid(xt);else if(jt=mo(xt,1.5),jt!=null&&jt.point)xt=jt.point;else{xt=me.snapToNormalGrid(xt);const[yn,An]=lr(xt);yn!==null&&xt.setX(yn),An!==null&&xt.setY(An),jt=mo(xt,1.5),jt!=null&&jt.point&&(xt=jt.point)}const[Kt,sn]=tr(xt);pe(OP(yn=>{yn[0].show=Kt||sn})),T(ve.current,xt.x,xt.y)}}},nr=un=>{un.intersections.length>0&&un.intersections[0].object===Je.current&&he(!0)},or=un=>{v($t=>{vx.selectMe($t,e,un,Oo.ContextMenu),$t.pastePoint.copy(un.intersections[0].point),$t.clickObjectType=z.Foundation,$t.pasteNormal=Io,un.altKey?$t.contextMenuObjectType=null:un.intersections.length>0&&un.intersections[0].object===Je.current&&($t.contextMenuObjectType=z.Foundation),$t.pasteNormal=Io})},Ai=()=>{Bl&&(Rc(!1),We.current=null),he(!1),ze(!1),We.current&&Ae.current&&(N(We.current.id,!1),Ae.current=!1,v(un=>{un.addedWallId=null,un.objectTypeToAdd=z.Wall}),We.current=null),ye({show:!1,direction:null,position:null}),pe([{show:!1,direction:null,position:null},{show:!1,direction:null,position:null}])},ka=un=>{We.current&&me.isPlantOrHuman(We.current)&&un.intersections[0].object===Je.current&&ze(!0)},wi=(un,$t,Bt)=>{const pn=JSON.parse(JSON.stringify(un));return pn.cx=$t,pn.cy=Bt,te(pn)?(po(Y.t("message.MoveCancelledBecauseOfOverlap",Ht)),!1):me.isSolarCollectorWithinHorizontalSurface(pn,t)?!0:(po(Y.t("message.MoveOutsideBoundaryCancelled",Ht)),!1)},Fs=(un,$t)=>{const Bt=JSON.parse(JSON.stringify(un));return Bt.relativeAzimuth=$t,te(Bt)?(po(Y.t("message.RotationCancelledBecauseOfOverlap",Ht)),!1):me.isSolarCollectorWithinHorizontalSurface(Bt,t)?!0:(po(Y.t("message.RotationOutsideBoundaryCancelled",Ht)),!1)},ks=(un,$t,Bt,pn,Pn)=>{if(un.type===z.SolarPanel&&un.tiltAngle!==0&&.5*Pn*Math.abs(Math.sin(un.tiltAngle))>un.poleHeight)return!1;const $e=JSON.parse(JSON.stringify(un));return $e.cx=$t,$e.cy=Bt,$e.lx=pn,$e.ly=Pn,me.isSolarCollectorWithinHorizontalSurface($e,t)},Zs=un=>{if(Ke.current&&t&&We.current&&t){if(!me.isSolarCollector(We.current))return;const $t=We.current;gn(un);const Bt=kt.intersectObjects([Ke.current]);if(Bt.length>0){let pn=Bt[0].point;const Pn=H.getState().moveHandleType,$e=H.getState().rotateHandleType,bt=H.getState().resizeHandleType;if(Pn&&t)pn=me.relativeCoordinates(pn.x,pn.y,pn.z,t),T($t.id,pn.x,pn.y),$t.parentId!==e&&H.getState().set(Lt=>{const xt=Lt.elements.find(jt=>jt.id===$t.id&&jt.type===z.SolarPanel);xt&&(xt.parentId!==e||xt.foundationId!==e)&&(xt.parentId=e,xt.foundationId=e,xt.parentType=z.Foundation,Lt.selectedElement&&(Lt.selectedElement.parentId=e,xt.color=Lt.selectedElement.color))});else if($e){if($e===Kr.Upper||$e===Kr.Lower){const Lt=t.rotation[2],xt=new Xt(t.cx,t.cy),jt=new Xt(t.lx*$t.cx,t.ly*$t.cy).rotateAround(si,Lt),Kt=new Xt().addVectors(jt,xt),sn=Math.atan2(-pn.x+Kt.x,pn.y-Kt.y)-Lt+($e===Kr.Lower?0:Math.PI),yn=Math.abs(sn)>Math.PI?-Math.sign(sn)*la:0,An=sn+yn;E($t.id,An),at.current=An}}else if(bt){const Lt=H.getState().resizeAnchor,xt=new Xt(pn.x,pn.y),jt=new Xt(Lt.x,Lt.y),Kt=xt.distanceTo(jt),sn=$t.relativeAzimuth+l[2],yn=new Xt().subVectors(xt,jt),An=new Xt(n,o);if($t.type===z.SolarPanel){const bn=$t,Ln=O(bn.pvModelName);switch(bt){case vt.Lower:case vt.Upper:{const Yn=bt===vt.Lower?1:-1,Wn=yn.angle()-sn+Yn*Gt;let oo=Kt*Math.cos(Wn);bn.orientation===vr.portrait?oo=Math.max(1,Math.ceil((oo-Ln.length/2)/Ln.length))*Ln.length:oo=Math.max(1,Math.ceil((oo-Ln.width/2)/Ln.width))*Ln.width;const qn=Lt.x+Yn*(oo*Math.sin(sn))/2,Ko=Lt.y-Yn*(oo*Math.cos(sn))/2,li=new Xt(qn,Ko),$i=new Xt().subVectors(li,An).rotateAround(si,-l[2]),Or=$i.x/r,ya=$i.y/i;ks($t,Or,ya,$t.lx,oo)&&(S($t.id,oo),T($t.id,Or,ya))}break;case vt.Left:case vt.Right:{const Yn=bt===vt.Left?-1:1,Wn=yn.angle()-sn+(bt===vt.Left?Math.PI:0);let oo=Kt*Math.cos(Wn);bn.orientation===vr.portrait?oo=Math.max(1,Math.ceil((oo-Ln.width/2)/Ln.width))*Ln.width:oo=Math.max(1,Math.ceil((oo-Ln.length/2)/Ln.length))*Ln.length;const qn=Lt.x+Yn*(oo*Math.cos(sn))/2,Ko=Lt.y+Yn*(oo*Math.sin(sn))/2,li=new Xt(qn,Ko),$i=new Xt().subVectors(li,An).rotateAround(si,-l[2]),Or=$i.x/r,ya=$i.y/i;ks($t,Or,ya,oo,$t.ly)&&(x($t.id,oo),T($t.id,Or,ya))}break}}else if($t.type===z.ParabolicTrough){const bn=$t;switch(bt){case vt.Lower:case vt.Upper:{const Ln=bt===vt.Lower?1:-1,Yn=yn.angle()-sn+Ln*Gt;let Wn=Kt*Math.cos(Yn);Wn=Math.max(1,Math.ceil((Wn-bn.moduleLength/2)/bn.moduleLength))*bn.moduleLength;const qn=Lt.x+Ln*(Wn*Math.sin(sn))/2,Ko=Lt.y-Ln*(Wn*Math.cos(sn))/2,li=new Xt(qn,Ko),$i=new Xt().subVectors(li,An).rotateAround(si,-l[2]),Or=$i.x/r,ya=$i.y/i;ks($t,Or,ya,$t.lx,Wn)&&(S($t.id,Wn),T($t.id,Or,ya))}break;case vt.Left:case vt.Right:{const Ln=bt===vt.Left?-1:1,Yn=yn.angle()-sn+(bt===vt.Left?Math.PI:0),Wn=Kt*Math.cos(Yn),oo=Lt.x+Ln*(Wn*Math.cos(sn))/2,qn=Lt.y+Ln*(Wn*Math.sin(sn))/2,Ko=new Xt(oo,qn),li=new Xt().subVectors(Ko,An).rotateAround(si,-l[2]),$i=li.x/r,Or=li.y/i;ks($t,$i,Or,Wn,$t.ly)&&(x($t.id,Wn),T($t.id,$i,Or),v(ya=>{ya.actionState.parabolicTroughWidth=Wn}))}break}}else if($t.type===z.FresnelReflector){const bn=$t;switch(bt){case vt.Lower:case vt.Upper:{const Ln=bt===vt.Lower?1:-1,Yn=yn.angle()-sn+Ln*Gt;let Wn=Kt*Math.cos(Yn);Wn=Math.max(1,Math.ceil((Wn-bn.moduleLength/2)/bn.moduleLength))*bn.moduleLength;const qn=Lt.x+Ln*(Wn*Math.sin(sn))/2,Ko=Lt.y-Ln*(Wn*Math.cos(sn))/2,li=new Xt(qn,Ko),$i=new Xt().subVectors(li,An).rotateAround(si,-l[2]),Or=$i.x/r,ya=$i.y/i;ks($t,Or,ya,$t.lx,Wn)&&(S($t.id,Wn),T($t.id,Or,ya))}break;case vt.Left:case vt.Right:{const Ln=bt===vt.Left?-1:1,Yn=yn.angle()-sn+(bt===vt.Left?Math.PI:0),Wn=Kt*Math.cos(Yn),oo=Lt.x+Ln*(Wn*Math.cos(sn))/2,qn=Lt.y+Ln*(Wn*Math.sin(sn))/2,Ko=new Xt(oo,qn),li=new Xt().subVectors(Ko,An).rotateAround(si,-l[2]),$i=li.x/r,Or=li.y/i;ks($t,$i,Or,Wn,$t.ly)&&(x($t.id,Wn),T($t.id,$i,Or),v(ya=>{ya.actionState.fresnelReflectorWidth=Wn}))}break}}else if($t.type===z.ParabolicDish){const bn=$t;switch(bt){case vt.Left:case vt.Right:case vt.Lower:case vt.Upper:{const Ln=Math.min(10,Kt);ks($t,bn.cx,bn.cy,$t.lx,Ln)&&(x($t.id,Ln),S($t.id,Ln),v(Yn=>{Yn.actionState.parabolicDishRimDiameter=Ln}));break}}}}}}},{transparent:Ui,opacity:da}=QH();m.useEffect(()=>{Je.current&&(Je.current.material[4].needsUpdate=!0)},[Ui]);const[Bl,Gl]=m.useState(!1),qu=un=>{const $t=Eu.getIntersectionObjects(un);if($t.length==0||$t[0].eventObject.userData.id!==e){Bl&&(Rc(!1),We.current=null,ze(!1));return}const Bt=H.getState().selectedElement;!Bl&&Bt&&!Bt.locked&&Bt.type===z.SolarPanel&&H.getState().moveHandleType&&(Rc(!0,Bt.poleHeight),We.current=Bt,ze(!0))},Rc=(un,$t)=>{un&&$t!==void 0?(Gl(!0),tn.setZ($t)):(Gl(!1),tn.setZ(0))},mu=()=>Bl?!0:We.current&&me.isSolarCollector(We.current)&&!We.current.locked;return m.useEffect(()=>{const un=()=>{We.current&&Ae.current&&N(We.current.id,!1)};return window.addEventListener("beforeunload",un),()=>{window.removeEventListener("beforeunload",un)}},[]),h.jsx(h.Fragment,{children:h.jsxs("group",{ref:Be,name:`${P2} ${e}`,position:[n,o,Ct],rotation:[0,0,l[2]],userData:{id:e,fId:e},children:[h.jsx(Oye,{parentId:e,foundationId:e,wrapperType:z.Foundation,plx:r,ply:i,plz:a}),h.jsx(KZt,{foundationId:e,wrapperType:z.Foundation}),h.jsxs(Qr,{castShadow:X,receiveShadow:X,uuid:e,userData:{simulation:!0,stand:!0,id:e,aabb:!0},ref:Je,name:sX,args:[r,i,a],onContextMenu:or,onPointerOver:nr,onPointerDown:ar,onPointerUp:No,onPointerMove:L2.throttle(hl,VF,{trailing:!1}),onPointerOut:Ai,onPointerEnter:ka,children:[h.jsx("meshStandardMaterial",{attach:"material-0",color:s}),h.jsx("meshStandardMaterial",{attach:"material-1",color:s}),h.jsx("meshStandardMaterial",{attach:"material-2",color:s}),h.jsx("meshStandardMaterial",{attach:"material-3",color:s}),ae&&xe?h.jsx("meshBasicMaterial",{attach:"material-4",color:"white",map:xe,transparent:Ui,opacity:da}):h.jsx("meshStandardMaterial",{attach:"material-4",color:p===Yi.NoTexture?s:"white",map:Hn,transparent:Ui,opacity:da}),h.jsx("meshStandardMaterial",{attach:"material-5",color:s})]}),mu()&&h.jsx(ua,{ref:Ke,name:"Foundation Intersection Plane",position:tn,args:[r,i],visible:!1,onPointerMove:L2.throttle(Zs,VF)}),Se&&h.jsxs(h.Fragment,{children:[H.getState().rotateHandleType&&We.current&&me.isSolarCollector(We.current)&&h.jsx(Nye,{element:We.current,height:We.current.poleHeight+Ct}),(H.getState().moveHandleType||H.getState().resizeHandleType||ve.current)&&h.jsx(Gge,{hx:gt,hy:dt,hz:Ct})]}),y&&h.jsx(Uye,{element:t,verticalLift:mt}),(!y||$)&&h.jsx(fw,{hx:gt,hy:dt,hz:Ct,lineColor:$&&b?"white":c,lineWidth:$&&b?u*3:u}),y&&d&&h.jsx(fw,{hx:gt,hy:dt,hz:Ct,lineColor:y0,lineWidth:u*5}),Ie.show&&h.jsx("group",{position:[0,0,Ct+.01],children:h.jsx(ESe,{hx:gt,hy:dt,position:Ie.position,direction:Ie.direction,color:"black"})}),h.jsx("group",{position:[0,0,Ct+.01],children:ce.map((un,$t)=>un.show?h.jsx(ESe,{hx:gt,hy:dt,position:un.position,direction:un.direction,color:"yellow"},$t):null)}),y&&!d&&h.jsxs(h.Fragment,{children:[h.jsx(Qr,{ref:Ne,position:[tt.x,tt.y,0],args:[Qe,Qe,a*1.2],name:vt.LowerLeft,onPointerDown:un=>{F(e,un,Oo.Resize),Ne.current&&v($t=>{const Bt=Ne.current.localToWorld(new ie(r,i,0));$t.resizeAnchor.copy(Bt)})},onPointerOver:un=>{yo(un,vt.LowerLeft)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===vt.LowerLeft||H.getState().resizeHandleType===vt.LowerLeft?ta:Da})}),h.jsx(Qr,{ref:De,position:[Fe.x,Fe.y,0],args:[Qe,Qe,a*1.2],name:vt.UpperLeft,onPointerDown:un=>{F(e,un,Oo.Resize),De.current&&v($t=>{const Bt=De.current.localToWorld(new ie(r,-i,0));$t.resizeAnchor.copy(Bt)})},onPointerOver:un=>{yo(un,vt.UpperLeft)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===vt.UpperLeft||H.getState().resizeHandleType===vt.UpperLeft?ta:Da})}),h.jsx(Qr,{ref:ke,position:[qe.x,qe.y,0],args:[Qe,Qe,a*1.2],name:vt.LowerRight,onPointerDown:un=>{F(e,un,Oo.Resize),ke.current&&v($t=>{const Bt=ke.current.localToWorld(new ie(-r,i,0));$t.resizeAnchor.copy(Bt)})},onPointerOver:un=>{yo(un,vt.LowerRight)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===vt.LowerRight||H.getState().resizeHandleType===vt.LowerRight?ta:Da})}),h.jsx(Qr,{ref:Ye,position:[je.x,je.y,0],args:[Qe,Qe,a*1.2],name:vt.UpperRight,onPointerDown:un=>{F(e,un,Oo.Resize),Ye.current&&v($t=>{const Bt=Ye.current.localToWorld(new ie(-r,-i,0));$t.resizeAnchor.copy(Bt)})},onPointerOver:un=>{yo(un,vt.UpperRight)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===vt.UpperRight||H.getState().resizeHandleType===vt.UpperRight?ta:Da})}),!Q&&h.jsxs(h.Fragment,{children:[h.jsx(ds,{ref:it,args:[mt,6,6,0,Math.PI],position:[0,-dt-mt,0],name:Ho.Lower,onPointerDown:()=>{v(un=>{un.moveHandleType=Ho.Lower,un.selectedElement=un.elements.find($t=>$t.id===e)??null;for(const $t of un.elements)un.selectedElementIdSet.has($t.id)&&!me.isElementAllowedMultipleMoveOnGround($t)&&un.selectedElementIdSet.delete($t.id)}),Fn.getState().setEnableOrbitController(!1)},onPointerOver:un=>{yo(un,Ho.Lower)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===Ho.Lower||H.getState().moveHandleType===Ho.Lower?ta:XF})}),h.jsx(ds,{ref:Ve,args:[mt,6,6,0,Math.PI],position:[0,dt+mt,0],name:Ho.Upper,onPointerDown:()=>{v(un=>{un.moveHandleType=Ho.Upper,un.selectedElement=un.elements.find($t=>$t.id===e)??null;for(const $t of un.elements)un.selectedElementIdSet.has($t.id)&&!me.isElementAllowedMultipleMoveOnGround($t)&&un.selectedElementIdSet.delete($t.id)}),Fn.getState().setEnableOrbitController(!1)},onPointerOver:un=>{yo(un,Ho.Upper)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===Ho.Upper||H.getState().moveHandleType===Ho.Upper?ta:XF})}),h.jsx(ds,{ref:yt,args:[mt,6,6,0,Math.PI],position:[-gt-mt,0,0],name:Ho.Left,onPointerDown:()=>{v(un=>{un.moveHandleType=Ho.Left,un.selectedElement=un.elements.find($t=>$t.id===e)??null;for(const $t of un.elements)un.selectedElementIdSet.has($t.id)&&!me.isElementAllowedMultipleMoveOnGround($t)&&un.selectedElementIdSet.delete($t.id)}),Fn.getState().setEnableOrbitController(!1)},onPointerOver:un=>{yo(un,Ho.Left)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===Ho.Left||H.getState().moveHandleType===Ho.Left?ta:tw})}),h.jsx(ds,{ref:ct,args:[mt,6,6,0,Math.PI],position:[gt+mt,0,0],name:Ho.Right,onPointerDown:()=>{v(un=>{un.moveHandleType=Ho.Right,un.selectedElement=un.elements.find($t=>$t.id===e)??null;for(const $t of un.elements)un.selectedElementIdSet.has($t.id)&&!me.isElementAllowedMultipleMoveOnGround($t)&&un.selectedElementIdSet.delete($t.id)}),Fn.getState().setEnableOrbitController(!1)},onPointerOver:un=>{yo(un,Ho.Right)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===Ho.Right||H.getState().moveHandleType===Ho.Right?ta:tw})}),h.jsx(PR,{id:e,position:[0,-Dt,0],color:re===Kr.Lower||H.getState().rotateHandleType===Kr.Lower?ta:Da,ratio:Tt,handleType:Kr.Lower,hoverHandle:yo,noHoverHandle:So}),h.jsx(PR,{id:e,position:[0,Dt,0],color:re===Kr.Upper||H.getState().rotateHandleType===Kr.Upper?ta:Da,ratio:Tt,handleType:Kr.Upper,hoverHandle:yo,noHoverHandle:So})]})]}),!Q&&h.jsxs(h.Fragment,{children:[(Z||f)&&!y&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",text:(t!=null&&t.label?t.label:Y.t("shared.FoundationElement",Ht))+(d?" ("+Y.t("shared.ElementLocked",Ht)+")":""),color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,fontFace:"Roboto",textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,(t==null?void 0:t.labelHeight)??Ct+.2]}),!d&&re===vt.LowerLeft&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label-LL",text:"LL",fontSize:20,fontFace:"Times Roman",textHeight:.2,position:[-gt,-dt,Ct+.2]}),!d&&re===vt.UpperLeft&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label-UL",text:"UL",fontSize:20,fontFace:"Times Roman",textHeight:.2,position:[-gt,dt,Ct+.2]}),!d&&re===vt.LowerRight&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label-LR",text:"LR",fontSize:20,fontFace:"Times Roman",textHeight:.2,position:[gt,-dt,Ct+.2]}),!d&&re===vt.UpperRight&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label-UR",text:"UR",fontSize:20,fontFace:"Times Roman",textHeight:.2,position:[gt,dt,Ct+.2]})]}),g===Dn.FocusPipe&&h.jsx(tZt,{foundation:t}),g===Dn.FocusTower&&h.jsx(eZt,{foundation:t}),g===Dn.UpdraftTower&&h.jsx(ZQt,{foundation:t}),h.jsx(GZt,{...t})]})})}),_ye="Handles Intersection Plane",Vz=t=>{if(t.intersections.length>0){for(const e of t.intersections)if(e.eventObject.name===_ye)return e.point.z<0?null:e.point}return null},J7=(t,e)=>new ie().subVectors(t,new ie(e.cx,e.cy,e.lz)).applyEuler(new nn(0,0,-e.rotation[2])),F$e=(t,e,n,o,r)=>{const[i,a]=[e/2,n/2],[l,s,c]=o,u=new nn().fromArray([l-Gt,s,c,"ZXY"]),d=r.map(f=>({x:f.x,y:f.y}));for(let f=-1;f<=1;f+=2)for(let p=-1;p<=1;p+=2){const g=new ie(i*f,0,a*p).applyEuler(u),y=new ie().addVectors(t,g);if(!me.isPointInside(y.x,y.y,d))return!1}return!0},$Zt=(t,e,n,o,r,i,a)=>{const l=n/2,[s,c,u]=i,d=new nn().fromArray([s-Gt,c,u,"ZXY"]),f=a.map(g=>({x:g.x,y:g.y})),p=new ie().addVectors(t,new ie(o*e,0,l+r).applyEuler(d));return!(!me.isPointInside(p.x,p.y,f)||!F$e(t,e,n,i,a))},QZt=(t,e,n)=>{if(t.intersections.length>0)for(const o of t.intersections){const r=o.eventObject.name;if(r.includes("Window")&&r.includes(e)&&o.object.name!==_ye)return null;if(r.includes("Roof")&&r.includes(n)){const i=o.point.clone(),a=Number.parseInt(o.object.name.split(" ").pop()??"-1");return{pointer:i,segmentIdx:a}}}return null},LSe=t=>{switch(t){case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:return!0}return!1},ZZt=(t,e,n)=>{const o=new ie().subVectors(e,t).applyEuler(new nn(0,0,-n)),r=Math.abs(o.x),i=Math.hypot(o.y,o.z),a=new ie().addVectors(t,e).divideScalar(2);return{newLx:r,newLz:i,newCenter:a}},een=(t,e,n)=>n===Go.Gambrel?Wye(t).map(o=>o.add(e)):t.map(o=>o.points[0].clone().add(e)),WSe=(t,e,n)=>{H.getState().set(o=>{const r=o.elements.find(i=>i.id===t&&i.type===z.Window);r&&([r.cx,r.cy,r.cz]=e,r.rotation=[...n])})},NSe=(t,e,n,o)=>{H.getState().set(r=>{const i=r.elements.find(a=>a.id===t&&a.type===z.Window);i&&([i.cx,i.cy,i.cz]=e,[i.lx,i.ly,i.lz]=n,o!=null&&(i.archHeight=o))})},USe=(t,e)=>{H.getState().set(n=>{const o=n.elements.find(r=>r.id===t&&r.type===z.Window);o&&(o.polygonTop=[...e])})},ten=(t,e,n=.01)=>{if(t.type!==z.SolarPanel&&t.type!==z.Window)return null;const o=new nn().fromArray([t.rotation[0],t.rotation[1],t.rotation[2],"ZXY"]),r=new ie,i=t.lx/2+n;let a=n;t.type===z.SolarPanel?(a+=t.ly/2,r.set(t.cx*e.lx,t.cy*e.ly,0)):(a+=t.lz/2,r.set(t.cx,t.cy,0));const l=[];for(let s=-1;s<=1;s+=2)for(let c=-1;c<=1;c+=2){const u=new ie(s*i,s*c*a).applyEuler(o).add(r);l.push(u)}if(t.type===z.Window&&t.windowType===Ti.Polygonal){const[s,c]=t.polygonTop??Gp,u=new ie(s*i,c+a).applyEuler(o).add(r);l.push(u)}return l},Kie=t=>{if(t.windowType===Ti.Polygonal)return t.polygonTop??Gp},k$e=({z:t})=>{const e=m.useRef(null),[n,o]=m.useState("white");return h.jsx(Qr,{ref:e,name:vt.Arch,args:[.2,.2,.2],position:[0,0,t],onPointerEnter:()=>{o("red")},onPointerLeave:()=>{o("white")},children:h.jsx("meshBasicMaterial",{color:n})})},nen=({id:t,parentId:e,foundationId:n,lx:o,lz:r,polygonTop:i,rotation:a,windowType:l,parentType:s})=>{const c=H(se=>se.addedWindowId),u=H(En),d=c===t,f=s===z.Roof,p=m.useRef(null),g=m.useRef(null),y=m.useRef(null),w=m.useRef(null),b=m.useRef(null),C=m.useRef(null),P=m.useRef(null),v=m.useRef(null),T=m.useRef([]),A=m.useRef(null),x=m.useRef(null),S=m.useRef(null),R=m.useRef(null),M=m.useRef(null),[D,E]=m.useState(!1),[W,j]=[o/2,r/2],[L,k]=i,N=m.useMemo(()=>o*L,[o,L]),F=H(fn),U=(se,ne,fe)=>{if(!n)return null;const ge=H.getState().elements.find(ze=>ze.id===n&&ze.type===z.Foundation);if(!ge)return null;const de=se.object.localToWorld(new ie),[Z,he,xe]=a,He=new nn().fromArray([Z-Gt,he,xe+ge.rotation[2],"ZXY"]),Se=new ie(ne,0,fe).applyEuler(He);return new ie().addVectors(de,Se)},O=se=>{let ne,fe,ge;for(const pe of H.getState().elements)pe.id===t&&pe.type===z.Window?ne=pe:pe.id===n&&pe.type===z.Foundation?fe=pe:pe.id===e&&pe.type===z.Roof&&(ge=pe);const de=Fn.getState().contentRef;if(!ne||!fe||!ge||!de||!de.current)return;const Z=fe.id,he=de.current.children.find(pe=>pe.name===`${P2} ${Z}`);if(!he)return;const xe=he.children.find(pe=>pe.name===D$e);if(!xe)return;const He=xe.children.find(pe=>pe.name.includes("Roof")&&pe.name.includes(e));if(!He)return;const Se=He.children[0];if(!Se)return;for(const pe of H.getState().elements)if(pe.parentId===e&&pe.id!==t){const ve=ten(pe,fe);ve&&T.current.push(ve)}const{centroid:ze,roofSegments:Ie}=Se.userData,ce=new ie(ne.cx,ne.cy,ne.cz+fe.lz).clone().sub(ze);p.current=se,g.current=fe,y.current=ge,C.current=Cn.getSegmentIdx(Ie,ce),b.current=ze,w.current=Ie,v.current=een(w.current,b.current,ge.roofType),A.current=[ne.cx,ne.cy,ne.cz],S.current=[ne.lx,ne.ly,ne.lz],x.current=[...ne.rotation],R.current=ne.archHeight,M.current=ne.polygonTop??null},B=()=>{if(!A.current||!x.current)return;const se=H.getState().elements.find(fe=>fe.id===t&&fe.type===z.Window);if(!se)return;const ne={name:"Move skylight",timestamp:Date.now(),id:se.id,oldPosition:[...A.current],newPosition:[se.cx,se.cy,se.cz],oldRotation:[...x.current],newRotation:[...se.rotation],undo(){WSe(ne.id,ne.oldPosition,ne.oldRotation)},redo(){WSe(ne.id,ne.newPosition,ne.newRotation)}};u(ne)},_=()=>{if(!S.current||!A.current)return;const se=H.getState().elements.find(fe=>fe.id===t&&fe.type===z.Window);if(!se)return;const ne={name:"Resize skylight",timestamp:Date.now(),id:se.id,oldPosition:[...A.current],newPosition:[se.cx,se.cy,se.cz],oldDimension:[...S.current],newDimension:[se.lx,se.ly,se.lz],oldArchHeight:R.current,newArchHeight:se.archHeight,undo(){NSe(this.id,this.oldPosition,this.oldDimension,this.oldArchHeight)},redo(){NSe(this.id,this.newPosition,this.newDimension,this.newArchHeight)}};u(ne)},X=()=>{if(!M.current)return;const se=H.getState().elements.find(fe=>fe.id===t&&fe.type===z.Window);if(!se)return;const ne={name:"Resize skylight top vertex",timestamp:Date.now(),id:se.id,oldPolygonTop:[...M.current],newPolygonTop:se.polygonTop??Gp,undo(){USe(this.id,this.oldPolygonTop)},redo(){USe(this.id,this.newPolygonTop)}};u(ne)},$=se=>se.roofType===Go.Gable?!1:Math.abs(se.rise)<.001,Q=se=>{if(y.current&&$(y.current))return v.current;if(se!=null){const fe=Tn.getState().getRoofSegmentVertices(e);if(!fe)return;const ge=se===-1?fe.length-1:se;return fe[ge]}},le=(se,ne,fe,ge,de)=>{const[Z,he]=[ne/2,fe/2],xe=new nn().fromArray([ge[0],ge[1],ge[2],"ZXY"]),He=[];for(let Se=-1;Se<=1;Se+=2)for(let ze=-1;ze<=1;ze+=2){const Ie=new ie(Se*Z,Se*ze*he).applyEuler(xe).add(se);He.push(Ie)}if(de){const[Se,ze]=de,Ie=new ie(Se*Z*2,ze+he).applyEuler(xe).add(se);He.push(Ie)}for(const Se of T.current){for(const ze of He)if(me.isPointInside(ze.x,ze.y,Se))return!1;for(const ze of Se)if(me.isPointInside(ze.x,ze.y,He))return!1}return!0},q=(se,ne,fe,ge,de,Z)=>{if(Z){const[he,xe]=Z;return $Zt(ne,fe,ge,he,xe,de,se)}else return F$e(ne,fe,ge,de,se)},te=se=>{if(!f||d)return;const ne=se.object.name;switch(ne){case Ho.Mid:break;case vt.LowerLeft:{P.current=U(se,o,r);break}case vt.LowerRight:{P.current=U(se,-o,r);break}case vt.UpperLeft:{P.current=U(se,o,-r);break}case vt.UpperRight:{P.current=U(se,-o,-r);break}case vt.Arch:{P.current=U(se,0,-r);break}case vt.Upper:break;default:return}O(ne),E(!0),Fn.getState().setEnableOrbitController(!1)},re=se=>{if(p.current===null||!g.current||!y.current||!w.current||!b.current||!v.current)return;const ne=g.current;if(p.current===Ho.Mid){const fe=y.current,ge=QZt(se,t,e),de=new ie;if($(fe)){const Z=Vz(se);if(!Z)return;de.copy(Z);const he=J7(de,ne);F(xe=>{if(!v.current)return;const He=xe.elements.find(Ae=>Ae.id===t&&Ae.type===z.Window);if(!He)return;const{lx:Se,lz:ze,rotation:Ie}=He,ye=v.current,ce=Kie(He),pe=q(ye,he,Se,ze,Ie,ce),ve=le(he,Se,ze,Ie,ce);pe&&ve&&(He.cx=he.x,He.cy=he.y,He.cz=he.z)})}else{if(ge&&ge.segmentIdx!==C.current){const ze=ge.pointer;de.copy(ze)}else{const ze=Vz(se);if(!ze)return;de.copy(ze)}const Z=J7(de,ne),he=Z.clone().sub(b.current),{rotation:xe,segmentVertices:He,segmentIdx:Se}=Cn.computeState(w.current,he);He?Z.setZ(Cn.getRooftopElementZ(He,he,b.current.z+fe.thickness)):Z.setZ(b.current.z+fe.thickness),F(ze=>{const Ie=Tn.getState().getRoofSegmentVertices(e);if(!Ie)return;const ye=Se===-1?Ie.length-1:Se,ce=Ie[ye];if(!ce)return;const pe=ze.elements.find(Ee=>Ee.id===t&&Ee.type===z.Window);if(!pe)return;const{lx:ve,lz:Ae}=pe,Te=Kie(pe),Me=q(ce,Z,ve,Ae,xe,Te),Pe=le(Z,ve,Ae,xe,Te);Me&&Pe&&(pe.cx=Z.x,pe.cy=Z.y,pe.cz=Z.z,pe.rotation=[...xe],ge&&ge.segmentIdx!==C.current&&(C.current=ge.segmentIdx))})}}else if(LSe(p.current)){const fe=Q(C.current),ge=Vz(se),de=P.current;if(!ge||!de||!fe)return;const Z=J7(ge,ne),he=J7(de,ne),{newLx:xe,newLz:He,newCenter:Se}=ZZt(he,Z,a[2]);H.getState().set(ze=>{const Ie=ze.elements.find(ve=>ve.id===t&&ve.type===z.Window);if(!Ie)return;const ye=Kie(Ie),ce=q(fe,Se,xe,He,a,ye),pe=le(Se,xe,He,a,ye);ce&&pe&&(Ie.cx=Se.x,Ie.cy=Se.y,Ie.cz=Se.z,Ie.lx=xe,Ie.lz=Math.max(.001,He))})}else if(p.current===vt.Upper){const fe=Q(C.current),ge=Vz(se);if(!ge||!fe)return;const de=J7(ge,ne);F(Z=>{const he=Z.elements.find(De=>De.id===t);if(!he)return;const[xe,He]=[he.lx/2,he.lz/2],Se=new ie(he.cx,he.cy,he.cz),ze=new nn().fromArray([he.rotation[0],he.rotation[1],he.rotation[2],"ZXY"]),Ie=new ie(-xe,-He,0).applyEuler(ze).add(Se),ye=new ie(xe,-He,0).applyEuler(ze).add(Se),ce=new ie().subVectors(de,Ie),pe=new ie().subVectors(ye,Ie).normalize(),ve=ce.clone().projectOnVector(pe).applyEuler(new nn(0,0,-he.rotation[2])),Ae=me.clamp((ve.x-xe)/he.lx,-.5,.5),Te=Cn.getDistance(Ie,ye,de),Me=Math.hypot(Te,de.z-Ie.z),Pe=Math.max(0,Me-he.lz),Ee=[Ae,Pe],Be=new ie(he.cx,he.cy,he.cz),{lx:Je,lz:We}=he,Ke=q(fe,Be,Je,We,a,Ee),Ne=le(Be,Je,We,a,Ee);Ke&&Ne&&(he.polygonTop=[...Ee])})}else if(p.current===vt.Arch){const fe=Vz(se),ge=P.current,de=Q(C.current);if(!fe||!ge||!de)return;const Z=J7(fe,ne),he=J7(ge,ne);F(xe=>{const He=xe.elements.find(Pe=>Pe.id===t&&Pe.type===z.Window);if(!He)return;const[Se,ze]=[He.lx/2,He.lz/2],Ie=new ie(He.cx,He.cy,He.cz),ye=new nn().fromArray([He.rotation[0],He.rotation[1],He.rotation[2],"ZXY"]),ce=new ie(-Se,-ze,0).applyEuler(ye).add(Ie),pe=new ie(Se,-ze,0).applyEuler(ye).add(Ie),ve=Cn.getDistance(ce,pe,Z);let Ae=Math.hypot(ve,Z.z-ce.z);const Te=Math.min(He.archHeight,He.lz,He.lx/2),Me=He.lz-Te;if(Ae>Me&&Ae{p.current===Ho.Mid?B():LSe(p.current)?_():p.current===vt.Upper?X():p.current===vt.Arch&&_(),A.current=null,S.current=null,x.current=null,R.current=null,M.current=null,p.current=null,g.current=null,y.current=null,w.current=null,b.current=null,C.current=null,P.current=null,v.current=null,T.current=[],E(!1),Fn.getState().setEnableOrbitController(!0)};return h.jsxs(h.Fragment,{children:[h.jsxs("group",{name:"Handle Wrapper",onPointerDown:te,children:[!d&&h.jsxs(h.Fragment,{children:[l===Ti.Polygonal&&h.jsx(wv,{x:N,z:j+k,handleType:vt.Upper,scale:[.5,1,1.5]}),h.jsx(wv,{x:-W,z:j,handleType:vt.UpperLeft}),h.jsx(wv,{x:W,z:j,handleType:vt.UpperRight}),h.jsx(wv,{x:-W,z:-j,handleType:vt.LowerLeft}),h.jsx(wv,{x:W,z:-j,handleType:vt.LowerRight}),l===Ti.Arched&&h.jsx(k$e,{z:j})]}),h.jsx(yxt,{handleType:Ho.Mid})]}),f&&D&&h.jsx(ua,{name:_ye,args:[1e3,1e3],rotation:[Gt,0,0],onPointerMove:re,onPointerUp:ae,visible:!1,children:h.jsx("meshBasicMaterial",{color:"red",side:$r,transparent:!0,opacity:.5})})]})},oen=be.memo(nen),ren=new mf({color:"white",side:$r}),ien=be.memo(({dimension:t,mullionData:e,shadowEnabled:n})=>{const[o,r,i]=t,{width:a,horizontalMullionSpacing:l,verticalMullionSpacing:s,color:c}=e,u=3,d=1,f=a/2,p=m.useMemo(()=>h.jsx("meshStandardMaterial",{color:c}),[c]),g=m.useMemo(()=>{const w=[],b=Math.round(o/s)-1;if(b<=0||a===0)return w;const C=o/(b+1);let P=C/2;b%2!==0&&(w.push(0),P=C);for(let v=0;v{const w=[],b=Math.round(i/l)-1;if(b<=0||a===0)return w;const C=i/(b+1);let P=C/2;b%2!==0&&(w.push(0),P=C);for(let v=0;vh.jsx(ca,{position:[w,25e-5,0],args:[f,f,i,u,d],rotation:[Gt,Gt,0],receiveShadow:n,castShadow:n,children:p},b)),e.horizontalMullion&&y.map((w,b)=>h.jsx(ca,{position:[0,5e-4,w],args:[f,f,o,u,d],rotation:[0,0,Gt],receiveShadow:n,castShadow:n,children:p},b))]})}),aen=be.memo(({dimension:t,frameData:e,shadowEnabled:n})=>{const[o,r,i]=t,{color:a,width:l,sillWidth:s}=e,c=m.useMemo(()=>h.jsx("meshStandardMaterial",{color:a}),[a]),u=l/2,d=u/2,f=o+l*3,p=l;return h.jsxs("group",{name:"Window Frame Group",position:[0,-d/2,0],children:[h.jsx(Qr,{position:[0,0,i/2],args:[o+2*l,d,l],castShadow:n,receiveShadow:n,children:c}),h.jsx(Qr,{position:[-o/2-u,0,0],args:[l,d,i],castShadow:n,receiveShadow:n,children:c}),h.jsx(Qr,{position:[o/2+u,0,0],args:[l,d,i],castShadow:n,receiveShadow:n,children:c}),h.jsx(Qr,{position:[0,0,-i/2-(s===0?0:p/2)],args:s===0?[o+2*l,d,l]:[f,s??l,p],castShadow:n,receiveShadow:n,children:c})]})}),len=be.memo(({cy:t,dimension:e,wireframeData:n})=>{const[o,r,i]=e,{lineWidth:a,lineColor:l,selected:s,locked:c,opacity:u}=n,d=o/2,f=i/2,p=3,g=1,y=m.useMemo(()=>new mf({color:l}),[l]),w=m.useMemo(()=>new mf({color:y0}),[]),b=(C,P)=>{const v=C/2;return h.jsxs(h.Fragment,{children:[h.jsx(ca,{args:[C,C,o,p,g],rotation:[0,0,Gt],position:[0,0,f-v],material:P}),h.jsx(ca,{args:[C,C,o,p,g],rotation:[0,0,Gt],position:[0,0,-f+v],material:P}),h.jsx(ca,{args:[C,C,i,p,g],rotation:[Gt,Gt,0],position:[d-v,0,0],material:P}),h.jsx(ca,{args:[C,C,i,p,g],rotation:[Gt,Gt,0],position:[-d+v,0,0],material:P})]})};return h.jsxs("group",{name:"Window Wireframe Group",children:[u>0&&h.jsx("group",{position:[0,t,0],children:b(a/20,y)}),c&&s&&b(a/5,w)]})}),sen=({id:t,dimension:e,position:n,mullionData:o,frameData:r,wireframeData:i,leftShutter:a,rightShutter:l,shutterColor:s,shutterWidth:c,glassMaterial:u,showHeatFluxes:d,area:f,empty:p,interior:g,foundation:y})=>{const w=H.getState().world,b=H(e5),C=H(i3),P=H(a3),v=H(Ds),T=Tn(Tb),A=m.useRef(0),x=m.useRef(),[S,R,M]=e,[D,E,W]=n,j=m.useMemo(()=>{if(!d||g||y&&y.notBuilding)return;const F=T.get(t);if(!F)return;const U=F.reduce((q,te)=>q+te,0);if(f===0)return;const O=r3*(w.solarRadiationHeatmapGridCellSize??.5),B=Math.max(2,Math.round(S/O)),_=Math.max(2,Math.round(M/O)),X=S/B,$=M/_,Q=U/f*(b??Qm);A.current=Q<0?1:0,x.current=me.getEuler(Io,Oc,"YXZ",Math.sign(Q)*Gt);const le=[];if(Q<0)for(let q=0;qc*S,[S,c]),k=m.useMemo(()=>(L+r.width+S)/2*1.025,[S,L,r.width]),N=(F,U,O)=>h.jsx(ua,{name:"Window Seal Plane",args:F,position:U,rotation:O,material:ren,receiveShadow:v,castShadow:v});return h.jsxs(h.Fragment,{children:[!p&&h.jsxs("group",{name:"Rectangle Window Plane Group",position:[0,E,0],children:[h.jsx(ua,{name:"Window Glass Plane",args:[S,M],rotation:[Gt,0,0],children:u}),(o.horizontalMullion||o.verticalMullion)&&h.jsx(ien,{dimension:e,mullionData:o,shadowEnabled:v})]}),r.showFrame&&h.jsx(aen,{dimension:e,frameData:r,shadowEnabled:v}),h.jsx(Gye,{cx:k,lx:L,lz:M,color:s,showLeft:a,showRight:l,spacing:r.showFrame?r.width/2:0}),h.jsx(len,{cy:E,dimension:e,wireframeData:i}),N([R,M],[-S/2+.001,R/2,0],[Gt,Gt,0]),N([R,M],[S/2-1e-4,R/2,0],[Gt,-Gt,0]),N([S,R],[0,R/2,M/2-.001],[Math.PI,0,0]),N([S,R],[0,R/2,-M/2+.001]),j&&j.map((F,U)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:F,name:"Heat Flux "+U,lineWidth:P??Zm,color:C??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:F[A.current].clone().add(new ie(0,A.current===0?-.1:.1,0)),args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:x.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:C??g0})})]},U))]})},cen=be.memo(sen),Vye=({element:t})=>{const e=H(s0),n=H(d1),o=H(ly),r=t.lx/2,i=t.lz/2,a=.05,l=1,s=.5,c=t.lineColor??"white",u="darkorchid",d=Math.max(.25,(r+i)/32),f=.25,p=30,g=-.1,y=m.useMemo(()=>({lng:e}),[e]),w=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:u,text:t.lz.toFixed(1)+Y.t("word.MeterAbbreviation",y),fontSize:p,fontFace:"Times Roman",textHeight:d,position:[-r-f,g,0]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r-f,0,-i],[-r-f,0,i]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r-f+a,0,-i+3*a],[-r-f,0,-i],[-r-f-a,0,-i+3*a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r-f+a,0,i-3*a],[-r-f,0,i],[-r-f-a,0,i-3*a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r,0,-i],[-r-f*2,0,-i]],color:c,linewidth:s}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r,0,i],[-r-f*2,0,i]],color:c,linewidth:s})]}),[r,i,y]),b=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:u,text:t.lz.toFixed(1)+Y.t("word.MeterAbbreviation",y),fontSize:p,fontFace:"Times Roman",textHeight:d,position:[r+f,g,0]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r+f,0,-i],[r+f,0,i]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r+f+a,0,-i+3*a],[r+f,0,-i],[r+f-a,0,-i+3*a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r+f+a,0,i-3*a],[r+f,0,i],[r+f-a,0,i-3*a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r,0,-i],[r+f*2,0,-i]],color:c,linewidth:s}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r,0,i],[r+f*2,0,i]],color:c,linewidth:s})]}),[r,i,y]),C=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:u,text:t.lx.toFixed(1)+Y.t("word.MeterAbbreviation",y),fontSize:p,fontFace:"Times Roman",textHeight:d,position:[0,g,-i-f]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r,0,-i-f],[r,0,-i-f]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r+3*a,0,-i-f-a],[-r,0,-i-f],[-r+3*a,0,-i-f+a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r-3*a,0,-i-f-a],[r,0,-i-f],[r-3*a,0,-i-f+a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r,0,-i],[-r,0,-i-f*2]],color:c,linewidth:s}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r,0,-i],[r,0,-i-f*2]],color:c,linewidth:s})]}),[r,i,y]),P=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:u,text:t.lx.toFixed(1)+Y.t("word.MeterAbbreviation",y),fontSize:p,fontFace:"Times Roman",textHeight:d,position:[0,g,i+f]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r,0,i+f],[r,0,i+f]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r+3*a,0,i+f-a],[-r,0,i+f],[-r+3*a,0,i+f+a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r-3*a,0,i+f-a],[r,0,i+f],[r-3*a,0,i+f+a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r,0,i],[-r,0,i+f*2]],color:c,linewidth:s}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r,0,i],[r,0,i+f*2]],color:c,linewidth:s})]}),[r,i,y]);if(n)switch(n){case vt.LowerLeft:return h.jsxs(h.Fragment,{children:[w,C]});case vt.LowerRight:return h.jsxs(h.Fragment,{children:[b,C]});case vt.UpperLeft:return h.jsxs(h.Fragment,{children:[w,P]});case vt.UpperRight:return h.jsxs(h.Fragment,{children:[b,P]})}if(o)switch(o){case vt.LowerLeft:return h.jsxs(h.Fragment,{children:[w,C]});case vt.LowerRight:return h.jsxs(h.Fragment,{children:[b,C]});case vt.UpperLeft:return h.jsxs(h.Fragment,{children:[w,P]});case vt.UpperRight:return h.jsxs(h.Fragment,{children:[b,P]})}return h.jsx(h.Fragment,{})};be.memo(Vye);const Gye=({cx:t,cz:e=0,lx:n,lz:o,color:r,showLeft:i,showRight:a,spacing:l})=>{const s=H(Ds),c=ht(Ss),u=ht(h3);return c||u?null:h.jsxs("group",{name:"Shutter Group",children:[a&&h.jsx(Qr,{args:[n,.1,o],position:[t+l,0,e],castShadow:s,receiveShadow:s,children:h.jsx("meshStandardMaterial",{color:r})}),i&&h.jsx(Qr,{args:[n,.1,o],position:[-t-l,0,e],castShadow:s,receiveShadow:s,children:h.jsx("meshStandardMaterial",{color:r})})]})},ade="Window Group",Gp=[0,.5],uen=t=>{const{id:e,parentId:n,foundationId:o,cx:r,cy:i,cz:a,lx:l,ly:s,lz:c,rotation:u,locked:d,lineWidth:f=.2,lineColor:p="black",horizontalMullion:g=!0,verticalMullion:y=!0,mullionWidth:w=.06,horizontalMullionSpacing:b=.5,verticalMullionSpacing:C=.5,tint:P="#73D8FF",opacity:v=.5,leftShutter:T=!1,rightShutter:A=!1,shutterColor:x="gray",shutterWidth:S=.5,mullionColor:R="white",frame:M=!1,color:D="white",frameWidth:E=.1,sillWidth:W=.1,windowType:j=Ti.Default,archHeight:L,parentType:k=z.Wall,polygonTop:N=Gp}=t,F=`${ade} ${e}`,U=H(fn),O=H(pA),B=ht(xh),_=H(gBe),X=Es(e),$=(Se=!1)=>{U(ze=>{if(ze.contextMenuObjectType=null,ze.groupActionMode)ze.multiSelectionsMode||ze.selectedElementIdSet.clear(),t.foundationId&&(ze.selectedElementIdSet.has(n)?ze.selectedElementIdSet.delete(n):ze.selectedElementIdSet.add(t.foundationId));else for(const Ie of ze.elements)if(Ie.id===e)if(Ie.selected=!0,ze.selectedElement=Ie,Se)if(ze.selectedElementIdSet.has(e))for(const ye of ze.elements)ze.selectedElementIdSet.has(ye.id)&&ye.type!==ze.selectedElement.type&&ze.selectedElementIdSet.delete(ye.id);else if(ze.multiSelectionsMode){ze.selectedElementIdSet.add(e);for(const ye of ze.elements)ze.selectedElementIdSet.has(ye.id)&&ye.type!==ze.selectedElement.type&&ze.selectedElementIdSet.delete(ye.id)}else ze.selectedElementIdSet.clear(),ze.selectedElementIdSet.add(e);else ze.multiSelectionsMode?ze.selectedElementIdSet.has(e)?ze.selectedElementIdSet.delete(e):ze.selectedElementIdSet.add(e):(ze.selectedElementIdSet.clear(),ze.selectedElementIdSet.add(e));else Ie.selected=!1})},Q=Se=>Se.intersections.length>0&&Se.intersections[0].eventObject.name===F&&!H.getState().moveHandleType&&!H.getState().resizeHandleType&&!H.getState().isAddingElement()&&H.getState().objectTypeToAdd===z.None,le=Se=>{if(Se.eventObject.name===F&&Se.intersections.length>0)switch(Se.object.name){case Ho.Mid:case vt.UpperLeft:case vt.UpperRight:case vt.LowerLeft:case vt.LowerRight:case vt.Arch:case vt.Upper:return!0}return!1},q=(Se,ze)=>{Fn.getState().setEnableOrbitController(!1),B("showWallIntersectionPlaneId",n),U(Ie=>{Ie.resizeHandleType=Se,Ie.resizeAnchor.copy(new ie(r,0,a).add(ze))})},te=Se=>{if(!(Se.button===2||H.getState().addedWallId)&&(Q(Se)&&$(),le(Se))){const ze=Se.intersections[0].eventObject.name;switch(ze){case Ho.Mid:{Fn.getState().setEnableOrbitController(!1),ht.getState().set(Ie=>{Ie.showWallIntersectionPlaneId=n,Ie.oldParentId=n,Ie.oldFoundationId=o}),U(Ie=>{Ie.moveHandleType=ze,Ie.selectedElement=Ie.elements.find(ye=>{var ce;return ye.id===((ce=Ie.selectedElement)==null?void 0:ce.id)})});break}case vt.UpperLeft:{q(ze,new ie(l/2,0,-c/2));break}case vt.UpperRight:{q(ze,new ie(-l/2,0,-c/2));break}case vt.LowerLeft:{q(ze,new ie(l/2,0,c/2));break}case vt.LowerRight:{q(ze,new ie(-l/2,0,c/2));break}case vt.Arch:{q(ze,new ie(0,0,0));break}case vt.Upper:{q(ze,new ie(0,0,c/2));break}}}},re=Se=>{H.getState().addedWallId||Q(Se)&&($(!0),U(ze=>{ze.contextMenuObjectType=z.Window}))},ae=m.useMemo(()=>{if(k===z.Roof){const[Se,ze,Ie]=u;return new nn().fromArray([Se-Gt,ze,Ie,"ZXY"])}else return new nn},[k,u]),se=m.useMemo(()=>h.jsx("meshPhongMaterial",{specular:new rr("white"),shininess:_??fG,color:P,side:$r,opacity:v,transparent:!0}),[_,P,v]),ne=m.useMemo(()=>L!==void 0?[l,s,c,L]:[l,s,c],[l,s,c,L]),fe=m.useMemo(()=>k===z.Roof?[r,.05,a]:[r,i,a],[r,i,a,k]),ge=m.useMemo(()=>({horizontalMullion:g,verticalMullion:y,width:w,horizontalMullionSpacing:b,verticalMullionSpacing:C,color:R}),[g,y,w,b,C,R]),de=m.useMemo(()=>({showFrame:M,width:E,color:D,sillWidth:W}),[M,E,D,W]),Z=m.useMemo(()=>({lineColor:p,lineWidth:f,selected:X,locked:d,opacity:v}),[p,f,X,d,v]),he=ht(h3),xe=()=>{switch(j){case Ti.Default:return h.jsx(cen,{id:t.id,dimension:ne,position:fe,mullionData:ge,frameData:de,wireframeData:Z,leftShutter:T,rightShutter:A,shutterColor:x,shutterWidth:S,glassMaterial:se,showHeatFluxes:he,area:me.getWindowArea(t),empty:!!t.empty,interior:!!t.interior,foundation:O(t)});case Ti.Arched:return h.jsx(zxt,{id:t.id,dimension:ne,position:fe,mullionData:ge,frameData:de,wireframeData:Z,leftShutter:T,rightShutter:A,shutterColor:x,shutterWidth:S,glassMaterial:se,showHeatFluxes:he,area:me.getWindowArea(t),empty:!!t.empty,interior:!!t.interior,foundation:O(t)});case Ti.Polygonal:return h.jsx(Nxt,{id:t.id,dimension:ne,polygonTop:N,position:fe,glassMaterial:se,empty:!!t.empty,interior:!!t.interior,wireframeData:Z,frameData:de,leftShutter:T,rightShutter:A,shutterColor:x,shutterWidth:S,showHeatFluxes:he,area:me.getWindowArea(t),foundation:O(t)})}},He=k===z.Roof?i:0;return h.jsxs("group",{name:F,position:[r,He,a],rotation:ae,onPointerDown:te,onContextMenu:re,onPointerMove:()=>{},children:[xe(),X&&h.jsx(Vye,{element:t}),X&&!d&&h.jsx(oen,{id:e,parentId:n,foundationId:o,lx:l,lz:c,polygonTop:N,rotation:u,windowType:j,parentType:k})]},e)},L$e=be.memo(uen),den=be.memo(({lineColor:t="black",lineWidth:e=.2,hx:n,hz:o,fill:r,isTopPartial:i,leftUnfilledHeight:a,rightUnfilledHeight:l,showParapet:s=!1,leftHeight:c=2*o,rightHeight:u=2*o,center:d,centerLeft:f,centerRight:p})=>{const g=H(T=>T.viewState.orthographic),y=[-n,-o+.001+(r===El.Partial?a:0),.001],w=[n,-o+.001+(r===El.Partial?l:0),.001],b=[-n,c-o-.001,.001],C=[n,u-o-.001,.001],P=n*2,v=[];if(g)e=2,v.push(b,C);else if(s)v.push(b,y,w,C);else if(i)v.push(y,b,C,w,y);else{if(v.push(y,b),f){const T=[f[0]*P,f[1]-o,.001];v.push(T)}if(d){const T=[d[0]*P,d[1]-o,.001];v.push(T)}if(p){const T=[p[0]*P,p[1]-o,.001];v.push(T)}v.push(C,w)}return h.jsx(be.Fragment,{children:h.jsx(jn,{rotation:[Gt,0,0],points:v,color:t,lineWidth:e})})});var Pd=(t=>(t.Default="Default",t.Arched="Arched",t))(Pd||{});const fen=be.memo(({dimension:t,lineColor:e,lineWidth:n})=>{const[o,r,i]=t.map(u=>u/2),a=[-o,0,i+.05],l=[o,0,i+.05],s=[-o,0,-i],c=[o,0,-i];return h.jsx(jn,{points:[s,a,l,c],lineWidth:n,color:e})}),hen=be.memo(({dimension:t,color:e})=>{const[n,o,r]=t,i=H(Ds),a=m.useMemo(()=>h.jsx("meshStandardMaterial",{color:e}),[e]),l=.1,s=l/2;return h.jsxs("group",{name:"Door frame group",children:[h.jsx(Qr,{position:[0,0,r/2],args:[n,l,l],castShadow:i,receiveShadow:i,children:a}),h.jsx(Qr,{position:[-n/2+s,0,0],args:[l,l,r],castShadow:i,receiveShadow:i,children:a}),h.jsx(Qr,{position:[n/2-s,0,0],args:[l,l,r],castShadow:i,receiveShadow:i,children:a})]})}),pen=be.memo(({id:t,dimension:e,color:n,frameColor:o,selected:r,locked:i,material:a,filled:l,area:s,showHeatFluxes:c,foundation:u})=>{const d=H.getState().world,f=H(e5),p=H(i3),g=H(a3),y=H(Ds),w=Tn(Tb),b=m.useRef(0),C=m.useRef(),[P,v,T]=e,A=m.useMemo(()=>{if(!c||u&&u.notBuilding)return;const S=w.get(t);if(!S)return;const R=S.reduce((N,F)=>N+F,0);if(s===0)return;const M=r3*(d.solarRadiationHeatmapGridCellSize??.5),D=Math.max(2,Math.round(P/M)),E=Math.max(2,Math.round(T/M)),W=P/D,j=T/E,L=R/s*(f??Qm);b.current=L<0?1:0,C.current=me.getEuler(Io,Oc,"YXZ",Math.sign(L)*Gt);const k=[];if(L<0)for(let N=0;N{const S=new Fl,[R,M]=[P/2,T/2],D=Math.max(R,M)*.2;return S.moveTo(-R,-M),S.lineTo(-R,M),S.lineTo(R,M),S.lineTo(R,-M),l||(S.lineTo(R-D,-M),S.lineTo(R-D,M-D),S.lineTo(-R+D,M-D),S.lineTo(-R+D,-M)),S.closePath(),S},[P,T,l]);return h.jsxs("group",{name:"Rectangle door group",position:[0,-.01,0],children:[h.jsx("mesh",{name:"Rectangular Door Mesh",rotation:[Gt,0,0],material:a,castShadow:y&&l,receiveShadow:y&&l,children:h.jsx("shapeGeometry",{args:[x]})}),l&&h.jsxs("mesh",{name:"Rectangular Door Simulation Mesh",rotation:[Gt,0,0],uuid:t,userData:{simulation:!0},castShadow:!1,receiveShadow:!1,visible:!1,children:[h.jsx("shapeGeometry",{args:[x]}),h.jsx("meshBasicMaterial",{side:$r})]}),l&&h.jsx("mesh",{name:"Door plane inside",position:[0,.1,0],rotation:[-Gt,0,Math.PI],material:a,castShadow:y&&l,receiveShadow:y&&l,children:h.jsx("shapeGeometry",{args:[x]})}),h.jsx(fen,{dimension:e,lineColor:r&&i?y0:"black",lineWidth:r&&i?2:.2}),h.jsx(hen,{dimension:e,color:o}),A&&A.map((S,R)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:S,name:"Heat Flux "+R,lineWidth:g??Zm,color:p??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:S[b.current].clone().add(new ie(0,b.current===0?-.1:.1,0)),args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:C.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:p??g0})})]},R))]})}),gen=be.memo(({id:t,dimension:e,color:n,frameColor:o,selected:r,locked:i,material:a,filled:l,showHeatFluxes:s,area:c,foundation:u})=>{const d=H.getState().world,f=H(Ds),p=H(e5),g=H(i3),y=H(a3),w=Tn(Tb),b=m.useRef(0),C=m.useRef(),[P,v,T,A]=e,x=(D,E)=>{if(A>0){const W=.5*P,j=.5*T,L=Math.min(A,T,W),k=.5*(L+W*W/L);if(Math.abs(D)-j)return!0;const N=E-(T-k-j);return D*D+N*N{if(!s||u&&u.notBuilding)return;const D=w.get(t);if(!D)return;const E=D.reduce((O,B)=>O+B,0);if(c===0)return;const W=r3*(d.solarRadiationHeatmapGridCellSize??.5),j=Math.max(2,Math.round(P/W)),L=Math.max(2,Math.round(T/W)),k=P/j,N=T/L,F=E/c*(p??Qm);b.current=F<0?1:0,C.current=me.getEuler(Io,Oc,"YXZ",Math.sign(F)*Gt);const U=[];if(F<0)for(let O=0;O{const D=new Fl,E=P/2,W=T/2,j=Math.min(A,T,E);if(D.moveTo(E,-W),D.lineTo(E,W-j),j>.1){const L=j/2+P**2/(8*j),[k,N]=[0,W-L],F=Math.acos(Math.min(E/L,1)),U=Math.PI-F;D.absarc(k,N,L,F,U,!1)}else D.lineTo(-E,W);if(D.lineTo(-E,-W),!l){const L=P*.4,k=T*.4,N=Math.min(A*.8,T*.8,E*.8);if(D.lineTo(-L,-W),N>.1){D.lineTo(-L,W-N);const F=N/2+(P*.8)**2/(8*N),[U,O]=[0,k-F],B=Math.acos(Math.min(L/F,1)),_=Math.PI-B;D.absarc(U,O,F,_,B,!0)}else D.lineTo(-L,k),D.lineTo(L,k);D.lineTo(L,-W)}return D.closePath(),D},[P,T,A,l]),M=m.useMemo(()=>({lineColor:"black",lineWidth:i&&r?.2:.1,opacity:1,selected:r,locked:i}),[r,i]);return h.jsxs("group",{name:"Arched door group",children:[h.jsx("mesh",{name:"Arched Door Mesh",rotation:[Gt,0,0],material:a,castShadow:f&&l,receiveShadow:f&&l,children:h.jsx("shapeGeometry",{args:[R]})}),l&&h.jsxs("mesh",{name:"Arched Door Simulation Mesh",rotation:[Gt,0,0],material:a,uuid:t,userData:{simulation:!0},castShadow:!1,receiveShadow:!1,visible:!1,children:[h.jsx("shapeGeometry",{args:[R]}),h.jsx("meshBasicMaterial",{side:$r})]}),l&&h.jsx("mesh",{name:"Door plane mesh inside",position:[0,.1,0],rotation:[-Gt,0,Math.PI],material:a,castShadow:f&&l,receiveShadow:f&&l,children:h.jsx("shapeGeometry",{args:[R]})}),h.jsx(Kce,{cy:0,dimension:e,wireframeData:M}),h.jsx(Kce,{cy:v,dimension:e,wireframeData:M}),S&&S.map((D,E)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:D,name:"Heat Flux "+E,lineWidth:y??Zm,color:g??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:D[b.current].clone().add(new ie(0,b.current===0?-.1:.1,0)),args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:C.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:g??g0})})]},E))]})}),W$e="/aladdin/assets/door_edge-Dxz9LnYZ.png",N$e="/aladdin/assets/door_01-Bl1yYWKp.png",lde="/aladdin/assets/door_02-eLAy3erM.png",U$e="/aladdin/assets/door_03-CX-eEQtv.png",j$e="/aladdin/assets/door_04-Bk3Xe_KE.png",B$e="/aladdin/assets/door_05-15BnnbHK.png",Y$e="/aladdin/assets/door_06-B08sjms-.png",O$e="/aladdin/assets/door_07-BVyEwygm.png",_$e="/aladdin/assets/door_08-Cd1Vc7FQ.png",V$e="/aladdin/assets/door_09-DQcA4jCn.png",G$e="/aladdin/assets/door_10-DVLJsY3W.png",X$e="/aladdin/assets/door_11-dOCMnkGG.png",J$e="/aladdin/assets/door_12-7f2iD2B7.png",K$e="/aladdin/assets/door_13-IsPl-xmI.png",q$e="/aladdin/assets/door_14-CljRO-fX.png",$$e="/aladdin/assets/door_15-CoUc1lfF.png",Q$e="/aladdin/assets/door_16-Dlbc5tIF.png",Z$e="/aladdin/assets/door_17-CHob_UgA.png",men=(t,e,n,o)=>{const r=m.useMemo(()=>{let s;switch(t){case sr.Default:s=W$e;break;case sr.NoTexture:s=ig;break;case sr.Texture01:s=N$e;break;case sr.Texture02:s=lde;break;case sr.Texture03:s=U$e;break;case sr.Texture04:s=j$e;break;case sr.Texture05:s=B$e;break;case sr.Texture06:s=Y$e;break;case sr.Texture07:s=O$e;break;case sr.Texture08:s=_$e;break;case sr.Texture09:s=V$e;break;case sr.Texture10:s=G$e;break;case sr.Texture11:s=X$e;break;case sr.Texture12:s=J$e;break;case sr.Texture13:s=K$e;break;case sr.Texture14:s=q$e;break;case sr.Texture15:s=$$e;break;case sr.Texture16:s=Q$e;break;case sr.Texture17:s=Z$e;break;default:s=lde}return new df().load(s,c=>{n!==void 0&&o!==void 0&&(c.offset.set(.5,.5),c.repeat.set(1/n,1/o)),a(c),l()})},[t,e,n,o]),[i,a]=m.useState(r),{invalidate:l}=oi();return i},yen=new mf({color:"white",side:Ra}),Aen=be.memo(({dimension:t,doorType:e})=>{const[n,o,r]=t.map(a=>a/2);return n===0&&r===0?null:h.jsxs("group",{name:"Door handle wrapper",children:[h.jsx(wv,{x:-n,z:r,handleType:vt.UpperLeft}),h.jsx(wv,{x:n,z:r,handleType:vt.UpperRight}),e===Pd.Arched&&h.jsx(k$e,{z:r})]})}),wen=be.memo(({dimension:t})=>{const e=H(Ds),[n,o,r]=t,[i,a,l]=t.map(c=>c/2),s=(c,u,d)=>h.jsx(ua,{name:"Door seal plane",args:c,position:u,rotation:d,material:yen,receiveShadow:e});return h.jsxs("group",{name:"Door seal planes group",children:[s([o,r],[-i,a,0],[Gt,Gt,0]),s([o,r],[i,a,0],[Gt,-Gt,0]),s([n,o],[0,a,l],[Math.PI,0,0])]})}),ven=t=>{const{id:e,parentId:n,cx:o,cy:r,cz:i,lx:a,ly:l,lz:s,textureType:c,locked:u=!1,color:d="white",doorType:f=Pd.Default,archHeight:p=1,filled:g=!0,opacity:y=1,frameColor:w="white"}=t,b=`Door Group ${e}`,C=H(fn),P=ht(xh),v=H(gBe),T=Es(e),A=m.useRef(!1);m.useEffect(()=>{const $=()=>{A.current=!1};return window.addEventListener("pointerup",$),()=>window.removeEventListener("pointerup",$)},[]);const x=($=!1)=>{C(Q=>{if(Q.groupActionMode)Q.multiSelectionsMode||Q.selectedElementIdSet.clear(),t.foundationId&&(Q.selectedElementIdSet.has(n)?Q.selectedElementIdSet.delete(n):Q.selectedElementIdSet.add(t.foundationId));else for(const le of Q.elements)if(le.id===e)if(le.selected=!0,Q.selectedElement=le,$)if(Q.selectedElementIdSet.has(e))for(const q of Q.elements)Q.selectedElementIdSet.has(q.id)&&q.type!==Q.selectedElement.type&&Q.selectedElementIdSet.delete(q.id);else if(Q.multiSelectionsMode){Q.selectedElementIdSet.add(e);for(const q of Q.elements)Q.selectedElementIdSet.has(q.id)&&q.type!==Q.selectedElement.type&&Q.selectedElementIdSet.delete(q.id)}else Q.selectedElementIdSet.clear(),Q.selectedElementIdSet.add(e);else Q.multiSelectionsMode?Q.selectedElementIdSet.has(e)?Q.selectedElementIdSet.delete(e):Q.selectedElementIdSet.add(e):(Q.selectedElementIdSet.clear(),Q.selectedElementIdSet.add(e));else le.selected=!1})},S=$=>$.intersections.length>0&&$.intersections[0].eventObject.name===b&&!H.getState().moveHandleType&&!H.getState().resizeHandleType&&!H.getState().isAddingElement()&&H.getState().objectTypeToAdd===z.None,R=$=>{if($.eventObject.name===b&&$.intersections.length>0)switch($.object.name){case vt.UpperLeft:case vt.UpperRight:case vt.Arch:return!0}return!1},M=($,Q)=>{Fn.getState().setEnableOrbitController(!1),P("showWallIntersectionPlaneId",n),C(le=>{le.resizeHandleType=$,le.resizeAnchor.copy(new ie(o,0,i).add(Q))})},D=$=>{H.getState().addedWallId||S($)&&(x(!0),C(Q=>{Q.contextMenuObjectType=z.Door}))},E=$=>{if(!(A.current||$.button===2||H.getState().addedWallId)&&(A.current=!0,S($)&&x(),R($))){const Q=$.intersections[0].eventObject.name;switch(Q){case vt.UpperLeft:{M(Q,new ie(a/2,0,-s/2));break}case vt.UpperRight:{M(Q,new ie(-a/2,0,-s/2));break}case vt.Arch:{M(Q,new ie(0,0,0));break}}}},W=H(pA),j=ht(Ss),L=ht(h3),k=H(Cf),N=Tn(u1),[F,U]=m.useState(null),O=()=>{switch(f){case Pd.Default:return h.jsx(pen,{id:e,dimension:_,color:d,frameColor:w,selected:T,locked:u,material:X,filled:g,showHeatFluxes:L,area:me.getDoorArea(t),foundation:W(t)});case Pd.Arched:return h.jsx(gen,{id:e,dimension:_,color:d,frameColor:w,selected:T,locked:u,material:X,filled:g,showHeatFluxes:L,area:me.getDoorArea(t),foundation:W(t)})}};m.useEffect(()=>{if(t&&j){const $=N(t.id);if($){const Q=me.fetchHeatmapTexture($,k??5);Q&&(Q.wrapS=Hs,Q.wrapT=Hs,Q.offset.set(-a/2,-s/2),Q.center.set(a/2,s/2),Q.repeat.set(1/a,1/s),U(Q))}}},[j,k]);const B=men(c,f,a,s),_=m.useMemo(()=>[a,l,s,p],[a,l,s,p]),X=m.useMemo(()=>j&&F&&t.filled?new e3({color:d,map:F,side:Ra}):g?c===sr.Default||c===sr.NoTexture?y<1?new q1e({specular:"white",shininess:v??fG,color:d,side:Ra,opacity:y,transparent:!0}):new mf({map:B,color:d,side:Ra}):new mf({map:B,side:Ra}):new mf({opacity:d===Lce?.5:0,color:d,transparent:!0,side:$r}),[j,F,d,c,B,g,y]);return h.jsxs("group",{name:b,position:[o,0,i],onPointerDown:E,onContextMenu:D,children:[O(),T&&h.jsx(Vye,{element:t}),T&&!u&&h.jsx(Aen,{dimension:_,doorType:f}),h.jsx(wen,{dimension:_})]})},xen=be.memo(ven),ben="/aladdin/assets/polygon_08-BBFzZjDj.png",Sen="/aladdin/assets/polygon_09-B_8KpAt3.png",Ten="/aladdin/assets/polygon_10-CKqrpQre.png",eQe=({id:t,lz:e=.1,filled:n=!1,rotation:o=[0,0,0],normal:r=[0,0,1],color:i="yellow",label:a,text:l,fontSize:s=1,fontColor:c="black",fontOutlineWidth:u=0,fontOutlineColor:d="white",fontStrokeWidth:f=0,fontStrokeColor:p="black",lineStyle:g=Gh.Solid,lineColor:y="black",lineWidth:w=1,locked:b=!1,showLabel:C=!1,parentId:P,foundationId:v,vertices:T,opacity:A=1,noOutline:x=!1,shininess:S=0,selectedIndex:R=-1,textureType:M=Jr.NoTexture})=>{const D=H(fn),E=H(Y0),W=H($q),j=H(Ds),L=Es(t),{gl:{domElement:k}}=oi(),[N,F]=m.useState(!1),[U,O]=m.useState(0),[B,_]=m.useState(0),[X,$]=m.useState(null),Q=m.useRef(null),le=m.useRef(null),q=H(Pe=>{for(const Ee of Pe.elements)if(Ee.id===P)return Ee}),te=new ie,re=new nn;if((q==null?void 0:q.type)===z.Cuboid){const{pos:Pe,rot:Ee}=me.getWorldDataById(q.id);te.copy(Pe),re.set(0,0,Ee)}const ae=q?Math.max(1,Math.max(q.lx,q.ly)/24):1,se=Vx*ae,ne=c1*ae,fe=Jt(),ge=(Pe,Ee)=>{D(Be=>{for(const Je of Be.elements)if(Je.type===z.Polygon&&Je.id===Pe){Je.selectedIndex=Ee;break}})},de=m.useMemo(()=>{const Pe=new Array;if(q){switch(q.type){case z.Foundation:{for(const Be of T)Pe.push({x:Be.x*q.lx,y:Be.y*q.ly});break}case z.Wall:{for(const Be of T)Pe.push({x:Be.x*q.lx,y:Be.y*q.lz});break}case z.Cuboid:{const Be=new ie().fromArray(r);let Je,We;me.isUnitVectorX(Be)?(Je=q.lz,We=q.ly):me.isUnitVectorY(Be)?(Je=q.lx,We=q.lz):(Je=q.lx,We=q.ly);for(const Ke of T)Pe.push({x:Ke.x*Je,y:Ke.y*We});break}}const Ee=me.calculatePolygonCentroid(Pe);O(Ee.x),_(Ee.y)}return Pe},[T,q,r]),he=(()=>{if((q==null?void 0:q.type)===z.Cuboid){const Pe=me.isIdentical(r,rs);return te.z+(q.lz+(Pe?0:e))/2+.01}return(q==null?void 0:q.type)===z.Foundation?q.lz+.01:e/2+.01})(),He=(()=>{if((q==null?void 0:q.type)===z.Wall)return new nn(-Gt,0,Math.PI,"ZXY");const Pe=new ie().fromArray(r);let Ee=o[2];return(q==null?void 0:q.type)===z.Cuboid&&(Ee=re.z),me.isSame(Pe,Op)?new nn(0,Gt,Ee,"ZXY"):me.isSame(Pe,_p)?new nn(0,-Gt,Ee,"ZXY"):me.isSame(Pe,Oc)?new nn(-Gt,0,Ee,"ZXY"):me.isSame(Pe,Vp)?new nn(Gt,0,Ee,"ZXY"):new nn(0,0,Ee,"ZXY")})(),ze=(()=>{if(q){if(q.type===z.Cuboid){const Pe=new ie(te.x,te.y,he),Ee=new ie().fromArray(r);let Be=!1;const Je=new ie;return me.isSame(Ee,Op)?(Be=!0,Je.x=q.lx/2+.01):me.isSame(Ee,_p)?(Be=!0,Je.x=-q.lx/2-.01):me.isSame(Ee,Oc)?(Be=!0,Je.y=q.ly/2+.01):me.isSame(Ee,Vp)&&(Be=!0,Je.y=-q.ly/2-.01),Be&&(Je.applyEuler(re),Pe.x=te.x+Je.x,Pe.y=te.y+Je.y,Pe.z=te.z+Je.z),Pe}else if(q.type===z.Wall)return new ie(0,-.01,0)}return new ie((q==null?void 0:q.cx)??0,(q==null?void 0:q.cy)??0,he)})(),Ie=m.useMemo(()=>{const Pe=new Array;for(const Ee of de)Pe.push(new ie(Ee.x,Ee.y,0));return Pe.push(new ie(de[0].x,de[0].y,0)),Pe},[de]),ye=m.useMemo(()=>{const Pe=new Fl;Pe.moveTo(de[0].x,de[0].y);for(let Ee=1;Ee{Pe.intersections.length>0&&Pe.intersections[0].object===Pe.eventObject&&($(Ee),Ee===Ho.Default?k.style.cursor="move":k.style.cursor="pointer")},[]),pe=m.useCallback(()=>{$(null),k.style.cursor="default"},[]),ve=Pe=>{switch(Pe){case Jr.Texture01:return{x:1,y:1};case Jr.Texture02:return{x:2,y:2};case Jr.Texture03:return{x:.4,y:.4};case Jr.Texture04:return{x:.25,y:.25};case Jr.Texture05:return{x:5,y:5};case Jr.Texture06:return{x:1,y:1};case Jr.Texture07:return{x:1,y:1};case Jr.Texture08:return{x:2,y:2};case Jr.Texture09:return{x:2,y:2};case Jr.Texture10:return{x:4,y:4};default:return{x:1,y:1}}},Ae=m.useMemo(()=>{let Pe;switch(M){case Jr.Texture01:Pe=f$e;break;case Jr.Texture02:Pe=h$e;break;case Jr.Texture03:Pe=p$e;break;case Jr.Texture04:Pe=g$e;break;case Jr.Texture05:Pe=m$e;break;case Jr.Texture06:Pe=y$e;break;case Jr.Texture07:Pe=A$e;break;case Jr.Texture08:Pe=ben;break;case Jr.Texture09:Pe=Sen;break;case Jr.Texture10:Pe=Ten;break;default:Pe=ig}return new df().load(Pe,Ee=>{const Be=ve(M);Ee.wrapT=Ee.wrapS=Hs,Ee.repeat.set(1/Be.x,1/Be.y);const Je=new ie().fromArray(r);me.isSame(Je,Op)?Ee.rotation=Gt:me.isSame(Je,_p)?Ee.rotation=-Gt:me.isSame(Je,Vp)&&(Ee.rotation=Math.PI),Me(Ee)})},[M,r]),[Te,Me]=m.useState(Ae);return h.jsxs("group",{name:"Polygon Group "+t,rotation:He,position:ze,children:[n&&h.jsxs("mesh",{uuid:t,ref:Q,receiveShadow:j,castShadow:!1,name:z.Polygon,onPointerDown:Pe=>{Pe.button!==2&&W===z.None&&E(t,Pe)},onContextMenu:Pe=>{E(t,Pe,Oo.ContextMenu),D(Ee=>{Pe.intersections.length>0&&Pe.intersections[0].object===Q.current&&(Pe.intersections.length>1&&Ee.pastePoint.copy(Pe.intersections[1].point),Ee.contextMenuObjectType=z.Polygon)})},onPointerOver:Pe=>{Pe.intersections.length>0&&Pe.intersections[0].object===Q.current&&F(!0)},onPointerOut:()=>{F(!1),k.style.cursor="default"},children:[h.jsx("shapeGeometry",{attach:"geometry",args:[ye]}),S===void 0||S===0?h.jsx("meshStandardMaterial",{attach:"material",color:M===Jr.NoTexture?i:"white",map:Te,side:$r,transparent:A<1,opacity:A}):h.jsx("meshPhongMaterial",{attach:"material",color:M===Jr.NoTexture?i:"white",map:Te,side:Ra,specular:new rr("white"),shininess:S,transparent:A<1,opacity:A})]}),l&&h.jsx(r4t,{fontSize:s,scale:[1,1,1],color:c,position:[U,B,.01],rotation:[0,0,(q==null?void 0:q.type)===z.Wall?Math.PI:0],anchorX:"center",anchorY:"middle",outlineWidth:u,outlineColor:d,strokeWidth:f,strokeColor:p,children:l}),(!x||b&&L)&&h.jsx(jn,{points:Ie,color:b&&L?y0:y,lineWidth:w,dashed:g&&g!==Gh.Solid,dashSize:g===Gh.Dashed?.3:.1,gapSize:.1,uuid:t,receiveShadow:!1,castShadow:!1,name:"Polygon Wireframe",onPointerDown:Pe=>{Pe.button!==2&&E(t,Pe)},onContextMenu:Pe=>{W===z.None&&(E(t,Pe,Oo.ContextMenu),D(Ee=>{if(Pe.intersections.length>0){const Be=Pe.intersections[0].object;Be.name==="Polygon Wireframe"&&Be.uuid===t&&(Ee.contextMenuObjectType=z.Polygon)}}))}}),!n&&h.jsx(jn,{position:[0,0,.1],points:Ie,visible:!1,lineWidth:Math.min(w*10,10),receiveShadow:!1,castShadow:!1,uuid:t,name:"Polygon Enlarged Line",onPointerDown:Pe=>{Pe.button!==2&&E(t,Pe)},onContextMenu:Pe=>{W===z.None&&(E(t,Pe,Oo.ContextMenu),D(Ee=>{if(Pe.intersections.length>0){const Be=Pe.intersections[0].object;Be.name==="Polygon Enlarged Line"&&Be.uuid===t&&(Ee.contextMenuObjectType=z.Polygon)}}))}}),L&&!b&&h.jsx(ds,{ref:le,position:[U,B,0],args:[ne,6,6],name:Ho.Default,onPointerDown:Pe=>{Pe.button!==2&&(E(t,Pe,Oo.Move),Fn.getState().setEnableOrbitController(!1),ht.getState().set(Ee=>{Ee.showWallIntersectionPlaneId=P,Ee.oldParentId=P,Ee.oldFoundationId=v}),D(Ee=>{Ee.moveHandleType=Ho.Default}))},onPointerOver:Pe=>{ce(Pe,Ho.Default)},onPointerOut:pe,children:h.jsx("meshBasicMaterial",{attach:"material",color:"orange"})}),L&&!b&&de.map((Pe,Ee)=>h.jsxs(be.Fragment,{children:[h.jsx(Qr,{userData:{vertexIndex:Ee},position:[Pe.x,Pe.y,0],name:vt.Default,args:[se,se,e/2+(n?0:.1)],onPointerDown:Be=>{Be.button!==2&&(E(t,Be,Oo.Resize),ge(t,Ee),Fn.getState().setEnableOrbitController(!1),ht.getState().set(Je=>{Je.showWallIntersectionPlaneId=P,Je.oldParentId=P,Je.oldFoundationId=v}),D(Je=>{Je.resizeHandleType=vt.Default}))},onPointerOver:Be=>{ce(Be,vt.Default),ge(t,Ee)},onPointerOut:pe,onContextMenu:Be=>{D(Je=>{if(Be.intersections.length>0){const We=Be.intersections[0].object.userData.vertexIndex;We!==void 0&&(Je.contextMenuObjectType=z.PolygonVertex,ge(t,We))}})},children:h.jsx("meshBasicMaterial",{attach:"material",color:(X===vt.Default||H.getState().resizeHandleType===vt.Default)&&R===Ee?ta:Da})}),h.jsx("textSprite",{name:"Label "+Ee,text:""+Ee,fontSize:20*ae,fontFace:"Times Roman",textHeight:.2*ae,position:[Pe.x,Pe.y,.2*ae]})]},"resize-handle-"+Ee)),(N||C)&&!L&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",text:(a??Y.t("shared.PolygonElement",fe))+(b?" ("+Y.t("shared.ElementLocked",fe)+")":""),fontSize:20*ae,fontFace:"Times Roman",textHeight:.2*ae,position:[0,0,e+.2]})]})},Xye={display:!1,color:"white",textureType:Uo.NoTexture,parapetHeight:1,copingsWidth:.5,copingsHeight:.1},Pen=({args:t,wallData:e,parapetZ:n,currWallPointData:o,leftWallPointData:r,rightWallPointData:i})=>{const{display:a,color:l,textureType:s,parapetHeight:c,copingsWidth:u,copingsHeight:d}=t,{id:f,cx:p,cy:g,hx:y,hy:w,angle:b}=e,C=c-d,P=i$e(s),v=m.useMemo(()=>{const L=new ie(-y,w-u/2),k=new ie(y,w-u/2),N=new ie(y,w+u/2),F=new ie(-y,w+u/2),U=[L,k,N,F];if(i||r){const O=jSe(o);if(i&&gO(o.rightPoint,i.leftPoint)){const B=M(O,i);B&&(k.copy(B.outerIntersection),N.copy(B.innerIntersection))}if(r&&gO(o.leftPoint,r.rightPoint)){const B=M(O,r);B&&(L.copy(B.outerIntersection),F.copy(B.innerIntersection))}}return U},[y,w,u,o,r,i]),T=m.useMemo(()=>{const L=new Fl,k=new ie(-y,w*2),N=new ie(y,w*2);if(i||r){const F=cX(o,o.ly);if(i&&gO(o.rightPoint,i.leftPoint)){const U=D(F,i);U&&N.copy(U)}if(r&&gO(o.leftPoint,r.rightPoint)){const U=D(F,r);U&&k.copy(U)}}return L.moveTo(-y,0),L.lineTo(y,0),L.lineTo(N.x,N.y),L.lineTo(k.x,k.y),L.closePath(),L},[y,w,o,r,i]),A=m.useMemo(()=>{const L=new Fl;if(u===0)return L;const[k,N,F,U]=v;return L.moveTo(k.x,k.y),L.lineTo(N.x,N.y),L.lineTo(F.x,F.y),L.lineTo(U.x,U.y),L.closePath(),L},[u,v]),x=m.useMemo(()=>v.map(L=>L.toArray()),[v]),S=m.useMemo(()=>[new ie(-y,0,0),new ie(y,0,0)],[y]),R=m.useMemo(()=>[new ie,new ie(0,0,C)],[C]);function M(L,k){const N=jSe(k),F=qie(L.outerPoints.leftPoint,L.outerPoints.rightPoint,N.outerPoints.leftPoint,N.outerPoints.rightPoint);if(!F)return null;const U=qie(L.innerPoints.leftPoint,L.innerPoints.rightPoint,N.innerPoints.leftPoint,N.innerPoints.rightPoint);return U?{innerIntersection:new ie().subVectors(U,new ie(p,g)).applyEuler(new nn(0,0,-b)),outerIntersection:new ie().subVectors(F,new ie(p,g)).applyEuler(new nn(0,0,-b))}:null}function D(L,k){const N=cX(k,k.ly),F=qie(L.leftPoint,L.rightPoint,N.leftPoint,N.rightPoint);return F?new ie().subVectors(F,new ie(p,g)).applyEuler(new nn(0,0,-b)):null}function E(){return!(H.getState().moveHandleType||H.getState().resizeHandleType||H.getState().isAddingElement())}function W(L){L.button!==2&&L.intersections.length>0&&L.intersections[0].eventObject===L.eventObject&&E()&&H.getState().selectMe(f,L,Oo.Select,!0)}function j(L){H.getState().selectMe(f,L,Oo.ContextMenu,!0),H.getState().set(k=>{L.intersections.length>0&&L.intersections[0].eventObject===L.eventObject&&(k.contextMenuObjectType=z.Wall)})}return a?h.jsxs("group",{name:"Wall Parapet Group",position:[0,0,n],onContextMenu:j,onPointerDown:W,children:[h.jsx(nw,{name:"Body Extrude Mesh",args:[T,{steps:1,depth:C,bevelEnabled:!1}],children:h.jsx("meshStandardMaterial",{color:l,map:P})}),h.jsx(jn,{position:[y,0,0],points:R,color:"black",lineWidth:.2}),h.jsx(jn,{position:[-y,0,0],points:R,color:"black",lineWidth:.2}),h.jsx(jn,{position:[0,0,C],points:S,color:"black",lineWidth:.2}),h.jsx(nw,{name:"Copings Extrude Mesh",position:[0,0,C],args:[A,{steps:1,depth:d,bevelEnabled:!1}],children:h.jsx("meshStandardMaterial",{color:l})}),h.jsx(jn,{position:[0,0,C+d],points:x,color:"black",lineWidth:.2}),h.jsx(jn,{position:[0,0,C],points:x,color:"black",lineWidth:.2})]}):null};function jSe(t){const e=(t.ly+t.copingsWidth)/2,n=(t.ly-t.copingsWidth)/2;return{innerPoints:cX(t,e),outerPoints:cX(t,n)}}function cX(t,e){const{leftPoint:n,rightPoint:o}=t,r=new ie().fromArray(n),i=new ie().fromArray(o),l=new ie().subVectors(i,r).applyEuler(new nn(0,0,Gt)).normalize().clone().multiplyScalar(e);return{leftPoint:r.clone().add(l),rightPoint:i.clone().add(l)}}function gO(t,e){return Math.abs(t[0]-e[0]){const{id:n,lx:o,lz:r}=t,i=H(l3),a=H(e5),l=H(i3),s=H(a3),c=Tn(Tb),u=ht(h3),d=m.useRef(0),f=m.useRef(),p=m.useMemo(()=>{if(!u||e)return;const g=c.get(n);if(!g)return;const y=g.reduce((U,O)=>U+O,0),w=t.fill===El.Partial&&!me.isPartialWallFull(t),b=me.getWallVertices(t,0),C=w?me.getPartialWallVertices(t,0):b,P=me.getPolygonArea(b);let v=w?me.getPolygonArea(C):P;if(v===0)return;const T=i(z.Window,n),A=i(z.Door,n);if(T&&T.length>0)for(const U of T)v-=me.getWindowArea(U,t);if(A&&A.length>0)for(const U of A)v-=U.lx*U.lz*t.lx*t.lz;const x=H.getState().world,S=r3*(x.solarRadiationHeatmapGridCellSize??.5),R=me.getHighestPointOfWall(t),M=Math.max(2,Math.round(o/S)),D=Math.max(2,Math.round(R/S)),E=o/M,W=R/D,j=(R-t.lz)/2,L=y/v*(a??Qm);d.current=L<0?1:0,f.current=me.getEuler(Io,Oc,"YXZ",Math.sign(L)*Gt);const k=[],N=w?me.getPartialWallVertices(t,0):me.getWallVertices(t,0);let F;for(let U=0;U0)for(const $ of T){if($.type!==z.Window)continue;const Q=$.cx*t.lx,le=$.cz*t.lz,q=$.lx*t.lx/2,te=$.lz*t.lz/2;if($.windowType===Ti.Arched){if(_>=Q-q&&_=le-te&&X=Q-q&&_=le-te&&X0)for(const $ of A){const Q=$.cx*o,le=$.cz*R,q=$.lx*o/2,te=$.lz*R/2;if(_>=Q-q&&_=le-te&&Xh.jsxs(be.Fragment,{children:[h.jsx(jn,{points:g,name:"Heat Flux "+y,lineWidth:s??Zm,color:l??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:g[d.current].clone().add(new ie(0,d.current===0?-.1:.1,0)),args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:f.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:l??g0})})]},y))}):null},Hen=be.memo(Ren),$ie="Wall Block Plane",Men="Wall Intersection Plane",sP=.1,Ien=be.memo(({transparent:t,color:e,opacity:n})=>{const r=H(Dw).z<=0;return h.jsx("meshStandardMaterial",{color:t?e:"white",transparent:t,opacity:n,side:r?p0:$r})}),zen=({wallModel:t,foundationModel:e})=>{var mu,un,$t,Bt,pn,Pn;let{id:n,cx:o,cy:r,lx:i=1,ly:a=.5,lz:l=5,relativeAngle:s,leftJoints:c,rightJoints:u,textureType:d,color:f="white",lineColor:p="black",lineWidth:g=.2,parentId:y,locked:w=!1,roofId:b,leftRoofHeight:C,rightRoofHeight:P,centerRoofHeight:v,centerLeftRoofHeight:T,centerRightRoofHeight:A,wallStructure:x=gc.Default,structureSpacing:S=2,structureWidth:R=.1,structureColor:M="white",opacity:D=.5,fill:E=El.Full,leftUnfilledHeight:W=.5,rightUnfilledHeight:j=.5,leftTopPartialHeight:L=l,rightTopPartialHeight:k=l,parapet:N=Xye,leftPoint:F,rightPoint:U}=t;C=c.length>0?C:l,P=u.length>0?P:l;const O=i$e(d),B=Es(n),_=H(fn),X=H(Cb),$=H(Y0),Q=H(En),le=H(Yge),q=Tn(u1),te=H(zw),re=H(Ds),ae=H(Oge),se=H(AOe),ne=H(Cf),fe=ht(xh),ge=ht(Ss),de=ht($e=>$e.elementBeingCanceledId),Z=ht($e=>$e.showWallIntersectionPlaneId),[he,xe]=m.useState(!1),[He,Se]=m.useState(null),{camera:ze,gl:Ie}=oi(),{elementsOnWall:ye,leftWall:ce,rightWall:pe}=jQt(n,c[0],u[0]),ve=a$e(e),Ae=m.useRef(null),Te=m.useRef(null),Me=m.useRef(null),Pe=m.useRef(null),Ee=m.useRef(null),Be=m.useRef(null),Je=m.useRef(null),We=m.useRef(null),Ke=i/2,Ne=a/2,De=l/2,ke=ve?ve.rotation[2]+s:s,Ye=me.getInnerWallOffset(ce,i,a,s,"left"),it=me.getInnerWallOffset(pe,i,a,s,"right"),Ve=x===gc.Stud||x===gc.Pillar,yt=C??l,ct=P??l,Xe=E===El.Partial,ut=Xe?W:0,ft=Xe?j:0,ot=Xe?Math.min(yt,L):yt,st=Xe?Math.min(ct,k):ct,at=Xe&&(!me.isZero(yt-ot)||!me.isZero(ct-st)),Oe=re&&!Ve,Ze=N.display,St=Math.max(ot,st)-De,Pt=m.useMemo(()=>new Xt,[]),Rt=m.useMemo(()=>new l0,[]),Ut=m.useMemo(()=>new mf({color:"white",side:$r,transparent:Ve,opacity:D}),[Ve,D]),Ht=m.useMemo(()=>me.getHighestPointOfWall(t),[t.lz,t.leftRoofHeight,t.rightRoofHeight,t.centerRoofHeight,t.centerLeftRoofHeight,t.centerRightRoofHeight]),At=m.useMemo(()=>{const $e=new Fl;return Qe($e,i,l,0,0,0,0),ye.forEach(bt=>{if(bt.type===z.Window&&bt.id!==Je.current&&bt.lx>0&&bt.lz>0){const Lt=bt,xt=new Fl,[jt,Kt,sn,yn]=[bt.lx*i,bt.lz*l,bt.cx*i,bt.cz*l];if(Lt.windowType)switch(Lt.windowType){case Ti.Arched:mn(xt,jt,Kt,sn,yn,Lt.archHeight);break;case Ti.Polygonal:{const[An,bn]=Lt.polygonTop??Gp;Hn(xt,jt,Kt,sn,yn,An*jt,bn);break}case Ti.Default:default:an(xt,jt,Kt,sn,yn)}else an(xt,jt,Kt,sn,yn);$e.holes.push(xt)}}),$e},[i,l,E,W,j,ot,st,ye,C,P,v,T,A]),kt=m.useMemo(()=>{const $e=new Fl,bt=l,Lt=l/2;if(Xe)$e.moveTo(-Ke+Ye,-Lt+W),$e.lineTo(Ke-it,-Lt+j);else{$e.moveTo(-Ke+Ye,-Lt);const xt=ye.filter(jt=>jt.type===z.Door).sort((jt,Kt)=>jt.cx-Kt.cx);for(const jt of xt)if(jt.id!==Je.current){const[Kt,sn,yn,An]=[jt.cx*i,jt.cz*bt,jt.lx*i,jt.lz*bt];if(jt.doorType===Pd.Default)$e.lineTo(Kt-yn/2,-Lt),$e.lineTo(Kt-yn/2,-Lt+An),$e.lineTo(Kt+yn/2,-Lt+An),$e.lineTo(Kt+yn/2,-Lt);else{const bn=Math.min(jt.archHeight,An,yn/2);if($e.lineTo(Kt-yn/2,-Lt),bn>.1){$e.lineTo(Kt-yn/2,-Lt+An/2-bn);const Ln=bn/2+yn**2/(8*bn),[Yn,Wn]=[Kt,sn+An/2-Ln],oo=Math.acos(Math.min(yn/2/Ln,1)),qn=Math.PI-oo;$e.absarc(Yn,Wn,Ln,qn,oo,!0)}else $e.lineTo(Kt-yn/2,-Lt+An),$e.lineTo(Kt+yn/2,-Lt+An);$e.lineTo(Kt+yn/2,-Lt)}}$e.lineTo(Ke-it,-Lt)}if(at){const xt=st-ot,jt=(i-it)*xt/i,Kt=Ye*xt/i;$e.lineTo(Ke-it,-Lt+ot+jt),$e.lineTo(-Ke+Ye,-Lt+ot+Kt)}else b?(P?$e.lineTo(Ke-it,P-Lt):$e.lineTo(Ke-it,Lt),A&&$e.lineTo(A[0]*i,A[1]-Lt),v&&$e.lineTo(v[0]*i,v[1]-Lt),T&&$e.lineTo(T[0]*i,T[1]-Lt),C?$e.lineTo(-Ke+Ye,C-Lt):$e.lineTo(-Ke+Ye,Lt)):($e.lineTo(Ke-it,Lt),$e.lineTo(-Ke+Ye,Lt));return $e.closePath(),ye.forEach(xt=>{if(xt.type===z.Window&&xt.id!==Je.current&&xt.lx>0&&xt.lz>0){const jt=xt,Kt=new Fl,[sn,yn,An,bn]=[xt.lx*i,xt.lz*l,xt.cx*i,xt.cz*l];if(jt.windowType)switch(jt.windowType){case Ti.Arched:mn(Kt,sn,yn,An,bn,jt.archHeight);break;case Ti.Polygonal:{const[Ln,Yn]=jt.polygonTop??Gp;Hn(Kt,sn,yn,An,bn,Ln*sn,Yn);break}case Ti.Default:default:an(Kt,sn,yn,An,bn);break}else an(Kt,sn,yn,An,bn);$e.holes.push(Kt)}}),$e},[i,l,E,W,j,ot,st,Ye,it,ye,b,C,P,v,T,A]),gt=m.useMemo(()=>Xe?(ot+st)/2-De:De,[De,Xe,ot,st]),dt=m.useMemo(()=>{const $e=st-ot;return!Xe||Math.abs($e)<.01?0:Math.atan2($e,i)},[i,Xe,ot,st]),Ct=m.useMemo(()=>{const $e=new Fl;if(!Xe||Math.abs(dt)<1e-4)return gn($e,i,a,Ye,it),$e;{const bt=i/2,Lt=a/2,xt=Math.cos(dt),jt=bt/xt,Kt=(bt-Ye)/xt,sn=(bt-it)/xt;return $e.moveTo(-jt,-Lt),$e.lineTo(jt,-Lt),$e.lineTo(sn,Lt),$e.lineTo(-Kt,Lt),$e.closePath(),$e}},[i,a,Ye,it,Xe,dt]),tt=m.useMemo(()=>{const $e=[],bt=i/2,Lt=l/2;return Xe?($e.push({x:-bt+Ye,y:-Lt+ut}),$e.push({x:bt-it,y:-Lt+ft})):($e.push({x:-bt,y:-Lt}),$e.push({x:bt,y:-Lt})),at?($e.push({x:bt-it,y:-Lt+st}),$e.push({x:-bt+Ye,y:-Lt+ot})):(P?$e.push({x:bt,y:P-Lt}):$e.push({x:bt,y:Lt}),A&&$e.push({x:A[0]*i,y:A[1]-Lt}),v&&$e.push({x:v[0]*i,y:v[1]-Lt}),T&&$e.push({x:T[0]*i,y:T[1]-Lt}),C?$e.push({x:-bt,y:C-Lt}):$e.push({x:-bt,y:Lt})),$e},[i,l,E,ut,ft,ot,st,C,P,v,T,A]),Fe=m.useMemo(()=>{const $e=[];let bt=0,Lt=0;if(E===El.Partial&&(bt=(j-W)/i,Lt=W+Ke*bt),x===gc.Stud){let xt=-Ke+R/2;for(;xt<=Ke;)$e.push([xt,bt*xt+Lt]),xt+=S;xt=Ke-R/2,$e.push([xt,bt*xt+Lt])}else if(x===gc.Pillar){let xt=-Ke;for(;xt<=Ke;)$e.push([xt,bt*xt+Lt]),xt+=S;$e.push([Ke,bt*Ke+Lt])}return $e},[x,R,S,i,a,l,W,j]),qe=m.useMemo(()=>({id:n,parentId:y,cx:o,cy:r,hx:Ke,hy:Ne,angle:s,selected:B}),[n,y,o,r,Ke,Ne,s,B]),je=m.useMemo(()=>({leftPoint:F,rightPoint:U,ly:a,copingsWidth:N.copingsWidth}),[F,U,a,N.copingsWidth]),rt=m.useMemo(()=>!ce||!ce.parapet||!ce.parapet.display?null:{leftPoint:ce.leftPoint,rightPoint:ce.rightPoint,ly:ce.ly,copingsWidth:ce.parapet.copingsWidth},[ce==null?void 0:ce.leftPoint,ce==null?void 0:ce.rightPoint,ce==null?void 0:ce.ly,(mu=ce==null?void 0:ce.parapet)==null?void 0:mu.copingsWidth,(un=ce==null?void 0:ce.parapet)==null?void 0:un.display]),mt=m.useMemo(()=>!pe||!pe.parapet||!pe.parapet.display?null:{leftPoint:pe.leftPoint,rightPoint:pe.rightPoint,ly:pe.ly,copingsWidth:pe.parapet.copingsWidth},[pe==null?void 0:pe.leftPoint,pe==null?void 0:pe.rightPoint,pe==null?void 0:pe.ly,($t=pe==null?void 0:pe.parapet)==null?void 0:$t.copingsWidth,(Bt=pe==null?void 0:pe.parapet)==null?void 0:Bt.display]);m.useEffect(()=>{We.current&&We.current.id===de&&(We.current=null,ir())},[de]),m.useEffect(()=>{if(t&&ge){const $e=q(t.id);if($e){const bt=me.fetchHeatmapTexture($e,ne??5);if(bt){bt.wrapS=Hs,bt.wrapT=Hs;const Lt=l===Ht?0:(1-l/Ht)/2;bt.offset.set(-i/2,-Ht/2-Lt),bt.center.set(i/2,Ht/2),bt.repeat.set(1/i,1/Ht),Se(bt)}}}},[ge,ne]),m.useEffect(()=>{b&&(ae.has(b)||se.has(b))&&H.getState().set($e=>{const bt=new Set;for(const Lt of $e.elements)if(Lt.id===n&&Lt.type===z.Wall){const xt=Lt;if(xt.roofId=null,xt.leftRoofHeight=void 0,xt.rightRoofHeight=void 0,xt.centerRoofHeight=void 0,xt.centerLeftRoofHeight=void 0,xt.centerRightRoofHeight=void 0,ye.length>0){const jt=Cn.getWallPoints2D(xt);ye.forEach(Kt=>{if(Kt.type===z.Polygon)return;const sn=Kt.type===z.Door,yn=Kt.type===z.SolarPanel,An=yn?Kt.lx-.01:Kt.lx*i,bn=yn?Kt.ly-.01:Kt.lz*l,Ln=new ie(Kt.cx*i,0,Kt.cz*l);me.isElementInsideWall(Ln,An,bn,jt,sn)||(bt.add(Kt.id),$e.autoDeletedChild?$e.autoDeletedChild.push(Kt):$e.autoDeletedChild=[Kt])})}break}bt.size>0?$e.elements=$e.elements.filter(Lt=>!bt.has(Lt.id)):$e.autoDeletedChild===null&&($e.autoDeletedChild=[])})},[b,ae,se]);function Qe($e,bt,Lt,xt=0,jt=0,Kt=0,sn=0,yn=!0){const An=bt/2,bn=Lt/2;if(Xe?$e.moveTo(xt-An+Kt,jt-bn+W):$e.moveTo(xt-An+Kt,jt-bn),yn){const Ln=ye.filter(Yn=>Yn.type===z.Door).sort((Yn,Wn)=>Yn.cx-Wn.cx);for(const Yn of Ln)if(Yn.id!==Je.current){const[Wn,oo,qn,Ko]=[Yn.cx*bt,Yn.cz*Lt,Yn.lx*bt,Yn.lz*l];if(Yn.doorType===Pd.Default)$e.lineTo(xt+Wn-qn/2,jt-bn),$e.lineTo(xt+Wn-qn/2,jt-bn+Ko),$e.lineTo(xt+Wn+qn/2,jt-bn+Ko),$e.lineTo(xt+Wn+qn/2,jt-bn);else{const li=Math.min(Yn.archHeight,Ko,qn/2);if($e.lineTo(xt+Wn-qn/2,jt-bn),li>.1){$e.lineTo(xt+Wn-qn/2,jt-bn+Ko/2-li);const $i=li/2+qn**2/(8*li),[Or,ya]=[Wn,jt+oo+Ko/2-$i],Ps=Math.acos(Math.min(qn/2/$i,1)),$u=Math.PI-Ps;$e.absarc(Or,ya,$i,$u,Ps,!0)}else $e.lineTo(xt+Wn-qn/2,jt-bn+Ko),$e.lineTo(xt+Wn+qn/2,jt-bn+Ko);$e.lineTo(xt+Wn+qn/2,jt-bn)}}}Xe?$e.lineTo(xt+An-sn,jt-bn+j):$e.lineTo(xt+An-sn,jt-bn),at?($e.lineTo(xt+An-sn,jt-bn+st),$e.lineTo(xt-An+Kt,jt-bn+ot)):b?(P?$e.lineTo(xt+An-sn,P-bn):$e.lineTo(xt+An-sn,jt+bn),A&&$e.lineTo(A[0]*bt,A[1]-bn),v&&$e.lineTo(v[0]*bt,v[1]-bn),T&&$e.lineTo(T[0]*bt,T[1]-bn),C?$e.lineTo(xt-An+Kt,C-bn):$e.lineTo(xt-An+Kt,jt+bn)):($e.lineTo(xt+An-sn,jt+bn),$e.lineTo(xt-An+Kt,jt+bn)),$e.closePath()}function Tt($e,bt){const{cx:Lt,cy:xt,cz:jt}=bt;if(ve&&ke!==void 0){const Kt=me.wallAbsolutePosition(new ie(Lt,xt,jt),ve).setZ(l/2+ve.lz);return new ie().subVectors($e,Kt).applyEuler(new nn(0,0,-ke))}return new ie}function Dt($e){const bt=[];for(let Lt=-1;Lt<=1;Lt+=2)for(let xt=-1;xt<=1;xt+=2){const[jt,Kt]=[Lt,Lt*xt];switch($e.type){case z.Window:{const[sn,yn]=[$e.cx*i,$e.cz*l],[An,bn]=[$e.lx*i/2,$e.lz*l/2],Ln=sn+jt*An,Yn=yn+Kt*bn;bt.push({x:Ln,y:Yn});break}case z.Door:{const[sn,yn]=[$e.cx*i,$e.cz*l],[An,bn]=[$e.lx*i/2,$e.lz*l/2],Ln=sn+jt*An,Yn=yn+Kt*bn;bt.push({x:Ln,y:Yn});break}case z.SolarPanel:{const[sn,yn]=[$e.cx*i,$e.cz*l],[An,bn]=[$e.lx/2,$e.ly/2],Ln=sn+jt*An,Yn=yn+Kt*bn;bt.push({x:Ln,y:Yn})}}}if($e.type===z.Window&&$e.windowType===Ti.Polygonal){const Lt=$e,[xt,jt]=Lt.polygonTop??[0,0];bt.push({x:$e.cx*i+xt*$e.lx*i,y:$e.cz*l+$e.lz*l/2+jt})}return bt}function lt($e,bt=0){if(!Xe)return me.getWallVertices($e,bt);const Lt=$e.lx/2,xt=$e.lz/2,jt={x:-Lt-bt,y:$e.leftUnfilledHeight-xt-bt},Kt={x:Lt+bt,y:$e.rightUnfilledHeight-xt-bt},sn={x:-Lt-bt,y:$e.leftTopPartialHeight-xt+bt},yn={x:Lt+bt,y:$e.rightTopPartialHeight-xt+bt},An=[];return An.push(sn,jt,Kt,yn),at||($e.centerRightRoofHeight&&An.push({x:$e.centerRightRoofHeight[0]*$e.lx,y:$e.centerRightRoofHeight[1]-xt+bt}),$e.centerRoofHeight&&An.push({x:$e.centerRoofHeight[0]*$e.lx,y:$e.centerRoofHeight[1]-xt+bt}),$e.centerLeftRoofHeight&&An.push({x:$e.centerLeftRoofHeight[0]*$e.lx,y:$e.centerLeftRoofHeight[1]-xt+bt})),An}function zt($e,bt,Lt,xt,jt){if(Lt<.1||xt<.1||Lt>i||!b&&xt>l)return Je.current=$e,!1;const Kt=.1;Lt+=Kt,xt+=Kt;for(const sn of ye){if(sn.id===$e||sn.type===z.Polygon)continue;const yn=Dt(sn),An=[];for(let bn=-1;bn<=1;bn+=2)for(let Ln=-1;Ln<=1;Ln+=2){const Yn=bt.x+bn*Lt/2,Wn=bt.z+bn*Ln*xt/2;if(An.push({x:Yn,y:Wn}),me.isPointInside(Yn,Wn,yn))return Je.current=$e,!1}if(jt){const[bn,Ln]=jt,Yn=bt.x+bn*Lt,Wn=bt.z+xt/2+Ln;if(An.push({x:Yn,y:Wn}),me.isPointInside(Yn,Wn,yn))return Je.current=$e,!1}for(const bn of yn)if(me.isPointInside(bn.x,bn.y,An))return Je.current=$e,!1}return Je.current=null,!0}function Ft($e,bt,Lt,xt,jt){return me.isElementInsideWall(bt,Lt,xt,tt,jt)?!0:(Je.current=$e,!1)}function _t($e,bt,Lt,xt){const[jt,Kt]=xt,sn=$e.x+bt*jt,yn=$e.z+Lt/2+Kt;return!!me.isPointInside(sn,yn,lt(t,0))}function tn($e){Pt.x=$e.offsetX/Ie.domElement.clientWidth*2-1,Pt.y=-($e.offsetY/Ie.domElement.clientHeight)*2+1,Rt.setFromCamera(Pt,ze)}function Qt($e){return!($e.button===2||H.getState().addedWallId||Be.current||H.getState().moveHandleType||H.getState().resizeHandleType||H.getState().objectTypeToAdd!==z.None||B||le())}function gn($e,bt,Lt,xt,jt){const Kt=bt/2,sn=Lt/2;$e.moveTo(-Kt,-sn),$e.lineTo(Kt,-sn),$e.lineTo(Kt-jt,sn),$e.lineTo(-Kt+xt,sn),$e.closePath()}function an($e,bt,Lt,xt=0,jt=0){const Kt=bt/2,sn=Lt/2;$e.moveTo(xt-Kt,jt-sn),$e.lineTo(xt+Kt,jt-sn),$e.lineTo(xt+Kt,jt+sn),$e.lineTo(xt-Kt,jt+sn),$e.closePath()}function mn($e,bt,Lt,xt,jt,Kt=0){const sn=bt/2,yn=Lt/2,An=Math.min(Kt,Lt,sn);if($e.moveTo(xt-sn,jt-yn),$e.lineTo(xt+sn,jt-yn),$e.lineTo(xt+sn,jt+yn-An),An>0){const bn=An/2+bt**2/(8*An),[Ln,Yn]=[xt,jt+yn-bn],Wn=Math.acos(Math.min(1,sn/bn)),oo=Math.PI-Wn;$e.absarc(Ln,Yn,bn,Wn,oo,!1)}else $e.lineTo(xt-sn,jt+yn);$e.closePath()}function Hn($e,bt,Lt,xt,jt,Kt,sn){const[yn,An]=[bt/2,Lt/2];$e.moveTo(xt-yn,jt-An),$e.lineTo(xt+yn,jt-An),$e.lineTo(xt+yn,jt+An),$e.lineTo(xt+Kt,jt+An+sn),$e.lineTo(xt-yn,jt+An),$e.closePath()}function Fo($e){const bt=parseFloat((Math.round($e.x/S6)*S6).toFixed(1)),Lt=parseFloat((Math.round($e.z/S6)*S6).toFixed(1));return new ie(bt,$e.y,Lt)}function yo($e){const bt=parseFloat((Math.round($e.x/m9)*m9).toFixed(1)),Lt=parseFloat((Math.round($e.z/m9)*m9).toFixed(1));return new ie(bt,$e.y,Lt)}function So($e){return H.getState().enableFineGrid?$e=yo($e):$e=Fo($e),$e}function $o($e,bt,Lt,xt,jt){H.getState().set(Kt=>{for(const sn of Kt.elements)if(sn.id===$e){if([sn.cx,sn.cy,sn.cz]=bt,[sn.lx,sn.ly,sn.lz]=Lt,xt!==void 0&&(sn.type===z.Window||sn.type===z.Door)&&(sn.archHeight=xt),jt!==void 0&&sn.type===z.Window){const yn=sn;yn.windowType===Ti.Polygonal&&(yn.polygonTop=[...jt])}break}})}function mo($e){return $e.type===z.Window&&$e.windowType===Ti.Polygonal&&$e.polygonTop}function Jn($e){const bt={name:"Add",timestamp:Date.now(),addedElement:$e,undo:()=>{H.getState().removeElementById($e.id,!1)},redo:()=>{H.getState().set(Lt=>{Lt.elements.push(bt.addedElement),Lt.selectedElement=bt.addedElement,Lt.deletedRoofId=null})}};Q(bt)}function uo(){const $e=H.getState().selectedElement;if(!$e)return;const bt=H.getState().getElementById($e.id);if(bt)switch(bt.type){case z.Door:case z.Window:case z.SolarPanel:const Lt={name:`Resize ${bt.type}`,timestamp:Date.now(),resizedElementId:bt.id,resizedElementType:bt.type,oldPosition:[$e.cx,$e.cy,$e.cz],oldDimension:[$e.lx,$e.ly,$e.lz],newPosition:[bt.cx,bt.cy,bt.cz],newDimension:[bt.lx,bt.ly,bt.lz],oldArchHeight:$e.type===z.Window||$e.type===z.Door?$e.archHeight:void 0,newArchHeight:bt.type===z.Window||bt.type===z.Door?bt.archHeight:void 0,oldPolygonTop:mo($e)?[...$e.polygonTop]:void 0,newPolygonTop:mo(bt)?[...bt.polygonTop]:void 0,undo(){$o(this.resizedElementId,this.oldPosition,this.oldDimension,this.oldArchHeight,this.oldPolygonTop)},redo(){$o(this.resizedElementId,this.newPosition,this.newDimension,this.newArchHeight,this.newPolygonTop)}};Q(Lt);break;case z.Polygon:const xt=$e,jt=bt,Kt={name:"Edit Polygon",timestamp:Date.now(),oldValue:[...xt.vertices],newValue:[...jt.vertices],changedElementId:jt.id,changedElementType:jt.type,undo(){te(this.changedElementId,this.oldValue)},redo(){te(this.changedElementId,this.newValue)}};Q(Kt);break}}function ir(){H.getState().set($e=>{$e.addedWindowId=null,$e.addedDoorId=null})}function Rr($e){return $e===z.Window||$e===z.Door}function br($e,bt){const Lt=Eu.getIntersectionObjects($e);return Lt.length>0&&Lt[0].object.name===`${Eu.WALL_OUTSIDE_SURFACE_MESH_NAME} ${bt}`}function Vr($e){return $e.intersections.length>0&&$e.intersections[0].object===$e.eventObject}function Wo($e,bt,Lt){if(H.getState().moveHandleType&&bt&&wn(bt)&&bt.parentId!==$e){const xt=Lt.intersections.filter(Kt=>Kt.eventObject.name.includes(Eu.WALL_OUTSIDE_SURFACE_MESH_NAME)||Kt.eventObject.name.includes(ade)||Kt.eventObject.name===$ie);if(!(xt.length>0&&(xt[0].eventObject.name===$ie||xt[0].eventObject.name.includes(ade))))return!0}return!1}function wn($e){if(!$e)return!1;switch($e.type){case z.Window:case z.Door:case z.SolarPanel:case z.Light:case z.Sensor:return!0}return!1}function In($e){if(H.getState().resizeHandleType!==vt.Arch)return!1;if($e.type===z.Window){const bt=$e;return bt.windowType===Ti.Arched&&bt.archHeight!==void 0}if($e.type===z.Door){const bt=$e;return bt.doorType===Pd.Arched&&bt.archHeight!==void 0}}function ar($e,bt){const Lt=$e.getPoints().map(xt=>({x:xt.x,y:xt.y}));return!me.isPointInside(bt.x,bt.y,Lt)}function No($e,bt,Lt,xt,jt,Kt=!1){const sn=new ie().subVectors(bt,$e).normalize(),[yn,An]=Kt?[bt.y,$e.y]:[$e.y,bt.y];let bn;if(yn(bn.type===z.Wall&&bn.parentId===y&&An.set(bn.id,bn),An),new Map);let xt=!1,jt=0;const Kt={lng:H.getState().language},sn=t;let yn=sn;for(;yn&&yn.rightJoints.length>0;){jt++;const An=Lt.get(yn.rightJoints[0]);if(!An)break;if(bt&&An.lz!==sn.lz)return po(Y.t("message.WallsAreNotAtSameHeight",Kt)),!1;if(An.id===sn.id){xt=!0;break}if(yn=An,jt>100)break}return xt?!0:(po(Y.t("message.WallsAreNotConnected",Kt)),!1)}function xo(){return We.current&&We.current.status===0&&H.getState().moveHandleType===Ho.Mid}function Qo(){return!(H.getState().moveHandleType||H.getState().resizeHandleType||le())}function jo(){return at||W!==j||L!==k?!1:b?!(C!==P||v!==void 0||T!==void 0||A!==void 0):!0}function lr($e,bt,Lt){var yn;tn($e);const jt=((yn=(bt?Rt.intersectObjects([bt]):$e.intersections)[0])==null?void 0:yn.point)??$e.point,Kt=Tt(jt,t),sn=Lt?So(Kt.clone().add(Lt)).sub(Lt):So(Kt);return{relativePointer:Kt,pointerOnGrid:sn}}function fr($e,bt){if(!Ae.current)return null;const{pointerOnGrid:Lt}=lr($e,Ae.current),xt=Lt.x/t.lx,jt=Lt.z/t.lz;return bt===z.Window?Ga.makeWindow(t,xt,0,jt,z.Wall):bt===z.Door?Ga.makeDoor(t):null}function ai($e){$e&&(We.current={id:$e.id,type:$e.type,status:0}),_(bt=>{$e&&(bt.elements.push($e),bt.selectedElement=$e,bt.selectedElementIdSet.clear(),bt.selectedElementIdSet.add($e.id),$e.type===z.Window?bt.addedWindowId=$e.id:$e.type===z.Door&&(bt.addedDoorId=$e.id)),bt.moveHandleType=Ho.Mid,bt.objectTypeToAdd=z.None})}function hr($e){if(!$e)return;const{id:bt,type:Lt}=$e;_(xt=>{xt.elements=xt.elements.filter(jt=>jt.id!==bt),xt.selectedElement=null,xt.moveHandleType=null,xt.objectTypeToAdd=Lt,xt.addedWindowId=null,xt.addedDoorId=null}),We.current=null}function tr($e){if(!$e)return[0,0];switch($e.type){case z.Window:{const bt=ht.getState().oldParentId;if($e.parentId!==bt){const Lt=H.getState().elements.find(xt=>xt.id===bt);return Lt?[$e.lx*Lt.lx/2,$e.lz*Lt.lz/2]:[0,0]}else return[$e.lx*i/2,$e.lz*l/2]}case z.Door:return[$e.lx*i/2,$e.lz*l/2];case z.SolarPanel:return[$e.lx/2,$e.ly/2]}return[sP,sP]}function xi(){const $e=[];if(v){const bt=v[0];if(bt===.5&&C!==void 0)return $e.push(new ie(Ke,v[1]-De),new ie(-Ke,C-De)),$e;if(bt===-.5&&P!==void 0)return $e.push(new ie(Ke,P-De),new ie(-Ke,v[1]-De)),$e}return P!==void 0?$e.push(new ie(Ke,P-De)):$e.push(new ie(Ke,De)),A!==void 0&&$e.push(new ie(A[0]*i,A[1]-De)),v!==void 0&&$e.push(new ie(v[0]*i,v[1]-De)),T!==void 0&&$e.push(new ie(T[0]*i,T[1]-De)),C!==void 0?$e.push(new ie(-Ke,C-De)):$e.push(new ie(-Ke,De)),$e}function Eo($e,bt){const Lt=bt==null?void 0:bt.ignorePadding,xt=bt!=null&&bt.elementHalfSize?[...bt.elementHalfSize]:[0,0],jt=Lt?0:sP,Kt=Lt?0:sP+Ye,sn=Lt?0:sP+it,[yn,An]=xt,[bn,Ln,Yn,Wn]=[-Ke+yn+Kt,Ke-yn-sn,-De+An+jt,De-An-jt],oo=$e.clone();if(jo()){const qn=Xe?W:0,Ko=l-(Xe?ot:l);return oo.setX(me.clamp($e.x,bn,Ln)),oo.setZ(me.clamp($e.z,Yn+qn,Wn-Ko)),oo}else{const qn=hl(yn,An,bn,Ln,jt),Ko=new Xt($e.x,$e.z);let li=1/0,$i=-1/0;if(bt!=null&&bt.resizeAnchor){const Ps=bt.resizeAnchor.x,$u=[];if(at)$u.push(new ie(-Ke,-De+ot),new ie(Ke,-De+st));else{const Ef=xi().reverse();$u.push(...Ef)}for(let Ef=1;Ef<$u.length;Ef++){const Xl=$u[Ef-1],_0=$u[Ef];if(Ps>=Xl.x&&Ps<=_0.x){const Hh=(_0.y-Xl.y)/(_0.x-Xl.x),xp=-Hh*Xl.x+Xl.y;li=Hh*Ps+xp;break}}const Qu=new ie(-Ke,-De+ut),Rh=new ie(Ke,-De+ft),Df=(Rh.y-Qu.y)/(Rh.x-Qu.x),Zu=-Df*Qu.x+Qu.y;$i=Df*Ps+Zu}const Or=Ko.y>li;if(ar(qn,Ko)){const Ps=eo(qn,Ko);oo.setX(Ps.x),oo.setZ(me.clamp(Ps.y,$i+jt,li-jt))}else Or&&oo.setZ(li-jt)}return oo.setZ(Math.max(Yn,oo.z)),oo}function bi($e,bt){_(Lt=>{const xt=Lt.elements.find(jt=>jt.id===$e);if(xt)switch(xt.type){case z.Window:{xt.cx=bt.x/i,xt.cz=bt.z/l,xt.cy=xt.id===Je.current?-.01:.3,xt.tint=xt.id===Je.current?"red":Lt.selectedElement.tint;break}case z.Door:{const jt=l/2;xt.cx=bt.x/i,xt.cz=(bt.z-jt)/2/l,xt.lz=(bt.z+jt)/l;break}case z.SolarPanel:{xt.cx=bt.x/i,xt.cz=bt.z/l,xt.color=xt.id===Je.current?"red":"#fff";break}case z.Sensor:case z.Light:{xt.cx=bt.x/i,xt.cz=bt.z/l;break}case z.Polygon:{const jt=xt;if(jt.vertices.length>0){const Kt=me.calculatePolygonCentroid(jt.vertices),sn=-bt.x/i-Kt.x,yn=-bt.z/l-Kt.y,An=jt.vertices.map(bn=>({x:bn.x+sn,y:bn.y+yn}));xt.vertices=An}break}}})}function hl($e,bt,Lt,xt,jt){const Kt=[],sn=new ie(-Ke,-De+ut),yn=new ie(Ke,-De+ft);if(No(sn,yn,$e,bt,jt,!0),Kt.push({start:new ie(Lt,De),end:new ie(Lt,sn.y)}),Kt.push({start:sn.clone(),end:yn.clone()}),Kt.push({start:new ie(xt,yn.y),end:new ie(xt,De)}),at){const bn=new ie(Ke,-De+st),Ln=new ie(-Ke,-De+ot);No(bn,Ln,$e,bt,jt),Kt.push({start:bn.clone(),end:Ln.clone()})}else{const bn=xi();for(let Ln=1;Ln{const jt=xt.elements.find(An=>An.id===(Lt==null?void 0:Lt.id));if(!jt||jt.type===z.SolarPanel&&jt.parentType===void 0)return;if(jt.type===z.Window){const An=xt.elements.find(bn=>bn.id===jt.parentId);if(An){const bn=jt.lx*An.lx,Ln=jt.lz*An.lz;jt.lx=bn/i,jt.lz=Ln/l}}const{pointerOnGrid:Kt}=lr($e,Ae.current),sn=tr(jt),yn=Eo(Kt,{elementHalfSize:sn,ignorePadding:jt.type===z.SolarPanel});zt(jt.id,yn,sn[0]*2,sn[1]*2),jt.cx=yn.x/i,jt.cz=yn.z/l,jt.parentId=n,jt.foundationId=y,xt.selectedElement&&(xt.selectedElement.parentId=n,xt.selectedElement.foundationId=y),jt.type===z.Window?(jt.cy=jt.id===Je.current?-.01:0,jt.tint=jt.id===Je.current?"red":xt.selectedElement.tint):jt.type===z.SolarPanel&&(jt.color=jt.id===Je.current?"red":"#fff",jt.parentType=z.Wall)}),fe("showWallIntersectionPlaneId",n))}else xo()&&hr(We.current)}function Ai($e){if($e.button!==2){if(xo()){Fn.getState().setEnableOrbitController(!1),xe(!0);const{pointerOnGrid:bt}=lr($e,Ae.current),Lt=Eo(bt);_(xt=>{var jt,Kt;xt.moveHandleType=null,((jt=We.current)==null?void 0:jt.type)===z.Window?(xt.resizeHandleType=vt.LowerRight,xt.resizeAnchor.copy(Lt)):((Kt=We.current)==null?void 0:Kt.type)===z.Door&&(xt.resizeHandleType=vt.UpperRight,xt.resizeAnchor.copy(Lt).setZ(-l/2))}),We.current.status=1}else if(Vr($e))if(H.getState().objectTypeToAdd!==z.None){const Lt=$e.point;Zs(Lt,!0)}else H.getState().groupActionMode?(_(Lt=>{for(const xt of Lt.elements)xt.selected=xt.id===y;Lt.multiSelectionsMode||Lt.selectedElementIdSet.clear(),Lt.selectedElementIdSet.has(y)?Lt.selectedElementIdSet.delete(y):Lt.selectedElementIdSet.add(y)}),$e.stopPropagation()):Qo()&&H.getState().selectMe(n,$e,Oo.Select)}}function ka(){We.current&&We.current.status===0&&(_($e=>{$e.elements.pop(),$e.addedDoorId=null,$e.addedWindowId=null,$e.moveHandleType=null,$e.actionModeLock&&We.current&&($e.objectTypeToAdd=We.current.type)}),We.current=null)}function wi(){xo()&&hr(We.current),Je.current=null}function Fs($e){const bt=H.getState().selectedElement??X();if((bt==null?void 0:bt.parentId)===t.id){if(H.getState().moveHandleType){const Lt=bt.type!==z.Polygon?new ie(-bt.lx/2*i,0,bt.lz/2*l):void 0,{relativePointer:xt,pointerOnGrid:jt}=lr($e,Pe.current,Lt),Kt=tr(bt),sn=Eo(jt,{elementHalfSize:Kt,ignorePadding:bt.type===z.SolarPanel}),[yn,An]=[Kt[0]*2,Kt[1]*2];if(bt.type!==z.SolarPanel&&Ft(bt.id,sn,yn,An),bt.type!==z.Polygon){let bn=!0,Ln;bt.type===z.Window&&bt.windowType===Ti.Polygonal&&(Ln=bt.polygonTop??Gp,bn=_t(sn,yn,An,Ln));const Yn=zt(bt.id,sn,yn,An,Ln);bn&&Yn?Je.current=null:Je.current=bt.id}bi(bt.id,sn)}else if(H.getState().resizeHandleType){const{relativePointer:Lt,pointerOnGrid:xt}=lr($e,Pe.current),jt=H.getState().resizeHandleType,Kt=H.getState().resizeAnchor;switch(bt.type){case z.Window:{const sn=bt,yn=Eo(xt,{resizeAnchor:Kt});if(In(sn)){const{newLz:An,newCz:bn,newArchHeight:Ln}=nr(sn,yn,Kt),Yn=new ie(sn.cx*i,0,bn);zt(sn.id,Yn,sn.lx*i,An),Ft(sn.id,Yn,sn.lx*i,An),_(Wn=>{const oo=Wn.elements.find(qn=>qn.id===sn.id);oo&&(oo.lz=An/l,oo.cz=bn/l,oo.archHeight=Ln,oo.cy=oo.id===Je.current?-.01:.3,oo.tint=oo.id===Je.current?"red":sn.tint)})}else if(jt===vt.Upper){const An=new ie(sn.cx*i,0,sn.cz*l),[bn,Ln]=[sn.lx*i,sn.lz*l],Yn=me.clamp((xt.x-Kt.x)/bn,-.5,.5),Wn=Math.max(0,xt.z-Kt.z),oo=[Yn,Wn];(!zt(sn.id,An,bn,Ln,oo)||!_t(An,bn,Ln,oo))&&(Je.current=sn.id),_(qn=>{const Ko=qn.elements.find(li=>li.id===sn.id);Ko&&(Ko.polygonTop=[...oo],Ko.cy=Ko.id===Je.current?-.01:.3,Ko.tint=Ko.id===Je.current?"red":sn.tint)})}else{const{dimensionXZ:An,positionXZ:bn}=Xn($e,yn,Kt),Ln=new ie(bn.x,0,bn.z);let Yn=!0,Wn;sn.windowType===Ti.Polygonal&&(Wn=sn.polygonTop??Gp,Yn=_t(Ln,An.x,An.z,Wn)),(!zt(sn.id,Ln,An.x,An.z,Wn)||!Yn||!Ft(sn.id,Ln,An.x,An.z))&&(Je.current=sn.id),_(oo=>{const qn=oo.elements.find(Ko=>Ko.id===sn.id);qn&&(qn.lx=An.x/i,qn.lz=An.z/l,qn.cx=bn.x/i,qn.cz=bn.z/l,qn.cy=qn.id===Je.current?-.01:.3,qn.tint=qn.id===Je.current?"red":sn.tint)})}break}case z.Door:{const sn=bt,yn=Eo(xt,{resizeAnchor:Kt});if(In(sn)){const{newLz:An,newCz:bn,newArchHeight:Ln}=nr(sn,yn,Kt),Yn=new ie(sn.cx*i,0,bn);zt(sn.id,Yn,sn.lx*i,An),Ft(sn.id,Yn,sn.lx*i,An,!0),_(Wn=>{const oo=Wn.elements.find(qn=>qn.id===sn.id);oo&&(oo.lz=An/l,oo.cz=bn/l,oo.archHeight=Ln,oo.color=oo.id===Je.current?Lce:bt.color)})}else{const{dimensionXZ:An,positionXZ:bn}=Xn($e,yn,Kt),Ln=new ie(bn.x,0,bn.z);zt(sn.id,Ln,An.x,An.z),Ft(sn.id,Ln,An.x,An.z,!0),_(Yn=>{const Wn=Yn.elements.find(oo=>oo.id===sn.id);Wn&&(Wn.cx=bn.x/i,Wn.lx=An.x/i,Wn.cz=(yn.z-l/2)/2/l,Wn.lz=(yn.z+l/2)/l,Wn.color=Wn.id===Je.current?Lce:bt.color)})}break}case z.SolarPanel:{const sn=bt,[yn,An]=tQe(sn);if(jt===vt.Lower||jt===vt.Upper){const Ln=Math.max(1,Math.round(Math.abs(Lt.z-Kt.z)/An))*An,Yn=new ie(0,0,Lt.z-Kt.z).normalize().multiplyScalar(Ln),Wn=new ie().addVectors(Kt,Yn.clone().divideScalar(2));if(!me.isElementInsideWall(Wn,sn.lx-.01,Ln-.01,tt))return;zt(sn.id,Wn,sn.lx,Math.abs(Yn.z)),_(oo=>{const qn=oo.elements.find(Ko=>Ko.id===sn.id);qn&&(qn.cz=Wn.z/l,qn.ly=Math.abs(Yn.z),qn.color=qn.id===Je.current?"red":"#fff")})}else if(jt===vt.Left||jt===vt.Right){const Ln=Math.max(1,Math.round(Math.abs(Lt.x-Kt.x)/yn))*yn,Yn=new ie(Lt.x-Kt.x,0,0).normalize().multiplyScalar(Ln),Wn=new ie().addVectors(Kt,Yn.clone().divideScalar(2));if(!me.isElementInsideWall(Wn,Ln-.01,sn.ly-.01,tt))return;zt(sn.id,Wn,Math.abs(Yn.x),sn.ly),_(oo=>{const qn=oo.elements.find(Ko=>Ko.id===sn.id);qn&&(qn.cx=Wn.x/i,qn.lx=Math.abs(Yn.x),qn.color=qn.id===Je.current?"red":"#fff")})}break}case z.Polygon:{_(sn=>{const yn=sn.elements.find(An=>An.id===bt.id);(yn==null?void 0:yn.selectedIndex)>=0&&(yn.vertices[yn.selectedIndex].x=-xt.x/i,yn.vertices[yn.selectedIndex].y=-xt.z/l)});break}}}}}function ks(){if(Je.current)We.current&&We.current.status===1?(_($e=>{$e.elements.pop(),$e.actionModeLock&&We.current&&($e.objectTypeToAdd=We.current.type)}),We.current=null):(H.getState().moveHandleType||H.getState().resizeHandleType)&&Eu.undoInvalidOperation();else if(We.current){if(We.current.status===0)_($e=>{$e.elements.pop(),$e.actionModeLock&&We.current&&($e.objectTypeToAdd=We.current.type)}),We.current=null;else if(We.current.status===1){const $e=H.getState().elements,bt=$e[$e.length-1];bt.lx*i<.1||bt.lz*l<.1?_(Lt=>{Lt.elements.pop(),Lt.actionModeLock&&We.current&&(Lt.objectTypeToAdd=We.current.type)}):(_(Lt=>{Lt.actionModeLock&&We.current&&(Lt.objectTypeToAdd=We.current.type,vx.selectNone(Lt))}),Jn(bt)),We.current=null}}else H.getState().moveHandleType?Eu.addUndoableMove():H.getState().resizeHandleType&&uo();Fn.getState().setEnableOrbitController(!0),xe(!1),_($e=>{$e.moveHandleType=null,$e.resizeHandleType=null,$e.selectedElement=$e.elements.find(bt=>{var Lt;return bt.id===((Lt=$e.selectedElement)==null?void 0:Lt.id)})}),fe("showWallIntersectionPlaneId",null),Je.current=null,ir()}function Zs($e,bt){if(ve&&H.getState().objectTypeToAdd){let Lt=null;switch(H.getState().objectTypeToAdd){case z.PyramidRoof:{!b&&Jo(!1,!0)&&(Lt=Ga.makePyramidRoof([t.id],ve));break}case z.GableRoof:{!b&&Jo(!1,!1)&&(Lt=Ga.makeGableRoof([t.id],ve));break}case z.HipRoof:{!b&&Jo(!1,!0)&&(Lt=Ga.makeHipRoof([t.id],ve,i/2));break}case z.GambrelRoof:{!b&&Jo(!1,!1)&&(Lt=Ga.makeGambrelRoof([t.id],ve));break}case z.MansardRoof:{!b&&Jo(!1,!0)&&(Lt=Ga.makeMansardRoof([t.id],ve));break}case z.SolarPanel:{if($e&&bt){const xt=Tt($e,t),jt=H.getState().actionState;Lt=Ga.makeSolarPanel(t,H.getState().getPvModule(jt.solarPanelModelName??"SPR-X21-335-BLK"),xt.x/i,0,xt.z/l,jt.solarPanelOrientation??vr.landscape,jt.solarPanelPoleHeight??1,jt.solarPanelPoleSpacing??3,0,0,new ie(0,-1,0),[Gt,0,0],jt.solarPanelFrameColor)}break}case z.Sensor:{if($e&&bt){const xt=Tt($e,t),jt=t.relativeAngle-Gt;Lt=Ga.makeSensor(t,(xt.x-.05)/i,0,(xt.z-.05)/l,new ie(Math.cos(jt),Math.sin(jt),0),[0,0,0])}break}case z.Light:{if($e&&bt){const xt=Tt($e,t),jt=t.relativeAngle-Gt,Kt=H.getState().actionState;Lt=Ga.makeLight(t,2,Kt.lightDistance,Kt.lightIntensity,Kt.lightColor,(xt.x-.05)/i,0,(xt.z-.05)/l,new ie(Math.cos(jt),Math.sin(jt),0),[0,0,0])}break}case z.BatteryStorage:{if($e&&bt){const xt=Tt($e,t);H.getState().actionState,Lt=Ga.makePowerWall(t,xt.x/i,0,xt.z/l)}break}}Lt&&(Jn(Lt),_(xt=>{xt.elements.push(Lt),Lt&&Lt.type===z.Roof&&xt.addedRoofIdSet.add(Lt.id),xt.actionModeLock||(xt.objectTypeToAdd=z.None)}))}}function Ui($e,bt,Lt){Ee.current||($(n,$e,Oo.ContextMenu),_(xt=>{$e.intersections.length>0&&$e.intersections[0].object===bt&&(xt.contextMenuObjectType=z.Wall,Lt&&xt.pastePoint.copy($e.intersections[0].point))}),$e.stopPropagation())}function da($e){if($e.button===2)return;const bt=H.getState().objectTypeToAdd;!xo()&&!le()&&Vr($e)&&bt===z.None?H.getState().groupActionMode?(_(Lt=>{for(const xt of Lt.elements)xt.id===y?xt.selected=!0:xt.selected=!1}),$e.stopPropagation()):Qo()&&H.getState().selectMe(n,$e,Oo.Select):Cn.isTypeRoof(bt)&&Ai($e)}function Bl($e){$e.button===2||$e.intersections.length===0||$e.intersections[0].object!==$e.eventObject||(H.getState().groupActionMode?_(bt=>{for(const Lt of bt.elements)Lt.selected=Lt.id===y;bt.selectedElementIdSet.clear(),bt.selectedElementIdSet.add(y)}):(Qt($e)&&(_(bt=>{bt.contextMenuObjectType=null}),$(n,$e,Oo.Select)),Zs(),$e.stopPropagation()))}function Gl($e){$e.intersections.length>0&&$e.intersections[0].object===$e.eventObject&&($(n,$e,Oo.ContextMenu),_(bt=>{bt.contextMenuObjectType=z.Wall}),$e.stopPropagation())}function qu(){let[$e,bt]=v??[0,(ot+st)/2];$e=$e*i;const Lt=$e+Ke,xt=Math.hypot(Lt,bt-ot),jt=-Math.atan2(bt-ot,Lt),Kt=Ke-$e,sn=Math.hypot(Kt,st-bt),yn=-Math.atan2(st-bt,Kt);return h.jsxs("group",{name:`wall stud group ${n}`,children:[Fe.map(([An,bn],Ln)=>{let Yn;return An<$e?Yn=(An+Ke)*(bt-ot)/($e+Ke)+ot-bn:Yn=(An-Ke)*(bt-st)/($e-Ke)+st-bn,h.jsx(Qr,{args:[R,a,Yn],position:[An,Ne,(Yn-l)/2+bn],castShadow:re,receiveShadow:re,onContextMenu:Gl,onPointerDown:Bl,children:h.jsx("meshStandardMaterial",{color:M})},Ln)}),h.jsx(Qr,{args:[xt,a,a],position:[-Ke+Lt/2,Ne,(ot+bt)/2-De-a/2],rotation:[0,jt,0],castShadow:re,receiveShadow:re,onContextMenu:Gl,onPointerDown:Bl,children:h.jsx("meshStandardMaterial",{color:M})}),h.jsx(Qr,{args:[sn,a,a],position:[Ke-Kt/2,Ne,(st+bt)/2-De-a/2],rotation:[0,yn,0],castShadow:re,receiveShadow:re,onContextMenu:Gl,onPointerDown:Bl,children:h.jsx("meshStandardMaterial",{color:M})})]})}function Rc(){let[$e,bt]=v??[0,(ot+st)/2];$e=$e*i;const Lt=$e+Ke,xt=Math.hypot(Lt,bt-ot),jt=-Math.atan2(bt-ot,Lt),Kt=Ke-$e,sn=Math.hypot(Kt,st-bt),yn=-Math.atan2(st-bt,Kt),An=a;return h.jsxs("group",{name:`wall pillar group ${n}`,position:[0,-a/2,0],children:[Fe.map(([bn,Ln],Yn)=>{let Wn;return bn<$e?Wn=(bn+Ke)*(bt-ot)/($e+Ke)+ot-Ln:Wn=(bn-Ke)*(bt-st)/($e-Ke)+st-Ln,h.jsx(ca,{args:[R/2,R/2,Wn],position:[bn,Ne,(Wn-l)/2+Ln],rotation:[-Gt,0,0],castShadow:re,receiveShadow:re,onContextMenu:Gl,onPointerDown:Bl,children:h.jsx("meshStandardMaterial",{color:M})},Yn)}),h.jsx(Qr,{args:[xt,R,An],position:[-Ke+Lt/2,Ne,(ot+bt)/2-De-An/2],rotation:[0,jt,0],castShadow:re,receiveShadow:re,onContextMenu:Gl,onPointerDown:Bl,children:h.jsx("meshStandardMaterial",{color:M})}),h.jsx(Qr,{args:[sn,R,An],position:[Ke-Kt/2,Ne,(st+bt)/2-De-An/2],rotation:[0,yn,0],castShadow:re,receiveShadow:re,onContextMenu:Gl,onPointerDown:Bl,children:h.jsx("meshStandardMaterial",{color:M})})]})}return h.jsxs(h.Fragment,{children:[(D>0||x===gc.Default)&&h.jsxs(h.Fragment,{children:[h.jsxs("mesh",{name:"Wall Simulation Mesh",uuid:n,userData:{simulation:!0},rotation:[Gt,0,0],castShadow:!1,receiveShadow:!1,visible:!1,children:[h.jsx("shapeGeometry",{args:[At]}),h.jsx("meshBasicMaterial",{side:$r})]}),h.jsxs("mesh",{name:`${Eu.WALL_OUTSIDE_SURFACE_MESH_NAME} ${n}`,ref:Ae,rotation:[Gt,0,0],castShadow:Oe,receiveShadow:re,onContextMenu:$e=>{Ui($e,Ae.current,!0)},onPointerMove:or,onPointerDown:Ai,onPointerUp:ka,onPointerOut:wi,children:[h.jsx("shapeGeometry",{args:[At]}),ge&&He?h.jsx("meshBasicMaterial",{attach:"material",map:He,color:"white",opacity:D,transparent:Ve}):h.jsx("meshStandardMaterial",{attach:"material",color:d===Uo.Default||d===Uo.NoTexture?f:"white",map:O,transparent:Ve,opacity:D})]}),h.jsxs("mesh",{rotation:[Gt,0,0],position:[0,.05,0],castShadow:Oe,children:[h.jsx("shapeGeometry",{args:[kt]}),h.jsx("meshStandardMaterial",{color:"white",side:p0,transparent:Ve,opacity:D})]}),h.jsxs("mesh",{name:"Inside Wall",ref:Te,position:[0,a,0],rotation:[Gt,0,0],castShadow:Oe,receiveShadow:re,onPointerDown:da,onContextMenu:$e=>{Ui($e,Te.current)},children:[h.jsx("shapeGeometry",{args:[kt]}),h.jsx(Ien,{transparent:Ve,color:f,opacity:D})]}),h.jsxs("mesh",{rotation:[Gt,0,0],position:[0,a-.01,0],receiveShadow:!0,children:[h.jsx("shapeGeometry",{args:[kt]}),h.jsx("meshStandardMaterial",{color:"white",side:Ra,transparent:Ve,opacity:D})]}),(!b||at)&&!Ze&&h.jsx("mesh",{name:"Top Wall",ref:Me,material:Ut,position:[0,Ne,gt],rotation:[0,-dt,0],castShadow:Oe,receiveShadow:re,onPointerDown:da,onContextMenu:$e=>{Ui($e,Me.current)},children:h.jsx("shapeGeometry",{args:[Ct]})}),Ye===0&&h.jsx(ua,{args:[ot-ut,a],material:Ut,position:[-Ke+.01,Ne,-De+ut+(ot-ut)/2],rotation:[0,Gt,0],castShadow:Oe,receiveShadow:re,onPointerDown:da}),it===0&&h.jsx(ua,{args:[st-ft,a],material:Ut,position:[Ke-.01,Ne,-De+ft+(st-ft)/2],rotation:[0,Gt,0],castShadow:Oe,receiveShadow:re,onPointerDown:da}),(he||Z===n)&&((pn=H.getState().selectedElement)==null?void 0:pn.parentId)===n&&h.jsxs(h.Fragment,{children:[h.jsx(ua,{ref:Pe,name:Men,args:[1e4,1e4],position:[0,a/3,0],rotation:[Gt,0,0],onPointerMove:Fs,onPointerUp:ks,visible:!1,children:h.jsx("meshBasicMaterial",{color:"blue",side:$r})}),h.jsx(ua,{name:$ie,args:[i,l],rotation:[Gt,0,0],position:[0,a,0],onPointerMove:()=>{},visible:!1})]}),ye.map($e=>{switch($e.type){case z.Window:return h.jsx(L$e,{...$e,cx:$e.cx*i,cy:$e.cy*a,cz:$e.cz*l,lx:$e.lx*i,ly:a,lz:$e.lz*l},$e.id);case z.Door:return E!==El.Full?null:h.jsx(xen,{...$e,cx:$e.cx*i,cy:0,cz:$e.cz*l,lx:$e.lx*i,ly:a,lz:$e.lz*l},$e.id);default:return null}})]}),ye.map($e=>$e.type===z.Polygon&&E!==El.Empty?h.jsx(eQe,{...$e},$e.id):null),x===gc.Stud&&qu(),x===gc.Pillar&&Rc(),Ze&&h.jsx(Cen,{args:N,wallData:qe,parapetZ:St,currWallPointData:je,leftWallPointData:rt,rightWallPointData:mt}),(x===gc.Default||w&&B)&&h.jsx(den,{lineColor:B&&w?y0:p,lineWidth:B&&w?2:g,hx:Ke,hz:De,fill:E,isTopPartial:at,leftUnfilledHeight:W,rightUnfilledHeight:j,showParapet:Ze,leftHeight:ot,rightHeight:st,center:v,centerLeft:T,centerRight:A}),B&&h.jsx(Uye,{element:t,verticalLift:0}),(he||Z===n)&&((Pn=H.getState().selectedElement)==null?void 0:Pn.parentId)===n&&h.jsx("group",{position:[0,-.001,0],rotation:[Gt,0,0],children:h.jsx(Gge,{hx:Ke,hy:De,hz:0})}),h.jsx(Hen,{wallModel:t,notBuilding:ve.notBuilding})]})};function tQe(t){const e=H.getState().getPvModule(t.pvModelName);return t.orientation===vr.landscape?[e.length,e.width]:[e.width,e.length]}const Den=(t,e)=>t.wallModel===e.wallModel,Een=be.memo(zen,Den);class Cn{static getWireframetStyle(e,n,o,r){return[o&&r?y0:e,o&&r?1:n]}static getComposedWallNormal(e){return new ie().subVectors(e.leftPoint,e.rightPoint).applyEuler(gG).normalize()}static getWallNormal(e){return new ie().subVectors(new ie(e.leftPoint[0],e.leftPoint[1]),new ie(e.rightPoint[0],e.rightPoint[1])).applyEuler(gG).normalize()}static isTypeRoof(e){return e===z.Roof||e===z.PyramidRoof||e===z.HipRoof||e===z.GableRoof||e===z.GambrelRoof||e===z.MansardRoof}static getIntersectionPoint(e,n,o,r){if(Math.abs(e.x-n.x)<.001&&Math.abs(o.x-r.x)<.001)return n.clone();const i=(n.y-e.y)/(n.x-e.x),a=(r.y-o.y)/(r.x-o.x);if(Math.abs(i-a)<.001)return n.clone();const l=[e.x,n.x,o.x,r.x],s=[e.y,n.y,o.y,r.y],c=((l[2]-l[3])*(l[1]*s[0]-l[0]*s[1])-(l[0]-l[1])*(l[3]*s[2]-l[2]*s[3]))/((l[2]-l[3])*(s[0]-s[1])-(l[0]-l[1])*(s[2]-s[3])),u=((s[2]-s[3])*(s[1]*l[0]-s[0]*l[1])-(s[0]-s[1])*(s[3]*l[2]-s[2]*l[3]))/((s[2]-s[3])*(l[0]-l[1])-(s[0]-s[1])*(l[2]-l[3]));return!Number.isFinite(c)||!Number.isFinite(u)?n.clone():new ie(c,u)}static getDistance(e,n,o){const r=n.y-e.y;if(r===0)return Math.abs(e.y-o.y);const i=e.x-n.x;if(i===0)return Math.abs(e.x-o.x);const a=n.x*e.y-e.x*n.y,l=Math.abs((r*o.x+i*o.y+a)/Math.sqrt(r*r+i*i));return l===0?1/0:l}static getWallPoints2D(e,n,o,r){const{lx:i,lz:a,rightRoofHeight:l,leftRoofHeight:s}=e,c=o??e.centerLeftRoofHeight,u=n??e.centerRoofHeight,d=r??e.centerRightRoofHeight,f=[],p=i/2,g=a/2;return f.push({x:-p,y:-g}),f.push({x:p,y:-g}),l?f.push({x:p,y:l-g}):f.push({x:p,y:g}),d&&f.push({x:d[0]*i,y:d[1]-g}),u&&f.push({x:u[0]*i,y:u[1]-g}),c&&f.push({x:c[0]*i,y:c[1]-g}),s?f.push({x:-p,y:s-g}):f.push({x:-p,y:g}),f}static isPointInside(e,n,o){let r=!1;for(let i=0,a=e.length-1;io!=u>o&&n<(c-l)*(o-s)/(u-s)+l&&(r=!r)}return r}static isRoofValid(e,n,o,r,i,a){for(const l of H.getState().elements)if(l.type===z.Wall&&l.roofId===e){const s=l;let c=[];if(s.id===n)c=Cn.getWallPoints2D(s,r,i,a);else if(s.id===o){let u,d,f;r&&(u=[-r[0],r[1]]),a&&(d=[-a[0],a[1]]),i&&(f=[-i[0],i[1]]),c=Cn.getWallPoints2D(s,u,d,f)}if(s.id===n||s.id===o){for(const u of H.getState().elements)if(u.parentId===s.id){let d=u.lx/2,f=u.lz/2,p=sP;u.type===z.SolarPanel&&(d=(d-.01)/s.lx,f=(u.ly/2-.01)/s.lz,p=0);const g=u.cx*s.lx-d*s.lx,y=u.cx*s.lx+d*s.lx,w=u.cz*s.lz+f*s.lz+p;if(!Cn.isPointInside(c,g,w)||!Cn.isPointInside(c,y,w))return!1}}}return!0}static getSegmentIdx(e,n){for(let o=0;oi.z){const u=[l,a,r];return me.isPointInside(o.x,o.y,u.map(me.mapVector3ToPoint2))?[r,a,l]:[r,i,a]}else{const u=[l,a,i];return me.isPointInside(o.x,o.y,u.map(me.mapVector3ToPoint2))?[i,a,l]:[i,l,r]}else if(s<=c){const u=[l,a,i];return me.isPointInside(o.x,o.y,u.map(me.mapVector3ToPoint2))?[i,a,l]:[i,l,r]}else{const u=[l,a,r];return me.isPointInside(o.x,o.y,u.map(me.mapVector3ToPoint2))?[r,a,l]:[r,i,a]}}static getSegmentNormal(e){const[n,o,r]=e;return new ie().crossVectors(new ie().subVectors(n,o),new ie().subVectors(n,r)).normalize()}static getRotationFromNormal(e){return me.isSame(e.normalize(),Io)?[0,0,0]:[Math.PI/2-Math.atan2(e.z,Math.hypot(e.x,e.y)),0,Math.atan2(e.y,e.x)+Math.PI/2]}static getRooftopElementZ(e,n,o){const[r,i,a]=e,l=(i.y-r.y)*(a.z-r.z)-(i.z-r.z)*(a.y-r.y),s=(i.z-r.z)*(a.x-r.x)-(i.x-r.x)*(a.z-r.z),c=(i.x-r.x)*(a.y-r.y)-(i.y-r.y)*(a.x-r.x);return-(-(l*r.x+s*r.y+c*r.z)+l*n.x+s*n.y)/c+o}static computeState(e,n,o){const r=Cn.getSegmentIdx(e,n);if(o)return{segmentIdx:-1,segmentVertices:null,normal:new ie(0,0,1),rotation:[0,0,0]};if(r!==-1){const i=Cn.getSegmentVertices(e,r,n),a=Cn.getSegmentNormal(i),l=Cn.getRotationFromNormal(a);return{segmentIdx:r,segmentVertices:i,normal:a,rotation:l}}else return{segmentIdx:-1,segmentVertices:null,normal:new ie(0,0,1),rotation:[0,0,0]}}static getOrderedWallArrayOfRoof(e){const n=new Map;for(const a of H.getState().elements)a.type===z.Wall&&a.roofId===e&&n.set(a.id,a);if(n.size===0)return{orderedWallArray:[],isLoop:!1};const o=n.entries().next().value[1],r=[o];let i=o.rightJoints[0];for(;i&&i!==o.id;){const a=n.get(i);if(a)r.push(a),i=a.rightJoints[0];else break}if(i===o.id)return{orderedWallArray:r,isLoop:!0};for(i=o.leftJoints[0];i;){const a=n.get(i);if(a)r.unshift(a),i=a.leftJoints[0];else break}return{orderedWallArray:r,isLoop:!1}}static getRoofBoundaryVertices(e){const n=Tn.getState().roofSegmentVerticesMap.get(e.id);if(!n)throw new Error;if(e.roofType!==Go.Gable&&e.rise<.01)return n[0].map(o=>({x:o.x,y:o.y}));switch(e.roofType){case Go.Gable:return n.length===1?n[0].map(o=>({x:o.x,y:o.y})):n.reduce((o,r)=>(o.push({x:r[0].x,y:r[0].y},{x:r[1].x,y:r[1].y}),o),[]);case Go.Gambrel:return n.reduce((o,r,i)=>((i===0||i===3)&&o.push({x:r[0].x,y:r[0].y},{x:r[1].x,y:r[1].y}),o),[]);case Go.Mansard:return n.reduce((o,r,i)=>(i!==n.length-1&&o.push({x:r[0].x,y:r[0].y}),o),[]);default:return n.reduce((o,r,i)=>(o.push({x:r[0].x,y:r[0].y}),o),[])}}static getAbsoluteWindowVerticesOnRoof(e,n){const o=[],r=new ie(e.cx,e.cy,e.cz),i=new ie(n.cx,n.cy,n.lz);if(e.windowType===Ti.Arched){const a=Math.min(e.archHeight,e.lx/2,e.lz);for(let s=-1;s<=1;s+=2)for(let c=-1;c<=1;c+=2){const u=s*c>0?new ie(e.lx/2*s,(e.lz/2-a)*c*s,0):new ie(e.lx/2*s,e.lz/2*c*s,0);u.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(r),u.applyEuler(new nn(0,0,n.rotation[2],"ZXY")).add(i),o.push(u)}const l=new ie(0,e.lz/2,0);l.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(r),l.applyEuler(new nn(0,0,n.rotation[2],"ZXY")).add(i),o.push(l)}else{for(let a=-1;a<=1;a+=2)for(let l=-1;l<=1;l+=2){const s=new ie(e.lx/2*a,e.lz/2*l*a,0);s.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(r),s.applyEuler(new nn(0,0,n.rotation[2],"ZXY")).add(i),o.push(s)}if(e.windowType===Ti.Polygonal&&e.polygonTop){const a=new ie(e.lx*e.polygonTop[0],e.lz/2+e.polygonTop[1],0);a.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(r),a.applyEuler(new nn(0,0,n.rotation[2],"ZXY")).add(i),o.push(a)}}return o}static getRelativeWindowVerticesOnRoof(e){const n=[],o=new ie(e.cx,e.cy,e.cz);if(e.windowType===Ti.Arched){const r=Math.min(e.archHeight,e.lx/2,e.lz);for(let a=-1;a<=1;a+=2)for(let l=-1;l<=1;l+=2){const s=a*l>0?new ie(e.lx/2*a,(e.lz/2-r)*l*a,0):new ie(e.lx/2*a,e.lz/2*l*a,0);s.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(o),n.push(s)}const i=new ie(0,e.lz/2,0);i.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(o),n.push(i)}else{for(let r=-1;r<=1;r+=2)for(let i=-1;i<=1;i+=2){const a=new ie(e.lx/2*r,e.lz/2*i*r,0);a.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(o),n.push(a)}if(e.windowType===Ti.Polygonal&&e.polygonTop){const r=new ie(e.lx*e.polygonTop[0],e.lz/2+e.polygonTop[1],0);r.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(o),n.push(r)}}return n}static getAbsoluteSolarPanelVerticesOnRoof(e,n){const o=[],r=new ie(e.cx,e.cy,e.cz),i=new ie(n.cx,n.cy,n.cz);for(let a=-1;a<=1;a+=2)for(let l=-1;l<=1;l+=2){const s=new ie(e.lx/2*a,e.ly/2*l*a,0);e.rotation[0]===0?s.applyEuler(new nn(e.tiltAngle,0,e.relativeAzimuth,"ZXY")).add(r):s.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(r),s.applyEuler(new nn(0,0,n.rotation[2],"ZXY")).add(i),o.push(s)}return o}static getSolarPanelVerticesOnRoof(e,n){const o=[],r=new ie(e.cx,e.cy,e.cz+n.cz);for(let i=-1;i<=1;i+=2)for(let a=-1;a<=1;a+=2){const l=new ie(e.lx/2*i,e.ly/2*a*i,0);e.rotation[0]===0?l.applyEuler(new nn(e.tiltAngle,0,e.relativeAzimuth,"ZXY")).add(r):l.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(r),o.push(l)}return o}static getWindowVerticesOnRoof(e,n=0){const o=[],r=new ie(e.cx,e.cy,e.cz),[i,a]=[e.lx/2+n,e.lz/2+n];for(let l=-1;l<=1;l+=2)for(let s=-1;s<=1;s+=2){const c=new ie(l*i,l*s*a);c.applyEuler(new nn().fromArray([e.rotation[0],e.rotation[1],e.rotation[2],"ZXY"])).add(r),o.push(c)}if(e.windowType===Ti.Polygonal){const[l,s]=e.polygonTop??Gp,c=new ie(l*e.lx,e.lz+s).add(r);o.push(c)}return o}static rooftopElementBoundaryCheck(e,n){for(const o of e)if(!me.isPointInside(o.x,o.y,n))return!1;return!0}static rooftopWindowCollisionCheck(e,n,o){const r=[];for(const i of H.getState().elements)if(i.parentId===o&&i.id!==e){const a=Cn.getWindowVerticesOnRoof(i);r.push(a)}for(const i of r){for(const a of n)if(me.isPointInside(a.x,a.y,i))return!1;for(const a of i)if(me.isPointInside(a.x,a.y,n))return!1}return!0}static rooftopSPCollisionCheck(e,n,o){for(const r of H.getState().elements)if(r.type===e.type&&r.parentId===e.parentId&&r.id!==e.id){const i=Cn.getSolarPanelVerticesOnRoof(r,n);for(const s of o)if(me.isPointInside(s.x,s.y,i))return!1;for(const s of i)if(me.isPointInside(s.x,s.y,o))return!1;const a=o.map(me.mapVector3ToPoint2),l=i.map(me.mapVector3ToPoint2);a.push(a[0]),l.push(l[0]);for(let s=0;s0){for(const i of r)if(!i.leftJoints||i.leftJoints.length===0||!i.rightJoints||i.rightJoints.length===0)return jc.WALL_DISJOINED}return jc.COMPLETE}static calculateBuildingArea(e){const n=Do.getWallPointsOfRoof(e);return Do.getPolygonArea(n)}static toUValueInUS(e){return e/5.67826}static toUValueInSI(e){return e*5.67826}static toRValueInUS(e){return e*5.67826}static toRValueInSI(e){return e/5.67826}static fetchWaterTexture(e,n){const o=document.createElement("canvas");o.width=e,o.height=n;const r=o.getContext("2d");if(r){const i=r.createRadialGradient(e/2,n/2,0,e/2,n/2,Math.max(e,n)/2);i.addColorStop(0,"#45AAEA"),i.addColorStop(.04,"#2B65EC"),i.addColorStop(.2,"#0000FF"),r.fillStyle=i,r.fillRect(0,0,e,n)}return new XP(o)}static fetchWhiteTexture(e,n){const o=document.createElement("canvas");o.width=e,o.height=n;const r=o.getContext("2d");return r&&(r.fillStyle="white",r.fillRect(0,0,e,n)),new XP(o)}static fetchIntersectables(e){const n=[];return e.traverse(o=>{o.userData.unintersectable||n.push(o)}),n}static fetchSimulationElements(e,n){if(e.userData.simulation&&n.push(e),e.children.length>0)for(const o of e.children)Do.fetchSimulationElements(o,n)}static getSimulationElements(e,n,o){if(e.userData.simulation&&e.uuid!==o&&n.push(e),e.children.length>0)for(const r of e.children)Do.getSimulationElements(r,n,o)}static hasMovingParts(e){for(const n of e)switch(n.type){case z.ParabolicDish:case z.ParabolicTrough:case z.FresnelReflector:case z.Heliostat:return!0;case z.SolarPanel:if(n.trackerType!==za.NO_TRACKER)return!0}return!1}static onBuildingEnvelope(e){return e.type===z.Foundation||e.type===z.Window||e.type===z.Door||e.type===z.Wall||e.type===z.Roof}static getWindowArea(e,n){if(n){if(e.windowType===Ti.Arched&&e.archHeight>0){const o=.5*e.lx*n.lx,r=e.lz*n.lz,i=Math.min(e.archHeight,r,o),a=.5*(i+o*o/i),l=Math.acos(Math.min(o/a,1));return .5*(Math.PI-l*2)*a*a-o*(a-i)+(r-i)*o*2}else if(e.windowType===Ti.Polygonal&&e.polygonTop){let o=e.lx*e.lz*n.lx*n.lz;return o+=e.lx*n.lx*e.polygonTop[1]/2,o}return e.lx*e.lz*n.lx*n.lz}else{if(e.windowType===Ti.Arched&&e.archHeight>0){const o=.5*e.lx,r=e.lz,i=Math.min(e.archHeight,r,o),a=.5*(i+o*o/i),l=Math.acos(Math.min(o/a,1));return .5*(Math.PI-l*2)*a*a-o*(a-i)+(r-i)*o*2}else if(e.windowType===Ti.Polygonal&&e.polygonTop){let o=e.lx*e.lz;return o+=e.lx*e.polygonTop[1]/2,o}return e.lx*e.lz}}static getDoorArea(e,n){if(n){if(e.doorType===Pd.Arched&&e.archHeight>0){const o=.5*e.lx*n.lx,r=e.lz*n.lz,i=Math.min(e.archHeight,r,o),a=.5*(i+o*o/i),l=Math.acos(Math.min(o/a,1));return .5*(Math.PI-l*2)*a*a-o*(a-i)+(r-i)*o*2}return e.lx*e.lz*n.lx*n.lz}else{if(e.doorType===Pd.Arched&&e.archHeight>0){const o=.5*e.lx,r=e.lz,i=Math.min(e.archHeight,r,o),a=.5*(i+o*o/i),l=Math.acos(Math.min(o/a,1));return .5*(Math.PI-l*2)*a*a-o*(a-i)+(r-i)*o*2}return e.lx*e.lz}}static hasHeliostatOrFresnelReflectors(e){for(const n of e)if(n.type===z.FresnelReflector||n.type===z.Heliostat)return!0;return!1}static lineIntersection(e,n,o,r){const i=n.x-e.x,a=n.y-e.y,l=i*(r.y-o.y)-(r.x-o.x)*a;if(l===0)return;const s=((r.y-o.y)*(r.x-e.x)+(o.x-r.x)*(r.y-e.y))/l,c=((e.y-n.y)*(r.x-e.x)+i*(r.y-e.y))/l;if(!(!(0<=s&&s<=1)||!(0<=c&&c<=1)))return{x:e.x+s*i,y:e.y+s*a}}static calculateSolarRadiationColor(e,n){const o=n/(Rz.length-1);let r=Math.max(0,Math.floor(e/o));r>Rz.length-2&&(r=Rz.length-2);const i=Math.min(1,(e-o*r)/o);return new rr(Rz[r]).lerp(Rz[r+1],i)}static transpose(e){return e[0].map((n,o)=>e.map(r=>r[o]))}static clone2DArray(e){return e.map(n=>[...n])}static fetchHeatmapTexture(e,n,o){if(!e)return null;const r=document.createElement("canvas"),i=e.length,a=e[0].length;r.width=i,r.height=a;const l=r.getContext("2d");if(l){l.clearRect(0,0,i,a);const s=l.getImageData(0,0,i,a),c=s.data;for(let u=0;un!=u>n&&e<(c-l)*(n-s)/(u-s)+l&&(r=!r)}return r}static getPoints(e){const n=[];for(const o of e)n.push({x:o.x,y:o.y});return n}static polygonIntersections(e,n,o){const r=new Array;let i,a,l;for(let s=0;s0&&(n>l.x&&(n=l.x),r>l.y&&(r=l.y),o=o||Math.abs(a)>=r)return!1;const l=e.rightPoint[0],s=e.rightPoint[1];return!(Math.abs(l)>=o||Math.abs(s)>=r)}static isSensorWithin(e,n){return Math.abs(e.cx)<.5-e.lx/n.lx&&Math.abs(e.cy)<.5-e.ly/n.ly}static isSolarCollectorWithinHorizontalSurface(e,n){const o=e.cx,r=e.cy,i=Math.cos(e.relativeAzimuth),a=Math.sin(e.relativeAzimuth),l=n.lx*.5,s=n.ly*.5,c=e.lx*.5,u=e.ly*.5*Math.cos(e.tiltAngle);let d=o+c*i-u*a,f=r+c*a+u*i;return!(Math.abs(d)>l||Math.abs(f)>s||(d=o+c*i+u*a,f=r+c*a-u*i,Math.abs(d)>l||Math.abs(f)>s)||(d=o-c*i-u*a,f=r-c*a+u*i,Math.abs(d)>l||Math.abs(f)>s)||(d=o-c*i+u*a,f=r-c*a-u*i,Math.abs(d)>l||Math.abs(f)>s))}static isWindTurbineWithinHorizontalSurface(e,n){return Math.abs(e.cx)<=.5&&Math.abs(e.cy)<=.5}static isUnitVectorX(e){return Do.isSame(e,Op)||Do.isSame(e,_p)}static isUnitVectorY(e){return Do.isSame(e,Oc)||Do.isSame(e,Vp)}static isSame(e,n){return Math.abs(e.x-n.x)It)return!1;return!0}static isEqual(e,n){return Math.abs(e-n)-1&&e.splice(o,1)}static fixElements(e){const n=[];for(const o of e)o.type||n.push(o);if(n.length>0)for(const o of n)Do.deleteElement(e,o)}static fixViewStateLight(e){e.ambientLightIntensity&&(e.ambientLightIntensity*=2),e.directLightIntensity&&(e.directLightIntensity*=3.5)}static isResizingVertical(e){switch(e){case vt.LowerLeftTop:case vt.UpperLeftTop:case vt.LowerRightTop:case vt.UpperRightTop:return!0;default:return!1}}static isTopResizeHandle(e){return e===vt.LowerLeftTop||e===vt.LowerRightTop||e===vt.UpperLeftTop||e===vt.UpperRightTop||e===vt.Top}static isXResizeHandle(e){return e===vt.Left||e===vt.Right}static isYResizeHandle(e){return e===vt.Upper||e===vt.Lower}static isTopResizeHandleOfWall(e){return e===vt.UpperLeft||e===vt.UpperRight}static isRiseHandleOfRoof(e){return e===Lr.Top||e===Lr.Mid||e===Lr.TopMid}static isMoveHandle(e){return e===Ho.Default||e===Ho.Top||e===Ho.Upper||e===Ho.Lower||e===Ho.Left||e===Ho.Right}static snapToNormalGrid(e){const n=Math.round(e.x/S6)*S6,o=Math.round(e.y/S6)*S6;return new ie(n,o,e.z)}static snapToFineGrid(e){const n=Math.round(e.x/m9)*m9,o=Math.round(e.y/m9)*m9;return new ie(n,o,e.z)}static isPositionRelative(e){return e===z.SolarPanel||e===z.ParabolicTrough||e===z.ParabolicDish||e===z.FresnelReflector||e===z.Heliostat||e===z.WindTurbine||e===z.WaterHeater||e===z.Sensor||e===z.Light||e===z.Polygon||e===z.Window||e===z.Door||e===z.Roof||e===z.Wall}static isPlantOrHuman(e){return e.type===z.Tree||e.type===z.Flower||e.type===z.Human}static isFoundationOrCuboid(e){return e.type===z.Foundation||e.type===z.Cuboid}static isSolarCollector(e){return Do.isSolarCollectorType(e.type)}static isSolarCollectorType(e){return e===z.SolarPanel||e===z.WaterHeater||Do.isCspCollectorType(e)}static isCspCollector(e){return Do.isCspCollectorType(e.type)}static isCspCollectorType(e){return e===z.ParabolicDish||e===z.ParabolicTrough||e===z.FresnelReflector||e===z.Heliostat}static isParabolicCollector(e){return Do.isParabolaType(e.type)}static isParabolaType(e){return e===z.ParabolicDish||e===z.ParabolicTrough}static isParabolicTroughOrFresnelReflector(e){return e===z.FresnelReflector||e===z.ParabolicTrough}static isHeliostatOrFresnelReflector(e){return e===z.FresnelReflector||e===z.Heliostat}static isLegalOnWall(e){switch(e){case z.Window:case z.Door:case z.Sensor:case z.Light:case z.SolarPanel:case z.Polygon:return!0}return!1}static isDescendantOf(e,n){const o=e.parentId;if(!o||o===Zo)return!1;const r=H.getState().getElementById(o);return r?r.id===n?!0:Do.isDescendantOf(r,n):!1}static isElementInsideWall(e,n,o,r,i){const a=n/2,l=o/2;for(let c=-1;c<=1;c+=2)for(let u=-1;u<=1;u+=2){if(i&&u===-1)continue;const d=e.x+a*c,f=e.z+l*u;if(!Do.isPointInside(d,f,r))return!1}const s=[{x:e.x-a,y:e.z-l},{x:e.x-a,y:e.z+l},{x:e.x+a,y:e.z+l},{x:e.x+a,y:e.z-l}];for(const c of r)if(Do.isPointInside(c.x,c.y,s))return!1;return!0}static isRectOutsideBoundary(e,n,o,r,i,a){return e+o>i||e-o<-i||n+r>a||n-r<-a}static getSolarPanelVerticesOnCuboidVerticalFace(e){const n=[],[o,r]=[e.lx/2,e.ly/2];return Do.isIdentical(e.normal,[-1,0,0])||Do.isIdentical(e.normal,[1,0,0])?(n.push({x:e.cy-o,y:e.cz-r}),n.push({x:e.cy+o,y:e.cz-r}),n.push({x:e.cy+o,y:e.cz+r}),n.push({x:e.cy-o,y:e.cz+r})):(Do.isIdentical(e.normal,[0,1,0])||Do.isIdentical(e.normal,[0,-1,0]))&&(n.push({x:e.cx-o,y:e.cz-r}),n.push({x:e.cx+o,y:e.cz-r}),n.push({x:e.cx+o,y:e.cz+r}),n.push({x:e.cx-o,y:e.cz+r})),n}static checkCollisionOnCuboidSameVerticalFace(e){for(const n of H.getState().elements)if(n.type===z.SolarPanel&&n.id!==e.id&&n.parentId===e.parentId&&Do.isIdentical(n.normal,e.normal)){const o=Do.getSolarPanelVerticesOnCuboidVerticalFace(n),r=Do.getSolarPanelVerticesOnCuboidVerticalFace(e);for(const i of o)if(Do.isPointInside(i.x,i.y,r))return!0;for(const i of r)if(Do.isPointInside(i.x,i.y,o))return!0}return!1}static checkElementOnCuboidState(e,n){if(Do.isIdentical(e.normal,[0,0,1])){if(!Do.isSolarCollectorWithinHorizontalSurface(e,n))return ga.OutsideBoundary;if(H.getState().overlapWithSibling(e))return ga.OverLap}else{const[o,r]=[e.lx/2,e.ly/2],[i,a,l]=[n.lx/2,n.ly/2,n.lz/2];if(Do.isIdentical(e.normal,[-1,0,0])||Do.isIdentical(e.normal,[1,0,0])){if(Do.isRectOutsideBoundary(e.cy,e.cz,o,r,a,l))return ga.OutsideBoundary}else if((Do.isIdentical(e.normal,[0,1,0])||Do.isIdentical(e.normal,[0,-1,0]))&&Do.isRectOutsideBoundary(e.cx,e.cz,o,r,i,l))return ga.OutsideBoundary;if(Do.checkCollisionOnCuboidSameVerticalFace(e))return ga.OverLap}return ga.Valid}static checkElementOnWallState(e,n){let r=e.lx/2+1e-5,i=e.lz/2+1e-5;n&&e.type===z.SolarPanel&&(r=r/n.lx+1e-5,i=e.ly/2/n.lz+1e-5);const a=e.cx-r,l=e.cx+r,s=e.cz-i,c=e.cz+i;if(n&&n.type===z.Wall&&!Do.isElementInsideWall(new ie(e.cx*n.lx,e.cy,e.cz*n.lz),n.lx*r*2,n.lz*i*2,Do.getWallInnerSideShapePoints(n),e.type===z.Door))return ga.OutsideBoundary;for(const u of H.getState().elements)if(Do.isLegalOnWall(u.type)&&u.type!==z.Polygon&&u.parentId===e.parentId&&u.id!==e.id){let d=u.lx/2,f=u.lz/2;n&&u.type===z.SolarPanel&&(d=d/n.lx,f=u.ly/2/n.lz);const p=u.cx-d,g=u.cx+d,y=u.cz-f,w=u.cz+f;if((a>=p&&a<=g||l>=p&&l<=g||p>=a&&p<=l||g>=a&&g<=l)&&(s>=y&&s<=w||c>=y&&c<=w||y>=s&&y<=c||w>=s&&w<=c))return ga.OverLap}return ga.Valid}static checkElementOnRoofState(e,n){if(e.foundationId){const o=H.getState().getElementById(e.foundationId);if(o){const r=Cn.getSolarPanelVerticesOnRoof(e,o),i=Cn.getRoofBoundaryVertices(n);return Cn.rooftopElementBoundaryCheck(r,i)?Cn.rooftopSPCollisionCheck(e,o,r)?ga.Valid:ga.OverLap:ga.OutsideBoundary}}return ga.Invalid}static relativeCoordinates(e,n,o,r,i){const a=new ie(e,n,o);if(r.type===z.Wall){const l=new ie(r.cx,r.cy),s=H.getState().getParent(r);if(s){const c=new ie(s.cx,s.cy);l.applyEuler(new nn(0,0,s.rotation[2])).add(c).setZ(s.lz+r.lz/2),a.sub(l).applyEuler(new nn(0,0,-r.relativeAngle-s.rotation[2]))}}else{const{pos:l,rot:s}=Do.getWorldDataById(r.id);a.set(e-l.x,n-l.y,o-l.z),a.applyEuler(new nn(0,0,-s))}return i||(a.x/=r.lx,a.y/=r.ly,a.z/=r.lz),a}static absoluteCoordinates(e,n,o,r,i,a,l){if(r.type===z.Wall&&i){const c=r,u=i?i.rotation[2]+c.relativeAngle:c.relativeAngle;if(u!==void 0){const d=Do.wallAbsolutePosition(new ie(c.cx,c.cy,c.cz),i).setZ(c.lz/2+i.lz),f=new ie(e*c.lx,n*c.ly,o*c.lz);if(f.applyAxisAngle(Io,u),a){const p=a*Math.cos(u-Gt),g=a*Math.sin(u-Gt);return new ie(d.x+f.x+p,d.y+f.y+g,d.z+f.z)}return new ie(d.x+f.x,d.y+f.y,d.z+f.z)}}if(r.type===z.Roof&&i){const c=new ie(e,n,o+i.cz);return c.applyEuler(new nn().fromArray(i.rotation)),c.x+=i.cx,c.y+=i.cy,c}const s=new ie;return l?s.set(e,n,o):s.set(e*r.lx,n*r.ly,o*r.lz),s.applyEuler(new nn().fromArray(r.rotation)),s.x+=r.cx,s.y+=r.cy,s.z+=r.cz,s}static absoluteHumanOrTreeCoordinates(e,n,o,r){const i=new ie(e,n,o);return i.applyEuler(new nn().fromArray(r.rotation)),i.x+=r.cx,i.y+=r.cy,i.z+=r.cz,i}static relativePoint(e,n){const o=new ie(e.x-n.cx,e.y-n.cy,e.z-n.cz);return o.applyEuler(new nn().fromArray(n.rotation.map(r=>-r))),o}static wallAbsolutePosition(e,n){const o=new ie(n.cx,n.cy);return new ie().addVectors(o,new ie(e.x,e.y).applyAxisAngle(Io,n.rotation[2]))}static wallRelativePosition(e,n){const o=new ie(n.cx,n.cy);return new ie().subVectors(new ie(e.x,e.y),o).applyAxisAngle(Io,-n.rotation[2])}static getObjectChildById(e,n){if(e){for(const o of e.children)if(o.name===Ov){const r=Do.getStackCuboidObjectById(o,n);if(r)return r}else if(o.name.includes(n))return o}return null}static getStackCuboidObjectById(e,n){if(e)for(const o of e.children){if(o.name.includes(n))return o;if(o.name===C$e){const r=Do.getStackCuboidObjectById(o.children[0],n);if(r)return r}}return null}static toRadians(e){return e*(Math.PI/180)}static toDegrees(e){return e*(180/Math.PI)}static getArrayMax(e){return e.reduce((n,o)=>Math.max(n,o))}static getArrayMin(e){return e.reduce((n,o)=>Math.min(n,o))}static getArrayMax2D(e){return Do.getArrayMax(e.map(Do.getArrayMax))}static getArrayMin2D(e){return Do.getArrayMin(e.map(Do.getArrayMin))}static sphericalToCartesianZ(e){const n=e.x*Math.cos(e.z),o=n*Math.cos(e.y),r=n*Math.sin(e.y),i=e.x*Math.sin(e.z);return e.set(o,r,i),e}static getDistance(e,n,o,r){return e=Do.toRadians(e),n=Do.toRadians(n),o=Do.toRadians(o),r=Do.toRadians(r),Math.acos(Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos(Math.abs(e-o)))}static minutesIntoDay(e){return e.getHours()*60+e.getMinutes()}static dayOfYear(e){return(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())-Date.UTC(e.getFullYear(),0,0))/864e5}static daysInYear(e){const n=e.getFullYear();return n%4===0&&n%100>0||n%400===0?366:365}static daysOfMonth(e,n){return new Date(n,e+1,0).getDate()}static fahrenheitToCelsius(e){return(e-32)*5/9}static celsiusToFahrenheit(e){return e*(9/5)+32}static getOS(){var e;return(e=QUe.os)==null?void 0:e.family}static isMac(){const e=Do.getOS();return e?e.includes("Mac")||e.includes("OS X"):!1}static isChrome(){const e=Do.getOS();return e?e.includes("Chrome"):!1}static detectWebGLContext(){try{const e=document.createElement("canvas");return!!window.WebGLRenderingContext&&(!!e.getContext("webgl")||!!e.getContext("experimental-webgl"))}catch{return!1}}static clamp(e,n,o){return n>o?(n+o)/2:Math.min(Math.max(e,n),o)}static distanceFromPointToLine2D(e,n,o){const[r,i]=[e.x,e.y],[a,l]=[n.x,n.y],[s,c]=[o.x,o.y],u=r-a,d=i-l,f=s-a,p=c-l,g=u*f+d*p,y=f*f+p*p;let w=-1;y!==0&&(w=g/y);let b,C;w<0?(b=a,C=l):w>1?(b=s,C=c):(b=a+w*f,C=l+w*p);const P=r-b,v=i-C;return Math.sqrt(P*P+v*v)}static mapVector3ToPoint2(e){return{x:e.x,y:e.y}}static getWallVertices(e,n){const o=e.lx/2,r=e.lz/2,i={x:-o-n,y:-r-n},a={x:o+n,y:-r-n},l={x:-o-n,y:(e.leftRoofHeight??e.lz)-r+n},s={x:o+n,y:(e.rightRoofHeight??e.lz)-r+n},c=[];return c.push(l,i,a,s),e.centerRightRoofHeight&&c.push({x:e.centerRightRoofHeight[0]*e.lx,y:e.centerRightRoofHeight[1]-r+n}),e.centerRoofHeight&&c.push({x:e.centerRoofHeight[0]*e.lx,y:e.centerRoofHeight[1]-r+n}),e.centerLeftRoofHeight&&c.push({x:e.centerLeftRoofHeight[0]*e.lx,y:e.centerLeftRoofHeight[1]-r+n}),c}static isPartialWallFull(e){return Do.isZero((e.leftRoofHeight??e.lz)-e.leftTopPartialHeight)&&Do.isZero((e.rightRoofHeight??e.lz)-e.rightTopPartialHeight)&&Do.isZero(e.leftUnfilledHeight)&&Do.isZero(e.rightUnfilledHeight)}static getPartialWallVertices(e,n){if(Do.isPartialWallFull(e))return Do.getWallVertices(e,n);const o=e.lx/2,r=e.lz/2,i={x:-o-n,y:e.leftUnfilledHeight-r-n},a={x:o+n,y:e.rightUnfilledHeight-r-n},l={x:-o-n,y:e.leftTopPartialHeight-r+n},s={x:o+n,y:e.rightTopPartialHeight-r+n},c=[];return c.push(l,i,a,s),e.centerRightRoofHeight&&c.push({x:e.centerRightRoofHeight[0]*e.lx,y:e.centerRightRoofHeight[1]-r+n}),e.centerRoofHeight&&c.push({x:e.centerRoofHeight[0]*e.lx,y:e.centerRoofHeight[1]-r+n}),e.centerLeftRoofHeight&&c.push({x:e.centerLeftRoofHeight[0]*e.lx,y:e.centerLeftRoofHeight[1]-r+n}),c}static getHighestPointOfWall(e){let n=e.lz;return e.leftRoofHeight&&(n=Math.max(n,e.leftRoofHeight)),e.rightRoofHeight&&(n=Math.max(n,e.rightRoofHeight)),e.centerRightRoofHeight&&(n=Math.max(n,e.centerRightRoofHeight[1])),e.centerRoofHeight&&(n=Math.max(n,e.centerRoofHeight[1])),e.centerLeftRoofHeight&&(n=Math.max(n,e.centerLeftRoofHeight[1])),n}static getWallPointsOfRoof(e,n){let o=n??H.getState().getElementById(e.wallsId[0]);if(!o)return[];const r=o,i=[];for(;o&&(!o.roofId||o.roofId===e.id)&&(i.push({x:o.leftPoint[0],y:o.leftPoint[1],eave:o.eavesLength??0}),o.leftJoints[0]);)if(o.leftJoints[0]!==r.id)o=H.getState().getElementById(o.leftJoints[0]);else return i.reverse(),i;for(i.reverse(),o=H.getState().getElementById(r==null?void 0:r.rightJoints[0]);o&&(!o.roofId||o.roofId===e.id)&&(i.push({x:o.leftPoint[0],y:o.leftPoint[1],eave:o.eavesLength??0}),o.rightJoints[0]&&o.rightJoints[0]!==r.id);)o=H.getState().getElementById(o.rightJoints[0]);return i}static getWallInnerSideShapePoints(e){const{lx:n,ly:o,lz:r,relativeAngle:i,fill:a,leftUnfilledHeight:l,rightUnfilledHeight:s,leftRoofHeight:c,centerLeftRoofHeight:u,centerRoofHeight:d,centerRightRoofHeight:f,rightRoofHeight:p,leftJoints:g,rightJoints:y}=e,w=g.length>0?H.getState().getElementById(g[0]):null,b=y.length>0?H.getState().getElementById(y[0]):null,C=w&&w.type===z.Wall?Do.getInnerWallOffset(w,n,o,i,"left"):0,P=b&&b.type===z.Wall?Do.getInnerWallOffset(b,n,o,i,"right"):0,v=[],T=n/2,A=r/2;return a===El.Partial?(v.push({x:-T+C,y:-A+l}),v.push({x:T-P,y:-A+s})):(v.push({x:-T+C,y:-A}),v.push({x:T-P,y:-A})),p?v.push({x:T-P,y:p-A}):v.push({x:T-P,y:A}),f&&v.push({x:f[0]*n,y:f[1]-A}),d&&v.push({x:d[0]*n,y:d[1]-A}),u&&v.push({x:u[0]*n,y:u[1]-A}),c?v.push({x:-T+C,y:c-A}):v.push({x:-T+C,y:A}),v}static getInnerWallOffset(e,n,o,r,i){let a=0;if(e&&e.fill!==El.Empty){const l=i==="left"?-1:1,s=(Math.PI*3+l*(r-e.relativeAngle))%la;s<=Gt+.01&&s>0&&(a=Math.min(o/Math.tan(s)+e.ly,n))}return a}static isElementAllowedMultipleMoveOnGround(e){return e.type===z.Foundation||e.type===z.Cuboid&&e.parentId===Zo}static areBasesOverlapped(e,n,o){const r=o.get(e),i=o.get(n);if(!r||!i)return!1;for(const a of r)if(Do.isPointInside(a.x,a.y,i))return!0;for(const a of i)if(Do.isPointInside(a.x,a.y,r))return!0;r.push(r[0]),i.push(i[0]);for(let a=0;aNumber(c)),[a,l,s]=n.split(".").map(c=>Number(c));return oa?!1:rl?!1:i{const n=H.getState().getElementById,o=[],r=e;for(;e&&(o.push(e),e.leftJoints[0]);)if(e.leftJoints[0]!==r.id){const a=n(e.leftJoints[0]);a&&a.type===z.Wall&&(e=a)}else return o;const i=n(r.rightJoints[0]);for(i&&i.type===z.Wall&&(e=i);e&&(o.push(e),e.rightJoints[0]&&e.rightJoints[0]!==r.id);){const a=n(e.rightJoints[0]);a&&(e=a)}return o},Do.getWorldDataById=e=>{const n=H.getState().getElementById(e);if(!n)return{pos:new ie,rot:0,topZ:0};const o=new ie(n.cx,n.cy,n.cz),r=n.rotation[2],i=n.lz;if(n.parentId===Zo)return{pos:o,rot:r,topZ:i};const{pos:a,rot:l,topZ:s}=Do.getWorldDataById(n.parentId),c=new nn(0,0,l);return{pos:new ie().addVectors(o.applyEuler(c),a.clone().setZ(s)),rot:r+l,topZ:i+s}},Do.isChild=(e,n,o=!1)=>{const r=H.getState().getElementById(n);return!r||o&&r.locked?!1:r.parentId===e?!0:Do.isChild(e,r.parentId,o)},Do.getBaseId=e=>{const n=H.getState().getElementById(e);return n?n.parentId===Zo?n.id:Do.getBaseId(n.parentId):null},Do.isElementTriggerAutoDeletion=e=>{if(e.type===z.Roof){const r=e;if(r.roofType===Go.Gable||r.roofType===Go.Gambrel)return!0}if(e.type!==z.Wall)return!1;const n=e;if(!n.roofId)return!1;const o=H.getState().getElementById(n.roofId);if(!o)return!1;switch(o.roofType){case Go.Hip:case Go.Gable:case Go.Gambrel:return!0;case Go.Pyramid:case Go.Mansard:return o.wallsId.length===0?!1:o.wallsId[0]===n.id;default:return!1}};let me=Do;var BSe;class YSe{constructor(){this[BSe]=!0,this.latitude=42.2844063,this.longitude=-71.3488548,this.address=uG,this.countryCode="US",this.date=new Date(new Date().getFullYear(),5,22,12).toLocaleString("en-US"),this.name="default",this.ground={albedo:.3,thermalDiffusivity:.05,snowReflectionFactors:new Array(12).fill(0)},this.leafDayOfYear1=Eq,this.leafDayOfYear2=Fq,this.airAttenuationCoefficient=.01,this.airConvectiveCoefficient=5,this.timesPerHour=1,this.daysPerYear=12,this.monthlyIrradianceLosses=new Array(12).fill(.05),this.pvGridCellSize=.5,this.discretization=Fm.APPROXIMATE,this.diurnalTemperatureModel=y2.Sinusoidal,this.highestTemperatureTimeInMinutes=900,this.solarPanelVisibilityGridCellSize=.2,this.solarRadiationHeatmapGridCellSize=.5,this.cspTimesPerHour=1,this.cspDaysPerYear=4,this.cspGridCellSize=.5,this.sutTimesPerHour=1,this.sutDaysPerYear=4,this.sutGridCellSize=1,this.noAnimationForHeatmapSimulation=!1,this.noAnimationForThermalSimulation=!1,this.noAnimationForSensorDataCollection=!1,this.noAnimationForSolarPanelSimulation=!1,this.noAnimationForSolarUpdraftTowerSimulation=!1}static resetWorldModel(e){e.latitude=42.2844063,e.longitude=-71.3488548,e.address=uG,e.countryCode="US",e.date=new Date(new Date().getFullYear(),5,22,12).toLocaleString("en-US"),e.name="default",e.ground.albedo=.3,e.ground.thermalDiffusivity=.05,e.ground.snowReflectionFactors.fill(0),e.airAttenuationCoefficient=.01,e.airConvectiveCoefficient=5,e.timesPerHour=1,e.daysPerYear=12,e.monthlyIrradianceLosses=new Array(12).fill(.05),e.pvGridCellSize=.5,e.discretization=Fm.APPROXIMATE,e.diurnalTemperatureModel=y2.Sinusoidal,e.highestTemperatureTimeInMinutes=900,e.solarPanelVisibilityGridCellSize=.2,e.solarRadiationHeatmapGridCellSize=.5,e.cspTimesPerHour=1,e.cspDaysPerYear=4,e.cspGridCellSize=.5,e.sutTimesPerHour=1,e.sutDaysPerYear=4,e.sutGridCellSize=1,e.noAnimationForHeatmapSimulation=!1,e.noAnimationForThermalSimulation=!1,e.noAnimationForSensorDataCollection=!1,e.noAnimationForSolarPanelSimulation=!1,e.noAnimationForSolarUpdraftTowerSimulation=!1}getElements(){const e=[],n={type:z.Foundation,cx:0,cy:0,cz:.05,lx:10,ly:10,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:Zo,textureType:Yi.NoTexture,id:Xi.generate()};e.push(n);const o={type:z.Sensor,cx:-.1,cy:0,cz:.105,lx:.1,ly:.1,lz:.01,parentId:n.id,foundationId:n.id,normal:[0,0,1],rotation:[0,0,0],id:Xi.generate(),showLabel:!0,light:!0,heatFlux:!1};e.push(o);const r={type:z.Human,name:Yt.Judd,cx:1,cy:-1,cz:0,lx:Fp.fetchWidth(Yt.Jiya),lz:Fp.fetchHeight(Yt.Jiya),normal:[1,0,0],rotation:[0,0,0],parentId:Zo,id:Xi.generate()};return e.push(r),e}}BSe=qm;class Yl{static clone(e,n,o,r,i,a,l,s){let c=null;switch(n.type){case z.Polygon:e&&(c=Yl.clonePolygon(e,n,o,r,i,a,l));break;case z.Sensor:e&&(c=Yl.cloneSensor(e,n,o,r,i));break;case z.Light:e&&(c=Yl.cloneLight(e,n,o,r,i));break;case z.SolarPanel:e&&(c=Yl.cloneSolarPanel(e,n,o,r,i));break;case z.ParabolicTrough:e&&(c=Yl.cloneParabolicTrough(e,n,o,r,i));break;case z.ParabolicDish:e&&(c=Yl.cloneParabolicDish(e,n,o,r,i));break;case z.FresnelReflector:e&&(c=Yl.cloneFresnelReflector(e,n,o,r,i));break;case z.Heliostat:e&&(c=Yl.cloneHeliostat(e,n,o,r,i));break;case z.WindTurbine:e&&(c=Yl.cloneWindTurbine(e,n,o,r,i));break;case z.Wall:e&&(c=Yl.cloneWall(e,n,o,r,i));break;case z.Window:e&&(c=Yl.cloneWindow(e,n,o,r,i,s));break;case z.Door:e&&(c=Yl.cloneDoor(e,n,o,r,i));break;case z.Roof:e&&(c=Yl.cloneRoof(e,n,o,r,i));break;case z.Human:c=Yl.cloneHuman(n,o,r,i,e);break;case z.Tree:c=Yl.cloneTree(n,o,r,i,e);break;case z.Flower:c=Yl.cloneFlower(n,o,r,i,e);break;case z.Foundation:c=Yl.cloneFoundation(n,o,r);break;case z.Cuboid:const u=e?e.id:Zo;c=Yl.cloneCuboid(u,n,o,r);break}return c}static cloneHuman(e,n,o,r,i){return{type:z.Human,name:e.name,flip:e.flip,cx:n,cy:o,cz:r,lx:e.lx,ly:e.ly,lz:e.lz,normal:[...e.normal],rotation:[...e.rotation],parentId:(i==null?void 0:i.id)??e.parentId,id:Xi.generate()}}static cloneTree(e,n,o,r,i){return{type:z.Tree,name:e.name,flip:e.flip,cx:n,cy:o,cz:r,lx:e.lx,ly:e.ly,lz:e.lz,normal:[...e.normal],rotation:[...e.rotation],parentId:(i==null?void 0:i.id)??e.parentId,id:Xi.generate()}}static cloneFlower(e,n,o,r,i){return{type:z.Flower,name:e.name,flip:e.flip,cx:n,cy:o,cz:r,lx:e.lx,ly:e.ly,lz:e.lz,normal:[...e.normal],rotation:[...e.rotation],parentId:(i==null?void 0:i.id)??e.parentId,id:Xi.generate()}}static clonePolygon(e,n,o,r,i,a,l){let s;switch(e.type){case z.Foundation:case z.Cuboid:s=e.id;break;case z.Wall:case z.Roof:s=e.parentId;break}const c=n.vertices.map(d=>({...d})),u={type:z.Polygon,cx:o,cy:r,cz:i,lx:n.lx,ly:n.ly,lz:n.lz,filled:n.filled,noOutline:n.noOutline,color:n.color,lineColor:n.lineColor,lineWidth:n.lineWidth,opacity:n.opacity,textureType:n.textureType,text:n.text,fontSize:n.fontSize,fontColor:n.fontColor,normal:[...n.normal],rotation:n.parentId?[...e.rotation]:[0,0,0],vertices:c,parentId:e.id,parentType:e.type,foundationId:s,id:Xi.generate()};if(!a){let d=o,f=r;if(e.type===z.Cuboid&&l){me.isSame(l,_p)?d=i??0:me.isSame(l,Op)?d=-(i??0):me.isSame(l,Vp)?f=i??0:me.isSame(l,Oc)&&(f=-(i??0));const p=l.dot(new ie().fromArray(n.normal));if(Math.abs(p)0&&this.commands.length>this.limit&&this.commands.splice(0,this.commands.length-this.limit),this.index=this.commands.length-1)}undo(){const e=this.commands[this.index];if(e)return this.isExecuting=!0,e.undo(),this.isExecuting=!1,this.index--,e.name}redo(){const e=this.commands[this.index+1];if(e)return this.isExecuting=!0,e.redo(),this.isExecuting=!1,this.index++,e.name}clear(){this.commands=[],this.index=-1}hasUndo(){return this.index!==-1}hasRedo(){return this.index0||this.cuboidCount>0||this.wallCount>0||this.windowCount>0||this.doorCount>0||this.humanCount>0||this.treeCount>0||this.flowerCount>0||this.polygonCount>0||this.sensorCount>0||this.insideLightCount>0||this.outsideLightCount>0||this.solarPanelCount>0||this.parabolicTroughCount>0||this.parabolicDishCount>0||this.fresnelReflectorCount>0||this.heliostatCount>0||this.solarUpdraftTowerCount>0||this.windTurbineCount>0}}var JSe;class ken{constructor(e){this[JSe]=!0,this.problem=e,this.objectiveFunctionType=To.DAILY_TOTAL_OUTPUT,this.selectionMethod=Wm.ROULETTE_WHEEL,this.searchMethod=us.GLOBAL_SEARCH_UNIFORM_SELECTION,this.populationSize=20,this.maximumGenerations=5,this.selectionRate=.5,this.crossoverRate=.5,this.mutationRate=.1,this.convergenceThreshold=.01,this.localSearchRadius=.1}}JSe=qm;var KSe;class Len{constructor(e){this[KSe]=!0,this.problem=e,this.objectiveFunctionType=To.DAILY_TOTAL_OUTPUT,this.searchMethod=us.GLOBAL_SEARCH_UNIFORM_SELECTION,this.swarmSize=20,this.maximumSteps=5,this.vmax=.01,this.inertia=.8,this.cognitiveCoefficient=.1,this.socialCoefficient=.1,this.convergenceThreshold=.01,this.localSearchRadius=.1}}KSe=qm;var qSe;class $Se{constructor(){this[qSe]=!0,this.geneticAlgorithmParams=new ken(Pi.SOLAR_PANEL_TILT_ANGLE),this.particleSwarmOptimizationParams=new Len(Pi.SOLAR_PANEL_TILT_ANGLE)}}qSe=qm;var QSe;class uX{constructor(){this[QSe]=!0,this.minimumInterRowSpacing=2,this.maximumInterRowSpacing=10,this.minimumRowsPerRack=1,this.maximumRowsPerRack=6,this.minimumTiltAngle=-Gt,this.maximumTiltAngle=Gt,this.poleHeight=1,this.poleSpacing=5,this.orientation=vr.landscape,this.pvModelName="CS6X-355P-FG",this.rowAxis=Dl.leftRight}}QSe=qm;var ZSe;class eTe{constructor(){this[ZSe]=!0,this.projectLifeSpan=25,this.electricitySellingPrice=.25,this.operationalCostPerUnit=.15}}ZSe=qm;var tTe;class nTe{constructor(){this[tTe]=!0,this.humanName=Yt.Jack,this.flowerType=ro.YellowFlower,this.treeType=pr.Dogwood,this.treeSpread=3,this.treeHeight=4,this.foundationHeight=.1,this.foundationColor="#808080",this.foundationTexture=Yi.NoTexture,this.groundFloorRValue=o8,this.cuboidHeight=4,this.cuboidFaceColors=["#808080","#808080","#808080","#808080","#808080","#808080"],this.cuboidFaceTextures=[Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture],this.cuboidStackable=!1,this.cuboidTransparency=0,this.wallHeight=5,this.wallThickness=.3,this.wallColor="#ffffff",this.wallTexture=Uo.Default,this.wallStructure=gc.Default,this.wallStructureSpacing=2,this.wallStructureWidth=.1,this.wallStructureColor="#ffffff",this.wallOpacity=.5,this.wallRValue=f6,this.wallVolumetricHeatCapacity=.5,this.wallEavesLength=.3,this.wallParapet=Xye,this.roofColor="#454769",this.roofSideColor="#ffffff",this.roofTexture=Ur.Default,this.roofThickness=.2,this.roofStructure=wc.Default,this.roofGlassOpacity=.5,this.roofGlassTint="#73D8FF",this.roofRafterWidth=.1,this.roofRafterSpacing=1,this.roofRafterColor="#ffffff",this.roofRValue=r8,this.roofVolumetricHeatCapacity=.5,this.roofRise=2,this.roofCeiling=!1,this.ceilingRValue=y6,this.doorColor="#ffffff",this.doorFrameColor="#ffffff",this.doorTexture=sr.Default,this.doorType=Pd.Default,this.doorArchHeight=1,this.doorFilled=!0,this.doorInterior=!1,this.doorUValue=G4,this.doorOpacity=1,this.doorVolumetricHeatCapacity=.5,this.windowWidth=1,this.windowHeight=1,this.windowColor="#ffffff",this.windowTint="#73D8FF",this.windowOpacity=.5,this.windowUValue=V4,this.windowHorizontalMullion=!0,this.windowVerticalMullion=!0,this.windowMullionWidth=.06,this.windowHorizontalMullionSpacing=.5,this.windowVerticalMullionSpacing=.5,this.windowMullionColor="#ffffff",this.windowFrame=!1,this.windowFrameWidth=.1,this.windowSillWidth=.1,this.windowType=Ti.Default,this.windowArchHeight=1,this.windowShutterLeft=!1,this.windowShutterRight=!1,this.windowShutterColor="gray",this.windowShutterWidth=.5,this.windowEmpty=!1,this.windowInterior=!1,this.windTurbineBirdSafeDesign=uc.None,this.windTurbineBladeColor=t9,this.windTurbineStripeColor=n9,this.windTurbineNumberOfBlades=3,this.windTurbinePitchAngle=Math.PI/18,this.windTurbineRelativeYawAngle=0,this.windTurbineInitialRotorAngle=0,this.windTurbineTowerHeight=20,this.windTurbineTowerRadius=.5,this.windTurbineBladeRadius=10,this.windTurbineBladeMaximumChordLength=1,this.windTurbineBladeMaximumChordRadius=3,this.windTurbineBladeRootRadius=.3,this.windTurbineHubRadius=.75,this.windTurbineHubLength=1.5,this.solarPanelModelName="SPR-X21-335-BLK",this.solarPanelOrientation=vr.landscape,this.solarPanelPoleHeight=1,this.solarPanelPoleSpacing=3,this.solarPanelTiltAngle=0,this.solarPanelRelativeAzimuth=0,this.solarPanelFrameColor="#ffffff",this.solarPanelCx=0,this.solarPanelCy=0,this.parabolicDishReflectance=.9,this.parabolicDishAbsorptance=.95,this.parabolicDishOpticalEfficiency=.7,this.parabolicDishThermalEfficiency=.3,this.parabolicDishRimDiameter=4,this.parabolicDishLatusRectum=8,this.parabolicDishPoleHeight=.2,this.parabolicDishPoleRadius=.1,this.parabolicDishReceiverStructure=uf.CentralPole,this.parabolicTroughReflectance=.9,this.parabolicTroughAbsorptance=.95,this.parabolicTroughOpticalEfficiency=.7,this.parabolicTroughThermalEfficiency=.3,this.parabolicTroughLatusRectum=2,this.parabolicTroughPoleHeight=.2,this.parabolicTroughWidth=2,this.parabolicTroughModuleLength=3,this.fresnelReflectorReceiver="None",this.fresnelReflectorReflectance=.9,this.fresnelReflectorPoleHeight=.2,this.fresnelReflectorWidth=2,this.fresnelReflectorModuleLength=3,this.heliostatTower="None",this.heliostatReflectance=.9,this.heliostatPoleHeight=.2,this.heliostatPoleRadius=.1,this.heliostatWidth=4,this.heliostatLength=2,this.lightColor="#ffff99",this.lightIntensity=3,this.lightDistance=5}}tTe=qm;var oTe;class rTe{constructor(){this[oTe]=!0,this.dailyPvIndividualOutputs=!1,this.yearlyPvIndividualOutputs=!1,this.dailyParabolicDishIndividualOutputs=!1,this.yearlyParabolicDishIndividualOutputs=!1,this.dailyParabolicTroughIndividualOutputs=!1,this.yearlyParabolicTroughIndividualOutputs=!1,this.dailyFresnelReflectorIndividualOutputs=!1,this.yearlyFresnelReflectorIndividualOutputs=!1,this.dailyHeliostatIndividualOutputs=!1,this.yearlyHeliostatIndividualOutputs=!1,this.dailyUpdraftTowerIndividualOutputs=!1,this.yearlyUpdraftTowerIndividualOutputs=!1}}oTe=qm;class pd{static getDefaultHiddenParameters(e){return e===Pi.SOLAR_PANEL_ARRAY?["latitude","orientation","poleHeight"]:[]}static getVariables(e,n){if(e===Pi.SOLAR_PANEL_ARRAY){const o=[];return n.includes("rowWidth")||o.push("rowWidth"),n.includes("tiltAngle")||o.push("tiltAngle"),n.includes("interRowSpacing")||o.push("interRowSpacing"),n.includes("latitude")||o.push("latitude"),n.includes("orientation")||o.push("orientation"),n.includes("poleHeight")||o.push("poleHeight"),n.includes("unitCost")||o.push("unitCost"),n.includes("sellingPrice")||o.push("sellingPrice"),n.includes("totalYearlyCost")||o.push("totalYearlyCost"),n.includes("totalYearlyYield")||o.push("totalYearlyYield"),n.includes("meanYearlyYield")||o.push("meanYearlyYield"),n.includes("yearlyProfit")||o.push("yearlyProfit"),o}return[]}static getTitles(e,n,o){if(e===Pi.SOLAR_PANEL_ARRAY){const r=[];return o.includes("rowWidth")||r.push(Y.t("polygonMenu.SolarPanelArrayRowWidth",n)),o.includes("tiltAngle")||r.push(Y.t("polygonMenu.SolarPanelArrayTiltAngle",n)),o.includes("interRowSpacing")||r.push(Y.t("polygonMenu.SolarPanelArrayRowSpacing",n)),o.includes("latitude")||r.push(Y.t("word.Latitude",n)),o.includes("orientation")||r.push(Y.t("polygonMenu.SolarPanelArrayOrientation",n)),o.includes("poleHeight")||r.push(Y.t("polygonMenu.SolarPanelArrayPoleHeight",n)),o.includes("unitCost")||r.push(Y.t("economicsPanel.UnitCost",n)),o.includes("sellingPrice")||r.push(Y.t("economicsPanel.SellingPrice",n)),o.includes("totalYearlyCost")||r.push(Y.t("polygonMenu.SolarPanelArrayTotalYearlyCost",n)),o.includes("totalYearlyYield")||r.push(Y.t("polygonMenu.SolarPanelArrayTotalYearlyYield",n)),o.includes("meanYearlyYield")||r.push(Y.t("polygonMenu.SolarPanelArrayMeanYearlyYield",n)),o.includes("yearlyProfit")||r.push(Y.t("polygonMenu.SolarPanelArrayYearlyProfit",n)),r}return[]}static getTypes(e,n){if(e===Pi.SOLAR_PANEL_ARRAY){const o=[];return n.includes("rowWidth")||o.push("number"),n.includes("tiltAngle")||o.push("number"),n.includes("interRowSpacing")||o.push("number"),n.includes("latitude")||o.push("number"),n.includes("orientation")||o.push("boolean"),n.includes("poleHeight")||o.push("number"),n.includes("unitCost")||o.push("number"),n.includes("sellingPrice")||o.push("number"),n.includes("totalYearlyCost")||o.push("number"),n.includes("totalYearlyYield")||o.push("number"),n.includes("meanYearlyYield")||o.push("number"),n.includes("yearlyProfit")||o.push("number"),o}return[]}static getDigits(e,n){if(e===Pi.SOLAR_PANEL_ARRAY){const o=[];return n.includes("rowWidth")||o.push(0),n.includes("tiltAngle")||o.push(1),n.includes("interRowSpacing")||o.push(1),n.includes("latitude")||o.push(1),n.includes("orientation")||o.push(0),n.includes("poleHeight")||o.push(1),n.includes("unitCost")||o.push(2),n.includes("sellingPrice")||o.push(2),n.includes("totalYearlyCost")||o.push(1),n.includes("totalYearlyYield")||o.push(1),n.includes("meanYearlyYield")||o.push(1),n.includes("yearlyProfit")||o.push(3),o}return[]}static getTickIntegers(e,n){if(e===Pi.SOLAR_PANEL_ARRAY){const o=[];return n.includes("rowWidth")||o.push(!0),n.includes("tiltAngle")||o.push(!1),n.includes("interRowSpacing")||o.push(!1),n.includes("latitude")||o.push(!1),n.includes("orientation")||o.push(!0),n.includes("poleHeight")||o.push(!1),n.includes("unitCost")||o.push(!1),n.includes("sellingPrice")||o.push(!1),n.includes("totalYearlyCost")||o.push(!1),n.includes("totalYearlyYield")||o.push(!1),n.includes("meanYearlyYield")||o.push(!1),n.includes("yearlyProfit")||o.push(!1),o}return[]}static getUnits(e,n,o){if(e===Pi.SOLAR_PANEL_ARRAY){const r=[];return o.includes("rowWidth")||r.push(" "+Y.t("solarPanelMenu.Panels",n)),o.includes("tiltAngle")||r.push("°"),o.includes("interRowSpacing")||r.push(" "+Y.t("word.MeterAbbreviation",n)),o.includes("latitude")||r.push("°"),o.includes("orientation")||r.push(""),o.includes("poleHeight")||r.push(" "+Y.t("word.MeterAbbreviation",n)),o.includes("unitCost")||r.push(""),o.includes("sellingPrice")||r.push(""),o.includes("totalYearlyCost")||r.push("K"),o.includes("totalYearlyYield")||r.push(" MWh"),o.includes("meanYearlyYield")||r.push(" kWh"),o.includes("yearlyProfit")||r.push("K"),r}return[]}static getUnit(e,n){return e==="tiltAngle"||e==="latitude"?"°":e==="interRowSpacing"||e==="poleHeight"?Y.t("word.MeterAbbreviation",n):e==="totalYearlyYield"?"MWh":e==="meanYearlyYield"?"kWh":e==="totalYearlyCost"||e==="yearlyProfit"?"K":""}static setScatterData(e,n,o,r){switch(e){case"rowWidth":o[n]=r.rowsPerRack;break;case"tiltAngle":o[n]=me.toDegrees(r.tiltAngle);break;case"interRowSpacing":o[n]=r.interRowSpacing;break;case"latitude":o[n]=r.latitude;break;case"orientation":o[n]=r.orientation===vr.landscape?0:1;break;case"poleHeight":o[n]=r.poleHeight;break;case"unitCost":o[n]=r.unitCost;break;case"sellingPrice":o[n]=r.sellingPrice;break;case"totalYearlyCost":o[n]=me.calculateCost(r);break;case"totalYearlyYield":o[n]=r.yearlyYield*.001;break;case"meanYearlyYield":o[n]=r.yearlyYield/r.panelCount;break;case"yearlyProfit":o[n]=me.calculateProfit(r);break}}}class Wen{static updateOldFileData(){H.getState().set(e=>{me.compareVersion(e.version,G6t)&&(e.viewState.ambientLightIntensity&&(e.viewState.ambientLightIntensity*=3),e.viewState.directLightIntensity&&(e.viewState.directLightIntensity*=3.5));const n=new Map;for(const o of e.elements)n.set(o.id,o);for(const o of e.elements)switch(o.type){case z.Foundation:{o.parentId!==Zo&&(console.error("Error: "+o.parentId+" is not ground!"),o.parentId=Zo);break}case z.Wall:{const r=o;if(r.wallStructure===void 0&&(r.wallStructure=gc.Default),r.structureSpacing===void 0&&(r.structureSpacing=2),r.structureWidth===void 0&&(r.structureWidth=.1),r.structureColor===void 0&&(r.structureColor="white"),r.opacity===void 0&&(r.opacity=.5),r.fill===void 0&&(r.fill=El.Full),r.unfilledHeight===void 0&&(r.unfilledHeight=.5),r.leftUnfilledHeight===void 0||r.rightUnfilledHeight===void 0){const i=r.unfilledHeight??.5;r.leftUnfilledHeight=i,r.rightUnfilledHeight=i}if((r.leftTopPartialHeight===void 0||r.rightTopPartialHeight===void 0)&&(r.leftTopPartialHeight=r.lz,r.rightTopPartialHeight=r.lz),r.eavesLength===void 0&&r.roofId){const i=n.get(r.roofId);if(i&&i.type===z.Roof){const a=i;r.eavesLength=a.overhang!==void 0?a.overhang:.3}else r.eavesLength=.3}if(r.parapet===void 0&&(r.parapet={...Xye}),r.roofId){const i=n.get(r.roofId);if(i&&i.type===z.Roof){const a=i;(a.roofType===Go.Pyramid||a.roofType===Go.Hip||a.roofType===Go.Mansard)&&(r.leftRoofHeight=void 0,r.rightRoofHeight=void 0)}}break}case z.Window:{const r=o;r.horizontalMullion===void 0&&(r.horizontalMullion=r.mullion),r.verticalMullion===void 0&&(r.verticalMullion=r.mullion),r.mullionWidth===void 0&&(r.mullionWidth=.06),r.horizontalMullionSpacing===void 0&&(r.horizontalMullionSpacing=r.mullionSpacing??.5),r.verticalMullionSpacing===void 0&&(r.verticalMullionSpacing=r.mullionSpacing??.5),r.tint===void 0&&(r.tint="#73D8FF"),r.opacity===void 0&&(r.opacity=.5),r.shutter&&(r.leftShutter=r.shutter.showLeft,r.rightShutter=r.shutter.showRight,r.shutterColor=r.shutter.color,r.shutterWidth=r.shutter.width,r.shutter=void 0),r.shutterColor===void 0&&(r.shutterColor="gray"),r.shutterWidth===void 0&&(r.shutterWidth=.5),r.mullionColor===void 0&&(r.mullionColor="white"),r.frame===void 0&&(r.frame=!1),r.color===void 0&&(r.color="white"),r.frameWidth===void 0&&(r.frameWidth=.1),r.windowType===void 0&&(r.windowType=Ti.Default),r.archHeight===void 0&&(r.archHeight=1);break}case z.Door:{const r=o;r.doorType===void 0&&(r.doorType=Pd.Default),r.archHeight===void 0&&(r.archHeight=1),r.filled===void 0&&(r.filled=!0);break}case z.Roof:{const r=o;if(r.ceiling===void 0&&(r.ceiling=!1),r.roofType===Go.Gambrel){const i=r;i.frontRidgePoint===void 0&&(i.frontRidgePoint=i.frontRidgeLeftPoint?[...i.frontRidgeLeftPoint]:[.35,.5],i.frontRidgeLeftPoint=void 0,i.frontRidgeRightPoint=void 0),i.backRidgePoint===void 0&&(i.backRidgePoint=i.backRidgeLeftPoint?[...i.backRidgeLeftPoint]:[-.35,.5],i.backRidgeLeftPoint=void 0,i.backRidgeRightPoint=void 0),i.topRidgePoint===void 0&&(i.topRidgePoint=i.topRidgeLeftPoint?[...i.topRidgeLeftPoint]:[0,1],i.topRidgeLeftPoint=void 0,i.topRidgeRightPoint=void 0)}break}case z.SolarPanel:{const r=o;if(r.version===void 0)switch(r.version=1,r.parentType){case void 0:case z.Foundation:{r.parentType=z.Foundation;const i=n.get(r.parentId);i&&(r.cx=r.cx*i.lx,r.cy=r.cy*i.ly,r.cz=r.cz*i.lz),r.rotation[2]!==0&&(r.rotation=[0,0,0]);break}case z.Cuboid:{const i=n.get(r.parentId);i&&(r.cx=r.cx*i.lx,r.cy=r.cy*i.ly,r.cz=r.cz*i.lz,r.rotation=ea.getRotationOnCuboid(new ie().fromArray(r.normal)),me.isEqual(0,r.rotation[0])&&r.rotation[2]!==0&&(r.rotation=[0,0,0]));break}case z.Wall:{r.normal=[0,-1,0],r.rotation=[Gt,0,0];break}case z.Roof:{if(r.foundationId){const i=n.get(r.foundationId);i&&(r.cx=r.cx*i.lx,r.cy=r.cy*i.ly,r.cz=r.cz+i.lz/2)}break}}}}})}}function md(t){return t.type===z.Foundation||t.type===z.Cuboid}Wpt();const H=GK()(j6t(_6t((t,e)=>{const n=me.isOpenFromURL(),o=new YSe,r=n?[]:o.getElements(),i=a=>t(OP(a));return{set:a=>{try{i(a)}catch(l){console.log(l)}},version:TC,world:o,elements:r,user:{},viewState:new _Se,actionState:new nTe,graphState:new rTe,solarPanelArrayLayoutParams:new GSe,solarPanelArrayLayoutConstraints:new uX,evolutionaryAlgorithmState:new $Se,economicsParams:new eTe,geneticAlgorithmWizardSelectedTab:"1",particleSwarmOptimizationWizardSelectedTab:"1",modelType:ha.UNKNOWN,modelAuthor:null,modelLabel:null,modelDescription:null,projectView:!1,projectState:{owner:null,title:null,description:null,type:Pi.SOLAR_PANEL_ARRAY,designs:new Array,ranges:new Array,filters:new Array,hiddenParameters:pd.getDefaultHiddenParameters(Pi.SOLAR_PANEL_ARRAY),counter:0,dataColoring:d9.ALL,selectedProperty:null,sortDescending:!1,xAxisNameScatterPlot:null,yAxisNameScatterPlot:null,dotSizeScatterPlot:5,thumbnailWidth:200},projectImages:new Map,designProjectType:null,notes:[],language:"en",floatingWindowOpacity:m0,selectedFloatingWindow:null,cloudFile:void 0,latestModelSite:void 0,modelSites:new Map,peopleModels:new Map,modelsMapLatitude:42.2844063,modelsMapLongitude:-71.3488548,modelsMapAddress:uG,modelsMapZoom:eje,modelsMapType:"roadmap",modelsMapTilt:0,minimumNavigationMoveSpeed:3,minimumNavigationTurnSpeed:3,tempHumanPlant:[],ray:new l0,mouse:new Xt,fileChanged:!1,setNavigationView(a){i(l=>{l.viewState.navigationView=a,l.viewState.enableRotate=!a,a&&(l.viewState.orthographic=!1)})},set2DView(a){i(l=>{l.viewState.orthographic=a,l.viewState.enableRotate=!a,a&&(l.viewState.navigationView=!1)})},applyCount:0,setApplyCount(a){i(l=>{l.applyCount=a})},revertApply(){if(e().applyCount){for(let a=0;a{s.version=a.version,s.world=a.world,s.viewState=a.view,s.graphState=a.graphState??new rTe,s.elements=a.elements,s.notes=a.notes??[],s.animate24Hours=!!a.animate24Hours,s.modelType=a.modelType??ha.UNKNOWN,s.modelAuthor=a.modelAuthor??null,s.modelLabel=a.modelLabel??null,s.modelDescription=a.modelDescription??null,s.designProjectType=a.designProjectType??null,s.cloudFile=l,s.currentUndoable=void 0,s.actionInfo=void 0,s.sceneRadius=a.sceneRadius??100,s.updateSceneRadiusFlag=!s.updateSceneRadiusFlag,s.localContentToImportAfterCloudFileUpdate=void 0,s.fileChanged=!s.fileChanged,s.evolutionMethod=a.evolutionMethod??Vs.GENETIC_ALGORITHM,s.solarPanelArrayLayoutParams=a.solarPanelArrayLayoutParams??new GSe,s.solarPanelArrayLayoutConstraints=a.solarPanelArrayLayoutConstraints??new uX,s.evolutionaryAlgorithmState=a.evolutionaryAlgorithmState??new $Se,s.economicsParams=a.economicsParams??new eTe,s.minimumNavigationMoveSpeed=a.minimumNavigationMoveSpeed??3,s.minimumNavigationTurnSpeed=a.minimumNavigationTurnSpeed??3,s.fittestIndividualResults.length=0,s.undoManager.clear(),s.deletedRoofId=null,s.autoDeletedRoofs=null,s.autoDeletedRoofIdSet.clear(),s.autoDeletedChild=null,s.deletedRoofIdSet.clear(),s.addedRoofIdSet.clear(),s.actionState=new nTe,s.multiSelectionsMode=!1,s.selectedElementIdSet.clear(),s.groupActionMode=!1,s.selectedFloatingWindow=null}),Wen.updateOldFileData(),ht.getState().set(s=>{s.changed=!1,s.skipChange=!0,s.animateSun=!1,s.showSolarRadiationHeatmap=!1,s.showHeatFluxes=!1,s.simulationInProgress=!1,s.simulationPaused=!1,s.clearDailySimulationResultsFlag=!s.clearDailySimulationResultsFlag,s.clearYearlySimulationResultsFlag=!s.clearYearlySimulationResultsFlag,s.navigationMoveSpeed=a.minimumNavigationMoveSpeed??3,s.navigationTurnSpeed=a.minimumNavigationTurnSpeed??3}),Tn.getState().clearDataStore(),Tn.getState().clearRoofVerticesMap()},exportContent(){const a=e(),l=new Date,s=JSON.parse(JSON.stringify(a.elements));return me.fixElements(s),{docid:Xi.generate(),time:yc(l).format("MM/DD/YYYY hh:mm A"),timestamp:l.getTime(),userid:a.user.uid,owner:a.user.signFile?a.user.displayName:null,email:a.user.signFile?a.user.email:null,version:TC,world:JSON.parse(JSON.stringify(a.world)),elements:s,sceneRadius:a.sceneRadius,view:JSON.parse(JSON.stringify(a.viewState)),animate24Hours:a.animate24Hours,graphState:JSON.parse(JSON.stringify(a.graphState)),evolutionMethod:a.evolutionMethod,solarPanelArrayLayoutParams:JSON.parse(JSON.stringify(a.solarPanelArrayLayoutParams)),solarPanelArrayLayoutConstraints:JSON.parse(JSON.stringify(a.solarPanelArrayLayoutConstraints)),evolutionaryAlgorithmState:JSON.parse(JSON.stringify(a.evolutionaryAlgorithmState)),economicsParams:JSON.parse(JSON.stringify(a.economicsParams)),modelType:a.modelType,modelAuthor:a.modelAuthor,modelLabel:a.modelLabel,modelDescription:a.modelDescription,designProjectType:a.designProjectType,notes:a.notes,minimumNavigationMoveSpeed:a.minimumNavigationMoveSpeed,minimumNavigationTurnSpeed:a.minimumNavigationTurnSpeed}},clearContent(){i(a=>{a.elements=[],a.sceneRadius=100}),Tn.getState().clearDataStore(),Tn.getState().clearRoofVerticesMap()},createEmptyFile(){i(a=>{YSe.resetWorldModel(a.world),_Se.resetViewState(a.viewState),a.version=TC,a.elements=[],a.sceneRadius=100,a.cloudFile=void 0,a.localContentToImportAfterCloudFileUpdate=void 0,a.notes=[],a.fileChanged=!a.fileChanged,a.currentUndoable=void 0,a.actionInfo=void 0,a.undoManager.clear(),a.modelType=ha.UNKNOWN,a.modelLabel=null,a.modelDescription=null,a.designProjectType=null,a.minimumNavigationMoveSpeed=3,a.minimumNavigationTurnSpeed=3,a.multiSelectionsMode=!1,a.selectedElementIdSet.clear(),a.groupActionMode=!1,a.selectedFloatingWindow=null,a.deletedRoofId=null,a.autoDeletedRoofs=null,a.autoDeletedRoofIdSet.clear(),a.autoDeletedChild=null,a.deletedRoofIdSet.clear(),a.addedRoofIdSet.clear()}),ht.getState().set(a=>{a.changed=!1,a.skipChange=!0,a.animateSun=!1,a.showSolarRadiationHeatmap=!1,a.showHeatFluxes=!1}),Tn.getState().clearDataStore(),Tn.getState().clearRoofVerticesMap()},undoManager:new Fen,addUndoable(a){i(l=>{l.loggable&&(l.currentUndoable=a),l.undoManager.add(a)})},fittestIndividualResults:[],setFittestIndividualResults(a){i(l=>{l.fittestIndividualResults=[...a]})},variableLabels:[],setVariableLabels(a){i(l=>{l.variableLabels=[...a]})},aabb:new bf(new ie(-10,-10,-10),new ie(10,10,10)),animate24Hours:!1,evolutionMethod:Vs.GENETIC_ALGORITHM,clickObjectType:null,contextMenuObjectType:null,hoveredHandle:null,moveHandleType:null,resizeHandleType:null,rotateHandleType:null,resizeAnchor:new ie,selectedElement:null,getSelectedElement(){if(e().selectedElementIdSet.size===0)return null;const a=e().selectedElement;return a?e().elements.find(l=>l.id===a.id)??null:null},selectedElementIdSet:new Set,multiSelectionsMode:!1,findNearestSibling(a){let l=null;const s=e().getElementById(a);if(s){let c=Number.MAX_VALUE;for(const u of e().elements)if(u.type===s.type&&u.parentId===s.parentId&&u.id!==a){const d=s.cx-u.cx,f=s.cy-u.cy,p=s.cz-u.cz,g=d*d+f*f+p*p;c>g&&(c=g,l=u.id)}}return l},overlapWithSibling(a,l){let s=!1;if(l===void 0){const c=e().getParent(a);if(c){for(const u of e().elements)if(u.type===a.type&&u.parentId===a.parentId&&u.id!==a.id){if(a.type===z.SolarPanel){if(me.doSolarPanelsOverlap(a,u,c)){s=!0;break}}else if(Math.abs(a.cx-u.cx)*c.lx<.5*(a.lx+u.lx)&&Math.abs(a.cy-u.cy)*c.ly<.5*(a.ly+u.ly)&&Math.abs(a.cz-u.cz)*c.lz<.5*(a.lz+u.lz)){s=!0;break}}}}else{const c=l*l,u=e().getParent(a);for(const d of e().elements)if(d.type===a.type&&d.parentId===a.parentId&&d.id!==a.id){const f=(a.cx-d.cx)*(u?u.lx:1),p=(a.cy-d.cy)*(u?u.ly:1),g=(a.cz-d.cz)*(u?u.lz:1);if(f*f+p*p+g*gC.id===g);if(b){const C=new ie(b.cx,b.cy,b.lz),P=new nn(0,0,b.rotation[2]),v=new ie;switch(l){case vt.UpperLeft:{v.fromArray(w.leftPoint).setZ(0);break}case vt.UpperRight:{v.fromArray(w.rightPoint).setZ(0);break}}y.copy(v.applyEuler(P).add(C))}break}case z.Roof:{const w=e().elements.find(b=>b.id===g);if(w){const b=new ie(w.cx,w.cy,w.lz),C=new nn(0,0,w.rotation[2]),P=new ie(e().selectedElementX,e().selectedElementY).applyEuler(C).add(b);y.set(P.x,P.y,w.lz)}break}case z.Tree:{const w=e().elements.find(b=>b.id===g);if(w){const b=new ie(w.cx,w.cy,w.cz+w.lz/2),C=new nn(0,0,w.rotation[2]);y.copy(new ie(a.cx,a.cy,w.lz).applyEuler(C).add(b))}break}}return y},getElementById(a){const l=e().elements;for(const s of l)if(s.id===a)return s;return null},getParent(a){const l=e().elements;for(const s of l)if(s.id===a.parentId)return s;return null},getFoundation(a){const l=e().elements;for(const s of l)if(s.id===a.foundationId&&s.type===z.Foundation)return s;return null},selectNone(){i(a=>{a.selectedElementIdSet.clear();for(const l of a.elements)l.selected=!1;a.selectedElement=null}),Fn.getState().selectNone()},selectMe(a,l,s,c){const u=Fn.getState().setEnableOrbitController;l.intersections.length>0&&(l.intersections.filter(f=>!f.eventObject.name.startsWith("Wall Intersection Plane"))[0].object===l.eventObject||c)&&i(f=>{var p,g,y;for(const w of f.elements)if(w.id===a)if(w.selected=!0,f.selectedElement=w,f.selectedElementHeight=w.lz,f.groupActionMode){let b=w.foundationId??null;!b&&md(w)&&(b=me.getBaseId(w.id)),b&&(f.multiSelectionsMode||f.selectedElementIdSet.clear(),f.selectedElementIdSet.has(b)?f.selectedElementIdSet.delete(b):f.selectedElementIdSet.add(b))}else if(s===Oo.ContextMenu)if(f.selectedElementIdSet.has(a))for(const b of f.elements)f.selectedElementIdSet.has(b.id)&&b.type!==f.selectedElement.type&&f.selectedElementIdSet.delete(b.id);else if(f.multiSelectionsMode){f.selectedElementIdSet.add(a);for(const b of f.elements)f.selectedElementIdSet.has(b.id)&&b.type!==f.selectedElement.type&&f.selectedElementIdSet.delete(b.id)}else f.selectedElementIdSet.clear(),f.selectedElementIdSet.add(a);else f.multiSelectionsMode?f.selectedElementIdSet.has(a)?f.selectedElementIdSet.delete(a):f.selectedElementIdSet.add(a):(f.selectedElementIdSet.clear(),f.selectedElementIdSet.add(a));else w.selected=!1;if(f.moveHandleType=null,f.resizeHandleType=null,f.rotateHandleType=null,f.contextMenuObjectType=null,s)switch(s){case Oo.Move:{((p=f.selectedElement)==null?void 0:p.type)===z.Tree||((g=f.selectedElement)==null?void 0:g.type)===z.Human?f.moveHandleType=Ho.Default:f.moveHandleType=l.eventObject.name,u(!1);break}case Oo.Resize:{f.resizeHandleType=l.eventObject.name,u(!1);break}case Oo.Rotate:{f.rotateHandleType=l.eventObject.name,u(!1);break}case Oo.Select:{f.selectedElementAngle=((y=l.object.parent)==null?void 0:y.rotation.z)??0,u(!0);break}default:u(!0)}})},countHeatmapCells(){let a=0;return i(l=>{const s=l.world.solarRadiationHeatmapGridCellSize??.5,c=s*s;for(const u of l.elements)(u.type===z.Foundation||u.type===z.Cuboid)&&(a+=u.lx*u.ly/c)}),Math.round(a)},updateAllElementLocks(a){i(l=>{for(const s of l.elements)s.locked=a})},updateElementLockByFoundationId(a,l){i(s=>{for(const c of s.elements)(c.foundationId===a||c.parentId===a||c.id===a)&&(c.locked=l)})},updateElementLockByParentId(a,l,s){i(c=>{for(const u of c.elements)u.parentId===a&&l===u.type&&(u.locked=s)})},updateElementLockById(a,l){i(s=>{for(const c of s.elements)if(c.id===a){c.locked=l;break}})},updateElementReferenceById(a,l){i(s=>{for(const c of s.elements)if(c.id===a){c.referenceId=l;break}})},updateElementLabelById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.label=l;break}})},updateElementShowLabelById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.showLabel=l;break}})},updateElementColorById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.color=l;break}})},updateElementColorOnSurface(a,l,s,c){i(u=>{for(const d of u.elements)d.type===a&&d.parentId===l&&me.isIdentical(d.normal,s)&&!d.locked&&(d.color=c)})},updateElementColorAboveFoundation(a,l,s){i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&!u.locked&&(u.color=s)})},updateElementColorForAll(a,l){i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.color=l)})},updateElementLineColorById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.lineColor=l;break}})},updateElementLineColorOnSurface(a,l,s,c){i(u=>{for(const d of u.elements)d.type===a&&d.parentId===l&&me.isIdentical(d.normal,s)&&!d.locked&&(d.lineColor=c)})},updateElementLineColorAboveFoundation(a,l,s){i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&!u.locked&&(u.lineColor=s)})},updateElementLineColorForAll(a,l){i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.lineColor=l)})},updateElementLineWidthById(a,l){i(s=>{for(const c of s.elements)if(c.id===a){c.lineWidth=l;break}})},updateElementLineWidthOnSurface(a,l,s,c){i(u=>{for(const d of u.elements)d.type===a&&d.parentId===l&&me.isIdentical(d.normal,s)&&!d.locked&&(d.lineWidth=c)})},updateElementLineWidthAboveFoundation(a,l,s){i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&!u.locked&&(u.lineWidth=s)})},updateElementLineWidthForAll(a,l){i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.lineWidth=l)})},updateElementCxById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.cx=l,c.type===z.SolarPanel&&c.parentType===z.Roof&&(s.updateElementOnRoofFlag=!0);break}})},updateElementCyById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.cy=l,c.type===z.SolarPanel&&c.parentType===z.Roof&&(s.updateElementOnRoofFlag=!0);break}})},updateElementCzById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.cz=l;break}})},updateElementCzForAll(a,l){i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.cz=l)})},updateElementLxById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.lx=l;break}})},updateElementLxAboveFoundation(a,l,s){i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&!u.locked&&(u.lx=s)})},updateElementLxOnSurface(a,l,s,c){i(u=>{for(const d of u.elements)if(d.type===a&&!d.locked){let f;s?f=d.parentId===l&&me.isIdentical(d.normal,s):f=d.parentId===l,f&&(d.lx=c)}})},updateElementLxForAll(a,l){i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.lx=l)})},updateElementLyById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.ly=l;break}})},updateElementLyAboveFoundation(a,l,s){i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&!u.locked&&(u.ly=s)})},updateElementLyOnSurface(a,l,s,c){i(u=>{for(const d of u.elements)if(d.type===a&&!d.locked){let f;s?f=d.parentId===l&&me.isIdentical(d.normal,s):f=d.parentId===l,f&&(d.ly=c)}})},updateElementLyForAll(a,l){i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.ly=l)})},updateElementLzById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.lz=l;break}})},updateElementLzAboveFoundation(a,l,s){i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&!u.locked&&(u.lz=s)})},updateElementLzOnSurface(a,l,s,c){i(u=>{for(const d of u.elements)if(d.type===a&&!d.locked){let f;s?f=d.parentId===l&&me.isIdentical(d.normal,s):f=d.parentId===l,f&&(d.lz=c)}})},updateElementLzForAll(a,l){i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.lz=l)})},updateElementRotationById(a,l,s,c){i(u=>{for(const d of u.elements)(d.id===a&&!d.locked||d.parentId===a&&!w$e(d)&&d.type!==z.SolarPanel)&&(d.rotation[0]=l,d.rotation[1]=s,d.rotation[2]=c);u.selectedElementAngle=c})},updateElementRotationForAll(a,l,s,c){i(u=>{for(const d of u.elements)if(d.type===a)d.locked||(d.rotation[0]=l,d.rotation[1]=s,d.rotation[2]=c);else{const f=u.getParent(d);f&&!f.locked&&f.type===a&&(d.rotation[0]=l,d.rotation[1]=s,d.rotation[2]=c)}})},updateSolarCollectorDrawSunBeamById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked&&me.isSolarCollector(c)){c.drawSunBeam=l;break}})},updateSolarCollectorDrawSunBeamAboveFoundation(a,l,s){me.isSolarCollectorType(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&u.type===a&&(u.drawSunBeam=s)})},updateSolarCollectorDrawSunBeamForAll(a,l){me.isSolarCollectorType(a)&&i(s=>{for(const c of s.elements)c.locked||c.type===a&&(c.drawSunBeam=l)})},updateSolarCollectorRelativeAzimuthById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked&&me.isSolarCollector(c)){c.relativeAzimuth=l,s.selectedElementAngle=l;break}})},updateSolarCollectorRelativeAzimuthAboveFoundation(a,l,s){me.isSolarCollectorType(a)&&i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&!u.locked&&u.parentType!==z.Wall&&(u.relativeAzimuth=s)})},updateSolarCollectorRelativeAzimuthOnSurface(a,l,s,c){me.isSolarCollectorType(a)&&i(u=>{for(const d of u.elements)if(d.type===a&&!d.locked){let f;s?f=d.parentId===l&&me.isIdentical(d.normal,s):f=d.parentId===l,f&&(d.relativeAzimuth=c)}})},updateSolarCollectorRelativeAzimuthForAll(a,l){me.isSolarCollectorType(a)&&i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&c.parentType!==z.Wall&&(c.relativeAzimuth=l)})},updateSolarCollectorXById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked&&me.isSolarCollector(c)){c.cx=l;break}})},updateSolarCollectorXAboveFoundation(a,l,s){me.isSolarCollectorType(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&u.type===a&&(u.cx=s)})},updateSolarCollectorXForAll(a,l){me.isSolarCollectorType(a)&&i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.cx=l)})},updateSolarCollectorYById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked&&me.isSolarCollector(c)){c.cy=l;break}})},updateSolarCollectorYAboveFoundation(a,l,s){me.isSolarCollectorType(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&u.type===a&&(u.cy=s)})},updateSolarCollectorYForAll(a,l){me.isSolarCollectorType(a)&&i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.cy=l)})},updateSolarCollectorPoleHeightById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked&&me.isSolarCollector(c)){c.poleHeight=l;break}})},updateSolarCollectorPoleHeightAboveFoundation(a,l,s){me.isSolarCollectorType(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&u.type===a&&(u.poleHeight=s)})},updateSolarCollectorPoleHeightOnSurface(a,l,s,c){me.isSolarCollectorType(a)&&i(u=>{for(const d of u.elements)if(!d.locked&&d.type===a){let f;s?f=d.parentId===l&&me.isIdentical(d.normal,s):f=d.parentId===l,f&&(d.poleHeight=c)}})},updateSolarCollectorPoleHeightForAll(a,l){me.isSolarCollectorType(a)&&i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.poleHeight=l)})},updateSolarCollectorPoleRadiusById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked&&me.isSolarCollector(c)){c.poleRadius=l;break}})},updateSolarCollectorPoleRadiusAboveFoundation(a,l,s){me.isSolarCollectorType(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&u.type===a&&(u.poleRadius=s)})},updateSolarCollectorPoleRadiusOnSurface(a,l,s,c){me.isSolarCollectorType(a)&&i(u=>{for(const d of u.elements)if(!d.locked&&d.type===a){let f;s?f=d.parentId===l&&me.isIdentical(d.normal,s):f=d.parentId===l,f&&(d.poleRadius=c)}})},updateSolarCollectorPoleRadiusForAll(a,l){me.isSolarCollectorType(a)&&i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.poleRadius=l)})},clearAllSolarCollectorYields(){i(a=>{for(const l of a.elements)if(me.isSolarCollector(l)){const s=l;s.dailyYield=0,s.yearlyYield=0}})},updateSolarCollectorDailyYieldById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&me.isSolarCollector(c)){c.dailyYield=l;break}})},updateSolarCollectorYearlyYieldById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&me.isSolarCollector(c)){c.yearlyYield=l;break}})},updateCspReflectanceById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&me.isCspCollector(c)){c.reflectance=l;break}})},updateCspReflectanceAboveFoundation(a,l,s){me.isCspCollectorType(a)&&i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&(u.reflectance=s)})},updateCspReflectanceForAll(a,l){me.isCspCollectorType(a)&&i(s=>{for(const c of s.elements)c.type===a&&(c.reflectance=l)})},updateParabolicCollectorAbsorptanceById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&me.isParabolicCollector(c)){c.absorptance=l;break}})},updateParabolicCollectorAbsorptanceAboveFoundation(a,l,s){me.isParabolaType(a)&&i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&(u.absorptance=s)})},updateParabolicCollectorAbsorptanceForAll(a,l){me.isParabolaType(a)&&i(s=>{for(const c of s.elements)c.type===a&&(c.absorptance=l)})},updateParabolicCollectorOpticalEfficiencyById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&me.isParabolicCollector(c)){c.opticalEfficiency=l;break}})},updateParabolicCollectorOpticalEfficiencyAboveFoundation(a,l,s){me.isParabolaType(a)&&i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&(u.opticalEfficiency=s)})},updateParabolicCollectorOpticalEfficiencyForAll(a,l){me.isParabolaType(a)&&i(s=>{for(const c of s.elements)c.type===a&&(c.opticalEfficiency=l)})},updateParabolicCollectorThermalEfficiencyById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&me.isParabolicCollector(c)){c.thermalEfficiency=l;break}})},updateParabolicCollectorThermalEfficiencyAboveFoundation(a,l,s){me.isParabolaType(a)&&i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&(u.thermalEfficiency=s)})},updateParabolicCollectorThermalEfficiencyForAll(a,l){me.isParabolaType(a)&&i(s=>{for(const c of s.elements)c.type===a&&(c.thermalEfficiency=l)})},foundationActionScope:oe.OnlyThisObject,setFoundationActionScope(a){i(l=>{l.foundationActionScope=a})},cuboidActionScope:oe.OnlyThisObject,setCuboidActionScope(a){i(l=>{l.cuboidActionScope=a})},polygonActionScope:oe.OnlyThisObject,setPolygonActionScope(a){i(l=>{l.polygonActionScope=a})},updatePolygonVertexPositionById(a,l,s,c){i(u=>{for(const d of u.elements)if(d.type===z.Polygon&&d.id===a){const f=d;l>=0&&l{for(const c of s.elements)if(c.type===z.Polygon&&c.id===a){const u=c;u.vertices=l;break}})},waterHeaterActionScope:oe.OnlyThisObject,setWaterHeaterActionScope(a){i(l=>{l.waterHeaterActionScope=a})},solarPanelActionScope:oe.OnlyThisObject,setSolarPanelActionScope(a){i(l=>{l.solarPanelActionScope=a})},updateSolarPanelTiltAngleById(a,l){i(s=>{for(const c of s.elements)if(c.type===z.SolarPanel&&c.id===a&&!c.locked){const u=c;u.tiltAngle=l;break}})},setSolarPanelOrientation(a,l,s){if(a.orientation=s,a.orientation===vr.portrait){const c=Math.max(1,Math.round(a.lx/l.width)),u=Math.max(1,Math.round(a.ly/l.length));a.lx=c*l.width,a.ly=u*l.length}else{const c=Math.max(1,Math.round(a.lx/l.length)),u=Math.max(1,Math.round(a.ly/l.width));a.lx=c*l.length,a.ly=u*l.width}},parabolicTroughActionScope:oe.OnlyThisObject,setParabolicTroughActionScope(a){i(l=>{l.parabolicTroughActionScope=a})},fresnelReflectorActionScope:oe.OnlyThisObject,setFresnelReflectorActionScope(a){i(l=>{l.fresnelReflectorActionScope=a})},heliostatActionScope:oe.OnlyThisObject,setHeliostatActionScope(a){i(l=>{l.heliostatActionScope=a})},updateSolarReceiverById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){if(c.type===z.Heliostat){c.towerId=l;break}else if(c.type===z.FresnelReflector){c.receiverId=l;break}}})},updateSolarReceiverAboveFoundation(a,l,s){me.isHeliostatOrFresnelReflector(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&(u.type===z.Heliostat?u.towerId=s:u.type===z.FresnelReflector&&(u.receiverId=s))})},updateSolarReceiverForAll(a,l){me.isHeliostatOrFresnelReflector(a)&&i(s=>{for(const c of s.elements)c.locked||(c.type===z.Heliostat?c.towerId=l:c.type===z.FresnelReflector&&(c.receiverId=l))})},parabolicDishActionScope:oe.OnlyThisObject,setParabolicDishActionScope(a){i(l=>{l.parabolicDishActionScope=a})},updateModuleLengthById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){if(c.type===z.ParabolicTrough){c.moduleLength=l;break}else if(c.type===z.FresnelReflector){c.moduleLength=l;break}}})},updateModuleLengthAboveFoundation(a,l,s){me.isParabolicTroughOrFresnelReflector(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&(u.type===z.ParabolicTrough||u.type===z.FresnelReflector)&&(u.moduleLength=s)})},updateModuleLengthForAll(a,l){me.isParabolicTroughOrFresnelReflector(a)&&i(s=>{for(const c of s.elements)c.locked||(c.type===z.ParabolicTrough||c.type===z.FresnelReflector)&&(c.moduleLength=l)})},updateParabolaLatusRectumById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){(c.type===z.ParabolicTrough||c.type===z.ParabolicDish)&&(c.latusRectum=l);break}})},updateParabolaLatusRectumAboveFoundation(a,l,s){me.isParabolaType(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&(u.type===z.ParabolicTrough||u.type===z.ParabolicDish)&&(u.latusRectum=s)})},updateParabolaLatusRectumForAll(a,l){me.isParabolaType(a)&&i(s=>{for(const c of s.elements)c.locked||(c.type===z.ParabolicTrough||c.type===z.ParabolicDish)&&(c.latusRectum=l)})},windTurbineActionScope:oe.OnlyThisObject,setWindTurbineActionScope(a){i(l=>{l.windTurbineActionScope=a})},wallActionScope:oe.OnlyThisObject,setWallActionScope(a){i(l=>{l.wallActionScope=a})},roofActionScope:oe.OnlyThisObject,setRoofActionScope(a){i(l=>{l.roofActionScope=a})},windowActionScope:oe.OnlyThisObject,setWindowActionScope(a){i(l=>{l.windowActionScope=a})},doorActionScope:oe.OnlyThisObject,setDoorActionScope(a){i(l=>{l.doorActionScope=a})},updateWallRelativeAngleById(a,l){i(s=>{for(const c of s.elements)if(c.type===z.Wall&&c.id===a&&!c.locked){c.relativeAngle=l;break}})},updateWallLeftJointsById(a,l){i(s=>{for(const c of s.elements)if(c.type===z.Wall&&c.id===a){c.leftJoints=l;break}})},updateWallRightJointsById(a,l){i(s=>{for(const c of s.elements)if(c.type===z.Wall&&c.id===a){c.rightJoints=l;break}})},updateWallLeftPointById(a,l){i(s=>{for(const c of s.elements)if(c.type===z.Wall&&c.id===a&&!c.locked){c.leftPoint=[...l];break}})},updateWallRightPointById(a,l){i(s=>{for(const c of s.elements)if(c.type===z.Wall&&c.id===a&&!c.locked){c.rightPoint=[...l];break}})},updateRoofRiseById(a,l,s){i(c=>{for(const u of c.elements)if(u.id===a&&u.type===z.Roof){u.rise=l,c.actionState.roofRise=l,s!==void 0&&(c.selectedElementHeight=s);break}})},updateRoofStructureById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&c.type===z.Roof){const u=c;u.roofStructure=l;break}})},updateInsideLightById(a,l){i(s=>{for(const c of s.elements)if(c.type===z.Light&&c.id===a){c.inside=l;break}})},updateInsideLightsByParentId(a,l){i(s=>{for(const c of s.elements)c.parentId===a&&c.type===z.Light&&(c.inside=l)})},setElementPosition(a,l,s,c){i(u=>{for(const[d,f]of u.elements.entries())if(f.id===a){u.elements[d].cx=l,u.elements[d].cy=s,c!==void 0&&(u.elements[d].cz=c);break}})},setElementNormal(a,l,s,c){i(u=>{for(const[d,f]of u.elements.entries())if(f.id===a||f.parentId===a){const p=u.elements[d];p.normal[0]=l,p.normal[1]=s,p.normal[2]=c}})},setElementSize(a,l,s,c){i(u=>{for(const[d,f]of u.elements.entries())if(f.id===a){u.elements[d].lx=l,u.elements[d].ly=s,c&&(u.elements[d].lz=c,u.selectedElementHeight=c);break}})},actionModeLock:!1,objectTypeToAdd:z.None,addElement(a,l,s){let c=null;const u="id"in a?a.id:Zo;return i(d=>{switch(d.objectTypeToAdd){case z.Human:{const f=new ie().copy(l);if(u!==Zo){const{rot:g,pos:y}=me.getWorldDataById(u);f.sub(new ie(y.x,y.y,y.z)).applyEuler(new nn(0,0,-g))}const p=Ga.makeHuman(d.actionState.humanName,u,f.x,f.y,f.z);c=p,d.elements.push(p);break}case z.Tree:{const f=new ie().copy(l);if(u!==Zo){const{rot:g,pos:y}=me.getWorldDataById(u);f.sub(new ie(y.x,y.y,y.z)).applyEuler(new nn(0,0,-g))}const p=Ga.makeTree(d.actionState.treeType,d.actionState.treeSpread,d.actionState.treeHeight,u,f.x,f.y,f.z);c=p,d.elements.push(p);break}case z.Flower:{const f=new ie().copy(l);if(u!==Zo){const{rot:g,pos:y}=me.getWorldDataById(u);f.sub(new ie(y.x,y.y,y.z)).applyEuler(new nn(0,0,-g))}const p=Ga.makeFlower(d.actionState.flowerType,u,f.x,f.y,f.z);c=p,d.elements.push(p);break}case z.Polygon:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f),g=Ga.makePolygon(f,p.x,p.y,p.z,s,"rotation"in a?a.rotation:void 0,f.type);c=g,d.elements.push(g);break}case z.Sensor:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f),g=Ga.makeSensor(f,p.x,p.y,p.z,s,"rotation"in a?a.rotation:void 0);c=g,d.elements.push(g);break}case z.Light:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f),g=Ga.makeLight(f,2,d.actionState.lightDistance,d.actionState.lightIntensity,d.actionState.lightColor,p.x,p.y,p.z,s,"rotation"in a?a.rotation:void 0);c=g,d.elements.push(g);break}case z.SolarPanel:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f,!0),g=Ga.makeSolarPanel(f,d.getPvModule(d.actionState.solarPanelModelName??"SPR-X21-335-BLK"),p.x,p.y,p.z,d.actionState.solarPanelOrientation??vr.landscape,d.actionState.solarPanelPoleHeight??1,d.actionState.solarPanelPoleSpacing??3,d.actionState.solarPanelTiltAngle??0,d.actionState.solarPanelRelativeAzimuth??0,s,[0,0,0],d.actionState.solarPanelFrameColor??"white");c=g,d.elements.push(g);break}case z.ParabolicTrough:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f),g=Ga.makeParabolicTrough(f,d.actionState.parabolicTroughReflectance,d.actionState.parabolicTroughAbsorptance,d.actionState.parabolicTroughOpticalEfficiency,d.actionState.parabolicTroughThermalEfficiency,d.actionState.parabolicTroughLatusRectum,d.actionState.parabolicTroughPoleHeight,d.actionState.parabolicTroughModuleLength,p.x,p.y,p.z,s,"rotation"in a?a.rotation:void 0,d.actionState.parabolicTroughWidth);c=g,d.elements.push(g);break}case z.ParabolicDish:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f),g=Ga.makeParabolicDish(f,d.actionState.parabolicDishReflectance,d.actionState.parabolicDishAbsorptance,d.actionState.parabolicDishOpticalEfficiency,d.actionState.parabolicDishThermalEfficiency,d.actionState.parabolicDishLatusRectum,d.actionState.parabolicDishPoleHeight,d.actionState.parabolicDishReceiverStructure,p.x,p.y,p.z,s,"rotation"in a?a.rotation:void 0,d.actionState.parabolicDishRimDiameter,d.actionState.parabolicDishRimDiameter);c=g,d.elements.push(g);break}case z.FresnelReflector:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f),g=Ga.makeFresnelReflector(f,d.actionState.fresnelReflectorReceiver,d.actionState.fresnelReflectorReflectance,d.actionState.fresnelReflectorPoleHeight,d.actionState.fresnelReflectorModuleLength,p.x,p.y,p.z,s,"rotation"in a?a.rotation:void 0,d.actionState.fresnelReflectorWidth);c=g,d.elements.push(g);break}case z.Heliostat:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f),g=Ga.makeHeliostat(f,d.actionState.heliostatTower,d.actionState.heliostatReflectance,d.actionState.heliostatPoleHeight,p.x,p.y,p.z,s,"rotation"in a?a.rotation:void 0,d.actionState.heliostatLength,d.actionState.heliostatWidth);c=g,d.elements.push(g);break}case z.WindTurbine:{const f=a,p=me.relativeCoordinates(l.x,l.y,0,f),g=Ga.makeWindTurbine(f,d.actionState.windTurbineBirdSafeDesign??uc.None,d.actionState.windTurbineBladeColor??t9,d.actionState.windTurbineStripeColor??n9,d.actionState.windTurbineNumberOfBlades??3,d.actionState.windTurbineInitialRotorAngle??0,d.actionState.windTurbineRelativeYawAngle??0,d.actionState.windTurbinePitchAngle??Math.PI/18,d.actionState.windTurbineBladeRadius??10,d.actionState.windTurbineBladeRootRadius??.3,d.actionState.windTurbineBladeMaximumChordLength??1,d.actionState.windTurbineBladeMaximumChordRadius??3,d.actionState.windTurbineTowerRadius??.5,d.actionState.windTurbineTowerHeight??20,d.actionState.windTurbineHubRadius??.75,d.actionState.windTurbineHubLength??1.5,p.x,p.y,0);c=g,d.elements.push(g);break}case z.Foundation:{const f=Ga.makeFoundation(l.x,l.y,d.actionState.foundationHeight,d.actionState.foundationColor,d.actionState.foundationTexture);c=f,d.elements.push(f);break}case z.Cuboid:{const f=Ga.makeCuboid(l.x,l.y,d.actionState.cuboidHeight,d.actionState.cuboidFaceColors,d.actionState.cuboidFaceTextures);c=f,d.elements.push(f);break}case z.Wall:{const f=a,p=me.wallRelativePosition(new ie(l.x,l.y),f),g=Ga.makeWall(f,p.x,p.y,p.z,s);d.elements.push(g),d.selectedElement=g,c=g;break}}c&&(d.selectedElementIdSet.clear(),d.selectedElementIdSet.add(c.id))}),c},elementsToPaste:[],deletedElements:[],clearDeletedElements(){i(a=>{a.deletedElements=[]})},pastePoint:new ie,pasteNormal:void 0,copyElementById(a){i(l=>{l.elementsToPaste=[];for(const s of l.elements)if(s.id===a){if(s.type===z.Polygon){const c=me.calculatePolygonCentroid(s.vertices);s.cx=c.x,s.cy=c.y,l.elementsToPaste.push(s)}else l.elementsToPaste.push(s);break}for(const s of l.elements)if(me.isChild(a,s.id)){if(s.type===z.Polygon){const c=me.calculatePolygonCentroid(s.vertices);s.cx=c.x,s.cy=c.y}l.elementsToPaste.push(s)}})},removeSelectedElements(){const a=e().selectedElementIdSet;if(a.size===0)return[];const l=Array.from(a),s=new Set,c=new Set;for(const u of e().elements)if(a.has(u.id))s.add(u),c.add(u.id);else for(const d of l)me.isChild(d,u.id)&&(s.add(u),c.add(u.id));return i(u=>{u.autoDeletedRoofs=[],u.deletedElements=Array.from(s),u.elements=u.elements.filter(d=>{var f,p;if(c.has(d.id)){switch(d.type){case z.Wall:{const g=d;let y="",w="";g.leftJoints.length>0&&(y=((f=u.getElementById(g.leftJoints[0]))==null?void 0:f.id)??""),g.rightJoints.length>0&&(w=((p=u.getElementById(g.rightJoints[0]))==null?void 0:p.id)??"");for(const b of u.elements)b.id===y?b.rightJoints=[]:b.id===w&&(b.leftJoints=[]);u.updateWallMapOnFoundationFlag=!u.updateWallMapOnFoundationFlag;break}case z.Roof:{u.deletedRoofIdSet.add(d.id),Tn.getState().deleteRoofSegmentVertices(d.id),Tn.getState().deleteRoofSegmentVerticesWithoutOverhang(d.id);break}}return!1}else return!0})}),Array.from(s)},removeElementById(a,l,s=!0,c){const u=e().elements.filter(d=>d.id===a||me.isChild(a,d.id));return i(d=>{var f,p;for(const g of d.elements)if(g.id===a){if(l)if(g.type===z.Polygon){const y=me.calculatePolygonCentroid(g.vertices);g.cx=y.x,g.cy=y.y,d.elementsToPaste=[g]}else d.elementsToPaste=[g];else c||(d.deletedElements=[g]);switch(g.selected=!1,g.type){case z.Roof:{const y=g;d.deletedRoofId=g.id,d.deletedRoofIdSet.add(g.id),Tn.getState().deleteRoofSegmentVertices(a),Tn.getState().deleteRoofSegmentVerticesWithoutOverhang(a),c&&(d.autoDeletedRoofs?d.autoDeletedRoofs.push(y):d.autoDeletedRoofs=[y],d.autoDeletedRoofIdSet.add(y.id));break}case z.Wall:{const y=g;let w="",b="";y.leftJoints.length>0&&(w=((f=d.getElementById(y.leftJoints[0]))==null?void 0:f.id)??""),y.rightJoints.length>0&&(b=((p=d.getElementById(y.rightJoints[0]))==null?void 0:p.id)??"");for(const C of d.elements)C.id===w?C.rightJoints=[]:C.id===b&&(C.leftJoints=[]);d.elements=d.elements.filter(C=>!(C.type===z.Roof&&C.wallsId.length===0)),d.updateWallMapOnFoundationFlag=!d.updateWallMapOnFoundationFlag,d.deletedWallId=g.id;break}case z.Foundation:{d.deletedFoundationId=g.id;break}case z.Cuboid:{d.deletedCuboidId=g.id;break}}break}if(c)for(const g of d.elements)me.isChild(a,g.id)&&(d.autoDeletedChild?d.autoDeletedChild.push(g):d.autoDeletedChild=[g]);else if(l)for(const g of d.elements)me.isChild(a,g.id)&&d.elementsToPaste.push(g);else for(const g of d.elements)me.isChild(a,g.id)&&d.deletedElements.push(g);d.elements=d.elements.filter(g=>g.id===a||g.parentId===a||g.foundationId===a||me.isChild(a,g.id)?(g.type===z.Roof&&(Tn.getState().deleteRoofSegmentVertices(a),Tn.getState().deleteRoofSegmentVerticesWithoutOverhang(a)),!1):!0),d.selectedElementIdSet.delete(a),s&&(d.selectedElement=null,d.selectedElementIdSet.clear())}),u},removeElementsByType(a){i(l=>{a===z.Foundation?l.elements=l.elements.filter(s=>s.locked||s.type!==z.Foundation&&!s.foundationId?!0:(s.type===z.Roof&&(Tn.getState().deleteRoofSegmentVertices(s.id),Tn.getState().deleteRoofSegmentVerticesWithoutOverhang(s.id)),!1)):l.elements=l.elements.filter(s=>s.locked||s.type!==a?!0:(s.type===z.Roof&&(Tn.getState().deleteRoofSegmentVertices(s.id),Tn.getState().deleteRoofSegmentVerticesWithoutOverhang(s.id)),!1))})},countElementsByType(a,l){let s=0;if(l)for(const c of e().elements)c.type===a&&!c.locked&&s++;else for(const c of e().elements)c.type===a&&s++;return s},countSolarStructuresByType(a,l){let s=0;if(l)for(const c of e().elements)c.type===z.Foundation&&!c.locked&&c.solarStructure===a&&s++;else for(const c of e().elements)c.type===z.Foundation&&c.solarStructure===a&&s++;return s},countObservers(){let a=0;for(const l of e().elements)l.type===z.Human&&l.observer&&a++;return a},removeElementsByReferenceId(a,l){i(s=>{if(l){s.deletedElements=[];for(const c of s.elements)c.referenceId===a&&s.deletedElements.push(c)}s.elements=s.elements.filter(c=>c.referenceId!==a)})},countElementsByReferenceId(a){let l=0;for(const s of e().elements)s.referenceId===a&&l++;return l},getChildren(a){const l=[];for(const s of e().elements)s.parentId===a&&l.push(s);return l},getChildrenOfType(a,l){const s=[];for(const c of e().elements)c.type===a&&c.parentId===l&&s.push(c);return s},removeAllChildElementsByType(a,l){i(s=>{s.elements=s.elements.filter(c=>c.locked||c.type!==l||c.parentId!==a),l===z.Wall&&(s.updateWallMapOnFoundationFlag=!s.updateWallMapOnFoundationFlag)})},removeAllElementsOnFoundationByType(a,l){i(s=>{s.elements=s.elements.filter(c=>c.locked||c.type!==l||c.foundationId!==a),l===z.Wall&&(s.updateWallMapOnFoundationFlag=!s.updateWallMapOnFoundationFlag)})},countAllElements(a){let l=0;if(a)for(const s of e().elements)s.locked||l++;else l=e().elements.length;return l},countAllElementsByType(a){const l=new XSe;for(const s of e().elements)if(s.locked?l.lockedCount++:l.unlockedCount++,!(a&&s.locked))switch(s.type){case z.Foundation:{s.solarStructure===Dn.UpdraftTower&&l.solarUpdraftTowerCount++,l.foundationCount++;break}case z.Cuboid:{l.cuboidCount++;break}case z.Wall:{l.wallCount++;break}case z.Window:{l.windowCount++;break}case z.Door:{l.doorCount++;break}case z.Human:{l.humanCount++;break}case z.Tree:{l.treeCount++;break}case z.Flower:{l.flowerCount++;break}case z.Polygon:{l.polygonCount++;break}case z.Sensor:{l.sensorCount++;break}case z.Light:{s.inside?l.insideLightCount++:l.outsideLightCount++;break}case z.SolarPanel:{l.solarPanelCount++;const c=s,u=e().getPvModule(c.pvModelName);u&&(l.solarPanelModuleCount+=me.countSolarPanelsOnRack(c,u));break}case z.ParabolicDish:{l.parabolicDishCount++;break}case z.ParabolicTrough:{l.parabolicTroughCount++;break}case z.FresnelReflector:{l.fresnelReflectorCount++;break}case z.Heliostat:{l.heliostatCount++;break}case z.WindTurbine:{l.windTurbineCount++;break}}return l},countAllOffspringsByTypeAtOnce(a,l){const s=new XSe;for(const c of e().elements){const u=c.parentId===a||c.foundationId===a;if(u&&(c.locked?s.lockedCount++:s.unlockedCount++),(l||!c.locked)&&u)switch(c.type){case z.Foundation:{c.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTowerCount++,s.foundationCount++;break}case z.Cuboid:{s.cuboidCount++;break}case z.Wall:{s.wallCount++;break}case z.Window:{s.windowCount++,c.locked&&s.lockedWindowCount++;break}case z.Door:{s.doorCount++,c.locked&&s.lockedDoorCount++;break}case z.Human:{s.humanCount++;break}case z.Tree:{s.treeCount++;break}case z.Flower:{s.flowerCount++;break}case z.Polygon:{s.polygonCount++,c.locked&&s.lockedPolygonCount++;break}case z.Sensor:{s.sensorCount++,c.locked&&s.lockedSensorCount++;break}case z.Light:{c.inside?s.insideLightCount++:s.outsideLightCount++,c.locked&&s.lockedLightCount++;break}case z.SolarPanel:{s.solarPanelCount++,c.locked&&s.lockedSolarPanelCount++;const d=c,f=e().getPvModule(d.pvModelName);f&&(s.solarPanelModuleCount+=me.countSolarPanelsOnRack(d,f));break}case z.ParabolicDish:{s.parabolicDishCount++;break}case z.ParabolicTrough:{s.parabolicTroughCount++;break}case z.FresnelReflector:{s.fresnelReflectorCount++;break}case z.Heliostat:{s.heliostatCount++;break}case z.WindTurbine:{s.windTurbineCount++,c.locked&&s.lockedWindTurbineCount++;break}}}return s},countSolarPanelsOnRack(a){let l=0;for(const s of e().elements)if(s.id===a&&s.type===z.SolarPanel){const c=s,u=e().getPvModule(c.pvModelName);if(u){l=me.countSolarPanelsOnRack(c,u);break}}return l},copyCutElements(){const a=[],l=new Map,s=new Map,c=new Map;for(let u=0;ug.id===d.parentId);if(p){const g=l.get(p.id);g&&(e().getElementById(d.id)?(f=Yl.clone(g,d,d.cx,d.cy,d.cz,d.type===z.Polygon),(f==null?void 0:f.type)===z.SolarPanel&&(f.rotation=[...d.rotation],f.normal=[...d.normal])):f=JSON.parse(JSON.stringify(d)))}}f&&(l.set(d.id,f),s.set(d.id,f.id),c.set(f.id,d.id),a.push(f))}for(const u of a){if(u.type===z.Roof){const d=c.get(u.id);if(d)for(const f of e().elementsToPaste)f.id===d&&(u.wallsId=f.wallsId.map(p=>s.get(p)))}if(u.type===z.Wall){const d=c.get(u.id);if(d){for(const f of e().elementsToPaste)if(f.id===d&&f.type===z.Wall){const p=f,g=s.get(p.leftJoints[0]);g&&(u.leftJoints=[g]);const y=s.get(p.rightJoints[0]);if(y&&(u.rightJoints=[y]),p.roofId){const w=s.get(p.roofId);w&&(u.roofId=w)}break}}}}return a},pasteElementsToPoint(){const a=[];return i(l=>{if(l.elementsToPaste.length===1){let s=l.pastePoint;const c=l.elementsToPaste[0];let u=l.selectedElement;const d=l.getParent(c);if(u){if(u.type===z.Polygon){const p=l.getParent(u);p&&(u=p,c.parentId=u.id,me.isPositionRelative(c.type)&&(s=me.relativeCoordinates(s.x,s.y,s.z,u)))}else if(u.type===z.Roof){if(u.parentId){const p=l.getElementById(u.parentId);p&&(c.type===z.SolarPanel?s.sub(new ie(p.cx,p.cy,p.cz)).applyEuler(new nn(0,0,-p.rotation[2])):(s.sub(new ie(p.cx,p.cy,p.lz)).applyEuler(new nn(0,0,-p.rotation[2])),c.type!==z.Window&&(s.setX(s.x/p.lx),s.setY(s.y/p.ly))))}}else if(u.type===z.Cuboid){if(c.type===z.Cuboid){const{pos:p}=me.getWorldDataById(u.id);s.sub(p)}else me.isPositionRelative(c.type)&&(c.type===z.SolarPanel?s=me.relativeCoordinates(s.x,s.y,s.z,u,!0):s=me.relativeCoordinates(s.x,s.y,s.z,u));c.parentId=u.id}else u.type===z.Wall?s=me.relativeCoordinates(s.x,s.y,s.z,u):d&&d.type&&c.type!==z.Foundation&&(c.parentId=u.id,me.isPositionRelative(c.type)&&(c.type===z.SolarPanel?s=me.relativeCoordinates(s.x,s.y,s.z,u,!0):s=me.relativeCoordinates(s.x,s.y,s.z,u)));c.type===z.Wall&&s.set(s.x*u.lx,s.y*u.ly,0)}const f=Yl.clone(u,c,s.x,s.y,s.z,!1,l.pasteNormal,d);if(f){l.pasteNormal&&(u==null?void 0:u.type)===z.Cuboid&&(f.normal=l.pasteNormal.toArray(),f.rotation=Cn.getRotationFromNormal(l.pasteNormal));const p={lng:l.language};let g=!1;switch(f.type){case z.Cuboid:{const y=C=>{const P=[];for(const v of e().elements)if(v.parentId===C.id)switch(P.push(v),v.type){case z.Cuboid:case z.Foundation:case z.Wall:case z.Roof:P.push(...y(v))}return P},w=y(c),b=new Map;a.push(f),b.set(c.id,f);for(const C of w){const P=b.get(C.parentId);if(P){const v=Yl.clone(P,C,C.cx,C.cy,C.cz,C.type===z.Polygon);v&&(f.normal&&(v.normal=[...C.normal]),a.push(v),b.set(C.id,v))}}l.elements.push(...a),l.elementsToPaste=[f],g=!1;break}case z.Foundation:{const y=new Map,w=new Map;for(const b of l.elements)if(b.parentId===c.id){const C=Yl.clone(f,b,b.cx,b.cy,b.cz,b.type===z.Polygon);if(C&&(f.normal&&(C.normal=[...b.normal]),a.push(C),(C==null?void 0:C.type)===z.Wall||(C==null?void 0:C.type)===z.Roof)){y.set(C.id,b.id),w.set(b.id,C.id);for(const P of l.elements)if(P.parentId===b.id){const v=Yl.clone(C,P,P.cx,P.cy,P.cz);v&&(b.normal&&(v.normal=[...P.normal]),a.push(v))}}}l.elements.push(...a),g=!0;for(const b of l.elements){if(b.type===z.Roof){const C=y.get(b.id);if(C){const P=e().getElementById(C);P&&(b.wallsId=P.wallsId.map(v=>w.get(v)))}}if(b.type===z.Wall){const C=y.get(b.id);if(C){for(const P of l.elements)if(P.id===C&&P.type===z.Wall){const v=P,T=w.get(v.leftJoints[0]);T&&(b.leftJoints=[T]);const A=w.get(v.rightJoints[0]);if(A&&(b.rightJoints=[A]),v.roofId){const x=w.get(v.roofId);x&&(b.roofId=x)}break}}}}break}case z.SolarPanel:{if((u==null?void 0:u.type)===z.Wall){if(u)switch(me.checkElementOnWallState(f,u)){case ga.Valid:{const y=u.relativeAngle-Gt;f.normal=[Math.cos(y),Math.sin(y),0],g=!0;break}case ga.OverLap:po(Y.t("message.CannotPasteBecauseOfOverlap",p));break;case ga.OutsideBoundary:po(Y.t("message.CannotPasteOutsideBoundary",p));break}break}if(u&&u.type===z.Roof){if(f.foundationId){const y=l.getElementById(f.foundationId);if(y){const w=Cn.getSolarPanelVerticesOnRoof(f,y),b=Cn.getRoofBoundaryVertices(u);if(!Cn.rooftopElementBoundaryCheck(w,b)){po(Y.t("message.CannotPasteOutsideBoundary",p));break}if(!Cn.rooftopSPCollisionCheck(f,y,w)){po(Y.t("message.CannotPasteBecauseOfOverlap",p));break}g=!0,l.updateElementOnRoofFlag=!0}}break}l.overlapWithSibling(f)?po(Y.t("message.CannotPasteBecauseOfOverlap",p)):u&&(u.type===z.Foundation||u.type===z.Cuboid&&me.isIdentical(f.normal,rs))&&me.isSolarCollector(f)?(g=me.isSolarCollectorWithinHorizontalSurface(f,u),g||po(Y.t("message.CannotPasteOutsideBoundary",p))):g=!0;break}case z.Sensor:case z.Light:case z.WindTurbine:case z.ParabolicDish:case z.Heliostat:case z.FresnelReflector:case z.ParabolicTrough:{if((u==null?void 0:u.type)===z.Wall){if(u)switch(me.checkElementOnWallState(f,u)){case ga.Valid:{const y=u.relativeAngle-Gt;f.normal=[Math.cos(y),Math.sin(y),0],g=!0;break}case ga.OverLap:po(Y.t("message.CannotPasteBecauseOfOverlap",p));break;case ga.OutsideBoundary:po(Y.t("message.CannotPasteOutsideBoundary",p));break}break}if(u&&u.type===z.Roof){if(f.foundationId){const y=l.getElementById(f.foundationId);if(y){const w=Cn.getSolarPanelVerticesOnRoof(f,y),b=Cn.getRoofBoundaryVertices(u);if(!Cn.rooftopElementBoundaryCheck(w,b)){po(Y.t("message.CannotPasteOutsideBoundary",p));break}if(!Cn.rooftopSPCollisionCheck(f,y,w)){po(Y.t("message.CannotPasteBecauseOfOverlap",p));break}g=!0,l.updateElementOnRoofFlag=!0}}break}l.overlapWithSibling(f)?po(Y.t("message.CannotPasteBecauseOfOverlap",p)):u&&(u.type===z.Foundation||u.type===z.Cuboid&&me.isIdentical(f.normal,rs))&&me.isSolarCollector(f)?(g=me.isSolarCollectorWithinHorizontalSurface(f,u),g||po(Y.t("message.CannotPasteOutsideBoundary",p))):g=!0;break}case z.Wall:{const y=new ie(f.cx,f.cy,0),w=new ie(f.lx/2,0,0),b=new ie(-f.lx/2,0,0),C=f,P=new nn(0,0,C.relativeAngle);C.leftPoint=y.clone().add(b.applyEuler(P)).toArray(),C.rightPoint=y.clone().add(w.applyEuler(P)).toArray(),C.roofId=void 0,C.leftRoofHeight=void 0,C.rightRoofHeight=void 0,C.centerLeftRoofHeight=void 0,C.centerRightRoofHeight=void 0,C.centerRoofHeight=void 0;for(const v of l.elements)if(v.parentId===c.id){const T=Yl.clone(f,v,v.cx,v.cy,v.cz,v.type===z.Polygon);T&&(f.normal&&(T.normal=[...v.normal]),a.push(T))}l.elements.push(...a),l.updateWallMapOnFoundationFlag=!l.updateWallMapOnFoundationFlag,g=!0;break}case z.Door:case z.Window:{if((u==null?void 0:u.type)===z.Wall)switch(me.checkElementOnWallState(f,u)){case ga.Valid:g=!0;break;case ga.OverLap:po(Y.t("message.CannotPasteBecauseOfOverlap",p));break;case ga.OutsideBoundary:po(Y.t("message.CannotPasteOutsideBoundary",p));break}else if((u==null?void 0:u.type)===z.Roof){const y=Cn.getRotationOnRoof(u.id,s);y&&(f.rotation=[...y]);const w=Cn.getWindowVerticesOnRoof(f),b=Cn.getRoofSegmentBoundary(u.id,s);if(!b)break;if(!Cn.rooftopElementBoundaryCheck(w,b)){po(Y.t("message.CannotPasteOutsideBoundary",p));break}if(!Cn.rooftopWindowCollisionCheck(f.id,w,u.id)){po(Y.t("message.CannotPasteBecauseOfOverlap",p));break}g=!0}break}default:if(g=!0,me.isPlantOrHuman(f))if(u){const y=l.getParent(f);if(y){const w=me.relativePoint(l.pastePoint,y);f.cx=w.x,f.cy=w.y,f.cz=w.z}}else f.parentId=Zo}g&&(l.elements.push(f),a.push(f))}}else if(l.elementsToPaste.length>1){let s=l.pastePoint;const c=l.copyCutElements();if(c.length>0){if(c[0].type===z.Cuboid){const u=l.selectedElement;if(u&&u.type===z.Cuboid){const{pos:d}=me.getWorldDataById(u.id);s.sub(d),c[0].parentId=u.id}}else if(c[0].type===z.Wall){const u=l.selectedElement;u&&u.type===z.Foundation&&(s=me.relativeCoordinates(s.x,s.y,s.z,u),s.set(s.x*u.lx,s.y*u.ly,0),c[0].parentId=u.id,c[0].foundationId=u.id)}c[0].cx=s.x,c[0].cy=s.y,c[0].cz=s.z,c[0].type===z.Foundation?c[0].cz+=c[0].lz/2:c[0].type===z.Cuboid&&(c[0].cz=c[0].lz/2),l.elements.push(...c),a.push(...c)}}a.length>0&&(l.selectedElementIdSet.clear(),l.selectedElementIdSet.add(a[0].id),l.selectedElement=a[0])}),a},pasteElementsByKey(){const a=[];return i(l=>{if(l.elementsToPaste.length>0){const s=l.elementsToPaste[0],c=l.getParent(s),u=Yl.clone(c,s,s.cx,s.cy,s.cz);if(u){let d=!1;switch(u.type){case z.Door:case z.Window:{if(c){const f=u.lx/2;if(u.cx+=f*3,c.type===z.Wall)for(;u.cx+f<.5;)if(me.checkElementOnWallState(u,c)===ga.Valid){l.elements.push(u),d=!0;break}else u.cx+=f;else if(c.type===z.Roof){const p=Cn.getRotationOnRoof(c.id,new ie(u.cx,u.cy));p&&(u.rotation=[...p]);let g=Cn.getWindowVerticesOnRoof(u),y=Cn.getRoofSegmentBoundary(c.id,new ie(u.cx,u.cy));const w=Cn.getRoofBoundaryVertices(c);for(;Cn.rooftopElementBoundaryCheck(g,w);)if(y&&Cn.rooftopElementBoundaryCheck(g,y)&&Cn.rooftopWindowCollisionCheck(u.id,g,c.id)){l.elements.push(u),d=!0;break}else{u.cx+=f/2;const b=Cn.getRotationOnRoof(c.id,new ie(u.cx,u.cy));b&&(u.rotation=[...b]),g=Cn.getWindowVerticesOnRoof(u),y=Cn.getRoofSegmentBoundary(c.id,new ie(u.cx,u.cy))}}if(!d){u.cx=s.cx-f*3;const p=Cn.getRotationOnRoof(c.id,new ie(u.cx,u.cy));if(p&&(u.rotation=[...p]),c.type===z.Wall){for(;u.cx-f>-.5;)if(c.type===z.Wall)if(me.checkElementOnWallState(u,c)===ga.Valid){l.elements.push(u),d=!0;break}else u.cx-=f}else if(c.type===z.Roof){let g=Cn.getWindowVerticesOnRoof(u),y=Cn.getRoofSegmentBoundary(c.id,new ie(u.cx,u.cy));const w=Cn.getRoofBoundaryVertices(c);for(;Cn.rooftopElementBoundaryCheck(g,w);)if(y&&Cn.rooftopElementBoundaryCheck(g,y)&&Cn.rooftopWindowCollisionCheck(u.id,g,c.id)){l.elements.push(u),d=!0;break}else{u.cx-=f;const b=Cn.getRotationOnRoof(c.id,new ie(u.cx,u.cy));b&&(u.rotation=[...b]),g=Cn.getWindowVerticesOnRoof(u),y=Cn.getRoofSegmentBoundary(c.id,new ie(u.cx,u.cy))}}}if(!d){const p={lng:l.language};po(Y.t("message.CannotPasteOutsideBoundary",p))}c.type===z.Roof&&d&&(l.updateElementOnRoofFlag=!0)}break}case z.Human:{u.cx+=1,l.elements.push(u),l.elementsToPaste=[u],d=!0;break}case z.Tree:case z.Flower:{u.cx+=u.lx,l.elements.push(u),l.elementsToPaste=[u],d=!0;break}case z.SolarPanel:{if(u.parentId){const f=l.getParent(u);if(f){if(f.type===z.Wall){const y=u.lx/f.lx/2;for(u.cx+=y*3;u.cx+y<.5;)if(me.checkElementOnWallState(u,f)===ga.Valid){l.elements.push(u),d=!0;break}else u.cx+=y;if(!d)for(u.cx=s.cx-y*3;u.cx-y>-.5;)if(me.checkElementOnWallState(u,f)===ga.Valid){l.elements.push(u),l.elementsToPaste=[u],d=!0;break}else u.cx-=y;if(!d){const w={lng:l.language};po(Y.t("message.CannotPasteOutsideBoundary",w))}break}else if(f.type===z.Roof){if(s.foundationId){const y=l.getElementById(s.foundationId);if(y){const w=Cn.getRoofBoundaryVertices(f),b=u.lx*1.25;for(u.cx+=b;u.cx+u.lx/2-y.lx/2;){const C=Cn.getSolarPanelVerticesOnRoof(u,y);if(Cn.rooftopElementBoundaryCheck(C,w)&&Cn.rooftopSPCollisionCheck(u,y,C)){l.elements.push(u),d=!0;break}else u.cx-=b}if(d)l.updateElementOnRoofFlag=!0;else{const C={lng:l.language};po(Y.t("message.CannotPasteOutsideBoundary",C))}}}break}else f.type===z.Cuboid&&(u.normal=[...s.normal],u.rotation=[...s.rotation]);const p=l.findNearestSibling(s.id);if(p){const y=l.getElementById(p);if(y){const w=u.cx,b=u.cy,C=u.cz,P=y.cx-s.cx,v=y.cy-s.cy,T=y.cz-s.cz;u.cx=y.cx+P,u.cy=y.cy+v,u.cz=y.cz+T,l.overlapWithSibling(u)&&(u.cx=s.cx-P,u.cy=s.cy-v,u.cz=s.cz-T,l.overlapWithSibling(u)&&(u.cx=s.cx-2*P,u.cy=s.cy-2*v,u.cz=s.cz-2*T,l.overlapWithSibling(u)&&(u.cx=w-P,u.cy=b-v,u.cz=C-T)))}else u.cx+=1.25*u.lx}else u.cx+=1.25*u.lx;const g={lng:l.language};l.overlapWithSibling(u)?po(Y.t("message.CannotPasteBecauseOfOverlap",g)):f.type===z.Foundation||f.type===z.Cuboid&&me.isIdentical(u.normal,rs)?me.isSolarCollectorWithinHorizontalSurface(u,f)?(l.elements.push(u),l.elementsToPaste=[u],d=!0):po(Y.t("message.CannotPasteOutsideBoundary",g)):(l.elements.push(u),l.elementsToPaste=[u],d=!0)}}break}case z.FresnelReflector:case z.Heliostat:case z.ParabolicDish:case z.ParabolicTrough:{if(u.parentId){const f=l.getParent(u);if(f){if(f.type===z.Wall){const y=u.lx/f.lx/2;for(u.cx+=y*3;u.cx+y<.5;)if(me.checkElementOnWallState(u,f)===ga.Valid){l.elements.push(u),d=!0;break}else u.cx+=y;if(!d)for(u.cx=s.cx-y*3;u.cx-y>-.5;)if(me.checkElementOnWallState(u,f)===ga.Valid){l.elements.push(u),l.elementsToPaste=[u],d=!0;break}else u.cx-=y;if(!d){const w={lng:l.language};po(Y.t("message.CannotPasteOutsideBoundary",w))}break}else if(f.type===z.Roof){if(s.foundationId){const y=l.getElementById(s.foundationId);if(y){const w=Cn.getRoofBoundaryVertices(f),b=u.lx/y.lx/2;for(u.cx+=b*1.25;u.cx+b<.5;){const C=Cn.getSolarPanelVerticesOnRoof(u,y);if(Cn.rooftopElementBoundaryCheck(C,w)&&Cn.rooftopSPCollisionCheck(u,y,C)){l.elements.push(u),d=!0;break}else u.cx+=b*1.25}if(!d)for(u.cx=s.cx-b*1.25;u.cx-b>-.5;){const C=Cn.getSolarPanelVerticesOnRoof(u,y);if(Cn.rooftopElementBoundaryCheck(C,w)&&Cn.rooftopSPCollisionCheck(u,y,C)){l.elements.push(u),d=!0;break}else u.cx-=b*1.25}if(d)l.updateElementOnRoofFlag=!0;else{const C={lng:l.language};po(Y.t("message.CannotPasteOutsideBoundary",C))}}}break}const p=l.findNearestSibling(s.id);if(p){const y=l.getElementById(p);if(y){const w=u.cx,b=u.cy,C=u.cz,P=y.cx-s.cx,v=y.cy-s.cy,T=y.cz-s.cz;u.cx=y.cx+P,u.cy=y.cy+v,u.cz=y.cz+T,l.overlapWithSibling(u)&&(u.cx=s.cx-P,u.cy=s.cy-v,u.cz=s.cz-T,l.overlapWithSibling(u)&&(u.cx=s.cx-2*P,u.cy=s.cy-2*v,u.cz=s.cz-2*T,l.overlapWithSibling(u)&&(u.cx=w-P,u.cy=b-v,u.cz=C-T)))}else u.cx+=(.01+u.lx)/f.lx}else u.cx+=(.01+u.lx)/f.lx;const g={lng:l.language};l.overlapWithSibling(u)?po(Y.t("message.CannotPasteBecauseOfOverlap",g)):f.type===z.Foundation||f.type===z.Cuboid&&me.isIdentical(u.normal,rs)?me.isSolarCollectorWithinHorizontalSurface(u,f)?(l.elements.push(u),l.elementsToPaste=[u],d=!0):po(Y.t("message.CannotPasteOutsideBoundary",g)):(l.elements.push(u),l.elementsToPaste=[u],d=!0)}}break}case z.Sensor:case z.Light:case z.WindTurbine:{if(u.parentId){const f=l.getParent(u);f&&(u.cx+=u.lx/f.lx),u.cx<.5&&(l.elements.push(u),l.elementsToPaste=[u],d=!0)}break}case z.Polygon:{const f=u;for(const p of f.vertices)p.x+=.1;f.cx+=.1,l.elements.push(f),l.elementsToPaste=[f],d=!0;break}case z.Cuboid:{if(u.cx+=u.lx,l.elementsToPaste.length===1){const f=y=>{const w=[];for(const b of e().elements)if(b.parentId===y.id)switch(w.push(b),b.type){case z.Cuboid:case z.Foundation:case z.Wall:case z.Roof:w.push(...f(b))}return w},p=f(s),g=new Map;a.push(u),g.set(s.id,u);for(const y of p){const w=g.get(y.parentId);if(w){const b=Yl.clone(w,y,y.cx,y.cy,y.cz,y.type===z.Polygon);b&&(u.normal&&(b.normal=[...y.normal]),a.push(b),g.set(y.id,b))}}l.elements.push(...a),l.elementsToPaste=[u],l.selectedElementIdSet.clear(),l.selectedElementIdSet.add(u.id),l.selectedElement=u}else if(l.elementsToPaste.length>1){const f=l.copyCutElements();f.length>0&&(f[0].cx+=f[0].lx,l.elements.push(...f),l.elementsToPaste=[...f],a.push(...f),l.selectedElementIdSet.clear(),l.selectedElementIdSet.add(f[0].id),l.selectedElement=f[0])}d=!1;break}case z.Foundation:{if(u.cx+=u.lx,l.elementsToPaste.length===1){const f=new Map,p=new Map;for(const g of l.elements)if(g.parentId===s.id&&g.parentId!==g.id){const y=Yl.clone(u,g,g.cx,g.cy,g.cz,g.type===z.Polygon);if(y&&(u.normal&&(y.normal=[...g.normal]),a.push(y),(y==null?void 0:y.type)===z.Wall||(y==null?void 0:y.type)===z.Roof)){f.set(y.id,g.id),p.set(g.id,y.id);for(const w of l.elements)if(w.parentId===g.id){const b=Yl.clone(y,w,w.cx,w.cy,w.cz);b&&(g.normal&&(b.normal=[...w.normal]),a.push(b))}}}l.elements.push(...a),l.elements.push(u),l.elementsToPaste=[u];for(const g of l.elements){if(g.type===z.Roof){const y=f.get(g.id);if(y){const w=e().getElementById(y);w&&(g.wallsId=w.wallsId.map(b=>p.get(b)))}}if(g.type===z.Wall){const y=f.get(g.id);if(y){for(const w of l.elements)if(w.id===y&&w.type===z.Wall){const b=w,C=p.get(b.leftJoints[0]);C&&(g.leftJoints=[C]);const P=p.get(b.rightJoints[0]);if(P&&(g.rightJoints=[P]),b.roofId){const v=p.get(b.roofId);v&&(g.roofId=v)}break}}}}}else if(l.elementsToPaste.length>1){const f=l.copyCutElements();f.length>0&&(f[0].cx+=f[0].lx,l.elements.push(...f),a.push(...f),l.elementsToPaste=f,l.selectedElementIdSet.clear(),l.selectedElementIdSet.add(f[0].id),l.selectedElement=f[0])}d=!0;break}case z.Wall:{const f=u,p=new ie(1,-1,0).applyEuler(new nn(0,0,f.relativeAngle));if(u.cx+=p.x,u.cy+=p.y,l.elementsToPaste.length===1){const g=new ie(u.cx,u.cy,0),y=new ie(u.lx/2,0,0),w=new ie(-u.lx/2,0,0),b=new nn(0,0,f.relativeAngle);f.leftPoint=g.clone().add(w.applyEuler(b)).toArray(),f.rightPoint=g.clone().add(y.applyEuler(b)).toArray(),f.roofId=void 0,f.leftRoofHeight=void 0,f.rightRoofHeight=void 0,f.centerLeftRoofHeight=void 0,f.centerRightRoofHeight=void 0,f.centerRoofHeight=void 0;for(const C of l.elements)if(C.parentId===s.id){const P=Yl.clone(u,C,C.cx,C.cy,C.cz,C.type===z.Polygon);P&&(u.normal&&(P.normal=[...C.normal]),a.push(P))}l.elements.push(...a),l.elements.push(u),l.elementsToPaste=[u]}else if(l.elementsToPaste.length>1){const g=l.copyCutElements();g.length>0&&(g[0].cx+=p.x,g[0].cy-=p.y,l.elements.push(...g),a.push(...g),l.elementsToPaste=g,l.selectedElementIdSet.clear(),l.selectedElementIdSet.add(g[0].id),l.selectedElement=g[0])}l.updateWallMapOnFoundationFlag=!l.updateWallMapOnFoundationFlag,d=!0;break}}l.elementsToPaste.length===1&&d&&(a.push(u),l.selectedElementIdSet.clear(),l.selectedElementIdSet.add(u.id),l.selectedElement=u)}}}),a},pvModules:{},loadPvModules(){const a=[];cB.parse(Ipt,{download:!0,complete:function(l){for(const s of l.data)if(Array.isArray(s)&&s.length>1){const c={name:s[0].trim(),brand:s[1].trim(),cellType:s[2].trim(),efficiency:parseFloat(s[3].trim()),length:parseFloat(s[4].trim()),nominalLength:parseFloat(s[5].trim()),width:parseFloat(s[6].trim()),nominalWidth:parseFloat(s[7].trim()),thickness:parseFloat(s[8].trim()),m:parseFloat(s[9].trim()),n:parseFloat(s[10].trim()),pmax:parseFloat(s[11].trim()),vmpp:parseFloat(s[12].trim()),impp:parseFloat(s[13].trim()),voc:parseFloat(s[14].trim()),isc:parseFloat(s[15].trim()),pmaxTC:parseFloat(s[16].trim()),noct:parseFloat(s[17].trim()),weight:parseFloat(s[18].trim()),color:s[19].trim(),shadeTolerance:s[20].trim(),bifacialityFactor:parseFloat(s[21].trim())};a.push(c)}i(s=>{for(const c of a)s.pvModules[c.name]=c})}})},getPvModule(a){return e().pvModules[a]},weatherModel:void 0,setWeatherModel(a){i(l=>{l.weatherModel=l.weatherData[a]})},weatherData:{},loadWeatherData(){if(Object.keys(e().weatherData).length>0)return;const a=[];cB.parse(Rpt,{download:!0,complete:function(l){for(const s of l.data)if(Array.isArray(s)&&s.length>1){const c=[],u=[],d=[];for(let p=5;p<29;p++)(p-5)%2===0?c.push(parseFloat(s[p].trim())):u.push(parseFloat(s[p].trim()));for(let p=29;p<41;p++)d.push(parseFloat(s[p].trim()));const f={city:s[0].trim(),country:s[1].trim(),longitude:parseFloat(s[2].trim()),latitude:parseFloat(s[3].trim()),elevation:parseFloat(s[4].trim()),lowestTemperatures:c,highestTemperatures:u,sunshineHours:d};a.push(f)}i(s=>{for(const c of a)s.weatherData[c.city+", "+c.country]=c;s.weatherModel=s.weatherData["Boston MA, USA"]}),console.log(a.length+" weather datasets loaded")}})},getWeather(a){const l=e().weatherModel;return l||e().weatherData[a]},horizontalSolarRadiationData:{},loadHorizontalSolarRadiationData(){const a=[];cB.parse(Hpt,{download:!0,complete:function(l){for(const s of l.data)if(Array.isArray(s)&&s.length>1){const c=[];for(let d=2;d<14;d++)c.push(parseFloat(s[d].trim()));const u={city:s[0].trim(),country:s[1].trim(),data:c};a.push(u)}i(s=>{for(const c of a)s.horizontalSolarRadiationData[c.city+", "+c.country]=c})}})},getHorizontalSolarRadiation(a){return e().horizontalSolarRadiationData[a]},verticalSolarRadiationData:{},loadVerticalSolarRadiationData(){const a=[];cB.parse(Mpt,{download:!0,complete:function(l){for(const s of l.data)if(Array.isArray(s)&&s.length>1){const c=[];for(let d=2;d<14;d++)c.push(parseFloat(s[d].trim()));const u={city:s[0].trim(),country:s[1].trim(),data:c};a.push(u)}i(s=>{for(const c of a)s.verticalSolarRadiationData[c.city+", "+c.country]=c})}})},getVerticalSolarRadiation(a){return e().verticalSolarRadiationData[a]},getClosestCity(a,l){let s=Number.MAX_VALUE,c=null,u;const d=e().weatherData;for(const f in d)Object.hasOwn(d,f)&&(u=me.getDistance(l,a,d[f].longitude,d[f].latitude),u{l.sunlightDirection=a.clone()})},cameraDirection:new ie,getCameraDirection(){return e().cameraDirection},updateSceneRadiusFlag:!1,updateSceneRadius(){i(a=>{a.updateSceneRadiusFlag=!a.updateSceneRadiusFlag})},sceneRadius:100,setSceneRadius(a){i(l=>{l.sceneRadius=a})},selectedElementAngle:0,selectedElementHeight:0,selectedElementX:0,selectedElementY:0,isAddingElement(){return!!(e().addedCuboidId||e().addedFoundationId||e().addedWallId||e().addedWindowId||e().addedDoorId)},addedFoundationId:null,deletedFoundationId:null,addedCuboidId:null,deletedCuboidId:null,addedWallId:null,deletedWallId:null,updateWallMapOnFoundationFlag:!1,updateWallMapOnFoundation(){i(a=>{a.updateWallMapOnFoundationFlag=!a.updateWallMapOnFoundationFlag})},updateElementOnRoofFlag:!1,setUpdateElementOnRoofFlag(a){i(l=>{l.updateElementOnRoofFlag=a})},updateElementOnRoofFn(){i(a=>{a.updateElementOnRoofFlag=!0})},addedWindowId:null,addedDoorId:null,addedRoofIdSet:new Set,deletedRoofId:null,deletedRoofIdSet:new Set,autoDeletedRoofs:null,autoDeletedRoofIdSet:new Set,autoDeletedChild:null,getAutoDeletedElements(){const a=e().autoDeletedRoofs,l=e().autoDeletedChild;return!a||!l?null:[...a,...l]},deleteAddedRoofId(a){i(l=>{l.addedRoofIdSet.delete(a)})},groupActionMode:!1,setGroupActionMode(a){i(l=>{l.groupActionMode=a})},groupActionUpdateFlag:!1,locale:p1e,localFileDialogRequested:!1,loggable:!1,actionInfo:void 0,currentUndoable:void 0,showCloudFileTitleDialog:!1,showCloudFileTitleDialogFlag:!1,localContentToImportAfterCloudFileUpdate:void 0,enableFineGrid:!1,setEnableFineGrid(a){i(l=>{l.enableFineGrid=a})}}},{name:"aladdin-storage",storage:$Ue(()=>new URLSearchParams(window.location.search).get("viewonly")==="true"?sessionStorage:localStorage),skipHydration:me.isOpenFromURL(),partialize:t=>({language:t.language,animate24Hours:t.animate24Hours,floatingWindowOpacity:t.floatingWindowOpacity,selectedFloatingWindow:t.selectedFloatingWindow,locale:t.locale,cloudFile:t.cloudFile,latestModelSite:t.latestModelSite,modelSites:t.modelSites,modelsMapLatitude:t.modelsMapLatitude,modelsMapLongitude:t.modelsMapLongitude,modelsMapAddress:t.modelsMapAddress,modelsMapZoom:t.modelsMapZoom,modelsMapType:t.modelsMapType,modelsMapTilt:t.modelsMapTilt,world:t.world,elements:t.elements,viewState:t.viewState,graphState:t.graphState,actionState:t.actionState,modelType:t.modelType,modelAuthor:t.modelAuthor,modelLabel:t.modelLabel,modelDescription:t.modelDescription,projectView:t.projectView,projectState:t.projectState,designProjectType:t.designProjectType,notes:t.notes,user:t.user,sceneRadius:t.sceneRadius,weatherModel:t.weatherModel,solarPanelArrayLayoutParams:t.solarPanelArrayLayoutParams,solarPanelArrayLayoutConstraints:t.solarPanelArrayLayoutConstraints,economicsParams:t.economicsParams,evolutionMethod:t.evolutionMethod,evolutionaryAlgorithmState:t.evolutionaryAlgorithmState,geneticAlgorithmWizardSelectedTab:t.geneticAlgorithmWizardSelectedTab,particleSwarmOptimizationWizardSelectedTab:t.particleSwarmOptimizationWizardSelectedTab,minimumNavigationMoveSpeed:t.minimumNavigationMoveSpeed,minimumNavigationTurnSpeed:t.minimumNavigationTurnSpeed})})));class Nen extends be.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,n){}clearCacheAndReload(){localStorage.clear(),window.location.reload()}render(){return this.state.hasError?h.jsxs("div",{style:{marginTop:10,marginLeft:20},children:[h.jsx("h1",{children:"Error"}),h.jsx("p",{children:"Something went wrong. Please click the following button to clear the cache and reload the page."}),h.jsx("p",{children:h.jsx("button",{onClick:this.clearCacheAndReload,children:"Refresh"})})]}):this.props.children}}const Uen=t=>{const e=typeof t=="function",n=m.useRef(t);m.useEffect(()=>{n.current=t}),m.useEffect(()=>{if(e){const o=r=>{const i=n.current(r);if(typeof i=="string")return r.preventDefault(),r.returnValue=i;if(r.defaultPrevented)return r.returnValue=""};return window.addEventListener("beforeunload",o),()=>{window.removeEventListener("beforeunload",o)}}},[e])},jen=({children:t=null,onBeforeunload:e})=>(Uen(e),t),Ben="/aladdin/assets/daysky-xGPh_lTa.jpg",Yen="/aladdin/assets/desert-C1g8PGRA.jpg",Oen="/aladdin/assets/dune-BTLjQ9Lc.jpg",_en="/aladdin/assets/forest-4yWLHFWh.jpg",Ven="/aladdin/assets/grassland-CDTfZBr_.jpg",iTe="/aladdin/assets/hill-spring-BepVmTLf.jpg",aTe="/aladdin/assets/hill-summer-RoU04vrD.jpg",lTe="/aladdin/assets/hill-fall-BPbpF4zI.jpg",sTe="/aladdin/assets/hill-winter-CQjb4ZNm.jpg",Gen="/aladdin/assets/lake-Dj_bK41O.jpg",Xen="/aladdin/assets/mountain-Du_Jo4ue.jpg",Jen="/aladdin/assets/rural-BqG-D3I1.jpg",Ken=be.memo(({theme:t="Default"})=>{const e=H(fn),n=H(bW),o=H(Cb),r=H(Dge),i=H(Bge),a=H(EH),l=H(Gn),s=H(u3),c=H(kge),u=H(d1),d=H(Tc),f=H(rl),p=H(En),g=H(c3),y=H(ZBe),{scene:w,camera:b,gl:{domElement:C}}=oi(),P=m.useRef(null),v=m.useRef(null),T=m.useRef(null),A=m.useRef(new Map),x=m.useRef(new Map),S=m.useRef(new ie),R=m.useRef(new ie),M=m.useRef(new ie(1,1,1)),D=m.useRef(0),E=m.useRef(0),W=m.useRef(new Map),j=m.useRef(new Map),L=m.useRef(new Map),k=m.useRef(new Map),N=m.useRef(null),F=Jt(),U=m.useMemo(()=>new l0,[]),O=m.useMemo(()=>new nn,[]),_=new Date(f).getMonth()+1,[X,$]=m.useState(eh.Sky),Q=m.useMemo(()=>new ie,[]),le=m.useMemo(()=>new nn,[]);if(v.current&&u){X!==eh.Vertical&&$(eh.Vertical);const ce=i(v.current,u),pe=r(),ve=-Math.atan2(pe.x,pe.y);Q.set(ce.x,ce.y,0),le.set(-Gt,0,ve,"ZXY")}const q=m.useMemo(()=>{switch(t){case Os.Desert:return .5;case Os.Dune:return .25;case Os.Forest:return .25;case Os.Grassland:return .15;case Os.Hill:return .3;case Os.Lake:return .1;case Os.Mountain:return .4;case Os.Rural:return .25;default:return .2}},[t]),te=m.useMemo(()=>{switch(t){case Os.Desert:return Yen;case Os.Dune:return Oen;case Os.Forest:return _en;case Os.Grassland:return Ven;case Os.Hill:return d>0?_>=12||_<=3?sTe:_>3&&_<=5?iTe:_>5&&_<=9?aTe:lTe:_>=12||_<=3?aTe:_>3&&_<=5?lTe:_>5&&_<=9?sTe:iTe;case Os.Lake:return Gen;case Os.Mountain:return Xen;case Os.Rural:return Jen;default:return Ben}},[t,_,d]),re=bb(te),ae=ce=>ce===z.Foundation||ce===z.Cuboid||ce===z.Tree||ce===z.Flower||ce===z.Human,se=ce=>{if(ce.intersections.length>0)if(ce.intersections[0].object===P.current)n(),e(ve=>{ve.clickObjectType=z.Sky});else{const ve=o();ve&&ae(ve.type)&&(v.current=ve,me.isPlantOrHuman(v.current)&&($(eh.Vertical),le.set(-Gt,0,0,"ZXY")),ve.type!==z.Foundation&&ve.type!==z.Cuboid&&Fn.getState().setEnableOrbitController(!1))}},ne=ce=>{if(!ce)return"";const pe=ce.name.split(" ");return pe[2]?pe[2]:ne(ce.parent)},fe=(ce,pe)=>{if(ce==null)return null;for(const ve of ce.children)if(ve.name.includes(`${pe}`))return ve;return null},ge=(ce,pe)=>{var Me,Pe;const ve=Fn.getState().contentRef,Ae=fe(ve==null?void 0:ve.current,ce.id);if(Ae){for(const Ee of Ae.children)if(Ee.name.includes(`${pe.id}`)){(Pe=(Me=Fn.getState().contentRef)==null?void 0:Me.current)==null||Pe.add(Ee);break}}pe.parentId=Zo;const Te=new ie(pe.cx,pe.cy,pe.cz).applyEuler(new nn(0,0,ce.rotation[2])).add(S.current);pe.cx=Te.x,pe.cy=Te.y,pe.cz=0,L.current.set(pe.id,new ie(Te.x,Te.y,0)),k.current.set(pe.id,Zo)},de=(ce,pe,ve)=>{if(!ce||!pe)return;const Ae=Fn.getState().contentRef;if(Ae!=null&&Ae.current){const Te=me.getObjectChildById(Ae.current,pe),Me=me.getObjectChildById(pe===Zo?Ae.current:Te,ve);if(Me){if(ce===Zo)Ae.current.add(Me);else{const Pe=me.getObjectChildById(Ae.current,ce);Pe==null||Pe.add(Me)}np()}}},Z=(ce,pe)=>{ce&&e(ve=>{for(const Ae of ve.elements)if(Ae.id===pe&&!me.isFoundationOrCuboid(Ae)){Ae.parentId=ce;break}})},he=ce=>{for(const pe of ce)if(pe.object.userData.stand)return pe;return null},xe=(ce,pe)=>{if(ce&&ce.current){const ve=he(pe.intersections);if(ve){const Ae=ve.object,Te=ce.current.parent;if(Ae.name==="Ground"){if(Te&&Te.name!=="Content"){const Me=Fn.getState().contentRef;Me&&Me.current&&(Me.current.add(ce.current),Z(Zo,ne(ce.current)))}ce.current.position.copy(ve.point),np()}else if(Ae.userData.stand){const Me=Ae.parent;if(Me){Te&&Te.uuid!==Me.uuid&&(Me.add(ce.current),Z(ne(Me),ne(ce.current))),O.set(0,0,-Me.rotation.z);const Pe=new ie().subVectors(ve.point,Me.position).applyEuler(O);ce.current.position.copy(Pe),np()}}}}},He=(ce,pe,ve)=>{e(Ae=>{for(const Te of Ae.elements)if(Te.id===ce){me.isFoundationOrCuboid(Te)||(Te.parentId=pe),Te.cx=ve.x,Te.cy=ve.y,Te.cz=ve.z;break}})},Se=()=>{if(H.getState().viewState.orthographic)return!1;if(P.current){const ce=U.intersectObjects(me.fetchIntersectables(w),!1);if(ce.length>0){for(const pe of ce)if(pe.object.userData.stand)return!1}}return U.intersectObjects([P.current]).length>0},ze=ce=>{if(v.current&&v.current.type&&!v.current.locked){const pe=new Xt;pe.x=ce.offsetX/C.clientWidth*2-1,pe.y=-(ce.offsetY/C.clientHeight)*2+1,U.setFromCamera(pe,b);let ve;if(T.current&&X===eh.Vertical&&(ve=U.intersectObjects([T.current]),ve&&ve.length>0)){const Ae=ve[0].point;switch(v.current.type){case z.Tree:{const Te=v.current;switch(u){case vt.Top:c(Te.id,Ae.z),e(Me=>{Me.selectedElementHeight=Math.max(1,Ae.z)});break;case vt.Left:case vt.Right:case vt.Upper:case vt.Lower:s(Te.id,2*Math.hypot(Ae.x-Te.cx,Ae.y-Te.cy));break}xe(Fn.getState().treeRef,ce);break}case z.Human:{xe(Fn.getState().humanRef,ce);break}case z.Cuboid:{if(me.isTopResizeHandle(u)){e(Me=>{var Pe;for(const Ee of Me.elements)if(Ee.id===((Pe=v.current)==null?void 0:Pe.id)){Ee.cz=Math.max(.5,Ae.z/2),Ee.lz=Math.max(1,Ae.z);break}Me.selectedElementHeight=Math.max(1,Ae.z)});const Te=Fn.getState().cuboidRef;if(Te!=null&&Te.current){for(const Me of Te.current.children)if(Me.name.includes("Human")||Me.name.includes("Tree")){const Pe=A.current.get(ne(Me));Pe&&(Math.abs(E.current-Pe.z)<.01?Me.position.setZ(Math.max(Ae.z/2,.5)):Me.position.setZ(Pe.z-Te.current.position.z))}}}break}}}}},Ie=ce=>{if(ce.button===2)return;e(ve=>{ve.contextMenuObjectType=null}),se(ce);const pe=v.current;if(pe)switch(E.current=pe.lz,S.current.set(pe.cx,pe.cy,pe.cz),pe.type){case z.Human:N.current=pe.parentId;break;case z.Tree:N.current=pe.parentId,D.current=pe.lx;break;case z.Cuboid:{S.current.set(pe.cx,pe.cy,pe.cz),M.current.set(pe.lx,pe.ly,pe.lz),A.current.clear();const ve=new ie(pe.cx,pe.cy,pe.cz),Ae=a(pe.id);if(Ae.length>0){W.current.clear();const Te=pe.rotation[2];for(const Me of Ae)switch(Me.type){case z.Tree:case z.Human:{const Pe=new ie(Me.cx,Me.cy,Me.cz).applyEuler(new nn(0,0,Te));Pe.add(ve),A.current.set(Me.id,Pe),W.current.set(Me.id,new ie(Me.cx,Me.cy,Me.cz));break}case z.SolarPanel:case z.Sensor:{if(me.isIdentical(Me.normal,rs)){const Pe=new ie(Me.cx*pe.lx,Me.cy*pe.ly,Me.cz*pe.lz).applyEuler(new nn(0,0,Te));Pe.add(ve),A.current.set(Me.id,Pe)}break}case z.Polygon:{if(me.isIdentical(Me.normal,rs)){const Pe=Me,Ee=[];for(const Be of Pe.vertices){const Je=new Xt(Be.x*pe.lx,Be.y*pe.ly).rotateAround(si,Te);Je.add(new Xt(ve.x,ve.y)),Ee.push(Je)}x.current.set(Pe.id,Ee)}break}}}break}}},ye=()=>{var ce,pe;if(v.current){const ve=l(v.current.id);if(ve&&!ve.locked){let Ae=null,Te=N.current;switch(ve.type){case z.Cuboid:switch(u){case vt.UpperLeftTop:case vt.UpperRightTop:case vt.LowerLeftTop:case vt.LowerRightTop:{j.current.clear(),e(Ee=>{Ee.actionState.cuboidHeight=ve.lz;for(const Be of Ee.elements)if(me.isPlantOrHuman(Be)&&Be.parentId===ve.id)if(j.current.set(Be.id,ve.id),Math.abs(M.current.z/2-Be.cz)<.01)Be.cz=ve.lz/2;else{const Je=Be.cz+S.current.z-ve.cz;Math.abs(Je)>ve.lz/2?ge(ve,Be):Be.cz=Je}});const Me=a(ve.id);if(Me.length>0)for(const Ee of Me)L.current.set(Ee.id,new ie(Ee.cx,Ee.cy,Ee.cz));const Pe={name:"Change Cuboid Height",timestamp:Date.now(),changedElementId:ve.id,changedElementType:ve.type,oldValue:E.current,newValue:ve.lz,oldChildrenPositionsMap:new Map(W.current),newChildrenPositionsMap:new Map(L.current),oldChildrenParentIdMap:new Map(j.current),newChildrenParentIdMap:new Map(k.current),undo:()=>{var Ee,Be;if(e(Je=>{for(const We of Je.elements)if(We.id===Pe.changedElementId){We.lz=Pe.oldValue,We.cz=Pe.oldValue/2;break}}),Pe.oldChildrenPositionsMap&&Pe.oldChildrenPositionsMap.size>0)for(const[Je,We]of Pe.oldChildrenPositionsMap.entries()){const Ke=l(Je);if((Ke==null?void 0:Ke.type)!==z.Polygon){g(Je,We.x,We.y,We.z);const Ne=(Ee=Pe.oldChildrenParentIdMap)==null?void 0:Ee.get(Je),De=(Be=Pe.newChildrenParentIdMap)==null?void 0:Be.get(Je);Ne&&De&&Ne!==De&&(de(Ne,De,Je),Z(Ne,Je))}}},redo:()=>{var Ee,Be;if(e(Je=>{for(const We of Je.elements)if(We.id===Pe.changedElementId){We.lz=Pe.newValue,We.cz=Pe.newValue/2;break}}),Pe.newChildrenPositionsMap&&Pe.newChildrenPositionsMap.size>0)for(const[Je,We]of Pe.newChildrenPositionsMap.entries()){g(Je,We.x,We.y,We.z);const Ke=(Ee=Pe.oldChildrenParentIdMap)==null?void 0:Ee.get(Je),Ne=(Be=Pe.newChildrenParentIdMap)==null?void 0:Be.get(Je);Ke&&Ne&&Ke!==Ne&&(de(Ne,Ke,Je),Z(Ne,Je))}}};p(Pe);break}}break;case z.Tree:switch(u){case vt.Top:{const Me={name:"Change Tree Height",timestamp:Date.now(),changedElementId:ve.id,changedElementType:ve.type,oldValue:E.current,newValue:ve.lz,undo:()=>{c(Me.changedElementId,Me.oldValue)},redo:()=>{c(Me.changedElementId,Me.newValue)}};p(Me),e(Pe=>{Pe.actionState.treeHeight=ve.lz});break}case vt.Left:case vt.Right:case vt.Lower:case vt.Upper:{const Me={name:"Change Tree Spread",timestamp:Date.now(),changedElementId:ve.id,changedElementType:ve.type,oldValue:D.current,newValue:ve.lx,undo:()=>{s(Me.changedElementId,Me.oldValue)},redo:()=>{s(Me.changedElementId,Me.newValue)}};p(Me),e(Pe=>{Pe.actionState.treeSpread=ve.lx});break}}Ae=(ce=Fn.getState().treeRef)==null?void 0:ce.current;break;case z.Human:Ae=(pe=Fn.getState().humanRef)==null?void 0:pe.current;break}if(Ae){const Me=U.intersectObjects(me.fetchIntersectables(w),!1),Pe=he(Me);if(Pe){const Ee=Pe.point;if(Pe.object.name==="Ground")He(ve.id,Zo,Ee),R.current.set(Ee.x,Ee.y,Ee.z),Te=Zo;else if(Pe.object.userData.stand){const Be=ne(Pe.object),Je=Pe.object.parent;if(Je){const We=new ie().subVectors(Ee,Je.position).applyEuler(O);He(ve.id,Be,We),R.current.set(We.x,We.y,We.z),Te=Be}}}}if(H.getState().moveHandleType&&me.isPlantOrHuman(ve)&&(R.current.distanceToSquared(S.current)>It||U.intersectObjects([P.current]).length>0)){let Me=!0;if(!H.getState().viewState.orthographic&&(Me=R.current.length().02}if(!Me||Se()){g(ve.id,S.current.x,S.current.y,S.current.z),Ae&&me.isPlantOrHuman(ve)&&Ae.position.copy(S.current),me.isPlantOrHuman(ve)&&Z(N.current,ve.id);const Pe=Fn.getState().contentRef;if(Pe!=null&&Pe.current&&N.current&&Ae){if(N.current===Zo)Pe.current.add(Ae);else{const Ee=me.getObjectChildById(Pe.current,N.current);Ee==null||Ee.add(Ae)}np()}po(Y.t("message.CannotMoveObjectTooFar",F))}else{const Pe={name:"Move",timestamp:Date.now(),movedElementId:ve.id,movedElementType:ve.type,oldCx:S.current.x,oldCy:S.current.y,oldCz:S.current.z,newCx:R.current.x,newCy:R.current.y,newCz:R.current.z,oldParentId:N.current,newParentId:Te,undo:()=>{g(Pe.movedElementId,Pe.oldCx,Pe.oldCy,Pe.oldCz),Z(Pe.oldParentId,Pe.movedElementId),de(Pe.oldParentId,Pe.newParentId,Pe.movedElementId)},redo:()=>{g(Pe.movedElementId,Pe.newCx,Pe.newCy,Pe.newCz),Z(Pe.newParentId,Pe.movedElementId),de(Pe.newParentId,Pe.oldParentId,Pe.movedElementId)}};p(Pe),y()}}}v.current=null,$(eh.Sky),e(Ae=>{Ae.moveHandleType=null,Ae.resizeHandleType=null,Ae.rotateHandleType=null}),Fn.setState({humanRef:null,treeRef:null}),Fn.getState().setEnableOrbitController(!0)}};return h.jsxs(h.Fragment,{children:[h.jsxs("mesh",{ref:P,name:"Sky",rotation:[Gt,0,0],scale:[1,q,1],onContextMenu:ce=>{ce.intersections.length>0&&ce.intersections[0].object===P.current&&(n(),e(ve=>{ve.clickObjectType=z.Sky,ve.contextMenuObjectType=z.Sky}))},onPointerDown:Ie,children:[h.jsx("sphereGeometry",{args:[$6t,16,8,0,la,0,Gt]}),h.jsx("meshToonMaterial",{map:re,side:p0,opacity:1,color:"skyblue"})]}),v.current&&X!==eh.Sky&&h.jsx(ua,{ref:T,visible:!1,name:"Sky Intersection Plane",rotation:le,position:Q,args:[1e3,1e3],onPointerMove:L2.throttle(ze,VF),onPointerUp:ye,children:h.jsx("meshStandardMaterial",{side:$r})})]})}),qen=be.memo(({lineWidth:t=1,endPoint:e=1e3,showTickMarks:n=!0,showTickLabels:o=!0})=>{const r=H(Swt),i=H(Ug),a=H(Id),[l,s]=m.useState(!1),c=50,u=m.useRef(1),d=m.useRef(u.current*10),f=m.useRef(new Array(c).fill(1)),p=.1,g=.3,y="FloralWhite",w=t/2,b=o3(lW,fN),C=Math.min(1,Math.max(.5,i*.01)),P={font:b,height:0,size:C},v=a?r.max.z+.01:0;m.useEffect(()=>{i<50?u.current=1:i<100?u.current=2:u.current=5,d.current=10*u.current,f.current=new Array(c).fill(1),s(!l)},[i]);const T=A=>A%(5*u.current)===0?g:p;return h.jsxs(h.Fragment,{children:[h.jsx(jn,{userData:{unintersectable:!0},name:"x axis line",points:[[-e,0,v],[e,0,v]],color:"red",lineWidth:t}),a&&n&&f.current.map((A,x)=>{const S=(x+1)*u.current,R=T(S);return h.jsxs(be.Fragment,{children:[h.jsx(jn,{userData:{unintersectable:!0},points:[[S,-R,v],[S,R,v]],color:y,lineWidth:w}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-S,-R,v],[-S,R,v]],color:y,lineWidth:w})]},S)}),a&&o&&f.current.map((A,x)=>{const S=(x+1)*u.current;return S%d.current===0?h.jsxs("mesh",{userData:{unintersectable:!0},position:[S-C,-g*2-C,v],children:[h.jsx("textGeometry",{args:[(S<10?" ":"")+S,P]}),h.jsx("meshStandardMaterial",{attach:"material",color:"lightGray"})]},S):h.jsx(be.Fragment,{},S)}),a&&o&&f.current.map((A,x)=>{const S=-(x+1)*u.current;return S%d.current===0?h.jsxs("mesh",{userData:{unintersectable:!0},position:[S-C,-g*2-C,v],children:[h.jsx("textGeometry",{args:[(S>-10?" ":"")+S,P]}),h.jsx("meshStandardMaterial",{attach:"material",color:"lightGray"})]},S):h.jsx(be.Fragment,{},S)}),h.jsx(jn,{name:"y axis line",userData:{unintersectable:!0},points:[[0,-e,v],[0,e,v]],color:"blue",lineWidth:t}),a&&n&&f.current.map((A,x)=>{const S=(x+1)*u.current,R=T(S);return h.jsxs(be.Fragment,{children:[h.jsx(jn,{userData:{unintersectable:!0},points:[[-R,S,v],[R,S,v]],color:y,lineWidth:w*1.5}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-R,-S,v],[R,-S,v]],color:y,lineWidth:w*1.5})]},S)}),a&&o&&f.current.map((A,x)=>{const S=(x+1)*u.current;return S%d.current===0?h.jsxs("mesh",{userData:{unintersectable:!0},position:[-g*2-C*2,S-C/2,v],children:[h.jsx("textGeometry",{args:[S+"",P]}),h.jsx("meshStandardMaterial",{attach:"material",color:"lightGray"})]},S):h.jsx(be.Fragment,{},S)}),a&&o&&f.current.map((A,x)=>{const S=-(x+1)*u.current;return S%d.current===0?h.jsxs("mesh",{userData:{unintersectable:!0},position:[-g*2-C*2,S-C/2,v],children:[h.jsx("textGeometry",{args:[S+"",P]}),h.jsx("meshStandardMaterial",{attach:"material",color:"lightGray"})]},S):h.jsx(be.Fragment,{},S)}),!a&&h.jsx(jn,{userData:{unintersectable:!0},name:"z axis line",points:[[0,0,0],[0,0,e]],color:"green",lineWidth:t})]})}),$en=be.memo(t=>{var $;const{id:e,cx:n,cy:o,cz:r,name:i=Yt.Jack,locked:a=!1,flip:l=!1,observer:s=!1,parentId:c}=t;let u=!1;H(Q=>{if(c===Zo)u=!0;else for(const le of Q.elements)if(le.id===c){u=!0;break}});const d=H(yp);m.useEffect(()=>{u||d(e,!1)},[u,e]);const f=H(fn),p=H(Id)??!1,g=H(Y0),y=H(Eb),w=H(ly),b=ht(Ss),C=Es(e),{gl:P}=oi(),[v,T]=m.useState(!1),A=Fn(Q=>Q.contentRef),x=m.useRef(null),S=m.useRef(null),R=Jt(),M=m.useRef(!1),D=H(zH);D!==M.current&&(M.current=D,A!=null&&A.current&&x.current&&A.current.add(x.current)),m.useEffect(()=>{if(c!==Zo){const Q=F();Q&&x.current&&Q.add(x.current)}},[D,c]);const E=m.useMemo(()=>new df().load(Fp.fetchTextureImage(i),Q=>{l&&(Q.wrapS=Hs,Q.repeat.x=-1),j(Q)}),[i,l]),[W,j]=m.useState(E),L=m.useMemo(()=>Fp.fetchWidth(i),[i]),k=m.useMemo(()=>Fp.fetchHeight(i),[i]),N=m.useMemo(()=>Fp.fetchLabel(i,R)+(a?" ("+Y.t("shared.ElementLocked",R)+")":"")+` -`+Y.t("word.Coordinates",R)+": ("+n.toFixed(1)+", "+o.toFixed(1)+") "+Y.t("word.MeterAbbreviation",R),[i,a,n,o,R]);m.useEffect(()=>{const Q=F();Q&&x.current&&Q.add(x.current)},[A]);const F=()=>c!==Zo&&(A!=null&&A.current)?me.getObjectChildById(A.current,c):null;ay(({camera:Q})=>{if(x.current){const{rot:le}=me.getWorldDataById(c);if(p)x.current.rotation.set(Gt,Math.PI-le,0);else{const{x:q,y:te}=Q.position,{x:re,y:ae}=x.current.localToWorld(new ie);x.current.rotation.set(0,0,-Math.atan2(q-re,te-ae)-le)}}});const U=m.useCallback((Q,le)=>{ht.getState().duringCameraInteraction||Q.intersections.length>0&&(Q.intersections[0].object===Q.eventObject||Q.intersections.length>1&&Q.intersections[1].object===Q.eventObject)&&(f(te=>{te.hoveredHandle=le,te.selectedElementHeight=t.lz}),me.isMoveHandle(le)?P.domElement.style.cursor="move":P.domElement.style.cursor="pointer")},[t.lz]),O=m.useCallback(()=>{f(Q=>{Q.hoveredHandle=null}),P.domElement.style.cursor=H.getState().addedCuboidId?"crosshair":"default"},[]),B=s?Fp.fetchGender(t.name):Ha.Male,_=s?(t.flip?-1:1)*Fp.fetchHatOffsetX(t.name):0,X=s?Fp.fetchHatOffsetY(t.name):0;return u?h.jsx("group",{ref:x,name:"Human Group "+e,userData:{aabb:!0},position:[n,o,r??0],children:h.jsxs("group",{position:[0,.1,k/2],children:[h.jsx(PC,{rotation:[Gt,0,0],uuid:e,name:i,follow:!1,children:h.jsx(ua,{ref:S,renderOrder:3,receiveShadow:!b,name:`Human ${i} plane`,args:[L,k],onContextMenu:Q=>{g(e,Q,Oo.ContextMenu),f(le=>{Q.intersections.length>0&&Q.intersections[0].object===S.current&&(le.contextMenuObjectType=z.Human)})},onPointerDown:Q=>{Q.button!==2&&Q.eventObject===Q.intersections[0].eventObject&&(g(e,Q,Oo.Move),Fn.setState({humanRef:x}))},onPointerOver:Q=>{Q.intersections.length>0&&Q.intersections[0].object===S.current&&T(!0)},onPointerOut:()=>{T(!1)},children:h.jsx("meshToonMaterial",{map:W,alphaTest:.5,side:$r})})}),C&&a&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-L/2,0,-k/2],[-L/2,0,k/2],[-L/2,0,k/2],[L/2,0,k/2],[L/2,0,-k/2],[L/2,0,k/2],[L/2,0,-k/2],[-L/2,0,-k/2]],castShadow:!1,receiveShadow:!1,lineWidth:.5,rotation:($=S.current)==null?void 0:$.rotation,color:y0}),s&&h.jsxs(h.Fragment,{children:[h.jsx(ds,{uuid:e,visible:!1,userData:{eyeball:!0},name:i+" eyeball",args:[L/5,4,4,0,la,0,la],position:[0,0,t.lz/2],children:h.jsx("meshBasicMaterial",{attach:"material",side:$r})}),h.jsx(ca,{name:"Observer hat 1",userData:{unintersectable:!0},castShadow:!1,receiveShadow:!1,args:[.1,.1,.1,16,2],position:[_,0,t.lz/2-.05+X],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:B===Ha.Male?"gray":"hotpink"})}),h.jsx(ca,{name:"Observer hat 2",userData:{unintersectable:!0},castShadow:!1,receiveShadow:!1,args:[.2,.2,.01,16,2],position:[_,0,t.lz/2-.1+X],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:B===Ha.Male?"gray":"hotpink"})})]}),C&&!a&&h.jsx(ds,{position:[0,0,-k/2],args:[c1*4,6,6,0,Math.PI],name:Ho.Default,onPointerDown:Q=>{Q.button!==2&&Q.eventObject===Q.intersections[0].eventObject&&(g(e,Q,Oo.Move),Fn.setState({humanRef:x}))},onPointerEnter:Q=>{U(Q,Ho.Default)},onPointerLeave:O,children:h.jsx("meshBasicMaterial",{attach:"material",color:w===Ho.Default||y===Ho.Default?ta:tw})}),v&&!C&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:N,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,k/2+((t==null?void 0:t.labelHeight)??.4)]})]})}):null}),cTe="/aladdin/assets/apple_spring-Ctq5fKrS.png",sde="/aladdin/assets/apple_summer-Dr8H3cny.png",uTe="/aladdin/assets/apple_fall-Cp6pAzIj.png",dTe="/aladdin/assets/apple_winter-D03fshM0.png",fTe="/aladdin/assets/birch_spring-sKFxYorO.png",cde="/aladdin/assets/birch_summer-FaJ43Xt4.png",hTe="/aladdin/assets/birch_fall-PIQyyY4L.png",pTe="/aladdin/assets/birch_winter-C5h1hTVJ.png",nQe="/aladdin/assets/coconut-rkhxogn3.png",gTe="/aladdin/assets/dogwood_spring-9vLsm3g2.png",ude="/aladdin/assets/dogwood_summer-DgdkRZ2O.png",mTe="/aladdin/assets/dogwood_fall-Wu983FGV.png",yTe="/aladdin/assets/dogwood_winter-4w2TO6RG.png",ATe="/aladdin/assets/elm_spring-DJcRoCq2.png",dde="/aladdin/assets/elm_summer-VNy_g1qe.png",wTe="/aladdin/assets/elm_fall-ChdMN8fe.png",vTe="/aladdin/assets/elm_winter-Qng-eWYe.png",oQe="/aladdin/assets/fan_palm-DbCJ1Nso.png",xTe="/aladdin/assets/linden_spring-C_zkyu46.png",fde="/aladdin/assets/linden_summer-zap94GfP.png",bTe="/aladdin/assets/linden_fall-CK-BpZ7U.png",STe="/aladdin/assets/linden_winter-Dt7sgspu.png",TTe="/aladdin/assets/magnolia_spring-CNor1Lb8.png",hde="/aladdin/assets/magnolia_summer-C7-8T4uo.png",PTe="/aladdin/assets/magnolia_fall-D3wi6n7Y.png",CTe="/aladdin/assets/magnolia_winter-116tEre9.png",RTe="/aladdin/assets/maple_spring-26OHjb4f.png",pde="/aladdin/assets/maple_summer-BbcBLKSJ.png",HTe="/aladdin/assets/maple_fall-Bp5Vy2Jl.png",MTe="/aladdin/assets/maple_winter-BnFW631O.png",ITe="/aladdin/assets/oak_spring-CsUg07TC.png",gde="/aladdin/assets/oak_summer-CPK7amde.png",zTe="/aladdin/assets/oak_fall-rgRz_M_t.png",DTe="/aladdin/assets/oak_winter-CD4uumS6.png",rQe="/aladdin/assets/pine-CI5zZHth.png",iQe="/aladdin/assets/spruce-CEhjo5-Q.png";class Gz{static isEvergreen(e){return e===pr.Spruce||e===pr.Pine||e===pr.FanPalm||e===pr.Coconut}static isConic(e){return e===pr.Spruce}static fetchLabel(e,n){switch(e){case pr.Apple:return Y.t("tree.Apple",n);case pr.Birch:return Y.t("tree.Birch",n);case pr.Coconut:return Y.t("tree.Coconut",n);case pr.Dogwood:return Y.t("tree.Dogwood",n);case pr.Elm:return Y.t("tree.Elm",n);case pr.FanPalm:return Y.t("tree.FanPalm",n);case pr.Linden:return Y.t("tree.Linden",n);case pr.Magnolia:return Y.t("tree.Magnolia",n);case pr.Maple:return Y.t("tree.Maple",n);case pr.Oak:return Y.t("tree.Oak",n);case pr.Spruce:return Y.t("tree.Spruce",n);default:return Y.t("tree.Pine",n)}}static fetchTheta(e){switch(e){case pr.Apple:return .65*Math.PI;case pr.Birch:return .72*Math.PI;case pr.Coconut:return .5*Math.PI;case pr.Dogwood:return .65*Math.PI;case pr.Elm:return .78*Math.PI;case pr.FanPalm:return .52*Math.PI;case pr.Linden:return .75*Math.PI;case pr.Magnolia:return .68*Math.PI;case pr.Maple:return .65*Math.PI;case pr.Oak:return .75*Math.PI;case pr.Spruce:return Math.PI;default:return Math.PI*.5}}static fetchTextureImage(e,n,o,r,i){let a;const l=r+30,s=i-30,c=o>0;switch(e){case pr.Apple:n>=i||n<=r?a=c?dTe:sde:n>r&&n<=l?a=c?cTe:uTe:n>l&&n<=s?a=c?sde:dTe:a=c?uTe:cTe;break;case pr.Birch:n>=i||n<=r?a=c?pTe:cde:n>r&&n<=l?a=c?fTe:hTe:n>l&&n<=s?a=c?cde:pTe:a=c?hTe:fTe;break;case pr.Coconut:a=nQe;break;case pr.Dogwood:n>=i||n<=r?a=c?yTe:ude:n>r&&n<=l?a=c?gTe:mTe:n>l&&n<=s?a=c?ude:yTe:a=c?mTe:gTe;break;case pr.Elm:n>=i||n<=r?a=c?vTe:dde:n>r&&n<=l?a=c?ATe:wTe:n>l&&n<=s?a=c?dde:vTe:a=c?wTe:ATe;break;case pr.FanPalm:a=oQe;break;case pr.Linden:n>=i||n<=r?a=c?STe:fde:n>r&&n<=l?a=c?xTe:bTe:n>l&&n<=s?a=c?fde:STe:a=c?bTe:xTe;break;case pr.Magnolia:n>=i||n<=r?a=c?CTe:hde:n>r&&n<=l?a=c?TTe:PTe:n>l&&n<=s?a=c?hde:CTe:a=c?PTe:TTe;break;case pr.Maple:n>=i||n<=r?a=c?MTe:pde:n>r&&n<=l?a=c?RTe:HTe:n>l&&n<=s?a=c?pde:MTe:a=c?HTe:RTe;break;case pr.Oak:n>=i||n<=r?a=c?DTe:gde:n>r&&n<=l?a=c?ITe:zTe:n>l&&n<=s?a=c?gde:DTe:a=c?zTe:ITe;break;case pr.Spruce:a=iQe;break;default:a=rQe}return a}}const Qen=be.memo(t=>{var ve;const{parentId:e,id:n,cx:o,cy:r,cz:i,lx:a,lz:l,name:s=pr.Pine,flip:c=!1,locked:u=!1,showModel:d=!1,showLabel:f=!1}=t;let p=!1;H(Ae=>{if(e===Zo)p=!0;else for(const Te of Ae.elements)if(Te.id===e){p=!0;break}});const g=H(yp);m.useEffect(()=>{p||g(n,!1)},[p]);const y=H(fn),w=H(Id)??!1,b=H(rl),C=H(Tc),P=H(xge)??Eq,v=H(bge)??Fq,T=H(Ds),A=H(Y0),x=H(Eb),S=H(d1),R=H(ly),M=Es(n),[D,E]=m.useState(!1),{gl:W}=oi(),j=Fn(Ae=>Ae.contentRef),L=m.useRef(null),k=m.useRef(null),N=m.useRef(null),F=m.useRef(null),U=m.useRef(null),O=m.useRef(null),B=m.useRef(null),_=m.useRef(null),X=m.useRef(null),$=m.useRef(null),Q=Jt(),le=m.useMemo(()=>me.dayOfYear(new Date(b)),[b]),q=m.useMemo(()=>!Gz.isEvergreen(t?t.name:pr.Dogwood)&&(C>0?lev:le>=P&&le<=v),[le,P,v,C,t==null?void 0:t.name]),te=m.useRef(!1),re=H(zH);re!==te.current&&(te.current=re,j!=null&&j.current&&L.current&&j.current.add(L.current)),m.useEffect(()=>{if(e!==Zo){const Ae=ce();Ae&&L.current&&Ae.add(L.current)}},[re]),m.useEffect(()=>{const Ae=ce();Ae&&L.current&&Ae.add(L.current)},[j]);const ae=m.useMemo(()=>new df().load(Gz.fetchTextureImage(s,le,C,P,v),Ae=>{c&&(Ae.wrapS=Hs,Ae.repeat.x=-1),ne(Ae)}),[s,le,C,c,P,v]),[se,ne]=m.useState(ae),fe=m.useMemo(()=>(t!=null&&t.label?t.label:Gz.fetchLabel(s,Q))+(u?" ("+Y.t("shared.ElementLocked",Q)+")":"")+(t!=null&&t.label?"":` -`+Y.t("word.Coordinates",Q)+": ("+o.toFixed(1)+", "+r.toFixed(1)+") "+Y.t("word.MeterAbbreviation",Q)),[t==null?void 0:t.label,s,o,r,u,Q]),ge=m.useMemo(()=>Gz.fetchTheta(s),[s]),de=a/2,Z=l/2,he=m.useMemo(()=>new ie(0,0,Z),[Z]),xe=m.useMemo(()=>new ie(-de,0,0),[de]),He=m.useMemo(()=>new ie(de,0,0),[de]),Se=m.useMemo(()=>new ie(0,-de,0),[de]),ze=m.useMemo(()=>new ie(0,de,0),[de]),Ie=m.useCallback((Ae,Te)=>{ht.getState().duringCameraInteraction||Ae.intersections.length>0&&(Ae.intersections[0].object===Ae.eventObject||Ae.intersections.length>1&&Ae.intersections[1].object===Ae.eventObject)&&(y(Pe=>{Pe.hoveredHandle=Te,Pe.selectedElementHeight=t.lz}),me.isMoveHandle(Te)?W.domElement.style.cursor="move":W.domElement.style.cursor="pointer")},[t==null?void 0:t.lz]),ye=m.useCallback(()=>{y(Ae=>{Ae.hoveredHandle=null}),W.domElement.style.cursor=H.getState().addedCuboidId?"crosshair":"default"},[]),ce=()=>e!==Zo&&(j!=null&&j.current)?me.getObjectChildById(j.current,e):null;ay(({camera:Ae})=>{if(k.current&&L.current&&N.current&&U.current){const{rot:Te}=me.getWorldDataById(e),{x:Me,y:Pe}=Ae.position,{x:Ee,y:Be}=L.current.position,{x:Je,y:We}=H.getState().sunlightDirection;if(ce()){const Ne=L.current.localToWorld(new ie),De=Math.atan2(Me-Ne.x,Pe-Ne.y)+Te;k.current.rotation.set(Gt,-De,0),U.current.rotation.set(-Gt,De,0),N.current.rotation.set(Gt,-Math.atan2(Je,We)-Te,0)}else{const Ne=Math.atan2(Me-Ee,Pe-Be);k.current.rotation.set(Gt,-Ne,0),U.current.rotation.set(-Gt,Ne,0),N.current.rotation.set(Gt,-Math.atan2(Je,We),0)}}});const pe=c1*3;return h.jsx(h.Fragment,{children:p?h.jsx("group",{ref:L,name:"Tree Group "+n,userData:{aabb:!0},position:[o,r,i??0],children:h.jsxs("group",{position:[0,0,l/2],children:[h.jsx(PC,{ref:k,uuid:n,name:s,follow:!1,children:h.jsx(ua,{args:[a,l],children:h.jsx("meshToonMaterial",{map:se,side:$r,alphaTest:.5})})}),h.jsx(PC,{ref:N,name:s+" Shadow Billboard",follow:!1,children:h.jsx(ua,{args:[a,l],castShadow:T,children:h.jsx("meshBasicMaterial",{map:se,side:$r,alphaTest:.5,opacity:0})})}),Gz.isConic(s)?h.jsx(Rd,{visible:d||w,name:s+" Model",userData:{simulation:!0},position:[0,0,s===pr.Spruce?0:l*.06],args:[a/2,l,8,8,!0],scale:[1,1,1],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",side:$r,transparent:!0,opacity:.75})}):h.jsx(ds,{visible:d||w,userData:{simulation:!q},name:s+" Model",args:[a/2,8,8,0,la,0,ge],scale:[1,l/a,1],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",side:$r,transparent:!0,opacity:.75})}),h.jsx(PC,{ref:U,name:"Interaction Billboard",visible:!1,position:[0,0,-l/2+.5],children:h.jsx(ua,{ref:F,renderOrder:3,name:s+" plane",args:[a/2,l/3],rotation:[w?Gt:0,0,0],onContextMenu:Ae=>{A(n,Ae,Oo.ContextMenu),y(Te=>{Ae.intersections.length>0&&Ae.intersections[0].object===F.current&&(Te.contextMenuObjectType=z.Tree)})},onPointerDown:Ae=>{Ae.button!==2&&Ae.eventObject===Ae.intersections[0].eventObject&&(A(n,Ae,Oo.Move),Fn.setState({treeRef:L}))},onPointerOver:Ae=>{Ae.intersections.length>0&&Ae.intersections[0].object===F.current&&E(!0)},onPointerOut:()=>{E(!1)}})}),M&&u&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-a/2,-l/2,0],[-a/2,l/2,0],[-a/2,l/2,0],[a/2,l/2,0],[a/2,-l/2,0],[a/2,l/2,0],[a/2,-l/2,0],[-a/2,-l/2,0]],castShadow:!1,receiveShadow:!1,lineWidth:.5,rotation:(ve=k.current)==null?void 0:ve.rotation,color:y0}),M&&!u&&h.jsxs(h.Fragment,{children:[h.jsx(ds,{position:new ie(0,0,-l/2),args:[pe,6,6,0,Math.PI],name:Ho.Default,renderOrder:2,onPointerDown:Ae=>{Ae.button!==2&&Ae.eventObject===Ae.intersections[0].eventObject&&(A(n,Ae,Oo.Move),Fn.setState({treeRef:L}))},onPointerEnter:Ae=>{Ie(Ae,Ho.Default)},onPointerLeave:ye,children:h.jsx("meshBasicMaterial",{attach:"material",color:R===Ho.Default||x===Ho.Default?ta:tw})}),!w&&h.jsxs(h.Fragment,{children:[h.jsx(Qr,{ref:O,name:vt.Top,args:[pe,pe,pe],position:he,onPointerDown:Ae=>{A(n,Ae,Oo.Resize)},onPointerEnter:Ae=>{Ie(Ae,vt.Top)},onPointerLeave:ye,children:h.jsx("meshBasicMaterial",{attach:"material",color:R===vt.Top||S===vt.Top?ta:Da})}),h.jsx(Qr,{ref:B,name:vt.Left,args:[pe,pe,pe],position:xe,onPointerDown:Ae=>{A(n,Ae,Oo.Resize)},onPointerEnter:Ae=>{Ie(Ae,vt.Left)},onPointerLeave:ye,children:h.jsx("meshBasicMaterial",{attach:"material",color:R===vt.Left||S===vt.Left?ta:Da})}),h.jsx(Qr,{ref:_,name:vt.Right,args:[pe,pe,pe],position:He,onPointerDown:Ae=>{A(n,Ae,Oo.Resize)},onPointerEnter:Ae=>{Ie(Ae,vt.Right)},onPointerLeave:ye,children:h.jsx("meshBasicMaterial",{attach:"material",color:R===vt.Right||S===vt.Right?ta:Da})}),h.jsx(Qr,{ref:X,name:vt.Lower,args:[pe,pe,pe],position:Se,onPointerDown:Ae=>{A(n,Ae,Oo.Resize)},onPointerEnter:Ae=>{Ie(Ae,vt.Lower)},onPointerLeave:ye,children:h.jsx("meshBasicMaterial",{attach:"material",color:R===vt.Lower||S===vt.Lower?ta:Da})}),h.jsx(Qr,{ref:$,name:vt.Upper,args:[pe,pe,pe],position:ze,onPointerDown:Ae=>{A(n,Ae,Oo.Resize)},onPointerEnter:Ae=>{Ie(Ae,vt.Upper)},onPointerLeave:ye,children:h.jsx("meshBasicMaterial",{attach:"material",color:R===vt.Upper||S===vt.Upper?ta:Da})})]})]}),(D||f)&&!M&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:fe,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,l/2+((t==null?void 0:t.labelHeight)??.4)]})]})}):null})});function aQe(t){const e=t+"Geometry";return m.forwardRef(({args:n,children:o,...r},i)=>h.jsxs("mesh",{ref:i,...r,children:[h.jsx(e,{attach:"geometry",args:n}),o]}))}const ETe=aQe("ParabolicCylinder"),FTe=aQe("Paraboloid"),Zen=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i,ly:a,lz:l=.1,reflectance:s=.9,absorberTubeRadius:c=.05,latusRectum:u=2,tiltAngle:d,relativeAzimuth:f,moduleLength:p,poleHeight:g,poleRadius:y,drawSunBeam:w,rotation:b=[0,0,0],color:C="white",lineColor:P="black",lineWidth:v=.5,showLabel:T=!1,locked:A=!1,parentId:x}=t,S=H(fn),R=H(rl),M=H(Tc),D=H(Kn),E=ht(Ss),W=H(Cf),j=Tn(u1),L=H(Ds),k=H(Gn),N=H(Y0),F=H(Ug),U=H(d1),O=H(Dw),B=Es(e),{gl:{domElement:_}}=oi(),[X,$]=m.useState(!1),[Q,le]=m.useState(null),[q,te]=m.useState(1),[re,ae]=m.useState(null),se=m.useRef(null),ne=m.useRef(null),fe=m.useRef(null),ge=m.useRef(null),de=m.useRef(null),Z=m.useRef(null),he=m.useRef(null),xe=m.useRef(!1),He=Math.max(100,10*F),Se=16,ze=O.z<=0,Ie=Jt();let ye=n,ce=o,pe=r;const ve=i/2,Ae=a/2,Te=l/2,Me=g+ve,Pe=H(Ht=>{for(const At of Ht.elements)if(At.id===x)return At});if(x&&Pe)switch(Pe.type){case z.Foundation:if(pe=Me+Te+Pe.lz,me.isZero(b[2]))ye=Pe.cx+n*Pe.lx,ce=Pe.cy+o*Pe.ly;else{const Ht=new ie(n*Pe.lx,o*Pe.ly,0);Ht.applyAxisAngle(Io,b[2]),ye=Pe.cx+Ht.x,ce=Pe.cy+Ht.y}break}const Ee=ve*ve/u,Be=.25*u,Je=new ie(-ve,-Ae,Te+Ee),We=new ie(-ve,Ae,Te+Ee),Ke=new ie(ve,-Ae,Te+Ee),Ne=new ie(ve,Ae,Te+Ee);m.useEffect(()=>{if(t&&E){const Ht=j(t.id);Ht&&ae(me.fetchHeatmapTexture(Ht,W??5))}},[E,W]),m.useEffect(()=>{te(Math.max(1,Math.round(a/p)))},[a,p]),m.useEffect(()=>{const Ht=()=>{Fn.getState().setEnableOrbitController(!0),xe.current=!1};return window.addEventListener("pointerup",Ht),()=>{window.removeEventListener("pointerup",Ht)}},[]);const De=m.useMemo(()=>(t!=null&&t.label?t.label:Y.t("shared.ParabolicTroughElement",Ie))+(t!=null&&t.locked?" ("+Y.t("shared.ElementLocked",Ie)+")":"")+(t!=null&&t.label?"":` -`+Y.t("word.Coordinates",Ie)+": ("+ye.toFixed(1)+", "+ce.toFixed(1)+", "+pe.toFixed(1)+") "+Y.t("word.MeterAbbreviation",Ie)),[t==null?void 0:t.label,t==null?void 0:t.locked,ye,ce,pe,Ie]),ke=m.useMemo(()=>new nn(0,0,b[2],"ZXY"),[b]),Ye=(Ht,At)=>{Ht.intersections.length>0&&Ht.intersections[0].object===Ht.eventObject&&(le(At),At===Ho.Top?_.style.cursor="move":At===Kr.Lower||At===Kr.Upper||At===Kr.Tilt?_.style.cursor="grab":_.style.cursor="pointer")},it=()=>{le(null),_.style.cursor="default"},Ve=m.useMemo(()=>Ei(new Date(R),M),[R,M]),yt=m.useMemo(()=>{var Ht;return(Ht=k(x))==null?void 0:Ht.rotation[2]},[x]),ct=yt?Ve.clone().applyAxisAngle(Io,-yt):Ve,Xe=m.useMemo(()=>Ve.z>0?new nn(0,Math.atan2(ct.x,ct.z),0,"ZXY"):new nn(d,0,f,"ZXY"),[Ve,d,f,ct.x,ct.z]),ut=m.useMemo(()=>{if(Ve.z>0){const Ht=yt?Math.cos(yt):1,At=yt?Math.sin(yt):0;return-Be*(Ve.x*At+Ve.y*Ht)/Math.hypot(Ve.x,Ve.z)}return 0},[Ve,yt,Be]),ft=new ie(0,ut,Be).applyEuler(Xe),ot=Ve.clone().multiplyScalar(He).applyEuler(new nn(-ke.x,0,-ke.z)),st=-(Me+l)/2,at=m.useMemo(()=>{const Ht=[],At=Math.cos(f)*p,kt=Math.sin(f)*p,gt=q/2-.5;for(let dt=0;dt{const Ht=[],At=a/q,kt=-i/u,gt=-2*kt/Se;for(let dt=0;dt<=q;dt++){const Ct=[];for(let tt=0;tt<=Se;tt++){const Fe=kt+tt*gt;Ct.push(new ie(u*Fe/2,-Ae+dt*At,u*Fe*Fe/4))}Ht.push({points:Ct})}return Ht},[i,a,q,u]),Ze=Math.max(1,(i+a)/16),St=Vx*Ze*1.5,Pt=c1*Ze*2,Rt=D.length<50&&Oe.length<10,Ut=Rt?4:2;return h.jsxs("group",{name:"Parabolic Trough Group "+e,rotation:ke,position:[ye,ce,pe+Te],children:[h.jsxs("group",{rotation:Xe,children:[h.jsx(ETe,{receiveShadow:L,castShadow:L,uuid:e,ref:se,args:[u/2,i,a,Se,4],name:"Parabolic Trough Front Side",onPointerDown:Ht=>{Ht.button!==2&&N(e,Ht,Oo.Select)},onContextMenu:Ht=>{N(e,Ht,Oo.ContextMenu),S(At=>{Ht.intersections.length>0&&Ht.intersections[0].object===se.current&&(At.contextMenuObjectType=z.ParabolicTrough)})},onPointerOver:Ht=>{Ht.intersections.length>0&&Ht.intersections[0].object===se.current&&($(!0),_.style.cursor="move")},onPointerOut:()=>{$(!1),_.style.cursor="default"},children:E&&re?h.jsx("meshBasicMaterial",{attach:"material",side:Ra,map:re}):h.jsx("meshPhongMaterial",{attach:"material",specular:new rr("white"),shininess:100*s,side:Ra,color:"lightskyblue"})}),h.jsx(ETe,{receiveShadow:L,castShadow:L,uuid:e+" backside",ref:ne,args:[u/2,i,a,Se,4],name:"Parabolic Trough Back Side",position:[0,0,-Te/2],onPointerDown:Ht=>{Ht.button!==2&&N(e,Ht,Oo.Select)},onContextMenu:Ht=>{N(e,Ht,Oo.ContextMenu),S(At=>{Ht.intersections.length>0&&Ht.intersections[0].object===ne.current&&(At.contextMenuObjectType=z.ParabolicTrough)})},onPointerOver:Ht=>{Ht.intersections.length>0&&Ht.intersections[0].object===ne.current&&($(!0),_.style.cursor="move")},onPointerOut:()=>{$(!1),_.style.cursor="default"},children:h.jsx("meshStandardMaterial",{attach:"material",side:p0,color:"white"})}),Oe&&Oe.map((Ht,At)=>h.jsxs(be.Fragment,{children:[Rt&&h.jsx(jn,{name:"Parabolic Trough Rim Lines",userData:{unintersectable:!0},points:Ht.points,castShadow:!1,receiveShadow:!1,lineWidth:v,color:P}),(At===0||At===Oe.length-1||Rt)&&h.jsx(jn,{name:"Parabolic Trough Focal Lines",userData:{unintersectable:!0},points:[Ht.points[Se/2].clone(),Ht.points[Se/2].clone().add(new ie(0,0,Be))],castShadow:!1,receiveShadow:!1,lineWidth:v,color:ze?"dimgray":"white"})]},At)),Rt&&h.jsx(jn,{name:"Parabolic Trough Outline 1",userData:{unintersectable:!0},points:[[-ve,-Ae,Ee],[-ve,Ae,Ee]],castShadow:!1,receiveShadow:!1,lineWidth:v,color:P}),Rt&&h.jsx(jn,{name:"Parabolic Trough Outline 2",userData:{unintersectable:!0},points:[[ve,-Ae,Ee],[ve,Ae,Ee]],castShadow:!1,receiveShadow:!1,lineWidth:v,color:P}),h.jsx(ca,{name:"Parabolic Trough Absorber Tube",uuid:e,args:[c,c,a,Rt?6:2,1],position:[0,0,Be],receiveShadow:!1,castShadow:!0,children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})}),h.jsx(ua,{name:"Parabolic Trough Simulation Plane",uuid:e,args:[i,a],position:[0,0,Ee],userData:{simulation:!0},receiveShadow:!1,castShadow:!1,visible:!1,children:h.jsx("meshBasicMaterial",{side:$r})}),B&&A&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-ve,-Ae,Ee],[-ve,Ae,Ee],[ve,Ae,Ee],[ve,-Ae,Ee],[-ve,-Ae,Ee]],castShadow:!1,receiveShadow:!1,lineWidth:1,color:y0}),B&&!A&&h.jsxs(h.Fragment,{children:[h.jsx(ds,{ref:fe,position:new ie(0,0,0),args:[Pt,6,6],name:Ho.Default,onPointerOver:Ht=>{Ye(Ht,Ho.Top)},onPointerOut:()=>{it()},onPointerDown:Ht=>{Ht.button!==2&&N(e,Ht,Oo.Move)},children:h.jsx("meshBasicMaterial",{attach:"material",color:"orange"})}),h.jsxs("group",{children:[h.jsx(Qr,{ref:ge,position:[(Je.x+Ke.x)/2,Je.y,Je.z-Ee],args:[St,St,l*1.2],name:vt.Lower,onPointerDown:Ht=>{N(e,Ht,Oo.Resize),Z.current&&S(At=>{const kt=ge.current.localToWorld(new ie(0,a,-Je.z));At.resizeAnchor.copy(kt)})},onPointerOver:Ht=>{Ye(Ht,vt.Lower)},onPointerOut:()=>{it()},children:h.jsx("meshBasicMaterial",{attach:"material",color:Q===vt.Lower||U===vt.Lower?ta:Da})}),h.jsx(Qr,{ref:de,position:[(We.x+Ne.x)/2,We.y,We.z-Ee],args:[St,St,l*1.2],name:vt.Upper,onPointerDown:Ht=>{N(e,Ht,Oo.Resize),Z.current&&S(At=>{const kt=de.current.localToWorld(new ie(0,-a,-We.z));At.resizeAnchor.copy(kt)})},onPointerOver:Ht=>{Ye(Ht,vt.Upper)},onPointerOut:()=>{it()},children:h.jsx("meshBasicMaterial",{attach:"material",color:Q===vt.Upper||U===vt.Upper?ta:Da})}),h.jsx(Qr,{ref:Z,position:[Je.x,(Je.y+We.y)/2,Je.z],args:[St,St,l*1.2],name:vt.Left,onPointerDown:Ht=>{N(e,Ht,Oo.Resize),Z.current&&S(At=>{const kt=Z.current.localToWorld(new ie(i,0,-Je.z));At.resizeAnchor.copy(kt)})},onPointerOver:Ht=>{Ye(Ht,vt.Left)},onPointerOut:()=>{it()},children:h.jsx("meshBasicMaterial",{attach:"material",color:Q===vt.Left||U===vt.Left?ta:Da})}),h.jsx(Qr,{ref:he,position:[Ke.x,(Ke.y+Ne.y)/2,Ke.z],args:[St,St,l*1.2],name:vt.Right,onPointerDown:Ht=>{N(e,Ht,Oo.Resize),Z.current&&S(At=>{const kt=he.current.localToWorld(new ie(-i,0,-Ke.z));At.resizeAnchor.copy(kt)})},onPointerOver:Ht=>{Ye(Ht,vt.Right)},onPointerOut:()=>{it()},children:h.jsx("meshBasicMaterial",{attach:"material",color:Q===vt.Right||U===vt.Right?ta:Da})})]})]})]}),Me>0&&at.map((Ht,At)=>At%5!==0&&!Rt?h.jsx(be.Fragment,{},At):h.jsx(ca,{userData:{unintersectable:!0},name:"Pole "+At,castShadow:!1,receiveShadow:!1,args:[y,y,Me+(Ht.z-st)*2+l,Ut,1],position:Ht,rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:C})},At)),w&&Ve.z>0&&h.jsx(jn,{userData:{unintersectable:!0},points:[ft,new ie(-.3*ve,0,.09*Ee).applyEuler(Xe),ot,new ie(-.6*ve,0,.36*Ee).applyEuler(Xe),ft,new ie(-.9*ve,0,.81*Ee).applyEuler(Xe),ot,new ie(0,0,0),ft,new ie(.3*ve,0,.09*Ee).applyEuler(Xe),ot,new ie(.6*ve,0,.36*Ee).applyEuler(Xe),ft,new ie(.9*ve,0,.81*Ee).applyEuler(Xe),ot],name:"Sun Beams",lineWidth:.25,color:"white"}),(X||T)&&!B&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:De,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,(t==null?void 0:t.labelHeight)??Math.max(Ae*Math.abs(Math.sin(t.tiltAngle))+.1,.2)]})]})}),etn=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i,ly:a,lz:l=.1,reflectance:s=.9,structureType:c=uf.CentralPole,receiverRadius:u=.25,receiverPoleRadius:d=.1,latusRectum:f=2,tiltAngle:p,relativeAzimuth:g,poleHeight:y,poleRadius:w=.2,drawSunBeam:b,rotation:C=[0,0,0],color:P="white",lineColor:v="black",lineWidth:T=.25,showLabel:A=!1,locked:x=!1,parentId:S}=t,R=H(fn),M=H(rl),D=H(Tc),E=H(Kn),W=ht(Ss),j=H(Cf),L=Tn(u1),k=H(Ds),N=H(Gn),F=H(Y0),U=H(Ug),O=H(d1),B=H(Dw),_=Es(e),{gl:{domElement:X}}=oi(),[$,Q]=m.useState(!1),[le,q]=m.useState(null),[te,re]=m.useState(null),ae=m.useRef(null),se=m.useRef(null),ne=m.useRef(null),fe=m.useRef(null),ge=m.useRef(null),de=m.useRef(null),Z=m.useRef(null),he=m.useRef(!1),xe=Math.max(100,10*U),He=32,Se=8,ze=B.z<=0;let Ie=n,ye=o,ce=r;const pe=i/2,ve=a/2,Ae=l/2,Te=y+pe,Me=Jt(),Pe=H(At=>{for(const kt of At.elements)if(kt.id===S)return kt});if(S&&Pe)switch(Pe.type){case z.Foundation:if(ce=Te+Ae+Pe.lz,me.isZero(C[2]))Ie=Pe.cx+n*Pe.lx,ye=Pe.cy+o*Pe.ly;else{const At=new ie(n*Pe.lx,o*Pe.ly,0);At.applyAxisAngle(Io,C[2]),Ie=Pe.cx+At.x,ye=Pe.cy+At.y}break}const Ee=pe*pe/f,Be=.25*f,Je=new ie(-pe,-ve,Ae+Ee),We=new ie(-pe,ve,Ae+Ee),Ke=new ie(pe,-ve,Ae+Ee),Ne=new ie(pe,ve,Ae+Ee),De=bb(Bye),ke=u+1;m.useEffect(()=>{if(t&&W){const At=L(t.id);At&&re(me.fetchHeatmapTexture(At,j??5))}},[W,j]),m.useEffect(()=>{const At=()=>{Fn.getState().setEnableOrbitController(!0),he.current=!1};return window.addEventListener("pointerup",At),()=>{window.removeEventListener("pointerup",At)}},[]);const Ye=m.useMemo(()=>(t!=null&&t.label?t.label:Y.t("shared.ParabolicDishElement",Me))+(t!=null&&t.locked?" ("+Y.t("shared.ElementLocked",Me)+")":"")+(t!=null&&t.label?"":` -`+Y.t("word.Coordinates",Me)+": ("+Ie.toFixed(1)+", "+ye.toFixed(1)+", "+ce.toFixed(1)+") "+Y.t("word.MeterAbbreviation",Me)),[t==null?void 0:t.label,t==null?void 0:t.locked,Me,Ie,ye,ce]),it=m.useMemo(()=>new nn(0,0,C[2],"ZXY"),[C]),Ve=(At,kt)=>{At.intersections.length>0&&At.intersections[0].object===At.eventObject&&(q(kt),kt===Ho.Top?X.style.cursor="move":kt===Kr.Lower||kt===Kr.Upper||kt===Kr.Tilt?X.style.cursor="grab":X.style.cursor="pointer")},yt=()=>{q(null),X.style.cursor="default"},ct=m.useMemo(()=>Ei(new Date(M),D),[M,D]),Xe=m.useMemo(()=>{var At;return(At=N(S))==null?void 0:At.rotation[2]},[S]),ut=Xe?ct.clone().applyAxisAngle(Io,-Xe):ct,ft=m.useMemo(()=>{if(ct.z>0){const At=Math.hypot(ut.x,ut.y);return new nn(Math.atan2(At,ut.z),0,Math.atan2(ut.y,ut.x)+Gt,"ZXY")}return new nn(p,0,g,"ZXY")},[ct,p,g,ut.x,ut.y,ut.z]),ot=-(Te+l)/2,st=E.length<50,at=m.useMemo(()=>{const At=[];if(st){const kt=[],gt=[];let dt,Ct,tt;const Fe=.25*Ee;for(let qe=0;qe<=He;qe++)dt=la*qe/He,Ct=Math.cos(dt),tt=Math.sin(dt),kt.push(new ie(pe*Ct,pe*tt,Ee)),gt.push(new ie(pe*Ct/2,pe*tt/2,Fe));At.push({points:kt}),At.push({points:gt});for(let qe=0;qe<12;qe++){dt=la*qe/12,Ct=Math.cos(dt),tt=Math.sin(dt);const je=[];for(let rt=0;rt<=Se;rt++){const mt=rt===0?0:rt/Se*pe;je.push(new ie(mt*Ct,mt*tt,mt*mt/f+.01))}At.push({points:je})}}return At},[pe,f,st]),Oe=m.useMemo(()=>{if(c===uf.CentralPoleWithTripod){const At=[];let kt;for(let gt=0;gt<3;gt++){kt=la*gt/3;const dt=[];dt.push(new ie(pe*Math.cos(kt),pe*Math.sin(kt),Ee)),dt.push(new ie(0,0,Be)),At.push({points:dt})}return At}},[pe,f,c]),Ze=m.useMemo(()=>{if(c===uf.Quadrupod){const At=[];let kt;for(let gt=0;gt<4;gt++){kt=la*gt/4;const dt=[];dt.push(new ie(pe*Math.cos(kt),pe*Math.sin(kt),Ee)),dt.push(new ie(0,0,Be)),At.push({points:dt})}return At}},[pe,f,c]),St=Math.max(1,(i+a)/16),Pt=Vx*St*1.5,Rt=c1*St*3,Ut=ct.clone().multiplyScalar(xe),Ht=new ie(0,0,Be).applyEuler(ft);return h.jsxs("group",{name:"Parabolic Dish Group "+e,rotation:it,position:[Ie,ye,ce+Ae],children:[h.jsxs("group",{rotation:ft,children:[h.jsx(FTe,{receiveShadow:k,castShadow:k,uuid:e,ref:ae,args:[f/2,pe,He,Se],name:"Parabolic Dish Front Side",onPointerDown:At=>{At.button!==2&&F(e,At,Oo.Select)},onContextMenu:At=>{F(e,At,Oo.ContextMenu),R(kt=>{At.intersections.length>0&&At.intersections[0].object===ae.current&&(kt.contextMenuObjectType=z.ParabolicDish)})},onPointerOver:At=>{At.intersections.length>0&&At.intersections[0].object===ae.current&&(Q(!0),X.style.cursor="move")},onPointerOut:()=>{Q(!1),X.style.cursor="default"},children:W&&te?h.jsx("meshBasicMaterial",{attach:"material",side:Ra,map:te}):h.jsx("meshPhongMaterial",{attach:"material",specular:new rr("white"),shininess:100*s,side:Ra,color:"lightskyblue"})}),h.jsx(FTe,{receiveShadow:k,castShadow:k,uuid:e+" backside",ref:se,args:[f/2,pe,He,Se],name:"Parabolic Dish Back Side",position:[0,0,-Ae/4],onPointerDown:At=>{At.button!==2&&F(e,At,Oo.Select)},onContextMenu:At=>{F(e,At,Oo.ContextMenu),R(kt=>{At.intersections.length>0&&At.intersections[0].object===se.current&&(kt.contextMenuObjectType=z.ParabolicDish)})},onPointerOver:At=>{At.intersections.length>0&&At.intersections[0].object===se.current&&(Q(!0),X.style.cursor="move")},onPointerOut:()=>{Q(!1),X.style.cursor="default"},children:h.jsx("meshStandardMaterial",{attach:"material",side:p0,color:P})}),at&&at.length>0&&at.map((At,kt)=>h.jsx(be.Fragment,{children:h.jsx(jn,{name:"Parabolic Dish Wireframe",userData:{unintersectable:!0},points:At.points,castShadow:!1,receiveShadow:!1,lineWidth:T,color:v})},kt)),h.jsx(ca,{name:"Parabolic Dish Receiver",uuid:e,args:[u,u,.5,st?12:4,1],rotation:[Gt,0,0],position:[0,0,Be-.1],receiveShadow:!1,castShadow:!0,children:h.jsx("meshStandardMaterial",{attach:"material",color:P})}),ct.z>0&&h.jsx("mesh",{position:[0,0,Be-.1],children:h.jsx("sprite",{scale:[ke,ke,ke],children:h.jsx("spriteMaterial",{map:De,transparent:!1,color:16777215,blending:nR,depthWrite:!1})})}),(c===uf.CentralPole||c===uf.CentralPoleWithTripod)&&h.jsx(ca,{name:"Parabolic Dish Receiver Pole",uuid:e,args:[d,d,Be,st?6:2,1],rotation:[Gt,0,0],position:[0,0,Be/2],receiveShadow:!1,castShadow:!0,children:h.jsx("meshStandardMaterial",{attach:"material",color:P})}),c===uf.CentralPoleWithTripod&&Oe&&Oe.map((At,kt)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{name:"Parabolic Dish Tripod Lines",userData:{unintersectable:!0},points:At.points,castShadow:!1,receiveShadow:!1,lineWidth:1,color:ze?"dimgray":P}),h.jsx(ds,{position:new ie(At.points[0].x,At.points[0].y,At.points[0].z),args:[d/2,4,4],name:"Parabolic Dish Tripod Joint",children:h.jsx("meshStandardMaterial",{attach:"material",color:P})})]},kt)),c===uf.Quadrupod&&Ze&&Ze.map((At,kt)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{name:"Parabolic Dish Quadrupod Lines",userData:{unintersectable:!0},points:At.points,castShadow:!1,receiveShadow:!1,lineWidth:2,color:ze?"dimgray":P}),h.jsx(ds,{position:new ie(At.points[0].x,At.points[0].y,At.points[0].z),args:[d/2,4,4],name:"Parabolic Dish Quadrupod Joint",children:h.jsx("meshStandardMaterial",{attach:"material",color:P})})]},kt)),h.jsx(lR,{name:"Parabolic Dish Simulation Circle",uuid:e,args:[i/2,He],position:[0,0,Ee],userData:{simulation:!0},receiveShadow:!1,castShadow:!1,visible:!1,children:h.jsx("meshBasicMaterial",{side:$r})}),_&&x&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-pe,-ve,Ee],[-pe,ve,Ee],[pe,ve,Ee],[pe,-ve,Ee],[-pe,-ve,Ee]],castShadow:!1,receiveShadow:!1,lineWidth:1,color:y0}),_&&!x&&h.jsxs(h.Fragment,{children:[h.jsx(ds,{ref:ne,position:new ie(0,0,0),args:[Rt,6,6],name:Ho.Default,onPointerOver:At=>{Ve(At,Ho.Top)},onPointerOut:()=>{yt()},onPointerDown:At=>{At.button!==2&&F(e,At,Oo.Move)},children:h.jsx("meshBasicMaterial",{attach:"material",color:"orange"})}),h.jsxs("group",{children:[h.jsx(Qr,{ref:fe,position:[(Je.x+Ke.x)/2,Je.y,Je.z],args:[Pt,Pt,l*1.2],name:vt.Lower,onPointerDown:At=>{F(e,At,Oo.Resize),de.current&&R(kt=>{const gt=fe.current.localToWorld(new ie(0,a,-Je.z));kt.resizeAnchor.copy(gt)})},onPointerOver:At=>{Ve(At,vt.Lower)},onPointerOut:()=>{yt()},children:h.jsx("meshBasicMaterial",{attach:"material",color:le===vt.Lower||O===vt.Lower?ta:Da})}),h.jsx(Qr,{ref:ge,position:[(We.x+Ne.x)/2,We.y,We.z],args:[Pt,Pt,l*1.2],name:vt.Upper,onPointerDown:At=>{F(e,At,Oo.Resize),de.current&&R(kt=>{const gt=ge.current.localToWorld(new ie(0,-a,-We.z));kt.resizeAnchor.copy(gt)})},onPointerOver:At=>{Ve(At,vt.Upper)},onPointerOut:()=>{yt()},children:h.jsx("meshBasicMaterial",{attach:"material",color:le===vt.Upper||O===vt.Upper?ta:Da})}),h.jsx(Qr,{ref:de,position:[Je.x,(Je.y+We.y)/2,Je.z],args:[Pt,Pt,l*1.2],name:vt.Left,onPointerDown:At=>{F(e,At,Oo.Resize),de.current&&R(kt=>{const gt=de.current.localToWorld(new ie(i,0,-Je.z));kt.resizeAnchor.copy(gt)})},onPointerOver:At=>{Ve(At,vt.Left)},onPointerOut:()=>{yt()},children:h.jsx("meshBasicMaterial",{attach:"material",color:le===vt.Left||O===vt.Left?ta:Da})}),h.jsx(Qr,{ref:Z,position:[Ke.x,(Ke.y+Ne.y)/2,Ke.z],args:[Pt,Pt,l*1.2],name:vt.Right,onPointerDown:At=>{F(e,At,Oo.Resize),de.current&&R(kt=>{const gt=Z.current.localToWorld(new ie(-i,0,-Ke.z));kt.resizeAnchor.copy(gt)})},onPointerOver:At=>{Ve(At,vt.Right)},onPointerOut:()=>{yt()},children:h.jsx("meshBasicMaterial",{attach:"material",color:le===vt.Right||O===vt.Right?ta:Da})})]})]})]}),Te>0&&h.jsx(ca,{userData:{unintersectable:!0},name:"Pole",castShadow:!1,receiveShadow:!1,args:[w,w,Te+l,st?4:2,1],position:[0,0,ot],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:P})}),b&&ct.z>0&&h.jsx(jn,{rotation:[-it.x,0,-it.z],userData:{unintersectable:!0},points:[Ht,new ie(-.3*pe,0,.09*Ee).applyEuler(ft),Ut,new ie(-.6*pe,0,.36*Ee).applyEuler(ft),Ht,new ie(-.9*pe,0,.81*Ee).applyEuler(ft),Ut,Ht,new ie(.3*pe,0,.09*Ee).applyEuler(ft),Ut,new ie(.6*pe,0,.36*Ee).applyEuler(ft),Ht,new ie(.9*pe,0,.81*Ee).applyEuler(ft),Ut],name:"Sun Beams",lineWidth:.25,color:"white"}),($||A)&&!_&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:Ye,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,(t==null?void 0:t.labelHeight)??Math.max(ve*Math.abs(Math.sin(t.tiltAngle))+.1,.2)]})]})}),ttn=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i,ly:a,lz:l=.1,reflectance:s=.9,tiltAngle:c,relativeAzimuth:u,moduleLength:d,poleHeight:f,poleRadius:p=.1,drawSunBeam:g,rotation:y=[0,0,0],color:w="white",lineColor:b="black",lineWidth:C=.5,showLabel:P=!1,locked:v=!1,parentId:T,receiverId:A}=t,x=H(fn),S=H(s0),R=H(rl),M=H(Tc),D=H(Kn),E=ht(Ss),W=H(Cf),j=Tn(u1),L=H(Ds),k=H(Gn),N=H(Y0),F=H(Ug),U=H(d1),O=Es(e),{gl:{domElement:B}}=oi(),[_,X]=m.useState(!1),[$,Q]=m.useState(null),[le,q]=m.useState(1),[te,re]=m.useState(null),ae=m.useRef(null),se=m.useRef(null),ne=m.useRef(null),fe=m.useRef(null),ge=m.useRef(null),de=m.useRef(null),Z=m.useRef(!1),he=Math.max(100,10*F),xe=m.useMemo(()=>({lng:S}),[S]);let He=n,Se=o,ze=r;const Ie=i/2,ye=a/2,ce=l/2,pe=f+Ie,ve=H(ot=>{for(const st of ot.elements)if(st.id===T)return st});if(ve)switch(ve.type){case z.Foundation:if(ze=pe+ce+ve.lz,me.isZero(y[2]))He=ve.cx+n*ve.lx,Se=ve.cy+o*ve.ly;else{const ot=new ie(n*ve.lx,o*ve.ly,0);ot.applyAxisAngle(Io,y[2]),He=ve.cx+ot.x,Se=ve.cy+ot.y}break}const Ae=new ie(-Ie,-ye,ce),Te=new ie(-Ie,ye,ce),Me=new ie(Ie,-ye,ce),Pe=new ie(Ie,ye,ce);m.useEffect(()=>{if(t&&E){const ot=j(t.id);ot&&re(me.fetchHeatmapTexture(ot,W??5))}},[E,W]),m.useEffect(()=>{q(Math.max(1,Math.round(a/d)))},[a,d]),m.useEffect(()=>{const ot=()=>{Fn.getState().setEnableOrbitController(!0),Z.current=!1};return window.addEventListener("pointerup",ot),()=>{window.removeEventListener("pointerup",ot)}},[]);const Ee=m.useMemo(()=>(t!=null&&t.label?t.label:Y.t("shared.FresnelReflectorElement",xe))+(t!=null&&t.locked?" ("+Y.t("shared.ElementLocked",xe)+")":"")+(t!=null&&t.label?"":` +}`;var Pa=Bj(function(){return ji(Ot,ei+"return "+zo).apply(n,dn)});if(Pa.source=zo,C7(Pa))throw Pa;return Pa}function QI(G){return ll(G).toLowerCase()}function qS(G){return ll(G).toUpperCase()}function ZI(G,ee,Re){if(G=ll(G),G&&(Re||ee===n))return b3(G);if(!G||!(ee=b0(ee)))return G;var et=ms(G),Mt=ms(ee),Ot=xl(et,Mt),dn=_g(et,Mt)+1;return M1(et,Ot,dn).join("")}function Uj(G,ee,Re){if(G=ll(G),G&&(Re||ee===n))return G.slice(0,xy(G)+1);if(!G||!(ee=b0(ee)))return G;var et=ms(G),Mt=_g(et,ms(ee))+1;return M1(et,0,Mt).join("")}function jj(G,ee,Re){if(G=ll(G),G&&(Re||ee===n))return G.replace(Pt,"");if(!G||!(ee=b0(ee)))return G;var et=ms(G),Mt=xl(et,ms(ee));return M1(et,Mt).join("")}function Nr(G,ee){var Re=M,et=D;if(As(ee)){var Mt="separator"in ee?ee.separator:Mt;Re="length"in ee?Gi(ee.length):Re,et="omission"in ee?b0(ee.omission):et}G=ll(G);var Ot=G.length;if(Ih(G)){var dn=ms(G);Ot=dn.length}if(Re>=Ot)return G;var xn=Re-Xc(et);if(xn<1)return et;var zn=dn?M1(dn,0,xn).join(""):G.slice(0,xn);if(Mt===n)return zn+et;if(dn&&(xn+=zn.length-xn),OS(Mt)){if(G.slice(xn).search(Mt)){var wo,bo=zn;for(Mt.global||(Mt=Jc(Mt.source,ll(tt.exec(Mt))+"g")),Mt.lastIndex=0;wo=Mt.exec(bo);)var zo=wo.index;zn=zn.slice(0,zo===n?xn:zo)}}else if(G.indexOf(b0(Mt),xn)!=xn){var Tr=zn.lastIndexOf(Mt);Tr>-1&&(zn=zn.slice(0,Tr))}return zn+et}function ez(G){return G=ll(G),G&&ct.test(G)?G.replace(Ve,by):G}var c0=J(function(G,ee,Re){return G+(Re?" ":"")+ee.toUpperCase()}),Y5=_3("toUpperCase");function z1(G,ee,Re){return G=ll(G),ee=Re?n:ee,ee===n?S3(G)?Sy(G):Zu(G):G.match(ee)||[]}var Bj=Zr(function(G,ee){try{return Ln(G,n,ee)}catch(Re){return C7(Re)?Re:new ui(Re)}}),kne=oa(function(G,ee){return Wn(ee,function(Re){Re=sm(Re),Fh(G,Re,T7(G[Re],G))}),G});function Lne(G){var ee=G==null?0:G.length,Re=gi();return G=ee?Or(G,function(et){if(typeof et[1]!="function")throw new G0(a);return[Re(et[0]),et[1]]}):[],Zr(function(et){for(var Mt=-1;++MtF)return[];var Re=B,et=X0(G,B);ee=gi(ee),G-=B;for(var Mt=Mh(et,ee);++Re0||ee<0)?new di(Re):(G<0?Re=Re.takeRight(-G):G&&(Re=Re.drop(G)),ee!==n&&(ee=Gi(ee),Re=ee<0?Re.dropRight(-ee):Re.take(ee-G)),Re)},di.prototype.takeRightWhile=function(G){return this.reverse().takeWhile(G).reverse()},di.prototype.toArray=function(){return this.take(B)},bu(di.prototype,function(G,ee){var Re=/^(?:filter|find|map|reject)|While$/.test(ee),et=/^(?:head|last)$/.test(ee),Mt=Wt[et?"take"+(ee=="last"?"Right":""):ee],Ot=et||/^find/.test(ee);Mt&&(Wt.prototype[ee]=function(){var dn=this.__wrapped__,xn=et?[1]:arguments,zn=dn instanceof di,wo=xn[0],bo=zn||Zi(dn),zo=function(_a){var sl=Mt.apply(Wt,ya([_a],xn));return et&&Tr?sl[0]:sl};bo&&Re&&typeof wo=="function"&&wo.length!=1&&(zn=bo=!1);var Tr=this.__chain__,ei=!!this.__actions__.length,Mi=Ot&&!Tr,Pa=zn&&!ei;if(!Ot&&bo){dn=Pa?dn:new di(this);var Ii=G.apply(dn,xn);return Ii.__actions__.push({func:By,args:[zo],thisArg:n}),new J0(Ii,Tr)}return Mi&&Pa?G.apply(this,xn):(Ii=this.thru(zo),Mi?et?Ii.value()[0]:Ii.value():Ii)})}),Wn(["pop","push","shift","sort","splice","unshift"],function(G){var ee=Gg[G],Re=/^(?:push|sort|unshift)$/.test(G)?"tap":"thru",et=/^(?:pop|shift)$/.test(G);Wt.prototype[G]=function(){var Mt=arguments;if(et&&!this.__chain__){var Ot=this.value();return ee.apply(Zi(Ot)?Ot:[],Mt)}return this[Re](function(dn){return ee.apply(Zi(dn)?dn:[],Mt)})}}),bu(di.prototype,function(G,ee){var Re=Wt[ee];if(Re){var et=Re.name+"";Ya.call(v1,et)||(v1[et]=[]),v1[et].push({name:ee,func:Re})}}),v1[pt(n,b).name]=[{name:"wrapper",func:n}],di.prototype.clone=gS,di.prototype.reverse=mS,di.prototype.value=Od,Wt.prototype.at=Zte,Wt.prototype.chain=cI,Wt.prototype.commit=ene,Wt.prototype.next=uI,Wt.prototype.plant=nne,Wt.prototype.reverse=one,Wt.prototype.toJSON=Wt.prototype.valueOf=Wt.prototype.value=ES,Wt.prototype.first=Wt.prototype.head,Yd&&(Wt.prototype[Yd]=tne),Wt},bp=pS();$e?(($e.exports=bp)._=bp,Pn._=bp):pn._=bp}).call(Ac)})(lX,lX.exports);var L2=lX.exports;const nZt=t=>{const{lx:e,lz:n,parentId:o,id:r,roofId:i}=t,a=H(rxt),l=H(_ge);m.useEffect(()=>{i&&(a===i||l.has(i))&&H.getState().set(d=>{for(const f of d.elements)if(f.id===r&&f.type===z.Wall){const p=f;p.roofId=null,p.leftRoofHeight=void 0,p.rightRoofHeight=void 0,p.centerRoofHeight=void 0,p.centerLeftRoofHeight=void 0,p.centerRightRoofHeight=void 0;break}})},[i,a,l]);const s=d=>!(d.button===2||H.getState().moveHandleType||H.getState().resizeHandleType||H.getState().objectTypeToAdd!==z.None||H.getState().isAddingElement()),c=d=>{s(d)&&(H.getState().set(f=>{f.contextMenuObjectType=null}),H.getState().selectMe(r,d,Oo.Select))},u=d=>{H.getState().selectMe(r,d,Oo.ContextMenu),H.getState().set(f=>{d.intersections.length>0&&d.intersections[0].object===d.eventObject&&(f.contextMenuObjectType=z.Wall)})};return h.jsx(ua,{args:[e,n],rotation:[Gt,0,0],visible:!1,onPointerDown:c,onContextMenu:u,children:h.jsx("meshBasicMaterial",{side:$r})})},oZt=be.memo(nZt),zSe=({cy:t,size:e,type:n})=>{const[o,r]=m.useState(XF),i=()=>{r(ta)},a=()=>{r(XF)};return h.jsx(ds,{name:n,args:[e],position:[0,t,0],onPointerEnter:i,onPointerOut:a,children:h.jsx("meshBasicMaterial",{attach:"material",color:o})})},rZt=({ply:t,phz:e})=>{const n=a5(),o=r=>{r.intersections.length>0&&r.intersections[0].eventObject.parent===r.eventObject&&(H.getState().set(i=>{i.moveHandleType=r.object.name}),Fn.getState().setEnableOrbitController(!1))};return h.jsxs("group",{name:"Move Handle Group",position:[0,0,-e],onPointerDown:o,children:[h.jsx(zSe,{cy:-n,size:n,type:Ho.Lower}),h.jsx(zSe,{cy:t+n,size:n,type:Ho.Upper})]})},iZt=be.memo(rZt),aZt="#ADD8E6",R4=be.memo(({x:t,z:e,handleType:n,highLight:o,handleSize:r,partial:i})=>{const a=H(fn),l=H(d1),s=H(yOe),[c,u]=m.useState(!1),d=o||c||n===l||s&&(n===vt.LowerRight||n===vt.UpperRight)?ta:i?aZt:Da;let f=r,p=r,g=r;if(n===vt.LowerRight||n===vt.LowerLeft)f=r*1.7;else if(i){f*=.75,p=r/2,g=r*2.5;const y=g/4;n===vt.WallPartialResizeLeft||n===vt.WallPartialResizeRight?e-=y:(n===vt.WallPartialResizeLeftTop||n===vt.WallPartialResizeRightTop)&&(e+=y)}else p=r/2,g=r*1.7;return h.jsx(Qr,{name:n,args:[f,p,g],position:[t,0,e],onPointerOver:()=>{u(!0),a(y=>{y.hoveredHandle=n})},onPointerLeave:()=>{u(!1),a(y=>{y.hoveredHandle=null})},children:h.jsx("meshBasicMaterial",{color:d})})}),lZt=be.memo(({id:t,parentLz:e,roofId:n,x:o,z:r,absAngle:i,leftUnfilledHeight:a,rightUnfilledHeight:l,leftTopPartialResizeHandleHeight:s,rightTopPartialResizeHandleHeight:c,fill:u,wallLeftHeight:d,wallRightHeight:f,highLight:p,leftJoints:g,rightJoints:y})=>{const w=H(fn),b=H(Id),C=a5(),[P,v]=m.useState(!1),[T,A]=m.useState(new ie),[x,S]=m.useState(new nn),R=m.useRef(null),M=m.useRef(!1),D=m.useRef([r*2,a,l]),E=m.useRef(new Map),W=m.useRef(null),j=m.useRef(null),L=m.useRef([]),k=m.useMemo(()=>{if(!n)return null;const q=H.getState().elements.find(te=>te.id===n&&te.type===z.Roof);return q?q.roofType:null},[n]);b&&(r=-r);const N=q=>{const te=H.getState().cameraDirection,re=Math.atan2(te.x,te.y);A(new ie(q,0,0)),S(new nn(Gt,0,-re-i,"ZXY")),v(!0)},F=(q,te,re)=>{const[ae,se,ne,fe,ge]=te;w(de=>{for(const Z of de.elements)if(Z.id===q&&Z.type===z.Wall){const he=Z;Z.lz=ae,he.leftUnfilledHeight=se,he.rightUnfilledHeight=ne,he.leftTopPartialHeight=fe,he.rightTopPartialHeight=ge}else if(Z.type===z.Wall&&re.has(Z.id)){const he=re.get(Z.id);he!==void 0&&(Z.lz=he,Z.cz=he/2)}})},U=()=>{n&&(g.length>0||y.length>0)&&(k===Go.Gable||k===Go.Gambrel?H.getState().elements.forEach(q=>{q.id===g[0]&&(W.current=q.lz),q.id===y[0]&&(j.current=q.lz)}):(E.current.clear(),H.getState().elements.forEach(q=>{q.type===z.Wall&&q.roofId===n&&E.current.set(q.id,q.lz)})))},O=()=>{L.current=H.getState().elements.filter(q=>q.parentId===t)},B=(q,te,re,ae,se)=>{const{lx:ne,lz:fe,roofId:ge,leftRoofHeight:de,rightRoofHeight:Z,centerLeftRoofHeight:he,centerRightRoofHeight:xe,centerRoofHeight:He}=q,Se=u===El.Partial,ze=Se?Math.min(d,ae):d,Ie=Se?Math.min(f,se):f,ye=Se&&(!me.isZero(d-ze)||!me.isZero(f-Ie)),[ce,pe]=[ne/2,fe/2],ve=[];return ve.push({x:-ce,y:-pe+te},{x:ce,y:-pe+re}),ye?ve.push({x:ce,y:-pe+Ie},{x:-ce,y:-pe+ze}):ge?(Z?ve.push({x:ce,y:-pe+Z}):ve.push({x:ce,y:pe}),xe&&ve.push({x:xe[0]*ne,y:-pe+xe[1]}),He&&ve.push({x:He[0]*ne,y:-pe+He[1]}),he&&ve.push({x:he[0]*ne,y:-pe+he[1]}),de?ve.push({x:-ce,y:-pe+de}):ve.push({x:-ce,y:pe})):ve.push({x:ce,y:pe},{x:-ce,y:pe}),ve},_=(q,te,re,ae,se)=>{const ne=B(q,te,re,ae,se);if(L.current.length>0)for(const fe of L.current){let{cx:ge,cz:de,lx:Z,ly:he,lz:xe}=fe;if(ge*=q.lx,de*=q.lz,fe.type!==z.SolarPanel?(Z*=q.lx,xe*=q.lz):xe=he,fe.type===z.Window&&fe.windowType===Ti.Polygonal){const[He,Se]=fe.polygonTop??Gp,ze=ge+He*Z,Ie=de+xe/2+Se;if(!me.isPointInside(ze,Ie,ne))return!1}if(!me.isElementInsideWall(new ie(ge,0,de),Z,xe,ne,fe.type===z.Door))return!1}return!0},X=()=>{W.current=null,j.current=null},$=q=>{var re;if(H.getState().addedWallId||q.object!==((re=q.intersections[0])==null?void 0:re.object))return;const te=q.object;switch(te.name){case vt.LowerLeft:{w(ae=>{ae.resizeAnchor.copy(te.localToWorld(new ie(o*2,0,0)))});break}case vt.LowerRight:{w(ae=>{ae.resizeAnchor.copy(te.localToWorld(new ie(-o*2,0,0)))});break}case vt.UpperLeft:case vt.WallPartialResizeLeft:case vt.WallPartialResizeLeftTop:{N(-o),U(),O();break}case vt.UpperRight:case vt.WallPartialResizeRight:case vt.WallPartialResizeRightTop:{N(o),U(),O();break}default:console.error("Wall resize handle unknown");return}w(ae=>{ae.resizeHandleType=te.name}),Fn.getState().setEnableOrbitController(!1),M.current=!0,D.current=[r*2,a,l,s,c]},Q=q=>{if(q.intersections.length===0||!M.current)return;const te=q.intersections[0].point;switch(H.getState().resizeHandleType){case vt.UpperLeft:case vt.UpperRight:{w(re=>{const ae=u===El.Partial?Math.max(a,l):0;let se=Math.max(ae+C,te.z-e);if(k===null||k===Go.Gable||k===Go.Gambrel){if(W.current||j.current){const ne=Math.abs(se-(W.current??1/0)),fe=Math.abs(se-(j.current??1/0));ne{for(const ae of re.elements)if(ae.id===t&&ae.type===z.Wall){const se=ae;let ne=me.clamp(te.z-e,0,se.leftTopPartialHeight);if(se.leftJoints.length>0){const fe=re.elements.find(ge=>ge.id===se.leftJoints[0]&&ge.type===z.Wall);if(fe&&fe.fill===El.Partial){const ge=fe.rightUnfilledHeight;Math.abs(ne-ge)<.5&&(ne=ge)}}_(se,ne,re.enableFineGrid?ne:se.rightUnfilledHeight,se.leftTopPartialHeight,se.rightTopPartialHeight)&&(se.leftUnfilledHeight=ne,re.enableFineGrid&&(se.rightUnfilledHeight=ne));break}});break}case vt.WallPartialResizeRight:{w(re=>{for(const ae of re.elements)if(ae.id===t&&ae.type===z.Wall){const se=ae;let ne=me.clamp(te.z-e,0,se.rightTopPartialHeight);if(se.rightJoints.length>0){const fe=re.elements.find(ge=>ge.id===se.rightJoints[0]&&ge.type===z.Wall);if(fe&&fe.fill===El.Partial){const ge=fe.leftUnfilledHeight;Math.abs(ne-ge)<.5&&(ne=ge)}}_(se,re.enableFineGrid?ne:se.leftUnfilledHeight,ne,se.leftTopPartialHeight,se.rightTopPartialHeight)&&(se.rightUnfilledHeight=ne,re.enableFineGrid&&(se.leftUnfilledHeight=ne));break}});break}case vt.WallPartialResizeLeftTop:{w(re=>{const ae=re.elements.find(se=>se.id===t&&se.type===z.Wall);if(ae){let se=me.clamp(te.z-e,ae.leftUnfilledHeight,ae.lz);if(ae.leftJoints.length>0){const ne=re.elements.find(fe=>fe.id===ae.leftJoints[0]&&fe.type===z.Wall);if(ne&&ne.fill===El.Partial){const fe=ne.rightTopPartialHeight;Math.abs(se-fe)<.5&&(se=fe)}}_(ae,ae.leftUnfilledHeight,ae.rightUnfilledHeight,se,re.enableFineGrid?se:ae.rightTopPartialHeight)&&(ae.leftTopPartialHeight=se,re.enableFineGrid&&(ae.rightTopPartialHeight=se))}});break}case vt.WallPartialResizeRightTop:{w(re=>{const ae=re.elements.find(se=>se.id===t&&se.type===z.Wall);if(ae){let se=me.clamp(te.z-e,ae.rightUnfilledHeight,ae.lz);if(ae.rightJoints.length>0){const ne=re.elements.find(fe=>fe.id===ae.rightJoints[0]&&fe.type===z.Wall);if(ne&&ne.fill===El.Partial){const fe=ne.leftTopPartialHeight;Math.abs(se-fe)<.5&&(se=fe)}}_(ae,ae.leftUnfilledHeight,ae.rightUnfilledHeight,re.enableFineGrid?se:ae.leftTopPartialHeight,se)&&(ae.rightTopPartialHeight=se,re.enableFineGrid&&(ae.leftTopPartialHeight=se))}});break}}},le=()=>{Fn.getState().setEnableOrbitController(!0),v(!1),X(),M.current=!1;const q=new Map;n&&k!==Go.Gable&&k!==Go.Gambrel&&H.getState().elements.forEach(re=>{re.type===z.Wall&&re.roofId===n&&q.set(re.id,re.lz)});const te={name:"Change Wall Height",timestamp:Date.now(),resizedElementId:t,resizedElementType:z.Wall,oldHeights:[...D.current],newHeights:[r*2,a,l,s,c],oldSameBuildingWallsHeightMap:new Map(E.current),newSameBuildingWallsHeightMap:q,undo(){F(this.resizedElementId,this.oldHeights,this.oldSameBuildingWallsHeightMap)},redo(){F(this.resizedElementId,this.newHeights,this.newSameBuildingWallsHeightMap)}};H.getState().addUndoable(te),w(re=>{re.actionState.wallHeight=r*2,re.resizeHandleType=null})};return h.jsxs(h.Fragment,{children:[h.jsxs("group",{name:"Wall Resize Handle Group",onPointerDown:$,children:[h.jsx(R4,{x:-o,z:-r,handleType:vt.LowerLeft,highLight:p,handleSize:C}),h.jsx(R4,{x:o,z:-r,handleType:vt.LowerRight,highLight:p,handleSize:C}),!b&&h.jsxs(h.Fragment,{children:[h.jsx(R4,{x:-o,z:r,handleType:vt.UpperLeft,highLight:p,handleSize:C}),h.jsx(R4,{x:o,z:r,handleType:vt.UpperRight,highLight:p,handleSize:C}),u===El.Partial&&h.jsxs(h.Fragment,{children:[h.jsx(R4,{x:-o,z:-r+a,handleType:vt.WallPartialResizeLeft,highLight:p,handleSize:C,partial:!0}),h.jsx(R4,{x:o,z:-r+l,handleType:vt.WallPartialResizeRight,highLight:p,handleSize:C,partial:!0}),h.jsx(R4,{x:-o,z:-r+s,handleType:vt.WallPartialResizeLeftTop,highLight:p,handleSize:C,partial:!0}),h.jsx(R4,{x:o,z:-r+c,handleType:vt.WallPartialResizeRightTop,highLight:p,handleSize:C,partial:!0})]})]})]}),P&&h.jsx(ua,{ref:R,position:T,rotation:x,args:[1e4,1e4],visible:!1,onPointerMove:Q,onPointerUp:le,children:h.jsx("meshBasicMaterial",{side:$r})})]})});function w$e(t){return t.type===z.Cuboid}const sZt="/aladdin/assets/building_facade_01-PU9ju7d_.png",cZt="/aladdin/assets/building_facade_02-x--kz-oN.png",uZt="/aladdin/assets/building_facade_03-BYNjzj26.png",dZt="/aladdin/assets/building_facade_04-VGO1xPmk.png",fZt="/aladdin/assets/building_facade_05-D5uzq3D-.png",hZt="/aladdin/assets/building_facade_06-ClFD4NV8.png",pZt="/aladdin/assets/building_facade_07-XvrQxWV-.png",gZt="/aladdin/assets/building_facade_08-D0kjh0Oz.png",mZt="/aladdin/assets/building_facade_09-y8kFBOu-.png",yZt="/aladdin/assets/building_facade_10-B2-exMft.png",_z=be.memo(({handleType:t,position:e,size:n,onPointerDown:o,onPointerOver:r,onPointerOut:i})=>{const a=H(Eb),l=H(ly),s=m.useRef(null),[c,u,d]=e;let f=tw;c===0&&u===0?f=eAt:c===0?f=XF:u===0&&(f=tw);const p=l===t||a===t?ta:f;return h.jsx(ds,{ref:s,name:t,args:[n/2,6,6,0,Math.PI],position:[c,u,d],onPointerDown:o,onPointerOver:g=>{r(g,t)},onPointerOut:i,children:h.jsx("meshBasicMaterial",{color:p})})}),mm=be.memo(({handleType:t,position:e,size:n,onPointerOver:o,onPointerOut:r})=>{const i=H(d1),a=H(ly),l=m.useRef(null),[s,c,u]=e,d=a===t||i===t?ta:Da,f=()=>{if(l.current){const p=l.current.localToWorld(new ie(-s*2,-c*2,0));H.getState().set(g=>{g.resizeAnchor.copy(p),g.resizeHandleType=t}),Fn.getState().setEnableOrbitController(!1)}};return h.jsx(Qr,{ref:l,name:t,args:[n,n,n],position:[s,c,u],onPointerDown:f,onPointerOver:p=>{o(p,t)},onPointerOut:r,children:h.jsx("meshBasicMaterial",{color:d})})}),AZt=({id:t,args:e})=>{const[n,o,r]=e,i=H(fn),a=H(Gn),l=H(Id),s=H(t$),[c,u]=m.useState(null),{gl:d,raycaster:f}=oi(),p=a5(),g=m.useRef(null),y=m.useRef(null),w=m.useRef(null),b=m.useRef(null),C=m.useRef(null),P=m.useRef(new Map),v=m.useRef(new Map),T=m.useRef(null),A=m.useMemo(()=>[0,Math.min(-1.2*o,-o-.75)-p*2,Vx/2-r],[o,r,p]),x=m.useMemo(()=>[0,Math.max(1.2*o,o+.75)+p*2,Vx/2-r],[o,r,p]),S=c!==null,R=!l,M=!s,D=m.useCallback((q,te)=>{ht.getState().duringCameraInteraction||q.intersections.length>0&&(q.intersections[0].object===q.eventObject||q.intersections.length>1&&q.intersections[1].object===q.eventObject)&&(i(ae=>{ae.hoveredHandle=te;const se=a(t);se&&(ae.selectedElementAngle=se.rotation[2],ae.selectedElementHeight=se.lz)}),me.isMoveHandle(te)?d.domElement.style.cursor="move":te===Kr.Upper||te===Kr.Lower?d.domElement.style.cursor="grab":d.domElement.style.cursor=H.getState().addedCuboidId?"crosshair":"pointer")},[]),E=m.useCallback(()=>{i(q=>{q.hoveredHandle=null}),d.domElement.style.cursor=H.getState().addedCuboidId?"crosshair":"default"},[]),W=q=>{const te=a(q);if(!te)return 0;const re=te.rotation[2];return te.parentId===Zo?re:re+W(te.parentId)},j=q=>{switch(q){case z.SolarPanel:case z.Human:case z.Flower:case z.Tree:return!0}return!1},L=q=>j(q)||q===z.Cuboid,k=q=>{i(te=>{const re=te.elements.find(ze=>ze.id===t);if(!re)return;const ae=q.clone().setZ(0),se=H.getState().resizeAnchor.clone().setZ(0),ne=new ie().subVectors(ae,se).applyEuler(new nn(0,0,-(w.current??0))),fe=new ie().addVectors(ae,se).multiplyScalar(.5),{pos:ge,rot:de}=me.getWorldDataById(re.parentId),Z=new ie().subVectors(fe,ge).applyEuler(new nn(0,0,-de));re.cx=Z.x,re.cy=Z.y;const he=Math.abs(ne.x),xe=Math.abs(ne.y);re.lx=he,re.ly=xe;const He=new ie(Z.x,Z.y,re.cz).applyEuler(new nn(0,0,de)).add(ge),Se=re.rotation[2]+de;if(P.current.size>0)for(const ze of te.elements){const Ie=P.current.get(ze.id);if(Ie){const ye=Ie.clone().sub(He).applyEuler(new nn(0,0,-Se));if(j(ze.type)){const ce=v.current.get(ze.id);if(ce){const[pe,ve]=ce;pe==="Top"?(ze.cx=ye.x,ze.cy=ye.y):pe==="NS"?(ze.cx=ye.x,ze.cy=Math.sign(ve)*(xe/2)):pe==="EW"&&(ze.cx=Math.sign(ve)*(he/2),ze.cy=ye.y)}}else ze.type===z.Cuboid?(ze.cx=ye.x,ze.cy=ye.y):(ze.cx=ye.x/he,ze.cy=ye.y/xe)}}})},N=q=>{i(te=>{const re=te.elements.find(Se=>Se.id===t);if(!re)return;const ae=q.clone().setZ(0),se=H.getState().resizeAnchor.clone().setZ(0),ne=new ie().subVectors(ae,se).applyEuler(new nn(0,0,-(w.current??0))),fe=new ie().addVectors(ae,se).multiplyScalar(.5),{pos:ge,rot:de}=me.getWorldDataById(re.parentId),Z=new ie().subVectors(fe,ge).applyEuler(new nn(0,0,-de));re.cx=Z.x;const he=Math.abs(ne.x);re.lx=he;const xe=new ie(Z.x,Z.y,re.cz).applyEuler(new nn(0,0,de)).add(ge),He=re.rotation[2]+de;if(P.current.size>0)for(const Se of te.elements){const ze=P.current.get(Se.id);if(ze){const Ie=ze.clone().sub(xe).applyEuler(new nn(0,0,-He));if(j(Se.type)){const ye=v.current.get(Se.id);if(ye){const[ce,pe]=ye;ce==="Top"||ce==="NS"?Se.cx=Ie.x:ce==="EW"&&(Se.cx=Math.sign(pe)*(he/2))}}else Se.type===z.Cuboid?Se.cx=Ie.x:Se.cx=Ie.x/he}}})},F=q=>{i(te=>{const re=te.elements.find(Se=>Se.id===t);if(!re)return;const ae=q.clone().setZ(0),se=H.getState().resizeAnchor.clone().setZ(0),ne=new ie().subVectors(ae,se).applyEuler(new nn(0,0,-(w.current??0))),fe=new ie().addVectors(ae,se).multiplyScalar(.5),{pos:ge,rot:de}=me.getWorldDataById(re.parentId),Z=new ie().subVectors(fe,ge).applyEuler(new nn(0,0,-de));re.cy=Z.y;const he=Math.abs(ne.y);re.ly=he;const xe=new ie(Z.x,Z.y,re.cz).applyEuler(new nn(0,0,de)).add(ge),He=re.rotation[2]+de;if(P.current.size>0)for(const Se of te.elements){const ze=P.current.get(Se.id);if(ze){const Ie=ze.clone().sub(xe).applyEuler(new nn(0,0,-He));if(j(Se.type)){const ye=v.current.get(Se.id);if(ye){const[ce,pe]=ye;ce==="Top"?Se.cy=Ie.y:ce==="NS"?Se.cy=Math.sign(pe)*(he/2):ce==="EW"&&(Se.cy=Ie.y)}}else Se.type===z.Cuboid?Se.cy=Ie.y:Se.cy=Ie.y/he}}})},U=q=>{if(g.current!==null){const te=Math.max(1,q.z-g.current);i(re=>{for(const ae of re.elements)if(ae.id===t&&(ae.lz=te,ae.cz=te/2,re.selectedElementHeight=te),ae.parentId===t&&j(ae.type)){const se=v.current.get(ae.id);se&&se[0]==="Top"&&(ae.cz=te/2)}})}},O=q=>{if(y.current){const[te,re]=y.current;let ae=Math.atan2(te-q.x,q.y-re)+(H.getState().rotateHandleType===Kr.Upper?0:Math.PI);const se=Math.abs(ae)>Math.PI?-Math.sign(ae)*la:0;b.current&&(ae-=b.current),H.getState().updateElementRotationById(t,0,0,ae+se)}},B=q=>{if(q.intersections.length>0&&q.intersections[0].object.name===q.object.name||H.getState().addedCuboidId){const te=a(t);if(te&&te.parentId!==Zo){u({position:new ie(0,0,-r),rotation:new nn});const{pos:re,rot:ae}=me.getWorldDataById(te.parentId);C.current=re,b.current=ae,w.current=ae+te.rotation[2];const se=new ie(te.cx,te.cy,te.cz).applyEuler(new nn(0,0,ae)).add(re),ne=H.getState().elements.filter(fe=>fe.parentId===te.id&&(L(fe.type)||me.isIdentical(fe.normal,[0,0,1])));P.current.clear(),v.current.clear();for(const fe of ne){const ge=new ie;j(fe.type)?(ge.set(fe.cx,fe.cy,fe.cz),Math.abs(fe.cz-r)<.01?v.current.set(fe.id,["Top",1]):Math.abs(Math.abs(fe.cx)-n)<.01?v.current.set(fe.id,["EW",Math.sign(fe.cx)]):v.current.set(fe.id,["NS",Math.sign(fe.cy)])):fe.type===z.Cuboid?ge.set(fe.cx,fe.cy,fe.cz):ge.set(fe.cx*te.lx,fe.cy*te.ly,0),ge.applyEuler(new nn(0,0,w.current)).add(se),P.current.set(fe.id,ge)}}i(re=>{re.selectedElementIdSet.clear(),re.selectedElementIdSet.add(t),re.selectedElement=re.elements.find(ae=>ae.id===t)??null})}},_=q=>{if(q.intersections.length>0&&q.intersections[0].object.name===q.object.name){const te=q.intersections[0].object,re=H.getState().cameraDirection,ae=Math.atan2(re.x,re.y)+W(t);u({position:te.position.clone(),rotation:new nn(-Gt,ae,0)});const se=te.localToWorld(new ie);g.current=se.z-r*2;const ne=H.getState().elements.filter(fe=>fe.parentId===t&&j(fe.type));v.current.clear();for(const fe of ne)new ie().set(fe.cx,fe.cy,fe.cz),Math.abs(fe.cz-r)<.01&&v.current.set(fe.id,["Top",1]);i(fe=>{fe.selectedElementIdSet.clear(),fe.selectedElementIdSet.add(t),fe.selectedElement=fe.elements.find(ge=>ge.id===t)??null})}},X=q=>{if(q.intersections.length>0&&q.intersections[0].object.name===q.object.name){u({position:new ie(0,0,-r),rotation:new nn(0,0,0)});const te=q.eventObject;y.current=te.localToWorld(new ie).toArray();const re=a(t);re&&(b.current=W(re.parentId))}},$=q=>{if(q.intersections.length>0){const te=q.intersections[0].eventObject.name;switch(te){case Ho.Lower:case Ho.Upper:case Ho.Left:case Ho.Right:case Ho.Top:{H.getState().set(re=>{const ae=re.elements.find(se=>se.id===t)??null;if(ae){if(re.selectedElement=ae,ae.parentId===Zo)for(const se of re.elements)re.selectedElementIdSet.has(se.id)&&!me.isElementAllowedMultipleMoveOnGround(se)&&re.selectedElementIdSet.delete(se.id);else re.selectedElementIdSet.clear(),re.selectedElementIdSet.add(ae.id);re.moveHandleType=te}}),Fn.getState().setEnableOrbitController(!1);break}}}},Q=q=>{if(T.current){const te=f.intersectObject(T.current);if(te.length){const re=te[0].point,ae=H.getState().resizeHandleType;ae?me.isTopResizeHandle(ae)?U(re):me.isXResizeHandle(ae)?N(re):me.isYResizeHandle(ae)?F(re):k(re):H.getState().rotateHandleType&&O(re)}}},le=()=>{u(null),g.current=null,y.current=null,w.current=null,b.current=null,C.current=null};return h.jsxs(h.Fragment,{children:[S&&h.jsx(ua,{name:"Cuboid Intersection Plane",ref:T,args:[1e4,1e4],position:c.position,rotation:c.rotation,visible:!1,onPointerMove:Q,onPointerUp:le}),h.jsxs("group",{name:"Bottom Resize Handle Group",position:[0,0,-r+p/2],onPointerDown:B,children:[h.jsx(mm,{handleType:vt.UpperLeft,position:[-n,o,0],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.UpperRight,position:[n,o,0],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.LowerLeft,position:[-n,-o,0],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.LowerRight,position:[n,-o,0],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.Left,position:[-n,0,0],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.Right,position:[n,0,0],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.Upper,position:[0,o,0],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.Lower,position:[0,-o,0],size:p,onPointerOver:D,onPointerOut:E})]}),R&&h.jsxs("group",{name:"Cuboid Top Resize Handle Group",onPointerDown:_,children:[h.jsx(mm,{handleType:vt.LowerLeftTop,position:[-n,-o,r],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.UpperLeftTop,position:[-n,o,r],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.LowerRightTop,position:[n,-o,r],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(mm,{handleType:vt.UpperRightTop,position:[n,o,r],size:p,onPointerOver:D,onPointerOut:E})]}),M&&h.jsxs(h.Fragment,{children:[h.jsxs("group",{name:"Cuboid Move Handle Group",onPointerDown:$,children:[h.jsx(_z,{handleType:Ho.Lower,position:[0,-o-p*1.2,-r],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(_z,{handleType:Ho.Upper,position:[0,o+p*1.2,-r],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(_z,{handleType:Ho.Left,position:[-n-p*1.2,0,-r],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(_z,{handleType:Ho.Right,position:[n+p*1.2,0,-r],size:p,onPointerOver:D,onPointerOut:E}),h.jsx(_z,{handleType:Ho.Top,position:[0,0,r],size:p,onPointerOver:D,onPointerOut:E})]}),h.jsxs("group",{name:"Cuboid Rotate Handle Group",onPointerDown:X,children:[h.jsx(PR,{id:t,handleType:Kr.Lower,position:A,ratio:p*4,hoverHandle:D,noHoverHandle:E}),h.jsx(PR,{id:t,position:x,handleType:Kr.Upper,ratio:p*4,hoverHandle:D,noHoverHandle:E})]})]})]})},wZt=be.memo(AZt);class ea{static isNewPositionOk(e){const n=H.getState().elements.find(o=>o.id===e.parentId);if(!n)return!1;switch(n.type){case z.Foundation:{if(!me.isSolarCollectorWithinHorizontalSurface(e,n))return po(Y.t("message.MoveOutsideBoundaryCancelled",{lng:H.getState().language})),!1;if(H.getState().overlapWithSibling(e))return po(Y.t("message.MoveCancelledBecauseOfOverlap",{lng:H.getState().language})),!1;break}case z.Cuboid:{const o=me.checkElementOnCuboidState(e,n);if(o===ma.OutsideBoundary)return po(Y.t("message.MoveOutsideBoundaryCancelled",{lng:H.getState().language})),!1;if(o===ma.OverLap)return po(Y.t("message.MoveCancelledBecauseOfOverlap",{lng:H.getState().language})),!1;break}case z.Wall:{const o=me.checkElementOnWallState(e,n);if(o===ma.OutsideBoundary)return po(Y.t("message.MoveOutsideBoundaryCancelled",{lng:H.getState().language})),!1;if(o===ma.OverLap)return po(Y.t("message.MoveCancelledBecauseOfOverlap",{lng:H.getState().language})),!1;break}case z.Roof:{const o=me.checkElementOnRoofState(e,n);if(o===ma.OutsideBoundary)return po(Y.t("message.MoveOutsideBoundaryCancelled",{lng:H.getState().language})),!1;if(o===ma.OverLap)return po(Y.t("message.MoveCancelledBecauseOfOverlap",{lng:H.getState().language})),!1;break}}return!0}static getRackCount(e,n,o,r,i){if(e===vr.portrait){const a=Math.max(1,Math.round(n/i)),l=Math.max(1,Math.round(o/r));return a*l}else{const a=Math.max(1,Math.round(n/r)),l=Math.max(1,Math.round(o/i));return a*l}}static setSelected(e,n){H.getState().set(o=>{var r;o.multiSelectionsMode||(n?(o.selectedElement=o.elements.find(i=>i.id===e)??null,o.selectedElementIdSet.clear(),o.selectedElementIdSet.add(e)):(((r=o.selectedElement)==null?void 0:r.id)===e&&(o.selectedElement=null),o.selectedElementIdSet.has(e)&&o.selectedElementIdSet.delete(e)))})}static getSurfaceType(e,n){return!n||!e||e===z.Foundation?Lp.Horizontal:e===z.Wall?Lp.Vertical:me.isEqual(n.z,1)?Lp.Horizontal:e===z.Cuboid?Lp.Vertical:Lp.Inclined}static findParentGroup(e,n){const o=e.parent;if(!o)return null;for(const r of n)if(o.name.includes(r))return o;return ea.findParentGroup(o,n)}static getRoofId(e){if(!e)return null;const n=e.userData.roofId;return n||ea.getRoofId(e.parent)}static getRoofSegmentData(e){if(!e)return null;const{roofId:n,foundation:o,centroid:r,roofSegments:i}=e.userData;return!n||!o||!r||!i?ea.getRoofSegmentData(e.parent):{roofId:n,foundation:o,centroid:r,roofSegments:i}}static getRelativeAzimuth(e){return e>Math.PI?e-Math.PI*2:e<-Math.PI?e+Math.PI*2:e}static isTrackerEnabled(e,n){return e===Lp.Horizontal&&n!==za.NO_TRACKER}static getUnitSize(e,n,o){return e===vr.landscape?{length:n,width:o}:{length:o,width:n}}static getRotationOnCuboid(e){const{x:n,y:o,z:r}=e;return me.isEqual(r,1)?[0,0,0]:me.isEqual(n,0)&&me.isEqual(o,1)?[Gt,0,Math.PI]:me.isEqual(n,0)&&me.isEqual(o,-1)?[Gt,0,0]:me.isEqual(n,-1)&&me.isEqual(o,0)?[Gt,0,-Gt]:me.isEqual(n,1)&&me.isEqual(o,0)?[Gt,0,Gt]:[0,0,0]}static getPVModel(e){const n=H.getState().pvModules[e];return n||(console.warn("pvModel undefined. Using default model: SPR-X21-335-BLK"),{name:"SPR-X21-335-BLK",brand:"SunPower",cellType:"Monocrystalline",efficiency:.21,length:1.558,nominalLength:1.56,width:1.046,nominalWidth:1.05,thickness:.046,m:12,n:8,pmax:335,vmpp:57.3,impp:5.85,voc:67.9,isc:6.23,pmaxTC:-.0029,noct:41.5,weight:18.6,color:"Black",shadeTolerance:"High",bifacialityFactor:0})}static addUndoable(e,n){if(e)switch(n){case Wa.Move:{ea.addUndoableMove(e);break}case Wa.ResizeX:case Wa.ResizeY:{ea.addUndoableResize(e);break}case Wa.RotateLower:case Wa.RotateUpper:{ea.addUndoableRotate(e);break}case Wa.Tilt:{ea.addUndoableTilt(e);break}}}static addUndoableMove(e){const n=H.getState().elements.find(i=>i.id===e.id&&i.type===z.SolarPanel);if(!n)return;const o={name:"Move",timestamp:Date.now(),movedElementId:n.id,movedElementType:n.type,oldCx:e.cx,oldCy:e.cy,oldCz:e.cz,newCx:n.cx,newCy:n.cy,newCz:n.cz,oldParentType:e.parentType,newParentType:n.parentType,oldParentId:e.parentId,newParentId:n.parentId,oldFoundationId:e.foundationId,newFoundationId:n.foundationId,oldNormal:new ie().fromArray(e.normal),newNormal:new ie().fromArray(n.normal),oldRotation:[...e.rotation],newRotation:[...n.rotation],undo(){r(this.movedElementId,[this.oldCx,this.oldCy,this.oldCz],this.oldParentId,this.oldFoundationId,this.oldParentType,this.oldRotation,this.oldNormal)},redo(){r(this.movedElementId,[this.newCx,this.newCy,this.newCz],this.newParentId,this.newFoundationId,this.newParentType,this.newRotation,this.newNormal)}};H.getState().addUndoable(o);const r=(i,a,l,s,c,u,d)=>{H.getState().set(f=>{const p=f.elements.find(g=>g.id===i);!p||p.type!==z.SolarPanel||([p.cx,p.cy,p.cz]=[...a],l&&(p.parentId=l),s&&(p.foundationId=s),c&&(p.parentType=c),u&&(p.rotation=[...u]),d&&(p.normal=[d.x,d.y,d.z]))})}}static addUndoableResize(e){const n=H.getState().elements.find(r=>r.id===e.id&&r.type===z.SolarPanel);if(!n)return;const o={name:"Resize Solar Panel",timestamp:Date.now(),id:n.id,oldPos:[e.cx,e.cy,e.cz],oldDms:[e.lx,e.ly,e.lz],oldRot:[...e.rotation],oldNor:[...e.normal],newPos:[n.cx,n.cy,n.cz],newDms:[n.lx,n.ly,n.lz],newRot:[...n.rotation],newNor:[...n.normal],undo(){H.getState().set(r=>{for(const i of r.elements)if(i.id===o.id){[i.cx,i.cy,i.cz]=[...o.oldPos],[i.lx,i.ly,i.lz]=[...o.oldDms],i.normal=[...o.oldNor],i.rotation=[...o.oldRot];break}})},redo(){H.getState().set(r=>{for(const i of r.elements)if(i.id===o.id){[i.cx,i.cy,i.cz]=[...o.newPos],[i.lx,i.ly,i.lz]=[...o.newDms],i.normal=[...o.newNor],i.rotation=[...o.newRot];break}})}};H.getState().addUndoable(o)}static addUndoableRotate(e){const n=H.getState().elements.find(i=>i.id===e.id&&i.type===z.SolarPanel);if(!n)return;const o={name:"Set Solar Panel Relative Azimuth",timestamp:Date.now(),changedElementId:n.id,oldValue:e.relativeAzimuth,newValue:n.relativeAzimuth,changedElementType:z.SolarPanel,undo:()=>{r(o.oldValue)},redo:()=>{r(o.newValue)}};H.getState().addUndoable(o);const r=i=>{H.getState().set(a=>{const l=a.elements.find(s=>s.id===o.changedElementId&&s.type===z.SolarPanel);l&&(l.relativeAzimuth=i)})}}static addUndoableTilt(e){const n=H.getState().elements.find(i=>i.id===e.id&&i.type===z.SolarPanel);if(!n)return;const o={name:"Set Solar Panel Tilt",timestamp:Date.now(),changedElementId:n.id,oldValue:e.tiltAngle,newValue:n.tiltAngle,changedElementType:z.SolarPanel,undo:()=>{r(o.oldValue)},redo:()=>{r(o.newValue)}};H.getState().addUndoable(o);const r=i=>{H.getState().set(a=>{const l=a.elements.find(s=>s.id===o.changedElementId&&s.type===z.SolarPanel);l&&(l.tiltAngle=i)})}}}const vZt=t=>{const{id:e,cx:n,cy:o,lx:r=1,ly:i=1,lz:a=1,color:l="silver",lineColor:s="black",lineWidth:c=.1,locked:u=!1,showLabel:d=!1,textureTypes:f=[Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture],stackable:p,transparency:g}=t,y=Es(e),w=H(fn),b=H(s0),C=H(Id),P=H(Gn),v=H(Cb),T=H(Nge),A=H(yp),x=H(u3),S=H(Iw),R=H(c3),M=H(Fge),D=H(Ewt),E=H(Y0),W=H(Jq),j=H(t5),L=H(Ds),k=H(En),N=H(Oge),F=H(zw),U=H(aYe),O=H(Ege),B=ht(Ss),_=H(Cf),X=Tn(u1),$=H(hA),{camera:Q,gl:{domElement:le},raycaster:q,mouse:te}=oi(),[re,ae]=m.useState(null),[se,ne]=m.useState(null),[fe,ge]=m.useState(null),[de,Z]=m.useState(null),[he,xe]=m.useState(null),[He,Se]=m.useState(!1),[ze,Ie]=m.useState(!1),ye=m.useRef(null),ce=m.useRef(null),pe=m.useRef(null),ve=m.useRef(Io),[Ae,Te]=m.useState(new ie(0,0,0)),Me=m.useRef(new nn(0,0,0)),Pe=m.useRef(new ie(1,1,1)),Ee=m.useRef(new ie),Be=m.useRef(new ie),Je=m.useRef(new ie),We=m.useRef(new ie),Ke=m.useRef(new ie(1,1,1)),Ne=m.useRef(new ie(1,1,1)),De=m.useRef(0),ke=m.useRef(0),Ye=m.useRef([]),it=m.useRef([]),Ve=m.useRef(null),yt=m.useRef(new ie),ct=m.useRef(0),Xe=m.useMemo(()=>({lng:b}),[b]),ut=r/2,ft=i/2,ot=a/2,st=m.useMemo(()=>new ie,[]),at=m.useMemo(()=>(t!=null&&t.label?t.label:Y.t("shared.CuboidElement",Xe))+(t!=null&&t.locked?" ("+Y.t("shared.ElementLocked",Xe)+")":"")+(t!=null&&t.label?"":` +`+Y.t("word.Coordinates",Xe)+": ("+n.toFixed(1)+", "+o.toFixed(1)+", "+(a/2).toFixed(1)+") "+Y.t("word.MeterAbbreviation",Xe)),[t==null?void 0:t.label,t==null?void 0:t.locked,Xe,n,o,a]);m.useEffect(()=>{const wn=()=>{pe.current=null,Ie(!1),Fn.getState().setEnableOrbitController(!0)};return window.addEventListener("pointerup",wn),()=>{window.removeEventListener("pointerup",wn)}},[]),m.useEffect(()=>{H.getState().tempHumanPlant.length>0&&w(wn=>{wn.elements.push(...wn.tempHumanPlant),wn.tempHumanPlant=[]})},[]),m.useEffect(()=>{if(t&&B){const wn=_??5,In=X(t.id+"-top");In&&ae(me.fetchHeatmapTexture(In,wn));const ar=X(t.id+"-south");ar&&ne(me.fetchHeatmapTexture(ar,wn));const No=X(t.id+"-north");No&&ge(me.fetchHeatmapTexture(No,wn));const eo=X(t.id+"-west");eo&&Z(me.fetchHeatmapTexture(eo,wn));const Xn=X(t.id+"-east");Xn&&xe(me.fetchHeatmapTexture(Xn,wn,!0))}},[B,_]);const Oe=wn=>{switch(wn){case Co.Facade01:return sZt;case Co.Facade02:return cZt;case Co.Facade03:return uZt;case Co.Facade04:return dZt;case Co.Facade05:return fZt;case Co.Facade06:return hZt;case Co.Facade07:return pZt;case Co.Facade08:return gZt;case Co.Facade09:return mZt;case Co.Facade10:return yZt;default:return ig}},Ze=wn=>{switch(wn){case Co.Facade01:return{x:14,y:6.5};case Co.Facade02:return{x:14,y:6.5};case Co.Facade03:return{x:10,y:12};case Co.Facade04:return{x:20,y:11};case Co.Facade05:return{x:15,y:10};case Co.Facade06:return{x:11,y:3.5};case Co.Facade07:return{x:11,y:10};case Co.Facade08:return{x:16,y:9};case Co.Facade09:return{x:10,y:9};case Co.Facade10:return{x:12,y:9};default:return{x:1,y:1}}},St=m.useMemo(()=>new df().load(f?Oe(f[0]):ig,wn=>{const In=Ze(f[0]);wn.repeat.set(i/In.x,a/In.y),wn.rotation=Gt,wn.center.x=1,wn.center.y=0,wn.wrapS=wn.wrapT=Hs,Rt(wn)}),[f[0],i,a]),[Pt,Rt]=m.useState(St),Ut=m.useMemo(()=>new df().load(f?Oe(f[1]):ig,wn=>{const In=Ze(f[1]);wn.repeat.set(i/In.x,a/In.y),wn.rotation=-Gt,wn.wrapS=wn.wrapT=Hs,At(wn)}),[f[1],i,a]),[Ht,At]=m.useState(Ut),kt=m.useMemo(()=>new df().load(f?Oe(f[2]):ig,wn=>{const In=Ze(f[2]);wn.repeat.set(r/In.x,a/In.y),wn.rotation=Math.PI,wn.center.x=0,wn.center.y=1,wn.wrapS=wn.wrapT=Hs,dt(wn)}),[f[2],r,a]),[gt,dt]=m.useState(kt),Ct=m.useMemo(()=>new df().load(f?Oe(f[3]):ig,wn=>{const In=Ze(f[3]);wn.repeat.set(r/In.x,a/In.y),wn.wrapS=wn.wrapT=Hs,Fe(wn)}),[f[3],r,a]),[tt,Fe]=m.useState(Ct),qe=m.useMemo(()=>new df().load(f?Oe(f[4]):ig,wn=>{const In=Ze(f[4]);wn.repeat.set(r/In.x,i/In.y),wn.wrapS=wn.wrapT=Hs,rt(wn)}),[f[4],r,i]),[je,rt]=m.useState(qe);m.useEffect(()=>{np()},[f]);const mt=wn=>{switch(wn){case z.Polygon:case z.Sensor:case z.Light:case z.SolarPanel:return!0}return!1},Qe=wn=>{switch(wn){case z.Polygon:case z.Sensor:case z.Light:case z.SolarPanel:case z.Human:case z.Tree:case z.Flower:return!0}return!1},Tt=wn=>{ve.current=wn;const In=.01;me.isSame(ve.current,Io)?(Te(new ie(0,0,ot+In)),Me.current=new nn(0,0,0),Pe.current.set(ut,ft,ot)):me.isSame(ve.current,Op)?(Te(new ie(ut+In,0,0)),Me.current=new nn(0,Gt,0),Pe.current.set(ot,ft,ut)):me.isSame(ve.current,_p)?(Te(new ie(-ut-In,0,0)),Me.current=new nn(0,-Gt,0),Pe.current.set(ot,ft,ut)):me.isSame(ve.current,Vp)?(Te(new ie(0,-ft-In,0)),Me.current=new nn(Gt,0,0),Pe.current.set(ut,ot,ft)):me.isSame(ve.current,Oc)&&(Te(new ie(0,ft+In,0)),Me.current=new nn(-Gt,0,0),Pe.current.set(ut,ot,ft))},Dt=Math.max(1,Math.max(r,i)/8),lt=c1*Dt,zt=wn=>{var No,eo;const In=wn.intersections[0];if(H.getState().objectTypeToAdd===z.SolarPanel){const Xn=In.point,{pos:Jo,rot:xo}=me.getWorldDataById(e),Qo=new ie().subVectors(Xn,Jo).applyEuler(new nn(0,0,-xo)),jo=((No=In.face)==null?void 0:No.normal)??new ie(0,0,1),lr=Ga.makeSolarPanel(t,H.getState().getPvModule(H.getState().actionState.solarPanelModelName??"SPR-X21-335-BLK"),Qo.x,Qo.y,Qo.z,H.getState().actionState.solarPanelOrientation??vr.landscape,H.getState().actionState.solarPanelPoleHeight??1,H.getState().actionState.solarPanelPoleSpacing??3,H.getState().actionState.solarPanelTiltAngle??0,H.getState().actionState.solarPanelRelativeAzimuth??0,jo,ea.getRotationOnCuboid(jo),H.getState().actionState.solarPanelFrameColor??"white");return w(fr=>{fr.elements.push(lr)}),lr}else return T(t,In.point,(eo=In.face)==null?void 0:eo.normal)},Ft=wn=>{if(wn.button===2)return;N()||E(e,wn,Oo.Select);const In=v();let ar=!1;if(wn.intersections[0].object.name===z.Polygon&&H.getState().objectTypeToAdd!==z.None&&(ar=!0),(In==null?void 0:In.id)===e||ar)if(Qe(H.getState().objectTypeToAdd)&&t){Ie(!0);const No=zt(wn);if(No){const eo={name:"Add",timestamp:Date.now(),addedElement:No,undo:()=>{A(eo.addedElement.id,!1)},redo:()=>{w(Xn=>{Xn.elements.push(eo.addedElement),Xn.selectedElement=eo.addedElement})}};k(eo),w(Xn=>{Xn.objectTypeToAdd=z.None})}}else Fn.getState().selectNone(),Fn.setState({cuboidRef:ye});else if(In&&In.parentId===e&&mt(In.type)){Ie(!0);const{rot:No,pos:eo}=me.getWorldDataById(e);yt.current.copy(eo),ct.current=No,pe.current=In;let Xn;for(const Jo of wn.intersections)if(Jo.object===ce.current){Xn=Jo.face;break}switch(Xn&&Tt(Xn.normal),Fn.getState().setEnableOrbitController(!1),Ee.current.x=In.cx,Ee.current.y=In.cy,Ee.current.z=In.cz,Je.current.fromArray(In.normal),Ke.current.x=In.lx,Ke.current.y=In.ly,Ke.current.z=In.lz,In.type){case z.SolarPanel:De.current=In.relativeAzimuth,ht.getState().setPrimitiveStore("oldParentId",e),ht.getState().setPrimitiveStore("oldFoundationId",e);break;case z.Polygon:Ye.current=In.vertices.map(Jo=>({...Jo}));break}}},_t=wn=>{var xo,Qo;if(!ce.current)return;const In=q.intersectObjects([ce.current]);if(In.length===0)return;const ar=In[0].face;if(!ar)return;const No=Eu.getIntersectionObjects(wn);if(No.length===0||No[0].eventObject.userData.id!==e){Wo(!1),pe.current=null;return}const eo=H.getState().selectedElement;if(!!(eo&&!eo.locked&&eo.type===z.SolarPanel&&H.getState().moveHandleType)&&(pe.current=eo),ar.normal.z===1&&((xo=pe.current)==null?void 0:xo.type)!==z.Polygon){const jo=!!(((Qo=pe.current)==null?void 0:Qo.type)===z.SolarPanel&&(H.getState().moveHandleType||H.getState().rotateHandleType||H.getState().resizeHandleType)&&!pe.current.locked);Wo(jo),jo&&(st.set(0,0,pe.current.poleHeight+a/2),Tt(new ie(0,0,1)),Ie(!0));return}else if(Wo(!1),pe.current&&t&&!pe.current.locked){const jo=new Xt(wn.offsetX/le.clientWidth*2-1,1-wn.offsetY/le.clientHeight*2);q.setFromCamera(jo,Q);let lr=In[0].point;if(H.getState().moveHandleType){const fr=ar.normal;if(Tt(fr),lr=me.relativeCoordinates(lr.x,lr.y,lr.z,t),pe.current.type===z.Polygon){const ai=pe.current;if(H.getState().moveHandleType===Ho.Default){const hr=me.calculatePolygonCentroid(Ye.current),tr=new ie().fromArray(ai.normal);let xi,Eo;me.isSame(tr,Op)?(xi=-(hr.x+lr.z),Eo=lr.y-hr.y):me.isSame(tr,_p)?(xi=lr.z-hr.x,Eo=lr.y-hr.y):me.isSame(tr,Oc)?(xi=lr.x-hr.x,Eo=-(hr.y+lr.z)):me.isSame(tr,Vp)?(xi=lr.x-hr.x,Eo=lr.z-hr.y):(xi=lr.x-hr.x,Eo=lr.y-hr.y);const bi=Ye.current.map(hl=>({...hl}));bi.forEach(hl=>{hl.x+=xi,hl.y+=Eo}),F(ai.id,bi)}}else R(pe.current.id,lr.x,lr.y,lr.z),D(pe.current.id,fr.x,fr.y,fr.z),pe.current.parentId!==e&&H.getState().set(ai=>{const hr=ai.elements.find(tr=>{var xi;return tr.id===((xi=pe.current)==null?void 0:xi.id)&&tr.type===z.SolarPanel});hr&&(hr.parentId!==e||hr.foundationId!==e)&&(hr.parentId=e,hr.foundationId=e,hr.parentType=z.Cuboid,ai.selectedElement&&(ai.selectedElement.parentId=e,hr.color=ai.selectedElement.color))})}else if(H.getState().resizeHandleType)switch(pe.current.type){case z.SolarPanel:{const fr=pe.current;if(fr.normal[2]===1)break;const[ai,hr]=tQe(fr),tr=H.getState().resizeAnchor,xi=H.getState().resizeHandleType;if(xi===vt.Lower||xi===vt.Upper){const bi=Math.max(1,Math.round(Math.abs(lr.z-tr.z)/hr))*hr,hl=new ie(0,0,lr.z-tr.z).normalize().multiplyScalar(bi),nr=new ie().addVectors(tr,hl.clone().divideScalar(2));w(or=>{const Ai=or.elements.find(ka=>ka.id===fr.id);Ai&&(Ai.cz=(nr.z-yt.current.z)/a,Ai.ly=Math.abs(hl.z))})}else if(xi===vt.Left||xi===vt.Right){const Eo=new ie().subVectors(lr,tr).setZ(0),hl=Math.max(1,Math.round(Eo.length()/ai))*ai,nr=Eo.clone().normalize().multiplyScalar(hl),or=new ie().addVectors(tr,nr.clone().divideScalar(2)),Ai=new ie().subVectors(or,yt.current).applyEuler(new nn(0,0,-ct.current));w(ka=>{const wi=ka.elements.find(Fs=>Fs.id===fr.id);wi&&(Math.abs(Math.abs(wi.normal[1])-1)<.01?wi.cx=Ai.x/r:wi.cy=Ai.y/i,wi.lx=nr.length())})}break}case z.Polygon:{if(H.getState().resizeHandleType===vt.Default){let fr=new ie(lr.x-yt.current.x,lr.y-yt.current.y,0).applyEuler(new nn(0,0,-ct.current,"ZXY"));const ai=pe.current,hr=new ie().fromArray(ai.normal);let tr,xi;me.isSame(hr,Op)?(tr=t.lz,xi=t.ly,fr.x=-lr.z+yt.current.z):me.isSame(hr,_p)?(tr=t.lz,xi=t.ly,fr.x=lr.z-yt.current.z):me.isSame(hr,Oc)?(tr=t.lx,xi=t.lz,fr.y=-lr.z+yt.current.z):me.isSame(hr,Vp)?(tr=t.lx,xi=t.lz,fr.y=lr.z-yt.current.z):(tr=t.lx,xi=t.ly),fr=H.getState().enableFineGrid?me.snapToFineGrid(fr):me.snapToNormalGrid(fr),fr.x/=tr,fr.y/=xi,U(ai.id,ai.selectedIndex,fr.x,fr.y)}break}}Ie(!0)}},tn=wn=>{if(Ve.current&&pe.current&&t){if(pe.current.type!==z.SolarPanel)return;const In=pe.current;if(In.locked)return;q.setFromCamera(te,Q);const ar=q.intersectObjects([Ve.current]);if(ar.length>0){let No=ar[0].point.clone();if(H.getState().moveHandleType)No=me.relativeCoordinates(No.x,No.y,No.z-In.poleHeight,t),R(In.id,No.x,No.y,No.z),D(pe.current.id,0,0,1),pe.current.parentId!==e&&H.getState().set(eo=>{const Xn=eo.elements.find(Jo=>{var xo;return Jo.id===((xo=pe.current)==null?void 0:xo.id)&&Jo.type===z.SolarPanel});Xn&&(Xn.parentId!==e||Xn.foundationId!==e)&&(Xn.parentId=e,Xn.foundationId=e,Xn.parentType=z.Cuboid,eo.selectedElement&&(eo.selectedElement.parentId=e,Xn.color=eo.selectedElement.color))});else if(H.getState().rotateHandleType&&H.getState().rotateHandleType!==Kr.Tilt){const eo=ct.current,Xn=new Xt(yt.current.x,yt.current.y),Jo=new Xt(t.lx*In.cx,t.ly*In.cy).rotateAround(si,eo),xo=new Xt().addVectors(Jo,Xn),Qo=-eo+Math.atan2(-No.x+xo.x,No.y-xo.y)+(H.getState().rotateHandleType===Kr.Lower?0:Math.PI),jo=Math.abs(Qo)>Math.PI?-Math.sign(Qo)*la:0,lr=Qo+jo;W(In.id,lr),ke.current=lr}else if(H.getState().resizeHandleType){const eo=H.getState().resizeAnchor,Xn=j(In.pvModelName),Jo=new Xt(No.x,No.y),xo=new Xt(eo.x,eo.y),Qo=Jo.distanceTo(xo),jo=In.relativeAzimuth+ct.current,lr=new Xt().subVectors(Jo,xo);switch(H.getState().resizeHandleType){case vt.Lower:case vt.Upper:{const fr=H.getState().resizeHandleType===vt.Lower?1:-1,ai=lr.angle()-jo+fr*Gt;let hr=Qo*Math.cos(ai);In.orientation===vr.portrait?hr=Math.max(1,Math.ceil((hr-Xn.length/2)/Xn.length))*Xn.length:hr=Math.max(1,Math.ceil((hr-Xn.width/2)/Xn.width))*Xn.width;const tr=eo.x+fr*(hr*Math.sin(jo))/2,xi=eo.y-fr*(hr*Math.cos(jo))/2,Eo=new Xt(tr,xi),bi=new Xt(yt.current.x,yt.current.y),hl=new Xt().subVectors(Eo,bi).rotateAround(si,-ct.current),nr=hl.x/r,or=hl.y/i;an(In,nr,or,In.lx,hr)&&(S(In.id,hr),R(In.id,nr,or));break}case vt.Left:case vt.Right:{const fr=H.getState().resizeHandleType===vt.Left?-1:1,ai=lr.angle()-jo+(H.getState().resizeHandleType===vt.Left?Math.PI:0);let hr=Qo*Math.cos(ai);In.orientation===vr.portrait?hr=Math.max(1,Math.ceil((hr-Xn.width/2)/Xn.width))*Xn.width:hr=Math.max(1,Math.ceil((hr-Xn.length/2)/Xn.length))*Xn.length;const tr=eo.x+fr*(hr*Math.cos(jo))/2,xi=eo.y+fr*(hr*Math.sin(jo))/2,Eo=new Xt(tr,xi),bi=new Xt(yt.current.x,yt.current.y),hl=new Xt().subVectors(Eo,bi).rotateAround(si,-ct.current),nr=hl.x/r,or=hl.y/i;an(In,nr,or,hr,In.ly)&&(x(In.id,hr),R(In.id,nr,or));break}}}}}},Qt=(wn,In,ar)=>{const No=JSON.parse(JSON.stringify(wn));return No.cx=In,No.cy=ar,O(No)?(po(Y.t("message.MoveCancelledBecauseOfOverlap",Xe)),!1):me.isIdentical(wn.normal,rs)&&!me.isSolarCollectorWithinHorizontalSurface(No,t)?(po(Y.t("message.MoveOutsideBoundaryCancelled",Xe)),!1):!0},gn=(wn,In)=>{const ar=JSON.parse(JSON.stringify(wn));return ar.relativeAzimuth=In,O(ar)?(po(Y.t("message.RotationCancelledBecauseOfOverlap",Xe)),!1):me.isSolarCollectorWithinHorizontalSurface(ar,t)?!0:(po(Y.t("message.RotationOutsideBoundaryCancelled",Xe)),!1)},an=(wn,In,ar,No,eo)=>{if(wn.tiltAngle!==0&&.5*eo*Math.abs(Math.sin(wn.tiltAngle))>wn.poleHeight)return!1;const Xn=JSON.parse(JSON.stringify(wn));return Xn.cx=In,Xn.cy=ar,Xn.lx=No,Xn.ly=eo,!!me.isSolarCollectorWithinHorizontalSurface(Xn,t)},mn=()=>{if(!pe.current)return;const wn=P(pe.current.id);if(wn){if(wn.type===z.Polygon){if(H.getState().moveHandleType||H.getState().resizeHandleType){it.current=wn.vertices.map(ar=>({...ar}));const In={name:H.getState().moveHandleType?"Move Polygon":"Resize Polygon",timestamp:Date.now(),oldValue:Ye.current,newValue:it.current,changedElementId:wn.id,changedElementType:wn.type,undo:()=>{F(In.changedElementId,In.oldValue)},redo:()=>{F(In.changedElementId,In.newValue)}};k(In)}}else if(H.getState().resizeHandleType){if(Be.current.x=wn.cx,Be.current.y=wn.cy,Be.current.z=wn.cz,Ne.current.x=wn.lx,Ne.current.y=wn.ly,Ne.current.z=wn.lz,Be.current.distanceToSquared(Ee.current)>It&&Ne.current.distanceToSquared(Ke.current)>It){const In={name:"Resize",timestamp:Date.now(),resizedElementId:pe.current.id,resizedElementType:pe.current.type,oldCx:Ee.current.x,oldCy:Ee.current.y,oldCz:Ee.current.z,newCx:Be.current.x,newCy:Be.current.y,newCz:Be.current.z,oldLx:Ke.current.x,oldLy:Ke.current.y,oldLz:Ke.current.z,newLx:Ne.current.x,newLy:Ne.current.y,newLz:Ne.current.z,undo:()=>{R(In.resizedElementId,In.oldCx,In.oldCy,In.oldCz),M(In.resizedElementId,In.oldLx,In.oldLy,In.oldLz)},redo:()=>{R(In.resizedElementId,In.newCx,In.newCy,In.newCz),M(In.resizedElementId,In.newLx,In.newLy,In.newLz)}};k(In)}}else if(H.getState().rotateHandleType){if(pe.current.type===z.SolarPanel){const In=pe.current;if(Math.abs(ke.current-De.current)>It)if(gn(In,ke.current)){w(No=>{No.selectedElementAngle=ke.current});const ar={name:"Rotate",timestamp:Date.now(),oldValue:De.current,newValue:ke.current,changedElementId:In.id,changedElementType:In.type,undo:()=>{W(ar.changedElementId,ar.oldValue)},redo:()=>{W(ar.changedElementId,ar.newValue)}};k(ar)}else W(In.id,De.current)}}else if(Be.current.x=wn.cx,Be.current.y=wn.cy,Be.current.z=wn.cz,We.current.fromArray(wn.normal),Be.current.distanceToSquared(Ee.current)>It){let In=!0;wn.type===z.SolarPanel&&(In=Qt(wn,wn.cx,wn.cy)),In?Eu.addUndoableMove():w(ar=>{const No=ar.elements.find(xo=>xo.id===wn.id);if(!No||!ar.selectedElement)return;const eo=ar.selectedElement;No.cx=eo.cx,No.cy=eo.cy,No.cz=eo.cz,No.rotation=[...eo.rotation],No.normal=[...eo.normal];const Xn=ht.getState().oldParentId,Jo=ht.getState().oldFoundationId;Xn&&(No.parentId=Xn),Jo&&(No.foundationId=Jo)})}pe.current=null}},Hn=wn=>{wn.intersections.length>0&&wn.intersections[0].object===ce.current&&Se(!0)},Fo=wn=>{pe.current&&me.isPlantOrHuman(pe.current)&&wn.intersections[0].object===ce.current&&Ie(!0)},yo=()=>{Se(!1),Ie(!1)},So=wn=>{E(e,wn,Oo.ContextMenu),w(In=>{In.pastePoint.copy(wn.intersections[0].point);const ar=wn.intersections[0].face;ar&&(In.pasteNormal=ar.normal.clone(),me.isSame(ar.normal,Op)?In.selectedSideIndex=0:me.isSame(ar.normal,_p)?In.selectedSideIndex=1:me.isSame(ar.normal,Oc)?In.selectedSideIndex=2:me.isSame(ar.normal,Vp)?In.selectedSideIndex=3:me.isSame(ar.normal,Io)&&(In.selectedSideIndex=4)),In.clickObjectType=z.Cuboid,wn.intersections.length>0&&wn.intersections[0].object===ce.current&&(In.contextMenuObjectType=z.Cuboid)})},{transparent:$o,opacity:mo}=QH(g!==void 0&&g>0,1-(g??0));m.useEffect(()=>{if(ce.current)for(let wn=0;wn<6;wn++)ce.current.material[wn].needsUpdate=!0},[$o]);const Jn=[0,1,2,3,4,5],uo=[B&&he?he:Pt,B&&de?de:Ht,B&&fe?fe:gt,B&&se?se:tt,B&&re?re:je,null],ir=t&&t.faceColors?Jn.map(wn=>f&&f[wn]!==Co.NoTexture?B?h.jsx("meshBasicMaterial",{side:Ra,attach:`material-${wn}`,color:"white",map:uo[wn],transparent:$o,opacity:mo},wn):h.jsx("meshStandardMaterial",{side:Ra,attach:`material-${wn}`,color:"white",map:uo[wn],transparent:$o,opacity:mo},wn):B?h.jsx("meshBasicMaterial",{side:Ra,attach:`material-${wn}`,color:"white",map:uo[wn],transparent:$o,opacity:mo},wn):h.jsx("meshStandardMaterial",{side:Ra,attach:`material-${wn}`,color:t.faceColors?t.faceColors[wn]:l,map:uo[wn],transparent:$o,opacity:mo},wn)):h.jsx("meshStandardMaterial",{side:Ra,color:l,transparent:$o,opacity:mo}),Rr=m.useMemo(()=>[ut,ft,ot],[ut,ft,ot]),br=y&&!u,[Vr,Wo]=m.useState(!1);return h.jsxs("group",{ref:ye,name:"Cuboid Group "+e,children:[h.jsx(Qr,{castShadow:L,receiveShadow:L,userData:{simulation:!0,stand:!0,stackable:p,id:e,aabb:!0},uuid:e,ref:ce,args:[r,i,a],name:"Cuboid "+e,onContextMenu:So,onPointerDown:Ft,onPointerMove:_t,onPointerUp:mn,onPointerOver:Hn,onPointerOut:yo,onPointerEnter:Fo,children:ir}),Vr&&h.jsx(ua,{ref:Ve,name:"Intersection Plane",position:st,args:[r,i],visible:!1,onPointerMove:tn}),ze&&h.jsxs(h.Fragment,{children:[(H.getState().moveHandleType||H.getState().resizeHandleType)&&h.jsx(Xge,{hx:Pe.current.x,hy:Pe.current.y,hz:Pe.current.z,position:Ae,rotation:Me.current}),H.getState().rotateHandleType&&pe.current&&pe.current.type===z.SolarPanel&&h.jsx(Uye,{element:pe.current,height:pe.current.poleHeight+ot})]}),y&&h.jsx(jye,{element:t,verticalLift:lt}),(g||!y||$)&&h.jsx(fw,{hx:ut,hy:ft,hz:ot,lineColor:g||$&&C?"white":s,lineWidth:g?c*15:$&&C?c*5:c}),y&&u&&h.jsx(fw,{hx:ut,hy:ft,hz:ot,lineColor:y0,lineWidth:c*5}),br&&h.jsx(wZt,{id:e,args:Rr}),(He||d)&&!y&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",text:at,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,fontFace:"Roboto",textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,ot+((t==null?void 0:t.labelHeight)??.2)]})]})},xZt=be.memo(vZt),nC=t=>{const[e,n]=m.useState(t);return m.useEffect(()=>{t!==e&&n(t)},[t]),[e,n]},MQ=(t,e)=>{const{gl:n}=oi(),[o,r]=m.useState(t),i=m.useRef(!1),a=m.useRef(!1);return m.useEffect(()=>{const u=()=>{i.current&&(i.current=!1,a.current||(r(t),n.domElement.style.cursor="default"))};return window.addEventListener("pointerup",u),()=>window.removeEventListener("pointerup",u)},[]),{_color:o,_onPointerDown:()=>{i.current=!0,setTimeout(()=>{n.domElement.style.cursor=e},10)},_onPointerMove:u=>{u.intersections.length==0||u.intersections[0].object!==u.object?(a.current=!1,r(t),n.domElement.style.cursor="default"):(a.current=!0,r(ta),n.domElement.style.cursor=e)},_onPointerLeave:()=>{a.current=!1,i.current||(r(t),n.domElement.style.cursor="default")}}},bZt=(t,e)=>{const[n,o]=m.useState(t),[r,i]=m.useState(e);return m.useEffect(()=>{o(t),i(e)},[t,e]),{materialLx:n,materialLy:r,setMaterialSize:(l,s)=>{l===Wa.ResizeX?s!==n&&o(Math.abs(s)):s!==r&&i(Math.abs(s))}}},v$e=t=>{const e=ht(Ss),n=H(Cf),[o,r]=m.useState(null);return m.useEffect(()=>{if(e){const i=Tn.getState().getHeatmap(t);i&&r(me.fetchHeatmapTexture(i,n??5))}},[e,n]),o},x$e=(t,e,n,o,r,i)=>{const a=r??((n==null?void 0:n.color)==="Black"&&(n==null?void 0:n.cellType)==="Monocrystalline"?"silver":"white"),l=i??"gray",s=m.useMemo(()=>{if(!n)return null;const{cellType:d,length:f,width:p,m:g,n:y,color:w}=n;return o===vr.portrait?DSe(d,p,f,y,g,w,a,l):DSe(d,f,p,g,y,w,a,l)},[n,o,a,l]),[c,u]=m.useState(s);return m.useEffect(()=>{if(s&&n){const{length:d,width:f}=n,p=Math.max(1,Math.round(t/(o===vr.landscape?d:f))),g=Math.max(1,Math.round(e/(o===vr.landscape?f:d)));s.repeat.set(p,g),s.wrapS=s.wrapT=Hs,u(s.clone())}},[s,t,e]),c},DSe=(t,e,n,o,r,i,a,l)=>{e*=owe,n*=owe;const s=document.createElement("canvas");[s.width,s.height]=[e,n];const c=s.getContext("2d");if(c){c.fillStyle=a,c.fillRect(0,0,e,n);const u=Math.max(e,n)*tAt;if(c.fillStyle=l,c.fillRect(u,u,e-2*u,n-2*u),c.fillStyle=i==="Black"?oAt:rAt,t==="Thin Film"){const d=u*.6;c.fillRect(d,d,e-d*2,n-d*2)}else{const d=Math.max(e,n)*nAt,f=u+d,p=(e-f*2-d*(o-1))/o,g=(n-f*2-d*(r-1))/r,y=p*.1,w=g*.1;if(t==="Monocrystalline")for(let b=0;b{const{id:e,parentId:n,cx:o,cy:r,cz:i,lx:a,ly:l,lz:s,normal:c,locked:u,trackerType:d,tiltAngle:f,relativeAzimuth:p,poleHeight:g,poleRadius:y,poleSpacing:w,color:b="white"}=t,C=Es(e),P=b$e(c),v=l/2,T=P?g:0,A=Math.max(1,(a+l)/16),x=A*2/3,S=A*2/3,R=-g/2-s/2,M=H(fn),D=H(lYe),E=H(En),W=H(rl),j=H(Tc),{gl:{domElement:L},camera:k,raycaster:N,mouse:F}=oi(),[U,O]=m.useState(null),[B,_]=m.useState(!1),X=m.useRef(!1),$=m.useRef(0),Q=m.useRef(0),le=m.useRef(null),q=m.useRef(null),te=m.useMemo(()=>new Array(13).fill(0),[]),re=m.useMemo(()=>new Date(W),[W]),ae=m.useMemo(()=>{const He=[],Se=Math.floor(.5*a/w),ze=Math.floor(.5*l*Math.abs(Math.cos(f))/w),Ie=.5*Math.sin(f),ye=Math.cos(p)*w,ce=Math.sin(p)*w;for(let pe=-Se;pe<=Se;pe++)for(let ve=-ze;ve<=ze;ve++){const Ae=pe*ye-ve*ce,Te=pe*ce+ve*ye;He.push(new ie(Ae,Te,R+Ie*w*ve))}return He},[p,f,w,a,l,R]),se=m.useMemo(()=>Oye(c),[c]),ne=m.useMemo(()=>{if(P){if(d===za.NO_TRACKER)return new nn(f,0,p,"ZXY");const He=Ei(re,j),Se=S$e(n,se.z)-se.z;switch(d){case za.ALTAZIMUTH_DUAL_AXIS_TRACKER:const ze=Math.hypot(He.x,He.y);return new nn(Math.atan2(ze,He.z),0,Math.atan2(He.y,He.x)+Gt-Se,"ZXY");case za.HORIZONTAL_SINGLE_AXIS_TRACKER:return new nn(0,Math.atan2(He.x,He.z),-Se+(a.1,de=T>0&&P;m.useEffect(()=>{const He=()=>{Fn.getState().setEnableOrbitController(!0),X.current=!1,_(!1),(H.getState().rotateHandleType||H.getState().moveHandleType||H.getState().resizeHandleType)&&M(Se=>{Se.rotateHandleType=null,Se.moveHandleType=null,Se.resizeHandleType=null})};return window.addEventListener("pointerup",He),()=>{window.removeEventListener("pointerup",He)}},[]);const Z=(He,Se)=>{He.intersections.length>0&&He.intersections[0].object===He.eventObject&&(O(Se),Se===Ho.Top?L.style.cursor="move":Se===Kr.Lower||Se===Kr.Upper||Se===Kr.Tilt?L.style.cursor="grab":L.style.cursor="pointer")},he=()=>{O(null),L.style.cursor="default"},xe=He=>U===He||H.getState().rotateHandleType===He?ta:Da;return h.jsxs("group",{name:"Solar Panel Group",position:[o,r,T+i],rotation:se,children:[h.jsx(TZt,{solarPanelModel:t,groupRotation:se,panelRotation:ne}),fe&&h.jsxs("group",{position:[0,0,-T],rotation:[0,0,ne.z],children:[h.jsx(PR,{id:e,position:[0,-v-x/2,T],color:xe(Kr.Upper),ratio:x,handleType:Kr.Upper,hoverHandle:Z,noHoverHandle:he}),h.jsx(PR,{id:e,position:[0,v+x/2,T],color:xe(Kr.Lower),ratio:x,handleType:Kr.Lower,hoverHandle:Z,noHoverHandle:he})]}),ge&&h.jsxs(h.Fragment,{children:[h.jsx(sR,{name:Kr.Tilt,args:[S,1.1*S,18,2,-Gt,Math.PI],rotation:[0,-Gt,ne.z,"ZXY"],onPointerOver:He=>{Z(He,Kr.Tilt)},onPointerOut:He=>{he()},onPointerDown:He=>{if(_(!0),U){Fn.getState().setEnableOrbitController(!1),X.current=!0,$.current=f;const{rot:Se}=me.getWorldDataById(n);le.current=Se}M(Se=>{Se.rotateHandleType=Kr.Tilt})},children:h.jsx("meshBasicMaterial",{attach:"material",side:$r,color:U===Kr.Tilt||B?ta:Da})}),B&&h.jsxs(h.Fragment,{children:[h.jsx(sR,{ref:q,name:"Solar panel tilt handle",args:[S,2*S,18,2,-Gt,Math.PI],rotation:[0,-Gt,ne.z,"ZXY"],onPointerUp:He=>{if(Math.abs(Q.current-$.current)>It){const Se={name:"Set Solar Panel Tilt Angle",timestamp:Date.now(),oldValue:$.current,newValue:Q.current,changedElementId:e,changedElementType:z.SolarPanel,undo:()=>{D(Se.changedElementId,Se.oldValue)},redo:()=>{D(Se.changedElementId,Se.newValue)}};E(Se)}},onPointerMove:He=>{if(X.current&&(N.setFromCamera(F,k),q.current)){const Se=N.intersectObjects([q.current]);if(Se.length>0){const ze=Se[0].point,Ie=q.current.parent;if(Ie){const ye=Ie.localToWorld(new ie),ce=new ie().subVectors(ze,ye);let pe=ce.angleTo(Io);if(!(.5*l*Math.abs(Math.sin(pe))>T)){const Ae=p+(le.current??0),Te=Ae%Math.PI===0?Math.sign(-ce.y)*Math.sign(Math.cos(Ae)):Math.sign(ce.x)*Math.sign(Math.sin(Ae));pe*=Te,D(e,pe),Q.current=pe}}}}},children:h.jsx("meshBasicMaterial",{attach:"material",depthTest:!1,transparent:!0,opacity:.5,side:$r})}),h.jsx(jn,{points:[[0,0,S],[0,0,1.75*S]],rotation:new nn(f,0,ne.z,"ZXY"),lineWidth:1}),te.map((He,Se)=>h.jsxs("group",{rotation:new nn(Math.PI/12*Se-Gt,0,ne.z,"ZXY"),children:[h.jsx(jn,{points:[[0,0,1.8*S],[0,0,2*S]],color:"white",transparent:!0,opacity:.5}),h.jsx("textSprite",{userData:{unintersectable:!0},text:`${Se*15-90}°`,fontSize:20*S,fontFace:"Times Roman",textHeight:.15*S,position:[0,0,1.6*S]})]},Se)),h.jsx("group",{rotation:new nn(f,0,ne.z,"ZXY"),children:h.jsx("textSprite",{userData:{unintersectable:!0},text:`${Math.floor(f/Math.PI*180)}°`,fontSize:20*S,fontFace:"Times Roman",textHeight:.2*S,position:[0,0,.75*S]})})]})]}),de&&ae.map((He,Se)=>h.jsx(ca,{userData:{unintersectable:!0},name:"Pole "+Se,castShadow:!1,receiveShadow:!1,args:[y,y,g+(He.z-R)*2+s,4,1],position:He,rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:b})},Se))]})},TZt=({solarPanelModel:t,groupRotation:e,panelRotation:n})=>{let{id:o,parentId:r,lx:i,ly:a,lz:l,cx:s,cy:c,cz:u,normal:d,tiltAngle:f,relativeAzimuth:p,trackerType:g,drawSunBeam:y,locked:w,showLabel:b,label:C,pvModelName:P,orientation:v,frameColor:T,backsheetColor:A,color:x,poleHeight:S}=t;const R=Es(o),M=H(fn),D=H(Y0),E=H(rl),W=H(Tc),j=H(d1),L=H(s0),k=ht(Ss),N=H(fW),F=H(gBe),U=H(Id)??!1,O=m.useMemo(()=>({lng:L}),[L]),B=b$e(d),_=B?f:0,X=B?p:0,$=Math.max(1,(i+a)/16),Q=Vx*$*1.5,le=c1*$*2,[q,te,re]=[i,a,l].map(Je=>Je/2),ae=[Q,Q,l*1.2],se=N[P];se&&(l=Math.max(se.thickness,.02));const ne=m.useMemo(()=>new Date(E),[E]),fe=m.useMemo(()=>(C||Y.t("shared.SolarPanelElement",O))+(w?" ("+Y.t("shared.ElementLocked",O)+")":"")+(C?"":` +`+Y.t("word.Coordinates",O)+": ("+s.toFixed(1)+", "+c.toFixed(1)+", "+u.toFixed(1)+") "+Y.t("word.MeterAbbreviation",O)),[C,w,O,s,c,u]),ge=m.useMemo(()=>{const Je=[];if(se){let We,Ke;v===vr.portrait?(We=Math.max(1,Math.round(i/se.width)),Ke=Math.max(1,Math.round(a/se.length))):(We=Math.max(1,Math.round(i/se.length)),Ke=Math.max(1,Math.round(a/se.width)));const Ne=i/We,De=a/Ke;for(let ke=0;ke<=We;ke++)Je.push({points:[new ie(-q+ke*Ne,-te,l),new ie(-q+ke*Ne,te,l)]});for(let ke=0;ke<=Ke;ke++)Je.push({points:[new ie(-q,-te+ke*De,l),new ie(q,-te+ke*De,l)]})}return Je},[se,v,P,i,a,l]),[de,Z]=m.useState(pe()),[he,xe]=m.useState(!1),[He,Se]=m.useState(null),ze=m.useRef(null),{gl:Ie}=oi(),ye=x$e(i,a,se,v,T,A),ce=v$e(o);ay(()=>{const Je=pe();Je.equals(de)||Z(Je)});function pe(){const Je=new nn,We=S$e(r,e.z);return g===za.NO_TRACKER?Je.set(-e.x-_,0,-We-X):Je.set(-e.x-n.x,-n.y,-We-n.z),Ei(ne,W).applyEuler(Je)}function ve(Je){return He===Je||j===Je?ta:Da}function Ae(Je){if(Je.intersections.length>0&&Je.eventObject.name.includes(Jie)){const Ke=Je.object.name;Se(Ke),Ke===Ho.Top?Ie.domElement.style.cursor="move":Ke===Kr.Lower||Ke===Kr.Upper||Ke===Kr.Tilt?Ie.domElement.style.cursor="grab":Ie.domElement.style.cursor="pointer"}}function Te(){Se(null),Ie.domElement.style.cursor="default"}function Me(Je,We){Fn.getState().setEnableOrbitController(!1),M(Ke=>{Ke.resizeHandleType=Je,Ke.resizeAnchor.copy(We)})}function Pe(Je){if(Je.intersections.length>0&&Je.intersections[0].eventObject.name===Jie){const We=Je.object.name;switch(We){case Ho.Default:{Fn.getState().setEnableOrbitController(!1),M(Ke=>{Ke.moveHandleType=We,Ke.selectedElement=Ke.elements.find(Ne=>{var De;return Ne.id===((De=Ke.selectedElement)==null?void 0:De.id)})});break}case vt.Left:{const Ke=Je.object.localToWorld(new ie(i,0,0));Me(We,Ke);break}case vt.Right:{const Ke=Je.object.localToWorld(new ie(-i,0,0));Me(We,Ke);break}case vt.Lower:{const Ke=Je.object.localToWorld(new ie(0,a,0));Me(We,Ke);break}case vt.Upper:{const Ke=Je.object.localToWorld(new ie(0,-a,0));Me(We,Ke);break}}}}function Ee(){return k&&ce?h.jsx("meshBasicMaterial",{attach:"material-4",map:ce}):ye?U||F===0?h.jsx("meshStandardMaterial",{attach:"material-4",map:ye,color:x}):h.jsx("meshPhongMaterial",{attach:"material-4",specular:new rr((se==null?void 0:se.color)==="Blue"?pG:gG),shininess:F??ew,side:Ra,map:ye,color:x}):h.jsx("meshStandardMaterial",{attach:"material-4",color:x})}function Be(){return(se==null?void 0:se.bifacialityFactor)===0||U||S===0&&f===0?h.jsx("meshStandardMaterial",{attach:"material-5",color:x}):ye?h.jsx("meshPhongMaterial",{attach:"material-5",specular:new rr((se==null?void 0:se.color)==="Blue"?pG:gG),shininess:F??ew,side:Ra,map:ye,color:x}):null}return h.jsxs(h.Fragment,{children:[h.jsxs("group",{name:"Solar Panel Box Group",rotation:n,children:[h.jsxs(Qr,{uuid:o,ref:ze,args:[i,a,l],position:[0,0,re],onPointerDown:Je=>{Je.button!==2&&D(o,Je,Oo.Select)},onContextMenu:Je=>{D(o,Je,Oo.ContextMenu),M(We=>{Je.intersections.length>0&&Je.intersections[0].object===ze.current&&(We.contextMenuObjectType=z.SolarPanel)})},onPointerOver:Je=>{Je.intersections.length>0&&Je.intersections[0].object===ze.current&&(xe(!0),Ie.domElement.style.cursor="move")},onPointerOut:Je=>{xe(!1),Ie.domElement.style.cursor="default"},children:[h.jsx("meshStandardMaterial",{attach:"material-0",color:"white"}),h.jsx("meshStandardMaterial",{attach:"material-1",color:"white"}),h.jsx("meshStandardMaterial",{attach:"material-2",color:"white"}),h.jsx("meshStandardMaterial",{attach:"material-3",color:"white"}),Ee(),Be()]}),R&&!w&&h.jsxs("group",{name:Jie,onPointerDown:Pe,onPointerOver:Ae,onPointerOut:Te,children:[h.jsx(ds,{args:[le,6,6],name:Ho.Default,children:h.jsx("meshBasicMaterial",{color:"orange"})}),h.jsx(Qr,{position:[0,-te,re],args:ae,name:vt.Lower,children:h.jsx("meshBasicMaterial",{color:ve(vt.Lower)})}),h.jsx(Qr,{position:[0,te,re],args:ae,name:vt.Upper,children:h.jsx("meshBasicMaterial",{color:ve(vt.Upper)})}),h.jsx(Qr,{position:[-q,0,re],args:ae,name:vt.Left,children:h.jsx("meshBasicMaterial",{color:ve(vt.Left)})}),h.jsx(Qr,{position:[q,0,re],args:ae,name:vt.Right,children:h.jsx("meshBasicMaterial",{color:ve(vt.Right)})})]}),y&&de.z>0&&h.jsx(PZt,{sunDirection:de}),k&&ce&&ge.map((Je,We)=>h.jsx(jn,{name:"Solar Panel Lines",userData:{unintersectable:!0},points:Je.points,castShadow:!1,receiveShadow:!1,lineWidth:.2,color:"black"},We)),h.jsx(ua,{name:"Solar Panel Simulation Plane",uuid:o,args:[i,a],userData:{simulation:!0},receiveShadow:!1,castShadow:!1,visible:!1,children:h.jsx("meshBasicMaterial",{side:$r})}),R&&w&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-q,-te,0],[-q,te,0],[q,te,0],[q,-te,0],[-q,-te,0]],castShadow:!1,receiveShadow:!1,lineWidth:2,color:y0})]}),(he||b)&&!R&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:fe,color:t.labelColor??"white",fontSize:t.labelFontSize??20,textHeight:t.labelSize??.2,position:[0,0,t.labelHeight??Math.max(te*Math.abs(Math.sin(f))+.1,.2)]})]})},PZt=be.memo(({sunDirection:t})=>{const e=H(Ug),n=m.useMemo(()=>Math.max(100,10*e),[e]);return h.jsxs("group",{name:"Sun Beam Group",children:[h.jsx(jn,{userData:{unintersectable:!0},points:[Io.clone().multiplyScalar(.75),[0,0,0],t.clone().multiplyScalar(n)],name:"Sun Beam",lineWidth:.5,color:"white"}),h.jsx(jn,{userData:{unintersectable:!0},points:[t.clone().multiplyScalar(.5),Io.clone().multiplyScalar(.5)],name:"Angle",lineWidth:.5,color:"white"}),h.jsx("textSprite",{userData:{unintersectable:!0},name:"Angle Value",text:me.toDegrees(t.angleTo(Io)).toFixed(1)+"°",fontSize:20,fontFace:"Times Roman",textHeight:.1,position:t.clone().multiplyScalar(.75).add(Io.clone().multiplyScalar(.75)).multiplyScalar(.5)}),h.jsx("group",{position:Io.clone().multiplyScalar(.75),rotation:[Gt,0,0],children:h.jsx(Rd,{userData:{unintersectable:!0},args:[.04,.2,4,2],name:"Normal Vector Arrow Head",children:h.jsx("meshBasicMaterial",{attach:"material",color:"white"})})})]})});function Oye(t){const[e,n,o]=t;return o===1?new nn(0,0,0):e!==0?new nn(Gt,0,e*Gt,"ZXY"):n!==0?new nn(-n*Gt,0,0):new nn}function b$e(t){return Math.abs(t[2]-1)<.01}function S$e(t,e){const{rot:n}=me.getWorldDataById(t);return n+e}be.memo(SZt);const T$e=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i=1,ly:a=1,lz:l=.1,rotation:s=[0,0,0],normal:c=[0,0,1],color:u="white",lineColor:d="black",lineWidth:f=.1,locked:p=!1,label:g,showLabel:y=!1,parentId:w,foundationId:b,light:C=!0,heatFlux:P=!1}=t,v=H(fn),T=H(Ds),A=H(Y0),x=Es(e),{gl:{domElement:S}}=oi(),[R,M]=m.useState(!1),D=m.useRef(null),E=m.useRef(null),W=Jt(),j=H(_=>{for(const X of _.elements)if(X.id===w)return X}),L=H(_=>{for(const X of _.elements)if(X.id===b)return X});let k=n,N=o,F=r;if(w&&j)switch(j.type){case z.Foundation:{if(F=j.cz+j.lz/2,me.isZero(s[2]))k=j.cx+n*j.lx,N=j.cy+o*j.ly;else{const _=new ie(n*j.lx,o*j.ly,0);_.applyAxisAngle(Io,s[2]),k=j.cx+_.x,N=j.cy+_.y}break}case z.Wall:{if((L==null?void 0:L.type)===z.Foundation){const _=me.absoluteCoordinates(n,o,r,j,L);k=_.x,N=_.y,F=_.z}break}case z.Roof:{if((L==null?void 0:L.type)===z.Foundation){const _=me.absoluteCoordinates(n,o,r,j,L);k=_.x,N=_.y,F=_.z}break}}const U=l/2,O=m.useMemo(()=>{if((j==null?void 0:j.type)===z.Wall){const X=j,$=L?L.rotation[2]+X.relativeAngle:X.relativeAngle;return new nn(Gt,0,$,"ZXY")}if((j==null?void 0:j.type)===z.Roof)return new nn(s[0],s[1],L?L.rotation[2]+s[2]:s[2],"ZXY");if((j==null?void 0:j.type)===z.Cuboid)return Oye(c);const _=new ie().fromArray(c);return me.isSame(_,Op)?new nn(0,Gt,s[2],"ZXY"):me.isSame(_,_p)?new nn(0,-Gt,s[2],"ZXY"):me.isSame(_,Oc)?new nn(-Gt,0,s[2],"ZXY"):me.isSame(_,Vp)?new nn(Gt,0,s[2],"ZXY"):new nn(0,0,s[2])},[c,s,L==null?void 0:L.rotation]),B=m.useMemo(()=>(g||Y.t("shared.SensorElement",W))+(p?" ("+Y.t("shared.ElementLocked",W)+")":"")+` +`+Y.t("word.Coordinates",W)+": ("+k.toFixed(1)+", "+N.toFixed(1)+", "+F.toFixed(1)+") "+Y.t("word.MeterAbbreviation",W),[g,p,W,k,N,F]);return h.jsxs("group",{name:"Sensor Group "+e,rotation:O,position:[k,N,F+U],children:[h.jsx(Qr,{receiveShadow:T,uuid:e,ref:D,args:[i,a,l],name:"Sensor",onPointerDown:_=>{_.button!==2&&(A(e,_,Oo.Move),Fn.getState().setEnableOrbitController(!1),ht.getState().set(X=>{X.showWallIntersectionPlaneId=w,X.oldParentId=w,X.oldFoundationId=b}),v(X=>{X.moveHandleType=Ho.Default}))},onContextMenu:_=>{A(e,_,Oo.ContextMenu),v(X=>{_.intersections.length>0&&_.intersections[0].object===D.current&&(X.contextMenuObjectType=z.Sensor)})},onPointerOver:_=>{_.intersections.length>0&&_.intersections[0].object===D.current&&(M(!0),S.style.cursor="move")},onPointerOut:()=>{M(!1),S.style.cursor="default"},children:h.jsx("meshStandardMaterial",{attach:"material",color:t!=null&&t.lit?ta:u})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Meter",castShadow:!1,receiveShadow:!1,args:[i*.3,a*.3,U,8,1],position:new ie(0,0,U),rotation:[Gt,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:"black"})}),!x&&h.jsx(fw,{hx:i/2,hy:a/2,hz:l/2,lineColor:d,lineWidth:f}),x&&p&&h.jsx(fw,{hx:i/2,hy:a/2,hz:l/2,lineColor:y0,lineWidth:f*10}),x&&!p&&h.jsx(ds,{ref:E,position:new ie(0,0,0),args:[c1,6,6,0,Math.PI],name:Ho.Default,onPointerDown:_=>{_.button===2?(A(e,_,Oo.ContextMenu),v(X=>{_.intersections.length>0&&_.intersections[0].object===E.current&&(X.contextMenuObjectType=z.Sensor)})):A(e,_,Oo.Move),Fn.getState().setEnableOrbitController(!1),ht.getState().set(X=>{X.showWallIntersectionPlaneId=w,X.oldParentId=w,X.oldFoundationId=b}),v(X=>{X.moveHandleType=Ho.Default})},children:h.jsx("meshBasicMaterial",{attach:"material",color:"orange"})}),(R||y)&&!x&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:B,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,l+((t==null?void 0:t.labelHeight)??.2)]})]})}),P$e=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i=1,ly:a=1,lz:l=.1,rotation:s=[0,0,0],normal:c=[0,0,1],color:u="#ffff99",lineWidth:d=.1,locked:f=!1,label:p,showLabel:g=!1,parentId:y,foundationId:w,decay:b=2,distance:C=5,intensity:P=3,inside:v=!1}=t,T=H(fn),A=H(Ds),x=H(Y0),R=H(Dw).z<=0,M=Es(e),{gl:{domElement:D}}=oi(),[E,W]=m.useState(!1),j=m.useRef(null),L=m.useRef(null),k=Jt(),N=H(le=>{for(const q of le.elements)if(q.id===y)return q}),F=H(le=>{for(const q of le.elements)if(q.id===w)return q});let U=.1,O=n,B=o,_=r;if(y&&N)switch(N.type){case z.Foundation:if(_=N.cz+N.lz/2,me.isZero(s[2]))O=N.cx+n*N.lx,B=N.cy+o*N.ly;else{const le=new ie(n*N.lx,o*N.ly,0);le.applyAxisAngle(Io,s[2]),O=N.cx+le.x,B=N.cy+le.y}break;case z.Wall:if((F==null?void 0:F.type)===z.Foundation){const le=me.absoluteCoordinates(n,o,r,N,F);O=le.x,B=le.y,_=le.z}U=N.ly;break;case z.Roof:if((F==null?void 0:F.type)===z.Foundation){const le=me.absoluteCoordinates(n,o,r,N,F);O=le.x,B=le.y,_=le.z}U=N.thickness;break}const X=l/2,$=m.useMemo(()=>{if((N==null?void 0:N.type)===z.Wall){const q=N,te=F?F.rotation[2]+q.relativeAngle:q.relativeAngle;return new nn(Gt,0,te,"ZXY")}if((N==null?void 0:N.type)===z.Roof)return new nn(s[0],s[1],F?F.rotation[2]+s[2]:s[2],"ZXY");if((N==null?void 0:N.type)===z.Cuboid)return Oye(c);const le=new ie().fromArray(c);return me.isSame(le,Op)?new nn(0,Gt,s[2],"ZXY"):me.isSame(le,_p)?new nn(0,-Gt,s[2],"ZXY"):me.isSame(le,Oc)?new nn(-Gt,0,s[2],"ZXY"):me.isSame(le,Vp)?new nn(Gt,0,s[2],"ZXY"):new nn(0,0,s[2])},[c,s,F,N]),Q=m.useMemo(()=>(p||Y.t("shared.LightElement",k))+(f?" ("+Y.t("shared.ElementLocked",k)+")":"")+` +`+Y.t("word.Coordinates",k)+": ("+O.toFixed(1)+", "+B.toFixed(1)+", "+_.toFixed(1)+") "+Y.t("word.MeterAbbreviation",k),[p,f,k,O,B,_]);return h.jsxs("group",{name:"Light Group "+e,rotation:$,position:[O,B,_],children:[R&&h.jsx("pointLight",{color:u,name:"Point Light "+e,position:[0,0,v?-U-X:X],decay:b*.2,distance:C,intensity:P,castShadow:!0}),h.jsx(ca,{receiveShadow:A,userData:{unintersectable:!0},uuid:e,ref:j,position:[0,0,v?-U:0],rotation:[Gt,0,0],args:[i*.5,a*.5,X,16,1],name:"Light Base",onPointerDown:le=>{le.button!==2&&(x(e,le,Oo.Move),Fn.getState().setEnableOrbitController(!1),ht.getState().set(q=>{q.showWallIntersectionPlaneId=y,q.oldParentId=y,q.oldFoundationId=w}))},onContextMenu:le=>{x(e,le,Oo.ContextMenu),T(q=>{le.intersections.length>0&&le.intersections[0].object===j.current&&(q.contextMenuObjectType=z.Light)})},onPointerOver:le=>{le.intersections.length>0&&le.intersections[0].object===j.current&&(W(!0),D.style.cursor="move")},onPointerOut:()=>{W(!1),D.style.cursor="default"},children:h.jsx("meshStandardMaterial",{attach:"material",color:"lightgray"})}),h.jsx(ds,{userData:{unintersectable:!0},name:"Light Bulb",castShadow:!1,receiveShadow:A,args:[i*.3,8,8,0,la,0,Math.PI],position:new ie(0,0,v?-U-X:X),rotation:[Gt,0,0],children:R?h.jsx("meshBasicMaterial",{attach:"material",color:"white"}):h.jsx("meshStandardMaterial",{attach:"material",color:"white"})}),M&&f&&h.jsx(fw,{hx:i/2,hy:a/2,hz:l/2,lineColor:y0,lineWidth:d*10}),M&&!f&&h.jsx(ds,{ref:L,position:new ie(0,0,v?-U-X:X),args:[c1,6,6,v?Math.PI:0,Math.PI],name:Ho.Default,onPointerDown:le=>{le.button===2?(x(e,le,Oo.ContextMenu),T(q=>{le.intersections.length>0&&le.intersections[0].object===L.current&&(q.contextMenuObjectType=z.Light)})):x(e,le,Oo.Move),Fn.getState().setEnableOrbitController(!1),ht.getState().set(q=>{q.showWallIntersectionPlaneId=y,q.oldParentId=y,q.oldFoundationId=w})},children:h.jsx("meshBasicMaterial",{attach:"material",color:"orange"})}),(E||g)&&!M&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:Q,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,(v?-U:0)+l+((t==null?void 0:t.labelHeight)??.2)]})]})}),Ov="Cuboid Wrapper",C$e="Cuboid Stackable Child",R$e=({elements:t,cuboidModel:e})=>{const{id:n,cx:o,cy:r,lx:i,ly:a,lz:l,rotation:s}=e,c=l/2,u=d=>w$e(d)&&d.parentId===n;return h.jsxs("group",{name:Ov,position:[o,r,c],rotation:[0,0,s[2]],userData:{id:n,fId:n},children:[h.jsx(xZt,{...e}),h.jsx(_ye,{parentId:n,foundationId:n,wrapperType:z.Cuboid,plx:i,ply:a,plz:l}),t.map(d=>{if(u(d))return h.jsx("group",{name:C$e,position:[0,0,c],children:h.jsx(R$e,{elements:t,cuboidModel:d})},d.id);if(d.parentId===n){const{lx:f,ly:p,lz:g}=e;switch(d.type){case z.Sensor:return h.jsx(T$e,{...d,cx:d.cx*f,cy:d.cy*p,cz:d.cz*g},d.id);case z.Light:return h.jsx(P$e,{...d,cx:d.cx*f,cy:d.cy*p,cz:d.cz*g},d.id);default:return null}}else return null})]})},sX=be.memo(({positionY:t,name:e,onPointerDown:n})=>{const o=a5(),{_color:r,_onPointerDown:i,_onPointerMove:a,_onPointerLeave:l}=MQ(Da,"grab"),s=c=>{n(c),i()};return h.jsxs("group",{name:e,position:[0,t,0],rotation:[Gt,0,0],scale:o*3,onPointerDown:s,onPointerMove:a,onPointerLeave:l,children:[h.jsx(mge,{args:[.15,.05,6,8,3/2*Math.PI],rotation:[Gt,0,Gt],children:h.jsx("meshBasicMaterial",{color:r})}),h.jsx(Rd,{args:[.1,.1,6],rotation:[Gt,0,0],position:[.15,0,.05],children:h.jsx("meshBasicMaterial",{color:r})}),h.jsx(lR,{args:[.05,6],rotation:[0,Gt,0],position:[0,0,.15],children:h.jsx("meshBasicMaterial",{color:r})}),h.jsx(ua,{args:[.35,.35],position:[0,.05,0],rotation:[-Gt,0,0],visible:!1})]})}),CZt=be.memo(m.forwardRef(({tiltAngle:t,positionZ:e,isOnVerticalSurface:n,onPointerDown:o,onPointerMove:r},i)=>{const a=a5()*3,l=Math.PI/12,s=m.useMemo(()=>n?Gt:Math.PI,[n]),c=m.useMemo(()=>n?new Array(7).fill(0):new Array(13).fill(0),[n]),u=m.useMemo(()=>n?e:0,[n,e]),[d,f]=m.useState(!1),p=m.useRef(null),g=m.useRef(null),y=m.useRef(null),{_color:w,_onPointerDown:b,_onPointerMove:C,_onPointerLeave:P}=MQ(Da,"grab");m.useImperativeHandle(i,()=>({setVisiable(x){p.current&&(p.current.visible=x)},update(x,S){g.current&&g.current.rotation.set(x,0,0),y.current&&(y.current.text=v(x)),p.current&&(p.current.position.z=S)}}),[]);const v=x=>{const S=n?-x:x;return`${Math.floor(S/Math.PI*180)}°`},T=x=>{f(!0),o(x),b()},A=x=>{r(x)};return m.useEffect(()=>{const x=()=>{f(!1)};return window.addEventListener("pointerup",x),()=>window.addEventListener("pointerup",x)},[]),h.jsxs("group",{name:"Tilt_Handle_Group",ref:p,position:[0,0,u],children:[h.jsx(sR,{name:Kr.Tilt,args:[a,1.125*a,18,2,0,s],rotation:[Gt,0,Gt,"ZXY"],onPointerDown:T,onPointerMove:C,onPointerLeave:P,children:h.jsx("meshBasicMaterial",{side:$r,color:w})}),d&&h.jsxs(h.Fragment,{children:[h.jsx(sR,{name:"Tilt_Handle_Intersection_Plane",args:[a,2*a,18,2,0,s],rotation:[Gt,0,Gt,"ZXY"],onPointerMove:A,children:h.jsx("meshBasicMaterial",{transparent:!0,depthTest:!1,opacity:.5,side:$r})}),h.jsx("group",{rotation:[-Gt,0,0],children:c.map((x,S)=>{const R=n?`${90-S*15}°`:`${S*15-90}°`;return h.jsxs("group",{rotation:[l*S,0,0,"ZXY"],children:[h.jsx(jn,{points:[[0,0,1.8*a],[0,0,2*a]],color:"white",transparent:!0,opacity:.5}),h.jsx("textSprite",{userData:{unintersectable:!0},text:R,fontSize:20*a,fontFace:"Times Roman",textHeight:.15*a,position:[0,0,1.6*a]})]},S)})}),h.jsxs("group",{ref:g,rotation:[t,0,0],children:[h.jsx(jn,{points:[[0,0,a],[0,0,1.75*a]]}),h.jsx("textSprite",{ref:y,userData:{unintersectable:!0},text:v(t),fontSize:20*a,fontFace:"Times Roman",textHeight:.2*a,position:[0,0,.75*a]})]})]})]})})),RZt=be.memo(()=>h.jsxs("group",{name:"Normal Pointer Group",children:[h.jsx(jn,{points:[[0,0,0],[0,0,1]],userData:{unintersectable:!0},lineWidth:.5,color:"white"}),h.jsx(Rd,{position:[0,0,1],rotation:[Gt,0,0],userData:{unintersectable:!0},args:[.04,.2,4,2],children:h.jsx("meshBasicMaterial",{color:"white"})})]})),HZt=be.memo(be.forwardRef(({positionZ:t,rotationX:e,topTiltGroupRef:n},o)=>{const r=H(Ug),i=H(rl),a=H(Tc),l=m.useMemo(()=>Math.max(100,10*r),[r]),s=m.useMemo(()=>Ei(new Date(i),a),[i,a]),c=m.useRef(null),u=m.useRef(null),d=m.useRef(null),[f,p]=m.useState(null),[g,y]=m.useState(null),[w,b]=m.useState(new ie),[C,P]=m.useState(!1),v=M=>{M?C||P(!0):C&&P(!1)},T=M=>!(s.z<0||M<0||M>90),A=()=>n.current?n.current.getWorldDirection(zl).angleTo(s)/Math.PI*180:-1,x=M=>M.toFixed(1)+"°",S=()=>{if(!n.current||!c.current)return null;const M=Hu.setFromQuaternion(c.current.getWorldQuaternion(lf)).z;Hu.set(0,0,-M);const D=c.current.getWorldPosition(nde),E=n.current.localToWorld(zl.set(0,0,.5)).sub(D).applyEuler(Hu),W=u.current.localToWorld(i9.set(0,0,.5)).sub(D).applyEuler(Hu);return[E.clone(),W.clone()]},R=M=>{if(!f||f.length!==2||!M||M.length!==2)return!1;const[D,E]=M,[W,j]=f;return me.isSame(D,W)&&me.isSame(E,j)};return m.useImperativeHandle(o,()=>({setPositionZ(M){c.current&&(c.current.position.z=M)},setRotationX(M){c.current&&(c.current.rotation.x=M)}}),[]),m.useEffect(()=>{if(!n.current)return;const M=A();if(T(M))v(!0);else{v(!1);return}y(x(M));const E=S();if(p(E),E&&E.length===2){const[W,j]=E,L=new ie().addVectors(W,j).divideScalar(2).multiplyScalar(1.5);b(L)}},[]),ay(()=>{if(!n.current)return;const M=A();if(T(M))v(!0);else{v(!1);return}u.current&&u.current.lookAt(u.current.getWorldPosition(zl).add(s));const E=S();if(R(E)||p(E),d.current&&(E==null?void 0:E.length)===2){const[W,j]=E;d.current.position.addVectors(W,j).divideScalar(2).multiplyScalar(1.5),d.current.text=x(M)}}),C?h.jsxs("group",{ref:c,position:[0,0,t],rotation:[e,0,0],children:[h.jsx(jn,{name:"Sun Beam",ref:u,points:[[0,0,0],[0,0,l]],userData:{unintersectable:!0},lineWidth:.5,color:"white"}),f&&w&&g&&h.jsxs(h.Fragment,{children:[h.jsx(jn,{name:"Angle Line",points:f,userData:{unintersectable:!0},lineWidth:1,color:"white"}),h.jsx("textSprite",{ref:d,position:w,text:g,userData:{unintersectable:!0},fontSize:20,fontFace:"Times Roman",textHeight:.1})]})]}):null})),MZt=be.memo(m.forwardRef(({tiltAngle:t,trackerType:e,surfaceType:n,children:o},r)=>{const i=m.useRef(null),a=H(rl),l=H(Tc),s=m.useRef(new ie),c=m.useMemo(()=>{const f=Ei(new Date(a),l);return s.current.copy(f),f},[a,l]),u=()=>{i.current&&i.current.rotation.set(0,0,0)},d=(f,p)=>{if(i.current)switch(f){case za.ALTAZIMUTH_DUAL_AXIS_TRACKER:{i.current.rotation.set(Math.atan2(Math.hypot(s.current.x,s.current.y),s.current.z),0,Math.atan2(s.current.y,s.current.x)+Gt-p,"ZXY");break}case za.VERTICAL_SINGLE_AXIS_TRACKER:{i.current.rotation.set(t,0,Math.atan2(s.current.y,s.current.x)+Gt-p,"ZXY");break}case za.HORIZONTAL_SINGLE_AXIS_TRACKER:{const g=new ie().copy(s.current).applyEuler(Hu.set(0,0,-p));i.current.rotation.set(0,Math.atan2(g.x,g.z),0,"ZXY");break}}};return m.useImperativeHandle(r,()=>({reset(){u()},update(f,p){d(f,p)}}),[]),m.useEffect(()=>{if(!i.current)return;if(e===za.NO_TRACKER||n!==Lp.Horizontal){u();return}const f=ea.findParentGroup(i.current,[P2,Ov]);f&&d(e,Hu.setFromQuaternion(f.getWorldQuaternion(lf)).z)},[c,e,n]),h.jsx("group",{ref:i,children:o})})),IZt=({solarPanel:t,lx:e,ly:n})=>{const{id:o,tiltAngle:r,pvModelName:i,orientation:a,color:l}=t,s=ht(Ss),c=H(Id)??!1,u=H(gBe),d=H.getState().pvModules[i],f=x$e(e,n,d,a,t.frameColor,t.backsheetColor),p=v$e(o),g=()=>s&&p?h.jsx("meshBasicMaterial",{attach:"material-4",map:p}):f?c||u===0?h.jsx("meshStandardMaterial",{attach:"material-4",map:f,color:l}):h.jsx("meshPhongMaterial",{attach:"material-4",specular:new rr((d==null?void 0:d.color)==="Blue"?pG:gG),shininess:u??ew,side:Ra,map:f,color:l}):null,y=()=>(d==null?void 0:d.bifacialityFactor)===0||c?h.jsx("meshStandardMaterial",{attach:"material-5",color:l}):f?h.jsx("meshPhongMaterial",{attach:"material-5",specular:new rr((d==null?void 0:d.color)==="Blue"?pG:gG),shininess:u??ew,side:Ra,map:f,color:l}):null;return h.jsxs(h.Fragment,{children:[h.jsx("meshStandardMaterial",{attach:"material-0",color:l}),h.jsx("meshStandardMaterial",{attach:"material-1",color:l}),h.jsx("meshStandardMaterial",{attach:"material-2",color:l}),h.jsx("meshStandardMaterial",{attach:"material-3",color:l}),g(),y()]})},zZt=be.memo(m.forwardRef(({lx:t,ly:e,poleRadius:n,poleHeight:o,poleSpacing:r,tiltAngle:i,color:a,visiable:l},s)=>{const c=H(v=>v.elements.length>100?2:4),[u,d]=nC(t),[f,p]=nC(e),[g,y]=nC(i),[w,b]=nC(l),C=m.useRef(null);m.useImperativeHandle(s,()=>({update({lx:v,ly:T,tilt:A}){v!==void 0&&d(v),T!==void 0&&p(T),A!==void 0&&y(A)},setVisiable(v){b(v)}}),[]);const P=m.useMemo(()=>{const v=[],T=Math.floor(.5*u/r),A=Math.floor(.5*f*Math.abs(Math.cos(g))/r),x=Math.tan(g);for(let S=-T;S<=T;S++)for(let R=-A;R<=A;R++){const M=S*r,D=R*r,E=x*D+o,W=(E-o)/2;v.push(new Qa(M,D,W,E))}return v},[u,f,g,r,o]);return w?h.jsx("group",{name:"Poles group",ref:C,position:[0,0,-o/2],children:P.map((v,T)=>v.w<0?null:h.jsx(ca,{userData:{unintersectable:!0},name:"Pole "+T,args:[n,n,v.w,c,1],position:[v.x,v.y,v.z],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{color:a})},T))}):null})),DZt=be.memo(({hlx:t,hly:e})=>h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-t,-e,0],[-t,e,0],[t,e,0],[t,-e,0],[-t,-e,0]],lineWidth:3,color:y0})),EZt=be.memo(({solarPanel:t,boxRef:e})=>{const{ly:n,tiltAngle:o,label:r,locked:i,labelColor:a="white",labelFontSize:l=20,labelSize:s=.2,labelHeight:c}=t,u=n/2,d=Jt(),[f,p]=m.useState("");m.useEffect(()=>{if(!e.current)return;const{x:y,y:w,z:b}=e.current.getWorldPosition(zl);p((r??Y.t("shared.SolarPanelElement",d))+(i?" ("+Y.t("shared.ElementLocked",d)+")":"")+(r?"":` +`+Y.t("word.Coordinates",d)+": ("+y.toFixed(1)+", "+w.toFixed(1)+", "+b.toFixed(1)+") "+Y.t("word.MeterAbbreviation",d)))},[r,i,d]);const g=c??Math.max(u*Math.abs(Math.sin(o))+.1,.2);return h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:f,color:a,fontSize:l,textHeight:s,position:[0,0,g]})}),H$e=be.memo(({onPointerDown:t})=>{const{_color:e,_onPointerDown:n,_onPointerMove:o,_onPointerLeave:r}=MQ(tw,"move"),i=a5()*.75,{gl:a}=oi();return h.jsx(ds,{name:"Move_Handle",args:[i],onPointerDown:l=>{t(l),n(),a.domElement.style.cursor="move"},onPointerMove:o,onPointerLeave:r,children:h.jsx("meshBasicMaterial",{color:e})})}),oC=be.memo(({cx:t,cy:e,size:n,type:o})=>{const{_color:r,_onPointerDown:i,_onPointerMove:a,_onPointerLeave:l}=MQ(Da,"pointer");return h.jsx(Qr,{name:o,position:[t,e,.1],args:[n,n,.1],onPointerDown:i,onPointerMove:a,onPointerLeave:l,children:h.jsx("meshBasicMaterial",{color:r})})}),FZt=be.memo(m.forwardRef(({hlx:t,hly:e,onPointerDown:n},o)=>{const r=a5();return h.jsxs("group",{name:"Resize_Handles_Group",ref:o,onPointerDown:n,children:[h.jsx(oC,{type:vt.Left,cx:-t,cy:0,size:r}),h.jsx(oC,{type:vt.Right,cx:t,cy:0,size:r}),h.jsx(oC,{type:vt.Lower,cx:0,cy:-e,size:r}),h.jsx(oC,{type:vt.Upper,cx:0,cy:e,size:r})]})})),M$e=be.memo(({children:t,onPointerOut:e,onPointerOver:n})=>{const o=H(Ds);return h.jsx(Qr,{name:"Box_Mesh",receiveShadow:o,castShadow:o,onPointerOver:n,onPointerOut:e,children:t})}),kZt=({lx:t,ly:e,lz:n,orientation:o,modelLength:r,modelWidth:i})=>{const a=[],[l,s,c]=[t/2,e/2,n/2];let u,d;o===vr.portrait?(u=Math.max(1,Math.round(t/i)),d=Math.max(1,Math.round(e/r))):(u=Math.max(1,Math.round(t/r)),d=Math.max(1,Math.round(e/i)));const f=t/u,p=e/d;for(let g=0;g<=u;g++)a.push({points:[new ie(-l+g*f,-s,c),new ie(-l+g*f,s,c)]});for(let g=0;g<=d;g++)a.push({points:[new ie(-l,-s+g*p,c),new ie(l,-s+g*p,c)]});return h.jsx("group",{name:"Solar Panel Heatmap Lines Group",position:[0,0,.005],children:a.map((g,y)=>h.jsx(jn,{name:"Solar Panel Lines",userData:{unintersectable:!0},points:g.points,lineWidth:.2},y))})},LZt=be.memo(({lx:t,ly:e,lz:n,orientation:o,modelLength:r,modelWidth:i})=>ht(Ss)?h.jsx(kZt,{lx:t,ly:e,lz:n,orientation:o,modelLength:r,modelWidth:i}):null),I$e=be.memo(m.forwardRef(({lx:t,ly:e,relativeAzimuth:n},o)=>{const r=Math.max(5,Math.hypot(t,e)*.75),i=m.useMemo(()=>new Array(25).fill(0),[]),a=o3(lW,hN),l=r*.05,s={font:a,height:0,size:l},c=f=>f===0?-l*.3:f>0&&f<7?-l*.8:-l*1.2,[u,d]=m.useState(n);return m.useImperativeHandle(o,()=>({setAzimuth:f=>{f<-Math.PI?d(f+Math.PI*2):f>Math.PI?d(f-Math.PI*2):d(f)}})),h.jsxs("group",{rotation:[Gt,0,0],position:[0,0,.1],name:"Solar Panel Polar Grid Group",children:[h.jsx("polarGridHelper",{args:[r,24,6,120,"white","white"],userData:{unintersectable:!0}}),h.jsx(sR,{args:[r*.98,r,24,1,Gt,u],userData:{unintersectable:!0},rotation:[-Gt,0,0],children:h.jsx("meshBasicMaterial",{side:$r,color:"yellow"})}),h.jsx("group",{rotation:[0,u,0],children:h.jsx("mesh",{position:[-.5,0,-r*.9],rotation:[-Gt,0,0],userData:{unintersectable:!0},children:h.jsx("textGeometry",{args:[`${-me.toDegrees(u).toFixed(1)}°`,s]})})}),i.map((f,p)=>{let g=Math.ceil(p/2)*(p%2===0?1:-1);g===-12&&(g=12);const y=c(Math.abs(g));return h.jsx("group",{rotation:[0,g*Math.PI/12,0],children:h.jsxs("mesh",{position:[y,0,-r*1.05],rotation:[-Gt,0,0],userData:{unintersectable:!0},children:[h.jsx("textGeometry",{args:[`${-15*g}°`,s]}),h.jsx("meshStandardMaterial",{attach:"material",color:"lightGray"})]})},p)})]})})),WZt=be.memo(m.forwardRef(({lx:t,ly:e,tiltAngle:n,modelLength:o,visiable:r},i)=>{const a=H(Ds),l=.75,s=(v,T)=>{const A=T*l,x=Math.cos(v),S=v/2,R=A*Math.sin(S)*2,M=S;return{cz:(A-T/2)*x+R*Math.sin(M),mountAngle:M,length:R}},{cz:c,mountAngle:u,length:d}=m.useMemo(()=>s(n,e),[n,e]),[f,p]=nC(t),[g,y]=nC(r),w=m.useMemo(()=>{const v=[];let A=Math.round(f/o)%2===0?o/2:0;for(;A({update(v,T){if(b.current&&C.current&&P.current){const{cz:A,mountAngle:x,length:S}=s(-v,T);b.current.position.y=-A,C.current.rotation.x=-x,P.current.position.z=S/2,P.current.scale.z=S-.025}},resizeX(v){p(v)},setVisiable(v){y(v)}}));const b=m.useRef(null),C=m.useRef(null),P=m.useRef(null);return g?h.jsx("group",{ref:b,position:[0,-c,0],castShadow:a,receiveShadow:a,children:h.jsx("group",{ref:C,rotation:[-u,0,0],children:h.jsx("group",{ref:P,position:[0,0,d/2],scale:[1,1,d-.025],children:w.map((v,T)=>h.jsx(Qr,{position:[v,0,0],args:[.05,.05,1],children:h.jsx("meshStandardMaterial",{color:"#BFBFBF"})},T))})})}):null}));var Wa=(t=>(t.Move="Move",t.RotateUpper="RotateUpper",t.RotateLower="RotateLower",t.ResizeX="ResizeX",t.ResizeY="ResizeY",t.ResizeHeight="ResizeHeight",t.Tilt="Tilt",t.None="None",t))(Wa||{}),Lp=(t=>(t.Vertical="Vertical",t.Horizontal="Horizontal",t.Inclined="Inclined",t))(Lp||{});const NZt="Intersection Plane XY",gO=1,ESe=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i,ly:a,rotation:l,normal:s,relativeAzimuth:c,tiltAngle:u,parentType:d,drawSunBeam:f,trackerType:p=za.NO_TRACKER,pvModelName:g="SPR-X21-335-BLK",orientation:y=vr.landscape,poleHeight:w,poleRadius:b,poleSpacing:C,color:P="white",locked:v}=t,T=m.useMemo(()=>ea.getPVModel(g),[g]),A=Math.max(T.thickness,.02),[x,S,R]=[i/2,a/2,A/2],M=Es(e),{materialLx:D,materialLy:E,setMaterialSize:W}=bZt(i,a),{set:j,get:L,raycaster:k}=oi(),N=H(fn),[F,U]=m.useState(!1),[O,B]=m.useState(!1),[_,X]=m.useState(!1),$=m.useRef(null),Q=m.useRef(null),le=m.useRef(null),q=m.useRef(null),te=m.useRef(null),re=m.useRef(null),ae=m.useRef(null),se=m.useRef(null),ne=m.useRef(null),fe=m.useRef(null),ge=m.useRef(null),de=m.useRef(null),Z=m.useRef(null),he=m.useRef(null),xe=m.useRef(new ie),He=m.useRef(new ie),Se=m.useRef(null),ze=m.useRef(null),Ie=m.useRef(null),ye=m.useRef(null),ce=m.useRef(null),pe=m.useMemo(()=>ea.getSurfaceType(d,new ie().fromArray(s)),[d,s]),ve=m.useMemo(()=>ea.isTrackerEnabled(pe,p),[pe,p]),Ae=m.useMemo(()=>-S*Math.sin(Math.min(0,u)),[u,S]),Te=m.useMemo(()=>{switch(pe){case"Horizontal":return R+w;case"Vertical":return R+Ae;case"Inclined":return R}},[w,R,pe,Ae]),Me=m.useMemo(()=>M&&!v,[M,v]),Pe=m.useMemo(()=>M&&pe==="Horizontal"&&!ve&&!v,[M,pe,p,ve,v]),Ee=m.useMemo(()=>!M||ve||v?!1:pe==="Vertical"||pe==="Horizontal"&&w>0,[M,pe,w,ve,v]),Be=m.useMemo(()=>w>0&&pe==="Horizontal",[w,pe]),Je=m.useMemo(()=>pe==="Vertical",[pe]),We=At=>{j({frameloop:At})},Ke=()=>{if(!te.current)return;const[At,kt]=te.current.scale.toArray().map(gt=>gt/2);if(re.current)for(const gt of re.current.children)switch(gt.name){case vt.Left:{gt.position.x=-At;break}case vt.Right:{gt.position.x=At;break}case vt.Upper:{gt.position.y=kt;break}case vt.Lower:{gt.position.y=-kt;break}}if(ae.current)for(const gt of ae.current.children)switch(gt.name){case Kr.Lower:{gt.position.y=-kt-gO;break}case Kr.Upper:{gt.position.y=kt+gO;break}}},Ne=At=>{if(!At)return;const[kt,gt,dt]=ea.getRotationOnCuboid(At);De(kt,gt,dt),me.isEqual(At.z,1)?he.current!==null?le.current.rotation.z=he.current-Hu.z:le.current.rotation.z=c:le.current.rotation.set(0,0,0)},De=(At,kt,gt)=>{$.current&&$.current.rotation.set(At,kt,gt,"ZXY"),ne.current&&ne.current.setRotationX(-At)},ke=At=>{le.current&&(le.current.position.z=At),ne.current&&ne.current.setPositionZ(At)},Ye=(At,kt)=>{q.current&&(q.current.rotation.x=At),se.current&&se.current.update(At,kt),fe.current&&fe.current.update({tilt:At}),Z.current&&Z.current.update(At,a)},it=(At,kt)=>{const gt=Fn.getState().solarPanelCountRef;gt&>.current&&(gt.current.textContent=`${ea.getRackCount(y,At,kt,T.length,T.width)}`)},Ve=At=>{de.current&&de.current.setAzimuth(At)},yt=At=>{Z.current&&Z.current.resizeX(Math.abs(At))},ct=At=>{Z.current&&Z.current.update(u,Math.abs(At))},Xe=(At,kt,gt)=>{switch(gt){case"Move":{const dt=At.intersectObjects(kt.children);for(const Ct of dt){if(Ct.object.name===cX){const tt=Ct.object.parent;return tt?{intersection:Ct,parentGroup:tt,parentType:z.Foundation}:null}if(Ct.object.name.includes(Eu.WALL_OUTSIDE_SURFACE_MESH_NAME)){const tt=Ct.object.parent;return tt?{intersection:Ct,parentGroup:tt,parentType:z.Wall}:null}if(Ct.object.name.includes("Roof")){const tt=ea.findParentGroup(Ct.object,[cX]);return tt?{intersection:Ct,parentGroup:tt,parentType:z.Roof}:null}if(Ct.object.name.includes("Cuboid")){const tt=ea.findParentGroup(Ct.object,[Ov]);return tt?{intersection:Ct,parentGroup:tt,parentType:z.Cuboid}:null}}break}case"ResizeX":case"ResizeY":case"RotateLower":case"RotateUpper":{if(!O||!ge.current||!ce.current)return null;const dt=At.intersectObjects([ge.current]),Ct=dt[0];return!Ct||me.isEqual(Ct.point.z,0)?null:{intersection:dt[0],parentGroup:ce.current,parentType:d}}}return null},ut=(At,kt)=>{const{length:gt,width:dt}=ea.getUnitSize(y,T.length,T.width);return At==="ResizeX"?(kt-gt&&(kt=gt),Math.round(kt/gt)*gt):At==="ResizeY"?(kt-dt&&(kt=dt),Math.round(kt/dt)*dt):kt},ft=(At,kt)=>{if(kt==="ResizeX")return At;{const gt=Math.abs(2*w/Math.sin(u));return me.clamp(At,-gt,gt)}},ot=(At,kt,gt,dt)=>{var tt;const Ct=kt.children.find(Fe=>Fe.name===ide);if(Ct&&At&&Ct!==At){At.children=At.children.filter(qe=>qe!==$.current),Ct.children.push($.current),$.current.parent=Ct;const Fe=(tt=Ct.parent)==null?void 0:tt.userData;if(Fe&&Fe.id&&Fe.fId&&(Se.current=Fe.id,ze.current=Fe.fId),gt===z.Roof){const qe=ea.getRoofId(dt);qe&&(Se.current=qe)}}Ie.current=gt},st=At=>{At.intersections.length==0||At.intersections[0].object!==At.object||(At.stopPropagation(),ea.setSelected(e,!0),At.button===2&&N(kt=>{kt.contextMenuObjectType=z.SolarPanel}))},at=At=>{if(!M||!$.current||!le.current||At.intersections.length==0||At.intersections[0].object!==At.object)return;We("always"),Fn.getState().setEnableOrbitController(!1),ye.current="Move";const kt=ea.findParentGroup($.current,[P2,Ov]);kt&&(he.current=Hu.setFromQuaternion(kt.getWorldQuaternion(lf.set(0,0,0,0))).z+c)},Oe=At=>{if(!(!M||!$.current||!le.current)&&!(At.intersections.length==0||At.intersections[0].object!==At.object)){switch(We("always"),Fn.getState().setEnableOrbitController(!1),At.object.name){case vt.Left:case vt.Right:{ye.current="ResizeX";break}case vt.Upper:case vt.Lower:{ye.current="ResizeY";break}}pe==="Horizontal"?(le.current.localToWorld(xe.current.set(-At.object.position.x,-At.object.position.y*Math.abs(Math.cos(u)),-R-w)),$.current.getWorldPosition(He.current).sub(xe.current).normalize()):(le.current.localToWorld(xe.current.set(-At.object.position.x,-At.object.position.y,0)),le.current.getWorldPosition(He.current).sub(xe.current).normalize()),B(!0),ce.current=ea.findParentGroup($.current,[z$e,P2,Ov])}},Ze=At=>{if(!(!le.current||!ae.current)&&!(At.intersections.length==0||At.intersections[0].object!==At.object)){switch(We("always"),Fn.getState().setEnableOrbitController(!1),At.eventObject.name){case Kr.Upper:{ye.current="RotateUpper";break}case Kr.Lower:{ye.current="RotateLower";break}}le.current.getWorldPosition(xe.current),xe.current.z=0,B(!0),X(!0),ce.current=ea.findParentGroup($.current,[P2,Ov])}},St=At=>{At.intersections.length==0||At.intersections[0].object!==At.object||(ye.current="Tilt",We("always"),Fn.getState().setEnableOrbitController(!1),pe==="Vertical"?$.current.getWorldPosition(xe.current):le.current.getWorldPosition(xe.current))},Pt=At=>{if(!le.current||!q.current||!se.current)return;const kt=zl.subVectors(At.point,xe.current),gt=le.current.localToWorld(i9.set(0,-1,0)).sub(xe.current),dt=kt.angleTo(gt),tt=Math.sign(Gt-dt)*kt.angleTo(le.current.getWorldDirection(nde));if(pe==="Vertical"){const Fe=tt>0?-tt:tt,qe=R-S*Math.sin(Fe);ke(qe),Ye(Fe,-qe)}else{const Fe=w>=S?Gt:Math.asin(w/S);Ye(me.clamp(tt,-Fe,Fe),0)}},Rt=m.useCallback(()=>{if(!ye.current)return;const At=H.getState().elements.find(gt=>gt.id===e);switch(ye.current){case"Move":{N(gt=>{if(!$.current||!ye.current)return;const dt=Fn.getState().pointer;k.setFromCamera(dt,L().camera);const Ct=Xe(k,L().scene,ye.current),tt=gt.elements.find(Fe=>Fe.id===e);if(tt)if(tt.parentId!==Se.current&&Se.current&&ze.current&&(tt.parentId=Se.current,tt.foundationId=ze.current),Ie.current&&Ie.current!==tt.parentType&&(tt.parentType=Ie.current),tt.parentType===z.Wall){const Fe=gt.elements.find(qe=>qe.id===tt.parentId);Fe&&(tt.cx=$.current.position.x/Fe.lx,tt.cy=0,tt.cz=$.current.position.z/Fe.lz,tt.rotation=[Gt,0,0],tt.normal=[0,-1,0])}else if(tt.cx=$.current.position.x,tt.cy=$.current.position.y,tt.cz=$.current.position.z,he.current!==null&&(Ct!=null&&Ct.parentGroup)&&(tt.relativeAzimuth=he.current-Hu.setFromQuaternion(Ct.parentGroup.getWorldQuaternion(lf.set(0,0,0,0))).z),Ct!=null&&Ct.intersection)if(ea.getSurfaceType(Ct.parentType,Ct.intersection.normal)==="Horizontal")tt.rotation=[0,0,0],tt.normal=[0,0,1];else{const{x:qe,y:je,z:rt}=$.current.rotation,mt=zl.set(0,0,1).applyEuler($.current.rotation);tt.rotation=[qe,je,rt],tt.normal=[mt.x,mt.y,mt.z]}else{const{x:Fe,y:qe,z:je}=$.current.rotation,rt=zl.set(0,0,1).applyEuler($.current.rotation);tt.rotation=[Fe,qe,je],tt.normal=[rt.x,rt.y,rt.z]}});break}case"ResizeX":case"ResizeY":{N(gt=>{if(!te.current||!$.current)return;const dt=gt.elements.find(Ct=>Ct.id===e);if(dt)if(dt.lx=te.current.scale.x,dt.ly=te.current.scale.y,dt.parentType===z.Wall){const Ct=gt.elements.find(tt=>tt.id===dt.parentId);Ct&&(dt.cx=$.current.position.x/Ct.lx,dt.cy=0,dt.cz=$.current.position.z/Ct.lz)}else dt.parentType===z.Roof&&(gt.updateElementOnRoofFlag=!gt.updateElementOnRoofFlag),[dt.cx,dt.cy,dt.cz]=$.current.position});break}case"RotateLower":case"RotateUpper":{N(gt=>{if(!le.current)return;const dt=gt.elements.find(tt=>tt.id===e);if(!dt)return;const Ct=ea.getRelativeAzimuth(le.current.rotation.z);dt.relativeAzimuth=Ct});break}case"Tilt":{N(gt=>{if(!q.current)return;const dt=gt.elements.find(Ct=>Ct.id===e);dt&&(dt.tiltAngle=q.current.rotation.x)});break}}const kt=H.getState().elements.find(gt=>gt.id===e);At&&kt&&(ea.isNewPositionOk(kt)?ea.addUndoable(At,ye.current):setTimeout(()=>{N(gt=>{const dt=gt.elements.findIndex(Ct=>Ct.id===e);dt!==-1&&(gt.elements[dt]=At)})},10)),L().frameloop!=="demand"&&We("demand"),Fn.getState().setEnableOrbitController(!0),ye.current=null,he.current=null,Se.current=null,ze.current=null,Ie.current=null,ce.current=null,B(!1),X(!1)},[]);m.useEffect(()=>(window.addEventListener("pointerup",Rt),()=>window.removeEventListener("pointerup",Rt)),[Rt]),ay(({camera:At,scene:kt,raycaster:gt})=>{if(!$.current||!le.current||!M||!ye.current||ye.current==="Tilt")return;const dt=Fn.getState().pointer;gt.setFromCamera(dt,At);const Ct=Xe(gt,kt,ye.current);if(!Ct)return;const{intersection:tt,parentGroup:Fe,parentType:qe}=Ct,je=tt.point;switch(ye.current){case"Move":{if(!qe)break;switch(ot($.current.parent,Fe,qe,tt.object),qe){case z.Foundation:{$.current.position.x=je.x-Fe.position.x,$.current.position.y=je.y-Fe.position.y,$.current.position.z=je.z-Fe.position.z,$.current.position.applyEuler(Hu.set(0,0,-Fe.rotation.z)),De(0,0,0),he.current!==null?le.current.rotation.z=he.current-Fe.rotation.z:le.current.rotation.z=c;break}case z.Wall:{const mt=ea.findParentGroup(Fe,[P2]);mt&&(Fe.localToWorld(zl.set(0,0,0)),i9.set(0,0,0).subVectors(je,zl).applyEuler(Hu.set(0,0,-mt.rotation.z-Fe.rotation.z)),$.current.position.x=i9.x,$.current.position.y=0,$.current.position.z=i9.z,De(Gt,0,0),le.current.rotation.set(0,0,0));break}case z.Roof:{const mt=ea.getRoofSegmentData(tt.object);if(mt){const{roofId:Qe,foundation:Tt,centroid:Dt,roofSegments:lt}=mt;if(Tt&&Dt&<&&Qe){const zt=new ie().subVectors(je,new ie(Tt.cx,Tt.cy,Tt.cz)).applyEuler(new nn(0,0,-Tt.rotation[2])),Ft=zt.clone().sub(Dt),{normal:_t,rotation:tn}=Cn.computeState(lt,Ft);$.current.position.x=zt.x,$.current.position.y=zt.y,$.current.position.z=zt.z,me.isEqual(tn[0],0)?(De(0,0,0),he.current!==null?le.current.rotation.set(0,0,he.current-Fe.rotation.z):le.current.rotation.set(0,0,c)):(De(tn[0],tn[1],tn[2]),le.current.rotation.set(0,0,0))}}break}case z.Cuboid:Fe.getWorldPosition(zl),Fe.getWorldQuaternion(lf),Hu.setFromQuaternion(lf),$.current.position.subVectors(je,zl).applyQuaternion(lf.invert()),Ne(tt.normal)}const rt=ea.getSurfaceType(qe,tt.normal);switch(rt==="Horizontal"?(fe.current&&fe.current.setVisiable(!0),Z.current&&Z.current.setVisiable(!1),ke(w+R)):(fe.current&&fe.current.setVisiable(!1),Z.current&&Z.current.setVisiable(!0),ke(R)),rt){case"Horizontal":{Ye(u,0);break}case"Vertical":{const mt=Math.min(0,u),Qe=R-S*Math.sin(mt);ke(Qe),Ye(mt,-Qe);break}case"Inclined":{Ye(0,0);break}}ea.isTrackerEnabled(rt,p)?(le.current.rotation.set(0,0,0),q.current.rotation.set(0,0,0),Q.current.update(p,Hu.setFromQuaternion(Fe.getWorldQuaternion(lf)).z)):Q.current.reset();break}case"ResizeX":case"ResizeY":{const rt=xe.current,mt=zl.subVectors(je,rt),Qe=He.current,Tt=mt.angleTo(Qe),Dt=mt.length()*Math.cos(Tt),lt=ut(ye.current,Dt);if(pe==="Vertical"){const zt=$.current.getWorldPosition(zl).sub(le.current.getWorldPosition(i9)),Ft=nde.copy(Qe).multiplyScalar(lt/2).add(rt).add(zt).sub(Fe.getWorldPosition(ode)).applyQuaternion(Fe.getWorldQuaternion(lf).invert());$.current.position.x=Ft.x,$.current.position.z=Ft.z,qe===z.Cuboid&&($.current.position.y=Ft.y),ye.current==="ResizeX"?(te.current.scale.x=Math.abs(lt),yt(lt)):ye.current==="ResizeY"&&(te.current.scale.y=Math.abs(lt),ct(lt),qe===z.Wall&&ke(Math.abs(lt/2*Math.sin(Math.min(0,u))))),W(ye.current,lt)}else{const zt=ft(lt,ye.current),Ft=zl.copy(Qe).multiplyScalar(zt/2).add(rt).sub(Fe.getWorldPosition(ode)).applyQuaternion(Fe.getWorldQuaternion(lf).invert()),_t=Math.abs(zt);ye.current==="ResizeX"?(te.current.scale.x=_t,fe.current&&fe.current.update({lx:_t})):ye.current==="ResizeY"&&(te.current.scale.y=_t,fe.current&&fe.current.update({ly:_t})),$.current.position.x=Ft.x,$.current.position.y=Ft.y,$.current.position.z=Ft.z,W(ye.current,zt)}Ke(),it(te.current.scale.x,te.current.scale.y);break}case"RotateUpper":{zl.subVectors(je,xe.current).setZ(0);let rt=zl.angleTo(i9.set(0,1,0));zl.x>0&&(rt=-rt),le.current.rotation.z=rt-Hu.setFromQuaternion(Fe.getWorldQuaternion(lf)).z,Ve(le.current.rotation.z);break}case"RotateLower":{zl.subVectors(je,xe.current).setZ(0);let rt=zl.angleTo(i9.set(0,-1,0));zl.x<0&&(rt=-rt),le.current.rotation.z=rt-Hu.setFromQuaternion(Fe.getWorldQuaternion(lf)).z,Ve(le.current.rotation.z);break}}});const Ut=m.useMemo(()=>pe==="Horizontal"&&!ve?new nn(0,0,c,"ZXY"):new nn(0,0,0,"ZXY"),[pe,c,ve]),Ht=m.useMemo(()=>ve?new nn(0,0,0,"ZXY"):pe==="Horizontal"&&w>0?new nn(u,0,0,"ZXY"):pe==="Vertical"?new nn(Math.min(0,u),0,0,"ZXY"):new nn(0,0,0,"ZXY"),[w,pe,u,ve]);return h.jsxs("group",{name:`Ref_Solar_Panel_Group ${e}`,ref:$,position:[n,o,r],rotation:[l[0],l[1],l[2],"ZXY"],onPointerDown:st,onPointerMissed:()=>{M&&ea.setSelected(e,!1)},children:[h.jsxs("group",{name:"Top_Azimuth_Group",ref:le,position:[0,0,Te],rotation:Ut,children:[h.jsx(MZt,{ref:Q,tiltAngle:u,trackerType:p,surfaceType:pe,children:h.jsxs("group",{name:"Top_Tilt_Group",ref:q,rotation:Ht,children:[h.jsxs("group",{ref:te,scale:[i,a,A],children:[h.jsx(M$e,{onPointerOver:()=>U(!0),onPointerOut:()=>U(!1),children:h.jsx(IZt,{solarPanel:t,lx:D,ly:E})}),h.jsx(ua,{name:"Solar Panel Simulation Plane",uuid:e,userData:{simulation:!0},visible:!1,children:h.jsx("meshBasicMaterial",{side:$r})})]}),M&&v&&h.jsx(DZt,{hlx:x,hly:S}),h.jsx(LZt,{lx:D,ly:E,lz:A,orientation:y,modelLength:T.length,modelWidth:T.width}),Me&&h.jsxs(h.Fragment,{children:[h.jsx(H$e,{onPointerDown:at}),h.jsx(FZt,{ref:re,hlx:x,hly:S,onPointerDown:Oe})]}),f&&h.jsx(RZt,{})]})}),O&&h.jsx(ua,{name:NZt,ref:ge,args:[1e4,1e4],visible:!1,children:h.jsx("meshBasicMaterial",{color:"darkgrey"})}),Pe&&h.jsxs("group",{name:"Rotate_Handles_Group",ref:ae,children:[h.jsx(sX,{name:Kr.Upper,positionY:S+gO,onPointerDown:Ze}),h.jsx(sX,{name:Kr.Lower,positionY:-S-gO,onPointerDown:Ze})]}),Ee&&h.jsx(CZt,{ref:se,tiltAngle:u,positionZ:-Ae,isOnVerticalSurface:pe==="Vertical",onPointerDown:St,onPointerMove:Pt}),h.jsx(zZt,{ref:fe,lx:i,ly:a,tiltAngle:u,poleHeight:w,poleRadius:b,poleSpacing:C,color:P,visiable:Be}),(F||t.showLabel)&&!M&&h.jsx(EZt,{solarPanel:t,boxRef:te})]}),f&&h.jsx(HZt,{ref:ne,topTiltGroupRef:q,positionZ:Te,rotationX:-l[0]}),h.jsx(WZt,{ref:Z,tiltAngle:-u,lx:i,ly:a,modelLength:T.length,visiable:Je}),_&&h.jsx(I$e,{ref:de,lx:i,ly:a,relativeAzimuth:c})]})}),ide="Solar_Panels_Wrapper_Group",_ye=be.memo(({parentId:t,foundationId:e,wrapperType:n,plx:o,ply:r,plz:i})=>{const a=m.useCallback(s=>{if(s.type!==z.SolarPanel)return!1;const c=s;switch(n){case z.Foundation:return c.foundationId===e&&(c.parentType===z.Foundation||c.parentType===z.Roof);case z.Cuboid:return c.foundationId===e&&c.parentType===z.Cuboid;case z.Wall:return s.parentId===t&&c.parentType===z.Wall}return!1},[t,e,n]),l=H(s=>s.elements.filter(a),cy);switch(n){case z.Foundation:case z.Cuboid:return h.jsx("group",{name:ide,children:l.map(s=>h.jsx(ESe,{...s},s.id))});case z.Wall:return h.jsx("group",{name:ide,children:l.map(s=>h.jsx(ESe,{...s,cx:s.cx*o,cz:s.cz*i},s.id))});default:return null}}),UZt=be.memo(({parentId:t,foundationId:e,parentLx:n,parentLz:o})=>{const r=a=>a.type!==z.BatteryStorage?!1:a.parentId===t;return H(a=>a.elements.filter(r),cy).map(a=>h.jsx(jZt,{...a,cx:a.cx*n,cz:a.cz*o},a.id))}),jZt=t=>{const{id:e,cx:n,cz:o,lx:r,ly:i,lz:a,color:l}=t,s=i/2,c=H(fn),u=Es(e),d=f=>{f.intersections.length==0||f.intersections[0].object!==f.object||(f.stopPropagation(),ea.setSelected(e,!0),f.button===2&&c(p=>{p.contextMenuObjectType=z.SolarPanel}))};return h.jsxs("group",{name:`Power_Wall_Group ${e}`,position:[n,0,o],onPointerDown:d,children:[h.jsx(Qr,{args:[r,i,a],position:[0,-s,0],children:h.jsx("meshStandardMaterial",{color:l})}),u&&h.jsx(ds,{args:[.2],position:[0,-i,0]})]})},z$e="Wall_Group",BZt=({wallModel:t,foundationModel:e})=>{const{id:n,roofId:o,cx:r,cy:i,lx:a,ly:l,lz:s,relativeAngle:c,fill:u,locked:d,leftUnfilledHeight:f,rightUnfilledHeight:p,leftTopPartialHeight:g,rightTopPartialHeight:y,leftJoints:w,rightJoints:b,parentId:C}=t,P=Es(n),[v,T]=[a/2,s/2],A=u===El.Partial,x=w.length>0?t.leftRoofHeight:s,S=b.length>0?t.rightRoofHeight:s,R=x??s,M=S??s,D=A?Math.min(R,g):R,E=A?Math.min(M,y):M,W=a===0,j=()=>u===El.Empty?h.jsx(oZt,{...t}):h.jsx(Een,{wallModel:t,foundationModel:e});return h.jsxs("group",{name:`${z$e} ${n}`,position:[r,i,T],rotation:[0,0,c],userData:{aabb:!0,id:n,fId:C},children:[h.jsx(_ye,{parentId:n,foundationId:C,wrapperType:z.Wall,plx:a,ply:l,plz:s}),h.jsx(UZt,{parentId:n,foundationId:C,parentLx:a,parentLz:s}),j(),P&&!d&&h.jsxs(h.Fragment,{children:[a>.5&&h.jsx(iZt,{ply:l,phz:T}),h.jsx(lZt,{id:n,parentLz:e.lz,roofId:o,absAngle:c+e.rotation[2],x:v,z:T,leftUnfilledHeight:f,rightUnfilledHeight:p,leftTopPartialResizeHandleHeight:D,rightTopPartialResizeHandleHeight:E,fill:u,wallLeftHeight:R,wallRightHeight:M,highLight:W,leftJoints:w,rightJoints:b})]})]})},YZt=(t,e)=>t.wallModel===e.wallModel,OZt=be.memo(BZt,YZt),D$e="Building Group",_Zt=t=>{const{id:e,lx:n,ly:o,lz:r}=t,i=l=>l.foundationId!==e?!1:l.type===z.Wall||l.type===z.Roof||l.type===z.SolarPanel&&l.parentType===z.Roof||l.type===z.Window&&l.parentType===z.Roof,a=H(l=>l.elements.filter(i),cy);return a.length===0?null:h.jsx("group",{name:D$e,position:[0,0,r/2],children:a.map(l=>{switch(l.type){case z.Wall:return h.jsx(OZt,{wallModel:l,foundationModel:t},l.id);case z.Roof:return h.jsx(_Qt,{roofModel:l,foundationModel:t},l.id);case z.Window:return h.jsx(L$e,{...l,cz:l.cz},l.id);default:return null}})})},VZt=(t,e)=>t.lx===e.lx&&t.ly===e.ly&&t.lz===e.lz&&t.rotation===e.rotation,GZt=be.memo(_Zt,VZt),FSe=be.memo(({hx:t,hy:e,position:n,direction:o,color:r})=>{if(n===null)return null;const[i,a]=n,l=[];if(o==="x")l.push([-t,a,0]),l.push([t,a,0]);else if(o==="y")l.push([i,-e,0]),l.push([i,e,0]);else return o==="xy"?h.jsxs(h.Fragment,{children:[h.jsx(jn,{points:[[-t,a,0],[t,a,0]],color:r}),h.jsx(jn,{points:[[i,-e,0],[i,e,0]],color:r})]}):null;return h.jsx(jn,{points:l,color:r})});class rC{static addUndoable(e,n){if(e)switch(n){case Wa.Move:{rC.addUndoableMove(e);break}case Wa.ResizeX:{rC.addUndoableResizeX(e);break}case Wa.ResizeHeight:{rC.addUndoablResizeHeight(e);break}case Wa.RotateLower:case Wa.RotateUpper:{rC.addUndoableRotate(e);break}}}static addUndoableMove(e){const n=H.getState().elements.find(i=>i.id===e.id&&i.type===z.WaterHeater);if(!n)return;const o={name:"Move Water Heater",timestamp:Date.now(),movedElementId:n.id,movedElementType:n.type,oldCx:e.cx,oldCy:e.cy,oldCz:e.cz,newCx:n.cx,newCy:n.cy,newCz:n.cz,oldParentType:e.parentType,newParentType:n.parentType,oldParentId:e.parentId,newParentId:n.parentId,oldFoundationId:e.foundationId,newFoundationId:n.foundationId,oldNormal:new ie().fromArray(e.normal),newNormal:new ie().fromArray(n.normal),oldRotation:[...e.rotation],newRotation:[...n.rotation],undo(){r(this.movedElementId,[this.oldCx,this.oldCy,this.oldCz],this.oldParentId,this.oldFoundationId,this.oldParentType,this.oldRotation,this.oldNormal)},redo(){r(this.movedElementId,[this.newCx,this.newCy,this.newCz],this.newParentId,this.newFoundationId,this.newParentType,this.newRotation,this.newNormal)}};H.getState().addUndoable(o);const r=(i,a,l,s,c,u,d)=>{H.getState().set(f=>{const p=f.elements.find(g=>g.id===i);!p||p.type!==z.WaterHeater||([p.cx,p.cy,p.cz]=[...a],l&&(p.parentId=l),s&&(p.foundationId=s),c&&(p.parentType=c),u&&(p.rotation=[...u]),d&&(p.normal=[d.x,d.y,d.z]))})}}static addUndoableResizeX(e){const n=H.getState().elements.find(r=>r.id===e.id&&r.type===z.WaterHeater);if(!n)return;const o={name:"Resize Water Heater X",timestamp:Date.now(),id:n.id,oldPos:[e.cx,e.cy,e.cz],oldDms:[e.lx,e.ly,e.lz],oldRot:[...e.rotation],oldNor:[...e.normal],newPos:[n.cx,n.cy,n.cz],newDms:[n.lx,n.ly,n.lz],newRot:[...n.rotation],newNor:[...n.normal],undo(){H.getState().set(r=>{for(const i of r.elements)if(i.id===o.id){[i.cx,i.cy,i.cz]=[...o.oldPos],[i.lx,i.ly,i.lz]=[...o.oldDms],i.normal=[...o.oldNor],i.rotation=[...o.oldRot];break}})},redo(){H.getState().set(r=>{for(const i of r.elements)if(i.id===o.id){[i.cx,i.cy,i.cz]=[...o.newPos],[i.lx,i.ly,i.lz]=[...o.newDms],i.normal=[...o.newNor],i.rotation=[...o.newRot];break}})}};H.getState().addUndoable(o)}static addUndoablResizeHeight(e){const n=H.getState().elements.find(r=>r.id===e.id&&r.type===z.WaterHeater);if(!n)return;const o={name:"Resize Water Heater Height",timestamp:Date.now(),id:n.id,oldHeight:e.lz,newHeight:n.lz,undo(){H.getState().set(r=>{for(const i of r.elements)if(i.id===o.id){i.lz=o.oldHeight;break}})},redo(){H.getState().set(r=>{for(const i of r.elements)if(i.id===o.id){i.lz=o.newHeight;break}})}};H.getState().addUndoable(o)}static addUndoableRotate(e){const n=H.getState().elements.find(i=>i.id===e.id&&i.type===z.WaterHeater);if(!n)return;const o={name:"Rotate Water Heater",timestamp:Date.now(),changedElementId:n.id,oldValue:e.relativeAzimuth,newValue:n.relativeAzimuth,changedElementType:z.WaterHeater,undo:()=>{r(o.oldValue)},redo:()=>{r(o.newValue)}};H.getState().addUndoable(o);const r=i=>{H.getState().set(a=>{const l=a.elements.find(s=>s.id===o.changedElementId&&s.type===z.WaterHeater);l&&(l.relativeAzimuth=i)})}}}const XZt=be.memo(({waterTankLength:t,waterTankRadius:e,panelWidth:n})=>{const o=t/2,r=n/2,i=r+e;return h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-o,-r,0],[-o,i,0],[o,i,0],[o,-r,0],[-o,-r,0]],lineWidth:3,color:y0})}),kSe="Mount Left",LSe="Mount Right",JZt=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i,ly:a,lz:l,rotation:s,normal:c,relativeAzimuth:u,parentType:d,locked:f}=t,p=i,g=a,y=.05,w=.3,b=p+.25,C=l-w*2,P=Math.asin(Math.min(1,(C+w)/g)),v=.5,T=m.useRef(null),A=m.useRef(null),x=m.useRef(null),S=m.useRef(null),R=m.useRef(new ie),M=m.useRef(new ie),D=m.useRef(null),E=m.useRef(null),W=m.useRef(null),j=m.useRef(null),L=m.useRef(null),k=m.useRef(null),N=m.useRef(null),F=m.useRef(null),U=m.useRef(null),O=m.useRef(null),B=m.useRef(null),_=m.useRef(null),X=m.useRef(null),$=m.useRef(null),[Q,le]=m.useState(!1),[q,te]=m.useState(!1),[re,ae]=m.useState(!1),[se,ne]=m.useState(!1),fe=Es(e),ge=a5(),{set:de,get:Z,raycaster:he}=oi(),xe=m.useMemo(()=>ea.getSurfaceType(d,new ie().fromArray(c)),[d,c]),He=m.useMemo(()=>xe===Lp.Horizontal?new nn(0,0,u,"ZXY"):new nn(0,0,0,"ZXY"),[xe,u]),Se=m.useMemo(()=>fe&&xe===Lp.Horizontal&&!f,[fe,xe,f]),ze=H(fn),Ie=We=>{de({frameloop:We})},ye=(We,Ke,Ne)=>{switch(Ne){case Wa.Move:{const De=We.intersectObjects(Ke.children);for(const ke of De)if(ke.object.name.includes("Roof")){const Ye=ea.findParentGroup(ke.object,[cX]);return Ye?{intersection:ke,parentGroup:Ye,parentType:z.Roof}:null}break}case Wa.ResizeX:case Wa.ResizeY:case Wa.RotateLower:case Wa.RotateUpper:{if(!Q||!F.current||!D.current)return null;const De=We.intersectObjects([F.current]),ke=De[0];return!ke||me.isEqual(ke.point.z,0)?null:{intersection:De[0],parentGroup:D.current,parentType:d}}case Wa.ResizeHeight:{if(!q||!U.current||!D.current)return null;const De=We.intersectObjects([U.current]),ke=De[0];return!ke||me.isEqual(ke.point.z,0)?null:{intersection:De[0],parentGroup:D.current,parentType:d}}}return null},ce=(We,Ke,Ne)=>{E.current&&E.current.rotation.set(We,Ke,Ne,"ZXY")},pe=(We,Ke,Ne,De)=>{var Ye;const ke=Ke.children.find(it=>it.name===E$e);if(ke&&We&&ke!==We){We.children=We.children.filter(Ve=>Ve!==E.current),ke.children.push(E.current),E.current.parent=ke;const it=(Ye=ke.parent)==null?void 0:Ye.userData;if(it&&it.id&&it.fId&&(x.current=it.id,S.current=it.fId),Ne===z.Roof){const Ve=ea.getRoofId(De);Ve&&(x.current=Ve)}}},ve=()=>{if(!j.current)return;const[We,Ke]=j.current.scale.toArray().map(Ne=>Ne/2);if(k.current)for(const Ne of k.current.children)switch(Ne.name){case vt.Left:{Ne.position.x=-We;break}case vt.Right:{Ne.position.x=We;break}case vt.Upper:{Ne.position.y=Ke;break}case vt.Lower:{Ne.position.y=-Ke;break}}if(L.current&&(L.current.scale.y=j.current.scale.x+.25),O.current)for(const Ne of O.current.children)switch(Ne.name){case kSe:{Ne.position.x=-j.current.scale.x*.4;break}case LSe:{Ne.position.x=j.current.scale.x*.4;break}}},Ae=We=>{B.current&&B.current.setAzimuth(We)},Te=We=>{We.intersections.length==0||We.intersections[0].object!==We.object||(We.stopPropagation(),ea.setSelected(e,!0),We.button===2&&ze(Ke=>{Ke.contextMenuObjectType=z.WaterHeater}))},Me=We=>{if(!fe||!E.current||We.intersections.length==0||We.intersections[0].object!==We.object)return;Ie("always"),Fn.getState().setEnableOrbitController(!1),T.current=Wa.Move;const Ke=ea.findParentGroup(E.current,[P2]);Ke&&(A.current=Hu.setFromQuaternion(Ke.getWorldQuaternion(lf.set(0,0,0,0))).z+u)},Pe=We=>{if(!(!fe||!E.current||!W.current)&&!(We.intersections.length==0||We.intersections[0].object!==We.object)){switch(Ie("always"),Fn.getState().setEnableOrbitController(!1),We.object.name){case vt.Left:case vt.Right:{T.current=Wa.ResizeX;break}case vt.Upper:case vt.Lower:{T.current=Wa.ResizeY;break}}xe===Lp.Horizontal?(W.current.localToWorld(R.current.set(-We.object.position.x,-We.object.position.y,0)),E.current.getWorldPosition(M.current).sub(R.current).normalize()):(W.current.localToWorld(R.current.set(-We.object.position.x,-We.object.position.y,0)),W.current.getWorldPosition(M.current).sub(R.current).normalize()),le(!0),D.current=ea.findParentGroup(E.current,[P2])}},Ee=We=>{!fe||!E.current||!W.current||We.intersections.length==0||We.intersections[0].object!==We.object||(Ie("always"),Fn.getState().setEnableOrbitController(!1),T.current=Wa.ResizeHeight,D.current=ea.findParentGroup(E.current,[P2]),te(!0),setTimeout(()=>{if(U.current){const Ke=Z().camera.position;We.intersections[0].object.localToWorld(zl.set(0,0,0)),U.current.lookAt(Ke.x,Ke.y,zl.z),We.intersections[0].object.localToWorld(R.current.set(0,0,-l)),setTimeout(()=>{U.current.userData.state=!0},10)}},0))},Be=We=>{if(!(!W.current||!N.current)&&!(We.intersections.length==0||We.intersections[0].object!==We.object)){switch(Ie("always"),Fn.getState().setEnableOrbitController(!1),We.eventObject.name){case Kr.Upper:{T.current=Wa.RotateUpper;break}case Kr.Lower:{T.current=Wa.RotateLower;break}}W.current.getWorldPosition(R.current),R.current.z=0,le(!0),ne(!0),D.current=ea.findParentGroup(E.current,[P2])}},Je=m.useCallback(()=>{if(!T.current)return;const We=H.getState().elements.find(Ke=>Ke.id===e);switch(T.current){case Wa.Move:{ze(Ke=>{if(!E.current||!T.current)return;const Ne=Fn.getState().pointer;he.setFromCamera(Ne,Z().camera);const De=ye(he,Z().scene,T.current),ke=Ke.elements.find(Ye=>Ye.id===e);if(ke)if(ke.parentId!==x.current&&x.current&&S.current&&(ke.parentId=x.current,ke.foundationId=S.current),ke.cx=E.current.position.x,ke.cy=E.current.position.y,ke.cz=E.current.position.z,A.current!==null&&(De!=null&&De.parentGroup)&&(ke.relativeAzimuth=A.current-Hu.setFromQuaternion(De.parentGroup.getWorldQuaternion(lf.set(0,0,0,0))).z),De!=null&&De.intersection)if(ea.getSurfaceType(De.parentType,De.intersection.normal)===Lp.Horizontal)ke.rotation=[0,0,0],ke.normal=[0,0,1];else{const{x:it,y:Ve,z:yt}=E.current.rotation,ct=zl.set(0,0,1).applyEuler(E.current.rotation);ke.rotation=[it,Ve,yt],ke.normal=[ct.x,ct.y,ct.z]}else{const{x:Ye,y:it,z:Ve}=E.current.rotation,yt=zl.set(0,0,1).applyEuler(E.current.rotation);ke.rotation=[Ye,it,Ve],ke.normal=[yt.x,yt.y,yt.z]}});break}case Wa.ResizeX:{ze(Ke=>{if(!j.current||!E.current)return;const Ne=Ke.elements.find(De=>De.id===e);Ne&&(Ne.lx=j.current.scale.x,Ne.ly=j.current.scale.y,Ne.parentType===z.Roof&&(Ke.updateElementOnRoofFlag=!Ke.updateElementOnRoofFlag),[Ne.cx,Ne.cy,Ne.cz]=E.current.position)});break}case Wa.ResizeHeight:{ze(Ke=>{if(!X.current)return;const Ne=Ke.elements.find(De=>De.id===e);Ne&&(Ne.lz=X.current.position.z+w)});break}case Wa.RotateLower:case Wa.RotateUpper:{ze(Ke=>{if(!W.current)return;const Ne=Ke.elements.find(ke=>ke.id===e);if(!Ne)return;const De=ea.getRelativeAzimuth(W.current.rotation.z);Ne.relativeAzimuth=De});break}}rC.addUndoable(We,T.current),Z().frameloop!=="demand"&&Ie("demand"),Fn.getState().setEnableOrbitController(!0),T.current=null,A.current=null,x.current=null,S.current=null,D.current=null,le(!1),te(!1),ne(!1)},[]);return m.useEffect(()=>(window.addEventListener("pointerup",Je),()=>window.removeEventListener("pointerup",Je)),[Je]),ay(({camera:We,scene:Ke,raycaster:Ne})=>{if(!E.current||!W.current||!fe||!T.current)return;const De=Fn.getState().pointer;Ne.setFromCamera(De,We);const ke=ye(Ne,Ke,T.current);if(!ke)return;const{intersection:Ye,parentGroup:it,parentType:Ve}=ke,yt=Ye.point;switch(T.current){case Wa.Move:{if(!Ve)break;switch(pe(E.current.parent,it,Ve,Ye.object),Ve){case z.Roof:{const ct=ea.getRoofSegmentData(Ye.object);if(ct){const{roofId:Xe,foundation:ut,centroid:ft,roofSegments:ot}=ct;if(ut&&ft&&ot&&Xe){const st=new ie().subVectors(yt,new ie(ut.cx,ut.cy,ut.cz)).applyEuler(new nn(0,0,-ut.rotation[2])),at=st.clone().sub(ft),{normal:Oe,rotation:Ze}=Cn.computeState(ot,at);E.current.position.x=st.x,E.current.position.y=st.y,E.current.position.z=st.z,me.isEqual(Ze[0],0)?(ce(0,0,0),A.current!==null?W.current.rotation.set(0,0,A.current-it.rotation.z):W.current.rotation.set(0,0,u)):(ce(Ze[0],Ze[1],Ze[2]),W.current.rotation.set(0,0,0))}}break}}break}case Wa.ResizeX:case Wa.ResizeY:{const ct=R.current,Xe=zl.subVectors(yt,ct),ut=M.current,ft=Xe.angleTo(ut),st=Xe.length()*Math.cos(ft);if(xe!==Lp.Vertical){const at=st,Oe=zl.copy(ut).multiplyScalar(at/2).add(ct).sub(it.getWorldPosition(ode)).applyQuaternion(it.getWorldQuaternion(lf).invert()),Ze=Math.abs(at);T.current===Wa.ResizeX?j.current.scale.x=Ze:(T.current,Wa.ResizeY),E.current.position.x=Oe.x,E.current.position.y=Oe.y,E.current.position.z=Oe.z}ve();break}case Wa.RotateUpper:{zl.subVectors(yt,R.current).setZ(0);let ct=zl.angleTo(i9.set(0,1,0));zl.x>0&&(ct=-ct),W.current.rotation.z=ct-Hu.setFromQuaternion(it.getWorldQuaternion(lf)).z,Ae(W.current.rotation.z);break}case Wa.RotateLower:{zl.subVectors(yt,R.current).setZ(0);let ct=zl.angleTo(i9.set(0,-1,0));zl.x<0&&(ct=-ct),W.current.rotation.z=ct-Hu.setFromQuaternion(it.getWorldQuaternion(lf)).z,Ae(W.current.rotation.z);break}case Wa.ResizeHeight:{if(U.current.userData.state&&X.current){const ct=me.clamp(yt.z-R.current.z,w*2,g+w),Xe=ct-w,ut=ct-w*2;X.current.position.z=Xe,$.current&&O.current&&(O.current.scale.y=ut,O.current.position.z=ut/2,$.current.position.z=Xe,$.current.rotation.x=Math.asin(Xe/g))}break}}}),h.jsxs("group",{ref:E,position:[n,o,r],rotation:[s[0],s[1],s[2],"ZXY"],onPointerDown:Te,children:[h.jsxs("group",{ref:W,rotation:He,children:[h.jsxs("group",{ref:X,position:[0,g/2,w+C],children:[h.jsx(ca,{ref:L,args:[w,w,1],rotation:[0,0,Gt],scale:[1,b,1],children:h.jsx("meshStandardMaterial",{color:"grey"})}),fe&&h.jsx(Qr,{ref:_,args:[ge,.1,ge],position:[0,0,w],onPointerDown:Ee,children:h.jsx("meshBasicMaterial",{color:"white"})})]}),h.jsx("group",{ref:$,position:[0,g/2,w+C],rotation:[P,0,0],children:h.jsxs("group",{position:[0,-g/2,y/2],children:[h.jsxs("group",{ref:j,scale:[p,g,y],children:[h.jsx(M$e,{onPointerOver:()=>ae(!0),onPointerOut:()=>ae(!1),children:h.jsx("meshStandardMaterial",{color:"grey"})}),h.jsx(ua,{name:"Water Heater Simulation Plane",uuid:e,userData:{simulation:!0},visible:!1,children:h.jsx("meshBasicMaterial",{side:$r})})]}),fe&&!f&&h.jsxs(h.Fragment,{children:[h.jsx(H$e,{onPointerDown:Me}),h.jsxs("group",{name:"Resize_Handles_Group",ref:k,onPointerDown:Pe,children:[h.jsx(oC,{cx:p/2,cy:0,type:vt.Right,size:ge}),h.jsx(oC,{cx:-p/2,cy:0,type:vt.Left,size:ge})]})]}),fe&&f&&h.jsx(XZt,{waterTankLength:b,waterTankRadius:w,panelWidth:g})]})}),h.jsxs("group",{ref:O,position:[0,g/2,C/2],rotation:[Gt,0,0],scale:[1,C+.1,1],children:[h.jsx(ca,{name:kSe,args:[.05,.05,1],position:[-p*.4,0,0],children:h.jsx("meshStandardMaterial",{color:"grey"})}),h.jsx(ca,{name:LSe,args:[.05,.05,1],position:[p*.4,0,0],children:h.jsx("meshStandardMaterial",{color:"grey"})})]}),Se&&h.jsxs("group",{name:"Rotate_Handles_Group",ref:N,position:[0,0,C/2],children:[h.jsx(sX,{name:Kr.Upper,positionY:g/2+w+v,onPointerDown:Be}),h.jsx(sX,{name:Kr.Lower,positionY:-g/2-v,onPointerDown:Be})]}),q&&h.jsx(ua,{ref:U,args:[1e4,1e4],position:[0,g/2,0],rotation:[Gt,0,0,"ZXY"],visible:!1,children:h.jsx("meshBasicMaterial",{color:"darkgrey"})})]}),Q&&h.jsx(ua,{ref:F,args:[1e4,1e4],position:[0,0,C/2],visible:!1,children:h.jsx("meshBasicMaterial",{color:"darkgrey"})}),se&&h.jsx(I$e,{ref:B,lx:i,ly:a,relativeAzimuth:u})]})}),E$e="Water_Heater_Wrapper_Group",KZt=be.memo(({foundationId:t,wrapperType:e})=>{const n=m.useCallback(r=>{if(r.type!==z.WaterHeater)return!1;const i=r;switch(e){case z.Foundation:return i.foundationId===t&&i.parentType===z.Roof;case z.Cuboid:case z.Wall:}return!1},[t,e]),o=H(r=>r.elements.filter(n),cy);switch(e){case z.Foundation:return h.jsx("group",{name:E$e,children:o.map(r=>h.jsx(JZt,{...r},r.id))});default:return null}}),P2="Foundation_Group",cX="Foundation",qZt=be.memo(t=>{const{id:e,cx:n,cy:o,lx:r=1,ly:i=1,lz:a=.1,rotation:l=[0,0,0],color:s="gray",lineColor:c="black",lineWidth:u=.2,locked:d=!1,showLabel:f=!1,textureType:p=Yi.NoTexture,solarStructure:g}=t,y=Es(e),w=H(s0),b=H(Id),C=H(Gn),P=H(Cb),v=H(fn),T=H(c3),A=H(Fge),x=H(u3),S=H(Iw),R=H(Vge),M=H(Gge),D=H(uxt),E=H(Jq),W=H(aYe),j=H(zw),L=H(LYe),k=H(WYe),N=H(yp),F=H(Y0),U=H(Nge),O=H(t5),B=H(oxt),_=H(cxt),X=H(Ds),$=H(hA),Q=H(e$),le=H(En),q=H(Oge),te=H(Ege),re=H(ly),ae=ht(Ss),se=H(Cf),ne=H(yge),fe=Tn(u1),{camera:ge,gl:{domElement:de}}=oi(),[Z,he]=m.useState(!1),[xe,He]=m.useState(null),[Se,ze]=m.useState(!1),[Ie,ye]=m.useState({show:!1,direction:null,position:null}),[ce,pe]=m.useState([{show:!1,direction:null,position:null},{show:!1,direction:null,position:null}]),ve=m.useRef(null),Ae=m.useRef(!1),Te=m.useRef(!1),Me=m.useRef(null),Pe=m.useRef(Xr.null),Ee=m.useRef(new Map),Be=m.useRef(null),Je=m.useRef(null),We=m.useRef(null),Ke=m.useRef(null),Ne=m.useRef(null),De=m.useRef(null),ke=m.useRef(null),Ye=m.useRef(null),it=m.useRef(null),Ve=m.useRef(null),yt=m.useRef(null),ct=m.useRef(null),Xe=m.useRef(new ie),ut=m.useRef(new ie),ft=m.useRef(new ie(1,1,1)),ot=m.useRef(new ie(1,1,1)),st=m.useRef(0),at=m.useRef(0),Oe=m.useRef([]),Ze=m.useRef([]),St=m.useRef([]),Pt=m.useRef([]),Rt=m.useRef([]),Ut=m.useRef([]),Ht=m.useMemo(()=>({lng:w}),[w]),At=m.useMemo(()=>new Xt,[]),kt=m.useMemo(()=>new l0,[]),gt=r/2,dt=i/2,Ct=a/2,tt=m.useMemo(()=>new ie(-gt,-dt,Ct),[gt,dt,Ct]),Fe=m.useMemo(()=>new ie(-gt,dt,Ct),[gt,dt,Ct]),qe=m.useMemo(()=>new ie(gt,-dt,Ct),[gt,dt,Ct]),je=m.useMemo(()=>new ie(gt,dt,Ct),[gt,dt,Ct]),rt=a5(),mt=rt,Qe=rt,Tt=rt*4,Dt=dt+Tt,lt=m.useRef(!1),zt=m.useRef(null),Ft=H(ixt),_t=H(wOe),tn=m.useMemo(()=>new ie,[]);if(We.current){let un=-1;switch(We.current.type){case z.SolarPanel:{un=We.current.poleHeight;break}case z.ParabolicTrough:{const $t=We.current;un=$t.poleHeight+$t.lx/2;break}case z.ParabolicDish:{const $t=We.current;un=$t.poleHeight+$t.lx/2+$t.lx*$t.lx/(4*$t.latusRectum);break}case z.FresnelReflector:{const $t=We.current;un=$t.poleHeight+$t.lx/2;break}}un>=0&&tn.set(0,0,(t==null?void 0:t.lz)/2+un)}m.useEffect(()=>{Ee.current.clear();for(const un of H.getState().elements)un.type===z.Wall&&un.parentId===e&&Ee.current.set(un.id,un)},[e,_]),m.useEffect(()=>{B&&B===ve.current&&(Ee.current.delete(B),Ae.current=!1,Te.current=!1,ve.current=null,v(un=>{un.addedWallId===un.deletedWallId&&(un.addedWallId=null),un.deletedWallId=null}),Fn.getState().setEnableOrbitController(!0),ye({show:!1,direction:null,position:null}),pe([{show:!1,direction:null,position:null},{show:!1,direction:null,position:null}]))},[B]),m.useEffect(()=>{if(t&&ae){const un=fe(t.id);He(un?me.fetchHeatmapTexture(un,se??5):null)}},[ae,se,ne]),m.useEffect(()=>{!lt.current||!H.getState().getAutoDeletedElements()||Qt()},[Ft,_t]);const Qt=L2.debounce(()=>{if(!zt.current)return;const un=H.getState().getAutoDeletedElements();if(!un)return;const{wall:$t,newAngle:Bt,newJoints:pn}=zt.current,Pn={name:"Move Wall",timestamp:Date.now(),id:$t.id,oldPoints:[[...Rt.current[0]],[...Rt.current[1]]],newPoints:[[...$t.leftPoint],[...$t.rightPoint]],oldJoints:[[...St.current[0]],[...St.current[1]]],newJoints:[[...pn[0]],[...pn[1]]],oldAngle:st.current,newAngle:Bt,flippedWallSide:Pe.current,autoDeletedElements:[...un],undo(){switch(this.flippedWallSide){case Xr.loop:{uo(this.id);break}case Xr.left:{const jt=C(this.newJoints[0][0]);jt&&ir(jt);break}case Xr.right:{const jt=C(this.newJoints[1][0]);jt&&Rr(jt);break}}const[$e,bt]=this.oldJoints,[Lt,xt]=this.newJoints;v(jt=>{for(const Kt of jt.elements)if(Kt.id===this.id){const[sn,yn]=this.oldPoints;Kt.cx=(sn[0]+yn[0])/2,Kt.cy=(sn[1]+yn[1])/2,Kt.lx=Math.hypot(sn[0]-yn[0],sn[1]-yn[1]);const An=Kt;An.relativeAngle=this.oldAngle,An.leftPoint=[...sn],An.rightPoint=[...yn],An.leftJoints=[...$e],An.rightJoints=[...bt];break}jt.resizeHandleType=null,jt.elements.push(...this.autoDeletedElements),jt.deletedRoofId=null,jt.autoDeletedChild=null,jt.autoDeletedRoofs=null,jt.autoDeletedRoofIdSet.clear()}),$e[0]!==Lt[0]&&v(jt=>{for(const Kt of jt.elements)Kt.type===z.Wall&&(Kt.id===$e[0]&&(Kt.rightJoints=[this.id]),Kt.id===Lt[0]&&(this.flippedWallSide!==Xr.left?Kt.rightJoints=[]:Kt.leftJoints=[]))}),bt[0]!==xt[0]&&v(jt=>{for(const Kt of jt.elements)Kt.type===z.Wall&&(Kt.id===bt[0]&&(Kt.leftJoints=[this.id]),Kt.id===xt[0]&&(this.flippedWallSide!==Xr.right?Kt.leftJoints=[]:Kt.rightJoints=[]))}),Pe.current=Xr.null},redo(){const[$e,bt]=this.oldJoints,[Lt,xt]=this.newJoints;switch(v(Kt=>{for(const sn of Kt.elements)if(sn.id===this.id&&sn.type===z.Wall){const[yn,An]=this.newPoints;sn.cx=(yn[0]+An[0])/2,sn.cy=(yn[1]+An[1])/2,sn.lx=Math.hypot(yn[0]-An[0],yn[1]-An[1]);const bn=sn;bn.relativeAngle=this.newAngle,bn.leftPoint=[...yn],bn.rightPoint=[...An],bn.leftJoints=[...Lt],bn.rightJoints=[...xt];break}}),$e[0]!==Lt[0]&&v(Kt=>{for(const sn of Kt.elements)sn.type===z.Wall&&(sn.id===$e[0]&&(sn.rightJoints=[]),sn.id===Lt[0]&&(this.flippedWallSide===Xr.right?sn.leftJoints=[this.id]:sn.rightJoints=[this.id]))}),bt[0]!==xt[0]&&v(Kt=>{for(const sn of Kt.elements)sn.type===z.Wall&&(sn.id===bt[0]&&(sn.leftJoints=[]),sn.id===xt[0]&&(this.flippedWallSide===Xr.right?sn.rightJoints=[this.id]:sn.leftJoints=[this.id]))}),this.flippedWallSide){case Xr.loop:{uo(this.id);break}case Xr.left:{const Kt=C(this.newJoints[0][0]);Kt&&Rr(Kt);break}case Xr.right:{const Kt=C(this.newJoints[1][0]);Kt&&ir(Kt);break}}const jt=new Set(this.autoDeletedElements.map(Kt=>Kt.id));v(Kt=>{Kt.resizeHandleType=null,Kt.elements=Kt.elements.filter(yn=>!jt.has(yn.id));const sn=this.autoDeletedElements.find(yn=>yn.type===z.Roof);sn&&(Kt.deletedRoofId=sn.id)}),Pe.current=Xr.null}};le(Pn),lt.current=!1,v($e=>{$e.autoDeletedRoofs=null,$e.autoDeletedRoofIdSet.clear(),$e.autoDeletedChild=null})},100),gn=un=>{At.x=un.offsetX/de.clientWidth*2-1,At.y=-(un.offsetY/de.clientHeight)*2+1,kt.setFromCamera(At,ge)},an=un=>{switch(un){case Yi.Texture01:return{x:1,y:1};case Yi.Texture02:return{x:2,y:2};case Yi.Texture03:return{x:.4,y:.4};case Yi.Texture04:return{x:.25,y:.25};case Yi.Texture05:return{x:5,y:5};case Yi.Texture06:return{x:1,y:1};case Yi.Texture07:return{x:1,y:1};default:return{x:1,y:1}}},mn=m.useMemo(()=>{let un;switch(p){case Yi.Texture01:un=f$e;break;case Yi.Texture02:un=h$e;break;case Yi.Texture03:un=p$e;break;case Yi.Texture04:un=g$e;break;case Yi.Texture05:un=m$e;break;case Yi.Texture06:un=y$e;break;case Yi.Texture07:un=A$e;break;default:un=ig}return new df().load(un,$t=>{$t.wrapS=$t.wrapT=Hs;const Bt=an(p);$t.repeat.set(r/Bt.x,i/Bt.y),Fo($t)})},[p,r,i]),[Hn,Fo]=m.useState(mn),yo=m.useCallback((un,$t)=>{ht.getState().duringCameraInteraction||un.intersections.length>0&&(un.intersections[0].object===un.eventObject||un.intersections.length>1&&un.intersections[1].object===un.eventObject)&&(v(pn=>{pn.hoveredHandle=$t}),me.isMoveHandle($t)?de.style.cursor="move":$t===Kr.Lower||$t===Kr.Upper?de.style.cursor="grab":de.style.cursor=H.getState().addedFoundationId?"crosshair":"pointer")},[]),So=m.useCallback(()=>{v(un=>{un.hoveredHandle=null}),de.style.cursor=H.getState().addedFoundationId?"crosshair":"default"},[]),$o=un=>{switch(un){case z.Human:case z.Tree:case z.Flower:case z.Polygon:case z.Sensor:case z.Light:case z.SolarPanel:case z.ParabolicDish:case z.ParabolicTrough:case z.FresnelReflector:case z.Heliostat:case z.WindTurbine:case z.Wall:return!0;default:return!1}},mo=(un,$t)=>{let Bt=$t,pn=null,Pn=null,$e=null,bt;if(!H.getState().enableFineGrid)for(const[Lt,xt]of Ee.current){if(Lt===ve.current||We.current&&Lt===We.current.id)continue;const jt=new ie(xt.leftPoint[0],xt.leftPoint[1],0),Kt=new ie(xt.rightPoint[0],xt.rightPoint[1],0),sn=(jt==null?void 0:jt.distanceTo(un))??Number.MAX_VALUE,yn=(Kt==null?void 0:Kt.distanceTo(un))??Number.MAX_VALUE,An=sn<=yn,bn=An?sn:yn,Ln=An?jt:Kt;bn<=Bt+.01&&(Bt=bn,pn=Ln,bt=An?xt.leftJoints[0]:xt.rightJoints[0],Pn=Lt,$e=An?G1.Left:G1.Right)}return{id:Pn,point:pn,side:$e,jointId:bt}},Jn=(un,$t)=>(H.getState().enableFineGrid?(un=me.snapToFineGrid(un),$t=null):$t?un=$t:un=me.snapToNormalGrid(un),un),uo=un=>{Ee.current.clear();for(const Bt of H.getState().elements)Bt.type===z.Wall&&Bt.parentId===e&&Ee.current.set(Bt.id,Bt);let $t=Ee.current.get(un);for(;$t&&$t.leftJoints.length>0;){const Bt=Ee.current.get($t.id);if(!Bt||(v(pn=>{for(const Pn of pn.elements)if(Pn.id===Bt.id){const $e=Pn;$e.relativeAngle=(Bt.relativeAngle+Math.PI)%la,$e.leftPoint=[...Bt.rightPoint],$e.rightPoint=[...Bt.leftPoint],$e.leftJoints=[Bt.rightJoints[0]],$e.rightJoints=[Bt.leftJoints[0]];break}}),$t=Ee.current.get($t.leftJoints[0]),$t&&$t.id===un))break}v(Bt=>{Bt.updateWallMapOnFoundationFlag=!Bt.updateWallMapOnFoundationFlag,H.getState().resizeHandleType&&(Bt.resizeHandleType=H.getState().resizeHandleType===vt.LowerLeft?vt.LowerRight:vt.LowerLeft)}),Pe.current=Pe.current===Xr.null?Xr.loop:Xr.null},ir=(un,$t)=>{Ee.current.clear();for(const Pn of H.getState().elements)Pn.type===z.Wall&&Pn.parentId===e&&Ee.current.set(Pn.id,Pn);const Bt=un;let pn=un;for(;pn;){const Pn=Ee.current.get(pn.id);if(!Pn)break;v(bt=>{for(const Lt of bt.elements)if(Pn&&Lt.id===Pn.id){const xt=Lt;xt.relativeAngle=(Pn.relativeAngle+Math.PI)%la,xt.leftPoint=[...Pn.rightPoint],xt.rightPoint=[...Pn.leftPoint],xt.leftJoints=Pn.rightJoints.length>0?[Pn.rightJoints[0]]:[],xt.rightJoints=Pn.leftJoints.length>0?[Pn.leftJoints[0]]:[];break}});let $e;if(Pn.leftJoints.length>0&&($e=Ee.current.get(Pn.leftJoints[0])),$e&&$e.id!==Bt.id)pn=$e;else break}v(Pn=>{if($t)for(const $e of Pn.elements)$e.type===z.Wall&&($e.id===Bt.id&&($e.leftJoints=[$t.id]),$e.id===$t.id&&($e.rightJoints=[Bt.id]));Pn.updateWallMapOnFoundationFlag=!Pn.updateWallMapOnFoundationFlag,Pn.resizeHandleType=vt.LowerLeft}),Pe.current=Pe.current===Xr.null?Xr.right:Xr.null},Rr=(un,$t)=>{Ee.current.clear();for(const Pn of H.getState().elements)Pn.type===z.Wall&&Pn.parentId===e&&Ee.current.set(Pn.id,Pn);const Bt=un;let pn=un;for(;pn;){const Pn=Ee.current.get(pn.id);if(!Pn)break;v(bt=>{for(const Lt of bt.elements)if(Pn&&Lt.id===Pn.id){const xt=Lt;xt.relativeAngle=(Pn.relativeAngle+Math.PI)%la,xt.leftPoint=[...Pn.rightPoint],xt.rightPoint=[...Pn.leftPoint],xt.leftJoints=Pn.rightJoints.length>0?[Pn.rightJoints[0]]:[],xt.rightJoints=Pn.leftJoints.length>0?[Pn.leftJoints[0]]:[];break}});let $e;if(Pn.rightJoints.length>0&&($e=Ee.current.get(Pn.rightJoints[0])),$e&&$e.id!==Bt.id)pn=$e;else break}v(Pn=>{if($t)for(const $e of Pn.elements)$e.type===z.Wall&&($e.id===Bt.id&&($e.rightJoints=[$t.id]),$e.id===$t.id&&($e.leftJoints=[Bt.id]));Pn.updateWallMapOnFoundationFlag=!Pn.updateWallMapOnFoundationFlag,Pn.resizeHandleType=vt.LowerRight}),Pe.current=Pe.current===Xr.null?Xr.left:Xr.null},br=un=>{let $t;Ee.current.clear();for(const pn of H.getState().elements)pn.id===un&&($t=pn),pn.type===z.Wall&&pn.parentId===e&&Ee.current.set(pn.id,pn);let Bt=!1;for(;$t&&$t.leftJoints.length>0;)if($t=Ee.current.get($t.leftJoints[0]),($t==null?void 0:$t.id)===un){Bt=!0;break}if(Bt){let pn=0,Pn=0;for(;$t&&$t.leftJoints.length>0;){const $e=Ee.current.get($t.leftJoints[0]),bt=(Math.PI*3-($t.relativeAngle-$e.relativeAngle))%la;if(pn+=bt,Pn+=1,$t=$e,$t.id===un)break}pn>(Pn-2)*Math.PI+.1?uo(un):Pe.current!==Xr.null&&(Pe.current=Xr.loop)}return Bt},Vr=un=>{const $t={name:"Add",timestamp:Date.now(),addedElement:un,undo:()=>{N($t.addedElement.id,!1)},redo:()=>{v(Bt=>{Bt.elements.push($t.addedElement),Bt.selectedElement=$t.addedElement})}};le($t)},Wo=un=>{const $t={name:"Add",timestamp:Date.now(),addedElement:un,flippedWallSide:Pe.current,undo:()=>{const Bt=$t.addedElement;if(N(Bt.id,!1),($t.flippedWallSide===Xr.right||$t.flippedWallSide===Xr.loop)&&Bt.rightJoints.length>0){const pn=C(Bt.rightJoints[0]);pn&&Rr(pn)}else if($t.flippedWallSide===Xr.left&&Bt.leftJoints.length>0){const pn=C(Bt.leftJoints[0]);pn&&ir(pn)}},redo:()=>{const Bt=$t.addedElement;if($t.flippedWallSide===Xr.right||$t.flippedWallSide===Xr.loop&&Bt.rightJoints.length>0){const pn=C(Bt.rightJoints[0]);pn&&ir(pn)}else if($t.flippedWallSide===Xr.left&&Bt.leftJoints.length>0){const pn=C(Bt.leftJoints[0]);pn&&Rr(pn)}Bt.rightJoints.length>0&&R(Bt.rightJoints[0],[Bt.id]),Bt.leftJoints.length>0&&M(Bt.leftJoints[0],[Bt.id]),v(pn=>{pn.elements.push(Bt),pn.selectedElement=Bt,pn.updateWallMapOnFoundationFlag=!pn.updateWallMapOnFoundationFlag})}};le($t)},wn=un=>{const $t=H.getState().getAutoDeletedElements(),Bt={name:"Resize Wall",timestamp:Date.now(),resizedElementId:un.id,resizedElementType:un.type,oldPosition:Xe.current.clone(),newPosition:ut.current.clone(),oldDimension:ft.current.clone(),newDimension:ot.current.clone(),oldAngle:st.current,newAngle:at.current,oldJoints:[[...St.current[0]],[...St.current[1]]],newJoints:[[...Pt.current[0]],[...Pt.current[1]]],oldPoint:[[...Rt.current[0]],[...Rt.current[1]]],newPoint:[[...Ut.current[0]],[...Ut.current[1]]],flippedWallSide:Pe.current,autoDeletedElement:$t?[...$t]:[],undo:()=>{switch(Bt.flippedWallSide){case Xr.right:if(Bt.newJoints[1]){const pn=C(Bt.newJoints[1][0]);pn&&Rr(pn)}break;case Xr.left:if(Bt.newJoints[0]){const pn=C(Bt.newJoints[0][0]);pn&&ir(pn)}break;case Xr.loop:if(Bt.newJoints[0]&&Bt.newJoints[1])uo(Bt.resizedElementId);else if(Bt.newJoints[1]){const pn=C(Bt.newJoints[1][0]);pn&&Rr(pn)}else if(Bt.newJoints[0]){const pn=C(Bt.newJoints[0][0]);pn&&ir(pn)}break}v(pn=>{for(const Pn of pn.elements)if(Pn.id===Bt.resizedElementId){const $e=Pn;switch($e.cx=Bt.oldPosition.x,$e.cy=Bt.oldPosition.y,$e.cz=Bt.oldPosition.z,$e.lx=Bt.oldDimension.x,$e.ly=Bt.oldDimension.y,$e.lz=Bt.oldDimension.z,$e.relativeAngle=Bt.oldAngle,$e.leftJoints=[...Bt.oldJoints[0]],$e.rightJoints=[...Bt.oldJoints[1]],$e.leftPoint=[...Bt.oldPoint[0]],$e.rightPoint=[...Bt.oldPoint[1]],Bt.flippedWallSide){case Xr.loop:{if(Bt.oldJoints[0]!==Bt.newJoints[1])for(const bt of pn.elements)bt.type===z.Wall&&(bt.id===Bt.newJoints[1][0]&&(bt.rightJoints=[]),bt.id===Bt.oldJoints[0][0]&&(bt.rightJoints=[Bt.resizedElementId]));else if(Bt.oldJoints[1]!==Bt.newJoints[0])for(const bt of pn.elements)bt.type===z.Wall&&(bt.id===Bt.newJoints[0][0]&&(bt.leftJoints=[]),bt.id===Bt.oldJoints[1][0]&&(bt.leftJoints=[Bt.resizedElementId]));break}case Xr.left:case Xr.right:{if(!Bt.oldJoints[0]&&Bt.newJoints[1]){for(const bt of pn.elements)if(bt.type===z.Wall&&bt.id===Bt.newJoints[1][0]){bt.leftJoints=[];break}}else if(!Bt.oldJoints[1]&&Bt.newJoints[0]){for(const bt of pn.elements)if(bt.type===z.Wall&&bt.id===Bt.newJoints[0][0]){bt.rightJoints=[];break}}else if(Bt.flippedWallSide===Xr.left&&Bt.oldJoints[0])for(const bt of pn.elements)bt.type===z.Wall&&(bt.id===Bt.newJoints[1][0]&&(bt.leftJoints=[]),bt.id===Bt.oldJoints[0][0]&&(bt.rightJoints=[$e.id]));else if(Bt.flippedWallSide===Xr.right&&Bt.oldJoints[1])for(const bt of pn.elements)bt.type===z.Wall&&(bt.id===Bt.newJoints[0][0]&&(bt.rightJoints=[]),bt.id===Bt.oldJoints[1][0]&&(bt.leftJoints=[$e.id]));break}case Xr.null:{if(Bt.oldJoints[0]!==Bt.newJoints[0])for(const bt of pn.elements)bt.type===z.Wall&&(bt.id===Bt.newJoints[0][0]&&(bt.rightJoints=[]),bt.id===Bt.oldJoints[0][0]&&(bt.rightJoints=[$e.id]));if(Bt.oldJoints[1]!==Bt.newJoints[1])for(const bt of pn.elements)bt.type===z.Wall&&(bt.id===Bt.newJoints[1][0]&&(bt.leftJoints=[]),bt.id===Bt.oldJoints[1][0]&&(bt.leftJoints=[$e.id]));pn.updateWallMapOnFoundationFlag=!pn.updateWallMapOnFoundationFlag;break}}break}pn.elements.push(...Bt.autoDeletedElement),pn.resizeHandleType=null,pn.deletedRoofId=null,pn.autoDeletedRoofs=null,pn.autoDeletedRoofIdSet.clear(),pn.autoDeletedChild=null}),Pe.current=Xr.null},redo:()=>{Bt.autoDeletedElement.length>0&&N(Bt.autoDeletedElement[0].id,!1,!1,!0);const pn=new Set(Bt.autoDeletedElement.map(Pn=>Pn.id));switch(v(Pn=>{Pn.elements=Pn.elements.filter($e=>!pn.has($e.id));for(const $e of Pn.elements)if($e.id===Bt.resizedElementId){const bt=$e;switch(bt.cx=Bt.newPosition.x,bt.cy=Bt.newPosition.y,bt.cz=Bt.newPosition.z,bt.lx=Bt.newDimension.x,bt.ly=Bt.newDimension.y,bt.lz=Bt.newDimension.z,Bt.flippedWallSide){case Xr.left:bt.relativeAngle=(Bt.newAngle+Math.PI)%la;for(const Lt of Pn.elements)if(Lt.type===z.Wall&&Lt.id===Bt.oldJoints[0][0]){Lt.rightJoints=[];break}break;case Xr.right:bt.relativeAngle=(Bt.newAngle+Math.PI)%la;for(const Lt of Pn.elements)if(Lt.type===z.Wall&&Lt.id===Bt.oldJoints[1][0]){Lt.leftJoints=[];break}break;case Xr.loop:bt.relativeAngle=(Bt.newAngle+Math.PI)%la,bt.leftJoints=[...Bt.newJoints[1]],bt.rightJoints=[...Bt.newJoints[0]],bt.leftPoint=[...Bt.newPoint[1]],bt.rightPoint=[...Bt.newPoint[0]];for(const Lt of Pn.elements)Lt.type===z.Wall&&(Lt.id===Bt.newJoints[0][0]&&(Lt.leftJoints=[bt.id]),Lt.id===Bt.newJoints[1][0]&&(Lt.rightJoints=[bt.id]));break;case Xr.null:if(bt.relativeAngle=Bt.newAngle,bt.leftJoints=[...Bt.newJoints[0]],bt.rightJoints=[...Bt.newJoints[1]],bt.leftPoint=[...Bt.newPoint[0]],bt.rightPoint=[...Bt.newPoint[1]],Bt.oldJoints[0][0]!==Bt.newJoints[0][0])for(const Lt of Pn.elements)Lt.type===z.Wall&&(Lt.id===Bt.newJoints[0][0]&&(Lt.rightJoints=[bt.id]),Lt.id===Bt.oldJoints[0][0]&&(Lt.rightJoints=[]));if(Bt.oldJoints[1][0]!==Bt.newJoints[1][0])for(const Lt of Pn.elements)Lt.type===z.Wall&&(Lt.id===Bt.newJoints[1][0]&&(Lt.leftJoints=[bt.id]),Lt.id===Bt.oldJoints[1][0]&&(Lt.leftJoints=[]));Pn.updateWallMapOnFoundationFlag=!Pn.updateWallMapOnFoundationFlag;break}break}Pn.resizeHandleType=null}),setTimeout(()=>{v(Pn=>{Pn.deletedRoofId=null,Pn.autoDeletedRoofs=null,Pn.autoDeletedRoofIdSet.clear()})}),Bt.flippedWallSide){case Xr.left:{const Pn=C(Bt.resizedElementId),$e=C(Bt.newJoints[1][0]);Rr(Pn,$e);break}case Xr.right:{const Pn=C(Bt.resizedElementId),$e=C(Bt.newJoints[0][0]);ir(Pn,$e);break}case Xr.loop:Ee.current.clear();for(const Pn of H.getState().elements)Pn.type===z.Wall&&Pn.parentId===e&&Ee.current.set(Pn.id,Pn);uo(Bt.resizedElementId);break}Pe.current=Xr.null}};le(Bt),v(pn=>{pn.actionState.wallHeight=un.lz,pn.deletedRoofId=null,pn.autoDeletedRoofs=null,pn.autoDeletedRoofIdSet.clear(),pn.autoDeletedChild=[]})},In=(un,$t,Bt)=>{if(un.roofId)lt.current=!0,zt.current={wall:un,newAngle:$t,newJoints:[[...Bt[0]],[...Bt[1]]]};else{const pn={name:"Move Wall",timestamp:Date.now(),id:un.id,oldPoints:[[...Rt.current[0]],[...Rt.current[1]]],newPoints:[[...un.leftPoint],[...un.rightPoint]],oldJoints:[[...St.current[0]],[...St.current[1]]],newJoints:[[...Bt[0]],[...Bt[1]]],oldAngle:st.current,newAngle:$t,flippedWallSide:Pe.current,undo(){switch(this.flippedWallSide){case Xr.loop:{uo(this.id);break}case Xr.left:{const xt=C(this.newJoints[0][0]);xt&&ir(xt);break}case Xr.right:{const xt=C(this.newJoints[1][0]);xt&&Rr(xt);break}}const[Pn,$e]=this.oldJoints,[bt,Lt]=this.newJoints;v(xt=>{for(const jt of xt.elements)if(jt.id===this.id){const[Kt,sn]=this.oldPoints;jt.cx=(Kt[0]+sn[0])/2,jt.cy=(Kt[1]+sn[1])/2,jt.lx=Math.hypot(Kt[0]-sn[0],Kt[1]-sn[1]);const yn=jt;yn.relativeAngle=this.oldAngle,yn.leftPoint=[...Kt],yn.rightPoint=[...sn],yn.leftJoints=[...Pn],yn.rightJoints=[...$e];break}xt.resizeHandleType=null}),Pn[0]!==bt[0]&&v(xt=>{for(const jt of xt.elements)jt.type===z.Wall&&(jt.id===Pn[0]&&(jt.rightJoints=[this.id]),jt.id===bt[0]&&(this.flippedWallSide!==Xr.left?jt.rightJoints=[]:jt.leftJoints=[]))}),$e[0]!==Lt[0]&&v(xt=>{for(const jt of xt.elements)jt.type===z.Wall&&(jt.id===$e[0]&&(jt.leftJoints=[this.id]),jt.id===Lt[0]&&(this.flippedWallSide!==Xr.right?jt.leftJoints=[]:jt.rightJoints=[]))}),Pe.current=Xr.null},redo(){const[Pn,$e]=this.oldJoints,[bt,Lt]=this.newJoints;switch(v(xt=>{for(const jt of xt.elements)if(jt.id===this.id&&jt.type===z.Wall){const[Kt,sn]=this.newPoints;jt.cx=(Kt[0]+sn[0])/2,jt.cy=(Kt[1]+sn[1])/2,jt.lx=Math.hypot(Kt[0]-sn[0],Kt[1]-sn[1]);const yn=jt;yn.relativeAngle=this.newAngle,yn.leftPoint=[...Kt],yn.rightPoint=[...sn],yn.leftJoints=[...bt],yn.rightJoints=[...Lt];break}}),Pn[0]!==bt[0]&&v(xt=>{for(const jt of xt.elements)jt.type===z.Wall&&(jt.id===Pn[0]&&(jt.rightJoints=[]),jt.id===bt[0]&&(this.flippedWallSide===Xr.right?jt.leftJoints=[this.id]:jt.rightJoints=[this.id]))}),$e[0]!==Lt[0]&&v(xt=>{for(const jt of xt.elements)jt.type===z.Wall&&(jt.id===$e[0]&&(jt.leftJoints=[]),jt.id===Lt[0]&&(this.flippedWallSide===Xr.right?jt.rightJoints=[this.id]:jt.leftJoints=[this.id]))}),this.flippedWallSide){case Xr.loop:{uo(this.id);break}case Xr.left:{const xt=C(this.newJoints[0][0]);xt&&Rr(xt);break}case Xr.right:{const xt=C(this.newJoints[1][0]);xt&&ir(xt);break}}v(xt=>{xt.resizeHandleType=null}),Pe.current=Xr.null}};le(pn)}},ar=un=>{if(un.button===2){un.altKey&&F(e,un,Oo.Select);return}v(pn=>{pn.contextMenuObjectType=null}),H.getState().objectTypeToAdd!==z.Window&&!q()&&F(e,un,Oo.Select);const $t=P();let Bt=!1;if(un.intersections[0].object.name===z.Polygon&&H.getState().objectTypeToAdd!==z.None&&(Bt=!0),($t==null?void 0:$t.id)===e||Bt)if($o(H.getState().objectTypeToAdd)){if(t){ze(!0);const pn=un.intersections.filter($e=>!$e.eventObject.name.startsWith("Wall Intersection Plane"))[0].point,Pn=U(t,pn);Pn&&Vr(Pn),v($e=>{$e.actionModeLock||($e.objectTypeToAdd=z.None)})}}else Fn.getState().selectNone(),Fn.setState({foundationRef:Be});else if($t&&$t.parentId===e&&$o($t.type))switch(We.current=$t,$t.type===z.Wall&&!Ae.current&&(Me.current=[...H.getState().elements]),ze(!0),Xe.current.set($t.cx,$t.cy,$t.cz),ft.current.set($t.lx,$t.ly,$t.lz),ht.getState().setPrimitiveStore("oldParentId",e),ht.getState().setPrimitiveStore("oldFoundationId",e),$t.type){case z.SolarPanel:case z.ParabolicTrough:case z.FresnelReflector:{st.current=$t.relativeAzimuth;break}case z.Polygon:{Oe.current=$t.vertices.map(pn=>({...pn}));break}case z.Wall:{const pn=$t;st.current=pn.relativeAngle,St.current=[[...pn.leftJoints],[...pn.rightJoints]],Rt.current=[[...pn.leftPoint],[...pn.rightPoint]],eo.current=pn.leftJoints[0],Xn.current=pn.rightJoints[0],Ee.current.clear();for(const Pn of H.getState().elements)Pn.type===z.Wall&&Pn.parentId===e&&Ee.current.set(Pn.id,Pn);break}}if(Ae.current&&ve.current&&Je.current){const pn=kt.intersectObjects([Je.current]);if(pn.length===0)return;let Pn=me.wallRelativePosition(pn[0].point,t);ce[0].position&&(Pn.setX(ce[0].position[0]),Pn.setY(ce[0].position[1]));const{id:$e,point:bt,side:Lt,jointId:xt}=mo(Pn,1.5);Pn=Jn(Pn,bt);let jt=vt.LowerRight;if($e){const Kt=C($e);Lt===G1.Right?v(sn=>{for(const yn of sn.elements)if(yn.type===z.Wall){if(yn.id===ve.current){const An=yn;An.cx=Pn.x,An.cy=Pn.y,Kt.rightJoints.length===0&&(An.leftJoints=[Kt.id])}yn.id===$e&&Kt.rightJoints.length===0&&(yn.rightJoints=ve.current?[ve.current]:[])}}):Lt===G1.Left&&!xt&&(v(sn=>{for(const yn of sn.elements)if(yn.type===z.Wall){if(yn.id===ve.current){const An=yn;An.cx=Pn.x,An.cy=Pn.y,Kt.leftJoints.length===0&&(An.rightJoints=[Kt.id])}yn.id===$e&&Kt.leftJoints.length===0&&(yn.leftJoints=ve.current?[ve.current]:[])}}),jt=vt.LowerLeft)}else T(ve.current,Pn.x,Pn.y);Ae.current=!1,Te.current=!0,D(ve.current,[Pn.x,Pn.y,Pn.z]),v(Kt=>{Kt.resizeHandleType=jt,Kt.resizeAnchor=me.wallAbsolutePosition(Pn,t)}),Fn.getState().setEnableOrbitController(!1),We.current=$t}},No=un=>{if(Bl&&Rc(!1),un.altKey&&un.button===2&&k&&k.length>0){v(pn=>{pn.pastePoint.copy(un.intersections[0].point),pn.clickObjectType=z.Foundation,pn.pasteNormal=Io});const Bt=L();if(Bt.length>0){const pn={name:"Paste to Point",timestamp:Date.now(),pastedElements:Bt.map(Pn=>({...Pn})),undo:()=>{for(const Pn of pn.pastedElements)N(Pn.id,!1)},redo:()=>{v(Pn=>{Pn.elements.push(...pn.pastedElements),Pn.selectedElement=pn.pastedElements[0]})}};le(pn)}}if(!We.current||We.current.type===z.Tree||We.current.type===z.Flower||We.current.type===z.Human)return;const $t=C(We.current.id);if($t){switch($t.type){case z.Wall:{const Bt=$t;if(Ae.current)v(pn=>{pn.elements.pop(),pn.addedWallId=null,pn.actionModeLock&&(pn.objectTypeToAdd=z.Wall,vx.selectNone(pn))}),ve.current&&Ee.current.delete(ve.current),ve.current=null,Ae.current=!1,Te.current=!1;else if(Te.current&&ve.current&&Je.current)Fn.getState().setEnableOrbitController(!0),v(pn=>{pn.actionModeLock&&(pn.objectTypeToAdd=z.Wall,vx.selectNone(pn)),pn.addedWallId=null,Bt.lx===0&&Me.current?(pn.elements=[...Me.current],ve.current&&Ee.current.delete(ve.current)):(Wo(Bt),Ee.current.set(Bt.id,Bt))}),ve.current=null,Te.current=!1;else if(H.getState().resizeHandleType)Bt.lx>.45?(Ee.current.set(Bt.id,Bt),ut.current.set(Bt.cx,Bt.cy,Bt.cz),ot.current.set(Bt.lx,Bt.ly,Bt.lz),at.current=Bt.relativeAngle,Pt.current=[[...Bt.leftJoints],[...Bt.rightJoints]],Ut.current=[[...Bt.leftPoint],[...Bt.rightPoint]],wn(Bt)):v(pn=>{Me.current&&(pn.elements=[...Me.current],Me.current=null)});else if(H.getState().moveHandleType){let pn=Bt.relativeAngle,Pn=[],$e=[];if(eo.current)if(Bt.leftJoints.length>0&&(eo.current!==Bt.leftJoints[0]||eo.current===Bt.leftJoints[0]&&Jo.current)&&M(Bt.leftJoints[0],[]),Jo.current)R(eo.current,[Bt.id]),$e=[eo.current];else if(Pn=[eo.current],Qo.current){R(eo.current,[Bt.id]);const bt=C(eo.current);bt&&Rr(bt)}else M(eo.current,[Bt.id]);else Bt.leftJoints.length>0&&Bt.leftJoints[0]!==Xn.current&&(Pn=[],M(Bt.leftJoints[0],[]));if(Xn.current)if(Bt.rightJoints.length>0&&(Xn.current!==Bt.rightJoints[0]||Xn.current===Bt.rightJoints[0]&&Jo.current)&&Bt.rightJoints[0]!==eo.current&&R(Bt.rightJoints[0],[]),Jo.current)M(Xn.current,[Bt.id]),Pn=[Xn.current];else if($e=[Xn.current],xo.current){M(Xn.current,[Bt.id]);const bt=C(Xn.current);bt&&ir(bt)}else R(Xn.current,[Bt.id]);else Bt.rightJoints.length>0&&Bt.rightJoints[0]!==eo.current&&($e=[],R(Bt.rightJoints[0],[]));v(bt=>{for(const Lt of bt.elements)if(Lt.id===Bt.id&&Lt.type===z.Wall){const xt=Lt;if(Jo.current&&(pn=(xt.relativeAngle+Math.PI)%la,xt.relativeAngle=pn,[xt.leftPoint,xt.rightPoint]=[[...xt.rightPoint],[...xt.leftPoint]]),Pn.length===0&&$e.length===0)xt.roofId=null;else if(Pn.length>0){const jt=bt.elements.find(Kt=>Kt.id===Pn[0]);jt&&(xt.roofId=jt.roofId)}else if($e.length>0){const jt=bt.elements.find(Kt=>Kt.id===$e[0]);jt&&(xt.roofId=jt.roofId)}xt.leftJoints=[...Pn],xt.rightJoints=[...$e];break}bt.updateWallMapOnFoundationFlag=!bt.updateWallMapOnFoundationFlag}),br(Bt.id),In(Bt,pn,[[...Pn],[...$e]]),Jo.current=!1,Qo.current=!1,xo.current=!1,eo.current=null,Xn.current=null}Pe.current=Xr.null,v(pn=>{pn.updateWallMapOnFoundationFlag=!pn.updateWallMapOnFoundationFlag}),ye({show:!1,direction:null,position:null}),pe([{show:!1,direction:null,position:null},{show:!1,direction:null,position:null}]);break}case z.Polygon:{if(H.getState().moveHandleType||H.getState().resizeHandleType){Ze.current=$t.vertices.map(pn=>({...pn}));const Bt={name:H.getState().moveHandleType?"Move Polygon":"Resize Polygon",timestamp:Date.now(),oldValue:Oe.current,newValue:Ze.current,changedElementId:$t.id,changedElementType:$t.type,undo:()=>{j(Bt.changedElementId,Bt.oldValue)},redo:()=>{j(Bt.changedElementId,Bt.newValue)}};le(Bt)}break}default:if(H.getState().resizeHandleType){if(ut.current.set($t.cx,$t.cy,$t.cz),ot.current.set($t.lx,$t.ly,$t.lz),ut.current.distanceToSquared(Xe.current)>It||ot.current.distanceToSquared(ft.current)>It){const Bt={name:"Resize",timestamp:Date.now(),resizedElementId:We.current.id,resizedElementType:We.current.type,oldCx:Xe.current.x,oldCy:Xe.current.y,oldCz:Xe.current.z,newCx:ut.current.x,newCy:ut.current.y,newCz:ut.current.z,oldLx:ft.current.x,oldLy:ft.current.y,oldLz:ft.current.z,newLx:ot.current.x,newLy:ot.current.y,newLz:ot.current.z,undo:()=>{T(Bt.resizedElementId,Bt.oldCx,Bt.oldCy,Bt.oldCz),A(Bt.resizedElementId,Bt.oldLx,Bt.oldLy,Bt.oldLz)},redo:()=>{T(Bt.resizedElementId,Bt.newCx,Bt.newCy,Bt.newCz),A(Bt.resizedElementId,Bt.newLx,Bt.newLy,Bt.newLz)}};le(Bt)}}else if(H.getState().rotateHandleType){if(me.isSolarCollector(We.current)){const Bt=We.current;if(Math.abs(at.current-st.current)>It)if(Fs(Bt,at.current)){v(Pn=>{Pn.selectedElementAngle=at.current});const pn={name:"Rotate",timestamp:Date.now(),oldValue:st.current,newValue:at.current,changedElementId:Bt.id,changedElementType:Bt.type,undo:()=>{E(pn.changedElementId,pn.oldValue)},redo:()=>{E(pn.changedElementId,pn.newValue)}};le(pn)}else E(Bt.id,st.current)}}else if(ut.current.set($t.cx,$t.cy,$t.cz),ut.current.distanceToSquared(Xe.current)>It){let Bt=!0;me.isSolarCollector($t)&&(Bt=wi($t,$t.cx,$t.cy)),Bt?Eu.addUndoableMove():v(pn=>{const Pn=pn.elements.find(xt=>xt.id===$t.id);if(!Pn||!pn.selectedElement)return;const $e=pn.selectedElement;Pn.cx=$e.cx,Pn.cy=$e.cy,Pn.cz=$e.cz,Pn.rotation=[...$e.rotation],Pn.normal=[...$e.normal];const bt=ht.getState().oldParentId,Lt=ht.getState().oldFoundationId;bt&&(Pn.parentId=bt),Lt&&(Pn.foundationId=Lt)})}}ze(!1),We.current=null,v(Bt=>{Bt.resizeHandleType=null,Bt.moveHandleType=null})}},eo=m.useRef(null),Xn=m.useRef(null),Jo=m.useRef(!1),xo=m.useRef(!1),Qo=m.useRef(!1),jo=(un,$t,Bt)=>{let pn=Math.atan2($t.y-un.y,$t.x-un.x)-(Bt===vt.LowerLeft?Math.PI:0);return pn=pn>=0?pn:(la+pn)%la,pn},lr=(un,$t)=>{let pn=null,Pn=null,$e=1/0,bt=1/0;for(const[Lt,xt]of Ee.current)if(We.current!==null&&xt.id!==We.current.id&&xt.id!==$t){const jt=Math.abs(un.x-xt.leftPoint[0]),Kt=Math.abs(un.x-xt.rightPoint[0]),sn=Math.abs(un.y-xt.leftPoint[1]),yn=Math.abs(un.y-xt.rightPoint[1]);jt<1&&jt<$e&&($e=jt,pn=xt.leftPoint[0]),Kt<1&&Kt<$e&&($e=Kt,pn=xt.rightPoint[0]),sn<1&&sn{const $e=jo(un,$t,Bt);let bt=null,Lt=null;return $e<.05||$e>la-.05||Math.abs($e-Math.PI)<.05||Math.abs($t.y-un.y)<1?Lt=un.y:(Math.abs($e-Math.PI/2)<.05||Math.abs($e-3*Math.PI/2)<.05||Math.abs($t.x-un.x)<1)&&(bt=un.x),[bt,Lt]},ai=(un,$t,Bt,pn)=>{const[Pn,$e]=lr($t),[bt,Lt]=fr(un,$t,Bt),xt=hr($t.x,Pn,bt),jt=hr($t.y,$e,Lt);return new ie(xt,jt,$t.z)},hr=(un,$t,Bt)=>$t!==null&&Bt!==null?Math.abs($t-un){let[pn,Pn]=[1/0,1/0],$e=null,bt=null;for(const[Lt,xt]of Ee.current)if(We.current!==null&&xt.id!==We.current.id&&xt.id!==Bt){const jt=Math.abs(un.x-xt.leftPoint[0]),Kt=Math.abs(un.x-xt.rightPoint[0]);jt<.01&&jt{$e!==null&&bt!==null?(Lt[$t].direction="xy",Lt[$t].position=[$e,bt]):$e!==null?(Lt[$t].direction="y",Lt[$t].position=[$e,un.y]):bt!==null?(Lt[$t].direction="x",Lt[$t].position=[un.x,bt]):(Lt[$t].direction=null,Lt[$t].position=null)})),[$e!==null,bt!==null]},xi=(un,$t)=>Math.abs($t)<.01||Math.abs($t-Math.PI)<.01?(ye(Bt=>({...Bt,direction:"x",position:[un.x,un.y]})),[!0,!1]):Math.abs($t-Math.PI/2)<.01||Math.abs($t-3*Math.PI/2)<.01?(ye(Bt=>({...Bt,direction:"y",position:[un.x,un.y]})),[!1,!0]):(ye(Bt=>({...Bt,direction:null,position:null})),[!1,!1]),Eo=(un,$t)=>{pe(OP(Bt=>{Bt[0].show=un})),ye(Bt=>({...Bt,show:$t}))},bi=(un,$t)=>{const[Bt,pn]=tr(un),[Pn,$e]=xi(un,$t);Bt&&pn?Eo(!0,!1):Bt?Eo(!0,!$e&&Pn):pn?Eo(!0,!Pn&&$e):Eo(!1,Pn||$e)},hl=un=>{var $e,bt;if(!t||(qu(un),We.current&&me.isSolarCollector(We.current)))return;const $t=H.getState().objectTypeToAdd;if(!We.current&&!ve.current&&$t!==z.Wall||(($e=We.current)==null?void 0:$e.parentId)!==e&&$t===z.None)return;const Bt=H.getState().moveHandleType,pn=H.getState().resizeHandleType,Pn=H.getState().resizeAnchor;if(gn(un),Je.current){const Lt=kt.intersectObjects([Je.current]);if(Lt.length===0)return;let xt=Lt[0].point;if(We.current&&We.current.type&&!We.current.locked&&Lt.length>0)switch(ze(!0),We.current.type){case z.Sensor:case z.Light:case z.WindTurbine:{xt=me.relativeCoordinates(xt.x,xt.y,xt.z,t),T(We.current.id,xt.x,xt.y);break}case z.Polygon:{const jt=We.current;if(Bt===Ho.Default){xt=me.relativeCoordinates(xt.x,xt.y,xt.z,t);const Kt=me.calculatePolygonCentroid(jt.vertices),sn=xt.x-Kt.x,yn=xt.y-Kt.y,An=jt.vertices.map(bn=>({...bn}));An.forEach(bn=>{bn.x+=sn,bn.y+=yn}),j(jt.id,An)}else pn===vt.Default&&(xt.x-=t.cx,xt.y-=t.cy,xt.applyEuler(new nn().fromArray(t.rotation.map(Kt=>-Kt))),xt=H.getState().enableFineGrid?me.snapToFineGrid(xt):me.snapToNormalGrid(xt),xt.x/=t.lx,xt.y/=t.ly,W(jt.id,jt.selectedIndex,xt.x,xt.y));break}case z.Wall:{if(((bt=H.getState().selectedElement)==null?void 0:bt.type)!==z.Wall)break;if(pn&&(pn===vt.LowerLeft||pn===vt.LowerRight)){const jt=me.wallRelativePosition(Pn,t);xt=me.wallRelativePosition(xt,t);let Kt=null;H.getState().enableFineGrid?xt=me.snapToFineGrid(xt):(Kt=mo(xt,1.5),Kt!=null&&Kt.point?xt=Kt.point:(xt=me.snapToNormalGrid(xt),xt=ai(jt,xt,pn),Kt=mo(xt,1.5),Kt!=null&&Kt.point&&(xt=Kt.point)));const sn=jo(jt,xt,pn);bi(xt,sn);const yn=xt.distanceTo(jt),An=new ie().addVectors(xt,jt).divideScalar(2),bn=pn===vt.LowerLeft?xt:jt,Ln=pn===vt.LowerLeft?jt:xt;v(Wn=>{for(const oo of Wn.elements)if(oo.id===We.current.id&&oo.type===z.Wall){const qn=oo;qn.cx=An.x,qn.cy=An.y,qn.lx=yn,qn.relativeAngle=sn,qn.leftPoint=[bn.x,bn.y,0],qn.rightPoint=[Ln.x,Ln.y,0];break}});const Yn=C(We.current.id);if(Yn){if(Kt&&Kt.point){if(Kt.id&&Kt.side&&!Kt.jointId){const Wn=C(Kt.id);if(Wn){if(pn===vt.LowerLeft&&Wn.leftJoints.length===0&&Kt.side===G1.Left){if(Yn.leftJoints.length>0&&Yn.leftJoints[0]!==Kt.id){const oo=Yn.leftJoints[0];v(qn=>{for(const Ko of qn.elements)if(Ko.id===oo&&Ko.type===z.Wall){Ko.rightJoints=[];break}})}Rr(Yn,Wn)}else if(pn===vt.LowerRight&&Wn.rightJoints.length===0&&Kt.side===G1.Right){if(Yn.rightJoints.length>0&&Yn.rightJoints[0]!==Kt.id){const oo=Yn.rightJoints[0];v(qn=>{for(const Ko of qn.elements)if(Ko.id===oo&&Ko.type===z.Wall){Ko.leftJoints=[];break}})}ir(Yn,Wn)}else pn===vt.LowerRight&&Kt.side===G1.Left&&Wn.leftJoints.length===0&&Wn.rightJoints[0]!==Yn.id?v(oo=>{let qn=null;Yn.rightJoints.length>0&&Yn.rightJoints[0]!==(Kt==null?void 0:Kt.id)&&(qn=Yn.rightJoints[0]);for(const Ko of oo.elements)Ko.type===z.Wall&&(Ko.id===Yn.id&&(Ko.rightJoints=[Wn.id]),Ko.id===Wn.id&&(Ko.leftJoints=[Yn.id]),Ko.id===qn&&(Ko.leftJoints=[]))}):pn===vt.LowerLeft&&Kt.side===G1.Right&&Wn.rightJoints.length===0&&Wn.leftJoints[0]!==Yn.id&&v(oo=>{let qn=null;Yn.leftJoints.length>0&&Yn.leftJoints[0]!==(Kt==null?void 0:Kt.id)&&(qn=Yn.leftJoints[0]);for(const Ko of oo.elements)Ko.type===z.Wall&&(Ko.id===Yn.id&&(Ko.leftJoints=[Wn.id]),Ko.id===Wn.id&&(Ko.rightJoints=[Yn.id]),Ko.id===qn&&(Ko.rightJoints=[]))});br(Yn.id)}}}else if(pn===vt.LowerRight&&Yn.rightJoints.length>0){const Wn=Yn.rightJoints[0];v(oo=>{for(const qn of oo.elements)qn.type===z.Wall&&(qn.id===Yn.id&&(qn.rightJoints=[]),qn.id===Wn&&(qn.leftJoints=[]));oo.updateWallMapOnFoundationFlag=!oo.updateWallMapOnFoundationFlag})}else if(pn===vt.LowerLeft&&Yn.leftJoints.length>0){const Wn=Yn.leftJoints[0];v(oo=>{for(const qn of oo.elements)qn.type===z.Wall&&(qn.id===Yn.id&&(qn.leftJoints=[]),qn.id===Wn&&(qn.rightJoints=[]));oo.updateWallMapOnFoundationFlag=!oo.updateWallMapOnFoundationFlag})}}}else if(Bt){const jt=C(We.current.id);if(jt){xt=me.wallRelativePosition(xt,t);const Kt=new ie,sn=new nn(0,0,jt.relativeAngle);Bt===Ho.Lower?Kt.setY(rt):Bt===Ho.Upper&&Kt.setY(-rt-jt.ly),xt.add(Kt.applyEuler(sn));const yn=new ie().addVectors(xt,new ie(-jt.lx/2,0,0).applyEuler(sn)),An=new ie().addVectors(xt,new ie(jt.lx/2,0,0).applyEuler(sn));let bn=null,Ln=null,Yn=!1;Jo.current=!1,Qo.current=!1,xo.current=!1,eo.current=null,Xn.current=null;const Wn=(oo,qn)=>{const Ko=qn==="left"?yn:An,li=new ie().subVectors(oo,Ko);xt.add(li),yn.add(li),An.add(li)};if(!H.getState().enableFineGrid){let oo=mo(yn,1);oo.point?(Wn(oo.point,"left"),oo.id&&(!oo.jointId||oo.jointId===jt.id)&&(eo.current=oo.id,bn=oo.side===G1.Left)):eo.current=null;let qn=mo(An,1);if(qn.point?(oo.id||Wn(qn.point,"right"),qn.id&&(!qn.jointId||qn.jointId===jt.id)&&(oo.id!==qn.id||oo.side!==qn.side)&&(Xn.current=qn.id,Ln=qn.side===G1.Right)):Xn.current=null,!oo.point&&!qn.point){const[ya,Ps]=lr(yn),[$u,Qu]=lr(An);if(ya!==null||$u!==null){const Rh=(ya??1/0)-yn.x,Df=($u??1/0)-An.x,Zu=Math.min(Rh,Df);yn.setX(yn.x+Zu),An.setX(An.x+Zu),xt.setX(xt.x+Zu),oo=mo(yn,1),oo.point?(Wn(oo.point,"left"),oo.id&&(!oo.jointId||oo.jointId===jt.id)&&(eo.current=oo.id,bn=oo.side===G1.Left)):eo.current=null}if(Ps!==null||Qu!==null){const Rh=(Ps??1/0)-yn.y,Df=(Qu??1/0)-An.y,Zu=Math.min(Rh,Df);yn.setY(yn.y+Zu),An.setY(An.y+Zu),xt.setY(xt.y+Zu),qn=mo(An,1),qn.point?(oo.id||Wn(qn.point,"right"),qn.id&&(!qn.jointId||qn.jointId===jt.id)&&(oo.id!==qn.id||oo.side!==qn.side)&&(Xn.current=qn.id,Ln=qn.side===G1.Right)):Xn.current=null}}const[Ko,li]=tr(yn,0),[$i,Or]=tr(An,1);pe(OP(ya=>{ya[0].show=Ko||li,ya[1].show=$i||Or})),bn&&Ln===null||Ln&&bn===null||bn&&Ln?Jo.current=!0:(bn&&Ln===!1||Ln&&bn===!1)&&(Qo.current=bn,xo.current=Ln),oo.point&&qn.point&&(oo.id!==qn.id||oo.side!==qn.side)&&(yn.copy(oo.point),An.copy(qn.point),Yn=!0)}v(oo=>{var qn;for(const Ko of oo.elements)if(Ko.id===((qn=We.current)==null?void 0:qn.id)&&Ko.type===z.Wall){const li=Ko;if(Yn){li.cx=(yn.x+An.x)/2,li.cy=(yn.y+An.y)/2,li.lx=yn.distanceTo(An);let $i=Math.atan2(An.y-yn.y,An.x-yn.x);$i=$i>=0?$i:(la+$i)%la,li.relativeAngle=$i}else li.cx=xt.x,li.cy=xt.y;li.leftPoint=yn.toArray(),li.rightPoint=An.toArray();break}})}}break}}if($t===z.Wall&&!Ae.current){Me.current=[...H.getState().elements];const jt=U(t,xt);We.current=jt,ve.current=jt.id,Ae.current=!0,ze(!0),Fn.getState().setEnableOrbitController(!1),v(Kt=>{Kt.addedWallId=jt.id,Kt.objectTypeToAdd=z.None})}if(ve.current&&Ae.current){xt=me.wallRelativePosition(Lt[0].point,t);let jt=null;if(H.getState().enableFineGrid)xt=me.snapToFineGrid(xt);else if(jt=mo(xt,1.5),jt!=null&&jt.point)xt=jt.point;else{xt=me.snapToNormalGrid(xt);const[yn,An]=lr(xt);yn!==null&&xt.setX(yn),An!==null&&xt.setY(An),jt=mo(xt,1.5),jt!=null&&jt.point&&(xt=jt.point)}const[Kt,sn]=tr(xt);pe(OP(yn=>{yn[0].show=Kt||sn})),T(ve.current,xt.x,xt.y)}}},nr=un=>{un.intersections.length>0&&un.intersections[0].object===Je.current&&he(!0)},or=un=>{v($t=>{vx.selectMe($t,e,un,Oo.ContextMenu),$t.pastePoint.copy(un.intersections[0].point),$t.clickObjectType=z.Foundation,$t.pasteNormal=Io,un.altKey?$t.contextMenuObjectType=null:un.intersections.length>0&&un.intersections[0].object===Je.current&&($t.contextMenuObjectType=z.Foundation),$t.pasteNormal=Io})},Ai=()=>{Bl&&(Rc(!1),We.current=null),he(!1),ze(!1),We.current&&Ae.current&&(N(We.current.id,!1),Ae.current=!1,v(un=>{un.addedWallId=null,un.objectTypeToAdd=z.Wall}),We.current=null),ye({show:!1,direction:null,position:null}),pe([{show:!1,direction:null,position:null},{show:!1,direction:null,position:null}])},ka=un=>{We.current&&me.isPlantOrHuman(We.current)&&un.intersections[0].object===Je.current&&ze(!0)},wi=(un,$t,Bt)=>{const pn=JSON.parse(JSON.stringify(un));return pn.cx=$t,pn.cy=Bt,te(pn)?(po(Y.t("message.MoveCancelledBecauseOfOverlap",Ht)),!1):me.isSolarCollectorWithinHorizontalSurface(pn,t)?!0:(po(Y.t("message.MoveOutsideBoundaryCancelled",Ht)),!1)},Fs=(un,$t)=>{const Bt=JSON.parse(JSON.stringify(un));return Bt.relativeAzimuth=$t,te(Bt)?(po(Y.t("message.RotationCancelledBecauseOfOverlap",Ht)),!1):me.isSolarCollectorWithinHorizontalSurface(Bt,t)?!0:(po(Y.t("message.RotationOutsideBoundaryCancelled",Ht)),!1)},ks=(un,$t,Bt,pn,Pn)=>{if(un.type===z.SolarPanel&&un.tiltAngle!==0&&.5*Pn*Math.abs(Math.sin(un.tiltAngle))>un.poleHeight)return!1;const $e=JSON.parse(JSON.stringify(un));return $e.cx=$t,$e.cy=Bt,$e.lx=pn,$e.ly=Pn,me.isSolarCollectorWithinHorizontalSurface($e,t)},Zs=un=>{if(Ke.current&&t&&We.current&&t){if(!me.isSolarCollector(We.current))return;const $t=We.current;gn(un);const Bt=kt.intersectObjects([Ke.current]);if(Bt.length>0){let pn=Bt[0].point;const Pn=H.getState().moveHandleType,$e=H.getState().rotateHandleType,bt=H.getState().resizeHandleType;if(Pn&&t)pn=me.relativeCoordinates(pn.x,pn.y,pn.z,t),T($t.id,pn.x,pn.y),$t.parentId!==e&&H.getState().set(Lt=>{const xt=Lt.elements.find(jt=>jt.id===$t.id&&jt.type===z.SolarPanel);xt&&(xt.parentId!==e||xt.foundationId!==e)&&(xt.parentId=e,xt.foundationId=e,xt.parentType=z.Foundation,Lt.selectedElement&&(Lt.selectedElement.parentId=e,xt.color=Lt.selectedElement.color))});else if($e){if($e===Kr.Upper||$e===Kr.Lower){const Lt=t.rotation[2],xt=new Xt(t.cx,t.cy),jt=new Xt(t.lx*$t.cx,t.ly*$t.cy).rotateAround(si,Lt),Kt=new Xt().addVectors(jt,xt),sn=Math.atan2(-pn.x+Kt.x,pn.y-Kt.y)-Lt+($e===Kr.Lower?0:Math.PI),yn=Math.abs(sn)>Math.PI?-Math.sign(sn)*la:0,An=sn+yn;E($t.id,An),at.current=An}}else if(bt){const Lt=H.getState().resizeAnchor,xt=new Xt(pn.x,pn.y),jt=new Xt(Lt.x,Lt.y),Kt=xt.distanceTo(jt),sn=$t.relativeAzimuth+l[2],yn=new Xt().subVectors(xt,jt),An=new Xt(n,o);if($t.type===z.SolarPanel){const bn=$t,Ln=O(bn.pvModelName);switch(bt){case vt.Lower:case vt.Upper:{const Yn=bt===vt.Lower?1:-1,Wn=yn.angle()-sn+Yn*Gt;let oo=Kt*Math.cos(Wn);bn.orientation===vr.portrait?oo=Math.max(1,Math.ceil((oo-Ln.length/2)/Ln.length))*Ln.length:oo=Math.max(1,Math.ceil((oo-Ln.width/2)/Ln.width))*Ln.width;const qn=Lt.x+Yn*(oo*Math.sin(sn))/2,Ko=Lt.y-Yn*(oo*Math.cos(sn))/2,li=new Xt(qn,Ko),$i=new Xt().subVectors(li,An).rotateAround(si,-l[2]),Or=$i.x/r,ya=$i.y/i;ks($t,Or,ya,$t.lx,oo)&&(S($t.id,oo),T($t.id,Or,ya))}break;case vt.Left:case vt.Right:{const Yn=bt===vt.Left?-1:1,Wn=yn.angle()-sn+(bt===vt.Left?Math.PI:0);let oo=Kt*Math.cos(Wn);bn.orientation===vr.portrait?oo=Math.max(1,Math.ceil((oo-Ln.width/2)/Ln.width))*Ln.width:oo=Math.max(1,Math.ceil((oo-Ln.length/2)/Ln.length))*Ln.length;const qn=Lt.x+Yn*(oo*Math.cos(sn))/2,Ko=Lt.y+Yn*(oo*Math.sin(sn))/2,li=new Xt(qn,Ko),$i=new Xt().subVectors(li,An).rotateAround(si,-l[2]),Or=$i.x/r,ya=$i.y/i;ks($t,Or,ya,oo,$t.ly)&&(x($t.id,oo),T($t.id,Or,ya))}break}}else if($t.type===z.ParabolicTrough){const bn=$t;switch(bt){case vt.Lower:case vt.Upper:{const Ln=bt===vt.Lower?1:-1,Yn=yn.angle()-sn+Ln*Gt;let Wn=Kt*Math.cos(Yn);Wn=Math.max(1,Math.ceil((Wn-bn.moduleLength/2)/bn.moduleLength))*bn.moduleLength;const qn=Lt.x+Ln*(Wn*Math.sin(sn))/2,Ko=Lt.y-Ln*(Wn*Math.cos(sn))/2,li=new Xt(qn,Ko),$i=new Xt().subVectors(li,An).rotateAround(si,-l[2]),Or=$i.x/r,ya=$i.y/i;ks($t,Or,ya,$t.lx,Wn)&&(S($t.id,Wn),T($t.id,Or,ya))}break;case vt.Left:case vt.Right:{const Ln=bt===vt.Left?-1:1,Yn=yn.angle()-sn+(bt===vt.Left?Math.PI:0),Wn=Kt*Math.cos(Yn),oo=Lt.x+Ln*(Wn*Math.cos(sn))/2,qn=Lt.y+Ln*(Wn*Math.sin(sn))/2,Ko=new Xt(oo,qn),li=new Xt().subVectors(Ko,An).rotateAround(si,-l[2]),$i=li.x/r,Or=li.y/i;ks($t,$i,Or,Wn,$t.ly)&&(x($t.id,Wn),T($t.id,$i,Or),v(ya=>{ya.actionState.parabolicTroughWidth=Wn}))}break}}else if($t.type===z.FresnelReflector){const bn=$t;switch(bt){case vt.Lower:case vt.Upper:{const Ln=bt===vt.Lower?1:-1,Yn=yn.angle()-sn+Ln*Gt;let Wn=Kt*Math.cos(Yn);Wn=Math.max(1,Math.ceil((Wn-bn.moduleLength/2)/bn.moduleLength))*bn.moduleLength;const qn=Lt.x+Ln*(Wn*Math.sin(sn))/2,Ko=Lt.y-Ln*(Wn*Math.cos(sn))/2,li=new Xt(qn,Ko),$i=new Xt().subVectors(li,An).rotateAround(si,-l[2]),Or=$i.x/r,ya=$i.y/i;ks($t,Or,ya,$t.lx,Wn)&&(S($t.id,Wn),T($t.id,Or,ya))}break;case vt.Left:case vt.Right:{const Ln=bt===vt.Left?-1:1,Yn=yn.angle()-sn+(bt===vt.Left?Math.PI:0),Wn=Kt*Math.cos(Yn),oo=Lt.x+Ln*(Wn*Math.cos(sn))/2,qn=Lt.y+Ln*(Wn*Math.sin(sn))/2,Ko=new Xt(oo,qn),li=new Xt().subVectors(Ko,An).rotateAround(si,-l[2]),$i=li.x/r,Or=li.y/i;ks($t,$i,Or,Wn,$t.ly)&&(x($t.id,Wn),T($t.id,$i,Or),v(ya=>{ya.actionState.fresnelReflectorWidth=Wn}))}break}}else if($t.type===z.ParabolicDish){const bn=$t;switch(bt){case vt.Left:case vt.Right:case vt.Lower:case vt.Upper:{const Ln=Math.min(10,Kt);ks($t,bn.cx,bn.cy,$t.lx,Ln)&&(x($t.id,Ln),S($t.id,Ln),v(Yn=>{Yn.actionState.parabolicDishRimDiameter=Ln}));break}}}}}}},{transparent:Ui,opacity:fa}=QH();m.useEffect(()=>{Je.current&&(Je.current.material[4].needsUpdate=!0)},[Ui]);const[Bl,Gl]=m.useState(!1),qu=un=>{const $t=Eu.getIntersectionObjects(un);if($t.length==0||$t[0].eventObject.userData.id!==e){Bl&&(Rc(!1),We.current=null,ze(!1));return}const Bt=H.getState().selectedElement;!Bl&&Bt&&!Bt.locked&&Bt.type===z.SolarPanel&&H.getState().moveHandleType&&(Rc(!0,Bt.poleHeight),We.current=Bt,ze(!0))},Rc=(un,$t)=>{un&&$t!==void 0?(Gl(!0),tn.setZ($t)):(Gl(!1),tn.setZ(0))},mu=()=>Bl?!0:We.current&&me.isSolarCollector(We.current)&&!We.current.locked;return m.useEffect(()=>{const un=()=>{We.current&&Ae.current&&N(We.current.id,!1)};return window.addEventListener("beforeunload",un),()=>{window.removeEventListener("beforeunload",un)}},[]),h.jsx(h.Fragment,{children:h.jsxs("group",{ref:Be,name:`${P2} ${e}`,position:[n,o,Ct],rotation:[0,0,l[2]],userData:{id:e,fId:e},children:[h.jsx(_ye,{parentId:e,foundationId:e,wrapperType:z.Foundation,plx:r,ply:i,plz:a}),h.jsx(KZt,{foundationId:e,wrapperType:z.Foundation}),h.jsxs(Qr,{castShadow:X,receiveShadow:X,uuid:e,userData:{simulation:!0,stand:!0,id:e,aabb:!0},ref:Je,name:cX,args:[r,i,a],onContextMenu:or,onPointerOver:nr,onPointerDown:ar,onPointerUp:No,onPointerMove:L2.throttle(hl,VF,{trailing:!1}),onPointerOut:Ai,onPointerEnter:ka,children:[h.jsx("meshStandardMaterial",{attach:"material-0",color:s}),h.jsx("meshStandardMaterial",{attach:"material-1",color:s}),h.jsx("meshStandardMaterial",{attach:"material-2",color:s}),h.jsx("meshStandardMaterial",{attach:"material-3",color:s}),ae&&xe?h.jsx("meshBasicMaterial",{attach:"material-4",color:"white",map:xe,transparent:Ui,opacity:fa}):h.jsx("meshStandardMaterial",{attach:"material-4",color:p===Yi.NoTexture?s:"white",map:Hn,transparent:Ui,opacity:fa}),h.jsx("meshStandardMaterial",{attach:"material-5",color:s})]}),mu()&&h.jsx(ua,{ref:Ke,name:"Foundation Intersection Plane",position:tn,args:[r,i],visible:!1,onPointerMove:L2.throttle(Zs,VF)}),Se&&h.jsxs(h.Fragment,{children:[H.getState().rotateHandleType&&We.current&&me.isSolarCollector(We.current)&&h.jsx(Uye,{element:We.current,height:We.current.poleHeight+Ct}),(H.getState().moveHandleType||H.getState().resizeHandleType||ve.current)&&h.jsx(Xge,{hx:gt,hy:dt,hz:Ct})]}),y&&h.jsx(jye,{element:t,verticalLift:mt}),(!y||$)&&h.jsx(fw,{hx:gt,hy:dt,hz:Ct,lineColor:$&&b?"white":c,lineWidth:$&&b?u*3:u}),y&&d&&h.jsx(fw,{hx:gt,hy:dt,hz:Ct,lineColor:y0,lineWidth:u*5}),Ie.show&&h.jsx("group",{position:[0,0,Ct+.01],children:h.jsx(FSe,{hx:gt,hy:dt,position:Ie.position,direction:Ie.direction,color:"black"})}),h.jsx("group",{position:[0,0,Ct+.01],children:ce.map((un,$t)=>un.show?h.jsx(FSe,{hx:gt,hy:dt,position:un.position,direction:un.direction,color:"yellow"},$t):null)}),y&&!d&&h.jsxs(h.Fragment,{children:[h.jsx(Qr,{ref:Ne,position:[tt.x,tt.y,0],args:[Qe,Qe,a*1.2],name:vt.LowerLeft,onPointerDown:un=>{F(e,un,Oo.Resize),Ne.current&&v($t=>{const Bt=Ne.current.localToWorld(new ie(r,i,0));$t.resizeAnchor.copy(Bt)})},onPointerOver:un=>{yo(un,vt.LowerLeft)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===vt.LowerLeft||H.getState().resizeHandleType===vt.LowerLeft?ta:Da})}),h.jsx(Qr,{ref:De,position:[Fe.x,Fe.y,0],args:[Qe,Qe,a*1.2],name:vt.UpperLeft,onPointerDown:un=>{F(e,un,Oo.Resize),De.current&&v($t=>{const Bt=De.current.localToWorld(new ie(r,-i,0));$t.resizeAnchor.copy(Bt)})},onPointerOver:un=>{yo(un,vt.UpperLeft)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===vt.UpperLeft||H.getState().resizeHandleType===vt.UpperLeft?ta:Da})}),h.jsx(Qr,{ref:ke,position:[qe.x,qe.y,0],args:[Qe,Qe,a*1.2],name:vt.LowerRight,onPointerDown:un=>{F(e,un,Oo.Resize),ke.current&&v($t=>{const Bt=ke.current.localToWorld(new ie(-r,i,0));$t.resizeAnchor.copy(Bt)})},onPointerOver:un=>{yo(un,vt.LowerRight)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===vt.LowerRight||H.getState().resizeHandleType===vt.LowerRight?ta:Da})}),h.jsx(Qr,{ref:Ye,position:[je.x,je.y,0],args:[Qe,Qe,a*1.2],name:vt.UpperRight,onPointerDown:un=>{F(e,un,Oo.Resize),Ye.current&&v($t=>{const Bt=Ye.current.localToWorld(new ie(-r,-i,0));$t.resizeAnchor.copy(Bt)})},onPointerOver:un=>{yo(un,vt.UpperRight)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===vt.UpperRight||H.getState().resizeHandleType===vt.UpperRight?ta:Da})}),!Q&&h.jsxs(h.Fragment,{children:[h.jsx(ds,{ref:it,args:[mt,6,6,0,Math.PI],position:[0,-dt-mt,0],name:Ho.Lower,onPointerDown:()=>{v(un=>{un.moveHandleType=Ho.Lower,un.selectedElement=un.elements.find($t=>$t.id===e)??null;for(const $t of un.elements)un.selectedElementIdSet.has($t.id)&&!me.isElementAllowedMultipleMoveOnGround($t)&&un.selectedElementIdSet.delete($t.id)}),Fn.getState().setEnableOrbitController(!1)},onPointerOver:un=>{yo(un,Ho.Lower)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===Ho.Lower||H.getState().moveHandleType===Ho.Lower?ta:XF})}),h.jsx(ds,{ref:Ve,args:[mt,6,6,0,Math.PI],position:[0,dt+mt,0],name:Ho.Upper,onPointerDown:()=>{v(un=>{un.moveHandleType=Ho.Upper,un.selectedElement=un.elements.find($t=>$t.id===e)??null;for(const $t of un.elements)un.selectedElementIdSet.has($t.id)&&!me.isElementAllowedMultipleMoveOnGround($t)&&un.selectedElementIdSet.delete($t.id)}),Fn.getState().setEnableOrbitController(!1)},onPointerOver:un=>{yo(un,Ho.Upper)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===Ho.Upper||H.getState().moveHandleType===Ho.Upper?ta:XF})}),h.jsx(ds,{ref:yt,args:[mt,6,6,0,Math.PI],position:[-gt-mt,0,0],name:Ho.Left,onPointerDown:()=>{v(un=>{un.moveHandleType=Ho.Left,un.selectedElement=un.elements.find($t=>$t.id===e)??null;for(const $t of un.elements)un.selectedElementIdSet.has($t.id)&&!me.isElementAllowedMultipleMoveOnGround($t)&&un.selectedElementIdSet.delete($t.id)}),Fn.getState().setEnableOrbitController(!1)},onPointerOver:un=>{yo(un,Ho.Left)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===Ho.Left||H.getState().moveHandleType===Ho.Left?ta:tw})}),h.jsx(ds,{ref:ct,args:[mt,6,6,0,Math.PI],position:[gt+mt,0,0],name:Ho.Right,onPointerDown:()=>{v(un=>{un.moveHandleType=Ho.Right,un.selectedElement=un.elements.find($t=>$t.id===e)??null;for(const $t of un.elements)un.selectedElementIdSet.has($t.id)&&!me.isElementAllowedMultipleMoveOnGround($t)&&un.selectedElementIdSet.delete($t.id)}),Fn.getState().setEnableOrbitController(!1)},onPointerOver:un=>{yo(un,Ho.Right)},onPointerOut:So,children:h.jsx("meshBasicMaterial",{attach:"material",color:re===Ho.Right||H.getState().moveHandleType===Ho.Right?ta:tw})}),h.jsx(PR,{id:e,position:[0,-Dt,0],color:re===Kr.Lower||H.getState().rotateHandleType===Kr.Lower?ta:Da,ratio:Tt,handleType:Kr.Lower,hoverHandle:yo,noHoverHandle:So}),h.jsx(PR,{id:e,position:[0,Dt,0],color:re===Kr.Upper||H.getState().rotateHandleType===Kr.Upper?ta:Da,ratio:Tt,handleType:Kr.Upper,hoverHandle:yo,noHoverHandle:So})]})]}),!Q&&h.jsxs(h.Fragment,{children:[(Z||f)&&!y&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",text:(t!=null&&t.label?t.label:Y.t("shared.FoundationElement",Ht))+(d?" ("+Y.t("shared.ElementLocked",Ht)+")":""),color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,fontFace:"Roboto",textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,(t==null?void 0:t.labelHeight)??Ct+.2]}),!d&&re===vt.LowerLeft&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label-LL",text:"LL",fontSize:20,fontFace:"Times Roman",textHeight:.2,position:[-gt,-dt,Ct+.2]}),!d&&re===vt.UpperLeft&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label-UL",text:"UL",fontSize:20,fontFace:"Times Roman",textHeight:.2,position:[-gt,dt,Ct+.2]}),!d&&re===vt.LowerRight&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label-LR",text:"LR",fontSize:20,fontFace:"Times Roman",textHeight:.2,position:[gt,-dt,Ct+.2]}),!d&&re===vt.UpperRight&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label-UR",text:"UR",fontSize:20,fontFace:"Times Roman",textHeight:.2,position:[gt,dt,Ct+.2]})]}),g===Dn.FocusPipe&&h.jsx(tZt,{foundation:t}),g===Dn.FocusTower&&h.jsx(eZt,{foundation:t}),g===Dn.UpdraftTower&&h.jsx(ZQt,{foundation:t}),h.jsx(GZt,{...t})]})})}),Vye="Handles Intersection Plane",Vz=t=>{if(t.intersections.length>0){for(const e of t.intersections)if(e.eventObject.name===Vye)return e.point.z<0?null:e.point}return null},J7=(t,e)=>new ie().subVectors(t,new ie(e.cx,e.cy,e.lz)).applyEuler(new nn(0,0,-e.rotation[2])),F$e=(t,e,n,o,r)=>{const[i,a]=[e/2,n/2],[l,s,c]=o,u=new nn().fromArray([l-Gt,s,c,"ZXY"]),d=r.map(f=>({x:f.x,y:f.y}));for(let f=-1;f<=1;f+=2)for(let p=-1;p<=1;p+=2){const g=new ie(i*f,0,a*p).applyEuler(u),y=new ie().addVectors(t,g);if(!me.isPointInside(y.x,y.y,d))return!1}return!0},$Zt=(t,e,n,o,r,i,a)=>{const l=n/2,[s,c,u]=i,d=new nn().fromArray([s-Gt,c,u,"ZXY"]),f=a.map(g=>({x:g.x,y:g.y})),p=new ie().addVectors(t,new ie(o*e,0,l+r).applyEuler(d));return!(!me.isPointInside(p.x,p.y,f)||!F$e(t,e,n,i,a))},QZt=(t,e,n)=>{if(t.intersections.length>0)for(const o of t.intersections){const r=o.eventObject.name;if(r.includes("Window")&&r.includes(e)&&o.object.name!==Vye)return null;if(r.includes("Roof")&&r.includes(n)){const i=o.point.clone(),a=Number.parseInt(o.object.name.split(" ").pop()??"-1");return{pointer:i,segmentIdx:a}}}return null},WSe=t=>{switch(t){case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:return!0}return!1},ZZt=(t,e,n)=>{const o=new ie().subVectors(e,t).applyEuler(new nn(0,0,-n)),r=Math.abs(o.x),i=Math.hypot(o.y,o.z),a=new ie().addVectors(t,e).divideScalar(2);return{newLx:r,newLz:i,newCenter:a}},een=(t,e,n)=>n===Go.Gambrel?Nye(t).map(o=>o.add(e)):t.map(o=>o.points[0].clone().add(e)),NSe=(t,e,n)=>{H.getState().set(o=>{const r=o.elements.find(i=>i.id===t&&i.type===z.Window);r&&([r.cx,r.cy,r.cz]=e,r.rotation=[...n])})},USe=(t,e,n,o)=>{H.getState().set(r=>{const i=r.elements.find(a=>a.id===t&&a.type===z.Window);i&&([i.cx,i.cy,i.cz]=e,[i.lx,i.ly,i.lz]=n,o!=null&&(i.archHeight=o))})},jSe=(t,e)=>{H.getState().set(n=>{const o=n.elements.find(r=>r.id===t&&r.type===z.Window);o&&(o.polygonTop=[...e])})},ten=(t,e,n=.01)=>{if(t.type!==z.SolarPanel&&t.type!==z.Window)return null;const o=new nn().fromArray([t.rotation[0],t.rotation[1],t.rotation[2],"ZXY"]),r=new ie,i=t.lx/2+n;let a=n;t.type===z.SolarPanel?(a+=t.ly/2,r.set(t.cx*e.lx,t.cy*e.ly,0)):(a+=t.lz/2,r.set(t.cx,t.cy,0));const l=[];for(let s=-1;s<=1;s+=2)for(let c=-1;c<=1;c+=2){const u=new ie(s*i,s*c*a).applyEuler(o).add(r);l.push(u)}if(t.type===z.Window&&t.windowType===Ti.Polygonal){const[s,c]=t.polygonTop??Gp,u=new ie(s*i,c+a).applyEuler(o).add(r);l.push(u)}return l},Kie=t=>{if(t.windowType===Ti.Polygonal)return t.polygonTop??Gp},k$e=({z:t})=>{const e=m.useRef(null),[n,o]=m.useState("white");return h.jsx(Qr,{ref:e,name:vt.Arch,args:[.2,.2,.2],position:[0,0,t],onPointerEnter:()=>{o("red")},onPointerLeave:()=>{o("white")},children:h.jsx("meshBasicMaterial",{color:n})})},nen=({id:t,parentId:e,foundationId:n,lx:o,lz:r,polygonTop:i,rotation:a,windowType:l,parentType:s})=>{const c=H(se=>se.addedWindowId),u=H(En),d=c===t,f=s===z.Roof,p=m.useRef(null),g=m.useRef(null),y=m.useRef(null),w=m.useRef(null),b=m.useRef(null),C=m.useRef(null),P=m.useRef(null),v=m.useRef(null),T=m.useRef([]),A=m.useRef(null),x=m.useRef(null),S=m.useRef(null),R=m.useRef(null),M=m.useRef(null),[D,E]=m.useState(!1),[W,j]=[o/2,r/2],[L,k]=i,N=m.useMemo(()=>o*L,[o,L]),F=H(fn),U=(se,ne,fe)=>{if(!n)return null;const ge=H.getState().elements.find(ze=>ze.id===n&&ze.type===z.Foundation);if(!ge)return null;const de=se.object.localToWorld(new ie),[Z,he,xe]=a,He=new nn().fromArray([Z-Gt,he,xe+ge.rotation[2],"ZXY"]),Se=new ie(ne,0,fe).applyEuler(He);return new ie().addVectors(de,Se)},O=se=>{let ne,fe,ge;for(const pe of H.getState().elements)pe.id===t&&pe.type===z.Window?ne=pe:pe.id===n&&pe.type===z.Foundation?fe=pe:pe.id===e&&pe.type===z.Roof&&(ge=pe);const de=Fn.getState().contentRef;if(!ne||!fe||!ge||!de||!de.current)return;const Z=fe.id,he=de.current.children.find(pe=>pe.name===`${P2} ${Z}`);if(!he)return;const xe=he.children.find(pe=>pe.name===D$e);if(!xe)return;const He=xe.children.find(pe=>pe.name.includes("Roof")&&pe.name.includes(e));if(!He)return;const Se=He.children[0];if(!Se)return;for(const pe of H.getState().elements)if(pe.parentId===e&&pe.id!==t){const ve=ten(pe,fe);ve&&T.current.push(ve)}const{centroid:ze,roofSegments:Ie}=Se.userData,ce=new ie(ne.cx,ne.cy,ne.cz+fe.lz).clone().sub(ze);p.current=se,g.current=fe,y.current=ge,C.current=Cn.getSegmentIdx(Ie,ce),b.current=ze,w.current=Ie,v.current=een(w.current,b.current,ge.roofType),A.current=[ne.cx,ne.cy,ne.cz],S.current=[ne.lx,ne.ly,ne.lz],x.current=[...ne.rotation],R.current=ne.archHeight,M.current=ne.polygonTop??null},B=()=>{if(!A.current||!x.current)return;const se=H.getState().elements.find(fe=>fe.id===t&&fe.type===z.Window);if(!se)return;const ne={name:"Move skylight",timestamp:Date.now(),id:se.id,oldPosition:[...A.current],newPosition:[se.cx,se.cy,se.cz],oldRotation:[...x.current],newRotation:[...se.rotation],undo(){NSe(ne.id,ne.oldPosition,ne.oldRotation)},redo(){NSe(ne.id,ne.newPosition,ne.newRotation)}};u(ne)},_=()=>{if(!S.current||!A.current)return;const se=H.getState().elements.find(fe=>fe.id===t&&fe.type===z.Window);if(!se)return;const ne={name:"Resize skylight",timestamp:Date.now(),id:se.id,oldPosition:[...A.current],newPosition:[se.cx,se.cy,se.cz],oldDimension:[...S.current],newDimension:[se.lx,se.ly,se.lz],oldArchHeight:R.current,newArchHeight:se.archHeight,undo(){USe(this.id,this.oldPosition,this.oldDimension,this.oldArchHeight)},redo(){USe(this.id,this.newPosition,this.newDimension,this.newArchHeight)}};u(ne)},X=()=>{if(!M.current)return;const se=H.getState().elements.find(fe=>fe.id===t&&fe.type===z.Window);if(!se)return;const ne={name:"Resize skylight top vertex",timestamp:Date.now(),id:se.id,oldPolygonTop:[...M.current],newPolygonTop:se.polygonTop??Gp,undo(){jSe(this.id,this.oldPolygonTop)},redo(){jSe(this.id,this.newPolygonTop)}};u(ne)},$=se=>se.roofType===Go.Gable?!1:Math.abs(se.rise)<.001,Q=se=>{if(y.current&&$(y.current))return v.current;if(se!=null){const fe=Tn.getState().getRoofSegmentVertices(e);if(!fe)return;const ge=se===-1?fe.length-1:se;return fe[ge]}},le=(se,ne,fe,ge,de)=>{const[Z,he]=[ne/2,fe/2],xe=new nn().fromArray([ge[0],ge[1],ge[2],"ZXY"]),He=[];for(let Se=-1;Se<=1;Se+=2)for(let ze=-1;ze<=1;ze+=2){const Ie=new ie(Se*Z,Se*ze*he).applyEuler(xe).add(se);He.push(Ie)}if(de){const[Se,ze]=de,Ie=new ie(Se*Z*2,ze+he).applyEuler(xe).add(se);He.push(Ie)}for(const Se of T.current){for(const ze of He)if(me.isPointInside(ze.x,ze.y,Se))return!1;for(const ze of Se)if(me.isPointInside(ze.x,ze.y,He))return!1}return!0},q=(se,ne,fe,ge,de,Z)=>{if(Z){const[he,xe]=Z;return $Zt(ne,fe,ge,he,xe,de,se)}else return F$e(ne,fe,ge,de,se)},te=se=>{if(!f||d)return;const ne=se.object.name;switch(ne){case Ho.Mid:break;case vt.LowerLeft:{P.current=U(se,o,r);break}case vt.LowerRight:{P.current=U(se,-o,r);break}case vt.UpperLeft:{P.current=U(se,o,-r);break}case vt.UpperRight:{P.current=U(se,-o,-r);break}case vt.Arch:{P.current=U(se,0,-r);break}case vt.Upper:break;default:return}O(ne),E(!0),Fn.getState().setEnableOrbitController(!1)},re=se=>{if(p.current===null||!g.current||!y.current||!w.current||!b.current||!v.current)return;const ne=g.current;if(p.current===Ho.Mid){const fe=y.current,ge=QZt(se,t,e),de=new ie;if($(fe)){const Z=Vz(se);if(!Z)return;de.copy(Z);const he=J7(de,ne);F(xe=>{if(!v.current)return;const He=xe.elements.find(Ae=>Ae.id===t&&Ae.type===z.Window);if(!He)return;const{lx:Se,lz:ze,rotation:Ie}=He,ye=v.current,ce=Kie(He),pe=q(ye,he,Se,ze,Ie,ce),ve=le(he,Se,ze,Ie,ce);pe&&ve&&(He.cx=he.x,He.cy=he.y,He.cz=he.z)})}else{if(ge&&ge.segmentIdx!==C.current){const ze=ge.pointer;de.copy(ze)}else{const ze=Vz(se);if(!ze)return;de.copy(ze)}const Z=J7(de,ne),he=Z.clone().sub(b.current),{rotation:xe,segmentVertices:He,segmentIdx:Se}=Cn.computeState(w.current,he);He?Z.setZ(Cn.getRooftopElementZ(He,he,b.current.z+fe.thickness)):Z.setZ(b.current.z+fe.thickness),F(ze=>{const Ie=Tn.getState().getRoofSegmentVertices(e);if(!Ie)return;const ye=Se===-1?Ie.length-1:Se,ce=Ie[ye];if(!ce)return;const pe=ze.elements.find(Ee=>Ee.id===t&&Ee.type===z.Window);if(!pe)return;const{lx:ve,lz:Ae}=pe,Te=Kie(pe),Me=q(ce,Z,ve,Ae,xe,Te),Pe=le(Z,ve,Ae,xe,Te);Me&&Pe&&(pe.cx=Z.x,pe.cy=Z.y,pe.cz=Z.z,pe.rotation=[...xe],ge&&ge.segmentIdx!==C.current&&(C.current=ge.segmentIdx))})}}else if(WSe(p.current)){const fe=Q(C.current),ge=Vz(se),de=P.current;if(!ge||!de||!fe)return;const Z=J7(ge,ne),he=J7(de,ne),{newLx:xe,newLz:He,newCenter:Se}=ZZt(he,Z,a[2]);H.getState().set(ze=>{const Ie=ze.elements.find(ve=>ve.id===t&&ve.type===z.Window);if(!Ie)return;const ye=Kie(Ie),ce=q(fe,Se,xe,He,a,ye),pe=le(Se,xe,He,a,ye);ce&&pe&&(Ie.cx=Se.x,Ie.cy=Se.y,Ie.cz=Se.z,Ie.lx=xe,Ie.lz=Math.max(.001,He))})}else if(p.current===vt.Upper){const fe=Q(C.current),ge=Vz(se);if(!ge||!fe)return;const de=J7(ge,ne);F(Z=>{const he=Z.elements.find(De=>De.id===t);if(!he)return;const[xe,He]=[he.lx/2,he.lz/2],Se=new ie(he.cx,he.cy,he.cz),ze=new nn().fromArray([he.rotation[0],he.rotation[1],he.rotation[2],"ZXY"]),Ie=new ie(-xe,-He,0).applyEuler(ze).add(Se),ye=new ie(xe,-He,0).applyEuler(ze).add(Se),ce=new ie().subVectors(de,Ie),pe=new ie().subVectors(ye,Ie).normalize(),ve=ce.clone().projectOnVector(pe).applyEuler(new nn(0,0,-he.rotation[2])),Ae=me.clamp((ve.x-xe)/he.lx,-.5,.5),Te=Cn.getDistance(Ie,ye,de),Me=Math.hypot(Te,de.z-Ie.z),Pe=Math.max(0,Me-he.lz),Ee=[Ae,Pe],Be=new ie(he.cx,he.cy,he.cz),{lx:Je,lz:We}=he,Ke=q(fe,Be,Je,We,a,Ee),Ne=le(Be,Je,We,a,Ee);Ke&&Ne&&(he.polygonTop=[...Ee])})}else if(p.current===vt.Arch){const fe=Vz(se),ge=P.current,de=Q(C.current);if(!fe||!ge||!de)return;const Z=J7(fe,ne),he=J7(ge,ne);F(xe=>{const He=xe.elements.find(Pe=>Pe.id===t&&Pe.type===z.Window);if(!He)return;const[Se,ze]=[He.lx/2,He.lz/2],Ie=new ie(He.cx,He.cy,He.cz),ye=new nn().fromArray([He.rotation[0],He.rotation[1],He.rotation[2],"ZXY"]),ce=new ie(-Se,-ze,0).applyEuler(ye).add(Ie),pe=new ie(Se,-ze,0).applyEuler(ye).add(Ie),ve=Cn.getDistance(ce,pe,Z);let Ae=Math.hypot(ve,Z.z-ce.z);const Te=Math.min(He.archHeight,He.lz,He.lx/2),Me=He.lz-Te;if(Ae>Me&&Ae{p.current===Ho.Mid?B():WSe(p.current)?_():p.current===vt.Upper?X():p.current===vt.Arch&&_(),A.current=null,S.current=null,x.current=null,R.current=null,M.current=null,p.current=null,g.current=null,y.current=null,w.current=null,b.current=null,C.current=null,P.current=null,v.current=null,T.current=[],E(!1),Fn.getState().setEnableOrbitController(!0)};return h.jsxs(h.Fragment,{children:[h.jsxs("group",{name:"Handle Wrapper",onPointerDown:te,children:[!d&&h.jsxs(h.Fragment,{children:[l===Ti.Polygonal&&h.jsx(wv,{x:N,z:j+k,handleType:vt.Upper,scale:[.5,1,1.5]}),h.jsx(wv,{x:-W,z:j,handleType:vt.UpperLeft}),h.jsx(wv,{x:W,z:j,handleType:vt.UpperRight}),h.jsx(wv,{x:-W,z:-j,handleType:vt.LowerLeft}),h.jsx(wv,{x:W,z:-j,handleType:vt.LowerRight}),l===Ti.Arched&&h.jsx(k$e,{z:j})]}),h.jsx(yxt,{handleType:Ho.Mid})]}),f&&D&&h.jsx(ua,{name:Vye,args:[1e3,1e3],rotation:[Gt,0,0],onPointerMove:re,onPointerUp:ae,visible:!1,children:h.jsx("meshBasicMaterial",{color:"red",side:$r,transparent:!0,opacity:.5})})]})},oen=be.memo(nen),ren=new mf({color:"white",side:$r}),ien=be.memo(({dimension:t,mullionData:e,shadowEnabled:n})=>{const[o,r,i]=t,{width:a,horizontalMullionSpacing:l,verticalMullionSpacing:s,color:c}=e,u=3,d=1,f=a/2,p=m.useMemo(()=>h.jsx("meshStandardMaterial",{color:c}),[c]),g=m.useMemo(()=>{const w=[],b=Math.round(o/s)-1;if(b<=0||a===0)return w;const C=o/(b+1);let P=C/2;b%2!==0&&(w.push(0),P=C);for(let v=0;v{const w=[],b=Math.round(i/l)-1;if(b<=0||a===0)return w;const C=i/(b+1);let P=C/2;b%2!==0&&(w.push(0),P=C);for(let v=0;vh.jsx(ca,{position:[w,25e-5,0],args:[f,f,i,u,d],rotation:[Gt,Gt,0],receiveShadow:n,castShadow:n,children:p},b)),e.horizontalMullion&&y.map((w,b)=>h.jsx(ca,{position:[0,5e-4,w],args:[f,f,o,u,d],rotation:[0,0,Gt],receiveShadow:n,castShadow:n,children:p},b))]})}),aen=be.memo(({dimension:t,frameData:e,shadowEnabled:n})=>{const[o,r,i]=t,{color:a,width:l,sillWidth:s}=e,c=m.useMemo(()=>h.jsx("meshStandardMaterial",{color:a}),[a]),u=l/2,d=u/2,f=o+l*3,p=l;return h.jsxs("group",{name:"Window Frame Group",position:[0,-d/2,0],children:[h.jsx(Qr,{position:[0,0,i/2],args:[o+2*l,d,l],castShadow:n,receiveShadow:n,children:c}),h.jsx(Qr,{position:[-o/2-u,0,0],args:[l,d,i],castShadow:n,receiveShadow:n,children:c}),h.jsx(Qr,{position:[o/2+u,0,0],args:[l,d,i],castShadow:n,receiveShadow:n,children:c}),h.jsx(Qr,{position:[0,0,-i/2-(s===0?0:p/2)],args:s===0?[o+2*l,d,l]:[f,s??l,p],castShadow:n,receiveShadow:n,children:c})]})}),len=be.memo(({cy:t,dimension:e,wireframeData:n})=>{const[o,r,i]=e,{lineWidth:a,lineColor:l,selected:s,locked:c,opacity:u}=n,d=o/2,f=i/2,p=3,g=1,y=m.useMemo(()=>new mf({color:l}),[l]),w=m.useMemo(()=>new mf({color:y0}),[]),b=(C,P)=>{const v=C/2;return h.jsxs(h.Fragment,{children:[h.jsx(ca,{args:[C,C,o,p,g],rotation:[0,0,Gt],position:[0,0,f-v],material:P}),h.jsx(ca,{args:[C,C,o,p,g],rotation:[0,0,Gt],position:[0,0,-f+v],material:P}),h.jsx(ca,{args:[C,C,i,p,g],rotation:[Gt,Gt,0],position:[d-v,0,0],material:P}),h.jsx(ca,{args:[C,C,i,p,g],rotation:[Gt,Gt,0],position:[-d+v,0,0],material:P})]})};return h.jsxs("group",{name:"Window Wireframe Group",children:[u>0&&h.jsx("group",{position:[0,t,0],children:b(a/20,y)}),c&&s&&b(a/5,w)]})}),sen=({id:t,dimension:e,position:n,mullionData:o,frameData:r,wireframeData:i,leftShutter:a,rightShutter:l,shutterColor:s,shutterWidth:c,glassMaterial:u,showHeatFluxes:d,area:f,empty:p,interior:g,foundation:y})=>{const w=H.getState().world,b=H(e5),C=H(i3),P=H(a3),v=H(Ds),T=Tn(Tb),A=m.useRef(0),x=m.useRef(),[S,R,M]=e,[D,E,W]=n,j=m.useMemo(()=>{if(!d||g||y&&y.notBuilding)return;const F=T.get(t);if(!F)return;const U=F.reduce((q,te)=>q+te,0);if(f===0)return;const O=r3*(w.solarRadiationHeatmapGridCellSize??.5),B=Math.max(2,Math.round(S/O)),_=Math.max(2,Math.round(M/O)),X=S/B,$=M/_,Q=U/f*(b??Qm);A.current=Q<0?1:0,x.current=me.getEuler(Io,Oc,"YXZ",Math.sign(Q)*Gt);const le=[];if(Q<0)for(let q=0;qc*S,[S,c]),k=m.useMemo(()=>(L+r.width+S)/2*1.025,[S,L,r.width]),N=(F,U,O)=>h.jsx(ua,{name:"Window Seal Plane",args:F,position:U,rotation:O,material:ren,receiveShadow:v,castShadow:v});return h.jsxs(h.Fragment,{children:[!p&&h.jsxs("group",{name:"Rectangle Window Plane Group",position:[0,E,0],children:[h.jsx(ua,{name:"Window Glass Plane",args:[S,M],rotation:[Gt,0,0],children:u}),(o.horizontalMullion||o.verticalMullion)&&h.jsx(ien,{dimension:e,mullionData:o,shadowEnabled:v})]}),r.showFrame&&h.jsx(aen,{dimension:e,frameData:r,shadowEnabled:v}),h.jsx(Xye,{cx:k,lx:L,lz:M,color:s,showLeft:a,showRight:l,spacing:r.showFrame?r.width/2:0}),h.jsx(len,{cy:E,dimension:e,wireframeData:i}),N([R,M],[-S/2+.001,R/2,0],[Gt,Gt,0]),N([R,M],[S/2-1e-4,R/2,0],[Gt,-Gt,0]),N([S,R],[0,R/2,M/2-.001],[Math.PI,0,0]),N([S,R],[0,R/2,-M/2+.001]),j&&j.map((F,U)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:F,name:"Heat Flux "+U,lineWidth:P??Zm,color:C??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:F[A.current].clone().add(new ie(0,A.current===0?-.1:.1,0)),args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:x.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:C??g0})})]},U))]})},cen=be.memo(sen),Gye=({element:t})=>{const e=H(s0),n=H(d1),o=H(ly),r=t.lx/2,i=t.lz/2,a=.05,l=1,s=.5,c=t.lineColor??"white",u="darkorchid",d=Math.max(.25,(r+i)/32),f=.25,p=30,g=-.1,y=m.useMemo(()=>({lng:e}),[e]),w=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:u,text:t.lz.toFixed(1)+Y.t("word.MeterAbbreviation",y),fontSize:p,fontFace:"Times Roman",textHeight:d,position:[-r-f,g,0]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r-f,0,-i],[-r-f,0,i]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r-f+a,0,-i+3*a],[-r-f,0,-i],[-r-f-a,0,-i+3*a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r-f+a,0,i-3*a],[-r-f,0,i],[-r-f-a,0,i-3*a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r,0,-i],[-r-f*2,0,-i]],color:c,linewidth:s}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r,0,i],[-r-f*2,0,i]],color:c,linewidth:s})]}),[r,i,y]),b=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:u,text:t.lz.toFixed(1)+Y.t("word.MeterAbbreviation",y),fontSize:p,fontFace:"Times Roman",textHeight:d,position:[r+f,g,0]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r+f,0,-i],[r+f,0,i]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r+f+a,0,-i+3*a],[r+f,0,-i],[r+f-a,0,-i+3*a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r+f+a,0,i-3*a],[r+f,0,i],[r+f-a,0,i-3*a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r,0,-i],[r+f*2,0,-i]],color:c,linewidth:s}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r,0,i],[r+f*2,0,i]],color:c,linewidth:s})]}),[r,i,y]),C=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:u,text:t.lx.toFixed(1)+Y.t("word.MeterAbbreviation",y),fontSize:p,fontFace:"Times Roman",textHeight:d,position:[0,g,-i-f]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r,0,-i-f],[r,0,-i-f]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r+3*a,0,-i-f-a],[-r,0,-i-f],[-r+3*a,0,-i-f+a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r-3*a,0,-i-f-a],[r,0,-i-f],[r-3*a,0,-i-f+a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r,0,-i],[-r,0,-i-f*2]],color:c,linewidth:s}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r,0,-i],[r,0,-i-f*2]],color:c,linewidth:s})]}),[r,i,y]),P=m.useMemo(()=>h.jsxs(h.Fragment,{children:[h.jsx("textSprite",{userData:{unintersectable:!0},backgroundColor:u,text:t.lx.toFixed(1)+Y.t("word.MeterAbbreviation",y),fontSize:p,fontFace:"Times Roman",textHeight:d,position:[0,g,i+f]}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r,0,i+f],[r,0,i+f]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r+3*a,0,i+f-a],[-r,0,i+f],[-r+3*a,0,i+f+a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r-3*a,0,i+f-a],[r,0,i+f],[r-3*a,0,i+f+a]],color:c,linewidth:l}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-r,0,i],[-r,0,i+f*2]],color:c,linewidth:s}),h.jsx(jn,{userData:{unintersectable:!0},points:[[r,0,i],[r,0,i+f*2]],color:c,linewidth:s})]}),[r,i,y]);if(n)switch(n){case vt.LowerLeft:return h.jsxs(h.Fragment,{children:[w,C]});case vt.LowerRight:return h.jsxs(h.Fragment,{children:[b,C]});case vt.UpperLeft:return h.jsxs(h.Fragment,{children:[w,P]});case vt.UpperRight:return h.jsxs(h.Fragment,{children:[b,P]})}if(o)switch(o){case vt.LowerLeft:return h.jsxs(h.Fragment,{children:[w,C]});case vt.LowerRight:return h.jsxs(h.Fragment,{children:[b,C]});case vt.UpperLeft:return h.jsxs(h.Fragment,{children:[w,P]});case vt.UpperRight:return h.jsxs(h.Fragment,{children:[b,P]})}return h.jsx(h.Fragment,{})};be.memo(Gye);const Xye=({cx:t,cz:e=0,lx:n,lz:o,color:r,showLeft:i,showRight:a,spacing:l})=>{const s=H(Ds),c=ht(Ss),u=ht(h3);return c||u?null:h.jsxs("group",{name:"Shutter Group",children:[a&&h.jsx(Qr,{args:[n,.1,o],position:[t+l,0,e],castShadow:s,receiveShadow:s,children:h.jsx("meshStandardMaterial",{color:r})}),i&&h.jsx(Qr,{args:[n,.1,o],position:[-t-l,0,e],castShadow:s,receiveShadow:s,children:h.jsx("meshStandardMaterial",{color:r})})]})},ade="Window Group",Gp=[0,.5],uen=t=>{const{id:e,parentId:n,foundationId:o,cx:r,cy:i,cz:a,lx:l,ly:s,lz:c,rotation:u,locked:d,lineWidth:f=.2,lineColor:p="black",horizontalMullion:g=!0,verticalMullion:y=!0,mullionWidth:w=.06,horizontalMullionSpacing:b=.5,verticalMullionSpacing:C=.5,tint:P="#73D8FF",opacity:v=.5,leftShutter:T=!1,rightShutter:A=!1,shutterColor:x="gray",shutterWidth:S=.5,mullionColor:R="white",frame:M=!1,color:D="white",frameWidth:E=.1,sillWidth:W=.1,windowType:j=Ti.Default,archHeight:L,parentType:k=z.Wall,polygonTop:N=Gp}=t,F=`${ade} ${e}`,U=H(fn),O=H(pA),B=ht(xh),_=H(mBe),X=Es(e),$=(Se=!1)=>{U(ze=>{if(ze.contextMenuObjectType=null,ze.groupActionMode)ze.multiSelectionsMode||ze.selectedElementIdSet.clear(),t.foundationId&&(ze.selectedElementIdSet.has(n)?ze.selectedElementIdSet.delete(n):ze.selectedElementIdSet.add(t.foundationId));else for(const Ie of ze.elements)if(Ie.id===e)if(Ie.selected=!0,ze.selectedElement=Ie,Se)if(ze.selectedElementIdSet.has(e))for(const ye of ze.elements)ze.selectedElementIdSet.has(ye.id)&&ye.type!==ze.selectedElement.type&&ze.selectedElementIdSet.delete(ye.id);else if(ze.multiSelectionsMode){ze.selectedElementIdSet.add(e);for(const ye of ze.elements)ze.selectedElementIdSet.has(ye.id)&&ye.type!==ze.selectedElement.type&&ze.selectedElementIdSet.delete(ye.id)}else ze.selectedElementIdSet.clear(),ze.selectedElementIdSet.add(e);else ze.multiSelectionsMode?ze.selectedElementIdSet.has(e)?ze.selectedElementIdSet.delete(e):ze.selectedElementIdSet.add(e):(ze.selectedElementIdSet.clear(),ze.selectedElementIdSet.add(e));else Ie.selected=!1})},Q=Se=>Se.intersections.length>0&&Se.intersections[0].eventObject.name===F&&!H.getState().moveHandleType&&!H.getState().resizeHandleType&&!H.getState().isAddingElement()&&H.getState().objectTypeToAdd===z.None,le=Se=>{if(Se.eventObject.name===F&&Se.intersections.length>0)switch(Se.object.name){case Ho.Mid:case vt.UpperLeft:case vt.UpperRight:case vt.LowerLeft:case vt.LowerRight:case vt.Arch:case vt.Upper:return!0}return!1},q=(Se,ze)=>{Fn.getState().setEnableOrbitController(!1),B("showWallIntersectionPlaneId",n),U(Ie=>{Ie.resizeHandleType=Se,Ie.resizeAnchor.copy(new ie(r,0,a).add(ze))})},te=Se=>{if(!(Se.button===2||H.getState().addedWallId)&&(Q(Se)&&$(),le(Se))){const ze=Se.intersections[0].eventObject.name;switch(ze){case Ho.Mid:{Fn.getState().setEnableOrbitController(!1),ht.getState().set(Ie=>{Ie.showWallIntersectionPlaneId=n,Ie.oldParentId=n,Ie.oldFoundationId=o}),U(Ie=>{Ie.moveHandleType=ze,Ie.selectedElement=Ie.elements.find(ye=>{var ce;return ye.id===((ce=Ie.selectedElement)==null?void 0:ce.id)})});break}case vt.UpperLeft:{q(ze,new ie(l/2,0,-c/2));break}case vt.UpperRight:{q(ze,new ie(-l/2,0,-c/2));break}case vt.LowerLeft:{q(ze,new ie(l/2,0,c/2));break}case vt.LowerRight:{q(ze,new ie(-l/2,0,c/2));break}case vt.Arch:{q(ze,new ie(0,0,0));break}case vt.Upper:{q(ze,new ie(0,0,c/2));break}}}},re=Se=>{H.getState().addedWallId||Q(Se)&&($(!0),U(ze=>{ze.contextMenuObjectType=z.Window}))},ae=m.useMemo(()=>{if(k===z.Roof){const[Se,ze,Ie]=u;return new nn().fromArray([Se-Gt,ze,Ie,"ZXY"])}else return new nn},[k,u]),se=m.useMemo(()=>h.jsx("meshPhongMaterial",{specular:new rr("white"),shininess:_??hG,color:P,side:$r,opacity:v,transparent:!0}),[_,P,v]),ne=m.useMemo(()=>L!==void 0?[l,s,c,L]:[l,s,c],[l,s,c,L]),fe=m.useMemo(()=>k===z.Roof?[r,.05,a]:[r,i,a],[r,i,a,k]),ge=m.useMemo(()=>({horizontalMullion:g,verticalMullion:y,width:w,horizontalMullionSpacing:b,verticalMullionSpacing:C,color:R}),[g,y,w,b,C,R]),de=m.useMemo(()=>({showFrame:M,width:E,color:D,sillWidth:W}),[M,E,D,W]),Z=m.useMemo(()=>({lineColor:p,lineWidth:f,selected:X,locked:d,opacity:v}),[p,f,X,d,v]),he=ht(h3),xe=()=>{switch(j){case Ti.Default:return h.jsx(cen,{id:t.id,dimension:ne,position:fe,mullionData:ge,frameData:de,wireframeData:Z,leftShutter:T,rightShutter:A,shutterColor:x,shutterWidth:S,glassMaterial:se,showHeatFluxes:he,area:me.getWindowArea(t),empty:!!t.empty,interior:!!t.interior,foundation:O(t)});case Ti.Arched:return h.jsx(zxt,{id:t.id,dimension:ne,position:fe,mullionData:ge,frameData:de,wireframeData:Z,leftShutter:T,rightShutter:A,shutterColor:x,shutterWidth:S,glassMaterial:se,showHeatFluxes:he,area:me.getWindowArea(t),empty:!!t.empty,interior:!!t.interior,foundation:O(t)});case Ti.Polygonal:return h.jsx(Nxt,{id:t.id,dimension:ne,polygonTop:N,position:fe,glassMaterial:se,empty:!!t.empty,interior:!!t.interior,wireframeData:Z,frameData:de,leftShutter:T,rightShutter:A,shutterColor:x,shutterWidth:S,showHeatFluxes:he,area:me.getWindowArea(t),foundation:O(t)})}},He=k===z.Roof?i:0;return h.jsxs("group",{name:F,position:[r,He,a],rotation:ae,onPointerDown:te,onContextMenu:re,onPointerMove:()=>{},children:[xe(),X&&h.jsx(Gye,{element:t}),X&&!d&&h.jsx(oen,{id:e,parentId:n,foundationId:o,lx:l,lz:c,polygonTop:N,rotation:u,windowType:j,parentType:k})]},e)},L$e=be.memo(uen),den=be.memo(({lineColor:t="black",lineWidth:e=.2,hx:n,hz:o,fill:r,isTopPartial:i,leftUnfilledHeight:a,rightUnfilledHeight:l,showParapet:s=!1,leftHeight:c=2*o,rightHeight:u=2*o,center:d,centerLeft:f,centerRight:p})=>{const g=H(T=>T.viewState.orthographic),y=[-n,-o+.001+(r===El.Partial?a:0),.001],w=[n,-o+.001+(r===El.Partial?l:0),.001],b=[-n,c-o-.001,.001],C=[n,u-o-.001,.001],P=n*2,v=[];if(g)e=2,v.push(b,C);else if(s)v.push(b,y,w,C);else if(i)v.push(y,b,C,w,y);else{if(v.push(y,b),f){const T=[f[0]*P,f[1]-o,.001];v.push(T)}if(d){const T=[d[0]*P,d[1]-o,.001];v.push(T)}if(p){const T=[p[0]*P,p[1]-o,.001];v.push(T)}v.push(C,w)}return h.jsx(be.Fragment,{children:h.jsx(jn,{rotation:[Gt,0,0],points:v,color:t,lineWidth:e})})});var Pd=(t=>(t.Default="Default",t.Arched="Arched",t))(Pd||{});const fen=be.memo(({dimension:t,lineColor:e,lineWidth:n})=>{const[o,r,i]=t.map(u=>u/2),a=[-o,0,i+.05],l=[o,0,i+.05],s=[-o,0,-i],c=[o,0,-i];return h.jsx(jn,{points:[s,a,l,c],lineWidth:n,color:e})}),hen=be.memo(({dimension:t,color:e})=>{const[n,o,r]=t,i=H(Ds),a=m.useMemo(()=>h.jsx("meshStandardMaterial",{color:e}),[e]),l=.1,s=l/2;return h.jsxs("group",{name:"Door frame group",children:[h.jsx(Qr,{position:[0,0,r/2],args:[n,l,l],castShadow:i,receiveShadow:i,children:a}),h.jsx(Qr,{position:[-n/2+s,0,0],args:[l,l,r],castShadow:i,receiveShadow:i,children:a}),h.jsx(Qr,{position:[n/2-s,0,0],args:[l,l,r],castShadow:i,receiveShadow:i,children:a})]})}),pen=be.memo(({id:t,dimension:e,color:n,frameColor:o,selected:r,locked:i,material:a,filled:l,area:s,showHeatFluxes:c,foundation:u})=>{const d=H.getState().world,f=H(e5),p=H(i3),g=H(a3),y=H(Ds),w=Tn(Tb),b=m.useRef(0),C=m.useRef(),[P,v,T]=e,A=m.useMemo(()=>{if(!c||u&&u.notBuilding)return;const S=w.get(t);if(!S)return;const R=S.reduce((N,F)=>N+F,0);if(s===0)return;const M=r3*(d.solarRadiationHeatmapGridCellSize??.5),D=Math.max(2,Math.round(P/M)),E=Math.max(2,Math.round(T/M)),W=P/D,j=T/E,L=R/s*(f??Qm);b.current=L<0?1:0,C.current=me.getEuler(Io,Oc,"YXZ",Math.sign(L)*Gt);const k=[];if(L<0)for(let N=0;N{const S=new Fl,[R,M]=[P/2,T/2],D=Math.max(R,M)*.2;return S.moveTo(-R,-M),S.lineTo(-R,M),S.lineTo(R,M),S.lineTo(R,-M),l||(S.lineTo(R-D,-M),S.lineTo(R-D,M-D),S.lineTo(-R+D,M-D),S.lineTo(-R+D,-M)),S.closePath(),S},[P,T,l]);return h.jsxs("group",{name:"Rectangle door group",position:[0,-.01,0],children:[h.jsx("mesh",{name:"Rectangular Door Mesh",rotation:[Gt,0,0],material:a,castShadow:y&&l,receiveShadow:y&&l,children:h.jsx("shapeGeometry",{args:[x]})}),l&&h.jsxs("mesh",{name:"Rectangular Door Simulation Mesh",rotation:[Gt,0,0],uuid:t,userData:{simulation:!0},castShadow:!1,receiveShadow:!1,visible:!1,children:[h.jsx("shapeGeometry",{args:[x]}),h.jsx("meshBasicMaterial",{side:$r})]}),l&&h.jsx("mesh",{name:"Door plane inside",position:[0,.1,0],rotation:[-Gt,0,Math.PI],material:a,castShadow:y&&l,receiveShadow:y&&l,children:h.jsx("shapeGeometry",{args:[x]})}),h.jsx(fen,{dimension:e,lineColor:r&&i?y0:"black",lineWidth:r&&i?2:.2}),h.jsx(hen,{dimension:e,color:o}),A&&A.map((S,R)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:S,name:"Heat Flux "+R,lineWidth:g??Zm,color:p??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:S[b.current].clone().add(new ie(0,b.current===0?-.1:.1,0)),args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:C.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:p??g0})})]},R))]})}),gen=be.memo(({id:t,dimension:e,color:n,frameColor:o,selected:r,locked:i,material:a,filled:l,showHeatFluxes:s,area:c,foundation:u})=>{const d=H.getState().world,f=H(Ds),p=H(e5),g=H(i3),y=H(a3),w=Tn(Tb),b=m.useRef(0),C=m.useRef(),[P,v,T,A]=e,x=(D,E)=>{if(A>0){const W=.5*P,j=.5*T,L=Math.min(A,T,W),k=.5*(L+W*W/L);if(Math.abs(D)-j)return!0;const N=E-(T-k-j);return D*D+N*N{if(!s||u&&u.notBuilding)return;const D=w.get(t);if(!D)return;const E=D.reduce((O,B)=>O+B,0);if(c===0)return;const W=r3*(d.solarRadiationHeatmapGridCellSize??.5),j=Math.max(2,Math.round(P/W)),L=Math.max(2,Math.round(T/W)),k=P/j,N=T/L,F=E/c*(p??Qm);b.current=F<0?1:0,C.current=me.getEuler(Io,Oc,"YXZ",Math.sign(F)*Gt);const U=[];if(F<0)for(let O=0;O{const D=new Fl,E=P/2,W=T/2,j=Math.min(A,T,E);if(D.moveTo(E,-W),D.lineTo(E,W-j),j>.1){const L=j/2+P**2/(8*j),[k,N]=[0,W-L],F=Math.acos(Math.min(E/L,1)),U=Math.PI-F;D.absarc(k,N,L,F,U,!1)}else D.lineTo(-E,W);if(D.lineTo(-E,-W),!l){const L=P*.4,k=T*.4,N=Math.min(A*.8,T*.8,E*.8);if(D.lineTo(-L,-W),N>.1){D.lineTo(-L,W-N);const F=N/2+(P*.8)**2/(8*N),[U,O]=[0,k-F],B=Math.acos(Math.min(L/F,1)),_=Math.PI-B;D.absarc(U,O,F,_,B,!0)}else D.lineTo(-L,k),D.lineTo(L,k);D.lineTo(L,-W)}return D.closePath(),D},[P,T,A,l]),M=m.useMemo(()=>({lineColor:"black",lineWidth:i&&r?.2:.1,opacity:1,selected:r,locked:i}),[r,i]);return h.jsxs("group",{name:"Arched door group",children:[h.jsx("mesh",{name:"Arched Door Mesh",rotation:[Gt,0,0],material:a,castShadow:f&&l,receiveShadow:f&&l,children:h.jsx("shapeGeometry",{args:[R]})}),l&&h.jsxs("mesh",{name:"Arched Door Simulation Mesh",rotation:[Gt,0,0],material:a,uuid:t,userData:{simulation:!0},castShadow:!1,receiveShadow:!1,visible:!1,children:[h.jsx("shapeGeometry",{args:[R]}),h.jsx("meshBasicMaterial",{side:$r})]}),l&&h.jsx("mesh",{name:"Door plane mesh inside",position:[0,.1,0],rotation:[-Gt,0,Math.PI],material:a,castShadow:f&&l,receiveShadow:f&&l,children:h.jsx("shapeGeometry",{args:[R]})}),h.jsx(Kce,{cy:0,dimension:e,wireframeData:M}),h.jsx(Kce,{cy:v,dimension:e,wireframeData:M}),S&&S.map((D,E)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{points:D,name:"Heat Flux "+E,lineWidth:y??Zm,color:g??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:D[b.current].clone().add(new ie(0,b.current===0?-.1:.1,0)),args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:C.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:g??g0})})]},E))]})}),W$e="/aladdin/assets/door_edge-Dxz9LnYZ.png",N$e="/aladdin/assets/door_01-Bl1yYWKp.png",lde="/aladdin/assets/door_02-eLAy3erM.png",U$e="/aladdin/assets/door_03-CX-eEQtv.png",j$e="/aladdin/assets/door_04-Bk3Xe_KE.png",B$e="/aladdin/assets/door_05-15BnnbHK.png",Y$e="/aladdin/assets/door_06-B08sjms-.png",O$e="/aladdin/assets/door_07-BVyEwygm.png",_$e="/aladdin/assets/door_08-Cd1Vc7FQ.png",V$e="/aladdin/assets/door_09-DQcA4jCn.png",G$e="/aladdin/assets/door_10-DVLJsY3W.png",X$e="/aladdin/assets/door_11-dOCMnkGG.png",J$e="/aladdin/assets/door_12-7f2iD2B7.png",K$e="/aladdin/assets/door_13-IsPl-xmI.png",q$e="/aladdin/assets/door_14-CljRO-fX.png",$$e="/aladdin/assets/door_15-CoUc1lfF.png",Q$e="/aladdin/assets/door_16-Dlbc5tIF.png",Z$e="/aladdin/assets/door_17-CHob_UgA.png",men=(t,e,n,o)=>{const r=m.useMemo(()=>{let s;switch(t){case sr.Default:s=W$e;break;case sr.NoTexture:s=ig;break;case sr.Texture01:s=N$e;break;case sr.Texture02:s=lde;break;case sr.Texture03:s=U$e;break;case sr.Texture04:s=j$e;break;case sr.Texture05:s=B$e;break;case sr.Texture06:s=Y$e;break;case sr.Texture07:s=O$e;break;case sr.Texture08:s=_$e;break;case sr.Texture09:s=V$e;break;case sr.Texture10:s=G$e;break;case sr.Texture11:s=X$e;break;case sr.Texture12:s=J$e;break;case sr.Texture13:s=K$e;break;case sr.Texture14:s=q$e;break;case sr.Texture15:s=$$e;break;case sr.Texture16:s=Q$e;break;case sr.Texture17:s=Z$e;break;default:s=lde}return new df().load(s,c=>{n!==void 0&&o!==void 0&&(c.offset.set(.5,.5),c.repeat.set(1/n,1/o)),a(c),l()})},[t,e,n,o]),[i,a]=m.useState(r),{invalidate:l}=oi();return i},yen=new mf({color:"white",side:Ra}),Aen=be.memo(({dimension:t,doorType:e})=>{const[n,o,r]=t.map(a=>a/2);return n===0&&r===0?null:h.jsxs("group",{name:"Door handle wrapper",children:[h.jsx(wv,{x:-n,z:r,handleType:vt.UpperLeft}),h.jsx(wv,{x:n,z:r,handleType:vt.UpperRight}),e===Pd.Arched&&h.jsx(k$e,{z:r})]})}),wen=be.memo(({dimension:t})=>{const e=H(Ds),[n,o,r]=t,[i,a,l]=t.map(c=>c/2),s=(c,u,d)=>h.jsx(ua,{name:"Door seal plane",args:c,position:u,rotation:d,material:yen,receiveShadow:e});return h.jsxs("group",{name:"Door seal planes group",children:[s([o,r],[-i,a,0],[Gt,Gt,0]),s([o,r],[i,a,0],[Gt,-Gt,0]),s([n,o],[0,a,l],[Math.PI,0,0])]})}),ven=t=>{const{id:e,parentId:n,cx:o,cy:r,cz:i,lx:a,ly:l,lz:s,textureType:c,locked:u=!1,color:d="white",doorType:f=Pd.Default,archHeight:p=1,filled:g=!0,opacity:y=1,frameColor:w="white"}=t,b=`Door Group ${e}`,C=H(fn),P=ht(xh),v=H(mBe),T=Es(e),A=m.useRef(!1);m.useEffect(()=>{const $=()=>{A.current=!1};return window.addEventListener("pointerup",$),()=>window.removeEventListener("pointerup",$)},[]);const x=($=!1)=>{C(Q=>{if(Q.groupActionMode)Q.multiSelectionsMode||Q.selectedElementIdSet.clear(),t.foundationId&&(Q.selectedElementIdSet.has(n)?Q.selectedElementIdSet.delete(n):Q.selectedElementIdSet.add(t.foundationId));else for(const le of Q.elements)if(le.id===e)if(le.selected=!0,Q.selectedElement=le,$)if(Q.selectedElementIdSet.has(e))for(const q of Q.elements)Q.selectedElementIdSet.has(q.id)&&q.type!==Q.selectedElement.type&&Q.selectedElementIdSet.delete(q.id);else if(Q.multiSelectionsMode){Q.selectedElementIdSet.add(e);for(const q of Q.elements)Q.selectedElementIdSet.has(q.id)&&q.type!==Q.selectedElement.type&&Q.selectedElementIdSet.delete(q.id)}else Q.selectedElementIdSet.clear(),Q.selectedElementIdSet.add(e);else Q.multiSelectionsMode?Q.selectedElementIdSet.has(e)?Q.selectedElementIdSet.delete(e):Q.selectedElementIdSet.add(e):(Q.selectedElementIdSet.clear(),Q.selectedElementIdSet.add(e));else le.selected=!1})},S=$=>$.intersections.length>0&&$.intersections[0].eventObject.name===b&&!H.getState().moveHandleType&&!H.getState().resizeHandleType&&!H.getState().isAddingElement()&&H.getState().objectTypeToAdd===z.None,R=$=>{if($.eventObject.name===b&&$.intersections.length>0)switch($.object.name){case vt.UpperLeft:case vt.UpperRight:case vt.Arch:return!0}return!1},M=($,Q)=>{Fn.getState().setEnableOrbitController(!1),P("showWallIntersectionPlaneId",n),C(le=>{le.resizeHandleType=$,le.resizeAnchor.copy(new ie(o,0,i).add(Q))})},D=$=>{H.getState().addedWallId||S($)&&(x(!0),C(Q=>{Q.contextMenuObjectType=z.Door}))},E=$=>{if(!(A.current||$.button===2||H.getState().addedWallId)&&(A.current=!0,S($)&&x(),R($))){const Q=$.intersections[0].eventObject.name;switch(Q){case vt.UpperLeft:{M(Q,new ie(a/2,0,-s/2));break}case vt.UpperRight:{M(Q,new ie(-a/2,0,-s/2));break}case vt.Arch:{M(Q,new ie(0,0,0));break}}}},W=H(pA),j=ht(Ss),L=ht(h3),k=H(Cf),N=Tn(u1),[F,U]=m.useState(null),O=()=>{switch(f){case Pd.Default:return h.jsx(pen,{id:e,dimension:_,color:d,frameColor:w,selected:T,locked:u,material:X,filled:g,showHeatFluxes:L,area:me.getDoorArea(t),foundation:W(t)});case Pd.Arched:return h.jsx(gen,{id:e,dimension:_,color:d,frameColor:w,selected:T,locked:u,material:X,filled:g,showHeatFluxes:L,area:me.getDoorArea(t),foundation:W(t)})}};m.useEffect(()=>{if(t&&j){const $=N(t.id);if($){const Q=me.fetchHeatmapTexture($,k??5);Q&&(Q.wrapS=Hs,Q.wrapT=Hs,Q.offset.set(-a/2,-s/2),Q.center.set(a/2,s/2),Q.repeat.set(1/a,1/s),U(Q))}}},[j,k]);const B=men(c,f,a,s),_=m.useMemo(()=>[a,l,s,p],[a,l,s,p]),X=m.useMemo(()=>j&&F&&t.filled?new e3({color:d,map:F,side:Ra}):g?c===sr.Default||c===sr.NoTexture?y<1?new q1e({specular:"white",shininess:v??hG,color:d,side:Ra,opacity:y,transparent:!0}):new mf({map:B,color:d,side:Ra}):new mf({map:B,side:Ra}):new mf({opacity:d===Lce?.5:0,color:d,transparent:!0,side:$r}),[j,F,d,c,B,g,y]);return h.jsxs("group",{name:b,position:[o,0,i],onPointerDown:E,onContextMenu:D,children:[O(),T&&h.jsx(Gye,{element:t}),T&&!u&&h.jsx(Aen,{dimension:_,doorType:f}),h.jsx(wen,{dimension:_})]})},xen=be.memo(ven),ben="/aladdin/assets/polygon_08-BBFzZjDj.png",Sen="/aladdin/assets/polygon_09-B_8KpAt3.png",Ten="/aladdin/assets/polygon_10-CKqrpQre.png",eQe=({id:t,lz:e=.1,filled:n=!1,rotation:o=[0,0,0],normal:r=[0,0,1],color:i="yellow",label:a,text:l,fontSize:s=1,fontColor:c="black",fontOutlineWidth:u=0,fontOutlineColor:d="white",fontStrokeWidth:f=0,fontStrokeColor:p="black",lineStyle:g=Gh.Solid,lineColor:y="black",lineWidth:w=1,locked:b=!1,showLabel:C=!1,parentId:P,foundationId:v,vertices:T,opacity:A=1,noOutline:x=!1,shininess:S=0,selectedIndex:R=-1,textureType:M=Jr.NoTexture})=>{const D=H(fn),E=H(Y0),W=H(Qq),j=H(Ds),L=Es(t),{gl:{domElement:k}}=oi(),[N,F]=m.useState(!1),[U,O]=m.useState(0),[B,_]=m.useState(0),[X,$]=m.useState(null),Q=m.useRef(null),le=m.useRef(null),q=H(Pe=>{for(const Ee of Pe.elements)if(Ee.id===P)return Ee}),te=new ie,re=new nn;if((q==null?void 0:q.type)===z.Cuboid){const{pos:Pe,rot:Ee}=me.getWorldDataById(q.id);te.copy(Pe),re.set(0,0,Ee)}const ae=q?Math.max(1,Math.max(q.lx,q.ly)/24):1,se=Vx*ae,ne=c1*ae,fe=Jt(),ge=(Pe,Ee)=>{D(Be=>{for(const Je of Be.elements)if(Je.type===z.Polygon&&Je.id===Pe){Je.selectedIndex=Ee;break}})},de=m.useMemo(()=>{const Pe=new Array;if(q){switch(q.type){case z.Foundation:{for(const Be of T)Pe.push({x:Be.x*q.lx,y:Be.y*q.ly});break}case z.Wall:{for(const Be of T)Pe.push({x:Be.x*q.lx,y:Be.y*q.lz});break}case z.Cuboid:{const Be=new ie().fromArray(r);let Je,We;me.isUnitVectorX(Be)?(Je=q.lz,We=q.ly):me.isUnitVectorY(Be)?(Je=q.lx,We=q.lz):(Je=q.lx,We=q.ly);for(const Ke of T)Pe.push({x:Ke.x*Je,y:Ke.y*We});break}}const Ee=me.calculatePolygonCentroid(Pe);O(Ee.x),_(Ee.y)}return Pe},[T,q,r]),he=(()=>{if((q==null?void 0:q.type)===z.Cuboid){const Pe=me.isIdentical(r,rs);return te.z+(q.lz+(Pe?0:e))/2+.01}return(q==null?void 0:q.type)===z.Foundation?q.lz+.01:e/2+.01})(),He=(()=>{if((q==null?void 0:q.type)===z.Wall)return new nn(-Gt,0,Math.PI,"ZXY");const Pe=new ie().fromArray(r);let Ee=o[2];return(q==null?void 0:q.type)===z.Cuboid&&(Ee=re.z),me.isSame(Pe,Op)?new nn(0,Gt,Ee,"ZXY"):me.isSame(Pe,_p)?new nn(0,-Gt,Ee,"ZXY"):me.isSame(Pe,Oc)?new nn(-Gt,0,Ee,"ZXY"):me.isSame(Pe,Vp)?new nn(Gt,0,Ee,"ZXY"):new nn(0,0,Ee,"ZXY")})(),ze=(()=>{if(q){if(q.type===z.Cuboid){const Pe=new ie(te.x,te.y,he),Ee=new ie().fromArray(r);let Be=!1;const Je=new ie;return me.isSame(Ee,Op)?(Be=!0,Je.x=q.lx/2+.01):me.isSame(Ee,_p)?(Be=!0,Je.x=-q.lx/2-.01):me.isSame(Ee,Oc)?(Be=!0,Je.y=q.ly/2+.01):me.isSame(Ee,Vp)&&(Be=!0,Je.y=-q.ly/2-.01),Be&&(Je.applyEuler(re),Pe.x=te.x+Je.x,Pe.y=te.y+Je.y,Pe.z=te.z+Je.z),Pe}else if(q.type===z.Wall)return new ie(0,-.01,0)}return new ie((q==null?void 0:q.cx)??0,(q==null?void 0:q.cy)??0,he)})(),Ie=m.useMemo(()=>{const Pe=new Array;for(const Ee of de)Pe.push(new ie(Ee.x,Ee.y,0));return Pe.push(new ie(de[0].x,de[0].y,0)),Pe},[de]),ye=m.useMemo(()=>{const Pe=new Fl;Pe.moveTo(de[0].x,de[0].y);for(let Ee=1;Ee{Pe.intersections.length>0&&Pe.intersections[0].object===Pe.eventObject&&($(Ee),Ee===Ho.Default?k.style.cursor="move":k.style.cursor="pointer")},[]),pe=m.useCallback(()=>{$(null),k.style.cursor="default"},[]),ve=Pe=>{switch(Pe){case Jr.Texture01:return{x:1,y:1};case Jr.Texture02:return{x:2,y:2};case Jr.Texture03:return{x:.4,y:.4};case Jr.Texture04:return{x:.25,y:.25};case Jr.Texture05:return{x:5,y:5};case Jr.Texture06:return{x:1,y:1};case Jr.Texture07:return{x:1,y:1};case Jr.Texture08:return{x:2,y:2};case Jr.Texture09:return{x:2,y:2};case Jr.Texture10:return{x:4,y:4};default:return{x:1,y:1}}},Ae=m.useMemo(()=>{let Pe;switch(M){case Jr.Texture01:Pe=f$e;break;case Jr.Texture02:Pe=h$e;break;case Jr.Texture03:Pe=p$e;break;case Jr.Texture04:Pe=g$e;break;case Jr.Texture05:Pe=m$e;break;case Jr.Texture06:Pe=y$e;break;case Jr.Texture07:Pe=A$e;break;case Jr.Texture08:Pe=ben;break;case Jr.Texture09:Pe=Sen;break;case Jr.Texture10:Pe=Ten;break;default:Pe=ig}return new df().load(Pe,Ee=>{const Be=ve(M);Ee.wrapT=Ee.wrapS=Hs,Ee.repeat.set(1/Be.x,1/Be.y);const Je=new ie().fromArray(r);me.isSame(Je,Op)?Ee.rotation=Gt:me.isSame(Je,_p)?Ee.rotation=-Gt:me.isSame(Je,Vp)&&(Ee.rotation=Math.PI),Me(Ee)})},[M,r]),[Te,Me]=m.useState(Ae);return h.jsxs("group",{name:"Polygon Group "+t,rotation:He,position:ze,children:[n&&h.jsxs("mesh",{uuid:t,ref:Q,receiveShadow:j,castShadow:!1,name:z.Polygon,onPointerDown:Pe=>{Pe.button!==2&&W===z.None&&E(t,Pe)},onContextMenu:Pe=>{E(t,Pe,Oo.ContextMenu),D(Ee=>{Pe.intersections.length>0&&Pe.intersections[0].object===Q.current&&(Pe.intersections.length>1&&Ee.pastePoint.copy(Pe.intersections[1].point),Ee.contextMenuObjectType=z.Polygon)})},onPointerOver:Pe=>{Pe.intersections.length>0&&Pe.intersections[0].object===Q.current&&F(!0)},onPointerOut:()=>{F(!1),k.style.cursor="default"},children:[h.jsx("shapeGeometry",{attach:"geometry",args:[ye]}),S===void 0||S===0?h.jsx("meshStandardMaterial",{attach:"material",color:M===Jr.NoTexture?i:"white",map:Te,side:$r,transparent:A<1,opacity:A}):h.jsx("meshPhongMaterial",{attach:"material",color:M===Jr.NoTexture?i:"white",map:Te,side:Ra,specular:new rr("white"),shininess:S,transparent:A<1,opacity:A})]}),l&&h.jsx(r4t,{fontSize:s,scale:[1,1,1],color:c,position:[U,B,.01],rotation:[0,0,(q==null?void 0:q.type)===z.Wall?Math.PI:0],anchorX:"center",anchorY:"middle",outlineWidth:u,outlineColor:d,strokeWidth:f,strokeColor:p,children:l}),(!x||b&&L)&&h.jsx(jn,{points:Ie,color:b&&L?y0:y,lineWidth:w,dashed:g&&g!==Gh.Solid,dashSize:g===Gh.Dashed?.3:.1,gapSize:.1,uuid:t,receiveShadow:!1,castShadow:!1,name:"Polygon Wireframe",onPointerDown:Pe=>{Pe.button!==2&&E(t,Pe)},onContextMenu:Pe=>{W===z.None&&(E(t,Pe,Oo.ContextMenu),D(Ee=>{if(Pe.intersections.length>0){const Be=Pe.intersections[0].object;Be.name==="Polygon Wireframe"&&Be.uuid===t&&(Ee.contextMenuObjectType=z.Polygon)}}))}}),!n&&h.jsx(jn,{position:[0,0,.1],points:Ie,visible:!1,lineWidth:Math.min(w*10,10),receiveShadow:!1,castShadow:!1,uuid:t,name:"Polygon Enlarged Line",onPointerDown:Pe=>{Pe.button!==2&&E(t,Pe)},onContextMenu:Pe=>{W===z.None&&(E(t,Pe,Oo.ContextMenu),D(Ee=>{if(Pe.intersections.length>0){const Be=Pe.intersections[0].object;Be.name==="Polygon Enlarged Line"&&Be.uuid===t&&(Ee.contextMenuObjectType=z.Polygon)}}))}}),L&&!b&&h.jsx(ds,{ref:le,position:[U,B,0],args:[ne,6,6],name:Ho.Default,onPointerDown:Pe=>{Pe.button!==2&&(E(t,Pe,Oo.Move),Fn.getState().setEnableOrbitController(!1),ht.getState().set(Ee=>{Ee.showWallIntersectionPlaneId=P,Ee.oldParentId=P,Ee.oldFoundationId=v}),D(Ee=>{Ee.moveHandleType=Ho.Default}))},onPointerOver:Pe=>{ce(Pe,Ho.Default)},onPointerOut:pe,children:h.jsx("meshBasicMaterial",{attach:"material",color:"orange"})}),L&&!b&&de.map((Pe,Ee)=>h.jsxs(be.Fragment,{children:[h.jsx(Qr,{userData:{vertexIndex:Ee},position:[Pe.x,Pe.y,0],name:vt.Default,args:[se,se,e/2+(n?0:.1)],onPointerDown:Be=>{Be.button!==2&&(E(t,Be,Oo.Resize),ge(t,Ee),Fn.getState().setEnableOrbitController(!1),ht.getState().set(Je=>{Je.showWallIntersectionPlaneId=P,Je.oldParentId=P,Je.oldFoundationId=v}),D(Je=>{Je.resizeHandleType=vt.Default}))},onPointerOver:Be=>{ce(Be,vt.Default),ge(t,Ee)},onPointerOut:pe,onContextMenu:Be=>{D(Je=>{if(Be.intersections.length>0){const We=Be.intersections[0].object.userData.vertexIndex;We!==void 0&&(Je.contextMenuObjectType=z.PolygonVertex,ge(t,We))}})},children:h.jsx("meshBasicMaterial",{attach:"material",color:(X===vt.Default||H.getState().resizeHandleType===vt.Default)&&R===Ee?ta:Da})}),h.jsx("textSprite",{name:"Label "+Ee,text:""+Ee,fontSize:20*ae,fontFace:"Times Roman",textHeight:.2*ae,position:[Pe.x,Pe.y,.2*ae]})]},"resize-handle-"+Ee)),(N||C)&&!L&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",text:(a??Y.t("shared.PolygonElement",fe))+(b?" ("+Y.t("shared.ElementLocked",fe)+")":""),fontSize:20*ae,fontFace:"Times Roman",textHeight:.2*ae,position:[0,0,e+.2]})]})},Jye={display:!1,color:"white",textureType:Uo.NoTexture,parapetHeight:1,copingsWidth:.5,copingsHeight:.1},Pen=({args:t,wallData:e,parapetZ:n,currWallPointData:o,leftWallPointData:r,rightWallPointData:i})=>{const{display:a,color:l,textureType:s,parapetHeight:c,copingsWidth:u,copingsHeight:d}=t,{id:f,cx:p,cy:g,hx:y,hy:w,angle:b}=e,C=c-d,P=i$e(s),v=m.useMemo(()=>{const L=new ie(-y,w-u/2),k=new ie(y,w-u/2),N=new ie(y,w+u/2),F=new ie(-y,w+u/2),U=[L,k,N,F];if(i||r){const O=BSe(o);if(i&&mO(o.rightPoint,i.leftPoint)){const B=M(O,i);B&&(k.copy(B.outerIntersection),N.copy(B.innerIntersection))}if(r&&mO(o.leftPoint,r.rightPoint)){const B=M(O,r);B&&(L.copy(B.outerIntersection),F.copy(B.innerIntersection))}}return U},[y,w,u,o,r,i]),T=m.useMemo(()=>{const L=new Fl,k=new ie(-y,w*2),N=new ie(y,w*2);if(i||r){const F=uX(o,o.ly);if(i&&mO(o.rightPoint,i.leftPoint)){const U=D(F,i);U&&N.copy(U)}if(r&&mO(o.leftPoint,r.rightPoint)){const U=D(F,r);U&&k.copy(U)}}return L.moveTo(-y,0),L.lineTo(y,0),L.lineTo(N.x,N.y),L.lineTo(k.x,k.y),L.closePath(),L},[y,w,o,r,i]),A=m.useMemo(()=>{const L=new Fl;if(u===0)return L;const[k,N,F,U]=v;return L.moveTo(k.x,k.y),L.lineTo(N.x,N.y),L.lineTo(F.x,F.y),L.lineTo(U.x,U.y),L.closePath(),L},[u,v]),x=m.useMemo(()=>v.map(L=>L.toArray()),[v]),S=m.useMemo(()=>[new ie(-y,0,0),new ie(y,0,0)],[y]),R=m.useMemo(()=>[new ie,new ie(0,0,C)],[C]);function M(L,k){const N=BSe(k),F=qie(L.outerPoints.leftPoint,L.outerPoints.rightPoint,N.outerPoints.leftPoint,N.outerPoints.rightPoint);if(!F)return null;const U=qie(L.innerPoints.leftPoint,L.innerPoints.rightPoint,N.innerPoints.leftPoint,N.innerPoints.rightPoint);return U?{innerIntersection:new ie().subVectors(U,new ie(p,g)).applyEuler(new nn(0,0,-b)),outerIntersection:new ie().subVectors(F,new ie(p,g)).applyEuler(new nn(0,0,-b))}:null}function D(L,k){const N=uX(k,k.ly),F=qie(L.leftPoint,L.rightPoint,N.leftPoint,N.rightPoint);return F?new ie().subVectors(F,new ie(p,g)).applyEuler(new nn(0,0,-b)):null}function E(){return!(H.getState().moveHandleType||H.getState().resizeHandleType||H.getState().isAddingElement())}function W(L){L.button!==2&&L.intersections.length>0&&L.intersections[0].eventObject===L.eventObject&&E()&&H.getState().selectMe(f,L,Oo.Select,!0)}function j(L){H.getState().selectMe(f,L,Oo.ContextMenu,!0),H.getState().set(k=>{L.intersections.length>0&&L.intersections[0].eventObject===L.eventObject&&(k.contextMenuObjectType=z.Wall)})}return a?h.jsxs("group",{name:"Wall Parapet Group",position:[0,0,n],onContextMenu:j,onPointerDown:W,children:[h.jsx(nw,{name:"Body Extrude Mesh",args:[T,{steps:1,depth:C,bevelEnabled:!1}],children:h.jsx("meshStandardMaterial",{color:l,map:P})}),h.jsx(jn,{position:[y,0,0],points:R,color:"black",lineWidth:.2}),h.jsx(jn,{position:[-y,0,0],points:R,color:"black",lineWidth:.2}),h.jsx(jn,{position:[0,0,C],points:S,color:"black",lineWidth:.2}),h.jsx(nw,{name:"Copings Extrude Mesh",position:[0,0,C],args:[A,{steps:1,depth:d,bevelEnabled:!1}],children:h.jsx("meshStandardMaterial",{color:l})}),h.jsx(jn,{position:[0,0,C+d],points:x,color:"black",lineWidth:.2}),h.jsx(jn,{position:[0,0,C],points:x,color:"black",lineWidth:.2})]}):null};function BSe(t){const e=(t.ly+t.copingsWidth)/2,n=(t.ly-t.copingsWidth)/2;return{innerPoints:uX(t,e),outerPoints:uX(t,n)}}function uX(t,e){const{leftPoint:n,rightPoint:o}=t,r=new ie().fromArray(n),i=new ie().fromArray(o),l=new ie().subVectors(i,r).applyEuler(new nn(0,0,Gt)).normalize().clone().multiplyScalar(e);return{leftPoint:r.clone().add(l),rightPoint:i.clone().add(l)}}function mO(t,e){return Math.abs(t[0]-e[0]){const{id:n,lx:o,lz:r}=t,i=H(l3),a=H(e5),l=H(i3),s=H(a3),c=Tn(Tb),u=ht(h3),d=m.useRef(0),f=m.useRef(),p=m.useMemo(()=>{if(!u||e)return;const g=c.get(n);if(!g)return;const y=g.reduce((U,O)=>U+O,0),w=t.fill===El.Partial&&!me.isPartialWallFull(t),b=me.getWallVertices(t,0),C=w?me.getPartialWallVertices(t,0):b,P=me.getPolygonArea(b);let v=w?me.getPolygonArea(C):P;if(v===0)return;const T=i(z.Window,n),A=i(z.Door,n);if(T&&T.length>0)for(const U of T)v-=me.getWindowArea(U,t);if(A&&A.length>0)for(const U of A)v-=U.lx*U.lz*t.lx*t.lz;const x=H.getState().world,S=r3*(x.solarRadiationHeatmapGridCellSize??.5),R=me.getHighestPointOfWall(t),M=Math.max(2,Math.round(o/S)),D=Math.max(2,Math.round(R/S)),E=o/M,W=R/D,j=(R-t.lz)/2,L=y/v*(a??Qm);d.current=L<0?1:0,f.current=me.getEuler(Io,Oc,"YXZ",Math.sign(L)*Gt);const k=[],N=w?me.getPartialWallVertices(t,0):me.getWallVertices(t,0);let F;for(let U=0;U0)for(const $ of T){if($.type!==z.Window)continue;const Q=$.cx*t.lx,le=$.cz*t.lz,q=$.lx*t.lx/2,te=$.lz*t.lz/2;if($.windowType===Ti.Arched){if(_>=Q-q&&_=le-te&&X=Q-q&&_=le-te&&X0)for(const $ of A){const Q=$.cx*o,le=$.cz*R,q=$.lx*o/2,te=$.lz*R/2;if(_>=Q-q&&_=le-te&&Xh.jsxs(be.Fragment,{children:[h.jsx(jn,{points:g,name:"Heat Flux "+y,lineWidth:s??Zm,color:l??g0}),h.jsx(Rd,{userData:{unintersectable:!0},position:g[d.current].clone().add(new ie(0,d.current===0?-.1:.1,0)),args:[.06,.2,4,1],name:"Normal Vector Arrow Head",rotation:f.current??[0,0,0],children:h.jsx("meshBasicMaterial",{attach:"material",color:l??g0})})]},y))}):null},Hen=be.memo(Ren),$ie="Wall Block Plane",Men="Wall Intersection Plane",sP=.1,Ien=be.memo(({transparent:t,color:e,opacity:n})=>{const r=H(Dw).z<=0;return h.jsx("meshStandardMaterial",{color:t?e:"white",transparent:t,opacity:n,side:r?p0:$r})}),zen=({wallModel:t,foundationModel:e})=>{var mu,un,$t,Bt,pn,Pn;let{id:n,cx:o,cy:r,lx:i=1,ly:a=.5,lz:l=5,relativeAngle:s,leftJoints:c,rightJoints:u,textureType:d,color:f="white",lineColor:p="black",lineWidth:g=.2,parentId:y,locked:w=!1,roofId:b,leftRoofHeight:C,rightRoofHeight:P,centerRoofHeight:v,centerLeftRoofHeight:T,centerRightRoofHeight:A,wallStructure:x=gc.Default,structureSpacing:S=2,structureWidth:R=.1,structureColor:M="white",opacity:D=.5,fill:E=El.Full,leftUnfilledHeight:W=.5,rightUnfilledHeight:j=.5,leftTopPartialHeight:L=l,rightTopPartialHeight:k=l,parapet:N=Jye,leftPoint:F,rightPoint:U}=t;C=c.length>0?C:l,P=u.length>0?P:l;const O=i$e(d),B=Es(n),_=H(fn),X=H(Cb),$=H(Y0),Q=H(En),le=H(Oge),q=Tn(u1),te=H(zw),re=H(Ds),ae=H(_ge),se=H(AOe),ne=H(Cf),fe=ht(xh),ge=ht(Ss),de=ht($e=>$e.elementBeingCanceledId),Z=ht($e=>$e.showWallIntersectionPlaneId),[he,xe]=m.useState(!1),[He,Se]=m.useState(null),{camera:ze,gl:Ie}=oi(),{elementsOnWall:ye,leftWall:ce,rightWall:pe}=jQt(n,c[0],u[0]),ve=a$e(e),Ae=m.useRef(null),Te=m.useRef(null),Me=m.useRef(null),Pe=m.useRef(null),Ee=m.useRef(null),Be=m.useRef(null),Je=m.useRef(null),We=m.useRef(null),Ke=i/2,Ne=a/2,De=l/2,ke=ve?ve.rotation[2]+s:s,Ye=me.getInnerWallOffset(ce,i,a,s,"left"),it=me.getInnerWallOffset(pe,i,a,s,"right"),Ve=x===gc.Stud||x===gc.Pillar,yt=C??l,ct=P??l,Xe=E===El.Partial,ut=Xe?W:0,ft=Xe?j:0,ot=Xe?Math.min(yt,L):yt,st=Xe?Math.min(ct,k):ct,at=Xe&&(!me.isZero(yt-ot)||!me.isZero(ct-st)),Oe=re&&!Ve,Ze=N.display,St=Math.max(ot,st)-De,Pt=m.useMemo(()=>new Xt,[]),Rt=m.useMemo(()=>new l0,[]),Ut=m.useMemo(()=>new mf({color:"white",side:$r,transparent:Ve,opacity:D}),[Ve,D]),Ht=m.useMemo(()=>me.getHighestPointOfWall(t),[t.lz,t.leftRoofHeight,t.rightRoofHeight,t.centerRoofHeight,t.centerLeftRoofHeight,t.centerRightRoofHeight]),At=m.useMemo(()=>{const $e=new Fl;return Qe($e,i,l,0,0,0,0),ye.forEach(bt=>{if(bt.type===z.Window&&bt.id!==Je.current&&bt.lx>0&&bt.lz>0){const Lt=bt,xt=new Fl,[jt,Kt,sn,yn]=[bt.lx*i,bt.lz*l,bt.cx*i,bt.cz*l];if(Lt.windowType)switch(Lt.windowType){case Ti.Arched:mn(xt,jt,Kt,sn,yn,Lt.archHeight);break;case Ti.Polygonal:{const[An,bn]=Lt.polygonTop??Gp;Hn(xt,jt,Kt,sn,yn,An*jt,bn);break}case Ti.Default:default:an(xt,jt,Kt,sn,yn)}else an(xt,jt,Kt,sn,yn);$e.holes.push(xt)}}),$e},[i,l,E,W,j,ot,st,ye,C,P,v,T,A]),kt=m.useMemo(()=>{const $e=new Fl,bt=l,Lt=l/2;if(Xe)$e.moveTo(-Ke+Ye,-Lt+W),$e.lineTo(Ke-it,-Lt+j);else{$e.moveTo(-Ke+Ye,-Lt);const xt=ye.filter(jt=>jt.type===z.Door).sort((jt,Kt)=>jt.cx-Kt.cx);for(const jt of xt)if(jt.id!==Je.current){const[Kt,sn,yn,An]=[jt.cx*i,jt.cz*bt,jt.lx*i,jt.lz*bt];if(jt.doorType===Pd.Default)$e.lineTo(Kt-yn/2,-Lt),$e.lineTo(Kt-yn/2,-Lt+An),$e.lineTo(Kt+yn/2,-Lt+An),$e.lineTo(Kt+yn/2,-Lt);else{const bn=Math.min(jt.archHeight,An,yn/2);if($e.lineTo(Kt-yn/2,-Lt),bn>.1){$e.lineTo(Kt-yn/2,-Lt+An/2-bn);const Ln=bn/2+yn**2/(8*bn),[Yn,Wn]=[Kt,sn+An/2-Ln],oo=Math.acos(Math.min(yn/2/Ln,1)),qn=Math.PI-oo;$e.absarc(Yn,Wn,Ln,qn,oo,!0)}else $e.lineTo(Kt-yn/2,-Lt+An),$e.lineTo(Kt+yn/2,-Lt+An);$e.lineTo(Kt+yn/2,-Lt)}}$e.lineTo(Ke-it,-Lt)}if(at){const xt=st-ot,jt=(i-it)*xt/i,Kt=Ye*xt/i;$e.lineTo(Ke-it,-Lt+ot+jt),$e.lineTo(-Ke+Ye,-Lt+ot+Kt)}else b?(P?$e.lineTo(Ke-it,P-Lt):$e.lineTo(Ke-it,Lt),A&&$e.lineTo(A[0]*i,A[1]-Lt),v&&$e.lineTo(v[0]*i,v[1]-Lt),T&&$e.lineTo(T[0]*i,T[1]-Lt),C?$e.lineTo(-Ke+Ye,C-Lt):$e.lineTo(-Ke+Ye,Lt)):($e.lineTo(Ke-it,Lt),$e.lineTo(-Ke+Ye,Lt));return $e.closePath(),ye.forEach(xt=>{if(xt.type===z.Window&&xt.id!==Je.current&&xt.lx>0&&xt.lz>0){const jt=xt,Kt=new Fl,[sn,yn,An,bn]=[xt.lx*i,xt.lz*l,xt.cx*i,xt.cz*l];if(jt.windowType)switch(jt.windowType){case Ti.Arched:mn(Kt,sn,yn,An,bn,jt.archHeight);break;case Ti.Polygonal:{const[Ln,Yn]=jt.polygonTop??Gp;Hn(Kt,sn,yn,An,bn,Ln*sn,Yn);break}case Ti.Default:default:an(Kt,sn,yn,An,bn);break}else an(Kt,sn,yn,An,bn);$e.holes.push(Kt)}}),$e},[i,l,E,W,j,ot,st,Ye,it,ye,b,C,P,v,T,A]),gt=m.useMemo(()=>Xe?(ot+st)/2-De:De,[De,Xe,ot,st]),dt=m.useMemo(()=>{const $e=st-ot;return!Xe||Math.abs($e)<.01?0:Math.atan2($e,i)},[i,Xe,ot,st]),Ct=m.useMemo(()=>{const $e=new Fl;if(!Xe||Math.abs(dt)<1e-4)return gn($e,i,a,Ye,it),$e;{const bt=i/2,Lt=a/2,xt=Math.cos(dt),jt=bt/xt,Kt=(bt-Ye)/xt,sn=(bt-it)/xt;return $e.moveTo(-jt,-Lt),$e.lineTo(jt,-Lt),$e.lineTo(sn,Lt),$e.lineTo(-Kt,Lt),$e.closePath(),$e}},[i,a,Ye,it,Xe,dt]),tt=m.useMemo(()=>{const $e=[],bt=i/2,Lt=l/2;return Xe?($e.push({x:-bt+Ye,y:-Lt+ut}),$e.push({x:bt-it,y:-Lt+ft})):($e.push({x:-bt,y:-Lt}),$e.push({x:bt,y:-Lt})),at?($e.push({x:bt-it,y:-Lt+st}),$e.push({x:-bt+Ye,y:-Lt+ot})):(P?$e.push({x:bt,y:P-Lt}):$e.push({x:bt,y:Lt}),A&&$e.push({x:A[0]*i,y:A[1]-Lt}),v&&$e.push({x:v[0]*i,y:v[1]-Lt}),T&&$e.push({x:T[0]*i,y:T[1]-Lt}),C?$e.push({x:-bt,y:C-Lt}):$e.push({x:-bt,y:Lt})),$e},[i,l,E,ut,ft,ot,st,C,P,v,T,A]),Fe=m.useMemo(()=>{const $e=[];let bt=0,Lt=0;if(E===El.Partial&&(bt=(j-W)/i,Lt=W+Ke*bt),x===gc.Stud){let xt=-Ke+R/2;for(;xt<=Ke;)$e.push([xt,bt*xt+Lt]),xt+=S;xt=Ke-R/2,$e.push([xt,bt*xt+Lt])}else if(x===gc.Pillar){let xt=-Ke;for(;xt<=Ke;)$e.push([xt,bt*xt+Lt]),xt+=S;$e.push([Ke,bt*Ke+Lt])}return $e},[x,R,S,i,a,l,W,j]),qe=m.useMemo(()=>({id:n,parentId:y,cx:o,cy:r,hx:Ke,hy:Ne,angle:s,selected:B}),[n,y,o,r,Ke,Ne,s,B]),je=m.useMemo(()=>({leftPoint:F,rightPoint:U,ly:a,copingsWidth:N.copingsWidth}),[F,U,a,N.copingsWidth]),rt=m.useMemo(()=>!ce||!ce.parapet||!ce.parapet.display?null:{leftPoint:ce.leftPoint,rightPoint:ce.rightPoint,ly:ce.ly,copingsWidth:ce.parapet.copingsWidth},[ce==null?void 0:ce.leftPoint,ce==null?void 0:ce.rightPoint,ce==null?void 0:ce.ly,(mu=ce==null?void 0:ce.parapet)==null?void 0:mu.copingsWidth,(un=ce==null?void 0:ce.parapet)==null?void 0:un.display]),mt=m.useMemo(()=>!pe||!pe.parapet||!pe.parapet.display?null:{leftPoint:pe.leftPoint,rightPoint:pe.rightPoint,ly:pe.ly,copingsWidth:pe.parapet.copingsWidth},[pe==null?void 0:pe.leftPoint,pe==null?void 0:pe.rightPoint,pe==null?void 0:pe.ly,($t=pe==null?void 0:pe.parapet)==null?void 0:$t.copingsWidth,(Bt=pe==null?void 0:pe.parapet)==null?void 0:Bt.display]);m.useEffect(()=>{We.current&&We.current.id===de&&(We.current=null,ir())},[de]),m.useEffect(()=>{if(t&&ge){const $e=q(t.id);if($e){const bt=me.fetchHeatmapTexture($e,ne??5);if(bt){bt.wrapS=Hs,bt.wrapT=Hs;const Lt=l===Ht?0:(1-l/Ht)/2;bt.offset.set(-i/2,-Ht/2-Lt),bt.center.set(i/2,Ht/2),bt.repeat.set(1/i,1/Ht),Se(bt)}}}},[ge,ne]),m.useEffect(()=>{b&&(ae.has(b)||se.has(b))&&H.getState().set($e=>{const bt=new Set;for(const Lt of $e.elements)if(Lt.id===n&&Lt.type===z.Wall){const xt=Lt;if(xt.roofId=null,xt.leftRoofHeight=void 0,xt.rightRoofHeight=void 0,xt.centerRoofHeight=void 0,xt.centerLeftRoofHeight=void 0,xt.centerRightRoofHeight=void 0,ye.length>0){const jt=Cn.getWallPoints2D(xt);ye.forEach(Kt=>{if(Kt.type===z.Polygon)return;const sn=Kt.type===z.Door,yn=Kt.type===z.SolarPanel,An=yn?Kt.lx-.01:Kt.lx*i,bn=yn?Kt.ly-.01:Kt.lz*l,Ln=new ie(Kt.cx*i,0,Kt.cz*l);me.isElementInsideWall(Ln,An,bn,jt,sn)||(bt.add(Kt.id),$e.autoDeletedChild?$e.autoDeletedChild.push(Kt):$e.autoDeletedChild=[Kt])})}break}bt.size>0?$e.elements=$e.elements.filter(Lt=>!bt.has(Lt.id)):$e.autoDeletedChild===null&&($e.autoDeletedChild=[])})},[b,ae,se]);function Qe($e,bt,Lt,xt=0,jt=0,Kt=0,sn=0,yn=!0){const An=bt/2,bn=Lt/2;if(Xe?$e.moveTo(xt-An+Kt,jt-bn+W):$e.moveTo(xt-An+Kt,jt-bn),yn){const Ln=ye.filter(Yn=>Yn.type===z.Door).sort((Yn,Wn)=>Yn.cx-Wn.cx);for(const Yn of Ln)if(Yn.id!==Je.current){const[Wn,oo,qn,Ko]=[Yn.cx*bt,Yn.cz*Lt,Yn.lx*bt,Yn.lz*l];if(Yn.doorType===Pd.Default)$e.lineTo(xt+Wn-qn/2,jt-bn),$e.lineTo(xt+Wn-qn/2,jt-bn+Ko),$e.lineTo(xt+Wn+qn/2,jt-bn+Ko),$e.lineTo(xt+Wn+qn/2,jt-bn);else{const li=Math.min(Yn.archHeight,Ko,qn/2);if($e.lineTo(xt+Wn-qn/2,jt-bn),li>.1){$e.lineTo(xt+Wn-qn/2,jt-bn+Ko/2-li);const $i=li/2+qn**2/(8*li),[Or,ya]=[Wn,jt+oo+Ko/2-$i],Ps=Math.acos(Math.min(qn/2/$i,1)),$u=Math.PI-Ps;$e.absarc(Or,ya,$i,$u,Ps,!0)}else $e.lineTo(xt+Wn-qn/2,jt-bn+Ko),$e.lineTo(xt+Wn+qn/2,jt-bn+Ko);$e.lineTo(xt+Wn+qn/2,jt-bn)}}}Xe?$e.lineTo(xt+An-sn,jt-bn+j):$e.lineTo(xt+An-sn,jt-bn),at?($e.lineTo(xt+An-sn,jt-bn+st),$e.lineTo(xt-An+Kt,jt-bn+ot)):b?(P?$e.lineTo(xt+An-sn,P-bn):$e.lineTo(xt+An-sn,jt+bn),A&&$e.lineTo(A[0]*bt,A[1]-bn),v&&$e.lineTo(v[0]*bt,v[1]-bn),T&&$e.lineTo(T[0]*bt,T[1]-bn),C?$e.lineTo(xt-An+Kt,C-bn):$e.lineTo(xt-An+Kt,jt+bn)):($e.lineTo(xt+An-sn,jt+bn),$e.lineTo(xt-An+Kt,jt+bn)),$e.closePath()}function Tt($e,bt){const{cx:Lt,cy:xt,cz:jt}=bt;if(ve&&ke!==void 0){const Kt=me.wallAbsolutePosition(new ie(Lt,xt,jt),ve).setZ(l/2+ve.lz);return new ie().subVectors($e,Kt).applyEuler(new nn(0,0,-ke))}return new ie}function Dt($e){const bt=[];for(let Lt=-1;Lt<=1;Lt+=2)for(let xt=-1;xt<=1;xt+=2){const[jt,Kt]=[Lt,Lt*xt];switch($e.type){case z.Window:{const[sn,yn]=[$e.cx*i,$e.cz*l],[An,bn]=[$e.lx*i/2,$e.lz*l/2],Ln=sn+jt*An,Yn=yn+Kt*bn;bt.push({x:Ln,y:Yn});break}case z.Door:{const[sn,yn]=[$e.cx*i,$e.cz*l],[An,bn]=[$e.lx*i/2,$e.lz*l/2],Ln=sn+jt*An,Yn=yn+Kt*bn;bt.push({x:Ln,y:Yn});break}case z.SolarPanel:{const[sn,yn]=[$e.cx*i,$e.cz*l],[An,bn]=[$e.lx/2,$e.ly/2],Ln=sn+jt*An,Yn=yn+Kt*bn;bt.push({x:Ln,y:Yn})}}}if($e.type===z.Window&&$e.windowType===Ti.Polygonal){const Lt=$e,[xt,jt]=Lt.polygonTop??[0,0];bt.push({x:$e.cx*i+xt*$e.lx*i,y:$e.cz*l+$e.lz*l/2+jt})}return bt}function lt($e,bt=0){if(!Xe)return me.getWallVertices($e,bt);const Lt=$e.lx/2,xt=$e.lz/2,jt={x:-Lt-bt,y:$e.leftUnfilledHeight-xt-bt},Kt={x:Lt+bt,y:$e.rightUnfilledHeight-xt-bt},sn={x:-Lt-bt,y:$e.leftTopPartialHeight-xt+bt},yn={x:Lt+bt,y:$e.rightTopPartialHeight-xt+bt},An=[];return An.push(sn,jt,Kt,yn),at||($e.centerRightRoofHeight&&An.push({x:$e.centerRightRoofHeight[0]*$e.lx,y:$e.centerRightRoofHeight[1]-xt+bt}),$e.centerRoofHeight&&An.push({x:$e.centerRoofHeight[0]*$e.lx,y:$e.centerRoofHeight[1]-xt+bt}),$e.centerLeftRoofHeight&&An.push({x:$e.centerLeftRoofHeight[0]*$e.lx,y:$e.centerLeftRoofHeight[1]-xt+bt})),An}function zt($e,bt,Lt,xt,jt){if(Lt<.1||xt<.1||Lt>i||!b&&xt>l)return Je.current=$e,!1;const Kt=.1;Lt+=Kt,xt+=Kt;for(const sn of ye){if(sn.id===$e||sn.type===z.Polygon)continue;const yn=Dt(sn),An=[];for(let bn=-1;bn<=1;bn+=2)for(let Ln=-1;Ln<=1;Ln+=2){const Yn=bt.x+bn*Lt/2,Wn=bt.z+bn*Ln*xt/2;if(An.push({x:Yn,y:Wn}),me.isPointInside(Yn,Wn,yn))return Je.current=$e,!1}if(jt){const[bn,Ln]=jt,Yn=bt.x+bn*Lt,Wn=bt.z+xt/2+Ln;if(An.push({x:Yn,y:Wn}),me.isPointInside(Yn,Wn,yn))return Je.current=$e,!1}for(const bn of yn)if(me.isPointInside(bn.x,bn.y,An))return Je.current=$e,!1}return Je.current=null,!0}function Ft($e,bt,Lt,xt,jt){return me.isElementInsideWall(bt,Lt,xt,tt,jt)?!0:(Je.current=$e,!1)}function _t($e,bt,Lt,xt){const[jt,Kt]=xt,sn=$e.x+bt*jt,yn=$e.z+Lt/2+Kt;return!!me.isPointInside(sn,yn,lt(t,0))}function tn($e){Pt.x=$e.offsetX/Ie.domElement.clientWidth*2-1,Pt.y=-($e.offsetY/Ie.domElement.clientHeight)*2+1,Rt.setFromCamera(Pt,ze)}function Qt($e){return!($e.button===2||H.getState().addedWallId||Be.current||H.getState().moveHandleType||H.getState().resizeHandleType||H.getState().objectTypeToAdd!==z.None||B||le())}function gn($e,bt,Lt,xt,jt){const Kt=bt/2,sn=Lt/2;$e.moveTo(-Kt,-sn),$e.lineTo(Kt,-sn),$e.lineTo(Kt-jt,sn),$e.lineTo(-Kt+xt,sn),$e.closePath()}function an($e,bt,Lt,xt=0,jt=0){const Kt=bt/2,sn=Lt/2;$e.moveTo(xt-Kt,jt-sn),$e.lineTo(xt+Kt,jt-sn),$e.lineTo(xt+Kt,jt+sn),$e.lineTo(xt-Kt,jt+sn),$e.closePath()}function mn($e,bt,Lt,xt,jt,Kt=0){const sn=bt/2,yn=Lt/2,An=Math.min(Kt,Lt,sn);if($e.moveTo(xt-sn,jt-yn),$e.lineTo(xt+sn,jt-yn),$e.lineTo(xt+sn,jt+yn-An),An>0){const bn=An/2+bt**2/(8*An),[Ln,Yn]=[xt,jt+yn-bn],Wn=Math.acos(Math.min(1,sn/bn)),oo=Math.PI-Wn;$e.absarc(Ln,Yn,bn,Wn,oo,!1)}else $e.lineTo(xt-sn,jt+yn);$e.closePath()}function Hn($e,bt,Lt,xt,jt,Kt,sn){const[yn,An]=[bt/2,Lt/2];$e.moveTo(xt-yn,jt-An),$e.lineTo(xt+yn,jt-An),$e.lineTo(xt+yn,jt+An),$e.lineTo(xt+Kt,jt+An+sn),$e.lineTo(xt-yn,jt+An),$e.closePath()}function Fo($e){const bt=parseFloat((Math.round($e.x/S6)*S6).toFixed(1)),Lt=parseFloat((Math.round($e.z/S6)*S6).toFixed(1));return new ie(bt,$e.y,Lt)}function yo($e){const bt=parseFloat((Math.round($e.x/m9)*m9).toFixed(1)),Lt=parseFloat((Math.round($e.z/m9)*m9).toFixed(1));return new ie(bt,$e.y,Lt)}function So($e){return H.getState().enableFineGrid?$e=yo($e):$e=Fo($e),$e}function $o($e,bt,Lt,xt,jt){H.getState().set(Kt=>{for(const sn of Kt.elements)if(sn.id===$e){if([sn.cx,sn.cy,sn.cz]=bt,[sn.lx,sn.ly,sn.lz]=Lt,xt!==void 0&&(sn.type===z.Window||sn.type===z.Door)&&(sn.archHeight=xt),jt!==void 0&&sn.type===z.Window){const yn=sn;yn.windowType===Ti.Polygonal&&(yn.polygonTop=[...jt])}break}})}function mo($e){return $e.type===z.Window&&$e.windowType===Ti.Polygonal&&$e.polygonTop}function Jn($e){const bt={name:"Add",timestamp:Date.now(),addedElement:$e,undo:()=>{H.getState().removeElementById($e.id,!1)},redo:()=>{H.getState().set(Lt=>{Lt.elements.push(bt.addedElement),Lt.selectedElement=bt.addedElement,Lt.deletedRoofId=null})}};Q(bt)}function uo(){const $e=H.getState().selectedElement;if(!$e)return;const bt=H.getState().getElementById($e.id);if(bt)switch(bt.type){case z.Door:case z.Window:case z.SolarPanel:const Lt={name:`Resize ${bt.type}`,timestamp:Date.now(),resizedElementId:bt.id,resizedElementType:bt.type,oldPosition:[$e.cx,$e.cy,$e.cz],oldDimension:[$e.lx,$e.ly,$e.lz],newPosition:[bt.cx,bt.cy,bt.cz],newDimension:[bt.lx,bt.ly,bt.lz],oldArchHeight:$e.type===z.Window||$e.type===z.Door?$e.archHeight:void 0,newArchHeight:bt.type===z.Window||bt.type===z.Door?bt.archHeight:void 0,oldPolygonTop:mo($e)?[...$e.polygonTop]:void 0,newPolygonTop:mo(bt)?[...bt.polygonTop]:void 0,undo(){$o(this.resizedElementId,this.oldPosition,this.oldDimension,this.oldArchHeight,this.oldPolygonTop)},redo(){$o(this.resizedElementId,this.newPosition,this.newDimension,this.newArchHeight,this.newPolygonTop)}};Q(Lt);break;case z.Polygon:const xt=$e,jt=bt,Kt={name:"Edit Polygon",timestamp:Date.now(),oldValue:[...xt.vertices],newValue:[...jt.vertices],changedElementId:jt.id,changedElementType:jt.type,undo(){te(this.changedElementId,this.oldValue)},redo(){te(this.changedElementId,this.newValue)}};Q(Kt);break}}function ir(){H.getState().set($e=>{$e.addedWindowId=null,$e.addedDoorId=null})}function Rr($e){return $e===z.Window||$e===z.Door}function br($e,bt){const Lt=Eu.getIntersectionObjects($e);return Lt.length>0&&Lt[0].object.name===`${Eu.WALL_OUTSIDE_SURFACE_MESH_NAME} ${bt}`}function Vr($e){return $e.intersections.length>0&&$e.intersections[0].object===$e.eventObject}function Wo($e,bt,Lt){if(H.getState().moveHandleType&&bt&&wn(bt)&&bt.parentId!==$e){const xt=Lt.intersections.filter(Kt=>Kt.eventObject.name.includes(Eu.WALL_OUTSIDE_SURFACE_MESH_NAME)||Kt.eventObject.name.includes(ade)||Kt.eventObject.name===$ie);if(!(xt.length>0&&(xt[0].eventObject.name===$ie||xt[0].eventObject.name.includes(ade))))return!0}return!1}function wn($e){if(!$e)return!1;switch($e.type){case z.Window:case z.Door:case z.SolarPanel:case z.Light:case z.Sensor:return!0}return!1}function In($e){if(H.getState().resizeHandleType!==vt.Arch)return!1;if($e.type===z.Window){const bt=$e;return bt.windowType===Ti.Arched&&bt.archHeight!==void 0}if($e.type===z.Door){const bt=$e;return bt.doorType===Pd.Arched&&bt.archHeight!==void 0}}function ar($e,bt){const Lt=$e.getPoints().map(xt=>({x:xt.x,y:xt.y}));return!me.isPointInside(bt.x,bt.y,Lt)}function No($e,bt,Lt,xt,jt,Kt=!1){const sn=new ie().subVectors(bt,$e).normalize(),[yn,An]=Kt?[bt.y,$e.y]:[$e.y,bt.y];let bn;if(yn(bn.type===z.Wall&&bn.parentId===y&&An.set(bn.id,bn),An),new Map);let xt=!1,jt=0;const Kt={lng:H.getState().language},sn=t;let yn=sn;for(;yn&&yn.rightJoints.length>0;){jt++;const An=Lt.get(yn.rightJoints[0]);if(!An)break;if(bt&&An.lz!==sn.lz)return po(Y.t("message.WallsAreNotAtSameHeight",Kt)),!1;if(An.id===sn.id){xt=!0;break}if(yn=An,jt>100)break}return xt?!0:(po(Y.t("message.WallsAreNotConnected",Kt)),!1)}function xo(){return We.current&&We.current.status===0&&H.getState().moveHandleType===Ho.Mid}function Qo(){return!(H.getState().moveHandleType||H.getState().resizeHandleType||le())}function jo(){return at||W!==j||L!==k?!1:b?!(C!==P||v!==void 0||T!==void 0||A!==void 0):!0}function lr($e,bt,Lt){var yn;tn($e);const jt=((yn=(bt?Rt.intersectObjects([bt]):$e.intersections)[0])==null?void 0:yn.point)??$e.point,Kt=Tt(jt,t),sn=Lt?So(Kt.clone().add(Lt)).sub(Lt):So(Kt);return{relativePointer:Kt,pointerOnGrid:sn}}function fr($e,bt){if(!Ae.current)return null;const{pointerOnGrid:Lt}=lr($e,Ae.current),xt=Lt.x/t.lx,jt=Lt.z/t.lz;return bt===z.Window?Ga.makeWindow(t,xt,0,jt,z.Wall):bt===z.Door?Ga.makeDoor(t):null}function ai($e){$e&&(We.current={id:$e.id,type:$e.type,status:0}),_(bt=>{$e&&(bt.elements.push($e),bt.selectedElement=$e,bt.selectedElementIdSet.clear(),bt.selectedElementIdSet.add($e.id),$e.type===z.Window?bt.addedWindowId=$e.id:$e.type===z.Door&&(bt.addedDoorId=$e.id)),bt.moveHandleType=Ho.Mid,bt.objectTypeToAdd=z.None})}function hr($e){if(!$e)return;const{id:bt,type:Lt}=$e;_(xt=>{xt.elements=xt.elements.filter(jt=>jt.id!==bt),xt.selectedElement=null,xt.moveHandleType=null,xt.objectTypeToAdd=Lt,xt.addedWindowId=null,xt.addedDoorId=null}),We.current=null}function tr($e){if(!$e)return[0,0];switch($e.type){case z.Window:{const bt=ht.getState().oldParentId;if($e.parentId!==bt){const Lt=H.getState().elements.find(xt=>xt.id===bt);return Lt?[$e.lx*Lt.lx/2,$e.lz*Lt.lz/2]:[0,0]}else return[$e.lx*i/2,$e.lz*l/2]}case z.Door:return[$e.lx*i/2,$e.lz*l/2];case z.SolarPanel:return[$e.lx/2,$e.ly/2]}return[sP,sP]}function xi(){const $e=[];if(v){const bt=v[0];if(bt===.5&&C!==void 0)return $e.push(new ie(Ke,v[1]-De),new ie(-Ke,C-De)),$e;if(bt===-.5&&P!==void 0)return $e.push(new ie(Ke,P-De),new ie(-Ke,v[1]-De)),$e}return P!==void 0?$e.push(new ie(Ke,P-De)):$e.push(new ie(Ke,De)),A!==void 0&&$e.push(new ie(A[0]*i,A[1]-De)),v!==void 0&&$e.push(new ie(v[0]*i,v[1]-De)),T!==void 0&&$e.push(new ie(T[0]*i,T[1]-De)),C!==void 0?$e.push(new ie(-Ke,C-De)):$e.push(new ie(-Ke,De)),$e}function Eo($e,bt){const Lt=bt==null?void 0:bt.ignorePadding,xt=bt!=null&&bt.elementHalfSize?[...bt.elementHalfSize]:[0,0],jt=Lt?0:sP,Kt=Lt?0:sP+Ye,sn=Lt?0:sP+it,[yn,An]=xt,[bn,Ln,Yn,Wn]=[-Ke+yn+Kt,Ke-yn-sn,-De+An+jt,De-An-jt],oo=$e.clone();if(jo()){const qn=Xe?W:0,Ko=l-(Xe?ot:l);return oo.setX(me.clamp($e.x,bn,Ln)),oo.setZ(me.clamp($e.z,Yn+qn,Wn-Ko)),oo}else{const qn=hl(yn,An,bn,Ln,jt),Ko=new Xt($e.x,$e.z);let li=1/0,$i=-1/0;if(bt!=null&&bt.resizeAnchor){const Ps=bt.resizeAnchor.x,$u=[];if(at)$u.push(new ie(-Ke,-De+ot),new ie(Ke,-De+st));else{const Ef=xi().reverse();$u.push(...Ef)}for(let Ef=1;Ef<$u.length;Ef++){const Xl=$u[Ef-1],_0=$u[Ef];if(Ps>=Xl.x&&Ps<=_0.x){const Hh=(_0.y-Xl.y)/(_0.x-Xl.x),xp=-Hh*Xl.x+Xl.y;li=Hh*Ps+xp;break}}const Qu=new ie(-Ke,-De+ut),Rh=new ie(Ke,-De+ft),Df=(Rh.y-Qu.y)/(Rh.x-Qu.x),Zu=-Df*Qu.x+Qu.y;$i=Df*Ps+Zu}const Or=Ko.y>li;if(ar(qn,Ko)){const Ps=eo(qn,Ko);oo.setX(Ps.x),oo.setZ(me.clamp(Ps.y,$i+jt,li-jt))}else Or&&oo.setZ(li-jt)}return oo.setZ(Math.max(Yn,oo.z)),oo}function bi($e,bt){_(Lt=>{const xt=Lt.elements.find(jt=>jt.id===$e);if(xt)switch(xt.type){case z.Window:{xt.cx=bt.x/i,xt.cz=bt.z/l,xt.cy=xt.id===Je.current?-.01:.3,xt.tint=xt.id===Je.current?"red":Lt.selectedElement.tint;break}case z.Door:{const jt=l/2;xt.cx=bt.x/i,xt.cz=(bt.z-jt)/2/l,xt.lz=(bt.z+jt)/l;break}case z.SolarPanel:{xt.cx=bt.x/i,xt.cz=bt.z/l,xt.color=xt.id===Je.current?"red":"#fff";break}case z.Sensor:case z.Light:{xt.cx=bt.x/i,xt.cz=bt.z/l;break}case z.Polygon:{const jt=xt;if(jt.vertices.length>0){const Kt=me.calculatePolygonCentroid(jt.vertices),sn=-bt.x/i-Kt.x,yn=-bt.z/l-Kt.y,An=jt.vertices.map(bn=>({x:bn.x+sn,y:bn.y+yn}));xt.vertices=An}break}}})}function hl($e,bt,Lt,xt,jt){const Kt=[],sn=new ie(-Ke,-De+ut),yn=new ie(Ke,-De+ft);if(No(sn,yn,$e,bt,jt,!0),Kt.push({start:new ie(Lt,De),end:new ie(Lt,sn.y)}),Kt.push({start:sn.clone(),end:yn.clone()}),Kt.push({start:new ie(xt,yn.y),end:new ie(xt,De)}),at){const bn=new ie(Ke,-De+st),Ln=new ie(-Ke,-De+ot);No(bn,Ln,$e,bt,jt),Kt.push({start:bn.clone(),end:Ln.clone()})}else{const bn=xi();for(let Ln=1;Ln{const jt=xt.elements.find(An=>An.id===(Lt==null?void 0:Lt.id));if(!jt||jt.type===z.SolarPanel&&jt.parentType===void 0)return;if(jt.type===z.Window){const An=xt.elements.find(bn=>bn.id===jt.parentId);if(An){const bn=jt.lx*An.lx,Ln=jt.lz*An.lz;jt.lx=bn/i,jt.lz=Ln/l}}const{pointerOnGrid:Kt}=lr($e,Ae.current),sn=tr(jt),yn=Eo(Kt,{elementHalfSize:sn,ignorePadding:jt.type===z.SolarPanel});zt(jt.id,yn,sn[0]*2,sn[1]*2),jt.cx=yn.x/i,jt.cz=yn.z/l,jt.parentId=n,jt.foundationId=y,xt.selectedElement&&(xt.selectedElement.parentId=n,xt.selectedElement.foundationId=y),jt.type===z.Window?(jt.cy=jt.id===Je.current?-.01:0,jt.tint=jt.id===Je.current?"red":xt.selectedElement.tint):jt.type===z.SolarPanel&&(jt.color=jt.id===Je.current?"red":"#fff",jt.parentType=z.Wall)}),fe("showWallIntersectionPlaneId",n))}else xo()&&hr(We.current)}function Ai($e){if($e.button!==2){if(xo()){Fn.getState().setEnableOrbitController(!1),xe(!0);const{pointerOnGrid:bt}=lr($e,Ae.current),Lt=Eo(bt);_(xt=>{var jt,Kt;xt.moveHandleType=null,((jt=We.current)==null?void 0:jt.type)===z.Window?(xt.resizeHandleType=vt.LowerRight,xt.resizeAnchor.copy(Lt)):((Kt=We.current)==null?void 0:Kt.type)===z.Door&&(xt.resizeHandleType=vt.UpperRight,xt.resizeAnchor.copy(Lt).setZ(-l/2))}),We.current.status=1}else if(Vr($e))if(H.getState().objectTypeToAdd!==z.None){const Lt=$e.point;Zs(Lt,!0)}else H.getState().groupActionMode?(_(Lt=>{for(const xt of Lt.elements)xt.selected=xt.id===y;Lt.multiSelectionsMode||Lt.selectedElementIdSet.clear(),Lt.selectedElementIdSet.has(y)?Lt.selectedElementIdSet.delete(y):Lt.selectedElementIdSet.add(y)}),$e.stopPropagation()):Qo()&&H.getState().selectMe(n,$e,Oo.Select)}}function ka(){We.current&&We.current.status===0&&(_($e=>{$e.elements.pop(),$e.addedDoorId=null,$e.addedWindowId=null,$e.moveHandleType=null,$e.actionModeLock&&We.current&&($e.objectTypeToAdd=We.current.type)}),We.current=null)}function wi(){xo()&&hr(We.current),Je.current=null}function Fs($e){const bt=H.getState().selectedElement??X();if((bt==null?void 0:bt.parentId)===t.id){if(H.getState().moveHandleType){const Lt=bt.type!==z.Polygon?new ie(-bt.lx/2*i,0,bt.lz/2*l):void 0,{relativePointer:xt,pointerOnGrid:jt}=lr($e,Pe.current,Lt),Kt=tr(bt),sn=Eo(jt,{elementHalfSize:Kt,ignorePadding:bt.type===z.SolarPanel}),[yn,An]=[Kt[0]*2,Kt[1]*2];if(bt.type!==z.SolarPanel&&Ft(bt.id,sn,yn,An),bt.type!==z.Polygon){let bn=!0,Ln;bt.type===z.Window&&bt.windowType===Ti.Polygonal&&(Ln=bt.polygonTop??Gp,bn=_t(sn,yn,An,Ln));const Yn=zt(bt.id,sn,yn,An,Ln);bn&&Yn?Je.current=null:Je.current=bt.id}bi(bt.id,sn)}else if(H.getState().resizeHandleType){const{relativePointer:Lt,pointerOnGrid:xt}=lr($e,Pe.current),jt=H.getState().resizeHandleType,Kt=H.getState().resizeAnchor;switch(bt.type){case z.Window:{const sn=bt,yn=Eo(xt,{resizeAnchor:Kt});if(In(sn)){const{newLz:An,newCz:bn,newArchHeight:Ln}=nr(sn,yn,Kt),Yn=new ie(sn.cx*i,0,bn);zt(sn.id,Yn,sn.lx*i,An),Ft(sn.id,Yn,sn.lx*i,An),_(Wn=>{const oo=Wn.elements.find(qn=>qn.id===sn.id);oo&&(oo.lz=An/l,oo.cz=bn/l,oo.archHeight=Ln,oo.cy=oo.id===Je.current?-.01:.3,oo.tint=oo.id===Je.current?"red":sn.tint)})}else if(jt===vt.Upper){const An=new ie(sn.cx*i,0,sn.cz*l),[bn,Ln]=[sn.lx*i,sn.lz*l],Yn=me.clamp((xt.x-Kt.x)/bn,-.5,.5),Wn=Math.max(0,xt.z-Kt.z),oo=[Yn,Wn];(!zt(sn.id,An,bn,Ln,oo)||!_t(An,bn,Ln,oo))&&(Je.current=sn.id),_(qn=>{const Ko=qn.elements.find(li=>li.id===sn.id);Ko&&(Ko.polygonTop=[...oo],Ko.cy=Ko.id===Je.current?-.01:.3,Ko.tint=Ko.id===Je.current?"red":sn.tint)})}else{const{dimensionXZ:An,positionXZ:bn}=Xn($e,yn,Kt),Ln=new ie(bn.x,0,bn.z);let Yn=!0,Wn;sn.windowType===Ti.Polygonal&&(Wn=sn.polygonTop??Gp,Yn=_t(Ln,An.x,An.z,Wn)),(!zt(sn.id,Ln,An.x,An.z,Wn)||!Yn||!Ft(sn.id,Ln,An.x,An.z))&&(Je.current=sn.id),_(oo=>{const qn=oo.elements.find(Ko=>Ko.id===sn.id);qn&&(qn.lx=An.x/i,qn.lz=An.z/l,qn.cx=bn.x/i,qn.cz=bn.z/l,qn.cy=qn.id===Je.current?-.01:.3,qn.tint=qn.id===Je.current?"red":sn.tint)})}break}case z.Door:{const sn=bt,yn=Eo(xt,{resizeAnchor:Kt});if(In(sn)){const{newLz:An,newCz:bn,newArchHeight:Ln}=nr(sn,yn,Kt),Yn=new ie(sn.cx*i,0,bn);zt(sn.id,Yn,sn.lx*i,An),Ft(sn.id,Yn,sn.lx*i,An,!0),_(Wn=>{const oo=Wn.elements.find(qn=>qn.id===sn.id);oo&&(oo.lz=An/l,oo.cz=bn/l,oo.archHeight=Ln,oo.color=oo.id===Je.current?Lce:bt.color)})}else{const{dimensionXZ:An,positionXZ:bn}=Xn($e,yn,Kt),Ln=new ie(bn.x,0,bn.z);zt(sn.id,Ln,An.x,An.z),Ft(sn.id,Ln,An.x,An.z,!0),_(Yn=>{const Wn=Yn.elements.find(oo=>oo.id===sn.id);Wn&&(Wn.cx=bn.x/i,Wn.lx=An.x/i,Wn.cz=(yn.z-l/2)/2/l,Wn.lz=(yn.z+l/2)/l,Wn.color=Wn.id===Je.current?Lce:bt.color)})}break}case z.SolarPanel:{const sn=bt,[yn,An]=tQe(sn);if(jt===vt.Lower||jt===vt.Upper){const Ln=Math.max(1,Math.round(Math.abs(Lt.z-Kt.z)/An))*An,Yn=new ie(0,0,Lt.z-Kt.z).normalize().multiplyScalar(Ln),Wn=new ie().addVectors(Kt,Yn.clone().divideScalar(2));if(!me.isElementInsideWall(Wn,sn.lx-.01,Ln-.01,tt))return;zt(sn.id,Wn,sn.lx,Math.abs(Yn.z)),_(oo=>{const qn=oo.elements.find(Ko=>Ko.id===sn.id);qn&&(qn.cz=Wn.z/l,qn.ly=Math.abs(Yn.z),qn.color=qn.id===Je.current?"red":"#fff")})}else if(jt===vt.Left||jt===vt.Right){const Ln=Math.max(1,Math.round(Math.abs(Lt.x-Kt.x)/yn))*yn,Yn=new ie(Lt.x-Kt.x,0,0).normalize().multiplyScalar(Ln),Wn=new ie().addVectors(Kt,Yn.clone().divideScalar(2));if(!me.isElementInsideWall(Wn,Ln-.01,sn.ly-.01,tt))return;zt(sn.id,Wn,Math.abs(Yn.x),sn.ly),_(oo=>{const qn=oo.elements.find(Ko=>Ko.id===sn.id);qn&&(qn.cx=Wn.x/i,qn.lx=Math.abs(Yn.x),qn.color=qn.id===Je.current?"red":"#fff")})}break}case z.Polygon:{_(sn=>{const yn=sn.elements.find(An=>An.id===bt.id);(yn==null?void 0:yn.selectedIndex)>=0&&(yn.vertices[yn.selectedIndex].x=-xt.x/i,yn.vertices[yn.selectedIndex].y=-xt.z/l)});break}}}}}function ks(){if(Je.current)We.current&&We.current.status===1?(_($e=>{$e.elements.pop(),$e.actionModeLock&&We.current&&($e.objectTypeToAdd=We.current.type)}),We.current=null):(H.getState().moveHandleType||H.getState().resizeHandleType)&&Eu.undoInvalidOperation();else if(We.current){if(We.current.status===0)_($e=>{$e.elements.pop(),$e.actionModeLock&&We.current&&($e.objectTypeToAdd=We.current.type)}),We.current=null;else if(We.current.status===1){const $e=H.getState().elements,bt=$e[$e.length-1];bt.lx*i<.1||bt.lz*l<.1?_(Lt=>{Lt.elements.pop(),Lt.actionModeLock&&We.current&&(Lt.objectTypeToAdd=We.current.type)}):(_(Lt=>{Lt.actionModeLock&&We.current&&(Lt.objectTypeToAdd=We.current.type,vx.selectNone(Lt))}),Jn(bt)),We.current=null}}else H.getState().moveHandleType?Eu.addUndoableMove():H.getState().resizeHandleType&&uo();Fn.getState().setEnableOrbitController(!0),xe(!1),_($e=>{$e.moveHandleType=null,$e.resizeHandleType=null,$e.selectedElement=$e.elements.find(bt=>{var Lt;return bt.id===((Lt=$e.selectedElement)==null?void 0:Lt.id)})}),fe("showWallIntersectionPlaneId",null),Je.current=null,ir()}function Zs($e,bt){if(ve&&H.getState().objectTypeToAdd){let Lt=null;switch(H.getState().objectTypeToAdd){case z.PyramidRoof:{!b&&Jo(!1,!0)&&(Lt=Ga.makePyramidRoof([t.id],ve));break}case z.GableRoof:{!b&&Jo(!1,!1)&&(Lt=Ga.makeGableRoof([t.id],ve));break}case z.HipRoof:{!b&&Jo(!1,!0)&&(Lt=Ga.makeHipRoof([t.id],ve,i/2));break}case z.GambrelRoof:{!b&&Jo(!1,!1)&&(Lt=Ga.makeGambrelRoof([t.id],ve));break}case z.MansardRoof:{!b&&Jo(!1,!0)&&(Lt=Ga.makeMansardRoof([t.id],ve));break}case z.SolarPanel:{if($e&&bt){const xt=Tt($e,t),jt=H.getState().actionState;Lt=Ga.makeSolarPanel(t,H.getState().getPvModule(jt.solarPanelModelName??"SPR-X21-335-BLK"),xt.x/i,0,xt.z/l,jt.solarPanelOrientation??vr.landscape,jt.solarPanelPoleHeight??1,jt.solarPanelPoleSpacing??3,0,0,new ie(0,-1,0),[Gt,0,0],jt.solarPanelFrameColor)}break}case z.Sensor:{if($e&&bt){const xt=Tt($e,t),jt=t.relativeAngle-Gt;Lt=Ga.makeSensor(t,(xt.x-.05)/i,0,(xt.z-.05)/l,new ie(Math.cos(jt),Math.sin(jt),0),[0,0,0])}break}case z.Light:{if($e&&bt){const xt=Tt($e,t),jt=t.relativeAngle-Gt,Kt=H.getState().actionState;Lt=Ga.makeLight(t,2,Kt.lightDistance,Kt.lightIntensity,Kt.lightColor,(xt.x-.05)/i,0,(xt.z-.05)/l,new ie(Math.cos(jt),Math.sin(jt),0),[0,0,0])}break}case z.BatteryStorage:{if($e&&bt){const xt=Tt($e,t);H.getState().actionState,Lt=Ga.makePowerWall(t,xt.x/i,0,xt.z/l)}break}}Lt&&(Jn(Lt),_(xt=>{xt.elements.push(Lt),Lt&&Lt.type===z.Roof&&xt.addedRoofIdSet.add(Lt.id),xt.actionModeLock||(xt.objectTypeToAdd=z.None)}))}}function Ui($e,bt,Lt){Ee.current||($(n,$e,Oo.ContextMenu),_(xt=>{$e.intersections.length>0&&$e.intersections[0].object===bt&&(xt.contextMenuObjectType=z.Wall,Lt&&xt.pastePoint.copy($e.intersections[0].point))}),$e.stopPropagation())}function fa($e){if($e.button===2)return;const bt=H.getState().objectTypeToAdd;!xo()&&!le()&&Vr($e)&&bt===z.None?H.getState().groupActionMode?(_(Lt=>{for(const xt of Lt.elements)xt.id===y?xt.selected=!0:xt.selected=!1}),$e.stopPropagation()):Qo()&&H.getState().selectMe(n,$e,Oo.Select):Cn.isTypeRoof(bt)&&Ai($e)}function Bl($e){$e.button===2||$e.intersections.length===0||$e.intersections[0].object!==$e.eventObject||(H.getState().groupActionMode?_(bt=>{for(const Lt of bt.elements)Lt.selected=Lt.id===y;bt.selectedElementIdSet.clear(),bt.selectedElementIdSet.add(y)}):(Qt($e)&&(_(bt=>{bt.contextMenuObjectType=null}),$(n,$e,Oo.Select)),Zs(),$e.stopPropagation()))}function Gl($e){$e.intersections.length>0&&$e.intersections[0].object===$e.eventObject&&($(n,$e,Oo.ContextMenu),_(bt=>{bt.contextMenuObjectType=z.Wall}),$e.stopPropagation())}function qu(){let[$e,bt]=v??[0,(ot+st)/2];$e=$e*i;const Lt=$e+Ke,xt=Math.hypot(Lt,bt-ot),jt=-Math.atan2(bt-ot,Lt),Kt=Ke-$e,sn=Math.hypot(Kt,st-bt),yn=-Math.atan2(st-bt,Kt);return h.jsxs("group",{name:`wall stud group ${n}`,children:[Fe.map(([An,bn],Ln)=>{let Yn;return An<$e?Yn=(An+Ke)*(bt-ot)/($e+Ke)+ot-bn:Yn=(An-Ke)*(bt-st)/($e-Ke)+st-bn,h.jsx(Qr,{args:[R,a,Yn],position:[An,Ne,(Yn-l)/2+bn],castShadow:re,receiveShadow:re,onContextMenu:Gl,onPointerDown:Bl,children:h.jsx("meshStandardMaterial",{color:M})},Ln)}),h.jsx(Qr,{args:[xt,a,a],position:[-Ke+Lt/2,Ne,(ot+bt)/2-De-a/2],rotation:[0,jt,0],castShadow:re,receiveShadow:re,onContextMenu:Gl,onPointerDown:Bl,children:h.jsx("meshStandardMaterial",{color:M})}),h.jsx(Qr,{args:[sn,a,a],position:[Ke-Kt/2,Ne,(st+bt)/2-De-a/2],rotation:[0,yn,0],castShadow:re,receiveShadow:re,onContextMenu:Gl,onPointerDown:Bl,children:h.jsx("meshStandardMaterial",{color:M})})]})}function Rc(){let[$e,bt]=v??[0,(ot+st)/2];$e=$e*i;const Lt=$e+Ke,xt=Math.hypot(Lt,bt-ot),jt=-Math.atan2(bt-ot,Lt),Kt=Ke-$e,sn=Math.hypot(Kt,st-bt),yn=-Math.atan2(st-bt,Kt),An=a;return h.jsxs("group",{name:`wall pillar group ${n}`,position:[0,-a/2,0],children:[Fe.map(([bn,Ln],Yn)=>{let Wn;return bn<$e?Wn=(bn+Ke)*(bt-ot)/($e+Ke)+ot-Ln:Wn=(bn-Ke)*(bt-st)/($e-Ke)+st-Ln,h.jsx(ca,{args:[R/2,R/2,Wn],position:[bn,Ne,(Wn-l)/2+Ln],rotation:[-Gt,0,0],castShadow:re,receiveShadow:re,onContextMenu:Gl,onPointerDown:Bl,children:h.jsx("meshStandardMaterial",{color:M})},Yn)}),h.jsx(Qr,{args:[xt,R,An],position:[-Ke+Lt/2,Ne,(ot+bt)/2-De-An/2],rotation:[0,jt,0],castShadow:re,receiveShadow:re,onContextMenu:Gl,onPointerDown:Bl,children:h.jsx("meshStandardMaterial",{color:M})}),h.jsx(Qr,{args:[sn,R,An],position:[Ke-Kt/2,Ne,(st+bt)/2-De-An/2],rotation:[0,yn,0],castShadow:re,receiveShadow:re,onContextMenu:Gl,onPointerDown:Bl,children:h.jsx("meshStandardMaterial",{color:M})})]})}return h.jsxs(h.Fragment,{children:[(D>0||x===gc.Default)&&h.jsxs(h.Fragment,{children:[h.jsxs("mesh",{name:"Wall Simulation Mesh",uuid:n,userData:{simulation:!0},rotation:[Gt,0,0],castShadow:!1,receiveShadow:!1,visible:!1,children:[h.jsx("shapeGeometry",{args:[At]}),h.jsx("meshBasicMaterial",{side:$r})]}),h.jsxs("mesh",{name:`${Eu.WALL_OUTSIDE_SURFACE_MESH_NAME} ${n}`,ref:Ae,rotation:[Gt,0,0],castShadow:Oe,receiveShadow:re,onContextMenu:$e=>{Ui($e,Ae.current,!0)},onPointerMove:or,onPointerDown:Ai,onPointerUp:ka,onPointerOut:wi,children:[h.jsx("shapeGeometry",{args:[At]}),ge&&He?h.jsx("meshBasicMaterial",{attach:"material",map:He,color:"white",opacity:D,transparent:Ve}):h.jsx("meshStandardMaterial",{attach:"material",color:d===Uo.Default||d===Uo.NoTexture?f:"white",map:O,transparent:Ve,opacity:D})]}),h.jsxs("mesh",{rotation:[Gt,0,0],position:[0,.05,0],castShadow:Oe,children:[h.jsx("shapeGeometry",{args:[kt]}),h.jsx("meshStandardMaterial",{color:"white",side:p0,transparent:Ve,opacity:D})]}),h.jsxs("mesh",{name:"Inside Wall",ref:Te,position:[0,a,0],rotation:[Gt,0,0],castShadow:Oe,receiveShadow:re,onPointerDown:fa,onContextMenu:$e=>{Ui($e,Te.current)},children:[h.jsx("shapeGeometry",{args:[kt]}),h.jsx(Ien,{transparent:Ve,color:f,opacity:D})]}),h.jsxs("mesh",{rotation:[Gt,0,0],position:[0,a-.01,0],receiveShadow:!0,children:[h.jsx("shapeGeometry",{args:[kt]}),h.jsx("meshStandardMaterial",{color:"white",side:Ra,transparent:Ve,opacity:D})]}),(!b||at)&&!Ze&&h.jsx("mesh",{name:"Top Wall",ref:Me,material:Ut,position:[0,Ne,gt],rotation:[0,-dt,0],castShadow:Oe,receiveShadow:re,onPointerDown:fa,onContextMenu:$e=>{Ui($e,Me.current)},children:h.jsx("shapeGeometry",{args:[Ct]})}),Ye===0&&h.jsx(ua,{args:[ot-ut,a],material:Ut,position:[-Ke+.01,Ne,-De+ut+(ot-ut)/2],rotation:[0,Gt,0],castShadow:Oe,receiveShadow:re,onPointerDown:fa}),it===0&&h.jsx(ua,{args:[st-ft,a],material:Ut,position:[Ke-.01,Ne,-De+ft+(st-ft)/2],rotation:[0,Gt,0],castShadow:Oe,receiveShadow:re,onPointerDown:fa}),(he||Z===n)&&((pn=H.getState().selectedElement)==null?void 0:pn.parentId)===n&&h.jsxs(h.Fragment,{children:[h.jsx(ua,{ref:Pe,name:Men,args:[1e4,1e4],position:[0,a/3,0],rotation:[Gt,0,0],onPointerMove:Fs,onPointerUp:ks,visible:!1,children:h.jsx("meshBasicMaterial",{color:"blue",side:$r})}),h.jsx(ua,{name:$ie,args:[i,l],rotation:[Gt,0,0],position:[0,a,0],onPointerMove:()=>{},visible:!1})]}),ye.map($e=>{switch($e.type){case z.Window:return h.jsx(L$e,{...$e,cx:$e.cx*i,cy:$e.cy*a,cz:$e.cz*l,lx:$e.lx*i,ly:a,lz:$e.lz*l},$e.id);case z.Door:return E!==El.Full?null:h.jsx(xen,{...$e,cx:$e.cx*i,cy:0,cz:$e.cz*l,lx:$e.lx*i,ly:a,lz:$e.lz*l},$e.id);default:return null}})]}),ye.map($e=>$e.type===z.Polygon&&E!==El.Empty?h.jsx(eQe,{...$e},$e.id):null),x===gc.Stud&&qu(),x===gc.Pillar&&Rc(),Ze&&h.jsx(Cen,{args:N,wallData:qe,parapetZ:St,currWallPointData:je,leftWallPointData:rt,rightWallPointData:mt}),(x===gc.Default||w&&B)&&h.jsx(den,{lineColor:B&&w?y0:p,lineWidth:B&&w?2:g,hx:Ke,hz:De,fill:E,isTopPartial:at,leftUnfilledHeight:W,rightUnfilledHeight:j,showParapet:Ze,leftHeight:ot,rightHeight:st,center:v,centerLeft:T,centerRight:A}),B&&h.jsx(jye,{element:t,verticalLift:0}),(he||Z===n)&&((Pn=H.getState().selectedElement)==null?void 0:Pn.parentId)===n&&h.jsx("group",{position:[0,-.001,0],rotation:[Gt,0,0],children:h.jsx(Xge,{hx:Ke,hy:De,hz:0})}),h.jsx(Hen,{wallModel:t,notBuilding:ve.notBuilding})]})};function tQe(t){const e=H.getState().getPvModule(t.pvModelName);return t.orientation===vr.landscape?[e.length,e.width]:[e.width,e.length]}const Den=(t,e)=>t.wallModel===e.wallModel,Een=be.memo(zen,Den);class Cn{static getWireframetStyle(e,n,o,r){return[o&&r?y0:e,o&&r?1:n]}static getComposedWallNormal(e){return new ie().subVectors(e.leftPoint,e.rightPoint).applyEuler(mG).normalize()}static getWallNormal(e){return new ie().subVectors(new ie(e.leftPoint[0],e.leftPoint[1]),new ie(e.rightPoint[0],e.rightPoint[1])).applyEuler(mG).normalize()}static isTypeRoof(e){return e===z.Roof||e===z.PyramidRoof||e===z.HipRoof||e===z.GableRoof||e===z.GambrelRoof||e===z.MansardRoof}static getIntersectionPoint(e,n,o,r){if(Math.abs(e.x-n.x)<.001&&Math.abs(o.x-r.x)<.001)return n.clone();const i=(n.y-e.y)/(n.x-e.x),a=(r.y-o.y)/(r.x-o.x);if(Math.abs(i-a)<.001)return n.clone();const l=[e.x,n.x,o.x,r.x],s=[e.y,n.y,o.y,r.y],c=((l[2]-l[3])*(l[1]*s[0]-l[0]*s[1])-(l[0]-l[1])*(l[3]*s[2]-l[2]*s[3]))/((l[2]-l[3])*(s[0]-s[1])-(l[0]-l[1])*(s[2]-s[3])),u=((s[2]-s[3])*(s[1]*l[0]-s[0]*l[1])-(s[0]-s[1])*(s[3]*l[2]-s[2]*l[3]))/((s[2]-s[3])*(l[0]-l[1])-(s[0]-s[1])*(l[2]-l[3]));return!Number.isFinite(c)||!Number.isFinite(u)?n.clone():new ie(c,u)}static getDistance(e,n,o){const r=n.y-e.y;if(r===0)return Math.abs(e.y-o.y);const i=e.x-n.x;if(i===0)return Math.abs(e.x-o.x);const a=n.x*e.y-e.x*n.y,l=Math.abs((r*o.x+i*o.y+a)/Math.sqrt(r*r+i*i));return l===0?1/0:l}static getWallPoints2D(e,n,o,r){const{lx:i,lz:a,rightRoofHeight:l,leftRoofHeight:s}=e,c=o??e.centerLeftRoofHeight,u=n??e.centerRoofHeight,d=r??e.centerRightRoofHeight,f=[],p=i/2,g=a/2;return f.push({x:-p,y:-g}),f.push({x:p,y:-g}),l?f.push({x:p,y:l-g}):f.push({x:p,y:g}),d&&f.push({x:d[0]*i,y:d[1]-g}),u&&f.push({x:u[0]*i,y:u[1]-g}),c&&f.push({x:c[0]*i,y:c[1]-g}),s?f.push({x:-p,y:s-g}):f.push({x:-p,y:g}),f}static isPointInside(e,n,o){let r=!1;for(let i=0,a=e.length-1;io!=u>o&&n<(c-l)*(o-s)/(u-s)+l&&(r=!r)}return r}static isRoofValid(e,n,o,r,i,a){for(const l of H.getState().elements)if(l.type===z.Wall&&l.roofId===e){const s=l;let c=[];if(s.id===n)c=Cn.getWallPoints2D(s,r,i,a);else if(s.id===o){let u,d,f;r&&(u=[-r[0],r[1]]),a&&(d=[-a[0],a[1]]),i&&(f=[-i[0],i[1]]),c=Cn.getWallPoints2D(s,u,d,f)}if(s.id===n||s.id===o){for(const u of H.getState().elements)if(u.parentId===s.id){let d=u.lx/2,f=u.lz/2,p=sP;u.type===z.SolarPanel&&(d=(d-.01)/s.lx,f=(u.ly/2-.01)/s.lz,p=0);const g=u.cx*s.lx-d*s.lx,y=u.cx*s.lx+d*s.lx,w=u.cz*s.lz+f*s.lz+p;if(!Cn.isPointInside(c,g,w)||!Cn.isPointInside(c,y,w))return!1}}}return!0}static getSegmentIdx(e,n){for(let o=0;oi.z){const u=[l,a,r];return me.isPointInside(o.x,o.y,u.map(me.mapVector3ToPoint2))?[r,a,l]:[r,i,a]}else{const u=[l,a,i];return me.isPointInside(o.x,o.y,u.map(me.mapVector3ToPoint2))?[i,a,l]:[i,l,r]}else if(s<=c){const u=[l,a,i];return me.isPointInside(o.x,o.y,u.map(me.mapVector3ToPoint2))?[i,a,l]:[i,l,r]}else{const u=[l,a,r];return me.isPointInside(o.x,o.y,u.map(me.mapVector3ToPoint2))?[r,a,l]:[r,i,a]}}static getSegmentNormal(e){const[n,o,r]=e;return new ie().crossVectors(new ie().subVectors(n,o),new ie().subVectors(n,r)).normalize()}static getRotationFromNormal(e){return me.isSame(e.normalize(),Io)?[0,0,0]:[Math.PI/2-Math.atan2(e.z,Math.hypot(e.x,e.y)),0,Math.atan2(e.y,e.x)+Math.PI/2]}static getRooftopElementZ(e,n,o){const[r,i,a]=e,l=(i.y-r.y)*(a.z-r.z)-(i.z-r.z)*(a.y-r.y),s=(i.z-r.z)*(a.x-r.x)-(i.x-r.x)*(a.z-r.z),c=(i.x-r.x)*(a.y-r.y)-(i.y-r.y)*(a.x-r.x);return-(-(l*r.x+s*r.y+c*r.z)+l*n.x+s*n.y)/c+o}static computeState(e,n,o){const r=Cn.getSegmentIdx(e,n);if(o)return{segmentIdx:-1,segmentVertices:null,normal:new ie(0,0,1),rotation:[0,0,0]};if(r!==-1){const i=Cn.getSegmentVertices(e,r,n),a=Cn.getSegmentNormal(i),l=Cn.getRotationFromNormal(a);return{segmentIdx:r,segmentVertices:i,normal:a,rotation:l}}else return{segmentIdx:-1,segmentVertices:null,normal:new ie(0,0,1),rotation:[0,0,0]}}static getOrderedWallArrayOfRoof(e){const n=new Map;for(const a of H.getState().elements)a.type===z.Wall&&a.roofId===e&&n.set(a.id,a);if(n.size===0)return{orderedWallArray:[],isLoop:!1};const o=n.entries().next().value[1],r=[o];let i=o.rightJoints[0];for(;i&&i!==o.id;){const a=n.get(i);if(a)r.push(a),i=a.rightJoints[0];else break}if(i===o.id)return{orderedWallArray:r,isLoop:!0};for(i=o.leftJoints[0];i;){const a=n.get(i);if(a)r.unshift(a),i=a.leftJoints[0];else break}return{orderedWallArray:r,isLoop:!1}}static getRoofBoundaryVertices(e){const n=Tn.getState().roofSegmentVerticesMap.get(e.id);if(!n)throw new Error;if(e.roofType!==Go.Gable&&e.rise<.01)return n[0].map(o=>({x:o.x,y:o.y}));switch(e.roofType){case Go.Gable:return n.length===1?n[0].map(o=>({x:o.x,y:o.y})):n.reduce((o,r)=>(o.push({x:r[0].x,y:r[0].y},{x:r[1].x,y:r[1].y}),o),[]);case Go.Gambrel:return n.reduce((o,r,i)=>((i===0||i===3)&&o.push({x:r[0].x,y:r[0].y},{x:r[1].x,y:r[1].y}),o),[]);case Go.Mansard:return n.reduce((o,r,i)=>(i!==n.length-1&&o.push({x:r[0].x,y:r[0].y}),o),[]);default:return n.reduce((o,r,i)=>(o.push({x:r[0].x,y:r[0].y}),o),[])}}static getAbsoluteWindowVerticesOnRoof(e,n){const o=[],r=new ie(e.cx,e.cy,e.cz),i=new ie(n.cx,n.cy,n.lz);if(e.windowType===Ti.Arched){const a=Math.min(e.archHeight,e.lx/2,e.lz);for(let s=-1;s<=1;s+=2)for(let c=-1;c<=1;c+=2){const u=s*c>0?new ie(e.lx/2*s,(e.lz/2-a)*c*s,0):new ie(e.lx/2*s,e.lz/2*c*s,0);u.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(r),u.applyEuler(new nn(0,0,n.rotation[2],"ZXY")).add(i),o.push(u)}const l=new ie(0,e.lz/2,0);l.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(r),l.applyEuler(new nn(0,0,n.rotation[2],"ZXY")).add(i),o.push(l)}else{for(let a=-1;a<=1;a+=2)for(let l=-1;l<=1;l+=2){const s=new ie(e.lx/2*a,e.lz/2*l*a,0);s.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(r),s.applyEuler(new nn(0,0,n.rotation[2],"ZXY")).add(i),o.push(s)}if(e.windowType===Ti.Polygonal&&e.polygonTop){const a=new ie(e.lx*e.polygonTop[0],e.lz/2+e.polygonTop[1],0);a.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(r),a.applyEuler(new nn(0,0,n.rotation[2],"ZXY")).add(i),o.push(a)}}return o}static getRelativeWindowVerticesOnRoof(e){const n=[],o=new ie(e.cx,e.cy,e.cz);if(e.windowType===Ti.Arched){const r=Math.min(e.archHeight,e.lx/2,e.lz);for(let a=-1;a<=1;a+=2)for(let l=-1;l<=1;l+=2){const s=a*l>0?new ie(e.lx/2*a,(e.lz/2-r)*l*a,0):new ie(e.lx/2*a,e.lz/2*l*a,0);s.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(o),n.push(s)}const i=new ie(0,e.lz/2,0);i.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(o),n.push(i)}else{for(let r=-1;r<=1;r+=2)for(let i=-1;i<=1;i+=2){const a=new ie(e.lx/2*r,e.lz/2*i*r,0);a.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(o),n.push(a)}if(e.windowType===Ti.Polygonal&&e.polygonTop){const r=new ie(e.lx*e.polygonTop[0],e.lz/2+e.polygonTop[1],0);r.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(o),n.push(r)}}return n}static getAbsoluteSolarPanelVerticesOnRoof(e,n){const o=[],r=new ie(e.cx,e.cy,e.cz),i=new ie(n.cx,n.cy,n.cz);for(let a=-1;a<=1;a+=2)for(let l=-1;l<=1;l+=2){const s=new ie(e.lx/2*a,e.ly/2*l*a,0);e.rotation[0]===0?s.applyEuler(new nn(e.tiltAngle,0,e.relativeAzimuth,"ZXY")).add(r):s.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(r),s.applyEuler(new nn(0,0,n.rotation[2],"ZXY")).add(i),o.push(s)}return o}static getSolarPanelVerticesOnRoof(e,n){const o=[],r=new ie(e.cx,e.cy,e.cz+n.cz);for(let i=-1;i<=1;i+=2)for(let a=-1;a<=1;a+=2){const l=new ie(e.lx/2*i,e.ly/2*a*i,0);e.rotation[0]===0?l.applyEuler(new nn(e.tiltAngle,0,e.relativeAzimuth,"ZXY")).add(r):l.applyEuler(new nn(e.rotation[0],e.rotation[1],e.rotation[2],"ZXY")).add(r),o.push(l)}return o}static getWindowVerticesOnRoof(e,n=0){const o=[],r=new ie(e.cx,e.cy,e.cz),[i,a]=[e.lx/2+n,e.lz/2+n];for(let l=-1;l<=1;l+=2)for(let s=-1;s<=1;s+=2){const c=new ie(l*i,l*s*a);c.applyEuler(new nn().fromArray([e.rotation[0],e.rotation[1],e.rotation[2],"ZXY"])).add(r),o.push(c)}if(e.windowType===Ti.Polygonal){const[l,s]=e.polygonTop??Gp,c=new ie(l*e.lx,e.lz+s).add(r);o.push(c)}return o}static rooftopElementBoundaryCheck(e,n){for(const o of e)if(!me.isPointInside(o.x,o.y,n))return!1;return!0}static rooftopWindowCollisionCheck(e,n,o){const r=[];for(const i of H.getState().elements)if(i.parentId===o&&i.id!==e){const a=Cn.getWindowVerticesOnRoof(i);r.push(a)}for(const i of r){for(const a of n)if(me.isPointInside(a.x,a.y,i))return!1;for(const a of i)if(me.isPointInside(a.x,a.y,n))return!1}return!0}static rooftopSPCollisionCheck(e,n,o){for(const r of H.getState().elements)if(r.type===e.type&&r.parentId===e.parentId&&r.id!==e.id){const i=Cn.getSolarPanelVerticesOnRoof(r,n);for(const s of o)if(me.isPointInside(s.x,s.y,i))return!1;for(const s of i)if(me.isPointInside(s.x,s.y,o))return!1;const a=o.map(me.mapVector3ToPoint2),l=i.map(me.mapVector3ToPoint2);a.push(a[0]),l.push(l[0]);for(let s=0;s0){for(const i of r)if(!i.leftJoints||i.leftJoints.length===0||!i.rightJoints||i.rightJoints.length===0)return jc.WALL_DISJOINED}return jc.COMPLETE}static calculateBuildingArea(e){const n=Do.getWallPointsOfRoof(e);return Do.getPolygonArea(n)}static toUValueInUS(e){return e/5.67826}static toUValueInSI(e){return e*5.67826}static toRValueInUS(e){return e*5.67826}static toRValueInSI(e){return e/5.67826}static fetchWaterTexture(e,n){const o=document.createElement("canvas");o.width=e,o.height=n;const r=o.getContext("2d");if(r){const i=r.createRadialGradient(e/2,n/2,0,e/2,n/2,Math.max(e,n)/2);i.addColorStop(0,"#45AAEA"),i.addColorStop(.04,"#2B65EC"),i.addColorStop(.2,"#0000FF"),r.fillStyle=i,r.fillRect(0,0,e,n)}return new XP(o)}static fetchWhiteTexture(e,n){const o=document.createElement("canvas");o.width=e,o.height=n;const r=o.getContext("2d");return r&&(r.fillStyle="white",r.fillRect(0,0,e,n)),new XP(o)}static fetchIntersectables(e){const n=[];return e.traverse(o=>{o.userData.unintersectable||n.push(o)}),n}static fetchSimulationElements(e,n){if(e.userData.simulation&&n.push(e),e.children.length>0)for(const o of e.children)Do.fetchSimulationElements(o,n)}static getSimulationElements(e,n,o){if(e.userData.simulation&&e.uuid!==o&&n.push(e),e.children.length>0)for(const r of e.children)Do.getSimulationElements(r,n,o)}static hasMovingParts(e){for(const n of e)switch(n.type){case z.ParabolicDish:case z.ParabolicTrough:case z.FresnelReflector:case z.Heliostat:return!0;case z.SolarPanel:if(n.trackerType!==za.NO_TRACKER)return!0}return!1}static onBuildingEnvelope(e){return e.type===z.Foundation||e.type===z.Window||e.type===z.Door||e.type===z.Wall||e.type===z.Roof}static getWindowArea(e,n){if(n){if(e.windowType===Ti.Arched&&e.archHeight>0){const o=.5*e.lx*n.lx,r=e.lz*n.lz,i=Math.min(e.archHeight,r,o),a=.5*(i+o*o/i),l=Math.acos(Math.min(o/a,1));return .5*(Math.PI-l*2)*a*a-o*(a-i)+(r-i)*o*2}else if(e.windowType===Ti.Polygonal&&e.polygonTop){let o=e.lx*e.lz*n.lx*n.lz;return o+=e.lx*n.lx*e.polygonTop[1]/2,o}return e.lx*e.lz*n.lx*n.lz}else{if(e.windowType===Ti.Arched&&e.archHeight>0){const o=.5*e.lx,r=e.lz,i=Math.min(e.archHeight,r,o),a=.5*(i+o*o/i),l=Math.acos(Math.min(o/a,1));return .5*(Math.PI-l*2)*a*a-o*(a-i)+(r-i)*o*2}else if(e.windowType===Ti.Polygonal&&e.polygonTop){let o=e.lx*e.lz;return o+=e.lx*e.polygonTop[1]/2,o}return e.lx*e.lz}}static getDoorArea(e,n){if(n){if(e.doorType===Pd.Arched&&e.archHeight>0){const o=.5*e.lx*n.lx,r=e.lz*n.lz,i=Math.min(e.archHeight,r,o),a=.5*(i+o*o/i),l=Math.acos(Math.min(o/a,1));return .5*(Math.PI-l*2)*a*a-o*(a-i)+(r-i)*o*2}return e.lx*e.lz*n.lx*n.lz}else{if(e.doorType===Pd.Arched&&e.archHeight>0){const o=.5*e.lx,r=e.lz,i=Math.min(e.archHeight,r,o),a=.5*(i+o*o/i),l=Math.acos(Math.min(o/a,1));return .5*(Math.PI-l*2)*a*a-o*(a-i)+(r-i)*o*2}return e.lx*e.lz}}static hasHeliostatOrFresnelReflectors(e){for(const n of e)if(n.type===z.FresnelReflector||n.type===z.Heliostat)return!0;return!1}static lineIntersection(e,n,o,r){const i=n.x-e.x,a=n.y-e.y,l=i*(r.y-o.y)-(r.x-o.x)*a;if(l===0)return;const s=((r.y-o.y)*(r.x-e.x)+(o.x-r.x)*(r.y-e.y))/l,c=((e.y-n.y)*(r.x-e.x)+i*(r.y-e.y))/l;if(!(!(0<=s&&s<=1)||!(0<=c&&c<=1)))return{x:e.x+s*i,y:e.y+s*a}}static calculateSolarRadiationColor(e,n){const o=n/(Rz.length-1);let r=Math.max(0,Math.floor(e/o));r>Rz.length-2&&(r=Rz.length-2);const i=Math.min(1,(e-o*r)/o);return new rr(Rz[r]).lerp(Rz[r+1],i)}static transpose(e){return e[0].map((n,o)=>e.map(r=>r[o]))}static clone2DArray(e){return e.map(n=>[...n])}static fetchHeatmapTexture(e,n,o){if(!e)return null;const r=document.createElement("canvas"),i=e.length,a=e[0].length;r.width=i,r.height=a;const l=r.getContext("2d");if(l){l.clearRect(0,0,i,a);const s=l.getImageData(0,0,i,a),c=s.data;for(let u=0;un!=u>n&&e<(c-l)*(n-s)/(u-s)+l&&(r=!r)}return r}static getPoints(e){const n=[];for(const o of e)n.push({x:o.x,y:o.y});return n}static polygonIntersections(e,n,o){const r=new Array;let i,a,l;for(let s=0;s0&&(n>l.x&&(n=l.x),r>l.y&&(r=l.y),o=o||Math.abs(a)>=r)return!1;const l=e.rightPoint[0],s=e.rightPoint[1];return!(Math.abs(l)>=o||Math.abs(s)>=r)}static isSensorWithin(e,n){return Math.abs(e.cx)<.5-e.lx/n.lx&&Math.abs(e.cy)<.5-e.ly/n.ly}static isSolarCollectorWithinHorizontalSurface(e,n){const o=e.cx,r=e.cy,i=Math.cos(e.relativeAzimuth),a=Math.sin(e.relativeAzimuth),l=n.lx*.5,s=n.ly*.5,c=e.lx*.5,u=e.ly*.5*Math.cos(e.tiltAngle);let d=o+c*i-u*a,f=r+c*a+u*i;return!(Math.abs(d)>l||Math.abs(f)>s||(d=o+c*i+u*a,f=r+c*a-u*i,Math.abs(d)>l||Math.abs(f)>s)||(d=o-c*i-u*a,f=r-c*a+u*i,Math.abs(d)>l||Math.abs(f)>s)||(d=o-c*i+u*a,f=r-c*a-u*i,Math.abs(d)>l||Math.abs(f)>s))}static isWindTurbineWithinHorizontalSurface(e,n){return Math.abs(e.cx)<=.5&&Math.abs(e.cy)<=.5}static isUnitVectorX(e){return Do.isSame(e,Op)||Do.isSame(e,_p)}static isUnitVectorY(e){return Do.isSame(e,Oc)||Do.isSame(e,Vp)}static isSame(e,n){return Math.abs(e.x-n.x)It)return!1;return!0}static isEqual(e,n){return Math.abs(e-n)-1&&e.splice(o,1)}static fixElements(e){const n=[];for(const o of e)o.type||n.push(o);if(n.length>0)for(const o of n)Do.deleteElement(e,o)}static fixViewStateLight(e){e.ambientLightIntensity&&(e.ambientLightIntensity*=2),e.directLightIntensity&&(e.directLightIntensity*=3.5)}static isResizingVertical(e){switch(e){case vt.LowerLeftTop:case vt.UpperLeftTop:case vt.LowerRightTop:case vt.UpperRightTop:return!0;default:return!1}}static isTopResizeHandle(e){return e===vt.LowerLeftTop||e===vt.LowerRightTop||e===vt.UpperLeftTop||e===vt.UpperRightTop||e===vt.Top}static isXResizeHandle(e){return e===vt.Left||e===vt.Right}static isYResizeHandle(e){return e===vt.Upper||e===vt.Lower}static isTopResizeHandleOfWall(e){return e===vt.UpperLeft||e===vt.UpperRight}static isRiseHandleOfRoof(e){return e===Lr.Top||e===Lr.Mid||e===Lr.TopMid}static isMoveHandle(e){return e===Ho.Default||e===Ho.Top||e===Ho.Upper||e===Ho.Lower||e===Ho.Left||e===Ho.Right}static snapToNormalGrid(e){const n=Math.round(e.x/S6)*S6,o=Math.round(e.y/S6)*S6;return new ie(n,o,e.z)}static snapToFineGrid(e){const n=Math.round(e.x/m9)*m9,o=Math.round(e.y/m9)*m9;return new ie(n,o,e.z)}static isPositionRelative(e){return e===z.SolarPanel||e===z.ParabolicTrough||e===z.ParabolicDish||e===z.FresnelReflector||e===z.Heliostat||e===z.WindTurbine||e===z.WaterHeater||e===z.Sensor||e===z.Light||e===z.Polygon||e===z.Window||e===z.Door||e===z.Roof||e===z.Wall}static isPlantOrHuman(e){return e.type===z.Tree||e.type===z.Flower||e.type===z.Human}static isFoundationOrCuboid(e){return e.type===z.Foundation||e.type===z.Cuboid}static isSolarCollector(e){return Do.isSolarCollectorType(e.type)}static isSolarCollectorType(e){return e===z.SolarPanel||e===z.WaterHeater||Do.isCspCollectorType(e)}static isCspCollector(e){return Do.isCspCollectorType(e.type)}static isCspCollectorType(e){return e===z.ParabolicDish||e===z.ParabolicTrough||e===z.FresnelReflector||e===z.Heliostat}static isParabolicCollector(e){return Do.isParabolaType(e.type)}static isParabolaType(e){return e===z.ParabolicDish||e===z.ParabolicTrough}static isParabolicTroughOrFresnelReflector(e){return e===z.FresnelReflector||e===z.ParabolicTrough}static isHeliostatOrFresnelReflector(e){return e===z.FresnelReflector||e===z.Heliostat}static isLegalOnWall(e){switch(e){case z.Window:case z.Door:case z.Sensor:case z.Light:case z.SolarPanel:case z.Polygon:return!0}return!1}static isDescendantOf(e,n){const o=e.parentId;if(!o||o===Zo)return!1;const r=H.getState().getElementById(o);return r?r.id===n?!0:Do.isDescendantOf(r,n):!1}static isElementInsideWall(e,n,o,r,i){const a=n/2,l=o/2;for(let c=-1;c<=1;c+=2)for(let u=-1;u<=1;u+=2){if(i&&u===-1)continue;const d=e.x+a*c,f=e.z+l*u;if(!Do.isPointInside(d,f,r))return!1}const s=[{x:e.x-a,y:e.z-l},{x:e.x-a,y:e.z+l},{x:e.x+a,y:e.z+l},{x:e.x+a,y:e.z-l}];for(const c of r)if(Do.isPointInside(c.x,c.y,s))return!1;return!0}static isRectOutsideBoundary(e,n,o,r,i,a){return e+o>i||e-o<-i||n+r>a||n-r<-a}static getSolarPanelVerticesOnCuboidVerticalFace(e){const n=[],[o,r]=[e.lx/2,e.ly/2];return Do.isIdentical(e.normal,[-1,0,0])||Do.isIdentical(e.normal,[1,0,0])?(n.push({x:e.cy-o,y:e.cz-r}),n.push({x:e.cy+o,y:e.cz-r}),n.push({x:e.cy+o,y:e.cz+r}),n.push({x:e.cy-o,y:e.cz+r})):(Do.isIdentical(e.normal,[0,1,0])||Do.isIdentical(e.normal,[0,-1,0]))&&(n.push({x:e.cx-o,y:e.cz-r}),n.push({x:e.cx+o,y:e.cz-r}),n.push({x:e.cx+o,y:e.cz+r}),n.push({x:e.cx-o,y:e.cz+r})),n}static checkCollisionOnCuboidSameVerticalFace(e){for(const n of H.getState().elements)if(n.type===z.SolarPanel&&n.id!==e.id&&n.parentId===e.parentId&&Do.isIdentical(n.normal,e.normal)){const o=Do.getSolarPanelVerticesOnCuboidVerticalFace(n),r=Do.getSolarPanelVerticesOnCuboidVerticalFace(e);for(const i of o)if(Do.isPointInside(i.x,i.y,r))return!0;for(const i of r)if(Do.isPointInside(i.x,i.y,o))return!0}return!1}static checkElementOnCuboidState(e,n){if(Do.isIdentical(e.normal,[0,0,1])){if(!Do.isSolarCollectorWithinHorizontalSurface(e,n))return ma.OutsideBoundary;if(H.getState().overlapWithSibling(e))return ma.OverLap}else{const[o,r]=[e.lx/2,e.ly/2],[i,a,l]=[n.lx/2,n.ly/2,n.lz/2];if(Do.isIdentical(e.normal,[-1,0,0])||Do.isIdentical(e.normal,[1,0,0])){if(Do.isRectOutsideBoundary(e.cy,e.cz,o,r,a,l))return ma.OutsideBoundary}else if((Do.isIdentical(e.normal,[0,1,0])||Do.isIdentical(e.normal,[0,-1,0]))&&Do.isRectOutsideBoundary(e.cx,e.cz,o,r,i,l))return ma.OutsideBoundary;if(Do.checkCollisionOnCuboidSameVerticalFace(e))return ma.OverLap}return ma.Valid}static checkElementOnWallState(e,n){let r=e.lx/2+1e-5,i=e.lz/2+1e-5;n&&e.type===z.SolarPanel&&(r=r/n.lx+1e-5,i=e.ly/2/n.lz+1e-5);const a=e.cx-r,l=e.cx+r,s=e.cz-i,c=e.cz+i;if(n&&n.type===z.Wall&&!Do.isElementInsideWall(new ie(e.cx*n.lx,e.cy,e.cz*n.lz),n.lx*r*2,n.lz*i*2,Do.getWallInnerSideShapePoints(n),e.type===z.Door))return ma.OutsideBoundary;for(const u of H.getState().elements)if(Do.isLegalOnWall(u.type)&&u.type!==z.Polygon&&u.parentId===e.parentId&&u.id!==e.id){let d=u.lx/2,f=u.lz/2;n&&u.type===z.SolarPanel&&(d=d/n.lx,f=u.ly/2/n.lz);const p=u.cx-d,g=u.cx+d,y=u.cz-f,w=u.cz+f;if((a>=p&&a<=g||l>=p&&l<=g||p>=a&&p<=l||g>=a&&g<=l)&&(s>=y&&s<=w||c>=y&&c<=w||y>=s&&y<=c||w>=s&&w<=c))return ma.OverLap}return ma.Valid}static checkElementOnRoofState(e,n){if(e.foundationId){const o=H.getState().getElementById(e.foundationId);if(o){const r=Cn.getSolarPanelVerticesOnRoof(e,o),i=Cn.getRoofBoundaryVertices(n);return Cn.rooftopElementBoundaryCheck(r,i)?Cn.rooftopSPCollisionCheck(e,o,r)?ma.Valid:ma.OverLap:ma.OutsideBoundary}}return ma.Invalid}static relativeCoordinates(e,n,o,r,i){const a=new ie(e,n,o);if(r.type===z.Wall){const l=new ie(r.cx,r.cy),s=H.getState().getParent(r);if(s){const c=new ie(s.cx,s.cy);l.applyEuler(new nn(0,0,s.rotation[2])).add(c).setZ(s.lz+r.lz/2),a.sub(l).applyEuler(new nn(0,0,-r.relativeAngle-s.rotation[2]))}}else{const{pos:l,rot:s}=Do.getWorldDataById(r.id);a.set(e-l.x,n-l.y,o-l.z),a.applyEuler(new nn(0,0,-s))}return i||(a.x/=r.lx,a.y/=r.ly,a.z/=r.lz),a}static absoluteCoordinates(e,n,o,r,i,a,l){if(r.type===z.Wall&&i){const c=r,u=i?i.rotation[2]+c.relativeAngle:c.relativeAngle;if(u!==void 0){const d=Do.wallAbsolutePosition(new ie(c.cx,c.cy,c.cz),i).setZ(c.lz/2+i.lz),f=new ie(e*c.lx,n*c.ly,o*c.lz);if(f.applyAxisAngle(Io,u),a){const p=a*Math.cos(u-Gt),g=a*Math.sin(u-Gt);return new ie(d.x+f.x+p,d.y+f.y+g,d.z+f.z)}return new ie(d.x+f.x,d.y+f.y,d.z+f.z)}}if(r.type===z.Roof&&i){const c=new ie(e,n,o+i.cz);return c.applyEuler(new nn().fromArray(i.rotation)),c.x+=i.cx,c.y+=i.cy,c}const s=new ie;return l?s.set(e,n,o):s.set(e*r.lx,n*r.ly,o*r.lz),s.applyEuler(new nn().fromArray(r.rotation)),s.x+=r.cx,s.y+=r.cy,s.z+=r.cz,s}static absoluteHumanOrTreeCoordinates(e,n,o,r){const i=new ie(e,n,o);return i.applyEuler(new nn().fromArray(r.rotation)),i.x+=r.cx,i.y+=r.cy,i.z+=r.cz,i}static relativePoint(e,n){const o=new ie(e.x-n.cx,e.y-n.cy,e.z-n.cz);return o.applyEuler(new nn().fromArray(n.rotation.map(r=>-r))),o}static wallAbsolutePosition(e,n){const o=new ie(n.cx,n.cy);return new ie().addVectors(o,new ie(e.x,e.y).applyAxisAngle(Io,n.rotation[2]))}static wallRelativePosition(e,n){const o=new ie(n.cx,n.cy);return new ie().subVectors(new ie(e.x,e.y),o).applyAxisAngle(Io,-n.rotation[2])}static getObjectChildById(e,n){if(e){for(const o of e.children)if(o.name===Ov){const r=Do.getStackCuboidObjectById(o,n);if(r)return r}else if(o.name.includes(n))return o}return null}static getStackCuboidObjectById(e,n){if(e)for(const o of e.children){if(o.name.includes(n))return o;if(o.name===C$e){const r=Do.getStackCuboidObjectById(o.children[0],n);if(r)return r}}return null}static toRadians(e){return e*(Math.PI/180)}static toDegrees(e){return e*(180/Math.PI)}static getArrayMax(e){return e.reduce((n,o)=>Math.max(n,o))}static getArrayMin(e){return e.reduce((n,o)=>Math.min(n,o))}static getArrayMax2D(e){return Do.getArrayMax(e.map(Do.getArrayMax))}static getArrayMin2D(e){return Do.getArrayMin(e.map(Do.getArrayMin))}static sphericalToCartesianZ(e){const n=e.x*Math.cos(e.z),o=n*Math.cos(e.y),r=n*Math.sin(e.y),i=e.x*Math.sin(e.z);return e.set(o,r,i),e}static getDistance(e,n,o,r){return e=Do.toRadians(e),n=Do.toRadians(n),o=Do.toRadians(o),r=Do.toRadians(r),Math.acos(Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos(Math.abs(e-o)))}static minutesIntoDay(e){return e.getHours()*60+e.getMinutes()}static dayOfYear(e){return(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())-Date.UTC(e.getFullYear(),0,0))/864e5}static daysInYear(e){const n=e.getFullYear();return n%4===0&&n%100>0||n%400===0?366:365}static daysOfMonth(e,n){return new Date(n,e+1,0).getDate()}static fahrenheitToCelsius(e){return(e-32)*5/9}static celsiusToFahrenheit(e){return e*(9/5)+32}static getOS(){var e;return(e=ZUe.os)==null?void 0:e.family}static isMac(){const e=Do.getOS();return e?e.includes("Mac")||e.includes("OS X"):!1}static isChrome(){const e=Do.getOS();return e?e.includes("Chrome"):!1}static detectWebGLContext(){try{const e=document.createElement("canvas");return!!window.WebGLRenderingContext&&(!!e.getContext("webgl")||!!e.getContext("experimental-webgl"))}catch{return!1}}static clamp(e,n,o){return n>o?(n+o)/2:Math.min(Math.max(e,n),o)}static distanceFromPointToLine2D(e,n,o){const[r,i]=[e.x,e.y],[a,l]=[n.x,n.y],[s,c]=[o.x,o.y],u=r-a,d=i-l,f=s-a,p=c-l,g=u*f+d*p,y=f*f+p*p;let w=-1;y!==0&&(w=g/y);let b,C;w<0?(b=a,C=l):w>1?(b=s,C=c):(b=a+w*f,C=l+w*p);const P=r-b,v=i-C;return Math.sqrt(P*P+v*v)}static mapVector3ToPoint2(e){return{x:e.x,y:e.y}}static getWallVertices(e,n){const o=e.lx/2,r=e.lz/2,i={x:-o-n,y:-r-n},a={x:o+n,y:-r-n},l={x:-o-n,y:(e.leftRoofHeight??e.lz)-r+n},s={x:o+n,y:(e.rightRoofHeight??e.lz)-r+n},c=[];return c.push(l,i,a,s),e.centerRightRoofHeight&&c.push({x:e.centerRightRoofHeight[0]*e.lx,y:e.centerRightRoofHeight[1]-r+n}),e.centerRoofHeight&&c.push({x:e.centerRoofHeight[0]*e.lx,y:e.centerRoofHeight[1]-r+n}),e.centerLeftRoofHeight&&c.push({x:e.centerLeftRoofHeight[0]*e.lx,y:e.centerLeftRoofHeight[1]-r+n}),c}static isPartialWallFull(e){return Do.isZero((e.leftRoofHeight??e.lz)-e.leftTopPartialHeight)&&Do.isZero((e.rightRoofHeight??e.lz)-e.rightTopPartialHeight)&&Do.isZero(e.leftUnfilledHeight)&&Do.isZero(e.rightUnfilledHeight)}static getPartialWallVertices(e,n){if(Do.isPartialWallFull(e))return Do.getWallVertices(e,n);const o=e.lx/2,r=e.lz/2,i={x:-o-n,y:e.leftUnfilledHeight-r-n},a={x:o+n,y:e.rightUnfilledHeight-r-n},l={x:-o-n,y:e.leftTopPartialHeight-r+n},s={x:o+n,y:e.rightTopPartialHeight-r+n},c=[];return c.push(l,i,a,s),e.centerRightRoofHeight&&c.push({x:e.centerRightRoofHeight[0]*e.lx,y:e.centerRightRoofHeight[1]-r+n}),e.centerRoofHeight&&c.push({x:e.centerRoofHeight[0]*e.lx,y:e.centerRoofHeight[1]-r+n}),e.centerLeftRoofHeight&&c.push({x:e.centerLeftRoofHeight[0]*e.lx,y:e.centerLeftRoofHeight[1]-r+n}),c}static getHighestPointOfWall(e){let n=e.lz;return e.leftRoofHeight&&(n=Math.max(n,e.leftRoofHeight)),e.rightRoofHeight&&(n=Math.max(n,e.rightRoofHeight)),e.centerRightRoofHeight&&(n=Math.max(n,e.centerRightRoofHeight[1])),e.centerRoofHeight&&(n=Math.max(n,e.centerRoofHeight[1])),e.centerLeftRoofHeight&&(n=Math.max(n,e.centerLeftRoofHeight[1])),n}static getWallPointsOfRoof(e,n){let o=n??H.getState().getElementById(e.wallsId[0]);if(!o)return[];const r=o,i=[];for(;o&&(!o.roofId||o.roofId===e.id)&&(i.push({x:o.leftPoint[0],y:o.leftPoint[1],eave:o.eavesLength??0}),o.leftJoints[0]);)if(o.leftJoints[0]!==r.id)o=H.getState().getElementById(o.leftJoints[0]);else return i.reverse(),i;for(i.reverse(),o=H.getState().getElementById(r==null?void 0:r.rightJoints[0]);o&&(!o.roofId||o.roofId===e.id)&&(i.push({x:o.leftPoint[0],y:o.leftPoint[1],eave:o.eavesLength??0}),o.rightJoints[0]&&o.rightJoints[0]!==r.id);)o=H.getState().getElementById(o.rightJoints[0]);return i}static getWallInnerSideShapePoints(e){const{lx:n,ly:o,lz:r,relativeAngle:i,fill:a,leftUnfilledHeight:l,rightUnfilledHeight:s,leftRoofHeight:c,centerLeftRoofHeight:u,centerRoofHeight:d,centerRightRoofHeight:f,rightRoofHeight:p,leftJoints:g,rightJoints:y}=e,w=g.length>0?H.getState().getElementById(g[0]):null,b=y.length>0?H.getState().getElementById(y[0]):null,C=w&&w.type===z.Wall?Do.getInnerWallOffset(w,n,o,i,"left"):0,P=b&&b.type===z.Wall?Do.getInnerWallOffset(b,n,o,i,"right"):0,v=[],T=n/2,A=r/2;return a===El.Partial?(v.push({x:-T+C,y:-A+l}),v.push({x:T-P,y:-A+s})):(v.push({x:-T+C,y:-A}),v.push({x:T-P,y:-A})),p?v.push({x:T-P,y:p-A}):v.push({x:T-P,y:A}),f&&v.push({x:f[0]*n,y:f[1]-A}),d&&v.push({x:d[0]*n,y:d[1]-A}),u&&v.push({x:u[0]*n,y:u[1]-A}),c?v.push({x:-T+C,y:c-A}):v.push({x:-T+C,y:A}),v}static getInnerWallOffset(e,n,o,r,i){let a=0;if(e&&e.fill!==El.Empty){const l=i==="left"?-1:1,s=(Math.PI*3+l*(r-e.relativeAngle))%la;s<=Gt+.01&&s>0&&(a=Math.min(o/Math.tan(s)+e.ly,n))}return a}static isElementAllowedMultipleMoveOnGround(e){return e.type===z.Foundation||e.type===z.Cuboid&&e.parentId===Zo}static areBasesOverlapped(e,n,o){const r=o.get(e),i=o.get(n);if(!r||!i)return!1;for(const a of r)if(Do.isPointInside(a.x,a.y,i))return!0;for(const a of i)if(Do.isPointInside(a.x,a.y,r))return!0;r.push(r[0]),i.push(i[0]);for(let a=0;aNumber(c)),[a,l,s]=n.split(".").map(c=>Number(c));return oa?!1:rl?!1:i{const n=H.getState().getElementById,o=[],r=e;for(;e&&(o.push(e),e.leftJoints[0]);)if(e.leftJoints[0]!==r.id){const a=n(e.leftJoints[0]);a&&a.type===z.Wall&&(e=a)}else return o;const i=n(r.rightJoints[0]);for(i&&i.type===z.Wall&&(e=i);e&&(o.push(e),e.rightJoints[0]&&e.rightJoints[0]!==r.id);){const a=n(e.rightJoints[0]);a&&(e=a)}return o},Do.getWorldDataById=e=>{const n=H.getState().getElementById(e);if(!n)return{pos:new ie,rot:0,topZ:0};const o=new ie(n.cx,n.cy,n.cz),r=n.rotation[2],i=n.lz;if(n.parentId===Zo)return{pos:o,rot:r,topZ:i};const{pos:a,rot:l,topZ:s}=Do.getWorldDataById(n.parentId),c=new nn(0,0,l);return{pos:new ie().addVectors(o.applyEuler(c),a.clone().setZ(s)),rot:r+l,topZ:i+s}},Do.isChild=(e,n,o=!1)=>{const r=H.getState().getElementById(n);return!r||o&&r.locked?!1:r.parentId===e?!0:Do.isChild(e,r.parentId,o)},Do.getBaseId=e=>{const n=H.getState().getElementById(e);return n?n.parentId===Zo?n.id:Do.getBaseId(n.parentId):null},Do.isElementTriggerAutoDeletion=e=>{if(e.type===z.Roof){const r=e;if(r.roofType===Go.Gable||r.roofType===Go.Gambrel)return!0}if(e.type!==z.Wall)return!1;const n=e;if(!n.roofId)return!1;const o=H.getState().getElementById(n.roofId);if(!o)return!1;switch(o.roofType){case Go.Hip:case Go.Gable:case Go.Gambrel:return!0;case Go.Pyramid:case Go.Mansard:return o.wallsId.length===0?!1:o.wallsId[0]===n.id;default:return!1}};let me=Do;var YSe;class OSe{constructor(){this[YSe]=!0,this.latitude=42.2844063,this.longitude=-71.3488548,this.address=dG,this.countryCode="US",this.date=new Date(new Date().getFullYear(),5,22,12).toLocaleString("en-US"),this.name="default",this.ground={albedo:.3,thermalDiffusivity:.05,snowReflectionFactors:new Array(12).fill(0)},this.leafDayOfYear1=Fq,this.leafDayOfYear2=kq,this.airAttenuationCoefficient=.01,this.airConvectiveCoefficient=5,this.timesPerHour=1,this.daysPerYear=12,this.monthlyIrradianceLosses=new Array(12).fill(.05),this.pvGridCellSize=.5,this.discretization=Fm.APPROXIMATE,this.diurnalTemperatureModel=y2.Sinusoidal,this.highestTemperatureTimeInMinutes=900,this.solarPanelVisibilityGridCellSize=.2,this.solarRadiationHeatmapGridCellSize=.5,this.cspTimesPerHour=1,this.cspDaysPerYear=4,this.cspGridCellSize=.5,this.sutTimesPerHour=1,this.sutDaysPerYear=4,this.sutGridCellSize=1,this.noAnimationForHeatmapSimulation=!1,this.noAnimationForThermalSimulation=!1,this.noAnimationForSensorDataCollection=!1,this.noAnimationForSolarPanelSimulation=!1,this.noAnimationForSolarUpdraftTowerSimulation=!1}static resetWorldModel(e){e.latitude=42.2844063,e.longitude=-71.3488548,e.address=dG,e.countryCode="US",e.date=new Date(new Date().getFullYear(),5,22,12).toLocaleString("en-US"),e.name="default",e.ground.albedo=.3,e.ground.thermalDiffusivity=.05,e.ground.snowReflectionFactors.fill(0),e.airAttenuationCoefficient=.01,e.airConvectiveCoefficient=5,e.timesPerHour=1,e.daysPerYear=12,e.monthlyIrradianceLosses=new Array(12).fill(.05),e.pvGridCellSize=.5,e.discretization=Fm.APPROXIMATE,e.diurnalTemperatureModel=y2.Sinusoidal,e.highestTemperatureTimeInMinutes=900,e.solarPanelVisibilityGridCellSize=.2,e.solarRadiationHeatmapGridCellSize=.5,e.cspTimesPerHour=1,e.cspDaysPerYear=4,e.cspGridCellSize=.5,e.sutTimesPerHour=1,e.sutDaysPerYear=4,e.sutGridCellSize=1,e.noAnimationForHeatmapSimulation=!1,e.noAnimationForThermalSimulation=!1,e.noAnimationForSensorDataCollection=!1,e.noAnimationForSolarPanelSimulation=!1,e.noAnimationForSolarUpdraftTowerSimulation=!1}getElements(){const e=[],n={type:z.Foundation,cx:0,cy:0,cz:.05,lx:10,ly:10,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:Zo,textureType:Yi.NoTexture,id:Xi.generate()};e.push(n);const o={type:z.Sensor,cx:-.1,cy:0,cz:.105,lx:.1,ly:.1,lz:.01,parentId:n.id,foundationId:n.id,normal:[0,0,1],rotation:[0,0,0],id:Xi.generate(),showLabel:!0,light:!0,heatFlux:!1};e.push(o);const r={type:z.Human,name:Yt.Judd,cx:1,cy:-1,cz:0,lx:Fp.fetchWidth(Yt.Jiya),lz:Fp.fetchHeight(Yt.Jiya),normal:[1,0,0],rotation:[0,0,0],parentId:Zo,id:Xi.generate()};return e.push(r),e}}YSe=qm;class Yl{static clone(e,n,o,r,i,a,l,s){let c=null;switch(n.type){case z.Polygon:e&&(c=Yl.clonePolygon(e,n,o,r,i,a,l));break;case z.Sensor:e&&(c=Yl.cloneSensor(e,n,o,r,i));break;case z.Light:e&&(c=Yl.cloneLight(e,n,o,r,i));break;case z.SolarPanel:e&&(c=Yl.cloneSolarPanel(e,n,o,r,i));break;case z.ParabolicTrough:e&&(c=Yl.cloneParabolicTrough(e,n,o,r,i));break;case z.ParabolicDish:e&&(c=Yl.cloneParabolicDish(e,n,o,r,i));break;case z.FresnelReflector:e&&(c=Yl.cloneFresnelReflector(e,n,o,r,i));break;case z.Heliostat:e&&(c=Yl.cloneHeliostat(e,n,o,r,i));break;case z.WindTurbine:e&&(c=Yl.cloneWindTurbine(e,n,o,r,i));break;case z.Wall:e&&(c=Yl.cloneWall(e,n,o,r,i));break;case z.Window:e&&(c=Yl.cloneWindow(e,n,o,r,i,s));break;case z.Door:e&&(c=Yl.cloneDoor(e,n,o,r,i));break;case z.Roof:e&&(c=Yl.cloneRoof(e,n,o,r,i));break;case z.Human:c=Yl.cloneHuman(n,o,r,i,e);break;case z.Tree:c=Yl.cloneTree(n,o,r,i,e);break;case z.Flower:c=Yl.cloneFlower(n,o,r,i,e);break;case z.Foundation:c=Yl.cloneFoundation(n,o,r);break;case z.Cuboid:const u=e?e.id:Zo;c=Yl.cloneCuboid(u,n,o,r);break}return c}static cloneHuman(e,n,o,r,i){return{type:z.Human,name:e.name,flip:e.flip,cx:n,cy:o,cz:r,lx:e.lx,ly:e.ly,lz:e.lz,normal:[...e.normal],rotation:[...e.rotation],parentId:(i==null?void 0:i.id)??e.parentId,id:Xi.generate()}}static cloneTree(e,n,o,r,i){return{type:z.Tree,name:e.name,flip:e.flip,cx:n,cy:o,cz:r,lx:e.lx,ly:e.ly,lz:e.lz,normal:[...e.normal],rotation:[...e.rotation],parentId:(i==null?void 0:i.id)??e.parentId,id:Xi.generate()}}static cloneFlower(e,n,o,r,i){return{type:z.Flower,name:e.name,flip:e.flip,cx:n,cy:o,cz:r,lx:e.lx,ly:e.ly,lz:e.lz,normal:[...e.normal],rotation:[...e.rotation],parentId:(i==null?void 0:i.id)??e.parentId,id:Xi.generate()}}static clonePolygon(e,n,o,r,i,a,l){let s;switch(e.type){case z.Foundation:case z.Cuboid:s=e.id;break;case z.Wall:case z.Roof:s=e.parentId;break}const c=n.vertices.map(d=>({...d})),u={type:z.Polygon,cx:o,cy:r,cz:i,lx:n.lx,ly:n.ly,lz:n.lz,filled:n.filled,noOutline:n.noOutline,color:n.color,lineColor:n.lineColor,lineWidth:n.lineWidth,opacity:n.opacity,textureType:n.textureType,text:n.text,fontSize:n.fontSize,fontColor:n.fontColor,normal:[...n.normal],rotation:n.parentId?[...e.rotation]:[0,0,0],vertices:c,parentId:e.id,parentType:e.type,foundationId:s,id:Xi.generate()};if(!a){let d=o,f=r;if(e.type===z.Cuboid&&l){me.isSame(l,_p)?d=i??0:me.isSame(l,Op)?d=-(i??0):me.isSame(l,Vp)?f=i??0:me.isSame(l,Oc)&&(f=-(i??0));const p=l.dot(new ie().fromArray(n.normal));if(Math.abs(p)0&&this.commands.length>this.limit&&this.commands.splice(0,this.commands.length-this.limit),this.index=this.commands.length-1)}undo(){const e=this.commands[this.index];if(e)return this.isExecuting=!0,e.undo(),this.isExecuting=!1,this.index--,e.name}redo(){const e=this.commands[this.index+1];if(e)return this.isExecuting=!0,e.redo(),this.isExecuting=!1,this.index++,e.name}clear(){this.commands=[],this.index=-1}hasUndo(){return this.index!==-1}hasRedo(){return this.index0||this.cuboidCount>0||this.wallCount>0||this.windowCount>0||this.doorCount>0||this.humanCount>0||this.treeCount>0||this.flowerCount>0||this.polygonCount>0||this.sensorCount>0||this.insideLightCount>0||this.outsideLightCount>0||this.solarPanelCount>0||this.parabolicTroughCount>0||this.parabolicDishCount>0||this.fresnelReflectorCount>0||this.heliostatCount>0||this.solarUpdraftTowerCount>0||this.windTurbineCount>0}}var KSe;class ken{constructor(e){this[KSe]=!0,this.problem=e,this.objectiveFunctionType=To.DAILY_TOTAL_OUTPUT,this.selectionMethod=Wm.ROULETTE_WHEEL,this.searchMethod=us.GLOBAL_SEARCH_UNIFORM_SELECTION,this.populationSize=20,this.maximumGenerations=5,this.selectionRate=.5,this.crossoverRate=.5,this.mutationRate=.1,this.convergenceThreshold=.01,this.localSearchRadius=.1}}KSe=qm;var qSe;class Len{constructor(e){this[qSe]=!0,this.problem=e,this.objectiveFunctionType=To.DAILY_TOTAL_OUTPUT,this.searchMethod=us.GLOBAL_SEARCH_UNIFORM_SELECTION,this.swarmSize=20,this.maximumSteps=5,this.vmax=.01,this.inertia=.8,this.cognitiveCoefficient=.1,this.socialCoefficient=.1,this.convergenceThreshold=.01,this.localSearchRadius=.1}}qSe=qm;var $Se;class QSe{constructor(){this[$Se]=!0,this.geneticAlgorithmParams=new ken(Pi.SOLAR_PANEL_TILT_ANGLE),this.particleSwarmOptimizationParams=new Len(Pi.SOLAR_PANEL_TILT_ANGLE)}}$Se=qm;var ZSe;class dX{constructor(){this[ZSe]=!0,this.minimumInterRowSpacing=2,this.maximumInterRowSpacing=10,this.minimumRowsPerRack=1,this.maximumRowsPerRack=6,this.minimumTiltAngle=-Gt,this.maximumTiltAngle=Gt,this.poleHeight=1,this.poleSpacing=5,this.orientation=vr.landscape,this.pvModelName="CS6X-355P-FG",this.rowAxis=Dl.leftRight}}ZSe=qm;var eTe;class tTe{constructor(){this[eTe]=!0,this.projectLifeSpan=25,this.electricitySellingPrice=.25,this.operationalCostPerUnit=.15}}eTe=qm;var nTe;class oTe{constructor(){this[nTe]=!0,this.humanName=Yt.Jack,this.flowerType=ro.YellowFlower,this.treeType=pr.Dogwood,this.treeSpread=3,this.treeHeight=4,this.foundationHeight=.1,this.foundationColor="#808080",this.foundationTexture=Yi.NoTexture,this.groundFloorRValue=o8,this.cuboidHeight=4,this.cuboidFaceColors=["#808080","#808080","#808080","#808080","#808080","#808080"],this.cuboidFaceTextures=[Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture],this.cuboidStackable=!1,this.cuboidTransparency=0,this.wallHeight=5,this.wallThickness=.3,this.wallColor="#ffffff",this.wallTexture=Uo.Default,this.wallStructure=gc.Default,this.wallStructureSpacing=2,this.wallStructureWidth=.1,this.wallStructureColor="#ffffff",this.wallOpacity=.5,this.wallRValue=f6,this.wallVolumetricHeatCapacity=.5,this.wallEavesLength=.3,this.wallParapet=Jye,this.roofColor="#454769",this.roofSideColor="#ffffff",this.roofTexture=Ur.Default,this.roofThickness=.2,this.roofStructure=wc.Default,this.roofGlassOpacity=.5,this.roofGlassTint="#73D8FF",this.roofRafterWidth=.1,this.roofRafterSpacing=1,this.roofRafterColor="#ffffff",this.roofRValue=r8,this.roofVolumetricHeatCapacity=.5,this.roofRise=2,this.roofCeiling=!1,this.ceilingRValue=y6,this.doorColor="#ffffff",this.doorFrameColor="#ffffff",this.doorTexture=sr.Default,this.doorType=Pd.Default,this.doorArchHeight=1,this.doorFilled=!0,this.doorInterior=!1,this.doorUValue=G4,this.doorOpacity=1,this.doorVolumetricHeatCapacity=.5,this.windowWidth=1,this.windowHeight=1,this.windowColor="#ffffff",this.windowTint="#73D8FF",this.windowOpacity=.5,this.windowUValue=V4,this.windowHorizontalMullion=!0,this.windowVerticalMullion=!0,this.windowMullionWidth=.06,this.windowHorizontalMullionSpacing=.5,this.windowVerticalMullionSpacing=.5,this.windowMullionColor="#ffffff",this.windowFrame=!1,this.windowFrameWidth=.1,this.windowSillWidth=.1,this.windowType=Ti.Default,this.windowArchHeight=1,this.windowShutterLeft=!1,this.windowShutterRight=!1,this.windowShutterColor="gray",this.windowShutterWidth=.5,this.windowEmpty=!1,this.windowInterior=!1,this.windTurbineBirdSafeDesign=uc.None,this.windTurbineBladeColor=t9,this.windTurbineStripeColor=n9,this.windTurbineNumberOfBlades=3,this.windTurbinePitchAngle=Math.PI/18,this.windTurbineRelativeYawAngle=0,this.windTurbineInitialRotorAngle=0,this.windTurbineTowerHeight=20,this.windTurbineTowerRadius=.5,this.windTurbineBladeRadius=10,this.windTurbineBladeMaximumChordLength=1,this.windTurbineBladeMaximumChordRadius=3,this.windTurbineBladeRootRadius=.3,this.windTurbineHubRadius=.75,this.windTurbineHubLength=1.5,this.solarPanelModelName="SPR-X21-335-BLK",this.solarPanelOrientation=vr.landscape,this.solarPanelPoleHeight=1,this.solarPanelPoleSpacing=3,this.solarPanelTiltAngle=0,this.solarPanelRelativeAzimuth=0,this.solarPanelFrameColor="#ffffff",this.solarPanelCx=0,this.solarPanelCy=0,this.parabolicDishReflectance=.9,this.parabolicDishAbsorptance=.95,this.parabolicDishOpticalEfficiency=.7,this.parabolicDishThermalEfficiency=.3,this.parabolicDishRimDiameter=4,this.parabolicDishLatusRectum=8,this.parabolicDishPoleHeight=.2,this.parabolicDishPoleRadius=.1,this.parabolicDishReceiverStructure=uf.CentralPole,this.parabolicTroughReflectance=.9,this.parabolicTroughAbsorptance=.95,this.parabolicTroughOpticalEfficiency=.7,this.parabolicTroughThermalEfficiency=.3,this.parabolicTroughLatusRectum=2,this.parabolicTroughPoleHeight=.2,this.parabolicTroughWidth=2,this.parabolicTroughModuleLength=3,this.fresnelReflectorReceiver="None",this.fresnelReflectorReflectance=.9,this.fresnelReflectorPoleHeight=.2,this.fresnelReflectorWidth=2,this.fresnelReflectorModuleLength=3,this.heliostatTower="None",this.heliostatReflectance=.9,this.heliostatPoleHeight=.2,this.heliostatPoleRadius=.1,this.heliostatWidth=4,this.heliostatLength=2,this.lightColor="#ffff99",this.lightIntensity=3,this.lightDistance=5}}nTe=qm;var rTe;class iTe{constructor(){this[rTe]=!0,this.dailyPvIndividualOutputs=!1,this.yearlyPvIndividualOutputs=!1,this.dailyParabolicDishIndividualOutputs=!1,this.yearlyParabolicDishIndividualOutputs=!1,this.dailyParabolicTroughIndividualOutputs=!1,this.yearlyParabolicTroughIndividualOutputs=!1,this.dailyFresnelReflectorIndividualOutputs=!1,this.yearlyFresnelReflectorIndividualOutputs=!1,this.dailyHeliostatIndividualOutputs=!1,this.yearlyHeliostatIndividualOutputs=!1,this.dailyUpdraftTowerIndividualOutputs=!1,this.yearlyUpdraftTowerIndividualOutputs=!1}}rTe=qm;class pd{static getDefaultHiddenParameters(e){return e===Pi.SOLAR_PANEL_ARRAY?["latitude","orientation","poleHeight"]:[]}static getVariables(e,n){if(e===Pi.SOLAR_PANEL_ARRAY){const o=[];return n.includes("rowWidth")||o.push("rowWidth"),n.includes("tiltAngle")||o.push("tiltAngle"),n.includes("interRowSpacing")||o.push("interRowSpacing"),n.includes("latitude")||o.push("latitude"),n.includes("orientation")||o.push("orientation"),n.includes("poleHeight")||o.push("poleHeight"),n.includes("unitCost")||o.push("unitCost"),n.includes("sellingPrice")||o.push("sellingPrice"),n.includes("totalYearlyCost")||o.push("totalYearlyCost"),n.includes("totalYearlyYield")||o.push("totalYearlyYield"),n.includes("meanYearlyYield")||o.push("meanYearlyYield"),n.includes("yearlyProfit")||o.push("yearlyProfit"),o}return[]}static getTitles(e,n,o){if(e===Pi.SOLAR_PANEL_ARRAY){const r=[];return o.includes("rowWidth")||r.push(Y.t("polygonMenu.SolarPanelArrayRowWidth",n)),o.includes("tiltAngle")||r.push(Y.t("polygonMenu.SolarPanelArrayTiltAngle",n)),o.includes("interRowSpacing")||r.push(Y.t("polygonMenu.SolarPanelArrayRowSpacing",n)),o.includes("latitude")||r.push(Y.t("word.Latitude",n)),o.includes("orientation")||r.push(Y.t("polygonMenu.SolarPanelArrayOrientation",n)),o.includes("poleHeight")||r.push(Y.t("polygonMenu.SolarPanelArrayPoleHeight",n)),o.includes("unitCost")||r.push(Y.t("economicsPanel.UnitCost",n)),o.includes("sellingPrice")||r.push(Y.t("economicsPanel.SellingPrice",n)),o.includes("totalYearlyCost")||r.push(Y.t("polygonMenu.SolarPanelArrayTotalYearlyCost",n)),o.includes("totalYearlyYield")||r.push(Y.t("polygonMenu.SolarPanelArrayTotalYearlyYield",n)),o.includes("meanYearlyYield")||r.push(Y.t("polygonMenu.SolarPanelArrayMeanYearlyYield",n)),o.includes("yearlyProfit")||r.push(Y.t("polygonMenu.SolarPanelArrayYearlyProfit",n)),r}return[]}static getTypes(e,n){if(e===Pi.SOLAR_PANEL_ARRAY){const o=[];return n.includes("rowWidth")||o.push("number"),n.includes("tiltAngle")||o.push("number"),n.includes("interRowSpacing")||o.push("number"),n.includes("latitude")||o.push("number"),n.includes("orientation")||o.push("boolean"),n.includes("poleHeight")||o.push("number"),n.includes("unitCost")||o.push("number"),n.includes("sellingPrice")||o.push("number"),n.includes("totalYearlyCost")||o.push("number"),n.includes("totalYearlyYield")||o.push("number"),n.includes("meanYearlyYield")||o.push("number"),n.includes("yearlyProfit")||o.push("number"),o}return[]}static getDigits(e,n){if(e===Pi.SOLAR_PANEL_ARRAY){const o=[];return n.includes("rowWidth")||o.push(0),n.includes("tiltAngle")||o.push(1),n.includes("interRowSpacing")||o.push(1),n.includes("latitude")||o.push(1),n.includes("orientation")||o.push(0),n.includes("poleHeight")||o.push(1),n.includes("unitCost")||o.push(2),n.includes("sellingPrice")||o.push(2),n.includes("totalYearlyCost")||o.push(1),n.includes("totalYearlyYield")||o.push(1),n.includes("meanYearlyYield")||o.push(1),n.includes("yearlyProfit")||o.push(3),o}return[]}static getTickIntegers(e,n){if(e===Pi.SOLAR_PANEL_ARRAY){const o=[];return n.includes("rowWidth")||o.push(!0),n.includes("tiltAngle")||o.push(!1),n.includes("interRowSpacing")||o.push(!1),n.includes("latitude")||o.push(!1),n.includes("orientation")||o.push(!0),n.includes("poleHeight")||o.push(!1),n.includes("unitCost")||o.push(!1),n.includes("sellingPrice")||o.push(!1),n.includes("totalYearlyCost")||o.push(!1),n.includes("totalYearlyYield")||o.push(!1),n.includes("meanYearlyYield")||o.push(!1),n.includes("yearlyProfit")||o.push(!1),o}return[]}static getUnits(e,n,o){if(e===Pi.SOLAR_PANEL_ARRAY){const r=[];return o.includes("rowWidth")||r.push(" "+Y.t("solarPanelMenu.Panels",n)),o.includes("tiltAngle")||r.push("°"),o.includes("interRowSpacing")||r.push(" "+Y.t("word.MeterAbbreviation",n)),o.includes("latitude")||r.push("°"),o.includes("orientation")||r.push(""),o.includes("poleHeight")||r.push(" "+Y.t("word.MeterAbbreviation",n)),o.includes("unitCost")||r.push(""),o.includes("sellingPrice")||r.push(""),o.includes("totalYearlyCost")||r.push("K"),o.includes("totalYearlyYield")||r.push(" MWh"),o.includes("meanYearlyYield")||r.push(" kWh"),o.includes("yearlyProfit")||r.push("K"),r}return[]}static getUnit(e,n){return e==="tiltAngle"||e==="latitude"?"°":e==="interRowSpacing"||e==="poleHeight"?Y.t("word.MeterAbbreviation",n):e==="totalYearlyYield"?"MWh":e==="meanYearlyYield"?"kWh":e==="totalYearlyCost"||e==="yearlyProfit"?"K":""}static setScatterData(e,n,o,r){switch(e){case"rowWidth":o[n]=r.rowsPerRack;break;case"tiltAngle":o[n]=me.toDegrees(r.tiltAngle);break;case"interRowSpacing":o[n]=r.interRowSpacing;break;case"latitude":o[n]=r.latitude;break;case"orientation":o[n]=r.orientation===vr.landscape?0:1;break;case"poleHeight":o[n]=r.poleHeight;break;case"unitCost":o[n]=r.unitCost;break;case"sellingPrice":o[n]=r.sellingPrice;break;case"totalYearlyCost":o[n]=me.calculateCost(r);break;case"totalYearlyYield":o[n]=r.yearlyYield*.001;break;case"meanYearlyYield":o[n]=r.yearlyYield/r.panelCount;break;case"yearlyProfit":o[n]=me.calculateProfit(r);break}}}class Wen{static updateOldFileData(){H.getState().set(e=>{me.compareVersion(e.version,G6t)&&(e.viewState.ambientLightIntensity&&(e.viewState.ambientLightIntensity*=3),e.viewState.directLightIntensity&&(e.viewState.directLightIntensity*=3.5));const n=new Map;for(const o of e.elements)n.set(o.id,o);for(const o of e.elements)switch(o.type){case z.Foundation:{o.parentId!==Zo&&(console.error("Error: "+o.parentId+" is not ground!"),o.parentId=Zo);break}case z.Wall:{const r=o;if(r.wallStructure===void 0&&(r.wallStructure=gc.Default),r.structureSpacing===void 0&&(r.structureSpacing=2),r.structureWidth===void 0&&(r.structureWidth=.1),r.structureColor===void 0&&(r.structureColor="white"),r.opacity===void 0&&(r.opacity=.5),r.fill===void 0&&(r.fill=El.Full),r.unfilledHeight===void 0&&(r.unfilledHeight=.5),r.leftUnfilledHeight===void 0||r.rightUnfilledHeight===void 0){const i=r.unfilledHeight??.5;r.leftUnfilledHeight=i,r.rightUnfilledHeight=i}if((r.leftTopPartialHeight===void 0||r.rightTopPartialHeight===void 0)&&(r.leftTopPartialHeight=r.lz,r.rightTopPartialHeight=r.lz),r.eavesLength===void 0&&r.roofId){const i=n.get(r.roofId);if(i&&i.type===z.Roof){const a=i;r.eavesLength=a.overhang!==void 0?a.overhang:.3}else r.eavesLength=.3}if(r.parapet===void 0&&(r.parapet={...Jye}),r.roofId){const i=n.get(r.roofId);if(i&&i.type===z.Roof){const a=i;(a.roofType===Go.Pyramid||a.roofType===Go.Hip||a.roofType===Go.Mansard)&&(r.leftRoofHeight=void 0,r.rightRoofHeight=void 0)}}break}case z.Window:{const r=o;r.horizontalMullion===void 0&&(r.horizontalMullion=r.mullion),r.verticalMullion===void 0&&(r.verticalMullion=r.mullion),r.mullionWidth===void 0&&(r.mullionWidth=.06),r.horizontalMullionSpacing===void 0&&(r.horizontalMullionSpacing=r.mullionSpacing??.5),r.verticalMullionSpacing===void 0&&(r.verticalMullionSpacing=r.mullionSpacing??.5),r.tint===void 0&&(r.tint="#73D8FF"),r.opacity===void 0&&(r.opacity=.5),r.shutter&&(r.leftShutter=r.shutter.showLeft,r.rightShutter=r.shutter.showRight,r.shutterColor=r.shutter.color,r.shutterWidth=r.shutter.width,r.shutter=void 0),r.shutterColor===void 0&&(r.shutterColor="gray"),r.shutterWidth===void 0&&(r.shutterWidth=.5),r.mullionColor===void 0&&(r.mullionColor="white"),r.frame===void 0&&(r.frame=!1),r.color===void 0&&(r.color="white"),r.frameWidth===void 0&&(r.frameWidth=.1),r.windowType===void 0&&(r.windowType=Ti.Default),r.archHeight===void 0&&(r.archHeight=1);break}case z.Door:{const r=o;r.doorType===void 0&&(r.doorType=Pd.Default),r.archHeight===void 0&&(r.archHeight=1),r.filled===void 0&&(r.filled=!0);break}case z.Roof:{const r=o;if(r.ceiling===void 0&&(r.ceiling=!1),r.roofType===Go.Gambrel){const i=r;i.frontRidgePoint===void 0&&(i.frontRidgePoint=i.frontRidgeLeftPoint?[...i.frontRidgeLeftPoint]:[.35,.5],i.frontRidgeLeftPoint=void 0,i.frontRidgeRightPoint=void 0),i.backRidgePoint===void 0&&(i.backRidgePoint=i.backRidgeLeftPoint?[...i.backRidgeLeftPoint]:[-.35,.5],i.backRidgeLeftPoint=void 0,i.backRidgeRightPoint=void 0),i.topRidgePoint===void 0&&(i.topRidgePoint=i.topRidgeLeftPoint?[...i.topRidgeLeftPoint]:[0,1],i.topRidgeLeftPoint=void 0,i.topRidgeRightPoint=void 0)}break}case z.SolarPanel:{const r=o;if(r.version===void 0)switch(r.version=1,r.parentType){case void 0:case z.Foundation:{r.parentType=z.Foundation;const i=n.get(r.parentId);i&&(r.cx=r.cx*i.lx,r.cy=r.cy*i.ly,r.cz=r.cz*i.lz),r.rotation[2]!==0&&(r.rotation=[0,0,0]);break}case z.Cuboid:{const i=n.get(r.parentId);i&&(r.cx=r.cx*i.lx,r.cy=r.cy*i.ly,r.cz=r.cz*i.lz,r.rotation=ea.getRotationOnCuboid(new ie().fromArray(r.normal)),me.isEqual(0,r.rotation[0])&&r.rotation[2]!==0&&(r.rotation=[0,0,0]));break}case z.Wall:{r.normal=[0,-1,0],r.rotation=[Gt,0,0];break}case z.Roof:{if(r.foundationId){const i=n.get(r.foundationId);i&&(r.cx=r.cx*i.lx,r.cy=r.cy*i.ly,r.cz=r.cz+i.lz/2)}break}}}}})}}function md(t){return t.type===z.Foundation||t.type===z.Cuboid}Wpt();const H=XK()(j6t(_6t((t,e)=>{const n=me.isOpenFromURL(),o=new OSe,r=n?[]:o.getElements(),i=a=>t(OP(a));return{set:a=>{try{i(a)}catch(l){console.log(l)}},version:TC,world:o,elements:r,user:{},viewState:new VSe,actionState:new oTe,graphState:new iTe,solarPanelArrayLayoutParams:new XSe,solarPanelArrayLayoutConstraints:new dX,evolutionaryAlgorithmState:new QSe,economicsParams:new tTe,geneticAlgorithmWizardSelectedTab:"1",particleSwarmOptimizationWizardSelectedTab:"1",modelType:pa.UNKNOWN,modelAuthor:null,modelLabel:null,modelDescription:null,projectView:!1,projectState:{owner:null,title:null,description:null,type:Pi.SOLAR_PANEL_ARRAY,designs:new Array,ranges:new Array,filters:new Array,hiddenParameters:pd.getDefaultHiddenParameters(Pi.SOLAR_PANEL_ARRAY),counter:0,dataColoring:d9.ALL,selectedProperty:null,sortDescending:!1,xAxisNameScatterPlot:null,yAxisNameScatterPlot:null,dotSizeScatterPlot:5,thumbnailWidth:200},projectImages:new Map,designProjectType:null,notes:[],language:"en",floatingWindowOpacity:m0,selectedFloatingWindow:null,cloudFile:void 0,latestModelSite:void 0,modelSites:new Map,peopleModels:new Map,modelsMapLatitude:42.2844063,modelsMapLongitude:-71.3488548,modelsMapAddress:dG,modelsMapZoom:tje,modelsMapType:"roadmap",modelsMapTilt:0,minimumNavigationMoveSpeed:3,minimumNavigationTurnSpeed:3,tempHumanPlant:[],ray:new l0,mouse:new Xt,fileChanged:!1,setNavigationView(a){i(l=>{l.viewState.navigationView=a,l.viewState.enableRotate=!a,a&&(l.viewState.orthographic=!1)})},set2DView(a){i(l=>{l.viewState.orthographic=a,l.viewState.enableRotate=!a,a&&(l.viewState.navigationView=!1)})},applyCount:0,setApplyCount(a){i(l=>{l.applyCount=a})},revertApply(){if(e().applyCount){for(let a=0;a{s.version=a.version,s.world=a.world,s.viewState=a.view,s.graphState=a.graphState??new iTe,s.elements=a.elements,s.notes=a.notes??[],s.animate24Hours=!!a.animate24Hours,s.modelType=a.modelType??pa.UNKNOWN,s.modelAuthor=a.modelAuthor??null,s.modelLabel=a.modelLabel??null,s.modelDescription=a.modelDescription??null,s.designProjectType=a.designProjectType??null,s.cloudFile=l,s.currentUndoable=void 0,s.actionInfo=void 0,s.sceneRadius=a.sceneRadius??100,s.updateSceneRadiusFlag=!s.updateSceneRadiusFlag,s.localContentToImportAfterCloudFileUpdate=void 0,s.fileChanged=!s.fileChanged,s.evolutionMethod=a.evolutionMethod??Vs.GENETIC_ALGORITHM,s.solarPanelArrayLayoutParams=a.solarPanelArrayLayoutParams??new XSe,s.solarPanelArrayLayoutConstraints=a.solarPanelArrayLayoutConstraints??new dX,s.evolutionaryAlgorithmState=a.evolutionaryAlgorithmState??new QSe,s.economicsParams=a.economicsParams??new tTe,s.minimumNavigationMoveSpeed=a.minimumNavigationMoveSpeed??3,s.minimumNavigationTurnSpeed=a.minimumNavigationTurnSpeed??3,s.fittestIndividualResults.length=0,s.undoManager.clear(),s.deletedRoofId=null,s.autoDeletedRoofs=null,s.autoDeletedRoofIdSet.clear(),s.autoDeletedChild=null,s.deletedRoofIdSet.clear(),s.addedRoofIdSet.clear(),s.actionState=new oTe,s.multiSelectionsMode=!1,s.selectedElementIdSet.clear(),s.groupActionMode=!1,s.selectedFloatingWindow=null}),Wen.updateOldFileData(),ht.getState().set(s=>{s.changed=!1,s.skipChange=!0,s.animateSun=!1,s.showSolarRadiationHeatmap=!1,s.showHeatFluxes=!1,s.simulationInProgress=!1,s.simulationPaused=!1,s.clearDailySimulationResultsFlag=!s.clearDailySimulationResultsFlag,s.clearYearlySimulationResultsFlag=!s.clearYearlySimulationResultsFlag,s.navigationMoveSpeed=a.minimumNavigationMoveSpeed??3,s.navigationTurnSpeed=a.minimumNavigationTurnSpeed??3}),Tn.getState().clearDataStore(),Tn.getState().clearRoofVerticesMap()},exportContent(){const a=e(),l=new Date,s=JSON.parse(JSON.stringify(a.elements));return me.fixElements(s),{docid:Xi.generate(),time:yc(l).format("MM/DD/YYYY hh:mm A"),timestamp:l.getTime(),userid:a.user.uid,owner:a.user.signFile?a.user.displayName:null,email:a.user.signFile?a.user.email:null,version:TC,world:JSON.parse(JSON.stringify(a.world)),elements:s,sceneRadius:a.sceneRadius,view:JSON.parse(JSON.stringify(a.viewState)),animate24Hours:a.animate24Hours,graphState:JSON.parse(JSON.stringify(a.graphState)),evolutionMethod:a.evolutionMethod,solarPanelArrayLayoutParams:JSON.parse(JSON.stringify(a.solarPanelArrayLayoutParams)),solarPanelArrayLayoutConstraints:JSON.parse(JSON.stringify(a.solarPanelArrayLayoutConstraints)),evolutionaryAlgorithmState:JSON.parse(JSON.stringify(a.evolutionaryAlgorithmState)),economicsParams:JSON.parse(JSON.stringify(a.economicsParams)),modelType:a.modelType,modelAuthor:a.modelAuthor,modelLabel:a.modelLabel,modelDescription:a.modelDescription,designProjectType:a.designProjectType,notes:a.notes,minimumNavigationMoveSpeed:a.minimumNavigationMoveSpeed,minimumNavigationTurnSpeed:a.minimumNavigationTurnSpeed}},clearContent(){i(a=>{a.elements=[],a.sceneRadius=100}),Tn.getState().clearDataStore(),Tn.getState().clearRoofVerticesMap()},createEmptyFile(){i(a=>{OSe.resetWorldModel(a.world),VSe.resetViewState(a.viewState),a.version=TC,a.elements=[],a.sceneRadius=100,a.cloudFile=void 0,a.localContentToImportAfterCloudFileUpdate=void 0,a.notes=[],a.fileChanged=!a.fileChanged,a.currentUndoable=void 0,a.actionInfo=void 0,a.undoManager.clear(),a.modelType=pa.UNKNOWN,a.modelLabel=null,a.modelDescription=null,a.designProjectType=null,a.minimumNavigationMoveSpeed=3,a.minimumNavigationTurnSpeed=3,a.multiSelectionsMode=!1,a.selectedElementIdSet.clear(),a.groupActionMode=!1,a.selectedFloatingWindow=null,a.deletedRoofId=null,a.autoDeletedRoofs=null,a.autoDeletedRoofIdSet.clear(),a.autoDeletedChild=null,a.deletedRoofIdSet.clear(),a.addedRoofIdSet.clear()}),ht.getState().set(a=>{a.changed=!1,a.skipChange=!0,a.animateSun=!1,a.showSolarRadiationHeatmap=!1,a.showHeatFluxes=!1}),Tn.getState().clearDataStore(),Tn.getState().clearRoofVerticesMap()},undoManager:new Fen,addUndoable(a){i(l=>{l.loggable&&(l.currentUndoable=a),l.undoManager.add(a)})},fittestIndividualResults:[],setFittestIndividualResults(a){i(l=>{l.fittestIndividualResults=[...a]})},variableLabels:[],setVariableLabels(a){i(l=>{l.variableLabels=[...a]})},aabb:new bf(new ie(-10,-10,-10),new ie(10,10,10)),animate24Hours:!1,evolutionMethod:Vs.GENETIC_ALGORITHM,clickObjectType:null,contextMenuObjectType:null,hoveredHandle:null,moveHandleType:null,resizeHandleType:null,rotateHandleType:null,resizeAnchor:new ie,selectedElement:null,getSelectedElement(){if(e().selectedElementIdSet.size===0)return null;const a=e().selectedElement;return a?e().elements.find(l=>l.id===a.id)??null:null},selectedElementIdSet:new Set,multiSelectionsMode:!1,findNearestSibling(a){let l=null;const s=e().getElementById(a);if(s){let c=Number.MAX_VALUE;for(const u of e().elements)if(u.type===s.type&&u.parentId===s.parentId&&u.id!==a){const d=s.cx-u.cx,f=s.cy-u.cy,p=s.cz-u.cz,g=d*d+f*f+p*p;c>g&&(c=g,l=u.id)}}return l},overlapWithSibling(a,l){let s=!1;if(l===void 0){const c=e().getParent(a);if(c){for(const u of e().elements)if(u.type===a.type&&u.parentId===a.parentId&&u.id!==a.id){if(a.type===z.SolarPanel){if(me.doSolarPanelsOverlap(a,u,c)){s=!0;break}}else if(Math.abs(a.cx-u.cx)*c.lx<.5*(a.lx+u.lx)&&Math.abs(a.cy-u.cy)*c.ly<.5*(a.ly+u.ly)&&Math.abs(a.cz-u.cz)*c.lz<.5*(a.lz+u.lz)){s=!0;break}}}}else{const c=l*l,u=e().getParent(a);for(const d of e().elements)if(d.type===a.type&&d.parentId===a.parentId&&d.id!==a.id){const f=(a.cx-d.cx)*(u?u.lx:1),p=(a.cy-d.cy)*(u?u.ly:1),g=(a.cz-d.cz)*(u?u.lz:1);if(f*f+p*p+g*gC.id===g);if(b){const C=new ie(b.cx,b.cy,b.lz),P=new nn(0,0,b.rotation[2]),v=new ie;switch(l){case vt.UpperLeft:{v.fromArray(w.leftPoint).setZ(0);break}case vt.UpperRight:{v.fromArray(w.rightPoint).setZ(0);break}}y.copy(v.applyEuler(P).add(C))}break}case z.Roof:{const w=e().elements.find(b=>b.id===g);if(w){const b=new ie(w.cx,w.cy,w.lz),C=new nn(0,0,w.rotation[2]),P=new ie(e().selectedElementX,e().selectedElementY).applyEuler(C).add(b);y.set(P.x,P.y,w.lz)}break}case z.Tree:{const w=e().elements.find(b=>b.id===g);if(w){const b=new ie(w.cx,w.cy,w.cz+w.lz/2),C=new nn(0,0,w.rotation[2]);y.copy(new ie(a.cx,a.cy,w.lz).applyEuler(C).add(b))}break}}return y},getElementById(a){const l=e().elements;for(const s of l)if(s.id===a)return s;return null},getParent(a){const l=e().elements;for(const s of l)if(s.id===a.parentId)return s;return null},getFoundation(a){const l=e().elements;for(const s of l)if(s.id===a.foundationId&&s.type===z.Foundation)return s;return null},selectNone(){i(a=>{a.selectedElementIdSet.clear();for(const l of a.elements)l.selected=!1;a.selectedElement=null}),Fn.getState().selectNone()},selectMe(a,l,s,c){const u=Fn.getState().setEnableOrbitController;l.intersections.length>0&&(l.intersections.filter(f=>!f.eventObject.name.startsWith("Wall Intersection Plane"))[0].object===l.eventObject||c)&&i(f=>{var p,g,y;for(const w of f.elements)if(w.id===a)if(w.selected=!0,f.selectedElement=w,f.selectedElementHeight=w.lz,f.groupActionMode){let b=w.foundationId??null;!b&&md(w)&&(b=me.getBaseId(w.id)),b&&(f.multiSelectionsMode||f.selectedElementIdSet.clear(),f.selectedElementIdSet.has(b)?f.selectedElementIdSet.delete(b):f.selectedElementIdSet.add(b))}else if(s===Oo.ContextMenu)if(f.selectedElementIdSet.has(a))for(const b of f.elements)f.selectedElementIdSet.has(b.id)&&b.type!==f.selectedElement.type&&f.selectedElementIdSet.delete(b.id);else if(f.multiSelectionsMode){f.selectedElementIdSet.add(a);for(const b of f.elements)f.selectedElementIdSet.has(b.id)&&b.type!==f.selectedElement.type&&f.selectedElementIdSet.delete(b.id)}else f.selectedElementIdSet.clear(),f.selectedElementIdSet.add(a);else f.multiSelectionsMode?f.selectedElementIdSet.has(a)?f.selectedElementIdSet.delete(a):f.selectedElementIdSet.add(a):(f.selectedElementIdSet.clear(),f.selectedElementIdSet.add(a));else w.selected=!1;if(f.moveHandleType=null,f.resizeHandleType=null,f.rotateHandleType=null,f.contextMenuObjectType=null,s)switch(s){case Oo.Move:{((p=f.selectedElement)==null?void 0:p.type)===z.Tree||((g=f.selectedElement)==null?void 0:g.type)===z.Human?f.moveHandleType=Ho.Default:f.moveHandleType=l.eventObject.name,u(!1);break}case Oo.Resize:{f.resizeHandleType=l.eventObject.name,u(!1);break}case Oo.Rotate:{f.rotateHandleType=l.eventObject.name,u(!1);break}case Oo.Select:{f.selectedElementAngle=((y=l.object.parent)==null?void 0:y.rotation.z)??0,u(!0);break}default:u(!0)}})},countHeatmapCells(){let a=0;return i(l=>{const s=l.world.solarRadiationHeatmapGridCellSize??.5,c=s*s;for(const u of l.elements)(u.type===z.Foundation||u.type===z.Cuboid)&&(a+=u.lx*u.ly/c)}),Math.round(a)},updateAllElementLocks(a){i(l=>{for(const s of l.elements)s.locked=a})},updateElementLockByFoundationId(a,l){i(s=>{for(const c of s.elements)(c.foundationId===a||c.parentId===a||c.id===a)&&(c.locked=l)})},updateElementLockByParentId(a,l,s){i(c=>{for(const u of c.elements)u.parentId===a&&l===u.type&&(u.locked=s)})},updateElementLockById(a,l){i(s=>{for(const c of s.elements)if(c.id===a){c.locked=l;break}})},updateElementReferenceById(a,l){i(s=>{for(const c of s.elements)if(c.id===a){c.referenceId=l;break}})},updateElementLabelById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.label=l;break}})},updateElementShowLabelById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.showLabel=l;break}})},updateElementColorById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.color=l;break}})},updateElementColorOnSurface(a,l,s,c){i(u=>{for(const d of u.elements)d.type===a&&d.parentId===l&&me.isIdentical(d.normal,s)&&!d.locked&&(d.color=c)})},updateElementColorAboveFoundation(a,l,s){i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&!u.locked&&(u.color=s)})},updateElementColorForAll(a,l){i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.color=l)})},updateElementLineColorById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.lineColor=l;break}})},updateElementLineColorOnSurface(a,l,s,c){i(u=>{for(const d of u.elements)d.type===a&&d.parentId===l&&me.isIdentical(d.normal,s)&&!d.locked&&(d.lineColor=c)})},updateElementLineColorAboveFoundation(a,l,s){i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&!u.locked&&(u.lineColor=s)})},updateElementLineColorForAll(a,l){i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.lineColor=l)})},updateElementLineWidthById(a,l){i(s=>{for(const c of s.elements)if(c.id===a){c.lineWidth=l;break}})},updateElementLineWidthOnSurface(a,l,s,c){i(u=>{for(const d of u.elements)d.type===a&&d.parentId===l&&me.isIdentical(d.normal,s)&&!d.locked&&(d.lineWidth=c)})},updateElementLineWidthAboveFoundation(a,l,s){i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&!u.locked&&(u.lineWidth=s)})},updateElementLineWidthForAll(a,l){i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.lineWidth=l)})},updateElementCxById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.cx=l,c.type===z.SolarPanel&&c.parentType===z.Roof&&(s.updateElementOnRoofFlag=!0);break}})},updateElementCyById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.cy=l,c.type===z.SolarPanel&&c.parentType===z.Roof&&(s.updateElementOnRoofFlag=!0);break}})},updateElementCzById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.cz=l;break}})},updateElementCzForAll(a,l){i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.cz=l)})},updateElementLxById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.lx=l;break}})},updateElementLxAboveFoundation(a,l,s){i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&!u.locked&&(u.lx=s)})},updateElementLxOnSurface(a,l,s,c){i(u=>{for(const d of u.elements)if(d.type===a&&!d.locked){let f;s?f=d.parentId===l&&me.isIdentical(d.normal,s):f=d.parentId===l,f&&(d.lx=c)}})},updateElementLxForAll(a,l){i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.lx=l)})},updateElementLyById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.ly=l;break}})},updateElementLyAboveFoundation(a,l,s){i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&!u.locked&&(u.ly=s)})},updateElementLyOnSurface(a,l,s,c){i(u=>{for(const d of u.elements)if(d.type===a&&!d.locked){let f;s?f=d.parentId===l&&me.isIdentical(d.normal,s):f=d.parentId===l,f&&(d.ly=c)}})},updateElementLyForAll(a,l){i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.ly=l)})},updateElementLzById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){c.lz=l;break}})},updateElementLzAboveFoundation(a,l,s){i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&!u.locked&&(u.lz=s)})},updateElementLzOnSurface(a,l,s,c){i(u=>{for(const d of u.elements)if(d.type===a&&!d.locked){let f;s?f=d.parentId===l&&me.isIdentical(d.normal,s):f=d.parentId===l,f&&(d.lz=c)}})},updateElementLzForAll(a,l){i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.lz=l)})},updateElementRotationById(a,l,s,c){i(u=>{for(const d of u.elements)(d.id===a&&!d.locked||d.parentId===a&&!w$e(d)&&d.type!==z.SolarPanel)&&(d.rotation[0]=l,d.rotation[1]=s,d.rotation[2]=c);u.selectedElementAngle=c})},updateElementRotationForAll(a,l,s,c){i(u=>{for(const d of u.elements)if(d.type===a)d.locked||(d.rotation[0]=l,d.rotation[1]=s,d.rotation[2]=c);else{const f=u.getParent(d);f&&!f.locked&&f.type===a&&(d.rotation[0]=l,d.rotation[1]=s,d.rotation[2]=c)}})},updateSolarCollectorDrawSunBeamById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked&&me.isSolarCollector(c)){c.drawSunBeam=l;break}})},updateSolarCollectorDrawSunBeamAboveFoundation(a,l,s){me.isSolarCollectorType(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&u.type===a&&(u.drawSunBeam=s)})},updateSolarCollectorDrawSunBeamForAll(a,l){me.isSolarCollectorType(a)&&i(s=>{for(const c of s.elements)c.locked||c.type===a&&(c.drawSunBeam=l)})},updateSolarCollectorRelativeAzimuthById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked&&me.isSolarCollector(c)){c.relativeAzimuth=l,s.selectedElementAngle=l;break}})},updateSolarCollectorRelativeAzimuthAboveFoundation(a,l,s){me.isSolarCollectorType(a)&&i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&!u.locked&&u.parentType!==z.Wall&&(u.relativeAzimuth=s)})},updateSolarCollectorRelativeAzimuthOnSurface(a,l,s,c){me.isSolarCollectorType(a)&&i(u=>{for(const d of u.elements)if(d.type===a&&!d.locked){let f;s?f=d.parentId===l&&me.isIdentical(d.normal,s):f=d.parentId===l,f&&(d.relativeAzimuth=c)}})},updateSolarCollectorRelativeAzimuthForAll(a,l){me.isSolarCollectorType(a)&&i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&c.parentType!==z.Wall&&(c.relativeAzimuth=l)})},updateSolarCollectorXById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked&&me.isSolarCollector(c)){c.cx=l;break}})},updateSolarCollectorXAboveFoundation(a,l,s){me.isSolarCollectorType(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&u.type===a&&(u.cx=s)})},updateSolarCollectorXForAll(a,l){me.isSolarCollectorType(a)&&i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.cx=l)})},updateSolarCollectorYById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked&&me.isSolarCollector(c)){c.cy=l;break}})},updateSolarCollectorYAboveFoundation(a,l,s){me.isSolarCollectorType(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&u.type===a&&(u.cy=s)})},updateSolarCollectorYForAll(a,l){me.isSolarCollectorType(a)&&i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.cy=l)})},updateSolarCollectorPoleHeightById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked&&me.isSolarCollector(c)){c.poleHeight=l;break}})},updateSolarCollectorPoleHeightAboveFoundation(a,l,s){me.isSolarCollectorType(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&u.type===a&&(u.poleHeight=s)})},updateSolarCollectorPoleHeightOnSurface(a,l,s,c){me.isSolarCollectorType(a)&&i(u=>{for(const d of u.elements)if(!d.locked&&d.type===a){let f;s?f=d.parentId===l&&me.isIdentical(d.normal,s):f=d.parentId===l,f&&(d.poleHeight=c)}})},updateSolarCollectorPoleHeightForAll(a,l){me.isSolarCollectorType(a)&&i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.poleHeight=l)})},updateSolarCollectorPoleRadiusById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked&&me.isSolarCollector(c)){c.poleRadius=l;break}})},updateSolarCollectorPoleRadiusAboveFoundation(a,l,s){me.isSolarCollectorType(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&u.type===a&&(u.poleRadius=s)})},updateSolarCollectorPoleRadiusOnSurface(a,l,s,c){me.isSolarCollectorType(a)&&i(u=>{for(const d of u.elements)if(!d.locked&&d.type===a){let f;s?f=d.parentId===l&&me.isIdentical(d.normal,s):f=d.parentId===l,f&&(d.poleRadius=c)}})},updateSolarCollectorPoleRadiusForAll(a,l){me.isSolarCollectorType(a)&&i(s=>{for(const c of s.elements)c.type===a&&!c.locked&&(c.poleRadius=l)})},clearAllSolarCollectorYields(){i(a=>{for(const l of a.elements)if(me.isSolarCollector(l)){const s=l;s.dailyYield=0,s.yearlyYield=0}})},updateSolarCollectorDailyYieldById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&me.isSolarCollector(c)){c.dailyYield=l;break}})},updateSolarCollectorYearlyYieldById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&me.isSolarCollector(c)){c.yearlyYield=l;break}})},updateCspReflectanceById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&me.isCspCollector(c)){c.reflectance=l;break}})},updateCspReflectanceAboveFoundation(a,l,s){me.isCspCollectorType(a)&&i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&(u.reflectance=s)})},updateCspReflectanceForAll(a,l){me.isCspCollectorType(a)&&i(s=>{for(const c of s.elements)c.type===a&&(c.reflectance=l)})},updateParabolicCollectorAbsorptanceById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&me.isParabolicCollector(c)){c.absorptance=l;break}})},updateParabolicCollectorAbsorptanceAboveFoundation(a,l,s){me.isParabolaType(a)&&i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&(u.absorptance=s)})},updateParabolicCollectorAbsorptanceForAll(a,l){me.isParabolaType(a)&&i(s=>{for(const c of s.elements)c.type===a&&(c.absorptance=l)})},updateParabolicCollectorOpticalEfficiencyById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&me.isParabolicCollector(c)){c.opticalEfficiency=l;break}})},updateParabolicCollectorOpticalEfficiencyAboveFoundation(a,l,s){me.isParabolaType(a)&&i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&(u.opticalEfficiency=s)})},updateParabolicCollectorOpticalEfficiencyForAll(a,l){me.isParabolaType(a)&&i(s=>{for(const c of s.elements)c.type===a&&(c.opticalEfficiency=l)})},updateParabolicCollectorThermalEfficiencyById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&me.isParabolicCollector(c)){c.thermalEfficiency=l;break}})},updateParabolicCollectorThermalEfficiencyAboveFoundation(a,l,s){me.isParabolaType(a)&&i(c=>{for(const u of c.elements)u.type===a&&u.foundationId===l&&(u.thermalEfficiency=s)})},updateParabolicCollectorThermalEfficiencyForAll(a,l){me.isParabolaType(a)&&i(s=>{for(const c of s.elements)c.type===a&&(c.thermalEfficiency=l)})},foundationActionScope:oe.OnlyThisObject,setFoundationActionScope(a){i(l=>{l.foundationActionScope=a})},cuboidActionScope:oe.OnlyThisObject,setCuboidActionScope(a){i(l=>{l.cuboidActionScope=a})},polygonActionScope:oe.OnlyThisObject,setPolygonActionScope(a){i(l=>{l.polygonActionScope=a})},updatePolygonVertexPositionById(a,l,s,c){i(u=>{for(const d of u.elements)if(d.type===z.Polygon&&d.id===a){const f=d;l>=0&&l{for(const c of s.elements)if(c.type===z.Polygon&&c.id===a){const u=c;u.vertices=l;break}})},waterHeaterActionScope:oe.OnlyThisObject,setWaterHeaterActionScope(a){i(l=>{l.waterHeaterActionScope=a})},solarPanelActionScope:oe.OnlyThisObject,setSolarPanelActionScope(a){i(l=>{l.solarPanelActionScope=a})},updateSolarPanelTiltAngleById(a,l){i(s=>{for(const c of s.elements)if(c.type===z.SolarPanel&&c.id===a&&!c.locked){const u=c;u.tiltAngle=l;break}})},setSolarPanelOrientation(a,l,s){if(a.orientation=s,a.orientation===vr.portrait){const c=Math.max(1,Math.round(a.lx/l.width)),u=Math.max(1,Math.round(a.ly/l.length));a.lx=c*l.width,a.ly=u*l.length}else{const c=Math.max(1,Math.round(a.lx/l.length)),u=Math.max(1,Math.round(a.ly/l.width));a.lx=c*l.length,a.ly=u*l.width}},parabolicTroughActionScope:oe.OnlyThisObject,setParabolicTroughActionScope(a){i(l=>{l.parabolicTroughActionScope=a})},fresnelReflectorActionScope:oe.OnlyThisObject,setFresnelReflectorActionScope(a){i(l=>{l.fresnelReflectorActionScope=a})},heliostatActionScope:oe.OnlyThisObject,setHeliostatActionScope(a){i(l=>{l.heliostatActionScope=a})},updateSolarReceiverById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){if(c.type===z.Heliostat){c.towerId=l;break}else if(c.type===z.FresnelReflector){c.receiverId=l;break}}})},updateSolarReceiverAboveFoundation(a,l,s){me.isHeliostatOrFresnelReflector(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&(u.type===z.Heliostat?u.towerId=s:u.type===z.FresnelReflector&&(u.receiverId=s))})},updateSolarReceiverForAll(a,l){me.isHeliostatOrFresnelReflector(a)&&i(s=>{for(const c of s.elements)c.locked||(c.type===z.Heliostat?c.towerId=l:c.type===z.FresnelReflector&&(c.receiverId=l))})},parabolicDishActionScope:oe.OnlyThisObject,setParabolicDishActionScope(a){i(l=>{l.parabolicDishActionScope=a})},updateModuleLengthById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){if(c.type===z.ParabolicTrough){c.moduleLength=l;break}else if(c.type===z.FresnelReflector){c.moduleLength=l;break}}})},updateModuleLengthAboveFoundation(a,l,s){me.isParabolicTroughOrFresnelReflector(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&(u.type===z.ParabolicTrough||u.type===z.FresnelReflector)&&(u.moduleLength=s)})},updateModuleLengthForAll(a,l){me.isParabolicTroughOrFresnelReflector(a)&&i(s=>{for(const c of s.elements)c.locked||(c.type===z.ParabolicTrough||c.type===z.FresnelReflector)&&(c.moduleLength=l)})},updateParabolaLatusRectumById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&!c.locked){(c.type===z.ParabolicTrough||c.type===z.ParabolicDish)&&(c.latusRectum=l);break}})},updateParabolaLatusRectumAboveFoundation(a,l,s){me.isParabolaType(a)&&i(c=>{for(const u of c.elements)u.foundationId===l&&!u.locked&&(u.type===z.ParabolicTrough||u.type===z.ParabolicDish)&&(u.latusRectum=s)})},updateParabolaLatusRectumForAll(a,l){me.isParabolaType(a)&&i(s=>{for(const c of s.elements)c.locked||(c.type===z.ParabolicTrough||c.type===z.ParabolicDish)&&(c.latusRectum=l)})},windTurbineActionScope:oe.OnlyThisObject,setWindTurbineActionScope(a){i(l=>{l.windTurbineActionScope=a})},wallActionScope:oe.OnlyThisObject,setWallActionScope(a){i(l=>{l.wallActionScope=a})},roofActionScope:oe.OnlyThisObject,setRoofActionScope(a){i(l=>{l.roofActionScope=a})},windowActionScope:oe.OnlyThisObject,setWindowActionScope(a){i(l=>{l.windowActionScope=a})},doorActionScope:oe.OnlyThisObject,setDoorActionScope(a){i(l=>{l.doorActionScope=a})},updateWallRelativeAngleById(a,l){i(s=>{for(const c of s.elements)if(c.type===z.Wall&&c.id===a&&!c.locked){c.relativeAngle=l;break}})},updateWallLeftJointsById(a,l){i(s=>{for(const c of s.elements)if(c.type===z.Wall&&c.id===a){c.leftJoints=l;break}})},updateWallRightJointsById(a,l){i(s=>{for(const c of s.elements)if(c.type===z.Wall&&c.id===a){c.rightJoints=l;break}})},updateWallLeftPointById(a,l){i(s=>{for(const c of s.elements)if(c.type===z.Wall&&c.id===a&&!c.locked){c.leftPoint=[...l];break}})},updateWallRightPointById(a,l){i(s=>{for(const c of s.elements)if(c.type===z.Wall&&c.id===a&&!c.locked){c.rightPoint=[...l];break}})},updateRoofRiseById(a,l,s){i(c=>{for(const u of c.elements)if(u.id===a&&u.type===z.Roof){u.rise=l,c.actionState.roofRise=l,s!==void 0&&(c.selectedElementHeight=s);break}})},updateRoofStructureById(a,l){i(s=>{for(const c of s.elements)if(c.id===a&&c.type===z.Roof){const u=c;u.roofStructure=l;break}})},updateInsideLightById(a,l){i(s=>{for(const c of s.elements)if(c.type===z.Light&&c.id===a){c.inside=l;break}})},updateInsideLightsByParentId(a,l){i(s=>{for(const c of s.elements)c.parentId===a&&c.type===z.Light&&(c.inside=l)})},setElementPosition(a,l,s,c){i(u=>{for(const[d,f]of u.elements.entries())if(f.id===a){u.elements[d].cx=l,u.elements[d].cy=s,c!==void 0&&(u.elements[d].cz=c);break}})},setElementNormal(a,l,s,c){i(u=>{for(const[d,f]of u.elements.entries())if(f.id===a||f.parentId===a){const p=u.elements[d];p.normal[0]=l,p.normal[1]=s,p.normal[2]=c}})},setElementSize(a,l,s,c){i(u=>{for(const[d,f]of u.elements.entries())if(f.id===a){u.elements[d].lx=l,u.elements[d].ly=s,c&&(u.elements[d].lz=c,u.selectedElementHeight=c);break}})},actionModeLock:!1,objectTypeToAdd:z.None,addElement(a,l,s){let c=null;const u="id"in a?a.id:Zo;return i(d=>{switch(d.objectTypeToAdd){case z.Human:{const f=new ie().copy(l);if(u!==Zo){const{rot:g,pos:y}=me.getWorldDataById(u);f.sub(new ie(y.x,y.y,y.z)).applyEuler(new nn(0,0,-g))}const p=Ga.makeHuman(d.actionState.humanName,u,f.x,f.y,f.z);c=p,d.elements.push(p);break}case z.Tree:{const f=new ie().copy(l);if(u!==Zo){const{rot:g,pos:y}=me.getWorldDataById(u);f.sub(new ie(y.x,y.y,y.z)).applyEuler(new nn(0,0,-g))}const p=Ga.makeTree(d.actionState.treeType,d.actionState.treeSpread,d.actionState.treeHeight,u,f.x,f.y,f.z);c=p,d.elements.push(p);break}case z.Flower:{const f=new ie().copy(l);if(u!==Zo){const{rot:g,pos:y}=me.getWorldDataById(u);f.sub(new ie(y.x,y.y,y.z)).applyEuler(new nn(0,0,-g))}const p=Ga.makeFlower(d.actionState.flowerType,u,f.x,f.y,f.z);c=p,d.elements.push(p);break}case z.Polygon:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f),g=Ga.makePolygon(f,p.x,p.y,p.z,s,"rotation"in a?a.rotation:void 0,f.type);c=g,d.elements.push(g);break}case z.Sensor:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f),g=Ga.makeSensor(f,p.x,p.y,p.z,s,"rotation"in a?a.rotation:void 0);c=g,d.elements.push(g);break}case z.Light:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f),g=Ga.makeLight(f,2,d.actionState.lightDistance,d.actionState.lightIntensity,d.actionState.lightColor,p.x,p.y,p.z,s,"rotation"in a?a.rotation:void 0);c=g,d.elements.push(g);break}case z.SolarPanel:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f,!0),g=Ga.makeSolarPanel(f,d.getPvModule(d.actionState.solarPanelModelName??"SPR-X21-335-BLK"),p.x,p.y,p.z,d.actionState.solarPanelOrientation??vr.landscape,d.actionState.solarPanelPoleHeight??1,d.actionState.solarPanelPoleSpacing??3,d.actionState.solarPanelTiltAngle??0,d.actionState.solarPanelRelativeAzimuth??0,s,[0,0,0],d.actionState.solarPanelFrameColor??"white");c=g,d.elements.push(g);break}case z.ParabolicTrough:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f),g=Ga.makeParabolicTrough(f,d.actionState.parabolicTroughReflectance,d.actionState.parabolicTroughAbsorptance,d.actionState.parabolicTroughOpticalEfficiency,d.actionState.parabolicTroughThermalEfficiency,d.actionState.parabolicTroughLatusRectum,d.actionState.parabolicTroughPoleHeight,d.actionState.parabolicTroughModuleLength,p.x,p.y,p.z,s,"rotation"in a?a.rotation:void 0,d.actionState.parabolicTroughWidth);c=g,d.elements.push(g);break}case z.ParabolicDish:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f),g=Ga.makeParabolicDish(f,d.actionState.parabolicDishReflectance,d.actionState.parabolicDishAbsorptance,d.actionState.parabolicDishOpticalEfficiency,d.actionState.parabolicDishThermalEfficiency,d.actionState.parabolicDishLatusRectum,d.actionState.parabolicDishPoleHeight,d.actionState.parabolicDishReceiverStructure,p.x,p.y,p.z,s,"rotation"in a?a.rotation:void 0,d.actionState.parabolicDishRimDiameter,d.actionState.parabolicDishRimDiameter);c=g,d.elements.push(g);break}case z.FresnelReflector:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f),g=Ga.makeFresnelReflector(f,d.actionState.fresnelReflectorReceiver,d.actionState.fresnelReflectorReflectance,d.actionState.fresnelReflectorPoleHeight,d.actionState.fresnelReflectorModuleLength,p.x,p.y,p.z,s,"rotation"in a?a.rotation:void 0,d.actionState.fresnelReflectorWidth);c=g,d.elements.push(g);break}case z.Heliostat:{const f=a,p=me.relativeCoordinates(l.x,l.y,l.z,f),g=Ga.makeHeliostat(f,d.actionState.heliostatTower,d.actionState.heliostatReflectance,d.actionState.heliostatPoleHeight,p.x,p.y,p.z,s,"rotation"in a?a.rotation:void 0,d.actionState.heliostatLength,d.actionState.heliostatWidth);c=g,d.elements.push(g);break}case z.WindTurbine:{const f=a,p=me.relativeCoordinates(l.x,l.y,0,f),g=Ga.makeWindTurbine(f,d.actionState.windTurbineBirdSafeDesign??uc.None,d.actionState.windTurbineBladeColor??t9,d.actionState.windTurbineStripeColor??n9,d.actionState.windTurbineNumberOfBlades??3,d.actionState.windTurbineInitialRotorAngle??0,d.actionState.windTurbineRelativeYawAngle??0,d.actionState.windTurbinePitchAngle??Math.PI/18,d.actionState.windTurbineBladeRadius??10,d.actionState.windTurbineBladeRootRadius??.3,d.actionState.windTurbineBladeMaximumChordLength??1,d.actionState.windTurbineBladeMaximumChordRadius??3,d.actionState.windTurbineTowerRadius??.5,d.actionState.windTurbineTowerHeight??20,d.actionState.windTurbineHubRadius??.75,d.actionState.windTurbineHubLength??1.5,p.x,p.y,0);c=g,d.elements.push(g);break}case z.Foundation:{const f=Ga.makeFoundation(l.x,l.y,d.actionState.foundationHeight,d.actionState.foundationColor,d.actionState.foundationTexture);c=f,d.elements.push(f);break}case z.Cuboid:{const f=Ga.makeCuboid(l.x,l.y,d.actionState.cuboidHeight,d.actionState.cuboidFaceColors,d.actionState.cuboidFaceTextures);c=f,d.elements.push(f);break}case z.Wall:{const f=a,p=me.wallRelativePosition(new ie(l.x,l.y),f),g=Ga.makeWall(f,p.x,p.y,p.z,s);d.elements.push(g),d.selectedElement=g,c=g;break}}c&&(d.selectedElementIdSet.clear(),d.selectedElementIdSet.add(c.id))}),c},elementsToPaste:[],deletedElements:[],clearDeletedElements(){i(a=>{a.deletedElements=[]})},pastePoint:new ie,pasteNormal:void 0,copyElementById(a){i(l=>{l.elementsToPaste=[];for(const s of l.elements)if(s.id===a){if(s.type===z.Polygon){const c=me.calculatePolygonCentroid(s.vertices);s.cx=c.x,s.cy=c.y,l.elementsToPaste.push(s)}else l.elementsToPaste.push(s);break}for(const s of l.elements)if(me.isChild(a,s.id)){if(s.type===z.Polygon){const c=me.calculatePolygonCentroid(s.vertices);s.cx=c.x,s.cy=c.y}l.elementsToPaste.push(s)}})},removeSelectedElements(){const a=e().selectedElementIdSet;if(a.size===0)return[];const l=Array.from(a),s=new Set,c=new Set;for(const u of e().elements)if(a.has(u.id))s.add(u),c.add(u.id);else for(const d of l)me.isChild(d,u.id)&&(s.add(u),c.add(u.id));return i(u=>{u.autoDeletedRoofs=[],u.deletedElements=Array.from(s),u.elements=u.elements.filter(d=>{var f,p;if(c.has(d.id)){switch(d.type){case z.Wall:{const g=d;let y="",w="";g.leftJoints.length>0&&(y=((f=u.getElementById(g.leftJoints[0]))==null?void 0:f.id)??""),g.rightJoints.length>0&&(w=((p=u.getElementById(g.rightJoints[0]))==null?void 0:p.id)??"");for(const b of u.elements)b.id===y?b.rightJoints=[]:b.id===w&&(b.leftJoints=[]);u.updateWallMapOnFoundationFlag=!u.updateWallMapOnFoundationFlag;break}case z.Roof:{u.deletedRoofIdSet.add(d.id),Tn.getState().deleteRoofSegmentVertices(d.id),Tn.getState().deleteRoofSegmentVerticesWithoutOverhang(d.id);break}}return!1}else return!0})}),Array.from(s)},removeElementById(a,l,s=!0,c){const u=e().elements.filter(d=>d.id===a||me.isChild(a,d.id));return i(d=>{var f,p;for(const g of d.elements)if(g.id===a){if(l)if(g.type===z.Polygon){const y=me.calculatePolygonCentroid(g.vertices);g.cx=y.x,g.cy=y.y,d.elementsToPaste=[g]}else d.elementsToPaste=[g];else c||(d.deletedElements=[g]);switch(g.selected=!1,g.type){case z.Roof:{const y=g;d.deletedRoofId=g.id,d.deletedRoofIdSet.add(g.id),Tn.getState().deleteRoofSegmentVertices(a),Tn.getState().deleteRoofSegmentVerticesWithoutOverhang(a),c&&(d.autoDeletedRoofs?d.autoDeletedRoofs.push(y):d.autoDeletedRoofs=[y],d.autoDeletedRoofIdSet.add(y.id));break}case z.Wall:{const y=g;let w="",b="";y.leftJoints.length>0&&(w=((f=d.getElementById(y.leftJoints[0]))==null?void 0:f.id)??""),y.rightJoints.length>0&&(b=((p=d.getElementById(y.rightJoints[0]))==null?void 0:p.id)??"");for(const C of d.elements)C.id===w?C.rightJoints=[]:C.id===b&&(C.leftJoints=[]);d.elements=d.elements.filter(C=>!(C.type===z.Roof&&C.wallsId.length===0)),d.updateWallMapOnFoundationFlag=!d.updateWallMapOnFoundationFlag,d.deletedWallId=g.id;break}case z.Foundation:{d.deletedFoundationId=g.id;break}case z.Cuboid:{d.deletedCuboidId=g.id;break}}break}if(c)for(const g of d.elements)me.isChild(a,g.id)&&(d.autoDeletedChild?d.autoDeletedChild.push(g):d.autoDeletedChild=[g]);else if(l)for(const g of d.elements)me.isChild(a,g.id)&&d.elementsToPaste.push(g);else for(const g of d.elements)me.isChild(a,g.id)&&d.deletedElements.push(g);d.elements=d.elements.filter(g=>g.id===a||g.parentId===a||g.foundationId===a||me.isChild(a,g.id)?(g.type===z.Roof&&(Tn.getState().deleteRoofSegmentVertices(a),Tn.getState().deleteRoofSegmentVerticesWithoutOverhang(a)),!1):!0),d.selectedElementIdSet.delete(a),s&&(d.selectedElement=null,d.selectedElementIdSet.clear())}),u},removeElementsByType(a){i(l=>{a===z.Foundation?l.elements=l.elements.filter(s=>s.locked||s.type!==z.Foundation&&!s.foundationId?!0:(s.type===z.Roof&&(Tn.getState().deleteRoofSegmentVertices(s.id),Tn.getState().deleteRoofSegmentVerticesWithoutOverhang(s.id)),!1)):l.elements=l.elements.filter(s=>s.locked||s.type!==a?!0:(s.type===z.Roof&&(Tn.getState().deleteRoofSegmentVertices(s.id),Tn.getState().deleteRoofSegmentVerticesWithoutOverhang(s.id)),!1))})},countElementsByType(a,l){let s=0;if(l)for(const c of e().elements)c.type===a&&!c.locked&&s++;else for(const c of e().elements)c.type===a&&s++;return s},countSolarStructuresByType(a,l){let s=0;if(l)for(const c of e().elements)c.type===z.Foundation&&!c.locked&&c.solarStructure===a&&s++;else for(const c of e().elements)c.type===z.Foundation&&c.solarStructure===a&&s++;return s},countObservers(){let a=0;for(const l of e().elements)l.type===z.Human&&l.observer&&a++;return a},removeElementsByReferenceId(a,l){i(s=>{if(l){s.deletedElements=[];for(const c of s.elements)c.referenceId===a&&s.deletedElements.push(c)}s.elements=s.elements.filter(c=>c.referenceId!==a)})},countElementsByReferenceId(a){let l=0;for(const s of e().elements)s.referenceId===a&&l++;return l},getChildren(a){const l=[];for(const s of e().elements)s.parentId===a&&l.push(s);return l},getChildrenOfType(a,l){const s=[];for(const c of e().elements)c.type===a&&c.parentId===l&&s.push(c);return s},removeAllChildElementsByType(a,l){i(s=>{s.elements=s.elements.filter(c=>c.locked||c.type!==l||c.parentId!==a),l===z.Wall&&(s.updateWallMapOnFoundationFlag=!s.updateWallMapOnFoundationFlag)})},removeAllElementsOnFoundationByType(a,l){i(s=>{s.elements=s.elements.filter(c=>c.locked||c.type!==l||c.foundationId!==a),l===z.Wall&&(s.updateWallMapOnFoundationFlag=!s.updateWallMapOnFoundationFlag)})},countAllElements(a){let l=0;if(a)for(const s of e().elements)s.locked||l++;else l=e().elements.length;return l},countAllElementsByType(a){const l=new JSe;for(const s of e().elements)if(s.locked?l.lockedCount++:l.unlockedCount++,!(a&&s.locked))switch(s.type){case z.Foundation:{s.solarStructure===Dn.UpdraftTower&&l.solarUpdraftTowerCount++,l.foundationCount++;break}case z.Cuboid:{l.cuboidCount++;break}case z.Wall:{l.wallCount++;break}case z.Window:{l.windowCount++;break}case z.Door:{l.doorCount++;break}case z.Human:{l.humanCount++;break}case z.Tree:{l.treeCount++;break}case z.Flower:{l.flowerCount++;break}case z.Polygon:{l.polygonCount++;break}case z.Sensor:{l.sensorCount++;break}case z.Light:{s.inside?l.insideLightCount++:l.outsideLightCount++;break}case z.SolarPanel:{l.solarPanelCount++;const c=s,u=e().getPvModule(c.pvModelName);u&&(l.solarPanelModuleCount+=me.countSolarPanelsOnRack(c,u));break}case z.ParabolicDish:{l.parabolicDishCount++;break}case z.ParabolicTrough:{l.parabolicTroughCount++;break}case z.FresnelReflector:{l.fresnelReflectorCount++;break}case z.Heliostat:{l.heliostatCount++;break}case z.WindTurbine:{l.windTurbineCount++;break}}return l},countAllOffspringsByTypeAtOnce(a,l){const s=new JSe;for(const c of e().elements){const u=c.parentId===a||c.foundationId===a;if(u&&(c.locked?s.lockedCount++:s.unlockedCount++),(l||!c.locked)&&u)switch(c.type){case z.Foundation:{c.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTowerCount++,s.foundationCount++;break}case z.Cuboid:{s.cuboidCount++;break}case z.Wall:{s.wallCount++;break}case z.Window:{s.windowCount++,c.locked&&s.lockedWindowCount++;break}case z.Door:{s.doorCount++,c.locked&&s.lockedDoorCount++;break}case z.Human:{s.humanCount++;break}case z.Tree:{s.treeCount++;break}case z.Flower:{s.flowerCount++;break}case z.Polygon:{s.polygonCount++,c.locked&&s.lockedPolygonCount++;break}case z.Sensor:{s.sensorCount++,c.locked&&s.lockedSensorCount++;break}case z.Light:{c.inside?s.insideLightCount++:s.outsideLightCount++,c.locked&&s.lockedLightCount++;break}case z.SolarPanel:{s.solarPanelCount++,c.locked&&s.lockedSolarPanelCount++;const d=c,f=e().getPvModule(d.pvModelName);f&&(s.solarPanelModuleCount+=me.countSolarPanelsOnRack(d,f));break}case z.ParabolicDish:{s.parabolicDishCount++;break}case z.ParabolicTrough:{s.parabolicTroughCount++;break}case z.FresnelReflector:{s.fresnelReflectorCount++;break}case z.Heliostat:{s.heliostatCount++;break}case z.WindTurbine:{s.windTurbineCount++,c.locked&&s.lockedWindTurbineCount++;break}}}return s},countSolarPanelsOnRack(a){let l=0;for(const s of e().elements)if(s.id===a&&s.type===z.SolarPanel){const c=s,u=e().getPvModule(c.pvModelName);if(u){l=me.countSolarPanelsOnRack(c,u);break}}return l},copyCutElements(){const a=[],l=new Map,s=new Map,c=new Map;for(let u=0;ug.id===d.parentId);if(p){const g=l.get(p.id);g&&(e().getElementById(d.id)?(f=Yl.clone(g,d,d.cx,d.cy,d.cz,d.type===z.Polygon),(f==null?void 0:f.type)===z.SolarPanel&&(f.rotation=[...d.rotation],f.normal=[...d.normal])):f=JSON.parse(JSON.stringify(d)))}}f&&(l.set(d.id,f),s.set(d.id,f.id),c.set(f.id,d.id),a.push(f))}for(const u of a){if(u.type===z.Roof){const d=c.get(u.id);if(d)for(const f of e().elementsToPaste)f.id===d&&(u.wallsId=f.wallsId.map(p=>s.get(p)))}if(u.type===z.Wall){const d=c.get(u.id);if(d){for(const f of e().elementsToPaste)if(f.id===d&&f.type===z.Wall){const p=f,g=s.get(p.leftJoints[0]);g&&(u.leftJoints=[g]);const y=s.get(p.rightJoints[0]);if(y&&(u.rightJoints=[y]),p.roofId){const w=s.get(p.roofId);w&&(u.roofId=w)}break}}}}return a},pasteElementsToPoint(){const a=[];return i(l=>{if(l.elementsToPaste.length===1){let s=l.pastePoint;const c=l.elementsToPaste[0];let u=l.selectedElement;const d=l.getParent(c);if(u){if(u.type===z.Polygon){const p=l.getParent(u);p&&(u=p,c.parentId=u.id,me.isPositionRelative(c.type)&&(s=me.relativeCoordinates(s.x,s.y,s.z,u)))}else if(u.type===z.Roof){if(u.parentId){const p=l.getElementById(u.parentId);p&&(c.type===z.SolarPanel?s.sub(new ie(p.cx,p.cy,p.cz)).applyEuler(new nn(0,0,-p.rotation[2])):(s.sub(new ie(p.cx,p.cy,p.lz)).applyEuler(new nn(0,0,-p.rotation[2])),c.type!==z.Window&&(s.setX(s.x/p.lx),s.setY(s.y/p.ly))))}}else if(u.type===z.Cuboid){if(c.type===z.Cuboid){const{pos:p}=me.getWorldDataById(u.id);s.sub(p)}else me.isPositionRelative(c.type)&&(c.type===z.SolarPanel?s=me.relativeCoordinates(s.x,s.y,s.z,u,!0):s=me.relativeCoordinates(s.x,s.y,s.z,u));c.parentId=u.id}else u.type===z.Wall?s=me.relativeCoordinates(s.x,s.y,s.z,u):d&&d.type&&c.type!==z.Foundation&&(c.parentId=u.id,me.isPositionRelative(c.type)&&(c.type===z.SolarPanel?s=me.relativeCoordinates(s.x,s.y,s.z,u,!0):s=me.relativeCoordinates(s.x,s.y,s.z,u)));c.type===z.Wall&&s.set(s.x*u.lx,s.y*u.ly,0)}const f=Yl.clone(u,c,s.x,s.y,s.z,!1,l.pasteNormal,d);if(f){l.pasteNormal&&(u==null?void 0:u.type)===z.Cuboid&&(f.normal=l.pasteNormal.toArray(),f.rotation=Cn.getRotationFromNormal(l.pasteNormal));const p={lng:l.language};let g=!1;switch(f.type){case z.Cuboid:{const y=C=>{const P=[];for(const v of e().elements)if(v.parentId===C.id)switch(P.push(v),v.type){case z.Cuboid:case z.Foundation:case z.Wall:case z.Roof:P.push(...y(v))}return P},w=y(c),b=new Map;a.push(f),b.set(c.id,f);for(const C of w){const P=b.get(C.parentId);if(P){const v=Yl.clone(P,C,C.cx,C.cy,C.cz,C.type===z.Polygon);v&&(f.normal&&(v.normal=[...C.normal]),a.push(v),b.set(C.id,v))}}l.elements.push(...a),l.elementsToPaste=[f],g=!1;break}case z.Foundation:{const y=new Map,w=new Map;for(const b of l.elements)if(b.parentId===c.id){const C=Yl.clone(f,b,b.cx,b.cy,b.cz,b.type===z.Polygon);if(C&&(f.normal&&(C.normal=[...b.normal]),a.push(C),(C==null?void 0:C.type)===z.Wall||(C==null?void 0:C.type)===z.Roof)){y.set(C.id,b.id),w.set(b.id,C.id);for(const P of l.elements)if(P.parentId===b.id){const v=Yl.clone(C,P,P.cx,P.cy,P.cz);v&&(b.normal&&(v.normal=[...P.normal]),a.push(v))}}}l.elements.push(...a),g=!0;for(const b of l.elements){if(b.type===z.Roof){const C=y.get(b.id);if(C){const P=e().getElementById(C);P&&(b.wallsId=P.wallsId.map(v=>w.get(v)))}}if(b.type===z.Wall){const C=y.get(b.id);if(C){for(const P of l.elements)if(P.id===C&&P.type===z.Wall){const v=P,T=w.get(v.leftJoints[0]);T&&(b.leftJoints=[T]);const A=w.get(v.rightJoints[0]);if(A&&(b.rightJoints=[A]),v.roofId){const x=w.get(v.roofId);x&&(b.roofId=x)}break}}}}break}case z.SolarPanel:{if((u==null?void 0:u.type)===z.Wall){if(u)switch(me.checkElementOnWallState(f,u)){case ma.Valid:{const y=u.relativeAngle-Gt;f.normal=[Math.cos(y),Math.sin(y),0],g=!0;break}case ma.OverLap:po(Y.t("message.CannotPasteBecauseOfOverlap",p));break;case ma.OutsideBoundary:po(Y.t("message.CannotPasteOutsideBoundary",p));break}break}if(u&&u.type===z.Roof){if(f.foundationId){const y=l.getElementById(f.foundationId);if(y){const w=Cn.getSolarPanelVerticesOnRoof(f,y),b=Cn.getRoofBoundaryVertices(u);if(!Cn.rooftopElementBoundaryCheck(w,b)){po(Y.t("message.CannotPasteOutsideBoundary",p));break}if(!Cn.rooftopSPCollisionCheck(f,y,w)){po(Y.t("message.CannotPasteBecauseOfOverlap",p));break}g=!0,l.updateElementOnRoofFlag=!0}}break}l.overlapWithSibling(f)?po(Y.t("message.CannotPasteBecauseOfOverlap",p)):u&&(u.type===z.Foundation||u.type===z.Cuboid&&me.isIdentical(f.normal,rs))&&me.isSolarCollector(f)?(g=me.isSolarCollectorWithinHorizontalSurface(f,u),g||po(Y.t("message.CannotPasteOutsideBoundary",p))):g=!0;break}case z.Sensor:case z.Light:case z.WindTurbine:case z.ParabolicDish:case z.Heliostat:case z.FresnelReflector:case z.ParabolicTrough:{if((u==null?void 0:u.type)===z.Wall){if(u)switch(me.checkElementOnWallState(f,u)){case ma.Valid:{const y=u.relativeAngle-Gt;f.normal=[Math.cos(y),Math.sin(y),0],g=!0;break}case ma.OverLap:po(Y.t("message.CannotPasteBecauseOfOverlap",p));break;case ma.OutsideBoundary:po(Y.t("message.CannotPasteOutsideBoundary",p));break}break}if(u&&u.type===z.Roof){if(f.foundationId){const y=l.getElementById(f.foundationId);if(y){const w=Cn.getSolarPanelVerticesOnRoof(f,y),b=Cn.getRoofBoundaryVertices(u);if(!Cn.rooftopElementBoundaryCheck(w,b)){po(Y.t("message.CannotPasteOutsideBoundary",p));break}if(!Cn.rooftopSPCollisionCheck(f,y,w)){po(Y.t("message.CannotPasteBecauseOfOverlap",p));break}g=!0,l.updateElementOnRoofFlag=!0}}break}l.overlapWithSibling(f)?po(Y.t("message.CannotPasteBecauseOfOverlap",p)):u&&(u.type===z.Foundation||u.type===z.Cuboid&&me.isIdentical(f.normal,rs))&&me.isSolarCollector(f)?(g=me.isSolarCollectorWithinHorizontalSurface(f,u),g||po(Y.t("message.CannotPasteOutsideBoundary",p))):g=!0;break}case z.Wall:{const y=new ie(f.cx,f.cy,0),w=new ie(f.lx/2,0,0),b=new ie(-f.lx/2,0,0),C=f,P=new nn(0,0,C.relativeAngle);C.leftPoint=y.clone().add(b.applyEuler(P)).toArray(),C.rightPoint=y.clone().add(w.applyEuler(P)).toArray(),C.roofId=void 0,C.leftRoofHeight=void 0,C.rightRoofHeight=void 0,C.centerLeftRoofHeight=void 0,C.centerRightRoofHeight=void 0,C.centerRoofHeight=void 0;for(const v of l.elements)if(v.parentId===c.id){const T=Yl.clone(f,v,v.cx,v.cy,v.cz,v.type===z.Polygon);T&&(f.normal&&(T.normal=[...v.normal]),a.push(T))}l.elements.push(...a),l.updateWallMapOnFoundationFlag=!l.updateWallMapOnFoundationFlag,g=!0;break}case z.Door:case z.Window:{if((u==null?void 0:u.type)===z.Wall)switch(me.checkElementOnWallState(f,u)){case ma.Valid:g=!0;break;case ma.OverLap:po(Y.t("message.CannotPasteBecauseOfOverlap",p));break;case ma.OutsideBoundary:po(Y.t("message.CannotPasteOutsideBoundary",p));break}else if((u==null?void 0:u.type)===z.Roof){const y=Cn.getRotationOnRoof(u.id,s);y&&(f.rotation=[...y]);const w=Cn.getWindowVerticesOnRoof(f),b=Cn.getRoofSegmentBoundary(u.id,s);if(!b)break;if(!Cn.rooftopElementBoundaryCheck(w,b)){po(Y.t("message.CannotPasteOutsideBoundary",p));break}if(!Cn.rooftopWindowCollisionCheck(f.id,w,u.id)){po(Y.t("message.CannotPasteBecauseOfOverlap",p));break}g=!0}break}default:if(g=!0,me.isPlantOrHuman(f))if(u){const y=l.getParent(f);if(y){const w=me.relativePoint(l.pastePoint,y);f.cx=w.x,f.cy=w.y,f.cz=w.z}}else f.parentId=Zo}g&&(l.elements.push(f),a.push(f))}}else if(l.elementsToPaste.length>1){let s=l.pastePoint;const c=l.copyCutElements();if(c.length>0){if(c[0].type===z.Cuboid){const u=l.selectedElement;if(u&&u.type===z.Cuboid){const{pos:d}=me.getWorldDataById(u.id);s.sub(d),c[0].parentId=u.id}}else if(c[0].type===z.Wall){const u=l.selectedElement;u&&u.type===z.Foundation&&(s=me.relativeCoordinates(s.x,s.y,s.z,u),s.set(s.x*u.lx,s.y*u.ly,0),c[0].parentId=u.id,c[0].foundationId=u.id)}c[0].cx=s.x,c[0].cy=s.y,c[0].cz=s.z,c[0].type===z.Foundation?c[0].cz+=c[0].lz/2:c[0].type===z.Cuboid&&(c[0].cz=c[0].lz/2),l.elements.push(...c),a.push(...c)}}a.length>0&&(l.selectedElementIdSet.clear(),l.selectedElementIdSet.add(a[0].id),l.selectedElement=a[0])}),a},pasteElementsByKey(){const a=[];return i(l=>{if(l.elementsToPaste.length>0){const s=l.elementsToPaste[0],c=l.getParent(s),u=Yl.clone(c,s,s.cx,s.cy,s.cz);if(u){let d=!1;switch(u.type){case z.Door:case z.Window:{if(c){const f=u.lx/2;if(u.cx+=f*3,c.type===z.Wall)for(;u.cx+f<.5;)if(me.checkElementOnWallState(u,c)===ma.Valid){l.elements.push(u),d=!0;break}else u.cx+=f;else if(c.type===z.Roof){const p=Cn.getRotationOnRoof(c.id,new ie(u.cx,u.cy));p&&(u.rotation=[...p]);let g=Cn.getWindowVerticesOnRoof(u),y=Cn.getRoofSegmentBoundary(c.id,new ie(u.cx,u.cy));const w=Cn.getRoofBoundaryVertices(c);for(;Cn.rooftopElementBoundaryCheck(g,w);)if(y&&Cn.rooftopElementBoundaryCheck(g,y)&&Cn.rooftopWindowCollisionCheck(u.id,g,c.id)){l.elements.push(u),d=!0;break}else{u.cx+=f/2;const b=Cn.getRotationOnRoof(c.id,new ie(u.cx,u.cy));b&&(u.rotation=[...b]),g=Cn.getWindowVerticesOnRoof(u),y=Cn.getRoofSegmentBoundary(c.id,new ie(u.cx,u.cy))}}if(!d){u.cx=s.cx-f*3;const p=Cn.getRotationOnRoof(c.id,new ie(u.cx,u.cy));if(p&&(u.rotation=[...p]),c.type===z.Wall){for(;u.cx-f>-.5;)if(c.type===z.Wall)if(me.checkElementOnWallState(u,c)===ma.Valid){l.elements.push(u),d=!0;break}else u.cx-=f}else if(c.type===z.Roof){let g=Cn.getWindowVerticesOnRoof(u),y=Cn.getRoofSegmentBoundary(c.id,new ie(u.cx,u.cy));const w=Cn.getRoofBoundaryVertices(c);for(;Cn.rooftopElementBoundaryCheck(g,w);)if(y&&Cn.rooftopElementBoundaryCheck(g,y)&&Cn.rooftopWindowCollisionCheck(u.id,g,c.id)){l.elements.push(u),d=!0;break}else{u.cx-=f;const b=Cn.getRotationOnRoof(c.id,new ie(u.cx,u.cy));b&&(u.rotation=[...b]),g=Cn.getWindowVerticesOnRoof(u),y=Cn.getRoofSegmentBoundary(c.id,new ie(u.cx,u.cy))}}}if(!d){const p={lng:l.language};po(Y.t("message.CannotPasteOutsideBoundary",p))}c.type===z.Roof&&d&&(l.updateElementOnRoofFlag=!0)}break}case z.Human:{u.cx+=1,l.elements.push(u),l.elementsToPaste=[u],d=!0;break}case z.Tree:case z.Flower:{u.cx+=u.lx,l.elements.push(u),l.elementsToPaste=[u],d=!0;break}case z.SolarPanel:{if(u.parentId){const f=l.getParent(u);if(f){if(f.type===z.Wall){const y=u.lx/f.lx/2;for(u.cx+=y*3;u.cx+y<.5;)if(me.checkElementOnWallState(u,f)===ma.Valid){l.elements.push(u),d=!0;break}else u.cx+=y;if(!d)for(u.cx=s.cx-y*3;u.cx-y>-.5;)if(me.checkElementOnWallState(u,f)===ma.Valid){l.elements.push(u),l.elementsToPaste=[u],d=!0;break}else u.cx-=y;if(!d){const w={lng:l.language};po(Y.t("message.CannotPasteOutsideBoundary",w))}break}else if(f.type===z.Roof){if(s.foundationId){const y=l.getElementById(s.foundationId);if(y){const w=Cn.getRoofBoundaryVertices(f),b=u.lx*1.25;for(u.cx+=b;u.cx+u.lx/2-y.lx/2;){const C=Cn.getSolarPanelVerticesOnRoof(u,y);if(Cn.rooftopElementBoundaryCheck(C,w)&&Cn.rooftopSPCollisionCheck(u,y,C)){l.elements.push(u),d=!0;break}else u.cx-=b}if(d)l.updateElementOnRoofFlag=!0;else{const C={lng:l.language};po(Y.t("message.CannotPasteOutsideBoundary",C))}}}break}else f.type===z.Cuboid&&(u.normal=[...s.normal],u.rotation=[...s.rotation]);const p=l.findNearestSibling(s.id);if(p){const y=l.getElementById(p);if(y){const w=u.cx,b=u.cy,C=u.cz,P=y.cx-s.cx,v=y.cy-s.cy,T=y.cz-s.cz;u.cx=y.cx+P,u.cy=y.cy+v,u.cz=y.cz+T,l.overlapWithSibling(u)&&(u.cx=s.cx-P,u.cy=s.cy-v,u.cz=s.cz-T,l.overlapWithSibling(u)&&(u.cx=s.cx-2*P,u.cy=s.cy-2*v,u.cz=s.cz-2*T,l.overlapWithSibling(u)&&(u.cx=w-P,u.cy=b-v,u.cz=C-T)))}else u.cx+=1.25*u.lx}else u.cx+=1.25*u.lx;const g={lng:l.language};l.overlapWithSibling(u)?po(Y.t("message.CannotPasteBecauseOfOverlap",g)):f.type===z.Foundation||f.type===z.Cuboid&&me.isIdentical(u.normal,rs)?me.isSolarCollectorWithinHorizontalSurface(u,f)?(l.elements.push(u),l.elementsToPaste=[u],d=!0):po(Y.t("message.CannotPasteOutsideBoundary",g)):(l.elements.push(u),l.elementsToPaste=[u],d=!0)}}break}case z.FresnelReflector:case z.Heliostat:case z.ParabolicDish:case z.ParabolicTrough:{if(u.parentId){const f=l.getParent(u);if(f){if(f.type===z.Wall){const y=u.lx/f.lx/2;for(u.cx+=y*3;u.cx+y<.5;)if(me.checkElementOnWallState(u,f)===ma.Valid){l.elements.push(u),d=!0;break}else u.cx+=y;if(!d)for(u.cx=s.cx-y*3;u.cx-y>-.5;)if(me.checkElementOnWallState(u,f)===ma.Valid){l.elements.push(u),l.elementsToPaste=[u],d=!0;break}else u.cx-=y;if(!d){const w={lng:l.language};po(Y.t("message.CannotPasteOutsideBoundary",w))}break}else if(f.type===z.Roof){if(s.foundationId){const y=l.getElementById(s.foundationId);if(y){const w=Cn.getRoofBoundaryVertices(f),b=u.lx/y.lx/2;for(u.cx+=b*1.25;u.cx+b<.5;){const C=Cn.getSolarPanelVerticesOnRoof(u,y);if(Cn.rooftopElementBoundaryCheck(C,w)&&Cn.rooftopSPCollisionCheck(u,y,C)){l.elements.push(u),d=!0;break}else u.cx+=b*1.25}if(!d)for(u.cx=s.cx-b*1.25;u.cx-b>-.5;){const C=Cn.getSolarPanelVerticesOnRoof(u,y);if(Cn.rooftopElementBoundaryCheck(C,w)&&Cn.rooftopSPCollisionCheck(u,y,C)){l.elements.push(u),d=!0;break}else u.cx-=b*1.25}if(d)l.updateElementOnRoofFlag=!0;else{const C={lng:l.language};po(Y.t("message.CannotPasteOutsideBoundary",C))}}}break}const p=l.findNearestSibling(s.id);if(p){const y=l.getElementById(p);if(y){const w=u.cx,b=u.cy,C=u.cz,P=y.cx-s.cx,v=y.cy-s.cy,T=y.cz-s.cz;u.cx=y.cx+P,u.cy=y.cy+v,u.cz=y.cz+T,l.overlapWithSibling(u)&&(u.cx=s.cx-P,u.cy=s.cy-v,u.cz=s.cz-T,l.overlapWithSibling(u)&&(u.cx=s.cx-2*P,u.cy=s.cy-2*v,u.cz=s.cz-2*T,l.overlapWithSibling(u)&&(u.cx=w-P,u.cy=b-v,u.cz=C-T)))}else u.cx+=(.01+u.lx)/f.lx}else u.cx+=(.01+u.lx)/f.lx;const g={lng:l.language};l.overlapWithSibling(u)?po(Y.t("message.CannotPasteBecauseOfOverlap",g)):f.type===z.Foundation||f.type===z.Cuboid&&me.isIdentical(u.normal,rs)?me.isSolarCollectorWithinHorizontalSurface(u,f)?(l.elements.push(u),l.elementsToPaste=[u],d=!0):po(Y.t("message.CannotPasteOutsideBoundary",g)):(l.elements.push(u),l.elementsToPaste=[u],d=!0)}}break}case z.Sensor:case z.Light:case z.WindTurbine:{if(u.parentId){const f=l.getParent(u);f&&(u.cx+=u.lx/f.lx),u.cx<.5&&(l.elements.push(u),l.elementsToPaste=[u],d=!0)}break}case z.Polygon:{const f=u;for(const p of f.vertices)p.x+=.1;f.cx+=.1,l.elements.push(f),l.elementsToPaste=[f],d=!0;break}case z.Cuboid:{if(u.cx+=u.lx,l.elementsToPaste.length===1){const f=y=>{const w=[];for(const b of e().elements)if(b.parentId===y.id)switch(w.push(b),b.type){case z.Cuboid:case z.Foundation:case z.Wall:case z.Roof:w.push(...f(b))}return w},p=f(s),g=new Map;a.push(u),g.set(s.id,u);for(const y of p){const w=g.get(y.parentId);if(w){const b=Yl.clone(w,y,y.cx,y.cy,y.cz,y.type===z.Polygon);b&&(u.normal&&(b.normal=[...y.normal]),a.push(b),g.set(y.id,b))}}l.elements.push(...a),l.elementsToPaste=[u],l.selectedElementIdSet.clear(),l.selectedElementIdSet.add(u.id),l.selectedElement=u}else if(l.elementsToPaste.length>1){const f=l.copyCutElements();f.length>0&&(f[0].cx+=f[0].lx,l.elements.push(...f),l.elementsToPaste=[...f],a.push(...f),l.selectedElementIdSet.clear(),l.selectedElementIdSet.add(f[0].id),l.selectedElement=f[0])}d=!1;break}case z.Foundation:{if(u.cx+=u.lx,l.elementsToPaste.length===1){const f=new Map,p=new Map;for(const g of l.elements)if(g.parentId===s.id&&g.parentId!==g.id){const y=Yl.clone(u,g,g.cx,g.cy,g.cz,g.type===z.Polygon);if(y&&(u.normal&&(y.normal=[...g.normal]),a.push(y),(y==null?void 0:y.type)===z.Wall||(y==null?void 0:y.type)===z.Roof)){f.set(y.id,g.id),p.set(g.id,y.id);for(const w of l.elements)if(w.parentId===g.id){const b=Yl.clone(y,w,w.cx,w.cy,w.cz);b&&(g.normal&&(b.normal=[...w.normal]),a.push(b))}}}l.elements.push(...a),l.elements.push(u),l.elementsToPaste=[u];for(const g of l.elements){if(g.type===z.Roof){const y=f.get(g.id);if(y){const w=e().getElementById(y);w&&(g.wallsId=w.wallsId.map(b=>p.get(b)))}}if(g.type===z.Wall){const y=f.get(g.id);if(y){for(const w of l.elements)if(w.id===y&&w.type===z.Wall){const b=w,C=p.get(b.leftJoints[0]);C&&(g.leftJoints=[C]);const P=p.get(b.rightJoints[0]);if(P&&(g.rightJoints=[P]),b.roofId){const v=p.get(b.roofId);v&&(g.roofId=v)}break}}}}}else if(l.elementsToPaste.length>1){const f=l.copyCutElements();f.length>0&&(f[0].cx+=f[0].lx,l.elements.push(...f),a.push(...f),l.elementsToPaste=f,l.selectedElementIdSet.clear(),l.selectedElementIdSet.add(f[0].id),l.selectedElement=f[0])}d=!0;break}case z.Wall:{const f=u,p=new ie(1,-1,0).applyEuler(new nn(0,0,f.relativeAngle));if(u.cx+=p.x,u.cy+=p.y,l.elementsToPaste.length===1){const g=new ie(u.cx,u.cy,0),y=new ie(u.lx/2,0,0),w=new ie(-u.lx/2,0,0),b=new nn(0,0,f.relativeAngle);f.leftPoint=g.clone().add(w.applyEuler(b)).toArray(),f.rightPoint=g.clone().add(y.applyEuler(b)).toArray(),f.roofId=void 0,f.leftRoofHeight=void 0,f.rightRoofHeight=void 0,f.centerLeftRoofHeight=void 0,f.centerRightRoofHeight=void 0,f.centerRoofHeight=void 0;for(const C of l.elements)if(C.parentId===s.id){const P=Yl.clone(u,C,C.cx,C.cy,C.cz,C.type===z.Polygon);P&&(u.normal&&(P.normal=[...C.normal]),a.push(P))}l.elements.push(...a),l.elements.push(u),l.elementsToPaste=[u]}else if(l.elementsToPaste.length>1){const g=l.copyCutElements();g.length>0&&(g[0].cx+=p.x,g[0].cy-=p.y,l.elements.push(...g),a.push(...g),l.elementsToPaste=g,l.selectedElementIdSet.clear(),l.selectedElementIdSet.add(g[0].id),l.selectedElement=g[0])}l.updateWallMapOnFoundationFlag=!l.updateWallMapOnFoundationFlag,d=!0;break}}l.elementsToPaste.length===1&&d&&(a.push(u),l.selectedElementIdSet.clear(),l.selectedElementIdSet.add(u.id),l.selectedElement=u)}}}),a},pvModules:{},loadPvModules(){const a=[];uB.parse(Ipt,{download:!0,complete:function(l){for(const s of l.data)if(Array.isArray(s)&&s.length>1){const c={name:s[0].trim(),brand:s[1].trim(),cellType:s[2].trim(),efficiency:parseFloat(s[3].trim()),length:parseFloat(s[4].trim()),nominalLength:parseFloat(s[5].trim()),width:parseFloat(s[6].trim()),nominalWidth:parseFloat(s[7].trim()),thickness:parseFloat(s[8].trim()),m:parseFloat(s[9].trim()),n:parseFloat(s[10].trim()),pmax:parseFloat(s[11].trim()),vmpp:parseFloat(s[12].trim()),impp:parseFloat(s[13].trim()),voc:parseFloat(s[14].trim()),isc:parseFloat(s[15].trim()),pmaxTC:parseFloat(s[16].trim()),noct:parseFloat(s[17].trim()),weight:parseFloat(s[18].trim()),color:s[19].trim(),shadeTolerance:s[20].trim(),bifacialityFactor:parseFloat(s[21].trim())};a.push(c)}i(s=>{for(const c of a)s.pvModules[c.name]=c})}})},getPvModule(a){return e().pvModules[a]},weatherModel:void 0,setWeatherModel(a){i(l=>{l.weatherModel=l.weatherData[a]})},weatherData:{},loadWeatherData(){if(Object.keys(e().weatherData).length>0)return;const a=[];uB.parse(Rpt,{download:!0,complete:function(l){for(const s of l.data)if(Array.isArray(s)&&s.length>1){const c=[],u=[],d=[];for(let p=5;p<29;p++)(p-5)%2===0?c.push(parseFloat(s[p].trim())):u.push(parseFloat(s[p].trim()));for(let p=29;p<41;p++)d.push(parseFloat(s[p].trim()));const f={city:s[0].trim(),country:s[1].trim(),longitude:parseFloat(s[2].trim()),latitude:parseFloat(s[3].trim()),elevation:parseFloat(s[4].trim()),lowestTemperatures:c,highestTemperatures:u,sunshineHours:d};a.push(f)}i(s=>{for(const c of a)s.weatherData[c.city+", "+c.country]=c;s.weatherModel=s.weatherData["Boston MA, USA"]}),console.log(a.length+" weather datasets loaded")}})},getWeather(a){const l=e().weatherModel;return l||e().weatherData[a]},horizontalSolarRadiationData:{},loadHorizontalSolarRadiationData(){const a=[];uB.parse(Hpt,{download:!0,complete:function(l){for(const s of l.data)if(Array.isArray(s)&&s.length>1){const c=[];for(let d=2;d<14;d++)c.push(parseFloat(s[d].trim()));const u={city:s[0].trim(),country:s[1].trim(),data:c};a.push(u)}i(s=>{for(const c of a)s.horizontalSolarRadiationData[c.city+", "+c.country]=c})}})},getHorizontalSolarRadiation(a){return e().horizontalSolarRadiationData[a]},verticalSolarRadiationData:{},loadVerticalSolarRadiationData(){const a=[];uB.parse(Mpt,{download:!0,complete:function(l){for(const s of l.data)if(Array.isArray(s)&&s.length>1){const c=[];for(let d=2;d<14;d++)c.push(parseFloat(s[d].trim()));const u={city:s[0].trim(),country:s[1].trim(),data:c};a.push(u)}i(s=>{for(const c of a)s.verticalSolarRadiationData[c.city+", "+c.country]=c})}})},getVerticalSolarRadiation(a){return e().verticalSolarRadiationData[a]},getClosestCity(a,l){let s=Number.MAX_VALUE,c=null,u;const d=e().weatherData;for(const f in d)Object.hasOwn(d,f)&&(u=me.getDistance(l,a,d[f].longitude,d[f].latitude),u{l.sunlightDirection=a.clone()})},cameraDirection:new ie,getCameraDirection(){return e().cameraDirection},updateSceneRadiusFlag:!1,updateSceneRadius(){i(a=>{a.updateSceneRadiusFlag=!a.updateSceneRadiusFlag})},sceneRadius:100,setSceneRadius(a){i(l=>{l.sceneRadius=a})},selectedElementAngle:0,selectedElementHeight:0,selectedElementX:0,selectedElementY:0,isAddingElement(){return!!(e().addedCuboidId||e().addedFoundationId||e().addedWallId||e().addedWindowId||e().addedDoorId)},addedFoundationId:null,deletedFoundationId:null,addedCuboidId:null,deletedCuboidId:null,addedWallId:null,deletedWallId:null,updateWallMapOnFoundationFlag:!1,updateWallMapOnFoundation(){i(a=>{a.updateWallMapOnFoundationFlag=!a.updateWallMapOnFoundationFlag})},updateElementOnRoofFlag:!1,setUpdateElementOnRoofFlag(a){i(l=>{l.updateElementOnRoofFlag=a})},updateElementOnRoofFn(){i(a=>{a.updateElementOnRoofFlag=!0})},addedWindowId:null,addedDoorId:null,addedRoofIdSet:new Set,deletedRoofId:null,deletedRoofIdSet:new Set,autoDeletedRoofs:null,autoDeletedRoofIdSet:new Set,autoDeletedChild:null,getAutoDeletedElements(){const a=e().autoDeletedRoofs,l=e().autoDeletedChild;return!a||!l?null:[...a,...l]},deleteAddedRoofId(a){i(l=>{l.addedRoofIdSet.delete(a)})},groupActionMode:!1,setGroupActionMode(a){i(l=>{l.groupActionMode=a})},groupActionUpdateFlag:!1,locale:p1e,localFileDialogRequested:!1,loggable:!1,actionInfo:void 0,currentUndoable:void 0,showCloudFileTitleDialog:!1,showCloudFileTitleDialogFlag:!1,localContentToImportAfterCloudFileUpdate:void 0,enableFineGrid:!1,setEnableFineGrid(a){i(l=>{l.enableFineGrid=a})}}},{name:"aladdin-storage",storage:QUe(()=>new URLSearchParams(window.location.search).get("viewonly")==="true"?sessionStorage:localStorage),skipHydration:me.isOpenFromURL(),partialize:t=>({language:t.language,animate24Hours:t.animate24Hours,floatingWindowOpacity:t.floatingWindowOpacity,selectedFloatingWindow:t.selectedFloatingWindow,locale:t.locale,cloudFile:t.cloudFile,latestModelSite:t.latestModelSite,modelSites:t.modelSites,modelsMapLatitude:t.modelsMapLatitude,modelsMapLongitude:t.modelsMapLongitude,modelsMapAddress:t.modelsMapAddress,modelsMapZoom:t.modelsMapZoom,modelsMapType:t.modelsMapType,modelsMapTilt:t.modelsMapTilt,world:t.world,elements:t.elements,viewState:t.viewState,graphState:t.graphState,actionState:t.actionState,modelType:t.modelType,modelAuthor:t.modelAuthor,modelLabel:t.modelLabel,modelDescription:t.modelDescription,projectView:t.projectView,projectState:t.projectState,designProjectType:t.designProjectType,notes:t.notes,user:t.user,sceneRadius:t.sceneRadius,weatherModel:t.weatherModel,solarPanelArrayLayoutParams:t.solarPanelArrayLayoutParams,solarPanelArrayLayoutConstraints:t.solarPanelArrayLayoutConstraints,economicsParams:t.economicsParams,evolutionMethod:t.evolutionMethod,evolutionaryAlgorithmState:t.evolutionaryAlgorithmState,geneticAlgorithmWizardSelectedTab:t.geneticAlgorithmWizardSelectedTab,particleSwarmOptimizationWizardSelectedTab:t.particleSwarmOptimizationWizardSelectedTab,minimumNavigationMoveSpeed:t.minimumNavigationMoveSpeed,minimumNavigationTurnSpeed:t.minimumNavigationTurnSpeed})})));class Nen extends be.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,n){}clearCacheAndReload(){localStorage.clear(),window.location.reload()}render(){return this.state.hasError?h.jsxs("div",{style:{marginTop:10,marginLeft:20},children:[h.jsx("h1",{children:"Error"}),h.jsx("p",{children:"Something went wrong. Please click the following button to clear the cache and reload the page."}),h.jsx("p",{children:h.jsx("button",{onClick:this.clearCacheAndReload,children:"Refresh"})})]}):this.props.children}}const Uen=t=>{const e=typeof t=="function",n=m.useRef(t);m.useEffect(()=>{n.current=t}),m.useEffect(()=>{if(e){const o=r=>{const i=n.current(r);if(typeof i=="string")return r.preventDefault(),r.returnValue=i;if(r.defaultPrevented)return r.returnValue=""};return window.addEventListener("beforeunload",o),()=>{window.removeEventListener("beforeunload",o)}}},[e])},jen=({children:t=null,onBeforeunload:e})=>(Uen(e),t),Ben="/aladdin/assets/daysky-xGPh_lTa.jpg",Yen="/aladdin/assets/desert-C1g8PGRA.jpg",Oen="/aladdin/assets/dune-BTLjQ9Lc.jpg",_en="/aladdin/assets/forest-4yWLHFWh.jpg",Ven="/aladdin/assets/grassland-CDTfZBr_.jpg",aTe="/aladdin/assets/hill-spring-BepVmTLf.jpg",lTe="/aladdin/assets/hill-summer-RoU04vrD.jpg",sTe="/aladdin/assets/hill-fall-BPbpF4zI.jpg",cTe="/aladdin/assets/hill-winter-CQjb4ZNm.jpg",Gen="/aladdin/assets/lake-Dj_bK41O.jpg",Xen="/aladdin/assets/mountain-Du_Jo4ue.jpg",Jen="/aladdin/assets/rural-BqG-D3I1.jpg",Ken=be.memo(({theme:t="Default"})=>{const e=H(fn),n=H(bW),o=H(Cb),r=H(Dge),i=H(Yge),a=H(EH),l=H(Gn),s=H(u3),c=H(kge),u=H(d1),d=H(Tc),f=H(rl),p=H(En),g=H(c3),y=H(eYe),{scene:w,camera:b,gl:{domElement:C}}=oi(),P=m.useRef(null),v=m.useRef(null),T=m.useRef(null),A=m.useRef(new Map),x=m.useRef(new Map),S=m.useRef(new ie),R=m.useRef(new ie),M=m.useRef(new ie(1,1,1)),D=m.useRef(0),E=m.useRef(0),W=m.useRef(new Map),j=m.useRef(new Map),L=m.useRef(new Map),k=m.useRef(new Map),N=m.useRef(null),F=Jt(),U=m.useMemo(()=>new l0,[]),O=m.useMemo(()=>new nn,[]),_=new Date(f).getMonth()+1,[X,$]=m.useState(eh.Sky),Q=m.useMemo(()=>new ie,[]),le=m.useMemo(()=>new nn,[]);if(v.current&&u){X!==eh.Vertical&&$(eh.Vertical);const ce=i(v.current,u),pe=r(),ve=-Math.atan2(pe.x,pe.y);Q.set(ce.x,ce.y,0),le.set(-Gt,0,ve,"ZXY")}const q=m.useMemo(()=>{switch(t){case Os.Desert:return .5;case Os.Dune:return .25;case Os.Forest:return .25;case Os.Grassland:return .15;case Os.Hill:return .3;case Os.Lake:return .1;case Os.Mountain:return .4;case Os.Rural:return .25;default:return .2}},[t]),te=m.useMemo(()=>{switch(t){case Os.Desert:return Yen;case Os.Dune:return Oen;case Os.Forest:return _en;case Os.Grassland:return Ven;case Os.Hill:return d>0?_>=12||_<=3?cTe:_>3&&_<=5?aTe:_>5&&_<=9?lTe:sTe:_>=12||_<=3?lTe:_>3&&_<=5?sTe:_>5&&_<=9?cTe:aTe;case Os.Lake:return Gen;case Os.Mountain:return Xen;case Os.Rural:return Jen;default:return Ben}},[t,_,d]),re=bb(te),ae=ce=>ce===z.Foundation||ce===z.Cuboid||ce===z.Tree||ce===z.Flower||ce===z.Human,se=ce=>{if(ce.intersections.length>0)if(ce.intersections[0].object===P.current)n(),e(ve=>{ve.clickObjectType=z.Sky});else{const ve=o();ve&&ae(ve.type)&&(v.current=ve,me.isPlantOrHuman(v.current)&&($(eh.Vertical),le.set(-Gt,0,0,"ZXY")),ve.type!==z.Foundation&&ve.type!==z.Cuboid&&Fn.getState().setEnableOrbitController(!1))}},ne=ce=>{if(!ce)return"";const pe=ce.name.split(" ");return pe[2]?pe[2]:ne(ce.parent)},fe=(ce,pe)=>{if(ce==null)return null;for(const ve of ce.children)if(ve.name.includes(`${pe}`))return ve;return null},ge=(ce,pe)=>{var Me,Pe;const ve=Fn.getState().contentRef,Ae=fe(ve==null?void 0:ve.current,ce.id);if(Ae){for(const Ee of Ae.children)if(Ee.name.includes(`${pe.id}`)){(Pe=(Me=Fn.getState().contentRef)==null?void 0:Me.current)==null||Pe.add(Ee);break}}pe.parentId=Zo;const Te=new ie(pe.cx,pe.cy,pe.cz).applyEuler(new nn(0,0,ce.rotation[2])).add(S.current);pe.cx=Te.x,pe.cy=Te.y,pe.cz=0,L.current.set(pe.id,new ie(Te.x,Te.y,0)),k.current.set(pe.id,Zo)},de=(ce,pe,ve)=>{if(!ce||!pe)return;const Ae=Fn.getState().contentRef;if(Ae!=null&&Ae.current){const Te=me.getObjectChildById(Ae.current,pe),Me=me.getObjectChildById(pe===Zo?Ae.current:Te,ve);if(Me){if(ce===Zo)Ae.current.add(Me);else{const Pe=me.getObjectChildById(Ae.current,ce);Pe==null||Pe.add(Me)}np()}}},Z=(ce,pe)=>{ce&&e(ve=>{for(const Ae of ve.elements)if(Ae.id===pe&&!me.isFoundationOrCuboid(Ae)){Ae.parentId=ce;break}})},he=ce=>{for(const pe of ce)if(pe.object.userData.stand)return pe;return null},xe=(ce,pe)=>{if(ce&&ce.current){const ve=he(pe.intersections);if(ve){const Ae=ve.object,Te=ce.current.parent;if(Ae.name==="Ground"){if(Te&&Te.name!=="Content"){const Me=Fn.getState().contentRef;Me&&Me.current&&(Me.current.add(ce.current),Z(Zo,ne(ce.current)))}ce.current.position.copy(ve.point),np()}else if(Ae.userData.stand){const Me=Ae.parent;if(Me){Te&&Te.uuid!==Me.uuid&&(Me.add(ce.current),Z(ne(Me),ne(ce.current))),O.set(0,0,-Me.rotation.z);const Pe=new ie().subVectors(ve.point,Me.position).applyEuler(O);ce.current.position.copy(Pe),np()}}}}},He=(ce,pe,ve)=>{e(Ae=>{for(const Te of Ae.elements)if(Te.id===ce){me.isFoundationOrCuboid(Te)||(Te.parentId=pe),Te.cx=ve.x,Te.cy=ve.y,Te.cz=ve.z;break}})},Se=()=>{if(H.getState().viewState.orthographic)return!1;if(P.current){const ce=U.intersectObjects(me.fetchIntersectables(w),!1);if(ce.length>0){for(const pe of ce)if(pe.object.userData.stand)return!1}}return U.intersectObjects([P.current]).length>0},ze=ce=>{if(v.current&&v.current.type&&!v.current.locked){const pe=new Xt;pe.x=ce.offsetX/C.clientWidth*2-1,pe.y=-(ce.offsetY/C.clientHeight)*2+1,U.setFromCamera(pe,b);let ve;if(T.current&&X===eh.Vertical&&(ve=U.intersectObjects([T.current]),ve&&ve.length>0)){const Ae=ve[0].point;switch(v.current.type){case z.Tree:{const Te=v.current;switch(u){case vt.Top:c(Te.id,Ae.z),e(Me=>{Me.selectedElementHeight=Math.max(1,Ae.z)});break;case vt.Left:case vt.Right:case vt.Upper:case vt.Lower:s(Te.id,2*Math.hypot(Ae.x-Te.cx,Ae.y-Te.cy));break}xe(Fn.getState().treeRef,ce);break}case z.Human:{xe(Fn.getState().humanRef,ce);break}case z.Cuboid:{if(me.isTopResizeHandle(u)){e(Me=>{var Pe;for(const Ee of Me.elements)if(Ee.id===((Pe=v.current)==null?void 0:Pe.id)){Ee.cz=Math.max(.5,Ae.z/2),Ee.lz=Math.max(1,Ae.z);break}Me.selectedElementHeight=Math.max(1,Ae.z)});const Te=Fn.getState().cuboidRef;if(Te!=null&&Te.current){for(const Me of Te.current.children)if(Me.name.includes("Human")||Me.name.includes("Tree")){const Pe=A.current.get(ne(Me));Pe&&(Math.abs(E.current-Pe.z)<.01?Me.position.setZ(Math.max(Ae.z/2,.5)):Me.position.setZ(Pe.z-Te.current.position.z))}}}break}}}}},Ie=ce=>{if(ce.button===2)return;e(ve=>{ve.contextMenuObjectType=null}),se(ce);const pe=v.current;if(pe)switch(E.current=pe.lz,S.current.set(pe.cx,pe.cy,pe.cz),pe.type){case z.Human:N.current=pe.parentId;break;case z.Tree:N.current=pe.parentId,D.current=pe.lx;break;case z.Cuboid:{S.current.set(pe.cx,pe.cy,pe.cz),M.current.set(pe.lx,pe.ly,pe.lz),A.current.clear();const ve=new ie(pe.cx,pe.cy,pe.cz),Ae=a(pe.id);if(Ae.length>0){W.current.clear();const Te=pe.rotation[2];for(const Me of Ae)switch(Me.type){case z.Tree:case z.Human:{const Pe=new ie(Me.cx,Me.cy,Me.cz).applyEuler(new nn(0,0,Te));Pe.add(ve),A.current.set(Me.id,Pe),W.current.set(Me.id,new ie(Me.cx,Me.cy,Me.cz));break}case z.SolarPanel:case z.Sensor:{if(me.isIdentical(Me.normal,rs)){const Pe=new ie(Me.cx*pe.lx,Me.cy*pe.ly,Me.cz*pe.lz).applyEuler(new nn(0,0,Te));Pe.add(ve),A.current.set(Me.id,Pe)}break}case z.Polygon:{if(me.isIdentical(Me.normal,rs)){const Pe=Me,Ee=[];for(const Be of Pe.vertices){const Je=new Xt(Be.x*pe.lx,Be.y*pe.ly).rotateAround(si,Te);Je.add(new Xt(ve.x,ve.y)),Ee.push(Je)}x.current.set(Pe.id,Ee)}break}}}break}}},ye=()=>{var ce,pe;if(v.current){const ve=l(v.current.id);if(ve&&!ve.locked){let Ae=null,Te=N.current;switch(ve.type){case z.Cuboid:switch(u){case vt.UpperLeftTop:case vt.UpperRightTop:case vt.LowerLeftTop:case vt.LowerRightTop:{j.current.clear(),e(Ee=>{Ee.actionState.cuboidHeight=ve.lz;for(const Be of Ee.elements)if(me.isPlantOrHuman(Be)&&Be.parentId===ve.id)if(j.current.set(Be.id,ve.id),Math.abs(M.current.z/2-Be.cz)<.01)Be.cz=ve.lz/2;else{const Je=Be.cz+S.current.z-ve.cz;Math.abs(Je)>ve.lz/2?ge(ve,Be):Be.cz=Je}});const Me=a(ve.id);if(Me.length>0)for(const Ee of Me)L.current.set(Ee.id,new ie(Ee.cx,Ee.cy,Ee.cz));const Pe={name:"Change Cuboid Height",timestamp:Date.now(),changedElementId:ve.id,changedElementType:ve.type,oldValue:E.current,newValue:ve.lz,oldChildrenPositionsMap:new Map(W.current),newChildrenPositionsMap:new Map(L.current),oldChildrenParentIdMap:new Map(j.current),newChildrenParentIdMap:new Map(k.current),undo:()=>{var Ee,Be;if(e(Je=>{for(const We of Je.elements)if(We.id===Pe.changedElementId){We.lz=Pe.oldValue,We.cz=Pe.oldValue/2;break}}),Pe.oldChildrenPositionsMap&&Pe.oldChildrenPositionsMap.size>0)for(const[Je,We]of Pe.oldChildrenPositionsMap.entries()){const Ke=l(Je);if((Ke==null?void 0:Ke.type)!==z.Polygon){g(Je,We.x,We.y,We.z);const Ne=(Ee=Pe.oldChildrenParentIdMap)==null?void 0:Ee.get(Je),De=(Be=Pe.newChildrenParentIdMap)==null?void 0:Be.get(Je);Ne&&De&&Ne!==De&&(de(Ne,De,Je),Z(Ne,Je))}}},redo:()=>{var Ee,Be;if(e(Je=>{for(const We of Je.elements)if(We.id===Pe.changedElementId){We.lz=Pe.newValue,We.cz=Pe.newValue/2;break}}),Pe.newChildrenPositionsMap&&Pe.newChildrenPositionsMap.size>0)for(const[Je,We]of Pe.newChildrenPositionsMap.entries()){g(Je,We.x,We.y,We.z);const Ke=(Ee=Pe.oldChildrenParentIdMap)==null?void 0:Ee.get(Je),Ne=(Be=Pe.newChildrenParentIdMap)==null?void 0:Be.get(Je);Ke&&Ne&&Ke!==Ne&&(de(Ne,Ke,Je),Z(Ne,Je))}}};p(Pe);break}}break;case z.Tree:switch(u){case vt.Top:{const Me={name:"Change Tree Height",timestamp:Date.now(),changedElementId:ve.id,changedElementType:ve.type,oldValue:E.current,newValue:ve.lz,undo:()=>{c(Me.changedElementId,Me.oldValue)},redo:()=>{c(Me.changedElementId,Me.newValue)}};p(Me),e(Pe=>{Pe.actionState.treeHeight=ve.lz});break}case vt.Left:case vt.Right:case vt.Lower:case vt.Upper:{const Me={name:"Change Tree Spread",timestamp:Date.now(),changedElementId:ve.id,changedElementType:ve.type,oldValue:D.current,newValue:ve.lx,undo:()=>{s(Me.changedElementId,Me.oldValue)},redo:()=>{s(Me.changedElementId,Me.newValue)}};p(Me),e(Pe=>{Pe.actionState.treeSpread=ve.lx});break}}Ae=(ce=Fn.getState().treeRef)==null?void 0:ce.current;break;case z.Human:Ae=(pe=Fn.getState().humanRef)==null?void 0:pe.current;break}if(Ae){const Me=U.intersectObjects(me.fetchIntersectables(w),!1),Pe=he(Me);if(Pe){const Ee=Pe.point;if(Pe.object.name==="Ground")He(ve.id,Zo,Ee),R.current.set(Ee.x,Ee.y,Ee.z),Te=Zo;else if(Pe.object.userData.stand){const Be=ne(Pe.object),Je=Pe.object.parent;if(Je){const We=new ie().subVectors(Ee,Je.position).applyEuler(O);He(ve.id,Be,We),R.current.set(We.x,We.y,We.z),Te=Be}}}}if(H.getState().moveHandleType&&me.isPlantOrHuman(ve)&&(R.current.distanceToSquared(S.current)>It||U.intersectObjects([P.current]).length>0)){let Me=!0;if(!H.getState().viewState.orthographic&&(Me=R.current.length().02}if(!Me||Se()){g(ve.id,S.current.x,S.current.y,S.current.z),Ae&&me.isPlantOrHuman(ve)&&Ae.position.copy(S.current),me.isPlantOrHuman(ve)&&Z(N.current,ve.id);const Pe=Fn.getState().contentRef;if(Pe!=null&&Pe.current&&N.current&&Ae){if(N.current===Zo)Pe.current.add(Ae);else{const Ee=me.getObjectChildById(Pe.current,N.current);Ee==null||Ee.add(Ae)}np()}po(Y.t("message.CannotMoveObjectTooFar",F))}else{const Pe={name:"Move",timestamp:Date.now(),movedElementId:ve.id,movedElementType:ve.type,oldCx:S.current.x,oldCy:S.current.y,oldCz:S.current.z,newCx:R.current.x,newCy:R.current.y,newCz:R.current.z,oldParentId:N.current,newParentId:Te,undo:()=>{g(Pe.movedElementId,Pe.oldCx,Pe.oldCy,Pe.oldCz),Z(Pe.oldParentId,Pe.movedElementId),de(Pe.oldParentId,Pe.newParentId,Pe.movedElementId)},redo:()=>{g(Pe.movedElementId,Pe.newCx,Pe.newCy,Pe.newCz),Z(Pe.newParentId,Pe.movedElementId),de(Pe.newParentId,Pe.oldParentId,Pe.movedElementId)}};p(Pe),y()}}}v.current=null,$(eh.Sky),e(Ae=>{Ae.moveHandleType=null,Ae.resizeHandleType=null,Ae.rotateHandleType=null}),Fn.setState({humanRef:null,treeRef:null}),Fn.getState().setEnableOrbitController(!0)}};return h.jsxs(h.Fragment,{children:[h.jsxs("mesh",{ref:P,name:"Sky",rotation:[Gt,0,0],scale:[1,q,1],onContextMenu:ce=>{ce.intersections.length>0&&ce.intersections[0].object===P.current&&(n(),e(ve=>{ve.clickObjectType=z.Sky,ve.contextMenuObjectType=z.Sky}))},onPointerDown:Ie,children:[h.jsx("sphereGeometry",{args:[$6t,16,8,0,la,0,Gt]}),h.jsx("meshToonMaterial",{map:re,side:p0,opacity:1,color:"skyblue"})]}),v.current&&X!==eh.Sky&&h.jsx(ua,{ref:T,visible:!1,name:"Sky Intersection Plane",rotation:le,position:Q,args:[1e3,1e3],onPointerMove:L2.throttle(ze,VF),onPointerUp:ye,children:h.jsx("meshStandardMaterial",{side:$r})})]})}),qen=be.memo(({lineWidth:t=1,endPoint:e=1e3,showTickMarks:n=!0,showTickLabels:o=!0})=>{const r=H(Swt),i=H(Ug),a=H(Id),[l,s]=m.useState(!1),c=50,u=m.useRef(1),d=m.useRef(u.current*10),f=m.useRef(new Array(c).fill(1)),p=.1,g=.3,y="FloralWhite",w=t/2,b=o3(lW,hN),C=Math.min(1,Math.max(.5,i*.01)),P={font:b,height:0,size:C},v=a?r.max.z+.01:0;m.useEffect(()=>{i<50?u.current=1:i<100?u.current=2:u.current=5,d.current=10*u.current,f.current=new Array(c).fill(1),s(!l)},[i]);const T=A=>A%(5*u.current)===0?g:p;return h.jsxs(h.Fragment,{children:[h.jsx(jn,{userData:{unintersectable:!0},name:"x axis line",points:[[-e,0,v],[e,0,v]],color:"red",lineWidth:t}),a&&n&&f.current.map((A,x)=>{const S=(x+1)*u.current,R=T(S);return h.jsxs(be.Fragment,{children:[h.jsx(jn,{userData:{unintersectable:!0},points:[[S,-R,v],[S,R,v]],color:y,lineWidth:w}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-S,-R,v],[-S,R,v]],color:y,lineWidth:w})]},S)}),a&&o&&f.current.map((A,x)=>{const S=(x+1)*u.current;return S%d.current===0?h.jsxs("mesh",{userData:{unintersectable:!0},position:[S-C,-g*2-C,v],children:[h.jsx("textGeometry",{args:[(S<10?" ":"")+S,P]}),h.jsx("meshStandardMaterial",{attach:"material",color:"lightGray"})]},S):h.jsx(be.Fragment,{},S)}),a&&o&&f.current.map((A,x)=>{const S=-(x+1)*u.current;return S%d.current===0?h.jsxs("mesh",{userData:{unintersectable:!0},position:[S-C,-g*2-C,v],children:[h.jsx("textGeometry",{args:[(S>-10?" ":"")+S,P]}),h.jsx("meshStandardMaterial",{attach:"material",color:"lightGray"})]},S):h.jsx(be.Fragment,{},S)}),h.jsx(jn,{name:"y axis line",userData:{unintersectable:!0},points:[[0,-e,v],[0,e,v]],color:"blue",lineWidth:t}),a&&n&&f.current.map((A,x)=>{const S=(x+1)*u.current,R=T(S);return h.jsxs(be.Fragment,{children:[h.jsx(jn,{userData:{unintersectable:!0},points:[[-R,S,v],[R,S,v]],color:y,lineWidth:w*1.5}),h.jsx(jn,{userData:{unintersectable:!0},points:[[-R,-S,v],[R,-S,v]],color:y,lineWidth:w*1.5})]},S)}),a&&o&&f.current.map((A,x)=>{const S=(x+1)*u.current;return S%d.current===0?h.jsxs("mesh",{userData:{unintersectable:!0},position:[-g*2-C*2,S-C/2,v],children:[h.jsx("textGeometry",{args:[S+"",P]}),h.jsx("meshStandardMaterial",{attach:"material",color:"lightGray"})]},S):h.jsx(be.Fragment,{},S)}),a&&o&&f.current.map((A,x)=>{const S=-(x+1)*u.current;return S%d.current===0?h.jsxs("mesh",{userData:{unintersectable:!0},position:[-g*2-C*2,S-C/2,v],children:[h.jsx("textGeometry",{args:[S+"",P]}),h.jsx("meshStandardMaterial",{attach:"material",color:"lightGray"})]},S):h.jsx(be.Fragment,{},S)}),!a&&h.jsx(jn,{userData:{unintersectable:!0},name:"z axis line",points:[[0,0,0],[0,0,e]],color:"green",lineWidth:t})]})}),$en=be.memo(t=>{var $;const{id:e,cx:n,cy:o,cz:r,name:i=Yt.Jack,locked:a=!1,flip:l=!1,observer:s=!1,parentId:c}=t;let u=!1;H(Q=>{if(c===Zo)u=!0;else for(const le of Q.elements)if(le.id===c){u=!0;break}});const d=H(yp);m.useEffect(()=>{u||d(e,!1)},[u,e]);const f=H(fn),p=H(Id)??!1,g=H(Y0),y=H(Eb),w=H(ly),b=ht(Ss),C=Es(e),{gl:P}=oi(),[v,T]=m.useState(!1),A=Fn(Q=>Q.contentRef),x=m.useRef(null),S=m.useRef(null),R=Jt(),M=m.useRef(!1),D=H(zH);D!==M.current&&(M.current=D,A!=null&&A.current&&x.current&&A.current.add(x.current)),m.useEffect(()=>{if(c!==Zo){const Q=F();Q&&x.current&&Q.add(x.current)}},[D,c]);const E=m.useMemo(()=>new df().load(Fp.fetchTextureImage(i),Q=>{l&&(Q.wrapS=Hs,Q.repeat.x=-1),j(Q)}),[i,l]),[W,j]=m.useState(E),L=m.useMemo(()=>Fp.fetchWidth(i),[i]),k=m.useMemo(()=>Fp.fetchHeight(i),[i]),N=m.useMemo(()=>Fp.fetchLabel(i,R)+(a?" ("+Y.t("shared.ElementLocked",R)+")":"")+` +`+Y.t("word.Coordinates",R)+": ("+n.toFixed(1)+", "+o.toFixed(1)+") "+Y.t("word.MeterAbbreviation",R),[i,a,n,o,R]);m.useEffect(()=>{const Q=F();Q&&x.current&&Q.add(x.current)},[A]);const F=()=>c!==Zo&&(A!=null&&A.current)?me.getObjectChildById(A.current,c):null;ay(({camera:Q})=>{if(x.current){const{rot:le}=me.getWorldDataById(c);if(p)x.current.rotation.set(Gt,Math.PI-le,0);else{const{x:q,y:te}=Q.position,{x:re,y:ae}=x.current.localToWorld(new ie);x.current.rotation.set(0,0,-Math.atan2(q-re,te-ae)-le)}}});const U=m.useCallback((Q,le)=>{ht.getState().duringCameraInteraction||Q.intersections.length>0&&(Q.intersections[0].object===Q.eventObject||Q.intersections.length>1&&Q.intersections[1].object===Q.eventObject)&&(f(te=>{te.hoveredHandle=le,te.selectedElementHeight=t.lz}),me.isMoveHandle(le)?P.domElement.style.cursor="move":P.domElement.style.cursor="pointer")},[t.lz]),O=m.useCallback(()=>{f(Q=>{Q.hoveredHandle=null}),P.domElement.style.cursor=H.getState().addedCuboidId?"crosshair":"default"},[]),B=s?Fp.fetchGender(t.name):Ha.Male,_=s?(t.flip?-1:1)*Fp.fetchHatOffsetX(t.name):0,X=s?Fp.fetchHatOffsetY(t.name):0;return u?h.jsx("group",{ref:x,name:"Human Group "+e,userData:{aabb:!0},position:[n,o,r??0],children:h.jsxs("group",{position:[0,.1,k/2],children:[h.jsx(PC,{rotation:[Gt,0,0],uuid:e,name:i,follow:!1,children:h.jsx(ua,{ref:S,renderOrder:3,receiveShadow:!b,name:`Human ${i} plane`,args:[L,k],onContextMenu:Q=>{g(e,Q,Oo.ContextMenu),f(le=>{Q.intersections.length>0&&Q.intersections[0].object===S.current&&(le.contextMenuObjectType=z.Human)})},onPointerDown:Q=>{Q.button!==2&&Q.eventObject===Q.intersections[0].eventObject&&(g(e,Q,Oo.Move),Fn.setState({humanRef:x}))},onPointerOver:Q=>{Q.intersections.length>0&&Q.intersections[0].object===S.current&&T(!0)},onPointerOut:()=>{T(!1)},children:h.jsx("meshToonMaterial",{map:W,alphaTest:.5,side:$r})})}),C&&a&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-L/2,0,-k/2],[-L/2,0,k/2],[-L/2,0,k/2],[L/2,0,k/2],[L/2,0,-k/2],[L/2,0,k/2],[L/2,0,-k/2],[-L/2,0,-k/2]],castShadow:!1,receiveShadow:!1,lineWidth:.5,rotation:($=S.current)==null?void 0:$.rotation,color:y0}),s&&h.jsxs(h.Fragment,{children:[h.jsx(ds,{uuid:e,visible:!1,userData:{eyeball:!0},name:i+" eyeball",args:[L/5,4,4,0,la,0,la],position:[0,0,t.lz/2],children:h.jsx("meshBasicMaterial",{attach:"material",side:$r})}),h.jsx(ca,{name:"Observer hat 1",userData:{unintersectable:!0},castShadow:!1,receiveShadow:!1,args:[.1,.1,.1,16,2],position:[_,0,t.lz/2-.05+X],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:B===Ha.Male?"gray":"hotpink"})}),h.jsx(ca,{name:"Observer hat 2",userData:{unintersectable:!0},castShadow:!1,receiveShadow:!1,args:[.2,.2,.01,16,2],position:[_,0,t.lz/2-.1+X],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:B===Ha.Male?"gray":"hotpink"})})]}),C&&!a&&h.jsx(ds,{position:[0,0,-k/2],args:[c1*4,6,6,0,Math.PI],name:Ho.Default,onPointerDown:Q=>{Q.button!==2&&Q.eventObject===Q.intersections[0].eventObject&&(g(e,Q,Oo.Move),Fn.setState({humanRef:x}))},onPointerEnter:Q=>{U(Q,Ho.Default)},onPointerLeave:O,children:h.jsx("meshBasicMaterial",{attach:"material",color:w===Ho.Default||y===Ho.Default?ta:tw})}),v&&!C&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:N,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,k/2+((t==null?void 0:t.labelHeight)??.4)]})]})}):null}),uTe="/aladdin/assets/apple_spring-Ctq5fKrS.png",sde="/aladdin/assets/apple_summer-Dr8H3cny.png",dTe="/aladdin/assets/apple_fall-Cp6pAzIj.png",fTe="/aladdin/assets/apple_winter-D03fshM0.png",hTe="/aladdin/assets/birch_spring-sKFxYorO.png",cde="/aladdin/assets/birch_summer-FaJ43Xt4.png",pTe="/aladdin/assets/birch_fall-PIQyyY4L.png",gTe="/aladdin/assets/birch_winter-C5h1hTVJ.png",nQe="/aladdin/assets/coconut-rkhxogn3.png",mTe="/aladdin/assets/dogwood_spring-9vLsm3g2.png",ude="/aladdin/assets/dogwood_summer-DgdkRZ2O.png",yTe="/aladdin/assets/dogwood_fall-Wu983FGV.png",ATe="/aladdin/assets/dogwood_winter-4w2TO6RG.png",wTe="/aladdin/assets/elm_spring-DJcRoCq2.png",dde="/aladdin/assets/elm_summer-VNy_g1qe.png",vTe="/aladdin/assets/elm_fall-ChdMN8fe.png",xTe="/aladdin/assets/elm_winter-Qng-eWYe.png",oQe="/aladdin/assets/fan_palm-DbCJ1Nso.png",bTe="/aladdin/assets/linden_spring-C_zkyu46.png",fde="/aladdin/assets/linden_summer-zap94GfP.png",STe="/aladdin/assets/linden_fall-CK-BpZ7U.png",TTe="/aladdin/assets/linden_winter-Dt7sgspu.png",PTe="/aladdin/assets/magnolia_spring-CNor1Lb8.png",hde="/aladdin/assets/magnolia_summer-C7-8T4uo.png",CTe="/aladdin/assets/magnolia_fall-D3wi6n7Y.png",RTe="/aladdin/assets/magnolia_winter-116tEre9.png",HTe="/aladdin/assets/maple_spring-26OHjb4f.png",pde="/aladdin/assets/maple_summer-BbcBLKSJ.png",MTe="/aladdin/assets/maple_fall-Bp5Vy2Jl.png",ITe="/aladdin/assets/maple_winter-BnFW631O.png",zTe="/aladdin/assets/oak_spring-CsUg07TC.png",gde="/aladdin/assets/oak_summer-CPK7amde.png",DTe="/aladdin/assets/oak_fall-rgRz_M_t.png",ETe="/aladdin/assets/oak_winter-CD4uumS6.png",rQe="/aladdin/assets/pine-CI5zZHth.png",iQe="/aladdin/assets/spruce-CEhjo5-Q.png";class Gz{static isEvergreen(e){return e===pr.Spruce||e===pr.Pine||e===pr.FanPalm||e===pr.Coconut}static isConic(e){return e===pr.Spruce}static fetchLabel(e,n){switch(e){case pr.Apple:return Y.t("tree.Apple",n);case pr.Birch:return Y.t("tree.Birch",n);case pr.Coconut:return Y.t("tree.Coconut",n);case pr.Dogwood:return Y.t("tree.Dogwood",n);case pr.Elm:return Y.t("tree.Elm",n);case pr.FanPalm:return Y.t("tree.FanPalm",n);case pr.Linden:return Y.t("tree.Linden",n);case pr.Magnolia:return Y.t("tree.Magnolia",n);case pr.Maple:return Y.t("tree.Maple",n);case pr.Oak:return Y.t("tree.Oak",n);case pr.Spruce:return Y.t("tree.Spruce",n);default:return Y.t("tree.Pine",n)}}static fetchTheta(e){switch(e){case pr.Apple:return .65*Math.PI;case pr.Birch:return .72*Math.PI;case pr.Coconut:return .5*Math.PI;case pr.Dogwood:return .65*Math.PI;case pr.Elm:return .78*Math.PI;case pr.FanPalm:return .52*Math.PI;case pr.Linden:return .75*Math.PI;case pr.Magnolia:return .68*Math.PI;case pr.Maple:return .65*Math.PI;case pr.Oak:return .75*Math.PI;case pr.Spruce:return Math.PI;default:return Math.PI*.5}}static fetchTextureImage(e,n,o,r,i){let a;const l=r+30,s=i-30,c=o>0;switch(e){case pr.Apple:n>=i||n<=r?a=c?fTe:sde:n>r&&n<=l?a=c?uTe:dTe:n>l&&n<=s?a=c?sde:fTe:a=c?dTe:uTe;break;case pr.Birch:n>=i||n<=r?a=c?gTe:cde:n>r&&n<=l?a=c?hTe:pTe:n>l&&n<=s?a=c?cde:gTe:a=c?pTe:hTe;break;case pr.Coconut:a=nQe;break;case pr.Dogwood:n>=i||n<=r?a=c?ATe:ude:n>r&&n<=l?a=c?mTe:yTe:n>l&&n<=s?a=c?ude:ATe:a=c?yTe:mTe;break;case pr.Elm:n>=i||n<=r?a=c?xTe:dde:n>r&&n<=l?a=c?wTe:vTe:n>l&&n<=s?a=c?dde:xTe:a=c?vTe:wTe;break;case pr.FanPalm:a=oQe;break;case pr.Linden:n>=i||n<=r?a=c?TTe:fde:n>r&&n<=l?a=c?bTe:STe:n>l&&n<=s?a=c?fde:TTe:a=c?STe:bTe;break;case pr.Magnolia:n>=i||n<=r?a=c?RTe:hde:n>r&&n<=l?a=c?PTe:CTe:n>l&&n<=s?a=c?hde:RTe:a=c?CTe:PTe;break;case pr.Maple:n>=i||n<=r?a=c?ITe:pde:n>r&&n<=l?a=c?HTe:MTe:n>l&&n<=s?a=c?pde:ITe:a=c?MTe:HTe;break;case pr.Oak:n>=i||n<=r?a=c?ETe:gde:n>r&&n<=l?a=c?zTe:DTe:n>l&&n<=s?a=c?gde:ETe:a=c?DTe:zTe;break;case pr.Spruce:a=iQe;break;default:a=rQe}return a}}const Qen=be.memo(t=>{var ve;const{parentId:e,id:n,cx:o,cy:r,cz:i,lx:a,lz:l,name:s=pr.Pine,flip:c=!1,locked:u=!1,showModel:d=!1,showLabel:f=!1}=t;let p=!1;H(Ae=>{if(e===Zo)p=!0;else for(const Te of Ae.elements)if(Te.id===e){p=!0;break}});const g=H(yp);m.useEffect(()=>{p||g(n,!1)},[p]);const y=H(fn),w=H(Id)??!1,b=H(rl),C=H(Tc),P=H(xge)??Fq,v=H(bge)??kq,T=H(Ds),A=H(Y0),x=H(Eb),S=H(d1),R=H(ly),M=Es(n),[D,E]=m.useState(!1),{gl:W}=oi(),j=Fn(Ae=>Ae.contentRef),L=m.useRef(null),k=m.useRef(null),N=m.useRef(null),F=m.useRef(null),U=m.useRef(null),O=m.useRef(null),B=m.useRef(null),_=m.useRef(null),X=m.useRef(null),$=m.useRef(null),Q=Jt(),le=m.useMemo(()=>me.dayOfYear(new Date(b)),[b]),q=m.useMemo(()=>!Gz.isEvergreen(t?t.name:pr.Dogwood)&&(C>0?lev:le>=P&&le<=v),[le,P,v,C,t==null?void 0:t.name]),te=m.useRef(!1),re=H(zH);re!==te.current&&(te.current=re,j!=null&&j.current&&L.current&&j.current.add(L.current)),m.useEffect(()=>{if(e!==Zo){const Ae=ce();Ae&&L.current&&Ae.add(L.current)}},[re]),m.useEffect(()=>{const Ae=ce();Ae&&L.current&&Ae.add(L.current)},[j]);const ae=m.useMemo(()=>new df().load(Gz.fetchTextureImage(s,le,C,P,v),Ae=>{c&&(Ae.wrapS=Hs,Ae.repeat.x=-1),ne(Ae)}),[s,le,C,c,P,v]),[se,ne]=m.useState(ae),fe=m.useMemo(()=>(t!=null&&t.label?t.label:Gz.fetchLabel(s,Q))+(u?" ("+Y.t("shared.ElementLocked",Q)+")":"")+(t!=null&&t.label?"":` +`+Y.t("word.Coordinates",Q)+": ("+o.toFixed(1)+", "+r.toFixed(1)+") "+Y.t("word.MeterAbbreviation",Q)),[t==null?void 0:t.label,s,o,r,u,Q]),ge=m.useMemo(()=>Gz.fetchTheta(s),[s]),de=a/2,Z=l/2,he=m.useMemo(()=>new ie(0,0,Z),[Z]),xe=m.useMemo(()=>new ie(-de,0,0),[de]),He=m.useMemo(()=>new ie(de,0,0),[de]),Se=m.useMemo(()=>new ie(0,-de,0),[de]),ze=m.useMemo(()=>new ie(0,de,0),[de]),Ie=m.useCallback((Ae,Te)=>{ht.getState().duringCameraInteraction||Ae.intersections.length>0&&(Ae.intersections[0].object===Ae.eventObject||Ae.intersections.length>1&&Ae.intersections[1].object===Ae.eventObject)&&(y(Pe=>{Pe.hoveredHandle=Te,Pe.selectedElementHeight=t.lz}),me.isMoveHandle(Te)?W.domElement.style.cursor="move":W.domElement.style.cursor="pointer")},[t==null?void 0:t.lz]),ye=m.useCallback(()=>{y(Ae=>{Ae.hoveredHandle=null}),W.domElement.style.cursor=H.getState().addedCuboidId?"crosshair":"default"},[]),ce=()=>e!==Zo&&(j!=null&&j.current)?me.getObjectChildById(j.current,e):null;ay(({camera:Ae})=>{if(k.current&&L.current&&N.current&&U.current){const{rot:Te}=me.getWorldDataById(e),{x:Me,y:Pe}=Ae.position,{x:Ee,y:Be}=L.current.position,{x:Je,y:We}=H.getState().sunlightDirection;if(ce()){const Ne=L.current.localToWorld(new ie),De=Math.atan2(Me-Ne.x,Pe-Ne.y)+Te;k.current.rotation.set(Gt,-De,0),U.current.rotation.set(-Gt,De,0),N.current.rotation.set(Gt,-Math.atan2(Je,We)-Te,0)}else{const Ne=Math.atan2(Me-Ee,Pe-Be);k.current.rotation.set(Gt,-Ne,0),U.current.rotation.set(-Gt,Ne,0),N.current.rotation.set(Gt,-Math.atan2(Je,We),0)}}});const pe=c1*3;return h.jsx(h.Fragment,{children:p?h.jsx("group",{ref:L,name:"Tree Group "+n,userData:{aabb:!0},position:[o,r,i??0],children:h.jsxs("group",{position:[0,0,l/2],children:[h.jsx(PC,{ref:k,uuid:n,name:s,follow:!1,children:h.jsx(ua,{args:[a,l],children:h.jsx("meshToonMaterial",{map:se,side:$r,alphaTest:.5})})}),h.jsx(PC,{ref:N,name:s+" Shadow Billboard",follow:!1,children:h.jsx(ua,{args:[a,l],castShadow:T,children:h.jsx("meshBasicMaterial",{map:se,side:$r,alphaTest:.5,opacity:0})})}),Gz.isConic(s)?h.jsx(Rd,{visible:d||w,name:s+" Model",userData:{simulation:!0},position:[0,0,s===pr.Spruce?0:l*.06],args:[a/2,l,8,8,!0],scale:[1,1,1],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",side:$r,transparent:!0,opacity:.75})}):h.jsx(ds,{visible:d||w,userData:{simulation:!q},name:s+" Model",args:[a/2,8,8,0,la,0,ge],scale:[1,l/a,1],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",side:$r,transparent:!0,opacity:.75})}),h.jsx(PC,{ref:U,name:"Interaction Billboard",visible:!1,position:[0,0,-l/2+.5],children:h.jsx(ua,{ref:F,renderOrder:3,name:s+" plane",args:[a/2,l/3],rotation:[w?Gt:0,0,0],onContextMenu:Ae=>{A(n,Ae,Oo.ContextMenu),y(Te=>{Ae.intersections.length>0&&Ae.intersections[0].object===F.current&&(Te.contextMenuObjectType=z.Tree)})},onPointerDown:Ae=>{Ae.button!==2&&Ae.eventObject===Ae.intersections[0].eventObject&&(A(n,Ae,Oo.Move),Fn.setState({treeRef:L}))},onPointerOver:Ae=>{Ae.intersections.length>0&&Ae.intersections[0].object===F.current&&E(!0)},onPointerOut:()=>{E(!1)}})}),M&&u&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-a/2,-l/2,0],[-a/2,l/2,0],[-a/2,l/2,0],[a/2,l/2,0],[a/2,-l/2,0],[a/2,l/2,0],[a/2,-l/2,0],[-a/2,-l/2,0]],castShadow:!1,receiveShadow:!1,lineWidth:.5,rotation:(ve=k.current)==null?void 0:ve.rotation,color:y0}),M&&!u&&h.jsxs(h.Fragment,{children:[h.jsx(ds,{position:new ie(0,0,-l/2),args:[pe,6,6,0,Math.PI],name:Ho.Default,renderOrder:2,onPointerDown:Ae=>{Ae.button!==2&&Ae.eventObject===Ae.intersections[0].eventObject&&(A(n,Ae,Oo.Move),Fn.setState({treeRef:L}))},onPointerEnter:Ae=>{Ie(Ae,Ho.Default)},onPointerLeave:ye,children:h.jsx("meshBasicMaterial",{attach:"material",color:R===Ho.Default||x===Ho.Default?ta:tw})}),!w&&h.jsxs(h.Fragment,{children:[h.jsx(Qr,{ref:O,name:vt.Top,args:[pe,pe,pe],position:he,onPointerDown:Ae=>{A(n,Ae,Oo.Resize)},onPointerEnter:Ae=>{Ie(Ae,vt.Top)},onPointerLeave:ye,children:h.jsx("meshBasicMaterial",{attach:"material",color:R===vt.Top||S===vt.Top?ta:Da})}),h.jsx(Qr,{ref:B,name:vt.Left,args:[pe,pe,pe],position:xe,onPointerDown:Ae=>{A(n,Ae,Oo.Resize)},onPointerEnter:Ae=>{Ie(Ae,vt.Left)},onPointerLeave:ye,children:h.jsx("meshBasicMaterial",{attach:"material",color:R===vt.Left||S===vt.Left?ta:Da})}),h.jsx(Qr,{ref:_,name:vt.Right,args:[pe,pe,pe],position:He,onPointerDown:Ae=>{A(n,Ae,Oo.Resize)},onPointerEnter:Ae=>{Ie(Ae,vt.Right)},onPointerLeave:ye,children:h.jsx("meshBasicMaterial",{attach:"material",color:R===vt.Right||S===vt.Right?ta:Da})}),h.jsx(Qr,{ref:X,name:vt.Lower,args:[pe,pe,pe],position:Se,onPointerDown:Ae=>{A(n,Ae,Oo.Resize)},onPointerEnter:Ae=>{Ie(Ae,vt.Lower)},onPointerLeave:ye,children:h.jsx("meshBasicMaterial",{attach:"material",color:R===vt.Lower||S===vt.Lower?ta:Da})}),h.jsx(Qr,{ref:$,name:vt.Upper,args:[pe,pe,pe],position:ze,onPointerDown:Ae=>{A(n,Ae,Oo.Resize)},onPointerEnter:Ae=>{Ie(Ae,vt.Upper)},onPointerLeave:ye,children:h.jsx("meshBasicMaterial",{attach:"material",color:R===vt.Upper||S===vt.Upper?ta:Da})})]})]}),(D||f)&&!M&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:fe,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,l/2+((t==null?void 0:t.labelHeight)??.4)]})]})}):null})});function aQe(t){const e=t+"Geometry";return m.forwardRef(({args:n,children:o,...r},i)=>h.jsxs("mesh",{ref:i,...r,children:[h.jsx(e,{attach:"geometry",args:n}),o]}))}const FTe=aQe("ParabolicCylinder"),kTe=aQe("Paraboloid"),Zen=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i,ly:a,lz:l=.1,reflectance:s=.9,absorberTubeRadius:c=.05,latusRectum:u=2,tiltAngle:d,relativeAzimuth:f,moduleLength:p,poleHeight:g,poleRadius:y,drawSunBeam:w,rotation:b=[0,0,0],color:C="white",lineColor:P="black",lineWidth:v=.5,showLabel:T=!1,locked:A=!1,parentId:x}=t,S=H(fn),R=H(rl),M=H(Tc),D=H(Kn),E=ht(Ss),W=H(Cf),j=Tn(u1),L=H(Ds),k=H(Gn),N=H(Y0),F=H(Ug),U=H(d1),O=H(Dw),B=Es(e),{gl:{domElement:_}}=oi(),[X,$]=m.useState(!1),[Q,le]=m.useState(null),[q,te]=m.useState(1),[re,ae]=m.useState(null),se=m.useRef(null),ne=m.useRef(null),fe=m.useRef(null),ge=m.useRef(null),de=m.useRef(null),Z=m.useRef(null),he=m.useRef(null),xe=m.useRef(!1),He=Math.max(100,10*F),Se=16,ze=O.z<=0,Ie=Jt();let ye=n,ce=o,pe=r;const ve=i/2,Ae=a/2,Te=l/2,Me=g+ve,Pe=H(Ht=>{for(const At of Ht.elements)if(At.id===x)return At});if(x&&Pe)switch(Pe.type){case z.Foundation:if(pe=Me+Te+Pe.lz,me.isZero(b[2]))ye=Pe.cx+n*Pe.lx,ce=Pe.cy+o*Pe.ly;else{const Ht=new ie(n*Pe.lx,o*Pe.ly,0);Ht.applyAxisAngle(Io,b[2]),ye=Pe.cx+Ht.x,ce=Pe.cy+Ht.y}break}const Ee=ve*ve/u,Be=.25*u,Je=new ie(-ve,-Ae,Te+Ee),We=new ie(-ve,Ae,Te+Ee),Ke=new ie(ve,-Ae,Te+Ee),Ne=new ie(ve,Ae,Te+Ee);m.useEffect(()=>{if(t&&E){const Ht=j(t.id);Ht&&ae(me.fetchHeatmapTexture(Ht,W??5))}},[E,W]),m.useEffect(()=>{te(Math.max(1,Math.round(a/p)))},[a,p]),m.useEffect(()=>{const Ht=()=>{Fn.getState().setEnableOrbitController(!0),xe.current=!1};return window.addEventListener("pointerup",Ht),()=>{window.removeEventListener("pointerup",Ht)}},[]);const De=m.useMemo(()=>(t!=null&&t.label?t.label:Y.t("shared.ParabolicTroughElement",Ie))+(t!=null&&t.locked?" ("+Y.t("shared.ElementLocked",Ie)+")":"")+(t!=null&&t.label?"":` +`+Y.t("word.Coordinates",Ie)+": ("+ye.toFixed(1)+", "+ce.toFixed(1)+", "+pe.toFixed(1)+") "+Y.t("word.MeterAbbreviation",Ie)),[t==null?void 0:t.label,t==null?void 0:t.locked,ye,ce,pe,Ie]),ke=m.useMemo(()=>new nn(0,0,b[2],"ZXY"),[b]),Ye=(Ht,At)=>{Ht.intersections.length>0&&Ht.intersections[0].object===Ht.eventObject&&(le(At),At===Ho.Top?_.style.cursor="move":At===Kr.Lower||At===Kr.Upper||At===Kr.Tilt?_.style.cursor="grab":_.style.cursor="pointer")},it=()=>{le(null),_.style.cursor="default"},Ve=m.useMemo(()=>Ei(new Date(R),M),[R,M]),yt=m.useMemo(()=>{var Ht;return(Ht=k(x))==null?void 0:Ht.rotation[2]},[x]),ct=yt?Ve.clone().applyAxisAngle(Io,-yt):Ve,Xe=m.useMemo(()=>Ve.z>0?new nn(0,Math.atan2(ct.x,ct.z),0,"ZXY"):new nn(d,0,f,"ZXY"),[Ve,d,f,ct.x,ct.z]),ut=m.useMemo(()=>{if(Ve.z>0){const Ht=yt?Math.cos(yt):1,At=yt?Math.sin(yt):0;return-Be*(Ve.x*At+Ve.y*Ht)/Math.hypot(Ve.x,Ve.z)}return 0},[Ve,yt,Be]),ft=new ie(0,ut,Be).applyEuler(Xe),ot=Ve.clone().multiplyScalar(He).applyEuler(new nn(-ke.x,0,-ke.z)),st=-(Me+l)/2,at=m.useMemo(()=>{const Ht=[],At=Math.cos(f)*p,kt=Math.sin(f)*p,gt=q/2-.5;for(let dt=0;dt{const Ht=[],At=a/q,kt=-i/u,gt=-2*kt/Se;for(let dt=0;dt<=q;dt++){const Ct=[];for(let tt=0;tt<=Se;tt++){const Fe=kt+tt*gt;Ct.push(new ie(u*Fe/2,-Ae+dt*At,u*Fe*Fe/4))}Ht.push({points:Ct})}return Ht},[i,a,q,u]),Ze=Math.max(1,(i+a)/16),St=Vx*Ze*1.5,Pt=c1*Ze*2,Rt=D.length<50&&Oe.length<10,Ut=Rt?4:2;return h.jsxs("group",{name:"Parabolic Trough Group "+e,rotation:ke,position:[ye,ce,pe+Te],children:[h.jsxs("group",{rotation:Xe,children:[h.jsx(FTe,{receiveShadow:L,castShadow:L,uuid:e,ref:se,args:[u/2,i,a,Se,4],name:"Parabolic Trough Front Side",onPointerDown:Ht=>{Ht.button!==2&&N(e,Ht,Oo.Select)},onContextMenu:Ht=>{N(e,Ht,Oo.ContextMenu),S(At=>{Ht.intersections.length>0&&Ht.intersections[0].object===se.current&&(At.contextMenuObjectType=z.ParabolicTrough)})},onPointerOver:Ht=>{Ht.intersections.length>0&&Ht.intersections[0].object===se.current&&($(!0),_.style.cursor="move")},onPointerOut:()=>{$(!1),_.style.cursor="default"},children:E&&re?h.jsx("meshBasicMaterial",{attach:"material",side:Ra,map:re}):h.jsx("meshPhongMaterial",{attach:"material",specular:new rr("white"),shininess:100*s,side:Ra,color:"lightskyblue"})}),h.jsx(FTe,{receiveShadow:L,castShadow:L,uuid:e+" backside",ref:ne,args:[u/2,i,a,Se,4],name:"Parabolic Trough Back Side",position:[0,0,-Te/2],onPointerDown:Ht=>{Ht.button!==2&&N(e,Ht,Oo.Select)},onContextMenu:Ht=>{N(e,Ht,Oo.ContextMenu),S(At=>{Ht.intersections.length>0&&Ht.intersections[0].object===ne.current&&(At.contextMenuObjectType=z.ParabolicTrough)})},onPointerOver:Ht=>{Ht.intersections.length>0&&Ht.intersections[0].object===ne.current&&($(!0),_.style.cursor="move")},onPointerOut:()=>{$(!1),_.style.cursor="default"},children:h.jsx("meshStandardMaterial",{attach:"material",side:p0,color:"white"})}),Oe&&Oe.map((Ht,At)=>h.jsxs(be.Fragment,{children:[Rt&&h.jsx(jn,{name:"Parabolic Trough Rim Lines",userData:{unintersectable:!0},points:Ht.points,castShadow:!1,receiveShadow:!1,lineWidth:v,color:P}),(At===0||At===Oe.length-1||Rt)&&h.jsx(jn,{name:"Parabolic Trough Focal Lines",userData:{unintersectable:!0},points:[Ht.points[Se/2].clone(),Ht.points[Se/2].clone().add(new ie(0,0,Be))],castShadow:!1,receiveShadow:!1,lineWidth:v,color:ze?"dimgray":"white"})]},At)),Rt&&h.jsx(jn,{name:"Parabolic Trough Outline 1",userData:{unintersectable:!0},points:[[-ve,-Ae,Ee],[-ve,Ae,Ee]],castShadow:!1,receiveShadow:!1,lineWidth:v,color:P}),Rt&&h.jsx(jn,{name:"Parabolic Trough Outline 2",userData:{unintersectable:!0},points:[[ve,-Ae,Ee],[ve,Ae,Ee]],castShadow:!1,receiveShadow:!1,lineWidth:v,color:P}),h.jsx(ca,{name:"Parabolic Trough Absorber Tube",uuid:e,args:[c,c,a,Rt?6:2,1],position:[0,0,Be],receiveShadow:!1,castShadow:!0,children:h.jsx("meshStandardMaterial",{attach:"material",color:"white"})}),h.jsx(ua,{name:"Parabolic Trough Simulation Plane",uuid:e,args:[i,a],position:[0,0,Ee],userData:{simulation:!0},receiveShadow:!1,castShadow:!1,visible:!1,children:h.jsx("meshBasicMaterial",{side:$r})}),B&&A&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-ve,-Ae,Ee],[-ve,Ae,Ee],[ve,Ae,Ee],[ve,-Ae,Ee],[-ve,-Ae,Ee]],castShadow:!1,receiveShadow:!1,lineWidth:1,color:y0}),B&&!A&&h.jsxs(h.Fragment,{children:[h.jsx(ds,{ref:fe,position:new ie(0,0,0),args:[Pt,6,6],name:Ho.Default,onPointerOver:Ht=>{Ye(Ht,Ho.Top)},onPointerOut:()=>{it()},onPointerDown:Ht=>{Ht.button!==2&&N(e,Ht,Oo.Move)},children:h.jsx("meshBasicMaterial",{attach:"material",color:"orange"})}),h.jsxs("group",{children:[h.jsx(Qr,{ref:ge,position:[(Je.x+Ke.x)/2,Je.y,Je.z-Ee],args:[St,St,l*1.2],name:vt.Lower,onPointerDown:Ht=>{N(e,Ht,Oo.Resize),Z.current&&S(At=>{const kt=ge.current.localToWorld(new ie(0,a,-Je.z));At.resizeAnchor.copy(kt)})},onPointerOver:Ht=>{Ye(Ht,vt.Lower)},onPointerOut:()=>{it()},children:h.jsx("meshBasicMaterial",{attach:"material",color:Q===vt.Lower||U===vt.Lower?ta:Da})}),h.jsx(Qr,{ref:de,position:[(We.x+Ne.x)/2,We.y,We.z-Ee],args:[St,St,l*1.2],name:vt.Upper,onPointerDown:Ht=>{N(e,Ht,Oo.Resize),Z.current&&S(At=>{const kt=de.current.localToWorld(new ie(0,-a,-We.z));At.resizeAnchor.copy(kt)})},onPointerOver:Ht=>{Ye(Ht,vt.Upper)},onPointerOut:()=>{it()},children:h.jsx("meshBasicMaterial",{attach:"material",color:Q===vt.Upper||U===vt.Upper?ta:Da})}),h.jsx(Qr,{ref:Z,position:[Je.x,(Je.y+We.y)/2,Je.z],args:[St,St,l*1.2],name:vt.Left,onPointerDown:Ht=>{N(e,Ht,Oo.Resize),Z.current&&S(At=>{const kt=Z.current.localToWorld(new ie(i,0,-Je.z));At.resizeAnchor.copy(kt)})},onPointerOver:Ht=>{Ye(Ht,vt.Left)},onPointerOut:()=>{it()},children:h.jsx("meshBasicMaterial",{attach:"material",color:Q===vt.Left||U===vt.Left?ta:Da})}),h.jsx(Qr,{ref:he,position:[Ke.x,(Ke.y+Ne.y)/2,Ke.z],args:[St,St,l*1.2],name:vt.Right,onPointerDown:Ht=>{N(e,Ht,Oo.Resize),Z.current&&S(At=>{const kt=he.current.localToWorld(new ie(-i,0,-Ke.z));At.resizeAnchor.copy(kt)})},onPointerOver:Ht=>{Ye(Ht,vt.Right)},onPointerOut:()=>{it()},children:h.jsx("meshBasicMaterial",{attach:"material",color:Q===vt.Right||U===vt.Right?ta:Da})})]})]})]}),Me>0&&at.map((Ht,At)=>At%5!==0&&!Rt?h.jsx(be.Fragment,{},At):h.jsx(ca,{userData:{unintersectable:!0},name:"Pole "+At,castShadow:!1,receiveShadow:!1,args:[y,y,Me+(Ht.z-st)*2+l,Ut,1],position:Ht,rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:C})},At)),w&&Ve.z>0&&h.jsx(jn,{userData:{unintersectable:!0},points:[ft,new ie(-.3*ve,0,.09*Ee).applyEuler(Xe),ot,new ie(-.6*ve,0,.36*Ee).applyEuler(Xe),ft,new ie(-.9*ve,0,.81*Ee).applyEuler(Xe),ot,new ie(0,0,0),ft,new ie(.3*ve,0,.09*Ee).applyEuler(Xe),ot,new ie(.6*ve,0,.36*Ee).applyEuler(Xe),ft,new ie(.9*ve,0,.81*Ee).applyEuler(Xe),ot],name:"Sun Beams",lineWidth:.25,color:"white"}),(X||T)&&!B&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:De,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,(t==null?void 0:t.labelHeight)??Math.max(Ae*Math.abs(Math.sin(t.tiltAngle))+.1,.2)]})]})}),etn=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i,ly:a,lz:l=.1,reflectance:s=.9,structureType:c=uf.CentralPole,receiverRadius:u=.25,receiverPoleRadius:d=.1,latusRectum:f=2,tiltAngle:p,relativeAzimuth:g,poleHeight:y,poleRadius:w=.2,drawSunBeam:b,rotation:C=[0,0,0],color:P="white",lineColor:v="black",lineWidth:T=.25,showLabel:A=!1,locked:x=!1,parentId:S}=t,R=H(fn),M=H(rl),D=H(Tc),E=H(Kn),W=ht(Ss),j=H(Cf),L=Tn(u1),k=H(Ds),N=H(Gn),F=H(Y0),U=H(Ug),O=H(d1),B=H(Dw),_=Es(e),{gl:{domElement:X}}=oi(),[$,Q]=m.useState(!1),[le,q]=m.useState(null),[te,re]=m.useState(null),ae=m.useRef(null),se=m.useRef(null),ne=m.useRef(null),fe=m.useRef(null),ge=m.useRef(null),de=m.useRef(null),Z=m.useRef(null),he=m.useRef(!1),xe=Math.max(100,10*U),He=32,Se=8,ze=B.z<=0;let Ie=n,ye=o,ce=r;const pe=i/2,ve=a/2,Ae=l/2,Te=y+pe,Me=Jt(),Pe=H(At=>{for(const kt of At.elements)if(kt.id===S)return kt});if(S&&Pe)switch(Pe.type){case z.Foundation:if(ce=Te+Ae+Pe.lz,me.isZero(C[2]))Ie=Pe.cx+n*Pe.lx,ye=Pe.cy+o*Pe.ly;else{const At=new ie(n*Pe.lx,o*Pe.ly,0);At.applyAxisAngle(Io,C[2]),Ie=Pe.cx+At.x,ye=Pe.cy+At.y}break}const Ee=pe*pe/f,Be=.25*f,Je=new ie(-pe,-ve,Ae+Ee),We=new ie(-pe,ve,Ae+Ee),Ke=new ie(pe,-ve,Ae+Ee),Ne=new ie(pe,ve,Ae+Ee),De=bb(Yye),ke=u+1;m.useEffect(()=>{if(t&&W){const At=L(t.id);At&&re(me.fetchHeatmapTexture(At,j??5))}},[W,j]),m.useEffect(()=>{const At=()=>{Fn.getState().setEnableOrbitController(!0),he.current=!1};return window.addEventListener("pointerup",At),()=>{window.removeEventListener("pointerup",At)}},[]);const Ye=m.useMemo(()=>(t!=null&&t.label?t.label:Y.t("shared.ParabolicDishElement",Me))+(t!=null&&t.locked?" ("+Y.t("shared.ElementLocked",Me)+")":"")+(t!=null&&t.label?"":` +`+Y.t("word.Coordinates",Me)+": ("+Ie.toFixed(1)+", "+ye.toFixed(1)+", "+ce.toFixed(1)+") "+Y.t("word.MeterAbbreviation",Me)),[t==null?void 0:t.label,t==null?void 0:t.locked,Me,Ie,ye,ce]),it=m.useMemo(()=>new nn(0,0,C[2],"ZXY"),[C]),Ve=(At,kt)=>{At.intersections.length>0&&At.intersections[0].object===At.eventObject&&(q(kt),kt===Ho.Top?X.style.cursor="move":kt===Kr.Lower||kt===Kr.Upper||kt===Kr.Tilt?X.style.cursor="grab":X.style.cursor="pointer")},yt=()=>{q(null),X.style.cursor="default"},ct=m.useMemo(()=>Ei(new Date(M),D),[M,D]),Xe=m.useMemo(()=>{var At;return(At=N(S))==null?void 0:At.rotation[2]},[S]),ut=Xe?ct.clone().applyAxisAngle(Io,-Xe):ct,ft=m.useMemo(()=>{if(ct.z>0){const At=Math.hypot(ut.x,ut.y);return new nn(Math.atan2(At,ut.z),0,Math.atan2(ut.y,ut.x)+Gt,"ZXY")}return new nn(p,0,g,"ZXY")},[ct,p,g,ut.x,ut.y,ut.z]),ot=-(Te+l)/2,st=E.length<50,at=m.useMemo(()=>{const At=[];if(st){const kt=[],gt=[];let dt,Ct,tt;const Fe=.25*Ee;for(let qe=0;qe<=He;qe++)dt=la*qe/He,Ct=Math.cos(dt),tt=Math.sin(dt),kt.push(new ie(pe*Ct,pe*tt,Ee)),gt.push(new ie(pe*Ct/2,pe*tt/2,Fe));At.push({points:kt}),At.push({points:gt});for(let qe=0;qe<12;qe++){dt=la*qe/12,Ct=Math.cos(dt),tt=Math.sin(dt);const je=[];for(let rt=0;rt<=Se;rt++){const mt=rt===0?0:rt/Se*pe;je.push(new ie(mt*Ct,mt*tt,mt*mt/f+.01))}At.push({points:je})}}return At},[pe,f,st]),Oe=m.useMemo(()=>{if(c===uf.CentralPoleWithTripod){const At=[];let kt;for(let gt=0;gt<3;gt++){kt=la*gt/3;const dt=[];dt.push(new ie(pe*Math.cos(kt),pe*Math.sin(kt),Ee)),dt.push(new ie(0,0,Be)),At.push({points:dt})}return At}},[pe,f,c]),Ze=m.useMemo(()=>{if(c===uf.Quadrupod){const At=[];let kt;for(let gt=0;gt<4;gt++){kt=la*gt/4;const dt=[];dt.push(new ie(pe*Math.cos(kt),pe*Math.sin(kt),Ee)),dt.push(new ie(0,0,Be)),At.push({points:dt})}return At}},[pe,f,c]),St=Math.max(1,(i+a)/16),Pt=Vx*St*1.5,Rt=c1*St*3,Ut=ct.clone().multiplyScalar(xe),Ht=new ie(0,0,Be).applyEuler(ft);return h.jsxs("group",{name:"Parabolic Dish Group "+e,rotation:it,position:[Ie,ye,ce+Ae],children:[h.jsxs("group",{rotation:ft,children:[h.jsx(kTe,{receiveShadow:k,castShadow:k,uuid:e,ref:ae,args:[f/2,pe,He,Se],name:"Parabolic Dish Front Side",onPointerDown:At=>{At.button!==2&&F(e,At,Oo.Select)},onContextMenu:At=>{F(e,At,Oo.ContextMenu),R(kt=>{At.intersections.length>0&&At.intersections[0].object===ae.current&&(kt.contextMenuObjectType=z.ParabolicDish)})},onPointerOver:At=>{At.intersections.length>0&&At.intersections[0].object===ae.current&&(Q(!0),X.style.cursor="move")},onPointerOut:()=>{Q(!1),X.style.cursor="default"},children:W&&te?h.jsx("meshBasicMaterial",{attach:"material",side:Ra,map:te}):h.jsx("meshPhongMaterial",{attach:"material",specular:new rr("white"),shininess:100*s,side:Ra,color:"lightskyblue"})}),h.jsx(kTe,{receiveShadow:k,castShadow:k,uuid:e+" backside",ref:se,args:[f/2,pe,He,Se],name:"Parabolic Dish Back Side",position:[0,0,-Ae/4],onPointerDown:At=>{At.button!==2&&F(e,At,Oo.Select)},onContextMenu:At=>{F(e,At,Oo.ContextMenu),R(kt=>{At.intersections.length>0&&At.intersections[0].object===se.current&&(kt.contextMenuObjectType=z.ParabolicDish)})},onPointerOver:At=>{At.intersections.length>0&&At.intersections[0].object===se.current&&(Q(!0),X.style.cursor="move")},onPointerOut:()=>{Q(!1),X.style.cursor="default"},children:h.jsx("meshStandardMaterial",{attach:"material",side:p0,color:P})}),at&&at.length>0&&at.map((At,kt)=>h.jsx(be.Fragment,{children:h.jsx(jn,{name:"Parabolic Dish Wireframe",userData:{unintersectable:!0},points:At.points,castShadow:!1,receiveShadow:!1,lineWidth:T,color:v})},kt)),h.jsx(ca,{name:"Parabolic Dish Receiver",uuid:e,args:[u,u,.5,st?12:4,1],rotation:[Gt,0,0],position:[0,0,Be-.1],receiveShadow:!1,castShadow:!0,children:h.jsx("meshStandardMaterial",{attach:"material",color:P})}),ct.z>0&&h.jsx("mesh",{position:[0,0,Be-.1],children:h.jsx("sprite",{scale:[ke,ke,ke],children:h.jsx("spriteMaterial",{map:De,transparent:!1,color:16777215,blending:nR,depthWrite:!1})})}),(c===uf.CentralPole||c===uf.CentralPoleWithTripod)&&h.jsx(ca,{name:"Parabolic Dish Receiver Pole",uuid:e,args:[d,d,Be,st?6:2,1],rotation:[Gt,0,0],position:[0,0,Be/2],receiveShadow:!1,castShadow:!0,children:h.jsx("meshStandardMaterial",{attach:"material",color:P})}),c===uf.CentralPoleWithTripod&&Oe&&Oe.map((At,kt)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{name:"Parabolic Dish Tripod Lines",userData:{unintersectable:!0},points:At.points,castShadow:!1,receiveShadow:!1,lineWidth:1,color:ze?"dimgray":P}),h.jsx(ds,{position:new ie(At.points[0].x,At.points[0].y,At.points[0].z),args:[d/2,4,4],name:"Parabolic Dish Tripod Joint",children:h.jsx("meshStandardMaterial",{attach:"material",color:P})})]},kt)),c===uf.Quadrupod&&Ze&&Ze.map((At,kt)=>h.jsxs(be.Fragment,{children:[h.jsx(jn,{name:"Parabolic Dish Quadrupod Lines",userData:{unintersectable:!0},points:At.points,castShadow:!1,receiveShadow:!1,lineWidth:2,color:ze?"dimgray":P}),h.jsx(ds,{position:new ie(At.points[0].x,At.points[0].y,At.points[0].z),args:[d/2,4,4],name:"Parabolic Dish Quadrupod Joint",children:h.jsx("meshStandardMaterial",{attach:"material",color:P})})]},kt)),h.jsx(lR,{name:"Parabolic Dish Simulation Circle",uuid:e,args:[i/2,He],position:[0,0,Ee],userData:{simulation:!0},receiveShadow:!1,castShadow:!1,visible:!1,children:h.jsx("meshBasicMaterial",{side:$r})}),_&&x&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-pe,-ve,Ee],[-pe,ve,Ee],[pe,ve,Ee],[pe,-ve,Ee],[-pe,-ve,Ee]],castShadow:!1,receiveShadow:!1,lineWidth:1,color:y0}),_&&!x&&h.jsxs(h.Fragment,{children:[h.jsx(ds,{ref:ne,position:new ie(0,0,0),args:[Rt,6,6],name:Ho.Default,onPointerOver:At=>{Ve(At,Ho.Top)},onPointerOut:()=>{yt()},onPointerDown:At=>{At.button!==2&&F(e,At,Oo.Move)},children:h.jsx("meshBasicMaterial",{attach:"material",color:"orange"})}),h.jsxs("group",{children:[h.jsx(Qr,{ref:fe,position:[(Je.x+Ke.x)/2,Je.y,Je.z],args:[Pt,Pt,l*1.2],name:vt.Lower,onPointerDown:At=>{F(e,At,Oo.Resize),de.current&&R(kt=>{const gt=fe.current.localToWorld(new ie(0,a,-Je.z));kt.resizeAnchor.copy(gt)})},onPointerOver:At=>{Ve(At,vt.Lower)},onPointerOut:()=>{yt()},children:h.jsx("meshBasicMaterial",{attach:"material",color:le===vt.Lower||O===vt.Lower?ta:Da})}),h.jsx(Qr,{ref:ge,position:[(We.x+Ne.x)/2,We.y,We.z],args:[Pt,Pt,l*1.2],name:vt.Upper,onPointerDown:At=>{F(e,At,Oo.Resize),de.current&&R(kt=>{const gt=ge.current.localToWorld(new ie(0,-a,-We.z));kt.resizeAnchor.copy(gt)})},onPointerOver:At=>{Ve(At,vt.Upper)},onPointerOut:()=>{yt()},children:h.jsx("meshBasicMaterial",{attach:"material",color:le===vt.Upper||O===vt.Upper?ta:Da})}),h.jsx(Qr,{ref:de,position:[Je.x,(Je.y+We.y)/2,Je.z],args:[Pt,Pt,l*1.2],name:vt.Left,onPointerDown:At=>{F(e,At,Oo.Resize),de.current&&R(kt=>{const gt=de.current.localToWorld(new ie(i,0,-Je.z));kt.resizeAnchor.copy(gt)})},onPointerOver:At=>{Ve(At,vt.Left)},onPointerOut:()=>{yt()},children:h.jsx("meshBasicMaterial",{attach:"material",color:le===vt.Left||O===vt.Left?ta:Da})}),h.jsx(Qr,{ref:Z,position:[Ke.x,(Ke.y+Ne.y)/2,Ke.z],args:[Pt,Pt,l*1.2],name:vt.Right,onPointerDown:At=>{F(e,At,Oo.Resize),de.current&&R(kt=>{const gt=Z.current.localToWorld(new ie(-i,0,-Ke.z));kt.resizeAnchor.copy(gt)})},onPointerOver:At=>{Ve(At,vt.Right)},onPointerOut:()=>{yt()},children:h.jsx("meshBasicMaterial",{attach:"material",color:le===vt.Right||O===vt.Right?ta:Da})})]})]})]}),Te>0&&h.jsx(ca,{userData:{unintersectable:!0},name:"Pole",castShadow:!1,receiveShadow:!1,args:[w,w,Te+l,st?4:2,1],position:[0,0,ot],rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:P})}),b&&ct.z>0&&h.jsx(jn,{rotation:[-it.x,0,-it.z],userData:{unintersectable:!0},points:[Ht,new ie(-.3*pe,0,.09*Ee).applyEuler(ft),Ut,new ie(-.6*pe,0,.36*Ee).applyEuler(ft),Ht,new ie(-.9*pe,0,.81*Ee).applyEuler(ft),Ut,Ht,new ie(.3*pe,0,.09*Ee).applyEuler(ft),Ut,new ie(.6*pe,0,.36*Ee).applyEuler(ft),Ht,new ie(.9*pe,0,.81*Ee).applyEuler(ft),Ut],name:"Sun Beams",lineWidth:.25,color:"white"}),($||A)&&!_&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:Ye,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,(t==null?void 0:t.labelHeight)??Math.max(ve*Math.abs(Math.sin(t.tiltAngle))+.1,.2)]})]})}),ttn=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i,ly:a,lz:l=.1,reflectance:s=.9,tiltAngle:c,relativeAzimuth:u,moduleLength:d,poleHeight:f,poleRadius:p=.1,drawSunBeam:g,rotation:y=[0,0,0],color:w="white",lineColor:b="black",lineWidth:C=.5,showLabel:P=!1,locked:v=!1,parentId:T,receiverId:A}=t,x=H(fn),S=H(s0),R=H(rl),M=H(Tc),D=H(Kn),E=ht(Ss),W=H(Cf),j=Tn(u1),L=H(Ds),k=H(Gn),N=H(Y0),F=H(Ug),U=H(d1),O=Es(e),{gl:{domElement:B}}=oi(),[_,X]=m.useState(!1),[$,Q]=m.useState(null),[le,q]=m.useState(1),[te,re]=m.useState(null),ae=m.useRef(null),se=m.useRef(null),ne=m.useRef(null),fe=m.useRef(null),ge=m.useRef(null),de=m.useRef(null),Z=m.useRef(!1),he=Math.max(100,10*F),xe=m.useMemo(()=>({lng:S}),[S]);let He=n,Se=o,ze=r;const Ie=i/2,ye=a/2,ce=l/2,pe=f+Ie,ve=H(ot=>{for(const st of ot.elements)if(st.id===T)return st});if(ve)switch(ve.type){case z.Foundation:if(ze=pe+ce+ve.lz,me.isZero(y[2]))He=ve.cx+n*ve.lx,Se=ve.cy+o*ve.ly;else{const ot=new ie(n*ve.lx,o*ve.ly,0);ot.applyAxisAngle(Io,y[2]),He=ve.cx+ot.x,Se=ve.cy+ot.y}break}const Ae=new ie(-Ie,-ye,ce),Te=new ie(-Ie,ye,ce),Me=new ie(Ie,-ye,ce),Pe=new ie(Ie,ye,ce);m.useEffect(()=>{if(t&&E){const ot=j(t.id);ot&&re(me.fetchHeatmapTexture(ot,W??5))}},[E,W]),m.useEffect(()=>{q(Math.max(1,Math.round(a/d)))},[a,d]),m.useEffect(()=>{const ot=()=>{Fn.getState().setEnableOrbitController(!0),Z.current=!1};return window.addEventListener("pointerup",ot),()=>{window.removeEventListener("pointerup",ot)}},[]);const Ee=m.useMemo(()=>(t!=null&&t.label?t.label:Y.t("shared.FresnelReflectorElement",xe))+(t!=null&&t.locked?" ("+Y.t("shared.ElementLocked",xe)+")":"")+(t!=null&&t.label?"":` `+Y.t("word.Coordinates",xe)+": ("+He.toFixed(1)+", "+Se.toFixed(1)+", "+ze.toFixed(1)+") "+Y.t("word.MeterAbbreviation",xe)),[t==null?void 0:t.label,t==null?void 0:t.locked,xe,He,Se,ze]),Be=m.useMemo(()=>new nn(0,0,y[2],"ZXY"),[y]),Je=(ot,st)=>{ot.intersections.length>0&&ot.intersections[0].object===ot.eventObject&&(Q(st),st===Ho.Top?B.style.cursor="move":st===Kr.Lower||st===Kr.Upper||st===Kr.Tilt?B.style.cursor="grab":B.style.cursor="pointer")},We=()=>{Q(null),B.style.cursor="default"},Ke=m.useMemo(()=>Ei(new Date(R),M),[R,M]),Ne=ve==null?void 0:ve.rotation[2],De=A&&A!==T?k(A):null,ke=m.useMemo(()=>{if(De){if(De.type===z.Foundation){const ot=De;if(ot.solarStructure===Dn.FocusPipe&&ot.solarAbsorberPipe)return new ie((ot.cx-He)*(Ne?Math.cos(Ne):1),(ot.cy-Se)*(Ne?Math.sin(Ne):0),ot.cz-ze+ot.lz/2+(ot.solarAbsorberPipe.absorberHeight??10))}}else if(ve&&ve.type===z.Foundation){const ot=ve;if(ot.solarStructure===Dn.FocusPipe&&ot.solarAbsorberPipe)return new ie((ot.cx-He)*(Ne?Math.cos(Ne):1),(ot.cy-Se)*(Ne?Math.sin(Ne):0),ot.cz-ze+ot.lz/2+(ot.solarAbsorberPipe.absorberHeight??10))}return null},[De,ve,He,Se,ze,Ne]),Ye=m.useRef(new ie),it=m.useMemo(()=>{if(ke&&Ke.z>0){const ot=Ne?new ie(Math.sin(Ne),Math.cos(Ne),0):new ie(0,1,0);Ye.current.set(ke.x,ke.y,ke.z);const st=Ke.z{const ot=[],st=Math.cos(u)*d,at=Math.sin(u)*d,Oe=le/2-.5;for(let Ze=0;Ze{const ot=[],st=a/le;for(let at=0;at<=le;at++){const Oe=[];Oe.push(new ie(-Ie,-ye+at*st,ce)),Oe.push(new ie(Ie,-ye+at*st,ce)),ot.push({points:Oe})}return ot},[i,a,ce,le]),Xe=Math.max(1,Math.min(i*5,a*5,(i+a)/16)),ut=Vx*Xe*1.5,ft=c1*Xe*2;return h.jsxs("group",{name:"Fresnel Reflector Group "+e,rotation:Be,position:[He,Se,ze+ce],children:[h.jsxs("group",{rotation:it,children:[h.jsxs(Qr,{receiveShadow:L,castShadow:L,uuid:e,ref:ae,args:[i,a,l],name:"Fresnel Reflector",onPointerDown:ot=>{ot.button!==2&&N(e,ot,Oo.Select)},onContextMenu:ot=>{N(e,ot,Oo.ContextMenu),x(st=>{ot.intersections.length>0&&ot.intersections[0].object===ae.current&&(st.contextMenuObjectType=z.FresnelReflector)})},onPointerOver:ot=>{ot.intersections.length>0&&ot.intersections[0].object===ae.current&&(X(!0),B.style.cursor="move")},onPointerOut:()=>{X(!1),B.style.cursor="default"},children:[h.jsx("meshStandardMaterial",{attach:"material-0",color:w}),h.jsx("meshStandardMaterial",{attach:"material-1",color:w}),h.jsx("meshStandardMaterial",{attach:"material-2",color:w}),h.jsx("meshStandardMaterial",{attach:"material-3",color:w}),E&&te?h.jsx("meshBasicMaterial",{attach:"material-4",side:Ra,map:te}):h.jsx("meshPhongMaterial",{attach:"material-4",specular:new rr("white"),shininess:100*s,side:Ra,color:"lightskyblue"}),h.jsx("meshStandardMaterial",{attach:"material-5",color:w})]}),ct&&ct.map((ot,st)=>h.jsx(jn,{name:"Fresnel Reflector Module Line",userData:{unintersectable:!0},points:ot.points,castShadow:!1,receiveShadow:!1,lineWidth:C,color:b},st)),h.jsx(jn,{name:"Fresnel Reflector Outline 1",userData:{unintersectable:!0},points:[[-Ie,-ye,ce],[-Ie,ye,ce]],castShadow:!1,receiveShadow:!1,lineWidth:C,color:b}),h.jsx(jn,{name:"Fresnel Reflector Outline 2",userData:{unintersectable:!0},points:[[Ie,-ye,ce],[Ie,ye,ce]],castShadow:!1,receiveShadow:!1,lineWidth:C,color:b}),h.jsx(ua,{name:"Fresnel Reflector Simulation Plane",uuid:e,args:[i,a],position:[0,0,ce],userData:{simulation:!0},receiveShadow:!1,castShadow:!1,visible:!1,children:h.jsx("meshBasicMaterial",{side:$r})}),O&&v&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-Ie,-ye,ce],[-Ie,ye,ce],[Ie,ye,ce],[Ie,-ye,ce],[-Ie,-ye,ce]],castShadow:!1,receiveShadow:!1,lineWidth:1,color:y0}),O&&!v&&h.jsxs(h.Fragment,{children:[h.jsx(ds,{ref:se,position:new ie(0,0,0),args:[ft,6,6],name:Ho.Default,castShadow:!1,receiveShadow:!1,onPointerOver:ot=>{Je(ot,Ho.Top)},onPointerOut:()=>{We()},onPointerDown:ot=>{ot.button!==2&&N(e,ot,Oo.Move)},children:h.jsx("meshBasicMaterial",{attach:"material",color:"orange"})}),h.jsxs("group",{children:[h.jsx(Qr,{ref:ne,position:[(Ae.x+Me.x)/2,Ae.y,Ae.z-ce],args:[ut,ut,l*1.2],name:vt.Lower,castShadow:!1,receiveShadow:!1,onPointerDown:ot=>{N(e,ot,Oo.Resize),ge.current&&x(st=>{const at=ne.current.localToWorld(new ie(0,a,-Ae.z));st.resizeAnchor.copy(at)})},onPointerOver:ot=>{Je(ot,vt.Lower)},onPointerOut:()=>{We()},children:h.jsx("meshBasicMaterial",{attach:"material",color:$===vt.Lower||U===vt.Lower?ta:Da})}),h.jsx(Qr,{ref:fe,position:[(Te.x+Pe.x)/2,Te.y,Te.z-ce],args:[ut,ut,l*1.2],name:vt.Upper,castShadow:!1,receiveShadow:!1,onPointerDown:ot=>{N(e,ot,Oo.Resize),ge.current&&x(st=>{const at=fe.current.localToWorld(new ie(0,-a,-Te.z));st.resizeAnchor.copy(at)})},onPointerOver:ot=>{Je(ot,vt.Upper)},onPointerOut:()=>{We()},children:h.jsx("meshBasicMaterial",{attach:"material",color:$===vt.Upper||U===vt.Upper?ta:Da})}),h.jsx(Qr,{ref:ge,position:[Ae.x,(Ae.y+Te.y)/2,Ae.z],args:[ut,ut,l*1.2],name:vt.Left,castShadow:!1,receiveShadow:!1,onPointerDown:ot=>{N(e,ot,Oo.Resize),ge.current&&x(st=>{const at=ge.current.localToWorld(new ie(i,0,-Ae.z));st.resizeAnchor.copy(at)})},onPointerOver:ot=>{Je(ot,vt.Left)},onPointerOut:()=>{We()},children:h.jsx("meshBasicMaterial",{attach:"material",color:$===vt.Left||U===vt.Left?ta:Da})}),h.jsx(Qr,{ref:de,position:[Me.x,(Me.y+Pe.y)/2,Me.z],args:[ut,ut,l*1.2],name:vt.Right,castShadow:!1,receiveShadow:!1,onPointerDown:ot=>{N(e,ot,Oo.Resize),ge.current&&x(st=>{const at=de.current.localToWorld(new ie(-i,0,-Me.z));st.resizeAnchor.copy(at)})},onPointerOver:ot=>{Je(ot,vt.Right)},onPointerOut:()=>{We()},children:h.jsx("meshBasicMaterial",{attach:"material",color:$===vt.Right||U===vt.Right?ta:Da})})]})]})]}),pe>0&&yt.map((ot,st)=>{const at=D.length<100?4:2;return h.jsx(ca,{userData:{unintersectable:!0},name:"Pole "+st,castShadow:!1,receiveShadow:!1,args:[p,p,pe+(ot.z-Ve)*2+l,at,1],position:ot,rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:w})},st)}),g&&Ke.z>0&&h.jsx(jn,{rotation:[-Be.x,0,-Be.z],userData:{unintersectable:!0},points:ke?[Ye.current,new ie(0,0,ce),Ke.clone().multiplyScalar(he)]:[new ie(0,0,ce),Ke.clone().multiplyScalar(he)],name:"Sun Beam",lineWidth:.25,color:"white",castShadow:!1,receiveShadow:!1}),(_||P)&&!O&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:Ee,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,castShadow:!1,receiveShadow:!1,position:[0,0,(t==null?void 0:t.labelHeight)??Math.max(ye*Math.abs(Math.sin(t.tiltAngle))+.1,.2)]})]})}),ntn=be.memo(t=>{const{id:e,cx:n,cy:o,cz:r,lx:i,ly:a,lz:l=.1,reflectance:s=.9,tiltAngle:c,relativeAzimuth:u,poleHeight:d,poleRadius:f=Math.min(i,a)/20,drawSunBeam:p,rotation:g=[0,0,0],color:y="white",lineColor:w="black",lineWidth:b=.5,showLabel:C=!1,locked:P=!1,parentId:v,towerId:T}=t,A=H(fn),x=H(rl),S=H(Tc),R=H(Kn),M=ht(Ss),D=H(Cf),E=Tn(u1),W=H(Ds),j=H(Gn),L=H(Y0),k=H(Ug),N=Es(e),{gl:{domElement:F}}=oi(),[U,O]=m.useState(!1),[B,_]=m.useState(null),X=m.useRef(null),$=m.useRef(null),Q=m.useRef(!1),le=Math.max(100,10*k),q=Jt();let te=n,re=o,ae=r;const se=i/2,ne=a/2,fe=l/2,ge=d+Math.max(se,ne),de=H(Te=>{for(const Me of Te.elements)if(Me.id===v)return Me});if(de)switch(de.type){case z.Foundation:if(ae=ge+fe+de.lz,me.isZero(g[2]))te=de.cx+n*de.lx,re=de.cy+o*de.ly;else{const Te=new ie(n*de.lx,o*de.ly,0);Te.applyAxisAngle(Io,g[2]),te=de.cx+Te.x,re=de.cy+Te.y}break}m.useEffect(()=>{if(t&&M){const Te=E(t.id);Te&&_(me.fetchHeatmapTexture(Te,D??5))}},[M,D]),m.useEffect(()=>{const Te=()=>{Fn.getState().setEnableOrbitController(!0),Q.current=!1};return window.addEventListener("pointerup",Te),()=>{window.removeEventListener("pointerup",Te)}},[]);const Z=m.useMemo(()=>(t!=null&&t.label?t.label:Y.t("shared.HeliostatElement",q))+(t!=null&&t.locked?" ("+Y.t("shared.ElementLocked",q)+")":"")+(t!=null&&t.label?"":` -`+Y.t("word.Coordinates",q)+": ("+te.toFixed(1)+", "+re.toFixed(1)+", "+ae.toFixed(1)+") "+Y.t("word.MeterAbbreviation",q)),[t==null?void 0:t.label,t==null?void 0:t.locked,q,te,re,ae]),he=m.useMemo(()=>new nn(0,0,g[2],"ZXY"),[g]),xe=(Te,Me)=>{Te.intersections.length>0&&Te.intersections[0].object===Te.eventObject&&(F.style.cursor=Me===Ho.Default?"move":"pointer")},He=()=>{F.style.cursor="default"},Se=m.useMemo(()=>Ei(new Date(x),S),[x,S]),ze=de==null?void 0:de.rotation[2],Ie=T&&T!==v?j(T):null,ye=m.useMemo(()=>{if(Ie){if(Ie.type===z.Foundation){const Te=Ie;if(Te.solarStructure===Dn.FocusTower&&Te.solarPowerTower)return new ie(Te.cx-te,Te.cy-re,Te.cz-ae+Te.lz/2+(Te.solarPowerTower.towerHeight??20))}}else if(de&&de.type===z.Foundation){const Te=de;if(Te.solarStructure===Dn.FocusTower&&Te.solarPowerTower)return new ie(Te.cx-te,Te.cy-re,Te.cz-ae+Te.lz/2+(Te.solarPowerTower.towerHeight??20))}return null},[de,te,re,ae,Ie]),ce=m.useMemo(()=>{if(ye&&Se.z>0){let Me=ye.clone().normalize().add(Se).normalize();me.isSame(Me,Io)&&(Me=new ie(-.001,0,1).normalize()),ze&&Me.applyAxisAngle(Io,-ze);const Pe=Math.hypot(Me.x,Me.y);return new nn(Math.atan2(Pe,Me.z),0,Math.atan2(Me.y,Me.x)+Gt,"ZXY")}return new nn(c,0,u,"ZXY")},[ye,Se,c,u,ze]),pe=-(ge+l)/2,ve=Math.max(1,(i+a)/8),Ae=c1*ve*4;return h.jsxs("group",{name:"Heliostat Group "+e,rotation:he,position:[te,re,ae+fe],children:[h.jsxs("group",{rotation:ce,children:[h.jsxs(Qr,{receiveShadow:W,castShadow:W,uuid:e,ref:X,args:[i,a,l],name:"Heliostat",onPointerDown:Te=>{Te.button!==2&&L(e,Te,Oo.Select)},onContextMenu:Te=>{L(e,Te,Oo.ContextMenu),A(Me=>{Te.intersections.length>0&&Te.intersections[0].object===X.current&&(Me.contextMenuObjectType=z.Heliostat)})},onPointerOver:Te=>{Te.intersections.length>0&&Te.intersections[0].object===X.current&&(O(!0),F.style.cursor="move")},onPointerOut:()=>{O(!1),F.style.cursor="default"},children:[h.jsx("meshStandardMaterial",{attach:"material-0",color:y}),h.jsx("meshStandardMaterial",{attach:"material-1",color:y}),h.jsx("meshStandardMaterial",{attach:"material-2",color:y}),h.jsx("meshStandardMaterial",{attach:"material-3",color:y}),M&&B?h.jsx("meshBasicMaterial",{attach:"material-4",side:Ra,map:B}):h.jsx("meshPhongMaterial",{attach:"material-4",specular:new rr("white"),shininess:100*s,side:Ra,color:"lightskyblue"}),h.jsx("meshStandardMaterial",{attach:"material-5",color:y})]}),h.jsx(ua,{name:"Heliostat Simulation Plane",uuid:e,args:[i,a],position:[0,0,fe],userData:{simulation:!0},receiveShadow:!1,castShadow:!1,visible:!1,children:h.jsx("meshBasicMaterial",{side:$r})}),N&&P&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-se,-ne,fe],[-se,ne,fe],[se,ne,fe],[se,-ne,fe],[-se,-ne,fe]],castShadow:!1,receiveShadow:!1,lineWidth:1,color:y0}),N&&!P&&h.jsx(ds,{ref:$,position:new ie(0,0,0),args:[Ae,6,6],name:Ho.Default,castShadow:!1,receiveShadow:!1,onPointerOver:Te=>{xe(Te,Ho.Default)},onPointerOut:()=>{He()},onPointerDown:Te=>{Te.button!==2&&L(e,Te,Oo.Move)},children:h.jsx("meshBasicMaterial",{attach:"material",color:"orange"})})]}),ge>0&&h.jsx(ca,{userData:{unintersectable:!0},name:"Pole",castShadow:!1,receiveShadow:!1,args:[f,f,ge+l,R.length<100?4:2,1],position:new ie(0,0,pe),rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:y})}),p&&Se.z>0&&h.jsx(jn,{rotation:[-he.x,0,-he.z],userData:{unintersectable:!0},points:ye?[ye,new ie(0,0,fe),Se.clone().multiplyScalar(le)]:[new ie(0,0,fe),Se.clone().multiplyScalar(le)],name:"Sun Beam",lineWidth:.25,color:"white",castShadow:!1,receiveShadow:!1}),(U||C)&&!N&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:Z,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,castShadow:!1,receiveShadow:!1,position:[0,0,(t==null?void 0:t.labelHeight)??Math.max(ne*Math.abs(Math.sin(t.tiltAngle))+.1,.2)]})]})}),otn=be.memo(t=>{var re;const{parentId:e,id:n,cx:o,cy:r,cz:i,name:a=ro.WhiteFlower,flip:l=!1,locked:s=!1}=t;let c=!1;H(ae=>{if(e===Zo)c=!0;else for(const se of ae.elements)if(se.id===e){c=!0;break}});const u=H(yp);m.useEffect(()=>{c||u(n,!1)},[c]);const d=H(fn),f=H(s0),p=H(Id)??!1,g=H(rl),y=H(Tc),w=H(xge)??Eq,b=H(bge)??Fq,C=H(Y0),P=H(Eb),v=H(ly),T=ht(Ss),[A,x]=m.useState(!1),{gl:S}=oi(),R=Es(n),M=Fn(ae=>ae.contentRef),D=m.useRef(null),E=m.useRef(null),W=m.useRef(null),j=m.useRef(null),L=m.useMemo(()=>({lng:f}),[f]),k=m.useMemo(()=>{const ae=me.dayOfYear(new Date(g));return y>0?aeb:ae>=w&&ae<=b},[g,w,b,y]),N=m.useRef(!1),F=H(zH);F!==N.current&&(N.current=F,M!=null&&M.current&&D.current&&M.current.add(D.current)),m.useEffect(()=>{if(e!==Zo){const ae=Q();ae&&D.current&&ae.add(D.current)}},[F,e]),m.useEffect(()=>{const ae=Q();ae&&D.current&&ae.add(D.current)},[M]);const U=m.useMemo(()=>new df().load(p8.fetchTextureImage(a,k),ae=>{l&&(ae.wrapS=Hs,ae.repeat.x=-1),B(ae)}),[a,k,l]),[O,B]=m.useState(U),_=m.useMemo(()=>p8.fetchLabel(a,L)+(s?" ("+Y.t("shared.ElementLocked",L)+")":"")+` -`+Y.t("word.Coordinates",L)+": ("+o.toFixed(1)+", "+r.toFixed(1)+") "+Y.t("word.MeterAbbreviation",L),[a,o,r,s,L]),X=m.useCallback((ae,se)=>{ht.getState().duringCameraInteraction||ae.intersections.length>0&&(ae.intersections[0].object===ae.eventObject||ae.intersections.length>1&&ae.intersections[1].object===ae.eventObject)&&(d(fe=>{fe.hoveredHandle=se,fe.selectedElementHeight=t.lz}),me.isMoveHandle(se)?S.domElement.style.cursor="move":S.domElement.style.cursor="pointer")},[t.lz]),$=m.useCallback(()=>{d(ae=>{ae.hoveredHandle=null}),S.domElement.style.cursor=H.getState().addedCuboidId?"crosshair":"default"},[]),Q=()=>e!==Zo&&(M!=null&&M.current)?me.getObjectChildById(M.current,e):null,le=m.useMemo(()=>p8.fetchSpread(a),[a]),q=m.useMemo(()=>p8.fetchHeight(a),[a]);ay(({camera:ae})=>{if(D.current){const{rot:se}=me.getWorldDataById(e);if(p)E.current&&j.current&&(E.current.rotation.set(Gt,0,0),j.current.rotation.set(0,0,0)),D.current.rotation.set(-Gt,0,0);else{if(E.current&&j.current){const{x:ne,y:fe}=ae.position,{x:ge,y:de}=D.current.position;if(Q()){const he=D.current.localToWorld(new ie),xe=Math.atan2(ne-he.x,fe-he.y)+se;E.current.rotation.set(Gt,-xe,0),j.current.rotation.set(-Gt,xe,0)}else{const he=Math.atan2(ne-ge,fe-de);E.current.rotation.set(Gt,-he,0),j.current.rotation.set(-Gt,he,0)}}D.current.rotation.set(0,0,0)}}});const te=c1*3;return h.jsx(h.Fragment,{children:c?h.jsx("group",{ref:D,name:"Flower Group "+n,userData:{aabb:!0},position:[o,r,(i??0)+(p?.25:0)],children:h.jsxs("group",{position:[0,0,q/2],children:[h.jsx(PC,{ref:E,uuid:n,name:a,follow:!1,rotation:[Gt,0,0],children:h.jsx(ua,{args:[le,q],receiveShadow:!T,children:h.jsx("meshToonMaterial",{map:O,side:$r,alphaTest:.5})})}),h.jsx(PC,{ref:j,name:"Interaction Billboard",visible:!1,position:[0,0,-q/2],children:h.jsx(ua,{ref:W,renderOrder:3,name:a+" plane",args:[le/2,q*2],rotation:[p?Gt:0,0,0],onContextMenu:ae=>{C(n,ae,Oo.ContextMenu),d(se=>{ae.intersections.length>0&&ae.intersections[0].object===W.current&&(se.contextMenuObjectType=z.Flower)})},onPointerDown:ae=>{ae.button!==2&&ae.eventObject===ae.intersections[0].eventObject&&(C(n,ae,Oo.Move),Fn.setState({flowerRef:D}))},onPointerOver:ae=>{ae.intersections.length>0&&ae.intersections[0].object===W.current&&x(!0)},onPointerOut:()=>{x(!1)}})}),R&&s&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-le/2,-q/2,0],[-le/2,q/2,0],[-le/2,q/2,0],[le/2,q/2,0],[le/2,-q/2,0],[le/2,q/2,0],[le/2,-q/2,0],[-le/2,-q/2,0]],castShadow:!1,receiveShadow:!1,lineWidth:.5,rotation:(re=E.current)==null?void 0:re.rotation,color:y0}),R&&!s&&h.jsx(h.Fragment,{children:h.jsx(ds,{position:new ie(0,0,-q/2),args:[te,6,6,0,Math.PI],name:Ho.Default,renderOrder:2,onPointerDown:ae=>{ae.button!==2&&ae.eventObject===ae.intersections[0].eventObject&&(C(n,ae,Oo.Move),Fn.setState({flowerRef:D}))},onPointerEnter:ae=>{X(ae,Ho.Default)},onPointerLeave:$,children:h.jsx("meshBasicMaterial",{attach:"material",color:v===Ho.Default||P===Ho.Default?ta:tw})})}),A&&!R&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:_,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,q/2+((t==null?void 0:t.labelHeight)??.4)]})]})}):null})});var mde=function(t,e){return mde=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])},mde(t,e)};function Pr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");mde(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var U0=function(){return U0=Object.assign||function(e){for(var n,o=1,r=arguments.length;o0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function rp(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}function yl(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o0?vd(ZH,--ty):0,RR--,lu===10&&(RR=1,zQ--),lu}function W2(){return lu=ty2||Ade(lu)>3?"":" "}function htn(t,e){for(;--e&&W2()&&!(lu<48||lu>102||lu>57&&lu<65||lu>70&&lu<97););return EQ(t,oV()+(e<6&&xx()==32&&W2()==32))}function wde(t){for(;W2();)switch(lu){case t:return ty;case 34:case 39:t!==34&&t!==39&&wde(lu);break;case 40:t===41&&wde(t);break;case 92:W2();break}return ty}function ptn(t,e){for(;W2()&&t+lu!==57;)if(t+lu===84&&xx()===47)break;return"/*"+EQ(e,ty-1)+"*"+Kye(t===47?t:W2())}function gtn(t){for(;!Ade(xx());)W2();return EQ(t,ty)}function mtn(t){return dtn(rV("",null,null,null,[""],t=utn(t),0,[0],t))}function rV(t,e,n,o,r,i,a,l,s){for(var c=0,u=0,d=a,f=0,p=0,g=0,y=1,w=1,b=1,C=0,P="",v=r,T=i,A=o,x=P;w;)switch(g=C,C=W2()){case 40:if(g!=108&&vd(x,d-1)==58){nV(x+=Ca(Qie(C),"&","&\f"),"&\f",cQe(c?l[c-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:x+=Qie(C);break;case 9:case 10:case 13:case 32:x+=ftn(g);break;case 92:x+=htn(oV()-1,7);continue;case 47:switch(xx()){case 42:case 47:ND(ytn(ptn(W2(),oV()),e,n,s),s);break;default:x+="/"}break;case 123*y:l[c++]=c9(x)*b;case 125*y:case 59:case 0:switch(C){case 0:case 125:w=0;case 59+u:b==-1&&(x=Ca(x,/\f/g,"")),p>0&&c9(x)-d&&ND(p>32?WTe(x+";",o,n,d-1,s):WTe(Ca(x," ","")+";",o,n,d-2,s),s);break;case 59:x+=";";default:if(ND(A=LTe(x,e,n,c,u,r,l,P,v=[],T=[],d,i),i),C===123)if(u===0)rV(x,e,A,A,v,i,d,l,T);else switch(f===99&&vd(x,3)===110?100:f){case 100:case 108:case 109:case 115:rV(t,A,A,o&&ND(LTe(t,A,A,0,0,r,l,P,r,v=[],d,T),T),r,T,d,l,o?v:T);break;default:rV(x,A,A,A,[""],T,0,l,T)}}c=u=p=0,y=b=1,P=x="",d=a;break;case 58:d=1+c9(x),p=g;default:if(y<1){if(C==123)--y;else if(C==125&&y++==0&&ctn()==125)continue}switch(x+=Kye(C),C*y){case 38:b=u>0?1:(x+="\f",-1);break;case 44:l[c++]=(c9(x)-1)*b,b=1;break;case 64:xx()===45&&(x+=Qie(W2())),f=xx(),u=d=c9(P=x+=gtn(oV())),C++;break;case 45:g===45&&c9(x)==2&&(y=0)}}return i}function LTe(t,e,n,o,r,i,a,l,s,c,u,d){for(var f=r-1,p=r===0?i:[""],g=dQe(p),y=0,w=0,b=0;y0?p[C]+" "+P:Ca(P,/&\f/g,p[C])))&&(s[b++]=v);return DQ(t,e,n,r===0?IQ:l,s,c,u,d)}function ytn(t,e,n,o){return DQ(t,e,n,lQe,Kye(stn()),CR(t,2,-2),0,o)}function WTe(t,e,n,o,r){return DQ(t,e,n,Jye,CR(t,0,o),CR(t,o+1,-1),o,r)}function hQe(t,e,n){switch(atn(t,e)){case 5103:return Ql+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ql+t+t;case 4789:return IE+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Ql+t+IE+t+lc+t+t;case 5936:switch(vd(t,e+11)){case 114:return Ql+t+lc+Ca(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Ql+t+lc+Ca(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Ql+t+lc+Ca(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return Ql+t+lc+t+t;case 6165:return Ql+t+lc+"flex-"+t+t;case 5187:return Ql+t+Ca(t,/(\w+).+(:[^]+)/,Ql+"box-$1$2"+lc+"flex-$1$2")+t;case 5443:return Ql+t+lc+"flex-item-"+Ca(t,/flex-|-self/g,"")+(h6(t,/flex-|baseline/)?"":lc+"grid-row-"+Ca(t,/flex-|-self/g,""))+t;case 4675:return Ql+t+lc+"flex-line-pack"+Ca(t,/align-content|flex-|-self/g,"")+t;case 5548:return Ql+t+lc+Ca(t,"shrink","negative")+t;case 5292:return Ql+t+lc+Ca(t,"basis","preferred-size")+t;case 6060:return Ql+"box-"+Ca(t,"-grow","")+Ql+t+lc+Ca(t,"grow","positive")+t;case 4554:return Ql+Ca(t,/([^-])(transform)/g,"$1"+Ql+"$2")+t;case 6187:return Ca(Ca(Ca(t,/(zoom-|grab)/,Ql+"$1"),/(image-set)/,Ql+"$1"),t,"")+t;case 5495:case 3959:return Ca(t,/(image-set\([^]*)/,Ql+"$1$`$1");case 4968:return Ca(Ca(t,/(.+:)(flex-)?(.*)/,Ql+"box-pack:$3"+lc+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ql+t+t;case 4200:if(!h6(t,/flex-|baseline/))return lc+"grid-column-align"+CR(t,e)+t;break;case 2592:case 3360:return lc+Ca(t,"template-","")+t;case 4384:case 3616:return n&&n.some(function(o,r){return e=r,h6(o.props,/grid-\w+-end/)})?~nV(t+(n=n[e].value),"span",0)?t:lc+Ca(t,"-start","")+t+lc+"grid-row-span:"+(~nV(n,"span",0)?h6(n,/\d+/):+h6(n,/\d+/)-+h6(t,/\d+/))+";":lc+Ca(t,"-start","")+t;case 4896:case 4128:return n&&n.some(function(o){return h6(o.props,/grid-\w+-start/)})?t:lc+Ca(Ca(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return Ca(t,/(.+)-inline(.+)/,Ql+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(c9(t)-1-e>6)switch(vd(t,e+1)){case 109:if(vd(t,e+4)!==45)break;case 102:return Ca(t,/(.+:)(.+)-([^]+)/,"$1"+Ql+"$2-$3$1"+IE+(vd(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~nV(t,"stretch",0)?hQe(Ca(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return Ca(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(o,r,i,a,l,s,c){return lc+r+":"+i+c+(a?lc+r+"-span:"+(l?s:+s-+i)+c:"")+t});case 4949:if(vd(t,e+6)===121)return Ca(t,":",":"+Ql)+t;break;case 6444:switch(vd(t,vd(t,14)===45?18:11)){case 120:return Ca(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ql+(vd(t,14)===45?"inline-":"")+"box$3$1"+Ql+"$2$3$1"+lc+"$2box$3")+t;case 100:return Ca(t,":",":"+lc)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Ca(t,"scroll-","scroll-snap-")+t}return t}function dX(t,e){for(var n="",o=0;o-1&&!t.return)switch(t.type){case Jye:t.return=hQe(t.value,t.length,n);return;case sQe:return dX([U4(t,{value:Ca(t.value,"@","@"+Ql)})],o);case IQ:if(t.length)return ltn(n=t.props,function(r){switch(h6(r,o=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":OT(U4(t,{props:[Ca(r,/:(read-\w+)/,":"+IE+"$1")]})),OT(U4(t,{props:[r]})),yde(t,{props:kTe(n,o)});break;case"::placeholder":OT(U4(t,{props:[Ca(r,/:(plac\w+)/,":"+Ql+"input-$1")]})),OT(U4(t,{props:[Ca(r,/:(plac\w+)/,":"+IE+"$1")]})),OT(U4(t,{props:[Ca(r,/:(plac\w+)/,lc+"input-$1")]})),OT(U4(t,{props:[r]})),yde(t,{props:kTe(n,o)});break}return""})}}var btn={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},Q1={},HR=typeof process<"u"&&Q1!==void 0&&(Q1.REACT_APP_SC_ATTR||Q1.SC_ATTR)||"data-styled",pQe="active",gQe="data-styled-version",FQ="6.1.10",qye=`/*!sc*/ -`,$ye=typeof window<"u"&&"HTMLElement"in window,Stn=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Q1!==void 0&&Q1.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Q1.REACT_APP_SC_DISABLE_SPEEDY!==""?Q1.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Q1.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Q1!==void 0&&Q1.SC_DISABLE_SPEEDY!==void 0&&Q1.SC_DISABLE_SPEEDY!==""&&Q1.SC_DISABLE_SPEEDY!=="false"&&Q1.SC_DISABLE_SPEEDY),kQ=Object.freeze([]),MR=Object.freeze({});function Ttn(t,e,n){return n===void 0&&(n=MR),t.theme!==n.theme&&t.theme||e||n.theme}var mQe=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Ptn=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ctn=/(^-|-$)/g;function NTe(t){return t.replace(Ptn,"-").replace(Ctn,"")}var Rtn=/(a)(d)/gi,mO=52,UTe=function(t){return String.fromCharCode(t+(t>25?39:97))};function vde(t){var e,n="";for(e=Math.abs(t);e>mO;e=e/mO|0)n=UTe(e%mO)+n;return(UTe(e%mO)+n).replace(Rtn,"$1-$2")}var Zie,yQe=5381,iC=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},AQe=function(t){return iC(yQe,t)};function Htn(t){return vde(AQe(t)>>>0)}function Mtn(t){return t.displayName||t.name||"Component"}function eae(t){return typeof t=="string"&&!0}var wQe=typeof Symbol=="function"&&Symbol.for,vQe=wQe?Symbol.for("react.memo"):60115,Itn=wQe?Symbol.for("react.forward_ref"):60112,ztn={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Dtn={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},xQe={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Etn=((Zie={})[Itn]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Zie[vQe]=xQe,Zie);function jTe(t){return("type"in(e=t)&&e.type.$$typeof)===vQe?xQe:"$$typeof"in t?Etn[t.$$typeof]:ztn;var e}var Ftn=Object.defineProperty,ktn=Object.getOwnPropertyNames,BTe=Object.getOwnPropertySymbols,Ltn=Object.getOwnPropertyDescriptor,Wtn=Object.getPrototypeOf,YTe=Object.prototype;function bQe(t,e,n){if(typeof e!="string"){if(YTe){var o=Wtn(e);o&&o!==YTe&&bQe(t,o,n)}var r=ktn(e);BTe&&(r=r.concat(BTe(e)));for(var i=jTe(t),a=jTe(e),l=0;l0?" Args: ".concat(e.join(", ")):""))}var Ntn=function(){function t(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return t.prototype.indexOfGroup=function(e){for(var n=0,o=0;o=this.groupSizes.length){for(var o=this.groupSizes,r=o.length,i=r;e>=i;)if((i<<=1)<0)throw pN(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(o),this.length=i;for(var a=r;a=this.length||this.groupSizes[e]===0)return n;for(var o=this.groupSizes[e],r=this.indexOfGroup(e),i=r+o,a=r;a=0){var o=document.createTextNode(n);return this.element.insertBefore(o,this.nodes[e]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.prototype.getRule=function(e){return e0&&(w+="".concat(b,","))}),s+="".concat(g).concat(y,'{content:"').concat(w,'"}').concat(qye)},u=0;u0?".".concat(e):f},u=s.slice();u.push(function(f){f.type===IQ&&f.value.includes("&")&&(f.props[0]=f.props[0].replace(Ktn,n).replace(o,c))}),a.prefix&&u.push(xtn),u.push(Atn);var d=function(f,p,g,y){p===void 0&&(p=""),g===void 0&&(g=""),y===void 0&&(y="&"),e=y,n=p,o=new RegExp("\\".concat(n,"\\b"),"g");var w=f.replace(qtn,""),b=mtn(g||p?"".concat(g," ").concat(p," { ").concat(w," }"):w);a.namespace&&(b=PQe(b,a.namespace));var C=[];return dX(b,wtn(u.concat(vtn(function(P){return C.push(P)})))),C};return d.hash=s.length?s.reduce(function(f,p){return p.name||pN(15),iC(f,p.name)},yQe).toString():"",d}var Qtn=new TQe,bde=$tn(),CQe=be.createContext({shouldForwardProp:void 0,styleSheet:Qtn,stylis:bde});CQe.Consumer;be.createContext(void 0);function VTe(){return m.useContext(CQe)}var Ztn=function(){function t(e,n){var o=this;this.inject=function(r,i){i===void 0&&(i=bde);var a=o.name+i.hash;r.hasNameForId(o.id,a)||r.insertRules(o.id,a,i(o.rules,a,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=n,Zye(this,function(){throw pN(12,String(o.name))})}return t.prototype.getName=function(e){return e===void 0&&(e=bde),this.name+e.hash},t}(),enn=function(t){return t>="A"&&t<="Z"};function GTe(t){for(var e="",n=0;n>>0);if(!n.hasNameForId(this.componentId,a)){var l=o(i,".".concat(a),void 0,this.componentId);n.insertRules(this.componentId,a,l)}r=_v(r,a),this.staticRulesId=a}else{for(var s=iC(this.baseHash,o.hash),c="",u=0;u>>0);n.hasNameForId(this.componentId,p)||n.insertRules(this.componentId,p,o(c,".".concat(p),void 0,this.componentId)),r=_v(r,p)}}return r},t}(),MQe=be.createContext(void 0);MQe.Consumer;var tae={};function rnn(t,e,n){var o=Qye(t),r=t,i=!eae(t),a=e.attrs,l=a===void 0?kQ:a,s=e.componentId,c=s===void 0?function(v,T){var A=typeof v!="string"?"sc":NTe(v);tae[A]=(tae[A]||0)+1;var x="".concat(A,"-").concat(Htn(FQ+A+tae[A]));return T?"".concat(T,"-").concat(x):x}(e.displayName,e.parentComponentId):s,u=e.displayName,d=u===void 0?function(v){return eae(v)?"styled.".concat(v):"Styled(".concat(Mtn(v),")")}(t):u,f=e.displayName&&e.componentId?"".concat(NTe(e.displayName),"-").concat(e.componentId):e.componentId||c,p=o&&r.attrs?r.attrs.concat(l).filter(Boolean):l,g=e.shouldForwardProp;if(o&&r.shouldForwardProp){var y=r.shouldForwardProp;if(e.shouldForwardProp){var w=e.shouldForwardProp;g=function(v,T){return y(v,T)&&w(v,T)}}else g=y}var b=new onn(n,f,o?r.componentStyle:void 0);function C(v,T){return function(A,x,S){var R=A.attrs,M=A.componentStyle,D=A.defaultProps,E=A.foldedComponentIds,W=A.styledComponentId,j=A.target,L=be.useContext(MQe),k=VTe(),N=A.shouldForwardProp||k.shouldForwardProp,F=Ttn(x,L,D)||MR,U=function(Q,le,q){for(var te,re=U0(U0({},le),{className:void 0,theme:q}),ae=0;aenew nn(0,0,g[2],"ZXY"),[g]),xe=(Te,Me)=>{Te.intersections.length>0&&Te.intersections[0].object===Te.eventObject&&(F.style.cursor=Me===Ho.Default?"move":"pointer")},He=()=>{F.style.cursor="default"},Se=m.useMemo(()=>Ei(new Date(x),S),[x,S]),ze=de==null?void 0:de.rotation[2],Ie=T&&T!==v?j(T):null,ye=m.useMemo(()=>{if(Ie){if(Ie.type===z.Foundation){const Te=Ie;if(Te.solarStructure===Dn.FocusTower&&Te.solarPowerTower)return new ie(Te.cx-te,Te.cy-re,Te.cz-ae+Te.lz/2+(Te.solarPowerTower.towerHeight??20))}}else if(de&&de.type===z.Foundation){const Te=de;if(Te.solarStructure===Dn.FocusTower&&Te.solarPowerTower)return new ie(Te.cx-te,Te.cy-re,Te.cz-ae+Te.lz/2+(Te.solarPowerTower.towerHeight??20))}return null},[de,te,re,ae,Ie]),ce=m.useMemo(()=>{if(ye&&Se.z>0){let Me=ye.clone().normalize().add(Se).normalize();me.isSame(Me,Io)&&(Me=new ie(-.001,0,1).normalize()),ze&&Me.applyAxisAngle(Io,-ze);const Pe=Math.hypot(Me.x,Me.y);return new nn(Math.atan2(Pe,Me.z),0,Math.atan2(Me.y,Me.x)+Gt,"ZXY")}return new nn(c,0,u,"ZXY")},[ye,Se,c,u,ze]),pe=-(ge+l)/2,ve=Math.max(1,(i+a)/8),Ae=c1*ve*4;return h.jsxs("group",{name:"Heliostat Group "+e,rotation:he,position:[te,re,ae+fe],children:[h.jsxs("group",{rotation:ce,children:[h.jsxs(Qr,{receiveShadow:W,castShadow:W,uuid:e,ref:X,args:[i,a,l],name:"Heliostat",onPointerDown:Te=>{Te.button!==2&&L(e,Te,Oo.Select)},onContextMenu:Te=>{L(e,Te,Oo.ContextMenu),A(Me=>{Te.intersections.length>0&&Te.intersections[0].object===X.current&&(Me.contextMenuObjectType=z.Heliostat)})},onPointerOver:Te=>{Te.intersections.length>0&&Te.intersections[0].object===X.current&&(O(!0),F.style.cursor="move")},onPointerOut:()=>{O(!1),F.style.cursor="default"},children:[h.jsx("meshStandardMaterial",{attach:"material-0",color:y}),h.jsx("meshStandardMaterial",{attach:"material-1",color:y}),h.jsx("meshStandardMaterial",{attach:"material-2",color:y}),h.jsx("meshStandardMaterial",{attach:"material-3",color:y}),M&&B?h.jsx("meshBasicMaterial",{attach:"material-4",side:Ra,map:B}):h.jsx("meshPhongMaterial",{attach:"material-4",specular:new rr("white"),shininess:100*s,side:Ra,color:"lightskyblue"}),h.jsx("meshStandardMaterial",{attach:"material-5",color:y})]}),h.jsx(ua,{name:"Heliostat Simulation Plane",uuid:e,args:[i,a],position:[0,0,fe],userData:{simulation:!0},receiveShadow:!1,castShadow:!1,visible:!1,children:h.jsx("meshBasicMaterial",{side:$r})}),N&&P&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-se,-ne,fe],[-se,ne,fe],[se,ne,fe],[se,-ne,fe],[-se,-ne,fe]],castShadow:!1,receiveShadow:!1,lineWidth:1,color:y0}),N&&!P&&h.jsx(ds,{ref:$,position:new ie(0,0,0),args:[Ae,6,6],name:Ho.Default,castShadow:!1,receiveShadow:!1,onPointerOver:Te=>{xe(Te,Ho.Default)},onPointerOut:()=>{He()},onPointerDown:Te=>{Te.button!==2&&L(e,Te,Oo.Move)},children:h.jsx("meshBasicMaterial",{attach:"material",color:"orange"})})]}),ge>0&&h.jsx(ca,{userData:{unintersectable:!0},name:"Pole",castShadow:!1,receiveShadow:!1,args:[f,f,ge+l,R.length<100?4:2,1],position:new ie(0,0,pe),rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:y})}),p&&Se.z>0&&h.jsx(jn,{rotation:[-he.x,0,-he.z],userData:{unintersectable:!0},points:ye?[ye,new ie(0,0,fe),Se.clone().multiplyScalar(le)]:[new ie(0,0,fe),Se.clone().multiplyScalar(le)],name:"Sun Beam",lineWidth:.25,color:"white",castShadow:!1,receiveShadow:!1}),(U||C)&&!N&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:Z,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,castShadow:!1,receiveShadow:!1,position:[0,0,(t==null?void 0:t.labelHeight)??Math.max(ne*Math.abs(Math.sin(t.tiltAngle))+.1,.2)]})]})}),otn=be.memo(t=>{var re;const{parentId:e,id:n,cx:o,cy:r,cz:i,name:a=ro.WhiteFlower,flip:l=!1,locked:s=!1}=t;let c=!1;H(ae=>{if(e===Zo)c=!0;else for(const se of ae.elements)if(se.id===e){c=!0;break}});const u=H(yp);m.useEffect(()=>{c||u(n,!1)},[c]);const d=H(fn),f=H(s0),p=H(Id)??!1,g=H(rl),y=H(Tc),w=H(xge)??Fq,b=H(bge)??kq,C=H(Y0),P=H(Eb),v=H(ly),T=ht(Ss),[A,x]=m.useState(!1),{gl:S}=oi(),R=Es(n),M=Fn(ae=>ae.contentRef),D=m.useRef(null),E=m.useRef(null),W=m.useRef(null),j=m.useRef(null),L=m.useMemo(()=>({lng:f}),[f]),k=m.useMemo(()=>{const ae=me.dayOfYear(new Date(g));return y>0?aeb:ae>=w&&ae<=b},[g,w,b,y]),N=m.useRef(!1),F=H(zH);F!==N.current&&(N.current=F,M!=null&&M.current&&D.current&&M.current.add(D.current)),m.useEffect(()=>{if(e!==Zo){const ae=Q();ae&&D.current&&ae.add(D.current)}},[F,e]),m.useEffect(()=>{const ae=Q();ae&&D.current&&ae.add(D.current)},[M]);const U=m.useMemo(()=>new df().load(p8.fetchTextureImage(a,k),ae=>{l&&(ae.wrapS=Hs,ae.repeat.x=-1),B(ae)}),[a,k,l]),[O,B]=m.useState(U),_=m.useMemo(()=>p8.fetchLabel(a,L)+(s?" ("+Y.t("shared.ElementLocked",L)+")":"")+` +`+Y.t("word.Coordinates",L)+": ("+o.toFixed(1)+", "+r.toFixed(1)+") "+Y.t("word.MeterAbbreviation",L),[a,o,r,s,L]),X=m.useCallback((ae,se)=>{ht.getState().duringCameraInteraction||ae.intersections.length>0&&(ae.intersections[0].object===ae.eventObject||ae.intersections.length>1&&ae.intersections[1].object===ae.eventObject)&&(d(fe=>{fe.hoveredHandle=se,fe.selectedElementHeight=t.lz}),me.isMoveHandle(se)?S.domElement.style.cursor="move":S.domElement.style.cursor="pointer")},[t.lz]),$=m.useCallback(()=>{d(ae=>{ae.hoveredHandle=null}),S.domElement.style.cursor=H.getState().addedCuboidId?"crosshair":"default"},[]),Q=()=>e!==Zo&&(M!=null&&M.current)?me.getObjectChildById(M.current,e):null,le=m.useMemo(()=>p8.fetchSpread(a),[a]),q=m.useMemo(()=>p8.fetchHeight(a),[a]);ay(({camera:ae})=>{if(D.current){const{rot:se}=me.getWorldDataById(e);if(p)E.current&&j.current&&(E.current.rotation.set(Gt,0,0),j.current.rotation.set(0,0,0)),D.current.rotation.set(-Gt,0,0);else{if(E.current&&j.current){const{x:ne,y:fe}=ae.position,{x:ge,y:de}=D.current.position;if(Q()){const he=D.current.localToWorld(new ie),xe=Math.atan2(ne-he.x,fe-he.y)+se;E.current.rotation.set(Gt,-xe,0),j.current.rotation.set(-Gt,xe,0)}else{const he=Math.atan2(ne-ge,fe-de);E.current.rotation.set(Gt,-he,0),j.current.rotation.set(-Gt,he,0)}}D.current.rotation.set(0,0,0)}}});const te=c1*3;return h.jsx(h.Fragment,{children:c?h.jsx("group",{ref:D,name:"Flower Group "+n,userData:{aabb:!0},position:[o,r,(i??0)+(p?.25:0)],children:h.jsxs("group",{position:[0,0,q/2],children:[h.jsx(PC,{ref:E,uuid:n,name:a,follow:!1,rotation:[Gt,0,0],children:h.jsx(ua,{args:[le,q],receiveShadow:!T,children:h.jsx("meshToonMaterial",{map:O,side:$r,alphaTest:.5})})}),h.jsx(PC,{ref:j,name:"Interaction Billboard",visible:!1,position:[0,0,-q/2],children:h.jsx(ua,{ref:W,renderOrder:3,name:a+" plane",args:[le/2,q*2],rotation:[p?Gt:0,0,0],onContextMenu:ae=>{C(n,ae,Oo.ContextMenu),d(se=>{ae.intersections.length>0&&ae.intersections[0].object===W.current&&(se.contextMenuObjectType=z.Flower)})},onPointerDown:ae=>{ae.button!==2&&ae.eventObject===ae.intersections[0].eventObject&&(C(n,ae,Oo.Move),Fn.setState({flowerRef:D}))},onPointerOver:ae=>{ae.intersections.length>0&&ae.intersections[0].object===W.current&&x(!0)},onPointerOut:()=>{x(!1)}})}),R&&s&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-le/2,-q/2,0],[-le/2,q/2,0],[-le/2,q/2,0],[le/2,q/2,0],[le/2,-q/2,0],[le/2,q/2,0],[le/2,-q/2,0],[-le/2,-q/2,0]],castShadow:!1,receiveShadow:!1,lineWidth:.5,rotation:(re=E.current)==null?void 0:re.rotation,color:y0}),R&&!s&&h.jsx(h.Fragment,{children:h.jsx(ds,{position:new ie(0,0,-q/2),args:[te,6,6,0,Math.PI],name:Ho.Default,renderOrder:2,onPointerDown:ae=>{ae.button!==2&&ae.eventObject===ae.intersections[0].eventObject&&(C(n,ae,Oo.Move),Fn.setState({flowerRef:D}))},onPointerEnter:ae=>{X(ae,Ho.Default)},onPointerLeave:$,children:h.jsx("meshBasicMaterial",{attach:"material",color:v===Ho.Default||P===Ho.Default?ta:tw})})}),A&&!R&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:_,color:(t==null?void 0:t.labelColor)??"white",fontSize:(t==null?void 0:t.labelFontSize)??20,textHeight:(t==null?void 0:t.labelSize)??.2,position:[0,0,q/2+((t==null?void 0:t.labelHeight)??.4)]})]})}):null})});var mde=function(t,e){return mde=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])},mde(t,e)};function Pr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");mde(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var U0=function(){return U0=Object.assign||function(e){for(var n,o=1,r=arguments.length;o0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function rp(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}function yl(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o0?vd(ZH,--ty):0,RR--,lu===10&&(RR=1,zQ--),lu}function W2(){return lu=ty2||Ade(lu)>3?"":" "}function htn(t,e){for(;--e&&W2()&&!(lu<48||lu>102||lu>57&&lu<65||lu>70&&lu<97););return EQ(t,rV()+(e<6&&xx()==32&&W2()==32))}function wde(t){for(;W2();)switch(lu){case t:return ty;case 34:case 39:t!==34&&t!==39&&wde(lu);break;case 40:t===41&&wde(t);break;case 92:W2();break}return ty}function ptn(t,e){for(;W2()&&t+lu!==57;)if(t+lu===84&&xx()===47)break;return"/*"+EQ(e,ty-1)+"*"+qye(t===47?t:W2())}function gtn(t){for(;!Ade(xx());)W2();return EQ(t,ty)}function mtn(t){return dtn(iV("",null,null,null,[""],t=utn(t),0,[0],t))}function iV(t,e,n,o,r,i,a,l,s){for(var c=0,u=0,d=a,f=0,p=0,g=0,y=1,w=1,b=1,C=0,P="",v=r,T=i,A=o,x=P;w;)switch(g=C,C=W2()){case 40:if(g!=108&&vd(x,d-1)==58){oV(x+=Ca(Qie(C),"&","&\f"),"&\f",cQe(c?l[c-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:x+=Qie(C);break;case 9:case 10:case 13:case 32:x+=ftn(g);break;case 92:x+=htn(rV()-1,7);continue;case 47:switch(xx()){case 42:case 47:ND(ytn(ptn(W2(),rV()),e,n,s),s);break;default:x+="/"}break;case 123*y:l[c++]=c9(x)*b;case 125*y:case 59:case 0:switch(C){case 0:case 125:w=0;case 59+u:b==-1&&(x=Ca(x,/\f/g,"")),p>0&&c9(x)-d&&ND(p>32?NTe(x+";",o,n,d-1,s):NTe(Ca(x," ","")+";",o,n,d-2,s),s);break;case 59:x+=";";default:if(ND(A=WTe(x,e,n,c,u,r,l,P,v=[],T=[],d,i),i),C===123)if(u===0)iV(x,e,A,A,v,i,d,l,T);else switch(f===99&&vd(x,3)===110?100:f){case 100:case 108:case 109:case 115:iV(t,A,A,o&&ND(WTe(t,A,A,0,0,r,l,P,r,v=[],d,T),T),r,T,d,l,o?v:T);break;default:iV(x,A,A,A,[""],T,0,l,T)}}c=u=p=0,y=b=1,P=x="",d=a;break;case 58:d=1+c9(x),p=g;default:if(y<1){if(C==123)--y;else if(C==125&&y++==0&&ctn()==125)continue}switch(x+=qye(C),C*y){case 38:b=u>0?1:(x+="\f",-1);break;case 44:l[c++]=(c9(x)-1)*b,b=1;break;case 64:xx()===45&&(x+=Qie(W2())),f=xx(),u=d=c9(P=x+=gtn(rV())),C++;break;case 45:g===45&&c9(x)==2&&(y=0)}}return i}function WTe(t,e,n,o,r,i,a,l,s,c,u,d){for(var f=r-1,p=r===0?i:[""],g=dQe(p),y=0,w=0,b=0;y0?p[C]+" "+P:Ca(P,/&\f/g,p[C])))&&(s[b++]=v);return DQ(t,e,n,r===0?IQ:l,s,c,u,d)}function ytn(t,e,n,o){return DQ(t,e,n,lQe,qye(stn()),CR(t,2,-2),0,o)}function NTe(t,e,n,o,r){return DQ(t,e,n,Kye,CR(t,0,o),CR(t,o+1,-1),o,r)}function hQe(t,e,n){switch(atn(t,e)){case 5103:return Ql+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ql+t+t;case 4789:return IE+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Ql+t+IE+t+lc+t+t;case 5936:switch(vd(t,e+11)){case 114:return Ql+t+lc+Ca(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Ql+t+lc+Ca(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Ql+t+lc+Ca(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return Ql+t+lc+t+t;case 6165:return Ql+t+lc+"flex-"+t+t;case 5187:return Ql+t+Ca(t,/(\w+).+(:[^]+)/,Ql+"box-$1$2"+lc+"flex-$1$2")+t;case 5443:return Ql+t+lc+"flex-item-"+Ca(t,/flex-|-self/g,"")+(h6(t,/flex-|baseline/)?"":lc+"grid-row-"+Ca(t,/flex-|-self/g,""))+t;case 4675:return Ql+t+lc+"flex-line-pack"+Ca(t,/align-content|flex-|-self/g,"")+t;case 5548:return Ql+t+lc+Ca(t,"shrink","negative")+t;case 5292:return Ql+t+lc+Ca(t,"basis","preferred-size")+t;case 6060:return Ql+"box-"+Ca(t,"-grow","")+Ql+t+lc+Ca(t,"grow","positive")+t;case 4554:return Ql+Ca(t,/([^-])(transform)/g,"$1"+Ql+"$2")+t;case 6187:return Ca(Ca(Ca(t,/(zoom-|grab)/,Ql+"$1"),/(image-set)/,Ql+"$1"),t,"")+t;case 5495:case 3959:return Ca(t,/(image-set\([^]*)/,Ql+"$1$`$1");case 4968:return Ca(Ca(t,/(.+:)(flex-)?(.*)/,Ql+"box-pack:$3"+lc+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ql+t+t;case 4200:if(!h6(t,/flex-|baseline/))return lc+"grid-column-align"+CR(t,e)+t;break;case 2592:case 3360:return lc+Ca(t,"template-","")+t;case 4384:case 3616:return n&&n.some(function(o,r){return e=r,h6(o.props,/grid-\w+-end/)})?~oV(t+(n=n[e].value),"span",0)?t:lc+Ca(t,"-start","")+t+lc+"grid-row-span:"+(~oV(n,"span",0)?h6(n,/\d+/):+h6(n,/\d+/)-+h6(t,/\d+/))+";":lc+Ca(t,"-start","")+t;case 4896:case 4128:return n&&n.some(function(o){return h6(o.props,/grid-\w+-start/)})?t:lc+Ca(Ca(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return Ca(t,/(.+)-inline(.+)/,Ql+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(c9(t)-1-e>6)switch(vd(t,e+1)){case 109:if(vd(t,e+4)!==45)break;case 102:return Ca(t,/(.+:)(.+)-([^]+)/,"$1"+Ql+"$2-$3$1"+IE+(vd(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~oV(t,"stretch",0)?hQe(Ca(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return Ca(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(o,r,i,a,l,s,c){return lc+r+":"+i+c+(a?lc+r+"-span:"+(l?s:+s-+i)+c:"")+t});case 4949:if(vd(t,e+6)===121)return Ca(t,":",":"+Ql)+t;break;case 6444:switch(vd(t,vd(t,14)===45?18:11)){case 120:return Ca(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ql+(vd(t,14)===45?"inline-":"")+"box$3$1"+Ql+"$2$3$1"+lc+"$2box$3")+t;case 100:return Ca(t,":",":"+lc)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Ca(t,"scroll-","scroll-snap-")+t}return t}function fX(t,e){for(var n="",o=0;o-1&&!t.return)switch(t.type){case Kye:t.return=hQe(t.value,t.length,n);return;case sQe:return fX([U4(t,{value:Ca(t.value,"@","@"+Ql)})],o);case IQ:if(t.length)return ltn(n=t.props,function(r){switch(h6(r,o=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":OT(U4(t,{props:[Ca(r,/:(read-\w+)/,":"+IE+"$1")]})),OT(U4(t,{props:[r]})),yde(t,{props:LTe(n,o)});break;case"::placeholder":OT(U4(t,{props:[Ca(r,/:(plac\w+)/,":"+Ql+"input-$1")]})),OT(U4(t,{props:[Ca(r,/:(plac\w+)/,":"+IE+"$1")]})),OT(U4(t,{props:[Ca(r,/:(plac\w+)/,lc+"input-$1")]})),OT(U4(t,{props:[r]})),yde(t,{props:LTe(n,o)});break}return""})}}var btn={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},Q1={},HR=typeof process<"u"&&Q1!==void 0&&(Q1.REACT_APP_SC_ATTR||Q1.SC_ATTR)||"data-styled",pQe="active",gQe="data-styled-version",FQ="6.1.10",$ye=`/*!sc*/ +`,Qye=typeof window<"u"&&"HTMLElement"in window,Stn=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Q1!==void 0&&Q1.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Q1.REACT_APP_SC_DISABLE_SPEEDY!==""?Q1.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Q1.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Q1!==void 0&&Q1.SC_DISABLE_SPEEDY!==void 0&&Q1.SC_DISABLE_SPEEDY!==""&&Q1.SC_DISABLE_SPEEDY!=="false"&&Q1.SC_DISABLE_SPEEDY),kQ=Object.freeze([]),MR=Object.freeze({});function Ttn(t,e,n){return n===void 0&&(n=MR),t.theme!==n.theme&&t.theme||e||n.theme}var mQe=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Ptn=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ctn=/(^-|-$)/g;function UTe(t){return t.replace(Ptn,"-").replace(Ctn,"")}var Rtn=/(a)(d)/gi,yO=52,jTe=function(t){return String.fromCharCode(t+(t>25?39:97))};function vde(t){var e,n="";for(e=Math.abs(t);e>yO;e=e/yO|0)n=jTe(e%yO)+n;return(jTe(e%yO)+n).replace(Rtn,"$1-$2")}var Zie,yQe=5381,iC=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},AQe=function(t){return iC(yQe,t)};function Htn(t){return vde(AQe(t)>>>0)}function Mtn(t){return t.displayName||t.name||"Component"}function eae(t){return typeof t=="string"&&!0}var wQe=typeof Symbol=="function"&&Symbol.for,vQe=wQe?Symbol.for("react.memo"):60115,Itn=wQe?Symbol.for("react.forward_ref"):60112,ztn={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Dtn={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},xQe={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Etn=((Zie={})[Itn]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Zie[vQe]=xQe,Zie);function BTe(t){return("type"in(e=t)&&e.type.$$typeof)===vQe?xQe:"$$typeof"in t?Etn[t.$$typeof]:ztn;var e}var Ftn=Object.defineProperty,ktn=Object.getOwnPropertyNames,YTe=Object.getOwnPropertySymbols,Ltn=Object.getOwnPropertyDescriptor,Wtn=Object.getPrototypeOf,OTe=Object.prototype;function bQe(t,e,n){if(typeof e!="string"){if(OTe){var o=Wtn(e);o&&o!==OTe&&bQe(t,o,n)}var r=ktn(e);YTe&&(r=r.concat(YTe(e)));for(var i=BTe(t),a=BTe(e),l=0;l0?" Args: ".concat(e.join(", ")):""))}var Ntn=function(){function t(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return t.prototype.indexOfGroup=function(e){for(var n=0,o=0;o=this.groupSizes.length){for(var o=this.groupSizes,r=o.length,i=r;e>=i;)if((i<<=1)<0)throw gN(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(o),this.length=i;for(var a=r;a=this.length||this.groupSizes[e]===0)return n;for(var o=this.groupSizes[e],r=this.indexOfGroup(e),i=r+o,a=r;a=0){var o=document.createTextNode(n);return this.element.insertBefore(o,this.nodes[e]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.prototype.getRule=function(e){return e0&&(w+="".concat(b,","))}),s+="".concat(g).concat(y,'{content:"').concat(w,'"}').concat($ye)},u=0;u0?".".concat(e):f},u=s.slice();u.push(function(f){f.type===IQ&&f.value.includes("&")&&(f.props[0]=f.props[0].replace(Ktn,n).replace(o,c))}),a.prefix&&u.push(xtn),u.push(Atn);var d=function(f,p,g,y){p===void 0&&(p=""),g===void 0&&(g=""),y===void 0&&(y="&"),e=y,n=p,o=new RegExp("\\".concat(n,"\\b"),"g");var w=f.replace(qtn,""),b=mtn(g||p?"".concat(g," ").concat(p," { ").concat(w," }"):w);a.namespace&&(b=PQe(b,a.namespace));var C=[];return fX(b,wtn(u.concat(vtn(function(P){return C.push(P)})))),C};return d.hash=s.length?s.reduce(function(f,p){return p.name||gN(15),iC(f,p.name)},yQe).toString():"",d}var Qtn=new TQe,bde=$tn(),CQe=be.createContext({shouldForwardProp:void 0,styleSheet:Qtn,stylis:bde});CQe.Consumer;be.createContext(void 0);function GTe(){return m.useContext(CQe)}var Ztn=function(){function t(e,n){var o=this;this.inject=function(r,i){i===void 0&&(i=bde);var a=o.name+i.hash;r.hasNameForId(o.id,a)||r.insertRules(o.id,a,i(o.rules,a,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=n,e2e(this,function(){throw gN(12,String(o.name))})}return t.prototype.getName=function(e){return e===void 0&&(e=bde),this.name+e.hash},t}(),enn=function(t){return t>="A"&&t<="Z"};function XTe(t){for(var e="",n=0;n>>0);if(!n.hasNameForId(this.componentId,a)){var l=o(i,".".concat(a),void 0,this.componentId);n.insertRules(this.componentId,a,l)}r=_v(r,a),this.staticRulesId=a}else{for(var s=iC(this.baseHash,o.hash),c="",u=0;u>>0);n.hasNameForId(this.componentId,p)||n.insertRules(this.componentId,p,o(c,".".concat(p),void 0,this.componentId)),r=_v(r,p)}}return r},t}(),MQe=be.createContext(void 0);MQe.Consumer;var tae={};function rnn(t,e,n){var o=Zye(t),r=t,i=!eae(t),a=e.attrs,l=a===void 0?kQ:a,s=e.componentId,c=s===void 0?function(v,T){var A=typeof v!="string"?"sc":UTe(v);tae[A]=(tae[A]||0)+1;var x="".concat(A,"-").concat(Htn(FQ+A+tae[A]));return T?"".concat(T,"-").concat(x):x}(e.displayName,e.parentComponentId):s,u=e.displayName,d=u===void 0?function(v){return eae(v)?"styled.".concat(v):"Styled(".concat(Mtn(v),")")}(t):u,f=e.displayName&&e.componentId?"".concat(UTe(e.displayName),"-").concat(e.componentId):e.componentId||c,p=o&&r.attrs?r.attrs.concat(l).filter(Boolean):l,g=e.shouldForwardProp;if(o&&r.shouldForwardProp){var y=r.shouldForwardProp;if(e.shouldForwardProp){var w=e.shouldForwardProp;g=function(v,T){return y(v,T)&&w(v,T)}}else g=y}var b=new onn(n,f,o?r.componentStyle:void 0);function C(v,T){return function(A,x,S){var R=A.attrs,M=A.componentStyle,D=A.defaultProps,E=A.foldedComponentIds,W=A.styledComponentId,j=A.target,L=be.useContext(MQe),k=GTe(),N=A.shouldForwardProp||k.shouldForwardProp,F=Ttn(x,L,D)||MR,U=function(Q,le,q){for(var te,re=U0(U0({},le),{className:void 0,theme:q}),ae=0;ae{const t=H(fn),e=H(ma),n=ht(Uge),o=H(Uq),r=Jt(),i=()=>{ht.getState().set(c=>{c.runDailyThermalSimulation=!1,c.runYearlyThermalSimulation=!1,c.pauseDailyThermalSimulation=!1,c.pauseYearlyThermalSimulation=!1,c.runStaticSimulation=!1,c.runDynamicSimulation=!1,c.pauseSimulation=!1,c.runDailyLightSensor=!1,c.runYearlyLightSensor=!1,c.pauseDailyLightSensor=!1,c.pauseYearlyLightSensor=!1,c.runDailySimulationForSolarPanels=!1,c.runYearlySimulationForSolarPanels=!1,c.pauseDailySimulationForSolarPanels=!1,c.pauseYearlySimulationForSolarPanels=!1,c.runDailySimulationForParabolicTroughs=!1,c.runYearlySimulationForParabolicTroughs=!1,c.pauseDailySimulationForParabolicTroughs=!1,c.pauseYearlySimulationForParabolicTroughs=!1,c.runDailySimulationForParabolicDishes=!1,c.runYearlySimulationForParabolicDishes=!1,c.pauseDailySimulationForParabolicDishes=!1,c.pauseYearlySimulationForParabolicDishes=!1,c.runDailySimulationForFresnelReflectors=!1,c.runYearlySimulationForFresnelReflectors=!1,c.pauseDailySimulationForFresnelReflectors=!1,c.pauseYearlySimulationForFresnelReflectors=!1,c.runDailySimulationForHeliostats=!1,c.runYearlySimulationForHeliostats=!1,c.pauseDailySimulationForHeliostats=!1,c.pauseYearlySimulationForHeliostats=!1}),t(c=>{e&&(c.actionInfo={name:"Cancel Simulation",timestamp:new Date().getTime()})})},a=()=>{ht.getState().set(c=>{c.runDailyThermalSimulation&&(c.pauseDailyThermalSimulation=!0),c.runYearlyThermalSimulation&&(c.pauseYearlyThermalSimulation=!0),c.runDynamicSimulation&&(c.pauseSimulation=!0),c.runDailyLightSensor&&(c.pauseDailyLightSensor=!0),c.runYearlyLightSensor&&(c.pauseYearlyLightSensor=!0),c.runDailySimulationForSolarPanels&&(c.pauseDailySimulationForSolarPanels=!0),c.runYearlySimulationForSolarPanels&&(c.pauseYearlySimulationForSolarPanels=!0),c.runDailySimulationForParabolicTroughs&&(c.pauseDailySimulationForParabolicTroughs=!0),c.runYearlySimulationForParabolicTroughs&&(c.pauseYearlySimulationForParabolicTroughs=!0),c.runDailySimulationForParabolicDishes&&(c.pauseDailySimulationForParabolicDishes=!0),c.runYearlySimulationForParabolicDishes&&(c.pauseYearlySimulationForParabolicDishes=!0),c.runDailySimulationForFresnelReflectors&&(c.pauseDailySimulationForFresnelReflectors=!0),c.runYearlySimulationForFresnelReflectors&&(c.pauseYearlySimulationForFresnelReflectors=!0),c.runDailySimulationForHeliostats&&(c.pauseDailySimulationForHeliostats=!0),c.runYearlySimulationForHeliostats&&(c.pauseYearlySimulationForHeliostats=!0)}),t(c=>{e&&(c.actionInfo={name:"Pause Simulation",timestamp:new Date().getTime()})})},l=()=>{ht.getState().set(c=>{c.runDailyThermalSimulation&&(c.pauseDailyThermalSimulation=!1),c.runYearlyThermalSimulation&&(c.pauseYearlyThermalSimulation=!1),c.runDynamicSimulation&&(c.pauseSimulation=!1),c.runDailyLightSensor&&(c.pauseDailyLightSensor=!1),c.runYearlyLightSensor&&(c.pauseYearlyLightSensor=!1),c.runDailySimulationForSolarPanels&&(c.pauseDailySimulationForSolarPanels=!1),c.runYearlySimulationForSolarPanels&&(c.pauseYearlySimulationForSolarPanels=!1),c.runDailySimulationForParabolicTroughs&&(c.pauseDailySimulationForParabolicTroughs=!1),c.runYearlySimulationForParabolicTroughs&&(c.pauseYearlySimulationForParabolicTroughs=!1),c.runDailySimulationForParabolicDishes&&(c.pauseDailySimulationForParabolicDishes=!1),c.runYearlySimulationForParabolicDishes&&(c.pauseYearlySimulationForParabolicDishes=!1),c.runDailySimulationForFresnelReflectors&&(c.pauseDailySimulationForFresnelReflectors=!1),c.runYearlySimulationForFresnelReflectors&&(c.pauseYearlySimulationForFresnelReflectors=!1),c.runDailySimulationForHeliostats&&(c.pauseDailySimulationForHeliostats=!1),c.runYearlySimulationForHeliostats&&(c.pauseYearlySimulationForHeliostats=!1)}),t(c=>{e&&(c.actionInfo={name:"Resume Simulation",timestamp:new Date().getTime()})})},{t:s}=Vl();return h.jsx(ann,{style:{bottom:o?"42px":"6px"},children:h.jsxs(en,{direction:"horizontal",style:{color:"antiquewhite",fontSize:"10px"},children:[h.jsx(lo,{type:"primary",onClick:i,title:s("message.CancelSimulation",r),children:s("word.Cancel",r)}),!n&&h.jsx(lo,{type:"primary",onClick:a,title:s("message.PauseSimulation",r),children:s("word.Pause",r)}),n&&h.jsx(lo,{type:"primary",onClick:l,title:s("message.ResumeSimulation",r),children:s("word.Resume",r)})]})})}),snn=Ro.div` +`,lnn=be.memo(()=>{const t=H(fn),e=H(da),n=ht(Uge),o=H(jq),r=Jt(),i=()=>{ht.getState().set(c=>{c.runDailyThermalSimulation=!1,c.runYearlyThermalSimulation=!1,c.pauseDailyThermalSimulation=!1,c.pauseYearlyThermalSimulation=!1,c.runStaticSimulation=!1,c.runDynamicSimulation=!1,c.pauseSimulation=!1,c.runDailyLightSensor=!1,c.runYearlyLightSensor=!1,c.pauseDailyLightSensor=!1,c.pauseYearlyLightSensor=!1,c.runDailySimulationForSolarPanels=!1,c.runYearlySimulationForSolarPanels=!1,c.pauseDailySimulationForSolarPanels=!1,c.pauseYearlySimulationForSolarPanels=!1,c.runDailySimulationForParabolicTroughs=!1,c.runYearlySimulationForParabolicTroughs=!1,c.pauseDailySimulationForParabolicTroughs=!1,c.pauseYearlySimulationForParabolicTroughs=!1,c.runDailySimulationForParabolicDishes=!1,c.runYearlySimulationForParabolicDishes=!1,c.pauseDailySimulationForParabolicDishes=!1,c.pauseYearlySimulationForParabolicDishes=!1,c.runDailySimulationForFresnelReflectors=!1,c.runYearlySimulationForFresnelReflectors=!1,c.pauseDailySimulationForFresnelReflectors=!1,c.pauseYearlySimulationForFresnelReflectors=!1,c.runDailySimulationForHeliostats=!1,c.runYearlySimulationForHeliostats=!1,c.pauseDailySimulationForHeliostats=!1,c.pauseYearlySimulationForHeliostats=!1}),t(c=>{e&&(c.actionInfo={name:"Cancel Simulation",timestamp:new Date().getTime()})})},a=()=>{ht.getState().set(c=>{c.runDailyThermalSimulation&&(c.pauseDailyThermalSimulation=!0),c.runYearlyThermalSimulation&&(c.pauseYearlyThermalSimulation=!0),c.runDynamicSimulation&&(c.pauseSimulation=!0),c.runDailyLightSensor&&(c.pauseDailyLightSensor=!0),c.runYearlyLightSensor&&(c.pauseYearlyLightSensor=!0),c.runDailySimulationForSolarPanels&&(c.pauseDailySimulationForSolarPanels=!0),c.runYearlySimulationForSolarPanels&&(c.pauseYearlySimulationForSolarPanels=!0),c.runDailySimulationForParabolicTroughs&&(c.pauseDailySimulationForParabolicTroughs=!0),c.runYearlySimulationForParabolicTroughs&&(c.pauseYearlySimulationForParabolicTroughs=!0),c.runDailySimulationForParabolicDishes&&(c.pauseDailySimulationForParabolicDishes=!0),c.runYearlySimulationForParabolicDishes&&(c.pauseYearlySimulationForParabolicDishes=!0),c.runDailySimulationForFresnelReflectors&&(c.pauseDailySimulationForFresnelReflectors=!0),c.runYearlySimulationForFresnelReflectors&&(c.pauseYearlySimulationForFresnelReflectors=!0),c.runDailySimulationForHeliostats&&(c.pauseDailySimulationForHeliostats=!0),c.runYearlySimulationForHeliostats&&(c.pauseYearlySimulationForHeliostats=!0)}),t(c=>{e&&(c.actionInfo={name:"Pause Simulation",timestamp:new Date().getTime()})})},l=()=>{ht.getState().set(c=>{c.runDailyThermalSimulation&&(c.pauseDailyThermalSimulation=!1),c.runYearlyThermalSimulation&&(c.pauseYearlyThermalSimulation=!1),c.runDynamicSimulation&&(c.pauseSimulation=!1),c.runDailyLightSensor&&(c.pauseDailyLightSensor=!1),c.runYearlyLightSensor&&(c.pauseYearlyLightSensor=!1),c.runDailySimulationForSolarPanels&&(c.pauseDailySimulationForSolarPanels=!1),c.runYearlySimulationForSolarPanels&&(c.pauseYearlySimulationForSolarPanels=!1),c.runDailySimulationForParabolicTroughs&&(c.pauseDailySimulationForParabolicTroughs=!1),c.runYearlySimulationForParabolicTroughs&&(c.pauseYearlySimulationForParabolicTroughs=!1),c.runDailySimulationForParabolicDishes&&(c.pauseDailySimulationForParabolicDishes=!1),c.runYearlySimulationForParabolicDishes&&(c.pauseYearlySimulationForParabolicDishes=!1),c.runDailySimulationForFresnelReflectors&&(c.pauseDailySimulationForFresnelReflectors=!1),c.runYearlySimulationForFresnelReflectors&&(c.pauseYearlySimulationForFresnelReflectors=!1),c.runDailySimulationForHeliostats&&(c.pauseDailySimulationForHeliostats=!1),c.runYearlySimulationForHeliostats&&(c.pauseYearlySimulationForHeliostats=!1)}),t(c=>{e&&(c.actionInfo={name:"Resume Simulation",timestamp:new Date().getTime()})})},{t:s}=Vl();return h.jsx(ann,{style:{bottom:o?"42px":"6px"},children:h.jsxs(en,{direction:"horizontal",style:{color:"antiquewhite",fontSize:"10px"},children:[h.jsx(lo,{type:"primary",onClick:i,title:s("message.CancelSimulation",r),children:s("word.Cancel",r)}),!n&&h.jsx(lo,{type:"primary",onClick:a,title:s("message.PauseSimulation",r),children:s("word.Pause",r)}),n&&h.jsx(lo,{type:"primary",onClick:l,title:s("message.ResumeSimulation",r),children:s("word.Resume",r)})]})})}),snn=Ro.div` position: absolute; left: calc(100vw / 2 - 50px); width: 100px; @@ -4845,7 +4845,7 @@ function print() { __p += __j.call(arguments, '') } opacity: 100%; user-select: none; z-index: 10000; // must be larger than that of the spinner so that this can be clicked -`,cnn=be.memo(()=>{const t=H(fn),e=H(ma),n=ht(UYe),o=H(Uq),{t:r}=Vl(),i=Jt(),a=()=>{ht.getState().set(c=>{c.runStaticSimulation=!1,c.pauseSimulation=!1,c.runEvolution=!1,c.pauseEvolution=!1}),e&&t(c=>{c.actionInfo={name:"Cancel Evolution",timestamp:new Date().getTime()}})},l=()=>{ht.getState().set(c=>{c.pauseSimulation=!0,c.runEvolution&&(c.pauseEvolution=!0)}),e&&t(c=>{c.actionInfo={name:"Pause Evolution",timestamp:new Date().getTime()}})},s=()=>{ht.getState().set(c=>{c.pauseSimulation=!1,c.runEvolution&&(c.pauseEvolution=!1)}),e&&t(c=>{c.actionInfo={name:"Resume Evolution",timestamp:new Date().getTime()}})};return h.jsx(snn,{style:{bottom:o?"42px":"6px"},children:h.jsxs(en,{direction:"horizontal",style:{color:"antiquewhite",fontSize:"10px"},children:[h.jsx(lo,{type:"primary",onClick:a,title:r("message.CancelEvolution",i),children:r("word.Cancel",i)}),!n&&h.jsx(lo,{type:"primary",onClick:l,title:r("message.PauseEvolution",i),children:r("word.Pause",i)}),n&&h.jsx(lo,{type:"primary",onClick:s,title:r("message.ResumeEvolution",i),children:r("word.Resume",i)})]})})}),LQ=Ro(qW)` +`,cnn=be.memo(()=>{const t=H(fn),e=H(da),n=ht(jYe),o=H(jq),{t:r}=Vl(),i=Jt(),a=()=>{ht.getState().set(c=>{c.runStaticSimulation=!1,c.pauseSimulation=!1,c.runEvolution=!1,c.pauseEvolution=!1}),e&&t(c=>{c.actionInfo={name:"Cancel Evolution",timestamp:new Date().getTime()}})},l=()=>{ht.getState().set(c=>{c.pauseSimulation=!0,c.runEvolution&&(c.pauseEvolution=!0)}),e&&t(c=>{c.actionInfo={name:"Pause Evolution",timestamp:new Date().getTime()}})},s=()=>{ht.getState().set(c=>{c.pauseSimulation=!1,c.runEvolution&&(c.pauseEvolution=!1)}),e&&t(c=>{c.actionInfo={name:"Resume Evolution",timestamp:new Date().getTime()}})};return h.jsx(snn,{style:{bottom:o?"42px":"6px"},children:h.jsxs(en,{direction:"horizontal",style:{color:"antiquewhite",fontSize:"10px"},children:[h.jsx(lo,{type:"primary",onClick:a,title:r("message.CancelEvolution",i),children:r("word.Cancel",i)}),!n&&h.jsx(lo,{type:"primary",onClick:l,title:r("message.PauseEvolution",i),children:r("word.Pause",i)}),n&&h.jsx(lo,{type:"primary",onClick:s,title:r("message.ResumeEvolution",i),children:r("word.Resume",i)})]})})}),LQ=Ro($W)` position: fixed; top: 0; left: 0; @@ -4857,8 +4857,8 @@ function print() { __p += __j.call(arguments, '') } align-items: center; background-color: rgba(255, 255, 255, 0.5); z-index: 9999; -`,unn=be.memo(function({initializing:e}){const n=ht(h7t),o=ht(Rf),r=ht(NYe),i=ht(Uge),a=ht(UYe),l=H(Tge),s=H(Pge),c=H(Sge),u=H(YBe),d=H(I8t),f=ht(VYe),p=ht(GYe),g=ht(pOe),y=ht(gOe),w=ht(sOe),b=ht(cOe),C=ht(pW),P=ht(hW),v=ht(Yq),T=H.getState().elements;return h.jsx(h.Fragment,{children:(e||n||o||r)&&h.jsxs(h.Fragment,{children:[o&&(!c&&C||!d&&(P||v)||!l&&(g||y)||!u&&(w||b)||!s&&(f||p)||me.hasMovingParts(T))&&h.jsx(lnn,{}),r&&h.jsx(cnn,{}),h.jsx(LQ,{spinning:!i||!a})]})})}),dnn=()=>{if(H(zH),!ht.getState().waiting)return null;const e=()=>(m.useEffect(()=>(ht.getState().set(n=>{n.waiting=!1}),()=>{ht.getState().set(n=>{n.waiting=!1})})),null);return h.jsx(e,{})},fnn=be.memo(({id:t,cx:e,cy:n,cz:o,lx:r,lz:i,birdSafe:a=uc.None,numberOfBlades:l=3,speed:s=10,hubRadius:c=.75,hubLength:u=1.5,maximumChordRadius:d=3,maximumChordLength:f=1,towerHeight:p,towerRadius:g,bladeRadius:y,bladeTipWidth:w=.2,bladeRootRadius:b=.3,rotation:C=[0,0,0],relativeYawAngle:P=0,initialRotorAngle:v=0,pitchAngle:T=me.toRadians(10),color:A="white",bladeColor:x=t9,stripeColor:S=n9,lineColor:R="black",lineWidth:M=.5,showLabel:D=!1,locked:E=!1,parentId:W})=>{const j=H(fn),L=H(Gn),k=H(Y0),N=Es(t),F=H(Ds),U=H(rl),{gl:{domElement:O}}=oi(),[B,_]=m.useState(!1),X=m.useRef(null),$=m.useRef(null),Q=m.useRef(!1),le=Jt(),q=m.useMemo(()=>me.fetchBladeTexture(y,b*2,100,a,x,S),[b,y,a,x,S]),te=H(Ie=>{for(const ye of Ie.elements)if(ye.id===W)return ye});if(te)switch(te.type){case z.Foundation:if(o=te.lz,me.isZero(C[2]))e=te.cx+e*te.lx,n=te.cy+n*te.ly;else{const Ie=new ie(e*te.lx,n*te.ly,0);Ie.applyAxisAngle(Io,C[2]),e=te.cx+Ie.x,n=te.cy+Ie.y}break}const re=L(t),ae=c*1.25,se=u*2.5,ne=y-d/3,fe=m.useMemo(()=>{const Ie=f-b,ye=new Fl,ce=[];return ce.push(new Xt(-b,0)),ce.push(new Xt(-Ie/2,y-ne)),ce.push(new Xt(-Ie,d)),ce.push(new Xt(b-w,y)),ye.moveTo(-b,0),ye.splineThru(ce),ye.lineTo(b,y),ye.lineTo(b,0),ye.closePath(),ye},[y,ne,f,d,b,w]),ge=m.useMemo(()=>{const Ie=new Date(U);return v+s*(Ie.getHours()*60+Ie.getMinutes())*Math.PI/72},[U,s,v]);m.useEffect(()=>{const Ie=()=>{Fn.getState().setEnableOrbitController(!0),Q.current=!1};return window.addEventListener("pointerup",Ie),()=>{window.removeEventListener("pointerup",Ie)}},[]);const de=m.useMemo(()=>(re!=null&&re.label?re.label:Y.t("shared.WindTurbineElement",le))+(re!=null&&re.locked?" ("+Y.t("shared.ElementLocked",le)+")":"")+(re!=null&&re.label?"":` -`+Y.t("word.Coordinates",le)+": ("+e.toFixed(1)+", "+n.toFixed(1)+", "+o.toFixed(1)+") "+Y.t("word.MeterAbbreviation",le)),[re==null?void 0:re.label,re==null?void 0:re.locked,le,e,n,o]),Z=m.useMemo(()=>new nn(0,0,C[2]+P,"ZXY"),[C,P]),he=(Ie,ye)=>{Ie.intersections.length>0&&Ie.intersections[0].object===Ie.eventObject&&(O.style.cursor=ye===Ho.Default?"move":"pointer")},xe=()=>{O.style.cursor="default"},He=c1*4,Se=m.useMemo(()=>{const Ie=Math.PI*2/l,ye=new Array;for(let ce=0;ceh.jsxs("group",{position:new ie(0,-u*.85,p),rotation:[Gt,T,ye,"XZY"],children:[h.jsxs("mesh",{name:"Blade "+Ie+" Font Side",receiveShadow:F,castShadow:F,children:[h.jsx("shapeGeometry",{attach:"geometry",args:[fe]}),h.jsx("meshStandardMaterial",{attach:"material",color:x,side:Ra,map:ce})]}),h.jsxs("mesh",{name:"Blade "+Ie+" Back Side",receiveShadow:F,castShadow:F,position:new ie(0,-.05,0),children:[h.jsx("shapeGeometry",{attach:"geometry",args:[fe]}),h.jsx("meshStandardMaterial",{attach:"material",color:x,side:p0,map:ce})]}),h.jsx(ca,{name:"Blade root",castShadow:!1,receiveShadow:!1,args:[b*1.1,b*1.1,.24,12,1],position:new ie(0,c-.14,0),children:h.jsx("meshStandardMaterial",{attach:"material",color:A})})]},Ie);return h.jsxs("group",{name:"Wind Turbine Group "+t,rotation:Z,position:[e,n,o],children:[h.jsx("group",{children:N&&!E&&h.jsx(ds,{ref:$,position:new ie(0,0,0),args:[He+g,6,6],name:Ho.Default,castShadow:!1,receiveShadow:!1,onPointerOver:Ie=>{he(Ie,Ho.Default)},onPointerOut:()=>{xe()},onPointerDown:Ie=>{Ie.button!==2&&k(t,Ie,Oo.Move)},children:h.jsx("meshStandardMaterial",{attach:"material",color:"orange"})})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Tower",ref:X,castShadow:F,receiveShadow:F,args:[g*.8,g*1.2,p,4,1],position:new ie(0,0,p*.5),rotation:[Gt,0,0],onPointerDown:Ie=>{Ie.button!==2&&(k(t,Ie,Oo.Select),Fn.getState().setEnableOrbitController(!1))},onContextMenu:Ie=>{k(t,Ie,Oo.ContextMenu),j(ye=>{Ie.intersections.length>0&&Ie.intersections[0].object===X.current&&(ye.contextMenuObjectType=z.WindTurbine)})},onPointerOver:Ie=>{Ie.intersections.length>0&&Ie.intersections[0].object===X.current&&(_(!0),O.style.cursor="move")},onPointerOut:()=>{_(!1),O.style.cursor="default"},children:h.jsx("meshStandardMaterial",{attach:"material",color:A})}),h.jsx(ds,{userData:{unintersectable:!0},name:"Hub",castShadow:F,receiveShadow:F,args:[c,8,8,Gt,Math.PI,0,Math.PI],position:new ie(0,-u*.5,p),rotation:[Math.PI,0,Gt],scale:[u/c,1,1],children:h.jsx("meshStandardMaterial",{attach:"material",color:A})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Hub Cap",castShadow:F,receiveShadow:F,args:[c,c,.01,16,1],position:new ie(0,-u*.5,p),rotation:[Math.PI,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:A})}),h.jsx(u4t,{userData:{unintersectable:!0},name:"Nacelle",castShadow:F,receiveShadow:F,radius:.1,smoothness:4,args:[ae,ae,se],position:new ie(0,(se-u)*.5-.1,p),rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:A})}),a!==uc.None&&Se.map((Ie,ye)=>ze(ye,Ie,q)),a===uc.None&&Se.map((Ie,ye)=>ze(ye,Ie,null)),N&&E&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-r/2,0,0],[-r/2,i,0],[-r/2,i,0],[r/2,i,0],[r/2,0,0],[r/2,i,0],[r/2,0,0],[-r/2,0,0]],rotation:[Gt,0,0],castShadow:!1,receiveShadow:!1,lineWidth:1,color:y0}),(B||D)&&!N&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:de,color:(re==null?void 0:re.labelColor)??"white",fontSize:(re==null?void 0:re.labelFontSize)??20,textHeight:(re==null?void 0:re.labelSize)??1,castShadow:!1,receiveShadow:!1,position:[0,0,1+p+c]})]})}),hnn=be.memo(()=>{const t=H(Kn),e=m.useRef(null);return m.useEffect(()=>{e&&Fn.setState({contentRef:e})},[]),console.debug(t),h.jsxs("group",{ref:e,name:"Content",children:[t.map(n=>{switch(n.type){case z.Foundation:return h.jsx(qZt,{...n},n.id);case z.Sensor:{const o=n;return o.parentType===z.Cuboid?null:h.jsx(T$e,{...o},n.id)}case z.Light:{const o=n;return o.parentType===z.Cuboid?null:h.jsx(P$e,{...o},n.id)}case z.Cuboid:return n.parentId!==Zo?null:h.jsx(R$e,{elements:t,cuboidModel:n},n.id);case z.Human:return h.jsx($en,{...n},n.id);case z.Tree:return h.jsx(Qen,{...n},n.id);case z.Flower:return h.jsx(otn,{...n},n.id);case z.ParabolicDish:return h.jsx(etn,{...n},n.id);case z.ParabolicTrough:return h.jsx(Zen,{...n},n.id);case z.FresnelReflector:return h.jsx(ttn,{...n},n.id);case z.Heliostat:return h.jsx(ntn,{...n},n.id);case z.WindTurbine:return h.jsx(fnn,{...n},n.id);case z.Polygon:switch(n.parentType){case z.Wall:return null;default:return h.jsx(eQe,{...n},n.id)}default:if(n.id)return h.jsx(be.Fragment,{},n.id)}return null}),h.jsx(dnn,{}),h.jsx(pnn,{})]})}),pnn=()=>{const t=H(Oge);return m.useEffect(()=>{H.getState().set(e=>{e.deletedRoofIdSet.clear()})},[t]),null},gnn=be.memo(()=>{const t=H(fn),e=H(Cb),n=H(EH),o=H(c3),r=H(Lge),i=H(Nge),a=H(Gn),l=H(u3),s=H(kge),c=H(yp),u=H(Dge),d=H(Bge),f=H(En),p=H(zw),g=H(ZBe),y=H($q),w=H(Eb),b=H(d1),C=H(Zq),P=H(ext),v=H(Ds),T=H(TBe),A=H(PBe),x=H(Qe=>Qe.world.ground),S=H(txt),R=H(nxt),M=ht(Ss),D=ht(Y7t),{get:E,scene:W,invalidate:j}=oi(),L=m.useRef(null),k=m.useRef(null),N=m.useRef(null),F=m.useRef(new ie),U=m.useRef(new ie),O=m.useRef(new Map),B=m.useRef(new Map),_=m.useRef(new Map),X=m.useRef(new Map),$=m.useRef(new Map),Q=m.useRef(new Map),le=m.useRef(new Map),q=m.useRef(new Map),te=m.useRef(new ie(1,1,1)),re=m.useRef(new ie(1,1,1)),ae=m.useRef([0,0,1]),se=m.useRef([0,0,1]),ne=m.useRef(null),fe=m.useRef(null),ge=m.useRef(new Map),de=m.useRef(new Map),Z=m.useRef(new Map),he=m.useRef(!1),xe=m.useRef(!1),He=m.useRef(!1),Se=m.useRef(!1),ze=m.useRef(!1),Ie=m.useRef(new Map),ye=m.useRef(new Map),ce=m.useRef(new Map),pe=m.useRef(new ie),ve=Jt();m.useEffect(()=>(window.addEventListener("pointerup",Ze),()=>{window.removeEventListener("pointerup",Ze)}),[]),m.useEffect(()=>{S&&(t(Qe=>{Qe.addedFoundationId=null,Qe.deletedFoundationId=null}),he.current=!1,xe.current=!1)},[S]),m.useEffect(()=>{R&&(t(Qe=>{Qe.addedCuboidId=null,Qe.deletedCuboidId=null}),He.current=!1,Se.current=!1)},[R]);const{camera:Ae}=oi(),Te=m.useMemo(()=>new l0,[]),Me=m.useMemo(()=>new Xt,[]),Pe=N.current?Math.cos(N.current.rotation[2]):1,Ee=N.current?Math.sin(N.current.rotation[2]):0;let Be=eh.Ground;const Je=m.useMemo(()=>new ie,[]),We=m.useMemo(()=>new nn,[]),Ke=m.useMemo(()=>new nn,[]);if(N.current){if(me.isPlantOrHuman(N.current)){Be=eh.Vertical;const Qe=H.getState().viewState.orthographic?0:-Gt,{x:Tt,y:Dt}=Ae.position,lt=-Math.atan2(Tt,Dt);We.set(Qe,0,lt,"ZXY"),Je.set(N.current.cx,N.current.cy,0)}else if(w===Ho.Top)Be=eh.Horizontal,Je.set(N.current.cx,N.current.cy,N.current.lz),We.set(0,0,0);else if(me.isMoveHandle(w)||b===vt.Left||b===vt.Right||b===vt.Lower||b===vt.Upper||b===vt.LowerLeft||b===vt.UpperLeft&&N.current.type!==z.Wall||b===vt.LowerRight||b===vt.UpperRight&&N.current.type!==z.Wall||C===Kr.Lower||C===Kr.Upper)Be=eh.Horizontal,Je.set(N.current.cx,N.current.cy,c1),We.set(0,0,0);else if(b){Be=eh.Vertical;const Qe=d(N.current,b),Tt=u(),Dt=-Math.atan2(Tt.x,Tt.y);Je.set(Qe.x,Qe.y,0),We.set(-Gt,0,Dt,"ZXY")}}const Ne=Qe=>{Me.x=Qe.offsetX/E().gl.domElement.clientWidth*2-1,Me.y=-(Qe.offsetY/E().gl.domElement.clientHeight)*2+1,Te.setFromCamera(Me,E().camera)},De=Qe=>{for(const Tt of Qe)if(Tt.object.userData.stand)return Tt;return null},ke=(Qe,Tt)=>{Qe&&t(Dt=>{for(const lt of Dt.elements)if(lt.id===Tt&<.type!==z.Foundation){lt.parentId=Qe;break}})},Ye=Qe=>{if(!Qe)return"";const Tt=Qe.name.split(" ");return Tt[2]?Tt[2]:Ye(Qe.parent)},it=(Qe,Tt,Dt)=>{if(!Qe||!Tt)return;const lt=Fn.getState().contentRef;if(lt!=null&<.current){const zt=me.getObjectChildById(lt.current,Tt),Ft=me.getObjectChildById(Tt===Zo?lt.current:zt,Dt);if(Ft){if(Qe===Zo)lt.current.add(Ft);else{const _t=me.getObjectChildById(lt.current,Qe);_t==null||_t.add(Ft)}j()}}},Ve=(Qe,Tt)=>{if(Qe&&Qe.current){const Dt=De(Tt.intersections);if(Dt){const lt=Dt.object,zt=Qe.current.parent;if(lt.name==="Ground"){if(zt&&zt.name!=="Content"){const Ft=Fn.getState().contentRef;Ft&&Ft.current&&(Ft.current.add(Qe.current),ke(Zo,Ye(Qe.current)))}Qe.current.position.copy(Dt.point),j()}else if(lt.userData.stand){const Ft=lt.parent;if(Ft){zt&&zt.uuid!==Ft.uuid&&(Ft.add(Qe.current),ke(Ye(Ft),Ye(Qe.current)));const{rot:_t}=me.getWorldDataById(Ye(Ft));Ke.set(0,0,-_t);const tn=new ie().subVectors(Dt.point,Ft.localToWorld(new ie)).applyEuler(Ke);Qe.current.position.copy(tn),j()}}ze.current||(ze.current=!0)}}},yt=(Qe,Tt,Dt)=>{t(lt=>{for(const zt of lt.elements)if(zt.id===Qe){me.isFoundationOrCuboid(zt)||(zt.parentId=Tt),zt.cx=Dt.x,zt.cy=Dt.y,zt.cz=Dt.z;break}})},ct=()=>{if(!N.current)return;const Qe={name:"Resize",timestamp:Date.now(),resizedElementId:N.current.id,resizedElementType:N.current.type,oldCx:F.current.x,oldCy:F.current.y,oldCz:F.current.z,newCx:U.current.x,newCy:U.current.y,newCz:U.current.z,oldLx:te.current.x,oldLy:te.current.y,oldLz:te.current.z,newLx:re.current.x,newLy:re.current.y,newLz:re.current.z,oldChildrenPositionsMap:new Map(O.current),newChildrenPositionsMap:new Map(B.current),oldPolygonVerticesMap:new Map(_.current),newPolygonVerticesMap:new Map(X.current),oldChildrenParentIdMap:new Map(le.current),newChildrenParentIdMap:new Map(q.current),oldWallPointsMap:new Map($.current),newWallPointsMap:new Map(Q.current),undo:()=>{var Tt,Dt;if(t(lt=>{for(const zt of lt.elements)if(zt.id===Qe.resizedElementId){zt.cx=Qe.oldCx,zt.cy=Qe.oldCy,zt.cz=Qe.oldCz,zt.lx=Qe.oldLx,zt.ly=Qe.oldLy,zt.lz=Qe.oldLz;break}}),Qe.oldChildrenPositionsMap.size>0)for(const[lt,zt]of Qe.oldChildrenPositionsMap.entries()){const Ft=a(lt);if((Ft==null?void 0:Ft.type)!==z.Polygon){t(Qt=>{for(const gn of Qt.elements)if(gn.id===lt){if(gn.cx=zt.x,gn.cy=zt.y,Ut(gn)||(gn.cz=zt.z),gn.type===z.Wall){const an=gn,mn=Qe.oldWallPointsMap.get(an.id);mn&&(an.leftPoint=[mn[0].x,mn[0].y,0],an.rightPoint=[mn[1].x,mn[1].y,0])}break}Qe.oldWallPointsMap.size>0&&(Qt.updateWallMapOnFoundationFlag=!Qt.updateWallMapOnFoundationFlag)});const _t=(Tt=Qe.oldChildrenParentIdMap)==null?void 0:Tt.get(lt),tn=(Dt=Qe.newChildrenParentIdMap)==null?void 0:Dt.get(lt);_t&&tn&&_t!==tn&&(it(_t,tn,lt),ke(_t,lt))}}if(Qe.oldPolygonVerticesMap.size>0)for(const[lt,zt]of Qe.oldPolygonVerticesMap.entries()){const Ft=a(lt);(Ft==null?void 0:Ft.type)===z.Polygon&&p(lt,zt)}},redo:()=>{var Tt,Dt;if(t(lt=>{for(const zt of lt.elements)if(zt.id===Qe.resizedElementId){zt.cx=Qe.newCx,zt.cy=Qe.newCy,zt.cz=Qe.newCz,zt.lx=Qe.newLx,zt.ly=Qe.newLy,zt.lz=Qe.newLz;break}}),Qe.newChildrenPositionsMap.size>0)for(const[lt,zt]of Qe.newChildrenPositionsMap.entries()){t(tn=>{for(const Qt of tn.elements)if(Qt.id===lt){if(Qt.cx=zt.x,Qt.cy=zt.y,(Qt.type!==z.SolarPanel||Qt.parentType!==z.Roof)&&(Qt.cz=zt.z),Qt.type===z.Wall){const gn=Qt,an=Qe.newWallPointsMap.get(gn.id);an&&(gn.leftPoint=[an[0].x,an[0].y,0],gn.rightPoint=[an[1].x,an[1].y,0])}break}Qe.newWallPointsMap.size>0&&(tn.updateWallMapOnFoundationFlag=!tn.updateWallMapOnFoundationFlag)});const Ft=(Tt=Qe.oldChildrenParentIdMap)==null?void 0:Tt.get(lt),_t=(Dt=Qe.newChildrenParentIdMap)==null?void 0:Dt.get(lt);Ft&&_t&&Ft!==_t&&(it(_t,Ft,lt),ke(_t,lt))}if(Qe.newPolygonVerticesMap.size>0)for(const[lt,zt]of Qe.newPolygonVerticesMap.entries()){const Ft=a(lt);(Ft==null?void 0:Ft.type)===z.Polygon&&p(lt,zt)}}};return Qe},Xe=(Qe,Tt)=>{var Ft,_t;const Dt=Fn.getState().contentRef,lt=me.getObjectChildById(Dt==null?void 0:Dt.current,Qe.id);if(lt){for(const tn of lt.children)if(tn.name.includes(`${Tt.id}`)){(_t=(Ft=Fn.getState().contentRef)==null?void 0:Ft.current)==null||_t.add(tn);break}}Tt.parentId=Zo;const zt=new ie(Tt.cx,Tt.cy,Tt.cz).applyEuler(new nn(0,0,Qe.rotation[2])).add(F.current);Tt.cx=zt.x,Tt.cy=zt.y,Tt.cz=0,B.current.set(Tt.id,new ie(zt.x,zt.y,0)),q.current.set(Tt.id,Zo)},ut=Qe=>{Qe.intersections.length>0&&Qe.intersections[0].object===L.current&&t(Dt=>{vx.selectNone(Dt),Dt.pastePoint.copy(Qe.intersections[0].point),Dt.clickObjectType=z.Ground,Dt.contextMenuObjectType=z.Ground,Dt.pasteNormal=Io})},ft=Qe=>{const Tt=H.getState().resizeHandleType;switch(Qe.type){case z.Tree:switch(Tt){case vt.Top:{const Dt={name:"Change Tree Height",timestamp:Date.now(),changedElementId:Qe.id,changedElementType:Qe.type,oldValue:te.current.z,newValue:Qe.lz,undo:()=>{s(Dt.changedElementId,Dt.oldValue)},redo:()=>{s(Dt.changedElementId,Dt.newValue)}};f(Dt),t(lt=>{lt.actionState.treeHeight=Qe.lz});return}case vt.Left:case vt.Right:case vt.Lower:case vt.Upper:{const Dt={name:"Change Tree Spread",timestamp:Date.now(),changedElementId:Qe.id,changedElementType:Qe.type,oldValue:te.current.x,newValue:Qe.lx,undo:()=>{l(Dt.changedElementId,Dt.oldValue)},redo:()=>{l(Dt.changedElementId,Dt.newValue)}};f(Dt),t(lt=>{lt.actionState.treeSpread=Qe.lx});return}}break;case z.Wall:{const Dt={name:"Change Wall Height",timestamp:Date.now(),changedElementId:Qe.id,changedElementType:Qe.type,oldValue:te.current.z,newValue:Qe.lz,undo:()=>{s(Dt.changedElementId,Dt.oldValue)},redo:()=>{s(Dt.changedElementId,Dt.newValue)}};f(Dt),t(lt=>{lt.actionState.wallHeight=Qe.lz});return}}if(U.current.set(Qe.cx,Qe.cy,Qe.cz),re.current.set(Qe.lx,Qe.ly,Qe.lz),le.current.clear(),q.current.clear(),B.current.clear(),X.current.clear(),Q.current.clear(),t(Dt=>{if(Qe.type===z.Cuboid&&(Dt.actionState.cuboidHeight=Qe.lz),Dt.updateSceneRadius(),Dt.updateWallMapOnFoundationFlag=!Dt.updateWallMapOnFoundationFlag,Qe.parentId===Zo){for(const lt of Dt.elements)if(me.isPlantOrHuman(lt)&<.parentId===Qe.id&&(le.current.set(lt.id,Qe.id),!me.isResizingVertical(H.getState().resizeHandleType)))if(Math.abs(te.current.z/2-lt.cz)<.01){const zt=new ie(lt.cx,lt.cy,lt.cz).applyEuler(new nn(0,0,Qe.rotation[2])).add(F.current).sub(U.current).applyEuler(new nn(0,0,-Qe.rotation[2]));Math.abs(zt.x)>Math.abs(re.current.x/2)+.01||Math.abs(zt.y)>Math.abs(re.current.y/2)+.01?Xe(Qe,lt):(lt.cx=zt.x,lt.cy=zt.y)}else{const zt=new ie(lt.cx,lt.cy,lt.cz),Ft=new ie().subVectors(U.current,F.current),_t=new ie().subVectors(zt,Ft);Math.abs(zt.x/te.current.x)>.49?Math.abs(_t.y)>Qe.ly/2+.5?Xe(Qe,lt):(lt.cx=(zt.x>0?Qe.lx:-Qe.lx)/2,lt.cy=_t.y):Math.abs(zt.y/te.current.y)>.49&&(Math.abs(_t.x)>Qe.lx/2+.5?Xe(Qe,lt):(lt.cx=_t.x,lt.cy=(zt.y>0?Qe.ly:-Qe.ly)/2))}}}),U.current.distanceToSquared(F.current)>It&&re.current.distanceToSquared(te.current)>It){if(Qe.type===z.Foundation||Qe.type===z.Cuboid){const lt=n(Qe.id);if(lt.length>0)for(const zt of lt)if(zt.type===z.Polygon)X.current.set(zt.id,zt.vertices.map(Ft=>({...Ft})));else{if(zt.type===z.Wall){const Ft=zt,_t=new Xt(Ft.leftPoint[0],Ft.leftPoint[1]),tn=new Xt(Ft.rightPoint[0],Ft.rightPoint[1]);Q.current.set(zt.id,[_t,tn])}B.current.set(zt.id,new ie(zt.cx,zt.cy,zt.cz))}if(Qe.type===z.Foundation){const zt=Ht(Qe.id);if(zt.length>0)for(const Ft of zt){const _t=new ie(Ft.cx,Ft.cy);B.current.set(Ft.id,_t)}}}const Dt=ct();Dt&&f(Dt)}},ot=()=>{if(H.getState().viewState.orthographic)return!1;if(L.current){const Qe=Te.intersectObjects(E().scene.children,!0);if(Qe.length>0){for(const Tt of Qe)if(Tt.object.userData.stand)return!1}}return Te.intersectObjects([L.current]).length===0},st=Qe=>{t(Tt=>{for(const Dt of Tt.elements)if(Qe.has(Dt.id)){const lt=Qe.get(Dt.id);lt&&(Dt.cx=lt[0],Dt.cy=lt[1],Dt.cz=lt[2])}})},at=(Qe,Tt)=>{var zt,Ft,_t;if(Qe.locked)return;U.current.set(Qe.cx,Qe.cy,Qe.cz);let Dt=ne.current,lt=null;switch(Ne(Tt),Qe.type){case z.Tree:lt=(zt=Fn.getState().treeRef)==null?void 0:zt.current;break;case z.Flower:lt=(Ft=Fn.getState().flowerRef)==null?void 0:Ft.current;break;case z.Human:lt=(_t=Fn.getState().humanRef)==null?void 0:_t.current;break}if(lt&&ze.current){const tn=Te.intersectObjects(me.fetchIntersectables(W),!1),Qt=De(tn);if(Qt){const gn=Qt.point;if(Qt.object.name==="Ground")yt(Qe.id,Zo,gn),U.current.set(gn.x,gn.y,gn.z),Dt=Zo;else if(Qt.object.userData.stand){const an=Ye(Qt.object),mn=Qt.object.parent;if(mn){const Hn=new ie().subVectors(gn,mn.localToWorld(new ie)).applyEuler(Ke);yt(Qe.id,an,Hn),U.current.set(Hn.x,Hn.y,Hn.z),Dt=an}}}ze.current=!1}if(U.current.distanceToSquared(F.current)>It||Te.intersectObjects([L.current]).length===0){let tn=!0;if(!H.getState().viewState.orthographic&&(tn=U.current.length().02}if(!tn||ot()){o(Qe.id,F.current.x,F.current.y,F.current.z),lt&&me.isPlantOrHuman(Qe)&<.position.copy(F.current),me.isPlantOrHuman(Qe)&&ke(ne.current,Qe.id);const Qt=Fn.getState().contentRef;if(Qt!=null&&Qt.current&&ne.current&<){if(ne.current===Zo)Qt.current.add(lt);else{const gn=me.getObjectChildById(Qt.current,ne.current);gn==null||gn.add(lt)}j()}po(Y.t("message.CannotMoveObjectTooFar",ve))}else{if(Ie.current.size>1){ce.current.clear();for(const gn of H.getState().elements)ye.current.has(gn.id)&&ce.current.set(gn.id,[gn.cx,gn.cy,gn.cz]);const Qt={name:"Move Foundation Group",timestamp:Date.now(),oldPositionMap:new Map(ye.current),newPositionMap:new Map(ce.current),undo:()=>{st(Qt.oldPositionMap)},redo:()=>{st(Qt.newPositionMap)}};f(Qt)}else{const Qt=Qe.type===z.Cuboid,gn=Qt?fe.current:ne.current,an=Qt?Qe.parentId:Dt,mn={name:"Move",timestamp:Date.now(),movedElementId:Qe.id,movedElementType:Qe.type,oldCx:F.current.x,oldCy:F.current.y,oldCz:F.current.z,newCx:U.current.x,newCy:U.current.y,newCz:U.current.z,oldRotation:[...ae.current],newRotation:[...Qe.rotation],oldParentId:gn,newParentId:an,undo:()=>{o(mn.movedElementId,mn.oldCx,mn.oldCy,mn.oldCz),t(Hn=>{const Fo=Hn.elements.find(yo=>yo.id===mn.movedElementId);Fo&&mn.oldRotation&&(Fo.rotation=[...mn.oldRotation])}),ke(mn.oldParentId,mn.movedElementId),mn.movedElementType&&kt(mn.movedElementType)&&it(mn.oldParentId,mn.newParentId,mn.movedElementId)},redo:()=>{o(mn.movedElementId,mn.newCx,mn.newCy,mn.newCz),t(Hn=>{const Fo=Hn.elements.find(yo=>yo.id===mn.movedElementId);Fo&&mn.newRotation&&(Fo.rotation=[...mn.newRotation])}),ke(mn.newParentId,mn.movedElementId),mn.movedElementType&&kt(mn.movedElementType)&&it(mn.newParentId,mn.oldParentId,mn.movedElementId)}};f(mn)}Ie.current.clear(),g()}}},Oe=Qe=>{se.current=[...Qe.rotation];const Tt=new ie().fromArray(ae.current);if(new ie().fromArray(se.current).distanceToSquared(Tt)>It){const lt={name:"Rotate",timestamp:Date.now(),rotatedElementId:Qe.id,rotatedElementType:Qe.type,oldRotation:ae.current,newRotation:se.current,undo:()=>{r(lt.rotatedElementId,lt.oldRotation[0],lt.oldRotation[1],lt.oldRotation[2])},redo:()=>{r(lt.rotatedElementId,lt.newRotation[0],lt.newRotation[1],lt.newRotation[2])}};f(lt)}},Ze=Qe=>{if(Qe.button!==2){if(Fn.getState().setEnableOrbitController(!0),N.current){const Tt=a(N.current.id);if(Tt)if(xe.current)if(he.current=!1,xe.current=!1,t(Dt=>{Dt.addedFoundationId=null,Dt.updateSceneRadius()}),Tt.lx<=.1||Tt.ly<=.1)c(Tt.id,!1);else{const Dt={name:"Add",timestamp:Date.now(),addedElement:Tt,undo:()=>{c(Dt.addedElement.id,!1),g()},redo:()=>{t(lt=>{lt.elements.push(Dt.addedElement),lt.selectedElement=Dt.addedElement,lt.updateSceneRadius()})}};f(Dt)}else if(Se.current)if(He.current=!1,Se.current=!1,t(Dt=>{Dt.addedCuboidId=null,Dt.updateSceneRadius()}),Tt.lx<=.1||Tt.ly<=.1)c(Tt.id,!1);else{const Dt={name:"Add",timestamp:Date.now(),addedElement:Tt,undo:()=>{c(Dt.addedElement.id,!1),g()},redo:()=>{t(lt=>{lt.elements.push(Dt.addedElement),lt.selectedElement=Dt.addedElement,lt.updateSceneRadius()})}};f(Dt)}else H.getState().resizeHandleType?ft(Tt):H.getState().rotateHandleType?Oe(Tt):H.getState().moveHandleType&&at(Tt,Qe),Tt.type===z.Foundation&&ht.getState().updateFoundationMovedFlag()}t(Tt=>{Tt.moveHandleType=null,Tt.resizeHandleType=null,Tt.rotateHandleType=null}),Fn.setState({humanRef:null,treeRef:null,flowerRef:null}),ht.getState().set(Tt=>{Tt.showWallIntersectionPlaneId=null,Tt.oldParentId=null,Tt.oldFoundationId=null})}},St=(Qe,Tt)=>{const{pos:Dt}=me.getWorldDataById(Qe.id),lt=new ie(Dt.x,Dt.y),zt=new ie().subVectors(lt,Tt);Ie.current.set(Qe.id,zt),ye.current.set(Qe.id,[Qe.cx,Qe.cy,Qe.cz])},Pt=(Qe,Tt)=>{const Dt=Qe.intersections[0].point.clone().setZ(0);for(const lt of H.getState().elements)md(lt)&<.parentId===Zo&&!lt.locked&<.id!==Tt.id&&!Ie.current.has(lt.id)&&!me.isChild(Tt.id,lt.id)&&!me.isChild(lt.id,Tt.id)&&me.areTwoBasesOverlapped(lt,Tt)&&(St(lt,Dt),lt.enableGroupMaster&&Pt(Qe,lt)),lt.id===Tt.id&&St(lt,Dt)},Rt=(Qe,Tt)=>{Ie.current.clear(),ye.current.clear(),Tt.enableGroupMaster&&H.getState().moveHandleType&&Pt(Qe,Tt)},Ut=Qe=>{if(Qe.type===z.SolarPanel&&Qe.parentType===z.Roof||Qe.type===z.Window&&Qe.parentType===z.Roof)return!0},Ht=Qe=>H.getState().elements.filter(Tt=>Tt.foundationId!==Qe?!1:Tt.type===z.SolarPanel&&Tt.parentType===z.Roof||Tt.type===z.Window&&Tt.parentType===z.Roof||Tt.type===z.Sensor||Tt.type===z.Light),At=Qe=>{if(Qe.button===2||Qe.intersections.length===0||!L.current)return;if(he.current){Ne(Qe);const Dt=Te.intersectObjects([L.current]);Dt.length>0&&(Fn.getState().setEnableOrbitController(!1),t(lt=>{lt.moveHandleType=null,lt.resizeHandleType=vt.LowerRight,lt.resizeAnchor.copy(Dt[0].point)}),he.current=!1,xe.current=!0);return}if(He.current){Ne(Qe);const Dt=Te.intersectObjects([L.current]);Dt.length>0&&(Fn.getState().setEnableOrbitController(!1),t(lt=>{var zt;if(lt.moveHandleType=null,lt.resizeHandleType=vt.LowerRight,lt.resizeAnchor.copy(Dt[0].point),N.current){const Ft=dt(Qe,(zt=N.current)==null?void 0:zt.id);if(Ft){const _t=Te.intersectObjects([Ft.eventObject]);_t.length>0&<.resizeAnchor.copy(_t[0].point)}}}),He.current=!1,Se.current=!0);return}if(Qe.intersections[0].object===L.current){if(H.getState().multiSelectionsMode||t(Dt=>{Dt.clickObjectType=z.Ground,Dt.selectedElement=null,vx.selectNone(Dt),Dt.contextMenuObjectType=null}),Fe(y)){const Dt=Qe.intersections[0].point,lt=i(x,Dt),zt={name:"Add",timestamp:Date.now(),addedElement:lt,undo:()=>{c(zt.addedElement.id,!1),g()},redo:()=>{t(Ft=>{Ft.elements.push(zt.addedElement),Ft.selectedElement=zt.addedElement,Ft.updateSceneRadius()})}};f(zt),t(Ft=>{Ft.actionModeLock||(Ft.objectTypeToAdd=z.None),Ft.updateSceneRadius()})}N.current=null}else{const Dt=H.getState().selectedElementIdSet;if(Dt.size>1){const lt=H.getState().selectedElement;if(lt){N.current=lt,Ie.current.clear();for(const zt of H.getState().elements)if(me.isElementAllowedMultipleMoveOnGround(zt)&&Dt.has(zt.id))if(zt.enableGroupMaster)Pt(Qe,zt);else{const _t=Qe.intersections[0].point.clone().setZ(0);St(zt,_t)}}}else{const lt=e();if(lt&&Fe(lt.type)){if(N.current=lt,F.current.set(lt.cx,lt.cy,lt.cz),te.current.set(lt.lx,lt.ly,lt.lz),ae.current=[...lt.rotation],lt.type===z.Foundation||lt.type===z.Cuboid){const zt=n(lt.id);if(O.current.clear(),_.current.clear(),$.current.clear(),zt.length>0)for(const Ft of zt)if(Ft.type===z.Polygon)_.current.set(Ft.id,Ft.vertices.map(_t=>({..._t})));else{if(Ft.type===z.Wall){const _t=Ft,tn=new Xt(_t.leftPoint[0],_t.leftPoint[1]),Qt=new Xt(_t.rightPoint[0],_t.rightPoint[1]);$.current.set(Ft.id,[tn,Qt])}O.current.set(Ft.id,new ie(Ft.cx,Ft.cy,Ft.cz))}if(lt.type===z.Foundation){const Ft=Ht(lt.id);if(Ft.length>0)for(const _t of Ft){const tn=new ie(_t.cx,_t.cy);O.current.set(_t.id,tn)}}}switch(lt.type){case z.Tree:ne.current=lt.parentId,te.current.set(lt.lx,lt.ly,lt.lz);break;case z.Flower:ne.current=lt.parentId;break;case z.Human:ne.current=lt.parentId;break;case z.Cuboid:{if(md(lt)&<.parentId===Zo?Rt(Qe,lt):Ie.current.clear(),fe.current=lt.parentId,H.getState().moveHandleType){const{rot:gn}=me.getWorldDataById(lt.id),an=new nn(0,0,gn);switch(H.getState().moveHandleType){case Ho.Right:{pe.current.set(-lt.lx/2,0,0).applyEuler(an);break}case Ho.Left:{pe.current.set(lt.lx/2,0,0).applyEuler(an);break}case Ho.Lower:{pe.current.set(0,lt.ly/2,0).applyEuler(an);break}case Ho.Upper:{pe.current.set(0,-lt.ly/2,0).applyEuler(an);break}default:{pe.current.set(0,0,0);break}}}ge.current.clear();const{pos:Ft,rot:_t}=me.getWorldDataById(lt.id),tn=new ie(Ft.x,Ft.y,Ft.z),Qt=n(lt.id);if(Qt.length>0)for(const gn of Qt)switch(gn.type){case z.Cuboid:{const an=new ie(gn.cx,gn.cy,gn.cz).applyEuler(new nn(0,0,_t));an.add(tn),ge.current.set(gn.id,an);break}case z.Tree:case z.Flower:case z.Human:{const an=new ie(gn.cx,gn.cy,gn.cz).applyEuler(new nn(0,0,_t));an.add(tn),ge.current.set(gn.id,an);break}case z.SolarPanel:{const an=new ie(gn.cx,gn.cy,gn.cz).applyEuler(new nn(0,0,_t)).add(tn);ge.current.set(gn.id,an);break}case z.Light:case z.Sensor:if(me.isIdentical(gn.normal,rs)){const an=new ie(gn.cx*lt.lx,gn.cy*lt.ly,gn.cz*lt.lz).applyEuler(new nn(0,0,_t));an.add(tn),ge.current.set(gn.id,an)}break;case z.Polygon:if(me.isIdentical(gn.normal,rs)){const an=gn,mn=[];for(const Hn of an.vertices){const Fo=new Xt(Hn.x*lt.lx,Hn.y*lt.ly).rotateAround(si,_t);Fo.add(new Xt(tn.x,tn.y)),mn.push(Fo)}de.current.set(an.id,mn)}break}break}case z.Foundation:{md(lt)&&Rt(Qe,lt),ge.current.clear(),de.current.clear(),Z.current.clear();const zt=new Xt(lt.cx,lt.cy),Ft=new ie(lt.cx,lt.cy,lt.cz),_t=n(lt.id);if(_t.length>0){const Qt=lt.rotation[2];for(const gn of _t)switch(gn.type){case z.Wall:{const an=gn,mn=new Xt(an.cx,an.cy).rotateAround(si,Qt);mn.add(zt);const Hn=new Xt(an.leftPoint[0],an.leftPoint[1]).rotateAround(si,Qt);Hn.add(zt);const Fo=new Xt(an.rightPoint[0],an.rightPoint[1]).rotateAround(si,Qt);Fo.add(zt),Z.current.set(an.id,{centerPointAbsPos:mn,leftPointAbsPos:Hn,rightPointAbsPos:Fo});break}case z.Tree:case z.Flower:case z.Human:{const an=new ie(gn.cx,gn.cy,gn.cz).applyEuler(new nn(0,0,Qt));an.add(Ft),ge.current.set(gn.id,an);break}case z.SolarPanel:{const an=new ie(gn.cx,gn.cy,gn.cz).applyEuler(new nn(0,0,Qt)).add(Ft);ge.current.set(gn.id,an);break}case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:case z.WindTurbine:case z.Sensor:{const an=new ie(gn.cx*lt.lx,gn.cy*lt.ly,gn.cz*lt.lz).applyEuler(new nn(0,0,Qt));an.add(Ft),ge.current.set(gn.id,an);break}case z.Polygon:{const an=gn,mn=[];for(const Hn of an.vertices){const Fo=new Xt(Hn.x*lt.lx,Hn.y*lt.ly).rotateAround(si,Qt);Fo.add(zt),mn.push(Fo)}de.current.set(an.id,mn);break}}}const tn=Ht(lt.id);if(tn.length>0){const Qt=new nn(0,0,lt.rotation[2]);for(const gn of tn)if(gn.type===z.Window||gn.type===z.SolarPanel){const an=new ie(gn.cx,gn.cy).applyEuler(Qt);an.add(Ft),ge.current.set(gn.id,an)}else{const an=new ie(gn.cx*lt.lx,gn.cy*lt.ly).applyEuler(Qt);an.add(Ft),ge.current.set(gn.id,an)}}break}}}else N.current=null}}},kt=Qe=>Qe===z.Human||Qe===z.Tree||Qe===z.Flower,gt=(Qe,Tt)=>{if(Qe.tempHumanPlant.length===0){const Dt=Qe.elements.filter(zt=>kt(zt.type)&&me.isDescendantOf(zt,Tt));Qe.tempHumanPlant=Dt;const lt=new Set(Dt.map(zt=>zt.id));Qe.elements=Qe.elements.filter(zt=>!lt.has(zt.id))}},dt=(Qe,Tt)=>{const Dt=Qe.intersections.find(zt=>{const Ft=zt.eventObject;if(!Ft.name.includes("Cuboid"))return!1;const _t=Ft.name.split(" ");return _t.length!==2?!1:_t[1]!==Tt&&Ft.userData.stackable});if(!Dt)return;const lt=Dt.eventObject.name.split(" ")[1];if(!Ie.current.has(lt))return me.isChild(Tt,lt)?void 0:Dt};m.useEffect(()=>{N.current&&(D||y!==z.None)&&(he.current&&y!==z.Foundation?(he.current=!1,xe.current=!1,t(Qe=>{Qe.addedFoundationId=null,Qe.updateSceneRadius()}),ht.getState().setSelectButtonClicked(!1),c(N.current.id,!1),N.current=null):He.current&&y!==z.Cuboid&&(He.current=!1,Se.current=!1,t(Qe=>{Qe.addedCuboidId=null,Qe.updateSceneRadius()}),ht.getState().setSelectButtonClicked(!1),c(N.current.id,!1),N.current=null))},[y,D]);const Ct=Qe=>{if(N.current&&N.current.type&&!N.current.locked){Ne(Qe);let Tt;switch(N.current.type){case z.Foundation:k.current&&(Tt=Te.intersectObjects([k.current]),Tt.length>0&&(w?mt(Tt[0].point):b?je(Tt[0].point):C&&rt(Tt[0].point)));break;case z.Cuboid:if(k.current&&Be===eh.Horizontal&&(Tt=Te.intersectObjects([k.current]),Tt.length>0)){const Dt=Tt[0].point.clone(),lt=dt(Qe,N.current.id);if(w)if(Ie.current.size>1)mt(Dt);else if(lt){if(Tt=Te.intersectObjects([lt.eventObject]),Tt.length===0)return;Dt.copy(Tt[0].point).add(pe.current);const zt=lt.eventObject.name.split(" ")[1];t(Ft=>{const _t=Ft.elements.find(Qt=>{var gn;return Qt.id===((gn=Ft.selectedElement)==null?void 0:gn.id)}),tn=Ft.selectedElement;if(_t&&tn){const{pos:Qt,rot:gn}=me.getWorldDataById(zt),an=new ie().subVectors(Dt,Qt);if(an.applyEuler(new nn(0,0,-gn)),_t.cx=an.x,_t.cy=an.y,tn.parentId!==zt){_t.parentId!==zt&>(Ft,_t.id);const{rot:mn}=me.getWorldDataById(tn.id);_t.rotation[2]=mn-gn,_t.parentId=zt}else _t.parentId!==zt&&(_t.parentId!==tn.parentId&>(Ft,_t.id),_t.parentId=tn.parentId,_t.rotation[2]=tn.rotation[2])}})}else t(zt=>{const Ft=zt.elements.find(_t=>_t.id===N.current.id);if(Ft&&Ft.parentId!==Zo){Ft.parentId!==Zo&>(zt,Ft.id);const{rot:_t}=me.getWorldDataById(Ft.parentId);Ft.rotation[2]+=_t,Ft.parentId=Zo}}),mt(Dt);else if(b){const zt=a(N.current.id);zt&&zt.parentId===Zo&&je(Dt)}}break}}if(L.current){if(y!==z.None){Ne(Qe);const Tt=Te.intersectObjects([L.current]);if(Tt.length>0){const Dt=Tt[0].point;switch(y){case z.Foundation:{const lt=i(x,Dt);lt&&(t(zt=>{zt.addedFoundationId=lt.id,zt.objectTypeToAdd=z.None}),N.current=lt,he.current=!0);break}case z.Cuboid:{const lt=i(x,Dt);lt&&(t(zt=>{zt.addedCuboidId=lt.id,zt.objectTypeToAdd=z.None}),N.current=lt,He.current=!0);break}}}}if(N.current&&(he.current||He.current)){Ne(Qe);let Tt=Te.intersectObjects([L.current]);if(Tt.length===0)return;const Dt=Tt[0].point;if(N.current.type===z.Foundation)o(N.current.id,Dt.x,Dt.y);else if(N.current.type===z.Cuboid){const lt=dt(Qe,N.current.id);if(lt){if(Tt=Te.intersectObjects([lt.eventObject]),Tt.length===0)return;Dt.copy(Tt[0].point);const zt=lt.eventObject.name.split(" ")[1];t(Ft=>{const _t=Ft.elements.find(tn=>{var Qt;return tn.id===((Qt=N.current)==null?void 0:Qt.id)});if(_t){const{pos:tn,rot:Qt}=me.getWorldDataById(zt),gn=new ie().subVectors(Dt,tn);gn.applyEuler(new nn(0,0,-Qt)),_t.cx=gn.x,_t.cy=gn.y,_t.parentId=zt,_t.rotation[2]=-Qt}})}else t(zt=>{const Ft=zt.elements.find(_t=>{var tn;return _t.id===((tn=N.current)==null?void 0:tn.id)});if(Ft&&Ft.parentId!==Zo){const{rot:_t}=me.getWorldDataById(Ft.parentId);Ft.rotation[2]+=_t,Ft.parentId=Zo}}),o(N.current.id,Dt.x,Dt.y)}}}},tt=Qe=>{if(N.current&&N.current.type&&!N.current.locked){Ne(Qe);let Tt;if(k.current&&Be===eh.Vertical&&(Tt=Te.intersectObjects([k.current]),Tt&&Tt.length>0)){const Dt=Tt[0].point;switch(N.current.type){case z.Tree:{const lt=N.current;switch(b){case vt.Top:s(lt.id,Dt.z),t(zt=>{zt.selectedElementHeight=Math.max(1,Dt.z)});break;case vt.Left:case vt.Right:case vt.Upper:case vt.Lower:l(lt.id,2*Math.hypot(Dt.x-lt.cx,Dt.y-lt.cy));break}Ve(Fn.getState().treeRef,Qe);break}case z.Flower:{Ve(Fn.getState().flowerRef,Qe);break}case z.Human:{Ve(Fn.getState().humanRef,Qe);break}}}}},Fe=Qe=>Qe===z.Foundation||Qe===z.Cuboid||Qe===z.Tree||Qe===z.Flower||Qe===z.Human,qe=(Qe,Tt,Dt,lt,zt)=>{if(Qe){for(const Ft of Qe.children)if(Ft.name.includes("Human")||Ft.name.includes("Tree")||Ft.name.includes("Flower")){const _t=Ye(Ft),tn=ge.current.get(_t);if(tn)if(Math.abs(te.current.z/2-Ft.position.z)<.01){const Qt=new ie().subVectors(tn,lt).applyEuler(new nn(0,0,-zt));Ft.position.setX(Qt.x),Ft.position.setY(Qt.y)}else{const Qt=new ie().subVectors(tn,F.current).applyEuler(new nn(0,0,-zt)),gn=new ie().subVectors(lt,F.current),an=new ie().subVectors(Qt,gn);Math.abs(Qt.x/te.current.x)>.49?(Ft.position.setX((Qt.x>0?Tt:-Tt)/2),Ft.position.setY(an.y)):Math.abs(Qt.y/te.current.y)>.49&&(Ft.position.setX(an.x),Ft.position.setY((Qt.y>0?Dt:-Dt)/2))}}}},je=Qe=>{if(!N.current)return;const Tt=new Xt(Qe.x,Qe.y),Dt=new Xt(P.x,P.y),lt=Dt.distanceTo(Tt),zt=Math.atan2(Tt.x-P.x,Tt.y-P.y)+N.current.rotation[2];let Ft=Math.abs(lt*Math.sin(zt)),_t=Math.abs(lt*Math.cos(zt));const tn=new Xt().addVectors(Tt,Dt).multiplyScalar(.5);if(N.current.type===z.Cuboid&&(b===vt.Lower||b===vt.Upper||b===vt.Left||b===vt.Right)){const Qt=new ie(P.x,P.y),gn=N.current.rotation[2],an=new ie(Qe.x,Qe.y).sub(Qt).applyEuler(new nn(0,0,-gn)),mn=new ie(1,0,0);(b===vt.Upper||b===vt.Lower)&&mn.set(0,1,0),mn.applyEuler(new nn(0,0,gn));const Hn=Qt.clone().add(mn.clone().multiplyScalar(an.x/2));b===vt.Left||b===vt.Right?(Ft=Math.abs(an.x),_t=N.current.ly):(b===vt.Upper||b===vt.Lower)&&(Ft=N.current.lx,_t=Math.abs(an.y),Hn.copy(Qt.add(mn.clone().multiplyScalar(an.y/2)))),tn.x=Hn.x,tn.y=Hn.y}switch(t(Qt=>{if(!N.current)return;let gn=!1;for(const an of Qt.elements)if(an.id===N.current.id){switch(an.type){case z.Cuboid:case z.Foundation:{const mn=n(an.id);if(mn.length>0){const Hn=[];for(const yo of mn){if(me.isPlantOrHuman(yo))continue;const So=JSON.parse(JSON.stringify(yo));if(Hn.push(So),me.isIdentical(So.normal,rs))if(yo.type===z.Wall){const $o=Z.current.get(yo.id);if($o){const mo=-an.rotation[2],{centerPointAbsPos:Jn,leftPointAbsPos:uo,rightPointAbsPos:ir}=$o,Rr=new Xt().subVectors(Jn,tn).rotateAround(si,mo),br=new Xt().subVectors(uo,tn).rotateAround(si,mo),Vr=new Xt().subVectors(ir,tn).rotateAround(si,mo);switch(b){case vt.Lower:case vt.Upper:So.cy=Rr.y;break;case vt.Left:case vt.Right:So.cx=Rr.x;break;case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:So.cx=Rr.x,So.cy=Rr.y;break}So.leftPoint=[br.x,br.y,0],So.rightPoint=[Vr.x,Vr.y,0]}}else{const $o=ge.current.get(yo.id);if($o){const mo=-an.rotation[2],Jn=new Xt().subVectors(new Xt($o.x,$o.y),tn).rotateAround(si,mo);switch(b){case vt.Lower:case vt.Upper:So.type===z.SolarPanel?So.cy=Jn.y:So.cy=Jn.y/_t;break;case vt.Left:case vt.Right:So.type===z.SolarPanel?So.cx=Jn.x:So.cx=Jn.x/Ft;break;case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:So.type===z.SolarPanel?(So.cx=Jn.x,So.cy=Jn.y):(So.cx=Jn.x/Ft,So.cy=Jn.y/_t);break}}}else if(So.type===z.SolarPanel&&So.parentType===z.Roof){const $o=ge.current.get(yo.id);if($o){const mo=new Xt().subVectors(new Xt($o.x,$o.y),tn).rotateAround(si,-an.rotation[2]);So.cx=mo.x,So.cy=mo.y}}}const Fo=JSON.parse(JSON.stringify(an));switch(b){case vt.Lower:case vt.Upper:case vt.Left:case vt.Right:case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:Fo.lx=Ft,Fo.ly=_t,Fo.cx=tn.x,Fo.cy=tn.y;break}if(me.doesParentContainAllChildren(Fo,Hn)){switch(b){case vt.Lower:case vt.Upper:case vt.Left:case vt.Right:case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:an.lx=Ft,an.ly=_t,an.cx=tn.x,an.cy=tn.y;break}gn=!0}}else if(Ft>.49&&_t>.49){switch(b){case vt.Lower:case vt.Upper:case vt.Left:case vt.Right:case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:an.lx=Ft,an.ly=_t,an.cx=tn.x,an.cy=tn.y;break}gn=!0}break}}break}if(gn)for(const an of Qt.elements){if(an.parentId===N.current.id)switch(an.type){case z.Wall:{const mn=an,Hn=Z.current.get(an.id);if(Hn){const Fo=-N.current.rotation[2],{centerPointAbsPos:yo,leftPointAbsPos:So,rightPointAbsPos:$o}=Hn,mo=new Xt().subVectors(yo,tn).rotateAround(si,Fo),Jn=new Xt().subVectors(So,tn).rotateAround(si,Fo),uo=new Xt().subVectors($o,tn).rotateAround(si,Fo);switch(b){case vt.Lower:case vt.Upper:an.cy=mo.y;break;case vt.Left:case vt.Right:an.cx=mo.x;break;case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:an.cx=mo.x,an.cy=mo.y;break}mn.leftPoint=[Jn.x,Jn.y,0],mn.rightPoint=[uo.x,uo.y,0]}break}case z.SolarPanel:{const mn=ge.current.get(an.id);if(mn){const Hn=new Xt().subVectors(new Xt(mn.x,mn.y),tn).rotateAround(si,-N.current.rotation[2]),[Fo,yo,So]=an.normal;me.isEqual(So,1)&&(an.cx=Hn.x,an.cy=Hn.y),me.isEqual(Fo,0)&&me.isEqual(yo,1)?an.cy=_t/2:me.isEqual(Fo,0)&&me.isEqual(yo,-1)?an.cy=-_t/2:me.isEqual(Fo,-1)&&me.isEqual(yo,0)?an.cx=-Ft/2:me.isEqual(Fo,1)&&me.isEqual(yo,0)&&(an.cx=Ft/2)}break}case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:case z.WindTurbine:case z.Sensor:if(me.isIdentical(an.normal,rs)){const mn=ge.current.get(an.id);if(mn){const Hn=new Xt().subVectors(new Xt(mn.x,mn.y),tn).rotateAround(si,-N.current.rotation[2]);switch(b){case vt.Lower:case vt.Upper:an.cy=Hn.y/_t;break;case vt.Left:case vt.Right:an.cx=Hn.x/Ft;break;case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:an.cx=Hn.x/Ft,an.cy=Hn.y/_t;break}}}break;case z.Cuboid:{const mn=ge.current.get(an.id);if(mn){const Hn=new Xt().subVectors(new Xt(mn.x,mn.y),tn).rotateAround(si,-N.current.rotation[2]);switch(b){case vt.Lower:case vt.Upper:an.cy=Hn.y;break;case vt.Left:case vt.Right:an.cx=Hn.x;break;case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:an.cx=Hn.x,an.cy=Hn.y;break}}break}case z.Polygon:if(me.isIdentical(an.normal,rs)){const mn=an,Hn=de.current.get(mn.id);if(Hn){const Fo=[];Hn.forEach(yo=>{const So=new Xt().subVectors(yo,tn).rotateAround(si,-N.current.rotation[2]);Fo.push({x:So.x/Ft,y:So.y/_t})}),mn.vertices=Fo}}break}if(an.foundationId===N.current.id&&(an.type===z.SolarPanel||an.type===z.Window)&&an.parentType===z.Roof){const mn=ge.current.get(an.id);if(mn){const Hn=new Xt().subVectors(new Xt(mn.x,mn.y),tn).rotateAround(si,-N.current.rotation[2]);an.cx=Hn.x,an.cy=Hn.y}}if(an.foundationId===N.current.id&&(an.type===z.Sensor||an.type===z.Light)&&an.parentType===z.Roof){const mn=ge.current.get(an.id);if(mn){const Hn=new Xt().subVectors(new Xt(mn.x,mn.y),tn).rotateAround(si,-N.current.rotation[2]);an.cx=Hn.x/Ft,an.cy=Hn.y/_t}}}}),N.current.type){case z.Foundation:{const Qt=Fn.getState().foundationRef;Qt!=null&&Qt.current&&qe(Qt==null?void 0:Qt.current,Ft,_t,Qt.current.position,N.current.rotation[2]);break}case z.Cuboid:{const Qt=Fn.getState().cuboidRef;Qt!=null&&Qt.current&&Qt.current.parent&&qe(Qt==null?void 0:Qt.current,Ft,_t,Qt.current.parent.position,N.current.rotation[2]);break}}},rt=Qe=>{const{cx:Tt,cy:Dt}=N.current,lt=Math.atan2(Tt-Qe.x,Qe.y-Dt)+(C===Kr.Upper?0:Math.PI),zt=Math.abs(lt)>Math.PI?-Math.sign(lt)*la:0;r(N.current.id,0,0,lt+zt)},mt=Qe=>{const Tt=Ie.current.size>1;if(Tt){t(_t=>{for(const tn of _t.elements)if(md(tn)&&Ie.current.has(tn.id)){const Qt=Ie.current.get(tn.id);Qt&&(tn.cx=Qe.x+Qt.x,tn.cy=Qe.y+Qt.y)}});return}let Dt,lt;const zt=N.current.lx/2,Ft=N.current.ly/2;switch(w){case Ho.Top:{if(Tt){const _t=new ie(Qe.x,Qe.y);t(tn=>{for(const Qt of tn.elements)if(Qt.id===N.current.id)Qt.cx=_t.x,Qt.cy=_t.y;else if(Ie.current.has(Qt.id)){const gn=Ie.current.get(Qt.id);if(gn){const an=new ie().addVectors(_t,gn);Qt.cx=an.x,Qt.cy=an.y}}})}else o(N.current.id,Qe.x,Qe.y);break}case Ho.Upper:if(Dt=Qe.x+Ee*Ft,lt=Qe.y-Pe*Ft,Tt){const _t=new ie(Dt,lt);t(tn=>{for(const Qt of tn.elements)if(Qt.id===N.current.id)Qt.cx=_t.x,Qt.cy=_t.y;else if(Ie.current.has(Qt.id)){const gn=Ie.current.get(Qt.id);if(gn){const an=new ie().addVectors(_t,gn);Qt.cx=an.x,Qt.cy=an.y}}})}else o(N.current.id,Dt,lt);break;case Ho.Lower:if(Dt=Qe.x-Ee*Ft,lt=Qe.y+Pe*Ft,Tt){const _t=new ie(Dt,lt);t(tn=>{for(const Qt of tn.elements)if(Qt.id===N.current.id)Qt.cx=_t.x,Qt.cy=_t.y;else if(Ie.current.has(Qt.id)){const gn=Ie.current.get(Qt.id);if(gn){const an=new ie().addVectors(_t,gn);Qt.cx=an.x,Qt.cy=an.y}}})}else o(N.current.id,Dt,lt);break;case Ho.Left:if(Dt=Qe.x+Pe*zt,lt=Qe.y+Ee*zt,Tt){const _t=new ie(Dt,lt);t(tn=>{for(const Qt of tn.elements)if(Qt.id===N.current.id)Qt.cx=_t.x,Qt.cy=_t.y;else if(Ie.current.has(Qt.id)){const gn=Ie.current.get(Qt.id);if(gn){const an=new ie().addVectors(_t,gn);Qt.cx=an.x,Qt.cy=an.y}}})}else o(N.current.id,Dt,lt);break;case Ho.Right:if(Dt=Qe.x-Pe*zt,lt=Qe.y-Ee*zt,Tt){const _t=new ie(Dt,lt);t(tn=>{for(const Qt of tn.elements)if(Qt.id===N.current.id)Qt.cx=_t.x,Qt.cy=_t.y;else if(Ie.current.has(Qt.id)){const gn=Ie.current.get(Qt.id);if(gn){const an=new ie().addVectors(_t,gn);Qt.cx=an.x,Qt.cy=an.y}}})}else o(N.current.id,Dt,lt);break}};return m.useEffect(()=>{const Qe=()=>{const Tt=H.getState().addedFoundationId,Dt=H.getState().addedCuboidId;Tt&&(c(Tt,!1),t(lt=>{lt.objectTypeToAdd=z.Foundation,lt.addedFoundationId=null}),Fn.getState().setEnableOrbitController(!0),N.current=null,he.current=!1,xe.current=!1),Dt&&(c(Dt,!1),t(lt=>{lt.objectTypeToAdd=z.Cuboid,lt.addedCuboidId=null}),Fn.getState().setEnableOrbitController(!0),N.current=null,He.current=!1,Se.current=!1)};return window.addEventListener("beforeunload",Qe),()=>{window.removeEventListener("beforeunload",Qe)}},[]),h.jsxs(h.Fragment,{children:[N.current&&Be!==eh.Ground&&h.jsx(ua,{ref:k,visible:!1,name:"Ground Intersection Plane",rotation:We,position:Je,args:[1e5,1e5],onPointerMove:L2.throttle(tt,VF,{trailing:!1}),children:h.jsx("meshStandardMaterial",{side:$r,opacity:.5,transparent:!0})}),h.jsx(ua,{receiveShadow:v,ref:L,name:"Ground",userData:{stand:!0},rotation:[0,0,0],position:[0,0,0],args:[1e4,1e4],renderOrder:-2,onContextMenu:ut,onPointerDown:At,onPointerMove:L2.throttle(Ct,VF,{trailing:!1}),children:M&&!A?h.jsx("meshBasicMaterial",{color:T}):h.jsx("meshStandardMaterial",{depthTest:!1,color:A?"white":T,map:A?me.WATER_TEXTURE:me.WHITE_TEXTURE,needsUpdate:!0})})]})}),nae=48,mnn=72,ynn=12,Ann=be.memo(({date:t,hourAngle:e,declinationAngle:n,worldLatitude:o})=>{const r=H(Ug),i=H(RBe),a=H(wBe)??!0,l=H(vBe)??!0,s=H(xBe)??!0,[c,u]=m.useState(me.toRadians(42)),d=bb(Bye),f=Math.max(2,r*.2),p=Math.max(.4,r*.025),g=o3(lW,fN),y=r*.05,w={font:g,height:0,size:y},b=6,C=new Array(2*b+1).fill(0),P=_=>_===0?-y*.3:_>0&&_<7?-y*.8:-y*1.2;m.useEffect(()=>{u(me.toRadians(o))},[o]);const v=6,[T,A]=m.useMemo(()=>{const _=new Ni,X=new Ni,$=[],Q=[],le=la/mnn;let q=0;for(let ne=0;neIt&&(ge=.05*r+(q%3===0?.2:0),de=new ie(r,fe,0),de.z=.002,Q.push(me.sphericalToCartesianZ(de)),de=new ie(r+ge,fe,0),de.z=.002,Q.push(me.sphericalToCartesianZ(de))),q++}const te=$.length*3,re=new Float32Array(te),ae=new Float32Array(te),se=new Float32Array(te);for(let ne=0;ne<$.length;ne++){const fe=ne*3;re[fe]=$[ne].x,re[fe+1]=$[ne].y,re[fe+2]=$[ne].z,ae[fe]=0,ae[fe+1]=1,ae[fe+2]=0;const ge=Math.floor(ne/18)%2===0?.2:1;se[fe]=ge,se[fe+1]=ge,se[fe+2]=ge}return _.setAttribute("position",new nl(re,3)),_.setAttribute("normal",new nl(ae,3)),_.setAttribute("color",new nl(se,3)),X.setFromPoints(Q),[_,X]},[r]),x=m.useMemo(()=>{const _=[],X=dl(t,me.toDegrees(c)),$=hO(X.sunrise),Q=hO(X.sunset),le=(Q-$)/nae;for(let q=$;q-.01&&_.push(te)}return _},[t,c,r,n]),S=_=>{const X=hN(_),$=[],Q=dl(_,me.toDegrees(c)),le=hO(Q.sunrise),q=hO(Q.sunset),te=(q-le)/nae;for(let re=le;re-.01&&$.push(ae)}return $},R=m.useMemo(()=>{const _=[];for(let X=0;X<=v;X++){const $=new Date(2021,X===0?11:X-1,22);_.push(S($))}return _},[c,r]),M=m.useMemo(()=>a9(r,e,n,c),[c,n,e,r]),D=m.useMemo(()=>M.clone().normalize(),[M]),E=m.useMemo(()=>new ie(M.x,M.y,0).normalize(),[M]),W=m.useMemo(()=>Math.asin(M.z/M.length()),[M]),j=m.useMemo(()=>{const X=new D2(0,0,f,f,0,W,!1,0).getPoints(25),$=new Array;for(const Q of X)$.push(new ie(Q.x,Q.y,0));return $},[W,M,f]),L=m.useMemo(()=>Math.acos(M.z/M.length()),[M]),k=m.useMemo(()=>{const X=new D2(0,0,f*.8,f*.8,W,Gt,!1,0).getPoints(25),$=new Array;for(const Q of X)$.push(new ie(Q.x,Q.y,0));return $},[L,M,f,W]),N=m.useMemo(()=>{const _=Math.acos(M.y/Math.hypot(M.x,M.y));return M.x>0?-_:_},[M]),F=m.useMemo(()=>{const X=new D2(0,0,f*1.2,f*1.2,Gt,Gt+N,M.x>0,0).getPoints(50),$=new Array;for(const Q of X)$.push(new ie(Q.x,Q.y,0));return $},[N,M,f]),U=m.useMemo(()=>{const _=2*lP/ynn,X=la/nae,$=new Ni;let Q=0;const le=[],q=[];for(let te=-lP;teMath.PI&&(ae=Math.PI),se>lP&&(se=lP);const ne=a9(r,re,te,c),fe=a9(r,ae,te,c),ge=a9(r,ae,se,c),de=a9(r,re,se,c);(ne.z>=0||fe.z>=0||ge.z>=0||de.z>=0)&&(le.push(ne,fe,ge,de),q.push(Q),q.push(Q+1),q.push(Q+2),q.push(Q),q.push(Q+2),q.push(Q+3),Q+=4)}return $.setFromPoints(le),$.setIndex(new nl(new Uint16Array(q),1)),$},[c,r]),O=.05*r,B=2+5*O;return h.jsxs("group",{children:[C.map((_,X)=>{let $=Math.ceil(X/2)*(X%2===0?1:-1);$===-b&&($=b);const Q=P(Math.abs($));return h.jsx("group",{rotation:[Gt,$*Math.PI/b,0],children:h.jsxs("mesh",{position:[Q,0,-r*1.1],rotation:[-Gt,0,0],children:[h.jsx("textGeometry",{args:[`${-(180/b)*$}°`,w]}),h.jsx("meshStandardMaterial",{attach:"material",color:"lightGray"})]})},X)}),h.jsxs("mesh",{rotation:new nn(0,0,0),name:"Heliodon",children:[h.jsxs("mesh",{children:[h.jsx("bufferGeometry",{...T}),h.jsx("meshBasicMaterial",{side:$r,vertexColors:!0,polygonOffset:!0,polygonOffsetFactor:-.7,polygonOffsetUnits:-2})]}),h.jsxs("lineSegments",{children:[h.jsx("bufferGeometry",{...A}),h.jsx("meshBasicMaterial",{color:0})]}),h.jsxs("mesh",{children:[x.length>3&&h.jsx(jn,{lineWidth:2,points:x,color:"yellow"}),R.filter(_=>_.length>3).map((_,X)=>h.jsx(jn,{opacity:X===0||X===v?1:.5,lineWidth:X===0||X===v?1:.5,points:_,color:"#999"},X)),h.jsx("mesh",{args:[U],children:h.jsx("meshBasicMaterial",{side:$r,color:[1,1,0],transparent:!0,opacity:.5,depthWrite:!1,clippingPlanes:[new l9(Oc,0)]})}),h.jsx("mesh",{position:M,children:h.jsx("sprite",{scale:[B,B,B],children:h.jsx("spriteMaterial",{map:d,transparent:!1,color:16777215,blending:nR,depthWrite:!1})})}),h.jsxs("mesh",{position:M,children:[h.jsx("sphereGeometry",{args:[O,10,10]}),h.jsx("meshBasicMaterial",{color:"white"})]})]})]}),h.jsx(ua,{args:[1e4,1e4],renderOrder:-1,userData:{unintersectable:!0},children:h.jsx("meshBasicMaterial",{transparent:!0,opacity:0})}),i&&M.z>0&&h.jsxs(h.Fragment,{children:[h.jsx(jn,{userData:{unintersectable:!0},points:[[0,0,0],[M.x,M.y,M.z]],name:"Line from origin to sun",lineWidth:.5,color:"white"}),h.jsx(jn,{userData:{unintersectable:!0},points:[[0,0,0],[M.x,M.y,0]],name:"Line from origin to sun projection on ground",lineWidth:.5,color:"white"}),h.jsx(jn,{userData:{unintersectable:!0},points:[[M.x,M.y,0],[M.x,M.y,M.z]],name:"Line from sun projection on ground to sun",lineWidth:.5,color:"white"}),l&&h.jsxs(h.Fragment,{children:[h.jsx(jn,{userData:{unintersectable:!0},linewidth:.5,points:j,position:[0,0,0],rotation:new nn(Gt,0,Gt+N,"ZXY"),color:"white",name:"Elevation Angle Arc"}),h.jsx("textSprite",{userData:{unintersectable:!0},name:"Elevation Angle",backgroundColor:"indigo",text:me.toDegrees(W).toFixed(0)+"°",fontSize:80,fontFace:"Times Roman",textHeight:p,position:D.clone().multiplyScalar(f).add(E.clone().multiplyScalar(f)).multiplyScalar(.65)})]}),s&&h.jsxs(h.Fragment,{children:[h.jsx(jn,{userData:{unintersectable:!0},linewidth:.5,points:k,position:[0,0,0],rotation:new nn(Gt,0,Gt+N,"ZXY"),color:"white",name:"Zenith Angle Arc"}),h.jsx("textSprite",{userData:{unintersectable:!0},name:"Zenith Angle",backgroundColor:"navy",text:me.toDegrees(L).toFixed(0)+"°",fontSize:80,fontFace:"Times Roman",textHeight:p,position:D.clone().multiplyScalar(f).add(Io.clone().multiplyScalar(f)).multiplyScalar(.57)})]}),a&&h.jsxs(h.Fragment,{children:[h.jsx(jn,{userData:{unintersectable:!0},linewidth:.5,points:F,position:[0,0,0],color:"white",name:"Azimuth Angle Arc"}),h.jsx("textSprite",{userData:{unintersectable:!0},name:"Azimuth Angle",backgroundColor:"firebrick",text:me.toDegrees(Math.abs(N-Math.PI)<1e-6?N:-N).toFixed(0)+"°",fontSize:80,fontFace:"Times Roman",textHeight:p,position:E.clone().multiplyScalar(f).add(Oc.clone().multiplyScalar(f)).multiplyScalar(1.1).add(new ie(0,0,p/2))})]})]})]})}),wnn=be.memo(()=>{const t=H(CBe),e=H(Ug),n=H(Tc),o=H(rl),r=H(B7t),i=m.useMemo(()=>new Date(o),[o]),[a,l]=m.useMemo(()=>[jye(i),hN(i)],[i]);return m.useEffect(()=>{r(a9(e,a,l,me.toRadians(n)))},[n,a,l,e]),h.jsx(h.Fragment,{children:t&&h.jsx(Ann,{date:new Date(o),hourAngle:a,declinationAngle:l,worldLatitude:n})})}),KTe="/aladdin/assets/ifi-logo-CwxGDl7t.png",vnn="/aladdin/assets/magic-lamp-XxXOV1dq.png",xnn=be.memo(({top:t,height:e,color:n})=>{const o=H(s0),r=m.useMemo(()=>({lng:o}),[o]),i=t+56+"px",a=t+100+"px",l=t+205+"px";return h.jsxs("div",{children:[h.jsxs("div",{style:{position:"absolute",borderRadius:"20px",border:"thin",textAlign:"center",left:"15%",right:"15%",top:t+"px",height:(e??300)+"px"},children:[h.jsx("h2",{style:{marginTop:"20px",color:n},children:Y.t("aboutUs.ProductBroughtToYouBy",r)}),h.jsxs("p",{style:{paddingTop:"6px",fontSize:"12px",color:n},children:[h.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://intofuture.org/aladdin-terms.html",style:{color:n,textDecoration:"none"},children:Y.t("aboutUs.TermsOfService",r)}),"   |   ",h.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://intofuture.org/aladdin-privacy.html",style:{color:n,textDecoration:"none"},children:Y.t("aboutUs.PrivacyPolicy",r)})]})]}),h.jsxs("div",{children:[h.jsx("hr",{style:{position:"absolute",left:"10%",width:"80%",marginTop:i,color:n}}),h.jsx("table",{style:{position:"absolute",border:"none",top:a,left:"10%",width:"80%",fontSize:"small",color:n},children:h.jsx("tbody",{children:h.jsxs("tr",{style:{verticalAlign:"top"},children:[h.jsxs("td",{children:[h.jsx("h3",{style:{color:n},children:Y.t("aboutUs.Software",r)}),"Xiaotong Ding",h.jsx("br",{}),"Charles Xie",h.jsx("br",{})]}),h.jsxs("td",{children:[h.jsx("h3",{style:{color:n},children:Y.t("aboutUs.Content",r)}),"Charles Xie",h.jsx("br",{})]}),h.jsxs("td",{children:[h.jsx("h3",{style:{color:n},children:Y.t("aboutUs.Support",r)}),"Charles Xie",h.jsx("br",{})]})]})})})]}),h.jsxs("div",{style:{position:"absolute",left:"10%",marginRight:"10%",top:l,fontSize:"12px",textAlign:"justify",color:n},children:[Y.t("aboutUs.Translators",r),": ",s9.Ukrainian," (Andriy Kashyrskyy), ",s9.Spanish," (Alex Barco), ",s9.Turkish," (Hasan Bircan)",h.jsx("br",{}),h.jsx("br",{}),Y.t("aboutUs.Acknowledgment",r),": ",Y.t("aboutUs.FundingInformation",r)," ",Y.t("aboutUs.Contact",r)]})]})}),bnn=Ro.div` +`,unn=be.memo(function({initializing:e}){const n=ht(h7t),o=ht(Rf),r=ht(UYe),i=ht(Uge),a=ht(jYe),l=H(Tge),s=H(Pge),c=H(Sge),u=H(OBe),d=H(I8t),f=ht(VYe),p=ht(GYe),g=ht(pOe),y=ht(gOe),w=ht(sOe),b=ht(cOe),C=ht(pW),P=ht(hW),v=ht(Oq),T=H.getState().elements;return h.jsx(h.Fragment,{children:(e||n||o||r)&&h.jsxs(h.Fragment,{children:[o&&(!c&&C||!d&&(P||v)||!l&&(g||y)||!u&&(w||b)||!s&&(f||p)||me.hasMovingParts(T))&&h.jsx(lnn,{}),r&&h.jsx(cnn,{}),h.jsx(LQ,{spinning:!i||!a})]})})}),dnn=()=>{if(H(zH),!ht.getState().waiting)return null;const e=()=>(m.useEffect(()=>(ht.getState().set(n=>{n.waiting=!1}),()=>{ht.getState().set(n=>{n.waiting=!1})})),null);return h.jsx(e,{})},fnn=be.memo(({id:t,cx:e,cy:n,cz:o,lx:r,lz:i,birdSafe:a=uc.None,numberOfBlades:l=3,speed:s=10,hubRadius:c=.75,hubLength:u=1.5,maximumChordRadius:d=3,maximumChordLength:f=1,towerHeight:p,towerRadius:g,bladeRadius:y,bladeTipWidth:w=.2,bladeRootRadius:b=.3,rotation:C=[0,0,0],relativeYawAngle:P=0,initialRotorAngle:v=0,pitchAngle:T=me.toRadians(10),color:A="white",bladeColor:x=t9,stripeColor:S=n9,lineColor:R="black",lineWidth:M=.5,showLabel:D=!1,locked:E=!1,parentId:W})=>{const j=H(fn),L=H(Gn),k=H(Y0),N=Es(t),F=H(Ds),U=H(rl),{gl:{domElement:O}}=oi(),[B,_]=m.useState(!1),X=m.useRef(null),$=m.useRef(null),Q=m.useRef(!1),le=Jt(),q=m.useMemo(()=>me.fetchBladeTexture(y,b*2,100,a,x,S),[b,y,a,x,S]),te=H(Ie=>{for(const ye of Ie.elements)if(ye.id===W)return ye});if(te)switch(te.type){case z.Foundation:if(o=te.lz,me.isZero(C[2]))e=te.cx+e*te.lx,n=te.cy+n*te.ly;else{const Ie=new ie(e*te.lx,n*te.ly,0);Ie.applyAxisAngle(Io,C[2]),e=te.cx+Ie.x,n=te.cy+Ie.y}break}const re=L(t),ae=c*1.25,se=u*2.5,ne=y-d/3,fe=m.useMemo(()=>{const Ie=f-b,ye=new Fl,ce=[];return ce.push(new Xt(-b,0)),ce.push(new Xt(-Ie/2,y-ne)),ce.push(new Xt(-Ie,d)),ce.push(new Xt(b-w,y)),ye.moveTo(-b,0),ye.splineThru(ce),ye.lineTo(b,y),ye.lineTo(b,0),ye.closePath(),ye},[y,ne,f,d,b,w]),ge=m.useMemo(()=>{const Ie=new Date(U);return v+s*(Ie.getHours()*60+Ie.getMinutes())*Math.PI/72},[U,s,v]);m.useEffect(()=>{const Ie=()=>{Fn.getState().setEnableOrbitController(!0),Q.current=!1};return window.addEventListener("pointerup",Ie),()=>{window.removeEventListener("pointerup",Ie)}},[]);const de=m.useMemo(()=>(re!=null&&re.label?re.label:Y.t("shared.WindTurbineElement",le))+(re!=null&&re.locked?" ("+Y.t("shared.ElementLocked",le)+")":"")+(re!=null&&re.label?"":` +`+Y.t("word.Coordinates",le)+": ("+e.toFixed(1)+", "+n.toFixed(1)+", "+o.toFixed(1)+") "+Y.t("word.MeterAbbreviation",le)),[re==null?void 0:re.label,re==null?void 0:re.locked,le,e,n,o]),Z=m.useMemo(()=>new nn(0,0,C[2]+P,"ZXY"),[C,P]),he=(Ie,ye)=>{Ie.intersections.length>0&&Ie.intersections[0].object===Ie.eventObject&&(O.style.cursor=ye===Ho.Default?"move":"pointer")},xe=()=>{O.style.cursor="default"},He=c1*4,Se=m.useMemo(()=>{const Ie=Math.PI*2/l,ye=new Array;for(let ce=0;ceh.jsxs("group",{position:new ie(0,-u*.85,p),rotation:[Gt,T,ye,"XZY"],children:[h.jsxs("mesh",{name:"Blade "+Ie+" Font Side",receiveShadow:F,castShadow:F,children:[h.jsx("shapeGeometry",{attach:"geometry",args:[fe]}),h.jsx("meshStandardMaterial",{attach:"material",color:x,side:Ra,map:ce})]}),h.jsxs("mesh",{name:"Blade "+Ie+" Back Side",receiveShadow:F,castShadow:F,position:new ie(0,-.05,0),children:[h.jsx("shapeGeometry",{attach:"geometry",args:[fe]}),h.jsx("meshStandardMaterial",{attach:"material",color:x,side:p0,map:ce})]}),h.jsx(ca,{name:"Blade root",castShadow:!1,receiveShadow:!1,args:[b*1.1,b*1.1,.24,12,1],position:new ie(0,c-.14,0),children:h.jsx("meshStandardMaterial",{attach:"material",color:A})})]},Ie);return h.jsxs("group",{name:"Wind Turbine Group "+t,rotation:Z,position:[e,n,o],children:[h.jsx("group",{children:N&&!E&&h.jsx(ds,{ref:$,position:new ie(0,0,0),args:[He+g,6,6],name:Ho.Default,castShadow:!1,receiveShadow:!1,onPointerOver:Ie=>{he(Ie,Ho.Default)},onPointerOut:()=>{xe()},onPointerDown:Ie=>{Ie.button!==2&&k(t,Ie,Oo.Move)},children:h.jsx("meshStandardMaterial",{attach:"material",color:"orange"})})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Tower",ref:X,castShadow:F,receiveShadow:F,args:[g*.8,g*1.2,p,4,1],position:new ie(0,0,p*.5),rotation:[Gt,0,0],onPointerDown:Ie=>{Ie.button!==2&&(k(t,Ie,Oo.Select),Fn.getState().setEnableOrbitController(!1))},onContextMenu:Ie=>{k(t,Ie,Oo.ContextMenu),j(ye=>{Ie.intersections.length>0&&Ie.intersections[0].object===X.current&&(ye.contextMenuObjectType=z.WindTurbine)})},onPointerOver:Ie=>{Ie.intersections.length>0&&Ie.intersections[0].object===X.current&&(_(!0),O.style.cursor="move")},onPointerOut:()=>{_(!1),O.style.cursor="default"},children:h.jsx("meshStandardMaterial",{attach:"material",color:A})}),h.jsx(ds,{userData:{unintersectable:!0},name:"Hub",castShadow:F,receiveShadow:F,args:[c,8,8,Gt,Math.PI,0,Math.PI],position:new ie(0,-u*.5,p),rotation:[Math.PI,0,Gt],scale:[u/c,1,1],children:h.jsx("meshStandardMaterial",{attach:"material",color:A})}),h.jsx(ca,{userData:{unintersectable:!0},name:"Hub Cap",castShadow:F,receiveShadow:F,args:[c,c,.01,16,1],position:new ie(0,-u*.5,p),rotation:[Math.PI,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:A})}),h.jsx(u4t,{userData:{unintersectable:!0},name:"Nacelle",castShadow:F,receiveShadow:F,radius:.1,smoothness:4,args:[ae,ae,se],position:new ie(0,(se-u)*.5-.1,p),rotation:[Gt,0,0],children:h.jsx("meshStandardMaterial",{attach:"material",color:A})}),a!==uc.None&&Se.map((Ie,ye)=>ze(ye,Ie,q)),a===uc.None&&Se.map((Ie,ye)=>ze(ye,Ie,null)),N&&E&&h.jsx(jn,{name:"Selection highlight lines",userData:{unintersectable:!0},points:[[-r/2,0,0],[-r/2,i,0],[-r/2,i,0],[r/2,i,0],[r/2,0,0],[r/2,i,0],[r/2,0,0],[-r/2,0,0]],rotation:[Gt,0,0],castShadow:!1,receiveShadow:!1,lineWidth:1,color:y0}),(B||D)&&!N&&h.jsx("textSprite",{userData:{unintersectable:!0},name:"Label",fontFace:"Roboto",text:de,color:(re==null?void 0:re.labelColor)??"white",fontSize:(re==null?void 0:re.labelFontSize)??20,textHeight:(re==null?void 0:re.labelSize)??1,castShadow:!1,receiveShadow:!1,position:[0,0,1+p+c]})]})}),hnn=be.memo(()=>{const t=H(Kn),e=m.useRef(null);return m.useEffect(()=>{e&&Fn.setState({contentRef:e})},[]),console.debug(t),h.jsxs("group",{ref:e,name:"Content",children:[t.map(n=>{switch(n.type){case z.Foundation:return h.jsx(qZt,{...n},n.id);case z.Sensor:{const o=n;return o.parentType===z.Cuboid?null:h.jsx(T$e,{...o},n.id)}case z.Light:{const o=n;return o.parentType===z.Cuboid?null:h.jsx(P$e,{...o},n.id)}case z.Cuboid:return n.parentId!==Zo?null:h.jsx(R$e,{elements:t,cuboidModel:n},n.id);case z.Human:return h.jsx($en,{...n},n.id);case z.Tree:return h.jsx(Qen,{...n},n.id);case z.Flower:return h.jsx(otn,{...n},n.id);case z.ParabolicDish:return h.jsx(etn,{...n},n.id);case z.ParabolicTrough:return h.jsx(Zen,{...n},n.id);case z.FresnelReflector:return h.jsx(ttn,{...n},n.id);case z.Heliostat:return h.jsx(ntn,{...n},n.id);case z.WindTurbine:return h.jsx(fnn,{...n},n.id);case z.Polygon:switch(n.parentType){case z.Wall:return null;default:return h.jsx(eQe,{...n},n.id)}default:if(n.id)return h.jsx(be.Fragment,{},n.id)}return null}),h.jsx(dnn,{}),h.jsx(pnn,{})]})}),pnn=()=>{const t=H(_ge);return m.useEffect(()=>{H.getState().set(e=>{e.deletedRoofIdSet.clear()})},[t]),null},gnn=be.memo(()=>{const t=H(fn),e=H(Cb),n=H(EH),o=H(c3),r=H(Lge),i=H(Nge),a=H(Gn),l=H(u3),s=H(kge),c=H(yp),u=H(Dge),d=H(Yge),f=H(En),p=H(zw),g=H(eYe),y=H(Qq),w=H(Eb),b=H(d1),C=H(Zq),P=H(ext),v=H(Ds),T=H(PBe),A=H(CBe),x=H(Qe=>Qe.world.ground),S=H(txt),R=H(nxt),M=ht(Ss),D=ht(Y7t),{get:E,scene:W,invalidate:j}=oi(),L=m.useRef(null),k=m.useRef(null),N=m.useRef(null),F=m.useRef(new ie),U=m.useRef(new ie),O=m.useRef(new Map),B=m.useRef(new Map),_=m.useRef(new Map),X=m.useRef(new Map),$=m.useRef(new Map),Q=m.useRef(new Map),le=m.useRef(new Map),q=m.useRef(new Map),te=m.useRef(new ie(1,1,1)),re=m.useRef(new ie(1,1,1)),ae=m.useRef([0,0,1]),se=m.useRef([0,0,1]),ne=m.useRef(null),fe=m.useRef(null),ge=m.useRef(new Map),de=m.useRef(new Map),Z=m.useRef(new Map),he=m.useRef(!1),xe=m.useRef(!1),He=m.useRef(!1),Se=m.useRef(!1),ze=m.useRef(!1),Ie=m.useRef(new Map),ye=m.useRef(new Map),ce=m.useRef(new Map),pe=m.useRef(new ie),ve=Jt();m.useEffect(()=>(window.addEventListener("pointerup",Ze),()=>{window.removeEventListener("pointerup",Ze)}),[]),m.useEffect(()=>{S&&(t(Qe=>{Qe.addedFoundationId=null,Qe.deletedFoundationId=null}),he.current=!1,xe.current=!1)},[S]),m.useEffect(()=>{R&&(t(Qe=>{Qe.addedCuboidId=null,Qe.deletedCuboidId=null}),He.current=!1,Se.current=!1)},[R]);const{camera:Ae}=oi(),Te=m.useMemo(()=>new l0,[]),Me=m.useMemo(()=>new Xt,[]),Pe=N.current?Math.cos(N.current.rotation[2]):1,Ee=N.current?Math.sin(N.current.rotation[2]):0;let Be=eh.Ground;const Je=m.useMemo(()=>new ie,[]),We=m.useMemo(()=>new nn,[]),Ke=m.useMemo(()=>new nn,[]);if(N.current){if(me.isPlantOrHuman(N.current)){Be=eh.Vertical;const Qe=H.getState().viewState.orthographic?0:-Gt,{x:Tt,y:Dt}=Ae.position,lt=-Math.atan2(Tt,Dt);We.set(Qe,0,lt,"ZXY"),Je.set(N.current.cx,N.current.cy,0)}else if(w===Ho.Top)Be=eh.Horizontal,Je.set(N.current.cx,N.current.cy,N.current.lz),We.set(0,0,0);else if(me.isMoveHandle(w)||b===vt.Left||b===vt.Right||b===vt.Lower||b===vt.Upper||b===vt.LowerLeft||b===vt.UpperLeft&&N.current.type!==z.Wall||b===vt.LowerRight||b===vt.UpperRight&&N.current.type!==z.Wall||C===Kr.Lower||C===Kr.Upper)Be=eh.Horizontal,Je.set(N.current.cx,N.current.cy,c1),We.set(0,0,0);else if(b){Be=eh.Vertical;const Qe=d(N.current,b),Tt=u(),Dt=-Math.atan2(Tt.x,Tt.y);Je.set(Qe.x,Qe.y,0),We.set(-Gt,0,Dt,"ZXY")}}const Ne=Qe=>{Me.x=Qe.offsetX/E().gl.domElement.clientWidth*2-1,Me.y=-(Qe.offsetY/E().gl.domElement.clientHeight)*2+1,Te.setFromCamera(Me,E().camera)},De=Qe=>{for(const Tt of Qe)if(Tt.object.userData.stand)return Tt;return null},ke=(Qe,Tt)=>{Qe&&t(Dt=>{for(const lt of Dt.elements)if(lt.id===Tt&<.type!==z.Foundation){lt.parentId=Qe;break}})},Ye=Qe=>{if(!Qe)return"";const Tt=Qe.name.split(" ");return Tt[2]?Tt[2]:Ye(Qe.parent)},it=(Qe,Tt,Dt)=>{if(!Qe||!Tt)return;const lt=Fn.getState().contentRef;if(lt!=null&<.current){const zt=me.getObjectChildById(lt.current,Tt),Ft=me.getObjectChildById(Tt===Zo?lt.current:zt,Dt);if(Ft){if(Qe===Zo)lt.current.add(Ft);else{const _t=me.getObjectChildById(lt.current,Qe);_t==null||_t.add(Ft)}j()}}},Ve=(Qe,Tt)=>{if(Qe&&Qe.current){const Dt=De(Tt.intersections);if(Dt){const lt=Dt.object,zt=Qe.current.parent;if(lt.name==="Ground"){if(zt&&zt.name!=="Content"){const Ft=Fn.getState().contentRef;Ft&&Ft.current&&(Ft.current.add(Qe.current),ke(Zo,Ye(Qe.current)))}Qe.current.position.copy(Dt.point),j()}else if(lt.userData.stand){const Ft=lt.parent;if(Ft){zt&&zt.uuid!==Ft.uuid&&(Ft.add(Qe.current),ke(Ye(Ft),Ye(Qe.current)));const{rot:_t}=me.getWorldDataById(Ye(Ft));Ke.set(0,0,-_t);const tn=new ie().subVectors(Dt.point,Ft.localToWorld(new ie)).applyEuler(Ke);Qe.current.position.copy(tn),j()}}ze.current||(ze.current=!0)}}},yt=(Qe,Tt,Dt)=>{t(lt=>{for(const zt of lt.elements)if(zt.id===Qe){me.isFoundationOrCuboid(zt)||(zt.parentId=Tt),zt.cx=Dt.x,zt.cy=Dt.y,zt.cz=Dt.z;break}})},ct=()=>{if(!N.current)return;const Qe={name:"Resize",timestamp:Date.now(),resizedElementId:N.current.id,resizedElementType:N.current.type,oldCx:F.current.x,oldCy:F.current.y,oldCz:F.current.z,newCx:U.current.x,newCy:U.current.y,newCz:U.current.z,oldLx:te.current.x,oldLy:te.current.y,oldLz:te.current.z,newLx:re.current.x,newLy:re.current.y,newLz:re.current.z,oldChildrenPositionsMap:new Map(O.current),newChildrenPositionsMap:new Map(B.current),oldPolygonVerticesMap:new Map(_.current),newPolygonVerticesMap:new Map(X.current),oldChildrenParentIdMap:new Map(le.current),newChildrenParentIdMap:new Map(q.current),oldWallPointsMap:new Map($.current),newWallPointsMap:new Map(Q.current),undo:()=>{var Tt,Dt;if(t(lt=>{for(const zt of lt.elements)if(zt.id===Qe.resizedElementId){zt.cx=Qe.oldCx,zt.cy=Qe.oldCy,zt.cz=Qe.oldCz,zt.lx=Qe.oldLx,zt.ly=Qe.oldLy,zt.lz=Qe.oldLz;break}}),Qe.oldChildrenPositionsMap.size>0)for(const[lt,zt]of Qe.oldChildrenPositionsMap.entries()){const Ft=a(lt);if((Ft==null?void 0:Ft.type)!==z.Polygon){t(Qt=>{for(const gn of Qt.elements)if(gn.id===lt){if(gn.cx=zt.x,gn.cy=zt.y,Ut(gn)||(gn.cz=zt.z),gn.type===z.Wall){const an=gn,mn=Qe.oldWallPointsMap.get(an.id);mn&&(an.leftPoint=[mn[0].x,mn[0].y,0],an.rightPoint=[mn[1].x,mn[1].y,0])}break}Qe.oldWallPointsMap.size>0&&(Qt.updateWallMapOnFoundationFlag=!Qt.updateWallMapOnFoundationFlag)});const _t=(Tt=Qe.oldChildrenParentIdMap)==null?void 0:Tt.get(lt),tn=(Dt=Qe.newChildrenParentIdMap)==null?void 0:Dt.get(lt);_t&&tn&&_t!==tn&&(it(_t,tn,lt),ke(_t,lt))}}if(Qe.oldPolygonVerticesMap.size>0)for(const[lt,zt]of Qe.oldPolygonVerticesMap.entries()){const Ft=a(lt);(Ft==null?void 0:Ft.type)===z.Polygon&&p(lt,zt)}},redo:()=>{var Tt,Dt;if(t(lt=>{for(const zt of lt.elements)if(zt.id===Qe.resizedElementId){zt.cx=Qe.newCx,zt.cy=Qe.newCy,zt.cz=Qe.newCz,zt.lx=Qe.newLx,zt.ly=Qe.newLy,zt.lz=Qe.newLz;break}}),Qe.newChildrenPositionsMap.size>0)for(const[lt,zt]of Qe.newChildrenPositionsMap.entries()){t(tn=>{for(const Qt of tn.elements)if(Qt.id===lt){if(Qt.cx=zt.x,Qt.cy=zt.y,(Qt.type!==z.SolarPanel||Qt.parentType!==z.Roof)&&(Qt.cz=zt.z),Qt.type===z.Wall){const gn=Qt,an=Qe.newWallPointsMap.get(gn.id);an&&(gn.leftPoint=[an[0].x,an[0].y,0],gn.rightPoint=[an[1].x,an[1].y,0])}break}Qe.newWallPointsMap.size>0&&(tn.updateWallMapOnFoundationFlag=!tn.updateWallMapOnFoundationFlag)});const Ft=(Tt=Qe.oldChildrenParentIdMap)==null?void 0:Tt.get(lt),_t=(Dt=Qe.newChildrenParentIdMap)==null?void 0:Dt.get(lt);Ft&&_t&&Ft!==_t&&(it(_t,Ft,lt),ke(_t,lt))}if(Qe.newPolygonVerticesMap.size>0)for(const[lt,zt]of Qe.newPolygonVerticesMap.entries()){const Ft=a(lt);(Ft==null?void 0:Ft.type)===z.Polygon&&p(lt,zt)}}};return Qe},Xe=(Qe,Tt)=>{var Ft,_t;const Dt=Fn.getState().contentRef,lt=me.getObjectChildById(Dt==null?void 0:Dt.current,Qe.id);if(lt){for(const tn of lt.children)if(tn.name.includes(`${Tt.id}`)){(_t=(Ft=Fn.getState().contentRef)==null?void 0:Ft.current)==null||_t.add(tn);break}}Tt.parentId=Zo;const zt=new ie(Tt.cx,Tt.cy,Tt.cz).applyEuler(new nn(0,0,Qe.rotation[2])).add(F.current);Tt.cx=zt.x,Tt.cy=zt.y,Tt.cz=0,B.current.set(Tt.id,new ie(zt.x,zt.y,0)),q.current.set(Tt.id,Zo)},ut=Qe=>{Qe.intersections.length>0&&Qe.intersections[0].object===L.current&&t(Dt=>{vx.selectNone(Dt),Dt.pastePoint.copy(Qe.intersections[0].point),Dt.clickObjectType=z.Ground,Dt.contextMenuObjectType=z.Ground,Dt.pasteNormal=Io})},ft=Qe=>{const Tt=H.getState().resizeHandleType;switch(Qe.type){case z.Tree:switch(Tt){case vt.Top:{const Dt={name:"Change Tree Height",timestamp:Date.now(),changedElementId:Qe.id,changedElementType:Qe.type,oldValue:te.current.z,newValue:Qe.lz,undo:()=>{s(Dt.changedElementId,Dt.oldValue)},redo:()=>{s(Dt.changedElementId,Dt.newValue)}};f(Dt),t(lt=>{lt.actionState.treeHeight=Qe.lz});return}case vt.Left:case vt.Right:case vt.Lower:case vt.Upper:{const Dt={name:"Change Tree Spread",timestamp:Date.now(),changedElementId:Qe.id,changedElementType:Qe.type,oldValue:te.current.x,newValue:Qe.lx,undo:()=>{l(Dt.changedElementId,Dt.oldValue)},redo:()=>{l(Dt.changedElementId,Dt.newValue)}};f(Dt),t(lt=>{lt.actionState.treeSpread=Qe.lx});return}}break;case z.Wall:{const Dt={name:"Change Wall Height",timestamp:Date.now(),changedElementId:Qe.id,changedElementType:Qe.type,oldValue:te.current.z,newValue:Qe.lz,undo:()=>{s(Dt.changedElementId,Dt.oldValue)},redo:()=>{s(Dt.changedElementId,Dt.newValue)}};f(Dt),t(lt=>{lt.actionState.wallHeight=Qe.lz});return}}if(U.current.set(Qe.cx,Qe.cy,Qe.cz),re.current.set(Qe.lx,Qe.ly,Qe.lz),le.current.clear(),q.current.clear(),B.current.clear(),X.current.clear(),Q.current.clear(),t(Dt=>{if(Qe.type===z.Cuboid&&(Dt.actionState.cuboidHeight=Qe.lz),Dt.updateSceneRadius(),Dt.updateWallMapOnFoundationFlag=!Dt.updateWallMapOnFoundationFlag,Qe.parentId===Zo){for(const lt of Dt.elements)if(me.isPlantOrHuman(lt)&<.parentId===Qe.id&&(le.current.set(lt.id,Qe.id),!me.isResizingVertical(H.getState().resizeHandleType)))if(Math.abs(te.current.z/2-lt.cz)<.01){const zt=new ie(lt.cx,lt.cy,lt.cz).applyEuler(new nn(0,0,Qe.rotation[2])).add(F.current).sub(U.current).applyEuler(new nn(0,0,-Qe.rotation[2]));Math.abs(zt.x)>Math.abs(re.current.x/2)+.01||Math.abs(zt.y)>Math.abs(re.current.y/2)+.01?Xe(Qe,lt):(lt.cx=zt.x,lt.cy=zt.y)}else{const zt=new ie(lt.cx,lt.cy,lt.cz),Ft=new ie().subVectors(U.current,F.current),_t=new ie().subVectors(zt,Ft);Math.abs(zt.x/te.current.x)>.49?Math.abs(_t.y)>Qe.ly/2+.5?Xe(Qe,lt):(lt.cx=(zt.x>0?Qe.lx:-Qe.lx)/2,lt.cy=_t.y):Math.abs(zt.y/te.current.y)>.49&&(Math.abs(_t.x)>Qe.lx/2+.5?Xe(Qe,lt):(lt.cx=_t.x,lt.cy=(zt.y>0?Qe.ly:-Qe.ly)/2))}}}),U.current.distanceToSquared(F.current)>It&&re.current.distanceToSquared(te.current)>It){if(Qe.type===z.Foundation||Qe.type===z.Cuboid){const lt=n(Qe.id);if(lt.length>0)for(const zt of lt)if(zt.type===z.Polygon)X.current.set(zt.id,zt.vertices.map(Ft=>({...Ft})));else{if(zt.type===z.Wall){const Ft=zt,_t=new Xt(Ft.leftPoint[0],Ft.leftPoint[1]),tn=new Xt(Ft.rightPoint[0],Ft.rightPoint[1]);Q.current.set(zt.id,[_t,tn])}B.current.set(zt.id,new ie(zt.cx,zt.cy,zt.cz))}if(Qe.type===z.Foundation){const zt=Ht(Qe.id);if(zt.length>0)for(const Ft of zt){const _t=new ie(Ft.cx,Ft.cy);B.current.set(Ft.id,_t)}}}const Dt=ct();Dt&&f(Dt)}},ot=()=>{if(H.getState().viewState.orthographic)return!1;if(L.current){const Qe=Te.intersectObjects(E().scene.children,!0);if(Qe.length>0){for(const Tt of Qe)if(Tt.object.userData.stand)return!1}}return Te.intersectObjects([L.current]).length===0},st=Qe=>{t(Tt=>{for(const Dt of Tt.elements)if(Qe.has(Dt.id)){const lt=Qe.get(Dt.id);lt&&(Dt.cx=lt[0],Dt.cy=lt[1],Dt.cz=lt[2])}})},at=(Qe,Tt)=>{var zt,Ft,_t;if(Qe.locked)return;U.current.set(Qe.cx,Qe.cy,Qe.cz);let Dt=ne.current,lt=null;switch(Ne(Tt),Qe.type){case z.Tree:lt=(zt=Fn.getState().treeRef)==null?void 0:zt.current;break;case z.Flower:lt=(Ft=Fn.getState().flowerRef)==null?void 0:Ft.current;break;case z.Human:lt=(_t=Fn.getState().humanRef)==null?void 0:_t.current;break}if(lt&&ze.current){const tn=Te.intersectObjects(me.fetchIntersectables(W),!1),Qt=De(tn);if(Qt){const gn=Qt.point;if(Qt.object.name==="Ground")yt(Qe.id,Zo,gn),U.current.set(gn.x,gn.y,gn.z),Dt=Zo;else if(Qt.object.userData.stand){const an=Ye(Qt.object),mn=Qt.object.parent;if(mn){const Hn=new ie().subVectors(gn,mn.localToWorld(new ie)).applyEuler(Ke);yt(Qe.id,an,Hn),U.current.set(Hn.x,Hn.y,Hn.z),Dt=an}}}ze.current=!1}if(U.current.distanceToSquared(F.current)>It||Te.intersectObjects([L.current]).length===0){let tn=!0;if(!H.getState().viewState.orthographic&&(tn=U.current.length().02}if(!tn||ot()){o(Qe.id,F.current.x,F.current.y,F.current.z),lt&&me.isPlantOrHuman(Qe)&<.position.copy(F.current),me.isPlantOrHuman(Qe)&&ke(ne.current,Qe.id);const Qt=Fn.getState().contentRef;if(Qt!=null&&Qt.current&&ne.current&<){if(ne.current===Zo)Qt.current.add(lt);else{const gn=me.getObjectChildById(Qt.current,ne.current);gn==null||gn.add(lt)}j()}po(Y.t("message.CannotMoveObjectTooFar",ve))}else{if(Ie.current.size>1){ce.current.clear();for(const gn of H.getState().elements)ye.current.has(gn.id)&&ce.current.set(gn.id,[gn.cx,gn.cy,gn.cz]);const Qt={name:"Move Foundation Group",timestamp:Date.now(),oldPositionMap:new Map(ye.current),newPositionMap:new Map(ce.current),undo:()=>{st(Qt.oldPositionMap)},redo:()=>{st(Qt.newPositionMap)}};f(Qt)}else{const Qt=Qe.type===z.Cuboid,gn=Qt?fe.current:ne.current,an=Qt?Qe.parentId:Dt,mn={name:"Move",timestamp:Date.now(),movedElementId:Qe.id,movedElementType:Qe.type,oldCx:F.current.x,oldCy:F.current.y,oldCz:F.current.z,newCx:U.current.x,newCy:U.current.y,newCz:U.current.z,oldRotation:[...ae.current],newRotation:[...Qe.rotation],oldParentId:gn,newParentId:an,undo:()=>{o(mn.movedElementId,mn.oldCx,mn.oldCy,mn.oldCz),t(Hn=>{const Fo=Hn.elements.find(yo=>yo.id===mn.movedElementId);Fo&&mn.oldRotation&&(Fo.rotation=[...mn.oldRotation])}),ke(mn.oldParentId,mn.movedElementId),mn.movedElementType&&kt(mn.movedElementType)&&it(mn.oldParentId,mn.newParentId,mn.movedElementId)},redo:()=>{o(mn.movedElementId,mn.newCx,mn.newCy,mn.newCz),t(Hn=>{const Fo=Hn.elements.find(yo=>yo.id===mn.movedElementId);Fo&&mn.newRotation&&(Fo.rotation=[...mn.newRotation])}),ke(mn.newParentId,mn.movedElementId),mn.movedElementType&&kt(mn.movedElementType)&&it(mn.newParentId,mn.oldParentId,mn.movedElementId)}};f(mn)}Ie.current.clear(),g()}}},Oe=Qe=>{se.current=[...Qe.rotation];const Tt=new ie().fromArray(ae.current);if(new ie().fromArray(se.current).distanceToSquared(Tt)>It){const lt={name:"Rotate",timestamp:Date.now(),rotatedElementId:Qe.id,rotatedElementType:Qe.type,oldRotation:ae.current,newRotation:se.current,undo:()=>{r(lt.rotatedElementId,lt.oldRotation[0],lt.oldRotation[1],lt.oldRotation[2])},redo:()=>{r(lt.rotatedElementId,lt.newRotation[0],lt.newRotation[1],lt.newRotation[2])}};f(lt)}},Ze=Qe=>{if(Qe.button!==2){if(Fn.getState().setEnableOrbitController(!0),N.current){const Tt=a(N.current.id);if(Tt)if(xe.current)if(he.current=!1,xe.current=!1,t(Dt=>{Dt.addedFoundationId=null,Dt.updateSceneRadius()}),Tt.lx<=.1||Tt.ly<=.1)c(Tt.id,!1);else{const Dt={name:"Add",timestamp:Date.now(),addedElement:Tt,undo:()=>{c(Dt.addedElement.id,!1),g()},redo:()=>{t(lt=>{lt.elements.push(Dt.addedElement),lt.selectedElement=Dt.addedElement,lt.updateSceneRadius()})}};f(Dt)}else if(Se.current)if(He.current=!1,Se.current=!1,t(Dt=>{Dt.addedCuboidId=null,Dt.updateSceneRadius()}),Tt.lx<=.1||Tt.ly<=.1)c(Tt.id,!1);else{const Dt={name:"Add",timestamp:Date.now(),addedElement:Tt,undo:()=>{c(Dt.addedElement.id,!1),g()},redo:()=>{t(lt=>{lt.elements.push(Dt.addedElement),lt.selectedElement=Dt.addedElement,lt.updateSceneRadius()})}};f(Dt)}else H.getState().resizeHandleType?ft(Tt):H.getState().rotateHandleType?Oe(Tt):H.getState().moveHandleType&&at(Tt,Qe),Tt.type===z.Foundation&&ht.getState().updateFoundationMovedFlag()}t(Tt=>{Tt.moveHandleType=null,Tt.resizeHandleType=null,Tt.rotateHandleType=null}),Fn.setState({humanRef:null,treeRef:null,flowerRef:null}),ht.getState().set(Tt=>{Tt.showWallIntersectionPlaneId=null,Tt.oldParentId=null,Tt.oldFoundationId=null})}},St=(Qe,Tt)=>{const{pos:Dt}=me.getWorldDataById(Qe.id),lt=new ie(Dt.x,Dt.y),zt=new ie().subVectors(lt,Tt);Ie.current.set(Qe.id,zt),ye.current.set(Qe.id,[Qe.cx,Qe.cy,Qe.cz])},Pt=(Qe,Tt)=>{const Dt=Qe.intersections[0].point.clone().setZ(0);for(const lt of H.getState().elements)md(lt)&<.parentId===Zo&&!lt.locked&<.id!==Tt.id&&!Ie.current.has(lt.id)&&!me.isChild(Tt.id,lt.id)&&!me.isChild(lt.id,Tt.id)&&me.areTwoBasesOverlapped(lt,Tt)&&(St(lt,Dt),lt.enableGroupMaster&&Pt(Qe,lt)),lt.id===Tt.id&&St(lt,Dt)},Rt=(Qe,Tt)=>{Ie.current.clear(),ye.current.clear(),Tt.enableGroupMaster&&H.getState().moveHandleType&&Pt(Qe,Tt)},Ut=Qe=>{if(Qe.type===z.SolarPanel&&Qe.parentType===z.Roof||Qe.type===z.Window&&Qe.parentType===z.Roof)return!0},Ht=Qe=>H.getState().elements.filter(Tt=>Tt.foundationId!==Qe?!1:Tt.type===z.SolarPanel&&Tt.parentType===z.Roof||Tt.type===z.Window&&Tt.parentType===z.Roof||Tt.type===z.Sensor||Tt.type===z.Light),At=Qe=>{if(Qe.button===2||Qe.intersections.length===0||!L.current)return;if(he.current){Ne(Qe);const Dt=Te.intersectObjects([L.current]);Dt.length>0&&(Fn.getState().setEnableOrbitController(!1),t(lt=>{lt.moveHandleType=null,lt.resizeHandleType=vt.LowerRight,lt.resizeAnchor.copy(Dt[0].point)}),he.current=!1,xe.current=!0);return}if(He.current){Ne(Qe);const Dt=Te.intersectObjects([L.current]);Dt.length>0&&(Fn.getState().setEnableOrbitController(!1),t(lt=>{var zt;if(lt.moveHandleType=null,lt.resizeHandleType=vt.LowerRight,lt.resizeAnchor.copy(Dt[0].point),N.current){const Ft=dt(Qe,(zt=N.current)==null?void 0:zt.id);if(Ft){const _t=Te.intersectObjects([Ft.eventObject]);_t.length>0&<.resizeAnchor.copy(_t[0].point)}}}),He.current=!1,Se.current=!0);return}if(Qe.intersections[0].object===L.current){if(H.getState().multiSelectionsMode||t(Dt=>{Dt.clickObjectType=z.Ground,Dt.selectedElement=null,vx.selectNone(Dt),Dt.contextMenuObjectType=null}),Fe(y)){const Dt=Qe.intersections[0].point,lt=i(x,Dt),zt={name:"Add",timestamp:Date.now(),addedElement:lt,undo:()=>{c(zt.addedElement.id,!1),g()},redo:()=>{t(Ft=>{Ft.elements.push(zt.addedElement),Ft.selectedElement=zt.addedElement,Ft.updateSceneRadius()})}};f(zt),t(Ft=>{Ft.actionModeLock||(Ft.objectTypeToAdd=z.None),Ft.updateSceneRadius()})}N.current=null}else{const Dt=H.getState().selectedElementIdSet;if(Dt.size>1){const lt=H.getState().selectedElement;if(lt){N.current=lt,Ie.current.clear();for(const zt of H.getState().elements)if(me.isElementAllowedMultipleMoveOnGround(zt)&&Dt.has(zt.id))if(zt.enableGroupMaster)Pt(Qe,zt);else{const _t=Qe.intersections[0].point.clone().setZ(0);St(zt,_t)}}}else{const lt=e();if(lt&&Fe(lt.type)){if(N.current=lt,F.current.set(lt.cx,lt.cy,lt.cz),te.current.set(lt.lx,lt.ly,lt.lz),ae.current=[...lt.rotation],lt.type===z.Foundation||lt.type===z.Cuboid){const zt=n(lt.id);if(O.current.clear(),_.current.clear(),$.current.clear(),zt.length>0)for(const Ft of zt)if(Ft.type===z.Polygon)_.current.set(Ft.id,Ft.vertices.map(_t=>({..._t})));else{if(Ft.type===z.Wall){const _t=Ft,tn=new Xt(_t.leftPoint[0],_t.leftPoint[1]),Qt=new Xt(_t.rightPoint[0],_t.rightPoint[1]);$.current.set(Ft.id,[tn,Qt])}O.current.set(Ft.id,new ie(Ft.cx,Ft.cy,Ft.cz))}if(lt.type===z.Foundation){const Ft=Ht(lt.id);if(Ft.length>0)for(const _t of Ft){const tn=new ie(_t.cx,_t.cy);O.current.set(_t.id,tn)}}}switch(lt.type){case z.Tree:ne.current=lt.parentId,te.current.set(lt.lx,lt.ly,lt.lz);break;case z.Flower:ne.current=lt.parentId;break;case z.Human:ne.current=lt.parentId;break;case z.Cuboid:{if(md(lt)&<.parentId===Zo?Rt(Qe,lt):Ie.current.clear(),fe.current=lt.parentId,H.getState().moveHandleType){const{rot:gn}=me.getWorldDataById(lt.id),an=new nn(0,0,gn);switch(H.getState().moveHandleType){case Ho.Right:{pe.current.set(-lt.lx/2,0,0).applyEuler(an);break}case Ho.Left:{pe.current.set(lt.lx/2,0,0).applyEuler(an);break}case Ho.Lower:{pe.current.set(0,lt.ly/2,0).applyEuler(an);break}case Ho.Upper:{pe.current.set(0,-lt.ly/2,0).applyEuler(an);break}default:{pe.current.set(0,0,0);break}}}ge.current.clear();const{pos:Ft,rot:_t}=me.getWorldDataById(lt.id),tn=new ie(Ft.x,Ft.y,Ft.z),Qt=n(lt.id);if(Qt.length>0)for(const gn of Qt)switch(gn.type){case z.Cuboid:{const an=new ie(gn.cx,gn.cy,gn.cz).applyEuler(new nn(0,0,_t));an.add(tn),ge.current.set(gn.id,an);break}case z.Tree:case z.Flower:case z.Human:{const an=new ie(gn.cx,gn.cy,gn.cz).applyEuler(new nn(0,0,_t));an.add(tn),ge.current.set(gn.id,an);break}case z.SolarPanel:{const an=new ie(gn.cx,gn.cy,gn.cz).applyEuler(new nn(0,0,_t)).add(tn);ge.current.set(gn.id,an);break}case z.Light:case z.Sensor:if(me.isIdentical(gn.normal,rs)){const an=new ie(gn.cx*lt.lx,gn.cy*lt.ly,gn.cz*lt.lz).applyEuler(new nn(0,0,_t));an.add(tn),ge.current.set(gn.id,an)}break;case z.Polygon:if(me.isIdentical(gn.normal,rs)){const an=gn,mn=[];for(const Hn of an.vertices){const Fo=new Xt(Hn.x*lt.lx,Hn.y*lt.ly).rotateAround(si,_t);Fo.add(new Xt(tn.x,tn.y)),mn.push(Fo)}de.current.set(an.id,mn)}break}break}case z.Foundation:{md(lt)&&Rt(Qe,lt),ge.current.clear(),de.current.clear(),Z.current.clear();const zt=new Xt(lt.cx,lt.cy),Ft=new ie(lt.cx,lt.cy,lt.cz),_t=n(lt.id);if(_t.length>0){const Qt=lt.rotation[2];for(const gn of _t)switch(gn.type){case z.Wall:{const an=gn,mn=new Xt(an.cx,an.cy).rotateAround(si,Qt);mn.add(zt);const Hn=new Xt(an.leftPoint[0],an.leftPoint[1]).rotateAround(si,Qt);Hn.add(zt);const Fo=new Xt(an.rightPoint[0],an.rightPoint[1]).rotateAround(si,Qt);Fo.add(zt),Z.current.set(an.id,{centerPointAbsPos:mn,leftPointAbsPos:Hn,rightPointAbsPos:Fo});break}case z.Tree:case z.Flower:case z.Human:{const an=new ie(gn.cx,gn.cy,gn.cz).applyEuler(new nn(0,0,Qt));an.add(Ft),ge.current.set(gn.id,an);break}case z.SolarPanel:{const an=new ie(gn.cx,gn.cy,gn.cz).applyEuler(new nn(0,0,Qt)).add(Ft);ge.current.set(gn.id,an);break}case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:case z.WindTurbine:case z.Sensor:{const an=new ie(gn.cx*lt.lx,gn.cy*lt.ly,gn.cz*lt.lz).applyEuler(new nn(0,0,Qt));an.add(Ft),ge.current.set(gn.id,an);break}case z.Polygon:{const an=gn,mn=[];for(const Hn of an.vertices){const Fo=new Xt(Hn.x*lt.lx,Hn.y*lt.ly).rotateAround(si,Qt);Fo.add(zt),mn.push(Fo)}de.current.set(an.id,mn);break}}}const tn=Ht(lt.id);if(tn.length>0){const Qt=new nn(0,0,lt.rotation[2]);for(const gn of tn)if(gn.type===z.Window||gn.type===z.SolarPanel){const an=new ie(gn.cx,gn.cy).applyEuler(Qt);an.add(Ft),ge.current.set(gn.id,an)}else{const an=new ie(gn.cx*lt.lx,gn.cy*lt.ly).applyEuler(Qt);an.add(Ft),ge.current.set(gn.id,an)}}break}}}else N.current=null}}},kt=Qe=>Qe===z.Human||Qe===z.Tree||Qe===z.Flower,gt=(Qe,Tt)=>{if(Qe.tempHumanPlant.length===0){const Dt=Qe.elements.filter(zt=>kt(zt.type)&&me.isDescendantOf(zt,Tt));Qe.tempHumanPlant=Dt;const lt=new Set(Dt.map(zt=>zt.id));Qe.elements=Qe.elements.filter(zt=>!lt.has(zt.id))}},dt=(Qe,Tt)=>{const Dt=Qe.intersections.find(zt=>{const Ft=zt.eventObject;if(!Ft.name.includes("Cuboid"))return!1;const _t=Ft.name.split(" ");return _t.length!==2?!1:_t[1]!==Tt&&Ft.userData.stackable});if(!Dt)return;const lt=Dt.eventObject.name.split(" ")[1];if(!Ie.current.has(lt))return me.isChild(Tt,lt)?void 0:Dt};m.useEffect(()=>{N.current&&(D||y!==z.None)&&(he.current&&y!==z.Foundation?(he.current=!1,xe.current=!1,t(Qe=>{Qe.addedFoundationId=null,Qe.updateSceneRadius()}),ht.getState().setSelectButtonClicked(!1),c(N.current.id,!1),N.current=null):He.current&&y!==z.Cuboid&&(He.current=!1,Se.current=!1,t(Qe=>{Qe.addedCuboidId=null,Qe.updateSceneRadius()}),ht.getState().setSelectButtonClicked(!1),c(N.current.id,!1),N.current=null))},[y,D]);const Ct=Qe=>{if(N.current&&N.current.type&&!N.current.locked){Ne(Qe);let Tt;switch(N.current.type){case z.Foundation:k.current&&(Tt=Te.intersectObjects([k.current]),Tt.length>0&&(w?mt(Tt[0].point):b?je(Tt[0].point):C&&rt(Tt[0].point)));break;case z.Cuboid:if(k.current&&Be===eh.Horizontal&&(Tt=Te.intersectObjects([k.current]),Tt.length>0)){const Dt=Tt[0].point.clone(),lt=dt(Qe,N.current.id);if(w)if(Ie.current.size>1)mt(Dt);else if(lt){if(Tt=Te.intersectObjects([lt.eventObject]),Tt.length===0)return;Dt.copy(Tt[0].point).add(pe.current);const zt=lt.eventObject.name.split(" ")[1];t(Ft=>{const _t=Ft.elements.find(Qt=>{var gn;return Qt.id===((gn=Ft.selectedElement)==null?void 0:gn.id)}),tn=Ft.selectedElement;if(_t&&tn){const{pos:Qt,rot:gn}=me.getWorldDataById(zt),an=new ie().subVectors(Dt,Qt);if(an.applyEuler(new nn(0,0,-gn)),_t.cx=an.x,_t.cy=an.y,tn.parentId!==zt){_t.parentId!==zt&>(Ft,_t.id);const{rot:mn}=me.getWorldDataById(tn.id);_t.rotation[2]=mn-gn,_t.parentId=zt}else _t.parentId!==zt&&(_t.parentId!==tn.parentId&>(Ft,_t.id),_t.parentId=tn.parentId,_t.rotation[2]=tn.rotation[2])}})}else t(zt=>{const Ft=zt.elements.find(_t=>_t.id===N.current.id);if(Ft&&Ft.parentId!==Zo){Ft.parentId!==Zo&>(zt,Ft.id);const{rot:_t}=me.getWorldDataById(Ft.parentId);Ft.rotation[2]+=_t,Ft.parentId=Zo}}),mt(Dt);else if(b){const zt=a(N.current.id);zt&&zt.parentId===Zo&&je(Dt)}}break}}if(L.current){if(y!==z.None){Ne(Qe);const Tt=Te.intersectObjects([L.current]);if(Tt.length>0){const Dt=Tt[0].point;switch(y){case z.Foundation:{const lt=i(x,Dt);lt&&(t(zt=>{zt.addedFoundationId=lt.id,zt.objectTypeToAdd=z.None}),N.current=lt,he.current=!0);break}case z.Cuboid:{const lt=i(x,Dt);lt&&(t(zt=>{zt.addedCuboidId=lt.id,zt.objectTypeToAdd=z.None}),N.current=lt,He.current=!0);break}}}}if(N.current&&(he.current||He.current)){Ne(Qe);let Tt=Te.intersectObjects([L.current]);if(Tt.length===0)return;const Dt=Tt[0].point;if(N.current.type===z.Foundation)o(N.current.id,Dt.x,Dt.y);else if(N.current.type===z.Cuboid){const lt=dt(Qe,N.current.id);if(lt){if(Tt=Te.intersectObjects([lt.eventObject]),Tt.length===0)return;Dt.copy(Tt[0].point);const zt=lt.eventObject.name.split(" ")[1];t(Ft=>{const _t=Ft.elements.find(tn=>{var Qt;return tn.id===((Qt=N.current)==null?void 0:Qt.id)});if(_t){const{pos:tn,rot:Qt}=me.getWorldDataById(zt),gn=new ie().subVectors(Dt,tn);gn.applyEuler(new nn(0,0,-Qt)),_t.cx=gn.x,_t.cy=gn.y,_t.parentId=zt,_t.rotation[2]=-Qt}})}else t(zt=>{const Ft=zt.elements.find(_t=>{var tn;return _t.id===((tn=N.current)==null?void 0:tn.id)});if(Ft&&Ft.parentId!==Zo){const{rot:_t}=me.getWorldDataById(Ft.parentId);Ft.rotation[2]+=_t,Ft.parentId=Zo}}),o(N.current.id,Dt.x,Dt.y)}}}},tt=Qe=>{if(N.current&&N.current.type&&!N.current.locked){Ne(Qe);let Tt;if(k.current&&Be===eh.Vertical&&(Tt=Te.intersectObjects([k.current]),Tt&&Tt.length>0)){const Dt=Tt[0].point;switch(N.current.type){case z.Tree:{const lt=N.current;switch(b){case vt.Top:s(lt.id,Dt.z),t(zt=>{zt.selectedElementHeight=Math.max(1,Dt.z)});break;case vt.Left:case vt.Right:case vt.Upper:case vt.Lower:l(lt.id,2*Math.hypot(Dt.x-lt.cx,Dt.y-lt.cy));break}Ve(Fn.getState().treeRef,Qe);break}case z.Flower:{Ve(Fn.getState().flowerRef,Qe);break}case z.Human:{Ve(Fn.getState().humanRef,Qe);break}}}}},Fe=Qe=>Qe===z.Foundation||Qe===z.Cuboid||Qe===z.Tree||Qe===z.Flower||Qe===z.Human,qe=(Qe,Tt,Dt,lt,zt)=>{if(Qe){for(const Ft of Qe.children)if(Ft.name.includes("Human")||Ft.name.includes("Tree")||Ft.name.includes("Flower")){const _t=Ye(Ft),tn=ge.current.get(_t);if(tn)if(Math.abs(te.current.z/2-Ft.position.z)<.01){const Qt=new ie().subVectors(tn,lt).applyEuler(new nn(0,0,-zt));Ft.position.setX(Qt.x),Ft.position.setY(Qt.y)}else{const Qt=new ie().subVectors(tn,F.current).applyEuler(new nn(0,0,-zt)),gn=new ie().subVectors(lt,F.current),an=new ie().subVectors(Qt,gn);Math.abs(Qt.x/te.current.x)>.49?(Ft.position.setX((Qt.x>0?Tt:-Tt)/2),Ft.position.setY(an.y)):Math.abs(Qt.y/te.current.y)>.49&&(Ft.position.setX(an.x),Ft.position.setY((Qt.y>0?Dt:-Dt)/2))}}}},je=Qe=>{if(!N.current)return;const Tt=new Xt(Qe.x,Qe.y),Dt=new Xt(P.x,P.y),lt=Dt.distanceTo(Tt),zt=Math.atan2(Tt.x-P.x,Tt.y-P.y)+N.current.rotation[2];let Ft=Math.abs(lt*Math.sin(zt)),_t=Math.abs(lt*Math.cos(zt));const tn=new Xt().addVectors(Tt,Dt).multiplyScalar(.5);if(N.current.type===z.Cuboid&&(b===vt.Lower||b===vt.Upper||b===vt.Left||b===vt.Right)){const Qt=new ie(P.x,P.y),gn=N.current.rotation[2],an=new ie(Qe.x,Qe.y).sub(Qt).applyEuler(new nn(0,0,-gn)),mn=new ie(1,0,0);(b===vt.Upper||b===vt.Lower)&&mn.set(0,1,0),mn.applyEuler(new nn(0,0,gn));const Hn=Qt.clone().add(mn.clone().multiplyScalar(an.x/2));b===vt.Left||b===vt.Right?(Ft=Math.abs(an.x),_t=N.current.ly):(b===vt.Upper||b===vt.Lower)&&(Ft=N.current.lx,_t=Math.abs(an.y),Hn.copy(Qt.add(mn.clone().multiplyScalar(an.y/2)))),tn.x=Hn.x,tn.y=Hn.y}switch(t(Qt=>{if(!N.current)return;let gn=!1;for(const an of Qt.elements)if(an.id===N.current.id){switch(an.type){case z.Cuboid:case z.Foundation:{const mn=n(an.id);if(mn.length>0){const Hn=[];for(const yo of mn){if(me.isPlantOrHuman(yo))continue;const So=JSON.parse(JSON.stringify(yo));if(Hn.push(So),me.isIdentical(So.normal,rs))if(yo.type===z.Wall){const $o=Z.current.get(yo.id);if($o){const mo=-an.rotation[2],{centerPointAbsPos:Jn,leftPointAbsPos:uo,rightPointAbsPos:ir}=$o,Rr=new Xt().subVectors(Jn,tn).rotateAround(si,mo),br=new Xt().subVectors(uo,tn).rotateAround(si,mo),Vr=new Xt().subVectors(ir,tn).rotateAround(si,mo);switch(b){case vt.Lower:case vt.Upper:So.cy=Rr.y;break;case vt.Left:case vt.Right:So.cx=Rr.x;break;case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:So.cx=Rr.x,So.cy=Rr.y;break}So.leftPoint=[br.x,br.y,0],So.rightPoint=[Vr.x,Vr.y,0]}}else{const $o=ge.current.get(yo.id);if($o){const mo=-an.rotation[2],Jn=new Xt().subVectors(new Xt($o.x,$o.y),tn).rotateAround(si,mo);switch(b){case vt.Lower:case vt.Upper:So.type===z.SolarPanel?So.cy=Jn.y:So.cy=Jn.y/_t;break;case vt.Left:case vt.Right:So.type===z.SolarPanel?So.cx=Jn.x:So.cx=Jn.x/Ft;break;case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:So.type===z.SolarPanel?(So.cx=Jn.x,So.cy=Jn.y):(So.cx=Jn.x/Ft,So.cy=Jn.y/_t);break}}}else if(So.type===z.SolarPanel&&So.parentType===z.Roof){const $o=ge.current.get(yo.id);if($o){const mo=new Xt().subVectors(new Xt($o.x,$o.y),tn).rotateAround(si,-an.rotation[2]);So.cx=mo.x,So.cy=mo.y}}}const Fo=JSON.parse(JSON.stringify(an));switch(b){case vt.Lower:case vt.Upper:case vt.Left:case vt.Right:case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:Fo.lx=Ft,Fo.ly=_t,Fo.cx=tn.x,Fo.cy=tn.y;break}if(me.doesParentContainAllChildren(Fo,Hn)){switch(b){case vt.Lower:case vt.Upper:case vt.Left:case vt.Right:case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:an.lx=Ft,an.ly=_t,an.cx=tn.x,an.cy=tn.y;break}gn=!0}}else if(Ft>.49&&_t>.49){switch(b){case vt.Lower:case vt.Upper:case vt.Left:case vt.Right:case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:an.lx=Ft,an.ly=_t,an.cx=tn.x,an.cy=tn.y;break}gn=!0}break}}break}if(gn)for(const an of Qt.elements){if(an.parentId===N.current.id)switch(an.type){case z.Wall:{const mn=an,Hn=Z.current.get(an.id);if(Hn){const Fo=-N.current.rotation[2],{centerPointAbsPos:yo,leftPointAbsPos:So,rightPointAbsPos:$o}=Hn,mo=new Xt().subVectors(yo,tn).rotateAround(si,Fo),Jn=new Xt().subVectors(So,tn).rotateAround(si,Fo),uo=new Xt().subVectors($o,tn).rotateAround(si,Fo);switch(b){case vt.Lower:case vt.Upper:an.cy=mo.y;break;case vt.Left:case vt.Right:an.cx=mo.x;break;case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:an.cx=mo.x,an.cy=mo.y;break}mn.leftPoint=[Jn.x,Jn.y,0],mn.rightPoint=[uo.x,uo.y,0]}break}case z.SolarPanel:{const mn=ge.current.get(an.id);if(mn){const Hn=new Xt().subVectors(new Xt(mn.x,mn.y),tn).rotateAround(si,-N.current.rotation[2]),[Fo,yo,So]=an.normal;me.isEqual(So,1)&&(an.cx=Hn.x,an.cy=Hn.y),me.isEqual(Fo,0)&&me.isEqual(yo,1)?an.cy=_t/2:me.isEqual(Fo,0)&&me.isEqual(yo,-1)?an.cy=-_t/2:me.isEqual(Fo,-1)&&me.isEqual(yo,0)?an.cx=-Ft/2:me.isEqual(Fo,1)&&me.isEqual(yo,0)&&(an.cx=Ft/2)}break}case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:case z.WindTurbine:case z.Sensor:if(me.isIdentical(an.normal,rs)){const mn=ge.current.get(an.id);if(mn){const Hn=new Xt().subVectors(new Xt(mn.x,mn.y),tn).rotateAround(si,-N.current.rotation[2]);switch(b){case vt.Lower:case vt.Upper:an.cy=Hn.y/_t;break;case vt.Left:case vt.Right:an.cx=Hn.x/Ft;break;case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:an.cx=Hn.x/Ft,an.cy=Hn.y/_t;break}}}break;case z.Cuboid:{const mn=ge.current.get(an.id);if(mn){const Hn=new Xt().subVectors(new Xt(mn.x,mn.y),tn).rotateAround(si,-N.current.rotation[2]);switch(b){case vt.Lower:case vt.Upper:an.cy=Hn.y;break;case vt.Left:case vt.Right:an.cx=Hn.x;break;case vt.LowerLeft:case vt.LowerRight:case vt.UpperLeft:case vt.UpperRight:an.cx=Hn.x,an.cy=Hn.y;break}}break}case z.Polygon:if(me.isIdentical(an.normal,rs)){const mn=an,Hn=de.current.get(mn.id);if(Hn){const Fo=[];Hn.forEach(yo=>{const So=new Xt().subVectors(yo,tn).rotateAround(si,-N.current.rotation[2]);Fo.push({x:So.x/Ft,y:So.y/_t})}),mn.vertices=Fo}}break}if(an.foundationId===N.current.id&&(an.type===z.SolarPanel||an.type===z.Window)&&an.parentType===z.Roof){const mn=ge.current.get(an.id);if(mn){const Hn=new Xt().subVectors(new Xt(mn.x,mn.y),tn).rotateAround(si,-N.current.rotation[2]);an.cx=Hn.x,an.cy=Hn.y}}if(an.foundationId===N.current.id&&(an.type===z.Sensor||an.type===z.Light)&&an.parentType===z.Roof){const mn=ge.current.get(an.id);if(mn){const Hn=new Xt().subVectors(new Xt(mn.x,mn.y),tn).rotateAround(si,-N.current.rotation[2]);an.cx=Hn.x/Ft,an.cy=Hn.y/_t}}}}),N.current.type){case z.Foundation:{const Qt=Fn.getState().foundationRef;Qt!=null&&Qt.current&&qe(Qt==null?void 0:Qt.current,Ft,_t,Qt.current.position,N.current.rotation[2]);break}case z.Cuboid:{const Qt=Fn.getState().cuboidRef;Qt!=null&&Qt.current&&Qt.current.parent&&qe(Qt==null?void 0:Qt.current,Ft,_t,Qt.current.parent.position,N.current.rotation[2]);break}}},rt=Qe=>{const{cx:Tt,cy:Dt}=N.current,lt=Math.atan2(Tt-Qe.x,Qe.y-Dt)+(C===Kr.Upper?0:Math.PI),zt=Math.abs(lt)>Math.PI?-Math.sign(lt)*la:0;r(N.current.id,0,0,lt+zt)},mt=Qe=>{const Tt=Ie.current.size>1;if(Tt){t(_t=>{for(const tn of _t.elements)if(md(tn)&&Ie.current.has(tn.id)){const Qt=Ie.current.get(tn.id);Qt&&(tn.cx=Qe.x+Qt.x,tn.cy=Qe.y+Qt.y)}});return}let Dt,lt;const zt=N.current.lx/2,Ft=N.current.ly/2;switch(w){case Ho.Top:{if(Tt){const _t=new ie(Qe.x,Qe.y);t(tn=>{for(const Qt of tn.elements)if(Qt.id===N.current.id)Qt.cx=_t.x,Qt.cy=_t.y;else if(Ie.current.has(Qt.id)){const gn=Ie.current.get(Qt.id);if(gn){const an=new ie().addVectors(_t,gn);Qt.cx=an.x,Qt.cy=an.y}}})}else o(N.current.id,Qe.x,Qe.y);break}case Ho.Upper:if(Dt=Qe.x+Ee*Ft,lt=Qe.y-Pe*Ft,Tt){const _t=new ie(Dt,lt);t(tn=>{for(const Qt of tn.elements)if(Qt.id===N.current.id)Qt.cx=_t.x,Qt.cy=_t.y;else if(Ie.current.has(Qt.id)){const gn=Ie.current.get(Qt.id);if(gn){const an=new ie().addVectors(_t,gn);Qt.cx=an.x,Qt.cy=an.y}}})}else o(N.current.id,Dt,lt);break;case Ho.Lower:if(Dt=Qe.x-Ee*Ft,lt=Qe.y+Pe*Ft,Tt){const _t=new ie(Dt,lt);t(tn=>{for(const Qt of tn.elements)if(Qt.id===N.current.id)Qt.cx=_t.x,Qt.cy=_t.y;else if(Ie.current.has(Qt.id)){const gn=Ie.current.get(Qt.id);if(gn){const an=new ie().addVectors(_t,gn);Qt.cx=an.x,Qt.cy=an.y}}})}else o(N.current.id,Dt,lt);break;case Ho.Left:if(Dt=Qe.x+Pe*zt,lt=Qe.y+Ee*zt,Tt){const _t=new ie(Dt,lt);t(tn=>{for(const Qt of tn.elements)if(Qt.id===N.current.id)Qt.cx=_t.x,Qt.cy=_t.y;else if(Ie.current.has(Qt.id)){const gn=Ie.current.get(Qt.id);if(gn){const an=new ie().addVectors(_t,gn);Qt.cx=an.x,Qt.cy=an.y}}})}else o(N.current.id,Dt,lt);break;case Ho.Right:if(Dt=Qe.x-Pe*zt,lt=Qe.y-Ee*zt,Tt){const _t=new ie(Dt,lt);t(tn=>{for(const Qt of tn.elements)if(Qt.id===N.current.id)Qt.cx=_t.x,Qt.cy=_t.y;else if(Ie.current.has(Qt.id)){const gn=Ie.current.get(Qt.id);if(gn){const an=new ie().addVectors(_t,gn);Qt.cx=an.x,Qt.cy=an.y}}})}else o(N.current.id,Dt,lt);break}};return m.useEffect(()=>{const Qe=()=>{const Tt=H.getState().addedFoundationId,Dt=H.getState().addedCuboidId;Tt&&(c(Tt,!1),t(lt=>{lt.objectTypeToAdd=z.Foundation,lt.addedFoundationId=null}),Fn.getState().setEnableOrbitController(!0),N.current=null,he.current=!1,xe.current=!1),Dt&&(c(Dt,!1),t(lt=>{lt.objectTypeToAdd=z.Cuboid,lt.addedCuboidId=null}),Fn.getState().setEnableOrbitController(!0),N.current=null,He.current=!1,Se.current=!1)};return window.addEventListener("beforeunload",Qe),()=>{window.removeEventListener("beforeunload",Qe)}},[]),h.jsxs(h.Fragment,{children:[N.current&&Be!==eh.Ground&&h.jsx(ua,{ref:k,visible:!1,name:"Ground Intersection Plane",rotation:We,position:Je,args:[1e5,1e5],onPointerMove:L2.throttle(tt,VF,{trailing:!1}),children:h.jsx("meshStandardMaterial",{side:$r,opacity:.5,transparent:!0})}),h.jsx(ua,{receiveShadow:v,ref:L,name:"Ground",userData:{stand:!0},rotation:[0,0,0],position:[0,0,0],args:[1e4,1e4],renderOrder:-2,onContextMenu:ut,onPointerDown:At,onPointerMove:L2.throttle(Ct,VF,{trailing:!1}),children:M&&!A?h.jsx("meshBasicMaterial",{color:T}):h.jsx("meshStandardMaterial",{depthTest:!1,color:A?"white":T,map:A?me.WATER_TEXTURE:me.WHITE_TEXTURE,needsUpdate:!0})})]})}),nae=48,mnn=72,ynn=12,Ann=be.memo(({date:t,hourAngle:e,declinationAngle:n,worldLatitude:o})=>{const r=H(Ug),i=H(HBe),a=H(vBe)??!0,l=H(xBe)??!0,s=H(bBe)??!0,[c,u]=m.useState(me.toRadians(42)),d=bb(Yye),f=Math.max(2,r*.2),p=Math.max(.4,r*.025),g=o3(lW,hN),y=r*.05,w={font:g,height:0,size:y},b=6,C=new Array(2*b+1).fill(0),P=_=>_===0?-y*.3:_>0&&_<7?-y*.8:-y*1.2;m.useEffect(()=>{u(me.toRadians(o))},[o]);const v=6,[T,A]=m.useMemo(()=>{const _=new Ni,X=new Ni,$=[],Q=[],le=la/mnn;let q=0;for(let ne=0;neIt&&(ge=.05*r+(q%3===0?.2:0),de=new ie(r,fe,0),de.z=.002,Q.push(me.sphericalToCartesianZ(de)),de=new ie(r+ge,fe,0),de.z=.002,Q.push(me.sphericalToCartesianZ(de))),q++}const te=$.length*3,re=new Float32Array(te),ae=new Float32Array(te),se=new Float32Array(te);for(let ne=0;ne<$.length;ne++){const fe=ne*3;re[fe]=$[ne].x,re[fe+1]=$[ne].y,re[fe+2]=$[ne].z,ae[fe]=0,ae[fe+1]=1,ae[fe+2]=0;const ge=Math.floor(ne/18)%2===0?.2:1;se[fe]=ge,se[fe+1]=ge,se[fe+2]=ge}return _.setAttribute("position",new nl(re,3)),_.setAttribute("normal",new nl(ae,3)),_.setAttribute("color",new nl(se,3)),X.setFromPoints(Q),[_,X]},[r]),x=m.useMemo(()=>{const _=[],X=dl(t,me.toDegrees(c)),$=pO(X.sunrise),Q=pO(X.sunset),le=(Q-$)/nae;for(let q=$;q-.01&&_.push(te)}return _},[t,c,r,n]),S=_=>{const X=pN(_),$=[],Q=dl(_,me.toDegrees(c)),le=pO(Q.sunrise),q=pO(Q.sunset),te=(q-le)/nae;for(let re=le;re-.01&&$.push(ae)}return $},R=m.useMemo(()=>{const _=[];for(let X=0;X<=v;X++){const $=new Date(2021,X===0?11:X-1,22);_.push(S($))}return _},[c,r]),M=m.useMemo(()=>a9(r,e,n,c),[c,n,e,r]),D=m.useMemo(()=>M.clone().normalize(),[M]),E=m.useMemo(()=>new ie(M.x,M.y,0).normalize(),[M]),W=m.useMemo(()=>Math.asin(M.z/M.length()),[M]),j=m.useMemo(()=>{const X=new D2(0,0,f,f,0,W,!1,0).getPoints(25),$=new Array;for(const Q of X)$.push(new ie(Q.x,Q.y,0));return $},[W,M,f]),L=m.useMemo(()=>Math.acos(M.z/M.length()),[M]),k=m.useMemo(()=>{const X=new D2(0,0,f*.8,f*.8,W,Gt,!1,0).getPoints(25),$=new Array;for(const Q of X)$.push(new ie(Q.x,Q.y,0));return $},[L,M,f,W]),N=m.useMemo(()=>{const _=Math.acos(M.y/Math.hypot(M.x,M.y));return M.x>0?-_:_},[M]),F=m.useMemo(()=>{const X=new D2(0,0,f*1.2,f*1.2,Gt,Gt+N,M.x>0,0).getPoints(50),$=new Array;for(const Q of X)$.push(new ie(Q.x,Q.y,0));return $},[N,M,f]),U=m.useMemo(()=>{const _=2*lP/ynn,X=la/nae,$=new Ni;let Q=0;const le=[],q=[];for(let te=-lP;teMath.PI&&(ae=Math.PI),se>lP&&(se=lP);const ne=a9(r,re,te,c),fe=a9(r,ae,te,c),ge=a9(r,ae,se,c),de=a9(r,re,se,c);(ne.z>=0||fe.z>=0||ge.z>=0||de.z>=0)&&(le.push(ne,fe,ge,de),q.push(Q),q.push(Q+1),q.push(Q+2),q.push(Q),q.push(Q+2),q.push(Q+3),Q+=4)}return $.setFromPoints(le),$.setIndex(new nl(new Uint16Array(q),1)),$},[c,r]),O=.05*r,B=2+5*O;return h.jsxs("group",{children:[C.map((_,X)=>{let $=Math.ceil(X/2)*(X%2===0?1:-1);$===-b&&($=b);const Q=P(Math.abs($));return h.jsx("group",{rotation:[Gt,$*Math.PI/b,0],children:h.jsxs("mesh",{position:[Q,0,-r*1.1],rotation:[-Gt,0,0],children:[h.jsx("textGeometry",{args:[`${-(180/b)*$}°`,w]}),h.jsx("meshStandardMaterial",{attach:"material",color:"lightGray"})]})},X)}),h.jsxs("mesh",{rotation:new nn(0,0,0),name:"Heliodon",children:[h.jsxs("mesh",{children:[h.jsx("bufferGeometry",{...T}),h.jsx("meshBasicMaterial",{side:$r,vertexColors:!0,polygonOffset:!0,polygonOffsetFactor:-.7,polygonOffsetUnits:-2})]}),h.jsxs("lineSegments",{children:[h.jsx("bufferGeometry",{...A}),h.jsx("meshBasicMaterial",{color:0})]}),h.jsxs("mesh",{children:[x.length>3&&h.jsx(jn,{lineWidth:2,points:x,color:"yellow"}),R.filter(_=>_.length>3).map((_,X)=>h.jsx(jn,{opacity:X===0||X===v?1:.5,lineWidth:X===0||X===v?1:.5,points:_,color:"#999"},X)),h.jsx("mesh",{args:[U],children:h.jsx("meshBasicMaterial",{side:$r,color:[1,1,0],transparent:!0,opacity:.5,depthWrite:!1,clippingPlanes:[new l9(Oc,0)]})}),h.jsx("mesh",{position:M,children:h.jsx("sprite",{scale:[B,B,B],children:h.jsx("spriteMaterial",{map:d,transparent:!1,color:16777215,blending:nR,depthWrite:!1})})}),h.jsxs("mesh",{position:M,children:[h.jsx("sphereGeometry",{args:[O,10,10]}),h.jsx("meshBasicMaterial",{color:"white"})]})]})]}),h.jsx(ua,{args:[1e4,1e4],renderOrder:-1,userData:{unintersectable:!0},children:h.jsx("meshBasicMaterial",{transparent:!0,opacity:0})}),i&&M.z>0&&h.jsxs(h.Fragment,{children:[h.jsx(jn,{userData:{unintersectable:!0},points:[[0,0,0],[M.x,M.y,M.z]],name:"Line from origin to sun",lineWidth:.5,color:"white"}),h.jsx(jn,{userData:{unintersectable:!0},points:[[0,0,0],[M.x,M.y,0]],name:"Line from origin to sun projection on ground",lineWidth:.5,color:"white"}),h.jsx(jn,{userData:{unintersectable:!0},points:[[M.x,M.y,0],[M.x,M.y,M.z]],name:"Line from sun projection on ground to sun",lineWidth:.5,color:"white"}),l&&h.jsxs(h.Fragment,{children:[h.jsx(jn,{userData:{unintersectable:!0},linewidth:.5,points:j,position:[0,0,0],rotation:new nn(Gt,0,Gt+N,"ZXY"),color:"white",name:"Elevation Angle Arc"}),h.jsx("textSprite",{userData:{unintersectable:!0},name:"Elevation Angle",backgroundColor:"indigo",text:me.toDegrees(W).toFixed(0)+"°",fontSize:80,fontFace:"Times Roman",textHeight:p,position:D.clone().multiplyScalar(f).add(E.clone().multiplyScalar(f)).multiplyScalar(.65)})]}),s&&h.jsxs(h.Fragment,{children:[h.jsx(jn,{userData:{unintersectable:!0},linewidth:.5,points:k,position:[0,0,0],rotation:new nn(Gt,0,Gt+N,"ZXY"),color:"white",name:"Zenith Angle Arc"}),h.jsx("textSprite",{userData:{unintersectable:!0},name:"Zenith Angle",backgroundColor:"navy",text:me.toDegrees(L).toFixed(0)+"°",fontSize:80,fontFace:"Times Roman",textHeight:p,position:D.clone().multiplyScalar(f).add(Io.clone().multiplyScalar(f)).multiplyScalar(.57)})]}),a&&h.jsxs(h.Fragment,{children:[h.jsx(jn,{userData:{unintersectable:!0},linewidth:.5,points:F,position:[0,0,0],color:"white",name:"Azimuth Angle Arc"}),h.jsx("textSprite",{userData:{unintersectable:!0},name:"Azimuth Angle",backgroundColor:"firebrick",text:me.toDegrees(Math.abs(N-Math.PI)<1e-6?N:-N).toFixed(0)+"°",fontSize:80,fontFace:"Times Roman",textHeight:p,position:E.clone().multiplyScalar(f).add(Oc.clone().multiplyScalar(f)).multiplyScalar(1.1).add(new ie(0,0,p/2))})]})]})]})}),wnn=be.memo(()=>{const t=H(RBe),e=H(Ug),n=H(Tc),o=H(rl),r=H(B7t),i=m.useMemo(()=>new Date(o),[o]),[a,l]=m.useMemo(()=>[Bye(i),pN(i)],[i]);return m.useEffect(()=>{r(a9(e,a,l,me.toRadians(n)))},[n,a,l,e]),h.jsx(h.Fragment,{children:t&&h.jsx(Ann,{date:new Date(o),hourAngle:a,declinationAngle:l,worldLatitude:n})})}),qTe="/aladdin/assets/ifi-logo-CwxGDl7t.png",vnn="/aladdin/assets/magic-lamp-XxXOV1dq.png",xnn=be.memo(({top:t,height:e,color:n})=>{const o=H(s0),r=m.useMemo(()=>({lng:o}),[o]),i=t+56+"px",a=t+100+"px",l=t+205+"px";return h.jsxs("div",{children:[h.jsxs("div",{style:{position:"absolute",borderRadius:"20px",border:"thin",textAlign:"center",left:"15%",right:"15%",top:t+"px",height:(e??300)+"px"},children:[h.jsx("h2",{style:{marginTop:"20px",color:n},children:Y.t("aboutUs.ProductBroughtToYouBy",r)}),h.jsxs("p",{style:{paddingTop:"6px",fontSize:"12px",color:n},children:[h.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://intofuture.org/aladdin-terms.html",style:{color:n,textDecoration:"none"},children:Y.t("aboutUs.TermsOfService",r)}),"   |   ",h.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://intofuture.org/aladdin-privacy.html",style:{color:n,textDecoration:"none"},children:Y.t("aboutUs.PrivacyPolicy",r)})]})]}),h.jsxs("div",{children:[h.jsx("hr",{style:{position:"absolute",left:"10%",width:"80%",marginTop:i,color:n}}),h.jsx("table",{style:{position:"absolute",border:"none",top:a,left:"10%",width:"80%",fontSize:"small",color:n},children:h.jsx("tbody",{children:h.jsxs("tr",{style:{verticalAlign:"top"},children:[h.jsxs("td",{children:[h.jsx("h3",{style:{color:n},children:Y.t("aboutUs.Software",r)}),"Xiaotong Ding",h.jsx("br",{}),"Charles Xie",h.jsx("br",{})]}),h.jsxs("td",{children:[h.jsx("h3",{style:{color:n},children:Y.t("aboutUs.Content",r)}),"Charles Xie",h.jsx("br",{})]}),h.jsxs("td",{children:[h.jsx("h3",{style:{color:n},children:Y.t("aboutUs.Support",r)}),"Charles Xie",h.jsx("br",{})]})]})})})]}),h.jsxs("div",{style:{position:"absolute",left:"10%",marginRight:"10%",top:l,fontSize:"12px",textAlign:"justify",color:n},children:[Y.t("aboutUs.Translators",r),": ",s9.Ukrainian," (Andriy Kashyrskyy), ",s9.Spanish," (Alex Barco), ",s9.Turkish," (Hasan Bircan)",h.jsx("br",{}),h.jsx("br",{}),Y.t("aboutUs.Acknowledgment",r),": ",Y.t("aboutUs.FundingInformation",r)," ",Y.t("aboutUs.Contact",r)]})]})}),bnn=Ro.div` position: absolute; top: 80px; left: 10px; @@ -4871,7 +4871,7 @@ function print() { __p += __j.call(arguments, '') } border-radius: 10px; background: dimgray; box-shadow: 3px 3px 3px 3px black; -`,Snn=be.memo(({close:t})=>{const e=H(s0);return h.jsxs(bnn,{children:[h.jsx(xnn,{top:10,color:"antiquewhite"}),h.jsx("div",{style:{position:"absolute",fontSize:"small",color:"antiquewhite",cursor:"pointer",bottom:"10px"},onMouseDown:()=>{t()},children:Y.t("word.Close",{lng:e})})]})});var Tnn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 244c176.18 0 319 142.82 319 319v233a32 32 0 01-32 32H225a32 32 0 01-32-32V563c0-176.18 142.82-319 319-319zM484 68h56a8 8 0 018 8v96a8 8 0 01-8 8h-56a8 8 0 01-8-8V76a8 8 0 018-8zM177.25 191.66a8 8 0 0111.32 0l67.88 67.88a8 8 0 010 11.31l-39.6 39.6a8 8 0 01-11.31 0l-67.88-67.88a8 8 0 010-11.31l39.6-39.6zm669.6 0l39.6 39.6a8 8 0 010 11.3l-67.88 67.9a8 8 0 01-11.32 0l-39.6-39.6a8 8 0 010-11.32l67.89-67.88a8 8 0 0111.31 0zM192 892h640a32 32 0 0132 32v24a8 8 0 01-8 8H168a8 8 0 01-8-8v-24a32 32 0 0132-32zm148-317v253h64V575h-64z"}}]},name:"alert",theme:"filled"},Pnn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Tnn}))},Cnn=m.forwardRef(Pnn),Rnn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M766.4 744.3c43.7 0 79.4-36.2 79.4-80.5 0-53.5-79.4-140.8-79.4-140.8S687 610.3 687 663.8c0 44.3 35.7 80.5 79.4 80.5zm-377.1-44.1c7.1 7.1 18.6 7.1 25.6 0l256.1-256c7.1-7.1 7.1-18.6 0-25.6l-256-256c-.6-.6-1.3-1.2-2-1.7l-78.2-78.2a9.11 9.11 0 00-12.8 0l-48 48a9.11 9.11 0 000 12.8l67.2 67.2-207.8 207.9c-7.1 7.1-7.1 18.6 0 25.6l255.9 256zm12.9-448.6l178.9 178.9H223.4l178.8-178.9zM904 816H120c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8z"}}]},name:"bg-colors",theme:"outlined"},Hnn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Rnn}))},Mnn=m.forwardRef(Hnn),Inn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 248H728l-32.4-90.8a32.07 32.07 0 00-30.2-21.2H358.6c-13.5 0-25.6 8.5-30.1 21.2L296 248H160c-44.2 0-80 35.8-80 80v456c0 44.2 35.8 80 80 80h704c44.2 0 80-35.8 80-80V328c0-44.2-35.8-80-80-80zm8 536c0 4.4-3.6 8-8 8H160c-4.4 0-8-3.6-8-8V328c0-4.4 3.6-8 8-8h186.7l17.1-47.8 22.9-64.2h250.5l22.9 64.2 17.1 47.8H864c4.4 0 8 3.6 8 8v456zM512 384c-88.4 0-160 71.6-160 160s71.6 160 160 160 160-71.6 160-160-71.6-160-160-160zm0 256c-53 0-96-43-96-96s43-96 96-96 96 43 96 96-43 96-96 96z"}}]},name:"camera",theme:"outlined"},znn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Inn}))},Vu=m.forwardRef(znn),Dnn={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"},Enn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Dnn}))},Sh=m.forwardRef(Enn),Fnn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v584zM688 420h-55.2c-5.1 0-10 2.5-13 6.6L468.9 634.4l-64.7-89c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.4 0-12.8-6.5-12.8z"}}]},name:"carry-out",theme:"outlined"},knn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Fnn}))},Lnn=m.forwardRef(knn),Wnn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},Nnn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Wnn}))},Unn=m.forwardRef(Nnn),jnn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M518.3 459a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V856c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V613.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 459z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-upload",theme:"outlined"},Bnn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:jnn}))},Ynn=m.forwardRef(Bnn),Onn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M690 405h-46.9c-10.2 0-19.9 4.9-25.9 13.2L512 563.6 406.8 418.2c-6-8.3-15.6-13.2-25.9-13.2H334c-6.5 0-10.3 7.4-6.5 12.7l178 246c3.2 4.4 9.7 4.4 12.9 0l178-246c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"down-circle",theme:"outlined"},_nn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Onn}))},Vnn=m.forwardRef(_nn),Gnn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32zm-622.3-84c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9z"}}]},name:"edit",theme:"filled"},Xnn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Gnn}))},Jnn=m.forwardRef(Xnn),Knn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},qnn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Knn}))},ny=m.forwardRef(qnn),$nn={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},Qnn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:$nn}))},Znn=m.forwardRef(Qnn),eon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M603.3 327.5l-246 178a7.95 7.95 0 000 12.9l246 178c5.3 3.8 12.7 0 12.7-6.5V643c0-10.2-4.9-19.9-13.2-25.9L457.4 512l145.4-105.2c8.3-6 13.2-15.6 13.2-25.9V334c0-6.5-7.4-10.3-12.7-6.5z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"left-circle",theme:"outlined"},ton=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:eon}))},non=m.forwardRef(ton),oon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},ron=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:oon}))},ion=m.forwardRef(ron),aon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"},lon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:aon}))},son=m.forwardRef(lon),con={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3-15.4 12.3-16.6 35.4-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8z"}}]},name:"pushpin",theme:"filled"},uon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:con}))},don=m.forwardRef(uon),fon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"}}]},name:"pushpin",theme:"outlined"},hon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:fon}))},qTe=m.forwardRef(hon),pon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M666.7 505.5l-246-178A8 8 0 00408 334v46.9c0 10.2 4.9 19.9 13.2 25.9L566.6 512 421.2 617.2c-8.3 6-13.2 15.6-13.2 25.9V690c0 6.5 7.4 10.3 12.7 6.5l246-178c4.4-3.2 4.4-9.8 0-13z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"right-circle",theme:"outlined"},gon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:pon}))},zQe=m.forwardRef(gon),mon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},yon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:mon}))},Mf=m.forwardRef(yon),Aon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},won=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Aon}))},von=m.forwardRef(won),xon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M839.6 433.8L749 150.5a9.24 9.24 0 00-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 00-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 00-9.2-9.3zM416 702h-76V172c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v530h-76c-6.7 0-10.5 7.8-6.3 13l112 141.9a8 8 0 0012.6 0l112-141.9c4.1-5.2.4-13-6.3-13z"}}]},name:"sort-ascending",theme:"outlined"},bon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:xon}))},Son=m.forwardRef(bon),Ton={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M839.6 433.8L749 150.5a9.24 9.24 0 00-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 00-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 00-9.2-9.3zM310.3 167.1a8 8 0 00-12.6 0L185.7 309c-4.2 5.3-.4 13 6.3 13h76v530c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V322h76c6.7 0 10.5-7.8 6.3-13l-112-141.9z"}}]},name:"sort-descending",theme:"outlined"},Pon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Ton}))},Con=m.forwardRef(Pon),Ron={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"unordered-list",theme:"outlined"},Hon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Ron}))},fu=m.forwardRef(Hon),Mon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M518.5 360.3a7.95 7.95 0 00-12.9 0l-178 246c-3.8 5.3 0 12.7 6.5 12.7H381c10.2 0 19.9-4.9 25.9-13.2L512 460.4l105.2 145.4c6 8.3 15.6 13.2 25.9 13.2H690c6.5 0 10.3-7.4 6.5-12.7l-178-246z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"up-circle",theme:"outlined"},Ion=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Mon}))},zon=m.forwardRef(Ion),Don={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"},Eon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Don}))},Fon=m.forwardRef(Eon),kon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M859.9 780H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM505.7 669a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V176c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8z"}}]},name:"vertical-align-bottom",theme:"outlined"},Lon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:kon}))},Won=m.forwardRef(Lon),Non={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},Uon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Non}))},hX=m.forwardRef(Uon);const jon="pSdH5rJWovu8hchgLSnsqT",Bon="02/02/2023 12:24 pm",Yon=1675358675337,Oon="QWecNcxhyvP6j6sBN11hBsfZDau1",_on=null,Von=null,Gon={latitude:42.2844063,timesPerHour:20,date:"1/22/2022 10:15:00 AM",longitude:-71.3488548,name:"default",address:"Natick, MA",ground:{snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0],albedo:.3,thermalDiffusivity:.05},orthographic:!1,cameraZoom:28.63945562104857},Xon=[{cy:1.9385448115528998,name:"June",type:"Human",cz:11465644746167777e-31,normal:[0,1,0],cx:-2.72710574788732,selected:!1,id:"8si9AKQwGf4sYiD91xfFr6",rotation:[0,0,0],parentId:"Ground"}],Jon={mapWeatherStations:!1,showGroundPanel:!1,showSiteInfoPanel:!0,mapTilt:0,groundPanelY:0,yearlyLightSensorPanelY:0,axes:!0,showHeliodonPanel:!0,showWeatherPanel:!1,dailyLightSensorPanelY:0,mapType:"roadmap",groundImage:!1,autoRotate:!1,dailyLightSensorPanelX:0,showYearlyLightSensorPanel:!1,weatherPanelY:0,heliodonPanelX:-6,showStickyNotePanel:!0,groundColor:"#16cda5",weatherPanelX:0,heliodonPanelY:9,groundPanelX:0,shadowEnabled:!0,theme:"Default",heliodon:!0,stickyNotePanelY:0,yearlyLightSensorPanelX:0,showDailyLightSensorPanel:!1,mapZoom:16,stickyNotePanelX:0,cameraPosition:[-2.2645315712935465,-19.016408185270922,3.0537676736998205],panCenter:[1.9284721678646957,1.0746189678250615,2.420128405670479],orthographic:!1,enableRotate:!0,cameraZoom:24.55475326309651,showInstructionPanel:!1,cameraPosition2D:[0,-4000177797536253e-20,39.9999999999799],panCenter2D:[0,0,0],showSunAngles:!0,stickyNotePanelRect:{x:-5,y:-2,width:309,height:64}},Kon=1,qon={pvModelName:"CS6X-355P-FG",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},$on={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},Qon={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},Zon={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},ern=["Sun angles relative to the ground"],trn={docid:jon,time:Bon,timestamp:Yon,userid:Oon,owner:_on,email:Von,world:Gon,elements:Xon,view:Jon,evolutionMethod:Kon,solarPanelArrayLayoutParams:qon,solarPanelArrayLayoutConstraints:$on,evolutionaryAlgorithmState:Qon,economicsParams:Zon,notes:ern},nrn="aLZxDeCyLDDueFWdBcXne3",orn="02/02/2023 12:27 pm",rrn=1675358863088,irn="QWecNcxhyvP6j6sBN11hBsfZDau1",arn=null,lrn=null,srn={latitude:0,timesPerHour:6,date:"9/22/2022, 3:00:00 PM",longitude:-71.3488548,name:"default",address:"",ground:{snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0],albedo:.3,thermalDiffusivity:.05},orthographic:!1,cameraZoom:28.63945562104857,noAnimationForSensorDataCollection:!0},crn=[{cy:-3.793749931074972,name:"Jeanette",type:"Human",cz:0,normal:[0,1,0],cx:-1.8371287635005462,selected:!1,id:"8si9AKQwGf4sYiD91xfFr6",rotation:[0,0,0],parentId:"Ground",lx:.4,ly:.6,lz:1.62},{type:"Foundation",cx:-.02034256309656146,cy:-.0945631153454527,cz:.05,lx:4.039349774896637,ly:4.009416382499952,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",selected:!1,id:"vtjS16tFJ2nQYaRPqaTXtD",textureType:"Foundation Texture #2"},{type:"Sensor",cx:.24583065540477922,cy:-.24570551313996075,cz:.5000000074505806,lx:.1,ly:.1,lz:.01,showLabel:!0,normal:[0,0,1],rotation:[0,0,0],parentId:"vtjS16tFJ2nQYaRPqaTXtD",foundationId:"vtjS16tFJ2nQYaRPqaTXtD",id:"1RgbN67ETfax1aEC4UN1sd",selected:!1}],urn={mapWeatherStations:!1,showGroundPanel:!1,showSiteInfoPanel:!0,mapTilt:0,groundPanelY:0,yearlyLightSensorPanelY:5,axes:!0,showHeliodonPanel:!0,showWeatherPanel:!1,dailyLightSensorPanelY:203,mapType:"roadmap",groundImage:!1,autoRotate:!1,dailyLightSensorPanelX:-31,showYearlyLightSensorPanel:!0,weatherPanelY:0,heliodonPanelX:-5,showStickyNotePanel:!0,groundColor:"#16cda5",weatherPanelX:0,heliodonPanelY:4,groundPanelX:0,shadowEnabled:!0,theme:"Default",heliodon:!0,stickyNotePanelY:0,yearlyLightSensorPanelX:-1,showDailyLightSensorPanel:!1,mapZoom:16,stickyNotePanelX:0,cameraPosition:[14.252594110627898,-20.834202556609767,6.804345920821559],panCenter:[0,0,0],orthographic:!1,enableRotate:!0,cameraZoom:58.72652247402654,showInstructionPanel:!1,cameraPosition2D:[0,-4000177797536253e-20,39.9999999999795],panCenter2D:[0,0,0],showSunAngles:!0,stickyNotePanelRect:{x:1204,y:154,width:595,height:199},yearlyLightSensorPanelRect:{x:-1284,y:2,width:600,height:500},yearlyLightSensorPanelShowDaylight:!1},drn=1,frn={pvModelName:"CS6X-355P-FG",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},hrn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},prn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},grn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},mrn=["The solar radiation at different locations of the Earth in different seasons is largely responsible for local climate. Overall, every place on the Earth has about the same hours of daylight in total (ideally 12×365=4,380 hours), regardless of where it is. However, the distribution throughout the year is vastly different, resulting in large temperature variations across the globe. You can change the latitude to investigate these relationships. Make sure to refresh the graph after changing any variables."],yrn={docid:nrn,time:orn,timestamp:rrn,userid:irn,owner:arn,email:lrn,world:srn,elements:crn,view:urn,evolutionMethod:drn,solarPanelArrayLayoutParams:frn,solarPanelArrayLayoutConstraints:hrn,evolutionaryAlgorithmState:prn,economicsParams:grn,notes:mrn},Arn="3DwyXjJjUExjZ1f5APPdnu",wrn="11/13/2022 04:59 pm",vrn=1668376781695,xrn="QWecNcxhyvP6j6sBN11hBsfZDau1",brn=null,Srn=null,Trn={date:"6/22/2022 1:00:00 PM",timesPerHour:6,address:"Natick, MA",latitude:42.2844063,longitude:-71.3488548,name:"default",orthographic:!1,cameraZoom:35,ground:{snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0],thermalDiffusivity:.05,albedo:.3},noAnimationForSensorDataCollection:!0,noAnimationForHeatmapSimulation:!0},Prn=[{selected:!1,cz:-.00999999999999913,cx:-.2955982837076121,type:"Human",id:"3NsNQgPftGsbYSoSRa2zV4",normal:[0,1,0],cy:3.9255960830681698,name:"Jack",rotation:[0,0,0],parentId:"Ground",lx:.42,ly:.42,lz:1.8},{selected:!1,cy:4.081504375344256,name:"Jacqueline",rotation:[0,0,0],normal:[0,1,0],id:"xaNFgEDtpNwZNyUWnndg4x",cz:-.009999999999999095,type:"Human",cx:2.399220108700476,parentId:"Ground",lx:.43,ly:.6,lz:1.78},{cx:.20566332108722207,color:"gray",cz:2,type:"Cuboid",lz:4,normal:[0,0,1],faceColors:["gray","gray","gray","gray","gray","gray"],textureTypes:["No Facade Texture","No Facade Texture","No Facade Texture","No Facade Texture","No Facade Texture","No Facade Texture"],ly:3.646712311386908,cy:.10935014088128625,rotation:[0,0,0],lx:2.2290047878920136,id:"2QtCNEmEF6Mcs3vbbR96ZT",selected:!1,parentId:"Ground"},{ly:.1,selected:!1,type:"Sensor",showLabel:!0,normal:[0,0,1],lz:.01,rotation:[0,0,0],lx:.1,cz:.5,cx:.03109721392634064,cy:.16878784903489202,id:"iqgmPt2Nm3r4bW8A7g6DJy",label:"Top",parentId:"2QtCNEmEF6Mcs3vbbR96ZT",foundationId:"2QtCNEmEF6Mcs3vbbR96ZT"},{label:"North",rotation:[0,0,0],ly:.1,normal:[0,1,0],cy:.4999999988722325,type:"Sensor",showLabel:!0,selected:!1,id:"soQWet6PH9YYEVPLyKPtZ1",cz:-.036155842645941405,lx:.1,lz:.01,cx:-.0014535790327764226,parentId:"2QtCNEmEF6Mcs3vbbR96ZT",foundationId:"2QtCNEmEF6Mcs3vbbR96ZT"},{normal:[1,0,0],cz:.012842850721372034,cy:-.02894757303561696,ly:.1,lz:.01,label:"East",id:"g3pxtSA3CsXPiogBgtEeYs",lx:.1,showLabel:!0,rotation:[0,0,0],type:"Sensor",cx:.5000000161579515,selected:!1,parentId:"2QtCNEmEF6Mcs3vbbR96ZT",foundationId:"2QtCNEmEF6Mcs3vbbR96ZT"},{lz:.01,showLabel:!0,rotation:[0,0,0],cy:-.4999999988722335,selected:!1,id:"1GCXGRbm6nuTH23uA8Yngz",cx:.028086152131634783,normal:[0,-1,0],cz:-.16060425332465766,ly:.1,type:"Sensor",label:"South",lx:.1,parentId:"2QtCNEmEF6Mcs3vbbR96ZT",foundationId:"2QtCNEmEF6Mcs3vbbR96ZT"},{selected:!1,ly:.1,normal:[-1,0,0],rotation:[0,0,0],id:"9Aqk7YM1qj7eBSDfhRzr51",cy:-.0010171489984738787,label:"West",cz:.04694614030299604,cx:-.5000000161579532,type:"Sensor",showLabel:!0,lz:.01,lx:.1,parentId:"2QtCNEmEF6Mcs3vbbR96ZT",foundationId:"2QtCNEmEF6Mcs3vbbR96ZT"}],Crn={showDailyLightSensorPanel:!0,showYearlyLightSensorPanel:!1,autoRotate:!1,showGroundPanel:!1,yearlyLightSensorPanelY:70,stickyNotePanelX:6,mapType:"roadmap",weatherPanelY:0,shadowEnabled:!0,theme:"Default",stickyNotePanelY:0,mapWeatherStations:!1,groundColor:"#16cda5",heliodon:!0,dailyLightSensorPanelX:-19,axes:!0,showWeatherPanel:!1,dailyLightSensorPanelY:15,mapTilt:0,heliodonPanelX:-1235,groundPanelY:0,heliodonPanelY:7,groundImage:!1,mapZoom:16,showStickyNotePanel:!0,groundPanelX:0,weatherPanelX:0,yearlyLightSensorPanelX:-905,showHeliodonPanel:!1,cameraPosition:[11.69562560736218,15.284097405092108,4.526997191755329],panCenter:[-2.432389491951708,.8034413072625061,1.0138875329134873],orthographic:!1,enableRotate:!0,cameraZoom:28.63945562104857,cameraPosition2D:[0,-4000177797536253e-20,39.99999999997991],panCenter2D:[0,0,0],stickyNotePanelRect:{x:0,y:0,width:400,height:300},dailyLightSensorPanelRect:{x:0,y:0,width:600,height:360}},Rrn=1,Hrn={pvModelName:"CS6X-355P-FG",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},Mrn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},Irn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},zrn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},Drn=[`Solar radiation to a box +`,Snn=be.memo(({close:t})=>{const e=H(s0);return h.jsxs(bnn,{children:[h.jsx(xnn,{top:10,color:"antiquewhite"}),h.jsx("div",{style:{position:"absolute",fontSize:"small",color:"antiquewhite",cursor:"pointer",bottom:"10px"},onMouseDown:()=>{t()},children:Y.t("word.Close",{lng:e})})]})});var Tnn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 244c176.18 0 319 142.82 319 319v233a32 32 0 01-32 32H225a32 32 0 01-32-32V563c0-176.18 142.82-319 319-319zM484 68h56a8 8 0 018 8v96a8 8 0 01-8 8h-56a8 8 0 01-8-8V76a8 8 0 018-8zM177.25 191.66a8 8 0 0111.32 0l67.88 67.88a8 8 0 010 11.31l-39.6 39.6a8 8 0 01-11.31 0l-67.88-67.88a8 8 0 010-11.31l39.6-39.6zm669.6 0l39.6 39.6a8 8 0 010 11.3l-67.88 67.9a8 8 0 01-11.32 0l-39.6-39.6a8 8 0 010-11.32l67.89-67.88a8 8 0 0111.31 0zM192 892h640a32 32 0 0132 32v24a8 8 0 01-8 8H168a8 8 0 01-8-8v-24a32 32 0 0132-32zm148-317v253h64V575h-64z"}}]},name:"alert",theme:"filled"},Pnn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Tnn}))},Cnn=m.forwardRef(Pnn),Rnn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M766.4 744.3c43.7 0 79.4-36.2 79.4-80.5 0-53.5-79.4-140.8-79.4-140.8S687 610.3 687 663.8c0 44.3 35.7 80.5 79.4 80.5zm-377.1-44.1c7.1 7.1 18.6 7.1 25.6 0l256.1-256c7.1-7.1 7.1-18.6 0-25.6l-256-256c-.6-.6-1.3-1.2-2-1.7l-78.2-78.2a9.11 9.11 0 00-12.8 0l-48 48a9.11 9.11 0 000 12.8l67.2 67.2-207.8 207.9c-7.1 7.1-7.1 18.6 0 25.6l255.9 256zm12.9-448.6l178.9 178.9H223.4l178.8-178.9zM904 816H120c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8z"}}]},name:"bg-colors",theme:"outlined"},Hnn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Rnn}))},Mnn=m.forwardRef(Hnn),Inn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 248H728l-32.4-90.8a32.07 32.07 0 00-30.2-21.2H358.6c-13.5 0-25.6 8.5-30.1 21.2L296 248H160c-44.2 0-80 35.8-80 80v456c0 44.2 35.8 80 80 80h704c44.2 0 80-35.8 80-80V328c0-44.2-35.8-80-80-80zm8 536c0 4.4-3.6 8-8 8H160c-4.4 0-8-3.6-8-8V328c0-4.4 3.6-8 8-8h186.7l17.1-47.8 22.9-64.2h250.5l22.9 64.2 17.1 47.8H864c4.4 0 8 3.6 8 8v456zM512 384c-88.4 0-160 71.6-160 160s71.6 160 160 160 160-71.6 160-160-71.6-160-160-160zm0 256c-53 0-96-43-96-96s43-96 96-96 96 43 96 96-43 96-96 96z"}}]},name:"camera",theme:"outlined"},znn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Inn}))},Vu=m.forwardRef(znn),Dnn={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"},Enn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Dnn}))},Sh=m.forwardRef(Enn),Fnn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v584zM688 420h-55.2c-5.1 0-10 2.5-13 6.6L468.9 634.4l-64.7-89c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.4 0-12.8-6.5-12.8z"}}]},name:"carry-out",theme:"outlined"},knn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Fnn}))},Lnn=m.forwardRef(knn),Wnn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},Nnn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Wnn}))},Unn=m.forwardRef(Nnn),jnn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M518.3 459a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V856c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V613.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 459z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-upload",theme:"outlined"},Bnn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:jnn}))},Ynn=m.forwardRef(Bnn),Onn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M690 405h-46.9c-10.2 0-19.9 4.9-25.9 13.2L512 563.6 406.8 418.2c-6-8.3-15.6-13.2-25.9-13.2H334c-6.5 0-10.3 7.4-6.5 12.7l178 246c3.2 4.4 9.7 4.4 12.9 0l178-246c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"down-circle",theme:"outlined"},_nn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Onn}))},Vnn=m.forwardRef(_nn),Gnn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32zm-622.3-84c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9z"}}]},name:"edit",theme:"filled"},Xnn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Gnn}))},Jnn=m.forwardRef(Xnn),Knn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},qnn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Knn}))},ny=m.forwardRef(qnn),$nn={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},Qnn=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:$nn}))},Znn=m.forwardRef(Qnn),eon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M603.3 327.5l-246 178a7.95 7.95 0 000 12.9l246 178c5.3 3.8 12.7 0 12.7-6.5V643c0-10.2-4.9-19.9-13.2-25.9L457.4 512l145.4-105.2c8.3-6 13.2-15.6 13.2-25.9V334c0-6.5-7.4-10.3-12.7-6.5z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"left-circle",theme:"outlined"},ton=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:eon}))},non=m.forwardRef(ton),oon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},ron=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:oon}))},ion=m.forwardRef(ron),aon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"},lon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:aon}))},son=m.forwardRef(lon),con={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3-15.4 12.3-16.6 35.4-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8z"}}]},name:"pushpin",theme:"filled"},uon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:con}))},don=m.forwardRef(uon),fon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"}}]},name:"pushpin",theme:"outlined"},hon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:fon}))},$Te=m.forwardRef(hon),pon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M666.7 505.5l-246-178A8 8 0 00408 334v46.9c0 10.2 4.9 19.9 13.2 25.9L566.6 512 421.2 617.2c-8.3 6-13.2 15.6-13.2 25.9V690c0 6.5 7.4 10.3 12.7 6.5l246-178c4.4-3.2 4.4-9.8 0-13z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"right-circle",theme:"outlined"},gon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:pon}))},zQe=m.forwardRef(gon),mon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},yon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:mon}))},Mf=m.forwardRef(yon),Aon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},won=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Aon}))},von=m.forwardRef(won),xon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M839.6 433.8L749 150.5a9.24 9.24 0 00-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 00-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 00-9.2-9.3zM416 702h-76V172c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v530h-76c-6.7 0-10.5 7.8-6.3 13l112 141.9a8 8 0 0012.6 0l112-141.9c4.1-5.2.4-13-6.3-13z"}}]},name:"sort-ascending",theme:"outlined"},bon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:xon}))},Son=m.forwardRef(bon),Ton={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M839.6 433.8L749 150.5a9.24 9.24 0 00-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 00-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 00-9.2-9.3zM310.3 167.1a8 8 0 00-12.6 0L185.7 309c-4.2 5.3-.4 13 6.3 13h76v530c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V322h76c6.7 0 10.5-7.8 6.3-13l-112-141.9z"}}]},name:"sort-descending",theme:"outlined"},Pon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Ton}))},Con=m.forwardRef(Pon),Ron={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"unordered-list",theme:"outlined"},Hon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Ron}))},fu=m.forwardRef(Hon),Mon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M518.5 360.3a7.95 7.95 0 00-12.9 0l-178 246c-3.8 5.3 0 12.7 6.5 12.7H381c10.2 0 19.9-4.9 25.9-13.2L512 460.4l105.2 145.4c6 8.3 15.6 13.2 25.9 13.2H690c6.5 0 10.3-7.4 6.5-12.7l-178-246z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"up-circle",theme:"outlined"},Ion=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Mon}))},zon=m.forwardRef(Ion),Don={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"},Eon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Don}))},Fon=m.forwardRef(Eon),kon={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M859.9 780H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM505.7 669a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V176c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8z"}}]},name:"vertical-align-bottom",theme:"outlined"},Lon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:kon}))},Won=m.forwardRef(Lon),Non={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},Uon=function(e,n){return m.createElement(kr,Fr({},e,{ref:n,icon:Non}))},pX=m.forwardRef(Uon);const jon="pSdH5rJWovu8hchgLSnsqT",Bon="02/02/2023 12:24 pm",Yon=1675358675337,Oon="QWecNcxhyvP6j6sBN11hBsfZDau1",_on=null,Von=null,Gon={latitude:42.2844063,timesPerHour:20,date:"1/22/2022 10:15:00 AM",longitude:-71.3488548,name:"default",address:"Natick, MA",ground:{snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0],albedo:.3,thermalDiffusivity:.05},orthographic:!1,cameraZoom:28.63945562104857},Xon=[{cy:1.9385448115528998,name:"June",type:"Human",cz:11465644746167777e-31,normal:[0,1,0],cx:-2.72710574788732,selected:!1,id:"8si9AKQwGf4sYiD91xfFr6",rotation:[0,0,0],parentId:"Ground"}],Jon={mapWeatherStations:!1,showGroundPanel:!1,showSiteInfoPanel:!0,mapTilt:0,groundPanelY:0,yearlyLightSensorPanelY:0,axes:!0,showHeliodonPanel:!0,showWeatherPanel:!1,dailyLightSensorPanelY:0,mapType:"roadmap",groundImage:!1,autoRotate:!1,dailyLightSensorPanelX:0,showYearlyLightSensorPanel:!1,weatherPanelY:0,heliodonPanelX:-6,showStickyNotePanel:!0,groundColor:"#16cda5",weatherPanelX:0,heliodonPanelY:9,groundPanelX:0,shadowEnabled:!0,theme:"Default",heliodon:!0,stickyNotePanelY:0,yearlyLightSensorPanelX:0,showDailyLightSensorPanel:!1,mapZoom:16,stickyNotePanelX:0,cameraPosition:[-2.2645315712935465,-19.016408185270922,3.0537676736998205],panCenter:[1.9284721678646957,1.0746189678250615,2.420128405670479],orthographic:!1,enableRotate:!0,cameraZoom:24.55475326309651,showInstructionPanel:!1,cameraPosition2D:[0,-4000177797536253e-20,39.9999999999799],panCenter2D:[0,0,0],showSunAngles:!0,stickyNotePanelRect:{x:-5,y:-2,width:309,height:64}},Kon=1,qon={pvModelName:"CS6X-355P-FG",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},$on={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},Qon={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},Zon={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},ern=["Sun angles relative to the ground"],trn={docid:jon,time:Bon,timestamp:Yon,userid:Oon,owner:_on,email:Von,world:Gon,elements:Xon,view:Jon,evolutionMethod:Kon,solarPanelArrayLayoutParams:qon,solarPanelArrayLayoutConstraints:$on,evolutionaryAlgorithmState:Qon,economicsParams:Zon,notes:ern},nrn="aLZxDeCyLDDueFWdBcXne3",orn="02/02/2023 12:27 pm",rrn=1675358863088,irn="QWecNcxhyvP6j6sBN11hBsfZDau1",arn=null,lrn=null,srn={latitude:0,timesPerHour:6,date:"9/22/2022, 3:00:00 PM",longitude:-71.3488548,name:"default",address:"",ground:{snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0],albedo:.3,thermalDiffusivity:.05},orthographic:!1,cameraZoom:28.63945562104857,noAnimationForSensorDataCollection:!0},crn=[{cy:-3.793749931074972,name:"Jeanette",type:"Human",cz:0,normal:[0,1,0],cx:-1.8371287635005462,selected:!1,id:"8si9AKQwGf4sYiD91xfFr6",rotation:[0,0,0],parentId:"Ground",lx:.4,ly:.6,lz:1.62},{type:"Foundation",cx:-.02034256309656146,cy:-.0945631153454527,cz:.05,lx:4.039349774896637,ly:4.009416382499952,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",selected:!1,id:"vtjS16tFJ2nQYaRPqaTXtD",textureType:"Foundation Texture #2"},{type:"Sensor",cx:.24583065540477922,cy:-.24570551313996075,cz:.5000000074505806,lx:.1,ly:.1,lz:.01,showLabel:!0,normal:[0,0,1],rotation:[0,0,0],parentId:"vtjS16tFJ2nQYaRPqaTXtD",foundationId:"vtjS16tFJ2nQYaRPqaTXtD",id:"1RgbN67ETfax1aEC4UN1sd",selected:!1}],urn={mapWeatherStations:!1,showGroundPanel:!1,showSiteInfoPanel:!0,mapTilt:0,groundPanelY:0,yearlyLightSensorPanelY:5,axes:!0,showHeliodonPanel:!0,showWeatherPanel:!1,dailyLightSensorPanelY:203,mapType:"roadmap",groundImage:!1,autoRotate:!1,dailyLightSensorPanelX:-31,showYearlyLightSensorPanel:!0,weatherPanelY:0,heliodonPanelX:-5,showStickyNotePanel:!0,groundColor:"#16cda5",weatherPanelX:0,heliodonPanelY:4,groundPanelX:0,shadowEnabled:!0,theme:"Default",heliodon:!0,stickyNotePanelY:0,yearlyLightSensorPanelX:-1,showDailyLightSensorPanel:!1,mapZoom:16,stickyNotePanelX:0,cameraPosition:[14.252594110627898,-20.834202556609767,6.804345920821559],panCenter:[0,0,0],orthographic:!1,enableRotate:!0,cameraZoom:58.72652247402654,showInstructionPanel:!1,cameraPosition2D:[0,-4000177797536253e-20,39.9999999999795],panCenter2D:[0,0,0],showSunAngles:!0,stickyNotePanelRect:{x:1204,y:154,width:595,height:199},yearlyLightSensorPanelRect:{x:-1284,y:2,width:600,height:500},yearlyLightSensorPanelShowDaylight:!1},drn=1,frn={pvModelName:"CS6X-355P-FG",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},hrn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},prn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},grn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},mrn=["The solar radiation at different locations of the Earth in different seasons is largely responsible for local climate. Overall, every place on the Earth has about the same hours of daylight in total (ideally 12×365=4,380 hours), regardless of where it is. However, the distribution throughout the year is vastly different, resulting in large temperature variations across the globe. You can change the latitude to investigate these relationships. Make sure to refresh the graph after changing any variables."],yrn={docid:nrn,time:orn,timestamp:rrn,userid:irn,owner:arn,email:lrn,world:srn,elements:crn,view:urn,evolutionMethod:drn,solarPanelArrayLayoutParams:frn,solarPanelArrayLayoutConstraints:hrn,evolutionaryAlgorithmState:prn,economicsParams:grn,notes:mrn},Arn="3DwyXjJjUExjZ1f5APPdnu",wrn="11/13/2022 04:59 pm",vrn=1668376781695,xrn="QWecNcxhyvP6j6sBN11hBsfZDau1",brn=null,Srn=null,Trn={date:"6/22/2022 1:00:00 PM",timesPerHour:6,address:"Natick, MA",latitude:42.2844063,longitude:-71.3488548,name:"default",orthographic:!1,cameraZoom:35,ground:{snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0],thermalDiffusivity:.05,albedo:.3},noAnimationForSensorDataCollection:!0,noAnimationForHeatmapSimulation:!0},Prn=[{selected:!1,cz:-.00999999999999913,cx:-.2955982837076121,type:"Human",id:"3NsNQgPftGsbYSoSRa2zV4",normal:[0,1,0],cy:3.9255960830681698,name:"Jack",rotation:[0,0,0],parentId:"Ground",lx:.42,ly:.42,lz:1.8},{selected:!1,cy:4.081504375344256,name:"Jacqueline",rotation:[0,0,0],normal:[0,1,0],id:"xaNFgEDtpNwZNyUWnndg4x",cz:-.009999999999999095,type:"Human",cx:2.399220108700476,parentId:"Ground",lx:.43,ly:.6,lz:1.78},{cx:.20566332108722207,color:"gray",cz:2,type:"Cuboid",lz:4,normal:[0,0,1],faceColors:["gray","gray","gray","gray","gray","gray"],textureTypes:["No Facade Texture","No Facade Texture","No Facade Texture","No Facade Texture","No Facade Texture","No Facade Texture"],ly:3.646712311386908,cy:.10935014088128625,rotation:[0,0,0],lx:2.2290047878920136,id:"2QtCNEmEF6Mcs3vbbR96ZT",selected:!1,parentId:"Ground"},{ly:.1,selected:!1,type:"Sensor",showLabel:!0,normal:[0,0,1],lz:.01,rotation:[0,0,0],lx:.1,cz:.5,cx:.03109721392634064,cy:.16878784903489202,id:"iqgmPt2Nm3r4bW8A7g6DJy",label:"Top",parentId:"2QtCNEmEF6Mcs3vbbR96ZT",foundationId:"2QtCNEmEF6Mcs3vbbR96ZT"},{label:"North",rotation:[0,0,0],ly:.1,normal:[0,1,0],cy:.4999999988722325,type:"Sensor",showLabel:!0,selected:!1,id:"soQWet6PH9YYEVPLyKPtZ1",cz:-.036155842645941405,lx:.1,lz:.01,cx:-.0014535790327764226,parentId:"2QtCNEmEF6Mcs3vbbR96ZT",foundationId:"2QtCNEmEF6Mcs3vbbR96ZT"},{normal:[1,0,0],cz:.012842850721372034,cy:-.02894757303561696,ly:.1,lz:.01,label:"East",id:"g3pxtSA3CsXPiogBgtEeYs",lx:.1,showLabel:!0,rotation:[0,0,0],type:"Sensor",cx:.5000000161579515,selected:!1,parentId:"2QtCNEmEF6Mcs3vbbR96ZT",foundationId:"2QtCNEmEF6Mcs3vbbR96ZT"},{lz:.01,showLabel:!0,rotation:[0,0,0],cy:-.4999999988722335,selected:!1,id:"1GCXGRbm6nuTH23uA8Yngz",cx:.028086152131634783,normal:[0,-1,0],cz:-.16060425332465766,ly:.1,type:"Sensor",label:"South",lx:.1,parentId:"2QtCNEmEF6Mcs3vbbR96ZT",foundationId:"2QtCNEmEF6Mcs3vbbR96ZT"},{selected:!1,ly:.1,normal:[-1,0,0],rotation:[0,0,0],id:"9Aqk7YM1qj7eBSDfhRzr51",cy:-.0010171489984738787,label:"West",cz:.04694614030299604,cx:-.5000000161579532,type:"Sensor",showLabel:!0,lz:.01,lx:.1,parentId:"2QtCNEmEF6Mcs3vbbR96ZT",foundationId:"2QtCNEmEF6Mcs3vbbR96ZT"}],Crn={showDailyLightSensorPanel:!0,showYearlyLightSensorPanel:!1,autoRotate:!1,showGroundPanel:!1,yearlyLightSensorPanelY:70,stickyNotePanelX:6,mapType:"roadmap",weatherPanelY:0,shadowEnabled:!0,theme:"Default",stickyNotePanelY:0,mapWeatherStations:!1,groundColor:"#16cda5",heliodon:!0,dailyLightSensorPanelX:-19,axes:!0,showWeatherPanel:!1,dailyLightSensorPanelY:15,mapTilt:0,heliodonPanelX:-1235,groundPanelY:0,heliodonPanelY:7,groundImage:!1,mapZoom:16,showStickyNotePanel:!0,groundPanelX:0,weatherPanelX:0,yearlyLightSensorPanelX:-905,showHeliodonPanel:!1,cameraPosition:[11.69562560736218,15.284097405092108,4.526997191755329],panCenter:[-2.432389491951708,.8034413072625061,1.0138875329134873],orthographic:!1,enableRotate:!0,cameraZoom:28.63945562104857,cameraPosition2D:[0,-4000177797536253e-20,39.99999999997991],panCenter2D:[0,0,0],stickyNotePanelRect:{x:0,y:0,width:400,height:300},dailyLightSensorPanelRect:{x:0,y:0,width:600,height:360}},Rrn=1,Hrn={pvModelName:"CS6X-355P-FG",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},Mrn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},Irn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},zrn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},Drn=[`Solar radiation to a box This model shows the solar radiation the five sides (top, west, east, south, and north sides) of a box receives. There is a sensor on each side. Analyze the daily and annual sensor data to compare the solar radiation the five sides receive. @@ -4893,10 +4893,10 @@ in an arbitrary shape with a nearby structure`],iDn={docid:Ozn,time:_zn,timestam 房屋朝向的影響`],lEn={docid:jDn,time:BDn,timestamp:YDn,userid:ODn,owner:_Dn,email:VDn,world:GDn,elements:XDn,sceneRadius:JDn,view:KDn,graphState:qDn,evolutionMethod:$Dn,solarPanelArrayLayoutParams:QDn,solarPanelArrayLayoutConstraints:ZDn,evolutionaryAlgorithmState:eEn,economicsParams:tEn,modelType:nEn,modelAuthor:oEn,modelLabel:rEn,modelDescription:iEn,notes:aEn},sEn="gRqNfJd8beo5ietdqmmTM2",cEn="05/22/2023 10:35 am",uEn=1684766140952,dEn="QWecNcxhyvP6j6sBN11hBsfZDau1",fEn=null,hEn=null,pEn={solarRadiationHeatmapGridCellSize:.5,date:"6/10/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:4,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},gEn=[{type:"Human",name:"Jack",cx:-6.628211467880927,cy:-10.2119938102408,cz:4440892098500626e-31,lx:.42,lz:1.8,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.42},{type:"Foundation",cx:11.171058971915114,cy:.06430302499558693,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"👎",showLabel:!0,labelHeight:8.5,labelSize:.8,color:"#808080"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{id:"45EQZzpZDmcCPwStDm4gUQ",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:3.4648066919643785,color:"#333333",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["py4fscALBHuoNNVWKoXS9c"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:1.7611028730632272,ceiling:!1},{type:"Window",cx:-.2916666666666667,cy:.3,cz:0,lx:.16666666666666666,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"#009ce0",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"#cccccc",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"#cccccc",tint:"#73D8FF",opacity:.5,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"1KMGfKAaAbRXUc5v152G7H"},{type:"Window",cx:.2916666666666667,cy:.3,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"#cccccc",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"8WmW65wXvFqVAFHZJFWsjr",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"#009ce0",width:.5},selected:!1},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:3.5222057461264544,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi1N2ddsqnGWnubKQgsZki"],rightJoints:["2mKkmtjixue6mVK8C5qdJT"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"adSAr7Jscp2bREMCNnKie9",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:3.5222057461264544,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["14k9EDHAzKUWAkBFT1miXA"],rightJoints:["adSAr7Jscp2bREMCNnKie9"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi1N2ddsqnGWnubKQgsZki",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:3.5222057461264544,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["adSAr7Jscp2bREMCNnKie9"],rightJoints:["14k9EDHAzKUWAkBFT1miXA"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"2mKkmtjixue6mVK8C5qdJT",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:3.5222057461264544,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["2mKkmtjixue6mVK8C5qdJT"],rightJoints:["xi1N2ddsqnGWnubKQgsZki"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"14k9EDHAzKUWAkBFT1miXA",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Window",cx:-.2916666666666667,cy:.1,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"#cccccc",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"szq2y8vnCqxebu1Sp5dC5N",parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"#009ce0",width:.5},selected:!1},{type:"Window",cx:.2916666666666667,cy:.1,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"#cccccc",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"bm2Jq3Yh33GneBgsKAvMp7",parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"#009ce0",width:.5},selected:!1},{id:"w7eDFcjLuyPhMChKfhs6jB",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:3.4648066919643785,color:"#333333",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["14k9EDHAzKUWAkBFT1miXA"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:3.5222057461264544,ceiling:!1},{type:"Foundation",cx:-11.120691028084872,cy:-.06445313166738242,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},labelHeight:8.5,labelSize:.8,id:"4TcV7zx5NzstoQTaTqoAzt",selected:!1,label:"👍",showLabel:!0,color:"#808080"},{type:"Door",cx:-.020833333333333332,cy:0,cz:-.125,lx:.125,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",id:"vNVpqbsNF7tYjDx7E7kMLR"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"xpWZ6k69MtomLyhCbBynNa"}],mEn=24,yEn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[-.042868749999999976,0,0],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[-.042868749999999976,-.0001500066673827405,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-18.39191326488849,-28.88082266775545,4.500680104409036],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[9.06975830834568,5.812472797471483,4.500680104409029],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:5.5,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-5,y:7,width:600,height:360},showDiurnalTemperaturePanel:!1,diurnalTemperaturePanelRect:{x:0,y:0,width:600,height:400},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:0,y:0,width:600,height:400},stickyNotePanelRect:{x:-2,y:-1,width:243,height:90}},AEn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},wEn=1,vEn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},xEn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},bEn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},SEn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},TEn="Unknown",PEn=null,CEn=null,REn=null,HEn=[`Effect of insulation 房屋隔熱性的影響`],MEn={docid:sEn,time:cEn,timestamp:uEn,userid:dEn,owner:fEn,email:hEn,world:pEn,elements:gEn,sceneRadius:mEn,view:yEn,graphState:AEn,evolutionMethod:wEn,solarPanelArrayLayoutParams:vEn,solarPanelArrayLayoutConstraints:xEn,evolutionaryAlgorithmState:bEn,economicsParams:SEn,modelType:TEn,modelAuthor:PEn,modelLabel:CEn,modelDescription:REn,notes:HEn},IEn="2b6To2exbyQMzsnyC5zQ4h",zEn="05/22/2023 10:37 am",DEn=1684766230048,EEn="QWecNcxhyvP6j6sBN11hBsfZDau1",FEn=null,kEn=null,LEn={solarRadiationHeatmapGridCellSize:.5,date:"6/10/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:4,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},WEn=[{type:"Human",name:"Jack",cx:-6.628211467880927,cy:-10.2119938102408,cz:4440892098500626e-31,lx:.42,lz:1.8,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.42},{type:"Foundation",cx:9.345387499999994,cy:.10743784147400248,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"B",showLabel:!0,labelHeight:6.5,labelSize:.8,color:"#808080"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{id:"45EQZzpZDmcCPwStDm4gUQ",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:1.9987267232669597,color:"#333333",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["py4fscALBHuoNNVWKoXS9c"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:1.7611028730632272,ceiling:!1},{type:"Foundation",cx:-9.302518749999996,cy:.06403695851719249,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},id:"fbqvzYqiEy79jeL8wsadib",selected:!1,hvacSystem:{thermostatSetpoint:20},label:"A",labelHeight:6.5,showLabel:!0,labelSize:.8,color:"#808080"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,leftJoints:["pPpJHGJ2bGVqLdA1FpXi4V"],rightJoints:["2RETAxyRMzZBEQkBGms56R"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"giYTP9Qg6uJ3yfkS1RoDqG",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,leftJoints:["beHqET5NN8aNdsuBncMpY7"],rightJoints:["giYTP9Qg6uJ3yfkS1RoDqG"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"pPpJHGJ2bGVqLdA1FpXi4V",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,leftJoints:["giYTP9Qg6uJ3yfkS1RoDqG"],rightJoints:["beHqET5NN8aNdsuBncMpY7"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"2RETAxyRMzZBEQkBGms56R",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,leftJoints:["2RETAxyRMzZBEQkBGms56R"],rightJoints:["pPpJHGJ2bGVqLdA1FpXi4V"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"beHqET5NN8aNdsuBncMpY7",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:1.9987267232669597,thickness:.2,roofType:"Gable",roofStructure:"Default",wallsId:["beHqET5NN8aNdsuBncMpY7"],textureType:"No Roof Texture",color:"#cccccc",sideColor:"#ffffff",selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",id:"wqKadTHiLAV8a3mAejBhVp",ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],rValue:1.7611028730632272,ceiling:!1},{type:"Window",cx:-.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.55,uValue:2,normal:[0,0,1],rotation:[0,0,0],parentId:"beHqET5NN8aNdsuBncMpY7",foundationId:"fbqvzYqiEy79jeL8wsadib",id:"2bkzpWVFhyLy2B93eQe6LC"},{type:"Window",cx:.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"2qrmNqnNqMrnaf9yVKwntp",parentId:"beHqET5NN8aNdsuBncMpY7",foundationId:"fbqvzYqiEy79jeL8wsadib",tint:"#73D8FF",opacity:.55,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Window",cx:-.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.55,uValue:2,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"hQgFUEAKKCuxnfg7DfAtUD"},{type:"Window",cx:.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"3F32WEzwgnaEKesshW1B9d",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.55,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"beHqET5NN8aNdsuBncMpY7",foundationId:"fbqvzYqiEy79jeL8wsadib",id:"fPNsZAwsuY65jcgPGD7JxY"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"pMhyfs2o4fEnaE7UjB8PVu"}],NEn=22,UEn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[0,0,0],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[0,-.0001500066673827405,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-12.301199186500163,-22.5861615760567,3.4543056235043506],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[6.0653741729769015,2.261846946588245,3.4543056235043506],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:5.5,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-5,y:7,width:600,height:360},showDiurnalTemperaturePanel:!1,diurnalTemperaturePanelRect:{x:0,y:0,width:600,height:400},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:0,y:0,width:600,height:400},stickyNotePanelRect:{x:-3,y:-4,width:278,height:87}},jEn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},BEn=1,YEn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},OEn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},_En={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},VEn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},GEn="Unknown",XEn=null,JEn=null,KEn=null,qEn=[`Effect of roof color 屋頂顔色的影響`],$En={docid:IEn,time:zEn,timestamp:DEn,userid:EEn,owner:FEn,email:kEn,world:LEn,elements:WEn,sceneRadius:NEn,view:UEn,graphState:jEn,evolutionMethod:BEn,solarPanelArrayLayoutParams:YEn,solarPanelArrayLayoutConstraints:OEn,evolutionaryAlgorithmState:_En,economicsParams:VEn,modelType:GEn,modelAuthor:XEn,modelLabel:JEn,modelDescription:KEn,notes:qEn},QEn="gyoLQ5RfiYexA7q1ehdofm",ZEn="05/22/2023 10:45 am",eFn=1684766701791,tFn="QWecNcxhyvP6j6sBN11hBsfZDau1",nFn=null,oFn=null,rFn={solarRadiationHeatmapGridCellSize:.5,date:"6/10/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:4,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},iFn=[{type:"Human",name:"Jacqueline",cx:-6.628211467880927,cy:-10.2119938102408,cz:4440892098500626e-31,lx:.43,lz:1.78,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.42},{type:"Foundation",cx:9.345387499999994,cy:.10743784147400248,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"B",showLabel:!0,labelHeight:7,labelSize:.8,color:"#808080"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.1,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],selected:!1,eavesLength:.1,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],selected:!1,eavesLength:.1,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.1,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{id:"45EQZzpZDmcCPwStDm4gUQ",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:1.9987267232669597,color:"#808080",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["py4fscALBHuoNNVWKoXS9c"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:1.7611028730632272,ceiling:!1},{type:"Foundation",cx:-9.302518749999996,cy:.06403695851719249,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},id:"fbqvzYqiEy79jeL8wsadib",selected:!1,hvacSystem:{thermostatSetpoint:20},label:"A",labelHeight:7,showLabel:!0,labelSize:.8,color:"#808080"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,leftJoints:["pPpJHGJ2bGVqLdA1FpXi4V"],rightJoints:["2RETAxyRMzZBEQkBGms56R"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"giYTP9Qg6uJ3yfkS1RoDqG",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,eavesLength:.1,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,leftJoints:["beHqET5NN8aNdsuBncMpY7"],rightJoints:["giYTP9Qg6uJ3yfkS1RoDqG"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"pPpJHGJ2bGVqLdA1FpXi4V",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],eavesLength:.1,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,leftJoints:["giYTP9Qg6uJ3yfkS1RoDqG"],rightJoints:["beHqET5NN8aNdsuBncMpY7"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"2RETAxyRMzZBEQkBGms56R",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],eavesLength:.1,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,leftJoints:["2RETAxyRMzZBEQkBGms56R"],rightJoints:["pPpJHGJ2bGVqLdA1FpXi4V"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"beHqET5NN8aNdsuBncMpY7",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,eavesLength:.8,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:1.9987267232669597,thickness:.2,roofType:"Gable",roofStructure:"Default",wallsId:["beHqET5NN8aNdsuBncMpY7"],textureType:"No Roof Texture",color:"#808080",sideColor:"#ffffff",selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",id:"wqKadTHiLAV8a3mAejBhVp",ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],rValue:1.7611028730632272,ceiling:!1},{type:"Window",cx:-.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.55,uValue:2,normal:[0,0,1],rotation:[0,0,0],parentId:"beHqET5NN8aNdsuBncMpY7",foundationId:"fbqvzYqiEy79jeL8wsadib",id:"2bkzpWVFhyLy2B93eQe6LC"},{type:"Window",cx:.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"2qrmNqnNqMrnaf9yVKwntp",parentId:"beHqET5NN8aNdsuBncMpY7",foundationId:"fbqvzYqiEy79jeL8wsadib",tint:"#73D8FF",opacity:.55,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Window",cx:-.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.55,uValue:2,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"hQgFUEAKKCuxnfg7DfAtUD"},{type:"Window",cx:.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"3F32WEzwgnaEKesshW1B9d",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.55,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"beHqET5NN8aNdsuBncMpY7",foundationId:"fbqvzYqiEy79jeL8wsadib",id:"uPY2H1vbzdvDNNQKsQzM2R"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"qj1uppbZ68e6DUdrkgfzdA"}],aFn=22,lFn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[0,0,0],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[0,-.0001500066673827405,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-11.365944827281202,-27.884282052116806,4.909032289220344],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[8.512452835588759,2.1768673048896354,4.909032289220344],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:5.5,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-5,y:7,width:600,height:360},showDiurnalTemperaturePanel:!1,diurnalTemperaturePanelRect:{x:0,y:0,width:600,height:400},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:0,y:0,width:600,height:400},stickyNotePanelRect:{x:-1,y:0,width:284,height:88}},sFn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},cFn=1,uFn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},dFn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},fFn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},hFn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},pFn="Unknown",gFn=null,mFn=null,yFn=null,AFn=[`Effect of eaves overhang -屋簷延申長度的影響`],wFn={docid:QEn,time:ZEn,timestamp:eFn,userid:tFn,owner:nFn,email:oFn,world:rFn,elements:iFn,sceneRadius:aFn,view:lFn,graphState:sFn,evolutionMethod:cFn,solarPanelArrayLayoutParams:uFn,solarPanelArrayLayoutConstraints:dFn,evolutionaryAlgorithmState:fFn,economicsParams:hFn,modelType:pFn,modelAuthor:gFn,modelLabel:mFn,modelDescription:yFn,notes:AFn},vFn="iJM88uQ7kfN8BTPGSVD3jV",xFn="05/22/2023 10:47 am",bFn=1684766839823,SFn="QWecNcxhyvP6j6sBN11hBsfZDau1",TFn=null,PFn=null,CFn={solarRadiationHeatmapGridCellSize:.5,date:"6/10/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:4,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},RFn=[{type:"Human",name:"Jack",cx:-6.628211467880927,cy:-10.2119938102408,cz:4440892098500626e-31,lx:.42,lz:1.8,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.42},{type:"Foundation",cx:11.171058971915114,cy:.06430302499558693,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"A",showLabel:!0,labelHeight:8.5,labelSize:.8,color:"#666666"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{id:"45EQZzpZDmcCPwStDm4gUQ",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:3.4648066919643785,color:"#4d4d4d",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["py4fscALBHuoNNVWKoXS9c"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:2.8177645969011635,ceiling:!1},{type:"Window",cx:-.2916666666666667,cy:.3,cz:0,lx:.16666666666666666,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#009ce0",opacity:.65,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"1KMGfKAaAbRXUc5v152G7H"},{type:"Window",cx:.2916666666666667,cy:.3,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"8WmW65wXvFqVAFHZJFWsjr",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#009ce0",opacity:.65,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi1N2ddsqnGWnubKQgsZki"],rightJoints:["2mKkmtjixue6mVK8C5qdJT"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"adSAr7Jscp2bREMCNnKie9",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["14k9EDHAzKUWAkBFT1miXA"],rightJoints:["adSAr7Jscp2bREMCNnKie9"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi1N2ddsqnGWnubKQgsZki",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["adSAr7Jscp2bREMCNnKie9"],rightJoints:["14k9EDHAzKUWAkBFT1miXA"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"2mKkmtjixue6mVK8C5qdJT",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["2mKkmtjixue6mVK8C5qdJT"],rightJoints:["xi1N2ddsqnGWnubKQgsZki"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"14k9EDHAzKUWAkBFT1miXA",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Window",cx:-.2916666666666667,cy:.1,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"szq2y8vnCqxebu1Sp5dC5N",parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",tint:"#009ce0",opacity:.35,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Window",cx:.2916666666666667,cy:.1,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"bm2Jq3Yh33GneBgsKAvMp7",parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",tint:"#009ce0",opacity:.35,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{id:"w7eDFcjLuyPhMChKfhs6jB",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:3.4648066919643785,color:"#4d4d4d",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["14k9EDHAzKUWAkBFT1miXA"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:2.8177645969011635,ceiling:!1},{type:"Foundation",cx:-11.120691028084872,cy:-.06445313166738242,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},labelHeight:8.5,labelSize:.8,id:"4TcV7zx5NzstoQTaTqoAzt",selected:!1,label:"B",showLabel:!0,color:"#666666"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",id:"rRMpmcwQNzvRYmkTWpEhiw"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"jyiupxyxWNzhU4yRrTPHU1"}],HFn=24,MFn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[-.042868749999999976,0,0],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[-.042868749999999976,-.0001500066673827405,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-16.77287507225449,-24.274336266873924,5.320155603217975],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[10.498836843888402,4.793969537181787,2.890808814152251],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:5.5,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-5,y:7,width:600,height:360},showDiurnalTemperaturePanel:!1,diurnalTemperaturePanelRect:{x:0,y:0,width:600,height:400},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:0,y:0,width:600,height:400},stickyNotePanelRect:{x:-5,y:-1,width:421,height:65}},IFn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},zFn=1,DFn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},EFn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},FFn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},kFn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},LFn="Unknown",WFn=null,NFn=null,UFn=null,jFn=["Effect of solar heat gain coefficients (SHGC) of windows"],BFn={docid:vFn,time:xFn,timestamp:bFn,userid:SFn,owner:TFn,email:PFn,world:CFn,elements:RFn,sceneRadius:HFn,view:MFn,graphState:IFn,evolutionMethod:zFn,solarPanelArrayLayoutParams:DFn,solarPanelArrayLayoutConstraints:EFn,evolutionaryAlgorithmState:FFn,economicsParams:kFn,modelType:LFn,modelAuthor:WFn,modelLabel:NFn,modelDescription:UFn,notes:jFn},YFn="6nLDNj8vM4d4LSQKVT9SXo",OFn="05/22/2023 10:49 am",_Fn=1684766960725,VFn="QWecNcxhyvP6j6sBN11hBsfZDau1",GFn=null,XFn=null,JFn={solarRadiationHeatmapGridCellSize:.5,date:"6/10/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:4,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},KFn=[{type:"Human",name:"Jack",cx:-6.628211467880927,cy:-10.2119938102408,cz:4440892098500626e-31,lx:.42,lz:1.8,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.42},{type:"Foundation",cx:11.171058971915114,cy:.06430302499558693,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"20℃",showLabel:!0,labelHeight:8.5,labelSize:.8,color:"#999999"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{id:"45EQZzpZDmcCPwStDm4gUQ",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:3.4648066919643785,color:"#4d4d4d",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["py4fscALBHuoNNVWKoXS9c"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:2.641654309594841,ceiling:!1},{type:"Window",cx:-.2916666666666667,cy:.3,cz:0,lx:.16666666666666666,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.5,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"1KMGfKAaAbRXUc5v152G7H"},{type:"Window",cx:.2916666666666667,cy:.3,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"8WmW65wXvFqVAFHZJFWsjr",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi1N2ddsqnGWnubKQgsZki"],rightJoints:["2mKkmtjixue6mVK8C5qdJT"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"adSAr7Jscp2bREMCNnKie9",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["14k9EDHAzKUWAkBFT1miXA"],rightJoints:["adSAr7Jscp2bREMCNnKie9"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi1N2ddsqnGWnubKQgsZki",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["adSAr7Jscp2bREMCNnKie9"],rightJoints:["14k9EDHAzKUWAkBFT1miXA"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"2mKkmtjixue6mVK8C5qdJT",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["2mKkmtjixue6mVK8C5qdJT"],rightJoints:["xi1N2ddsqnGWnubKQgsZki"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"14k9EDHAzKUWAkBFT1miXA",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Window",cx:-.2916666666666667,cy:.1,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"szq2y8vnCqxebu1Sp5dC5N",parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Window",cx:.2916666666666667,cy:.1,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"bm2Jq3Yh33GneBgsKAvMp7",parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{id:"w7eDFcjLuyPhMChKfhs6jB",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:3.4648066919643785,color:"#4d4d4d",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["14k9EDHAzKUWAkBFT1miXA"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:2.641654309594841,ceiling:!1},{type:"Foundation",cx:-11.120691028084872,cy:-.06445313166738242,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:25},labelHeight:8.5,labelSize:.8,id:"4TcV7zx5NzstoQTaTqoAzt",selected:!1,label:"25℃",showLabel:!0,color:"#999999"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",id:"1TYVF9JTXJtxWba41xgetC"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"afEtgeFVMoeDZdyxJU1psm"}],qFn=24,$Fn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[-.042868749999999976,0,0],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[-.042868749999999976,-.0001500066673827405,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-21.828926822512322,-33.873528421784314,4.788669771967834],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[11.438181824994281,-4.700464851624883,4.788669771967831],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:5.5,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-5,y:7,width:600,height:360},showDiurnalTemperaturePanel:!1,diurnalTemperaturePanelRect:{x:0,y:0,width:600,height:400},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:0,y:0,width:600,height:400},stickyNotePanelRect:{x:-1,y:0,width:277,height:63}},QFn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},ZFn=1,ekn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},tkn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},nkn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},okn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},rkn="Unknown",ikn=null,akn=null,lkn=null,skn=["Effect of thermostat setpoint"],ckn={docid:YFn,time:OFn,timestamp:_Fn,userid:VFn,owner:GFn,email:XFn,world:JFn,elements:KFn,sceneRadius:qFn,view:$Fn,graphState:QFn,evolutionMethod:ZFn,solarPanelArrayLayoutParams:ekn,solarPanelArrayLayoutConstraints:tkn,evolutionaryAlgorithmState:nkn,economicsParams:okn,modelType:rkn,modelAuthor:ikn,modelLabel:akn,modelDescription:lkn,notes:skn},ukn="uQrNcHUUR7GCUfUbuFogjq",dkn="02/04/2023 01:39 pm",fkn=1675535990373,hkn="QWecNcxhyvP6j6sBN11hBsfZDau1",pkn=null,gkn=null,mkn={solarRadiationHeatmapGridCellSize:.5,date:"7/22/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:12,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},ykn=[{type:"Human",name:"Jamelia",cx:-4.3683434199366005,cy:-14.38651482103353,cz:0,lx:.65,lz:1.8,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.65},{type:"Foundation",cx:-13.228758971915111,cy:.10702186833261693,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20,temperatureThreshold:5},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"A",showLabel:!0,labelHeight:9,labelSize:.8,color:"#666666"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"6YiUmdowinEDGE2jXwEcty",leftRoofHeight:6,rightRoofHeight:6,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Wall",cx:6.0818182264215075,cy:-.11406220740522244,cz:2.2301039869226305,lx:9.999999999999998,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.0818182264215075,-5.1140622074052215,.1],rightPoint:[6.081818226421507,4.885937792594777,.1],relativeAngle:1.5707963267948968,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"6YiUmdowinEDGE2jXwEcty",leftRoofHeight:6,rightRoofHeight:6,centerRoofHeight:[0,8.046374836825025],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"6YiUmdowinEDGE2jXwEcty",leftRoofHeight:6,rightRoofHeight:6,centerRoofHeight:[0,8.046374836825025],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"6YiUmdowinEDGE2jXwEcty",leftRoofHeight:6,rightRoofHeight:6,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Window",cx:-.375,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.6,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"1KMGfKAaAbRXUc5v152G7H",uValue:1.7034779999999998},{type:"Window",cx:.375,cy:.3,cz:.2916666666666667,lx:.08333333333333337,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"8WmW65wXvFqVAFHZJFWsjr",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Door",cx:0,cy:0,cz:-.2916666666666667,lx:.16666666666666666,ly:0,lz:.4166666666666667,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #6",color:"#ffffff",selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"gLG7BoTZHSewPba87UV4Za",uValue:1.135652},{type:"Window",cx:-.16666666666666666,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"vLVbxQBoEhW71qxT8m1C96",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.16666666666666666,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"26QzSovJr2WkHKUiErU1ER",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.375,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"dZ11kEn33ciPLMqva4wYhW",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.16666666666666666,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"oEPM7Qer3dagcgAZgTd83X",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.16666666666666666,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"nJe6q1fYHpVb61zzuXMiiq",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.375,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"atbMWVsRWU1gP4pFd8UmqE",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.3416666666666667,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"4Xcrc4Qc969xumwjdaTpEv",parentId:"wugyuZMsPdNUQJ1PdoxEGD",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"9r471ngxUS5HfZPQXAbspz",parentId:"wugyuZMsPdNUQJ1PdoxEGD",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.30833333333333335,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"nuMh9HUjsyggQDkK4K4z9r",parentId:"wugyuZMsPdNUQJ1PdoxEGD",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.3416666666666667,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"5TzjYq921EthYvgGjhkd95",parentId:"wugyuZMsPdNUQJ1PdoxEGD",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"i86kfMa5D3a95EHYr74Cik",parentId:"wugyuZMsPdNUQJ1PdoxEGD",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.30833333333333335,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"fes2JVoykppGjYbeBaK1t6",parentId:"wugyuZMsPdNUQJ1PdoxEGD",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.35833333333333334,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"hRvyn5tFnyKbZGmExP8ZBN",parentId:"xi9Zz1pobWAhkAdtkZFZBZ",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.35833333333333334,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"fHUqZ9dwKm5QsdBz4rQhkH",parentId:"xi9Zz1pobWAhkAdtkZFZBZ",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"hVPD3ovUCMHizYi7hHMynX",parentId:"xi9Zz1pobWAhkAdtkZFZBZ",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.3416666666666667,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"92r9RVUcqNvqTSSqzXVWe8",parentId:"xi9Zz1pobWAhkAdtkZFZBZ",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"88LWhfUeptGcLDGkhffTYu",parentId:"xi9Zz1pobWAhkAdtkZFZBZ",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.3416666666666667,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"jJyncTarX8t32trtWmHYJ8",parentId:"xi9Zz1pobWAhkAdtkZFZBZ",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.375,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"tbGfuWPSK8hFimiixh3gnq",parentId:"s4gNJy8vD8tdJGQTaw6DQj",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:2.0463748368250254,thickness:.2,rValue:2.8177645969011635,roofType:"Gable",roofStructure:"Default",wallsId:["s4gNJy8vD8tdJGQTaw6DQj"],textureType:"Roof Texture Default",color:"#333333",sideColor:"#ffffff",selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"6YiUmdowinEDGE2jXwEcty",ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],volumetricHeatCapacity:.2,ceiling:!1},{type:"Window",cx:.375,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"uPf27SYtJ3oEqK8uLnnYC4",parentId:"s4gNJy8vD8tdJGQTaw6DQj",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:0,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"41qtH3jyhy6TAYrTpcQ22r",parentId:"s4gNJy8vD8tdJGQTaw6DQj",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.375,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"c15PoZLmaL9G5281NC3Bky",parentId:"s4gNJy8vD8tdJGQTaw6DQj",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.375,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"e8J6XhFvtnTfamsfk7MdQo",parentId:"s4gNJy8vD8tdJGQTaw6DQj",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Door",cx:-4625929269271485e-33,cy:0,cz:-.2916666666666667,lx:.16666666666666666,ly:0,lz:.4166666666666667,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1.135652,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"s4gNJy8vD8tdJGQTaw6DQj",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"1Z9wCTEw4evBfgBWBx239G"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["iUbSPuuaLHTe92zf2RbbzH"],rightJoints:["b2z6LAysW1ypLiK23VhMbQ"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"t5aKJuTWqFhNtovV6QcVDQ",parentId:"9Lzok59gfWu44BJHP6NeDv",foundationId:"9Lzok59gfWu44BJHP6NeDv",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"5ujWfCT94pVpZ6u8JCHaJM",leftRoofHeight:6,rightRoofHeight:6,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Window",cx:-.375,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"6XAyQ1Y5un66zE9fws5TBK",parentId:"t5aKJuTWqFhNtovV6QcVDQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.375,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"5Fr8WLjKhMXxtEUSo3U3cz",parentId:"t5aKJuTWqFhNtovV6QcVDQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:0,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"bFA3kdwdbv23kgNuvqrBLu",parentId:"t5aKJuTWqFhNtovV6QcVDQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.375,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"2peuf57tgQn8h8KDddojmU",parentId:"t5aKJuTWqFhNtovV6QcVDQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.375,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"pRLjDR4NSZstZSY2CyZhG6",parentId:"t5aKJuTWqFhNtovV6QcVDQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Door",cx:-4625929269271485e-33,cy:0,cz:-.2916666666666667,lx:.16666666666666666,ly:0,lz:.4166666666666667,color:"#ffffff",textureType:"Door Texture #1",filled:!0,doorType:"Default",archHeight:1,normal:[0,1,0],rotation:[0,0,0],id:"fRfZQadrT6sohNBtnZQnjD",parentId:"t5aKJuTWqFhNtovV6QcVDQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",selected:!1,uValue:1.135652},{type:"Wall",cx:6.0818182264215075,cy:-.11406220740522244,cz:2.2301039869226305,lx:9.999999999999998,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["t1vsyYVv6oASAroVbtBJh8"],rightJoints:["t5aKJuTWqFhNtovV6QcVDQ"],leftPoint:[6.0818182264215075,-5.1140622074052215,.1],rightPoint:[6.081818226421507,4.885937792594777,.1],relativeAngle:1.5707963267948968,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"iUbSPuuaLHTe92zf2RbbzH",parentId:"9Lzok59gfWu44BJHP6NeDv",foundationId:"9Lzok59gfWu44BJHP6NeDv",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"5ujWfCT94pVpZ6u8JCHaJM",leftRoofHeight:6,rightRoofHeight:6,centerRoofHeight:[0,8.046374836825025],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Window",cx:-.35833333333333334,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"twjCCVvcJUWUtdX8G6XaEz",parentId:"iUbSPuuaLHTe92zf2RbbzH",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.35833333333333334,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"fJ9ef8TPTGwzuoD998nCxH",parentId:"iUbSPuuaLHTe92zf2RbbzH",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"75FMXmZGkavm2QX1w7Rd2n",parentId:"iUbSPuuaLHTe92zf2RbbzH",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.3416666666666667,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"digHAxUKfqtzZ8Hf1JBrDE",parentId:"iUbSPuuaLHTe92zf2RbbzH",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"pUavBYiArb55RaZvTqEZ7s",parentId:"iUbSPuuaLHTe92zf2RbbzH",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.3416666666666667,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"bMNcD6i8MyPWUstcj4RLAn",parentId:"iUbSPuuaLHTe92zf2RbbzH",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["t5aKJuTWqFhNtovV6QcVDQ"],rightJoints:["t1vsyYVv6oASAroVbtBJh8"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"b2z6LAysW1ypLiK23VhMbQ",parentId:"9Lzok59gfWu44BJHP6NeDv",foundationId:"9Lzok59gfWu44BJHP6NeDv",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"5ujWfCT94pVpZ6u8JCHaJM",leftRoofHeight:6,rightRoofHeight:6,centerRoofHeight:[0,8.046374836825025],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Window",cx:.3416666666666667,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"7af2qg5wEnfy5x3dVwJDa9",parentId:"b2z6LAysW1ypLiK23VhMbQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"8pzbRVzHdUJ21tt86EiuYq",parentId:"b2z6LAysW1ypLiK23VhMbQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.30833333333333335,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"9Rqpx9csAi6gzvsKmMevD7",parentId:"b2z6LAysW1ypLiK23VhMbQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.3416666666666667,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"sRtEGAvWiVdZjNF7cbimyK",parentId:"b2z6LAysW1ypLiK23VhMbQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"cYa823h2xpVhLafAMFJLLp",parentId:"b2z6LAysW1ypLiK23VhMbQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.30833333333333335,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"eCrrhs7nC8ZLgf3kozqASz",parentId:"b2z6LAysW1ypLiK23VhMbQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["b2z6LAysW1ypLiK23VhMbQ"],rightJoints:["iUbSPuuaLHTe92zf2RbbzH"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"t1vsyYVv6oASAroVbtBJh8",parentId:"9Lzok59gfWu44BJHP6NeDv",foundationId:"9Lzok59gfWu44BJHP6NeDv",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"5ujWfCT94pVpZ6u8JCHaJM",leftRoofHeight:6,rightRoofHeight:6,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Window",cx:-.375,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"xoY2sZ3zu3yaqNq4svSL83",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.375,cy:.1,cz:.2916666666666667,lx:.08333333333333337,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"shVdFBTLP3GUxKo2h9rQPd",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Door",cx:0,cy:0,cz:-.2916666666666667,lx:.16666666666666666,ly:0,lz:.4166666666666667,color:"#ffffff",textureType:"Door Texture #6",filled:!0,doorType:"Default",archHeight:1,normal:[0,1,0],rotation:[0,0,0],id:"miHyMDSBYSuj5NSFDxZf2d",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",selected:!1,uValue:1.135652},{type:"Window",cx:-.16666666666666666,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"izobe4AEhigpZU6WX5N4k5",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.16666666666666666,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"o5YP1zidq8SX6PcUxxaAjL",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.375,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"4GhJEysBwSqkSWJpqyaJ48",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.16666666666666666,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"aAGJp2q5U3FuWTdYaSVjDf",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.16666666666666666,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"twPsG5mQU2qWwH6PZR3MFv",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.375,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"1Gwnr8y8qnWjyqse356de2",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{id:"5ujWfCT94pVpZ6u8JCHaJM",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:2.0463748368250254,color:"#333333",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"9Lzok59gfWu44BJHP6NeDv",foundationId:"9Lzok59gfWu44BJHP6NeDv",roofType:"Gable",roofStructure:"Default",textureType:"Roof Texture Default",thickness:.2,wallsId:["t5aKJuTWqFhNtovV6QcVDQ"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:2.8177645969011635,volumetricHeatCapacity:.2,ceiling:!1},{type:"Foundation",cx:13.117837499999993,cy:-.021318315185384407,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20,temperatureThreshold:5},labelHeight:9,labelSize:.8,showLabel:!0,id:"9Lzok59gfWu44BJHP6NeDv",selected:!1,label:"B",color:"#666666"},{type:"Solar Panel",pvModelName:"SPR-X21-335-BLK",trackerType:"None",relativeAzimuth:0,tiltAngle:.5235987755982988,orientation:"Landscape",drawSunBeam:!0,poleHeight:10,poleRadius:.05,poleSpacing:3,cx:.017473997824250177,cy:-.1848238594563359,cz:7.203451961471109,lx:10.906,ly:4.184,lz:.046,showLabel:!1,normal:[-25496209749856465e-33,-.3787787636615868,.9254872490742375],rotation:[.38847637916043065,0,-2220446049250313e-31],color:"#fff",frameColor:"white",parentType:"Roof",parentId:"5ujWfCT94pVpZ6u8JCHaJM",foundationId:"9Lzok59gfWu44BJHP6NeDv",id:"m7muU5PcHHSqA6qooFMWMX",selected:!1}],Akn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[-.042868749999999976,0,0],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[-.042868749999999976,-.0001500066673827405,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-21.205706148898816,-34.501280243521734,7.541149435690317],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[7.9613043217859705,4.9057140700953275,7.541149435690313],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:5.5,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-5,y:7,width:675,height:408},showDiurnalTemperaturePanel:!1,diurnalTemperaturePanelRect:{x:0,y:0,width:600,height:400},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:-1091,y:218,width:775,height:342},stickyNotePanelRect:{x:-3,y:-2,width:275,height:63}},wkn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},vkn=1,xkn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},bkn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},Skn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},Tkn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},Pkn=["Effect of rooftop solar panels"],Ckn={docid:ukn,time:dkn,timestamp:fkn,userid:hkn,owner:pkn,email:gkn,world:mkn,elements:ykn,view:Akn,graphState:wkn,evolutionMethod:vkn,solarPanelArrayLayoutParams:xkn,solarPanelArrayLayoutConstraints:bkn,evolutionaryAlgorithmState:Skn,economicsParams:Tkn,notes:Pkn},Rkn="4VyiQ32UEi5Uhg2actsJ7k",Hkn="05/22/2023 10:52 am",Mkn=1684767120478,Ikn="QWecNcxhyvP6j6sBN11hBsfZDau1",zkn=null,Dkn=null,Ekn={solarRadiationHeatmapGridCellSize:.5,date:"7/1/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:4,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},Fkn=[{type:"Human",name:"Jack",cx:-6.628211467880927,cy:-10.2119938102408,cz:4440892098500626e-31,lx:.42,lz:1.8,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.42},{type:"Foundation",cx:9.345387499999994,cy:.10743784147400248,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"Uninsulated floor",showLabel:!0,labelHeight:7,labelSize:.5,color:"#808080",rValue:1.7611028730632272},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{id:"45EQZzpZDmcCPwStDm4gUQ",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:1.9987267232669597,color:"#808080",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["py4fscALBHuoNNVWKoXS9c"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:1.7611028730632272,ceiling:!1},{type:"Foundation",cx:-9.302518749999996,cy:.06403695851719249,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},id:"fbqvzYqiEy79jeL8wsadib",selected:!1,hvacSystem:{thermostatSetpoint:20},label:"Insulated floor",labelHeight:7,showLabel:!0,labelSize:.5,color:"#808080",rValue:3.5222057461264544},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,leftJoints:["pPpJHGJ2bGVqLdA1FpXi4V"],rightJoints:["2RETAxyRMzZBEQkBGms56R"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"giYTP9Qg6uJ3yfkS1RoDqG",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,leftJoints:["beHqET5NN8aNdsuBncMpY7"],rightJoints:["giYTP9Qg6uJ3yfkS1RoDqG"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"pPpJHGJ2bGVqLdA1FpXi4V",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,leftJoints:["giYTP9Qg6uJ3yfkS1RoDqG"],rightJoints:["beHqET5NN8aNdsuBncMpY7"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"2RETAxyRMzZBEQkBGms56R",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,leftJoints:["2RETAxyRMzZBEQkBGms56R"],rightJoints:["pPpJHGJ2bGVqLdA1FpXi4V"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"beHqET5NN8aNdsuBncMpY7",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:1.9987267232669597,thickness:.2,roofType:"Gable",roofStructure:"Default",wallsId:["beHqET5NN8aNdsuBncMpY7"],textureType:"No Roof Texture",color:"#808080",sideColor:"#ffffff",selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",id:"wqKadTHiLAV8a3mAejBhVp",ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],rValue:1.7611028730632272,ceiling:!1},{type:"Window",cx:-.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.55,uValue:2,normal:[0,0,1],rotation:[0,0,0],parentId:"beHqET5NN8aNdsuBncMpY7",foundationId:"fbqvzYqiEy79jeL8wsadib",id:"2bkzpWVFhyLy2B93eQe6LC"},{type:"Window",cx:.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"2qrmNqnNqMrnaf9yVKwntp",parentId:"beHqET5NN8aNdsuBncMpY7",foundationId:"fbqvzYqiEy79jeL8wsadib",tint:"#73D8FF",opacity:.55,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Window",cx:-.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.55,uValue:2,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"hQgFUEAKKCuxnfg7DfAtUD"},{type:"Window",cx:.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"3F32WEzwgnaEKesshW1B9d",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.55,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"beHqET5NN8aNdsuBncMpY7",foundationId:"fbqvzYqiEy79jeL8wsadib",id:"3uhARcmLhJJ7AF4oGmRXFJ"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"rJ589nLaG9XWmTRZhwLvTz"}],kkn=22,Lkn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[0,0,0],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[0,-.0001500066673827405,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-17.829241192466892,-21.107034059971184,4.718921354569243],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[4.327600264578368,2.7041849125647666,4.718921354569243],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:5.5,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-5,y:7,width:600,height:360},showDiurnalTemperaturePanel:!0,diurnalTemperaturePanelRect:{x:-1,y:1,width:517,height:333},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:0,y:0,width:600,height:400},heatFluxScaleFactor:10,stickyNotePanelRect:{x:-2,y:344,width:517,height:60}},Wkn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},Nkn=1,Ukn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},jkn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},Bkn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},Ykn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},Okn="Unknown",_kn=null,Vkn=null,Gkn=null,Xkn=["Effect of ground temperature and floor insulation"],Jkn={docid:Rkn,time:Hkn,timestamp:Mkn,userid:Ikn,owner:zkn,email:Dkn,world:Ekn,elements:Fkn,sceneRadius:kkn,view:Lkn,graphState:Wkn,evolutionMethod:Nkn,solarPanelArrayLayoutParams:Ukn,solarPanelArrayLayoutConstraints:jkn,evolutionaryAlgorithmState:Bkn,economicsParams:Ykn,modelType:Okn,modelAuthor:_kn,modelLabel:Vkn,modelDescription:Gkn,notes:Xkn},Kkn="gTE5M2QuRpvxtj7gFjQvBp",qkn="05/22/2023 10:53 am",$kn=1684767216212,Qkn="QWecNcxhyvP6j6sBN11hBsfZDau1",Zkn=null,eLn=null,tLn={solarRadiationHeatmapGridCellSize:.5,date:"6/10/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:4,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},nLn=[{type:"Human",name:"Jack",cx:-6.628211467880927,cy:-10.2119938102408,cz:4440892098500626e-31,lx:.42,lz:1.8,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.42},{type:"Foundation",cx:11.171058971915114,cy:.06430302499558693,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"A",showLabel:!0,labelHeight:8.5,labelSize:.8,color:"#666666"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{id:"45EQZzpZDmcCPwStDm4gUQ",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:3.4648066919643785,color:"#4d4d4d",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["py4fscALBHuoNNVWKoXS9c"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:2.641654309594841,ceiling:!1},{type:"Window",cx:-.2916666666666667,cy:.3,cz:0,lx:.16666666666666666,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.5,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"1KMGfKAaAbRXUc5v152G7H"},{type:"Window",cx:.2916666666666667,cy:.3,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"8WmW65wXvFqVAFHZJFWsjr",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Tree",name:"Maple",cx:11.597557786217195,cy:-9.10270743636709,cz:0,lx:11.852806241793175,lz:12.934464914753796,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"o3k54VQM47Q54nSJAwrmEn",selected:!1},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi1N2ddsqnGWnubKQgsZki"],rightJoints:["2mKkmtjixue6mVK8C5qdJT"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"adSAr7Jscp2bREMCNnKie9",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["14k9EDHAzKUWAkBFT1miXA"],rightJoints:["adSAr7Jscp2bREMCNnKie9"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"xi1N2ddsqnGWnubKQgsZki",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["adSAr7Jscp2bREMCNnKie9"],rightJoints:["14k9EDHAzKUWAkBFT1miXA"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"2mKkmtjixue6mVK8C5qdJT",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["2mKkmtjixue6mVK8C5qdJT"],rightJoints:["xi1N2ddsqnGWnubKQgsZki"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"14k9EDHAzKUWAkBFT1miXA",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Window",cx:-.2916666666666667,cy:.1,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"szq2y8vnCqxebu1Sp5dC5N",parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Window",cx:.2916666666666667,cy:.1,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"bm2Jq3Yh33GneBgsKAvMp7",parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{id:"w7eDFcjLuyPhMChKfhs6jB",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:3.4648066919643785,color:"#4d4d4d",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["14k9EDHAzKUWAkBFT1miXA"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:2.641654309594841,ceiling:!1},{type:"Foundation",cx:-11.120691028084872,cy:-.06445313166738242,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},labelHeight:8.5,labelSize:.8,id:"4TcV7zx5NzstoQTaTqoAzt",selected:!1,label:"B",showLabel:!0,color:"#666666"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #14",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",id:"p8R6iYpCmdMa5Cs4zuS1P6"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #14",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"56LE4zBekLnvJc9jFEm7Yu"}],oLn=24,rLn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[-.042868749999999976,0,0],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[-.042868749999999976,-.0001500066673827405,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-25.541858353538785,-23.926978121750373,5.679305436989464],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[13.47063227815913,1.5150691532035274,5.679305436989461],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:5.5,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-5,y:7,width:600,height:360},showDiurnalTemperaturePanel:!1,diurnalTemperaturePanelRect:{x:0,y:0,width:600,height:400},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:0,y:0,width:600,height:400},stickyNotePanelRect:{x:-3,y:-2,width:203,height:64}},iLn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},aLn=1,lLn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},sLn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},cLn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},uLn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},dLn="Unknown",fLn=null,hLn=null,pLn=null,gLn=["Effect of trees"],mLn={docid:Kkn,time:qkn,timestamp:$kn,userid:Qkn,owner:Zkn,email:eLn,world:tLn,elements:nLn,sceneRadius:oLn,view:rLn,graphState:iLn,evolutionMethod:aLn,solarPanelArrayLayoutParams:lLn,solarPanelArrayLayoutConstraints:sLn,evolutionaryAlgorithmState:cLn,economicsParams:uLn,modelType:dLn,modelAuthor:fLn,modelLabel:hLn,modelDescription:pLn,notes:gLn},yLn="21TNkEaRQtmkMpHquDpRhe",ALn="03/21/2023 12:30 pm",wLn=1679416202848,vLn="QWecNcxhyvP6j6sBN11hBsfZDau1",xLn=null,bLn=null,SLn={solarRadiationHeatmapGridCellSize:.25,date:"1/22/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:12,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},TLn=[{type:"Human",name:"Judd",cx:2.5001103094985826,cy:-6.058721988130646,cz:.030962420627473897,lx:.544,lz:1.68,normal:[0,1,0],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.42},{type:"Foundation",cx:-10.117024999999996,cy:.27838070851727714,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20,temperatureThreshold:5},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"No Ceiling",showLabel:!0,labelHeight:6,labelSize:.5,color:"#808080"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:3,rightRoofHeight:3,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:3,rightRoofHeight:3,centerRoofHeight:[0,5.068830689450057],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:3,rightRoofHeight:3,centerRoofHeight:[0,5.068830689450057],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:3,rightRoofHeight:3,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{id:"45EQZzpZDmcCPwStDm4gUQ",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:2.068830689450057,color:"#4d4d4d",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.1,wallsId:["py4fscALBHuoNNVWKoXS9c"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:1.7611028730632272,ceiling:!1},{type:"Window",cx:-.3125,cy:.3,cz:.08333333333333333,lx:.125,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.55,uValue:2,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"hQgFUEAKKCuxnfg7DfAtUD"},{type:"Window",cx:.3125,cy:.3,cz:.08333333333333333,lx:.125,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"3F32WEzwgnaEKesshW1B9d",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.55,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Door",cx:-.029166666666666664,cy:0,cz:-.08333333333333333,lx:.10833333333333334,ly:0,lz:.8333333333333334,color:"white",uValue:1.7034779999999998,textureType:"Door Texture #17",filled:!0,doorType:"Arched",archHeight:1,normal:[0,0,1],rotation:[0,0,0],id:"9j89u3pSufVm3Q5kpF4NcM",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",selected:!1},{type:"Human",name:"Jena",cx:2.5001103094985826,cy:-6.058721988130646,cz:.030962420627473897,lx:.695,ly:.42,lz:1.6,normal:[0,1,0],rotation:[0,0,0],parentId:"cfvC81ormzBEgA9Ah4eP3v",id:"34EHkp2Lb8b2vnEKfniznR",selected:!1},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["rHyZXvwyEPAa7dU7nYmXpR"],rightJoints:["jvSvdwWqKHJqgaZtgavr3X"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"8NQNpFkXNGAXtcTwXhtHNW",parentId:"cfvC81ormzBEgA9Ah4eP3v",foundationId:"cfvC81ormzBEgA9Ah4eP3v",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"gCFHHnVKnRgFUFksjrmZCm",leftRoofHeight:3,rightRoofHeight:3,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["sb7GHiMmhgNyZJdQ71BL5y"],rightJoints:["8NQNpFkXNGAXtcTwXhtHNW"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"rHyZXvwyEPAa7dU7nYmXpR",parentId:"cfvC81ormzBEgA9Ah4eP3v",foundationId:"cfvC81ormzBEgA9Ah4eP3v",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"gCFHHnVKnRgFUFksjrmZCm",leftRoofHeight:3,rightRoofHeight:3,centerRoofHeight:[0,5.068830689450057],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["8NQNpFkXNGAXtcTwXhtHNW"],rightJoints:["sb7GHiMmhgNyZJdQ71BL5y"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"jvSvdwWqKHJqgaZtgavr3X",parentId:"cfvC81ormzBEgA9Ah4eP3v",foundationId:"cfvC81ormzBEgA9Ah4eP3v",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"gCFHHnVKnRgFUFksjrmZCm",leftRoofHeight:3,rightRoofHeight:3,centerRoofHeight:[0,5.068830689450057],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["jvSvdwWqKHJqgaZtgavr3X"],rightJoints:["rHyZXvwyEPAa7dU7nYmXpR"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"sb7GHiMmhgNyZJdQ71BL5y",parentId:"cfvC81ormzBEgA9Ah4eP3v",foundationId:"cfvC81ormzBEgA9Ah4eP3v",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"gCFHHnVKnRgFUFksjrmZCm",leftRoofHeight:3,rightRoofHeight:3,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{type:"Window",cx:-.3125,cy:.1,cz:.08333333333333333,lx:.125,ly:.2,lz:.5,uValue:2,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"q6p3CCHJFvsqrEsXwbRh1R",parentId:"sb7GHiMmhgNyZJdQ71BL5y",foundationId:"cfvC81ormzBEgA9Ah4eP3v",tint:"#73D8FF",opacity:.55,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Window",cx:.3125,cy:.1,cz:.08333333333333333,lx:.125,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"j1XnXywfGpFArNKZPbAhkm",parentId:"sb7GHiMmhgNyZJdQ71BL5y",foundationId:"cfvC81ormzBEgA9Ah4eP3v",tint:"#73D8FF",opacity:.55,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Door",cx:4625929269271485e-33,cy:0,cz:-.08333333333333333,lx:.10833333333333334,ly:0,lz:.8333333333333334,color:"white",uValue:1.7034779999999998,textureType:"Door Texture #17",filled:!0,doorType:"Arched",archHeight:1,normal:[0,0,1],rotation:[0,0,0],id:"6uoZg4uoFLaTiYnPcJZ3V9",parentId:"sb7GHiMmhgNyZJdQ71BL5y",foundationId:"cfvC81ormzBEgA9Ah4eP3v",selected:!1},{id:"gCFHHnVKnRgFUFksjrmZCm",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,ceiling:!0,rise:2.068830689450057,color:"#4d4d4d",rValue:1.7611028730632272,sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"cfvC81ormzBEgA9Ah4eP3v",foundationId:"cfvC81ormzBEgA9Ah4eP3v",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.1,wallsId:["sb7GHiMmhgNyZJdQ71BL5y"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,ceilingRValue:3.5222057461264544},{type:"Foundation",cx:10.177578528084874,cy:.23562811833261754,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",color:"#808080",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20,temperatureThreshold:5},labelHeight:6,labelSize:.5,showLabel:!0,id:"cfvC81ormzBEgA9Ah4eP3v",selected:!1,label:"Insulated Ceiling"}],PLn=23,CLn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[0,.08573749999997851,4287065548240426e-23],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[0,.08558749333259577,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-19.73331041183491,-15.606053038152623,2.569638957524864],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[3.388120187568702,1.9907625161279443,1.1720990830439746],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:3,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-2,y:3,width:510,height:354},showDiurnalTemperaturePanel:!1,diurnalTemperaturePanelRect:{x:0,y:0,width:600,height:400},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:0,y:0,width:600,height:400},heatFluxScaleFactor:2,stickyNotePanelRect:{x:-4,y:2,width:397,height:65}},RLn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},HLn=1,MLn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},ILn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},zLn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},DLn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},ELn="Unknown",FLn=null,kLn=null,LLn=null,WLn=["Thermal envelope vs. building envelope"],NLn={docid:yLn,time:ALn,timestamp:wLn,userid:vLn,owner:xLn,email:bLn,world:SLn,elements:TLn,sceneRadius:PLn,view:CLn,graphState:RLn,evolutionMethod:HLn,solarPanelArrayLayoutParams:MLn,solarPanelArrayLayoutConstraints:ILn,evolutionaryAlgorithmState:zLn,economicsParams:DLn,modelType:ELn,modelAuthor:FLn,modelLabel:kLn,modelDescription:LLn,notes:WLn},ULn=t=>{let e;switch(t){case"sun_angles":e=trn;break;case"insolation_and_climate":e=yrn;break;case"solar_radiation_to_box":e=Ern;break;case"sun_beam_at_center":e=Krn;break;case"thermal_vs_building_envelope":e=NLn;break;case"effect_house_size":e=UDn;break;case"effect_house_orientation":e=lEn;break;case"effect_wall_roof_insulation":e=MEn;break;case"effect_roof_color":e=$En;break;case"effect_eaves_overhang_length":e=wFn;break;case"effect_window_shgc":e=BFn;break;case"effect_thermostat_setpoint":e=ckn;break;case"effect_solar_panels":e=Ckn;break;case"effect_ground_temperature":e=Jkn;break;case"effect_trees":e=mLn;break;case"office_building_01":e=M5n;break;case"hotel_01":e=V5n;break;case"spanish_style_hotel":e=h9n;break;case"apartment_building_01":e=k9n;break;case"white_house":e=A2n;break;case"harold_washington_college":e=V2n;break;case"bilim_mersin_turkiye":e=h5n;break;case"south_burlington_high_school":e=Q9n;break;case"mescalero_apache_school":e=g3n;break;case"city_block_heatmap":e=P3n;break;case"chicago_skyline":e=Q3n;break;case"vegetative_buffer_01":e=g8n;break;case"solar_canopy_form_factors":e=G7n;break;case"solar_canopy_over_bleachers":e=cvn;break;case"solar_bus_stop":e=zvn;break;case"solar_facade_tesla":e=Exn;break;case"solar_canopy_over_garage":e=mxn;break;case"bipv_01":e=Jvn;break;case"floatovoltaics":e=qxn;break;case"agriculture_solar_wind_colocation":e=Sbn;break;case"effect_tilt_angle_solar_panel":e=D8n;break;case"effect_azimuth_solar_panel":e=K8n;break;case"effect_azimuth_parabolic_trough":e=fwn;break;case"effect_latus_rectum_parabolic_trough":e=Hwn;break;case"parabolic_dish_focus_sunlight":e=FSn;break;case"effect_orientation_solar_panel":e=Vwn;break;case"solar_panel_types":e=din;break;case"vertical_bifacial_solar_panels":e=Lin;break;case"compare_monofacial_bifacial_solar_panels":e=lan;break;case"why_solar_array":e=l7n;break;case"solar_panel_array_auto_layout":e=M7n;break;case"inter_row_spacing":e=jbn;break;case"rooftop_solar_panels":e=Tan;break;case"solar_panels_over_canal":e=msn;break;case"solar_noise_barrier":e=Zln;break;case"rainbow_swash_solar_farm":e=Ban;break;case"mickey_mouse_solar_farm":e=rln;break;case"solar_farm_hsat_array":e=vln;break;case"solar_farm_aadat_array":e=Lln;break;case"solar_trackers":e=Esn;break;case"nevada_solar_one_parabolic_troughs":e=ASn;break;case"tooele_parabolic_dish_array":e=qSn;break;case"ps10_solar_power_tower":e=nSn;break;case"linear_fresnel_reflectors":e=hTn;break;case"linear_fresnel_reflectors_two_absorbers":e=ITn;break;case"effect_absorber_pipe_height":e=XTn;break;case"effect_azimuth_fresnel_reflector":e=uPn;break;case"cosine_efficiency_heliostats":e=DPn;break;case"shadowing_blocking_heliostats":e=eCn;break;case"effect_solar_power_tower_height":e=bCn;break;case"solar_power_tower":e=UCn;break;case"solar_updraft_tower":e=PHn;break;case"solar_updraft_tower_city":e=kHn;break;case"effect_blade_number":e=sMn;break;case"effect_pitch_angle":e=kMn;break;case"bird_safe_blade_design":e=sIn;break;case"offshore_wind_farm":e=kIn;break;case"cape_cod_with_shed_dormer":e=xcn;break;case"mansard_roof_with_dormers":e=Ocn;break;case"t_shaped_house":e=d0n;break;case"all_roof_types":e=qsn;break;case"a_frame_house":e=g1n;break;case"half_timbered_house":e=W1n;break;case"dutch_gable_roof":e=Xpn;break;case"combination_roof_vs_bonnet_roof":e=rgn;break;case"butterfly_roof_house":e=Cgn;break;case"gable_roof_vs_hip_roof":e=Xgn;break;case"gable_and_valley_roof":e=pmn;break;case"clerestory_roof":e=kmn;break;case"monitor_roof":e=oyn;break;case"colonial_vs_saltbox":e=Tyn;break;case"gambrel_roof_vs_mansard_roof":e=Vyn;break;case"colonial_house":e=$hn;break;case"dutch_colonial_house":e=bpn;break;case"cape_cod_with_garage":e=E0n;break;case"greenhouse":e=v6n;break;case"solarium":e=dfn;break;case"pavilion":e=X6n;break;case"octagonal_pagoda":e=uAn;break;case"ocean_front":e=RAn;break;case"mosque_01":e=Hfn;break;case"church_01":e=Vfn;break;case"cathedral_01":e=shn;break;case"cathedral_02":e=Ihn;break;case"adobe_taos_house":e=q0n;break;case"egyptian_pyramids":e=_An;break;case"mayan_pyramid":e=h4n;break;case"si_o_se_pol":e=I4n;break;case"stacked_cuboids":e=Q4n;break;case"barn_house":e=xdn;break;case"ranch_house":e=Sun;break;case"bonnet_house":e=Jun;break;case"modern_house_01":e=Odn;break;case"solar_radiation_predicted_vs_measured":e=tRn;break;case"bestest_case_600":e=ARn;break;case"bestest_case_610":e=kRn;break;case"bestest_case_620":e=QRn;break;case"bestest_case_630":e=gHn;break;case"tucson_sundt_station":e=VIn;break;case"ai_tilt_angle_one_row":e=szn;break;case"ai_tilt_angles_multiple_rows":e=Pzn;break;case"ai_solar_farm_design":e=Yzn;break;case"ai_solar_farm_design_block":e=iDn;break;case"ai_fitchburg_solar_farm":e=bDn;break}return e},eM=()=>{const t=H(fn),e=H(kYe),n=H(LYe),o=H(yp),r=Jt(),i=me.isMac(),a=()=>{if(n&&n.length>0){const l=e();if(l.length>0){const s={name:"Paste to Point",timestamp:Date.now(),pastedElements:l.map(c=>({...c})),undo:()=>{for(const c of s.pastedElements)o(c.id,!1)},redo:()=>{t(c=>{c.elements.push(...s.pastedElements),c.selectedElement=s.pastedElements[0],c.updateElementOnRoofFlag=!0})}};H.getState().addUndoable(s)}}};return h.jsxs(rn,{onClick:a,children:[Y.t("word.Paste",r),h.jsxs("span",{style:{paddingLeft:"4px",fontSize:9},children:["(",i?"⌘":"Ctrl","+V)"]})]})},Ld=()=>{const t=H(fn),e=H(FYe),n=H(ma),o=Jt(),r=me.isMac(),i=()=>{const a=H.getState().selectedElement;a&&(e(a.id),n&&t(l=>{l.actionInfo={name:"Copy",timestamp:new Date().getTime(),elementId:a.id,elementType:a.type}}))};return h.jsxs(rn,{onClick:i,children:[Y.t("word.Copy",o),h.jsxs("span",{style:{paddingLeft:"4px",fontSize:9},children:["(",r?"⌘":"Ctrl","+C)"]})]})},Wd=()=>{const t=H(fn),e=H(yp),n=me.isMac(),o=Jt(),r=()=>{const i=H.getState().selectedElement;if(!(!i||i.type===z.Roof))if(i.locked)hn(Y.t("message.ThisElementIsLocked",o));else{const a=e(i.id,!0);if(a.length===0)return;if(me.isElementTriggerAutoDeletion(a[0]))Fn.getState().setListenToAutoDeletionByCut(!0),ht.getState().setPrimitiveStore("selectedElementId",i.id);else{const l={name:"Cut",timestamp:Date.now(),deletedElements:a,selectedElementId:i.id,undo:()=>{const s=l.deletedElements;if(s.length===0)return;const c=s.find(u=>u.id===l.selectedElementId);c&&t(u=>{for(const d of s)u.elements.push(d);if(c.type===z.Wall){const d=c;let f=null,p=null;if(d.leftJoints.length>0&&(f=d.leftJoints[0]),d.rightJoints.length>0&&(p=d.rightJoints[0]),f||p)for(const g of u.elements)g.id===f&&g.type===z.Wall&&(g.rightJoints[0]=d.id),g.id===p&&g.type===z.Wall&&(g.leftJoints[0]=d.id)}})},redo:()=>{l.deletedElements&&l.deletedElements.length>0&&e(l.deletedElements[0].id,!0)}};H.getState().addUndoable(l)}}};return h.jsxs(rn,{onClick:r,children:[Y.t("word.Cut",o),h.jsxs("span",{style:{paddingLeft:"4px",fontSize:9},children:["(",n?"⌘":"Ctrl","+X)"]})]})},Ju=({selectedElement:t})=>{const e=Jt(),n=H(Fwt),o=H(En),r=a=>{t&&n(t.id,a)},i=a=>{const l=a.target.checked,s={name:"Lock",timestamp:Date.now(),checked:l,selectedElementId:t==null?void 0:t.id,selectedElementType:t==null?void 0:t.type,undo:()=>{r(!s.checked)},redo:()=>{r(s.checked)}};o(s),r(l)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.locked,onChange:i,children:Y.t("word.Lock",e)})})},rn=({stayAfterClick:t,noPadding:e,fontWeight:n,textSelectable:o=!0,update:r,onClick:i,children:a})=>{const l=s=>{i&&i(s),t&&s.stopPropagation(),r&&ht.getState().updateContextMenu()};return h.jsx("span",{onClick:l,style:{userSelect:o?"auto":"none",display:"inline-block",fontWeight:n,width:"100%",paddingLeft:e?"0px":"24px"},children:a})},to=({Dialog:t,noPadding:e,children:n})=>{const[o,r]=m.useState(!1),i=()=>{H.getState().setApplyCount(0),r(!0)};return h.jsxs(h.Fragment,{children:[h.jsx(rn,{noPadding:e,onClick:i,children:n}),o&&h.jsx(t,{setDialogVisible:r})]})},DQe=({groupableElement:t})=>{const e=Jt(),n=()=>{H.getState().set(r=>{for(const i of r.elements)if(i.id===t.id&&md(i)){i.enableGroupMaster=!i.enableGroupMaster;break}r.groupActionUpdateFlag=!r.groupActionUpdateFlag})},o=r=>{const i={name:"Group Master",timestamp:Date.now(),checked:r.target.checked,selectedElementId:t.id,selectedElementType:t.type,undo:()=>n(),redo:()=>n()};H.getState().addUndoable(i),n()};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.enableGroupMaster,onChange:o,children:Y.t("foundationMenu.GroupMaster",e)})})},pX=({element:t,inside:e,children:n})=>{const o=H.getState().updateInsideLightsByParentId,r=()=>{const i=new Map;for(const l of H.getState().elements)l.parentId===t.id&&l.type===z.Light&&i.set(l.id,l.inside);o(t.id,e);const a={name:e?`Set All Lights on ${t.type} Inside`:`Set All Lights on ${t.type} Outside`,timestamp:Date.now(),oldValues:i,newValue:!0,undo:()=>{for(const[l,s]of a.oldValues.entries())H.getState().updateInsideLightById(l,s)},redo:()=>{o(t.id,e)}};H.getState().addUndoable(a)};return h.jsx(rn,{stayAfterClick:!0,update:!0,noPadding:!0,onClick:r,children:n})},e2e=({solarCollector:t})=>{const e=H.getState().updateSolarCollectorDrawSunBeamById,n=Jt(),o=r=>{const i={name:"Show Sun Beam",timestamp:Date.now(),checked:!t.drawSunBeam,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{e(t.id,!i.checked)},redo:()=>{e(t.id,i.checked)}};H.getState().addUndoable(i),e(t.id,r)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.drawSunBeam,onChange:r=>o(r.target.checked),children:Y.t("solarCollectorMenu.DrawSunBeam",n)})})},hw=({checked:t,onClick:e,children:n})=>h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t,onClick:e,children:n})}),EC=({min:t,max:e,value:n,onChange:o,children:r})=>h.jsxs(rn,{stayAfterClick:!0,noPadding:!0,children:[r,h.jsx(Iu,{min:t,max:e,tooltip:{open:!1},defaultValue:n,onChange:o})]}),lh=({children:t})=>h.jsx("span",{style:{paddingLeft:"2px",fontSize:9},children:t}),f2=({selector:t,onChange:e,children:n})=>{const o=H(t);return h.jsx(rn,{noPadding:!0,stayAfterClick:!0,children:h.jsx(Li,{style:{width:"100%"},checked:o,onChange:e,children:n})})},oae=({selector:t,onChange:e,children:n})=>{const o=H(t);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{width:"280px"},children:n}),h.jsx(xc,{checked:o,onChange:e})]})},EQe="/aladdin/assets/map_residential_building-BlM-FtN4.png",FQe="/aladdin/assets/map_commercial_building-DgYY52Jp.png",kQe="/aladdin/assets/map_school_building-B4f7IMQ-.png",LQe="/aladdin/assets/map_tourist_attraction-qR1MEaG5.png",WQe="/aladdin/assets/map_solar_panel-DyfTsHia.png",NQe="/aladdin/assets/map_parabolic_dish-C1NBHVgm.png",UQe="/aladdin/assets/map_parabolic_trough-CCcc-zs6.png",jQe="/aladdin/assets/map_fresnel_reflector-Bzw0EMA6.png",BQe="/aladdin/assets/map_heliostat-BXje3i1H.png",YQe="/aladdin/assets/map_under_construction-fpLVLcIy.png",OQe="/aladdin/assets/map_marker-C9GhGDY6.png",_Qe="/aladdin/assets/map_wind_turbine-Bw5iob8S.png",VQe="/aladdin/assets/map_colocation_projects-PrxUC05F.png";var WQ={exports:{}},GQe={};function XQe(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(t=window.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.style;if(!n||e in n)return"";for(let o=0;oe===n.identifier)||t.changedTouches&&(0,Cg.findInArray)(t.changedTouches,n=>e===n.identifier)}function lWn(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function sWn(t){if(!t)return;let e=t.getElementById("react-draggable-style-el");e||(e=t.createElement("style"),e.type="text/css",e.id="react-draggable-style-el",e.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +屋簷延申長度的影響`],wFn={docid:QEn,time:ZEn,timestamp:eFn,userid:tFn,owner:nFn,email:oFn,world:rFn,elements:iFn,sceneRadius:aFn,view:lFn,graphState:sFn,evolutionMethod:cFn,solarPanelArrayLayoutParams:uFn,solarPanelArrayLayoutConstraints:dFn,evolutionaryAlgorithmState:fFn,economicsParams:hFn,modelType:pFn,modelAuthor:gFn,modelLabel:mFn,modelDescription:yFn,notes:AFn},vFn="iJM88uQ7kfN8BTPGSVD3jV",xFn="05/22/2023 10:47 am",bFn=1684766839823,SFn="QWecNcxhyvP6j6sBN11hBsfZDau1",TFn=null,PFn=null,CFn={solarRadiationHeatmapGridCellSize:.5,date:"6/10/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:4,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},RFn=[{type:"Human",name:"Jack",cx:-6.628211467880927,cy:-10.2119938102408,cz:4440892098500626e-31,lx:.42,lz:1.8,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.42},{type:"Foundation",cx:11.171058971915114,cy:.06430302499558693,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"A",showLabel:!0,labelHeight:8.5,labelSize:.8,color:"#666666"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{id:"45EQZzpZDmcCPwStDm4gUQ",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:3.4648066919643785,color:"#4d4d4d",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["py4fscALBHuoNNVWKoXS9c"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:2.8177645969011635,ceiling:!1},{type:"Window",cx:-.2916666666666667,cy:.3,cz:0,lx:.16666666666666666,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#009ce0",opacity:.65,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"1KMGfKAaAbRXUc5v152G7H"},{type:"Window",cx:.2916666666666667,cy:.3,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"8WmW65wXvFqVAFHZJFWsjr",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#009ce0",opacity:.65,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi1N2ddsqnGWnubKQgsZki"],rightJoints:["2mKkmtjixue6mVK8C5qdJT"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"adSAr7Jscp2bREMCNnKie9",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["14k9EDHAzKUWAkBFT1miXA"],rightJoints:["adSAr7Jscp2bREMCNnKie9"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi1N2ddsqnGWnubKQgsZki",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["adSAr7Jscp2bREMCNnKie9"],rightJoints:["14k9EDHAzKUWAkBFT1miXA"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"2mKkmtjixue6mVK8C5qdJT",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["2mKkmtjixue6mVK8C5qdJT"],rightJoints:["xi1N2ddsqnGWnubKQgsZki"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"14k9EDHAzKUWAkBFT1miXA",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Window",cx:-.2916666666666667,cy:.1,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"szq2y8vnCqxebu1Sp5dC5N",parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",tint:"#009ce0",opacity:.35,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Window",cx:.2916666666666667,cy:.1,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"bm2Jq3Yh33GneBgsKAvMp7",parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",tint:"#009ce0",opacity:.35,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{id:"w7eDFcjLuyPhMChKfhs6jB",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:3.4648066919643785,color:"#4d4d4d",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["14k9EDHAzKUWAkBFT1miXA"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:2.8177645969011635,ceiling:!1},{type:"Foundation",cx:-11.120691028084872,cy:-.06445313166738242,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},labelHeight:8.5,labelSize:.8,id:"4TcV7zx5NzstoQTaTqoAzt",selected:!1,label:"B",showLabel:!0,color:"#666666"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",id:"rRMpmcwQNzvRYmkTWpEhiw"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"jyiupxyxWNzhU4yRrTPHU1"}],HFn=24,MFn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[-.042868749999999976,0,0],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[-.042868749999999976,-.0001500066673827405,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-16.77287507225449,-24.274336266873924,5.320155603217975],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[10.498836843888402,4.793969537181787,2.890808814152251],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:5.5,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-5,y:7,width:600,height:360},showDiurnalTemperaturePanel:!1,diurnalTemperaturePanelRect:{x:0,y:0,width:600,height:400},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:0,y:0,width:600,height:400},stickyNotePanelRect:{x:-5,y:-1,width:421,height:65}},IFn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},zFn=1,DFn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},EFn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},FFn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},kFn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},LFn="Unknown",WFn=null,NFn=null,UFn=null,jFn=["Effect of solar heat gain coefficients (SHGC) of windows"],BFn={docid:vFn,time:xFn,timestamp:bFn,userid:SFn,owner:TFn,email:PFn,world:CFn,elements:RFn,sceneRadius:HFn,view:MFn,graphState:IFn,evolutionMethod:zFn,solarPanelArrayLayoutParams:DFn,solarPanelArrayLayoutConstraints:EFn,evolutionaryAlgorithmState:FFn,economicsParams:kFn,modelType:LFn,modelAuthor:WFn,modelLabel:NFn,modelDescription:UFn,notes:jFn},YFn="6nLDNj8vM4d4LSQKVT9SXo",OFn="05/22/2023 10:49 am",_Fn=1684766960725,VFn="QWecNcxhyvP6j6sBN11hBsfZDau1",GFn=null,XFn=null,JFn={solarRadiationHeatmapGridCellSize:.5,date:"6/10/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:4,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},KFn=[{type:"Human",name:"Jack",cx:-6.628211467880927,cy:-10.2119938102408,cz:4440892098500626e-31,lx:.42,lz:1.8,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.42},{type:"Foundation",cx:11.171058971915114,cy:.06430302499558693,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"20℃",showLabel:!0,labelHeight:8.5,labelSize:.8,color:"#999999"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{id:"45EQZzpZDmcCPwStDm4gUQ",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:3.4648066919643785,color:"#4d4d4d",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["py4fscALBHuoNNVWKoXS9c"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:2.641654309594841,ceiling:!1},{type:"Window",cx:-.2916666666666667,cy:.3,cz:0,lx:.16666666666666666,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.5,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"1KMGfKAaAbRXUc5v152G7H"},{type:"Window",cx:.2916666666666667,cy:.3,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"8WmW65wXvFqVAFHZJFWsjr",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi1N2ddsqnGWnubKQgsZki"],rightJoints:["2mKkmtjixue6mVK8C5qdJT"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"adSAr7Jscp2bREMCNnKie9",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["14k9EDHAzKUWAkBFT1miXA"],rightJoints:["adSAr7Jscp2bREMCNnKie9"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi1N2ddsqnGWnubKQgsZki",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["adSAr7Jscp2bREMCNnKie9"],rightJoints:["14k9EDHAzKUWAkBFT1miXA"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"2mKkmtjixue6mVK8C5qdJT",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["2mKkmtjixue6mVK8C5qdJT"],rightJoints:["xi1N2ddsqnGWnubKQgsZki"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"14k9EDHAzKUWAkBFT1miXA",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Window",cx:-.2916666666666667,cy:.1,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"szq2y8vnCqxebu1Sp5dC5N",parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Window",cx:.2916666666666667,cy:.1,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"bm2Jq3Yh33GneBgsKAvMp7",parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{id:"w7eDFcjLuyPhMChKfhs6jB",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:3.4648066919643785,color:"#4d4d4d",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["14k9EDHAzKUWAkBFT1miXA"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:2.641654309594841,ceiling:!1},{type:"Foundation",cx:-11.120691028084872,cy:-.06445313166738242,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:25},labelHeight:8.5,labelSize:.8,id:"4TcV7zx5NzstoQTaTqoAzt",selected:!1,label:"25℃",showLabel:!0,color:"#999999"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",id:"1TYVF9JTXJtxWba41xgetC"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"afEtgeFVMoeDZdyxJU1psm"}],qFn=24,$Fn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[-.042868749999999976,0,0],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[-.042868749999999976,-.0001500066673827405,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-21.828926822512322,-33.873528421784314,4.788669771967834],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[11.438181824994281,-4.700464851624883,4.788669771967831],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:5.5,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-5,y:7,width:600,height:360},showDiurnalTemperaturePanel:!1,diurnalTemperaturePanelRect:{x:0,y:0,width:600,height:400},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:0,y:0,width:600,height:400},stickyNotePanelRect:{x:-1,y:0,width:277,height:63}},QFn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},ZFn=1,ekn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},tkn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},nkn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},okn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},rkn="Unknown",ikn=null,akn=null,lkn=null,skn=["Effect of thermostat setpoint"],ckn={docid:YFn,time:OFn,timestamp:_Fn,userid:VFn,owner:GFn,email:XFn,world:JFn,elements:KFn,sceneRadius:qFn,view:$Fn,graphState:QFn,evolutionMethod:ZFn,solarPanelArrayLayoutParams:ekn,solarPanelArrayLayoutConstraints:tkn,evolutionaryAlgorithmState:nkn,economicsParams:okn,modelType:rkn,modelAuthor:ikn,modelLabel:akn,modelDescription:lkn,notes:skn},ukn="uQrNcHUUR7GCUfUbuFogjq",dkn="02/04/2023 01:39 pm",fkn=1675535990373,hkn="QWecNcxhyvP6j6sBN11hBsfZDau1",pkn=null,gkn=null,mkn={solarRadiationHeatmapGridCellSize:.5,date:"7/22/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:12,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},ykn=[{type:"Human",name:"Jamelia",cx:-4.3683434199366005,cy:-14.38651482103353,cz:0,lx:.65,lz:1.8,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.65},{type:"Foundation",cx:-13.228758971915111,cy:.10702186833261693,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20,temperatureThreshold:5},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"A",showLabel:!0,labelHeight:9,labelSize:.8,color:"#666666"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"6YiUmdowinEDGE2jXwEcty",leftRoofHeight:6,rightRoofHeight:6,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Wall",cx:6.0818182264215075,cy:-.11406220740522244,cz:2.2301039869226305,lx:9.999999999999998,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.0818182264215075,-5.1140622074052215,.1],rightPoint:[6.081818226421507,4.885937792594777,.1],relativeAngle:1.5707963267948968,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"6YiUmdowinEDGE2jXwEcty",leftRoofHeight:6,rightRoofHeight:6,centerRoofHeight:[0,8.046374836825025],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"6YiUmdowinEDGE2jXwEcty",leftRoofHeight:6,rightRoofHeight:6,centerRoofHeight:[0,8.046374836825025],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"6YiUmdowinEDGE2jXwEcty",leftRoofHeight:6,rightRoofHeight:6,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Window",cx:-.375,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.6,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"1KMGfKAaAbRXUc5v152G7H",uValue:1.7034779999999998},{type:"Window",cx:.375,cy:.3,cz:.2916666666666667,lx:.08333333333333337,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"8WmW65wXvFqVAFHZJFWsjr",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Door",cx:0,cy:0,cz:-.2916666666666667,lx:.16666666666666666,ly:0,lz:.4166666666666667,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #6",color:"#ffffff",selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"gLG7BoTZHSewPba87UV4Za",uValue:1.135652},{type:"Window",cx:-.16666666666666666,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"vLVbxQBoEhW71qxT8m1C96",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.16666666666666666,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"26QzSovJr2WkHKUiErU1ER",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.375,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"dZ11kEn33ciPLMqva4wYhW",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.16666666666666666,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"oEPM7Qer3dagcgAZgTd83X",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.16666666666666666,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"nJe6q1fYHpVb61zzuXMiiq",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.375,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"atbMWVsRWU1gP4pFd8UmqE",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.3416666666666667,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"4Xcrc4Qc969xumwjdaTpEv",parentId:"wugyuZMsPdNUQJ1PdoxEGD",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"9r471ngxUS5HfZPQXAbspz",parentId:"wugyuZMsPdNUQJ1PdoxEGD",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.30833333333333335,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"nuMh9HUjsyggQDkK4K4z9r",parentId:"wugyuZMsPdNUQJ1PdoxEGD",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.3416666666666667,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"5TzjYq921EthYvgGjhkd95",parentId:"wugyuZMsPdNUQJ1PdoxEGD",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"i86kfMa5D3a95EHYr74Cik",parentId:"wugyuZMsPdNUQJ1PdoxEGD",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.30833333333333335,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"fes2JVoykppGjYbeBaK1t6",parentId:"wugyuZMsPdNUQJ1PdoxEGD",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.35833333333333334,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"hRvyn5tFnyKbZGmExP8ZBN",parentId:"xi9Zz1pobWAhkAdtkZFZBZ",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.35833333333333334,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"fHUqZ9dwKm5QsdBz4rQhkH",parentId:"xi9Zz1pobWAhkAdtkZFZBZ",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"hVPD3ovUCMHizYi7hHMynX",parentId:"xi9Zz1pobWAhkAdtkZFZBZ",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.3416666666666667,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"92r9RVUcqNvqTSSqzXVWe8",parentId:"xi9Zz1pobWAhkAdtkZFZBZ",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"88LWhfUeptGcLDGkhffTYu",parentId:"xi9Zz1pobWAhkAdtkZFZBZ",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.3416666666666667,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"jJyncTarX8t32trtWmHYJ8",parentId:"xi9Zz1pobWAhkAdtkZFZBZ",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.375,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"tbGfuWPSK8hFimiixh3gnq",parentId:"s4gNJy8vD8tdJGQTaw6DQj",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:2.0463748368250254,thickness:.2,rValue:2.8177645969011635,roofType:"Gable",roofStructure:"Default",wallsId:["s4gNJy8vD8tdJGQTaw6DQj"],textureType:"Roof Texture Default",color:"#333333",sideColor:"#ffffff",selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"6YiUmdowinEDGE2jXwEcty",ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],volumetricHeatCapacity:.2,ceiling:!1},{type:"Window",cx:.375,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"uPf27SYtJ3oEqK8uLnnYC4",parentId:"s4gNJy8vD8tdJGQTaw6DQj",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:0,cy:.3,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"41qtH3jyhy6TAYrTpcQ22r",parentId:"s4gNJy8vD8tdJGQTaw6DQj",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.375,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"c15PoZLmaL9G5281NC3Bky",parentId:"s4gNJy8vD8tdJGQTaw6DQj",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.375,cy:.3,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"e8J6XhFvtnTfamsfk7MdQo",parentId:"s4gNJy8vD8tdJGQTaw6DQj",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Door",cx:-4625929269271485e-33,cy:0,cz:-.2916666666666667,lx:.16666666666666666,ly:0,lz:.4166666666666667,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1.135652,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"s4gNJy8vD8tdJGQTaw6DQj",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"1Z9wCTEw4evBfgBWBx239G"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["iUbSPuuaLHTe92zf2RbbzH"],rightJoints:["b2z6LAysW1ypLiK23VhMbQ"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"t5aKJuTWqFhNtovV6QcVDQ",parentId:"9Lzok59gfWu44BJHP6NeDv",foundationId:"9Lzok59gfWu44BJHP6NeDv",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"5ujWfCT94pVpZ6u8JCHaJM",leftRoofHeight:6,rightRoofHeight:6,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Window",cx:-.375,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"6XAyQ1Y5un66zE9fws5TBK",parentId:"t5aKJuTWqFhNtovV6QcVDQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.375,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"5Fr8WLjKhMXxtEUSo3U3cz",parentId:"t5aKJuTWqFhNtovV6QcVDQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:0,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"bFA3kdwdbv23kgNuvqrBLu",parentId:"t5aKJuTWqFhNtovV6QcVDQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.375,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"2peuf57tgQn8h8KDddojmU",parentId:"t5aKJuTWqFhNtovV6QcVDQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.375,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"pRLjDR4NSZstZSY2CyZhG6",parentId:"t5aKJuTWqFhNtovV6QcVDQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Door",cx:-4625929269271485e-33,cy:0,cz:-.2916666666666667,lx:.16666666666666666,ly:0,lz:.4166666666666667,color:"#ffffff",textureType:"Door Texture #1",filled:!0,doorType:"Default",archHeight:1,normal:[0,1,0],rotation:[0,0,0],id:"fRfZQadrT6sohNBtnZQnjD",parentId:"t5aKJuTWqFhNtovV6QcVDQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",selected:!1,uValue:1.135652},{type:"Wall",cx:6.0818182264215075,cy:-.11406220740522244,cz:2.2301039869226305,lx:9.999999999999998,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["t1vsyYVv6oASAroVbtBJh8"],rightJoints:["t5aKJuTWqFhNtovV6QcVDQ"],leftPoint:[6.0818182264215075,-5.1140622074052215,.1],rightPoint:[6.081818226421507,4.885937792594777,.1],relativeAngle:1.5707963267948968,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"iUbSPuuaLHTe92zf2RbbzH",parentId:"9Lzok59gfWu44BJHP6NeDv",foundationId:"9Lzok59gfWu44BJHP6NeDv",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"5ujWfCT94pVpZ6u8JCHaJM",leftRoofHeight:6,rightRoofHeight:6,centerRoofHeight:[0,8.046374836825025],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Window",cx:-.35833333333333334,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"twjCCVvcJUWUtdX8G6XaEz",parentId:"iUbSPuuaLHTe92zf2RbbzH",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.35833333333333334,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"fJ9ef8TPTGwzuoD998nCxH",parentId:"iUbSPuuaLHTe92zf2RbbzH",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"75FMXmZGkavm2QX1w7Rd2n",parentId:"iUbSPuuaLHTe92zf2RbbzH",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.3416666666666667,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"digHAxUKfqtzZ8Hf1JBrDE",parentId:"iUbSPuuaLHTe92zf2RbbzH",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"pUavBYiArb55RaZvTqEZ7s",parentId:"iUbSPuuaLHTe92zf2RbbzH",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.3416666666666667,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"bMNcD6i8MyPWUstcj4RLAn",parentId:"iUbSPuuaLHTe92zf2RbbzH",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["t5aKJuTWqFhNtovV6QcVDQ"],rightJoints:["t1vsyYVv6oASAroVbtBJh8"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"b2z6LAysW1ypLiK23VhMbQ",parentId:"9Lzok59gfWu44BJHP6NeDv",foundationId:"9Lzok59gfWu44BJHP6NeDv",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"5ujWfCT94pVpZ6u8JCHaJM",leftRoofHeight:6,rightRoofHeight:6,centerRoofHeight:[0,8.046374836825025],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Window",cx:.3416666666666667,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"7af2qg5wEnfy5x3dVwJDa9",parentId:"b2z6LAysW1ypLiK23VhMbQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"8pzbRVzHdUJ21tt86EiuYq",parentId:"b2z6LAysW1ypLiK23VhMbQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.30833333333333335,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"9Rqpx9csAi6gzvsKmMevD7",parentId:"b2z6LAysW1ypLiK23VhMbQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.3416666666666667,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"sRtEGAvWiVdZjNF7cbimyK",parentId:"b2z6LAysW1ypLiK23VhMbQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.008333333333333337,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"cYa823h2xpVhLafAMFJLLp",parentId:"b2z6LAysW1ypLiK23VhMbQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.30833333333333335,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"eCrrhs7nC8ZLgf3kozqASz",parentId:"b2z6LAysW1ypLiK23VhMbQ",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:6,rValue:2.1133234476758727,volumetricHeatCapacity:.25,fill:"Full",leftJoints:["b2z6LAysW1ypLiK23VhMbQ"],rightJoints:["iUbSPuuaLHTe92zf2RbbzH"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"Wall Texture Default",color:"#ffffe0",normal:[0,0,1],rotation:[0,0,0],id:"t1vsyYVv6oASAroVbtBJh8",parentId:"9Lzok59gfWu44BJHP6NeDv",foundationId:"9Lzok59gfWu44BJHP6NeDv",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"5ujWfCT94pVpZ6u8JCHaJM",leftRoofHeight:6,rightRoofHeight:6,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:6,rightTopPartialHeight:6},{type:"Window",cx:-.375,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"xoY2sZ3zu3yaqNq4svSL83",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.375,cy:.1,cz:.2916666666666667,lx:.08333333333333337,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"shVdFBTLP3GUxKo2h9rQPd",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Door",cx:0,cy:0,cz:-.2916666666666667,lx:.16666666666666666,ly:0,lz:.4166666666666667,color:"#ffffff",textureType:"Door Texture #6",filled:!0,doorType:"Default",archHeight:1,normal:[0,1,0],rotation:[0,0,0],id:"miHyMDSBYSuj5NSFDxZf2d",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",selected:!1,uValue:1.135652},{type:"Window",cx:-.16666666666666666,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"izobe4AEhigpZU6WX5N4k5",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.16666666666666666,cy:.1,cz:.2916666666666667,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"o5YP1zidq8SX6PcUxxaAjL",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.375,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"4GhJEysBwSqkSWJpqyaJ48",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:-.16666666666666666,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"aAGJp2q5U3FuWTdYaSVjDf",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.16666666666666666,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"twPsG5mQU2qWwH6PZR3MFv",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{type:"Window",cx:.375,cy:.1,cz:-.2083333333333333,lx:.08333333333333333,ly:.2,lz:.24999999999999992,mullion:!0,mullionWidth:.06,mullionSpacing:.6,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"1Gwnr8y8qnWjyqse356de2",parentId:"t1vsyYVv6oASAroVbtBJh8",foundationId:"9Lzok59gfWu44BJHP6NeDv",tint:"#73D8FF",opacity:.6,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1,uValue:1.7034779999999998},{id:"5ujWfCT94pVpZ6u8JCHaJM",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:2.0463748368250254,color:"#333333",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"9Lzok59gfWu44BJHP6NeDv",foundationId:"9Lzok59gfWu44BJHP6NeDv",roofType:"Gable",roofStructure:"Default",textureType:"Roof Texture Default",thickness:.2,wallsId:["t5aKJuTWqFhNtovV6QcVDQ"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:2.8177645969011635,volumetricHeatCapacity:.2,ceiling:!1},{type:"Foundation",cx:13.117837499999993,cy:-.021318315185384407,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20,temperatureThreshold:5},labelHeight:9,labelSize:.8,showLabel:!0,id:"9Lzok59gfWu44BJHP6NeDv",selected:!1,label:"B",color:"#666666"},{type:"Solar Panel",pvModelName:"SPR-X21-335-BLK",trackerType:"None",relativeAzimuth:0,tiltAngle:.5235987755982988,orientation:"Landscape",drawSunBeam:!0,poleHeight:10,poleRadius:.05,poleSpacing:3,cx:.017473997824250177,cy:-.1848238594563359,cz:7.203451961471109,lx:10.906,ly:4.184,lz:.046,showLabel:!1,normal:[-25496209749856465e-33,-.3787787636615868,.9254872490742375],rotation:[.38847637916043065,0,-2220446049250313e-31],color:"#fff",frameColor:"white",parentType:"Roof",parentId:"5ujWfCT94pVpZ6u8JCHaJM",foundationId:"9Lzok59gfWu44BJHP6NeDv",id:"m7muU5PcHHSqA6qooFMWMX",selected:!1}],Akn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[-.042868749999999976,0,0],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[-.042868749999999976,-.0001500066673827405,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-21.205706148898816,-34.501280243521734,7.541149435690317],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[7.9613043217859705,4.9057140700953275,7.541149435690313],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:5.5,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-5,y:7,width:675,height:408},showDiurnalTemperaturePanel:!1,diurnalTemperaturePanelRect:{x:0,y:0,width:600,height:400},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:-1091,y:218,width:775,height:342},stickyNotePanelRect:{x:-3,y:-2,width:275,height:63}},wkn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},vkn=1,xkn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},bkn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},Skn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},Tkn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},Pkn=["Effect of rooftop solar panels"],Ckn={docid:ukn,time:dkn,timestamp:fkn,userid:hkn,owner:pkn,email:gkn,world:mkn,elements:ykn,view:Akn,graphState:wkn,evolutionMethod:vkn,solarPanelArrayLayoutParams:xkn,solarPanelArrayLayoutConstraints:bkn,evolutionaryAlgorithmState:Skn,economicsParams:Tkn,notes:Pkn},Rkn="4VyiQ32UEi5Uhg2actsJ7k",Hkn="05/22/2023 10:52 am",Mkn=1684767120478,Ikn="QWecNcxhyvP6j6sBN11hBsfZDau1",zkn=null,Dkn=null,Ekn={solarRadiationHeatmapGridCellSize:.5,date:"7/1/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:4,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},Fkn=[{type:"Human",name:"Jack",cx:-6.628211467880927,cy:-10.2119938102408,cz:4440892098500626e-31,lx:.42,lz:1.8,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.42},{type:"Foundation",cx:9.345387499999994,cy:.10743784147400248,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"Uninsulated floor",showLabel:!0,labelHeight:7,labelSize:.5,color:"#808080",rValue:1.7611028730632272},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{id:"45EQZzpZDmcCPwStDm4gUQ",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:1.9987267232669597,color:"#808080",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["py4fscALBHuoNNVWKoXS9c"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:1.7611028730632272,ceiling:!1},{type:"Foundation",cx:-9.302518749999996,cy:.06403695851719249,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},id:"fbqvzYqiEy79jeL8wsadib",selected:!1,hvacSystem:{thermostatSetpoint:20},label:"Insulated floor",labelHeight:7,showLabel:!0,labelSize:.5,color:"#808080",rValue:3.5222057461264544},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,leftJoints:["pPpJHGJ2bGVqLdA1FpXi4V"],rightJoints:["2RETAxyRMzZBEQkBGms56R"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"giYTP9Qg6uJ3yfkS1RoDqG",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,leftJoints:["beHqET5NN8aNdsuBncMpY7"],rightJoints:["giYTP9Qg6uJ3yfkS1RoDqG"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"pPpJHGJ2bGVqLdA1FpXi4V",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,leftJoints:["giYTP9Qg6uJ3yfkS1RoDqG"],rightJoints:["beHqET5NN8aNdsuBncMpY7"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"2RETAxyRMzZBEQkBGms56R",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,5.99872672326696],eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,leftJoints:["2RETAxyRMzZBEQkBGms56R"],rightJoints:["pPpJHGJ2bGVqLdA1FpXi4V"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"beHqET5NN8aNdsuBncMpY7",parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",selected:!1,roofId:"wqKadTHiLAV8a3mAejBhVp",wallStructure:"Default",structureSpacing:2,structureWidth:.1,structureColor:"white",opacity:.5,fill:"Full",rValue:2.1133234476758727,volumetricHeatCapacity:.1,leftRoofHeight:4,rightRoofHeight:4,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:1.9987267232669597,thickness:.2,roofType:"Gable",roofStructure:"Default",wallsId:["beHqET5NN8aNdsuBncMpY7"],textureType:"No Roof Texture",color:"#808080",sideColor:"#ffffff",selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,normal:[0,0,1],rotation:[0,0,0],parentId:"fbqvzYqiEy79jeL8wsadib",foundationId:"fbqvzYqiEy79jeL8wsadib",id:"wqKadTHiLAV8a3mAejBhVp",ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],rValue:1.7611028730632272,ceiling:!1},{type:"Window",cx:-.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.55,uValue:2,normal:[0,0,1],rotation:[0,0,0],parentId:"beHqET5NN8aNdsuBncMpY7",foundationId:"fbqvzYqiEy79jeL8wsadib",id:"2bkzpWVFhyLy2B93eQe6LC"},{type:"Window",cx:.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"2qrmNqnNqMrnaf9yVKwntp",parentId:"beHqET5NN8aNdsuBncMpY7",foundationId:"fbqvzYqiEy79jeL8wsadib",tint:"#73D8FF",opacity:.55,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Window",cx:-.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.55,uValue:2,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"hQgFUEAKKCuxnfg7DfAtUD"},{type:"Window",cx:.3125,cy:.3,cz:0,lx:.125,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"3F32WEzwgnaEKesshW1B9d",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.55,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"beHqET5NN8aNdsuBncMpY7",foundationId:"fbqvzYqiEy79jeL8wsadib",id:"3uhARcmLhJJ7AF4oGmRXFJ"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #1",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"rJ589nLaG9XWmTRZhwLvTz"}],kkn=22,Lkn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[0,0,0],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[0,-.0001500066673827405,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-17.829241192466892,-21.107034059971184,4.718921354569243],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[4.327600264578368,2.7041849125647666,4.718921354569243],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:5.5,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-5,y:7,width:600,height:360},showDiurnalTemperaturePanel:!0,diurnalTemperaturePanelRect:{x:-1,y:1,width:517,height:333},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:0,y:0,width:600,height:400},heatFluxScaleFactor:10,stickyNotePanelRect:{x:-2,y:344,width:517,height:60}},Wkn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},Nkn=1,Ukn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},jkn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},Bkn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},Ykn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},Okn="Unknown",_kn=null,Vkn=null,Gkn=null,Xkn=["Effect of ground temperature and floor insulation"],Jkn={docid:Rkn,time:Hkn,timestamp:Mkn,userid:Ikn,owner:zkn,email:Dkn,world:Ekn,elements:Fkn,sceneRadius:kkn,view:Lkn,graphState:Wkn,evolutionMethod:Nkn,solarPanelArrayLayoutParams:Ukn,solarPanelArrayLayoutConstraints:jkn,evolutionaryAlgorithmState:Bkn,economicsParams:Ykn,modelType:Okn,modelAuthor:_kn,modelLabel:Vkn,modelDescription:Gkn,notes:Xkn},Kkn="gTE5M2QuRpvxtj7gFjQvBp",qkn="05/22/2023 10:53 am",$kn=1684767216212,Qkn="QWecNcxhyvP6j6sBN11hBsfZDau1",Zkn=null,eLn=null,tLn={solarRadiationHeatmapGridCellSize:.5,date:"6/10/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:4,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},nLn=[{type:"Human",name:"Jack",cx:-6.628211467880927,cy:-10.2119938102408,cz:4440892098500626e-31,lx:.42,lz:1.8,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.42},{type:"Foundation",cx:11.171058971915114,cy:.06430302499558693,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"A",showLabel:!0,labelHeight:8.5,labelSize:.8,color:"#666666"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{id:"45EQZzpZDmcCPwStDm4gUQ",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:3.4648066919643785,color:"#4d4d4d",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["py4fscALBHuoNNVWKoXS9c"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:2.641654309594841,ceiling:!1},{type:"Window",cx:-.2916666666666667,cy:.3,cz:0,lx:.16666666666666666,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.5,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"1KMGfKAaAbRXUc5v152G7H"},{type:"Window",cx:.2916666666666667,cy:.3,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"8WmW65wXvFqVAFHZJFWsjr",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Tree",name:"Maple",cx:11.597557786217195,cy:-9.10270743636709,cz:0,lx:11.852806241793175,lz:12.934464914753796,normal:[0,1,0],rotation:[0,0,0],parentId:"Ground",id:"o3k54VQM47Q54nSJAwrmEn",selected:!1},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi1N2ddsqnGWnubKQgsZki"],rightJoints:["2mKkmtjixue6mVK8C5qdJT"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"adSAr7Jscp2bREMCNnKie9",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["14k9EDHAzKUWAkBFT1miXA"],rightJoints:["adSAr7Jscp2bREMCNnKie9"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"xi1N2ddsqnGWnubKQgsZki",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["adSAr7Jscp2bREMCNnKie9"],rightJoints:["14k9EDHAzKUWAkBFT1miXA"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"2mKkmtjixue6mVK8C5qdJT",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,centerRoofHeight:[0,7.4648066919643785],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:4,rValue:1.7611028730632272,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["2mKkmtjixue6mVK8C5qdJT"],rightJoints:["xi1N2ddsqnGWnubKQgsZki"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#cccccc",normal:[0,0,1],rotation:[0,0,0],id:"14k9EDHAzKUWAkBFT1miXA",parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"w7eDFcjLuyPhMChKfhs6jB",leftRoofHeight:4,rightRoofHeight:4,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:4,rightTopPartialHeight:4},{type:"Window",cx:-.2916666666666667,cy:.1,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"szq2y8vnCqxebu1Sp5dC5N",parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Window",cx:.2916666666666667,cy:.1,cz:0,lx:.16666666666666666,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"bm2Jq3Yh33GneBgsKAvMp7",parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",tint:"#73D8FF",opacity:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{id:"w7eDFcjLuyPhMChKfhs6jB",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:3.4648066919643785,color:"#4d4d4d",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"4TcV7zx5NzstoQTaTqoAzt",foundationId:"4TcV7zx5NzstoQTaTqoAzt",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.2,wallsId:["14k9EDHAzKUWAkBFT1miXA"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:2.641654309594841,ceiling:!1},{type:"Foundation",cx:-11.120691028084872,cy:-.06445313166738242,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20},labelHeight:8.5,labelSize:.8,id:"4TcV7zx5NzstoQTaTqoAzt",selected:!1,label:"B",showLabel:!0,color:"#666666"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #14",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"14k9EDHAzKUWAkBFT1miXA",foundationId:"4TcV7zx5NzstoQTaTqoAzt",id:"p8R6iYpCmdMa5Cs4zuS1P6"},{type:"Door",cx:0,cy:0,cz:-.125,lx:.16666666666666666,ly:0,lz:.75,doorType:"Default",filled:!0,archHeight:1,textureType:"Door Texture #14",color:"#ffffff",uValue:1,selected:!1,lineWidth:.2,lineColor:"#000000",showLabel:!1,normal:[0,1,0],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"56LE4zBekLnvJc9jFEm7Yu"}],oLn=24,rLn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[-.042868749999999976,0,0],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[-.042868749999999976,-.0001500066673827405,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-25.541858353538785,-23.926978121750373,5.679305436989464],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[13.47063227815913,1.5150691532035274,5.679305436989461],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:5.5,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-5,y:7,width:600,height:360},showDiurnalTemperaturePanel:!1,diurnalTemperaturePanelRect:{x:0,y:0,width:600,height:400},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:0,y:0,width:600,height:400},stickyNotePanelRect:{x:-3,y:-2,width:203,height:64}},iLn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},aLn=1,lLn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},sLn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},cLn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},uLn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},dLn="Unknown",fLn=null,hLn=null,pLn=null,gLn=["Effect of trees"],mLn={docid:Kkn,time:qkn,timestamp:$kn,userid:Qkn,owner:Zkn,email:eLn,world:tLn,elements:nLn,sceneRadius:oLn,view:rLn,graphState:iLn,evolutionMethod:aLn,solarPanelArrayLayoutParams:lLn,solarPanelArrayLayoutConstraints:sLn,evolutionaryAlgorithmState:cLn,economicsParams:uLn,modelType:dLn,modelAuthor:fLn,modelLabel:hLn,modelDescription:pLn,notes:gLn},yLn="21TNkEaRQtmkMpHquDpRhe",ALn="03/21/2023 12:30 pm",wLn=1679416202848,vLn="QWecNcxhyvP6j6sBN11hBsfZDau1",xLn=null,bLn=null,SLn={solarRadiationHeatmapGridCellSize:.25,date:"1/22/2022, 12:00:00 PM",cspTimesPerHour:4,noAnimationForHeatmapSimulation:!1,cspGridCellSize:.5,dustLoss:.05,address:"Natick, MA",cspDaysPerYear:4,ground:{thermalDiffusivity:.05,albedo:.3,snowReflectionFactors:[0,0,0,0,0,0,0,0,0,0,0,0]},daysPerYear:12,latitude:42.2844063,noAnimationForSensorDataCollection:!1,timesPerHour:1,discretization:"Approximate",airAttenuationCoefficient:.01,noAnimationForSolarPanelSimulation:!1,solarPanelVisibilityGridCellSize:.2,pvGridCellSize:.5,name:"default",longitude:-71.3488548,diurnalTemperatureModel:2},TLn=[{type:"Human",name:"Judd",cx:2.5001103094985826,cy:-6.058721988130646,cz:.030962420627473897,lx:.544,lz:1.68,normal:[0,1,0],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",id:"3LYQCPYTZ6WYqLSGF4X7Lr",selected:!1,ly:.42},{type:"Foundation",cx:-10.117024999999996,cy:.27838070851727714,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20,temperatureThreshold:5},id:"iFATUUjMA7c8wHKwioiCvi",selected:!1,label:"No Ceiling",showLabel:!0,labelHeight:6,labelSize:.5,color:"#808080"},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],rightJoints:["wugyuZMsPdNUQJ1PdoxEGD"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"s4gNJy8vD8tdJGQTaw6DQj",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:3,rightRoofHeight:3,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["py4fscALBHuoNNVWKoXS9c"],rightJoints:["s4gNJy8vD8tdJGQTaw6DQj"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"xi9Zz1pobWAhkAdtkZFZBZ",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:3,rightRoofHeight:3,centerRoofHeight:[0,5.068830689450057],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["s4gNJy8vD8tdJGQTaw6DQj"],rightJoints:["py4fscALBHuoNNVWKoXS9c"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"wugyuZMsPdNUQJ1PdoxEGD",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:3,rightRoofHeight:3,centerRoofHeight:[0,5.068830689450057],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["wugyuZMsPdNUQJ1PdoxEGD"],rightJoints:["xi9Zz1pobWAhkAdtkZFZBZ"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"py4fscALBHuoNNVWKoXS9c",parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"45EQZzpZDmcCPwStDm4gUQ",leftRoofHeight:3,rightRoofHeight:3,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{id:"45EQZzpZDmcCPwStDm4gUQ",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,rise:2.068830689450057,color:"#4d4d4d",sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"iFATUUjMA7c8wHKwioiCvi",foundationId:"iFATUUjMA7c8wHKwioiCvi",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.1,wallsId:["py4fscALBHuoNNVWKoXS9c"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,rValue:1.7611028730632272,ceiling:!1},{type:"Window",cx:-.3125,cy:.3,cz:.08333333333333333,lx:.125,ly:.2,lz:.5,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,selected:!1,lineWidth:.2,lineColor:"black",showLabel:!1,color:"white",tint:"#73D8FF",opacity:.55,uValue:2,normal:[0,0,1],rotation:[0,0,0],parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",id:"hQgFUEAKKCuxnfg7DfAtUD"},{type:"Window",cx:.3125,cy:.3,cz:.08333333333333333,lx:.125,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"3F32WEzwgnaEKesshW1B9d",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",tint:"#73D8FF",opacity:.55,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Door",cx:-.029166666666666664,cy:0,cz:-.08333333333333333,lx:.10833333333333334,ly:0,lz:.8333333333333334,color:"white",uValue:1.7034779999999998,textureType:"Door Texture #17",filled:!0,doorType:"Arched",archHeight:1,normal:[0,0,1],rotation:[0,0,0],id:"9j89u3pSufVm3Q5kpF4NcM",parentId:"py4fscALBHuoNNVWKoXS9c",foundationId:"iFATUUjMA7c8wHKwioiCvi",selected:!1},{type:"Human",name:"Jena",cx:2.5001103094985826,cy:-6.058721988130646,cz:.030962420627473897,lx:.695,ly:.42,lz:1.6,normal:[0,1,0],rotation:[0,0,0],parentId:"cfvC81ormzBEgA9Ah4eP3v",id:"34EHkp2Lb8b2vnEKfniznR",selected:!1},{type:"Wall",cx:.08181822642150738,cy:4.8859377925947785,cz:2.2408122612280286,lx:12,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["rHyZXvwyEPAa7dU7nYmXpR"],rightJoints:["jvSvdwWqKHJqgaZtgavr3X"],leftPoint:[6.081818226421507,4.885937792594777,.1],rightPoint:[-5.9181817735784925,4.8859377925947785,.1],relativeAngle:3.141592653589793,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"8NQNpFkXNGAXtcTwXhtHNW",parentId:"cfvC81ormzBEgA9Ah4eP3v",foundationId:"cfvC81ormzBEgA9Ah4eP3v",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"gCFHHnVKnRgFUFksjrmZCm",leftRoofHeight:3,rightRoofHeight:3,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{type:"Wall",cx:6.081818226421506,cy:-.114062207405222,cz:2.2301039869226305,lx:10,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["sb7GHiMmhgNyZJdQ71BL5y"],rightJoints:["8NQNpFkXNGAXtcTwXhtHNW"],leftPoint:[6.081818226421504,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,4.8859377925947785,.1],relativeAngle:1.5707963267948963,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"rHyZXvwyEPAa7dU7nYmXpR",parentId:"cfvC81ormzBEgA9Ah4eP3v",foundationId:"cfvC81ormzBEgA9Ah4eP3v",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"gCFHHnVKnRgFUFksjrmZCm",leftRoofHeight:3,rightRoofHeight:3,centerRoofHeight:[0,5.068830689450057],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{type:"Wall",cx:-5.9181817735784925,cy:-.114062207405222,cz:2.228839888904333,lx:10,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["8NQNpFkXNGAXtcTwXhtHNW"],rightJoints:["sb7GHiMmhgNyZJdQ71BL5y"],leftPoint:[-5.918181773578492,4.8859377925947785,.1],rightPoint:[-5.9181817735784925,-5.1140622074052215,.1],relativeAngle:4.71238898038469,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"jvSvdwWqKHJqgaZtgavr3X",parentId:"cfvC81ormzBEgA9Ah4eP3v",foundationId:"cfvC81ormzBEgA9Ah4eP3v",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"gCFHHnVKnRgFUFksjrmZCm",leftRoofHeight:3,rightRoofHeight:3,centerRoofHeight:[0,5.068830689450057],selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{type:"Wall",cx:.08181822642150782,cy:-5.1140622074052215,cz:2.268765007024547,lx:12,ly:.2,lz:3,rValue:2.1133234476758727,volumetricHeatCapacity:.1,fill:"Full",leftJoints:["jvSvdwWqKHJqgaZtgavr3X"],rightJoints:["rHyZXvwyEPAa7dU7nYmXpR"],leftPoint:[-5.9181817735784925,-5.1140622074052215,.1],rightPoint:[6.0818182264215075,-5.1140622074052215,.1],relativeAngle:0,textureType:"No Wall Texture",color:"#ffffff",normal:[0,0,1],rotation:[0,0,0],id:"sb7GHiMmhgNyZJdQ71BL5y",parentId:"cfvC81ormzBEgA9Ah4eP3v",foundationId:"cfvC81ormzBEgA9Ah4eP3v",wallStructure:"Default",structureSpacing:2,structureColor:"white",structureWidth:.1,opacity:.5,roofId:"gCFHHnVKnRgFUFksjrmZCm",leftRoofHeight:3,rightRoofHeight:3,selected:!1,eavesLength:.2,parapet:{display:!1,color:"white",textureType:"No Wall Texture",parapetHeight:1,copingsWidth:.5,copingsHeight:.1},leftUnfilledHeight:.5,rightUnfilledHeight:.5,leftTopPartialHeight:3,rightTopPartialHeight:3},{type:"Window",cx:-.3125,cy:.1,cz:.08333333333333333,lx:.125,ly:.2,lz:.5,uValue:2,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"q6p3CCHJFvsqrEsXwbRh1R",parentId:"sb7GHiMmhgNyZJdQ71BL5y",foundationId:"cfvC81ormzBEgA9Ah4eP3v",tint:"#73D8FF",opacity:.55,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Window",cx:.3125,cy:.1,cz:.08333333333333333,lx:.125,ly:.2,lz:.5,mullion:!0,mullionWidth:.06,mullionSpacing:1,mullionColor:"white",frame:!0,frameWidth:.1,windowType:"Default",archHeight:1,color:"white",normal:[0,0,1],rotation:[0,0,0],id:"j1XnXywfGpFArNKZPbAhkm",parentId:"sb7GHiMmhgNyZJdQ71BL5y",foundationId:"cfvC81ormzBEgA9Ah4eP3v",tint:"#73D8FF",opacity:.55,shutter:{showLeft:!1,showRight:!1,color:"grey",width:.5},selected:!1},{type:"Door",cx:4625929269271485e-33,cy:0,cz:-.08333333333333333,lx:.10833333333333334,ly:0,lz:.8333333333333334,color:"white",uValue:1.7034779999999998,textureType:"Door Texture #17",filled:!0,doorType:"Arched",archHeight:1,normal:[0,0,1],rotation:[0,0,0],id:"6uoZg4uoFLaTiYnPcJZ3V9",parentId:"sb7GHiMmhgNyZJdQ71BL5y",foundationId:"cfvC81ormzBEgA9Ah4eP3v",selected:!1},{id:"gCFHHnVKnRgFUFksjrmZCm",type:"Roof",cx:0,cy:0,cz:0,lx:0,ly:0,lz:0,ceiling:!0,rise:2.068830689450057,color:"#4d4d4d",rValue:1.7611028730632272,sideColor:"#ffffff",normal:[0,0,1],rotation:[0,0,0],parentId:"cfvC81ormzBEgA9Ah4eP3v",foundationId:"cfvC81ormzBEgA9Ah4eP3v",roofType:"Gable",roofStructure:"Default",textureType:"No Roof Texture",thickness:.1,wallsId:["sb7GHiMmhgNyZJdQ71BL5y"],ridgeLeftPoint:[0,1],ridgeRightPoint:[0,1],selected:!1,ceilingRValue:3.5222057461264544},{type:"Foundation",cx:10.177578528084874,cy:.23562811833261754,cz:.05,lx:16.34049294383023,ly:14.404432132963985,lz:.1,normal:[0,0,1],rotation:[0,0,0],parentId:"Ground",color:"#808080",solarUpdraftTower:{},solarAbsorberPipe:{},solarPowerTower:{},hvacSystem:{thermostatSetpoint:20,temperatureThreshold:5},labelHeight:6,labelSize:.5,showLabel:!0,id:"cfvC81ormzBEgA9Ah4eP3v",selected:!1,label:"Insulated Ceiling"}],PLn=23,CLn={dailyPvYieldPanelX:0,mapPanelY:0,dailyFresnelReflectorYieldPanelX:0,panCenter2D:[0,.08573749999997851,4287065548240426e-23],yearlyHeliostatYieldPanelY:0,mapPanelX:0,yearlyHeliostatYieldPanelX:0,cameraPosition2D:[0,.08558749333259577,150],theme:"Default",showDesignInfoPanel:!1,weatherPanelX:0,dailyParabolicTroughYieldPanelX:0,mapWeatherStations:!1,stickyNotePanelX:0,showDailyHeliostatYieldPanel:!1,mapZoom:18,showYearlyParabolicTroughYieldPanel:!1,dailyHeliostatYieldPanelX:0,showDailyParabolicDishYieldPanel:!1,cameraPosition:[-19.73331041183491,-15.606053038152623,2.569638957524864],showYearlyHeliostatYieldPanel:!1,orthographic:!1,dailyHeliostatYieldPanelY:0,dailyParabolicTroughYieldPanelY:0,heliodonPanelY:439,yearlyParabolicTroughYieldPanelY:0,showWeatherPanel:!1,groundImage:!1,yearlyLightSensorPanelX:0,ambientLightIntensity:.1,yearlyFresnelReflectorYieldPanelX:0,enableRotate:!0,dailyLightSensorPanelX:0,heliodon:!1,solarRadiationHeatMapReflectionOnly:!1,cameraZoom:23.327015599941696,mapType:"roadmap",showMapPanel:!1,yearlyParabolicDishYieldPanelY:0,showSiteInfoPanel:!0,showDailyParabolicTroughYieldPanel:!1,showDailyFresnelReflectorYieldPanel:!1,showYearlyLightSensorPanel:!1,autoRotate:!1,heliodonPanelX:-14,showStickyNotePanel:!0,showDailyLightSensorPanel:!1,visibilityResultsPanelX:0,yearlyPvYieldPanelY:0,showDailyPvYieldPanel:!1,visibilityResultsPanelY:0,showSunAngles:!1,dailyFresnelReflectorYieldPanelY:0,weatherPanelY:0,dailyLightSensorPanelY:0,groundColor:"#16a5a5",mapTilt:0,showYearlyPvYieldPanel:!1,dailyParabolicDishYieldPanelY:0,yearlyLightSensorPanelY:0,yearlyParabolicTroughYieldPanelX:0,dailyPvYieldPanelY:0,yearlyPvYieldPanelX:0,yearlyParabolicDishYieldPanelX:0,shadowEnabled:!0,showInstructionPanel:!1,panCenter:[3.388120187568702,1.9907625161279443,1.1720990830439746],yearlyFresnelReflectorYieldPanelY:0,showHeliodonPanel:!1,axes:!0,solarRadiationHeatMapMaxValue:3,dailyParabolicDishYieldPanelX:0,showSolarPanelVisibilityResultsPanel:!1,stickyNotePanelY:0,showYearlyParabolicDishYieldPanel:!1,showYearlyFresnelReflectorYieldPanel:!1,showDailyBuildingEnergyPanel:!0,directLightIntensity:1,dailyBuildingEnergyPanelRect:{x:-2,y:3,width:510,height:354},showDiurnalTemperaturePanel:!1,diurnalTemperaturePanelRect:{x:0,y:0,width:600,height:400},showYearlyBuildingEnergyPanel:!1,yearlyBuildingEnergyPanelRect:{x:0,y:0,width:600,height:400},heatFluxScaleFactor:2,stickyNotePanelRect:{x:-4,y:2,width:397,height:65}},RLn={dailyPvIndividualOutputs:!1,yearlyPvIndividualOutputs:!1,dailyParabolicDishIndividualOutputs:!1,yearlyParabolicDishIndividualOutputs:!1,dailyParabolicTroughIndividualOutputs:!1,yearlyParabolicTroughIndividualOutputs:!1,dailyFresnelReflectorIndividualOutputs:!1,yearlyFresnelReflectorIndividualOutputs:!1,dailyHeliostatIndividualOutputs:!1,yearlyHeliostatIndividualOutputs:!1,dailyUpdraftTowerIndividualOutputs:!1,yearlyUpdraftTowerIndividualOutputs:!1},HLn=1,MLn={pvModelName:"SPR-X21-335-BLK",rowAxis:"Zonal",orientation:"Landscape",tiltAngle:0,rowsPerRack:1,interRowSpacing:2,poleHeight:1,poleSpacing:3},ILn={minimumInterRowSpacing:2,maximumInterRowSpacing:10,minimumRowsPerRack:1,maximumRowsPerRack:6,minimumTiltAngle:-1.5707963267948966,maximumTiltAngle:1.5707963267948966,poleHeight:1,poleSpacing:5,orientation:"Landscape",pvModelName:"CS6X-355P-FG",rowAxis:"Zonal"},zLn={geneticAlgorithmParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,selectionMethod:1,searchMethod:1,populationSize:20,maximumGenerations:5,selectionRate:.5,crossoverRate:.5,mutationRate:.1,convergenceThreshold:.01,localSearchRadius:.1},particleSwarmOptimizationParams:{problem:"Solar Panel Tilt Angle",objectiveFunctionType:1,searchMethod:1,swarmSize:20,maximumSteps:5,vmax:.01,inertia:.8,cognitiveCoefficient:.1,socialCoefficient:.1,convergenceThreshold:.01,localSearchRadius:.1}},DLn={projectLifeSpan:25,electricitySellingPrice:.25,operationalCostPerUnit:.15},ELn="Unknown",FLn=null,kLn=null,LLn=null,WLn=["Thermal envelope vs. building envelope"],NLn={docid:yLn,time:ALn,timestamp:wLn,userid:vLn,owner:xLn,email:bLn,world:SLn,elements:TLn,sceneRadius:PLn,view:CLn,graphState:RLn,evolutionMethod:HLn,solarPanelArrayLayoutParams:MLn,solarPanelArrayLayoutConstraints:ILn,evolutionaryAlgorithmState:zLn,economicsParams:DLn,modelType:ELn,modelAuthor:FLn,modelLabel:kLn,modelDescription:LLn,notes:WLn},ULn=t=>{let e;switch(t){case"sun_angles":e=trn;break;case"insolation_and_climate":e=yrn;break;case"solar_radiation_to_box":e=Ern;break;case"sun_beam_at_center":e=Krn;break;case"thermal_vs_building_envelope":e=NLn;break;case"effect_house_size":e=UDn;break;case"effect_house_orientation":e=lEn;break;case"effect_wall_roof_insulation":e=MEn;break;case"effect_roof_color":e=$En;break;case"effect_eaves_overhang_length":e=wFn;break;case"effect_window_shgc":e=BFn;break;case"effect_thermostat_setpoint":e=ckn;break;case"effect_solar_panels":e=Ckn;break;case"effect_ground_temperature":e=Jkn;break;case"effect_trees":e=mLn;break;case"office_building_01":e=M5n;break;case"hotel_01":e=V5n;break;case"spanish_style_hotel":e=h9n;break;case"apartment_building_01":e=k9n;break;case"white_house":e=A2n;break;case"harold_washington_college":e=V2n;break;case"bilim_mersin_turkiye":e=h5n;break;case"south_burlington_high_school":e=Q9n;break;case"mescalero_apache_school":e=g3n;break;case"city_block_heatmap":e=P3n;break;case"chicago_skyline":e=Q3n;break;case"vegetative_buffer_01":e=g8n;break;case"solar_canopy_form_factors":e=G7n;break;case"solar_canopy_over_bleachers":e=cvn;break;case"solar_bus_stop":e=zvn;break;case"solar_facade_tesla":e=Exn;break;case"solar_canopy_over_garage":e=mxn;break;case"bipv_01":e=Jvn;break;case"floatovoltaics":e=qxn;break;case"agriculture_solar_wind_colocation":e=Sbn;break;case"effect_tilt_angle_solar_panel":e=D8n;break;case"effect_azimuth_solar_panel":e=K8n;break;case"effect_azimuth_parabolic_trough":e=fwn;break;case"effect_latus_rectum_parabolic_trough":e=Hwn;break;case"parabolic_dish_focus_sunlight":e=FSn;break;case"effect_orientation_solar_panel":e=Vwn;break;case"solar_panel_types":e=din;break;case"vertical_bifacial_solar_panels":e=Lin;break;case"compare_monofacial_bifacial_solar_panels":e=lan;break;case"why_solar_array":e=l7n;break;case"solar_panel_array_auto_layout":e=M7n;break;case"inter_row_spacing":e=jbn;break;case"rooftop_solar_panels":e=Tan;break;case"solar_panels_over_canal":e=msn;break;case"solar_noise_barrier":e=Zln;break;case"rainbow_swash_solar_farm":e=Ban;break;case"mickey_mouse_solar_farm":e=rln;break;case"solar_farm_hsat_array":e=vln;break;case"solar_farm_aadat_array":e=Lln;break;case"solar_trackers":e=Esn;break;case"nevada_solar_one_parabolic_troughs":e=ASn;break;case"tooele_parabolic_dish_array":e=qSn;break;case"ps10_solar_power_tower":e=nSn;break;case"linear_fresnel_reflectors":e=hTn;break;case"linear_fresnel_reflectors_two_absorbers":e=ITn;break;case"effect_absorber_pipe_height":e=XTn;break;case"effect_azimuth_fresnel_reflector":e=uPn;break;case"cosine_efficiency_heliostats":e=DPn;break;case"shadowing_blocking_heliostats":e=eCn;break;case"effect_solar_power_tower_height":e=bCn;break;case"solar_power_tower":e=UCn;break;case"solar_updraft_tower":e=PHn;break;case"solar_updraft_tower_city":e=kHn;break;case"effect_blade_number":e=sMn;break;case"effect_pitch_angle":e=kMn;break;case"bird_safe_blade_design":e=sIn;break;case"offshore_wind_farm":e=kIn;break;case"cape_cod_with_shed_dormer":e=xcn;break;case"mansard_roof_with_dormers":e=Ocn;break;case"t_shaped_house":e=d0n;break;case"all_roof_types":e=qsn;break;case"a_frame_house":e=g1n;break;case"half_timbered_house":e=W1n;break;case"dutch_gable_roof":e=Xpn;break;case"combination_roof_vs_bonnet_roof":e=rgn;break;case"butterfly_roof_house":e=Cgn;break;case"gable_roof_vs_hip_roof":e=Xgn;break;case"gable_and_valley_roof":e=pmn;break;case"clerestory_roof":e=kmn;break;case"monitor_roof":e=oyn;break;case"colonial_vs_saltbox":e=Tyn;break;case"gambrel_roof_vs_mansard_roof":e=Vyn;break;case"colonial_house":e=$hn;break;case"dutch_colonial_house":e=bpn;break;case"cape_cod_with_garage":e=E0n;break;case"greenhouse":e=v6n;break;case"solarium":e=dfn;break;case"pavilion":e=X6n;break;case"octagonal_pagoda":e=uAn;break;case"ocean_front":e=RAn;break;case"mosque_01":e=Hfn;break;case"church_01":e=Vfn;break;case"cathedral_01":e=shn;break;case"cathedral_02":e=Ihn;break;case"adobe_taos_house":e=q0n;break;case"egyptian_pyramids":e=_An;break;case"mayan_pyramid":e=h4n;break;case"si_o_se_pol":e=I4n;break;case"stacked_cuboids":e=Q4n;break;case"barn_house":e=xdn;break;case"ranch_house":e=Sun;break;case"bonnet_house":e=Jun;break;case"modern_house_01":e=Odn;break;case"solar_radiation_predicted_vs_measured":e=tRn;break;case"bestest_case_600":e=ARn;break;case"bestest_case_610":e=kRn;break;case"bestest_case_620":e=QRn;break;case"bestest_case_630":e=gHn;break;case"tucson_sundt_station":e=VIn;break;case"ai_tilt_angle_one_row":e=szn;break;case"ai_tilt_angles_multiple_rows":e=Pzn;break;case"ai_solar_farm_design":e=Yzn;break;case"ai_solar_farm_design_block":e=iDn;break;case"ai_fitchburg_solar_farm":e=bDn;break}return e},eM=()=>{const t=H(fn),e=H(LYe),n=H(WYe),o=H(yp),r=Jt(),i=me.isMac(),a=()=>{if(n&&n.length>0){const l=e();if(l.length>0){const s={name:"Paste to Point",timestamp:Date.now(),pastedElements:l.map(c=>({...c})),undo:()=>{for(const c of s.pastedElements)o(c.id,!1)},redo:()=>{t(c=>{c.elements.push(...s.pastedElements),c.selectedElement=s.pastedElements[0],c.updateElementOnRoofFlag=!0})}};H.getState().addUndoable(s)}}};return h.jsxs(rn,{onClick:a,children:[Y.t("word.Paste",r),h.jsxs("span",{style:{paddingLeft:"4px",fontSize:9},children:["(",i?"⌘":"Ctrl","+V)"]})]})},Ld=()=>{const t=H(fn),e=H(kYe),n=H(da),o=Jt(),r=me.isMac(),i=()=>{const a=H.getState().selectedElement;a&&(e(a.id),n&&t(l=>{l.actionInfo={name:"Copy",timestamp:new Date().getTime(),elementId:a.id,elementType:a.type}}))};return h.jsxs(rn,{onClick:i,children:[Y.t("word.Copy",o),h.jsxs("span",{style:{paddingLeft:"4px",fontSize:9},children:["(",r?"⌘":"Ctrl","+C)"]})]})},Wd=()=>{const t=H(fn),e=H(yp),n=me.isMac(),o=Jt(),r=()=>{const i=H.getState().selectedElement;if(!(!i||i.type===z.Roof))if(i.locked)hn(Y.t("message.ThisElementIsLocked",o));else{const a=e(i.id,!0);if(a.length===0)return;if(me.isElementTriggerAutoDeletion(a[0]))Fn.getState().setListenToAutoDeletionByCut(!0),ht.getState().setPrimitiveStore("selectedElementId",i.id);else{const l={name:"Cut",timestamp:Date.now(),deletedElements:a,selectedElementId:i.id,undo:()=>{const s=l.deletedElements;if(s.length===0)return;const c=s.find(u=>u.id===l.selectedElementId);c&&t(u=>{for(const d of s)u.elements.push(d);if(c.type===z.Wall){const d=c;let f=null,p=null;if(d.leftJoints.length>0&&(f=d.leftJoints[0]),d.rightJoints.length>0&&(p=d.rightJoints[0]),f||p)for(const g of u.elements)g.id===f&&g.type===z.Wall&&(g.rightJoints[0]=d.id),g.id===p&&g.type===z.Wall&&(g.leftJoints[0]=d.id)}})},redo:()=>{l.deletedElements&&l.deletedElements.length>0&&e(l.deletedElements[0].id,!0)}};H.getState().addUndoable(l)}}};return h.jsxs(rn,{onClick:r,children:[Y.t("word.Cut",o),h.jsxs("span",{style:{paddingLeft:"4px",fontSize:9},children:["(",n?"⌘":"Ctrl","+X)"]})]})},Ju=({selectedElement:t})=>{const e=Jt(),n=H(Fwt),o=H(En),r=a=>{t&&n(t.id,a)},i=a=>{const l=a.target.checked,s={name:"Lock",timestamp:Date.now(),checked:l,selectedElementId:t==null?void 0:t.id,selectedElementType:t==null?void 0:t.type,undo:()=>{r(!s.checked)},redo:()=>{r(s.checked)}};o(s),r(l)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.locked,onChange:i,children:Y.t("word.Lock",e)})})},rn=({stayAfterClick:t,noPadding:e,fontWeight:n,textSelectable:o=!0,update:r,onClick:i,children:a})=>{const l=s=>{i&&i(s),t&&s.stopPropagation(),r&&ht.getState().updateContextMenu()};return h.jsx("span",{onClick:l,style:{userSelect:o?"auto":"none",display:"inline-block",fontWeight:n,width:"100%",paddingLeft:e?"0px":"24px"},children:a})},to=({Dialog:t,noPadding:e,children:n})=>{const[o,r]=m.useState(!1),i=()=>{H.getState().setApplyCount(0),r(!0)};return h.jsxs(h.Fragment,{children:[h.jsx(rn,{noPadding:e,onClick:i,children:n}),o&&h.jsx(t,{setDialogVisible:r})]})},DQe=({groupableElement:t})=>{const e=Jt(),n=()=>{H.getState().set(r=>{for(const i of r.elements)if(i.id===t.id&&md(i)){i.enableGroupMaster=!i.enableGroupMaster;break}r.groupActionUpdateFlag=!r.groupActionUpdateFlag})},o=r=>{const i={name:"Group Master",timestamp:Date.now(),checked:r.target.checked,selectedElementId:t.id,selectedElementType:t.type,undo:()=>n(),redo:()=>n()};H.getState().addUndoable(i),n()};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.enableGroupMaster,onChange:o,children:Y.t("foundationMenu.GroupMaster",e)})})},gX=({element:t,inside:e,children:n})=>{const o=H.getState().updateInsideLightsByParentId,r=()=>{const i=new Map;for(const l of H.getState().elements)l.parentId===t.id&&l.type===z.Light&&i.set(l.id,l.inside);o(t.id,e);const a={name:e?`Set All Lights on ${t.type} Inside`:`Set All Lights on ${t.type} Outside`,timestamp:Date.now(),oldValues:i,newValue:!0,undo:()=>{for(const[l,s]of a.oldValues.entries())H.getState().updateInsideLightById(l,s)},redo:()=>{o(t.id,e)}};H.getState().addUndoable(a)};return h.jsx(rn,{stayAfterClick:!0,update:!0,noPadding:!0,onClick:r,children:n})},t2e=({solarCollector:t})=>{const e=H.getState().updateSolarCollectorDrawSunBeamById,n=Jt(),o=r=>{const i={name:"Show Sun Beam",timestamp:Date.now(),checked:!t.drawSunBeam,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{e(t.id,!i.checked)},redo:()=>{e(t.id,i.checked)}};H.getState().addUndoable(i),e(t.id,r)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.drawSunBeam,onChange:r=>o(r.target.checked),children:Y.t("solarCollectorMenu.DrawSunBeam",n)})})},hw=({checked:t,onClick:e,children:n})=>h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t,onClick:e,children:n})}),EC=({min:t,max:e,value:n,onChange:o,children:r})=>h.jsxs(rn,{stayAfterClick:!0,noPadding:!0,children:[r,h.jsx(Iu,{min:t,max:e,tooltip:{open:!1},defaultValue:n,onChange:o})]}),lh=({children:t})=>h.jsx("span",{style:{paddingLeft:"2px",fontSize:9},children:t}),f2=({selector:t,onChange:e,children:n})=>{const o=H(t);return h.jsx(rn,{noPadding:!0,stayAfterClick:!0,children:h.jsx(Li,{style:{width:"100%"},checked:o,onChange:e,children:n})})},oae=({selector:t,onChange:e,children:n})=>{const o=H(t);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{width:"280px"},children:n}),h.jsx(xc,{checked:o,onChange:e})]})},EQe="/aladdin/assets/map_residential_building-BlM-FtN4.png",FQe="/aladdin/assets/map_commercial_building-DgYY52Jp.png",kQe="/aladdin/assets/map_school_building-B4f7IMQ-.png",LQe="/aladdin/assets/map_tourist_attraction-qR1MEaG5.png",WQe="/aladdin/assets/map_solar_panel-DyfTsHia.png",NQe="/aladdin/assets/map_parabolic_dish-C1NBHVgm.png",UQe="/aladdin/assets/map_parabolic_trough-CCcc-zs6.png",jQe="/aladdin/assets/map_fresnel_reflector-Bzw0EMA6.png",BQe="/aladdin/assets/map_heliostat-BXje3i1H.png",YQe="/aladdin/assets/map_under_construction-fpLVLcIy.png",OQe="/aladdin/assets/map_marker-C9GhGDY6.png",_Qe="/aladdin/assets/map_wind_turbine-Bw5iob8S.png",VQe="/aladdin/assets/map_colocation_projects-PrxUC05F.png";var WQ={exports:{}},GQe={};function XQe(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(t=window.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.style;if(!n||e in n)return"";for(let o=0;oe===n.identifier)||t.changedTouches&&(0,Cg.findInArray)(t.changedTouches,n=>e===n.identifier)}function lWn(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function sWn(t){if(!t)return;let e=t.getElementById("react-draggable-style-el");e||(e=t.createElement("style"),e.type="text/css",e.id="react-draggable-style-el",e.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,e.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} -`,t.getElementsByTagName("head")[0].appendChild(e)),t.body&&QQe(t.body,"react-draggable-transparent-selection")}function cWn(t){if(t)try{if(t.body&&ZQe(t.body,"react-draggable-transparent-selection"),t.selection)t.selection.empty();else{const e=(t.defaultView||window).getSelection();e&&e.type!=="Caret"&&e.removeAllRanges()}}catch{}}function QQe(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function ZQe(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var A3={};Object.defineProperty(A3,"__esModule",{value:!0});A3.canDragX=fWn;A3.canDragY=hWn;A3.createCoreData=gWn;A3.createDraggableData=mWn;A3.getBoundPosition=uWn;A3.getControlPosition=pWn;A3.snapToGrid=dWn;var K1=y3,aC=A0;function uWn(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:o}=t.props;o=typeof o=="string"?o:yWn(o);const r=n2e(t);if(typeof o=="string"){const{ownerDocument:i}=r,a=i.defaultView;let l;if(o==="parent"?l=r.parentNode:l=i.querySelector(o),!(l instanceof a.HTMLElement))throw new Error('Bounds selector "'+o+'" could not find an element.');const s=l,c=a.getComputedStyle(r),u=a.getComputedStyle(s);o={left:-r.offsetLeft+(0,K1.int)(u.paddingLeft)+(0,K1.int)(c.marginLeft),top:-r.offsetTop+(0,K1.int)(u.paddingTop)+(0,K1.int)(c.marginTop),right:(0,aC.innerWidth)(s)-(0,aC.outerWidth)(r)-r.offsetLeft+(0,K1.int)(u.paddingRight)-(0,K1.int)(c.marginRight),bottom:(0,aC.innerHeight)(s)-(0,aC.outerHeight)(r)-r.offsetTop+(0,K1.int)(u.paddingBottom)-(0,K1.int)(c.marginBottom)}}return(0,K1.isNum)(o.right)&&(e=Math.min(e,o.right)),(0,K1.isNum)(o.bottom)&&(n=Math.min(n,o.bottom)),(0,K1.isNum)(o.left)&&(e=Math.max(e,o.left)),(0,K1.isNum)(o.top)&&(n=Math.max(n,o.top)),[e,n]}function dWn(t,e,n){const o=Math.round(e/t[0])*t[0],r=Math.round(n/t[1])*t[1];return[o,r]}function fWn(t){return t.props.axis==="both"||t.props.axis==="x"}function hWn(t){return t.props.axis==="both"||t.props.axis==="y"}function pWn(t,e,n){const o=typeof e=="number"?(0,aC.getTouch)(t,e):null;if(typeof e=="number"&&!o)return null;const r=n2e(n),i=n.props.offsetParent||r.offsetParent||r.ownerDocument.body;return(0,aC.offsetXYFromParent)(o||t,i,n.props.scale)}function gWn(t,e,n){const o=!(0,K1.isNum)(t.lastX),r=n2e(t);return o?{node:r,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:r,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function mWn(t,e){const n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function yWn(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function n2e(t){const e=t.findDOMNode();if(!e)throw new Error(": Unmounted during event!");return e}var NQ={},UQ={};Object.defineProperty(UQ,"__esModule",{value:!0});UQ.default=AWn;function AWn(){}Object.defineProperty(NQ,"__esModule",{value:!0});NQ.default=void 0;var iae=vWn(m),zp=o2e(Lq),wWn=o2e(Cd),Jf=A0,H4=A3,aae=y3,Xz=o2e(UQ);function o2e(t){return t&&t.__esModule?t:{default:t}}function eZe(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(eZe=function(o){return o?n:e})(t)}function vWn(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=eZe(e);if(n&&n.has(t))return n.get(t);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)){var a=r?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=t[i]}return o.default=t,n&&n.set(t,o),o}function Vh(t,e,n){return e=xWn(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xWn(t){var e=bWn(t,"string");return typeof e=="symbol"?e:String(e)}function bWn(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const e2={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let M4=e2.mouse,jQ=class extends iae.Component{constructor(){super(...arguments),Vh(this,"dragging",!1),Vh(this,"lastX",NaN),Vh(this,"lastY",NaN),Vh(this,"touchIdentifier",null),Vh(this,"mounted",!1),Vh(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&typeof e.button=="number"&&e.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:o}=n;if(this.props.disabled||!(e.target instanceof o.defaultView.Node)||this.props.handle&&!(0,Jf.matchesSelectorAndParentsTo)(e.target,this.props.handle,n)||this.props.cancel&&(0,Jf.matchesSelectorAndParentsTo)(e.target,this.props.cancel,n))return;e.type==="touchstart"&&e.preventDefault();const r=(0,Jf.getTouchIdentifier)(e);this.touchIdentifier=r;const i=(0,H4.getControlPosition)(e,r,this);if(i==null)return;const{x:a,y:l}=i,s=(0,H4.createCoreData)(this,a,l);(0,Xz.default)("DraggableCore: handleDragStart: %j",s),(0,Xz.default)("calling",this.props.onStart),!(this.props.onStart(e,s)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Jf.addUserSelectStyles)(o),this.dragging=!0,this.lastX=a,this.lastY=l,(0,Jf.addEvent)(o,M4.move,this.handleDrag),(0,Jf.addEvent)(o,M4.stop,this.handleDragStop))}),Vh(this,"handleDrag",e=>{const n=(0,H4.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:o,y:r}=n;if(Array.isArray(this.props.grid)){let l=o-this.lastX,s=r-this.lastY;if([l,s]=(0,H4.snapToGrid)(this.props.grid,l,s),!l&&!s)return;o=this.lastX+l,r=this.lastY+s}const i=(0,H4.createCoreData)(this,o,r);if((0,Xz.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const s=document.createEvent("MouseEvents");s.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(s)}return}this.lastX=o,this.lastY=r}),Vh(this,"handleDragStop",e=>{if(!this.dragging)return;const n=(0,H4.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:o,y:r}=n;if(Array.isArray(this.props.grid)){let s=o-this.lastX||0,c=r-this.lastY||0;[s,c]=(0,H4.snapToGrid)(this.props.grid,s,c),o=this.lastX+s,r=this.lastY+c}const i=(0,H4.createCoreData)(this,o,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;const l=this.findDOMNode();l&&this.props.enableUserSelectHack&&(0,Jf.removeUserSelectStyles)(l.ownerDocument),(0,Xz.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,l&&((0,Xz.default)("DraggableCore: Removing handlers"),(0,Jf.removeEvent)(l.ownerDocument,M4.move,this.handleDrag),(0,Jf.removeEvent)(l.ownerDocument,M4.stop,this.handleDragStop))}),Vh(this,"onMouseDown",e=>(M4=e2.mouse,this.handleDragStart(e))),Vh(this,"onMouseUp",e=>(M4=e2.mouse,this.handleDragStop(e))),Vh(this,"onTouchStart",e=>(M4=e2.touch,this.handleDragStart(e))),Vh(this,"onTouchEnd",e=>(M4=e2.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,Jf.addEvent)(e,e2.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,Jf.removeEvent)(n,e2.mouse.move,this.handleDrag),(0,Jf.removeEvent)(n,e2.touch.move,this.handleDrag),(0,Jf.removeEvent)(n,e2.mouse.stop,this.handleDragStop),(0,Jf.removeEvent)(n,e2.touch.stop,this.handleDragStop),(0,Jf.removeEvent)(e,e2.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Jf.removeUserSelectStyles)(n)}}findDOMNode(){var e,n;return(e=this.props)!==null&&e!==void 0&&e.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:wWn.default.findDOMNode(this)}render(){return iae.cloneElement(iae.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};NQ.default=jQ;Vh(jQ,"displayName","DraggableCore");Vh(jQ,"propTypes",{allowAnyClick:zp.default.bool,children:zp.default.node.isRequired,disabled:zp.default.bool,enableUserSelectHack:zp.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:zp.default.arrayOf(zp.default.number),handle:zp.default.string,cancel:zp.default.string,nodeRef:zp.default.object,onStart:zp.default.func,onDrag:zp.default.func,onStop:zp.default.func,onMouseDown:zp.default.func,scale:zp.default.number,className:aae.dontSetMe,style:aae.dontSetMe,transform:aae.dontSetMe});Vh(jQ,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return s.default}}),t.default=void 0;var e=f(m),n=u(Lq),o=u(Cd),r=u(BLn),i=A0,a=A3,l=y3,s=u(NQ),c=u(UQ);function u(C){return C&&C.__esModule?C:{default:C}}function d(C){if(typeof WeakMap!="function")return null;var P=new WeakMap,v=new WeakMap;return(d=function(T){return T?v:P})(C)}function f(C,P){if(C&&C.__esModule)return C;if(C===null||typeof C!="object"&&typeof C!="function")return{default:C};var v=d(P);if(v&&v.has(C))return v.get(C);var T={},A=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in C)if(x!=="default"&&Object.prototype.hasOwnProperty.call(C,x)){var S=A?Object.getOwnPropertyDescriptor(C,x):null;S&&(S.get||S.set)?Object.defineProperty(T,x,S):T[x]=C[x]}return T.default=C,v&&v.set(C,T),T}function p(){return p=Object.assign?Object.assign.bind():function(C){for(var P=1;P{if((0,c.default)("Draggable: onDragStart: %j",T),this.props.onStart(v,(0,a.createDraggableData)(this,T))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),g(this,"onDrag",(v,T)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",T);const A=(0,a.createDraggableData)(this,T),x={x:A.x,y:A.y,slackX:0,slackY:0};if(this.props.bounds){const{x:R,y:M}=x;x.x+=this.state.slackX,x.y+=this.state.slackY;const[D,E]=(0,a.getBoundPosition)(this,x.x,x.y);x.x=D,x.y=E,x.slackX=this.state.slackX+(R-x.x),x.slackY=this.state.slackY+(M-x.y),A.x=x.x,A.y=x.y,A.deltaX=x.x-this.state.x,A.deltaY=x.y-this.state.y}if(this.props.onDrag(v,A)===!1)return!1;this.setState(x)}),g(this,"onDragStop",(v,T)=>{if(!this.state.dragging||this.props.onStop(v,(0,a.createDraggableData)(this,T))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",T);const x={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:R,y:M}=this.props.position;x.x=R,x.y=M}this.setState(x)}),this.state={dragging:!1,dragged:!1,x:P.position?P.position.x:P.defaultPosition.x,y:P.position?P.position.y:P.defaultPosition.y,prevPropsPosition:{...P.position},slackX:0,slackY:0,isElementSVG:!1},P.position&&!(P.onDrag||P.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var P,v;return(P=(v=this.props)===null||v===void 0||(v=v.nodeRef)===null||v===void 0?void 0:v.current)!==null&&P!==void 0?P:o.default.findDOMNode(this)}render(){const{axis:P,bounds:v,children:T,defaultPosition:A,defaultClassName:x,defaultClassNameDragging:S,defaultClassNameDragged:R,position:M,positionOffset:D,scale:E,...W}=this.props;let j={},L=null;const N=!!!M||this.state.dragging,F=M||A,U={x:(0,a.canDragX)(this)&&N?this.state.x:F.x,y:(0,a.canDragY)(this)&&N?this.state.y:F.y};this.state.isElementSVG?L=(0,i.createSVGTransform)(U,D):j=(0,i.createCSSTransform)(U,D);const O=(0,r.default)(T.props.className||"",x,{[S]:this.state.dragging,[R]:this.state.dragged});return e.createElement(s.default,p({},W,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(T),{className:O,style:{...T.props.style,...j},transform:L}))}}t.default=b,g(b,"displayName","Draggable"),g(b,"propTypes",{...s.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),g(b,"defaultProps",{...s.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(GQe);const{default:tZe,DraggableCore:SWn}=GQe;WQ.exports=tZe;WQ.exports.default=tZe;WQ.exports.DraggableCore=SWn;var TWn=WQ.exports;const _i=Fi(TWn),ZTe=t=>{t=1831565813+(t|=0)|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296};let PWn=class{constructor(e){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;const{length:n,separator:o,dictionaries:r,style:i,seed:a}=e;this.dictionaries=r,this.separator=o,this.length=n,this.style=i,this.seed=a}generate(){if(!this.dictionaries)throw new Error('Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object');if(this.length<=0)throw new Error("Invalid length provided");if(this.length>this.dictionaries.length)throw new Error(`The length cannot be bigger than the number of dictionaries. -Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let e=this.seed;return this.dictionaries.slice(0,this.length).reduce((n,o)=>{let r;e?(r=(a=>{if(typeof a=="string"){const l=a.split("").map(c=>c.charCodeAt(0)).reduce((c,u)=>c+u,1),s=Math.floor(Number(l));return ZTe(s)}return ZTe(a)})(e),e=4294967296*r):r=Math.random();let i=o[Math.floor(r*o.length)]||"";if(this.style==="lowerCase")i=i.toLowerCase();else if(this.style==="capital"){const[a,...l]=i.split("");i=a.toUpperCase()+l.join("")}else this.style==="upperCase"&&(i=i.toUpperCase());return n?`${n}${this.separator}${i}`:`${i}`},"")}};const ePe={separator:"_",dictionaries:[]},CWn=t=>{const e=[...t&&t.dictionaries||ePe.dictionaries],n={...ePe,...t,length:t&&t.length||e.length,dictionaries:e};if(!t||!t.dictionaries||!t.dictionaries.length)throw new Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new PWn(n).generate()};var RWn=["aardvark","aardwolf","albatross","alligator","alpaca","amphibian","anaconda","angelfish","anglerfish","ant","anteater","antelope","antlion","ape","aphid","armadillo","asp","baboon","badger","bandicoot","barnacle","barracuda","basilisk","bass","bat","bear","beaver","bedbug","bee","beetle","bird","bison","blackbird","boa","boar","bobcat","bobolink","bonobo","booby","bovid","bug","butterfly","buzzard","camel","canid","canidae","capybara","cardinal","caribou","carp","cat","caterpillar","catfish","catshark","cattle","centipede","cephalopod","chameleon","cheetah","chickadee","chicken","chimpanzee","chinchilla","chipmunk","cicada","clam","clownfish","cobra","cockroach","cod","condor","constrictor","coral","cougar","cow","coyote","crab","crane","crawdad","crayfish","cricket","crocodile","crow","cuckoo","damselfly","deer","dingo","dinosaur","dog","dolphin","donkey","dormouse","dove","dragon","dragonfly","duck","eagle","earthworm","earwig","echidna","eel","egret","elephant","elk","emu","ermine","falcon","felidae","ferret","finch","firefly","fish","flamingo","flea","fly","flyingfish","fowl","fox","frog","galliform","gamefowl","gayal","gazelle","gecko","gerbil","gibbon","giraffe","goat","goldfish","goose","gopher","gorilla","grasshopper","grouse","guan","guanaco","guineafowl","gull","guppy","haddock","halibut","hamster","hare","harrier","hawk","hedgehog","heron","herring","hippopotamus","hookworm","hornet","horse","hoverfly","hummingbird","hyena","iguana","impala","jackal","jaguar","jay","jellyfish","junglefowl","kangaroo","kingfisher","kite","kiwi","koala","koi","krill","ladybug","lamprey","landfowl","lark","leech","lemming","lemur","leopard","leopon","limpet","lion","lizard","llama","lobster","locust","loon","louse","lungfish","lynx","macaw","mackerel","magpie","mammal","manatee","mandrill","marlin","marmoset","marmot","marsupial","marten","mastodon","meadowlark","meerkat","mink","minnow","mite","mockingbird","mole","mollusk","mongoose","monkey","moose","mosquito","moth","mouse","mule","muskox","narwhal","newt","nightingale","ocelot","octopus","opossum","orangutan","orca","ostrich","otter","owl","ox","panda","panther","parakeet","parrot","parrotfish","partridge","peacock","peafowl","pelican","penguin","perch","pheasant","pig","pigeon","pike","pinniped","piranha","planarian","platypus","pony","porcupine","porpoise","possum","prawn","primate","ptarmigan","puffin","puma","python","quail","quelea","quokka","rabbit","raccoon","rat","rattlesnake","raven","reindeer","reptile","rhinoceros","roadrunner","rodent","rook","rooster","roundworm","sailfish","salamander","salmon","sawfish","scallop","scorpion","seahorse","shark","sheep","shrew","shrimp","silkworm","silverfish","skink","skunk","sloth","slug","smelt","snail","snake","snipe","sole","sparrow","spider","spoonbill","squid","squirrel","starfish","stingray","stoat","stork","sturgeon","swallow","swan","swift","swordfish","swordtail","tahr","takin","tapir","tarantula","tarsier","termite","tern","thrush","tick","tiger","tiglon","toad","tortoise","toucan","trout","tuna","turkey","turtle","tyrannosaurus","unicorn","urial","vicuna","viper","vole","vulture","wallaby","walrus","warbler","wasp","weasel","whale","whippet","whitefish","wildcat","wildebeest","wildfowl","wolf","wolverine","wombat","woodpecker","worm","wren","xerinae","yak","zebra"],HWn=["amaranth","amber","amethyst","apricot","aqua","aquamarine","azure","beige","black","blue","blush","bronze","brown","chocolate","coffee","copper","coral","crimson","cyan","emerald","fuchsia","gold","gray","green","harlequin","indigo","ivory","jade","lavender","lime","magenta","maroon","moccasin","olive","orange","peach","pink","plum","purple","red","rose","salmon","sapphire","scarlet","silver","tan","teal","tomato","turquoise","violet","white","yellow"];const{Option:U1}=_o,MWn=({setDialogVisible:t})=>{const e=H(fn),n=H(ma),o=H(s0),[r,i]=m.useState(H.getState().modelType),[a,l]=m.useState(H.getState().modelAuthor??CWn({dictionaries:[HWn,RWn],separator:" ",style:"capital"})),[s,c]=m.useState(H.getState().modelLabel??H.getState().cloudFile??null),[u,d]=m.useState(H.getState().modelDescription),[f,p]=m.useState(!1),[g,y]=m.useState({left:0,top:0,bottom:0,right:0}),w=m.useRef(null),b=m.useRef(null),{TextArea:C}=as,P={lng:o};m.useEffect(()=>{var S;(S=b.current)==null||S.focus()},[]);const v=(S,R)=>{if(w.current){const{clientWidth:M,clientHeight:D}=window.document.documentElement,E=w.current.getBoundingClientRect();y({left:-E.left+R.x,right:M-(E.right-R.x),top:-E.top+R.y,bottom:D-((E==null?void 0:E.bottom)-R.y)})}},T=()=>{t(!1)},A=()=>{ht.getState().set(S=>{S.publishOnModelsMapFlag=!0}),e(S=>{S.modelType=r,S.modelAuthor=a,S.modelLabel=s,S.modelDescription=u}),ht.getState().setChanged(!0),n&&e(S=>{S.actionInfo={name:"Publish on Map of Models",timestamp:new Date().getTime()}}),t(!1)},{t:x}=Vl();return h.jsxs(Oi,{width:560,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>p(!0),onMouseOut:()=>p(!1),children:x("menu.file.PublishOnModelsMap",P)}),footer:[h.jsx(lo,{onClick:T,children:x("word.Cancel",P)},"Cancel"),h.jsx(lo,{type:"primary",ref:b,onClick:A,disabled:!a||!s,children:x("word.OK",P)},"OK")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:S=>h.jsx(_i,{disabled:!f,bounds:g,onStart:(R,M)=>v(R,M),children:h.jsx("div",{ref:w,children:S})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:8,children:x("shared.ModelType",P)+":"}),h.jsx(nt,{className:"gutter-row",span:16,children:h.jsxs(_o,{style:{width:"100%"},value:r,onChange:S=>{i(S)},children:[h.jsxs(U1,{value:ha.UNKNOWN,children:[h.jsx("img",{alt:"Building",width:24,src:OQe,style:{marginRight:"8px"}}),x("word.Unknown",P)]},ha.UNKNOWN),h.jsxs(U1,{value:ha.UNDER_CONSTRUCTION,children:[h.jsx("img",{alt:"Building",width:24,src:YQe,style:{marginRight:"8px"}}),x("word.UnderConstruction",P)]},ha.UNDER_CONSTRUCTION),h.jsxs(U1,{value:ha.RESIDENTIAL_BUILDING,children:[h.jsx("img",{alt:"Residential Building",width:24,src:EQe,style:{marginRight:"8px"}}),x("word.ResidentialBuilding",P)]},ha.RESIDENTIAL_BUILDING),h.jsxs(U1,{value:ha.COMMERCIAL_BUILDING,children:[h.jsx("img",{alt:"Commercial Building",width:24,src:FQe,style:{marginRight:"8px"}}),x("word.CommercialBuilding",P)]},ha.COMMERCIAL_BUILDING),h.jsxs(U1,{value:ha.SCHOOL_BUILDING,children:[h.jsx("img",{alt:"School Building",width:24,src:kQe,style:{marginRight:"8px"}}),x("word.SchoolBuilding",P)]},ha.SCHOOL_BUILDING),h.jsxs(U1,{value:ha.TOURIST_ATTRACTION,children:[h.jsx("img",{alt:"Tourist Attraction",width:24,src:LQe,style:{marginRight:"8px"}}),x("word.TouristAttraction",P)]},ha.TOURIST_ATTRACTION),h.jsxs(U1,{value:ha.PHOTOVOLTAIC,children:[h.jsx("img",{alt:"Photovoltaic",width:24,src:WQe,style:{marginRight:"8px"}}),x("word.Photovoltaic",P)]},ha.PHOTOVOLTAIC),h.jsxs(U1,{value:ha.PARABOLIC_DISH,children:[h.jsx("img",{alt:"Parabolic Dish",width:24,src:NQe,style:{marginRight:"8px"}}),x("shared.ParabolicDishElement",P)]},ha.PARABOLIC_DISH),h.jsxs(U1,{value:ha.PARABOLIC_TROUGH,children:[h.jsx("img",{alt:"Parabolic Trough",width:24,src:UQe,style:{marginRight:"8px"}}),x("shared.ParabolicTroughElement",P)]},ha.PARABOLIC_TROUGH),h.jsxs(U1,{value:ha.FRESNEL_REFLECTOR,children:[h.jsx("img",{alt:"Fresnel Reflector",width:24,src:jQe,style:{marginRight:"8px"}}),x("shared.FresnelReflectorElement",P)]},ha.FRESNEL_REFLECTOR),h.jsxs(U1,{value:ha.SOLAR_POWER_TOWER,children:[h.jsx("img",{alt:"Heliostat",width:24,src:BQe,style:{marginRight:"8px"}}),x("shared.HeliostatElement",P)]},ha.SOLAR_POWER_TOWER),h.jsxs(U1,{value:ha.WIND_TURBINE,children:[h.jsx("img",{alt:"Wind Turbine",width:24,src:_Qe,style:{marginRight:"8px"}}),Y.t("word.WindPower",P)]},ha.WIND_TURBINE),h.jsxs(U1,{value:ha.COLOCATION_PROJECTS,children:[h.jsx("img",{alt:"Colocation Projects",width:24,src:VQe,style:{marginRight:"8px"}}),Y.t("word.ColocationProjects",P)]},ha.COLOCATION_PROJECTS)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[x("word.Publisher",P),":"]}),h.jsx(nt,{className:"gutter-row",span:16,children:h.jsx(as,{maxLength:30,style:{width:"100%"},value:a??"",onKeyDown:S=>{if(!aR.test(S.key))return S.preventDefault(),!1},onChange:S=>{l(S.target.value)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[x("word.Label",P),":"]}),h.jsx(nt,{className:"gutter-row",span:16,children:h.jsx(as,{maxLength:50,style:{width:"100%"},value:s??"",onKeyDown:S=>{if(!aR.test(S.key))return S.preventDefault(),!1},onChange:S=>{c(S.target.value)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[x("word.Description",P),":",h.jsx("br",{}),h.jsxs("span",{style:{fontSize:"10px"},children:["(",x("word.MaximumCharacters",P),": 200)"]})]}),h.jsx(nt,{className:"gutter-row",span:16,children:h.jsx(C,{rows:5,maxLength:200,style:{width:"100%"},value:u??"",onChange:S=>{d(S.target.value)}})})]})]})},IWn=be.memo(()=>{const t=Jt(),e=H(mp),n=H(Pb),[o,r]=m.useState(!1),i=()=>{const a=new URLSearchParams(window.location.search).get("userid"),l=a===e.uid;e.uid&&n&&l?r(!0):e.uid?hn(a&&!l?Y.t("menu.file.YouCannotPublishAModelThatYouDoNotOwn",t)+".":Y.t("menu.file.YouMustSaveModelOnCloudBeforePublishingIt",t)+"."):hn(Y.t("menu.file.YouMustLogInToPublishYourModel",t)+".")};return h.jsxs(h.Fragment,{children:[h.jsxs(rn,{noPadding:!0,onClick:i,children:[Y.t("menu.file.PublishOnModelsMap",t),"..."]}),o&&h.jsx(MWn,{setDialogVisible:r})]})}),zWn=(t,e,n)=>{const o={lng:H.getState().language},r=H.getState().user,i=H.getState().cloudFile,a=H.getState().undoManager,l=H.getState().loggable,s=H.getState().set,c=()=>{a.clear(),ht.getState().set(b=>{b.createNewFileFlag=!0,b.openModelsMap=!1}),s(b=>{b.objectTypeToAdd=z.None,b.groupActionMode=!1,window.history.pushState({},document.title,t1),l&&(b.actionInfo={name:"Create New File",timestamp:new Date().getTime()})})},u=()=>{a.clear(),ht.getState().set(b=>{b.openLocalFileFlag=!0,b.openModelsMap=!1}),s(b=>{b.objectTypeToAdd=z.None,b.groupActionMode=!1,b.cloudFile=void 0,window.history.pushState({},document.title,t1),l&&(b.actionInfo={name:"Open Local File",timestamp:new Date().getTime()})})},d=()=>{ht.getState().set(b=>{b.saveLocalFileDialogVisible=!0}),l&&s(b=>{b.actionInfo={name:"Save as Local File",timestamp:new Date().getTime()}})},f=()=>{ht.getState().set(b=>{b.listCloudFilesFlag=!0,b.openModelsMap=!1}),s(b=>{b.selectedFloatingWindow="cloudFilePanel"}),l&&s(b=>{b.actionInfo={name:"List Cloud Files",timestamp:new Date().getTime()}})},p=()=>{ht.getState().setSaveCloudFileFlag(!0),l&&s(b=>{b.actionInfo={name:"Save Cloud File",timestamp:new Date().getTime()}})},g=()=>{s(b=>{b.showCloudFileTitleDialogFlag=!b.showCloudFileTitleDialogFlag,b.showCloudFileTitleDialog=!0,l&&(b.actionInfo={name:"Save as Cloud File",timestamp:new Date().getTime()})})},y=()=>{n&&(MQt("screenshot.png",n.toDataURL("image/png")),l&&s(b=>{b.actionInfo={name:"Take Screenshot",timestamp:new Date().getTime()}}),ht.getState().set(b=>{b.openModelsMap=!1}))},w=[];return t||w.push({key:"create-new-file",label:h.jsxs(rn,{noPadding:!0,onClick:c,children:[Y.t("menu.file.CreateNewFile",o),h.jsxs(lh,{children:["(",e?"⌘":"Ctrl","+F)"]})]})}),t||w.push({key:"open-local-file",label:h.jsxs(rn,{noPadding:!0,onClick:u,children:[Y.t("menu.file.OpenLocalFile",o),h.jsxs(lh,{children:["(",e?"⌘":"Ctrl","+O)"]}),"..."]})}),w.push({key:"save-local-file",label:h.jsxs(rn,{noPadding:!0,onClick:d,children:[Y.t("menu.file.SaveAsLocalFile",o),h.jsxs(lh,{children:["(",e?"⌘":"Ctrl","+S)"]}),"..."]})}),r.uid&&!t&&w.push({key:"open-cloud-file",label:h.jsxs(rn,{noPadding:!0,onClick:f,children:[Y.t("menu.file.OpenCloudFile",o),h.jsxs(lh,{children:["(",e?"⌘":"Ctrl","+Shift+O)"]}),"..."]})}),r.uid&&i&&!t&&w.push({key:"save-cloud-file",label:h.jsxs(rn,{noPadding:!0,onClick:p,children:[Y.t("menu.file.SaveCloudFile",o),h.jsxs(lh,{children:["(",e?"⌘":"Ctrl","+Shift+S)"]}),"..."]})}),r.uid&&!t&&w.push({key:"save-as-cloud-file",label:h.jsx(rn,{noPadding:!0,onClick:g,children:Y.t("menu.file.SaveAsCloudFile",o)})}),t||w.push({key:"publish-on-model-map",label:h.jsx(IWn,{})}),w.push({key:"take-screen-shot",label:h.jsx(rn,{noPadding:!0,onClick:y,children:Y.t("menu.file.TakeScreenshot",o)})}),w},{Option:DWn}=_o,nZe=be.memo(({saveAs:t,setDialogVisible:e})=>{const n=H(fn),o=H(ma),[r,i]=m.useState(H.getState().projectState.type??Pi.SOLAR_PANEL_ARRAY),[a,l]=m.useState(H.getState().projectState.title),[s,c]=m.useState(H.getState().projectState.description),[u,d]=m.useState(!1),[f,p]=m.useState({left:0,top:0,bottom:0,right:0}),g=m.useRef(null),{TextArea:y}=as,w=Jt(),b=(v,T)=>{if(g.current){const{clientWidth:A,clientHeight:x}=window.document.documentElement,S=g.current.getBoundingClientRect();p({left:-S.left+T.x,right:A-(S.right-T.x),top:-S.top+T.y,bottom:x-((S==null?void 0:S.bottom)-T.y)})}},C=()=>{e(!1)},P=()=>{ht.getState().set(v=>{t?v.saveProjectAsFlag=!0:v.createProjectFlag=!0}),ht.getState().set(v=>{v.projectType=r,v.projectTitle=a,v.projectDescription=s}),o&&n(v=>{v.actionInfo={name:t?"Save Project as":"Create New Project",timestamp:new Date().getTime()}}),e(!1)};return h.jsxs(Oi,{width:560,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>d(!0),onMouseOut:()=>d(!1),children:`${Y.t(t?"menu.project.SaveProjectAs":"menu.project.CreateNewProject",w)}`}),footer:[h.jsx(lo,{onClick:C,children:`${Y.t("word.Cancel",w)}`},"Cancel"),h.jsx(lo,{type:"primary",onClick:P,disabled:!a,children:`${Y.t("word.OK",w)}`},"OK")],onCancel:()=>{e(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:v=>h.jsx(_i,{disabled:!u,bounds:f,onStart:(T,A)=>b(T,A),children:h.jsx("div",{ref:g,children:v})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:8,children:Y.t("projectPanel.ProjectType",w)+":"}),h.jsx(nt,{className:"gutter-row",span:16,children:h.jsx(_o,{disabled:t,style:{width:"100%"},value:r,onChange:v=>{i(v)},children:h.jsx(DWn,{value:Pi.SOLAR_PANEL_ARRAY,children:`${Y.t("projectPanel.SolarPanelArray",w)}`},Pi.SOLAR_PANEL_ARRAY)})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[`${Y.t("word.Title",w)}`,":"]}),h.jsx(nt,{className:"gutter-row",span:16,children:h.jsx(as,{maxLength:50,style:{width:"100%"},value:a??"",onKeyDown:v=>{if(!aR.test(v.key))return v.preventDefault(),!1},onChange:v=>{l(v.target.value)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[`${Y.t("word.Description",w)}`,":",h.jsx("br",{}),h.jsxs("span",{style:{fontSize:"10px"},children:["(",`${Y.t("word.MaximumCharacters",w)}`,": 200)"]})]}),h.jsx(nt,{className:"gutter-row",span:16,children:h.jsx(y,{rows:5,maxLength:200,style:{width:"100%"},value:s??"",onChange:v=>{c(v.target.value)}})})]})]})}),EWn=()=>{const[t,e]=m.useState(!1),n=Jt(),o=()=>{if(!H.getState().user.uid){hn(Y.t("menu.project.YouMustLogInToCreateProject",n)+".");return}e(!0),ht.getState().set(r=>{r.openModelsMap=!1}),H.getState().loggable&&H.getState().set(r=>{r.actionInfo={name:"Create New Project",timestamp:new Date().getTime()}})};return h.jsxs(h.Fragment,{children:[h.jsxs(rn,{noPadding:!0,onClick:o,children:[Y.t("menu.project.CreateNewProject",n),"..."]}),t&&h.jsx(nZe,{saveAs:!1,setDialogVisible:e})]})},FWn=()=>{const[t,e]=m.useState(!1),n=Jt(),o=()=>{e(!0),ht.getState().set(r=>{r.openModelsMap=!1}),H.getState().loggable&&H.getState().set(r=>{r.actionInfo={name:"Save Project As",timestamp:new Date().getTime()}})};return h.jsxs(h.Fragment,{children:[h.jsxs(rn,{noPadding:!0,onClick:o,children:[Y.t("menu.project.SaveProjectAs",n),"..."]}),t&&h.jsx(nZe,{saveAs:!0,setDialogVisible:e})]})},kWn=()=>{const t={lng:H.getState().language},e=H.getState().user,n=H.getState().loggable,o=H.getState().projectState,r=H.getState().projectView,i=H.getState().set,a=()=>{if(!e.uid){hn(Y.t("menu.project.YouMustLogInToOpenProject",t)+".");return}ht.getState().set(s=>{s.showProjectsFlag=!0,s.openModelsMap=!1}),i(s=>{s.selectedFloatingWindow="projectListPanel"}),n&&i(s=>{s.actionInfo={name:"Open Project",timestamp:new Date().getTime()}})},l=[];return l.push({key:"create-new-project",label:h.jsx(EWn,{})}),l.push({key:"list-project",label:h.jsxs(rn,{noPadding:!0,onClick:a,children:[Y.t("menu.project.OpenProject",t),"..."]})}),r&&o.title&&e.uid&&l.push({key:"save-project-as",label:h.jsx(FWn,{})}),l},LWn=(t,e,n,o)=>{const r={lng:H.getState().language},i=H.getState().loggable,a=H.getState().set,l=()=>{t&&(H.getState().copyElementById(t.id),i&&a(p=>{p.actionInfo={name:"Copy",timestamp:new Date().getTime(),elementId:t.id,elementType:t.type}}))},s=()=>{if(!(!t||t.type===z.Roof))if(t.locked)hn(Y.t("message.ThisElementIsLocked",r));else{const p=H.getState().removeElementById(t.id,!0);if(p.length===0)return;if(me.isElementTriggerAutoDeletion(p[0]))Fn.getState().setListenToAutoDeletionByCut(!0),ht.getState().setPrimitiveStore("selectedElementId",t.id);else{const g={name:"Cut",timestamp:Date.now(),deletedElements:p,selectedElementId:t.id,undo:()=>{const y=g.deletedElements;if(y.length===0)return;const w=y.find(b=>b.id===g.selectedElementId);w&&a(b=>{for(const C of y)b.elements.push(C);if(w.type===z.Wall){const C=w;let P=null,v=null;if(C.leftJoints.length>0&&(P=C.leftJoints[0]),C.rightJoints.length>0&&(v=C.rightJoints[0]),P||v)for(const T of b.elements)T.id===P&&T.type===z.Wall&&(T.rightJoints[0]=C.id),T.id===v&&T.type===z.Wall&&(T.leftJoints[0]=C.id)}})},redo:()=>{g.deletedElements&&g.deletedElements.length>0&&H.getState().removeElementById(g.deletedElements[0].id,!0)}};H.getState().addUndoable(g)}}},c=()=>{const p=H.getState().elementsToPaste;if(p&&p.length>0){const g=H.getState().pasteElementsByKey();if(g.length>0){const y={name:"Paste by Key",timestamp:Date.now(),pastedElements:JSON.parse(JSON.stringify(g)),undo:()=>{for(const w of y.pastedElements)H.getState().removeElementById(w.id,!1)},redo:()=>{a(w=>{w.elements.push(...y.pastedElements),w.selectedElement=y.pastedElements[0]})}};H.getState().addUndoable(y)}}},u=()=>{if(n.hasUndo()){const p=n.undo();p&&hn(Y.t("menu.edit.Undo",r)+": "+p,dG),i&&a(g=>{g.actionInfo={name:"Undo",timestamp:new Date().getTime()}})}},d=()=>{if(n.hasRedo()){const p=n.redo();p&&hn(Y.t("menu.edit.Redo",r)+": "+p,dG),i&&a(g=>{g.actionInfo={name:"Redo",timestamp:new Date().getTime()}})}},f=[];return t&&f.push({key:"cut",label:h.jsxs(rn,{noPadding:!0,onClick:s,children:[Y.t("word.Cut",r),h.jsxs(lh,{children:["(",o?"⌘":"Ctrl","+X)"]})]})}),t&&f.push({key:"copy",label:h.jsxs(rn,{noPadding:!0,onClick:l,children:[Y.t("word.Copy",r),h.jsxs(lh,{children:["(",o?"⌘":"Ctrl","+C)"]})]})}),e&&f.push({key:"paste",label:h.jsxs(rn,{noPadding:!0,onClick:c,children:[Y.t("word.Paste",r),h.jsxs(lh,{children:["(",o?"⌘":"Ctrl","+V)"]})]})}),n.hasUndo()&&f.push({key:"undo",label:h.jsxs(rn,{noPadding:!0,onClick:u,children:[Y.t("menu.edit.Undo",r)+": "+n.getLastUndoName(),h.jsxs(lh,{children:["(",o?"⌘":"Ctrl","+Z)"]})]})}),n.hasRedo()&&f.push({key:"redo",label:h.jsxs(rn,{noPadding:!0,onClick:d,children:[Y.t("menu.edit.Redo",r)+": "+n.getLastRedoName(),h.jsxs(lh,{children:["(",o?"⌘":"Ctrl","+Y)"]})]})}),f};var r2e={},BQ={};Object.defineProperty(BQ,"__esModule",{value:!0});BQ.default=void 0;var WWn={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"};BQ.default=WWn;var YQ={},gN={},OQ={};Object.defineProperty(OQ,"__esModule",{value:!0});OQ.default=void 0;var NWn={locale:"zh_CN",yearFormat:"YYYY年",cellDateFormat:"D",cellMeridiemFormat:"A",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"};OQ.default=NWn;var mN={};Object.defineProperty(mN,"__esModule",{value:!0});mN.default=void 0;const UWn={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]};mN.default=UWn;var oZe=Md.default;Object.defineProperty(gN,"__esModule",{value:!0});gN.default=void 0;var jWn=oZe(OQ),BWn=oZe(mN);const rZe={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},jWn.default),timePickerLocale:Object.assign({},BWn.default)};rZe.lang.ok="确定";gN.default=rZe;var YWn=Md.default;Object.defineProperty(YQ,"__esModule",{value:!0});YQ.default=void 0;var OWn=YWn(gN);YQ.default=OWn.default;var _Q=Md.default;Object.defineProperty(r2e,"__esModule",{value:!0});var iZe=r2e.default=void 0,_Wn=_Q(BQ),VWn=_Q(YQ),GWn=_Q(gN),XWn=_Q(mN);const j1="${label}不是一个有效的${type}",JWn={locale:"zh-cn",Pagination:_Wn.default,DatePicker:GWn.default,TimePicker:XWn.default,Calendar:VWn.default,global:{placeholder:"请选择"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckall:"全选",filterSearchPlaceholder:"在筛选项中搜索",emptyText:"暂无数据",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{titles:["",""],searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",deselectAll:"取消全选",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开",collapse:"收起"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:j1,method:j1,array:j1,object:j1,number:j1,date:j1,boolean:j1,integer:j1,float:j1,regexp:j1,email:j1,url:j1,hex:j1},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},Image:{preview:"预览"},QRCode:{expired:"二维码过期",refresh:"点击刷新",scanned:"已扫描"},ColorPicker:{presetEmpty:"暂无"}};iZe=r2e.default=JWn;var i2e={},VQ={};Object.defineProperty(VQ,"__esModule",{value:!0});VQ.default=void 0;var KWn={items_per_page:"條/頁",jump_to:"跳至",jump_to_confirm:"確定",page:"頁",prev_page:"上一頁",next_page:"下一頁",prev_5:"向前 5 頁",next_5:"向後 5 頁",prev_3:"向前 3 頁",next_3:"向後 3 頁",page_size:"頁碼"};VQ.default=KWn;var GQ={},yN={},XQ={};Object.defineProperty(XQ,"__esModule",{value:!0});XQ.default=void 0;var qWn={locale:"zh_TW",today:"今天",now:"此刻",backToToday:"返回今天",ok:"確定",timeSelect:"選擇時間",dateSelect:"選擇日期",weekSelect:"選擇周",clear:"清除",month:"月",year:"年",previousMonth:"上個月 (翻頁上鍵)",nextMonth:"下個月 (翻頁下鍵)",monthSelect:"選擇月份",yearSelect:"選擇年份",decadeSelect:"選擇年代",yearFormat:"YYYY年",dayFormat:"D",dateFormat:"YYYY年M月D日",dateTimeFormat:"YYYY年M月D日 HH時mm分ss秒",previousYear:"上一年 (Control鍵加左方向鍵)",nextYear:"下一年 (Control鍵加右方向鍵)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世紀",nextCentury:"下一世紀"};XQ.default=qWn;var AN={};Object.defineProperty(AN,"__esModule",{value:!0});AN.default=void 0;const $Wn={placeholder:"請選擇時間"};AN.default=$Wn;var aZe=Md.default;Object.defineProperty(yN,"__esModule",{value:!0});yN.default=void 0;var QWn=aZe(XQ),ZWn=aZe(AN);const lZe={lang:Object.assign({placeholder:"請選擇日期",yearPlaceholder:"請選擇年份",quarterPlaceholder:"請選擇季度",monthPlaceholder:"請選擇月份",weekPlaceholder:"請選擇周",rangePlaceholder:["開始日期","結束日期"],rangeYearPlaceholder:["開始年份","結束年份"],rangeMonthPlaceholder:["開始月份","結束月份"],rangeQuarterPlaceholder:["開始季度","結束季度"],rangeWeekPlaceholder:["開始周","結束周"]},QWn.default),timePickerLocale:Object.assign({},ZWn.default)};lZe.lang.ok="確 定";yN.default=lZe;var eNn=Md.default;Object.defineProperty(GQ,"__esModule",{value:!0});GQ.default=void 0;var tNn=eNn(yN);GQ.default=tNn.default;var JQ=Md.default;Object.defineProperty(i2e,"__esModule",{value:!0});var sZe=i2e.default=void 0,nNn=JQ(VQ),oNn=JQ(GQ),rNn=JQ(yN),iNn=JQ(AN);const B1="${label}不是一個有效的${type}",aNn={locale:"zh-tw",Pagination:nNn.default,DatePicker:rNn.default,TimePicker:iNn.default,Calendar:oNn.default,global:{placeholder:"請選擇"},Table:{filterTitle:"篩選器",filterConfirm:"確定",filterReset:"重置",filterEmptyText:"無篩選項",filterCheckall:"全選",filterSearchPlaceholder:"在篩選項中搜尋",emptyText:"暫無數據",selectAll:"全部選取",selectInvert:"反向選取",selectNone:"清空所有",selectionAll:"全選所有",sortTitle:"排序",expand:"展開行",collapse:"關閉行",triggerDesc:"點擊降序",triggerAsc:"點擊升序",cancelSort:"取消排序"},Modal:{okText:"確定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"結束導覽"},Popconfirm:{okText:"確定",cancelText:"取消"},Transfer:{titles:["",""],searchPlaceholder:"搜尋資料",itemUnit:"項目",itemsUnit:"項目",remove:"删除",selectCurrent:"全選當頁",removeCurrent:"删除當頁",selectAll:"全選所有",removeAll:"删除全部",selectInvert:"反選當頁"},Upload:{uploading:"正在上傳...",removeFile:"刪除檔案",uploadError:"上傳失敗",previewFile:"檔案預覽",downloadFile:"下载文件"},Empty:{description:"無此資料"},Icon:{icon:"圖標"},Text:{edit:"編輯",copy:"複製",copied:"複製成功",expand:"展開"},Form:{optional:"(可選)",defaultValidateMessages:{default:"字段驗證錯誤${label}",required:"請輸入${label}",enum:"${label}必須是其中一個[${enum}]",whitespace:"${label}不能為空字符",date:{format:"${label}日期格式無效",parse:"${label}不能轉換為日期",invalid:"${label}是一個無效日期"},types:{string:B1,method:B1,array:B1,object:B1,number:B1,date:B1,boolean:B1,integer:B1,float:B1,regexp:B1,email:B1,url:B1,hex:B1},string:{len:"${label}須為${len}個字符",min:"${label}最少${min}個字符",max:"${label}最多${max}個字符",range:"${label}須在${min}-${max}字符之間"},number:{len:"${label}必須等於${len}",min:"${label}最小值為${min}",max:"${label}最大值為${max}",range:"${label}須在${min}-${max}之間"},array:{len:"須為${len}個${label}",min:"最少${min}個${label}",max:"最多${max}個${label}",range:"${label}數量須在${min}-${max}之間"},pattern:{mismatch:"${label}與模式不匹配${pattern}"}}},Image:{preview:"預覽"},QRCode:{expired:"二維碼過期",refresh:"點擊刷新",scanned:"已掃描"}};sZe=i2e.default=aNn;var a2e={},KQ={};Object.defineProperty(KQ,"__esModule",{value:!0});KQ.default=void 0;var lNn={items_per_page:"/ página",jump_to:"Ir a",jump_to_confirm:"confirmar",page:"Página",prev_page:"Página anterior",next_page:"Página siguiente",prev_5:"5 páginas previas",next_5:"5 páginas siguientes",prev_3:"3 páginas previas",next_3:"3 páginas siguientes",page_size:"tamaño de página"};KQ.default=lNn;var qQ={},wN={},$Q={};Object.defineProperty($Q,"__esModule",{value:!0});$Q.default=void 0;var sNn={locale:"es_ES",today:"Hoy",now:"Ahora",backToToday:"Volver a hoy",ok:"Aceptar",clear:"Limpiar",month:"Mes",year:"Año",timeSelect:"Seleccionar hora",dateSelect:"Seleccionar fecha",monthSelect:"Elegir un mes",yearSelect:"Elegir un año",decadeSelect:"Elegir una década",yearFormat:"YYYY",dateFormat:"D/M/YYYY",dayFormat:"D",dateTimeFormat:"D/M/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Mes anterior (PageUp)",nextMonth:"Mes siguiente (PageDown)",previousYear:"Año anterior (Control + left)",nextYear:"Año siguiente (Control + right)",previousDecade:"Década anterior",nextDecade:"Década siguiente",previousCentury:"Siglo anterior",nextCentury:"Siglo siguiente"};$Q.default=sNn;var vN={};Object.defineProperty(vN,"__esModule",{value:!0});vN.default=void 0;const cNn={placeholder:"Seleccionar hora"};vN.default=cNn;var cZe=Md.default;Object.defineProperty(wN,"__esModule",{value:!0});wN.default=void 0;var uNn=cZe($Q),dNn=cZe(vN);const fNn={lang:Object.assign({placeholder:"Seleccionar fecha",rangePlaceholder:["Fecha inicial","Fecha final"],shortWeekDays:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],shortMonths:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"]},uNn.default),timePickerLocale:Object.assign({},dNn.default)};wN.default=fNn;var hNn=Md.default;Object.defineProperty(qQ,"__esModule",{value:!0});qQ.default=void 0;var pNn=hNn(wN);qQ.default=pNn.default;var QQ=Md.default;Object.defineProperty(a2e,"__esModule",{value:!0});var uZe=a2e.default=void 0,gNn=QQ(KQ),mNn=QQ(qQ),yNn=QQ(wN),ANn=QQ(vN);const Y1="${label} no es un ${type} válido",wNn={locale:"es",Pagination:gNn.default,DatePicker:yNn.default,TimePicker:ANn.default,Calendar:mNn.default,global:{placeholder:"Seleccione"},Table:{filterTitle:"Filtrar menú",filterConfirm:"Aceptar",filterReset:"Reiniciar",filterEmptyText:"Sin filtros",filterCheckall:"Seleccionar todo",filterSearchPlaceholder:"Buscar en filtros",emptyText:"Sin datos",selectAll:"Seleccionar todo",selectInvert:"Invertir selección",selectNone:"Vacíe todo",selectionAll:"Seleccionar todos los datos",sortTitle:"Ordenar",expand:"Expandir fila",collapse:"Colapsar fila",triggerDesc:"Click para ordenar en orden descendente",triggerAsc:"Click para ordenar en orden ascendente",cancelSort:"Click para cancelar ordenamiento"},Modal:{okText:"Aceptar",cancelText:"Cancelar",justOkText:"Aceptar"},Popconfirm:{okText:"Aceptar",cancelText:"Cancelar"},Transfer:{titles:["",""],searchPlaceholder:"Buscar aquí",itemUnit:"elemento",itemsUnit:"elementos",remove:"Eliminar",selectCurrent:"Seleccionar página actual",removeCurrent:"Remover página actual",selectAll:"Seleccionar todos los datos",removeAll:"Eliminar todos los datos",selectInvert:"Invertir página actual"},Upload:{uploading:"Subiendo...",removeFile:"Eliminar archivo",uploadError:"Error al subir el archivo",previewFile:"Vista previa",downloadFile:"Descargar archivo"},Empty:{description:"No hay datos"},Icon:{icon:"ícono"},Text:{edit:"Editar",copy:"Copiar",copied:"Copiado",expand:"Expandir"},Form:{optional:"(opcional)",defaultValidateMessages:{default:"Error de validación del campo ${label}",required:"Por favor ingresar ${label}",enum:"${label} debe ser uno de [${enum}]",whitespace:"${label} no puede ser un carácter en blanco",date:{format:"El formato de fecha de ${label} es inválido",parse:"${label} no se puede convertir a una fecha",invalid:"${label} es una fecha inválida"},types:{string:Y1,method:Y1,array:Y1,object:Y1,number:Y1,date:Y1,boolean:Y1,integer:Y1,float:Y1,regexp:Y1,email:Y1,url:Y1,hex:Y1},string:{len:"${label} debe tener ${len} caracteres",min:"${label} debe tener al menos ${min} caracteres",max:"${label} debe tener hasta ${max} caracteres",range:"${label} debe tener entre ${min}-${max} caracteres"},number:{len:"${label} debe ser igual a ${len}",min:"${label} valor mínimo es ${min}",max:"${label} valor máximo es ${max}",range:"${label} debe estar entre ${min}-${max}"},array:{len:"Debe ser ${len} ${label}",min:"Al menos ${min} ${label}",max:"A lo mucho ${max} ${label}",range:"El monto de ${label} debe estar entre ${min}-${max}"},pattern:{mismatch:"${label} no coincide con el patrón ${pattern}"}}},Image:{preview:"Previsualización"}};uZe=a2e.default=wNn;var l2e={},ZQ={};Object.defineProperty(ZQ,"__esModule",{value:!0});ZQ.default=void 0;var vNn={items_per_page:"/ sayfa",jump_to:"Git",jump_to_confirm:"onayla",page:"Sayfa",prev_page:"Önceki Sayfa",next_page:"Sonraki Sayfa",prev_5:"Önceki 5 Sayfa",next_5:"Sonraki 5 Sayfa",prev_3:"Önceki 3 Sayfa",next_3:"Sonraki 3 Sayfa",page_size:"sayfa boyutu"};ZQ.default=vNn;var eZ={},xN={},tZ={};Object.defineProperty(tZ,"__esModule",{value:!0});tZ.default=void 0;var xNn={locale:"tr_TR",today:"Bugün",now:"Şimdi",backToToday:"Bugüne Geri Dön",ok:"Tamam",clear:"Temizle",month:"Ay",year:"Yıl",timeSelect:"Zaman Seç",dateSelect:"Tarih Seç",monthSelect:"Ay Seç",yearSelect:"Yıl Seç",decadeSelect:"On Yıl Seç",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Önceki Ay (PageUp)",nextMonth:"Sonraki Ay (PageDown)",previousYear:"Önceki Yıl (Control + Sol)",nextYear:"Sonraki Yıl (Control + Sağ)",previousDecade:"Önceki On Yıl",nextDecade:"Sonraki On Yıl",previousCentury:"Önceki Yüzyıl",nextCentury:"Sonraki Yüzyıl"};tZ.default=xNn;var bN={};Object.defineProperty(bN,"__esModule",{value:!0});bN.default=void 0;const bNn={placeholder:"Zaman seç",rangePlaceholder:["Başlangıç zamanı","Bitiş zamanı"]};bN.default=bNn;var dZe=Md.default;Object.defineProperty(xN,"__esModule",{value:!0});xN.default=void 0;var SNn=dZe(tZ),TNn=dZe(bN);const PNn={lang:Object.assign({placeholder:"Tarih seç",yearPlaceholder:"Yıl seç",quarterPlaceholder:"Çeyrek seç",monthPlaceholder:"Ay seç",weekPlaceholder:"Hafta seç",rangePlaceholder:["Başlangıç tarihi","Bitiş tarihi"],rangeYearPlaceholder:["Başlangıç yılı","Bitiş yılı"],rangeMonthPlaceholder:["Başlangıç ayı","Bitiş ayı"],rangeWeekPlaceholder:["Başlangıç haftası","Bitiş haftası"]},SNn.default),timePickerLocale:Object.assign({},TNn.default)};xN.default=PNn;var CNn=Md.default;Object.defineProperty(eZ,"__esModule",{value:!0});eZ.default=void 0;var RNn=CNn(xN);eZ.default=RNn.default;var nZ=Md.default;Object.defineProperty(l2e,"__esModule",{value:!0});var fZe=l2e.default=void 0,HNn=nZ(ZQ),MNn=nZ(eZ),INn=nZ(xN),zNn=nZ(bN);const O1="${label} geçerli bir ${type} değil",DNn={locale:"tr",Pagination:HNn.default,DatePicker:INn.default,TimePicker:zNn.default,Calendar:MNn.default,global:{placeholder:"Lütfen seçiniz"},Table:{filterTitle:"Filtre menüsü",filterConfirm:"Tamam",filterReset:"Sıfırla",filterEmptyText:"Filtre yok",selectAll:"Tüm sayfayı seç",selectInvert:"Tersini seç",selectionAll:"Tümünü seç",sortTitle:"Sırala",expand:"Satırı genişlet",collapse:"Satırı daralt",triggerDesc:"Azalan düzende sırala",triggerAsc:"Artan düzende sırala",cancelSort:"Sıralamayı kaldır"},Modal:{okText:"Tamam",cancelText:"İptal",justOkText:"Tamam"},Popconfirm:{okText:"Tamam",cancelText:"İptal"},Transfer:{titles:["",""],searchPlaceholder:"Arama",itemUnit:"Öğe",itemsUnit:"Öğeler",remove:"Kaldır",selectCurrent:"Tüm sayfayı seç",removeCurrent:"Sayfayı kaldır",selectAll:"Tümünü seç",removeAll:"Tümünü kaldır",selectInvert:"Tersini seç"},Upload:{uploading:"Yükleniyor...",removeFile:"Dosyayı kaldır",uploadError:"Yükleme hatası",previewFile:"Dosyayı önizle",downloadFile:"Dosyayı indir"},Empty:{description:"Veri Yok"},Icon:{icon:"ikon"},Text:{edit:"Düzenle",copy:"Kopyala",copied:"Kopyalandı",expand:"Genişlet"},Form:{optional:"(opsiyonel)",defaultValidateMessages:{default:"Alan doğrulama hatası ${label}",required:"${label} gerekli bir alan",enum:"${label} şunlardan biri olmalı: [${enum}]",whitespace:"${label} sadece boşluk olamaz",date:{format:"${label} tarih biçimi geçersiz",parse:"${label} bir tarihe dönüştürülemedi",invalid:"${label} geçersiz bir tarih"},types:{string:O1,method:O1,array:O1,object:O1,number:O1,date:O1,boolean:O1,integer:O1,float:O1,regexp:O1,email:O1,url:O1,hex:O1},string:{len:"${label} ${len} karakter olmalı",min:"${label} en az ${min} karakter olmalı",max:"${label} en çok ${max} karakter olmalı",range:"${label} ${min}-${max} karakter arası olmalı"},number:{len:"${label} ${len} olmalı",min:"${label} en az ${min} olmalı",max:"${label} en çok ${max} olmalı",range:"${label} ${min}-${max} arası olmalı"},array:{len:"${label} sayısı ${len} olmalı",min:"${label} sayısı en az ${min} olmalı",max:"${label} sayısı en çok ${max} olmalı",range:"${label} sayısı ${min}-${max} arası olmalı"},pattern:{mismatch:"${label} şu kalıpla eşleşmeli: ${pattern}"}}},Image:{preview:"Önizleme"}};fZe=l2e.default=DNn;var s2e={},oZ={};Object.defineProperty(oZ,"__esModule",{value:!0});oZ.default=void 0;var ENn={items_per_page:"/ сторінці",jump_to:"Перейти",jump_to_confirm:"підтвердити",page:"",prev_page:"Попередня сторінка",next_page:"Наступна сторінка",prev_5:"Попередні 5 сторінок",next_5:"Наступні 5 сторінок",prev_3:"Попередні 3 сторінки",next_3:"Наступні 3 сторінки",page_size:"Page Size"};oZ.default=ENn;var rZ={},SN={},iZ={};Object.defineProperty(iZ,"__esModule",{value:!0});iZ.default=void 0;var FNn={locale:"uk_UA",today:"Сьогодні",now:"Зараз",backToToday:"Поточна дата",ok:"OK",clear:"Очистити",month:"Місяць",year:"Рік",timeSelect:"Обрати час",dateSelect:"Обрати дату",monthSelect:"Обрати місяць",yearSelect:"Обрати рік",decadeSelect:"Обрати десятиріччя",yearFormat:"YYYY",dateFormat:"D-M-YYYY",dayFormat:"D",dateTimeFormat:"D-M-YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Попередній місяць (PageUp)",nextMonth:"Наступний місяць (PageDown)",previousYear:"Попередній рік (Control + left)",nextYear:"Наступний рік (Control + right)",previousDecade:"Попереднє десятиріччя",nextDecade:"Наступне десятиріччя",previousCentury:"Попереднє століття",nextCentury:"Наступне століття"};iZ.default=FNn;var TN={};Object.defineProperty(TN,"__esModule",{value:!0});TN.default=void 0;const kNn={placeholder:"Оберіть час"};TN.default=kNn;var hZe=Md.default;Object.defineProperty(SN,"__esModule",{value:!0});SN.default=void 0;var LNn=hZe(iZ),WNn=hZe(TN);const NNn={lang:Object.assign({placeholder:"Оберіть дату",rangePlaceholder:["Початкова дата","Кінцева дата"]},LNn.default),timePickerLocale:Object.assign({},WNn.default)};SN.default=NNn;var UNn=Md.default;Object.defineProperty(rZ,"__esModule",{value:!0});rZ.default=void 0;var jNn=UNn(SN);rZ.default=jNn.default;var aZ=Md.default;Object.defineProperty(s2e,"__esModule",{value:!0});var pZe=s2e.default=void 0,BNn=aZ(oZ),YNn=aZ(rZ),ONn=aZ(SN),_Nn=aZ(TN);const _1="${label} не є типом ${type}",VNn={locale:"uk",Pagination:BNn.default,DatePicker:ONn.default,TimePicker:_Nn.default,Calendar:YNn.default,global:{placeholder:"Будь ласка, оберіть"},Table:{filterTitle:"Фільтрувати",filterConfirm:"OK",filterReset:"Скинути",filterEmptyText:"Фільтри відсутні",filterCheckall:"Обрати всі",filterSearchPlaceholder:"Пошук у фільтрах",emptyText:"Даних немає",selectAll:"Обрати всі на сторінці",selectInvert:"Інвертувати вибір",selectNone:"Очистити вибір",selectionAll:"Обрати всі",sortTitle:"Сортувати",expand:"Розгорнути рядок",collapse:"Згорнути рядок",triggerDesc:"Сортувати за спаданням",triggerAsc:"Сортувати за зростанням",cancelSort:"Відмінити сортування"},Tour:{Next:"Далі",Previous:"Назад",Finish:"Завершити"},Modal:{okText:"Гаразд",cancelText:"Скасувати",justOkText:"Гаразд"},Popconfirm:{okText:"Гаразд",cancelText:"Скасувати"},Transfer:{titles:["",""],searchPlaceholder:"Введіть текст для пошуку",itemUnit:"елем.",itemsUnit:"елем.",remove:"Видалити",selectCurrent:"Вибрати поточну сторінку",removeCurrent:"Скасувати вибір на сторінці",selectAll:"Вибрати всі дані",removeAll:"Скасувати вибір",selectInvert:"Інвертувати поточну сторінку"},Upload:{uploading:"Завантаження ...",removeFile:"Видалити файл",uploadError:"Помилка завантаження",previewFile:"Попередній перегляд файлу",downloadFile:"Завантажити файл"},Empty:{description:"Даних немає"},Icon:{icon:"іконка"},Text:{edit:"Редагувати",copy:"Скопіювати",copied:"Скопійовано",expand:"Розширити"},Form:{optional:"(опціонально)",defaultValidateMessages:{default:"Помилка валідації для поля ${label}",required:"Будь ласка, заповніть ${label}",enum:"Лише одне зі значень [${enum}] доступне для ${label}",whitespace:"Значення у полі ${label} не може бути пробілом",date:{format:"Не валідний формат дати у ${label}",parse:"Значення ${label} не може бути приведене до дати",invalid:"Не валідна дата у ${label}"},types:{string:_1,method:_1,array:_1,object:_1,number:_1,date:_1,boolean:_1,integer:_1,float:_1,regexp:_1,email:_1,url:_1,hex:_1},string:{len:"${label} має містити ${len} символів",min:"${label} має містити не менш, ніж ${min} символів",max:"${label} має містити не більш, ніж ${max} символів",range:"${label} має містити ${min}-${max} символів"},number:{len:"${label} має дорівнювати ${len}",min:"${label} має бути не менш, ніж ${min}",max:"${label} має бути не більш, ніж ${max}",range:"${label} має бути в межах ${min}-${max}"},array:{len:"${label} має містити ${len} елементи",min:"${label} має містити не менш, ніж ${min} елементи",max:"${label} має містити не більш, ніж ${max} елементи",range:"Кількість елементів в ${label} має бути в межах ${min}-${max}"},pattern:{mismatch:"${label} не відповідає шаблону ${pattern}"}}},Image:{preview:"Попередній перегляд"},QRCode:{expired:"QR-код закінчився",refresh:"Оновити"}};pZe=s2e.default=VNn;const GNn=be.memo(()=>{const t=H(s0),e=n=>{H.getState().set(o=>{switch(o.language=n.target.value,o.language){case"zh_cn":o.locale=iZe;break;case"zh_tw":o.locale=sZe;break;case"es":o.locale=uZe;break;case"tr":o.locale=fZe;break;case"ua":o.locale=pZe;break;default:o.locale=p1e}})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,update:!0,children:h.jsx(Ue.Group,{value:t,style:{height:"170px"},onChange:e,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:"en",children:s9.English}),h.jsx(Ue,{style:{width:"100%"},value:"es",children:s9.Spanish}),h.jsx(Ue,{style:{width:"100%"},value:"zh_cn",children:s9.ChineseSimplified}),h.jsx(Ue,{style:{width:"100%"},value:"zh_tw",children:s9.ChineseTraditional}),h.jsx(Ue,{style:{width:"100%"},value:"tr",children:s9.Turkish}),h.jsx(Ue,{style:{width:"100%"},value:"ua",children:s9.Ukrainian})]})})})}),XNn=(t,e,n)=>{const o={lng:H.getState().language},r=()=>{ht.getState().set(l=>{l.showModelsGallery=!0,l.leaderboardFlag=!0,l.openModelsMap=!1})},i=()=>{ht.getState().set(l=>{l.modelsMapFlag=!0,l.modelsMapWeatherStations=!1,l.openModelsMap=!0,l.showModelsGallery=!1}),H.getState().loggable&&H.getState().set(l=>{l.actionInfo={name:"Open Models Map",timestamp:new Date().getTime()}})},a=[];return t&&!e&&a.push({key:"my-models",label:h.jsxs(rn,{noPadding:!0,onClick:r,children:[Y.t("menu.ModelsGallery",o),"..."]})}),n||a.push({key:"models-map",label:h.jsxs(rn,{noPadding:!0,onClick:i,children:[Y.t("menu.ModelsMap",o),"..."]})}),a},gX=()=>{const t=Fn.getState().orbitControlsRef;if(t!=null&&t.current){const e=Math.min(50,H.getState().sceneRadius*4);t.current.object.position.set(e,e,e),t.current.target.set(0,0,0),t.current.update(),H.getState().set(n=>{const o=n.viewState;o.cameraPosition=[e,e,e],o.panCenter=[0,0,0]})}},mX=t=>{if(H.getState().viewState.orthographic){const e=H.getState().viewState.cameraZoom??20,n=e,o=e/t,r={name:"Zoom",timestamp:Date.now(),oldValue:n,newValue:o,undo:()=>{H.getState().set(i=>{i.viewState.cameraZoom=r.oldValue})},redo:()=>{H.getState().set(i=>{i.viewState.cameraZoom=r.newValue})}};H.getState().addUndoable(r),H.getState().set(i=>{i.viewState.cameraZoom=o})}else{const e=Fn.getState().orbitControlsRef;if(e!=null&&e.current){const n=e.current.object.position,o=n.x*t,r=n.y*t,i=n.z*t,a={name:"Zoom",timestamp:Date.now(),oldCameraPosition:[n.x,n.y,n.z],newCameraPosition:[o,r,i],undo:()=>{var u,d;const l=a.oldCameraPosition[0],s=a.oldCameraPosition[1],c=a.oldCameraPosition[2];(u=e.current)==null||u.object.position.set(l,s,c),(d=e.current)==null||d.update(),H.getState().set(f=>{f.viewState.cameraPosition=[l,s,c]})},redo:()=>{var u,d;const l=a.newCameraPosition[0],s=a.newCameraPosition[1],c=a.newCameraPosition[2];(u=e.current)==null||u.object.position.set(l,s,c),(d=e.current)==null||d.update(),H.getState().set(f=>{f.viewState.cameraPosition=[l,s,c]})}};H.getState().addUndoable(a),e.current.object.position.set(o,r,i),e.current.update(),H.getState().set(l=>{l.viewState.cameraPosition=[o,r,i]})}}},JNn=(t,e)=>{const n={lng:H.getState().language},o=H.getState().viewState.orthographic,r=H.getState().viewState.cameraPosition,i=H.getState().viewState.panCenter,a=r[0]===r[1]&&r[1]===r[2]&&i[0]===0&&i[1]===0&&i[2]===0,l=()=>{const C={name:"Reset View",timestamp:Date.now(),oldCameraPosition:[...r],oldPanCenter:[...i],undo:()=>{const P=Fn.getState().orbitControlsRef;P!=null&&P.current&&(P.current.object.position.set(C.oldCameraPosition[0],C.oldCameraPosition[1],C.oldCameraPosition[2]),P.current.target.set(C.oldPanCenter[0],C.oldPanCenter[1],C.oldPanCenter[2]),P.current.update(),H.getState().set(v=>{const T=v.viewState;T.cameraPosition=[...C.oldCameraPosition],T.panCenter=[...C.oldPanCenter]}))},redo:()=>{gX()}};H.getState().addUndoable(C),gX(),H.getState().set(P=>{P.objectTypeToAdd=z.None,P.groupActionMode=!1,P.viewState.orthographic=!1})},s=()=>{mX(1.1)},c=()=>{mX(.9)},u=C=>{const P=H.getState().setNavigationView,v={name:"Toggle Navigation View",timestamp:Date.now(),checked:C.target.checked,undo:()=>{P(!v.checked)},redo:()=>{P(v.checked)}};H.getState().addUndoable(v),H.getState().set(T=>{T.viewState.autoRotate=!1}),P(C.target.checked)},d=C=>{const P=H.getState().set2DView,v={name:"Toggle 2D View",timestamp:Date.now(),checked:C.target.checked,undo:()=>{P(!v.checked)},redo:()=>{P(v.checked)}};H.getState().addUndoable(v),P(C.target.checked),H.getState().set(T=>{T.viewState.autoRotate=!1})},f=C=>{if(!H.getState().viewState.orthographic){const P={name:"Auto Rotate",timestamp:Date.now(),checked:C.target.checked,undo:()=>{H.getState().set(v=>{v.objectTypeToAdd=z.None,v.groupActionMode=!1,v.viewState.autoRotate=!P.checked})},redo:()=>{H.getState().set(v=>{v.objectTypeToAdd=z.None,v.groupActionMode=!1,v.viewState.autoRotate=P.checked})}};H.getState().addUndoable(P),H.getState().set(v=>{v.objectTypeToAdd=z.None,v.groupActionMode=!1,v.viewState.autoRotate=!v.viewState.autoRotate})}},p=C=>{const P=C.target.checked,v={name:"Show Axes",timestamp:Date.now(),checked:P,undo:()=>{H.getState().set(T=>{T.viewState.axes=!v.checked})},redo:()=>{H.getState().set(T=>{T.viewState.axes=v.checked})}};H.getState().addUndoable(v),H.getState().set(T=>{T.viewState.axes=P})},g=C=>{const P={name:"Show Shadow",timestamp:Date.now(),checked:C.target.checked,undo:()=>{H.getState().set(v=>{v.viewState.shadowEnabled=!P.checked,v.viewState.shadowEnabled&&v.updateSceneRadius()})},redo:()=>{H.getState().set(v=>{v.viewState.shadowEnabled=P.checked,v.viewState.shadowEnabled&&v.updateSceneRadius()})}};H.getState().addUndoable(P),H.getState().set(v=>{v.viewState.shadowEnabled=C.target.checked,v.viewState.shadowEnabled&&v.updateSceneRadius()})},y=C=>{const P=C.target.checked?ew:0,v={name:"Set Surface Shininess",timestamp:Date.now(),oldValue:H.getState().viewState.solarPanelShininess??ew,newValue:P,undo:()=>{H.getState().set(T=>{T.viewState.solarPanelShininess=v.oldValue})},redo:()=>{H.getState().set(T=>{T.viewState.solarPanelShininess=v.newValue})}};H.getState().addUndoable(v),H.getState().set(T=>{T.viewState.solarPanelShininess=P})},w=C=>{const P=H.getState().floatingWindowOpacity,v=C.target.checked?m0:1,T={name:"Floating Window Opacity",timestamp:Date.now(),oldValue:P,newValue:v,undo:()=>{H.getState().set(A=>{A.floatingWindowOpacity=T.oldValue})},redo:()=>{H.getState().set(A=>{A.floatingWindowOpacity=T.newValue})}};H.getState().addUndoable(T),H.getState().set(A=>{A.floatingWindowOpacity=v})},b=[];return!o&&!a&&b.push({key:"reset-view",label:h.jsxs(rn,{onClick:l,children:[Y.t("menu.view.ResetView",n),h.jsxs(lh,{children:["(",t,")"]})]})}),b.push({key:"zoom-out-view",label:h.jsxs(rn,{onClick:s,children:[Y.t("menu.view.ZoomOut",n),h.jsxs(lh,{children:["(",e?"⌘":"Ctrl","+])"]})]})}),b.push({key:"zoom-in-view",label:h.jsxs(rn,{onClick:c,children:[Y.t("menu.view.ZoomIn",n),h.jsxs(lh,{children:["(",e?"⌘":"Ctrl","+[)"]})]})}),b.push({key:"navigation-view-check-box",label:h.jsxs(f2,{selector:Wq,onChange:u,children:[Y.t("menu.view.NavigationView",n),h.jsxs(lh,{children:["(",mre,"+Q)"]})]})}),b.push({key:"orthographic-check-box",label:h.jsxs(f2,{selector:Id,onChange:d,children:[Y.t("menu.view.TwoDimensionalView",n),h.jsxs(lh,{children:["(",mre,"+B)"]})]})}),o||b.push({key:"auto-rotate-check-box",label:h.jsxs(f2,{selector:bBe,onChange:f,children:[Y.t("menu.view.AutoRotate",n),h.jsxs(lh,{children:["(",mre,"+M)"]})]})}),b.push({key:"axes-check-box",label:h.jsx(f2,{selector:Age,onChange:p,children:Y.t("skyMenu.Axes",n)})}),b.push({key:"shadow-check-box",label:h.jsx(f2,{selector:Ds,onChange:g,children:Y.t("menu.view.ShowShadow",n)})}),b.push({key:"shininess-check-box",label:h.jsx(f2,{selector:C=>C.viewState.solarPanelShininess===void 0||C.viewState.solarPanelShininess>0,onChange:y,children:Y.t("menu.view.ShowSurfaceShininess",n)})}),b.push({key:"translucency-check-box",label:h.jsx(f2,{selector:C=>C.floatingWindowOpacity<1,onChange:w,children:Y.t("menu.view.TranslucentFloatingWindows",n)})}),b},KNn=()=>{const t={lng:H.getState().language},e=H.getState().set,n=H.getState().addUndoable,o=H.getState().viewState.showHeliodonPanel,r=H.getState().viewState.showMapPanel,i=H.getState().viewState.showWeatherPanel,a=H.getState().viewState.showDiurnalTemperaturePanel,l=ht.getState().showEconomicsPanel,s=ht.getState().showNavigationPanel,c=ht.getState().showShadowSettings,u=H.getState().loggable,d=()=>{const P={name:"Open Sun and Time Settings Panel",timestamp:Date.now(),undo:()=>{e(v=>{v.viewState.showHeliodonPanel=!1})},redo:()=>{e(v=>{v.viewState.showHeliodonPanel=!0})}};n(P),e(v=>{v.viewState.showHeliodonPanel=!0,v.selectedFloatingWindow="heliodonPanel"})},f=()=>{const P={name:"Open Maps",timestamp:Date.now(),undo:()=>{e(v=>{v.viewState.showMapPanel=!1})},redo:()=>{e(v=>{v.viewState.showMapPanel=!0})}};n(P),e(v=>{v.viewState.showMapPanel=!0,v.selectedFloatingWindow="mapPanel"})},p=()=>{const P={name:"Open Weather Panel",timestamp:Date.now(),undo:()=>{e(v=>{v.viewState.showWeatherPanel=!1})},redo:()=>{e(v=>{v.viewState.showWeatherPanel=!0})}};n(P),e(v=>{v.viewState.showWeatherPanel=!0,v.selectedFloatingWindow="weatherPanel"})},g=()=>{const P={name:"Open Diurnal Temperature Panel",timestamp:Date.now(),undo:()=>{e(v=>{v.viewState.showDiurnalTemperaturePanel=!1})},redo:()=>{e(v=>{v.viewState.showDiurnalTemperaturePanel=!0})}};n(P),e(v=>{v.viewState.showDiurnalTemperaturePanel=!0,v.selectedFloatingWindow="diurnalTemperaturePanel"})},y=()=>{ht.getState().set(P=>{P.showEconomicsPanel=!0}),u&&e(P=>{P.actionInfo={name:"Open Economics Panel",timestamp:new Date().getTime()}})},w=()=>{ht.getState().set(P=>{P.showNavigationPanel=!0}),u&&e(P=>{P.actionInfo={name:"Open Navigation Panel",timestamp:new Date().getTime()}})},b=()=>{ht.getState().set(P=>{P.showShadowSettings=!0}),u&&e(P=>{P.actionInfo={name:"Open Shadow Settings",timestamp:new Date().getTime()}})},C=[];return o||C.push({key:"sun-time",label:h.jsxs(rn,{noPadding:!0,onClick:d,children:[Y.t("menu.settings.SunAndTime",t),"..."]})}),r||C.push({key:"show-map-panel",label:h.jsxs(rn,{noPadding:!0,onClick:f,children:[Y.t("word.Location",t),"..."]})}),i||C.push({key:"weather-panel",label:h.jsxs(rn,{noPadding:!0,onClick:p,children:[Y.t("menu.settings.WeatherData",t),"..."]})}),a||C.push({key:"diurnal-temperature-panel",label:h.jsxs(rn,{noPadding:!0,onClick:g,children:[Y.t("menu.settings.DiurnalTemperature",t),"..."]})}),l||C.push({key:"economics-panel",label:h.jsxs(rn,{noPadding:!0,onClick:y,children:[Y.t("economicsPanel.EconomicsParameters",t),"..."]})}),s||C.push({key:"navigation-panel",label:h.jsxs(rn,{noPadding:!0,onClick:w,children:[Y.t("navigationPanel.NavigationParameters",t),"..."]})}),c||C.push({key:"shadow-settings",label:h.jsxs(rn,{noPadding:!0,onClick:b,children:[Y.t("shadowSettingsPanel.ShadowSettings",t),"..."]})}),C},qNn=()=>{const t={lng:H.getState().language},e=H.getState().set,n=H.getState().addUndoable,o=s=>{const c=s.target.checked,u={name:"Show Site Information",timestamp:Date.now(),checked:c,undo:()=>{e(d=>{d.viewState.showSiteInfoPanel=!u.checked})},redo:()=>{e(d=>{d.viewState.showSiteInfoPanel=u.checked})}};n(u),e(d=>{d.viewState.showSiteInfoPanel=c})},r=s=>{const c=s.target.checked,u={name:"Show Design Information",timestamp:Date.now(),checked:c,undo:()=>{e(d=>{d.viewState.showDesignInfoPanel=!u.checked})},redo:()=>{e(d=>{d.viewState.showDesignInfoPanel=u.checked})}};n(u),e(d=>{d.viewState.showDesignInfoPanel=!d.viewState.showDesignInfoPanel})},i=s=>{const c={name:"Show Instruction Panel",timestamp:Date.now(),checked:s.target.checked,undo:()=>{e(u=>{u.viewState.showInstructionPanel=!c.checked})},redo:()=>{e(u=>{u.viewState.showInstructionPanel=c.checked})}};n(c),e(u=>{u.viewState.showInstructionPanel=!u.viewState.showInstructionPanel})},a=s=>{const c={name:"Show Sticky Note",timestamp:Date.now(),checked:s.target.value,undo:()=>{e(u=>{u.viewState.showStickyNotePanel=!c.checked})},redo:()=>{e(u=>{u.viewState.showStickyNotePanel=c.checked})}};n(c),e(u=>{u.viewState.showStickyNotePanel=!u.viewState.showStickyNotePanel})};return[{key:"site-info-panel-check-box",label:h.jsx(f2,{selector:vge,onChange:o,children:Y.t("menu.view.accessories.SiteInformation",t)})},{key:"design-info-panel-check-box",label:h.jsx(f2,{selector:Uq,onChange:r,children:Y.t("menu.view.accessories.DesignInformation",t)})},{key:"instruction-panel-check-box",label:h.jsx(f2,{selector:MBe,onChange:i,children:Y.t("menu.view.accessories.Instruction",t)})},{key:"sticky-note-panel-check-box",label:h.jsx(f2,{selector:zBe,onChange:a,children:Y.t("menu.view.accessories.StickyNote",t)})}]};var ag=(t=>(t[t.NO_BUILDING=3]="NO_BUILDING",t[t.AT_LEAST_ONE_BAD_NO_GOOD=2]="AT_LEAST_ONE_BAD_NO_GOOD",t[t.AT_LEAST_ONE_BAD_AT_LEAST_ONE_GOOD=1]="AT_LEAST_ONE_BAD_AT_LEAST_ONE_GOOD",t[t.OK=0]="OK",t))(ag||{});const wO=50,yX=(t,e,n)=>{if(e(z.Foundation)===0)return{status:3};let r=!1,i=!1,a;for(const l of t)if(l.type===z.Foundation){const s=l;if(s.notBuilding)continue;if(n(z.Wall,s.id).length>0){const u=me.getBuildingCompletionStatus(s,t);u===jc.COMPLETE?r=!0:(i=!0,a=u)}else i=!0}return i&&!r?{status:2,buildingCompletion:a}:i&&r?{status:1}:{status:0}},K7=t=>{if(!t.color)return .5;const e=t.color.toLowerCase();if(e==="white")return .05;if(e==="black")return .95;const n=parseInt(t.color.substring(1),16),o=n>>16&255,r=n>>8&255,i=n&255;let a=Math.min(o,r);a=Math.min(a,i);let l=Math.max(o,r);return l=Math.max(l,i),Math.min(.95,Math.max(.05,1-(a+l)/510))},vO=(t,e,n,o)=>e<0&&t.low>=n-o||e>0&&t.high<=n+o?0:e,$x=(t,e,n,o,r,i)=>{if(n===y2.Sinusoidal)return .5*(t+e)-.5*(t-e)*Math.cos(rde*(i-(o-720)));const a=.5*(t+e),l=.5*(t-e),s=r.daylight();if(i>r.sunrise&&ir.sunset){const p=i-r.sunset;return e+(u-e)*Math.exp(-d*p/c)}const f=i+23*60-r.sunset;return e+(u-e)*Math.exp(-d*f/c)},Qx=(t,e,n)=>{const o=t.getFullYear(),r=t.getMonth(),i=t.getDate(),l=me.daysOfMonth(r,o)/2;let s,c,u;if(i11&&(c=0);const p=me.daysOfMonth(c,o)/2,g=l+p;u=(i-l)/g}const d=e[s]+(e[c]-e[s])*u,f=n[s]+(n[c]-n[s])*u;return{low:d,high:f}},$Nn=(t,e,n,o,r,i)=>{const a=n.length;let l=0,s=-1e3,c=1e3,u=-1e3,d=1e3;for(let g=0;go[g]&&(c=o[g]),d>n[g]&&(d=n[g]);l/=2*a;const f=.25*(s-c+u-d),p=i*Math.sqrt(Xie/(2*r));return t>0?l-f*Math.exp(-p)*Math.cos(Xie*(e-HSe)-p):l-f*Math.exp(-p)*Math.cos(Math.PI+Xie*(e-HSe)-p)},gZe=(t,e,n,o,r,i,a,l,s)=>$Nn(t,e,o,r,l,s)-Math.exp(-s*Math.sqrt(rde/(2*l)))*a*Math.cos(rde*(n-(i-720)-KQt)),{Option:q7}=_o,lZ=be.memo(({type:t})=>{const e=H(UBe),n=H(C8t),o=H(H8t),r=Jt(),i=m.useMemo(()=>{switch(t){case ns.CSP:return n;case ns.SUT:return o;default:return e}},[t,e,n,o]);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{width:"150px"},children:Y.t("menu.option.SamplingFrequency",r)+":"}),h.jsxs(_o,{style:{width:"72px"},value:i??4,onChange:a=>{H.getState().set(l=>{switch(t){case ns.CSP:l.world.cspTimesPerHour=a;break;case ns.SUT:l.world.sutTimesPerHour=a;break;default:l.world.timesPerHour=a;break}})},children:[h.jsx(q7,{value:1,children:"1"},1),h.jsx(q7,{value:2,children:"2"},2),h.jsx(q7,{value:3,children:"3"},3),h.jsx(q7,{value:4,children:"4"},4),h.jsx(q7,{value:6,children:"6"},6),h.jsx(q7,{value:12,children:"12"},12),h.jsx(q7,{value:30,children:"30"},30)]}),h.jsx(en,{style:{paddingLeft:"10px"},children:Y.t("menu.option.TimesPerHour",r)})]})}),{Option:lae}=_o,sZ=be.memo(({type:t})=>{const e=H(IH),n=H(uW),o=H(BBe),r=Jt(),i=m.useMemo(()=>{switch(t){case ns.CSP:return n;case ns.SUT:return o;default:return e}},[t,e,n,o]);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsxs(_o,{style:{marginLeft:"150px",width:"72px"},value:i??6,onChange:a=>{switch(t){case ns.BUILDING:H.getState().set(l=>{l.world.daysPerYear=a});break;case ns.PV:H.getState().set(l=>{l.world.daysPerYear=a}),Tn.setState({yearlyPvYield:[]});break;case ns.CSP:H.getState().set(l=>{l.world.cspDaysPerYear=a}),Tn.setState({yearlyParabolicTroughYield:[],yearlyParabolicDishYield:[],yearlyFresnelReflectorYield:[],yearlyHeliostatYield:[]});break;case ns.SUT:H.getState().set(l=>{l.world.sutDaysPerYear=a}),Tn.setState({yearlyUpdraftTowerYield:[]});break}},children:[h.jsx(lae,{value:4,children:"4"},4),h.jsx(lae,{value:6,children:"6"},6),h.jsx(lae,{value:12,children:"12"},12)]}),h.jsx(en,{style:{paddingLeft:"10px"},children:Y.t("menu.option.DaysPerYear",r)})]})}),PN=be.memo(({type:t})=>{const e=H(S8t),n=H(T8t),o=H(R8t),r=H(M8t),i=Jt(),a=m.useMemo(()=>{switch(t){case ns.PV:return n;case ns.CSP:return o;case ns.SUT:return r;default:return e}},[t,n,o,r,e]);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{width:"150px"},children:Y.t("menu.option.GridCellSize",i)+":"}),h.jsx(Mn,{min:.1,max:5,step:.05,style:{width:72},precision:2,value:a??.5,onChange:l=>{l!==null&&H.getState().set(s=>{switch(t){case ns.PV:s.world.pvGridCellSize=l;break;case ns.CSP:s.world.cspGridCellSize=l;break;case ns.SUT:s.world.sutGridCellSize=l;break;default:s.world.solarRadiationHeatmapGridCellSize=l;break}})}}),h.jsx(en,{style:{paddingLeft:"10px"},children:Y.t("word.MeterAbbreviation",i)})]})}),QNn=()=>[{key:"building-energy-simulation-sampling-frequency",label:h.jsx(lZ,{type:ns.BUILDING})},{key:"building-energy-simulation-sampling-days",label:h.jsx(sZ,{type:ns.BUILDING})},{key:"building-energy-simulation-grid-cell-size",label:h.jsx(PN,{type:ns.BUILDING})}],{Option:tPe}=_o,ZNn=be.memo(()=>{const t=Jt(),e=H(b8t);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{width:"150px"},children:Y.t("menu.solarPanel.PanelDiscretization",t)+":"}),h.jsxs(_o,{style:{width:"165px"},value:e??Fm.APPROXIMATE,onChange:n=>{H.getState().set(o=>{o.world.discretization=n})},children:[h.jsx(tPe,{value:Fm.EXACT,children:Y.t("menu.solarPanel.Exact",t)},Fm.EXACT),h.jsx(tPe,{value:Fm.APPROXIMATE,children:Y.t("menu.solarPanel.Approximate",t)},Fm.APPROXIMATE)]})]})}),eUn=be.memo(()=>{const t=Jt(),e=H(Pge);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{width:"280px"},children:Y.t("menu.solarPanel.SolarPanelSimulationNoAnimation",t)+":"}),h.jsx(xc,{checked:e,onChange:n=>{H.getState().set(o=>{o.world.noAnimationForSolarPanelSimulation=n})}})]})}),tUn=t=>{const e=H.getState().world.discretization,n=[{key:"solar-panel-simulation-sampling-frequency",label:h.jsx(lZ,{type:ns.PV})},{key:"solar-panel-simulation-sampling-days",label:h.jsx(sZ,{type:ns.PV})},{key:"solar-panel-discretization",label:h.jsx(ZNn,{})}];return(!e||e===Fm.APPROXIMATE)&&n.push({key:"solar-panel-simulation-grid-cell-size",label:h.jsx(PN,{type:ns.PV})}),t||n.push({key:"solar-panel-simulation-no-animation",label:h.jsx(eUn,{})}),n},xO=t=>[{key:`${t}-simulation-sampling-frequency`,label:h.jsx(lZ,{type:ns.CSP})},{key:`${t}-simulation-sampling-days`,label:h.jsx(sZ,{type:ns.CSP})},{key:`${t}-simulation-grid-cell-size`,label:h.jsx(PN,{type:ns.CSP})}],nUn=be.memo(()=>{const t=Jt(),e=H(Cf);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{width:"280px"},children:Y.t("menu.physics.SolarRadiationHeatmapMaxValue",t)+":"}),h.jsx(Mn,{min:.5,max:50,step:.5,style:{width:60},precision:1,value:e??5,onChange:n=>{H.getState().set(o=>{n!==null&&(o.viewState.solarRadiationHeatMapMaxValue=n)})}})]})}),oUn=be.memo(()=>{const t=Jt(),e=H(UBe);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{width:"150px"},children:Y.t("menu.option.SamplingFrequency",t)+":"}),h.jsx(Mn,{min:1,max:60,step:1,style:{width:60},precision:0,value:e,formatter:n=>Number(n).toFixed(0),onChange:n=>{n!==null&&H.getState().set(o=>{o.world.timesPerHour=n})}}),h.jsx(en,{style:{paddingLeft:"10px"},children:Y.t("menu.option.TimesPerHour",t)})]})}),rUn=be.memo(()=>{const t=Jt(),e=H(P8t);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{paddingRight:"10px"},children:Y.t("menu.solarPanel.VisibilityGridCellSize",t)+":"}),h.jsx(Mn,{min:.1,max:5,step:.1,style:{width:60},precision:1,value:e??.2,onChange:n=>{n!==null&&H.getState().set(o=>{o.world.solarPanelVisibilityGridCellSize=n})}}),h.jsx(en,{style:{paddingLeft:"10px"},children:Y.t("word.MeterAbbreviation",t)})]})}),iUn=()=>[{key:"sut-simulation-sampling-frequency",label:h.jsx(lZ,{type:ns.SUT})},{key:"sut-simulation-sampling-days",label:h.jsx(sZ,{type:ns.SUT})},{key:"sut-simulation-grid-cell-size",label:h.jsx(PN,{type:ns.SUT})}],aUn=t=>{const e={lng:H.getState().language},n=ht.getState().setPrimitiveStore,o=H.getState().set,r=H.getState().selectNone,i=H.getState().countElementsByType,a=H.getState().countHeatmapCells,l=ht.getState().runDynamicSimulation,s=ht.getState().runStaticSimulation,c=H.getState().world.noAnimationForHeatmapSimulation,u=H.getState().elements,d=H.getState().loggable,f=me.hasMovingParts(u),p=[],g=()=>{s||hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{r(),n("runStaticSimulation",!s),d&&o(B=>{B.actionInfo={name:"Generate Daily Solar Radiation Heatmap (Static)",timestamp:new Date().getTime()}})},100)},y=()=>{l||hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{r(),n("runDynamicSimulation",!l),d&&o(B=>{B.actionInfo={name:"Generate Daily Solar Radiation Heatmap (Dynamic)",timestamp:new Date().getTime()}})},100)},w=()=>{a()>nje?Oi.confirm({title:Y.t("message.CalculationMayBeSlowDoYouWantToContinue",e)+" ("+Y.t("message.IncreaseSolarRadiationHeatmapGridCellSizeToSpeedUp",e)+")",icon:h.jsx($W,{}),onOk:()=>{b()},onCancel:()=>{},okText:`${Y.t("word.Yes",e)}`,cancelText:`${Y.t("word.No",e)}`}):b()},b=()=>{!c||f?y():g()},C=()=>{if(i(z.Sensor)===0){hn(Y.t("analysisManager.NoSensorForCollectingData",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{d&&o(_=>{_.actionInfo={name:"Collect Daily Data for Sensors",timestamp:new Date().getTime()}}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailyLightSensor=!0})},100)},P=()=>{if(i(z.Sensor)===0){hn(Y.t("analysisManager.NoSensorForCollectingData",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{d&&o(_=>{_.actionInfo={name:"Collect Yearly Data for Sensors",timestamp:new Date().getTime()}}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runYearlyLightSensor=!0})},100)},v=()=>{const B=yX(u,H.getState().countElementsByType,H.getState().getChildrenOfType);if(B.status===ag.NO_BUILDING){hn(Y.t("analysisManager.NoBuildingForAnalysis",e));return}if(B.status===ag.AT_LEAST_ONE_BAD_NO_GOOD){let _;switch(B.buildingCompletion){case jc.WALL_DISJOINED:_=Y.t("message.WallsAreNotConnected",e);break;case jc.WALL_EMPTY:_=Y.t("message.BuildingContainsEmptyWall",e);break;case jc.ROOF_MISSING:_=Y.t("message.BuildingRoofMissing",e);break;default:_=Y.t("message.UnknownErrors",e)}po(Y.t("message.SimulationWillNotStartDueToErrors",e)+": "+_);return}B.status===ag.AT_LEAST_ONE_BAD_AT_LEAST_ONE_GOOD&&SR(Y.t("message.SimulationWillStartDespiteWarnings",e)),hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{r(),d&&o(_=>{_.actionInfo={name:"Analyze Daily Building Energy",timestamp:new Date().getTime()}}),ht.getState().set(_=>{_.runDailyThermalSimulation=!0,_.simulationInProgress=!0})},100)},T=()=>{const B=yX(u,H.getState().countElementsByType,H.getState().getChildrenOfType);if(B.status===ag.NO_BUILDING){hn(Y.t("analysisManager.NoBuildingForAnalysis",e));return}if(B.status===ag.AT_LEAST_ONE_BAD_NO_GOOD){let _;switch(B.buildingCompletion){case jc.WALL_DISJOINED:_=Y.t("message.WallsAreNotConnected",e);break;case jc.WALL_EMPTY:_=Y.t("message.BuildingContainsEmptyWall",e);break;case jc.ROOF_MISSING:_=Y.t("message.BuildingRoofMissing",e);break;default:_=Y.t("message.UnknownErrors",e)}po(Y.t("message.SimulationWillNotStartDueToErrors",e)+": "+_);return}B.status===ag.AT_LEAST_ONE_BAD_AT_LEAST_ONE_GOOD&&SR(Y.t("message.SimulationWillStartDespiteWarnings",e)),hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{r(),ht.getState().set(_=>{_.runYearlyThermalSimulation=!0,_.simulationInProgress=!0}),d&&o(_=>{_.actionInfo={name:"Analyze Yearly Building Energy",timestamp:new Date().getTime()}})},100)},A=()=>{if(i(z.SolarPanel)===0){hn(Y.t("analysisManager.NoSolarPanelForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.dailyPvIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Daily Simulation For Solar Panels",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailySimulationForSolarPanels=!0})},100)},x=()=>{if(i(z.SolarPanel)===0){hn(Y.t("analysisManager.NoSolarPanelForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.yearlyPvIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Yearly Simulation For Solar Panels",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runYearlySimulationForSolarPanels=!0})},100)},S=()=>{if(H.getState().countObservers()===0){hn(Y.t("analysisManager.NoObserverForVisibilityAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{ht.getState().set(_=>{_.runSolarPanelVisibilityAnalysis=!_.runSolarPanelVisibilityAnalysis,_.simulationInProgress=!0}),d&&o(_=>{_.actionInfo={name:"Run Visibility Analysis For Solar Panels",timestamp:new Date().getTime()}})},100)},R=()=>{if(i(z.ParabolicTrough)===0){hn(Y.t("analysisManager.NoParabolicTroughForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.dailyParabolicTroughIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Daily Simulation for Parabolic Troughs",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailySimulationForParabolicTroughs=!0})},100)},M=()=>{if(i(z.ParabolicTrough)===0){hn(Y.t("analysisManager.NoParabolicTroughForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.yearlyParabolicTroughIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Yearly Simulation for Parabolic Troughs",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runYearlySimulationForParabolicTroughs=!0})},100)},D=()=>{if(i(z.ParabolicDish)===0){hn(Y.t("analysisManager.NoParabolicDishForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.dailyParabolicDishIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Daily Simulation for Parabolic Dishes",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailySimulationForParabolicDishes=!0})},100)},E=()=>{if(i(z.ParabolicDish)===0){hn(Y.t("analysisManager.NoParabolicDishForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.yearlyParabolicDishIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Yearly Simulation for Parabolic Dishes",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runYearlySimulationForParabolicDishes=!0})},100)},W=()=>{if(i(z.FresnelReflector)===0){hn(Y.t("analysisManager.NoFresnelReflectorForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.dailyFresnelReflectorIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Daily Simulation for Fresnel Reflectors",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailySimulationForFresnelReflectors=!0})},100)},j=()=>{if(i(z.FresnelReflector)===0){hn(Y.t("analysisManager.NoFresnelReflectorForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.yearlyFresnelReflectorIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Yearly Simulation for Fresnel Reflectors",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runYearlySimulationForFresnelReflectors=!0})},100)},L=()=>{if(i(z.Heliostat)===0){hn(Y.t("analysisManager.NoHeliostatForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.dailyHeliostatIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Daily Simulation for Heliostats",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailySimulationForHeliostats=!0})},100)},k=()=>{if(i(z.Heliostat)===0){hn(Y.t("analysisManager.NoHeliostatForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.yearlyHeliostatIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Yearly Simulation for Heliostats",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runYearlySimulationForHeliostats=!0})},100)},N=()=>{if(H.getState().countSolarStructuresByType(Dn.UpdraftTower)===0){hn(Y.t("analysisManager.NoSolarUpdraftTowerForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.dailyUpdraftTowerIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Daily Simulation for Solar Updraft Tower",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailySimulationForUpdraftTower=!0})},100)},F=()=>{if(H.getState().countSolarStructuresByType(Dn.UpdraftTower)===0){hn(Y.t("analysisManager.NoSolarUpdraftTowerForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.yearlyUpdraftTowerIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Yearly Simulation for Solar Updraft Tower",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runYearlySimulationForUpdraftTower=!0})},100)},U=[];U.push({key:"solar-radiation-heatmap-grid-cell-size",label:h.jsx(PN,{type:ns.BUILDING})}),U.push({key:"solar-radiation-heatmap-max-value",label:h.jsx(nUn,{})}),me.hasHeliostatOrFresnelReflectors(u)&&U.push({key:"solar-radiation-heatmap-reflection-only",label:h.jsx(oae,{selector:yge,onChange:B=>{H.getState().set(_=>{_.world.noAnimationForHeatmapSimulation=B})},children:Y.t("menu.physics.ReflectionHeatmap",e)+":"})}),f||U.push({key:"solar-radiation-heatmap-no-animation",label:h.jsx(oae,{selector:Sge,onChange:B=>{H.getState().set(_=>{_.world.noAnimationForHeatmapSimulation=B})},children:Y.t("menu.physics.SolarRadiationHeatmapNoAnimation",e)+":"})}),p.push({key:"physics-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.physicsSubMenu",e)}),children:[{key:"daily-solar-radiation-heatmap",label:h.jsx(rn,{noPadding:!0,onClick:w,children:Y.t("menu.physics.DailySolarRadiationHeatmap",e)})},{key:"solar-radiation-heatmap-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.physics.SolarRadiationHeatmapOptions",e)}),children:U}]});const O=[];return O.push({key:"sensor-simulation-sampling-frequency",label:h.jsx(oUn,{})}),f||O.push({key:"sensor-simulation-no-animation",label:h.jsx(oae,{selector:Tge,onChange:B=>{H.getState().set(_=>{_.world.noAnimationForSensorDataCollection=B})},children:Y.t("menu.sensor.SensorSimulationNoAnimation",e)+":"})}),t.sensorCount>0&&p.push({key:"sensor-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.sensorSubMenu",e)}),children:[{key:"sensor-collect-daily-data",label:h.jsx(rn,{noPadding:!0,onClick:C,children:Y.t("menu.sensor.CollectDailyData",e)})},{key:"sensor-collect-yearly-data",label:h.jsx(rn,{noPadding:!0,onClick:P,children:Y.t("menu.sensor.CollectYearlyData",e)})},{key:"sensor-simulation-options-submenu-2",label:h.jsx(rn,{noPadding:!0,children:Y.t("word.Options",e)}),children:O}]}),t.wallCount>0&&p.push({key:"buildings-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.buildingSubMenu",e)}),children:[{key:"building-energy-daily-data",label:h.jsx(rn,{noPadding:!0,onClick:v,children:Y.t("menu.building.AnalyzeDailyBuildingEnergy",e)})},{key:"building-energy-yearly-data",label:h.jsx(rn,{noPadding:!0,onClick:T,children:Y.t("menu.building.AnalyzeYearlyBuildingEnergy",e)})},{key:"building-energy-analysis-options-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.building.EnergyAnalysisOptions",e)}),children:QNn()}]}),t.solarPanelCount>0&&p.push({key:"solar-panels-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.solarPanelSubMenu",e)}),children:[{key:"solar-panel-daily-yield",label:h.jsx(rn,{noPadding:!0,onClick:A,children:Y.t("menu.solarPanel.AnalyzeDailyYield",e)})},{key:"solar-panel-yearly-yield",label:h.jsx(rn,{noPadding:!0,onClick:x,children:Y.t("menu.solarPanel.AnalyzeYearlyYield",e)})},{key:"solar-panel-energy-analysis-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.solarPanel.EnergyAnalysisOptions",e)}),children:tUn(f)},{key:"solar-panel-visibility",label:h.jsx(rn,{noPadding:!0,onClick:S,children:Y.t("menu.solarPanel.AnalyzeVisibility",e)})},{key:"solar-panel-visibility-analysis-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.solarPanel.VisibilityAnalysisOptions",e)}),children:[{key:"solar-panel-visibility-grid-cell-size",label:h.jsx(rUn,{})}]}]}),t.parabolicTroughCount>0&&p.push({key:"parabolic-troughs-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.parabolicTroughSubMenu",e)}),children:[{key:"parabolic-trough-daily-yield",label:h.jsx(rn,{noPadding:!0,onClick:R,children:Y.t("menu.parabolicTrough.AnalyzeDailyYield",e)})},{key:"parabolic-trough-yearly-yield",label:h.jsx(rn,{noPadding:!0,onClick:M,children:Y.t("menu.parabolicTrough.AnalyzeYearlyYield",e)})},{key:"parabolic-trough-analysis-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.AnalysisOptions",e)}),children:xO("parabolic-trough")}]}),t.parabolicDishCount>0&&p.push({key:"parabolic-dishes-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.parabolicDishSubMenu",e)}),children:[{key:"parabolic-dish-daily-yield",label:h.jsx(rn,{noPadding:!0,onClick:D,children:Y.t("menu.parabolicDish.AnalyzeDailyYield",e)})},{key:"parabolic-dish-yearly-yield",label:h.jsx(rn,{noPadding:!0,onClick:E,children:Y.t("menu.parabolicDish.AnalyzeYearlyYield",e)})},{key:"parabolic-dish-analysis-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.AnalysisOptions",e)}),children:xO("parabolic-dish")}]}),t.fresnelReflectorCount>0&&p.push({key:"fresnel-reflector-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.fresnelReflectorSubMenu",e)}),children:[{key:"fresnel-reflector-daily-yield",label:h.jsx(rn,{noPadding:!0,onClick:W,children:Y.t("menu.fresnelReflector.AnalyzeDailyYield",e)})},{key:"fresnel-reflector-yearly-yield",label:h.jsx(rn,{noPadding:!0,onClick:j,children:Y.t("menu.fresnelReflector.AnalyzeYearlyYield",e)})},{key:"fresnel-reflector-analysis-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.AnalysisOptions",e)}),children:xO("fresnel-reflector")}]}),t.heliostatCount>0&&p.push({key:"heliostat-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.heliostatSubMenu",e)}),children:[{key:"heliostat-daily-yield",label:h.jsx(rn,{noPadding:!0,onClick:L,children:Y.t("menu.heliostat.AnalyzeDailyYield",e)})},{key:"heliostat-yearly-yield",label:h.jsx(rn,{noPadding:!0,onClick:k,children:Y.t("menu.heliostat.AnalyzeYearlyYield",e)})},{key:"heliostat-analysis-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.AnalysisOptions",e)}),children:xO("heliostat-analysis")}]}),t.solarUpdraftTowerCount>0&&p.push({key:"solar-updraft-tower-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.solarUpdraftTowerSubMenu",e)}),children:[{key:"solar-updraft-tower-daily-yield",label:h.jsx(rn,{noPadding:!0,onClick:N,children:Y.t("menu.solarUpdraftTower.AnalyzeDailyYield",e)})},{key:"solar-updraft-tower-yearly-yield",label:h.jsx(rn,{noPadding:!0,onClick:F,children:Y.t("menu.solarUpdraftTower.AnalyzeYearlyYield",e)})},{key:"solar-updraft-tower-analysis-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.AnalysisOptions",e)}),children:iUn()}]}),p};/** +`,t.getElementsByTagName("head")[0].appendChild(e)),t.body&&QQe(t.body,"react-draggable-transparent-selection")}function cWn(t){if(t)try{if(t.body&&ZQe(t.body,"react-draggable-transparent-selection"),t.selection)t.selection.empty();else{const e=(t.defaultView||window).getSelection();e&&e.type!=="Caret"&&e.removeAllRanges()}}catch{}}function QQe(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function ZQe(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var A3={};Object.defineProperty(A3,"__esModule",{value:!0});A3.canDragX=fWn;A3.canDragY=hWn;A3.createCoreData=gWn;A3.createDraggableData=mWn;A3.getBoundPosition=uWn;A3.getControlPosition=pWn;A3.snapToGrid=dWn;var K1=y3,aC=A0;function uWn(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:o}=t.props;o=typeof o=="string"?o:yWn(o);const r=o2e(t);if(typeof o=="string"){const{ownerDocument:i}=r,a=i.defaultView;let l;if(o==="parent"?l=r.parentNode:l=i.querySelector(o),!(l instanceof a.HTMLElement))throw new Error('Bounds selector "'+o+'" could not find an element.');const s=l,c=a.getComputedStyle(r),u=a.getComputedStyle(s);o={left:-r.offsetLeft+(0,K1.int)(u.paddingLeft)+(0,K1.int)(c.marginLeft),top:-r.offsetTop+(0,K1.int)(u.paddingTop)+(0,K1.int)(c.marginTop),right:(0,aC.innerWidth)(s)-(0,aC.outerWidth)(r)-r.offsetLeft+(0,K1.int)(u.paddingRight)-(0,K1.int)(c.marginRight),bottom:(0,aC.innerHeight)(s)-(0,aC.outerHeight)(r)-r.offsetTop+(0,K1.int)(u.paddingBottom)-(0,K1.int)(c.marginBottom)}}return(0,K1.isNum)(o.right)&&(e=Math.min(e,o.right)),(0,K1.isNum)(o.bottom)&&(n=Math.min(n,o.bottom)),(0,K1.isNum)(o.left)&&(e=Math.max(e,o.left)),(0,K1.isNum)(o.top)&&(n=Math.max(n,o.top)),[e,n]}function dWn(t,e,n){const o=Math.round(e/t[0])*t[0],r=Math.round(n/t[1])*t[1];return[o,r]}function fWn(t){return t.props.axis==="both"||t.props.axis==="x"}function hWn(t){return t.props.axis==="both"||t.props.axis==="y"}function pWn(t,e,n){const o=typeof e=="number"?(0,aC.getTouch)(t,e):null;if(typeof e=="number"&&!o)return null;const r=o2e(n),i=n.props.offsetParent||r.offsetParent||r.ownerDocument.body;return(0,aC.offsetXYFromParent)(o||t,i,n.props.scale)}function gWn(t,e,n){const o=!(0,K1.isNum)(t.lastX),r=o2e(t);return o?{node:r,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:r,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function mWn(t,e){const n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function yWn(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function o2e(t){const e=t.findDOMNode();if(!e)throw new Error(": Unmounted during event!");return e}var NQ={},UQ={};Object.defineProperty(UQ,"__esModule",{value:!0});UQ.default=AWn;function AWn(){}Object.defineProperty(NQ,"__esModule",{value:!0});NQ.default=void 0;var iae=vWn(m),zp=r2e(Wq),wWn=r2e(Cd),Jf=A0,H4=A3,aae=y3,Xz=r2e(UQ);function r2e(t){return t&&t.__esModule?t:{default:t}}function eZe(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(eZe=function(o){return o?n:e})(t)}function vWn(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=eZe(e);if(n&&n.has(t))return n.get(t);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)){var a=r?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=t[i]}return o.default=t,n&&n.set(t,o),o}function Vh(t,e,n){return e=xWn(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xWn(t){var e=bWn(t,"string");return typeof e=="symbol"?e:String(e)}function bWn(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const e2={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let M4=e2.mouse,jQ=class extends iae.Component{constructor(){super(...arguments),Vh(this,"dragging",!1),Vh(this,"lastX",NaN),Vh(this,"lastY",NaN),Vh(this,"touchIdentifier",null),Vh(this,"mounted",!1),Vh(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&typeof e.button=="number"&&e.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:o}=n;if(this.props.disabled||!(e.target instanceof o.defaultView.Node)||this.props.handle&&!(0,Jf.matchesSelectorAndParentsTo)(e.target,this.props.handle,n)||this.props.cancel&&(0,Jf.matchesSelectorAndParentsTo)(e.target,this.props.cancel,n))return;e.type==="touchstart"&&e.preventDefault();const r=(0,Jf.getTouchIdentifier)(e);this.touchIdentifier=r;const i=(0,H4.getControlPosition)(e,r,this);if(i==null)return;const{x:a,y:l}=i,s=(0,H4.createCoreData)(this,a,l);(0,Xz.default)("DraggableCore: handleDragStart: %j",s),(0,Xz.default)("calling",this.props.onStart),!(this.props.onStart(e,s)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Jf.addUserSelectStyles)(o),this.dragging=!0,this.lastX=a,this.lastY=l,(0,Jf.addEvent)(o,M4.move,this.handleDrag),(0,Jf.addEvent)(o,M4.stop,this.handleDragStop))}),Vh(this,"handleDrag",e=>{const n=(0,H4.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:o,y:r}=n;if(Array.isArray(this.props.grid)){let l=o-this.lastX,s=r-this.lastY;if([l,s]=(0,H4.snapToGrid)(this.props.grid,l,s),!l&&!s)return;o=this.lastX+l,r=this.lastY+s}const i=(0,H4.createCoreData)(this,o,r);if((0,Xz.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const s=document.createEvent("MouseEvents");s.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(s)}return}this.lastX=o,this.lastY=r}),Vh(this,"handleDragStop",e=>{if(!this.dragging)return;const n=(0,H4.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:o,y:r}=n;if(Array.isArray(this.props.grid)){let s=o-this.lastX||0,c=r-this.lastY||0;[s,c]=(0,H4.snapToGrid)(this.props.grid,s,c),o=this.lastX+s,r=this.lastY+c}const i=(0,H4.createCoreData)(this,o,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;const l=this.findDOMNode();l&&this.props.enableUserSelectHack&&(0,Jf.removeUserSelectStyles)(l.ownerDocument),(0,Xz.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,l&&((0,Xz.default)("DraggableCore: Removing handlers"),(0,Jf.removeEvent)(l.ownerDocument,M4.move,this.handleDrag),(0,Jf.removeEvent)(l.ownerDocument,M4.stop,this.handleDragStop))}),Vh(this,"onMouseDown",e=>(M4=e2.mouse,this.handleDragStart(e))),Vh(this,"onMouseUp",e=>(M4=e2.mouse,this.handleDragStop(e))),Vh(this,"onTouchStart",e=>(M4=e2.touch,this.handleDragStart(e))),Vh(this,"onTouchEnd",e=>(M4=e2.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,Jf.addEvent)(e,e2.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,Jf.removeEvent)(n,e2.mouse.move,this.handleDrag),(0,Jf.removeEvent)(n,e2.touch.move,this.handleDrag),(0,Jf.removeEvent)(n,e2.mouse.stop,this.handleDragStop),(0,Jf.removeEvent)(n,e2.touch.stop,this.handleDragStop),(0,Jf.removeEvent)(e,e2.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Jf.removeUserSelectStyles)(n)}}findDOMNode(){var e,n;return(e=this.props)!==null&&e!==void 0&&e.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:wWn.default.findDOMNode(this)}render(){return iae.cloneElement(iae.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};NQ.default=jQ;Vh(jQ,"displayName","DraggableCore");Vh(jQ,"propTypes",{allowAnyClick:zp.default.bool,children:zp.default.node.isRequired,disabled:zp.default.bool,enableUserSelectHack:zp.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:zp.default.arrayOf(zp.default.number),handle:zp.default.string,cancel:zp.default.string,nodeRef:zp.default.object,onStart:zp.default.func,onDrag:zp.default.func,onStop:zp.default.func,onMouseDown:zp.default.func,scale:zp.default.number,className:aae.dontSetMe,style:aae.dontSetMe,transform:aae.dontSetMe});Vh(jQ,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return s.default}}),t.default=void 0;var e=f(m),n=u(Wq),o=u(Cd),r=u(BLn),i=A0,a=A3,l=y3,s=u(NQ),c=u(UQ);function u(C){return C&&C.__esModule?C:{default:C}}function d(C){if(typeof WeakMap!="function")return null;var P=new WeakMap,v=new WeakMap;return(d=function(T){return T?v:P})(C)}function f(C,P){if(C&&C.__esModule)return C;if(C===null||typeof C!="object"&&typeof C!="function")return{default:C};var v=d(P);if(v&&v.has(C))return v.get(C);var T={},A=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in C)if(x!=="default"&&Object.prototype.hasOwnProperty.call(C,x)){var S=A?Object.getOwnPropertyDescriptor(C,x):null;S&&(S.get||S.set)?Object.defineProperty(T,x,S):T[x]=C[x]}return T.default=C,v&&v.set(C,T),T}function p(){return p=Object.assign?Object.assign.bind():function(C){for(var P=1;P{if((0,c.default)("Draggable: onDragStart: %j",T),this.props.onStart(v,(0,a.createDraggableData)(this,T))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),g(this,"onDrag",(v,T)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",T);const A=(0,a.createDraggableData)(this,T),x={x:A.x,y:A.y,slackX:0,slackY:0};if(this.props.bounds){const{x:R,y:M}=x;x.x+=this.state.slackX,x.y+=this.state.slackY;const[D,E]=(0,a.getBoundPosition)(this,x.x,x.y);x.x=D,x.y=E,x.slackX=this.state.slackX+(R-x.x),x.slackY=this.state.slackY+(M-x.y),A.x=x.x,A.y=x.y,A.deltaX=x.x-this.state.x,A.deltaY=x.y-this.state.y}if(this.props.onDrag(v,A)===!1)return!1;this.setState(x)}),g(this,"onDragStop",(v,T)=>{if(!this.state.dragging||this.props.onStop(v,(0,a.createDraggableData)(this,T))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",T);const x={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:R,y:M}=this.props.position;x.x=R,x.y=M}this.setState(x)}),this.state={dragging:!1,dragged:!1,x:P.position?P.position.x:P.defaultPosition.x,y:P.position?P.position.y:P.defaultPosition.y,prevPropsPosition:{...P.position},slackX:0,slackY:0,isElementSVG:!1},P.position&&!(P.onDrag||P.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var P,v;return(P=(v=this.props)===null||v===void 0||(v=v.nodeRef)===null||v===void 0?void 0:v.current)!==null&&P!==void 0?P:o.default.findDOMNode(this)}render(){const{axis:P,bounds:v,children:T,defaultPosition:A,defaultClassName:x,defaultClassNameDragging:S,defaultClassNameDragged:R,position:M,positionOffset:D,scale:E,...W}=this.props;let j={},L=null;const N=!!!M||this.state.dragging,F=M||A,U={x:(0,a.canDragX)(this)&&N?this.state.x:F.x,y:(0,a.canDragY)(this)&&N?this.state.y:F.y};this.state.isElementSVG?L=(0,i.createSVGTransform)(U,D):j=(0,i.createCSSTransform)(U,D);const O=(0,r.default)(T.props.className||"",x,{[S]:this.state.dragging,[R]:this.state.dragged});return e.createElement(s.default,p({},W,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(T),{className:O,style:{...T.props.style,...j},transform:L}))}}t.default=b,g(b,"displayName","Draggable"),g(b,"propTypes",{...s.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),g(b,"defaultProps",{...s.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(GQe);const{default:tZe,DraggableCore:SWn}=GQe;WQ.exports=tZe;WQ.exports.default=tZe;WQ.exports.DraggableCore=SWn;var TWn=WQ.exports;const _i=Fi(TWn),ePe=t=>{t=1831565813+(t|=0)|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296};let PWn=class{constructor(e){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;const{length:n,separator:o,dictionaries:r,style:i,seed:a}=e;this.dictionaries=r,this.separator=o,this.length=n,this.style=i,this.seed=a}generate(){if(!this.dictionaries)throw new Error('Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object');if(this.length<=0)throw new Error("Invalid length provided");if(this.length>this.dictionaries.length)throw new Error(`The length cannot be bigger than the number of dictionaries. +Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let e=this.seed;return this.dictionaries.slice(0,this.length).reduce((n,o)=>{let r;e?(r=(a=>{if(typeof a=="string"){const l=a.split("").map(c=>c.charCodeAt(0)).reduce((c,u)=>c+u,1),s=Math.floor(Number(l));return ePe(s)}return ePe(a)})(e),e=4294967296*r):r=Math.random();let i=o[Math.floor(r*o.length)]||"";if(this.style==="lowerCase")i=i.toLowerCase();else if(this.style==="capital"){const[a,...l]=i.split("");i=a.toUpperCase()+l.join("")}else this.style==="upperCase"&&(i=i.toUpperCase());return n?`${n}${this.separator}${i}`:`${i}`},"")}};const tPe={separator:"_",dictionaries:[]},CWn=t=>{const e=[...t&&t.dictionaries||tPe.dictionaries],n={...tPe,...t,length:t&&t.length||e.length,dictionaries:e};if(!t||!t.dictionaries||!t.dictionaries.length)throw new Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new PWn(n).generate()};var RWn=["aardvark","aardwolf","albatross","alligator","alpaca","amphibian","anaconda","angelfish","anglerfish","ant","anteater","antelope","antlion","ape","aphid","armadillo","asp","baboon","badger","bandicoot","barnacle","barracuda","basilisk","bass","bat","bear","beaver","bedbug","bee","beetle","bird","bison","blackbird","boa","boar","bobcat","bobolink","bonobo","booby","bovid","bug","butterfly","buzzard","camel","canid","canidae","capybara","cardinal","caribou","carp","cat","caterpillar","catfish","catshark","cattle","centipede","cephalopod","chameleon","cheetah","chickadee","chicken","chimpanzee","chinchilla","chipmunk","cicada","clam","clownfish","cobra","cockroach","cod","condor","constrictor","coral","cougar","cow","coyote","crab","crane","crawdad","crayfish","cricket","crocodile","crow","cuckoo","damselfly","deer","dingo","dinosaur","dog","dolphin","donkey","dormouse","dove","dragon","dragonfly","duck","eagle","earthworm","earwig","echidna","eel","egret","elephant","elk","emu","ermine","falcon","felidae","ferret","finch","firefly","fish","flamingo","flea","fly","flyingfish","fowl","fox","frog","galliform","gamefowl","gayal","gazelle","gecko","gerbil","gibbon","giraffe","goat","goldfish","goose","gopher","gorilla","grasshopper","grouse","guan","guanaco","guineafowl","gull","guppy","haddock","halibut","hamster","hare","harrier","hawk","hedgehog","heron","herring","hippopotamus","hookworm","hornet","horse","hoverfly","hummingbird","hyena","iguana","impala","jackal","jaguar","jay","jellyfish","junglefowl","kangaroo","kingfisher","kite","kiwi","koala","koi","krill","ladybug","lamprey","landfowl","lark","leech","lemming","lemur","leopard","leopon","limpet","lion","lizard","llama","lobster","locust","loon","louse","lungfish","lynx","macaw","mackerel","magpie","mammal","manatee","mandrill","marlin","marmoset","marmot","marsupial","marten","mastodon","meadowlark","meerkat","mink","minnow","mite","mockingbird","mole","mollusk","mongoose","monkey","moose","mosquito","moth","mouse","mule","muskox","narwhal","newt","nightingale","ocelot","octopus","opossum","orangutan","orca","ostrich","otter","owl","ox","panda","panther","parakeet","parrot","parrotfish","partridge","peacock","peafowl","pelican","penguin","perch","pheasant","pig","pigeon","pike","pinniped","piranha","planarian","platypus","pony","porcupine","porpoise","possum","prawn","primate","ptarmigan","puffin","puma","python","quail","quelea","quokka","rabbit","raccoon","rat","rattlesnake","raven","reindeer","reptile","rhinoceros","roadrunner","rodent","rook","rooster","roundworm","sailfish","salamander","salmon","sawfish","scallop","scorpion","seahorse","shark","sheep","shrew","shrimp","silkworm","silverfish","skink","skunk","sloth","slug","smelt","snail","snake","snipe","sole","sparrow","spider","spoonbill","squid","squirrel","starfish","stingray","stoat","stork","sturgeon","swallow","swan","swift","swordfish","swordtail","tahr","takin","tapir","tarantula","tarsier","termite","tern","thrush","tick","tiger","tiglon","toad","tortoise","toucan","trout","tuna","turkey","turtle","tyrannosaurus","unicorn","urial","vicuna","viper","vole","vulture","wallaby","walrus","warbler","wasp","weasel","whale","whippet","whitefish","wildcat","wildebeest","wildfowl","wolf","wolverine","wombat","woodpecker","worm","wren","xerinae","yak","zebra"],HWn=["amaranth","amber","amethyst","apricot","aqua","aquamarine","azure","beige","black","blue","blush","bronze","brown","chocolate","coffee","copper","coral","crimson","cyan","emerald","fuchsia","gold","gray","green","harlequin","indigo","ivory","jade","lavender","lime","magenta","maroon","moccasin","olive","orange","peach","pink","plum","purple","red","rose","salmon","sapphire","scarlet","silver","tan","teal","tomato","turquoise","violet","white","yellow"];const{Option:U1}=_o,MWn=({setDialogVisible:t})=>{const e=H(fn),n=H(da),o=H(s0),[r,i]=m.useState(H.getState().modelType),[a,l]=m.useState(H.getState().modelAuthor??CWn({dictionaries:[HWn,RWn],separator:" ",style:"capital"})),[s,c]=m.useState(H.getState().modelLabel??H.getState().cloudFile??null),[u,d]=m.useState(H.getState().modelDescription),[f,p]=m.useState(!1),[g,y]=m.useState({left:0,top:0,bottom:0,right:0}),w=m.useRef(null),b=m.useRef(null),{TextArea:C}=as,P={lng:o};m.useEffect(()=>{var S;(S=b.current)==null||S.focus()},[]);const v=(S,R)=>{if(w.current){const{clientWidth:M,clientHeight:D}=window.document.documentElement,E=w.current.getBoundingClientRect();y({left:-E.left+R.x,right:M-(E.right-R.x),top:-E.top+R.y,bottom:D-((E==null?void 0:E.bottom)-R.y)})}},T=()=>{t(!1)},A=()=>{ht.getState().set(S=>{S.publishOnModelsMapFlag=!0}),e(S=>{S.modelType=r,S.modelAuthor=a,S.modelLabel=s,S.modelDescription=u}),ht.getState().setChanged(!0),n&&e(S=>{S.actionInfo={name:"Publish on Map of Models",timestamp:new Date().getTime()}}),t(!1)},{t:x}=Vl();return h.jsxs(Oi,{width:560,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>p(!0),onMouseOut:()=>p(!1),children:x("menu.file.PublishOnModelsMap",P)}),footer:[h.jsx(lo,{onClick:T,children:x("word.Cancel",P)},"Cancel"),h.jsx(lo,{type:"primary",ref:b,onClick:A,disabled:!a||!s,children:x("word.OK",P)},"OK")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:S=>h.jsx(_i,{disabled:!f,bounds:g,onStart:(R,M)=>v(R,M),children:h.jsx("div",{ref:w,children:S})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:8,children:x("shared.ModelType",P)+":"}),h.jsx(nt,{className:"gutter-row",span:16,children:h.jsxs(_o,{style:{width:"100%"},value:r,onChange:S=>{i(S)},children:[h.jsxs(U1,{value:pa.UNKNOWN,children:[h.jsx("img",{alt:"Building",width:24,src:OQe,style:{marginRight:"8px"}}),x("word.Unknown",P)]},pa.UNKNOWN),h.jsxs(U1,{value:pa.UNDER_CONSTRUCTION,children:[h.jsx("img",{alt:"Building",width:24,src:YQe,style:{marginRight:"8px"}}),x("word.UnderConstruction",P)]},pa.UNDER_CONSTRUCTION),h.jsxs(U1,{value:pa.RESIDENTIAL_BUILDING,children:[h.jsx("img",{alt:"Residential Building",width:24,src:EQe,style:{marginRight:"8px"}}),x("word.ResidentialBuilding",P)]},pa.RESIDENTIAL_BUILDING),h.jsxs(U1,{value:pa.COMMERCIAL_BUILDING,children:[h.jsx("img",{alt:"Commercial Building",width:24,src:FQe,style:{marginRight:"8px"}}),x("word.CommercialBuilding",P)]},pa.COMMERCIAL_BUILDING),h.jsxs(U1,{value:pa.SCHOOL_BUILDING,children:[h.jsx("img",{alt:"School Building",width:24,src:kQe,style:{marginRight:"8px"}}),x("word.SchoolBuilding",P)]},pa.SCHOOL_BUILDING),h.jsxs(U1,{value:pa.TOURIST_ATTRACTION,children:[h.jsx("img",{alt:"Tourist Attraction",width:24,src:LQe,style:{marginRight:"8px"}}),x("word.TouristAttraction",P)]},pa.TOURIST_ATTRACTION),h.jsxs(U1,{value:pa.PHOTOVOLTAIC,children:[h.jsx("img",{alt:"Photovoltaic",width:24,src:WQe,style:{marginRight:"8px"}}),x("word.Photovoltaic",P)]},pa.PHOTOVOLTAIC),h.jsxs(U1,{value:pa.PARABOLIC_DISH,children:[h.jsx("img",{alt:"Parabolic Dish",width:24,src:NQe,style:{marginRight:"8px"}}),x("shared.ParabolicDishElement",P)]},pa.PARABOLIC_DISH),h.jsxs(U1,{value:pa.PARABOLIC_TROUGH,children:[h.jsx("img",{alt:"Parabolic Trough",width:24,src:UQe,style:{marginRight:"8px"}}),x("shared.ParabolicTroughElement",P)]},pa.PARABOLIC_TROUGH),h.jsxs(U1,{value:pa.FRESNEL_REFLECTOR,children:[h.jsx("img",{alt:"Fresnel Reflector",width:24,src:jQe,style:{marginRight:"8px"}}),x("shared.FresnelReflectorElement",P)]},pa.FRESNEL_REFLECTOR),h.jsxs(U1,{value:pa.SOLAR_POWER_TOWER,children:[h.jsx("img",{alt:"Heliostat",width:24,src:BQe,style:{marginRight:"8px"}}),x("shared.HeliostatElement",P)]},pa.SOLAR_POWER_TOWER),h.jsxs(U1,{value:pa.WIND_TURBINE,children:[h.jsx("img",{alt:"Wind Turbine",width:24,src:_Qe,style:{marginRight:"8px"}}),Y.t("word.WindPower",P)]},pa.WIND_TURBINE),h.jsxs(U1,{value:pa.COLOCATION_PROJECTS,children:[h.jsx("img",{alt:"Colocation Projects",width:24,src:VQe,style:{marginRight:"8px"}}),Y.t("word.ColocationProjects",P)]},pa.COLOCATION_PROJECTS)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[x("word.Publisher",P),":"]}),h.jsx(nt,{className:"gutter-row",span:16,children:h.jsx(as,{maxLength:30,style:{width:"100%"},value:a??"",onKeyDown:S=>{if(!aR.test(S.key))return S.preventDefault(),!1},onChange:S=>{l(S.target.value)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[x("word.Label",P),":"]}),h.jsx(nt,{className:"gutter-row",span:16,children:h.jsx(as,{maxLength:50,style:{width:"100%"},value:s??"",onKeyDown:S=>{if(!aR.test(S.key))return S.preventDefault(),!1},onChange:S=>{c(S.target.value)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[x("word.Description",P),":",h.jsx("br",{}),h.jsxs("span",{style:{fontSize:"10px"},children:["(",x("word.MaximumCharacters",P),": 200)"]})]}),h.jsx(nt,{className:"gutter-row",span:16,children:h.jsx(C,{rows:5,maxLength:200,style:{width:"100%"},value:u??"",onChange:S=>{d(S.target.value)}})})]})]})},IWn=be.memo(()=>{const t=Jt(),e=H(mp),n=H(Pb),[o,r]=m.useState(!1),i=()=>{const a=new URLSearchParams(window.location.search).get("userid"),l=a===e.uid;e.uid&&n&&l?r(!0):e.uid?hn(a&&!l?Y.t("menu.file.YouCannotPublishAModelThatYouDoNotOwn",t)+".":Y.t("menu.file.YouMustSaveModelOnCloudBeforePublishingIt",t)+"."):hn(Y.t("menu.file.YouMustLogInToPublishYourModel",t)+".")};return h.jsxs(h.Fragment,{children:[h.jsxs(rn,{noPadding:!0,onClick:i,children:[Y.t("menu.file.PublishOnModelsMap",t),"..."]}),o&&h.jsx(MWn,{setDialogVisible:r})]})}),zWn=(t,e,n)=>{const o={lng:H.getState().language},r=H.getState().user,i=H.getState().cloudFile,a=H.getState().undoManager,l=H.getState().loggable,s=H.getState().set,c=()=>{a.clear(),ht.getState().set(b=>{b.createNewFileFlag=!0,b.openModelsMap=!1}),s(b=>{b.objectTypeToAdd=z.None,b.groupActionMode=!1,window.history.pushState({},document.title,t1),l&&(b.actionInfo={name:"Create New File",timestamp:new Date().getTime()})})},u=()=>{a.clear(),ht.getState().set(b=>{b.openLocalFileFlag=!0,b.openModelsMap=!1}),s(b=>{b.objectTypeToAdd=z.None,b.groupActionMode=!1,b.cloudFile=void 0,window.history.pushState({},document.title,t1),l&&(b.actionInfo={name:"Open Local File",timestamp:new Date().getTime()})})},d=()=>{ht.getState().set(b=>{b.saveLocalFileDialogVisible=!0}),l&&s(b=>{b.actionInfo={name:"Save as Local File",timestamp:new Date().getTime()}})},f=()=>{ht.getState().set(b=>{b.listCloudFilesFlag=!0,b.openModelsMap=!1}),s(b=>{b.selectedFloatingWindow="cloudFilePanel"}),l&&s(b=>{b.actionInfo={name:"List Cloud Files",timestamp:new Date().getTime()}})},p=()=>{ht.getState().setSaveCloudFileFlag(!0),l&&s(b=>{b.actionInfo={name:"Save Cloud File",timestamp:new Date().getTime()}})},g=()=>{s(b=>{b.showCloudFileTitleDialogFlag=!b.showCloudFileTitleDialogFlag,b.showCloudFileTitleDialog=!0,l&&(b.actionInfo={name:"Save as Cloud File",timestamp:new Date().getTime()})})},y=()=>{n&&(MQt("screenshot.png",n.toDataURL("image/png")),l&&s(b=>{b.actionInfo={name:"Take Screenshot",timestamp:new Date().getTime()}}),ht.getState().set(b=>{b.openModelsMap=!1}))},w=[];return t||w.push({key:"create-new-file",label:h.jsxs(rn,{noPadding:!0,onClick:c,children:[Y.t("menu.file.CreateNewFile",o),h.jsxs(lh,{children:["(",e?"⌘":"Ctrl","+F)"]})]})}),t||w.push({key:"open-local-file",label:h.jsxs(rn,{noPadding:!0,onClick:u,children:[Y.t("menu.file.OpenLocalFile",o),h.jsxs(lh,{children:["(",e?"⌘":"Ctrl","+O)"]}),"..."]})}),w.push({key:"save-local-file",label:h.jsxs(rn,{noPadding:!0,onClick:d,children:[Y.t("menu.file.SaveAsLocalFile",o),h.jsxs(lh,{children:["(",e?"⌘":"Ctrl","+S)"]}),"..."]})}),r.uid&&!t&&w.push({key:"open-cloud-file",label:h.jsxs(rn,{noPadding:!0,onClick:f,children:[Y.t("menu.file.OpenCloudFile",o),h.jsxs(lh,{children:["(",e?"⌘":"Ctrl","+Shift+O)"]}),"..."]})}),r.uid&&i&&!t&&w.push({key:"save-cloud-file",label:h.jsxs(rn,{noPadding:!0,onClick:p,children:[Y.t("menu.file.SaveCloudFile",o),h.jsxs(lh,{children:["(",e?"⌘":"Ctrl","+Shift+S)"]}),"..."]})}),r.uid&&!t&&w.push({key:"save-as-cloud-file",label:h.jsx(rn,{noPadding:!0,onClick:g,children:Y.t("menu.file.SaveAsCloudFile",o)})}),t||w.push({key:"publish-on-model-map",label:h.jsx(IWn,{})}),w.push({key:"take-screen-shot",label:h.jsx(rn,{noPadding:!0,onClick:y,children:Y.t("menu.file.TakeScreenshot",o)})}),w},{Option:DWn}=_o,nZe=be.memo(({saveAs:t,setDialogVisible:e})=>{const n=H(fn),o=H(da),[r,i]=m.useState(H.getState().projectState.type??Pi.SOLAR_PANEL_ARRAY),[a,l]=m.useState(H.getState().projectState.title),[s,c]=m.useState(H.getState().projectState.description),[u,d]=m.useState(!1),[f,p]=m.useState({left:0,top:0,bottom:0,right:0}),g=m.useRef(null),{TextArea:y}=as,w=Jt(),b=(v,T)=>{if(g.current){const{clientWidth:A,clientHeight:x}=window.document.documentElement,S=g.current.getBoundingClientRect();p({left:-S.left+T.x,right:A-(S.right-T.x),top:-S.top+T.y,bottom:x-((S==null?void 0:S.bottom)-T.y)})}},C=()=>{e(!1)},P=()=>{ht.getState().set(v=>{t?v.saveProjectAsFlag=!0:v.createProjectFlag=!0}),ht.getState().set(v=>{v.projectType=r,v.projectTitle=a,v.projectDescription=s}),o&&n(v=>{v.actionInfo={name:t?"Save Project as":"Create New Project",timestamp:new Date().getTime(),details:{type:r,title:a,description:s}}}),e(!1)};return h.jsxs(Oi,{width:560,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>d(!0),onMouseOut:()=>d(!1),children:`${Y.t(t?"menu.project.SaveProjectAs":"menu.project.CreateNewProject",w)}`}),footer:[h.jsx(lo,{onClick:C,children:`${Y.t("word.Cancel",w)}`},"Cancel"),h.jsx(lo,{type:"primary",onClick:P,disabled:!a,children:`${Y.t("word.OK",w)}`},"OK")],onCancel:()=>{e(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:v=>h.jsx(_i,{disabled:!u,bounds:f,onStart:(T,A)=>b(T,A),children:h.jsx("div",{ref:g,children:v})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:8,children:Y.t("projectPanel.ProjectType",w)+":"}),h.jsx(nt,{className:"gutter-row",span:16,children:h.jsx(_o,{disabled:t,style:{width:"100%"},value:r,onChange:v=>{i(v)},children:h.jsx(DWn,{value:Pi.SOLAR_PANEL_ARRAY,children:`${Y.t("projectPanel.SolarPanelArray",w)}`},Pi.SOLAR_PANEL_ARRAY)})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[`${Y.t("word.Title",w)}`,":"]}),h.jsx(nt,{className:"gutter-row",span:16,children:h.jsx(as,{maxLength:50,style:{width:"100%"},value:a??"",onKeyDown:v=>{if(!aR.test(v.key))return v.preventDefault(),!1},onChange:v=>{l(v.target.value)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[`${Y.t("word.Description",w)}`,":",h.jsx("br",{}),h.jsxs("span",{style:{fontSize:"10px"},children:["(",`${Y.t("word.MaximumCharacters",w)}`,": 200)"]})]}),h.jsx(nt,{className:"gutter-row",span:16,children:h.jsx(y,{rows:5,maxLength:200,style:{width:"100%"},value:s??"",onChange:v=>{c(v.target.value)}})})]})]})}),EWn=()=>{const[t,e]=m.useState(!1),n=Jt(),o=()=>{if(!H.getState().user.uid){hn(Y.t("menu.project.YouMustLogInToCreateProject",n)+".");return}e(!0),ht.getState().set(r=>{r.openModelsMap=!1})};return h.jsxs(h.Fragment,{children:[h.jsxs(rn,{noPadding:!0,onClick:o,children:[Y.t("menu.project.CreateNewProject",n),"..."]}),t&&h.jsx(nZe,{saveAs:!1,setDialogVisible:e})]})},FWn=()=>{const[t,e]=m.useState(!1),n=Jt(),o=()=>{e(!0),ht.getState().set(r=>{r.openModelsMap=!1})};return h.jsxs(h.Fragment,{children:[h.jsxs(rn,{noPadding:!0,onClick:o,children:[Y.t("menu.project.SaveProjectAs",n),"..."]}),t&&h.jsx(nZe,{saveAs:!0,setDialogVisible:e})]})},kWn=()=>{const t={lng:H.getState().language},e=H.getState().user,n=H.getState().loggable,o=H.getState().projectState,r=H.getState().projectView,i=H.getState().set,a=()=>{if(!e.uid){hn(Y.t("menu.project.YouMustLogInToOpenProject",t)+".");return}ht.getState().set(s=>{s.showProjectsFlag=!0,s.openModelsMap=!1}),i(s=>{s.selectedFloatingWindow="projectListPanel"}),n&&i(s=>{s.actionInfo={name:"Open Project List",timestamp:new Date().getTime()}})},l=[];return l.push({key:"create-new-project",label:h.jsx(EWn,{})}),l.push({key:"list-project",label:h.jsxs(rn,{noPadding:!0,onClick:a,children:[Y.t("menu.project.OpenProject",t),"..."]})}),r&&o.title&&e.uid&&l.push({key:"save-project-as",label:h.jsx(FWn,{})}),l},LWn=(t,e,n,o)=>{const r={lng:H.getState().language},i=H.getState().loggable,a=H.getState().set,l=()=>{t&&(H.getState().copyElementById(t.id),i&&a(p=>{p.actionInfo={name:"Copy",timestamp:new Date().getTime(),elementId:t.id,elementType:t.type}}))},s=()=>{if(!(!t||t.type===z.Roof))if(t.locked)hn(Y.t("message.ThisElementIsLocked",r));else{const p=H.getState().removeElementById(t.id,!0);if(p.length===0)return;if(me.isElementTriggerAutoDeletion(p[0]))Fn.getState().setListenToAutoDeletionByCut(!0),ht.getState().setPrimitiveStore("selectedElementId",t.id);else{const g={name:"Cut",timestamp:Date.now(),deletedElements:p,selectedElementId:t.id,undo:()=>{const y=g.deletedElements;if(y.length===0)return;const w=y.find(b=>b.id===g.selectedElementId);w&&a(b=>{for(const C of y)b.elements.push(C);if(w.type===z.Wall){const C=w;let P=null,v=null;if(C.leftJoints.length>0&&(P=C.leftJoints[0]),C.rightJoints.length>0&&(v=C.rightJoints[0]),P||v)for(const T of b.elements)T.id===P&&T.type===z.Wall&&(T.rightJoints[0]=C.id),T.id===v&&T.type===z.Wall&&(T.leftJoints[0]=C.id)}})},redo:()=>{g.deletedElements&&g.deletedElements.length>0&&H.getState().removeElementById(g.deletedElements[0].id,!0)}};H.getState().addUndoable(g)}}},c=()=>{const p=H.getState().elementsToPaste;if(p&&p.length>0){const g=H.getState().pasteElementsByKey();if(g.length>0){const y={name:"Paste by Key",timestamp:Date.now(),pastedElements:JSON.parse(JSON.stringify(g)),undo:()=>{for(const w of y.pastedElements)H.getState().removeElementById(w.id,!1)},redo:()=>{a(w=>{w.elements.push(...y.pastedElements),w.selectedElement=y.pastedElements[0]})}};H.getState().addUndoable(y)}}},u=()=>{if(n.hasUndo()){const p=n.undo();p&&hn(Y.t("menu.edit.Undo",r)+": "+p,fG),i&&a(g=>{g.actionInfo={name:"Undo",timestamp:new Date().getTime()}})}},d=()=>{if(n.hasRedo()){const p=n.redo();p&&hn(Y.t("menu.edit.Redo",r)+": "+p,fG),i&&a(g=>{g.actionInfo={name:"Redo",timestamp:new Date().getTime()}})}},f=[];return t&&f.push({key:"cut",label:h.jsxs(rn,{noPadding:!0,onClick:s,children:[Y.t("word.Cut",r),h.jsxs(lh,{children:["(",o?"⌘":"Ctrl","+X)"]})]})}),t&&f.push({key:"copy",label:h.jsxs(rn,{noPadding:!0,onClick:l,children:[Y.t("word.Copy",r),h.jsxs(lh,{children:["(",o?"⌘":"Ctrl","+C)"]})]})}),e&&f.push({key:"paste",label:h.jsxs(rn,{noPadding:!0,onClick:c,children:[Y.t("word.Paste",r),h.jsxs(lh,{children:["(",o?"⌘":"Ctrl","+V)"]})]})}),n.hasUndo()&&f.push({key:"undo",label:h.jsxs(rn,{noPadding:!0,onClick:u,children:[Y.t("menu.edit.Undo",r)+": "+n.getLastUndoName(),h.jsxs(lh,{children:["(",o?"⌘":"Ctrl","+Z)"]})]})}),n.hasRedo()&&f.push({key:"redo",label:h.jsxs(rn,{noPadding:!0,onClick:d,children:[Y.t("menu.edit.Redo",r)+": "+n.getLastRedoName(),h.jsxs(lh,{children:["(",o?"⌘":"Ctrl","+Y)"]})]})}),f};var i2e={},BQ={};Object.defineProperty(BQ,"__esModule",{value:!0});BQ.default=void 0;var WWn={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"};BQ.default=WWn;var YQ={},mN={},OQ={};Object.defineProperty(OQ,"__esModule",{value:!0});OQ.default=void 0;var NWn={locale:"zh_CN",yearFormat:"YYYY年",cellDateFormat:"D",cellMeridiemFormat:"A",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"};OQ.default=NWn;var yN={};Object.defineProperty(yN,"__esModule",{value:!0});yN.default=void 0;const UWn={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]};yN.default=UWn;var oZe=Md.default;Object.defineProperty(mN,"__esModule",{value:!0});mN.default=void 0;var jWn=oZe(OQ),BWn=oZe(yN);const rZe={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},jWn.default),timePickerLocale:Object.assign({},BWn.default)};rZe.lang.ok="确定";mN.default=rZe;var YWn=Md.default;Object.defineProperty(YQ,"__esModule",{value:!0});YQ.default=void 0;var OWn=YWn(mN);YQ.default=OWn.default;var _Q=Md.default;Object.defineProperty(i2e,"__esModule",{value:!0});var iZe=i2e.default=void 0,_Wn=_Q(BQ),VWn=_Q(YQ),GWn=_Q(mN),XWn=_Q(yN);const j1="${label}不是一个有效的${type}",JWn={locale:"zh-cn",Pagination:_Wn.default,DatePicker:GWn.default,TimePicker:XWn.default,Calendar:VWn.default,global:{placeholder:"请选择"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckall:"全选",filterSearchPlaceholder:"在筛选项中搜索",emptyText:"暂无数据",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{titles:["",""],searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",deselectAll:"取消全选",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开",collapse:"收起"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:j1,method:j1,array:j1,object:j1,number:j1,date:j1,boolean:j1,integer:j1,float:j1,regexp:j1,email:j1,url:j1,hex:j1},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},Image:{preview:"预览"},QRCode:{expired:"二维码过期",refresh:"点击刷新",scanned:"已扫描"},ColorPicker:{presetEmpty:"暂无"}};iZe=i2e.default=JWn;var a2e={},VQ={};Object.defineProperty(VQ,"__esModule",{value:!0});VQ.default=void 0;var KWn={items_per_page:"條/頁",jump_to:"跳至",jump_to_confirm:"確定",page:"頁",prev_page:"上一頁",next_page:"下一頁",prev_5:"向前 5 頁",next_5:"向後 5 頁",prev_3:"向前 3 頁",next_3:"向後 3 頁",page_size:"頁碼"};VQ.default=KWn;var GQ={},AN={},XQ={};Object.defineProperty(XQ,"__esModule",{value:!0});XQ.default=void 0;var qWn={locale:"zh_TW",today:"今天",now:"此刻",backToToday:"返回今天",ok:"確定",timeSelect:"選擇時間",dateSelect:"選擇日期",weekSelect:"選擇周",clear:"清除",month:"月",year:"年",previousMonth:"上個月 (翻頁上鍵)",nextMonth:"下個月 (翻頁下鍵)",monthSelect:"選擇月份",yearSelect:"選擇年份",decadeSelect:"選擇年代",yearFormat:"YYYY年",dayFormat:"D",dateFormat:"YYYY年M月D日",dateTimeFormat:"YYYY年M月D日 HH時mm分ss秒",previousYear:"上一年 (Control鍵加左方向鍵)",nextYear:"下一年 (Control鍵加右方向鍵)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世紀",nextCentury:"下一世紀"};XQ.default=qWn;var wN={};Object.defineProperty(wN,"__esModule",{value:!0});wN.default=void 0;const $Wn={placeholder:"請選擇時間"};wN.default=$Wn;var aZe=Md.default;Object.defineProperty(AN,"__esModule",{value:!0});AN.default=void 0;var QWn=aZe(XQ),ZWn=aZe(wN);const lZe={lang:Object.assign({placeholder:"請選擇日期",yearPlaceholder:"請選擇年份",quarterPlaceholder:"請選擇季度",monthPlaceholder:"請選擇月份",weekPlaceholder:"請選擇周",rangePlaceholder:["開始日期","結束日期"],rangeYearPlaceholder:["開始年份","結束年份"],rangeMonthPlaceholder:["開始月份","結束月份"],rangeQuarterPlaceholder:["開始季度","結束季度"],rangeWeekPlaceholder:["開始周","結束周"]},QWn.default),timePickerLocale:Object.assign({},ZWn.default)};lZe.lang.ok="確 定";AN.default=lZe;var eNn=Md.default;Object.defineProperty(GQ,"__esModule",{value:!0});GQ.default=void 0;var tNn=eNn(AN);GQ.default=tNn.default;var JQ=Md.default;Object.defineProperty(a2e,"__esModule",{value:!0});var sZe=a2e.default=void 0,nNn=JQ(VQ),oNn=JQ(GQ),rNn=JQ(AN),iNn=JQ(wN);const B1="${label}不是一個有效的${type}",aNn={locale:"zh-tw",Pagination:nNn.default,DatePicker:rNn.default,TimePicker:iNn.default,Calendar:oNn.default,global:{placeholder:"請選擇"},Table:{filterTitle:"篩選器",filterConfirm:"確定",filterReset:"重置",filterEmptyText:"無篩選項",filterCheckall:"全選",filterSearchPlaceholder:"在篩選項中搜尋",emptyText:"暫無數據",selectAll:"全部選取",selectInvert:"反向選取",selectNone:"清空所有",selectionAll:"全選所有",sortTitle:"排序",expand:"展開行",collapse:"關閉行",triggerDesc:"點擊降序",triggerAsc:"點擊升序",cancelSort:"取消排序"},Modal:{okText:"確定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"結束導覽"},Popconfirm:{okText:"確定",cancelText:"取消"},Transfer:{titles:["",""],searchPlaceholder:"搜尋資料",itemUnit:"項目",itemsUnit:"項目",remove:"删除",selectCurrent:"全選當頁",removeCurrent:"删除當頁",selectAll:"全選所有",removeAll:"删除全部",selectInvert:"反選當頁"},Upload:{uploading:"正在上傳...",removeFile:"刪除檔案",uploadError:"上傳失敗",previewFile:"檔案預覽",downloadFile:"下载文件"},Empty:{description:"無此資料"},Icon:{icon:"圖標"},Text:{edit:"編輯",copy:"複製",copied:"複製成功",expand:"展開"},Form:{optional:"(可選)",defaultValidateMessages:{default:"字段驗證錯誤${label}",required:"請輸入${label}",enum:"${label}必須是其中一個[${enum}]",whitespace:"${label}不能為空字符",date:{format:"${label}日期格式無效",parse:"${label}不能轉換為日期",invalid:"${label}是一個無效日期"},types:{string:B1,method:B1,array:B1,object:B1,number:B1,date:B1,boolean:B1,integer:B1,float:B1,regexp:B1,email:B1,url:B1,hex:B1},string:{len:"${label}須為${len}個字符",min:"${label}最少${min}個字符",max:"${label}最多${max}個字符",range:"${label}須在${min}-${max}字符之間"},number:{len:"${label}必須等於${len}",min:"${label}最小值為${min}",max:"${label}最大值為${max}",range:"${label}須在${min}-${max}之間"},array:{len:"須為${len}個${label}",min:"最少${min}個${label}",max:"最多${max}個${label}",range:"${label}數量須在${min}-${max}之間"},pattern:{mismatch:"${label}與模式不匹配${pattern}"}}},Image:{preview:"預覽"},QRCode:{expired:"二維碼過期",refresh:"點擊刷新",scanned:"已掃描"}};sZe=a2e.default=aNn;var l2e={},KQ={};Object.defineProperty(KQ,"__esModule",{value:!0});KQ.default=void 0;var lNn={items_per_page:"/ página",jump_to:"Ir a",jump_to_confirm:"confirmar",page:"Página",prev_page:"Página anterior",next_page:"Página siguiente",prev_5:"5 páginas previas",next_5:"5 páginas siguientes",prev_3:"3 páginas previas",next_3:"3 páginas siguientes",page_size:"tamaño de página"};KQ.default=lNn;var qQ={},vN={},$Q={};Object.defineProperty($Q,"__esModule",{value:!0});$Q.default=void 0;var sNn={locale:"es_ES",today:"Hoy",now:"Ahora",backToToday:"Volver a hoy",ok:"Aceptar",clear:"Limpiar",month:"Mes",year:"Año",timeSelect:"Seleccionar hora",dateSelect:"Seleccionar fecha",monthSelect:"Elegir un mes",yearSelect:"Elegir un año",decadeSelect:"Elegir una década",yearFormat:"YYYY",dateFormat:"D/M/YYYY",dayFormat:"D",dateTimeFormat:"D/M/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Mes anterior (PageUp)",nextMonth:"Mes siguiente (PageDown)",previousYear:"Año anterior (Control + left)",nextYear:"Año siguiente (Control + right)",previousDecade:"Década anterior",nextDecade:"Década siguiente",previousCentury:"Siglo anterior",nextCentury:"Siglo siguiente"};$Q.default=sNn;var xN={};Object.defineProperty(xN,"__esModule",{value:!0});xN.default=void 0;const cNn={placeholder:"Seleccionar hora"};xN.default=cNn;var cZe=Md.default;Object.defineProperty(vN,"__esModule",{value:!0});vN.default=void 0;var uNn=cZe($Q),dNn=cZe(xN);const fNn={lang:Object.assign({placeholder:"Seleccionar fecha",rangePlaceholder:["Fecha inicial","Fecha final"],shortWeekDays:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],shortMonths:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"]},uNn.default),timePickerLocale:Object.assign({},dNn.default)};vN.default=fNn;var hNn=Md.default;Object.defineProperty(qQ,"__esModule",{value:!0});qQ.default=void 0;var pNn=hNn(vN);qQ.default=pNn.default;var QQ=Md.default;Object.defineProperty(l2e,"__esModule",{value:!0});var uZe=l2e.default=void 0,gNn=QQ(KQ),mNn=QQ(qQ),yNn=QQ(vN),ANn=QQ(xN);const Y1="${label} no es un ${type} válido",wNn={locale:"es",Pagination:gNn.default,DatePicker:yNn.default,TimePicker:ANn.default,Calendar:mNn.default,global:{placeholder:"Seleccione"},Table:{filterTitle:"Filtrar menú",filterConfirm:"Aceptar",filterReset:"Reiniciar",filterEmptyText:"Sin filtros",filterCheckall:"Seleccionar todo",filterSearchPlaceholder:"Buscar en filtros",emptyText:"Sin datos",selectAll:"Seleccionar todo",selectInvert:"Invertir selección",selectNone:"Vacíe todo",selectionAll:"Seleccionar todos los datos",sortTitle:"Ordenar",expand:"Expandir fila",collapse:"Colapsar fila",triggerDesc:"Click para ordenar en orden descendente",triggerAsc:"Click para ordenar en orden ascendente",cancelSort:"Click para cancelar ordenamiento"},Modal:{okText:"Aceptar",cancelText:"Cancelar",justOkText:"Aceptar"},Popconfirm:{okText:"Aceptar",cancelText:"Cancelar"},Transfer:{titles:["",""],searchPlaceholder:"Buscar aquí",itemUnit:"elemento",itemsUnit:"elementos",remove:"Eliminar",selectCurrent:"Seleccionar página actual",removeCurrent:"Remover página actual",selectAll:"Seleccionar todos los datos",removeAll:"Eliminar todos los datos",selectInvert:"Invertir página actual"},Upload:{uploading:"Subiendo...",removeFile:"Eliminar archivo",uploadError:"Error al subir el archivo",previewFile:"Vista previa",downloadFile:"Descargar archivo"},Empty:{description:"No hay datos"},Icon:{icon:"ícono"},Text:{edit:"Editar",copy:"Copiar",copied:"Copiado",expand:"Expandir"},Form:{optional:"(opcional)",defaultValidateMessages:{default:"Error de validación del campo ${label}",required:"Por favor ingresar ${label}",enum:"${label} debe ser uno de [${enum}]",whitespace:"${label} no puede ser un carácter en blanco",date:{format:"El formato de fecha de ${label} es inválido",parse:"${label} no se puede convertir a una fecha",invalid:"${label} es una fecha inválida"},types:{string:Y1,method:Y1,array:Y1,object:Y1,number:Y1,date:Y1,boolean:Y1,integer:Y1,float:Y1,regexp:Y1,email:Y1,url:Y1,hex:Y1},string:{len:"${label} debe tener ${len} caracteres",min:"${label} debe tener al menos ${min} caracteres",max:"${label} debe tener hasta ${max} caracteres",range:"${label} debe tener entre ${min}-${max} caracteres"},number:{len:"${label} debe ser igual a ${len}",min:"${label} valor mínimo es ${min}",max:"${label} valor máximo es ${max}",range:"${label} debe estar entre ${min}-${max}"},array:{len:"Debe ser ${len} ${label}",min:"Al menos ${min} ${label}",max:"A lo mucho ${max} ${label}",range:"El monto de ${label} debe estar entre ${min}-${max}"},pattern:{mismatch:"${label} no coincide con el patrón ${pattern}"}}},Image:{preview:"Previsualización"}};uZe=l2e.default=wNn;var s2e={},ZQ={};Object.defineProperty(ZQ,"__esModule",{value:!0});ZQ.default=void 0;var vNn={items_per_page:"/ sayfa",jump_to:"Git",jump_to_confirm:"onayla",page:"Sayfa",prev_page:"Önceki Sayfa",next_page:"Sonraki Sayfa",prev_5:"Önceki 5 Sayfa",next_5:"Sonraki 5 Sayfa",prev_3:"Önceki 3 Sayfa",next_3:"Sonraki 3 Sayfa",page_size:"sayfa boyutu"};ZQ.default=vNn;var eZ={},bN={},tZ={};Object.defineProperty(tZ,"__esModule",{value:!0});tZ.default=void 0;var xNn={locale:"tr_TR",today:"Bugün",now:"Şimdi",backToToday:"Bugüne Geri Dön",ok:"Tamam",clear:"Temizle",month:"Ay",year:"Yıl",timeSelect:"Zaman Seç",dateSelect:"Tarih Seç",monthSelect:"Ay Seç",yearSelect:"Yıl Seç",decadeSelect:"On Yıl Seç",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Önceki Ay (PageUp)",nextMonth:"Sonraki Ay (PageDown)",previousYear:"Önceki Yıl (Control + Sol)",nextYear:"Sonraki Yıl (Control + Sağ)",previousDecade:"Önceki On Yıl",nextDecade:"Sonraki On Yıl",previousCentury:"Önceki Yüzyıl",nextCentury:"Sonraki Yüzyıl"};tZ.default=xNn;var SN={};Object.defineProperty(SN,"__esModule",{value:!0});SN.default=void 0;const bNn={placeholder:"Zaman seç",rangePlaceholder:["Başlangıç zamanı","Bitiş zamanı"]};SN.default=bNn;var dZe=Md.default;Object.defineProperty(bN,"__esModule",{value:!0});bN.default=void 0;var SNn=dZe(tZ),TNn=dZe(SN);const PNn={lang:Object.assign({placeholder:"Tarih seç",yearPlaceholder:"Yıl seç",quarterPlaceholder:"Çeyrek seç",monthPlaceholder:"Ay seç",weekPlaceholder:"Hafta seç",rangePlaceholder:["Başlangıç tarihi","Bitiş tarihi"],rangeYearPlaceholder:["Başlangıç yılı","Bitiş yılı"],rangeMonthPlaceholder:["Başlangıç ayı","Bitiş ayı"],rangeWeekPlaceholder:["Başlangıç haftası","Bitiş haftası"]},SNn.default),timePickerLocale:Object.assign({},TNn.default)};bN.default=PNn;var CNn=Md.default;Object.defineProperty(eZ,"__esModule",{value:!0});eZ.default=void 0;var RNn=CNn(bN);eZ.default=RNn.default;var nZ=Md.default;Object.defineProperty(s2e,"__esModule",{value:!0});var fZe=s2e.default=void 0,HNn=nZ(ZQ),MNn=nZ(eZ),INn=nZ(bN),zNn=nZ(SN);const O1="${label} geçerli bir ${type} değil",DNn={locale:"tr",Pagination:HNn.default,DatePicker:INn.default,TimePicker:zNn.default,Calendar:MNn.default,global:{placeholder:"Lütfen seçiniz"},Table:{filterTitle:"Filtre menüsü",filterConfirm:"Tamam",filterReset:"Sıfırla",filterEmptyText:"Filtre yok",selectAll:"Tüm sayfayı seç",selectInvert:"Tersini seç",selectionAll:"Tümünü seç",sortTitle:"Sırala",expand:"Satırı genişlet",collapse:"Satırı daralt",triggerDesc:"Azalan düzende sırala",triggerAsc:"Artan düzende sırala",cancelSort:"Sıralamayı kaldır"},Modal:{okText:"Tamam",cancelText:"İptal",justOkText:"Tamam"},Popconfirm:{okText:"Tamam",cancelText:"İptal"},Transfer:{titles:["",""],searchPlaceholder:"Arama",itemUnit:"Öğe",itemsUnit:"Öğeler",remove:"Kaldır",selectCurrent:"Tüm sayfayı seç",removeCurrent:"Sayfayı kaldır",selectAll:"Tümünü seç",removeAll:"Tümünü kaldır",selectInvert:"Tersini seç"},Upload:{uploading:"Yükleniyor...",removeFile:"Dosyayı kaldır",uploadError:"Yükleme hatası",previewFile:"Dosyayı önizle",downloadFile:"Dosyayı indir"},Empty:{description:"Veri Yok"},Icon:{icon:"ikon"},Text:{edit:"Düzenle",copy:"Kopyala",copied:"Kopyalandı",expand:"Genişlet"},Form:{optional:"(opsiyonel)",defaultValidateMessages:{default:"Alan doğrulama hatası ${label}",required:"${label} gerekli bir alan",enum:"${label} şunlardan biri olmalı: [${enum}]",whitespace:"${label} sadece boşluk olamaz",date:{format:"${label} tarih biçimi geçersiz",parse:"${label} bir tarihe dönüştürülemedi",invalid:"${label} geçersiz bir tarih"},types:{string:O1,method:O1,array:O1,object:O1,number:O1,date:O1,boolean:O1,integer:O1,float:O1,regexp:O1,email:O1,url:O1,hex:O1},string:{len:"${label} ${len} karakter olmalı",min:"${label} en az ${min} karakter olmalı",max:"${label} en çok ${max} karakter olmalı",range:"${label} ${min}-${max} karakter arası olmalı"},number:{len:"${label} ${len} olmalı",min:"${label} en az ${min} olmalı",max:"${label} en çok ${max} olmalı",range:"${label} ${min}-${max} arası olmalı"},array:{len:"${label} sayısı ${len} olmalı",min:"${label} sayısı en az ${min} olmalı",max:"${label} sayısı en çok ${max} olmalı",range:"${label} sayısı ${min}-${max} arası olmalı"},pattern:{mismatch:"${label} şu kalıpla eşleşmeli: ${pattern}"}}},Image:{preview:"Önizleme"}};fZe=s2e.default=DNn;var c2e={},oZ={};Object.defineProperty(oZ,"__esModule",{value:!0});oZ.default=void 0;var ENn={items_per_page:"/ сторінці",jump_to:"Перейти",jump_to_confirm:"підтвердити",page:"",prev_page:"Попередня сторінка",next_page:"Наступна сторінка",prev_5:"Попередні 5 сторінок",next_5:"Наступні 5 сторінок",prev_3:"Попередні 3 сторінки",next_3:"Наступні 3 сторінки",page_size:"Page Size"};oZ.default=ENn;var rZ={},TN={},iZ={};Object.defineProperty(iZ,"__esModule",{value:!0});iZ.default=void 0;var FNn={locale:"uk_UA",today:"Сьогодні",now:"Зараз",backToToday:"Поточна дата",ok:"OK",clear:"Очистити",month:"Місяць",year:"Рік",timeSelect:"Обрати час",dateSelect:"Обрати дату",monthSelect:"Обрати місяць",yearSelect:"Обрати рік",decadeSelect:"Обрати десятиріччя",yearFormat:"YYYY",dateFormat:"D-M-YYYY",dayFormat:"D",dateTimeFormat:"D-M-YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Попередній місяць (PageUp)",nextMonth:"Наступний місяць (PageDown)",previousYear:"Попередній рік (Control + left)",nextYear:"Наступний рік (Control + right)",previousDecade:"Попереднє десятиріччя",nextDecade:"Наступне десятиріччя",previousCentury:"Попереднє століття",nextCentury:"Наступне століття"};iZ.default=FNn;var PN={};Object.defineProperty(PN,"__esModule",{value:!0});PN.default=void 0;const kNn={placeholder:"Оберіть час"};PN.default=kNn;var hZe=Md.default;Object.defineProperty(TN,"__esModule",{value:!0});TN.default=void 0;var LNn=hZe(iZ),WNn=hZe(PN);const NNn={lang:Object.assign({placeholder:"Оберіть дату",rangePlaceholder:["Початкова дата","Кінцева дата"]},LNn.default),timePickerLocale:Object.assign({},WNn.default)};TN.default=NNn;var UNn=Md.default;Object.defineProperty(rZ,"__esModule",{value:!0});rZ.default=void 0;var jNn=UNn(TN);rZ.default=jNn.default;var aZ=Md.default;Object.defineProperty(c2e,"__esModule",{value:!0});var pZe=c2e.default=void 0,BNn=aZ(oZ),YNn=aZ(rZ),ONn=aZ(TN),_Nn=aZ(PN);const _1="${label} не є типом ${type}",VNn={locale:"uk",Pagination:BNn.default,DatePicker:ONn.default,TimePicker:_Nn.default,Calendar:YNn.default,global:{placeholder:"Будь ласка, оберіть"},Table:{filterTitle:"Фільтрувати",filterConfirm:"OK",filterReset:"Скинути",filterEmptyText:"Фільтри відсутні",filterCheckall:"Обрати всі",filterSearchPlaceholder:"Пошук у фільтрах",emptyText:"Даних немає",selectAll:"Обрати всі на сторінці",selectInvert:"Інвертувати вибір",selectNone:"Очистити вибір",selectionAll:"Обрати всі",sortTitle:"Сортувати",expand:"Розгорнути рядок",collapse:"Згорнути рядок",triggerDesc:"Сортувати за спаданням",triggerAsc:"Сортувати за зростанням",cancelSort:"Відмінити сортування"},Tour:{Next:"Далі",Previous:"Назад",Finish:"Завершити"},Modal:{okText:"Гаразд",cancelText:"Скасувати",justOkText:"Гаразд"},Popconfirm:{okText:"Гаразд",cancelText:"Скасувати"},Transfer:{titles:["",""],searchPlaceholder:"Введіть текст для пошуку",itemUnit:"елем.",itemsUnit:"елем.",remove:"Видалити",selectCurrent:"Вибрати поточну сторінку",removeCurrent:"Скасувати вибір на сторінці",selectAll:"Вибрати всі дані",removeAll:"Скасувати вибір",selectInvert:"Інвертувати поточну сторінку"},Upload:{uploading:"Завантаження ...",removeFile:"Видалити файл",uploadError:"Помилка завантаження",previewFile:"Попередній перегляд файлу",downloadFile:"Завантажити файл"},Empty:{description:"Даних немає"},Icon:{icon:"іконка"},Text:{edit:"Редагувати",copy:"Скопіювати",copied:"Скопійовано",expand:"Розширити"},Form:{optional:"(опціонально)",defaultValidateMessages:{default:"Помилка валідації для поля ${label}",required:"Будь ласка, заповніть ${label}",enum:"Лише одне зі значень [${enum}] доступне для ${label}",whitespace:"Значення у полі ${label} не може бути пробілом",date:{format:"Не валідний формат дати у ${label}",parse:"Значення ${label} не може бути приведене до дати",invalid:"Не валідна дата у ${label}"},types:{string:_1,method:_1,array:_1,object:_1,number:_1,date:_1,boolean:_1,integer:_1,float:_1,regexp:_1,email:_1,url:_1,hex:_1},string:{len:"${label} має містити ${len} символів",min:"${label} має містити не менш, ніж ${min} символів",max:"${label} має містити не більш, ніж ${max} символів",range:"${label} має містити ${min}-${max} символів"},number:{len:"${label} має дорівнювати ${len}",min:"${label} має бути не менш, ніж ${min}",max:"${label} має бути не більш, ніж ${max}",range:"${label} має бути в межах ${min}-${max}"},array:{len:"${label} має містити ${len} елементи",min:"${label} має містити не менш, ніж ${min} елементи",max:"${label} має містити не більш, ніж ${max} елементи",range:"Кількість елементів в ${label} має бути в межах ${min}-${max}"},pattern:{mismatch:"${label} не відповідає шаблону ${pattern}"}}},Image:{preview:"Попередній перегляд"},QRCode:{expired:"QR-код закінчився",refresh:"Оновити"}};pZe=c2e.default=VNn;const GNn=be.memo(()=>{const t=H(s0),e=n=>{H.getState().set(o=>{switch(o.language=n.target.value,o.language){case"zh_cn":o.locale=iZe;break;case"zh_tw":o.locale=sZe;break;case"es":o.locale=uZe;break;case"tr":o.locale=fZe;break;case"ua":o.locale=pZe;break;default:o.locale=p1e}})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,update:!0,children:h.jsx(Ue.Group,{value:t,style:{height:"170px"},onChange:e,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:"en",children:s9.English}),h.jsx(Ue,{style:{width:"100%"},value:"es",children:s9.Spanish}),h.jsx(Ue,{style:{width:"100%"},value:"zh_cn",children:s9.ChineseSimplified}),h.jsx(Ue,{style:{width:"100%"},value:"zh_tw",children:s9.ChineseTraditional}),h.jsx(Ue,{style:{width:"100%"},value:"tr",children:s9.Turkish}),h.jsx(Ue,{style:{width:"100%"},value:"ua",children:s9.Ukrainian})]})})})}),XNn=(t,e,n)=>{const o={lng:H.getState().language},r=()=>{ht.getState().set(l=>{l.showModelsGallery=!0,l.leaderboardFlag=!0,l.openModelsMap=!1})},i=()=>{ht.getState().set(l=>{l.modelsMapFlag=!0,l.modelsMapWeatherStations=!1,l.openModelsMap=!0,l.showModelsGallery=!1}),H.getState().loggable&&H.getState().set(l=>{l.actionInfo={name:"Open Models Map",timestamp:new Date().getTime()}})},a=[];return t&&!e&&a.push({key:"my-models",label:h.jsxs(rn,{noPadding:!0,onClick:r,children:[Y.t("menu.ModelsGallery",o),"..."]})}),n||a.push({key:"models-map",label:h.jsxs(rn,{noPadding:!0,onClick:i,children:[Y.t("menu.ModelsMap",o),"..."]})}),a},mX=()=>{const t=Fn.getState().orbitControlsRef;if(t!=null&&t.current){const e=Math.min(50,H.getState().sceneRadius*4);t.current.object.position.set(e,e,e),t.current.target.set(0,0,0),t.current.update(),H.getState().set(n=>{const o=n.viewState;o.cameraPosition=[e,e,e],o.panCenter=[0,0,0]})}},yX=t=>{if(H.getState().viewState.orthographic){const e=H.getState().viewState.cameraZoom??20,n=e,o=e/t,r={name:"Zoom",timestamp:Date.now(),oldValue:n,newValue:o,undo:()=>{H.getState().set(i=>{i.viewState.cameraZoom=r.oldValue})},redo:()=>{H.getState().set(i=>{i.viewState.cameraZoom=r.newValue})}};H.getState().addUndoable(r),H.getState().set(i=>{i.viewState.cameraZoom=o})}else{const e=Fn.getState().orbitControlsRef;if(e!=null&&e.current){const n=e.current.object.position,o=n.x*t,r=n.y*t,i=n.z*t,a={name:"Zoom",timestamp:Date.now(),oldCameraPosition:[n.x,n.y,n.z],newCameraPosition:[o,r,i],undo:()=>{var u,d;const l=a.oldCameraPosition[0],s=a.oldCameraPosition[1],c=a.oldCameraPosition[2];(u=e.current)==null||u.object.position.set(l,s,c),(d=e.current)==null||d.update(),H.getState().set(f=>{f.viewState.cameraPosition=[l,s,c]})},redo:()=>{var u,d;const l=a.newCameraPosition[0],s=a.newCameraPosition[1],c=a.newCameraPosition[2];(u=e.current)==null||u.object.position.set(l,s,c),(d=e.current)==null||d.update(),H.getState().set(f=>{f.viewState.cameraPosition=[l,s,c]})}};H.getState().addUndoable(a),e.current.object.position.set(o,r,i),e.current.update(),H.getState().set(l=>{l.viewState.cameraPosition=[o,r,i]})}}},JNn=(t,e)=>{const n={lng:H.getState().language},o=H.getState().viewState.orthographic,r=H.getState().viewState.cameraPosition,i=H.getState().viewState.panCenter,a=r[0]===r[1]&&r[1]===r[2]&&i[0]===0&&i[1]===0&&i[2]===0,l=()=>{const C={name:"Reset View",timestamp:Date.now(),oldCameraPosition:[...r],oldPanCenter:[...i],undo:()=>{const P=Fn.getState().orbitControlsRef;P!=null&&P.current&&(P.current.object.position.set(C.oldCameraPosition[0],C.oldCameraPosition[1],C.oldCameraPosition[2]),P.current.target.set(C.oldPanCenter[0],C.oldPanCenter[1],C.oldPanCenter[2]),P.current.update(),H.getState().set(v=>{const T=v.viewState;T.cameraPosition=[...C.oldCameraPosition],T.panCenter=[...C.oldPanCenter]}))},redo:()=>{mX()}};H.getState().addUndoable(C),mX(),H.getState().set(P=>{P.objectTypeToAdd=z.None,P.groupActionMode=!1,P.viewState.orthographic=!1})},s=()=>{yX(1.1)},c=()=>{yX(.9)},u=C=>{const P=H.getState().setNavigationView,v={name:"Toggle Navigation View",timestamp:Date.now(),checked:C.target.checked,undo:()=>{P(!v.checked)},redo:()=>{P(v.checked)}};H.getState().addUndoable(v),H.getState().set(T=>{T.viewState.autoRotate=!1}),P(C.target.checked)},d=C=>{const P=H.getState().set2DView,v={name:"Toggle 2D View",timestamp:Date.now(),checked:C.target.checked,undo:()=>{P(!v.checked)},redo:()=>{P(v.checked)}};H.getState().addUndoable(v),P(C.target.checked),H.getState().set(T=>{T.viewState.autoRotate=!1})},f=C=>{if(!H.getState().viewState.orthographic){const P={name:"Auto Rotate",timestamp:Date.now(),checked:C.target.checked,undo:()=>{H.getState().set(v=>{v.objectTypeToAdd=z.None,v.groupActionMode=!1,v.viewState.autoRotate=!P.checked})},redo:()=>{H.getState().set(v=>{v.objectTypeToAdd=z.None,v.groupActionMode=!1,v.viewState.autoRotate=P.checked})}};H.getState().addUndoable(P),H.getState().set(v=>{v.objectTypeToAdd=z.None,v.groupActionMode=!1,v.viewState.autoRotate=!v.viewState.autoRotate})}},p=C=>{const P=C.target.checked,v={name:"Show Axes",timestamp:Date.now(),checked:P,undo:()=>{H.getState().set(T=>{T.viewState.axes=!v.checked})},redo:()=>{H.getState().set(T=>{T.viewState.axes=v.checked})}};H.getState().addUndoable(v),H.getState().set(T=>{T.viewState.axes=P})},g=C=>{const P={name:"Show Shadow",timestamp:Date.now(),checked:C.target.checked,undo:()=>{H.getState().set(v=>{v.viewState.shadowEnabled=!P.checked,v.viewState.shadowEnabled&&v.updateSceneRadius()})},redo:()=>{H.getState().set(v=>{v.viewState.shadowEnabled=P.checked,v.viewState.shadowEnabled&&v.updateSceneRadius()})}};H.getState().addUndoable(P),H.getState().set(v=>{v.viewState.shadowEnabled=C.target.checked,v.viewState.shadowEnabled&&v.updateSceneRadius()})},y=C=>{const P=C.target.checked?ew:0,v={name:"Set Surface Shininess",timestamp:Date.now(),oldValue:H.getState().viewState.solarPanelShininess??ew,newValue:P,undo:()=>{H.getState().set(T=>{T.viewState.solarPanelShininess=v.oldValue})},redo:()=>{H.getState().set(T=>{T.viewState.solarPanelShininess=v.newValue})}};H.getState().addUndoable(v),H.getState().set(T=>{T.viewState.solarPanelShininess=P})},w=C=>{const P=H.getState().floatingWindowOpacity,v=C.target.checked?m0:1,T={name:"Floating Window Opacity",timestamp:Date.now(),oldValue:P,newValue:v,undo:()=>{H.getState().set(A=>{A.floatingWindowOpacity=T.oldValue})},redo:()=>{H.getState().set(A=>{A.floatingWindowOpacity=T.newValue})}};H.getState().addUndoable(T),H.getState().set(A=>{A.floatingWindowOpacity=v})},b=[];return!o&&!a&&b.push({key:"reset-view",label:h.jsxs(rn,{onClick:l,children:[Y.t("menu.view.ResetView",n),h.jsxs(lh,{children:["(",t,")"]})]})}),b.push({key:"zoom-out-view",label:h.jsxs(rn,{onClick:s,children:[Y.t("menu.view.ZoomOut",n),h.jsxs(lh,{children:["(",e?"⌘":"Ctrl","+])"]})]})}),b.push({key:"zoom-in-view",label:h.jsxs(rn,{onClick:c,children:[Y.t("menu.view.ZoomIn",n),h.jsxs(lh,{children:["(",e?"⌘":"Ctrl","+[)"]})]})}),b.push({key:"navigation-view-check-box",label:h.jsxs(f2,{selector:Nq,onChange:u,children:[Y.t("menu.view.NavigationView",n),h.jsxs(lh,{children:["(",mre,"+Q)"]})]})}),b.push({key:"orthographic-check-box",label:h.jsxs(f2,{selector:Id,onChange:d,children:[Y.t("menu.view.TwoDimensionalView",n),h.jsxs(lh,{children:["(",mre,"+B)"]})]})}),o||b.push({key:"auto-rotate-check-box",label:h.jsxs(f2,{selector:SBe,onChange:f,children:[Y.t("menu.view.AutoRotate",n),h.jsxs(lh,{children:["(",mre,"+M)"]})]})}),b.push({key:"axes-check-box",label:h.jsx(f2,{selector:Age,onChange:p,children:Y.t("skyMenu.Axes",n)})}),b.push({key:"shadow-check-box",label:h.jsx(f2,{selector:Ds,onChange:g,children:Y.t("menu.view.ShowShadow",n)})}),b.push({key:"shininess-check-box",label:h.jsx(f2,{selector:C=>C.viewState.solarPanelShininess===void 0||C.viewState.solarPanelShininess>0,onChange:y,children:Y.t("menu.view.ShowSurfaceShininess",n)})}),b.push({key:"translucency-check-box",label:h.jsx(f2,{selector:C=>C.floatingWindowOpacity<1,onChange:w,children:Y.t("menu.view.TranslucentFloatingWindows",n)})}),b},KNn=()=>{const t={lng:H.getState().language},e=H.getState().set,n=H.getState().addUndoable,o=H.getState().viewState.showHeliodonPanel,r=H.getState().viewState.showMapPanel,i=H.getState().viewState.showWeatherPanel,a=H.getState().viewState.showDiurnalTemperaturePanel,l=ht.getState().showEconomicsPanel,s=ht.getState().showNavigationPanel,c=ht.getState().showShadowSettings,u=H.getState().loggable,d=()=>{const P={name:"Open Sun and Time Settings Panel",timestamp:Date.now(),undo:()=>{e(v=>{v.viewState.showHeliodonPanel=!1})},redo:()=>{e(v=>{v.viewState.showHeliodonPanel=!0})}};n(P),e(v=>{v.viewState.showHeliodonPanel=!0,v.selectedFloatingWindow="heliodonPanel"})},f=()=>{const P={name:"Open Maps",timestamp:Date.now(),undo:()=>{e(v=>{v.viewState.showMapPanel=!1})},redo:()=>{e(v=>{v.viewState.showMapPanel=!0})}};n(P),e(v=>{v.viewState.showMapPanel=!0,v.selectedFloatingWindow="mapPanel"})},p=()=>{const P={name:"Open Weather Panel",timestamp:Date.now(),undo:()=>{e(v=>{v.viewState.showWeatherPanel=!1})},redo:()=>{e(v=>{v.viewState.showWeatherPanel=!0})}};n(P),e(v=>{v.viewState.showWeatherPanel=!0,v.selectedFloatingWindow="weatherPanel"})},g=()=>{const P={name:"Open Diurnal Temperature Panel",timestamp:Date.now(),undo:()=>{e(v=>{v.viewState.showDiurnalTemperaturePanel=!1})},redo:()=>{e(v=>{v.viewState.showDiurnalTemperaturePanel=!0})}};n(P),e(v=>{v.viewState.showDiurnalTemperaturePanel=!0,v.selectedFloatingWindow="diurnalTemperaturePanel"})},y=()=>{ht.getState().set(P=>{P.showEconomicsPanel=!0}),u&&e(P=>{P.actionInfo={name:"Open Economics Panel",timestamp:new Date().getTime()}})},w=()=>{ht.getState().set(P=>{P.showNavigationPanel=!0}),u&&e(P=>{P.actionInfo={name:"Open Navigation Panel",timestamp:new Date().getTime()}})},b=()=>{ht.getState().set(P=>{P.showShadowSettings=!0}),u&&e(P=>{P.actionInfo={name:"Open Shadow Settings",timestamp:new Date().getTime()}})},C=[];return o||C.push({key:"sun-time",label:h.jsxs(rn,{noPadding:!0,onClick:d,children:[Y.t("menu.settings.SunAndTime",t),"..."]})}),r||C.push({key:"show-map-panel",label:h.jsxs(rn,{noPadding:!0,onClick:f,children:[Y.t("word.Location",t),"..."]})}),i||C.push({key:"weather-panel",label:h.jsxs(rn,{noPadding:!0,onClick:p,children:[Y.t("menu.settings.WeatherData",t),"..."]})}),a||C.push({key:"diurnal-temperature-panel",label:h.jsxs(rn,{noPadding:!0,onClick:g,children:[Y.t("menu.settings.DiurnalTemperature",t),"..."]})}),l||C.push({key:"economics-panel",label:h.jsxs(rn,{noPadding:!0,onClick:y,children:[Y.t("economicsPanel.EconomicsParameters",t),"..."]})}),s||C.push({key:"navigation-panel",label:h.jsxs(rn,{noPadding:!0,onClick:w,children:[Y.t("navigationPanel.NavigationParameters",t),"..."]})}),c||C.push({key:"shadow-settings",label:h.jsxs(rn,{noPadding:!0,onClick:b,children:[Y.t("shadowSettingsPanel.ShadowSettings",t),"..."]})}),C},qNn=()=>{const t={lng:H.getState().language},e=H.getState().set,n=H.getState().addUndoable,o=s=>{const c=s.target.checked,u={name:"Show Site Information",timestamp:Date.now(),checked:c,undo:()=>{e(d=>{d.viewState.showSiteInfoPanel=!u.checked})},redo:()=>{e(d=>{d.viewState.showSiteInfoPanel=u.checked})}};n(u),e(d=>{d.viewState.showSiteInfoPanel=c})},r=s=>{const c=s.target.checked,u={name:"Show Design Information",timestamp:Date.now(),checked:c,undo:()=>{e(d=>{d.viewState.showDesignInfoPanel=!u.checked})},redo:()=>{e(d=>{d.viewState.showDesignInfoPanel=u.checked})}};n(u),e(d=>{d.viewState.showDesignInfoPanel=!d.viewState.showDesignInfoPanel})},i=s=>{const c={name:"Show Instruction Panel",timestamp:Date.now(),checked:s.target.checked,undo:()=>{e(u=>{u.viewState.showInstructionPanel=!c.checked})},redo:()=>{e(u=>{u.viewState.showInstructionPanel=c.checked})}};n(c),e(u=>{u.viewState.showInstructionPanel=!u.viewState.showInstructionPanel})},a=s=>{const c={name:"Show Sticky Note",timestamp:Date.now(),checked:s.target.value,undo:()=>{e(u=>{u.viewState.showStickyNotePanel=!c.checked})},redo:()=>{e(u=>{u.viewState.showStickyNotePanel=c.checked})}};n(c),e(u=>{u.viewState.showStickyNotePanel=!u.viewState.showStickyNotePanel})};return[{key:"site-info-panel-check-box",label:h.jsx(f2,{selector:vge,onChange:o,children:Y.t("menu.view.accessories.SiteInformation",t)})},{key:"design-info-panel-check-box",label:h.jsx(f2,{selector:jq,onChange:r,children:Y.t("menu.view.accessories.DesignInformation",t)})},{key:"instruction-panel-check-box",label:h.jsx(f2,{selector:IBe,onChange:i,children:Y.t("menu.view.accessories.Instruction",t)})},{key:"sticky-note-panel-check-box",label:h.jsx(f2,{selector:DBe,onChange:a,children:Y.t("menu.view.accessories.StickyNote",t)})}]};var ag=(t=>(t[t.NO_BUILDING=3]="NO_BUILDING",t[t.AT_LEAST_ONE_BAD_NO_GOOD=2]="AT_LEAST_ONE_BAD_NO_GOOD",t[t.AT_LEAST_ONE_BAD_AT_LEAST_ONE_GOOD=1]="AT_LEAST_ONE_BAD_AT_LEAST_ONE_GOOD",t[t.OK=0]="OK",t))(ag||{});const vO=50,AX=(t,e,n)=>{if(e(z.Foundation)===0)return{status:3};let r=!1,i=!1,a;for(const l of t)if(l.type===z.Foundation){const s=l;if(s.notBuilding)continue;if(n(z.Wall,s.id).length>0){const u=me.getBuildingCompletionStatus(s,t);u===jc.COMPLETE?r=!0:(i=!0,a=u)}else i=!0}return i&&!r?{status:2,buildingCompletion:a}:i&&r?{status:1}:{status:0}},K7=t=>{if(!t.color)return .5;const e=t.color.toLowerCase();if(e==="white")return .05;if(e==="black")return .95;const n=parseInt(t.color.substring(1),16),o=n>>16&255,r=n>>8&255,i=n&255;let a=Math.min(o,r);a=Math.min(a,i);let l=Math.max(o,r);return l=Math.max(l,i),Math.min(.95,Math.max(.05,1-(a+l)/510))},xO=(t,e,n,o)=>e<0&&t.low>=n-o||e>0&&t.high<=n+o?0:e,$x=(t,e,n,o,r,i)=>{if(n===y2.Sinusoidal)return .5*(t+e)-.5*(t-e)*Math.cos(rde*(i-(o-720)));const a=.5*(t+e),l=.5*(t-e),s=r.daylight();if(i>r.sunrise&&ir.sunset){const p=i-r.sunset;return e+(u-e)*Math.exp(-d*p/c)}const f=i+23*60-r.sunset;return e+(u-e)*Math.exp(-d*f/c)},Qx=(t,e,n)=>{const o=t.getFullYear(),r=t.getMonth(),i=t.getDate(),l=me.daysOfMonth(r,o)/2;let s,c,u;if(i11&&(c=0);const p=me.daysOfMonth(c,o)/2,g=l+p;u=(i-l)/g}const d=e[s]+(e[c]-e[s])*u,f=n[s]+(n[c]-n[s])*u;return{low:d,high:f}},$Nn=(t,e,n,o,r,i)=>{const a=n.length;let l=0,s=-1e3,c=1e3,u=-1e3,d=1e3;for(let g=0;go[g]&&(c=o[g]),d>n[g]&&(d=n[g]);l/=2*a;const f=.25*(s-c+u-d),p=i*Math.sqrt(Xie/(2*r));return t>0?l-f*Math.exp(-p)*Math.cos(Xie*(e-MSe)-p):l-f*Math.exp(-p)*Math.cos(Math.PI+Xie*(e-MSe)-p)},gZe=(t,e,n,o,r,i,a,l,s)=>$Nn(t,e,o,r,l,s)-Math.exp(-s*Math.sqrt(rde/(2*l)))*a*Math.cos(rde*(n-(i-720)-KQt)),{Option:q7}=_o,lZ=be.memo(({type:t})=>{const e=H(jBe),n=H(C8t),o=H(H8t),r=Jt(),i=m.useMemo(()=>{switch(t){case ns.CSP:return n;case ns.SUT:return o;default:return e}},[t,e,n,o]);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{width:"150px"},children:Y.t("menu.option.SamplingFrequency",r)+":"}),h.jsxs(_o,{style:{width:"72px"},value:i??4,onChange:a=>{H.getState().set(l=>{switch(t){case ns.CSP:l.world.cspTimesPerHour=a;break;case ns.SUT:l.world.sutTimesPerHour=a;break;default:l.world.timesPerHour=a;break}})},children:[h.jsx(q7,{value:1,children:"1"},1),h.jsx(q7,{value:2,children:"2"},2),h.jsx(q7,{value:3,children:"3"},3),h.jsx(q7,{value:4,children:"4"},4),h.jsx(q7,{value:6,children:"6"},6),h.jsx(q7,{value:12,children:"12"},12),h.jsx(q7,{value:30,children:"30"},30)]}),h.jsx(en,{style:{paddingLeft:"10px"},children:Y.t("menu.option.TimesPerHour",r)})]})}),{Option:lae}=_o,sZ=be.memo(({type:t})=>{const e=H(IH),n=H(uW),o=H(YBe),r=Jt(),i=m.useMemo(()=>{switch(t){case ns.CSP:return n;case ns.SUT:return o;default:return e}},[t,e,n,o]);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsxs(_o,{style:{marginLeft:"150px",width:"72px"},value:i??6,onChange:a=>{switch(t){case ns.BUILDING:H.getState().set(l=>{l.world.daysPerYear=a});break;case ns.PV:H.getState().set(l=>{l.world.daysPerYear=a}),Tn.setState({yearlyPvYield:[]});break;case ns.CSP:H.getState().set(l=>{l.world.cspDaysPerYear=a}),Tn.setState({yearlyParabolicTroughYield:[],yearlyParabolicDishYield:[],yearlyFresnelReflectorYield:[],yearlyHeliostatYield:[]});break;case ns.SUT:H.getState().set(l=>{l.world.sutDaysPerYear=a}),Tn.setState({yearlyUpdraftTowerYield:[]});break}},children:[h.jsx(lae,{value:4,children:"4"},4),h.jsx(lae,{value:6,children:"6"},6),h.jsx(lae,{value:12,children:"12"},12)]}),h.jsx(en,{style:{paddingLeft:"10px"},children:Y.t("menu.option.DaysPerYear",r)})]})}),CN=be.memo(({type:t})=>{const e=H(S8t),n=H(T8t),o=H(R8t),r=H(M8t),i=Jt(),a=m.useMemo(()=>{switch(t){case ns.PV:return n;case ns.CSP:return o;case ns.SUT:return r;default:return e}},[t,n,o,r,e]);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{width:"150px"},children:Y.t("menu.option.GridCellSize",i)+":"}),h.jsx(Mn,{min:.1,max:5,step:.05,style:{width:72},precision:2,value:a??.5,onChange:l=>{l!==null&&H.getState().set(s=>{switch(t){case ns.PV:s.world.pvGridCellSize=l;break;case ns.CSP:s.world.cspGridCellSize=l;break;case ns.SUT:s.world.sutGridCellSize=l;break;default:s.world.solarRadiationHeatmapGridCellSize=l;break}})}}),h.jsx(en,{style:{paddingLeft:"10px"},children:Y.t("word.MeterAbbreviation",i)})]})}),QNn=()=>[{key:"building-energy-simulation-sampling-frequency",label:h.jsx(lZ,{type:ns.BUILDING})},{key:"building-energy-simulation-sampling-days",label:h.jsx(sZ,{type:ns.BUILDING})},{key:"building-energy-simulation-grid-cell-size",label:h.jsx(CN,{type:ns.BUILDING})}],{Option:nPe}=_o,ZNn=be.memo(()=>{const t=Jt(),e=H(b8t);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{width:"150px"},children:Y.t("menu.solarPanel.PanelDiscretization",t)+":"}),h.jsxs(_o,{style:{width:"165px"},value:e??Fm.APPROXIMATE,onChange:n=>{H.getState().set(o=>{o.world.discretization=n})},children:[h.jsx(nPe,{value:Fm.EXACT,children:Y.t("menu.solarPanel.Exact",t)},Fm.EXACT),h.jsx(nPe,{value:Fm.APPROXIMATE,children:Y.t("menu.solarPanel.Approximate",t)},Fm.APPROXIMATE)]})]})}),eUn=be.memo(()=>{const t=Jt(),e=H(Pge);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{width:"280px"},children:Y.t("menu.solarPanel.SolarPanelSimulationNoAnimation",t)+":"}),h.jsx(xc,{checked:e,onChange:n=>{H.getState().set(o=>{o.world.noAnimationForSolarPanelSimulation=n})}})]})}),tUn=t=>{const e=H.getState().world.discretization,n=[{key:"solar-panel-simulation-sampling-frequency",label:h.jsx(lZ,{type:ns.PV})},{key:"solar-panel-simulation-sampling-days",label:h.jsx(sZ,{type:ns.PV})},{key:"solar-panel-discretization",label:h.jsx(ZNn,{})}];return(!e||e===Fm.APPROXIMATE)&&n.push({key:"solar-panel-simulation-grid-cell-size",label:h.jsx(CN,{type:ns.PV})}),t||n.push({key:"solar-panel-simulation-no-animation",label:h.jsx(eUn,{})}),n},bO=t=>[{key:`${t}-simulation-sampling-frequency`,label:h.jsx(lZ,{type:ns.CSP})},{key:`${t}-simulation-sampling-days`,label:h.jsx(sZ,{type:ns.CSP})},{key:`${t}-simulation-grid-cell-size`,label:h.jsx(CN,{type:ns.CSP})}],nUn=be.memo(()=>{const t=Jt(),e=H(Cf);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{width:"280px"},children:Y.t("menu.physics.SolarRadiationHeatmapMaxValue",t)+":"}),h.jsx(Mn,{min:.5,max:50,step:.5,style:{width:60},precision:1,value:e??5,onChange:n=>{H.getState().set(o=>{n!==null&&(o.viewState.solarRadiationHeatMapMaxValue=n)})}})]})}),oUn=be.memo(()=>{const t=Jt(),e=H(jBe);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{width:"150px"},children:Y.t("menu.option.SamplingFrequency",t)+":"}),h.jsx(Mn,{min:1,max:60,step:1,style:{width:60},precision:0,value:e,formatter:n=>Number(n).toFixed(0),onChange:n=>{n!==null&&H.getState().set(o=>{o.world.timesPerHour=n})}}),h.jsx(en,{style:{paddingLeft:"10px"},children:Y.t("menu.option.TimesPerHour",t)})]})}),rUn=be.memo(()=>{const t=Jt(),e=H(P8t);return h.jsxs(rn,{noPadding:!0,stayAfterClick:!0,children:[h.jsx(en,{style:{paddingRight:"10px"},children:Y.t("menu.solarPanel.VisibilityGridCellSize",t)+":"}),h.jsx(Mn,{min:.1,max:5,step:.1,style:{width:60},precision:1,value:e??.2,onChange:n=>{n!==null&&H.getState().set(o=>{o.world.solarPanelVisibilityGridCellSize=n})}}),h.jsx(en,{style:{paddingLeft:"10px"},children:Y.t("word.MeterAbbreviation",t)})]})}),iUn=()=>[{key:"sut-simulation-sampling-frequency",label:h.jsx(lZ,{type:ns.SUT})},{key:"sut-simulation-sampling-days",label:h.jsx(sZ,{type:ns.SUT})},{key:"sut-simulation-grid-cell-size",label:h.jsx(CN,{type:ns.SUT})}],aUn=t=>{const e={lng:H.getState().language},n=ht.getState().setPrimitiveStore,o=H.getState().set,r=H.getState().selectNone,i=H.getState().countElementsByType,a=H.getState().countHeatmapCells,l=ht.getState().runDynamicSimulation,s=ht.getState().runStaticSimulation,c=H.getState().world.noAnimationForHeatmapSimulation,u=H.getState().elements,d=H.getState().loggable,f=me.hasMovingParts(u),p=[],g=()=>{s||hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{r(),n("runStaticSimulation",!s),d&&o(B=>{B.actionInfo={name:"Generate Daily Solar Radiation Heatmap (Static)",timestamp:new Date().getTime()}})},100)},y=()=>{l||hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{r(),n("runDynamicSimulation",!l),d&&o(B=>{B.actionInfo={name:"Generate Daily Solar Radiation Heatmap (Dynamic)",timestamp:new Date().getTime()}})},100)},w=()=>{a()>oje?Oi.confirm({title:Y.t("message.CalculationMayBeSlowDoYouWantToContinue",e)+" ("+Y.t("message.IncreaseSolarRadiationHeatmapGridCellSizeToSpeedUp",e)+")",icon:h.jsx(QW,{}),onOk:()=>{b()},onCancel:()=>{},okText:`${Y.t("word.Yes",e)}`,cancelText:`${Y.t("word.No",e)}`}):b()},b=()=>{!c||f?y():g()},C=()=>{if(i(z.Sensor)===0){hn(Y.t("analysisManager.NoSensorForCollectingData",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{d&&o(_=>{_.actionInfo={name:"Collect Daily Data for Sensors",timestamp:new Date().getTime()}}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailyLightSensor=!0})},100)},P=()=>{if(i(z.Sensor)===0){hn(Y.t("analysisManager.NoSensorForCollectingData",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{d&&o(_=>{_.actionInfo={name:"Collect Yearly Data for Sensors",timestamp:new Date().getTime()}}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runYearlyLightSensor=!0})},100)},v=()=>{const B=AX(u,H.getState().countElementsByType,H.getState().getChildrenOfType);if(B.status===ag.NO_BUILDING){hn(Y.t("analysisManager.NoBuildingForAnalysis",e));return}if(B.status===ag.AT_LEAST_ONE_BAD_NO_GOOD){let _;switch(B.buildingCompletion){case jc.WALL_DISJOINED:_=Y.t("message.WallsAreNotConnected",e);break;case jc.WALL_EMPTY:_=Y.t("message.BuildingContainsEmptyWall",e);break;case jc.ROOF_MISSING:_=Y.t("message.BuildingRoofMissing",e);break;default:_=Y.t("message.UnknownErrors",e)}po(Y.t("message.SimulationWillNotStartDueToErrors",e)+": "+_);return}B.status===ag.AT_LEAST_ONE_BAD_AT_LEAST_ONE_GOOD&&SR(Y.t("message.SimulationWillStartDespiteWarnings",e)),hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{r(),d&&o(_=>{_.actionInfo={name:"Analyze Daily Building Energy",timestamp:new Date().getTime()}}),ht.getState().set(_=>{_.runDailyThermalSimulation=!0,_.simulationInProgress=!0})},100)},T=()=>{const B=AX(u,H.getState().countElementsByType,H.getState().getChildrenOfType);if(B.status===ag.NO_BUILDING){hn(Y.t("analysisManager.NoBuildingForAnalysis",e));return}if(B.status===ag.AT_LEAST_ONE_BAD_NO_GOOD){let _;switch(B.buildingCompletion){case jc.WALL_DISJOINED:_=Y.t("message.WallsAreNotConnected",e);break;case jc.WALL_EMPTY:_=Y.t("message.BuildingContainsEmptyWall",e);break;case jc.ROOF_MISSING:_=Y.t("message.BuildingRoofMissing",e);break;default:_=Y.t("message.UnknownErrors",e)}po(Y.t("message.SimulationWillNotStartDueToErrors",e)+": "+_);return}B.status===ag.AT_LEAST_ONE_BAD_AT_LEAST_ONE_GOOD&&SR(Y.t("message.SimulationWillStartDespiteWarnings",e)),hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{r(),ht.getState().set(_=>{_.runYearlyThermalSimulation=!0,_.simulationInProgress=!0}),d&&o(_=>{_.actionInfo={name:"Analyze Yearly Building Energy",timestamp:new Date().getTime()}})},100)},A=()=>{if(i(z.SolarPanel)===0){hn(Y.t("analysisManager.NoSolarPanelForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.dailyPvIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Daily Simulation For Solar Panels",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailySimulationForSolarPanels=!0})},100)},x=()=>{if(i(z.SolarPanel)===0){hn(Y.t("analysisManager.NoSolarPanelForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.yearlyPvIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Yearly Simulation For Solar Panels",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runYearlySimulationForSolarPanels=!0})},100)},S=()=>{if(H.getState().countObservers()===0){hn(Y.t("analysisManager.NoObserverForVisibilityAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{ht.getState().set(_=>{_.runSolarPanelVisibilityAnalysis=!_.runSolarPanelVisibilityAnalysis,_.simulationInProgress=!0}),d&&o(_=>{_.actionInfo={name:"Run Visibility Analysis For Solar Panels",timestamp:new Date().getTime()}})},100)},R=()=>{if(i(z.ParabolicTrough)===0){hn(Y.t("analysisManager.NoParabolicTroughForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.dailyParabolicTroughIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Daily Simulation for Parabolic Troughs",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailySimulationForParabolicTroughs=!0})},100)},M=()=>{if(i(z.ParabolicTrough)===0){hn(Y.t("analysisManager.NoParabolicTroughForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.yearlyParabolicTroughIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Yearly Simulation for Parabolic Troughs",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runYearlySimulationForParabolicTroughs=!0})},100)},D=()=>{if(i(z.ParabolicDish)===0){hn(Y.t("analysisManager.NoParabolicDishForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.dailyParabolicDishIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Daily Simulation for Parabolic Dishes",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailySimulationForParabolicDishes=!0})},100)},E=()=>{if(i(z.ParabolicDish)===0){hn(Y.t("analysisManager.NoParabolicDishForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.yearlyParabolicDishIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Yearly Simulation for Parabolic Dishes",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runYearlySimulationForParabolicDishes=!0})},100)},W=()=>{if(i(z.FresnelReflector)===0){hn(Y.t("analysisManager.NoFresnelReflectorForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.dailyFresnelReflectorIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Daily Simulation for Fresnel Reflectors",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailySimulationForFresnelReflectors=!0})},100)},j=()=>{if(i(z.FresnelReflector)===0){hn(Y.t("analysisManager.NoFresnelReflectorForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.yearlyFresnelReflectorIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Yearly Simulation for Fresnel Reflectors",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runYearlySimulationForFresnelReflectors=!0})},100)},L=()=>{if(i(z.Heliostat)===0){hn(Y.t("analysisManager.NoHeliostatForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.dailyHeliostatIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Daily Simulation for Heliostats",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailySimulationForHeliostats=!0})},100)},k=()=>{if(i(z.Heliostat)===0){hn(Y.t("analysisManager.NoHeliostatForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.yearlyHeliostatIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Yearly Simulation for Heliostats",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runYearlySimulationForHeliostats=!0})},100)},N=()=>{if(H.getState().countSolarStructuresByType(Dn.UpdraftTower)===0){hn(Y.t("analysisManager.NoSolarUpdraftTowerForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.dailyUpdraftTowerIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Daily Simulation for Solar Updraft Tower",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailySimulationForUpdraftTower=!0})},100)},F=()=>{if(H.getState().countSolarStructuresByType(Dn.UpdraftTower)===0){hn(Y.t("analysisManager.NoSolarUpdraftTowerForAnalysis",e));return}hn(Y.t("message.SimulationStarted",e)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.yearlyUpdraftTowerIndividualOutputs=!1),d&&(_.actionInfo={name:"Run Yearly Simulation for Solar Updraft Tower",timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runYearlySimulationForUpdraftTower=!0})},100)},U=[];U.push({key:"solar-radiation-heatmap-grid-cell-size",label:h.jsx(CN,{type:ns.BUILDING})}),U.push({key:"solar-radiation-heatmap-max-value",label:h.jsx(nUn,{})}),me.hasHeliostatOrFresnelReflectors(u)&&U.push({key:"solar-radiation-heatmap-reflection-only",label:h.jsx(oae,{selector:yge,onChange:B=>{H.getState().set(_=>{_.world.noAnimationForHeatmapSimulation=B})},children:Y.t("menu.physics.ReflectionHeatmap",e)+":"})}),f||U.push({key:"solar-radiation-heatmap-no-animation",label:h.jsx(oae,{selector:Sge,onChange:B=>{H.getState().set(_=>{_.world.noAnimationForHeatmapSimulation=B})},children:Y.t("menu.physics.SolarRadiationHeatmapNoAnimation",e)+":"})}),p.push({key:"physics-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.physicsSubMenu",e)}),children:[{key:"daily-solar-radiation-heatmap",label:h.jsx(rn,{noPadding:!0,onClick:w,children:Y.t("menu.physics.DailySolarRadiationHeatmap",e)})},{key:"solar-radiation-heatmap-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.physics.SolarRadiationHeatmapOptions",e)}),children:U}]});const O=[];return O.push({key:"sensor-simulation-sampling-frequency",label:h.jsx(oUn,{})}),f||O.push({key:"sensor-simulation-no-animation",label:h.jsx(oae,{selector:Tge,onChange:B=>{H.getState().set(_=>{_.world.noAnimationForSensorDataCollection=B})},children:Y.t("menu.sensor.SensorSimulationNoAnimation",e)+":"})}),t.sensorCount>0&&p.push({key:"sensor-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.sensorSubMenu",e)}),children:[{key:"sensor-collect-daily-data",label:h.jsx(rn,{noPadding:!0,onClick:C,children:Y.t("menu.sensor.CollectDailyData",e)})},{key:"sensor-collect-yearly-data",label:h.jsx(rn,{noPadding:!0,onClick:P,children:Y.t("menu.sensor.CollectYearlyData",e)})},{key:"sensor-simulation-options-submenu-2",label:h.jsx(rn,{noPadding:!0,children:Y.t("word.Options",e)}),children:O}]}),t.wallCount>0&&p.push({key:"buildings-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.buildingSubMenu",e)}),children:[{key:"building-energy-daily-data",label:h.jsx(rn,{noPadding:!0,onClick:v,children:Y.t("menu.building.AnalyzeDailyBuildingEnergy",e)})},{key:"building-energy-yearly-data",label:h.jsx(rn,{noPadding:!0,onClick:T,children:Y.t("menu.building.AnalyzeYearlyBuildingEnergy",e)})},{key:"building-energy-analysis-options-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.building.EnergyAnalysisOptions",e)}),children:QNn()}]}),t.solarPanelCount>0&&p.push({key:"solar-panels-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.solarPanelSubMenu",e)}),children:[{key:"solar-panel-daily-yield",label:h.jsx(rn,{noPadding:!0,onClick:A,children:Y.t("menu.solarPanel.AnalyzeDailyYield",e)})},{key:"solar-panel-yearly-yield",label:h.jsx(rn,{noPadding:!0,onClick:x,children:Y.t("menu.solarPanel.AnalyzeYearlyYield",e)})},{key:"solar-panel-energy-analysis-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.solarPanel.EnergyAnalysisOptions",e)}),children:tUn(f)},{key:"solar-panel-visibility",label:h.jsx(rn,{noPadding:!0,onClick:S,children:Y.t("menu.solarPanel.AnalyzeVisibility",e)})},{key:"solar-panel-visibility-analysis-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.solarPanel.VisibilityAnalysisOptions",e)}),children:[{key:"solar-panel-visibility-grid-cell-size",label:h.jsx(rUn,{})}]}]}),t.parabolicTroughCount>0&&p.push({key:"parabolic-troughs-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.parabolicTroughSubMenu",e)}),children:[{key:"parabolic-trough-daily-yield",label:h.jsx(rn,{noPadding:!0,onClick:R,children:Y.t("menu.parabolicTrough.AnalyzeDailyYield",e)})},{key:"parabolic-trough-yearly-yield",label:h.jsx(rn,{noPadding:!0,onClick:M,children:Y.t("menu.parabolicTrough.AnalyzeYearlyYield",e)})},{key:"parabolic-trough-analysis-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.AnalysisOptions",e)}),children:bO("parabolic-trough")}]}),t.parabolicDishCount>0&&p.push({key:"parabolic-dishes-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.parabolicDishSubMenu",e)}),children:[{key:"parabolic-dish-daily-yield",label:h.jsx(rn,{noPadding:!0,onClick:D,children:Y.t("menu.parabolicDish.AnalyzeDailyYield",e)})},{key:"parabolic-dish-yearly-yield",label:h.jsx(rn,{noPadding:!0,onClick:E,children:Y.t("menu.parabolicDish.AnalyzeYearlyYield",e)})},{key:"parabolic-dish-analysis-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.AnalysisOptions",e)}),children:bO("parabolic-dish")}]}),t.fresnelReflectorCount>0&&p.push({key:"fresnel-reflector-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.fresnelReflectorSubMenu",e)}),children:[{key:"fresnel-reflector-daily-yield",label:h.jsx(rn,{noPadding:!0,onClick:W,children:Y.t("menu.fresnelReflector.AnalyzeDailyYield",e)})},{key:"fresnel-reflector-yearly-yield",label:h.jsx(rn,{noPadding:!0,onClick:j,children:Y.t("menu.fresnelReflector.AnalyzeYearlyYield",e)})},{key:"fresnel-reflector-analysis-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.AnalysisOptions",e)}),children:bO("fresnel-reflector")}]}),t.heliostatCount>0&&p.push({key:"heliostat-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.heliostatSubMenu",e)}),children:[{key:"heliostat-daily-yield",label:h.jsx(rn,{noPadding:!0,onClick:L,children:Y.t("menu.heliostat.AnalyzeDailyYield",e)})},{key:"heliostat-yearly-yield",label:h.jsx(rn,{noPadding:!0,onClick:k,children:Y.t("menu.heliostat.AnalyzeYearlyYield",e)})},{key:"heliostat-analysis-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.AnalysisOptions",e)}),children:bO("heliostat-analysis")}]}),t.solarUpdraftTowerCount>0&&p.push({key:"solar-updraft-tower-submenu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.solarUpdraftTowerSubMenu",e)}),children:[{key:"solar-updraft-tower-daily-yield",label:h.jsx(rn,{noPadding:!0,onClick:N,children:Y.t("menu.solarUpdraftTower.AnalyzeDailyYield",e)})},{key:"solar-updraft-tower-yearly-yield",label:h.jsx(rn,{noPadding:!0,onClick:F,children:Y.t("menu.solarUpdraftTower.AnalyzeYearlyYield",e)})},{key:"solar-updraft-tower-analysis-options",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.AnalysisOptions",e)}),children:iUn()}]}),p};/** * @license * Copyright 2017 Google LLC * @@ -4941,7 +4941,7 @@ Length provided: ${this.length}. Number of dictionaries provided: ${this.diction * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var yZe=function(t){for(var e=[],n=0,o=0;o>6|192,e[n++]=r&63|128):(r&64512)===55296&&o+1>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=r&63|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=r&63|128)}return e},lUn=function(t){for(var e=[],n=0,o=0;n191&&r<224){var i=t[n++];e[o++]=String.fromCharCode((r&31)<<6|i&63)}else if(r>239&&r<365){var i=t[n++],a=t[n++],l=t[n++],s=((r&7)<<18|(i&63)<<12|(a&63)<<6|l&63)-65536;e[o++]=String.fromCharCode(55296+(s>>10)),e[o++]=String.fromCharCode(56320+(s&1023))}else{var i=t[n++],a=t[n++];e[o++]=String.fromCharCode((r&15)<<12|(i&63)<<6|a&63)}}return e.join("")},c2e={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,o=[],r=0;r>2,d=(i&3)<<4|l>>4,f=(l&15)<<2|c>>6,p=c&63;s||(p=64,a||(f=64)),o.push(n[u],n[d],n[f],n[p])}return o.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(yZe(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):lUn(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,o=[],r=0;r>4;if(o.push(f),c!==64){var p=l<<4&240|c>>2;if(o.push(p),d!==64){var g=c<<6&192|d;o.push(g)}}}return o},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},AZe=function(t){var e=yZe(t);return c2e.encodeByteArray(e,!0)},nPe=function(t){return AZe(t).replace(/\./g,"")},oPe=function(t){try{return c2e.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** + */var yZe=function(t){for(var e=[],n=0,o=0;o>6|192,e[n++]=r&63|128):(r&64512)===55296&&o+1>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=r&63|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=r&63|128)}return e},lUn=function(t){for(var e=[],n=0,o=0;n191&&r<224){var i=t[n++];e[o++]=String.fromCharCode((r&31)<<6|i&63)}else if(r>239&&r<365){var i=t[n++],a=t[n++],l=t[n++],s=((r&7)<<18|(i&63)<<12|(a&63)<<6|l&63)-65536;e[o++]=String.fromCharCode(55296+(s>>10)),e[o++]=String.fromCharCode(56320+(s&1023))}else{var i=t[n++],a=t[n++];e[o++]=String.fromCharCode((r&15)<<12|(i&63)<<6|a&63)}}return e.join("")},u2e={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,o=[],r=0;r>2,d=(i&3)<<4|l>>4,f=(l&15)<<2|c>>6,p=c&63;s||(p=64,a||(f=64)),o.push(n[u],n[d],n[f],n[p])}return o.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(yZe(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):lUn(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,o=[],r=0;r>4;if(o.push(f),c!==64){var p=l<<4&240|c>>2;if(o.push(p),d!==64){var g=c<<6&192|d;o.push(g)}}}return o},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},AZe=function(t){var e=yZe(t);return u2e.encodeByteArray(e,!0)},oPe=function(t){return AZe(t).replace(/\./g,"")},rPe=function(t){try{return u2e.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** * @license * Copyright 2017 Google LLC * @@ -4986,7 +4986,7 @@ Length provided: ${this.length}. Number of dictionaries provided: ${this.diction * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function u2e(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var n={alg:"none",type:"JWT"},o=e||"demo-project",r=t.iat||0,i=t.sub||t.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");var a=U0({iss:"https://securetoken.google.com/"+o,aud:o,iat:r,exp:r+3600,auth_time:r,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},t),l="";return[nPe(JSON.stringify(n)),nPe(JSON.stringify(a)),l].join(".")}/** + */function d2e(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var n={alg:"none",type:"JWT"},o=e||"demo-project",r=t.iat||0,i=t.sub||t.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");var a=U0({iss:"https://securetoken.google.com/"+o,aud:o,iat:r,exp:r+3600,auth_time:r,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},t),l="";return[oPe(JSON.stringify(n)),oPe(JSON.stringify(a)),l].join(".")}/** * @license * Copyright 2017 Google LLC * @@ -5001,7 +5001,7 @@ Length provided: ${this.length}. Number of dictionaries provided: ${this.diction * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Zx(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function d2e(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Zx())}function vZe(){try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function cUn(){return typeof self=="object"&&self.self===self}function uUn(){var t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function xZe(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function dUn(){return Zx().indexOf("Electron/")>=0}function fUn(){var t=Zx();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function hUn(){return Zx().indexOf("MSAppHost/")>=0}function bZe(){return mZe.NODE_ADMIN===!0}function pUn(){return!vZe()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}/** + */function Zx(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function f2e(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Zx())}function vZe(){try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function cUn(){return typeof self=="object"&&self.self===self}function uUn(){var t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function xZe(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function dUn(){return Zx().indexOf("Electron/")>=0}function fUn(){var t=Zx();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function hUn(){return Zx().indexOf("MSAppHost/")>=0}function bZe(){return mZe.NODE_ADMIN===!0}function pUn(){return!vZe()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}/** * @license * Copyright 2017 Google LLC * @@ -5016,7 +5016,7 @@ Length provided: ${this.length}. Number of dictionaries provided: ${this.diction * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var gUn="FirebaseError",SZe=function(t){Pr(e,t);function e(n,o,r){var i=t.call(this,o)||this;return i.code=n,i.customData=r,i.name=gUn,Object.setPrototypeOf(i,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,f2e.prototype.create),i}return e}(Error),f2e=function(){function t(e,n,o){this.service=e,this.serviceName=n,this.errors=o}return t.prototype.create=function(e){for(var n=[],o=1;o"})}var yUn=/\{\$([^}]+)}/g;/** + */var gUn="FirebaseError",SZe=function(t){Pr(e,t);function e(n,o,r){var i=t.call(this,o)||this;return i.code=n,i.customData=r,i.name=gUn,Object.setPrototypeOf(i,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,h2e.prototype.create),i}return e}(Error),h2e=function(){function t(e,n,o){this.service=e,this.serviceName=n,this.errors=o}return t.prototype.create=function(e){for(var n=[],o=1;o"})}var yUn=/\{\$([^}]+)}/g;/** * @license * Copyright 2017 Google LLC * @@ -5046,7 +5046,7 @@ Length provided: ${this.length}. Number of dictionaries provided: ${this.diction * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var TZe=function(t){var e={},n={},o={},r="";try{var i=t.split(".");e=yk(oPe(i[0])||""),n=yk(oPe(i[1])||""),r=i[2],o=n.d||{},delete n.d}catch{}return{header:e,claims:n,data:o,signature:r}},AUn=function(t){var e=TZe(t),n=e.claims;return!!n&&typeof n=="object"&&n.hasOwnProperty("iat")},wUn=function(t){var e=TZe(t).claims;return typeof e=="object"&&e.admin===!0};/** + */var TZe=function(t){var e={},n={},o={},r="";try{var i=t.split(".");e=yk(rPe(i[0])||""),n=yk(rPe(i[1])||""),r=i[2],o=n.d||{},delete n.d}catch{}return{header:e,claims:n,data:o,signature:r}},AUn=function(t){var e=TZe(t),n=e.claims;return!!n&&typeof n=="object"&&n.hasOwnProperty("iat")},wUn=function(t){var e=TZe(t).claims;return typeof e=="object"&&e.admin===!0};/** * @license * Copyright 2017 Google LLC * @@ -5061,7 +5061,7 @@ Length provided: ${this.length}. Number of dictionaries provided: ${this.diction * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Eg(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function eb(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]}function Tde(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function AX(t,e,n){var o={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(o[r]=e.call(n,t[r],r,t));return o}/** + */function Eg(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function eb(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]}function Tde(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function wX(t,e,n){var o={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(o[r]=e.call(n,t[r],r,t));return o}/** * @license * Copyright 2017 Google LLC * @@ -5106,7 +5106,7 @@ Length provided: ${this.length}. Number of dictionaries provided: ${this.diction * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var Di=function(t,e,n,o){var r;if(on&&(r=n===0?"none":"no more than "+n),r){var i=t+" failed: Was called with "+o+(o===1?" argument.":" arguments.")+" Expects "+r+".";throw new Error(i)}};function Qp(t,e){return t+" failed: "+e+" argument "}function xd(t,e,n,o){if(!(o&&!n)&&typeof n!="function")throw new Error(Qp(t,e)+"must be a valid function.")}function rPe(t,e,n,o){if(n&&(typeof n!="object"||n===null))throw new Error(Qp(t,e)+"must be a valid context object.")}/** + */var Di=function(t,e,n,o){var r;if(on&&(r=n===0?"none":"no more than "+n),r){var i=t+" failed: Was called with "+o+(o===1?" argument.":" arguments.")+" Expects "+r+".";throw new Error(i)}};function Qp(t,e){return t+" failed: "+e+" argument "}function xd(t,e,n,o){if(!(o&&!n)&&typeof n!="function")throw new Error(Qp(t,e)+"must be a valid function.")}function iPe(t,e,n,o){if(n&&(typeof n!="object"||n===null))throw new Error(Qp(t,e)+"must be a valid context object.")}/** * @license * Copyright 2017 Google LLC * @@ -5209,7 +5209,7 @@ and limitations under the License. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var $7,h2e=[],Rl;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(Rl||(Rl={}));var RZe={debug:Rl.DEBUG,verbose:Rl.VERBOSE,info:Rl.INFO,warn:Rl.WARN,error:Rl.ERROR,silent:Rl.SILENT},HUn=Rl.INFO,MUn=($7={},$7[Rl.DEBUG]="log",$7[Rl.VERBOSE]="log",$7[Rl.INFO]="info",$7[Rl.WARN]="warn",$7[Rl.ERROR]="error",$7),IUn=function(t,e){for(var n=[],o=2;o=(l??s.logLevel)&&t({level:Rl[c].toLowerCase(),message:f,args:u,type:s.name})}},o=0,r=h2e;o=(l??s.logLevel)&&t({level:Rl[c].toLowerCase(),message:f,args:u,type:s.name})}},o=0,r=p2e;o=0&&zR.warn(` + `);var aPe=self.firebase.SDK_VERSION;aPe&&aPe.indexOf("LITE")>=0&&zR.warn(` Warning: You are trying to load Firebase while using Firebase Performance standalone script. You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code. - `)}var ZUn=g2e.initializeApp;g2e.initializeApp=function(){for(var t=[],e=0;e=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var njn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Yr,m2e=m2e||{},na=njn||self;function vX(){}function Cde(t){var e=typeof t;return e=e!="object"?e:t?Array.isArray(t)?"array":e:"null",e=="array"||e=="object"&&typeof t.length=="number"}function uZ(t){var e=typeof t;return e=="object"&&t!=null||e=="function"}function ojn(t){return Object.prototype.hasOwnProperty.call(t,cae)&&t[cae]||(t[cae]=++rjn)}var cae="closure_uid_"+(1e9*Math.random()>>>0),rjn=0;function ijn(t,e,n){return t.call.apply(t.bind,arguments)}function ajn(t,e,n){if(!t)throw Error();if(2e?null:typeof t=="string"?t.charAt(e):t[e]}function aPe(t){return Array.prototype.concat.apply([],arguments)}function y2e(t){var e=t.length;if(0e?1:0}var Zh;e:{var sPe=na.navigator;if(sPe){var cPe=sPe.userAgent;if(cPe){Zh=cPe;break e}}Zh=""}function A2e(t,e,n){for(var o in t)e.call(n,t[o],o,t)}function FZe(t){var e={};for(var n in t)e[n]=t[n];return e}var uPe="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function kZe(t,e){for(var n,o,r=1;rparseFloat(dae)){bX=String(hae);break e}}bX=dae}var fjn={};function hjn(){return cjn(function(){for(var t=0,e=lPe(String(bX)).split("."),n=lPe("9").split("."),o=Math.max(e.length,n.length),r=0;t==0&&r>>0);function YZe(t){return typeof t=="function"?t:(t[gae]||(t[gae]=function(e){return t.handleEvent(e)}),t[gae])}function Hd(){Bw.call(this),this.i=new hZ(this),this.P=this,this.I=null}If(Hd,Bw);Hd.prototype[dZ]=!0;Hd.prototype.removeEventListener=function(t,e,n,o){jZe(this,t,e,n,o)};function wf(t,e){var n,o=t.I;if(o)for(n=[];o;o=o.I)n.push(o);if(t=t.P,o=e.type||e,typeof e=="string")e=new gh(e,t);else if(e instanceof gh)e.target=e.target||t;else{var r=e;e=new gh(o,t),kZe(e,r)}if(r=!0,n)for(var i=n.length-1;0<=i;i--){var a=e.g=n[i];r=SO(a,o,!0,e)&&r}if(a=e.g=t,r=SO(a,o,!0,e)&&r,r=SO(a,o,!1,e)&&r,n)for(i=0;ie.h&&(e.h++,t.next=e.g,e.g=t)}Dde=!1}function pZ(t,e){Hd.call(this),this.h=t||1,this.g=e||na,this.j=Af(this.kb,this),this.l=Date.now()}If(pZ,Hd);Yr=pZ.prototype;Yr.da=!1;Yr.S=null;Yr.kb=function(){if(this.da){var t=Date.now()-this.l;0=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var njn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Yr,y2e=y2e||{},na=njn||self;function xX(){}function Cde(t){var e=typeof t;return e=e!="object"?e:t?Array.isArray(t)?"array":e:"null",e=="array"||e=="object"&&typeof t.length=="number"}function uZ(t){var e=typeof t;return e=="object"&&t!=null||e=="function"}function ojn(t){return Object.prototype.hasOwnProperty.call(t,cae)&&t[cae]||(t[cae]=++rjn)}var cae="closure_uid_"+(1e9*Math.random()>>>0),rjn=0;function ijn(t,e,n){return t.call.apply(t.bind,arguments)}function ajn(t,e,n){if(!t)throw Error();if(2e?null:typeof t=="string"?t.charAt(e):t[e]}function lPe(t){return Array.prototype.concat.apply([],arguments)}function A2e(t){var e=t.length;if(0e?1:0}var Zh;e:{var cPe=na.navigator;if(cPe){var uPe=cPe.userAgent;if(uPe){Zh=uPe;break e}}Zh=""}function w2e(t,e,n){for(var o in t)e.call(n,t[o],o,t)}function FZe(t){var e={};for(var n in t)e[n]=t[n];return e}var dPe="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function kZe(t,e){for(var n,o,r=1;rparseFloat(dae)){SX=String(hae);break e}}SX=dae}var fjn={};function hjn(){return cjn(function(){for(var t=0,e=sPe(String(SX)).split("."),n=sPe("9").split("."),o=Math.max(e.length,n.length),r=0;t==0&&r>>0);function YZe(t){return typeof t=="function"?t:(t[gae]||(t[gae]=function(e){return t.handleEvent(e)}),t[gae])}function Hd(){Bw.call(this),this.i=new hZ(this),this.P=this,this.I=null}If(Hd,Bw);Hd.prototype[dZ]=!0;Hd.prototype.removeEventListener=function(t,e,n,o){jZe(this,t,e,n,o)};function wf(t,e){var n,o=t.I;if(o)for(n=[];o;o=o.I)n.push(o);if(t=t.P,o=e.type||e,typeof e=="string")e=new gh(e,t);else if(e instanceof gh)e.target=e.target||t;else{var r=e;e=new gh(o,t),kZe(e,r)}if(r=!0,n)for(var i=n.length-1;0<=i;i--){var a=e.g=n[i];r=TO(a,o,!0,e)&&r}if(a=e.g=t,r=TO(a,o,!0,e)&&r,r=TO(a,o,!1,e)&&r,n)for(i=0;ie.h&&(e.h++,t.next=e.g,e.g=t)}Dde=!1}function pZ(t,e){Hd.call(this),this.h=t||1,this.g=e||na,this.j=Af(this.kb,this),this.l=Date.now()}If(pZ,Hd);Yr=pZ.prototype;Yr.da=!1;Yr.S=null;Yr.kb=function(){if(this.da){var t=Date.now()-this.l;0o.length)){var r=o[1];if(Array.isArray(r)&&!(1>r.length)){var i=r[0];if(i!="noop"&&i!="stop"&&i!="close")for(var a=1;ae)&&(e!=3||Rde||this.g&&(this.h.h||this.g.ga()||APe(this.g)))){this.I||e!=4||n==7||(n==8||0>=o?vk(3):vk(2)),wZ(this);var r=this.g.ba();this.N=r;t:if(tet(this)){var i=APe(this.g);t="";var a=i.length,l=T6(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){Vv(this),zE(this);var s="";break t}this.h.i=new na.TextDecoder}for(n=0;ne.length?SX:(e=e.substr(o,n),t.C=o+n,e)))}Yr.cancel=function(){this.I=!0,Vv(this)};function MN(t){t.Y=Date.now()+t.P,oet(t,t.P)}function oet(t,e){if(t.B!=null)throw Error("WatchDog timer not null");t.B=CN(Af(t.eb,t),e)}function wZ(t){t.B&&(na.clearTimeout(t.B),t.B=null)}Yr.eb=function(){this.B=null;var t=Date.now();0<=t-this.Y?(zjn(this.j,this.A),this.K!=2&&(vk(),ip(17)),Vv(this),this.o=2,zE(this)):oet(this,this.Y-t)};function zE(t){t.l.G==0||t.I||Pet(t.l,t)}function Vv(t){wZ(t);var e=t.L;e&&typeof e.na=="function"&&e.na(),t.L=null,P2e(t.W),XZe(t.V),t.g&&(e=t.g,t.g=null,e.abort(),e.na())}function Lde(t,e){try{var n=t.l;if(n.G!=0&&(n.g==t||Wde(n.i,t))){if(n.I=t.N,!t.J&&Wde(n.i,t)&&n.G==3){try{var o=n.Ca.g.parse(e)}catch{o=null}if(Array.isArray(o)&&o.length==3){var r=o;if(r[0]==0){e:if(!n.u){if(n.g)if(n.g.F+3e3r[2]&&n.N&&n.A==0&&!n.v&&(n.v=CN(Af(n.ab,n),6e3));if(1>=det(n.i)&&n.ka){try{n.ka()}catch{}n.ka=void 0}}else Gv(n,11)}else if((t.J||n.g==t)&&RX(n),!xX(e))for(r=n.Ca.g.parse(e),e=0;ee)throw Error("Bad port number "+e);t.m=e}else t.m=null}function gPe(t,e,n){e instanceof xk?(t.h=e,_jn(t.h,t.g)):(n||(e=UD(e,Yjn)),t.h=new xk(e,t.g))}function Bc(t,e,n){t.h.set(e,n)}function vZ(t){return Bc(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function Wjn(t){return t instanceof nb?iA(t):new nb(t,void 0)}function Njn(t,e,n,o){var r=new nb(null,void 0);return t&&TX(r,t),e&&PX(r,e),n&&CX(r,n),o&&(r.l=o),r}function DE(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function UD(t,e,n){return typeof t=="string"?(t=encodeURI(t).replace(e,Ujn),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function Ujn(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(t&15).toString(16)}var mPe=/[#\/\?@]/g,jjn=/[#\?:]/g,Bjn=/[#\?]/g,Yjn=/[#\?@]/g,Ojn=/#/g;function xk(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function Yw(t){t.g||(t.g=new nM,t.h=0,t.i&&Ljn(t.i,function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)}))}Yr=xk.prototype;Yr.add=function(t,e){Yw(this),this.i=null,t=oM(this,t);var n=this.g.get(t);return n||this.g.set(t,n=[]),n.push(e),this.h+=1,this};function iet(t,e){Yw(t),e=oM(t,e),tb(t.g.h,e)&&(t.i=null,t.h-=t.g.get(e).length,t=t.g,tb(t.h,e)&&(delete t.h[e],t.i--,t.g.length>2*t.i&&z2e(t)))}function aet(t,e){return Yw(t),e=oM(t,e),tb(t.g.h,e)}Yr.forEach=function(t,e){Yw(this),this.g.forEach(function(n,o){EZe(n,function(r){t.call(e,r,o,this)},this)},this)};Yr.T=function(){Yw(this);for(var t=this.g.R(),e=this.g.T(),n=[],o=0;o=t.j:!1}function det(t){return t.h?1:t.g?t.g.size:0}function Wde(t,e){return t.h?t.h==e:t.g?t.g.has(e):!1}function D2e(t,e){t.g?t.g.add(e):t.h=e}function fet(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}cet.prototype.cancel=function(){var t,e;if(this.i=het(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){try{for(var n=zZe(this.g.values()),o=n.next();!o.done;o=n.next()){var r=o.value;r.cancel()}}catch(i){t={error:i}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.g.clear()}};function het(t){var e,n;if(t.h!=null)return t.i.concat(t.h.D);if(t.g!=null&&t.g.size!==0){var o=t.i;try{for(var r=zZe(t.g.values()),i=r.next();!i.done;i=r.next()){var a=i.value;o=o.concat(a.D)}}catch(l){e={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return o}return y2e(t.i)}function E2e(){}E2e.prototype.stringify=function(t){return na.JSON.stringify(t,void 0)};E2e.prototype.parse=function(t){return na.JSON.parse(t,void 0)};function Xjn(){this.g=new E2e}function Jjn(t,e,n){var o=n||"";try{I2e(t,function(r,i){var a=r;uZ(r)&&(a=S2e(r)),e.push(o+i+"="+encodeURIComponent(a))})}catch(r){throw e.push(o+"type="+encodeURIComponent("_badmap")),r}}function Kjn(t,e){var n=new gZ;if(na.Image){var o=new Image;o.onload=bO(TO,n,o,"TestLoadImage: loaded",!0,e),o.onerror=bO(TO,n,o,"TestLoadImage: error",!1,e),o.onabort=bO(TO,n,o,"TestLoadImage: abort",!1,e),o.ontimeout=bO(TO,n,o,"TestLoadImage: timeout",!1,e),na.setTimeout(function(){o.ontimeout&&o.ontimeout()},1e4),o.src=t}else e(!1)}function TO(t,e,n,o,r){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,r(o)}catch{}}function IN(t){this.l=t.$b||null,this.j=t.ib||!1}If(IN,R2e);IN.prototype.g=function(){return new xZ(this.l,this.j)};IN.prototype.i=function(t){return function(){return t}}({});function xZ(t,e){Hd.call(this),this.D=t,this.u=e,this.m=void 0,this.readyState=F2e,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}If(xZ,Hd);var F2e=0;Yr=xZ.prototype;Yr.open=function(t,e){if(this.readyState!=F2e)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=e,this.readyState=1,bk(this)};Yr.send=function(t){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;var e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(e.body=t),(this.D||na).fetch(new Request(this.B,e)).then(this.Va.bind(this),this.ha.bind(this))};Yr.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted."),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,zN(this)),this.readyState=F2e};Yr.Va=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,bk(this)),this.g&&(this.readyState=3,bk(this),this.g)))if(this.responseType==="arraybuffer")t.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(typeof na.ReadableStream<"u"&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;pet(this)}else t.text().then(this.Ua.bind(this),this.ha.bind(this))};function pet(t){t.j.read().then(t.Sa.bind(t)).catch(t.ha.bind(t))}Yr.Sa=function(t){if(this.g){if(this.u&&t.value)this.response.push(t.value);else if(!this.u){var e=t.value?t.value:new Uint8Array(0);(e=this.A.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)}t.done?zN(this):bk(this),this.readyState==3&&pet(this)}};Yr.Ua=function(t){this.g&&(this.response=this.responseText=t,zN(this))};Yr.Ta=function(t){this.g&&(this.response=t,zN(this))};Yr.ha=function(){this.g&&zN(this)};function zN(t){t.readyState=4,t.l=null,t.j=null,t.A=null,bk(t)}Yr.setRequestHeader=function(t,e){this.v.append(t,e)};Yr.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""};Yr.getAllResponseHeaders=function(){if(!this.h)return"";for(var t=[],e=this.h.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join(`\r -`)};function bk(t){t.onreadystatechange&&t.onreadystatechange.call(t)}Object.defineProperty(xZ.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(t){this.m=t?"include":"same-origin"}});var qjn=na.JSON.parse;function hu(t){Hd.call(this),this.headers=new nM,this.u=t||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=get,this.K=this.L=!1}If(hu,Hd);var get="",$jn=/^https?$/i,Qjn=["POST","PUT"];Yr=hu.prototype;Yr.ea=function(t,e,n,o){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.H+"; newUri="+t);e=e?e.toUpperCase():"GET",this.H=t,this.j="",this.m=0,this.D=!1,this.h=!0,this.g=this.u?this.u.g():Ede.g(),this.C=this.u?pPe(this.u):pPe(Ede),this.g.onreadystatechange=Af(this.Fa,this);try{this.F=!0,this.g.open(e,String(t),!0),this.F=!1}catch(i){yPe(this,i);return}t=n||"";var r=new nM(this.headers);o&&I2e(o,function(i,a){r.set(a,i)}),o=sjn(r.T()),n=na.FormData&&t instanceof na.FormData,!(0<=DZe(Qjn,e))||o||n||r.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),r.forEach(function(i,a){this.g.setRequestHeader(a,i)},this),this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Aet(this),0=t.i.j-(t.m?1:0)?!1:t.m?(t.l=e.D.concat(t.l),!0):t.G==1||t.G==2||t.C>=(t.Xa?0:t.Ya)?!1:(t.m=CN(Af(t.Ha,t,e),Cet(t,t.C)),t.C++,!0)}Yr.Ha=function(t){if(this.m)if(this.m=null,this.G==1){if(!t){this.V=Math.floor(1e5*Math.random()),t=this.V++;var e=new HN(this,this.h,t,void 0),n=this.s;if(this.P&&(n?(n=FZe(n),kZe(n,this.P)):n=this.P),this.o===null&&(e.H=n),this.ja)e:{for(var o=0,r=0;rc)i=Math.max(0,r[s].h-100),l=!1;else try{Jjn(u,a,"req"+c+"_")}catch{o&&o(u)}}if(l){o=a.join("&");break e}}return t=t.l.splice(0,n),e.D=t,o}function bet(t){t.g||t.u||(t.Y=1,T2e(t.Ga,t),t.A=0)}function W2e(t){return t.g||t.u||3<=t.A?!1:(t.Y++,t.u=CN(Af(t.Ga,t),Cet(t,t.A)),t.A++,!0)}Yr.Ga=function(){if(this.u=null,Tet(this),this.$&&!(this.L||this.g==null||0>=this.O)){var t=2*this.O;this.h.info("BP detection timer enabled: "+t),this.B=CN(Af(this.bb,this),t)}};Yr.bb=function(){this.B&&(this.B=null,this.h.info("BP detection timeout reached."),this.h.info("Buffering proxy detected and switch to long-polling!"),this.N=!1,this.L=!0,ip(10),SZ(this),Tet(this))};function N2e(t){t.B!=null&&(na.clearTimeout(t.B),t.B=null)}function Tet(t){t.g=new HN(t,t.h,"rpc",t.Y),t.o===null&&(t.g.H=t.s),t.g.O=0;var e=iA(t.oa);Bc(e,"RID","rpc"),Bc(e,"SID",t.J),Bc(e,"CI",t.N?"0":"1"),Bc(e,"AID",t.U),DN(t,e),Bc(e,"TYPE","xmlhttp"),t.o&&t.s&&k2e(e,t.o,t.s),t.K&&t.g.setTimeout(t.K);var n=t.g;t=t.la,n.K=1,n.v=vZ(iA(e)),n.s=null,n.U=!0,eet(n,t)}Yr.ab=function(){this.v!=null&&(this.v=null,SZ(this),W2e(this),ip(19))};function RX(t){t.v!=null&&(na.clearTimeout(t.v),t.v=null)}function Pet(t,e){var n=null;if(t.g==e){RX(t),N2e(t),t.g=null;var o=2}else if(Wde(t.i,e))n=e.D,fet(t.i,e),o=1;else return;if(t.I=e.N,t.G!=0){if(e.i)if(o==1){n=e.s?e.s.length:0,e=Date.now()-e.F;var r=t.C;o=mZ(),wf(o,new qZe(o,n)),TZ(t)}else bet(t);else if(r=e.o,r==3||r==0&&0o.length)){var r=o[1];if(Array.isArray(r)&&!(1>r.length)){var i=r[0];if(i!="noop"&&i!="stop"&&i!="close")for(var a=1;ae)&&(e!=3||Rde||this.g&&(this.h.h||this.g.ga()||wPe(this.g)))){this.I||e!=4||n==7||(n==8||0>=o?vk(3):vk(2)),wZ(this);var r=this.g.ba();this.N=r;t:if(tet(this)){var i=wPe(this.g);t="";var a=i.length,l=T6(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){Vv(this),zE(this);var s="";break t}this.h.i=new na.TextDecoder}for(n=0;ne.length?TX:(e=e.substr(o,n),t.C=o+n,e)))}Yr.cancel=function(){this.I=!0,Vv(this)};function IN(t){t.Y=Date.now()+t.P,oet(t,t.P)}function oet(t,e){if(t.B!=null)throw Error("WatchDog timer not null");t.B=RN(Af(t.eb,t),e)}function wZ(t){t.B&&(na.clearTimeout(t.B),t.B=null)}Yr.eb=function(){this.B=null;var t=Date.now();0<=t-this.Y?(zjn(this.j,this.A),this.K!=2&&(vk(),ip(17)),Vv(this),this.o=2,zE(this)):oet(this,this.Y-t)};function zE(t){t.l.G==0||t.I||Pet(t.l,t)}function Vv(t){wZ(t);var e=t.L;e&&typeof e.na=="function"&&e.na(),t.L=null,C2e(t.W),XZe(t.V),t.g&&(e=t.g,t.g=null,e.abort(),e.na())}function Lde(t,e){try{var n=t.l;if(n.G!=0&&(n.g==t||Wde(n.i,t))){if(n.I=t.N,!t.J&&Wde(n.i,t)&&n.G==3){try{var o=n.Ca.g.parse(e)}catch{o=null}if(Array.isArray(o)&&o.length==3){var r=o;if(r[0]==0){e:if(!n.u){if(n.g)if(n.g.F+3e3r[2]&&n.N&&n.A==0&&!n.v&&(n.v=RN(Af(n.ab,n),6e3));if(1>=det(n.i)&&n.ka){try{n.ka()}catch{}n.ka=void 0}}else Gv(n,11)}else if((t.J||n.g==t)&&HX(n),!bX(e))for(r=n.Ca.g.parse(e),e=0;ee)throw Error("Bad port number "+e);t.m=e}else t.m=null}function mPe(t,e,n){e instanceof xk?(t.h=e,_jn(t.h,t.g)):(n||(e=UD(e,Yjn)),t.h=new xk(e,t.g))}function Bc(t,e,n){t.h.set(e,n)}function vZ(t){return Bc(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function Wjn(t){return t instanceof nb?iA(t):new nb(t,void 0)}function Njn(t,e,n,o){var r=new nb(null,void 0);return t&&PX(r,t),e&&CX(r,e),n&&RX(r,n),o&&(r.l=o),r}function DE(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function UD(t,e,n){return typeof t=="string"?(t=encodeURI(t).replace(e,Ujn),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function Ujn(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(t&15).toString(16)}var yPe=/[#\/\?@]/g,jjn=/[#\?:]/g,Bjn=/[#\?]/g,Yjn=/[#\?@]/g,Ojn=/#/g;function xk(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function Yw(t){t.g||(t.g=new nM,t.h=0,t.i&&Ljn(t.i,function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)}))}Yr=xk.prototype;Yr.add=function(t,e){Yw(this),this.i=null,t=oM(this,t);var n=this.g.get(t);return n||this.g.set(t,n=[]),n.push(e),this.h+=1,this};function iet(t,e){Yw(t),e=oM(t,e),tb(t.g.h,e)&&(t.i=null,t.h-=t.g.get(e).length,t=t.g,tb(t.h,e)&&(delete t.h[e],t.i--,t.g.length>2*t.i&&D2e(t)))}function aet(t,e){return Yw(t),e=oM(t,e),tb(t.g.h,e)}Yr.forEach=function(t,e){Yw(this),this.g.forEach(function(n,o){EZe(n,function(r){t.call(e,r,o,this)},this)},this)};Yr.T=function(){Yw(this);for(var t=this.g.R(),e=this.g.T(),n=[],o=0;o=t.j:!1}function det(t){return t.h?1:t.g?t.g.size:0}function Wde(t,e){return t.h?t.h==e:t.g?t.g.has(e):!1}function E2e(t,e){t.g?t.g.add(e):t.h=e}function fet(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}cet.prototype.cancel=function(){var t,e;if(this.i=het(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){try{for(var n=zZe(this.g.values()),o=n.next();!o.done;o=n.next()){var r=o.value;r.cancel()}}catch(i){t={error:i}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.g.clear()}};function het(t){var e,n;if(t.h!=null)return t.i.concat(t.h.D);if(t.g!=null&&t.g.size!==0){var o=t.i;try{for(var r=zZe(t.g.values()),i=r.next();!i.done;i=r.next()){var a=i.value;o=o.concat(a.D)}}catch(l){e={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return o}return A2e(t.i)}function F2e(){}F2e.prototype.stringify=function(t){return na.JSON.stringify(t,void 0)};F2e.prototype.parse=function(t){return na.JSON.parse(t,void 0)};function Xjn(){this.g=new F2e}function Jjn(t,e,n){var o=n||"";try{z2e(t,function(r,i){var a=r;uZ(r)&&(a=T2e(r)),e.push(o+i+"="+encodeURIComponent(a))})}catch(r){throw e.push(o+"type="+encodeURIComponent("_badmap")),r}}function Kjn(t,e){var n=new gZ;if(na.Image){var o=new Image;o.onload=SO(PO,n,o,"TestLoadImage: loaded",!0,e),o.onerror=SO(PO,n,o,"TestLoadImage: error",!1,e),o.onabort=SO(PO,n,o,"TestLoadImage: abort",!1,e),o.ontimeout=SO(PO,n,o,"TestLoadImage: timeout",!1,e),na.setTimeout(function(){o.ontimeout&&o.ontimeout()},1e4),o.src=t}else e(!1)}function PO(t,e,n,o,r){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,r(o)}catch{}}function zN(t){this.l=t.$b||null,this.j=t.ib||!1}If(zN,H2e);zN.prototype.g=function(){return new xZ(this.l,this.j)};zN.prototype.i=function(t){return function(){return t}}({});function xZ(t,e){Hd.call(this),this.D=t,this.u=e,this.m=void 0,this.readyState=k2e,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}If(xZ,Hd);var k2e=0;Yr=xZ.prototype;Yr.open=function(t,e){if(this.readyState!=k2e)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=e,this.readyState=1,bk(this)};Yr.send=function(t){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;var e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(e.body=t),(this.D||na).fetch(new Request(this.B,e)).then(this.Va.bind(this),this.ha.bind(this))};Yr.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted."),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,DN(this)),this.readyState=k2e};Yr.Va=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,bk(this)),this.g&&(this.readyState=3,bk(this),this.g)))if(this.responseType==="arraybuffer")t.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(typeof na.ReadableStream<"u"&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;pet(this)}else t.text().then(this.Ua.bind(this),this.ha.bind(this))};function pet(t){t.j.read().then(t.Sa.bind(t)).catch(t.ha.bind(t))}Yr.Sa=function(t){if(this.g){if(this.u&&t.value)this.response.push(t.value);else if(!this.u){var e=t.value?t.value:new Uint8Array(0);(e=this.A.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)}t.done?DN(this):bk(this),this.readyState==3&&pet(this)}};Yr.Ua=function(t){this.g&&(this.response=this.responseText=t,DN(this))};Yr.Ta=function(t){this.g&&(this.response=t,DN(this))};Yr.ha=function(){this.g&&DN(this)};function DN(t){t.readyState=4,t.l=null,t.j=null,t.A=null,bk(t)}Yr.setRequestHeader=function(t,e){this.v.append(t,e)};Yr.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""};Yr.getAllResponseHeaders=function(){if(!this.h)return"";for(var t=[],e=this.h.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join(`\r +`)};function bk(t){t.onreadystatechange&&t.onreadystatechange.call(t)}Object.defineProperty(xZ.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(t){this.m=t?"include":"same-origin"}});var qjn=na.JSON.parse;function hu(t){Hd.call(this),this.headers=new nM,this.u=t||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=get,this.K=this.L=!1}If(hu,Hd);var get="",$jn=/^https?$/i,Qjn=["POST","PUT"];Yr=hu.prototype;Yr.ea=function(t,e,n,o){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.H+"; newUri="+t);e=e?e.toUpperCase():"GET",this.H=t,this.j="",this.m=0,this.D=!1,this.h=!0,this.g=this.u?this.u.g():Ede.g(),this.C=this.u?gPe(this.u):gPe(Ede),this.g.onreadystatechange=Af(this.Fa,this);try{this.F=!0,this.g.open(e,String(t),!0),this.F=!1}catch(i){APe(this,i);return}t=n||"";var r=new nM(this.headers);o&&z2e(o,function(i,a){r.set(a,i)}),o=sjn(r.T()),n=na.FormData&&t instanceof na.FormData,!(0<=DZe(Qjn,e))||o||n||r.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),r.forEach(function(i,a){this.g.setRequestHeader(a,i)},this),this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Aet(this),0=t.i.j-(t.m?1:0)?!1:t.m?(t.l=e.D.concat(t.l),!0):t.G==1||t.G==2||t.C>=(t.Xa?0:t.Ya)?!1:(t.m=RN(Af(t.Ha,t,e),Cet(t,t.C)),t.C++,!0)}Yr.Ha=function(t){if(this.m)if(this.m=null,this.G==1){if(!t){this.V=Math.floor(1e5*Math.random()),t=this.V++;var e=new MN(this,this.h,t,void 0),n=this.s;if(this.P&&(n?(n=FZe(n),kZe(n,this.P)):n=this.P),this.o===null&&(e.H=n),this.ja)e:{for(var o=0,r=0;rc)i=Math.max(0,r[s].h-100),l=!1;else try{Jjn(u,a,"req"+c+"_")}catch{o&&o(u)}}if(l){o=a.join("&");break e}}return t=t.l.splice(0,n),e.D=t,o}function bet(t){t.g||t.u||(t.Y=1,P2e(t.Ga,t),t.A=0)}function N2e(t){return t.g||t.u||3<=t.A?!1:(t.Y++,t.u=RN(Af(t.Ga,t),Cet(t,t.A)),t.A++,!0)}Yr.Ga=function(){if(this.u=null,Tet(this),this.$&&!(this.L||this.g==null||0>=this.O)){var t=2*this.O;this.h.info("BP detection timer enabled: "+t),this.B=RN(Af(this.bb,this),t)}};Yr.bb=function(){this.B&&(this.B=null,this.h.info("BP detection timeout reached."),this.h.info("Buffering proxy detected and switch to long-polling!"),this.N=!1,this.L=!0,ip(10),SZ(this),Tet(this))};function U2e(t){t.B!=null&&(na.clearTimeout(t.B),t.B=null)}function Tet(t){t.g=new MN(t,t.h,"rpc",t.Y),t.o===null&&(t.g.H=t.s),t.g.O=0;var e=iA(t.oa);Bc(e,"RID","rpc"),Bc(e,"SID",t.J),Bc(e,"CI",t.N?"0":"1"),Bc(e,"AID",t.U),EN(t,e),Bc(e,"TYPE","xmlhttp"),t.o&&t.s&&L2e(e,t.o,t.s),t.K&&t.g.setTimeout(t.K);var n=t.g;t=t.la,n.K=1,n.v=vZ(iA(e)),n.s=null,n.U=!0,eet(n,t)}Yr.ab=function(){this.v!=null&&(this.v=null,SZ(this),N2e(this),ip(19))};function HX(t){t.v!=null&&(na.clearTimeout(t.v),t.v=null)}function Pet(t,e){var n=null;if(t.g==e){HX(t),U2e(t),t.g=null;var o=2}else if(Wde(t.i,e))n=e.D,fet(t.i,e),o=1;else return;if(t.I=e.N,t.G!=0){if(e.i)if(o==1){n=e.s?e.s.length:0,e=Date.now()-e.F;var r=t.C;o=mZ(),wf(o,new qZe(o,n)),TZ(t)}else bet(t);else if(r=e.o,r==3||r==0&&0=Number.MIN_SAFE_INTEGER}/** + */function Gb(t){return t==null}function zX(t){return t===0&&1/t==-1/0}function Net(t){return typeof t=="number"&&Number.isInteger(t)&&!zX(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}/** * @license * Copyright 2017 Google LLC * @@ -5592,7 +5592,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function ob(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?j2e(t)?4:10:ri()}function _9(t,e){var n=ob(t);if(n!==ob(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return Sk(t).isEqual(Sk(e));case 3:return function(o,r){if(typeof o.timestampValue=="string"&&typeof r.timestampValue=="string"&&o.timestampValue.length===r.timestampValue.length)return o.timestampValue===r.timestampValue;var i=pw(o.timestampValue),a=pw(r.timestampValue);return i.seconds===a.seconds&&i.nanos===a.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(o,r){return kR(o.bytesValue).isEqual(kR(r.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(o,r){return ou(o.geoPointValue.latitude)===ou(r.geoPointValue.latitude)&&ou(o.geoPointValue.longitude)===ou(r.geoPointValue.longitude)}(t,e);case 2:return function(o,r){if("integerValue"in o&&"integerValue"in r)return ou(o.integerValue)===ou(r.integerValue);if("doubleValue"in o&&"doubleValue"in r){var i=ou(o.doubleValue),a=ou(r.doubleValue);return i===a?IX(i)===IX(a):isNaN(i)&&isNaN(a)}return!1}(t,e);case 9:return ER(t.arrayValue.values||[],e.arrayValue.values||[],_9);case 10:return function(o,r){var i=o.mapValue.fields||{},a=r.mapValue.fields||{};if(xPe(i)!==xPe(a))return!1;for(var l in i)if(i.hasOwnProperty(l)&&(a[l]===void 0||!_9(i[l],a[l])))return!1;return!0}(t,e);default:return ri()}}function Tk(t,e){return(t.values||[]).find(function(n){return _9(n,e)})!==void 0}function LR(t,e){var n=ob(t),o=ob(e);if(n!==o)return $a(n,o);switch(n){case 0:return 0;case 1:return $a(t.booleanValue,e.booleanValue);case 2:return function(r,i){var a=ou(r.integerValue||r.doubleValue),l=ou(i.integerValue||i.doubleValue);return al?1:a===l?0:isNaN(a)?isNaN(l)?0:-1:1}(t,e);case 3:return bPe(t.timestampValue,e.timestampValue);case 4:return bPe(Sk(t),Sk(e));case 5:return $a(t.stringValue,e.stringValue);case 6:return function(r,i){var a=kR(r),l=kR(i);return a.compareTo(l)}(t.bytesValue,e.bytesValue);case 7:return function(r,i){for(var a=r.split("/"),l=i.split("/"),s=0;sl?1:a===l?0:isNaN(a)?isNaN(l)?0:-1:1}(t,e);case 3:return SPe(t.timestampValue,e.timestampValue);case 4:return SPe(Sk(t),Sk(e));case 5:return $a(t.stringValue,e.stringValue);case 6:return function(r,i){var a=kR(r),l=kR(i);return a.compareTo(l)}(t.bytesValue,e.bytesValue);case 7:return function(r,i){for(var a=r.split("/"),l=i.split("/"),s=0;s":return n>0;case">=":return n>=0;default:return ri()}},e.prototype.g=function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0},e}(function(){}),pBn=function(t){function e(n,o,r){var i=this;return(i=t.call(this,n,o,r)||this).key=ci.fromName(r.referenceValue),i}return Pr(e,t),e.prototype.matches=function(n){var o=ci.comparator(n.key,this.key);return this.m(o)},e}(vg),gBn=function(t){function e(n,o){var r=this;return(r=t.call(this,n,"in",o)||this).keys=jet("in",o),r}return Pr(e,t),e.prototype.matches=function(n){return this.keys.some(function(o){return o.isEqual(n.key)})},e}(vg),mBn=function(t){function e(n,o){var r=this;return(r=t.call(this,n,"not-in",o)||this).keys=jet("not-in",o),r}return Pr(e,t),e.prototype.matches=function(n){return!this.keys.some(function(o){return o.isEqual(n.key)})},e}(vg);function jet(t,e){var n;return(((n=e.arrayValue)===null||n===void 0?void 0:n.values)||[]).map(function(o){return ci.fromName(o.referenceValue)})}var yBn=function(t){function e(n,o){return t.call(this,n,"array-contains",o)||this}return Pr(e,t),e.prototype.matches=function(n){var o=n.data.field(this.field);return Y2e(o)&&Tk(o.arrayValue,this.value)},e}(vg),ABn=function(t){function e(n,o){return t.call(this,n,"in",o)||this}return Pr(e,t),e.prototype.matches=function(n){var o=n.data.field(this.field);return o!==null&&Tk(this.value.arrayValue,o)},e}(vg),wBn=function(t){function e(n,o){return t.call(this,n,"not-in",o)||this}return Pr(e,t),e.prototype.matches=function(n){if(Tk(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var o=n.data.field(this.field);return o!==null&&!Tk(this.value.arrayValue,o)},e}(vg),vBn=function(t){function e(n,o){return t.call(this,n,"array-contains-any",o)||this}return Pr(e,t),e.prototype.matches=function(n){var o=this,r=n.data.field(this.field);return!(!Y2e(r)||!r.arrayValue.values)&&r.arrayValue.values.some(function(i){return Tk(o.value.arrayValue,i)})},e}(vg),Pk=function(t,e){this.position=t,this.before=e};function EX(t){return(t.before?"b":"a")+":"+t.position.map(function(e){return B2e(e)}).join(",")}var FC=function(t,e){e===void 0&&(e="asc"),this.field=t,this.dir=e};function xBn(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}function CPe(t,e,n){for(var o=0,r=0;r":return n>0;case">=":return n>=0;default:return ri()}},e.prototype.g=function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0},e}(function(){}),pBn=function(t){function e(n,o,r){var i=this;return(i=t.call(this,n,o,r)||this).key=ci.fromName(r.referenceValue),i}return Pr(e,t),e.prototype.matches=function(n){var o=ci.comparator(n.key,this.key);return this.m(o)},e}(vg),gBn=function(t){function e(n,o){var r=this;return(r=t.call(this,n,"in",o)||this).keys=jet("in",o),r}return Pr(e,t),e.prototype.matches=function(n){return this.keys.some(function(o){return o.isEqual(n.key)})},e}(vg),mBn=function(t){function e(n,o){var r=this;return(r=t.call(this,n,"not-in",o)||this).keys=jet("not-in",o),r}return Pr(e,t),e.prototype.matches=function(n){return!this.keys.some(function(o){return o.isEqual(n.key)})},e}(vg);function jet(t,e){var n;return(((n=e.arrayValue)===null||n===void 0?void 0:n.values)||[]).map(function(o){return ci.fromName(o.referenceValue)})}var yBn=function(t){function e(n,o){return t.call(this,n,"array-contains",o)||this}return Pr(e,t),e.prototype.matches=function(n){var o=n.data.field(this.field);return O2e(o)&&Tk(o.arrayValue,this.value)},e}(vg),ABn=function(t){function e(n,o){return t.call(this,n,"in",o)||this}return Pr(e,t),e.prototype.matches=function(n){var o=n.data.field(this.field);return o!==null&&Tk(this.value.arrayValue,o)},e}(vg),wBn=function(t){function e(n,o){return t.call(this,n,"not-in",o)||this}return Pr(e,t),e.prototype.matches=function(n){if(Tk(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var o=n.data.field(this.field);return o!==null&&!Tk(this.value.arrayValue,o)},e}(vg),vBn=function(t){function e(n,o){return t.call(this,n,"array-contains-any",o)||this}return Pr(e,t),e.prototype.matches=function(n){var o=this,r=n.data.field(this.field);return!(!O2e(r)||!r.arrayValue.values)&&r.arrayValue.values.some(function(i){return Tk(o.value.arrayValue,i)})},e}(vg),Pk=function(t,e){this.position=t,this.before=e};function FX(t){return(t.before?"b":"a")+":"+t.position.map(function(e){return Y2e(e)}).join(",")}var FC=function(t,e){e===void 0&&(e="asc"),this.field=t,this.dir=e};function xBn(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}function RPe(t,e,n){for(var o=0,r=0;r0?t.explicitOrderBy[0].field:null}function _2e(t){for(var e=0,n=t.filters;e0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.p.push(new FC(X2.keyField(),s))}}}return e.p}function V9(t){var e=Ir(t);if(!e.T)if(e.limitType==="F")e.T=PPe(e.path,e.collectionGroup,WR(e),e.filters,e.limit,e.startAt,e.endAt);else{for(var n=[],o=0,r=WR(e);o0&&(n+=", orderBy: ["+e.orderBy.map(function(o){return function(r){return r.field.canonicalString()+" ("+r.dir+")"}(o)}).join(", ")+"]"),e.startAt&&(n+=", startAt: "+EX(e.startAt)),e.endAt&&(n+=", endAt: "+EX(e.endAt)),"Target("+n+")"}(V9(t))+"; limitType="+t.limitType+")"}function LN(t,e){return e.isFoundDocument()&&function(n,o){var r=o.key.path;return n.collectionGroup!==null?o.key.hasCollectionId(n.collectionGroup)&&n.path.isPrefixOf(r):ci.isDocumentKey(n.path)?n.path.isEqual(r):n.path.isImmediateParentOf(r)}(t,e)&&function(n,o){for(var r=0,i=n.explicitOrderBy;r0?t.explicitOrderBy[0].field:null}function V2e(t){for(var e=0,n=t.filters;e0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.p.push(new FC(X2.keyField(),s))}}}return e.p}function V9(t){var e=Ir(t);if(!e.T)if(e.limitType==="F")e.T=CPe(e.path,e.collectionGroup,WR(e),e.filters,e.limit,e.startAt,e.endAt);else{for(var n=[],o=0,r=WR(e);o0&&(n+=", orderBy: ["+e.orderBy.map(function(o){return function(r){return r.field.canonicalString()+" ("+r.dir+")"}(o)}).join(", ")+"]"),e.startAt&&(n+=", startAt: "+FX(e.startAt)),e.endAt&&(n+=", endAt: "+FX(e.endAt)),"Target("+n+")"}(V9(t))+"; limitType="+t.limitType+")"}function WN(t,e){return e.isFoundDocument()&&function(n,o){var r=o.key.path;return n.collectionGroup!==null?o.key.hasCollectionId(n.collectionGroup)&&n.path.isPrefixOf(r):ci.isDocumentKey(n.path)?n.path.isEqual(r):n.path.isImmediateParentOf(r)}(t,e)&&function(n,o){for(var r=0,i=n.explicitOrderBy;r0&&(n=n.right)}return null},t.prototype.indexOf=function(e){for(var n=0,o=this.root;!o.isEmpty();){var r=this.comparator(e,o.key);if(r===0)return n+o.left.size;r<0?o=o.left:(n+=o.left.size+1,o=o.right)}return-1},t.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(t.prototype,"size",{get:function(){return this.root.size},enumerable:!1,configurable:!0}),t.prototype.minKey=function(){return this.root.minKey()},t.prototype.maxKey=function(){return this.root.maxKey()},t.prototype.inorderTraversal=function(e){return this.root.inorderTraversal(e)},t.prototype.forEach=function(e){this.inorderTraversal(function(n,o){return e(n,o),!1})},t.prototype.toString=function(){var e=[];return this.inorderTraversal(function(n,o){return e.push(n+":"+o),!1}),"{"+e.join(", ")+"}"},t.prototype.reverseTraversal=function(e){return this.root.reverseTraversal(e)},t.prototype.getIterator=function(){return new CO(this.root,null,this.comparator,!1)},t.prototype.getIteratorFrom=function(e){return new CO(this.root,e,this.comparator,!1)},t.prototype.getReverseIterator=function(){return new CO(this.root,null,this.comparator,!0)},t.prototype.getReverseIteratorFrom=function(e){return new CO(this.root,e,this.comparator,!0)},t}(),CO=function(){function t(e,n,o,r){this.isReverse=r,this.nodeStack=[];for(var i=1;!e.isEmpty();)if(i=n?o(e.key,n):1,r&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(i===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}return t.prototype.getNext=function(){var e=this.nodeStack.pop(),n={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return n},t.prototype.hasNext=function(){return this.nodeStack.length>0},t.prototype.peek=function(){if(this.nodeStack.length===0)return null;var e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}},t}(),i8=function(){function t(e,n,o,r,i){this.key=e,this.value=n,this.color=o??t.RED,this.left=r??t.EMPTY,this.right=i??t.EMPTY,this.size=this.left.size+1+this.right.size}return t.prototype.copy=function(e,n,o,r,i){return new t(e??this.key,n??this.value,o??this.color,r??this.left,i??this.right)},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)},t.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},t.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},t.prototype.minKey=function(){return this.min().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(e,n,o){var r=this,i=o(e,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(e,n,o),null):i===0?r.copy(null,n,null,null,null):r.copy(null,null,null,null,r.right.insert(e,n,o))).fixUp()},t.prototype.removeMin=function(){if(this.left.isEmpty())return t.EMPTY;var e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),(e=e.copy(null,null,null,e.left.removeMin(),null)).fixUp()},t.prototype.remove=function(e,n){var o,r=this;if(n(e,r.key)<0)r.left.isEmpty()||r.left.isRed()||r.left.left.isRed()||(r=r.moveRedLeft()),r=r.copy(null,null,null,r.left.remove(e,n),null);else{if(r.left.isRed()&&(r=r.rotateRight()),r.right.isEmpty()||r.right.isRed()||r.right.left.isRed()||(r=r.moveRedRight()),n(e,r.key)===0){if(r.right.isEmpty())return t.EMPTY;o=r.right.min(),r=r.copy(o.key,o.value,null,null,r.right.removeMin())}r=r.copy(null,null,null,null,r.right.remove(e,n))}return r.fixUp()},t.prototype.isRed=function(){return this.color},t.prototype.fixUp=function(){var e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e},t.prototype.moveRedLeft=function(){var e=this.colorFlip();return e.right.left.isRed()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight())).rotateLeft()).colorFlip()),e},t.prototype.moveRedRight=function(){var e=this.colorFlip();return e.left.left.isRed()&&(e=(e=e.rotateRight()).colorFlip()),e},t.prototype.rotateLeft=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip=function(){var e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)},t.prototype.checkMaxDepth=function(){var e=this.check();return Math.pow(2,e)<=this.size+1},t.prototype.check=function(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw ri();var e=this.left.check();if(e!==this.right.check())throw ri();return e+(this.isRed()?0:1)},t}();i8.EMPTY=null,i8.RED=!0,i8.BLACK=!1,i8.EMPTY=new(function(){function t(){this.size=0}return Object.defineProperty(t.prototype,"key",{get:function(){throw ri()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){throw ri()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){throw ri()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){throw ri()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){throw ri()},enumerable:!1,configurable:!0}),t.prototype.copy=function(e,n,o,r,i){return this},t.prototype.insert=function(e,n,o){return new i8(e,n)},t.prototype.remove=function(e,n){return this},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(e){return!1},t.prototype.reverseTraversal=function(e){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.isRed=function(){return!1},t.prototype.checkMaxDepth=function(){return!0},t.prototype.check=function(){return 0},t}());/** + */var Th=function(){function t(e,n){this.comparator=e,this.root=n||i8.EMPTY}return t.prototype.insert=function(e,n){return new t(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,i8.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator,this.root.remove(e,this.comparator).copy(null,null,i8.BLACK,null,null))},t.prototype.get=function(e){for(var n=this.root;!n.isEmpty();){var o=this.comparator(e,n.key);if(o===0)return n.value;o<0?n=n.left:o>0&&(n=n.right)}return null},t.prototype.indexOf=function(e){for(var n=0,o=this.root;!o.isEmpty();){var r=this.comparator(e,o.key);if(r===0)return n+o.left.size;r<0?o=o.left:(n+=o.left.size+1,o=o.right)}return-1},t.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(t.prototype,"size",{get:function(){return this.root.size},enumerable:!1,configurable:!0}),t.prototype.minKey=function(){return this.root.minKey()},t.prototype.maxKey=function(){return this.root.maxKey()},t.prototype.inorderTraversal=function(e){return this.root.inorderTraversal(e)},t.prototype.forEach=function(e){this.inorderTraversal(function(n,o){return e(n,o),!1})},t.prototype.toString=function(){var e=[];return this.inorderTraversal(function(n,o){return e.push(n+":"+o),!1}),"{"+e.join(", ")+"}"},t.prototype.reverseTraversal=function(e){return this.root.reverseTraversal(e)},t.prototype.getIterator=function(){return new RO(this.root,null,this.comparator,!1)},t.prototype.getIteratorFrom=function(e){return new RO(this.root,e,this.comparator,!1)},t.prototype.getReverseIterator=function(){return new RO(this.root,null,this.comparator,!0)},t.prototype.getReverseIteratorFrom=function(e){return new RO(this.root,e,this.comparator,!0)},t}(),RO=function(){function t(e,n,o,r){this.isReverse=r,this.nodeStack=[];for(var i=1;!e.isEmpty();)if(i=n?o(e.key,n):1,r&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(i===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}return t.prototype.getNext=function(){var e=this.nodeStack.pop(),n={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return n},t.prototype.hasNext=function(){return this.nodeStack.length>0},t.prototype.peek=function(){if(this.nodeStack.length===0)return null;var e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}},t}(),i8=function(){function t(e,n,o,r,i){this.key=e,this.value=n,this.color=o??t.RED,this.left=r??t.EMPTY,this.right=i??t.EMPTY,this.size=this.left.size+1+this.right.size}return t.prototype.copy=function(e,n,o,r,i){return new t(e??this.key,n??this.value,o??this.color,r??this.left,i??this.right)},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)},t.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},t.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},t.prototype.minKey=function(){return this.min().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(e,n,o){var r=this,i=o(e,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(e,n,o),null):i===0?r.copy(null,n,null,null,null):r.copy(null,null,null,null,r.right.insert(e,n,o))).fixUp()},t.prototype.removeMin=function(){if(this.left.isEmpty())return t.EMPTY;var e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),(e=e.copy(null,null,null,e.left.removeMin(),null)).fixUp()},t.prototype.remove=function(e,n){var o,r=this;if(n(e,r.key)<0)r.left.isEmpty()||r.left.isRed()||r.left.left.isRed()||(r=r.moveRedLeft()),r=r.copy(null,null,null,r.left.remove(e,n),null);else{if(r.left.isRed()&&(r=r.rotateRight()),r.right.isEmpty()||r.right.isRed()||r.right.left.isRed()||(r=r.moveRedRight()),n(e,r.key)===0){if(r.right.isEmpty())return t.EMPTY;o=r.right.min(),r=r.copy(o.key,o.value,null,null,r.right.removeMin())}r=r.copy(null,null,null,null,r.right.remove(e,n))}return r.fixUp()},t.prototype.isRed=function(){return this.color},t.prototype.fixUp=function(){var e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e},t.prototype.moveRedLeft=function(){var e=this.colorFlip();return e.right.left.isRed()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight())).rotateLeft()).colorFlip()),e},t.prototype.moveRedRight=function(){var e=this.colorFlip();return e.left.left.isRed()&&(e=(e=e.rotateRight()).colorFlip()),e},t.prototype.rotateLeft=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip=function(){var e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)},t.prototype.checkMaxDepth=function(){var e=this.check();return Math.pow(2,e)<=this.size+1},t.prototype.check=function(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw ri();var e=this.left.check();if(e!==this.right.check())throw ri();return e+(this.isRed()?0:1)},t}();i8.EMPTY=null,i8.RED=!0,i8.BLACK=!1,i8.EMPTY=new(function(){function t(){this.size=0}return Object.defineProperty(t.prototype,"key",{get:function(){throw ri()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){throw ri()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){throw ri()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){throw ri()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){throw ri()},enumerable:!1,configurable:!0}),t.prototype.copy=function(e,n,o,r,i){return this},t.prototype.insert=function(e,n,o){return new i8(e,n)},t.prototype.remove=function(e,n){return this},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(e){return!1},t.prototype.reverseTraversal=function(e){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.isRed=function(){return!1},t.prototype.checkMaxDepth=function(){return!0},t.prototype.check=function(){return 0},t}());/** * @license * Copyright 2017 Google LLC * @@ -5712,7 +5712,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var ju=function(){function t(e){this.comparator=e,this.data=new Th(this.comparator)}return t.prototype.has=function(e){return this.data.get(e)!==null},t.prototype.first=function(){return this.data.minKey()},t.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(t.prototype,"size",{get:function(){return this.data.size},enumerable:!1,configurable:!0}),t.prototype.indexOf=function(e){return this.data.indexOf(e)},t.prototype.forEach=function(e){this.data.inorderTraversal(function(n,o){return e(n),!1})},t.prototype.forEachInRange=function(e,n){for(var o=this.data.getIteratorFrom(e[0]);o.hasNext();){var r=o.getNext();if(this.comparator(r.key,e[1])>=0)return;n(r.key)}},t.prototype.forEachWhile=function(e,n){var o;for(o=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();o.hasNext();)if(!e(o.getNext().key))return},t.prototype.firstAfterOrEqual=function(e){var n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null},t.prototype.getIterator=function(){return new EPe(this.data.getIterator())},t.prototype.getIteratorFrom=function(e){return new EPe(this.data.getIteratorFrom(e))},t.prototype.add=function(e){return this.copy(this.data.remove(e).insert(e,!0))},t.prototype.delete=function(e){return this.has(e)?this.copy(this.data.remove(e)):this},t.prototype.isEmpty=function(){return this.data.isEmpty()},t.prototype.unionWith=function(e){var n=this;return n.size=0)return;n(r.key)}},t.prototype.forEachWhile=function(e,n){var o;for(o=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();o.hasNext();)if(!e(o.getNext().key))return},t.prototype.firstAfterOrEqual=function(e){var n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null},t.prototype.getIterator=function(){return new FPe(this.data.getIterator())},t.prototype.getIteratorFrom=function(e){return new FPe(this.data.getIteratorFrom(e))},t.prototype.add=function(e){return this.copy(this.data.remove(e).insert(e,!0))},t.prototype.delete=function(e){return this.has(e)?this.copy(this.data.remove(e)):this},t.prototype.isEmpty=function(){return this.data.isEmpty()},t.prototype.unionWith=function(e){var n=this;return n.size0&&(this.k=!0,this.C=e)},t.prototype.M=function(){var e=Ks(),n=Ks(),o=Ks();return this.D.forEach(function(r,i){switch(i){case 0:e=e.add(r);break;case 2:n=n.add(r);break;case 1:o=o.add(r);break;default:ri()}}),new J2e(this.C,this.N,e,n,o)},t.prototype.L=function(){this.k=!1,this.D=LPe()},t.prototype.B=function(e,n){this.k=!0,this.D=this.D.insert(e,n)},t.prototype.q=function(e){this.k=!0,this.D=this.D.remove(e)},t.prototype.U=function(){this.S+=1},t.prototype.K=function(){this.S-=1},t.prototype.j=function(){this.k=!0,this.N=!0},t}(),kBn=function(){function t(e){this.W=e,this.G=new Map,this.H=U2(),this.J=kPe(),this.Y=new ju($a)}return t.prototype.X=function(e){for(var n=0,o=e.v;n0?e.targetIds.forEach(n):this.G.forEach(function(r,i){o.st(i)&&n(i)})},t.prototype.rt=function(e){var n=e.targetId,o=e.V.count,r=this.ot(n);if(r){var i=r.target;if(DX(i))if(o===0){var a=new ci(i.path);this.tt(n,a,wh.newNoDocument(a,Na.min()))}else Wi(o===1);else this.ct(n)!==o&&(this.it(n),this.Y=this.Y.add(n))}},t.prototype.ut=function(e){var n=this,o=new Map;this.G.forEach(function(a,l){var s=n.ot(l);if(s){if(a.current&&DX(s.target)){var c=new ci(s.target.path);n.H.get(c)!==null||n.at(l,c)||n.tt(l,c,wh.newNoDocument(c,e))}a.$&&(o.set(l,a.M()),a.L())}});var r=Ks();this.J.forEach(function(a,l){var s=!0;l.forEachWhile(function(c){var u=n.ot(c);return!u||u.purpose===2||(s=!1,!1)}),s&&(r=r.add(a))});var i=new X2e(e,o,this.Y,this.H,r);return this.H=U2(),this.J=kPe(),this.Y=new ju($a),i},t.prototype.Z=function(e,n){if(this.st(e)){var o=this.at(e,n.key)?2:0;this.nt(e).B(n.key,o),this.H=this.H.insert(n.key,n),this.J=this.J.insert(n.key,this.ht(n.key).add(e))}},t.prototype.tt=function(e,n,o){if(this.st(e)){var r=this.nt(e);this.at(e,n)?r.B(n,1):r.q(n),this.J=this.J.insert(n,this.ht(n).delete(e)),o&&(this.H=this.H.insert(n,o))}},t.prototype.removeTarget=function(e){this.G.delete(e)},t.prototype.ct=function(e){var n=this.nt(e).M();return this.W.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size},t.prototype.U=function(e){this.nt(e).U()},t.prototype.nt=function(e){var n=this.G.get(e);return n||(n=new FPe,this.G.set(e,n)),n},t.prototype.ht=function(e){var n=this.J.get(e);return n||(n=new ju($a),this.J=this.J.insert(e,n)),n},t.prototype.st=function(e){var n=this.ot(e)!==null;return n||ur("WatchChangeAggregator","Detected inactive target",e),n},t.prototype.ot=function(e){var n=this.G.get(e);return n&&n.F?null:this.W.lt(e)},t.prototype.it=function(e){var n=this;this.G.set(e,new FPe),this.W.getRemoteKeysForTarget(e).forEach(function(o){n.tt(e,o,null)})},t.prototype.at=function(e,n){return this.W.getRemoteKeysForTarget(e).has(n)},t}();function kPe(){return new Th(ci.comparator)}function LPe(){return new Th(ci.comparator)}/** + */var J2e=function(){function t(e,n,o,r,i){this.snapshotVersion=e,this.targetChanges=n,this.targetMismatches=o,this.documentUpdates=r,this.resolvedLimboDocuments=i}return t.createSynthesizedRemoteEventForCurrentChange=function(e,n){var o=new Map;return o.set(e,K2e.createSynthesizedTargetChangeForCurrentChange(e,n)),new t(Na.min(),o,HZ(),U2(),Ks())},t}(),K2e=function(){function t(e,n,o,r,i){this.resumeToken=e,this.current=n,this.addedDocuments=o,this.modifiedDocuments=r,this.removedDocuments=i}return t.createSynthesizedTargetChangeForCurrentChange=function(e,n){return new t(i1.EMPTY_BYTE_STRING,n,Ks(),Ks(),Ks())},t}(),fV=function(t,e,n,o){this.v=t,this.removedTargetIds=e,this.key=n,this.P=o},ttt=function(t,e){this.targetId=t,this.V=e},ntt=function(t,e,n,o){n===void 0&&(n=i1.EMPTY_BYTE_STRING),o===void 0&&(o=null),this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=o},kPe=function(){function t(){this.S=0,this.D=WPe(),this.C=i1.EMPTY_BYTE_STRING,this.N=!1,this.k=!0}return Object.defineProperty(t.prototype,"current",{get:function(){return this.N},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resumeToken",{get:function(){return this.C},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"F",{get:function(){return this.S!==0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"$",{get:function(){return this.k},enumerable:!1,configurable:!0}),t.prototype.O=function(e){e.approximateByteSize()>0&&(this.k=!0,this.C=e)},t.prototype.M=function(){var e=Ks(),n=Ks(),o=Ks();return this.D.forEach(function(r,i){switch(i){case 0:e=e.add(r);break;case 2:n=n.add(r);break;case 1:o=o.add(r);break;default:ri()}}),new K2e(this.C,this.N,e,n,o)},t.prototype.L=function(){this.k=!1,this.D=WPe()},t.prototype.B=function(e,n){this.k=!0,this.D=this.D.insert(e,n)},t.prototype.q=function(e){this.k=!0,this.D=this.D.remove(e)},t.prototype.U=function(){this.S+=1},t.prototype.K=function(){this.S-=1},t.prototype.j=function(){this.k=!0,this.N=!0},t}(),kBn=function(){function t(e){this.W=e,this.G=new Map,this.H=U2(),this.J=LPe(),this.Y=new ju($a)}return t.prototype.X=function(e){for(var n=0,o=e.v;n0?e.targetIds.forEach(n):this.G.forEach(function(r,i){o.st(i)&&n(i)})},t.prototype.rt=function(e){var n=e.targetId,o=e.V.count,r=this.ot(n);if(r){var i=r.target;if(EX(i))if(o===0){var a=new ci(i.path);this.tt(n,a,wh.newNoDocument(a,Na.min()))}else Wi(o===1);else this.ct(n)!==o&&(this.it(n),this.Y=this.Y.add(n))}},t.prototype.ut=function(e){var n=this,o=new Map;this.G.forEach(function(a,l){var s=n.ot(l);if(s){if(a.current&&EX(s.target)){var c=new ci(s.target.path);n.H.get(c)!==null||n.at(l,c)||n.tt(l,c,wh.newNoDocument(c,e))}a.$&&(o.set(l,a.M()),a.L())}});var r=Ks();this.J.forEach(function(a,l){var s=!0;l.forEachWhile(function(c){var u=n.ot(c);return!u||u.purpose===2||(s=!1,!1)}),s&&(r=r.add(a))});var i=new J2e(e,o,this.Y,this.H,r);return this.H=U2(),this.J=LPe(),this.Y=new ju($a),i},t.prototype.Z=function(e,n){if(this.st(e)){var o=this.at(e,n.key)?2:0;this.nt(e).B(n.key,o),this.H=this.H.insert(n.key,n),this.J=this.J.insert(n.key,this.ht(n.key).add(e))}},t.prototype.tt=function(e,n,o){if(this.st(e)){var r=this.nt(e);this.at(e,n)?r.B(n,1):r.q(n),this.J=this.J.insert(n,this.ht(n).delete(e)),o&&(this.H=this.H.insert(n,o))}},t.prototype.removeTarget=function(e){this.G.delete(e)},t.prototype.ct=function(e){var n=this.nt(e).M();return this.W.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size},t.prototype.U=function(e){this.nt(e).U()},t.prototype.nt=function(e){var n=this.G.get(e);return n||(n=new kPe,this.G.set(e,n)),n},t.prototype.ht=function(e){var n=this.J.get(e);return n||(n=new ju($a),this.J=this.J.insert(e,n)),n},t.prototype.st=function(e){var n=this.ot(e)!==null;return n||ur("WatchChangeAggregator","Detected inactive target",e),n},t.prototype.ot=function(e){var n=this.G.get(e);return n&&n.F?null:this.W.lt(e)},t.prototype.it=function(e){var n=this;this.G.set(e,new kPe),this.W.getRemoteKeysForTarget(e).forEach(function(o){n.tt(e,o,null)})},t.prototype.at=function(e,n){return this.W.getRemoteKeysForTarget(e).has(n)},t}();function LPe(){return new Th(ci.comparator)}function WPe(){return new Th(ci.comparator)}/** * @license * Copyright 2017 Google LLC * @@ -5742,7 +5742,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var LBn={asc:"ASCENDING",desc:"DESCENDING"},WBn={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},NBn=function(t,e){this.databaseId=t,this.I=e};function Ck(t,e){return t.I?new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+e.nanoseconds).slice(-9)+"Z":{seconds:""+e.seconds,nanos:e.nanoseconds}}function ott(t,e){return t.I?e.toBase64():e.toUint8Array()}function UBn(t,e){return Ck(t,e.toTimestamp())}function ap(t){return Wi(!!t),Na.fromTimestamp(function(e){var n=pw(e);return new Zp(n.seconds,n.nanos)}(t))}function K2e(t,e){return function(n){return new Ol(["projects",n.projectId,"databases",n.database])}(t).child("documents").child(e).canonicalString()}function rtt(t){var e=Ol.fromString(t);return Wi(dtt(e)),e}function Rk(t,e){return K2e(t.databaseId,e.path)}function L6(t,e){var n=rtt(e);if(n.get(1)!==t.databaseId.projectId)throw new ko(On.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new ko(On.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new ci(att(n))}function _de(t,e){return K2e(t.databaseId,e)}function itt(t){var e=rtt(t);return e.length===4?Ol.emptyPath():att(e)}function Hk(t){return new Ol(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function att(t){return Wi(t.length>4&&t.get(4)==="documents"),t.popFirst(5)}function WPe(t,e,n){return{name:Rk(t,e),fields:n.value.mapValue.fields}}function jBn(t,e,n){var o=L6(t,e.name),r=ap(e.updateTime),i=new hg({mapValue:{fields:e.fields}}),a=wh.newFoundDocument(o,r,i);return n&&a.setHasCommittedMutations(),n?a.setHasCommittedMutations():a}function kX(t,e){var n;if(e instanceof NN)n={update:WPe(t,e.key,e.value)};else if(e instanceof UN)n={delete:Rk(t,e.key)};else if(e instanceof Ow)n={update:WPe(t,e.key,e.data),updateMask:VBn(e.fieldMask)};else{if(!(e instanceof G2e))return ri();n={verify:Rk(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map(function(o){return function(r,i){var a=i.transform;if(a instanceof NR)return{fieldPath:i.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof rb)return{fieldPath:i.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof ib)return{fieldPath:i.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof UR)return{fieldPath:i.field.canonicalString(),increment:a.A};throw ri()}(0,o)})),e.precondition.isNone||(n.currentDocument=function(o,r){return r.updateTime!==void 0?{updateTime:UBn(o,r.updateTime)}:r.exists!==void 0?{exists:r.exists}:ri()}(t,e.precondition)),n}function NPe(t,e){var n=e.currentDocument?function(c){return c.updateTime!==void 0?hh.updateTime(ap(c.updateTime)):c.exists!==void 0?hh.exists(c.exists):hh.none()}(e.currentDocument):hh.none(),o=e.updateTransforms?e.updateTransforms.map(function(c){return function(u,d){var f=null;if("setToServerValue"in d)Wi(d.setToServerValue==="REQUEST_TIME"),f=new NR;else if("appendMissingElements"in d){var p=d.appendMissingElements.values||[];f=new rb(p)}else if("removeAllFromArray"in d){var g=d.removeAllFromArray.values||[];f=new ib(g)}else"increment"in d?f=new UR(u,d.increment):ri();var y=X2.fromServerFormat(d.fieldPath);return new WN(y,f)}(t,c)}):[];if(e.update){e.update.name;var r=L6(t,e.update.name),i=new hg({mapValue:{fields:e.update.fields}});if(e.updateMask){var a=function(c){var u=c.fieldPaths||[];return new FR(u.map(function(d){return X2.fromServerFormat(d)}))}(e.updateMask);return new Ow(r,i,a,n,o)}return new NN(r,i,n,o)}if(e.delete){var l=L6(t,e.delete);return new UN(l,n)}if(e.verify){var s=L6(t,e.verify);return new G2e(s,n)}return ri()}function ltt(t,e){return{documents:[_de(t,e.path)]}}function stt(t,e){var n={structuredQuery:{}},o=e.path;e.collectionGroup!==null?(n.parent=_de(t,o),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=_de(t,o.popLast()),n.structuredQuery.from=[{collectionId:o.lastSegment()}]);var r=function(l){if(l.length!==0){var s=l.map(function(c){return function(u){if(u.op==="=="){if(TPe(u.value))return{unaryFilter:{field:_T(u.field),op:"IS_NAN"}};if(SPe(u.value))return{unaryFilter:{field:_T(u.field),op:"IS_NULL"}}}else if(u.op==="!="){if(TPe(u.value))return{unaryFilter:{field:_T(u.field),op:"IS_NOT_NAN"}};if(SPe(u.value))return{unaryFilter:{field:_T(u.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:_T(u.field),op:YBn(u.op),value:u.value}}}(c)});return s.length===1?s[0]:{compositeFilter:{op:"AND",filters:s}}}}(e.filters);r&&(n.structuredQuery.where=r);var i=function(l){if(l.length!==0)return l.map(function(s){return function(c){return{field:_T(c.field),direction:BBn(c.dir)}}(s)})}(e.orderBy);i&&(n.structuredQuery.orderBy=i);var a=function(l,s){return l.I||Gb(s)?s:{value:s}}(t,e.limit);return a!==null&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=UPe(e.startAt)),e.endAt&&(n.structuredQuery.endAt=UPe(e.endAt)),n}function ctt(t){var e=itt(t.parent),n=t.structuredQuery,o=n.from?n.from.length:0,r=null;if(o>0){Wi(o===1);var i=n.from[0];i.allDescendants?r=i.collectionId:e=e.child(i.collectionId)}var a=[];n.where&&(a=utt(n.where));var l=[];n.orderBy&&(l=n.orderBy.map(function(d){return function(f){return new FC(sC(f.field),function(p){switch(p){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(f.direction))}(d)}));var s=null;n.limit&&(s=function(d){var f;return Gb(f=typeof d=="object"?d.value:d)?null:f}(n.limit));var c=null;n.startAt&&(c=jPe(n.startAt));var u=null;return n.endAt&&(u=jPe(n.endAt)),Bet(e,r,l,a,s,"F",c,u)}function utt(t){return t?t.unaryFilter!==void 0?[_Bn(t)]:t.fieldFilter!==void 0?[OBn(t)]:t.compositeFilter!==void 0?t.compositeFilter.filters.map(function(e){return utt(e)}).reduce(function(e,n){return e.concat(n)}):ri():[]}function UPe(t){return{before:t.before,values:t.position}}function jPe(t){var e=!!t.before,n=t.values||[];return new Pk(n,e)}function BBn(t){return LBn[t]}function YBn(t){return WBn[t]}function _T(t){return{fieldPath:t.canonicalString()}}function sC(t){return X2.fromServerFormat(t.fieldPath)}function OBn(t){return vg.create(sC(t.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return ri()}}(t.fieldFilter.op),t.fieldFilter.value)}function _Bn(t){switch(t.unaryFilter.op){case"IS_NAN":var e=sC(t.unaryFilter.field);return vg.create(e,"==",{doubleValue:NaN});case"IS_NULL":var n=sC(t.unaryFilter.field);return vg.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var o=sC(t.unaryFilter.field);return vg.create(o,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var r=sC(t.unaryFilter.field);return vg.create(r,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return ri()}}function VBn(t){var e=[];return t.fields.forEach(function(n){return e.push(n.canonicalString())}),{fieldPaths:e}}function dtt(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}/** + */var LBn={asc:"ASCENDING",desc:"DESCENDING"},WBn={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},NBn=function(t,e){this.databaseId=t,this.I=e};function Ck(t,e){return t.I?new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+e.nanoseconds).slice(-9)+"Z":{seconds:""+e.seconds,nanos:e.nanoseconds}}function ott(t,e){return t.I?e.toBase64():e.toUint8Array()}function UBn(t,e){return Ck(t,e.toTimestamp())}function ap(t){return Wi(!!t),Na.fromTimestamp(function(e){var n=pw(e);return new Zp(n.seconds,n.nanos)}(t))}function q2e(t,e){return function(n){return new Ol(["projects",n.projectId,"databases",n.database])}(t).child("documents").child(e).canonicalString()}function rtt(t){var e=Ol.fromString(t);return Wi(dtt(e)),e}function Rk(t,e){return q2e(t.databaseId,e.path)}function L6(t,e){var n=rtt(e);if(n.get(1)!==t.databaseId.projectId)throw new ko(On.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new ko(On.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new ci(att(n))}function _de(t,e){return q2e(t.databaseId,e)}function itt(t){var e=rtt(t);return e.length===4?Ol.emptyPath():att(e)}function Hk(t){return new Ol(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function att(t){return Wi(t.length>4&&t.get(4)==="documents"),t.popFirst(5)}function NPe(t,e,n){return{name:Rk(t,e),fields:n.value.mapValue.fields}}function jBn(t,e,n){var o=L6(t,e.name),r=ap(e.updateTime),i=new hg({mapValue:{fields:e.fields}}),a=wh.newFoundDocument(o,r,i);return n&&a.setHasCommittedMutations(),n?a.setHasCommittedMutations():a}function LX(t,e){var n;if(e instanceof UN)n={update:NPe(t,e.key,e.value)};else if(e instanceof jN)n={delete:Rk(t,e.key)};else if(e instanceof Ow)n={update:NPe(t,e.key,e.data),updateMask:VBn(e.fieldMask)};else{if(!(e instanceof X2e))return ri();n={verify:Rk(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map(function(o){return function(r,i){var a=i.transform;if(a instanceof NR)return{fieldPath:i.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof rb)return{fieldPath:i.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof ib)return{fieldPath:i.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof UR)return{fieldPath:i.field.canonicalString(),increment:a.A};throw ri()}(0,o)})),e.precondition.isNone||(n.currentDocument=function(o,r){return r.updateTime!==void 0?{updateTime:UBn(o,r.updateTime)}:r.exists!==void 0?{exists:r.exists}:ri()}(t,e.precondition)),n}function UPe(t,e){var n=e.currentDocument?function(c){return c.updateTime!==void 0?hh.updateTime(ap(c.updateTime)):c.exists!==void 0?hh.exists(c.exists):hh.none()}(e.currentDocument):hh.none(),o=e.updateTransforms?e.updateTransforms.map(function(c){return function(u,d){var f=null;if("setToServerValue"in d)Wi(d.setToServerValue==="REQUEST_TIME"),f=new NR;else if("appendMissingElements"in d){var p=d.appendMissingElements.values||[];f=new rb(p)}else if("removeAllFromArray"in d){var g=d.removeAllFromArray.values||[];f=new ib(g)}else"increment"in d?f=new UR(u,d.increment):ri();var y=X2.fromServerFormat(d.fieldPath);return new NN(y,f)}(t,c)}):[];if(e.update){e.update.name;var r=L6(t,e.update.name),i=new hg({mapValue:{fields:e.update.fields}});if(e.updateMask){var a=function(c){var u=c.fieldPaths||[];return new FR(u.map(function(d){return X2.fromServerFormat(d)}))}(e.updateMask);return new Ow(r,i,a,n,o)}return new UN(r,i,n,o)}if(e.delete){var l=L6(t,e.delete);return new jN(l,n)}if(e.verify){var s=L6(t,e.verify);return new X2e(s,n)}return ri()}function ltt(t,e){return{documents:[_de(t,e.path)]}}function stt(t,e){var n={structuredQuery:{}},o=e.path;e.collectionGroup!==null?(n.parent=_de(t,o),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=_de(t,o.popLast()),n.structuredQuery.from=[{collectionId:o.lastSegment()}]);var r=function(l){if(l.length!==0){var s=l.map(function(c){return function(u){if(u.op==="=="){if(PPe(u.value))return{unaryFilter:{field:_T(u.field),op:"IS_NAN"}};if(TPe(u.value))return{unaryFilter:{field:_T(u.field),op:"IS_NULL"}}}else if(u.op==="!="){if(PPe(u.value))return{unaryFilter:{field:_T(u.field),op:"IS_NOT_NAN"}};if(TPe(u.value))return{unaryFilter:{field:_T(u.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:_T(u.field),op:YBn(u.op),value:u.value}}}(c)});return s.length===1?s[0]:{compositeFilter:{op:"AND",filters:s}}}}(e.filters);r&&(n.structuredQuery.where=r);var i=function(l){if(l.length!==0)return l.map(function(s){return function(c){return{field:_T(c.field),direction:BBn(c.dir)}}(s)})}(e.orderBy);i&&(n.structuredQuery.orderBy=i);var a=function(l,s){return l.I||Gb(s)?s:{value:s}}(t,e.limit);return a!==null&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=jPe(e.startAt)),e.endAt&&(n.structuredQuery.endAt=jPe(e.endAt)),n}function ctt(t){var e=itt(t.parent),n=t.structuredQuery,o=n.from?n.from.length:0,r=null;if(o>0){Wi(o===1);var i=n.from[0];i.allDescendants?r=i.collectionId:e=e.child(i.collectionId)}var a=[];n.where&&(a=utt(n.where));var l=[];n.orderBy&&(l=n.orderBy.map(function(d){return function(f){return new FC(sC(f.field),function(p){switch(p){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(f.direction))}(d)}));var s=null;n.limit&&(s=function(d){var f;return Gb(f=typeof d=="object"?d.value:d)?null:f}(n.limit));var c=null;n.startAt&&(c=BPe(n.startAt));var u=null;return n.endAt&&(u=BPe(n.endAt)),Bet(e,r,l,a,s,"F",c,u)}function utt(t){return t?t.unaryFilter!==void 0?[_Bn(t)]:t.fieldFilter!==void 0?[OBn(t)]:t.compositeFilter!==void 0?t.compositeFilter.filters.map(function(e){return utt(e)}).reduce(function(e,n){return e.concat(n)}):ri():[]}function jPe(t){return{before:t.before,values:t.position}}function BPe(t){var e=!!t.before,n=t.values||[];return new Pk(n,e)}function BBn(t){return LBn[t]}function YBn(t){return WBn[t]}function _T(t){return{fieldPath:t.canonicalString()}}function sC(t){return X2.fromServerFormat(t.fieldPath)}function OBn(t){return vg.create(sC(t.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return ri()}}(t.fieldFilter.op),t.fieldFilter.value)}function _Bn(t){switch(t.unaryFilter.op){case"IS_NAN":var e=sC(t.unaryFilter.field);return vg.create(e,"==",{doubleValue:NaN});case"IS_NULL":var n=sC(t.unaryFilter.field);return vg.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var o=sC(t.unaryFilter.field);return vg.create(o,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var r=sC(t.unaryFilter.field);return vg.create(r,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return ri()}}function VBn(t){var e=[];return t.fields.forEach(function(n){return e.push(n.canonicalString())}),{fieldPaths:e}}function dtt(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}/** * @license * Copyright 2017 Google LLC * @@ -5757,7 +5757,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function j2(t){for(var e="",n=0;n0&&(e=BPe(e)),e=GBn(t.get(n),e);return BPe(e)}function GBn(t,e){for(var n=e,o=t.length,r=0;r=2),e===2)return Wi(t.charAt(0)===""&&t.charAt(1)===""),Ol.emptyPath();for(var n=e-2,o=[],r="",i=0;in)&&ri(),t.charAt(a+1)){case"":var l=t.substring(i,a),s=void 0;r.length===0?s=l:(s=r+=l,r=""),o.push(s);break;case"":r+=t.substring(i,a),r+="\0";break;case"":r+=t.substring(i,a+1);break;default:ri()}i=a+2}return new Ol(o)}/** + */function j2(t){for(var e="",n=0;n0&&(e=YPe(e)),e=GBn(t.get(n),e);return YPe(e)}function GBn(t,e){for(var n=e,o=t.length,r=0;r=2),e===2)return Wi(t.charAt(0)===""&&t.charAt(1)===""),Ol.emptyPath();for(var n=e-2,o=[],r="",i=0;in)&&ri(),t.charAt(a+1)){case"":var l=t.substring(i,a),s=void 0;r.length===0?s=l:(s=r+=l,r=""),o.push(s);break;case"":r+=t.substring(i,a),r+="\0";break;case"":r+=t.substring(i,a+1);break;default:ri()}i=a+2}return new Ol(o)}/** * @license * Copyright 2017 Google LLC * @@ -5772,7 +5772,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var XBn=function(t,e){this.seconds=t,this.nanoseconds=e},tg=function(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n};tg.store="owner",tg.key="owner";var O8=function(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n};O8.store="mutationQueues",O8.keyPath="userId";var hc=function(t,e,n,o,r){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=o,this.mutations=r};hc.store="mutations",hc.keyPath="batchId",hc.userMutationsIndex="userMutationsIndex",hc.userMutationsKeyPath=["userId","batchId"];var sh=function(){function t(){}return t.prefixForUser=function(e){return[e]},t.prefixForPath=function(e,n){return[e,j2(n)]},t.key=function(e,n,o){return[e,j2(n),o]},t}();sh.store="documentMutations",sh.PLACEHOLDER=new sh;var JBn=function(t,e){this.path=t,this.readTime=e},KBn=function(t,e){this.path=t,this.version=e},f0=function(t,e,n,o,r,i){this.unknownDocument=t,this.noDocument=e,this.document=n,this.hasCommittedMutations=o,this.readTime=r,this.parentPath=i};f0.store="remoteDocuments",f0.readTimeIndex="readTimeIndex",f0.readTimeIndexPath="readTime",f0.collectionReadTimeIndex="collectionReadTimeIndex",f0.collectionReadTimeIndexPath=["parentPath","readTime"];var y9=function(t){this.byteSize=t};y9.store="remoteDocumentGlobal",y9.key="remoteDocumentGlobalKey";var Xp=function(t,e,n,o,r,i,a){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=o,this.lastListenSequenceNumber=r,this.lastLimboFreeSnapshotVersion=i,this.query=a};Xp.store="targets",Xp.keyPath="targetId",Xp.queryTargetsIndexName="queryTargetsIndex",Xp.queryTargetsKeyPath=["canonicalId","targetId"];var hf=function(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n};hf.store="targetDocuments",hf.keyPath=["targetId","path"],hf.documentTargetsIndex="documentTargetsIndex",hf.documentTargetsKeyPath=["path","targetId"];var lg=function(t,e,n,o){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=o};lg.key="targetGlobalKey",lg.store="targetGlobal";var Sx=function(t,e){this.collectionId=t,this.parent=e};Sx.store="collectionParents",Sx.keyPath=["collectionId","parent"];var W6=function(t,e,n,o){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=o};W6.store="clientMetadata",W6.keyPath="clientId";var jR=function(t,e,n){this.bundleId=t,this.createTime=e,this.version=n};jR.store="bundles",jR.keyPath="bundleId";var BR=function(t,e,n){this.name=t,this.readTime=e,this.bundledQuery=n};BR.store="namedQueries",BR.keyPath="name";var qBn=yl(yl([],yl(yl([],yl(yl([],yl(yl([],[O8.store,hc.store,sh.store,f0.store,Xp.store,tg.store,lg.store,hf.store]),[W6.store])),[y9.store])),[Sx.store])),[jR.store,BR.store]),ftt="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",htt=function(){function t(){this.onCommittedListeners=[]}return t.prototype.addOnCommittedListener=function(e){this.onCommittedListeners.push(e)},t.prototype.raiseOnCommittedEvent=function(){this.onCommittedListeners.forEach(function(e){return e()})},t}(),a1=function(){var t=this;this.promise=new Promise(function(e,n){t.resolve=e,t.reject=n})},Vo=function(){function t(e){var n=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(function(o){n.isDone=!0,n.result=o,n.nextCallback&&n.nextCallback(o)},function(o){n.isDone=!0,n.error=o,n.catchCallback&&n.catchCallback(o)})}return t.prototype.catch=function(e){return this.next(void 0,e)},t.prototype.next=function(e,n){var o=this;return this.callbackAttached&&ri(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new t(function(r,i){o.nextCallback=function(a){o.wrapSuccess(e,a).next(r,i)},o.catchCallback=function(a){o.wrapFailure(n,a).next(r,i)}})},t.prototype.toPromise=function(){var e=this;return new Promise(function(n,o){e.next(n,o)})},t.prototype.wrapUserFunction=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(o){return t.reject(o)}},t.prototype.wrapSuccess=function(e,n){return e?this.wrapUserFunction(function(){return e(n)}):t.resolve(n)},t.prototype.wrapFailure=function(e,n){return e?this.wrapUserFunction(function(){return e(n)}):t.reject(n)},t.resolve=function(e){return new t(function(n,o){n(e)})},t.reject=function(e){return new t(function(n,o){o(e)})},t.waitFor=function(e){return new t(function(n,o){var r=0,i=0,a=!1;e.forEach(function(l){++r,l.next(function(){++i,a&&i===r&&n()},function(s){return o(s)})}),a=!0,i===r&&n()})},t.or=function(e){for(var n=t.resolve(!1),o=function(a){n=n.next(function(l){return l?t.resolve(l):a()})},r=0,i=e;r"u")return!1;if(t.gt())return!0;var e=Zx(),n=t._t(e),o=00||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||o||i)},t.gt=function(){var e;return typeof process<"u"&&((e=cBn)===null||e===void 0?void 0:e.Tt)==="YES"},t.It=function(e,n){return e.store(n)},t._t=function(e){var n=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),o=n?n[1].split("_").slice(0,2).join("."):"-1";return Number(o)},t.Et=function(e){var n=e.match(/Android ([\d.]+)/i),o=n?n[1].split(".").slice(0,2).join("."):"-1";return Number(o)},t.prototype.At=function(e){return vo(this,void 0,void 0,function(){var n,o=this;return Ao(this,function(r){switch(r.label){case 0:return this.db?[3,2]:(ur("SimpleDb","Opening database:",this.name),n=this,[4,new Promise(function(i,a){var l=indexedDB.open(o.name,o.version);l.onsuccess=function(s){var c=s.target.result;i(c)},l.onblocked=function(){a(new FE(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},l.onerror=function(s){var c=s.target.error;c.name==="VersionError"?a(new ko(On.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):a(new FE(e,c))},l.onupgradeneeded=function(s){ur("SimpleDb",'Database "'+o.name+'" requires upgrade from version:',s.oldVersion);var c=s.target.result;o.wt.Rt(c,l.transaction,s.oldVersion,o.version).next(function(){ur("SimpleDb","Database upgrade to version "+o.version+" complete")})}})]);case 1:n.db=r.sent(),r.label=2;case 2:return[2,(this.bt&&(this.db.onversionchange=function(i){return o.bt(i)}),this.db)]}})})},t.prototype.vt=function(e){this.bt=e,this.db&&(this.db.onversionchange=function(n){return e(n)})},t.prototype.runTransaction=function(e,n,o,r){return vo(this,void 0,void 0,function(){var i,a,l,s,c;return Ao(this,function(u){switch(u.label){case 0:i=n==="readonly",a=0,l=function(){var d,f,p,g,y;return Ao(this,function(w){switch(w.label){case 0:++a,w.label=1;case 1:return w.trys.push([1,4,,5]),[4,s.At(e)];case 2:return s.db=w.sent(),d=ptt.open(s.db,e,i?"readonly":"readwrite",o),f=r(d).catch(function(b){return d.abort(b),Vo.reject(b)}).toPromise(),p={},f.catch(function(){}),[4,d.dt];case 3:return[2,(p.value=(w.sent(),f),p)];case 4:return g=w.sent(),y=g.name!=="FirebaseError"&&a<3,ur("SimpleDb","Transaction failed with error:",g.message,"Retrying:",y),s.close(),y?[3,5]:[2,{value:Promise.reject(g)}];case 5:return[2]}})},s=this,u.label=1;case 1:return[5,l()];case 2:if(typeof(c=u.sent())=="object")return[2,c.value];u.label=3;case 3:return[3,1];case 4:return[2]}})})},t.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},t}(),$Bn=function(){function t(e){this.Pt=e,this.Vt=!1,this.St=null}return Object.defineProperty(t.prototype,"isDone",{get:function(){return this.Vt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Dt",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{set:function(e){this.Pt=e},enumerable:!1,configurable:!0}),t.prototype.done=function(){this.Vt=!0},t.prototype.Ct=function(e){this.St=e},t.prototype.delete=function(){return Sv(this.Pt.delete())},t}(),FE=function(t){function e(n,o){var r=this;return(r=t.call(this,On.UNAVAILABLE,"IndexedDB transaction '"+n+"' failed: "+o)||this).name="IndexedDbTransactionError",r}return Pr(e,t),e}(ko);function Xb(t){return t.name==="IndexedDbTransactionError"}var QBn=function(){function t(e){this.store=e}return t.prototype.put=function(e,n){var o;return n!==void 0?(ur("SimpleDb","PUT",this.store.name,e,n),o=this.store.put(n,e)):(ur("SimpleDb","PUT",this.store.name,"",e),o=this.store.put(e)),Sv(o)},t.prototype.add=function(e){return ur("SimpleDb","ADD",this.store.name,e,e),Sv(this.store.add(e))},t.prototype.get=function(e){var n=this;return Sv(this.store.get(e)).next(function(o){return o===void 0&&(o=null),ur("SimpleDb","GET",n.store.name,e,o),o})},t.prototype.delete=function(e){return ur("SimpleDb","DELETE",this.store.name,e),Sv(this.store.delete(e))},t.prototype.count=function(){return ur("SimpleDb","COUNT",this.store.name),Sv(this.store.count())},t.prototype.Nt=function(e,n){var o=this.cursor(this.options(e,n)),r=[];return this.xt(o,function(i,a){r.push(a)}).next(function(){return r})},t.prototype.kt=function(e,n){ur("SimpleDb","DELETE ALL",this.store.name);var o=this.options(e,n);o.Ft=!1;var r=this.cursor(o);return this.xt(r,function(i,a,l){return l.delete()})},t.prototype.$t=function(e,n){var o;n?o=e:(o={},n=e);var r=this.cursor(o);return this.xt(r,n)},t.prototype.Ot=function(e){var n=this.cursor({});return new Vo(function(o,r){n.onerror=function(i){var a=q2e(i.target.error);r(a)},n.onsuccess=function(i){var a=i.target.result;a?e(a.primaryKey,a.value).next(function(l){l?a.continue():o()}):o()}})},t.prototype.xt=function(e,n){var o=[];return new Vo(function(r,i){e.onerror=function(a){i(a.target.error)},e.onsuccess=function(a){var l=a.target.result;if(l){var s=new $Bn(l),c=n(l.primaryKey,l.value,s);if(c instanceof Vo){var u=c.catch(function(d){return s.done(),Vo.reject(d)});o.push(u)}s.isDone?r():s.Dt===null?l.continue():l.continue(s.Dt)}else r()}}).next(function(){return Vo.waitFor(o)})},t.prototype.options=function(e,n){var o;return e!==void 0&&(typeof e=="string"?o=e:n=e),{index:o,range:n}},t.prototype.cursor=function(e){var n="next";if(e.reverse&&(n="prev"),e.index){var o=this.store.index(e.index);return e.Ft?o.openKeyCursor(e.range,n):o.openCursor(e.range,n)}return this.store.openCursor(e.range,n)},t}();function Sv(t){return new Vo(function(e,n){t.onsuccess=function(o){var r=o.target.result;e(r)},t.onerror=function(o){var r=q2e(o.target.error);n(r)}})}var YPe=!1;function q2e(t){var e=YR._t(Zx());if(e>=12.2&&e<13){var n="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(n)>=0){var o=new ko("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+n+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return YPe||(YPe=!0,setTimeout(function(){throw o},0)),o}}return t}/** + */var XBn=function(t,e){this.seconds=t,this.nanoseconds=e},tg=function(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n};tg.store="owner",tg.key="owner";var O8=function(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n};O8.store="mutationQueues",O8.keyPath="userId";var hc=function(t,e,n,o,r){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=o,this.mutations=r};hc.store="mutations",hc.keyPath="batchId",hc.userMutationsIndex="userMutationsIndex",hc.userMutationsKeyPath=["userId","batchId"];var sh=function(){function t(){}return t.prefixForUser=function(e){return[e]},t.prefixForPath=function(e,n){return[e,j2(n)]},t.key=function(e,n,o){return[e,j2(n),o]},t}();sh.store="documentMutations",sh.PLACEHOLDER=new sh;var JBn=function(t,e){this.path=t,this.readTime=e},KBn=function(t,e){this.path=t,this.version=e},f0=function(t,e,n,o,r,i){this.unknownDocument=t,this.noDocument=e,this.document=n,this.hasCommittedMutations=o,this.readTime=r,this.parentPath=i};f0.store="remoteDocuments",f0.readTimeIndex="readTimeIndex",f0.readTimeIndexPath="readTime",f0.collectionReadTimeIndex="collectionReadTimeIndex",f0.collectionReadTimeIndexPath=["parentPath","readTime"];var y9=function(t){this.byteSize=t};y9.store="remoteDocumentGlobal",y9.key="remoteDocumentGlobalKey";var Xp=function(t,e,n,o,r,i,a){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=o,this.lastListenSequenceNumber=r,this.lastLimboFreeSnapshotVersion=i,this.query=a};Xp.store="targets",Xp.keyPath="targetId",Xp.queryTargetsIndexName="queryTargetsIndex",Xp.queryTargetsKeyPath=["canonicalId","targetId"];var hf=function(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n};hf.store="targetDocuments",hf.keyPath=["targetId","path"],hf.documentTargetsIndex="documentTargetsIndex",hf.documentTargetsKeyPath=["path","targetId"];var lg=function(t,e,n,o){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=o};lg.key="targetGlobalKey",lg.store="targetGlobal";var Sx=function(t,e){this.collectionId=t,this.parent=e};Sx.store="collectionParents",Sx.keyPath=["collectionId","parent"];var W6=function(t,e,n,o){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=o};W6.store="clientMetadata",W6.keyPath="clientId";var jR=function(t,e,n){this.bundleId=t,this.createTime=e,this.version=n};jR.store="bundles",jR.keyPath="bundleId";var BR=function(t,e,n){this.name=t,this.readTime=e,this.bundledQuery=n};BR.store="namedQueries",BR.keyPath="name";var qBn=yl(yl([],yl(yl([],yl(yl([],yl(yl([],[O8.store,hc.store,sh.store,f0.store,Xp.store,tg.store,lg.store,hf.store]),[W6.store])),[y9.store])),[Sx.store])),[jR.store,BR.store]),ftt="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",htt=function(){function t(){this.onCommittedListeners=[]}return t.prototype.addOnCommittedListener=function(e){this.onCommittedListeners.push(e)},t.prototype.raiseOnCommittedEvent=function(){this.onCommittedListeners.forEach(function(e){return e()})},t}(),a1=function(){var t=this;this.promise=new Promise(function(e,n){t.resolve=e,t.reject=n})},Vo=function(){function t(e){var n=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(function(o){n.isDone=!0,n.result=o,n.nextCallback&&n.nextCallback(o)},function(o){n.isDone=!0,n.error=o,n.catchCallback&&n.catchCallback(o)})}return t.prototype.catch=function(e){return this.next(void 0,e)},t.prototype.next=function(e,n){var o=this;return this.callbackAttached&&ri(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new t(function(r,i){o.nextCallback=function(a){o.wrapSuccess(e,a).next(r,i)},o.catchCallback=function(a){o.wrapFailure(n,a).next(r,i)}})},t.prototype.toPromise=function(){var e=this;return new Promise(function(n,o){e.next(n,o)})},t.prototype.wrapUserFunction=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(o){return t.reject(o)}},t.prototype.wrapSuccess=function(e,n){return e?this.wrapUserFunction(function(){return e(n)}):t.resolve(n)},t.prototype.wrapFailure=function(e,n){return e?this.wrapUserFunction(function(){return e(n)}):t.reject(n)},t.resolve=function(e){return new t(function(n,o){n(e)})},t.reject=function(e){return new t(function(n,o){o(e)})},t.waitFor=function(e){return new t(function(n,o){var r=0,i=0,a=!1;e.forEach(function(l){++r,l.next(function(){++i,a&&i===r&&n()},function(s){return o(s)})}),a=!0,i===r&&n()})},t.or=function(e){for(var n=t.resolve(!1),o=function(a){n=n.next(function(l){return l?t.resolve(l):a()})},r=0,i=e;r"u")return!1;if(t.gt())return!0;var e=Zx(),n=t._t(e),o=00||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||o||i)},t.gt=function(){var e;return typeof process<"u"&&((e=cBn)===null||e===void 0?void 0:e.Tt)==="YES"},t.It=function(e,n){return e.store(n)},t._t=function(e){var n=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),o=n?n[1].split("_").slice(0,2).join("."):"-1";return Number(o)},t.Et=function(e){var n=e.match(/Android ([\d.]+)/i),o=n?n[1].split(".").slice(0,2).join("."):"-1";return Number(o)},t.prototype.At=function(e){return vo(this,void 0,void 0,function(){var n,o=this;return Ao(this,function(r){switch(r.label){case 0:return this.db?[3,2]:(ur("SimpleDb","Opening database:",this.name),n=this,[4,new Promise(function(i,a){var l=indexedDB.open(o.name,o.version);l.onsuccess=function(s){var c=s.target.result;i(c)},l.onblocked=function(){a(new FE(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},l.onerror=function(s){var c=s.target.error;c.name==="VersionError"?a(new ko(On.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):a(new FE(e,c))},l.onupgradeneeded=function(s){ur("SimpleDb",'Database "'+o.name+'" requires upgrade from version:',s.oldVersion);var c=s.target.result;o.wt.Rt(c,l.transaction,s.oldVersion,o.version).next(function(){ur("SimpleDb","Database upgrade to version "+o.version+" complete")})}})]);case 1:n.db=r.sent(),r.label=2;case 2:return[2,(this.bt&&(this.db.onversionchange=function(i){return o.bt(i)}),this.db)]}})})},t.prototype.vt=function(e){this.bt=e,this.db&&(this.db.onversionchange=function(n){return e(n)})},t.prototype.runTransaction=function(e,n,o,r){return vo(this,void 0,void 0,function(){var i,a,l,s,c;return Ao(this,function(u){switch(u.label){case 0:i=n==="readonly",a=0,l=function(){var d,f,p,g,y;return Ao(this,function(w){switch(w.label){case 0:++a,w.label=1;case 1:return w.trys.push([1,4,,5]),[4,s.At(e)];case 2:return s.db=w.sent(),d=ptt.open(s.db,e,i?"readonly":"readwrite",o),f=r(d).catch(function(b){return d.abort(b),Vo.reject(b)}).toPromise(),p={},f.catch(function(){}),[4,d.dt];case 3:return[2,(p.value=(w.sent(),f),p)];case 4:return g=w.sent(),y=g.name!=="FirebaseError"&&a<3,ur("SimpleDb","Transaction failed with error:",g.message,"Retrying:",y),s.close(),y?[3,5]:[2,{value:Promise.reject(g)}];case 5:return[2]}})},s=this,u.label=1;case 1:return[5,l()];case 2:if(typeof(c=u.sent())=="object")return[2,c.value];u.label=3;case 3:return[3,1];case 4:return[2]}})})},t.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},t}(),$Bn=function(){function t(e){this.Pt=e,this.Vt=!1,this.St=null}return Object.defineProperty(t.prototype,"isDone",{get:function(){return this.Vt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Dt",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{set:function(e){this.Pt=e},enumerable:!1,configurable:!0}),t.prototype.done=function(){this.Vt=!0},t.prototype.Ct=function(e){this.St=e},t.prototype.delete=function(){return Sv(this.Pt.delete())},t}(),FE=function(t){function e(n,o){var r=this;return(r=t.call(this,On.UNAVAILABLE,"IndexedDB transaction '"+n+"' failed: "+o)||this).name="IndexedDbTransactionError",r}return Pr(e,t),e}(ko);function Xb(t){return t.name==="IndexedDbTransactionError"}var QBn=function(){function t(e){this.store=e}return t.prototype.put=function(e,n){var o;return n!==void 0?(ur("SimpleDb","PUT",this.store.name,e,n),o=this.store.put(n,e)):(ur("SimpleDb","PUT",this.store.name,"",e),o=this.store.put(e)),Sv(o)},t.prototype.add=function(e){return ur("SimpleDb","ADD",this.store.name,e,e),Sv(this.store.add(e))},t.prototype.get=function(e){var n=this;return Sv(this.store.get(e)).next(function(o){return o===void 0&&(o=null),ur("SimpleDb","GET",n.store.name,e,o),o})},t.prototype.delete=function(e){return ur("SimpleDb","DELETE",this.store.name,e),Sv(this.store.delete(e))},t.prototype.count=function(){return ur("SimpleDb","COUNT",this.store.name),Sv(this.store.count())},t.prototype.Nt=function(e,n){var o=this.cursor(this.options(e,n)),r=[];return this.xt(o,function(i,a){r.push(a)}).next(function(){return r})},t.prototype.kt=function(e,n){ur("SimpleDb","DELETE ALL",this.store.name);var o=this.options(e,n);o.Ft=!1;var r=this.cursor(o);return this.xt(r,function(i,a,l){return l.delete()})},t.prototype.$t=function(e,n){var o;n?o=e:(o={},n=e);var r=this.cursor(o);return this.xt(r,n)},t.prototype.Ot=function(e){var n=this.cursor({});return new Vo(function(o,r){n.onerror=function(i){var a=$2e(i.target.error);r(a)},n.onsuccess=function(i){var a=i.target.result;a?e(a.primaryKey,a.value).next(function(l){l?a.continue():o()}):o()}})},t.prototype.xt=function(e,n){var o=[];return new Vo(function(r,i){e.onerror=function(a){i(a.target.error)},e.onsuccess=function(a){var l=a.target.result;if(l){var s=new $Bn(l),c=n(l.primaryKey,l.value,s);if(c instanceof Vo){var u=c.catch(function(d){return s.done(),Vo.reject(d)});o.push(u)}s.isDone?r():s.Dt===null?l.continue():l.continue(s.Dt)}else r()}}).next(function(){return Vo.waitFor(o)})},t.prototype.options=function(e,n){var o;return e!==void 0&&(typeof e=="string"?o=e:n=e),{index:o,range:n}},t.prototype.cursor=function(e){var n="next";if(e.reverse&&(n="prev"),e.index){var o=this.store.index(e.index);return e.Ft?o.openKeyCursor(e.range,n):o.openCursor(e.range,n)}return this.store.openCursor(e.range,n)},t}();function Sv(t){return new Vo(function(e,n){t.onsuccess=function(o){var r=o.target.result;e(r)},t.onerror=function(o){var r=$2e(o.target.error);n(r)}})}var OPe=!1;function $2e(t){var e=YR._t(Zx());if(e>=12.2&&e<13){var n="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(n)>=0){var o=new ko("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+n+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return OPe||(OPe=!0,setTimeout(function(){throw o},0)),o}}return t}/** * @license * Copyright 2020 Google LLC * @@ -5787,7 +5787,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var OPe=function(t){function e(n,o){var r=this;return(r=t.call(this)||this).Mt=n,r.currentSequenceNumber=o,r}return Pr(e,t),e}(htt);function p1(t,e){var n=Ir(t);return YR.It(n.Mt,e)}/** + */var _Pe=function(t){function e(n,o){var r=this;return(r=t.call(this)||this).Mt=n,r.currentSequenceNumber=o,r}return Pr(e,t),e}(htt);function p1(t,e){var n=Ir(t);return YR.It(n.Mt,e)}/** * @license * Copyright 2017 Google LLC * @@ -5802,7 +5802,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var $2e=function(){function t(e,n,o,r){this.batchId=e,this.localWriteTime=n,this.baseMutations=o,this.mutations=r}return t.prototype.applyToRemoteDocument=function(e,n){for(var o=n.mutationResults,r=0;r=r),a=uP(o.R,s)),c.done()}).next(function(){return a})},t.prototype.getHighestUnacknowledgedBatchId=function(e){var n=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),o=-1;return z4(e).$t({index:hc.userMutationsIndex,range:n,reverse:!0},function(r,i,a){o=i.batchId,a.done()}).next(function(){return o})},t.prototype.getAllMutationBatches=function(e){var n=this,o=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return z4(e).Nt(hc.userMutationsIndex,o).next(function(r){return r.map(function(i){return uP(n.R,i)})})},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,n){var o=this,r=sh.prefixForPath(this.userId,n.path),i=IDBKeyRange.lowerBound(r),a=[];return dP(e).$t({range:i},function(l,s,c){var u=l[0],d=l[1],f=l[2],p=P6(d);if(u===o.userId&&n.path.isEqual(p))return z4(e).get(f).next(function(g){if(!g)throw ri();Wi(g.userId===o.userId),a.push(uP(o.R,g))});c.done()}).next(function(){return a})},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(e,n){var o=this,r=new ju($a),i=[];return n.forEach(function(a){var l=sh.prefixForPath(o.userId,a.path),s=IDBKeyRange.lowerBound(l),c=dP(e).$t({range:s},function(u,d,f){var p=u[0],g=u[1],y=u[2],w=P6(g);p===o.userId&&a.path.isEqual(w)?r=r.add(y):f.done()});i.push(c)}),Vo.waitFor(i).next(function(){return o.Wt(e,r)})},t.prototype.getAllMutationBatchesAffectingQuery=function(e,n){var o=this,r=n.path,i=r.length+1,a=sh.prefixForPath(this.userId,r),l=IDBKeyRange.lowerBound(a),s=new ju($a);return dP(e).$t({range:l},function(c,u,d){var f=c[0],p=c[1],g=c[2],y=P6(p);f===o.userId&&r.isPrefixOf(y)?y.length===i&&(s=s.add(g)):d.done()}).next(function(){return o.Wt(e,s)})},t.prototype.Wt=function(e,n){var o=this,r=[],i=[];return n.forEach(function(a){i.push(z4(e).get(a).next(function(l){if(l===null)throw ri();Wi(l.userId===o.userId),r.push(uP(o.R,l))}))}),Vo.waitFor(i).next(function(){return r})},t.prototype.removeMutationBatch=function(e,n){var o=this;return wtt(e.Mt,this.userId,n).next(function(r){return e.addOnCommittedListener(function(){o.Gt(n.batchId)}),Vo.forEach(r,function(i){return o.referenceDelegate.markPotentiallyOrphaned(e,i)})})},t.prototype.Gt=function(e){delete this.Kt[e]},t.prototype.performConsistencyCheck=function(e){var n=this;return this.checkEmpty(e).next(function(o){if(!o)return Vo.resolve();var r=IDBKeyRange.lowerBound(sh.prefixForUser(n.userId)),i=[];return dP(e).$t({range:r},function(a,l,s){if(a[0]===n.userId){var c=P6(a[1]);i.push(c)}else s.done()}).next(function(){Wi(i.length===0)})})},t.prototype.containsKey=function(e,n){return vtt(e,this.userId,n)},t.prototype.zt=function(e){var n=this;return xtt(e).get(this.userId).next(function(o){return o||new O8(n.userId,-1,"")})},t}();function vtt(t,e,n){var o=sh.prefixForPath(e,n.path),r=o[1],i=IDBKeyRange.lowerBound(o),a=!1;return dP(t).$t({range:i,Ft:!0},function(l,s,c){var u=l[0],d=l[1];l[2],u===e&&d===r&&(a=!0),c.done()}).next(function(){return a})}function z4(t){return p1(t,hc.store)}function dP(t){return p1(t,sh.store)}function xtt(t){return p1(t,O8.store)}/** + */e9.DEFAULT_COLLECTION_PERCENTILE=10,e9.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,e9.DEFAULT=new e9(41943040,e9.DEFAULT_COLLECTION_PERCENTILE,e9.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),e9.DISABLED=new e9(-1,0,0);var oYn=function(){function t(e,n,o,r){this.userId=e,this.R=n,this.Ut=o,this.referenceDelegate=r,this.Kt={}}return t.Qt=function(e,n,o,r){return Wi(e.uid!==""),new t(e.isAuthenticated()?e.uid:"",n,o,r)},t.prototype.checkEmpty=function(e){var n=!0,o=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return z4(e).$t({index:hc.userMutationsIndex,range:o},function(r,i,a){n=!1,a.done()}).next(function(){return n})},t.prototype.addMutationBatch=function(e,n,o,r){var i=this,a=dP(e),l=z4(e);return l.add({}).next(function(s){Wi(typeof s=="number");for(var c=new Q2e(s,n,o,r),u=function(b,C,P){var v=P.baseMutations.map(function(A){return LX(b.Lt,A)}),T=P.mutations.map(function(A){return LX(b.Lt,A)});return new hc(C,P.batchId,P.localWriteTime.toMillis(),v,T)}(i.R,i.userId,c),d=[],f=new ju(function(b,C){return $a(b.canonicalString(),C.canonicalString())}),p=0,g=r;p=r),a=uP(o.R,s)),c.done()}).next(function(){return a})},t.prototype.getHighestUnacknowledgedBatchId=function(e){var n=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),o=-1;return z4(e).$t({index:hc.userMutationsIndex,range:n,reverse:!0},function(r,i,a){o=i.batchId,a.done()}).next(function(){return o})},t.prototype.getAllMutationBatches=function(e){var n=this,o=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return z4(e).Nt(hc.userMutationsIndex,o).next(function(r){return r.map(function(i){return uP(n.R,i)})})},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,n){var o=this,r=sh.prefixForPath(this.userId,n.path),i=IDBKeyRange.lowerBound(r),a=[];return dP(e).$t({range:i},function(l,s,c){var u=l[0],d=l[1],f=l[2],p=P6(d);if(u===o.userId&&n.path.isEqual(p))return z4(e).get(f).next(function(g){if(!g)throw ri();Wi(g.userId===o.userId),a.push(uP(o.R,g))});c.done()}).next(function(){return a})},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(e,n){var o=this,r=new ju($a),i=[];return n.forEach(function(a){var l=sh.prefixForPath(o.userId,a.path),s=IDBKeyRange.lowerBound(l),c=dP(e).$t({range:s},function(u,d,f){var p=u[0],g=u[1],y=u[2],w=P6(g);p===o.userId&&a.path.isEqual(w)?r=r.add(y):f.done()});i.push(c)}),Vo.waitFor(i).next(function(){return o.Wt(e,r)})},t.prototype.getAllMutationBatchesAffectingQuery=function(e,n){var o=this,r=n.path,i=r.length+1,a=sh.prefixForPath(this.userId,r),l=IDBKeyRange.lowerBound(a),s=new ju($a);return dP(e).$t({range:l},function(c,u,d){var f=c[0],p=c[1],g=c[2],y=P6(p);f===o.userId&&r.isPrefixOf(y)?y.length===i&&(s=s.add(g)):d.done()}).next(function(){return o.Wt(e,s)})},t.prototype.Wt=function(e,n){var o=this,r=[],i=[];return n.forEach(function(a){i.push(z4(e).get(a).next(function(l){if(l===null)throw ri();Wi(l.userId===o.userId),r.push(uP(o.R,l))}))}),Vo.waitFor(i).next(function(){return r})},t.prototype.removeMutationBatch=function(e,n){var o=this;return wtt(e.Mt,this.userId,n).next(function(r){return e.addOnCommittedListener(function(){o.Gt(n.batchId)}),Vo.forEach(r,function(i){return o.referenceDelegate.markPotentiallyOrphaned(e,i)})})},t.prototype.Gt=function(e){delete this.Kt[e]},t.prototype.performConsistencyCheck=function(e){var n=this;return this.checkEmpty(e).next(function(o){if(!o)return Vo.resolve();var r=IDBKeyRange.lowerBound(sh.prefixForUser(n.userId)),i=[];return dP(e).$t({range:r},function(a,l,s){if(a[0]===n.userId){var c=P6(a[1]);i.push(c)}else s.done()}).next(function(){Wi(i.length===0)})})},t.prototype.containsKey=function(e,n){return vtt(e,this.userId,n)},t.prototype.zt=function(e){var n=this;return xtt(e).get(this.userId).next(function(o){return o||new O8(n.userId,-1,"")})},t}();function vtt(t,e,n){var o=sh.prefixForPath(e,n.path),r=o[1],i=IDBKeyRange.lowerBound(o),a=!1;return dP(t).$t({range:i,Ft:!0},function(l,s,c){var u=l[0],d=l[1];l[2],u===e&&d===r&&(a=!0),c.done()}).next(function(){return a})}function z4(t){return p1(t,hc.store)}function dP(t){return p1(t,sh.store)}function xtt(t){return p1(t,O8.store)}/** * @license * Copyright 2017 Google LLC * @@ -5892,7 +5892,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var WX=function(){function t(e){this.Ht=e}return t.prototype.next=function(){return this.Ht+=2,this.Ht},t.Jt=function(){return new t(0)},t.Yt=function(){return new t(-1)},t}(),rYn=function(){function t(e,n){this.referenceDelegate=e,this.R=n}return t.prototype.allocateTargetId=function(e){var n=this;return this.Xt(e).next(function(o){var r=new WX(o.highestTargetId);return o.highestTargetId=r.next(),n.Zt(e,o).next(function(){return o.highestTargetId})})},t.prototype.getLastRemoteSnapshotVersion=function(e){return this.Xt(e).next(function(n){return Na.fromTimestamp(new Zp(n.lastRemoteSnapshotVersion.seconds,n.lastRemoteSnapshotVersion.nanoseconds))})},t.prototype.getHighestSequenceNumber=function(e){return this.Xt(e).next(function(n){return n.highestListenSequenceNumber})},t.prototype.setTargetsMetadata=function(e,n,o){var r=this;return this.Xt(e).next(function(i){return i.highestListenSequenceNumber=n,o&&(i.lastRemoteSnapshotVersion=o.toTimestamp()),n>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=n),r.Zt(e,i)})},t.prototype.addTargetData=function(e,n){var o=this;return this.te(e,n).next(function(){return o.Xt(e).next(function(r){return r.targetCount+=1,o.ee(n,r),o.Zt(e,r)})})},t.prototype.updateTargetData=function(e,n){return this.te(e,n)},t.prototype.removeTargetData=function(e,n){var o=this;return this.removeMatchingKeysForTargetId(e,n.targetId).next(function(){return VT(e).delete(n.targetId)}).next(function(){return o.Xt(e)}).next(function(r){return Wi(r.targetCount>0),r.targetCount-=1,o.Zt(e,r)})},t.prototype.removeTargets=function(e,n,o){var r=this,i=0,a=[];return VT(e).$t(function(l,s){var c=jD(s);c.sequenceNumber<=n&&o.get(c.targetId)===null&&(i++,a.push(r.removeTargetData(e,c)))}).next(function(){return Vo.waitFor(a)}).next(function(){return i})},t.prototype.forEachTarget=function(e,n){return VT(e).$t(function(o,r){var i=jD(r);n(i)})},t.prototype.Xt=function(e){return KPe(e).get(lg.key).next(function(n){return Wi(n!==null),n})},t.prototype.Zt=function(e,n){return KPe(e).put(lg.key,n)},t.prototype.te=function(e,n){return VT(e).put(ytt(this.R,n))},t.prototype.ee=function(e,n){var o=!1;return e.targetId>n.highestTargetId&&(n.highestTargetId=e.targetId,o=!0),e.sequenceNumber>n.highestListenSequenceNumber&&(n.highestListenSequenceNumber=e.sequenceNumber,o=!0),o},t.prototype.getTargetCount=function(e){return this.Xt(e).next(function(n){return n.targetCount})},t.prototype.getTargetData=function(e,n){var o=EN(n),r=IDBKeyRange.bound([o,Number.NEGATIVE_INFINITY],[o,Number.POSITIVE_INFINITY]),i=null;return VT(e).$t({range:r,index:Xp.queryTargetsIndexName},function(a,l,s){var c=jD(l);PZ(n,c.target)&&(i=c,s.done())}).next(function(){return i})},t.prototype.addMatchingKeys=function(e,n,o){var r=this,i=[],a=a8(e);return n.forEach(function(l){var s=j2(l.path);i.push(a.put(new hf(o,s))),i.push(r.referenceDelegate.addReference(e,o,l))}),Vo.waitFor(i)},t.prototype.removeMatchingKeys=function(e,n,o){var r=this,i=a8(e);return Vo.forEach(n,function(a){var l=j2(a.path);return Vo.waitFor([i.delete([o,l]),r.referenceDelegate.removeReference(e,o,a)])})},t.prototype.removeMatchingKeysForTargetId=function(e,n){var o=a8(e),r=IDBKeyRange.bound([n],[n+1],!1,!0);return o.delete(r)},t.prototype.getMatchingKeysForTargetId=function(e,n){var o=IDBKeyRange.bound([n],[n+1],!1,!0),r=a8(e),i=Ks();return r.$t({range:o,Ft:!0},function(a,l,s){var c=P6(a[1]),u=new ci(c);i=i.add(u)}).next(function(){return i})},t.prototype.containsKey=function(e,n){var o=j2(n.path),r=IDBKeyRange.bound([o],[Fet(o)],!1,!0),i=0;return a8(e).$t({index:hf.documentTargetsIndex,Ft:!0,range:r},function(a,l,s){var c=a[0];a[1],c!==0&&(i++,s.done())}).next(function(){return i>0})},t.prototype.lt=function(e,n){return VT(e).get(n).next(function(o){return o?jD(o):null})},t}();/** + */var NX=function(){function t(e){this.Ht=e}return t.prototype.next=function(){return this.Ht+=2,this.Ht},t.Jt=function(){return new t(0)},t.Yt=function(){return new t(-1)},t}(),rYn=function(){function t(e,n){this.referenceDelegate=e,this.R=n}return t.prototype.allocateTargetId=function(e){var n=this;return this.Xt(e).next(function(o){var r=new NX(o.highestTargetId);return o.highestTargetId=r.next(),n.Zt(e,o).next(function(){return o.highestTargetId})})},t.prototype.getLastRemoteSnapshotVersion=function(e){return this.Xt(e).next(function(n){return Na.fromTimestamp(new Zp(n.lastRemoteSnapshotVersion.seconds,n.lastRemoteSnapshotVersion.nanoseconds))})},t.prototype.getHighestSequenceNumber=function(e){return this.Xt(e).next(function(n){return n.highestListenSequenceNumber})},t.prototype.setTargetsMetadata=function(e,n,o){var r=this;return this.Xt(e).next(function(i){return i.highestListenSequenceNumber=n,o&&(i.lastRemoteSnapshotVersion=o.toTimestamp()),n>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=n),r.Zt(e,i)})},t.prototype.addTargetData=function(e,n){var o=this;return this.te(e,n).next(function(){return o.Xt(e).next(function(r){return r.targetCount+=1,o.ee(n,r),o.Zt(e,r)})})},t.prototype.updateTargetData=function(e,n){return this.te(e,n)},t.prototype.removeTargetData=function(e,n){var o=this;return this.removeMatchingKeysForTargetId(e,n.targetId).next(function(){return VT(e).delete(n.targetId)}).next(function(){return o.Xt(e)}).next(function(r){return Wi(r.targetCount>0),r.targetCount-=1,o.Zt(e,r)})},t.prototype.removeTargets=function(e,n,o){var r=this,i=0,a=[];return VT(e).$t(function(l,s){var c=jD(s);c.sequenceNumber<=n&&o.get(c.targetId)===null&&(i++,a.push(r.removeTargetData(e,c)))}).next(function(){return Vo.waitFor(a)}).next(function(){return i})},t.prototype.forEachTarget=function(e,n){return VT(e).$t(function(o,r){var i=jD(r);n(i)})},t.prototype.Xt=function(e){return qPe(e).get(lg.key).next(function(n){return Wi(n!==null),n})},t.prototype.Zt=function(e,n){return qPe(e).put(lg.key,n)},t.prototype.te=function(e,n){return VT(e).put(ytt(this.R,n))},t.prototype.ee=function(e,n){var o=!1;return e.targetId>n.highestTargetId&&(n.highestTargetId=e.targetId,o=!0),e.sequenceNumber>n.highestListenSequenceNumber&&(n.highestListenSequenceNumber=e.sequenceNumber,o=!0),o},t.prototype.getTargetCount=function(e){return this.Xt(e).next(function(n){return n.targetCount})},t.prototype.getTargetData=function(e,n){var o=FN(n),r=IDBKeyRange.bound([o,Number.NEGATIVE_INFINITY],[o,Number.POSITIVE_INFINITY]),i=null;return VT(e).$t({range:r,index:Xp.queryTargetsIndexName},function(a,l,s){var c=jD(l);PZ(n,c.target)&&(i=c,s.done())}).next(function(){return i})},t.prototype.addMatchingKeys=function(e,n,o){var r=this,i=[],a=a8(e);return n.forEach(function(l){var s=j2(l.path);i.push(a.put(new hf(o,s))),i.push(r.referenceDelegate.addReference(e,o,l))}),Vo.waitFor(i)},t.prototype.removeMatchingKeys=function(e,n,o){var r=this,i=a8(e);return Vo.forEach(n,function(a){var l=j2(a.path);return Vo.waitFor([i.delete([o,l]),r.referenceDelegate.removeReference(e,o,a)])})},t.prototype.removeMatchingKeysForTargetId=function(e,n){var o=a8(e),r=IDBKeyRange.bound([n],[n+1],!1,!0);return o.delete(r)},t.prototype.getMatchingKeysForTargetId=function(e,n){var o=IDBKeyRange.bound([n],[n+1],!1,!0),r=a8(e),i=Ks();return r.$t({range:o,Ft:!0},function(a,l,s){var c=P6(a[1]),u=new ci(c);i=i.add(u)}).next(function(){return i})},t.prototype.containsKey=function(e,n){var o=j2(n.path),r=IDBKeyRange.bound([o],[Fet(o)],!1,!0),i=0;return a8(e).$t({index:hf.documentTargetsIndex,Ft:!0,range:r},function(a,l,s){var c=a[0];a[1],c!==0&&(i++,s.done())}).next(function(){return i>0})},t.prototype.lt=function(e,n){return VT(e).get(n).next(function(o){return o?jD(o):null})},t}();/** * @license * Copyright 2017 Google LLC * @@ -5907,7 +5907,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function VT(t){return p1(t,Xp.store)}function KPe(t){return p1(t,lg.store)}function a8(t){return p1(t,hf.store)}/** + */function VT(t){return p1(t,Xp.store)}function qPe(t){return p1(t,lg.store)}function a8(t){return p1(t,hf.store)}/** * @license * Copyright 2017 Google LLC * @@ -5937,12 +5937,12 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function qPe(t,e){var n=t[0],o=t[1],r=e[0],i=e[1],a=$a(n,r);return a===0?$a(o,i):a}var iYn=function(){function t(e){this.ne=e,this.buffer=new ju(qPe),this.se=0}return t.prototype.ie=function(){return++this.se},t.prototype.re=function(e){var n=[e,this.ie()];if(this.buffer.sizeu.params.maximumSequenceNumbersToCollect?(ur("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+u.params.maximumSequenceNumbersToCollect+" from "+f),r=u.params.maximumSequenceNumbersToCollect):r=f,a=Date.now(),u.nthSequenceNumber(e,r)}).next(function(f){return o=f,l=Date.now(),u.removeTargets(e,o,n)}).next(function(f){return i=f,s=Date.now(),u.removeOrphanedDocuments(e,o)}).next(function(f){return c=Date.now(),Nde()<=Rl.DEBUG&&ur("LruGarbageCollector",`LRU Garbage Collection + */function $Pe(t,e){var n=t[0],o=t[1],r=e[0],i=e[1],a=$a(n,r);return a===0?$a(o,i):a}var iYn=function(){function t(e){this.ne=e,this.buffer=new ju($Pe),this.se=0}return t.prototype.ie=function(){return++this.se},t.prototype.re=function(e){var n=[e,this.ie()];if(this.buffer.sizeu.params.maximumSequenceNumbersToCollect?(ur("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+u.params.maximumSequenceNumbersToCollect+" from "+f),r=u.params.maximumSequenceNumbersToCollect):r=f,a=Date.now(),u.nthSequenceNumber(e,r)}).next(function(f){return o=f,l=Date.now(),u.removeTargets(e,o,n)}).next(function(f){return i=f,s=Date.now(),u.removeOrphanedDocuments(e,o)}).next(function(f){return c=Date.now(),Nde()<=Rl.DEBUG&&ur("LruGarbageCollector",`LRU Garbage Collection Counted targets in `+(a-d)+`ms Determined least recently used `+r+" in "+(l-a)+`ms Removed `+i+" targets in "+(s-l)+`ms Removed `+f+" documents in "+(c-s)+`ms -Total Duration: `+(c-d)+"ms"),Vo.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:i,documentsRemoved:f})})},t}(),sYn=function(){function t(e,n){this.db=e,this.garbageCollector=function(o,r){return new lYn(o,r)}(this,n)}return t.prototype.he=function(e){var n=this.de(e);return this.db.getTargetCache().getTargetCount(e).next(function(o){return n.next(function(r){return o+r})})},t.prototype.de=function(e){var n=0;return this.le(e,function(o){n++}).next(function(){return n})},t.prototype.forEachTarget=function(e,n){return this.db.getTargetCache().forEachTarget(e,n)},t.prototype.le=function(e,n){return this.we(e,function(o,r){return n(r)})},t.prototype.addReference=function(e,n,o){return RO(e,o)},t.prototype.removeReference=function(e,n,o){return RO(e,o)},t.prototype.removeTargets=function(e,n,o){return this.db.getTargetCache().removeTargets(e,n,o)},t.prototype.markPotentiallyOrphaned=function(e,n){return RO(e,n)},t.prototype._e=function(e,n){return function(o,r){var i=!1;return xtt(o).Ot(function(a){return vtt(o,a,r).next(function(l){return l&&(i=!0),Vo.resolve(!l)})}).next(function(){return i})}(e,n)},t.prototype.removeOrphanedDocuments=function(e,n){var o=this,r=this.db.getRemoteDocumentCache().newChangeBuffer(),i=[],a=0;return this.we(e,function(l,s){if(s<=n){var c=o._e(e,l).next(function(u){if(!u)return a++,r.getEntry(e,l).next(function(){return r.removeEntry(l),a8(e).delete([0,j2(l.path)])})});i.push(c)}}).next(function(){return Vo.waitFor(i)}).next(function(){return r.apply(e)}).next(function(){return a})},t.prototype.removeTarget=function(e,n){var o=n.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,o)},t.prototype.updateLimboDocument=function(e,n){return RO(e,n)},t.prototype.we=function(e,n){var o,r=a8(e),i=wg.o;return r.$t({index:hf.documentTargetsIndex},function(a,l){var s=a[0];a[1];var c=l.path,u=l.sequenceNumber;s===0?(i!==wg.o&&n(new ci(P6(o)),i),i=u,o=c):i=wg.o}).next(function(){i!==wg.o&&n(new ci(P6(o)),i)})},t.prototype.getCacheSize=function(e){return this.db.getRemoteDocumentCache().getSize(e)},t}();function RO(t,e){return a8(t).put(function(n,o){return new hf(0,j2(n.path),o)}(e,t.currentSequenceNumber))}/** +Total Duration: `+(c-d)+"ms"),Vo.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:i,documentsRemoved:f})})},t}(),sYn=function(){function t(e,n){this.db=e,this.garbageCollector=function(o,r){return new lYn(o,r)}(this,n)}return t.prototype.he=function(e){var n=this.de(e);return this.db.getTargetCache().getTargetCount(e).next(function(o){return n.next(function(r){return o+r})})},t.prototype.de=function(e){var n=0;return this.le(e,function(o){n++}).next(function(){return n})},t.prototype.forEachTarget=function(e,n){return this.db.getTargetCache().forEachTarget(e,n)},t.prototype.le=function(e,n){return this.we(e,function(o,r){return n(r)})},t.prototype.addReference=function(e,n,o){return HO(e,o)},t.prototype.removeReference=function(e,n,o){return HO(e,o)},t.prototype.removeTargets=function(e,n,o){return this.db.getTargetCache().removeTargets(e,n,o)},t.prototype.markPotentiallyOrphaned=function(e,n){return HO(e,n)},t.prototype._e=function(e,n){return function(o,r){var i=!1;return xtt(o).Ot(function(a){return vtt(o,a,r).next(function(l){return l&&(i=!0),Vo.resolve(!l)})}).next(function(){return i})}(e,n)},t.prototype.removeOrphanedDocuments=function(e,n){var o=this,r=this.db.getRemoteDocumentCache().newChangeBuffer(),i=[],a=0;return this.we(e,function(l,s){if(s<=n){var c=o._e(e,l).next(function(u){if(!u)return a++,r.getEntry(e,l).next(function(){return r.removeEntry(l),a8(e).delete([0,j2(l.path)])})});i.push(c)}}).next(function(){return Vo.waitFor(i)}).next(function(){return r.apply(e)}).next(function(){return a})},t.prototype.removeTarget=function(e,n){var o=n.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,o)},t.prototype.updateLimboDocument=function(e,n){return HO(e,n)},t.prototype.we=function(e,n){var o,r=a8(e),i=wg.o;return r.$t({index:hf.documentTargetsIndex},function(a,l){var s=a[0];a[1];var c=l.path,u=l.sequenceNumber;s===0?(i!==wg.o&&n(new ci(P6(o)),i),i=u,o=c):i=wg.o}).next(function(){i!==wg.o&&n(new ci(P6(o)),i)})},t.prototype.getCacheSize=function(e){return this.db.getRemoteDocumentCache().getSize(e)},t}();function HO(t,e){return a8(t).put(function(n,o){return new hf(0,j2(n.path),o)}(e,t.currentSequenceNumber))}/** * @license * Copyright 2017 Google LLC * @@ -5957,7 +5957,7 @@ Total Duration: `+(c-d)+"ms"),Vo.resolve({didRun:!0,sequenceNumbersCollected:r,t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var iM=function(){function t(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={}}return t.prototype.get=function(e){var n=this.mapKeyFn(e),o=this.inner[n];if(o!==void 0)for(var r=0,i=o;r=0&&r<=11);var a=new ptt("createOrUpgrade",n);o<1&&r>=1&&(function(s){s.createObjectStore(tg.store)}(e),function(s){s.createObjectStore(O8.store,{keyPath:O8.keyPath}),s.createObjectStore(hc.store,{keyPath:hc.keyPath,autoIncrement:!0}).createIndex(hc.userMutationsIndex,hc.userMutationsKeyPath,{unique:!0}),s.createObjectStore(sh.store)}(e),QPe(e),function(s){s.createObjectStore(f0.store)}(e));var l=Vo.resolve();return o<3&&r>=3&&(o!==0&&(function(s){s.deleteObjectStore(hf.store),s.deleteObjectStore(Xp.store),s.deleteObjectStore(lg.store)}(e),QPe(e)),l=l.next(function(){return function(s){var c=s.store(lg.store),u=new lg(0,0,Na.min().toTimestamp(),0);return c.put(lg.key,u)}(a)})),o<4&&r>=4&&(o!==0&&(l=l.next(function(){return function(s,c){return c.store(hc.store).Nt().next(function(u){s.deleteObjectStore(hc.store),s.createObjectStore(hc.store,{keyPath:hc.keyPath,autoIncrement:!0}).createIndex(hc.userMutationsIndex,hc.userMutationsKeyPath,{unique:!0});var d=c.store(hc.store),f=u.map(function(p){return d.put(p)});return Vo.waitFor(f)})}(e,a)})),l=l.next(function(){(function(s){s.createObjectStore(W6.store,{keyPath:W6.keyPath})})(e)})),o<5&&r>=5&&(l=l.next(function(){return i.Re(a)})),o<6&&r>=6&&(l=l.next(function(){return function(s){s.createObjectStore(y9.store)}(e),i.be(a)})),o<7&&r>=7&&(l=l.next(function(){return i.ve(a)})),o<8&&r>=8&&(l=l.next(function(){return i.Pe(e,a)})),o<9&&r>=9&&(l=l.next(function(){(function(s){s.objectStoreNames.contains("remoteDocumentChanges")&&s.deleteObjectStore("remoteDocumentChanges")})(e),function(s){var c=s.objectStore(f0.store);c.createIndex(f0.readTimeIndex,f0.readTimeIndexPath,{unique:!1}),c.createIndex(f0.collectionReadTimeIndex,f0.collectionReadTimeIndexPath,{unique:!1})}(n)})),o<10&&r>=10&&(l=l.next(function(){return i.Ve(a)})),o<11&&r>=11&&(l=l.next(function(){(function(s){s.createObjectStore(jR.store,{keyPath:jR.keyPath})})(e),function(s){s.createObjectStore(BR.store,{keyPath:BR.keyPath})}(e)})),l},t.prototype.be=function(e){var n=0;return e.store(f0.store).$t(function(o,r){n+=LX(r)}).next(function(){var o=new y9(n);return e.store(y9.store).put(y9.key,o)})},t.prototype.Re=function(e){var n=this,o=e.store(O8.store),r=e.store(hc.store);return o.Nt().next(function(i){return Vo.forEach(i,function(a){var l=IDBKeyRange.bound([a.userId,-1],[a.userId,a.lastAcknowledgedBatchId]);return r.Nt(hc.userMutationsIndex,l).next(function(s){return Vo.forEach(s,function(c){Wi(c.userId===a.userId);var u=uP(n.R,c);return wtt(e,a.userId,u).next(function(){})})})})})},t.prototype.ve=function(e){var n=e.store(hf.store),o=e.store(f0.store);return e.store(lg.store).get(lg.key).next(function(r){var i=[];return o.$t(function(a,l){var s=new Ol(a),c=function(u){return[0,j2(u)]}(s);i.push(n.get(c).next(function(u){return u?Vo.resolve():function(d){return n.put(new hf(0,j2(d),r.highestListenSequenceNumber))}(s)}))}).next(function(){return Vo.waitFor(i)})})},t.prototype.Pe=function(e,n){e.createObjectStore(Sx.store,{keyPath:Sx.keyPath});var o=n.store(Sx.store),r=new Z2e,i=function(a){if(r.add(a)){var l=a.lastSegment(),s=a.popLast();return o.put({collectionId:l,parent:j2(s)})}};return n.store(f0.store).$t({Ft:!0},function(a,l){var s=new Ol(a);return i(s.popLast())}).next(function(){return n.store(sh.store).$t({Ft:!0},function(a,l){a[0];var s=a[1];a[2];var c=P6(s);return i(c.popLast())})})},t.prototype.Ve=function(e){var n=this,o=e.store(Xp.store);return o.$t(function(r,i){var a=jD(i),l=ytt(n.R,a);return o.put(l)})},t}();function QPe(t){t.createObjectStore(hf.store,{keyPath:hf.keyPath}).createIndex(hf.documentTargetsIndex,hf.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(Xp.store,{keyPath:Xp.keyPath}).createIndex(Xp.queryTargetsIndexName,Xp.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(lg.store)}var Aae="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",fYn=function(){function t(e,n,o,r,i,a,l,s,c,u){if(this.allowTabSynchronization=e,this.persistenceKey=n,this.clientId=o,this.Se=i,this.window=a,this.document=l,this.De=c,this.Ce=u,this.Ne=null,this.xe=!1,this.isPrimary=!1,this.networkEnabled=!0,this.ke=null,this.inForeground=!1,this.Fe=null,this.$e=null,this.Oe=Number.NEGATIVE_INFINITY,this.Me=function(d){return Promise.resolve()},!t.yt())throw new ko(On.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new sYn(this,r),this.Le=n+"main",this.R=new gtt(s),this.Be=new YR(this.Le,11,new dYn(this.R)),this.qe=new rYn(this.referenceDelegate,this.R),this.Ut=new nYn,this.Ue=function(d,f){return new cYn(d,f)}(this.R,this.Ut),this.Ke=new eYn,this.window&&this.window.localStorage?this.Qe=this.window.localStorage:(this.Qe=null,u===!1&&cu("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return t.prototype.start=function(){var e=this;return this.je().then(function(){if(!e.isPrimary&&!e.allowTabSynchronization)throw new ko(On.FAILED_PRECONDITION,Aae);return e.We(),e.Ge(),e.ze(),e.runTransaction("getHighestListenSequenceNumber","readonly",function(n){return e.qe.getHighestSequenceNumber(n)})}).then(function(n){e.Ne=new wg(n,e.De)}).then(function(){e.xe=!0}).catch(function(n){return e.Be&&e.Be.close(),Promise.reject(n)})},t.prototype.He=function(e){var n=this;return this.Me=function(o){return vo(n,void 0,void 0,function(){return Ao(this,function(r){return this.started?[2,e(o)]:[2]})})},e(this.isPrimary)},t.prototype.setDatabaseDeletedListener=function(e){var n=this;this.Be.vt(function(o){return vo(n,void 0,void 0,function(){return Ao(this,function(r){switch(r.label){case 0:return o.newVersion===null?[4,e()]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}})})})},t.prototype.setNetworkEnabled=function(e){var n=this;this.networkEnabled!==e&&(this.networkEnabled=e,this.Se.enqueueAndForget(function(){return vo(n,void 0,void 0,function(){return Ao(this,function(o){switch(o.label){case 0:return this.started?[4,this.je()]:[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}})})}))},t.prototype.je=function(){var e=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",function(n){return MO(n).put(new W6(e.clientId,Date.now(),e.networkEnabled,e.inForeground)).next(function(){if(e.isPrimary)return e.Je(n).next(function(o){o||(e.isPrimary=!1,e.Se.enqueueRetryable(function(){return e.Me(!1)}))})}).next(function(){return e.Ye(n)}).next(function(o){return e.isPrimary&&!o?e.Xe(n).next(function(){return!1}):!!o&&e.Ze(n).next(function(){return!0})})}).catch(function(n){if(Xb(n))return ur("IndexedDbPersistence","Failed to extend owner lease: ",n),e.isPrimary;if(!e.allowTabSynchronization)throw n;return ur("IndexedDbPersistence","Releasing owner lease after error during lease refresh",n),!1}).then(function(n){e.isPrimary!==n&&e.Se.enqueueRetryable(function(){return e.Me(n)}),e.isPrimary=n})},t.prototype.Je=function(e){var n=this;return Kz(e).get(tg.key).next(function(o){return Vo.resolve(n.tn(o))})},t.prototype.en=function(e){return MO(e).delete(this.clientId)},t.prototype.nn=function(){return vo(this,void 0,void 0,function(){var e,n,o,r,i=this;return Ao(this,function(a){switch(a.label){case 0:return!this.isPrimary||this.sn(this.Oe,18e5)?[3,2]:(this.Oe=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",function(l){var s=p1(l,W6.store);return s.Nt().next(function(c){var u=i.rn(c,18e5),d=c.filter(function(f){return u.indexOf(f)===-1});return Vo.forEach(d,function(f){return s.delete(f.clientId)}).next(function(){return d})})}).catch(function(){return[]})]);case 1:if(e=a.sent(),this.Qe)for(n=0,o=e;no&&(cu("Detected an update time that is in the future: "+e+" > "+o),1))},t.prototype.We=function(){var e=this;this.document!==null&&typeof this.document.addEventListener=="function"&&(this.Fe=function(){e.Se.enqueueAndForget(function(){return e.inForeground=e.document.visibilityState==="visible",e.je()})},this.document.addEventListener("visibilitychange",this.Fe),this.inForeground=this.document.visibilityState==="visible")},t.prototype.an=function(){this.Fe&&(this.document.removeEventListener("visibilitychange",this.Fe),this.Fe=null)},t.prototype.Ge=function(){var e,n=this;typeof((e=this.window)===null||e===void 0?void 0:e.addEventListener)=="function"&&(this.ke=function(){n.un(),pUn()&&navigator.appVersion.match("Version/14")&&n.Se.enterRestrictedMode(!0),n.Se.enqueueAndForget(function(){return n.shutdown()})},this.window.addEventListener("pagehide",this.ke))},t.prototype.hn=function(){this.ke&&(this.window.removeEventListener("pagehide",this.ke),this.ke=null)},t.prototype.cn=function(e){var n;try{var o=((n=this.Qe)===null||n===void 0?void 0:n.getItem(this.on(e)))!==null;return ur("IndexedDbPersistence","Client '"+e+"' "+(o?"is":"is not")+" zombied in LocalStorage"),o}catch(r){return cu("IndexedDbPersistence","Failed to get zombied client id.",r),!1}},t.prototype.un=function(){if(this.Qe)try{this.Qe.setItem(this.on(this.clientId),String(Date.now()))}catch(e){cu("Failed to set zombie client id.",e)}},t.prototype.ln=function(){if(this.Qe)try{this.Qe.removeItem(this.on(this.clientId))}catch{}},t.prototype.on=function(e){return"firestore_zombie_"+this.persistenceKey+"_"+e},t}();function Kz(t){return p1(t,tg.store)}function MO(t){return p1(t,W6.store)}function e5e(t,e){var n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}var Stt=function(){function t(e,n,o){this.Ue=e,this._n=n,this.Ut=o}return t.prototype.mn=function(e,n){var o=this;return this._n.getAllMutationBatchesAffectingDocumentKey(e,n).next(function(r){return o.yn(e,n,r)})},t.prototype.yn=function(e,n,o){return this.Ue.getEntry(e,n).next(function(r){for(var i=0,a=o;i0)},t.prototype.Dn=function(e,n){return Nde()<=Rl.DEBUG&&ur("QueryEngine","Using full collection scan to execute query:",Bde(n)),this.Sn.getDocumentsMatchingQuery(e,n,Na.min())},t}(),pYn=function(){function t(e,n,o,r){this.persistence=e,this.xn=n,this.R=r,this.kn=new Th($a),this.Fn=new iM(function(i){return EN(i)},PZ),this.$n=Na.min(),this._n=e.getMutationQueue(o),this.On=e.getRemoteDocumentCache(),this.qe=e.getTargetCache(),this.Mn=new Stt(this.On,this._n,this.persistence.getIndexManager()),this.Ke=e.getBundleCache(),this.xn.Vn(this.Mn)}return t.prototype.collectGarbage=function(e){var n=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",function(o){return e.collect(o,n.kn)})},t}();/** + */var dYn=function(){function t(e){this.R=e}return t.prototype.Rt=function(e,n,o,r){var i=this;Wi(o=0&&r<=11);var a=new ptt("createOrUpgrade",n);o<1&&r>=1&&(function(s){s.createObjectStore(tg.store)}(e),function(s){s.createObjectStore(O8.store,{keyPath:O8.keyPath}),s.createObjectStore(hc.store,{keyPath:hc.keyPath,autoIncrement:!0}).createIndex(hc.userMutationsIndex,hc.userMutationsKeyPath,{unique:!0}),s.createObjectStore(sh.store)}(e),ZPe(e),function(s){s.createObjectStore(f0.store)}(e));var l=Vo.resolve();return o<3&&r>=3&&(o!==0&&(function(s){s.deleteObjectStore(hf.store),s.deleteObjectStore(Xp.store),s.deleteObjectStore(lg.store)}(e),ZPe(e)),l=l.next(function(){return function(s){var c=s.store(lg.store),u=new lg(0,0,Na.min().toTimestamp(),0);return c.put(lg.key,u)}(a)})),o<4&&r>=4&&(o!==0&&(l=l.next(function(){return function(s,c){return c.store(hc.store).Nt().next(function(u){s.deleteObjectStore(hc.store),s.createObjectStore(hc.store,{keyPath:hc.keyPath,autoIncrement:!0}).createIndex(hc.userMutationsIndex,hc.userMutationsKeyPath,{unique:!0});var d=c.store(hc.store),f=u.map(function(p){return d.put(p)});return Vo.waitFor(f)})}(e,a)})),l=l.next(function(){(function(s){s.createObjectStore(W6.store,{keyPath:W6.keyPath})})(e)})),o<5&&r>=5&&(l=l.next(function(){return i.Re(a)})),o<6&&r>=6&&(l=l.next(function(){return function(s){s.createObjectStore(y9.store)}(e),i.be(a)})),o<7&&r>=7&&(l=l.next(function(){return i.ve(a)})),o<8&&r>=8&&(l=l.next(function(){return i.Pe(e,a)})),o<9&&r>=9&&(l=l.next(function(){(function(s){s.objectStoreNames.contains("remoteDocumentChanges")&&s.deleteObjectStore("remoteDocumentChanges")})(e),function(s){var c=s.objectStore(f0.store);c.createIndex(f0.readTimeIndex,f0.readTimeIndexPath,{unique:!1}),c.createIndex(f0.collectionReadTimeIndex,f0.collectionReadTimeIndexPath,{unique:!1})}(n)})),o<10&&r>=10&&(l=l.next(function(){return i.Ve(a)})),o<11&&r>=11&&(l=l.next(function(){(function(s){s.createObjectStore(jR.store,{keyPath:jR.keyPath})})(e),function(s){s.createObjectStore(BR.store,{keyPath:BR.keyPath})}(e)})),l},t.prototype.be=function(e){var n=0;return e.store(f0.store).$t(function(o,r){n+=WX(r)}).next(function(){var o=new y9(n);return e.store(y9.store).put(y9.key,o)})},t.prototype.Re=function(e){var n=this,o=e.store(O8.store),r=e.store(hc.store);return o.Nt().next(function(i){return Vo.forEach(i,function(a){var l=IDBKeyRange.bound([a.userId,-1],[a.userId,a.lastAcknowledgedBatchId]);return r.Nt(hc.userMutationsIndex,l).next(function(s){return Vo.forEach(s,function(c){Wi(c.userId===a.userId);var u=uP(n.R,c);return wtt(e,a.userId,u).next(function(){})})})})})},t.prototype.ve=function(e){var n=e.store(hf.store),o=e.store(f0.store);return e.store(lg.store).get(lg.key).next(function(r){var i=[];return o.$t(function(a,l){var s=new Ol(a),c=function(u){return[0,j2(u)]}(s);i.push(n.get(c).next(function(u){return u?Vo.resolve():function(d){return n.put(new hf(0,j2(d),r.highestListenSequenceNumber))}(s)}))}).next(function(){return Vo.waitFor(i)})})},t.prototype.Pe=function(e,n){e.createObjectStore(Sx.store,{keyPath:Sx.keyPath});var o=n.store(Sx.store),r=new e5e,i=function(a){if(r.add(a)){var l=a.lastSegment(),s=a.popLast();return o.put({collectionId:l,parent:j2(s)})}};return n.store(f0.store).$t({Ft:!0},function(a,l){var s=new Ol(a);return i(s.popLast())}).next(function(){return n.store(sh.store).$t({Ft:!0},function(a,l){a[0];var s=a[1];a[2];var c=P6(s);return i(c.popLast())})})},t.prototype.Ve=function(e){var n=this,o=e.store(Xp.store);return o.$t(function(r,i){var a=jD(i),l=ytt(n.R,a);return o.put(l)})},t}();function ZPe(t){t.createObjectStore(hf.store,{keyPath:hf.keyPath}).createIndex(hf.documentTargetsIndex,hf.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(Xp.store,{keyPath:Xp.keyPath}).createIndex(Xp.queryTargetsIndexName,Xp.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(lg.store)}var Aae="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",fYn=function(){function t(e,n,o,r,i,a,l,s,c,u){if(this.allowTabSynchronization=e,this.persistenceKey=n,this.clientId=o,this.Se=i,this.window=a,this.document=l,this.De=c,this.Ce=u,this.Ne=null,this.xe=!1,this.isPrimary=!1,this.networkEnabled=!0,this.ke=null,this.inForeground=!1,this.Fe=null,this.$e=null,this.Oe=Number.NEGATIVE_INFINITY,this.Me=function(d){return Promise.resolve()},!t.yt())throw new ko(On.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new sYn(this,r),this.Le=n+"main",this.R=new gtt(s),this.Be=new YR(this.Le,11,new dYn(this.R)),this.qe=new rYn(this.referenceDelegate,this.R),this.Ut=new nYn,this.Ue=function(d,f){return new cYn(d,f)}(this.R,this.Ut),this.Ke=new eYn,this.window&&this.window.localStorage?this.Qe=this.window.localStorage:(this.Qe=null,u===!1&&cu("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return t.prototype.start=function(){var e=this;return this.je().then(function(){if(!e.isPrimary&&!e.allowTabSynchronization)throw new ko(On.FAILED_PRECONDITION,Aae);return e.We(),e.Ge(),e.ze(),e.runTransaction("getHighestListenSequenceNumber","readonly",function(n){return e.qe.getHighestSequenceNumber(n)})}).then(function(n){e.Ne=new wg(n,e.De)}).then(function(){e.xe=!0}).catch(function(n){return e.Be&&e.Be.close(),Promise.reject(n)})},t.prototype.He=function(e){var n=this;return this.Me=function(o){return vo(n,void 0,void 0,function(){return Ao(this,function(r){return this.started?[2,e(o)]:[2]})})},e(this.isPrimary)},t.prototype.setDatabaseDeletedListener=function(e){var n=this;this.Be.vt(function(o){return vo(n,void 0,void 0,function(){return Ao(this,function(r){switch(r.label){case 0:return o.newVersion===null?[4,e()]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}})})})},t.prototype.setNetworkEnabled=function(e){var n=this;this.networkEnabled!==e&&(this.networkEnabled=e,this.Se.enqueueAndForget(function(){return vo(n,void 0,void 0,function(){return Ao(this,function(o){switch(o.label){case 0:return this.started?[4,this.je()]:[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}})})}))},t.prototype.je=function(){var e=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",function(n){return IO(n).put(new W6(e.clientId,Date.now(),e.networkEnabled,e.inForeground)).next(function(){if(e.isPrimary)return e.Je(n).next(function(o){o||(e.isPrimary=!1,e.Se.enqueueRetryable(function(){return e.Me(!1)}))})}).next(function(){return e.Ye(n)}).next(function(o){return e.isPrimary&&!o?e.Xe(n).next(function(){return!1}):!!o&&e.Ze(n).next(function(){return!0})})}).catch(function(n){if(Xb(n))return ur("IndexedDbPersistence","Failed to extend owner lease: ",n),e.isPrimary;if(!e.allowTabSynchronization)throw n;return ur("IndexedDbPersistence","Releasing owner lease after error during lease refresh",n),!1}).then(function(n){e.isPrimary!==n&&e.Se.enqueueRetryable(function(){return e.Me(n)}),e.isPrimary=n})},t.prototype.Je=function(e){var n=this;return Kz(e).get(tg.key).next(function(o){return Vo.resolve(n.tn(o))})},t.prototype.en=function(e){return IO(e).delete(this.clientId)},t.prototype.nn=function(){return vo(this,void 0,void 0,function(){var e,n,o,r,i=this;return Ao(this,function(a){switch(a.label){case 0:return!this.isPrimary||this.sn(this.Oe,18e5)?[3,2]:(this.Oe=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",function(l){var s=p1(l,W6.store);return s.Nt().next(function(c){var u=i.rn(c,18e5),d=c.filter(function(f){return u.indexOf(f)===-1});return Vo.forEach(d,function(f){return s.delete(f.clientId)}).next(function(){return d})})}).catch(function(){return[]})]);case 1:if(e=a.sent(),this.Qe)for(n=0,o=e;no&&(cu("Detected an update time that is in the future: "+e+" > "+o),1))},t.prototype.We=function(){var e=this;this.document!==null&&typeof this.document.addEventListener=="function"&&(this.Fe=function(){e.Se.enqueueAndForget(function(){return e.inForeground=e.document.visibilityState==="visible",e.je()})},this.document.addEventListener("visibilitychange",this.Fe),this.inForeground=this.document.visibilityState==="visible")},t.prototype.an=function(){this.Fe&&(this.document.removeEventListener("visibilitychange",this.Fe),this.Fe=null)},t.prototype.Ge=function(){var e,n=this;typeof((e=this.window)===null||e===void 0?void 0:e.addEventListener)=="function"&&(this.ke=function(){n.un(),pUn()&&navigator.appVersion.match("Version/14")&&n.Se.enterRestrictedMode(!0),n.Se.enqueueAndForget(function(){return n.shutdown()})},this.window.addEventListener("pagehide",this.ke))},t.prototype.hn=function(){this.ke&&(this.window.removeEventListener("pagehide",this.ke),this.ke=null)},t.prototype.cn=function(e){var n;try{var o=((n=this.Qe)===null||n===void 0?void 0:n.getItem(this.on(e)))!==null;return ur("IndexedDbPersistence","Client '"+e+"' "+(o?"is":"is not")+" zombied in LocalStorage"),o}catch(r){return cu("IndexedDbPersistence","Failed to get zombied client id.",r),!1}},t.prototype.un=function(){if(this.Qe)try{this.Qe.setItem(this.on(this.clientId),String(Date.now()))}catch(e){cu("Failed to set zombie client id.",e)}},t.prototype.ln=function(){if(this.Qe)try{this.Qe.removeItem(this.on(this.clientId))}catch{}},t.prototype.on=function(e){return"firestore_zombie_"+this.persistenceKey+"_"+e},t}();function Kz(t){return p1(t,tg.store)}function IO(t){return p1(t,W6.store)}function t5e(t,e){var n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}var Stt=function(){function t(e,n,o){this.Ue=e,this._n=n,this.Ut=o}return t.prototype.mn=function(e,n){var o=this;return this._n.getAllMutationBatchesAffectingDocumentKey(e,n).next(function(r){return o.yn(e,n,r)})},t.prototype.yn=function(e,n,o){return this.Ue.getEntry(e,n).next(function(r){for(var i=0,a=o;i0)},t.prototype.Dn=function(e,n){return Nde()<=Rl.DEBUG&&ur("QueryEngine","Using full collection scan to execute query:",Bde(n)),this.Sn.getDocumentsMatchingQuery(e,n,Na.min())},t}(),pYn=function(){function t(e,n,o,r){this.persistence=e,this.xn=n,this.R=r,this.kn=new Th($a),this.Fn=new iM(function(i){return FN(i)},PZ),this.$n=Na.min(),this._n=e.getMutationQueue(o),this.On=e.getRemoteDocumentCache(),this.qe=e.getTargetCache(),this.Mn=new Stt(this.On,this._n,this.persistence.getIndexManager()),this.Ke=e.getBundleCache(),this.xn.Vn(this.Mn)}return t.prototype.collectGarbage=function(e){var n=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",function(o){return e.collect(o,n.kn)})},t}();/** * @license * Copyright 2017 Google LLC * @@ -6002,7 +6002,7 @@ Total Duration: `+(c-d)+"ms"),Vo.resolve({didRun:!0,sequenceNumbersCollected:r,t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Ptt(t,e,n,o){return new pYn(t,e,n,o)}function Ctt(t,e){return vo(this,void 0,void 0,function(){var n,o,r,i;return Ao(this,function(a){switch(a.label){case 0:return n=Ir(t),o=n._n,r=n.Mn,[4,n.persistence.runTransaction("Handle user change","readonly",function(l){var s;return n._n.getAllMutationBatches(l).next(function(c){return s=c,o=n.persistence.getMutationQueue(e),r=new Stt(n.On,o,n.persistence.getIndexManager()),o.getAllMutationBatches(l)}).next(function(c){for(var u=[],d=[],f=Ks(),p=0,g=s;p0){var g=f.withResumeToken(p,o).withSequenceNumber(i.currentSequenceNumber);r=r.insert(d,g),function(y,w,b){return Wi(w.resumeToken.approximateByteSize()>0),y.resumeToken.approximateByteSize()===0||w.snapshotVersion.toMicroseconds()-y.snapshotVersion.toMicroseconds()>=3e8||b.addedDocuments.size+b.modifiedDocuments.size+b.removedDocuments.size>0}(f,g,u)&&l.push(n.qe.updateTargetData(i,g))}}});var s=U2();if(e.documentUpdates.forEach(function(u,d){e.resolvedLimboDocuments.has(u)&&l.push(n.persistence.referenceDelegate.updateLimboDocument(i,u))}),l.push(yYn(i,a,e.documentUpdates,o).next(function(u){s=u})),!o.isEqual(Na.min())){var c=n.qe.getLastRemoteSnapshotVersion(i).next(function(u){return n.qe.setTargetsMetadata(i,i.currentSequenceNumber,o)});l.push(c)}return Vo.waitFor(l).next(function(){return a.apply(i)}).next(function(){return n.Mn.En(i,s)}).next(function(){return s})}).then(function(i){return n.kn=r,i})}function yYn(t,e,n,o,r){var i=Ks();return n.forEach(function(a){return i=i.add(a)}),e.getEntries(t,i).next(function(a){var l=U2();return n.forEach(function(s,c){var u=a.get(s),d=o;c.isNoDocument()&&c.version.isEqual(Na.min())?(e.removeEntry(s,d),l=l.insert(s,c)):!u.isValidDocument()||c.version.compareTo(u.version)>0||c.version.compareTo(u.version)===0&&u.hasPendingWrites?(e.addEntry(c,d),l=l.insert(s,c)):ur("LocalStore","Ignoring outdated watch update for ",s,". Current version:",u.version," Watch version:",c.version)}),l})}function AYn(t,e){var n=Ir(t);return n.persistence.runTransaction("Get next mutation batch","readonly",function(o){return e===void 0&&(e=-1),n._n.getNextMutationBatchAfterBatchId(o,e)})}function NX(t,e){var n=Ir(t);return n.persistence.runTransaction("Allocate target","readwrite",function(o){var r;return n.qe.getTargetData(o,e).next(function(i){return i?(r=i,Vo.resolve(r)):n.qe.allocateTargetId(o).next(function(a){return r=new MZ(e,a,0,o.currentSequenceNumber),n.qe.addTargetData(o,r).next(function(){return r})})})}).then(function(o){var r=n.kn.get(o.targetId);return(r===null||o.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.kn=n.kn.insert(o.targetId,o),n.Fn.set(e,o.targetId)),o})}function VR(t,e,n){return vo(this,void 0,void 0,function(){var o,r,i,a;return Ao(this,function(l){switch(l.label){case 0:o=Ir(t),r=o.kn.get(e),i=n?"readwrite":"readwrite-primary",l.label=1;case 1:return l.trys.push([1,4,,5]),n?[3,3]:[4,o.persistence.runTransaction("Release target",i,function(s){return o.persistence.referenceDelegate.removeTarget(s,r)})];case 2:l.sent(),l.label=3;case 3:return[3,5];case 4:if(!Xb(a=l.sent()))throw a;return ur("LocalStore","Failed to update sequence numbers for target "+e+": "+a),[3,5];case 5:return o.kn=o.kn.remove(e),o.Fn.delete(r.target),[2]}})})}function UX(t,e,n){var o=Ir(t),r=Na.min(),i=Ks();return o.persistence.runTransaction("Execute query","readonly",function(a){return function(l,s,c){var u=Ir(l),d=u.Fn.get(c);return d!==void 0?Vo.resolve(u.kn.get(d)):u.qe.getTargetData(s,c)}(o,a,V9(e)).next(function(l){if(l)return r=l.lastLimboFreeSnapshotVersion,o.qe.getMatchingKeysForTargetId(a,l.targetId).next(function(s){i=s})}).next(function(){return o.xn.getDocumentsMatchingQuery(a,e,n?r:Na.min(),n?i:Ks())}).next(function(l){return{documents:l,Bn:i}})})}function Htt(t,e){var n=Ir(t),o=Ir(n.qe),r=n.kn.get(e);return r?Promise.resolve(r.target):n.persistence.runTransaction("Get target data","readonly",function(i){return o.lt(i,e).next(function(a){return a?a.target:null})})}function Mtt(t){var e=Ir(t);return e.persistence.runTransaction("Get new document changes","readonly",function(n){return function(o,r,i){var a=Ir(o),l=U2(),s=Q2e(i),c=q4(r),u=IDBKeyRange.lowerBound(s,!0);return c.$t({index:f0.readTimeIndex,range:u},function(d,f){var p=Vde(a.R,f);l=l.insert(p.key,p),s=f.readTime}).next(function(){return{wn:l,readTime:mtt(s)}})}(e.On,n,e.$n)}).then(function(n){var o=n.wn,r=n.readTime;return e.$n=r,o})}function wYn(t){return vo(this,void 0,void 0,function(){var e;return Ao(this,function(n){return[2,(e=Ir(t)).persistence.runTransaction("Synchronize last document change read time","readonly",function(o){return function(r){var i=q4(r),a=Na.min();return i.$t({index:f0.readTimeIndex,reverse:!0},function(l,s,c){s.readTime&&(a=mtt(s.readTime)),c.done()}).next(function(){return a})}(o)}).then(function(o){e.$n=o})]})})}/** + */function Ptt(t,e,n,o){return new pYn(t,e,n,o)}function Ctt(t,e){return vo(this,void 0,void 0,function(){var n,o,r,i;return Ao(this,function(a){switch(a.label){case 0:return n=Ir(t),o=n._n,r=n.Mn,[4,n.persistence.runTransaction("Handle user change","readonly",function(l){var s;return n._n.getAllMutationBatches(l).next(function(c){return s=c,o=n.persistence.getMutationQueue(e),r=new Stt(n.On,o,n.persistence.getIndexManager()),o.getAllMutationBatches(l)}).next(function(c){for(var u=[],d=[],f=Ks(),p=0,g=s;p0){var g=f.withResumeToken(p,o).withSequenceNumber(i.currentSequenceNumber);r=r.insert(d,g),function(y,w,b){return Wi(w.resumeToken.approximateByteSize()>0),y.resumeToken.approximateByteSize()===0||w.snapshotVersion.toMicroseconds()-y.snapshotVersion.toMicroseconds()>=3e8||b.addedDocuments.size+b.modifiedDocuments.size+b.removedDocuments.size>0}(f,g,u)&&l.push(n.qe.updateTargetData(i,g))}}});var s=U2();if(e.documentUpdates.forEach(function(u,d){e.resolvedLimboDocuments.has(u)&&l.push(n.persistence.referenceDelegate.updateLimboDocument(i,u))}),l.push(yYn(i,a,e.documentUpdates,o).next(function(u){s=u})),!o.isEqual(Na.min())){var c=n.qe.getLastRemoteSnapshotVersion(i).next(function(u){return n.qe.setTargetsMetadata(i,i.currentSequenceNumber,o)});l.push(c)}return Vo.waitFor(l).next(function(){return a.apply(i)}).next(function(){return n.Mn.En(i,s)}).next(function(){return s})}).then(function(i){return n.kn=r,i})}function yYn(t,e,n,o,r){var i=Ks();return n.forEach(function(a){return i=i.add(a)}),e.getEntries(t,i).next(function(a){var l=U2();return n.forEach(function(s,c){var u=a.get(s),d=o;c.isNoDocument()&&c.version.isEqual(Na.min())?(e.removeEntry(s,d),l=l.insert(s,c)):!u.isValidDocument()||c.version.compareTo(u.version)>0||c.version.compareTo(u.version)===0&&u.hasPendingWrites?(e.addEntry(c,d),l=l.insert(s,c)):ur("LocalStore","Ignoring outdated watch update for ",s,". Current version:",u.version," Watch version:",c.version)}),l})}function AYn(t,e){var n=Ir(t);return n.persistence.runTransaction("Get next mutation batch","readonly",function(o){return e===void 0&&(e=-1),n._n.getNextMutationBatchAfterBatchId(o,e)})}function UX(t,e){var n=Ir(t);return n.persistence.runTransaction("Allocate target","readwrite",function(o){var r;return n.qe.getTargetData(o,e).next(function(i){return i?(r=i,Vo.resolve(r)):n.qe.allocateTargetId(o).next(function(a){return r=new MZ(e,a,0,o.currentSequenceNumber),n.qe.addTargetData(o,r).next(function(){return r})})})}).then(function(o){var r=n.kn.get(o.targetId);return(r===null||o.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.kn=n.kn.insert(o.targetId,o),n.Fn.set(e,o.targetId)),o})}function VR(t,e,n){return vo(this,void 0,void 0,function(){var o,r,i,a;return Ao(this,function(l){switch(l.label){case 0:o=Ir(t),r=o.kn.get(e),i=n?"readwrite":"readwrite-primary",l.label=1;case 1:return l.trys.push([1,4,,5]),n?[3,3]:[4,o.persistence.runTransaction("Release target",i,function(s){return o.persistence.referenceDelegate.removeTarget(s,r)})];case 2:l.sent(),l.label=3;case 3:return[3,5];case 4:if(!Xb(a=l.sent()))throw a;return ur("LocalStore","Failed to update sequence numbers for target "+e+": "+a),[3,5];case 5:return o.kn=o.kn.remove(e),o.Fn.delete(r.target),[2]}})})}function jX(t,e,n){var o=Ir(t),r=Na.min(),i=Ks();return o.persistence.runTransaction("Execute query","readonly",function(a){return function(l,s,c){var u=Ir(l),d=u.Fn.get(c);return d!==void 0?Vo.resolve(u.kn.get(d)):u.qe.getTargetData(s,c)}(o,a,V9(e)).next(function(l){if(l)return r=l.lastLimboFreeSnapshotVersion,o.qe.getMatchingKeysForTargetId(a,l.targetId).next(function(s){i=s})}).next(function(){return o.xn.getDocumentsMatchingQuery(a,e,n?r:Na.min(),n?i:Ks())}).next(function(l){return{documents:l,Bn:i}})})}function Htt(t,e){var n=Ir(t),o=Ir(n.qe),r=n.kn.get(e);return r?Promise.resolve(r.target):n.persistence.runTransaction("Get target data","readonly",function(i){return o.lt(i,e).next(function(a){return a?a.target:null})})}function Mtt(t){var e=Ir(t);return e.persistence.runTransaction("Get new document changes","readonly",function(n){return function(o,r,i){var a=Ir(o),l=U2(),s=Z2e(i),c=q4(r),u=IDBKeyRange.lowerBound(s,!0);return c.$t({index:f0.readTimeIndex,range:u},function(d,f){var p=Vde(a.R,f);l=l.insert(p.key,p),s=f.readTime}).next(function(){return{wn:l,readTime:mtt(s)}})}(e.On,n,e.$n)}).then(function(n){var o=n.wn,r=n.readTime;return e.$n=r,o})}function wYn(t){return vo(this,void 0,void 0,function(){var e;return Ao(this,function(n){return[2,(e=Ir(t)).persistence.runTransaction("Synchronize last document change read time","readonly",function(o){return function(r){var i=q4(r),a=Na.min();return i.$t({index:f0.readTimeIndex,reverse:!0},function(l,s,c){s.readTime&&(a=mtt(s.readTime)),c.done()}).next(function(){return a})}(o)}).then(function(o){e.$n=o})]})})}/** * @license * Copyright 2020 Google LLC * @@ -6017,7 +6017,7 @@ Total Duration: `+(c-d)+"ms"),Vo.resolve({didRun:!0,sequenceNumbersCollected:r,t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var vYn=function(){function t(e){this.R=e,this.Qn=new Map,this.jn=new Map}return t.prototype.getBundleMetadata=function(e,n){return Vo.resolve(this.Qn.get(n))},t.prototype.saveBundleMetadata=function(e,n){var o;return this.Qn.set(n.id,{id:(o=n).id,version:o.version,createTime:ap(o.createTime)}),Vo.resolve()},t.prototype.getNamedQuery=function(e,n){return Vo.resolve(this.jn.get(n))},t.prototype.saveNamedQuery=function(e,n){return this.jn.set(n.name,function(o){return{name:o.name,query:Att(o.bundledQuery),readTime:ap(o.readTime)}}(n)),Vo.resolve()},t}(),t5e=function(){function t(){this.Wn=new ju(yd.Gn),this.zn=new ju(yd.Hn)}return t.prototype.isEmpty=function(){return this.Wn.isEmpty()},t.prototype.addReference=function(e,n){var o=new yd(e,n);this.Wn=this.Wn.add(o),this.zn=this.zn.add(o)},t.prototype.Jn=function(e,n){var o=this;e.forEach(function(r){return o.addReference(r,n)})},t.prototype.removeReference=function(e,n){this.Yn(new yd(e,n))},t.prototype.Xn=function(e,n){var o=this;e.forEach(function(r){return o.removeReference(r,n)})},t.prototype.Zn=function(e){var n=this,o=new ci(new Ol([])),r=new yd(o,e),i=new yd(o,e+1),a=[];return this.zn.forEachInRange([r,i],function(l){n.Yn(l),a.push(l.key)}),a},t.prototype.ts=function(){var e=this;this.Wn.forEach(function(n){return e.Yn(n)})},t.prototype.Yn=function(e){this.Wn=this.Wn.delete(e),this.zn=this.zn.delete(e)},t.prototype.es=function(e){var n=new ci(new Ol([])),o=new yd(n,e),r=new yd(n,e+1),i=Ks();return this.zn.forEachInRange([o,r],function(a){i=i.add(a.key)}),i},t.prototype.containsKey=function(e){var n=new yd(e,0),o=this.Wn.firstAfterOrEqual(n);return o!==null&&e.isEqual(o.key)},t}(),yd=function(){function t(e,n){this.key=e,this.ns=n}return t.Gn=function(e,n){return ci.comparator(e.key,n.key)||$a(e.ns,n.ns)},t.Hn=function(e,n){return $a(e.ns,n.ns)||ci.comparator(e.key,n.key)},t}(),xYn=function(){function t(e,n){this.Ut=e,this.referenceDelegate=n,this._n=[],this.ss=1,this.rs=new ju(yd.Gn)}return t.prototype.checkEmpty=function(e){return Vo.resolve(this._n.length===0)},t.prototype.addMutationBatch=function(e,n,o,r){var i=this.ss;this.ss++,this._n.length>0&&this._n[this._n.length-1];var a=new $2e(i,n,o,r);this._n.push(a);for(var l=0,s=r;li?this._n[i]:null)},t.prototype.getHighestUnacknowledgedBatchId=function(){return Vo.resolve(this._n.length===0?-1:this.ss-1)},t.prototype.getAllMutationBatches=function(e){return Vo.resolve(this._n.slice())},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,n){var o=this,r=new yd(n,0),i=new yd(n,Number.POSITIVE_INFINITY),a=[];return this.rs.forEachInRange([r,i],function(l){var s=o.os(l.ns);a.push(s)}),Vo.resolve(a)},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(e,n){var o=this,r=new ju($a);return n.forEach(function(i){var a=new yd(i,0),l=new yd(i,Number.POSITIVE_INFINITY);o.rs.forEachInRange([a,l],function(s){r=r.add(s.ns)})}),Vo.resolve(this.us(r))},t.prototype.getAllMutationBatchesAffectingQuery=function(e,n){var o=n.path,r=o.length+1,i=o;ci.isDocumentKey(i)||(i=i.child(""));var a=new yd(new ci(i),0),l=new ju($a);return this.rs.forEachWhile(function(s){var c=s.key.path;return!!o.isPrefixOf(c)&&(c.length===r&&(l=l.add(s.ns)),!0)},a),Vo.resolve(this.us(l))},t.prototype.us=function(e){var n=this,o=[];return e.forEach(function(r){var i=n.os(r);i!==null&&o.push(i)}),o},t.prototype.removeMutationBatch=function(e,n){var o=this;Wi(this.hs(n.batchId,"removed")===0),this._n.shift();var r=this.rs;return Vo.forEach(n.mutations,function(i){var a=new yd(i.key,n.batchId);return r=r.delete(a),o.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(function(){o.rs=r})},t.prototype.Gt=function(e){},t.prototype.containsKey=function(e,n){var o=new yd(n,0),r=this.rs.firstAfterOrEqual(o);return Vo.resolve(n.isEqual(r&&r.key))},t.prototype.performConsistencyCheck=function(e){return this._n.length,Vo.resolve()},t.prototype.hs=function(e,n){return this.cs(e)},t.prototype.cs=function(e){return this._n.length===0?0:e-this._n[0].batchId},t.prototype.os=function(e){var n=this.cs(e);return n<0||n>=this._n.length?null:this._n[n]},t}(),bYn=function(){function t(e,n){this.Ut=e,this.ls=n,this.docs=new Th(ci.comparator),this.size=0}return t.prototype.addEntry=function(e,n,o){var r=n.key,i=this.docs.get(r),a=i?i.size:0,l=this.ls(n);return this.docs=this.docs.insert(r,{document:n.clone(),size:l,readTime:o}),this.size+=l-a,this.Ut.addToCollectionParentIndex(e,r.path.popLast())},t.prototype.removeEntry=function(e){var n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)},t.prototype.getEntry=function(e,n){var o=this.docs.get(n);return Vo.resolve(o?o.document.clone():wh.newInvalidDocument(n))},t.prototype.getEntries=function(e,n){var o=this,r=U2();return n.forEach(function(i){var a=o.docs.get(i);r=r.insert(i,a?a.document.clone():wh.newInvalidDocument(i))}),Vo.resolve(r)},t.prototype.getDocumentsMatchingQuery=function(e,n,o){for(var r=U2(),i=new ci(n.path.child("")),a=this.docs.getIteratorFrom(i);a.hasNext();){var l=a.getNext(),s=l.key,c=l.value,u=c.document,d=c.readTime;if(!n.path.isPrefixOf(s.path))break;d.compareTo(o)<=0||LN(n,u)&&(r=r.insert(u.key,u.clone()))}return Vo.resolve(r)},t.prototype.fs=function(e,n){return Vo.forEach(this.docs,function(o){return n(o)})},t.prototype.newChangeBuffer=function(e){return new SYn(this)},t.prototype.getSize=function(e){return Vo.resolve(this.size)},t}(),SYn=function(t){function e(n){var o=this;return(o=t.call(this)||this).Ie=n,o}return Pr(e,t),e.prototype.applyChanges=function(n){var o=this,r=[];return this.changes.forEach(function(i,a){a.document.isValidDocument()?r.push(o.Ie.addEntry(n,a.document,o.getReadTime(i))):o.Ie.removeEntry(i)}),Vo.waitFor(r)},e.prototype.getFromCache=function(n,o){return this.Ie.getEntry(n,o)},e.prototype.getAllFromCache=function(n,o){return this.Ie.getEntries(n,o)},e}(btt),TYn=function(){function t(e){this.persistence=e,this.ds=new iM(function(n){return EN(n)},PZ),this.lastRemoteSnapshotVersion=Na.min(),this.highestTargetId=0,this.ws=0,this._s=new t5e,this.targetCount=0,this.ys=WX.Jt()}return t.prototype.forEachTarget=function(e,n){return this.ds.forEach(function(o,r){return n(r)}),Vo.resolve()},t.prototype.getLastRemoteSnapshotVersion=function(e){return Vo.resolve(this.lastRemoteSnapshotVersion)},t.prototype.getHighestSequenceNumber=function(e){return Vo.resolve(this.ws)},t.prototype.allocateTargetId=function(e){return this.highestTargetId=this.ys.next(),Vo.resolve(this.highestTargetId)},t.prototype.setTargetsMetadata=function(e,n,o){return o&&(this.lastRemoteSnapshotVersion=o),n>this.ws&&(this.ws=n),Vo.resolve()},t.prototype.te=function(e){this.ds.set(e.target,e);var n=e.targetId;n>this.highestTargetId&&(this.ys=new WX(n),this.highestTargetId=n),e.sequenceNumber>this.ws&&(this.ws=e.sequenceNumber)},t.prototype.addTargetData=function(e,n){return this.te(n),this.targetCount+=1,Vo.resolve()},t.prototype.updateTargetData=function(e,n){return this.te(n),Vo.resolve()},t.prototype.removeTargetData=function(e,n){return this.ds.delete(n.target),this._s.Zn(n.targetId),this.targetCount-=1,Vo.resolve()},t.prototype.removeTargets=function(e,n,o){var r=this,i=0,a=[];return this.ds.forEach(function(l,s){s.sequenceNumber<=n&&o.get(s.targetId)===null&&(r.ds.delete(l),a.push(r.removeMatchingKeysForTargetId(e,s.targetId)),i++)}),Vo.waitFor(a).next(function(){return i})},t.prototype.getTargetCount=function(e){return Vo.resolve(this.targetCount)},t.prototype.getTargetData=function(e,n){var o=this.ds.get(n)||null;return Vo.resolve(o)},t.prototype.addMatchingKeys=function(e,n,o){return this._s.Jn(n,o),Vo.resolve()},t.prototype.removeMatchingKeys=function(e,n,o){this._s.Xn(n,o);var r=this.persistence.referenceDelegate,i=[];return r&&n.forEach(function(a){i.push(r.markPotentiallyOrphaned(e,a))}),Vo.waitFor(i)},t.prototype.removeMatchingKeysForTargetId=function(e,n){return this._s.Zn(n),Vo.resolve()},t.prototype.getMatchingKeysForTargetId=function(e,n){var o=this._s.es(n);return Vo.resolve(o)},t.prototype.containsKey=function(e,n){return Vo.resolve(this._s.containsKey(n))},t}(),PYn=function(){function t(e,n){var o=this;this.gs={},this.Ne=new wg(0),this.xe=!1,this.xe=!0,this.referenceDelegate=e(this),this.qe=new TYn(this),this.Ut=new tYn,this.Ue=function(r,i){return new bYn(r,function(a){return o.referenceDelegate.ps(a)})}(this.Ut),this.R=new gtt(n),this.Ke=new vYn(this.R)}return t.prototype.start=function(){return Promise.resolve()},t.prototype.shutdown=function(){return this.xe=!1,Promise.resolve()},Object.defineProperty(t.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),t.prototype.setDatabaseDeletedListener=function(){},t.prototype.setNetworkEnabled=function(){},t.prototype.getIndexManager=function(){return this.Ut},t.prototype.getMutationQueue=function(e){var n=this.gs[e.toKey()];return n||(n=new xYn(this.Ut,this.referenceDelegate),this.gs[e.toKey()]=n),n},t.prototype.getTargetCache=function(){return this.qe},t.prototype.getRemoteDocumentCache=function(){return this.Ue},t.prototype.getBundleCache=function(){return this.Ke},t.prototype.runTransaction=function(e,n,o){var r=this;ur("MemoryPersistence","Starting transaction:",e);var i=new CYn(this.Ne.next());return this.referenceDelegate.Es(),o(i).next(function(a){return r.referenceDelegate.Ts(i).next(function(){return a})}).toPromise().then(function(a){return i.raiseOnCommittedEvent(),a})},t.prototype.Is=function(e,n){return Vo.or(Object.values(this.gs).map(function(o){return function(){return o.containsKey(e,n)}}))},t}(),CYn=function(t){function e(n){var o=this;return(o=t.call(this)||this).currentSequenceNumber=n,o}return Pr(e,t),e}(htt),RYn=function(){function t(e){this.persistence=e,this.As=new t5e,this.Rs=null}return t.bs=function(e){return new t(e)},Object.defineProperty(t.prototype,"vs",{get:function(){if(this.Rs)return this.Rs;throw ri()},enumerable:!1,configurable:!0}),t.prototype.addReference=function(e,n,o){return this.As.addReference(o,n),this.vs.delete(o.toString()),Vo.resolve()},t.prototype.removeReference=function(e,n,o){return this.As.removeReference(o,n),this.vs.add(o.toString()),Vo.resolve()},t.prototype.markPotentiallyOrphaned=function(e,n){return this.vs.add(n.toString()),Vo.resolve()},t.prototype.removeTarget=function(e,n){var o=this;this.As.Zn(n.targetId).forEach(function(i){return o.vs.add(i.toString())});var r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next(function(i){i.forEach(function(a){return o.vs.add(a.toString())})}).next(function(){return r.removeTargetData(e,n)})},t.prototype.Es=function(){this.Rs=new Set},t.prototype.Ts=function(e){var n=this,o=this.persistence.getRemoteDocumentCache().newChangeBuffer();return Vo.forEach(this.vs,function(r){var i=ci.fromPath(r);return n.Ps(e,i).next(function(a){a||o.removeEntry(i)})}).next(function(){return n.Rs=null,o.apply(e)})},t.prototype.updateLimboDocument=function(e,n){var o=this;return this.Ps(e,n).next(function(r){r?o.vs.delete(n.toString()):o.vs.add(n.toString())})},t.prototype.ps=function(e){return 0},t.prototype.Ps=function(e,n){var o=this;return Vo.or([function(){return Vo.resolve(o.As.containsKey(n))},function(){return o.persistence.getTargetCache().containsKey(e,n)},function(){return o.persistence.Is(e,n)}])},t}(),cf=function(){function t(e){this.uid=e}return t.prototype.isAuthenticated=function(){return this.uid!=null},t.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},t.prototype.isEqual=function(e){return e.uid===this.uid},t}();/** + */var vYn=function(){function t(e){this.R=e,this.Qn=new Map,this.jn=new Map}return t.prototype.getBundleMetadata=function(e,n){return Vo.resolve(this.Qn.get(n))},t.prototype.saveBundleMetadata=function(e,n){var o;return this.Qn.set(n.id,{id:(o=n).id,version:o.version,createTime:ap(o.createTime)}),Vo.resolve()},t.prototype.getNamedQuery=function(e,n){return Vo.resolve(this.jn.get(n))},t.prototype.saveNamedQuery=function(e,n){return this.jn.set(n.name,function(o){return{name:o.name,query:Att(o.bundledQuery),readTime:ap(o.readTime)}}(n)),Vo.resolve()},t}(),n5e=function(){function t(){this.Wn=new ju(yd.Gn),this.zn=new ju(yd.Hn)}return t.prototype.isEmpty=function(){return this.Wn.isEmpty()},t.prototype.addReference=function(e,n){var o=new yd(e,n);this.Wn=this.Wn.add(o),this.zn=this.zn.add(o)},t.prototype.Jn=function(e,n){var o=this;e.forEach(function(r){return o.addReference(r,n)})},t.prototype.removeReference=function(e,n){this.Yn(new yd(e,n))},t.prototype.Xn=function(e,n){var o=this;e.forEach(function(r){return o.removeReference(r,n)})},t.prototype.Zn=function(e){var n=this,o=new ci(new Ol([])),r=new yd(o,e),i=new yd(o,e+1),a=[];return this.zn.forEachInRange([r,i],function(l){n.Yn(l),a.push(l.key)}),a},t.prototype.ts=function(){var e=this;this.Wn.forEach(function(n){return e.Yn(n)})},t.prototype.Yn=function(e){this.Wn=this.Wn.delete(e),this.zn=this.zn.delete(e)},t.prototype.es=function(e){var n=new ci(new Ol([])),o=new yd(n,e),r=new yd(n,e+1),i=Ks();return this.zn.forEachInRange([o,r],function(a){i=i.add(a.key)}),i},t.prototype.containsKey=function(e){var n=new yd(e,0),o=this.Wn.firstAfterOrEqual(n);return o!==null&&e.isEqual(o.key)},t}(),yd=function(){function t(e,n){this.key=e,this.ns=n}return t.Gn=function(e,n){return ci.comparator(e.key,n.key)||$a(e.ns,n.ns)},t.Hn=function(e,n){return $a(e.ns,n.ns)||ci.comparator(e.key,n.key)},t}(),xYn=function(){function t(e,n){this.Ut=e,this.referenceDelegate=n,this._n=[],this.ss=1,this.rs=new ju(yd.Gn)}return t.prototype.checkEmpty=function(e){return Vo.resolve(this._n.length===0)},t.prototype.addMutationBatch=function(e,n,o,r){var i=this.ss;this.ss++,this._n.length>0&&this._n[this._n.length-1];var a=new Q2e(i,n,o,r);this._n.push(a);for(var l=0,s=r;li?this._n[i]:null)},t.prototype.getHighestUnacknowledgedBatchId=function(){return Vo.resolve(this._n.length===0?-1:this.ss-1)},t.prototype.getAllMutationBatches=function(e){return Vo.resolve(this._n.slice())},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,n){var o=this,r=new yd(n,0),i=new yd(n,Number.POSITIVE_INFINITY),a=[];return this.rs.forEachInRange([r,i],function(l){var s=o.os(l.ns);a.push(s)}),Vo.resolve(a)},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(e,n){var o=this,r=new ju($a);return n.forEach(function(i){var a=new yd(i,0),l=new yd(i,Number.POSITIVE_INFINITY);o.rs.forEachInRange([a,l],function(s){r=r.add(s.ns)})}),Vo.resolve(this.us(r))},t.prototype.getAllMutationBatchesAffectingQuery=function(e,n){var o=n.path,r=o.length+1,i=o;ci.isDocumentKey(i)||(i=i.child(""));var a=new yd(new ci(i),0),l=new ju($a);return this.rs.forEachWhile(function(s){var c=s.key.path;return!!o.isPrefixOf(c)&&(c.length===r&&(l=l.add(s.ns)),!0)},a),Vo.resolve(this.us(l))},t.prototype.us=function(e){var n=this,o=[];return e.forEach(function(r){var i=n.os(r);i!==null&&o.push(i)}),o},t.prototype.removeMutationBatch=function(e,n){var o=this;Wi(this.hs(n.batchId,"removed")===0),this._n.shift();var r=this.rs;return Vo.forEach(n.mutations,function(i){var a=new yd(i.key,n.batchId);return r=r.delete(a),o.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(function(){o.rs=r})},t.prototype.Gt=function(e){},t.prototype.containsKey=function(e,n){var o=new yd(n,0),r=this.rs.firstAfterOrEqual(o);return Vo.resolve(n.isEqual(r&&r.key))},t.prototype.performConsistencyCheck=function(e){return this._n.length,Vo.resolve()},t.prototype.hs=function(e,n){return this.cs(e)},t.prototype.cs=function(e){return this._n.length===0?0:e-this._n[0].batchId},t.prototype.os=function(e){var n=this.cs(e);return n<0||n>=this._n.length?null:this._n[n]},t}(),bYn=function(){function t(e,n){this.Ut=e,this.ls=n,this.docs=new Th(ci.comparator),this.size=0}return t.prototype.addEntry=function(e,n,o){var r=n.key,i=this.docs.get(r),a=i?i.size:0,l=this.ls(n);return this.docs=this.docs.insert(r,{document:n.clone(),size:l,readTime:o}),this.size+=l-a,this.Ut.addToCollectionParentIndex(e,r.path.popLast())},t.prototype.removeEntry=function(e){var n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)},t.prototype.getEntry=function(e,n){var o=this.docs.get(n);return Vo.resolve(o?o.document.clone():wh.newInvalidDocument(n))},t.prototype.getEntries=function(e,n){var o=this,r=U2();return n.forEach(function(i){var a=o.docs.get(i);r=r.insert(i,a?a.document.clone():wh.newInvalidDocument(i))}),Vo.resolve(r)},t.prototype.getDocumentsMatchingQuery=function(e,n,o){for(var r=U2(),i=new ci(n.path.child("")),a=this.docs.getIteratorFrom(i);a.hasNext();){var l=a.getNext(),s=l.key,c=l.value,u=c.document,d=c.readTime;if(!n.path.isPrefixOf(s.path))break;d.compareTo(o)<=0||WN(n,u)&&(r=r.insert(u.key,u.clone()))}return Vo.resolve(r)},t.prototype.fs=function(e,n){return Vo.forEach(this.docs,function(o){return n(o)})},t.prototype.newChangeBuffer=function(e){return new SYn(this)},t.prototype.getSize=function(e){return Vo.resolve(this.size)},t}(),SYn=function(t){function e(n){var o=this;return(o=t.call(this)||this).Ie=n,o}return Pr(e,t),e.prototype.applyChanges=function(n){var o=this,r=[];return this.changes.forEach(function(i,a){a.document.isValidDocument()?r.push(o.Ie.addEntry(n,a.document,o.getReadTime(i))):o.Ie.removeEntry(i)}),Vo.waitFor(r)},e.prototype.getFromCache=function(n,o){return this.Ie.getEntry(n,o)},e.prototype.getAllFromCache=function(n,o){return this.Ie.getEntries(n,o)},e}(btt),TYn=function(){function t(e){this.persistence=e,this.ds=new iM(function(n){return FN(n)},PZ),this.lastRemoteSnapshotVersion=Na.min(),this.highestTargetId=0,this.ws=0,this._s=new n5e,this.targetCount=0,this.ys=NX.Jt()}return t.prototype.forEachTarget=function(e,n){return this.ds.forEach(function(o,r){return n(r)}),Vo.resolve()},t.prototype.getLastRemoteSnapshotVersion=function(e){return Vo.resolve(this.lastRemoteSnapshotVersion)},t.prototype.getHighestSequenceNumber=function(e){return Vo.resolve(this.ws)},t.prototype.allocateTargetId=function(e){return this.highestTargetId=this.ys.next(),Vo.resolve(this.highestTargetId)},t.prototype.setTargetsMetadata=function(e,n,o){return o&&(this.lastRemoteSnapshotVersion=o),n>this.ws&&(this.ws=n),Vo.resolve()},t.prototype.te=function(e){this.ds.set(e.target,e);var n=e.targetId;n>this.highestTargetId&&(this.ys=new NX(n),this.highestTargetId=n),e.sequenceNumber>this.ws&&(this.ws=e.sequenceNumber)},t.prototype.addTargetData=function(e,n){return this.te(n),this.targetCount+=1,Vo.resolve()},t.prototype.updateTargetData=function(e,n){return this.te(n),Vo.resolve()},t.prototype.removeTargetData=function(e,n){return this.ds.delete(n.target),this._s.Zn(n.targetId),this.targetCount-=1,Vo.resolve()},t.prototype.removeTargets=function(e,n,o){var r=this,i=0,a=[];return this.ds.forEach(function(l,s){s.sequenceNumber<=n&&o.get(s.targetId)===null&&(r.ds.delete(l),a.push(r.removeMatchingKeysForTargetId(e,s.targetId)),i++)}),Vo.waitFor(a).next(function(){return i})},t.prototype.getTargetCount=function(e){return Vo.resolve(this.targetCount)},t.prototype.getTargetData=function(e,n){var o=this.ds.get(n)||null;return Vo.resolve(o)},t.prototype.addMatchingKeys=function(e,n,o){return this._s.Jn(n,o),Vo.resolve()},t.prototype.removeMatchingKeys=function(e,n,o){this._s.Xn(n,o);var r=this.persistence.referenceDelegate,i=[];return r&&n.forEach(function(a){i.push(r.markPotentiallyOrphaned(e,a))}),Vo.waitFor(i)},t.prototype.removeMatchingKeysForTargetId=function(e,n){return this._s.Zn(n),Vo.resolve()},t.prototype.getMatchingKeysForTargetId=function(e,n){var o=this._s.es(n);return Vo.resolve(o)},t.prototype.containsKey=function(e,n){return Vo.resolve(this._s.containsKey(n))},t}(),PYn=function(){function t(e,n){var o=this;this.gs={},this.Ne=new wg(0),this.xe=!1,this.xe=!0,this.referenceDelegate=e(this),this.qe=new TYn(this),this.Ut=new tYn,this.Ue=function(r,i){return new bYn(r,function(a){return o.referenceDelegate.ps(a)})}(this.Ut),this.R=new gtt(n),this.Ke=new vYn(this.R)}return t.prototype.start=function(){return Promise.resolve()},t.prototype.shutdown=function(){return this.xe=!1,Promise.resolve()},Object.defineProperty(t.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),t.prototype.setDatabaseDeletedListener=function(){},t.prototype.setNetworkEnabled=function(){},t.prototype.getIndexManager=function(){return this.Ut},t.prototype.getMutationQueue=function(e){var n=this.gs[e.toKey()];return n||(n=new xYn(this.Ut,this.referenceDelegate),this.gs[e.toKey()]=n),n},t.prototype.getTargetCache=function(){return this.qe},t.prototype.getRemoteDocumentCache=function(){return this.Ue},t.prototype.getBundleCache=function(){return this.Ke},t.prototype.runTransaction=function(e,n,o){var r=this;ur("MemoryPersistence","Starting transaction:",e);var i=new CYn(this.Ne.next());return this.referenceDelegate.Es(),o(i).next(function(a){return r.referenceDelegate.Ts(i).next(function(){return a})}).toPromise().then(function(a){return i.raiseOnCommittedEvent(),a})},t.prototype.Is=function(e,n){return Vo.or(Object.values(this.gs).map(function(o){return function(){return o.containsKey(e,n)}}))},t}(),CYn=function(t){function e(n){var o=this;return(o=t.call(this)||this).currentSequenceNumber=n,o}return Pr(e,t),e}(htt),RYn=function(){function t(e){this.persistence=e,this.As=new n5e,this.Rs=null}return t.bs=function(e){return new t(e)},Object.defineProperty(t.prototype,"vs",{get:function(){if(this.Rs)return this.Rs;throw ri()},enumerable:!1,configurable:!0}),t.prototype.addReference=function(e,n,o){return this.As.addReference(o,n),this.vs.delete(o.toString()),Vo.resolve()},t.prototype.removeReference=function(e,n,o){return this.As.removeReference(o,n),this.vs.add(o.toString()),Vo.resolve()},t.prototype.markPotentiallyOrphaned=function(e,n){return this.vs.add(n.toString()),Vo.resolve()},t.prototype.removeTarget=function(e,n){var o=this;this.As.Zn(n.targetId).forEach(function(i){return o.vs.add(i.toString())});var r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next(function(i){i.forEach(function(a){return o.vs.add(a.toString())})}).next(function(){return r.removeTargetData(e,n)})},t.prototype.Es=function(){this.Rs=new Set},t.prototype.Ts=function(e){var n=this,o=this.persistence.getRemoteDocumentCache().newChangeBuffer();return Vo.forEach(this.vs,function(r){var i=ci.fromPath(r);return n.Ps(e,i).next(function(a){a||o.removeEntry(i)})}).next(function(){return n.Rs=null,o.apply(e)})},t.prototype.updateLimboDocument=function(e,n){var o=this;return this.Ps(e,n).next(function(r){r?o.vs.delete(n.toString()):o.vs.add(n.toString())})},t.prototype.ps=function(e){return 0},t.prototype.Ps=function(e,n){var o=this;return Vo.or([function(){return Vo.resolve(o.As.containsKey(n))},function(){return o.persistence.getTargetCache().containsKey(e,n)},function(){return o.persistence.Is(e,n)}])},t}(),cf=function(){function t(e){this.uid=e}return t.prototype.isAuthenticated=function(){return this.uid!=null},t.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},t.prototype.isEqual=function(e){return e.uid===this.uid},t}();/** * @license * Copyright 2017 Google LLC * @@ -6032,7 +6032,7 @@ Total Duration: `+(c-d)+"ms"),Vo.resolve({didRun:!0,sequenceNumbersCollected:r,t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function ZPe(t,e){return"firestore_clients_"+t+"_"+e}function eCe(t,e,n){var o="firestore_mutations_"+t+"_"+n;return e.isAuthenticated()&&(o+="_"+e.uid),o}function wae(t,e){return"firestore_targets_"+t+"_"+e}cf.UNAUTHENTICATED=new cf(null),cf.GOOGLE_CREDENTIALS=new cf("google-credentials-uid"),cf.FIRST_PARTY=new cf("first-party-uid"),cf.MOCK_USER=new cf("mock-user");var tCe=function(){function t(e,n,o,r){this.user=e,this.batchId=n,this.state=o,this.error=r}return t.Vs=function(e,n,o){var r,i=JSON.parse(o),a=typeof i=="object"&&["pending","acknowledged","rejected"].indexOf(i.state)!==-1&&(i.error===void 0||typeof i.error=="object");return a&&i.error&&(a=typeof i.error.message=="string"&&typeof i.error.code=="string")&&(r=new ko(i.error.code,i.error.message)),a?new t(e,n,i.state,r):(cu("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+o),null)},t.prototype.Ss=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},t}(),vae=function(){function t(e,n,o){this.targetId=e,this.state=n,this.error=o}return t.Vs=function(e,n){var o,r=JSON.parse(n),i=typeof r=="object"&&["not-current","current","rejected"].indexOf(r.state)!==-1&&(r.error===void 0||typeof r.error=="object");return i&&r.error&&(i=typeof r.error.message=="string"&&typeof r.error.code=="string")&&(o=new ko(r.error.code,r.error.message)),i?new t(e,r.state,o):(cu("SharedClientState","Failed to parse target state for ID '"+e+"': "+n),null)},t.prototype.Ss=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},t}(),nCe=function(){function t(e,n){this.clientId=e,this.activeTargetIds=n}return t.Vs=function(e,n){for(var o=JSON.parse(n),r=typeof o=="object"&&o.activeTargetIds instanceof Array,i=HZ(),a=0;r&&a0){var f=s.getResponseJson().error;if(f&&f.status&&f.message){var p=function(g){var y=g.toLowerCase().replace(/_/g,"-");return Object.values(On).indexOf(y)>=0?y:On.UNKNOWN}(f.status);l(new ko(p,f.message))}else l(new ko(On.UNKNOWN,"Server responded with status "+s.getStatus()))}else l(new ko(On.UNAVAILABLE,"Connection failed."));break;default:ri()}}finally{ur("Connection",'RPC "'+n+'" completed.')}});var c=JSON.stringify(i);s.send(o,"POST",c,r,15)})},e.prototype.Oi=function(n,o){var r=[this.Di,"/","google.firestore.v1.Firestore","/",n,"/channel"],i=oBn(),a=rBn(),l={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(l.xmlHttpFactory=new lBn({})),this.ki(l.initMessageHeaders,o),d2e()||xZe()||dUn()||fUn()||hUn()||uUn()||(l.httpHeadersOverwriteParam="$httpHeaders");var s=r.join("");ur("Connection","Creating WebChannel: "+s,l);var c=i.createWebChannel(s,l),u=!1,d=!1,f=new zYn({Ei:function(g){d?ur("Connection","Not sending because WebChannel is closed:",g):(u||(ur("Connection","Opening WebChannel transport."),c.open(),u=!0),ur("Connection","WebChannel sending:",g),c.send(g))},Ti:function(){return c.close()}}),p=function(g,y,w){g.listen(y,function(b){try{w(b)}catch(C){setTimeout(function(){throw C},0)}})};return p(c,PO.EventType.OPEN,function(){d||ur("Connection","WebChannel transport opened.")}),p(c,PO.EventType.CLOSE,function(){d||(d=!0,ur("Connection","WebChannel transport closed"),f.Vi())}),p(c,PO.EventType.ERROR,function(g){d||(d=!0,MX("Connection","WebChannel transport errored:",g),f.Vi(new ko(On.UNAVAILABLE,"The operation could not be completed")))}),p(c,PO.EventType.MESSAGE,function(g){var y;if(!d){var w=g.data[0];Wi(!!w);var b=w,C=b.error||((y=b[0])===null||y===void 0?void 0:y.error);if(C){ur("Connection","WebChannel received error:",C);var P=C.status,v=function(A){var x=tu[A];if(x!==void 0)return ett(x)}(P),T=C.message;v===void 0&&(v=On.INTERNAL,T="Unknown error status: "+P+" with message "+C.message),d=!0,f.Vi(new ko(v,T)),c.close()}else ur("Connection","WebChannel received:",w),f.Si(w)}}),p(a,aBn.STAT_EVENT,function(g){g.stat===vPe.PROXY?ur("Connection","Detected buffering proxy"):g.stat===vPe.NOPROXY&&ur("Connection","Detected no buffering proxy")}),setTimeout(function(){f.Pi()},0),f},e}(function(){function t(e){this.databaseInfo=e,this.databaseId=e.databaseId;var n=e.ssl?"https":"http";this.Di=n+"://"+e.host,this.Ci="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}return t.prototype.Ni=function(e,n,o,r){var i=this.xi(e,n);ur("RestConnection","Sending: ",i,o);var a={};return this.ki(a,r),this.Fi(e,i,a,o).then(function(l){return ur("RestConnection","Received: ",l),l},function(l){throw MX("RestConnection",e+" failed with error: ",l,"url: ",i,"request:",o),l})},t.prototype.$i=function(e,n,o,r){return this.Ni(e,n,o,r)},t.prototype.ki=function(e,n){if(e["X-Goog-Api-Client"]="gl-js/ fire/8.10.1",e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),n)for(var o in n.authHeaders)n.authHeaders.hasOwnProperty(o)&&(e[o]=n.authHeaders[o])},t.prototype.xi=function(e,n){var o=IYn[e];return this.Di+"/v1/"+n+":"+o},t}());/** + */function eCe(t,e){return"firestore_clients_"+t+"_"+e}function tCe(t,e,n){var o="firestore_mutations_"+t+"_"+n;return e.isAuthenticated()&&(o+="_"+e.uid),o}function wae(t,e){return"firestore_targets_"+t+"_"+e}cf.UNAUTHENTICATED=new cf(null),cf.GOOGLE_CREDENTIALS=new cf("google-credentials-uid"),cf.FIRST_PARTY=new cf("first-party-uid"),cf.MOCK_USER=new cf("mock-user");var nCe=function(){function t(e,n,o,r){this.user=e,this.batchId=n,this.state=o,this.error=r}return t.Vs=function(e,n,o){var r,i=JSON.parse(o),a=typeof i=="object"&&["pending","acknowledged","rejected"].indexOf(i.state)!==-1&&(i.error===void 0||typeof i.error=="object");return a&&i.error&&(a=typeof i.error.message=="string"&&typeof i.error.code=="string")&&(r=new ko(i.error.code,i.error.message)),a?new t(e,n,i.state,r):(cu("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+o),null)},t.prototype.Ss=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},t}(),vae=function(){function t(e,n,o){this.targetId=e,this.state=n,this.error=o}return t.Vs=function(e,n){var o,r=JSON.parse(n),i=typeof r=="object"&&["not-current","current","rejected"].indexOf(r.state)!==-1&&(r.error===void 0||typeof r.error=="object");return i&&r.error&&(i=typeof r.error.message=="string"&&typeof r.error.code=="string")&&(o=new ko(r.error.code,r.error.message)),i?new t(e,r.state,o):(cu("SharedClientState","Failed to parse target state for ID '"+e+"': "+n),null)},t.prototype.Ss=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},t}(),oCe=function(){function t(e,n){this.clientId=e,this.activeTargetIds=n}return t.Vs=function(e,n){for(var o=JSON.parse(n),r=typeof o=="object"&&o.activeTargetIds instanceof Array,i=HZ(),a=0;r&&a0){var f=s.getResponseJson().error;if(f&&f.status&&f.message){var p=function(g){var y=g.toLowerCase().replace(/_/g,"-");return Object.values(On).indexOf(y)>=0?y:On.UNKNOWN}(f.status);l(new ko(p,f.message))}else l(new ko(On.UNKNOWN,"Server responded with status "+s.getStatus()))}else l(new ko(On.UNAVAILABLE,"Connection failed."));break;default:ri()}}finally{ur("Connection",'RPC "'+n+'" completed.')}});var c=JSON.stringify(i);s.send(o,"POST",c,r,15)})},e.prototype.Oi=function(n,o){var r=[this.Di,"/","google.firestore.v1.Firestore","/",n,"/channel"],i=oBn(),a=rBn(),l={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(l.xmlHttpFactory=new lBn({})),this.ki(l.initMessageHeaders,o),f2e()||xZe()||dUn()||fUn()||hUn()||uUn()||(l.httpHeadersOverwriteParam="$httpHeaders");var s=r.join("");ur("Connection","Creating WebChannel: "+s,l);var c=i.createWebChannel(s,l),u=!1,d=!1,f=new zYn({Ei:function(g){d?ur("Connection","Not sending because WebChannel is closed:",g):(u||(ur("Connection","Opening WebChannel transport."),c.open(),u=!0),ur("Connection","WebChannel sending:",g),c.send(g))},Ti:function(){return c.close()}}),p=function(g,y,w){g.listen(y,function(b){try{w(b)}catch(C){setTimeout(function(){throw C},0)}})};return p(c,CO.EventType.OPEN,function(){d||ur("Connection","WebChannel transport opened.")}),p(c,CO.EventType.CLOSE,function(){d||(d=!0,ur("Connection","WebChannel transport closed"),f.Vi())}),p(c,CO.EventType.ERROR,function(g){d||(d=!0,IX("Connection","WebChannel transport errored:",g),f.Vi(new ko(On.UNAVAILABLE,"The operation could not be completed")))}),p(c,CO.EventType.MESSAGE,function(g){var y;if(!d){var w=g.data[0];Wi(!!w);var b=w,C=b.error||((y=b[0])===null||y===void 0?void 0:y.error);if(C){ur("Connection","WebChannel received error:",C);var P=C.status,v=function(A){var x=tu[A];if(x!==void 0)return ett(x)}(P),T=C.message;v===void 0&&(v=On.INTERNAL,T="Unknown error status: "+P+" with message "+C.message),d=!0,f.Vi(new ko(v,T)),c.close()}else ur("Connection","WebChannel received:",w),f.Si(w)}}),p(a,aBn.STAT_EVENT,function(g){g.stat===xPe.PROXY?ur("Connection","Detected buffering proxy"):g.stat===xPe.NOPROXY&&ur("Connection","Detected no buffering proxy")}),setTimeout(function(){f.Pi()},0),f},e}(function(){function t(e){this.databaseInfo=e,this.databaseId=e.databaseId;var n=e.ssl?"https":"http";this.Di=n+"://"+e.host,this.Ci="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}return t.prototype.Ni=function(e,n,o,r){var i=this.xi(e,n);ur("RestConnection","Sending: ",i,o);var a={};return this.ki(a,r),this.Fi(e,i,a,o).then(function(l){return ur("RestConnection","Received: ",l),l},function(l){throw IX("RestConnection",e+" failed with error: ",l,"url: ",i,"request:",o),l})},t.prototype.$i=function(e,n,o,r){return this.Ni(e,n,o,r)},t.prototype.ki=function(e,n){if(e["X-Goog-Api-Client"]="gl-js/ fire/8.10.1",e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),n)for(var o in n.authHeaders)n.authHeaders.hasOwnProperty(o)&&(e[o]=n.authHeaders[o])},t.prototype.xi=function(e,n){var o=IYn[e];return this.Di+"/v1/"+n+":"+o},t}());/** * @license * Copyright 2020 Google LLC * @@ -6062,7 +6062,7 @@ Total Duration: `+(c-d)+"ms"),Vo.resolve({didRun:!0,sequenceNumbersCollected:r,t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function ztt(){return typeof window<"u"?window:null}function fV(){return typeof document<"u"?document:null}/** + */function ztt(){return typeof window<"u"?window:null}function hV(){return typeof document<"u"?document:null}/** * @license * Copyright 2020 Google LLC * @@ -6077,8 +6077,8 @@ Total Duration: `+(c-d)+"ms"),Vo.resolve({didRun:!0,sequenceNumbersCollected:r,t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function IZ(t){return new NBn(t,!0)}var n5e=function(){function t(e,n,o,r,i){o===void 0&&(o=1e3),r===void 0&&(r=1.5),i===void 0&&(i=6e4),this.Se=e,this.timerId=n,this.Mi=o,this.Li=r,this.Bi=i,this.qi=0,this.Ui=null,this.Ki=Date.now(),this.reset()}return t.prototype.reset=function(){this.qi=0},t.prototype.Qi=function(){this.qi=this.Bi},t.prototype.ji=function(e){var n=this;this.cancel();var o=Math.floor(this.qi+this.Wi()),r=Math.max(0,Date.now()-this.Ki),i=Math.max(0,o-r);i>0&&ur("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.qi+" ms, delay with jitter: "+o+" ms, last attempt: "+r+" ms ago)"),this.Ui=this.Se.enqueueAfterDelay(this.timerId,i,function(){return n.Ki=Date.now(),e()}),this.qi*=this.Li,this.qithis.Bi&&(this.qi=this.Bi)},t.prototype.Gi=function(){this.Ui!==null&&(this.Ui.skipDelay(),this.Ui=null)},t.prototype.cancel=function(){this.Ui!==null&&(this.Ui.cancel(),this.Ui=null)},t.prototype.Wi=function(){return(Math.random()-.5)*this.qi},t}(),Dtt=function(){function t(e,n,o,r,i,a){this.Se=e,this.zi=o,this.Hi=r,this.Ji=i,this.listener=a,this.state=0,this.Yi=0,this.Xi=null,this.stream=null,this.Zi=new n5e(e,n)}return t.prototype.tr=function(){return this.state===1||this.state===2||this.state===4},t.prototype.er=function(){return this.state===2},t.prototype.start=function(){this.state!==3?this.auth():this.nr()},t.prototype.stop=function(){return vo(this,void 0,void 0,function(){return Ao(this,function(e){switch(e.label){case 0:return this.tr()?[4,this.close(0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},t.prototype.sr=function(){this.state=0,this.Zi.reset()},t.prototype.ir=function(){var e=this;this.er()&&this.Xi===null&&(this.Xi=this.Se.enqueueAfterDelay(this.zi,6e4,function(){return e.rr()}))},t.prototype.cr=function(e){this.ur(),this.stream.send(e)},t.prototype.rr=function(){return vo(this,void 0,void 0,function(){return Ao(this,function(e){return this.er()?[2,this.close(0)]:[2]})})},t.prototype.ur=function(){this.Xi&&(this.Xi.cancel(),this.Xi=null)},t.prototype.close=function(e,n){return vo(this,void 0,void 0,function(){return Ao(this,function(o){switch(o.label){case 0:return this.ur(),this.Zi.cancel(),this.Yi++,e!==3?this.Zi.reset():n&&n.code===On.RESOURCE_EXHAUSTED?(cu(n.toString()),cu("Using maximum backoff delay to prevent overloading the backend."),this.Zi.Qi()):n&&n.code===On.UNAUTHENTICATED&&this.Ji.invalidateToken(),this.stream!==null&&(this.ar(),this.stream.close(),this.stream=null),this.state=e,[4,this.listener.Ri(n)];case 1:return o.sent(),[2]}})})},t.prototype.ar=function(){},t.prototype.auth=function(){var e=this;this.state=1;var n=this.hr(this.Yi),o=this.Yi;this.Ji.getToken().then(function(r){e.Yi===o&&e.lr(r)},function(r){n(function(){var i=new ko(On.UNKNOWN,"Fetching auth token failed: "+r.message);return e.dr(i)})})},t.prototype.lr=function(e){var n=this,o=this.hr(this.Yi);this.stream=this.wr(e),this.stream.Ii(function(){o(function(){return n.state=2,n.listener.Ii()})}),this.stream.Ri(function(r){o(function(){return n.dr(r)})}),this.stream.onMessage(function(r){o(function(){return n.onMessage(r)})})},t.prototype.nr=function(){var e=this;this.state=4,this.Zi.ji(function(){return vo(e,void 0,void 0,function(){return Ao(this,function(n){return this.state=0,this.start(),[2]})})})},t.prototype.dr=function(e){return ur("PersistentStream","close with error: "+e),this.stream=null,this.close(3,e)},t.prototype.hr=function(e){var n=this;return function(o){n.Se.enqueueAndForget(function(){return n.Yi===e?o():(ur("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())})}},t}(),EYn=function(t){function e(n,o,r,i,a){var l=this;return(l=t.call(this,n,"listen_stream_connection_backoff","listen_stream_idle",o,r,a)||this).R=i,l}return Pr(e,t),e.prototype.wr=function(n){return this.Hi.Oi("Listen",n)},e.prototype.onMessage=function(n){this.Zi.reset();var o=function(i,a){var l;if("targetChange"in a){a.targetChange;var s=function(w){return w==="NO_CHANGE"?0:w==="ADD"?1:w==="REMOVE"?2:w==="CURRENT"?3:w==="RESET"?4:ri()}(a.targetChange.targetChangeType||"NO_CHANGE"),c=a.targetChange.targetIds||[],u=function(w,b){return w.I?(Wi(b===void 0||typeof b=="string"),i1.fromBase64String(b||"")):(Wi(b===void 0||b instanceof Uint8Array),i1.fromUint8Array(b||new Uint8Array))}(i,a.targetChange.resumeToken),d=(f=a.targetChange.cause)&&function(w){var b=w.code===void 0?On.UNKNOWN:ett(w.code);return new ko(b,w.message||"")}(f);l=new ntt(s,c,u,d||null)}else if("documentChange"in a){a.documentChange,(s=a.documentChange).document,s.document.name,s.document.updateTime,c=L6(i,s.document.name),u=ap(s.document.updateTime);var f=new hg({mapValue:{fields:s.document.fields}}),p=(d=wh.newFoundDocument(c,u,f),s.targetIds||[]),g=s.removedTargetIds||[];l=new dV(p,g,d.key,d)}else if("documentDelete"in a)a.documentDelete,(s=a.documentDelete).document,c=L6(i,s.document),u=s.readTime?ap(s.readTime):Na.min(),f=wh.newNoDocument(c,u),d=s.removedTargetIds||[],l=new dV([],d,f.key,f);else if("documentRemove"in a)a.documentRemove,(s=a.documentRemove).document,c=L6(i,s.document),u=s.removedTargetIds||[],l=new dV([],u,c,null);else{if(!("filter"in a))return ri();a.filter;var y=a.filter;y.targetId,s=y.count||0,c=new HBn(s),u=y.targetId,l=new ttt(u,c)}return l}(this.R,n),r=function(i){if(!("targetChange"in i))return Na.min();var a=i.targetChange;return a.targetIds&&a.targetIds.length?Na.min():a.readTime?ap(a.readTime):Na.min()}(n);return this.listener._r(o,r)},e.prototype.mr=function(n){var o={};o.database=Hk(this.R),o.addTarget=function(i,a){var l,s=a.target;return(l=DX(s)?{documents:ltt(i,s)}:{query:stt(i,s)}).targetId=a.targetId,a.resumeToken.approximateByteSize()>0?l.resumeToken=ott(i,a.resumeToken):a.snapshotVersion.compareTo(Na.min())>0&&(l.readTime=Ck(i,a.snapshotVersion.toTimestamp())),l}(this.R,n);var r=function(i,a){var l=function(s,c){switch(c){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return ri()}}(0,a.purpose);return l==null?null:{"goog-listen-tags":l}}(this.R,n);r&&(o.labels=r),this.cr(o)},e.prototype.yr=function(n){var o={};o.database=Hk(this.R),o.removeTarget=n,this.cr(o)},e}(Dtt),FYn=function(t){function e(n,o,r,i,a){var l=this;return(l=t.call(this,n,"write_stream_connection_backoff","write_stream_idle",o,r,a)||this).R=i,l.gr=!1,l}return Pr(e,t),Object.defineProperty(e.prototype,"pr",{get:function(){return this.gr},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.gr=!1,this.lastStreamToken=void 0,t.prototype.start.call(this)},e.prototype.ar=function(){this.gr&&this.Er([])},e.prototype.wr=function(n){return this.Hi.Oi("Write",n)},e.prototype.onMessage=function(n){if(Wi(!!n.streamToken),this.lastStreamToken=n.streamToken,this.gr){this.Zi.reset();var o=function(i,a){return i&&i.length>0?(Wi(a!==void 0),i.map(function(l){return function(s,c){var u=s.updateTime?ap(s.updateTime):ap(c);return u.isEqual(Na.min())&&(u=ap(c)),new PBn(u,s.transformResults||[])}(l,a)})):[]}(n.writeResults,n.commitTime),r=ap(n.commitTime);return this.listener.Tr(r,o)}return Wi(!n.writeResults||n.writeResults.length===0),this.gr=!0,this.listener.Ir()},e.prototype.Ar=function(){var n={};n.database=Hk(this.R),this.cr(n)},e.prototype.Er=function(n){var o=this,r={streamToken:this.lastStreamToken,writes:n.map(function(i){return kX(o.R,i)})};this.cr(r)},e}(Dtt),kYn=function(t){function e(n,o,r){var i=this;return(i=t.call(this)||this).credentials=n,i.Hi=o,i.R=r,i.Rr=!1,i}return Pr(e,t),e.prototype.br=function(){if(this.Rr)throw new ko(On.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.Ni=function(n,o,r){var i=this;return this.br(),this.credentials.getToken().then(function(a){return i.Hi.Ni(n,o,r,a)}).catch(function(a){throw a.name==="FirebaseError"?(a.code===On.UNAUTHENTICATED&&i.credentials.invalidateToken(),a):new ko(On.UNKNOWN,a.toString())})},e.prototype.$i=function(n,o,r){var i=this;return this.br(),this.credentials.getToken().then(function(a){return i.Hi.$i(n,o,r,a)}).catch(function(a){throw a.name==="FirebaseError"?(a.code===On.UNAUTHENTICATED&&i.credentials.invalidateToken(),a):new ko(On.UNKNOWN,a.toString())})},e.prototype.terminate=function(){this.Rr=!0},e}(function(){}),LYn=function(){function t(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this.vr=0,this.Pr=null,this.Vr=!0}return t.prototype.Sr=function(){var e=this;this.vr===0&&(this.Dr("Unknown"),this.Pr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,function(){return e.Pr=null,e.Cr("Backend didn't respond within 10 seconds."),e.Dr("Offline"),Promise.resolve()}))},t.prototype.Nr=function(e){this.state==="Online"?this.Dr("Unknown"):(this.vr++,this.vr>=1&&(this.kr(),this.Cr("Connection failed 1 times. Most recent error: "+e.toString()),this.Dr("Offline")))},t.prototype.set=function(e){this.kr(),this.vr=0,e==="Online"&&(this.Vr=!1),this.Dr(e)},t.prototype.Dr=function(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))},t.prototype.Cr=function(e){var n="Could not reach Cloud Firestore backend. "+e+` -This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.Vr?(cu(n),this.Vr=!1):ur("OnlineStateTracker",n)},t.prototype.kr=function(){this.Pr!==null&&(this.Pr.cancel(),this.Pr=null)},t}(),WYn=function(t,e,n,o,r){var i=this;this.localStore=t,this.datastore=e,this.asyncQueue=n,this.remoteSyncer={},this.Fr=[],this.$r=new Map,this.Or=new Set,this.Mr=[],this.Lr=r,this.Lr.di(function(a){n.enqueueAndForget(function(){return vo(i,void 0,void 0,function(){return Ao(this,function(l){switch(l.label){case 0:return _w(this)?(ur("RemoteStore","Restarting streams for network reachability change."),[4,function(s){return vo(this,void 0,void 0,function(){var c;return Ao(this,function(u){switch(u.label){case 0:return(c=Ir(s)).Or.add(4),[4,aM(c)];case 1:return u.sent(),c.Br.set("Unknown"),c.Or.delete(4),[4,jN(c)];case 2:return u.sent(),[2]}})})}(this)]):[3,2];case 1:l.sent(),l.label=2;case 2:return[2]}})})})}),this.Br=new LYn(n,o)};/** + */function IZ(t){return new NBn(t,!0)}var o5e=function(){function t(e,n,o,r,i){o===void 0&&(o=1e3),r===void 0&&(r=1.5),i===void 0&&(i=6e4),this.Se=e,this.timerId=n,this.Mi=o,this.Li=r,this.Bi=i,this.qi=0,this.Ui=null,this.Ki=Date.now(),this.reset()}return t.prototype.reset=function(){this.qi=0},t.prototype.Qi=function(){this.qi=this.Bi},t.prototype.ji=function(e){var n=this;this.cancel();var o=Math.floor(this.qi+this.Wi()),r=Math.max(0,Date.now()-this.Ki),i=Math.max(0,o-r);i>0&&ur("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.qi+" ms, delay with jitter: "+o+" ms, last attempt: "+r+" ms ago)"),this.Ui=this.Se.enqueueAfterDelay(this.timerId,i,function(){return n.Ki=Date.now(),e()}),this.qi*=this.Li,this.qithis.Bi&&(this.qi=this.Bi)},t.prototype.Gi=function(){this.Ui!==null&&(this.Ui.skipDelay(),this.Ui=null)},t.prototype.cancel=function(){this.Ui!==null&&(this.Ui.cancel(),this.Ui=null)},t.prototype.Wi=function(){return(Math.random()-.5)*this.qi},t}(),Dtt=function(){function t(e,n,o,r,i,a){this.Se=e,this.zi=o,this.Hi=r,this.Ji=i,this.listener=a,this.state=0,this.Yi=0,this.Xi=null,this.stream=null,this.Zi=new o5e(e,n)}return t.prototype.tr=function(){return this.state===1||this.state===2||this.state===4},t.prototype.er=function(){return this.state===2},t.prototype.start=function(){this.state!==3?this.auth():this.nr()},t.prototype.stop=function(){return vo(this,void 0,void 0,function(){return Ao(this,function(e){switch(e.label){case 0:return this.tr()?[4,this.close(0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},t.prototype.sr=function(){this.state=0,this.Zi.reset()},t.prototype.ir=function(){var e=this;this.er()&&this.Xi===null&&(this.Xi=this.Se.enqueueAfterDelay(this.zi,6e4,function(){return e.rr()}))},t.prototype.cr=function(e){this.ur(),this.stream.send(e)},t.prototype.rr=function(){return vo(this,void 0,void 0,function(){return Ao(this,function(e){return this.er()?[2,this.close(0)]:[2]})})},t.prototype.ur=function(){this.Xi&&(this.Xi.cancel(),this.Xi=null)},t.prototype.close=function(e,n){return vo(this,void 0,void 0,function(){return Ao(this,function(o){switch(o.label){case 0:return this.ur(),this.Zi.cancel(),this.Yi++,e!==3?this.Zi.reset():n&&n.code===On.RESOURCE_EXHAUSTED?(cu(n.toString()),cu("Using maximum backoff delay to prevent overloading the backend."),this.Zi.Qi()):n&&n.code===On.UNAUTHENTICATED&&this.Ji.invalidateToken(),this.stream!==null&&(this.ar(),this.stream.close(),this.stream=null),this.state=e,[4,this.listener.Ri(n)];case 1:return o.sent(),[2]}})})},t.prototype.ar=function(){},t.prototype.auth=function(){var e=this;this.state=1;var n=this.hr(this.Yi),o=this.Yi;this.Ji.getToken().then(function(r){e.Yi===o&&e.lr(r)},function(r){n(function(){var i=new ko(On.UNKNOWN,"Fetching auth token failed: "+r.message);return e.dr(i)})})},t.prototype.lr=function(e){var n=this,o=this.hr(this.Yi);this.stream=this.wr(e),this.stream.Ii(function(){o(function(){return n.state=2,n.listener.Ii()})}),this.stream.Ri(function(r){o(function(){return n.dr(r)})}),this.stream.onMessage(function(r){o(function(){return n.onMessage(r)})})},t.prototype.nr=function(){var e=this;this.state=4,this.Zi.ji(function(){return vo(e,void 0,void 0,function(){return Ao(this,function(n){return this.state=0,this.start(),[2]})})})},t.prototype.dr=function(e){return ur("PersistentStream","close with error: "+e),this.stream=null,this.close(3,e)},t.prototype.hr=function(e){var n=this;return function(o){n.Se.enqueueAndForget(function(){return n.Yi===e?o():(ur("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())})}},t}(),EYn=function(t){function e(n,o,r,i,a){var l=this;return(l=t.call(this,n,"listen_stream_connection_backoff","listen_stream_idle",o,r,a)||this).R=i,l}return Pr(e,t),e.prototype.wr=function(n){return this.Hi.Oi("Listen",n)},e.prototype.onMessage=function(n){this.Zi.reset();var o=function(i,a){var l;if("targetChange"in a){a.targetChange;var s=function(w){return w==="NO_CHANGE"?0:w==="ADD"?1:w==="REMOVE"?2:w==="CURRENT"?3:w==="RESET"?4:ri()}(a.targetChange.targetChangeType||"NO_CHANGE"),c=a.targetChange.targetIds||[],u=function(w,b){return w.I?(Wi(b===void 0||typeof b=="string"),i1.fromBase64String(b||"")):(Wi(b===void 0||b instanceof Uint8Array),i1.fromUint8Array(b||new Uint8Array))}(i,a.targetChange.resumeToken),d=(f=a.targetChange.cause)&&function(w){var b=w.code===void 0?On.UNKNOWN:ett(w.code);return new ko(b,w.message||"")}(f);l=new ntt(s,c,u,d||null)}else if("documentChange"in a){a.documentChange,(s=a.documentChange).document,s.document.name,s.document.updateTime,c=L6(i,s.document.name),u=ap(s.document.updateTime);var f=new hg({mapValue:{fields:s.document.fields}}),p=(d=wh.newFoundDocument(c,u,f),s.targetIds||[]),g=s.removedTargetIds||[];l=new fV(p,g,d.key,d)}else if("documentDelete"in a)a.documentDelete,(s=a.documentDelete).document,c=L6(i,s.document),u=s.readTime?ap(s.readTime):Na.min(),f=wh.newNoDocument(c,u),d=s.removedTargetIds||[],l=new fV([],d,f.key,f);else if("documentRemove"in a)a.documentRemove,(s=a.documentRemove).document,c=L6(i,s.document),u=s.removedTargetIds||[],l=new fV([],u,c,null);else{if(!("filter"in a))return ri();a.filter;var y=a.filter;y.targetId,s=y.count||0,c=new HBn(s),u=y.targetId,l=new ttt(u,c)}return l}(this.R,n),r=function(i){if(!("targetChange"in i))return Na.min();var a=i.targetChange;return a.targetIds&&a.targetIds.length?Na.min():a.readTime?ap(a.readTime):Na.min()}(n);return this.listener._r(o,r)},e.prototype.mr=function(n){var o={};o.database=Hk(this.R),o.addTarget=function(i,a){var l,s=a.target;return(l=EX(s)?{documents:ltt(i,s)}:{query:stt(i,s)}).targetId=a.targetId,a.resumeToken.approximateByteSize()>0?l.resumeToken=ott(i,a.resumeToken):a.snapshotVersion.compareTo(Na.min())>0&&(l.readTime=Ck(i,a.snapshotVersion.toTimestamp())),l}(this.R,n);var r=function(i,a){var l=function(s,c){switch(c){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return ri()}}(0,a.purpose);return l==null?null:{"goog-listen-tags":l}}(this.R,n);r&&(o.labels=r),this.cr(o)},e.prototype.yr=function(n){var o={};o.database=Hk(this.R),o.removeTarget=n,this.cr(o)},e}(Dtt),FYn=function(t){function e(n,o,r,i,a){var l=this;return(l=t.call(this,n,"write_stream_connection_backoff","write_stream_idle",o,r,a)||this).R=i,l.gr=!1,l}return Pr(e,t),Object.defineProperty(e.prototype,"pr",{get:function(){return this.gr},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.gr=!1,this.lastStreamToken=void 0,t.prototype.start.call(this)},e.prototype.ar=function(){this.gr&&this.Er([])},e.prototype.wr=function(n){return this.Hi.Oi("Write",n)},e.prototype.onMessage=function(n){if(Wi(!!n.streamToken),this.lastStreamToken=n.streamToken,this.gr){this.Zi.reset();var o=function(i,a){return i&&i.length>0?(Wi(a!==void 0),i.map(function(l){return function(s,c){var u=s.updateTime?ap(s.updateTime):ap(c);return u.isEqual(Na.min())&&(u=ap(c)),new PBn(u,s.transformResults||[])}(l,a)})):[]}(n.writeResults,n.commitTime),r=ap(n.commitTime);return this.listener.Tr(r,o)}return Wi(!n.writeResults||n.writeResults.length===0),this.gr=!0,this.listener.Ir()},e.prototype.Ar=function(){var n={};n.database=Hk(this.R),this.cr(n)},e.prototype.Er=function(n){var o=this,r={streamToken:this.lastStreamToken,writes:n.map(function(i){return LX(o.R,i)})};this.cr(r)},e}(Dtt),kYn=function(t){function e(n,o,r){var i=this;return(i=t.call(this)||this).credentials=n,i.Hi=o,i.R=r,i.Rr=!1,i}return Pr(e,t),e.prototype.br=function(){if(this.Rr)throw new ko(On.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.Ni=function(n,o,r){var i=this;return this.br(),this.credentials.getToken().then(function(a){return i.Hi.Ni(n,o,r,a)}).catch(function(a){throw a.name==="FirebaseError"?(a.code===On.UNAUTHENTICATED&&i.credentials.invalidateToken(),a):new ko(On.UNKNOWN,a.toString())})},e.prototype.$i=function(n,o,r){var i=this;return this.br(),this.credentials.getToken().then(function(a){return i.Hi.$i(n,o,r,a)}).catch(function(a){throw a.name==="FirebaseError"?(a.code===On.UNAUTHENTICATED&&i.credentials.invalidateToken(),a):new ko(On.UNKNOWN,a.toString())})},e.prototype.terminate=function(){this.Rr=!0},e}(function(){}),LYn=function(){function t(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this.vr=0,this.Pr=null,this.Vr=!0}return t.prototype.Sr=function(){var e=this;this.vr===0&&(this.Dr("Unknown"),this.Pr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,function(){return e.Pr=null,e.Cr("Backend didn't respond within 10 seconds."),e.Dr("Offline"),Promise.resolve()}))},t.prototype.Nr=function(e){this.state==="Online"?this.Dr("Unknown"):(this.vr++,this.vr>=1&&(this.kr(),this.Cr("Connection failed 1 times. Most recent error: "+e.toString()),this.Dr("Offline")))},t.prototype.set=function(e){this.kr(),this.vr=0,e==="Online"&&(this.Vr=!1),this.Dr(e)},t.prototype.Dr=function(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))},t.prototype.Cr=function(e){var n="Could not reach Cloud Firestore backend. "+e+` +This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.Vr?(cu(n),this.Vr=!1):ur("OnlineStateTracker",n)},t.prototype.kr=function(){this.Pr!==null&&(this.Pr.cancel(),this.Pr=null)},t}(),WYn=function(t,e,n,o,r){var i=this;this.localStore=t,this.datastore=e,this.asyncQueue=n,this.remoteSyncer={},this.Fr=[],this.$r=new Map,this.Or=new Set,this.Mr=[],this.Lr=r,this.Lr.di(function(a){n.enqueueAndForget(function(){return vo(i,void 0,void 0,function(){return Ao(this,function(l){switch(l.label){case 0:return _w(this)?(ur("RemoteStore","Restarting streams for network reachability change."),[4,function(s){return vo(this,void 0,void 0,function(){var c;return Ao(this,function(u){switch(u.label){case 0:return(c=Ir(s)).Or.add(4),[4,aM(c)];case 1:return u.sent(),c.Br.set("Unknown"),c.Or.delete(4),[4,BN(c)];case 2:return u.sent(),[2]}})})}(this)]):[3,2];case 1:l.sent(),l.label=2;case 2:return[2]}})})})}),this.Br=new LYn(n,o)};/** * @license * Copyright 2017 Google LLC * @@ -6093,7 +6093,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function jN(t){return vo(this,void 0,void 0,function(){var e,n;return Ao(this,function(o){switch(o.label){case 0:if(!_w(t))return[3,4];e=0,n=t.Mr,o.label=1;case 1:return e0}function _w(t){return Ir(t).Or.size===0}function Ftt(t){t.qr=void 0}function NYn(t){return vo(this,void 0,void 0,function(){return Ao(this,function(e){return t.$r.forEach(function(n,o){o5e(t,n)}),[2]})})}function UYn(t,e){return vo(this,void 0,void 0,function(){return Ao(this,function(n){return Ftt(t),i5e(t)?(t.Br.Nr(e),r5e(t)):t.Br.set("Unknown"),[2]})})}function jYn(t,e,n){return vo(this,void 0,void 0,function(){var o,r,i;return Ao(this,function(a){switch(a.label){case 0:if(t.Br.set("Online"),!(e instanceof ntt&&e.state===2&&e.cause))return[3,6];a.label=1;case 1:return a.trys.push([1,3,,5]),[4,function(l,s){return vo(this,void 0,void 0,function(){var c,u,d,f;return Ao(this,function(p){switch(p.label){case 0:c=s.cause,u=0,d=s.targetIds,p.label=1;case 1:return u=0?[4,function(l,s){var c=l.qr.ut(s);return c.targetChanges.forEach(function(u,d){if(u.resumeToken.approximateByteSize()>0){var f=l.$r.get(d);f&&l.$r.set(d,f.withResumeToken(u.resumeToken,s))}}),c.targetMismatches.forEach(function(u){var d=l.$r.get(u);if(d){l.$r.set(u,d.withResumeToken(i1.EMPTY_BYTE_STRING,d.snapshotVersion)),Ett(l,u);var f=new MZ(d.target,u,1,d.sequenceNumber);o5e(l,f)}}),l.remoteSyncer.applyRemoteEvent(c)}(t,n)]:[3,10];case 9:a.sent(),a.label=10;case 10:return[3,13];case 11:return ur("RemoteStore","Failed to raise snapshot:",i=a.sent()),[4,jX(t,i)];case 12:return a.sent(),[3,13];case 13:return[2]}})})}function jX(t,e,n){return vo(this,void 0,void 0,function(){var o=this;return Ao(this,function(r){switch(r.label){case 0:if(!Xb(e))throw e;return t.Or.add(1),[4,aM(t)];case 1:return r.sent(),t.Br.set("Offline"),n||(n=function(){return Rtt(t.localStore)}),t.asyncQueue.enqueueRetryable(function(){return vo(o,void 0,void 0,function(){return Ao(this,function(i){switch(i.label){case 0:return ur("RemoteStore","Retrying IndexedDB access"),[4,n()];case 1:return i.sent(),t.Or.delete(1),[4,jN(t)];case 2:return i.sent(),[2]}})})}),[2]}})})}function ktt(t,e){return e().catch(function(n){return jX(t,n,e)})}function lM(t){return vo(this,void 0,void 0,function(){var e,n,o,r,i;return Ao(this,function(a){switch(a.label){case 0:e=Ir(t),n=gw(e),o=e.Fr.length>0?e.Fr[e.Fr.length-1].batchId:-1,a.label=1;case 1:if(!function(l){return _w(l)&&l.Fr.length<10}(e))return[3,7];a.label=2;case 2:return a.trys.push([2,4,,6]),[4,AYn(e.localStore,o)];case 3:return(r=a.sent())===null?(e.Fr.length===0&&n.ir(),[3,7]):(o=r.batchId,function(l,s){l.Fr.push(s);var c=gw(l);c.er()&&c.pr&&c.Er(s.mutations)}(e,r),[3,6]);case 4:return i=a.sent(),[4,jX(e,i)];case 5:return a.sent(),[3,6];case 6:return[3,1];case 7:return Ltt(e)&&Wtt(e),[2]}})})}function Ltt(t){return _w(t)&&!gw(t).tr()&&t.Fr.length>0}function Wtt(t){gw(t).start()}function BYn(t){return vo(this,void 0,void 0,function(){return Ao(this,function(e){return gw(t).Ar(),[2]})})}function YYn(t){return vo(this,void 0,void 0,function(){var e,n,o,r;return Ao(this,function(i){for(e=gw(t),n=0,o=t.Fr;n0&&(ur("RemoteStore","Stopping write stream with "+t.Fr.length+" pending writes"),t.Fr=[]),o.label=4;case 4:return[2]}})})})),t.Kr}var VYn=function(){function t(e,n,o,r,i){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=o,this.op=r,this.removalCallback=i,this.deferred=new a1,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(function(a){})}return t.createAndSchedule=function(e,n,o,r,i){var a=new t(e,n,Date.now()+o,r,i);return a.start(o),a},t.prototype.start=function(e){var n=this;this.timerHandle=setTimeout(function(){return n.handleDelayElapsed()},e)},t.prototype.skipDelay=function(){return this.handleDelayElapsed()},t.prototype.cancel=function(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new ko(On.CANCELLED,"Operation cancelled"+(e?": "+e:""))))},t.prototype.handleDelayElapsed=function(){var e=this;this.asyncQueue.enqueueAndForget(function(){return e.timerHandle!==null?(e.clearTimeout(),e.op().then(function(n){return e.deferred.resolve(n)})):Promise.resolve()})},t.prototype.clearTimeout=function(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},t}();function cM(t,e){if(cu("AsyncQueue",e+": "+t),Xb(t))return new ko(On.UNAVAILABLE,e+": "+t);throw t}/** + */function BN(t){return vo(this,void 0,void 0,function(){var e,n;return Ao(this,function(o){switch(o.label){case 0:if(!_w(t))return[3,4];e=0,n=t.Mr,o.label=1;case 1:return e0}function _w(t){return Ir(t).Or.size===0}function Ftt(t){t.qr=void 0}function NYn(t){return vo(this,void 0,void 0,function(){return Ao(this,function(e){return t.$r.forEach(function(n,o){r5e(t,n)}),[2]})})}function UYn(t,e){return vo(this,void 0,void 0,function(){return Ao(this,function(n){return Ftt(t),a5e(t)?(t.Br.Nr(e),i5e(t)):t.Br.set("Unknown"),[2]})})}function jYn(t,e,n){return vo(this,void 0,void 0,function(){var o,r,i;return Ao(this,function(a){switch(a.label){case 0:if(t.Br.set("Online"),!(e instanceof ntt&&e.state===2&&e.cause))return[3,6];a.label=1;case 1:return a.trys.push([1,3,,5]),[4,function(l,s){return vo(this,void 0,void 0,function(){var c,u,d,f;return Ao(this,function(p){switch(p.label){case 0:c=s.cause,u=0,d=s.targetIds,p.label=1;case 1:return u=0?[4,function(l,s){var c=l.qr.ut(s);return c.targetChanges.forEach(function(u,d){if(u.resumeToken.approximateByteSize()>0){var f=l.$r.get(d);f&&l.$r.set(d,f.withResumeToken(u.resumeToken,s))}}),c.targetMismatches.forEach(function(u){var d=l.$r.get(u);if(d){l.$r.set(u,d.withResumeToken(i1.EMPTY_BYTE_STRING,d.snapshotVersion)),Ett(l,u);var f=new MZ(d.target,u,1,d.sequenceNumber);r5e(l,f)}}),l.remoteSyncer.applyRemoteEvent(c)}(t,n)]:[3,10];case 9:a.sent(),a.label=10;case 10:return[3,13];case 11:return ur("RemoteStore","Failed to raise snapshot:",i=a.sent()),[4,BX(t,i)];case 12:return a.sent(),[3,13];case 13:return[2]}})})}function BX(t,e,n){return vo(this,void 0,void 0,function(){var o=this;return Ao(this,function(r){switch(r.label){case 0:if(!Xb(e))throw e;return t.Or.add(1),[4,aM(t)];case 1:return r.sent(),t.Br.set("Offline"),n||(n=function(){return Rtt(t.localStore)}),t.asyncQueue.enqueueRetryable(function(){return vo(o,void 0,void 0,function(){return Ao(this,function(i){switch(i.label){case 0:return ur("RemoteStore","Retrying IndexedDB access"),[4,n()];case 1:return i.sent(),t.Or.delete(1),[4,BN(t)];case 2:return i.sent(),[2]}})})}),[2]}})})}function ktt(t,e){return e().catch(function(n){return BX(t,n,e)})}function lM(t){return vo(this,void 0,void 0,function(){var e,n,o,r,i;return Ao(this,function(a){switch(a.label){case 0:e=Ir(t),n=gw(e),o=e.Fr.length>0?e.Fr[e.Fr.length-1].batchId:-1,a.label=1;case 1:if(!function(l){return _w(l)&&l.Fr.length<10}(e))return[3,7];a.label=2;case 2:return a.trys.push([2,4,,6]),[4,AYn(e.localStore,o)];case 3:return(r=a.sent())===null?(e.Fr.length===0&&n.ir(),[3,7]):(o=r.batchId,function(l,s){l.Fr.push(s);var c=gw(l);c.er()&&c.pr&&c.Er(s.mutations)}(e,r),[3,6]);case 4:return i=a.sent(),[4,BX(e,i)];case 5:return a.sent(),[3,6];case 6:return[3,1];case 7:return Ltt(e)&&Wtt(e),[2]}})})}function Ltt(t){return _w(t)&&!gw(t).tr()&&t.Fr.length>0}function Wtt(t){gw(t).start()}function BYn(t){return vo(this,void 0,void 0,function(){return Ao(this,function(e){return gw(t).Ar(),[2]})})}function YYn(t){return vo(this,void 0,void 0,function(){var e,n,o,r;return Ao(this,function(i){for(e=gw(t),n=0,o=t.Fr;n0&&(ur("RemoteStore","Stopping write stream with "+t.Fr.length+" pending writes"),t.Fr=[]),o.label=4;case 4:return[2]}})})})),t.Kr}var VYn=function(){function t(e,n,o,r,i){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=o,this.op=r,this.removalCallback=i,this.deferred=new a1,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(function(a){})}return t.createAndSchedule=function(e,n,o,r,i){var a=new t(e,n,Date.now()+o,r,i);return a.start(o),a},t.prototype.start=function(e){var n=this;this.timerHandle=setTimeout(function(){return n.handleDelayElapsed()},e)},t.prototype.skipDelay=function(){return this.handleDelayElapsed()},t.prototype.cancel=function(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new ko(On.CANCELLED,"Operation cancelled"+(e?": "+e:""))))},t.prototype.handleDelayElapsed=function(){var e=this;this.asyncQueue.enqueueAndForget(function(){return e.timerHandle!==null?(e.clearTimeout(),e.op().then(function(n){return e.deferred.resolve(n)})):Promise.resolve()})},t.prototype.clearTimeout=function(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},t}();function cM(t,e){if(cu("AsyncQueue",e+": "+t),Xb(t))return new ko(On.UNAVAILABLE,e+": "+t);throw t}/** * @license * Copyright 2017 Google LLC * @@ -6111,7 +6111,7 @@ This typically indicates that your device does not have a healthy Internet conne */var Ntt=function(){function t(e){this.comparator=e?function(n,o){return e(n,o)||ci.comparator(n.key,o.key)}:function(n,o){return ci.comparator(n.key,o.key)},this.keyedMap=Ode(),this.sortedSet=new Th(this.comparator)}return t.emptySet=function(e){return new t(e.comparator)},t.prototype.has=function(e){return this.keyedMap.get(e)!=null},t.prototype.get=function(e){return this.keyedMap.get(e)},t.prototype.first=function(){return this.sortedSet.minKey()},t.prototype.last=function(){return this.sortedSet.maxKey()},t.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},t.prototype.indexOf=function(e){var n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1},Object.defineProperty(t.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!1,configurable:!0}),t.prototype.forEach=function(e){this.sortedSet.inorderTraversal(function(n,o){return e(n),!1})},t.prototype.add=function(e){var n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))},t.prototype.delete=function(e){var n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this},t.prototype.isEqual=function(e){if(!(e instanceof t)||this.size!==e.size)return!1;for(var n=this.sortedSet.getIterator(),o=e.sortedSet.getIterator();n.hasNext();){var r=n.getNext().key,i=o.getNext().key;if(!r.isEqual(i))return!1}return!0},t.prototype.toString=function(){var e=[];return this.forEach(function(n){e.push(n.toString())}),e.length===0?"DocumentSet ()":`DocumentSet ( `+e.join(` `)+` -)`},t.prototype.copy=function(e,n){var o=new t;return o.comparator=this.comparator,o.keyedMap=e,o.sortedSet=n,o},t}(),rCe=function(){function t(){this.Qr=new Th(ci.comparator)}return t.prototype.track=function(e){var n=e.doc.key,o=this.Qr.get(n);o?e.type!==0&&o.type===3?this.Qr=this.Qr.insert(n,e):e.type===3&&o.type!==1?this.Qr=this.Qr.insert(n,{type:o.type,doc:e.doc}):e.type===2&&o.type===2?this.Qr=this.Qr.insert(n,{type:2,doc:e.doc}):e.type===2&&o.type===0?this.Qr=this.Qr.insert(n,{type:0,doc:e.doc}):e.type===1&&o.type===0?this.Qr=this.Qr.remove(n):e.type===1&&o.type===2?this.Qr=this.Qr.insert(n,{type:1,doc:o.doc}):e.type===0&&o.type===1?this.Qr=this.Qr.insert(n,{type:2,doc:e.doc}):ri():this.Qr=this.Qr.insert(n,e)},t.prototype.jr=function(){var e=[];return this.Qr.inorderTraversal(function(n,o){e.push(o)}),e},t}(),BX=function(){function t(e,n,o,r,i,a,l,s){this.query=e,this.docs=n,this.oldDocs=o,this.docChanges=r,this.mutatedKeys=i,this.fromCache=a,this.syncStateChanged=l,this.excludesMetadataChanges=s}return t.fromInitialDocuments=function(e,n,o,r){var i=[];return n.forEach(function(a){i.push({type:0,doc:a})}),new t(e,n,Ntt.emptySet(n),i,o,r,!0,!1)},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return!this.mutatedKeys.isEmpty()},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){if(!(this.fromCache===e.fromCache&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&kN(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;var n=this.docChanges,o=e.docChanges;if(n.length!==o.length)return!1;for(var r=0;r=0&&(i.listeners.splice(a,1),r=i.listeners.length===0),r?[2,(n.queries.delete(o),n.onUnlisten(o))]:[2]})})}function JYn(t,e){for(var n=Ir(t),o=!1,r=0,i=e;r0)return!0;var n=this.Xr&&this.Xr.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0},t.prototype.no=function(e){e=BX.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache),this.Yr=!0,this.Jr.next(e)},t}();/** + */function l5e(t,e){return vo(this,void 0,void 0,function(){var n,o,r,i,a,l,s;return Ao(this,function(c){switch(c.label){case 0:if(n=Ir(t),o=e.query,r=!1,(i=n.queries.get(o))||(r=!0,i=new GYn),!r)return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),a=i,[4,n.onListen(o)];case 2:return a.Wr=c.sent(),[3,4];case 3:return l=c.sent(),s=cM(l,"Initialization of query '"+Bde(e.query)+"' failed"),[2,void e.onError(s)];case 4:return n.queries.set(o,i),i.listeners.push(e),e.zr(n.onlineState),i.Wr&&e.Hr(i.Wr)&&c5e(n),[2]}})})}function s5e(t,e){return vo(this,void 0,void 0,function(){var n,o,r,i,a;return Ao(this,function(l){return n=Ir(t),o=e.query,r=!1,(i=n.queries.get(o))&&(a=i.listeners.indexOf(e))>=0&&(i.listeners.splice(a,1),r=i.listeners.length===0),r?[2,(n.queries.delete(o),n.onUnlisten(o))]:[2]})})}function JYn(t,e){for(var n=Ir(t),o=!1,r=0,i=e;r0)return!0;var n=this.Xr&&this.Xr.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0},t.prototype.no=function(e){e=YX.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache),this.Yr=!0,this.Jr.next(e)},t}();/** * @license * Copyright 2017 Google LLC * @@ -6141,7 +6141,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var Utt=function(t){this.key=t},jtt=function(t){this.key=t},Btt=function(){function t(e,n){this.query=e,this.uo=n,this.ao=null,this.current=!1,this.ho=Ks(),this.mutatedKeys=Ks(),this.lo=_et(e),this.fo=new Ntt(this.lo)}return Object.defineProperty(t.prototype,"wo",{get:function(){return this.uo},enumerable:!1,configurable:!0}),t.prototype._o=function(e,n){var o=this,r=n?n.mo:new rCe,i=n?n.fo:this.fo,a=n?n.mutatedKeys:this.mutatedKeys,l=i,s=!1,c=cV(this.query)&&i.size===this.query.limit?i.last():null,u=FX(this.query)&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal(function(f,p){var g=i.get(f),y=LN(o.query,p)?p:null,w=!!g&&o.mutatedKeys.has(g.key),b=!!y&&(y.hasLocalMutations||o.mutatedKeys.has(y.key)&&y.hasCommittedMutations),C=!1;g&&y?g.data.isEqual(y.data)?w!==b&&(r.track({type:3,doc:y}),C=!0):o.yo(g,y)||(r.track({type:2,doc:y}),C=!0,(c&&o.lo(y,c)>0||u&&o.lo(y,u)<0)&&(s=!0)):!g&&y?(r.track({type:0,doc:y}),C=!0):g&&!y&&(r.track({type:1,doc:g}),C=!0,(c||u)&&(s=!0)),C&&(y?(l=l.add(y),a=b?a.add(f):a.delete(f)):(l=l.delete(f),a=a.delete(f)))}),cV(this.query)||FX(this.query))for(;l.size>this.query.limit;){var d=cV(this.query)?l.last():l.first();l=l.delete(d.key),a=a.delete(d.key),r.track({type:1,doc:d})}return{fo:l,mo:r,Nn:s,mutatedKeys:a}},t.prototype.yo=function(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations},t.prototype.applyChanges=function(e,n,o){var r=this,i=this.fo;this.fo=e.fo,this.mutatedKeys=e.mutatedKeys;var a=e.mo.jr();a.sort(function(u,d){return function(f,p){var g=function(y){switch(y){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return ri()}};return g(f)-g(p)}(u.type,d.type)||r.lo(u.doc,d.doc)}),this.po(o);var l=n?this.Eo():[],s=this.ho.size===0&&this.current?1:0,c=s!==this.ao;return this.ao=s,a.length!==0||c?{snapshot:new BX(this.query,e.fo,i,a,e.mutatedKeys,s===0,c,!1),To:l}:{To:l}},t.prototype.zr=function(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({fo:this.fo,mo:new rCe,mutatedKeys:this.mutatedKeys,Nn:!1},!1)):{To:[]}},t.prototype.Io=function(e){return!this.uo.has(e)&&!!this.fo.has(e)&&!this.fo.get(e).hasLocalMutations},t.prototype.po=function(e){var n=this;e&&(e.addedDocuments.forEach(function(o){return n.uo=n.uo.add(o)}),e.modifiedDocuments.forEach(function(o){}),e.removedDocuments.forEach(function(o){return n.uo=n.uo.delete(o)}),this.current=e.current)},t.prototype.Eo=function(){var e=this;if(!this.current)return[];var n=this.ho;this.ho=Ks(),this.fo.forEach(function(r){e.Io(r.key)&&(e.ho=e.ho.add(r.key))});var o=[];return n.forEach(function(r){e.ho.has(r)||o.push(new jtt(r))}),this.ho.forEach(function(r){n.has(r)||o.push(new Utt(r))}),o},t.prototype.Ao=function(e){this.uo=e.Bn,this.ho=Ks();var n=this._o(e.documents);return this.applyChanges(n,!0)},t.prototype.Ro=function(){return BX.fromInitialDocuments(this.query,this.fo,this.mutatedKeys,this.ao===0)},t}(),qYn=function(t,e,n){this.query=t,this.targetId=e,this.view=n},$Yn=function(t){this.key=t,this.bo=!1},QYn=function(){function t(e,n,o,r,i,a){this.localStore=e,this.remoteStore=n,this.eventManager=o,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=a,this.vo={},this.Po=new iM(function(l){return Oet(l)},kN),this.Vo=new Map,this.So=new Set,this.Do=new Th(ci.comparator),this.Co=new Map,this.No=new t5e,this.xo={},this.ko=new Map,this.Fo=WX.Yt(),this.onlineState="Unknown",this.$o=void 0}return Object.defineProperty(t.prototype,"isPrimaryClient",{get:function(){return this.$o===!0},enumerable:!1,configurable:!0}),t}();function ZYn(t,e){return vo(this,void 0,void 0,function(){var n,o,r,i,a,l;return Ao(this,function(s){switch(s.label){case 0:return n=p5e(t),(i=n.Po.get(e))?(o=i.targetId,n.sharedClientState.addLocalQueryTarget(o),r=i.view.Ro(),[3,4]):[3,1];case 1:return[4,NX(n.localStore,V9(e))];case 2:return a=s.sent(),l=n.sharedClientState.addLocalQueryTarget(a.targetId),o=a.targetId,[4,u5e(n,e,o,l==="current")];case 3:r=s.sent(),n.isPrimaryClient&&zZ(n.remoteStore,a),s.label=4;case 4:return[2,r]}})})}function u5e(t,e,n,o){return vo(this,void 0,void 0,function(){var r,i,a,l,s,c;return Ao(this,function(u){switch(u.label){case 0:return t.Oo=function(d,f,p){return function(g,y,w,b){return vo(this,void 0,void 0,function(){var C,P,v;return Ao(this,function(T){switch(T.label){case 0:return C=y.view._o(w),C.Nn?[4,UX(g.localStore,y.query,!1).then(function(A){var x=A.documents;return y.view._o(x,C)})]:[3,2];case 1:C=T.sent(),T.label=2;case 2:return P=b&&b.targetChanges.get(y.targetId),v=y.view.applyChanges(C,g.isPrimaryClient,P),[2,(Jde(g,y.targetId,v.To),v.snapshot)]}})})}(t,d,f,p)},[4,UX(t.localStore,e,!0)];case 1:return r=u.sent(),i=new Btt(e,r.Bn),a=i._o(r.documents),l=J2e.createSynthesizedTargetChangeForCurrentChange(n,o&&t.onlineState!=="Offline"),s=i.applyChanges(a,t.isPrimaryClient,l),Jde(t,n,s.To),c=new qYn(e,n,i),[2,(t.Po.set(e,c),t.Vo.has(n)?t.Vo.get(n).push(e):t.Vo.set(n,[e]),s.snapshot)]}})})}function eOn(t,e){return vo(this,void 0,void 0,function(){var n,o,r;return Ao(this,function(i){switch(i.label){case 0:return n=Ir(t),o=n.Po.get(e),(r=n.Vo.get(o.targetId)).length>1?[2,(n.Vo.set(o.targetId,r.filter(function(a){return!kN(a,e)})),void n.Po.delete(e))]:n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(o.targetId),n.sharedClientState.isActiveQueryTarget(o.targetId)?[3,2]:[4,VR(n.localStore,o.targetId,!1).then(function(){n.sharedClientState.clearQueryState(o.targetId),Mk(n.remoteStore,o.targetId),GR(n,o.targetId)}).catch(Jb)]):[3,3];case 1:i.sent(),i.label=2;case 2:return[3,5];case 3:return GR(n,o.targetId),[4,VR(n.localStore,o.targetId,!0)];case 4:i.sent(),i.label=5;case 5:return[2]}})})}function tOn(t,e,n){return vo(this,void 0,void 0,function(){var o,r,i,a;return Ao(this,function(l){switch(l.label){case 0:o=g5e(t),l.label=1;case 1:return l.trys.push([1,5,,6]),[4,function(s,c){var u,d=Ir(s),f=Zp.now(),p=c.reduce(function(g,y){return g.add(y.key)},Ks());return d.persistence.runTransaction("Locally write mutations","readwrite",function(g){return d.Mn.pn(g,p).next(function(y){u=y;for(var w=[],b=0,C=c;b0?l.bo=!0:i.modifiedDocuments.size>0?Wi(l.bo):i.removedDocuments.size>0&&(Wi(l.bo),l.bo=!1))}),[4,Vw(n,o,e)];case 3:return r.sent(),[3,6];case 4:return[4,Jb(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}})})}function iCe(t,e,n){var o=Ir(t);if(o.isPrimaryClient&&n===0||!o.isPrimaryClient&&n===1){var r=[];o.Po.forEach(function(i,a){var l=a.view.zr(e);l.snapshot&&r.push(l.snapshot)}),function(i,a){var l=Ir(i);l.onlineState=a;var s=!1;l.queries.forEach(function(c,u){for(var d=0,f=u.listeners;d0&&t.Do.size0||u&&o.lo(y,u)<0)&&(s=!0)):!g&&y?(r.track({type:0,doc:y}),C=!0):g&&!y&&(r.track({type:1,doc:g}),C=!0,(c||u)&&(s=!0)),C&&(y?(l=l.add(y),a=b?a.add(f):a.delete(f)):(l=l.delete(f),a=a.delete(f)))}),uV(this.query)||kX(this.query))for(;l.size>this.query.limit;){var d=uV(this.query)?l.last():l.first();l=l.delete(d.key),a=a.delete(d.key),r.track({type:1,doc:d})}return{fo:l,mo:r,Nn:s,mutatedKeys:a}},t.prototype.yo=function(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations},t.prototype.applyChanges=function(e,n,o){var r=this,i=this.fo;this.fo=e.fo,this.mutatedKeys=e.mutatedKeys;var a=e.mo.jr();a.sort(function(u,d){return function(f,p){var g=function(y){switch(y){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return ri()}};return g(f)-g(p)}(u.type,d.type)||r.lo(u.doc,d.doc)}),this.po(o);var l=n?this.Eo():[],s=this.ho.size===0&&this.current?1:0,c=s!==this.ao;return this.ao=s,a.length!==0||c?{snapshot:new YX(this.query,e.fo,i,a,e.mutatedKeys,s===0,c,!1),To:l}:{To:l}},t.prototype.zr=function(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({fo:this.fo,mo:new iCe,mutatedKeys:this.mutatedKeys,Nn:!1},!1)):{To:[]}},t.prototype.Io=function(e){return!this.uo.has(e)&&!!this.fo.has(e)&&!this.fo.get(e).hasLocalMutations},t.prototype.po=function(e){var n=this;e&&(e.addedDocuments.forEach(function(o){return n.uo=n.uo.add(o)}),e.modifiedDocuments.forEach(function(o){}),e.removedDocuments.forEach(function(o){return n.uo=n.uo.delete(o)}),this.current=e.current)},t.prototype.Eo=function(){var e=this;if(!this.current)return[];var n=this.ho;this.ho=Ks(),this.fo.forEach(function(r){e.Io(r.key)&&(e.ho=e.ho.add(r.key))});var o=[];return n.forEach(function(r){e.ho.has(r)||o.push(new jtt(r))}),this.ho.forEach(function(r){n.has(r)||o.push(new Utt(r))}),o},t.prototype.Ao=function(e){this.uo=e.Bn,this.ho=Ks();var n=this._o(e.documents);return this.applyChanges(n,!0)},t.prototype.Ro=function(){return YX.fromInitialDocuments(this.query,this.fo,this.mutatedKeys,this.ao===0)},t}(),qYn=function(t,e,n){this.query=t,this.targetId=e,this.view=n},$Yn=function(t){this.key=t,this.bo=!1},QYn=function(){function t(e,n,o,r,i,a){this.localStore=e,this.remoteStore=n,this.eventManager=o,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=a,this.vo={},this.Po=new iM(function(l){return Oet(l)},LN),this.Vo=new Map,this.So=new Set,this.Do=new Th(ci.comparator),this.Co=new Map,this.No=new n5e,this.xo={},this.ko=new Map,this.Fo=NX.Yt(),this.onlineState="Unknown",this.$o=void 0}return Object.defineProperty(t.prototype,"isPrimaryClient",{get:function(){return this.$o===!0},enumerable:!1,configurable:!0}),t}();function ZYn(t,e){return vo(this,void 0,void 0,function(){var n,o,r,i,a,l;return Ao(this,function(s){switch(s.label){case 0:return n=g5e(t),(i=n.Po.get(e))?(o=i.targetId,n.sharedClientState.addLocalQueryTarget(o),r=i.view.Ro(),[3,4]):[3,1];case 1:return[4,UX(n.localStore,V9(e))];case 2:return a=s.sent(),l=n.sharedClientState.addLocalQueryTarget(a.targetId),o=a.targetId,[4,d5e(n,e,o,l==="current")];case 3:r=s.sent(),n.isPrimaryClient&&zZ(n.remoteStore,a),s.label=4;case 4:return[2,r]}})})}function d5e(t,e,n,o){return vo(this,void 0,void 0,function(){var r,i,a,l,s,c;return Ao(this,function(u){switch(u.label){case 0:return t.Oo=function(d,f,p){return function(g,y,w,b){return vo(this,void 0,void 0,function(){var C,P,v;return Ao(this,function(T){switch(T.label){case 0:return C=y.view._o(w),C.Nn?[4,jX(g.localStore,y.query,!1).then(function(A){var x=A.documents;return y.view._o(x,C)})]:[3,2];case 1:C=T.sent(),T.label=2;case 2:return P=b&&b.targetChanges.get(y.targetId),v=y.view.applyChanges(C,g.isPrimaryClient,P),[2,(Jde(g,y.targetId,v.To),v.snapshot)]}})})}(t,d,f,p)},[4,jX(t.localStore,e,!0)];case 1:return r=u.sent(),i=new Btt(e,r.Bn),a=i._o(r.documents),l=K2e.createSynthesizedTargetChangeForCurrentChange(n,o&&t.onlineState!=="Offline"),s=i.applyChanges(a,t.isPrimaryClient,l),Jde(t,n,s.To),c=new qYn(e,n,i),[2,(t.Po.set(e,c),t.Vo.has(n)?t.Vo.get(n).push(e):t.Vo.set(n,[e]),s.snapshot)]}})})}function eOn(t,e){return vo(this,void 0,void 0,function(){var n,o,r;return Ao(this,function(i){switch(i.label){case 0:return n=Ir(t),o=n.Po.get(e),(r=n.Vo.get(o.targetId)).length>1?[2,(n.Vo.set(o.targetId,r.filter(function(a){return!LN(a,e)})),void n.Po.delete(e))]:n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(o.targetId),n.sharedClientState.isActiveQueryTarget(o.targetId)?[3,2]:[4,VR(n.localStore,o.targetId,!1).then(function(){n.sharedClientState.clearQueryState(o.targetId),Mk(n.remoteStore,o.targetId),GR(n,o.targetId)}).catch(Jb)]):[3,3];case 1:i.sent(),i.label=2;case 2:return[3,5];case 3:return GR(n,o.targetId),[4,VR(n.localStore,o.targetId,!0)];case 4:i.sent(),i.label=5;case 5:return[2]}})})}function tOn(t,e,n){return vo(this,void 0,void 0,function(){var o,r,i,a;return Ao(this,function(l){switch(l.label){case 0:o=m5e(t),l.label=1;case 1:return l.trys.push([1,5,,6]),[4,function(s,c){var u,d=Ir(s),f=Zp.now(),p=c.reduce(function(g,y){return g.add(y.key)},Ks());return d.persistence.runTransaction("Locally write mutations","readwrite",function(g){return d.Mn.pn(g,p).next(function(y){u=y;for(var w=[],b=0,C=c;b0?l.bo=!0:i.modifiedDocuments.size>0?Wi(l.bo):i.removedDocuments.size>0&&(Wi(l.bo),l.bo=!1))}),[4,Vw(n,o,e)];case 3:return r.sent(),[3,6];case 4:return[4,Jb(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}})})}function aCe(t,e,n){var o=Ir(t);if(o.isPrimaryClient&&n===0||!o.isPrimaryClient&&n===1){var r=[];o.Po.forEach(function(i,a){var l=a.view.zr(e);l.snapshot&&r.push(l.snapshot)}),function(i,a){var l=Ir(i);l.onlineState=a;var s=!1;l.queries.forEach(function(c,u){for(var d=0,f=u.listeners;d0&&t.Do.size0)throw new ko(On.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(i,a){return vo(this,void 0,void 0,function(){var l,s,c,u,d,f;return Ao(this,function(p){switch(p.label){case 0:return l=Ir(i),s=Hk(l.R)+"/documents",c={documents:a.map(function(g){return Rk(l.R,g)})},[4,l.$i("BatchGetDocuments",s,c)];case 1:return u=p.sent(),d=new Map,u.forEach(function(g){var y=function(w,b){return"found"in b?function(C,P){Wi(!!P.found),P.found.name,P.found.updateTime;var v=L6(C,P.found.name),T=ap(P.found.updateTime),A=new hg({mapValue:{fields:P.found.fields}});return wh.newFoundDocument(v,T,A)}(w,b):"missing"in b?function(C,P){Wi(!!P.missing),Wi(!!P.readTime);var v=L6(C,P.missing),T=ap(P.readTime);return wh.newNoDocument(v,T)}(w,b):ri()}(l.R,g);d.set(y.key.toString(),y)}),f=[],[2,(a.forEach(function(g){var y=d.get(g.toString());Wi(!!y),f.push(y)}),f)]}})})}(this.datastore,e)];case 1:return[2,((n=r.sent()).forEach(function(i){return o.recordVersion(i)}),n)]}})})},t.prototype.set=function(e,n){this.write(n.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())},t.prototype.update=function(e,n){try{this.write(n.toMutation(e,this.preconditionForUpdate(e)))}catch(o){this.lastWriteError=o}this.writtenDocs.add(e.toString())},t.prototype.delete=function(e){this.write(new UN(e,this.precondition(e))),this.writtenDocs.add(e.toString())},t.prototype.commit=function(){return vo(this,void 0,void 0,function(){var e,n=this;return Ao(this,function(o){switch(o.label){case 0:if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;return e=this.readVersions,this.mutations.forEach(function(r){e.delete(r.key.toString())}),e.forEach(function(r,i){var a=ci.fromPath(i);n.mutations.push(new G2e(a,n.precondition(a)))}),[4,function(r,i){return vo(this,void 0,void 0,function(){var a,l,s;return Ao(this,function(c){switch(c.label){case 0:return a=Ir(r),l=Hk(a.R)+"/documents",s={writes:i.map(function(u){return kX(a.R,u)})},[4,a.Ni("Commit",l,s)];case 1:return c.sent(),[2]}})})}(this.datastore,this.mutations)];case 1:return o.sent(),this.committed=!0,[2]}})})},t.prototype.recordVersion=function(e){var n;if(e.isFoundDocument())n=e.version;else{if(!e.isNoDocument())throw ri();n=Na.min()}var o=this.readVersions.get(e.key.toString());if(o){if(!n.isEqual(o))throw new ko(On.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),n)},t.prototype.precondition=function(e){var n=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&n?hh.updateTime(n):hh.none()},t.prototype.preconditionForUpdate=function(e){var n=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&n){if(n.isEqual(Na.min()))throw new ko(On.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return hh.updateTime(n)}return hh.exists(!0)},t.prototype.write=function(e){this.ensureCommitNotCalled(),this.mutations.push(e)},t.prototype.ensureCommitNotCalled=function(){},t}(),AOn=function(){function t(e,n,o,r){this.asyncQueue=e,this.datastore=n,this.updateFunction=o,this.deferred=r,this.ec=5,this.Zi=new n5e(this.asyncQueue,"transaction_retry")}return t.prototype.run=function(){this.ec-=1,this.nc()},t.prototype.nc=function(){var e=this;this.Zi.ji(function(){return vo(e,void 0,void 0,function(){var n,o,r=this;return Ao(this,function(i){return n=new yOn(this.datastore),(o=this.sc(n))&&o.then(function(a){r.asyncQueue.enqueueAndForget(function(){return n.commit().then(function(){r.deferred.resolve(a)}).catch(function(l){r.ic(l)})})}).catch(function(a){r.ic(a)}),[2]})})})},t.prototype.sc=function(e){try{var n=this.updateFunction(e);return!Gb(n)&&n.catch&&n.then?n:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(o){return this.deferred.reject(o),null}},t.prototype.ic=function(e){var n=this;this.ec>0&&this.rc(e)?(this.ec-=1,this.asyncQueue.enqueueAndForget(function(){return n.nc(),Promise.resolve()})):this.deferred.reject(e)},t.prototype.rc=function(e){if(e.name==="FirebaseError"){var n=e.code;return n==="aborted"||n==="failed-precondition"||!Zet(n)}return!1},t}(),wOn=function(){function t(e,n,o){var r=this;this.credentials=e,this.asyncQueue=n,this.databaseInfo=o,this.user=cf.UNAUTHENTICATED,this.clientId=Eet.u(),this.credentialListener=function(){return Promise.resolve()},this.credentials.setChangeListener(n,function(i){return vo(r,void 0,void 0,function(){return Ao(this,function(a){switch(a.label){case 0:return ur("FirestoreClient","Received user=",i.uid),[4,this.credentialListener(i)];case 1:return a.sent(),this.user=i,[2]}})})})}return t.prototype.getConfiguration=function(){return vo(this,void 0,void 0,function(){return Ao(this,function(e){return[2,{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100}]})})},t.prototype.setCredentialChangeListener=function(e){this.credentialListener=e},t.prototype.verifyNotTerminated=function(){if(this.asyncQueue.isShuttingDown)throw new ko(On.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.terminate=function(){var e=this;this.asyncQueue.enterRestrictedMode();var n=new a1;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(function(){return vo(e,void 0,void 0,function(){var o,r;return Ao(this,function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),this.onlineComponents?[4,this.onlineComponents.terminate()]:[3,2];case 1:i.sent(),i.label=2;case 2:return this.offlineComponents?[4,this.offlineComponents.terminate()]:[3,4];case 3:i.sent(),i.label=4;case 4:return this.credentials.removeChangeListener(),n.resolve(),[3,6];case 5:return o=i.sent(),r=cM(o,"Failed to shutdown persistence"),n.reject(r),[3,6];case 6:return[2]}})})}),n.promise},t}();/** + */var DZ=function(){function t(e){this.observer=e,this.muted=!1}return t.prototype.next=function(e){this.observer.next&&this.jo(this.observer.next,e)},t.prototype.error=function(e){this.observer.error?this.jo(this.observer.error,e):console.error("Uncaught Error in snapshot listener:",e)},t.prototype.Wo=function(){this.muted=!0},t.prototype.jo=function(e,n){var o=this;this.muted||setTimeout(function(){o.muted||e(n)},0)},t}(),yOn=function(){function t(e){this.datastore=e,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastWriteError=null,this.writtenDocs=new Set}return t.prototype.lookup=function(e){return vo(this,void 0,void 0,function(){var n,o=this;return Ao(this,function(r){switch(r.label){case 0:if(this.ensureCommitNotCalled(),this.mutations.length>0)throw new ko(On.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(i,a){return vo(this,void 0,void 0,function(){var l,s,c,u,d,f;return Ao(this,function(p){switch(p.label){case 0:return l=Ir(i),s=Hk(l.R)+"/documents",c={documents:a.map(function(g){return Rk(l.R,g)})},[4,l.$i("BatchGetDocuments",s,c)];case 1:return u=p.sent(),d=new Map,u.forEach(function(g){var y=function(w,b){return"found"in b?function(C,P){Wi(!!P.found),P.found.name,P.found.updateTime;var v=L6(C,P.found.name),T=ap(P.found.updateTime),A=new hg({mapValue:{fields:P.found.fields}});return wh.newFoundDocument(v,T,A)}(w,b):"missing"in b?function(C,P){Wi(!!P.missing),Wi(!!P.readTime);var v=L6(C,P.missing),T=ap(P.readTime);return wh.newNoDocument(v,T)}(w,b):ri()}(l.R,g);d.set(y.key.toString(),y)}),f=[],[2,(a.forEach(function(g){var y=d.get(g.toString());Wi(!!y),f.push(y)}),f)]}})})}(this.datastore,e)];case 1:return[2,((n=r.sent()).forEach(function(i){return o.recordVersion(i)}),n)]}})})},t.prototype.set=function(e,n){this.write(n.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())},t.prototype.update=function(e,n){try{this.write(n.toMutation(e,this.preconditionForUpdate(e)))}catch(o){this.lastWriteError=o}this.writtenDocs.add(e.toString())},t.prototype.delete=function(e){this.write(new jN(e,this.precondition(e))),this.writtenDocs.add(e.toString())},t.prototype.commit=function(){return vo(this,void 0,void 0,function(){var e,n=this;return Ao(this,function(o){switch(o.label){case 0:if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;return e=this.readVersions,this.mutations.forEach(function(r){e.delete(r.key.toString())}),e.forEach(function(r,i){var a=ci.fromPath(i);n.mutations.push(new X2e(a,n.precondition(a)))}),[4,function(r,i){return vo(this,void 0,void 0,function(){var a,l,s;return Ao(this,function(c){switch(c.label){case 0:return a=Ir(r),l=Hk(a.R)+"/documents",s={writes:i.map(function(u){return LX(a.R,u)})},[4,a.Ni("Commit",l,s)];case 1:return c.sent(),[2]}})})}(this.datastore,this.mutations)];case 1:return o.sent(),this.committed=!0,[2]}})})},t.prototype.recordVersion=function(e){var n;if(e.isFoundDocument())n=e.version;else{if(!e.isNoDocument())throw ri();n=Na.min()}var o=this.readVersions.get(e.key.toString());if(o){if(!n.isEqual(o))throw new ko(On.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),n)},t.prototype.precondition=function(e){var n=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&n?hh.updateTime(n):hh.none()},t.prototype.preconditionForUpdate=function(e){var n=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&n){if(n.isEqual(Na.min()))throw new ko(On.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return hh.updateTime(n)}return hh.exists(!0)},t.prototype.write=function(e){this.ensureCommitNotCalled(),this.mutations.push(e)},t.prototype.ensureCommitNotCalled=function(){},t}(),AOn=function(){function t(e,n,o,r){this.asyncQueue=e,this.datastore=n,this.updateFunction=o,this.deferred=r,this.ec=5,this.Zi=new o5e(this.asyncQueue,"transaction_retry")}return t.prototype.run=function(){this.ec-=1,this.nc()},t.prototype.nc=function(){var e=this;this.Zi.ji(function(){return vo(e,void 0,void 0,function(){var n,o,r=this;return Ao(this,function(i){return n=new yOn(this.datastore),(o=this.sc(n))&&o.then(function(a){r.asyncQueue.enqueueAndForget(function(){return n.commit().then(function(){r.deferred.resolve(a)}).catch(function(l){r.ic(l)})})}).catch(function(a){r.ic(a)}),[2]})})})},t.prototype.sc=function(e){try{var n=this.updateFunction(e);return!Gb(n)&&n.catch&&n.then?n:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(o){return this.deferred.reject(o),null}},t.prototype.ic=function(e){var n=this;this.ec>0&&this.rc(e)?(this.ec-=1,this.asyncQueue.enqueueAndForget(function(){return n.nc(),Promise.resolve()})):this.deferred.reject(e)},t.prototype.rc=function(e){if(e.name==="FirebaseError"){var n=e.code;return n==="aborted"||n==="failed-precondition"||!Zet(n)}return!1},t}(),wOn=function(){function t(e,n,o){var r=this;this.credentials=e,this.asyncQueue=n,this.databaseInfo=o,this.user=cf.UNAUTHENTICATED,this.clientId=Eet.u(),this.credentialListener=function(){return Promise.resolve()},this.credentials.setChangeListener(n,function(i){return vo(r,void 0,void 0,function(){return Ao(this,function(a){switch(a.label){case 0:return ur("FirestoreClient","Received user=",i.uid),[4,this.credentialListener(i)];case 1:return a.sent(),this.user=i,[2]}})})})}return t.prototype.getConfiguration=function(){return vo(this,void 0,void 0,function(){return Ao(this,function(e){return[2,{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100}]})})},t.prototype.setCredentialChangeListener=function(e){this.credentialListener=e},t.prototype.verifyNotTerminated=function(){if(this.asyncQueue.isShuttingDown)throw new ko(On.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.terminate=function(){var e=this;this.asyncQueue.enterRestrictedMode();var n=new a1;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(function(){return vo(e,void 0,void 0,function(){var o,r;return Ao(this,function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),this.onlineComponents?[4,this.onlineComponents.terminate()]:[3,2];case 1:i.sent(),i.label=2;case 2:return this.offlineComponents?[4,this.offlineComponents.terminate()]:[3,4];case 3:i.sent(),i.label=4;case 4:return this.credentials.removeChangeListener(),n.resolve(),[3,6];case 5:return o=i.sent(),r=cM(o,"Failed to shutdown persistence"),n.reject(r),[3,6];case 6:return[2]}})})}),n.promise},t}();/** * @license * Copyright 2020 Google LLC * @@ -6186,7 +6186,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Xtt(t,e){return vo(this,void 0,void 0,function(){var n,o,r=this;return Ao(this,function(i){switch(i.label){case 0:return t.asyncQueue.verifyOperationInProgress(),ur("FirestoreClient","Initializing OfflineComponentProvider"),[4,t.getConfiguration()];case 1:return n=i.sent(),[4,e.initialize(n)];case 2:return i.sent(),o=n.initialUser,t.setCredentialChangeListener(function(a){return vo(r,void 0,void 0,function(){return Ao(this,function(l){switch(l.label){case 0:return o.isEqual(a)?[3,2]:[4,Ctt(e.localStore,a)];case 1:l.sent(),o=a,l.label=2;case 2:return[2]}})})}),e.persistence.setDatabaseDeletedListener(function(){return t.terminate()}),t.offlineComponents=e,[2]}})})}function Jtt(t,e){return vo(this,void 0,void 0,function(){var n,o;return Ao(this,function(r){switch(r.label){case 0:return t.asyncQueue.verifyOperationInProgress(),[4,m5e(t)];case 1:return n=r.sent(),ur("FirestoreClient","Initializing OnlineComponentProvider"),[4,t.getConfiguration()];case 2:return o=r.sent(),[4,e.initialize(n,o)];case 3:return r.sent(),t.setCredentialChangeListener(function(i){return function(a,l){return vo(this,void 0,void 0,function(){var s,c;return Ao(this,function(u){switch(u.label){case 0:return(s=Ir(a)).asyncQueue.verifyOperationInProgress(),ur("RemoteStore","RemoteStore received new credentials"),c=_w(s),s.Or.add(3),[4,aM(s)];case 1:return u.sent(),c&&s.Br.set("Unknown"),[4,s.remoteSyncer.handleCredentialChange(l)];case 2:return u.sent(),s.Or.delete(3),[4,jN(s)];case 3:return u.sent(),[2]}})})}(e.remoteStore,i)}),t.onlineComponents=e,[2]}})})}function m5e(t){return vo(this,void 0,void 0,function(){return Ao(this,function(e){switch(e.label){case 0:return t.offlineComponents?[3,2]:(ur("FirestoreClient","Using default OfflineComponentProvider"),[4,Xtt(t,new Vtt)]);case 1:e.sent(),e.label=2;case 2:return[2,t.offlineComponents]}})})}function EZ(t){return vo(this,void 0,void 0,function(){return Ao(this,function(e){switch(e.label){case 0:return t.onlineComponents?[3,2]:(ur("FirestoreClient","Using default OnlineComponentProvider"),[4,Jtt(t,new Kde)]);case 1:e.sent(),e.label=2;case 2:return[2,t.onlineComponents]}})})}function lCe(t){return m5e(t).then(function(e){return e.persistence})}function Ktt(t){return m5e(t).then(function(e){return e.localStore})}function sCe(t){return EZ(t).then(function(e){return e.remoteStore})}function qtt(t){return EZ(t).then(function(e){return e.syncEngine})}function XR(t){return vo(this,void 0,void 0,function(){var e,n;return Ao(this,function(o){switch(o.label){case 0:return[4,EZ(t)];case 1:return e=o.sent(),[2,((n=e.eventManager).onListen=ZYn.bind(null,e.syncEngine),n.onUnlisten=eOn.bind(null,e.syncEngine),n)]}})})}function cCe(t,e,n){var o=this;n===void 0&&(n={});var r=new a1;return t.asyncQueue.enqueueAndForget(function(){return vo(o,void 0,void 0,function(){var i;return Ao(this,function(a){switch(a.label){case 0:return i=function(l,s,c,u,d){var f=new DZ({next:function(g){s.enqueueAndForget(function(){return l5e(l,p)});var y=g.docs.has(c);!y&&g.fromCache?d.reject(new ko(On.UNAVAILABLE,"Failed to get document because the client is offline.")):y&&g.fromCache&&u&&u.source==="server"?d.reject(new ko(On.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):d.resolve(g)},error:function(g){return d.reject(g)}}),p=new c5e(FN(c.path),f,{includeMetadataChanges:!0,so:!0});return a5e(l,p)},[4,XR(t)];case 1:return[2,i.apply(void 0,[a.sent(),t.asyncQueue,e,n,r])]}})})}),r.promise}function uCe(t,e,n){var o=this;n===void 0&&(n={});var r=new a1;return t.asyncQueue.enqueueAndForget(function(){return vo(o,void 0,void 0,function(){var i;return Ao(this,function(a){switch(a.label){case 0:return i=function(l,s,c,u,d){var f=new DZ({next:function(g){s.enqueueAndForget(function(){return l5e(l,p)}),g.fromCache&&u.source==="server"?d.reject(new ko(On.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):d.resolve(g)},error:function(g){return d.reject(g)}}),p=new c5e(c,f,{includeMetadataChanges:!0,so:!0});return a5e(l,p)},[4,XR(t)];case 1:return[2,i.apply(void 0,[a.sent(),t.asyncQueue,e,n,r])]}})})}),r.promise}var vOn=function(t,e,n,o,r,i,a,l){this.databaseId=t,this.appId=e,this.persistenceKey=n,this.host=o,this.ssl=r,this.forceLongPolling=i,this.autoDetectLongPolling=a,this.useFetchStreams=l},YX=function(){function t(e,n){this.projectId=e,this.database=n||"(default)"}return Object.defineProperty(t.prototype,"isDefaultDatabase",{get:function(){return this.database==="(default)"},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database},t}(),dCe=new Map,$tt=function(t,e){this.user=e,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization="Bearer "+t},fCe=function(){function t(){this.changeListener=null}return t.prototype.getToken=function(){return Promise.resolve(null)},t.prototype.invalidateToken=function(){},t.prototype.setChangeListener=function(e,n){this.changeListener=n,e.enqueueRetryable(function(){return n(cf.UNAUTHENTICATED)})},t.prototype.removeChangeListener=function(){this.changeListener=null},t}(),xOn=function(){function t(e){this.token=e,this.changeListener=null}return t.prototype.getToken=function(){return Promise.resolve(this.token)},t.prototype.invalidateToken=function(){},t.prototype.setChangeListener=function(e,n){var o=this;this.changeListener=n,e.enqueueRetryable(function(){return n(o.token.user)})},t.prototype.removeChangeListener=function(){this.changeListener=null},t}(),bOn=function(){function t(e){var n=this;this.currentUser=cf.UNAUTHENTICATED,this.oc=new a1,this.cc=0,this.forceRefresh=!1,this.auth=null,this.asyncQueue=null,this.uc=function(){n.cc++,n.currentUser=n.ac(),n.oc.resolve(),n.changeListener&&n.asyncQueue.enqueueRetryable(function(){return n.changeListener(n.currentUser)})};var o=function(r){ur("FirebaseCredentialsProvider","Auth detected"),n.auth=r,n.auth.addAuthTokenListener(n.uc)};e.onInit(function(r){return o(r)}),setTimeout(function(){if(!n.auth){var r=e.getImmediate({optional:!0});r?o(r):(ur("FirebaseCredentialsProvider","Auth not yet detected"),n.oc.resolve())}},0)}return t.prototype.getToken=function(){var e=this,n=this.cc,o=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(o).then(function(r){return e.cc!==n?(ur("FirebaseCredentialsProvider","getToken aborted due to token change."),e.getToken()):r?(Wi(typeof r.accessToken=="string"),new $tt(r.accessToken,e.currentUser)):null}):Promise.resolve(null)},t.prototype.invalidateToken=function(){this.forceRefresh=!0},t.prototype.setChangeListener=function(e,n){var o=this;this.asyncQueue=e,this.asyncQueue.enqueueRetryable(function(){return vo(o,void 0,void 0,function(){return Ao(this,function(r){switch(r.label){case 0:return[4,this.oc.promise];case 1:return r.sent(),[4,n(this.currentUser)];case 2:return r.sent(),this.changeListener=n,[2]}})})})},t.prototype.removeChangeListener=function(){this.auth&&this.auth.removeAuthTokenListener(this.uc),this.changeListener=function(){return Promise.resolve()}},t.prototype.ac=function(){var e=this.auth&&this.auth.getUid();return Wi(e===null||typeof e=="string"),new cf(e)},t}(),SOn=function(){function t(e,n,o){this.hc=e,this.lc=n,this.fc=o,this.type="FirstParty",this.user=cf.FIRST_PARTY}return Object.defineProperty(t.prototype,"authHeaders",{get:function(){var e={"X-Goog-AuthUser":this.lc},n=this.hc.auth.getAuthHeaderValueForFirstParty([]);return n&&(e.Authorization=n),this.fc&&(e["X-Goog-Iam-Authorization-Token"]=this.fc),e},enumerable:!1,configurable:!0}),t}(),TOn=function(){function t(e,n,o){this.hc=e,this.lc=n,this.fc=o}return t.prototype.getToken=function(){return Promise.resolve(new SOn(this.hc,this.lc,this.fc))},t.prototype.setChangeListener=function(e,n){e.enqueueRetryable(function(){return n(cf.FIRST_PARTY)})},t.prototype.removeChangeListener=function(){},t.prototype.invalidateToken=function(){},t}();/** + */function Xtt(t,e){return vo(this,void 0,void 0,function(){var n,o,r=this;return Ao(this,function(i){switch(i.label){case 0:return t.asyncQueue.verifyOperationInProgress(),ur("FirestoreClient","Initializing OfflineComponentProvider"),[4,t.getConfiguration()];case 1:return n=i.sent(),[4,e.initialize(n)];case 2:return i.sent(),o=n.initialUser,t.setCredentialChangeListener(function(a){return vo(r,void 0,void 0,function(){return Ao(this,function(l){switch(l.label){case 0:return o.isEqual(a)?[3,2]:[4,Ctt(e.localStore,a)];case 1:l.sent(),o=a,l.label=2;case 2:return[2]}})})}),e.persistence.setDatabaseDeletedListener(function(){return t.terminate()}),t.offlineComponents=e,[2]}})})}function Jtt(t,e){return vo(this,void 0,void 0,function(){var n,o;return Ao(this,function(r){switch(r.label){case 0:return t.asyncQueue.verifyOperationInProgress(),[4,y5e(t)];case 1:return n=r.sent(),ur("FirestoreClient","Initializing OnlineComponentProvider"),[4,t.getConfiguration()];case 2:return o=r.sent(),[4,e.initialize(n,o)];case 3:return r.sent(),t.setCredentialChangeListener(function(i){return function(a,l){return vo(this,void 0,void 0,function(){var s,c;return Ao(this,function(u){switch(u.label){case 0:return(s=Ir(a)).asyncQueue.verifyOperationInProgress(),ur("RemoteStore","RemoteStore received new credentials"),c=_w(s),s.Or.add(3),[4,aM(s)];case 1:return u.sent(),c&&s.Br.set("Unknown"),[4,s.remoteSyncer.handleCredentialChange(l)];case 2:return u.sent(),s.Or.delete(3),[4,BN(s)];case 3:return u.sent(),[2]}})})}(e.remoteStore,i)}),t.onlineComponents=e,[2]}})})}function y5e(t){return vo(this,void 0,void 0,function(){return Ao(this,function(e){switch(e.label){case 0:return t.offlineComponents?[3,2]:(ur("FirestoreClient","Using default OfflineComponentProvider"),[4,Xtt(t,new Vtt)]);case 1:e.sent(),e.label=2;case 2:return[2,t.offlineComponents]}})})}function EZ(t){return vo(this,void 0,void 0,function(){return Ao(this,function(e){switch(e.label){case 0:return t.onlineComponents?[3,2]:(ur("FirestoreClient","Using default OnlineComponentProvider"),[4,Jtt(t,new Kde)]);case 1:e.sent(),e.label=2;case 2:return[2,t.onlineComponents]}})})}function sCe(t){return y5e(t).then(function(e){return e.persistence})}function Ktt(t){return y5e(t).then(function(e){return e.localStore})}function cCe(t){return EZ(t).then(function(e){return e.remoteStore})}function qtt(t){return EZ(t).then(function(e){return e.syncEngine})}function XR(t){return vo(this,void 0,void 0,function(){var e,n;return Ao(this,function(o){switch(o.label){case 0:return[4,EZ(t)];case 1:return e=o.sent(),[2,((n=e.eventManager).onListen=ZYn.bind(null,e.syncEngine),n.onUnlisten=eOn.bind(null,e.syncEngine),n)]}})})}function uCe(t,e,n){var o=this;n===void 0&&(n={});var r=new a1;return t.asyncQueue.enqueueAndForget(function(){return vo(o,void 0,void 0,function(){var i;return Ao(this,function(a){switch(a.label){case 0:return i=function(l,s,c,u,d){var f=new DZ({next:function(g){s.enqueueAndForget(function(){return s5e(l,p)});var y=g.docs.has(c);!y&&g.fromCache?d.reject(new ko(On.UNAVAILABLE,"Failed to get document because the client is offline.")):y&&g.fromCache&&u&&u.source==="server"?d.reject(new ko(On.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):d.resolve(g)},error:function(g){return d.reject(g)}}),p=new u5e(kN(c.path),f,{includeMetadataChanges:!0,so:!0});return l5e(l,p)},[4,XR(t)];case 1:return[2,i.apply(void 0,[a.sent(),t.asyncQueue,e,n,r])]}})})}),r.promise}function dCe(t,e,n){var o=this;n===void 0&&(n={});var r=new a1;return t.asyncQueue.enqueueAndForget(function(){return vo(o,void 0,void 0,function(){var i;return Ao(this,function(a){switch(a.label){case 0:return i=function(l,s,c,u,d){var f=new DZ({next:function(g){s.enqueueAndForget(function(){return s5e(l,p)}),g.fromCache&&u.source==="server"?d.reject(new ko(On.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):d.resolve(g)},error:function(g){return d.reject(g)}}),p=new u5e(c,f,{includeMetadataChanges:!0,so:!0});return l5e(l,p)},[4,XR(t)];case 1:return[2,i.apply(void 0,[a.sent(),t.asyncQueue,e,n,r])]}})})}),r.promise}var vOn=function(t,e,n,o,r,i,a,l){this.databaseId=t,this.appId=e,this.persistenceKey=n,this.host=o,this.ssl=r,this.forceLongPolling=i,this.autoDetectLongPolling=a,this.useFetchStreams=l},OX=function(){function t(e,n){this.projectId=e,this.database=n||"(default)"}return Object.defineProperty(t.prototype,"isDefaultDatabase",{get:function(){return this.database==="(default)"},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database},t}(),fCe=new Map,$tt=function(t,e){this.user=e,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization="Bearer "+t},hCe=function(){function t(){this.changeListener=null}return t.prototype.getToken=function(){return Promise.resolve(null)},t.prototype.invalidateToken=function(){},t.prototype.setChangeListener=function(e,n){this.changeListener=n,e.enqueueRetryable(function(){return n(cf.UNAUTHENTICATED)})},t.prototype.removeChangeListener=function(){this.changeListener=null},t}(),xOn=function(){function t(e){this.token=e,this.changeListener=null}return t.prototype.getToken=function(){return Promise.resolve(this.token)},t.prototype.invalidateToken=function(){},t.prototype.setChangeListener=function(e,n){var o=this;this.changeListener=n,e.enqueueRetryable(function(){return n(o.token.user)})},t.prototype.removeChangeListener=function(){this.changeListener=null},t}(),bOn=function(){function t(e){var n=this;this.currentUser=cf.UNAUTHENTICATED,this.oc=new a1,this.cc=0,this.forceRefresh=!1,this.auth=null,this.asyncQueue=null,this.uc=function(){n.cc++,n.currentUser=n.ac(),n.oc.resolve(),n.changeListener&&n.asyncQueue.enqueueRetryable(function(){return n.changeListener(n.currentUser)})};var o=function(r){ur("FirebaseCredentialsProvider","Auth detected"),n.auth=r,n.auth.addAuthTokenListener(n.uc)};e.onInit(function(r){return o(r)}),setTimeout(function(){if(!n.auth){var r=e.getImmediate({optional:!0});r?o(r):(ur("FirebaseCredentialsProvider","Auth not yet detected"),n.oc.resolve())}},0)}return t.prototype.getToken=function(){var e=this,n=this.cc,o=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(o).then(function(r){return e.cc!==n?(ur("FirebaseCredentialsProvider","getToken aborted due to token change."),e.getToken()):r?(Wi(typeof r.accessToken=="string"),new $tt(r.accessToken,e.currentUser)):null}):Promise.resolve(null)},t.prototype.invalidateToken=function(){this.forceRefresh=!0},t.prototype.setChangeListener=function(e,n){var o=this;this.asyncQueue=e,this.asyncQueue.enqueueRetryable(function(){return vo(o,void 0,void 0,function(){return Ao(this,function(r){switch(r.label){case 0:return[4,this.oc.promise];case 1:return r.sent(),[4,n(this.currentUser)];case 2:return r.sent(),this.changeListener=n,[2]}})})})},t.prototype.removeChangeListener=function(){this.auth&&this.auth.removeAuthTokenListener(this.uc),this.changeListener=function(){return Promise.resolve()}},t.prototype.ac=function(){var e=this.auth&&this.auth.getUid();return Wi(e===null||typeof e=="string"),new cf(e)},t}(),SOn=function(){function t(e,n,o){this.hc=e,this.lc=n,this.fc=o,this.type="FirstParty",this.user=cf.FIRST_PARTY}return Object.defineProperty(t.prototype,"authHeaders",{get:function(){var e={"X-Goog-AuthUser":this.lc},n=this.hc.auth.getAuthHeaderValueForFirstParty([]);return n&&(e.Authorization=n),this.fc&&(e["X-Goog-Iam-Authorization-Token"]=this.fc),e},enumerable:!1,configurable:!0}),t}(),TOn=function(){function t(e,n,o){this.hc=e,this.lc=n,this.fc=o}return t.prototype.getToken=function(){return Promise.resolve(new SOn(this.hc,this.lc,this.fc))},t.prototype.setChangeListener=function(e,n){e.enqueueRetryable(function(){return n(cf.FIRST_PARTY)})},t.prototype.removeChangeListener=function(){},t.prototype.invalidateToken=function(){},t}();/** * @license * Copyright 2017 Google LLC * @@ -6201,7 +6201,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function y5e(t,e,n){if(!n)throw new ko(On.INVALID_ARGUMENT,"Function "+t+"() cannot be called with an empty "+e+".")}function A5e(t,e){if(e===void 0)return{merge:!1};if(e.mergeFields!==void 0&&e.merge!==void 0)throw new ko(On.INVALID_ARGUMENT,"Invalid options passed to function "+t+'(): You cannot specify both "merge" and "mergeFields".');return e}function Qtt(t,e,n,o){if(e===!0&&o===!0)throw new ko(On.INVALID_ARGUMENT,t+" and "+n+" cannot be used together.")}function hCe(t){if(!ci.isDocumentKey(t))throw new ko(On.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+t+" has "+t.length+".")}function pCe(t){if(ci.isDocumentKey(t))throw new ko(On.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+t+" has "+t.length+".")}function FZ(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=t.substring(0,20)+"..."),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";var e=function(n){if(n.constructor){var o=/function\s+([^\s(]+)\s*\(/.exec(n.constructor.toString());if(o&&o.length>1)return o[1]}return null}(t);return e?"a custom "+e+" object":"an object"}return typeof t=="function"?"a function":ri()}function ts(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new ko(On.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");var n=FZ(t);throw new ko(On.INVALID_ARGUMENT,"Expected type '"+e.name+"', but it was: "+n)}return t}function gCe(t,e){if(e<=0)throw new ko(On.INVALID_ARGUMENT,"Function "+t+"() requires a positive number, but it was: "+e+".")}/** + */function A5e(t,e,n){if(!n)throw new ko(On.INVALID_ARGUMENT,"Function "+t+"() cannot be called with an empty "+e+".")}function w5e(t,e){if(e===void 0)return{merge:!1};if(e.mergeFields!==void 0&&e.merge!==void 0)throw new ko(On.INVALID_ARGUMENT,"Invalid options passed to function "+t+'(): You cannot specify both "merge" and "mergeFields".');return e}function Qtt(t,e,n,o){if(e===!0&&o===!0)throw new ko(On.INVALID_ARGUMENT,t+" and "+n+" cannot be used together.")}function pCe(t){if(!ci.isDocumentKey(t))throw new ko(On.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+t+" has "+t.length+".")}function gCe(t){if(ci.isDocumentKey(t))throw new ko(On.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+t+" has "+t.length+".")}function FZ(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=t.substring(0,20)+"..."),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";var e=function(n){if(n.constructor){var o=/function\s+([^\s(]+)\s*\(/.exec(n.constructor.toString());if(o&&o.length>1)return o[1]}return null}(t);return e?"a custom "+e+" object":"an object"}return typeof t=="function"?"a function":ri()}function ts(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new ko(On.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");var n=FZ(t);throw new ko(On.INVALID_ARGUMENT,"Expected type '"+e.name+"', but it was: "+n)}return t}function mCe(t,e){if(e<=0)throw new ko(On.INVALID_ARGUMENT,"Function "+t+"() requires a positive number, but it was: "+e+".")}/** * @license * Copyright 2020 Google LLC * @@ -6216,7 +6216,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var mCe=function(){function t(e){var n;if(e.host===void 0){if(e.ssl!==void 0)throw new ko(On.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(n=e.ssl)===null||n===void 0||n;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new ko(On.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.useFetchStreams=!!e.useFetchStreams,Qtt("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling)}return t.prototype.isEqual=function(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams},t}(),Ik=function(){function t(e,n){this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new mCe({}),this._settingsFrozen=!1,e instanceof YX?(this._databaseId=e,this._credentials=new fCe):(this._app=e,this._databaseId=function(o){if(!Object.prototype.hasOwnProperty.apply(o.options,["projectId"]))throw new ko(On.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new YX(o.options.projectId)}(e),this._credentials=new bOn(n))}return Object.defineProperty(t.prototype,"app",{get:function(){if(!this._app)throw new ko(On.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_initialized",{get:function(){return this._settingsFrozen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_terminated",{get:function(){return this._terminateTask!==void 0},enumerable:!1,configurable:!0}),t.prototype._setSettings=function(e){if(this._settingsFrozen)throw new ko(On.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new mCe(e),e.credentials!==void 0&&(this._credentials=function(n){if(!n)return new fCe;switch(n.type){case"gapi":var o=n.client;return Wi(!(typeof o!="object"||o===null||!o.auth||!o.auth.getAuthHeaderValueForFirstParty)),new TOn(o,n.sessionIndex||"0",n.iamToken||null);case"provider":return n.client;default:throw new ko(On.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(e.credentials))},t.prototype._getSettings=function(){return this._settings},t.prototype._freezeSettings=function(){return this._settingsFrozen=!0,this._settings},t.prototype._delete=function(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask},t.prototype.toJSON=function(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}},t.prototype._terminate=function(){return e=this,(n=dCe.get(e))&&(ur("ComponentProvider","Removing Datastore"),dCe.delete(e),n.terminate()),Promise.resolve();var e,n},t}(),t0=function(){function t(e,n,o){this.converter=n,this._key=o,this.type="document",this.firestore=e}return Object.defineProperty(t.prototype,"_path",{get:function(){return this._key.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new _8(this.firestore,this.converter,this._key.path.popLast())},enumerable:!1,configurable:!0}),t.prototype.withConverter=function(e){return new t(this.firestore,e,this._key)},t}(),Rg=function(){function t(e,n,o){this.converter=n,this._query=o,this.type="query",this.firestore=e}return t.prototype.withConverter=function(e){return new t(this.firestore,e,this._query)},t}(),_8=function(t){function e(n,o,r){var i=this;return(i=t.call(this,n,o,FN(r))||this)._path=r,i.type="collection",i}return Pr(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var n=this._path.popLast();return n.isEmpty()?null:new t0(this.firestore,null,new ci(n))},enumerable:!1,configurable:!0}),e.prototype.withConverter=function(n){return new e(this.firestore,n,this._path)},e}(Rg);/** + */var yCe=function(){function t(e){var n;if(e.host===void 0){if(e.ssl!==void 0)throw new ko(On.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(n=e.ssl)===null||n===void 0||n;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new ko(On.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.useFetchStreams=!!e.useFetchStreams,Qtt("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling)}return t.prototype.isEqual=function(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams},t}(),Ik=function(){function t(e,n){this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new yCe({}),this._settingsFrozen=!1,e instanceof OX?(this._databaseId=e,this._credentials=new hCe):(this._app=e,this._databaseId=function(o){if(!Object.prototype.hasOwnProperty.apply(o.options,["projectId"]))throw new ko(On.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new OX(o.options.projectId)}(e),this._credentials=new bOn(n))}return Object.defineProperty(t.prototype,"app",{get:function(){if(!this._app)throw new ko(On.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_initialized",{get:function(){return this._settingsFrozen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_terminated",{get:function(){return this._terminateTask!==void 0},enumerable:!1,configurable:!0}),t.prototype._setSettings=function(e){if(this._settingsFrozen)throw new ko(On.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new yCe(e),e.credentials!==void 0&&(this._credentials=function(n){if(!n)return new hCe;switch(n.type){case"gapi":var o=n.client;return Wi(!(typeof o!="object"||o===null||!o.auth||!o.auth.getAuthHeaderValueForFirstParty)),new TOn(o,n.sessionIndex||"0",n.iamToken||null);case"provider":return n.client;default:throw new ko(On.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(e.credentials))},t.prototype._getSettings=function(){return this._settings},t.prototype._freezeSettings=function(){return this._settingsFrozen=!0,this._settings},t.prototype._delete=function(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask},t.prototype.toJSON=function(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}},t.prototype._terminate=function(){return e=this,(n=fCe.get(e))&&(ur("ComponentProvider","Removing Datastore"),fCe.delete(e),n.terminate()),Promise.resolve();var e,n},t}(),t0=function(){function t(e,n,o){this.converter=n,this._key=o,this.type="document",this.firestore=e}return Object.defineProperty(t.prototype,"_path",{get:function(){return this._key.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new _8(this.firestore,this.converter,this._key.path.popLast())},enumerable:!1,configurable:!0}),t.prototype.withConverter=function(e){return new t(this.firestore,e,this._key)},t}(),Rg=function(){function t(e,n,o){this.converter=n,this._query=o,this.type="query",this.firestore=e}return t.prototype.withConverter=function(e){return new t(this.firestore,e,this._query)},t}(),_8=function(t){function e(n,o,r){var i=this;return(i=t.call(this,n,o,kN(r))||this)._path=r,i.type="collection",i}return Pr(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var n=this._path.popLast();return n.isEmpty()?null:new t0(this.firestore,null,new ci(n))},enumerable:!1,configurable:!0}),e.prototype.withConverter=function(n){return new e(this.firestore,n,this._path)},e}(Rg);/** * @license * Copyright 2020 Google LLC * @@ -6231,7 +6231,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Ztt(t,e){for(var n,o=[],r=2;r0&&this.Zi.ji(function(){return n.bc()}),o.label=5;case 5:return[2]}})})},t.prototype.Rc=function(e){var n=this,o=this.dc.then(function(){return n.gc=!0,e().catch(function(r){throw n.yc=r,n.gc=!1,cu("INTERNAL UNHANDLED ERROR: ",function(i){var a=i.message||"";return i.stack&&(a=i.stack.includes(i.message)?i.stack:i.message+` + */function Ztt(t,e){for(var n,o=[],r=2;r0&&this.Zi.ji(function(){return n.bc()}),o.label=5;case 5:return[2]}})})},t.prototype.Rc=function(e){var n=this,o=this.dc.then(function(){return n.gc=!0,e().catch(function(r){throw n.yc=r,n.gc=!1,cu("INTERNAL UNHANDLED ERROR: ",function(i){var a=i.message||"";return i.stack&&(a=i.stack.includes(i.message)?i.stack:i.message+` `+i.stack),a}(r)),r}).then(function(r){return n.gc=!1,r})});return this.dc=o,o},t.prototype.enqueueAfterDelay=function(e,n,o){var r=this;this.Ac(),this.Tc.indexOf(e)>-1&&(n=0);var i=VYn.createAndSchedule(this,e,n,o,function(a){return r.vc(a)});return this.mc.push(i),i},t.prototype.Ac=function(){this.yc&&ri()},t.prototype.verifyOperationInProgress=function(){},t.prototype.Pc=function(){return vo(this,void 0,void 0,function(){var e;return Ao(this,function(n){switch(n.label){case 0:return[4,e=this.dc];case 1:n.sent(),n.label=2;case 2:if(e!==this.dc)return[3,0];n.label=3;case 3:return[2]}})})},t.prototype.Vc=function(e){for(var n=0,o=this.mc;n90)throw new ko(On.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new ko(On.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}return Object.defineProperty(t.prototype,"latitude",{get:function(){return this._lat},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"longitude",{get:function(){return this._long},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return this._lat===e._lat&&this._long===e._long},t.prototype.toJSON=function(){return{latitude:this._lat,longitude:this._long}},t.prototype._compareTo=function(e){return $a(this._lat,e._lat)||$a(this._long,e._long)},t}(),ROn=/^__.*__$/,HOn=function(){function t(e,n,o){this.data=e,this.fieldMask=n,this.fieldTransforms=o}return t.prototype.toMutation=function(e,n){return this.fieldMask!==null?new Ow(e,this.data,this.fieldMask,n,this.fieldTransforms):new NN(e,this.data,n,this.fieldTransforms)},t}(),ont=function(){function t(e,n,o){this.data=e,this.fieldMask=n,this.fieldTransforms=o}return t.prototype.toMutation=function(e,n){return new Ow(e,this.data,this.fieldMask,n,this.fieldTransforms)},t}();/** + */var M9=function(){function t(){for(var e=[],n=0;n90)throw new ko(On.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new ko(On.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}return Object.defineProperty(t.prototype,"latitude",{get:function(){return this._lat},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"longitude",{get:function(){return this._long},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return this._lat===e._lat&&this._long===e._long},t.prototype.toJSON=function(){return{latitude:this._lat,longitude:this._long}},t.prototype._compareTo=function(e){return $a(this._lat,e._lat)||$a(this._long,e._long)},t}(),ROn=/^__.*__$/,HOn=function(){function t(e,n,o){this.data=e,this.fieldMask=n,this.fieldTransforms=o}return t.prototype.toMutation=function(e,n){return this.fieldMask!==null?new Ow(e,this.data,this.fieldMask,n,this.fieldTransforms):new UN(e,this.data,n,this.fieldTransforms)},t}(),ont=function(){function t(e,n,o){this.data=e,this.fieldMask=n,this.fieldTransforms=o}return t.prototype.toMutation=function(e,n){return new Ow(e,this.data,this.fieldMask,n,this.fieldTransforms)},t}();/** * @license * Copyright 2020 Google LLC * @@ -6277,7 +6277,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function rnt(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw ri()}}var int=function(){function t(e,n,o,r,i,a){this.settings=e,this.databaseId=n,this.R=o,this.ignoreUndefinedProperties=r,i===void 0&&this.Cc(),this.fieldTransforms=i||[],this.fieldMask=a||[]}return Object.defineProperty(t.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Nc",{get:function(){return this.settings.Nc},enumerable:!1,configurable:!0}),t.prototype.xc=function(e){return new t(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.R,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)},t.prototype.kc=function(e){var n,o=(n=this.path)===null||n===void 0?void 0:n.child(e),r=this.xc({path:o,Fc:!1});return r.$c(e),r},t.prototype.Oc=function(e){var n,o=(n=this.path)===null||n===void 0?void 0:n.child(e),r=this.xc({path:o,Fc:!1});return r.Cc(),r},t.prototype.Mc=function(e){return this.xc({path:void 0,Fc:!0})},t.prototype.Lc=function(e){return OX(e,this.settings.methodName,this.settings.Bc||!1,this.path,this.settings.qc)},t.prototype.contains=function(e){return this.fieldMask.find(function(n){return e.isPrefixOf(n)})!==void 0||this.fieldTransforms.find(function(n){return e.isPrefixOf(n.field)})!==void 0},t.prototype.Cc=function(){if(this.path)for(var e=0;e=0;--f)if(!unt(u,l[f])){var p=l[f],g=s[f];g=ba(g);var y=a.Oc(p);if(g instanceof w5e)u.push(p);else{var w=$b(g,y);w!=null&&(u.push(p),d.set(p,w))}}var b=new FR(u);return new ont(d,b,a.fieldTransforms)}function lnt(t,e,n,o){return o===void 0&&(o=!1),$b(n,t.Uc(o?4:3,e))}function $b(t,e){if(cnt(t=ba(t)))return b5e("Unsupported field value:",e,t),snt(t,e);if(t instanceof Kb)return function(n,o){if(!rnt(o.Nc))throw o.Lc(n._methodName+"() can only be used with update() and set()");if(!o.path)throw o.Lc(n._methodName+"() is not currently supported inside arrays");var r=n._toFieldTransform(o);r&&o.fieldTransforms.push(r)}(t,e),null;if(t===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.Fc&&e.Nc!==4)throw e.Lc("Nested arrays are not supported");return function(n,o){for(var r=[],i=0,a=0,l=n;a0&&e.fieldMask.push(e.path):Vb(t,function(o,r){var i=$b(r,e.kc(o));i!=null&&(n[o]=i)}),{mapValue:{fields:n}}}function cnt(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof Zp||t instanceof kZ||t instanceof ab||t instanceof t0||t instanceof Kb)}function b5e(t,e,n){if(!cnt(n)||!function(r){return typeof r=="object"&&r!==null&&(Object.getPrototypeOf(r)===Object.prototype||Object.getPrototypeOf(r)===null)}(n)){var o=FZ(n);throw o==="an object"?e.Lc(t+" a custom object"):e.Lc(t+" "+o)}}function qde(t,e,n){if((e=ba(e))instanceof M9)return e._internalPath;if(typeof e=="string")return S5e(t,e);throw OX("Field path arguments must be of type string or FieldPath.",t,!1,void 0,n)}var FOn=new RegExp("[~\\*/\\[\\]]");function S5e(t,e,n){if(e.search(FOn)>=0)throw OX("Invalid field path ("+e+"). Paths must not contain '~', '*', '/', '[', or ']'",t,!1,void 0,n);try{return new(M9.bind.apply(M9,yl([void 0],e.split("."))))()._internalPath}catch{throw OX("Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'",t,!1,void 0,n)}}function OX(t,e,n,o,r){var i=o&&!o.isEmpty(),a=r!==void 0,l="Function "+e+"() called with invalid data";n&&(l+=" (via `toFirestore()`)");var s="";return(i||a)&&(s+=" (found",i&&(s+=" in field "+o),a&&(s+=" in document "+r),s+=")"),new ko(On.INVALID_ARGUMENT,(l+=". ")+t+s)}function unt(t,e){return t.some(function(n){return n.isEqual(e)})}/** + */function rnt(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw ri()}}var int=function(){function t(e,n,o,r,i,a){this.settings=e,this.databaseId=n,this.R=o,this.ignoreUndefinedProperties=r,i===void 0&&this.Cc(),this.fieldTransforms=i||[],this.fieldMask=a||[]}return Object.defineProperty(t.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Nc",{get:function(){return this.settings.Nc},enumerable:!1,configurable:!0}),t.prototype.xc=function(e){return new t(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.R,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)},t.prototype.kc=function(e){var n,o=(n=this.path)===null||n===void 0?void 0:n.child(e),r=this.xc({path:o,Fc:!1});return r.$c(e),r},t.prototype.Oc=function(e){var n,o=(n=this.path)===null||n===void 0?void 0:n.child(e),r=this.xc({path:o,Fc:!1});return r.Cc(),r},t.prototype.Mc=function(e){return this.xc({path:void 0,Fc:!0})},t.prototype.Lc=function(e){return _X(e,this.settings.methodName,this.settings.Bc||!1,this.path,this.settings.qc)},t.prototype.contains=function(e){return this.fieldMask.find(function(n){return e.isPrefixOf(n)})!==void 0||this.fieldTransforms.find(function(n){return e.isPrefixOf(n.field)})!==void 0},t.prototype.Cc=function(){if(this.path)for(var e=0;e=0;--f)if(!unt(u,l[f])){var p=l[f],g=s[f];g=ba(g);var y=a.Oc(p);if(g instanceof v5e)u.push(p);else{var w=$b(g,y);w!=null&&(u.push(p),d.set(p,w))}}var b=new FR(u);return new ont(d,b,a.fieldTransforms)}function lnt(t,e,n,o){return o===void 0&&(o=!1),$b(n,t.Uc(o?4:3,e))}function $b(t,e){if(cnt(t=ba(t)))return S5e("Unsupported field value:",e,t),snt(t,e);if(t instanceof Kb)return function(n,o){if(!rnt(o.Nc))throw o.Lc(n._methodName+"() can only be used with update() and set()");if(!o.path)throw o.Lc(n._methodName+"() is not currently supported inside arrays");var r=n._toFieldTransform(o);r&&o.fieldTransforms.push(r)}(t,e),null;if(t===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.Fc&&e.Nc!==4)throw e.Lc("Nested arrays are not supported");return function(n,o){for(var r=[],i=0,a=0,l=n;a0&&e.fieldMask.push(e.path):Vb(t,function(o,r){var i=$b(r,e.kc(o));i!=null&&(n[o]=i)}),{mapValue:{fields:n}}}function cnt(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof Zp||t instanceof kZ||t instanceof ab||t instanceof t0||t instanceof Kb)}function S5e(t,e,n){if(!cnt(n)||!function(r){return typeof r=="object"&&r!==null&&(Object.getPrototypeOf(r)===Object.prototype||Object.getPrototypeOf(r)===null)}(n)){var o=FZ(n);throw o==="an object"?e.Lc(t+" a custom object"):e.Lc(t+" "+o)}}function qde(t,e,n){if((e=ba(e))instanceof M9)return e._internalPath;if(typeof e=="string")return T5e(t,e);throw _X("Field path arguments must be of type string or FieldPath.",t,!1,void 0,n)}var FOn=new RegExp("[~\\*/\\[\\]]");function T5e(t,e,n){if(e.search(FOn)>=0)throw _X("Invalid field path ("+e+"). Paths must not contain '~', '*', '/', '[', or ']'",t,!1,void 0,n);try{return new(M9.bind.apply(M9,yl([void 0],e.split("."))))()._internalPath}catch{throw _X("Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'",t,!1,void 0,n)}}function _X(t,e,n,o,r){var i=o&&!o.isEmpty(),a=r!==void 0,l="Function "+e+"() called with invalid data";n&&(l+=" (via `toFirestore()`)");var s="";return(i||a)&&(s+=" (found",i&&(s+=" in field "+o),a&&(s+=" in document "+r),s+=")"),new ko(On.INVALID_ARGUMENT,(l+=". ")+t+s)}function unt(t,e){return t.some(function(n){return n.isEqual(e)})}/** * @license * Copyright 2020 Google LLC * @@ -6292,7 +6292,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var zk=function(){function t(e,n,o,r,i){this._firestore=e,this._userDataWriter=n,this._key=o,this._document=r,this._converter=i}return Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new t0(this._firestore,this._converter,this._key)},enumerable:!1,configurable:!0}),t.prototype.exists=function(){return this._document!==null},t.prototype.data=function(){if(this._document){if(this._converter){var e=new kOn(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}},t.prototype.get=function(e){if(this._document){var n=this._document.data.field(_X("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}},t}(),kOn=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return Pr(e,t),e.prototype.data=function(){return t.prototype.data.call(this)},e}(zk);function _X(t,e){return typeof e=="string"?S5e(t,e):e instanceof M9?e._internalPath:e._delegate._internalPath}/** + */var zk=function(){function t(e,n,o,r,i){this._firestore=e,this._userDataWriter=n,this._key=o,this._document=r,this._converter=i}return Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new t0(this._firestore,this._converter,this._key)},enumerable:!1,configurable:!0}),t.prototype.exists=function(){return this._document!==null},t.prototype.data=function(){if(this._document){if(this._converter){var e=new kOn(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}},t.prototype.get=function(e){if(this._document){var n=this._document.data.field(VX("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}},t}(),kOn=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return Pr(e,t),e.prototype.data=function(){return t.prototype.data.call(this)},e}(zk);function VX(t,e){return typeof e=="string"?T5e(t,e):e instanceof M9?e._internalPath:e._delegate._internalPath}/** * @license * Copyright 2020 Google LLC * @@ -6307,7 +6307,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var Xv=function(){function t(e,n){this.hasPendingWrites=e,this.fromCache=n}return t.prototype.isEqual=function(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache},t}(),N6=function(t){function e(n,o,r,i,a,l){var s=this;return(s=t.call(this,n,o,r,i,l)||this)._firestore=n,s._firestoreImpl=n,s.metadata=a,s}return Pr(e,t),e.prototype.exists=function(){return t.prototype.exists.call(this)},e.prototype.data=function(n){if(n===void 0&&(n={}),this._document){if(this._converter){var o=new kE(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(o,n)}return this._userDataWriter.convertValue(this._document.data.value,n.serverTimestamps)}},e.prototype.get=function(n,o){if(o===void 0&&(o={}),this._document){var r=this._document.data.field(_X("DocumentSnapshot.get",n));if(r!==null)return this._userDataWriter.convertValue(r,o.serverTimestamps)}},e}(zk),kE=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return Pr(e,t),e.prototype.data=function(n){return n===void 0&&(n={}),t.prototype.data.call(this,n)},e}(N6),l8=function(){function t(e,n,o,r){this._firestore=e,this._userDataWriter=n,this._snapshot=r,this.metadata=new Xv(r.hasPendingWrites,r.fromCache),this.query=o}return Object.defineProperty(t.prototype,"docs",{get:function(){var e=[];return this.forEach(function(n){return e.push(n)}),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return this.size===0},enumerable:!1,configurable:!0}),t.prototype.forEach=function(e,n){var o=this;this._snapshot.docs.forEach(function(r){e.call(n,new kE(o._firestore,o._userDataWriter,r.key,r,new Xv(o._snapshot.mutatedKeys.has(r.key),o._snapshot.fromCache),o.query.converter))})},t.prototype.docChanges=function(e){e===void 0&&(e={});var n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new ko(On.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(o,r){if(o._snapshot.oldDocs.isEmpty()){var i=0;return o._snapshot.docChanges.map(function(l){return{type:"added",doc:new kE(o._firestore,o._userDataWriter,l.doc.key,l.doc,new Xv(o._snapshot.mutatedKeys.has(l.doc.key),o._snapshot.fromCache),o.query.converter),oldIndex:-1,newIndex:i++}})}var a=o._snapshot.oldDocs;return o._snapshot.docChanges.filter(function(l){return r||l.type!==3}).map(function(l){var s=new kE(o._firestore,o._userDataWriter,l.doc.key,l.doc,new Xv(o._snapshot.mutatedKeys.has(l.doc.key),o._snapshot.fromCache),o.query.converter),c=-1,u=-1;return l.type!==0&&(c=a.indexOf(l.doc.key),a=a.delete(l.doc.key)),l.type!==1&&(u=(a=a.add(l.doc)).indexOf(l.doc.key)),{type:LOn(l.type),doc:s,oldIndex:c,newIndex:u}})}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges},t}();function LOn(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return ri()}}function dnt(t,e){return t instanceof N6&&e instanceof N6?t._firestore===e._firestore&&t._key.isEqual(e._key)&&(t._document===null?e._document===null:t._document.isEqual(e._document))&&t._converter===e._converter:t instanceof l8&&e instanceof l8&&t._firestore===e._firestore&&tnt(t.query,e.query)&&t.metadata.isEqual(e.metadata)&&t._snapshot.isEqual(e._snapshot)}/** + */var Xv=function(){function t(e,n){this.hasPendingWrites=e,this.fromCache=n}return t.prototype.isEqual=function(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache},t}(),N6=function(t){function e(n,o,r,i,a,l){var s=this;return(s=t.call(this,n,o,r,i,l)||this)._firestore=n,s._firestoreImpl=n,s.metadata=a,s}return Pr(e,t),e.prototype.exists=function(){return t.prototype.exists.call(this)},e.prototype.data=function(n){if(n===void 0&&(n={}),this._document){if(this._converter){var o=new kE(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(o,n)}return this._userDataWriter.convertValue(this._document.data.value,n.serverTimestamps)}},e.prototype.get=function(n,o){if(o===void 0&&(o={}),this._document){var r=this._document.data.field(VX("DocumentSnapshot.get",n));if(r!==null)return this._userDataWriter.convertValue(r,o.serverTimestamps)}},e}(zk),kE=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return Pr(e,t),e.prototype.data=function(n){return n===void 0&&(n={}),t.prototype.data.call(this,n)},e}(N6),l8=function(){function t(e,n,o,r){this._firestore=e,this._userDataWriter=n,this._snapshot=r,this.metadata=new Xv(r.hasPendingWrites,r.fromCache),this.query=o}return Object.defineProperty(t.prototype,"docs",{get:function(){var e=[];return this.forEach(function(n){return e.push(n)}),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return this.size===0},enumerable:!1,configurable:!0}),t.prototype.forEach=function(e,n){var o=this;this._snapshot.docs.forEach(function(r){e.call(n,new kE(o._firestore,o._userDataWriter,r.key,r,new Xv(o._snapshot.mutatedKeys.has(r.key),o._snapshot.fromCache),o.query.converter))})},t.prototype.docChanges=function(e){e===void 0&&(e={});var n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new ko(On.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(o,r){if(o._snapshot.oldDocs.isEmpty()){var i=0;return o._snapshot.docChanges.map(function(l){return{type:"added",doc:new kE(o._firestore,o._userDataWriter,l.doc.key,l.doc,new Xv(o._snapshot.mutatedKeys.has(l.doc.key),o._snapshot.fromCache),o.query.converter),oldIndex:-1,newIndex:i++}})}var a=o._snapshot.oldDocs;return o._snapshot.docChanges.filter(function(l){return r||l.type!==3}).map(function(l){var s=new kE(o._firestore,o._userDataWriter,l.doc.key,l.doc,new Xv(o._snapshot.mutatedKeys.has(l.doc.key),o._snapshot.fromCache),o.query.converter),c=-1,u=-1;return l.type!==0&&(c=a.indexOf(l.doc.key),a=a.delete(l.doc.key)),l.type!==1&&(u=(a=a.add(l.doc)).indexOf(l.doc.key)),{type:LOn(l.type),doc:s,oldIndex:c,newIndex:u}})}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges},t}();function LOn(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return ri()}}function dnt(t,e){return t instanceof N6&&e instanceof N6?t._firestore===e._firestore&&t._key.isEqual(e._key)&&(t._document===null?e._document===null:t._document.isEqual(e._document))&&t._converter===e._converter:t instanceof l8&&e instanceof l8&&t._firestore===e._firestore&&tnt(t.query,e.query)&&t.metadata.isEqual(e.metadata)&&t._snapshot.isEqual(e._snapshot)}/** * @license * Copyright 2020 Google LLC * @@ -6322,7 +6322,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function fnt(t){if(FX(t)&&t.explicitOrderBy.length===0)throw new ko(On.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var BN=function(){};function D4(t){for(var e=[],n=1;n, or >=) must be on the same field. But you have inequality filters on '"+v.toString()+"' and '"+P.field.toString()+"'");var T=O2e(C);T!==null&&pnt(C,P.field,T)}var A=function(x,S){for(var R=0,M=x.filters;R=0)return D.op}return null}(C,function(x){switch(x){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(P.op));if(A!==null)throw A===P.op?new ko(On.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+P.op.toString()+"' filter."):new ko(On.INVALID_ARGUMENT,"Invalid query. You cannot use '"+P.op.toString()+"' filters with '"+A.toString()+"' filters.")}(i,b),b}(n._query,0,o,n.firestore._databaseId,this.jc,this.Wc,this.Gc);return new Rg(n.firestore,n.converter,function(i,a){var l=i.filters.concat([a]);return new vA(i.path,i.collectionGroup,i.explicitOrderBy.slice(),l,i.limit,i.limitType,i.startAt,i.endAt)}(n._query,r))},e}(BN),NOn=function(t){function e(n,o){var r=this;return(r=t.call(this)||this).jc=n,r.zc=o,r.type="orderBy",r}return Pr(e,t),e.prototype._apply=function(n){var o=function(r,i,a){if(r.startAt!==null)throw new ko(On.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(r.endAt!==null)throw new ko(On.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var l=new FC(i,a);return function(s,c){if(O2e(s)===null){var u=_2e(s);u!==null&&pnt(s,u,c.field)}}(r,l),l}(n._query,this.jc,this.zc);return new Rg(n.firestore,n.converter,function(r,i){var a=r.explicitOrderBy.concat([i]);return new vA(r.path,r.collectionGroup,a,r.filters.slice(),r.limit,r.limitType,r.startAt,r.endAt)}(n._query,o))},e}(BN),wCe=function(t){function e(n,o,r){var i=this;return(i=t.call(this)||this).type=n,i.Hc=o,i.Jc=r,i}return Pr(e,t),e.prototype._apply=function(n){return new Rg(n.firestore,n.converter,Yet(n._query,this.Hc,this.Jc))},e}(BN),vCe=function(t){function e(n,o,r){var i=this;return(i=t.call(this)||this).type=n,i.Yc=o,i.Xc=r,i}return Pr(e,t),e.prototype._apply=function(n){var o=hnt(n,this.type,this.Yc,this.Xc);return new Rg(n.firestore,n.converter,function(r,i){return new vA(r.path,r.collectionGroup,r.explicitOrderBy.slice(),r.filters.slice(),r.limit,r.limitType,i,r.endAt)}(n._query,o))},e}(BN),xCe=function(t){function e(n,o,r){var i=this;return(i=t.call(this)||this).type=n,i.Yc=o,i.Xc=r,i}return Pr(e,t),e.prototype._apply=function(n){var o=hnt(n,this.type,this.Yc,this.Xc);return new Rg(n.firestore,n.converter,function(r,i){return new vA(r.path,r.collectionGroup,r.explicitOrderBy.slice(),r.filters.slice(),r.limit,r.limitType,r.startAt,i)}(n._query,o))},e}(BN);function hnt(t,e,n,o){if(n[0]=ba(n[0]),n[0]instanceof zk)return function(i,a,l,s,c){if(!s)throw new ko(On.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+l+"().");for(var u=[],d=0,f=WR(i);dd.length)throw new ko(On.INVALID_ARGUMENT,"Too many arguments provided to "+s+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var f=[],p=0;p10)throw new ko(On.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters support a maximum of 10 elements in the value array.")}function pnt(t,e,n){if(!n.isEqual(e))throw new ko(On.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '"+e.toString()+"' and so you must also use '"+e.toString()+"' as your first argument to orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}/** + */function fnt(t){if(kX(t)&&t.explicitOrderBy.length===0)throw new ko(On.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var YN=function(){};function D4(t){for(var e=[],n=1;n, or >=) must be on the same field. But you have inequality filters on '"+v.toString()+"' and '"+P.field.toString()+"'");var T=_2e(C);T!==null&&pnt(C,P.field,T)}var A=function(x,S){for(var R=0,M=x.filters;R=0)return D.op}return null}(C,function(x){switch(x){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(P.op));if(A!==null)throw A===P.op?new ko(On.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+P.op.toString()+"' filter."):new ko(On.INVALID_ARGUMENT,"Invalid query. You cannot use '"+P.op.toString()+"' filters with '"+A.toString()+"' filters.")}(i,b),b}(n._query,0,o,n.firestore._databaseId,this.jc,this.Wc,this.Gc);return new Rg(n.firestore,n.converter,function(i,a){var l=i.filters.concat([a]);return new vA(i.path,i.collectionGroup,i.explicitOrderBy.slice(),l,i.limit,i.limitType,i.startAt,i.endAt)}(n._query,r))},e}(YN),NOn=function(t){function e(n,o){var r=this;return(r=t.call(this)||this).jc=n,r.zc=o,r.type="orderBy",r}return Pr(e,t),e.prototype._apply=function(n){var o=function(r,i,a){if(r.startAt!==null)throw new ko(On.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(r.endAt!==null)throw new ko(On.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var l=new FC(i,a);return function(s,c){if(_2e(s)===null){var u=V2e(s);u!==null&&pnt(s,u,c.field)}}(r,l),l}(n._query,this.jc,this.zc);return new Rg(n.firestore,n.converter,function(r,i){var a=r.explicitOrderBy.concat([i]);return new vA(r.path,r.collectionGroup,a,r.filters.slice(),r.limit,r.limitType,r.startAt,r.endAt)}(n._query,o))},e}(YN),vCe=function(t){function e(n,o,r){var i=this;return(i=t.call(this)||this).type=n,i.Hc=o,i.Jc=r,i}return Pr(e,t),e.prototype._apply=function(n){return new Rg(n.firestore,n.converter,Yet(n._query,this.Hc,this.Jc))},e}(YN),xCe=function(t){function e(n,o,r){var i=this;return(i=t.call(this)||this).type=n,i.Yc=o,i.Xc=r,i}return Pr(e,t),e.prototype._apply=function(n){var o=hnt(n,this.type,this.Yc,this.Xc);return new Rg(n.firestore,n.converter,function(r,i){return new vA(r.path,r.collectionGroup,r.explicitOrderBy.slice(),r.filters.slice(),r.limit,r.limitType,i,r.endAt)}(n._query,o))},e}(YN),bCe=function(t){function e(n,o,r){var i=this;return(i=t.call(this)||this).type=n,i.Yc=o,i.Xc=r,i}return Pr(e,t),e.prototype._apply=function(n){var o=hnt(n,this.type,this.Yc,this.Xc);return new Rg(n.firestore,n.converter,function(r,i){return new vA(r.path,r.collectionGroup,r.explicitOrderBy.slice(),r.filters.slice(),r.limit,r.limitType,r.startAt,i)}(n._query,o))},e}(YN);function hnt(t,e,n,o){if(n[0]=ba(n[0]),n[0]instanceof zk)return function(i,a,l,s,c){if(!s)throw new ko(On.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+l+"().");for(var u=[],d=0,f=WR(i);dd.length)throw new ko(On.INVALID_ARGUMENT,"Too many arguments provided to "+s+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var f=[],p=0;p10)throw new ko(On.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters support a maximum of 10 elements in the value array.")}function pnt(t,e,n){if(!n.isEqual(e))throw new ko(On.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '"+e.toString()+"' and so you must also use '"+e.toString()+"' as your first argument to orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}/** * @license * Copyright 2020 Google LLC * @@ -6337,7 +6337,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var T5e=function(){function t(){}return t.prototype.convertValue=function(e,n){switch(n===void 0&&(n="none"),ob(e)){case 0:return null;case 1:return e.booleanValue;case 2:return ou(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(kR(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 10:return this.convertObject(e.mapValue,n);default:throw ri()}},t.prototype.convertObject=function(e,n){var o=this,r={};return Vb(e.fields,function(i,a){r[i]=o.convertValue(a,n)}),r},t.prototype.convertGeoPoint=function(e){return new kZ(ou(e.latitude),ou(e.longitude))},t.prototype.convertArray=function(e,n){var o=this;return(e.values||[]).map(function(r){return o.convertValue(r,n)})},t.prototype.convertServerTimestamp=function(e,n){switch(n){case"previous":var o=Wet(e);return o==null?null:this.convertValue(o,n);case"estimate":return this.convertTimestamp(Sk(e));default:return null}},t.prototype.convertTimestamp=function(e){var n=pw(e);return new Zp(n.seconds,n.nanos)},t.prototype.convertDocumentKey=function(e,n){var o=Ol.fromString(e);Wi(dtt(o));var r=new YX(o.get(1),o.get(3)),i=new ci(o.popFirst(5));return r.isEqual(n)||cu("Document "+i+" contains a document reference within a different database ("+r.projectId+"/"+r.database+") which is not supported. It will be treated as a reference in the current database ("+n.projectId+"/"+n.database+") instead."),i},t}();/** + */var P5e=function(){function t(){}return t.prototype.convertValue=function(e,n){switch(n===void 0&&(n="none"),ob(e)){case 0:return null;case 1:return e.booleanValue;case 2:return ou(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(kR(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 10:return this.convertObject(e.mapValue,n);default:throw ri()}},t.prototype.convertObject=function(e,n){var o=this,r={};return Vb(e.fields,function(i,a){r[i]=o.convertValue(a,n)}),r},t.prototype.convertGeoPoint=function(e){return new kZ(ou(e.latitude),ou(e.longitude))},t.prototype.convertArray=function(e,n){var o=this;return(e.values||[]).map(function(r){return o.convertValue(r,n)})},t.prototype.convertServerTimestamp=function(e,n){switch(n){case"previous":var o=Wet(e);return o==null?null:this.convertValue(o,n);case"estimate":return this.convertTimestamp(Sk(e));default:return null}},t.prototype.convertTimestamp=function(e){var n=pw(e);return new Zp(n.seconds,n.nanos)},t.prototype.convertDocumentKey=function(e,n){var o=Ol.fromString(e);Wi(dtt(o));var r=new OX(o.get(1),o.get(3)),i=new ci(o.popFirst(5));return r.isEqual(n)||cu("Document "+i+" contains a document reference within a different database ("+r.projectId+"/"+r.database+") which is not supported. It will be treated as a reference in the current database ("+n.projectId+"/"+n.database+") instead."),i},t}();/** * @license * Copyright 2020 Google LLC * @@ -6352,7 +6352,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function WZ(t,e,n){return t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e}var UOn=function(t){function e(n){var o=this;return(o=t.call(this)||this).firestore=n,o}return Pr(e,t),e.prototype.convertBytes=function(n){return new ab(n)},e.prototype.convertReference=function(n){var o=this.convertDocumentKey(n,this.firestore._databaseId);return new t0(this.firestore,null,o)},e}(T5e),jOn=function(){function t(e,n){this._firestore=e,this._commitHandler=n,this._mutations=[],this._committed=!1,this._dataReader=qb(e)}return t.prototype.set=function(e,n,o){this._verifyNotCommitted();var r=s8(e,this._firestore),i=WZ(r.converter,n,o),a=LZ(this._dataReader,"WriteBatch.set",r._key,i,r.converter!==null,o);return this._mutations.push(a.toMutation(r._key,hh.none())),this},t.prototype.update=function(e,n,o){for(var r=[],i=3;i0?this._commitHandler(this._mutations):Promise.resolve()},t.prototype._verifyNotCommitted=function(){if(this._committed)throw new ko(On.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},t}();/** + */function WZ(t,e,n){return t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e}var UOn=function(t){function e(n){var o=this;return(o=t.call(this)||this).firestore=n,o}return Pr(e,t),e.prototype.convertBytes=function(n){return new ab(n)},e.prototype.convertReference=function(n){var o=this.convertDocumentKey(n,this.firestore._databaseId);return new t0(this.firestore,null,o)},e}(P5e),jOn=function(){function t(e,n){this._firestore=e,this._commitHandler=n,this._mutations=[],this._committed=!1,this._dataReader=qb(e)}return t.prototype.set=function(e,n,o){this._verifyNotCommitted();var r=s8(e,this._firestore),i=WZ(r.converter,n,o),a=LZ(this._dataReader,"WriteBatch.set",r._key,i,r.converter!==null,o);return this._mutations.push(a.toMutation(r._key,hh.none())),this},t.prototype.update=function(e,n,o){for(var r=[],i=3;i0?this._commitHandler(this._mutations):Promise.resolve()},t.prototype._verifyNotCommitted=function(){if(this._committed)throw new ko(On.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},t}();/** * @license * Copyright 2020 Google LLC * @@ -6382,7 +6382,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var Tx=function(t){function e(n){var o=this;return(o=t.call(this)||this).firestore=n,o}return Pr(e,t),e.prototype.convertBytes=function(n){return new ab(n)},e.prototype.convertReference=function(n){var o=this.convertDocumentKey(n,this.firestore._databaseId);return new t0(this.firestore,null,o)},e}(T5e);function TCe(t,e,n){t=ts(t,t0);var o=ts(t.firestore,Wu),r=WZ(t.converter,e,n);return YN(o,[LZ(qb(o),"setDoc",t._key,r,t.converter!==null,n).toMutation(t._key,hh.none())])}function PCe(t,e,n){for(var o=[],r=3;r"u")throw new ko(On.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function RCe(){if(typeof atob>"u")throw new ko(On.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var mnt=function(){function t(e){this._delegate=e}return t.fromBase64String=function(e){return RCe(),new t(ab.fromBase64String(e))},t.fromUint8Array=function(e){return CCe(),new t(ab.fromUint8Array(e))},t.prototype.toBase64=function(){return RCe(),this._delegate.toBase64()},t.prototype.toUint8Array=function(){return CCe(),this._delegate.toUint8Array()},t.prototype.isEqual=function(e){return this._delegate.isEqual(e._delegate)},t.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},t}(),YOn=function(){function t(){}return t.prototype.enableIndexedDbPersistence=function(e,n){return function(o,r){ACe(o=ts(o,Wu));var i=ch(o),a=o._freezeSettings(),l=new Kde;return yCe(i,l,new Gtt(l,a.cacheSizeBytes,r==null?void 0:r.forceOwnership))}(e._delegate,{forceOwnership:n})},t.prototype.enableMultiTabIndexedDbPersistence=function(e){return function(n){ACe(n=ts(n,Wu));var o=ch(n),r=n._freezeSettings(),i=new Kde;return yCe(o,i,new mOn(i,r.cacheSizeBytes))}(e._delegate)},t.prototype.clearIndexedDbPersistence=function(e){return function(n){var o=this;if(n._initialized&&!n._terminated)throw new ko(On.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");var r=new a1;return n._queue.enqueueAndForgetEvenWhileRestricted(function(){return vo(o,void 0,void 0,function(){var i;return Ao(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,function(l){return vo(this,void 0,void 0,function(){var s;return Ao(this,function(c){switch(c.label){case 0:return YR.yt()?(s=l+"main",[4,YR.delete(s)]):[2,Promise.resolve()];case 1:return c.sent(),[2]}})})}(e5e(n._databaseId,n._persistenceKey))];case 1:return a.sent(),r.resolve(),[3,3];case 2:return i=a.sent(),r.reject(i),[3,3];case 3:return[2]}})})}),r.promise}(e._delegate)},t}(),ynt=function(){function t(e,n,o){var r=this;this._delegate=n,this.Zc=o,this.INTERNAL={delete:function(){return r.terminate()}},e instanceof YX||(this.tu=e)}return Object.defineProperty(t.prototype,"_databaseId",{get:function(){return this._delegate._databaseId},enumerable:!1,configurable:!0}),t.prototype.settings=function(e){var n=this._delegate._getSettings();e.merge||n.host===e.host||MX("You are overriding the original host. If you did not intend to override your settings, use {merge: true}."),e.merge&&delete(e=Object.assign(Object.assign({},n),e)).merge,this._delegate._setSettings(e)},t.prototype.useEmulator=function(e,n,o){o===void 0&&(o={}),function(r,i,a,l){var s;l===void 0&&(l={});var c=(r=ts(r,Ik))._getSettings();if(c.host!=="firestore.googleapis.com"&&c.host!==i&&MX("Host has been set in both settings() and useEmulator(), emulator host will be used"),r._setSettings(Object.assign(Object.assign({},c),{host:i+":"+a,ssl:!1})),l.mockUserToken){var u,d;if(typeof l.mockUserToken=="string")u=l.mockUserToken,d=cf.MOCK_USER;else{u=u2e(l.mockUserToken,(s=r._app)===null||s===void 0?void 0:s.options.projectId);var f=l.mockUserToken.sub||l.mockUserToken.user_id;if(!f)throw new ko(On.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");d=new cf(f)}r._credentials=new xOn(new $tt(u,d))}}(this._delegate,e,n,o)},t.prototype.enableNetwork=function(){return function(e){var n=this;return e.asyncQueue.enqueue(function(){return vo(n,void 0,void 0,function(){var o,r;return Ao(this,function(i){switch(i.label){case 0:return[4,lCe(e)];case 1:return o=i.sent(),[4,sCe(e)];case 2:return r=i.sent(),[2,(o.setNetworkEnabled(!0),function(a){var l=Ir(a);return l.Or.delete(0),jN(l)}(r))]}})})})}(ch(ts(this._delegate,Wu)))},t.prototype.disableNetwork=function(){return function(e){var n=this;return e.asyncQueue.enqueue(function(){return vo(n,void 0,void 0,function(){var o,r;return Ao(this,function(i){switch(i.label){case 0:return[4,lCe(e)];case 1:return o=i.sent(),[4,sCe(e)];case 2:return r=i.sent(),[2,(o.setNetworkEnabled(!1),function(a){return vo(this,void 0,void 0,function(){var l;return Ao(this,function(s){switch(s.label){case 0:return(l=Ir(a)).Or.add(0),[4,aM(l)];case 1:return s.sent(),l.Br.set("Offline"),[2]}})})}(r))]}})})})}(ch(ts(this._delegate,Wu)))},t.prototype.enablePersistence=function(e){var n=!1,o=!1;return e&&Qtt("synchronizeTabs",n=!!e.synchronizeTabs,"experimentalForceOwningTab",o=!!e.experimentalForceOwningTab),n?this.Zc.enableMultiTabIndexedDbPersistence(this):this.Zc.enableIndexedDbPersistence(this,o)},t.prototype.clearPersistence=function(){return this.Zc.clearIndexedDbPersistence(this)},t.prototype.terminate=function(){return this.tu&&(this.tu._removeServiceInstance("firestore"),this.tu._removeServiceInstance("firestore-exp")),this._delegate._delete()},t.prototype.waitForPendingWrites=function(){return function(e){var n=this,o=new a1;return e.asyncQueue.enqueueAndForget(function(){return vo(n,void 0,void 0,function(){var r;return Ao(this,function(i){switch(i.label){case 0:return r=iOn,[4,qtt(e)];case 1:return[2,r.apply(void 0,[i.sent(),o])]}})})}),o.promise}(ch(ts(this._delegate,Wu)))},t.prototype.onSnapshotsInSync=function(e){return function(n,o){return function(r,i){var a=this,l=new DZ(i);return r.asyncQueue.enqueueAndForget(function(){return vo(a,void 0,void 0,function(){var s;return Ao(this,function(c){switch(c.label){case 0:return s=function(u,d){Ir(u).Gr.add(d),d.next()},[4,XR(r)];case 1:return[2,s.apply(void 0,[c.sent(),l])]}})})}),function(){l.Wo(),r.asyncQueue.enqueueAndForget(function(){return vo(a,void 0,void 0,function(){var s;return Ao(this,function(c){switch(c.label){case 0:return s=function(u,d){Ir(u).Gr.delete(d)},[4,XR(r)];case 1:return[2,s.apply(void 0,[c.sent(),l])]}})})})}}(ch(n=ts(n,Wu)),JR(o)?o:{next:o})}(this._delegate,e)},Object.defineProperty(t.prototype,"app",{get:function(){if(!this.tu)throw new ko(On.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.tu},enumerable:!1,configurable:!0}),t.prototype.collection=function(e){try{return new VX(this,Ztt(this._delegate,e))}catch(n){throw Kh(n,"collection()","Firestore.collection()")}},t.prototype.doc=function(e){try{return new Px(this,hV(this._delegate,e))}catch(n){throw Kh(n,"doc()","Firestore.doc()")}},t.prototype.collectionGroup=function(e){try{return new jZ(this,function(n,o){if(n=ts(n,Ik),y5e("collectionGroup","collection id",o),o.indexOf("/")>=0)throw new ko(On.INVALID_ARGUMENT,"Invalid collection ID '"+o+"' passed to function collectionGroup(). Collection IDs must not contain '/'.");return new Rg(n,null,function(r){return new vA(Ol.emptyPath(),r)}(o))}(this._delegate,e))}catch(n){throw Kh(n,"collectionGroup()","Firestore.collectionGroup()")}},t.prototype.runTransaction=function(e){var n=this;return function(o,r){return function(i,a){var l=this,s=new a1;return i.asyncQueue.enqueueAndForget(function(){return vo(l,void 0,void 0,function(){var c;return Ao(this,function(u){switch(u.label){case 0:return[4,function(d){return EZ(d).then(function(f){return f.datastore})}(i)];case 1:return c=u.sent(),new AOn(i.asyncQueue,c,a,s).run(),[2]}})})}),s.promise}(ch(o),function(i){return r(new BOn(o,i))})}(this._delegate,function(o){return e(new Ant(n,o))})},t.prototype.batch=function(){var e=this;return ch(this._delegate),new wnt(new jOn(this._delegate,function(n){return YN(e._delegate,n)}))},t.prototype.loadBundle=function(e){throw new ko(On.FAILED_PRECONDITION,'"loadBundle()" does not exist, have you imported "firebase/firestore/bundle"?')},t.prototype.namedQuery=function(e){throw new ko(On.FAILED_PRECONDITION,'"namedQuery()" does not exist, have you imported "firebase/firestore/bundle"?')},t}(),NZ=function(t){function e(n){var o=this;return(o=t.call(this)||this).firestore=n,o}return Pr(e,t),e.prototype.convertBytes=function(n){return new mnt(new ab(n))},e.prototype.convertReference=function(n){var o=this.convertDocumentKey(n,this.firestore._databaseId);return Px.eu(o,this.firestore,null)},e}(T5e);function OOn(t){var e;e=t,N2.setLogLevel(e)}var Ant=function(){function t(e,n){this._firestore=e,this._delegate=n,this._userDataWriter=new NZ(e)}return t.prototype.get=function(e){var n=this,o=Jv(e);return this._delegate.get(o).then(function(r){return new Dk(n._firestore,new N6(n._firestore._delegate,n._userDataWriter,r._key,r._document,r.metadata,o.converter))})},t.prototype.set=function(e,n,o){var r=Jv(e);return o?(A5e("Transaction.set",o),this._delegate.set(r,n,o)):this._delegate.set(r,n),this},t.prototype.update=function(e,n,o){for(var r,i=[],a=3;a"u")throw new ko(On.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function HCe(){if(typeof atob>"u")throw new ko(On.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var mnt=function(){function t(e){this._delegate=e}return t.fromBase64String=function(e){return HCe(),new t(ab.fromBase64String(e))},t.fromUint8Array=function(e){return RCe(),new t(ab.fromUint8Array(e))},t.prototype.toBase64=function(){return HCe(),this._delegate.toBase64()},t.prototype.toUint8Array=function(){return RCe(),this._delegate.toUint8Array()},t.prototype.isEqual=function(e){return this._delegate.isEqual(e._delegate)},t.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},t}(),YOn=function(){function t(){}return t.prototype.enableIndexedDbPersistence=function(e,n){return function(o,r){wCe(o=ts(o,Wu));var i=ch(o),a=o._freezeSettings(),l=new Kde;return ACe(i,l,new Gtt(l,a.cacheSizeBytes,r==null?void 0:r.forceOwnership))}(e._delegate,{forceOwnership:n})},t.prototype.enableMultiTabIndexedDbPersistence=function(e){return function(n){wCe(n=ts(n,Wu));var o=ch(n),r=n._freezeSettings(),i=new Kde;return ACe(o,i,new mOn(i,r.cacheSizeBytes))}(e._delegate)},t.prototype.clearIndexedDbPersistence=function(e){return function(n){var o=this;if(n._initialized&&!n._terminated)throw new ko(On.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");var r=new a1;return n._queue.enqueueAndForgetEvenWhileRestricted(function(){return vo(o,void 0,void 0,function(){var i;return Ao(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,function(l){return vo(this,void 0,void 0,function(){var s;return Ao(this,function(c){switch(c.label){case 0:return YR.yt()?(s=l+"main",[4,YR.delete(s)]):[2,Promise.resolve()];case 1:return c.sent(),[2]}})})}(t5e(n._databaseId,n._persistenceKey))];case 1:return a.sent(),r.resolve(),[3,3];case 2:return i=a.sent(),r.reject(i),[3,3];case 3:return[2]}})})}),r.promise}(e._delegate)},t}(),ynt=function(){function t(e,n,o){var r=this;this._delegate=n,this.Zc=o,this.INTERNAL={delete:function(){return r.terminate()}},e instanceof OX||(this.tu=e)}return Object.defineProperty(t.prototype,"_databaseId",{get:function(){return this._delegate._databaseId},enumerable:!1,configurable:!0}),t.prototype.settings=function(e){var n=this._delegate._getSettings();e.merge||n.host===e.host||IX("You are overriding the original host. If you did not intend to override your settings, use {merge: true}."),e.merge&&delete(e=Object.assign(Object.assign({},n),e)).merge,this._delegate._setSettings(e)},t.prototype.useEmulator=function(e,n,o){o===void 0&&(o={}),function(r,i,a,l){var s;l===void 0&&(l={});var c=(r=ts(r,Ik))._getSettings();if(c.host!=="firestore.googleapis.com"&&c.host!==i&&IX("Host has been set in both settings() and useEmulator(), emulator host will be used"),r._setSettings(Object.assign(Object.assign({},c),{host:i+":"+a,ssl:!1})),l.mockUserToken){var u,d;if(typeof l.mockUserToken=="string")u=l.mockUserToken,d=cf.MOCK_USER;else{u=d2e(l.mockUserToken,(s=r._app)===null||s===void 0?void 0:s.options.projectId);var f=l.mockUserToken.sub||l.mockUserToken.user_id;if(!f)throw new ko(On.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");d=new cf(f)}r._credentials=new xOn(new $tt(u,d))}}(this._delegate,e,n,o)},t.prototype.enableNetwork=function(){return function(e){var n=this;return e.asyncQueue.enqueue(function(){return vo(n,void 0,void 0,function(){var o,r;return Ao(this,function(i){switch(i.label){case 0:return[4,sCe(e)];case 1:return o=i.sent(),[4,cCe(e)];case 2:return r=i.sent(),[2,(o.setNetworkEnabled(!0),function(a){var l=Ir(a);return l.Or.delete(0),BN(l)}(r))]}})})})}(ch(ts(this._delegate,Wu)))},t.prototype.disableNetwork=function(){return function(e){var n=this;return e.asyncQueue.enqueue(function(){return vo(n,void 0,void 0,function(){var o,r;return Ao(this,function(i){switch(i.label){case 0:return[4,sCe(e)];case 1:return o=i.sent(),[4,cCe(e)];case 2:return r=i.sent(),[2,(o.setNetworkEnabled(!1),function(a){return vo(this,void 0,void 0,function(){var l;return Ao(this,function(s){switch(s.label){case 0:return(l=Ir(a)).Or.add(0),[4,aM(l)];case 1:return s.sent(),l.Br.set("Offline"),[2]}})})}(r))]}})})})}(ch(ts(this._delegate,Wu)))},t.prototype.enablePersistence=function(e){var n=!1,o=!1;return e&&Qtt("synchronizeTabs",n=!!e.synchronizeTabs,"experimentalForceOwningTab",o=!!e.experimentalForceOwningTab),n?this.Zc.enableMultiTabIndexedDbPersistence(this):this.Zc.enableIndexedDbPersistence(this,o)},t.prototype.clearPersistence=function(){return this.Zc.clearIndexedDbPersistence(this)},t.prototype.terminate=function(){return this.tu&&(this.tu._removeServiceInstance("firestore"),this.tu._removeServiceInstance("firestore-exp")),this._delegate._delete()},t.prototype.waitForPendingWrites=function(){return function(e){var n=this,o=new a1;return e.asyncQueue.enqueueAndForget(function(){return vo(n,void 0,void 0,function(){var r;return Ao(this,function(i){switch(i.label){case 0:return r=iOn,[4,qtt(e)];case 1:return[2,r.apply(void 0,[i.sent(),o])]}})})}),o.promise}(ch(ts(this._delegate,Wu)))},t.prototype.onSnapshotsInSync=function(e){return function(n,o){return function(r,i){var a=this,l=new DZ(i);return r.asyncQueue.enqueueAndForget(function(){return vo(a,void 0,void 0,function(){var s;return Ao(this,function(c){switch(c.label){case 0:return s=function(u,d){Ir(u).Gr.add(d),d.next()},[4,XR(r)];case 1:return[2,s.apply(void 0,[c.sent(),l])]}})})}),function(){l.Wo(),r.asyncQueue.enqueueAndForget(function(){return vo(a,void 0,void 0,function(){var s;return Ao(this,function(c){switch(c.label){case 0:return s=function(u,d){Ir(u).Gr.delete(d)},[4,XR(r)];case 1:return[2,s.apply(void 0,[c.sent(),l])]}})})})}}(ch(n=ts(n,Wu)),JR(o)?o:{next:o})}(this._delegate,e)},Object.defineProperty(t.prototype,"app",{get:function(){if(!this.tu)throw new ko(On.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.tu},enumerable:!1,configurable:!0}),t.prototype.collection=function(e){try{return new GX(this,Ztt(this._delegate,e))}catch(n){throw Kh(n,"collection()","Firestore.collection()")}},t.prototype.doc=function(e){try{return new Px(this,pV(this._delegate,e))}catch(n){throw Kh(n,"doc()","Firestore.doc()")}},t.prototype.collectionGroup=function(e){try{return new jZ(this,function(n,o){if(n=ts(n,Ik),A5e("collectionGroup","collection id",o),o.indexOf("/")>=0)throw new ko(On.INVALID_ARGUMENT,"Invalid collection ID '"+o+"' passed to function collectionGroup(). Collection IDs must not contain '/'.");return new Rg(n,null,function(r){return new vA(Ol.emptyPath(),r)}(o))}(this._delegate,e))}catch(n){throw Kh(n,"collectionGroup()","Firestore.collectionGroup()")}},t.prototype.runTransaction=function(e){var n=this;return function(o,r){return function(i,a){var l=this,s=new a1;return i.asyncQueue.enqueueAndForget(function(){return vo(l,void 0,void 0,function(){var c;return Ao(this,function(u){switch(u.label){case 0:return[4,function(d){return EZ(d).then(function(f){return f.datastore})}(i)];case 1:return c=u.sent(),new AOn(i.asyncQueue,c,a,s).run(),[2]}})})}),s.promise}(ch(o),function(i){return r(new BOn(o,i))})}(this._delegate,function(o){return e(new Ant(n,o))})},t.prototype.batch=function(){var e=this;return ch(this._delegate),new wnt(new jOn(this._delegate,function(n){return ON(e._delegate,n)}))},t.prototype.loadBundle=function(e){throw new ko(On.FAILED_PRECONDITION,'"loadBundle()" does not exist, have you imported "firebase/firestore/bundle"?')},t.prototype.namedQuery=function(e){throw new ko(On.FAILED_PRECONDITION,'"namedQuery()" does not exist, have you imported "firebase/firestore/bundle"?')},t}(),NZ=function(t){function e(n){var o=this;return(o=t.call(this)||this).firestore=n,o}return Pr(e,t),e.prototype.convertBytes=function(n){return new mnt(new ab(n))},e.prototype.convertReference=function(n){var o=this.convertDocumentKey(n,this.firestore._databaseId);return Px.eu(o,this.firestore,null)},e}(P5e);function OOn(t){var e;e=t,N2.setLogLevel(e)}var Ant=function(){function t(e,n){this._firestore=e,this._delegate=n,this._userDataWriter=new NZ(e)}return t.prototype.get=function(e){var n=this,o=Jv(e);return this._delegate.get(o).then(function(r){return new Dk(n._firestore,new N6(n._firestore._delegate,n._userDataWriter,r._key,r._document,r.metadata,o.converter))})},t.prototype.set=function(e,n,o){var r=Jv(e);return o?(w5e("Transaction.set",o),this._delegate.set(r,n,o)):this._delegate.set(r,n),this},t.prototype.update=function(e,n,o){for(var r,i=[],a=3;a>6,128|o&63);else if((o&64512)===55296){var r=n>18,128|o>>12&63,128|o>>6&63,128|o&63)}}else(o&64512)===56320?e.push(239,191,189):e.push(224|o>>12,128|o>>6&63,128|o&63)}return new Uint8Array(e)}function c_n(t){var e;try{e=decodeURIComponent(t)}catch{throw LE(Bm.DATA_URL,"Malformed data URL.")}return Mnt(e)}function Int(t,e){switch(t){case Bm.BASE64:{var n=e.indexOf("-")!==-1,o=e.indexOf("_")!==-1;if(n||o){var r=n?"-":"_";throw LE(t,"Invalid character '"+r+"' found: is it base64url encoded?")}break}case Bm.BASE64URL:{var i=e.indexOf("+")!==-1,a=e.indexOf("/")!==-1;if(i||a){var r=i?"+":"/";throw LE(t,"Invalid character '"+r+"' found: is it base64 encoded?")}e=e.replace(/-/g,"+").replace(/_/g,"/");break}}var l;try{l=s_n(e)}catch{throw LE(t,"Invalid character found")}for(var s=new Uint8Array(l.length),c=0;c][;base64],");var o=n[1]||null;o!=null&&(this.base64=f_n(o,";base64"),this.contentType=this.base64?o.substring(0,o.length-7):o),this.rest=e.substring(e.indexOf(",")+1)}return t}();function u_n(t){var e=new znt(t);return e.base64?Int(Bm.BASE64,e.rest):c_n(e.rest)}function d_n(t){var e=new znt(t);return e.contentType}function f_n(t,e){var n=t.length>=e.length;return n?t.substring(t.length-e.length)===e:!1}/** + */var Bm={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"},Sae=function(){function t(e,n){this.data=e,this.contentType=n||null}return t}();function Hnt(t,e){switch(t){case Bm.RAW:return new Sae(Mnt(e));case Bm.BASE64:case Bm.BASE64URL:return new Sae(Int(t,e));case Bm.DATA_URL:return new Sae(u_n(e),d_n(e))}throw C5e()}function Mnt(t){for(var e=[],n=0;n>6,128|o&63);else if((o&64512)===55296){var r=n>18,128|o>>12&63,128|o>>6&63,128|o&63)}}else(o&64512)===56320?e.push(239,191,189):e.push(224|o>>12,128|o>>6&63,128|o&63)}return new Uint8Array(e)}function c_n(t){var e;try{e=decodeURIComponent(t)}catch{throw LE(Bm.DATA_URL,"Malformed data URL.")}return Mnt(e)}function Int(t,e){switch(t){case Bm.BASE64:{var n=e.indexOf("-")!==-1,o=e.indexOf("_")!==-1;if(n||o){var r=n?"-":"_";throw LE(t,"Invalid character '"+r+"' found: is it base64url encoded?")}break}case Bm.BASE64URL:{var i=e.indexOf("+")!==-1,a=e.indexOf("/")!==-1;if(i||a){var r=i?"+":"/";throw LE(t,"Invalid character '"+r+"' found: is it base64 encoded?")}e=e.replace(/-/g,"+").replace(/_/g,"/");break}}var l;try{l=s_n(e)}catch{throw LE(t,"Invalid character found")}for(var s=new Uint8Array(l.length),c=0;c][;base64],");var o=n[1]||null;o!=null&&(this.base64=f_n(o,";base64"),this.contentType=this.base64?o.substring(0,o.length-7):o),this.rest=e.substring(e.indexOf(",")+1)}return t}();function u_n(t){var e=new znt(t);return e.base64?Int(Bm.BASE64,e.rest):c_n(e.rest)}function d_n(t){var e=new znt(t);return e.contentType}function f_n(t,e){var n=t.length>=e.length;return n?t.substring(t.length-e.length)===e:!1}/** * @license * Copyright 2017 Google LLC * @@ -6533,7 +6533,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var p_n=function(){function t(){var e=this;this.sent_=!1,this.xhr_=new XMLHttpRequest,this.errorCode_=Cx.NO_ERROR,this.sendPromise_=new Promise(function(n){e.xhr_.addEventListener("abort",function(){e.errorCode_=Cx.ABORT,n()}),e.xhr_.addEventListener("error",function(){e.errorCode_=Cx.NETWORK_ERROR,n()}),e.xhr_.addEventListener("load",function(){n()})})}return t.prototype.send=function(e,n,o,r){if(this.sent_)throw IO("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(n,e,!0),r!==void 0)for(var i in r)r.hasOwnProperty(i)&&this.xhr_.setRequestHeader(i,r[i].toString());return o!==void 0?this.xhr_.send(o):this.xhr_.send(),this.sendPromise_},t.prototype.getErrorCode=function(){if(!this.sent_)throw IO("cannot .getErrorCode() before sending");return this.errorCode_},t.prototype.getStatus=function(){if(!this.sent_)throw IO("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}},t.prototype.getResponseText=function(){if(!this.sent_)throw IO("cannot .getResponseText() before sending");return this.xhr_.responseText},t.prototype.abort=function(){this.xhr_.abort()},t.prototype.getResponseHeader=function(e){return this.xhr_.getResponseHeader(e)},t.prototype.addUploadProgressListener=function(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)},t.prototype.removeUploadProgressListener=function(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)},t}();function g_n(){return new p_n}/** + */var p_n=function(){function t(){var e=this;this.sent_=!1,this.xhr_=new XMLHttpRequest,this.errorCode_=Cx.NO_ERROR,this.sendPromise_=new Promise(function(n){e.xhr_.addEventListener("abort",function(){e.errorCode_=Cx.ABORT,n()}),e.xhr_.addEventListener("error",function(){e.errorCode_=Cx.NETWORK_ERROR,n()}),e.xhr_.addEventListener("load",function(){n()})})}return t.prototype.send=function(e,n,o,r){if(this.sent_)throw zO("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(n,e,!0),r!==void 0)for(var i in r)r.hasOwnProperty(i)&&this.xhr_.setRequestHeader(i,r[i].toString());return o!==void 0?this.xhr_.send(o):this.xhr_.send(),this.sendPromise_},t.prototype.getErrorCode=function(){if(!this.sent_)throw zO("cannot .getErrorCode() before sending");return this.errorCode_},t.prototype.getStatus=function(){if(!this.sent_)throw zO("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}},t.prototype.getResponseText=function(){if(!this.sent_)throw zO("cannot .getResponseText() before sending");return this.xhr_.responseText},t.prototype.abort=function(){this.xhr_.abort()},t.prototype.getResponseHeader=function(e){return this.xhr_.getResponseHeader(e)},t.prototype.addUploadProgressListener=function(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)},t.prototype.removeUploadProgressListener=function(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)},t}();function g_n(){return new p_n}/** * @license * Copyright 2017 Google LLC * @@ -6593,7 +6593,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function v_n(t){return t!==void 0}function x_n(t){return typeof t=="function"}function b_n(t){return typeof t=="object"&&!Array.isArray(t)}function BZ(t){return typeof t=="string"||t instanceof String}function HCe(t){return C5e()&&t instanceof Blob}function C5e(){return typeof Blob<"u"}function Zde(t,e,n,o){if(on)throw kC("Invalid value for '"+t+"'. Expected "+n+" or less.")}/** + */function v_n(t){return t!==void 0}function x_n(t){return typeof t=="function"}function b_n(t){return typeof t=="object"&&!Array.isArray(t)}function BZ(t){return typeof t=="string"||t instanceof String}function MCe(t){return R5e()&&t instanceof Blob}function R5e(){return typeof Blob<"u"}function Zde(t,e,n,o){if(on)throw kC("Invalid value for '"+t+"'. Expected "+n+" or less.")}/** * @license * Copyright 2017 Google LLC * @@ -6623,7 +6623,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var S_n=function(){function t(e,n,o,r,i,a,l,s,c,u,d){var f=this;this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.url_=e,this.method_=n,this.headers_=o,this.body_=r,this.successCodes_=i.slice(),this.additionalRetryCodes_=a.slice(),this.callback_=l,this.errorCallback_=s,this.progressCallback_=u,this.timeout_=c,this.pool_=d,this.promise_=new Promise(function(p,g){f.resolve_=p,f.reject_=g,f.start_()})}return t.prototype.start_=function(){var e=this;function n(r,i){if(i){r(!1,new zO(!1,null,!0));return}var a=e.pool_.createConnection();e.pendingConnection_=a;function l(s){var c=s.loaded,u=s.lengthComputable?s.total:-1;e.progressCallback_!==null&&e.progressCallback_(c,u)}e.progressCallback_!==null&&a.addUploadProgressListener(l),a.send(e.url_,e.method_,e.body_,e.headers_).then(function(){e.progressCallback_!==null&&a.removeUploadProgressListener(l),e.pendingConnection_=null;var s=a.getErrorCode()===Cx.NO_ERROR,c=a.getStatus();if(!s||e.isRetryStatusCode_(c)){var u=a.getErrorCode()===Cx.ABORT;r(!1,new zO(!1,null,u));return}var d=e.successCodes_.indexOf(c)!==-1;r(!0,new zO(d,a))})}function o(r,i){var a=e.resolve_,l=e.reject_,s=i.connection;if(i.wasSuccessCode)try{var c=e.callback_(s,s.getResponseText());v_n(c)?a(c):a()}catch(d){l(d)}else if(s!==null){var u=P5e();u.serverResponse=s.getResponseText(),e.errorCallback_?l(e.errorCallback_(s,u)):l(u)}else if(i.canceled){var u=e.appDelete_?Cnt():Tnt();l(u)}else{var u=n_n();l(u)}}this.canceled_?o(!1,new zO(!1,null,!0)):this.backoffId_=A_n(n,o,this.timeout_)},t.prototype.getPromise=function(){return this.promise_},t.prototype.cancel=function(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&w_n(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()},t.prototype.isRetryStatusCode_=function(e){var n=e>=500&&e<600,o=[408,429],r=o.indexOf(e)!==-1,i=this.additionalRetryCodes_.indexOf(e)!==-1;return n||r||i},t}(),zO=function(){function t(e,n,o){this.wasSuccessCode=e,this.connection=n,this.canceled=!!o}return t}();function T_n(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function P_n(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function C_n(t,e){e&&(t["X-Firebase-GMPID"]=e)}function R_n(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function H_n(t,e,n,o,r,i){var a=Dnt(t.urlParams),l=t.url+a,s=Object.assign({},t.headers);return C_n(s,e),T_n(s,n),P_n(s,i),R_n(s,o),new S_n(l,t.method,s,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,r)}/** + */var S_n=function(){function t(e,n,o,r,i,a,l,s,c,u,d){var f=this;this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.url_=e,this.method_=n,this.headers_=o,this.body_=r,this.successCodes_=i.slice(),this.additionalRetryCodes_=a.slice(),this.callback_=l,this.errorCallback_=s,this.progressCallback_=u,this.timeout_=c,this.pool_=d,this.promise_=new Promise(function(p,g){f.resolve_=p,f.reject_=g,f.start_()})}return t.prototype.start_=function(){var e=this;function n(r,i){if(i){r(!1,new DO(!1,null,!0));return}var a=e.pool_.createConnection();e.pendingConnection_=a;function l(s){var c=s.loaded,u=s.lengthComputable?s.total:-1;e.progressCallback_!==null&&e.progressCallback_(c,u)}e.progressCallback_!==null&&a.addUploadProgressListener(l),a.send(e.url_,e.method_,e.body_,e.headers_).then(function(){e.progressCallback_!==null&&a.removeUploadProgressListener(l),e.pendingConnection_=null;var s=a.getErrorCode()===Cx.NO_ERROR,c=a.getStatus();if(!s||e.isRetryStatusCode_(c)){var u=a.getErrorCode()===Cx.ABORT;r(!1,new DO(!1,null,u));return}var d=e.successCodes_.indexOf(c)!==-1;r(!0,new DO(d,a))})}function o(r,i){var a=e.resolve_,l=e.reject_,s=i.connection;if(i.wasSuccessCode)try{var c=e.callback_(s,s.getResponseText());v_n(c)?a(c):a()}catch(d){l(d)}else if(s!==null){var u=C5e();u.serverResponse=s.getResponseText(),e.errorCallback_?l(e.errorCallback_(s,u)):l(u)}else if(i.canceled){var u=e.appDelete_?Cnt():Tnt();l(u)}else{var u=n_n();l(u)}}this.canceled_?o(!1,new DO(!1,null,!0)):this.backoffId_=A_n(n,o,this.timeout_)},t.prototype.getPromise=function(){return this.promise_},t.prototype.cancel=function(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&w_n(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()},t.prototype.isRetryStatusCode_=function(e){var n=e>=500&&e<600,o=[408,429],r=o.indexOf(e)!==-1,i=this.additionalRetryCodes_.indexOf(e)!==-1;return n||r||i},t}(),DO=function(){function t(e,n,o){this.wasSuccessCode=e,this.connection=n,this.canceled=!!o}return t}();function T_n(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function P_n(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function C_n(t,e){e&&(t["X-Firebase-GMPID"]=e)}function R_n(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function H_n(t,e,n,o,r,i){var a=Dnt(t.urlParams),l=t.url+a,s=Object.assign({},t.headers);return C_n(s,e),T_n(s,n),P_n(s,i),R_n(s,o),new S_n(l,t.method,s,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,r)}/** * @license * Copyright 2017 Google LLC * @@ -6638,7 +6638,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function M_n(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function I_n(){for(var t=[],e=0;e0&&(i.delimiter=n),o&&(i.pageToken=o),r&&(i.maxResults=r);var a=e.bucketOnlyServerUrl(),l=Gw(a,t.host),s="GET",c=t.maxOperationRetryTime,u=new xA(l,s,B_n(t,e.bucket),c);return u.urlParams=i,u.errorHandler=uM(e),u}function __n(t,e,n){var o=e.fullServerUrl(),r=Gw(o,t.host),i="GET",a=t.maxOperationRetryTime,l=new xA(r,i,Y_n(t,n),a);return l.errorHandler=_Z(e),l}function V_n(t,e,n,o){var r=e.fullServerUrl(),i=Gw(r,t.host),a="PATCH",l=M5e(n,o),s={"Content-Type":"application/json; charset=utf-8"},c=t.maxOperationRetryTime,u=new xA(i,a,OZ(t,o),c);return u.headers=s,u.body=l,u.errorHandler=_Z(e),u}function G_n(t,e){var n=e.fullServerUrl(),o=Gw(n,t.host),r="DELETE",i=t.maxOperationRetryTime;function a(s,c){}var l=new xA(o,r,a,i);return l.successCodes=[200,204],l.errorHandler=_Z(e),l}function X_n(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}function Lnt(t,e,n){var o=Object.assign({},n);return o.fullPath=t.path,o.size=e.size(),o.contentType||(o.contentType=X_n(null,e)),o}function J_n(t,e,n,o,r){var i=e.bucketOnlyServerUrl(),a={"X-Goog-Upload-Protocol":"multipart"};function l(){for(var P="",v=0;v<2;v++)P=P+Math.random().toString().slice(2);return P}var s=l();a["Content-Type"]="multipart/related; boundary="+s;var c=Lnt(e,o,r),u=M5e(c,n),d="--"+s+`\r + */function I9(t){if(!t)throw C5e()}function OZ(t,e){function n(o,r){var i=Fnt(t,r,e);return I9(i!==null),i}return n}function B_n(t,e){function n(o,r){var i=j_n(t,e,r);return I9(i!==null),i}return n}function Y_n(t,e){function n(o,r){var i=Fnt(t,r,e);return I9(i!==null),N_n(i,r,t.host)}return n}function uM(t){function e(n,o){var r;return n.getStatus()===401?n.getResponseText().includes("Firebase App Check token is invalid")?r=e_n():r=ZOn():n.getStatus()===402?r=QOn(t.bucket):n.getStatus()===403?r=t_n(t.path):r=o,r.serverResponse=o.serverResponse,r}return e}function _Z(t){var e=uM(t);function n(o,r){var i=e(o,r);return o.getStatus()===404&&(i=$On(t.path)),i.serverResponse=r.serverResponse,i}return n}function knt(t,e,n){var o=e.fullServerUrl(),r=Gw(o,t.host),i="GET",a=t.maxOperationRetryTime,l=new xA(r,i,OZ(t,n),a);return l.errorHandler=_Z(e),l}function O_n(t,e,n,o,r){var i={};e.isRoot?i.prefix="":i.prefix=e.path+"/",n.length>0&&(i.delimiter=n),o&&(i.pageToken=o),r&&(i.maxResults=r);var a=e.bucketOnlyServerUrl(),l=Gw(a,t.host),s="GET",c=t.maxOperationRetryTime,u=new xA(l,s,B_n(t,e.bucket),c);return u.urlParams=i,u.errorHandler=uM(e),u}function __n(t,e,n){var o=e.fullServerUrl(),r=Gw(o,t.host),i="GET",a=t.maxOperationRetryTime,l=new xA(r,i,Y_n(t,n),a);return l.errorHandler=_Z(e),l}function V_n(t,e,n,o){var r=e.fullServerUrl(),i=Gw(r,t.host),a="PATCH",l=I5e(n,o),s={"Content-Type":"application/json; charset=utf-8"},c=t.maxOperationRetryTime,u=new xA(i,a,OZ(t,o),c);return u.headers=s,u.body=l,u.errorHandler=_Z(e),u}function G_n(t,e){var n=e.fullServerUrl(),o=Gw(n,t.host),r="DELETE",i=t.maxOperationRetryTime;function a(s,c){}var l=new xA(o,r,a,i);return l.successCodes=[200,204],l.errorHandler=_Z(e),l}function X_n(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}function Lnt(t,e,n){var o=Object.assign({},n);return o.fullPath=t.path,o.size=e.size(),o.contentType||(o.contentType=X_n(null,e)),o}function J_n(t,e,n,o,r){var i=e.bucketOnlyServerUrl(),a={"X-Goog-Upload-Protocol":"multipart"};function l(){for(var P="",v=0;v<2;v++)P=P+Math.random().toString().slice(2);return P}var s=l();a["Content-Type"]="multipart/related; boundary="+s;var c=Lnt(e,o,r),u=I5e(c,n),d="--"+s+`\r Content-Type: application/json; charset=utf-8\r \r `+u+`\r @@ -6736,7 +6736,7 @@ Content-Type: application/json; charset=utf-8\r Content-Type: `+c.contentType+`\r \r `,f=`\r ---`+s+"--",p=R5e.getBlob(d,o,f);if(p===null)throw Pnt();var g={name:c.fullPath},y=Gw(i,t.host),w="POST",b=t.maxUploadRetryTime,C=new xA(y,w,OZ(t,n),b);return C.urlParams=g,C.headers=a,C.body=p.uploadData(),C.errorHandler=uM(e),C}var GX=function(){function t(e,n,o,r){this.current=e,this.total=n,this.finalized=!!o,this.metadata=r||null}return t}();function I5e(t,e){var n=null;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch{I9(!1)}var o=e||["active"];return I9(!!n&&o.indexOf(n)!==-1),n}function K_n(t,e,n,o,r){var i=e.bucketOnlyServerUrl(),a=Lnt(e,o,r),l={name:a.fullPath},s=Gw(i,t.host),c="POST",u={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":""+o.size(),"X-Goog-Upload-Header-Content-Type":a.contentType,"Content-Type":"application/json; charset=utf-8"},d=M5e(a,n),f=t.maxUploadRetryTime;function p(y){I5e(y);var w;try{w=y.getResponseHeader("X-Goog-Upload-URL")}catch{I9(!1)}return I9(BZ(w)),w}var g=new xA(s,c,p,f);return g.urlParams=l,g.headers=u,g.body=d,g.errorHandler=uM(e),g}function q_n(t,e,n,o){var r={"X-Goog-Upload-Command":"query"};function i(c){var u=I5e(c,["active","final"]),d=null;try{d=c.getResponseHeader("X-Goog-Upload-Size-Received")}catch{I9(!1)}d||I9(!1);var f=Number(d);return I9(!isNaN(f)),new GX(f,o.size(),u==="final")}var a="POST",l=t.maxUploadRetryTime,s=new xA(n,a,i,l);return s.headers=r,s.errorHandler=uM(e),s}var zCe=256*1024;function $_n(t,e,n,o,r,i,a,l){var s=new GX(0,0);if(a?(s.current=a.current,s.total=a.total):(s.current=0,s.total=o.size()),o.size()!==s.total)throw a_n();var c=s.total-s.current,u=c;r>0&&(u=Math.min(u,r));var d=s.current,f=d+u,p=u===c?"upload, finalize":"upload",g={"X-Goog-Upload-Command":p,"X-Goog-Upload-Offset":""+s.current},y=o.slice(d,f);if(y===null)throw Pnt();function w(v,T){var A=I5e(v,["active","final"]),x=s.current+u,S=o.size(),R;return A==="final"?R=OZ(e,i)(v,T):R=null,new GX(x,S,A==="final",R)}var b="POST",C=e.maxUploadRetryTime,P=new xA(n,b,w,C);return P.headers=g,P.body=y.uploadData(),P.progressCallback=l||null,P.errorHandler=uM(t),P}/** +--`+s+"--",p=H5e.getBlob(d,o,f);if(p===null)throw Pnt();var g={name:c.fullPath},y=Gw(i,t.host),w="POST",b=t.maxUploadRetryTime,C=new xA(y,w,OZ(t,n),b);return C.urlParams=g,C.headers=a,C.body=p.uploadData(),C.errorHandler=uM(e),C}var XX=function(){function t(e,n,o,r){this.current=e,this.total=n,this.finalized=!!o,this.metadata=r||null}return t}();function z5e(t,e){var n=null;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch{I9(!1)}var o=e||["active"];return I9(!!n&&o.indexOf(n)!==-1),n}function K_n(t,e,n,o,r){var i=e.bucketOnlyServerUrl(),a=Lnt(e,o,r),l={name:a.fullPath},s=Gw(i,t.host),c="POST",u={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":""+o.size(),"X-Goog-Upload-Header-Content-Type":a.contentType,"Content-Type":"application/json; charset=utf-8"},d=I5e(a,n),f=t.maxUploadRetryTime;function p(y){z5e(y);var w;try{w=y.getResponseHeader("X-Goog-Upload-URL")}catch{I9(!1)}return I9(BZ(w)),w}var g=new xA(s,c,p,f);return g.urlParams=l,g.headers=u,g.body=d,g.errorHandler=uM(e),g}function q_n(t,e,n,o){var r={"X-Goog-Upload-Command":"query"};function i(c){var u=z5e(c,["active","final"]),d=null;try{d=c.getResponseHeader("X-Goog-Upload-Size-Received")}catch{I9(!1)}d||I9(!1);var f=Number(d);return I9(!isNaN(f)),new XX(f,o.size(),u==="final")}var a="POST",l=t.maxUploadRetryTime,s=new xA(n,a,i,l);return s.headers=r,s.errorHandler=uM(e),s}var DCe=256*1024;function $_n(t,e,n,o,r,i,a,l){var s=new XX(0,0);if(a?(s.current=a.current,s.total=a.total):(s.current=0,s.total=o.size()),o.size()!==s.total)throw a_n();var c=s.total-s.current,u=c;r>0&&(u=Math.min(u,r));var d=s.current,f=d+u,p=u===c?"upload, finalize":"upload",g={"X-Goog-Upload-Command":p,"X-Goog-Upload-Offset":""+s.current},y=o.slice(d,f);if(y===null)throw Pnt();function w(v,T){var A=z5e(v,["active","final"]),x=s.current+u,S=o.size(),R;return A==="final"?R=OZ(e,i)(v,T):R=null,new XX(x,S,A==="final",R)}var b="POST",C=e.maxUploadRetryTime,P=new xA(n,b,w,C);return P.headers=g,P.body=y.uploadData(),P.progressCallback=l||null,P.errorHandler=uM(t),P}/** * @license * Copyright 2017 Google LLC * @@ -6781,7 +6781,7 @@ Content-Type: `+c.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var Wnt=function(){function t(e,n,o){var r=this;o===void 0&&(o=null),this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=n,this._metadata=o,this._mappings=YZ(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=function(i){r._request=void 0,r._chunkMultiplier=1,i._codeEquals("canceled")?(r._needToFetchStatus=!0,r.completeTransitions_()):(r._error=i,r._transition("error"))},this._metadataErrorHandler=function(i){r._request=void 0,i._codeEquals("canceled")?r.completeTransitions_():(r._error=i,r._transition("error"))},this._promise=new Promise(function(i,a){r._resolve=i,r._reject=a,r._start()}),this._promise.then(null,function(){})}return t.prototype._makeProgressCallback=function(){var e=this,n=this._transferred;return function(o){return e._updateProgress(n+o)}},t.prototype._shouldDoResumable=function(e){return e.size()>256*1024},t.prototype._start=function(){this._state==="running"&&this._request===void 0&&(this._resumable?this._uploadUrl===void 0?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this._continueUpload():this._oneShotUpload())},t.prototype._resolveToken=function(e){var n=this;Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(function(o){var r=o[0],i=o[1];switch(n._state){case"running":e(r,i);break;case"canceling":n._transition("canceled");break;case"pausing":n._transition("paused");break}})},t.prototype._createResumable=function(){var e=this;this._resolveToken(function(n,o){var r=K_n(e._ref.storage,e._ref._location,e._mappings,e._blob,e._metadata),i=e._ref.storage._makeRequest(r,n,o);e._request=i,i.getPromise().then(function(a){e._request=void 0,e._uploadUrl=a,e._needToFetchStatus=!1,e.completeTransitions_()},e._errorHandler)})},t.prototype._fetchStatus=function(){var e=this,n=this._uploadUrl;this._resolveToken(function(o,r){var i=q_n(e._ref.storage,e._ref._location,n,e._blob),a=e._ref.storage._makeRequest(i,o,r);e._request=a,a.getPromise().then(function(l){l=l,e._request=void 0,e._updateProgress(l.current),e._needToFetchStatus=!1,l.finalized&&(e._needToFetchMetadata=!0),e.completeTransitions_()},e._errorHandler)})},t.prototype._continueUpload=function(){var e=this,n=zCe*this._chunkMultiplier,o=new GX(this._transferred,this._blob.size()),r=this._uploadUrl;this._resolveToken(function(i,a){var l;try{l=$_n(e._ref._location,e._ref.storage,r,e._blob,n,e._mappings,o,e._makeProgressCallback())}catch(c){e._error=c,e._transition("error");return}var s=e._ref.storage._makeRequest(l,i,a);e._request=s,s.getPromise().then(function(c){e._increaseMultiplier(),e._request=void 0,e._updateProgress(c.current),c.finalized?(e._metadata=c.metadata,e._transition("success")):e.completeTransitions_()},e._errorHandler)})},t.prototype._increaseMultiplier=function(){var e=zCe*this._chunkMultiplier;e<32*1024*1024&&(this._chunkMultiplier*=2)},t.prototype._fetchMetadata=function(){var e=this;this._resolveToken(function(n,o){var r=knt(e._ref.storage,e._ref._location,e._mappings),i=e._ref.storage._makeRequest(r,n,o);e._request=i,i.getPromise().then(function(a){e._request=void 0,e._metadata=a,e._transition("success")},e._metadataErrorHandler)})},t.prototype._oneShotUpload=function(){var e=this;this._resolveToken(function(n,o){var r=J_n(e._ref.storage,e._ref._location,e._mappings,e._blob,e._metadata),i=e._ref.storage._makeRequest(r,n,o);e._request=i,i.getPromise().then(function(a){e._request=void 0,e._metadata=a,e._updateProgress(e._blob.size()),e._transition("success")},e._errorHandler)})},t.prototype._updateProgress=function(e){var n=this._transferred;this._transferred=e,this._transferred!==n&&this._notifyObservers()},t.prototype._transition=function(e){if(this._state!==e)switch(e){case"canceling":this._state=e,this._request!==void 0&&this._request.cancel();break;case"pausing":this._state=e,this._request!==void 0&&this._request.cancel();break;case"running":var n=this._state==="paused";this._state=e,n&&(this._notifyObservers(),this._start());break;case"paused":this._state=e,this._notifyObservers();break;case"canceled":this._error=Tnt(),this._state=e,this._notifyObservers();break;case"error":this._state=e,this._notifyObservers();break;case"success":this._state=e,this._notifyObservers();break}},t.prototype.completeTransitions_=function(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start();break}},Object.defineProperty(t.prototype,"snapshot",{get:function(){var e=Tae(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}},enumerable:!1,configurable:!0}),t.prototype.on=function(e,n,o,r){var i=this,a=new Q_n(n,o,r);return this._addObserver(a),function(){i._removeObserver(a)}},t.prototype.then=function(e,n){return this._promise.then(e,n)},t.prototype.catch=function(e){return this.then(null,e)},t.prototype._addObserver=function(e){this._observers.push(e),this._notifyObserver(e)},t.prototype._removeObserver=function(e){var n=this._observers.indexOf(e);n!==-1&&this._observers.splice(n,1)},t.prototype._notifyObservers=function(){var e=this;this._finishPromise();var n=this._observers.slice();n.forEach(function(o){e._notifyObserver(o)})},t.prototype._finishPromise=function(){if(this._resolve!==void 0){var e=!0;switch(Tae(this._state)){case qh.SUCCESS:GT(this._resolve.bind(null,this.snapshot))();break;case qh.CANCELED:case qh.ERROR:var n=this._reject;GT(n.bind(null,this._error))();break;default:e=!1;break}e&&(this._resolve=void 0,this._reject=void 0)}},t.prototype._notifyObserver=function(e){var n=Tae(this._state);switch(n){case qh.RUNNING:case qh.PAUSED:e.next&>(e.next.bind(e,this.snapshot))();break;case qh.SUCCESS:e.complete&>(e.complete.bind(e))();break;case qh.CANCELED:case qh.ERROR:e.error&>(e.error.bind(e,this._error))();break;default:e.error&>(e.error.bind(e,this._error))()}},t.prototype.resume=function(){var e=this._state==="paused"||this._state==="pausing";return e&&this._transition("running"),e},t.prototype.pause=function(){var e=this._state==="running";return e&&this._transition("pausing"),e},t.prototype.cancel=function(){var e=this._state==="running"||this._state==="pausing";return e&&this._transition("canceling"),e},t}();/** + */var Wnt=function(){function t(e,n,o){var r=this;o===void 0&&(o=null),this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=n,this._metadata=o,this._mappings=YZ(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=function(i){r._request=void 0,r._chunkMultiplier=1,i._codeEquals("canceled")?(r._needToFetchStatus=!0,r.completeTransitions_()):(r._error=i,r._transition("error"))},this._metadataErrorHandler=function(i){r._request=void 0,i._codeEquals("canceled")?r.completeTransitions_():(r._error=i,r._transition("error"))},this._promise=new Promise(function(i,a){r._resolve=i,r._reject=a,r._start()}),this._promise.then(null,function(){})}return t.prototype._makeProgressCallback=function(){var e=this,n=this._transferred;return function(o){return e._updateProgress(n+o)}},t.prototype._shouldDoResumable=function(e){return e.size()>256*1024},t.prototype._start=function(){this._state==="running"&&this._request===void 0&&(this._resumable?this._uploadUrl===void 0?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this._continueUpload():this._oneShotUpload())},t.prototype._resolveToken=function(e){var n=this;Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(function(o){var r=o[0],i=o[1];switch(n._state){case"running":e(r,i);break;case"canceling":n._transition("canceled");break;case"pausing":n._transition("paused");break}})},t.prototype._createResumable=function(){var e=this;this._resolveToken(function(n,o){var r=K_n(e._ref.storage,e._ref._location,e._mappings,e._blob,e._metadata),i=e._ref.storage._makeRequest(r,n,o);e._request=i,i.getPromise().then(function(a){e._request=void 0,e._uploadUrl=a,e._needToFetchStatus=!1,e.completeTransitions_()},e._errorHandler)})},t.prototype._fetchStatus=function(){var e=this,n=this._uploadUrl;this._resolveToken(function(o,r){var i=q_n(e._ref.storage,e._ref._location,n,e._blob),a=e._ref.storage._makeRequest(i,o,r);e._request=a,a.getPromise().then(function(l){l=l,e._request=void 0,e._updateProgress(l.current),e._needToFetchStatus=!1,l.finalized&&(e._needToFetchMetadata=!0),e.completeTransitions_()},e._errorHandler)})},t.prototype._continueUpload=function(){var e=this,n=DCe*this._chunkMultiplier,o=new XX(this._transferred,this._blob.size()),r=this._uploadUrl;this._resolveToken(function(i,a){var l;try{l=$_n(e._ref._location,e._ref.storage,r,e._blob,n,e._mappings,o,e._makeProgressCallback())}catch(c){e._error=c,e._transition("error");return}var s=e._ref.storage._makeRequest(l,i,a);e._request=s,s.getPromise().then(function(c){e._increaseMultiplier(),e._request=void 0,e._updateProgress(c.current),c.finalized?(e._metadata=c.metadata,e._transition("success")):e.completeTransitions_()},e._errorHandler)})},t.prototype._increaseMultiplier=function(){var e=DCe*this._chunkMultiplier;e<32*1024*1024&&(this._chunkMultiplier*=2)},t.prototype._fetchMetadata=function(){var e=this;this._resolveToken(function(n,o){var r=knt(e._ref.storage,e._ref._location,e._mappings),i=e._ref.storage._makeRequest(r,n,o);e._request=i,i.getPromise().then(function(a){e._request=void 0,e._metadata=a,e._transition("success")},e._metadataErrorHandler)})},t.prototype._oneShotUpload=function(){var e=this;this._resolveToken(function(n,o){var r=J_n(e._ref.storage,e._ref._location,e._mappings,e._blob,e._metadata),i=e._ref.storage._makeRequest(r,n,o);e._request=i,i.getPromise().then(function(a){e._request=void 0,e._metadata=a,e._updateProgress(e._blob.size()),e._transition("success")},e._errorHandler)})},t.prototype._updateProgress=function(e){var n=this._transferred;this._transferred=e,this._transferred!==n&&this._notifyObservers()},t.prototype._transition=function(e){if(this._state!==e)switch(e){case"canceling":this._state=e,this._request!==void 0&&this._request.cancel();break;case"pausing":this._state=e,this._request!==void 0&&this._request.cancel();break;case"running":var n=this._state==="paused";this._state=e,n&&(this._notifyObservers(),this._start());break;case"paused":this._state=e,this._notifyObservers();break;case"canceled":this._error=Tnt(),this._state=e,this._notifyObservers();break;case"error":this._state=e,this._notifyObservers();break;case"success":this._state=e,this._notifyObservers();break}},t.prototype.completeTransitions_=function(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start();break}},Object.defineProperty(t.prototype,"snapshot",{get:function(){var e=Tae(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}},enumerable:!1,configurable:!0}),t.prototype.on=function(e,n,o,r){var i=this,a=new Q_n(n,o,r);return this._addObserver(a),function(){i._removeObserver(a)}},t.prototype.then=function(e,n){return this._promise.then(e,n)},t.prototype.catch=function(e){return this.then(null,e)},t.prototype._addObserver=function(e){this._observers.push(e),this._notifyObserver(e)},t.prototype._removeObserver=function(e){var n=this._observers.indexOf(e);n!==-1&&this._observers.splice(n,1)},t.prototype._notifyObservers=function(){var e=this;this._finishPromise();var n=this._observers.slice();n.forEach(function(o){e._notifyObserver(o)})},t.prototype._finishPromise=function(){if(this._resolve!==void 0){var e=!0;switch(Tae(this._state)){case qh.SUCCESS:GT(this._resolve.bind(null,this.snapshot))();break;case qh.CANCELED:case qh.ERROR:var n=this._reject;GT(n.bind(null,this._error))();break;default:e=!1;break}e&&(this._resolve=void 0,this._reject=void 0)}},t.prototype._notifyObserver=function(e){var n=Tae(this._state);switch(n){case qh.RUNNING:case qh.PAUSED:e.next&>(e.next.bind(e,this.snapshot))();break;case qh.SUCCESS:e.complete&>(e.complete.bind(e))();break;case qh.CANCELED:case qh.ERROR:e.error&>(e.error.bind(e,this._error))();break;default:e.error&>(e.error.bind(e,this._error))()}},t.prototype.resume=function(){var e=this._state==="paused"||this._state==="pausing";return e&&this._transition("running"),e},t.prototype.pause=function(){var e=this._state==="running";return e&&this._transition("pausing"),e},t.prototype.cancel=function(){var e=this._state==="running"||this._state==="pausing";return e&&this._transition("canceling"),e},t}();/** * @license * Copyright 2019 Google LLC * @@ -6796,7 +6796,7 @@ Content-Type: `+c.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var VZ=function(){function t(e,n){this._service=e,n instanceof Ym?this._location=n:this._location=Ym.makeFromUrl(n,e.host)}return t.prototype.toString=function(){return"gs://"+this._location.bucket+"/"+this._location.path},t.prototype._newRef=function(e,n){return new t(e,n)},Object.defineProperty(t.prototype,"root",{get:function(){var e=new Ym(this._location.bucket,"");return this._newRef(this._service,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucket",{get:function(){return this._location.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullPath",{get:function(){return this._location.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return Ent(this._location.path)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"storage",{get:function(){return this._service},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=D_n(this._location.path);if(e===null)return null;var n=new Ym(this._location.bucket,e);return new t(this._service,n)},enumerable:!1,configurable:!0}),t.prototype._throwIfRoot=function(e){if(this._location.path==="")throw Rnt(e)},t}();function Z_n(t,e,n){return t._throwIfRoot("uploadBytesResumable"),new Wnt(t,new R5e(e),n)}function eVn(t){var e={prefixes:[],items:[]};return Nnt(t,e).then(function(){return e})}function Nnt(t,e,n){return vo(this,void 0,void 0,function(){var o,r,i,a;return Ao(this,function(l){switch(l.label){case 0:return o={pageToken:n},[4,Unt(t,o)];case 1:return r=l.sent(),(i=e.prefixes).push.apply(i,r.prefixes),(a=e.items).push.apply(a,r.items),r.nextPageToken==null?[3,3]:[4,Nnt(t,e,r.nextPageToken)];case 2:l.sent(),l.label=3;case 3:return[2]}})})}function Unt(t,e){return vo(this,void 0,void 0,function(){var n,o;return Ao(this,function(r){switch(r.label){case 0:return e!=null&&typeof e.maxResults=="number"&&Zde("options.maxResults",1,1e3,e.maxResults),n=e||{},o=O_n(t.storage,t._location,"/",n.pageToken,n.maxResults),[4,t.storage.makeRequestWithTokens(o)];case 1:return[2,r.sent().getPromise()]}})})}function tVn(t){return vo(this,void 0,void 0,function(){var e;return Ao(this,function(n){switch(n.label){case 0:return t._throwIfRoot("getMetadata"),e=knt(t.storage,t._location,YZ()),[4,t.storage.makeRequestWithTokens(e)];case 1:return[2,n.sent().getPromise()]}})})}function nVn(t,e){return vo(this,void 0,void 0,function(){var n;return Ao(this,function(o){switch(o.label){case 0:return t._throwIfRoot("updateMetadata"),n=V_n(t.storage,t._location,e,YZ()),[4,t.storage.makeRequestWithTokens(n)];case 1:return[2,o.sent().getPromise()]}})})}function oVn(t){return vo(this,void 0,void 0,function(){var e;return Ao(this,function(n){switch(n.label){case 0:return t._throwIfRoot("getDownloadURL"),e=__n(t.storage,t._location,YZ()),[4,t.storage.makeRequestWithTokens(e)];case 1:return[2,n.sent().getPromise().then(function(o){if(o===null)throw l_n();return o})]}})})}function rVn(t){return vo(this,void 0,void 0,function(){var e;return Ao(this,function(n){switch(n.label){case 0:return t._throwIfRoot("deleteObject"),e=G_n(t.storage,t._location),[4,t.storage.makeRequestWithTokens(e)];case 1:return[2,n.sent().getPromise()]}})})}function jnt(t,e){var n=E_n(t._location.path,e),o=new Ym(t._location.bucket,n);return new VZ(t.storage,o)}/** + */var VZ=function(){function t(e,n){this._service=e,n instanceof Ym?this._location=n:this._location=Ym.makeFromUrl(n,e.host)}return t.prototype.toString=function(){return"gs://"+this._location.bucket+"/"+this._location.path},t.prototype._newRef=function(e,n){return new t(e,n)},Object.defineProperty(t.prototype,"root",{get:function(){var e=new Ym(this._location.bucket,"");return this._newRef(this._service,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucket",{get:function(){return this._location.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullPath",{get:function(){return this._location.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return Ent(this._location.path)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"storage",{get:function(){return this._service},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=D_n(this._location.path);if(e===null)return null;var n=new Ym(this._location.bucket,e);return new t(this._service,n)},enumerable:!1,configurable:!0}),t.prototype._throwIfRoot=function(e){if(this._location.path==="")throw Rnt(e)},t}();function Z_n(t,e,n){return t._throwIfRoot("uploadBytesResumable"),new Wnt(t,new H5e(e),n)}function eVn(t){var e={prefixes:[],items:[]};return Nnt(t,e).then(function(){return e})}function Nnt(t,e,n){return vo(this,void 0,void 0,function(){var o,r,i,a;return Ao(this,function(l){switch(l.label){case 0:return o={pageToken:n},[4,Unt(t,o)];case 1:return r=l.sent(),(i=e.prefixes).push.apply(i,r.prefixes),(a=e.items).push.apply(a,r.items),r.nextPageToken==null?[3,3]:[4,Nnt(t,e,r.nextPageToken)];case 2:l.sent(),l.label=3;case 3:return[2]}})})}function Unt(t,e){return vo(this,void 0,void 0,function(){var n,o;return Ao(this,function(r){switch(r.label){case 0:return e!=null&&typeof e.maxResults=="number"&&Zde("options.maxResults",1,1e3,e.maxResults),n=e||{},o=O_n(t.storage,t._location,"/",n.pageToken,n.maxResults),[4,t.storage.makeRequestWithTokens(o)];case 1:return[2,r.sent().getPromise()]}})})}function tVn(t){return vo(this,void 0,void 0,function(){var e;return Ao(this,function(n){switch(n.label){case 0:return t._throwIfRoot("getMetadata"),e=knt(t.storage,t._location,YZ()),[4,t.storage.makeRequestWithTokens(e)];case 1:return[2,n.sent().getPromise()]}})})}function nVn(t,e){return vo(this,void 0,void 0,function(){var n;return Ao(this,function(o){switch(o.label){case 0:return t._throwIfRoot("updateMetadata"),n=V_n(t.storage,t._location,e,YZ()),[4,t.storage.makeRequestWithTokens(n)];case 1:return[2,o.sent().getPromise()]}})})}function oVn(t){return vo(this,void 0,void 0,function(){var e;return Ao(this,function(n){switch(n.label){case 0:return t._throwIfRoot("getDownloadURL"),e=__n(t.storage,t._location,YZ()),[4,t.storage.makeRequestWithTokens(e)];case 1:return[2,n.sent().getPromise().then(function(o){if(o===null)throw l_n();return o})]}})})}function rVn(t){return vo(this,void 0,void 0,function(){var e;return Ao(this,function(n){switch(n.label){case 0:return t._throwIfRoot("deleteObject"),e=G_n(t.storage,t._location),[4,t.storage.makeRequestWithTokens(e)];case 1:return[2,n.sent().getPromise()]}})})}function jnt(t,e){var n=E_n(t._location.path,e),o=new Ym(t._location.bucket,n);return new VZ(t.storage,o)}/** * @license * Copyright 2017 Google LLC * @@ -6811,7 +6811,7 @@ Content-Type: `+c.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function efe(t){return/^[A-Za-z]+:\/\//.test(t)}function iVn(t,e){return new VZ(t,e)}function Bnt(t,e){if(t instanceof GZ){var n=t;if(n._bucket==null)throw i_n();var o=new VZ(n,n._bucket);return e!=null?Bnt(o,e):o}else return e!==void 0?jnt(t,e):t}function aVn(t,e){if(e&&efe(e)){if(t instanceof GZ)return iVn(t,e);throw kC("To use ref(service, url), the first argument must be a Storage instance.")}else return Bnt(t,e)}function DCe(t,e){var n=e==null?void 0:e[Snt];return n==null?null:Ym.makeFromBucketSpec(n,t)}function lVn(t,e,n,o){o===void 0&&(o={}),t.host="http://"+e+":"+n;var r=o.mockUserToken;r&&(t._overrideAuthToken=typeof r=="string"?r:u2e(r,t.app.options.projectId))}var GZ=function(){function t(e,n,o,r,i,a){this.app=e,this._authProvider=n,this._appCheckProvider=o,this._pool=r,this._url=i,this._firebaseVersion=a,this._bucket=null,this._host=bnt,this._appId=null,this._deleted=!1,this._maxOperationRetryTime=KOn,this._maxUploadRetryTime=qOn,this._requests=new Set,i!=null?this._bucket=Ym.makeFromBucketSpec(i,this._host):this._bucket=DCe(this._host,this.app.options)}return Object.defineProperty(t.prototype,"host",{get:function(){return this._host},set:function(e){this._host=e,this._url!=null?this._bucket=Ym.makeFromBucketSpec(this._url,e):this._bucket=DCe(e,this.app.options)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this._maxUploadRetryTime},set:function(e){Zde("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxOperationRetryTime",{get:function(){return this._maxOperationRetryTime},set:function(e){Zde("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e},enumerable:!1,configurable:!0}),t.prototype._getAuthToken=function(){return vo(this,void 0,void 0,function(){var e,n;return Ao(this,function(o){switch(o.label){case 0:return this._overrideAuthToken?[2,this._overrideAuthToken]:(e=this._authProvider.getImmediate({optional:!0}),e?[4,e.getToken()]:[3,2]);case 1:if(n=o.sent(),n!==null)return[2,n.accessToken];o.label=2;case 2:return[2,null]}})})},t.prototype._getAppCheckToken=function(){return vo(this,void 0,void 0,function(){var e,n;return Ao(this,function(o){switch(o.label){case 0:return e=this._appCheckProvider.getImmediate({optional:!0}),e?[4,e.getToken()]:[3,2];case 1:return n=o.sent(),[2,n.token];case 2:return[2,null]}})})},t.prototype._delete=function(){return this._deleted||(this._deleted=!0,this._requests.forEach(function(e){return e.cancel()}),this._requests.clear()),Promise.resolve()},t.prototype._makeStorageReference=function(e){return new VZ(this,e)},t.prototype._makeRequest=function(e,n,o){var r=this;if(this._deleted)return new y_n(Cnt());var i=H_n(e,this._appId,n,o,this._pool,this._firebaseVersion);return this._requests.add(i),i.getPromise().then(function(){return r._requests.delete(i)},function(){return r._requests.delete(i)}),i},t.prototype.makeRequestWithTokens=function(e){return vo(this,void 0,void 0,function(){var n,o,r;return Ao(this,function(i){switch(i.label){case 0:return[4,Promise.all([this._getAuthToken(),this._getAppCheckToken()])];case 1:return n=i.sent(),o=n[0],r=n[1],[2,this._makeRequest(e,o,r)]}})})},t}();/** + */function efe(t){return/^[A-Za-z]+:\/\//.test(t)}function iVn(t,e){return new VZ(t,e)}function Bnt(t,e){if(t instanceof GZ){var n=t;if(n._bucket==null)throw i_n();var o=new VZ(n,n._bucket);return e!=null?Bnt(o,e):o}else return e!==void 0?jnt(t,e):t}function aVn(t,e){if(e&&efe(e)){if(t instanceof GZ)return iVn(t,e);throw kC("To use ref(service, url), the first argument must be a Storage instance.")}else return Bnt(t,e)}function ECe(t,e){var n=e==null?void 0:e[Snt];return n==null?null:Ym.makeFromBucketSpec(n,t)}function lVn(t,e,n,o){o===void 0&&(o={}),t.host="http://"+e+":"+n;var r=o.mockUserToken;r&&(t._overrideAuthToken=typeof r=="string"?r:d2e(r,t.app.options.projectId))}var GZ=function(){function t(e,n,o,r,i,a){this.app=e,this._authProvider=n,this._appCheckProvider=o,this._pool=r,this._url=i,this._firebaseVersion=a,this._bucket=null,this._host=bnt,this._appId=null,this._deleted=!1,this._maxOperationRetryTime=KOn,this._maxUploadRetryTime=qOn,this._requests=new Set,i!=null?this._bucket=Ym.makeFromBucketSpec(i,this._host):this._bucket=ECe(this._host,this.app.options)}return Object.defineProperty(t.prototype,"host",{get:function(){return this._host},set:function(e){this._host=e,this._url!=null?this._bucket=Ym.makeFromBucketSpec(this._url,e):this._bucket=ECe(e,this.app.options)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this._maxUploadRetryTime},set:function(e){Zde("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxOperationRetryTime",{get:function(){return this._maxOperationRetryTime},set:function(e){Zde("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e},enumerable:!1,configurable:!0}),t.prototype._getAuthToken=function(){return vo(this,void 0,void 0,function(){var e,n;return Ao(this,function(o){switch(o.label){case 0:return this._overrideAuthToken?[2,this._overrideAuthToken]:(e=this._authProvider.getImmediate({optional:!0}),e?[4,e.getToken()]:[3,2]);case 1:if(n=o.sent(),n!==null)return[2,n.accessToken];o.label=2;case 2:return[2,null]}})})},t.prototype._getAppCheckToken=function(){return vo(this,void 0,void 0,function(){var e,n;return Ao(this,function(o){switch(o.label){case 0:return e=this._appCheckProvider.getImmediate({optional:!0}),e?[4,e.getToken()]:[3,2];case 1:return n=o.sent(),[2,n.token];case 2:return[2,null]}})})},t.prototype._delete=function(){return this._deleted||(this._deleted=!0,this._requests.forEach(function(e){return e.cancel()}),this._requests.clear()),Promise.resolve()},t.prototype._makeStorageReference=function(e){return new VZ(this,e)},t.prototype._makeRequest=function(e,n,o){var r=this;if(this._deleted)return new y_n(Cnt());var i=H_n(e,this._appId,n,o,this._pool,this._firebaseVersion);return this._requests.add(i),i.getPromise().then(function(){return r._requests.delete(i)},function(){return r._requests.delete(i)}),i},t.prototype.makeRequestWithTokens=function(e){return vo(this,void 0,void 0,function(){var n,o,r;return Ao(this,function(i){switch(i.label){case 0:return[4,Promise.all([this._getAuthToken(),this._getAppCheckToken()])];case 1:return n=i.sent(),o=n[0],r=n[1],[2,this._makeRequest(e,o,r)]}})})},t}();/** * @license * Copyright 2020 Google LLC * @@ -6826,7 +6826,7 @@ Content-Type: `+c.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function sVn(t,e,n){return t=ba(t),Z_n(t,e,n)}function cVn(t){return t=ba(t),tVn(t)}function uVn(t,e){return t=ba(t),nVn(t,e)}function dVn(t,e){return t=ba(t),Unt(t,e)}function fVn(t){return t=ba(t),eVn(t)}function hVn(t){return t=ba(t),oVn(t)}function pVn(t){return t=ba(t),rVn(t)}function ECe(t,e){return t=ba(t),aVn(t,e)}function gVn(t,e){return jnt(t,e)}function mVn(t,e,n,o){o===void 0&&(o={}),lVn(t,e,n,o)}/** + */function sVn(t,e,n){return t=ba(t),Z_n(t,e,n)}function cVn(t){return t=ba(t),tVn(t)}function uVn(t,e){return t=ba(t),nVn(t,e)}function dVn(t,e){return t=ba(t),Unt(t,e)}function fVn(t){return t=ba(t),eVn(t)}function hVn(t){return t=ba(t),oVn(t)}function pVn(t){return t=ba(t),rVn(t)}function FCe(t,e){return t=ba(t),aVn(t,e)}function gVn(t,e){return jnt(t,e)}function mVn(t,e,n,o){o===void 0&&(o={}),lVn(t,e,n,o)}/** * @license * Copyright 2020 Google LLC * @@ -6841,7 +6841,7 @@ Content-Type: `+c.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var EO=function(){function t(e,n,o){this._delegate=e,this.task=n,this.ref=o}return Object.defineProperty(t.prototype,"bytesTransferred",{get:function(){return this._delegate.bytesTransferred},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._delegate.state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalBytes",{get:function(){return this._delegate.totalBytes},enumerable:!1,configurable:!0}),t}();/** + */var FO=function(){function t(e,n,o){this._delegate=e,this.task=n,this.ref=o}return Object.defineProperty(t.prototype,"bytesTransferred",{get:function(){return this._delegate.bytesTransferred},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._delegate.state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalBytes",{get:function(){return this._delegate.totalBytes},enumerable:!1,configurable:!0}),t}();/** * @license * Copyright 2020 Google LLC * @@ -6856,7 +6856,7 @@ Content-Type: `+c.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var FCe=function(){function t(e,n){this._delegate=e,this._ref=n,this.cancel=this._delegate.cancel.bind(this._delegate),this.catch=this._delegate.catch.bind(this._delegate),this.pause=this._delegate.pause.bind(this._delegate),this.resume=this._delegate.resume.bind(this._delegate)}return Object.defineProperty(t.prototype,"snapshot",{get:function(){return new EO(this._delegate.snapshot,this,this._ref)},enumerable:!1,configurable:!0}),t.prototype.then=function(e,n){var o=this;return this._delegate.then(function(r){if(e)return e(new EO(r,o,o._ref))},n)},t.prototype.on=function(e,n,o,r){var i=this,a=void 0;return n&&(typeof n=="function"?a=function(l){return n(new EO(l,i,i._ref))}:a={next:n.next?function(l){return n.next(new EO(l,i,i._ref))}:void 0,complete:n.complete||void 0,error:n.error||void 0}),this._delegate.on(e,a,o||void 0,r||void 0)},t}(),kCe=function(){function t(e,n){this._delegate=e,this._service=n}return Object.defineProperty(t.prototype,"prefixes",{get:function(){var e=this;return this._delegate.prefixes.map(function(n){return new Fk(n,e._service)})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){var e=this;return this._delegate.items.map(function(n){return new Fk(n,e._service)})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextPageToken",{get:function(){return this._delegate.nextPageToken||null},enumerable:!1,configurable:!0}),t}();/** + */var kCe=function(){function t(e,n){this._delegate=e,this._ref=n,this.cancel=this._delegate.cancel.bind(this._delegate),this.catch=this._delegate.catch.bind(this._delegate),this.pause=this._delegate.pause.bind(this._delegate),this.resume=this._delegate.resume.bind(this._delegate)}return Object.defineProperty(t.prototype,"snapshot",{get:function(){return new FO(this._delegate.snapshot,this,this._ref)},enumerable:!1,configurable:!0}),t.prototype.then=function(e,n){var o=this;return this._delegate.then(function(r){if(e)return e(new FO(r,o,o._ref))},n)},t.prototype.on=function(e,n,o,r){var i=this,a=void 0;return n&&(typeof n=="function"?a=function(l){return n(new FO(l,i,i._ref))}:a={next:n.next?function(l){return n.next(new FO(l,i,i._ref))}:void 0,complete:n.complete||void 0,error:n.error||void 0}),this._delegate.on(e,a,o||void 0,r||void 0)},t}(),LCe=function(){function t(e,n){this._delegate=e,this._service=n}return Object.defineProperty(t.prototype,"prefixes",{get:function(){var e=this;return this._delegate.prefixes.map(function(n){return new Fk(n,e._service)})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){var e=this;return this._delegate.items.map(function(n){return new Fk(n,e._service)})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextPageToken",{get:function(){return this._delegate.nextPageToken||null},enumerable:!1,configurable:!0}),t}();/** * @license * Copyright 2020 Google LLC * @@ -6871,7 +6871,7 @@ Content-Type: `+c.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var Fk=function(){function t(e,n){this._delegate=e,this.storage=n}return Object.defineProperty(t.prototype,"name",{get:function(){return this._delegate.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucket",{get:function(){return this._delegate.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullPath",{get:function(){return this._delegate.fullPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return this._delegate.toString()},t.prototype.child=function(e){var n=gVn(this._delegate,e);return new t(n,this.storage)},Object.defineProperty(t.prototype,"root",{get:function(){return new t(this._delegate.root,this.storage)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this._delegate.parent;return e==null?null:new t(e,this.storage)},enumerable:!1,configurable:!0}),t.prototype.put=function(e,n){return this._throwIfRoot("put"),new FCe(sVn(this._delegate,e,n),this)},t.prototype.putString=function(e,n,o){n===void 0&&(n=Bm.RAW),this._throwIfRoot("putString");var r=Hnt(n,e),i=U0({},o);return i.contentType==null&&r.contentType!=null&&(i.contentType=r.contentType),new FCe(new Wnt(this._delegate,new R5e(r.data,!0),i),this)},t.prototype.listAll=function(){var e=this;return fVn(this._delegate).then(function(n){return new kCe(n,e.storage)})},t.prototype.list=function(e){var n=this;return dVn(this._delegate,e||void 0).then(function(o){return new kCe(o,n.storage)})},t.prototype.getMetadata=function(){return cVn(this._delegate)},t.prototype.updateMetadata=function(e){return uVn(this._delegate,e)},t.prototype.getDownloadURL=function(){return hVn(this._delegate)},t.prototype.delete=function(){return this._throwIfRoot("delete"),pVn(this._delegate)},t.prototype._throwIfRoot=function(e){if(this._delegate._location.path==="")throw Rnt(e)},t}();/** + */var Fk=function(){function t(e,n){this._delegate=e,this.storage=n}return Object.defineProperty(t.prototype,"name",{get:function(){return this._delegate.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucket",{get:function(){return this._delegate.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullPath",{get:function(){return this._delegate.fullPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return this._delegate.toString()},t.prototype.child=function(e){var n=gVn(this._delegate,e);return new t(n,this.storage)},Object.defineProperty(t.prototype,"root",{get:function(){return new t(this._delegate.root,this.storage)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this._delegate.parent;return e==null?null:new t(e,this.storage)},enumerable:!1,configurable:!0}),t.prototype.put=function(e,n){return this._throwIfRoot("put"),new kCe(sVn(this._delegate,e,n),this)},t.prototype.putString=function(e,n,o){n===void 0&&(n=Bm.RAW),this._throwIfRoot("putString");var r=Hnt(n,e),i=U0({},o);return i.contentType==null&&r.contentType!=null&&(i.contentType=r.contentType),new kCe(new Wnt(this._delegate,new H5e(r.data,!0),i),this)},t.prototype.listAll=function(){var e=this;return fVn(this._delegate).then(function(n){return new LCe(n,e.storage)})},t.prototype.list=function(e){var n=this;return dVn(this._delegate,e||void 0).then(function(o){return new LCe(o,n.storage)})},t.prototype.getMetadata=function(){return cVn(this._delegate)},t.prototype.updateMetadata=function(e){return uVn(this._delegate,e)},t.prototype.getDownloadURL=function(){return hVn(this._delegate)},t.prototype.delete=function(){return this._throwIfRoot("delete"),pVn(this._delegate)},t.prototype._throwIfRoot=function(e){if(this._delegate._location.path==="")throw Rnt(e)},t}();/** * @license * Copyright 2020 Google LLC * @@ -6886,7 +6886,7 @@ Content-Type: `+c.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var yVn=function(){function t(e,n){this.app=e,this._delegate=n}return Object.defineProperty(t.prototype,"maxOperationRetryTime",{get:function(){return this._delegate.maxOperationRetryTime},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this._delegate.maxUploadRetryTime},enumerable:!1,configurable:!0}),t.prototype.ref=function(e){if(efe(e))throw kC("ref() expected a child path but got a URL, use refFromURL instead.");return new Fk(ECe(this._delegate,e),this)},t.prototype.refFromURL=function(e){if(!efe(e))throw kC("refFromURL() expected a full URL but got a child path, use ref() instead.");try{Ym.makeFromUrl(e,this._delegate.host)}catch{throw kC("refFromUrl() expected a valid full URL but got an invalid one.")}return new Fk(ECe(this._delegate,e),this)},t.prototype.setMaxUploadRetryTime=function(e){this._delegate.maxUploadRetryTime=e},t.prototype.setMaxOperationRetryTime=function(e){this._delegate.maxOperationRetryTime=e},t.prototype.useEmulator=function(e,n,o){o===void 0&&(o={}),mVn(this._delegate,e,n,o)},t}(),AVn="@firebase/storage",wVn="0.7.1";/** + */var yVn=function(){function t(e,n){this.app=e,this._delegate=n}return Object.defineProperty(t.prototype,"maxOperationRetryTime",{get:function(){return this._delegate.maxOperationRetryTime},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this._delegate.maxUploadRetryTime},enumerable:!1,configurable:!0}),t.prototype.ref=function(e){if(efe(e))throw kC("ref() expected a child path but got a URL, use refFromURL instead.");return new Fk(FCe(this._delegate,e),this)},t.prototype.refFromURL=function(e){if(!efe(e))throw kC("refFromURL() expected a full URL but got a child path, use ref() instead.");try{Ym.makeFromUrl(e,this._delegate.host)}catch{throw kC("refFromUrl() expected a valid full URL but got an invalid one.")}return new Fk(FCe(this._delegate,e),this)},t.prototype.setMaxUploadRetryTime=function(e){this._delegate.maxUploadRetryTime=e},t.prototype.setMaxOperationRetryTime=function(e){this._delegate.maxOperationRetryTime=e},t.prototype.useEmulator=function(e,n,o){o===void 0&&(o={}),mVn(this._delegate,e,n,o)},t}(),AVn="@firebase/storage",wVn="0.7.1";/** * @license * Copyright 2020 Google LLC * @@ -6901,7 +6901,7 @@ Content-Type: `+c.contentType+`\r * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var vVn="storage";function xVn(t,e){var n=e.instanceIdentifier,o=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal"),i=t.getProvider("app-check-internal"),a=new yVn(o,new GZ(o,r,i,new m_n,n,$n.SDK_VERSION));return a}function bVn(t){var e={TaskState:qh,TaskEvent:h_n,StringFormat:Bm,Storage:GZ,Reference:Fk};t.INTERNAL.registerComponent(new Ob(vVn,xVn,"PUBLIC").setServiceProps(e).setMultipleInstances(!0)),t.registerVersion(AVn,wVn)}bVn($n);const Pae=async(t,e,n)=>{try{return(await $n.firestore().collection("users").doc(t).collection("projects").doc(e).get()).exists}catch(o){n(o)}},Ynt=async(t,e,n)=>{const o={lng:H.getState().language};await $n.firestore().collection("users").doc(t).collection("projects").doc(e).get().then(r=>{const i=r.data();i?n({owner:t,title:r.id,timestamp:i.timestamp,description:i.description,dataColoring:i.dataColoring??d9.ALL,type:i.type,designs:i.designs,ranges:i.ranges??[],filters:i.filters??[],hiddenParameters:i.hiddenParameters,counter:i.counter??0,selectedProperty:i.selectedProperty,sortDescending:i.sortDescending,xAxisNameScatterPlot:i.xAxisNameScatterPlot,yAxisNameScatterPlot:i.yAxisNameScatterPlot,dotSizeScatterPlot:i.dotSizeScatterPlot,thumbnailWidth:i.thumbnailWidth}):po(Y.t("message.CannotOpenProject",o)+": "+e)}).catch(r=>{po(Y.t("message.CannotOpenProject",o)+": "+r)})},SVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({designs:$n.firestore.FieldValue.arrayRemove(n)}).then(()=>{ht.getState().set(r=>{r.updateProjectsFlag=!0}),$n.firestore().collection("users").doc(t).collection("designs").doc(n.title).delete().then(()=>{H.getState().set(r=>{n.title===r.cloudFile&&(r.cloudFile=void 0)}),hn(Y.t("message.DesignRemovedFromProject",o)+".")}).catch(r=>{po(Y.t("message.CannotDeleteCloudFile",o)+": "+r)})})}catch(r){po(Y.t("message.CannotRemoveDesignFromProject",o)+": "+r)}},TVn=async(t,e,n,o)=>{const r={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({hiddenParameters:o?$n.firestore.FieldValue.arrayUnion(n):$n.firestore.FieldValue.arrayRemove(n)})}catch(i){po(Y.t("message.CannotUpdateProject",r)+": "+i)}},FO=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({ranges:$n.firestore.FieldValue.arrayUnion(n)})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},LCe=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({ranges:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},PVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({description:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},CVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({dataColoring:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},RVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({selectedProperty:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},HVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({xAxisNameScatterPlot:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},MVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({yAxisNameScatterPlot:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},IVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({dotSizeScatterPlot:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},zVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({thumbnailWidth:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},Ont=(t,e,n)=>{let o={timestamp:Date.now(),title:e,thumbnail:n,excluded:!1};switch(t){case Pi.SOLAR_PANEL_ARRAY:{const r=H.getState().world.latitude,i=me.countAllSolarPanels(),a=me.countAllSolarPanelDailyYields(),l=me.countAllSolarPanelYearlyYields(),s=H.getState().economicsParams,c=s.operationalCostPerUnit,u=s.electricitySellingPrice;o={latitude:r,unitCost:c,sellingPrice:u,panelCount:i,dailyYield:a,yearlyYield:l,...o,...H.getState().solarPanelArrayLayoutParams};break}case Pi.SOLAR_PANEL_TILT_ANGLE:break}return o},WCe=(t,e)=>{if(!e)return null;const n=[];for(const o of e){const r={...o};r.title=DVn(t,o.title),r.timestamp=Date.now(),n.push(r)}return n},DVn=(t,e)=>{const n=e.lastIndexOf(" ");return t+e.substring(n)},EVn=t=>{const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");return n&&n.drawImage(t,1,1),e.toDataURL()},NCe=(t,e,n,o)=>{const r={lng:H.getState().language};$n.firestore().collection("users").doc(n??o).collection("designs").doc(t).get().then(i=>{if(i.exists){const a=i.data();a&&$n.firestore().collection("users").doc(o).collection("designs").doc(e).set(a).then(()=>{hn(Y.t("message.CloudFileCopied",r)+": "+e)}).catch(l=>{po(Y.t("message.CannotWriteCloudFile",r)+": "+l)})}else po(Y.t("message.CannotReadCloudFile",r))}).catch(i=>{po(Y.t("message.CannotReadCloudFile",r)+": "+i)})},FVn=(t,e,n)=>{const o={lng:H.getState().language};$n.firestore().collection("users").doc(t).collection("projects").doc(e).get().then(r=>{if(r.exists){const i=r.data();if(i){const a=[];a.push(...i.designs);let l=-1;for(const[s,c]of a.entries())if(c.title===n.title){l=s;break}l>=0&&(a[l].invisible=!n.invisible,$n.firestore().collection("users").doc(t).collection("projects").doc(e).update({designs:a}).then(()=>{}).catch(s=>{po(Y.t("message.CannotUpdateProject",o)+": "+s)}))}}}).catch(r=>{po(Y.t("message.CannotFetchProjectData",o)+": "+r)}).finally(()=>{})},kVn=async(t,e,n,o,r,i)=>{const a={lng:H.getState().language};if(ht.getState().set(l=>{l.waiting=!0}),await $n.firestore().collection("users").doc(t).collection("designs").doc(r).set(H.getState().exportContent()),ht.getState().setChanged(!1),i){const l=me.resizeCanvas(i,o).toDataURL();$n.firestore().collection("users").doc(t).collection("projects").doc(n).get().then(s=>{if(s.exists){const c=s.data();if(c){const u=[];u.push(...c.designs);let d=-1;for(const[f,p]of u.entries())if(p.title===r){d=f;break}d>=0&&(u[d]=Ont(e,r,l),$n.firestore().collection("users").doc(t).collection("projects").doc(n).update({designs:u}).then(()=>{}).catch(f=>{po(Y.t("message.CannotUpdateProject",a)+": "+f)}).finally(()=>{H.getState().set(f=>{f.projectState.designs=u}),ht.getState().set(f=>{f.updateProjectsFlag=!0,f.waiting=!1})}))}}}).catch(s=>{po(Y.t("message.CannotFetchProjectData",a)+": "+s)}).finally(()=>{})}},UCe=async(t,e,n)=>{try{return(await $n.firestore().collection("users").doc(t).collection("files").doc(e).get()).exists}catch(o){n(o)}},LVn=async(t,e)=>{await $n.firestore().collection("users").doc(t).get().then(n=>{const o=n.data();return o?(o.fileList&&e.push(...o.fileList),!0):!1})},jCe=async(t,e)=>{await $n.firestore().collection("users").doc(t).update({fileList:$n.firestore.FieldValue.arrayUnion(e)}).then(()=>{}).catch(n=>{console.log(n)})},BCe=async(t,e)=>{await $n.firestore().collection("users").doc(t).update({fileList:$n.firestore.FieldValue.arrayRemove(e)}).then(()=>{}).catch(n=>{console.log(n)})},XX=async(t,e,n,o,r)=>{const i={lng:H.getState().language};H.getState().undoManager.clear(),ht.getState().set(a=>{a.waiting=!0});try{const l=(await $n.firestore().collection("users").doc(t).collection(n?"designs":"files").doc(e).get()).data();if(l?H.getState().importContent(l,e):(hn(Y.t("message.CloudFileNotFound",i)+": "+e),H.getState().set(s=>{s.cloudFile=void 0}),ht.getState().set(s=>{s.waiting=!1})),!o&&!r){const s=t1+"?client=web&userid="+t+"&title="+encodeURIComponent(e);window.history.pushState({},document.title,s)}}catch(a){po(Y.t("message.CannotOpenCloudFile",i)+": "+a),ht.getState().set(l=>{l.waiting=!1})}},E4=({key:t,label:e})=>({key:t,label:h.jsx(rn,{noPadding:!0,children:Y.t(e,{lng:H.getState().language})})}),WVn=t=>{const e={lng:H.getState().language},n=H.getState().set,o=a=>{n(l=>{l.projectState={...a},l.projectImages.clear(),l.projectView=!0}),ht.getState().set(l=>{l.projectImagesUpdateFlag=!l.projectImagesUpdateFlag,l.updateProjectsFlag=!0})},r=(a,l)=>{const s="QWecNcxhyvP6j6sBN11hBsfZDau1";a&&s&&(Ynt(s,a,o).then(()=>{XX(s,a+" "+l,!0,!0,t).then(()=>{})}),ht.getState().set(c=>{c.openModelsMap=!1}),H.getState().loggable&&n(c=>{c.actionInfo={name:"Open Example: "+a,timestamp:new Date().getTime()}}),t||window.history.pushState({},document.title,t1))};return[{key:"solar-energy-science",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.solarEnergyScienceSubMenu",e)}),children:[{key:"sun_angles",label:"menu.solarEnergyScienceTutorials.SunAngles"},{key:"insolation_and_climate",label:"menu.solarEnergyScienceTutorials.InsolationAndClimate"},{key:"solar_radiation_to_box",label:"menu.solarEnergyScienceTutorials.SolarRadiationToBox"},{key:"sun_beam_at_center",label:"menu.solarEnergyExamples.SunBeamAndHeliodon"}].map(E4)},{key:"building-science",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.buildingScienceSubMenu",e)}),children:[{key:"thermal_vs_building_envelope",label:"menu.buildingScienceTutorials.ThermalEnvelopeVsBuildingEnvelope"},{key:"effect_house_size",label:"menu.buildingScienceTutorials.EffectOfSizeOnBuildingEnergy"},{key:"effect_house_orientation",label:"menu.buildingScienceTutorials.EffectOfOrientationOnBuildingEnergy"},{key:"effect_wall_roof_insulation",label:"menu.buildingScienceTutorials.EffectOfInsulationOnBuildingEnergy"},{key:"effect_roof_color",label:"menu.buildingScienceTutorials.EffectOfRoofColorOnBuildingEnergy"},{key:"effect_eaves_overhang_length",label:"menu.buildingScienceTutorials.EffectOfEavesOverhangLengthOnBuildingEnergy"},{key:"effect_window_shgc",label:"menu.buildingScienceTutorials.EffectOfWindowSHGCOnBuildingEnergy"},{key:"effect_thermostat_setpoint",label:"menu.buildingScienceTutorials.EffectOfThermostatSetpointOnBuildingEnergy"},{key:"effect_solar_panels",label:"menu.buildingScienceTutorials.EffectOfSolarPanelsOnBuildingEnergy"},{key:"effect_ground_temperature",label:"menu.buildingScienceTutorials.EffectOfGroundTemperatureOnBuildingEnergy"},{key:"effect_trees",label:"menu.buildingScienceTutorials.EffectOfTreesOnBuildingEnergy"}].map(E4)},{key:"building-design",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.buildingDesignSubMenu",e)}),children:[{key:"cape_cod_with_shed_dormer",label:"menu.buildingDesignTutorials.CapeCodStyleHouseWithShedDormer"},{key:"mansard_roof_with_dormers",label:"menu.buildingDesignTutorials.MansardRoofWithDormers"},{key:"gable_roof_vs_hip_roof",label:"menu.buildingDesignTutorials.GableRoofVsHipRoof"},{key:"colonial_vs_saltbox",label:"menu.buildingDesignTutorials.ColonialVsSaltbox"},{key:"gambrel_roof_vs_mansard_roof",label:"menu.buildingDesignTutorials.GambrelRoofVsMansardRoof"},{key:"combination_roof_vs_bonnet_roof",label:"menu.buildingDesignTutorials.CombinationRoofVsBonnetRoof"},{key:"dutch_gable_roof",label:"menu.buildingDesignTutorials.DutchGableRoof"},{key:"gable_and_valley_roof",label:"menu.buildingDesignTutorials.GableAndValleyRoof"},{key:"clerestory_roof",label:"menu.buildingDesignTutorials.ClerestoryRoof"},{key:"monitor_roof",label:"menu.buildingDesignTutorials.MonitorRoof"},{key:"a_frame_house",label:"menu.buildingDesignTutorials.AFrameHouse"},{key:"half_timbered_house",label:"menu.buildingDesignTutorials.HalfTimberedHouse"},{key:"all_roof_types",label:"menu.buildingDesignTutorials.AllBasicRoofTypes"}].map(E4)},{key:"photovoltaic-solar-power",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.photovoltaicSolarPowerSubMenu",e)}),children:[{key:"effect_tilt_angle_solar_panel",label:"menu.photovoltaicSolarPowerTutorials.EffectOfTiltAngleOfSolarPanel"},{key:"effect_azimuth_solar_panel",label:"menu.photovoltaicSolarPowerTutorials.EffectOfAzimuthOfSolarPanel"},{key:"solar_panel_types",label:"menu.photovoltaicSolarPowerTutorials.SolarPanelTypes"},{key:"vertical_bifacial_solar_panels",label:"menu.photovoltaicSolarPowerTutorials.VerticalBifacialSolarPanels"},{key:"compare_monofacial_bifacial_solar_panels",label:"menu.photovoltaicSolarPowerTutorials.CompareMonofacialAndBifacialSolarPanels"},{key:"solar_trackers",label:"menu.photovoltaicSolarPowerTutorials.SolarTrackers"},{key:"why_solar_array",label:"menu.photovoltaicSolarPowerTutorials.CoveringGroundWithSolarPanels"},{key:"inter_row_spacing",label:"menu.photovoltaicSolarPowerTutorials.InterRowSpacingOfSolarPanelArray"},{key:"effect_orientation_solar_panel",label:"menu.photovoltaicSolarPowerTutorials.EffectOfOrientationOfSolarPanels"},{key:"solar_panel_array_auto_layout",label:"menu.photovoltaicSolarPowerTutorials.SolarPanelArrayAutomaticLayout"},{key:"rooftop_solar_panels",label:"menu.solarEnergyExamples.RooftopSolarPanels"},{key:"solar_canopy_form_factors",label:"menu.solarEnergyExamples.SolarCanopyFormFactors"},{key:"bipv_01",label:"menu.solarEnergyExamples.BuildingIntegratedPhotovoltaics"}].map(E4)},{key:"concentrated-solar-power",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.concentratedSolarPowerSubMenu",e)}),children:[{key:"parabolic_dish_focus_sunlight",label:"menu.concentratedSolarPowerTutorials.FocusSunlightWithParabolicDish"},{key:"effect_azimuth_parabolic_trough",label:"menu.concentratedSolarPowerTutorials.EffectOfAzimuthOfParabolicTrough"},{key:"effect_latus_rectum_parabolic_trough",label:"menu.concentratedSolarPowerTutorials.EffectOfLatusRectumOfParabolicTrough"},{key:"linear_fresnel_reflectors",label:"menu.concentratedSolarPowerTutorials.LinearFresnelReflectors"},{key:"effect_absorber_pipe_height",label:"menu.concentratedSolarPowerTutorials.EffectOfAbsorberPipeHeightForLinearFresnelReflectors"},{key:"effect_azimuth_fresnel_reflector",label:"menu.concentratedSolarPowerTutorials.EffectOfAzimuthOfLinearFresnelReflectors"},{key:"linear_fresnel_reflectors_two_absorbers",label:"menu.concentratedSolarPowerTutorials.LinearFresnelReflectorsWithTwoAbsorbers"},{key:"solar_power_tower",label:"menu.concentratedSolarPowerTutorials.SolarPowerTower"},{key:"cosine_efficiency_heliostats",label:"menu.concentratedSolarPowerTutorials.CosineEfficiencyOfHeliostats"},{key:"shadowing_blocking_heliostats",label:"menu.concentratedSolarPowerTutorials.ShadowingAndBlockingOfHeliostats"},{key:"effect_solar_power_tower_height",label:"menu.concentratedSolarPowerTutorials.EffectSolarPowerTowerHeight"}].map(E4)},{key:"other-types-of-solar-power",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.otherTypesOfSolarPowerSubMenu",e)}),children:[{key:"solar_updraft_tower",label:"menu.otherTypesOfSolarPowerTutorials.SolarUpdraftTower"}].map(E4)},{key:"wind-power",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.windPowerSubMenu",e)}),children:[{key:"effect_blade_number",label:"menu.windPowerTutorials.EffectOfBladeNumberOfWindTurbine"},{key:"effect_pitch_angle",label:"menu.windPowerTutorials.EffectOfPitchAngleOfWindTurbineBlades"},{key:"bird_safe_blade_design",label:"menu.windPowerTutorials.BirdSafeBladeDesign"},{key:"offshore_wind_farm",label:"menu.windPowerTutorials.OffshoreWindFarm"}].map(E4)},{key:"colocation",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.colocationSubMenu",e)}),children:[{key:"agriculture_solar_wind_colocation",label:"menu.colocationTutorials.AgricultureSolarWindColocation"}].map(E4)},{key:"generative-design",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.generativeDesignSubMenu",e)}),children:[{key:"Tilt Angle",label:h.jsx(rn,{noPadding:!0,onClick:()=>r("Tilt Angle",48),children:Y.t("menu.generativeDesignTutorials.MonofacialSolarPanelArrayTiltAngle",e)})},{key:"Bifacial Tilt Angle",label:h.jsx(rn,{noPadding:!0,onClick:()=>r("Bifacial Tilt Angle",50),children:Y.t("menu.generativeDesignTutorials.BifacialSolarPanelArrayTiltAngle",e)})},{key:"Latitude",label:h.jsx(rn,{noPadding:!0,onClick:()=>r("Latitude",0),children:Y.t("menu.generativeDesignTutorials.OutputOfSolarPanelArrayInDifferentPlaces",e)})},{key:"Pareto Front",label:h.jsx(rn,{noPadding:!0,onClick:()=>r("Pareto Front",0),children:Y.t("menu.generativeDesignTutorials.SimpleSolarFarmParetoFront",e)})}]}]},J5=({key:t,label:e})=>({key:t,label:h.jsx(rn,{noPadding:!0,children:Y.t(e,{lng:H.getState().language})})}),NVn=()=>{const t={lng:H.getState().language};return[{key:"solar-energy",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.solarEnergySubMenu",t)}),children:[{key:"photovoltaic-solar-power-examples",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.photovoltaicSolarPowerSubMenu",t)}),children:[{key:"vegetative_buffer_01",label:"menu.solarEnergyExamples.VegetativeBuffer"},{key:"solar_canopy_over_bleachers",label:"menu.solarEnergyExamples.SolarCanopyOverBleachers"},{key:"solar_canopy_over_garage",label:"menu.solarEnergyExamples.SolarCanopyOverGarage"},{key:"solar_bus_stop",label:"menu.solarEnergyExamples.SolarBusStop"},{key:"solar_facade_tesla",label:"menu.solarEnergyExamples.SolarFacadeTesla"},{key:"floatovoltaics",label:"menu.solarEnergyExamples.Floatovoltaics"},{key:"rainbow_swash_solar_farm",label:"menu.solarEnergyExamples.RainbowSwashSolarFarmBostonMA"},{key:"mickey_mouse_solar_farm",label:"menu.solarEnergyExamples.MickeyMouseSolarFarmOrlandoFL"},{key:"solar_panels_over_canal",label:"menu.solarEnergyExamples.SolarPanelsOverCanalBakersfieldCA"},{key:"solar_noise_barrier",label:"menu.solarEnergyExamples.SolarNoiseBarrierLexingtonMA"},{key:"solar_farm_hsat_array",label:"menu.solarEnergyExamples.HSATSolarTrackersRaleighNC"},{key:"solar_farm_aadat_array",label:"menu.solarEnergyExamples.AADATSolarTrackersLancasterCA"}].map(J5)},{key:"concentrated-solar-power-examples",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.concentratedSolarPowerSubMenu",t)}),children:[{key:"nevada_solar_one_parabolic_troughs",label:"menu.solarEnergyExamples.NevadaSolarOneParabolicTroughArray"},{key:"tooele_parabolic_dish_array",label:"menu.solarEnergyExamples.TooeleParabolicDishArray"},{key:"tucson_sundt_station",label:"menu.solarEnergyExamples.TucsonLinearFresnelReflectors"},{key:"ps10_solar_power_tower",label:"menu.solarEnergyExamples.PS10SolarPowerTower"}].map(J5)},{key:"other-types-of-solar-power-examples",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.otherTypesOfSolarPowerSubMenu",t)}),children:[{key:"solar_updraft_tower_city",label:"menu.solarEnergyExamples.SolarUpdraftTowerInCity"}].map(J5)}]},{key:"built-environment",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.builtEnvironmentSubMenu",t)}),children:[{key:"residential_buildings",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.residentialBuildingsSubMenu",t)}),children:[{key:"colonial_house",label:"menu.residentialBuildingExamples.ColonialHouse"},{key:"dutch_colonial_house",label:"menu.residentialBuildingExamples.DutchColonialHouse"},{key:"t_shaped_house",label:"menu.residentialBuildingExamples.TShapedHouse"},{key:"cape_cod_with_garage",label:"menu.residentialBuildingExamples.CapeCodHouseWithGarage"},{key:"solarium",label:"menu.residentialBuildingExamples.Solarium"},{key:"butterfly_roof_house",label:"menu.residentialBuildingExamples.ButterflyRoofHouse"},{key:"adobe_taos_house",label:"menu.residentialBuildingExamples.AdobeTaosHouse"},{key:"ranch_house",label:"menu.residentialBuildingExamples.RanchHouse"},{key:"bonnet_house",label:"menu.residentialBuildingExamples.BonnetHouse"},{key:"barn_house",label:"menu.residentialBuildingExamples.BarnStyleHouse"},{key:"modern_house_01",label:"menu.residentialBuildingExamples.ModernHouse"}].map(J5)},{key:"commercial_buildings",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.commercialBuildingsSubMenu",t)}),children:[{key:"white_house",label:"menu.commercialBuildingExamples.WhiteHouse"},{key:"harold_washington_college",label:"menu.commercialBuildingExamples.HaroldWashingtonCollege"},{key:"bilim_mersin_turkiye",label:"menu.commercialBuildingExamples.BilimMersinTurkiye"},{key:"spanish_style_hotel",label:"menu.commercialBuildingExamples.SpanishStyleHotel"},{key:"apartment_building_01",label:"menu.commercialBuildingExamples.ApartmentBuilding"},{key:"office_building_01",label:"menu.commercialBuildingExamples.OfficeBuilding"},{key:"hotel_01",label:"menu.commercialBuildingExamples.Hotel"}].map(J5)},{key:"other_buildings",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.otherBuildingsSubMenu",t)}),children:[{key:"greenhouse",label:"menu.otherBuildingExamples.Greenhouse"},{key:"church_01",label:"menu.residentialBuildingExamples.Church1"},{key:"cathedral_01",label:"menu.residentialBuildingExamples.Cathedral1"},{key:"cathedral_02",label:"menu.residentialBuildingExamples.Cathedral2"},{key:"mosque_01",label:"menu.residentialBuildingExamples.Mosque1"},{key:"pavilion",label:"menu.otherBuildingExamples.Pavilion"},{key:"octagonal_pagoda",label:"menu.otherBuildingExamples.OctagonalPagoda"},{key:"ocean_front",label:"menu.otherBuildingExamples.OceanFront"},{key:"egyptian_pyramids",label:"menu.otherBuildingExamples.EgyptianPyramids"},{key:"mayan_pyramid",label:"menu.otherBuildingExamples.MayanPyramid"},{key:"si_o_se_pol",label:"menu.otherBuildingExamples.SiOSePol"},{key:"stacked_cuboids",label:"menu.otherBuildingExamples.StackedCuboids"}].map(J5)},{key:"building_complexes",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.buildingComplexesSubMenu",t)}),children:[{key:"south_burlington_high_school",label:"menu.buildingComplexExamples.SouthBurlingtonHighSchoolVermont"},{key:"mescalero_apache_school",label:"menu.buildingComplexExamples.MescaleroApacheSchoolNewMexico"}].map(J5)},{key:"urban_planning",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.urbanPlanningSubMenu",t)}),children:[{key:"city_block_heatmap",label:"menu.urbanPlanningExamples.CityBlockHeatmap"},{key:"chicago_skyline",label:"menu.urbanPlanningExamples.ChicagoSkyline"}].map(J5)}]},{key:"artificial-intelligence",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.artificialIntelligenceSubMenu",t)}),children:[{key:"ai_tilt_angle_one_row",label:"menu.artificialIntelligenceExamples.OptimizingTiltAngleOfOneSolarPanelRow"},{key:"ai_tilt_angles_multiple_rows",label:"menu.artificialIntelligenceExamples.OptimizingTiltAnglesOfMultipleSolarPanelRows"},{key:"ai_solar_farm_design",label:"menu.artificialIntelligenceExamples.SolarFarmGenerativeDesign"},{key:"ai_solar_farm_design_block",label:"menu.artificialIntelligenceExamples.SolarFarmGenerativeDesignWithBlock"},{key:"ai_fitchburg_solar_farm",label:"menu.artificialIntelligenceExamples.FitchburgSolarFarmGenerativeDesign"}].map(J5)},{key:"benchmarks",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.benchmarksSubMenu",t)}),children:[{key:"solar_radiation_predicted_vs_measured",label:"menu.benchmarks.SolarRadiationPredictionVsMeasurement"},{key:"bestest_case_600",label:"menu.benchmarks.BESTESTCase600"},{key:"bestest_case_610",label:"menu.benchmarks.BESTESTCase610"},{key:"bestest_case_620",label:"menu.benchmarks.BESTESTCase620"},{key:"bestest_case_630",label:"menu.benchmarks.BESTESTCase630"}].map(J5)}]},UVn=Ro.div` + */var vVn="storage";function xVn(t,e){var n=e.instanceIdentifier,o=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal"),i=t.getProvider("app-check-internal"),a=new yVn(o,new GZ(o,r,i,new m_n,n,$n.SDK_VERSION));return a}function bVn(t){var e={TaskState:qh,TaskEvent:h_n,StringFormat:Bm,Storage:GZ,Reference:Fk};t.INTERNAL.registerComponent(new Ob(vVn,xVn,"PUBLIC").setServiceProps(e).setMultipleInstances(!0)),t.registerVersion(AVn,wVn)}bVn($n);const Pae=async(t,e,n)=>{try{return(await $n.firestore().collection("users").doc(t).collection("projects").doc(e).get()).exists}catch(o){n(o)}},Ynt=async(t,e,n)=>{const o={lng:H.getState().language};await $n.firestore().collection("users").doc(t).collection("projects").doc(e).get().then(r=>{const i=r.data();i?n({owner:t,title:r.id,timestamp:i.timestamp,description:i.description,dataColoring:i.dataColoring??d9.ALL,type:i.type,designs:i.designs,ranges:i.ranges??[],filters:i.filters??[],hiddenParameters:i.hiddenParameters,counter:i.counter??0,selectedProperty:i.selectedProperty,sortDescending:i.sortDescending,xAxisNameScatterPlot:i.xAxisNameScatterPlot,yAxisNameScatterPlot:i.yAxisNameScatterPlot,dotSizeScatterPlot:i.dotSizeScatterPlot,thumbnailWidth:i.thumbnailWidth}):po(Y.t("message.CannotOpenProject",o)+": "+e)}).catch(r=>{po(Y.t("message.CannotOpenProject",o)+": "+r)})},SVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({designs:$n.firestore.FieldValue.arrayRemove(n)}).then(()=>{ht.getState().set(r=>{r.updateProjectsFlag=!0}),$n.firestore().collection("users").doc(t).collection("designs").doc(n.title).delete().then(()=>{H.getState().set(r=>{n.title===r.cloudFile&&(r.cloudFile=void 0)}),hn(Y.t("message.DesignRemovedFromProject",o)+".")}).catch(r=>{po(Y.t("message.CannotDeleteCloudFile",o)+": "+r)})})}catch(r){po(Y.t("message.CannotRemoveDesignFromProject",o)+": "+r)}},TVn=async(t,e,n,o)=>{const r={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({hiddenParameters:o?$n.firestore.FieldValue.arrayUnion(n):$n.firestore.FieldValue.arrayRemove(n)})}catch(i){po(Y.t("message.CannotUpdateProject",r)+": "+i)}},kO=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({ranges:$n.firestore.FieldValue.arrayUnion(n)})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},WCe=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({ranges:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},PVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({description:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},CVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({dataColoring:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},RVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({selectedProperty:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},HVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({xAxisNameScatterPlot:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},MVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({yAxisNameScatterPlot:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},IVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({dotSizeScatterPlot:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},zVn=async(t,e,n)=>{const o={lng:H.getState().language};try{await $n.firestore().collection("users").doc(t).collection("projects").doc(e).update({thumbnailWidth:n})}catch(r){po(Y.t("message.CannotUpdateProject",o)+": "+r)}},Ont=(t,e,n)=>{let o={timestamp:Date.now(),title:e,thumbnail:n,excluded:!1};switch(t){case Pi.SOLAR_PANEL_ARRAY:{const r=H.getState().world.latitude,i=me.countAllSolarPanels(),a=me.countAllSolarPanelDailyYields(),l=me.countAllSolarPanelYearlyYields(),s=H.getState().economicsParams,c=s.operationalCostPerUnit,u=s.electricitySellingPrice;o={latitude:r,unitCost:c,sellingPrice:u,panelCount:i,dailyYield:a,yearlyYield:l,...o,...H.getState().solarPanelArrayLayoutParams};break}case Pi.SOLAR_PANEL_TILT_ANGLE:break}return o},NCe=(t,e)=>{if(!e)return null;const n=[];for(const o of e){const r={...o};r.title=DVn(t,o.title),r.timestamp=Date.now(),n.push(r)}return n},DVn=(t,e)=>{const n=e.lastIndexOf(" ");return t+e.substring(n)},EVn=t=>{const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");return n&&n.drawImage(t,1,1),e.toDataURL()},UCe=(t,e,n,o)=>{const r={lng:H.getState().language};$n.firestore().collection("users").doc(n??o).collection("designs").doc(t).get().then(i=>{if(i.exists){const a=i.data();a&&$n.firestore().collection("users").doc(o).collection("designs").doc(e).set(a).then(()=>{hn(Y.t("message.CloudFileCopied",r)+": "+e)}).catch(l=>{po(Y.t("message.CannotWriteCloudFile",r)+": "+l)})}else po(Y.t("message.CannotReadCloudFile",r))}).catch(i=>{po(Y.t("message.CannotReadCloudFile",r)+": "+i)})},FVn=(t,e,n)=>{const o={lng:H.getState().language};$n.firestore().collection("users").doc(t).collection("projects").doc(e).get().then(r=>{if(r.exists){const i=r.data();if(i){const a=[];a.push(...i.designs);let l=-1;for(const[s,c]of a.entries())if(c.title===n.title){l=s;break}l>=0&&(a[l].invisible=!n.invisible,$n.firestore().collection("users").doc(t).collection("projects").doc(e).update({designs:a}).then(()=>{}).catch(s=>{po(Y.t("message.CannotUpdateProject",o)+": "+s)}))}}}).catch(r=>{po(Y.t("message.CannotFetchProjectData",o)+": "+r)}).finally(()=>{})},kVn=async(t,e,n,o,r,i)=>{const a={lng:H.getState().language};if(ht.getState().set(l=>{l.waiting=!0}),await $n.firestore().collection("users").doc(t).collection("designs").doc(r).set(H.getState().exportContent()),ht.getState().setChanged(!1),i){const l=me.resizeCanvas(i,o).toDataURL();$n.firestore().collection("users").doc(t).collection("projects").doc(n).get().then(s=>{if(s.exists){const c=s.data();if(c){const u=[];u.push(...c.designs);let d=-1;for(const[f,p]of u.entries())if(p.title===r){d=f;break}d>=0&&(u[d]=Ont(e,r,l),$n.firestore().collection("users").doc(t).collection("projects").doc(n).update({designs:u}).then(()=>{}).catch(f=>{po(Y.t("message.CannotUpdateProject",a)+": "+f)}).finally(()=>{H.getState().set(f=>{f.projectState.designs=u}),ht.getState().set(f=>{f.updateProjectsFlag=!0,f.waiting=!1})}))}}}).catch(s=>{po(Y.t("message.CannotFetchProjectData",a)+": "+s)}).finally(()=>{})}},jCe=async(t,e,n)=>{try{return(await $n.firestore().collection("users").doc(t).collection("files").doc(e).get()).exists}catch(o){n(o)}},LVn=async(t,e)=>{await $n.firestore().collection("users").doc(t).get().then(n=>{const o=n.data();return o?(o.fileList&&e.push(...o.fileList),!0):!1})},BCe=async(t,e)=>{await $n.firestore().collection("users").doc(t).update({fileList:$n.firestore.FieldValue.arrayUnion(e)}).then(()=>{}).catch(n=>{console.log(n)})},YCe=async(t,e)=>{await $n.firestore().collection("users").doc(t).update({fileList:$n.firestore.FieldValue.arrayRemove(e)}).then(()=>{}).catch(n=>{console.log(n)})},JX=async(t,e,n,o,r)=>{const i={lng:H.getState().language};H.getState().undoManager.clear(),ht.getState().set(a=>{a.waiting=!0});try{const l=(await $n.firestore().collection("users").doc(t).collection(n?"designs":"files").doc(e).get()).data();if(l?H.getState().importContent(l,e):(hn(Y.t("message.CloudFileNotFound",i)+": "+e),H.getState().set(s=>{s.cloudFile=void 0}),ht.getState().set(s=>{s.waiting=!1})),!o&&!r){const s=t1+"?client=web&userid="+t+"&title="+encodeURIComponent(e);window.history.pushState({},document.title,s)}}catch(a){po(Y.t("message.CannotOpenCloudFile",i)+": "+a),ht.getState().set(l=>{l.waiting=!1})}},E4=({key:t,label:e})=>({key:t,label:h.jsx(rn,{noPadding:!0,children:Y.t(e,{lng:H.getState().language})})}),WVn=t=>{const e={lng:H.getState().language},n=H.getState().set,o=a=>{n(l=>{l.projectState={...a},l.projectImages.clear(),l.projectView=!0}),ht.getState().set(l=>{l.projectImagesUpdateFlag=!l.projectImagesUpdateFlag,l.updateProjectsFlag=!0})},r=(a,l)=>{const s="QWecNcxhyvP6j6sBN11hBsfZDau1";a&&s&&(Ynt(s,a,o).then(()=>{JX(s,a+" "+l,!0,!0,t).then(()=>{})}),ht.getState().set(c=>{c.openModelsMap=!1}),H.getState().loggable&&n(c=>{c.actionInfo={name:"Open Example: "+a,timestamp:new Date().getTime()}}),t||window.history.pushState({},document.title,t1))};return[{key:"solar-energy-science",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.solarEnergyScienceSubMenu",e)}),children:[{key:"sun_angles",label:"menu.solarEnergyScienceTutorials.SunAngles"},{key:"insolation_and_climate",label:"menu.solarEnergyScienceTutorials.InsolationAndClimate"},{key:"solar_radiation_to_box",label:"menu.solarEnergyScienceTutorials.SolarRadiationToBox"},{key:"sun_beam_at_center",label:"menu.solarEnergyExamples.SunBeamAndHeliodon"}].map(E4)},{key:"building-science",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.buildingScienceSubMenu",e)}),children:[{key:"thermal_vs_building_envelope",label:"menu.buildingScienceTutorials.ThermalEnvelopeVsBuildingEnvelope"},{key:"effect_house_size",label:"menu.buildingScienceTutorials.EffectOfSizeOnBuildingEnergy"},{key:"effect_house_orientation",label:"menu.buildingScienceTutorials.EffectOfOrientationOnBuildingEnergy"},{key:"effect_wall_roof_insulation",label:"menu.buildingScienceTutorials.EffectOfInsulationOnBuildingEnergy"},{key:"effect_roof_color",label:"menu.buildingScienceTutorials.EffectOfRoofColorOnBuildingEnergy"},{key:"effect_eaves_overhang_length",label:"menu.buildingScienceTutorials.EffectOfEavesOverhangLengthOnBuildingEnergy"},{key:"effect_window_shgc",label:"menu.buildingScienceTutorials.EffectOfWindowSHGCOnBuildingEnergy"},{key:"effect_thermostat_setpoint",label:"menu.buildingScienceTutorials.EffectOfThermostatSetpointOnBuildingEnergy"},{key:"effect_solar_panels",label:"menu.buildingScienceTutorials.EffectOfSolarPanelsOnBuildingEnergy"},{key:"effect_ground_temperature",label:"menu.buildingScienceTutorials.EffectOfGroundTemperatureOnBuildingEnergy"},{key:"effect_trees",label:"menu.buildingScienceTutorials.EffectOfTreesOnBuildingEnergy"}].map(E4)},{key:"building-design",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.buildingDesignSubMenu",e)}),children:[{key:"cape_cod_with_shed_dormer",label:"menu.buildingDesignTutorials.CapeCodStyleHouseWithShedDormer"},{key:"mansard_roof_with_dormers",label:"menu.buildingDesignTutorials.MansardRoofWithDormers"},{key:"gable_roof_vs_hip_roof",label:"menu.buildingDesignTutorials.GableRoofVsHipRoof"},{key:"colonial_vs_saltbox",label:"menu.buildingDesignTutorials.ColonialVsSaltbox"},{key:"gambrel_roof_vs_mansard_roof",label:"menu.buildingDesignTutorials.GambrelRoofVsMansardRoof"},{key:"combination_roof_vs_bonnet_roof",label:"menu.buildingDesignTutorials.CombinationRoofVsBonnetRoof"},{key:"dutch_gable_roof",label:"menu.buildingDesignTutorials.DutchGableRoof"},{key:"gable_and_valley_roof",label:"menu.buildingDesignTutorials.GableAndValleyRoof"},{key:"clerestory_roof",label:"menu.buildingDesignTutorials.ClerestoryRoof"},{key:"monitor_roof",label:"menu.buildingDesignTutorials.MonitorRoof"},{key:"a_frame_house",label:"menu.buildingDesignTutorials.AFrameHouse"},{key:"half_timbered_house",label:"menu.buildingDesignTutorials.HalfTimberedHouse"},{key:"all_roof_types",label:"menu.buildingDesignTutorials.AllBasicRoofTypes"}].map(E4)},{key:"photovoltaic-solar-power",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.photovoltaicSolarPowerSubMenu",e)}),children:[{key:"effect_tilt_angle_solar_panel",label:"menu.photovoltaicSolarPowerTutorials.EffectOfTiltAngleOfSolarPanel"},{key:"effect_azimuth_solar_panel",label:"menu.photovoltaicSolarPowerTutorials.EffectOfAzimuthOfSolarPanel"},{key:"solar_panel_types",label:"menu.photovoltaicSolarPowerTutorials.SolarPanelTypes"},{key:"vertical_bifacial_solar_panels",label:"menu.photovoltaicSolarPowerTutorials.VerticalBifacialSolarPanels"},{key:"compare_monofacial_bifacial_solar_panels",label:"menu.photovoltaicSolarPowerTutorials.CompareMonofacialAndBifacialSolarPanels"},{key:"solar_trackers",label:"menu.photovoltaicSolarPowerTutorials.SolarTrackers"},{key:"why_solar_array",label:"menu.photovoltaicSolarPowerTutorials.CoveringGroundWithSolarPanels"},{key:"inter_row_spacing",label:"menu.photovoltaicSolarPowerTutorials.InterRowSpacingOfSolarPanelArray"},{key:"effect_orientation_solar_panel",label:"menu.photovoltaicSolarPowerTutorials.EffectOfOrientationOfSolarPanels"},{key:"solar_panel_array_auto_layout",label:"menu.photovoltaicSolarPowerTutorials.SolarPanelArrayAutomaticLayout"},{key:"rooftop_solar_panels",label:"menu.solarEnergyExamples.RooftopSolarPanels"},{key:"solar_canopy_form_factors",label:"menu.solarEnergyExamples.SolarCanopyFormFactors"},{key:"bipv_01",label:"menu.solarEnergyExamples.BuildingIntegratedPhotovoltaics"}].map(E4)},{key:"concentrated-solar-power",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.concentratedSolarPowerSubMenu",e)}),children:[{key:"parabolic_dish_focus_sunlight",label:"menu.concentratedSolarPowerTutorials.FocusSunlightWithParabolicDish"},{key:"effect_azimuth_parabolic_trough",label:"menu.concentratedSolarPowerTutorials.EffectOfAzimuthOfParabolicTrough"},{key:"effect_latus_rectum_parabolic_trough",label:"menu.concentratedSolarPowerTutorials.EffectOfLatusRectumOfParabolicTrough"},{key:"linear_fresnel_reflectors",label:"menu.concentratedSolarPowerTutorials.LinearFresnelReflectors"},{key:"effect_absorber_pipe_height",label:"menu.concentratedSolarPowerTutorials.EffectOfAbsorberPipeHeightForLinearFresnelReflectors"},{key:"effect_azimuth_fresnel_reflector",label:"menu.concentratedSolarPowerTutorials.EffectOfAzimuthOfLinearFresnelReflectors"},{key:"linear_fresnel_reflectors_two_absorbers",label:"menu.concentratedSolarPowerTutorials.LinearFresnelReflectorsWithTwoAbsorbers"},{key:"solar_power_tower",label:"menu.concentratedSolarPowerTutorials.SolarPowerTower"},{key:"cosine_efficiency_heliostats",label:"menu.concentratedSolarPowerTutorials.CosineEfficiencyOfHeliostats"},{key:"shadowing_blocking_heliostats",label:"menu.concentratedSolarPowerTutorials.ShadowingAndBlockingOfHeliostats"},{key:"effect_solar_power_tower_height",label:"menu.concentratedSolarPowerTutorials.EffectSolarPowerTowerHeight"}].map(E4)},{key:"other-types-of-solar-power",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.otherTypesOfSolarPowerSubMenu",e)}),children:[{key:"solar_updraft_tower",label:"menu.otherTypesOfSolarPowerTutorials.SolarUpdraftTower"}].map(E4)},{key:"wind-power",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.windPowerSubMenu",e)}),children:[{key:"effect_blade_number",label:"menu.windPowerTutorials.EffectOfBladeNumberOfWindTurbine"},{key:"effect_pitch_angle",label:"menu.windPowerTutorials.EffectOfPitchAngleOfWindTurbineBlades"},{key:"bird_safe_blade_design",label:"menu.windPowerTutorials.BirdSafeBladeDesign"},{key:"offshore_wind_farm",label:"menu.windPowerTutorials.OffshoreWindFarm"}].map(E4)},{key:"colocation",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.colocationSubMenu",e)}),children:[{key:"agriculture_solar_wind_colocation",label:"menu.colocationTutorials.AgricultureSolarWindColocation"}].map(E4)},{key:"generative-design",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.generativeDesignSubMenu",e)}),children:[{key:"Tilt Angle",label:h.jsx(rn,{noPadding:!0,onClick:()=>r("Tilt Angle",48),children:Y.t("menu.generativeDesignTutorials.MonofacialSolarPanelArrayTiltAngle",e)})},{key:"Bifacial Tilt Angle",label:h.jsx(rn,{noPadding:!0,onClick:()=>r("Bifacial Tilt Angle",50),children:Y.t("menu.generativeDesignTutorials.BifacialSolarPanelArrayTiltAngle",e)})},{key:"Latitude",label:h.jsx(rn,{noPadding:!0,onClick:()=>r("Latitude",0),children:Y.t("menu.generativeDesignTutorials.OutputOfSolarPanelArrayInDifferentPlaces",e)})},{key:"Pareto Front",label:h.jsx(rn,{noPadding:!0,onClick:()=>r("Pareto Front",0),children:Y.t("menu.generativeDesignTutorials.SimpleSolarFarmParetoFront",e)})}]}]},J5=({key:t,label:e})=>({key:t,label:h.jsx(rn,{noPadding:!0,children:Y.t(e,{lng:H.getState().language})})}),NVn=()=>{const t={lng:H.getState().language};return[{key:"solar-energy",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.solarEnergySubMenu",t)}),children:[{key:"photovoltaic-solar-power-examples",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.photovoltaicSolarPowerSubMenu",t)}),children:[{key:"vegetative_buffer_01",label:"menu.solarEnergyExamples.VegetativeBuffer"},{key:"solar_canopy_over_bleachers",label:"menu.solarEnergyExamples.SolarCanopyOverBleachers"},{key:"solar_canopy_over_garage",label:"menu.solarEnergyExamples.SolarCanopyOverGarage"},{key:"solar_bus_stop",label:"menu.solarEnergyExamples.SolarBusStop"},{key:"solar_facade_tesla",label:"menu.solarEnergyExamples.SolarFacadeTesla"},{key:"floatovoltaics",label:"menu.solarEnergyExamples.Floatovoltaics"},{key:"rainbow_swash_solar_farm",label:"menu.solarEnergyExamples.RainbowSwashSolarFarmBostonMA"},{key:"mickey_mouse_solar_farm",label:"menu.solarEnergyExamples.MickeyMouseSolarFarmOrlandoFL"},{key:"solar_panels_over_canal",label:"menu.solarEnergyExamples.SolarPanelsOverCanalBakersfieldCA"},{key:"solar_noise_barrier",label:"menu.solarEnergyExamples.SolarNoiseBarrierLexingtonMA"},{key:"solar_farm_hsat_array",label:"menu.solarEnergyExamples.HSATSolarTrackersRaleighNC"},{key:"solar_farm_aadat_array",label:"menu.solarEnergyExamples.AADATSolarTrackersLancasterCA"}].map(J5)},{key:"concentrated-solar-power-examples",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.concentratedSolarPowerSubMenu",t)}),children:[{key:"nevada_solar_one_parabolic_troughs",label:"menu.solarEnergyExamples.NevadaSolarOneParabolicTroughArray"},{key:"tooele_parabolic_dish_array",label:"menu.solarEnergyExamples.TooeleParabolicDishArray"},{key:"tucson_sundt_station",label:"menu.solarEnergyExamples.TucsonLinearFresnelReflectors"},{key:"ps10_solar_power_tower",label:"menu.solarEnergyExamples.PS10SolarPowerTower"}].map(J5)},{key:"other-types-of-solar-power-examples",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.otherTypesOfSolarPowerSubMenu",t)}),children:[{key:"solar_updraft_tower_city",label:"menu.solarEnergyExamples.SolarUpdraftTowerInCity"}].map(J5)}]},{key:"built-environment",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.builtEnvironmentSubMenu",t)}),children:[{key:"residential_buildings",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.residentialBuildingsSubMenu",t)}),children:[{key:"colonial_house",label:"menu.residentialBuildingExamples.ColonialHouse"},{key:"dutch_colonial_house",label:"menu.residentialBuildingExamples.DutchColonialHouse"},{key:"t_shaped_house",label:"menu.residentialBuildingExamples.TShapedHouse"},{key:"cape_cod_with_garage",label:"menu.residentialBuildingExamples.CapeCodHouseWithGarage"},{key:"solarium",label:"menu.residentialBuildingExamples.Solarium"},{key:"butterfly_roof_house",label:"menu.residentialBuildingExamples.ButterflyRoofHouse"},{key:"adobe_taos_house",label:"menu.residentialBuildingExamples.AdobeTaosHouse"},{key:"ranch_house",label:"menu.residentialBuildingExamples.RanchHouse"},{key:"bonnet_house",label:"menu.residentialBuildingExamples.BonnetHouse"},{key:"barn_house",label:"menu.residentialBuildingExamples.BarnStyleHouse"},{key:"modern_house_01",label:"menu.residentialBuildingExamples.ModernHouse"}].map(J5)},{key:"commercial_buildings",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.commercialBuildingsSubMenu",t)}),children:[{key:"white_house",label:"menu.commercialBuildingExamples.WhiteHouse"},{key:"harold_washington_college",label:"menu.commercialBuildingExamples.HaroldWashingtonCollege"},{key:"bilim_mersin_turkiye",label:"menu.commercialBuildingExamples.BilimMersinTurkiye"},{key:"spanish_style_hotel",label:"menu.commercialBuildingExamples.SpanishStyleHotel"},{key:"apartment_building_01",label:"menu.commercialBuildingExamples.ApartmentBuilding"},{key:"office_building_01",label:"menu.commercialBuildingExamples.OfficeBuilding"},{key:"hotel_01",label:"menu.commercialBuildingExamples.Hotel"}].map(J5)},{key:"other_buildings",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.otherBuildingsSubMenu",t)}),children:[{key:"greenhouse",label:"menu.otherBuildingExamples.Greenhouse"},{key:"church_01",label:"menu.residentialBuildingExamples.Church1"},{key:"cathedral_01",label:"menu.residentialBuildingExamples.Cathedral1"},{key:"cathedral_02",label:"menu.residentialBuildingExamples.Cathedral2"},{key:"mosque_01",label:"menu.residentialBuildingExamples.Mosque1"},{key:"pavilion",label:"menu.otherBuildingExamples.Pavilion"},{key:"octagonal_pagoda",label:"menu.otherBuildingExamples.OctagonalPagoda"},{key:"ocean_front",label:"menu.otherBuildingExamples.OceanFront"},{key:"egyptian_pyramids",label:"menu.otherBuildingExamples.EgyptianPyramids"},{key:"mayan_pyramid",label:"menu.otherBuildingExamples.MayanPyramid"},{key:"si_o_se_pol",label:"menu.otherBuildingExamples.SiOSePol"},{key:"stacked_cuboids",label:"menu.otherBuildingExamples.StackedCuboids"}].map(J5)},{key:"building_complexes",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.buildingComplexesSubMenu",t)}),children:[{key:"south_burlington_high_school",label:"menu.buildingComplexExamples.SouthBurlingtonHighSchoolVermont"},{key:"mescalero_apache_school",label:"menu.buildingComplexExamples.MescaleroApacheSchoolNewMexico"}].map(J5)},{key:"urban_planning",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.urbanPlanningSubMenu",t)}),children:[{key:"city_block_heatmap",label:"menu.urbanPlanningExamples.CityBlockHeatmap"},{key:"chicago_skyline",label:"menu.urbanPlanningExamples.ChicagoSkyline"}].map(J5)}]},{key:"artificial-intelligence",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.artificialIntelligenceSubMenu",t)}),children:[{key:"ai_tilt_angle_one_row",label:"menu.artificialIntelligenceExamples.OptimizingTiltAngleOfOneSolarPanelRow"},{key:"ai_tilt_angles_multiple_rows",label:"menu.artificialIntelligenceExamples.OptimizingTiltAnglesOfMultipleSolarPanelRows"},{key:"ai_solar_farm_design",label:"menu.artificialIntelligenceExamples.SolarFarmGenerativeDesign"},{key:"ai_solar_farm_design_block",label:"menu.artificialIntelligenceExamples.SolarFarmGenerativeDesignWithBlock"},{key:"ai_fitchburg_solar_farm",label:"menu.artificialIntelligenceExamples.FitchburgSolarFarmGenerativeDesign"}].map(J5)},{key:"benchmarks",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.benchmarksSubMenu",t)}),children:[{key:"solar_radiation_predicted_vs_measured",label:"menu.benchmarks.SolarRadiationPredictionVsMeasurement"},{key:"bestest_case_600",label:"menu.benchmarks.BESTESTCase600"},{key:"bestest_case_610",label:"menu.benchmarks.BESTESTCase610"},{key:"bestest_case_620",label:"menu.benchmarks.BESTESTCase620"},{key:"bestest_case_630",label:"menu.benchmarks.BESTESTCase630"}].map(J5)}]},UVn=Ro.div` width: 100px; `,jVn=Ro.img` position: absolute; @@ -6926,15 +6926,15 @@ Content-Type: `+c.contentType+`\r align-items: center; user-select: none; z-index: 9; -`,YCe="tutorials-submenu",OCe="examples-submenu",YVn=be.memo(({viewOnly:t,canvas:e})=>{const n=H(fn),o=H(Ige),r=ht(Bq),i=H.getState().loggable,a=H.getState().language,l=H.getState().undoManager,s=ht.getState().changed,c=H.getState().cloudFile,u=H.getState().user,d=H.getState().elementsToPaste,f=H.getState().selectedElement;ht(j=>j.contextMenuFlag);const[p,g]=m.useState(!1),[y,w]=m.useState(!1),b=j=>{j&&w(!y)},{t:C}=Vl(),P=m.useMemo(()=>({lng:a}),[a]),v=m.useMemo(()=>me.isMac(),[]),T=m.useMemo(()=>{const j=me.getOS();return j&&(j.includes("OS X")||j.includes("Chrome"))?"Ctrl+Alt+H":"Ctrl+Home"},[]),A=j=>{j.keyPath.find(L=>L===YCe||L===OCe)&&x(j.key)},x=j=>{const L=ULn(j);L&&(ht.getState().set(k=>{k.openModelsMap=!1}),!t&&s?Oi.confirm({title:C("message.DoYouWantToSaveChanges",P),icon:h.jsx(ny,{}),onOk:()=>S(L),onCancel:()=>{ht.getState().set(k=>{k.waiting=!0}),setTimeout(()=>{o(L)},10)},okText:C("word.Yes",P),cancelText:C("word.No",P)}):(ht.getState().set(k=>{k.waiting=!0}),setTimeout(()=>{o(L)},10)),i&&n(k=>{k.actionInfo={name:"Open Example: "+j,timestamp:new Date().getTime()}}),t||window.history.pushState({},document.title,t1))},S=j=>{c?(n(L=>{L.localContentToImportAfterCloudFileUpdate=j}),ht.getState().setSaveCloudFileFlag(!0)):u.uid?n(L=>{L.localContentToImportAfterCloudFileUpdate=j,L.showCloudFileTitleDialogFlag=!L.showCloudFileTitleDialogFlag,L.showCloudFileTitleDialog=!0}):hn(C("menu.file.ToSaveYourWorkPleaseSignIn",P))},R=()=>{g(!0)},M=()=>{g(!1)},D=d&&d.length>0,E=H.getState().countAllElementsByType(),W=[];return r||W.push({key:"file-sub-menu",label:h.jsx(rn,{noPadding:!0,children:C("menu.fileSubMenu",P)}),children:zWn(t,v,e)}),!r&&!t&&u.uid&&W.push({key:"project-sub-menu",label:h.jsx(rn,{noPadding:!0,children:C("menu.projectSubMenu",P)}),children:kWn()}),(f||D||l.hasUndo()||l.hasRedo())&&!r&&W.push({key:"edit-sub-menu",label:h.jsx(rn,{noPadding:!0,children:C("menu.editSubMenu",P)}),children:LWn(f,D,l,v)}),r||W.push({key:"view-sub-menu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.viewSubMenu",P)}),children:JNn(T,v)}),r||W.push({key:"settings-sub-menu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.settingsSubMenu",P)}),children:KNn()}),r||W.push({key:"accessories-sub-menu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.view.accessoriesSubMenu",P)}),children:qNn()}),!r&&E.gotSome()&&W.push({key:"analysis-sub-menu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.analysisSubMenu",P)}),children:aUn(E)}),W.push({key:YCe,label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.tutorialsSubMenu",P)}),children:WVn(t)}),W.push({key:OCe,label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.examplesSubMenu",P)}),children:NVn()}),W.push({key:"public-sub-menu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.publicSubMenu",P)}),children:XNn(u.uid,t,r)}),W.push({key:"language-sub-menu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.languageSubMenu",P)}),children:[{key:"language-radio-group",label:h.jsx(GNn,{}),style:{backgroundColor:"white"}}]}),W.push({key:"about-us-window",label:h.jsxs(rn,{noPadding:!0,onClick:R,children:[Y.t("menu.AboutUs",P),"..."]})}),h.jsxs(h.Fragment,{children:[h.jsx(jw,{menu:{items:W,onClick:A},trigger:["click"],onOpenChange:b,children:h.jsxs(UVn,{children:[h.jsx(jVn,{src:vnn,title:C("tooltip.clickToOpenMenu",P)}),h.jsx(BVn,{children:h.jsx("span",{style:{fontSize:"10px",alignContent:"center",cursor:"pointer"},children:C("menu.mainMenu",P)})})]})}),p&&h.jsx(Snn,{close:M})]})});var _nt={exports:{}};/*! +`,OCe="tutorials-submenu",_Ce="examples-submenu",YVn=be.memo(({viewOnly:t,canvas:e})=>{const n=H(fn),o=H(Ige),r=ht(Yq),i=H.getState().loggable,a=H.getState().language,l=H.getState().undoManager,s=ht.getState().changed,c=H.getState().cloudFile,u=H.getState().user,d=H.getState().elementsToPaste,f=H.getState().selectedElement;ht(j=>j.contextMenuFlag);const[p,g]=m.useState(!1),[y,w]=m.useState(!1),b=j=>{j&&w(!y)},{t:C}=Vl(),P=m.useMemo(()=>({lng:a}),[a]),v=m.useMemo(()=>me.isMac(),[]),T=m.useMemo(()=>{const j=me.getOS();return j&&(j.includes("OS X")||j.includes("Chrome"))?"Ctrl+Alt+H":"Ctrl+Home"},[]),A=j=>{j.keyPath.find(L=>L===OCe||L===_Ce)&&x(j.key)},x=j=>{const L=ULn(j);L&&(ht.getState().set(k=>{k.openModelsMap=!1}),!t&&s?Oi.confirm({title:C("message.DoYouWantToSaveChanges",P),icon:h.jsx(ny,{}),onOk:()=>S(L),onCancel:()=>{ht.getState().set(k=>{k.waiting=!0}),setTimeout(()=>{o(L)},10)},okText:C("word.Yes",P),cancelText:C("word.No",P)}):(ht.getState().set(k=>{k.waiting=!0}),setTimeout(()=>{o(L)},10)),i&&n(k=>{k.actionInfo={name:"Open Example: "+j,timestamp:new Date().getTime()}}),t||window.history.pushState({},document.title,t1))},S=j=>{c?(n(L=>{L.localContentToImportAfterCloudFileUpdate=j}),ht.getState().setSaveCloudFileFlag(!0)):u.uid?n(L=>{L.localContentToImportAfterCloudFileUpdate=j,L.showCloudFileTitleDialogFlag=!L.showCloudFileTitleDialogFlag,L.showCloudFileTitleDialog=!0}):hn(C("menu.file.ToSaveYourWorkPleaseSignIn",P))},R=()=>{g(!0)},M=()=>{g(!1)},D=d&&d.length>0,E=H.getState().countAllElementsByType(),W=[];return r||W.push({key:"file-sub-menu",label:h.jsx(rn,{noPadding:!0,children:C("menu.fileSubMenu",P)}),children:zWn(t,v,e)}),!r&&!t&&u.uid&&W.push({key:"project-sub-menu",label:h.jsx(rn,{noPadding:!0,children:C("menu.projectSubMenu",P)}),children:kWn()}),(f||D||l.hasUndo()||l.hasRedo())&&!r&&W.push({key:"edit-sub-menu",label:h.jsx(rn,{noPadding:!0,children:C("menu.editSubMenu",P)}),children:LWn(f,D,l,v)}),r||W.push({key:"view-sub-menu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.viewSubMenu",P)}),children:JNn(T,v)}),r||W.push({key:"settings-sub-menu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.settingsSubMenu",P)}),children:KNn()}),r||W.push({key:"accessories-sub-menu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.view.accessoriesSubMenu",P)}),children:qNn()}),!r&&E.gotSome()&&W.push({key:"analysis-sub-menu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.analysisSubMenu",P)}),children:aUn(E)}),W.push({key:OCe,label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.tutorialsSubMenu",P)}),children:WVn(t)}),W.push({key:_Ce,label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.examplesSubMenu",P)}),children:NVn()}),W.push({key:"public-sub-menu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.publicSubMenu",P)}),children:XNn(u.uid,t,r)}),W.push({key:"language-sub-menu",label:h.jsx(rn,{noPadding:!0,children:Y.t("menu.languageSubMenu",P)}),children:[{key:"language-radio-group",label:h.jsx(GNn,{}),style:{backgroundColor:"white"}}]}),W.push({key:"about-us-window",label:h.jsxs(rn,{noPadding:!0,onClick:R,children:[Y.t("menu.AboutUs",P),"..."]})}),h.jsxs(h.Fragment,{children:[h.jsx(jw,{menu:{items:W,onClick:A},trigger:["click"],onOpenChange:b,children:h.jsxs(UVn,{children:[h.jsx(jVn,{src:vnn,title:C("tooltip.clickToOpenMenu",P)}),h.jsx(BVn,{children:h.jsx("span",{style:{fontSize:"10px",alignContent:"center",cursor:"pointer"},children:C("menu.mainMenu",P)})})]})}),p&&h.jsx(Snn,{close:M})]})});var _nt={exports:{}};/*! * JavaScript Cookie v2.2.1 * https://github.com/js-cookie/js-cookie * * Copyright 2006, 2015 Klaus Hartl & Fagner Brack * Released under the MIT license - */(function(t,e){(function(n){var o;if(t.exports=n(),o=!0,!o){var r=window.Cookies,i=window.Cookies=n();i.noConflict=function(){return window.Cookies=r,i}}})(function(){function n(){for(var i=0,a={};i"u")){d=n({path:"/"},a.defaults,d),typeof d.expires=="number"&&(d.expires=new Date(new Date*1+d.expires*864e5)),d.expires=d.expires?d.expires.toUTCString():"";try{var f=JSON.stringify(u);/^[\{\[]/.test(f)&&(u=f)}catch{}u=i.write?i.write(u,c):encodeURIComponent(String(u)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),c=encodeURIComponent(String(c)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var p="";for(var g in d)d[g]&&(p+="; "+g,d[g]!==!0&&(p+="="+d[g].split(";")[0]));return document.cookie=c+"="+u+p}}function s(c,u){if(!(typeof document>"u")){for(var d={},f=document.cookie?document.cookie.split("; "):[],p=0;p=0)&&(n[r]=t[r]);return n}var nfe={TOP:"top",BOTTOM:"bottom",NONE:"none"},KX;(function(t){t.STRICT="strict",t.LAX="lax",t.NONE="none"})(KX||(KX={}));var ofe={HIDDEN:"hidden",SHOW:"show",BY_COOKIE_VALUE:"byCookieValue"},Vnt="CookieConsent",XVn=["children"],JVn=function(e){var n=e.children,o=GVn(e,XVn);return be.createElement("button",Object.assign({},o),n)},BD={disableStyles:!1,hideOnAccept:!0,hideOnDecline:!0,location:nfe.BOTTOM,visible:ofe.BY_COOKIE_VALUE,onAccept:function(e){},onDecline:function(){},cookieName:Vnt,cookieValue:"true",declineCookieValue:"false",setDeclineCookie:!0,buttonText:"I understand",declineButtonText:"I decline",debug:!1,expires:365,containerClasses:"CookieConsent",contentClasses:"",buttonClasses:"",buttonWrapperClasses:"",declineButtonClasses:"",buttonId:"rcc-confirm-button",declineButtonId:"rcc-decline-button",extraCookieOptions:{},disableButtonStyles:!1,enableDeclineButton:!1,flipButtons:!1,sameSite:KX.LAX,ButtonComponent:JVn,overlay:!1,overlayClasses:"",onOverlayClick:function(){},acceptOnOverlayClick:!1,ariaAcceptLabel:"Accept cookies",ariaDeclineLabel:"Decline cookies",acceptOnScroll:!1,acceptOnScrollPercentage:25,customContentAttributes:{},customContainerAttributes:{},customButtonProps:{},customDeclineButtonProps:{},customButtonWrapperAttributes:{},style:{},buttonStyle:{},declineButtonStyle:{},contentStyle:{},overlayStyle:{}},KVn={visible:!1,style:{alignItems:"baseline",background:"#353535",color:"white",display:"flex",flexWrap:"wrap",justifyContent:"space-between",left:"0",position:"fixed",width:"100%",zIndex:"999"},buttonStyle:{background:"#ffd42d",border:"0",borderRadius:"0px",boxShadow:"none",color:"black",cursor:"pointer",flex:"0 0 auto",padding:"5px 10px",margin:"15px"},declineButtonStyle:{background:"#c12a2a",border:"0",borderRadius:"0px",boxShadow:"none",color:"#e5e5e5",cursor:"pointer",flex:"0 0 auto",padding:"5px 10px",margin:"15px"},contentStyle:{flex:"1 0 300px",margin:"15px"},overlayStyle:{position:"fixed",left:0,top:0,width:"100%",height:"100%",zIndex:"999",backgroundColor:"rgba(0,0,0,0.3)"}},qVn=function(e){e===void 0&&(e=Vnt);var n=JX.get(e);return n===void 0?JX.get(Gnt(e)):n},Gnt=function(e){return e+"-legacy"},Xnt=function(t){VVn(e,t);function e(){var o;return o=t.apply(this,arguments)||this,o.state=KVn,o.handleScroll=function(){var r=bm({},BD,o.props),i=r.acceptOnScrollPercentage,a=document.documentElement,l=document.body,s="scrollTop",c="scrollHeight",u=(a[s]||l[s])/((a[c]||l[c])-a.clientHeight)*100;u>i&&o.accept(!0)},o.removeScrollListener=function(){var r=o.props.acceptOnScroll;r&&window.removeEventListener("scroll",o.handleScroll)},o}var n=e.prototype;return n.componentDidMount=function(){var r=this.props.debug;(this.getCookieValue()===void 0||r)&&(this.setState({visible:!0}),this.props.acceptOnScroll&&window.addEventListener("scroll",this.handleScroll,{passive:!0}))},n.componentWillUnmount=function(){this.removeScrollListener()},n.accept=function(r){var i;r===void 0&&(r=!1);var a=bm({},BD,this.props),l=a.cookieName,s=a.cookieValue,c=a.hideOnAccept,u=a.onAccept;this.setCookie(l,s),u((i=r)!=null?i:!1),c&&(this.setState({visible:!1}),this.removeScrollListener())},n.overlayClick=function(){var r=bm({},BD,this.props),i=r.acceptOnOverlayClick,a=r.onOverlayClick;i&&this.accept(),a()},n.decline=function(){var r=bm({},BD,this.props),i=r.cookieName,a=r.declineCookieValue,l=r.hideOnDecline,s=r.onDecline,c=r.setDeclineCookie;c&&this.setCookie(i,a),s(),l&&this.setState({visible:!1})},n.setCookie=function(r,i){var a=this.props,l=a.extraCookieOptions,s=a.expires,c=a.sameSite,u=this.props.cookieSecurity;u===void 0&&(u=window.location?window.location.protocol==="https:":!0);var d=bm({expires:s},l,{sameSite:c,secure:u});c===KX.NONE&&JX.set(Gnt(r),i,d),JX.set(r,i,d)},n.getCookieValue=function(){var r=this.props.cookieName;return qVn(r)},n.render=function(){var r=this;switch(this.props.visible){case ofe.HIDDEN:return null;case ofe.BY_COOKIE_VALUE:if(!this.state.visible)return null;break}var i=this.props,a=i.location,l=i.style,s=i.buttonStyle,c=i.declineButtonStyle,u=i.contentStyle,d=i.disableStyles,f=i.buttonText,p=i.declineButtonText,g=i.containerClasses,y=i.contentClasses,w=i.buttonClasses,b=i.buttonWrapperClasses,C=i.declineButtonClasses,P=i.buttonId,v=i.declineButtonId,T=i.disableButtonStyles,A=i.enableDeclineButton,x=i.flipButtons,S=i.ButtonComponent,R=i.overlay,M=i.overlayClasses,D=i.overlayStyle,E=i.ariaAcceptLabel,W=i.ariaDeclineLabel,j=i.customContainerAttributes,L=i.customContentAttributes,k=i.customButtonProps,N=i.customDeclineButtonProps,F=i.customButtonWrapperAttributes,U={},O={},B={},_={},X={};switch(d?(U=Object.assign({},l),O=Object.assign({},s),B=Object.assign({},c),_=Object.assign({},u),X=Object.assign({},D)):(U=Object.assign({},bm({},this.state.style,l)),_=Object.assign({},bm({},this.state.contentStyle,u)),X=Object.assign({},bm({},this.state.overlayStyle,D)),T?(O=Object.assign({},s),B=Object.assign({},c)):(O=Object.assign({},bm({},this.state.buttonStyle,s)),B=Object.assign({},bm({},this.state.declineButtonStyle,c)))),a){case nfe.TOP:U.top="0";break;case nfe.BOTTOM:U.bottom="0";break}var $=[];return A&&$.push(be.createElement(S,Object.assign({key:"declineButton",style:B,className:C,id:v,"aria-label":W,onClick:function(){r.decline()}},N),p)),$.push(be.createElement(S,Object.assign({key:"acceptButton",style:O,className:w,id:P,"aria-label":E,onClick:function(){r.accept()}},k),f)),x&&$.reverse(),be.createElement(_Vn,{condition:R,wrapper:function(le){return be.createElement("div",{style:X,className:M,onClick:function(){r.overlayClick()}},le)}},be.createElement("div",Object.assign({className:""+g,style:U},j),be.createElement("div",Object.assign({style:_,className:y},L),this.props.children),be.createElement("div",Object.assign({className:""+b},F),$.map(function(Q){return Q}))))},e}(m.Component);Xnt.defaultProps=BD;const $Vn=be.memo(()=>{const t=Jt();return h.jsx(Xnt,{location:"bottom",buttonText:Y.t("cookie.Accept",t),cookieName:"AladdinCookieName",style:{background:"#2B373B",textAlign:"center",zIndex:99999},buttonStyle:{color:"#4e503b",fontSize:"12px"},expires:150,children:Y.t("cookie.Statement",t)})}),QVn=.7,ZVn=42.2845513,eGn=QVn/Math.cos(me.toRadians(ZVn)),tGn=be.memo(()=>{const t=H(fn),e=H(Tc),n=H(Sb),o=H(wge),r=H(HBe),i=m.useRef(null),a=bb(r==="satellite"||r==="hybrid"?RQt(640,e,n,o):HQt(640,e,n,o));let l;o===21?l=.5:o===20?l=1:l=Math.pow(2,20-o);const s=eGn*Math.cos(me.toRadians(e))*l,c=u=>{u.intersections.length>0&&u.intersections[0].object===i.current&&t(f=>{vx.selectNone(f),f.pastePoint.copy(u.intersections[0].point),f.clickObjectType=z.Ground,f.contextMenuObjectType=z.Ground,f.pasteNormal=Io})};return a?h.jsxs("mesh",{rotation:[0,0,0],position:[0,0,0],renderOrder:-1,scale:[s,s,1],receiveShadow:!0,ref:i,onContextMenu:c,children:[h.jsx("planeGeometry",{args:[100,100]}),h.jsx("meshStandardMaterial",{attach:"material",depthTest:!1,side:$r,map:a,opacity:1})]}):h.jsx(h.Fragment,{})}),nGn=({foundation:t})=>{const e=Jt(),n=()=>{H.getState().set(r=>{for(const i of r.elements)if(i.id===t.id){i.notBuilding=!i.notBuilding;break}})},o=r=>{const i={name:"Building",timestamp:Date.now(),checked:r.target.checked,selectedElementId:t.id,selectedElementType:t.type,undo:()=>n(),redo:()=>n()};H.getState().addUndoable(i),n()};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:!t.notBuilding,onChange:o,children:Y.t("word.Building",e)})})},_Ce=({foundation:t,lock:e,count:n})=>{const o=Jt(),r=e?"foundationMenu.LockAllUnlockedElementsOnThisFoundation":"foundationMenu.UnlockAllLockedElementsOnThisFoundation",i=()=>{const a=new Map;for(const c of H.getState().elements)(c.foundationId===t.id||c.id===t.id)&&a.set(c.id,!!c.locked);const s={name:e?"Lock All Unlocked Offsprings":"Unlock All Locked Offsprings",timestamp:Date.now(),oldValues:a,newValue:!0,undo:()=>{for(const[c,u]of s.oldValues.entries())H.getState().updateElementLockById(c,u)},redo:()=>{H.getState().updateElementLockByFoundationId(t.id,e)}};H.getState().addUndoable(s),H.getState().updateElementLockByFoundationId(t.id,e)};return h.jsxs(rn,{noPadding:!0,onClick:i,children:[Y.t(r,o)," (",n,")"]})},Cae=({foundation:t,objectType:e,modalTitle:n,onClickOk:o,children:r})=>{const i=H.getState().removeAllElementsOnFoundationByType,a=()=>{const s=H.getState().elements.filter(d=>!d.locked&&d.type===e&&d.foundationId===t.id);i(t.id,e);const c=JSON.parse(JSON.stringify(s)),u={name:`Remove All ${e}s on Foundation`,timestamp:Date.now(),parentId:t.id,removedElements:c,undo:()=>{H.getState().set(d=>{d.elements.push(...u.removedElements)})},redo:()=>{i(u.parentId,e)}};H.getState().addUndoable(u)},l=()=>{const s=o??a;Oi.confirm({title:n,icon:h.jsx(ny,{}),onOk:s})};return h.jsx(rn,{noPadding:!0,onClick:l,children:r})},oGn=({foundation:t})=>{const e=H.getState().set,n=Jt(),o=()=>{e(a=>{a.objectTypeToAdd=z.Polygon});const r=H.getState().addElement(t,new ie(t.cx,t.cy,t.lz),Io),i={name:"Add",timestamp:Date.now(),addedElement:r,undo:()=>{H.getState().removeElementById(i.addedElement.id,!1)},redo:()=>{e(a=>{a.elements.push(i.addedElement),a.selectedElement=i.addedElement})}};H.getState().addUndoable(i),e(a=>{a.objectTypeToAdd=z.None})};return h.jsx(rn,{onClick:o,children:Y.t("foundationMenu.AddPolygon",n)})},rGn=({foundation:t})=>{var a;const[e,n]=m.useState((a=t==null?void 0:t.hvacSystem)==null?void 0:a.id),o=l=>{let s=l.target.value;s.trim().length===0&&(s=void 0),n(s)},r=(l,s)=>{H.getState().set(c=>{for(const u of c.elements)if(u.type===z.Foundation&&u.id===l){const d=u;d.hvacSystem?d.hvacSystem.id=s:d.hvacSystem={thermostatSetpoint:20,temperatureThreshold:3,id:s};break}})},i=l=>{var d;const s=(d=t.hvacSystem)==null?void 0:d.id,c=l&&l.trim().length>0?l:void 0,u={name:"Change HVAC ID",timestamp:Date.now(),oldValue:s,newValue:c,undo:()=>{r(t.id,u.oldValue)},redo:()=>{r(t.id,u.newValue)}};H.getState().addUndoable(u),r(t.id,c)};return h.jsxs(rn,{stayAfterClick:!0,noPadding:!0,children:[h.jsx(en,{style:{width:"40px",paddingLeft:"0px",textAlign:"left"},children:"ID:"}),h.jsx(as,{style:{width:"180px"},value:e,onChange:o,onPressEnter:()=>i(e),onBlur:()=>i(e)})]})},iGn=({foundation:t})=>{var r;const e=Jt(),n=(i,a)=>{H.getState().set(l=>{for(const s of l.elements)if(s.type===z.Foundation&&s.id===i){const c=s;c.hvacSystem?c.hvacSystem.thermostatSetpoint=a:c.hvacSystem={thermostatSetpoint:a,temperatureThreshold:3};break}})},o=i=>{var c;if(i===null)return;const a=((c=t.hvacSystem)==null?void 0:c.thermostatSetpoint)??20,l=i,s={name:"Change Thermostat Setpoint",timestamp:Date.now(),oldValue:a,newValue:l,undo:()=>{n(t.id,s.oldValue)},redo:()=>{n(t.id,s.newValue)}};H.getState().addUndoable(s),n(t.id,l)};return h.jsxs(rn,{stayAfterClick:!0,noPadding:!0,children:[h.jsx(en,{style:{width:"160px"},children:Y.t("word.ThermostatSetpoint",e)+":"}),h.jsx(Mn,{min:0,max:30,step:1,style:{width:60},precision:1,value:((r=t.hvacSystem)==null?void 0:r.thermostatSetpoint)??20,onChange:o})]})},aGn=({foundation:t})=>{var r;const e=Jt(),n=(i,a)=>{H.getState().set(l=>{for(const s of l.elements)if(s.type===z.Foundation&&s.id===i){const c=s;c.hvacSystem?c.hvacSystem.temperatureThreshold=a:c.hvacSystem={thermostatSetpoint:20,temperatureThreshold:a};break}})},o=i=>{var c;if(i===null)return;const a=((c=t.hvacSystem)==null?void 0:c.temperatureThreshold)??3,l=i,s={name:"Change Temperature Tolerance Threshold",timestamp:Date.now(),oldValue:a,newValue:l,undo:()=>{n(t.id,s.oldValue)},redo:()=>{n(t.id,s.newValue)}};H.getState().addUndoable(s),n(t.id,l)};return h.jsxs(rn,{stayAfterClick:!0,noPadding:!0,children:[h.jsx(en,{title:Y.t("word.TemperatureToleranceThresholdExplanation",e),style:{width:"160px"},children:Y.t("word.TemperatureToleranceThreshold",e)+":"}),h.jsx(Mn,{min:0,max:30,step:1,style:{width:60},precision:1,value:((r=t.hvacSystem)==null?void 0:r.temperatureThreshold)??3,onChange:o}),h.jsx(en,{style:{paddingLeft:"10px"},children:"°C"})]})},lGn=({foundation:t})=>{const e=Jt(),n=(t==null?void 0:t.solarStructure)??Dn.None,o=(i,a)=>{H.getState().set(l=>{for(const s of l.elements)if(s.type===z.Foundation&&s.id===i&&!s.locked){s.solarStructure=a;break}})},r=i=>{const a=t.solarStructure,l=i.target.value,s={name:"Select Solar Structure for Selected Foundation",timestamp:Date.now(),oldValue:a,newValue:l,changedElementId:t.id,changedElementType:t.type,undo:()=>{o(s.changedElementId,s.oldValue)},redo:()=>{o(s.changedElementId,s.newValue)}};H.getState().addUndoable(s),o(t.id,l)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Ue.Group,{value:n,onChange:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:Dn.None,children:Y.t("word.None",e)}),h.jsx(Ue,{style:{width:"100%"},value:Dn.FocusPipe,children:Y.t("solarAbsorberPipeMenu.AbsorberPipeForFresnelReflectors",e)}),h.jsx(Ue,{style:{width:"100%"},value:Dn.FocusTower,children:Y.t("solarPowerTowerMenu.ReceiverTowerForHeliostats",e)}),h.jsx(Ue,{style:{width:"100%"},value:Dn.UpdraftTower,children:Y.t("solarUpdraftTowerMenu.SolarUpdraftTower",e)})]})})})},Jnt="/aladdin/assets/foundation_01_menu-DJ2ZRFYJ.png",Knt="/aladdin/assets/foundation_02_menu-D6HXceyz.png",qnt="/aladdin/assets/foundation_03_menu-BFLw0RU7.png",$nt="/aladdin/assets/foundation_04_menu-DtGEusM9.png",Qnt="/aladdin/assets/foundation_05_menu-BGUU1Wal.png",Znt="/aladdin/assets/foundation_06_menu-hg_Rf0EG.png",eot="/aladdin/assets/foundation_07_menu-BM9bFpzu.png",tot=t=>{const[e,n]=m.useState((t==null?void 0:t.label)??"");return m.useEffect(()=>{t!=null&&t.label&&n(t.label)},[t==null?void 0:t.id]),{labelText:e,setLabelText:n}},not=t=>{const e=H(En),n=H(Wwt);return()=>{if(t){const o={name:"Show Label for "+t.type,timestamp:Date.now(),checked:!t.showLabel,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{n(t.id,!o.checked)},redo:()=>{n(t.id,o.checked)}};e(o),n(t.id,!t.showLabel)}}},oot=(t,e)=>{const n=H(Lwt),o=H(En);return()=>{if(t){const r=t.label,i={name:"Set Label for "+t.type,timestamp:Date.now(),oldValue:r,newValue:e,changedElementId:t.id,changedElementType:t.type,undo:()=>{n(i.changedElementId,i.oldValue)},redo:()=>{n(i.changedElementId,i.newValue)}};o(i),n(t.id,e)}}},sGn=t=>{const e=H(fn),n=H(En),o=r=>{e(i=>{for(const a of i.elements)if(a.id===(t==null?void 0:t.id)){a.labelFontSize=r;break}})};return r=>{if(t){const i=t.labelFontSize??20,a=r,l={name:"Set Label Font Size for "+t.type,timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{o(l.oldValue)},redo:()=>{o(l.newValue)}};n(l),o(a)}}},cGn=t=>{const e=H(fn),n=H(En),o=r=>{e(i=>{for(const a of i.elements)if(a.id===(t==null?void 0:t.id)){a.labelSize=r;break}})};return r=>{if(t){const i=t.labelSize??.2,a=r,l={name:"Set Label Size for "+t.type,timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{o(l.oldValue)},redo:()=>{o(l.newValue)}};n(l),o(a)}}},uGn=t=>{const e=H(fn),n=H(En),o=r=>{e(i=>{for(const a of i.elements)if(a.id===(t==null?void 0:t.id)){a.labelColor=r;break}})};return r=>{if(t){const i=t.labelColor??"white",a=r,l={name:"Set Label Color for "+t.type,timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{o(l.oldValue)},redo:()=>{o(l.newValue)}};n(l),o(a)}}},dGn=t=>{const e=H(fn),n=H(En),o=r=>{e(i=>{for(const a of i.elements)if(a.id===(t==null?void 0:t.id)){a.labelHeight=r;break}})};return r=>{if(t){const i=t.labelHeight??t.lz/2+.2,a=r,l={name:"Set Label Height for "+t.type,timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{o(l.oldValue)},redo:()=>{o(l.newValue)}};n(l),o(a)}}},co=t=>H(e=>{if(!e.selectedElement)return;const n=e.elements.find(o=>{var r;return o.id===((r=e.selectedElement)==null?void 0:r.id)});if(!n||!t||n.type===t)return n}),XZ=t=>{const[e,n]=m.useState(t);return[e,r=>{n(r.hex)}]},so=({width:t,title:e,rejectedMessage:n,onApply:o,onClose:r,onClickOk:i,onClickCancel:a,children:l})=>{const s=H(Zn),c=H(Vi),{t:u}=Vl(),d=Jt(),[f,p]=m.useState({left:0,top:0,bottom:0,right:0}),[g,y]=m.useState(!1),w=m.useRef(null),b=(T,A)=>{if(w.current){const{clientWidth:x,clientHeight:S}=window.document.documentElement,R=w.current.getBoundingClientRect();p({left:-R.left+A.x,right:x-(R.right-A.x),top:-R.top+A.y,bottom:S-((R==null?void 0:R.bottom)-A.y)})}},C=m.useCallback(()=>{i?i():(o(),r(),s(0))},[o,i,r,s]),P=()=>{a?a():(r(),c())};m.useEffect(()=>{const T=A=>{A.key==="Enter"&&C()};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[C]);const v=!!n&&n.length>0;return h.jsxs(Oi,{width:t,open:!0,title:h.jsxs("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>y(!0),onMouseOut:()=>y(!1),children:[e,v&&h.jsx("span",{style:{color:"red",fontWeight:"bold"},children:n})]}),footer:[h.jsx(lo,{onClick:o,children:u("word.Apply",d)},"Apply"),h.jsx(lo,{onClick:P,children:u("word.Cancel",d)},"Cancel"),h.jsx(lo,{type:"primary",onClick:C,children:u("word.OK",d)},"OK")],onCancel:r,maskClosable:!1,destroyOnClose:!1,modalRender:T=>h.jsx(_i,{disabled:!g,bounds:f,onStart:(A,x)=>b(A,x),children:h.jsx("div",{ref:w,children:T})}),children:[h.jsx(vxe,{}),l,h.jsx(vxe,{})]})},fGn=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState((s==null?void 0:s.textureType)??Yi.NoTexture),d=Jt(),{Option:f}=_o,p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){x.textureType=T;break}})},g=v=>{e(T=>{for(const A of T.elements)A.type===z.Foundation&&!A.locked&&(A.textureType=v)})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)&&v!==T.textureType)return!0;break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&v!==T.textureType)return!0;break;default:if(v!==(s==null?void 0:s.textureType))return!0}return!1},w=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(x.type===z.Foundation&&v.has(x.id))if(T!==void 0)x.textureType=T;else{const S=v.get(x.id);S!==void 0&&(x.textureType=S)}})},b=v=>{if(s&&y(v)){switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)&&T.set(x.id,x.textureType??Yi.NoTexture);const A={name:"Set Texture for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{w(A.oldValues)},redo:()=>{w(A.oldValues,A.newValue)}};r(A),w(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)x.type===z.Foundation&&T.set(x.id,x.textureType??Yi.NoTexture);const A={name:"Set Texture for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T?T.textureType:s.textureType,x={name:"Set Texture of Selected Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),p(s.id,v),l(a+1);break}}e(T=>{T.actionState.foundationTexture=v})}},C=()=>{t(!1)},P=()=>{b(c)};return h.jsx(so,{width:500,title:Y.t("word.Texture",d),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:10,children:h.jsxs(_o,{style:{width:"150px"},value:c,onChange:u,children:[h.jsxs(f,{value:Yi.NoTexture,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"32px",height:"20px",border:"1px dashed dimGray"},children:" "}),Y.t("shared.NoTexture",d)]},Yi.NoTexture),h.jsxs(f,{value:Yi.Texture01,children:[h.jsx("img",{alt:Yi.Texture01,src:Jnt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("foundationMenu.Texture01",d)]},Yi.Texture01),h.jsxs(f,{value:Yi.Texture02,children:[h.jsx("img",{alt:Yi.Texture02,src:Knt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("foundationMenu.Texture02",d)]},Yi.Texture02),h.jsxs(f,{value:Yi.Texture03,children:[h.jsx("img",{alt:Yi.Texture03,src:qnt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("foundationMenu.Texture03",d)]},Yi.Texture03),h.jsxs(f,{value:Yi.Texture04,children:[h.jsx("img",{alt:Yi.Texture04,src:$nt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("foundationMenu.Texture04",d)]},Yi.Texture04),h.jsxs(f,{value:Yi.Texture05,children:[h.jsx("img",{alt:Yi.Texture05,src:Qnt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("foundationMenu.Texture05",d)]},Yi.Texture05),h.jsxs(f,{value:Yi.Texture06,children:[h.jsx("img",{alt:Yi.Texture06,src:Znt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("foundationMenu.Texture06",d)]},Yi.Texture06),h.jsxs(f,{value:Yi.Texture07,children:[h.jsx("img",{alt:Yi.Texture07,src:eot,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("foundationMenu.Texture07",d)]},Yi.Texture07)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:14,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})};var km={},ON={},hGn=typeof Ac=="object"&&Ac&&Ac.Object===Object&&Ac,rot=hGn,pGn=rot,gGn=typeof self=="object"&&self&&self.Object===Object&&self,mGn=pGn||gGn||Function("return this")(),l5=mGn,yGn=l5,AGn=yGn.Symbol,dM=AGn,VCe=dM,iot=Object.prototype,wGn=iot.hasOwnProperty,vGn=iot.toString,qz=VCe?VCe.toStringTag:void 0;function xGn(t){var e=wGn.call(t,qz),n=t[qz];try{t[qz]=void 0;var o=!0}catch{}var r=vGn.call(t);return o&&(e?t[qz]=n:delete t[qz]),r}var bGn=xGn,SGn=Object.prototype,TGn=SGn.toString;function PGn(t){return TGn.call(t)}var CGn=PGn,GCe=dM,RGn=bGn,HGn=CGn,MGn="[object Null]",IGn="[object Undefined]",XCe=GCe?GCe.toStringTag:void 0;function zGn(t){return t==null?t===void 0?IGn:MGn:XCe&&XCe in Object(t)?RGn(t):HGn(t)}var bA=zGn,DGn=Array.isArray,vp=DGn;function EGn(t){return t!=null&&typeof t=="object"}var s5=EGn,FGn=bA,kGn=vp,LGn=s5,WGn="[object String]";function NGn(t){return typeof t=="string"||!kGn(t)&&LGn(t)&&FGn(t)==WGn}var aot=NGn;const _N=Fi(aot);function UGn(t){return function(e,n,o){for(var r=-1,i=Object(e),a=o(e),l=a.length;l--;){var s=a[t?l:++r];if(n(i[s],s,i)===!1)break}return e}}var jGn=UGn,BGn=jGn,YGn=BGn(),OGn=YGn;function _Gn(t,e){for(var n=-1,o=Array(t);++n-1&&t%1==0&&t-1&&t%1==0&&t<=aXn}var F5e=lXn,sXn=bA,cXn=F5e,uXn=s5,dXn="[object Arguments]",fXn="[object Array]",hXn="[object Boolean]",pXn="[object Date]",gXn="[object Error]",mXn="[object Function]",yXn="[object Map]",AXn="[object Number]",wXn="[object Object]",vXn="[object RegExp]",xXn="[object Set]",bXn="[object String]",SXn="[object WeakMap]",TXn="[object ArrayBuffer]",PXn="[object DataView]",CXn="[object Float32Array]",RXn="[object Float64Array]",HXn="[object Int8Array]",MXn="[object Int16Array]",IXn="[object Int32Array]",zXn="[object Uint8Array]",DXn="[object Uint8ClampedArray]",EXn="[object Uint16Array]",FXn="[object Uint32Array]",dc={};dc[CXn]=dc[RXn]=dc[HXn]=dc[MXn]=dc[IXn]=dc[zXn]=dc[DXn]=dc[EXn]=dc[FXn]=!0;dc[dXn]=dc[fXn]=dc[TXn]=dc[hXn]=dc[PXn]=dc[pXn]=dc[gXn]=dc[mXn]=dc[yXn]=dc[AXn]=dc[wXn]=dc[vXn]=dc[xXn]=dc[bXn]=dc[SXn]=!1;function kXn(t){return uXn(t)&&cXn(t.length)&&!!dc[sXn(t)]}var LXn=kXn;function WXn(t){return function(e){return t(e)}}var JZ=WXn,$X={exports:{}};$X.exports;(function(t,e){var n=rot,o=e&&!e.nodeType&&e,r=o&&!0&&t&&!t.nodeType&&t,i=r&&r.exports===o,a=i&&n.process,l=function(){try{var s=r&&r.require&&r.require("util").types;return s||a&&a.binding&&a.binding("util")}catch{}}();t.exports=l})($X,$X.exports);var k5e=$X.exports,NXn=LXn,UXn=JZ,KCe=k5e,qCe=KCe&&KCe.isTypedArray,jXn=qCe?UXn(qCe):NXn,sot=jXn,BXn=VGn,YXn=z5e,OXn=vp,_Xn=D5e,VXn=E5e,GXn=sot,XXn=Object.prototype,JXn=XXn.hasOwnProperty;function KXn(t,e){var n=OXn(t),o=!n&&YXn(t),r=!n&&!o&&_Xn(t),i=!n&&!o&&!r&&GXn(t),a=n||o||r||i,l=a?BXn(t.length,String):[],s=l.length;for(var c in t)(e||JXn.call(t,c))&&!(a&&(c=="length"||r&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||VXn(c,s)))&&l.push(c);return l}var cot=KXn,qXn=Object.prototype;function $Xn(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||qXn;return t===n}var L5e=$Xn;function QXn(t,e){return function(n){return t(e(n))}}var uot=QXn,ZXn=uot,eJn=ZXn(Object.keys,Object),tJn=eJn,nJn=L5e,oJn=tJn,rJn=Object.prototype,iJn=rJn.hasOwnProperty;function aJn(t){if(!nJn(t))return oJn(t);var e=[];for(var n in Object(t))iJn.call(t,n)&&n!="constructor"&&e.push(n);return e}var lJn=aJn;function sJn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var c5=sJn;const fM=Fi(c5);var cJn=bA,uJn=c5,dJn="[object AsyncFunction]",fJn="[object Function]",hJn="[object GeneratorFunction]",pJn="[object Proxy]";function gJn(t){if(!uJn(t))return!1;var e=cJn(t);return e==fJn||e==hJn||e==dJn||e==pJn}var W5e=gJn;const va=Fi(W5e);var mJn=W5e,yJn=F5e;function AJn(t){return t!=null&&yJn(t.length)&&!mJn(t)}var hM=AJn,wJn=cot,vJn=lJn,xJn=hM;function bJn(t){return xJn(t)?wJn(t):vJn(t)}var pM=bJn,SJn=OGn,TJn=pM;function PJn(t,e){return t&&SJn(t,e,TJn)}var N5e=PJn;function CJn(t){return t}var Qb=CJn,RJn=Qb;function HJn(t){return typeof t=="function"?t:RJn}var MJn=HJn,IJn=N5e,zJn=MJn;function DJn(t,e){return t&&IJn(t,zJn(e))}var U5e=DJn,EJn=uot,FJn=EJn(Object.getPrototypeOf,Object),j5e=FJn,kJn=bA,LJn=j5e,WJn=s5,NJn="[object Object]",UJn=Function.prototype,jJn=Object.prototype,dot=UJn.toString,BJn=jJn.hasOwnProperty,YJn=dot.call(Object);function OJn(t){if(!WJn(t)||kJn(t)!=NJn)return!1;var e=LJn(t);if(e===null)return!0;var n=BJn.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&dot.call(n)==YJn}var fot=OJn;const _Jn=Fi(fot);function VJn(t,e){for(var n=-1,o=t==null?0:t.length,r=Array(o);++n-1}var lKn=aKn,sKn=qZ;function cKn(t,e){var n=this.__data__,o=sKn(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}var uKn=cKn,dKn=XJn,fKn=tKn,hKn=rKn,pKn=lKn,gKn=uKn;function gM(t){var e=-1,n=t==null?0:t.length;for(this.clear();++el))return!1;var c=i.get(t),u=i.get(e);if(c&&u)return c==e&&u==t;var d=-1,f=!0,p=n&T$n?new v$n:void 0;for(i.set(t,e),i.set(e,t);++d0&&arguments[0]!==void 0?arguments[0]:[],n=[];return(0,ato.default)(e,function(o){Array.isArray(o)?t(o).map(function(r){return n.push(r)}):(0,rto.default)(o)?(0,nto.default)(o,function(r,i){r===!0&&n.push(i),n.push(i+"-"+r)}):(0,eto.default)(o)&&n.push(o)}),n};ON.default=lto;var VN={};function sto(t,e){for(var n=-1,o=t==null?0:t.length;++n1&&arguments[1]!==void 0?arguments[1]:[],o=e.default&&(0,Rro.default)(e.default)||{};return n.map(function(r){var i=e[r];return i&&(0,Pro.default)(i,function(a,l){o[l]||(o[l]={}),o[l]=Hro({},o[l],i[l])}),r}),o};VN.default=Mro;var GN={};Object.defineProperty(GN,"__esModule",{value:!0});GN.autoprefix=void 0;var Iro=U5e,IRe=Dro(Iro),zro=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(o){Uro(r,o);function r(){var i,a,l,s;Nro(this,r);for(var c=arguments.length,u=Array(c),d=0;d1&&arguments[1]!==void 0?arguments[1]:"span";return function(o){Vro(r,o);function r(){var i,a,l,s;_ro(this,r);for(var c=arguments.length,u=Array(c),d=0;d1&&arguments[1]!==void 0?arguments[1]:!0;o[a]=l};return e===0&&r("first-child"),e===n-1&&r("last-child"),(e===0||e%2===0)&&r("even"),Math.abs(e%2)===1&&r("odd"),r("nth-child",e),o};n9e.default=Xro;Object.defineProperty(km,"__esModule",{value:!0});km.ReactCSS=km.loop=km.handleActive=o9e=km.handleHover=km.hover=void 0;var Jro=ON,Kro=xM(Jro),qro=VN,$ro=xM(qro),Qro=GN,Zro=xM(Qro),eio=XN,Yot=xM(eio),tio=JN,nio=xM(tio),oio=n9e,rio=xM(oio);function xM(t){return t&&t.__esModule?t:{default:t}}km.hover=Yot.default;var o9e=km.handleHover=Yot.default;km.handleActive=nio.default;km.loop=rio.default;var iio=km.ReactCSS=function(e){for(var n=arguments.length,o=Array(n>1?n-1:0),r=1;rl?f=1:f=Math.round(d*100/l)/100,n.a!==f)return{h:n.h,s:n.s,l:n.l,a:f,source:"rgb"}}else{var p=void 0;if(u<0?p=0:u>a?p=1:p=Math.round(u*100/a)/100,r!==p)return{h:n.h,s:n.s,l:n.l,a:p,source:"rgb"}}return null},Dae={},lio=function(e,n,o,r){if(typeof document>"u"&&!r)return null;var i=r?new r:document.createElement("canvas");i.width=o*2,i.height=o*2;var a=i.getContext("2d");return a?(a.fillStyle=e,a.fillRect(0,0,i.width,i.height),a.fillStyle=n,a.fillRect(0,0,o,o),a.translate(o,o),a.fillRect(0,0,o,o),i.toDataURL()):null},sio=function(e,n,o,r){var i=e+"-"+n+"-"+o+(r?"-server":"");if(Dae[i])return Dae[i];var a=lio(e,n,o,r);return Dae[i]=a,a},ERe=Object.assign||function(t){for(var e=1;e"u")){d=n({path:"/"},a.defaults,d),typeof d.expires=="number"&&(d.expires=new Date(new Date*1+d.expires*864e5)),d.expires=d.expires?d.expires.toUTCString():"";try{var f=JSON.stringify(u);/^[\{\[]/.test(f)&&(u=f)}catch{}u=i.write?i.write(u,c):encodeURIComponent(String(u)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),c=encodeURIComponent(String(c)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var p="";for(var g in d)d[g]&&(p+="; "+g,d[g]!==!0&&(p+="="+d[g].split(";")[0]));return document.cookie=c+"="+u+p}}function s(c,u){if(!(typeof document>"u")){for(var d={},f=document.cookie?document.cookie.split("; "):[],p=0;p=0)&&(n[r]=t[r]);return n}var nfe={TOP:"top",BOTTOM:"bottom",NONE:"none"},qX;(function(t){t.STRICT="strict",t.LAX="lax",t.NONE="none"})(qX||(qX={}));var ofe={HIDDEN:"hidden",SHOW:"show",BY_COOKIE_VALUE:"byCookieValue"},Vnt="CookieConsent",XVn=["children"],JVn=function(e){var n=e.children,o=GVn(e,XVn);return be.createElement("button",Object.assign({},o),n)},BD={disableStyles:!1,hideOnAccept:!0,hideOnDecline:!0,location:nfe.BOTTOM,visible:ofe.BY_COOKIE_VALUE,onAccept:function(e){},onDecline:function(){},cookieName:Vnt,cookieValue:"true",declineCookieValue:"false",setDeclineCookie:!0,buttonText:"I understand",declineButtonText:"I decline",debug:!1,expires:365,containerClasses:"CookieConsent",contentClasses:"",buttonClasses:"",buttonWrapperClasses:"",declineButtonClasses:"",buttonId:"rcc-confirm-button",declineButtonId:"rcc-decline-button",extraCookieOptions:{},disableButtonStyles:!1,enableDeclineButton:!1,flipButtons:!1,sameSite:qX.LAX,ButtonComponent:JVn,overlay:!1,overlayClasses:"",onOverlayClick:function(){},acceptOnOverlayClick:!1,ariaAcceptLabel:"Accept cookies",ariaDeclineLabel:"Decline cookies",acceptOnScroll:!1,acceptOnScrollPercentage:25,customContentAttributes:{},customContainerAttributes:{},customButtonProps:{},customDeclineButtonProps:{},customButtonWrapperAttributes:{},style:{},buttonStyle:{},declineButtonStyle:{},contentStyle:{},overlayStyle:{}},KVn={visible:!1,style:{alignItems:"baseline",background:"#353535",color:"white",display:"flex",flexWrap:"wrap",justifyContent:"space-between",left:"0",position:"fixed",width:"100%",zIndex:"999"},buttonStyle:{background:"#ffd42d",border:"0",borderRadius:"0px",boxShadow:"none",color:"black",cursor:"pointer",flex:"0 0 auto",padding:"5px 10px",margin:"15px"},declineButtonStyle:{background:"#c12a2a",border:"0",borderRadius:"0px",boxShadow:"none",color:"#e5e5e5",cursor:"pointer",flex:"0 0 auto",padding:"5px 10px",margin:"15px"},contentStyle:{flex:"1 0 300px",margin:"15px"},overlayStyle:{position:"fixed",left:0,top:0,width:"100%",height:"100%",zIndex:"999",backgroundColor:"rgba(0,0,0,0.3)"}},qVn=function(e){e===void 0&&(e=Vnt);var n=KX.get(e);return n===void 0?KX.get(Gnt(e)):n},Gnt=function(e){return e+"-legacy"},Xnt=function(t){VVn(e,t);function e(){var o;return o=t.apply(this,arguments)||this,o.state=KVn,o.handleScroll=function(){var r=bm({},BD,o.props),i=r.acceptOnScrollPercentage,a=document.documentElement,l=document.body,s="scrollTop",c="scrollHeight",u=(a[s]||l[s])/((a[c]||l[c])-a.clientHeight)*100;u>i&&o.accept(!0)},o.removeScrollListener=function(){var r=o.props.acceptOnScroll;r&&window.removeEventListener("scroll",o.handleScroll)},o}var n=e.prototype;return n.componentDidMount=function(){var r=this.props.debug;(this.getCookieValue()===void 0||r)&&(this.setState({visible:!0}),this.props.acceptOnScroll&&window.addEventListener("scroll",this.handleScroll,{passive:!0}))},n.componentWillUnmount=function(){this.removeScrollListener()},n.accept=function(r){var i;r===void 0&&(r=!1);var a=bm({},BD,this.props),l=a.cookieName,s=a.cookieValue,c=a.hideOnAccept,u=a.onAccept;this.setCookie(l,s),u((i=r)!=null?i:!1),c&&(this.setState({visible:!1}),this.removeScrollListener())},n.overlayClick=function(){var r=bm({},BD,this.props),i=r.acceptOnOverlayClick,a=r.onOverlayClick;i&&this.accept(),a()},n.decline=function(){var r=bm({},BD,this.props),i=r.cookieName,a=r.declineCookieValue,l=r.hideOnDecline,s=r.onDecline,c=r.setDeclineCookie;c&&this.setCookie(i,a),s(),l&&this.setState({visible:!1})},n.setCookie=function(r,i){var a=this.props,l=a.extraCookieOptions,s=a.expires,c=a.sameSite,u=this.props.cookieSecurity;u===void 0&&(u=window.location?window.location.protocol==="https:":!0);var d=bm({expires:s},l,{sameSite:c,secure:u});c===qX.NONE&&KX.set(Gnt(r),i,d),KX.set(r,i,d)},n.getCookieValue=function(){var r=this.props.cookieName;return qVn(r)},n.render=function(){var r=this;switch(this.props.visible){case ofe.HIDDEN:return null;case ofe.BY_COOKIE_VALUE:if(!this.state.visible)return null;break}var i=this.props,a=i.location,l=i.style,s=i.buttonStyle,c=i.declineButtonStyle,u=i.contentStyle,d=i.disableStyles,f=i.buttonText,p=i.declineButtonText,g=i.containerClasses,y=i.contentClasses,w=i.buttonClasses,b=i.buttonWrapperClasses,C=i.declineButtonClasses,P=i.buttonId,v=i.declineButtonId,T=i.disableButtonStyles,A=i.enableDeclineButton,x=i.flipButtons,S=i.ButtonComponent,R=i.overlay,M=i.overlayClasses,D=i.overlayStyle,E=i.ariaAcceptLabel,W=i.ariaDeclineLabel,j=i.customContainerAttributes,L=i.customContentAttributes,k=i.customButtonProps,N=i.customDeclineButtonProps,F=i.customButtonWrapperAttributes,U={},O={},B={},_={},X={};switch(d?(U=Object.assign({},l),O=Object.assign({},s),B=Object.assign({},c),_=Object.assign({},u),X=Object.assign({},D)):(U=Object.assign({},bm({},this.state.style,l)),_=Object.assign({},bm({},this.state.contentStyle,u)),X=Object.assign({},bm({},this.state.overlayStyle,D)),T?(O=Object.assign({},s),B=Object.assign({},c)):(O=Object.assign({},bm({},this.state.buttonStyle,s)),B=Object.assign({},bm({},this.state.declineButtonStyle,c)))),a){case nfe.TOP:U.top="0";break;case nfe.BOTTOM:U.bottom="0";break}var $=[];return A&&$.push(be.createElement(S,Object.assign({key:"declineButton",style:B,className:C,id:v,"aria-label":W,onClick:function(){r.decline()}},N),p)),$.push(be.createElement(S,Object.assign({key:"acceptButton",style:O,className:w,id:P,"aria-label":E,onClick:function(){r.accept()}},k),f)),x&&$.reverse(),be.createElement(_Vn,{condition:R,wrapper:function(le){return be.createElement("div",{style:X,className:M,onClick:function(){r.overlayClick()}},le)}},be.createElement("div",Object.assign({className:""+g,style:U},j),be.createElement("div",Object.assign({style:_,className:y},L),this.props.children),be.createElement("div",Object.assign({className:""+b},F),$.map(function(Q){return Q}))))},e}(m.Component);Xnt.defaultProps=BD;const $Vn=be.memo(()=>{const t=Jt();return h.jsx(Xnt,{location:"bottom",buttonText:Y.t("cookie.Accept",t),cookieName:"AladdinCookieName",style:{background:"#2B373B",textAlign:"center",zIndex:99999},buttonStyle:{color:"#4e503b",fontSize:"12px"},expires:150,children:Y.t("cookie.Statement",t)})}),QVn=.7,ZVn=42.2845513,eGn=QVn/Math.cos(me.toRadians(ZVn)),tGn=be.memo(()=>{const t=H(fn),e=H(Tc),n=H(Sb),o=H(wge),r=H(MBe),i=m.useRef(null),a=bb(r==="satellite"||r==="hybrid"?RQt(640,e,n,o):HQt(640,e,n,o));let l;o===21?l=.5:o===20?l=1:l=Math.pow(2,20-o);const s=eGn*Math.cos(me.toRadians(e))*l,c=u=>{u.intersections.length>0&&u.intersections[0].object===i.current&&t(f=>{vx.selectNone(f),f.pastePoint.copy(u.intersections[0].point),f.clickObjectType=z.Ground,f.contextMenuObjectType=z.Ground,f.pasteNormal=Io})};return a?h.jsxs("mesh",{rotation:[0,0,0],position:[0,0,0],renderOrder:-1,scale:[s,s,1],receiveShadow:!0,ref:i,onContextMenu:c,children:[h.jsx("planeGeometry",{args:[100,100]}),h.jsx("meshStandardMaterial",{attach:"material",depthTest:!1,side:$r,map:a,opacity:1})]}):h.jsx(h.Fragment,{})}),nGn=({foundation:t})=>{const e=Jt(),n=()=>{H.getState().set(r=>{for(const i of r.elements)if(i.id===t.id){i.notBuilding=!i.notBuilding;break}})},o=r=>{const i={name:"Building",timestamp:Date.now(),checked:r.target.checked,selectedElementId:t.id,selectedElementType:t.type,undo:()=>n(),redo:()=>n()};H.getState().addUndoable(i),n()};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:!t.notBuilding,onChange:o,children:Y.t("word.Building",e)})})},VCe=({foundation:t,lock:e,count:n})=>{const o=Jt(),r=e?"foundationMenu.LockAllUnlockedElementsOnThisFoundation":"foundationMenu.UnlockAllLockedElementsOnThisFoundation",i=()=>{const a=new Map;for(const c of H.getState().elements)(c.foundationId===t.id||c.id===t.id)&&a.set(c.id,!!c.locked);const s={name:e?"Lock All Unlocked Offsprings":"Unlock All Locked Offsprings",timestamp:Date.now(),oldValues:a,newValue:!0,undo:()=>{for(const[c,u]of s.oldValues.entries())H.getState().updateElementLockById(c,u)},redo:()=>{H.getState().updateElementLockByFoundationId(t.id,e)}};H.getState().addUndoable(s),H.getState().updateElementLockByFoundationId(t.id,e)};return h.jsxs(rn,{noPadding:!0,onClick:i,children:[Y.t(r,o)," (",n,")"]})},Cae=({foundation:t,objectType:e,modalTitle:n,onClickOk:o,children:r})=>{const i=H.getState().removeAllElementsOnFoundationByType,a=()=>{const s=H.getState().elements.filter(d=>!d.locked&&d.type===e&&d.foundationId===t.id);i(t.id,e);const c=JSON.parse(JSON.stringify(s)),u={name:`Remove All ${e}s on Foundation`,timestamp:Date.now(),parentId:t.id,removedElements:c,undo:()=>{H.getState().set(d=>{d.elements.push(...u.removedElements)})},redo:()=>{i(u.parentId,e)}};H.getState().addUndoable(u)},l=()=>{const s=o??a;Oi.confirm({title:n,icon:h.jsx(ny,{}),onOk:s})};return h.jsx(rn,{noPadding:!0,onClick:l,children:r})},oGn=({foundation:t})=>{const e=H.getState().set,n=Jt(),o=()=>{e(a=>{a.objectTypeToAdd=z.Polygon});const r=H.getState().addElement(t,new ie(t.cx,t.cy,t.lz),Io),i={name:"Add",timestamp:Date.now(),addedElement:r,undo:()=>{H.getState().removeElementById(i.addedElement.id,!1)},redo:()=>{e(a=>{a.elements.push(i.addedElement),a.selectedElement=i.addedElement})}};H.getState().addUndoable(i),e(a=>{a.objectTypeToAdd=z.None})};return h.jsx(rn,{onClick:o,children:Y.t("foundationMenu.AddPolygon",n)})},rGn=({foundation:t})=>{var a;const[e,n]=m.useState((a=t==null?void 0:t.hvacSystem)==null?void 0:a.id),o=l=>{let s=l.target.value;s.trim().length===0&&(s=void 0),n(s)},r=(l,s)=>{H.getState().set(c=>{for(const u of c.elements)if(u.type===z.Foundation&&u.id===l){const d=u;d.hvacSystem?d.hvacSystem.id=s:d.hvacSystem={thermostatSetpoint:20,temperatureThreshold:3,id:s};break}})},i=l=>{var d;const s=(d=t.hvacSystem)==null?void 0:d.id,c=l&&l.trim().length>0?l:void 0,u={name:"Change HVAC ID",timestamp:Date.now(),oldValue:s,newValue:c,undo:()=>{r(t.id,u.oldValue)},redo:()=>{r(t.id,u.newValue)}};H.getState().addUndoable(u),r(t.id,c)};return h.jsxs(rn,{stayAfterClick:!0,noPadding:!0,children:[h.jsx(en,{style:{width:"40px",paddingLeft:"0px",textAlign:"left"},children:"ID:"}),h.jsx(as,{style:{width:"180px"},value:e,onChange:o,onPressEnter:()=>i(e),onBlur:()=>i(e)})]})},iGn=({foundation:t})=>{var r;const e=Jt(),n=(i,a)=>{H.getState().set(l=>{for(const s of l.elements)if(s.type===z.Foundation&&s.id===i){const c=s;c.hvacSystem?c.hvacSystem.thermostatSetpoint=a:c.hvacSystem={thermostatSetpoint:a,temperatureThreshold:3};break}})},o=i=>{var c;if(i===null)return;const a=((c=t.hvacSystem)==null?void 0:c.thermostatSetpoint)??20,l=i,s={name:"Change Thermostat Setpoint",timestamp:Date.now(),oldValue:a,newValue:l,undo:()=>{n(t.id,s.oldValue)},redo:()=>{n(t.id,s.newValue)}};H.getState().addUndoable(s),n(t.id,l)};return h.jsxs(rn,{stayAfterClick:!0,noPadding:!0,children:[h.jsx(en,{style:{width:"160px"},children:Y.t("word.ThermostatSetpoint",e)+":"}),h.jsx(Mn,{min:0,max:30,step:1,style:{width:60},precision:1,value:((r=t.hvacSystem)==null?void 0:r.thermostatSetpoint)??20,onChange:o})]})},aGn=({foundation:t})=>{var r;const e=Jt(),n=(i,a)=>{H.getState().set(l=>{for(const s of l.elements)if(s.type===z.Foundation&&s.id===i){const c=s;c.hvacSystem?c.hvacSystem.temperatureThreshold=a:c.hvacSystem={thermostatSetpoint:20,temperatureThreshold:a};break}})},o=i=>{var c;if(i===null)return;const a=((c=t.hvacSystem)==null?void 0:c.temperatureThreshold)??3,l=i,s={name:"Change Temperature Tolerance Threshold",timestamp:Date.now(),oldValue:a,newValue:l,undo:()=>{n(t.id,s.oldValue)},redo:()=>{n(t.id,s.newValue)}};H.getState().addUndoable(s),n(t.id,l)};return h.jsxs(rn,{stayAfterClick:!0,noPadding:!0,children:[h.jsx(en,{title:Y.t("word.TemperatureToleranceThresholdExplanation",e),style:{width:"160px"},children:Y.t("word.TemperatureToleranceThreshold",e)+":"}),h.jsx(Mn,{min:0,max:30,step:1,style:{width:60},precision:1,value:((r=t.hvacSystem)==null?void 0:r.temperatureThreshold)??3,onChange:o}),h.jsx(en,{style:{paddingLeft:"10px"},children:"°C"})]})},lGn=({foundation:t})=>{const e=Jt(),n=(t==null?void 0:t.solarStructure)??Dn.None,o=(i,a)=>{H.getState().set(l=>{for(const s of l.elements)if(s.type===z.Foundation&&s.id===i&&!s.locked){s.solarStructure=a;break}})},r=i=>{const a=t.solarStructure,l=i.target.value,s={name:"Select Solar Structure for Selected Foundation",timestamp:Date.now(),oldValue:a,newValue:l,changedElementId:t.id,changedElementType:t.type,undo:()=>{o(s.changedElementId,s.oldValue)},redo:()=>{o(s.changedElementId,s.newValue)}};H.getState().addUndoable(s),o(t.id,l)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Ue.Group,{value:n,onChange:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:Dn.None,children:Y.t("word.None",e)}),h.jsx(Ue,{style:{width:"100%"},value:Dn.FocusPipe,children:Y.t("solarAbsorberPipeMenu.AbsorberPipeForFresnelReflectors",e)}),h.jsx(Ue,{style:{width:"100%"},value:Dn.FocusTower,children:Y.t("solarPowerTowerMenu.ReceiverTowerForHeliostats",e)}),h.jsx(Ue,{style:{width:"100%"},value:Dn.UpdraftTower,children:Y.t("solarUpdraftTowerMenu.SolarUpdraftTower",e)})]})})})},Jnt="/aladdin/assets/foundation_01_menu-DJ2ZRFYJ.png",Knt="/aladdin/assets/foundation_02_menu-D6HXceyz.png",qnt="/aladdin/assets/foundation_03_menu-BFLw0RU7.png",$nt="/aladdin/assets/foundation_04_menu-DtGEusM9.png",Qnt="/aladdin/assets/foundation_05_menu-BGUU1Wal.png",Znt="/aladdin/assets/foundation_06_menu-hg_Rf0EG.png",eot="/aladdin/assets/foundation_07_menu-BM9bFpzu.png",tot=t=>{const[e,n]=m.useState((t==null?void 0:t.label)??"");return m.useEffect(()=>{t!=null&&t.label&&n(t.label)},[t==null?void 0:t.id]),{labelText:e,setLabelText:n}},not=t=>{const e=H(En),n=H(Wwt);return()=>{if(t){const o={name:"Show Label for "+t.type,timestamp:Date.now(),checked:!t.showLabel,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{n(t.id,!o.checked)},redo:()=>{n(t.id,o.checked)}};e(o),n(t.id,!t.showLabel)}}},oot=(t,e)=>{const n=H(Lwt),o=H(En);return()=>{if(t){const r=t.label,i={name:"Set Label for "+t.type,timestamp:Date.now(),oldValue:r,newValue:e,changedElementId:t.id,changedElementType:t.type,undo:()=>{n(i.changedElementId,i.oldValue)},redo:()=>{n(i.changedElementId,i.newValue)}};o(i),n(t.id,e)}}},sGn=t=>{const e=H(fn),n=H(En),o=r=>{e(i=>{for(const a of i.elements)if(a.id===(t==null?void 0:t.id)){a.labelFontSize=r;break}})};return r=>{if(t){const i=t.labelFontSize??20,a=r,l={name:"Set Label Font Size for "+t.type,timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{o(l.oldValue)},redo:()=>{o(l.newValue)}};n(l),o(a)}}},cGn=t=>{const e=H(fn),n=H(En),o=r=>{e(i=>{for(const a of i.elements)if(a.id===(t==null?void 0:t.id)){a.labelSize=r;break}})};return r=>{if(t){const i=t.labelSize??.2,a=r,l={name:"Set Label Size for "+t.type,timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{o(l.oldValue)},redo:()=>{o(l.newValue)}};n(l),o(a)}}},uGn=t=>{const e=H(fn),n=H(En),o=r=>{e(i=>{for(const a of i.elements)if(a.id===(t==null?void 0:t.id)){a.labelColor=r;break}})};return r=>{if(t){const i=t.labelColor??"white",a=r,l={name:"Set Label Color for "+t.type,timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{o(l.oldValue)},redo:()=>{o(l.newValue)}};n(l),o(a)}}},dGn=t=>{const e=H(fn),n=H(En),o=r=>{e(i=>{for(const a of i.elements)if(a.id===(t==null?void 0:t.id)){a.labelHeight=r;break}})};return r=>{if(t){const i=t.labelHeight??t.lz/2+.2,a=r,l={name:"Set Label Height for "+t.type,timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{o(l.oldValue)},redo:()=>{o(l.newValue)}};n(l),o(a)}}},co=t=>H(e=>{if(!e.selectedElement)return;const n=e.elements.find(o=>{var r;return o.id===((r=e.selectedElement)==null?void 0:r.id)});if(!n||!t||n.type===t)return n}),XZ=t=>{const[e,n]=m.useState(t);return[e,r=>{n(r.hex)}]},so=({width:t,title:e,rejectedMessage:n,onApply:o,onClose:r,onClickOk:i,onClickCancel:a,children:l})=>{const s=H(Zn),c=H(Vi),{t:u}=Vl(),d=Jt(),[f,p]=m.useState({left:0,top:0,bottom:0,right:0}),[g,y]=m.useState(!1),w=m.useRef(null),b=(T,A)=>{if(w.current){const{clientWidth:x,clientHeight:S}=window.document.documentElement,R=w.current.getBoundingClientRect();p({left:-R.left+A.x,right:x-(R.right-A.x),top:-R.top+A.y,bottom:S-((R==null?void 0:R.bottom)-A.y)})}},C=m.useCallback(()=>{i?i():(o(),r(),s(0))},[o,i,r,s]),P=()=>{a?a():(r(),c())};m.useEffect(()=>{const T=A=>{A.key==="Enter"&&C()};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[C]);const v=!!n&&n.length>0;return h.jsxs(Oi,{width:t,open:!0,title:h.jsxs("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>y(!0),onMouseOut:()=>y(!1),children:[e,v&&h.jsx("span",{style:{color:"red",fontWeight:"bold"},children:n})]}),footer:[h.jsx(lo,{onClick:o,children:u("word.Apply",d)},"Apply"),h.jsx(lo,{onClick:P,children:u("word.Cancel",d)},"Cancel"),h.jsx(lo,{type:"primary",onClick:C,children:u("word.OK",d)},"OK")],onCancel:r,maskClosable:!1,destroyOnClose:!1,modalRender:T=>h.jsx(_i,{disabled:!g,bounds:f,onStart:(A,x)=>b(A,x),children:h.jsx("div",{ref:w,children:T})}),children:[h.jsx(xxe,{}),l,h.jsx(xxe,{})]})},fGn=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState((s==null?void 0:s.textureType)??Yi.NoTexture),d=Jt(),{Option:f}=_o,p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){x.textureType=T;break}})},g=v=>{e(T=>{for(const A of T.elements)A.type===z.Foundation&&!A.locked&&(A.textureType=v)})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)&&v!==T.textureType)return!0;break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&v!==T.textureType)return!0;break;default:if(v!==(s==null?void 0:s.textureType))return!0}return!1},w=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(x.type===z.Foundation&&v.has(x.id))if(T!==void 0)x.textureType=T;else{const S=v.get(x.id);S!==void 0&&(x.textureType=S)}})},b=v=>{if(s&&y(v)){switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)&&T.set(x.id,x.textureType??Yi.NoTexture);const A={name:"Set Texture for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{w(A.oldValues)},redo:()=>{w(A.oldValues,A.newValue)}};r(A),w(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)x.type===z.Foundation&&T.set(x.id,x.textureType??Yi.NoTexture);const A={name:"Set Texture for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T?T.textureType:s.textureType,x={name:"Set Texture of Selected Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),p(s.id,v),l(a+1);break}}e(T=>{T.actionState.foundationTexture=v})}},C=()=>{t(!1)},P=()=>{b(c)};return h.jsx(so,{width:500,title:Y.t("word.Texture",d),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:10,children:h.jsxs(_o,{style:{width:"150px"},value:c,onChange:u,children:[h.jsxs(f,{value:Yi.NoTexture,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"32px",height:"20px",border:"1px dashed dimGray"},children:" "}),Y.t("shared.NoTexture",d)]},Yi.NoTexture),h.jsxs(f,{value:Yi.Texture01,children:[h.jsx("img",{alt:Yi.Texture01,src:Jnt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("foundationMenu.Texture01",d)]},Yi.Texture01),h.jsxs(f,{value:Yi.Texture02,children:[h.jsx("img",{alt:Yi.Texture02,src:Knt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("foundationMenu.Texture02",d)]},Yi.Texture02),h.jsxs(f,{value:Yi.Texture03,children:[h.jsx("img",{alt:Yi.Texture03,src:qnt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("foundationMenu.Texture03",d)]},Yi.Texture03),h.jsxs(f,{value:Yi.Texture04,children:[h.jsx("img",{alt:Yi.Texture04,src:$nt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("foundationMenu.Texture04",d)]},Yi.Texture04),h.jsxs(f,{value:Yi.Texture05,children:[h.jsx("img",{alt:Yi.Texture05,src:Qnt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("foundationMenu.Texture05",d)]},Yi.Texture05),h.jsxs(f,{value:Yi.Texture06,children:[h.jsx("img",{alt:Yi.Texture06,src:Znt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("foundationMenu.Texture06",d)]},Yi.Texture06),h.jsxs(f,{value:Yi.Texture07,children:[h.jsx("img",{alt:Yi.Texture07,src:eot,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("foundationMenu.Texture07",d)]},Yi.Texture07)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:14,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})};var km={},_N={},hGn=typeof Ac=="object"&&Ac&&Ac.Object===Object&&Ac,rot=hGn,pGn=rot,gGn=typeof self=="object"&&self&&self.Object===Object&&self,mGn=pGn||gGn||Function("return this")(),l5=mGn,yGn=l5,AGn=yGn.Symbol,dM=AGn,GCe=dM,iot=Object.prototype,wGn=iot.hasOwnProperty,vGn=iot.toString,qz=GCe?GCe.toStringTag:void 0;function xGn(t){var e=wGn.call(t,qz),n=t[qz];try{t[qz]=void 0;var o=!0}catch{}var r=vGn.call(t);return o&&(e?t[qz]=n:delete t[qz]),r}var bGn=xGn,SGn=Object.prototype,TGn=SGn.toString;function PGn(t){return TGn.call(t)}var CGn=PGn,XCe=dM,RGn=bGn,HGn=CGn,MGn="[object Null]",IGn="[object Undefined]",JCe=XCe?XCe.toStringTag:void 0;function zGn(t){return t==null?t===void 0?IGn:MGn:JCe&&JCe in Object(t)?RGn(t):HGn(t)}var bA=zGn,DGn=Array.isArray,vp=DGn;function EGn(t){return t!=null&&typeof t=="object"}var s5=EGn,FGn=bA,kGn=vp,LGn=s5,WGn="[object String]";function NGn(t){return typeof t=="string"||!kGn(t)&&LGn(t)&&FGn(t)==WGn}var aot=NGn;const VN=Fi(aot);function UGn(t){return function(e,n,o){for(var r=-1,i=Object(e),a=o(e),l=a.length;l--;){var s=a[t?l:++r];if(n(i[s],s,i)===!1)break}return e}}var jGn=UGn,BGn=jGn,YGn=BGn(),OGn=YGn;function _Gn(t,e){for(var n=-1,o=Array(t);++n-1&&t%1==0&&t-1&&t%1==0&&t<=aXn}var k5e=lXn,sXn=bA,cXn=k5e,uXn=s5,dXn="[object Arguments]",fXn="[object Array]",hXn="[object Boolean]",pXn="[object Date]",gXn="[object Error]",mXn="[object Function]",yXn="[object Map]",AXn="[object Number]",wXn="[object Object]",vXn="[object RegExp]",xXn="[object Set]",bXn="[object String]",SXn="[object WeakMap]",TXn="[object ArrayBuffer]",PXn="[object DataView]",CXn="[object Float32Array]",RXn="[object Float64Array]",HXn="[object Int8Array]",MXn="[object Int16Array]",IXn="[object Int32Array]",zXn="[object Uint8Array]",DXn="[object Uint8ClampedArray]",EXn="[object Uint16Array]",FXn="[object Uint32Array]",dc={};dc[CXn]=dc[RXn]=dc[HXn]=dc[MXn]=dc[IXn]=dc[zXn]=dc[DXn]=dc[EXn]=dc[FXn]=!0;dc[dXn]=dc[fXn]=dc[TXn]=dc[hXn]=dc[PXn]=dc[pXn]=dc[gXn]=dc[mXn]=dc[yXn]=dc[AXn]=dc[wXn]=dc[vXn]=dc[xXn]=dc[bXn]=dc[SXn]=!1;function kXn(t){return uXn(t)&&cXn(t.length)&&!!dc[sXn(t)]}var LXn=kXn;function WXn(t){return function(e){return t(e)}}var JZ=WXn,QX={exports:{}};QX.exports;(function(t,e){var n=rot,o=e&&!e.nodeType&&e,r=o&&!0&&t&&!t.nodeType&&t,i=r&&r.exports===o,a=i&&n.process,l=function(){try{var s=r&&r.require&&r.require("util").types;return s||a&&a.binding&&a.binding("util")}catch{}}();t.exports=l})(QX,QX.exports);var L5e=QX.exports,NXn=LXn,UXn=JZ,qCe=L5e,$Ce=qCe&&qCe.isTypedArray,jXn=$Ce?UXn($Ce):NXn,sot=jXn,BXn=VGn,YXn=D5e,OXn=vp,_Xn=E5e,VXn=F5e,GXn=sot,XXn=Object.prototype,JXn=XXn.hasOwnProperty;function KXn(t,e){var n=OXn(t),o=!n&&YXn(t),r=!n&&!o&&_Xn(t),i=!n&&!o&&!r&&GXn(t),a=n||o||r||i,l=a?BXn(t.length,String):[],s=l.length;for(var c in t)(e||JXn.call(t,c))&&!(a&&(c=="length"||r&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||VXn(c,s)))&&l.push(c);return l}var cot=KXn,qXn=Object.prototype;function $Xn(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||qXn;return t===n}var W5e=$Xn;function QXn(t,e){return function(n){return t(e(n))}}var uot=QXn,ZXn=uot,eJn=ZXn(Object.keys,Object),tJn=eJn,nJn=W5e,oJn=tJn,rJn=Object.prototype,iJn=rJn.hasOwnProperty;function aJn(t){if(!nJn(t))return oJn(t);var e=[];for(var n in Object(t))iJn.call(t,n)&&n!="constructor"&&e.push(n);return e}var lJn=aJn;function sJn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var c5=sJn;const fM=Fi(c5);var cJn=bA,uJn=c5,dJn="[object AsyncFunction]",fJn="[object Function]",hJn="[object GeneratorFunction]",pJn="[object Proxy]";function gJn(t){if(!uJn(t))return!1;var e=cJn(t);return e==fJn||e==hJn||e==dJn||e==pJn}var N5e=gJn;const va=Fi(N5e);var mJn=N5e,yJn=k5e;function AJn(t){return t!=null&&yJn(t.length)&&!mJn(t)}var hM=AJn,wJn=cot,vJn=lJn,xJn=hM;function bJn(t){return xJn(t)?wJn(t):vJn(t)}var pM=bJn,SJn=OGn,TJn=pM;function PJn(t,e){return t&&SJn(t,e,TJn)}var U5e=PJn;function CJn(t){return t}var Qb=CJn,RJn=Qb;function HJn(t){return typeof t=="function"?t:RJn}var MJn=HJn,IJn=U5e,zJn=MJn;function DJn(t,e){return t&&IJn(t,zJn(e))}var j5e=DJn,EJn=uot,FJn=EJn(Object.getPrototypeOf,Object),B5e=FJn,kJn=bA,LJn=B5e,WJn=s5,NJn="[object Object]",UJn=Function.prototype,jJn=Object.prototype,dot=UJn.toString,BJn=jJn.hasOwnProperty,YJn=dot.call(Object);function OJn(t){if(!WJn(t)||kJn(t)!=NJn)return!1;var e=LJn(t);if(e===null)return!0;var n=BJn.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&dot.call(n)==YJn}var fot=OJn;const _Jn=Fi(fot);function VJn(t,e){for(var n=-1,o=t==null?0:t.length,r=Array(o);++n-1}var lKn=aKn,sKn=qZ;function cKn(t,e){var n=this.__data__,o=sKn(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}var uKn=cKn,dKn=XJn,fKn=tKn,hKn=rKn,pKn=lKn,gKn=uKn;function gM(t){var e=-1,n=t==null?0:t.length;for(this.clear();++el))return!1;var c=i.get(t),u=i.get(e);if(c&&u)return c==e&&u==t;var d=-1,f=!0,p=n&T$n?new v$n:void 0;for(i.set(t,e),i.set(e,t);++d0&&arguments[0]!==void 0?arguments[0]:[],n=[];return(0,ato.default)(e,function(o){Array.isArray(o)?t(o).map(function(r){return n.push(r)}):(0,rto.default)(o)?(0,nto.default)(o,function(r,i){r===!0&&n.push(i),n.push(i+"-"+r)}):(0,eto.default)(o)&&n.push(o)}),n};_N.default=lto;var GN={};function sto(t,e){for(var n=-1,o=t==null?0:t.length;++n1&&arguments[1]!==void 0?arguments[1]:[],o=e.default&&(0,Rro.default)(e.default)||{};return n.map(function(r){var i=e[r];return i&&(0,Pro.default)(i,function(a,l){o[l]||(o[l]={}),o[l]=Hro({},o[l],i[l])}),r}),o};GN.default=Mro;var XN={};Object.defineProperty(XN,"__esModule",{value:!0});XN.autoprefix=void 0;var Iro=j5e,zRe=Dro(Iro),zro=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(o){Uro(r,o);function r(){var i,a,l,s;Nro(this,r);for(var c=arguments.length,u=Array(c),d=0;d1&&arguments[1]!==void 0?arguments[1]:"span";return function(o){Vro(r,o);function r(){var i,a,l,s;_ro(this,r);for(var c=arguments.length,u=Array(c),d=0;d1&&arguments[1]!==void 0?arguments[1]:!0;o[a]=l};return e===0&&r("first-child"),e===n-1&&r("last-child"),(e===0||e%2===0)&&r("even"),Math.abs(e%2)===1&&r("odd"),r("nth-child",e),o};o9e.default=Xro;Object.defineProperty(km,"__esModule",{value:!0});km.ReactCSS=km.loop=km.handleActive=r9e=km.handleHover=km.hover=void 0;var Jro=_N,Kro=xM(Jro),qro=GN,$ro=xM(qro),Qro=XN,Zro=xM(Qro),eio=JN,Yot=xM(eio),tio=KN,nio=xM(tio),oio=o9e,rio=xM(oio);function xM(t){return t&&t.__esModule?t:{default:t}}km.hover=Yot.default;var r9e=km.handleHover=Yot.default;km.handleActive=nio.default;km.loop=rio.default;var iio=km.ReactCSS=function(e){for(var n=arguments.length,o=Array(n>1?n-1:0),r=1;rl?f=1:f=Math.round(d*100/l)/100,n.a!==f)return{h:n.h,s:n.s,l:n.l,a:f,source:"rgb"}}else{var p=void 0;if(u<0?p=0:u>a?p=1:p=Math.round(u*100/a)/100,r!==p)return{h:n.h,s:n.s,l:n.l,a:p,source:"rgb"}}return null},Dae={},lio=function(e,n,o,r){if(typeof document>"u"&&!r)return null;var i=r?new r:document.createElement("canvas");i.width=o*2,i.height=o*2;var a=i.getContext("2d");return a?(a.fillStyle=e,a.fillRect(0,0,i.width,i.height),a.fillStyle=n,a.fillRect(0,0,o,o),a.translate(o,o),a.fillRect(0,0,o,o),i.toDataURL()):null},sio=function(e,n,o,r){var i=e+"-"+n+"-"+o+(r?"-server":"");if(Dae[i])return Dae[i];var a=lio(e,n,o,r);return Dae[i]=a,a},FRe=Object.assign||function(t){for(var e=1;e-1},bio=function(e){return Number(String(e).replace(/%/g,""))},Sio=1,ul=function(t){yio(e,t);function e(n){gio(this,e);var o=mio(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.handleBlur=function(){o.state.blurValue&&o.setState({value:o.state.blurValue,blurValue:null})},o.handleChange=function(r){o.setUpdatedValue(r.target.value,r)},o.handleKeyDown=function(r){var i=bio(r.target.value);if(!isNaN(i)&&xio(r.keyCode)){var a=o.getArrowOffset(),l=r.keyCode===Oot?i+a:i-a;o.setUpdatedValue(l,r)}},o.handleDrag=function(r){if(o.props.dragLabel){var i=Math.round(o.props.value+r.movementX);i>=0&&i<=o.props.dragMax&&o.props.onChange&&o.props.onChange(o.getValueObjectWithLabel(i),r)}},o.handleMouseDown=function(r){o.props.dragLabel&&(r.preventDefault(),o.handleDrag(r),window.addEventListener("mousemove",o.handleDrag),window.addEventListener("mouseup",o.handleMouseUp))},o.handleMouseUp=function(){o.unbindEventListeners()},o.unbindEventListeners=function(){window.removeEventListener("mousemove",o.handleDrag),window.removeEventListener("mouseup",o.handleMouseUp)},o.state={value:String(n.value).toUpperCase(),blurValue:String(n.value).toUpperCase()},o.inputId="rc-editable-input-"+Sio++,o}return hio(e,[{key:"componentDidUpdate",value:function(o,r){this.props.value!==this.state.value&&(o.value!==this.props.value||r.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(o){return pio({},this.props.label,o)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||Aio}},{key:"setUpdatedValue",value:function(o,r){var i=this.props.label?this.getValueObjectWithLabel(o):o;this.props.onChange&&this.props.onChange(i,r),this.setState({value:o})}},{key:"render",value:function(){var o=this,r=qi({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return be.createElement("div",{style:r.wrap},be.createElement("input",{id:this.inputId,style:r.input,ref:function(a){return o.input=a},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?be.createElement("label",{htmlFor:this.inputId,style:r.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e}(m.PureComponent||m.Component),Tio=function(e,n,o,r){var i=r.clientWidth,a=r.clientHeight,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,s=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=l-(r.getBoundingClientRect().left+window.pageXOffset),u=s-(r.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var d=void 0;if(u<0)d=359;else if(u>a)d=0;else{var f=-(u*100/a)+100;d=360*f/100}if(o.h!==d)return{h:d,s:o.s,l:o.l,a:o.a,source:"hsl"}}else{var p=void 0;if(c<0)p=0;else if(c>i)p=359;else{var g=c*100/i;p=360*g/100}if(o.h!==p)return{h:p,s:o.s,l:o.l,a:o.a,source:"hsl"}}return null},Pio=function(){function t(e,n){for(var o=0;o-1},bio=function(e){return Number(String(e).replace(/%/g,""))},Sio=1,ul=function(t){yio(e,t);function e(n){gio(this,e);var o=mio(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.handleBlur=function(){o.state.blurValue&&o.setState({value:o.state.blurValue,blurValue:null})},o.handleChange=function(r){o.setUpdatedValue(r.target.value,r)},o.handleKeyDown=function(r){var i=bio(r.target.value);if(!isNaN(i)&&xio(r.keyCode)){var a=o.getArrowOffset(),l=r.keyCode===Oot?i+a:i-a;o.setUpdatedValue(l,r)}},o.handleDrag=function(r){if(o.props.dragLabel){var i=Math.round(o.props.value+r.movementX);i>=0&&i<=o.props.dragMax&&o.props.onChange&&o.props.onChange(o.getValueObjectWithLabel(i),r)}},o.handleMouseDown=function(r){o.props.dragLabel&&(r.preventDefault(),o.handleDrag(r),window.addEventListener("mousemove",o.handleDrag),window.addEventListener("mouseup",o.handleMouseUp))},o.handleMouseUp=function(){o.unbindEventListeners()},o.unbindEventListeners=function(){window.removeEventListener("mousemove",o.handleDrag),window.removeEventListener("mouseup",o.handleMouseUp)},o.state={value:String(n.value).toUpperCase(),blurValue:String(n.value).toUpperCase()},o.inputId="rc-editable-input-"+Sio++,o}return hio(e,[{key:"componentDidUpdate",value:function(o,r){this.props.value!==this.state.value&&(o.value!==this.props.value||r.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(o){return pio({},this.props.label,o)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||Aio}},{key:"setUpdatedValue",value:function(o,r){var i=this.props.label?this.getValueObjectWithLabel(o):o;this.props.onChange&&this.props.onChange(i,r),this.setState({value:o})}},{key:"render",value:function(){var o=this,r=qi({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return be.createElement("div",{style:r.wrap},be.createElement("input",{id:this.inputId,style:r.input,ref:function(a){return o.input=a},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?be.createElement("label",{htmlFor:this.inputId,style:r.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e}(m.PureComponent||m.Component),Tio=function(e,n,o,r){var i=r.clientWidth,a=r.clientHeight,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,s=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=l-(r.getBoundingClientRect().left+window.pageXOffset),u=s-(r.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var d=void 0;if(u<0)d=359;else if(u>a)d=0;else{var f=-(u*100/a)+100;d=360*f/100}if(o.h!==d)return{h:d,s:o.s,l:o.l,a:o.a,source:"hsl"}}else{var p=void 0;if(c<0)p=0;else if(c>i)p=359;else{var g=c*100/i;p=360*g/100}if(o.h!==p)return{h:p,s:o.s,l:o.l,a:o.a,source:"hsl"}}return null},Pio=function(){function t(e,n){for(var o=0;o-1}function Fio(t,e){var n=this.__data__,o=ree(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}function SA(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=Bao}function TM(t){return t!=null&&s9e(t.length)&&!i9e(t)}function Yao(t){return yw(t)&&TM(t)}function Oao(){return!1}var $ot=typeof bg=="object"&&bg&&!bg.nodeType&&bg,YRe=$ot&&typeof ph=="object"&&ph&&!ph.nodeType&&ph,_ao=YRe&&YRe.exports===$ot,ORe=_ao?u5.Buffer:void 0,Vao=ORe?ORe.isBuffer:void 0,oJ=Vao||Oao,Gao="[object Object]",Xao=Function.prototype,Jao=Object.prototype,Qot=Xao.toString,Kao=Jao.hasOwnProperty,qao=Qot.call(Object);function $ao(t){if(!yw(t)||eS(t)!=Gao)return!1;var e=Kot(t);if(e===null)return!0;var n=Kao.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Qot.call(n)==qao}var Qao="[object Arguments]",Zao="[object Array]",elo="[object Boolean]",tlo="[object Date]",nlo="[object Error]",olo="[object Function]",rlo="[object Map]",ilo="[object Number]",alo="[object Object]",llo="[object RegExp]",slo="[object Set]",clo="[object String]",ulo="[object WeakMap]",dlo="[object ArrayBuffer]",flo="[object DataView]",hlo="[object Float32Array]",plo="[object Float64Array]",glo="[object Int8Array]",mlo="[object Int16Array]",ylo="[object Int32Array]",Alo="[object Uint8Array]",wlo="[object Uint8ClampedArray]",vlo="[object Uint16Array]",xlo="[object Uint32Array]",fc={};fc[hlo]=fc[plo]=fc[glo]=fc[mlo]=fc[ylo]=fc[Alo]=fc[wlo]=fc[vlo]=fc[xlo]=!0;fc[Qao]=fc[Zao]=fc[dlo]=fc[elo]=fc[flo]=fc[tlo]=fc[nlo]=fc[olo]=fc[rlo]=fc[ilo]=fc[alo]=fc[llo]=fc[slo]=fc[clo]=fc[ulo]=!1;function blo(t){return yw(t)&&s9e(t.length)&&!!fc[eS(t)]}function Slo(t){return function(e){return t(e)}}var Zot=typeof bg=="object"&&bg&&!bg.nodeType&&bg,WE=Zot&&typeof ph=="object"&&ph&&!ph.nodeType&&ph,Tlo=WE&&WE.exports===Zot,Fae=Tlo&&_ot.process,_Re=function(){try{var t=WE&&WE.require&&WE.require("util").types;return t||Fae&&Fae.binding&&Fae.binding("util")}catch{}}(),VRe=_Re&&_Re.isTypedArray,c9e=VRe?Slo(VRe):blo;function ufe(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Plo=Object.prototype,Clo=Plo.hasOwnProperty;function Rlo(t,e,n){var o=t[e];(!(Clo.call(t,e)&&KN(o,n))||n===void 0&&!(e in t))&&a9e(t,e,n)}function Hlo(t,e,n,o){var r=!n;n||(n={});for(var i=-1,a=e.length;++i-1&&t%1==0&&t0){if(++e>=_lo)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Jlo=Xlo(Olo);function Klo(t,e){return Jlo(Blo(t,e,aee),t+"")}function qlo(t,e,n){if(!oy(n))return!1;var o=typeof e;return(o=="number"?TM(n)&&u9e(e,n.length):o=="string"&&e in n)?KN(n[e],t):!1}function $lo(t){return Klo(function(e,n){var o=-1,r=n.length,i=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(i=t.length>3&&typeof i=="function"?(r--,i):void 0,a&&qlo(n[0],n[1],a)&&(i=r<3?void 0:i,r=1),e=Object(e);++o=e||x<0||d&&S>=i}function b(){var A=kae();if(w(A))return C(A);l=setTimeout(b,y(A))}function C(A){return l=void 0,f&&o?p(A):(o=r=void 0,a)}function P(){l!==void 0&&clearTimeout(l),c=0,o=s=r=l=void 0}function v(){return l===void 0?a:C(kae())}function T(){var A=kae(),x=w(A);if(o=arguments,r=this,s=A,x){if(l===void 0)return g(s);if(d)return clearTimeout(l),l=setTimeout(b,e),p(s)}return l===void 0&&(l=setTimeout(b,e)),a}return T.cancel=P,T.flush=v,T}var uso="Expected a function";function dso(t,e,n){var o=!0,r=!0;if(typeof t!="function")throw new TypeError(uso);return oy(n)&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),ort(t,e,{leading:o,maxWait:e,trailing:r})}var fso=function(e,n,o){var r=o.getBoundingClientRect(),i=r.width,a=r.height,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,s=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=l-(o.getBoundingClientRect().left+window.pageXOffset),u=s-(o.getBoundingClientRect().top+window.pageYOffset);c<0?c=0:c>i&&(c=i),u<0?u=0:u>a&&(u=a);var d=c/i,f=1-u/a;return{h:n.h,s:d,v:f,a:n.a,source:"hsv"}},hso=function(){function t(e,n){for(var o=0;o-1}function Fio(t,e){var n=this.__data__,o=ree(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}function SA(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=Bao}function TM(t){return t!=null&&c9e(t.length)&&!a9e(t)}function Yao(t){return yw(t)&&TM(t)}function Oao(){return!1}var $ot=typeof bg=="object"&&bg&&!bg.nodeType&&bg,ORe=$ot&&typeof ph=="object"&&ph&&!ph.nodeType&&ph,_ao=ORe&&ORe.exports===$ot,_Re=_ao?u5.Buffer:void 0,Vao=_Re?_Re.isBuffer:void 0,rJ=Vao||Oao,Gao="[object Object]",Xao=Function.prototype,Jao=Object.prototype,Qot=Xao.toString,Kao=Jao.hasOwnProperty,qao=Qot.call(Object);function $ao(t){if(!yw(t)||eS(t)!=Gao)return!1;var e=Kot(t);if(e===null)return!0;var n=Kao.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Qot.call(n)==qao}var Qao="[object Arguments]",Zao="[object Array]",elo="[object Boolean]",tlo="[object Date]",nlo="[object Error]",olo="[object Function]",rlo="[object Map]",ilo="[object Number]",alo="[object Object]",llo="[object RegExp]",slo="[object Set]",clo="[object String]",ulo="[object WeakMap]",dlo="[object ArrayBuffer]",flo="[object DataView]",hlo="[object Float32Array]",plo="[object Float64Array]",glo="[object Int8Array]",mlo="[object Int16Array]",ylo="[object Int32Array]",Alo="[object Uint8Array]",wlo="[object Uint8ClampedArray]",vlo="[object Uint16Array]",xlo="[object Uint32Array]",fc={};fc[hlo]=fc[plo]=fc[glo]=fc[mlo]=fc[ylo]=fc[Alo]=fc[wlo]=fc[vlo]=fc[xlo]=!0;fc[Qao]=fc[Zao]=fc[dlo]=fc[elo]=fc[flo]=fc[tlo]=fc[nlo]=fc[olo]=fc[rlo]=fc[ilo]=fc[alo]=fc[llo]=fc[slo]=fc[clo]=fc[ulo]=!1;function blo(t){return yw(t)&&c9e(t.length)&&!!fc[eS(t)]}function Slo(t){return function(e){return t(e)}}var Zot=typeof bg=="object"&&bg&&!bg.nodeType&&bg,WE=Zot&&typeof ph=="object"&&ph&&!ph.nodeType&&ph,Tlo=WE&&WE.exports===Zot,Fae=Tlo&&_ot.process,VRe=function(){try{var t=WE&&WE.require&&WE.require("util").types;return t||Fae&&Fae.binding&&Fae.binding("util")}catch{}}(),GRe=VRe&&VRe.isTypedArray,u9e=GRe?Slo(GRe):blo;function ufe(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Plo=Object.prototype,Clo=Plo.hasOwnProperty;function Rlo(t,e,n){var o=t[e];(!(Clo.call(t,e)&&qN(o,n))||n===void 0&&!(e in t))&&l9e(t,e,n)}function Hlo(t,e,n,o){var r=!n;n||(n={});for(var i=-1,a=e.length;++i-1&&t%1==0&&t0){if(++e>=_lo)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Jlo=Xlo(Olo);function Klo(t,e){return Jlo(Blo(t,e,aee),t+"")}function qlo(t,e,n){if(!oy(n))return!1;var o=typeof e;return(o=="number"?TM(n)&&d9e(e,n.length):o=="string"&&e in n)?qN(n[e],t):!1}function $lo(t){return Klo(function(e,n){var o=-1,r=n.length,i=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(i=t.length>3&&typeof i=="function"?(r--,i):void 0,a&&qlo(n[0],n[1],a)&&(i=r<3?void 0:i,r=1),e=Object(e);++o=e||x<0||d&&S>=i}function b(){var A=kae();if(w(A))return C(A);l=setTimeout(b,y(A))}function C(A){return l=void 0,f&&o?p(A):(o=r=void 0,a)}function P(){l!==void 0&&clearTimeout(l),c=0,o=s=r=l=void 0}function v(){return l===void 0?a:C(kae())}function T(){var A=kae(),x=w(A);if(o=arguments,r=this,s=A,x){if(l===void 0)return g(s);if(d)return clearTimeout(l),l=setTimeout(b,e),p(s)}return l===void 0&&(l=setTimeout(b,e)),a}return T.cancel=P,T.flush=v,T}var uso="Expected a function";function dso(t,e,n){var o=!0,r=!0;if(typeof t!="function")throw new TypeError(uso);return oy(n)&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),ort(t,e,{leading:o,maxWait:e,trailing:r})}var fso=function(e,n,o){var r=o.getBoundingClientRect(),i=r.width,a=r.height,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,s=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=l-(o.getBoundingClientRect().left+window.pageXOffset),u=s-(o.getBoundingClientRect().top+window.pageYOffset);c<0?c=0:c>i&&(c=i),u<0?u=0:u>a&&(u=a);var d=c/i,f=1-u/a;return{h:n.h,s:d,v:f,a:n.a,source:"hsv"}},hso=function(){function t(e,n){for(var o=0;o=0,i=!n&&r&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return i?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(o=this.toRgbString()),e==="prgb"&&(o=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(o=this.toHexString()),e==="hex3"&&(o=this.toHexString(!0)),e==="hex4"&&(o=this.toHex8String(!0)),e==="hex8"&&(o=this.toHex8String()),e==="name"&&(o=this.toName()),e==="hsl"&&(o=this.toHslString()),e==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},clone:function(){return ti(this.toString())},_applyModification:function(e,n){var o=e.apply(null,[this].concat([].slice.call(n)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(Lso,arguments)},brighten:function(){return this._applyModification(Wso,arguments)},darken:function(){return this._applyModification(Nso,arguments)},desaturate:function(){return this._applyModification(Eso,arguments)},saturate:function(){return this._applyModification(Fso,arguments)},greyscale:function(){return this._applyModification(kso,arguments)},spin:function(){return this._applyModification(Uso,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(Yso,arguments)},complement:function(){return this._applyCombination(jso,arguments)},monochromatic:function(){return this._applyCombination(Oso,arguments)},splitcomplement:function(){return this._applyCombination(Bso,arguments)},triad:function(){return this._applyCombination(ZRe,[3])},tetrad:function(){return this._applyCombination(ZRe,[4])}};ti.fromRatio=function(t,e){if(rJ(t)=="object"){var n={};for(var o in t)t.hasOwnProperty(o)&&(o==="a"?n[o]=t[o]:n[o]=YD(t[o]));t=n}return ti(t,e)};function Hso(t){var e={r:0,g:0,b:0},n=1,o=null,r=null,i=null,a=!1,l=!1;return typeof t=="string"&&(t=Jso(t)),rJ(t)=="object"&&(s6(t.r)&&s6(t.g)&&s6(t.b)?(e=Mso(t.r,t.g,t.b),a=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):s6(t.h)&&s6(t.s)&&s6(t.v)?(o=YD(t.s),r=YD(t.v),e=zso(t.h,o,r),a=!0,l="hsv"):s6(t.h)&&s6(t.s)&&s6(t.l)&&(o=YD(t.s),i=YD(t.l),e=Iso(t.h,o,i),a=!0,l="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=irt(n),{ok:a,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}function Mso(t,e,n){return{r:Nc(t,255)*255,g:Nc(e,255)*255,b:Nc(n,255)*255}}function KRe(t,e,n){t=Nc(t,255),e=Nc(e,255),n=Nc(n,255);var o=Math.max(t,e,n),r=Math.min(t,e,n),i,a,l=(o+r)/2;if(o==r)i=a=0;else{var s=o-r;switch(a=l>.5?s/(2-o-r):s/(o+r),o){case t:i=(e-n)/s+(e1&&(d-=1),d<1/6?c+(u-c)*6*d:d<1/2?u:d<2/3?c+(u-c)*(2/3-d)*6:c}if(e===0)o=r=i=n;else{var l=n<.5?n*(1+e):n+e-n*e,s=2*n-l;o=a(s,l,t+1/3),r=a(s,l,t),i=a(s,l,t-1/3)}return{r:o*255,g:r*255,b:i*255}}function qRe(t,e,n){t=Nc(t,255),e=Nc(e,255),n=Nc(n,255);var o=Math.max(t,e,n),r=Math.min(t,e,n),i,a,l=o,s=o-r;if(a=o===0?0:s/o,o==r)i=0;else{switch(o){case t:i=(e-n)/s+(e>1)+720)%360;--e;)o.h=(o.h+r)%360,i.push(ti(o));return i}function Oso(t,e){e=e||6;for(var n=ti(t).toHsv(),o=n.h,r=n.s,i=n.v,a=[],l=1/e;e--;)a.push(ti({h:o,s:r,v:i})),i=(i+l)%1;return a}ti.mix=function(t,e,n){n=n===0?0:n||50;var o=ti(t).toRgb(),r=ti(e).toRgb(),i=n/100,a={r:(r.r-o.r)*i+o.r,g:(r.g-o.g)*i+o.g,b:(r.b-o.b)*i+o.b,a:(r.a-o.a)*i+o.a};return ti(a)};ti.readability=function(t,e){var n=ti(t),o=ti(e);return(Math.max(n.getLuminance(),o.getLuminance())+.05)/(Math.min(n.getLuminance(),o.getLuminance())+.05)};ti.isReadable=function(t,e,n){var o=ti.readability(t,e),r,i;switch(i=!1,r=Kso(n),r.level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7;break}return i};ti.mostReadable=function(t,e,n){var o=null,r=0,i,a,l,s;n=n||{},a=n.includeFallbackColors,l=n.level,s=n.size;for(var c=0;cr&&(r=i,o=ti(e[c]));return ti.isReadable(t,o,{level:l,size:s})||!a?o:(n.includeFallbackColors=!1,ti.mostReadable(t,["#fff","#000"],n))};var dfe=ti.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},_so=ti.hexNames=Vso(dfe);function Vso(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function irt(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Nc(t,e){Gso(t)&&(t="100%");var n=Xso(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function cee(t){return Math.min(1,Math.max(0,t))}function q1(t){return parseInt(t,16)}function Gso(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function Xso(t){return typeof t=="string"&&t.indexOf("%")!=-1}function C2(t){return t.length==1?"0"+t:""+t}function YD(t){return t<=1&&(t=t*100+"%"),t}function art(t){return Math.round(parseFloat(t)*255).toString(16)}function eHe(t){return q1(t)/255}var n2=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+o),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+o),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+o),hsva:new RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function s6(t){return!!n2.CSS_UNIT.exec(t)}function Jso(t){t=t.replace(Cso,"").replace(Rso,"").toLowerCase();var e=!1;if(dfe[t])t=dfe[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=n2.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=n2.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=n2.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=n2.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=n2.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=n2.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=n2.hex8.exec(t))?{r:q1(n[1]),g:q1(n[2]),b:q1(n[3]),a:eHe(n[4]),format:e?"name":"hex8"}:(n=n2.hex6.exec(t))?{r:q1(n[1]),g:q1(n[2]),b:q1(n[3]),format:e?"name":"hex"}:(n=n2.hex4.exec(t))?{r:q1(n[1]+""+n[1]),g:q1(n[2]+""+n[2]),b:q1(n[3]+""+n[3]),a:eHe(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=n2.hex3.exec(t))?{r:q1(n[1]+""+n[1]),g:q1(n[2]+""+n[2]),b:q1(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function Kso(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:e,size:n}}var tHe=function(e){var n=["r","g","b","a","h","s","l","v"],o=0,r=0;return Pso(n,function(i){if(e[i]&&(o+=1,isNaN(e[i])||(r+=1),i==="s"||i==="l")){var a=/^\d+%$/;a.test(e[i])&&(r+=1)}}),o===r?e:!1},OD=function(e,n){var o=e.hex?ti(e.hex):ti(e),r=o.toHsl(),i=o.toHsv(),a=o.toRgb(),l=o.toHex();r.s===0&&(r.h=n||0,i.h=n||0);var s=l==="000000"&&a.a===0;return{hsl:r,hex:s?"transparent":"#"+l,rgb:a,hsv:i,oldHue:e.h||n||r.h,source:e.source}},Jw=function(e){if(e==="transparent")return!0;var n=String(e).charAt(0)==="#"?1:0;return e.length!==4+n&&e.length<7+n&&ti(e).isValid()},f9e=function(e){if(!e)return"#fff";var n=OD(e);if(n.hex==="transparent")return"rgba(0,0,0,0.4)";var o=(n.rgb.r*299+n.rgb.g*587+n.rgb.b*114)/1e3;return o>=128?"#000":"#fff"},Lae=function(e,n){var o=e.replace("°","");return ti(n+" ("+o+")")._ok},Qz=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(o){oco(r,o);function r(){var i,a,l,s;nco(this,r);for(var c=arguments.length,u=Array(c),d=0;dl))return!1;var c=i.get(t),u=i.get(e);if(c&&u)return c==e&&u==t;var d=-1,f=!0,p=n&gco?new iJ:void 0;for(i.set(t,e),i.set(e,t);++d=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}var WO=24,z0o=mrt.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,o=t.width,r=o===void 0?WO:o,i=t.height,a=i===void 0?WO:i,l=t.style,s=l===void 0?{}:l,c=I0o(t,["fill","width","height","style"]);return wHe.default.createElement("svg",AHe({viewBox:"0 0 "+WO+" "+WO,style:AHe({fill:n,width:r,height:a},s)},c),wHe.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},D0o=function(){function t(e,n){for(var o=0;o1&&(r.a=1),o.props.onChange({h:o.props.hsl.h,s:o.props.hsl.s,l:o.props.hsl.l,a:Math.round(r.a*100)/100,source:"rgb"},i)):(r.h||r.s||r.l)&&(typeof r.s=="string"&&r.s.includes("%")&&(r.s=r.s.replace("%","")),typeof r.l=="string"&&r.l.includes("%")&&(r.l=r.l.replace("%","")),r.s==1?r.s=.01:r.l==1&&(r.l=.01),o.props.onChange({h:r.h||o.props.hsl.h,s:Number(yHe(r.s)?o.props.hsl.s:r.s),l:Number(yHe(r.l)?o.props.hsl.l:r.l),source:"hsl"},i))},o.showHighlight=function(r){r.currentTarget.style.background="#eee"},o.hideHighlight=function(r){r.currentTarget.style.background="transparent"},n.hsl.a!==1&&n.view==="hex"?o.state={view:"rgb"}:o.state={view:n.view},o}return D0o(e,[{key:"render",value:function(){var o=this,r=qi({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),i=void 0;return this.state.view==="hex"?i=be.createElement("div",{style:r.fields,className:"flexbox-fix"},be.createElement("div",{style:r.field},be.createElement(ul,{style:{input:r.input,label:r.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?i=be.createElement("div",{style:r.fields,className:"flexbox-fix"},be.createElement("div",{style:r.field},be.createElement(ul,{style:{input:r.input,label:r.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),be.createElement("div",{style:r.field},be.createElement(ul,{style:{input:r.input,label:r.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),be.createElement("div",{style:r.field},be.createElement(ul,{style:{input:r.input,label:r.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),be.createElement("div",{style:r.alpha},be.createElement(ul,{style:{input:r.input,label:r.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(i=be.createElement("div",{style:r.fields,className:"flexbox-fix"},be.createElement("div",{style:r.field},be.createElement(ul,{style:{input:r.input,label:r.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),be.createElement("div",{style:r.field},be.createElement(ul,{style:{input:r.input,label:r.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),be.createElement("div",{style:r.field},be.createElement(ul,{style:{input:r.input,label:r.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),be.createElement("div",{style:r.alpha},be.createElement(ul,{style:{input:r.input,label:r.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),be.createElement("div",{style:r.wrap,className:"flexbox-fix"},i,be.createElement("div",{style:r.toggle},be.createElement("div",{style:r.icon,onClick:this.toggleViews,ref:function(l){return o.icon=l}},be.createElement(z0o,{style:r.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(o,r){return o.hsl.a!==1&&r.view==="hex"?{view:"rgb"}:null}}]),e}(be.Component);yrt.defaultProps={view:"hex"};var vHe=function(){var e=qi({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return be.createElement("div",{style:e.picker})},L0o=function(){var e=qi({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return be.createElement("div",{style:e.picker})},A9e=function(e){var n=e.width,o=e.onChange,r=e.disableAlpha,i=e.rgb,a=e.hsl,l=e.hsv,s=e.hex,c=e.renderers,u=e.styles,d=u===void 0?{}:u,f=e.className,p=f===void 0?"":f,g=e.defaultView,y=qi(g1({default:{picker:{width:n,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+i.r+", "+i.g+", "+i.b+", "+i.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},d),{disableAlpha:r});return be.createElement("div",{style:y.picker,className:"chrome-picker "+p},be.createElement("div",{style:y.saturation},be.createElement(see,{style:y.Saturation,hsl:a,hsv:l,pointer:L0o,onChange:o})),be.createElement("div",{style:y.body},be.createElement("div",{style:y.controls,className:"flexbox-fix"},be.createElement("div",{style:y.color},be.createElement("div",{style:y.swatch},be.createElement("div",{style:y.active}),be.createElement(bM,{renderers:c}))),be.createElement("div",{style:y.toggles},be.createElement("div",{style:y.hue},be.createElement(SM,{style:y.Hue,hsl:a,pointer:vHe,onChange:o})),be.createElement("div",{style:y.alpha},be.createElement(r9e,{style:y.Alpha,rgb:i,hsl:a,pointer:vHe,renderers:c,onChange:o})))),be.createElement(yrt,{rgb:i,hsl:a,hex:s,view:g,onChange:o,disableAlpha:r})))};A9e.propTypes={width:go.oneOfType([go.string,go.number]),disableAlpha:go.bool,styles:go.object,defaultView:go.oneOf(["hex","rgb","hsl"])};A9e.defaultProps={width:225,disableAlpha:!1,styles:{}};m1(A9e);var W0o=function(e){var n=e.color,o=e.onClick,r=o===void 0?function(){}:o,i=e.onSwatchHover,a=e.active,l=qi({default:{color:{background:n,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:f9e(n),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:a,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return be.createElement(oS,{style:l.color,color:n,onClick:r,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},be.createElement("div",{style:l.dot}))},N0o=function(e){var n=e.hex,o=e.rgb,r=e.onChange,i=qi({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:n},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),a=function(s,c){s.r||s.g||s.b?r({r:s.r||o.r,g:s.g||o.g,b:s.b||o.b,source:"rgb"},c):r({hex:s.hex,source:"hex"},c)};return be.createElement("div",{style:i.fields,className:"flexbox-fix"},be.createElement("div",{style:i.active}),be.createElement(ul,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"hex",value:n,onChange:a}),be.createElement(ul,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:o.r,onChange:a}),be.createElement(ul,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:o.g,onChange:a}),be.createElement(ul,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:o.b,onChange:a}))},w9e=function(e){var n=e.onChange,o=e.onSwatchHover,r=e.colors,i=e.hex,a=e.rgb,l=e.styles,s=l===void 0?{}:l,c=e.className,u=c===void 0?"":c,d=qi(g1({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},s)),f=function(g,y){g.hex?Jw(g.hex)&&n({hex:g.hex,source:"hex"},y):n(g,y)};return be.createElement(qN,{style:d.Compact,styles:s},be.createElement("div",{style:d.compact,className:"compact-picker "+u},be.createElement("div",null,rS(r,function(p){return be.createElement(W0o,{key:p,color:p,active:p.toLowerCase()===i,onClick:f,onSwatchHover:o})}),be.createElement("div",{style:d.clear})),be.createElement(N0o,{hex:i,rgb:a,onChange:f})))};w9e.propTypes={colors:go.arrayOf(go.string),styles:go.object};w9e.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};const zf=m1(w9e);var U0o=function(e){var n=e.hover,o=e.color,r=e.onClick,i=e.onSwatchHover,a={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},l=qi({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:a}},{hover:n});return be.createElement("div",{style:l.swatch},be.createElement(oS,{color:o,onClick:r,onHover:i,focusStyle:a}))};const j0o=o9e(U0o);var v9e=function(e){var n=e.width,o=e.colors,r=e.onChange,i=e.onSwatchHover,a=e.triangle,l=e.styles,s=l===void 0?{}:l,c=e.className,u=c===void 0?"":c,d=qi(g1({default:{card:{width:n,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},s),{"hide-triangle":a==="hide","top-left-triangle":a==="top-left","top-right-triangle":a==="top-right","bottom-left-triangle":a==="bottom-left","bottom-right-triangle":a==="bottom-right"}),f=function(g,y){return r({hex:g,source:"hex"},y)};return be.createElement("div",{style:d.card,className:"github-picker "+u},be.createElement("div",{style:d.triangleShadow}),be.createElement("div",{style:d.triangle}),rS(o,function(p){return be.createElement(j0o,{color:p,key:p,onClick:f,onSwatchHover:i})}))};v9e.propTypes={width:go.oneOfType([go.string,go.number]),colors:go.arrayOf(go.string),triangle:go.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:go.object};v9e.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};m1(v9e);var B0o=function(e){var n=e.direction,o=qi({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:n==="vertical"});return be.createElement("div",{style:o.picker})},Y0o=Object.assign||function(t){for(var e=1;e.5});return be.createElement("div",{style:o.picker})},G0o=function(){var e=qi({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return be.createElement("div",{style:e.pointer},be.createElement("div",{style:e.left},be.createElement("div",{style:e.leftInside})),be.createElement("div",{style:e.right},be.createElement("div",{style:e.rightInside})))},xHe=function(e){var n=e.onClick,o=e.label,r=e.children,i=e.active,a=qi({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:i});return be.createElement("div",{style:a.button,onClick:n},o||r)},X0o=function(e){var n=e.rgb,o=e.currentColor,r=qi({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+n.r+","+n.g+", "+n.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:o,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return be.createElement("div",null,be.createElement("div",{style:r.label},"new"),be.createElement("div",{style:r.swatches},be.createElement("div",{style:r.new}),be.createElement("div",{style:r.current})),be.createElement("div",{style:r.label},"current"))},J0o=function(){function t(e,n){for(var o=0;o100&&(u.a=100),u.a/=100,n({h:r.h,s:r.s,l:r.l,a:u.a,source:"rgb"},d))};return be.createElement("div",{style:l.fields,className:"flexbox-fix"},be.createElement("div",{style:l.double},be.createElement(ul,{style:{input:l.input,label:l.label},label:"hex",value:i.replace("#",""),onChange:s})),be.createElement("div",{style:l.single},be.createElement(ul,{style:{input:l.input,label:l.label},label:"r",value:o.r,onChange:s,dragLabel:"true",dragMax:"255"})),be.createElement("div",{style:l.single},be.createElement(ul,{style:{input:l.input,label:l.label},label:"g",value:o.g,onChange:s,dragLabel:"true",dragMax:"255"})),be.createElement("div",{style:l.single},be.createElement(ul,{style:{input:l.input,label:l.label},label:"b",value:o.b,onChange:s,dragLabel:"true",dragMax:"255"})),be.createElement("div",{style:l.alpha},be.createElement(ul,{style:{input:l.input,label:l.label},label:"a",value:Math.round(o.a*100),onChange:s,dragLabel:"true",dragMax:"100"})))},Z0o=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}var NO=24,auo=wrt.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,o=t.width,r=o===void 0?NO:o,i=t.height,a=i===void 0?NO:i,l=t.style,s=l===void 0?{}:l,c=iuo(t,["fill","width","height","style"]);return SHe.default.createElement("svg",bHe({viewBox:"0 0 "+NO+" "+NO,style:bHe({fill:n,width:r,height:a},s)},c),SHe.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},luo=function(e){var n=e.color,o=e.onClick,r=o===void 0?function(){}:o,i=e.onSwatchHover,a=e.first,l=e.last,s=e.active,c=qi({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:n,marginBottom:"1px"},check:{color:f9e(n),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:a,last:l,active:s,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return be.createElement(oS,{color:n,style:c.color,onClick:r,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},be.createElement("div",{style:c.check},be.createElement(auo,null)))},suo=function(e){var n=e.onClick,o=e.onSwatchHover,r=e.group,i=e.active,a=qi({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return be.createElement("div",{style:a.group},rS(r,function(l,s){return be.createElement(luo,{key:l,color:l,active:l.toLowerCase()===i,first:s===0,last:s===r.length-1,onClick:n,onSwatchHover:o})}))},P9e=function(e){var n=e.width,o=e.height,r=e.onChange,i=e.onSwatchHover,a=e.colors,l=e.hex,s=e.styles,c=s===void 0?{}:s,u=e.className,d=u===void 0?"":u,f=qi(g1({default:{picker:{width:n,height:o},overflow:{height:o,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},c)),p=function(y,w){return r({hex:y,source:"hex"},w)};return be.createElement("div",{style:f.picker,className:"swatches-picker "+d},be.createElement(qN,null,be.createElement("div",{style:f.overflow},be.createElement("div",{style:f.body},rS(a,function(g){return be.createElement(suo,{key:g.toString(),group:g,active:l,onClick:p,onSwatchHover:i})}),be.createElement("div",{style:f.clear})))))};P9e.propTypes={width:go.oneOfType([go.string,go.number]),height:go.oneOfType([go.string,go.number]),colors:go.arrayOf(go.arrayOf(go.string)),styles:go.object};P9e.defaultProps={width:320,height:240,colors:[[fP[900],fP[700],fP[500],fP[300],fP[100]],[hP[900],hP[700],hP[500],hP[300],hP[100]],[pP[900],pP[700],pP[500],pP[300],pP[100]],[gP[900],gP[700],gP[500],gP[300],gP[100]],[mP[900],mP[700],mP[500],mP[300],mP[100]],[yP[900],yP[700],yP[500],yP[300],yP[100]],[AP[900],AP[700],AP[500],AP[300],AP[100]],[wP[900],wP[700],wP[500],wP[300],wP[100]],[vP[900],vP[700],vP[500],vP[300],vP[100]],["#194D33",_D[700],_D[500],_D[300],_D[100]],[xP[900],xP[700],xP[500],xP[300],xP[100]],[bP[900],bP[700],bP[500],bP[300],bP[100]],[SP[900],SP[700],SP[500],SP[300],SP[100]],[TP[900],TP[700],TP[500],TP[300],TP[100]],[PP[900],PP[700],PP[500],PP[300],PP[100]],[CP[900],CP[700],CP[500],CP[300],CP[100]],[RP[900],RP[700],RP[500],RP[300],RP[100]],[HP[900],HP[700],HP[500],HP[300],HP[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};m1(P9e);var C9e=function(e){var n=e.onChange,o=e.onSwatchHover,r=e.hex,i=e.colors,a=e.width,l=e.triangle,s=e.styles,c=s===void 0?{}:s,u=e.className,d=u===void 0?"":u,f=qi(g1({default:{card:{width:a,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},c),{"hide-triangle":l==="hide","top-left-triangle":l==="top-left","top-right-triangle":l==="top-right"}),p=function(y,w){Jw(y)&&n({hex:y,source:"hex"},w)};return be.createElement("div",{style:f.card,className:"twitter-picker "+d},be.createElement("div",{style:f.triangleShadow}),be.createElement("div",{style:f.triangle}),be.createElement("div",{style:f.body},rS(i,function(g,y){return be.createElement(oS,{key:y,color:g,hex:g,style:f.swatch,onClick:p,onHover:o,focusStyle:{boxShadow:"0 0 4px "+g}})}),be.createElement("div",{style:f.hash},"#"),be.createElement(ul,{label:null,style:{input:f.input},value:r.replace("#",""),onChange:p}),be.createElement("div",{style:f.clear})))};C9e.propTypes={width:go.oneOfType([go.string,go.number]),triangle:go.oneOf(["hide","top-left","top-right"]),colors:go.arrayOf(go.string),styles:go.object};C9e.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};m1(C9e);var R9e=function(e){var n=qi({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(e.hsl.h)+", "+Math.round(e.hsl.s*100)+"%, "+Math.round(e.hsl.l*100)+"%)"}}});return be.createElement("div",{style:n.picker})};R9e.propTypes={hsl:go.shape({h:go.number,s:go.number,l:go.number,a:go.number})};R9e.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var H9e=function(e){var n=qi({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(e.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return be.createElement("div",{style:n.picker})};H9e.propTypes={hsl:go.shape({h:go.number,s:go.number,l:go.number,a:go.number})};H9e.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var cuo=function(e){var n=e.onChange,o=e.rgb,r=e.hsl,i=e.hex,a=e.hsv,l=function(p,g){if(p.hex)Jw(p.hex)&&n({hex:p.hex,source:"hex"},g);else if(p.rgb){var y=p.rgb.split(",");Lae(p.rgb,"rgb")&&n({r:y[0],g:y[1],b:y[2],a:1,source:"rgb"},g)}else if(p.hsv){var w=p.hsv.split(",");Lae(p.hsv,"hsv")&&(w[2]=w[2].replace("%",""),w[1]=w[1].replace("%",""),w[0]=w[0].replace("°",""),w[1]==1?w[1]=.01:w[2]==1&&(w[2]=.01),n({h:Number(w[0]),s:Number(w[1]),v:Number(w[2]),source:"hsv"},g))}else if(p.hsl){var b=p.hsl.split(",");Lae(p.hsl,"hsl")&&(b[2]=b[2].replace("%",""),b[1]=b[1].replace("%",""),b[0]=b[0].replace("°",""),d[1]==1?d[1]=.01:d[2]==1&&(d[2]=.01),n({h:Number(b[0]),s:Number(b[1]),v:Number(b[2]),source:"hsl"},g))}},s=qi({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),c=o.r+", "+o.g+", "+o.b,u=Math.round(r.h)+"°, "+Math.round(r.s*100)+"%, "+Math.round(r.l*100)+"%",d=Math.round(a.h)+"°, "+Math.round(a.s*100)+"%, "+Math.round(a.v*100)+"%";return be.createElement("div",{style:s.wrap,className:"flexbox-fix"},be.createElement("div",{style:s.fields},be.createElement("div",{style:s.double},be.createElement(ul,{style:{input:s.input,label:s.label},label:"hex",value:i,onChange:l})),be.createElement("div",{style:s.column},be.createElement("div",{style:s.single},be.createElement(ul,{style:{input:s.input2,label:s.label2},label:"rgb",value:c,onChange:l})),be.createElement("div",{style:s.single},be.createElement(ul,{style:{input:s.input2,label:s.label2},label:"hsv",value:d,onChange:l})),be.createElement("div",{style:s.single},be.createElement(ul,{style:{input:s.input2,label:s.label2},label:"hsl",value:u,onChange:l})))))},M9e=function(e){var n=e.width,o=e.onChange,r=e.rgb,i=e.hsl,a=e.hsv,l=e.hex,s=e.header,c=e.styles,u=c===void 0?{}:c,d=e.className,f=d===void 0?"":d,p=qi(g1({default:{picker:{width:n,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+r.r+", "+r.g+", "+r.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},u));return be.createElement("div",{style:p.picker,className:"google-picker "+f},be.createElement("div",{style:p.head},s),be.createElement("div",{style:p.swatch}),be.createElement("div",{style:p.saturation},be.createElement(see,{hsl:i,hsv:a,pointer:R9e,onChange:o})),be.createElement("div",{style:p.body},be.createElement("div",{style:p.controls,className:"flexbox-fix"},be.createElement("div",{style:p.hue},be.createElement(SM,{style:p.Hue,hsl:i,radius:"4px",pointer:H9e,onChange:o}))),be.createElement(cuo,{rgb:r,hsl:i,hex:l,hsv:a,onChange:o})))};M9e.propTypes={width:go.oneOfType([go.string,go.number]),styles:go.object,header:go.string};M9e.defaultProps={width:652,styles:{},header:"Color picker"};m1(M9e);const uuo=({setDialogVisible:t})=>{const e=H(fn),n=H(oYe),o=H(Gn),r=H(rYe),i=H(En),a=H($s),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState((s==null?void 0:s.color)??"#808080"),d=Jt(),f=b=>{switch(a){case oe.AllSelectedObjectsOfThisType:{for(const C of H.getState().elements)if(C.type===z.Foundation&&!C.locked&&H.getState().selectedElementIdSet.has(C.id)&&b!==C.color)return!0;break}case oe.AllObjectsOfThisType:for(const C of H.getState().elements)if(C.type===z.Foundation&&!C.locked&&b!==C.color)return!0;break;default:if(b!==(s==null?void 0:s.color))return!0}return!1},p=(b,C)=>{H.getState().set(P=>{for(const v of P.elements)if(v.type===z.Foundation&&b.has(v.id))if(C!==void 0)v.color=C;else{const T=b.get(v.id);T!==void 0&&(v.color=T)}})},g=b=>{if(s&&f(b)){switch(a){case oe.AllSelectedObjectsOfThisType:{const C=new Map;for(const v of H.getState().elements)v.type===z.Foundation&&H.getState().selectedElementIdSet.has(v.id)&&C.set(v.id,v.color??"#808080");const P={name:"Set Color for Selected Foundations",timestamp:Date.now(),oldValues:C,newValue:b,undo:()=>{p(P.oldValues)},redo:()=>{p(P.oldValues,P.newValue)}};i(P),p(C,b),l(H.getState().applyCount+1);break}case oe.AllObjectsOfThisType:{const C=new Map;for(const v of H.getState().elements)v.type===z.Foundation&&C.set(v.id,v.color??"#808080");const P={name:"Set Color for All Foundations",timestamp:Date.now(),oldValues:C,newValue:b,undo:()=>{for(const[v,T]of P.oldValues.entries())n(v,T)},redo:()=>{r(z.Foundation,P.newValue)}};i(P),r(z.Foundation,b),l(H.getState().applyCount+1);break}default:{const C=o(s.id),P=C?C.color:s.color,v={name:"Set Color of Selected Foundation",timestamp:Date.now(),oldValue:P,newValue:b,changedElementId:s.id,changedElementType:s.type,undo:()=>{n(v.changedElementId,v.oldValue)},redo:()=>{n(v.changedElementId,v.newValue)}};i(v),n(s.id,b),l(H.getState().applyCount+1);break}}e(C=>{C.actionState.foundationColor=b})}},y=()=>{g(c)},w=()=>{t(!1)};return h.jsx(so,{width:600,title:Y.t("word.Color",d),onApply:y,onClose:w,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(zf,{color:c,onChangeComplete:b=>{u(b.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:12,children:h.jsx(Ue.Group,{onChange:b=>H.getState().setFoundationActionScope(b.target.value),value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},duo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(tYe),r=H(u3),i=H(gW),a=H(zw),l=H(EH),s=H(c3),c=H(En),u=H($s),d=H(fn),f=H(no),p=H(Zn),g=H(Vi),y=co(z.Foundation),[w,b]=m.useState((y==null?void 0:y.lx)??.1),C=m.useRef(new Map),P=m.useRef(new Map),v=m.useRef(new Map),T=m.useRef(new Map),A=m.useRef(new Map),x=m.useRef(new Map),S=m.useRef(new Map),R=m.useRef(new Map),M=m.useRef(!1),D=m.useRef(),E=Jt(),W=te=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:{for(const re of e)if(re.type===z.Foundation&&H.getState().selectedElementIdSet.has(re.id)){const ae=re,se=l(ae.id);if(se.length>0&&!me.doesNewSizeContainAllChildren(ae,se,te,ae.ly))return!1}break}case oe.AllObjectsOfThisType:{for(const re of e)if(re.type===z.Foundation){const ae=re,se=l(ae.id);if(se.length>0&&!me.doesNewSizeContainAllChildren(ae,se,te,ae.ly))return!1}break}default:{const re=l(y.id);if(re.length>0)return me.doesNewSizeContainAllChildren(y,re,te,y.ly);break}}return!0}},j=te=>!W(te),L=te=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:for(const re of e)if(re.type===z.Foundation&&!re.locked&&H.getState().selectedElementIdSet.has(re.id)&&Math.abs(re.lx-te)>It)return!0;break;case oe.AllObjectsOfThisType:for(const re of e)if(re.type===z.Foundation&&!re.locked&&Math.abs(re.lx-te)>It)return!0;break;default:if(Math.abs((y==null?void 0:y.lx)-te)>It)return!0}return!1}},k=(te,re)=>{if(te==null)return null;for(const ae of te.children)if(ae.name.includes(`${re}`))return ae;return null},N=(te,re,ae)=>{var se,ne;if(te){for(const fe of te.children)if(fe.name.includes(`${ae.id}`)){(ne=(se=Fn.getState().contentRef)==null?void 0:se.current)==null||ne.add(fe);break}d(fe=>{for(const ge of fe.elements)if(ge.id===ae.id){ge.parentId=Zo;const de=new Xt(ge.cx,ge.cy).rotateAround(si,re.rotation[2]).add(new Xt(re.cx,re.cy));ge.cx=de.x,ge.cy=de.y,ge.cz=0,T.current.set(ge.id,new ie(de.x,de.y,0)),P.current.set(ge.id,Zo);break}})}},F=(te,re)=>{const ae=l(te.id),se=te.rotation[2];if(A.current.clear(),R.current.clear(),ae.length>0)for(const ne of ae)switch(ne.type){case z.Wall:break;case z.SolarPanel:case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:case z.Sensor:{const fe=new Xt(ne.cx*te.lx,ne.cy*te.ly).rotateAround(si,se);A.current.set(ne.id,fe),v.current.set(ne.id,new ie(ne.cx,ne.cy));break}case z.Polygon:{const fe=ne,ge=[];for(const de of fe.vertices)ge.push(new Xt(de.x*te.lx,de.y*te.ly).rotateAround(si,se));R.current.set(ne.id,ge),x.current.set(ne.id,fe.vertices.map(de=>({...de})));break}case z.Human:case z.Tree:{v.current.set(ne.id,new ie(ne.cx,ne.cy,ne.cz));break}}if(r(te.id,re),ae.length>0)for(const ne of ae)switch(ne.type){case z.Wall:break;case z.SolarPanel:case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:case z.Sensor:{const fe=A.current.get(ne.id);if(fe){const de=new Xt(fe.x,fe.y).rotateAround(si,-se).x/re;o(ne.id,de),T.current.set(ne.id,new ie(de,ne.cy))}break}case z.Polygon:{const fe=R.current.get(ne.id);if(fe){const ge=[];for(const de of fe){const Z=de.rotateAround(si,-se),he=Z.x/re,xe=Z.y/te.ly;ge.push({x:he,y:xe})}a(ne.id,ge),S.current.set(ne.id,ge.map(de=>({...de})))}break}case z.Human:case z.Tree:{if(T.current.set(ne.id,new ie(ne.cx,ne.cy,ne.cz)),C.current.set(ne.id,te.id),Math.abs(ne.cz-te.lz/2)0){const fe=Fn.getState().contentRef,ge=k(fe==null?void 0:fe.current,te.id);N(ge,te,ne)}}else if(Math.abs(Math.abs(ne.cx)-te.lx/2)0?re:-re)/2;o(ne.id,fe),T.current.set(ne.id,new ie(fe,ne.cy,ne.cz))}break}}},U=(te,re,ae)=>{if(!te||!re)return;const se=Fn.getState().contentRef,ne=k(se==null?void 0:se.current,re),fe=k(re===Zo?se==null?void 0:se.current:ne,ae);if(fe&&(se!=null&&se.current)){if(te===Zo)se.current.add(fe);else{const ge=k(se.current,te);ge==null||ge.add(fe)}np()}},O=(te,re)=>{te&&d(ae=>{for(const se of ae.elements)if(se.id===re){se.parentId=te;break}})},B=(te,re)=>{H.getState().set(ae=>{for(const se of ae.elements)if(te.has(se.id))if(re!==void 0)se.lx=re;else{const ne=te.get(se.id);ne!==void 0&&(se.lx=ne)}})},_=te=>{if(!y||!L(te))return;const re=n(y.id),ae=re?re.lx:y.lx;if(D.current=void 0,M.current=j(te),M.current)D.current=te,b(ae);else switch(v.current.clear(),T.current.clear(),x.current.clear(),S.current.clear(),u){case oe.AllSelectedObjectsOfThisType:{const se=new Map;for(const fe of e)fe.type===z.Foundation&&H.getState().selectedElementIdSet.has(fe.id)&&se.set(fe.id,fe.lx);for(const fe of e)fe.type===z.Foundation&&H.getState().selectedElementIdSet.has(fe.id)&&F(fe,te);const ne={name:"Set Length for Selected Foundations",timestamp:Date.now(),oldSizes:se,newSize:te,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var fe,ge;if(B(ne.oldSizes),ne.oldChildrenPositionsMap&&ne.oldChildrenPositionsMap.size>0)for(const[de,Z]of ne.oldChildrenPositionsMap.entries()){s(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(U(he,xe,de),O(he,de))}if(ne.oldChildrenVerticesMap&&ne.oldChildrenVerticesMap.size>0)for(const[de,Z]of ne.oldChildrenVerticesMap.entries())a(de,Z)},redo:()=>{var fe,ge;if(B(ne.oldSizes,ne.newSize),ne.newChildrenPositionsMap&&ne.newChildrenPositionsMap.size>0)for(const[de,Z]of ne.newChildrenPositionsMap.entries()){s(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(U(xe,he,de),O(xe,de))}if(ne.newChildrenVerticesMap&&ne.newChildrenVerticesMap.size>0)for(const[de,Z]of ne.newChildrenVerticesMap.entries())a(de,Z)}};c(ne),p(f+1);break}case oe.AllObjectsOfThisType:{const se=new Map;for(const fe of e)fe.type===z.Foundation&&se.set(fe.id,fe.lx);for(const fe of e)fe.type===z.Foundation&&F(fe,te);const ne={name:"Set Length for All Foundations",timestamp:Date.now(),oldSizes:se,newSize:te,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var fe,ge;for(const[de,Z]of ne.oldSizes.entries())r(de,Z);if(ne.oldChildrenPositionsMap&&ne.oldChildrenPositionsMap.size>0)for(const[de,Z]of ne.oldChildrenPositionsMap.entries()){s(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(U(he,xe,de),O(he,de))}if(ne.oldChildrenVerticesMap&&ne.oldChildrenVerticesMap.size>0)for(const[de,Z]of ne.oldChildrenVerticesMap.entries())a(de,Z)},redo:()=>{var fe,ge;if(i(z.Foundation,ne.newSize),ne.newChildrenPositionsMap&&ne.newChildrenPositionsMap.size>0)for(const[de,Z]of ne.newChildrenPositionsMap.entries()){s(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(U(xe,he,de),O(xe,de))}if(ne.newChildrenVerticesMap&&ne.newChildrenVerticesMap.size>0)for(const[de,Z]of ne.newChildrenVerticesMap.entries())a(de,Z)}};c(ne),p(f+1);break}default:{F(y,te);const se={name:"Set Foundation Length",timestamp:Date.now(),oldSize:ae,newSize:te,resizedElementId:y.id,resizedElementType:y.type,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ne,fe;if(r(y.id,se.oldSize),se.oldChildrenPositionsMap&&se.oldChildrenPositionsMap.size>0)for(const[ge,de]of se.oldChildrenPositionsMap.entries()){s(ge,de.x,de.y,de.z);const Z=(ne=se.oldChildrenParentIdMap)==null?void 0:ne.get(ge),he=(fe=se.newChildrenParentIdMap)==null?void 0:fe.get(ge);Z&&he&&Z!==he&&(U(Z,he,ge),O(Z,ge))}if(se.oldChildrenVerticesMap&&se.oldChildrenVerticesMap.size>0)for(const[ge,de]of se.oldChildrenVerticesMap.entries())a(ge,de)},redo:()=>{var ne,fe;if(r(y.id,se.newSize),se.newChildrenPositionsMap&&se.newChildrenPositionsMap.size>0)for(const[ge,de]of se.newChildrenPositionsMap.entries()){s(ge,de.x,de.y,de.z);const Z=(ne=se.oldChildrenParentIdMap)==null?void 0:ne.get(ge),he=(fe=se.newChildrenParentIdMap)==null?void 0:fe.get(ge);Z&&he&&Z!==he&&(U(he,Z,ge),O(he,ge))}if(se.newChildrenVerticesMap&&se.newChildrenVerticesMap.size>0)for(const[ge,de]of se.newChildrenVerticesMap.entries())a(ge,de)}};c(se),p(f+1);break}}},X=()=>{t(!1)},$=()=>{X(),g()},Q=()=>{_(w),M.current||(t(!1),p(0))},le=()=>{_(w)},q=M.current?": "+Y.t("message.NotApplicableToSelectedAction",E)+(D.current!==void 0?" ("+D.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Length",E),rejectedMessage:q,onApply:le,onClose:X,onClickCancel:$,onClickOk:Q,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:1e3,style:{width:120},step:.5,precision:2,value:w,onChange:te=>{te!==null&&b(te)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",E),": [0.1, 1000] ",Y.t("word.MeterAbbreviation",E)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",E)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:te=>H.getState().setFoundationActionScope(te.target.value),value:u,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",E)})]})})})]})})},fuo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(c3),r=H(nYe),i=H(Iw),a=H(mW),l=H(zw),s=H(EH),c=H(En),u=H($s),d=H(fn),f=H(no),p=H(Zn),g=H(Vi),y=co(z.Foundation),[w,b]=m.useState((y==null?void 0:y.ly)??.1),C=m.useRef(new Map),P=m.useRef(new Map),v=m.useRef(new Map),T=m.useRef(new Map),A=m.useRef(new Map),x=m.useRef(new Map),S=m.useRef(new Map),R=m.useRef(new Map),M=m.useRef(!1),D=m.useRef(),E=Jt(),W=q=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:{for(const te of e)if(te.type===z.Foundation&&H.getState().selectedElementIdSet.has(te.id)){const re=te,ae=s(re.id);if(ae.length>0&&!me.doesNewSizeContainAllChildren(re,ae,re.lx,q))return!1}break}case oe.AllObjectsOfThisType:{for(const te of e)if(te.type===z.Foundation){const re=te,ae=s(re.id);if(ae.length>0&&!me.doesNewSizeContainAllChildren(re,ae,re.lx,q))return!1}break}default:{const te=s(y.id);if(te.length>0)return me.doesNewSizeContainAllChildren(y,te,y.lx,q);break}}return!0}},j=q=>!W(q),L=q=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:for(const te of e)if(te.type===z.Foundation&&!te.locked&&H.getState().selectedElementIdSet.has(te.id)&&Math.abs(te.ly-q)>It)return!0;break;case oe.AllObjectsOfThisType:for(const te of e)if(te.type===z.Foundation&&!te.locked&&Math.abs(te.ly-q)>It)return!0;break;default:if(Math.abs((y==null?void 0:y.ly)-q)>It)return!0}return!1}},k=(q,te)=>{if(q==null)return null;for(const re of q.children)if(re.name.includes(`${te}`))return re;return null},N=(q,te,re)=>{var ae,se;if(q){for(const ne of q.children)if(ne.name.includes(`${re.id}`)){(se=(ae=Fn.getState().contentRef)==null?void 0:ae.current)==null||se.add(ne);break}d(ne=>{for(const fe of ne.elements)if(fe.id===re.id){fe.parentId=Zo;const ge=new Xt(fe.cx,fe.cy).rotateAround(si,te.rotation[2]).add(new Xt(te.cx,te.cy));fe.cx=ge.x,fe.cy=ge.y,fe.cz=0,T.current.set(fe.id,new ie(ge.x,ge.y,0)),P.current.set(fe.id,Zo);break}})}},F=(q,te)=>{const re=s(q.id),ae=q.rotation[2];if(A.current.clear(),R.current.clear(),re.length>0)for(const se of re)switch(se.type){case z.Wall:break;case z.SolarPanel:case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:case z.Sensor:{const ne=new Xt(se.cx*q.lx,se.cy*q.ly).rotateAround(si,ae);A.current.set(se.id,ne),v.current.set(se.id,new ie(se.cx,se.cy));break}case z.Polygon:{const ne=se,fe=[];for(const ge of ne.vertices)fe.push(new Xt(ge.x*q.lx,ge.y*q.ly).rotateAround(si,ae));R.current.set(se.id,fe),x.current.set(se.id,ne.vertices.map(ge=>({...ge})));break}case z.Human:case z.Tree:{v.current.set(se.id,new ie(se.cx,se.cy,se.cz));break}}if(i(q.id,te),re.length>0)for(const se of re)switch(se.type){case z.Wall:break;case z.SolarPanel:case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:case z.Sensor:{const ne=A.current.get(se.id);if(ne){const ge=new Xt(ne.x,ne.y).rotateAround(si,-ae).y/te;r(se.id,ge),T.current.set(se.id,new ie(se.cx,ge))}break}case z.Polygon:{const ne=R.current.get(se.id);if(ne){const fe=[];for(const ge of ne){const de=ge.rotateAround(si,-ae),Z=de.x/q.lx,he=de.y/te;fe.push({x:Z,y:he})}l(se.id,fe),S.current.set(se.id,fe.map(ge=>({...ge})))}break}case z.Human:case z.Tree:{if(T.current.set(se.id,new ie(se.cx,se.cy,se.cz)),C.current.set(se.id,q.id),Math.abs(se.cz-q.lz/2)0){const ne=Fn.getState().contentRef,fe=k(ne==null?void 0:ne.current,q.id);N(fe,q,se)}}else if(Math.abs(Math.abs(se.cy)-q.ly/2)0?te:-te)/2;r(se.id,ne),T.current.set(se.id,new ie(se.cz,ne,se.cz))}break}}},U=(q,te,re)=>{if(!q||!te)return;const ae=Fn.getState().contentRef,se=k(ae==null?void 0:ae.current,te),ne=k(te===Zo?ae==null?void 0:ae.current:se,re);if(ne&&(ae!=null&&ae.current)){if(q===Zo)ae.current.add(ne);else{const fe=k(ae.current,q);fe==null||fe.add(ne)}np()}},O=(q,te)=>{q&&d(re=>{for(const ae of re.elements)if(ae.id===te){ae.parentId=q;break}})},B=q=>{if(!y||!L(q))return;const te=n(y.id),re=te?te.ly:y.ly;if(D.current=void 0,M.current=j(q),M.current)D.current=q,b(re);else switch(v.current.clear(),T.current.clear(),x.current.clear(),S.current.clear(),u){case oe.AllSelectedObjectsOfThisType:{const ae=new Map;for(const ne of e)ne.type===z.Foundation&&H.getState().selectedElementIdSet.has(ne.id)&&ae.set(ne.id,ne.ly);for(const ne of e)ne.type===z.Foundation&&H.getState().selectedElementIdSet.has(ne.id)&&F(ne,q);const se={name:"Set Width for Selected Foundations",timestamp:Date.now(),oldSizes:ae,newSize:q,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ne,fe;for(const[ge,de]of se.oldSizes.entries())i(ge,de);if(se.oldChildrenPositionsMap&&se.oldChildrenPositionsMap.size>0)for(const[ge,de]of se.oldChildrenPositionsMap.entries()){o(ge,de.x,de.y,de.z);const Z=(ne=se.oldChildrenParentIdMap)==null?void 0:ne.get(ge),he=(fe=se.newChildrenParentIdMap)==null?void 0:fe.get(ge);Z&&he&&Z!==he&&(U(Z,he,ge),O(Z,ge))}if(se.oldChildrenVerticesMap&&se.oldChildrenVerticesMap.size>0)for(const[ge,de]of se.oldChildrenVerticesMap.entries())l(ge,de)},redo:()=>{var ne,fe;for(const[ge,de]of se.oldSizes.entries())i(ge,se.newSize);if(se.newChildrenPositionsMap&&se.newChildrenPositionsMap.size>0)for(const[ge,de]of se.newChildrenPositionsMap.entries()){o(ge,de.x,de.y,de.z);const Z=(ne=se.oldChildrenParentIdMap)==null?void 0:ne.get(ge),he=(fe=se.newChildrenParentIdMap)==null?void 0:fe.get(ge);Z&&he&&Z!==he&&(U(he,Z,ge),O(he,ge))}if(se.newChildrenVerticesMap&&se.newChildrenVerticesMap.size>0)for(const[ge,de]of se.newChildrenVerticesMap.entries())l(ge,de)}};c(se),p(f+1);break}case oe.AllObjectsOfThisType:{const ae=new Map;for(const ne of e)ne.type===z.Foundation&&ae.set(ne.id,ne.ly);for(const ne of e)ne.type===z.Foundation&&F(ne,q);const se={name:"Set Width for All Foundations",timestamp:Date.now(),oldSizes:ae,newSize:q,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ne,fe;for(const[ge,de]of se.oldSizes.entries())i(ge,de);if(se.oldChildrenPositionsMap&&se.oldChildrenPositionsMap.size>0)for(const[ge,de]of se.oldChildrenPositionsMap.entries()){o(ge,de.x,de.y,de.z);const Z=(ne=se.oldChildrenParentIdMap)==null?void 0:ne.get(ge),he=(fe=se.newChildrenParentIdMap)==null?void 0:fe.get(ge);Z&&he&&Z!==he&&(U(Z,he,ge),O(Z,ge))}if(se.oldChildrenVerticesMap&&se.oldChildrenVerticesMap.size>0)for(const[ge,de]of se.oldChildrenVerticesMap.entries())l(ge,de)},redo:()=>{var ne,fe;if(a(z.Foundation,se.newSize),se.newChildrenPositionsMap&&se.newChildrenPositionsMap.size>0)for(const[ge,de]of se.newChildrenPositionsMap.entries()){o(ge,de.x,de.y,de.z);const Z=(ne=se.oldChildrenParentIdMap)==null?void 0:ne.get(ge),he=(fe=se.newChildrenParentIdMap)==null?void 0:fe.get(ge);Z&&he&&Z!==he&&(U(he,Z,ge),O(he,ge))}if(se.newChildrenVerticesMap&&se.newChildrenVerticesMap.size>0)for(const[ge,de]of se.newChildrenVerticesMap.entries())l(ge,de)}};c(se),p(f+1);break}default:{F(y,q);const ae={name:"Set Foundation Width",timestamp:Date.now(),oldSize:re,newSize:q,resizedElementId:y.id,resizedElementType:y.type,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var se,ne;if(i(y.id,ae.oldSize),ae.oldChildrenPositionsMap&&ae.oldChildrenPositionsMap.size>0)for(const[fe,ge]of ae.oldChildrenPositionsMap.entries()){o(fe,ge.x,ge.y,ge.z);const de=(se=ae.oldChildrenParentIdMap)==null?void 0:se.get(fe),Z=(ne=ae.newChildrenParentIdMap)==null?void 0:ne.get(fe);de&&Z&&de!==Z&&(U(de,Z,fe),O(de,fe))}if(ae.oldChildrenVerticesMap&&ae.oldChildrenVerticesMap.size>0)for(const[fe,ge]of ae.oldChildrenVerticesMap.entries())l(fe,ge)},redo:()=>{var se,ne;if(i(y.id,ae.newSize),ae.newChildrenPositionsMap&&ae.newChildrenPositionsMap.size>0)for(const[fe,ge]of ae.newChildrenPositionsMap.entries()){o(fe,ge.x,ge.y,ge.z);const de=(se=ae.oldChildrenParentIdMap)==null?void 0:se.get(fe),Z=(ne=ae.newChildrenParentIdMap)==null?void 0:ne.get(fe);de&&Z&&de!==Z&&(U(Z,de,fe),O(Z,fe))}if(ae.newChildrenVerticesMap&&ae.newChildrenVerticesMap.size>0)for(const[fe,ge]of ae.newChildrenVerticesMap.entries())l(fe,ge)}};c(ae),p(f+1);break}}},_=()=>{t(!1)},X=()=>{_(),g()},$=()=>{B(w),M.current||(t(!1),p(0))},Q=()=>{B(w)},le=M.current?": "+Y.t("message.NotApplicableToSelectedAction",E)+(D.current!==void 0?" ("+D.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Width",E),rejectedMessage:le,onApply:Q,onClickCancel:X,onClickOk:$,onClose:_,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:1e3,style:{width:120},step:.5,precision:2,value:w,onChange:q=>{q!==null&&b(q)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",E),": [0.1, 1000] ",Y.t("word.MeterAbbreviation",E)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",E)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:q=>H.getState().setFoundationActionScope(q.target.value),value:u,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",E)})]})})})]})})},huo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(c3),l=H(no),s=H(Zn),c=co(z.Foundation),[u,d]=m.useState((c==null?void 0:c.lz)??.1),f=m.useRef(new Map),p=m.useRef(new Map),g=m.useRef(new Map),y=m.useRef(new Map),w=Jt(),b=(W,j)=>{e(L=>{const k=L.elements.find(N=>N.id===W);k&&(k.lz=j,k.cz=j/2)})},C=(W,j)=>{e(L=>{for(const k of L.elements)k.type===W&&!k.locked&&(k.lz=j,k.cz=j/2)})},P=W=>{if(c){switch(i){case oe.AllSelectedObjectsOfThisType:{for(const j of n)if(j.type===z.Foundation&&!j.locked&&H.getState().selectedElementIdSet.has(j.id)&&Math.abs(j.lz-W)>It)return!0;break}case oe.AllObjectsOfThisType:for(const j of n)if(j.type===z.Foundation&&!j.locked&&Math.abs(j.lz-W)>It)return!0;break;default:if(Math.abs((c==null?void 0:c.lz)-W)>It)return!0}return!1}},v=(W,j)=>{if(W==null)return null;for(const L of W.children)if(L.name.includes(`${j}`))return L;return null},T=(W,j,L)=>{var k,N;if(W){for(const U of W.children)if(U.name.includes(`${L.id}`)){(N=(k=Fn.getState().contentRef)==null?void 0:k.current)==null||N.add(U);break}L.parentId=Zo;const F=new Xt(L.cx,L.cy).rotateAround(si,-j.rotation[2]).add(new Xt(j.cx,j.cy));L.cx=F.x,L.cy=F.y,L.cz=0,y.current.set(L.id,new ie(F.x,F.y,0)),p.current.set(L.id,Zo)}},A=(W,j,L)=>{e(k=>{for(const N of k.elements)if(N.parentId===W.id)if(f.current.set(N.id,W.id),g.current.set(N.id,new ie(N.cx,N.cy,N.cz)),me.isPlantOrHuman(N))if(Math.abs(N.cz-W.lz/2)j/2){const U=Fn.getState().contentRef,O=v(U==null?void 0:U.current,W.id);T(O,W,N)}else N.cz=F,y.current.set(N.id,new ie(N.cx,N.cy,F))}else N.type===z.SolarPanel&&(N.cz=j/2,y.current.set(N.id,new ie(N.cx,N.cy,j/2)));else N.foundationId===W.id&&N.type===z.SolarPanel&&N.parentType==z.Roof&&L!==void 0&&(g.current.set(N.id,new ie(N.cx,N.cy,N.cz)),N.cz=N.cz-L/2+j/2,y.current.set(N.id,new ie(N.cx,N.cy,N.cz)))})},x=(W,j,L)=>{if(!W||!j)return;const k=Fn.getState().contentRef,N=v(k==null?void 0:k.current,j),F=v(j===Zo?k==null?void 0:k.current:N,L);if(F&&(k!=null&&k.current)){if(W===Zo)k.current.add(F);else{const U=v(k.current,W);U==null||U.add(F)}np()}},S=(W,j)=>{W&&e(L=>{for(const k of L.elements)if(k.id===j){k.parentId=W;break}})},R=(W,j)=>{H.getState().set(L=>{for(const k of L.elements)if(W.has(k.id))if(j!==void 0)k.lz=j,k.cz=j/2;else{const N=W.get(k.id);N!==void 0&&(k.lz=N,k.cz=N/2)}})},M=W=>{if(c&&P(W)){switch(i){case oe.AllSelectedObjectsOfThisType:{const j=new Map;for(const k of n)k.type===z.Foundation&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&j.set(k.id,k.lz);for(const k of n)k.type===z.Foundation&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&A(k,W,j.get(k.id));const L={name:"Set Height for Selected Foundations",timestamp:Date.now(),oldValues:j,newValue:W,oldChildrenPositionsMap:new Map(g.current),newChildrenPositionsMap:new Map(y.current),oldChildrenParentIdMap:new Map(f.current),newChildrenParentIdMap:new Map(p.current),undo:()=>{var k,N;if(R(L.oldValues),L.oldChildrenPositionsMap&&L.oldChildrenPositionsMap.size>0)for(const[F,U]of L.oldChildrenPositionsMap.entries()){a(F,U.x,U.y,U.z);const O=(k=L.oldChildrenParentIdMap)==null?void 0:k.get(F),B=(N=L.newChildrenParentIdMap)==null?void 0:N.get(F);O&&B&&O!==B&&(x(O,B,F),S(O,F))}},redo:()=>{var N,F;const k=L.newValue;if(R(L.oldValues,k),L.newChildrenPositionsMap&&L.newChildrenPositionsMap.size>0)for(const[U,O]of L.newChildrenPositionsMap.entries()){a(U,O.x,O.y,O.z);const B=(N=L.oldChildrenParentIdMap)==null?void 0:N.get(U),_=(F=L.newChildrenParentIdMap)==null?void 0:F.get(U);B&&_&&B!==_&&(x(_,B,U),S(_,U))}}};r(L),R(j,W),s(l+1);break}case oe.AllObjectsOfThisType:{const j=new Map;for(const k of n)k.type===z.Foundation&&j.set(k.id,k.lz);for(const k of n)k.type===z.Foundation&&A(k,W,j.get(k.id));const L={name:"Set Height for All Foundations",timestamp:Date.now(),oldValues:j,newValue:W,oldChildrenPositionsMap:new Map(g.current),newChildrenPositionsMap:new Map(y.current),oldChildrenParentIdMap:new Map(f.current),newChildrenParentIdMap:new Map(p.current),undo:()=>{var k,N;for(const[F,U]of L.oldValues.entries())b(F,U);if(L.oldChildrenPositionsMap&&L.oldChildrenPositionsMap.size>0)for(const[F,U]of L.oldChildrenPositionsMap.entries()){a(F,U.x,U.y,U.z);const O=(k=L.oldChildrenParentIdMap)==null?void 0:k.get(F),B=(N=L.newChildrenParentIdMap)==null?void 0:N.get(F);O&&B&&O!==B&&(x(O,B,F),S(O,F))}},redo:()=>{var N,F;const k=L.newValue;if(C(z.Foundation,k),L.newChildrenPositionsMap&&L.newChildrenPositionsMap.size>0)for(const[U,O]of L.newChildrenPositionsMap.entries()){a(U,O.x,O.y,O.z);const B=(N=L.oldChildrenParentIdMap)==null?void 0:N.get(U),_=(F=L.newChildrenParentIdMap)==null?void 0:F.get(U);B&&_&&B!==_&&(x(_,B,U),S(_,U))}}};r(L),C(z.Foundation,W),s(l+1);break}default:{const j=o(c.id),L=j?j.lz:c.lz;A(c,W,L),b(c.id,W);const k={name:"Set Foundation Height",timestamp:Date.now(),oldValue:L,newValue:W,oldChildrenPositionsMap:new Map(g.current),newChildrenPositionsMap:new Map(y.current),oldChildrenParentIdMap:new Map(f.current),newChildrenParentIdMap:new Map(p.current),changedElementId:c.id,changedElementType:c.type,undo:()=>{var N,F;if(b(k.changedElementId,k.oldValue),k.oldChildrenPositionsMap&&k.oldChildrenPositionsMap.size>0)for(const[U,O]of k.oldChildrenPositionsMap.entries()){a(U,O.x,O.y,O.z);const B=(N=k.oldChildrenParentIdMap)==null?void 0:N.get(U),_=(F=k.newChildrenParentIdMap)==null?void 0:F.get(U);B&&_&&B!==_&&(x(B,_,U),S(B,U))}},redo:()=>{var N,F;if(b(k.changedElementId,k.newValue),k.newChildrenPositionsMap&&k.newChildrenPositionsMap.size>0)for(const[U,O]of k.newChildrenPositionsMap.entries()){a(U,O.x,O.y,O.z);const B=(N=k.oldChildrenParentIdMap)==null?void 0:N.get(U),_=(F=k.newChildrenParentIdMap)==null?void 0:F.get(U);B&&_&&B!==_&&(x(_,B,U),S(_,U))}}};r(k),s(l+1);break}}e(j=>{j.actionState.foundationHeight=W})}},D=()=>{t(!1)},E=()=>{M(u)};return h.jsx(so,{width:550,title:Y.t("word.Height",w),onApply:E,onClose:D,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:10,style:{width:120},step:.1,precision:2,value:u,onChange:W=>{W!==null&&d(W)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",w),": [0.1, 10] ",Y.t("word.MeterAbbreviation",w)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",w)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:W=>H.getState().setFoundationActionScope(W.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",w)})]})})})]})})},puo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(Lge),r=H($wt),i=H(En),a=H($s),l=H(no),s=H(Zn),c=co(z.Foundation),[u,d]=m.useState(c?-(c==null?void 0:c.rotation[2]):0),f=Jt(),p=C=>{if(c){switch(a){case oe.AllSelectedObjectsOfThisType:{for(const P of e)if(P.type===z.Foundation&&!P.locked&&H.getState().selectedElementIdSet.has(P.id)&&Math.abs(-P.rotation[2]-C)>It)return!0;break}case oe.AllObjectsOfThisType:for(const P of e)if(P.type===z.Foundation&&!P.locked&&Math.abs(-P.rotation[2]-C)>It)return!0;break;default:if(Math.abs(-(c==null?void 0:c.rotation[2])-C)>It)return!0}return!1}},g=(C,P)=>{H.getState().set(v=>{for(const T of v.elements)if(C.has(T.id))if(P!==void 0)T.rotation[2]=P;else{const A=C.get(T.id);A!==void 0&&(T.rotation[2]=-A)}})},y=C=>{if(c&&p(C))switch(a){case oe.AllSelectedObjectsOfThisType:{const P=new Map;for(const T of e)T.type===z.Foundation&&H.getState().selectedElementIdSet.has(T.id)&&P.set(T.id,-T.rotation[2]);const v={name:"Set Azimuth for All Selected Foundations",timestamp:Date.now(),oldValues:P,newValue:C,undo:()=>{g(v.oldValues)},redo:()=>{g(v.oldValues,-v.newValue)}};i(v),g(P,-C),s(l+1);break}case oe.AllObjectsOfThisType:{const P=new Map;for(const T of e)T.type===z.Foundation&&P.set(T.id,-T.rotation[2]);const v={name:"Set Azimuth for All Foundations",timestamp:Date.now(),oldValues:P,newValue:C,undo:()=>{for(const[T,A]of v.oldValues.entries())o(T,0,0,-A)},redo:()=>{r(z.Foundation,0,0,-v.newValue)}};i(v),r(z.Foundation,0,0,-C),s(l+1);break}default:{const P=n(c.id),v=P?-P.rotation[2]:-c.rotation[2],T={name:"Set Foundation Azimuth",timestamp:Date.now(),oldValue:v,newValue:C,changedElementId:c.id,changedElementType:c.type,undo:()=>{o(T.changedElementId,0,0,-T.oldValue)},redo:()=>{o(T.changedElementId,0,0,-T.newValue)}};i(T),o(c.id,0,0,-C),s(l+1);break}}},w=()=>{t(!1)},b=()=>{y(u)};return h.jsx(so,{width:500,title:Y.t("word.Azimuth",f),onApply:b,onClose:w,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:-180,max:180,style:{width:120},step:.5,precision:2,value:parseFloat(me.toDegrees(u).toFixed(2)),formatter:C=>`${C}°`,onChange:C=>{C!==null&&d(me.toRadians(C))}}),h.jsxs("div",{style:{paddingTop:"20px",paddingRight:"6px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [-180°, 180°]",h.jsx("br",{}),Y.t("message.AzimuthOfNorthIsZero",f),h.jsx("br",{}),Y.t("message.CounterclockwiseAzimuthIsPositive",f)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:C=>H.getState().setFoundationActionScope(C.target.value),value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},guo=({setDialogVisible:t})=>{const e=H(Kn),n=H(s3),o=H(En),r=H($s),i=H(Qwt),a=H(no),l=H(Zn),s=H(Vi),c=H(Gn),u=H(fn),d=H(k=>{if(n){for(const N of k.elements)if(N.id===n.id)return N}return null}),[f,p]=m.useState((d==null?void 0:d.rValue)??o8),[g,y]=m.useState(me.toRValueInUS(f)),[w,b]=m.useState(!1),[C,P]=m.useState({left:0,top:0,bottom:0,right:0}),v=m.useRef(null),T=Jt();m.useEffect(()=>{d&&p((d==null?void 0:d.rValue)??o8)},[d==null?void 0:d.rValue]);const A=k=>{switch(r){case oe.AllObjectsOfThisType:for(const N of e)if(N.type===z.Foundation&&!N.locked){const F=N;if(F.rValue===void 0||Math.abs(F.rValue-k)>It)return!0}break;default:if((d==null?void 0:d.rValue)===void 0||Math.abs((d==null?void 0:d.rValue)-k)>It)return!0}return!1},x=(k,N)=>{u(F=>{for(const U of F.elements)if(U.id===k){U.rValue=N;break}})},S=k=>{for(const[N,F]of k.entries())x(N,F)},R=(k,N)=>{for(const F of k.keys())x(F,N)},M=k=>{if(d&&A(k)){switch(r){case oe.AllObjectsOfThisType:{const N=new Map;u(U=>{for(const O of U.elements)if(O.type===z.Foundation&&!O.locked){const B=O;N.set(O.id,B.rValue??o8),B.rValue=k}});const F={name:"Set R-Value for All Ground Floors",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{S(F.oldValues)},redo:()=>{R(F.oldValues,F.newValue)}};o(F),l(a+1);break}default:{if(d){const F=c(d.id).rValue??d.rValue??o8,U={name:"Set Ground Floor R-Value",timestamp:Date.now(),oldValue:F,newValue:k,changedElementId:d.id,changedElementType:d.type,undo:()=>{x(U.changedElementId,U.oldValue)},redo:()=>{x(U.changedElementId,U.newValue)}};o(U),x(d.id,k),l(a+1)}break}}u(N=>{N.actionState.groundFloorRValue=k})}},D=(k,N)=>{if(v.current){const{clientWidth:F,clientHeight:U}=window.document.documentElement,O=v.current.getBoundingClientRect();P({left:-O.left+N.x,right:F-(O.right-N.x),top:-O.top+N.y,bottom:U-((O==null?void 0:O.bottom)-N.y)})}},E=()=>{p((d==null?void 0:d.rValue)??o8),t(!1)},W=()=>{E(),s()},j=()=>{M(f),t(!1),l(0)},L=()=>{M(f)};return h.jsx(h.Fragment,{children:h.jsx(Oi,{width:550,open:!0,title:h.jsxs("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>b(!0),onMouseOut:()=>b(!1),children:[Y.t("word.RValue",T)+" ","(",Y.t("word.ThermalResistance",T),")"]}),footer:[h.jsx(lo,{onClick:L,children:Y.t("word.Apply",T)},"Apply"),h.jsx(lo,{onClick:W,children:Y.t("word.Cancel",T)},"Cancel"),h.jsx(lo,{type:"primary",onClick:j,children:Y.t("word.OK",T)},"OK")],onCancel:E,maskClosable:!1,destroyOnClose:!1,modalRender:k=>h.jsx(_i,{disabled:!w,bounds:C,onStart:(N,F)=>D(N,F),children:h.jsx("div",{ref:v,children:k})}),children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:f,formatter:k=>Number(k).toFixed(2),onChange:k=>{k!==null&&(p(k),y(me.toRValueInUS(k)))},onPressEnter:j}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",T),": [0.01, 100]",h.jsx("br",{}),Y.t("word.SIUnit",T),": m²·℃/W"]}),h.jsx("br",{}),h.jsx(Mn,{min:me.toRValueInUS(.01),max:me.toRValueInUS(100),style:{width:120},step:.01,precision:2,value:g,formatter:k=>Number(k).toFixed(2),onChange:k=>{k!==null&&(y(k),p(me.toRValueInSI(k)))},onPressEnter:j}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",T),": [",me.toRValueInUS(.01).toFixed(3),", ",me.toRValueInUS(100).toFixed(1),"]",h.jsx("br",{}),Y.t("word.USUnit",T),": h·ft²·℉/Btu"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:k=>i(k.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisGroundFloor",T)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllGroundFloors",T)})]})})})]})})})},muo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarAbsorberPipe,[u,d]=m.useState((c==null?void 0:c.absorberHeight)??10),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberHeight=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusPipe&&(x.solarAbsorberPipe||(x.solarAbsorberPipe={}),x.solarAbsorberPipe.absorberHeight=v)}})},y=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberHeight=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberHeight===void 0||Math.abs(A.solarAbsorberPipe.absorberHeight-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberHeight===void 0||Math.abs(A.solarAbsorberPipe.absorberHeight-v)>It))return!0}break;default:if((c==null?void 0:c.absorberHeight)===void 0||Math.abs((c==null?void 0:c.absorberHeight)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberHeight??10)}const A={name:"Set Absorber Height for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberHeight??10)}const A={name:"Set Absorber Height for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarAbsorberPipe?T.solarAbsorberPipe.absorberHeight??10:c.absorberHeight??10;p(s.id,v);const x={name:"Set Absorber Height on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("solarAbsorberPipeMenu.AbsorberHeight",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:50,style:{width:120},step:.5,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [1, 50] ",Y.t("word.MeterAbbreviation",f)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",f)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},yuo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarAbsorberPipe,[u,d]=m.useState((c==null?void 0:c.apertureWidth)??.6),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.apertureWidth=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusPipe&&(x.solarAbsorberPipe||(x.solarAbsorberPipe={}),x.solarAbsorberPipe.apertureWidth=v)}})},y=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.apertureWidth=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.apertureWidth===void 0||Math.abs(A.solarAbsorberPipe.apertureWidth-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.apertureWidth===void 0||Math.abs(A.solarAbsorberPipe.apertureWidth-v)>It))return!0}break;default:if((c==null?void 0:c.apertureWidth)===void 0||Math.abs((c==null?void 0:c.apertureWidth)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.apertureWidth??.6)}const A={name:"Set Absorber Aperture Width for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.apertureWidth??.6)}const A={name:"Set Absorber Aperture Width for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarAbsorberPipe?T.solarAbsorberPipe.apertureWidth??.6:c.apertureWidth??.6;p(s.id,v);const x={name:"Set Absorber Aperture Width on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("solarAbsorberPipeMenu.AbsorberApertureWidth",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:2,style:{width:120},step:.01,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0.1, 2] ",Y.t("word.MeterAbbreviation",f)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",f)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},Auo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarAbsorberPipe,[u,d]=m.useState((c==null?void 0:c.poleNumber)??5),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.poleNumber=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusPipe&&(x.solarAbsorberPipe||(x.solarAbsorberPipe={}),x.solarAbsorberPipe.poleNumber=v)}})},y=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.poleNumber=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.poleNumber===void 0||A.solarAbsorberPipe.poleNumber!==v))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.poleNumber===void 0||A.solarAbsorberPipe.poleNumber!==v))return!0}break;default:if((c==null?void 0:c.poleNumber)===void 0||(c==null?void 0:c.poleNumber)!==v)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.poleNumber??5)}const A={name:"Set Absorber Pipe Pole Number for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.poleNumber??5)}const A={name:"Set Absorber Pipe Pole Number for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarAbsorberPipe?T.solarAbsorberPipe.poleNumber??5:c.poleNumber??5;p(s.id,v);const x={name:"Set Absorber Pipe Pole Number on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("solarAbsorberPipeMenu.AbsorberPipePoleNumber",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:1,max:100,style:{width:120},step:1,precision:0,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [1, 100]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},wuo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarAbsorberPipe,[u,d]=m.useState((c==null?void 0:c.absorberAbsorptance)??.95),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberAbsorptance=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusPipe&&(x.solarAbsorberPipe||(x.solarAbsorberPipe={}),x.solarAbsorberPipe.absorberAbsorptance=v)}})},y=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberAbsorptance=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberAbsorptance===void 0||Math.abs(A.solarAbsorberPipe.absorberAbsorptance-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberAbsorptance===void 0||Math.abs(A.solarAbsorberPipe.absorberAbsorptance-v)>It))return!0}break;default:if((c==null?void 0:c.absorberAbsorptance)===void 0||Math.abs((c==null?void 0:c.absorberAbsorptance)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberAbsorptance??.95)}const A={name:"Set Absorber Pipe Absorptance for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberAbsorptance??.95)}const A={name:"Set Absorber Pipe Absorptance for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarAbsorberPipe?T.solarAbsorberPipe.absorberAbsorptance??.95:c.absorberAbsorptance??.95;p(s.id,v);const x={name:"Set Absorber Pipe Absorptance on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:500,title:Y.t("solarAbsorberPipeMenu.AbsorberAbsorptance",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},vuo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarAbsorberPipe,[u,d]=m.useState((c==null?void 0:c.absorberOpticalEfficiency)??.7),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberOpticalEfficiency=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusPipe&&(x.solarAbsorberPipe||(x.solarAbsorberPipe={}),x.solarAbsorberPipe.absorberOpticalEfficiency=v)}})},y=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberOpticalEfficiency=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberOpticalEfficiency===void 0||Math.abs(A.solarAbsorberPipe.absorberOpticalEfficiency-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberOpticalEfficiency===void 0||Math.abs(A.solarAbsorberPipe.absorberOpticalEfficiency-v)>It))return!0}break;default:if((c==null?void 0:c.absorberOpticalEfficiency)===void 0||Math.abs((c==null?void 0:c.absorberOpticalEfficiency)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberOpticalEfficiency??.7)}const A={name:"Set Absorber Optical Efficiency for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberOpticalEfficiency??.7)}const A={name:"Set Absorber Optical Efficiency for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarAbsorberPipe?T.solarAbsorberPipe.absorberOpticalEfficiency??.7:c.absorberOpticalEfficiency??.7;p(s.id,v);const x={name:"Set Absorber Optical Efficiency on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:500,title:Y.t("solarAbsorberPipeMenu.AbsorberOpticalEfficiency",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},xuo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarAbsorberPipe,[u,d]=m.useState((c==null?void 0:c.absorberThermalEfficiency)??.3),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberThermalEfficiency=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusPipe&&(x.solarAbsorberPipe||(x.solarAbsorberPipe={}),x.solarAbsorberPipe.absorberThermalEfficiency=v)}})},y=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberThermalEfficiency=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberThermalEfficiency===void 0||Math.abs(A.solarAbsorberPipe.absorberThermalEfficiency-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberThermalEfficiency===void 0||Math.abs(A.solarAbsorberPipe.absorberThermalEfficiency-v)>It))return!0}break;default:if((c==null?void 0:c.absorberThermalEfficiency)===void 0||Math.abs((c==null?void 0:c.absorberThermalEfficiency)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberThermalEfficiency??.3)}const A={name:"Set Absorber Thermal Efficiency for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberThermalEfficiency??.3)}const A={name:"Set Absorber Thermal Efficiency for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarAbsorberPipe?T.solarAbsorberPipe.absorberThermalEfficiency??.3:c.absorberThermalEfficiency??.3;p(s.id,v);const x={name:"Set Absorber Thermal Efficiency on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:500,title:Y.t("solarAbsorberPipeMenu.AbsorberThermalEfficiency",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},buo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarPowerTower,[u,d]=m.useState((c==null?void 0:c.towerHeight)??20),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.towerHeight=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusTower&&(x.solarPowerTower||(x.solarPowerTower={}),x.solarPowerTower.towerHeight=v)}})},y=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.towerHeight=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.towerHeight===void 0||Math.abs(A.solarPowerTower.towerHeight-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.towerHeight===void 0||Math.abs(A.solarPowerTower.towerHeight-v)>It))return!0}break;default:if((c==null?void 0:c.towerHeight)===void 0||Math.abs((c==null?void 0:c.towerHeight)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.towerHeight??20)}const A={name:"Set Tower Height for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.towerHeight??20)}const A={name:"Set Tower Height for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarPowerTower?T.solarPowerTower.towerHeight??20:c.towerHeight??20;p(s.id,v);const x={name:"Set Tower Height on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("solarPowerTowerMenu.ReceiverTowerHeight",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:10,max:500,style:{width:120},step:1,precision:1,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [10, 500] ",Y.t("word.MeterAbbreviation",f)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",f)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},Suo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarPowerTower,[u,d]=m.useState((c==null?void 0:c.towerRadius)??1),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.towerRadius=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusTower&&(x.solarPowerTower||(x.solarPowerTower={}),x.solarPowerTower.towerRadius=v)}})},y=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.towerRadius=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.towerRadius===void 0||Math.abs(A.solarPowerTower.towerRadius-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.towerRadius===void 0||Math.abs(A.solarPowerTower.towerRadius-v)>It))return!0}break;default:if((c==null?void 0:c.towerRadius)===void 0||Math.abs((c==null?void 0:c.towerRadius)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.towerRadius??1)}const A={name:"Set Tower Radius for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.towerRadius??1)}const A={name:"Set Tower Radius for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarPowerTower?T.solarPowerTower.towerRadius??1:c.towerRadius??1;p(s.id,v);const x={name:"Set Tower Radius on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("solarPowerTowerMenu.ReceiverTowerRadius",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.5,max:10,style:{width:120},step:.5,precision:1,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0.5, 10] ",Y.t("word.MeterAbbreviation",f)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",f)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},Tuo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarPowerTower,[u,d]=m.useState((c==null?void 0:c.receiverAbsorptance)??.95),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.receiverAbsorptance=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusTower&&(x.solarPowerTower||(x.solarPowerTower={}),x.solarPowerTower.receiverAbsorptance=v)}})},y=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.receiverAbsorptance=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.receiverAbsorptance===void 0||Math.abs(A.solarPowerTower.receiverAbsorptance-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.receiverAbsorptance===void 0||Math.abs(A.solarPowerTower.receiverAbsorptance-v)>It))return!0}break;default:if((c==null?void 0:c.receiverAbsorptance)===void 0||Math.abs((c==null?void 0:c.receiverAbsorptance)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.receiverAbsorptance??.95)}const A={name:"Set Receiver Absorptance for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.receiverAbsorptance??.95)}const A={name:"Set Receiver Absorptance for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarPowerTower?T.solarPowerTower.receiverAbsorptance??.95:c.receiverAbsorptance??.95;p(s.id,v);const x={name:"Set Receiver Absorptance on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:500,title:Y.t("solarPowerTowerMenu.ReceiverAbsorptance",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},Puo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarPowerTower,[u,d]=m.useState((c==null?void 0:c.receiverThermalEfficiency)??.3),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.receiverThermalEfficiency=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusTower&&(x.solarPowerTower||(x.solarPowerTower={}),x.solarPowerTower.receiverThermalEfficiency=v)}})},y=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.receiverThermalEfficiency=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.receiverThermalEfficiency===void 0||Math.abs(A.solarPowerTower.receiverThermalEfficiency-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.receiverThermalEfficiency===void 0||Math.abs(A.solarPowerTower.receiverThermalEfficiency-v)>It))return!0}break;default:if((c==null?void 0:c.receiverThermalEfficiency)===void 0||Math.abs((c==null?void 0:c.receiverThermalEfficiency)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.receiverThermalEfficiency??.3)}const A={name:"Set Receiver Thermal Efficiency for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.receiverThermalEfficiency??.3)}const A={name:"Set Receiver Thermal Efficiency for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarPowerTower?T.solarPowerTower.receiverThermalEfficiency??.3:c.receiverThermalEfficiency??.3;p(s.id,v);const x={name:"Set Receiver Thermal Efficiency on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("solarPowerTowerMenu.ReceiverThermalEfficiency",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},Cuo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarPowerTower,[u,d]=m.useState((c==null?void 0:c.receiverOpticalEfficiency)??.7),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.receiverOpticalEfficiency=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusTower&&(x.solarPowerTower||(x.solarPowerTower={}),x.solarPowerTower.receiverOpticalEfficiency=v)}})},y=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.receiverOpticalEfficiency=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.receiverOpticalEfficiency===void 0||Math.abs(A.solarPowerTower.receiverOpticalEfficiency-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.receiverOpticalEfficiency===void 0||Math.abs(A.solarPowerTower.receiverOpticalEfficiency-v)>It))return!0}break;default:if((c==null?void 0:c.receiverOpticalEfficiency)===void 0||Math.abs((c==null?void 0:c.receiverOpticalEfficiency)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.receiverOpticalEfficiency??.7)}const A={name:"Set Receiver Optical Efficiency for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.receiverOpticalEfficiency??.7)}const A={name:"Set Receiver Optical Efficiency for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarPowerTower?T.solarPowerTower.receiverOpticalEfficiency??.7:c.receiverOpticalEfficiency??.7;p(s.id,v);const x={name:"Set Receiver Optical Efficiency on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:500,title:Y.t("solarPowerTowerMenu.ReceiverOpticalEfficiency",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},Ruo=({setDialogVisible:t})=>{var P;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState(((P=s==null?void 0:s.solarUpdraftTower)==null?void 0:P.chimneyHeight)??Math.max((s==null?void 0:s.lx)??0,(s==null?void 0:s.ly)??0)),d=Jt(),f=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.chimneyHeight=T);break}})},p=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.UpdraftTower&&(x.solarUpdraftTower||(x.solarUpdraftTower={}),x.solarUpdraftTower.chimneyHeight=v)}})},g=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.chimneyHeight=T)}})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.chimneyHeight===void 0||Math.abs(A.solarUpdraftTower.chimneyHeight-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.chimneyHeight===void 0||Math.abs(A.solarUpdraftTower.chimneyHeight-v)>It))return!0}break;default:if(s&&s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower&&(s.solarUpdraftTower.chimneyHeight===void 0||Math.abs(s.solarUpdraftTower.chimneyHeight-v)>It))return!0}return!1},w=v=>{var T,A;if(s&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)if(R.type===z.Foundation&&H.getState().selectedElementIdSet.has(R.id)){const M=R;M.solarStructure===Dn.UpdraftTower&&M.solarUpdraftTower&&x.set(R.id,((T=M.solarUpdraftTower)==null?void 0:T.chimneyHeight)??Math.max(M.lx,M.ly))}const S={name:"Set Solar Chimney Height for Selected Foundations",timestamp:Date.now(),oldValues:x,newValue:v,undo:()=>{for(const[R,M]of S.oldValues.entries())f(R,M)},redo:()=>{g(S.oldValues,S.newValue)}};r(S),g(x,v),l(a+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)if(R.type===z.Foundation){const M=R;M.solarStructure===Dn.UpdraftTower&&M.solarUpdraftTower&&x.set(R.id,((A=M.solarUpdraftTower)==null?void 0:A.chimneyHeight)??Math.max(M.lx,M.ly))}const S={name:"Set Solar Chimney Height for All Foundations",timestamp:Date.now(),oldValues:x,newValue:v,undo:()=>{for(const[R,M]of S.oldValues.entries())f(R,M)},redo:()=>{p(S.newValue)}};r(S),p(v),l(a+1);break}default:{if(s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower){const x=o(s.id),S=x&&x.solarUpdraftTower?x.solarUpdraftTower.chimneyHeight??Math.max(x.lx,x.ly):s.solarUpdraftTower.chimneyHeight??Math.max(s.lx,s.ly);f(s.id,v);const R={name:"Set Solar Chimney Height on Foundation",timestamp:Date.now(),oldValue:S,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(R.changedElementId,R.oldValue)},redo:()=>{f(R.changedElementId,R.newValue)}};r(R),l(a+1)}break}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerChimneyHeight",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:1e3,style:{width:120},step:1,precision:1,value:c,onChange:v=>{v!==null&&u(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [1, 1000] ",Y.t("word.MeterAbbreviation",d)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",d)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},Huo=({setDialogVisible:t})=>{var P;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState(((P=s==null?void 0:s.solarUpdraftTower)==null?void 0:P.chimneyRadius)??Math.max(1,.025*Math.min((s==null?void 0:s.lx)??0,(s==null?void 0:s.ly)??0))),d=Jt(),f=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.chimneyRadius=T);break}})},p=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.UpdraftTower&&(x.solarUpdraftTower||(x.solarUpdraftTower={}),x.solarUpdraftTower.chimneyRadius=v)}})},g=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.chimneyRadius=T)}})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.chimneyRadius===void 0||Math.abs(A.solarUpdraftTower.chimneyRadius-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.chimneyRadius===void 0||Math.abs(A.solarUpdraftTower.chimneyRadius-v)>It))return!0}break;default:if(s&&s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower&&(s.solarUpdraftTower.chimneyRadius===void 0||Math.abs(s.solarUpdraftTower.chimneyRadius-v)>It))return!0}return!1},w=v=>{var T,A;if(s&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)if(R.type===z.Foundation&&H.getState().selectedElementIdSet.has(R.id)){const M=R;M.solarStructure===Dn.UpdraftTower&&M.solarUpdraftTower&&x.set(R.id,((T=M.solarUpdraftTower)==null?void 0:T.chimneyRadius)??Math.max(1,.025*Math.min(M.lx,M.ly)))}const S={name:"Set Solar Chimney Radius for Selected Foundations",timestamp:Date.now(),oldValues:x,newValue:v,undo:()=>{for(const[R,M]of S.oldValues.entries())f(R,M)},redo:()=>{g(S.oldValues,S.newValue)}};r(S),g(x,v),l(a+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)if(R.type===z.Foundation){const M=R;M.solarStructure===Dn.UpdraftTower&&M.solarUpdraftTower&&x.set(R.id,((A=M.solarUpdraftTower)==null?void 0:A.chimneyRadius)??Math.max(1,.025*Math.min(M.lx,M.ly)))}const S={name:"Set Solar Chimney Radius for All Foundations",timestamp:Date.now(),oldValues:x,newValue:v,undo:()=>{for(const[R,M]of S.oldValues.entries())f(R,M)},redo:()=>{p(S.newValue)}};r(S),p(v),l(a+1);break}default:{if(s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower){const x=o(s.id),S=x&&x.solarUpdraftTower?x.solarUpdraftTower.chimneyRadius??Math.max(1,.025*Math.min(x.lx,x.ly)):s.solarUpdraftTower.chimneyRadius??Math.max(1,.025*Math.min(s.lx,s.ly));f(s.id,v);const R={name:"Set Solar Chimney Radius on Foundation",timestamp:Date.now(),oldValue:S,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(R.changedElementId,R.oldValue)},redo:()=>{f(R.changedElementId,R.newValue)}};r(R),l(a+1)}break}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerChimneyRadius",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:10,style:{width:120},step:1,precision:1,value:c,onChange:v=>{v!==null&&u(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0.1, 10] ",Y.t("word.MeterAbbreviation",d)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",d)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},Muo=({setDialogVisible:t})=>{var b;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=co(z.Foundation),[l,s]=m.useState(((b=a==null?void 0:a.solarUpdraftTower)==null?void 0:b.collectorHeight)??Math.max(3,10*((a==null?void 0:a.lz)??0))),c=Jt(),u=(C,P)=>{e(v=>{for(const T of v.elements)if(T.type===z.Foundation&&T.id===C&&!T.locked){const A=T;A.solarStructure===Dn.UpdraftTower&&(A.solarUpdraftTower||(A.solarUpdraftTower={}),A.solarUpdraftTower.collectorHeight=P);break}})},d=C=>{e(P=>{for(const v of P.elements)if(v.type===z.Foundation&&!v.locked){const T=v;T.solarStructure===Dn.UpdraftTower&&(T.solarUpdraftTower||(T.solarUpdraftTower={}),T.solarUpdraftTower.collectorHeight=C)}})},f=(C,P)=>{e(v=>{for(const T of v.elements)if(T.type===z.Foundation&&!T.locked&&C.has(T.id)){const A=T;A.solarStructure===Dn.UpdraftTower&&(A.solarUpdraftTower||(A.solarUpdraftTower={}),A.solarUpdraftTower.collectorHeight=P)}})},p=C=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const P of n)if(P.type===z.Foundation&&!P.locked&&H.getState().selectedElementIdSet.has(P.id)){const v=P;if(v.solarStructure===Dn.UpdraftTower&&v.solarUpdraftTower&&(v.solarUpdraftTower.collectorHeight===void 0||Math.abs(v.solarUpdraftTower.collectorHeight-C)>It))return!0}break;case oe.AllObjectsOfThisType:for(const P of n)if(P.type===z.Foundation&&!P.locked){const v=P;if(v.solarStructure===Dn.UpdraftTower&&v.solarUpdraftTower&&(v.solarUpdraftTower.collectorHeight===void 0||Math.abs(v.solarUpdraftTower.collectorHeight-C)>It))return!0}break;default:if(a&&a.solarStructure===Dn.UpdraftTower&&a.solarUpdraftTower&&(a.solarUpdraftTower.collectorHeight===void 0||Math.abs(a.solarUpdraftTower.collectorHeight-C)>It))return!0}return!1},g=C=>{if(a&&p(C))switch(i){case oe.AllSelectedObjectsOfThisType:{const P=new Map;for(const T of n)if(T.type===z.Foundation&&H.getState().selectedElementIdSet.has(T.id)){const A=T;A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&P.set(T.id,A.solarUpdraftTower.collectorHeight??Math.max(3,10*A.lz))}const v={name:"Set Solar Collector Height for Selected Foundations",timestamp:Date.now(),oldValues:P,newValue:C,undo:()=>{for(const[T,A]of v.oldValues.entries())u(T,A)},redo:()=>{f(v.oldValues,v.newValue)}};r(v),f(P,C);break}case oe.AllObjectsOfThisType:{const P=new Map;for(const T of n)if(T.type===z.Foundation){const A=T;A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&P.set(T.id,A.solarUpdraftTower.collectorHeight??Math.max(3,10*A.lz))}const v={name:"Set Solar Collector Height for All Foundations",timestamp:Date.now(),oldValues:P,newValue:C,undo:()=>{for(const[T,A]of v.oldValues.entries())u(T,A)},redo:()=>{d(v.newValue)}};r(v),d(C);break}default:{if(a.solarStructure===Dn.UpdraftTower&&a.solarUpdraftTower){const P=o(a.id),v=P&&P.solarUpdraftTower?P.solarUpdraftTower.collectorHeight??Math.max(3,10*P.lz):a.solarUpdraftTower.collectorHeight??Math.max(3,10*a.lz);u(a.id,C);const T={name:"Set Solar Collector Height on Foundation",timestamp:Date.now(),oldValue:v,newValue:C,changedElementId:a.id,changedElementType:a.type,undo:()=>{u(T.changedElementId,T.oldValue)},redo:()=>{u(T.changedElementId,T.newValue)}};r(T)}break}}},y=()=>{t(!1)},w=()=>{g(l)};return h.jsx(so,{width:550,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorHeight",c),onApply:w,onClose:y,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:20,style:{width:120},step:1,precision:1,value:l,onChange:C=>{C!==null&&s(C)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",c),": [0.1, 20] ",Y.t("word.MeterAbbreviation",c)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",c)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:C=>H.getState().setFoundationActionScope(C.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",c)})]})})})]})})},Iuo=({setDialogVisible:t})=>{var P;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState(((P=s==null?void 0:s.solarUpdraftTower)==null?void 0:P.collectorRadius)??Math.max(10,.5*Math.min((s==null?void 0:s.lx)??0,(s==null?void 0:s.ly)??0))),d=Jt(),f=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.collectorRadius=T);break}})},p=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.UpdraftTower&&(x.solarUpdraftTower||(x.solarUpdraftTower={}),x.solarUpdraftTower.collectorRadius=v)}})},g=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.collectorRadius=T)}})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.collectorRadius===void 0||Math.abs(A.solarUpdraftTower.collectorRadius-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.collectorRadius===void 0||Math.abs(A.solarUpdraftTower.collectorRadius-v)>It))return!0}break;default:if(s&&s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower&&(s.solarUpdraftTower.collectorRadius===void 0||Math.abs(s.solarUpdraftTower.collectorRadius-v)>It))return!0}return!1},w=v=>{if(s&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.collectorRadius??Math.max(10,.5*Math.min(S.lx,S.ly)))}const A={name:"Set Solar Collector Radius for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{g(A.oldValues,A.newValue)}};r(A),g(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.collectorRadius??Math.max(10,.5*Math.min(S.lx,S.ly)))}const A={name:"Set Solar Collector Radius for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{p(A.newValue)}};r(A),p(v),l(a+1);break}default:{if(s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower){const T=o(s.id),A=T&&T.solarUpdraftTower?T.solarUpdraftTower.collectorRadius??Math.max(10,.5*Math.min(T.lx,T.ly)):s.solarUpdraftTower.collectorRadius??Math.max(10,.5*Math.min(s.lx,s.ly));f(s.id,v);const x={name:"Set Solar Collector Radius on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(x.changedElementId,x.oldValue)},redo:()=>{f(x.changedElementId,x.newValue)}};r(x),l(a+1)}break}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorRadius",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:1e3,style:{width:120},step:1,precision:1,value:c,onChange:v=>{v!==null&&u(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [1, 1000] ",Y.t("word.MeterAbbreviation",d)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",d)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},zuo=({setDialogVisible:t})=>{var P;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState(((P=s==null?void 0:s.solarUpdraftTower)==null?void 0:P.collectorTransmissivity)??.9),d=Jt(),f=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.collectorTransmissivity=T);break}})},p=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.UpdraftTower&&(x.solarUpdraftTower||(x.solarUpdraftTower={}),x.solarUpdraftTower.collectorTransmissivity=v)}})},g=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.collectorTransmissivity=T)}})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.collectorTransmissivity===void 0||Math.abs(A.solarUpdraftTower.collectorTransmissivity-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.collectorTransmissivity===void 0||Math.abs(A.solarUpdraftTower.collectorTransmissivity-v)>It))return!0}break;default:if(s&&s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower&&(s.solarUpdraftTower.collectorTransmissivity===void 0||Math.abs(s.solarUpdraftTower.collectorTransmissivity-v)>It))return!0}return!1},w=v=>{if(s&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.collectorTransmissivity??.9)}const A={name:"Set Solar Collector Transmissivity for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{g(A.oldValues,A.newValue)}};r(A),g(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.collectorTransmissivity??.9)}const A={name:"Set Solar Collector Transmissivity for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{p(A.newValue)}};r(A),p(v),l(a+1);break}default:{if(s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower){const T=o(s.id),A=T&&T.solarUpdraftTower?T.solarUpdraftTower.collectorTransmissivity??.9:s.solarUpdraftTower.collectorTransmissivity??.9;f(s.id,v);const x={name:"Set Solar Collector Transmissivity on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(x.changedElementId,x.oldValue)},redo:()=>{f(x.changedElementId,x.newValue)}};r(x),l(a+1)}break}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:540,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorTransmissivity",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:c,onChange:v=>{v!==null&&u(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",marginLeft:"16px",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},Duo=({setDialogVisible:t})=>{var P;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState(((P=s==null?void 0:s.solarUpdraftTower)==null?void 0:P.collectorEmissivity)??.95),d=Jt(),f=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.collectorEmissivity=T);break}})},p=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.UpdraftTower&&(x.solarUpdraftTower||(x.solarUpdraftTower={}),x.solarUpdraftTower.collectorEmissivity=v)}})},g=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.collectorEmissivity=T)}})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.collectorEmissivity===void 0||Math.abs(A.solarUpdraftTower.collectorEmissivity-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.collectorEmissivity===void 0||Math.abs(A.solarUpdraftTower.collectorEmissivity-v)>It))return!0}break;default:if(s&&s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower&&(s.solarUpdraftTower.collectorEmissivity===void 0||Math.abs(s.solarUpdraftTower.collectorEmissivity-v)>It))return!0}return!1},w=v=>{if(s&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.collectorEmissivity??.95)}const A={name:"Set Solar Collector Emissivity for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{g(A.oldValues,A.newValue)}};r(A),g(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.collectorEmissivity??.95)}const A={name:"Set Solar Collector Emissivity for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{p(A.newValue)}};r(A),p(v),l(a+1);break}default:{if(s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower){const T=o(s.id),A=T&&T.solarUpdraftTower?T.solarUpdraftTower.collectorEmissivity??.95:s.solarUpdraftTower.collectorEmissivity??.95;f(s.id,v);const x={name:"Set Solar Collector Emissivity on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(x.changedElementId,x.oldValue)},redo:()=>{f(x.changedElementId,x.newValue)}};r(x),l(a+1)}break}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:540,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorEmissivity",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.01,max:1,style:{width:120},step:.01,precision:2,value:c,onChange:v=>{v!==null&&u(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",marginLeft:"16px",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},Euo=({setDialogVisible:t})=>{var P;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState(((P=s==null?void 0:s.solarUpdraftTower)==null?void 0:P.dischargeCoefficient)??.65),d=Jt(),f=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.dischargeCoefficient=T);break}})},p=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.UpdraftTower&&(x.solarUpdraftTower||(x.solarUpdraftTower={}),x.solarUpdraftTower.dischargeCoefficient=v)}})},g=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.dischargeCoefficient=T)}})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.dischargeCoefficient===void 0||Math.abs(A.solarUpdraftTower.dischargeCoefficient-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.dischargeCoefficient===void 0||Math.abs(A.solarUpdraftTower.dischargeCoefficient-v)>It))return!0}break;default:if(s&&s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower&&(s.solarUpdraftTower.dischargeCoefficient===void 0||Math.abs(s.solarUpdraftTower.dischargeCoefficient-v)>It))return!0}return!1},w=v=>{if(s&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.dischargeCoefficient??.65)}const A={name:"Set Solar Chimney Discharge Coefficient for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{g(A.oldValues,A.newValue)}};r(A),g(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.dischargeCoefficient??.65)}const A={name:"Set Solar Chimney Discharge Coefficient for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{p(A.newValue)}};r(A),p(v),l(a+1);break}default:{if(s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower){const T=o(s.id),A=T&&T.solarUpdraftTower?T.solarUpdraftTower.dischargeCoefficient??.65:s.solarUpdraftTower.dischargeCoefficient??.65;f(s.id,v);const x={name:"Set Solar Chimney Discharge Coefficient on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(x.changedElementId,x.oldValue)},redo:()=>{f(x.changedElementId,x.newValue)}};r(x),l(a+1)}break}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:540,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerDischargeCoefficient",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.65,max:.7,style:{width:120},step:.01,precision:2,value:c,onChange:v=>{v!==null&&u(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0.65, 0.70]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",marginLeft:"16px",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},Fuo=({setDialogVisible:t})=>{var P;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState(((P=s==null?void 0:s.solarUpdraftTower)==null?void 0:P.turbineEfficiency)??.3),d=Jt(),f=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.turbineEfficiency=T);break}})},p=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.UpdraftTower&&(x.solarUpdraftTower||(x.solarUpdraftTower={}),x.solarUpdraftTower.turbineEfficiency=v)}})},g=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.turbineEfficiency=T)}})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.turbineEfficiency===void 0||Math.abs(A.solarUpdraftTower.turbineEfficiency-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.turbineEfficiency===void 0||Math.abs(A.solarUpdraftTower.turbineEfficiency-v)>It))return!0}break;default:if(s&&s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower&&(s.solarUpdraftTower.turbineEfficiency===void 0||Math.abs(s.solarUpdraftTower.turbineEfficiency-v)>It))return!0}return!1},w=v=>{if(s&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.turbineEfficiency??.3)}const A={name:"Set Solar Updraft Tower Turbine Efficiency for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{g(A.oldValues,A.newValue)}};r(A),g(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.turbineEfficiency??.3)}const A={name:"Set Solar Updraft Tower Turbine Efficiency for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{p(A.newValue)}};r(A),p(v),l(a+1);break}default:{if(s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower){const T=o(s.id),A=T&&T.solarUpdraftTower?T.solarUpdraftTower.turbineEfficiency??.3:s.solarUpdraftTower.turbineEfficiency??.3;f(s.id,v);const x={name:"Set Solar Updraft Tower Turbine Efficiency on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(x.changedElementId,x.oldValue)},redo:()=>{f(x.changedElementId,x.newValue)}};r(x),l(a+1)}break}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:540,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerTurbineEfficiency",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.2,max:1,style:{width:120},step:.01,precision:2,value:c,onChange:v=>{v!==null&&u(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0.2, 1.0]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",marginLeft:"16px",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},{Option:XT}=_o,kuo=({setDialogVisible:t})=>{const e=H(fn),n=H(ma),o=H(s0),r=ht(n5),[i,a]=m.useState(!1),[l,s]=m.useState(!1),[c,u]=m.useState({left:0,top:0,bottom:0,right:0}),d=m.useRef(null),f=H(wA).geneticAlgorithmParams,p=m.useRef(f.selectionMethod),g=m.useRef(f.searchMethod),y=m.useRef(Math.min(f.objectiveFunctionType,To.YEARLY_TOTAL_OUTPUT)),w=m.useRef(f.populationSize),b=m.useRef(f.maximumGenerations),C=m.useRef(f.mutationRate),P=m.useRef(f.selectionRate??.5),v=m.useRef(f.crossoverRate??.5),T=m.useRef(f.convergenceThreshold),A=m.useRef(f.localSearchRadius),x=m.useRef(null);m.useEffect(()=>{var W;(W=x.current)==null||W.focus()},[]);const S={lng:o},R=(W,j)=>{if(d.current){const{clientWidth:L,clientHeight:k}=window.document.documentElement,N=d.current.getBoundingClientRect();u({left:-N.left+j.x,right:L-(N.right-j.x),top:-N.top+j.y,bottom:k-((N==null?void 0:N.bottom)-j.y)})}},M=()=>{e(W=>{W.evolutionaryAlgorithmState.geneticAlgorithmParams.problem=Pi.SOLAR_PANEL_TILT_ANGLE,W.evolutionaryAlgorithmState.geneticAlgorithmParams.objectiveFunctionType=y.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.selectionMethod=p.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.searchMethod=g.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.populationSize=w.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.maximumGenerations=b.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.selectionRate=P.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.crossoverRate=v.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.mutationRate=C.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.convergenceThreshold=T.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.localSearchRadius=A.current})},D=()=>{r||hn(E("message.EvolutionStarted",S)),M(),setTimeout(()=>{ht.getState().set(W=>{W.runEvolution=!W.runEvolution}),e(W=>{W.evolutionMethod=Vs.GENETIC_ALGORITHM,W.evolutionaryAlgorithmState.geneticAlgorithmParams.problem=Pi.SOLAR_PANEL_TILT_ANGLE,n&&(W.actionInfo={name:"Run Genetic Algorithm for Solar Panel Tilt Angle",timestamp:new Date().getTime()})})},100)},{t:E}=Vl();return h.jsx(h.Fragment,{children:h.jsxs(Oi,{width:640,open:!0,title:h.jsxs("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>s(!0),onMouseOut:()=>s(!1),children:[E("optimizationMenu.SolarPanelTiltAngleOptimization",S)+": ",E("optimizationMenu.GeneticAlgorithmSettings",S)]}),footer:[h.jsx(lo,{onClick:()=>{t(!1)},children:E("word.Cancel",S)},"Cancel"),h.jsx(lo,{type:"primary",ref:x,onClick:()=>{D(),t(!1)},children:E("word.Run",S)},"Run")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:W=>h.jsx(_i,{disabled:!l,bounds:c,onStart:(j,L)=>R(j,L),children:h.jsx("div",{ref:d,children:W})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.Objective",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:y.current,style:{width:"100%"},value:y.current,onChange:W=>{y.current=W,a(!i)},children:[h.jsx(XT,{value:To.DAILY_TOTAL_OUTPUT,children:E("optimizationMenu.ObjectiveFunctionDailyTotalYield",S)},To.DAILY_TOTAL_OUTPUT),h.jsx(XT,{value:To.YEARLY_TOTAL_OUTPUT,children:E("optimizationMenu.ObjectiveFunctionYearlyTotalYield",S)},To.YEARLY_TOTAL_OUTPUT)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.GeneticAlgorithmSelectionMethod",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:p.current,style:{width:"100%"},value:p.current,onChange:W=>{p.current=W,a(!i)},children:[h.jsx(XT,{value:Wm.ROULETTE_WHEEL,children:E("optimizationMenu.RouletteWheel",S)},Wm.ROULETTE_WHEEL),h.jsx(XT,{value:Wm.TOURNAMENT,children:E("optimizationMenu.Tournament",S)},Wm.TOURNAMENT)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.PopulationSize",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:10,max:100,style:{width:"100%"},precision:0,formatter:W=>Number(W).toFixed(0),value:w.current,step:1,onChange:W=>{W!==null&&(w.current=Number(W),a(!i))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.MaximumGenerations",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:5,max:100,step:1,style:{width:"100%"},precision:0,formatter:W=>Number(W).toFixed(0),value:b.current,onChange:W=>{W!==null&&(b.current=Number(W),a(!i))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.SelectionRate",S)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:P.current,step:.01,onChange:W=>{W!==null&&(P.current=Number(W),a(!i))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.CrossoverRate",S)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:v.current,step:.01,onChange:W=>{W!==null&&(v.current=Number(W),a(!i))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.MutationRate",S)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:C.current,step:.01,onChange:W=>{W!==null&&(C.current=Number(W),a(!i))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.ConvergenceThreshold",S)+" [0, 0.1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:.001,max:.1,style:{width:"100%"},precision:3,value:T.current,step:.001,onChange:W=>{W!==null&&(T.current=Number(W),a(!i))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.SearchMethod",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:g.current,style:{width:"100%"},value:g.current,onChange:W=>{g.current=Number(W),a(!i)},children:[h.jsx(XT,{value:us.GLOBAL_SEARCH_UNIFORM_SELECTION,children:E("optimizationMenu.GlobalSearchUniformSelection",S)},us.GLOBAL_SEARCH_UNIFORM_SELECTION),h.jsx(XT,{value:us.LOCAL_SEARCH_RANDOM_OPTIMIZATION,children:E("optimizationMenu.LocalSearchRandomOptimization",S)},us.LOCAL_SEARCH_RANDOM_OPTIMIZATION)]})})]}),g.current===us.LOCAL_SEARCH_RANDOM_OPTIMIZATION&&h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.LocalSearchRadius",S)+" ([0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:A.current,step:.01,onChange:W=>{W!==null&&(A.current=Number(W),a(!i))}})})]})]})})},{Option:UO}=_o,Luo=({setDialogVisible:t})=>{const e=H(fn),n=H(ma),o=H(s0),r=ht(n5),i=H(wA).particleSwarmOptimizationParams,[a,l]=m.useState(!1),[s,c]=m.useState(!1),[u,d]=m.useState({left:0,top:0,bottom:0,right:0}),f=m.useRef(null),p=m.useRef(Math.min(i.objectiveFunctionType,To.YEARLY_TOTAL_OUTPUT)),g=m.useRef(i.searchMethod),y=m.useRef(i.swarmSize),w=m.useRef(i.maximumSteps),b=m.useRef(i.vmax??.01),C=m.useRef(i.inertia??.8),P=m.useRef(i.cognitiveCoefficient??.1),v=m.useRef(i.socialCoefficient??.1),T=m.useRef(i.convergenceThreshold),A=m.useRef(i.localSearchRadius),x=m.useRef(null);m.useEffect(()=>{var W;(W=x.current)==null||W.focus()},[]);const S={lng:o},R=(W,j)=>{if(f.current){const{clientWidth:L,clientHeight:k}=window.document.documentElement,N=f.current.getBoundingClientRect();d({left:-N.left+j.x,right:L-(N.right-j.x),top:-N.top+j.y,bottom:k-((N==null?void 0:N.bottom)-j.y)})}},M=()=>{e(W=>{W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.problem=Pi.SOLAR_PANEL_TILT_ANGLE,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.objectiveFunctionType=p.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.searchMethod=g.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.swarmSize=y.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.maximumSteps=w.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.cognitiveCoefficient=P.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.socialCoefficient=v.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.vmax=b.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.inertia=C.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.convergenceThreshold=T.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.localSearchRadius=A.current})},D=()=>{r||hn(E("message.EvolutionStarted",S)),M(),setTimeout(()=>{ht.getState().set(W=>{W.runEvolution=!W.runEvolution}),e(W=>{W.evolutionMethod=Vs.PARTICLE_SWARM_OPTIMIZATION,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.problem=Pi.SOLAR_PANEL_TILT_ANGLE,n&&(W.actionInfo={name:"Run Particle Swarm Optimization for Solar Panel Tilt Angle",timestamp:new Date().getTime()})})},100)},{t:E}=Vl();return h.jsx(h.Fragment,{children:h.jsxs(Oi,{width:640,open:!0,title:h.jsxs("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>c(!0),onMouseOut:()=>c(!1),children:[E("optimizationMenu.SolarPanelTiltAngleOptimization",S)+": ",E("optimizationMenu.ParticleSwarmOptimizationSettings",S)]}),footer:[h.jsx(lo,{onClick:()=>{t(!1)},children:E("word.Cancel",S)},"Cancel"),h.jsx(lo,{type:"primary",ref:x,onClick:()=>{D(),t(!1)},children:E("word.Run",S)},"Run")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:W=>h.jsx(_i,{disabled:!s,bounds:u,onStart:(j,L)=>R(j,L),children:h.jsx("div",{ref:f,children:W})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.Objective",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:p.current,style:{width:"100%"},value:p.current,onChange:W=>{p.current=W,l(!a)},children:[h.jsx(UO,{value:To.DAILY_TOTAL_OUTPUT,children:E("optimizationMenu.ObjectiveFunctionDailyTotalYield",S)},To.DAILY_TOTAL_OUTPUT),h.jsx(UO,{value:To.YEARLY_TOTAL_OUTPUT,children:E("optimizationMenu.ObjectiveFunctionYearlyTotalYield",S)},To.YEARLY_TOTAL_OUTPUT)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.SwarmSize",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:10,max:100,style:{width:"100%"},precision:0,value:y.current,step:1,formatter:W=>Number(W).toFixed(0),onChange:W=>{y.current=Number(W),l(!a)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.MaximumSteps",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:5,max:100,step:1,style:{width:"100%"},precision:0,value:w.current,formatter:W=>Number(W).toFixed(0),onChange:W=>{w.current=Number(W),l(!a)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.CognitiveCoefficient",S)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:P.current,step:.01,onChange:W=>{P.current=Number(W),l(!a)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.SocialCoefficient",S)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:v.current,step:.01,onChange:W=>{v.current=Number(W),l(!a)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.InertiaWeight",S)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:C.current,step:.01,onChange:W=>{C.current=Number(W),l(!a)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.MaximumVelocity",S)+" [0.001, 0.1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:.001,max:.1,style:{width:"100%"},precision:3,value:b.current,step:.001,onChange:W=>{b.current=Number(W),l(!a)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.ConvergenceThreshold",S)+" [0, 0.1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:.001,max:.1,style:{width:"100%"},precision:3,value:T.current,step:.001,onChange:W=>{T.current=Number(W),l(!a)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.SearchMethod",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:g.current,style:{width:"100%"},value:g.current,onChange:W=>{g.current=Number(W),l(!a)},children:[h.jsx(UO,{value:us.GLOBAL_SEARCH_UNIFORM_SELECTION,children:E("optimizationMenu.GlobalSearchUniformSelection",S)},us.GLOBAL_SEARCH_UNIFORM_SELECTION),h.jsx(UO,{value:us.LOCAL_SEARCH_RANDOM_OPTIMIZATION,children:E("optimizationMenu.LocalSearchRandomOptimization",S)},us.LOCAL_SEARCH_RANDOM_OPTIMIZATION)]})})]}),g.current===us.LOCAL_SEARCH_RANDOM_OPTIMIZATION&&h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.LocalSearchRadius",S)+" ([0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:A.current,step:.01,onChange:W=>{A.current=Number(W),l(!a)}})})]})]})})},hy=({children:t,width:e="90px"})=>h.jsx("div",{style:{width:e},children:t}),Wuo=({element:t})=>{const e=not(t),n=Jt();return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:!!(t!=null&&t.showLabel),onChange:e,children:Y.t("labelSubMenu.KeepShowingLabel",n)})})},Nuo=({element:t})=>{const{labelText:e,setLabelText:n}=tot(t),o=oot(t,e),r=Jt();return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(as,{addonBefore:h.jsx(hy,{children:Y.t("labelSubMenu.LabelText",r)+":"}),value:e,onChange:i=>n(i.target.value),onPressEnter:o,onBlur:o})})},Uuo=({element:t})=>{const e=dGn(t),n=Jt();return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsx(hy,{children:Y.t("labelSubMenu.LabelHeight",n)+":"}),min:t.lz/2+.2,max:100,step:1,precision:1,value:t.labelHeight??t.lz/2+.2,onChange:o=>e(o)})})},juo=({element:t})=>{const e=sGn(t),n=Jt();return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsx(hy,{children:Y.t("labelSubMenu.LabelFontSize",n)+":"}),min:10,max:100,step:1,precision:0,value:t.labelFontSize??20,onChange:o=>e(o)})})},Buo=({element:t})=>{const e=cGn(t),n=Jt();return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsx(hy,{children:Y.t("labelSubMenu.LabelSize",n)+":"}),min:.2,max:5,step:.1,precision:1,value:t.labelSize??.2,onChange:o=>e(o)})})},Yuo=({element:t})=>{const e=uGn(t),n=Jt();return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(as,{addonBefore:h.jsx(hy,{children:Y.t("labelSubMenu.LabelColor",n)+":"}),value:t.labelColor??"#ffffff",onChange:o=>e(o.target.value)})})},PA=t=>[{key:`${t.type}-show-label`,label:h.jsx(Wuo,{element:t})},{key:`${t.type}-label-text`,label:h.jsx(Nuo,{element:t})},{key:`${t.type}-label-height`,label:h.jsx(Uuo,{element:t})},{key:`${t.type}-label-font-size`,label:h.jsx(juo,{element:t})},{key:`${t.type}-label-size`,label:h.jsx(Buo,{element:t})},{key:`${t.type}-label-color`,label:h.jsx(Yuo,{element:t})}],Ouo=[{key:"windowCount",objectType:z.Window},{key:"doorCount",objectType:z.Door},{key:"sensorCount",objectType:z.Sensor},{key:"outsideLightCount",objectType:z.Light},{key:"parabolicTroughCount",objectType:z.ParabolicTrough},{key:"parabolicDishCount",objectType:z.ParabolicDish},{key:"fresnelReflectorCount",objectType:z.FresnelReflector},{key:"heliostatCount",objectType:z.Heliostat},{key:"windTurbineCount",objectType:z.WindTurbine},{key:"polygonCount",objectType:z.Polygon},{key:"humanCount",objectType:z.Human},{key:"treeCount",objectType:z.Tree},{key:"flowerCount",objectType:z.Flower}],THe=(t,e)=>{const n={lng:H.getState().language};let o="",r="";switch(t){case z.Wall:{o=`${Y.t("foundationMenu.RemoveAllUnlockedWalls",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllWallsOnFoundation",n)} (${e} ${Y.t("foundationMenu.Walls",n)})`;break}case z.Window:{o=`${Y.t("foundationMenu.RemoveAllUnlockedWindows",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllWindowsOnFoundation",n)} (${e} ${Y.t("foundationMenu.Windows",n)})`;break}case z.Door:{o=`${Y.t("foundationMenu.RemoveAllUnlockedDoors",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllDoorsOnFoundation",n)} (${e} ${Y.t("foundationMenu.Doors",n)})`;break}case z.Sensor:{o=`${Y.t("foundationMenu.RemoveAllUnlockedSensors",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllSensorsOnFoundation",n)} (${e} ${Y.t("foundationMenu.Sensors",n)})`;break}case z.Light:{o=`${Y.t("foundationMenu.RemoveAllUnlockedLights",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllLightsOnFoundation",n)} (${e} ${Y.t("foundationMenu.Lights",n)})`;break}case z.ParabolicTrough:{o=`${Y.t("foundationMenu.RemoveAllUnlockedParabolicTroughs",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllParabolicTroughsOnFoundation",n)} (${e} ${Y.t("foundationMenu.ParabolicTroughs",n)})`;break}case z.ParabolicDish:{o=`${Y.t("foundationMenu.RemoveAllUnlockedParabolicDishes",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllParabolicDishesOnFoundation",n)} (${e} ${Y.t("foundationMenu.ParabolicDishes",n)})`;break}case z.FresnelReflector:{o=`${Y.t("foundationMenu.RemoveAllUnlockedFresnelReflectors",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllFresnelReflectorsOnFoundation",n)} (${e} ${Y.t("foundationMenu.FresnelReflectors",n)})`;break}case z.Heliostat:{o=`${Y.t("foundationMenu.RemoveAllUnlockedHeliostats",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllHeliostatsOnFoundation",n)} (${e} ${Y.t("foundationMenu.Heliostats",n)})`;break}case z.WindTurbine:{o=`${Y.t("foundationMenu.RemoveAllUnlockedWindTurbines",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllWindTurbinesOnFoundation",n)} (${e} ${Y.t("foundationMenu.WindTurbines",n)})`;break}case z.Polygon:{o=`${Y.t("foundationMenu.RemoveAllUnlockedPolygons",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllPolygonsOnFoundation",n)} (${e} ${Y.t("foundationMenu.Polygons",n)})`;break}case z.Human:{o=`${Y.t("foundationMenu.RemoveAllUnlockedHumans",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllHumansOnFoundation",n)} (${e} ${Y.t("foundationMenu.Humans",n)})`;break}case z.Tree:{o=`${Y.t("foundationMenu.RemoveAllUnlockedTrees",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllTreesOnFoundation",n)} (${e} ${Y.t("foundationMenu.Trees",n)})`;break}case z.Flower:{o=`${Y.t("foundationMenu.RemoveAllUnlockedFlowers",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllFlowersOnFoundation",n)} (${e} ${Y.t("foundationMenu.Flowers",n)})`;break}}return{itemLabel:o,modalTitle:r}},_uo=(t,e,n)=>n===z.Light?t.insideLightCount+t.outsideLightCount:t[e],Vuo=t=>{const e=H.getState().set,n=new Set;H.getState().elements.forEach(a=>{!a.locked&&a.type===z.Wall&&(a.parentId===t.id||a.foundationId===t.id)&&n.add(a.id)});const o=H.getState().elements.filter(a=>n.has(a.id)||n.has(a.parentId));e(a=>{a.elements=a.elements.filter(l=>!n.has(l.id)&&!n.has(l.parentId))});const r=JSON.parse(JSON.stringify(o)),i={name:"Remove All Walls on Foundation",timestamp:Date.now(),parentId:t.id,removedElements:r,undo:()=>{e(a=>{a.elements.push(...i.removedElements),a.updateWallMapOnFoundationFlag=!a.updateWallMapOnFoundationFlag})},redo:()=>{const a=new Set;H.getState().elements.forEach(l=>{!l.locked&&l.type===z.Wall&&l.parentId===i.parentId&&a.add(l.id)}),e(l=>{l.elements=l.elements.filter(s=>!a.has(s.id)&&!a.has(s.parentId))})}};H.getState().addUndoable(i)},Guo=(t,e,n)=>{const o=[],r={lng:H.getState().language};if(e.unlockedCount>0&&o.push({key:"lock-all-offsprings",label:h.jsx(_Ce,{foundation:t,lock:!0,count:e.unlockedCount})}),e.lockedCount>0&&o.push({key:"unlock-all-offsprings",label:h.jsx(_Ce,{foundation:t,lock:!1,count:e.lockedCount})}),n.wallCount>0){const{itemLabel:i,modalTitle:a}=THe(z.Wall,n.wallCount);o.push({key:"remove-all-walls-on-foundation",label:h.jsx(Cae,{foundation:t,objectType:z.Wall,modalTitle:a,onClickOk:()=>Vuo(t),children:i})})}if(n.solarPanelCount>0){const i=Y.t("foundationMenu.DoYouReallyWantToRemoveAllSolarPanelsOnFoundation",r)+" ("+n.solarPanelModuleCount+" "+Y.t("foundationMenu.SolarPanels",r)+", "+n.solarPanelCount+" "+Y.t("foundationMenu.Racks",r)+")?";o.push({key:"remove-all-solar-panels-on-foundation",label:h.jsxs(Cae,{foundation:t,objectType:z.SolarPanel,modalTitle:i,children:[Y.t("foundationMenu.RemoveAllUnlockedSolarPanels",r),"  (",n.solarPanelModuleCount," ",Y.t("foundationMenu.SolarPanels",r),", ",n.solarPanelCount," ",Y.t("foundationMenu.Racks",r),")"]})})}return Ouo.forEach(({key:i,objectType:a})=>{const l=_uo(n,i,a);if(typeof l=="number"&&l>0){const{itemLabel:s,modalTitle:c}=THe(a,l),u=a.replaceAll(" ","");o.push({key:`remove-all-${u}s-on-foundation`,label:h.jsx(Cae,{foundation:t,objectType:a,modalTitle:c,children:s})})}}),o},Xuo=()=>{const t=H.getState().elementsToPaste;if(t&&t.length>0){const e=t[0];if(e.type===z.Human||e.type===z.Tree||e.type===z.Flower||e.type===z.Polygon||e.type===z.Sensor||e.type===z.Light||e.type===z.SolarPanel||e.type===z.WaterHeater||e.type===z.ParabolicDish||e.type===z.Heliostat||e.type===z.FresnelReflector||e.type===z.ParabolicTrough||e.type===z.WindTurbine||e.type===z.Wall)return!0}return!1},Juo=t=>{const e=[];if(t.type!==z.Foundation)return{items:e};const n=t,o={lng:H.getState().language},r=!n.locked,i=!n.notBuilding&&me.getBuildingCompletionStatus(n,H.getState().elements)===jc.COMPLETE,a=H.getState().countAllOffspringsByTypeAtOnce(n.id,!0),l=H.getState().countAllOffspringsByTypeAtOnce(n.id,!1);return Xuo()&&e.push({key:"foundation-paste",label:h.jsx(eM,{})}),e.push({key:"foundation-copy",label:h.jsx(Ld,{})}),r&&e.push({key:"foundation-cut",label:h.jsx(Wd,{})}),e.push({key:"foundation-lock",label:h.jsx(Ju,{selectedElement:n})}),r&&e.push({key:"foundation-group-master",label:h.jsx(DQe,{groupableElement:n})}),e.push({key:"building",label:h.jsx(nGn,{foundation:n})}),a.gotSome()&&e.push({key:"lock-unlock-clear-on-foundation",label:h.jsx(rn,{children:Y.t("word.Elements",o)}),children:Guo(n,a,l)}),r&&((!n.textureType||n.textureType===Yi.NoTexture)&&e.push({key:"foundation-color",label:h.jsxs(to,{Dialog:uuo,children:[Y.t("word.Color",o)," ..."]})}),e.push({key:"foundation-texture",label:h.jsxs(to,{Dialog:fGn,children:[Y.t("word.Texture",o)," ..."]})}),e.push({key:"foundation-length",label:h.jsxs(to,{Dialog:duo,children:[Y.t("word.Length",o)," ..."]})}),e.push({key:"foundation-width",label:h.jsxs(to,{Dialog:fuo,children:[Y.t("word.Width",o)," ..."]})}),e.push({key:"foundation-height",label:h.jsxs(to,{Dialog:huo,children:[Y.t("word.Height",o)," ..."]})}),e.push({key:"foundation-azimuth",label:h.jsxs(to,{Dialog:puo,children:[Y.t("word.Azimuth",o)," ..."]})}),i&&e.push({key:"ground-floor-r-value",label:h.jsxs(to,{Dialog:guo,children:[Y.t("foundationMenu.GroundFloorRValue",o)," ..."]})})),e.push({key:"add-polygon-on-foundation",label:h.jsx(oGn,{foundation:n})}),!n.notBuilding&&a.wallCount>0&&e.push({key:"building-hvac-system",label:h.jsx(rn,{children:Y.t("word.BuildingHVACSystem",o)}),children:[{key:"hvac-system-id",label:h.jsx(rGn,{foundation:n})},{key:"thermostat-temperature",label:h.jsx(iGn,{foundation:n})},{key:"tolerance-threshold",label:h.jsx(aGn,{foundation:n})}]}),r&&(e.push({key:"select-solar-structure",label:h.jsx(rn,{children:Y.t("foundationMenu.SolarStructure",o)}),children:[{key:"select-solar-structure-submenu",label:h.jsx(lGn,{foundation:n}),style:{backgroundColor:"white"}}]}),n.solarStructure===Dn.FocusPipe&&e.push({key:"solar-absorber-pipe-physical-properties",label:h.jsx(rn,{children:Y.t("solarAbsorberPipeMenu.AbsorberPipePhysicalProperties",o)}),children:[{key:"solar-absorber-pipe-height",label:h.jsxs(to,{noPadding:!0,Dialog:muo,children:[Y.t("solarAbsorberPipeMenu.AbsorberHeight",o)," ..."]})},{key:"solar-absorber-pipe-aperture-width",label:h.jsxs(to,{noPadding:!0,Dialog:yuo,children:[Y.t("solarAbsorberPipeMenu.AbsorberApertureWidth",o)," ..."]})},{key:"foundation-solar-receiver-pipe-pole-number",label:h.jsxs(to,{noPadding:!0,Dialog:Auo,children:[Y.t("solarAbsorberPipeMenu.AbsorberPipePoleNumber",o)," ..."]})},{key:"solar-absorber-pipe-absorptance",label:h.jsxs(to,{noPadding:!0,Dialog:wuo,children:[Y.t("solarAbsorberPipeMenu.AbsorberAbsorptance",o)," ..."]})},{key:"solar-absorber-optical-efficiency",label:h.jsxs(to,{noPadding:!0,Dialog:vuo,children:[Y.t("solarAbsorberPipeMenu.AbsorberOpticalEfficiency",o)," ..."]})},{key:"solar-absorber-thermal-efficiency",label:h.jsxs(to,{noPadding:!0,Dialog:xuo,children:[Y.t("solarAbsorberPipeMenu.AbsorberThermalEfficiency",o)," ..."]})}]}),n.solarStructure===Dn.FocusTower&&e.push({key:"solar-power-tower-physical-properties",label:h.jsx(rn,{children:Y.t("solarPowerTowerMenu.ReceiverTowerPhysicalProperties",o)}),children:[{key:"solar-power-tower-height",label:h.jsxs(to,{noPadding:!0,Dialog:buo,children:[Y.t("solarPowerTowerMenu.ReceiverTowerHeight",o)," ..."]})},{key:"solar-power-tower-radius",label:h.jsxs(to,{noPadding:!0,Dialog:Suo,children:[Y.t("solarPowerTowerMenu.ReceiverTowerRadius",o)," ..."]})},{key:"solar-power-tower-receiver-absorptance",label:h.jsxs(to,{noPadding:!0,Dialog:Tuo,children:[Y.t("solarPowerTowerMenu.ReceiverAbsorptance",o)," ..."]})},{key:"solar-power-tower-receiver-optical-efficiency",label:h.jsxs(to,{noPadding:!0,Dialog:Cuo,children:[Y.t("solarPowerTowerMenu.ReceiverOpticalEfficiency",o)," ..."]})},{key:"solar-power-tower-receiver-thermal-efficiency",label:h.jsxs(to,{noPadding:!0,Dialog:Puo,children:[Y.t("solarPowerTowerMenu.ReceiverThermalEfficiency",o)," ..."]})}]}),n.solarStructure===Dn.UpdraftTower&&e.push({key:"solar-updraft-tower-physical-properties",label:h.jsx(rn,{children:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerPhysicalProperties",o)}),children:[{key:"solar-updraft-tower-chimney-height",label:h.jsxs(to,{noPadding:!0,Dialog:Ruo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerChimneyHeight",o)," ..."]})},{key:"solar-updraft-tower-chimney-radius",label:h.jsxs(to,{noPadding:!0,Dialog:Huo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerChimneyRadius",o)," ..."]})},{key:"solar-updraft-tower-collector-height",label:h.jsxs(to,{noPadding:!0,Dialog:Muo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorHeight",o)," ..."]})},{key:"solar-updraft-tower-collector-radius",label:h.jsxs(to,{noPadding:!0,Dialog:Iuo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorRadius",o)," ..."]})},{key:"solar-updraft-tower-collector-transmissivity",label:h.jsxs(to,{noPadding:!0,Dialog:zuo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorTransmissivity",o)," ..."]})},{key:"solar-updraft-tower-collector-emissivity",label:h.jsxs(to,{noPadding:!0,Dialog:Duo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorEmissivity",o)," ..."]})},{key:"solar-updraft-tower-discharge-coefficient",label:h.jsxs(to,{noPadding:!0,Dialog:Euo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerDischargeCoefficient",o)," ..."]})},{key:"solar-updraft-tower-turbine-efficiency",label:h.jsxs(to,{noPadding:!0,Dialog:Fuo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerTurbineEfficiency",o)," ..."]})}]})),e.push({key:"optimization",label:h.jsx(rn,{children:Y.t("optimizationMenu.Optimization",o)}),children:[{key:"genetic-algorithms",label:h.jsx(rn,{noPadding:!0,children:Y.t("optimizationMenu.GeneticAlgorithm",o)}),disabled:l.solarPanelCount===0,children:[{key:"solar-panel-tilt-angle-ga-optimizer",label:h.jsxs(to,{noPadding:!0,Dialog:kuo,children:[Y.t("optimizationMenu.SolarPanelTiltAngleOptimization",o),"..."]})}]},{key:"particle-swarm-optimization",label:h.jsx(rn,{noPadding:!0,children:Y.t("optimizationMenu.ParticleSwarmOptimization",o)}),disabled:l.solarPanelCount===0,children:[{key:"solar-panel-tilt-angle-pso-optimizer",label:h.jsxs(to,{noPadding:!0,Dialog:Luo,children:[Y.t("optimizationMenu.SolarPanelTiltAngleOptimization",o),"..."]})}]}]}),r&&e.push({key:"foundation-label",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",o)}),children:PA(n)}),{items:e}},Kuo=be.memo(({cuboid:t})=>{const e=Jt(),n=()=>{H.getState().set(o=>{for(const r of o.elements)if(r.id===t.id&&r.type===z.Cuboid){const i=r,a=!i.stackable;i.stackable=a,o.actionState.cuboidStackable=a;break}})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.stackable,onChange:n,children:Y.t("cuboidMenu.Stackable",e)})})}),quo=be.memo(({cuboid:t,selectedSideIndex:e})=>{const n=Jt(),o=H.getState().set,r=()=>{o(c=>{c.objectTypeToAdd=z.Polygon});const{pos:i}=me.getWorldDataById(t.id);let a;switch(e){case 0:a=Op;break;case 1:a=_p;break;case 2:a=Oc;break;case 3:a=Vp;break;default:a=Io,i.z=t.lz}const l=H.getState().addElement(t,i,a),s={name:"Add",timestamp:Date.now(),addedElement:l,undo:()=>{H.getState().removeElementById(s.addedElement.id,!1)},redo:()=>{o(c=>{c.elements.push(s.addedElement),c.selectedElement=s.addedElement})}};H.getState().addUndoable(s),o(c=>{c.objectTypeToAdd=z.None})};return h.jsx(rn,{onClick:r,children:Y.t("cuboidMenu.AddPolygon",n)})}),PHe=be.memo(({cuboid:t,objectType:e,modalTitle:n,onClickOk:o,children:r})=>{const i=H.getState().removeAllChildElementsByType,a=()=>{const s=H.getState().elements.filter(d=>!d.locked&&d.type===e&&d.parentId===t.id);i(t.id,e);const c=JSON.parse(JSON.stringify(s)),u={name:`Remove All ${e}s on Cuboid`,timestamp:Date.now(),parentId:t.id,removedElements:c,undo:()=>{H.getState().set(d=>{d.elements.push(...u.removedElements)})},redo:()=>{i(u.parentId,e)}};H.getState().addUndoable(u)},l=()=>{const s=o??a;Oi.confirm({title:n,icon:h.jsx(ny,{}),onOk:s})};return h.jsx(rn,{noPadding:!0,onClick:l,children:r})}),$uo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(Rb),i=H(Hb),a=H(eYe),l=H(no),s=H(Zn),c=co(z.Cuboid),[u,d]=m.useState((c==null?void 0:c.color)??"#808080"),[f,p]=m.useState(!1),g=Jt();m.useEffect(()=>{P()},[c,a]);const y=(R,M,D)=>{e(E=>{for(const W of E.elements)if(W.type===z.Cuboid&&W.id===M&&!W.locked){const j=W;j.faceColors||(j.faceColors=new Array(6),j.faceColors.fill(j.color??D)),j.faceColors[R]=D;break}})},w=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.Cuboid&&E.id===R&&!E.locked){E.color=M;const W=E;W.faceColors||(W.faceColors=new Array(6));for(let j=0;j<4;j++)W.faceColors[j]=M;break}})},b=R=>{e(M=>{for(const D of M.elements)if(D.type===z.Cuboid&&!D.locked){D.color=R;const E=D;E.faceColors||(E.faceColors=new Array(6));for(let W=0;W<4;W++)E.faceColors[W]=R}})},C=R=>{i(R.target.value),p(!f)},P=()=>{c&&(a>=0&&c.faceColors?d(c.faceColors[a]):d(c.color??"#808080"))},v=R=>{if(c){switch(r){case oe.AllSelectedObjectsOfThisType:for(const M of n)if(M.type===z.Cuboid&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)){const D=M;if(D.faceColors){for(let E=0;E<4;E++)if(R!==D.faceColors[E])return!0}else if(R!==D.color)return!0}break;case oe.AllObjectsOfThisType:for(const M of n)if(M.type===z.Cuboid&&!M.locked){const D=M;if(D.faceColors){for(let E=0;E<4;E++)if(R!==D.faceColors[E])return!0}else if(R!==D.color)return!0}break;case oe.OnlyThisObject:if(c.faceColors){for(let M=0;M<4;M++)if(R!==c.faceColors[M])return!0}else if(R!==(c==null?void 0:c.color))return!0;break;default:if(a>=0){const M=c!=null&&c.faceColors?c==null?void 0:c.faceColors[a]:c==null?void 0:c.color;if(R!==M)return!0}else if(R!==(c==null?void 0:c.color))return!0}return!1}},T=R=>{if(c&&v(R)){switch(r){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of n)if(E.type===z.Cuboid&&H.getState().selectedElementIdSet.has(E.id)){const W=E;if(W.faceColors)M.set(E.id,[...W.faceColors]);else{const j=W.color??"#808080";M.set(E.id,[j,j,j,j,j,j])}}const D={name:"Set Color for Selected Cuboids",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())if(W&&Array.isArray(W))for(let j=0;j{for(const[E,W]of D.oldValues.entries())if(W&&Array.isArray(W))for(let j=0;j{E.actionState.cuboidFaceColors||(E.actionState.cuboidFaceColors=["#808080","#808080","#808080","#808080","#808080","#808080"]);for(let W=0;W<4;W++)E.actionState.cuboidFaceColors[W]=R});break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of n)if(E.type===z.Cuboid){const W=E;if(W.faceColors)M.set(E.id,[...W.faceColors]);else{const j=W.color??"#808080";M.set(E.id,[j,j,j,j,j,j])}}const D={name:"Set Color for All Cuboids",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())if(W&&Array.isArray(W))for(let j=0;j{b(D.newValue)}};o(D),b(R),s(l+1),e(E=>{E.actionState.cuboidFaceColors||(E.actionState.cuboidFaceColors=["#808080","#808080","#808080","#808080","#808080","#808080"]);for(let W=0;W<4;W++)E.actionState.cuboidFaceColors[W]=R});break}case oe.OnlyThisObject:{let M;if(c.faceColors)M=[...c.faceColors];else{const E=c.color??"#808080";M=[E,E,E,E,E,E]}const D={name:"Set Color for All Sides of Selected Cuboid",timestamp:Date.now(),oldValue:M,newValue:R,changedElementId:c.id,changedElementType:c.type,undo:()=>{if(D.oldValue&&Array.isArray(D.oldValue))for(let E=0;E{w(D.changedElementId,D.newValue)}};o(D),w(c.id,R),s(l+1),e(E=>{E.actionState.cuboidFaceColors||(E.actionState.cuboidFaceColors=["#808080","#808080","#808080","#808080","#808080","#808080"]);for(let W=0;W<4;W++)E.actionState.cuboidFaceColors[W]=R});break}default:{if(a>=0){const M=c.faceColors?c.faceColors[a]:c.color,D={name:"Set Color for Selected Side of Cuboid",timestamp:Date.now(),oldValue:M,newValue:R,changedElementId:c.id,changedElementType:c.type,changedSideIndex:a,undo:()=>{D.changedSideIndex!==void 0&&y(D.changedSideIndex,D.changedElementId,D.oldValue)},redo:()=>{D.changedSideIndex!==void 0&&y(D.changedSideIndex,D.changedElementId,D.newValue)}};o(D),y(a,c.id,R),s(l+1),e(E=>{E.actionState.cuboidFaceColors||(E.actionState.cuboidFaceColors=["#808080","#808080","#808080","#808080","#808080","#808080"]),E.actionState.cuboidFaceColors[a]=R})}break}}p(!f)}},A=()=>{P(),t(!1)},x=()=>{T(u),t(!1),s(0)},S=a>=0&&(c!=null&&c.faceColors)?c.faceColors[a]:(c==null?void 0:c.color)??"#808080";return h.jsx(so,{width:600,title:Y.t("word.Color",g),onApply:x,onClose:A,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(zf,{color:u??S,onChangeComplete:R=>{d(R.hex),p(!f)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:12,children:h.jsx(Ue.Group,{onChange:C,value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("cuboidMenu.OnlyThisSide",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("cuboidMenu.AllSidesOfThisCuboid",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("cuboidMenu.AllSidesOfSelectedCuboids",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("cuboidMenu.AllSidesOfAllCuboids",g)})]})})})]})})},Quo="/aladdin/assets/building_facade_01_menu-BAm4EVGn.png",Zuo="/aladdin/assets/building_facade_02_menu-BylQ9E0j.png",edo="/aladdin/assets/building_facade_03_menu-DfU_cdlP.png",tdo="/aladdin/assets/building_facade_04_menu-Bz2bcbq0.png",ndo="/aladdin/assets/building_facade_05_menu-hF6OsAF0.png",odo="/aladdin/assets/building_facade_06_menu-CUmtyI19.png",rdo="/aladdin/assets/building_facade_07_menu-B8_DYqYz.png",ido="/aladdin/assets/building_facade_08_menu-CTA_rxim.png",ado="/aladdin/assets/building_facade_09_menu-BpQDoLbY.png",ldo="/aladdin/assets/building_facade_10_menu-z_jZrQMT.png",sdo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(Rb),i=H(Hb),a=H(eYe),l=H(no),s=H(Zn),c=co(z.Cuboid),[u,d]=m.useState(c&&c.textureTypes&&a>=0?c.textureTypes[a]:Co.NoTexture),f=Jt(),{Option:p}=_o;m.useEffect(()=>{c&&d(c.textureTypes&&a>=0?c.textureTypes[a]:Co.NoTexture)},[c,a]);const g=(x,S,R)=>{e(M=>{for(const D of M.elements)if(D.type===z.Cuboid&&D.id===S&&!D.locked){const E=D;E.textureTypes||(E.textureTypes=new Array(6),E.textureTypes.fill(Co.NoTexture)),E.textureTypes[x]=R;break}})},y=(x,S)=>{e(R=>{for(const M of R.elements)if(M.type===z.Cuboid&&M.id===x&&!M.locked){const D=M;D.textureTypes||(D.textureTypes=new Array(6),D.textureTypes.fill(Co.NoTexture));for(let E=0;E<4;E++)D.textureTypes[E]=S;break}})},w=(x,S)=>{e(R=>{for(const M of R.elements)if(M.type===z.Cuboid&&!M.locked&&x.has(M.id)){const D=M;if(D.textureTypes||(D.textureTypes=new Array(6),D.textureTypes.fill(Co.NoTexture)),S!==void 0)for(let E=0;E<4;E++)D.textureTypes[E]=S;else{const E=x.get(M.id);if(E&&E.length>=4)for(let W=0;W<4;W++)D.textureTypes[W]=E[W]}}})},b=x=>{e(S=>{for(const R of S.elements)if(R.type===z.Cuboid&&!R.locked){const M=R;M.textureTypes||(M.textureTypes=new Array(6),M.textureTypes.fill(Co.NoTexture));for(let D=0;D<4;D++)M.textureTypes[D]=x}})},C=x=>{i(x.target.value)},P=x=>{if(c){switch(r){case oe.AllSelectedObjectsOfThisType:for(const S of n)if(S.type===z.Cuboid&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)){const R=S;if(R.textureTypes){for(let M=0;M<4;M++)if(x!==R.textureTypes[M])return!0}}break;case oe.AllObjectsOfThisType:for(const S of n)if(S.type===z.Cuboid&&!S.locked){const R=S;if(R.textureTypes){for(let M=0;M<4;M++)if(x!==R.textureTypes[M])return!0}}break;case oe.OnlyThisObject:if(c.textureTypes){for(let S=0;S<4;S++)if(x!==c.textureTypes[S])return!0}break;default:if(a>=0&&c.textureTypes&&x!==c.textureTypes[a])return!0}return!1}},v=x=>{if(c&&P(x))switch(r){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of n)if(M.type===z.Cuboid&&H.getState().selectedElementIdSet.has(M.id)){const D=M;S.set(M.id,D.textureTypes?[...D.textureTypes]:void 0)}const R={name:"Set Texture for Selected Cuboids",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())if(D&&Array.isArray(D))for(let E=0;E{w(R.oldValues,R.newValue)}};o(R),w(S,x),s(l+1),e(M=>{M.actionState.cuboidFaceTextures||(M.actionState.cuboidFaceTextures=[Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture]);for(let D=0;D<4;D++)M.actionState.cuboidFaceTextures[D]=x});break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of n)if(M.type===z.Cuboid){const D=M;S.set(M.id,D.textureTypes?[...D.textureTypes]:void 0)}const R={name:"Set Texture for All Cuboids",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())if(D&&Array.isArray(D))for(let E=0;E{b(R.newValue)}};o(R),b(x),s(l+1),e(M=>{M.actionState.cuboidFaceTextures||(M.actionState.cuboidFaceTextures=[Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture]);for(let D=0;D<4;D++)M.actionState.cuboidFaceTextures[D]=x});break}case oe.OnlyThisObject:{const S=c.textureTypes?[...c.textureTypes]:void 0,R={name:"Set Texture for All Sides of Selected Cuboid",timestamp:Date.now(),oldValue:S,newValue:x,changedElementId:c.id,changedElementType:c.type,undo:()=>{if(R.oldValue&&Array.isArray(R.oldValue))for(let M=0;M{y(R.changedElementId,R.newValue)}};o(R),y(c.id,x),s(l+1),e(M=>{M.actionState.cuboidFaceTextures||(M.actionState.cuboidFaceTextures=[Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture]);for(let D=0;D<4;D++)M.actionState.cuboidFaceTextures[D]=x});break}default:{if(a>=0){const S=c.textureTypes?c.textureTypes[a]:Co.NoTexture,R={name:"Set Texture for Selected Side of Cuboid",timestamp:Date.now(),oldValue:S,newValue:x,changedElementId:c.id,changedElementType:c.type,changedSideIndex:a,undo:()=>{R.changedSideIndex!==void 0&&g(R.changedSideIndex,R.changedElementId,R.oldValue)},redo:()=>{R.changedSideIndex!==void 0&&g(R.changedSideIndex,R.changedElementId,R.newValue)}};o(R),g(a,c.id,x),s(l+1),e(M=>{M.actionState.cuboidFaceTextures||(M.actionState.cuboidFaceTextures=[Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture]),M.actionState.cuboidFaceTextures[a]=x})}break}}},T=()=>{c!=null&&c.textureTypes&&a>=0&&d(c.textureTypes[a]),t(!1)},A=()=>{v(u)};return h.jsx(so,{width:600,title:Y.t("word.Texture",f),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{style:{width:"150px"},value:u,onChange:d,children:[h.jsxs(p,{value:Co.NoTexture,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"32px",height:"20px",border:"1px dashed dimGray"},children:" "}),Y.t("shared.NoTexture",f)]},Co.NoTexture),h.jsxs(p,{value:Co.Facade01,children:[h.jsx("img",{alt:Co.Facade01,src:Quo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture01",f)]},Co.Facade01),h.jsxs(p,{value:Co.Facade02,children:[h.jsx("img",{alt:Co.Facade02,src:Zuo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture02",f)]},Co.Facade02),h.jsxs(p,{value:Co.Facade03,children:[h.jsx("img",{alt:Co.Facade03,src:edo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture03",f)]},Co.Facade03),h.jsxs(p,{value:Co.Facade04,children:[h.jsx("img",{alt:Co.Facade04,src:tdo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture04",f)]},Co.Facade04),h.jsxs(p,{value:Co.Facade05,children:[h.jsx("img",{alt:Co.Facade05,src:ndo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture05",f)]},Co.Facade05),h.jsxs(p,{value:Co.Facade06,children:[h.jsx("img",{alt:Co.Facade06,src:odo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture06",f)]},Co.Facade06),h.jsxs(p,{value:Co.Facade07,children:[h.jsx("img",{alt:Co.Facade07,src:rdo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture07",f)]},Co.Facade07),h.jsxs(p,{value:Co.Facade08,children:[h.jsx("img",{alt:Co.Facade08,src:ido,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture08",f)]},Co.Facade08),h.jsxs(p,{value:Co.Facade09,children:[h.jsx("img",{alt:Co.Facade09,src:ado,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture09",f)]},Co.Facade09),h.jsxs(p,{value:Co.Facade10,children:[h.jsx("img",{alt:Co.Facade10,src:ldo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture10",f)]},Co.Facade10)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:12,children:h.jsx(Ue.Group,{onChange:C,value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("cuboidMenu.OnlyThisSide",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("cuboidMenu.AllSidesOfThisCuboid",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("cuboidMenu.AllSidesOfSelectedCuboids",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("cuboidMenu.AllSidesOfAllCuboids",f)})]})})})]})})},cdo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(EH),r=H(tYe),i=H(u3),a=H(zw),l=H(c3),s=H(En),c=H(Rb),u=H(Hb),d=H(fn),f=H(no),p=H(Zn),g=H(Vi),y=co(z.Cuboid),[w,b]=m.useState((y==null?void 0:y.lx)??0),C=m.useRef(new Map),P=m.useRef(new Map),v=m.useRef(new Map),T=m.useRef(new Map),A=m.useRef(new Map),x=m.useRef(new Map),S=m.useRef(new Map),R=m.useRef(new Map),M=m.useRef(!1),D=m.useRef(),E=Jt(),W=re=>{u(re.target.value)},j=re=>{if(y){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const ae of e)if(ae.type===z.Cuboid&&H.getState().selectedElementIdSet.has(ae.id)){const se=ae,ne=o(se.id);if(ne.length>0&&!me.doesNewSizeContainAllChildren(se,ne,re,se.ly))return!1}break}case oe.AllObjectsOfThisType:{for(const ae of e)if(ae.type===z.Cuboid){const se=ae,ne=o(se.id);if(ne.length>0&&!me.doesNewSizeContainAllChildren(se,ne,re,se.ly))return!1}break}default:{const ae=o(y.id);if(ae.length>0)return me.doesNewSizeContainAllChildren(y,ae,re,y.ly);break}}return!0}},L=re=>!j(re),k=re=>{if(y){switch(c){case oe.AllSelectedObjectsOfThisType:for(const ae of e)if(ae.type===z.Cuboid&&!ae.locked&&H.getState().selectedElementIdSet.has(ae.id)&&Math.abs(ae.lx-re)>It)return!0;break;case oe.AllObjectsOfThisType:for(const ae of e)if(ae.type===z.Cuboid&&!ae.locked&&Math.abs(ae.lx-re)>It)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const ae of e)if(ae.type===z.Cuboid&&ae.parentId===(y==null?void 0:y.parentId)&&!ae.locked&&Math.abs(ae.lx-re)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:break;default:if(Math.abs((y==null?void 0:y.lx)-re)>It)return!0}return!1}},N=(re,ae)=>{if(re==null)return null;for(const se of re.children)if(se.name.includes(`${ae}`))return se;return null},F=(re,ae,se)=>{var ne,fe;if(re){for(const ge of re.children)if(ge.name.includes(`${se.id}`)){(fe=(ne=Fn.getState().contentRef)==null?void 0:ne.current)==null||fe.add(ge);break}d(ge=>{for(const de of ge.elements)if(de.id===se.id){de.parentId=Zo;const Z=new Xt(de.cx,de.cy).rotateAround(si,ae.rotation[2]).add(new Xt(ae.cx,ae.cy));de.cx=Z.x,de.cy=Z.y,de.cz=0,T.current.set(de.id,new ie(Z.x,Z.y,0)),P.current.set(de.id,Zo);break}})}},U=re=>{for(const ae of e)ae.type===z.Cuboid&&!ae.locked&&ae.parentId===(y==null?void 0:y.parentId)&&O(ae,re)},O=(re,ae)=>{const se=o(re.id),ne=re.rotation[2];if(A.current.clear(),R.current.clear(),se.length>0)for(const fe of se){if(me.isIdentical(fe.normal,rs))switch(fe.type){case z.Sensor:{const ge=new Xt(fe.cx*re.lx,fe.cy*re.ly).rotateAround(si,ne);A.current.set(fe.id,ge),v.current.set(fe.id,new ie(fe.cx,fe.cy));break}case z.Polygon:{const ge=fe,de=[];for(const Z of ge.vertices)de.push(new Xt(Z.x*re.lx,Z.y*re.ly).rotateAround(si,ne));R.current.set(fe.id,de),x.current.set(fe.id,ge.vertices.map(Z=>({...Z})));break}}else fe.type===z.SolarPanel&&(me.isEqual(fe.normal[0],-1)||me.isEqual(fe.normal[0],1))&&v.current.set(fe.id,new ie(fe.cx,fe.cy,fe.cz));me.isPlantOrHuman(fe)&&v.current.set(fe.id,new ie(fe.cx,fe.cy,fe.cz))}if(i(re.id,ae),se.length>0)for(const fe of se){if(me.isIdentical(fe.normal,rs))switch(fe.type){case z.Sensor:{const ge=A.current.get(fe.id);if(ge){const Z=new Xt(ge.x,ge.y).rotateAround(si,-ne).x/ae;r(fe.id,Z),T.current.set(fe.id,new ie(Z,fe.cy))}break}case z.Polygon:{const ge=R.current.get(fe.id);if(ge){const de=[];for(const Z of ge){const he=Z.rotateAround(si,-ne),xe=he.x/ae,He=he.y/re.ly;de.push({x:xe,y:He})}a(fe.id,de),S.current.set(fe.id,de.map(Z=>({...Z})))}break}}else fe.type===z.SolarPanel&&(me.isEqual(fe.normal[0],-1)&&(r(fe.id,-ae/2),T.current.set(fe.id,new ie(-ae/2,fe.cy,fe.cz))),me.isEqual(fe.normal[0],1)&&(r(fe.id,ae/2),T.current.set(fe.id,new ie(ae/2,fe.cy,fe.cz))));if(me.isPlantOrHuman(fe)){if(T.current.set(fe.id,new ie(fe.cx,fe.cy,fe.cz)),C.current.set(fe.id,re.id),Math.abs(fe.cz-re.lz/2)0){const ge=Fn.getState().contentRef,de=N(ge==null?void 0:ge.current,re.id);F(de,re,fe)}}else if(Math.abs(Math.abs(fe.cx)-re.lx/2)0?ae:-ae)/2;r(fe.id,ge),T.current.set(fe.id,new ie(ge,fe.cy,fe.cz))}}}},B=(re,ae,se)=>{if(!re||!ae)return;const ne=Fn.getState().contentRef,fe=N(ne==null?void 0:ne.current,ae),ge=N(ae===Zo?ne==null?void 0:ne.current:fe,se);if(ge&&(ne!=null&&ne.current)){if(re===Zo)ne.current.add(ge);else{const de=N(ne.current,re);de==null||de.add(ge)}np()}},_=(re,ae)=>{re&&d(se=>{for(const ne of se.elements)if(ne.id===ae){ne.parentId=re;break}})},X=re=>{if(!y||!k(re))return;const ae=n(y.id),se=ae?ae.lx:y.lx;if(D.current=void 0,M.current=L(re),M.current)D.current=re,b(se);else switch(c){case oe.AllSelectedObjectsOfThisType:{const ne=new Map;for(const ge of e)ge.type===z.Cuboid&&!ge.locked&&H.getState().selectedElementIdSet.has(ge.id)&&(ne.set(ge.id,ge.lx),O(ge,re));const fe={name:"Set Length for Selected Cuboids",timestamp:Date.now(),oldSizes:ne,newSize:re,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())i(Z,he);if(fe.oldChildrenPositionsMap&&fe.oldChildrenPositionsMap.size>0)for(const[Z,he]of fe.oldChildrenPositionsMap.entries()){l(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(xe,He,Z),_(xe,Z))}if(fe.oldChildrenVerticesMap&&fe.oldChildrenVerticesMap.size>0)for(const[Z,he]of fe.oldChildrenVerticesMap.entries())a(Z,he)},redo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())i(Z,fe.newSize);if(fe.newChildrenPositionsMap&&fe.newChildrenPositionsMap.size>0)for(const[Z,he]of fe.newChildrenPositionsMap.entries()){l(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(He,xe,Z),_(He,Z))}if(fe.newChildrenVerticesMap&&fe.newChildrenVerticesMap.size>0)for(const[Z,he]of fe.newChildrenVerticesMap.entries())a(Z,he)}};s(fe),p(f+1);break}case oe.AllObjectsOfThisTypeOnSurface:{const ne=new Map;for(const ge of e)ge.type===z.Cuboid&&ge.parentId===y.parentId&&!ge.locked&&(ne.set(ge.id,ge.lx),O(ge,re));const fe={name:"Set Length for All Cuboids on Surface",timestamp:Date.now(),oldSizes:ne,newSize:re,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())i(Z,he);if(fe.oldChildrenPositionsMap&&fe.oldChildrenPositionsMap.size>0)for(const[Z,he]of fe.oldChildrenPositionsMap.entries()){l(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(xe,He,Z),_(xe,Z))}if(fe.oldChildrenVerticesMap&&fe.oldChildrenVerticesMap.size>0)for(const[Z,he]of fe.oldChildrenVerticesMap.entries())a(Z,he)},redo:()=>{var ge,de;if(U(fe.newSize),fe.newChildrenPositionsMap&&fe.newChildrenPositionsMap.size>0)for(const[Z,he]of fe.newChildrenPositionsMap.entries()){l(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(He,xe,Z),_(He,Z))}if(fe.newChildrenVerticesMap&&fe.newChildrenVerticesMap.size>0)for(const[Z,he]of fe.newChildrenVerticesMap.entries())a(Z,he)}};s(fe),p(f+1);break}case oe.AllObjectsOfThisType:{const ne=new Map;for(const ge of e)ge.type===z.Cuboid&&!ge.locked&&(ne.set(ge.id,ge.lx),O(ge,re));const fe={name:"Set Length for All Cuboids",timestamp:Date.now(),oldSizes:ne,newSize:re,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())i(Z,he);if(fe.oldChildrenPositionsMap&&fe.oldChildrenPositionsMap.size>0)for(const[Z,he]of fe.oldChildrenPositionsMap.entries()){l(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(xe,He,Z),_(xe,Z))}if(fe.oldChildrenVerticesMap&&fe.oldChildrenVerticesMap.size>0)for(const[Z,he]of fe.oldChildrenVerticesMap.entries())a(Z,he)},redo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())i(Z,fe.newSize);if(fe.newChildrenPositionsMap&&fe.newChildrenPositionsMap.size>0)for(const[Z,he]of fe.newChildrenPositionsMap.entries()){l(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(He,xe,Z),_(He,Z))}if(fe.newChildrenVerticesMap&&fe.newChildrenVerticesMap.size>0)for(const[Z,he]of fe.newChildrenVerticesMap.entries())a(Z,he)}};s(fe),p(f+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:break;default:{O(y,re);const ne={name:"Set Cuboid Length",timestamp:Date.now(),oldSize:se,newSize:re,resizedElementId:y.id,resizedElementType:y.type,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var fe,ge;if(i(y.id,ne.oldSize),ne.oldChildrenPositionsMap&&ne.oldChildrenPositionsMap.size>0)for(const[de,Z]of ne.oldChildrenPositionsMap.entries()){l(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(B(he,xe,de),_(he,de))}if(ne.oldChildrenVerticesMap&&ne.oldChildrenVerticesMap.size>0)for(const[de,Z]of ne.oldChildrenVerticesMap.entries())a(de,Z)},redo:()=>{var fe,ge;if(i(y.id,ne.newSize),ne.newChildrenPositionsMap&&ne.newChildrenPositionsMap.size>0)for(const[de,Z]of ne.newChildrenPositionsMap.entries()){l(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(B(xe,he,de),_(xe,de))}if(ne.newChildrenVerticesMap&&ne.newChildrenVerticesMap.size>0)for(const[de,Z]of ne.newChildrenVerticesMap.entries())a(de,Z)}};s(ne),p(f+1);break}}},$=()=>{t(!1)},Q=()=>{$(),g()},le=()=>{X(w),M.current||(t(!1),p(0))},q=()=>{X(w)},te=M.current?": "+Y.t("message.NotApplicableToSelectedAction",E)+(D.current!==void 0?" ("+D.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Length",E),rejectedMessage:te,onApply:q,onClose:$,onClickCancel:Q,onClickOk:le,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:500,style:{width:120},step:.5,precision:2,value:w,onChange:re=>{re!==null&&b(re)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",E),": [0.1, 500] ",Y.t("word.MeterAbbreviation",E)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",E)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:W,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("cuboidMenu.OnlyThisCuboid",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("cuboidMenu.AllCuboidsOnSameSurface",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("cuboidMenu.AllSelectedCuboids",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("cuboidMenu.AllCuboids",E)})]})})})]})})},udo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(EH),r=H(c3),i=H(nYe),a=H(Iw),l=H(zw),s=H(En),c=H(Rb),u=H(Hb),d=H(fn),f=H(no),p=H(Zn),g=H(Vi),y=co(z.Cuboid),[w,b]=m.useState((y==null?void 0:y.ly)??0),C=m.useRef(new Map),P=m.useRef(new Map),v=m.useRef(new Map),T=m.useRef(new Map),A=m.useRef(new Map),x=m.useRef(new Map),S=m.useRef(new Map),R=m.useRef(new Map),M=m.useRef(!1),D=m.useRef(),E=Jt(),W=re=>{u(re.target.value)},j=re=>{if(y){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const ae of e)if(ae.type===z.Cuboid&&H.getState().selectedElementIdSet.has(ae.id)){const se=ae,ne=o(se.id);if(ne.length>0&&!me.doesNewSizeContainAllChildren(se,ne,se.lx,re))return!1}break}case oe.AllObjectsOfThisType:{for(const ae of e)if(ae.type===z.Cuboid){const se=ae,ne=o(se.id);if(ne.length>0&&!me.doesNewSizeContainAllChildren(se,ne,se.lx,re))return!1}break}default:{const ae=o(y.id);if(ae.length>0)return me.doesNewSizeContainAllChildren(y,ae,y.lx,re);break}}return!0}},L=re=>!j(re),k=re=>{if(y){switch(c){case oe.AllSelectedObjectsOfThisType:for(const ae of e)if(ae.type===z.Cuboid&&!ae.locked&&H.getState().selectedElementIdSet.has(ae.id)&&Math.abs(ae.ly-re)>It)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const ae of e)if(ae.type===z.Cuboid&&ae.parentId===(y==null?void 0:y.parentId)&&!ae.locked&&Math.abs(ae.ly-re)>It)return!0;break;case oe.AllObjectsOfThisType:{for(const ae of e)if(ae.type===z.Cuboid&&!ae.locked&&Math.abs(ae.ly-re)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:break;default:if(Math.abs((y==null?void 0:y.ly)-re)>It)return!0}return!1}},N=(re,ae)=>{if(re==null)return null;for(const se of re.children)if(se.name.includes(`${ae}`))return se;return null},F=(re,ae,se)=>{var ne,fe;if(re){for(const ge of re.children)if(ge.name.includes(`${se.id}`)){(fe=(ne=Fn.getState().contentRef)==null?void 0:ne.current)==null||fe.add(ge);break}d(ge=>{for(const de of ge.elements)if(de.id===se.id){de.parentId=Zo;const Z=new Xt(de.cx,de.cy).rotateAround(si,ae.rotation[2]).add(new Xt(ae.cx,ae.cy));de.cx=Z.x,de.cy=Z.y,de.cz=0,T.current.set(de.id,new ie(Z.x,Z.y,0)),P.current.set(de.id,Zo);break}})}},U=re=>{for(const ae of e)ae.type===z.Cuboid&&!ae.locked&&ae.parentId===(y==null?void 0:y.parentId)&&O(ae,re)},O=(re,ae)=>{const se=o(re.id),ne=re.rotation[2];if(A.current.clear(),R.current.clear(),se.length>0)for(const fe of se){if(me.isIdentical(fe.normal,rs))switch(fe.type){case z.Sensor:{const ge=new Xt(fe.cx*re.lx,fe.cy*re.ly).rotateAround(si,ne);A.current.set(fe.id,ge),v.current.set(fe.id,new ie(fe.cx,fe.cy));break}case z.Polygon:{const ge=fe,de=[];for(const Z of ge.vertices)de.push(new Xt(Z.x*re.lx,Z.y*re.ly).rotateAround(si,ne));R.current.set(fe.id,de),x.current.set(fe.id,ge.vertices.map(Z=>({...Z})));break}}else fe.type===z.SolarPanel&&(me.isEqual(fe.normal[1],-1)||me.isEqual(fe.normal[1],1))&&v.current.set(fe.id,new ie(fe.cx,fe.cy,fe.cz));me.isPlantOrHuman(fe)&&v.current.set(fe.id,new ie(fe.cx,fe.cy,fe.cz))}if(a(re.id,ae),se.length>0)for(const fe of se){if(me.isIdentical(fe.normal,rs))switch(fe.type){case z.Sensor:{const ge=A.current.get(fe.id);if(ge){const Z=new Xt(ge.x,ge.y).rotateAround(si,-ne).y/ae;i(fe.id,Z),T.current.set(fe.id,new ie(fe.cx,Z))}break}case z.Polygon:{const ge=R.current.get(fe.id);if(ge){const de=[];for(const Z of ge){const he=Z.rotateAround(si,-ne),xe=he.x/re.lx,He=he.y/ae;de.push({x:xe,y:He})}l(fe.id,de),S.current.set(fe.id,de.map(Z=>({...Z})))}break}}else fe.type===z.SolarPanel&&(me.isEqual(fe.normal[1],-1)&&(i(fe.id,-ae/2),T.current.set(fe.id,new ie(fe.cx,-ae/2,fe.cz))),me.isEqual(fe.normal[1],1)&&(i(fe.id,ae/2),T.current.set(fe.id,new ie(fe.cx,ae/2,fe.cz))));if(me.isPlantOrHuman(fe)){if(T.current.set(fe.id,new ie(fe.cx,fe.cy,fe.cz)),C.current.set(fe.id,re.id),Math.abs(fe.cz-re.lz/2)0){const ge=Fn.getState().contentRef,de=N(ge==null?void 0:ge.current,re.id);F(de,re,fe)}}else if(Math.abs(Math.abs(fe.cy)-re.ly/2)0?ae:-ae)/2;i(fe.id,ge),T.current.set(fe.id,new ie(fe.cz,ge,fe.cz))}}}},B=(re,ae,se)=>{if(!re||!ae)return;const ne=Fn.getState().contentRef,fe=N(ne==null?void 0:ne.current,ae),ge=N(ae===Zo?ne==null?void 0:ne.current:fe,se);if(ge&&(ne!=null&&ne.current)){if(re===Zo)ne.current.add(ge);else{const de=N(ne.current,re);de==null||de.add(ge)}np()}},_=(re,ae)=>{re&&d(se=>{for(const ne of se.elements)if(ne.id===ae){ne.parentId=re;break}})},X=re=>{if(!y||!k(re))return;const ae=n(y.id),se=ae?ae.ly:y.ly;if(D.current=void 0,M.current=L(re),M.current)D.current=re,b(se);else switch(v.current.clear(),T.current.clear(),x.current.clear(),S.current.clear(),c){case oe.AllSelectedObjectsOfThisType:{const ne=new Map;for(const ge of e)ge.type===z.Cuboid&&!ge.locked&&H.getState().selectedElementIdSet.has(ge.id)&&(ne.set(ge.id,ge.ly),O(ge,re));const fe={name:"Set Width for Selected Cuboids on Surface",timestamp:Date.now(),oldSizes:ne,newSize:re,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())a(Z,he);if(fe.oldChildrenPositionsMap&&fe.oldChildrenPositionsMap.size>0)for(const[Z,he]of fe.oldChildrenPositionsMap.entries()){r(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(xe,He,Z),_(xe,Z))}if(fe.oldChildrenVerticesMap&&fe.oldChildrenVerticesMap.size>0)for(const[Z,he]of fe.oldChildrenVerticesMap.entries())l(Z,he)},redo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())a(Z,fe.newSize);if(fe.newChildrenPositionsMap&&fe.newChildrenPositionsMap.size>0)for(const[Z,he]of fe.newChildrenPositionsMap.entries()){r(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(He,xe,Z),_(He,Z))}if(fe.newChildrenVerticesMap&&fe.newChildrenVerticesMap.size>0)for(const[Z,he]of fe.newChildrenVerticesMap.entries())l(Z,he)}};s(fe),p(f+1);break}case oe.AllObjectsOfThisTypeOnSurface:{const ne=new Map;for(const ge of e)ge.type===z.Cuboid&&ge.parentId===y.parentId&&!ge.locked&&(ne.set(ge.id,ge.ly),O(ge,re));const fe={name:"Set Width for All Cuboids on Surface",timestamp:Date.now(),oldSizes:ne,newSize:re,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())a(Z,he);if(fe.oldChildrenPositionsMap&&fe.oldChildrenPositionsMap.size>0)for(const[Z,he]of fe.oldChildrenPositionsMap.entries()){r(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(xe,He,Z),_(xe,Z))}if(fe.oldChildrenVerticesMap&&fe.oldChildrenVerticesMap.size>0)for(const[Z,he]of fe.oldChildrenVerticesMap.entries())l(Z,he)},redo:()=>{var ge,de;if(U(fe.newSize),fe.newChildrenPositionsMap&&fe.newChildrenPositionsMap.size>0)for(const[Z,he]of fe.newChildrenPositionsMap.entries()){r(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(He,xe,Z),_(He,Z))}if(fe.newChildrenVerticesMap&&fe.newChildrenVerticesMap.size>0)for(const[Z,he]of fe.newChildrenVerticesMap.entries())l(Z,he)}};s(fe),p(f+1);break}case oe.AllObjectsOfThisType:{const ne=new Map;for(const ge of e)ge.type===z.Cuboid&&!ge.locked&&(ne.set(ge.id,ge.ly),O(ge,re));const fe={name:"Set Width for All Cuboids on Surface",timestamp:Date.now(),oldSizes:ne,newSize:re,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())a(Z,he);if(fe.oldChildrenPositionsMap&&fe.oldChildrenPositionsMap.size>0)for(const[Z,he]of fe.oldChildrenPositionsMap.entries()){r(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(xe,He,Z),_(xe,Z))}if(fe.oldChildrenVerticesMap&&fe.oldChildrenVerticesMap.size>0)for(const[Z,he]of fe.oldChildrenVerticesMap.entries())l(Z,he)},redo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())a(Z,fe.newSize);if(fe.newChildrenPositionsMap&&fe.newChildrenPositionsMap.size>0)for(const[Z,he]of fe.newChildrenPositionsMap.entries()){r(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(He,xe,Z),_(He,Z))}if(fe.newChildrenVerticesMap&&fe.newChildrenVerticesMap.size>0)for(const[Z,he]of fe.newChildrenVerticesMap.entries())l(Z,he)}};s(fe),p(f+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:break;default:{O(y,re);const ne={name:"Set Cuboid Width",timestamp:Date.now(),oldSize:se,newSize:re,resizedElementId:y.id,resizedElementType:y.type,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var fe,ge;if(a(y.id,ne.oldSize),ne.oldChildrenPositionsMap&&ne.oldChildrenPositionsMap.size>0)for(const[de,Z]of ne.oldChildrenPositionsMap.entries()){r(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(B(he,xe,de),_(he,de))}if(ne.oldChildrenVerticesMap&&ne.oldChildrenVerticesMap.size>0)for(const[de,Z]of ne.oldChildrenVerticesMap.entries())l(de,Z)},redo:()=>{var fe,ge;if(a(y.id,ne.newSize),ne.newChildrenPositionsMap&&ne.newChildrenPositionsMap.size>0)for(const[de,Z]of ne.newChildrenPositionsMap.entries()){r(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(B(xe,he,de),_(xe,de))}if(ne.newChildrenVerticesMap&&ne.newChildrenVerticesMap.size>0)for(const[de,Z]of ne.newChildrenVerticesMap.entries())l(de,Z)}};s(ne),p(f+1);break}}},$=()=>{t(!1)},Q=()=>{$(),g()},le=()=>{X(w),M.current||(t(!1),p(0))},q=()=>{X(w)},te=M.current?": "+Y.t("message.NotApplicableToSelectedAction",E)+(D.current!==void 0?" ("+D.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Width",E),rejectedMessage:te,onApply:q,onClose:$,onClickCancel:Q,onClickOk:le,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:500,style:{width:120},step:.5,precision:2,value:w,onChange:re=>{re!==null&&b(re)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",E),": [0.1, 500] ",Y.t("word.MeterAbbreviation",E)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",E)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:W,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("cuboidMenu.OnlyThisCuboid",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("cuboidMenu.AllCuboidsOnSameSurface",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("cuboidMenu.AllSelectedCuboids",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("cuboidMenu.AllCuboids",E)})]})})})]})})},ddo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(qr),r=H(Gn),i=H(kge),a=H(Nwt),l=H(jwt),s=H(Uwt),c=H(En),u=H(Rb),d=H(Hb),f=H(c3),p=H(no),g=H(Zn),y=co(z.Cuboid),[w,b]=m.useState((y==null?void 0:y.lz)??0),C=m.useRef(new Map),P=m.useRef(new Map),v=m.useRef(new Map),T=m.useRef(new Map),A=Jt(),x=B=>{d(B.target.value)},S=(B,_)=>{i(B,_),a(B,_/2)},R=B=>{if(!y)return;const _=o(y);if(_)for(const X of n)X.type===z.Cuboid&&!X.locked&&X.parentId===_.id&&(i(X.id,B),a(X.id,B/2))},M=B=>{if(!y)return;const _=me.getBaseId(y.id);if(_)for(const X of n)X.type===z.Cuboid&&!X.locked&&me.getBaseId(X.id)===_&&(i(X.id,B),a(X.id,B/2))},D=B=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:{for(const _ of n)if(_.type===z.Cuboid&&!_.locked&&H.getState().selectedElementIdSet.has(_.id)&&Math.abs(_.lz-B)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const _ of n)if(_.type===z.Cuboid&&!_.locked&&Math.abs(_.lz-B)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{const _=me.getBaseId(y==null?void 0:y.id);if(_&&_!==Zo){for(const X of n)if(X.type===z.Cuboid&&X.parentId&&X.parentId!==Zo&&!X.locked){const $=X;if(_===me.getBaseId($.id)&&Math.abs($.lz-B)>It)return!0}}break}case oe.AllObjectsOfThisTypeOnSurface:{for(const _ of n)if(_.type===z.Cuboid&&_.parentId!==Zo&&_.parentId===(y==null?void 0:y.parentId)&&!_.locked&&Math.abs(_.lz-B)>It)return!0;break}default:{if(Math.abs((y==null?void 0:y.lz)-B)>It)return!0;break}}return!1}},E=(B,_)=>{if(B==null)return null;for(const X of B.children)if(X.name.includes(`${_}`))return X;return null},W=(B,_,X)=>{var $,Q;if(B){for(const q of B.children)if(q.name.includes(`${X.id}`)){(Q=($=Fn.getState().contentRef)==null?void 0:$.current)==null||Q.add(q);break}X.parentId=Zo;const le=new Xt(X.cx,X.cy).rotateAround(si,-_.rotation[2]).add(new Xt(_.cx,_.cy));X.cx=le.x,X.cy=le.y,X.cz=0,T.current.set(X.id,new ie(le.x,le.y,0)),P.current.set(X.id,Zo)}},j=(B,_)=>{e(X=>{for(const $ of X.elements)if($.parentId===B.id)if(C.current.set($.id,B.id),v.current.set($.id,new ie($.cx,$.cy,$.cz)),me.isPlantOrHuman($))if(Math.abs($.cz-B.lz/2)_/2){const le=Fn.getState().contentRef,q=E(le==null?void 0:le.current,B.id);W(q,B,$)}else $.cz=Q,T.current.set($.id,new ie($.cx,$.cy,Q))}else $.type===z.SolarPanel&&me.isEqual($.normal[2],1)&&($.cz=_/2,T.current.set($.id,new ie($.cx,$.cy,_/2)))})},L=(B,_,X)=>{if(!B||!_)return;const $=Fn.getState().contentRef,Q=E($==null?void 0:$.current,_),le=E(_===Zo?$==null?void 0:$.current:Q,X);if(le&&($!=null&&$.current)){if(B===Zo)$.current.add(le);else{const q=E($.current,B);q==null||q.add(le)}np()}},k=(B,_)=>{B&&e(X=>{for(const $ of X.elements)if($.id===_){$.parentId=B;break}})},N=(B,_)=>{H.getState().set(X=>{for(const $ of X.elements)if(B.has($.id))if(_!==void 0)$.lz=_,$.cz=_/2;else{const Q=B.get($.id);Q!==void 0&&($.lz=Q,$.cz=Q/2)}})},F=B=>{if(y&&D(B)){switch(u){case oe.AllSelectedObjectsOfThisType:{const _=new Map;for(const $ of n)$.type===z.Cuboid&&H.getState().selectedElementIdSet.has($.id)&&(_.set($.id,$.lz),j($,B));const X={name:"Set Height for Selected Cuboids",timestamp:Date.now(),oldValues:_,newValue:B,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var $,Q;if(N(X.oldValues),X.oldChildrenPositionsMap&&X.oldChildrenPositionsMap.size>0)for(const[le,q]of X.oldChildrenPositionsMap.entries()){f(le,q.x,q.y,q.z);const te=($=X.oldChildrenParentIdMap)==null?void 0:$.get(le),re=(Q=X.newChildrenParentIdMap)==null?void 0:Q.get(le);te&&re&&te!==re&&(L(te,re,le),k(te,le))}},redo:()=>{var Q,le;const $=X.newValue;if(N(X.oldValues,$),X.newChildrenPositionsMap&&X.newChildrenPositionsMap.size>0)for(const[q,te]of X.newChildrenPositionsMap.entries()){f(q,te.x,te.y,te.z);const re=(Q=X.oldChildrenParentIdMap)==null?void 0:Q.get(q),ae=(le=X.newChildrenParentIdMap)==null?void 0:le.get(q);re&&ae&&re!==ae&&(L(ae,re,q),k(ae,q))}}};c(X),N(_,B),g(p+1);break}case oe.AllObjectsOfThisType:{const _=new Map;for(const $ of n)$.type===z.Cuboid&&(_.set($.id,$.lz),j($,B));const X={name:"Set Height for All Cuboids",timestamp:Date.now(),oldValues:_,newValue:B,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var $,Q;for(const[le,q]of X.oldValues.entries())S(le,q);if(X.oldChildrenPositionsMap&&X.oldChildrenPositionsMap.size>0)for(const[le,q]of X.oldChildrenPositionsMap.entries()){f(le,q.x,q.y,q.z);const te=($=X.oldChildrenParentIdMap)==null?void 0:$.get(le),re=(Q=X.newChildrenParentIdMap)==null?void 0:Q.get(le);te&&re&&te!==re&&(L(te,re,le),k(te,le))}},redo:()=>{var Q,le;const $=X.newValue;if(l(z.Cuboid,$),s(z.Cuboid,$/2),X.newChildrenPositionsMap&&X.newChildrenPositionsMap.size>0)for(const[q,te]of X.newChildrenPositionsMap.entries()){f(q,te.x,te.y,te.z);const re=(Q=X.oldChildrenParentIdMap)==null?void 0:Q.get(q),ae=(le=X.newChildrenParentIdMap)==null?void 0:le.get(q);re&&ae&&re!==ae&&(L(ae,re,q),k(ae,q))}}};c(X),l(z.Cuboid,B),s(z.Cuboid,B/2),g(p+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{const _=new Map,X=me.getBaseId(y.id);for(const Q of n)Q.type===z.Cuboid&&me.getBaseId(Q.id)===X&&(_.set(Q.id,Q.lz),j(Q,B));const $={name:"Set Height for All Cuboids Above Same Base",timestamp:Date.now(),oldValues:_,newValue:B,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var Q,le;for(const[q,te]of $.oldValues.entries())S(q,te);if($.oldChildrenPositionsMap&&$.oldChildrenPositionsMap.size>0)for(const[q,te]of $.oldChildrenPositionsMap.entries()){f(q,te.x,te.y,te.z);const re=(Q=$.oldChildrenParentIdMap)==null?void 0:Q.get(q),ae=(le=$.newChildrenParentIdMap)==null?void 0:le.get(q);re&&ae&&re!==ae&&(L(re,ae,q),k(re,q))}},redo:()=>{var le,q;const Q=$.newValue;if(M(Q),$.newChildrenPositionsMap&&$.newChildrenPositionsMap.size>0)for(const[te,re]of $.newChildrenPositionsMap.entries()){f(te,re.x,re.y,re.z);const ae=(le=$.oldChildrenParentIdMap)==null?void 0:le.get(te),se=(q=$.newChildrenParentIdMap)==null?void 0:q.get(te);ae&&se&&ae!==se&&(L(se,ae,te),k(se,te))}}};c($),M(B),g(p+1);break}case oe.AllObjectsOfThisTypeOnSurface:{const _=new Map;for(const $ of n)$.type===z.Cuboid&&$.parentId===y.parentId&&(_.set($.id,$.lz),j($,B));const X={name:"Set Height for All Cuboids on Same Surface",timestamp:Date.now(),oldValues:_,newValue:B,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var $,Q;for(const[le,q]of X.oldValues.entries())S(le,q);if(X.oldChildrenPositionsMap&&X.oldChildrenPositionsMap.size>0)for(const[le,q]of X.oldChildrenPositionsMap.entries()){f(le,q.x,q.y,q.z);const te=($=X.oldChildrenParentIdMap)==null?void 0:$.get(le),re=(Q=X.newChildrenParentIdMap)==null?void 0:Q.get(le);te&&re&&te!==re&&(L(te,re,le),k(te,le))}},redo:()=>{var Q,le;const $=X.newValue;if(R($),X.newChildrenPositionsMap&&X.newChildrenPositionsMap.size>0)for(const[q,te]of X.newChildrenPositionsMap.entries()){f(q,te.x,te.y,te.z);const re=(Q=X.oldChildrenParentIdMap)==null?void 0:Q.get(q),ae=(le=X.newChildrenParentIdMap)==null?void 0:le.get(q);re&&ae&&re!==ae&&(L(ae,re,q),k(ae,q))}}};c(X),R(B),g(p+1);break}default:{const _=r(y.id),X=_?_.lz:y.lz;j(y,B),S(y.id,B);const $={name:"Set Cuboid Width",timestamp:Date.now(),oldValue:X,newValue:B,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),changedElementId:y.id,changedElementType:y.type,undo:()=>{var Q,le;if(S($.changedElementId,$.oldValue),$.oldChildrenPositionsMap&&$.oldChildrenPositionsMap.size>0)for(const[q,te]of $.oldChildrenPositionsMap.entries()){f(q,te.x,te.y,te.z);const re=(Q=$.oldChildrenParentIdMap)==null?void 0:Q.get(q),ae=(le=$.newChildrenParentIdMap)==null?void 0:le.get(q);re&&ae&&re!==ae&&(L(re,ae,q),k(re,q))}},redo:()=>{var Q,le;if(S($.changedElementId,$.newValue),$.newChildrenPositionsMap&&$.newChildrenPositionsMap.size>0)for(const[q,te]of $.newChildrenPositionsMap.entries()){f(q,te.x,te.y,te.z);const re=(Q=$.oldChildrenParentIdMap)==null?void 0:Q.get(q),ae=(le=$.newChildrenParentIdMap)==null?void 0:le.get(q);re&&ae&&re!==ae&&(L(ae,re,q),k(ae,q))}}};c($),g(p+1);break}}e(_=>{_.actionState.cuboidHeight=B})}},U=()=>{t(!1)},O=()=>{F(w)};return h.jsx(so,{width:550,title:Y.t("word.Height",A),onApply:O,onClose:U,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:1e3,style:{width:120},step:.5,precision:2,value:w,onChange:B=>{B!==null&&b(B)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",A),": [0.1, 1000] ",Y.t("word.MeterAbbreviation",A)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",A)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:x,value:u,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("cuboidMenu.OnlyThisCuboid",A)}),(y==null?void 0:y.parentId)!==Zo&&h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("cuboidMenu.AllCuboidsOnSameSurface",A)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("cuboidMenu.AllCuboidsAboveSameBase",A)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("cuboidMenu.AllSelectedCuboids",A)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("cuboidMenu.AllCuboids",A)})]})})})]})})},fdo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(Lge),r=H(En),i=H(Rb),a=H(Hb),l=H(no),s=H(Zn),c=co(z.Cuboid),[u,d]=m.useState(c?-c.rotation[2]:0),f=Jt(),p=v=>{a(v.target.value)},g=v=>{for(const T of e)T.type===z.Cuboid&&!T.locked&&T.parentId===(c==null?void 0:c.parentId)&&o(T.id,0,0,-v)},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of e)if(T.type===z.Cuboid&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)&&Math.abs(-T.rotation[2]-v)>It)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const T of e)if(T.type===z.Cuboid&&T.parentId===(c==null?void 0:c.parentId)&&!T.locked&&Math.abs(-T.rotation[2]-v)>It)return!0;break;case oe.AllObjectsOfThisType:{for(const T of e)if(T.type===z.Cuboid&&!T.locked&&Math.abs(-T.rotation[2]-v)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:break;default:if(Math.abs((c?-c.rotation[2]:0)-v)>It)return!0}return!1},w=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(v.has(x.id))if(T!==void 0)x.rotation[2]=T;else{const S=v.get(x.id);S!==void 0&&(x.rotation[2]=-S)}})},b=v=>{if(c&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of e)x.type===z.Cuboid&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&T.set(x.id,-x.rotation[2]);const A={name:"Set Azimuth for Selected Cuboids",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{w(A.oldValues)},redo:()=>{w(A.oldValues,-A.newValue)}};r(A),w(T,-v),s(l+1);break}case oe.AllObjectsOfThisTypeOnSurface:{const T=new Map;for(const x of e)x.type===z.Cuboid&&x.parentId===c.parentId&&!x.locked&&T.set(x.id,-x.rotation[2]);const A={name:"Set Azimuth for All Cuboids on Surface",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())o(x,0,0,-S)},redo:()=>{g(A.newValue)}};r(A),g(v),s(l+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of e)x.type===z.Cuboid&&!x.locked&&T.set(x.id,-x.rotation[2]);const A={name:"Set Azimuth for All Cuboids",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{w(A.oldValues)},redo:()=>{w(A.oldValues,-A.newValue)}};r(A),w(T,-v),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:break;default:{const T=n(c.id),A=T?-T.rotation[2]:-c.rotation[2],x={name:"Set Cuboid Azimuth",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:c.id,changedElementType:c.type,undo:()=>{o(x.changedElementId,0,0,-x.oldValue)},redo:()=>{o(x.changedElementId,0,0,-x.newValue)}};r(x),o(c.id,0,0,-v),s(l+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("word.Azimuth",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:-180,max:180,style:{width:120},step:.5,precision:2,value:parseFloat(me.toDegrees(u).toFixed(2)),formatter:v=>`${v}°`,onChange:v=>{v!==null&&d(me.toRadians(v))}}),h.jsxs("div",{style:{paddingTop:"20px",paddingRight:"6px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [-180°, 180°]",h.jsx("br",{}),Y.t("message.AzimuthOfNorthIsZero",f),h.jsx("br",{}),Y.t("message.CounterclockwiseAzimuthIsPositive",f)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:p,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("cuboidMenu.OnlyThisCuboid",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("cuboidMenu.AllCuboidsOnSameSurface",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("cuboidMenu.AllSelectedCuboids",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("cuboidMenu.AllCuboids",f)})]})})})]})})},hdo=[{key:"sensorCount",objectType:z.Sensor},{key:"polygonCount",objectType:z.Polygon},{key:"humanCount",objectType:z.Human},{key:"treeCount",objectType:z.Tree},{key:"flowerCount",objectType:z.Flower},{key:"outsideLightCount",objectType:z.Light}],pdo=(t,e)=>{const n={lng:H.getState().language};let o="",r="";switch(t){case z.Light:{o=`${Y.t("cuboidMenu.RemoveAllUnlockedLights",n)} (${e})`,r=`${Y.t("cuboidMenu.DoYouReallyWantToRemoveAllLightsOnCuboid",n)} (${e} ${Y.t("cuboidMenu.Lights",n)})`;break}case z.Sensor:{o=`${Y.t("cuboidMenu.RemoveAllUnlockedSensors",n)} (${e})`,r=`${Y.t("cuboidMenu.DoYouReallyWantToRemoveAllSensorsOnCuboid",n)} (${e} ${Y.t("cuboidMenu.Sensors",n)})`;break}case z.Polygon:{o=`${Y.t("cuboidMenu.RemoveAllUnlockedPolygons",n)} (${e})`,r=`${Y.t("cuboidMenu.DoYouReallyWantToRemoveAllPolygonsOnCuboid",n)} (${e} ${Y.t("cuboidMenu.Polygons",n)})`;break}case z.Human:{o=`${Y.t("cuboidMenu.RemoveAllUnlockedHumans",n)} (${e})`,r=`${Y.t("cuboidMenu.DoYouReallyWantToRemoveAllHumansOnCuboid",n)} (${e} ${Y.t("cuboidMenu.Humans",n)})`;break}case z.Tree:{o=`${Y.t("cuboidMenu.RemoveAllUnlockedTrees",n)} (${e})`,r=`${Y.t("cuboidMenu.DoYouReallyWantToRemoveAllTreesOnCuboid",n)} (${e} ${Y.t("cuboidMenu.Trees",n)})`;break}case z.Flower:{o=`${Y.t("cuboidMenu.RemoveAllUnlockedFlowers",n)} (${e})`,r=`${Y.t("cuboidMenu.DoYouReallyWantToRemoveAllFlowersOnCuboid",n)} (${e} ${Y.t("cuboidMenu.Flowers",n)})`;break}}return{itemLabel:o,modalTitle:r}},gdo=(t,e)=>{const n=[],o={lng:H.getState().language};if(e.solarPanelCount>0){const r=Y.t("cuboidMenu.DoYouReallyWantToRemoveAllSolarPanelsOnCuboid",o)+" ("+e.solarPanelModuleCount+" "+Y.t("cuboidMenu.SolarPanels",o)+", "+e.solarPanelCount+" "+Y.t("cuboidMenu.Racks",o)+")?";n.push({key:"remove-all-solar-panels-on-cuboid",label:h.jsxs(PHe,{cuboid:t,objectType:z.SolarPanel,modalTitle:r,children:[Y.t("cuboidMenu.RemoveAllUnlockedSolarPanels",o),"  (",e.solarPanelModuleCount," ",Y.t("cuboidMenu.SolarPanels",o),",",e.solarPanelCount," ",Y.t("cuboidMenu.Racks",o),")"]})})}return hdo.forEach(({key:r,objectType:i})=>{const a=e[r];if(typeof a=="number"&&a>0){const{itemLabel:l,modalTitle:s}=pdo(i,a),c=i.replaceAll(" ","");n.push({key:`remove-all-${c}s-on-cuboid`,label:h.jsx(PHe,{cuboid:t,objectType:i,modalTitle:s,children:l})})}}),n},mdo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(Rb),a=H(Hb),l=H(no),s=H(Zn),c=co(z.Cuboid),[u,d]=m.useState((c==null?void 0:c.transparency)??0),f=Jt(),p=(T,A)=>{e(x=>{for(const S of x.elements)if(S.type===z.Cuboid&&S.id===T&&!S.locked){S.transparency=A;break}})},g=T=>{for(const A of n)A.type===z.Cuboid&&!A.locked&&A.parentId===(c==null?void 0:c.parentId)&&p(A.id,T)},y=(T,A)=>{e(x=>{for(const S of x.elements)if(S.type===z.Cuboid&&T.has(S.id))if(A!==void 0)S.transparency=A;else{const R=T.get(S.id);R!==void 0&&(S.transparency=R)}})},w=T=>{a(T.target.value)},b=T=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const A of n)if(A.type===z.Cuboid&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&Math.abs((A.transparency??0)-T)>It)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const A of n)if(A.type===z.Cuboid&&A.parentId===(c==null?void 0:c.parentId)&&!A.locked&&Math.abs((A.transparency??0)-T)>It)return!0;break;case oe.AllObjectsOfThisType:{for(const A of n)if(A.type===z.Cuboid&&!A.locked&&Math.abs((A.transparency??0)-T)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:break;default:if(Math.abs(((c==null?void 0:c.transparency)??0)-T)>It)return!0}return!1},C=T=>{if(c&&b(T))switch(i){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Cuboid&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&A.set(S.id,S.transparency??0);const x={name:"Set Transparency for Selected Cuboids",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{y(x.oldValues,-x.newValue)}};r(x),y(A,T),s(l+1);break}case oe.AllObjectsOfThisTypeOnSurface:{const A=new Map;for(const S of n)S.type===z.Cuboid&&S.parentId===c.parentId&&!S.locked&&A.set(S.id,S.transparency??0);const x={name:"Set Transparency for All Cuboids on Surface",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())p(S,R)},redo:()=>{g(x.newValue)}};r(x),g(T),s(l+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Cuboid&&!S.locked&&A.set(S.id,S.transparency??0);const x={name:"Set Transparency for All Cuboids",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{y(x.oldValues,-x.newValue)}};r(x),y(A,T),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:break;default:{const A=o(c.id),x=A?A.transparency:c.transparency,S={name:"Set Cuboid Transparency",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:c.id,changedElementType:c.type,undo:()=>{p(S.changedElementId,S.oldValue)},redo:()=>{p(S.changedElementId,S.newValue)}};r(S),p(c.id,T),s(l+1);break}}},P=()=>{t(!1)},v=()=>{C(u)};return h.jsx(so,{width:550,title:Y.t("word.Transparency",f),onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.1,precision:2,value:u,onChange:T=>{T!==null&&d(T)}}),h.jsxs("div",{style:{paddingTop:"20px",paddingRight:"6px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("cuboidMenu.OnlyThisCuboid",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("cuboidMenu.AllCuboidsOnSameSurface",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("cuboidMenu.AllSelectedCuboids",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("cuboidMenu.AllCuboids",f)})]})})})]})})},ydo=()=>{const t=H.getState().elementsToPaste;if(t&&t.length>0){const e=t[0];if(e.type===z.Human||e.type===z.Tree||e.type===z.Flower||e.type===z.Polygon||e.type===z.Sensor||e.type===z.SolarPanel||e.type===z.Cuboid)return!0}return!1},Ado=t=>{const e=[];if(t.type!==z.Cuboid)return{items:e};const n=t,o=H.getState().selectedSideIndex,r={lng:H.getState().language},i=H.getState().countAllOffspringsByTypeAtOnce(n.id,!1),a=!(n!=null&&n.locked),l=!n.textureTypes||o>=0&&n.textureTypes[o]===Co.NoTexture;return ydo()&&e.push({key:"cuboid-paste",label:h.jsx(eM,{})}),e.push({key:"cuboid-copy",label:h.jsx(Ld,{})}),a&&e.push({key:"cuboid-cut",label:h.jsx(Wd,{})}),e.push({key:"cuboid-lock",label:h.jsx(Ju,{selectedElement:n})}),e.push({key:"cuboid-group-master",label:h.jsx(DQe,{groupableElement:n})}),e.push({key:"cuboid-stackable",label:h.jsx(Kuo,{cuboid:n})}),i.gotSome()&&e.push({key:"cuboid-clear",label:h.jsx(rn,{children:Y.t("word.Clear",r)}),children:gdo(n,i)}),a&&(l&&e.push({key:"cuboid-color",label:h.jsxs(to,{Dialog:$uo,children:[Y.t("word.Color",r)," ..."]})}),e.push({key:"cuboid-texture",label:h.jsxs(to,{Dialog:sdo,children:[Y.t("word.Texture",r)," ..."]})}),e.push({key:"cuboid-length",label:h.jsxs(to,{Dialog:cdo,children:[Y.t("word.Length",r)," ..."]})}),e.push({key:"cuboid-width",label:h.jsxs(to,{Dialog:udo,children:[Y.t("word.Width",r)," ..."]})}),e.push({key:"cuboid-height",label:h.jsxs(to,{Dialog:ddo,children:[Y.t("word.Height",r)," ..."]})}),e.push({key:"cuboid-azimuth",label:h.jsxs(to,{Dialog:fdo,children:[Y.t("word.Azimuth",r)," ..."]})}),e.push({key:"cuboid-transparency",label:h.jsxs(to,{Dialog:mdo,children:[Y.t("word.Transparency",r)," ..."]})})),e.push({key:"add-polygon-on-cuboid",label:h.jsx(quo,{cuboid:n,selectedSideIndex:o})}),a&&e.push({key:"cuboid-label",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",r)}),children:PA(n)}),{items:e}},wdo=()=>{const t=H(hA),e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.groundImage=r,i.viewState.groundImageType=i.viewState.mapType})},o=r=>{const i=r.target.checked,a={name:"Show Ground Image",timestamp:Date.now(),checked:i,undo:()=>{n(!a.checked)},redo:()=>{n(a.checked)}};H.getState().addUndoable(a),n(i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t,onChange:o,children:Y.t("groundMenu.ImageOnGround",e)})})},vdo=()=>{const t=H(PBe),e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.waterSurface=r})},o=r=>{const i=r.target.checked,a={name:"Water Surface",timestamp:Date.now(),checked:i,undo:()=>{n(!a.checked)},redo:()=>{n(a.checked)}};H.getState().addUndoable(a),n(i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,update:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t,onChange:o,children:Y.t("groundMenu.WaterSurface",e)})})},xdo=()=>{const t=H(TBe),e=o=>{H.getState().set(r=>{r.viewState.groundColor=o})},n=o=>{const r=t,i=o.hex,a={name:"Set Ground Color",timestamp:Date.now(),oldValue:r,newValue:i,undo:()=>{e(a.oldValue)},redo:()=>{e(a.newValue)}};H.getState().addUndoable(a),e(i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(zf,{color:t,onChangeComplete:n})})},bdo=()=>{const t=H(xge)??Eq,n=H(Tc)>0,o=Jt(),r=s=>{H.getState().set(c=>{c.world.leafDayOfYear1=s})},i=s=>{if(s===null)return;const c=t,u=s,d={name:"Set Leaf Day 1",timestamp:Date.now(),oldValue:c,newValue:u,undo:()=>{r(d.oldValue)},redo:()=>{r(d.newValue)}};H.getState().addUndoable(d),r(u)},a=()=>h.jsx("div",{style:{width:"80px"},children:Y.t(n?"groundMenu.LeafOffDay":"groundMenu.LeafOutDay",o)}),l=()=>h.jsx("div",{style:{width:"60px"},children:"(1-150)"});return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsx(a,{}),addonAfter:h.jsx(l,{}),style:{width:"300px"},min:1,max:150,step:1,precision:0,value:t,onChange:i})})},Sdo=()=>{const t=H(bge)??Fq,n=H(Tc)>0,o=Jt(),r=s=>{H.getState().set(c=>{c.world.leafDayOfYear2=s})},i=s=>{if(s===null)return;const c=t,u=s,d={name:"Set Leaf Day 2",timestamp:Date.now(),oldValue:c,newValue:u,undo:()=>{r(d.oldValue)},redo:()=>{r(d.newValue)}};H.getState().addUndoable(d),r(u)},a=()=>h.jsx("div",{style:{width:"80px"},children:Y.t(n?"groundMenu.LeafOffDay":"groundMenu.LeafOutDay",o)}),l=()=>h.jsx("div",{style:{width:"60px"},children:"(215-365)"});return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsx(a,{}),addonAfter:h.jsx(l,{}),style:{width:"300px"},min:215,max:365,step:1,precision:0,value:t,onChange:i})})},CHe=({monthIndex:t})=>{const e=H(i=>i.world.monthlyIrradianceLosses?i.world.monthlyIrradianceLosses[t]:.05)??.05,n=Jt(),o=i=>{H.getState().set(a=>{a.world.monthlyIrradianceLosses||(a.world.monthlyIrradianceLosses=new Array(12).fill(.05)),a.world.monthlyIrradianceLosses[t]=i})},r=i=>{if(i===null)return;const a=e,l=i,s={name:"Set Irradiance Loss in "+twe[t],timestamp:Date.now(),oldValue:a,newValue:l,undo:()=>{o(s.oldValue)},redo:()=>{o(s.newValue)}};H.getState().addUndoable(s),o(l)};return h.jsx(Mn,{addonBefore:h.jsx("span",{style:{fontFamily:"monospace"},children:Y.t(`month.${twe[t]}`,n)}),style:{width:"120px"},min:0,max:1,step:.01,precision:2,value:e,onChange:r})},Tdo=()=>{const t=H(r=>r.world.ground.albedo),e=Jt(),n=r=>{H.getState().set(i=>{i.world.ground.albedo=r})},o=r=>{if(r===null)return;const i=t,a=r,l={name:"Set Ground Albedo",timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"60px"},children:[Y.t("groundMenu.Albedo",e),":"]}),h.jsx(Mn,{min:.05,max:1,step:.01,precision:2,value:t,onChange:o})]})},Pdo=({itemLabel:t,modalTitle:e,objectType:n})=>{const o=H.getState().removeElementsByType,r=()=>{const a=H.getState().elements.filter(c=>!c.locked&&c.type===n);o(n);const l=JSON.parse(JSON.stringify(a)),s={name:"Remove All "+n+"s",timestamp:Date.now(),removedElements:l,undo:()=>{H.getState().set(c=>{c.elements.push(...s.removedElements)})},redo:()=>{o(n)}};H.getState().addUndoable(s),ht.getState().updateContextMenu()},i=()=>{Oi.confirm({title:e,onOk:r,icon:h.jsx(ny,{})})};return h.jsx(rn,{onClick:i,children:t})},RHe=({lock:t,count:e,label:n})=>{const o=H.getState().updateAllElementLocks,r=()=>{const i=new Map;for(const c of H.getState().elements)i.set(c.id,!!c.locked);const s={name:`${t?"Lock":"Unlock"} All ${t?"Unlocked":"Locked"} Elements`,timestamp:Date.now(),oldValues:i,newValue:!0,undo:()=>{for(const[c,u]of s.oldValues.entries())H.getState().updateElementLockById(c,u)},redo:()=>{o(t)}};H.getState().addUndoable(s),o(t)};return h.jsxs(rn,{update:!0,onClick:r,children:[n," (",e,")"]})},Cdo=[{key:"humanCount",type:z.Human,itemLabel:"groundMenu.RemoveAllUnlockedPeople",modalTitle:"groundMenu.DoYouReallyWantToRemoveAllPeople"},{key:"treeCount",type:z.Tree,itemLabel:"groundMenu.RemoveAllUnlockedTrees",modalTitle:"groundMenu.DoYouReallyWantToRemoveAllTrees"},{key:"flowerCount",type:z.Flower,itemLabel:"groundMenu.RemoveAllUnlockedFlowers",modalTitle:"groundMenu.DoYouReallyWantToRemoveAllFlowers"},{key:"solarPanelCount",type:z.SolarPanel,itemLabel:"groundMenu.RemoveAllUnlockedSolarPanels",modalTitle:"groundMenu.DoYouReallyWantToRemoveAllSolarPanels"},{key:"foundationCount",type:z.Foundation,itemLabel:"groundMenu.RemoveAllUnlockedFoundations",modalTitle:"groundMenu.DoYouReallyWantToRemoveAllFoundations"},{key:"cuboidCount",type:z.Cuboid,itemLabel:"groundMenu.RemoveAllUnlockedCuboids",modalTitle:"groundMenu.DoYouReallyWantToRemoveAllCuboids"}],Rdo=()=>{const t=H.getState().elementsToPaste;if(!t||t.length===0)return!1;const e=t[0];return e.type===z.Human||e.type===z.Tree||e.type===z.Flower||e.type===z.Cuboid||e.type===z.Foundation},Hdo=()=>Ms.slice().reduce((t,e,n,o)=>(t&&n%2!==0&&t.push({key:`${o[n-1]}-${o[n]}`,label:h.jsxs(rn,{stayAfterClick:!0,noPadding:!0,children:[h.jsx(CHe,{monthIndex:n-1}),h.jsx(CHe,{monthIndex:n})]})}),t),[]),Mdo=()=>{const t={lng:H.getState().language},e=H.getState().countAllElementsByType(!0),n=[];return Rdo()&&n.push({key:"ground-paste",label:h.jsx(eM,{})}),Cdo.forEach(({key:o,type:r,itemLabel:i,modalTitle:a})=>{const l=e[o];typeof l=="number"&&l>0&&n.push({key:`ground-remove-all-${r}s`,label:h.jsx(Pdo,{objectType:r,itemLabel:`${Y.t(i,t)} (${l})`,modalTitle:`${Y.t(a,t)} (${l})?`})})}),e.unlockedCount>0&&n.push({key:"lock-all-elements",label:h.jsx(RHe,{lock:!0,count:e.unlockedCount,label:Y.t("groundMenu.LockAllUnlockedElements",t)})}),e.lockedCount>0&&H.getState().elements.length>0&&n.push({key:"unlock-all-elements",label:h.jsx(RHe,{lock:!1,count:e.lockedCount,label:Y.t("groundMenu.UnlockAllLockedElements",t)})}),n.push({key:"image-on-ground",label:h.jsx(wdo,{})}),n.push({key:"water-surface",label:h.jsx(vdo,{})}),H.getState().viewState.waterSurface||n.push({key:"ground-color-submenu",label:h.jsx(rn,{children:Y.t("word.Color",t)}),children:[{key:"ground-color-picker",label:h.jsx(xdo,{}),style:{backgroundColor:"white"}}]}),n.push({key:"vegetation-submenu",label:h.jsx(rn,{children:Y.t("groundMenu.Vegetation",t)}),children:[{key:"leaf-out-day",label:h.jsx(bdo,{})},{key:"leaf-shed-day",label:h.jsx(Sdo,{})}]}),n.push({key:"monthly-irradiance-loss-submenu",label:h.jsx(rn,{children:Y.t("groundMenu.MonthlyIrradianceLoss",t)}),children:Hdo()}),n.push({key:"ground-albedo",label:h.jsx(Tdo,{})}),{items:n}};var NE={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return .5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return t===0?0:Math.pow(1024,t-1)},Out:function(t){return t===1?1:1-Math.pow(2,-10*t)},InOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return t===0?0:t===1?1:-Math.pow(2,10*(t-1))*Math.sin((t-1.1)*5*Math.PI)},Out:function(t){return t===0?0:t===1?1:Math.pow(2,-10*t)*Math.sin((t-.1)*5*Math.PI)+1},InOut:function(t){return t===0?0:t===1?1:(t*=2,t<1?-.5*Math.pow(2,10*(t-1))*Math.sin((t-1.1)*5*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin((t-1.1)*5*Math.PI)+1)}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-NE.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?NE.Bounce.In(t*2)*.5:NE.Bounce.Out(t*2-1)*.5+.5}}},VD;typeof self>"u"&&typeof process<"u"&&process.hrtime?VD=function(){var t=process.hrtime();return t[0]*1e3+t[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?VD=self.performance.now.bind(self.performance):Date.now!==void 0?VD=Date.now:VD=function(){return new Date().getTime()};var MP=VD,Ido=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(n){return e._tweens[n]})},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},t.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},t.prototype.update=function(e,n){e===void 0&&(e=MP()),n===void 0&&(n=!1);var o=Object.keys(this._tweens);if(o.length===0)return!1;for(;o.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r1?i(t[n],t[n-1],n-o):i(t[r],t[r+1>n?n:r+1],o-r)},Bezier:function(t,e){for(var n=0,o=t.length-1,r=Math.pow,i=GD.Utils.Bernstein,a=0;a<=o;a++)n+=r(1-e,o-a)*r(e,a)*t[a]*i(o,a);return n},CatmullRom:function(t,e){var n=t.length-1,o=n*e,r=Math.floor(o),i=GD.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(r=Math.floor(o=n*(1+e))),i(t[(r-1+n)%n],t[r],t[(r+1)%n],t[(r+2)%n],o-r)):e<0?t[0]-(i(t[0],t[0],t[1],t[1],-o)-t[0]):e>1?t[n]-(i(t[n],t[n],t[n-1],t[n-1],o-n)-t[n]):i(t[r?r-1:0],t[r],t[n1;o--)n*=o;return t[e]=n,n}}(),CatmullRom:function(t,e,n,o,r){var i=(n-t)*.5,a=(o-e)*.5,l=r*r,s=r*l;return(2*e-2*n+i+a)*s+(-3*e+3*n-2*i-a)*l+i*r+e}}},zdo=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),vrt=new Ido,Ddo=function(){function t(e,n){n===void 0&&(n=vrt),this._object=e,this._group=n,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=NE.Linear.None,this._interpolationFunction=GD.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=zdo.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(e,n){return this._valuesEnd=Object.create(e),n!==void 0&&(this._duration=n),this},t.prototype.duration=function(e){return this._duration=e,this},t.prototype.start=function(e){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e!==void 0?typeof e=="string"?MP()+parseFloat(e):e:MP(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(e,n,o,r){for(var i in o){var a=e[i],l=Array.isArray(a),s=l?"array":typeof a,c=!l&&Array.isArray(o[i]);if(!(s==="undefined"||s==="function")){if(c){var u=o[i];if(u.length===0)continue;u=u.map(this._handleRelativeValue.bind(this,a)),o[i]=[a].concat(u)}if((s==="object"||l)&&a&&!c){n[i]=l?[]:{};for(var d in a)n[i][d]=a[d];r[i]=l?[]:{},this._setupProperties(a,n[i],o[i],r[i])}else typeof n[i]>"u"&&(n[i]=a),l||(n[i]*=1),c?r[i]=o[i].slice().reverse():r[i]=n[i]||0}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(e){return e===void 0&&(e=MP()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this),this)},t.prototype.resume=function(e){return e===void 0&&(e=MP()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},t.prototype.stopChainedTweens=function(){for(var e=0,n=this._chainedTweens.length;ei)return!1;n&&this.start(e)}if(this._goToEnd=!1,e1?1:r;var a=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var l=0,s=this._chainedTweens.length;l{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&(l.type===z.Human||l.type===z.Tree||l.type===z.Flower)){const s=l;s.flip=i;break}})},o=r=>{const i=r.target.checked,a={name:`Flip ${t.type}`,timestamp:Date.now(),checked:i,selectedElementId:t.id,selectedElementType:z.Human,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.flip,onChange:o,children:Y.t("peopleMenu.Flip",e)})})}),Fdo=be.memo(({human:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.type===z.Human&&l.id===r){l.observer=i;break}})},o=r=>{const i=r.target.checked,a={name:"Set Observer",timestamp:Date.now(),checked:i,selectedElementId:t.id,selectedElementType:z.Human,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.observer,onChange:o,children:Y.t("peopleMenu.Observer",e)})})}),kdo=be.memo(({human:t})=>{const e=Jt(),[n,o]=m.useState(!1),r=m.useRef(0),i=m.useRef(-1),a=m.useRef(!0),l=m.useRef(!1);m.useEffect(()=>{if(l.current){if(a.current)return r.current=requestAnimationFrame(c),u(),()=>{cancelAnimationFrame(r.current)};a.current=!0}},[n]);const s=(f,p,g)=>{const y=Fn.getState().orbitControlsRef;y!=null&&y.current&&(y.current.object.position.set(f,p,g),y.current.update(),H.getState().set(w=>{const b=w.viewState;b.cameraPosition=[f,p,g]}))},c=()=>{requestAnimationFrame(c);const f=Date.now();f-i.current>100&&(Edo(),i.current=f)},u=()=>{if(!t)return;let f=t.cx,p=t.cy,g=t.cz+t.lz;const y=H.getState().getParent(t);if(y){const C=me.absoluteHumanOrTreeCoordinates(f,p,g,y);f=C.x,p=C.y,g=C.z}const w=H.getState().cameraDirection.clone().normalize().multiplyScalar(.5);f+=w.x,p+=w.y;const b=[...H.getState().viewState.cameraPosition];new Ddo(b).to([f,p,g],1e3).easing(NE.Quadratic.In).onUpdate(C=>{s(C[0],C[1],C[2])}).onComplete(()=>{H.getState().selectNone()}).start()},d=()=>{o(!n),l.current=!0};return h.jsx(rn,{onClick:d,children:Y.t("peopleMenu.ViewFromThisPerson",e)})}),Ldo=be.memo(({tree:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.type===z.Tree&&l.id===r){l.showModel=i;break}})},o=r=>{const i={name:"Show Tree Model",timestamp:Date.now(),checked:r,selectedElementId:t.id,selectedElementType:z.Tree,undo:()=>{n(t.id,!i.checked)},redo:()=>{n(t.id,i.checked)}};H.getState().addUndoable(i),n(t.id,r)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:(t==null?void 0:t.showModel)&&(t==null?void 0:t.type)===z.Tree,onChange:r=>o(r.target.checked),children:Y.t("treeMenu.ShowModel",e)})})}),Wdo=be.memo(({tree:t})=>{const e=H.getState().updateElementLxById,n=Jt(),o=t.lx??1,r=i=>{if(i===null||i===o)return;const a={name:"Set Tree Spread",timestamp:Date.now(),oldValue:o,newValue:i,changedElementId:t.id,changedElementType:t.type,undo:()=>{e(a.changedElementId,a.oldValue)},redo:()=>{e(a.changedElementId,a.newValue)}};H.getState().addUndoable(a),e(t.id,i),H.getState().set(l=>{l.actionState.treeSpread=i})};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"100px"},children:[Y.t("treeMenu.Spread",n)+" ("+Y.t("word.MeterAbbreviation",n)+")",":"]}),h.jsx(Mn,{style:{width:"160px"},min:1,max:50,step:1,precision:1,value:o,onChange:r})]})}),Ndo=be.memo(({tree:t})=>{const e=H.getState().updateElementLzById,n=Jt(),o=t.lz??1,r=i=>{if(i===null||i===o)return;const a={name:"Set Tree Height",timestamp:Date.now(),oldValue:o,newValue:i,changedElementId:t.id,changedElementType:t.type,undo:()=>{e(a.changedElementId,a.oldValue)},redo:()=>{e(a.changedElementId,a.newValue)}};H.getState().addUndoable(a),e(t.id,i),H.getState().set(l=>{l.actionState.treeHeight=i})};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"100px"},children:[Y.t("word.Height",n)+" ("+Y.t("word.MeterAbbreviation",n)+")",":"]}),h.jsx(Mn,{style:{width:"160px"},min:1,max:30,step:1,precision:1,value:o,onChange:r})]})}),{Option:Ka}=_o,Udo=be.memo(({human:t})=>{const e=H(fn),n=H(En),[o,r]=m.useState(!1),i=Jt(),a=(l,s)=>{e(c=>{for(const u of c.elements)if(u.type===z.Human&&u.id===l){const d=u;d.name=s,d.lx=Fp.fetchWidth(s),d.lz=Fp.fetchHeight(s);break}})};return h.jsxs(_o,{style:{width:"140px"},value:(t==null?void 0:t.name)??Yt.Jack,onChange:l=>{if(t){const s=t.name;if(s!==l){const c={name:"Change People",timestamp:Date.now(),oldValue:s,newValue:l,changedElementId:t.id,changedElementType:t.type,undo:()=>{a(c.changedElementId,c.oldValue)},redo:()=>{a(c.changedElementId,c.newValue)}};n(c),a(t.id,l),e(u=>{u.actionState.humanName=l}),r(!o)}}},children:[h.jsxs(Ka,{value:Yt.Jack,children:[h.jsx("img",{alt:Yt.Jack,src:bje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.Jack",i)]},Yt.Jack),h.jsxs(Ka,{value:Yt.Jacob,children:[h.jsx("img",{alt:Yt.Jacob,src:Sje,height:20,style:{paddingRight:"16px"}})," ",Y.t("people.Jacob",i)]},Yt.Jacob),h.jsxs(Ka,{value:Yt.Jacqueline,children:[h.jsx("img",{alt:Yt.Jacqueline,src:Tje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jacqueline",i)]},Yt.Jacqueline),h.jsxs(Ka,{value:Yt.Jaah,children:[h.jsx("img",{alt:Yt.Jaah,src:xje,height:20,style:{paddingRight:"19px"}})," ",Y.t("people.Jaah",i)]},Yt.Jaah),h.jsxs(Ka,{value:Yt.Jade,children:[h.jsx("img",{alt:Yt.Jade,src:Pje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jade",i)]},Yt.Jade),h.jsxs(Ka,{value:Yt.Jamelia,children:[h.jsx("img",{alt:Yt.Jamelia,src:Cje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jamelia",i)]},Yt.Jamelia),h.jsxs(Ka,{value:Yt.James,children:[h.jsx("img",{alt:Yt.James,src:Rje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.James",i)]},Yt.James),h.jsxs(Ka,{value:Yt.Jane,children:[h.jsx("img",{alt:Yt.Jane,src:Hje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.Jane",i)]},Yt.Jane),h.jsxs(Ka,{value:Yt.Jaya,children:[h.jsx("img",{alt:Yt.Jaya,src:Mje,height:20,style:{paddingRight:"19px"}})," ",Y.t("people.Jaya",i)]},Yt.Jaya),h.jsxs(Ka,{value:Yt.Jaye,children:[h.jsx("img",{alt:Yt.Jaye,src:Ije,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jaye",i)]},Yt.Jaye),h.jsxs(Ka,{value:Yt.Jeanette,children:[h.jsx("img",{alt:Yt.Jeanette,src:zje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jeanette",i)]},Yt.Jeanette),h.jsxs(Ka,{value:Yt.Jedi,children:[h.jsx("img",{alt:Yt.Jedi,src:Dje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jedi",i)]},Yt.Jedi),h.jsxs(Ka,{value:Yt.Jeff,children:[h.jsx("img",{alt:Yt.Jeff,src:Eje,height:20,style:{paddingRight:"19px"}})," ",Y.t("people.Jeff",i)]},Yt.Jeff),h.jsxs(Ka,{value:Yt.Jena,children:[h.jsx("img",{alt:Yt.Jena,src:Fje,height:20,style:{paddingRight:"19px"}})," ",Y.t("people.Jena",i)]},Yt.Jena),h.jsxs(Ka,{value:Yt.Jennifer,children:[h.jsx("img",{alt:Yt.Jennifer,src:kje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.Jennifer",i)]},Yt.Jennifer),h.jsxs(Ka,{value:Yt.Jess,children:[h.jsx("img",{alt:Yt.Jess,src:Lje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.Jess",i)]},Yt.Jess),h.jsxs(Ka,{value:Yt.Jett,children:[h.jsx("img",{alt:Yt.Jett,src:Wje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.Jett",i)]},Yt.Jett),h.jsxs(Ka,{value:Yt.Jill,children:[h.jsx("img",{alt:Yt.Jill,src:Nje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jill",i)]},Yt.Jill),h.jsxs(Ka,{value:Yt.Jiya,children:[h.jsx("img",{alt:Yt.Jiya,src:Uje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jiya",i)]},Yt.Jiya),h.jsxs(Ka,{value:Yt.Joan,children:[h.jsx("img",{alt:Yt.Joan,src:jje,height:20,style:{paddingRight:"8px"}})," ",Y.t("people.Joan",i)]},Yt.Joan),h.jsxs(Ka,{value:Yt.Jocelyn,children:[h.jsx("img",{alt:Yt.Jocelyn,src:Bje,height:20,style:{paddingRight:"23px"}})," ",Y.t("people.Jocelyn",i)]},Yt.Jocelyn),h.jsxs(Ka,{value:Yt.Joel,children:[h.jsx("img",{alt:Yt.Joel,src:Yje,height:20,style:{paddingRight:"7px"}})," ",Y.t("people.Joel",i)]},Yt.Joel),h.jsxs(Ka,{value:Yt.Joey,children:[h.jsx("img",{alt:Yt.Joey,src:Oje,height:20,style:{paddingRight:"22px"}})," ",Y.t("people.Joey",i)]},Yt.Joey),h.jsxs(Ka,{value:Yt.John,children:[h.jsx("img",{alt:Yt.John,src:_je,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.John",i)]},Yt.John),h.jsxs(Ka,{value:Yt.Jonathon,children:[h.jsx("img",{alt:Yt.Jonathon,src:Vje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jonathon",i)]},Yt.Jonathon),h.jsxs(Ka,{value:Yt.Jose,children:[h.jsx("img",{alt:Yt.Jose,src:Gje,height:20,style:{paddingRight:"5px"}})," ",Y.t("people.Jose",i)]},Yt.Jose),h.jsxs(Ka,{value:Yt.Joseph,children:[h.jsx("img",{alt:Yt.Joseph,src:Xje,height:20,style:{paddingRight:"22px"}})," ",Y.t("people.Joseph",i)]},Yt.Joseph),h.jsxs(Ka,{value:Yt.Joshua,children:[h.jsx("img",{alt:Yt.Joshua,src:Jje,height:20,style:{paddingRight:"22px"}})," ",Y.t("people.Joshua",i)]},Yt.Joshua),h.jsxs(Ka,{value:Yt.Judd,children:[h.jsx("img",{alt:Yt.Judd,src:Kje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.Judd",i)]},Yt.Judd),h.jsxs(Ka,{value:Yt.Judy,children:[h.jsx("img",{alt:Yt.Judy,src:qje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.Judy",i)]},Yt.Judy),h.jsxs(Ka,{value:Yt.Julia,children:[h.jsx("img",{alt:Yt.Julia,src:$je,height:20,style:{paddingRight:"22px"}})," ",Y.t("people.Julia",i)]},Yt.Julia),h.jsxs(Ka,{value:Yt.Julio,children:[h.jsx("img",{alt:Yt.Julio,src:Qje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Julio",i)]},Yt.Julio),h.jsxs(Ka,{value:Yt.Jumapili,children:[h.jsx("img",{alt:Yt.Jumapili,src:Zje,height:20,style:{paddingRight:"16px"}})," ",Y.t("people.Jumapili",i)]},Yt.Jumapili),h.jsxs(Ka,{value:Yt.June,children:[h.jsx("img",{alt:Yt.June,src:eBe,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.June",i)]},Yt.June),h.jsxs(Ka,{value:Yt.Juro,children:[h.jsx("img",{alt:Yt.Juro,src:tBe,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Juro",i)]},Yt.Juro),h.jsxs(Ka,{value:Yt.Justin,children:[h.jsx("img",{alt:Yt.Justin,src:nBe,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Justin",i)]},Yt.Justin)]})}),jdo=t=>{const e=[];if(t.type!==z.Human)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language},i=H.getState().viewState.orthographic??!1;return e.push({key:"human-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"human-cut",label:h.jsx(Wd,{})}),e.push({key:"human-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&e.push({key:"human-flip",label:h.jsx(I9e,{billboardModel:n})}),i||e.push({key:"human-move-view",label:h.jsx(kdo,{human:n})}),o&&(e.push({key:"human-obserber",label:h.jsx(Fdo,{human:n})}),e.push({key:"human-selection",label:h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"120px"},children:[Y.t("peopleMenu.ChangePerson",r),": "]}),h.jsx(Udo,{human:n})]})})),{items:e}},{Option:ef}=_o,Bdo=be.memo(({flower:t})=>{const e=H(fn),n=H(En),[o,r]=m.useState(!1),i=Jt(),a=(l,s)=>{e(c=>{for(const u of c.elements)if(u.type===z.Flower&&u.id===l){const d=u;d.name=s,d.lx=p8.fetchSpread(s),d.lz=p8.fetchHeight(s);break}})};return h.jsxs(_o,{style:{width:"200px"},value:(t==null?void 0:t.name)??ro.WhiteFlower,onChange:l=>{if(t){const s=t.name;if(s!==l){const c={name:"Change Flower",timestamp:Date.now(),oldValue:s,newValue:l,changedElementId:t.id,changedElementType:t.type,undo:()=>{a(c.changedElementId,c.oldValue)},redo:()=>{a(c.changedElementId,c.newValue)}};n(c),a(t.id,l),e(u=>{u.actionState.flowerType=l}),r(!o)}}},children:[h.jsxs(ef,{value:ro.WhiteFlower,children:[h.jsx("img",{alt:ro.WhiteFlower,src:fBe,height:20,style:{paddingRight:"17px"}})," ",Y.t("flower.WhiteFlower",i)]},ro.WhiteFlower),h.jsxs(ef,{value:ro.YellowFlower,children:[h.jsx("img",{alt:ro.YellowFlower,src:hBe,height:20,style:{paddingRight:"16px"}})," ",Y.t("flower.YellowFlower",i)]},ro.YellowFlower),h.jsxs(ef,{value:ro.Hibiscus,children:[h.jsx("img",{alt:ro.Hibiscus,src:rBe,height:20,style:{paddingRight:"19px"}})," ",Y.t("flower.Hibiscus",i)]},ro.Hibiscus),h.jsxs(ef,{value:ro.Hydrangea,children:[h.jsx("img",{alt:ro.Hydrangea,src:iBe,height:20,style:{paddingRight:"18px"}})," ",Y.t("flower.Hydrangea",i)]},ro.Hydrangea),h.jsxs(ef,{value:ro.Spirea,children:[h.jsx("img",{alt:ro.Spirea,src:cBe,height:20,style:{paddingRight:"18px"}})," ",Y.t("flower.Spirea",i)]},ro.Spirea),h.jsxs(ef,{value:ro.Hosta,children:[h.jsx("img",{alt:ro.Hosta,src:aBe,height:20,style:{paddingRight:"18px"}})," ",Y.t("flower.Hosta",i)]},ro.Hosta),h.jsxs(ef,{value:ro.Peony,children:[h.jsx("img",{alt:ro.Peony,src:lBe,height:20,style:{paddingRight:"17px"}})," ",Y.t("flower.Peony",i)]},ro.Peony),h.jsxs(ef,{value:ro.Boxwood,children:[h.jsx("img",{alt:ro.Boxwood,src:Yce,height:20,style:{paddingRight:"23px"}})," ",Y.t("flower.Boxwood",i)]},ro.Boxwood),h.jsxs(ef,{value:ro.TallBush,children:[h.jsx("img",{alt:ro.TallBush,src:Xce,height:20,style:{paddingRight:"32px"}})," ",Y.t("flower.TallBush",i)]},ro.TallBush),h.jsxs(ef,{value:ro.CactusCombo1,children:[h.jsx("img",{alt:ro.CactusCombo1,src:Oce,height:20,style:{paddingRight:"26px"}})," ",Y.t("flower.CactusCombo1",i)]},ro.CactusCombo1),h.jsxs(ef,{value:ro.CactusCombo2,children:[h.jsx("img",{alt:ro.CactusCombo2,src:_ce,height:20,style:{paddingRight:"26px"}})," ",Y.t("flower.CactusCombo2",i)]},ro.CactusCombo2),h.jsxs(ef,{value:ro.CactusCombo3,children:[h.jsx("img",{alt:ro.CactusCombo3,src:Vce,height:20,style:{paddingRight:"26px"}})," ",Y.t("flower.CactusCombo3",i)]},ro.CactusCombo3),h.jsxs(ef,{value:ro.CactusCombo4,children:[h.jsx("img",{alt:ro.CactusCombo4,src:Gce,height:20,style:{paddingRight:"26px"}})," ",Y.t("flower.CactusCombo4",i)]},ro.CactusCombo4),h.jsxs(ef,{value:ro.RedRose,children:[h.jsx("img",{alt:ro.RedRose,src:sBe,height:20,style:{paddingRight:"26px"}})," ",Y.t("flower.RedRose",i)]},ro.RedRose),h.jsxs(ef,{value:ro.Bellflower,children:[h.jsx("img",{alt:ro.Bellflower,src:oBe,height:20,style:{paddingRight:"20px"}})," ",Y.t("flower.Bellflower",i)]},ro.Bellflower),h.jsxs(ef,{value:ro.Sunflower,children:[h.jsx("img",{alt:ro.Sunflower,src:uBe,height:20,style:{paddingRight:"32px"}})," ",Y.t("flower.Sunflower",i)]},ro.Sunflower),h.jsxs(ef,{value:ro.Tulip,children:[h.jsx("img",{alt:ro.Tulip,src:dBe,height:20,style:{paddingRight:"24px"}})," ",Y.t("flower.Tulip",i)]},ro.Tulip)]})}),Ydo=t=>{const e=[];if(t.type!==z.Flower)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language};return e.push({key:"flower-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"flower-cut",label:h.jsx(Wd,{})}),e.push({key:"flower-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&e.push({key:"flower-flip",label:h.jsx(I9e,{billboardModel:n})}),o&&e.push({key:"flower-change-type",label:h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"60px"},children:[Y.t("flowerMenu.Type",r),": "]}),h.jsx(Bdo,{flower:n})]})}),{items:e}},Odo=({polygon:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.type===z.Polygon&&l.id===r){l.filled=i;break}})},o=r=>{const i={name:"Fill Polygon",timestamp:Date.now(),checked:!t.filled,selectedElementId:t.id,selectedElementType:z.Polygon,undo:()=>{n(t.id,!i.checked)},redo:()=>{n(t.id,i.checked)}};H.getState().addUndoable(i),n(t.id,r.target.checked)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.filled,onChange:o,children:Y.t("polygonMenu.Filled",e)})})},_do=({polygon:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.type===z.Polygon&&l.id===r){l.shininess=i;break}})},o=r=>{const a={name:"Shiny Polygon",timestamp:Date.now(),checked:((t==null?void 0:t.shininess)??0)>0,selectedElementId:t.id,selectedElementType:z.Polygon,undo:()=>{n(t.id,a.checked?0:100)},redo:()=>{n(t.id,a.checked?100:0)}};H.getState().addUndoable(a),n(t.id,r.target.checked?100:0)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:!!t.shininess,onChange:o,children:Y.t("polygonMenu.Shiny",e)})})},Vdo=({polygon:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.type===z.Polygon&&l.id===r){l.noOutline=i;break}})},o=r=>{const i={name:"No Outline for Polygon",timestamp:Date.now(),checked:!t.noOutline,selectedElementId:t.id,selectedElementType:z.Polygon,undo:()=>{n(t.id,!i.checked)},redo:()=>{n(t.id,i.checked)}};H.getState().addUndoable(i),n(t.id,r.target.checked)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.noOutline,onChange:o,children:Y.t("polygonMenu.NoOutline",e)})})},Gdo=({polygon:t})=>{const e=Jt(),[n,o]=m.useState((t==null?void 0:t.text)??""),r=(a,l)=>{H.getState().set(s=>{for(const c of s.elements)if(c.id===a){!c.locked&&c.type===z.Polygon&&(c.text=l);break}})},i=()=>{const a={name:"Set Text for Polygon",timestamp:Date.now(),oldValue:t.text??"",newValue:n,changedElementId:t.id,changedElementType:z.Polygon,undo:()=>{r(t.id,a.oldValue)},redo:()=>{r(t.id,a.newValue)}};H.getState().addUndoable(a),r(t.id,n)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(as,{addonBefore:h.jsxs(hy,{width:"120px",children:[Y.t("word.Text",e),":"]}),value:n,onChange:a=>o(a.target.value),onPressEnter:i,onBlur:i})})},Xdo=({polygon:t})=>{const e=Jt(),[n,o]=m.useState((t==null?void 0:t.fontSize)??1),r=(a,l)=>{H.getState().set(s=>{for(const c of s.elements)if(c.id===a){!c.locked&&c.type===z.Polygon&&(c.fontSize=l);break}})},i=()=>{const a={name:"Set Font Size for Polygon",timestamp:Date.now(),oldValue:t.fontSize??1,newValue:n,changedElementId:t.id,changedElementType:z.Polygon,undo:()=>{r(t.id,a.oldValue)},redo:()=>{r(t.id,a.newValue)}};H.getState().addUndoable(a),r(t.id,n)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsxs(hy,{width:"120px",children:[Y.t("word.FontSize",e),":"]}),min:.1,max:5,step:.01,precision:2,value:n,onChange:a=>o(a),onPressEnter:i,onBlur:i})})},Jdo=({polygon:t})=>{const e=Jt(),[n,o]=m.useState((t==null?void 0:t.fontColor)??"black"),r=(a,l)=>{H.getState().set(s=>{for(const c of s.elements)if(c.id===a){!c.locked&&c.type===z.Polygon&&(c.fontColor=l);break}})},i=()=>{const a={name:"Set Font Color for Polygon",timestamp:Date.now(),oldValue:t.fontColor??"black",newValue:n,changedElementId:t.id,changedElementType:z.Polygon,undo:()=>{r(t.id,a.oldValue)},redo:()=>{r(t.id,a.newValue)}};H.getState().addUndoable(a),r(t.id,n)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(as,{addonBefore:h.jsxs(hy,{width:"120px",children:[Y.t("word.FontColor",e),":"]}),value:n,onChange:a=>o(a.target.value),onPressEnter:i,onBlur:i})})},Kdo=({polygon:t})=>{const e=Jt(),[n,o]=m.useState((t==null?void 0:t.fontOutlineColor)??"white"),r=(a,l)=>{H.getState().set(s=>{for(const c of s.elements)if(c.id===a){!c.locked&&c.type===z.Polygon&&(c.fontOutlineColor=l);break}})},i=()=>{const a={name:"Set Font Outline Color for Polygon",timestamp:Date.now(),oldValue:t.fontOutlineColor??"white",newValue:n,changedElementId:t.id,changedElementType:z.Polygon,undo:()=>{r(t.id,a.oldValue)},redo:()=>{r(t.id,a.newValue)}};H.getState().addUndoable(a),r(t.id,n)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(as,{addonBefore:h.jsxs(hy,{width:"120px",children:[Y.t("polygonMenu.FontOutlineColor",e),":"]}),value:n,onChange:a=>o(a.target.value),onPressEnter:i,onBlur:i})})},qdo=({polygon:t})=>{const e=Jt(),[n,o]=m.useState((t==null?void 0:t.fontOutlineWidth)??0),r=(a,l)=>{H.getState().set(s=>{for(const c of s.elements)if(c.id===a){!c.locked&&c.type===z.Polygon&&(c.fontOutlineWidth=l);break}})},i=()=>{const a={name:"Set Font Outline Width for Polygon",timestamp:Date.now(),oldValue:t.fontOutlineWidth??0,newValue:n,changedElementId:t.id,changedElementType:z.Polygon,undo:()=>{r(t.id,a.oldValue)},redo:()=>{r(t.id,a.newValue)}};H.getState().addUndoable(a),r(t.id,n)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsxs(hy,{width:"120px",children:[Y.t("polygonMenu.FontOutlineWidth",e),":"]}),min:0,max:1,step:.01,precision:2,value:n,onChange:a=>o(a),onPressEnter:i,onBlur:i})})},$do=({polygon:t})=>{const e=Jt(),[n,o]=m.useState((t==null?void 0:t.fontStrokeColor)??"black"),r=(a,l)=>{H.getState().set(s=>{for(const c of s.elements)if(c.id===a){!c.locked&&c.type===z.Polygon&&(c.fontStrokeColor=l);break}})},i=()=>{const a={name:"Set Font Stroke Color for Polygon",timestamp:Date.now(),oldValue:t.fontStrokeColor??"black",newValue:n,changedElementId:t.id,changedElementType:z.Polygon,undo:()=>{r(t.id,a.oldValue)},redo:()=>{r(t.id,a.newValue)}};H.getState().addUndoable(a),r(t.id,n)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(as,{addonBefore:h.jsxs(hy,{width:"120px",children:[Y.t("polygonMenu.FontStrokeColor",e),":"]}),value:n,onChange:a=>o(a.target.value),onPressEnter:i,onBlur:i})})},Qdo=({polygon:t})=>{const e=Jt(),[n,o]=m.useState((t==null?void 0:t.fontStrokeWidth)??0),r=(a,l)=>{H.getState().set(s=>{for(const c of s.elements)if(c.id===a){!c.locked&&c.type===z.Polygon&&(c.fontStrokeWidth=l);break}})},i=()=>{const a={name:"Set Font Stroke Width for Polygon",timestamp:Date.now(),oldValue:t.fontStrokeWidth??0,newValue:n,changedElementId:t.id,changedElementType:z.Polygon,undo:()=>{r(t.id,a.oldValue)},redo:()=>{r(t.id,a.newValue)}};H.getState().addUndoable(a),r(t.id,n)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsxs(hy,{width:"120px",children:[Y.t("polygonMenu.FontStrokeWidth",e),":"]}),min:0,max:1,step:.01,precision:2,value:n,onChange:a=>o(a),onPressEnter:i,onBlur:i})})},Zdo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(qr),r=H(Owt),i=H(_wt),a=H(Vwt),l=H(Gwt),s=H(En),c=H(FH),u=H(kH),d=H(no),f=H(Zn),p=co(z.Polygon),[g,y]=m.useState((p==null?void 0:p.lineColor)??"black"),w=Jt(),b=x=>{u(x.target.value)},C=x=>{if(p){switch(c){case oe.AllSelectedObjectsOfThisType:for(const S of e)if(S.type===z.Polygon&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&x!==S.lineColor)return!0;break;case oe.AllObjectsOfThisType:for(const S of e)if(S.type===z.Polygon&&!S.locked&&x!==S.lineColor)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const S of e)if(S.type===z.Polygon&&S.parentId===p.parentId&&me.isIdentical(S.normal,p.normal)&&!S.locked&&S.lineColor!==x)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const S of e)if(S.type===z.Polygon&&S.foundationId===(p==null?void 0:p.foundationId)&&!S.locked&&S.lineColor!==x)return!0;break;default:if(x!==(p==null?void 0:p.lineColor))return!0}return!1}},P=(x,S)=>{H.getState().set(R=>{for(const M of R.elements)M.type===z.Polygon&&!M.locked&&x.has(M.id)&&(M.lineColor=S)})},v=x=>{if(p&&C(x))switch(c){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of e)M.type===z.Polygon&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M.lineColor??"black");const R={name:"Set Line Color for Selected Polygons",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{P(R.oldValues,R.newValue)}};s(R),P(S,x),f(d+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of e)M.type===z.Polygon&&S.set(M.id,M.lineColor??"black");const R={name:"Set Line Color for All Polygons",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{l(z.Polygon,R.newValue)}};s(R),l(z.Polygon,x),f(d+1);break}case oe.AllObjectsOfThisTypeOnSurface:{if(o(p)){const R=new Map;for(const D of e)D.type===z.Polygon&&D.parentId===p.parentId&&me.isIdentical(D.normal,p.normal)&&R.set(D.id,D.lineColor??"gray");const M={name:"Set Line Color for All Polygons on Same Surface",timestamp:Date.now(),oldValues:R,newValue:x,groupId:p.parentId,normal:p.normal,undo:()=>{for(const[D,E]of M.oldValues.entries())r(D,E)},redo:()=>{M.groupId&&i(z.Polygon,M.groupId,M.normal,M.newValue)}};s(M),i(z.Polygon,p.parentId,p.normal,x),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){const S=new Map;for(const M of e)M.type===z.Polygon&&M.foundationId===p.foundationId&&S.set(M.id,M.lineColor??"black");const R={name:"Set Line Color for All Polygons Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:p.foundationId,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{R.groupId&&a(z.Polygon,R.groupId,R.newValue)}};s(R),a(z.Polygon,p.foundationId,x),f(d+1)}break}default:{const S=n(p.id),R=S?S.lineColor:p.lineColor,M={name:"Set Line Color of Selected Polygon",timestamp:Date.now(),oldValue:R,newValue:x,changedElementId:p.id,changedElementType:p.type,undo:()=>{r(M.changedElementId,M.oldValue)},redo:()=>{r(M.changedElementId,M.newValue)}};s(M),r(p.id,x),f(d+1);break}}},T=()=>{t(!1)},A=()=>{v(g)};return h.jsx(so,{width:600,title:Y.t("polygonMenu.LineColor",w),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(zf,{color:g??(p==null?void 0:p.lineColor)??"black",onChangeComplete:x=>{y(x.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:12,children:h.jsx(Ue.Group,{onChange:b,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("polygonMenu.OnlyThisPolygon",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("polygonMenu.AllPolygonsOnSurface",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("polygonMenu.AllPolygonsAboveFoundation",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("polygonMenu.AllSelectedPolygons",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("polygonMenu.AllPolygons",w)})]})})})]})})},efo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(FH),l=H(kH),s=H(no),c=H(Zn),u=co(z.Polygon),[d,f]=m.useState((u==null?void 0:u.lineStyle)??Gh.Solid),p=Jt(),{Option:g}=_o,y=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.Polygon&&E.id===R){E.lineStyle=M;break}})},w=(R,M,D)=>{e(E=>{for(const W of E.elements)W.type===z.Polygon&&W.parentId===R&&me.isIdentical(W.normal,M)&&!W.locked&&(W.lineStyle=D)})},b=(R,M)=>{e(D=>{for(const E of D.elements)E.type===z.Polygon&&E.foundationId===R&&!E.locked&&(E.lineStyle=M)})},C=R=>{e(M=>{for(const D of M.elements)D.type===z.Polygon&&!D.locked&&(D.lineStyle=R)})},P=R=>{l(R.target.value)},v=R=>{if(u){switch(a){case oe.AllSelectedObjectsOfThisType:for(const M of n)if(M.type===z.Polygon&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&R!==M.lineStyle)return!0;break;case oe.AllObjectsOfThisType:for(const M of n)if(M.type===z.Polygon&&!M.locked&&R!==M.lineStyle)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const M of n)if(M.type===z.Polygon&&M.parentId===u.parentId&&me.isIdentical(M.normal,u.normal)&&!M.locked&&R!==M.lineStyle)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const M of n)if(M.type===z.Polygon&&M.foundationId===(u==null?void 0:u.foundationId)&&!M.locked&&R!==M.lineStyle)return!0;break;default:if(R!==(u==null?void 0:u.lineStyle))return!0}return!1}},T=(R,M)=>{H.getState().set(D=>{for(const E of D.elements)E.type===z.Polygon&&!E.locked&&R.has(E.id)&&(E.lineStyle=M)})},A=R=>{if(u&&v(R))switch(a){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.Polygon&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E.lineStyle??Gh.Solid);const D={name:"Set Line Style for Selected Polygons",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{T(D.oldValues,D.newValue)}};i(D),T(M,R),c(s+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.Polygon&&M.set(E.id,E.lineStyle??Gh.Solid);const D={name:"Set Line Style for All Polygons",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{C(D.newValue)}};i(D),C(R),c(s+1);break}case oe.AllObjectsOfThisTypeOnSurface:{if(r(u)){const D=new Map;for(const W of n)W.type===z.Polygon&&W.parentId===u.parentId&&me.isIdentical(W.normal,u.normal)&&D.set(W.id,W.lineStyle??Gh.Solid);const E={name:"Set Line Style for All Polygons on Same Surface",timestamp:Date.now(),oldValues:D,newValue:R,groupId:u.parentId,normal:u.normal,undo:()=>{for(const[W,j]of E.oldValues.entries())y(W,j)},redo:()=>{E.groupId&&w(E.groupId,E.normal,E.newValue)}};i(E),w(u.parentId,u.normal,R),c(s+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const M=new Map;for(const E of n)E.type===z.Polygon&&E.foundationId===u.foundationId&&M.set(E.id,E.lineStyle??Gh.Solid);const D={name:"Set Line Style for All Polygons Above Foundation",timestamp:Date.now(),oldValues:M,newValue:R,groupId:u.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{D.groupId&&b(D.groupId,D.newValue)}};i(D),b(u.foundationId,R),c(s+1)}break}default:{const M=o(u.id),D=M?M.lineStyle:u.lineStyle,E={name:"Set Line Style of Selected Polygon",timestamp:Date.now(),oldValue:D,newValue:R,changedElementId:u.id,changedElementType:u.type,undo:()=>{y(E.changedElementId,E.oldValue)},redo:()=>{y(E.changedElementId,E.newValue)}};i(E),y(u.id,R),c(s+1);break}}},x=()=>{t(!1)},S=()=>{A(d)};return h.jsx(so,{width:600,title:Y.t("polygonMenu.LineStyle",p),onApply:S,onClose:x,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:10,children:h.jsxs(_o,{style:{width:"200px"},value:d,onChange:R=>f(R),children:[h.jsxs(g,{value:Gh.Solid,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"48px",height:"1px",border:"1px solid dimGray"},children:" "}),Y.t("polygonMenu.SolidLine",p)]},Gh.Solid),h.jsxs(g,{value:Gh.Dashed,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"48px",height:"1px",border:"1px dashed dimGray"},children:" "}),Y.t("polygonMenu.DashedLine",p)]},Gh.Dashed),h.jsxs(g,{value:Gh.Dotted,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"48px",height:"1px",border:"1px dotted dimGray"},children:" "}),Y.t("polygonMenu.DottedLine",p)]},Gh.Dotted)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:14,children:h.jsx(Ue.Group,{onChange:P,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("polygonMenu.OnlyThisPolygon",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("polygonMenu.AllPolygonsOnSurface",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("polygonMenu.AllPolygonsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("polygonMenu.AllSelectedPolygons",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("polygonMenu.AllPolygons",p)})]})})})]})})},tfo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(qr),r=H(Xwt),i=H(Jwt),a=H(Kwt),l=H(qwt),s=H(En),c=H(FH),u=H(kH),d=H(no),f=H(Zn),p=co(z.Polygon),[g,y]=m.useState((p==null?void 0:p.lineWidth)??1),w=Jt(),{Option:b}=_o,C=S=>{u(S.target.value)},P=S=>{if(p){switch(c){case oe.AllSelectedObjectsOfThisType:for(const R of e)if(R.type===z.Polygon&&!R.locked&&H.getState().selectedElementIdSet.has(R.id)&&S!==R.lineWidth)return!0;break;case oe.AllObjectsOfThisType:for(const R of e)if(R.type===z.Polygon&&!R.locked&&S!==R.lineWidth)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const R of e)if(R.type===z.Polygon&&R.parentId===p.parentId&&me.isIdentical(R.normal,p.normal)&&!R.locked&&R.lineWidth!==S)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const R of e)if(R.type===z.Polygon&&R.foundationId===(p==null?void 0:p.foundationId)&&!R.locked&&R.lineWidth!==S)return!0;break;default:if(S!==(p==null?void 0:p.lineWidth))return!0}return!1}},v=(S,R)=>{H.getState().set(M=>{for(const D of M.elements)D.type===z.Polygon&&!D.locked&&S.has(D.id)&&(D.lineWidth=R)})},T=S=>{if(p&&P(S))switch(c){case oe.AllSelectedObjectsOfThisType:{const R=new Map;for(const D of e)D.type===z.Polygon&&H.getState().selectedElementIdSet.has(D.id)&&R.set(D.id,D.lineWidth??1);const M={name:"Set Line Width for Selected Polygons",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())r(D,E)},redo:()=>{v(M.oldValues,M.newValue)}};s(M),v(R,S),f(d+1);break}case oe.AllObjectsOfThisType:{const R=new Map;for(const D of e)D.type===z.Polygon&&R.set(D.id,D.lineWidth??1);const M={name:"Set Line Width for All Polygons",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())r(D,E)},redo:()=>{l(z.Polygon,M.newValue)}};s(M),l(z.Polygon,S),f(d+1);break}case oe.AllObjectsOfThisTypeOnSurface:{if(o(p)){const M=new Map;for(const E of e)E.type===z.Polygon&&E.parentId===p.parentId&&me.isIdentical(E.normal,p.normal)&&M.set(E.id,E.lineWidth??1);const D={name:"Set Line Width for All Polygons on Same Surface",timestamp:Date.now(),oldValues:M,newValue:S,groupId:p.parentId,normal:p.normal,undo:()=>{for(const[E,W]of D.oldValues.entries())r(E,W)},redo:()=>{D.groupId&&i(z.Polygon,D.groupId,D.normal,D.newValue)}};s(D),i(z.Polygon,p.parentId,p.normal,S),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){const R=new Map;for(const D of e)D.type===z.Polygon&&D.foundationId===p.foundationId&&R.set(D.id,D.lineWidth??1);const M={name:"Set Line Width for All Polygons Above Foundation",timestamp:Date.now(),oldValues:R,newValue:S,groupId:p.foundationId,undo:()=>{for(const[D,E]of M.oldValues.entries())r(D,E)},redo:()=>{M.groupId&&a(z.Polygon,M.groupId,M.newValue)}};s(M),a(z.Polygon,p.foundationId,S),f(d+1)}break}default:{const R=n(p.id),M=R?R.lineWidth:p.lineWidth,D={name:"Set Line Width of Selected Polygon",timestamp:Date.now(),oldValue:M,newValue:S,changedElementId:p.id,changedElementType:p.type,undo:()=>{r(D.changedElementId,D.oldValue)},redo:()=>{r(D.changedElementId,D.newValue)}};s(D),r(p.id,S),f(d+1);break}}},A=()=>{t(!1)},x=()=>{T(g),t(!1),f(0)};return h.jsx(so,{width:560,title:Y.t("polygonMenu.LineWidth",w),onApply:x,onClose:A,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:10,children:h.jsxs(_o,{style:{width:"200px"},value:g,onChange:S=>y(S),children:[h.jsx(b,{value:$y.One,children:h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"24px",width:"100%",height:"1px",border:"1px solid dimGray"}})},$y.One),h.jsx(b,{value:$y.Two,children:h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"24px",width:"100%",height:"1px",border:"2px solid dimGray"}})},$y.Two),h.jsx(b,{value:$y.Three,children:h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"24px",width:"100%",height:"1px",border:"3px solid dimGray"}})},$y.Three),h.jsx(b,{value:$y.Four,children:h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"24px",width:"100%",height:"1px",border:"4px solid dimGray"}})},$y.Four),h.jsx(b,{value:$y.Five,children:h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"24px",width:"100%",height:"1px",border:"5px solid dimGray"}})},$y.Five)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:14,children:h.jsx(Ue.Group,{onChange:C,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("polygonMenu.OnlyThisPolygon",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("polygonMenu.AllPolygonsOnSurface",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("polygonMenu.AllPolygonsAboveFoundation",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("polygonMenu.AllSelectedPolygons",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("polygonMenu.AllPolygons",w)})]})})})]})})},nfo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(qr),r=H(oYe),i=H(Bwt),a=H(Ywt),l=H(rYe),s=H(En),c=H(FH),u=H(kH),d=H(no),f=H(Zn),p=co(z.Polygon),[g,y]=m.useState((p==null?void 0:p.color)??"gray"),w=Jt(),b=x=>{u(x.target.value)},C=x=>{if(p){switch(c){case oe.AllSelectedObjectsOfThisType:for(const S of e)if(S.type===z.Polygon&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&x!==S.color)return!0;break;case oe.AllObjectsOfThisType:for(const S of e)if(S.type===z.Polygon&&!S.locked&&x!==S.color)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const S of e)if(S.type===z.Polygon&&S.foundationId===p.foundationId&&!S.locked&&S.color!==x)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const S of e)if(S.type===z.Polygon&&S.parentId===p.parentId&&me.isIdentical(S.normal,p.normal)&&!S.locked&&S.color!==x)return!0;break;default:if(x!==p.color)return!0}return!1}},P=(x,S)=>{H.getState().set(R=>{for(const M of R.elements)M.type===z.Polygon&&!M.locked&&x.has(M.id)&&(M.color=S)})},v=x=>{if(p&&C(x))switch(c){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of e)M.type===z.Polygon&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M.color??"gray");const R={name:"Set Fill Color for Selected Polygons",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{P(R.oldValues,R.newValue)}};s(R),P(S,x),f(d+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of e)M.type===z.Polygon&&S.set(M.id,M.color??"gray");const R={name:"Set Fill Color for All Polygons",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{l(z.Polygon,R.newValue)}};s(R),l(z.Polygon,x),f(d+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){const S=new Map;for(const M of e)M.type===z.Polygon&&M.foundationId===p.foundationId&&S.set(M.id,M.color??"gray");const R={name:"Set Fill Color for All Polygons Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:p.foundationId,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{R.groupId&&a(z.Polygon,R.groupId,R.newValue)}};s(R),a(z.Polygon,p.foundationId,x),f(d+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{if(o(p)){const R=new Map;for(const D of e)D.type===z.Polygon&&D.parentId===p.parentId&&me.isIdentical(D.normal,p.normal)&&R.set(D.id,D.color??"gray");const M={name:"Set Fill Color for All Polygons on Same Surface",timestamp:Date.now(),oldValues:R,newValue:x,groupId:p.parentId,normal:p.normal,undo:()=>{for(const[D,E]of M.oldValues.entries())r(D,E)},redo:()=>{M.groupId&&i(z.Polygon,M.groupId,M.normal,M.newValue)}};s(M),i(z.Polygon,p.parentId,p.normal,x),f(d+1)}break}default:{const S=n(p.id),R=S?S.color:p.color,M={name:"Set Fill Color of Selected Polygon",timestamp:Date.now(),oldValue:R,newValue:x,changedElementId:p.id,changedElementType:p.type,undo:()=>{r(M.changedElementId,M.oldValue)},redo:()=>{r(M.changedElementId,M.newValue)}};s(M),r(p.id,x),f(d+1);break}}},T=()=>{t(!1)},A=()=>{v(g)};return h.jsx(so,{width:600,title:Y.t("polygonMenu.FillColor",w),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(zf,{color:g??(p==null?void 0:p.color)??"gray",onChangeComplete:x=>{y(x.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:12,children:h.jsx(Ue.Group,{onChange:b,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("polygonMenu.OnlyThisPolygon",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("polygonMenu.AllPolygonsOnSurface",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("polygonMenu.AllPolygonsAboveFoundation",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("polygonMenu.AllSelectedPolygons",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("polygonMenu.AllPolygons",w)})]})})})]})})},ofo="/aladdin/assets/polygon_08_menu-RpvWW3pg.png",rfo="/aladdin/assets/polygon_09_menu-CCH8lYni.png",ifo="/aladdin/assets/polygon_10_menu-BYFeRpsw.png",afo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(FH),l=H(kH),s=H(no),c=H(Zn),u=co(z.Polygon),[d,f]=m.useState((u==null?void 0:u.textureType)??Jr.NoTexture),p=Jt(),{Option:g}=_o,y=(R,M)=>{e(D=>{for(const E of D.elements)if(E.id===R&&E.type===z.Polygon&&!E.locked){E.textureType=M;break}})},w=(R,M,D)=>{e(E=>{for(const W of E.elements)W.type===z.Polygon&&W.parentId===R&&me.isIdentical(W.normal,M)&&!W.locked&&(W.textureType=D)})},b=(R,M)=>{e(D=>{for(const E of D.elements)E.type===z.Polygon&&E.foundationId===R&&!E.locked&&(E.textureType=M)})},C=R=>{e(M=>{for(const D of M.elements)D.type===z.Polygon&&!D.locked&&(D.textureType=R)})},P=R=>{l(R.target.value)},v=R=>{if(u){switch(a){case oe.AllSelectedObjectsOfThisType:for(const M of n)if(M.type===z.Polygon&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&R!==M.textureType)return!0;break;case oe.AllObjectsOfThisType:for(const M of n)if(M.type===z.Polygon&&!M.locked&&R!==M.textureType)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const M of n)if(M.type===z.Polygon&&M.parentId===u.parentId&&me.isIdentical(M.normal,u.normal)&&!M.locked&&M.textureType!==R)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const M of n)if(M.type===z.Polygon&&M.foundationId===u.foundationId&&!M.locked&&M.textureType!==R)return!0;break;default:if(R!==(u==null?void 0:u.textureType))return!0}return!1}},T=(R,M)=>{H.getState().set(D=>{for(const E of D.elements)E.type===z.Polygon&&!E.locked&&R.has(E.id)&&(E.textureType=M)})},A=R=>{if(u&&v(R))switch(a){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.Polygon&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E.textureType??Jr.NoTexture);const D={name:"Set Texture for Selected Polygons",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{T(D.oldValues,D.newValue)}};i(D),T(M,R),c(s+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.Polygon&&M.set(E.id,E.textureType??Jr.NoTexture);const D={name:"Set Texture for All Polygons",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{C(D.newValue)}};i(D),C(R),c(s+1);break}case oe.AllObjectsOfThisTypeOnSurface:{if(r(u)){const D=new Map;for(const W of n)W.type===z.Polygon&&W.parentId===u.parentId&&me.isIdentical(W.normal,u.normal)&&D.set(W.id,W.textureType??Jr.NoTexture);const E={name:"Set Texture for All Polygons on Same Surface",timestamp:Date.now(),oldValues:D,newValue:R,groupId:u.parentId,normal:u.normal,undo:()=>{for(const[W,j]of E.oldValues.entries())y(W,j)},redo:()=>{E.groupId&&w(E.groupId,E.normal,E.newValue)}};i(E),w(u.parentId,u.normal,R),c(s+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const M=new Map;for(const E of n)E.type===z.Polygon&&E.foundationId===u.foundationId&&M.set(E.id,E.textureType??Jr.NoTexture);const D={name:"Set Texture for All Polygons Above Foundation",timestamp:Date.now(),oldValues:M,newValue:R,groupId:u.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{D.groupId&&b(D.groupId,D.newValue)}};i(D),b(u.foundationId,R),c(s+1)}break}default:{const M=o(u.id),D=M?M.textureType:u.textureType,E={name:"Set Texture of Selected Polygon",timestamp:Date.now(),oldValue:D,newValue:R,changedElementId:u.id,changedElementType:u.type,undo:()=>{y(E.changedElementId,E.oldValue)},redo:()=>{y(E.changedElementId,E.newValue)}};i(E),y(u.id,R),c(s+1);break}}},x=()=>{t(!1)},S=()=>{A(d)};return h.jsx(so,{width:500,title:Y.t("polygonMenu.FillTexture",p),onApply:S,onClose:x,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:10,children:h.jsxs(_o,{style:{width:"150px"},value:d,onChange:R=>f(R),children:[h.jsxs(g,{value:Jr.NoTexture,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"32px",height:"20px",border:"1px dashed dimGray"},children:" "}),Y.t("shared.NoTexture",p)]},Jr.NoTexture),h.jsxs(g,{value:Jr.Texture01,children:[h.jsx("img",{alt:Jr.Texture01,src:Jnt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture01",p)]},Jr.Texture01),h.jsxs(g,{value:Jr.Texture02,children:[h.jsx("img",{alt:Jr.Texture02,src:Knt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture02",p)]},Jr.Texture02),h.jsxs(g,{value:Jr.Texture03,children:[h.jsx("img",{alt:Jr.Texture03,src:qnt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture03",p)]},Jr.Texture03),h.jsxs(g,{value:Jr.Texture04,children:[h.jsx("img",{alt:Jr.Texture04,src:$nt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture04",p)]},Jr.Texture04),h.jsxs(g,{value:Jr.Texture05,children:[h.jsx("img",{alt:Jr.Texture05,src:Qnt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture05",p)]},Jr.Texture05),h.jsxs(g,{value:Jr.Texture06,children:[h.jsx("img",{alt:Jr.Texture06,src:Znt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture06",p)]},Jr.Texture06),h.jsxs(g,{value:Jr.Texture07,children:[h.jsx("img",{alt:Jr.Texture07,src:eot,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture07",p)]},Jr.Texture07),h.jsxs(g,{value:Jr.Texture08,children:[h.jsx("img",{alt:Jr.Texture08,src:ofo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture08",p)]},Jr.Texture08),h.jsxs(g,{value:Jr.Texture09,children:[h.jsx("img",{alt:Jr.Texture09,src:rfo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture09",p)]},Jr.Texture09),h.jsxs(g,{value:Jr.Texture10,children:[h.jsx("img",{alt:Jr.Texture10,src:ifo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture10",p)]},Jr.Texture10)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:14,children:h.jsx(Ue.Group,{onChange:P,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("polygonMenu.OnlyThisPolygon",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("polygonMenu.AllPolygonsOnSurface",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("polygonMenu.AllPolygonsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("polygonMenu.AllSelectedPolygons",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("polygonMenu.AllPolygons",p)})]})})})]})})},lfo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(FH),r=H(kH),i=H(no),a=H(Zn),l=H(Gn),s=H(fn),c=co(z.Polygon),[u,d]=m.useState((c==null?void 0:c.opacity)!==void 0?c.opacity:1),f=Jt(),p=(v,T)=>{s(A=>{for(const x of A.elements)if(x.id===v){x.opacity=T;break}})},g=v=>{for(const[T,A]of v.entries())p(T,A)},y=(v,T)=>{for(const A of v.keys())p(A,T)},w=v=>{if(c){switch(o){case oe.AllSelectedObjectsOfThisType:for(const T of e)if(T.type===z.Polygon&&v!==T.opacity&&!T.locked&&H.getState().selectedElementIdSet.has(T.id))return!0;break;case oe.AllObjectsOfThisType:for(const T of e)if(T.type===z.Polygon&&v!==T.opacity&&!T.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const T of e)if(T.type===z.Polygon&&T.foundationId===c.foundationId&&v!==T.opacity&&!T.locked)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const T of e)if(T.type===z.Polygon&&T.parentId===c.parentId&&me.isIdentical(T.normal,c.normal)&&v!==T.opacity&&!T.locked)return!0;break;default:if(v!==(c==null?void 0:c.opacity))return!0;break}return!1}},b=v=>{if(c&&w(v))switch(o){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of e)if(x.type===z.Polygon&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)){const S=x;T.set(x.id,S.opacity),p(S.id,v)}const A={name:"Set Opacity for Selected Polygons",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{g(A.oldValues)},redo:()=>{y(A.oldValues,A.newValue)}};n(A),a(i+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of e)if(x.type===z.Polygon&&!x.locked){const S=x;T.set(x.id,S.opacity),p(S.id,v)}const A={name:"Set Opacity for All Polygons",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{g(A.oldValues)},redo:()=>{y(A.oldValues,A.newValue)}};n(A),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(c.foundationId){const T=new Map;for(const x of e)if(x.type===z.Polygon&&x.foundationId===c.foundationId&&!x.locked){const S=x;T.set(x.id,S.opacity),p(S.id,v)}const A={name:"Set Opacity for All Polygons Above Foundation",timestamp:Date.now(),oldValues:T,newValue:v,groupId:c.foundationId,undo:()=>{g(A.oldValues)},redo:()=>{y(A.oldValues,A.newValue)}};n(A),a(i+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{if(c.parentId){const T=new Map;for(const x of e)if(x.type===z.Polygon&&x.parentId===c.parentId&&me.isIdentical(x.normal,c.normal)&&!x.locked){const S=x;T.set(x.id,S.opacity),p(S.id,v)}const A={name:"Set Opacity for All Polygons Above Foundation",timestamp:Date.now(),oldValues:T,newValue:v,groupId:c.foundationId,undo:()=>{g(A.oldValues)},redo:()=>{y(A.oldValues,A.newValue)}};n(A),a(i+1)}break}default:if(c){const T=l(c.id),A=T.opacity!==void 0?T.opacity:c.opacity!==void 0?c.opacity:1,x={name:"Set Polygon Opacity",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:c.id,changedElementType:c.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};n(x),p(c.id,v),a(i+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("polygonMenu.Opacity",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.1,precision:1,value:u,formatter:v=>Number(v).toFixed(1),onChange:v=>d(v)}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>r(v.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("polygonMenu.OnlyThisPolygon",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("polygonMenu.AllPolygonsOnSurface",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("polygonMenu.AllPolygonsAboveFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("polygonMenu.AllSelectedPolygons",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("polygonMenu.AllPolygons",f)})]})})})]})})};class KR{static create(e,n,o,r,i,a,l,s,c,u,d){if(n.type!==z.Foundation&&n.type!==z.Cuboid)throw new Error("base must be a foundation or cuboid");const f=[],p=me.calculatePolygonBounds(e.vertices),g=(r===vr.portrait?o.length:o.width)*a;if(s===Dl.upDown){const y=Math.floor(((p.maxX()-p.minX())*n.lx-g)/l),w=p.minX()+g/(2*n.lx)+d/n.lx,b=l/n.lx,C=.5*Math.abs(Math.cos(i))*g/n.lx,P={x:0,y:-.5},v={x:0,y:.5},T=void 0;for(let A=0;A<=y;A++){const x=w+A*b;P.x=v.x=x-C;const S=me.polygonIntersections(P,v,e.vertices).sort((D,E)=>D.y-E.y);P.x=v.x=x+C;const R=me.polygonIntersections(P,v,e.vertices).sort((D,E)=>D.y-E.y),M=Math.max(S.length,R.length)/2;if(M>0)for(let D=0;DD.x-E.x);P.y=v.y=x+C;const R=me.polygonIntersections(P,v,e.vertices).sort((D,E)=>D.x-E.x),M=Math.max(S.length,R.length)/2;if(M>0)for(let D=0;D0)return Ga.makeSolarPanel(s,c,a*s.lx,(y+w)/2*s.ly,s.cz,vr.portrait,d,f,u,Gt,Io,i,void 0,b*s.ly,l)}static makeLeftRightSegment(e,n,o,r,i,a,l,s,c,u,d,f,p){const g=Math.abs(e.x-n.x)0)return Ga.makeSolarPanel(s,c,(y+w)/2*s.lx,a*s.ly,s.cz,vr.portrait,d,f,u,0,Io,i,void 0,b*s.lx,l)}}class sfo{static create(e,n,o,r,i,a,l,s,c,u,d){if(n.type!==z.Foundation&&n.type!==z.Cuboid)throw new Error("base must be a foundation or cuboid");const f=[],p=!me.isZero(n.rotation[2]),g=[];for(const P of e.vertices)g.push({x:P.x*n.lx+n.cx,y:P.y*n.ly+n.cy});const y=p?me.rotatePolygon(g,n.cx,n.cy,n.rotation[2]):g,w=me.calculatePolygonBounds(y),b=(r===vr.portrait?o.length:o.width)*a,C=.5*Math.abs(Math.cos(i))*b;if(s===Dl.eastWest){const P=w.maxY()-w.minY(),v=Math.floor((P-2*d-b)/l),T=w.minY()+b/2+d,A={x:w.minX(),y:0},x={x:w.maxX(),y:0};for(let S=0;S<=v;S++){const R=T+S*l;A.y=x.y=R-C;const M=me.polygonIntersections(A,x,y).sort((W,j)=>W.x-j.x);A.y=x.y=R+C;const D=me.polygonIntersections(A,x,y).sort((W,j)=>W.x-j.x),E=Math.max(M.length,D.length)/2;if(E>0)for(let W=0;W0){const Q=me.relativeCoordinates((O+B)/2,R,0,n),le=Ga.makeSolarPanel(n,o,Q.x*n.lx,Q.y*n.ly,n.cz,vr.portrait,c,u,i,-n.rotation[2],Io,[0,0,0],void 0,$,b);le.referenceId=e.id,me.changeOrientation(le,o,r),f.push(le)}}}}else if(s===Dl.northSouth){const P=w.maxX()-w.minX(),v=Math.floor((P-2*d-b)/l),T=w.minX()+b/2+d,A={x:0,y:w.minY()},x={x:0,y:w.maxY()};for(let S=0;S<=v;S++){const R=T+S*l;A.x=x.x=R-C;const M=me.polygonIntersections(A,x,y).sort((W,j)=>W.y-j.y);A.x=x.x=R+C;const D=me.polygonIntersections(A,x,y).sort((W,j)=>W.y-j.y),E=Math.max(M.length,D.length)/2;if(E>0)for(let W=0;W0){const Q=me.relativeCoordinates(R,(_+X)/2,0,n),le=Ga.makeSolarPanel(n,o,Q.x*n.lx,Q.y*n.ly,n.cz,vr.portrait,c,u,i,-n.rotation[2]+Gt,Io,[0,0,0],void 0,$,b);le.referenceId=e.id,me.changeOrientation(le,o,r),f.push(le)}}}}return f}}const{Option:Q7}=_o,cfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H.getState().solarPanelArrayLayoutParams,r=H(Cb),i=H(qr),a=H(fW),l=H(t5),s=H(kwt),c=H(l7t),u=H(Wge),d=H(a7t),f=H(En),p=H(no),g=H(Zn),y=H(Vi),[w,b]=m.useState(!1),[C,P]=m.useState(!1),[v,T]=m.useState(!1),[A,x]=m.useState({left:0,top:0,bottom:0,right:0}),S=m.useRef(null),R=m.useRef(!0),M=m.useRef(null),D=m.useRef(null),E=m.useRef(!1),W=m.useRef(H(y4t)),j=m.useRef(H(A4t)),L=m.useRef(H(P4t)),k=m.useRef(H(T4t)),N=m.useRef(H(w4t)),F=m.useRef(H(v4t)),U=m.useRef(H(x4t)??0),O=m.useRef(H(b4t)),B=m.useRef(H(S4t)),_=Jt(),X=l(W.current),$=r();m.useEffect(()=>{var he;(he=M.current)==null||he.focus()},[]),m.useEffect(()=>{var he;C&&((he=D.current)==null||he.focus())},[C]);const Q=(he,xe)=>{if(S.current){const{clientWidth:He,clientHeight:Se}=window.document.documentElement,ze=S.current.getBoundingClientRect();x({left:-ze.left+xe.x,right:He-(ze.right-xe.x),top:-ze.top+xe.y,bottom:Se-((ze==null?void 0:ze.bottom)-xe.y)})}},le=()=>{const he=(L.current===vr.portrait?X.length:X.width)*N.current;return .5*(he*Math.abs(Math.sin(k.current)))>O.current?(po(Y.t("message.SolarPanelsCannotIntersectWithGround",_)),!1):he>F.current?(po(Y.t("message.SolarPanelsCannotOverlapWithOneAnother",_)),!1):!0},q=he=>{const xe=n.filter(He=>He.type===z.SolarPanel&&He.parentId===he.parentId);if(xe.length>0)for(const He of xe)He.referenceId!==he.id&&me.isPointInside(He.cx,He.cy,he.vertices)&&s(He.id,he.id)},te=()=>{if(($==null?void 0:$.type)===z.Polygon){const he=i($);if(he){const xe=[],Se=j.current===Dl.eastWest||j.current===Dl.northSouth?sfo.create($,he,X,L.current,k.current,N.current,F.current,j.current,O.current,B.current,U.current):KR.create($,he,X,L.current,k.current,N.current,F.current,j.current,O.current,B.current,U.current);if(Se.length>0){for(const Ie of Se)xe.push(JSON.parse(JSON.stringify(Ie))),e(ye=>{ye.elements.push(Ie)});const ze={name:"Solar Panel Array Layout",timestamp:Date.now(),oldElements:H.getState().deletedElements,newElements:xe,oldParams:{pvModelName:o.pvModelName,rowAxis:o.rowAxis,orientation:o.orientation,tiltAngle:o.tiltAngle,rowsPerRack:o.rowsPerRack,interRowSpacing:o.interRowSpacing,poleHeight:o.poleHeight,poleSpacing:o.poleSpacing,margin:o.margin},newParams:{pvModelName:W.current,rowAxis:j.current,orientation:L.current,tiltAngle:k.current,rowsPerRack:N.current,interRowSpacing:F.current,poleHeight:O.current,poleSpacing:B.current,margin:U.current},referenceId:$.id,undo:()=>{u(ze.referenceId,!1),ze.oldElements.length>0&&e(Ie=>{for(const ye of ze.oldElements)Ie.elements.push(ye)}),re(ze.oldParams),ae()},redo:()=>{u(ze.referenceId,!1),ze.newElements.length>0&&e(Ie=>{for(const ye of ze.newElements)Ie.elements.push(ye)}),re(ze.newParams),ae()}};f(ze),g(p+1)}}R.current=!1,ae()}},re=he=>{W.current=he.pvModelName,j.current=he.rowAxis,L.current=he.orientation,k.current=he.tiltAngle,N.current=he.rowsPerRack,F.current=he.interRowSpacing,O.current=he.poleHeight,B.current=he.poleSpacing,U.current=he.margin??0},ae=()=>{e(he=>{he.solarPanelArrayLayoutParams.pvModelName=W.current,he.solarPanelArrayLayoutParams.rowAxis=j.current,he.solarPanelArrayLayoutParams.orientation=L.current,he.solarPanelArrayLayoutParams.tiltAngle=k.current,he.solarPanelArrayLayoutParams.rowsPerRack=N.current,he.solarPanelArrayLayoutParams.interRowSpacing=F.current,he.solarPanelArrayLayoutParams.poleHeight=O.current,he.solarPanelArrayLayoutParams.poleSpacing=B.current,he.solarPanelArrayLayoutParams.margin=U.current})},se=()=>{R.current&&(le()?$&&(q($),c($.id)>0?P(!0):(d(),te())):po(Y.t("polygonMenu.LayoutNotAcceptedCheckYourParameters",_)))},ne=()=>{se(),E.current=!1},fe=()=>{t(!1),y(),R.current=!0,E.current=!1},ge=()=>{R.current?(se(),E.current=!0):t(!1)},de=()=>{P(!1)},Z=()=>{$&&(u($.id,!0),te(),E.current&&(t(!1),g(0))),P(!1)};return h.jsxs(h.Fragment,{children:[C&&h.jsx(Oi,{width:400,open:C,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>T(!0),onMouseOut:()=>T(!1),children:Y.t("word.Reminder",_)}),footer:[h.jsx(lo,{onClick:de,children:Y.t("word.Cancel",_)},"Cancel"),h.jsx(lo,{type:"primary",ref:D,onClick:Z,children:Y.t("word.OK",_)},"OK")],children:Y.t("message.ExistingSolarPanelsWillBeRemovedBeforeApplyingNewLayout",_)+" "+Y.t("message.DoYouWantToContinue",_)}),h.jsxs(Oi,{width:640,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>T(!0),onMouseOut:()=>T(!1),children:Y.t("polygonMenu.SolarPanelArrayLayoutParametricDesign",_)}),footer:[h.jsx(lo,{disabled:!R.current,onClick:ne,children:Y.t("word.Apply",_)},"Apply"),h.jsx(lo,{onClick:fe,children:Y.t("word.Cancel",_)},"Cancel"),h.jsx(lo,{type:"primary",ref:M,onClick:ge,children:Y.t("word.OK",_)},"OK")],onCancel:()=>{t(!1),R.current=!0},maskClosable:!1,destroyOnClose:!1,modalRender:he=>h.jsx(_i,{disabled:!v,bounds:A,onStart:(xe,He)=>Q(xe,He),children:h.jsx("div",{ref:S,children:he})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayModel",_)+" ("+Object.keys(a).length+" "+Y.t("word.Options",_)+"):"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(_o,{defaultValue:"Custom",style:{width:"100%"},value:W.current,onChange:he=>{he!==null&&(W.current=he,R.current=!0,b(!w))},children:Object.keys(a).map(he=>h.jsx(Q7,{value:he,children:he+(a[he].bifacialityFactor>0?" ("+Y.t("pvModelPanel.Bifacial",_)+")":"")},he))})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayRowAxis",_)+":"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsxs(_o,{style:{width:"100%"},value:j.current,onChange:he=>{he!==null&&(j.current=he,R.current=!0,b(!w))},children:[h.jsx(Q7,{value:Dl.leftRight,children:Y.t("polygonMenu.SolarPanelArrayLeftRightRowAxis",_)},Dl.leftRight),h.jsx(Q7,{value:Dl.upDown,children:Y.t("polygonMenu.SolarPanelArrayUpDownRowAxis",_)},Dl.upDown),h.jsx(Q7,{value:Dl.eastWest,children:Y.t("polygonMenu.SolarPanelArrayEastWestRowAxis",_)},Dl.eastWest),h.jsx(Q7,{value:Dl.northSouth,children:Y.t("polygonMenu.SolarPanelArrayNorthSouthRowAxis",_)},Dl.northSouth)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayOrientation",_)+":"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsxs(_o,{style:{width:"100%"},value:L.current,onChange:he=>{he!==null&&(L.current=he,R.current=!0,b(!w))},children:[h.jsx(Q7,{value:vr.portrait,children:Y.t("solarPanelMenu.Portrait",_)},vr.portrait),h.jsx(Q7,{value:vr.landscape,children:Y.t("solarPanelMenu.Landscape",_)},vr.landscape)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayTiltAngle",_)+" ([-90°, 90°]): "}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{min:-90,max:90,style:{width:"100%"},precision:2,value:parseFloat(me.toDegrees(k.current).toFixed(2)),step:1,formatter:he=>`${he}°`,onChange:he=>{he!==null&&(k.current=me.toRadians(he),R.current=!0,b(!w))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayRowWidth",_)+" ([1-100] "+Y.t("solarPanelMenu.Panels",_)+"): "}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{min:1,max:100,step:1,style:{width:"100%"},precision:0,formatter:he=>Number(he).toFixed(0),value:N.current,onChange:he=>{he!==null&&(N.current=he,R.current=!0,b(!w))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayInterRowSpacing",_)+" ([1, 20] "+Y.t("word.MeterAbbreviation",_)+"): "}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{min:1,max:20,style:{width:"100%"},precision:2,value:F.current,step:.5,onChange:he=>{he!==null&&(F.current=he,R.current=!0,b(!w))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayMargin",_)+" ([0, 5] "+Y.t("word.MeterAbbreviation",_)+"): "}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{min:0,max:5,style:{width:"100%"},precision:1,value:U.current,step:.1,onChange:he=>{he!==null&&(U.current=he,R.current=!0,b(!w))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayPoleHeight",_)+" ([0, 10] "+Y.t("word.MeterAbbreviation",_)+"): "}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{min:0,max:10,style:{width:"100%"},precision:2,value:O.current,step:.1,onChange:he=>{he!==null&&(O.current=he,R.current=!0,b(!w))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayPoleSpacing",_)+" ([2, 50] "+Y.t("word.MeterAbbreviation",_)+"): "}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{min:2,max:50,style:{width:"100%"},precision:2,value:B.current,step:.5,onChange:he=>{he!==null&&(B.current=he,R.current=!0,b(!w))}})})]})]})]})},{Option:Bh}=_o,{TabPane:Nae}=KW,ufo=({setDialogVisible:t})=>{const e=H(fn),n=H(ma),o=H(s0),r=ht(n5),i=H(fW),a=H(s3),l=H(qr),s=H(l3),c=H(wA).geneticAlgorithmParams,u=H(i$),d=H(fxt),f=H(n$),[p,g]=m.useState(!1),[y,w]=m.useState(!1),[b,C]=m.useState({left:0,top:0,bottom:0,right:0}),P=m.useRef(null),v=m.useRef(c.objectiveFunctionType),T=m.useRef(c.selectionMethod),A=m.useRef(c.searchMethod),x=m.useRef(c.populationSize),S=m.useRef(c.maximumGenerations),R=m.useRef(c.mutationRate),M=m.useRef(c.selectionRate??.5),D=m.useRef(c.crossoverRate??.5),E=m.useRef(c.convergenceThreshold),W=m.useRef(c.localSearchRadius),j=m.useRef(u.minimumTiltAngle??-Gt),L=m.useRef(u.maximumTiltAngle??Gt),k=m.useRef(u.minimumRowsPerRack),N=m.useRef(u.maximumRowsPerRack),F=m.useRef(u.minimumInterRowSpacing),U=m.useRef(u.maximumInterRowSpacing),O=m.useRef(null);m.useEffect(()=>{var Z;(Z=O.current)==null||Z.focus()},[]);const B={lng:o},_=m.useRef(u.rowAxis??Dl.leftRight),X=a?l(a):void 0,$=X?s(z.SolarPanel,X.id):void 0,Q=m.useRef($&&$.length>0?$[0].pvModelName:u.pvModelName??"CS6X-355P-FG"),le=m.useRef($&&$.length>0?$[0].orientation:u.orientation??vr.landscape),q=m.useRef($&&$.length>0?$[0].poleHeight:u.poleHeight??1),te=m.useRef($&&$.length>0?$[0].poleSpacing:u.poleSpacing??3),re=m.useRef(u.margin??0),ae=m.useRef(f.electricitySellingPrice),se=m.useRef(f.operationalCostPerUnit);m.useEffect(()=>{ae.current=f.electricitySellingPrice},[f.electricitySellingPrice]),m.useEffect(()=>{se.current=f.operationalCostPerUnit},[f.operationalCostPerUnit]);const ne=(Z,he)=>{if(P.current){const{clientWidth:xe,clientHeight:He}=window.document.documentElement,Se=P.current.getBoundingClientRect();C({left:-Se.left+he.x,right:xe-(Se.right-he.x),top:-Se.top+he.y,bottom:He-((Se==null?void 0:Se.bottom)-he.y)})}},fe=()=>{e(Z=>{Z.evolutionaryAlgorithmState.geneticAlgorithmParams.problem=Pi.SOLAR_PANEL_ARRAY,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.objectiveFunctionType=v.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.selectionMethod=T.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.searchMethod=A.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.populationSize=x.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.maximumGenerations=S.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.selectionRate=M.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.crossoverRate=D.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.mutationRate=R.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.convergenceThreshold=E.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.localSearchRadius=W.current,Z.solarPanelArrayLayoutConstraints||(Z.solarPanelArrayLayoutConstraints=new uX),Z.solarPanelArrayLayoutConstraints.minimumRowsPerRack=k.current,Z.solarPanelArrayLayoutConstraints.maximumRowsPerRack=N.current,Z.solarPanelArrayLayoutConstraints.minimumTiltAngle=j.current,Z.solarPanelArrayLayoutConstraints.maximumTiltAngle=L.current,Z.solarPanelArrayLayoutConstraints.minimumInterRowSpacing=F.current,Z.solarPanelArrayLayoutConstraints.maximumInterRowSpacing=U.current,Z.solarPanelArrayLayoutConstraints.poleHeight=q.current,Z.solarPanelArrayLayoutConstraints.poleSpacing=te.current,Z.solarPanelArrayLayoutConstraints.pvModelName=Q.current,Z.solarPanelArrayLayoutConstraints.rowAxis=_.current,Z.solarPanelArrayLayoutConstraints.orientation=le.current,Z.solarPanelArrayLayoutConstraints.margin=re.current,Z.economicsParams.operationalCostPerUnit=se.current,Z.economicsParams.electricitySellingPrice=ae.current})},ge=()=>{r||hn(de("message.EvolutionStarted",B)),fe(),setTimeout(()=>{ht.getState().set(Z=>{Z.runEvolution=!Z.runEvolution}),e(Z=>{Z.evolutionMethod=Vs.GENETIC_ALGORITHM,n&&(Z.actionInfo={name:"Run Genetic Algorithm for Solar Panel Array Layout",timestamp:new Date().getTime(),details:{...H.getState().evolutionaryAlgorithmState.geneticAlgorithmParams,...H.getState().solarPanelArrayLayoutConstraints,...H.getState().economicsParams}})})},100)},{t:de}=Vl();return h.jsx(h.Fragment,{children:h.jsx(Oi,{width:640,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>w(!0),onMouseOut:()=>w(!1),children:de("optimizationMenu.SolarPanelArrayLayout",B)+": "+de("optimizationMenu.GeneticAlgorithmSettings",B)}),footer:[h.jsx(lo,{onClick:()=>{t(!1)},children:de("word.Cancel",B)},"Cancel"),h.jsx(lo,{type:"primary",ref:O,onClick:()=>{ge(),t(!1)},children:de("word.Run",B)},"Run")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:Z=>h.jsx(_i,{disabled:!y,bounds:b,onStart:(he,xe)=>ne(he,xe),children:h.jsx("div",{ref:P,children:Z})}),children:h.jsxs(KW,{defaultActiveKey:d,type:"card",onChange:Z=>{e(he=>{he.geneticAlgorithmWizardSelectedTab=Z})},children:[h.jsxs(Nae,{tab:de("optimizationMenu.Parameters",B),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.Objective",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:v.current,style:{width:"100%"},value:v.current,onChange:Z=>{v.current=Z,g(!p)},children:[h.jsx(Bh,{value:To.DAILY_TOTAL_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionDailyTotalYield",B)},To.DAILY_TOTAL_OUTPUT),h.jsx(Bh,{value:To.YEARLY_TOTAL_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionYearlyTotalYield",B)},To.YEARLY_TOTAL_OUTPUT),h.jsx(Bh,{value:To.DAILY_AVERAGE_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionDailyMeanYield",B)},To.DAILY_AVERAGE_OUTPUT),h.jsx(Bh,{value:To.YEARLY_AVERAGE_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionYearlyMeanYield",B)},To.YEARLY_AVERAGE_OUTPUT),h.jsx(Bh,{value:To.DAILY_PROFIT,children:de("optimizationMenu.ObjectiveFunctionDailyProfit",B)},To.DAILY_PROFIT),h.jsx(Bh,{value:To.YEARLY_PROFIT,children:de("optimizationMenu.ObjectiveFunctionYearlyProfit",B)},To.YEARLY_PROFIT)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.GeneticAlgorithmSelectionMethod",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:T.current,style:{width:"100%"},value:T.current,onChange:Z=>{T.current=Z,g(!p)},children:[h.jsx(Bh,{value:Wm.ROULETTE_WHEEL,children:de("optimizationMenu.RouletteWheel",B)},Wm.ROULETTE_WHEEL),h.jsx(Bh,{value:Wm.TOURNAMENT,children:de("optimizationMenu.Tournament",B)},Wm.TOURNAMENT)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.PopulationSize",B)+" [10, 100]:"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:10,max:100,style:{width:"100%"},precision:0,value:x.current,step:1,formatter:Z=>Number(Z).toFixed(0),onChange:Z=>{Z!==null&&(x.current=Number(Z),g(!p))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.MaximumGenerations",B)+" [5, 100]:"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:5,max:100,step:1,style:{width:"100%"},precision:0,value:S.current,formatter:Z=>Number(Z).toFixed(0),onChange:Z=>{Z!==null&&(S.current=Number(Z),g(!p))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.SelectionRate",B)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:M.current,step:.01,onChange:Z=>{Z!==null&&(M.current=Number(Z),g(!p))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.CrossoverRate",B)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:D.current,step:.01,onChange:Z=>{Z!==null&&(D.current=Number(Z),g(!p))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.MutationRate",B)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:R.current,step:.01,onChange:Z=>{Z!==null&&(R.current=Number(Z),g(!p))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.ConvergenceThreshold",B)+" (0, 0.1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:.001,max:.1,style:{width:"100%"},precision:3,value:E.current,step:.001,onChange:Z=>{Z!==null&&(E.current=Number(Z),g(!p))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.SearchMethod",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:A.current,style:{width:"100%"},value:A.current,onChange:Z=>{A.current=Number(Z),g(!p)},children:[h.jsx(Bh,{value:us.GLOBAL_SEARCH_UNIFORM_SELECTION,children:de("optimizationMenu.GlobalSearchUniformSelection",B)},us.GLOBAL_SEARCH_UNIFORM_SELECTION),h.jsx(Bh,{value:us.LOCAL_SEARCH_RANDOM_OPTIMIZATION,children:de("optimizationMenu.LocalSearchRandomOptimization",B)},us.LOCAL_SEARCH_RANDOM_OPTIMIZATION)]})})]}),A.current===us.LOCAL_SEARCH_RANDOM_OPTIMIZATION&&h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.LocalSearchRadius",B)+" ([0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:W.current,step:.01,onChange:Z=>{Z!==null&&(W.current=Number(Z),g(!p))}})})]})]},"1"),h.jsxs(Nae,{tab:de("optimizationMenu.Variables",B),children:[h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.TiltAngleRange",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{range:!0,onChange:Z=>{j.current=me.toRadians(Z[0]),L.current=me.toRadians(Z[1]),g(!p)},min:-90,max:90,defaultValue:[me.toDegrees(j.current),me.toDegrees(L.current)],marks:{"-90":{style:{fontSize:"10px"},label:"-90°"},"-45":{style:{fontSize:"10px"},label:"-45°"},0:{style:{fontSize:"10px"},label:"0°"},45:{style:{fontSize:"10px"},label:"45°"},90:{style:{fontSize:"10px"},label:"90°"}}})})]}),h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.RowsPerRackRange",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{range:!0,onChange:Z=>{k.current=Z[0],N.current=Z[1],g(!p)},min:1,max:9,defaultValue:[k.current,N.current],marks:{1:{style:{fontSize:"10px"},label:1},2:{style:{fontSize:"10px"},label:2},3:{style:{fontSize:"10px"},label:3},4:{style:{fontSize:"10px"},label:4},5:{style:{fontSize:"10px"},label:5},6:{style:{fontSize:"10px"},label:6},7:{style:{fontSize:"10px"},label:7},8:{style:{fontSize:"10px"},label:8},9:{style:{fontSize:"10px"},label:9}}})})]}),h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.InterRowSpacingRange",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{range:!0,onChange:Z=>{F.current=Z[0],U.current=Z[1],g(!p)},min:1,max:10,defaultValue:[F.current,U.current],marks:{1:{style:{fontSize:"10px"},label:"1m"},3:{style:{fontSize:"10px"},label:"3m"},5:{style:{fontSize:"10px"},label:"5m"},7:{style:{fontSize:"10px"},label:"7m"},9:{style:{fontSize:"10px"},label:"9m"}}})})]})]},"2"),h.jsxs(Nae,{tab:de("optimizationMenu.Constants",B),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"6px",paddingTop:"0px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayModel",B)+" ("+Object.keys(i).length+" "+de("word.Options",B)+"):"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(_o,{defaultValue:"Custom",style:{width:"100%"},value:Q.current,onChange:Z=>{Q.current=Z,g(!p)},children:Object.keys(i).map(Z=>h.jsx(Bh,{value:Z,children:Z+(i[Z].bifacialityFactor>0?" ("+de("pvModelPanel.Bifacial",B)+")":"")},Z))})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"6px",paddingTop:"8px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayRowAxis",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{style:{width:"100%"},value:_.current,onChange:Z=>{_.current=Z,g(!p)},children:[h.jsx(Bh,{value:Dl.leftRight,children:de("polygonMenu.SolarPanelArrayLeftRightRowAxis",B)},Dl.leftRight),h.jsx(Bh,{value:Dl.upDown,children:de("polygonMenu.SolarPanelArrayUpDownRowAxis",B)},Dl.upDown)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"6px",paddingTop:"8px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayOrientation",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{style:{width:"100%"},value:le.current,onChange:Z=>{le.current=Z,g(!p)},children:[h.jsx(Bh,{value:vr.portrait,children:de("solarPanelMenu.Portrait",B)},vr.portrait),h.jsx(Bh,{value:vr.landscape,children:de("solarPanelMenu.Landscape",B)},vr.landscape)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayMargin",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{re.current=Z,g(!p)},min:0,max:5,step:.1,defaultValue:re.current,marks:{0:{style:{fontSize:"10px"},label:"0m"},1:{style:{fontSize:"10px"},label:"1m"},2:{style:{fontSize:"10px"},label:"2m"},3:{style:{fontSize:"10px"},label:"3m"},4:{style:{fontSize:"10px"},label:"4m"},5:{style:{fontSize:"10px"},label:"5m"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("solarCollectorMenu.PoleHeight",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{q.current=Z,g(!p)},min:0,max:10,step:.1,defaultValue:q.current,marks:{0:{style:{fontSize:"10px"},label:"0m"},2:{style:{fontSize:"10px"},label:"2m"},4:{style:{fontSize:"10px"},label:"4m"},6:{style:{fontSize:"10px"},label:"6m"},8:{style:{fontSize:"10px"},label:"8m"},10:{style:{fontSize:"10px"},label:"10m"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("solarPanelMenu.PoleSpacing",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{te.current=Z,g(!p)},min:2,max:10,step:.1,defaultValue:te.current,marks:{2:{style:{fontSize:"10px"},label:"2m"},4:{style:{fontSize:"10px"},label:"4m"},6:{style:{fontSize:"10px"},label:"6m"},8:{style:{fontSize:"10px"},label:"8m"},10:{style:{fontSize:"10px"},label:"10m"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("economicsPanel.OperationalCostPerUnit",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{se.current=Z,g(!p)},min:.1,max:1,step:.01,defaultValue:se.current,marks:{.1:{style:{fontSize:"10px"},label:"10¢"},.3:{style:{fontSize:"10px"},label:"30¢"},.5:{style:{fontSize:"10px"},label:"50¢"},.7:{style:{fontSize:"10px"},label:"70¢"},.9:{style:{fontSize:"10px"},label:"90¢"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("economicsPanel.ElectricitySellingPrice",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{ae.current=Z,g(!p)},min:.1,max:1,step:.01,defaultValue:ae.current,marks:{.1:{style:{fontSize:"10px"},label:"10¢"},.3:{style:{fontSize:"10px"},label:"30¢"},.5:{style:{fontSize:"10px"},label:"50¢"},.7:{style:{fontSize:"10px"},label:"70¢"},.9:{style:{fontSize:"10px"},label:"90¢"}}})})]})]},"3")]})})})},{Option:V1}=_o,{TabPane:Uae}=KW,dfo=({setDialogVisible:t})=>{const e=H(fn),n=H(ma),o=H(s0),r=ht(n5),i=H(fW),a=H(s3),l=H(qr),s=H(l3),c=H(wA).particleSwarmOptimizationParams,u=H(i$),d=H(hxt),f=H(n$),[p,g]=m.useState(!1),[y,w]=m.useState(!1),[b,C]=m.useState({left:0,top:0,bottom:0,right:0}),P=m.useRef(null),v=m.useRef(c.objectiveFunctionType),T=m.useRef(c.searchMethod),A=m.useRef(c.swarmSize),x=m.useRef(c.maximumSteps),S=m.useRef(c.vmax??.01),R=m.useRef(c.inertia??.8),M=m.useRef(c.cognitiveCoefficient??.1),D=m.useRef(c.socialCoefficient??.1),E=m.useRef(c.convergenceThreshold),W=m.useRef(c.localSearchRadius),j=m.useRef(u.minimumTiltAngle??-Gt),L=m.useRef(u.maximumTiltAngle??Gt),k=m.useRef(u.minimumRowsPerRack),N=m.useRef(u.maximumRowsPerRack),F=m.useRef(u.minimumInterRowSpacing),U=m.useRef(u.maximumInterRowSpacing),O=m.useRef(null);m.useEffect(()=>{var Z;(Z=O.current)==null||Z.focus()},[]);const B={lng:o},_=m.useRef(u.rowAxis??Dl.leftRight),X=a?l(a):void 0,$=X?s(z.SolarPanel,X.id):void 0,Q=m.useRef($&&$.length>0?$[0].pvModelName:u.pvModelName??"CS6X-355P-FG"),le=m.useRef($&&$.length>0?$[0].orientation:u.orientation??vr.landscape),q=m.useRef($&&$.length>0?$[0].poleHeight:u.poleHeight??1),te=m.useRef($&&$.length>0?$[0].poleSpacing:u.poleSpacing??3),re=m.useRef(u.margin??0),ae=m.useRef(f.electricitySellingPrice),se=m.useRef(f.operationalCostPerUnit);m.useEffect(()=>{ae.current=f.electricitySellingPrice},[f.electricitySellingPrice]),m.useEffect(()=>{se.current=f.operationalCostPerUnit},[f.operationalCostPerUnit]);const ne=(Z,he)=>{if(P.current){const{clientWidth:xe,clientHeight:He}=window.document.documentElement,Se=P.current.getBoundingClientRect();C({left:-Se.left+he.x,right:xe-(Se.right-he.x),top:-Se.top+he.y,bottom:He-((Se==null?void 0:Se.bottom)-he.y)})}},fe=()=>{e(Z=>{Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.problem=Pi.SOLAR_PANEL_ARRAY,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.objectiveFunctionType=v.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.searchMethod=T.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.swarmSize=A.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.maximumSteps=x.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.cognitiveCoefficient=M.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.socialCoefficient=D.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.vmax=S.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.inertia=R.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.convergenceThreshold=E.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.localSearchRadius=W.current,Z.solarPanelArrayLayoutConstraints||(Z.solarPanelArrayLayoutConstraints=new uX),Z.solarPanelArrayLayoutConstraints.minimumRowsPerRack=k.current,Z.solarPanelArrayLayoutConstraints.maximumRowsPerRack=N.current,Z.solarPanelArrayLayoutConstraints.minimumTiltAngle=j.current,Z.solarPanelArrayLayoutConstraints.maximumTiltAngle=L.current,Z.solarPanelArrayLayoutConstraints.minimumInterRowSpacing=F.current,Z.solarPanelArrayLayoutConstraints.maximumInterRowSpacing=U.current,Z.solarPanelArrayLayoutConstraints.poleHeight=q.current,Z.solarPanelArrayLayoutConstraints.poleSpacing=te.current,Z.solarPanelArrayLayoutConstraints.pvModelName=Q.current,Z.solarPanelArrayLayoutConstraints.rowAxis=_.current,Z.solarPanelArrayLayoutConstraints.orientation=le.current,Z.solarPanelArrayLayoutConstraints.margin=re.current,Z.economicsParams.operationalCostPerUnit=se.current,Z.economicsParams.electricitySellingPrice=ae.current})},ge=()=>{r||hn(de("message.EvolutionStarted",B)),fe(),setTimeout(()=>{ht.getState().set(Z=>{Z.runEvolution=!Z.runEvolution}),e(Z=>{Z.evolutionMethod=Vs.PARTICLE_SWARM_OPTIMIZATION,n&&(Z.actionInfo={name:"Run Particle Swarm Optimization for Solar Panel Array Layout",timestamp:new Date().getTime(),details:{...H.getState().evolutionaryAlgorithmState.particleSwarmOptimizationParams,...H.getState().solarPanelArrayLayoutConstraints,...H.getState().economicsParams}})})},100)},{t:de}=Vl();return h.jsx(h.Fragment,{children:h.jsx(Oi,{width:640,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>w(!0),onMouseOut:()=>w(!1),children:de("optimizationMenu.SolarPanelArrayLayout",B)+": "+de("optimizationMenu.ParticleSwarmOptimizationSettings",B)}),footer:[h.jsx(lo,{onClick:()=>{t(!1)},children:de("word.Cancel",B)},"Cancel"),h.jsx(lo,{type:"primary",ref:O,onClick:()=>{ge(),t(!1)},children:de("word.Run",B)},"Run")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:Z=>h.jsx(_i,{disabled:!y,bounds:b,onStart:(he,xe)=>ne(he,xe),children:h.jsx("div",{ref:P,children:Z})}),children:h.jsxs(KW,{defaultActiveKey:d,type:"card",onChange:Z=>{e(he=>{he.particleSwarmOptimizationWizardSelectedTab=Z})},children:[h.jsxs(Uae,{tab:de("optimizationMenu.Parameters",B),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.Objective",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:v.current,style:{width:"100%"},value:v.current,onChange:Z=>{v.current=Z,g(!p)},children:[h.jsx(V1,{value:To.DAILY_TOTAL_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionDailyTotalYield",B)},To.DAILY_TOTAL_OUTPUT),h.jsx(V1,{value:To.YEARLY_TOTAL_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionYearlyTotalYield",B)},To.YEARLY_TOTAL_OUTPUT),h.jsx(V1,{value:To.DAILY_AVERAGE_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionDailyMeanYield",B)},To.DAILY_AVERAGE_OUTPUT),h.jsx(V1,{value:To.YEARLY_AVERAGE_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionYearlyMeanYield",B)},To.YEARLY_AVERAGE_OUTPUT),h.jsx(V1,{value:To.DAILY_PROFIT,children:de("optimizationMenu.ObjectiveFunctionDailyProfit",B)},To.DAILY_PROFIT),h.jsx(V1,{value:To.YEARLY_PROFIT,children:de("optimizationMenu.ObjectiveFunctionYearlyProfit",B)},To.YEARLY_PROFIT)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.SwarmSize",B)+" [10, 100]:"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:10,max:100,style:{width:"100%"},precision:0,value:A.current,step:1,formatter:Z=>Number(Z).toFixed(0),onChange:Z=>{A.current=Number(Z),g(!p)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.MaximumSteps",B)+" [5, 100]:"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:5,max:100,step:1,style:{width:"100%"},precision:0,value:x.current,formatter:Z=>Number(Z).toFixed(0),onChange:Z=>{x.current=Number(Z),g(!p)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.CognitiveCoefficient",B)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:M.current,step:.01,onChange:Z=>{M.current=Number(Z),g(!p)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.SocialCoefficient",B)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:D.current,step:.01,onChange:Z=>{D.current=Number(Z),g(!p)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.InertiaWeight",B)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:R.current,step:.01,onChange:Z=>{R.current=Number(Z),g(!p)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.MaximumVelocity",B)+" [0.001, 0.1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:.001,max:.1,style:{width:"100%"},precision:3,value:S.current,step:.001,onChange:Z=>{S.current=Number(Z),g(!p)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.ConvergenceThreshold",B)+" (0, 0.1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:.001,max:.1,style:{width:"100%"},precision:3,value:E.current,step:.001,onChange:Z=>{E.current=Number(Z),g(!p)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.SearchMethod",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:T.current,style:{width:"100%"},value:T.current,onChange:Z=>{T.current=Number(Z),g(!p)},children:[h.jsx(V1,{value:us.GLOBAL_SEARCH_UNIFORM_SELECTION,children:de("optimizationMenu.GlobalSearchUniformSelection",B)},us.GLOBAL_SEARCH_UNIFORM_SELECTION),h.jsx(V1,{value:us.LOCAL_SEARCH_RANDOM_OPTIMIZATION,children:de("optimizationMenu.LocalSearchRandomOptimization",B)},us.LOCAL_SEARCH_RANDOM_OPTIMIZATION)]})})]}),T.current===us.LOCAL_SEARCH_RANDOM_OPTIMIZATION&&h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.LocalSearchRadius",B)+" ([0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:W.current,step:.01,onChange:Z=>{W.current=Number(Z),g(!p)}})})]})]},"1"),h.jsxs(Uae,{tab:de("optimizationMenu.Variables",B),children:[h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.TiltAngleRange",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{range:!0,onChange:Z=>{j.current=me.toRadians(Z[0]),L.current=me.toRadians(Z[1]),g(!p)},min:-90,max:90,defaultValue:[me.toDegrees(j.current),me.toDegrees(L.current)],marks:{"-90":{style:{fontSize:"10px"},label:"-90°"},"-45":{style:{fontSize:"10px"},label:"-45°"},0:{style:{fontSize:"10px"},label:"0°"},45:{style:{fontSize:"10px"},label:"45°"},90:{style:{fontSize:"10px"},label:"90°"}}})})]}),h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.RowsPerRackRange",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{range:!0,onChange:Z=>{k.current=Z[0],N.current=Z[1],g(!p)},min:1,max:9,defaultValue:[k.current,N.current],marks:{1:{style:{fontSize:"10px"},label:1},2:{style:{fontSize:"10px"},label:2},3:{style:{fontSize:"10px"},label:3},4:{style:{fontSize:"10px"},label:4},5:{style:{fontSize:"10px"},label:5},6:{style:{fontSize:"10px"},label:6},7:{style:{fontSize:"10px"},label:7},8:{style:{fontSize:"10px"},label:8},9:{style:{fontSize:"10px"},label:9}}})})]}),h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.InterRowSpacingRange",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{range:!0,onChange:Z=>{F.current=Z[0],U.current=Z[1],g(!p)},min:2,max:10,defaultValue:[F.current,U.current],marks:{2:{style:{fontSize:"10px"},label:"2m"},4:{style:{fontSize:"10px"},label:"4m"},6:{style:{fontSize:"10px"},label:"6m"},8:{style:{fontSize:"10px"},label:"8m"},10:{style:{fontSize:"10px"},label:"10m"}}})})]})]},"2"),h.jsxs(Uae,{tab:de("optimizationMenu.Constants",B),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"6px",paddingTop:"0px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayModel",B)+" ("+Object.keys(i).length+" "+de("word.Options",B)+"):"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(_o,{defaultValue:"Custom",style:{width:"100%"},value:Q.current,onChange:Z=>{Q.current=Z,g(!p)},children:Object.keys(i).map(Z=>h.jsx(V1,{value:Z,children:Z+(i[Z].bifacialityFactor>0?" ("+de("pvModelPanel.Bifacial",B)+")":"")},Z))})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"6px",paddingTop:"8px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayRowAxis",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{style:{width:"100%"},value:_.current,onChange:Z=>{_.current=Z,g(!p)},children:[h.jsx(V1,{value:Dl.leftRight,children:de("polygonMenu.SolarPanelArrayLeftRightRowAxis",B)},Dl.leftRight),h.jsx(V1,{value:Dl.upDown,children:de("polygonMenu.SolarPanelArrayUpDownRowAxis",B)},Dl.upDown)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"6px",paddingTop:"8px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayOrientation",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{style:{width:"100%"},value:le.current,onChange:Z=>{le.current=Z,g(!p)},children:[h.jsx(V1,{value:vr.portrait,children:de("solarPanelMenu.Portrait",B)},vr.portrait),h.jsx(V1,{value:vr.landscape,children:de("solarPanelMenu.Landscape",B)},vr.landscape)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayMargin",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{re.current=Z,g(!p)},min:0,max:5,step:.1,defaultValue:re.current,marks:{0:{style:{fontSize:"10px"},label:"0m"},1:{style:{fontSize:"10px"},label:"1m"},2:{style:{fontSize:"10px"},label:"2m"},3:{style:{fontSize:"10px"},label:"3m"},4:{style:{fontSize:"10px"},label:"4m"},5:{style:{fontSize:"10px"},label:"5m"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("solarCollectorMenu.PoleHeight",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{q.current=Z,g(!p)},min:0,max:10,step:.1,defaultValue:q.current,marks:{0:{style:{fontSize:"10px"},label:"0m"},2:{style:{fontSize:"10px"},label:"2m"},4:{style:{fontSize:"10px"},label:"4m"},6:{style:{fontSize:"10px"},label:"6m"},8:{style:{fontSize:"10px"},label:"8m"},10:{style:{fontSize:"10px"},label:"10m"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("solarPanelMenu.PoleSpacing",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{te.current=Z,g(!p)},min:2,max:10,step:.1,defaultValue:te.current,marks:{2:{style:{fontSize:"10px"},label:"2m"},4:{style:{fontSize:"10px"},label:"4m"},6:{style:{fontSize:"10px"},label:"6m"},8:{style:{fontSize:"10px"},label:"8m"},10:{style:{fontSize:"10px"},label:"10m"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("economicsPanel.OperationalCostPerUnit",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{se.current=Z,g(!p)},min:.1,max:1,step:.01,defaultValue:se.current,marks:{.1:{style:{fontSize:"10px"},label:"10¢"},.3:{style:{fontSize:"10px"},label:"30¢"},.5:{style:{fontSize:"10px"},label:"50¢"},.7:{style:{fontSize:"10px"},label:"70¢"},.9:{style:{fontSize:"10px"},label:"90¢"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("economicsPanel.ElectricitySellingPrice",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{ae.current=Z,g(!p)},min:.1,max:1,step:.01,defaultValue:ae.current,marks:{.1:{style:{fontSize:"10px"},label:"10¢"},.3:{style:{fontSize:"10px"},label:"30¢"},.5:{style:{fontSize:"10px"},label:"50¢"},.7:{style:{fontSize:"10px"},label:"70¢"},.9:{style:{fontSize:"10px"},label:"90¢"}}})})]})]},"3")]})})})},ffo=t=>{const e=[];if(t.type!==z.Polygon)return{items:e};const n=t,o=H.getState().getParent(n),r={lng:H.getState().language},i=!n.locked;return e.push({key:"polygon-paste",label:h.jsx(eM,{})}),e.push({key:"polygon-copy",label:h.jsx(Ld,{})}),i&&e.push({key:"polygon-cut",label:h.jsx(Wd,{})}),o&&(o.type===z.Foundation||o.type===z.Cuboid)&&e.push({key:"polygon-layout-submenu",label:h.jsx(rn,{children:Y.t("polygonMenu.Layout",r)}),children:[{key:"solar-panel-layout-wizard",label:h.jsxs(to,{noPadding:!0,Dialog:cfo,children:[Y.t("polygonMenu.SolarPanelArrayLayoutParametricDesign",r)," ..."]})},{key:"solar-panel-layout-ai",label:h.jsx(rn,{noPadding:!0,children:Y.t("polygonMenu.SolarPanelArrayLayoutGenerativeDesign",r)}),children:[{key:"solar-panel-layout-ga",label:h.jsxs(to,{noPadding:!0,Dialog:ufo,children:[Y.t("optimizationMenu.GeneticAlgorithm",r)," ..."]})},{key:"solar-panel-layout-pso",label:h.jsxs(to,{noPadding:!0,Dialog:dfo,children:[Y.t("optimizationMenu.ParticleSwarmOptimization",r)," ..."]})}]}]}),e.push({key:"polygon-lock",label:h.jsx(Ju,{selectedElement:n})}),i&&(e.push({key:"polygon-filled",label:h.jsx(Odo,{polygon:n})}),n.filled&&e.push({key:"polygon-shiny",label:h.jsx(_do,{polygon:n})}),e.push({key:"polygon-no-outline",label:h.jsx(Vdo,{polygon:n})})),i&&(e.push({key:"polygon-line-color",label:h.jsxs(to,{Dialog:Zdo,children:[Y.t("polygonMenu.LineColor",r)," ..."]})},{key:"polygon-line-style",label:h.jsxs(to,{Dialog:efo,children:[Y.t("polygonMenu.LineStyle",r)," ..."]})},{key:"polygon-line-width",label:h.jsxs(to,{Dialog:tfo,children:[Y.t("polygonMenu.LineWidth",r)," ..."]})}),n.filled&&((!n.textureType||n.textureType===Jr.NoTexture)&&e.push({key:"polygon-fill-color",label:h.jsxs(to,{Dialog:nfo,children:[Y.t("polygonMenu.FillColor",r)," ..."]})}),e.push({key:"polygon-texture",label:h.jsxs(to,{Dialog:afo,children:[Y.t("polygonMenu.FillTexture",r)," ..."]})},{key:"polygon-opacity",label:h.jsxs(to,{Dialog:lfo,children:[Y.t("polygonMenu.Opacity",r)," ..."]})})),e.push({key:"polygon-text-box",label:h.jsx(rn,{children:Y.t("polygonMenu.TextBox",r)}),children:[{key:"polygon-text",label:h.jsx(Gdo,{polygon:n})},{key:"polygon-font-size",label:h.jsx(Xdo,{polygon:n})},{key:"polygon-font-color",label:h.jsx(Jdo,{polygon:n})},{key:"polygon-font-outline-color",label:h.jsx(Kdo,{polygon:n})},{key:"polygon-font-outline-width",label:h.jsx(qdo,{polygon:n})},{key:"polygon-font-stroke-color",label:h.jsx($do,{polygon:n})},{key:"polygon-font-stroke-width",label:h.jsx(Qdo,{polygon:n})}]})),{items:e}},hfo=(t,e)=>{H.getState().set(n=>{for(const o of n.elements)if(o.type===z.Polygon&&o.id===t){o.vertices.splice(e,1);break}})},pfo=(t,e)=>{H.getState().set(n=>{for(const o of n.elements)if(o.type===z.Polygon&&o.id===t){const r=o,i=r.vertices.length;if(e>0&&e{H.getState().set(n=>{for(const o of n.elements)if(o.type===z.Polygon&&o.id===t){const r=o,i=r.vertices.length;if(e>=0&&e{if(t.selectedIndex>=0){const n=t.vertices.map(i=>({...i}));switch(e){case sx.Delete:hfo(t.id,t.selectedIndex);break;case sx.InsertBeforeIndex:pfo(t.id,t.selectedIndex);break;case sx.InsertAfterIndex:gfo(t.id,t.selectedIndex);break}const o=H.getState().getElementById(t.id).vertices.map(i=>({...i})),r={name:e,timestamp:Date.now(),changedElementId:t.id,changedElementType:t.type,oldValue:n,newValue:o,undo:()=>{r.oldValue&&Array.isArray(r.oldValue)&&H.getState().updatePolygonVerticesById(r.changedElementId,n)},redo:()=>{H.getState().updatePolygonVerticesById(r.changedElementId,o)}};H.getState().addUndoable(r)}},mfo=t=>{const e=[];if(t.type!==z.Polygon)return{items:e};const n=t,o={lng:H.getState().language};return e.push({key:"polygon-vertex-insert-before-index",label:h.jsx(rn,{noPadding:!0,children:Y.t("polygonMenu.InsertVertexBeforeIndex",o)})},{key:"polygon-vertex-insert-after-index",label:h.jsx(rn,{noPadding:!0,children:Y.t("polygonMenu.InsertVertexAfterIndex",o)})}),n.vertices.length>3&&e.push({key:"polygon-vertex-delete",label:h.jsx(rn,{noPadding:!0,children:Y.t("polygonMenu.DeleteVertex",o)})}),{items:e,onClick:({key:i})=>{switch(i){case"polygon-vertex-insert-before-index":jae(n,sx.InsertBeforeIndex);break;case"polygon-vertex-insert-after-index":jae(n,sx.InsertAfterIndex);break;case"polygon-vertex-delete":jae(n,sx.Delete);break}}}},yfo=({sensor:t})=>{const e=Jt(),n=not(t);return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:!!t.showLabel,onChange:n,children:Y.t("labelSubMenu.KeepShowingLabel",e)})})},Afo=({sensor:t})=>{const e=Jt(),{labelText:n,setLabelText:o}=tot(t),r=oot(t,n);return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsx(en,{style:{width:"80px"},children:Y.t("labelSubMenu.LabelText",e)+":"}),h.jsx(as,{style:{width:"150px"},value:n,onChange:i=>o(i.target.value),onPressEnter:r,onBlur:r})]})},wfo=t=>{const e=[];if(t.type!==z.Sensor)return{items:e};const n=t,o=!n.locked;return e.push({key:"sensor-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"sensor-cut",label:h.jsx(Wd,{})}),e.push({key:"sensor-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&(e.push({key:"sensor-show-label",label:h.jsx(yfo,{sensor:n})}),e.push({key:"sensor-label-text",label:h.jsx(Afo,{sensor:n})})),{items:e}},vfo=({light:t})=>{const e=Jt(),n=H.getState().updateInsideLightById,o=r=>{const i=r.target.checked,a={name:"Inside Light",timestamp:Date.now(),checked:i,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.inside,onChange:o,children:Y.t("lightMenu.Inside",e)})})},xfo=({light:t})=>{const e=Jt(),n=t.intensity??3,o=(i,a)=>{H.getState().set(l=>{for(const s of l.elements)if(s.type===z.Light&&s.id===i){s.intensity=a;break}})},r=i=>{if(i===null||i===n)return;const a={name:"Set Light Intensity",timestamp:Date.now(),oldValue:n,newValue:i,changedElementId:t.id,undo:()=>{o(a.changedElementId,a.oldValue)},redo:()=>{o(a.changedElementId,a.newValue)}};H.getState().addUndoable(a),o(t.id,i),H.getState().set(l=>{l.actionState.lightIntensity=i})};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"80px"},children:[Y.t("lightMenu.Intensity",e),":"]}),h.jsx(Mn,{min:.1,max:10,step:.1,precision:1,value:n,onChange:r})]})},bfo=({light:t})=>{const e=Jt(),n=t.distance??5,o=(i,a)=>{H.getState().set(l=>{for(const s of l.elements)if(s.type===z.Light&&s.id===i){s.distance=a;break}})},r=i=>{if(i===null||i===n)return;const a={name:"Set Light Distance",timestamp:Date.now(),oldValue:n,newValue:i,changedElementId:t.id,undo:()=>{o(a.changedElementId,a.oldValue)},redo:()=>{o(a.changedElementId,a.newValue)}};H.getState().addUndoable(a),o(t.id,i),H.getState().set(l=>{l.actionState.lightDistance=i})};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"80px"},children:[Y.t("lightMenu.MaximumDistance",e),":"]}),h.jsx(Mn,{min:1,max:10,step:1,precision:1,value:n,onChange:r})]})},Sfo=({light:t})=>{const e=t.color??"#ffff99",n=(o,r)=>{H.getState().set(i=>{for(const a of i.elements)if(a.type===z.Light&&a.id===o){a.color=r;break}})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(zf,{color:e,onChangeComplete:o=>{const r=t.color,i=o.hex,a={name:"Set Light Color",timestamp:Date.now(),oldValue:r,newValue:i,undo:()=>{n(t.id,a.oldValue)},redo:()=>{n(t.id,a.newValue)}};H.getState().addUndoable(a),n(t.id,i),H.getState().set(l=>{l.actionState.lightColor=i})}})})},Tfo=t=>{const e=[];if(t.type!==z.Light)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language},i=n.parentId?H.getState().getParent(n):void 0;return e.push({key:"light-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"light-cut",label:h.jsx(Wd,{})}),e.push({key:"light-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&i&&(i.type===z.Roof||i.type===z.Wall)&&e.push({key:"light-inside",label:h.jsx(vfo,{light:n})}),o&&e.push({key:"light-intensity",label:h.jsx(xfo,{light:n})},{key:"light-distance",label:h.jsx(bfo,{light:n})},{key:"light-color",label:h.jsx(rn,{children:Y.t("word.Color",r)}),children:[{key:"light-color-picker",label:h.jsx(Sfo,{light:n}),style:{backgroundColor:"white"}}]}),{items:e}},Pfo=()=>{const t=H(Age),e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.axes=r})},o=r=>{const i=r.target.checked,a={name:"Show Axes",timestamp:Date.now(),checked:i,undo:()=>{n(!a.checked)},redo:()=>{n(a.checked)}};H.getState().addUndoable(a),n(i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t,onChange:o,children:Y.t("skyMenu.Axes",e)})})},Cfo=()=>{const t=H(ABe),e=Jt(),n=i=>{H.getState().set(a=>{a.viewState.theme=i})},o=i=>{const a=t,l=i.target.value,s={name:"Select Theme",timestamp:Date.now(),oldValue:a,newValue:l,undo:()=>{n(s.oldValue)},redo:()=>{n(s.newValue)}};H.getState().addUndoable(s),n(l)},r=[{value:Os.Default,label:"skyMenu.ThemeDefault"},{value:Os.Desert,label:"skyMenu.ThemeDesert"},{value:Os.Dune,label:"skyMenu.ThemeDune"},{value:Os.Forest,label:"skyMenu.ThemeForest"},{value:Os.Grassland,label:"skyMenu.ThemeGrassland"},{value:Os.Hill,label:"skyMenu.ThemeHill"},{value:Os.Lake,label:"skyMenu.ThemeLake"},{value:Os.Mountain,label:"skyMenu.ThemeMountain"},{value:Os.Rural,label:"skyMenu.ThemeRural"}];return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Ue.Group,{value:t,onChange:o,children:h.jsx(en,{direction:"vertical",children:r.map((i,a)=>h.jsx(Ue,{style:{width:"100%"},value:i.value,children:Y.t(i.label,e)},`${a}-${i.value}`))})})})},Rfo=()=>{const t=H(wBe)??!0,e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.showAzimuthAngle=r})},o=r=>{const i=t,a=r.target.checked,l={name:"Show Azimuth Angle "+a,timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t,onChange:o,children:Y.t("skyMenu.ShowAzimuthAngle",e)})})},Hfo=()=>{const t=H(vBe)??!0,e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.showElevationAngle=r})},o=r=>{const i=t,a=r.target.checked,l={name:"Show Elevation Angle "+a,timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t,onChange:o,children:Y.t("skyMenu.ShowElevationAngle",e)})})},Mfo=()=>{const t=H(xBe)??!0,e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.showZenithAngle=r})},o=r=>{const i=t,a=r.target.checked,l={name:"Show Zenith Angle "+a,timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t,onChange:o,children:Y.t("skyMenu.ShowZenithAngle",e)})})},Ifo=()=>{const t=H(yBe)??3.5,e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.directLightIntensity=r})},o=r=>{if(r===null)return;const i=t,a=r,l={name:"Set Direct Light Intensity",timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsx(en,{style:{width:"270px"},children:Y.t("skyMenu.DirectLightBrightnessAtNoon",e)+" [0.1-10]:"}),h.jsx(Mn,{min:.1,max:10,step:.1,precision:2,value:t,onChange:o})]})},zfo=()=>{const t=H(mBe)??.2,e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.ambientLightIntensity=r})},o=r=>{if(r===null)return;const i=t,a=r,l={name:"Set Ambient Light Intensity",timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsx(en,{style:{width:"270px"},children:Y.t("skyMenu.AmbientLightBrightnessAtNoon",e)+" [0.01-1]:"}),h.jsx(Mn,{min:.01,max:1,step:.01,precision:2,value:t,onChange:o})]})},Dfo=()=>{const t=H(v8t)??.01,e=Jt(),n=r=>{H.getState().set(i=>{i.world.airAttenuationCoefficient=r})},o=r=>{if(r===null)return;const i=t,a=r,l={name:"Set Sunlight Attenuation Coefficient of Air",timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsx(en,{style:{width:"270px"},children:Y.t("skyMenu.SunlightAttenuationCoefficientInAir",e)+":"}),h.jsx(Mn,{min:0,max:.1,step:.001,precision:3,value:t,onChange:o})]})},Efo=()=>{const t=H(x8t)??5,e=Jt(),n=r=>{H.getState().set(i=>{i.world.airConvectiveCoefficient=r})},o=r=>{if(r===null)return;const i=t,a=r,l={name:"Set Convective Coefficient of Air",timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsx(en,{style:{width:"270px"},children:Y.t("skyMenu.ConvectiveCoefficientOfAir",e)+" [W/(m²×K)]:"}),h.jsx(Mn,{min:2.5,max:20,step:.1,precision:2,value:t,onChange:o})]})},Ffo=()=>{const t=H(cW)??900,e=H.getState().world,n=Jt(),o=m.useMemo(()=>dl(new Date(e.date),e.latitude),[e.date,e.latitude]),r=a=>{H.getState().set(l=>{l.world.highestTemperatureTimeInMinutes=a})},i=a=>{if(a===null)return;const l=t,s=a,c={name:"Set Time of Highest Temperature in Minutes",timestamp:Date.now(),oldValue:l,newValue:s,undo:()=>{r(c.oldValue)},redo:()=>{r(c.newValue)}};H.getState().addUndoable(c),r(s)};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsx(en,{style:{width:"270px"},children:Y.t("skyMenu.HighestTemperatureTimeInMinutes",n)+":"}),h.jsx(Mn,{min:720,max:o.sunset,step:5,precision:0,value:t,onChange:i})]})},kfo=()=>{const t={lng:H.getState().language},e=[];return e.push({key:"axes",label:h.jsx(Pfo,{})}),e.push({key:"theme-submenu",label:h.jsx(rn,{children:Y.t("skyMenu.Theme",t)}),children:[{key:"theme-radio-group",label:h.jsx(Cfo,{}),style:{backgroundColor:"white"}}]}),e.push({key:"sun-angles-submenu",label:h.jsx(rn,{children:Y.t("skyMenu.SelectSunAnglesToShow",t)}),children:[{key:"show-azimuth-angle",label:h.jsx(Rfo,{})},{key:"ShowElevationAngle",label:h.jsx(Hfo,{})},{key:"ShowZenithAngle",label:h.jsx(Mfo,{})}]}),e.push({key:"direct-light-intensity",label:h.jsx(Ifo,{})}),e.push({key:"ambient-light-intensity",label:h.jsx(zfo,{})}),e.push({key:"air-attenuation-coefficient",label:h.jsx(Dfo,{})}),e.push({key:"air-convective-coefficient",label:h.jsx(Efo,{})}),e.push({key:"highest-temperature-time-in-minutes",label:h.jsx(Ffo,{})}),{items:e}},RK=class RK{constructor(){this.n=14,this.nominalStrings=new Array(this.n),this.nominalWidths=new Array(this.n),this.nominalHeights=new Array(this.n),this.cellNx=new Array(this.n),this.cellNy=new Array(this.n),this.nominalWidths[0]=.99,this.nominalHeights[0]=1.65,this.cellNx[0]=6,this.cellNy[0]=10,this.nominalWidths[1]=.99,this.nominalHeights[1]=1.96,this.cellNx[1]=6,this.cellNy[1]=12,this.nominalWidths[2]=1.05,this.nominalHeights[2]=1.56,this.cellNx[2]=8,this.cellNy[2]=12,this.nominalWidths[3]=1.31,this.nominalHeights[3]=1.96,this.cellNx[3]=8,this.cellNy[3]=12,this.nominalWidths[4]=1.07,this.nominalHeights[4]=2.07,this.cellNx[4]=8,this.cellNy[4]=16,this.nominalWidths[5]=.6,this.nominalHeights[5]=1.2,this.cellNx[5]=10,this.cellNy[5]=20,this.nominalWidths[6]=1.2,this.nominalHeights[6]=2,this.cellNx[6]=10,this.cellNy[6]=20,this.nominalWidths[7]=1,this.nominalHeights[7]=2.07,this.cellNx[7]=6,this.cellNy[7]=12,this.nominalWidths[8]=.8,this.nominalHeights[8]=1.56,this.cellNx[8]=6,this.cellNy[8]=12,this.nominalWidths[9]=.83,this.nominalHeights[9]=1.58,this.cellNx[9]=6,this.cellNy[9]=12,this.nominalWidths[10]=.99,this.nominalHeights[10]=1.31,this.cellNx[10]=6,this.cellNy[10]=8,this.nominalWidths[11]=.99,this.nominalHeights[11]=1.5,this.cellNx[11]=6,this.cellNy[11]=9,this.nominalWidths[12]=1.05,this.nominalHeights[12]=1.81,this.cellNx[12]=8,this.cellNy[12]=14,this.nominalWidths[13]=1.05,this.nominalHeights[13]=1.69,this.cellNx[13]=8,this.cellNy[13]=13;for(let e=0;e{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(fW),a=H(t5),l=H(En),s=H(zd),c=H(Dd),u=H(no),d=H(Zn),f=co(),[p,g]=m.useState((f==null?void 0:f.pvModelName)??"SPR-X21-335-BLK"),[y,w]=m.useState(),b=Jt(),C=a(p??"SPR-X21-335-BLK");m.useEffect(()=>{w(C.nominalWidth.toFixed(2)+"m×"+C.nominalLength.toFixed(2)+"m ("+C.n+"×"+C.m+" "+Y.t("pvModelPanel.Cells",b)+")")},[C]);const P=(W,j)=>{e(L=>{for(const k of L.elements)if(k.type===z.SolarPanel&&k.id===W&&!k.locked){const N=k;N.pvModelName=j;const F=L.pvModules[j];if(N.orientation===vr.portrait){const U=Math.max(1,Math.round(N.lx/F.width)),O=Math.max(1,Math.round(N.ly/F.length));N.lx=U*F.width,N.ly=O*F.length}else{const U=Math.max(1,Math.round(N.lx/F.length)),O=Math.max(1,Math.round(N.ly/F.width));N.lx=U*F.length,N.ly=O*F.width}break}})},v=(W,j)=>{e(L=>{const k=L.pvModules[j];for(const N of L.elements)if(N.type===z.SolarPanel&&N.foundationId===W&&!N.locked){const F=N;if(F.pvModelName=j,F.orientation===vr.portrait){const U=Math.max(1,Math.round(F.lx/k.width)),O=Math.max(1,Math.round(F.ly/k.length));F.lx=U*k.width,F.ly=O*k.length}else{const U=Math.max(1,Math.round(F.lx/k.length)),O=Math.max(1,Math.round(F.ly/k.width));F.lx=U*k.length,F.ly=O*k.width}}})},T=(W,j,L)=>{e(k=>{const N=k.pvModules[L];for(const F of k.elements)if(F.type===z.SolarPanel&&!F.locked){let U;if(j?U=F.parentId===W&&me.isIdentical(F.normal,j):U=F.parentId===W,U){const O=F;if(O.pvModelName=L,O.orientation===vr.portrait){const B=Math.max(1,Math.round(O.lx/N.width)),_=Math.max(1,Math.round(O.ly/N.length));O.lx=B*N.width,O.ly=_*N.length}else{const B=Math.max(1,Math.round(O.lx/N.length)),_=Math.max(1,Math.round(O.ly/N.width));O.lx=B*N.length,O.ly=_*N.width}}}})},A=W=>{e(j=>{const L=j.pvModules[W];for(const k of j.elements)if(k.type===z.SolarPanel&&!k.locked){const N=k;if(N.pvModelName=W,N.orientation===vr.portrait){const F=Math.max(1,Math.round(N.lx/L.width)),U=Math.max(1,Math.round(N.ly/L.length));N.lx=F*L.width,N.ly=U*L.length}else{const F=Math.max(1,Math.round(N.lx/L.length)),U=Math.max(1,Math.round(N.ly/L.width));N.lx=F*L.length,N.ly=U*L.width}}})},x=(W,j)=>{H.getState().set(L=>{const k=L.pvModules[j];for(const N of L.elements)if(N.type===z.SolarPanel&&!N.locked&&W.has(N.id)){const F=N;if(F.pvModelName=j,F.orientation===vr.portrait){const U=Math.max(1,Math.round(F.lx/k.width)),O=Math.max(1,Math.round(F.ly/k.length));F.lx=U*k.width,F.ly=O*k.length}else{const U=Math.max(1,Math.round(F.lx/k.length)),O=Math.max(1,Math.round(F.ly/k.width));F.lx=U*k.length,F.ly=O*k.width}}})},S=W=>{c(W.target.value)},R=W=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:{for(const j of n)if(j.type===z.SolarPanel&&!j.locked&&H.getState().selectedElementIdSet.has(j.id)&&j.pvModelName!==W)return!0;break}case oe.AllObjectsOfThisType:{for(const j of n)if(j.type===z.SolarPanel&&!j.locked&&j.pvModelName!==W)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const j of n)if(j.type===z.SolarPanel&&j.foundationId===(f==null?void 0:f.foundationId)&&!j.locked&&j.pvModelName!==W)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const j=r(f);if(j){if(j.type===z.Cuboid){for(const k of n)if(k.type===z.SolarPanel&&k.parentId===f.parentId&&me.isIdentical(k.normal,f.normal)&&!k.locked&&k.pvModelName!==W)return!0}else for(const k of n)if(k.type===z.SolarPanel&&k.parentId===f.parentId&&!k.locked&&k.pvModelName!==W)return!0}break}default:{if((f==null?void 0:f.pvModelName)!==W)return!0;break}}return!1}},M=W=>{if(f&&R(W)){switch(s){case oe.AllSelectedObjectsOfThisType:{const j=new Map;for(const k of n)k.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(k.id)&&j.set(k.id,k.pvModelName);const L={name:"Set Model for Selected Solar Panels",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())P(k,N)},redo:()=>{x(L.oldValues,L.newValue)}};l(L),x(j,W),d(u+1);break}case oe.AllObjectsOfThisType:{const j=new Map;for(const k of n)k.type===z.SolarPanel&&j.set(k.id,k.pvModelName);const L={name:"Set Model for All Solar Panels",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())P(k,N)},redo:()=>{A(L.newValue)}};l(L),A(W),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const j=new Map;for(const k of n)k.type===z.SolarPanel&&k.foundationId===f.foundationId&&j.set(k.id,k.pvModelName);const L={name:"Set Model for All Solar Panels Above Foundation",timestamp:Date.now(),oldValues:j,newValue:W,groupId:f.foundationId,undo:()=>{for(const[k,N]of L.oldValues.entries())P(k,N)},redo:()=>{L.groupId&&v(L.groupId,L.newValue)}};l(L),v(f.foundationId,W),d(u+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{const j=r(f);if(j){const L=new Map,k=j.type===z.Cuboid;if(k)for(const U of n)U.type===z.SolarPanel&&U.parentId===f.parentId&&me.isIdentical(U.normal,f.normal)&&L.set(U.id,U.pvModelName);else for(const U of n)U.type===z.SolarPanel&&U.parentId===f.parentId&&L.set(U.id,U.pvModelName);const N=k?f.normal:void 0,F={name:"Set Model for All Solar Panels on Surface",timestamp:Date.now(),oldValues:L,newValue:W,groupId:f.parentId,normal:N,undo:()=>{for(const[U,O]of F.oldValues.entries())P(U,O)},redo:()=>{F.groupId&&T(F.groupId,F.normal,F.newValue)}};l(F),T(f.parentId,N,W),d(u+1)}break}default:{const j=o(f.id),L=j?j.pvModelName:f.pvModelName,k={name:"Set Model for Selected Solar Panel",timestamp:Date.now(),oldValue:L,newValue:W,changedElementId:f.id,changedElementType:f.type,undo:()=>{P(k.changedElementId,k.oldValue)},redo:()=>{P(k.changedElementId,k.newValue)}};l(k),P(f.id,W),d(u+1);break}}e(j=>{j.actionState.solarPanelModelName=W})}},D=()=>{t(!1)},E=()=>{M(p)};return h.jsxs(so,{width:640,title:Y.t("pvModelPanel.SolarPanelSpecs",b),onApply:E,onClose:D,children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("pvModelPanel.Model",b)+" ("+Object.keys(i).length+" "+Y.t("word.Options",b)+"):"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(_o,{defaultValue:"Custom",style:{width:"100%"},value:p,onChange:g,children:Object.keys(i).map(W=>h.jsx(Z7,{value:W,children:W+(i[W].bifacialityFactor>0?" ("+Y.t("pvModelPanel.Bifacial",b)+")":"")},W))})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("pvModelPanel.PanelSize",b)+":"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(_o,{disabled:!0,style:{width:"100%"},value:y,onChange:W=>{},children:mfe.instance.nominalStrings.map(W=>h.jsx(Z7,{value:W,children:W},W))})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("pvModelPanel.CellType",b)+":"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsxs(_o,{disabled:!0,style:{width:"100%"},value:C.cellType,onChange:W=>{},children:[h.jsx(Z7,{value:"Monocrystalline",children:Y.t("pvModelPanel.Monocrystalline",b)},"Monocrystalline"),h.jsx(Z7,{value:"Polycrystalline",children:Y.t("pvModelPanel.Polycrystalline",b)},"Polycrystalline"),h.jsx(Z7,{value:"Thin Film",children:Y.t("pvModelPanel.ThinFilm",b)},"Thin Film")]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("pvModelPanel.BifacialityFactor",b)+":"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{disabled:!0,style:{width:"100%"},precision:2,value:C.bifacialityFactor,onChange:W=>{}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("word.Color",b)+":"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsxs(_o,{disabled:!0,style:{width:"100%"},value:C.color,onChange:W=>{},children:[h.jsx(Z7,{value:"Black",children:Y.t("pvModelPanel.Black",b)},"Black"),h.jsx(Z7,{value:"Blue",children:Y.t("pvModelPanel.Blue",b)},"Blue")]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("pvModelPanel.SolarCellEfficiency",b)+" (%):"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{disabled:!0,style:{width:"100%"},precision:2,value:100*C.efficiency,onChange:W=>{}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("pvModelPanel.NominalOperatingCellTemperature",b)+" (°C):"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{disabled:!0,style:{width:"100%"},precision:1,value:C.noct,onChange:W=>{}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("pvModelPanel.TemperatureCoefficientOfPmax",b)+" (%/°C):"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(as,{disabled:!0,style:{width:"100%"},value:C.pmaxTC,onChange:W=>{}})})]}),h.jsxs(on,{gutter:6,style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},children:[h.jsx(nt,{className:"gutter-row",span:3,children:Y.t("word.ApplyTo",b)+":"}),h.jsx(nt,{className:"gutter-row",span:21,children:h.jsx(Ue.Group,{onChange:S,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",b)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",b)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",b)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",b)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",b)})]})})})]})]})},{Option:HHe}=_o,Wfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(t5),i=H(qr),a=H(Fge),l=H(En),s=H(zd),c=H(Dd),u=H(no),d=H(Zn),f=H(Vi),p=co(),[g,y]=m.useState((p==null?void 0:p.orientation)??vr.portrait),w=m.useRef(!1),b=m.useRef(),C=Jt(),P=(U,O)=>{e(B=>{for(const _ of B.elements)if(_.type===z.SolarPanel&&_.id===U&&!_.locked){const X=_,$=B.pvModules[X.pvModelName];B.setSolarPanelOrientation(X,$,O);break}})},v=(U,O)=>{e(B=>{for(const _ of B.elements)if(_.type===z.SolarPanel&&_.foundationId===U&&!_.locked){const X=_,$=B.pvModules[X.pvModelName];B.setSolarPanelOrientation(X,$,O)}})},T=(U,O,B)=>{e(_=>{for(const X of _.elements)if(X.type===z.SolarPanel&&!X.locked){let $;if(O?$=X.parentId===U&&me.isIdentical(X.normal,O):$=X.parentId===U,$){const Q=X,le=_.pvModules[Q.pvModelName];_.setSolarPanelOrientation(Q,le,B)}}})},A=U=>{e(O=>{for(const B of O.elements)if(B.type===z.SolarPanel&&!B.locked){const _=B,X=O.pvModules[_.pvModelName];O.setSolarPanelOrientation(_,X,U)}})},x=(U,O)=>{H.getState().set(B=>{for(const _ of B.elements)if(_.type===z.SolarPanel&&!_.locked&&U.has(_.id)){const X=_,$=B.pvModules[X.pvModelName];B.setSolarPanelOrientation(X,$,O)}})},S=U=>{c(U.target.value)},R=U=>{if(p){const O=r(p.pvModelName);if(U===vr.portrait){const B=Math.max(1,Math.round(p.lx/O.width)),_=Math.max(1,Math.round(p.ly/O.length));a(p.id,B*O.width,_*O.length)}else{const B=Math.max(1,Math.round(p.lx/O.length)),_=Math.max(1,Math.round(p.ly/O.width));a(p.id,B*O.length,_*O.width)}P(p.id,U)}},M=(U,O)=>{const B=i(U);if(B){if(B.type===z.Cuboid&&!me.isIdentical(U.normal,rs))return!0;const _=JSON.parse(JSON.stringify(U));_.orientation=O;const X=r(_.pvModelName);if(O===vr.portrait){const $=Math.max(1,Math.round(_.lx/X.width)),Q=Math.max(1,Math.round(_.ly/X.length));_.lx=$*X.width,_.ly=Q*X.length}else{const $=Math.max(1,Math.round(_.lx/X.length)),Q=Math.max(1,Math.round(_.ly/X.width));_.lx=$*X.length,_.ly=Q*X.width}return B.type===z.Wall?me.checkElementOnWallState(_,B)===ga.Valid:B.type===z.Roof?me.checkElementOnRoofState(_,B)===ga.Valid:me.isSolarCollectorWithinHorizontalSurface(_,B)}return!1},D=(U,O)=>!M(U,O),E=U=>{if(p){switch(s){case oe.AllSelectedObjectsOfThisType:{for(const O of n)if(O.type===z.SolarPanel&&!O.locked&&H.getState().selectedElementIdSet.has(O.id)&&O.orientation!==U)return!0;break}case oe.AllObjectsOfThisType:{for(const O of n)if(O.type===z.SolarPanel&&!O.locked&&O.orientation!==U)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const O of n)if(O.type===z.SolarPanel&&O.foundationId===(p==null?void 0:p.foundationId)&&!O.locked&&O.orientation!==U)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const O=i(p);if(O){if(O.type===z.Cuboid){for(const _ of n)if(_.type===z.SolarPanel&&_.parentId===p.parentId&&me.isIdentical(_.normal,p.normal)&&!_.locked&&_.orientation!==U)return!0}else for(const _ of n)if(_.type===z.SolarPanel&&_.parentId===p.parentId&&!_.locked&&_.orientation!==U)return!0}break}default:{if((p==null?void 0:p.orientation)!==U)return!0;break}}return!1}},W=U=>{if(p&&E(U)){switch(b.current=void 0,s){case oe.AllSelectedObjectsOfThisType:{w.current=!1;for(const O of n)if(O.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(O.id)&&D(O,U)){w.current=!0;break}if(w.current)b.current=U,y(p.orientation);else{const O=new Map;for(const _ of n)_.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(_.id)&&O.set(_.id,_.orientation);const B={name:"Set Orientation for Selected Solar Panels",timestamp:Date.now(),oldValues:O,newValue:U,undo:()=>{for(const[_,X]of B.oldValues.entries())P(_,X)},redo:()=>{x(B.oldValues,B.newValue)}};l(B),x(O,U),d(u+1)}break}case oe.AllObjectsOfThisType:{w.current=!1;for(const O of n)if(O.type===z.SolarPanel&&D(O,U)){w.current=!0;break}if(w.current)b.current=U,y(p.orientation);else{const O=new Map;for(const _ of n)_.type===z.SolarPanel&&O.set(_.id,_.orientation);const B={name:"Set Orientation for All Solar Panels",timestamp:Date.now(),oldValues:O,newValue:U,undo:()=>{for(const[_,X]of B.oldValues.entries())P(_,X)},redo:()=>{A(B.newValue)}};l(B),A(U),d(u+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){w.current=!1;for(const O of n)if(O.type===z.SolarPanel&&O.foundationId===p.foundationId&&D(O,U)){w.current=!0;break}if(w.current)b.current=U,y(p.orientation);else{const O=new Map;for(const _ of n)_.type===z.SolarPanel&&_.foundationId===p.foundationId&&O.set(_.id,_.orientation);const B={name:"Set Orientation for All Solar Panels Above Foundation",timestamp:Date.now(),oldValues:O,newValue:U,groupId:p.foundationId,undo:()=>{for(const[_,X]of B.oldValues.entries())P(_,X)},redo:()=>{B.groupId&&v(B.groupId,B.newValue)}};l(B),v(p.foundationId,U),d(u+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const O=i(p);if(O){if(w.current=!1,O.type===z.Cuboid){for(const _ of n)if(_.type===z.SolarPanel&&_.parentId===p.parentId&&me.isIdentical(_.normal,p.normal)&&D(_,U)){w.current=!0;break}}else for(const _ of n)if(_.type===z.SolarPanel&&_.parentId===p.parentId&&D(_,U)){w.current=!0;break}if(w.current)b.current=U,y(p.orientation);else{const _=new Map,X=O.type===z.Cuboid;if(X)for(const le of n)le.type===z.SolarPanel&&le.parentId===p.parentId&&me.isIdentical(le.normal,p.normal)&&_.set(le.id,le.orientation);else for(const le of n)le.type===z.SolarPanel&&le.parentId===p.parentId&&_.set(le.id,le.orientation);const $=X?p.normal:void 0,Q={name:"Set Orientation for All Solar Panels on Surface",timestamp:Date.now(),oldValues:_,newValue:U,groupId:p.parentId,normal:$,undo:()=>{for(const[le,q]of Q.oldValues.entries())P(le,q)},redo:()=>{Q.groupId&&T(Q.groupId,Q.normal,Q.newValue)}};l(Q),T(p.parentId,$,U),d(u+1)}}break}default:{const O=o(p.id),B=O?O.orientation:p.orientation;if(w.current=!1,w.current)b.current=U,y(B);else{const _={name:"Set Orientation of Selected Solar Panel",timestamp:Date.now(),oldValue:B,newValue:U,changedElementId:p.id,changedElementType:p.type,undo:()=>{R(_.oldValue)},redo:()=>{R(_.newValue)}};l(_),R(U),d(u+1)}break}}e(O=>{O.actionState.solarPanelOrientation=U})}},j=()=>{p&&(y(p.orientation),w.current=!1,t(!1))},L=()=>{j(),f()},k=()=>{W(g),w.current||(t(!1),d(0))},N=()=>{W(g)},F=w.current?": "+Y.t("message.NotApplicableToSelectedAction",C)+(b.current?" ("+(b.current===vr.portrait?Y.t("solarPanelMenu.Portrait",C):Y.t("solarPanelMenu.Landscape",C))+")":""):"";return h.jsx(so,{width:550,title:Y.t("solarPanelMenu.Orientation",C),rejectedMessage:F,onApply:N,onClose:j,onClickCancel:L,onClickOk:k,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:8,children:h.jsxs(_o,{style:{width:"150px"},value:g,onChange:U=>y(U),children:[h.jsx(HHe,{value:vr.portrait,children:Y.t("solarPanelMenu.Portrait",C)},vr.portrait),h.jsx(HHe,{value:vr.landscape,children:Y.t("solarPanelMenu.Landscape",C)},vr.landscape)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:S,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",C)})]})})})]})})},Nfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(t5),i=H(qr),a=H(En),l=H(zd),s=H(Dd),c=H(no),u=H(Zn),d=H(Vi),f=co(z.SolarPanel),[p,g]=m.useState((f==null?void 0:f.lx)??1),[y,w]=m.useState(0),b=m.useRef(!1),C=m.useRef(),P=Jt();m.useEffect(()=>{if(f){const O=r(f.pvModelName)??r("SPR-X21-335-BLK");w(f.orientation===vr.portrait?O.width:O.length)}},[f]);const v=(O,B)=>{e(_=>{for(const X of _.elements)if(X.type===z.SolarPanel&&X.id===O&&!X.locked){const $=X,Q=_.getPvModule($.pvModelName);X.lx=me.panelizeLx($,Q,B);break}})},T=(O,B)=>{e(_=>{for(const X of _.elements)if(X.type===z.SolarPanel&&X.foundationId===O&&!X.locked){const $=X,Q=_.getPvModule($.pvModelName);X.lx=me.panelizeLx($,Q,B)}})},A=(O,B,_)=>{e(X=>{for(const $ of X.elements)if($.type===z.SolarPanel&&!$.locked){let Q;if(B?Q=$.parentId===O&&me.isIdentical($.normal,B):Q=$.parentId===O,Q){const le=$,q=X.getPvModule(le.pvModelName);$.lx=me.panelizeLx(le,q,_)}}})},x=O=>{e(B=>{for(const _ of B.elements)if(_.type===z.SolarPanel&&!_.locked){const X=_,$=B.getPvModule(X.pvModelName);_.lx=me.panelizeLx(X,$,O)}})},S=(O,B)=>{H.getState().set(_=>{for(const X of _.elements)if(X.type===z.SolarPanel&&!X.locked&&O.has(X.id)){const $=X,Q=_.getPvModule($.pvModelName);X.lx=me.panelizeLx($,Q,B)}})},R=O=>{s(O.target.value)},M=(O,B)=>{const _=i(O);if(_){if(_.type===z.Cuboid&&!me.isIdentical(O.normal,rs))return!0;const X=JSON.parse(JSON.stringify(O));return X.lx=B,_.type===z.Wall?me.checkElementOnWallState(X,_)===ga.Valid:_.type===z.Roof?me.checkElementOnRoofState(X,_)===ga.Valid:me.isSolarCollectorWithinHorizontalSurface(X,_)}return!1},D=(O,B)=>!M(O,B),E=O=>{if(f){switch(l){case oe.AllSelectedObjectsOfThisType:{for(const B of n)if(B.type===z.SolarPanel&&!B.locked&&H.getState().selectedElementIdSet.has(B.id)&&Math.abs(B.lx-O)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const B of n)if(B.type===z.SolarPanel&&!B.locked&&Math.abs(B.lx-O)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const B of n)if(B.type===z.SolarPanel&&B.foundationId===(f==null?void 0:f.foundationId)&&!B.locked&&Math.abs(B.lx-O)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const B=i(f);if(B){if(B.type===z.Cuboid){for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&me.isIdentical(X.normal,f.normal)&&!X.locked&&Math.abs(X.lx-O)>It)return!0}else for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&!X.locked&&Math.abs(X.lx-O)>It)return!0}break}default:{if(Math.abs((f==null?void 0:f.lx)-O)>It)return!0;break}}return!1}},W=O=>{if(f&&E(O))switch(C.current=void 0,l){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const B of n)if(B.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(B.id)&&D(B,O)){b.current=!0;break}if(b.current)C.current=O,g(f.lx);else{const B=new Map;for(const X of n)X.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(X.id)&&B.set(X.id,X.lx);const _={name:"Set Length for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:B,newValue:O,undo:()=>{for(const[X,$]of _.oldValues.entries())v(X,$)},redo:()=>{S(_.oldValues,_.newValue)}};a(_),S(B,O),u(c+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const B of n)if(B.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(B.id)&&D(B,O)){b.current=!0;break}if(b.current)C.current=O,g(f.lx);else{const B=new Map;for(const X of n)X.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(X.id)&&B.set(X.id,X.lx);const _={name:"Set Length for All Solar Panel Arrays",timestamp:Date.now(),oldValues:B,newValue:O,undo:()=>{for(const[X,$]of _.oldValues.entries())v(X,$)},redo:()=>{x(_.newValue)}};a(_),x(O),u(c+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){b.current=!1;for(const B of n)if(B.type===z.SolarPanel&&B.foundationId===f.foundationId&&D(B,O)){b.current=!0;break}if(b.current)C.current=O,g(f.lx);else{const B=new Map;for(const X of n)X.type===z.SolarPanel&&X.foundationId===f.foundationId&&B.set(X.id,X.lx);const _={name:"Set Length for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:B,newValue:O,groupId:f.foundationId,undo:()=>{for(const[X,$]of _.oldValues.entries())v(X,$)},redo:()=>{_.groupId&&T(_.groupId,_.newValue)}};a(_),T(f.foundationId,O),u(c+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const B=i(f);if(B){if(b.current=!1,B.type===z.Cuboid){for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&me.isIdentical(X.normal,f.normal)&&D(X,O)){b.current=!0;break}}else for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&D(X,O)){b.current=!0;break}if(b.current)C.current=O,g(f.lx);else{const X=new Map,$=B.type===z.Cuboid;if($)for(const q of n)q.type===z.SolarPanel&&q.parentId===f.parentId&&me.isIdentical(q.normal,f.normal)&&X.set(q.id,q.lx);else for(const q of n)q.type===z.SolarPanel&&q.parentId===f.parentId&&X.set(q.id,q.lx);const Q=$?f.normal:void 0,le={name:"Set Length for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:X,newValue:O,groupId:f.parentId,normal:Q,undo:()=>{for(const[q,te]of le.oldValues.entries())v(q,te)},redo:()=>{le.groupId&&A(le.groupId,le.normal,le.newValue)}};a(le),A(f.parentId,Q,O),u(c+1)}}break}default:{const B=o(f.id),_=B?B.lx:f.lx;if(b.current=D(f,O),b.current)C.current=O,g(_);else{const X={name:"Set Solar Panel Array Length",timestamp:Date.now(),oldValue:_,newValue:O,changedElementId:f.id,changedElementType:f.type,undo:()=>{v(X.changedElementId,X.oldValue)},redo:()=>{v(X.changedElementId,X.newValue)}};a(X),v(f.id,O),u(c+1)}break}}},j=O=>{let B=O??1;return B=Math.max(1,Math.ceil((B-y/2)/y))*y,B},L=()=>{b.current=!1,t(!1)},k=()=>{L(),d()},N=()=>{W(p),b.current||(t(!1),u(0))},F=()=>{W(p)},U=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Length",P),rejectedMessage:U,onApply:F,onClose:L,onClickCancel:k,onClickOk:N,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:y,max:100*y,step:y,style:{width:120},precision:2,value:p,onChange:O=>{O!==null&&g(j(O))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Math.round(p/y)+" "+Y.t("solarPanelMenu.PanelsWide",P),h.jsx("br",{}),Y.t("word.MaximumNumber",P),": 100 ",Y.t("solarPanelMenu.Panels",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:R,value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",P)})]})})})]})})},Ufo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(t5),i=H(qr),a=H(En),l=H(zd),s=H(Dd),c=H(no),u=H(Zn),d=H(Vi),f=co(z.SolarPanel),[p,g]=m.useState((f==null?void 0:f.ly)??2),[y,w]=m.useState(0),b=m.useRef(!1),C=m.useRef(),P=Jt();m.useEffect(()=>{if(f){const O=r(f.pvModelName)??r("SPR-X21-335-BLK");w(f.orientation===vr.portrait?O.length:O.width),g(f.ly)}},[f]);const v=(O,B)=>{e(_=>{for(const X of _.elements)if(X.type===z.SolarPanel&&X.id===O&&!X.locked){const $=X,Q=_.getPvModule($.pvModelName);X.ly=me.panelizeLy($,Q,B);break}})},T=(O,B)=>{e(_=>{for(const X of _.elements)if(X.type===z.SolarPanel&&X.foundationId===O&&!X.locked){const $=X,Q=_.getPvModule($.pvModelName);X.ly=me.panelizeLy($,Q,B)}})},A=(O,B,_)=>{e(X=>{for(const $ of X.elements)if($.type===z.SolarPanel&&!$.locked){let Q;if(B?Q=$.parentId===O&&me.isIdentical($.normal,B):Q=$.parentId===O,Q){const le=$,q=X.getPvModule(le.pvModelName);$.ly=me.panelizeLy(le,q,_)}}})},x=O=>{e(B=>{for(const _ of B.elements)if(_.type===z.SolarPanel&&!_.locked){const X=_,$=B.getPvModule(X.pvModelName);_.ly=me.panelizeLy(X,$,O)}})},S=(O,B)=>{H.getState().set(_=>{for(const X of _.elements)if(X.type===z.SolarPanel&&!X.locked&&O.has(X.id)){const $=X,Q=_.getPvModule($.pvModelName);X.ly=me.panelizeLy($,Q,B)}})},R=O=>{s(O.target.value)},M=(O,B)=>{const _=i(O);if(_){if(_.type===z.Cuboid&&!me.isIdentical(O.normal,rs))return!0;const X=JSON.parse(JSON.stringify(O));return X.ly=B,_.type===z.Wall?me.checkElementOnWallState(X,_)===ga.Valid:_.type===z.Roof?me.checkElementOnRoofState(X,_)===ga.Valid:me.isSolarCollectorWithinHorizontalSurface(X,_)}return!1},D=(O,B)=>O.tiltAngle!==0&&.5*B*Math.abs(Math.sin(O.tiltAngle))>O.poleHeight||!M(O,B),E=O=>{if(f){switch(l){case oe.AllSelectedObjectsOfThisType:{for(const B of n)if(B.type===z.SolarPanel&&!B.locked&&H.getState().selectedElementIdSet.has(B.id)&&Math.abs(B.ly-O)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const B of n)if(B.type===z.SolarPanel&&!B.locked&&Math.abs(B.ly-O)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const B of n)if(B.type===z.SolarPanel&&B.foundationId===(f==null?void 0:f.foundationId)&&!B.locked&&Math.abs(B.ly-O)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const B=i(f);if(B){if(B.type===z.Cuboid){for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&me.isIdentical(X.normal,f.normal)&&!X.locked&&Math.abs(X.ly-O)>It)return!0}else for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&!X.locked&&Math.abs(X.ly-O)>It)return!0}break}default:{if(Math.abs((f==null?void 0:f.ly)-O)>It)return!0;break}}return!1}},W=O=>{if(f&&E(O))switch(C.current=void 0,l){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const B of n)if(B.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(B.id)&&D(B,O)){b.current=!0;break}if(b.current)C.current=O,g(f.ly);else{const B=new Map;for(const X of n)X.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(X.id)&&B.set(X.id,X.ly);const _={name:"Set Width for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:B,newValue:O,undo:()=>{for(const[X,$]of _.oldValues.entries())v(X,$)},redo:()=>{S(_.oldValues,_.newValue)}};a(_),S(B,O),u(c+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const B of n)if(B.type===z.SolarPanel&&D(B,O)){b.current=!0;break}if(b.current)C.current=O,g(f.ly);else{const B=new Map;for(const X of n)X.type===z.SolarPanel&&B.set(X.id,X.ly);const _={name:"Set Width for All Solar Panel Arrays",timestamp:Date.now(),oldValues:B,newValue:O,undo:()=>{for(const[X,$]of _.oldValues.entries())v(X,$)},redo:()=>{x(_.newValue)}};a(_),x(O),u(c+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){b.current=!1;for(const B of n)if(B.type===z.SolarPanel&&B.foundationId===f.foundationId&&D(B,O)){b.current=!0;break}if(b.current)C.current=O,g(f.ly);else{const B=new Map;for(const X of n)X.type===z.SolarPanel&&X.foundationId===f.foundationId&&B.set(X.id,X.ly);const _={name:"Set Width for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:B,newValue:O,groupId:f.foundationId,undo:()=>{for(const[X,$]of _.oldValues.entries())v(X,$)},redo:()=>{_.groupId&&T(_.groupId,_.newValue)}};a(_),T(f.foundationId,O),u(c+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const B=i(f);if(B){if(b.current=!1,B.type===z.Cuboid){for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&me.isIdentical(X.normal,f.normal)&&D(X,O)){b.current=!0;break}}else for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&D(X,O)){b.current=!0;break}if(b.current)C.current=O,g(f.ly);else{const X=new Map,$=B.type===z.Cuboid;if($)for(const q of n)q.type===z.SolarPanel&&q.parentId===f.parentId&&me.isIdentical(q.normal,f.normal)&&X.set(q.id,q.ly);else for(const q of n)q.type===z.SolarPanel&&q.parentId===f.parentId&&X.set(q.id,q.ly);const Q=$?f.normal:void 0,le={name:"Set Width for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:X,newValue:O,groupId:f.parentId,normal:Q,undo:()=>{for(const[q,te]of le.oldValues.entries())v(q,te)},redo:()=>{le.groupId&&A(le.groupId,le.normal,le.newValue)}};a(le),A(f.parentId,Q,O),u(c+1)}}break}default:{const B=o(f.id),_=B?B.ly:f.ly;if(b.current=D(f,O),b.current)C.current=O,g(_);else{const X={name:"Set Solar Panel Array Width",timestamp:Date.now(),oldValue:_,newValue:O,changedElementId:f.id,changedElementType:f.type,undo:()=>{v(X.changedElementId,X.oldValue)},redo:()=>{v(X.changedElementId,X.newValue)}};a(X),v(f.id,O),u(c+1)}break}}},j=()=>{b.current=!1,t(!1)},L=()=>{j(),d()},k=()=>{W(p),b.current||(t(!1),u(0))},N=O=>{let B=O??1;return B=Math.max(1,Math.ceil((B-y/2)/y))*y,B},F=()=>{W(p)},U=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Width",P),rejectedMessage:U,onApply:F,onClose:j,onClickCancel:L,onClickOk:k,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:y,max:100*y,step:y,style:{width:120},precision:2,value:p,onChange:O=>{O!==null&&g(N(O))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Math.round(p/y)+" "+Y.t("solarPanelMenu.PanelsLong",P),h.jsx("br",{}),Y.t("word.MaximumNumber",P),": 100 ",Y.t("solarPanelMenu.Panels",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:R,value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",P)})]})})})]})})},jfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(zd),l=H(Dd),s=H(no),c=H(Zn),u=H(S=>S.elements.find(R=>R.selected&&R.type===z.SolarPanel)),[d,f]=m.useState((u==null?void 0:u.inverterEfficiency)??.95),p=Jt(),g=(S,R)=>{e(M=>{for(const D of M.elements)if(D.type===z.SolarPanel&&D.id===S&&!D.locked){D.inverterEfficiency=R;break}})},y=(S,R)=>{e(M=>{for(const D of M.elements)D.type===z.SolarPanel&&D.foundationId===S&&!D.locked&&(D.inverterEfficiency=R)})},w=(S,R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.SolarPanel&&!E.locked){let W;R?W=E.parentId===S&&me.isIdentical(E.normal,R):W=E.parentId===S,W&&(E.inverterEfficiency=M)}})},b=S=>{e(R=>{for(const M of R.elements)M.type===z.SolarPanel&&!M.locked&&(M.inverterEfficiency=S)})},C=(S,R)=>{H.getState().set(M=>{for(const D of M.elements)D.type===z.SolarPanel&&!D.locked&&S.has(D.id)&&(D.inverterEfficiency=R)})},P=S=>{l(S.target.value)},v=S=>{switch(a){case oe.AllSelectedObjectsOfThisType:{for(const R of n)if(R.type===z.SolarPanel&&!R.locked&&H.getState().selectedElementIdSet.has(R.id)&&Math.abs((R.inverterEfficiency??.95)-S)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const R of n)if(R.type===z.SolarPanel&&!R.locked&&Math.abs((R.inverterEfficiency??.95)-S)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const R of n)if(R.type===z.SolarPanel&&R.foundationId===(u==null?void 0:u.foundationId)&&!R.locked&&Math.abs((R.inverterEfficiency??.95)-S)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const R=r(u);if(R){if(R.type===z.Cuboid){for(const D of n)if(D.type===z.SolarPanel&&D.parentId===u.parentId&&me.isIdentical(D.normal,u.normal)&&!D.locked&&Math.abs((D.inverterEfficiency??.95)-S)>It)return!0}else for(const D of n)if(D.type===z.SolarPanel&&D.parentId===u.parentId&&!D.locked&&Math.abs((D.inverterEfficiency??.95)-S)>It)return!0}break}default:{if(Math.abs(((u==null?void 0:u.inverterEfficiency)??.95)-S)>It)return!0;break}}return!1},T=S=>{if(u&&v(S))switch(a){case oe.AllSelectedObjectsOfThisType:{const R=new Map;for(const D of n)D.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(D.id)&&R.set(D.id,D.inverterEfficiency??.95);const M={name:"Set Inverter Efficiency for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{C(M.oldValues,M.newValue)}};i(M),C(R,S),c(s+1);break}case oe.AllObjectsOfThisType:{const R=new Map;for(const D of n)D.type===z.SolarPanel&&R.set(D.id,D.inverterEfficiency??.95);const M={name:"Set Inverter Efficiency for All Solar Panel Arrays",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{b(M.newValue)}};i(M),b(S),c(s+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const R=new Map;for(const D of n)D.type===z.SolarPanel&&D.foundationId===u.foundationId&&R.set(D.id,D.inverterEfficiency??.95);const M={name:"Set Inverter Efficiency for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:R,newValue:S,groupId:u.foundationId,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{M.groupId&&y(M.groupId,M.newValue)}};i(M),y(u.foundationId,S),c(s+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{const R=r(u);if(R){const M=new Map,D=R.type===z.Cuboid;if(D)for(const j of n)j.type===z.SolarPanel&&j.parentId===u.parentId&&me.isIdentical(j.normal,u.normal)&&M.set(j.id,j.inverterEfficiency??.95);else for(const j of n)j.type===z.SolarPanel&&j.parentId===u.parentId&&M.set(j.id,j.inverterEfficiency??.95);const E=D?u.normal:void 0,W={name:"Set Inverter Efficiency for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:M,newValue:S,groupId:u.parentId,normal:E,undo:()=>{for(const[j,L]of W.oldValues.entries())g(j,L)},redo:()=>{W.groupId&&w(W.groupId,W.normal,W.newValue)}};i(W),w(u.parentId,E,S),c(s+1)}break}default:{const R=o(u.id),M=R?R.inverterEfficiency??.95:u.inverterEfficiency??.95,D={name:"Set Solar Panel Array Inverter Efficiency",timestamp:Date.now(),oldValue:M,newValue:S,changedElementId:u.id,changedElementType:u.type,undo:()=>{g(D.changedElementId,D.oldValue)},redo:()=>{g(D.changedElementId,D.newValue)}};i(D),g(u.id,S),c(s+1);break}}},A=()=>{t(!1)},x=()=>{T(d)};return h.jsx(so,{width:550,title:Y.t("solarPanelMenu.InverterEfficiency",p),onApply:x,onClose:A,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.5,max:1,step:.01,style:{width:120},precision:2,value:d,onChange:S=>{S!==null&&f(S)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:["[0.5, 1.0]",h.jsx("br",{}),Y.t("solarPanelMenu.InverterEfficiencyExplained",p)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",p)})]})})})]})})},Bfo=({setDialogVisible:t})=>{const e=H(fn),n=H(s0),o=H(Kn),r=H(Gn),i=H(qr),a=H(En),l=H(zd),s=H(Dd),c=H(no),u=H(Zn),d=H(Vi),f=H(F=>F.elements.find(U=>U.selected&&U.type===z.SolarPanel)),[p,g]=m.useState(!1),[y,w]=m.useState(!1),[b,C]=m.useState({left:0,top:0,bottom:0,right:0}),P=m.useRef(null),v=m.useRef((f==null?void 0:f.dcToAcRatio)??1),T={lng:n};m.useEffect(()=>{f&&(v.current=f.dcToAcRatio??1)},[f.dcToAcRatio]);const A=(F,U)=>{e(O=>{for(const B of O.elements)if(B.type===z.SolarPanel&&B.id===F&&!B.locked){B.dcToAcRatio=U;break}})},x=(F,U)=>{e(O=>{for(const B of O.elements)B.type===z.SolarPanel&&B.foundationId===F&&!B.locked&&(B.dcToAcRatio=U)})},S=(F,U,O)=>{e(B=>{for(const _ of B.elements)if(_.type===z.SolarPanel&&!_.locked){let X;U?X=_.parentId===F&&me.isIdentical(_.normal,U):X=_.parentId===F,X&&(_.dcToAcRatio=O)}})},R=F=>{e(U=>{for(const O of U.elements)O.type===z.SolarPanel&&!O.locked&&(O.dcToAcRatio=F)})},M=(F,U)=>{H.getState().set(O=>{for(const B of O.elements)B.type===z.SolarPanel&&!B.locked&&F.has(B.id)&&(B.dcToAcRatio=U)})},D=F=>{s(F.target.value),g(!p)},E=F=>{switch(l){case oe.AllSelectedObjectsOfThisType:{for(const U of o)if(U.type===z.SolarPanel&&!U.locked&&H.getState().selectedElementIdSet.has(U.id)&&Math.abs((U.dcToAcRatio??1)-F)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const U of o)if(U.type===z.SolarPanel&&!U.locked&&Math.abs((U.dcToAcRatio??1)-F)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const U of o)if(U.type===z.SolarPanel&&U.foundationId===(f==null?void 0:f.foundationId)&&!U.locked&&Math.abs((U.dcToAcRatio??1)-F)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const U=i(f);if(U){if(U.type===z.Cuboid){for(const B of o)if(B.type===z.SolarPanel&&B.parentId===f.parentId&&me.isIdentical(B.normal,f.normal)&&!B.locked&&Math.abs((B.dcToAcRatio??1)-F)>It)return!0}else for(const B of o)if(B.type===z.SolarPanel&&B.parentId===f.parentId&&!B.locked&&Math.abs((B.dcToAcRatio??1)-F)>It)return!0}break}default:{if(Math.abs(((f==null?void 0:f.dcToAcRatio)??1)-F)>It)return!0;break}}return!1},W=F=>{if(f&&E(F)){switch(l){case oe.AllSelectedObjectsOfThisType:{const U=new Map;for(const B of o)B.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(B.id)&&U.set(B.id,B.dcToAcRatio??1);const O={name:"Set DC-AC Ratio for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())A(B,_)},redo:()=>{M(O.oldValues,O.newValue)}};a(O),M(U,F),u(c+1);break}case oe.AllObjectsOfThisType:{const U=new Map;for(const B of o)B.type===z.SolarPanel&&U.set(B.id,B.dcToAcRatio??1);const O={name:"Set DC-AC Ratio for All Solar Panel Arrays",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())A(B,_)},redo:()=>{R(O.newValue)}};a(O),R(F),u(c+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const U=new Map;for(const B of o)B.type===z.SolarPanel&&B.foundationId===f.foundationId&&U.set(B.id,B.dcToAcRatio??1);const O={name:"Set DC-AC Ratio for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:U,newValue:F,groupId:f.foundationId,undo:()=>{for(const[B,_]of O.oldValues.entries())A(B,_)},redo:()=>{O.groupId&&x(O.groupId,O.newValue)}};a(O),x(f.foundationId,F),u(c+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{const U=i(f);if(U){const O=new Map,B=U.type===z.Cuboid;if(B)for(const $ of o)$.type===z.SolarPanel&&$.parentId===f.parentId&&me.isIdentical($.normal,f.normal)&&O.set($.id,$.dcToAcRatio??1);else for(const $ of o)$.type===z.SolarPanel&&$.parentId===f.parentId&&O.set($.id,$.dcToAcRatio??1);const _=B?f.normal:void 0,X={name:"Set DC-AC Ratio for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:O,newValue:F,groupId:f.parentId,normal:_,undo:()=>{for(const[$,Q]of X.oldValues.entries())A($,Q)},redo:()=>{X.groupId&&S(X.groupId,X.normal,X.newValue)}};a(X),S(f.parentId,_,F),u(c+1)}break}default:{const U=r(f.id),O=U?U.dcToAcRatio??1:f.dcToAcRatio??1,B={name:"Set Solar Panel Array DC-AC Ratio",timestamp:Date.now(),oldValue:O,newValue:F,changedElementId:f.id,changedElementType:f.type,undo:()=>{A(B.changedElementId,B.oldValue)},redo:()=>{A(B.changedElementId,B.newValue)}};a(B),A(f.id,F),u(c+1);break}}g(!p)}},j=(F,U)=>{if(P.current){const{clientWidth:O,clientHeight:B}=window.document.documentElement,_=P.current.getBoundingClientRect();C({left:-_.left+U.x,right:O-(_.right-U.x),top:-_.top+U.y,bottom:B-((_==null?void 0:_.bottom)-U.y)})}},L=()=>{v.current=f.dcToAcRatio??1,t(!1)},k=()=>{L(),d()},N=()=>{W(v.current),t(!1),u(0)};return h.jsx(h.Fragment,{children:h.jsx(Oi,{width:550,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>w(!0),onMouseOut:()=>w(!1),children:Y.t("solarPanelMenu.DcToAcSizeRatio",T)}),footer:[h.jsx(lo,{onClick:()=>{W(v.current)},children:Y.t("word.Apply",T)},"Apply"),h.jsx(lo,{onClick:k,children:Y.t("word.Cancel",T)},"Cancel"),h.jsx(lo,{type:"primary",onClick:N,children:Y.t("word.OK",T)},"OK")],onCancel:L,maskClosable:!1,destroyOnClose:!1,modalRender:F=>h.jsx(_i,{disabled:!y,bounds:b,onStart:(U,O)=>j(U,O),children:h.jsx("div",{ref:P,children:F})}),children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:2,step:.01,style:{width:120},precision:2,value:v.current,onChange:F=>{F!==null&&(v.current=F,g(!p))},onPressEnter:N}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:["[1.0, 2.0]",h.jsx("br",{}),Y.t("solarPanelMenu.DcToAcSizeRatioExplained",T)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:D,value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",T)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",T)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",T)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",T)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",T)})]})})})]})})})},MHe=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(aYe),i=H(qr),a=H(En),l=H(zd),s=H(Dd),c=H(no),u=H(Zn),d=H(Vi),f=co(z.SolarPanel),p=(f==null?void 0:f.tiltAngle)??0,g=(f==null?void 0:f.parentType)===z.Wall,[y,w]=m.useState(g?-p:p),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=(k,N,F)=>{e(U=>{for(const O of U.elements)if(O.type===z.SolarPanel&&O.foundationId===k&&!O.locked){const B=O;B.parentType===z.Wall?B.tiltAngle=Math.min(0,F?-N:N):B.tiltAngle=N}})},T=(k,N,F)=>{e(U=>{for(const O of U.elements)if(O.type===z.SolarPanel&&!O.locked){let B;if(N?B=O.parentId===k&&me.isIdentical(O.normal,N):B=O.parentId===k,B){const _=O;_.tiltAngle=F}}})},A=(k,N)=>{e(F=>{for(const U of F.elements)if(U.type===z.SolarPanel&&!U.locked){const O=U;O.parentType===z.Wall?O.tiltAngle=Math.min(0,N?-k:k):O.tiltAngle=k}})},x=(k,N,F)=>{H.getState().set(U=>{for(const O of U.elements)if(O.type===z.SolarPanel&&!O.locked&&k.has(O.id)){const B=O;B.parentType===z.Wall?B.tiltAngle=Math.min(0,F?-N:N):B.tiltAngle=N}})},S=k=>{s(k.target.value)},R=k=>{if(f){switch(l){case oe.AllSelectedObjectsOfThisType:{for(const N of n)if(N.type===z.SolarPanel&&!N.locked&&H.getState().selectedElementIdSet.has(N.id)&&Math.abs(N.tiltAngle-k)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const N of n)if(N.type===z.SolarPanel&&!N.locked&&Math.abs(N.tiltAngle-k)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const N of n)if(N.type===z.SolarPanel&&N.foundationId===(f==null?void 0:f.foundationId)&&!N.locked&&Math.abs(N.tiltAngle-k)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const N=i(f);if(N){if(N.type===z.Cuboid){for(const U of n)if(U.type===z.SolarPanel&&U.parentId===f.parentId&&me.isIdentical(U.normal,f.normal)&&!U.locked&&Math.abs(U.tiltAngle-k)>It)return!0}else for(const U of n)if(U.type===z.SolarPanel&&U.parentId===f.parentId&&!U.locked&&Math.abs(U.tiltAngle-k)>It)return!0}break}default:{if(Math.abs((f==null?void 0:f.tiltAngle)-k)>It)return!0;break}}return!1}},M=k=>{if(g&&(k=-k),!!f&&R(k)){switch(C.current=void 0,l){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const N of n)if(N.type===z.SolarPanel&&N.parentType!==z.Wall&&H.getState().selectedElementIdSet.has(N.id)&&.5*N.ly*Math.abs(Math.sin(k))>N.poleHeight){b.current=!0;break}if(b.current)C.current=k,w(f.tiltAngle);else{const N=new Map;for(const U of n)U.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(U.id)&&N.set(U.id,U.tiltAngle);const F={name:"Set Tilt Angle for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,O)},redo:()=>{x(F.oldValues,F.newValue,!g)}};a(F),x(N,k,!g),u(c+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const N of n)if(N.type===z.SolarPanel&&N.parentType!==z.Wall&&.5*N.ly*Math.abs(Math.sin(k))>N.poleHeight){b.current=!0;break}if(b.current)C.current=k,w(f.tiltAngle);else{const N=new Map;for(const U of n)U.type===z.SolarPanel&&N.set(U.id,U.tiltAngle);const F={name:"Set Tilt Angle for All Solar Panel Arrays",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,O)},redo:()=>{A(F.newValue,!g)}};a(F),A(k,!g),u(c+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){b.current=!1;for(const N of n)if(N.type===z.SolarPanel&&N.foundationId===f.foundationId&&N.parentType!==z.Wall&&.5*N.ly*Math.abs(Math.sin(k))>N.poleHeight){b.current=!0;break}if(b.current)C.current=k,w(f.tiltAngle);else{const N=new Map;for(const U of n)U.type===z.SolarPanel&&U.foundationId===f.foundationId&&N.set(U.id,U.tiltAngle);const F={name:"Set Tilt Angle for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:N,newValue:k,groupId:f.foundationId,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,O)},redo:()=>{F.groupId&&v(F.groupId,F.newValue,!g)}};a(F),v(f.foundationId,k,!g),u(c+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const N=i(f);if(N){b.current=!1;const F=N.type===z.Cuboid;if(F){for(const U of n)if(U.type===z.SolarPanel&&U.parentId===f.parentId&&me.isIdentical(U.normal,f.normal)&&.5*U.ly*Math.abs(Math.sin(k))>U.poleHeight){b.current=!0;break}}else if(f.parentType===z.Wall)b.current=!1;else for(const U of n)if(U.type===z.SolarPanel&&U.parentId===f.parentId&&.5*U.ly*Math.abs(Math.sin(k))>U.poleHeight){b.current=!0;break}if(b.current)C.current=k,w(f.tiltAngle);else{const U=new Map;if(F)for(const _ of n)_.type===z.SolarPanel&&_.parentId===f.parentId&&me.isIdentical(_.normal,f.normal)&&U.set(_.id,_.tiltAngle);else for(const _ of n)_.type===z.SolarPanel&&_.parentId===f.parentId&&U.set(_.id,_.tiltAngle);const O=F?f.normal:void 0,B={name:"Set Tilt Angle for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:U,newValue:k,groupId:f.parentId,normal:O,undo:()=>{for(const[_,X]of B.oldValues.entries())r(_,X)},redo:()=>{B.groupId&&T(B.groupId,B.normal,B.newValue)}};a(B),T(f.parentId,O,k),u(c+1)}}break}default:{const N=o(f.id),F=N?N.tiltAngle:f.tiltAngle;if(b.current=.5*f.ly*Math.abs(Math.sin(k))>f.poleHeight,f.parentType===z.Wall&&(b.current=!1),b.current)C.current=k,w(F);else{const U={name:"Set Solar Panel Array Tilt Angle",timestamp:Date.now(),oldValue:F,newValue:k,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(U.changedElementId,U.oldValue)},redo:()=>{r(U.changedElementId,U.newValue)}};a(U),r(f.id,k),u(c+1)}break}}e(N=>{N.actionState.solarPanelTiltAngle=k})}},D=()=>{b.current=!1,t(!1)},E=()=>{D(),d()},W=()=>{M(y),b.current||(t(!1),u(0))},j=()=>{M(y)},L=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+me.toDegrees(C.current).toFixed(1)+"°)":null):null;return h.jsx(so,{width:550,title:Y.t("solarPanelMenu.TiltAngle",P),rejectedMessage:L,onApply:j,onClose:D,onClickCancel:E,onClickOk:W,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:g?0:-90,max:90,style:{width:120},precision:2,value:parseFloat(me.toDegrees(y).toFixed(2)),step:1,formatter:k=>`${k}°`,onChange:k=>{k!==null&&w(me.toRadians(k))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",P),": [",g?"0°":"-90°",", 90°]",h.jsx("br",{}),Y.t("solarPanelMenu.SouthFacingIsPositive",P)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:18,children:h.jsx(Ue.Group,{onChange:S,value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",P)})]})})})]})})},Yfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(Xq),i=H(uYe),a=H(dYe),l=H(fYe),s=H(qr),c=H(En),u=H(zd),d=H(Dd),f=H(no),p=H(Zn),g=H(Vi),y=co(z.SolarPanel),w=m.useRef(!1),b=m.useRef(),[C,P]=m.useState(y?-y.relativeAzimuth:0),v=Jt(),T=k=>{d(k.target.value)},A=(k,N)=>{const F=s(k);if(F){if(F.type===z.Cuboid&&!me.isIdentical(k.normal,rs))return!0;const U=JSON.parse(JSON.stringify(k));return U.relativeAzimuth=-N,F.type===z.Roof?me.checkElementOnRoofState(U,F)===ga.Valid:me.isSolarCollectorWithinHorizontalSurface(U,F)}return!1},x=(k,N)=>!A(k,N),S=k=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:for(const N of n)if(N.type===z.SolarPanel&&!N.locked&&N.parentType!==z.Wall&&H.getState().selectedElementIdSet.has(N.id)&&Math.abs(-N.relativeAzimuth-k)>It)return!0;break;case oe.AllObjectsOfThisType:for(const N of n)if(N.type===z.SolarPanel&&!N.locked&&N.parentType!==z.Wall&&Math.abs(-N.relativeAzimuth-k)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const N of n)if(N.type===z.SolarPanel&&N.foundationId===(y==null?void 0:y.foundationId)&&!N.locked&&N.parentType!==z.Wall&&Math.abs(-N.relativeAzimuth-k)>It)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:if(y!=null&&y.parentId){const N=s(y);if(N){if(N.type===z.Cuboid){for(const U of n)if(U.type===z.SolarPanel&&U.parentId===y.parentId&&me.isIdentical(U.normal,y.normal)&&!U.locked&&Math.abs(-U.relativeAzimuth-k)>It)return!0}else for(const U of n)if(U.type===z.SolarPanel&&U.parentId===y.parentId&&!U.locked&&Math.abs(-U.relativeAzimuth-k)>It)return!0}}break;default:if(Math.abs(-(y==null?void 0:y.relativeAzimuth)-k)>It)return!0}return!1}},R=(k,N)=>{H.getState().set(F=>{for(const U of F.elements)if(U.type===z.SolarPanel&&!U.locked&&k.has(U.id)){const O=U;O.relativeAzimuth=N}})},M=k=>{if(y&&S(k)){switch(b.current=void 0,u){case oe.AllSelectedObjectsOfThisType:{w.current=!1;for(const N of n)if(N.type===z.SolarPanel&&N.parentType!==z.Wall&&H.getState().selectedElementIdSet.has(N.id)&&x(N,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const N=new Map;for(const U of n)U.type===z.SolarPanel&&U.parentType!==z.Wall&&H.getState().selectedElementIdSet.has(U.id)&&N.set(U.id,-U.relativeAzimuth);const F={name:"Set Relative Azimuth for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,-O)},redo:()=>{R(F.oldValues,F.newValue)}};c(F),R(N,-k),p(f+1)}break}case oe.AllObjectsOfThisType:{w.current=!1;for(const N of n)if(N.type===z.SolarPanel&&N.parentType!==z.Wall&&x(N,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const N=new Map;for(const U of n)U.type===z.SolarPanel&&U.parentType!==z.Wall&&N.set(U.id,-U.relativeAzimuth);const F={name:"Set Relative Azimuth for All Solar Panel Arrays",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,-O)},redo:()=>{l(z.SolarPanel,-F.newValue)}};c(F),l(z.SolarPanel,-k),p(f+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(y.foundationId){w.current=!1;for(const N of n)if(N.type===z.SolarPanel&&N.foundationId===y.foundationId&&N.parentType!==z.Wall&&x(N,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const N=new Map;for(const U of n)U.type===z.SolarPanel&&U.foundationId===y.foundationId&&U.parentType!==z.Wall&&N.set(U.id,-U.relativeAzimuth);const F={name:"Set Relative Azimuth for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:N,newValue:k,groupId:y.foundationId,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,-O)},redo:()=>{F.groupId&&a(z.SolarPanel,F.groupId,-F.newValue)}};c(F),a(z.SolarPanel,y.foundationId,-k),p(f+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{if(y.parentId){const N=s(y);if(N){if(w.current=!1,N.type===z.Cuboid){for(const U of n)if(U.type===z.SolarPanel&&U.parentId===y.parentId&&me.isIdentical(U.normal,y.normal)&&x(U,k)){w.current=!0;break}}else for(const U of n)if(U.type===z.SolarPanel&&U.parentId===y.parentId&&x(U,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const U=new Map,O=N.type===z.Cuboid;if(O)for(const X of n)X.type===z.SolarPanel&&X.parentId===y.parentId&&me.isIdentical(X.normal,y.normal)&&U.set(X.id,-X.relativeAzimuth);else for(const X of n)X.type===z.SolarPanel&&X.parentId===y.parentId&&U.set(X.id,-X.relativeAzimuth);const B=O?y.normal:void 0,_={name:"Set Relative Azimuth for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:U,newValue:k,groupId:y.parentId,normal:B,undo:()=>{for(const[X,$]of _.oldValues.entries())r(X,-$)},redo:()=>{_.groupId&&i(z.SolarPanel,_.groupId,_.normal,-_.newValue)}};c(_),i(z.SolarPanel,y.parentId,B,-k),p(f+1)}}}break}default:{const N=o(y.id),F=N?-N.relativeAzimuth:-y.relativeAzimuth;if(w.current=x(y,k),w.current)b.current=k,P(F);else{const U={name:"Set Solar Panel Array Relative Azimuth",timestamp:Date.now(),oldValue:F,newValue:k,changedElementId:y.id,changedElementType:y.type,undo:()=>{r(U.changedElementId,-U.oldValue)},redo:()=>{r(U.changedElementId,-U.newValue)}};c(U),r(y.id,-k),p(f+1)}break}}e(N=>{N.actionState.solarPanelRelativeAzimuth=-k})}},D=()=>{w.current=!1,t(!1)},E=()=>{D(),g()},W=()=>{M(C),w.current||(t(!1),p(0))},j=()=>{M(C)},L=w.current?": "+Y.t("message.NotApplicableToSelectedAction",v)+(b.current!==void 0?" ("+me.toDegrees(b.current).toFixed(1)+"°)":null):null;return h.jsx(so,{width:550,title:Y.t("solarCollectorMenu.RelativeAzimuth",v),rejectedMessage:L,onApply:j,onClose:D,onClickCancel:E,onClickOk:W,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:-180,max:180,style:{width:120},precision:2,step:1,value:parseFloat(me.toDegrees(C).toFixed(2)),formatter:k=>`${k}°`,onChange:k=>{k!==null&&P(me.toRadians(k))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",v),": [-180°, 180°]",h.jsx("br",{}),Y.t("message.AzimuthOfNorthIsZero",v),h.jsx("br",{}),Y.t("message.CounterclockwiseAzimuthIsPositive",v)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:18,children:h.jsx(Ue.Group,{onChange:T,value:u,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",v)})]})})})]})})},Ofo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(zd),l=H(Dd),s=H(no),c=H(Zn),u=co(),[d,f]=m.useState((u==null?void 0:u.trackerType)??za.NO_TRACKER),p=Jt(),{Option:g}=_o,y=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.SolarPanel&&E.id===R&&!E.locked){E.trackerType=M;break}})},w=(R,M)=>{e(D=>{for(const E of D.elements)E.type===z.SolarPanel&&E.foundationId===R&&!E.locked&&(E.trackerType=M)})},b=(R,M,D)=>{e(E=>{for(const W of E.elements)if(W.type===z.SolarPanel&&!W.locked){let j;M?j=W.parentId===R&&me.isIdentical(W.normal,M):j=W.parentId===R,j&&(W.trackerType=D)}})},C=R=>{e(M=>{for(const D of M.elements)D.type===z.SolarPanel&&!D.locked&&(D.trackerType=R)})},P=(R,M)=>{H.getState().set(D=>{for(const E of D.elements)E.type===z.SolarPanel&&!E.locked&&R.has(E.id)&&(E.trackerType=M)})},v=R=>{l(R.target.value)},T=R=>{if(u){switch(a){case oe.AllSelectedObjectsOfThisType:{for(const M of n)if(M.type===z.SolarPanel&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&M.trackerType!==R)return!0;break}case oe.AllObjectsOfThisType:{for(const M of n)if(M.type===z.SolarPanel&&!M.locked&&M.trackerType!==R)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const M of n)if(M.type===z.SolarPanel&&M.foundationId===(u==null?void 0:u.foundationId)&&!M.locked&&M.trackerType!==R)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const M=r(u);if(M){if(M.type===z.Cuboid){for(const E of n)if(E.type===z.SolarPanel&&E.parentId===u.parentId&&me.isIdentical(E.normal,u.normal)&&!E.locked&&E.trackerType!==R)return!0}else for(const E of n)if(E.type===z.SolarPanel&&E.parentId===u.parentId&&!E.locked&&E.trackerType!==R)return!0}break}default:{if((u==null?void 0:u.trackerType)!==R)return!0;break}}return!1}},A=R=>{if(u&&T(R))switch(a){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E.trackerType);const D={name:"Set Tracker Type for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{P(D.oldValues,D.newValue)}};i(D),P(M,R),c(s+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.SolarPanel&&M.set(E.id,E.trackerType);const D={name:"Set Tracker Type for All Solar Panel Arrays",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{C(D.newValue)}};i(D),C(R),c(s+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const M=new Map;for(const E of n)E.type===z.SolarPanel&&E.foundationId===u.foundationId&&M.set(E.id,E.trackerType);const D={name:"Set Tracker Type for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:M,newValue:R,groupId:u.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{D.groupId&&w(D.groupId,D.newValue)}};i(D),w(u.foundationId,R),c(s+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{const M=r(u);if(M){const D=new Map,E=M.type===z.Cuboid;if(E)for(const L of n)L.type===z.SolarPanel&&L.parentId===u.parentId&&me.isIdentical(L.normal,u.normal)&&D.set(L.id,L.trackerType);else for(const L of n)L.type===z.SolarPanel&&L.parentId===u.parentId&&D.set(L.id,L.trackerType);const W=E?u.normal:void 0,j={name:"Set Tracker Type for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:D,newValue:R,groupId:u.parentId,normal:W,undo:()=>{for(const[L,k]of j.oldValues.entries())y(L,k)},redo:()=>{j.groupId&&b(j.groupId,j.normal,j.newValue)}};i(j),b(u.parentId,W,R),c(s+1)}break}default:{const M=o(u.id),D=M?M.trackerType:u.trackerType,E={name:"Set Solar Panel Array Tracker Type",timestamp:Date.now(),oldValue:D,newValue:R,changedElementId:u.id,changedElementType:u.type,undo:()=>{y(E.changedElementId,E.oldValue)},redo:()=>{y(E.changedElementId,E.newValue)}};i(E),y(u.id,R),c(s+1);break}}},x=()=>{t(!1)},S=()=>{A(d)};return h.jsx(so,{width:550,title:Y.t("solarPanelMenu.Tracker",p),onApply:S,onClose:x,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsxs(_o,{style:{width:"120px"},value:d,onChange:R=>f(R),children:[h.jsx(g,{value:za.NO_TRACKER,title:Y.t("solarPanelMenu.NoTracker",p),children:Y.t("word.None",p)},"NONE"),h.jsx(g,{value:za.HORIZONTAL_SINGLE_AXIS_TRACKER,title:Y.t("solarPanelMenu.HorizontalSingleAxisTracker",p),children:"HSAT"},"HSAT"),h.jsx(g,{value:za.VERTICAL_SINGLE_AXIS_TRACKER,title:Y.t("solarPanelMenu.VerticalSingleAxisTracker",p),children:"VSAT"},"VSAT"),h.jsx(g,{value:za.ALTAZIMUTH_DUAL_AXIS_TRACKER,title:Y.t("solarPanelMenu.AltazimuthDualAxisTracker",p),children:"AADAT"},"AADAT")]}),h.jsx("div",{style:{paddingTop:"20px",paddingRight:"10px",textAlign:"left",fontSize:"11px"},children:Y.t("solarPanelMenu.SolarTrackerFollowsSun",p)})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",p)})]})})})]})})},_fo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(zd),l=H(Dd),s=H(no),c=H(Zn),u=co(z.SolarPanel),[d,f]=m.useState((u==null?void 0:u.frameColor)??"white"),p=Jt(),g=(S,R)=>{e(M=>{for(const D of M.elements)if(D.type===z.SolarPanel&&D.id===S&&!D.locked){D.frameColor=R;break}})},y=(S,R)=>{e(M=>{for(const D of M.elements)D.type===z.SolarPanel&&D.foundationId===S&&!D.locked&&(D.frameColor=R)})},w=(S,R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.SolarPanel&&!E.locked){let W;R?W=E.parentId===S&&me.isIdentical(E.normal,R):W=E.parentId===S,W&&(E.frameColor=M)}})},b=S=>{e(R=>{for(const M of R.elements)M.type===z.SolarPanel&&!M.locked&&(M.frameColor=S)})},C=(S,R)=>{H.getState().set(M=>{for(const D of M.elements)D.type===z.SolarPanel&&!D.locked&&S.has(D.id)&&(D.frameColor=R)})},P=S=>{l(S.target.value)},v=S=>{if(u){switch(a){case oe.AllSelectedObjectsOfThisType:{for(const R of n)if(R.type===z.SolarPanel&&!R.locked&&H.getState().selectedElementIdSet.has(R.id)&&R.frameColor!==S)return!0;break}case oe.AllObjectsOfThisType:{for(const R of n)if(R.type===z.SolarPanel&&!R.locked&&R.frameColor!==S)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const R of n)if(R.type===z.SolarPanel&&R.foundationId===(u==null?void 0:u.foundationId)&&!R.locked&&R.frameColor!==S)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const R=r(u);if(R){if(R.type===z.Cuboid){for(const D of n)if(D.type===z.SolarPanel&&D.parentId===u.parentId&&me.isIdentical(D.normal,u.normal)&&!D.locked&&D.frameColor!==S)return!0}else for(const D of n)if(D.type===z.SolarPanel&&D.parentId===u.parentId&&!D.locked&&D.frameColor!==S)return!0}break}default:{if((u==null?void 0:u.frameColor)!==S)return!0;break}}return!1}},T=S=>{if(u&&v(S)){switch(a){case oe.AllSelectedObjectsOfThisType:{const R=new Map;for(const D of n)D.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(D.id)&&R.set(D.id,D.frameColor??"white");const M={name:"Set Frame Color for Selected Solar Panels",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{C(M.oldValues,M.newValue)}};i(M),C(R,S),c(s+1);break}case oe.AllObjectsOfThisType:{const R=new Map;for(const D of n)D.type===z.SolarPanel&&R.set(D.id,D.frameColor??"white");const M={name:"Set Frame Color for All Solar Panels",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{b(M.newValue)}};i(M),b(S),c(s+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const R=new Map;for(const D of n)D.type===z.SolarPanel&&D.foundationId===u.foundationId&&R.set(D.id,D.frameColor??"white");const M={name:"Set Frame Color for All Solar Panels Above Foundation",timestamp:Date.now(),oldValues:R,newValue:S,groupId:u.foundationId,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{M.groupId&&y(M.groupId,M.newValue)}};i(M),y(u.foundationId,S),c(s+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{const R=r(u);if(R){const M=new Map,D=R.type===z.Cuboid;if(D)for(const j of n)j.type===z.SolarPanel&&j.parentId===u.parentId&&me.isIdentical(j.normal,u.normal)&&M.set(j.id,j.frameColor??"white");else for(const j of n)j.type===z.SolarPanel&&j.parentId===u.parentId&&M.set(j.id,j.frameColor??"white");const E=D?u.normal:void 0,W={name:"Set Frame Color for All Solar Panels on Surface",timestamp:Date.now(),oldValues:M,newValue:S,groupId:u.parentId,normal:E,undo:()=>{for(const[j,L]of W.oldValues.entries())g(j,L)},redo:()=>{W.groupId&&w(W.groupId,W.normal,W.newValue)}};i(W),w(u.parentId,E,S),c(s+1)}break}default:{const R=o(u.id),M=R?R.frameColor:u.frameColor,D={name:"Set Frame Color of Selected Solar Panel",timestamp:Date.now(),oldValue:M,newValue:S,changedElementId:u.id,changedElementType:u.type,undo:()=>{g(u.id,D.oldValue)},redo:()=>{g(u.id,D.newValue)}};i(D),g(u.id,S),c(s+1);break}}e(R=>{R.actionState.solarPanelFrameColor=S})}},A=()=>{t(!1)},x=()=>{T(d)};return h.jsx(so,{width:680,title:Y.t("solarPanelMenu.FrameColor",p),onApply:x,onClose:A,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:10,children:h.jsx(zf,{color:d??(u==null?void 0:u.color)??"white",onChangeComplete:S=>{f(S.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:14,children:h.jsx(Ue.Group,{onChange:P,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",p)})]})})})]})})},Vfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(wW),i=H(i7t),a=H(vW),l=H(xW),s=H(qr),c=H(En),u=H(zd),d=H(Dd),f=H(no),p=H(Zn),g=H(Vi),y=co(z.SolarPanel),[w,b]=m.useState((y==null?void 0:y.poleHeight)??0),C=m.useRef(!1),P=m.useRef(),v=Jt(),T=j=>{d(j.target.value)},A=j=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:{for(const L of n)if(L.type===z.SolarPanel&&!L.locked&&H.getState().selectedElementIdSet.has(L.id)&&Math.abs(L.poleHeight-j)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const L of n)if(L.type===z.SolarPanel&&!L.locked&&Math.abs(L.poleHeight-j)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const L of n)if(L.type===z.SolarPanel&&L.foundationId===(y==null?void 0:y.foundationId)&&!L.locked&&Math.abs(L.poleHeight-j)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const L=s(y);if(L){if(L.type===z.Cuboid){for(const N of n)if(N.type===z.SolarPanel&&N.parentId===y.parentId&&me.isIdentical(N.normal,y.normal)&&!N.locked&&Math.abs(N.poleHeight-j)>It)return!0}else for(const N of n)if(N.type===z.SolarPanel&&N.parentId===y.parentId&&!N.locked&&Math.abs(N.poleHeight-j)>It)return!0}break}default:{if(Math.abs((y==null?void 0:y.poleHeight)-j)>It)return!0;break}}return!1}},x=(j,L)=>{H.getState().set(k=>{for(const N of k.elements)if(N.type===z.SolarPanel&&!N.locked&&j.has(N.id)){const F=N;F.poleHeight=L}})},S=j=>{if(y&&A(j)){switch(P.current=void 0,u){case oe.AllSelectedObjectsOfThisType:{C.current=!1;for(const L of n)if(L.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(L.id)&&.5*L.ly*Math.abs(Math.sin(L.tiltAngle))>j){C.current=!0;break}if(C.current)P.current=j,b(y.poleHeight);else{const L=new Map;for(const N of n)N.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(N.id)&&L.set(N.id,N.poleHeight);const k={name:"Set Pole Height for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:L,newValue:j,undo:()=>{for(const[N,F]of k.oldValues.entries())r(N,F)},redo:()=>{x(k.oldValues,k.newValue)}};c(k),x(L,j),p(f+1)}break}case oe.AllObjectsOfThisType:{C.current=!1;for(const L of n)if(L.type===z.SolarPanel&&.5*L.ly*Math.abs(Math.sin(L.tiltAngle))>j){C.current=!0;break}if(C.current)P.current=j,b(y.poleHeight);else{const L=new Map;for(const N of n)N.type===z.SolarPanel&&L.set(N.id,N.poleHeight);const k={name:"Set Pole Height for All Solar Panel Arrays",timestamp:Date.now(),oldValues:L,newValue:j,undo:()=>{for(const[N,F]of k.oldValues.entries())r(N,F)},redo:()=>{l(z.SolarPanel,k.newValue)}};c(k),l(z.SolarPanel,j),p(f+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(y.foundationId){C.current=!1;for(const L of n)if(L.type===z.SolarPanel&&L.foundationId===y.foundationId&&.5*L.ly*Math.abs(Math.sin(L.tiltAngle))>j){C.current=!0;break}if(C.current)P.current=j,b(y.poleHeight);else{const L=new Map;for(const N of n)N.type===z.SolarPanel&&N.foundationId===y.foundationId&&L.set(N.id,N.poleHeight);const k={name:"Set Pole Height for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:L,newValue:j,groupId:y.foundationId,undo:()=>{for(const[N,F]of k.oldValues.entries())r(N,F)},redo:()=>{k.groupId&&a(z.SolarPanel,k.groupId,k.newValue)}};c(k),a(z.SolarPanel,y.foundationId,j),p(f+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const L=s(y);if(L){if(C.current=!1,L.type===z.Cuboid){for(const N of n)if(N.type===z.SolarPanel&&N.parentId===y.parentId&&me.isIdentical(N.normal,y.normal)&&.5*N.ly*Math.abs(Math.sin(N.tiltAngle))>j){C.current=!0;break}}else for(const N of n)if(N.type===z.SolarPanel&&N.parentId===y.parentId&&.5*N.ly*Math.abs(Math.sin(N.tiltAngle))>j){C.current=!0;break}if(C.current)P.current=j,b(y.poleHeight);else{const N=new Map,F=L.type===z.Cuboid;if(F)for(const B of n)B.type===z.SolarPanel&&B.parentId===y.parentId&&me.isIdentical(B.normal,y.normal)&&N.set(B.id,B.poleHeight);else for(const B of n)B.type===z.SolarPanel&&B.parentId===y.parentId&&N.set(B.id,B.poleHeight);const U=F?y.normal:void 0,O={name:"Set Pole Height for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:N,newValue:j,groupId:y.parentId,normal:U,undo:()=>{for(const[B,_]of O.oldValues.entries())r(B,_)},redo:()=>{O.groupId&&i(z.SolarPanel,O.groupId,O.normal,O.newValue)}};c(O),i(z.SolarPanel,y.parentId,U,j),p(f+1)}}break}default:{const L=o(y.id),k=L?L.poleHeight:y.poleHeight;if(C.current=.5*y.ly*Math.abs(Math.sin(y.tiltAngle))>j,C.current)P.current=j,b(k);else{const N={name:"Set Solar Panel Array Pole Height",timestamp:Date.now(),oldValue:k,newValue:j,changedElementId:y.id,changedElementType:y.type,undo:()=>{r(N.changedElementId,N.oldValue)},redo:()=>{r(N.changedElementId,N.newValue)}};c(N),r(y.id,j),p(f+1)}break}}e(L=>{L.actionState.solarPanelPoleHeight=j})}},R=()=>{C.current=!1,t(!1)},M=()=>{R(),g()},D=()=>{S(w),C.current||(t(!1),p(0))},E=()=>{S(w)},W=C.current?": "+Y.t("message.NotApplicableToSelectedAction",v)+(P.current!==void 0?" ("+P.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("solarCollectorMenu.PoleHeight",v),rejectedMessage:W,onApply:E,onClose:R,onClickCancel:M,onClickOk:D,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:10,style:{width:120},step:.1,precision:2,value:w,onChange:j=>{j!==null&&b(j)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",v),": [0, 10] ",Y.t("word.MeterAbbreviation",v)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",v)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:T,value:u,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",v)})]})})})]})})},Gfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(zd),l=H(Dd),s=H(no),c=H(Zn),u=co(z.SolarPanel),[d,f]=m.useState((u==null?void 0:u.poleSpacing)??0),p=Jt(),g=(S,R)=>{e(M=>{for(const D of M.elements)if(D.type===z.SolarPanel&&D.id===S&&!D.locked){const E=D;E.poleSpacing=R;break}})},y=(S,R)=>{e(M=>{for(const D of M.elements)if(D.type===z.SolarPanel&&D.foundationId===S&&!D.locked){const E=D;E.poleSpacing=R}})},w=(S,R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.SolarPanel&&!E.locked){let W;if(R?W=E.parentId===S&&me.isIdentical(E.normal,R):W=E.parentId===S,W){const j=E;j.poleSpacing=M}}})},b=S=>{e(R=>{for(const M of R.elements)if(M.type===z.SolarPanel&&!M.locked){const D=M;D.poleSpacing=S}})},C=(S,R)=>{H.getState().set(M=>{for(const D of M.elements)if(D.type===z.SolarPanel&&!D.locked&&S.has(D.id)){const E=D;E.poleSpacing=R}})},P=S=>{l(S.target.value)},v=S=>{if(u){switch(a){case oe.AllSelectedObjectsOfThisType:{for(const R of n)if(R.type===z.SolarPanel&&!R.locked&&H.getState().selectedElementIdSet.has(R.id)&&Math.abs(R.poleSpacing-S)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const R of n)if(R.type===z.SolarPanel&&!R.locked&&Math.abs(R.poleSpacing-S)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const R of n)if(R.type===z.SolarPanel&&R.foundationId===(u==null?void 0:u.foundationId)&&!R.locked&&Math.abs(R.poleSpacing-S)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const R=r(u);if(R){if(R.type===z.Cuboid){for(const D of n)if(D.type===z.SolarPanel&&D.parentId===u.parentId&&me.isIdentical(D.normal,u.normal)&&!D.locked&&Math.abs(D.poleSpacing-S)>It)return!0}else for(const D of n)if(D.type===z.SolarPanel&&D.parentId===u.parentId&&!D.locked&&Math.abs(D.poleSpacing-S)>It)return!0}break}default:{if(Math.abs((u==null?void 0:u.poleSpacing)-S)>It)return!0;break}}return!1}},T=S=>{if(u&&v(S)){switch(a){case oe.AllSelectedObjectsOfThisType:{const R=new Map;for(const D of n)D.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(D.id)&&R.set(D.id,D.poleSpacing);const M={name:"Set Pole Spacing for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{C(M.oldValues,M.newValue)}};i(M),C(R,S),c(s+1);break}case oe.AllObjectsOfThisType:{const R=new Map;for(const D of n)D.type===z.SolarPanel&&R.set(D.id,D.poleSpacing);const M={name:"Set Pole Spacing for All Solar Panel Arrays",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{b(M.newValue)}};i(M),b(S),c(s+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const R=new Map;for(const D of n)D.type===z.SolarPanel&&D.foundationId===u.foundationId&&R.set(D.id,D.poleSpacing);const M={name:"Set Pole Spacing for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:R,newValue:S,groupId:u.foundationId,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{M.groupId&&y(M.groupId,M.newValue)}};i(M),y(u.foundationId,S),c(s+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{const R=r(u);if(R){const M=new Map,D=R.type===z.Cuboid;if(D)for(const j of n)j.type===z.SolarPanel&&j.parentId===u.parentId&&me.isIdentical(j.normal,u.normal)&&M.set(j.id,j.poleSpacing);else for(const j of n)j.type===z.SolarPanel&&j.parentId===u.parentId&&M.set(j.id,j.poleSpacing);const E=D?u.normal:void 0,W={name:"Set Pole Spacing for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:M,newValue:S,groupId:u.parentId,normal:E,undo:()=>{for(const[j,L]of W.oldValues.entries())g(j,L)},redo:()=>{W.groupId&&w(W.groupId,W.normal,W.newValue)}};i(W),w(u.parentId,E,S),c(s+1)}break}default:{const R=o(u.id),M=R?R.poleSpacing:u.poleSpacing,D={name:"Set Solar Panel Array Pole Spacing",timestamp:Date.now(),oldValue:M,newValue:S,changedElementId:u.id,changedElementType:u.type,undo:()=>{g(D.changedElementId,D.oldValue)},redo:()=>{g(D.changedElementId,D.newValue)}};i(D),g(u.id,S),c(s+1);break}}e(R=>{R.actionState.solarPanelPoleSpacing=S})}},A=()=>{t(!1)},x=()=>{T(d),t(!1),c(0)};return h.jsx(so,{width:550,title:Y.t("solarPanelMenu.PoleSpacing",p),onApply:x,onClose:A,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:10,step:1,style:{width:120},precision:2,value:d,onChange:S=>{S!==null&&f(S)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [1, 10] ",Y.t("word.MeterAbbreviation",p)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",p)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",p)})]})})})]})})},Xfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(qr),r=H(Gn),i=H(Zwt),a=H(e7t),l=H(t7t),s=H(En),c=H(zd),u=H(Dd),d=H(no),f=H(Zn),p=H(Vi),g=co(z.SolarPanel),[y,w]=m.useState((g==null?void 0:g.cx)??0),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=j=>{u(j.target.value)},T=j=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const L of n)if(L.type===z.SolarPanel&&!L.locked&&Math.abs(L.cx-j)>It)return!0;break;case oe.AllObjectsOfThisType:for(const L of n)if(L.type===z.SolarPanel&&!L.locked&&H.getState().selectedElementIdSet.has(L.id)&&Math.abs(L.cx-j)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const L of n)if(L.type===z.SolarPanel&&L.foundationId===(g==null?void 0:g.foundationId)&&!L.locked&&Math.abs(L.cx-j)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.cx)-j)>It)return!0}return!1}},A=(j,L)=>{H.getState().set(k=>{for(const N of k.elements)if(N.type===z.SolarPanel&&!N.locked&&j.has(N.id)){const F=N;F.cx=L}})},x=(j,L,k)=>j+.5*L/k<.5&&j-.5*L/k>-.5,S=j=>{if(!g||!T(j))return;C.current=void 0;const L=o(g);if(L){switch(c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(k.id)&&!x(j,g.lx,L.lx)){b.current=!0;break}if(b.current)C.current=j,w(g.cx);else{const k=new Map;for(const F of n)F.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.cx);const N={name:"Set Center X for Selected Solar Panel",timestamp:Date.now(),oldValues:k,newValue:j,undo:()=>{for(const[F,U]of N.oldValues.entries())i(F,U)},redo:()=>{A(N.oldValues,N.newValue)}};s(N),A(k,j),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.SolarPanel&&!x(j,g.lx,L.lx)){b.current=!0;break}if(b.current)C.current=j,w(g.cx);else{const k=new Map;for(const F of n)F.type===z.SolarPanel&&k.set(F.id,F.cx);const N={name:"Set Center X for All Solar Panels",timestamp:Date.now(),oldValues:k,newValue:j,undo:()=>{for(const[F,U]of N.oldValues.entries())i(F,U)},redo:()=>{l(z.SolarPanel,N.newValue)}};s(N),l(z.SolarPanel,j),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.SolarPanel&&k.foundationId===g.foundationId&&!x(j,g.lx,L.lx)){b.current=!0;break}if(b.current)C.current=j,w(g.cx);else{const k=new Map;for(const F of n)F.type===z.SolarPanel&&F.foundationId===g.foundationId&&k.set(F.id,F.cx);const N={name:"Set Center X for All Solar Panels Above Foundation",timestamp:Date.now(),oldValues:k,newValue:j,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())i(F,U)},redo:()=>{N.groupId&&a(z.SolarPanel,N.groupId,N.newValue)}};s(N),a(z.SolarPanel,g.foundationId,j),f(d+1)}}break}default:{const k=r(g.id),N=k?k.cx:g.cx;if(b.current=!x(j,g.lx,L.lx),b.current)C.current=j,w(N);else{const F={name:"Set Solar Panel Center X",timestamp:Date.now(),oldValue:N,newValue:j,changedElementId:g.id,changedElementType:g.type,undo:()=>{i(F.changedElementId,F.oldValue)},redo:()=>{i(F.changedElementId,F.newValue)}};s(F),i(g.id,j),f(d+1)}break}}e(k=>{k.actionState.solarPanelCx=j})}},R=()=>{b.current=!1,t(!1)},M=()=>{R(),p()},D=()=>{S(y),b.current||(t(!1),f(0))},E=()=>{S(y)},W=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("solarCollectorMenu.RelativeXCoordinateOfCenter",P),rejectedMessage:W,onApply:E,onClose:R,onClickCancel:M,onClickOk:D,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:-.5,max:.5,style:{width:120},step:.01,precision:2,value:y,onChange:j=>{j!==null&&w(j)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",P),": [-0.5, 0.5]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",P)})]})})})]})})},Jfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(qr),r=H(Gn),i=H(n7t),a=H(o7t),l=H(r7t),s=H(En),c=H(zd),u=H(Dd),d=H(no),f=H(Zn),p=H(Vi),g=co(z.SolarPanel),[y,w]=m.useState((g==null?void 0:g.cy)??0),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=j=>{u(j.target.value)},T=j=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const L of n)if(L.type===z.SolarPanel&&!L.locked&&Math.abs(L.cy-j)>It)return!0;break;case oe.AllObjectsOfThisType:for(const L of n)if(L.type===z.SolarPanel&&!L.locked&&H.getState().selectedElementIdSet.has(L.id)&&Math.abs(L.cy-j)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const L of n)if(L.type===z.SolarPanel&&L.foundationId===(g==null?void 0:g.foundationId)&&!L.locked&&Math.abs(L.cy-j)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.cy)-j)>It)return!0}return!1}},A=(j,L)=>{H.getState().set(k=>{for(const N of k.elements)if(N.type===z.SolarPanel&&!N.locked&&j.has(N.id)){const F=N;F.cy=L}})},x=(j,L,k)=>j+.5*L/k<.5&&j-.5*L/k>-.5,S=j=>{if(!g||!T(j))return;C.current=void 0;const L=o(g);if(L){switch(c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(k.id)&&!x(j,g.ly,L.ly)){b.current=!0;break}if(b.current)C.current=j,w(g.cy);else{const k=new Map;for(const F of n)F.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.cy);const N={name:"Set Center Y for Selected Solar Panel",timestamp:Date.now(),oldValues:k,newValue:j,undo:()=>{for(const[F,U]of N.oldValues.entries())i(F,U)},redo:()=>{A(N.oldValues,N.newValue)}};s(N),A(k,j),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.SolarPanel&&!x(j,g.ly,L.ly)){b.current=!0;break}if(b.current)C.current=j,w(g.cy);else{const k=new Map;for(const F of n)F.type===z.SolarPanel&&k.set(F.id,F.cy);const N={name:"Set Center Y for All Solar Panels",timestamp:Date.now(),oldValues:k,newValue:j,undo:()=>{for(const[F,U]of N.oldValues.entries())i(F,U)},redo:()=>{l(z.SolarPanel,N.newValue)}};s(N),l(z.SolarPanel,j),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.SolarPanel&&k.foundationId===g.foundationId&&!x(j,g.ly,L.ly)){b.current=!0;break}if(b.current)C.current=j,w(g.cy);else{const k=new Map;for(const F of n)F.type===z.SolarPanel&&F.foundationId===g.foundationId&&k.set(F.id,F.cy);const N={name:"Set Center Y for All Solar Panels Above Foundation",timestamp:Date.now(),oldValues:k,newValue:j,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())i(F,U)},redo:()=>{N.groupId&&a(z.SolarPanel,N.groupId,N.newValue)}};s(N),a(z.SolarPanel,g.foundationId,j),f(d+1)}}break}default:{const k=r(g.id),N=k?k.cy:g.cy;if(b.current=!x(j,g.ly,L.ly),b.current)C.current=j,w(N);else{const F={name:"Set Solar Panel Center Y",timestamp:Date.now(),oldValue:N,newValue:j,changedElementId:g.id,changedElementType:g.type,undo:()=>{i(F.changedElementId,F.oldValue)},redo:()=>{i(F.changedElementId,F.newValue)}};s(F),i(g.id,j),f(d+1)}break}}e(k=>{k.actionState.solarPanelCy=j})}},R=()=>{b.current=!1,t(!1)},M=()=>{R(),p()},D=()=>{S(y),b.current||(t(!1),f(0))},E=()=>{S(y)},W=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("solarCollectorMenu.RelativeYCoordinateOfCenter",P),rejectedMessage:W,onApply:E,onClose:R,onClickCancel:M,onClickOk:D,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:-.5,max:.5,style:{width:120},step:.01,precision:2,value:y,onChange:j=>{j!==null&&w(j)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",P),": [-0.5, 0.5]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",P)})]})})})]})})},Kfo=t=>{const e=[];if(t.type!==z.SolarPanel)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language},i=t.type===z.SolarPanel&&me.isIdentical(n.normal,rs);return e.push({key:"solar-panel-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"solar-panel-cut",label:h.jsx(Wd,{})}),e.push({key:"solar-panel-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&(e.push({key:"solar-panel-model-change",label:h.jsxs(to,{Dialog:Lfo,children:[Y.t("solarPanelMenu.ChangePvModel",r)," (",n.pvModelName,") ..."]})},{key:"solar-panel-orientation",label:h.jsxs(to,{Dialog:Wfo,children:[Y.t("solarPanelMenu.Orientation",r)," ..."]})},{key:"solar-panel-length",label:h.jsxs(to,{Dialog:Nfo,children:[Y.t("word.Length",r)," ..."]})},{key:"solar-panel-width",label:h.jsxs(to,{Dialog:Ufo,children:[Y.t("word.Width",r)," ..."]})}),e.push({key:"solar-panel-coordinates-submenu",label:h.jsx(rn,{children:Y.t("solarCollectorMenu.Coordinates",r)}),children:[{key:"solar-panel-center-x",label:h.jsxs(to,{Dialog:Xfo,children:[Y.t("solarCollectorMenu.RelativeXCoordinateOfCenter",r)," ..."]})},{key:"solar-panel-center-y",label:h.jsxs(to,{Dialog:Jfo,children:[Y.t("solarCollectorMenu.RelativeYCoordinateOfCenter",r)," ..."]})}]}),n.parentType===z.Wall&&e.push({key:"solar-panel-tilt-angle-on-wall",label:h.jsxs(to,{Dialog:MHe,children:[Y.t("solarPanelMenu.TiltAngle",r)," ..."]})}),i&&(n.trackerType===za.NO_TRACKER&&e.push({key:"solar-panel-tilt-angle",label:h.jsxs(to,{Dialog:MHe,children:[Y.t("solarPanelMenu.TiltAngle",r)," ..."]})}),e.push({key:"solar-panel-relative-azimuth",label:h.jsxs(to,{Dialog:Yfo,children:[Y.t("solarCollectorMenu.RelativeAzimuth",r)," ..."]})}),n.parentType!==z.Roof&&e.push({key:"solar-panel-tracker",label:h.jsxs(to,{Dialog:Ofo,children:[Y.t("solarPanelMenu.Tracker",r)," ..."]})})),e.push({key:"solar-panel-frame-color",label:h.jsxs(to,{Dialog:_fo,children:[Y.t("solarPanelMenu.FrameColor",r)," ..."]})}),e.push({key:"solar-panel-draw-sun-beam",label:h.jsx(e2e,{solarCollector:n})}),e.push({key:"solar-panel-electrical-submenu",label:h.jsx(rn,{children:Y.t("solarPanelMenu.ElectricalProperties",r)}),children:[{key:"solar-panel-inverter-efficiency",label:h.jsxs(to,{Dialog:jfo,children:[Y.t("solarPanelMenu.InverterEfficiency",r)," ..."]})},{key:"solar-panel-dc-ac-ratio",label:h.jsxs(to,{Dialog:Bfo,children:[Y.t("solarPanelMenu.DcToAcSizeRatio",r)," ..."]})}]}),e.push({key:"solar-panel-pole-submenu",label:h.jsx(rn,{children:Y.t("solarCollectorMenu.Pole",r)}),children:[{key:"solar-panel-pole-height",label:h.jsxs(to,{noPadding:!0,Dialog:Vfo,children:[Y.t("solarCollectorMenu.PoleHeight",r)," ..."]})},{key:"solar-panel-pole-spacing",label:h.jsxs(to,{noPadding:!0,Dialog:Gfo,children:[Y.t("solarPanelMenu.PoleSpacing",r)," ..."]})}]}),e.push({key:"solar-panel-label",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",r)}),children:PA(n)})),{items:e}},qfo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(Iw),r=H(Gq),i=H(mW),a=H(qr),l=H(En),s=H(gA),c=H(mA),u=H(no),d=H(Zn),f=H(Vi),p=co(z.ParabolicTrough),[g,y]=m.useState((p==null?void 0:p.ly)??9),w=m.useRef(!1),b=m.useRef(),C=Jt(),P=L=>{c(L.target.value)},v=(L,k)=>{const N=a(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.ly=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},T=(L,k)=>!v(L,k),A=L=>{if(p){switch(s){case oe.AllSelectedObjectsOfThisType:for(const k of e)if(k.type===z.ParabolicTrough&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.ly-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of e)if(k.type===z.ParabolicTrough&&!k.locked&&Math.abs(k.ly-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of e)if(k.type===z.ParabolicTrough&&k.foundationId===(p==null?void 0:p.foundationId)&&!k.locked&&Math.abs(k.ly-L)>It)return!0;break;default:if(Math.abs((p==null?void 0:p.ly)-L)>It)return!0}return!1}},x=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.ParabolicTrough&&!F.locked&&L.has(F.id)&&(F.ly=k)})},S=L=>{if(p&&A(L))switch(b.current=void 0,s){case oe.AllSelectedObjectsOfThisType:{w.current=!1;for(const k of e)if(k.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(k.id)&&T(k,L)){w.current=!0;break}if(w.current)b.current=L,y(p.ly);else{const k=new Map;for(const F of e)F.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.ly);const N={name:"Set Length for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())o(F,U)},redo:()=>{x(N.oldValues,N.newValue)}};l(N),x(k,L),d(u+1)}break}case oe.AllObjectsOfThisType:{w.current=!1;for(const k of e)if(k.type===z.ParabolicTrough&&T(k,L)){w.current=!0;break}if(w.current)b.current=L,y(p.ly);else{const k=new Map;for(const F of e)F.type===z.ParabolicTrough&&k.set(F.id,F.ly);const N={name:"Set Length for All Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())o(F,U)},redo:()=>{i(z.ParabolicTrough,N.newValue)}};l(N),i(z.ParabolicTrough,L),d(u+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){w.current=!1;for(const k of e)if(k.type===z.ParabolicTrough&&k.foundationId===p.foundationId&&T(k,L)){w.current=!0;break}if(w.current)b.current=L,y(p.ly);else{const k=new Map;for(const F of e)F.type===z.ParabolicTrough&&F.foundationId===p.foundationId&&k.set(F.id,F.ly);const N={name:"Set Length for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:p.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())o(F,U)},redo:()=>{N.groupId&&r(z.ParabolicTrough,N.groupId,N.newValue)}};l(N),r(z.ParabolicTrough,p.foundationId,L),d(u+1)}}break}default:{const k=n(p.id),N=k?k.ly:p.ly;if(w.current=T(p,L),w.current)b.current=L,y(N);else{const F={name:"Set Parabolic Trough Length",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:p.id,changedElementType:p.type,undo:()=>{o(F.changedElementId,F.oldValue)},redo:()=>{o(F.changedElementId,F.newValue)}};l(F),o(p.id,L),d(u+1)}break}}},R=()=>{w.current=!1,t(!1)},M=()=>{R(),f()},D=()=>{S(g),w.current||(t(!1),d(0))},E=L=>{if(!p)return 1;let k=L??1;return k=Math.max(1,Math.ceil((k-p.moduleLength/2)/p.moduleLength))*p.moduleLength,k},W=()=>{S(g)};if((p==null?void 0:p.type)!==z.ParabolicTrough)return null;const j=w.current?": "+Y.t("message.NotApplicableToSelectedAction",C)+(b.current!==void 0?" ("+b.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("word.Length",C),rejectedMessage:j,onApply:W,onClose:R,onClickCancel:M,onClickOk:D,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:p.moduleLength,max:100*p.moduleLength,step:p.moduleLength,precision:2,style:{width:120},value:g,onChange:L=>{y(E(L))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("parabolicTroughMenu.ModuleLength",C)+": "+p.moduleLength.toFixed(1)+" "+Y.t("word.MeterAbbreviation",C),h.jsx("br",{}),Math.round(g/p.moduleLength)+" "+Y.t("parabolicTroughMenu.ModulesLong",C),h.jsx("br",{}),Y.t("word.Maximum",C),": 100 ",Y.t("parabolicTroughMenu.Modules",C)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",C)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",C)})]})})})]})})},$fo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(u3),i=H(Vq),a=H(gW),l=H(qr),s=H(En),c=H(gA),u=H(mA),d=H(no),f=H(Zn),p=H(Vi),g=co(z.ParabolicTrough),[y,w]=m.useState((g==null?void 0:g.lx)??2),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.lx=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicTrough&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.lx-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicTrough&&!k.locked&&Math.abs(k.lx-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.ParabolicTrough&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.lx-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.lx)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.ParabolicTrough&&!F.locked&&L.has(F.id)&&(F.lx=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.lx);const N={name:"Set Width for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&k.set(F.id,F.lx);const N={name:"Set Width for All Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.ParabolicTrough,N.newValue)}};s(N),a(z.ParabolicTrough,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&F.foundationId===g.foundationId&&k.set(F.id,F.lx);const N={name:"Set Width for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.ParabolicTrough,N.groupId,N.newValue)}};s(N),i(z.ParabolicTrough,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.lx:g.lx;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Parabolic Trough Width",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.parabolicTroughWidth=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.ParabolicTrough)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("word.Width",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:10,step:.5,precision:2,style:{width:120},value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 10 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",P)})]})})})]})})},Qfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(zYe),i=H(DYe),a=H(EYe),l=H(qr),s=H(En),c=H(gA),u=H(mA),d=H(no),f=H(Zn),p=H(Vi),g=co(z.ParabolicTrough),[y,w]=m.useState((g==null?void 0:g.moduleLength)??3),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.moduleLength=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicTrough&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.moduleLength-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicTrough&&!k.locked&&Math.abs(k.moduleLength-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.ParabolicTrough&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.moduleLength-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.moduleLength)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.ParabolicTrough&&!F.locked&&L.has(F.id)&&(F.moduleLength=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.moduleLength);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.moduleLength);const N={name:"Set Module Length for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.moduleLength);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&k.set(F.id,F.moduleLength);const N={name:"Set Module Length for All Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.ParabolicTrough,N.newValue)}};s(N),a(z.ParabolicTrough,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.moduleLength);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&F.foundationId===g.foundationId&&k.set(F.id,F.moduleLength);const N={name:"Set Module Length for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.ParabolicTrough,N.groupId,N.newValue)}};s(N),i(z.ParabolicTrough,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.moduleLength:g.moduleLength;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Parabolic Trough Module Length",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.parabolicTroughModuleLength=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{R(y),b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.ParabolicTrough)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("parabolicTroughMenu.LatusRectum",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:10,step:.5,style:{width:120},precision:2,value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 10 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",P)})]})})})]})})},Zfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(HYe),i=H(MYe),a=H(IYe),l=H(qr),s=H(En),c=H(gA),u=H(mA),d=H(no),f=H(Zn),p=H(Vi),g=co(z.ParabolicTrough),[y,w]=m.useState((g==null?void 0:g.latusRectum)??2),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.latusRectum=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicTrough&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.latusRectum-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicTrough&&!k.locked&&Math.abs(k.latusRectum-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.ParabolicTrough&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.latusRectum-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.latusRectum)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.ParabolicTrough&&!F.locked&&L.has(F.id)&&(F.latusRectum=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.latusRectum);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.latusRectum);const N={name:"Set Latus Rectum for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.latusRectum);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&k.set(F.id,F.latusRectum);const N={name:"Set Latus Rectum for All Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.ParabolicTrough,N.newValue)}};s(N),a(z.ParabolicTrough,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.latusRectum);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&F.foundationId===g.foundationId&&k.set(F.id,F.latusRectum);const N={name:"Set Latus Rectum for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.ParabolicTrough,N.groupId,N.newValue)}};s(N),i(z.ParabolicTrough,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.latusRectum:g.latusRectum;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Parabolic Trough Latus Rectum",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.parabolicTroughLatusRectum=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{R(y),b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.ParabolicTrough)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("parabolicTroughMenu.LatusRectum",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:20,step:.5,precision:2,style:{width:120},value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 20 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",P)})]})})})]})})},eho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(wW),i=H(vW),a=H(xW),l=H(qr),s=H(En),c=H(gA),u=H(mA),d=H(no),f=H(Zn),p=H(Vi),g=co(z.ParabolicTrough),[y,w]=m.useState((g==null?void 0:g.poleHeight)??1),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=W=>{u(W.target.value)},T=W=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const j of n)if(j.type===z.ParabolicTrough&&!j.locked&&H.getState().selectedElementIdSet.has(j.id)&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const j of n)if(j.type===z.ParabolicTrough&&!j.locked&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const j of n)if(j.type===z.ParabolicTrough&&j.foundationId===(g==null?void 0:g.foundationId)&&!j.locked&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{if(l(g)){for(const L of n)if(L.type===z.ParabolicTrough&&L.parentId===g.parentId&&!L.locked&&Math.abs(L.poleHeight-W)>It)return!0}break}default:{if(Math.abs((g==null?void 0:g.poleHeight)-W)>It)return!0;break}}return!1}},A=(W,j)=>{H.getState().set(L=>{for(const k of L.elements)k.type===z.ParabolicTrough&&!k.locked&&W.has(k.id)&&(k.tiltAngle=j)})},x=W=>{if(g&&T(W)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const j of n)if(j.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(j.id)&&.5*j.ly*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(k.id)&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{A(L.oldValues,L.newValue)}};s(L),A(j,W),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const j of n)if(j.type===z.ParabolicTrough&&.5*j.ly*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.ParabolicTrough&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for All Parabolic Troughs",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{a(z.ParabolicTrough,L.newValue)}};s(L),a(z.ParabolicTrough,W),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const j of n)if(j.type===z.ParabolicTrough&&j.foundationId===g.foundationId&&.5*j.ly*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.ParabolicTrough&&k.foundationId===g.foundationId&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:j,newValue:W,groupId:g.foundationId,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{L.groupId&&i(z.ParabolicTrough,L.groupId,L.newValue)}};s(L),i(z.ParabolicTrough,g.foundationId,W),f(d+1)}}break}default:{const j=o(g.id),L=j?j.poleHeight:g.poleHeight;if(b.current=.5*g.lx*Math.abs(Math.sin(g.tiltAngle))>W,b.current)C.current=W,w(L);else{const k={name:"Set Parabolic Trough Pole Height",timestamp:Date.now(),oldValue:L,newValue:W,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(k.changedElementId,k.oldValue)},redo:()=>{r(k.changedElementId,k.newValue)}};s(k),r(g.id,W),f(d+1)}break}}e(j=>{j.actionState.parabolicTroughPoleHeight=W})}},S=()=>{b.current=!1,t(!1)},R=()=>{S(),p()},M=()=>{x(y),b.current||(t(!1),f(0))},D=()=>{x(y)};if((g==null?void 0:g.type)!==z.ParabolicTrough)return null;const E=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("solarCollectorMenu.ExtraPoleHeightInAdditionToHalfWidth",P),rejectedMessage:E,onApply:D,onClose:S,onClickCancel:R,onClickOk:M,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:5,style:{width:120},step:.1,precision:2,value:y,onChange:W=>{W!==null&&w(W)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",P),": [0, 5] ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",P)})]})})})]})})},tho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(Jq),i=H(Kq),a=H(qq),l=H(En),s=H(gA),c=H(mA),u=H(no),d=H(Zn),f=co(z.ParabolicTrough),[p,g]=m.useState((f==null?void 0:f.reflectance)??.9),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicTrough&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.reflectance)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicTrough&&!R.locked&&A.has(R.id)&&(R.reflectance=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicTrough,S.newValue)}};l(S),a(z.ParabolicTrough,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&R.foundationId===f.foundationId&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicTrough,S.groupId,S.newValue)}};l(S),i(z.ParabolicTrough,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.reflectance:f.reflectance,R={name:"Set Parabolic Trough Reflectance",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicTroughReflectance=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.ParabolicTrough?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",y)})]})})})]})})},nho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(mYe),i=H(yYe),a=H(AYe),l=H(En),s=H(gA),c=H(mA),u=H(no),d=H(Zn),f=co(z.ParabolicTrough),[p,g]=m.useState((f==null?void 0:f.absorptance)??.95),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.absorptance-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&Math.abs(x.absorptance-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicTrough&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.absorptance-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.absorptance)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicTrough&&!R.locked&&A.has(R.id)&&(R.absorptance=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.absorptance);const S={name:"Set Absorptance for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&x.set(R.id,R.absorptance);const S={name:"Set Absorptance for All Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicTrough,S.newValue)}};l(S),a(z.ParabolicTrough,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&R.foundationId===f.foundationId&&x.set(R.id,R.absorptance);const S={name:"Set Absorptance for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicTrough,S.groupId,S.newValue)}};l(S),i(z.ParabolicTrough,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.absorptance:f.absorptance,R={name:"Set Parabolic Trough Absorptance",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicTroughAbsorptance=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.ParabolicTrough?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReceiverAbsorptance",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",y)})]})})})]})})},oho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(wYe),i=H(vYe),a=H(xYe),l=H(En),s=H(gA),c=H(mA),u=H(no),d=H(Zn),f=co(z.ParabolicTrough),[p,g]=m.useState((f==null?void 0:f.opticalEfficiency)??.7),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.opticalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&Math.abs(x.opticalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicTrough&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.opticalEfficiency-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.opticalEfficiency)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicTrough&&!R.locked&&A.has(R.id)&&(R.opticalEfficiency=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.opticalEfficiency);const S={name:"Set Optical Efficiency for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&x.set(R.id,R.opticalEfficiency);const S={name:"Set Optical Efficiency for All Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicTrough,S.newValue)}};l(S),a(z.ParabolicTrough,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&R.foundationId===f.foundationId&&x.set(R.id,R.opticalEfficiency);const S={name:"Set Optical Efficiency for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicTrough,S.groupId,S.newValue)}};l(S),i(z.ParabolicTrough,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.opticalEfficiency:f.opticalEfficiency,R={name:"Set Parabolic Trough Optical Efficiency",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicTroughOpticalEfficiency=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.ParabolicTrough?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReflectorOpticalEfficiency",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",y)})]})})})]})})},rho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(bYe),i=H(SYe),a=H(TYe),l=H(En),s=H(gA),c=H(mA),u=H(no),d=H(Zn),f=co(z.ParabolicTrough),[p,g]=m.useState((f==null?void 0:f.thermalEfficiency)??.3),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.thermalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&Math.abs(x.thermalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicTrough&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.thermalEfficiency-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.thermalEfficiency)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicTrough&&!R.locked&&A.has(R.id)&&(R.thermalEfficiency=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.thermalEfficiency);const S={name:"Set Thermal Efficiency for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&x.set(R.id,R.thermalEfficiency);const S={name:"Set Thermal Efficiency for All Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicTrough,S.newValue)}};l(S),a(z.ParabolicTrough,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&R.foundationId===f.foundationId&&x.set(R.id,R.thermalEfficiency);const S={name:"Set Thermal Efficiency for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicTrough,S.groupId,S.newValue)}};l(S),i(z.ParabolicTrough,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.thermalEfficiency:f.thermalEfficiency,R={name:"Set Parabolic Trough Thermal Efficiency",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicTroughThermalEfficiency=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.ParabolicTrough?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReceiverThermalEfficiency",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",y)})]})})})]})})},iho=t=>{const e=[];if(t.type!==z.ParabolicTrough)return{items:e};const n=t,o={lng:H.getState().language},r=!n.locked;return e.push({key:"parabolic-trough-copy",label:h.jsx(Ld,{})}),r&&e.push({key:"parabolic-trough-cut",label:h.jsx(Wd,{})}),e.push({key:"parabolic-trough-lock",label:h.jsx(Ju,{selectedElement:n})}),r&&e.push({key:"parabolic-trough-length",label:h.jsxs(to,{Dialog:qfo,children:[Y.t("word.Length",o)," ..."]})},{key:"parabolic-trough-width",label:h.jsxs(to,{Dialog:$fo,children:[Y.t("word.Width",o)," ..."]})},{key:"parabolic-trough-module-length",label:h.jsxs(to,{Dialog:Qfo,children:[Y.t("parabolicTroughMenu.ModuleLength",o)," ..."]})},{key:"parabolic-trough-latus-rectum",label:h.jsxs(to,{Dialog:Zfo,children:[Y.t("parabolicTroughMenu.LatusRectum",o)," ..."]})},{key:"parabolic-trough-pole-height",label:h.jsxs(to,{Dialog:eho,children:[Y.t("solarCollectorMenu.ExtraPoleHeight",o)," ..."]})},{key:"parabolic-trough-reflectance",label:h.jsxs(to,{Dialog:tho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",o)," ..."]})},{key:"parabolic-trough-absorptance",label:h.jsxs(to,{Dialog:nho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReceiverAbsorptance",o)," ..."]})},{key:"parabolic-trough-optical-efficiency",label:h.jsxs(to,{Dialog:oho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReflectorOpticalEfficiency",o)," ..."]})},{key:"parabolic-trough-thermal-efficiency",label:h.jsxs(to,{Dialog:rho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReceiverThermalEfficiency",o)," ..."]})},{key:"parabolic-dish-draw-sun-beam",label:h.jsx(e2e,{solarCollector:n})},{key:"parabolic-trough-label-submenu",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",o)}),children:PA(n)}),{items:e}},aho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(u3),i=H(Iw),a=H(Vq),l=H(Gq),s=H(gW),c=H(mW),u=H(qr),d=H(En),f=H(yA),p=H(AA),g=H(no),y=H(Zn),w=H(Vi),b=co(z.ParabolicDish),[C,P]=m.useState((b==null?void 0:b.lx)??2),v=m.useRef(!1),T=m.useRef(),A=Jt(),x=F=>{p(F.target.value)},S=(F,U)=>{const O=u(F);if(O){const B=JSON.parse(JSON.stringify(F));return B.lx=U,me.isSolarCollectorWithinHorizontalSurface(B,O)}return!1},R=(F,U)=>!S(F,U),M=F=>{if(b){switch(f){case oe.AllSelectedObjectsOfThisType:for(const U of n)if(U.type===z.ParabolicDish&&!U.locked&&H.getState().selectedElementIdSet.has(U.id)&&Math.abs(U.lx-F)>It)return!0;break;case oe.AllObjectsOfThisType:for(const U of n)if(U.type===z.ParabolicDish&&!U.locked&&Math.abs(U.lx-F)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const U of n)if(U.type===z.ParabolicDish&&U.foundationId===(b==null?void 0:b.foundationId)&&!U.locked&&Math.abs(U.lx-F)>It)return!0;break;default:if(Math.abs((b==null?void 0:b.lx)-F)>It)return!0}return!1}},D=(F,U)=>{H.getState().set(O=>{for(const B of O.elements)B.type===z.ParabolicDish&&!B.locked&&F.has(B.id)&&(B.lx=U,B.ly=U)})},E=F=>{if(b&&M(F)){switch(T.current=void 0,f){case oe.AllSelectedObjectsOfThisType:{v.current=!1;for(const U of n)if(U.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(U.id)&&R(U,F)){v.current=!0;break}if(v.current)T.current=F,P(b.lx);else{const U=new Map;for(const B of n)B.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(B.id)&&U.set(B.id,B.lx);const O={name:"Set Diameter for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())r(B,_),i(B,_)},redo:()=>{D(O.oldValues,O.newValue)}};d(O),D(U,F),y(g+1)}break}case oe.AllObjectsOfThisType:{v.current=!1;for(const U of n)if(U.type===z.ParabolicDish&&R(U,F)){v.current=!0;break}if(v.current)T.current=F,P(b.lx);else{const U=new Map;for(const B of n)B.type===z.ParabolicDish&&U.set(B.id,B.lx);const O={name:"Set Diameter for All Parabolic Dishes",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())r(B,_),i(B,_)},redo:()=>{s(z.ParabolicDish,O.newValue),c(z.ParabolicDish,O.newValue)}};d(O),s(z.ParabolicDish,F),c(z.ParabolicDish,F),y(g+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(b.foundationId){v.current=!1;for(const U of n)if(U.type===z.ParabolicDish&&U.foundationId===b.foundationId&&R(U,F)){v.current=!0;break}if(v.current)T.current=F,P(b.lx);else{const U=new Map;for(const B of n)B.type===z.ParabolicDish&&B.foundationId===b.foundationId&&U.set(B.id,B.lx);const O={name:"Set Diameter for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:U,newValue:F,groupId:b.foundationId,undo:()=>{for(const[B,_]of O.oldValues.entries())r(B,_),i(B,_)},redo:()=>{O.groupId&&(a(z.ParabolicDish,O.groupId,O.newValue),l(z.ParabolicDish,O.groupId,O.newValue))}};d(O),a(z.ParabolicDish,b.foundationId,F),l(z.ParabolicDish,b.foundationId,F),y(g+1)}}break}default:{const U=o(b.id),O=U?U.lx:b.lx;if(v.current=R(b,F),v.current)T.current=F,P(O);else{const B={name:"Set Parabolic Dish Diameter",timestamp:Date.now(),oldValue:O,newValue:F,changedElementId:b.id,changedElementType:b.type,undo:()=>{r(B.changedElementId,B.oldValue),i(B.changedElementId,B.oldValue)},redo:()=>{r(B.changedElementId,B.newValue),i(B.changedElementId,B.newValue)}};d(B),r(b.id,F),i(b.id,F),y(g+1)}break}}e(U=>{U.actionState.parabolicDishRimDiameter=F})}},W=()=>{v.current=!1,t(!1)},j=()=>{W(),w()},L=()=>{E(C),v.current||(t(!1),y(0))},k=()=>{E(C)};if((b==null?void 0:b.type)!==z.ParabolicDish)return null;const N=v.current?": "+Y.t("message.NotApplicableToSelectedAction",A)+(T.current!==void 0?" ("+T.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("parabolicDishMenu.RimDiameter",A),rejectedMessage:N,onApply:k,onClose:W,onClickCancel:j,onClickOk:L,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:10,step:.5,precision:2,style:{width:120},value:C,onChange:F=>{F!==null&&P(F)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",A),": 1 ",Y.t("word.MeterAbbreviation",A),h.jsx("br",{}),Y.t("word.MaximumValue",A),": 10 ",Y.t("word.MeterAbbreviation",A)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",A)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:x,value:f,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",A)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",A)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",A)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",A)})]})})})]})})},lho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(HYe),i=H(MYe),a=H(IYe),l=H(qr),s=H(En),c=H(yA),u=H(AA),d=H(no),f=H(Zn),p=H(Vi),g=co(z.ParabolicDish),[y,w]=m.useState((g==null?void 0:g.latusRectum)??2),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.latusRectum=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicDish&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.latusRectum-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicDish&&!k.locked&&Math.abs(k.latusRectum-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.ParabolicDish&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.latusRectum-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.latusRectum)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.ParabolicDish&&!F.locked&&L.has(F.id)&&(F.latusRectum=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.latusRectum);else{const k=new Map;for(const F of n)F.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.latusRectum);const N={name:"Set Latus Rectum for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicDish&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.latusRectum);else{const k=new Map;for(const F of n)F.type===z.ParabolicDish&&k.set(F.id,F.latusRectum);const N={name:"Set Latus Rectum for All Parabolic Dishes",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.ParabolicDish,N.newValue)}};s(N),a(z.ParabolicDish,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.ParabolicDish&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.latusRectum);else{const k=new Map;for(const F of n)F.type===z.ParabolicDish&&F.foundationId===g.foundationId&&k.set(F.id,F.latusRectum);const N={name:"Set Latus Rectum for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.ParabolicDish,N.groupId,N.newValue)}};s(N),i(z.ParabolicDish,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.latusRectum:g.latusRectum;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Parabolic Dish Latus Rectum",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.parabolicDishLatusRectum=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{R(y),b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.ParabolicDish)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("parabolicDishMenu.LatusRectum",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:20,step:.5,style:{width:120},precision:2,value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 20 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",P)})]})})})]})})},sho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(yA),a=H(AA),l=H(no),s=H(Zn),c=co(z.ParabolicDish),[u,d]=m.useState((c==null?void 0:c.structureType)??uf.CentralPole),f=Jt(),{Option:p}=_o,g=(x,S)=>{e(R=>{for(const M of R.elements)if(M.id===x&&!M.locked&&M.type===z.ParabolicDish){M.structureType=S;break}})},y=(x,S)=>{e(R=>{for(const M of R.elements)M.foundationId===x&&!M.locked&&M.type===z.ParabolicDish&&(M.structureType=S)})},w=x=>{e(S=>{for(const R of S.elements)R.locked||R.type===z.ParabolicDish&&(R.structureType=x)})},b=x=>{a(x.target.value)},C=x=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const S of n)if(S.type===z.ParabolicDish&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&S.structureType!==x)return!0;break;case oe.AllObjectsOfThisType:for(const S of n)if(S.type===z.ParabolicDish&&!S.locked&&S.structureType!==x)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const S of n)if(S.type===z.ParabolicDish&&S.foundationId===(c==null?void 0:c.foundationId)&&!S.locked&&S.structureType!==x)return!0;break;default:if((c==null?void 0:c.structureType)!==x)return!0}return!1},P=(x,S)=>{H.getState().set(R=>{for(const M of R.elements)M.type===z.ParabolicDish&&!M.locked&&x.has(M.id)&&(M.structureType=S)})},v=x=>{if(c&&C(x)){switch(i){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M.structureType);const R={name:"Set Structure Type for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())g(M,D)},redo:()=>{P(R.oldValues,R.newValue)}};r(R),P(S,x),s(l+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.ParabolicDish&&S.set(M.id,M.structureType);const R={name:"Set Structure Type for All Parabolic Dishes",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())g(M,D)},redo:()=>{w(R.newValue)}};r(R),w(x),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(c.foundationId){const S=new Map;for(const M of n)M.type===z.ParabolicDish&&M.foundationId===c.foundationId&&S.set(M.id,M.structureType);const R={name:"Set Structure Type for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:c.foundationId,undo:()=>{for(const[M,D]of R.oldValues.entries())g(M,D)},redo:()=>{R.groupId&&y(R.groupId,R.newValue)}};r(R),y(c.foundationId,x),s(l+1)}break}default:{const S=o(c.id),R=S?S.structureType:c.structureType,M={name:"Set Parabolic Dish Structure Type",timestamp:Date.now(),oldValue:R,newValue:x,changedElementId:c.id,changedElementType:c.type,undo:()=>{g(M.changedElementId,M.oldValue)},redo:()=>{g(M.changedElementId,M.newValue)}};r(M),g(c.id,x),s(l+1);break}}e(S=>{S.actionState.parabolicDishReceiverStructure=x})}},T=()=>{t(!1)},A=()=>{v(u)};return(c==null?void 0:c.type)!==z.ParabolicDish?null:h.jsx(so,{width:640,title:Y.t("parabolicDishMenu.ReceiverStructure",f),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:8,children:h.jsxs(_o,{value:u,onChange:x=>d(x),children:[h.jsx(p,{value:uf.CentralPole,children:Y.t("parabolicDishMenu.CentralPole",f)},uf.CentralPole),h.jsx(p,{value:uf.CentralPoleWithTripod,children:Y.t("parabolicDishMenu.CentralPoleWithTripod",f)},uf.CentralPoleWithTripod),h.jsx(p,{value:uf.Quadrupod,children:Y.t("parabolicDishMenu.Quadrupod",f)},uf.Quadrupod)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:b,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",f)})]})})})]})})},cho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(wW),i=H(vW),a=H(xW),l=H(qr),s=H(En),c=H(yA),u=H(AA),d=H(no),f=H(Zn),p=H(Vi),g=co(z.ParabolicDish),[y,w]=m.useState((g==null?void 0:g.poleHeight)??1),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=W=>{u(W.target.value)},T=W=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const j of n)if(j.type===z.ParabolicDish&&!j.locked&&H.getState().selectedElementIdSet.has(j.id)&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const j of n)if(j.type===z.ParabolicDish&&!j.locked&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const j of n)if(j.type===z.ParabolicDish&&j.foundationId===(g==null?void 0:g.foundationId)&&!j.locked&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{if(l(g)){for(const L of n)if(L.type===z.ParabolicDish&&L.parentId===g.parentId&&!L.locked&&Math.abs(L.poleHeight-W)>It)return!0}break}default:{if(Math.abs((g==null?void 0:g.poleHeight)-W)>It)return!0;break}}return!1}},A=(W,j)=>{H.getState().set(L=>{for(const k of L.elements)k.type===z.ParabolicDish&&!k.locked&&W.has(k.id)&&(k.tiltAngle=j)})},x=W=>{if(g&&T(W)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const j of n)if(j.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(j.id)&&.5*j.ly*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(k.id)&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{A(L.oldValues,L.newValue)}};s(L),A(j,W),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const j of n)if(j.type===z.ParabolicDish&&.5*j.ly*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.ParabolicDish&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for All Parabolic Dishes",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{a(z.ParabolicDish,L.newValue)}};s(L),a(z.ParabolicDish,W),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const j of n)if(j.type===z.ParabolicDish&&j.foundationId===g.foundationId&&.5*j.ly*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.ParabolicDish&&k.foundationId===g.foundationId&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:j,newValue:W,groupId:g.foundationId,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{L.groupId&&i(z.ParabolicDish,L.groupId,L.newValue)}};s(L),i(z.ParabolicDish,g.foundationId,W),f(d+1)}}break}default:{const j=o(g.id),L=j?j.poleHeight:g.poleHeight;if(b.current=.5*g.lx*Math.abs(Math.sin(g.tiltAngle))>W,b.current)C.current=W,w(L);else{const k={name:"Set Parabolic Dish Pole Height",timestamp:Date.now(),oldValue:L,newValue:W,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(k.changedElementId,k.oldValue)},redo:()=>{r(k.changedElementId,k.newValue)}};s(k),r(g.id,W),f(d+1)}break}}e(j=>{j.actionState.parabolicDishPoleHeight=W})}},S=()=>{b.current=!1,t(!1)},R=()=>{S(),p()},M=()=>{x(y),b.current||(t(!1),f(0))},D=()=>{x(y)};if((g==null?void 0:g.type)!==z.ParabolicDish)return null;const E=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("parabolicDishMenu.ExtraPoleHeightInAdditionToRadius",P),rejectedMessage:E,onApply:D,onClose:S,onClickCancel:R,onClickOk:M,children:h.jsxs(on,{children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:5,style:{width:120},step:.1,precision:2,value:y,onChange:W=>{W!==null&&w(W)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",P),": [0, 5] ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",P)})]})})})]})})},uho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(hYe),i=H(pYe),a=H(gYe),l=H(qr),s=H(En),c=H(yA),u=H(AA),d=H(no),f=H(Zn),p=co(z.ParabolicDish),[g,y]=m.useState((p==null?void 0:p.poleRadius)??.1),w=Jt(),b=x=>{u(x.target.value)},C=x=>{if(p){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const S of n)if(S.type===z.ParabolicDish&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&Math.abs(S.poleRadius-x)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const S of n)if(S.type===z.ParabolicDish&&!S.locked&&Math.abs(S.poleRadius-x)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const S of n)if(S.type===z.ParabolicDish&&S.foundationId===(p==null?void 0:p.foundationId)&&!S.locked&&Math.abs(S.poleRadius-x)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{if(l(p)){for(const R of n)if(R.type===z.ParabolicDish&&R.parentId===p.parentId&&!R.locked&&Math.abs(R.poleRadius-x)>It)return!0}break}default:{if(Math.abs((p==null?void 0:p.poleRadius)-x)>It)return!0;break}}return!1}},P=(x,S)=>{H.getState().set(R=>{for(const M of R.elements)M.type===z.ParabolicDish&&!M.locked&&x.has(M.id)&&(M.poleRadius=S)})},v=x=>{if(p&&C(x)){switch(c){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M.poleRadius);const R={name:"Set Pole Radius for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{P(R.oldValues,R.newValue)}};s(R),P(S,x),f(d+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.ParabolicDish&&S.set(M.id,M.poleRadius);const R={name:"Set Pole Radius for All Parabolic Dishes",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{a(z.ParabolicDish,R.newValue)}};s(R),a(z.ParabolicDish,x),f(d+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){const S=new Map;for(const M of n)M.type===z.ParabolicDish&&M.foundationId===p.foundationId&&S.set(M.id,M.poleRadius);const R={name:"Set Pole Radius for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:p.foundationId,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{R.groupId&&i(z.ParabolicDish,R.groupId,R.newValue)}};s(R),i(z.ParabolicDish,p.foundationId,x),f(d+1)}break}default:{const S=o(p.id),R=S?S.poleRadius:p.poleRadius,M={name:"Set Parabolic Dish Pole Radius",timestamp:Date.now(),oldValue:R,newValue:x,changedElementId:p.id,changedElementType:p.type,undo:()=>{r(M.changedElementId,M.oldValue)},redo:()=>{r(M.changedElementId,M.newValue)}};s(M),r(p.id,x),f(d+1);break}}e(S=>{S.actionState.parabolicDishPoleRadius=x})}},T=()=>{t(!1)},A=()=>{v(g)};return(p==null?void 0:p.type)!==z.ParabolicDish?null:h.jsx(so,{width:600,title:Y.t("solarCollectorMenu.PoleRadius",w),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:.5,style:{width:120},step:.01,precision:2,value:g,onChange:x=>{x!==null&&y(x)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",w),": [0.1, 0.5] ",Y.t("word.MeterAbbreviation",w)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",w)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:b,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",w)})]})})})]})})},dho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(Jq),i=H(Kq),a=H(qq),l=H(En),s=H(yA),c=H(AA),u=H(no),d=H(Zn),f=co(z.ParabolicDish),[p,g]=m.useState((f==null?void 0:f.reflectance)??.9),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicDish&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.reflectance)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicDish&&!R.locked&&A.has(R.id)&&(R.reflectance=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicDish,S.newValue)}};l(S),a(z.ParabolicDish,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicDish&&R.foundationId===f.foundationId&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicDish,S.groupId,S.newValue)}};l(S),i(z.ParabolicDish,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.reflectance:f.reflectance,R={name:"Set Parabolic Dish Reflectance",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicDishReflectance=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.ParabolicDish?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",y)})]})})})]})})},fho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(mYe),i=H(yYe),a=H(AYe),l=H(En),s=H(yA),c=H(AA),u=H(no),d=H(Zn),f=co(z.ParabolicDish),[p,g]=m.useState((f==null?void 0:f.absorptance)??.95),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.absorptance-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&Math.abs(x.absorptance-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicDish&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.absorptance-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.absorptance)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicDish&&!R.locked&&A.has(R.id)&&(R.absorptance=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.absorptance);const S={name:"Set Absorptance for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&x.set(R.id,R.absorptance);const S={name:"Set Absorptance for All Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicDish,S.newValue)}};l(S),a(z.ParabolicDish,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicDish&&R.foundationId===f.foundationId&&x.set(R.id,R.absorptance);const S={name:"Set Absorptance for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicDish,S.groupId,S.newValue)}};l(S),i(z.ParabolicDish,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.absorptance:f.absorptance,R={name:"Set Parabolic Dish Absorptance",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicDishAbsorptance=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.ParabolicDish?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReceiverAbsorptance",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",y)})]})})})]})})},hho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(wYe),i=H(vYe),a=H(xYe),l=H(En),s=H(yA),c=H(AA),u=H(no),d=H(Zn),f=co(z.ParabolicDish),[p,g]=m.useState((f==null?void 0:f.opticalEfficiency)??.7),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.opticalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&Math.abs(x.opticalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicDish&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.opticalEfficiency-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.opticalEfficiency)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicDish&&!R.locked&&A.has(R.id)&&(R.opticalEfficiency=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.opticalEfficiency);const S={name:"Set Optical Efficiency for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&x.set(R.id,R.opticalEfficiency);const S={name:"Set Optical Efficiency for All Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicDish,S.newValue)}};l(S),a(z.ParabolicDish,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicDish&&R.foundationId===f.foundationId&&x.set(R.id,R.opticalEfficiency);const S={name:"Set Optical Efficiency for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicDish,S.groupId,S.newValue)}};l(S),i(z.ParabolicDish,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.opticalEfficiency:f.opticalEfficiency,R={name:"Set Parabolic Dish Optical Efficiency",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicDishOpticalEfficiency=A})}},v=()=>{t(!1)},T=()=>{P(p),t(!1),d(0)};return(f==null?void 0:f.type)!==z.ParabolicDish?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReflectorOpticalEfficiency",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",y)})]})})})]})})},pho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(bYe),i=H(SYe),a=H(TYe),l=H(En),s=H(yA),c=H(AA),u=H(no),d=H(Zn),f=co(z.ParabolicDish),[p,g]=m.useState((f==null?void 0:f.thermalEfficiency)??.3),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.thermalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&Math.abs(x.thermalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicDish&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.thermalEfficiency-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.thermalEfficiency)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicDish&&!R.locked&&A.has(R.id)&&(R.thermalEfficiency=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.thermalEfficiency);const S={name:"Set Thermal Efficiency for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&x.set(R.id,R.thermalEfficiency);const S={name:"Set Thermal Efficiency for All Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicDish,S.newValue)}};l(S),a(z.ParabolicDish,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicDish&&R.foundationId===f.foundationId&&x.set(R.id,R.thermalEfficiency);const S={name:"Set Thermal Efficiency for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicDish,S.groupId,S.newValue)}};l(S),i(z.ParabolicDish,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.thermalEfficiency:f.thermalEfficiency,R={name:"Set Parabolic Dish Thermal Efficiency",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicDishThermalEfficiency=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.ParabolicDish?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReceiverThermalEfficiency",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",y)})]})})})]})})},gho=t=>{const e=[];if(t.type!==z.ParabolicDish)return{items:e};const n=t,o={lng:H.getState().language},r=!n.locked;return e.push({key:"parabolic-dish-copy",label:h.jsx(Ld,{})}),r&&e.push({key:"parabolic-dish-cut",label:h.jsx(Wd,{})}),e.push({key:"parabolic-dish-lock",label:h.jsx(Ju,{selectedElement:n})}),r&&e.push({key:"parabolic-dish-radius",label:h.jsxs(to,{Dialog:aho,children:[Y.t("parabolicDishMenu.RimDiameter",o)," ..."]})},{key:"parabolic-dish-latus-rectum",label:h.jsxs(to,{Dialog:lho,children:[Y.t("parabolicDishMenu.LatusRectum",o)," ..."]})},{key:"parabolic-dish-structure-type",label:h.jsxs(to,{Dialog:sho,children:[Y.t("parabolicDishMenu.ReceiverStructure",o)," ..."]})},{key:"parabolic-dish-pole-height",label:h.jsxs(to,{Dialog:cho,children:[Y.t("solarCollectorMenu.ExtraPoleHeight",o)," ..."]})},{key:"parabolic-dish-pole-radius",label:h.jsxs(to,{Dialog:uho,children:[Y.t("solarCollectorMenu.PoleRadius",o)," ..."]})},{key:"parabolic-dish-reflectance",label:h.jsxs(to,{Dialog:dho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",o)," ..."]})},{key:"parabolic-dish-absorptance",label:h.jsxs(to,{Dialog:fho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReceiverAbsorptance",o)," ..."]})},{key:"parabolic-dish-optical-efficiency",label:h.jsxs(to,{Dialog:hho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReflectorOpticalEfficiency",o)," ..."]})},{key:"parabolic-dish-thermal-efficiency",label:h.jsxs(to,{Dialog:pho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReceiverThermalEfficiency",o)," ..."]})},{key:"parabolic-dish-draw-sun-beam",label:h.jsx(e2e,{solarCollector:n})},{key:"parabolic-dish-label-submenu",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",o)}),children:PA(n)}),{items:e}},mho=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(lYe),r=H(sYe),i=H(cYe),a=H(En),l=H(Mb),s=H(Ib),c=H(no),u=H(Zn),d=co(z.FresnelReflector),[f,p]=m.useState(!!(d!=null&&d.drawSunBeam)),g=Jt(),y=T=>{s(T.target.value)},w=T=>{switch(l){case oe.AllSelectedObjectsOfThisType:for(const A of e)if(A.type===z.FresnelReflector&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&A.drawSunBeam!==T)return!0;break;case oe.AllObjectsOfThisType:for(const A of e)if(A.type===z.FresnelReflector&&!A.locked&&A.drawSunBeam!==T)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const A of e)if(A.type===z.FresnelReflector&&A.foundationId===(d==null?void 0:d.foundationId)&&!A.locked&&A.drawSunBeam!==T)return!0;break;default:if((d==null?void 0:d.drawSunBeam)!==T)return!0}return!1},b=(T,A)=>{H.getState().set(x=>{for(const S of x.elements)me.isSolarCollectorType(S.type)&&!S.locked&&S.type===z.FresnelReflector&&T.has(S.id)&&(S.drawSunBeam=A)})},C=T=>{if(d&&w(T))switch(l){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of e)S.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(S.id)&&A.set(S.id,S.drawSunBeam);const x={name:"Draw Sun Beam for Selected Fresnel Reflectors",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())o(S,R)},redo:()=>{b(x.oldValues,x.newValue)}};a(x),b(A,T),u(c+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of e)S.type===z.FresnelReflector&&A.set(S.id,S.drawSunBeam);const x={name:"Draw Sun Beam for All Fresnel Reflectors",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())o(S,R)},redo:()=>{i(z.FresnelReflector,x.newValue)}};a(x),i(z.FresnelReflector,T),u(c+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(d.foundationId){const A=new Map;for(const S of e)S.type===z.FresnelReflector&&S.foundationId===d.foundationId&&A.set(S.id,S.drawSunBeam);const x={name:"Draw Sun Beam for All Fresnel Reflectors Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:d.foundationId,undo:()=>{for(const[S,R]of x.oldValues.entries())o(S,R)},redo:()=>{x.groupId&&r(z.FresnelReflector,x.groupId,x.newValue)}};a(x),r(z.FresnelReflector,d.foundationId,T),u(c+1)}break}default:{const A=n(d.id),x=A?A.drawSunBeam:d.drawSunBeam,S={name:"Draw Sun Beam for Fresnel Reflector",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:d.id,changedElementType:d.type,undo:()=>{o(S.changedElementId,S.oldValue)},redo:()=>{o(S.changedElementId,S.newValue)}};a(S),o(d.id,T),u(c+1);break}}},P=()=>{t(!1)},v=()=>{C(f)};return(d==null?void 0:d.type)!==z.FresnelReflector?null:h.jsx(so,{width:500,title:Y.t("solarCollectorMenu.DrawSunBeam",g),onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:4,children:h.jsx(xc,{checked:f,onChange:T=>{p(T)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:20,children:h.jsx(Ue.Group,{onChange:y,value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("fresnelReflectorMenu.OnlyThisFresnelReflector",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("fresnelReflectorMenu.AllFresnelReflectorsAboveFoundation",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllSelectedFresnelReflectors",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllFresnelReflectors",g)})]})})})]})})},{Option:yho}=_o,Aho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(PYe),i=H(CYe),a=H(RYe),l=H(En),s=H(Mb),c=H(Ib),u=H(no),d=H(Zn),f=co(z.FresnelReflector),[p,g]=m.useState((f==null?void 0:f.receiverId)??"None"),y=Jt(),w=m.useMemo(()=>{const x=[];for(const S of n)if(S.type===z.Foundation){const R=S;R.solarStructure===Dn.FocusPipe&&x.push(R.id)}return x},[n]);m.useEffect(()=>{if(g("None"),f)if(f.receiverId)g(f.receiverId);else{const x=o(f.parentId);x&&x.type===z.Foundation&&x.solarStructure===Dn.FocusPipe&&g(x.id)}},[f]);const b=x=>{c(x.target.value)},C=x=>{switch(s){case oe.AllSelectedObjectsOfThisType:for(const S of n)if(S.type===z.FresnelReflector&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&S.receiverId!==x)return!0;break;case oe.AllObjectsOfThisType:for(const S of n)if(S.type===z.FresnelReflector&&!S.locked&&S.receiverId!==x)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const S of n)if(S.type===z.FresnelReflector&&S.foundationId===(f==null?void 0:f.foundationId)&&!S.locked&&S.receiverId!==x)return!0;break;default:if((f==null?void 0:f.receiverId)!==x)return!0}return!1},P=(x,S)=>{e(R=>{for(const M of R.elements)me.isHeliostatOrFresnelReflector(M.type)&&!M.locked&&x.has(M.id)&&(M.type===z.Heliostat?M.towerId=S:M.type===z.FresnelReflector&&(M.receiverId=S))})},v=x=>{if(f&&C(x)){switch(s){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M.receiverId);const R={name:"Set Receiver for Selected Fresnel Reflectors",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{P(R.oldValues,R.newValue)}};l(R),P(S,x),d(u+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.FresnelReflector&&S.set(M.id,M.receiverId);const R={name:"Set Receiver for All Fresnel Reflectors",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{a(z.FresnelReflector,R.newValue)}};l(R),a(z.FresnelReflector,x),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const S=new Map;for(const M of n)M.type===z.FresnelReflector&&M.foundationId===f.foundationId&&S.set(M.id,M.receiverId);const R={name:"Set Receiver for All Fresnel Reflectors Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:f.foundationId,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{R.groupId&&i(z.FresnelReflector,R.groupId,R.newValue)}};l(R),i(z.FresnelReflector,f.foundationId,x),d(u+1)}break}default:{const S=o(f.id),R=S?S.receiverId:f.receiverId,M={name:"Set Receiver for Fresnel Reflector",timestamp:Date.now(),oldValue:R,newValue:x,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(M.changedElementId,M.oldValue)},redo:()=>{r(M.changedElementId,M.newValue)}};l(M),r(f.id,x),d(u+1);break}}e(S=>{S.actionState.fresnelReflectorReceiver=x})}},T=()=>{t(!1)},A=()=>{p&&v(p)};return(f==null?void 0:f.type)!==z.FresnelReflector?null:h.jsx(so,{width:640,title:Y.t("fresnelReflectorMenu.SelectAbsorberToReflectSunlightTo",y),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:9,children:h.jsx(_o,{style:{width:"160px"},value:p,onChange:x=>{g(x)},children:w.map((x,S)=>h.jsx(yho,{value:x,children:Y.t("fresnelReflectorMenu.AbsorberPipe",y)+" "+(S+1)},S))})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:15,children:h.jsx(Ue.Group,{onChange:b,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("fresnelReflectorMenu.OnlyThisFresnelReflector",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("fresnelReflectorMenu.AllFresnelReflectorsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllSelectedFresnelReflectors",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllFresnelReflectors",y)})]})})})]})})},who=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(Iw),r=H(Gq),i=H(mW),a=H(qr),l=H(En),s=H(Mb),c=H(Ib),u=H(no),d=H(Zn),f=H(Vi),p=co(z.FresnelReflector),[g,y]=m.useState((p==null?void 0:p.ly)??9),w=m.useRef(!1),b=m.useRef(),C=Jt(),P=L=>{c(L.target.value)},v=(L,k)=>{const N=a(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.ly=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},T=(L,k)=>!v(L,k),A=L=>{if(p){switch(s){case oe.AllSelectedObjectsOfThisType:for(const k of e)if(k.type===z.FresnelReflector&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.ly-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of e)if(k.type===z.FresnelReflector&&!k.locked&&Math.abs(k.ly-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of e)if(k.type===z.FresnelReflector&&k.foundationId===(p==null?void 0:p.foundationId)&&!k.locked&&Math.abs(k.ly-L)>It)return!0;break;default:if(Math.abs((p==null?void 0:p.ly)-L)>It)return!0}return!1}},x=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.FresnelReflector&&!F.locked&&L.has(F.id)&&(F.ly=k)})},S=L=>{if(p&&A(L))switch(b.current=void 0,s){case oe.AllSelectedObjectsOfThisType:{w.current=!1;for(const k of e)if(k.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(k.id)&&T(k,L)){w.current=!0;break}if(w.current)b.current=L,y(p.ly);else{const k=new Map;for(const F of e)F.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.ly);const N={name:"Set Length for Selected Fresnel Reflectors",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())o(F,U)},redo:()=>{x(N.oldValues,N.newValue)}};l(N),x(k,L),d(u+1)}break}case oe.AllObjectsOfThisType:{w.current=!1;for(const k of e)if(k.type===z.FresnelReflector&&T(k,L)){w.current=!0;break}if(w.current)b.current=L,y(p.ly);else{const k=new Map;for(const F of e)F.type===z.FresnelReflector&&k.set(F.id,F.ly);const N={name:"Set Length for All Fresnel Reflectors",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())o(F,U)},redo:()=>{i(z.FresnelReflector,N.newValue)}};l(N),i(z.FresnelReflector,L),d(u+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){w.current=!1;for(const k of e)if(k.type===z.FresnelReflector&&k.foundationId===p.foundationId&&T(k,L)){w.current=!0;break}if(w.current)b.current=L,y(p.ly);else{const k=new Map;for(const F of e)F.type===z.FresnelReflector&&F.foundationId===p.foundationId&&k.set(F.id,F.ly);const N={name:"Set Length for All Fresnel Reflectors Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:p.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())o(F,U)},redo:()=>{N.groupId&&r(z.FresnelReflector,N.groupId,N.newValue)}};l(N),r(z.FresnelReflector,p.foundationId,L),d(u+1)}}break}default:{const k=n(p.id),N=k?k.ly:p.ly;if(w.current=T(p,L),w.current)b.current=L,y(N);else{const F={name:"Set Fresnel Reflector Length",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:p.id,changedElementType:p.type,undo:()=>{o(F.changedElementId,F.oldValue)},redo:()=>{o(F.changedElementId,F.newValue)}};l(F),o(p.id,L),d(u+1)}break}}},R=()=>{w.current=!1,t(!1)},M=()=>{R(),f()},D=()=>{S(g),w.current||(t(!1),d(0))},E=L=>{if(!p)return 1;let k=L??1;return k=Math.max(1,Math.ceil((k-p.moduleLength/2)/p.moduleLength))*p.moduleLength,k},W=()=>{S(g)};if((p==null?void 0:p.type)!==z.FresnelReflector)return null;const j=w.current?": "+Y.t("message.NotApplicableToSelectedAction",C)+(b.current!==void 0?" ("+b.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("word.Length",C),rejectedMessage:j,onApply:W,onClose:R,onClickCancel:M,onClickOk:D,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:p.moduleLength,max:200*p.moduleLength,step:p.moduleLength,style:{width:120},precision:2,value:g,onChange:L=>{L!==null&&y(E(L))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("fresnelReflectorMenu.ModuleLength",C)+": "+p.moduleLength.toFixed(1)+" "+Y.t("word.MeterAbbreviation",C),h.jsx("br",{}),Math.round(g/p.moduleLength)+" "+Y.t("fresnelReflectorMenu.ModulesLong",C),h.jsx("br",{}),Y.t("word.Maximum",C),": 200 ",Y.t("fresnelReflectorMenu.Modules",C)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",C)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("fresnelReflectorMenu.OnlyThisFresnelReflector",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("fresnelReflectorMenu.AllFresnelReflectorsAboveFoundation",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllSelectedFresnelReflectors",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllFresnelReflectors",C)})]})})})]})})},vho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(u3),i=H(Vq),a=H(gW),l=H(qr),s=H(En),c=H(Mb),u=H(Ib),d=H(no),f=H(Zn),p=H(Vi),g=co(z.FresnelReflector),[y,w]=m.useState((g==null?void 0:g.lx)??2),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.lx=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.FresnelReflector&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.lx-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.FresnelReflector&&!k.locked&&Math.abs(k.lx-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.FresnelReflector&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.lx-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.lx)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.FresnelReflector&&!F.locked&&L.has(F.id)&&(F.lx=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.lx);const N={name:"Set Width for Selected Fresnel Reflectors",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.FresnelReflector&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.FresnelReflector&&k.set(F.id,F.lx);const N={name:"Set Width for All Fresnel Reflectors",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.FresnelReflector,N.newValue)}};s(N),a(z.FresnelReflector,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.FresnelReflector&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.FresnelReflector&&F.foundationId===g.foundationId&&k.set(F.id,F.lx);const N={name:"Set Width for All Fresnel Reflectors Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.FresnelReflector,N.groupId,N.newValue)}};s(N),i(z.FresnelReflector,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.lx:g.lx;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Fresnel Reflector Width",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.fresnelReflectorWidth=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{R(y),b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.FresnelReflector)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("word.Width",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:10,step:.5,style:{width:120},precision:2,value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 10 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("fresnelReflectorMenu.OnlyThisFresnelReflector",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("fresnelReflectorMenu.AllFresnelReflectorsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllSelectedFresnelReflectors",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllFresnelReflectors",P)})]})})})]})})},xho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(zYe),i=H(DYe),a=H(EYe),l=H(qr),s=H(En),c=H(Mb),u=H(Ib),d=H(no),f=H(Zn),p=H(Vi),g=co(z.FresnelReflector),[y,w]=m.useState((g==null?void 0:g.moduleLength)??3),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.moduleLength=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.FresnelReflector&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.moduleLength-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.FresnelReflector&&!k.locked&&Math.abs(k.moduleLength-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.FresnelReflector&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.moduleLength-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.moduleLength)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.FresnelReflector&&!F.locked&&L.has(F.id)&&(F.moduleLength=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.moduleLength);else{const k=new Map;for(const F of n)F.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.moduleLength);const N={name:"Set Module Length for Selected Fresnel Reflectors",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.FresnelReflector&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.moduleLength);else{const k=new Map;for(const F of n)F.type===z.FresnelReflector&&k.set(F.id,F.moduleLength);const N={name:"Set Module Length for All Fresnel Reflectors",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.FresnelReflector,N.newValue)}};s(N),a(z.FresnelReflector,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.FresnelReflector&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.moduleLength);else{const k=new Map;for(const F of n)F.type===z.FresnelReflector&&F.foundationId===g.foundationId&&k.set(F.id,F.moduleLength);const N={name:"Set Module Length for All Fresnel Reflectors Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.FresnelReflector,N.groupId,N.newValue)}};s(N),i(z.FresnelReflector,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.moduleLength:g.moduleLength;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Fresnel Reflector Module Length",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.fresnelReflectorModuleLength=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{R(y),b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.FresnelReflector)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("fresnelReflectorMenu.ModuleLength",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:20,step:.5,style:{width:120},precision:2,value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 10 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("fresnelReflectorMenu.OnlyThisFresnelReflector",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("fresnelReflectorMenu.AllFresnelReflectorsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllSelectedFresnelReflectors",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllFresnelReflectors",P)})]})})})]})})},bho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(wW),i=H(vW),a=H(xW),l=H(qr),s=H(En),c=H(Mb),u=H(Ib),d=H(no),f=H(Zn),p=H(Vi),g=co(z.FresnelReflector),[y,w]=m.useState((g==null?void 0:g.poleHeight)??1),b=m.useRef(!1),C=m.useRef(),P=m.useRef((g==null?void 0:g.poleHeight)??1),v=Jt(),T=j=>{u(j.target.value)},A=j=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const L of n)if(L.type===z.FresnelReflector&&!L.locked&&H.getState().selectedElementIdSet.has(L.id)&&Math.abs(L.poleHeight-j)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const L of n)if(L.type===z.FresnelReflector&&!L.locked&&Math.abs(L.poleHeight-j)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const L of n)if(L.type===z.FresnelReflector&&L.foundationId===(g==null?void 0:g.foundationId)&&!L.locked&&Math.abs(L.poleHeight-j)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{if(l(g)){for(const k of n)if(k.type===z.FresnelReflector&&k.parentId===g.parentId&&!k.locked&&Math.abs(k.poleHeight-j)>It)return!0}break}default:{if(Math.abs((g==null?void 0:g.poleHeight)-j)>It)return!0;break}}return!1}},x=(j,L)=>{H.getState().set(k=>{for(const N of k.elements)N.type===z.FresnelReflector&&!N.locked&&j.has(N.id)&&(N.poleHeight=L)})},S=j=>{if(g&&A(j)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const L of n)if(L.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(L.id)&&.5*L.ly*Math.abs(Math.sin(L.tiltAngle))>j){b.current=!0;break}if(b.current)C.current=j,P.current=g.poleHeight;else{const L=new Map;for(const N of n)N.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(N.id)&&L.set(N.id,N.poleHeight);const k={name:"Set Pole Height for Selected Fresnel Reflectors",timestamp:Date.now(),oldValues:L,newValue:j,undo:()=>{for(const[N,F]of k.oldValues.entries())r(N,F)},redo:()=>{x(k.oldValues,k.newValue)}};s(k),x(L,j),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const L of n)if(L.type===z.FresnelReflector&&.5*L.ly*Math.abs(Math.sin(L.tiltAngle))>j){b.current=!0;break}if(b.current)C.current=j,P.current=g.poleHeight;else{const L=new Map;for(const N of n)N.type===z.FresnelReflector&&L.set(N.id,N.poleHeight);const k={name:"Set Pole Height for All Fresnel Reflectors",timestamp:Date.now(),oldValues:L,newValue:j,undo:()=>{for(const[N,F]of k.oldValues.entries())r(N,F)},redo:()=>{a(z.FresnelReflector,k.newValue)}};s(k),a(z.FresnelReflector,j),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const L of n)if(L.type===z.FresnelReflector&&L.foundationId===g.foundationId&&.5*L.ly*Math.abs(Math.sin(L.tiltAngle))>j){b.current=!0;break}if(b.current)C.current=j,P.current=g.poleHeight;else{const L=new Map;for(const N of n)N.type===z.FresnelReflector&&N.foundationId===g.foundationId&&L.set(N.id,N.poleHeight);const k={name:"Set Pole Height for All Fresnel Reflectors Above Foundation",timestamp:Date.now(),oldValues:L,newValue:j,groupId:g.foundationId,undo:()=>{for(const[N,F]of k.oldValues.entries())r(N,F)},redo:()=>{k.groupId&&i(z.FresnelReflector,k.groupId,k.newValue)}};s(k),i(z.FresnelReflector,g.foundationId,j),f(d+1)}}break}default:{const L=o(g.id),k=L?L.poleHeight:g.poleHeight;if(b.current=.5*g.lx*Math.abs(Math.sin(g.tiltAngle))>j,b.current)C.current=j,P.current=k;else{const N={name:"Set Fresnel Reflector Pole Height",timestamp:Date.now(),oldValue:k,newValue:j,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(N.changedElementId,N.oldValue)},redo:()=>{r(N.changedElementId,N.newValue)}};s(N),r(g.id,j),f(d+1)}break}}e(L=>{L.actionState.fresnelReflectorPoleHeight=j})}},R=()=>{t(!1)},M=()=>{R(),p()},D=()=>{S(y),b.current||(t(!1),f(0))},E=()=>{S(y)};if((g==null?void 0:g.type)!==z.FresnelReflector)return null;const W=b.current?": "+Y.t("message.NotApplicableToSelectedAction",v)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("solarCollectorMenu.ExtraPoleHeightInAdditionToHalfWidth",v),rejectedMessage:W,onApply:E,onClose:R,onClickCancel:M,onClickOk:D,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:5,style:{width:120},step:.1,precision:2,value:y,onChange:j=>{j!==null&&w(j)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",v),": [0, 5] ",Y.t("word.MeterAbbreviation",v)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",v)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:T,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("fresnelReflectorMenu.OnlyThisFresnelReflector",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("fresnelReflectorMenu.AllFresnelReflectorsAboveFoundation",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllSelectedFresnelReflectors",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllFresnelReflectors",v)})]})})})]})})},Sho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(Jq),i=H(Kq),a=H(qq),l=H(En),s=H(Mb),c=H(Ib),u=H(no),d=H(Zn),f=co(z.FresnelReflector),[p,g]=m.useState((f==null?void 0:f.reflectance)??.9),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.FresnelReflector&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.FresnelReflector&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.FresnelReflector&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.reflectance)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.FresnelReflector&&!R.locked&&A.has(R.id)&&(R.reflectance=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for Selected Fresnel Reflectors",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.FresnelReflector&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Fresnel Reflectors",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.FresnelReflector,S.newValue)}};l(S),a(z.FresnelReflector,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.FresnelReflector&&R.foundationId===f.foundationId&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Fresnel Reflectors Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.FresnelReflector,S.groupId,S.newValue)}};l(S),i(z.FresnelReflector,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.reflectance:f.reflectance,R={name:"Set Fresnel Reflector Reflectance",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.fresnelReflectorReflectance=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.FresnelReflector?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,value:p,step:.01,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("fresnelReflectorMenu.OnlyThisFresnelReflector",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("fresnelReflectorMenu.AllFresnelReflectorsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllSelectedFresnelReflectors",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllFresnelReflectors",y)})]})})})]})})},Tho=t=>{const e=[];if(t.type!==z.FresnelReflector)return{items:e};const n=t,o={lng:H.getState().language},r=!n.locked;return e.push({key:"fresnel-reflector-copy",label:h.jsx(Ld,{})}),r&&e.push({key:"fresnel-reflector-cut",label:h.jsx(Wd,{})}),e.push({key:"fresnel-reflector-lock",label:h.jsx(Ju,{selectedElement:n})}),r&&e.push({key:"fresnel-reflector-receiver",label:h.jsxs(to,{Dialog:Aho,children:[Y.t("fresnelReflectorMenu.SelectAbsorberToReflectSunlightTo",o)," ..."]})},{key:"fresnel-reflector-length",label:h.jsxs(to,{Dialog:who,children:[Y.t("word.Length",o)," ..."]})},{key:"fresnel-reflector-width",label:h.jsxs(to,{Dialog:vho,children:[Y.t("word.Width",o)," ..."]})},{key:"fresnel-reflector-module-length",label:h.jsxs(to,{Dialog:xho,children:[Y.t("fresnelReflectorMenu.ModuleLength",o)," ..."]})},{key:"fresnel-reflector-pole-height",label:h.jsxs(to,{Dialog:bho,children:[Y.t("solarCollectorMenu.ExtraPoleHeight",o)," ..."]})},{key:"fresnel-reflector-reflectance",label:h.jsxs(to,{Dialog:Sho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",o)," ..."]})},{key:"fresnel-reflector-draw-sun-beam",label:h.jsxs(to,{Dialog:mho,children:[Y.t("solarCollectorMenu.DrawSunBeam",o)," ..."]})},{key:"fresnel-reflector-label-submenu",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",o)}),children:PA(n)}),{items:e}},Pho=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(lYe),r=H(sYe),i=H(cYe),a=H(En),l=H(zb),s=H(Db),c=H(no),u=H(Zn),d=co(z.Heliostat),[f,p]=m.useState(!!(d!=null&&d.drawSunBeam)),g=Jt(),y=T=>{s(T.target.value)},w=T=>{switch(l){case oe.AllSelectedObjectsOfThisType:for(const A of e)if(A.type===z.Heliostat&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&A.drawSunBeam!==T)return!0;break;case oe.AllObjectsOfThisType:for(const A of e)if(A.type===z.Heliostat&&!A.locked&&A.drawSunBeam!==T)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const A of e)if(A.type===z.Heliostat&&A.foundationId===(d==null?void 0:d.foundationId)&&!A.locked&&A.drawSunBeam!==T)return!0;break;default:if((d==null?void 0:d.drawSunBeam)!==T)return!0}return!1},b=(T,A)=>{H.getState().set(x=>{for(const S of x.elements)S.type===z.Heliostat&&!S.locked&&T.has(S.id)&&(S.drawSunBeam=A)})},C=T=>{if(d&&w(T))switch(l){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of e)S.type===z.Heliostat&&H.getState().selectedElementIdSet.has(S.id)&&A.set(S.id,S.drawSunBeam);const x={name:"Draw Sun Beam for Selected Heliostats",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())o(S,R)},redo:()=>{b(x.oldValues,x.newValue)}};a(x),b(A,T),u(c+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of e)S.type===z.Heliostat&&A.set(S.id,S.drawSunBeam);const x={name:"Draw Sun Beam for All Heliostats",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())o(S,R)},redo:()=>{i(z.Heliostat,x.newValue)}};a(x),i(z.Heliostat,T),u(c+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(d.foundationId){const A=new Map;for(const S of e)S.type===z.Heliostat&&S.foundationId===d.foundationId&&A.set(S.id,S.drawSunBeam);const x={name:"Draw Sun Beam for All Heliostats Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:d.foundationId,undo:()=>{for(const[S,R]of x.oldValues.entries())o(S,R)},redo:()=>{x.groupId&&r(z.Heliostat,x.groupId,x.newValue)}};a(x),r(z.Heliostat,d.foundationId,T),u(c+1)}break}default:{const A=n(d.id),x=A?A.drawSunBeam:d.drawSunBeam,S={name:"Draw Sun Beam for Heliostat",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:d.id,changedElementType:d.type,undo:()=>{o(S.changedElementId,S.oldValue)},redo:()=>{o(S.changedElementId,S.newValue)}};a(S),o(d.id,T),u(c+1);break}}},P=()=>{t(!1)},v=()=>{C(f)};return(d==null?void 0:d.type)!==z.Heliostat?null:h.jsx(so,{width:500,title:Y.t("solarCollectorMenu.DrawSunBeam",g),onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:4,children:h.jsx(xc,{checked:f,onChange:p})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:20,children:h.jsx(Ue.Group,{onChange:y,value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("heliostatMenu.OnlyThisHeliostat",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("heliostatMenu.AllHeliostatsAboveFoundation",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("heliostatMenu.AllSelectedHeliostats",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("heliostatMenu.AllHeliostats",g)})]})})})]})})},{Option:Cho}=_o,Rho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(PYe),i=H(CYe),a=H(RYe),l=H(En),s=H(zb),c=H(Db),u=H(no),d=H(Zn),f=co(z.Heliostat),[p,g]=m.useState((f==null?void 0:f.towerId)??"None"),y=Jt(),w=m.useMemo(()=>{const x=[];for(const S of n)if(S.type===z.Foundation){const R=S;R.solarStructure===Dn.FocusTower&&x.push(R.id)}return x},[n]);m.useEffect(()=>{if(g("None"),f)if(f.towerId)g(f.towerId);else{const x=o(f.parentId);x&&x.type===z.Foundation&&x.solarStructure===Dn.FocusTower&&g(x.id)}},[f]);const b=x=>{c(x.target.value)},C=x=>{switch(s){case oe.AllSelectedObjectsOfThisType:for(const S of n)if(S.type===z.Heliostat&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&S.towerId!==x)return!0;break;case oe.AllObjectsOfThisType:for(const S of n)if(S.type===z.Heliostat&&!S.locked&&S.towerId!==x)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const S of n)if(S.type===z.Heliostat&&S.foundationId===(f==null?void 0:f.foundationId)&&!S.locked&&S.towerId!==x)return!0;break;default:if((f==null?void 0:f.towerId)!==x)return!0}return!1},P=(x,S)=>{H.getState().set(R=>{for(const M of R.elements)M.type===z.Heliostat&&!M.locked&&x.has(M.id)&&(M.towerId=S)})},v=x=>{if(f&&C(x)){switch(s){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.Heliostat&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M.towerId);const R={name:"Set Tower for Selected Heliostats",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{P(R.oldValues,R.newValue)}};l(R),P(S,x),d(u+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.Heliostat&&S.set(M.id,M.towerId);const R={name:"Set Tower for All Heliostats",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{a(z.Heliostat,R.newValue)}};l(R),a(z.Heliostat,x),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const S=new Map;for(const M of n)M.type===z.Heliostat&&M.foundationId===f.foundationId&&S.set(M.id,M.towerId);const R={name:"Set Tower for All Heliostats Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:f.foundationId,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{R.groupId&&i(z.Heliostat,R.groupId,R.newValue)}};l(R),i(z.Heliostat,f.foundationId,x),d(u+1)}break}default:{const S=o(f.id),R=S?S.towerId:f.towerId,M={name:"Set Tower for Heliostat",timestamp:Date.now(),oldValue:R,newValue:x,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(M.changedElementId,M.oldValue)},redo:()=>{r(M.changedElementId,M.newValue)}};l(M),r(f.id,x),d(u+1);break}}e(S=>{S.actionState.heliostatTower=x})}},T=()=>{t(!1)},A=()=>{p&&v(p),t(!1),d(0)};return(f==null?void 0:f.type)!==z.Heliostat?null:h.jsx(so,{width:600,title:Y.t("heliostatMenu.SelectTowerToReflectSunlightTo",y),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:8,children:h.jsx(_o,{style:{width:"120px"},value:p,onChange:g,children:w.map((x,S)=>h.jsx(Cho,{value:x,children:Y.t("heliostatMenu.Tower",y)+" "+(S+1)},S))})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:b,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("heliostatMenu.OnlyThisHeliostat",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("heliostatMenu.AllHeliostatsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("heliostatMenu.AllSelectedHeliostats",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("heliostatMenu.AllHeliostats",y)})]})})})]})})},Hho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(u3),i=H(Vq),a=H(gW),l=H(qr),s=H(En),c=H(zb),u=H(Db),d=H(no),f=H(Zn),p=H(Vi),g=co(z.Heliostat),[y,w]=m.useState((g==null?void 0:g.lx)??2),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.lx=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.Heliostat&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.lx-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.Heliostat&&!k.locked&&Math.abs(k.lx-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.Heliostat&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.lx-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.lx)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.Heliostat&&!F.locked&&L.has(F.id)&&(F.lx=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.Heliostat&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.Heliostat&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.lx);const N={name:"Set Length for Selected Heliostats",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.Heliostat&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.Heliostat&&k.set(F.id,F.lx);const N={name:"Set Length for All Heliostats",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.Heliostat,N.newValue)}};s(N),a(z.Heliostat,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.Heliostat&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.Heliostat&&F.foundationId===g.foundationId&&k.set(F.id,F.lx);const N={name:"Set Length for All Heliostats Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.Heliostat,N.groupId,N.newValue)}};s(N),i(z.Heliostat,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.lx:g.lx;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Heliostat Length",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.heliostatLength=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{R(y),b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.Heliostat)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("word.Length",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:20,step:.5,style:{width:120},precision:2,value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 20 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("heliostatMenu.OnlyThisHeliostat",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("heliostatMenu.AllHeliostatsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("heliostatMenu.AllSelectedHeliostats",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("heliostatMenu.AllHeliostats",P)})]})})})]})})},Mho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(Iw),i=H(Gq),a=H(mW),l=H(qr),s=H(En),c=H(zb),u=H(Db),d=H(no),f=H(Zn),p=H(Vi),g=co(z.Heliostat),[y,w]=m.useState((g==null?void 0:g.ly)??4),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.ly=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.Heliostat&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.ly-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.Heliostat&&!k.locked&&Math.abs(k.ly-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.Heliostat&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.ly-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.ly)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.Heliostat&&!F.locked&&L.has(F.id)&&(F.ly=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.Heliostat&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.ly);else{const k=new Map;for(const F of n)F.type===z.Heliostat&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.ly);const N={name:"Set Width for Selected Heliostats",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.Heliostat&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.ly);else{const k=new Map;for(const F of n)F.type===z.Heliostat&&k.set(F.id,F.ly);const N={name:"Set Width for All Heliostats",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.Heliostat,N.newValue)}};s(N),a(z.Heliostat,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.Heliostat&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.ly);else{const k=new Map;for(const F of n)F.type===z.Heliostat&&F.foundationId===g.foundationId&&k.set(F.id,F.ly);const N={name:"Set Width for All Heliostats Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.Heliostat,N.groupId,N.newValue)}};s(N),i(z.Heliostat,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.ly:g.ly;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Heliostat Width",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.heliostatWidth=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{R(y),b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.Heliostat)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("word.Width",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:20,step:.5,precision:2,style:{width:120},value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 20 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("heliostatMenu.OnlyThisHeliostat",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("heliostatMenu.AllHeliostatsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("heliostatMenu.AllSelectedHeliostats",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("heliostatMenu.AllHeliostats",P)})]})})})]})})},Iho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(wW),i=H(vW),a=H(xW),l=H(qr),s=H(En),c=H(zb),u=H(Db),d=H(no),f=H(Zn),p=H(Vi),g=co(z.Heliostat),[y,w]=m.useState((g==null?void 0:g.poleHeight)??1),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=W=>{u(W.target.value)},T=W=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const j of n)if(j.type===z.Heliostat&&!j.locked&&H.getState().selectedElementIdSet.has(j.id)&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const j of n)if(j.type===z.Heliostat&&!j.locked&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const j of n)if(j.type===z.Heliostat&&j.foundationId===(g==null?void 0:g.foundationId)&&!j.locked&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{if(l(g)){for(const L of n)if(L.type===z.Heliostat&&L.parentId===g.parentId&&!L.locked&&Math.abs(L.poleHeight-W)>It)return!0}break}default:{if(Math.abs((g==null?void 0:g.poleHeight)-W)>It)return!0;break}}return!1}},A=(W,j)=>{H.getState().set(L=>{for(const k of L.elements)k.type===z.Heliostat&&!k.locked&&W.has(k.id)&&(k.poleHeight=j)})},x=W=>{if(g&&T(W)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const j of n)if(j.type===z.Heliostat&&H.getState().selectedElementIdSet.has(j.id)&&.5*Math.max(j.lx,j.ly)*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.Heliostat&&H.getState().selectedElementIdSet.has(k.id)&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for Selected Heliostats",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{A(L.oldValues,L.newValue)}};s(L),A(j,W),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const j of n)if(j.type===z.Heliostat&&.5*Math.max(j.lx,j.ly)*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.Heliostat&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for All Heliostats",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{a(z.Heliostat,L.newValue)}};s(L),a(z.Heliostat,W),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const j of n)if(j.type===z.Heliostat&&j.foundationId===g.foundationId&&.5*Math.max(j.lx,j.ly)*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.Heliostat&&k.foundationId===g.foundationId&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for All Heliostats Above Foundation",timestamp:Date.now(),oldValues:j,newValue:W,groupId:g.foundationId,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{L.groupId&&i(z.Heliostat,L.groupId,L.newValue)}};s(L),i(z.Heliostat,g.foundationId,W),f(d+1)}}break}default:{const j=o(g.id),L=j?j.poleHeight:g.poleHeight;if(b.current=.5*Math.max(g.lx,g.ly)*Math.abs(Math.sin(g.tiltAngle))>W,b.current)C.current=W,w(L);else{const k={name:"Set Heliostat Pole Height",timestamp:Date.now(),oldValue:L,newValue:W,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(k.changedElementId,k.oldValue)},redo:()=>{r(k.changedElementId,k.newValue)}};s(k),r(g.id,W),f(d+1)}break}}e(j=>{j.actionState.heliostatPoleHeight=W})}},S=()=>{b.current=!1,t(!1)},R=()=>{S(),p()},M=()=>{x(y),b.current||(t(!1),f(0))},D=()=>{x(y)};if((g==null?void 0:g.type)!==z.Heliostat)return null;const E=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("solarCollectorMenu.ExtraPoleHeightInAdditionToHalfWidth",P),rejectedMessage:E,onApply:D,onClose:S,onClickCancel:R,onClickOk:M,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:5,style:{width:120},step:.1,precision:2,value:y,onChange:W=>{W!==null&&w(W)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",P),": [0, 5] ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("heliostatMenu.OnlyThisHeliostat",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("heliostatMenu.AllHeliostatsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("heliostatMenu.AllSelectedHeliostats",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("heliostatMenu.AllHeliostats",P)})]})})})]})})},zho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(hYe),i=H(pYe),a=H(gYe),l=H(qr),s=H(En),c=H(zb),u=H(Db),d=H(no),f=H(Zn),p=co(z.Heliostat),[g,y]=m.useState((p==null?void 0:p.poleRadius)??.1),w=Jt(),b=x=>{u(x.target.value)},C=x=>{if(p){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const S of n)if(S.type===z.Heliostat&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&Math.abs(S.poleRadius-x)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const S of n)if(S.type===z.Heliostat&&!S.locked&&Math.abs(S.poleRadius-x)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const S of n)if(S.type===z.Heliostat&&S.foundationId===(p==null?void 0:p.foundationId)&&!S.locked&&Math.abs(S.poleRadius-x)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{if(l(p)){for(const R of n)if(R.type===z.Heliostat&&R.parentId===p.parentId&&!R.locked&&Math.abs(R.poleRadius-x)>It)return!0}break}default:{if(Math.abs((p==null?void 0:p.poleRadius)-x)>It)return!0;break}}return!1}},P=(x,S)=>{H.getState().set(R=>{for(const M of R.elements)M.type===z.Heliostat&&!M.locked&&x.has(M.id)&&(M.poleRadius=S)})},v=x=>{if(p&&C(x)){switch(c){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.Heliostat&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M.poleRadius);const R={name:"Set Pole Radius for Selected Heliostats",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{P(R.oldValues,R.newValue)}};s(R),P(S,x),f(d+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.Heliostat&&S.set(M.id,M.poleRadius);const R={name:"Set Pole Radius for All Heliostats",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{a(z.Heliostat,R.newValue)}};s(R),a(z.Heliostat,x),f(d+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){const S=new Map;for(const M of n)M.type===z.Heliostat&&M.foundationId===p.foundationId&&S.set(M.id,M.poleRadius);const R={name:"Set Pole Radius for All Heliostats Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:p.foundationId,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{R.groupId&&i(z.Heliostat,R.groupId,R.newValue)}};s(R),i(z.Heliostat,p.foundationId,x),f(d+1)}break}default:{const S=o(p.id),R=S?S.poleRadius:p.poleRadius,M={name:"Set Heliostat Pole Radius",timestamp:Date.now(),oldValue:R,newValue:x,changedElementId:p.id,changedElementType:p.type,undo:()=>{r(M.changedElementId,M.oldValue)},redo:()=>{r(M.changedElementId,M.newValue)}};s(M),r(p.id,x),f(d+1);break}}e(S=>{S.actionState.heliostatPoleRadius=x})}},T=()=>{t(!1)},A=()=>{v(g)};return(p==null?void 0:p.type)!==z.Heliostat?null:h.jsx(so,{width:600,title:Y.t("solarCollectorMenu.PoleRadius",w),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:.5,style:{width:120},step:.01,precision:2,value:g,onChange:x=>{x!==null&&y(x)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",w),": [0.1, 0.5] ",Y.t("word.MeterAbbreviation",w)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",w)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:b,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("heliostatMenu.OnlyThisHeliostat",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("heliostatMenu.AllHeliostatsAboveFoundation",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("heliostatMenu.AllSelectedHeliostats",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("heliostatMenu.AllHeliostats",w)})]})})})]})})},Dho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(Jq),i=H(Kq),a=H(qq),l=H(En),s=H(zb),c=H(Db),u=H(no),d=H(Zn),f=co(z.Heliostat),[p,g]=m.useState((f==null?void 0:f.reflectance)??.9),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.Heliostat&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.Heliostat&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.Heliostat&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.reflectance)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.Heliostat&&!R.locked&&A.has(R.id)&&(R.reflectance=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.Heliostat&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for Selected Heliostats",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.Heliostat&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Heliostats",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.Heliostat,S.newValue)}};l(S),a(z.Heliostat,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.Heliostat&&R.foundationId===f.foundationId&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Heliostats Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.Heliostat,S.groupId,S.newValue)}};l(S),i(z.Heliostat,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.reflectance:f.reflectance,R={name:"Set Heliostat Reflectance",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.heliostatReflectance=A})}},v=()=>{t(!1)},T=()=>{P(p),t(!1),d(0)};return(f==null?void 0:f.type)!==z.Heliostat?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("heliostatMenu.OnlyThisHeliostat",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("heliostatMenu.AllHeliostatsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("heliostatMenu.AllSelectedHeliostats",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("heliostatMenu.AllHeliostats",y)})]})})})]})})},Eho=t=>{const e=[];if(t.type!==z.Heliostat)return{items:e};const n=t,o={lng:H.getState().language},r=!n.locked;return e.push({key:"heliostat-copy",label:h.jsx(Ld,{})}),r&&e.push({key:"heliostat-cut",label:h.jsx(Wd,{})}),e.push({key:"heliostat-lock",label:h.jsx(Ju,{selectedElement:n})}),r&&e.push({key:"heliostat-tower",label:h.jsxs(to,{Dialog:Rho,children:[Y.t("heliostatMenu.SelectTowerToReflectSunlightTo",o)," ..."]})},{key:"heliostat-length",label:h.jsxs(to,{Dialog:Hho,children:[Y.t("word.Length",o)," ..."]})},{key:"heliostat-width",label:h.jsxs(to,{Dialog:Mho,children:[Y.t("word.Width",o)," ..."]})},{key:"heliostat-pole-height",label:h.jsxs(to,{Dialog:Iho,children:[Y.t("solarCollectorMenu.ExtraPoleHeight",o)," ..."]})},{key:"heliostat-pole-radius",label:h.jsxs(to,{Dialog:zho,children:[Y.t("solarCollectorMenu.PoleRadius",o)," ..."]})},{key:"heliostat-reflectance",label:h.jsxs(to,{Dialog:Dho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",o)," ..."]})},{key:"heliostat-draw-sun-beam",label:h.jsxs(to,{Dialog:Pho,children:[Y.t("solarCollectorMenu.DrawSunBeam",o)," ..."]})},{key:"heliostat-label-submenu",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",o)}),children:PA(n)}),{items:e}},{Option:ym}=_o,Fho=be.memo(({tree:t})=>{const e=H(fn),n=H(En),[o,r]=m.useState(!1),i=Jt(),a=(l,s)=>{e(c=>{for(const u of c.elements)if(u.type===z.Tree&&u.id===l){u.name=s;break}})};return h.jsxs(_o,{style:{width:"160px"},value:(t==null?void 0:t.name)??pr.Pine,onChange:l=>{if(t){const s=t.name;if(s!==l){const c={name:"Change Tree",timestamp:Date.now(),oldValue:s,newValue:l,changedElementId:t.id,changedElementType:t.type,undo:()=>{a(c.changedElementId,c.oldValue)},redo:()=>{a(c.changedElementId,c.newValue)}};n(c),a(t.id,l),e(u=>{u.actionState.treeType=l}),r(!o)}}},children:[h.jsxs(ym,{value:pr.Apple,children:[h.jsx("img",{alt:pr.Apple,src:sde,height:20,style:{paddingRight:"8px"}})," ",Y.t("tree.Apple",i)]},pr.Apple),h.jsxs(ym,{value:pr.Birch,children:[h.jsx("img",{alt:pr.Birch,src:cde,height:20,style:{paddingRight:"20px"}})," ",Y.t("tree.Birch",i)]},pr.Birch),h.jsxs(ym,{value:pr.Coconut,children:[h.jsx("img",{alt:pr.Coconut,src:nQe,height:20,style:{paddingRight:"18px"}})," ",Y.t("tree.Coconut",i)]},pr.Coconut),h.jsxs(ym,{value:pr.Dogwood,children:[h.jsx("img",{alt:pr.Dogwood,src:ude,height:20,style:{paddingRight:"10px"}})," ",Y.t("tree.Dogwood",i)]},pr.Dogwood),h.jsxs(ym,{value:pr.Elm,children:[h.jsx("img",{alt:pr.Elm,src:dde,height:20,style:{paddingRight:"20px"}}),Y.t("tree.Elm",i)]},pr.Elm),h.jsxs(ym,{value:pr.FanPalm,children:[h.jsx("img",{alt:pr.FanPalm,src:oQe,height:20,style:{paddingRight:"18px"}})," ",Y.t("tree.FanPalm",i)]},pr.FanPalm),h.jsxs(ym,{value:pr.Linden,children:[h.jsx("img",{alt:pr.Linden,src:fde,height:20,style:{paddingRight:"10px"}})," ",Y.t("tree.Linden",i)]},pr.Linden),h.jsxs(ym,{value:pr.Magnolia,children:[h.jsx("img",{alt:pr.Magnolia,src:hde,height:20,style:{paddingRight:"10px"}})," ",Y.t("tree.Magnolia",i)]},pr.Magnolia),h.jsxs(ym,{value:pr.Maple,children:[h.jsx("img",{alt:pr.Maple,src:pde,height:20,style:{paddingRight:"12px"}})," ",Y.t("tree.Maple",i)]},pr.Maple),h.jsxs(ym,{value:pr.Oak,children:[h.jsx("img",{alt:pr.Oak,src:gde,height:20,style:{paddingRight:"17px"}}),Y.t("tree.Oak",i)]},pr.Oak),h.jsxs(ym,{value:pr.Pine,children:[h.jsx("img",{alt:pr.Pine,src:rQe,height:20,style:{paddingRight:"18px"}})," ",Y.t("tree.Pine",i)]},pr.Pine),h.jsxs(ym,{value:pr.Spruce,children:[h.jsx("img",{alt:pr.Spruce,src:iQe,height:20,style:{paddingRight:"20px"}})," ",Y.t("tree.Spruce",i)]},pr.Spruce)]})}),kho=t=>{const e=[];if(t.type!==z.Tree)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language};return e.push({key:"tree-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"tree-cut",label:h.jsx(Wd,{})}),e.push({key:"tree-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&(e.push({key:"tree-show-model",label:h.jsx(Ldo,{tree:n})},{key:"tree-flip",label:h.jsx(I9e,{billboardModel:n})}),e.push({key:"tree-change-type",label:h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"100px"},children:[Y.t("treeMenu.Type",r),": "]}),h.jsx(Fho,{tree:n})]})},{key:"tree-spread",label:h.jsx(Wdo,{tree:n})},{key:"tree-height",label:h.jsx(Ndo,{tree:n})},{key:"tree-label-submenu",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",r)}),children:PA(n)})),{items:e}},Lho=({wall:t,objectType:e,modalTitle:n,onClickOk:o,children:r})=>{const i=H.getState().removeAllChildElementsByType,a=()=>{const s=H.getState().elements.filter(d=>!d.locked&&d.type===e&&d.parentId===t.id);i(t.id,e);const c=JSON.parse(JSON.stringify(s)),u={name:`Remove All ${e}s on Wall`,timestamp:Date.now(),parentId:t.id,removedElements:c,undo:()=>{H.getState().set(d=>{d.elements.push(...u.removedElements)})},redo:()=>{i(u.parentId,e)}};H.getState().addUndoable(u)},l=()=>{const s=o??a;Oi.confirm({title:n,icon:h.jsx(ny,{}),onOk:s})};return h.jsx(rn,{update:!0,noPadding:!0,onClick:l,children:r})},IHe=({wall:t,objectType:e,lock:n,children:o})=>{const r=H.getState().updateElementLockById,i=H.getState().updateElementLockByParentId,a=()=>{const l=e.replaceAll(" ",""),s=new Map;for(const d of H.getState().elements)d.parentId===t.id&&d.type===e&&s.set(d.id,!!d.locked);i(t.id,e,n);const u={name:n?`Lock All Unlocked ${l} on Wall`:`Unlock All Locked ${l} on Wall`,timestamp:Date.now(),oldValues:s,newValue:!0,undo:()=>{for(const[d,f]of u.oldValues.entries())r(d,f)},redo:()=>{i(t.id,e,n)}};H.getState().addUndoable(u)};return h.jsx(rn,{stayAfterClick:!0,update:!0,noPadding:!0,onClick:a,children:o})},Who=({wall:t})=>{const e=Jt(),n=H.getState().set,o=(i,a)=>{n(l=>{const s=l.elements.find(c=>c.id===i&&c.type===z.Wall);s&&(s.parapet.display=a)})},r=i=>{const a=i.target.checked,l={name:"Parapet",timestamp:Date.now(),checked:a,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{o(t.id,!l.checked)},redo:()=>{o(t.id,l.checked)}};H.getState().addUndoable(l),o(t.id,a),n(s=>{s.actionState.wallParapet.display=a})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.parapet.display,onChange:r,children:Y.t("wallMenu.Parapet",e)})})},Nho=({wall:t})=>{const e=Jt(),n=(i,a)=>{H.getState().set(l=>{for(const s of l.elements)if(s.id===i&&s.type===z.Wall){const c=s;c.wallStructure=a,(a===gc.Stud||a===gc.Pillar)&&(c.opacity=0);break}})},o=i=>{const a={name:"Select Wall Structure",timestamp:Date.now(),oldValue:t.wallStructure,newValue:i.target.value,changedElementId:t.id,changedElementType:t.type,undo:()=>{n(a.changedElementId,a.oldValue)},redo:()=>{n(a.changedElementId,a.newValue)}};H.getState().addUndoable(a),n(t.id,i.target.value),H.getState().set(l=>{l.actionState.wallStructure=i.target.value,(l.actionState.wallStructure===gc.Stud||l.actionState.wallStructure===gc.Pillar)&&(l.actionState.wallOpacity=0)})},r=t.wallStructure??gc.Default;return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Ue.Group,{value:r,onChange:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:gc.Default,children:Y.t("wallMenu.DefaultStructure",e)}),h.jsx(Ue,{style:{width:"100%"},value:gc.Stud,children:Y.t("wallMenu.StudStructure",e)}),h.jsx(Ue,{style:{width:"100%"},value:gc.Pillar,children:Y.t("wallMenu.PillarStructure",e)})]})})})},Uho=({wall:t})=>{const e=H.getState().set,n=Jt(),o=(i,a,l)=>{const{cx:s,cy:c,cz:u}=a,d=l?l.rotation[2]+a.relativeAngle:a.relativeAngle;if(l&&d!==void 0){const f=me.wallAbsolutePosition(new ie(s,c,u),l).setZ(a.lz/2+l.lz);return new ie().subVectors(i,f).applyEuler(new nn(0,0,-d))}return new ie},r=()=>{const i=H.getState().getFoundation(t);if(!i)return;const a=o(H.getState().pastePoint,t,i),l=Ga.makePolygon(t,-a.x/t.lx,0,-a.z/t.lz,new ie(0,0,1),[0,0,0],z.Wall);e(c=>{c.elements.push(l),c.objectTypeToAdd=z.None});const s={name:"Add",timestamp:Date.now(),addedElement:l,undo:()=>{H.getState().removeElementById(s.addedElement.id,!1)},redo:()=>{e(c=>{c.elements.push(s.addedElement),c.selectedElement=s.addedElement})}};H.getState().addUndoable(s)};return h.jsx(rn,{onClick:r,children:Y.t("foundationMenu.AddPolygon",n)})},jho=({wall:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&l.type===z.Wall){l.fill=i;break}})},o=r=>{const i={name:"Select Wall Fill",timestamp:Date.now(),oldValue:t.fill,newValue:r.target.value,changedElementId:t.id,changedElementType:t.type,undo:()=>{n(i.changedElementId,i.oldValue)},redo:()=>{n(i.changedElementId,i.newValue)}};H.getState().addUndoable(i),n(t.id,r.target.value)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Ue.Group,{value:t.fill,onChange:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:El.Full,children:Y.t("wallMenu.Full",e)}),h.jsx(Ue,{style:{width:"100%"},value:El.Partial,children:Y.t("wallMenu.Partial",e)}),h.jsx(Ue,{style:{width:"100%"},value:El.Empty,children:Y.t("wallMenu.Empty",e)})]})})})},Bho=({wall:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&l.type===z.Wall){l.openToOutside=i;break}})},o=r=>{const i={name:"Set Open to Outside",timestamp:Date.now(),oldValue:!!t.openToOutside,newValue:r.target.checked,changedElementId:t.id,changedElementType:t.type,undo:()=>{n(i.changedElementId,i.oldValue)},redo:()=>{n(i.changedElementId,i.newValue)}};H.getState().addUndoable(i),n(t.id,r.target.checked)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:!!t.openToOutside,onChange:o,children:Y.t("wallMenu.OpenToOutside",e)})})},Bae=[{key:"solarPanelCount",lockedKey:"lockedSolarPanelCount",objectType:z.SolarPanel},{key:"windowCount",lockedKey:"lockedWindowCount",objectType:z.Window},{key:"doorCount",lockedKey:"lockedDoorCount",objectType:z.Door},{key:"sensorCount",lockedKey:"lockedSensorCount",objectType:z.Sensor},{key:"polygonCount",lockedKey:"lockedPolygonCount",objectType:z.Polygon},{key:"outsideLightCount",lockedKey:"lockedLightCount",objectType:z.Light}],Yho=(t,e)=>{const n={lng:H.getState().language};let o="",r="";switch(t){case z.SolarPanel:{o=`${Y.t("wallMenu.RemoveAllUnlockedSolarPanels",n)} (${e})`,r=`${Y.t("wallMenu.DoYouReallyWantToRemoveAllSolarPanelsOnThisWall",n)} (${e} ${Y.t("wallMenu.SolarPanels",n)})`;break}case z.Window:{o=`${Y.t("wallMenu.RemoveAllUnlockedWindows",n)} (${e})`,r=`${Y.t("wallMenu.DoYouReallyWantToRemoveAllWindowsOnThisWall",n)} (${e} ${Y.t("wallMenu.Windows",n)})`;break}case z.Door:{o=`${Y.t("wallMenu.RemoveAllUnlockedDoors",n)} (${e})`,r=`${Y.t("wallMenu.DoYouReallyWantToRemoveAllDoorsOnThisWall",n)} (${e} ${Y.t("wallMenu.Doors",n)})`;break}case z.Sensor:{o=`${Y.t("wallMenu.RemoveAllUnlockedSensors",n)} (${e})`,r=`${Y.t("wallMenu.DoYouReallyWantToRemoveAllSensorsOnThisWall",n)} (${e} ${Y.t("wallMenu.Sensors",n)})`;break}case z.Light:{o=`${Y.t("wallMenu.RemoveAllUnlockedLights",n)} (${e})`,r=`${Y.t("wallMenu.DoYouReallyWantToRemoveAllLightsOnThisWall",n)} (${e} ${Y.t("wallMenu.Lights",n)})`;break}case z.Polygon:{o=`${Y.t("wallMenu.RemoveAllUnlockedPolygons",n)} (${e})`,r=`${Y.t("wallMenu.DoYouReallyWantToRemoveAllPolygonsOnThisWall",n)} (${e} ${Y.t("wallMenu.Polygons",n)})`;break}}return{itemLabel:o,modalTitle:r}},Yae=(t,e,n,o)=>n===z.Light?o?t.lockedLightCount:t.insideLightCount+t.outsideLightCount:t[e],Oho=(t,e,n)=>{const o=[],r={lng:H.getState().language};return Bae.forEach(({key:i,objectType:a})=>{const l=Yae(n,i,a);if(typeof l=="number"&&l>0){const{itemLabel:s,modalTitle:c}=Yho(a,l),u=a.replaceAll(" ","");o.push({key:`remove-all-${u}s-on-wall`,label:h.jsx(Lho,{wall:t,objectType:a,modalTitle:c,children:s})})}}),Bae.forEach(({key:i,objectType:a})=>{const l=Yae(n,i,a);if(typeof l=="number"&&l>0){const s=a.replaceAll(" ","");o.push({key:`lock-all-${s}s-on-wall`,label:h.jsxs(IHe,{wall:t,objectType:a,lock:!0,children:[Y.t(`wallMenu.LockAllUnlocked${s}s`,r)," (",l,")"]})})}}),Bae.forEach(({lockedKey:i,objectType:a})=>{const l=Yae(e,i,a,!0);if(typeof l=="number"&&l>0){const s=a.replaceAll(" ","");o.push({key:`unlock-all-${s}s-on-wall`,label:h.jsxs(IHe,{wall:t,objectType:a,lock:!1,children:[Y.t(`wallMenu.UnlockAllLocked${s}s`,r)," (",l,")"]})})}}),e.outsideLightCount>0&&o.push({key:"inside-lights-on-wall",label:h.jsxs(pX,{element:t,inside:!0,children:[Y.t("wallMenu.AllLightsOnWallInside",r)," (",e.outsideLightCount,")"]})}),e.insideLightCount>0&&o.push({key:"outside-lights-on-wall",label:h.jsxs(pX,{element:t,inside:!1,children:[Y.t("wallMenu.AllLightsOnWallOutside",r)," (",e.insideLightCount,")"]})}),o},_ho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(p3),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Wall),c=Jt(),[u,d]=XZ((s==null?void 0:s.parapet.color)??"#ffffff"),f=(T,A)=>{e(x=>{for(const S of x.elements)if(S.id===T&&S.type===z.Wall&&!S.locked){S.parapet.color=A;break}})},p=T=>{if(!s)return;const A=me.getAllConnectedWalls(s);A.length!==0&&e(x=>{for(const S of A)if(!S.locked)for(const R of x.elements)R.id===S.id&&R.type===z.Wall&&(R.parapet.color=T)})},g=(T,A)=>{e(x=>{for(const S of x.elements)S.parentId===T&&S.type===z.Wall&&!S.locked&&(S.parapet.color=A)})},y=T=>{e(A=>{for(const x of A.elements)x.type===z.Wall&&!x.locked&&(x.parapet.color=T)})},w=(T,A)=>{e(x=>{for(const S of x.elements)S.type===z.Wall&&!S.locked&&T.has(S.id)&&(S.parapet.color=A)})},b=T=>{if(s){switch(r){case oe.AllSelectedObjectsOfThisType:{for(const A of n)if(A.type===z.Wall&&T!==A.parapet.color&&!A.locked&&H.getState().selectedElementIdSet.has(A.id))return!0;break}case oe.AllObjectsOfThisType:{for(const A of n)if(A.type===z.Wall&&T!==A.parapet.color&&!A.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const A of n)if(A.type===z.Wall&&A.foundationId===s.foundationId&&T!==A.parapet.color&&!A.locked)return!0;break}case oe.AllConnectedObjects:{const A=me.getAllConnectedWalls(s);for(const x of A)if(T!==x.parapet.color&&!x.locked)return!0;break}default:{if(T!==(s==null?void 0:s.parapet.color))return!0;break}}return!1}},C=T=>{if(s&&b(T)){switch(r){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Wall&&H.getState().selectedElementIdSet.has(S.id)&&A.set(S.id,S.parapet.color??"#ffffff");const x={name:"Set Parapet Color for Selected Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{w(x.oldValues,x.newValue)}};o(x),w(A,T),a(i+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Wall&&A.set(S.id,S.parapet.color??"#ffffff");const x={name:"Set Parapet Color for All Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{y(x.newValue)}};o(x),y(T),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const A=new Map;for(const S of n)S.type===z.Wall&&S.foundationId===s.foundationId&&A.set(S.id,S.parapet.color??"#ffffff");const x={name:"Set Parapet Color for All Walls Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.foundationId,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{x.groupId&&g(x.groupId,x.newValue)}};o(x),g(s.foundationId,T),a(i+1)}break;case oe.AllConnectedObjects:if(s){const A=me.getAllConnectedWalls(s),x=new Map;for(const R of A)x.set(R.id,R.color??"#ffffff");const S={name:"Set Parapet Color for All Connected Walls",timestamp:Date.now(),oldValues:x,newValue:T,undo:()=>{for(const[R,M]of S.oldValues.entries())f(R,M)},redo:()=>{p(S.newValue)}};o(S),p(T),a(i+1)}break;default:if(s){const A=l(s.id),x=(A==null?void 0:A.parapet.color)??s.parapet.color??"#ffffff",S={name:"Set Parapet Color of Selected Wall",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(S.changedElementId,S.oldValue)},redo:()=>{f(S.changedElementId,S.newValue)}};o(S),f(s.id,T),a(i+1)}}e(A=>{A.actionState.wallParapet.color=T})}},P=()=>{C(u)},v=()=>{t(!1)};return h.jsx(so,{width:640,title:Y.t("wallMenu.ParapetColor",c),onApply:P,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:u,onChangeComplete:d})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:T=>H.getState().setWallActionScope(T.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",c)})]})})})]})})},xrt="/aladdin/assets/wall_01_menu-BlJdKfby.png",brt="/aladdin/assets/wall_02_menu-DfsmvvWJ.png",Srt="/aladdin/assets/wall_03_menu-B95_FEuA.png",Trt="/aladdin/assets/wall_04_menu-D-Kn25E7.png",Prt="/aladdin/assets/wall_05_menu-DGgjaMY9.png",Crt="/aladdin/assets/wall_06_menu-EOIch2eu.png",Rrt="/aladdin/assets/wall_07_menu-DvXS_qn2.png",Hrt="/aladdin/assets/wall_08_menu-CfftE2pF.png",Mrt="/aladdin/assets/wall_09_menu-_O8A0WOE.png",Irt="/aladdin/assets/wall_10_menu-B5QfhD3g.png",Vho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(p3),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Wall),[c,u]=m.useState((s==null?void 0:s.parapet.textureType)??Uo.Default),d=Jt(),{Option:f}=_o,p=(A,x)=>{e(S=>{for(const R of S.elements)if(R.type===z.Wall&&R.id===A&&!R.locked){R.parapet.textureType=x;break}})},g=A=>{if(!s)return;const x=me.getAllConnectedWalls(s);x.length!==0&&e(S=>{for(const R of x)if(!R.locked)for(const M of S.elements)M.id===R.id&&M.type===z.Wall&&(M.parapet.textureType=A)})},y=(A,x)=>{e(S=>{for(const R of S.elements)R.type===z.Wall&&R.foundationId===A&&!R.locked&&(R.parapet.textureType=x)})},w=A=>{e(x=>{for(const S of x.elements)S.type===z.Wall&&!S.locked&&(S.parapet.textureType=A)})},b=(A,x)=>{e(S=>{for(const R of S.elements)R.type===z.Wall&&!R.locked&&A.has(R.id)&&(R.parapet.textureType=x)})},C=A=>{if(s){switch(r){case oe.AllSelectedObjectsOfThisType:{for(const x of n)if(x.type===z.Wall&&A!==x.parapet.textureType&&!x.locked&&H.getState().selectedElementIdSet.has(x.id))return!0;break}case oe.AllObjectsOfThisType:{for(const x of n)if(x.type===z.Wall&&A!==x.parapet.textureType&&!x.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const x of n)if(x.type===z.Wall&&x.foundationId===s.foundationId&&A!==x.parapet.textureType&&!x.locked)return!0;break}case oe.AllConnectedObjects:{const x=me.getAllConnectedWalls(s);for(const S of x)if(A!==S.parapet.textureType&&!S.locked)return!0;break}default:{if(A!==(s==null?void 0:s.parapet.textureType))return!0;break}}return!1}},P=A=>{if(s&&C(A)){switch(r){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.Wall&&!R.locked&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.parapet.textureType??Uo.Default);const S={name:"Set Parapet Texture for Selected Walls",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())p(R,M)},redo:()=>{b(S.oldValues,S.newValue)}};o(S),b(x,A),a(i+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.Wall&&!R.locked&&x.set(R.id,R.parapet.textureType??Uo.Default);const S={name:"Set Parapet Texture for All Walls",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())p(R,M)},redo:()=>{w(S.newValue)}};o(S),w(A),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const x=new Map;for(const R of n)R.type===z.Wall&&R.foundationId===s.foundationId&&!R.locked&&x.set(R.id,R.parapet.textureType);const S={name:"Set Parapet Texture for All Walls Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:s.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())p(R,M)},redo:()=>{S.groupId&&y(S.groupId,S.newValue)}};o(S),y(s.foundationId,A),a(i+1)}break;case oe.AllConnectedObjects:if(s){const x=me.getAllConnectedWalls(s),S=new Map;for(const M of x)S.set(M.id,M.parapet.textureType);const R={name:"Set Parapet Texture for All Connected Walls",timestamp:Date.now(),oldValues:S,newValue:A,undo:()=>{for(const[M,D]of R.oldValues.entries())p(M,D)},redo:()=>{g(R.newValue)}};o(R),g(A),a(i+1)}break;default:if(s){const x=l(s.id),S=(x==null?void 0:x.parapet.textureType)??s.parapet.textureType,R={name:"Set Parapet Texture of Selected Wall",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(R.changedElementId,R.oldValue)},redo:()=>{p(R.changedElementId,R.newValue)}};o(R),p(s.id,A),a(i+1)}}e(x=>{x.actionState.wallParapet.textureType=A})}},v=()=>{t(!1)},T=()=>{P(c)};return h.jsx(so,{width:550,title:Y.t("word.Texture",d),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:9,children:h.jsxs(_o,{style:{width:"150px"},value:c,onChange:u,children:[h.jsxs(f,{value:Uo.NoTexture,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"32px",height:"20px",border:"1px dashed dimGray"},children:" "}),Y.t("shared.NoTexture",d)]},Uo.NoTexture),h.jsxs(f,{value:Uo.Default,children:[h.jsx("img",{alt:Uo.Default,src:Dye,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.TextureDefault",d)]},Uo.Default),h.jsxs(f,{value:Uo.Texture01,children:[h.jsx("img",{alt:Uo.Texture01,src:xrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture01",d)]},Uo.Texture01),h.jsxs(f,{value:Uo.Texture02,children:[h.jsx("img",{alt:Uo.Texture02,src:brt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture02",d)]},Uo.Texture02),h.jsxs(f,{value:Uo.Texture03,children:[h.jsx("img",{alt:Uo.Texture03,src:Srt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture03",d)]},Uo.Texture03),h.jsxs(f,{value:Uo.Texture04,children:[h.jsx("img",{alt:Uo.Texture04,src:Trt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture04",d)]},Uo.Texture04),h.jsxs(f,{value:Uo.Texture05,children:[h.jsx("img",{alt:Uo.Texture05,src:Prt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture05",d)]},Uo.Texture05),h.jsxs(f,{value:Uo.Texture06,children:[h.jsx("img",{alt:Uo.Texture06,src:Crt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture06",d)]},Uo.Texture06),h.jsxs(f,{value:Uo.Texture07,children:[h.jsx("img",{alt:Uo.Texture07,src:Rrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture07",d)]},Uo.Texture07),h.jsxs(f,{value:Uo.Texture08,children:[h.jsx("img",{alt:Uo.Texture08,src:Hrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture08",d)]},Uo.Texture08),h.jsxs(f,{value:Uo.Texture09,children:[h.jsx("img",{alt:Uo.Texture09,src:Mrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture09",d)]},Uo.Texture09),h.jsxs(f,{value:Uo.Texture10,children:[h.jsx("img",{alt:Uo.Texture10,src:Irt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture10",d)]},Uo.Texture10)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:15,children:h.jsx(Ue.Group,{onChange:A=>H.getState().setWallActionScope(A.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",d)})]})})})]})})},Oae=({wall:t,dataType:e,attributeKey:n,range:o,step:r,unit:i,setDialogVisible:a})=>{const l=H(Kn),s=H(En),c=H(p3),u=H(no),d=H(Zn),f=H(fn),p=m.useRef(t.parapet[n]),g=Jt(),y=R=>{f(M=>{switch(n){case"copingsHeight":M.actionState.wallParapet.copingsHeight=R;break;case"copingsWidth":M.actionState.wallParapet.copingsWidth=R;break;case"parapetHeight":M.actionState.wallParapet.parapetHeight=R;break}})},w=(R,M)=>{f(D=>{for(const E of D.elements)if(E.id===R&&E.type===z.Wall&&!E.locked){E.parapet[n]=M;break}}),y(M)},b=R=>{const M=me.getAllConnectedWalls(t);M.length!==0&&(f(D=>{for(const E of M)if(!E.locked)for(const W of D.elements)W.id===E.id&&W.type===z.Wall&&(W.parapet[n]=R)}),y(R))},C=(R,M)=>{f(D=>{for(const E of D.elements)E.parentId===R&&E.type===z.Wall&&!E.locked&&(E.parapet[n]=M)}),y(M)},P=R=>{f(M=>{for(const D of M.elements)D.type===z.Wall&&!D.locked&&(D.parapet[n]=R)}),y(R)},v=(R,M)=>{f(D=>{for(const E of D.elements)E.type===z.Wall&&!E.locked&&R.has(E.id)&&(E.parapet[n]=M)}),y(M)},T=R=>{switch(c){case oe.AllSelectedObjectsOfThisType:{for(const M of l)if(M.type===z.Wall&&R!==M.parapet[n]&&!M.locked&&H.getState().selectedElementIdSet.has(M.id))return!0;break}case oe.AllObjectsOfThisType:{for(const M of l)if(M.type===z.Wall&&R!==M.parapet[n]&&!M.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const M of l)if(M.type===z.Wall&&M.foundationId===t.foundationId&&R!==M.parapet[n]&&!M.locked)return!0;break}case oe.AllConnectedObjects:{const M=me.getAllConnectedWalls(t);for(const D of M)if(R!==D.parapet[n]&&!D.locked)return!0;break}default:{if(R!==t.parapet[n])return!0;break}}return!1},A=R=>{if(t&&T(R))switch(c){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of l)E.type===z.Wall&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E.parapet[n]);const D={name:`Set ${e} for Selected Walls`,timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{v(D.oldValues,D.newValue)}};s(D),v(M,R),d(u+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of l)E.type===z.Wall&&M.set(E.id,E.parapet[n]);const D={name:`Set ${e} for All Walls`,timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{P(D.newValue)}};s(D),P(R),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(t.foundationId){const M=new Map;for(const E of l)E.type===z.Wall&&E.foundationId===t.foundationId&&M.set(E.id,E.parapet[n]);const D={name:`Set ${e} for All Walls Above Foundation`,timestamp:Date.now(),oldValues:M,newValue:R,groupId:t.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{D.groupId&&C(D.groupId,D.newValue)}};s(D),C(t.foundationId,R),d(u+1)}break;case oe.AllConnectedObjects:if(t){const M=me.getAllConnectedWalls(t),D=new Map;for(const W of M)D.set(W.id,W.parapet[n]);const E={name:`Set ${e} for All Connected Walls`,timestamp:Date.now(),oldValues:D,newValue:R,undo:()=>{for(const[W,j]of E.oldValues.entries())w(W,j)},redo:()=>{b(E.newValue)}};s(E),b(R),d(u+1)}break;default:if(t){const M=t.parapet[n],D={name:`Set Wall ${e}`,timestamp:Date.now(),oldValue:M,newValue:R,changedElementId:t.id,changedElementType:t.type,undo:()=>{w(D.changedElementId,D.oldValue)},redo:()=>{w(D.changedElementId,D.newValue)}};s(D),w(t.id,R),d(u+1)}}},x=()=>{a(!1)},S=()=>{A(p.current)};return h.jsx(so,{width:550,title:Y.t(`wallMenu.${e}`,g),onApply:S,onClose:x,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:o[0],max:o[1],style:{width:120},step:r,precision:2,defaultValue:t.parapet[n],onChange:R=>p.current=R}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",g),": [",o.toString(),"] ",i]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:i??" "}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:R=>H.getState().setWallActionScope(R.target.value),value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",g)})]})})})]})})};var gV=(t=>(t.ParapetHeight="ParapetHeight",t.CopingsHeight="CopingsHeight",t.CopingsWidth="CopingsWidth",t))(gV||{});const Gho={ParapetHeight:{attributeKey:"parapetHeight",range:[0,5],step:.01,unit:"word.MeterAbbreviation"},CopingsHeight:{attributeKey:"copingsHeight",range:[0,1],step:.01,unit:"word.MeterAbbreviation"},CopingsWidth:{attributeKey:"copingsWidth",range:[0,3],step:.01,unit:"word.MeterAbbreviation"}},_ae=({Dialog:t,wall:e,dataType:n,children:o})=>{const r=Jt(),[i,a]=m.useState(!1),l=()=>{H.getState().setApplyCount(0),a(!0)},s=Gho[n];return h.jsxs(h.Fragment,{children:[h.jsx(rn,{noPadding:!0,onClick:l,children:o}),i&&h.jsx(t,{wall:e,dataType:n,attributeKey:s.attributeKey,range:s.range,step:s.step,unit:s.unit?Y.t(s.unit,r):void 0,setDialogVisible:a})]})},Xho=t=>{const e={lng:H.getState().language},n=[];return n.push({key:"parapet-checkbox",label:h.jsx(Who,{wall:t})}),t.parapet.display&&n.push({type:"divider"},{key:"parapet-color",label:h.jsxs(to,{noPadding:!0,Dialog:_ho,children:[Y.t("wallMenu.ParapetColor",e)," ..."]})},{key:"parapet-texture",label:h.jsxs(to,{noPadding:!0,Dialog:Vho,children:[Y.t("wallMenu.ParapetTexture",e)," ..."]})},{key:"parapet-height",label:h.jsxs(_ae,{wall:t,dataType:gV.ParapetHeight,Dialog:Oae,children:[Y.t("wallMenu.ParapetHeight",e)," ..."]})},{key:"copings-height",label:h.jsxs(_ae,{wall:t,dataType:gV.CopingsHeight,Dialog:Oae,children:[Y.t("wallMenu.CopingsHeight",e)," ..."]})},{key:"copings-width",label:h.jsxs(_ae,{wall:t,dataType:gV.CopingsWidth,Dialog:Oae,children:[Y.t("wallMenu.CopingsWidth",e)," ..."]})}),n},cC=({wall:t,dataType:e,attributeKey:n,range:o,step:r,unit:i,setDialogVisible:a})=>{const l=H(Kn),s=H(En),c=H(p3),u=H(no),d=H(Zn),f=H(fn),p=m.useRef(t[n]),g=Jt(),y=R=>{f(M=>{switch(n){case"ly":M.actionState.wallThickness=R;break;case"lz":M.actionState.wallHeight=R;break;case"opacity":M.actionState.wallOpacity=R;break;case"structureSpacing":M.actionState.wallStructureSpacing=R;break;case"structureWidth":M.actionState.wallStructureWidth=R;break;case"eavesLength":M.actionState.wallEavesLength=R;break}})},w=(R,M)=>{f(D=>{for(const E of D.elements)if(E.id===R&&E.type===z.Wall&&!E.locked){E[n]=M;break}}),y(M)},b=R=>{const M=me.getAllConnectedWalls(t);M.length!==0&&(f(D=>{for(const E of M)if(!E.locked)for(const W of D.elements)W.id===E.id&&W.type===z.Wall&&(W[n]=R)}),y(R))},C=(R,M)=>{f(D=>{for(const E of D.elements)E.parentId===R&&E.type===z.Wall&&!E.locked&&(E[n]=M)}),y(M)},P=R=>{f(M=>{for(const D of M.elements)D.type===z.Wall&&!D.locked&&(D[n]=R)}),y(R)},v=(R,M)=>{f(D=>{for(const E of D.elements)E.type===z.Wall&&!E.locked&&R.has(E.id)&&(E[n]=M)}),y(M)},T=R=>{switch(c){case oe.AllSelectedObjectsOfThisType:{for(const M of l)if(M.type===z.Wall&&R!==M[n]&&!M.locked&&H.getState().selectedElementIdSet.has(M.id))return!0;break}case oe.AllObjectsOfThisType:{for(const M of l)if(M.type===z.Wall&&R!==M[n]&&!M.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const M of l)if(M.type===z.Wall&&M.foundationId===t.foundationId&&R!==M[n]&&!M.locked)return!0;break}case oe.AllConnectedObjects:{const M=me.getAllConnectedWalls(t);for(const D of M)if(R!==D[n]&&!D.locked)return!0;break}default:{if(R!==t[n])return!0;break}}return!1},A=R=>{if(t&&T(R))switch(c){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of l)E.type===z.Wall&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E[n]);const D={name:`Set ${e} for Selected Walls`,timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{v(D.oldValues,D.newValue)}};s(D),v(M,R),d(u+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of l)E.type===z.Wall&&M.set(E.id,E[n]);const D={name:`Set ${e} for All Walls`,timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{P(D.newValue)}};s(D),P(R),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(t.foundationId){const M=new Map;for(const E of l)E.type===z.Wall&&E.foundationId===t.foundationId&&M.set(E.id,E[n]);const D={name:`Set ${e} for All Walls Above Foundation`,timestamp:Date.now(),oldValues:M,newValue:R,groupId:t.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{D.groupId&&C(D.groupId,D.newValue)}};s(D),C(t.foundationId,R),d(u+1)}break;case oe.AllConnectedObjects:if(t){const M=me.getAllConnectedWalls(t),D=new Map;for(const W of M)D.set(W.id,W[n]);const E={name:`Set ${e} for All Connected Walls`,timestamp:Date.now(),oldValues:D,newValue:R,undo:()=>{for(const[W,j]of E.oldValues.entries())w(W,j)},redo:()=>{b(E.newValue)}};s(E),b(R),d(u+1)}break;default:if(t){const M=t[n],D={name:`Set Wall ${e}`,timestamp:Date.now(),oldValue:M,newValue:R,changedElementId:t.id,changedElementType:t.type,undo:()=>{w(D.changedElementId,D.oldValue)},redo:()=>{w(D.changedElementId,D.newValue)}};s(D),w(t.id,R),d(u+1)}}},x=()=>{p.current=t[n],a(!1)},S=()=>{A(p.current)};return h.jsx(so,{width:550,title:Y.t(`wallMenu.${e}`,g),onApply:S,onClose:x,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:o[0],max:o[1],style:{width:120},step:r,precision:2,defaultValue:t[n],onChange:R=>p.current=R}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",g),": [",o.toString(),"] ",i]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:i??" "}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:R=>H.getState().setWallActionScope(R.target.value),value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",g)})]})})})]})})},uC=({Dialog:t,noPadding:e,dataType:n,children:o})=>{const r=Jt(),[i,a]=m.useState(!1),l=co(z.Wall),s=()=>{H.getState().setApplyCount(0),a(!0)},c=tpo[n];return h.jsxs(h.Fragment,{children:[h.jsx(rn,{noPadding:e,onClick:s,children:o}),i&&l&&h.jsx(t,{wall:l,dataType:n,attributeKey:c.attributeKey,range:c.range,step:c.step,unit:c.unit?Y.t(c.unit,r):void 0,setDialogVisible:a})]})},Jho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(p3),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Wall),[c,u]=XZ((s==null?void 0:s.structureColor)??"#ffffff"),d=Jt(),f=(T,A)=>{e(x=>{for(const S of x.elements)if(S.id===T&&S.type===z.Wall&&!S.locked){S.structureColor=A;break}})},p=T=>{if(!s)return;const A=me.getAllConnectedWalls(s);A.length!==0&&e(x=>{for(const S of A)if(!S.locked)for(const R of x.elements)R.id===S.id&&R.type===z.Wall&&(R.structureColor=T)})},g=(T,A)=>{e(x=>{for(const S of x.elements)S.parentId===T&&S.type===z.Wall&&!S.locked&&(S.structureColor=A)})},y=T=>{e(A=>{for(const x of A.elements)x.type===z.Wall&&!x.locked&&(x.structureColor=T)})},w=(T,A)=>{e(x=>{for(const S of x.elements)S.type===z.Wall&&!S.locked&&T.has(S.id)&&(S.color=A)})},b=T=>{if(s){switch(r){case oe.AllSelectedObjectsOfThisType:{for(const A of n)if(A.type===z.Wall&&T!==A.structureColor&&!A.locked&&H.getState().selectedElementIdSet.has(A.id))return!0;break}case oe.AllObjectsOfThisType:{for(const A of n)if(A.type===z.Wall&&T!==A.structureColor&&!A.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const A of n)if(A.type===z.Wall&&A.foundationId===s.foundationId&&T!==A.structureColor&&!A.locked)return!0;break}case oe.AllConnectedObjects:{const A=me.getAllConnectedWalls(s);for(const x of A)if(T!==x.structureColor&&!x.locked)return!0;break}default:{if(T!==(s==null?void 0:s.structureColor))return!0;break}}return!1}},C=T=>{if(s&&b(T)){switch(r){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Wall&&H.getState().selectedElementIdSet.has(S.id)&&A.set(S.id,S.structureColor??"#ffffff");const x={name:"Set Structure Color for Selected Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{w(x.oldValues,x.newValue)}};o(x),w(A,T),a(i+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Wall&&A.set(S.id,S.structureColor??"#ffffff");const x={name:"Set Structure Color for All Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{y(x.newValue)}};o(x),y(T),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const A=new Map;for(const S of n)S.type===z.Wall&&S.foundationId===s.foundationId&&A.set(S.id,S.structureColor??"#ffffff");const x={name:"Set Structure Color for All Walls Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.foundationId,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{x.groupId&&g(x.groupId,x.newValue)}};o(x),g(s.foundationId,T),a(i+1)}break;case oe.AllConnectedObjects:if(s){const A=me.getAllConnectedWalls(s),x=new Map;for(const R of A)x.set(R.id,R.color??"#ffffff");const S={name:"Set Structure Color for All Connected Walls",timestamp:Date.now(),oldValues:x,newValue:T,undo:()=>{for(const[R,M]of S.oldValues.entries())f(R,M)},redo:()=>{p(S.newValue)}};o(S),p(T),a(i+1)}break;default:if(s){const A=l(s.id),x=(A==null?void 0:A.structureColor)??s.structureColor??"#ffffff",S={name:"Set Structure Color of Selected Wall",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(S.changedElementId,S.oldValue)},redo:()=>{f(S.changedElementId,S.newValue)}};o(S),f(s.id,T),a(i+1)}}e(A=>{A.actionState.wallStructureColor=T})}},P=()=>{t(!1)},v=()=>{C(c)};return h.jsx(so,{width:640,title:Y.t("wallMenu.StructureColor",d),onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:c,onChangeComplete:u})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:T=>H.getState().setWallActionScope(T.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",d)})]})})})]})})};var ng=(t=>(t.Height="Height",t.Opacity="Opacity",t.StructureSpacing="StructureSpacing",t.StructureWidth="StructureWidth",t.Thickness="Thickness",t.EavesLength="EavesLength",t))(ng||{});const Kho=t=>{const e=[],n={lng:H.getState().language};return e.push({key:"wall-structure-submenu-radio-group",label:h.jsx(Nho,{wall:t}),style:{backgroundColor:"white"}}),t.wallStructure!==gc.Default&&e.push({type:"divider"},{key:"wall-structure-spacing",label:h.jsxs(uC,{noPadding:!0,dataType:ng.StructureSpacing,Dialog:cC,children:[Y.t(`wallMenu.${ng.StructureSpacing}`,n)," ..."]})},{key:"wall-structure-width",label:h.jsxs(uC,{noPadding:!0,dataType:ng.StructureWidth,Dialog:cC,children:[Y.t(`wallMenu.${ng.StructureWidth}`,n)," ..."]})},{key:"wall-structure-color",label:h.jsxs(to,{noPadding:!0,Dialog:Jho,children:[Y.t("wallMenu.StructureColor",n)," ..."]})}),e},qho=t=>{const e=[];return e.push({key:"wall-fill-radio-group",label:h.jsx(jho,{wall:t}),style:{backgroundColor:"white"}}),t.fill!==El.Full&&e.push({type:"divider"},{key:"wall-open-to-outside-checkbox",label:h.jsx(Bho,{wall:t})}),e},$ho=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(p3),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Wall),[c,u]=m.useState((s==null?void 0:s.rValue)??f6),[d,f]=m.useState(me.toRValueInUS(c)),p=Jt(),g=(T,A)=>{l(x=>{for(const S of x.elements)if(S.id===T){S.rValue=A;break}})},y=T=>{for(const[A,x]of T.entries())g(A,x)},w=(T,A)=>{for(const x of T.keys())g(x,A)},b=T=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:{for(const A of e)if(A.type===z.Wall&&T!==A.rValue&&!A.locked&&H.getState().selectedElementIdSet.has(A.id))return!0;break}case oe.AllObjectsOfThisType:{for(const A of e)if(A.type===z.Wall&&T!==A.rValue&&!A.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const A of e)if(A.type===z.Wall&&A.foundationId===s.foundationId&&T!==A.rValue&&!A.locked)return!0;break}case oe.AllConnectedObjects:{const A=me.getAllConnectedWalls(s);for(const x of A)if(T!==x.rValue&&!x.locked)return!0;break}default:{if(T!==(s==null?void 0:s.rValue))return!0;break}}return!1}},C=T=>{if(s&&b(T)){switch(o){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of e)if(S.type===z.Wall&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)){const R=S;A.set(S.id,R.rValue??f6),g(R.id,T)}const x={name:"Set R-Value for Selected Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of e)if(S.type===z.Wall&&!S.locked){const R=S;A.set(S.id,R.rValue??f6),g(R.id,T)}const x={name:"Set R-Value for All Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s!=null&&s.foundationId){const A=new Map;for(const S of e)if(S.type===z.Wall&&S.foundationId===s.foundationId&&!S.locked){const R=S;A.set(S.id,R.rValue??f6),g(R.id,T)}const x={name:"Set R-Value for All Walls Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.foundationId,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1)}break;case oe.AllConnectedObjects:if(s){const A=me.getAllConnectedWalls(s),x=new Map;for(const R of A)if(!R.locked){const M=R;x.set(R.id,M.rValue??f6),g(M.id,T)}const S={name:"Set R-Value for All Connected Walls",timestamp:Date.now(),oldValues:x,newValue:T,undo:()=>{y(S.oldValues)},redo:()=>{w(S.oldValues,S.newValue)}};n(S),i(r+1)}break;default:if(s){const x=a(s.id).rValue??s.rValue??f6,S={name:"Set Wall R-Value",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:s.id,changedElementType:s.type,undo:()=>{g(S.changedElementId,S.oldValue)},redo:()=>{g(S.changedElementId,S.newValue)}};n(S),g(s.id,T),i(r+1)}}l(A=>{A.actionState.wallRValue=T})}},P=()=>{u((s==null?void 0:s.rValue)??f6),t(!1)},v=()=>{C(c)};return h.jsx(so,{width:550,title:`${Y.t("word.RValue",p)+" "}(${Y.t("word.ThermalResistance",p)})`,onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(u(T),f(me.toRValueInUS(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0.01, 100]",h.jsx("br",{}),Y.t("word.SIUnit",p),": m²·℃/W"]}),h.jsx("br",{}),h.jsx(Mn,{min:me.toRValueInUS(.01),max:me.toRValueInUS(100),style:{width:120},step:.01,precision:2,value:d,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(f(T),u(me.toRValueInSI(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [",me.toRValueInUS(.01).toFixed(3),", ",me.toRValueInUS(100).toFixed(1),"]",h.jsx("br",{}),Y.t("word.USUnit",p),": h·ft²·℉/Btu"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:T=>H.getState().setWallActionScope(T.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",p)})]})})})]})})},Qho=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(p3),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Wall),[c,u]=m.useState((s==null?void 0:s.volumetricHeatCapacity)??.5),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)if(A.id===P){A.volumetricHeatCapacity=v;break}})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const T of e)if(T.type===z.Wall&&P!==T.volumetricHeatCapacity&&!T.locked&&H.getState().selectedElementIdSet.has(T.id))return!0;break;case oe.AllObjectsOfThisType:for(const T of e)if(T.type===z.Wall&&P!==T.volumetricHeatCapacity&&!T.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const T of e)if(T.type===z.Wall&&T.foundationId===s.foundationId&&P!==T.volumetricHeatCapacity&&!T.locked)return!0;break;case oe.AllConnectedObjects:const v=me.getAllConnectedWalls(s);for(const T of v)if(P!==T.volumetricHeatCapacity&&!T.locked)return!0;break;default:if(P!==(s==null?void 0:s.volumetricHeatCapacity))return!0;break}return!1}},w=P=>{if(s&&y(P)){switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of e)if(A.type===z.Wall&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)){const x=A;v.set(A.id,x.volumetricHeatCapacity??.5),f(x.id,P)}const T={name:"Set Volumetric Heat Capacity for Selected Walls",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of e)if(A.type===z.Wall&&!A.locked){const x=A;v.set(A.id,x.volumetricHeatCapacity??.5),f(x.id,P)}const T={name:"Set Volumetric Heat Capacity for All Walls",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(s!=null&&s.foundationId){const v=new Map;for(const A of e)if(A.type===z.Wall&&A.foundationId===s.foundationId&&!A.locked){const x=A;v.set(A.id,x.volumetricHeatCapacity??.5),f(x.id,P)}const T={name:"Set Volumetric Heat Capacity for All Walls Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break}case oe.AllConnectedObjects:{if(s){const v=me.getAllConnectedWalls(s),T=new Map;for(const x of v)if(!x.locked){const S=x;T.set(x.id,S.volumetricHeatCapacity??.5),f(S.id,P)}const A={name:"Set Volumetric Heat Capacity for All Connected Walls",timestamp:Date.now(),oldValues:T,newValue:P,undo:()=>{p(A.oldValues)},redo:()=>{g(A.oldValues,A.newValue)}};n(A),i(r+1)}break}default:{if(s){const T=a(s.id).volumetricHeatCapacity??s.volumetricHeatCapacity??.5,A={name:"Set Volumetric Heat Capacity of Wall",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}break}}l(v=>{v.actionState.wallVolumetricHeatCapacity=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("word.VolumetricHeatCapacity",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>{P!==null&&u(P)}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:["kWh/(m³·℃)",h.jsx("br",{}),h.jsx("br",{}),Y.t("word.Range",d),": [0.01, 100]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setWallActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",d)})]})})})]})})},Zho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(p3),i=H(no),a=H(Zn),l=H(Gn),s=Jt(),c=co(z.Wall),[u,d]=m.useState((c==null?void 0:c.textureType)??Uo.Default),{Option:f}=_o,p=(A,x)=>{e(S=>{for(const R of S.elements)if(R.type===z.Wall&&R.id===A&&!R.locked){R.textureType=x;break}})},g=A=>{if(!c)return;const x=me.getAllConnectedWalls(c);x.length!==0&&e(S=>{for(const R of x)if(!R.locked)for(const M of S.elements)M.id===R.id&&M.type===z.Wall&&(M.textureType=A)})},y=(A,x)=>{e(S=>{for(const R of S.elements)R.type===z.Wall&&R.foundationId===A&&!R.locked&&(R.textureType=x)})},w=A=>{e(x=>{for(const S of x.elements)S.type===z.Wall&&!S.locked&&(S.textureType=A)})},b=(A,x)=>{e(S=>{for(const R of S.elements)R.type===z.Wall&&!R.locked&&A.has(R.id)&&(R.textureType=x)})},C=A=>{if(c){switch(r){case oe.AllSelectedObjectsOfThisType:{for(const x of n)if(x.type===z.Wall&&A!==x.textureType&&!x.locked&&H.getState().selectedElementIdSet.has(x.id))return!0;break}case oe.AllObjectsOfThisType:{for(const x of n)if(x.type===z.Wall&&A!==x.textureType&&!x.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const x of n)if(x.type===z.Wall&&x.foundationId===c.foundationId&&A!==x.textureType&&!x.locked)return!0;break}case oe.AllConnectedObjects:{const x=me.getAllConnectedWalls(c);for(const S of x)if(A!==S.textureType&&!S.locked)return!0;break}default:{if(A!==(c==null?void 0:c.textureType))return!0;break}}return!1}},P=A=>{if(c&&C(A)){switch(r){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.Wall&&!R.locked&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.textureType??Uo.Default);const S={name:"Set Texture for Selected Walls",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())p(R,M)},redo:()=>{b(S.oldValues,S.newValue)}};o(S),b(x,A),a(i+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.Wall&&!R.locked&&x.set(R.id,R.textureType??Uo.Default);const S={name:"Set Texture for All Walls",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())p(R,M)},redo:()=>{w(S.newValue)}};o(S),w(A),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(c.foundationId){const x=new Map;for(const R of n)R.type===z.Wall&&R.foundationId===c.foundationId&&!R.locked&&x.set(R.id,R.textureType);const S={name:"Set Texture for All Walls Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:c.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())p(R,M)},redo:()=>{S.groupId&&y(S.groupId,S.newValue)}};o(S),y(c.foundationId,A),a(i+1)}break;case oe.AllConnectedObjects:if(c){const x=me.getAllConnectedWalls(c),S=new Map;for(const M of x)S.set(M.id,M.textureType);const R={name:"Set Texture for All Connected Walls",timestamp:Date.now(),oldValues:S,newValue:A,undo:()=>{for(const[M,D]of R.oldValues.entries())p(M,D)},redo:()=>{g(R.newValue)}};o(R),g(A),a(i+1)}break;default:if(c){const x=l(c.id),S=(x==null?void 0:x.textureType)??c.textureType,R={name:"Set Texture of Selected Wall",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:c.id,changedElementType:c.type,undo:()=>{p(R.changedElementId,R.oldValue)},redo:()=>{p(R.changedElementId,R.newValue)}};o(R),p(c.id,A),a(i+1)}}e(x=>{x.actionState.wallTexture=A})}},v=()=>{t(!1)},T=()=>{P(u)};return h.jsx(so,{width:550,title:Y.t("word.Texture",s),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:9,children:h.jsxs(_o,{style:{width:"150px"},value:u,onChange:d,children:[h.jsxs(f,{value:Uo.NoTexture,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"32px",height:"20px",border:"1px dashed dimGray"},children:" "}),Y.t("shared.NoTexture",s)]},Uo.NoTexture),h.jsxs(f,{value:Uo.Default,children:[h.jsx("img",{alt:Uo.Default,src:Dye,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.TextureDefault",s)]},Uo.Default),h.jsxs(f,{value:Uo.Texture01,children:[h.jsx("img",{alt:Uo.Texture01,src:xrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture01",s)]},Uo.Texture01),h.jsxs(f,{value:Uo.Texture02,children:[h.jsx("img",{alt:Uo.Texture02,src:brt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture02",s)]},Uo.Texture02),h.jsxs(f,{value:Uo.Texture03,children:[h.jsx("img",{alt:Uo.Texture03,src:Srt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture03",s)]},Uo.Texture03),h.jsxs(f,{value:Uo.Texture04,children:[h.jsx("img",{alt:Uo.Texture04,src:Trt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture04",s)]},Uo.Texture04),h.jsxs(f,{value:Uo.Texture05,children:[h.jsx("img",{alt:Uo.Texture05,src:Prt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture05",s)]},Uo.Texture05),h.jsxs(f,{value:Uo.Texture06,children:[h.jsx("img",{alt:Uo.Texture06,src:Crt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture06",s)]},Uo.Texture06),h.jsxs(f,{value:Uo.Texture07,children:[h.jsx("img",{alt:Uo.Texture07,src:Rrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture07",s)]},Uo.Texture07),h.jsxs(f,{value:Uo.Texture08,children:[h.jsx("img",{alt:Uo.Texture08,src:Hrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture08",s)]},Uo.Texture08),h.jsxs(f,{value:Uo.Texture09,children:[h.jsx("img",{alt:Uo.Texture09,src:Mrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture09",s)]},Uo.Texture09),h.jsxs(f,{value:Uo.Texture10,children:[h.jsx("img",{alt:Uo.Texture10,src:Irt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture10",s)]},Uo.Texture10)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:15,children:h.jsx(Ue.Group,{onChange:A=>H.getState().setWallActionScope(A.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",s)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",s)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",s)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",s)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",s)})]})})})]})})},epo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(p3),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Wall),c=Jt(),[u,d]=XZ((s==null?void 0:s.color)??"#ffffff"),f=(T,A)=>{e(x=>{for(const S of x.elements)if(S.type===z.Wall&&S.id===T&&!S.locked){S.color=A;break}})},p=T=>{if(!s)return;const A=me.getAllConnectedWalls(s);A.length!==0&&e(x=>{for(const S of A)if(!S.locked)for(const R of x.elements)R.id===S.id&&R.type===z.Wall&&(R.color=T)})},g=(T,A)=>{e(x=>{for(const S of x.elements)S.type===z.Wall&&S.foundationId===T&&!S.locked&&(S.color=A)})},y=T=>{e(A=>{for(const x of A.elements)x.type===z.Wall&&!x.locked&&(x.color=T)})},w=(T,A)=>{e(x=>{for(const S of x.elements)S.type===z.Wall&&!S.locked&&T.has(S.id)&&(S.color=A)})},b=T=>{if(s){switch(r){case oe.AllSelectedObjectsOfThisType:{for(const A of n)if(A.type===z.Wall&&T!==A.color&&!A.locked&&H.getState().selectedElementIdSet.has(A.id))return!0;break}case oe.AllObjectsOfThisType:{for(const A of n)if(A.type===z.Wall&&T!==A.color&&!A.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const A of n)if(A.type===z.Wall&&A.foundationId===s.foundationId&&T!==A.color&&!A.locked)return!0;break}case oe.AllConnectedObjects:{const A=me.getAllConnectedWalls(s);for(const x of A)if(T!==x.color&&!x.locked)return!0;break}default:{if(T!==(s==null?void 0:s.color))return!0;break}}return!1}},C=T=>{if(s&&b(T)){switch(r){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Wall&&H.getState().selectedElementIdSet.has(S.id)&&A.set(S.id,S.color??"#ffffff");const x={name:"Set Color for Selected Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{w(x.oldValues,x.newValue)}};o(x),w(A,T),a(i+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Wall&&A.set(S.id,S.color??"#ffffff");const x={name:"Set Color for All Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{y(x.newValue)}};o(x),y(T),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(s.foundationId){const A=new Map;for(const S of n)S.type===z.Wall&&S.foundationId===s.foundationId&&A.set(S.id,S.color??"#ffffff");const x={name:"Set Color for All Walls Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.foundationId,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{x.groupId&&g(x.groupId,x.newValue)}};o(x),g(s.foundationId,T),a(i+1)}break}case oe.AllConnectedObjects:{const A=me.getAllConnectedWalls(s),x=new Map;for(const R of A)x.set(R.id,R.color??"#ffffff");const S={name:"Set Color for All Connected Walls",timestamp:Date.now(),oldValues:x,newValue:T,undo:()=>{for(const[R,M]of S.oldValues.entries())f(R,M)},redo:()=>{p(S.newValue)}};o(S),p(T),a(i+1);break}default:{if(s){const A=l(s.id),x=(A==null?void 0:A.color)??s.color??"#ffffff",S={name:"Set Color of Selected Wall",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(S.changedElementId,S.oldValue)},redo:()=>{f(S.changedElementId,S.newValue)}};o(S),f(s.id,T),a(i+1)}break}}e(A=>{A.actionState.wallColor=T})}},P=()=>{t(!1)},v=()=>{C(u)};return h.jsx(so,{width:640,title:Y.t("wallMenu.Color",c),onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:u,onChangeComplete:d})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:T=>H.getState().setWallActionScope(T.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",c)})]})})})]})})},tpo={Height:{attributeKey:"lz",range:[.1,1e3],step:.1,unit:"word.MeterAbbreviation"},Opacity:{attributeKey:"opacity",range:[0,1],step:.01},StructureSpacing:{attributeKey:"structureSpacing",range:[.1,1e3],step:.1,unit:"word.MeterAbbreviation"},StructureWidth:{attributeKey:"structureWidth",range:[.01,1],step:.1,unit:"word.MeterAbbreviation"},Thickness:{attributeKey:"ly",range:[.1,1],step:.01,unit:"word.MeterAbbreviation"},EavesLength:{attributeKey:"eavesLength",range:[-.1,5],step:.01,unit:"word.MeterAbbreviation"},ParapetHeight:{attributeKey:"parapetHeight",range:[0,5],step:.01,unit:"word.MeterAbbreviation"},CopingsHeight:{attributeKey:"copingsHeight",range:[0,1],step:.01,unit:"word.MeterAbbreviation"},CopingsWidth:{attributeKey:"copingsWidth",range:[0,3],step:.01,unit:"word.MeterAbbreviation"}},npo=()=>{const t=H.getState().elementsToPaste;if(t&&t.length>0){const e=t[0];if(me.isLegalOnWall(e.type))return!0}return!1},opo=t=>{const e=[];if(t.type!==z.Wall)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language},i=H.getState().countAllOffspringsByTypeAtOnce,a=i(n.id,!0),l=i(n.id,!1);return npo()&&e.push({key:"wall-paste",label:h.jsx(eM,{})}),e.push({key:"wall-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"wall-cut",label:h.jsx(Wd,{})}),e.push({key:"wall-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&(a.gotSome()&&e.push({key:"lock-unlock-clear-on-wall",label:h.jsx(rn,{children:Y.t("word.Elements",r)}),children:Oho(n,a,l)}),e.push({key:"wall-parapet",label:h.jsx(rn,{children:Y.t("wallMenu.Parapet",r)}),children:Xho(n)}),e.push({key:"wall-structure",label:h.jsx(rn,{children:Y.t("wallMenu.WallStructure",r)}),children:Kho(n)}),n.wallStructure!==gc.Default&&e.push({key:"wall-opacity",label:h.jsxs(uC,{dataType:ng.Opacity,Dialog:cC,children:[Y.t(`wallMenu.${ng.Opacity}`,r)," ..."]})}),e.push({key:"wall-fill",label:h.jsx(rn,{children:Y.t("wallMenu.Fill",r)}),children:qho(n)},{key:"add-polygon-on-wall",label:h.jsx(Uho,{wall:n})},{key:"wall-thickness",label:h.jsxs(uC,{dataType:ng.Thickness,Dialog:cC,children:[Y.t(`wallMenu.${ng.Thickness}`,r)," ..."]})},{key:"wall-height",label:h.jsxs(uC,{dataType:ng.Height,Dialog:cC,children:[Y.t(`wallMenu.${ng.Height}`,r)," ..."]})},{key:"wall-eaves-length",label:h.jsxs(uC,{dataType:ng.EavesLength,Dialog:cC,children:[Y.t(`wallMenu.${ng.EavesLength}`,r)," ..."]})},{key:"wall-r-value",label:h.jsxs(to,{Dialog:$ho,children:[Y.t("word.RValue",r)," ..."]})},{key:"wall-heat-capacity",label:h.jsxs(to,{Dialog:Qho,children:[Y.t("word.VolumetricHeatCapacity",r)," ..."]})},{key:"wall-texture",label:h.jsxs(to,{Dialog:Zho,children:[Y.t("wallMenu.Texture",r)," ..."]})},{key:"wall-color",label:h.jsxs(to,{Dialog:epo,children:[Y.t("wallMenu.Color",r)," ..."]})})),{items:e}},rpo=be.memo(({door:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&l.type===z.Door){l.filled=i;break}})},o=r=>{const i=r.target.checked,a={name:"Filled Door",timestamp:Date.now(),checked:i,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i),H.getState().set(l=>{l.actionState.doorFilled=i})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.filled,onChange:o,children:Y.t("doorMenu.Filled",e)})})}),ipo=be.memo(({door:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&l.type===z.Door){l.interior=i;break}})},o=r=>{const i=r.target.checked,a={name:"Interior Door",timestamp:Date.now(),checked:i,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i),H.getState().set(l=>{l.actionState.doorInterior=i})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.interior,onChange:o,children:Y.t("doorMenu.Interior",e)})})}),apo=be.memo(({door:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&l.type===z.Door){l.doorType=i;break}})},o=r=>{const i={name:"Select Door Type",timestamp:Date.now(),oldValue:t.doorType,newValue:r.target.value,changedElementId:t.id,changedElementType:t.type,undo:()=>{n(i.changedElementId,i.oldValue)},redo:()=>{n(i.changedElementId,i.newValue)}};H.getState().addUndoable(i),n(t.id,r.target.value),H.getState().set(a=>{a.actionState.doorType=r.target.value})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Ue.Group,{value:t.doorType,onChange:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:Pd.Default,children:Y.t("doorMenu.Default",e)}),h.jsx(Ue,{style:{width:"100%"},value:Pd.Arched,children:Y.t("doorMenu.Arched",e)})]})})})}),lpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(Ew),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=H(qr),c=co(z.Door),u=m.useMemo(()=>{const x=c?c.lx:1,S=c?s(c):null;return S?x*S.lx:x},[c==null?void 0:c.lx]),[d,f]=m.useState(u),p=Jt(),g=(x,S)=>{l(R=>{for(const M of R.elements)if(M.id===x&&M.type===z.Door){const D=M,E=s(D);D.lx=E?S/E.lx:S;break}})},y=x=>{for(const[S,R]of x.entries())g(S,R)},w=(x,S)=>{for(const R of x.keys())g(R,S)},b=x=>{if(c){switch(o){case oe.AllSelectedObjectsOfThisType:{for(const S of e)if(S.type===z.Door&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)){const R=s(S);if(R&&x!==S.lx*R.lx)return!0}break}case oe.AllObjectsOfThisType:{for(const S of e)if(S.type===z.Door&&!S.locked){const R=s(S);if(R&&x!==S.lx*R.lx)return!0}break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const S of e)if(S.type===z.Door&&S.foundationId===c.foundationId&&!S.locked){const R=s(S);if(R&&x!==S.lx*R.lx)return!0}break}case oe.OnlyThisSide:{for(const S of e)if(S.type===z.Door&&S.parentId===c.parentId&&!S.locked){const R=s(S);if(R&&x!==S.lx*R.lx)return!0}break}default:{const S=s(c);if(S&&x!==c.lx*S.lx)return!0;break}}return!1}},C=x=>{if(c&&b(x))switch(o){case oe.AllSelectedObjectsOfThisType:{const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&!D.locked&&H.getState().selectedElementIdSet.has(D.id)){const E=D,W=E?s(E):null;S.set(D.id,E.lx*(W?W.lx:1)),E.lx=W?x/W.lx:x}});const R={name:"Set Width for Selected Doors",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1);break}case oe.AllObjectsOfThisType:{const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&!D.locked){const E=D,W=E?s(E):null;S.set(D.id,E.lx*(W?W.lx:1)),E.lx=W?x/W.lx:x}});const R={name:"Set Width for All Doors",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(c.foundationId){const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&D.foundationId===c.foundationId&&!D.locked){const E=D,W=E?s(E):null;S.set(D.id,E.lx*(W?W.lx:1)),E.lx=W?x/W.lx:x}});const R={name:"Set Width for All Doors Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:c.foundationId,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1)}break;case oe.OnlyThisSide:if(c.parentId){const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&D.parentId===c.parentId&&!D.locked){const E=D,W=E?s(E):null;S.set(D.id,E.lx*(W?W.lx:1)),E.lx=W?x/W.lx:x}});const R={name:"Set Width for All Doors On the Same Wall",timestamp:Date.now(),oldValues:S,newValue:x,groupId:c.parentId,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1)}break;default:if(c){const S=a(c.id),R=c?s(S):null,M=(S.lx??c.lx??.1)*(R?R.lx:1),D={name:"Set Door Width",timestamp:Date.now(),oldValue:M,newValue:x,changedElementId:c.id,changedElementType:c.type,undo:()=>{g(D.changedElementId,D.oldValue)},redo:()=>{g(D.changedElementId,D.newValue)}};n(D),g(c.id,x),i(r+1)}}},P=()=>{t(!1)},v=()=>{C(d)},T=c?s(c):null,A=T&&c?2*T.lx*Math.min(Math.abs(.5-c.cx),Math.abs(-.5-c.cx)):100;return h.jsx(so,{width:550,title:Y.t("word.Width",p),onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:A,style:{width:120},step:.1,precision:2,value:d,formatter:x=>Number(x).toFixed(2),onChange:x=>f(x)}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0.1, ",A.toFixed(1),"]",Y.t("word.MeterAbbreviation",p)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",p)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:x=>H.getState().setDoorActionScope(x.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",p)})]})})})]})})},spo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(Ew),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=H(qr),c=co(z.Door),u=m.useMemo(()=>{const x=c?c.lz:1,S=c?s(c):null;return S?x*S.lz:x},[c==null?void 0:c.lz]),[d,f]=m.useState(u),p=Jt(),g=(x,S)=>{l(R=>{for(const M of R.elements)if(M.id===x&&M.type===z.Door){const D=M,E=s(D);D.lz=E?S/E.lz:S,E&&(D.cz=-(E.lz-S)/(2*E.lz));break}})},y=x=>{for(const[S,R]of x.entries())g(S,R)},w=(x,S)=>{for(const R of x.keys())g(R,S)},b=x=>{if(c){switch(o){case oe.AllSelectedObjectsOfThisType:{for(const S of e)if(S.type===z.Door&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)){const R=s(S);if(R&&x!==S.lz*R.lz)return!0}break}case oe.AllObjectsOfThisType:{for(const S of e)if(S.type===z.Door&&!S.locked){const R=s(S);if(R&&x!==S.lz*R.lz)return!0}break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const S of e)if(S.type===z.Door&&S.foundationId===c.foundationId&&!S.locked){const R=s(S);if(R&&x!==S.lz*R.lz)return!0}break}case oe.OnlyThisSide:{for(const S of e)if(S.type===z.Door&&S.parentId===c.parentId&&!S.locked){const R=s(S);if(R&&x!==S.lz*R.lz)return!0}break}default:{const S=s(c);if(S&&x!==c.lz*S.lz)return!0;break}}return!1}},C=x=>{if(c&&b(x))switch(o){case oe.AllSelectedObjectsOfThisType:{const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&!D.locked&&H.getState().selectedElementIdSet.has(D.id)){const E=D,W=E?s(E):null;S.set(D.id,E.lz*(W?W.lz:1)),E.lz=W?x/W.lz:x,W&&(E.cz=-(W.lz-x)/(2*W.lz))}});const R={name:"Set Height for Selected Doors",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1);break}case oe.AllObjectsOfThisType:{const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&!D.locked){const E=D,W=E?s(E):null;S.set(D.id,E.lz*(W?W.lz:1)),E.lz=W?x/W.lz:x,W&&(E.cz=-(W.lz-x)/(2*W.lz))}});const R={name:"Set Height for All Doors",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(c.foundationId){const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&D.foundationId===c.foundationId&&!D.locked){const E=D,W=E?s(E):null;S.set(D.id,E.lz*(W?W.lz:1)),E.lz=W?x/W.lz:x,W&&(E.cz=-(W.lz-x)/(2*W.lz))}});const R={name:"Set Height for All Doors Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:c.foundationId,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1)}break;case oe.OnlyThisSide:if(c.parentId){const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&D.parentId===c.parentId&&!D.locked){const E=D,W=E?s(E):null;S.set(D.id,E.lz*(W?W.lz:1)),E.lz=W?x/W.lz:x,W&&(E.cz=-(W.lz-x)/(2*W.lz))}});const R={name:"Set Height for All Doors On the Same Wall",timestamp:Date.now(),oldValues:S,newValue:x,groupId:c.parentId,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1)}break;default:if(c){const S=a(c.id),R=c?s(S):null,M=(S.lz??c.lz??.2)*(R?R.lz:1),D={name:"Set Door Height",timestamp:Date.now(),oldValue:M,newValue:x,changedElementId:c.id,changedElementType:c.type,undo:()=>{g(D.changedElementId,D.oldValue)},redo:()=>{g(D.changedElementId,D.newValue)}};n(D),g(c.id,x),i(r+1)}}},P=()=>{f(u),t(!1)},v=()=>{C(d)},T=c?s(c):null,A=(T==null?void 0:T.lz)??20;return h.jsx(so,{width:550,title:Y.t("word.Height",p),onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:A,style:{width:120},step:.1,precision:2,value:d,formatter:x=>Number(x).toFixed(2),onChange:x=>{x!==null&&f(x)}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0.1, ",A.toFixed(1),"]",Y.t("word.MeterAbbreviation",p)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",p)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:x=>H.getState().setDoorActionScope(x.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",p)})]})})})]})})},cpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(Ew),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Door),[c,u]=m.useState((s==null?void 0:s.opacity)??1),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)if(A.id===P){A.opacity=v;break}})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Door&&P!==v.opacity&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Door&&P!==v.opacity&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Door&&v.foundationId===s.foundationId&&P!==v.opacity&&!v.locked)return!0;break;case oe.OnlyThisSide:for(const v of e)if(v.type===z.Door&&v.parentId===s.parentId&&P!==v.opacity&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.opacity))return!0;break}return!1}},w=P=>{if(s&&y(P)){switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)){const S=x;v.set(x.id,S.opacity??1),S.opacity=P}});const T={name:"Set Opacity for Selected Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&!x.locked){const S=x;v.set(x.id,S.opacity??1),S.opacity=P}});const T={name:"Set Opacity for All Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&x.foundationId===s.foundationId&&!x.locked){const S=x;v.set(x.id,S.opacity??1),S.opacity=P}});const T={name:"Set Opacity for All Doors Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;case oe.OnlyThisSide:if(s.parentId){const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&x.parentId===s.parentId&&!x.locked){const S=x;v.set(x.id,S.opacity??1),S.opacity=P}});const T={name:"Set Opacity for All Doors On the Same Wall",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.parentId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;default:if(s){const T=a(s.id).opacity??s.opacity??1,A={name:"Set Opacity of Door",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}}l(v=>{v.actionState.doorOpacity=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("wallMenu.Opacity",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>u(P)}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:["kWh/(m³·℃)",h.jsx("br",{}),h.jsx("br",{}),Y.t("word.Range",d),": [0.01, 100]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setDoorActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",d)})]})})})]})})},upo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(Ew),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Door),[c,u]=m.useState((s==null?void 0:s.uValue)??G4),[d,f]=m.useState(me.toUValueInUS(c)),p=Jt(),g=(T,A)=>{l(x=>{for(const S of x.elements)if(S.id===T){S.uValue=A;break}})},y=T=>{for(const[A,x]of T.entries())g(A,x)},w=(T,A)=>{for(const x of T.keys())g(x,A)},b=T=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const A of e)if(A.type===z.Door&&T!==A.uValue&&!A.locked&&H.getState().selectedElementIdSet.has(A.id))return!0;break;case oe.AllObjectsOfThisType:for(const A of e)if(A.type===z.Door&&T!==A.uValue&&!A.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const A of e)if(A.type===z.Door&&A.foundationId===s.foundationId&&T!==A.uValue&&!A.locked)return!0;break;case oe.OnlyThisSide:for(const A of e)if(A.type===z.Door&&A.parentId===s.parentId&&T!==A.uValue&&!A.locked)return!0;break;default:if(T!==(s==null?void 0:s.uValue))return!0;break}return!1}},C=T=>{if(s&&b(T)){switch(o){case oe.AllSelectedObjectsOfThisType:{const A=new Map;l(S=>{for(const R of S.elements)if(R.type===z.Door&&!R.locked){const M=R;A.set(R.id,M.uValue??G4),M.uValue=T}});const x={name:"Set U-Value for Selected Doors",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisType:{const A=new Map;l(S=>{for(const R of S.elements)if(R.type===z.Door&&!R.locked){const M=R;A.set(R.id,M.uValue??G4),M.uValue=T}});const x={name:"Set U-Value for All Doors",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const A=new Map;l(S=>{for(const R of S.elements)if(R.type===z.Door&&R.foundationId===s.foundationId&&!R.locked){const M=R;A.set(R.id,M.uValue??G4),M.uValue=T}});const x={name:"Set U-Value for All Doors Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.foundationId,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1)}break;case oe.OnlyThisSide:if(s.parentId){const A=new Map;l(S=>{for(const R of S.elements)if(R.type===z.Door&&R.parentId===s.parentId&&!R.locked){const M=R;A.set(R.id,M.uValue??G4),M.uValue=T}});const x={name:"Set U-Value for All Doors On the Same Wall",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.parentId,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1)}break;default:if(s){const x=a(s.id).uValue??s.uValue??G4,S={name:"Set Door U-Value",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:s.id,changedElementType:s.type,undo:()=>{g(S.changedElementId,S.oldValue)},redo:()=>{g(S.changedElementId,S.newValue)}};n(S),g(s.id,T),i(r+1)}}l(A=>{A.actionState.doorUValue=T})}},P=()=>{t(!1)},v=()=>{C(c)};return h.jsx(so,{width:550,title:`${Y.t("word.UValue",p)+" "}(${Y.t("word.ThermalTransmittance",p)})`,onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(u(T),f(me.toUValueInUS(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0.01, 100]",h.jsx("br",{}),Y.t("word.SIUnit",p),": W/(m²·℃)"]}),h.jsx("br",{}),h.jsx(Mn,{min:me.toUValueInUS(.01),max:me.toUValueInUS(100),style:{width:120},step:.01,precision:2,value:d,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(f(T),u(me.toUValueInSI(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [",me.toUValueInUS(.01).toFixed(3),", ",me.toUValueInUS(100).toFixed(1),"]",h.jsx("br",{}),Y.t("word.USUnit",p),": Btu/(h·ft²·℉)"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:T=>H.getState().setDoorActionScope(T.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",p)})]})})})]})})},dpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(Ew),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Door),[c,u]=m.useState((s==null?void 0:s.volumetricHeatCapacity)??.5),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)if(A.id===P){A.volumetricHeatCapacity=v;break}})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{switch(o){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Door&&P!==v.volumetricHeatCapacity&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Door&&P!==v.volumetricHeatCapacity&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Door&&v.foundationId===(s==null?void 0:s.foundationId)&&P!==v.volumetricHeatCapacity&&!v.locked)return!0;break;case oe.OnlyThisSide:for(const v of e)if(v.type===z.Door&&v.parentId===(s==null?void 0:s.parentId)&&P!==v.volumetricHeatCapacity&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.volumetricHeatCapacity))return!0;break}return!1},w=P=>{if(s&&y(P)){switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)){const S=x;v.set(x.id,S.volumetricHeatCapacity??.5),S.volumetricHeatCapacity=P}});const T={name:"Set Volumetric Heat Capacity for Selected Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&!x.locked){const S=x;v.set(x.id,S.volumetricHeatCapacity??.5),S.volumetricHeatCapacity=P}});const T={name:"Set Volumetric Heat Capacity for All Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&x.foundationId===s.foundationId&&!x.locked){const S=x;v.set(x.id,S.volumetricHeatCapacity??.5),S.volumetricHeatCapacity=P}});const T={name:"Set Volumetric Heat Capacity for All Doors Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;case oe.OnlyThisSide:if(s.parentId){const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&x.parentId===s.parentId&&!x.locked){const S=x;v.set(x.id,S.volumetricHeatCapacity??.5),S.volumetricHeatCapacity=P}});const T={name:"Set Volumetric Heat Capacity for All Doors On the Same Wall",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.parentId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;default:if(s){const T=a(s.id).volumetricHeatCapacity??s.volumetricHeatCapacity??.5,A={name:"Set Volumetric Heat Capacity of Door",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}}l(v=>{v.actionState.doorVolumetricHeatCapacity=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("word.VolumetricHeatCapacity",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>{P!==null&&u(P)}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:["kWh/(m³·℃)",h.jsx("br",{}),h.jsx("br",{}),Y.t("word.Range",d),": [0.01, 100]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setDoorActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",d)})]})})})]})})},fpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(Ew),r=H(no),i=H(Zn),a=H(fn),l=H(Gn),s=co(z.Door),[c,u]=m.useState((s==null?void 0:s.textureType)??sr.Default),d=Jt(),{Option:f}=_o,p=(v,T)=>{a(A=>{for(const x of A.elements)if(x.id===v){x.locked||(x.textureType=T);break}})},g=(v,T)=>{for(const A of v.keys())p(A,T)},y=v=>{for(const[T,A]of v.entries())p(T,A)},w=v=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const T of e)if(T.type===z.Door&&v!==T.textureType&&!T.locked&&H.getState().selectedElementIdSet.has(T.id))return!0;break;case oe.AllObjectsOfThisType:for(const T of e)if(T.type===z.Door&&v!==T.textureType&&!T.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const T of e)if(T.type===z.Door&&T.foundationId===s.foundationId&&v!==T.textureType&&!T.locked)return!0;break;case oe.OnlyThisSide:for(const T of e)if(T.type===z.Door&&T.parentId===s.parentId&&v!==T.textureType&&!T.locked)return!0;break;default:if(v!==(s==null?void 0:s.textureType))return!0;break}return!1}},b=v=>{if(s&&w(v)){switch(o){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of H.getState().elements)x.type===z.Door&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&T.set(x.id,x.textureType??sr.Default);const A={name:"Set Texture for Selected Doors",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{y(A.oldValues)},redo:()=>{g(A.oldValues,A.newValue)}};n(A),g(T,v),i(r+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of H.getState().elements)x.type===z.Door&&!x.locked&&T.set(x.id,x.textureType??sr.Default);const A={name:"Set Texture for All Doors",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{y(A.oldValues)},redo:()=>{g(A.oldValues,A.newValue)}};n(A),g(T,v),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const T=new Map;for(const x of H.getState().elements)x.type===z.Door&&x.foundationId===s.foundationId&&!x.locked&&T.set(x.id,x.textureType);const A={name:"Set Texture for All Doors Above Foundation",timestamp:Date.now(),oldValues:T,newValue:v,groupId:s.foundationId,undo:()=>{y(A.oldValues)},redo:()=>{A.groupId&&g(A.oldValues,A.newValue)}};n(A),g(T,v),i(r+1)}break;case oe.OnlyThisSide:if(s.parentId){const T=new Map;for(const x of H.getState().elements)x.type===z.Door&&x.parentId===s.parentId&&!x.locked&&T.set(x.id,x.textureType);const A={name:"Set Texture for All Doors On the Same Wall",timestamp:Date.now(),oldValues:T,newValue:v,groupId:s.parentId,undo:()=>{y(A.oldValues)},redo:()=>{A.groupId&&g(A.oldValues,A.newValue)}};n(A),g(T,v),i(r+1)}break;default:if(s){const T=l(s.id),A=T?T.textureType:s.textureType,x={name:"Set Texture of Selected Door",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};n(x),p(s.id,v),i(r+1)}}a(T=>{T.actionState.doorTexture=v})}},C=()=>{t(!1)},P=()=>{b(c)};return h.jsx(so,{width:550,title:Y.t("word.Texture",d),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:9,children:h.jsxs(_o,{style:{width:"150px"},value:c,onChange:v=>u(v),children:[h.jsxs(f,{value:sr.NoTexture,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"32px",height:"20px",border:"1px dashed dimGray"},children:" "}),Y.t("shared.NoTexture",d)]},sr.NoTexture),h.jsxs(f,{value:sr.Default,children:[h.jsx("img",{alt:sr.Default,src:W$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.TextureDefault",d)]},sr.Default),h.jsxs(f,{value:sr.Texture01,children:[h.jsx("img",{alt:sr.Texture01,src:N$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture01",d)]},sr.Texture01),h.jsxs(f,{value:sr.Texture02,children:[h.jsx("img",{alt:sr.Texture02,src:lde,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture02",d)]},sr.Texture02),h.jsxs(f,{value:sr.Texture03,children:[h.jsx("img",{alt:sr.Texture03,src:U$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture03",d)]},sr.Texture03),h.jsxs(f,{value:sr.Texture04,children:[h.jsx("img",{alt:sr.Texture04,src:j$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture04",d)]},sr.Texture04),h.jsxs(f,{value:sr.Texture05,children:[h.jsx("img",{alt:sr.Texture05,src:B$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture05",d)]},sr.Texture05),h.jsxs(f,{value:sr.Texture06,children:[h.jsx("img",{alt:sr.Texture06,src:Y$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture06",d)]},sr.Texture06),h.jsxs(f,{value:sr.Texture07,children:[h.jsx("img",{alt:sr.Texture07,src:O$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture07",d)]},sr.Texture07),h.jsxs(f,{value:sr.Texture08,children:[h.jsx("img",{alt:sr.Texture08,src:_$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture08",d)]},sr.Texture08),h.jsxs(f,{value:sr.Texture09,children:[h.jsx("img",{alt:sr.Texture09,src:V$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture09",d)]},sr.Texture09),h.jsxs(f,{value:sr.Texture10,children:[h.jsx("img",{alt:sr.Texture10,src:G$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture10",d)]},sr.Texture10),h.jsxs(f,{value:sr.Texture11,children:[h.jsx("img",{alt:sr.Texture11,src:X$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture11",d)]},sr.Texture11),h.jsxs(f,{value:sr.Texture12,children:[h.jsx("img",{alt:sr.Texture12,src:J$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture12",d)]},sr.Texture12),h.jsxs(f,{value:sr.Texture13,children:[h.jsx("img",{alt:sr.Texture13,src:K$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture13",d)]},sr.Texture13),h.jsxs(f,{value:sr.Texture14,children:[h.jsx("img",{alt:sr.Texture14,src:q$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture14",d)]},sr.Texture14),h.jsxs(f,{value:sr.Texture15,children:[h.jsx("img",{alt:sr.Texture15,src:$$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture15",d)]},sr.Texture15),h.jsxs(f,{value:sr.Texture16,children:[h.jsx("img",{alt:sr.Texture16,src:Q$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture16",d)]},sr.Texture16),h.jsxs(f,{value:sr.Texture17,children:[h.jsx("img",{alt:sr.Texture17,src:Z$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture17",d)]},sr.Texture17)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:15,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setDoorActionScope(v.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",d)})]})})})]})})},hpo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(Ew),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Door),[c,u]=m.useState((s==null?void 0:s.color)??"#ffffff"),d=Jt(),f=(P,v)=>{e(T=>{for(const A of T.elements)if(A.id===P){A.locked||(A.color=v);break}})},p=(P,v)=>{for(const T of P.keys())f(T,v)},g=P=>{for(const[v,T]of P.entries())f(v,T)},y=P=>{switch(r){case oe.AllSelectedObjectsOfThisType:for(const v of n)if(v.type===z.Door&&P!==v.color&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of n)if(v.type===z.Door&&P!==v.color&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of n)if(v.type===z.Door&&v.foundationId===(s==null?void 0:s.foundationId)&&P!==v.color&&!v.locked)return!0;break;case oe.OnlyThisSide:for(const v of n)if(v.type===z.Door&&v.parentId===(s==null?void 0:s.parentId)&&P!==v.color&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.color))return!0;break}return!1},w=P=>{if(s&&y(P)){switch(r){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&v.set(A.id,A.color??"#ffffff");const T={name:"Set Color for Selected Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&!A.locked&&v.set(A.id,A.color??"#ffffff");const T={name:"Set Color for All Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&A.foundationId===s.foundationId&&!s.locked&&v.set(A.id,A.color??"#ffffff");const T={name:"Set Color for All Doors Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{g(T.oldValues)},redo:()=>{T.groupId&&p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1)}break;case oe.OnlyThisSide:if(s.parentId){const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&A.parentId===s.parentId&&!s.locked&&v.set(A.id,A.color??"#ffffff");const T={name:"Set Color for All Doors On the Same Wall",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.parentId,undo:()=>{g(T.oldValues)},redo:()=>{T.groupId&&p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1)}break;default:if(s){const v=l(s.id),T=(v?v.color:s.color)??"#ffffff",A={name:"Set Color of Selected Door",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};o(A),f(s.id,P),a(i+1)}}e(v=>{v.actionState.doorColor=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:640,title:Y.t("word.Color",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:c,onChangeComplete:P=>{u(P.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setDoorActionScope(P.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",d)})]})})})]})})},ppo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(Ew),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Door),[c,u]=m.useState((s==null?void 0:s.frameColor)??"#ffffff"),d=Jt(),f=(P,v)=>{e(T=>{for(const A of T.elements)if(A.id===P){!A.locked&&A.type===z.Door&&(A.frameColor=v);break}})},p=(P,v)=>{for(const T of P.keys())f(T,v)},g=P=>{for(const[v,T]of P.entries())f(v,T)},y=P=>{switch(r){case oe.AllSelectedObjectsOfThisType:for(const v of n)if(v.type===z.Door&&!v.locked&&H.getState().selectedElementIdSet.has(v.id)&&P!==v.frameColor)return!0;break;case oe.AllObjectsOfThisType:for(const v of n)if(v.type===z.Door&&!v.locked&&P!==v.frameColor)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of n)if(v.type===z.Door&&v.foundationId===(s==null?void 0:s.foundationId)&&!v.locked&&P!==v.frameColor)return!0;break;case oe.OnlyThisSide:for(const v of n)if(v.type===z.Door&&v.parentId===(s==null?void 0:s.parentId)&&!v.locked&&P!==v.frameColor)return!0;break;default:if(P!==(s==null?void 0:s.frameColor))return!0;break}return!1},w=P=>{if(s&&y(P)){switch(r){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&v.set(A.id,A.frameColor??"#ffffff");const T={name:"Set Color for Selected Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&!A.locked&&v.set(A.id,A.frameColor??"#ffffff");const T={name:"Set Color for All Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&A.foundationId===s.foundationId&&!s.locked&&v.set(A.id,A.frameColor??"#ffffff");const T={name:"Set Color for All Doors Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{g(T.oldValues)},redo:()=>{T.groupId&&p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1)}break;case oe.OnlyThisSide:if(s.parentId){const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&A.parentId===s.parentId&&!s.locked&&v.set(A.id,A.frameColor??"#ffffff");const T={name:"Set Color for All Doors On the Same Wall",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.parentId,undo:()=>{g(T.oldValues)},redo:()=>{T.groupId&&p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1)}break;default:if(s){const v=l(s.id),T=(v?v.frameColor:s.frameColor)??"#ffffff",A={name:"Set Color of Selected Door",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};o(A),f(s.id,P),a(i+1)}}e(v=>{v.actionState.doorColor=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:640,title:Y.t("doorMenu.FrameColor",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:c??(s==null?void 0:s.frameColor)??"#ffffff",onChangeComplete:P=>{u(P.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setDoorActionScope(P.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",d)})]})})})]})})},gpo=t=>{const e=[];if(t.type!==z.Door)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language};return e.push({key:"door-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"door-cut",label:h.jsx(Wd,{})}),e.push({key:"door-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&(e.push({key:"door-filled",label:h.jsx(rpo,{door:n})},{key:"door-interior",label:h.jsx(ipo,{door:n})}),e.push({key:"door-type-submenu",label:h.jsx(rn,{children:Y.t("doorMenu.DoorType",r)}),children:[{key:"door-type-radio-group",label:h.jsx(apo,{door:n}),style:{backgroundColor:"white"}}]},{key:"door-width",label:h.jsxs(to,{Dialog:lpo,children:[Y.t("word.Width",r)," ..."]})},{key:"door-height",label:h.jsxs(to,{Dialog:spo,children:[Y.t("word.Height",r)," ..."]})}),n.filled&&(e.push({key:"door-u-value",label:h.jsxs(to,{Dialog:upo,children:[Y.t("word.UValue",r)," ..."]})},{key:"door-heat-capacity",label:h.jsxs(to,{Dialog:dpo,children:[Y.t("word.VolumetricHeatCapacity",r)," ..."]})},{key:"door-texture",label:h.jsxs(to,{Dialog:fpo,children:[Y.t("word.Texture",r)," ..."]})},{key:"door-color",label:h.jsxs(to,{Dialog:hpo,children:[Y.t("word.Color",r)," ..."]})},{key:"door-frame-color",label:h.jsxs(to,{Dialog:ppo,children:[Y.t("doorMenu.FrameColor",r)," ..."]})}),(n.textureType===sr.Default||n.textureType===sr.NoTexture)&&e.push({key:"door-opacity",label:h.jsxs(to,{Dialog:cpo,children:[Y.t("wallMenu.Opacity",r)," ..."]})}))),{items:e}},mpo=({windowModel:t,dataType:e,attributeKey:n,range:o,step:r,unit:i,note:a,digit:l,setDialogVisible:s})=>{const c=H(Kn),u=H(En),d=H(SW),f=H(no),p=H(Zn),g=H(fn),y=H(qr),w=m.useMemo(()=>{const L=t[n],k=y(t);if(k&&t.parentType!==z.Roof){if(n==="lx")return L*k.lx;if(n==="lz")return L*k.lz}return n==="sillWidth"&&L===void 0?.2:L},[n,t]),[b,C]=m.useState(w),P=Jt(),v=(L,k,N)=>{const F=y(L);F&&(k==="lx"||k==="lz")?L.parentType===z.Roof?L[k]=N:L[k]=N/F[k]:L[k]=N},T=(L,k)=>{g(N=>{for(const F of N.elements)if(F.id===L){!F.locked&&F.type===z.Window&&v(F,n,k);break}})},A=(L,k)=>{L&&g(N=>{for(const F of N.elements)!F.locked&&F.type===z.Window&&F.parentId===L&&v(F,n,k)})},x=(L,k)=>{L&&g(N=>{for(const F of N.elements)!F.locked&&F.type===z.Window&&F.foundationId===L&&v(F,n,k)})},S=L=>{g(k=>{for(const N of k.elements)!N.locked&&N.type===z.Window&&v(N,n,L)})},R=(L,k)=>{g(N=>{for(const F of N.elements)!F.locked&&F.type===z.Window&&L.has(F.id)&&v(F,n,k)})},M=L=>{for(const[k,N]of L.entries())T(k,N)},D=L=>{switch(d){case oe.AllSelectedObjectsOfThisType:{for(const k of c)if(k.type===z.Window&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)){const N=k,F=y(N);if(F&&N.parentType!==z.Roof){if(n==="lx"){if(L!==N[n]*F.lx)return!0}else if(n==="lz"){if(L!==N[n]*F.lz)return!0}else if(L!==N[n])return!0}else if(L!==N[n])return!0}break}case oe.AllObjectsOfThisType:{for(const k of c)if(k.type===z.Window&&!k.locked){const N=k,F=y(N);if(F&&N.parentType!==z.Roof){if(n==="lx"){if(L!==N[n]*F.lx)return!0}else if(n==="lz"){if(L!==N[n]*F.lz)return!0}else if(L!==N[n])return!0}else if(L!==N[n])return!0}break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const k of c)if(k.type===z.Window&&k.foundationId===t.foundationId&&!k.locked){const N=k,F=y(N);if(F&&N.parentType!==z.Roof){if(n==="lx"){if(L!==N[n]*F.lx)return!0}else if(n==="lz"){if(L!==N[n]*F.lz)return!0}else if(L!==N[n])return!0}else if(L!==N[n])return!0}break}case oe.OnlyThisSide:{for(const k of c)if(k.type===z.Window&&k.parentId===t.parentId&&!k.locked){const N=k,F=y(N);if(F&&N.parentType!==z.Roof){if(n==="lx"){if(L!==N[n]*F.lx)return!0}else if(n==="lz"){if(L!==N[n]*F.lz)return!0}else if(L!==N[n])return!0}else if(L!==N[n])return!0}break}default:{const k=y(t);if(k&&t.parentType!==z.Roof){if(n==="lx"){if(L!==t[n]*k.lx)return!0}else if(n==="lz"){if(L!==t[n]*k.lz)return!0}else if(L!==t[n])return!0}else if(L!==t[n])return!0;break}}return!1},E=L=>{if(t&&D(L)){switch(d){case oe.AllSelectedObjectsOfThisType:{const k=new Map;for(const F of c)if(F.type===z.Window&&!F.locked&&H.getState().selectedElementIdSet.has(F.id)){const U=F,O=y(U);let B=U[n];O&&U.parentType!==z.Roof&&(n==="lx"?B*=O.lx:n==="lz"&&(B*=O.lz)),k.set(F.id,B)}const N={name:`Set ${e} for Selected Windows`,timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{M(N.oldValues)},redo:()=>{R(N.oldValues,N.newValue)}};u(N),R(k,L),p(f+1);break}case oe.AllObjectsOfThisType:{const k=new Map;for(const F of c)if(F.type===z.Window&&!F.locked){const U=F,O=y(U);let B=U[n];O&&U.parentType!==z.Roof&&(n==="lx"?B*=O.lx:n==="lz"&&(B*=O.lz)),k.set(F.id,B)}const N={name:`Set ${e} for All Windows`,timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{M(N.oldValues)},redo:()=>{S(N.newValue)}};u(N),S(L),p(f+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(t.foundationId){const k=new Map;for(const F of c)if(F.type===z.Window&&F.foundationId===t.foundationId&&!F.locked){const U=F,O=y(U);let B=U[n];O&&U.parentType!==z.Roof&&(n==="lx"?B*=O.lx:n==="lz"&&(B*=O.lz)),k.set(F.id,B)}const N={name:`Set ${e} for All Windows Above Foundation`,timestamp:Date.now(),oldValues:k,newValue:L,groupId:t.foundationId,undo:()=>{M(N.oldValues)},redo:()=>{x(t.foundationId,N.newValue)}};u(N),x(t.foundationId,L),p(f+1)}break;case oe.OnlyThisSide:if(t.parentId){const k=new Map;for(const F of c)if(F.type===z.Window&&F.parentId===t.parentId&&!F.locked){const U=F,O=y(U);let B=U[n];O&&U.parentType!==z.Roof&&(n==="lx"?B*=O.lx:n==="lz"&&(B*=O.lz)),k.set(F.id,B)}const N={name:`Set ${e} for All Windows On the Same Parent`,timestamp:Date.now(),oldValues:k,newValue:L,groupId:t.parentId,undo:()=>{M(N.oldValues)},redo:()=>{A(t.parentId,N.newValue)}};u(N),A(t.parentId,L),p(f+1)}break;default:if(t){let k=t[n];const N=y(t);N&&t.parentType!==z.Roof&&(n==="lx"?k*=N.lx:n==="lz"&&(k*=N.lz));const F={name:`Set Window ${e}`,timestamp:Date.now(),oldValue:k,newValue:L,changedElementId:t.id,changedElementType:t.type,undo:()=>{T(F.changedElementId,F.oldValue)},redo:()=>{T(F.changedElementId,F.newValue)}};u(F),T(t.id,L),p(f+1)}}g(k=>{switch(e){case $h.Width:k.actionState.windowWidth=L;break;case $h.Height:k.actionState.windowHeight=L;break;case $h.Opacity:k.actionState.windowOpacity=L;break;case $h.FrameWidth:k.actionState.windowFrameWidth=L;break;case $h.SillWidth:k.actionState.windowSillWidth=L;break;case $h.HorizontalMullionSpacing:k.actionState.windowHorizontalMullionSpacing=L;break;case $h.VerticalMullionSpacing:k.actionState.windowVerticalMullionSpacing=L;break;case $h.MullionWidth:k.actionState.windowMullionWidth=L;break}})}},W=()=>{s(!1)},j=()=>{E(b)};return h.jsx(so,{width:550,title:Y.t(`windowMenu.${e}`,P),onApply:j,onClose:W,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:o[0],max:o[1],style:{width:120},step:r,precision:2,value:b,formatter:L=>Number(L).toFixed(2),onChange:L=>{L!==null&&C(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",P),": [",o[0].toFixed(o[0]===0?0:l??0),","," ",o[1].toFixed(l??0),"] ",i," ",h.jsx("br",{}),h.jsx("br",{})," ",a]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:i}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:L=>H.getState().setWindowActionScope(L.target.value),value:d,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windowMenu.OnlyThisWindow",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("windowMenu.AllWindowsOnSurface",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windowMenu.AllWindowsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windowMenu.AllSelectedWindows",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windowMenu.AllWindows",P)})]})})})]})})},ypo=({window:t,dataType:e,attributeKey:n,setDialogVisible:o})=>{const r=H(Kn),i=H(fn),a=H(En),l=H(SW),s=H(no),c=H(Zn),[u,d]=XZ(t[n]??"#ffffff"),f=Jt(),p=(x,S)=>{i(R=>{for(const M of R.elements)if(M.id===x){!M.locked&&M.type===z.Window&&(M[n]=S);break}})},g=(x,S)=>{i(R=>{for(const M of R.elements)!M.locked&&M.type===z.Window&&M.parentId===x&&(M[n]=S)})},y=(x,S)=>{i(R=>{for(const M of R.elements)!M.locked&&M.type===z.Window&&M.foundationId===x&&(M[n]=S)})},w=x=>{i(S=>{for(const R of S.elements)!R.locked&&R.type===z.Window&&(R[n]=x)})},b=(x,S)=>{i(R=>{for(const M of R.elements)!M.locked&&M.type===z.Window&&x.has(M.id)&&(M[n]=S)})},C=x=>{for(const[S,R]of x.entries())p(S,R)},P=x=>{switch(l){case oe.AllSelectedObjectsOfThisType:for(const S of r)if(S.type===z.Window&&x!==S[n]&&!S.locked&&H.getState().selectedElementIdSet.has(S.id))return!0;break;case oe.AllObjectsOfThisType:for(const S of r)if(S.type===z.Window&&x!==S[n]&&!S.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const S of r)if(S.type===z.Window&&S.foundationId===t.foundationId&&x!==S[n]&&!S.locked)return!0;break;case oe.OnlyThisSide:for(const S of r)if(S.type===z.Window&&S.parentId===t.parentId&&x!==S[n]&&!S.locked)return!0;break;default:if(x!==t[n])return!0;break}return!1},v=x=>{if(t&&P(x)){switch(l){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of r)M.type===z.Window&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M[n]);const R={name:`Set ${e} for Selected Windows`,timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{C(R.oldValues)},redo:()=>{b(R.oldValues,R.newValue)}};a(R),b(S,x),c(s+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of r)M.type===z.Window&&!M.locked&&S.set(M.id,M[n]);const R={name:`Set ${e} for All Windows`,timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{C(R.oldValues)},redo:()=>{w(R.newValue)}};a(R),w(x),c(s+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(t.foundationId){const S=new Map;for(const M of r)M.type===z.Window&&M.foundationId===t.foundationId&&!t.locked&&S.set(M.id,M[n]);const R={name:`Set ${e} for All Windows Above Foundation`,timestamp:Date.now(),oldValues:S,newValue:x,groupId:t.foundationId,undo:()=>{C(R.oldValues)},redo:()=>{y(R.groupId,R.newValue)}};a(R),y(t.foundationId,x),c(s+1)}break}case oe.OnlyThisSide:{if(t.parentId){const S=new Map;for(const M of r)M.type===z.Window&&M.parentId===t.parentId&&!M.locked&&S.set(M.id,M[n]);const R={name:`Set ${e} for All Windows On the Same Wall`,timestamp:Date.now(),oldValues:S,newValue:x,groupId:t.parentId,undo:()=>{C(R.oldValues)},redo:()=>{g(t.parentId,R.newValue)}};a(R),g(t.parentId,x),c(s+1)}break}default:{if(t){const S=t[n],R={name:`Set ${e} of Selected window`,timestamp:Date.now(),oldValue:S,newValue:x,changedElementId:t.id,changedElementType:t.type,undo:()=>{p(R.changedElementId,R.oldValue)},redo:()=>{p(R.changedElementId,R.newValue)}};a(R),p(t.id,x),c(s+1)}break}}i(S=>{switch(e){case $h.Tint:S.actionState.windowTint=x;break;case $h.MullionColor:S.actionState.windowMullionColor=x;break;case $h.Color:S.actionState.windowColor=x;break}})}},T=()=>{o()},A=()=>{t[n]!==u&&v(u)};return h.jsx(so,{width:640,title:Y.t(`windowMenu.${e}`,f),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:u??"#73D8FF",onChangeComplete:d})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:x=>H.getState().setWindowActionScope(x.target.value),value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windowMenu.OnlyThisWindow",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("windowMenu.AllWindowsOnSurface",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windowMenu.AllWindowsAboveFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windowMenu.AllSelectedWindows",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windowMenu.AllWindows",f)})]})})})]})})},Apo=({window:t,dataType:e,attributeKey:n,setDialogVisible:o})=>{const r=H(Kn),i=H(fn),a=H(En),l=H(SW),s=H(no),c=H(Zn),[u,d]=m.useState(t[n]),f=Jt(),p=(x,S)=>{i(R=>{for(const M of R.elements)if(M.id===x&&!M.locked&&M.type===z.Window){M[n]=S;break}})},g=(x,S)=>{i(R=>{for(const M of R.elements)!M.locked&&M.type===z.Window&&M.parentId===x&&(M[n]=S)})},y=(x,S)=>{i(R=>{for(const M of R.elements)!M.locked&&M.type===z.Window&&M.foundationId===x&&(M[n]=S)})},w=x=>{i(S=>{for(const R of S.elements)!R.locked&&R.type===z.Window&&(R[n]=x)})},b=(x,S)=>{i(R=>{for(const M of R.elements)!M.locked&&M.type===z.Window&&x.has(M.id)&&(M[n]=S)})},C=x=>{for(const[S,R]of x.entries())p(S,R)},P=x=>{switch(l){case oe.AllSelectedObjectsOfThisType:for(const S of r)if(S.type===z.Window&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&S[n]!==x)return!0;break;case oe.AllObjectsOfThisType:for(const S of r)if(S.type===z.Window&&!S.locked&&S[n]!==x)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const S of r)if(S.type===z.Window&&S.foundationId===t.foundationId&&!S.locked&&S[n]!==x)return!0;break;case oe.OnlyThisSide:for(const S of r)if(S.type===z.Window&&S.parentId===t.parentId&&!S.locked&&S[n]!==x)return!0;break;default:if(t[n]!==x)return!0;break}return!1},v=x=>{if(t&&P(x))switch(l){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of r)M.type===z.Window&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M[n]);const R={name:`Set ${e} for Selected Windows`,timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{C(R.oldValues)},redo:()=>{b(R.oldValues,R.newValue)}};a(R),b(S,x),c(s+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of r)M.type===z.Window&&!M.locked&&S.set(M.id,M[n]);const R={name:`Set ${e} for All Windows`,timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{C(R.oldValues)},redo:()=>{w(R.newValue)}};a(R),w(x),c(s+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(t.foundationId){const S=new Map;for(const M of r)M.type===z.Window&&M.foundationId===t.foundationId&&!t.locked&&S.set(M.id,M[n]);const R={name:`Set ${e} for All Windows Above Foundation`,timestamp:Date.now(),oldValues:S,newValue:x,groupId:t.foundationId,undo:()=>{C(R.oldValues)},redo:()=>{y(R.groupId,R.newValue)}};a(R),y(t.foundationId,x),c(s+1)}break}case oe.OnlyThisSide:{if(t.parentId){const S=new Map;for(const M of r)M.type===z.Window&&M.parentId===t.parentId&&!M.locked&&S.set(M.id,M[n]);const R={name:`Set ${e} for All Windows On the Same Wall`,timestamp:Date.now(),oldValues:S,newValue:x,groupId:t.parentId,undo:()=>{C(R.oldValues)},redo:()=>{g(t.parentId,R.newValue)}};a(R),g(t.parentId,x),c(s+1)}break}default:{if(t){const S=t[n],R={name:`Set ${e} of Selected window`,timestamp:Date.now(),oldValue:S,newValue:x,changedElementId:t.id,changedElementType:t.type,undo:()=>{p(R.changedElementId,R.oldValue)},redo:()=>{p(R.changedElementId,R.newValue)}};a(R),p(t.id,x),c(s+1)}break}}},T=()=>{o()},A=()=>{t[n]!==u&&v(u)};return h.jsx(so,{width:500,title:Y.t(`windowMenu.${e}`,f),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:4,children:h.jsx(xc,{checked:u,onChange:x=>{d(x)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:20,children:h.jsx(Ue.Group,{onChange:x=>H.getState().setWindowActionScope(x.target.value),value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windowMenu.OnlyThisWindow",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("windowMenu.AllWindowsOnSurface",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windowMenu.AllWindowsAboveFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windowMenu.AllSelectedWindows",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windowMenu.AllWindows",f)})]})})})]})})},{Option:wpo}=_o,vpo=({window:t,dataType:e,attributeKey:n,options:o,optionsText:r,setDialogVisible:i})=>{const a=H(Kn),l=H(fn),s=H(En),c=H(SW),u=H(no),d=H(Zn),[f,p]=m.useState(t[n]),g=Jt(),y=(R,M)=>{l(D=>{for(const E of D.elements)if(E.id===R){!E.locked&&E.type===z.Window&&(E[n]=M);break}})},w=(R,M)=>{l(D=>{for(const E of D.elements)!E.locked&&E.type===z.Window&&E.parentId===R&&(E[n]=M)})},b=(R,M)=>{l(D=>{for(const E of D.elements)!E.locked&&E.type===z.Window&&E.foundationId===R&&(E[n]=M)})},C=R=>{l(M=>{for(const D of M.elements)!D.locked&&D.type===z.Window&&(D[n]=R)})},P=(R,M)=>{l(D=>{for(const E of D.elements)!E.locked&&E.type===z.Window&&R.has(E.id)&&(E[n]=M)})},v=R=>{for(const[M,D]of R.entries())y(M,D)},T=R=>{if(t){switch(c){case oe.AllSelectedObjectsOfThisType:for(const M of a)if(M.type===z.Window&&R!==M[n]&&!M.locked&&H.getState().selectedElementIdSet.has(M.id))return!0;break;case oe.AllObjectsOfThisType:for(const M of a)if(M.type===z.Window&&R!==M[n]&&!M.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const M of a)if(M.type===z.Window&&M.foundationId===t.foundationId&&R!==M[n]&&!M.locked)return!0;break;case oe.OnlyThisSide:for(const M of a)if(M.type===z.Window&&M.parentId===t.parentId&&R!==M[n]&&!M.locked)return!0;break;default:if(R!==t[n])return!0;break}return!1}},A=R=>{if(t&&T(R)){switch(c){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of a)E.type===z.Window&&!E.locked&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E[n]);const D={name:`Set ${e} for Selected Windows`,timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{v(D.oldValues)},redo:()=>{P(D.oldValues,D.newValue)}};s(D),P(M,R),d(u+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of a)E.type===z.Window&&!E.locked&&M.set(E.id,E[n]);const D={name:`Set ${e} for All Windows`,timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{v(D.oldValues)},redo:()=>{C(D.newValue)}};s(D),C(R),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(t.foundationId){const M=new Map;for(const E of a)E.type===z.Window&&E.foundationId===t.foundationId&&!t.locked&&M.set(E.id,E[n]);const D={name:`Set ${e} for All Windows Above Foundation`,timestamp:Date.now(),oldValues:M,newValue:R,groupId:t.foundationId,undo:()=>{v(D.oldValues)},redo:()=>{b(D.groupId,D.newValue)}};s(D),b(t.foundationId,R),d(u+1)}break}case oe.OnlyThisSide:{if(t.parentId){const M=new Map;for(const E of a)E.type===z.Window&&E.parentId===t.parentId&&!E.locked&&M.set(E.id,E[n]);const D={name:`Set ${e} for All Windows On the Same Wall`,timestamp:Date.now(),oldValues:M,newValue:R,groupId:t.parentId,undo:()=>{v(D.oldValues)},redo:()=>{w(t.parentId,D.newValue)}};s(D),w(t.parentId,R),d(u+1)}break}default:{if(t){const M=t[n],D={name:`Set ${e} of Selected window`,timestamp:Date.now(),oldValue:M,newValue:R,changedElementId:t.id,changedElementType:t.type,undo:()=>{y(D.changedElementId,D.oldValue)},redo:()=>{y(D.changedElementId,D.newValue)}};s(D),y(t.id,R),d(u+1)}break}}l(M=>{switch(e){case $h.Tint:M.actionState.windowTint=R;break;case $h.MullionColor:M.actionState.windowMullionColor=R;break;case $h.Color:M.actionState.windowColor=R;break}})}},x=()=>{i()},S=()=>{A(f)};return h.jsx(so,{width:560,title:Y.t(`windowMenu.${e}`,g),onApply:S,onClose:x,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:8,children:h.jsx(_o,{style:{width:"150px"},value:f,onChange:R=>p(R),children:o.map((R,M)=>h.jsx(wpo,{value:R,children:r[M]},R))})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:R=>H.getState().setWindowActionScope(R.target.value),value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windowMenu.OnlyThisWindow",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("windowMenu.AllWindowsOnSurface",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windowMenu.AllWindowsAboveFoundation",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windowMenu.AllSelectedWindows",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windowMenu.AllWindows",g)})]})})})]})})};var xg=(t=>(t.Opacity="Opacity",t.Width="Width",t.Height="Height",t.Setback="Setback",t.HorizontalMullionSpacing="HorizontalMullionSpacing",t.VerticalMullionSpacing="VerticalMullionSpacing",t.MullionWidth="MullionWidth",t.SillWidth="SillWidth",t.FrameWidth="FrameWidth",t.ShutterWidth="ShutterWidth",t))(xg||{}),$N=(t=>(t.ShutterColor="ShutterColor",t.Color="Color",t.MullionColor="MullionColor",t.Tint="Tint",t))($N||{}),qR=(t=>(t.Frame="Frame",t.LeftShutter="LeftShutter",t.RightShutter="RightShutter",t.HorizontalMullion="HorizontalMullion",t.VerticalMullion="VerticalMullion",t))(qR||{}),zrt=(t=>(t.WindowType="WindowType",t))(zrt||{});const A9=({dataType:t,noPadding:e})=>{const n=Jt(),[o,r]=m.useState(!1),i=co(z.Window),a=i?H.getState().getParent(i):null,l=()=>{H.getState().setApplyCount(0),r(!0)},s=zpo[t];return t===xg.Width?s.range[1]=a&&i&&i.parentType!==z.Roof?2*a.lx*Math.min(Math.abs(.5-i.cx),Math.abs(-.5-i.cx)):100:t===xg.Height&&(s.range[1]=a&&i&&i.parentType!==z.Roof?2*a.lz*Math.min(Math.abs(.5-i.cz),Math.abs(-.5-i.cz)):100),h.jsxs(h.Fragment,{children:[h.jsxs(rn,{noPadding:e,onClick:l,children:[Y.t(`windowMenu.${t}`,n)," ..."]}),o&&s&&i&&h.jsx(mpo,{windowModel:i,dataType:t,attributeKey:s.attributeKey,range:s.range,step:s.step,unit:s.unit?Y.t(s.unit,n):void 0,note:s.note?Y.t(s.note,n):void 0,digit:s.digit??0,setDialogVisible:r})]})},dee=({dataType:t,noPadding:e})=>{const[n,o]=m.useState(!1),r=Jt(),i=co(z.Window),a=()=>{H.getState().setApplyCount(0),o(!0)},l=Hpo[t];return h.jsxs(h.Fragment,{children:[h.jsxs(rn,{noPadding:e,onClick:a,children:[Y.t(`windowMenu.${t}`,r)," ..."]}),n&&l&&i&&h.jsx(ypo,{window:i,dataType:t,attributeKey:l.attributeKey,setDialogVisible:()=>o(!1)})]})},Wk=({dataType:t,noPadding:e})=>{const[n,o]=m.useState(!1),r=Jt(),i=co(z.Window),a=()=>{H.getState().setApplyCount(0),o(!0)},l=Mpo[t];return h.jsxs(h.Fragment,{children:[h.jsxs(rn,{noPadding:e,onClick:a,children:[Y.t(`windowMenu.${t}`,r)," ..."]}),n&&l&&i&&h.jsx(Apo,{window:i,dataType:t,attributeKey:l.attributeKey,setDialogVisible:()=>o(!1)})]})},xpo=({dataType:t,noPadding:e})=>{const n=Jt(),[o,r]=m.useState(!1),i=co(z.Window),a=()=>{H.getState().setApplyCount(0),r(!0)},l=Ipo[t];return h.jsxs(h.Fragment,{children:[h.jsxs(rn,{noPadding:e,onClick:a,children:[Y.t(`windowMenu.${t}`,n)," ..."]}),o&&l&&i&&h.jsx(vpo,{window:i,dataType:t,attributeKey:l.attributeKey,options:[Ti.Default,Ti.Arched,Ti.Polygonal],optionsText:[Y.t("windowMenu.Default",n),Y.t("windowMenu.Arched",n),Y.t("windowMenu.Polygonal",n)],setDialogVisible:()=>r(!1)})]})},bpo=({window:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&l.type===z.Window){l.empty=i;break}})},o=r=>{const i=r.target.checked,a={name:"Empty Window",timestamp:Date.now(),checked:i,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i),H.getState().set(l=>{l.actionState.windowEmpty=i})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:!!t.empty,onChange:o,children:Y.t("windowMenu.Empty",e)})})},Spo=({window:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&l.type===z.Window){l.interior=i;break}})},o=r=>{const i=r.target.checked,a={name:"Interior Window",timestamp:Date.now(),checked:i,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i),H.getState().set(l=>{l.actionState.windowInterior=i})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:!!t.interior,onChange:o,children:Y.t("windowMenu.Interior",e)})})},Tpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(SW),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Window),[c,u]=m.useState((s==null?void 0:s.uValue)??V4),[d,f]=m.useState(me.toUValueInUS(c)),p=Jt(),g=(T,A)=>{l(x=>{for(const S of x.elements)if(S.id===T){S.uValue=A;break}})},y=T=>{for(const[A,x]of T.entries())g(A,x)},w=(T,A)=>{for(const x of T.keys())g(x,A)},b=T=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const A of e)if(A.type===z.Window&&T!==A.uValue&&!A.locked&&H.getState().selectedElementIdSet.has(A.id))return!0;break;case oe.AllObjectsOfThisType:for(const A of e)if(A.type===z.Window&&T!==A.uValue&&!A.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const A of e)if(A.type===z.Window&&A.foundationId===s.foundationId&&T!==A.uValue&&!A.locked)return!0;break;case oe.OnlyThisSide:for(const A of e)if(A.type===z.Window&&A.parentId===s.parentId&&T!==A.uValue&&!A.locked)return!0;break;default:if(T!==(s==null?void 0:s.uValue))return!0;break}return!1}},C=T=>{if(s&&b(T)){switch(o){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of e)if(S.type===z.Window&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)){const R=S;A.set(S.id,R.uValue??V4),g(R.id,T)}const x={name:"Set U-Value for Selected Windows",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of e)if(S.type===z.Window&&!S.locked){const R=S;A.set(S.id,R.uValue??V4),g(R.id,T)}const x={name:"Set U-Value for All Windows",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(s.foundationId){const A=new Map;for(const S of e)if(S.type===z.Window&&S.foundationId===s.foundationId&&!S.locked){const R=S;A.set(S.id,R.uValue??V4),g(R.id,T)}const x={name:"Set U-Value for All Windows Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.foundationId,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1)}break}case oe.OnlyThisSide:{if(s.parentId){const A=new Map;for(const S of e)if(S.type===z.Window&&S.parentId===s.parentId&&!S.locked){const R=S;A.set(S.id,R.uValue??V4),g(R.id,T)}const x={name:"Set U-Value for All Windows On the Same Wall",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.parentId,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1)}break}default:{if(s){const x=a(s.id).uValue??s.uValue??V4,S={name:"Set Window U-Value",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:s.id,changedElementType:s.type,undo:()=>{g(S.changedElementId,S.oldValue)},redo:()=>{g(S.changedElementId,S.newValue)}};n(S),g(s.id,T),i(r+1)}break}}l(A=>{A.actionState.windowUValue=T})}},P=()=>{t(!1)},v=()=>{C(c)};return h.jsx(so,{width:550,title:`${Y.t("word.UValue",p)+" "}(${Y.t("word.ThermalTransmittance",p)})`,onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(u(T),f(me.toUValueInUS(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0.01, 100]",h.jsx("br",{}),Y.t("word.SIUnit",p),": W/(m²·℃)"]}),h.jsx("br",{}),h.jsx(Mn,{min:me.toUValueInUS(.01),max:me.toUValueInUS(100),style:{width:120},step:.01,precision:2,value:d,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(f(T),u(me.toUValueInSI(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [",me.toUValueInUS(.01).toFixed(3),", ",me.toUValueInUS(100).toFixed(1),"]",h.jsx("br",{}),Y.t("word.USUnit",p),": Btu/(h·ft²·℉)"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:T=>H.getState().setWindowActionScope(T.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windowMenu.OnlyThisWindow",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("windowMenu.AllWindowsOnSurface",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windowMenu.AllWindowsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windowMenu.AllSelectedWindows",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windowMenu.AllWindows",p)})]})})})]})})},Ppo=t=>{const e=[];return e.push({key:"window-frame-boolean",label:h.jsx(Wk,{noPadding:!0,dataType:qR.Frame})}),t.frame&&e.push({type:"divider"},{key:"window-frame-width",label:h.jsx(A9,{noPadding:!0,dataType:xg.FrameWidth})},{key:"window-sill-width",label:h.jsx(A9,{noPadding:!0,dataType:xg.SillWidth})},{key:"window-frame-color",label:h.jsx(dee,{noPadding:!0,dataType:$N.Color})}),e},Cpo=t=>{const e=[];return e.push({key:"window-horizontal-mullion",label:h.jsx(Wk,{noPadding:!0,dataType:qR.HorizontalMullion})},{key:"window-vertical-mullion",label:h.jsx(Wk,{noPadding:!0,dataType:qR.VerticalMullion})}),(t.horizontalMullion||t.verticalMullion)&&(e.push({type:"divider"},{key:"window-mullion-width",label:h.jsx(A9,{noPadding:!0,dataType:xg.MullionWidth})},{key:"window-mullion-color",label:h.jsx(dee,{noPadding:!0,dataType:$N.MullionColor})}),t.horizontalMullion&&e.push({key:"window-horizontal-mullion-spacing",label:h.jsx(A9,{noPadding:!0,dataType:xg.HorizontalMullionSpacing})}),t.verticalMullion&&e.push({key:"window-vertical-mullion-spacing",label:h.jsx(A9,{noPadding:!0,dataType:xg.VerticalMullionSpacing})})),e},Rpo=t=>{const e=[];return e.push({key:"window-left-shutter",label:h.jsx(Wk,{noPadding:!0,dataType:qR.LeftShutter})},{key:"window-right-shutter",label:h.jsx(Wk,{noPadding:!0,dataType:qR.RightShutter})}),(t.leftShutter||t.rightShutter)&&e.push({type:"divider"},{key:"window-shutter-color",label:h.jsx(dee,{noPadding:!0,dataType:$N.ShutterColor})},{key:"window-shutter-width",label:h.jsx(A9,{noPadding:!0,dataType:xg.ShutterWidth})}),e};var $h=(t=>(t.Color="Color",t.Tint="Tint",t.Opacity="Opacity",t.WindowType="WindowType",t.MullionWidth="MullionWidth",t.HorizontalMullionSpacing="HorizontalMullionSpacing",t.VerticalMullionSpacing="VerticalMullionSpacing",t.MullionColor="MullionColor",t.Frame="Frame",t.FrameWidth="FrameWidth",t.SillWidth="SillWidth",t.Width="Width",t.Height="Height",t))($h||{});const Hpo={Tint:{attributeKey:"tint"},Color:{attributeKey:"color"},MullionColor:{attributeKey:"mullionColor"},ShutterColor:{attributeKey:"shutterColor"}},Mpo={HorizontalMullion:{attributeKey:"horizontalMullion"},VerticalMullion:{attributeKey:"verticalMullion"},Frame:{attributeKey:"frame"},LeftShutter:{attributeKey:"leftShutter"},RightShutter:{attributeKey:"rightShutter"}},Ipo={WindowType:{attributeKey:"windowType",options:[Ti.Default,Ti.Arched,Ti.Polygonal]}},zpo={Opacity:{attributeKey:"opacity",range:[0,.9],step:.1,note:"windowMenu.SolarHeatGainCoefficient",digit:1},Width:{attributeKey:"lx",range:[.1,100],step:.1,unit:"word.MeterAbbreviation",digit:1},Height:{attributeKey:"lz",range:[.1,100],step:.1,unit:"word.MeterAbbreviation",digit:1},Setback:{attributeKey:"cy",range:[0,1],step:.01,unit:"",digit:0,note:"windowMenu.RelativeToWallThickness"},MullionWidth:{attributeKey:"mullionWidth",range:[0,.5],step:.1,unit:"word.MeterAbbreviation",digit:1},ShutterWidth:{attributeKey:"shutterWidth",range:[0,.5],step:.01,unit:"",digit:1},HorizontalMullionSpacing:{attributeKey:"horizontalMullionSpacing",range:[.1,10],step:.01,unit:"word.MeterAbbreviation",digit:1},VerticalMullionSpacing:{attributeKey:"verticalMullionSpacing",range:[.1,10],step:.01,unit:"word.MeterAbbreviation",digit:1},FrameWidth:{attributeKey:"frameWidth",range:[.05,.2],step:.01,unit:"word.MeterAbbreviation",digit:2},SillWidth:{attributeKey:"sillWidth",range:[0,.5],step:.01,unit:"word.MeterAbbreviation",digit:2}},Dpo=t=>{const e=[];if(t.type!==z.Window)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language};return e.push({key:"window-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"window-cut",label:h.jsx(Wd,{})}),e.push({key:"window-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&e.push({key:"window-empty",label:h.jsx(bpo,{window:n})},{key:"window-interior",label:h.jsx(Spo,{window:n})}),o&&e.push({key:"window-type",label:h.jsx(xpo,{dataType:zrt.WindowType})},{key:"window-width",label:h.jsx(A9,{dataType:xg.Width})},{key:"window-height",label:h.jsx(A9,{dataType:xg.Height})},{key:"window-setback",label:h.jsx(A9,{dataType:xg.Setback})},{key:"window-opacity",label:h.jsx(A9,{dataType:xg.Opacity})},{key:"window-tint",label:h.jsx(dee,{dataType:$N.Tint})},{key:"window-u-value",label:h.jsxs(to,{Dialog:Tpo,children:[Y.t("word.UValue",r)," ..."]})},{key:"window-mullion-submenu",label:h.jsx(rn,{children:Y.t("windowMenu.Mullion",r)}),children:Cpo(n)},{key:"window-frame-submenu",label:h.jsx(rn,{children:Y.t("windowMenu.Frame",r)}),children:Ppo(n)},{key:"window-shutter-submenu",label:h.jsx(rn,{children:Y.t("windowMenu.Shutter",r)}),children:Rpo(n)}),{items:e}},Epo=({roof:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{const l=a.elements.find(s=>s.id===r&&s.type===z.Roof);l&&(l.ceiling=i,a.actionState.roofCeiling=i)})},o=r=>{const i=r.target.checked,a={name:"Roof Ceiling",timestamp:Date.now(),checked:i,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.ceiling,onChange:o,children:Y.t("roofMenu.Ceiling",e)})})},Fpo=({roof:t,objectType:e,modalTitle:n,onClickOk:o,children:r})=>{const i=H.getState().removeAllChildElementsByType,a=()=>{const s=H.getState().elements.filter(d=>!d.locked&&d.type===e&&d.parentId===t.id);i(t.id,e);const c=JSON.parse(JSON.stringify(s)),u={name:`Remove All ${e}s on Roof`,timestamp:Date.now(),parentId:t.id,removedElements:c,undo:()=>{H.getState().set(d=>{d.elements.push(...u.removedElements)})},redo:()=>{i(u.parentId,e)}};H.getState().addUndoable(u)},l=()=>{const s=o??a;Oi.confirm({title:n,icon:h.jsx(ny,{}),onOk:s})};return h.jsx(rn,{update:!0,noPadding:!0,onClick:l,children:r})},zHe=({roof:t,objectType:e,lock:n,children:o})=>{const r=H.getState().updateElementLockById,i=H.getState().updateElementLockByParentId,a=()=>{const l=e.replaceAll(" ",""),s=new Map;for(const d of H.getState().elements)d.parentId===t.id&&d.type===e&&s.set(d.id,!!d.locked);i(t.id,e,n);const u={name:n?`Lock All Unlocked ${l} on Roof`:`Unlock All Locked ${l} on Roof`,timestamp:Date.now(),oldValues:s,newValue:!0,undo:()=>{for(const[d,f]of u.oldValues.entries())r(d,f)},redo:()=>{i(t.id,e,n)}};H.getState().addUndoable(u)};return h.jsx(rn,{stayAfterClick:!0,update:!0,noPadding:!0,onClick:a,children:o})},kpo=({roof:t})=>{const e=Jt(),n=H.getState().updateRoofStructureById,o=r=>{const i={name:"Select Roof Structure",timestamp:Date.now(),oldValue:t.roofStructure??wc.Default,newValue:r.target.value,changedElementId:t.id,changedElementType:t.type,undo:()=>{n(i.changedElementId,i.oldValue)},redo:()=>{n(i.changedElementId,i.newValue)}};H.getState().addUndoable(i),n(t.id,r.target.value),H.getState().set(a=>{a.actionState.roofStructure=r.target.value})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Ue.Group,{value:t.roofStructure??wc.Default,onChange:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:wc.Default,children:Y.t("roofMenu.DefaultStructure",e)}),h.jsx(Ue,{style:{width:"100%"},value:wc.Rafter,children:Y.t("roofMenu.RafterStructure",e)}),h.jsx(Ue,{style:{width:"100%"},value:wc.Glass,children:Y.t("roofMenu.GlassStructure",e)})]})})})},Vae=[{key:"solarPanelCount",lockedKey:"lockedSolarPanelCount",objectType:z.SolarPanel},{key:"windowCount",lockedKey:"lockedWindowCount",objectType:z.Window},{key:"sensorCount",lockedKey:"lockedSensorCount",objectType:z.Sensor},{key:"outsideLightCount",lockedKey:"lockedLightCount",objectType:z.Light}],Lpo=(t,e)=>{const n={lng:H.getState().language};let o="",r="";switch(t){case z.SolarPanel:{o=`${Y.t("roofMenu.RemoveAllUnlockedSolarPanels",n)} (${e})`,r=`${Y.t("roofMenu.DoYouReallyWantToRemoveAllSolarPanelsOnThisRoof",n)} (${e} ${Y.t("roofMenu.SolarPanels",n)})`;break}case z.Window:{o=`${Y.t("roofMenu.RemoveAllUnlockedWindows",n)} (${e})`,r=`${Y.t("roofMenu.DoYouReallyWantToRemoveAllWindowsOnThisRoof",n)} (${e} ${Y.t("roofMenu.Windows",n)})`;break}case z.Sensor:{o=`${Y.t("roofMenu.RemoveAllUnlockedSensors",n)} (${e})`,r=`${Y.t("roofMenu.DoYouReallyWantToRemoveAllSensorsOnThisRoof",n)} (${e} ${Y.t("roofMenu.Sensors",n)})`;break}case z.Light:{o=`${Y.t("roofMenu.RemoveAllUnlockedLights",n)} (${e})`,r=`${Y.t("roofMenu.DoYouReallyWantToRemoveAllLightsOnThisRoof",n)} (${e} ${Y.t("roofMenu.Lights",n)})`;break}}return{itemLabel:o,modalTitle:r}},Gae=(t,e,n,o)=>n===z.Light?o?t.lockedLightCount:t.insideLightCount+t.outsideLightCount:t[e],Wpo=(t,e,n)=>{const o=[],r={lng:H.getState().language};return Vae.forEach(({key:i,objectType:a})=>{const l=Gae(n,i,a);if(typeof l=="number"&&l>0){const{itemLabel:s,modalTitle:c}=Lpo(a,l),u=a.replaceAll(" ","");o.push({key:`remove-all-${u}s-on-roof`,label:h.jsx(Fpo,{roof:t,objectType:a,modalTitle:c,children:s})})}}),Vae.forEach(({key:i,objectType:a})=>{const l=Gae(n,i,a);if(typeof l=="number"&&l>0){const s=a.replaceAll(" ","");o.push({key:`lock-all-${s}s-on-roof`,label:h.jsxs(zHe,{roof:t,objectType:a,lock:!0,children:[Y.t(`wallMenu.LockAllUnlocked${s}s`,r)," (",l,")"]})})}}),Vae.forEach(({lockedKey:i,objectType:a})=>{const l=Gae(e,i,a,!0);if(typeof l=="number"&&l>0){const s=a.replaceAll(" ","");o.push({key:`unlock-all-${s}s-on-wall`,label:h.jsxs(zHe,{roof:t,objectType:a,lock:!1,children:[Y.t(`wallMenu.UnlockAllLocked${s}s`,r)," (",l,")"]})})}}),e.outsideLightCount>0&&o.push({key:"inside-lights-on-wall",label:h.jsxs(pX,{element:t,inside:!0,children:[Y.t("wallMenu.AllLightsOnWallInside",r)," (",e.outsideLightCount,")"]})}),e.insideLightCount>0&&o.push({key:"outside-lights-on-wall",label:h.jsxs(pX,{element:t,inside:!1,children:[Y.t("wallMenu.AllLightsOnWallOutside",r)," (",e.insideLightCount,")"]})}),o},Npo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(sy),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.thickness)??.4),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)A.id===P&&(A.thickness=v,T.updateElementOnRoofFlag=!0),A.parentId===P&&A.type===z.Window&&(A.ly=v)})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.thickness&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.thickness&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.thickness&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.thickness))return!0;break}return!1}},w=P=>{if(s&&y(P)){switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of e)if(A.type===z.Roof&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)){const x=A;v.set(A.id,x.thickness),f(x.id,P)}const T={name:"Set Thickness for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of e)if(A.type===z.Roof&&!A.locked){const x=A;v.set(A.id,x.thickness),f(x.id,P)}const T={name:"Set Thickness for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of e)if(A.type===z.Roof&&A.foundationId===s.foundationId&&!A.locked){const x=A;v.set(A.id,x.thickness),f(x.id,P)}const T={name:"Set Thickness for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;default:if(s){const T=a(s.id).thickness??s.thickness??.4,A={name:"Set Roof Thickness",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}}l(v=>{v.actionState.roofThickness=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("word.Thickness",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.05,max:1,style:{width:120},step:.01,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>u(P)}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0.05, 1] ",Y.t("word.MeterAbbreviation",d)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",d)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},Upo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(sy),r=H(no),i=H(Zn),a=H(Gn),l=co(z.Roof),[s,c]=m.useState((l==null?void 0:l.rise)??0),u=Jt(),d=(C,P)=>{H.getState().updateRoofRiseById(C,P),H.getState().set(v=>{v.updateElementOnRoofFlag=!0})},f=C=>{for(const[P,v]of C.entries())d(P,v)},p=(C,P)=>{for(const v of C.keys())d(v,P)},g=C=>{if(l){switch(o){case oe.AllSelectedObjectsOfThisType:for(const P of e)if(P.type===z.Roof&&C!==P.rise&&!P.locked&&H.getState().selectedElementIdSet.has(P.id))return!0;break;case oe.AllObjectsOfThisType:for(const P of e)if(P.type===z.Roof&&C!==P.rise&&!P.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const P of e)if(P.type===z.Roof&&P.foundationId===l.foundationId&&C!==P.rise&&!P.locked)return!0;break;default:if(C!==(l==null?void 0:l.rise))return!0;break}return!1}},y=C=>{if(l&&g(C))switch(H.getState().roofActionScope){case oe.AllSelectedObjectsOfThisType:{const P=new Map;for(const T of e)T.type===z.Roof&&!T.locked&&(P.set(T.id,T.rise),d(T.id,C));const v={name:"Set Rise for Selected Roofs",timestamp:Date.now(),oldValues:P,newValue:C,undo:()=>{f(v.oldValues)},redo:()=>{p(v.oldValues,v.newValue)}};n(v),i(r+1);break}case oe.AllObjectsOfThisType:{const P=new Map;for(const T of e)T.type===z.Roof&&!T.locked&&(P.set(T.id,T.rise),d(T.id,C));const v={name:"Set Rise for All Roofs",timestamp:Date.now(),oldValues:P,newValue:C,undo:()=>{f(v.oldValues)},redo:()=>{p(v.oldValues,v.newValue)}};n(v),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(l.foundationId){const P=new Map;for(const T of e)T.type===z.Roof&&T.foundationId===l.foundationId&&!T.locked&&(P.set(T.id,T.rise),d(T.id,C));const v={name:"Set Rise for All Roofs Above Foundation",timestamp:Date.now(),oldValues:P,newValue:C,groupId:l.foundationId,undo:()=>{f(v.oldValues)},redo:()=>{p(v.oldValues,v.newValue)}};n(v),i(r+1)}break;default:if(l){const P=a(l.id),v=(P==null?void 0:P.rise)??(l==null?void 0:l.rise)??0,T={name:"Set Roof Rise",timestamp:Date.now(),oldValue:v,newValue:C,changedElementId:l.id,changedElementType:l.type,undo:()=>{d(T.changedElementId,T.oldValue)},redo:()=>{d(T.changedElementId,T.newValue)}};n(T),d(l.id,C),i(r+1)}}},w=()=>{t(!1)},b=()=>{y(s)};return h.jsx(so,{width:550,title:Y.t("roofMenu.Rise",u),onApply:b,onClose:w,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:200,style:{width:120},step:.1,precision:2,value:s,formatter:C=>Number(C).toFixed(2),onChange:C=>c(C)}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",u),": [0, 200] ",Y.t("word.MeterAbbreviation",u)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",u)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:C=>H.getState().setRoofActionScope(C.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",u)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",u)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",u)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",u)})]})})})]})})},jpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(sy),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.rValue)??r8),[d,f]=m.useState(me.toRValueInUS(c)),p=Jt(),g=(T,A)=>{l(x=>{for(const S of x.elements)if(S.id===T){S.rValue=A;break}})},y=T=>{for(const[A,x]of T.entries())g(A,x)},w=(T,A)=>{for(const x of T.keys())g(x,A)},b=T=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const A of e)if(A.type===z.Roof&&T!==A.rValue&&!A.locked&&H.getState().selectedElementIdSet.has(A.id))return!0;break;case oe.AllObjectsOfThisType:for(const A of e)if(A.type===z.Roof&&T!==A.rValue&&!A.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const A of e)if(A.type===z.Roof&&A.foundationId===s.foundationId&&T!==A.rValue&&!A.locked)return!0;break;default:if(T!==(s==null?void 0:s.rValue))return!0;break}return!1}},C=T=>{if(s&&b(T)){switch(o){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of e)if(S.type===z.Roof&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)){const R=S;A.set(S.id,R.rValue??r8),g(R.id,T)}const x={name:"Set R-Value for Selected Roofs",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of e)if(S.type===z.Roof&&!S.locked){const R=S;A.set(S.id,R.rValue??r8),g(R.id,T)}const x={name:"Set R-Value for All Roofs",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const A=new Map;for(const S of e)if(S.type===z.Roof&&S.foundationId===s.foundationId&&!S.locked){const R=S;A.set(S.id,R.rValue??r8),g(R.id,T)}const x={name:"Set R-Value for All Roofs Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.foundationId,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1)}break;default:if(s){const x=a(s.id).rValue??s.rValue??r8,S={name:"Set Roof R-Value",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:s.id,changedElementType:s.type,undo:()=>{g(S.changedElementId,S.oldValue)},redo:()=>{g(S.changedElementId,S.newValue)}};n(S),g(s.id,T),i(r+1)}}l(A=>{A.actionState.roofRValue=T})}},P=()=>{t(!1)},v=()=>{C(c)};return h.jsx(so,{width:550,title:`${Y.t("roofMenu.RoofRValue",p)+" "}(${Y.t("word.ThermalResistance",p)})`,onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(u(T),f(me.toRValueInUS(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0.01, 100]",h.jsx("br",{}),Y.t("word.SIUnit",p),": m²·℃/W"]}),h.jsx("br",{}),h.jsx(Mn,{min:me.toRValueInUS(.01),max:me.toRValueInUS(100),style:{width:120},step:.01,precision:2,value:d,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(f(T),u(me.toRValueInSI(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [",me.toRValueInUS(.01).toFixed(3),", ",me.toRValueInUS(100).toFixed(1),"]",h.jsx("br",{}),Y.t("word.USUnit",p),": h·ft²·℉/Btu"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:T=>H.getState().setRoofActionScope(T.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",p)})]})})})]})})},Bpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(p3),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.volumetricHeatCapacity)??.5),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)if(A.id===P){A.volumetricHeatCapacity=v;break}})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.volumetricHeatCapacity&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.volumetricHeatCapacity&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.volumetricHeatCapacity&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.volumetricHeatCapacity))return!0;break}return!1}},w=P=>{if(s&&y(P)){switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Roof&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)){const S=x;v.set(x.id,S.volumetricHeatCapacity??.5),S.volumetricHeatCapacity=P}});const T={name:"Set Volumetric Heat Capacity for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Roof&&!x.locked){const S=x;v.set(x.id,S.volumetricHeatCapacity??.5),S.volumetricHeatCapacity=P}});const T={name:"Set Volumetric Heat Capacity for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Roof&&x.foundationId===s.foundationId&&!x.locked){const S=x;v.set(x.id,S.volumetricHeatCapacity??.5),S.volumetricHeatCapacity=P}});const T={name:"Set Volumetric Heat Capacity for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;default:if(s){const T=a(s.id).volumetricHeatCapacity??s.volumetricHeatCapacity??.5,A={name:"Set Volumetric Heat Capacity of Roof",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}}l(v=>{v.actionState.roofVolumetricHeatCapacity=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("word.VolumetricHeatCapacity",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>u(P)}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:["kWh/(m³·℃)",h.jsx("br",{}),h.jsx("br",{}),Y.t("word.Range",d),": [0.01, 100]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},Ypo="/aladdin/assets/roof_edge-DBy_1Q5D.png",Opo="/aladdin/assets/roof_01-BwuyLpwq.png",_po="/aladdin/assets/roof_02-DAbYjnV7.png",Vpo="/aladdin/assets/roof_03-haZGIixv.png",Gpo="/aladdin/assets/roof_04-DDuwUcDr.png",Xpo="/aladdin/assets/roof_05-CtBb5xIW.png",Jpo="/aladdin/assets/roof_06-DuyyebV8.png",Kpo="/aladdin/assets/roof_07-DXWGQN8a.png",qpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(sy),r=H(no),i=H(Zn),a=H(fn),l=H(Gn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.textureType)??Ur.Default),d=Jt(),{Option:f}=_o,p=(v,T)=>{a(A=>{for(const x of A.elements)if(x.id===v){x.locked||(x.textureType=T);break}})},g=(v,T)=>{for(const A of v.keys())p(A,T)},y=v=>{for(const[T,A]of v.entries())p(T,A)},w=v=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const T of e)if(T.type===z.Roof&&v!==T.textureType&&!T.locked&&H.getState().selectedElementIdSet.has(T.id))return!0;break;case oe.AllObjectsOfThisType:for(const T of e)if(T.type===z.Roof&&v!==T.textureType&&!T.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const T of e)if(T.type===z.Roof&&T.foundationId===s.foundationId&&v!==T.textureType&&!T.locked)return!0;break;default:if(v!==(s==null?void 0:s.textureType))return!0;break}return!1}},b=v=>{if(s&&w(v)){switch(o){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of e)x.type===z.Roof&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&T.set(x.id,x.textureType??Ur.Default);const A={name:"Set Texture for Selected Roofs",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{y(A.oldValues)},redo:()=>{g(A.oldValues,A.newValue)}};n(A),g(T,v),i(r+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of e)x.type===z.Roof&&!x.locked&&T.set(x.id,x.textureType??Ur.Default);const A={name:"Set Texture for All Roofs",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{y(A.oldValues)},redo:()=>{g(A.oldValues,A.newValue)}};n(A),g(T,v),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const T=new Map;for(const x of e)x.type===z.Roof&&x.foundationId===s.foundationId&&!x.locked&&T.set(x.id,x.textureType);const A={name:"Set Texture for All Roofs Above Foundation",timestamp:Date.now(),oldValues:T,newValue:v,groupId:s.foundationId,undo:()=>{y(A.oldValues)},redo:()=>{A.groupId&&g(A.oldValues,A.newValue)}};n(A),g(T,v),i(r+1)}break;default:if(s){const T=l(s.id),A=T?T.textureType:s.textureType,x={name:"Set Texture of Selected Roof",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};n(x),p(s.id,v),i(r+1)}}a(T=>{T.actionState.roofTexture=v})}},C=()=>{t(!1)},P=()=>{b(c)};return h.jsx(so,{width:550,title:Y.t("word.Texture",d),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:9,children:h.jsxs(_o,{style:{width:"150px"},value:c,onChange:v=>u(v),children:[h.jsxs(f,{value:Ur.NoTexture,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"32px",height:"20px",border:"1px dashed dimGray"},children:" "}),Y.t("shared.NoTexture",d)]},Ur.NoTexture),h.jsxs(f,{value:Ur.Default,children:[h.jsx("img",{alt:Ur.Default,src:Ypo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.TextureDefault",d)]},Ur.Default),h.jsxs(f,{value:Ur.Texture01,children:[h.jsx("img",{alt:Ur.Texture01,src:Opo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.Texture01",d)]},Ur.Texture01),h.jsxs(f,{value:Ur.Texture02,children:[h.jsx("img",{alt:Ur.Texture02,src:_po,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.Texture02",d)]},Ur.Texture02),h.jsxs(f,{value:Ur.Texture03,children:[h.jsx("img",{alt:Ur.Texture03,src:Vpo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.Texture03",d)]},Ur.Texture03),h.jsxs(f,{value:Ur.Texture04,children:[h.jsx("img",{alt:Ur.Texture04,src:Gpo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.Texture04",d)]},Ur.Texture04),h.jsxs(f,{value:Ur.Texture05,children:[h.jsx("img",{alt:Ur.Texture05,src:Xpo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.Texture05",d)]},Ur.Texture05),h.jsxs(f,{value:Ur.Texture06,children:[h.jsx("img",{alt:Ur.Texture06,src:Jpo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.Texture06",d)]},Ur.Texture06),h.jsxs(f,{value:Ur.Texture07,children:[h.jsx("img",{alt:Ur.Texture07,src:Kpo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.Texture07",d)]},Ur.Texture07)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:15,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setRoofActionScope(v.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},$po=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(sy),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.color)??"#ffffff"),d=Jt(),f=(P,v)=>{e(T=>{for(const A of T.elements)if(A.id===P){A.locked||(A.color=v);break}})},p=(P,v)=>{for(const T of P.keys())f(T,v)},g=P=>{for(const[v,T]of P.entries())f(v,T)},y=P=>{if(s){switch(r){case oe.AllSelectedObjectsOfThisType:for(const v of n)if(v.type===z.Roof&&P!==v.color&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of n)if(v.type===z.Roof&&P!==v.color&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of n)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.color&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.color))return!0;break}return!1}},w=P=>{if(s&&y(P)){switch(r){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of n)A.type===z.Roof&&!A.locked&&v.set(A.id,A.color??"#ffffff");const T={name:"Set Color for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of n)A.type===z.Roof&&!A.locked&&v.set(A.id,A.color??"#ffffff");const T={name:"Set Color for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of n)A.type===z.Roof&&A.foundationId===s.foundationId&&!s.locked&&v.set(A.id,A.color??"#ffffff");const T={name:"Set Color for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{g(T.oldValues)},redo:()=>{T.groupId&&p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1)}break;default:if(s){const v=l(s.id),T=(v?v.color:s.color)??"#ffffff",A={name:"Set Color of Selected Roof",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};o(A),f(s.id,P),a(i+1)}}e(v=>{v.actionState.roofColor=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:640,title:Y.t("roofMenu.RoofColor",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:c,onChangeComplete:P=>{u(P.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},Qpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(fn),o=H(En),r=H(sy),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.sideColor)??"#ffffff"),d=Jt(),f=(P,v)=>{n(T=>{for(const A of T.elements)if(A.id===P){A.locked||(A.sideColor=v);break}})},p=(P,v)=>{for(const T of P.keys())f(T,v)},g=P=>{for(const[v,T]of P.entries())f(v,T)},y=P=>{if(s){switch(r){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.sideColor&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.sideColor&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.sideColor&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.sideColor))return!0;break}return!1}},w=P=>{if(s&&y(P)){switch(r){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of e)A.type===z.Roof&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&v.set(A.id,A.sideColor??"#ffffff");const T={name:"Set Side Color for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of e)A.type===z.Roof&&!A.locked&&v.set(A.id,A.sideColor??"#ffffff");const T={name:"Set Side Color for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of e)A.type===z.Roof&&A.foundationId===s.foundationId&&!s.locked&&v.set(A.id,A.sideColor??"#ffffff");const T={name:"Set Side Color for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{g(T.oldValues)},redo:()=>{T.groupId&&p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1)}break;default:if(s){const v=l(s.id),T=(v?v.sideColor:s.sideColor)??"#ffffff",A={name:"Set Side Color of Selected Roof",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};o(A),f(s.id,P),a(i+1)}}n(v=>{v.actionState.roofSideColor=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:640,title:Y.t("roofMenu.RoofSideColor",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:c??(s==null?void 0:s.sideColor)??"#ffffff",onChangeComplete:P=>{u(P.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},Zpo=({setDialogVisible:t})=>{const e=H(s0),n=H(s3),o=H(En),r=H(sy),i=H(xOe),a=H(no),l=H(Zn),s=H(Vi),c=H(Gn),u=H(fn),d=H(L=>{if(n){for(const k of L.elements)if(k.id===n.id)return k}return null}),[f,p]=m.useState((d==null?void 0:d.ceilingRValue)??y6),[g,y]=m.useState(me.toRValueInUS(f)),[w,b]=m.useState(!1),[C,P]=m.useState({left:0,top:0,bottom:0,right:0}),v=m.useRef(null),T={lng:e};m.useEffect(()=>{d&&p((d==null?void 0:d.ceilingRValue)??y6)},[d==null?void 0:d.ceilingRValue]);const A=(L,k)=>{u(N=>{for(const F of N.elements)if(F.id===L){F.ceilingRValue=k;break}})},x=L=>{for(const[k,N]of L.entries())A(k,N)},S=(L,k)=>{for(const N of L.keys())A(N,k)},R=L=>{if(d){switch(r){case oe.AllObjectsOfThisType:{const k=new Map;u(F=>{for(const U of F.elements)if(U.type===z.Roof&&!U.locked){const O=U;k.set(U.id,O.ceilingRValue??y6),O.ceilingRValue=L}});const N={name:"Set R-Value for All Ceilings",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{x(N.oldValues)},redo:()=>{S(N.oldValues,N.newValue)}};o(N),l(a+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(d.foundationId){const k=new Map;u(F=>{for(const U of F.elements)if(U.type===z.Roof&&U.foundationId===d.foundationId&&!U.locked){const O=U;k.set(U.id,O.ceilingRValue??y6),O.ceilingRValue=L}});const N={name:"Set R-Value for All Ceilings Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:d.foundationId,undo:()=>{x(N.oldValues)},redo:()=>{S(N.oldValues,N.newValue)}};o(N),l(a+1)}break}default:{if(d){const N=c(d.id).ceilingRValue??d.ceilingRValue??y6,F={name:"Set Ceiling R-Value",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:d.id,changedElementType:d.type,undo:()=>{A(F.changedElementId,F.oldValue)},redo:()=>{A(F.changedElementId,F.newValue)}};o(F),A(d.id,L),l(a+1)}break}}u(k=>{k.actionState.roofRValue=L})}},M=(L,k)=>{if(v.current){const{clientWidth:N,clientHeight:F}=window.document.documentElement,U=v.current.getBoundingClientRect();P({left:-U.left+k.x,right:N-(U.right-k.x),top:-U.top+k.y,bottom:F-((U==null?void 0:U.bottom)-k.y)})}},D=()=>{p((d==null?void 0:d.ceilingRValue)??y6),t(!1)},E=()=>{D(),s()},W=()=>{R(f),t(!1),l(0)},j=()=>{R(f)};return h.jsx(h.Fragment,{children:h.jsx(Oi,{width:550,open:!0,title:h.jsxs("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>b(!0),onMouseOut:()=>b(!1),children:[Y.t("roofMenu.CeilingRValue",T)+" ","(",Y.t("word.ThermalResistance",T),")"]}),footer:[h.jsx(lo,{onClick:j,children:Y.t("word.Apply",T)},"Apply"),h.jsx(lo,{onClick:E,children:Y.t("word.Cancel",T)},"Cancel"),h.jsx(lo,{type:"primary",onClick:W,children:Y.t("word.OK",T)},"OK")],onCancel:D,maskClosable:!1,destroyOnClose:!1,modalRender:L=>h.jsx(_i,{disabled:!w,bounds:C,onStart:(k,N)=>M(k,N),children:h.jsx("div",{ref:v,children:L})}),children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:f,formatter:L=>Number(L).toFixed(2),onChange:L=>{L!==null&&(p(L),y(me.toRValueInUS(L)))},onPressEnter:W}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",T),": [0.01, 100]",h.jsx("br",{}),Y.t("word.SIUnit",T),": m²·℃/W"]}),h.jsx("br",{}),h.jsx(Mn,{min:me.toRValueInUS(.01),max:me.toRValueInUS(100),style:{width:120},step:.01,precision:2,value:g,formatter:L=>Number(L).toFixed(2),onChange:L=>{L!==null&&(y(L),p(me.toRValueInSI(L)))},onPressEnter:W}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",T),": [",me.toRValueInUS(.01).toFixed(3),", ",me.toRValueInUS(100).toFixed(1),"]",h.jsx("br",{}),Y.t("word.USUnit",T),": h·ft²·℉/Btu"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:L=>i(L.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisCeiling",T)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllCeilingsAboveFoundation",T)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllCeilings",T)})]})})})]})})})},e1o=t=>{const e={lng:H.getState().language},n=[];return n.push({key:"roof-ceiling",label:h.jsx(Epo,{roof:t})}),t.ceiling&&n.push({type:"divider"},{key:"ceiling-r-value",label:h.jsxs(to,{noPadding:!0,Dialog:Zpo,children:[Y.t("roofMenu.CeilingRValue",e)," ..."]})}),n},t1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(sy),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.rafterColor)??"#ffffff"),d=Jt(),f=(P,v)=>{e(T=>{for(const A of T.elements)if(A.id===P){A.locked||(A.rafterColor=v);break}})},p=(P,v)=>{for(const T of P.keys())f(T,v)},g=P=>{for(const[v,T]of P.entries())f(v,T)},y=P=>{if(s){switch(r){case oe.AllSelectedObjectsOfThisType:for(const v of n)if(v.type===z.Roof&&P!==v.rafterColor&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of n)if(v.type===z.Roof&&P!==v.rafterColor&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of n)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.rafterColor&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.rafterColor))return!0;break}return!1}},w=P=>{if(s&&y(P))switch(r){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of n)A.type===z.Roof&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&v.set(A.id,A.rafterColor??"#ffffff");const T={name:"Set Rafter Color for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of n)A.type===z.Roof&&!A.locked&&v.set(A.id,A.rafterColor??"#ffffff");const T={name:"Set Rafter Color for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of n)A.type===z.Roof&&A.foundationId===s.foundationId&&!s.locked&&v.set(A.id,A.rafterColor??"#ffffff");const T={name:"Set Rafter Color for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{g(T.oldValues)},redo:()=>{T.groupId&&p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1)}break;default:if(s){const v=l(s.id),T=(v?v.rafterColor:s.rafterColor)??"#ffffff",A={name:"Set Rafter Color of Selected Roof",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};o(A),f(s.id,P),a(i+1)}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:640,title:Y.t("roofMenu.RoofColor",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:c,onChangeComplete:P=>{u(P.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},n1o=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(sy),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.rafterSpacing)??1),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)if(A.id===P){A.rafterSpacing=v;break}})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.rafterSpacing&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.rafterSpacing&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.rafterSpacing&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.rafterSpacing))return!0;break}return!1}},w=P=>{if(s&&y(P))switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of e)A.type===z.Roof&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&(v.set(A.id,A.rafterSpacing??1),f(A.id,P));const T={name:"Set Rafter Spacing for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of e)A.type===z.Roof&&!A.locked&&(v.set(A.id,A.rafterSpacing??1),f(A.id,P));const T={name:"Set Rafter Spacing for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of e)A.type===z.Roof&&A.foundationId===s.foundationId&&!A.locked&&(v.set(A.id,A.rafterSpacing??1),f(A.id,P));const T={name:"Set Rafter Spacing for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;default:if(s){const T=a(s.id).rafterSpacing??s.rafterSpacing??1,A={name:"Set Roof Rafter Spacing",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("roofMenu.RafterSpacing",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:100,style:{width:120},step:.1,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>u(P)}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0.1, 100] ",Y.t("word.MeterAbbreviation",d)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",d)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},o1o=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(sy),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.rafterWidth)??.1),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)if(A.id===P){A.rafterWidth=v;break}})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.rafterWidth&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.rafterWidth&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.rafterWidth&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.rafterWidth))return!0;break}return!1}},w=P=>{if(s&&y(P))switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of e)A.type===z.Roof&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&(v.set(A.id,A.rafterWidth??.1),f(A.id,P));const T={name:"Set Rafter Width for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of e)A.type===z.Roof&&!A.locked&&(v.set(A.id,A.rafterWidth??.1),f(A.id,P));const T={name:"Set Rafter Width for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of e)A.type===z.Roof&&A.foundationId===s.foundationId&&!A.locked&&(v.set(A.id,A.rafterWidth??.1),f(A.id,P));const T={name:"Set Rafter Width for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;default:if(s){const T=a(s.id).rafterWidth??s.rafterWidth??.1,A={name:"Set Roof Rafter Width",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("roofMenu.RafterWidth",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.01,max:1,style:{width:120},step:.01,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>u(P)}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0.01, 1] ",Y.t("word.MeterAbbreviation",d)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",d)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},r1o=({setDialogVisible:t})=>{const e=H(fn),n=H(s3),o=H(En),r=H(sy),i=H(xOe),a=H(no),l=H(Zn),s=H(Vi),c=H(Gn),[u,d]=m.useState((n==null?void 0:n.glassTint)??"#73D8FF"),[f,p]=m.useState(!1),[g,y]=m.useState({left:0,top:0,bottom:0,right:0}),w=m.useRef(null),b=m.useRef(null);m.useEffect(()=>{var E;(E=b.current)==null||E.focus()});const C=Jt();m.useEffect(()=>{n&&d((n==null?void 0:n.glassTint)??"#73D8FF")},[n]);const P=(E,W)=>{e(j=>{for(const L of j.elements)if(L.id===E){L.locked||(L.glassTint=W);break}})},v=(E,W)=>{for(const j of E.keys())P(j,W)},T=E=>{for(const[W,j]of E.entries())P(W,j)},A=E=>{if(n)switch(r){case oe.AllObjectsOfThisType:{const W=new Map;for(const L of H.getState().elements)L.type===z.Roof&&!L.locked&&W.set(L.id,L.glassTint??"#73D8FF");const j={name:"Set Glass Tint for All Roofs",timestamp:Date.now(),oldValues:W,newValue:E,undo:()=>{T(j.oldValues)},redo:()=>{v(j.oldValues,j.newValue)}};o(j),v(W,E),l(a+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(n.foundationId){const W=new Map;for(const L of H.getState().elements)L.type===z.Roof&&L.foundationId===n.foundationId&&!n.locked&&W.set(L.id,L.glassTint??"#73D8FF");const j={name:"Set Glass Tint for All Roofs Above Foundation",timestamp:Date.now(),oldValues:W,newValue:E,groupId:n.foundationId,undo:()=>{T(j.oldValues)},redo:()=>{j.groupId&&v(j.oldValues,j.newValue)}};o(j),v(W,E),l(a+1)}break}default:{if(n){const W=c(n.id),j=(W?W.glassTint:n.glassTint)??"#73D8FF",L={name:"Set Glass Tint of Selected Roof",timestamp:Date.now(),oldValue:j,newValue:E,changedElementId:n.id,changedElementType:n.type,undo:()=>{P(L.changedElementId,L.oldValue)},redo:()=>{P(L.changedElementId,L.newValue)}};o(L),P(n.id,E),l(a+1)}break}}},x=(E,W)=>{if(w.current){const{clientWidth:j,clientHeight:L}=window.document.documentElement,k=w.current.getBoundingClientRect();y({left:-k.left+W.x,right:j-(k.right-W.x),top:-k.top+W.y,bottom:L-((k==null?void 0:k.bottom)-W.y)})}},S=()=>{n!=null&&n.glassTint&&d(n.glassTint),t(!1)},R=()=>{S(),s()},M=()=>{const E=c(n.id);E&&E.glassTint!==u&&A(u),t(!1),l(0)},D=()=>{A(u)};return h.jsx(h.Fragment,{children:h.jsx(Oi,{width:640,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>p(!0),onMouseOut:()=>p(!1),children:Y.t("roofMenu.GlassTint",C)}),footer:[h.jsx(lo,{onClick:D,children:Y.t("word.Apply",C)},"Apply"),h.jsx(lo,{onClick:R,children:Y.t("word.Cancel",C)},"Cancel"),h.jsx(lo,{type:"primary",ref:b,onClick:M,children:Y.t("word.OK",C)},"OK")],onCancel:S,maskClosable:!1,destroyOnClose:!1,modalRender:E=>h.jsx(_i,{disabled:!f,bounds:g,onStart:(W,j)=>x(W,j),children:h.jsx("div",{ref:w,children:E})}),children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:u??(n==null?void 0:n.glassTint)??"#73D8FF",onChangeComplete:E=>{d(E.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:E=>i(E.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",C)})]})})})]})})})},i1o=t=>{const e={lng:H.getState().language},n=[];return n.push({key:"roof-structure-radio-group",label:h.jsx(kpo,{roof:t}),style:{backgroundColor:"white"}}),t.roofStructure===wc.Rafter&&n.push({type:"divider"},{key:"roof-rafter-spacing",label:h.jsxs(to,{noPadding:!0,Dialog:n1o,children:[Y.t("roofMenu.RafterSpacing",e)," ..."]})},{key:"roof-rafter-width",label:h.jsxs(to,{noPadding:!0,Dialog:o1o,children:[Y.t("roofMenu.RafterWidth",e)," ..."]})},{key:"roof-rafter-color",label:h.jsxs(to,{noPadding:!0,Dialog:t1o,children:[Y.t("roofMenu.RafterColor",e)," ..."]})}),t.roofStructure===wc.Glass&&n.push({type:"divider"},{key:"roof-glass-tint-selection",label:h.jsxs(to,{noPadding:!0,Dialog:r1o,children:[Y.t("roofMenu.GlassTint",e)," ..."]})}),n},a1o=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(sy),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.opacity)!==void 0?s.opacity:.5),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)if(A.id===P){A.opacity=v;break}})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.opacity&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.opacity&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.opacity&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.opacity))return!0;break}return!1}},w=P=>{if(s&&y(P)){switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of e)if(A.type===z.Roof&&!A.locked){const x=A;v.set(A.id,x.opacity),f(x.id,P)}const T={name:"Set Opacity for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of e)if(A.type===z.Roof&&!A.locked){const x=A;v.set(A.id,x.opacity),f(x.id,P)}const T={name:"Set Opacity for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of e)if(A.type===z.Roof&&A.foundationId===s.foundationId&&!A.locked){const x=A;v.set(A.id,x.opacity),f(x.id,P)}const T={name:"Set Opacity for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;default:if(s){const v=a(s.id),T=v.opacity!==void 0?v.opacity:s.opacity!==void 0?s.opacity:.5,A={name:"Set Roof Opacity",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}}l(v=>{v.actionState.roofGlassOpacity=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("roofMenu.Opacity",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>u(P)}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},l1o=()=>{const t=H.getState().elementsToPaste;if(t&&t.length>0)switch(t[0].type){case z.Window:case z.SolarPanel:case z.Sensor:case z.Light:return!0}return!1},s1o=t=>{const e=[];if(t.type!==z.Roof)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language},i=H.getState().countAllOffspringsByTypeAtOnce,a=i(n.id,!0),l=i(n.id,!1),s=n.roofStructure!==wc.Rafter||n.opacity===void 0||n.opacity>0;return l1o()&&e.push({key:"roof-paste",label:h.jsx(eM,{})}),e.push({key:"roof-lock",label:h.jsx(Ju,{selectedElement:n})}),n.rise>0&&e.push({key:"roof-ceiling-submenu",label:h.jsx(rn,{children:Y.t("roofMenu.Ceiling",r)}),children:e1o(n)}),a.gotSome()&&e.push({key:"lock-unlock-clear-on-roof",label:h.jsx(rn,{children:Y.t("word.Elements",r)}),children:Wpo(n,a,l)}),o&&(n.roofType===Go.Gable&&(e.push({key:"roof-structure-submenu",label:h.jsx(rn,{children:Y.t("roofMenu.RoofStructure",r)}),children:i1o(n)}),(n.roofStructure===wc.Rafter||n.roofStructure===wc.Glass)&&e.push({key:"opacity",label:h.jsxs(to,{Dialog:a1o,children:[Y.t("roofMenu.Opacity",r)," ..."]})})),e.push({key:"roof-thickness",label:h.jsxs(to,{Dialog:Npo,children:[Y.t(n.roofStructure===wc.Rafter?"roofMenu.RafterThickness":"word.Thickness",r)," ","..."]})}),e.push({key:"roof-rise",label:h.jsxs(to,{Dialog:Upo,children:[Y.t("roofMenu.Rise",r)," ..."]})}),s&&(e.push({key:"roof-r-value",label:h.jsxs(to,{Dialog:jpo,children:[Y.t("roofMenu.RoofRValue",r)," ..."]})},{key:"roof-heat-capacity",label:h.jsxs(to,{Dialog:Bpo,children:[Y.t("word.VolumetricHeatCapacity",r)," ..."]})},{key:"roof-texture",label:h.jsxs(to,{Dialog:qpo,children:[Y.t("word.Texture",r)," ..."]})}),(n.textureType===Ur.NoTexture||n.textureType===Ur.Default)&&e.push({key:"roof-color",label:h.jsxs(to,{Dialog:$po,children:[Y.t("roofMenu.RoofColor",r)," ..."]})}),e.push({key:"roof-side-color",label:h.jsxs(to,{Dialog:Qpo,children:[Y.t("roofMenu.RoofSideColor",r)," ..."]})}))),{items:e}},c1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.relativeYawAngle)??0),p=Jt(),g=R=>{a(R.target.value)},y=R=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const M of n)if(M.type===z.WindTurbine&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&Math.abs((M.relativeYawAngle??0)-R)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const M of n)if(M.type===z.WindTurbine&&M.foundationId===(u==null?void 0:u.foundationId)&&!M.locked&&Math.abs((M.relativeYawAngle??0)-R)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const M of n)if(M.type===z.WindTurbine&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&Math.abs((M.relativeYawAngle??0)-R)>It)return!0;break;default:if(Math.abs(((u==null?void 0:u.relativeYawAngle)??0)-R)>It)return!0}return!1}},w=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&E.id===R&&!E.locked){const W=E;W.relativeYawAngle=M;break}})},b=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&E.foundationId===R&&!E.locked){const W=E;W.relativeYawAngle=M}})},C=R=>{e(M=>{for(const D of M.elements)if(D.type===z.WindTurbine&&!D.locked){const E=D;E.relativeYawAngle=R}})},P=(R,M)=>{H.getState().set(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&!E.locked&&R.has(E.id)){const W=E;W.relativeYawAngle=M}})},v=R=>{if(u&&y(R)){switch(i){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E.relativeYawAngle);const D={name:"Set Relative Yaw Angle for Selected Wind Turbines",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{P(D.oldValues,D.newValue)}};r(D),P(M,R),s(l+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.WindTurbine&&M.set(E.id,E.relativeYawAngle);const D={name:"Set Relative Yaw Angle for All Wind Turbines",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{C(D.newValue)}};r(D),C(R),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const M=new Map;for(const E of n)E.type===z.WindTurbine&&E.foundationId===u.foundationId&&M.set(E.id,E.relativeYawAngle);const D={name:"Set Relative Yaw Angle for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:M,newValue:R,groupId:u.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{D.groupId&&b(D.groupId,D.newValue)}};r(D),b(u.foundationId,R),s(l+1)}break}default:{const M=o(u.id),D=M?M.relativeYawAngle:u.relativeYawAngle,E={name:"Set Wind Turbine Relative Yaw Angle",timestamp:Date.now(),oldValue:D,newValue:R,changedElementId:u.id,changedElementType:u.type,undo:()=>{w(E.changedElementId,E.oldValue)},redo:()=>{w(E.changedElementId,E.newValue)}};r(E),w(u.id,R),s(l+1);break}}e(M=>{M.actionState.windTurbineRelativeYawAngle=R})}},T=()=>{t(!1)},A=()=>{T(),c()},x=()=>{v(d),t(!1),s(0)},S=()=>{v(d)};return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.RelativeYawAngle",p),onApply:S,onClose:T,onClickCancel:A,onClickOk:x,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:-180,max:180,style:{width:120},precision:2,step:1,value:parseFloat(me.toDegrees(d).toFixed(2)),formatter:R=>`${R}°`,onChange:R=>{R!==null&&f(me.toRadians(R))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [-180°, 180°]",h.jsx("br",{}),Y.t("message.SouthFacingIsZero",p),h.jsx("br",{}),Y.t("message.CounterclockwiseAzimuthIsPositive",p)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:g,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",p)})]})})})]})})},u1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.numberOfBlades)??3),p=Jt(),{Option:g}=_o,y=M=>{a(M.target.value)},w=M=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const D of n)if(D.type===z.WindTurbine&&!D.locked&&H.getState().selectedElementIdSet.has(D.id)&&Math.abs((D.numberOfBlades??0)-M)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const D of n)if(D.type===z.WindTurbine&&D.foundationId===(u==null?void 0:u.foundationId)&&!D.locked&&Math.abs((D.numberOfBlades??0)-M)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const D of n)if(D.type===z.WindTurbine&&!D.locked&&H.getState().selectedElementIdSet.has(D.id)&&Math.abs((D.numberOfBlades??0)-M)>It)return!0;break;default:if(Math.abs(((u==null?void 0:u.numberOfBlades)??0)-M)>It)return!0}return!1}},b=(M,D)=>{e(E=>{for(const W of E.elements)if(W.type===z.WindTurbine&&W.id===M&&!W.locked){const j=W;j.numberOfBlades=D;break}})},C=(M,D)=>{e(E=>{for(const W of E.elements)if(W.type===z.WindTurbine&&W.foundationId===M&&!W.locked){const j=W;j.numberOfBlades=D}})},P=M=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&!E.locked){const W=E;W.numberOfBlades=M}})},v=(M,D)=>{H.getState().set(E=>{for(const W of E.elements)if(W.type===z.WindTurbine&&!W.locked&&M.has(W.id)){const j=W;j.numberOfBlades=D}})},T=M=>{if(u&&w(M)){switch(i){case oe.AllSelectedObjectsOfThisType:{const D=new Map;for(const W of n)W.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(W.id)&&D.set(W.id,W.numberOfBlades??3);const E={name:"Select Blade Number for Selected Wind Turbines",timestamp:Date.now(),oldValues:D,newValue:M,undo:()=>{for(const[W,j]of E.oldValues.entries())b(W,j)},redo:()=>{v(E.oldValues,E.newValue)}};r(E),v(D,M),s(l+1);break}case oe.AllObjectsOfThisType:{const D=new Map;for(const W of n)W.type===z.WindTurbine&&D.set(W.id,W.numberOfBlades??3);const E={name:"Select Blade Number for All Wind Turbines",timestamp:Date.now(),oldValues:D,newValue:M,undo:()=>{for(const[W,j]of E.oldValues.entries())b(W,j)},redo:()=>{P(E.newValue)}};r(E),P(M),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const D=new Map;for(const W of n)W.type===z.WindTurbine&&W.foundationId===u.foundationId&&D.set(W.id,W.numberOfBlades??3);const E={name:"Select Blade Number for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:D,newValue:M,groupId:u.foundationId,undo:()=>{for(const[W,j]of E.oldValues.entries())b(W,j)},redo:()=>{E.groupId&&C(E.groupId,E.newValue)}};r(E),C(u.foundationId,M),s(l+1)}break}default:{const D=o(u.id),E=D?D.numberOfBlades??3:u.numberOfBlades??3,W={name:"Select Wind Turbine Blade Number",timestamp:Date.now(),oldValue:E,newValue:M,changedElementId:u.id,changedElementType:u.type,undo:()=>{b(W.changedElementId,W.oldValue)},redo:()=>{b(W.changedElementId,W.newValue)}};r(W),b(u.id,M),s(l+1);break}}e(D=>{D.actionState.windTurbineNumberOfBlades=M})}},A=()=>{t(!1)},x=()=>{A(),c()},S=()=>{T(d),t(!1),s(0)},R=()=>{T(d)};return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.BladeNumber",p),onApply:R,onClose:A,onClickCancel:x,onClickOk:S,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:4,children:h.jsxs(_o,{style:{width:"60px"},value:d,onChange:M=>{M!==null&&f(M)},children:[h.jsx(g,{value:1,children:"1"},1),h.jsx(g,{value:2,children:"2"},2),h.jsx(g,{value:3,children:"3"},3),h.jsx(g,{value:4,children:"4"},4),h.jsx(g,{value:8,children:"8"},8)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:20,children:h.jsx(Ue.Group,{onChange:y,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",p)})]})})})]})})},d1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.initialRotorAngle)??0),p=Jt(),g=R=>{a(R.target.value)},y=R=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const M of n)if(M.type===z.WindTurbine&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&Math.abs((M.initialRotorAngle??0)-R)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const M of n)if(M.type===z.WindTurbine&&M.foundationId===(u==null?void 0:u.foundationId)&&!M.locked&&Math.abs((M.initialRotorAngle??0)-R)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const M of n)if(M.type===z.WindTurbine&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&Math.abs((M.initialRotorAngle??0)-R)>It)return!0;break;default:if(Math.abs(((u==null?void 0:u.initialRotorAngle)??0)-R)>It)return!0}return!1}},w=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&E.id===R&&!E.locked){const W=E;W.initialRotorAngle=M;break}})},b=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&E.foundationId===R&&!E.locked){const W=E;W.initialRotorAngle=M}})},C=R=>{e(M=>{for(const D of M.elements)if(D.type===z.WindTurbine&&!D.locked){const E=D;E.initialRotorAngle=R}})},P=(R,M)=>{H.getState().set(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&!E.locked&&R.has(E.id)){const W=E;W.initialRotorAngle=M}})},v=R=>{if(u&&y(R)){switch(i){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E.initialRotorAngle);const D={name:"Set Rotor Initial Angle for Selected Wind Turbines",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{P(D.oldValues,D.newValue)}};r(D),P(M,R),s(l+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.WindTurbine&&M.set(E.id,E.initialRotorAngle);const D={name:"Set Rotor Initial Angle for All Wind Turbines",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{C(D.newValue)}};r(D),C(R),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const M=new Map;for(const E of n)E.type===z.WindTurbine&&E.foundationId===u.foundationId&&M.set(E.id,E.initialRotorAngle);const D={name:"Set Rotor Initial Angle for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:M,newValue:R,groupId:u.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{D.groupId&&b(D.groupId,D.newValue)}};r(D),b(u.foundationId,R),s(l+1)}break}default:{const M=o(u.id),D=M?M.initialRotorAngle:u.initialRotorAngle,E={name:"Set Wind Turbine Rotor Initial Angle",timestamp:Date.now(),oldValue:D,newValue:R,changedElementId:u.id,changedElementType:u.type,undo:()=>{w(E.changedElementId,E.oldValue)},redo:()=>{w(E.changedElementId,E.newValue)}};r(E),w(u.id,R),s(l+1);break}}e(M=>{M.actionState.windTurbineInitialRotorAngle=R})}},T=()=>{t(!1)},A=()=>{T(),c()},x=()=>{v(d),t(!1),s(0)},S=()=>{v(d)};return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.RotorInitialAngle",p),onApply:S,onClose:T,onClickCancel:A,onClickOk:x,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:360,style:{width:120},precision:1,step:1,value:parseFloat(me.toDegrees(d).toFixed(2)),formatter:R=>`${R}°`,onChange:R=>{R!==null&&f(me.toRadians(R))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0°, 360°]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:g,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",p)})]})})})]})})},f1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=me.toRadians(10),d=co(z.WindTurbine),[f,p]=m.useState((d==null?void 0:d.pitchAngle)??u),g=Jt(),y=M=>{a(M.target.value)},w=M=>{if(d){switch(i){case oe.AllObjectsOfThisType:for(const D of n)if(D.type===z.WindTurbine&&!D.locked&&H.getState().selectedElementIdSet.has(D.id)&&Math.abs((D.pitchAngle??u)-M)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const D of n)if(D.type===z.WindTurbine&&D.foundationId===(d==null?void 0:d.foundationId)&&!D.locked&&Math.abs((D.pitchAngle??u)-M)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const D of n)if(D.type===z.WindTurbine&&!D.locked&&H.getState().selectedElementIdSet.has(D.id)&&Math.abs((D.pitchAngle??u)-M)>It)return!0;break;default:if(Math.abs(((d==null?void 0:d.pitchAngle)??u)-M)>It)return!0}return!1}},b=(M,D)=>{e(E=>{for(const W of E.elements)if(W.type===z.WindTurbine&&W.id===M&&!W.locked){const j=W;j.pitchAngle=D;break}})},C=(M,D)=>{e(E=>{for(const W of E.elements)if(W.type===z.WindTurbine&&W.foundationId===M&&!W.locked){const j=W;j.pitchAngle=D}})},P=M=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&!E.locked){const W=E;W.pitchAngle=M}})},v=(M,D)=>{H.getState().set(E=>{for(const W of E.elements)if(W.type===z.WindTurbine&&!W.locked&&M.has(W.id)){const j=W;j.pitchAngle=D}})},T=M=>{if(d&&w(M)){switch(i){case oe.AllSelectedObjectsOfThisType:{const D=new Map;for(const W of n)W.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(W.id)&&D.set(W.id,W.pitchAngle);const E={name:"Set Pitch Angle for Selected Wind Turbines",timestamp:Date.now(),oldValues:D,newValue:M,undo:()=>{for(const[W,j]of E.oldValues.entries())b(W,j)},redo:()=>{v(E.oldValues,E.newValue)}};r(E),v(D,M),s(l+1);break}case oe.AllObjectsOfThisType:{const D=new Map;for(const W of n)W.type===z.WindTurbine&&D.set(W.id,W.pitchAngle);const E={name:"Set Pitch Angle for All Wind Turbines",timestamp:Date.now(),oldValues:D,newValue:M,undo:()=>{for(const[W,j]of E.oldValues.entries())b(W,j)},redo:()=>{P(E.newValue)}};r(E),P(M),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(d.foundationId){const D=new Map;for(const W of n)W.type===z.WindTurbine&&W.foundationId===d.foundationId&&D.set(W.id,W.pitchAngle);const E={name:"Set Pitch Angle for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:D,newValue:M,groupId:d.foundationId,undo:()=>{for(const[W,j]of E.oldValues.entries())b(W,j)},redo:()=>{E.groupId&&C(E.groupId,E.newValue)}};r(E),C(d.foundationId,M),s(l+1)}break}default:{const D=o(d.id),E=D?D.pitchAngle:d.pitchAngle,W={name:"Set Wind Turbine Pitch Angle",timestamp:Date.now(),oldValue:E,newValue:M,changedElementId:d.id,changedElementType:d.type,undo:()=>{b(W.changedElementId,W.oldValue)},redo:()=>{b(W.changedElementId,W.newValue)}};r(W),b(d.id,M),s(l+1);break}}e(D=>{D.actionState.windTurbinePitchAngle=M})}},A=()=>{t(!1)},x=()=>{A(),c()},S=()=>{T(f),t(!1),s(0)},R=()=>{T(f)};return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.RotorBladePitchAngle",g),onApply:R,onClose:A,onClickCancel:x,onClickOk:S,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:-180,max:180,style:{width:120},precision:2,step:1,value:parseFloat(me.toDegrees(f).toFixed(2)),formatter:M=>`${M}°`,onChange:M=>{M!==null&&p(me.toRadians(M))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",g),": [-180°, 180°]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:y,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",g)})]})})})]})})},h1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.bladeRadius)??0),p=m.useRef(!1),g=m.useRef(),y=Jt(),w=E=>{a(E.target.value)},b=E=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const W of n)if(W.type===z.WindTurbine&&!W.locked&&H.getState().selectedElementIdSet.has(W.id)&&Math.abs(W.bladeRadius-E)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const W of n)if(W.type===z.WindTurbine&&W.foundationId===(u==null?void 0:u.foundationId)&&!W.locked&&Math.abs(W.bladeRadius-E)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const W of n)if(W.type===z.WindTurbine&&!W.locked&&H.getState().selectedElementIdSet.has(W.id)&&Math.abs(W.bladeRadius-E)>It)return!0;break;default:if(Math.abs((u==null?void 0:u.bladeRadius)-E)>It)return!0}return!1}},C=(E,W)=>{e(j=>{for(const L of j.elements)if(L.type===z.WindTurbine&&L.id===E&&!L.locked){const k=L;k.bladeRadius=W,k.lx=k.ly=W*2,k.lz=k.towerHeight+W;break}})},P=(E,W)=>{e(j=>{for(const L of j.elements)if(L.type===z.WindTurbine&&L.foundationId===E&&!L.locked){const k=L;k.bladeRadius=W,k.lx=k.ly=W*2,k.lz=k.towerHeight+W}})},v=E=>{e(W=>{for(const j of W.elements)if(j.type===z.WindTurbine&&!j.locked){const L=j;L.bladeRadius=E,L.lx=L.ly=E*2,L.lz=L.towerHeight+E}})},T=(E,W)=>{H.getState().set(j=>{for(const L of j.elements)if(L.type===z.WindTurbine&&!L.locked&&E.has(L.id)){const k=L;k.bladeRadius=W,k.lx=k.ly=W*2,k.lz=k.towerHeight+W}})},A=E=>{if(u&&b(E)){switch(g.current=void 0,i){case oe.AllSelectedObjectsOfThisType:{p.current=!1;for(const W of n)if(W.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(W.id)&&W.towerHeight{for(const[L,k]of j.oldValues.entries())C(L,k)},redo:()=>{T(j.oldValues,j.newValue)}};r(j),T(W,E),s(l+1)}break}case oe.AllObjectsOfThisType:{p.current=!1;for(const W of n)if(W.type===z.WindTurbine&&W.towerHeight{for(const[L,k]of j.oldValues.entries())C(L,k)},redo:()=>{v(j.newValue)}};r(j),v(E),s(l+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){p.current=!1;for(const W of n)if(W.type===z.WindTurbine&&W.foundationId===u.foundationId&&W.towerHeight{for(const[L,k]of j.oldValues.entries())C(L,k)},redo:()=>{j.groupId&&P(j.groupId,j.newValue)}};r(j),P(u.foundationId,E),s(l+1)}}break}default:{const W=o(u.id),j=W?W.bladeRadius:u.bladeRadius;if(p.current=u.towerHeight{C(L.changedElementId,L.oldValue)},redo:()=>{C(L.changedElementId,L.newValue)}};r(L),C(u.id,E),s(l+1)}break}}e(W=>{W.actionState.windTurbineBladeRadius=E})}},x=()=>{p.current=!1,t(!1)},S=()=>{x(),c()},R=()=>{A(d),p.current||(t(!1),s(0))},M=()=>{A(d)},D=p.current?": "+Y.t("message.NotApplicableToSelectedAction",y)+(g.current!==void 0?" ("+g.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.RotorBladeRadius",y),rejectedMessage:D,onApply:M,onClose:x,onClickCancel:S,onClickOk:R,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:100,style:{width:120},step:.1,precision:1,value:d,onChange:E=>{E!==null&&f(E)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [1, 100] ",Y.t("word.MeterAbbreviation",y)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",y)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",y)})]})})})]})})},p1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.bladeRootRadius)??.3),[p,g]=m.useState((u==null?void 0:u.maximumChordLength)??1),[y,w]=m.useState((u==null?void 0:u.maximumChordRadius)??3),b=m.useRef(null),C=Jt(),P=555;m.useEffect(()=>{if(!b.current||!u)return;const q=b.current.getContext("2d");if(!q)return;const te=b.current.width,re=b.current.height,ae=20,se=re*.7;q.clearRect(0,0,te,re),q.setLineDash([]),q.strokeStyle="gray",q.lineWidth=1,q.rect(0,0,te,re),q.stroke();const ne=(te-ae*2)/u.bladeRadius,fe=ne*u.bladeTipWidth,ge=ne*y,de=ne*p,Z=ne*u.bladeRadius,he=ne*d,xe=de-he,He=Z-ge/3,Se=[];Se.push(new Xt(ae,se-he)),Se.push(new Xt(ae+Z-He,se-xe/2)),Se.push(new Xt(ae+ge,se-xe)),Se.push(new Xt(ae+Z,se+he-fe));const Ie=new Aq(Se).getPoints(50);q.beginPath(),q.moveTo(Ie[0].x,Ie[0].y);for(let ye=1;ye{a(q.target.value)},T=q=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const te of n)if(te.type===z.WindTurbine&&!te.locked&&H.getState().selectedElementIdSet.has(te.id)&&Math.abs(te.bladeRootRadius-q)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const te of n)if(te.type===z.WindTurbine&&te.foundationId===(u==null?void 0:u.foundationId)&&!te.locked&&Math.abs(te.bladeRootRadius-q)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const te of n)if(te.type===z.WindTurbine&&!te.locked&&H.getState().selectedElementIdSet.has(te.id)&&Math.abs(te.bladeRootRadius-q)>It)return!0;break;default:if(Math.abs(((u==null?void 0:u.bladeRootRadius)??.3)-q)>It)return!0}return!1}},A=(q,te)=>{e(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&ae.id===q&&!ae.locked){const se=ae;se.bladeRootRadius=te;break}})},x=(q,te)=>{e(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&ae.foundationId===q&&!ae.locked){const se=ae;se.bladeRootRadius=te}})},S=q=>{e(te=>{for(const re of te.elements)if(re.type===z.WindTurbine&&!re.locked){const ae=re;ae.bladeRootRadius=q}})},R=(q,te)=>{H.getState().set(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&!ae.locked&&q.has(ae.id)){const se=ae;se.bladeRootRadius=te}})},M=q=>{if(u&&T(q)){switch(i){case oe.AllSelectedObjectsOfThisType:{const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(ae.id)&&te.set(ae.id,ae.bladeRootRadius);const re={name:"Set Root Radius for Selected Wind Turbines",timestamp:Date.now(),oldValues:te,newValue:q,undo:()=>{for(const[ae,se]of re.oldValues.entries())A(ae,se)},redo:()=>{R(re.oldValues,re.newValue)}};r(re),R(te,q),s(l+1);break}case oe.AllObjectsOfThisType:{const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&te.set(ae.id,ae.bladeRootRadius);const re={name:"Set Root Radius for All Wind Turbines",timestamp:Date.now(),oldValues:te,newValue:q,undo:()=>{for(const[ae,se]of re.oldValues.entries())A(ae,se)},redo:()=>{S(re.newValue)}};r(re),S(q),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&ae.foundationId===u.foundationId&&te.set(ae.id,ae.bladeRootRadius);const re={name:"Set Root Radius for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:te,newValue:q,groupId:u.foundationId,undo:()=>{for(const[ae,se]of re.oldValues.entries())A(ae,se)},redo:()=>{re.groupId&&x(re.groupId,re.newValue)}};r(re),x(u.foundationId,q),s(l+1)}break}default:{const te=o(u.id),re=te?te.bladeRootRadius:u.bladeRootRadius,ae={name:"Set Wind Turbine Root Radius",timestamp:Date.now(),oldValue:re,newValue:q,changedElementId:u.id,changedElementType:u.type,undo:()=>{A(ae.changedElementId,ae.oldValue)},redo:()=>{A(ae.changedElementId,ae.newValue)}};r(ae),A(u.id,q),s(l+1);break}}e(te=>{te.actionState.windTurbineBladeRootRadius=q})}},D=q=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const te of n)if(te.type===z.WindTurbine&&!te.locked&&H.getState().selectedElementIdSet.has(te.id)&&Math.abs(te.maximumChordLength-q)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const te of n)if(te.type===z.WindTurbine&&te.foundationId===(u==null?void 0:u.foundationId)&&!te.locked&&Math.abs(te.maximumChordLength-q)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const te of n)if(te.type===z.WindTurbine&&!te.locked&&H.getState().selectedElementIdSet.has(te.id)&&Math.abs(te.maximumChordLength-q)>It)return!0;break;default:if(Math.abs((u==null?void 0:u.maximumChordLength)-q)>It)return!0}return!1}},E=(q,te)=>{e(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&ae.id===q&&!ae.locked){const se=ae;se.maximumChordLength=te;break}})},W=(q,te)=>{e(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&ae.foundationId===q&&!ae.locked){const se=ae;se.maximumChordLength=te}})},j=q=>{e(te=>{for(const re of te.elements)if(re.type===z.WindTurbine&&!re.locked){const ae=re;ae.maximumChordLength=q}})},L=(q,te)=>{H.getState().set(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&!ae.locked&&q.has(ae.id)){const se=ae;se.maximumChordLength=te}})},k=q=>{if(u&&D(q)){switch(i){case oe.AllSelectedObjectsOfThisType:{const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(ae.id)&&te.set(ae.id,ae.maximumChordLength);const re={name:"Set Chord Length for Selected Wind Turbines",timestamp:Date.now(),oldValues:te,newValue:q,undo:()=>{for(const[ae,se]of re.oldValues.entries())E(ae,se)},redo:()=>{L(re.oldValues,re.newValue)}};r(re),L(te,q),s(l+1);break}case oe.AllObjectsOfThisType:{const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&te.set(ae.id,ae.maximumChordLength);const re={name:"Set Chord Length for All Wind Turbines",timestamp:Date.now(),oldValues:te,newValue:q,undo:()=>{for(const[ae,se]of re.oldValues.entries())E(ae,se)},redo:()=>{j(re.newValue)}};r(re),j(q),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&ae.foundationId===u.foundationId&&te.set(ae.id,ae.maximumChordLength);const re={name:"Set Chord Length for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:te,newValue:q,groupId:u.foundationId,undo:()=>{for(const[ae,se]of re.oldValues.entries())E(ae,se)},redo:()=>{re.groupId&&W(re.groupId,re.newValue)}};r(re),W(u.foundationId,q),s(l+1)}break}default:{const te=o(u.id),re=te?te.maximumChordLength:u.maximumChordLength,ae={name:"Set Wind Turbine Chord Length",timestamp:Date.now(),oldValue:re,newValue:q,changedElementId:u.id,changedElementType:u.type,undo:()=>{E(ae.changedElementId,ae.oldValue)},redo:()=>{E(ae.changedElementId,ae.newValue)}};r(ae),E(u.id,q),s(l+1);break}}e(te=>{te.actionState.windTurbineBladeMaximumChordLength=q})}},N=q=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const te of n)if(te.type===z.WindTurbine&&!te.locked&&H.getState().selectedElementIdSet.has(te.id)&&Math.abs(te.maximumChordRadius-q)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const te of n)if(te.type===z.WindTurbine&&te.foundationId===(u==null?void 0:u.foundationId)&&!te.locked&&Math.abs(te.maximumChordRadius-q)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const te of n)if(te.type===z.WindTurbine&&!te.locked&&H.getState().selectedElementIdSet.has(te.id)&&Math.abs(te.maximumChordRadius-q)>It)return!0;break;default:if(Math.abs((u==null?void 0:u.maximumChordRadius)-q)>It)return!0}return!1}},F=(q,te)=>{e(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&ae.id===q&&!ae.locked){const se=ae;se.maximumChordRadius=te;break}})},U=(q,te)=>{e(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&ae.foundationId===q&&!ae.locked){const se=ae;se.maximumChordRadius=te}})},O=q=>{e(te=>{for(const re of te.elements)if(re.type===z.WindTurbine&&!re.locked){const ae=re;ae.maximumChordRadius=q}})},B=(q,te)=>{H.getState().set(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&!ae.locked&&q.has(ae.id)){const se=ae;se.maximumChordRadius=te}})},_=q=>{if(u&&N(q)){switch(i){case oe.AllSelectedObjectsOfThisType:{const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(ae.id)&&te.set(ae.id,ae.maximumChordRadius);const re={name:"Set Chord Radius for Selected Wind Turbines",timestamp:Date.now(),oldValues:te,newValue:q,undo:()=>{for(const[ae,se]of re.oldValues.entries())F(ae,se)},redo:()=>{B(re.oldValues,re.newValue)}};r(re),B(te,q),s(l+1);break}case oe.AllObjectsOfThisType:{const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&te.set(ae.id,ae.maximumChordRadius);const re={name:"Set Chord Radius for All Wind Turbines",timestamp:Date.now(),oldValues:te,newValue:q,undo:()=>{for(const[ae,se]of re.oldValues.entries())F(ae,se)},redo:()=>{O(re.newValue)}};r(re),O(q),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&ae.foundationId===u.foundationId&&te.set(ae.id,ae.maximumChordRadius);const re={name:"Set Chord Radius for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:te,newValue:q,groupId:u.foundationId,undo:()=>{for(const[ae,se]of re.oldValues.entries())F(ae,se)},redo:()=>{re.groupId&&U(re.groupId,re.newValue)}};r(re),U(u.foundationId,q),s(l+1)}break}default:{const te=o(u.id),re=te?te.maximumChordRadius:u.maximumChordRadius,ae={name:"Set Wind Turbine Chord Radius",timestamp:Date.now(),oldValue:re,newValue:q,changedElementId:u.id,changedElementType:u.type,undo:()=>{F(ae.changedElementId,ae.oldValue)},redo:()=>{F(ae.changedElementId,ae.newValue)}};r(ae),F(u.id,q),s(l+1);break}}e(te=>{te.actionState.windTurbineBladeMaximumChordRadius=q})}},X=()=>{t(!1)},$=()=>{X(),c()},Q=()=>{k(p),_(y),M(d),t(!1),s(0)},le=()=>{k(p),_(y),M(d)};return h.jsxs(so,{width:600,title:Y.t("windTurbineMenu.RotorBladeDesign",C),onApply:le,onClose:X,onClickCancel:$,onClickOk:Q,children:[h.jsx(on,{children:h.jsx(nt,{span:24,children:h.jsx("canvas",{ref:b,id:"blade-design-canvas",width:P,height:P*.25,style:{paddingBottom:"12px"}})})}),h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"8px"},children:[h.jsx(nt,{style:{textAlign:"center",fontStyle:"italic"},children:"A: "}),h.jsx(nt,{children:h.jsx(Mn,{min:.1,max:1,style:{width:"70px"},step:.01,precision:2,value:d,onChange:q=>{q&&f(q)}})}),h.jsxs(nt,{style:{paddingTop:"5px",textAlign:"left",fontSize:"11px"},children:["[0.1, 1] ",Y.t("word.MeterAbbreviation",C)]})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"8px"},children:[h.jsx(nt,{style:{textAlign:"center",fontStyle:"italic"},children:"C: "}),h.jsx(nt,{children:h.jsx(Mn,{min:.5,max:2,style:{width:"70px"},step:.01,precision:2,value:p,onChange:q=>{q&&g(q)}})}),h.jsxs(nt,{style:{paddingTop:"5px",textAlign:"left",fontSize:"11px"},children:["[0.5, 2] ",Y.t("word.MeterAbbreviation",C)]})]}),h.jsxs(on,{gutter:6,children:[h.jsx(nt,{style:{textAlign:"center",fontStyle:"italic"},children:"D:"}),h.jsx(nt,{children:h.jsx(Mn,{min:2,max:((u==null?void 0:u.bladeRadius)??10)/2,style:{width:70},step:.01,precision:2,value:y,onChange:q=>{q&&w(q)}})}),h.jsxs(nt,{style:{paddingTop:"5px",textAlign:"left",fontSize:"11px"},children:["[2, ",((u==null?void 0:u.bladeRadius)??10)/2,"] ",Y.t("word.MeterAbbreviation",C)]})]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",C)})]})})})]})]})},g1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.hubRadius)??0),[p,g]=m.useState((u==null?void 0:u.hubLength)??0),y=Jt(),w=D=>{a(D.target.value)},b=(D,E)=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const W of n)if(W.type===z.WindTurbine&&!W.locked&&H.getState().selectedElementIdSet.has(W.id)){const j=W;if(Math.abs(j.hubRadius-D)>It||Math.abs(j.hubLength-E)>It)return!0}break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const W of n)if(W.type===z.WindTurbine&&W.foundationId===(u==null?void 0:u.foundationId)&&!W.locked){const j=W;if(Math.abs(j.hubRadius-D)>It||Math.abs(j.hubLength-E)>It)return!0}break;case oe.AllSelectedObjectsOfThisType:for(const W of n)if(W.type===z.WindTurbine&&!W.locked&&H.getState().selectedElementIdSet.has(W.id)){const j=W;if(Math.abs(j.hubRadius-D)>It||Math.abs(j.hubLength-E)>It)return!0}break;default:if(Math.abs((u==null?void 0:u.hubRadius)-D)>It||Math.abs((u==null?void 0:u.hubLength)-E)>It)return!0}return!1}},C=(D,E)=>{e(W=>{for(const j of W.elements)if(j.type===z.WindTurbine&&j.id===D&&!j.locked){const L=j;L.hubRadius=E[0],L.hubLength=E[1];break}})},P=(D,E)=>{e(W=>{for(const j of W.elements)if(j.type===z.WindTurbine&&j.foundationId===D&&!j.locked){const L=j;L.hubRadius=E[0],L.hubLength=E[1]}})},v=D=>{e(E=>{for(const W of E.elements)if(W.type===z.WindTurbine&&!W.locked){const j=W;j.hubRadius=D[0],j.hubLength=D[1]}})},T=(D,E)=>{H.getState().set(W=>{for(const j of W.elements)if(j.type===z.WindTurbine&&!j.locked&&D.has(j.id)){const L=j;L.hubRadius=E[0],L.hubLength=E[1]}})},A=D=>{if(u&&b(D[0],D[1])){switch(i){case oe.AllSelectedObjectsOfThisType:{const E=new Map;for(const j of n)if(j.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(j.id)){const L=j;E.set(j.id,[L.hubRadius,L.hubLength])}const W={name:"Set Hub Parameters for Selected Wind Turbines",timestamp:Date.now(),oldValues:E,newValue:D,undo:()=>{for(const[j,L]of W.oldValues.entries())C(j,L)},redo:()=>{T(W.oldValues,W.newValue)}};r(W),T(E,D),s(l+1);break}case oe.AllObjectsOfThisType:{const E=new Map;for(const j of n)if(j.type===z.WindTurbine){const L=j;E.set(j.id,[L.hubRadius,L.hubLength])}const W={name:"Set Hub Parameters for All Wind Turbines",timestamp:Date.now(),oldValues:E,newValue:D,undo:()=>{for(const[j,L]of W.oldValues.entries())C(j,L)},redo:()=>{v(W.newValue)}};r(W),v(D),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const E=new Map;for(const j of n)if(j.type===z.WindTurbine&&j.foundationId===u.foundationId){const L=j;E.set(j.id,[L.hubRadius,L.hubLength])}const W={name:"Set Hub Parameters for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:E,newValue:D,groupId:u.foundationId,undo:()=>{for(const[j,L]of W.oldValues.entries())C(j,L)},redo:()=>{W.groupId&&P(W.groupId,W.newValue)}};r(W),P(u.foundationId,D),s(l+1)}break}default:{const E=o(u.id),W=E?E.hubRadius:u.hubRadius,j=E?E.hubLength:u.hubLength,L={name:"Set Wind Turbine Hub Parameters",timestamp:Date.now(),oldValue:[W,j],newValue:D,changedElementId:u.id,changedElementType:u.type,undo:()=>{C(L.changedElementId,L.oldValue)},redo:()=>{C(L.changedElementId,L.newValue)}};r(L),C(u.id,D),s(l+1);break}}e(E=>{E.actionState.windTurbineHubRadius=D[0],E.actionState.windTurbineHubLength=D[1]})}},x=()=>{t(!1)},S=()=>{x(),c()},R=()=>{A([d,p]),t(!1),s(0)},M=()=>{A([d,p])};return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.HubDesign",y),onApply:M,onClose:x,onClickCancel:S,onClickOk:R,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx("div",{style:{marginTop:"-20px",textAlign:"left",fontSize:"12px"},children:Y.t("windTurbineMenu.HubRadius",y)}),h.jsx(Mn,{min:.5,max:5,style:{width:120},step:.01,precision:2,value:d,onChange:D=>{D!==null&&f(D)}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0.5, 5] ",Y.t("word.MeterAbbreviation",y)]}),h.jsx("div",{style:{paddingTop:"10px",textAlign:"left",fontSize:"12px"},children:Y.t("windTurbineMenu.HubLength",y)}),h.jsx(Mn,{min:1,max:10,style:{width:120},step:.01,precision:2,value:p,onChange:D=>{D!==null&&g(D)}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [1, 10] ",Y.t("word.MeterAbbreviation",y)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",y)})]})})})]})})},m1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.birdSafe)??uc.None),[p,g]=m.useState((u==null?void 0:u.bladeColor)??t9),[y,w]=m.useState((u==null?void 0:u.stripeColor)??n9),b=Jt(),{Option:C}=_o,P=j=>{a(j.target.value)},v=(j,L,k)=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const N of n)if(N.type===z.WindTurbine&&!N.locked&&H.getState().selectedElementIdSet.has(N.id)){const F=N;if((F.birdSafe??uc.None)!==j||(F.bladeColor??t9)!==L||(F.stripeColor??n9)!==k)return!0}break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const N of n)if(N.type===z.WindTurbine&&N.foundationId===(u==null?void 0:u.foundationId)&&!N.locked){const F=N;if((F.birdSafe??uc.None)!==j||(F.bladeColor??t9)!==L||(F.stripeColor??n9)!==k)return!0}break;case oe.AllSelectedObjectsOfThisType:for(const N of n)if(N.type===z.WindTurbine&&!N.locked&&H.getState().selectedElementIdSet.has(N.id)){const F=N;if((F.birdSafe??uc.None)!==j||(F.bladeColor??t9)!==L||(F.stripeColor??n9)!==k)return!0}break;default:if((u.birdSafe??uc.None)!==j||(u.bladeColor??t9)!==L||(u.stripeColor??n9)!==k)return!0}return!1}},T=(j,L,k,N)=>{e(F=>{for(const U of F.elements)if(U.type===z.WindTurbine&&U.id===j&&!U.locked){const O=U;O.birdSafe=L,O.bladeColor=k,O.stripeColor=N;break}})},A=(j,L,k,N)=>{e(F=>{for(const U of F.elements)if(U.type===z.WindTurbine&&U.foundationId===j&&!U.locked){const O=U;O.birdSafe=L,O.bladeColor=k,O.stripeColor=N}})},x=(j,L,k)=>{e(N=>{for(const F of N.elements)if(F.type===z.WindTurbine&&!F.locked){const U=F;U.birdSafe=j,U.bladeColor=L,U.stripeColor=k}})},S=(j,L,k,N)=>{H.getState().set(F=>{for(const U of F.elements)if(U.type===z.WindTurbine&&!U.locked&&j.has(U.id)){const O=U;O.birdSafe=L,O.bladeColor=k,O.stripeColor=N}})},R=(j,L,k)=>{if(u&&v(j,L,k)){switch(i){case oe.AllSelectedObjectsOfThisType:{const N=new Map;for(const U of n)if(U.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(U.id)){const O=U;N.set(U.id,[(O.birdSafe??uc.None).toString(),O.bladeColor,O.stripeColor])}const F={name:"Select Bird-Safe Design for Selected Wind Turbines",timestamp:Date.now(),oldValues:N,newValue:[j.toString(),L,k],undo:()=>{for(const[U,O]of F.oldValues.entries()){const B=O;T(U,Number(B[0]),B[1],B[2])}},redo:()=>{const U=F.newValue;S(F.oldValues,Number(U[0]),U[1],U[2])}};r(F),S(N,j,L,k),s(l+1);break}case oe.AllObjectsOfThisType:{const N=new Map;for(const U of n)if(U.type===z.WindTurbine){const O=U;N.set(U.id,[(O.birdSafe??uc.None).toString(),O.bladeColor,O.stripeColor])}const F={name:"Select Bird-Safe Design for All Wind Turbines",timestamp:Date.now(),oldValues:N,newValue:[j.toString(),L,k],undo:()=>{for(const[U,O]of F.oldValues.entries()){const B=O;T(U,Number(B[0]),B[1],B[2])}},redo:()=>{const U=F.newValue;x(Number(U[0]),U[1],U[2])}};r(F),x(j,L,k),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const N=new Map;for(const U of n)if(U.type===z.WindTurbine&&U.foundationId===u.foundationId){const O=U;N.set(U.id,[(O.birdSafe??uc.None).toString(),O.bladeColor,O.stripeColor])}const F={name:"Select Bird-Safe Design for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:N,newValue:[j.toString(),L,k],groupId:u.foundationId,undo:()=>{for(const[U,O]of F.oldValues.entries()){const B=O;T(U,Number(B[0]),B[1],B[2])}},redo:()=>{if(F.groupId){const U=F.newValue;A(F.groupId,Number(U[0]),U[1],U[2])}}};r(F),A(u.foundationId,j,L,k),s(l+1)}break}default:{const N=o(u.id),F=N?N.birdSafe??uc.None:u.birdSafe??uc.None,U=N?N.bladeColor??t9:u.bladeColor??t9,O=N?N.stripeColor??n9:u.stripeColor??n9,B=[F.toString(),U,O],_={name:"Select Bird-Safe Design for Wind Turbine",timestamp:Date.now(),oldValue:B,newValue:[j.toString(),L,k],changedElementId:u.id,changedElementType:u.type,undo:()=>{const X=_.oldValue;T(_.changedElementId,Number(X[0]),X[1],X[2])},redo:()=>{T(_.changedElementId,j,L,k)}};r(_),T(u.id,j,L,k),s(l+1);break}}e(N=>{N.actionState.windTurbineBirdSafeDesign=j,N.actionState.windTurbineBladeColor=L,N.actionState.windTurbineStripeColor=k})}},M=()=>{t(!1)},D=()=>{M(),c()},E=()=>{R(d,p,y),t(!1),s(0)},W=()=>{R(d,p,y)};return h.jsx(so,{width:600,title:Y.t("windTurbineMenu.BirdSafeDesign",b),onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsxs("span",{children:[Y.t("word.Pattern",b),": "]}),h.jsxs(_o,{style:{width:"116px"},value:d,onChange:j=>{j!==null&&f(j)},children:[h.jsx(C,{value:uc.None,children:Y.t("windTurbineMenu.BirdSafeNone",b)},uc.None),h.jsx(C,{value:uc.Bicolor,children:Y.t("windTurbineMenu.BirdSafeBicolor",b)},uc.Bicolor),h.jsx(C,{value:uc.Striped,children:Y.t("windTurbineMenu.BirdSafeStriped",b)},uc.Striped)]}),h.jsxs("div",{style:{marginTop:"10px"},children:[h.jsxs("span",{children:[Y.t("word.Color",b)," 1: "]}),h.jsx("input",{type:"color",value:p,onChange:j=>{g(j.target.value)}})]}),h.jsxs("div",{style:{marginTop:"10px"},children:[h.jsxs("span",{children:[Y.t("word.Color",b)," 2: "]}),h.jsx("input",{type:"color",value:y,onChange:j=>{w(j.target.value)}})]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:P,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",b)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",b)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",b)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",b)})]})})})]})})},y1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.towerHeight)??0),p=m.useRef(!1),g=m.useRef(),y=Jt(),w=E=>{a(E.target.value)},b=E=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const W of n)if(W.type===z.WindTurbine&&!W.locked&&H.getState().selectedElementIdSet.has(W.id)&&Math.abs(W.towerHeight-E)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const W of n)if(W.type===z.WindTurbine&&W.foundationId===(u==null?void 0:u.foundationId)&&!W.locked&&Math.abs(W.towerHeight-E)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const W of n)if(W.type===z.WindTurbine&&!W.locked&&H.getState().selectedElementIdSet.has(W.id)&&Math.abs(W.towerHeight-E)>It)return!0;break;default:if(Math.abs((u==null?void 0:u.towerHeight)-E)>It)return!0}return!1}},C=(E,W)=>{e(j=>{for(const L of j.elements)if(L.type===z.WindTurbine&&L.id===E&&!L.locked){const k=L;k.towerHeight=W,k.lz=W+k.bladeRadius;break}})},P=(E,W)=>{e(j=>{for(const L of j.elements)if(L.type===z.WindTurbine&&L.foundationId===E&&!L.locked){const k=L;k.towerHeight=W,k.lz=W+k.bladeRadius}})},v=E=>{e(W=>{for(const j of W.elements)if(j.type===z.WindTurbine&&!j.locked){const L=j;L.towerHeight=E,L.lz=E+L.bladeRadius}})},T=(E,W)=>{H.getState().set(j=>{for(const L of j.elements)if(L.type===z.WindTurbine&&!L.locked&&E.has(L.id)){const k=L;k.towerHeight=W,k.lz=W+k.bladeRadius}})},A=E=>{if(u&&b(E)){switch(g.current=void 0,i){case oe.AllSelectedObjectsOfThisType:{p.current=!1;for(const W of n)if(W.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(W.id)&&W.bladeRadius>E){p.current=!0;break}if(p.current)g.current=E,f(u.towerHeight);else{const W=new Map;for(const L of n)L.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(L.id)&&W.set(L.id,L.towerHeight);const j={name:"Set Tower Height for Selected Wind Turbines",timestamp:Date.now(),oldValues:W,newValue:E,undo:()=>{for(const[L,k]of j.oldValues.entries())C(L,k)},redo:()=>{T(j.oldValues,j.newValue)}};r(j),T(W,E),s(l+1)}break}case oe.AllObjectsOfThisType:{p.current=!1;for(const W of n)if(W.type===z.WindTurbine&&W.bladeRadius>E){p.current=!0;break}if(p.current)g.current=E,f(u.towerHeight);else{const W=new Map;for(const L of n)L.type===z.WindTurbine&&W.set(L.id,L.towerHeight);const j={name:"Set Tower Height for All Wind Turbines",timestamp:Date.now(),oldValues:W,newValue:E,undo:()=>{for(const[L,k]of j.oldValues.entries())C(L,k)},redo:()=>{v(j.newValue)}};r(j),v(E),s(l+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){p.current=!1;for(const W of n)if(W.type===z.WindTurbine&&W.foundationId===u.foundationId&&W.bladeRadius>E){p.current=!0;break}if(p.current)g.current=E,f(u.towerHeight);else{const W=new Map;for(const L of n)L.type===z.WindTurbine&&L.foundationId===u.foundationId&&W.set(L.id,L.towerHeight);const j={name:"Set Tower Height for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:W,newValue:E,groupId:u.foundationId,undo:()=>{for(const[L,k]of j.oldValues.entries())C(L,k)},redo:()=>{j.groupId&&P(j.groupId,j.newValue)}};r(j),P(u.foundationId,E),s(l+1)}}break}default:{const W=o(u.id),j=W?W.towerHeight:u.towerHeight;if(p.current=u.bladeRadius>E,p.current)g.current=E,f(j);else{const L={name:"Set Wind Turbine Tower Height",timestamp:Date.now(),oldValue:j,newValue:E,changedElementId:u.id,changedElementType:u.type,undo:()=>{C(L.changedElementId,L.oldValue)},redo:()=>{C(L.changedElementId,L.newValue)}};r(L),C(u.id,E),s(l+1)}break}}e(W=>{W.actionState.windTurbineTowerHeight=E})}},x=()=>{p.current=!1,t(!1)},S=()=>{x(),c()},R=()=>{A(d),p.current||(t(!1),s(0))},M=()=>{A(d)},D=p.current?": "+Y.t("message.NotApplicableToSelectedAction",y)+(g.current!==void 0?" ("+g.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.TowerHeight",y),rejectedMessage:D,onApply:M,onClose:x,onClickCancel:S,onClickOk:R,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:100,style:{width:120},step:.1,precision:1,value:d,onChange:E=>{E!==null&&f(E)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [1, 100] ",Y.t("word.MeterAbbreviation",y)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",y)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",y)})]})})})]})})},A1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.towerRadius)??0),p=Jt(),g=R=>{a(R.target.value)},y=R=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const M of n)if(M.type===z.WindTurbine&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&Math.abs(M.towerRadius-R)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const M of n)if(M.type===z.WindTurbine&&M.foundationId===(u==null?void 0:u.foundationId)&&!M.locked&&Math.abs(M.towerRadius-R)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const M of n)if(M.type===z.WindTurbine&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&Math.abs(M.towerRadius-R)>It)return!0;break;default:if(Math.abs((u==null?void 0:u.towerRadius)-R)>It)return!0}return!1}},w=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&E.id===R&&!E.locked){const W=E;W.towerRadius=M;break}})},b=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&E.foundationId===R&&!E.locked){const W=E;W.towerRadius=M}})},C=R=>{e(M=>{for(const D of M.elements)if(D.type===z.WindTurbine&&!D.locked){const E=D;E.towerRadius=R}})},P=(R,M)=>{H.getState().set(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&!E.locked&&R.has(E.id)){const W=E;W.towerRadius=M}})},v=R=>{if(u&&y(R)){switch(i){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E.towerRadius);const D={name:"Set Tower Radius for Selected Wind Turbines",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{P(D.oldValues,D.newValue)}};r(D),P(M,R),s(l+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.WindTurbine&&M.set(E.id,E.towerRadius);const D={name:"Set Tower Radius for All Wind Turbines",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{C(D.newValue)}};r(D),C(R),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const M=new Map;for(const E of n)E.type===z.WindTurbine&&E.foundationId===u.foundationId&&M.set(E.id,E.towerRadius);const D={name:"Set Tower Radius for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:M,newValue:R,groupId:u.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{D.groupId&&b(D.groupId,D.newValue)}};r(D),b(u.foundationId,R),s(l+1)}break}default:{const M=o(u.id),D=M?M.towerRadius:u.towerRadius,E={name:"Set Wind Turbine Tower Radius",timestamp:Date.now(),oldValue:D,newValue:R,changedElementId:u.id,changedElementType:u.type,undo:()=>{w(E.changedElementId,E.oldValue)},redo:()=>{w(E.changedElementId,E.newValue)}};r(E),w(u.id,R),s(l+1);break}}e(M=>{M.actionState.windTurbineTowerRadius=R})}},T=()=>{t(!1)},A=()=>{T(),c()},x=()=>{v(d),t(!1),s(0)},S=()=>{v(d)};return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.TowerRadius",p),onApply:S,onClose:T,onClickCancel:A,onClickOk:x,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:2,style:{width:120},step:.01,precision:2,value:d,onChange:R=>{R!==null&&f(R)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0.1, 2] ",Y.t("word.MeterAbbreviation",p)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",p)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:g,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",p)})]})})})]})})},w1o=t=>{const e=[];if(t.type!==z.WindTurbine)return{items:e};const n=t,o={lng:H.getState().language},r=!n.locked;return e.push({key:"wind-turbine-copy",label:h.jsx(Ld,{})}),r&&e.push({key:"wind-turbine-cut",label:h.jsx(Wd,{})}),e.push({key:"wind-turbine-lock",label:h.jsx(Ju,{selectedElement:n})}),r&&e.push({key:"wind-turbine-relative-yaw-angle",label:h.jsxs(to,{Dialog:c1o,children:[Y.t("windTurbineMenu.RelativeYawAngle",o)," ..."]})},{key:"wind-turbine-rotor-submenu",label:h.jsx(rn,{children:Y.t("windTurbineMenu.Rotor",o)}),children:[{key:"wind-turbine-rotor-blade-number",label:h.jsxs(to,{noPadding:!0,Dialog:u1o,children:[Y.t("windTurbineMenu.BladeNumber",o)," ..."]})},{key:"wind-turbine-rotor-initial-angle",label:h.jsxs(to,{noPadding:!0,Dialog:d1o,children:[Y.t("windTurbineMenu.RotorInitialAngle",o)," ..."]})},{key:"wind-turbine-rotor-blade-pitch-angle",label:h.jsxs(to,{noPadding:!0,Dialog:f1o,children:[Y.t("windTurbineMenu.RotorBladePitchAngle",o)," ..."]})},{key:"wind-turbine-rotor-blade-radius",label:h.jsxs(to,{noPadding:!0,Dialog:h1o,children:[Y.t("windTurbineMenu.RotorBladeRadius",o)," ..."]})},{key:"wind-turbine-rotor-blade-design",label:h.jsxs(to,{noPadding:!0,Dialog:p1o,children:[Y.t("windTurbineMenu.RotorBladeDesign",o)," ..."]})},{key:"wind-turbine-hub-design",label:h.jsxs(to,{noPadding:!0,Dialog:g1o,children:[Y.t("windTurbineMenu.HubDesign",o)," ..."]})},{key:"wind-turbine-bird-safe-blade",label:h.jsxs(to,{noPadding:!0,Dialog:m1o,children:[Y.t("windTurbineMenu.BirdSafeDesign",o)," ..."]})}]},{key:"wind-turbine-tower-submenu",label:h.jsx(rn,{children:Y.t("windTurbineMenu.Tower",o)}),children:[{key:"wind-turbine-tower-height",label:h.jsxs(to,{noPadding:!0,Dialog:y1o,children:[Y.t("windTurbineMenu.TowerHeight",o)," ..."]})},{key:"wind-turbine-tower-radius",label:h.jsxs(to,{noPadding:!0,Dialog:A1o,children:[Y.t("windTurbineMenu.TowerRadius",o)," ..."]})}]},{key:"wind-turbine-label",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",o)}),children:PA(n)}),{items:e}},v1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(zd),l=H(Dd),s=H(no),c=H(Zn),u=H(Vi),d=co(z.WaterHeater),[f,p]=m.useState((d==null?void 0:d.lx)??1),g=m.useRef(!1),y=m.useRef(),w=Jt(),b=(k,N)=>{e(F=>{for(const U of F.elements)if(U.type===z.WaterHeater&&U.id===k&&!U.locked){U.lx=N;break}})},C=(k,N)=>{e(F=>{for(const U of F.elements)U.type===z.WaterHeater&&U.foundationId===k&&!U.locked&&(U.lx=N)})},P=(k,N,F)=>{e(U=>{for(const O of U.elements)if(O.type===z.WaterHeater&&!O.locked){let B;N?B=O.parentId===k&&me.isIdentical(O.normal,N):B=O.parentId===k,B&&(O.lx=F)}})},v=k=>{e(N=>{for(const F of N.elements)F.type===z.WaterHeater&&!F.locked&&(F.lx=k)})},T=(k,N)=>{H.getState().set(F=>{for(const U of F.elements)U.type===z.WaterHeater&&!U.locked&&k.has(U.id)&&(U.lx=N)})},A=k=>{l(k.target.value)},x=(k,N)=>{const F=r(k);if(F){if(F.type===z.Cuboid&&!me.isIdentical(k.normal,rs))return!0;const U=JSON.parse(JSON.stringify(k));return U.lx=N,F.type===z.Roof?!0:me.isSolarCollectorWithinHorizontalSurface(U,F)}return!1},S=(k,N)=>!x(k,N),R=k=>{if(d){switch(a){case oe.AllSelectedObjectsOfThisType:{for(const N of n)if(N.type===z.WaterHeater&&!N.locked&&H.getState().selectedElementIdSet.has(N.id)&&Math.abs(N.lx-k)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const N of n)if(N.type===z.WaterHeater&&!N.locked&&Math.abs(N.lx-k)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const N of n)if(N.type===z.WaterHeater&&N.foundationId===(d==null?void 0:d.foundationId)&&!N.locked&&Math.abs(N.lx-k)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const N=r(d);if(N){if(N.type===z.Cuboid){for(const U of n)if(U.type===z.WaterHeater&&U.parentId===d.parentId&&me.isIdentical(U.normal,d.normal)&&!U.locked&&Math.abs(U.lx-k)>It)return!0}else for(const U of n)if(U.type===z.WaterHeater&&U.parentId===d.parentId&&!U.locked&&Math.abs(U.lx-k)>It)return!0}break}default:{if(Math.abs((d==null?void 0:d.lx)-k)>It)return!0;break}}return!1}},M=k=>{if(d&&R(k))switch(y.current=void 0,a){case oe.AllSelectedObjectsOfThisType:{g.current=!1;for(const N of n)if(N.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(N.id)&&S(N,k)){g.current=!0;break}if(g.current)y.current=k,p(d.lx);else{const N=new Map;for(const U of n)U.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(U.id)&&N.set(U.id,U.lx);const F={name:"Set Length for Selected Water Heater",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())b(U,O)},redo:()=>{T(F.oldValues,F.newValue)}};i(F),T(N,k),c(s+1)}break}case oe.AllObjectsOfThisType:{g.current=!1;for(const N of n)if(N.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(N.id)&&S(N,k)){g.current=!0;break}if(g.current)y.current=k,p(d.lx);else{const N=new Map;for(const U of n)U.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(U.id)&&N.set(U.id,U.lx);const F={name:"Set Length for All Water Heater",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())b(U,O)},redo:()=>{v(F.newValue)}};i(F),v(k),c(s+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(d.foundationId){g.current=!1;for(const N of n)if(N.type===z.WaterHeater&&N.foundationId===d.foundationId&&S(N,k)){g.current=!0;break}if(g.current)y.current=k,p(d.lx);else{const N=new Map;for(const U of n)U.type===z.WaterHeater&&U.foundationId===d.foundationId&&N.set(U.id,U.lx);const F={name:"Set Length for All Water Heater Above Foundation",timestamp:Date.now(),oldValues:N,newValue:k,groupId:d.foundationId,undo:()=>{for(const[U,O]of F.oldValues.entries())b(U,O)},redo:()=>{F.groupId&&C(F.groupId,F.newValue)}};i(F),C(d.foundationId,k),c(s+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const N=r(d);if(N){if(g.current=!1,N.type===z.Cuboid){for(const U of n)if(U.type===z.WaterHeater&&U.parentId===d.parentId&&me.isIdentical(U.normal,d.normal)&&S(U,k)){g.current=!0;break}}else for(const U of n)if(U.type===z.WaterHeater&&U.parentId===d.parentId&&S(U,k)){g.current=!0;break}if(g.current)y.current=k,p(d.lx);else{const U=new Map,O=N.type===z.Cuboid;if(O)for(const X of n)X.type===z.WaterHeater&&X.parentId===d.parentId&&me.isIdentical(X.normal,d.normal)&&U.set(X.id,X.lx);else for(const X of n)X.type===z.WaterHeater&&X.parentId===d.parentId&&U.set(X.id,X.lx);const B=O?d.normal:void 0,_={name:"Set Length for All Water Heater on Surface",timestamp:Date.now(),oldValues:U,newValue:k,groupId:d.parentId,normal:B,undo:()=>{for(const[X,$]of _.oldValues.entries())b(X,$)},redo:()=>{_.groupId&&P(_.groupId,_.normal,_.newValue)}};i(_),P(d.parentId,B,k),c(s+1)}}break}default:{const N=o(d.id),F=N?N.lx:d.lx;if(g.current=S(d,k),g.current)y.current=k,p(F);else{const U={name:"Set Water Heater Length",timestamp:Date.now(),oldValue:F,newValue:k,changedElementId:d.id,changedElementType:d.type,undo:()=>{b(U.changedElementId,U.oldValue)},redo:()=>{b(U.changedElementId,U.newValue)}};i(U),b(d.id,k),c(s+1)}break}}},D=()=>{g.current=!1,t(!1)},E=()=>{D(),u()},W=()=>{M(f),g.current||(t(!1),c(0))},j=()=>{M(f)},L=g.current?": "+Y.t("message.NotApplicableToSelectedAction",w)+(y.current!==void 0?" ("+y.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Length",w),rejectedMessage:L,onApply:j,onClose:D,onClickCancel:E,onClickOk:W,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:6,children:h.jsx(Mn,{min:0,max:100,step:.1,style:{width:120},precision:2,value:f,onChange:k=>{k!==null&&p(k)}})}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",w)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:A,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("waterHeaterMenu.OnlyThisWaterHeater",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("waterHeaterMenu.AllWaterHeatersOnSurface",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("waterHeaterMenu.AllWaterHeatersAboveFoundation",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("waterHeaterMenu.AllSelectedWaterHeaters",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("waterHeaterMenu.AllWaterHeaters",w)})]})})})]})})},x1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(zd),l=H(Dd),s=H(no),c=H(Zn),u=H(Vi),d=co(z.WaterHeater),[f,p]=m.useState(0),[g,y]=m.useState((d==null?void 0:d.ly)??1),w=m.useRef(!1),b=m.useRef(),C=Jt();m.useEffect(()=>{d&&p(Number((d.lz-.3).toFixed(2)))},[d]);const P=(F,U)=>{e(O=>{for(const B of O.elements)if(B.type===z.WaterHeater&&B.id===F&&!B.locked){B.ly=U;break}})},v=(F,U)=>{e(O=>{for(const B of O.elements)B.type===z.WaterHeater&&B.foundationId===F&&!B.locked&&(B.ly=U)})},T=(F,U,O)=>{e(B=>{for(const _ of B.elements)if(_.type===z.WaterHeater&&!_.locked){let X;U?X=_.parentId===F&&me.isIdentical(_.normal,U):X=_.parentId===F,X&&(_.ly=O)}})},A=F=>{e(U=>{for(const O of U.elements)O.type===z.WaterHeater&&!O.locked&&(O.ly=F)})},x=(F,U)=>{H.getState().set(O=>{for(const B of O.elements)B.type===z.WaterHeater&&!B.locked&&F.has(B.id)&&(B.ly=U)})},S=F=>{l(F.target.value)},R=(F,U)=>{const O=r(F);if(O){if(O.type===z.Cuboid&&!me.isIdentical(F.normal,rs))return!0;const B=JSON.parse(JSON.stringify(F));return B.ly=U,O.type===z.Roof?!0:me.isSolarCollectorWithinHorizontalSurface(B,O)}return!1},M=(F,U)=>!R(F,U),D=F=>{if(d){switch(a){case oe.AllSelectedObjectsOfThisType:{for(const U of n)if(U.type===z.WaterHeater&&!U.locked&&H.getState().selectedElementIdSet.has(U.id)&&Math.abs(U.ly-F)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const U of n)if(U.type===z.WaterHeater&&!U.locked&&Math.abs(U.ly-F)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const U of n)if(U.type===z.WaterHeater&&U.foundationId===(d==null?void 0:d.foundationId)&&!U.locked&&Math.abs(U.ly-F)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const U=r(d);if(U){if(U.type===z.Cuboid){for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&me.isIdentical(B.normal,d.normal)&&!B.locked&&Math.abs(B.ly-F)>It)return!0}else for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&!B.locked&&Math.abs(B.ly-F)>It)return!0}break}default:{if(Math.abs((d==null?void 0:d.ly)-F)>It)return!0;break}}return!1}},E=F=>{if(d&&D(F))switch(b.current=void 0,a){case oe.AllSelectedObjectsOfThisType:{w.current=!1;for(const U of n)if(U.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(U.id)&&M(U,F)){w.current=!0;break}if(w.current)b.current=F,y(d.ly);else{const U=new Map;for(const B of n)B.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(B.id)&&U.set(B.id,B.ly);const O={name:"Set Width for Selected Water Heater",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())P(B,_)},redo:()=>{x(O.oldValues,O.newValue)}};i(O),x(U,F),c(s+1)}break}case oe.AllObjectsOfThisType:{w.current=!1;for(const U of n)if(U.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(U.id)&&M(U,F)){w.current=!0;break}if(w.current)b.current=F,y(d.ly);else{const U=new Map;for(const B of n)B.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(B.id)&&U.set(B.id,B.ly);const O={name:"Set Length for All Water Heater",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())P(B,_)},redo:()=>{A(O.newValue)}};i(O),A(F),c(s+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(d.foundationId){w.current=!1;for(const U of n)if(U.type===z.WaterHeater&&U.foundationId===d.foundationId&&M(U,F)){w.current=!0;break}if(w.current)b.current=F,y(d.ly);else{const U=new Map;for(const B of n)B.type===z.WaterHeater&&B.foundationId===d.foundationId&&U.set(B.id,B.ly);const O={name:"Set Width for All Water Heater Above Foundation",timestamp:Date.now(),oldValues:U,newValue:F,groupId:d.foundationId,undo:()=>{for(const[B,_]of O.oldValues.entries())P(B,_)},redo:()=>{O.groupId&&v(O.groupId,O.newValue)}};i(O),v(d.foundationId,F),c(s+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const U=r(d);if(U){if(w.current=!1,U.type===z.Cuboid){for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&me.isIdentical(B.normal,d.normal)&&M(B,F)){w.current=!0;break}}else for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&M(B,F)){w.current=!0;break}if(w.current)b.current=F,y(d.ly);else{const B=new Map,_=U.type===z.Cuboid;if(_)for(const Q of n)Q.type===z.WaterHeater&&Q.parentId===d.parentId&&me.isIdentical(Q.normal,d.normal)&&B.set(Q.id,Q.ly);else for(const Q of n)Q.type===z.WaterHeater&&Q.parentId===d.parentId&&B.set(Q.id,Q.ly);const X=_?d.normal:void 0,$={name:"Set Width for All Water Heater on Surface",timestamp:Date.now(),oldValues:B,newValue:F,groupId:d.parentId,normal:X,undo:()=>{for(const[Q,le]of $.oldValues.entries())P(Q,le)},redo:()=>{$.groupId&&T($.groupId,$.normal,$.newValue)}};i($),T(d.parentId,X,F),c(s+1)}}break}default:{const U=o(d.id),O=U?U.ly:d.ly;if(w.current=M(d,F),w.current)b.current=F,y(O);else{const B={name:"Set Water Heater Width",timestamp:Date.now(),oldValue:O,newValue:F,changedElementId:d.id,changedElementType:d.type,undo:()=>{P(B.changedElementId,B.oldValue)},redo:()=>{P(B.changedElementId,B.newValue)}};i(B),P(d.id,F),c(s+1)}break}}},W=()=>{w.current=!1,t(!1)},j=()=>{W(),u()},L=()=>{E(g),w.current||(t(!1),c(0))},k=()=>{E(g)},N=w.current?": "+Y.t("message.NotApplicableToSelectedAction",C)+(b.current!==void 0?" ("+b.current.toFixed(2)+")":""):null;return console.log("min",f),h.jsx(so,{width:550,title:Y.t("word.Width",C),rejectedMessage:N,onApply:k,onClose:W,onClickCancel:j,onClickOk:L,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:6,children:h.jsx(Mn,{min:f,max:100,step:.1,style:{width:120},precision:2,value:g,onChange:F=>{F!==null&&y(F)}})}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",C)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:S,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("waterHeaterMenu.OnlyThisWaterHeater",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("waterHeaterMenu.AllWaterHeatersOnSurface",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("waterHeaterMenu.AllWaterHeatersAboveFoundation",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("waterHeaterMenu.AllSelectedWaterHeaters",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("waterHeaterMenu.AllWaterHeaters",C)})]})})})]})})},b1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(Xq),i=H(uYe),a=H(dYe),l=H(fYe),s=H(qr),c=H(En),u=H(zd),d=H(Dd),f=H(no),p=H(Zn),g=H(Vi),y=co(z.WaterHeater),w=m.useRef(!1),b=m.useRef(),[C,P]=m.useState(y?-y.relativeAzimuth:0),v=Jt(),T=k=>{d(k.target.value)},A=(k,N)=>{const F=s(k);if(F){if(F.type===z.Cuboid&&!me.isIdentical(k.normal,rs))return!0;const U=JSON.parse(JSON.stringify(k));return U.relativeAzimuth=-N,F.type===z.Roof?!0:me.isSolarCollectorWithinHorizontalSurface(U,F)}return!1},x=(k,N)=>!A(k,N),S=k=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:for(const N of n)if(N.type===z.WaterHeater&&!N.locked&&H.getState().selectedElementIdSet.has(N.id)&&Math.abs(-N.relativeAzimuth-k)>It)return!0;break;case oe.AllObjectsOfThisType:for(const N of n)if(N.type===z.WaterHeater&&!N.locked&&Math.abs(-N.relativeAzimuth-k)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const N of n)if(N.type===z.WaterHeater&&N.foundationId===(y==null?void 0:y.foundationId)&&!N.locked&&Math.abs(-N.relativeAzimuth-k)>It)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:if(y!=null&&y.parentId){const N=s(y);if(N){if(N.type===z.Cuboid){for(const U of n)if(U.type===z.WaterHeater&&U.parentId===y.parentId&&me.isIdentical(U.normal,y.normal)&&!U.locked&&Math.abs(-U.relativeAzimuth-k)>It)return!0}else for(const U of n)if(U.type===z.WaterHeater&&U.parentId===y.parentId&&!U.locked&&Math.abs(-U.relativeAzimuth-k)>It)return!0}}break;default:if(Math.abs(-(y==null?void 0:y.relativeAzimuth)-k)>It)return!0}return!1}},R=(k,N)=>{H.getState().set(F=>{for(const U of F.elements)if(U.type===z.WaterHeater&&!U.locked&&k.has(U.id)){const O=U;O.relativeAzimuth=N}})},M=k=>{if(y&&S(k)){switch(b.current=void 0,u){case oe.AllSelectedObjectsOfThisType:{w.current=!1;for(const N of n)if(N.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(N.id)&&x(N,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const N=new Map;for(const U of n)U.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(U.id)&&N.set(U.id,-U.relativeAzimuth);const F={name:"Set Relative Azimuth for Selected Water Heater",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,-O)},redo:()=>{R(F.oldValues,F.newValue)}};c(F),R(N,-k),p(f+1)}break}case oe.AllObjectsOfThisType:{w.current=!1;for(const N of n)if(N.type===z.WaterHeater&&x(N,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const N=new Map;for(const U of n)U.type===z.WaterHeater&&N.set(U.id,-U.relativeAzimuth);const F={name:"Set Relative Azimuth for All Water Heater",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,-O)},redo:()=>{l(z.WaterHeater,-F.newValue)}};c(F),l(z.WaterHeater,-k),p(f+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(y.foundationId){w.current=!1;for(const N of n)if(N.type===z.WaterHeater&&N.foundationId===y.foundationId&&x(N,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const N=new Map;for(const U of n)U.type===z.WaterHeater&&U.foundationId===y.foundationId&&N.set(U.id,-U.relativeAzimuth);const F={name:"Set Relative Azimuth for All Water Heater Above Foundation",timestamp:Date.now(),oldValues:N,newValue:k,groupId:y.foundationId,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,-O)},redo:()=>{F.groupId&&a(z.WaterHeater,F.groupId,-F.newValue)}};c(F),a(z.WaterHeater,y.foundationId,-k),p(f+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{if(y.parentId){const N=s(y);if(N){if(w.current=!1,N.type===z.Cuboid){for(const U of n)if(U.type===z.WaterHeater&&U.parentId===y.parentId&&me.isIdentical(U.normal,y.normal)&&x(U,k)){w.current=!0;break}}else for(const U of n)if(U.type===z.WaterHeater&&U.parentId===y.parentId&&x(U,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const U=new Map,O=N.type===z.Cuboid;if(O)for(const X of n)X.type===z.WaterHeater&&X.parentId===y.parentId&&me.isIdentical(X.normal,y.normal)&&U.set(X.id,-X.relativeAzimuth);else for(const X of n)X.type===z.WaterHeater&&X.parentId===y.parentId&&U.set(X.id,-X.relativeAzimuth);const B=O?y.normal:void 0,_={name:"Set Relative Azimuth for All Water Heater on Surface",timestamp:Date.now(),oldValues:U,newValue:k,groupId:y.parentId,normal:B,undo:()=>{for(const[X,$]of _.oldValues.entries())r(X,-$)},redo:()=>{_.groupId&&i(z.WaterHeater,_.groupId,_.normal,-_.newValue)}};c(_),i(z.WaterHeater,y.parentId,B,-k),p(f+1)}}}break}default:{const N=o(y.id),F=N?-N.relativeAzimuth:-y.relativeAzimuth;if(w.current=x(y,k),w.current)b.current=k,P(F);else{const U={name:"Set Solar Panel Array Relative Azimuth",timestamp:Date.now(),oldValue:F,newValue:k,changedElementId:y.id,changedElementType:y.type,undo:()=>{r(U.changedElementId,-U.oldValue)},redo:()=>{r(U.changedElementId,-U.newValue)}};c(U),r(y.id,-k),p(f+1)}break}}e(N=>{N.actionState.solarPanelRelativeAzimuth=-k})}},D=()=>{w.current=!1,t(!1)},E=()=>{D(),g()},W=()=>{M(C),w.current||(t(!1),p(0))},j=()=>{M(C)},L=w.current?": "+Y.t("message.NotApplicableToSelectedAction",v)+(b.current!==void 0?" ("+me.toDegrees(b.current).toFixed(1)+"°)":null):null;return h.jsx(so,{width:550,title:Y.t("solarCollectorMenu.RelativeAzimuth",v),rejectedMessage:L,onApply:j,onClose:D,onClickCancel:E,onClickOk:W,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:-180,max:180,style:{width:120},precision:2,step:1,value:parseFloat(me.toDegrees(C).toFixed(2)),formatter:k=>`${k}°`,onChange:k=>{k!==null&&P(me.toRadians(k))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",v),": [-180°, 180°]",h.jsx("br",{}),Y.t("message.AzimuthOfNorthIsZero",v),h.jsx("br",{}),Y.t("message.CounterclockwiseAzimuthIsPositive",v)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:18,children:h.jsx(Ue.Group,{onChange:T,value:u,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",v)})]})})})]})})},S1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(zd),l=H(Dd),s=H(no),c=H(Zn),u=H(Vi),d=co(z.WaterHeater),[f,p]=m.useState((d==null?void 0:d.lz)??1),[g,y]=m.useState(0),w=m.useRef(!1),b=m.useRef(),C=Jt();m.useEffect(()=>{d&&y(d.ly+.3)},[d]);const P=(F,U)=>{e(O=>{for(const B of O.elements)if(B.type===z.WaterHeater&&B.id===F&&!B.locked){B.lz=U;break}})},v=(F,U)=>{e(O=>{for(const B of O.elements)B.type===z.WaterHeater&&B.foundationId===F&&!B.locked&&(B.lz=U)})},T=(F,U,O)=>{e(B=>{for(const _ of B.elements)if(_.type===z.WaterHeater&&!_.locked){let X;U?X=_.parentId===F&&me.isIdentical(_.normal,U):X=_.parentId===F,X&&(_.lz=O)}})},A=F=>{e(U=>{for(const O of U.elements)O.type===z.WaterHeater&&!O.locked&&(O.lz=F)})},x=(F,U)=>{H.getState().set(O=>{for(const B of O.elements)B.type===z.WaterHeater&&!B.locked&&F.has(B.id)&&(B.lz=U)})},S=F=>{l(F.target.value)},R=(F,U)=>{const O=r(F);if(O){if(O.type===z.Cuboid&&!me.isIdentical(F.normal,rs))return!0;const B=JSON.parse(JSON.stringify(F));return B.lz=U,O.type===z.Roof?!0:me.isSolarCollectorWithinHorizontalSurface(B,O)}return!1},M=(F,U)=>!R(F,U),D=F=>{if(d){switch(a){case oe.AllSelectedObjectsOfThisType:{for(const U of n)if(U.type===z.WaterHeater&&!U.locked&&H.getState().selectedElementIdSet.has(U.id)&&Math.abs(U.lz-F)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const U of n)if(U.type===z.WaterHeater&&!U.locked&&Math.abs(U.lz-F)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const U of n)if(U.type===z.WaterHeater&&U.foundationId===(d==null?void 0:d.foundationId)&&!U.locked&&Math.abs(U.lz-F)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const U=r(d);if(U){if(U.type===z.Cuboid){for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&me.isIdentical(B.normal,d.normal)&&!B.locked&&Math.abs(B.lz-F)>It)return!0}else for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&!B.locked&&Math.abs(B.lz-F)>It)return!0}break}default:{if(Math.abs((d==null?void 0:d.lz)-F)>It)return!0;break}}return!1}},E=F=>{if(d&&D(F))switch(b.current=void 0,a){case oe.AllSelectedObjectsOfThisType:{w.current=!1;for(const U of n)if(U.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(U.id)&&M(U,F)){w.current=!0;break}if(w.current)b.current=F,p(d.lz);else{const U=new Map;for(const B of n)B.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(B.id)&&U.set(B.id,B.lz);const O={name:"Set Height for Selected Water Heater",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())P(B,_)},redo:()=>{x(O.oldValues,O.newValue)}};i(O),x(U,F),c(s+1)}break}case oe.AllObjectsOfThisType:{w.current=!1;for(const U of n)if(U.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(U.id)&&M(U,F)){w.current=!0;break}if(w.current)b.current=F,p(d.lz);else{const U=new Map;for(const B of n)B.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(B.id)&&U.set(B.id,B.lz);const O={name:"Set Height for All Water Heater",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())P(B,_)},redo:()=>{A(O.newValue)}};i(O),A(F),c(s+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(d.foundationId){w.current=!1;for(const U of n)if(U.type===z.WaterHeater&&U.foundationId===d.foundationId&&M(U,F)){w.current=!0;break}if(w.current)b.current=F,p(d.lz);else{const U=new Map;for(const B of n)B.type===z.WaterHeater&&B.foundationId===d.foundationId&&U.set(B.id,B.lz);const O={name:"Set Height for All Water Heater Above Foundation",timestamp:Date.now(),oldValues:U,newValue:F,groupId:d.foundationId,undo:()=>{for(const[B,_]of O.oldValues.entries())P(B,_)},redo:()=>{O.groupId&&v(O.groupId,O.newValue)}};i(O),v(d.foundationId,F),c(s+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const U=r(d);if(U){if(w.current=!1,U.type===z.Cuboid){for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&me.isIdentical(B.normal,d.normal)&&M(B,F)){w.current=!0;break}}else for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&M(B,F)){w.current=!0;break}if(w.current)b.current=F,p(d.lz);else{const B=new Map,_=U.type===z.Cuboid;if(_)for(const Q of n)Q.type===z.WaterHeater&&Q.parentId===d.parentId&&me.isIdentical(Q.normal,d.normal)&&B.set(Q.id,Q.lz);else for(const Q of n)Q.type===z.WaterHeater&&Q.parentId===d.parentId&&B.set(Q.id,Q.lz);const X=_?d.normal:void 0,$={name:"Set Height for All Water Heater on Surface",timestamp:Date.now(),oldValues:B,newValue:F,groupId:d.parentId,normal:X,undo:()=>{for(const[Q,le]of $.oldValues.entries())P(Q,le)},redo:()=>{$.groupId&&T($.groupId,$.normal,$.newValue)}};i($),T(d.parentId,X,F),c(s+1)}}break}default:{const U=o(d.id),O=U?U.lz:d.lz;if(w.current=M(d,F),w.current)b.current=F,p(O);else{const B={name:"Set Water Heater Height",timestamp:Date.now(),oldValue:O,newValue:F,changedElementId:d.id,changedElementType:d.type,undo:()=>{P(B.changedElementId,B.oldValue)},redo:()=>{P(B.changedElementId,B.newValue)}};i(B),P(d.id,F),c(s+1)}break}}},W=()=>{w.current=!1,t(!1)},j=()=>{W(),u()},L=()=>{E(f),w.current||(t(!1),c(0))},k=()=>{E(f)},N=w.current?": "+Y.t("message.NotApplicableToSelectedAction",C)+(b.current!==void 0?" ("+b.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Height",C),rejectedMessage:N,onApply:k,onClose:W,onClickCancel:j,onClickOk:L,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:6,children:h.jsx(Mn,{min:.6,max:g,step:.1,style:{width:120},precision:2,value:f,onChange:F=>{F!==null&&p(F)}})}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",C)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:S,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("waterHeaterMenu.OnlyThisWaterHeater",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("waterHeaterMenu.AllWaterHeatersOnSurface",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("waterHeaterMenu.AllWaterHeatersAboveFoundation",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("waterHeaterMenu.AllSelectedWaterHeaters",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("waterHeaterMenu.AllWaterHeaters",C)})]})})})]})})},T1o=t=>{const e=[];if(t.type!==z.WaterHeater)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language},i=t.type===z.WaterHeater&&me.isIdentical(n.normal,rs);return e.push({key:"water-heater-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"water-heater-cut",label:h.jsx(Wd,{})}),e.push({key:"water-heater-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&e.push({key:"water-heater-length",label:h.jsxs(to,{Dialog:v1o,children:[Y.t("word.Length",r)," ..."]})},{key:"water-heater-width",label:h.jsxs(to,{Dialog:x1o,children:[Y.t("word.Width",r)," ..."]})},{key:"water-heater-height",label:h.jsxs(to,{Dialog:S1o,children:[Y.t("word.Height",r)," ..."]})}),i&&e.push({key:"water-heater-relative-azimuth",label:h.jsxs(to,{Dialog:b1o,children:[Y.t("solarCollectorMenu.RelativeAzimuth",r)," ..."]})}),{items:e}},P1o=()=>{const t=H(p7t),e=co(),n=m.useRef(t),o=m.useRef(e);return t!==null?(n.current=t,o.current=e):setTimeout(()=>{n.current=t,o.current=t===null?void 0:e},200),[n.current,o.current]},C1o=({children:t})=>{ht(r=>r.contextMenuFlag);const[e,n]=P1o(),o=()=>{if(!n)return e===z.Ground?Mdo():e===z.Sky?kfo():{items:[]};switch(e){case z.Foundation:return Juo(n);case z.Cuboid:return Ado(n);case z.Wall:return opo(n);case z.Roof:return s1o(n);case z.SolarPanel:return Kfo(n);case z.Window:return Dpo(n);case z.Door:return gpo(n);case z.Sensor:return wfo(n);case z.Light:return Tfo(n);case z.Human:return jdo(n);case z.Tree:return kho(n);case z.Flower:return Ydo(n);case z.ParabolicTrough:return iho(n);case z.ParabolicDish:return gho(n);case z.FresnelReflector:return Tho(n);case z.Heliostat:return Eho(n);case z.Polygon:return ffo(n);case z.PolygonVertex:return mfo(n);case z.WindTurbine:return w1o(n);case z.WaterHeater:return T1o(n);default:return{items:[]}}};return h.jsx(jw,{trigger:["contextMenu"],menu:o(),overlayClassName:"my-overlay",children:t})},R1o=be.memo(C1o);(function(){var t,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(I,V,ue){I!=Array.prototype&&I!=Object.prototype&&(I[V]=ue.value)};function n(I){I=[typeof window=="object"&&window,typeof self=="object"&&self,typeof global=="object"&&global,I];for(var V=0;V>>0),P=0;function v(I,V,ue){return I.call.apply(I.bind,arguments)}function T(I,V,ue){if(!I)throw Error();if(2I.b&&(I.b++,V.next=I.a,I.a=V)}function X(){this.b=this.a=null}var $=new B(function(){return new le},function(I){I.reset()});X.prototype.add=function(I,V){var ue=$.get();ue.set(I,V),this.b?this.b.next=ue:this.a=ue,this.b=ue};function Q(){var I=xo,V=null;return I.a&&(V=I.a,I.a=I.a.next,I.a||(I.b=null),V.next=null),V}function le(){this.next=this.b=this.a=null}le.prototype.set=function(I,V){this.a=I,this.b=V,this.next=null},le.prototype.reset=function(){this.next=this.b=this.a=null};var q=Array.prototype.indexOf?function(I,V){return Array.prototype.indexOf.call(I,V,void 0)}:function(I,V){if(typeof I=="string")return typeof V!="string"||V.length!=1?-1:I.indexOf(V,0);for(var ue=0;ueV?null:typeof I=="string"?I.charAt(V):I[V]}function ge(I,V){return 0<=q(I,V)}function de(I,V){V=q(I,V);var ue;return(ue=0<=V)&&Array.prototype.splice.call(I,V,1),ue}function Z(I,V){var ue=0;re(I,function(Ce,_e){V.call(void 0,Ce,_e,I)&&Array.prototype.splice.call(I,_e,1).length==1&&ue++})}function he(I){return Array.prototype.concat.apply([],arguments)}function xe(I){var V=I.length;if(0/g,ye=/"/g,ce=/'/g,pe=/\x00/g,ve=/[\x00&<>"']/;function Ae(I,V){return I.indexOf(V)!=-1}function Te(I,V){return IV?1:0}var Me;e:{var Pe=s.navigator;if(Pe){var Ee=Pe.userAgent;if(Ee){Me=Ee;break e}}Me=""}function Be(I){return Ae(Me,I)}function Je(I,V){for(var ue in I)V.call(void 0,I[ue],ue,I)}function We(I){for(var V in I)return!1;return!0}function Ke(I){var V={},ue;for(ue in I)V[ue]=I[ue];return V}var Ne="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function De(I,V){for(var ue,Ce,_e=1;_e"}else wt=I===void 0?"undefined":I===null?"null":typeof I;O("Argument is not a %s (or a non-Element, non-Location mock); got: %s",V,wt)}}function Ye(I,V){this.a=I===yt&&V||"",this.b=Ve}Ye.prototype.ta=!0,Ye.prototype.sa=function(){return this.a},Ye.prototype.toString=function(){return"Const{"+this.a+"}"};function it(I){return I instanceof Ye&&I.constructor===Ye&&I.b===Ve?I.a:(O("expected object of type Const, got '"+I+"'"),"type_error:Const")}var Ve={},yt={},ct;function Xe(){if(ct===void 0){var I=null,V=s.trustedTypes;if(V&&V.createPolicy){try{I=V.createPolicy("goog#html",{createHTML:R,createScript:R,createScriptURL:R})}catch(ue){s.console&&s.console.error(ue.message)}ct=I}else ct=I}return ct}function ut(I,V){this.a=V===Oe?I:""}ut.prototype.ta=!0,ut.prototype.sa=function(){return this.a.toString()},ut.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};function ft(I){return I instanceof ut&&I.constructor===ut?I.a:(O("expected object of type TrustedResourceUrl, got '"+I+"' of type "+p(I)),"type_error:TrustedResourceUrl")}function ot(I,V){var ue=it(I);if(!at.test(ue))throw Error("Invalid TrustedResourceUrl format: "+ue);return I=ue.replace(st,function(Ce,_e){if(!Object.prototype.hasOwnProperty.call(V,_e))throw Error('Found marker, "'+_e+'", in format string, "'+ue+'", but no valid label mapping found in args: '+JSON.stringify(V));return Ce=V[_e],Ce instanceof Ye?it(Ce):encodeURIComponent(String(Ce))}),Ze(I)}var st=/%{(\w+)}/g,at=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,Oe={};function Ze(I){var V=Xe();return I=V?V.createScriptURL(I):I,new ut(I,Oe)}function St(I,V){this.a=V===gt?I:""}St.prototype.ta=!0,St.prototype.sa=function(){return this.a.toString()},St.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};function Pt(I){return I instanceof St&&I.constructor===St?I.a:(O("expected object of type SafeUrl, got '"+I+"' of type "+p(I)),"type_error:SafeUrl")}var Rt=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)|font\/\w+|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime|x-matroska))(?:;\w+=(?:\w+|"[\w;,= ]+"))*$/i,Ut=/^data:(.*);base64,[a-z0-9+\/]+=*$/i,Ht=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function At(I){if(I instanceof St)return I;if(I=typeof I=="object"&&I.ta?I.sa():String(I),Ht.test(I))I=new St(I,gt);else{I=String(I),I=I.replace(/(%0A|%0D)/g,"");var V=I.match(Ut);I=V&&Rt.test(V[1])?new St(I,gt):null}return I}function kt(I){return I instanceof St?I:(I=typeof I=="object"&&I.ta?I.sa():String(I),Ht.test(I)||(I="about:invalid#zClosurez"),new St(I,gt))}var gt={},dt=new St("about:invalid#zClosurez",gt);function Ct(I,V,ue){this.a=ue===Fe?I:""}Ct.prototype.ta=!0,Ct.prototype.sa=function(){return this.a.toString()},Ct.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};function tt(I){return I instanceof Ct&&I.constructor===Ct?I.a:(O("expected object of type SafeHtml, got '"+I+"' of type "+p(I)),"type_error:SafeHtml")}var Fe={};function qe(I,V){ke(I,"HTMLScriptElement"),I.src=ft(V),(V=I.ownerDocument&&I.ownerDocument.defaultView)&&V!=s?V=d(V.document):(u===null&&(u=d(s.document)),V=u),V&&I.setAttribute("nonce",V)}function je(I,V,ue,Ce){return I=I instanceof St?I:kt(I),V=V||s,ue=ue instanceof Ye?it(ue):ue||"",V.open(Pt(I),ue,Ce,void 0)}function rt(I,V){for(var ue=I.split("%s"),Ce="",_e=Array.prototype.slice.call(arguments,1);_e.length&&1")!=-1&&(I=I.replace(Ie,">")),I.indexOf('"')!=-1&&(I=I.replace(ye,""")),I.indexOf("'")!=-1&&(I=I.replace(ce,"'")),I.indexOf("\0")!=-1&&(I=I.replace(pe,"�"))),I}function Qe(I){return Qe[" "](I),I}Qe[" "]=f;function Tt(I,V){var ue=Fo;return Object.prototype.hasOwnProperty.call(ue,I)?ue[I]:ue[I]=V(I)}var Dt=Be("Opera"),lt=Be("Trident")||Be("MSIE"),zt=Be("Edge"),Ft=zt||lt,_t=Be("Gecko")&&!(Ae(Me.toLowerCase(),"webkit")&&!Be("Edge"))&&!(Be("Trident")||Be("MSIE"))&&!Be("Edge"),tn=Ae(Me.toLowerCase(),"webkit")&&!Be("Edge");function Qt(){var I=s.document;return I?I.documentMode:void 0}var gn;e:{var an="",mn=function(){var I=Me;if(_t)return/rv:([^\);]+)(\)|;)/.exec(I);if(zt)return/Edge\/([\d\.]+)/.exec(I);if(lt)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(I);if(tn)return/WebKit\/(\S+)/.exec(I);if(Dt)return/(?:Version)[ \/]?(\S+)/.exec(I)}();if(mn&&(an=mn?mn[1]:""),lt){var Hn=Qt();if(Hn!=null&&Hn>parseFloat(an)){gn=String(Hn);break e}}gn=an}var Fo={};function yo(I){return Tt(I,function(){for(var V=0,ue=He(String(gn)).split("."),Ce=He(String(I)).split("."),_e=Math.max(ue.length,Ce.length),wt=0;V==0&&wt<_e;wt++){var Et=ue[wt]||"",cn=Ce[wt]||"";do{if(Et=/(\d*)(\D*)(.*)/.exec(Et)||["","","",""],cn=/(\d*)(\D*)(.*)/.exec(cn)||["","","",""],Et[0].length==0&&cn[0].length==0)break;V=Te(Et[1].length==0?0:parseInt(Et[1],10),cn[1].length==0?0:parseInt(cn[1],10))||Te(Et[2].length==0,cn[2].length==0)||Te(Et[2],cn[2]),Et=Et[3],cn=cn[3]}while(V==0)}return 0<=V})}var So;if(s.document&<){var $o=Qt();So=$o||parseInt(gn,10)||void 0}else So=void 0;var mo=So;try{new self.OffscreenCanvas(0,0).getContext("2d")}catch{}var Jn=!lt||9<=Number(mo);function uo(I){var V=document;return typeof I=="string"?V.getElementById(I):I}function ir(I,V){Je(V,function(ue,Ce){ue&&typeof ue=="object"&&ue.ta&&(ue=ue.sa()),Ce=="style"?I.style.cssText=ue:Ce=="class"?I.className=ue:Ce=="for"?I.htmlFor=ue:Rr.hasOwnProperty(Ce)?I.setAttribute(Rr[Ce],ue):Ce.lastIndexOf("aria-",0)==0||Ce.lastIndexOf("data-",0)==0?I.setAttribute(Ce,ue):I[Ce]=ue})}var Rr={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};function br(I,V,ue){var Ce=arguments,_e=document,wt=String(Ce[0]),Et=Ce[1];if(!Jn&&Et&&(Et.name||Et.type)){if(wt=["<",wt],Et.name&&wt.push(' name="',mt(Et.name),'"'),Et.type){wt.push(' type="',mt(Et.type),'"');var cn={};De(cn,Et),delete cn.type,Et=cn}wt.push(">"),wt=wt.join("")}return wt=Wo(_e,wt),Et&&(typeof Et=="string"?wt.className=Et:Array.isArray(Et)?wt.className=Et.join(" "):ir(wt,Et)),2"u"&&typeof window<"u"&&window.postMessage&&window.addEventListener&&!Be("Presto")&&(I=function(){var _e=Wo(document,"IFRAME");_e.style.display="none",document.documentElement.appendChild(_e);var wt=_e.contentWindow;_e=wt.document,_e.open(),_e.close();var Et="callImmediate"+Math.random(),cn=wt.location.protocol=="file:"?"*":wt.location.protocol+"//"+wt.location.host;_e=A(function(ao){(cn=="*"||ao.origin==cn)&&ao.data==Et&&this.port1.onmessage()},this),wt.addEventListener("message",_e,!1),this.port1={},this.port2={postMessage:function(){wt.postMessage(Et,cn)}}}),typeof I<"u"&&!Be("Trident")&&!Be("MSIE")){var V=new I,ue={},Ce=ue;return V.port1.onmessage=function(){if(ue.next!==void 0){ue=ue.next;var _e=ue.Hb;ue.Hb=null,_e()}},function(_e){Ce.next={Hb:_e},Ce=Ce.next,V.port2.postMessage(0)}}return function(_e){s.setTimeout(_e,0)}}function No(I,V){eo||Xn(),Jo||(eo(),Jo=!0),xo.add(I,V)}var eo;function Xn(){if(s.Promise&&s.Promise.resolve){var I=s.Promise.resolve(void 0);eo=function(){I.then(Qo)}}else eo=function(){var V=Qo;!y(s.setImmediate)||s.Window&&s.Window.prototype&&!Be("Edge")&&s.Window.prototype.setImmediate==s.setImmediate?(In||(In=ar()),In(V)):s.setImmediate(V)}}var Jo=!1,xo=new X;function Qo(){for(var I;I=Q();){try{I.a.call(I.b)}catch(V){wn(V)}_($,I)}Jo=!1}function jo(I,V){if(this.a=lr,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,I!=f)try{var ue=this;I.call(V,function(Ce){Fs(ue,fr,Ce)},function(Ce){if(!(Ce instanceof mu))try{throw Ce instanceof Error?Ce:Error("Promise rejected.")}catch{}Fs(ue,ai,Ce)})}catch(Ce){Fs(this,ai,Ce)}}var lr=0,fr=2,ai=3;function hr(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}hr.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var tr=new B(function(){return new hr},function(I){I.reset()});function xi(I,V,ue){var Ce=tr.get();return Ce.g=I,Ce.b=V,Ce.f=ue,Ce}function Eo(I){if(I instanceof jo)return I;var V=new jo(f);return Fs(V,fr,I),V}function bi(I){return new jo(function(V,ue){ue(I)})}function hl(I,V,ue){ks(I,V,ue,null)||No(x(V,I))}function nr(I){return new jo(function(V,ue){var Ce=I.length,_e=[];if(Ce)for(var wt=function(Mo,Hi){Ce--,_e[Mo]=Hi,Ce==0&&V(_e)},Et=function(Mo){ue(Mo)},cn=0,ao;cn=I.keyCode)&&(I.keyCode=-1)}catch{}},xt.prototype.g=function(){return this.a};var Kt="closure_listenable_"+(1e6*Math.random()|0),sn=0;function yn(I,V,ue,Ce,_e){this.listener=I,this.proxy=null,this.src=V,this.type=ue,this.capture=!!Ce,this.Wa=_e,this.key=++sn,this.wa=this.Qa=!1}function An(I){I.wa=!0,I.listener=null,I.proxy=null,I.src=null,I.Wa=null}function bn(I){this.src=I,this.a={},this.b=0}bn.prototype.add=function(I,V,ue,Ce,_e){var wt=I.toString();I=this.a[wt],I||(I=this.a[wt]=[],this.b++);var Et=Yn(I,V,Ce,_e);return-1Ce.keyCode||Ce.returnValue!=null)){e:{var _e=!1;if(Ce.keyCode==0)try{Ce.keyCode=-1;break e}catch{_e=!0}(_e||Ce.returnValue==null)&&(Ce.returnValue=!0)}for(Ce=[],_e=V.b;_e;_e=_e.parentNode)Ce.push(_e);for(I=I.type,_e=Ce.length-1;0<=_e;_e--){V.b=Ce[_e];var wt=$u(Ce[_e],I,!0,V);ue=ue&&wt}for(_e=0;_e>>0);function Ef(I){return y(I)?I:(I[Zu]||(I[Zu]=function(V){return I.handleEvent(V)}),I[Zu])}function Xl(){un.call(this),this.v=new bn(this),this.bc=this,this.hb=null}S(Xl,un),Xl.prototype[Kt]=!0,Xl.prototype.addEventListener=function(I,V,ue,Ce){qn(this,I,V,ue,Ce)},Xl.prototype.removeEventListener=function(I,V,ue,Ce){Or(this,I,V,ue,Ce)},Xl.prototype.dispatchEvent=function(I){var V,ue=this.hb;if(ue)for(V=[];ue;ue=ue.hb)V.push(ue);ue=this.bc;var Ce=I.type||I;if(typeof I=="string")I=new Lt(I,ue);else if(I instanceof Lt)I.target=I.target||ue;else{var _e=I;I=new Lt(Ce,ue),De(I,_e)}if(_e=!0,V)for(var wt=V.length-1;0<=wt;wt--){var Et=I.b=V[wt];_e=xp(Et,Ce,!0,I)&&_e}if(Et=I.b=ue,_e=xp(Et,Ce,!0,I)&&_e,_e=xp(Et,Ce,!1,I)&&_e,V)for(wt=0;wtV)throw Error("Bad port number "+V);I.g=V}else I.g=null}function _g(I,V,ue){V instanceof Vg?(I.b=V,t7(I.b,I.i)):(ue||(V=Ih(V,zh)),I.b=new Vg(V,I.i))}function il(I,V,ue){I.b.set(V,ue)}function jd(I,V){return I.b.get(V)}function wu(I){return I instanceof Ls?new Ls(I):new Ls(I,void 0)}function p5(I,V,ue,Ce){var _e=new Ls(null,void 0);return I&&ec(_e,I),V&&(_e.a=V),ue&&xl(_e,ue),Ce&&(_e.f=Ce),_e}function wy(I,V){return I?V?decodeURI(I.replace(/%25/g,"%2525")):decodeURIComponent(I):""}function Ih(I,V,ue){return typeof I=="string"?(I=encodeURI(I).replace(V,S3),ue&&(I=I.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),I):null}function S3(I){return I=I.charCodeAt(0),"%"+(I>>4&15).toString(16)+(I&15).toString(16)}var vy=/[#\/\?@]/g,T3=/[#\?:]/g,g5=/[#\?]/g,zh=/[#\?@]/g,P3=/#/g;function Vg(I,V){this.b=this.a=null,this.c=I||null,this.f=!!V}function Bd(I){I.a||(I.a=new V0,I.b=0,I.c&&Au(I.c,function(V,ue){I.add(decodeURIComponent(V.replace(/\+/g," ")),ue)}))}function e7(I){var V=y1(I);if(typeof V>"u")throw Error("Keys are undefined");var ue=new Vg(null,void 0);I=yu(I);for(var Ce=0;Ce2*I.c&&Mh(I)))}t.clear=function(){this.a=this.c=null,this.b=0};function ms(I,V){return Bd(I),V=vu(I,V),Og(I.a.b,V)}t.forEach=function(I,V){Bd(this),this.a.forEach(function(ue,Ce){te(ue,function(_e){I.call(V,_e,Ce,this)},this)},this)},t.Y=function(){Bd(this);for(var I=this.a.X(),V=this.a.Y(),ue=[],Ce=0;CeI?!1:!lt||!mo||9',I=(Ce=Xe())?Ce.createHTML(I):I,I=new Ct(I,null,Fe),Ce=Et.document)&&(Ce.write(tt(I)),Ce.close())):(Et=je(V,Ce,ue,Et))&&I.noopener&&(Et.opener=null),Et)try{Et.focus()}catch{}return Et}function Gg(I){return new jo(function(V){function ue(){Gc(2e3).then(function(){if(!I||I.closed)V();else return ue()})}return ue()})}var C3=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,m5=/^[^@]+@[^@]+$/;function Ws(){var I=null;return new jo(function(V){s.document.readyState=="complete"?V():(I=function(){V()},$i(window,"load",I))}).o(function(V){throw Or(window,"load",I),V})}function y5(){return Ya(void 0)?Ws().then(function(){return new jo(function(I,V){var ue=s.document,Ce=setTimeout(function(){V(Error("Cordova framework is not ready."))},1e3);ue.addEventListener("deviceready",function(){clearTimeout(Ce),I()},!1)})}):bi(Error("Cordova must run in an Android or iOS file scheme."))}function Ya(I){return I=I||tc(),!(Yd()!=="file:"&&Yd()!=="ionic:"||!I.toLowerCase().match(/iphone|ipad|ipod|android/))}function R3(){var I=s.window;try{return!(!I||I==I.top)}catch{return!1}}function Hc(){return typeof s.WorkerGlobalScope<"u"&&typeof s.importScripts=="function"}function Ns(){return $n.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":$n.INTERNAL.hasOwnProperty("node")?"Node":Hc()?"Worker":"Browser"}function Xg(){var I=Ns();return I==="ReactNative"||I==="Node"}function IA(){for(var I=50,V=[];0"u"?null:Sy(I)}function S5(I){var V={},ue;for(ue in I)I.hasOwnProperty(ue)&&I[ue]!==null&&I[ue]!==void 0&&(V[ue]=I[ue]);return V}function Ty(I){if(I!==null)return JSON.parse(I)}function Kg(I){return I||Math.floor(1e9*Math.random()).toString()}function T5(I){return I=I||tc(),!(ed(I)=="Safari"||I.toLowerCase().match(/iphone|ipad|ipod/))}function P5(){var I=s.___jsl;if(I&&I.H){for(var V in I.H)if(I.H[V].r=I.H[V].r||[],I.H[V].L=I.H[V].L||[],I.H[V].r=I.H[V].L.concat(),I.CP)for(var ue=0;ueV)throw Error("Short delay should be less than long delay!");this.a=I,this.c=V,I=tc(),V=Ns(),this.b=Jc(I)||V==="ReactNative"}Ff.prototype.get=function(){var I=s.navigator;return!(I&&typeof I.onLine=="boolean"&&(b5()||Yd()==="chrome-extension:"||typeof I.connection<"u"))||I.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};function zA(){var I=s.document;return I&&typeof I.visibilityState<"u"?I.visibilityState=="visible":!0}function n7(){var I=s.document,V=null;return zA()||!I?Eo():new jo(function(ue){V=function(){zA()&&(I.removeEventListener("visibilitychange",V,!1),ue())},I.addEventListener("visibilitychange",V,!1)}).o(function(ue){throw I.removeEventListener("visibilitychange",V,!1),ue})}function H3(I){try{var V=new Date(parseInt(I,10));if(!isNaN(V.getTime())&&!/[^0-9]/.test(I))return V.toUTCString()}catch{}return null}function o7(){return!(!Jl("fireauth.oauthhelper",s)&&!Jl("fireauth.iframe",s))}function Kc(){var I=s.navigator;return I&&I.serviceWorker&&I.serviceWorker.controller||null}function X0(){var I=s.navigator;return I&&I.serviceWorker?Eo().then(function(){return I.serviceWorker.ready}).then(function(V){return V.active||null}).o(function(){return null}):Eo(null)}var r7={};function DA(I){r7[I]||(r7[I]=!0,typeof console<"u"&&typeof console.warn=="function"&&console.warn(I))}var M3;try{var EA={};Object.defineProperty(EA,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(EA,"abcd",{configurable:!0,enumerable:!0,value:2}),M3=EA.abcd==2}catch{M3=!1}function Hr(I,V,ue){M3?Object.defineProperty(I,V,{configurable:!0,enumerable:!0,value:ue}):I[V]=ue}function qc(I,V){if(V)for(var ue in V)V.hasOwnProperty(ue)&&Hr(I,ue,V[ue])}function kf(I){var V={};return qc(V,I),V}function C5(I){var V={},ue;for(ue in I)I.hasOwnProperty(ue)&&(V[ue]=I[ue]);return V}function Py(I,V){if(!V||!V.length)return!0;if(!I)return!1;for(var ue=0;ue"u")throw new M("missing-continue-uri");if(typeof V!="string"||typeof V=="string"&&!V.length)throw new M("invalid-continue-uri");this.h=V,this.b=this.a=null,this.g=!1;var ue=I[s7];if(ue&&typeof ue=="object"){V=ue[u7];var Ce=ue[S1];if(ue=ue[YA],typeof V=="string"&&V.length){if(this.a=V,typeof Ce<"u"&&typeof Ce!="boolean")throw new M("argument-error",S1+" property must be a boolean when specified.");if(this.g=!!Ce,typeof ue<"u"&&(typeof ue!="string"||typeof ue=="string"&&!ue.length))throw new M("argument-error",YA+" property must be a non empty string when specified.");this.b=ue||null}else{if(typeof V<"u")throw new M("argument-error",u7+" property must be a non empty string when specified.");if(typeof Ce<"u"||typeof ue<"u")throw new M("missing-android-pkg-name")}}else if(typeof ue<"u")throw new M("argument-error",s7+" property must be a non null object when specified.");if(this.f=null,(V=I[c7])&&typeof V=="object"){if(V=V[Mc],typeof V=="string"&&V.length)this.f=V;else if(typeof V<"u")throw new M("argument-error",Mc+" property must be a non empty string when specified.")}else if(typeof V<"u")throw new M("argument-error",c7+" property must be a non null object when specified.");if(V=I[jA],typeof V<"u"&&typeof V!="boolean")throw new M("argument-error",jA+" property must be a boolean when specified.");if(this.c=!!V,I=I[UA],typeof I<"u"&&(typeof I!="string"||typeof I=="string"&&!I.length))throw new M("argument-error",UA+" property must be a non empty string when specified.");this.i=I||null}var s7="android",UA="dynamicLinkDomain",jA="handleCodeInApp",c7="iOS",BA="url",S1="installApp",YA="minimumVersion",u7="packageName",Mc="bundleId";function OA(I){var V={};V.continueUrl=I.h,V.canHandleCodeInApp=I.c,(V.androidPackageName=I.a)&&(V.androidMinimumVersion=I.b,V.androidInstallApp=I.g),V.iOSBundleId=I.f,V.dynamicLinkDomain=I.i;for(var ue in V)V[ue]===null&&delete V[ue];return V}function jM(I){return se(I,function(V){return V=V.toString(16),1>4),Et!=64&&(V(wt<<4&240|Et>>2),cn!=64&&V(Et<<6&192|cn))}}function Ar(){if(!qg){qg={};for(var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),V=["+/=","+/","-_=","-_.","-_"],ue=0;5>ue;ue++)for(var Ce=I.concat(V[ue].split("")),_e=0;_ethis.a?this.a:I),this.b=V.provider_id||V.firebase&&V.firebase.sign_in_provider||null,this.f=V.firebase&&V.firebase.tenant||null,this.c=!!V.is_anonymous||this.b=="anonymous"}$g.prototype.T=function(){return this.f},$g.prototype.l=function(){return this.c},$g.prototype.toString=function(){return this.h};function H5(I){try{return new $g(I)}catch{return null}}function d7(I){if(!I||(I=I.split("."),I.length!=3))return null;I=I[1];for(var V=(4-I.length%4)%4,ue=0;ue_e)I[ue++]=String.fromCharCode(_e);else if(191<_e&&224>_e){var wt=Ce[V++];I[ue++]=String.fromCharCode((_e&31)<<6|wt&63)}else if(239<_e&&365>_e){wt=Ce[V++];var Et=Ce[V++],cn=Ce[V++],ao=((_e&7)<<18|(wt&63)<<12|(Et&63)<<6|cn&63)-65536;I[ue++]=String.fromCharCode(55296+(ao>>10)),I[ue++]=String.fromCharCode(56320+(ao&1023))}else wt=Ce[V++],Et=Ce[V++],I[ue++]=String.fromCharCode((_e&15)<<12|(wt&63)<<6|Et&63)}return JSON.parse(I.join(""))}catch{}return null}var _A="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),rd=["client_id","response_type","scope","redirect_uri","state"],Tp={nd:{Ja:"locale",va:700,ua:600,fa:"facebook.com",Ya:rd},pd:{Ja:null,va:500,ua:750,fa:"github.com",Ya:rd},qd:{Ja:"hl",va:515,ua:680,fa:"google.com",Ya:rd},wd:{Ja:"lang",va:485,ua:705,fa:"twitter.com",Ya:_A},kd:{Ja:"locale",va:640,ua:600,fa:"apple.com",Ya:[]}};function E3(I){for(var V in Tp)if(Tp[V].fa==I)return Tp[V];return null}function VA(I){var V={};V["facebook.com"]=id,V["google.com"]=F3,V["github.com"]=XA,V["twitter.com"]=JA;var ue=I&&I[Fh];try{if(ue)return V[ue]?new V[ue](I):new v0(I);if(typeof I[GA]<"u")return new M5(I)}catch{}return null}var GA="idToken",Fh="providerId";function M5(I){var V=I[Fh];if(!V&&I[GA]){var ue=H5(I[GA]);ue&&ue.b&&(V=ue.b)}if(!V)throw Error("Invalid additional user info!");(V=="anonymous"||V=="custom")&&(V=null),ue=!1,typeof I.isNewUser<"u"?ue=!!I.isNewUser:I.kind==="identitytoolkit#SignupNewUserResponse"&&(ue=!0),Hr(this,"providerId",V),Hr(this,"isNewUser",ue)}function v0(I){M5.call(this,I),I=Ty(I.rawUserInfo||"{}"),Hr(this,"profile",w1(I||{}))}S(v0,M5);function id(I){if(v0.call(this,I),this.providerId!="facebook.com")throw Error("Invalid provider ID!")}S(id,v0);function XA(I){if(v0.call(this,I),this.providerId!="github.com")throw Error("Invalid provider ID!");Hr(this,"username",this.profile&&this.profile.login||null)}S(XA,v0);function F3(I){if(v0.call(this,I),this.providerId!="google.com")throw Error("Invalid provider ID!")}S(F3,v0);function JA(I){if(v0.call(this,I),this.providerId!="twitter.com")throw Error("Invalid provider ID!");Hr(this,"username",I.screenName||null)}S(JA,v0);function Qg(I){var V=wu(I),ue=jd(V,"link"),Ce=jd(wu(ue),"link");return V=jd(V,"deep_link_id"),jd(wu(V),"link")||V||Ce||ue||I}function ad(I,V){if(!I&&!V)throw new M("internal-error","Internal assert: no raw session string available");if(I&&V)throw new M("internal-error","Internal assert: unable to determine the session type");this.a=I||null,this.b=V||null,this.type=this.a?I5:KA}var I5="enroll",KA="signin";ad.prototype.Ha=function(){return this.a?Eo(this.a):Eo(this.b)},ad.prototype.w=function(){return this.type==I5?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}};function Pp(){}Pp.prototype.ka=function(){},Pp.prototype.b=function(){},Pp.prototype.c=function(){},Pp.prototype.w=function(){};function Ry(I,V){return I.then(function(ue){if(ue[Zt]){var Ce=H5(ue[Zt]);if(!Ce||V!=Ce.i)throw new M("user-mismatch");return ue}throw new M("user-mismatch")}).o(function(ue){throw ue&&ue.code&&ue.code==E+"user-not-found"?new M("user-mismatch"):ue})}function T1(I,V){if(V)this.a=V;else throw new M("internal-error","failed to construct a credential");Hr(this,"providerId",I),Hr(this,"signInMethod",I)}T1.prototype.ka=function(I){return PS(I,Ic(this))},T1.prototype.b=function(I,V){var ue=Ic(this);return ue.idToken=V,Q0(I,ue)},T1.prototype.c=function(I,V){return Ry(VM(I,Ic(this)),V)};function Ic(I){return{pendingToken:I.a,requestUri:"http://localhost"}}T1.prototype.w=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}};function z5(I){if(I&&I.providerId&&I.signInMethod&&I.providerId.indexOf("saml.")==0&&I.pendingToken)try{return new T1(I.providerId,I.pendingToken)}catch{}return null}function _d(I,V,ue){if(this.a=null,V.idToken||V.accessToken)V.idToken&&Hr(this,"idToken",V.idToken),V.accessToken&&Hr(this,"accessToken",V.accessToken),V.nonce&&!V.pendingToken&&Hr(this,"nonce",V.nonce),V.pendingToken&&(this.a=V.pendingToken);else if(V.oauthToken&&V.oauthTokenSecret)Hr(this,"accessToken",V.oauthToken),Hr(this,"secret",V.oauthTokenSecret);else throw new M("internal-error","failed to construct a credential");Hr(this,"providerId",I),Hr(this,"signInMethod",ue)}_d.prototype.ka=function(I){return PS(I,bu(this))},_d.prototype.b=function(I,V){var ue=bu(this);return ue.idToken=V,Q0(I,ue)},_d.prototype.c=function(I,V){var ue=bu(this);return Ry(VM(I,ue),V)};function bu(I){var V={};return I.idToken&&(V.id_token=I.idToken),I.accessToken&&(V.access_token=I.accessToken),I.secret&&(V.oauth_token_secret=I.secret),V.providerId=I.providerId,I.nonce&&!I.a&&(V.nonce=I.nonce),V={postBody:e7(V).toString(),requestUri:"http://localhost"},I.a&&(delete V.postBody,V.pendingToken=I.a),V}_d.prototype.w=function(){var I={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(I.oauthIdToken=this.idToken),this.accessToken&&(I.oauthAccessToken=this.accessToken),this.secret&&(I.oauthTokenSecret=this.secret),this.nonce&&(I.nonce=this.nonce),this.a&&(I.pendingToken=this.a),I};function D5(I){if(I&&I.providerId&&I.signInMethod){var V={idToken:I.oauthIdToken,accessToken:I.oauthTokenSecret?null:I.oauthAccessToken,oauthTokenSecret:I.oauthTokenSecret,oauthToken:I.oauthTokenSecret&&I.oauthAccessToken,nonce:I.nonce,pendingToken:I.pendingToken};try{return new _d(I.providerId,V,I.signInMethod)}catch{}}return null}function Vd(I,V){this.Qc=V||[],qc(this,{providerId:I,isOAuthProvider:!0}),this.Jb={},this.qb=(E3(I)||{}).Ja||null,this.pb=null}Vd.prototype.Ka=function(I){return this.Jb=Ke(I),this};function Lf(I){if(typeof I!="string"||I.indexOf("saml.")!=0)throw new M("argument-error",'SAML provider IDs must be prefixed with "saml."');Vd.call(this,I,[])}S(Lf,Vd);function K0(I){Vd.call(this,I,rd),this.a=[]}S(K0,Vd),K0.prototype.Ca=function(I){return ge(this.a,I)||this.a.push(I),this},K0.prototype.Rb=function(){return xe(this.a)},K0.prototype.credential=function(I,V){var ue;if(w(I)?ue={idToken:I.idToken||null,accessToken:I.accessToken||null,nonce:I.rawNonce||null}:ue={idToken:I||null,accessToken:V||null},!ue.idToken&&!ue.accessToken)throw new M("argument-error","credential failed: must provide the ID token and/or the access token.");return new _d(this.providerId,ue,this.providerId)};function Cs(){K0.call(this,"facebook.com")}S(Cs,K0),Hr(Cs,"PROVIDER_ID","facebook.com"),Hr(Cs,"FACEBOOK_SIGN_IN_METHOD","facebook.com");function E5(I){if(!I)throw new M("argument-error","credential failed: expected 1 argument (the OAuth access token).");var V=I;return w(I)&&(V=I.accessToken),new Cs().credential({accessToken:V})}function Zg(){K0.call(this,"github.com")}S(Zg,K0),Hr(Zg,"PROVIDER_ID","github.com"),Hr(Zg,"GITHUB_SIGN_IN_METHOD","github.com");function qA(I){if(!I)throw new M("argument-error","credential failed: expected 1 argument (the OAuth access token).");var V=I;return w(I)&&(V=I.accessToken),new Zg().credential({accessToken:V})}function Hy(){K0.call(this,"google.com"),this.Ca("profile")}S(Hy,K0),Hr(Hy,"PROVIDER_ID","google.com"),Hr(Hy,"GOOGLE_SIGN_IN_METHOD","google.com");function My(I,V){var ue=I;return w(I)&&(ue=I.idToken,V=I.accessToken),new Hy().credential({idToken:ue,accessToken:V})}function em(){Vd.call(this,"twitter.com",_A)}S(em,Vd),Hr(em,"PROVIDER_ID","twitter.com"),Hr(em,"TWITTER_SIGN_IN_METHOD","twitter.com");function Kl(I,V){var ue=I;if(w(ue)||(ue={oauthToken:I,oauthTokenSecret:V}),!ue.oauthToken||!ue.oauthTokenSecret)throw new M("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new _d("twitter.com",ue,"twitter.com")}function Ci(I,V,ue){this.a=I,this.f=V,Hr(this,"providerId","password"),Hr(this,"signInMethod",ue===al.EMAIL_LINK_SIGN_IN_METHOD?al.EMAIL_LINK_SIGN_IN_METHOD:al.EMAIL_PASSWORD_SIGN_IN_METHOD)}Ci.prototype.ka=function(I){return this.signInMethod==al.EMAIL_LINK_SIGN_IN_METHOD?La(I,jy,{email:this.a,oobCode:this.f}):La(I,QM,{email:this.a,password:this.f})},Ci.prototype.b=function(I,V){return this.signInMethod==al.EMAIL_LINK_SIGN_IN_METHOD?La(I,$d,{idToken:V,email:this.a,oobCode:this.f}):La(I,KM,{idToken:V,email:this.a,password:this.f})},Ci.prototype.c=function(I,V){return Ry(this.ka(I),V)},Ci.prototype.w=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}};function zc(I){return I&&I.email&&I.password?new Ci(I.email,I.password,I.signInMethod):null}function al(){qc(this,{providerId:"password",isOAuthProvider:!1})}function js(I,V){if(V=Su(V),!V)throw new M("argument-error","Invalid email link!");return new Ci(I,V.code,al.EMAIL_LINK_SIGN_IN_METHOD)}function Su(I){return I=Qg(I),(I=D3(I))&&I.operation===x1?I:null}qc(al,{PROVIDER_ID:"password"}),qc(al,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),qc(al,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"});function Gd(I){if(!(I.fb&&I.eb||I.La&&I.ea))throw new M("internal-error");this.a=I,Hr(this,"providerId","phone"),this.fa="phone",Hr(this,"signInMethod","phone")}Gd.prototype.ka=function(I){return I.gb(Cp(this))},Gd.prototype.b=function(I,V){var ue=Cp(this);return ue.idToken=V,La(I,IU,ue)},Gd.prototype.c=function(I,V){var ue=Cp(this);return ue.operation="REAUTH",I=La(I,sm,ue),Ry(I,V)},Gd.prototype.w=function(){var I={providerId:"phone"};return this.a.fb&&(I.verificationId=this.a.fb),this.a.eb&&(I.verificationCode=this.a.eb),this.a.La&&(I.temporaryProof=this.a.La),this.a.ea&&(I.phoneNumber=this.a.ea),I};function nc(I){if(I&&I.providerId==="phone"&&(I.verificationId&&I.verificationCode||I.temporaryProof&&I.phoneNumber)){var V={};return te(["verificationId","verificationCode","temporaryProof","phoneNumber"],function(ue){I[ue]&&(V[ue]=I[ue])}),new Gd(V)}return null}function Cp(I){return I.a.La&&I.a.ea?{temporaryProof:I.a.La,phoneNumber:I.a.ea}:{sessionInfo:I.a.fb,code:I.a.eb}}function ld(I){try{this.a=I||$n.auth()}catch{throw new M("argument-error","Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().")}qc(this,{providerId:"phone",isOAuthProvider:!1})}ld.prototype.gb=function(I,V){var ue=this.a.a;return Eo(V.verify()).then(function(Ce){if(typeof Ce!="string")throw new M("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(V.type){case"recaptcha":var _e=w(I)?I.session:null,wt=w(I)?I.phoneNumber:I,Et;return _e&&_e.type==I5?Et=_e.Ha().then(function(cn){return i4(ue,{idToken:cn,phoneEnrollmentInfo:{phoneNumber:wt,recaptchaToken:Ce}})}):_e&&_e.type==KA?Et=_e.Ha().then(function(cn){return SS(ue,{mfaPendingCredential:cn,mfaEnrollmentId:I.multiFactorHint&&I.multiFactorHint.uid||I.multiFactorUid,phoneSignInInfo:{recaptchaToken:Ce}})}):Et=r4(ue,{phoneNumber:wt,recaptchaToken:Ce}),Et.then(function(cn){return typeof V.reset=="function"&&V.reset(),cn},function(cn){throw typeof V.reset=="function"&&V.reset(),cn});default:throw new M("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}})};function k3(I,V){if(!I)throw new M("missing-verification-id");if(!V)throw new M("missing-verification-code");return new Gd({fb:I,eb:V})}qc(ld,{PROVIDER_ID:"phone"}),qc(ld,{PHONE_SIGN_IN_METHOD:"phone"});function L3(I){if(I.temporaryProof&&I.phoneNumber)return new Gd({La:I.temporaryProof,ea:I.phoneNumber});var V=I&&I.providerId;if(!V||V==="password")return null;var ue=I&&I.oauthAccessToken,Ce=I&&I.oauthTokenSecret,_e=I&&I.nonce,wt=I&&I.oauthIdToken,Et=I&&I.pendingToken;try{switch(V){case"google.com":return My(wt,ue);case"facebook.com":return E5(ue);case"github.com":return qA(ue);case"twitter.com":return Kl(ue,Ce);default:return ue||Ce||wt||Et?Et?V.indexOf("saml.")==0?new T1(V,Et):new _d(V,{pendingToken:Et,idToken:I.oauthIdToken,accessToken:I.oauthAccessToken},V):new K0(V).credential({idToken:wt,accessToken:ue,rawNonce:_e}):null}}catch{return null}}function tm(I){if(!I.isOAuthProvider)throw new M("invalid-oauth-provider")}function ql(I,V,ue,Ce,_e,wt,Et){if(this.c=I,this.b=V||null,this.g=ue||null,this.f=Ce||null,this.i=wt||null,this.h=Et||null,this.a=_e||null,this.g||this.a){if(this.g&&this.a)throw new M("invalid-auth-event");if(this.g&&!this.f)throw new M("invalid-auth-event")}else throw new M("invalid-auth-event")}ql.prototype.getUid=function(){var I=[];return I.push(this.c),this.b&&I.push(this.b),this.f&&I.push(this.f),this.h&&I.push(this.h),I.join("-")},ql.prototype.T=function(){return this.h},ql.prototype.w=function(){return{type:this.c,eventId:this.b,urlResponse:this.g,sessionId:this.f,postBody:this.i,tenantId:this.h,error:this.a&&this.a.w()}};function $A(I){return I=I||{},I.type?new ql(I.type,I.eventId,I.urlResponse,I.sessionId,I.error&&D(I.error),I.postBody,I.tenantId):null}function W3(){this.b=null,this.a=[]}var P1=null;function N3(I){var V=P1;V.a.push(I),V.b||(V.b=function(ue){for(var Ce=0;Ce Auth section -> Sign in method tab.",I):Ce=="http"||Ce=="https"?ue=rt("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",I):V="operation-not-supported-in-this-environment",M.call(this,V,ue)}S(F5,M);function Tu(I,V,ue){M.call(this,I,ue),I=V||{},I.Kb&&Hr(this,"email",I.Kb),I.ea&&Hr(this,"phoneNumber",I.ea),I.credential&&Hr(this,"credential",I.credential),I.$b&&Hr(this,"tenantId",I.$b)}S(Tu,M),Tu.prototype.w=function(){var I={code:this.code,message:this.message};this.email&&(I.email=this.email),this.phoneNumber&&(I.phoneNumber=this.phoneNumber),this.tenantId&&(I.tenantId=this.tenantId);var V=this.credential&&this.credential.w();return V&&De(I,V),I},Tu.prototype.toJSON=function(){return this.w()};function Iy(I){if(I.code){var V=I.code||"";V.indexOf(E)==0&&(V=V.substring(E.length));var ue={credential:L3(I),$b:I.tenantId};if(I.email)ue.Kb=I.email;else if(I.phoneNumber)ue.ea=I.phoneNumber;else if(!ue.credential)return new M(V,I.message||void 0);return new Tu(V,ue,I.message)}return null}function Xd(){}Xd.prototype.c=null;function k5(I){return I.c||(I.c=I.b())}var zy;function Dy(){}S(Dy,Xd),Dy.prototype.a=function(){var I=U3(this);return I?new ActiveXObject(I):new XMLHttpRequest},Dy.prototype.b=function(){var I={};return U3(this)&&(I[0]=!0,I[1]=!0),I};function U3(I){if(!I.f&&typeof XMLHttpRequest>"u"&&typeof ActiveXObject<"u"){for(var V=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],ue=0;ue=R1(this).value)for(y(V)&&(V=V()),I=new sd(I,String(V),this.f),ue&&(I.a=ue),ue=this;ue;)ue=ue.a};var QA={},q0=null;function B3(I){q0||(q0=new nm(""),QA[""]=q0,q0.c=Ey);var V;if(!(V=QA[I])){V=new nm(I);var ue=I.lastIndexOf("."),Ce=I.substr(ue+1);ue=B3(I.substr(0,ue)),ue.b||(ue.b={}),ue.b[Ce]=V,V.a=ue,QA[I]=V}return V}function oc(I,V){I&&I.log(bS,V,void 0)}function Fy(I){this.f=I}S(Fy,Xd),Fy.prototype.a=function(){return new L5(this.f)},Fy.prototype.b=function(I){return function(){return I}}({});function L5(I){Xl.call(this),this.u=I,this.h=void 0,this.readyState=W5,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.l=new Headers,this.b=null,this.s="GET",this.f="",this.a=!1,this.i=B3("goog.net.FetchXmlHttp"),this.m=this.c=this.g=null}S(L5,Xl);var W5=0;t=L5.prototype,t.open=function(I,V){if(this.readyState!=W5)throw this.abort(),Error("Error reopening a connection");this.s=I,this.f=V,this.readyState=1,ky(this)},t.send=function(I){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.a=!0;var V={headers:this.l,method:this.s,credentials:this.h,cache:void 0};I&&(V.body=I),this.u.fetch(new Request(this.f,V)).then(this.uc.bind(this),this.Va.bind(this))},t.abort=function(){this.response=this.responseText="",this.l=new Headers,this.status=0,this.c&&this.c.cancel("Request was aborted."),1<=this.readyState&&this.a&&this.readyState!=4&&(this.a=!1,Nf(this)),this.readyState=W5},t.uc=function(I){this.a&&(this.g=I,this.b||(this.status=this.g.status,this.statusText=this.g.statusText,this.b=I.headers,this.readyState=2,ky(this)),this.a&&(this.readyState=3,ky(this),this.a&&(this.responseType==="arraybuffer"?I.arrayBuffer().then(this.sc.bind(this),this.Va.bind(this)):typeof s.ReadableStream<"u"&&"body"in I?(this.response=this.responseText="",this.c=I.body.getReader(),this.m=new TextDecoder,b0(this)):I.text().then(this.tc.bind(this),this.Va.bind(this)))))};function b0(I){I.c.read().then(I.pc.bind(I)).catch(I.Va.bind(I))}t.pc=function(I){if(this.a){var V=this.m.decode(I.value?I.value:new Uint8Array(0),{stream:!I.done});V&&(this.response=this.responseText+=V),I.done?Nf(this):ky(this),this.readyState==3&&b0(this)}},t.tc=function(I){this.a&&(this.response=this.responseText=I,Nf(this))},t.sc=function(I){this.a&&(this.response=I,Nf(this))},t.Va=function(I){var V=this.i;V&&V.log(j3,"Failed to fetch url "+this.f,I instanceof Error?I:Error(I)),this.a&&Nf(this)};function Nf(I){I.readyState=4,I.g=null,I.c=null,I.m=null,ky(I)}t.setRequestHeader=function(I,V){this.l.append(I,V)},t.getResponseHeader=function(I){return this.b?this.b.get(I.toLowerCase())||"":((I=this.i)&&I.log(j3,"Attempting to get response header but no headers have been received for url: "+this.f,void 0),"")},t.getAllResponseHeaders=function(){if(!this.b){var I=this.i;return I&&I.log(j3,"Attempting to get all response headers but no headers have been received for url: "+this.f,void 0),""}I=[];for(var V=this.b.entries(),ue=V.next();!ue.done;)ue=ue.value,I.push(ue[0]+": "+ue[1]),ue=V.next();return I.join(`\r -`)};function ky(I){I.onreadystatechange&&I.onreadystatechange.call(I)}Object.defineProperty(L5.prototype,"withCredentials",{get:function(){return this.h==="include"},set:function(I){this.h=I?"include":"same-origin"}});function Ly(I){Xl.call(this),this.headers=new V0,this.D=I||null,this.c=!1,this.C=this.a=null,this.h=this.P=this.l="",this.f=this.N=this.i=this.J=!1,this.g=0,this.s=null,this.m=N5,this.u=this.S=!1}S(Ly,Xl);var N5="";Ly.prototype.b=B3("goog.net.XhrIo");var om=/^https?$/i,h7=["POST","PUT"];function rm(I,V,ue,Ce,_e){if(I.a)throw Error("[goog.net.XhrIo] Object is active with another request="+I.l+"; newUri="+V);ue=ue?ue.toUpperCase():"GET",I.l=V,I.h="",I.P=ue,I.J=!1,I.c=!0,I.a=I.D?I.D.a():zy.a(),I.C=I.D?k5(I.D):k5(zy),I.a.onreadystatechange=A(I.Wb,I);try{oc(I.b,kh(I,"Opening Xhr")),I.N=!0,I.a.open(ue,String(V),!0),I.N=!1}catch(Et){oc(I.b,kh(I,"Error opening Xhr: "+Et.message)),H1(I,Et);return}V=Ce||"";var wt=new V0(I.headers);_e&&A1(_e,function(Et,cn){wt.set(cn,Et)}),_e=fe(wt.Y()),Ce=s.FormData&&V instanceof s.FormData,!ge(h7,ue)||_e||Ce||wt.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),wt.forEach(function(Et,cn){this.a.setRequestHeader(cn,Et)},I),I.m&&(I.a.responseType=I.m),"withCredentials"in I.a&&I.a.withCredentials!==I.S&&(I.a.withCredentials=I.S);try{e4(I),0=V.l&&V.cancel())}this.u?this.u.call(this.s,this):this.v=!0,this.a||(I=new U5,Wy(this),Jd(this,!1,I))}},am.prototype.m=function(I,V){this.i=!1,Jd(this,I,V)};function Jd(I,V,ue){I.a=!0,I.c=ue,I.f=!V,Kd(I)}function Wy(I){if(I.a){if(!I.v)throw new n4;I.v=!1}}function lm(I,V){Ny(I,null,V,void 0)}function Ny(I,V,ue,Ce){I.g.push([V,ue,Ce]),I.a&&Kd(I)}am.prototype.then=function(I,V,ue){var Ce,_e,wt=new jo(function(Et,cn){Ce=Et,_e=cn});return Ny(this,Ce,function(Et){Et instanceof U5?wt.cancel():_e(Et)}),wt.then(I,V,ue)},am.prototype.$goog_Thenable=!0;function S0(I){return ne(I.g,function(V){return y(V[1])})}function Kd(I){if(I.h&&I.a&&S0(I)){var V=I.h,ue=Rp[V];ue&&(s.clearTimeout(ue.a),delete Rp[V]),I.h=0}I.b&&(I.b.l--,delete I.b),V=I.c;for(var Ce=ue=!1;I.g.length&&!I.i;){var _e=I.g.shift(),wt=_e[0],Et=_e[1];if(_e=_e[2],wt=I.f?Et:wt)try{var cn=wt.call(_e||I.s,V);cn!==void 0&&(I.f=I.f&&(cn==V||cn instanceof Error),I.c=V=cn),(N(V)||typeof s.Promise=="function"&&V instanceof s.Promise)&&(Ce=!0,I.i=!0)}catch(ao){V=ao,I.f=!0,S0(I)||(ue=!0)}}I.c=V,Ce&&(cn=A(I.m,I,!0),Ce=A(I.m,I,!1),V instanceof am?(Ny(V,cn,Ce),V.C=!0):V.then(cn,Ce)),ue&&(V=new j5(V),Rp[V.a]=V,I.h=V.a)}function n4(){F.call(this)}S(n4,F),n4.prototype.message="Deferred has already fired",n4.prototype.name="AlreadyCalledError";function U5(){F.call(this)}S(U5,F),U5.prototype.message="Deferred was canceled",U5.prototype.name="CanceledError";function j5(I){this.a=s.setTimeout(A(this.c,this),0),this.b=I}j5.prototype.c=function(){throw delete Rp[this.a],this.b};var Rp={};function O3(I){var V={},ue=V.document||document,Ce=ft(I).toString(),_e=Wo(document,"SCRIPT"),wt={Xb:_e,Ma:void 0},Et=new am(wt),cn=null,ao=V.timeout!=null?V.timeout:5e3;return 0"u"||typeof s.Headers>"u"||typeof s.Request>"u"))throw new M("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.");var Et=new Ly(this.f);if(wt){Et.g=Math.max(0,wt);var cn=setTimeout(function(){Et.dispatchEvent("timeout")},wt)}_0(Et,"complete",function(){cn&&clearTimeout(cn);var ao=null;try{ao=JSON.parse(Uf(this))||null}catch{ao=null}V&&V(ao)}),Hh(Et,"ready",function(){cn&&clearTimeout(cn),Bt(this)}),Hh(Et,"timeout",function(){cn&&clearTimeout(cn),Bt(this),V&&V(null)}),rm(Et,I,ue,Ce,_e)};var qd=new Ye(yt,"https://apis.google.com/js/client.js?onload=%{onload}"),kn="__fcb"+Math.floor(1e6*Math.random()).toString();function Rn(I,V){if(((window.gapi||{}).client||{}).request)I();else{s[kn]=function(){((window.gapi||{}).client||{}).request?I():V(Error("CORS_UNSUPPORTED"))};var ue=ot(qd,{onload:kn});lm(O3(ue),function(){V(Error("CORS_UNSUPPORTED"))})}}Ge.prototype.s=function(I,V,ue,Ce,_e){var wt=this;pt.then(function(){window.gapi.client.setApiKey(wt.c);var Et=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:I,method:ue,body:Ce,headers:_e,authType:"none",callback:function(cn){window.gapi.auth.setToken(Et),V&&V(cn)}})}).o(function(Et){V&&V({error:{message:Et&&Et.message||"CORS_UNSUPPORTED"}})})};function _n(I,V){return new jo(function(ue,Ce){V.grant_type=="refresh_token"&&V.refresh_token||V.grant_type=="authorization_code"&&V.code?T0(I,I.l+"?key="+encodeURIComponent(I.c),function(_e){_e?_e.error?Ce(eI(_e)):_e.access_token&&_e.refresh_token?ue(_e):Ce(new M("internal-error")):Ce(new M("network-request-failed"))},"POST",e7(V).toString(),I.g,I.m.get()):Ce(new M("internal-error"))})}function xr(I,V,ue,Ce,_e,wt,Et){var cn=wu(V+ue);il(cn,"key",I.c),Et&&il(cn,"cb",Date.now().toString());var ao=Ce=="GET";if(ao)for(var Mo in _e)_e.hasOwnProperty(Mo)&&il(cn,Mo,_e[Mo]);return new jo(function(Hi,bl){T0(I,cn.toString(),function(gl){gl?gl.error?bl(eI(gl,wt||{})):Hi(gl):bl(new M("network-request-failed"))},Ce,ao?void 0:Sy(S5(_e)),I.a,I.v.get())})}function Dr(I){if(I=I.email,typeof I!="string"||!m5.test(I))throw new M("invalid-email")}function Qi(I){"email"in I&&Dr(I)}function Bi(I,V){return La(I,Ste,{identifier:V,continueUri:b5()?ui():"http://localhost"}).then(function(ue){return ue.signinMethods||[]})}function oa(I){return La(I,PU,{}).then(function(V){return V.authorizedDomains||[]})}function Oa(I){if(!I[Zt])throw I.mfaPendingCredential?new M("multi-factor-auth-required",null,Ke(I)):new M("internal-error")}function Ta(I){if(I.phoneNumber||I.temporaryProof){if(!I.phoneNumber||!I.temporaryProof)throw new M("internal-error")}else{if(!I.sessionInfo)throw new M("missing-verification-id");if(!I.code)throw new M("missing-verification-code")}}Ge.prototype.Ab=function(){return La(this,RU,{})},Ge.prototype.Cb=function(I,V){return La(this,CU,{idToken:I,email:V})},Ge.prototype.Db=function(I,V){return La(this,KM,{idToken:I,password:V})};var Hp={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};t=Ge.prototype,t.Eb=function(I,V){var ue={idToken:I},Ce=[];return Je(Hp,function(_e,wt){var Et=V[wt];Et===null?Ce.push(_e):wt in V&&(ue[wt]=Et)}),Ce.length&&(ue.deleteAttribute=Ce),La(this,CU,ue)},t.wb=function(I,V){return I={requestType:"PASSWORD_RESET",email:I},De(I,V),La(this,TU,I)},t.xb=function(I,V){return I={requestType:"EMAIL_SIGNIN",email:I},De(I,V),La(this,Rte,I)},t.vb=function(I,V){return I={requestType:"VERIFY_EMAIL",idToken:I},De(I,V),La(this,Hte,I)},t.Fb=function(I,V,ue){return I={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:I,newEmail:V},De(I,ue),La(this,g7,I)};function r4(I,V){return La(I,zte,V)}t.gb=function(I){return La(this,CS,I)};function i4(I,V){return La(I,Dte,V).then(function(ue){return ue.phoneSessionInfo.sessionInfo})}function gi(I){if(!I.phoneVerificationInfo)throw new M("internal-error");if(!I.phoneVerificationInfo.sessionInfo)throw new M("missing-verification-id");if(!I.phoneVerificationInfo.code)throw new M("missing-verification-code")}function SS(I,V){return La(I,qM,V).then(function(ue){return ue.phoneResponseInfo.sessionInfo})}function OM(I,V,ue){return La(I,Pte,{idToken:V,deleteProvider:ue})}function Uy(I){if(!I.requestUri||!I.sessionId&&!I.postBody&&!I.pendingToken)throw new M("internal-error")}function _M(I,V){return V.oauthIdToken&&V.providerId&&V.providerId.indexOf("oidc.")==0&&!V.pendingToken&&(I.sessionId?V.nonce=I.sessionId:I.postBody&&(I=new Vg(I.postBody),ms(I,"nonce")&&(V.nonce=I.get("nonce")))),V}function TS(I){var V=null;if(I.needConfirmation?(I.code="account-exists-with-different-credential",V=Iy(I)):I.errorMessage=="FEDERATED_USER_ID_ALREADY_LINKED"?(I.code="credential-already-in-use",V=Iy(I)):I.errorMessage=="EMAIL_EXISTS"?(I.code="email-already-in-use",V=Iy(I)):I.errorMessage&&(V=ZM(I.errorMessage)),V)throw V;Oa(I)}function PS(I,V){return V.returnIdpCredential=!0,La(I,HU,V)}function Q0(I,V){return V.returnIdpCredential=!0,La(I,$M,V)}function VM(I,V){return V.returnIdpCredential=!0,V.autoCreate=!1,La(I,m7,V)}function GM(I){if(!I.oobCode)throw new M("invalid-action-code")}t.ob=function(I,V){return La(this,Ite,{oobCode:I,newPassword:V})},t.Sa=function(I){return La(this,bte,{oobCode:I})},t.kb=function(I){return La(this,bU,{oobCode:I})};var bU={endpoint:"setAccountInfo",A:GM,Z:"email",B:!0},bte={endpoint:"resetPassword",A:GM,G:function(I){var V=I.requestType;if(!V||!I.email&&V!="EMAIL_SIGNIN"&&V!="VERIFY_AND_CHANGE_EMAIL")throw new M("internal-error")},B:!0},SU={endpoint:"signupNewUser",A:function(I){if(Dr(I),!I.password)throw new M("weak-password")},G:Oa,V:!0,B:!0},Ste={endpoint:"createAuthUri",B:!0},Tte={endpoint:"deleteAccount",O:["idToken"]},Pte={endpoint:"setAccountInfo",O:["idToken","deleteProvider"],A:function(I){if(!Array.isArray(I.deleteProvider))throw new M("internal-error")}},jy={endpoint:"emailLinkSignin",O:["email","oobCode"],A:Dr,G:Oa,V:!0,B:!0},$d={endpoint:"emailLinkSignin",O:["idToken","email","oobCode"],A:Dr,G:Oa,V:!0},XM={endpoint:"accounts/mfaEnrollment:finalize",O:["idToken","phoneVerificationInfo"],A:gi,G:Oa,B:!0,Na:!0},Cte={endpoint:"accounts/mfaSignIn:finalize",O:["mfaPendingCredential","phoneVerificationInfo"],A:gi,G:Oa,B:!0,Na:!0},JM={endpoint:"getAccountInfo"},Rte={endpoint:"getOobConfirmationCode",O:["requestType"],A:function(I){if(I.requestType!="EMAIL_SIGNIN")throw new M("internal-error");Dr(I)},Z:"email",B:!0},Hte={endpoint:"getOobConfirmationCode",O:["idToken","requestType"],A:function(I){if(I.requestType!="VERIFY_EMAIL")throw new M("internal-error")},Z:"email",B:!0},g7={endpoint:"getOobConfirmationCode",O:["idToken","newEmail","requestType"],A:function(I){if(I.requestType!="VERIFY_AND_CHANGE_EMAIL")throw new M("internal-error")},Z:"email",B:!0},TU={endpoint:"getOobConfirmationCode",O:["requestType"],A:function(I){if(I.requestType!="PASSWORD_RESET")throw new M("internal-error");Dr(I)},Z:"email",B:!0},PU={mb:!0,endpoint:"getProjectConfig",Vb:"GET"},Mte={mb:!0,endpoint:"getRecaptchaParam",Vb:"GET",G:function(I){if(!I.recaptchaSiteKey)throw new M("internal-error")}},Ite={endpoint:"resetPassword",A:GM,Z:"email",B:!0},zte={endpoint:"sendVerificationCode",O:["phoneNumber","recaptchaToken"],Z:"sessionInfo",B:!0},CU={endpoint:"setAccountInfo",O:["idToken"],A:Qi,V:!0},KM={endpoint:"setAccountInfo",O:["idToken"],A:function(I){if(Qi(I),!I.password)throw new M("weak-password")},G:Oa,V:!0},RU={endpoint:"signupNewUser",G:Oa,V:!0,B:!0},Dte={endpoint:"accounts/mfaEnrollment:start",O:["idToken","phoneEnrollmentInfo"],A:function(I){if(!I.phoneEnrollmentInfo)throw new M("internal-error");if(!I.phoneEnrollmentInfo.phoneNumber)throw new M("missing-phone-number");if(!I.phoneEnrollmentInfo.recaptchaToken)throw new M("missing-app-credential")},G:function(I){if(!I.phoneSessionInfo||!I.phoneSessionInfo.sessionInfo)throw new M("internal-error")},B:!0,Na:!0},qM={endpoint:"accounts/mfaSignIn:start",O:["mfaPendingCredential","mfaEnrollmentId","phoneSignInInfo"],A:function(I){if(!I.phoneSignInInfo||!I.phoneSignInInfo.recaptchaToken)throw new M("missing-app-credential")},G:function(I){if(!I.phoneResponseInfo||!I.phoneResponseInfo.sessionInfo)throw new M("internal-error")},B:!0,Na:!0},HU={endpoint:"verifyAssertion",A:Uy,Za:_M,G:TS,V:!0,B:!0},m7={endpoint:"verifyAssertion",A:Uy,Za:_M,G:function(I){if(I.errorMessage&&I.errorMessage=="USER_NOT_FOUND")throw new M("user-not-found");if(I.errorMessage)throw ZM(I.errorMessage);Oa(I)},V:!0,B:!0},$M={endpoint:"verifyAssertion",A:function(I){if(Uy(I),!I.idToken)throw new M("internal-error")},Za:_M,G:TS,V:!0},MU={endpoint:"verifyCustomToken",A:function(I){if(!I.token)throw new M("invalid-custom-token")},G:Oa,V:!0,B:!0},QM={endpoint:"verifyPassword",A:function(I){if(Dr(I),!I.password)throw new M("wrong-password")},G:Oa,V:!0,B:!0},CS={endpoint:"verifyPhoneNumber",A:Ta,G:Oa,B:!0},IU={endpoint:"verifyPhoneNumber",A:function(I){if(!I.idToken)throw new M("internal-error");Ta(I)},G:function(I){if(I.temporaryProof)throw I.code="credential-already-in-use",Iy(I);Oa(I)}},sm={Ib:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",A:Ta,G:Oa,B:!0},V3={endpoint:"accounts/mfaEnrollment:withdraw",O:["idToken","mfaEnrollmentId"],G:function(I){if(!!I[Zt]^!!I.refreshToken)throw new M("internal-error")},B:!0,Na:!0};function La(I,V,ue){if(!Py(ue,V.O))return bi(new M("internal-error"));var Ce=!!V.Na,_e=V.Vb||"POST",wt;return Eo(ue).then(V.A).then(function(){return V.V&&(ue.returnSecureToken=!0),V.B&&I.b&&typeof ue.tenantId>"u"&&(ue.tenantId=I.b),Ce?xr(I,I.i,V.endpoint,_e,ue,V.Ib,V.mb||!1):xr(I,I.h,V.endpoint,_e,ue,V.Ib,V.mb||!1)}).then(function(Et){return wt=Et,V.Za?V.Za(ue,wt):wt}).then(V.G).then(function(){if(!V.Z)return wt;if(!(V.Z in wt))throw new M("internal-error");return wt[V.Z]})}function ZM(I){return eI({error:{errors:[{message:I}],code:400,message:I}})}function eI(I,V){var ue=(I.error&&I.error.errors&&I.error.errors[0]||{}).reason||"",Ce={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(ue=Ce[ue]?new M(Ce[ue]):null)return ue;ue=I.error&&I.error.message||"",Ce={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_OR_INVALID_NONCE:"missing-or-invalid-nonce",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",INVALID_PROVIDER_ID:"invalid-provider-id",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",REJECTED_CREDENTIAL:"rejected-credential",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_DYNAMIC_LINK_DOMAIN:"invalid-dynamic-link-domain",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash",UNSUPPORTED_TENANT_OPERATION:"unsupported-tenant-operation",INVALID_TENANT_ID:"invalid-tenant-id",TENANT_ID_MISMATCH:"tenant-id-mismatch",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",EMAIL_CHANGE_NEEDS_VERIFICATION:"email-change-needs-verification",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",UNSUPPORTED_FIRST_FACTOR:"unsupported-first-factor",UNVERIFIED_EMAIL:"unverified-email"},De(Ce,V||{}),V=(V=ue.match(/^[^\s]+\s*:\s*([\s\S]*)$/))&&1"u"&&delete cn[ao]}),I.ports[0].postMessage({status:"done",eventId:ue,eventType:V,response:Et})})}};function Lh(I,V,ue){We(I.a)&&I.b.addEventListener("message",I.f),typeof I.a[V]>"u"&&(I.a[V]=[]),I.a[V].push(ue)}function NU(I){this.a=I}NU.prototype.postMessage=function(I,V){this.a.postMessage(I,V)};function UU(I){this.c=I,this.b=!1,this.a=[]}function jU(I,V,ue,Ce){var _e,wt=ue||{},Et,cn,ao,Mo=null;if(I.b)return bi(Error("connection_unavailable"));var Hi=Ce?800:50,bl=typeof MessageChannel<"u"?new MessageChannel:null;return new jo(function(gl,Z0){bl?(_e=Math.floor(Math.random()*Math.pow(10,20)).toString(),bl.port1.start(),cn=setTimeout(function(){Z0(Error("unsupported_event"))},Hi),Et=function(Oy){Oy.data.eventId===_e&&(Oy.data.status==="ack"?(clearTimeout(cn),ao=setTimeout(function(){Z0(Error("timeout"))},3e3)):Oy.data.status==="done"?(clearTimeout(ao),typeof Oy.data.response<"u"?gl(Oy.data.response):Z0(Error("unknown_error"))):(clearTimeout(cn),clearTimeout(ao),Z0(Error("invalid_response"))))},Mo={messageChannel:bl,onMessage:Et},I.a.push(Mo),bl.port1.addEventListener("message",Et),I.c.postMessage({eventType:V,eventId:_e,data:wt},[bl.port2])):Z0(Error("connection_unavailable"))}).then(function(gl){return IS(I,Mo),gl}).o(function(gl){throw IS(I,Mo),gl})}function IS(I,V){if(V){var ue=V.messageChannel,Ce=V.onMessage;ue&&(ue.port1.removeEventListener("message",Ce),ue.port1.close()),Z(I.a,function(_e){return _e==V})}}UU.prototype.close=function(){for(;0"u"&&(Ce=null);var _e=s.localStorage.getItem(ue);_e!==Ce&&(this.b[ue]=_e,this.nb(ue))}else if(V.indexOf("firebase:")==0&&this.a[V]){if(typeof I.a.a<"u"?G3(this,"local").ia(this.f):cI(this),this.m){if(ue=s.localStorage.getItem(V),Ce=I.a.newValue,Ce!==ue)Ce!==null?s.localStorage.setItem(V,Ce):s.localStorage.removeItem(V);else if(this.b[V]===Ce&&typeof I.a.a>"u")return}var wt=this;ue=function(){(typeof I.a.a<"u"||wt.b[V]!==s.localStorage.getItem(V))&&(wt.b[V]=s.localStorage.getItem(V),wt.nb(V))},lt&&mo&&mo==10&&s.localStorage.getItem(V)!==I.a.newValue&&I.a.newValue!==I.a.oldValue?setTimeout(ue,10):ue()}}else te(I,A(this.nb,this))},t.nb=function(I){this.a[I]&&te(this.a[I],function(V){V()})};function ene(I){this.a=I,this.b=x7()}var uI={name:"authEvent",F:"local"};function tne(I){return I.b.get(uI,I.a).then(function(V){return $A(V)})}function nne(){this.a=x7()}function one(){this.b=-1}function ES(I,V){this.b=$U,this.f=s.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=I,this.h=V,this.l=s.Int32Array?new Int32Array(64):Array(64),FS===void 0&&(s.Int32Array?FS=new Int32Array(pI):FS=pI),this.reset()}var FS;S(ES,one);for(var $U=64,rne=$U-1,QU=[],dI=0;dIV;V++){_e=ue[V-15]|0,Ce=ue[V-2]|0;var wt=(ue[V-16]|0)+((_e>>>7|_e<<25)^(_e>>>18|_e<<14)^_e>>>3)|0,Et=(ue[V-7]|0)+((Ce>>>17|Ce<<15)^(Ce>>>19|Ce<<13)^Ce>>>10)|0;ue[V]=wt+Et|0}Ce=I.a[0]|0,_e=I.a[1]|0;var cn=I.a[2]|0,ao=I.a[3]|0,Mo=I.a[4]|0,Hi=I.a[5]|0,bl=I.a[6]|0;for(wt=I.a[7]|0,V=0;64>V;V++){var gl=((Ce>>>2|Ce<<30)^(Ce>>>13|Ce<<19)^(Ce>>>22|Ce<<10))+(Ce&_e^Ce&cn^_e&cn)|0;Et=Mo&Hi^~Mo&bl,wt=wt+((Mo>>>6|Mo<<26)^(Mo>>>11|Mo<<21)^(Mo>>>25|Mo<<7))|0,Et=Et+(FS[V]|0)|0,Et=wt+(Et+(ue[V]|0)|0)|0,wt=bl,bl=Hi,Hi=Mo,Mo=ao+Et|0,ao=cn,cn=_e,_e=Ce,Ce=Et+gl|0}I.a[0]=I.a[0]+Ce|0,I.a[1]=I.a[1]+_e|0,I.a[2]=I.a[2]+cn|0,I.a[3]=I.a[3]+ao|0,I.a[4]=I.a[4]+Mo|0,I.a[5]=I.a[5]+Hi|0,I.a[6]=I.a[6]+bl|0,I.a[7]=I.a[7]+wt|0}function hI(I,V,ue){ue===void 0&&(ue=V.length);var Ce=0,_e=I.c;if(typeof V=="string")for(;Ce=wt&&wt==(wt|0)))throw Error("message must be a byte array");I.f[_e++]=wt,_e==I.b&&(fI(I),_e=0)}else throw Error("message must be string or array");I.c=_e,I.g+=ue}var pI=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function gI(){ES.call(this,8,ine)}S(gI,ES);var ine=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function ej(I,V,ue,Ce,_e,wt){this.v=I,this.i=V,this.l=ue,this.m=Ce||null,this.u=_e||null,this.s=wt,this.h=V+":"+ue,this.C=new nne,this.g=new ene(this.h),this.f=null,this.b=[],this.a=this.c=null}function kS(I){return new M("invalid-cordova-configuration",I)}t=ej.prototype,t.ma=function(){return this.Ia?this.Ia:this.Ia=y5().then(function(){if(typeof Jl("universalLinks.subscribe",s)!="function")throw kS("cordova-universal-links-plugin-fix is not installed");if(typeof Jl("BuildInfo.packageName",s)>"u")throw kS("cordova-plugin-buildinfo is not installed");if(typeof Jl("cordova.plugins.browsertab.openUrl",s)!="function")throw kS("cordova-plugin-browsertab is not installed");if(typeof Jl("cordova.InAppBrowser.open",s)!="function")throw kS("cordova-plugin-inappbrowser is not installed")},function(){throw new M("cordova-not-ready")})};function ane(){for(var I=20,V=[];0V.c?hI(V,ZU,56-V.c):hI(V,ZU,V.b-(V.c-56));for(var Ce=63;56<=Ce;Ce--)V.f[Ce]=ue&255,ue/=256;for(fI(V),Ce=ue=0;Ce>_e&255;return jM(I)}t.Pb=function(I,V){return V(new M("operation-not-supported-in-this-environment")),Eo()},t.Nb=function(){return bi(new M("operation-not-supported-in-this-environment"))},t.ac=function(){return!1},t.Yb=function(){return!0},t.Ub=function(){return!0},t.Ob=function(I,V,ue,Ce){if(this.c)return bi(new M("redirect-operation-pending"));var _e=this,wt=s.document,Et=null,cn=null,ao=null,Mo=null;return this.c=Eo().then(function(){return tm(V),nj(_e)}).then(function(){return lne(_e,I,V,ue,Ce)}).then(function(){return new jo(function(Hi,bl){cn=function(){var gl=Jl("cordova.plugins.browsertab.close",s);return Hi(),typeof gl=="function"&&gl(),_e.a&&typeof _e.a.close=="function"&&(_e.a.close(),_e.a=null),!1},_e.Ea(cn),ao=function(){Et||(Et=Gc(2e3).then(function(){bl(new M("redirect-cancelled-by-user"))}))},Mo=function(){zA()&&ao()},wt.addEventListener("resume",ao,!1),tc().toLowerCase().match(/android/)||wt.addEventListener("visibilitychange",Mo,!1)}).o(function(Hi){return mI(_e).then(function(){throw Hi})})}).oa(function(){ao&&wt.removeEventListener("resume",ao,!1),Mo&&wt.removeEventListener("visibilitychange",Mo,!1),Et&&Et.cancel(),cn&&_e.Ta(cn),_e.c=null})};function lne(I,V,ue,Ce,_e){var wt=ane(),Et=new ql(V,Ce,null,wt,new M("no-auth-event"),null,_e),cn=Jl("BuildInfo.packageName",s);if(typeof cn!="string")throw new M("invalid-cordova-configuration");var ao=Jl("BuildInfo.displayName",s),Mo={};if(tc().toLowerCase().match(/iphone|ipad|ipod/))Mo.ibi=cn;else if(tc().toLowerCase().match(/android/))Mo.apn=cn;else return bi(new M("operation-not-supported-in-this-environment"));ao&&(Mo.appDisplayName=ao),wt=LS(wt),Mo.sessionId=wt;var Hi=a4(I.v,I.i,I.l,V,ue,null,Ce,I.m,Mo,I.u,_e,I.s);return I.ma().then(function(){var bl=I.h;return I.C.a.set(uI,Et.w(),bl)}).then(function(){var bl=Jl("cordova.plugins.browsertab.isAvailable",s);if(typeof bl!="function")throw new M("invalid-cordova-configuration");var gl=null;bl(function(Z0){if(Z0){if(gl=Jl("cordova.plugins.browsertab.openUrl",s),typeof gl!="function")throw new M("invalid-cordova-configuration");gl(Hi)}else{if(gl=Jl("cordova.InAppBrowser.open",s),typeof gl!="function")throw new M("invalid-cordova-configuration");Z0=tc(),I.a=gl(Hi,Z0.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||Z0.match(/(iPad|iPhone|iPod).*OS 8_\d/i)?"_blank":"_system","location=yes")}})})}function tj(I,V){for(var ue=0;ueI.f&&(I.a=I.f),V)}function RI(I,V){I.stop(),I.b=Gc(Ane(I,V)).then(function(){return n7()}).then(function(){return I.h()}).then(function(){RI(I,!0)}).o(function(ue){I.i(ue)&&RI(I,!1)})}CI.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)};function C7(I){this.f=I,this.b=this.a=null,this.c=Date.now()}C7.prototype.w=function(){return{apiKey:this.f.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:this.c}};function gj(I,V){typeof V>"u"&&(I.b?(V=I.b,V=V.a-V.g):V=0),I.c=Date.now()+1e3*V}function um(I,V){I.b=H5(V[Zt]||""),I.a=V.refreshToken,V=V.expiresIn,gj(I,typeof V<"u"?Number(V):void 0)}function mj(I,V){I.b=V.b,I.a=V.a,I.c=V.c}function BS(I,V){return _n(I.f,V).then(function(ue){return I.b=H5(ue.access_token),I.a=ue.refresh_token,gj(I,ue.expires_in),{accessToken:I.b.toString(),refreshToken:I.a}}).o(function(ue){throw ue.code=="auth/user-token-expired"&&(I.a=null),ue})}C7.prototype.getToken=function(I){return I=!!I,this.b&&!this.a?bi(new M("user-token-expired")):I||!this.b||Date.now()>this.c-3e4?this.a?BS(this,{grant_type:"refresh_token",refresh_token:this.a}):Eo(null):Eo({accessToken:this.b.toString(),refreshToken:this.a})};function As(I,V){this.a=I||null,this.b=V||null,qc(this,{lastSignInTime:H3(V||null),creationTime:H3(I||null)})}function Ec(I){return new As(I.a,I.b)}As.prototype.w=function(){return{lastLoginAt:this.b,createdAt:this.a}};function yj(I,V,ue,Ce,_e,wt){qc(this,{uid:I,displayName:Ce||null,photoURL:_e||null,email:ue||null,phoneNumber:wt||null,providerId:V})}function Wh(I,V,ue){this.N=[],this.l=I.apiKey,this.m=I.appName,this.s=I.authDomain||null;var Ce=$n.SDK_VERSION?Jg($n.SDK_VERSION):null;this.a=new Ge(this.l,L(k),Ce),(this.u=I.emulatorConfig||null)&&Gr(this.a,this.u),this.h=new C7(this.a),_S(this,V[Zt]),um(this.h,V),Hr(this,"refreshToken",this.h.a),Aj(this,ue||{}),Xl.call(this),this.P=!1,this.s&&td()&&(this.b=c4(this.s,this.l,this.m,this.u)),this.W=[],this.i=null,this.D=H7(this),this.ba=A(this.ib,this);var _e=this;this.za=null,this.Pa=function(wt){_e.xa(wt.h)},this.qa=null,this.Ba=function(wt){HI(_e,wt.c)},this.$=null,this.aa=[],this.Oa=function(wt){R7(_e,wt.f)},this.ja=null,this.S=new cm(this,ue),Hr(this,"multiFactor",this.S)}S(Wh,Xl),Wh.prototype.xa=function(I){this.za=I,zi(this.a,I)};function HI(I,V){I.u=V,Gr(I.a,V),I.b&&(V=I.b,I.b=c4(I.s,I.l,I.m,I.u),I.P&&(T7(V,I),S7(I.b,I)))}Wh.prototype.la=function(){return this.za};function MI(I,V){I.qa&&Or(I.qa,"languageCodeChanged",I.Pa),(I.qa=V)&&qn(V,"languageCodeChanged",I.Pa)}function II(I,V){I.$&&Or(I.$,"emulatorConfigChanged",I.Ba),(I.$=V)&&qn(V,"emulatorConfigChanged",I.Ba)}function R7(I,V){I.aa=V,_r(I.a,$n.SDK_VERSION?Jg($n.SDK_VERSION,I.aa):null)}Wh.prototype.Ga=function(){return xe(this.aa)};function zI(I,V){I.ja&&Or(I.ja,"frameworkChanged",I.Oa),(I.ja=V)&&qn(V,"frameworkChanged",I.Oa)}Wh.prototype.ib=function(){this.D.b&&(this.D.stop(),this.D.start())};function YS(I){try{return $n.app(I.m).auth()}catch{throw new M("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+I.m+"'!")}}function H7(I){return new CI(function(){return I.I(!0)},function(V){return!!(V&&V.code=="auth/network-request-failed")},function(){var V=I.h.c-Date.now()-3e5;return 0"u"||We(I)?{}:OA(new xu(I))}).then(function(Ce){return V.a.vb(ue,Ce)}).then(function(Ce){if(V.email!=Ce)return V.reload()}).then(function(){}))},t.Fb=function(I,V){var ue=this,Ce=null;return C0(this,this.I().then(function(_e){return Ce=_e,typeof V>"u"||We(V)?{}:OA(new xu(V))}).then(function(_e){return ue.a.Fb(Ce,I,_e)}).then(function(_e){if(ue.email!=_e)return ue.reload()}).then(function(){}))};function C0(I,V,ue){var Ce=vne(I,V,ue);return I.N.push(Ce),Ce.oa(function(){de(I.N,Ce)}),Ce.o(function(_e){var wt=null;throw _e&&_e.code==="auth/multi-factor-auth-required"&&(wt=pj(_e.w(),YS(I),A(I.jc,I))),wt||_e})}t.jc=function(I){var V=null,ue=this;return I=Ry(Eo(I),ue.uid).then(function(Ce){return V=M7(ue,Ce,"reauthenticate"),$c(ue,Ce),ue.i=null,ue.reload()}).then(function(){return V}),C0(this,I,!0)};function vne(I,V,ue){return I.i&&!ue?(V.cancel(),bi(I.i)):V.o(function(Ce){throw!Ce||Ce.code!="auth/user-disabled"&&Ce.code!="auth/user-token-expired"||(I.i||I.dispatchEvent(new d4("userInvalidated")),I.i=Ce),Ce})}t.toJSON=function(){return this.w()},t.w=function(){var I={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,tenantId:this.tenantId,providerData:[],apiKey:this.l,appName:this.m,authDomain:this.s,stsTokenManager:this.h.w(),redirectEventId:this.ga||null};return this.metadata&&De(I,this.metadata.w()),te(this.providerData,function(V){I.providerData.push(C5(V))}),De(I,this.S.w()),I};function Sj(I){if(!I.apiKey)return null;var V={apiKey:I.apiKey,authDomain:I.authDomain,appName:I.appName,emulatorConfig:I.emulatorConfig},ue={};if(I.stsTokenManager&&I.stsTokenManager.accessToken){ue[Zt]=I.stsTokenManager.accessToken,ue.refreshToken=I.stsTokenManager.refreshToken||null;var Ce=I.stsTokenManager.expirationTime;Ce&&(ue.expiresIn=(Ce-Date.now())/1e3)}else return null;var _e=new Wh(V,ue,I);return I.providerData&&te(I.providerData,function(wt){wt&&kI(_e,kf(wt))}),I.redirectEventId&&(_e.ga=I.redirectEventId),_e}function xne(I,V,ue,Ce){var _e=new Wh(I,V);return ue&&(_e.ha=ue),Ce&&R7(_e,Ce),_e.reload().then(function(){return _e})}function bne(I,V,ue,Ce){var _e=I.h,wt={};return wt[Zt]=_e.b&&_e.b.toString(),wt.refreshToken=_e.a,V=new Wh(V||{apiKey:I.l,authDomain:I.s,appName:I.m},wt),ue&&(V.ha=ue),Ce&&R7(V,Ce),Gi(V,I),V}function Sne(I){this.a=I,this.b=x7()}var NI={name:"redirectUser",F:"session"};function Tj(I){return By(I.b,NI,I.a)}function Tne(I,V){return I.b.get(NI,I.a).then(function(ue){return ue&&V&&(ue.authDomain=V),Sj(ue||{})})}function UI(I){this.a=I,this.b=x7(),this.c=null,this.f=BI(this),this.b.addListener(Ip("local"),this.a,A(this.g,this))}UI.prototype.g=function(){var I=this,V=Ip("local");H0(this,function(){return Eo().then(function(){return I.c&&I.c.F!="local"?I.b.get(V,I.a):null}).then(function(ue){if(ue)return jI(I,"local").then(function(){I.c=V})})})};function jI(I,V){var ue=[],Ce;for(Ce in s4)s4[Ce]!==V&&ue.push(By(I.b,Ip(s4[Ce]),I.a));return ue.push(By(I.b,YI,I.a)),nr(ue)}function BI(I){var V=Ip("local"),ue=Ip("session"),Ce=Ip("none");return Qte(I.b,V,I.a).then(function(){return I.b.get(ue,I.a)}).then(function(_e){return _e?ue:I.b.get(Ce,I.a).then(function(wt){return wt?Ce:I.b.get(V,I.a).then(function(Et){return Et?V:I.b.get(YI,I.a).then(function(cn){return cn?Ip(cn):V})})})}).then(function(_e){return I.c=_e,jI(I,_e.F)}).o(function(){I.c||(I.c=V)})}var YI={name:"persistence",F:"session"};function Ip(I){return{name:"authUser",F:I}}UI.prototype.yb=function(I){var V=null,ue=this;return $te(I),H0(this,function(){return I!=ue.c.F?ue.b.get(ue.c,ue.a).then(function(Ce){return V=Ce,jI(ue,I)}).then(function(){if(ue.c=Ip(I),V)return ue.b.set(ue.c,V,ue.a)}):Eo()})};function Pne(I){return H0(I,function(){return I.b.set(YI,I.c.F,I.a)})}function Pj(I,V){return H0(I,function(){return I.b.set(I.c,V.w(),I.a)})}function Cj(I){return H0(I,function(){return By(I.b,I.c,I.a)})}function R0(I,V,ue){return H0(I,function(){return I.b.get(I.c,I.a).then(function(Ce){return Ce&&V&&(Ce.authDomain=V),Ce&&ue&&(Ce.emulatorConfig=ue),Sj(Ce||{})})})}function H0(I,V){return I.f=I.f.then(V,V),I.f}function I1(I){if(this.l=!1,Hr(this,"settings",new fj),Hr(this,"app",I),$l(this).options&&$l(this).options.apiKey)I=$n.SDK_VERSION?Jg($n.SDK_VERSION):null,this.a=new Ge($l(this).options&&$l(this).options.apiKey,L(k),I);else throw new M("invalid-api-key");this.P=[],this.s=[],this.N=[],this.Pa=$n.INTERNAL.createSubscribe(A(this.zc,this)),this.W=void 0,this.ib=$n.INTERNAL.createSubscribe(A(this.Ac,this)),f4(this,null),this.i=new UI($l(this).options.apiKey+":"+$l(this).name),this.D=new Sne($l(this).options.apiKey+":"+$l(this).name),this.$=Fc(this,Dj(this)),this.h=Fc(this,Mne(this)),this.ba=!1,this.ja=A(this.Zc,this),this.Ba=A(this.da,this),this.qa=A(this.mc,this),this.za=A(this.wc,this),this.Aa=A(this.xc,this),this.b=null,Mj(this),this.INTERNAL={},this.INTERNAL.delete=A(this.delete,this),this.INTERNAL.logFramework=A(this.Gc,this),this.u=0,Xl.call(this),Rne(this),this.J=[],this.R=null}S(I1,Xl);function Rj(I){Lt.call(this,"languageCodeChanged"),this.h=I}S(Rj,Lt);function Hj(I){Lt.call(this,"emulatorConfigChanged"),this.c=I}S(Hj,Lt);function OI(I){Lt.call(this,"frameworkChanged"),this.f=I}S(OI,Lt),t=I1.prototype,t.yb=function(I){return I=this.i.yb(I),Fc(this,I)},t.xa=function(I){this.aa===I||this.l||(this.aa=I,zi(this.a,this.aa),this.dispatchEvent(new Rj(this.la())))},t.la=function(){return this.aa},t.fd=function(){var I=s.navigator;this.xa(I&&(I.languages&&I.languages[0]||I.language||I.userLanguage)||null)},t.gd=function(I,V){if(!this.R){if(!/^https?:\/\//.test(I))throw new M("argument-error","Emulator URL must start with a valid scheme (http:// or https://).");V=V?!!V.disableWarnings:!1,Cne(V),this.R={url:I,ec:V},this.settings.jb=!0,Gr(this.a,this.R),this.dispatchEvent(new Hj(this.R))}};function Cne(I){typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),s.document&&!I&&Ws().then(function(){var V=s.document.createElement("div");V.innerText="Running in emulator mode. Do not use with production credentials.",V.style.position="fixed",V.style.width="100%",V.style.backgroundColor="#ffffff",V.style.border=".1em solid #000000",V.style.color="#b50000",V.style.bottom="0px",V.style.left="0px",V.style.margin="0px",V.style.zIndex=1e4,V.style.textAlign="center",V.classList.add("firebase-emulator-warning"),s.document.body.appendChild(V)})}t.Gc=function(I){this.J.push(I),_r(this.a,$n.SDK_VERSION?Jg($n.SDK_VERSION,this.J):null),this.dispatchEvent(new OI(this.J))},t.Ga=function(){return xe(this.J)},t.zb=function(I){this.S===I||this.l||(this.S=I,this.a.b=this.S)},t.T=function(){return this.S};function Rne(I){Object.defineProperty(I,"lc",{get:function(){return this.la()},set:function(V){this.xa(V)},enumerable:!1}),I.aa=null,Object.defineProperty(I,"ti",{get:function(){return this.T()},set:function(V){this.zb(V)},enumerable:!1}),I.S=null,Object.defineProperty(I,"emulatorConfig",{get:function(){if(this.R){var V=wu(this.R.url);V=kf({protocol:V.c,host:V.a,port:V.g,options:kf({disableWarnings:this.R.ec})})}else V=null;return V},enumerable:!1})}t.toJSON=function(){return{apiKey:$l(this).options.apiKey,authDomain:$l(this).options.authDomain,appName:$l(this).name,currentUser:aa(this)&&aa(this).w()}};function _I(I){return I.Oa||bi(new M("auth-domain-config-required"))}function Mj(I){var V=$l(I).options.authDomain,ue=$l(I).options.apiKey;V&&td()&&(I.Oa=I.$.then(function(){if(!I.l){if(I.b=c4(V,ue,$l(I).name,I.R),S7(I.b,I),aa(I)&&dm(aa(I)),I.m){dm(I.m);var Ce=I.m;Ce.xa(I.la()),MI(Ce,I),Ce=I.m,R7(Ce,I.J),zI(Ce,I),Ce=I.m,HI(Ce,I.R),II(Ce,I),I.m=null}return I.b}}))}t.Gb=function(I,V){switch(I){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==V&&!!this.f;default:return!1}},t.na=function(I,V,ue,Ce){I=="signInViaPopup"&&this.g==Ce&&(ue&&this.C?this.C(ue):V&&!ue&&this.f&&this.f(V),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.C)},t.Fa=function(I,V){return I=="signInViaRedirect"||I=="signInViaPopup"&&this.g==V&&this.f?A(this.ic,this):null},t.ic=function(I,V,ue,Ce){var _e=this,wt={requestUri:I,postBody:Ce,sessionId:V,tenantId:ue};return this.c&&(this.c.cancel(),this.c=null),_e.$.then(function(){return K3(_e,PS(_e.a,wt))})},t.Xc=function(I){if(!td())return bi(new M("operation-not-supported-in-this-environment"));var V=this,ue=E3(I.providerId),Ce=Kg(),_e=null;(!nd()||R3())&&$l(this).options.authDomain&&I.isOAuthProvider&&(_e=a4($l(this).options.authDomain,$l(this).options.apiKey,$l(this).name,"signInViaPopup",I,null,Ce,$n.SDK_VERSION||null,null,null,this.T(),this.R));var wt=G0(_e,ue&&ue.va,ue&&ue.ua);return ue=_I(this).then(function(Et){return vI(Et,wt,"signInViaPopup",I,Ce,!!_e,V.T())}).then(function(){return new jo(function(Et,cn){V.na("signInViaPopup",null,new M("cancelled-popup-request"),V.g),V.f=Et,V.C=cn,V.g=Ce,V.c=lj(V.b,V,"signInViaPopup",wt,Ce)})}).then(function(Et){return wt&&ys(wt),Et?kf(Et):null}).o(function(Et){throw wt&&ys(wt),Et}),Fc(this,ue)},t.Yc=function(I){if(!td())return bi(new M("operation-not-supported-in-this-environment"));var V=this,ue=_I(this).then(function(){return Pne(V.i)}).then(function(){return aj(V.b,"signInViaRedirect",I,void 0,V.T())});return Fc(this,ue)};function Ij(I){if(!td())return bi(new M("operation-not-supported-in-this-environment"));var V=_I(I).then(function(){return I.b.ra()}).then(function(ue){return ue?kf(ue):null});return Fc(I,V)}t.ra=function(){var I=this;return Ij(this).then(function(V){return I.b&&u4(I.b.b),V}).o(function(V){throw I.b&&u4(I.b.b),V})},t.dd=function(I){if(!I)return bi(new M("null-user"));if(this.S!=I.tenantId)return bi(new M("tenant-id-mismatch"));var V=this,ue={};ue.apiKey=$l(this).options.apiKey,ue.authDomain=$l(this).options.authDomain,ue.appName=$l(this).name;var Ce=bne(I,ue,V.D,V.Ga());return Fc(this,this.h.then(function(){if($l(V).options.apiKey!=I.l)return Ce.reload()}).then(function(){return aa(V)&&I.uid==aa(V).uid?(Gi(aa(V),I),V.da(I)):(f4(V,Ce),dm(Ce),V.da(Ce))}).then(function(){z7(V)}))};function Hne(I,V){var ue={};return ue.apiKey=$l(I).options.apiKey,ue.authDomain=$l(I).options.authDomain,ue.appName=$l(I).name,I.R&&(ue.emulatorConfig=I.R),I.$.then(function(){return xne(ue,V,I.D,I.Ga())}).then(function(Ce){return aa(I)&&Ce.uid==aa(I).uid?(Gi(aa(I),Ce),I.da(Ce)):(f4(I,Ce),dm(Ce),I.da(Ce))}).then(function(){z7(I)})}function f4(I,V){aa(I)&&(VS(aa(I),I.Ba),Or(aa(I),"tokenChanged",I.qa),Or(aa(I),"userDeleted",I.za),Or(aa(I),"userInvalidated",I.Aa),DI(aa(I))),V&&(V.W.push(I.Ba),qn(V,"tokenChanged",I.qa),qn(V,"userDeleted",I.za),qn(V,"userInvalidated",I.Aa),0this.u&&(this.u=0),this.u==0&&aa(this)&&DI(aa(this)),this.removeAuthTokenListener(I)},t.addAuthTokenListener=function(I){var V=this;this.s.push(I),Fc(this,this.h.then(function(){V.l||ge(V.s,I)&&I(Yy(V))}))},t.removeAuthTokenListener=function(I){Z(this.s,function(V){return V==I})};function Ine(I,V){I.N.push(V),Fc(I,I.h.then(function(){!I.l&&ge(I.N,V)&&I.W!==I.getUid()&&(I.W=I.getUid(),V(Yy(I)))}))}t.delete=function(){this.l=!0;for(var I=0;I"u"||We(V)?{}:OA(new xu(V))}).then(function(Ce){return ue.a.wb(I,Ce)}).then(function(){}))},t.Wc=function(I,V){return Fc(this,SI(this,I,V,A(this.ab,this)))},t.Vc=function(I,V){var ue=this;return Fc(this,Eo().then(function(){var Ce=V||ui(),_e=js(I,Ce);if(Ce=Su(Ce),!Ce)throw new M("argument-error","Invalid email link!");if(Ce.tenantId!==ue.T())throw new M("tenant-id-mismatch");return ue.ab(_e)}))};function D7(){}D7.prototype.render=function(){},D7.prototype.reset=function(){},D7.prototype.getResponse=function(){},D7.prototype.execute=function(){};function h4(){this.a={},this.b=1e12}var XS=null;h4.prototype.render=function(I,V){return this.a[this.b.toString()]=new KS(I,V),this.b++},h4.prototype.reset=function(I){var V=JS(this,I);I=Ej(I),V&&I&&(V.delete(),delete this.a[I])},h4.prototype.getResponse=function(I){return(I=JS(this,I))?I.getResponse():null},h4.prototype.execute=function(I){(I=JS(this,I))&&I.execute()};function JS(I,V){return(V=Ej(V))&&I.a[V]||null}function Ej(I){return(I=typeof I>"u"?1e12:I)?I.toString():null}function KS(I,V){this.g=!1,this.c=V,this.a=this.b=null,this.h=this.c.size!=="invisible",this.f=uo(I);var ue=this;this.i=function(){ue.execute()},this.h?this.execute():qn(this.f,"click",this.i)}KS.prototype.getResponse=function(){return VI(this),this.b},KS.prototype.execute=function(){VI(this);var I=this;this.a||(this.a=setTimeout(function(){I.b=IA();var V=I.c.callback,ue=I.c["expired-callback"];if(V)try{V(I.b)}catch{}I.a=setTimeout(function(){if(I.a=null,I.b=null,ue)try{ue()}catch{}I.h&&I.execute()},6e4)},500))},KS.prototype.delete=function(){VI(this),this.g=!0,clearTimeout(this.a),this.a=null,Or(this.f,"click",this.i)};function VI(I){if(I.g)throw Error("reCAPTCHA mock was already deleted!")}function GI(){}Hr(GI,"FACTOR_ID","phone");function XI(){}XI.prototype.g=function(){return XS||(XS=new h4),Eo(XS)},XI.prototype.c=function(){};var JI=null;function KI(){this.b=s.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var zne=new Ye(yt,"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),Dne=new Ff(3e4,6e4);KI.prototype.g=function(I){var V=this;return new jo(function(ue,Ce){var _e=setTimeout(function(){Ce(new M("network-request-failed"))},Dne.get());if(!s.grecaptcha||I!==V.f&&!V.b){s[V.a]=function(){if(s.grecaptcha){V.f=I;var Et=s.grecaptcha.render;s.grecaptcha.render=function(cn,ao){return cn=Et(cn,ao),V.b++,cn},clearTimeout(_e),ue(s.grecaptcha)}else clearTimeout(_e),Ce(new M("internal-error"));delete s[V.a]};var wt=ot(zne,{onload:V.a,hl:I||""});Eo(O3(wt)).o(function(){clearTimeout(_e),Ce(new M("internal-error","Unable to load external reCAPTCHA dependencies!"))})}else clearTimeout(_e),ue(s.grecaptcha)})},KI.prototype.c=function(){this.b--};var qI=null;function $I(I,V,ue,Ce,_e,wt,Et){if(Hr(this,"type","recaptcha"),this.c=this.f=null,this.J=!1,this.v=V,this.g=null,Et?(JI||(JI=new XI),Et=JI):(qI||(qI=new KI),Et=qI),this.m=Et,this.a=ue||{theme:"light",type:"image"},this.h=[],this.a[Lj])throw new M("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i=this.a[Ene]==="invisible",!s.document)throw new M("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!uo(V)||!this.i&&uo(V).hasChildNodes())throw new M("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.s=new Ge(I,wt||null,_e||null),this.u=Ce||function(){return null};var cn=this;this.l=[];var ao=this.a[Fj];this.a[Fj]=function(Hi){if(Wj(cn,Hi),typeof ao=="function")ao(Hi);else if(typeof ao=="string"){var bl=Jl(ao,s);typeof bl=="function"&&bl(Hi)}};var Mo=this.a[kj];this.a[kj]=function(){if(Wj(cn,null),typeof Mo=="function")Mo();else if(typeof Mo=="string"){var Hi=Jl(Mo,s);typeof Hi=="function"&&Hi()}}}var Fj="callback",kj="expired-callback",Lj="sitekey",Ene="size";function Wj(I,V){for(var ue=0;ue_e||_e>=Uj.length)throw new M("internal-error","Argument validator received an unsupported number of arguments.");ue=Uj[_e],Ce=(Ce?"":ue+" argument ")+(V.name?'"'+V.name+'" ':"")+"must be "+V.K+".";break e}Ce=null}}if(Ce)throw new M("argument-error",I+" failed: "+Ce)}var Uj="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function Nr(I,V){return{name:I||"",K:"a valid string",optional:!!V,M:function(ue){return typeof ue=="string"}}}function ez(I,V){return{name:I||"",K:"a boolean",optional:!!V,M:function(ue){return typeof ue=="boolean"}}}function c0(I,V){return{name:I||"",K:"a valid object",optional:!!V,M:w}}function Y5(I,V){return{name:I||"",K:"a function",optional:!!V,M:function(ue){return typeof ue=="function"}}}function z1(I,V){return{name:I||"",K:"null",optional:!!V,M:function(ue){return ue===null}}}function jj(){return{name:"",K:"an HTML element",optional:!1,M:function(I){return!!(I&&I instanceof Element)}}}function kne(){return{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(I){return!!(I&&I instanceof I1)}}}function Lne(){return{name:"app",K:"an instance of Firebase App",optional:!0,M:function(I){return!!(I&&I instanceof $n.app.App)}}}function O5(I){return{name:I?I+"Credential":"credential",K:I?"a valid "+I+" credential":"a valid credential",optional:!1,M:function(V){if(!V)return!1;var ue=!I||V.providerId===I;return!(!V.ka||!ue)}}}function $S(){return{name:"multiFactorAssertion",K:"a valid multiFactorAssertion",optional:!1,M:function(I){return I?!!I.tb:!1}}}function p4(){return{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(I){return!!(I&&I.providerId&&I.hasOwnProperty&&I.hasOwnProperty("isOAuthProvider"))}}}function tz(I,V){return w(I)&&typeof I.type=="string"&&I.type===V&&typeof I.Ha=="function"}function Bj(I){return w(I)&&typeof I.uid=="string"}function Pu(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(I){return!(!I||typeof I.type!="string"||typeof I.verify!="function")}}}function rc(I,V,ue,Ce){return{name:ue||"",K:I.K+" or "+V.K,optional:!!Ce,M:function(_e){return I.M(_e)||V.M(_e)}}}function ic(I,V){for(var ue in V){var Ce=V[ue].name;I[Ce]=Oj(Ce,I[ue],V[ue].j)}}function Yj(I,V){for(var ue in V){var Ce=V[ue].name;Ce!==ue&&Object.defineProperty(I,Ce,{get:x(function(_e){return this[_e]},ue),set:x(function(_e,wt,Et,cn){Nj(_e,[Et],[cn],!0),this[wt]=cn},Ce,ue,V[ue].lb),enumerable:!0})}}function Qc(I,V,ue,Ce){I[V]=Oj(V,ue,Ce)}function Oj(I,V,ue){function Ce(){var Et=Array.prototype.slice.call(arguments);return Nj(_e,ue,Et),V.apply(this,Et)}if(!ue)return V;var _e=nz(I),wt;for(wt in V)Ce[wt]=V[wt];for(wt in V.prototype)Ce.prototype[wt]=V.prototype[wt];return Ce}function nz(I){return I=I.split("."),I[I.length-1]}ic(I1.prototype,{kb:{name:"applyActionCode",j:[Nr("code")]},Sa:{name:"checkActionCode",j:[Nr("code")]},ob:{name:"confirmPasswordReset",j:[Nr("code"),Nr("newPassword")]},dc:{name:"createUserWithEmailAndPassword",j:[Nr("email"),Nr("password")]},hc:{name:"fetchSignInMethodsForEmail",j:[Nr("email")]},ra:{name:"getRedirectResult",j:[]},Bc:{name:"isSignInWithEmailLink",j:[Nr("emailLink")]},Hc:{name:"onAuthStateChanged",j:[rc(c0(),Y5(),"nextOrObserver"),Y5("opt_error",!0),Y5("opt_completed",!0)]},Ic:{name:"onIdTokenChanged",j:[rc(c0(),Y5(),"nextOrObserver"),Y5("opt_error",!0),Y5("opt_completed",!0)]},wb:{name:"sendPasswordResetEmail",j:[Nr("email"),rc(c0("opt_actionCodeSettings",!0),z1(null,!0),"opt_actionCodeSettings",!0)]},xb:{name:"sendSignInLinkToEmail",j:[Nr("email"),c0("actionCodeSettings")]},yb:{name:"setPersistence",j:[Nr("persistence")]},Sc:{name:"signInAndRetrieveDataWithCredential",j:[O5()]},Ab:{name:"signInAnonymously",j:[]},ab:{name:"signInWithCredential",j:[O5()]},Tc:{name:"signInWithCustomToken",j:[Nr("token")]},Uc:{name:"signInWithEmailAndPassword",j:[Nr("email"),Nr("password")]},Vc:{name:"signInWithEmailLink",j:[Nr("email"),Nr("emailLink",!0)]},Wc:{name:"signInWithPhoneNumber",j:[Nr("phoneNumber"),Pu()]},Xc:{name:"signInWithPopup",j:[p4()]},Yc:{name:"signInWithRedirect",j:[p4()]},dd:{name:"updateCurrentUser",j:[rc(function(I){return{name:"user",K:"an instance of Firebase User",optional:!!I,M:function(V){return!!(V&&V instanceof Wh)}}}(),z1(),"user")]},Bb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[Nr(null,!0)]},fd:{name:"useDeviceLanguage",j:[]},gd:{name:"useEmulator",j:[Nr("url"),c0("options",!0)]},jd:{name:"verifyPasswordResetCode",j:[Nr("code")]}}),Yj(I1.prototype,{lc:{name:"languageCode",lb:rc(Nr(),z1(),"languageCode")},ti:{name:"tenantId",lb:rc(Nr(),z1(),"tenantId")}}),I1.Persistence=s4,I1.Persistence.LOCAL="local",I1.Persistence.SESSION="session",I1.Persistence.NONE="none",ic(Wh.prototype,{delete:{name:"delete",j:[]},oc:{name:"getIdTokenResult",j:[ez("opt_forceRefresh",!0)]},I:{name:"getIdToken",j:[ez("opt_forceRefresh",!0)]},Cc:{name:"linkAndRetrieveDataWithCredential",j:[O5()]},rb:{name:"linkWithCredential",j:[O5()]},Dc:{name:"linkWithPhoneNumber",j:[Nr("phoneNumber"),Pu()]},Ec:{name:"linkWithPopup",j:[p4()]},Fc:{name:"linkWithRedirect",j:[p4()]},Lc:{name:"reauthenticateAndRetrieveDataWithCredential",j:[O5()]},ub:{name:"reauthenticateWithCredential",j:[O5()]},Mc:{name:"reauthenticateWithPhoneNumber",j:[Nr("phoneNumber"),Pu()]},Nc:{name:"reauthenticateWithPopup",j:[p4()]},Oc:{name:"reauthenticateWithRedirect",j:[p4()]},reload:{name:"reload",j:[]},vb:{name:"sendEmailVerification",j:[rc(c0("opt_actionCodeSettings",!0),z1(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[Nr(null,!0)]},cd:{name:"unlink",j:[Nr("provider")]},Cb:{name:"updateEmail",j:[Nr("email")]},Db:{name:"updatePassword",j:[Nr("password")]},ed:{name:"updatePhoneNumber",j:[O5("phone")]},Eb:{name:"updateProfile",j:[c0("profile")]},Fb:{name:"verifyBeforeUpdateEmail",j:[Nr("email"),rc(c0("opt_actionCodeSettings",!0),z1(null,!0),"opt_actionCodeSettings",!0)]}}),ic(h4.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),ic(D7.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),ic(jo.prototype,{oa:{name:"finally"},o:{name:"catch"},then:{name:"then"}}),Yj(fj.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",lb:ez("appVerificationDisabledForTesting")}}),ic(bI.prototype,{confirm:{name:"confirm",j:[Nr("verificationCode")]}}),Qc(Pp,"fromJSON",function(I){I=typeof I=="string"?JSON.parse(I):I;for(var V,ue=[D5,zc,nc,z5],Ce=0;Ce=0,i=!n&&r&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return i?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(o=this.toRgbString()),e==="prgb"&&(o=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(o=this.toHexString()),e==="hex3"&&(o=this.toHexString(!0)),e==="hex4"&&(o=this.toHex8String(!0)),e==="hex8"&&(o=this.toHex8String()),e==="name"&&(o=this.toName()),e==="hsl"&&(o=this.toHslString()),e==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},clone:function(){return ti(this.toString())},_applyModification:function(e,n){var o=e.apply(null,[this].concat([].slice.call(n)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(Lso,arguments)},brighten:function(){return this._applyModification(Wso,arguments)},darken:function(){return this._applyModification(Nso,arguments)},desaturate:function(){return this._applyModification(Eso,arguments)},saturate:function(){return this._applyModification(Fso,arguments)},greyscale:function(){return this._applyModification(kso,arguments)},spin:function(){return this._applyModification(Uso,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(Yso,arguments)},complement:function(){return this._applyCombination(jso,arguments)},monochromatic:function(){return this._applyCombination(Oso,arguments)},splitcomplement:function(){return this._applyCombination(Bso,arguments)},triad:function(){return this._applyCombination(eHe,[3])},tetrad:function(){return this._applyCombination(eHe,[4])}};ti.fromRatio=function(t,e){if(iJ(t)=="object"){var n={};for(var o in t)t.hasOwnProperty(o)&&(o==="a"?n[o]=t[o]:n[o]=YD(t[o]));t=n}return ti(t,e)};function Hso(t){var e={r:0,g:0,b:0},n=1,o=null,r=null,i=null,a=!1,l=!1;return typeof t=="string"&&(t=Jso(t)),iJ(t)=="object"&&(s6(t.r)&&s6(t.g)&&s6(t.b)?(e=Mso(t.r,t.g,t.b),a=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):s6(t.h)&&s6(t.s)&&s6(t.v)?(o=YD(t.s),r=YD(t.v),e=zso(t.h,o,r),a=!0,l="hsv"):s6(t.h)&&s6(t.s)&&s6(t.l)&&(o=YD(t.s),i=YD(t.l),e=Iso(t.h,o,i),a=!0,l="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=irt(n),{ok:a,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}function Mso(t,e,n){return{r:Nc(t,255)*255,g:Nc(e,255)*255,b:Nc(n,255)*255}}function qRe(t,e,n){t=Nc(t,255),e=Nc(e,255),n=Nc(n,255);var o=Math.max(t,e,n),r=Math.min(t,e,n),i,a,l=(o+r)/2;if(o==r)i=a=0;else{var s=o-r;switch(a=l>.5?s/(2-o-r):s/(o+r),o){case t:i=(e-n)/s+(e1&&(d-=1),d<1/6?c+(u-c)*6*d:d<1/2?u:d<2/3?c+(u-c)*(2/3-d)*6:c}if(e===0)o=r=i=n;else{var l=n<.5?n*(1+e):n+e-n*e,s=2*n-l;o=a(s,l,t+1/3),r=a(s,l,t),i=a(s,l,t-1/3)}return{r:o*255,g:r*255,b:i*255}}function $Re(t,e,n){t=Nc(t,255),e=Nc(e,255),n=Nc(n,255);var o=Math.max(t,e,n),r=Math.min(t,e,n),i,a,l=o,s=o-r;if(a=o===0?0:s/o,o==r)i=0;else{switch(o){case t:i=(e-n)/s+(e>1)+720)%360;--e;)o.h=(o.h+r)%360,i.push(ti(o));return i}function Oso(t,e){e=e||6;for(var n=ti(t).toHsv(),o=n.h,r=n.s,i=n.v,a=[],l=1/e;e--;)a.push(ti({h:o,s:r,v:i})),i=(i+l)%1;return a}ti.mix=function(t,e,n){n=n===0?0:n||50;var o=ti(t).toRgb(),r=ti(e).toRgb(),i=n/100,a={r:(r.r-o.r)*i+o.r,g:(r.g-o.g)*i+o.g,b:(r.b-o.b)*i+o.b,a:(r.a-o.a)*i+o.a};return ti(a)};ti.readability=function(t,e){var n=ti(t),o=ti(e);return(Math.max(n.getLuminance(),o.getLuminance())+.05)/(Math.min(n.getLuminance(),o.getLuminance())+.05)};ti.isReadable=function(t,e,n){var o=ti.readability(t,e),r,i;switch(i=!1,r=Kso(n),r.level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7;break}return i};ti.mostReadable=function(t,e,n){var o=null,r=0,i,a,l,s;n=n||{},a=n.includeFallbackColors,l=n.level,s=n.size;for(var c=0;cr&&(r=i,o=ti(e[c]));return ti.isReadable(t,o,{level:l,size:s})||!a?o:(n.includeFallbackColors=!1,ti.mostReadable(t,["#fff","#000"],n))};var dfe=ti.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},_so=ti.hexNames=Vso(dfe);function Vso(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function irt(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Nc(t,e){Gso(t)&&(t="100%");var n=Xso(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function cee(t){return Math.min(1,Math.max(0,t))}function q1(t){return parseInt(t,16)}function Gso(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function Xso(t){return typeof t=="string"&&t.indexOf("%")!=-1}function C2(t){return t.length==1?"0"+t:""+t}function YD(t){return t<=1&&(t=t*100+"%"),t}function art(t){return Math.round(parseFloat(t)*255).toString(16)}function tHe(t){return q1(t)/255}var n2=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+o),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+o),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+o),hsva:new RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function s6(t){return!!n2.CSS_UNIT.exec(t)}function Jso(t){t=t.replace(Cso,"").replace(Rso,"").toLowerCase();var e=!1;if(dfe[t])t=dfe[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=n2.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=n2.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=n2.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=n2.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=n2.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=n2.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=n2.hex8.exec(t))?{r:q1(n[1]),g:q1(n[2]),b:q1(n[3]),a:tHe(n[4]),format:e?"name":"hex8"}:(n=n2.hex6.exec(t))?{r:q1(n[1]),g:q1(n[2]),b:q1(n[3]),format:e?"name":"hex"}:(n=n2.hex4.exec(t))?{r:q1(n[1]+""+n[1]),g:q1(n[2]+""+n[2]),b:q1(n[3]+""+n[3]),a:tHe(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=n2.hex3.exec(t))?{r:q1(n[1]+""+n[1]),g:q1(n[2]+""+n[2]),b:q1(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function Kso(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:e,size:n}}var nHe=function(e){var n=["r","g","b","a","h","s","l","v"],o=0,r=0;return Pso(n,function(i){if(e[i]&&(o+=1,isNaN(e[i])||(r+=1),i==="s"||i==="l")){var a=/^\d+%$/;a.test(e[i])&&(r+=1)}}),o===r?e:!1},OD=function(e,n){var o=e.hex?ti(e.hex):ti(e),r=o.toHsl(),i=o.toHsv(),a=o.toRgb(),l=o.toHex();r.s===0&&(r.h=n||0,i.h=n||0);var s=l==="000000"&&a.a===0;return{hsl:r,hex:s?"transparent":"#"+l,rgb:a,hsv:i,oldHue:e.h||n||r.h,source:e.source}},Jw=function(e){if(e==="transparent")return!0;var n=String(e).charAt(0)==="#"?1:0;return e.length!==4+n&&e.length<7+n&&ti(e).isValid()},h9e=function(e){if(!e)return"#fff";var n=OD(e);if(n.hex==="transparent")return"rgba(0,0,0,0.4)";var o=(n.rgb.r*299+n.rgb.g*587+n.rgb.b*114)/1e3;return o>=128?"#000":"#fff"},Lae=function(e,n){var o=e.replace("°","");return ti(n+" ("+o+")")._ok},Qz=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(o){oco(r,o);function r(){var i,a,l,s;nco(this,r);for(var c=arguments.length,u=Array(c),d=0;dl))return!1;var c=i.get(t),u=i.get(e);if(c&&u)return c==e&&u==t;var d=-1,f=!0,p=n&gco?new aJ:void 0;for(i.set(t,e),i.set(e,t);++d=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}var NO=24,z0o=mrt.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,o=t.width,r=o===void 0?NO:o,i=t.height,a=i===void 0?NO:i,l=t.style,s=l===void 0?{}:l,c=I0o(t,["fill","width","height","style"]);return vHe.default.createElement("svg",wHe({viewBox:"0 0 "+NO+" "+NO,style:wHe({fill:n,width:r,height:a},s)},c),vHe.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},D0o=function(){function t(e,n){for(var o=0;o1&&(r.a=1),o.props.onChange({h:o.props.hsl.h,s:o.props.hsl.s,l:o.props.hsl.l,a:Math.round(r.a*100)/100,source:"rgb"},i)):(r.h||r.s||r.l)&&(typeof r.s=="string"&&r.s.includes("%")&&(r.s=r.s.replace("%","")),typeof r.l=="string"&&r.l.includes("%")&&(r.l=r.l.replace("%","")),r.s==1?r.s=.01:r.l==1&&(r.l=.01),o.props.onChange({h:r.h||o.props.hsl.h,s:Number(AHe(r.s)?o.props.hsl.s:r.s),l:Number(AHe(r.l)?o.props.hsl.l:r.l),source:"hsl"},i))},o.showHighlight=function(r){r.currentTarget.style.background="#eee"},o.hideHighlight=function(r){r.currentTarget.style.background="transparent"},n.hsl.a!==1&&n.view==="hex"?o.state={view:"rgb"}:o.state={view:n.view},o}return D0o(e,[{key:"render",value:function(){var o=this,r=qi({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),i=void 0;return this.state.view==="hex"?i=be.createElement("div",{style:r.fields,className:"flexbox-fix"},be.createElement("div",{style:r.field},be.createElement(ul,{style:{input:r.input,label:r.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?i=be.createElement("div",{style:r.fields,className:"flexbox-fix"},be.createElement("div",{style:r.field},be.createElement(ul,{style:{input:r.input,label:r.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),be.createElement("div",{style:r.field},be.createElement(ul,{style:{input:r.input,label:r.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),be.createElement("div",{style:r.field},be.createElement(ul,{style:{input:r.input,label:r.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),be.createElement("div",{style:r.alpha},be.createElement(ul,{style:{input:r.input,label:r.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(i=be.createElement("div",{style:r.fields,className:"flexbox-fix"},be.createElement("div",{style:r.field},be.createElement(ul,{style:{input:r.input,label:r.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),be.createElement("div",{style:r.field},be.createElement(ul,{style:{input:r.input,label:r.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),be.createElement("div",{style:r.field},be.createElement(ul,{style:{input:r.input,label:r.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),be.createElement("div",{style:r.alpha},be.createElement(ul,{style:{input:r.input,label:r.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),be.createElement("div",{style:r.wrap,className:"flexbox-fix"},i,be.createElement("div",{style:r.toggle},be.createElement("div",{style:r.icon,onClick:this.toggleViews,ref:function(l){return o.icon=l}},be.createElement(z0o,{style:r.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(o,r){return o.hsl.a!==1&&r.view==="hex"?{view:"rgb"}:null}}]),e}(be.Component);yrt.defaultProps={view:"hex"};var xHe=function(){var e=qi({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return be.createElement("div",{style:e.picker})},L0o=function(){var e=qi({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return be.createElement("div",{style:e.picker})},w9e=function(e){var n=e.width,o=e.onChange,r=e.disableAlpha,i=e.rgb,a=e.hsl,l=e.hsv,s=e.hex,c=e.renderers,u=e.styles,d=u===void 0?{}:u,f=e.className,p=f===void 0?"":f,g=e.defaultView,y=qi(g1({default:{picker:{width:n,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+i.r+", "+i.g+", "+i.b+", "+i.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},d),{disableAlpha:r});return be.createElement("div",{style:y.picker,className:"chrome-picker "+p},be.createElement("div",{style:y.saturation},be.createElement(see,{style:y.Saturation,hsl:a,hsv:l,pointer:L0o,onChange:o})),be.createElement("div",{style:y.body},be.createElement("div",{style:y.controls,className:"flexbox-fix"},be.createElement("div",{style:y.color},be.createElement("div",{style:y.swatch},be.createElement("div",{style:y.active}),be.createElement(bM,{renderers:c}))),be.createElement("div",{style:y.toggles},be.createElement("div",{style:y.hue},be.createElement(SM,{style:y.Hue,hsl:a,pointer:xHe,onChange:o})),be.createElement("div",{style:y.alpha},be.createElement(i9e,{style:y.Alpha,rgb:i,hsl:a,pointer:xHe,renderers:c,onChange:o})))),be.createElement(yrt,{rgb:i,hsl:a,hex:s,view:g,onChange:o,disableAlpha:r})))};w9e.propTypes={width:go.oneOfType([go.string,go.number]),disableAlpha:go.bool,styles:go.object,defaultView:go.oneOf(["hex","rgb","hsl"])};w9e.defaultProps={width:225,disableAlpha:!1,styles:{}};m1(w9e);var W0o=function(e){var n=e.color,o=e.onClick,r=o===void 0?function(){}:o,i=e.onSwatchHover,a=e.active,l=qi({default:{color:{background:n,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:h9e(n),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:a,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return be.createElement(oS,{style:l.color,color:n,onClick:r,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},be.createElement("div",{style:l.dot}))},N0o=function(e){var n=e.hex,o=e.rgb,r=e.onChange,i=qi({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:n},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),a=function(s,c){s.r||s.g||s.b?r({r:s.r||o.r,g:s.g||o.g,b:s.b||o.b,source:"rgb"},c):r({hex:s.hex,source:"hex"},c)};return be.createElement("div",{style:i.fields,className:"flexbox-fix"},be.createElement("div",{style:i.active}),be.createElement(ul,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"hex",value:n,onChange:a}),be.createElement(ul,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:o.r,onChange:a}),be.createElement(ul,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:o.g,onChange:a}),be.createElement(ul,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:o.b,onChange:a}))},v9e=function(e){var n=e.onChange,o=e.onSwatchHover,r=e.colors,i=e.hex,a=e.rgb,l=e.styles,s=l===void 0?{}:l,c=e.className,u=c===void 0?"":c,d=qi(g1({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},s)),f=function(g,y){g.hex?Jw(g.hex)&&n({hex:g.hex,source:"hex"},y):n(g,y)};return be.createElement($N,{style:d.Compact,styles:s},be.createElement("div",{style:d.compact,className:"compact-picker "+u},be.createElement("div",null,rS(r,function(p){return be.createElement(W0o,{key:p,color:p,active:p.toLowerCase()===i,onClick:f,onSwatchHover:o})}),be.createElement("div",{style:d.clear})),be.createElement(N0o,{hex:i,rgb:a,onChange:f})))};v9e.propTypes={colors:go.arrayOf(go.string),styles:go.object};v9e.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};const zf=m1(v9e);var U0o=function(e){var n=e.hover,o=e.color,r=e.onClick,i=e.onSwatchHover,a={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},l=qi({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:a}},{hover:n});return be.createElement("div",{style:l.swatch},be.createElement(oS,{color:o,onClick:r,onHover:i,focusStyle:a}))};const j0o=r9e(U0o);var x9e=function(e){var n=e.width,o=e.colors,r=e.onChange,i=e.onSwatchHover,a=e.triangle,l=e.styles,s=l===void 0?{}:l,c=e.className,u=c===void 0?"":c,d=qi(g1({default:{card:{width:n,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},s),{"hide-triangle":a==="hide","top-left-triangle":a==="top-left","top-right-triangle":a==="top-right","bottom-left-triangle":a==="bottom-left","bottom-right-triangle":a==="bottom-right"}),f=function(g,y){return r({hex:g,source:"hex"},y)};return be.createElement("div",{style:d.card,className:"github-picker "+u},be.createElement("div",{style:d.triangleShadow}),be.createElement("div",{style:d.triangle}),rS(o,function(p){return be.createElement(j0o,{color:p,key:p,onClick:f,onSwatchHover:i})}))};x9e.propTypes={width:go.oneOfType([go.string,go.number]),colors:go.arrayOf(go.string),triangle:go.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:go.object};x9e.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};m1(x9e);var B0o=function(e){var n=e.direction,o=qi({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:n==="vertical"});return be.createElement("div",{style:o.picker})},Y0o=Object.assign||function(t){for(var e=1;e.5});return be.createElement("div",{style:o.picker})},G0o=function(){var e=qi({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return be.createElement("div",{style:e.pointer},be.createElement("div",{style:e.left},be.createElement("div",{style:e.leftInside})),be.createElement("div",{style:e.right},be.createElement("div",{style:e.rightInside})))},bHe=function(e){var n=e.onClick,o=e.label,r=e.children,i=e.active,a=qi({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:i});return be.createElement("div",{style:a.button,onClick:n},o||r)},X0o=function(e){var n=e.rgb,o=e.currentColor,r=qi({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+n.r+","+n.g+", "+n.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:o,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return be.createElement("div",null,be.createElement("div",{style:r.label},"new"),be.createElement("div",{style:r.swatches},be.createElement("div",{style:r.new}),be.createElement("div",{style:r.current})),be.createElement("div",{style:r.label},"current"))},J0o=function(){function t(e,n){for(var o=0;o100&&(u.a=100),u.a/=100,n({h:r.h,s:r.s,l:r.l,a:u.a,source:"rgb"},d))};return be.createElement("div",{style:l.fields,className:"flexbox-fix"},be.createElement("div",{style:l.double},be.createElement(ul,{style:{input:l.input,label:l.label},label:"hex",value:i.replace("#",""),onChange:s})),be.createElement("div",{style:l.single},be.createElement(ul,{style:{input:l.input,label:l.label},label:"r",value:o.r,onChange:s,dragLabel:"true",dragMax:"255"})),be.createElement("div",{style:l.single},be.createElement(ul,{style:{input:l.input,label:l.label},label:"g",value:o.g,onChange:s,dragLabel:"true",dragMax:"255"})),be.createElement("div",{style:l.single},be.createElement(ul,{style:{input:l.input,label:l.label},label:"b",value:o.b,onChange:s,dragLabel:"true",dragMax:"255"})),be.createElement("div",{style:l.alpha},be.createElement(ul,{style:{input:l.input,label:l.label},label:"a",value:Math.round(o.a*100),onChange:s,dragLabel:"true",dragMax:"100"})))},Z0o=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}var UO=24,auo=wrt.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,o=t.width,r=o===void 0?UO:o,i=t.height,a=i===void 0?UO:i,l=t.style,s=l===void 0?{}:l,c=iuo(t,["fill","width","height","style"]);return THe.default.createElement("svg",SHe({viewBox:"0 0 "+UO+" "+UO,style:SHe({fill:n,width:r,height:a},s)},c),THe.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},luo=function(e){var n=e.color,o=e.onClick,r=o===void 0?function(){}:o,i=e.onSwatchHover,a=e.first,l=e.last,s=e.active,c=qi({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:n,marginBottom:"1px"},check:{color:h9e(n),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:a,last:l,active:s,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return be.createElement(oS,{color:n,style:c.color,onClick:r,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},be.createElement("div",{style:c.check},be.createElement(auo,null)))},suo=function(e){var n=e.onClick,o=e.onSwatchHover,r=e.group,i=e.active,a=qi({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return be.createElement("div",{style:a.group},rS(r,function(l,s){return be.createElement(luo,{key:l,color:l,active:l.toLowerCase()===i,first:s===0,last:s===r.length-1,onClick:n,onSwatchHover:o})}))},C9e=function(e){var n=e.width,o=e.height,r=e.onChange,i=e.onSwatchHover,a=e.colors,l=e.hex,s=e.styles,c=s===void 0?{}:s,u=e.className,d=u===void 0?"":u,f=qi(g1({default:{picker:{width:n,height:o},overflow:{height:o,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},c)),p=function(y,w){return r({hex:y,source:"hex"},w)};return be.createElement("div",{style:f.picker,className:"swatches-picker "+d},be.createElement($N,null,be.createElement("div",{style:f.overflow},be.createElement("div",{style:f.body},rS(a,function(g){return be.createElement(suo,{key:g.toString(),group:g,active:l,onClick:p,onSwatchHover:i})}),be.createElement("div",{style:f.clear})))))};C9e.propTypes={width:go.oneOfType([go.string,go.number]),height:go.oneOfType([go.string,go.number]),colors:go.arrayOf(go.arrayOf(go.string)),styles:go.object};C9e.defaultProps={width:320,height:240,colors:[[fP[900],fP[700],fP[500],fP[300],fP[100]],[hP[900],hP[700],hP[500],hP[300],hP[100]],[pP[900],pP[700],pP[500],pP[300],pP[100]],[gP[900],gP[700],gP[500],gP[300],gP[100]],[mP[900],mP[700],mP[500],mP[300],mP[100]],[yP[900],yP[700],yP[500],yP[300],yP[100]],[AP[900],AP[700],AP[500],AP[300],AP[100]],[wP[900],wP[700],wP[500],wP[300],wP[100]],[vP[900],vP[700],vP[500],vP[300],vP[100]],["#194D33",_D[700],_D[500],_D[300],_D[100]],[xP[900],xP[700],xP[500],xP[300],xP[100]],[bP[900],bP[700],bP[500],bP[300],bP[100]],[SP[900],SP[700],SP[500],SP[300],SP[100]],[TP[900],TP[700],TP[500],TP[300],TP[100]],[PP[900],PP[700],PP[500],PP[300],PP[100]],[CP[900],CP[700],CP[500],CP[300],CP[100]],[RP[900],RP[700],RP[500],RP[300],RP[100]],[HP[900],HP[700],HP[500],HP[300],HP[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};m1(C9e);var R9e=function(e){var n=e.onChange,o=e.onSwatchHover,r=e.hex,i=e.colors,a=e.width,l=e.triangle,s=e.styles,c=s===void 0?{}:s,u=e.className,d=u===void 0?"":u,f=qi(g1({default:{card:{width:a,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},c),{"hide-triangle":l==="hide","top-left-triangle":l==="top-left","top-right-triangle":l==="top-right"}),p=function(y,w){Jw(y)&&n({hex:y,source:"hex"},w)};return be.createElement("div",{style:f.card,className:"twitter-picker "+d},be.createElement("div",{style:f.triangleShadow}),be.createElement("div",{style:f.triangle}),be.createElement("div",{style:f.body},rS(i,function(g,y){return be.createElement(oS,{key:y,color:g,hex:g,style:f.swatch,onClick:p,onHover:o,focusStyle:{boxShadow:"0 0 4px "+g}})}),be.createElement("div",{style:f.hash},"#"),be.createElement(ul,{label:null,style:{input:f.input},value:r.replace("#",""),onChange:p}),be.createElement("div",{style:f.clear})))};R9e.propTypes={width:go.oneOfType([go.string,go.number]),triangle:go.oneOf(["hide","top-left","top-right"]),colors:go.arrayOf(go.string),styles:go.object};R9e.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};m1(R9e);var H9e=function(e){var n=qi({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(e.hsl.h)+", "+Math.round(e.hsl.s*100)+"%, "+Math.round(e.hsl.l*100)+"%)"}}});return be.createElement("div",{style:n.picker})};H9e.propTypes={hsl:go.shape({h:go.number,s:go.number,l:go.number,a:go.number})};H9e.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var M9e=function(e){var n=qi({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(e.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return be.createElement("div",{style:n.picker})};M9e.propTypes={hsl:go.shape({h:go.number,s:go.number,l:go.number,a:go.number})};M9e.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var cuo=function(e){var n=e.onChange,o=e.rgb,r=e.hsl,i=e.hex,a=e.hsv,l=function(p,g){if(p.hex)Jw(p.hex)&&n({hex:p.hex,source:"hex"},g);else if(p.rgb){var y=p.rgb.split(",");Lae(p.rgb,"rgb")&&n({r:y[0],g:y[1],b:y[2],a:1,source:"rgb"},g)}else if(p.hsv){var w=p.hsv.split(",");Lae(p.hsv,"hsv")&&(w[2]=w[2].replace("%",""),w[1]=w[1].replace("%",""),w[0]=w[0].replace("°",""),w[1]==1?w[1]=.01:w[2]==1&&(w[2]=.01),n({h:Number(w[0]),s:Number(w[1]),v:Number(w[2]),source:"hsv"},g))}else if(p.hsl){var b=p.hsl.split(",");Lae(p.hsl,"hsl")&&(b[2]=b[2].replace("%",""),b[1]=b[1].replace("%",""),b[0]=b[0].replace("°",""),d[1]==1?d[1]=.01:d[2]==1&&(d[2]=.01),n({h:Number(b[0]),s:Number(b[1]),v:Number(b[2]),source:"hsl"},g))}},s=qi({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),c=o.r+", "+o.g+", "+o.b,u=Math.round(r.h)+"°, "+Math.round(r.s*100)+"%, "+Math.round(r.l*100)+"%",d=Math.round(a.h)+"°, "+Math.round(a.s*100)+"%, "+Math.round(a.v*100)+"%";return be.createElement("div",{style:s.wrap,className:"flexbox-fix"},be.createElement("div",{style:s.fields},be.createElement("div",{style:s.double},be.createElement(ul,{style:{input:s.input,label:s.label},label:"hex",value:i,onChange:l})),be.createElement("div",{style:s.column},be.createElement("div",{style:s.single},be.createElement(ul,{style:{input:s.input2,label:s.label2},label:"rgb",value:c,onChange:l})),be.createElement("div",{style:s.single},be.createElement(ul,{style:{input:s.input2,label:s.label2},label:"hsv",value:d,onChange:l})),be.createElement("div",{style:s.single},be.createElement(ul,{style:{input:s.input2,label:s.label2},label:"hsl",value:u,onChange:l})))))},I9e=function(e){var n=e.width,o=e.onChange,r=e.rgb,i=e.hsl,a=e.hsv,l=e.hex,s=e.header,c=e.styles,u=c===void 0?{}:c,d=e.className,f=d===void 0?"":d,p=qi(g1({default:{picker:{width:n,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+r.r+", "+r.g+", "+r.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},u));return be.createElement("div",{style:p.picker,className:"google-picker "+f},be.createElement("div",{style:p.head},s),be.createElement("div",{style:p.swatch}),be.createElement("div",{style:p.saturation},be.createElement(see,{hsl:i,hsv:a,pointer:H9e,onChange:o})),be.createElement("div",{style:p.body},be.createElement("div",{style:p.controls,className:"flexbox-fix"},be.createElement("div",{style:p.hue},be.createElement(SM,{style:p.Hue,hsl:i,radius:"4px",pointer:M9e,onChange:o}))),be.createElement(cuo,{rgb:r,hsl:i,hex:l,hsv:a,onChange:o})))};I9e.propTypes={width:go.oneOfType([go.string,go.number]),styles:go.object,header:go.string};I9e.defaultProps={width:652,styles:{},header:"Color picker"};m1(I9e);const uuo=({setDialogVisible:t})=>{const e=H(fn),n=H(rYe),o=H(Gn),r=H(iYe),i=H(En),a=H($s),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState((s==null?void 0:s.color)??"#808080"),d=Jt(),f=b=>{switch(a){case oe.AllSelectedObjectsOfThisType:{for(const C of H.getState().elements)if(C.type===z.Foundation&&!C.locked&&H.getState().selectedElementIdSet.has(C.id)&&b!==C.color)return!0;break}case oe.AllObjectsOfThisType:for(const C of H.getState().elements)if(C.type===z.Foundation&&!C.locked&&b!==C.color)return!0;break;default:if(b!==(s==null?void 0:s.color))return!0}return!1},p=(b,C)=>{H.getState().set(P=>{for(const v of P.elements)if(v.type===z.Foundation&&b.has(v.id))if(C!==void 0)v.color=C;else{const T=b.get(v.id);T!==void 0&&(v.color=T)}})},g=b=>{if(s&&f(b)){switch(a){case oe.AllSelectedObjectsOfThisType:{const C=new Map;for(const v of H.getState().elements)v.type===z.Foundation&&H.getState().selectedElementIdSet.has(v.id)&&C.set(v.id,v.color??"#808080");const P={name:"Set Color for Selected Foundations",timestamp:Date.now(),oldValues:C,newValue:b,undo:()=>{p(P.oldValues)},redo:()=>{p(P.oldValues,P.newValue)}};i(P),p(C,b),l(H.getState().applyCount+1);break}case oe.AllObjectsOfThisType:{const C=new Map;for(const v of H.getState().elements)v.type===z.Foundation&&C.set(v.id,v.color??"#808080");const P={name:"Set Color for All Foundations",timestamp:Date.now(),oldValues:C,newValue:b,undo:()=>{for(const[v,T]of P.oldValues.entries())n(v,T)},redo:()=>{r(z.Foundation,P.newValue)}};i(P),r(z.Foundation,b),l(H.getState().applyCount+1);break}default:{const C=o(s.id),P=C?C.color:s.color,v={name:"Set Color of Selected Foundation",timestamp:Date.now(),oldValue:P,newValue:b,changedElementId:s.id,changedElementType:s.type,undo:()=>{n(v.changedElementId,v.oldValue)},redo:()=>{n(v.changedElementId,v.newValue)}};i(v),n(s.id,b),l(H.getState().applyCount+1);break}}e(C=>{C.actionState.foundationColor=b})}},y=()=>{g(c)},w=()=>{t(!1)};return h.jsx(so,{width:600,title:Y.t("word.Color",d),onApply:y,onClose:w,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(zf,{color:c,onChangeComplete:b=>{u(b.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:12,children:h.jsx(Ue.Group,{onChange:b=>H.getState().setFoundationActionScope(b.target.value),value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},duo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(nYe),r=H(u3),i=H(gW),a=H(zw),l=H(EH),s=H(c3),c=H(En),u=H($s),d=H(fn),f=H(no),p=H(Zn),g=H(Vi),y=co(z.Foundation),[w,b]=m.useState((y==null?void 0:y.lx)??.1),C=m.useRef(new Map),P=m.useRef(new Map),v=m.useRef(new Map),T=m.useRef(new Map),A=m.useRef(new Map),x=m.useRef(new Map),S=m.useRef(new Map),R=m.useRef(new Map),M=m.useRef(!1),D=m.useRef(),E=Jt(),W=te=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:{for(const re of e)if(re.type===z.Foundation&&H.getState().selectedElementIdSet.has(re.id)){const ae=re,se=l(ae.id);if(se.length>0&&!me.doesNewSizeContainAllChildren(ae,se,te,ae.ly))return!1}break}case oe.AllObjectsOfThisType:{for(const re of e)if(re.type===z.Foundation){const ae=re,se=l(ae.id);if(se.length>0&&!me.doesNewSizeContainAllChildren(ae,se,te,ae.ly))return!1}break}default:{const re=l(y.id);if(re.length>0)return me.doesNewSizeContainAllChildren(y,re,te,y.ly);break}}return!0}},j=te=>!W(te),L=te=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:for(const re of e)if(re.type===z.Foundation&&!re.locked&&H.getState().selectedElementIdSet.has(re.id)&&Math.abs(re.lx-te)>It)return!0;break;case oe.AllObjectsOfThisType:for(const re of e)if(re.type===z.Foundation&&!re.locked&&Math.abs(re.lx-te)>It)return!0;break;default:if(Math.abs((y==null?void 0:y.lx)-te)>It)return!0}return!1}},k=(te,re)=>{if(te==null)return null;for(const ae of te.children)if(ae.name.includes(`${re}`))return ae;return null},N=(te,re,ae)=>{var se,ne;if(te){for(const fe of te.children)if(fe.name.includes(`${ae.id}`)){(ne=(se=Fn.getState().contentRef)==null?void 0:se.current)==null||ne.add(fe);break}d(fe=>{for(const ge of fe.elements)if(ge.id===ae.id){ge.parentId=Zo;const de=new Xt(ge.cx,ge.cy).rotateAround(si,re.rotation[2]).add(new Xt(re.cx,re.cy));ge.cx=de.x,ge.cy=de.y,ge.cz=0,T.current.set(ge.id,new ie(de.x,de.y,0)),P.current.set(ge.id,Zo);break}})}},F=(te,re)=>{const ae=l(te.id),se=te.rotation[2];if(A.current.clear(),R.current.clear(),ae.length>0)for(const ne of ae)switch(ne.type){case z.Wall:break;case z.SolarPanel:case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:case z.Sensor:{const fe=new Xt(ne.cx*te.lx,ne.cy*te.ly).rotateAround(si,se);A.current.set(ne.id,fe),v.current.set(ne.id,new ie(ne.cx,ne.cy));break}case z.Polygon:{const fe=ne,ge=[];for(const de of fe.vertices)ge.push(new Xt(de.x*te.lx,de.y*te.ly).rotateAround(si,se));R.current.set(ne.id,ge),x.current.set(ne.id,fe.vertices.map(de=>({...de})));break}case z.Human:case z.Tree:{v.current.set(ne.id,new ie(ne.cx,ne.cy,ne.cz));break}}if(r(te.id,re),ae.length>0)for(const ne of ae)switch(ne.type){case z.Wall:break;case z.SolarPanel:case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:case z.Sensor:{const fe=A.current.get(ne.id);if(fe){const de=new Xt(fe.x,fe.y).rotateAround(si,-se).x/re;o(ne.id,de),T.current.set(ne.id,new ie(de,ne.cy))}break}case z.Polygon:{const fe=R.current.get(ne.id);if(fe){const ge=[];for(const de of fe){const Z=de.rotateAround(si,-se),he=Z.x/re,xe=Z.y/te.ly;ge.push({x:he,y:xe})}a(ne.id,ge),S.current.set(ne.id,ge.map(de=>({...de})))}break}case z.Human:case z.Tree:{if(T.current.set(ne.id,new ie(ne.cx,ne.cy,ne.cz)),C.current.set(ne.id,te.id),Math.abs(ne.cz-te.lz/2)0){const fe=Fn.getState().contentRef,ge=k(fe==null?void 0:fe.current,te.id);N(ge,te,ne)}}else if(Math.abs(Math.abs(ne.cx)-te.lx/2)0?re:-re)/2;o(ne.id,fe),T.current.set(ne.id,new ie(fe,ne.cy,ne.cz))}break}}},U=(te,re,ae)=>{if(!te||!re)return;const se=Fn.getState().contentRef,ne=k(se==null?void 0:se.current,re),fe=k(re===Zo?se==null?void 0:se.current:ne,ae);if(fe&&(se!=null&&se.current)){if(te===Zo)se.current.add(fe);else{const ge=k(se.current,te);ge==null||ge.add(fe)}np()}},O=(te,re)=>{te&&d(ae=>{for(const se of ae.elements)if(se.id===re){se.parentId=te;break}})},B=(te,re)=>{H.getState().set(ae=>{for(const se of ae.elements)if(te.has(se.id))if(re!==void 0)se.lx=re;else{const ne=te.get(se.id);ne!==void 0&&(se.lx=ne)}})},_=te=>{if(!y||!L(te))return;const re=n(y.id),ae=re?re.lx:y.lx;if(D.current=void 0,M.current=j(te),M.current)D.current=te,b(ae);else switch(v.current.clear(),T.current.clear(),x.current.clear(),S.current.clear(),u){case oe.AllSelectedObjectsOfThisType:{const se=new Map;for(const fe of e)fe.type===z.Foundation&&H.getState().selectedElementIdSet.has(fe.id)&&se.set(fe.id,fe.lx);for(const fe of e)fe.type===z.Foundation&&H.getState().selectedElementIdSet.has(fe.id)&&F(fe,te);const ne={name:"Set Length for Selected Foundations",timestamp:Date.now(),oldSizes:se,newSize:te,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var fe,ge;if(B(ne.oldSizes),ne.oldChildrenPositionsMap&&ne.oldChildrenPositionsMap.size>0)for(const[de,Z]of ne.oldChildrenPositionsMap.entries()){s(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(U(he,xe,de),O(he,de))}if(ne.oldChildrenVerticesMap&&ne.oldChildrenVerticesMap.size>0)for(const[de,Z]of ne.oldChildrenVerticesMap.entries())a(de,Z)},redo:()=>{var fe,ge;if(B(ne.oldSizes,ne.newSize),ne.newChildrenPositionsMap&&ne.newChildrenPositionsMap.size>0)for(const[de,Z]of ne.newChildrenPositionsMap.entries()){s(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(U(xe,he,de),O(xe,de))}if(ne.newChildrenVerticesMap&&ne.newChildrenVerticesMap.size>0)for(const[de,Z]of ne.newChildrenVerticesMap.entries())a(de,Z)}};c(ne),p(f+1);break}case oe.AllObjectsOfThisType:{const se=new Map;for(const fe of e)fe.type===z.Foundation&&se.set(fe.id,fe.lx);for(const fe of e)fe.type===z.Foundation&&F(fe,te);const ne={name:"Set Length for All Foundations",timestamp:Date.now(),oldSizes:se,newSize:te,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var fe,ge;for(const[de,Z]of ne.oldSizes.entries())r(de,Z);if(ne.oldChildrenPositionsMap&&ne.oldChildrenPositionsMap.size>0)for(const[de,Z]of ne.oldChildrenPositionsMap.entries()){s(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(U(he,xe,de),O(he,de))}if(ne.oldChildrenVerticesMap&&ne.oldChildrenVerticesMap.size>0)for(const[de,Z]of ne.oldChildrenVerticesMap.entries())a(de,Z)},redo:()=>{var fe,ge;if(i(z.Foundation,ne.newSize),ne.newChildrenPositionsMap&&ne.newChildrenPositionsMap.size>0)for(const[de,Z]of ne.newChildrenPositionsMap.entries()){s(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(U(xe,he,de),O(xe,de))}if(ne.newChildrenVerticesMap&&ne.newChildrenVerticesMap.size>0)for(const[de,Z]of ne.newChildrenVerticesMap.entries())a(de,Z)}};c(ne),p(f+1);break}default:{F(y,te);const se={name:"Set Foundation Length",timestamp:Date.now(),oldSize:ae,newSize:te,resizedElementId:y.id,resizedElementType:y.type,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ne,fe;if(r(y.id,se.oldSize),se.oldChildrenPositionsMap&&se.oldChildrenPositionsMap.size>0)for(const[ge,de]of se.oldChildrenPositionsMap.entries()){s(ge,de.x,de.y,de.z);const Z=(ne=se.oldChildrenParentIdMap)==null?void 0:ne.get(ge),he=(fe=se.newChildrenParentIdMap)==null?void 0:fe.get(ge);Z&&he&&Z!==he&&(U(Z,he,ge),O(Z,ge))}if(se.oldChildrenVerticesMap&&se.oldChildrenVerticesMap.size>0)for(const[ge,de]of se.oldChildrenVerticesMap.entries())a(ge,de)},redo:()=>{var ne,fe;if(r(y.id,se.newSize),se.newChildrenPositionsMap&&se.newChildrenPositionsMap.size>0)for(const[ge,de]of se.newChildrenPositionsMap.entries()){s(ge,de.x,de.y,de.z);const Z=(ne=se.oldChildrenParentIdMap)==null?void 0:ne.get(ge),he=(fe=se.newChildrenParentIdMap)==null?void 0:fe.get(ge);Z&&he&&Z!==he&&(U(he,Z,ge),O(he,ge))}if(se.newChildrenVerticesMap&&se.newChildrenVerticesMap.size>0)for(const[ge,de]of se.newChildrenVerticesMap.entries())a(ge,de)}};c(se),p(f+1);break}}},X=()=>{t(!1)},$=()=>{X(),g()},Q=()=>{_(w),M.current||(t(!1),p(0))},le=()=>{_(w)},q=M.current?": "+Y.t("message.NotApplicableToSelectedAction",E)+(D.current!==void 0?" ("+D.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Length",E),rejectedMessage:q,onApply:le,onClose:X,onClickCancel:$,onClickOk:Q,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:1e3,style:{width:120},step:.5,precision:2,value:w,onChange:te=>{te!==null&&b(te)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",E),": [0.1, 1000] ",Y.t("word.MeterAbbreviation",E)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",E)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:te=>H.getState().setFoundationActionScope(te.target.value),value:u,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",E)})]})})})]})})},fuo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(c3),r=H(oYe),i=H(Iw),a=H(mW),l=H(zw),s=H(EH),c=H(En),u=H($s),d=H(fn),f=H(no),p=H(Zn),g=H(Vi),y=co(z.Foundation),[w,b]=m.useState((y==null?void 0:y.ly)??.1),C=m.useRef(new Map),P=m.useRef(new Map),v=m.useRef(new Map),T=m.useRef(new Map),A=m.useRef(new Map),x=m.useRef(new Map),S=m.useRef(new Map),R=m.useRef(new Map),M=m.useRef(!1),D=m.useRef(),E=Jt(),W=q=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:{for(const te of e)if(te.type===z.Foundation&&H.getState().selectedElementIdSet.has(te.id)){const re=te,ae=s(re.id);if(ae.length>0&&!me.doesNewSizeContainAllChildren(re,ae,re.lx,q))return!1}break}case oe.AllObjectsOfThisType:{for(const te of e)if(te.type===z.Foundation){const re=te,ae=s(re.id);if(ae.length>0&&!me.doesNewSizeContainAllChildren(re,ae,re.lx,q))return!1}break}default:{const te=s(y.id);if(te.length>0)return me.doesNewSizeContainAllChildren(y,te,y.lx,q);break}}return!0}},j=q=>!W(q),L=q=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:for(const te of e)if(te.type===z.Foundation&&!te.locked&&H.getState().selectedElementIdSet.has(te.id)&&Math.abs(te.ly-q)>It)return!0;break;case oe.AllObjectsOfThisType:for(const te of e)if(te.type===z.Foundation&&!te.locked&&Math.abs(te.ly-q)>It)return!0;break;default:if(Math.abs((y==null?void 0:y.ly)-q)>It)return!0}return!1}},k=(q,te)=>{if(q==null)return null;for(const re of q.children)if(re.name.includes(`${te}`))return re;return null},N=(q,te,re)=>{var ae,se;if(q){for(const ne of q.children)if(ne.name.includes(`${re.id}`)){(se=(ae=Fn.getState().contentRef)==null?void 0:ae.current)==null||se.add(ne);break}d(ne=>{for(const fe of ne.elements)if(fe.id===re.id){fe.parentId=Zo;const ge=new Xt(fe.cx,fe.cy).rotateAround(si,te.rotation[2]).add(new Xt(te.cx,te.cy));fe.cx=ge.x,fe.cy=ge.y,fe.cz=0,T.current.set(fe.id,new ie(ge.x,ge.y,0)),P.current.set(fe.id,Zo);break}})}},F=(q,te)=>{const re=s(q.id),ae=q.rotation[2];if(A.current.clear(),R.current.clear(),re.length>0)for(const se of re)switch(se.type){case z.Wall:break;case z.SolarPanel:case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:case z.Sensor:{const ne=new Xt(se.cx*q.lx,se.cy*q.ly).rotateAround(si,ae);A.current.set(se.id,ne),v.current.set(se.id,new ie(se.cx,se.cy));break}case z.Polygon:{const ne=se,fe=[];for(const ge of ne.vertices)fe.push(new Xt(ge.x*q.lx,ge.y*q.ly).rotateAround(si,ae));R.current.set(se.id,fe),x.current.set(se.id,ne.vertices.map(ge=>({...ge})));break}case z.Human:case z.Tree:{v.current.set(se.id,new ie(se.cx,se.cy,se.cz));break}}if(i(q.id,te),re.length>0)for(const se of re)switch(se.type){case z.Wall:break;case z.SolarPanel:case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:case z.Sensor:{const ne=A.current.get(se.id);if(ne){const ge=new Xt(ne.x,ne.y).rotateAround(si,-ae).y/te;r(se.id,ge),T.current.set(se.id,new ie(se.cx,ge))}break}case z.Polygon:{const ne=R.current.get(se.id);if(ne){const fe=[];for(const ge of ne){const de=ge.rotateAround(si,-ae),Z=de.x/q.lx,he=de.y/te;fe.push({x:Z,y:he})}l(se.id,fe),S.current.set(se.id,fe.map(ge=>({...ge})))}break}case z.Human:case z.Tree:{if(T.current.set(se.id,new ie(se.cx,se.cy,se.cz)),C.current.set(se.id,q.id),Math.abs(se.cz-q.lz/2)0){const ne=Fn.getState().contentRef,fe=k(ne==null?void 0:ne.current,q.id);N(fe,q,se)}}else if(Math.abs(Math.abs(se.cy)-q.ly/2)0?te:-te)/2;r(se.id,ne),T.current.set(se.id,new ie(se.cz,ne,se.cz))}break}}},U=(q,te,re)=>{if(!q||!te)return;const ae=Fn.getState().contentRef,se=k(ae==null?void 0:ae.current,te),ne=k(te===Zo?ae==null?void 0:ae.current:se,re);if(ne&&(ae!=null&&ae.current)){if(q===Zo)ae.current.add(ne);else{const fe=k(ae.current,q);fe==null||fe.add(ne)}np()}},O=(q,te)=>{q&&d(re=>{for(const ae of re.elements)if(ae.id===te){ae.parentId=q;break}})},B=q=>{if(!y||!L(q))return;const te=n(y.id),re=te?te.ly:y.ly;if(D.current=void 0,M.current=j(q),M.current)D.current=q,b(re);else switch(v.current.clear(),T.current.clear(),x.current.clear(),S.current.clear(),u){case oe.AllSelectedObjectsOfThisType:{const ae=new Map;for(const ne of e)ne.type===z.Foundation&&H.getState().selectedElementIdSet.has(ne.id)&&ae.set(ne.id,ne.ly);for(const ne of e)ne.type===z.Foundation&&H.getState().selectedElementIdSet.has(ne.id)&&F(ne,q);const se={name:"Set Width for Selected Foundations",timestamp:Date.now(),oldSizes:ae,newSize:q,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ne,fe;for(const[ge,de]of se.oldSizes.entries())i(ge,de);if(se.oldChildrenPositionsMap&&se.oldChildrenPositionsMap.size>0)for(const[ge,de]of se.oldChildrenPositionsMap.entries()){o(ge,de.x,de.y,de.z);const Z=(ne=se.oldChildrenParentIdMap)==null?void 0:ne.get(ge),he=(fe=se.newChildrenParentIdMap)==null?void 0:fe.get(ge);Z&&he&&Z!==he&&(U(Z,he,ge),O(Z,ge))}if(se.oldChildrenVerticesMap&&se.oldChildrenVerticesMap.size>0)for(const[ge,de]of se.oldChildrenVerticesMap.entries())l(ge,de)},redo:()=>{var ne,fe;for(const[ge,de]of se.oldSizes.entries())i(ge,se.newSize);if(se.newChildrenPositionsMap&&se.newChildrenPositionsMap.size>0)for(const[ge,de]of se.newChildrenPositionsMap.entries()){o(ge,de.x,de.y,de.z);const Z=(ne=se.oldChildrenParentIdMap)==null?void 0:ne.get(ge),he=(fe=se.newChildrenParentIdMap)==null?void 0:fe.get(ge);Z&&he&&Z!==he&&(U(he,Z,ge),O(he,ge))}if(se.newChildrenVerticesMap&&se.newChildrenVerticesMap.size>0)for(const[ge,de]of se.newChildrenVerticesMap.entries())l(ge,de)}};c(se),p(f+1);break}case oe.AllObjectsOfThisType:{const ae=new Map;for(const ne of e)ne.type===z.Foundation&&ae.set(ne.id,ne.ly);for(const ne of e)ne.type===z.Foundation&&F(ne,q);const se={name:"Set Width for All Foundations",timestamp:Date.now(),oldSizes:ae,newSize:q,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ne,fe;for(const[ge,de]of se.oldSizes.entries())i(ge,de);if(se.oldChildrenPositionsMap&&se.oldChildrenPositionsMap.size>0)for(const[ge,de]of se.oldChildrenPositionsMap.entries()){o(ge,de.x,de.y,de.z);const Z=(ne=se.oldChildrenParentIdMap)==null?void 0:ne.get(ge),he=(fe=se.newChildrenParentIdMap)==null?void 0:fe.get(ge);Z&&he&&Z!==he&&(U(Z,he,ge),O(Z,ge))}if(se.oldChildrenVerticesMap&&se.oldChildrenVerticesMap.size>0)for(const[ge,de]of se.oldChildrenVerticesMap.entries())l(ge,de)},redo:()=>{var ne,fe;if(a(z.Foundation,se.newSize),se.newChildrenPositionsMap&&se.newChildrenPositionsMap.size>0)for(const[ge,de]of se.newChildrenPositionsMap.entries()){o(ge,de.x,de.y,de.z);const Z=(ne=se.oldChildrenParentIdMap)==null?void 0:ne.get(ge),he=(fe=se.newChildrenParentIdMap)==null?void 0:fe.get(ge);Z&&he&&Z!==he&&(U(he,Z,ge),O(he,ge))}if(se.newChildrenVerticesMap&&se.newChildrenVerticesMap.size>0)for(const[ge,de]of se.newChildrenVerticesMap.entries())l(ge,de)}};c(se),p(f+1);break}default:{F(y,q);const ae={name:"Set Foundation Width",timestamp:Date.now(),oldSize:re,newSize:q,resizedElementId:y.id,resizedElementType:y.type,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var se,ne;if(i(y.id,ae.oldSize),ae.oldChildrenPositionsMap&&ae.oldChildrenPositionsMap.size>0)for(const[fe,ge]of ae.oldChildrenPositionsMap.entries()){o(fe,ge.x,ge.y,ge.z);const de=(se=ae.oldChildrenParentIdMap)==null?void 0:se.get(fe),Z=(ne=ae.newChildrenParentIdMap)==null?void 0:ne.get(fe);de&&Z&&de!==Z&&(U(de,Z,fe),O(de,fe))}if(ae.oldChildrenVerticesMap&&ae.oldChildrenVerticesMap.size>0)for(const[fe,ge]of ae.oldChildrenVerticesMap.entries())l(fe,ge)},redo:()=>{var se,ne;if(i(y.id,ae.newSize),ae.newChildrenPositionsMap&&ae.newChildrenPositionsMap.size>0)for(const[fe,ge]of ae.newChildrenPositionsMap.entries()){o(fe,ge.x,ge.y,ge.z);const de=(se=ae.oldChildrenParentIdMap)==null?void 0:se.get(fe),Z=(ne=ae.newChildrenParentIdMap)==null?void 0:ne.get(fe);de&&Z&&de!==Z&&(U(Z,de,fe),O(Z,fe))}if(ae.newChildrenVerticesMap&&ae.newChildrenVerticesMap.size>0)for(const[fe,ge]of ae.newChildrenVerticesMap.entries())l(fe,ge)}};c(ae),p(f+1);break}}},_=()=>{t(!1)},X=()=>{_(),g()},$=()=>{B(w),M.current||(t(!1),p(0))},Q=()=>{B(w)},le=M.current?": "+Y.t("message.NotApplicableToSelectedAction",E)+(D.current!==void 0?" ("+D.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Width",E),rejectedMessage:le,onApply:Q,onClickCancel:X,onClickOk:$,onClose:_,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:1e3,style:{width:120},step:.5,precision:2,value:w,onChange:q=>{q!==null&&b(q)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",E),": [0.1, 1000] ",Y.t("word.MeterAbbreviation",E)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",E)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:q=>H.getState().setFoundationActionScope(q.target.value),value:u,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",E)})]})})})]})})},huo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(c3),l=H(no),s=H(Zn),c=co(z.Foundation),[u,d]=m.useState((c==null?void 0:c.lz)??.1),f=m.useRef(new Map),p=m.useRef(new Map),g=m.useRef(new Map),y=m.useRef(new Map),w=Jt(),b=(W,j)=>{e(L=>{const k=L.elements.find(N=>N.id===W);k&&(k.lz=j,k.cz=j/2)})},C=(W,j)=>{e(L=>{for(const k of L.elements)k.type===W&&!k.locked&&(k.lz=j,k.cz=j/2)})},P=W=>{if(c){switch(i){case oe.AllSelectedObjectsOfThisType:{for(const j of n)if(j.type===z.Foundation&&!j.locked&&H.getState().selectedElementIdSet.has(j.id)&&Math.abs(j.lz-W)>It)return!0;break}case oe.AllObjectsOfThisType:for(const j of n)if(j.type===z.Foundation&&!j.locked&&Math.abs(j.lz-W)>It)return!0;break;default:if(Math.abs((c==null?void 0:c.lz)-W)>It)return!0}return!1}},v=(W,j)=>{if(W==null)return null;for(const L of W.children)if(L.name.includes(`${j}`))return L;return null},T=(W,j,L)=>{var k,N;if(W){for(const U of W.children)if(U.name.includes(`${L.id}`)){(N=(k=Fn.getState().contentRef)==null?void 0:k.current)==null||N.add(U);break}L.parentId=Zo;const F=new Xt(L.cx,L.cy).rotateAround(si,-j.rotation[2]).add(new Xt(j.cx,j.cy));L.cx=F.x,L.cy=F.y,L.cz=0,y.current.set(L.id,new ie(F.x,F.y,0)),p.current.set(L.id,Zo)}},A=(W,j,L)=>{e(k=>{for(const N of k.elements)if(N.parentId===W.id)if(f.current.set(N.id,W.id),g.current.set(N.id,new ie(N.cx,N.cy,N.cz)),me.isPlantOrHuman(N))if(Math.abs(N.cz-W.lz/2)j/2){const U=Fn.getState().contentRef,O=v(U==null?void 0:U.current,W.id);T(O,W,N)}else N.cz=F,y.current.set(N.id,new ie(N.cx,N.cy,F))}else N.type===z.SolarPanel&&(N.cz=j/2,y.current.set(N.id,new ie(N.cx,N.cy,j/2)));else N.foundationId===W.id&&N.type===z.SolarPanel&&N.parentType==z.Roof&&L!==void 0&&(g.current.set(N.id,new ie(N.cx,N.cy,N.cz)),N.cz=N.cz-L/2+j/2,y.current.set(N.id,new ie(N.cx,N.cy,N.cz)))})},x=(W,j,L)=>{if(!W||!j)return;const k=Fn.getState().contentRef,N=v(k==null?void 0:k.current,j),F=v(j===Zo?k==null?void 0:k.current:N,L);if(F&&(k!=null&&k.current)){if(W===Zo)k.current.add(F);else{const U=v(k.current,W);U==null||U.add(F)}np()}},S=(W,j)=>{W&&e(L=>{for(const k of L.elements)if(k.id===j){k.parentId=W;break}})},R=(W,j)=>{H.getState().set(L=>{for(const k of L.elements)if(W.has(k.id))if(j!==void 0)k.lz=j,k.cz=j/2;else{const N=W.get(k.id);N!==void 0&&(k.lz=N,k.cz=N/2)}})},M=W=>{if(c&&P(W)){switch(i){case oe.AllSelectedObjectsOfThisType:{const j=new Map;for(const k of n)k.type===z.Foundation&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&j.set(k.id,k.lz);for(const k of n)k.type===z.Foundation&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&A(k,W,j.get(k.id));const L={name:"Set Height for Selected Foundations",timestamp:Date.now(),oldValues:j,newValue:W,oldChildrenPositionsMap:new Map(g.current),newChildrenPositionsMap:new Map(y.current),oldChildrenParentIdMap:new Map(f.current),newChildrenParentIdMap:new Map(p.current),undo:()=>{var k,N;if(R(L.oldValues),L.oldChildrenPositionsMap&&L.oldChildrenPositionsMap.size>0)for(const[F,U]of L.oldChildrenPositionsMap.entries()){a(F,U.x,U.y,U.z);const O=(k=L.oldChildrenParentIdMap)==null?void 0:k.get(F),B=(N=L.newChildrenParentIdMap)==null?void 0:N.get(F);O&&B&&O!==B&&(x(O,B,F),S(O,F))}},redo:()=>{var N,F;const k=L.newValue;if(R(L.oldValues,k),L.newChildrenPositionsMap&&L.newChildrenPositionsMap.size>0)for(const[U,O]of L.newChildrenPositionsMap.entries()){a(U,O.x,O.y,O.z);const B=(N=L.oldChildrenParentIdMap)==null?void 0:N.get(U),_=(F=L.newChildrenParentIdMap)==null?void 0:F.get(U);B&&_&&B!==_&&(x(_,B,U),S(_,U))}}};r(L),R(j,W),s(l+1);break}case oe.AllObjectsOfThisType:{const j=new Map;for(const k of n)k.type===z.Foundation&&j.set(k.id,k.lz);for(const k of n)k.type===z.Foundation&&A(k,W,j.get(k.id));const L={name:"Set Height for All Foundations",timestamp:Date.now(),oldValues:j,newValue:W,oldChildrenPositionsMap:new Map(g.current),newChildrenPositionsMap:new Map(y.current),oldChildrenParentIdMap:new Map(f.current),newChildrenParentIdMap:new Map(p.current),undo:()=>{var k,N;for(const[F,U]of L.oldValues.entries())b(F,U);if(L.oldChildrenPositionsMap&&L.oldChildrenPositionsMap.size>0)for(const[F,U]of L.oldChildrenPositionsMap.entries()){a(F,U.x,U.y,U.z);const O=(k=L.oldChildrenParentIdMap)==null?void 0:k.get(F),B=(N=L.newChildrenParentIdMap)==null?void 0:N.get(F);O&&B&&O!==B&&(x(O,B,F),S(O,F))}},redo:()=>{var N,F;const k=L.newValue;if(C(z.Foundation,k),L.newChildrenPositionsMap&&L.newChildrenPositionsMap.size>0)for(const[U,O]of L.newChildrenPositionsMap.entries()){a(U,O.x,O.y,O.z);const B=(N=L.oldChildrenParentIdMap)==null?void 0:N.get(U),_=(F=L.newChildrenParentIdMap)==null?void 0:F.get(U);B&&_&&B!==_&&(x(_,B,U),S(_,U))}}};r(L),C(z.Foundation,W),s(l+1);break}default:{const j=o(c.id),L=j?j.lz:c.lz;A(c,W,L),b(c.id,W);const k={name:"Set Foundation Height",timestamp:Date.now(),oldValue:L,newValue:W,oldChildrenPositionsMap:new Map(g.current),newChildrenPositionsMap:new Map(y.current),oldChildrenParentIdMap:new Map(f.current),newChildrenParentIdMap:new Map(p.current),changedElementId:c.id,changedElementType:c.type,undo:()=>{var N,F;if(b(k.changedElementId,k.oldValue),k.oldChildrenPositionsMap&&k.oldChildrenPositionsMap.size>0)for(const[U,O]of k.oldChildrenPositionsMap.entries()){a(U,O.x,O.y,O.z);const B=(N=k.oldChildrenParentIdMap)==null?void 0:N.get(U),_=(F=k.newChildrenParentIdMap)==null?void 0:F.get(U);B&&_&&B!==_&&(x(B,_,U),S(B,U))}},redo:()=>{var N,F;if(b(k.changedElementId,k.newValue),k.newChildrenPositionsMap&&k.newChildrenPositionsMap.size>0)for(const[U,O]of k.newChildrenPositionsMap.entries()){a(U,O.x,O.y,O.z);const B=(N=k.oldChildrenParentIdMap)==null?void 0:N.get(U),_=(F=k.newChildrenParentIdMap)==null?void 0:F.get(U);B&&_&&B!==_&&(x(_,B,U),S(_,U))}}};r(k),s(l+1);break}}e(j=>{j.actionState.foundationHeight=W})}},D=()=>{t(!1)},E=()=>{M(u)};return h.jsx(so,{width:550,title:Y.t("word.Height",w),onApply:E,onClose:D,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:10,style:{width:120},step:.1,precision:2,value:u,onChange:W=>{W!==null&&d(W)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",w),": [0.1, 10] ",Y.t("word.MeterAbbreviation",w)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",w)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:W=>H.getState().setFoundationActionScope(W.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",w)})]})})})]})})},puo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(Lge),r=H($wt),i=H(En),a=H($s),l=H(no),s=H(Zn),c=co(z.Foundation),[u,d]=m.useState(c?-(c==null?void 0:c.rotation[2]):0),f=Jt(),p=C=>{if(c){switch(a){case oe.AllSelectedObjectsOfThisType:{for(const P of e)if(P.type===z.Foundation&&!P.locked&&H.getState().selectedElementIdSet.has(P.id)&&Math.abs(-P.rotation[2]-C)>It)return!0;break}case oe.AllObjectsOfThisType:for(const P of e)if(P.type===z.Foundation&&!P.locked&&Math.abs(-P.rotation[2]-C)>It)return!0;break;default:if(Math.abs(-(c==null?void 0:c.rotation[2])-C)>It)return!0}return!1}},g=(C,P)=>{H.getState().set(v=>{for(const T of v.elements)if(C.has(T.id))if(P!==void 0)T.rotation[2]=P;else{const A=C.get(T.id);A!==void 0&&(T.rotation[2]=-A)}})},y=C=>{if(c&&p(C))switch(a){case oe.AllSelectedObjectsOfThisType:{const P=new Map;for(const T of e)T.type===z.Foundation&&H.getState().selectedElementIdSet.has(T.id)&&P.set(T.id,-T.rotation[2]);const v={name:"Set Azimuth for All Selected Foundations",timestamp:Date.now(),oldValues:P,newValue:C,undo:()=>{g(v.oldValues)},redo:()=>{g(v.oldValues,-v.newValue)}};i(v),g(P,-C),s(l+1);break}case oe.AllObjectsOfThisType:{const P=new Map;for(const T of e)T.type===z.Foundation&&P.set(T.id,-T.rotation[2]);const v={name:"Set Azimuth for All Foundations",timestamp:Date.now(),oldValues:P,newValue:C,undo:()=>{for(const[T,A]of v.oldValues.entries())o(T,0,0,-A)},redo:()=>{r(z.Foundation,0,0,-v.newValue)}};i(v),r(z.Foundation,0,0,-C),s(l+1);break}default:{const P=n(c.id),v=P?-P.rotation[2]:-c.rotation[2],T={name:"Set Foundation Azimuth",timestamp:Date.now(),oldValue:v,newValue:C,changedElementId:c.id,changedElementType:c.type,undo:()=>{o(T.changedElementId,0,0,-T.oldValue)},redo:()=>{o(T.changedElementId,0,0,-T.newValue)}};i(T),o(c.id,0,0,-C),s(l+1);break}}},w=()=>{t(!1)},b=()=>{y(u)};return h.jsx(so,{width:500,title:Y.t("word.Azimuth",f),onApply:b,onClose:w,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:-180,max:180,style:{width:120},step:.5,precision:2,value:parseFloat(me.toDegrees(u).toFixed(2)),formatter:C=>`${C}°`,onChange:C=>{C!==null&&d(me.toRadians(C))}}),h.jsxs("div",{style:{paddingTop:"20px",paddingRight:"6px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [-180°, 180°]",h.jsx("br",{}),Y.t("message.AzimuthOfNorthIsZero",f),h.jsx("br",{}),Y.t("message.CounterclockwiseAzimuthIsPositive",f)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:C=>H.getState().setFoundationActionScope(C.target.value),value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},guo=({setDialogVisible:t})=>{const e=H(Kn),n=H(s3),o=H(En),r=H($s),i=H(Qwt),a=H(no),l=H(Zn),s=H(Vi),c=H(Gn),u=H(fn),d=H(k=>{if(n){for(const N of k.elements)if(N.id===n.id)return N}return null}),[f,p]=m.useState((d==null?void 0:d.rValue)??o8),[g,y]=m.useState(me.toRValueInUS(f)),[w,b]=m.useState(!1),[C,P]=m.useState({left:0,top:0,bottom:0,right:0}),v=m.useRef(null),T=Jt();m.useEffect(()=>{d&&p((d==null?void 0:d.rValue)??o8)},[d==null?void 0:d.rValue]);const A=k=>{switch(r){case oe.AllObjectsOfThisType:for(const N of e)if(N.type===z.Foundation&&!N.locked){const F=N;if(F.rValue===void 0||Math.abs(F.rValue-k)>It)return!0}break;default:if((d==null?void 0:d.rValue)===void 0||Math.abs((d==null?void 0:d.rValue)-k)>It)return!0}return!1},x=(k,N)=>{u(F=>{for(const U of F.elements)if(U.id===k){U.rValue=N;break}})},S=k=>{for(const[N,F]of k.entries())x(N,F)},R=(k,N)=>{for(const F of k.keys())x(F,N)},M=k=>{if(d&&A(k)){switch(r){case oe.AllObjectsOfThisType:{const N=new Map;u(U=>{for(const O of U.elements)if(O.type===z.Foundation&&!O.locked){const B=O;N.set(O.id,B.rValue??o8),B.rValue=k}});const F={name:"Set R-Value for All Ground Floors",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{S(F.oldValues)},redo:()=>{R(F.oldValues,F.newValue)}};o(F),l(a+1);break}default:{if(d){const F=c(d.id).rValue??d.rValue??o8,U={name:"Set Ground Floor R-Value",timestamp:Date.now(),oldValue:F,newValue:k,changedElementId:d.id,changedElementType:d.type,undo:()=>{x(U.changedElementId,U.oldValue)},redo:()=>{x(U.changedElementId,U.newValue)}};o(U),x(d.id,k),l(a+1)}break}}u(N=>{N.actionState.groundFloorRValue=k})}},D=(k,N)=>{if(v.current){const{clientWidth:F,clientHeight:U}=window.document.documentElement,O=v.current.getBoundingClientRect();P({left:-O.left+N.x,right:F-(O.right-N.x),top:-O.top+N.y,bottom:U-((O==null?void 0:O.bottom)-N.y)})}},E=()=>{p((d==null?void 0:d.rValue)??o8),t(!1)},W=()=>{E(),s()},j=()=>{M(f),t(!1),l(0)},L=()=>{M(f)};return h.jsx(h.Fragment,{children:h.jsx(Oi,{width:550,open:!0,title:h.jsxs("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>b(!0),onMouseOut:()=>b(!1),children:[Y.t("word.RValue",T)+" ","(",Y.t("word.ThermalResistance",T),")"]}),footer:[h.jsx(lo,{onClick:L,children:Y.t("word.Apply",T)},"Apply"),h.jsx(lo,{onClick:W,children:Y.t("word.Cancel",T)},"Cancel"),h.jsx(lo,{type:"primary",onClick:j,children:Y.t("word.OK",T)},"OK")],onCancel:E,maskClosable:!1,destroyOnClose:!1,modalRender:k=>h.jsx(_i,{disabled:!w,bounds:C,onStart:(N,F)=>D(N,F),children:h.jsx("div",{ref:v,children:k})}),children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:f,formatter:k=>Number(k).toFixed(2),onChange:k=>{k!==null&&(p(k),y(me.toRValueInUS(k)))},onPressEnter:j}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",T),": [0.01, 100]",h.jsx("br",{}),Y.t("word.SIUnit",T),": m²·℃/W"]}),h.jsx("br",{}),h.jsx(Mn,{min:me.toRValueInUS(.01),max:me.toRValueInUS(100),style:{width:120},step:.01,precision:2,value:g,formatter:k=>Number(k).toFixed(2),onChange:k=>{k!==null&&(y(k),p(me.toRValueInSI(k)))},onPressEnter:j}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",T),": [",me.toRValueInUS(.01).toFixed(3),", ",me.toRValueInUS(100).toFixed(1),"]",h.jsx("br",{}),Y.t("word.USUnit",T),": h·ft²·℉/Btu"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:k=>i(k.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisGroundFloor",T)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllGroundFloors",T)})]})})})]})})})},muo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarAbsorberPipe,[u,d]=m.useState((c==null?void 0:c.absorberHeight)??10),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberHeight=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusPipe&&(x.solarAbsorberPipe||(x.solarAbsorberPipe={}),x.solarAbsorberPipe.absorberHeight=v)}})},y=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberHeight=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberHeight===void 0||Math.abs(A.solarAbsorberPipe.absorberHeight-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberHeight===void 0||Math.abs(A.solarAbsorberPipe.absorberHeight-v)>It))return!0}break;default:if((c==null?void 0:c.absorberHeight)===void 0||Math.abs((c==null?void 0:c.absorberHeight)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberHeight??10)}const A={name:"Set Absorber Height for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberHeight??10)}const A={name:"Set Absorber Height for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarAbsorberPipe?T.solarAbsorberPipe.absorberHeight??10:c.absorberHeight??10;p(s.id,v);const x={name:"Set Absorber Height on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("solarAbsorberPipeMenu.AbsorberHeight",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:50,style:{width:120},step:.5,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [1, 50] ",Y.t("word.MeterAbbreviation",f)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",f)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},yuo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarAbsorberPipe,[u,d]=m.useState((c==null?void 0:c.apertureWidth)??.6),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.apertureWidth=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusPipe&&(x.solarAbsorberPipe||(x.solarAbsorberPipe={}),x.solarAbsorberPipe.apertureWidth=v)}})},y=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.apertureWidth=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.apertureWidth===void 0||Math.abs(A.solarAbsorberPipe.apertureWidth-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.apertureWidth===void 0||Math.abs(A.solarAbsorberPipe.apertureWidth-v)>It))return!0}break;default:if((c==null?void 0:c.apertureWidth)===void 0||Math.abs((c==null?void 0:c.apertureWidth)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.apertureWidth??.6)}const A={name:"Set Absorber Aperture Width for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.apertureWidth??.6)}const A={name:"Set Absorber Aperture Width for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarAbsorberPipe?T.solarAbsorberPipe.apertureWidth??.6:c.apertureWidth??.6;p(s.id,v);const x={name:"Set Absorber Aperture Width on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("solarAbsorberPipeMenu.AbsorberApertureWidth",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:2,style:{width:120},step:.01,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0.1, 2] ",Y.t("word.MeterAbbreviation",f)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",f)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},Auo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarAbsorberPipe,[u,d]=m.useState((c==null?void 0:c.poleNumber)??5),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.poleNumber=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusPipe&&(x.solarAbsorberPipe||(x.solarAbsorberPipe={}),x.solarAbsorberPipe.poleNumber=v)}})},y=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.poleNumber=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.poleNumber===void 0||A.solarAbsorberPipe.poleNumber!==v))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.poleNumber===void 0||A.solarAbsorberPipe.poleNumber!==v))return!0}break;default:if((c==null?void 0:c.poleNumber)===void 0||(c==null?void 0:c.poleNumber)!==v)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.poleNumber??5)}const A={name:"Set Absorber Pipe Pole Number for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.poleNumber??5)}const A={name:"Set Absorber Pipe Pole Number for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarAbsorberPipe?T.solarAbsorberPipe.poleNumber??5:c.poleNumber??5;p(s.id,v);const x={name:"Set Absorber Pipe Pole Number on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("solarAbsorberPipeMenu.AbsorberPipePoleNumber",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:1,max:100,style:{width:120},step:1,precision:0,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [1, 100]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},wuo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarAbsorberPipe,[u,d]=m.useState((c==null?void 0:c.absorberAbsorptance)??.95),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberAbsorptance=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusPipe&&(x.solarAbsorberPipe||(x.solarAbsorberPipe={}),x.solarAbsorberPipe.absorberAbsorptance=v)}})},y=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberAbsorptance=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberAbsorptance===void 0||Math.abs(A.solarAbsorberPipe.absorberAbsorptance-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberAbsorptance===void 0||Math.abs(A.solarAbsorberPipe.absorberAbsorptance-v)>It))return!0}break;default:if((c==null?void 0:c.absorberAbsorptance)===void 0||Math.abs((c==null?void 0:c.absorberAbsorptance)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberAbsorptance??.95)}const A={name:"Set Absorber Pipe Absorptance for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberAbsorptance??.95)}const A={name:"Set Absorber Pipe Absorptance for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarAbsorberPipe?T.solarAbsorberPipe.absorberAbsorptance??.95:c.absorberAbsorptance??.95;p(s.id,v);const x={name:"Set Absorber Pipe Absorptance on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:500,title:Y.t("solarAbsorberPipeMenu.AbsorberAbsorptance",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},vuo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarAbsorberPipe,[u,d]=m.useState((c==null?void 0:c.absorberOpticalEfficiency)??.7),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberOpticalEfficiency=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusPipe&&(x.solarAbsorberPipe||(x.solarAbsorberPipe={}),x.solarAbsorberPipe.absorberOpticalEfficiency=v)}})},y=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberOpticalEfficiency=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberOpticalEfficiency===void 0||Math.abs(A.solarAbsorberPipe.absorberOpticalEfficiency-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberOpticalEfficiency===void 0||Math.abs(A.solarAbsorberPipe.absorberOpticalEfficiency-v)>It))return!0}break;default:if((c==null?void 0:c.absorberOpticalEfficiency)===void 0||Math.abs((c==null?void 0:c.absorberOpticalEfficiency)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberOpticalEfficiency??.7)}const A={name:"Set Absorber Optical Efficiency for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberOpticalEfficiency??.7)}const A={name:"Set Absorber Optical Efficiency for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarAbsorberPipe?T.solarAbsorberPipe.absorberOpticalEfficiency??.7:c.absorberOpticalEfficiency??.7;p(s.id,v);const x={name:"Set Absorber Optical Efficiency on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:500,title:Y.t("solarAbsorberPipeMenu.AbsorberOpticalEfficiency",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},xuo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarAbsorberPipe,[u,d]=m.useState((c==null?void 0:c.absorberThermalEfficiency)??.3),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberThermalEfficiency=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusPipe&&(x.solarAbsorberPipe||(x.solarAbsorberPipe={}),x.solarAbsorberPipe.absorberThermalEfficiency=v)}})},y=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusPipe&&(S.solarAbsorberPipe||(S.solarAbsorberPipe={}),S.solarAbsorberPipe.absorberThermalEfficiency=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberThermalEfficiency===void 0||Math.abs(A.solarAbsorberPipe.absorberThermalEfficiency-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusPipe&&A.solarAbsorberPipe&&(A.solarAbsorberPipe.absorberThermalEfficiency===void 0||Math.abs(A.solarAbsorberPipe.absorberThermalEfficiency-v)>It))return!0}break;default:if((c==null?void 0:c.absorberThermalEfficiency)===void 0||Math.abs((c==null?void 0:c.absorberThermalEfficiency)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberThermalEfficiency??.3)}const A={name:"Set Absorber Thermal Efficiency for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarAbsorberPipe&&T.set(x.id,S.solarAbsorberPipe.absorberThermalEfficiency??.3)}const A={name:"Set Absorber Thermal Efficiency for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarAbsorberPipe?T.solarAbsorberPipe.absorberThermalEfficiency??.3:c.absorberThermalEfficiency??.3;p(s.id,v);const x={name:"Set Absorber Thermal Efficiency on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:500,title:Y.t("solarAbsorberPipeMenu.AbsorberThermalEfficiency",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},buo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarPowerTower,[u,d]=m.useState((c==null?void 0:c.towerHeight)??20),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.towerHeight=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusTower&&(x.solarPowerTower||(x.solarPowerTower={}),x.solarPowerTower.towerHeight=v)}})},y=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.towerHeight=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.towerHeight===void 0||Math.abs(A.solarPowerTower.towerHeight-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.towerHeight===void 0||Math.abs(A.solarPowerTower.towerHeight-v)>It))return!0}break;default:if((c==null?void 0:c.towerHeight)===void 0||Math.abs((c==null?void 0:c.towerHeight)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.towerHeight??20)}const A={name:"Set Tower Height for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.towerHeight??20)}const A={name:"Set Tower Height for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarPowerTower?T.solarPowerTower.towerHeight??20:c.towerHeight??20;p(s.id,v);const x={name:"Set Tower Height on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("solarPowerTowerMenu.ReceiverTowerHeight",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:10,max:500,style:{width:120},step:1,precision:1,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [10, 500] ",Y.t("word.MeterAbbreviation",f)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",f)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},Suo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarPowerTower,[u,d]=m.useState((c==null?void 0:c.towerRadius)??1),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.towerRadius=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusTower&&(x.solarPowerTower||(x.solarPowerTower={}),x.solarPowerTower.towerRadius=v)}})},y=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.towerRadius=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.towerRadius===void 0||Math.abs(A.solarPowerTower.towerRadius-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.towerRadius===void 0||Math.abs(A.solarPowerTower.towerRadius-v)>It))return!0}break;default:if((c==null?void 0:c.towerRadius)===void 0||Math.abs((c==null?void 0:c.towerRadius)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.towerRadius??1)}const A={name:"Set Tower Radius for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.towerRadius??1)}const A={name:"Set Tower Radius for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarPowerTower?T.solarPowerTower.towerRadius??1:c.towerRadius??1;p(s.id,v);const x={name:"Set Tower Radius on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("solarPowerTowerMenu.ReceiverTowerRadius",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.5,max:10,style:{width:120},step:.5,precision:1,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0.5, 10] ",Y.t("word.MeterAbbreviation",f)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",f)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},Tuo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarPowerTower,[u,d]=m.useState((c==null?void 0:c.receiverAbsorptance)??.95),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.receiverAbsorptance=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusTower&&(x.solarPowerTower||(x.solarPowerTower={}),x.solarPowerTower.receiverAbsorptance=v)}})},y=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.receiverAbsorptance=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.receiverAbsorptance===void 0||Math.abs(A.solarPowerTower.receiverAbsorptance-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.receiverAbsorptance===void 0||Math.abs(A.solarPowerTower.receiverAbsorptance-v)>It))return!0}break;default:if((c==null?void 0:c.receiverAbsorptance)===void 0||Math.abs((c==null?void 0:c.receiverAbsorptance)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.receiverAbsorptance??.95)}const A={name:"Set Receiver Absorptance for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.receiverAbsorptance??.95)}const A={name:"Set Receiver Absorptance for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarPowerTower?T.solarPowerTower.receiverAbsorptance??.95:c.receiverAbsorptance??.95;p(s.id,v);const x={name:"Set Receiver Absorptance on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:500,title:Y.t("solarPowerTowerMenu.ReceiverAbsorptance",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},Puo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarPowerTower,[u,d]=m.useState((c==null?void 0:c.receiverThermalEfficiency)??.3),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.receiverThermalEfficiency=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusTower&&(x.solarPowerTower||(x.solarPowerTower={}),x.solarPowerTower.receiverThermalEfficiency=v)}})},y=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.receiverThermalEfficiency=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.receiverThermalEfficiency===void 0||Math.abs(A.solarPowerTower.receiverThermalEfficiency-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.receiverThermalEfficiency===void 0||Math.abs(A.solarPowerTower.receiverThermalEfficiency-v)>It))return!0}break;default:if((c==null?void 0:c.receiverThermalEfficiency)===void 0||Math.abs((c==null?void 0:c.receiverThermalEfficiency)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.receiverThermalEfficiency??.3)}const A={name:"Set Receiver Thermal Efficiency for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.receiverThermalEfficiency??.3)}const A={name:"Set Receiver Thermal Efficiency for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarPowerTower?T.solarPowerTower.receiverThermalEfficiency??.3:c.receiverThermalEfficiency??.3;p(s.id,v);const x={name:"Set Receiver Thermal Efficiency on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("solarPowerTowerMenu.ReceiverThermalEfficiency",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},Cuo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),c=s==null?void 0:s.solarPowerTower,[u,d]=m.useState((c==null?void 0:c.receiverOpticalEfficiency)??.7),f=Jt(),p=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.receiverOpticalEfficiency=T);break}})},g=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.FocusTower&&(x.solarPowerTower||(x.solarPowerTower={}),x.solarPowerTower.receiverOpticalEfficiency=v)}})},y=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.FocusTower&&(S.solarPowerTower||(S.solarPowerTower={}),S.solarPowerTower.receiverOpticalEfficiency=T)}})},w=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.receiverOpticalEfficiency===void 0||Math.abs(A.solarPowerTower.receiverOpticalEfficiency-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.FocusTower&&A.solarPowerTower&&(A.solarPowerTower.receiverOpticalEfficiency===void 0||Math.abs(A.solarPowerTower.receiverOpticalEfficiency-v)>It))return!0}break;default:if((c==null?void 0:c.receiverOpticalEfficiency)===void 0||Math.abs((c==null?void 0:c.receiverOpticalEfficiency)-v)>It)return!0}return!1},b=v=>{if(!(!s||!c)&&w(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.receiverOpticalEfficiency??.7)}const A={name:"Set Receiver Optical Efficiency for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{y(A.oldValues,A.newValue)}};r(A),y(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarPowerTower&&T.set(x.id,S.solarPowerTower.receiverOpticalEfficiency??.7)}const A={name:"Set Receiver Optical Efficiency for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())p(x,S)},redo:()=>{g(A.newValue)}};r(A),g(v),l(a+1);break}default:{const T=o(s.id),A=T&&T.solarPowerTower?T.solarPowerTower.receiverOpticalEfficiency??.7:c.receiverOpticalEfficiency??.7;p(s.id,v);const x={name:"Set Receiver Optical Efficiency on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};r(x),l(a+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:500,title:Y.t("solarPowerTowerMenu.ReceiverOpticalEfficiency",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:u,onChange:v=>{v!==null&&d(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",f)})]})})})]})})},Ruo=({setDialogVisible:t})=>{var P;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState(((P=s==null?void 0:s.solarUpdraftTower)==null?void 0:P.chimneyHeight)??Math.max((s==null?void 0:s.lx)??0,(s==null?void 0:s.ly)??0)),d=Jt(),f=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.chimneyHeight=T);break}})},p=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.UpdraftTower&&(x.solarUpdraftTower||(x.solarUpdraftTower={}),x.solarUpdraftTower.chimneyHeight=v)}})},g=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.chimneyHeight=T)}})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.chimneyHeight===void 0||Math.abs(A.solarUpdraftTower.chimneyHeight-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.chimneyHeight===void 0||Math.abs(A.solarUpdraftTower.chimneyHeight-v)>It))return!0}break;default:if(s&&s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower&&(s.solarUpdraftTower.chimneyHeight===void 0||Math.abs(s.solarUpdraftTower.chimneyHeight-v)>It))return!0}return!1},w=v=>{var T,A;if(s&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)if(R.type===z.Foundation&&H.getState().selectedElementIdSet.has(R.id)){const M=R;M.solarStructure===Dn.UpdraftTower&&M.solarUpdraftTower&&x.set(R.id,((T=M.solarUpdraftTower)==null?void 0:T.chimneyHeight)??Math.max(M.lx,M.ly))}const S={name:"Set Solar Chimney Height for Selected Foundations",timestamp:Date.now(),oldValues:x,newValue:v,undo:()=>{for(const[R,M]of S.oldValues.entries())f(R,M)},redo:()=>{g(S.oldValues,S.newValue)}};r(S),g(x,v),l(a+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)if(R.type===z.Foundation){const M=R;M.solarStructure===Dn.UpdraftTower&&M.solarUpdraftTower&&x.set(R.id,((A=M.solarUpdraftTower)==null?void 0:A.chimneyHeight)??Math.max(M.lx,M.ly))}const S={name:"Set Solar Chimney Height for All Foundations",timestamp:Date.now(),oldValues:x,newValue:v,undo:()=>{for(const[R,M]of S.oldValues.entries())f(R,M)},redo:()=>{p(S.newValue)}};r(S),p(v),l(a+1);break}default:{if(s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower){const x=o(s.id),S=x&&x.solarUpdraftTower?x.solarUpdraftTower.chimneyHeight??Math.max(x.lx,x.ly):s.solarUpdraftTower.chimneyHeight??Math.max(s.lx,s.ly);f(s.id,v);const R={name:"Set Solar Chimney Height on Foundation",timestamp:Date.now(),oldValue:S,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(R.changedElementId,R.oldValue)},redo:()=>{f(R.changedElementId,R.newValue)}};r(R),l(a+1)}break}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerChimneyHeight",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:1e3,style:{width:120},step:1,precision:1,value:c,onChange:v=>{v!==null&&u(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [1, 1000] ",Y.t("word.MeterAbbreviation",d)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",d)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},Huo=({setDialogVisible:t})=>{var P;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState(((P=s==null?void 0:s.solarUpdraftTower)==null?void 0:P.chimneyRadius)??Math.max(1,.025*Math.min((s==null?void 0:s.lx)??0,(s==null?void 0:s.ly)??0))),d=Jt(),f=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.chimneyRadius=T);break}})},p=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.UpdraftTower&&(x.solarUpdraftTower||(x.solarUpdraftTower={}),x.solarUpdraftTower.chimneyRadius=v)}})},g=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.chimneyRadius=T)}})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.chimneyRadius===void 0||Math.abs(A.solarUpdraftTower.chimneyRadius-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.chimneyRadius===void 0||Math.abs(A.solarUpdraftTower.chimneyRadius-v)>It))return!0}break;default:if(s&&s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower&&(s.solarUpdraftTower.chimneyRadius===void 0||Math.abs(s.solarUpdraftTower.chimneyRadius-v)>It))return!0}return!1},w=v=>{var T,A;if(s&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)if(R.type===z.Foundation&&H.getState().selectedElementIdSet.has(R.id)){const M=R;M.solarStructure===Dn.UpdraftTower&&M.solarUpdraftTower&&x.set(R.id,((T=M.solarUpdraftTower)==null?void 0:T.chimneyRadius)??Math.max(1,.025*Math.min(M.lx,M.ly)))}const S={name:"Set Solar Chimney Radius for Selected Foundations",timestamp:Date.now(),oldValues:x,newValue:v,undo:()=>{for(const[R,M]of S.oldValues.entries())f(R,M)},redo:()=>{g(S.oldValues,S.newValue)}};r(S),g(x,v),l(a+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)if(R.type===z.Foundation){const M=R;M.solarStructure===Dn.UpdraftTower&&M.solarUpdraftTower&&x.set(R.id,((A=M.solarUpdraftTower)==null?void 0:A.chimneyRadius)??Math.max(1,.025*Math.min(M.lx,M.ly)))}const S={name:"Set Solar Chimney Radius for All Foundations",timestamp:Date.now(),oldValues:x,newValue:v,undo:()=>{for(const[R,M]of S.oldValues.entries())f(R,M)},redo:()=>{p(S.newValue)}};r(S),p(v),l(a+1);break}default:{if(s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower){const x=o(s.id),S=x&&x.solarUpdraftTower?x.solarUpdraftTower.chimneyRadius??Math.max(1,.025*Math.min(x.lx,x.ly)):s.solarUpdraftTower.chimneyRadius??Math.max(1,.025*Math.min(s.lx,s.ly));f(s.id,v);const R={name:"Set Solar Chimney Radius on Foundation",timestamp:Date.now(),oldValue:S,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(R.changedElementId,R.oldValue)},redo:()=>{f(R.changedElementId,R.newValue)}};r(R),l(a+1)}break}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerChimneyRadius",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:10,style:{width:120},step:1,precision:1,value:c,onChange:v=>{v!==null&&u(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0.1, 10] ",Y.t("word.MeterAbbreviation",d)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",d)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},Muo=({setDialogVisible:t})=>{var b;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=co(z.Foundation),[l,s]=m.useState(((b=a==null?void 0:a.solarUpdraftTower)==null?void 0:b.collectorHeight)??Math.max(3,10*((a==null?void 0:a.lz)??0))),c=Jt(),u=(C,P)=>{e(v=>{for(const T of v.elements)if(T.type===z.Foundation&&T.id===C&&!T.locked){const A=T;A.solarStructure===Dn.UpdraftTower&&(A.solarUpdraftTower||(A.solarUpdraftTower={}),A.solarUpdraftTower.collectorHeight=P);break}})},d=C=>{e(P=>{for(const v of P.elements)if(v.type===z.Foundation&&!v.locked){const T=v;T.solarStructure===Dn.UpdraftTower&&(T.solarUpdraftTower||(T.solarUpdraftTower={}),T.solarUpdraftTower.collectorHeight=C)}})},f=(C,P)=>{e(v=>{for(const T of v.elements)if(T.type===z.Foundation&&!T.locked&&C.has(T.id)){const A=T;A.solarStructure===Dn.UpdraftTower&&(A.solarUpdraftTower||(A.solarUpdraftTower={}),A.solarUpdraftTower.collectorHeight=P)}})},p=C=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const P of n)if(P.type===z.Foundation&&!P.locked&&H.getState().selectedElementIdSet.has(P.id)){const v=P;if(v.solarStructure===Dn.UpdraftTower&&v.solarUpdraftTower&&(v.solarUpdraftTower.collectorHeight===void 0||Math.abs(v.solarUpdraftTower.collectorHeight-C)>It))return!0}break;case oe.AllObjectsOfThisType:for(const P of n)if(P.type===z.Foundation&&!P.locked){const v=P;if(v.solarStructure===Dn.UpdraftTower&&v.solarUpdraftTower&&(v.solarUpdraftTower.collectorHeight===void 0||Math.abs(v.solarUpdraftTower.collectorHeight-C)>It))return!0}break;default:if(a&&a.solarStructure===Dn.UpdraftTower&&a.solarUpdraftTower&&(a.solarUpdraftTower.collectorHeight===void 0||Math.abs(a.solarUpdraftTower.collectorHeight-C)>It))return!0}return!1},g=C=>{if(a&&p(C))switch(i){case oe.AllSelectedObjectsOfThisType:{const P=new Map;for(const T of n)if(T.type===z.Foundation&&H.getState().selectedElementIdSet.has(T.id)){const A=T;A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&P.set(T.id,A.solarUpdraftTower.collectorHeight??Math.max(3,10*A.lz))}const v={name:"Set Solar Collector Height for Selected Foundations",timestamp:Date.now(),oldValues:P,newValue:C,undo:()=>{for(const[T,A]of v.oldValues.entries())u(T,A)},redo:()=>{f(v.oldValues,v.newValue)}};r(v),f(P,C);break}case oe.AllObjectsOfThisType:{const P=new Map;for(const T of n)if(T.type===z.Foundation){const A=T;A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&P.set(T.id,A.solarUpdraftTower.collectorHeight??Math.max(3,10*A.lz))}const v={name:"Set Solar Collector Height for All Foundations",timestamp:Date.now(),oldValues:P,newValue:C,undo:()=>{for(const[T,A]of v.oldValues.entries())u(T,A)},redo:()=>{d(v.newValue)}};r(v),d(C);break}default:{if(a.solarStructure===Dn.UpdraftTower&&a.solarUpdraftTower){const P=o(a.id),v=P&&P.solarUpdraftTower?P.solarUpdraftTower.collectorHeight??Math.max(3,10*P.lz):a.solarUpdraftTower.collectorHeight??Math.max(3,10*a.lz);u(a.id,C);const T={name:"Set Solar Collector Height on Foundation",timestamp:Date.now(),oldValue:v,newValue:C,changedElementId:a.id,changedElementType:a.type,undo:()=>{u(T.changedElementId,T.oldValue)},redo:()=>{u(T.changedElementId,T.newValue)}};r(T)}break}}},y=()=>{t(!1)},w=()=>{g(l)};return h.jsx(so,{width:550,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorHeight",c),onApply:w,onClose:y,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:20,style:{width:120},step:1,precision:1,value:l,onChange:C=>{C!==null&&s(C)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",c),": [0.1, 20] ",Y.t("word.MeterAbbreviation",c)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",c)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:C=>H.getState().setFoundationActionScope(C.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",c)})]})})})]})})},Iuo=({setDialogVisible:t})=>{var P;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState(((P=s==null?void 0:s.solarUpdraftTower)==null?void 0:P.collectorRadius)??Math.max(10,.5*Math.min((s==null?void 0:s.lx)??0,(s==null?void 0:s.ly)??0))),d=Jt(),f=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.collectorRadius=T);break}})},p=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.UpdraftTower&&(x.solarUpdraftTower||(x.solarUpdraftTower={}),x.solarUpdraftTower.collectorRadius=v)}})},g=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.collectorRadius=T)}})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.collectorRadius===void 0||Math.abs(A.solarUpdraftTower.collectorRadius-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.collectorRadius===void 0||Math.abs(A.solarUpdraftTower.collectorRadius-v)>It))return!0}break;default:if(s&&s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower&&(s.solarUpdraftTower.collectorRadius===void 0||Math.abs(s.solarUpdraftTower.collectorRadius-v)>It))return!0}return!1},w=v=>{if(s&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.collectorRadius??Math.max(10,.5*Math.min(S.lx,S.ly)))}const A={name:"Set Solar Collector Radius for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{g(A.oldValues,A.newValue)}};r(A),g(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.collectorRadius??Math.max(10,.5*Math.min(S.lx,S.ly)))}const A={name:"Set Solar Collector Radius for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{p(A.newValue)}};r(A),p(v),l(a+1);break}default:{if(s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower){const T=o(s.id),A=T&&T.solarUpdraftTower?T.solarUpdraftTower.collectorRadius??Math.max(10,.5*Math.min(T.lx,T.ly)):s.solarUpdraftTower.collectorRadius??Math.max(10,.5*Math.min(s.lx,s.ly));f(s.id,v);const x={name:"Set Solar Collector Radius on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(x.changedElementId,x.oldValue)},redo:()=>{f(x.changedElementId,x.newValue)}};r(x),l(a+1)}break}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorRadius",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:1e3,style:{width:120},step:1,precision:1,value:c,onChange:v=>{v!==null&&u(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [1, 1000] ",Y.t("word.MeterAbbreviation",d)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",d)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},zuo=({setDialogVisible:t})=>{var P;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState(((P=s==null?void 0:s.solarUpdraftTower)==null?void 0:P.collectorTransmissivity)??.9),d=Jt(),f=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.collectorTransmissivity=T);break}})},p=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.UpdraftTower&&(x.solarUpdraftTower||(x.solarUpdraftTower={}),x.solarUpdraftTower.collectorTransmissivity=v)}})},g=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.collectorTransmissivity=T)}})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.collectorTransmissivity===void 0||Math.abs(A.solarUpdraftTower.collectorTransmissivity-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.collectorTransmissivity===void 0||Math.abs(A.solarUpdraftTower.collectorTransmissivity-v)>It))return!0}break;default:if(s&&s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower&&(s.solarUpdraftTower.collectorTransmissivity===void 0||Math.abs(s.solarUpdraftTower.collectorTransmissivity-v)>It))return!0}return!1},w=v=>{if(s&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.collectorTransmissivity??.9)}const A={name:"Set Solar Collector Transmissivity for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{g(A.oldValues,A.newValue)}};r(A),g(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.collectorTransmissivity??.9)}const A={name:"Set Solar Collector Transmissivity for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{p(A.newValue)}};r(A),p(v),l(a+1);break}default:{if(s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower){const T=o(s.id),A=T&&T.solarUpdraftTower?T.solarUpdraftTower.collectorTransmissivity??.9:s.solarUpdraftTower.collectorTransmissivity??.9;f(s.id,v);const x={name:"Set Solar Collector Transmissivity on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(x.changedElementId,x.oldValue)},redo:()=>{f(x.changedElementId,x.newValue)}};r(x),l(a+1)}break}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:540,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorTransmissivity",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:c,onChange:v=>{v!==null&&u(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",marginLeft:"16px",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},Duo=({setDialogVisible:t})=>{var P;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState(((P=s==null?void 0:s.solarUpdraftTower)==null?void 0:P.collectorEmissivity)??.95),d=Jt(),f=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.collectorEmissivity=T);break}})},p=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.UpdraftTower&&(x.solarUpdraftTower||(x.solarUpdraftTower={}),x.solarUpdraftTower.collectorEmissivity=v)}})},g=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.collectorEmissivity=T)}})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.collectorEmissivity===void 0||Math.abs(A.solarUpdraftTower.collectorEmissivity-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.collectorEmissivity===void 0||Math.abs(A.solarUpdraftTower.collectorEmissivity-v)>It))return!0}break;default:if(s&&s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower&&(s.solarUpdraftTower.collectorEmissivity===void 0||Math.abs(s.solarUpdraftTower.collectorEmissivity-v)>It))return!0}return!1},w=v=>{if(s&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.collectorEmissivity??.95)}const A={name:"Set Solar Collector Emissivity for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{g(A.oldValues,A.newValue)}};r(A),g(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.collectorEmissivity??.95)}const A={name:"Set Solar Collector Emissivity for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{p(A.newValue)}};r(A),p(v),l(a+1);break}default:{if(s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower){const T=o(s.id),A=T&&T.solarUpdraftTower?T.solarUpdraftTower.collectorEmissivity??.95:s.solarUpdraftTower.collectorEmissivity??.95;f(s.id,v);const x={name:"Set Solar Collector Emissivity on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(x.changedElementId,x.oldValue)},redo:()=>{f(x.changedElementId,x.newValue)}};r(x),l(a+1)}break}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:540,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorEmissivity",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.01,max:1,style:{width:120},step:.01,precision:2,value:c,onChange:v=>{v!==null&&u(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",marginLeft:"16px",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},Euo=({setDialogVisible:t})=>{var P;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState(((P=s==null?void 0:s.solarUpdraftTower)==null?void 0:P.dischargeCoefficient)??.65),d=Jt(),f=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.dischargeCoefficient=T);break}})},p=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.UpdraftTower&&(x.solarUpdraftTower||(x.solarUpdraftTower={}),x.solarUpdraftTower.dischargeCoefficient=v)}})},g=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.dischargeCoefficient=T)}})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.dischargeCoefficient===void 0||Math.abs(A.solarUpdraftTower.dischargeCoefficient-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.dischargeCoefficient===void 0||Math.abs(A.solarUpdraftTower.dischargeCoefficient-v)>It))return!0}break;default:if(s&&s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower&&(s.solarUpdraftTower.dischargeCoefficient===void 0||Math.abs(s.solarUpdraftTower.dischargeCoefficient-v)>It))return!0}return!1},w=v=>{if(s&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.dischargeCoefficient??.65)}const A={name:"Set Solar Chimney Discharge Coefficient for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{g(A.oldValues,A.newValue)}};r(A),g(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.dischargeCoefficient??.65)}const A={name:"Set Solar Chimney Discharge Coefficient for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{p(A.newValue)}};r(A),p(v),l(a+1);break}default:{if(s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower){const T=o(s.id),A=T&&T.solarUpdraftTower?T.solarUpdraftTower.dischargeCoefficient??.65:s.solarUpdraftTower.dischargeCoefficient??.65;f(s.id,v);const x={name:"Set Solar Chimney Discharge Coefficient on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(x.changedElementId,x.oldValue)},redo:()=>{f(x.changedElementId,x.newValue)}};r(x),l(a+1)}break}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:540,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerDischargeCoefficient",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.65,max:.7,style:{width:120},step:.01,precision:2,value:c,onChange:v=>{v!==null&&u(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0.65, 0.70]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",marginLeft:"16px",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},Fuo=({setDialogVisible:t})=>{var P;const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H($s),a=H(no),l=H(Zn),s=co(z.Foundation),[c,u]=m.useState(((P=s==null?void 0:s.solarUpdraftTower)==null?void 0:P.turbineEfficiency)??.3),d=Jt(),f=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&x.id===v&&!x.locked){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.turbineEfficiency=T);break}})},p=v=>{e(T=>{for(const A of T.elements)if(A.type===z.Foundation&&!A.locked){const x=A;x.solarStructure===Dn.UpdraftTower&&(x.solarUpdraftTower||(x.solarUpdraftTower={}),x.solarUpdraftTower.turbineEfficiency=v)}})},g=(v,T)=>{e(A=>{for(const x of A.elements)if(x.type===z.Foundation&&!x.locked&&v.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&(S.solarUpdraftTower||(S.solarUpdraftTower={}),S.solarUpdraftTower.turbineEfficiency=T)}})},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.turbineEfficiency===void 0||Math.abs(A.solarUpdraftTower.turbineEfficiency-v)>It))return!0}break;case oe.AllObjectsOfThisType:for(const T of n)if(T.type===z.Foundation&&!T.locked){const A=T;if(A.solarStructure===Dn.UpdraftTower&&A.solarUpdraftTower&&(A.solarUpdraftTower.turbineEfficiency===void 0||Math.abs(A.solarUpdraftTower.turbineEfficiency-v)>It))return!0}break;default:if(s&&s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower&&(s.solarUpdraftTower.turbineEfficiency===void 0||Math.abs(s.solarUpdraftTower.turbineEfficiency-v)>It))return!0}return!1},w=v=>{if(s&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation&&H.getState().selectedElementIdSet.has(x.id)){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.turbineEfficiency??.3)}const A={name:"Set Solar Updraft Tower Turbine Efficiency for Selected Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{g(A.oldValues,A.newValue)}};r(A),g(T,v),l(a+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of n)if(x.type===z.Foundation){const S=x;S.solarStructure===Dn.UpdraftTower&&S.solarUpdraftTower&&T.set(x.id,S.solarUpdraftTower.turbineEfficiency??.3)}const A={name:"Set Solar Updraft Tower Turbine Efficiency for All Foundations",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())f(x,S)},redo:()=>{p(A.newValue)}};r(A),p(v),l(a+1);break}default:{if(s.solarStructure===Dn.UpdraftTower&&s.solarUpdraftTower){const T=o(s.id),A=T&&T.solarUpdraftTower?T.solarUpdraftTower.turbineEfficiency??.3:s.solarUpdraftTower.turbineEfficiency??.3;f(s.id,v);const x={name:"Set Solar Updraft Tower Turbine Efficiency on Foundation",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(x.changedElementId,x.oldValue)},redo:()=>{f(x.changedElementId,x.newValue)}};r(x),l(a+1)}break}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:540,title:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerTurbineEfficiency",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.2,max:1,style:{width:120},step:.01,precision:2,value:c,onChange:v=>{v!==null&&u(v)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0.2, 1.0]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",marginLeft:"16px",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setFoundationActionScope(v.target.value),value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("foundationMenu.OnlyThisFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("foundationMenu.AllSelectedFoundations",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("foundationMenu.AllFoundations",d)})]})})})]})})},{Option:XT}=_o,kuo=({setDialogVisible:t})=>{const e=H(fn),n=H(da),o=H(s0),r=ht(n5),[i,a]=m.useState(!1),[l,s]=m.useState(!1),[c,u]=m.useState({left:0,top:0,bottom:0,right:0}),d=m.useRef(null),f=H(wA).geneticAlgorithmParams,p=m.useRef(f.selectionMethod),g=m.useRef(f.searchMethod),y=m.useRef(Math.min(f.objectiveFunctionType,To.YEARLY_TOTAL_OUTPUT)),w=m.useRef(f.populationSize),b=m.useRef(f.maximumGenerations),C=m.useRef(f.mutationRate),P=m.useRef(f.selectionRate??.5),v=m.useRef(f.crossoverRate??.5),T=m.useRef(f.convergenceThreshold),A=m.useRef(f.localSearchRadius),x=m.useRef(null);m.useEffect(()=>{var W;(W=x.current)==null||W.focus()},[]);const S={lng:o},R=(W,j)=>{if(d.current){const{clientWidth:L,clientHeight:k}=window.document.documentElement,N=d.current.getBoundingClientRect();u({left:-N.left+j.x,right:L-(N.right-j.x),top:-N.top+j.y,bottom:k-((N==null?void 0:N.bottom)-j.y)})}},M=()=>{e(W=>{W.evolutionaryAlgorithmState.geneticAlgorithmParams.problem=Pi.SOLAR_PANEL_TILT_ANGLE,W.evolutionaryAlgorithmState.geneticAlgorithmParams.objectiveFunctionType=y.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.selectionMethod=p.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.searchMethod=g.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.populationSize=w.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.maximumGenerations=b.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.selectionRate=P.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.crossoverRate=v.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.mutationRate=C.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.convergenceThreshold=T.current,W.evolutionaryAlgorithmState.geneticAlgorithmParams.localSearchRadius=A.current})},D=()=>{r||hn(E("message.EvolutionStarted",S)),M(),setTimeout(()=>{ht.getState().set(W=>{W.runEvolution=!W.runEvolution}),e(W=>{W.evolutionMethod=Vs.GENETIC_ALGORITHM,W.evolutionaryAlgorithmState.geneticAlgorithmParams.problem=Pi.SOLAR_PANEL_TILT_ANGLE,n&&(W.actionInfo={name:"Run Genetic Algorithm for Solar Panel Tilt Angle",timestamp:new Date().getTime()})})},100)},{t:E}=Vl();return h.jsx(h.Fragment,{children:h.jsxs(Oi,{width:640,open:!0,title:h.jsxs("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>s(!0),onMouseOut:()=>s(!1),children:[E("optimizationMenu.SolarPanelTiltAngleOptimization",S)+": ",E("optimizationMenu.GeneticAlgorithmSettings",S)]}),footer:[h.jsx(lo,{onClick:()=>{t(!1)},children:E("word.Cancel",S)},"Cancel"),h.jsx(lo,{type:"primary",ref:x,onClick:()=>{D(),t(!1)},children:E("word.Run",S)},"Run")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:W=>h.jsx(_i,{disabled:!l,bounds:c,onStart:(j,L)=>R(j,L),children:h.jsx("div",{ref:d,children:W})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.Objective",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:y.current,style:{width:"100%"},value:y.current,onChange:W=>{y.current=W,a(!i)},children:[h.jsx(XT,{value:To.DAILY_TOTAL_OUTPUT,children:E("optimizationMenu.ObjectiveFunctionDailyTotalYield",S)},To.DAILY_TOTAL_OUTPUT),h.jsx(XT,{value:To.YEARLY_TOTAL_OUTPUT,children:E("optimizationMenu.ObjectiveFunctionYearlyTotalYield",S)},To.YEARLY_TOTAL_OUTPUT)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.GeneticAlgorithmSelectionMethod",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:p.current,style:{width:"100%"},value:p.current,onChange:W=>{p.current=W,a(!i)},children:[h.jsx(XT,{value:Wm.ROULETTE_WHEEL,children:E("optimizationMenu.RouletteWheel",S)},Wm.ROULETTE_WHEEL),h.jsx(XT,{value:Wm.TOURNAMENT,children:E("optimizationMenu.Tournament",S)},Wm.TOURNAMENT)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.PopulationSize",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:10,max:100,style:{width:"100%"},precision:0,formatter:W=>Number(W).toFixed(0),value:w.current,step:1,onChange:W=>{W!==null&&(w.current=Number(W),a(!i))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.MaximumGenerations",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:5,max:100,step:1,style:{width:"100%"},precision:0,formatter:W=>Number(W).toFixed(0),value:b.current,onChange:W=>{W!==null&&(b.current=Number(W),a(!i))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.SelectionRate",S)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:P.current,step:.01,onChange:W=>{W!==null&&(P.current=Number(W),a(!i))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.CrossoverRate",S)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:v.current,step:.01,onChange:W=>{W!==null&&(v.current=Number(W),a(!i))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.MutationRate",S)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:C.current,step:.01,onChange:W=>{W!==null&&(C.current=Number(W),a(!i))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.ConvergenceThreshold",S)+" [0, 0.1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:.001,max:.1,style:{width:"100%"},precision:3,value:T.current,step:.001,onChange:W=>{W!==null&&(T.current=Number(W),a(!i))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.SearchMethod",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:g.current,style:{width:"100%"},value:g.current,onChange:W=>{g.current=Number(W),a(!i)},children:[h.jsx(XT,{value:us.GLOBAL_SEARCH_UNIFORM_SELECTION,children:E("optimizationMenu.GlobalSearchUniformSelection",S)},us.GLOBAL_SEARCH_UNIFORM_SELECTION),h.jsx(XT,{value:us.LOCAL_SEARCH_RANDOM_OPTIMIZATION,children:E("optimizationMenu.LocalSearchRandomOptimization",S)},us.LOCAL_SEARCH_RANDOM_OPTIMIZATION)]})})]}),g.current===us.LOCAL_SEARCH_RANDOM_OPTIMIZATION&&h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.LocalSearchRadius",S)+" ([0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:A.current,step:.01,onChange:W=>{W!==null&&(A.current=Number(W),a(!i))}})})]})]})})},{Option:jO}=_o,Luo=({setDialogVisible:t})=>{const e=H(fn),n=H(da),o=H(s0),r=ht(n5),i=H(wA).particleSwarmOptimizationParams,[a,l]=m.useState(!1),[s,c]=m.useState(!1),[u,d]=m.useState({left:0,top:0,bottom:0,right:0}),f=m.useRef(null),p=m.useRef(Math.min(i.objectiveFunctionType,To.YEARLY_TOTAL_OUTPUT)),g=m.useRef(i.searchMethod),y=m.useRef(i.swarmSize),w=m.useRef(i.maximumSteps),b=m.useRef(i.vmax??.01),C=m.useRef(i.inertia??.8),P=m.useRef(i.cognitiveCoefficient??.1),v=m.useRef(i.socialCoefficient??.1),T=m.useRef(i.convergenceThreshold),A=m.useRef(i.localSearchRadius),x=m.useRef(null);m.useEffect(()=>{var W;(W=x.current)==null||W.focus()},[]);const S={lng:o},R=(W,j)=>{if(f.current){const{clientWidth:L,clientHeight:k}=window.document.documentElement,N=f.current.getBoundingClientRect();d({left:-N.left+j.x,right:L-(N.right-j.x),top:-N.top+j.y,bottom:k-((N==null?void 0:N.bottom)-j.y)})}},M=()=>{e(W=>{W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.problem=Pi.SOLAR_PANEL_TILT_ANGLE,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.objectiveFunctionType=p.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.searchMethod=g.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.swarmSize=y.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.maximumSteps=w.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.cognitiveCoefficient=P.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.socialCoefficient=v.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.vmax=b.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.inertia=C.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.convergenceThreshold=T.current,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.localSearchRadius=A.current})},D=()=>{r||hn(E("message.EvolutionStarted",S)),M(),setTimeout(()=>{ht.getState().set(W=>{W.runEvolution=!W.runEvolution}),e(W=>{W.evolutionMethod=Vs.PARTICLE_SWARM_OPTIMIZATION,W.evolutionaryAlgorithmState.particleSwarmOptimizationParams.problem=Pi.SOLAR_PANEL_TILT_ANGLE,n&&(W.actionInfo={name:"Run Particle Swarm Optimization for Solar Panel Tilt Angle",timestamp:new Date().getTime()})})},100)},{t:E}=Vl();return h.jsx(h.Fragment,{children:h.jsxs(Oi,{width:640,open:!0,title:h.jsxs("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>c(!0),onMouseOut:()=>c(!1),children:[E("optimizationMenu.SolarPanelTiltAngleOptimization",S)+": ",E("optimizationMenu.ParticleSwarmOptimizationSettings",S)]}),footer:[h.jsx(lo,{onClick:()=>{t(!1)},children:E("word.Cancel",S)},"Cancel"),h.jsx(lo,{type:"primary",ref:x,onClick:()=>{D(),t(!1)},children:E("word.Run",S)},"Run")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:W=>h.jsx(_i,{disabled:!s,bounds:u,onStart:(j,L)=>R(j,L),children:h.jsx("div",{ref:f,children:W})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.Objective",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:p.current,style:{width:"100%"},value:p.current,onChange:W=>{p.current=W,l(!a)},children:[h.jsx(jO,{value:To.DAILY_TOTAL_OUTPUT,children:E("optimizationMenu.ObjectiveFunctionDailyTotalYield",S)},To.DAILY_TOTAL_OUTPUT),h.jsx(jO,{value:To.YEARLY_TOTAL_OUTPUT,children:E("optimizationMenu.ObjectiveFunctionYearlyTotalYield",S)},To.YEARLY_TOTAL_OUTPUT)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.SwarmSize",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:10,max:100,style:{width:"100%"},precision:0,value:y.current,step:1,formatter:W=>Number(W).toFixed(0),onChange:W=>{y.current=Number(W),l(!a)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.MaximumSteps",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:5,max:100,step:1,style:{width:"100%"},precision:0,value:w.current,formatter:W=>Number(W).toFixed(0),onChange:W=>{w.current=Number(W),l(!a)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.CognitiveCoefficient",S)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:P.current,step:.01,onChange:W=>{P.current=Number(W),l(!a)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.SocialCoefficient",S)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:v.current,step:.01,onChange:W=>{v.current=Number(W),l(!a)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.InertiaWeight",S)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:C.current,step:.01,onChange:W=>{C.current=Number(W),l(!a)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.MaximumVelocity",S)+" [0.001, 0.1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:.001,max:.1,style:{width:"100%"},precision:3,value:b.current,step:.001,onChange:W=>{b.current=Number(W),l(!a)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.ConvergenceThreshold",S)+" [0, 0.1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:.001,max:.1,style:{width:"100%"},precision:3,value:T.current,step:.001,onChange:W=>{T.current=Number(W),l(!a)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.SearchMethod",S)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:g.current,style:{width:"100%"},value:g.current,onChange:W=>{g.current=Number(W),l(!a)},children:[h.jsx(jO,{value:us.GLOBAL_SEARCH_UNIFORM_SELECTION,children:E("optimizationMenu.GlobalSearchUniformSelection",S)},us.GLOBAL_SEARCH_UNIFORM_SELECTION),h.jsx(jO,{value:us.LOCAL_SEARCH_RANDOM_OPTIMIZATION,children:E("optimizationMenu.LocalSearchRandomOptimization",S)},us.LOCAL_SEARCH_RANDOM_OPTIMIZATION)]})})]}),g.current===us.LOCAL_SEARCH_RANDOM_OPTIMIZATION&&h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:E("optimizationMenu.LocalSearchRadius",S)+" ([0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:A.current,step:.01,onChange:W=>{A.current=Number(W),l(!a)}})})]})]})})},hy=({children:t,width:e="90px"})=>h.jsx("div",{style:{width:e},children:t}),Wuo=({element:t})=>{const e=not(t),n=Jt();return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:!!(t!=null&&t.showLabel),onChange:e,children:Y.t("labelSubMenu.KeepShowingLabel",n)})})},Nuo=({element:t})=>{const{labelText:e,setLabelText:n}=tot(t),o=oot(t,e),r=Jt();return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(as,{addonBefore:h.jsx(hy,{children:Y.t("labelSubMenu.LabelText",r)+":"}),value:e,onChange:i=>n(i.target.value),onPressEnter:o,onBlur:o})})},Uuo=({element:t})=>{const e=dGn(t),n=Jt();return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsx(hy,{children:Y.t("labelSubMenu.LabelHeight",n)+":"}),min:t.lz/2+.2,max:100,step:1,precision:1,value:t.labelHeight??t.lz/2+.2,onChange:o=>e(o)})})},juo=({element:t})=>{const e=sGn(t),n=Jt();return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsx(hy,{children:Y.t("labelSubMenu.LabelFontSize",n)+":"}),min:10,max:100,step:1,precision:0,value:t.labelFontSize??20,onChange:o=>e(o)})})},Buo=({element:t})=>{const e=cGn(t),n=Jt();return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsx(hy,{children:Y.t("labelSubMenu.LabelSize",n)+":"}),min:.2,max:5,step:.1,precision:1,value:t.labelSize??.2,onChange:o=>e(o)})})},Yuo=({element:t})=>{const e=uGn(t),n=Jt();return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(as,{addonBefore:h.jsx(hy,{children:Y.t("labelSubMenu.LabelColor",n)+":"}),value:t.labelColor??"#ffffff",onChange:o=>e(o.target.value)})})},PA=t=>[{key:`${t.type}-show-label`,label:h.jsx(Wuo,{element:t})},{key:`${t.type}-label-text`,label:h.jsx(Nuo,{element:t})},{key:`${t.type}-label-height`,label:h.jsx(Uuo,{element:t})},{key:`${t.type}-label-font-size`,label:h.jsx(juo,{element:t})},{key:`${t.type}-label-size`,label:h.jsx(Buo,{element:t})},{key:`${t.type}-label-color`,label:h.jsx(Yuo,{element:t})}],Ouo=[{key:"windowCount",objectType:z.Window},{key:"doorCount",objectType:z.Door},{key:"sensorCount",objectType:z.Sensor},{key:"outsideLightCount",objectType:z.Light},{key:"parabolicTroughCount",objectType:z.ParabolicTrough},{key:"parabolicDishCount",objectType:z.ParabolicDish},{key:"fresnelReflectorCount",objectType:z.FresnelReflector},{key:"heliostatCount",objectType:z.Heliostat},{key:"windTurbineCount",objectType:z.WindTurbine},{key:"polygonCount",objectType:z.Polygon},{key:"humanCount",objectType:z.Human},{key:"treeCount",objectType:z.Tree},{key:"flowerCount",objectType:z.Flower}],PHe=(t,e)=>{const n={lng:H.getState().language};let o="",r="";switch(t){case z.Wall:{o=`${Y.t("foundationMenu.RemoveAllUnlockedWalls",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllWallsOnFoundation",n)} (${e} ${Y.t("foundationMenu.Walls",n)})`;break}case z.Window:{o=`${Y.t("foundationMenu.RemoveAllUnlockedWindows",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllWindowsOnFoundation",n)} (${e} ${Y.t("foundationMenu.Windows",n)})`;break}case z.Door:{o=`${Y.t("foundationMenu.RemoveAllUnlockedDoors",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllDoorsOnFoundation",n)} (${e} ${Y.t("foundationMenu.Doors",n)})`;break}case z.Sensor:{o=`${Y.t("foundationMenu.RemoveAllUnlockedSensors",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllSensorsOnFoundation",n)} (${e} ${Y.t("foundationMenu.Sensors",n)})`;break}case z.Light:{o=`${Y.t("foundationMenu.RemoveAllUnlockedLights",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllLightsOnFoundation",n)} (${e} ${Y.t("foundationMenu.Lights",n)})`;break}case z.ParabolicTrough:{o=`${Y.t("foundationMenu.RemoveAllUnlockedParabolicTroughs",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllParabolicTroughsOnFoundation",n)} (${e} ${Y.t("foundationMenu.ParabolicTroughs",n)})`;break}case z.ParabolicDish:{o=`${Y.t("foundationMenu.RemoveAllUnlockedParabolicDishes",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllParabolicDishesOnFoundation",n)} (${e} ${Y.t("foundationMenu.ParabolicDishes",n)})`;break}case z.FresnelReflector:{o=`${Y.t("foundationMenu.RemoveAllUnlockedFresnelReflectors",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllFresnelReflectorsOnFoundation",n)} (${e} ${Y.t("foundationMenu.FresnelReflectors",n)})`;break}case z.Heliostat:{o=`${Y.t("foundationMenu.RemoveAllUnlockedHeliostats",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllHeliostatsOnFoundation",n)} (${e} ${Y.t("foundationMenu.Heliostats",n)})`;break}case z.WindTurbine:{o=`${Y.t("foundationMenu.RemoveAllUnlockedWindTurbines",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllWindTurbinesOnFoundation",n)} (${e} ${Y.t("foundationMenu.WindTurbines",n)})`;break}case z.Polygon:{o=`${Y.t("foundationMenu.RemoveAllUnlockedPolygons",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllPolygonsOnFoundation",n)} (${e} ${Y.t("foundationMenu.Polygons",n)})`;break}case z.Human:{o=`${Y.t("foundationMenu.RemoveAllUnlockedHumans",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllHumansOnFoundation",n)} (${e} ${Y.t("foundationMenu.Humans",n)})`;break}case z.Tree:{o=`${Y.t("foundationMenu.RemoveAllUnlockedTrees",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllTreesOnFoundation",n)} (${e} ${Y.t("foundationMenu.Trees",n)})`;break}case z.Flower:{o=`${Y.t("foundationMenu.RemoveAllUnlockedFlowers",n)} (${e})`,r=`${Y.t("foundationMenu.DoYouReallyWantToRemoveAllFlowersOnFoundation",n)} (${e} ${Y.t("foundationMenu.Flowers",n)})`;break}}return{itemLabel:o,modalTitle:r}},_uo=(t,e,n)=>n===z.Light?t.insideLightCount+t.outsideLightCount:t[e],Vuo=t=>{const e=H.getState().set,n=new Set;H.getState().elements.forEach(a=>{!a.locked&&a.type===z.Wall&&(a.parentId===t.id||a.foundationId===t.id)&&n.add(a.id)});const o=H.getState().elements.filter(a=>n.has(a.id)||n.has(a.parentId));e(a=>{a.elements=a.elements.filter(l=>!n.has(l.id)&&!n.has(l.parentId))});const r=JSON.parse(JSON.stringify(o)),i={name:"Remove All Walls on Foundation",timestamp:Date.now(),parentId:t.id,removedElements:r,undo:()=>{e(a=>{a.elements.push(...i.removedElements),a.updateWallMapOnFoundationFlag=!a.updateWallMapOnFoundationFlag})},redo:()=>{const a=new Set;H.getState().elements.forEach(l=>{!l.locked&&l.type===z.Wall&&l.parentId===i.parentId&&a.add(l.id)}),e(l=>{l.elements=l.elements.filter(s=>!a.has(s.id)&&!a.has(s.parentId))})}};H.getState().addUndoable(i)},Guo=(t,e,n)=>{const o=[],r={lng:H.getState().language};if(e.unlockedCount>0&&o.push({key:"lock-all-offsprings",label:h.jsx(VCe,{foundation:t,lock:!0,count:e.unlockedCount})}),e.lockedCount>0&&o.push({key:"unlock-all-offsprings",label:h.jsx(VCe,{foundation:t,lock:!1,count:e.lockedCount})}),n.wallCount>0){const{itemLabel:i,modalTitle:a}=PHe(z.Wall,n.wallCount);o.push({key:"remove-all-walls-on-foundation",label:h.jsx(Cae,{foundation:t,objectType:z.Wall,modalTitle:a,onClickOk:()=>Vuo(t),children:i})})}if(n.solarPanelCount>0){const i=Y.t("foundationMenu.DoYouReallyWantToRemoveAllSolarPanelsOnFoundation",r)+" ("+n.solarPanelModuleCount+" "+Y.t("foundationMenu.SolarPanels",r)+", "+n.solarPanelCount+" "+Y.t("foundationMenu.Racks",r)+")?";o.push({key:"remove-all-solar-panels-on-foundation",label:h.jsxs(Cae,{foundation:t,objectType:z.SolarPanel,modalTitle:i,children:[Y.t("foundationMenu.RemoveAllUnlockedSolarPanels",r),"  (",n.solarPanelModuleCount," ",Y.t("foundationMenu.SolarPanels",r),", ",n.solarPanelCount," ",Y.t("foundationMenu.Racks",r),")"]})})}return Ouo.forEach(({key:i,objectType:a})=>{const l=_uo(n,i,a);if(typeof l=="number"&&l>0){const{itemLabel:s,modalTitle:c}=PHe(a,l),u=a.replaceAll(" ","");o.push({key:`remove-all-${u}s-on-foundation`,label:h.jsx(Cae,{foundation:t,objectType:a,modalTitle:c,children:s})})}}),o},Xuo=()=>{const t=H.getState().elementsToPaste;if(t&&t.length>0){const e=t[0];if(e.type===z.Human||e.type===z.Tree||e.type===z.Flower||e.type===z.Polygon||e.type===z.Sensor||e.type===z.Light||e.type===z.SolarPanel||e.type===z.WaterHeater||e.type===z.ParabolicDish||e.type===z.Heliostat||e.type===z.FresnelReflector||e.type===z.ParabolicTrough||e.type===z.WindTurbine||e.type===z.Wall)return!0}return!1},Juo=t=>{const e=[];if(t.type!==z.Foundation)return{items:e};const n=t,o={lng:H.getState().language},r=!n.locked,i=!n.notBuilding&&me.getBuildingCompletionStatus(n,H.getState().elements)===jc.COMPLETE,a=H.getState().countAllOffspringsByTypeAtOnce(n.id,!0),l=H.getState().countAllOffspringsByTypeAtOnce(n.id,!1);return Xuo()&&e.push({key:"foundation-paste",label:h.jsx(eM,{})}),e.push({key:"foundation-copy",label:h.jsx(Ld,{})}),r&&e.push({key:"foundation-cut",label:h.jsx(Wd,{})}),e.push({key:"foundation-lock",label:h.jsx(Ju,{selectedElement:n})}),r&&e.push({key:"foundation-group-master",label:h.jsx(DQe,{groupableElement:n})}),e.push({key:"building",label:h.jsx(nGn,{foundation:n})}),a.gotSome()&&e.push({key:"lock-unlock-clear-on-foundation",label:h.jsx(rn,{children:Y.t("word.Elements",o)}),children:Guo(n,a,l)}),r&&((!n.textureType||n.textureType===Yi.NoTexture)&&e.push({key:"foundation-color",label:h.jsxs(to,{Dialog:uuo,children:[Y.t("word.Color",o)," ..."]})}),e.push({key:"foundation-texture",label:h.jsxs(to,{Dialog:fGn,children:[Y.t("word.Texture",o)," ..."]})}),e.push({key:"foundation-length",label:h.jsxs(to,{Dialog:duo,children:[Y.t("word.Length",o)," ..."]})}),e.push({key:"foundation-width",label:h.jsxs(to,{Dialog:fuo,children:[Y.t("word.Width",o)," ..."]})}),e.push({key:"foundation-height",label:h.jsxs(to,{Dialog:huo,children:[Y.t("word.Height",o)," ..."]})}),e.push({key:"foundation-azimuth",label:h.jsxs(to,{Dialog:puo,children:[Y.t("word.Azimuth",o)," ..."]})}),i&&e.push({key:"ground-floor-r-value",label:h.jsxs(to,{Dialog:guo,children:[Y.t("foundationMenu.GroundFloorRValue",o)," ..."]})})),e.push({key:"add-polygon-on-foundation",label:h.jsx(oGn,{foundation:n})}),!n.notBuilding&&a.wallCount>0&&e.push({key:"building-hvac-system",label:h.jsx(rn,{children:Y.t("word.BuildingHVACSystem",o)}),children:[{key:"hvac-system-id",label:h.jsx(rGn,{foundation:n})},{key:"thermostat-temperature",label:h.jsx(iGn,{foundation:n})},{key:"tolerance-threshold",label:h.jsx(aGn,{foundation:n})}]}),r&&(e.push({key:"select-solar-structure",label:h.jsx(rn,{children:Y.t("foundationMenu.SolarStructure",o)}),children:[{key:"select-solar-structure-submenu",label:h.jsx(lGn,{foundation:n}),style:{backgroundColor:"white"}}]}),n.solarStructure===Dn.FocusPipe&&e.push({key:"solar-absorber-pipe-physical-properties",label:h.jsx(rn,{children:Y.t("solarAbsorberPipeMenu.AbsorberPipePhysicalProperties",o)}),children:[{key:"solar-absorber-pipe-height",label:h.jsxs(to,{noPadding:!0,Dialog:muo,children:[Y.t("solarAbsorberPipeMenu.AbsorberHeight",o)," ..."]})},{key:"solar-absorber-pipe-aperture-width",label:h.jsxs(to,{noPadding:!0,Dialog:yuo,children:[Y.t("solarAbsorberPipeMenu.AbsorberApertureWidth",o)," ..."]})},{key:"foundation-solar-receiver-pipe-pole-number",label:h.jsxs(to,{noPadding:!0,Dialog:Auo,children:[Y.t("solarAbsorberPipeMenu.AbsorberPipePoleNumber",o)," ..."]})},{key:"solar-absorber-pipe-absorptance",label:h.jsxs(to,{noPadding:!0,Dialog:wuo,children:[Y.t("solarAbsorberPipeMenu.AbsorberAbsorptance",o)," ..."]})},{key:"solar-absorber-optical-efficiency",label:h.jsxs(to,{noPadding:!0,Dialog:vuo,children:[Y.t("solarAbsorberPipeMenu.AbsorberOpticalEfficiency",o)," ..."]})},{key:"solar-absorber-thermal-efficiency",label:h.jsxs(to,{noPadding:!0,Dialog:xuo,children:[Y.t("solarAbsorberPipeMenu.AbsorberThermalEfficiency",o)," ..."]})}]}),n.solarStructure===Dn.FocusTower&&e.push({key:"solar-power-tower-physical-properties",label:h.jsx(rn,{children:Y.t("solarPowerTowerMenu.ReceiverTowerPhysicalProperties",o)}),children:[{key:"solar-power-tower-height",label:h.jsxs(to,{noPadding:!0,Dialog:buo,children:[Y.t("solarPowerTowerMenu.ReceiverTowerHeight",o)," ..."]})},{key:"solar-power-tower-radius",label:h.jsxs(to,{noPadding:!0,Dialog:Suo,children:[Y.t("solarPowerTowerMenu.ReceiverTowerRadius",o)," ..."]})},{key:"solar-power-tower-receiver-absorptance",label:h.jsxs(to,{noPadding:!0,Dialog:Tuo,children:[Y.t("solarPowerTowerMenu.ReceiverAbsorptance",o)," ..."]})},{key:"solar-power-tower-receiver-optical-efficiency",label:h.jsxs(to,{noPadding:!0,Dialog:Cuo,children:[Y.t("solarPowerTowerMenu.ReceiverOpticalEfficiency",o)," ..."]})},{key:"solar-power-tower-receiver-thermal-efficiency",label:h.jsxs(to,{noPadding:!0,Dialog:Puo,children:[Y.t("solarPowerTowerMenu.ReceiverThermalEfficiency",o)," ..."]})}]}),n.solarStructure===Dn.UpdraftTower&&e.push({key:"solar-updraft-tower-physical-properties",label:h.jsx(rn,{children:Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerPhysicalProperties",o)}),children:[{key:"solar-updraft-tower-chimney-height",label:h.jsxs(to,{noPadding:!0,Dialog:Ruo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerChimneyHeight",o)," ..."]})},{key:"solar-updraft-tower-chimney-radius",label:h.jsxs(to,{noPadding:!0,Dialog:Huo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerChimneyRadius",o)," ..."]})},{key:"solar-updraft-tower-collector-height",label:h.jsxs(to,{noPadding:!0,Dialog:Muo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorHeight",o)," ..."]})},{key:"solar-updraft-tower-collector-radius",label:h.jsxs(to,{noPadding:!0,Dialog:Iuo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorRadius",o)," ..."]})},{key:"solar-updraft-tower-collector-transmissivity",label:h.jsxs(to,{noPadding:!0,Dialog:zuo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorTransmissivity",o)," ..."]})},{key:"solar-updraft-tower-collector-emissivity",label:h.jsxs(to,{noPadding:!0,Dialog:Duo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerCollectorEmissivity",o)," ..."]})},{key:"solar-updraft-tower-discharge-coefficient",label:h.jsxs(to,{noPadding:!0,Dialog:Euo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerDischargeCoefficient",o)," ..."]})},{key:"solar-updraft-tower-turbine-efficiency",label:h.jsxs(to,{noPadding:!0,Dialog:Fuo,children:[Y.t("solarUpdraftTowerMenu.SolarUpdraftTowerTurbineEfficiency",o)," ..."]})}]})),e.push({key:"optimization",label:h.jsx(rn,{children:Y.t("optimizationMenu.Optimization",o)}),children:[{key:"genetic-algorithms",label:h.jsx(rn,{noPadding:!0,children:Y.t("optimizationMenu.GeneticAlgorithm",o)}),disabled:l.solarPanelCount===0,children:[{key:"solar-panel-tilt-angle-ga-optimizer",label:h.jsxs(to,{noPadding:!0,Dialog:kuo,children:[Y.t("optimizationMenu.SolarPanelTiltAngleOptimization",o),"..."]})}]},{key:"particle-swarm-optimization",label:h.jsx(rn,{noPadding:!0,children:Y.t("optimizationMenu.ParticleSwarmOptimization",o)}),disabled:l.solarPanelCount===0,children:[{key:"solar-panel-tilt-angle-pso-optimizer",label:h.jsxs(to,{noPadding:!0,Dialog:Luo,children:[Y.t("optimizationMenu.SolarPanelTiltAngleOptimization",o),"..."]})}]}]}),r&&e.push({key:"foundation-label",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",o)}),children:PA(n)}),{items:e}},Kuo=be.memo(({cuboid:t})=>{const e=Jt(),n=()=>{H.getState().set(o=>{for(const r of o.elements)if(r.id===t.id&&r.type===z.Cuboid){const i=r,a=!i.stackable;i.stackable=a,o.actionState.cuboidStackable=a;break}})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.stackable,onChange:n,children:Y.t("cuboidMenu.Stackable",e)})})}),quo=be.memo(({cuboid:t,selectedSideIndex:e})=>{const n=Jt(),o=H.getState().set,r=()=>{o(c=>{c.objectTypeToAdd=z.Polygon});const{pos:i}=me.getWorldDataById(t.id);let a;switch(e){case 0:a=Op;break;case 1:a=_p;break;case 2:a=Oc;break;case 3:a=Vp;break;default:a=Io,i.z=t.lz}const l=H.getState().addElement(t,i,a),s={name:"Add",timestamp:Date.now(),addedElement:l,undo:()=>{H.getState().removeElementById(s.addedElement.id,!1)},redo:()=>{o(c=>{c.elements.push(s.addedElement),c.selectedElement=s.addedElement})}};H.getState().addUndoable(s),o(c=>{c.objectTypeToAdd=z.None})};return h.jsx(rn,{onClick:r,children:Y.t("cuboidMenu.AddPolygon",n)})}),CHe=be.memo(({cuboid:t,objectType:e,modalTitle:n,onClickOk:o,children:r})=>{const i=H.getState().removeAllChildElementsByType,a=()=>{const s=H.getState().elements.filter(d=>!d.locked&&d.type===e&&d.parentId===t.id);i(t.id,e);const c=JSON.parse(JSON.stringify(s)),u={name:`Remove All ${e}s on Cuboid`,timestamp:Date.now(),parentId:t.id,removedElements:c,undo:()=>{H.getState().set(d=>{d.elements.push(...u.removedElements)})},redo:()=>{i(u.parentId,e)}};H.getState().addUndoable(u)},l=()=>{const s=o??a;Oi.confirm({title:n,icon:h.jsx(ny,{}),onOk:s})};return h.jsx(rn,{noPadding:!0,onClick:l,children:r})}),$uo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(Rb),i=H(Hb),a=H(tYe),l=H(no),s=H(Zn),c=co(z.Cuboid),[u,d]=m.useState((c==null?void 0:c.color)??"#808080"),[f,p]=m.useState(!1),g=Jt();m.useEffect(()=>{P()},[c,a]);const y=(R,M,D)=>{e(E=>{for(const W of E.elements)if(W.type===z.Cuboid&&W.id===M&&!W.locked){const j=W;j.faceColors||(j.faceColors=new Array(6),j.faceColors.fill(j.color??D)),j.faceColors[R]=D;break}})},w=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.Cuboid&&E.id===R&&!E.locked){E.color=M;const W=E;W.faceColors||(W.faceColors=new Array(6));for(let j=0;j<4;j++)W.faceColors[j]=M;break}})},b=R=>{e(M=>{for(const D of M.elements)if(D.type===z.Cuboid&&!D.locked){D.color=R;const E=D;E.faceColors||(E.faceColors=new Array(6));for(let W=0;W<4;W++)E.faceColors[W]=R}})},C=R=>{i(R.target.value),p(!f)},P=()=>{c&&(a>=0&&c.faceColors?d(c.faceColors[a]):d(c.color??"#808080"))},v=R=>{if(c){switch(r){case oe.AllSelectedObjectsOfThisType:for(const M of n)if(M.type===z.Cuboid&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)){const D=M;if(D.faceColors){for(let E=0;E<4;E++)if(R!==D.faceColors[E])return!0}else if(R!==D.color)return!0}break;case oe.AllObjectsOfThisType:for(const M of n)if(M.type===z.Cuboid&&!M.locked){const D=M;if(D.faceColors){for(let E=0;E<4;E++)if(R!==D.faceColors[E])return!0}else if(R!==D.color)return!0}break;case oe.OnlyThisObject:if(c.faceColors){for(let M=0;M<4;M++)if(R!==c.faceColors[M])return!0}else if(R!==(c==null?void 0:c.color))return!0;break;default:if(a>=0){const M=c!=null&&c.faceColors?c==null?void 0:c.faceColors[a]:c==null?void 0:c.color;if(R!==M)return!0}else if(R!==(c==null?void 0:c.color))return!0}return!1}},T=R=>{if(c&&v(R)){switch(r){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of n)if(E.type===z.Cuboid&&H.getState().selectedElementIdSet.has(E.id)){const W=E;if(W.faceColors)M.set(E.id,[...W.faceColors]);else{const j=W.color??"#808080";M.set(E.id,[j,j,j,j,j,j])}}const D={name:"Set Color for Selected Cuboids",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())if(W&&Array.isArray(W))for(let j=0;j{for(const[E,W]of D.oldValues.entries())if(W&&Array.isArray(W))for(let j=0;j{E.actionState.cuboidFaceColors||(E.actionState.cuboidFaceColors=["#808080","#808080","#808080","#808080","#808080","#808080"]);for(let W=0;W<4;W++)E.actionState.cuboidFaceColors[W]=R});break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of n)if(E.type===z.Cuboid){const W=E;if(W.faceColors)M.set(E.id,[...W.faceColors]);else{const j=W.color??"#808080";M.set(E.id,[j,j,j,j,j,j])}}const D={name:"Set Color for All Cuboids",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())if(W&&Array.isArray(W))for(let j=0;j{b(D.newValue)}};o(D),b(R),s(l+1),e(E=>{E.actionState.cuboidFaceColors||(E.actionState.cuboidFaceColors=["#808080","#808080","#808080","#808080","#808080","#808080"]);for(let W=0;W<4;W++)E.actionState.cuboidFaceColors[W]=R});break}case oe.OnlyThisObject:{let M;if(c.faceColors)M=[...c.faceColors];else{const E=c.color??"#808080";M=[E,E,E,E,E,E]}const D={name:"Set Color for All Sides of Selected Cuboid",timestamp:Date.now(),oldValue:M,newValue:R,changedElementId:c.id,changedElementType:c.type,undo:()=>{if(D.oldValue&&Array.isArray(D.oldValue))for(let E=0;E{w(D.changedElementId,D.newValue)}};o(D),w(c.id,R),s(l+1),e(E=>{E.actionState.cuboidFaceColors||(E.actionState.cuboidFaceColors=["#808080","#808080","#808080","#808080","#808080","#808080"]);for(let W=0;W<4;W++)E.actionState.cuboidFaceColors[W]=R});break}default:{if(a>=0){const M=c.faceColors?c.faceColors[a]:c.color,D={name:"Set Color for Selected Side of Cuboid",timestamp:Date.now(),oldValue:M,newValue:R,changedElementId:c.id,changedElementType:c.type,changedSideIndex:a,undo:()=>{D.changedSideIndex!==void 0&&y(D.changedSideIndex,D.changedElementId,D.oldValue)},redo:()=>{D.changedSideIndex!==void 0&&y(D.changedSideIndex,D.changedElementId,D.newValue)}};o(D),y(a,c.id,R),s(l+1),e(E=>{E.actionState.cuboidFaceColors||(E.actionState.cuboidFaceColors=["#808080","#808080","#808080","#808080","#808080","#808080"]),E.actionState.cuboidFaceColors[a]=R})}break}}p(!f)}},A=()=>{P(),t(!1)},x=()=>{T(u),t(!1),s(0)},S=a>=0&&(c!=null&&c.faceColors)?c.faceColors[a]:(c==null?void 0:c.color)??"#808080";return h.jsx(so,{width:600,title:Y.t("word.Color",g),onApply:x,onClose:A,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(zf,{color:u??S,onChangeComplete:R=>{d(R.hex),p(!f)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:12,children:h.jsx(Ue.Group,{onChange:C,value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("cuboidMenu.OnlyThisSide",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("cuboidMenu.AllSidesOfThisCuboid",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("cuboidMenu.AllSidesOfSelectedCuboids",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("cuboidMenu.AllSidesOfAllCuboids",g)})]})})})]})})},Quo="/aladdin/assets/building_facade_01_menu-BAm4EVGn.png",Zuo="/aladdin/assets/building_facade_02_menu-BylQ9E0j.png",edo="/aladdin/assets/building_facade_03_menu-DfU_cdlP.png",tdo="/aladdin/assets/building_facade_04_menu-Bz2bcbq0.png",ndo="/aladdin/assets/building_facade_05_menu-hF6OsAF0.png",odo="/aladdin/assets/building_facade_06_menu-CUmtyI19.png",rdo="/aladdin/assets/building_facade_07_menu-B8_DYqYz.png",ido="/aladdin/assets/building_facade_08_menu-CTA_rxim.png",ado="/aladdin/assets/building_facade_09_menu-BpQDoLbY.png",ldo="/aladdin/assets/building_facade_10_menu-z_jZrQMT.png",sdo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(Rb),i=H(Hb),a=H(tYe),l=H(no),s=H(Zn),c=co(z.Cuboid),[u,d]=m.useState(c&&c.textureTypes&&a>=0?c.textureTypes[a]:Co.NoTexture),f=Jt(),{Option:p}=_o;m.useEffect(()=>{c&&d(c.textureTypes&&a>=0?c.textureTypes[a]:Co.NoTexture)},[c,a]);const g=(x,S,R)=>{e(M=>{for(const D of M.elements)if(D.type===z.Cuboid&&D.id===S&&!D.locked){const E=D;E.textureTypes||(E.textureTypes=new Array(6),E.textureTypes.fill(Co.NoTexture)),E.textureTypes[x]=R;break}})},y=(x,S)=>{e(R=>{for(const M of R.elements)if(M.type===z.Cuboid&&M.id===x&&!M.locked){const D=M;D.textureTypes||(D.textureTypes=new Array(6),D.textureTypes.fill(Co.NoTexture));for(let E=0;E<4;E++)D.textureTypes[E]=S;break}})},w=(x,S)=>{e(R=>{for(const M of R.elements)if(M.type===z.Cuboid&&!M.locked&&x.has(M.id)){const D=M;if(D.textureTypes||(D.textureTypes=new Array(6),D.textureTypes.fill(Co.NoTexture)),S!==void 0)for(let E=0;E<4;E++)D.textureTypes[E]=S;else{const E=x.get(M.id);if(E&&E.length>=4)for(let W=0;W<4;W++)D.textureTypes[W]=E[W]}}})},b=x=>{e(S=>{for(const R of S.elements)if(R.type===z.Cuboid&&!R.locked){const M=R;M.textureTypes||(M.textureTypes=new Array(6),M.textureTypes.fill(Co.NoTexture));for(let D=0;D<4;D++)M.textureTypes[D]=x}})},C=x=>{i(x.target.value)},P=x=>{if(c){switch(r){case oe.AllSelectedObjectsOfThisType:for(const S of n)if(S.type===z.Cuboid&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)){const R=S;if(R.textureTypes){for(let M=0;M<4;M++)if(x!==R.textureTypes[M])return!0}}break;case oe.AllObjectsOfThisType:for(const S of n)if(S.type===z.Cuboid&&!S.locked){const R=S;if(R.textureTypes){for(let M=0;M<4;M++)if(x!==R.textureTypes[M])return!0}}break;case oe.OnlyThisObject:if(c.textureTypes){for(let S=0;S<4;S++)if(x!==c.textureTypes[S])return!0}break;default:if(a>=0&&c.textureTypes&&x!==c.textureTypes[a])return!0}return!1}},v=x=>{if(c&&P(x))switch(r){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of n)if(M.type===z.Cuboid&&H.getState().selectedElementIdSet.has(M.id)){const D=M;S.set(M.id,D.textureTypes?[...D.textureTypes]:void 0)}const R={name:"Set Texture for Selected Cuboids",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())if(D&&Array.isArray(D))for(let E=0;E{w(R.oldValues,R.newValue)}};o(R),w(S,x),s(l+1),e(M=>{M.actionState.cuboidFaceTextures||(M.actionState.cuboidFaceTextures=[Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture]);for(let D=0;D<4;D++)M.actionState.cuboidFaceTextures[D]=x});break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of n)if(M.type===z.Cuboid){const D=M;S.set(M.id,D.textureTypes?[...D.textureTypes]:void 0)}const R={name:"Set Texture for All Cuboids",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())if(D&&Array.isArray(D))for(let E=0;E{b(R.newValue)}};o(R),b(x),s(l+1),e(M=>{M.actionState.cuboidFaceTextures||(M.actionState.cuboidFaceTextures=[Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture]);for(let D=0;D<4;D++)M.actionState.cuboidFaceTextures[D]=x});break}case oe.OnlyThisObject:{const S=c.textureTypes?[...c.textureTypes]:void 0,R={name:"Set Texture for All Sides of Selected Cuboid",timestamp:Date.now(),oldValue:S,newValue:x,changedElementId:c.id,changedElementType:c.type,undo:()=>{if(R.oldValue&&Array.isArray(R.oldValue))for(let M=0;M{y(R.changedElementId,R.newValue)}};o(R),y(c.id,x),s(l+1),e(M=>{M.actionState.cuboidFaceTextures||(M.actionState.cuboidFaceTextures=[Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture]);for(let D=0;D<4;D++)M.actionState.cuboidFaceTextures[D]=x});break}default:{if(a>=0){const S=c.textureTypes?c.textureTypes[a]:Co.NoTexture,R={name:"Set Texture for Selected Side of Cuboid",timestamp:Date.now(),oldValue:S,newValue:x,changedElementId:c.id,changedElementType:c.type,changedSideIndex:a,undo:()=>{R.changedSideIndex!==void 0&&g(R.changedSideIndex,R.changedElementId,R.oldValue)},redo:()=>{R.changedSideIndex!==void 0&&g(R.changedSideIndex,R.changedElementId,R.newValue)}};o(R),g(a,c.id,x),s(l+1),e(M=>{M.actionState.cuboidFaceTextures||(M.actionState.cuboidFaceTextures=[Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture,Co.NoTexture]),M.actionState.cuboidFaceTextures[a]=x})}break}}},T=()=>{c!=null&&c.textureTypes&&a>=0&&d(c.textureTypes[a]),t(!1)},A=()=>{v(u)};return h.jsx(so,{width:600,title:Y.t("word.Texture",f),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{style:{width:"150px"},value:u,onChange:d,children:[h.jsxs(p,{value:Co.NoTexture,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"32px",height:"20px",border:"1px dashed dimGray"},children:" "}),Y.t("shared.NoTexture",f)]},Co.NoTexture),h.jsxs(p,{value:Co.Facade01,children:[h.jsx("img",{alt:Co.Facade01,src:Quo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture01",f)]},Co.Facade01),h.jsxs(p,{value:Co.Facade02,children:[h.jsx("img",{alt:Co.Facade02,src:Zuo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture02",f)]},Co.Facade02),h.jsxs(p,{value:Co.Facade03,children:[h.jsx("img",{alt:Co.Facade03,src:edo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture03",f)]},Co.Facade03),h.jsxs(p,{value:Co.Facade04,children:[h.jsx("img",{alt:Co.Facade04,src:tdo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture04",f)]},Co.Facade04),h.jsxs(p,{value:Co.Facade05,children:[h.jsx("img",{alt:Co.Facade05,src:ndo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture05",f)]},Co.Facade05),h.jsxs(p,{value:Co.Facade06,children:[h.jsx("img",{alt:Co.Facade06,src:odo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture06",f)]},Co.Facade06),h.jsxs(p,{value:Co.Facade07,children:[h.jsx("img",{alt:Co.Facade07,src:rdo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture07",f)]},Co.Facade07),h.jsxs(p,{value:Co.Facade08,children:[h.jsx("img",{alt:Co.Facade08,src:ido,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture08",f)]},Co.Facade08),h.jsxs(p,{value:Co.Facade09,children:[h.jsx("img",{alt:Co.Facade09,src:ado,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture09",f)]},Co.Facade09),h.jsxs(p,{value:Co.Facade10,children:[h.jsx("img",{alt:Co.Facade10,src:ldo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("cuboidMenu.Texture10",f)]},Co.Facade10)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:12,children:h.jsx(Ue.Group,{onChange:C,value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("cuboidMenu.OnlyThisSide",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("cuboidMenu.AllSidesOfThisCuboid",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("cuboidMenu.AllSidesOfSelectedCuboids",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("cuboidMenu.AllSidesOfAllCuboids",f)})]})})})]})})},cdo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(EH),r=H(nYe),i=H(u3),a=H(zw),l=H(c3),s=H(En),c=H(Rb),u=H(Hb),d=H(fn),f=H(no),p=H(Zn),g=H(Vi),y=co(z.Cuboid),[w,b]=m.useState((y==null?void 0:y.lx)??0),C=m.useRef(new Map),P=m.useRef(new Map),v=m.useRef(new Map),T=m.useRef(new Map),A=m.useRef(new Map),x=m.useRef(new Map),S=m.useRef(new Map),R=m.useRef(new Map),M=m.useRef(!1),D=m.useRef(),E=Jt(),W=re=>{u(re.target.value)},j=re=>{if(y){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const ae of e)if(ae.type===z.Cuboid&&H.getState().selectedElementIdSet.has(ae.id)){const se=ae,ne=o(se.id);if(ne.length>0&&!me.doesNewSizeContainAllChildren(se,ne,re,se.ly))return!1}break}case oe.AllObjectsOfThisType:{for(const ae of e)if(ae.type===z.Cuboid){const se=ae,ne=o(se.id);if(ne.length>0&&!me.doesNewSizeContainAllChildren(se,ne,re,se.ly))return!1}break}default:{const ae=o(y.id);if(ae.length>0)return me.doesNewSizeContainAllChildren(y,ae,re,y.ly);break}}return!0}},L=re=>!j(re),k=re=>{if(y){switch(c){case oe.AllSelectedObjectsOfThisType:for(const ae of e)if(ae.type===z.Cuboid&&!ae.locked&&H.getState().selectedElementIdSet.has(ae.id)&&Math.abs(ae.lx-re)>It)return!0;break;case oe.AllObjectsOfThisType:for(const ae of e)if(ae.type===z.Cuboid&&!ae.locked&&Math.abs(ae.lx-re)>It)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const ae of e)if(ae.type===z.Cuboid&&ae.parentId===(y==null?void 0:y.parentId)&&!ae.locked&&Math.abs(ae.lx-re)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:break;default:if(Math.abs((y==null?void 0:y.lx)-re)>It)return!0}return!1}},N=(re,ae)=>{if(re==null)return null;for(const se of re.children)if(se.name.includes(`${ae}`))return se;return null},F=(re,ae,se)=>{var ne,fe;if(re){for(const ge of re.children)if(ge.name.includes(`${se.id}`)){(fe=(ne=Fn.getState().contentRef)==null?void 0:ne.current)==null||fe.add(ge);break}d(ge=>{for(const de of ge.elements)if(de.id===se.id){de.parentId=Zo;const Z=new Xt(de.cx,de.cy).rotateAround(si,ae.rotation[2]).add(new Xt(ae.cx,ae.cy));de.cx=Z.x,de.cy=Z.y,de.cz=0,T.current.set(de.id,new ie(Z.x,Z.y,0)),P.current.set(de.id,Zo);break}})}},U=re=>{for(const ae of e)ae.type===z.Cuboid&&!ae.locked&&ae.parentId===(y==null?void 0:y.parentId)&&O(ae,re)},O=(re,ae)=>{const se=o(re.id),ne=re.rotation[2];if(A.current.clear(),R.current.clear(),se.length>0)for(const fe of se){if(me.isIdentical(fe.normal,rs))switch(fe.type){case z.Sensor:{const ge=new Xt(fe.cx*re.lx,fe.cy*re.ly).rotateAround(si,ne);A.current.set(fe.id,ge),v.current.set(fe.id,new ie(fe.cx,fe.cy));break}case z.Polygon:{const ge=fe,de=[];for(const Z of ge.vertices)de.push(new Xt(Z.x*re.lx,Z.y*re.ly).rotateAround(si,ne));R.current.set(fe.id,de),x.current.set(fe.id,ge.vertices.map(Z=>({...Z})));break}}else fe.type===z.SolarPanel&&(me.isEqual(fe.normal[0],-1)||me.isEqual(fe.normal[0],1))&&v.current.set(fe.id,new ie(fe.cx,fe.cy,fe.cz));me.isPlantOrHuman(fe)&&v.current.set(fe.id,new ie(fe.cx,fe.cy,fe.cz))}if(i(re.id,ae),se.length>0)for(const fe of se){if(me.isIdentical(fe.normal,rs))switch(fe.type){case z.Sensor:{const ge=A.current.get(fe.id);if(ge){const Z=new Xt(ge.x,ge.y).rotateAround(si,-ne).x/ae;r(fe.id,Z),T.current.set(fe.id,new ie(Z,fe.cy))}break}case z.Polygon:{const ge=R.current.get(fe.id);if(ge){const de=[];for(const Z of ge){const he=Z.rotateAround(si,-ne),xe=he.x/ae,He=he.y/re.ly;de.push({x:xe,y:He})}a(fe.id,de),S.current.set(fe.id,de.map(Z=>({...Z})))}break}}else fe.type===z.SolarPanel&&(me.isEqual(fe.normal[0],-1)&&(r(fe.id,-ae/2),T.current.set(fe.id,new ie(-ae/2,fe.cy,fe.cz))),me.isEqual(fe.normal[0],1)&&(r(fe.id,ae/2),T.current.set(fe.id,new ie(ae/2,fe.cy,fe.cz))));if(me.isPlantOrHuman(fe)){if(T.current.set(fe.id,new ie(fe.cx,fe.cy,fe.cz)),C.current.set(fe.id,re.id),Math.abs(fe.cz-re.lz/2)0){const ge=Fn.getState().contentRef,de=N(ge==null?void 0:ge.current,re.id);F(de,re,fe)}}else if(Math.abs(Math.abs(fe.cx)-re.lx/2)0?ae:-ae)/2;r(fe.id,ge),T.current.set(fe.id,new ie(ge,fe.cy,fe.cz))}}}},B=(re,ae,se)=>{if(!re||!ae)return;const ne=Fn.getState().contentRef,fe=N(ne==null?void 0:ne.current,ae),ge=N(ae===Zo?ne==null?void 0:ne.current:fe,se);if(ge&&(ne!=null&&ne.current)){if(re===Zo)ne.current.add(ge);else{const de=N(ne.current,re);de==null||de.add(ge)}np()}},_=(re,ae)=>{re&&d(se=>{for(const ne of se.elements)if(ne.id===ae){ne.parentId=re;break}})},X=re=>{if(!y||!k(re))return;const ae=n(y.id),se=ae?ae.lx:y.lx;if(D.current=void 0,M.current=L(re),M.current)D.current=re,b(se);else switch(c){case oe.AllSelectedObjectsOfThisType:{const ne=new Map;for(const ge of e)ge.type===z.Cuboid&&!ge.locked&&H.getState().selectedElementIdSet.has(ge.id)&&(ne.set(ge.id,ge.lx),O(ge,re));const fe={name:"Set Length for Selected Cuboids",timestamp:Date.now(),oldSizes:ne,newSize:re,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())i(Z,he);if(fe.oldChildrenPositionsMap&&fe.oldChildrenPositionsMap.size>0)for(const[Z,he]of fe.oldChildrenPositionsMap.entries()){l(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(xe,He,Z),_(xe,Z))}if(fe.oldChildrenVerticesMap&&fe.oldChildrenVerticesMap.size>0)for(const[Z,he]of fe.oldChildrenVerticesMap.entries())a(Z,he)},redo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())i(Z,fe.newSize);if(fe.newChildrenPositionsMap&&fe.newChildrenPositionsMap.size>0)for(const[Z,he]of fe.newChildrenPositionsMap.entries()){l(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(He,xe,Z),_(He,Z))}if(fe.newChildrenVerticesMap&&fe.newChildrenVerticesMap.size>0)for(const[Z,he]of fe.newChildrenVerticesMap.entries())a(Z,he)}};s(fe),p(f+1);break}case oe.AllObjectsOfThisTypeOnSurface:{const ne=new Map;for(const ge of e)ge.type===z.Cuboid&&ge.parentId===y.parentId&&!ge.locked&&(ne.set(ge.id,ge.lx),O(ge,re));const fe={name:"Set Length for All Cuboids on Surface",timestamp:Date.now(),oldSizes:ne,newSize:re,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())i(Z,he);if(fe.oldChildrenPositionsMap&&fe.oldChildrenPositionsMap.size>0)for(const[Z,he]of fe.oldChildrenPositionsMap.entries()){l(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(xe,He,Z),_(xe,Z))}if(fe.oldChildrenVerticesMap&&fe.oldChildrenVerticesMap.size>0)for(const[Z,he]of fe.oldChildrenVerticesMap.entries())a(Z,he)},redo:()=>{var ge,de;if(U(fe.newSize),fe.newChildrenPositionsMap&&fe.newChildrenPositionsMap.size>0)for(const[Z,he]of fe.newChildrenPositionsMap.entries()){l(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(He,xe,Z),_(He,Z))}if(fe.newChildrenVerticesMap&&fe.newChildrenVerticesMap.size>0)for(const[Z,he]of fe.newChildrenVerticesMap.entries())a(Z,he)}};s(fe),p(f+1);break}case oe.AllObjectsOfThisType:{const ne=new Map;for(const ge of e)ge.type===z.Cuboid&&!ge.locked&&(ne.set(ge.id,ge.lx),O(ge,re));const fe={name:"Set Length for All Cuboids",timestamp:Date.now(),oldSizes:ne,newSize:re,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())i(Z,he);if(fe.oldChildrenPositionsMap&&fe.oldChildrenPositionsMap.size>0)for(const[Z,he]of fe.oldChildrenPositionsMap.entries()){l(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(xe,He,Z),_(xe,Z))}if(fe.oldChildrenVerticesMap&&fe.oldChildrenVerticesMap.size>0)for(const[Z,he]of fe.oldChildrenVerticesMap.entries())a(Z,he)},redo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())i(Z,fe.newSize);if(fe.newChildrenPositionsMap&&fe.newChildrenPositionsMap.size>0)for(const[Z,he]of fe.newChildrenPositionsMap.entries()){l(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(He,xe,Z),_(He,Z))}if(fe.newChildrenVerticesMap&&fe.newChildrenVerticesMap.size>0)for(const[Z,he]of fe.newChildrenVerticesMap.entries())a(Z,he)}};s(fe),p(f+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:break;default:{O(y,re);const ne={name:"Set Cuboid Length",timestamp:Date.now(),oldSize:se,newSize:re,resizedElementId:y.id,resizedElementType:y.type,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var fe,ge;if(i(y.id,ne.oldSize),ne.oldChildrenPositionsMap&&ne.oldChildrenPositionsMap.size>0)for(const[de,Z]of ne.oldChildrenPositionsMap.entries()){l(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(B(he,xe,de),_(he,de))}if(ne.oldChildrenVerticesMap&&ne.oldChildrenVerticesMap.size>0)for(const[de,Z]of ne.oldChildrenVerticesMap.entries())a(de,Z)},redo:()=>{var fe,ge;if(i(y.id,ne.newSize),ne.newChildrenPositionsMap&&ne.newChildrenPositionsMap.size>0)for(const[de,Z]of ne.newChildrenPositionsMap.entries()){l(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(B(xe,he,de),_(xe,de))}if(ne.newChildrenVerticesMap&&ne.newChildrenVerticesMap.size>0)for(const[de,Z]of ne.newChildrenVerticesMap.entries())a(de,Z)}};s(ne),p(f+1);break}}},$=()=>{t(!1)},Q=()=>{$(),g()},le=()=>{X(w),M.current||(t(!1),p(0))},q=()=>{X(w)},te=M.current?": "+Y.t("message.NotApplicableToSelectedAction",E)+(D.current!==void 0?" ("+D.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Length",E),rejectedMessage:te,onApply:q,onClose:$,onClickCancel:Q,onClickOk:le,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:500,style:{width:120},step:.5,precision:2,value:w,onChange:re=>{re!==null&&b(re)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",E),": [0.1, 500] ",Y.t("word.MeterAbbreviation",E)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",E)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:W,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("cuboidMenu.OnlyThisCuboid",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("cuboidMenu.AllCuboidsOnSameSurface",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("cuboidMenu.AllSelectedCuboids",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("cuboidMenu.AllCuboids",E)})]})})})]})})},udo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(EH),r=H(c3),i=H(oYe),a=H(Iw),l=H(zw),s=H(En),c=H(Rb),u=H(Hb),d=H(fn),f=H(no),p=H(Zn),g=H(Vi),y=co(z.Cuboid),[w,b]=m.useState((y==null?void 0:y.ly)??0),C=m.useRef(new Map),P=m.useRef(new Map),v=m.useRef(new Map),T=m.useRef(new Map),A=m.useRef(new Map),x=m.useRef(new Map),S=m.useRef(new Map),R=m.useRef(new Map),M=m.useRef(!1),D=m.useRef(),E=Jt(),W=re=>{u(re.target.value)},j=re=>{if(y){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const ae of e)if(ae.type===z.Cuboid&&H.getState().selectedElementIdSet.has(ae.id)){const se=ae,ne=o(se.id);if(ne.length>0&&!me.doesNewSizeContainAllChildren(se,ne,se.lx,re))return!1}break}case oe.AllObjectsOfThisType:{for(const ae of e)if(ae.type===z.Cuboid){const se=ae,ne=o(se.id);if(ne.length>0&&!me.doesNewSizeContainAllChildren(se,ne,se.lx,re))return!1}break}default:{const ae=o(y.id);if(ae.length>0)return me.doesNewSizeContainAllChildren(y,ae,y.lx,re);break}}return!0}},L=re=>!j(re),k=re=>{if(y){switch(c){case oe.AllSelectedObjectsOfThisType:for(const ae of e)if(ae.type===z.Cuboid&&!ae.locked&&H.getState().selectedElementIdSet.has(ae.id)&&Math.abs(ae.ly-re)>It)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const ae of e)if(ae.type===z.Cuboid&&ae.parentId===(y==null?void 0:y.parentId)&&!ae.locked&&Math.abs(ae.ly-re)>It)return!0;break;case oe.AllObjectsOfThisType:{for(const ae of e)if(ae.type===z.Cuboid&&!ae.locked&&Math.abs(ae.ly-re)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:break;default:if(Math.abs((y==null?void 0:y.ly)-re)>It)return!0}return!1}},N=(re,ae)=>{if(re==null)return null;for(const se of re.children)if(se.name.includes(`${ae}`))return se;return null},F=(re,ae,se)=>{var ne,fe;if(re){for(const ge of re.children)if(ge.name.includes(`${se.id}`)){(fe=(ne=Fn.getState().contentRef)==null?void 0:ne.current)==null||fe.add(ge);break}d(ge=>{for(const de of ge.elements)if(de.id===se.id){de.parentId=Zo;const Z=new Xt(de.cx,de.cy).rotateAround(si,ae.rotation[2]).add(new Xt(ae.cx,ae.cy));de.cx=Z.x,de.cy=Z.y,de.cz=0,T.current.set(de.id,new ie(Z.x,Z.y,0)),P.current.set(de.id,Zo);break}})}},U=re=>{for(const ae of e)ae.type===z.Cuboid&&!ae.locked&&ae.parentId===(y==null?void 0:y.parentId)&&O(ae,re)},O=(re,ae)=>{const se=o(re.id),ne=re.rotation[2];if(A.current.clear(),R.current.clear(),se.length>0)for(const fe of se){if(me.isIdentical(fe.normal,rs))switch(fe.type){case z.Sensor:{const ge=new Xt(fe.cx*re.lx,fe.cy*re.ly).rotateAround(si,ne);A.current.set(fe.id,ge),v.current.set(fe.id,new ie(fe.cx,fe.cy));break}case z.Polygon:{const ge=fe,de=[];for(const Z of ge.vertices)de.push(new Xt(Z.x*re.lx,Z.y*re.ly).rotateAround(si,ne));R.current.set(fe.id,de),x.current.set(fe.id,ge.vertices.map(Z=>({...Z})));break}}else fe.type===z.SolarPanel&&(me.isEqual(fe.normal[1],-1)||me.isEqual(fe.normal[1],1))&&v.current.set(fe.id,new ie(fe.cx,fe.cy,fe.cz));me.isPlantOrHuman(fe)&&v.current.set(fe.id,new ie(fe.cx,fe.cy,fe.cz))}if(a(re.id,ae),se.length>0)for(const fe of se){if(me.isIdentical(fe.normal,rs))switch(fe.type){case z.Sensor:{const ge=A.current.get(fe.id);if(ge){const Z=new Xt(ge.x,ge.y).rotateAround(si,-ne).y/ae;i(fe.id,Z),T.current.set(fe.id,new ie(fe.cx,Z))}break}case z.Polygon:{const ge=R.current.get(fe.id);if(ge){const de=[];for(const Z of ge){const he=Z.rotateAround(si,-ne),xe=he.x/re.lx,He=he.y/ae;de.push({x:xe,y:He})}l(fe.id,de),S.current.set(fe.id,de.map(Z=>({...Z})))}break}}else fe.type===z.SolarPanel&&(me.isEqual(fe.normal[1],-1)&&(i(fe.id,-ae/2),T.current.set(fe.id,new ie(fe.cx,-ae/2,fe.cz))),me.isEqual(fe.normal[1],1)&&(i(fe.id,ae/2),T.current.set(fe.id,new ie(fe.cx,ae/2,fe.cz))));if(me.isPlantOrHuman(fe)){if(T.current.set(fe.id,new ie(fe.cx,fe.cy,fe.cz)),C.current.set(fe.id,re.id),Math.abs(fe.cz-re.lz/2)0){const ge=Fn.getState().contentRef,de=N(ge==null?void 0:ge.current,re.id);F(de,re,fe)}}else if(Math.abs(Math.abs(fe.cy)-re.ly/2)0?ae:-ae)/2;i(fe.id,ge),T.current.set(fe.id,new ie(fe.cz,ge,fe.cz))}}}},B=(re,ae,se)=>{if(!re||!ae)return;const ne=Fn.getState().contentRef,fe=N(ne==null?void 0:ne.current,ae),ge=N(ae===Zo?ne==null?void 0:ne.current:fe,se);if(ge&&(ne!=null&&ne.current)){if(re===Zo)ne.current.add(ge);else{const de=N(ne.current,re);de==null||de.add(ge)}np()}},_=(re,ae)=>{re&&d(se=>{for(const ne of se.elements)if(ne.id===ae){ne.parentId=re;break}})},X=re=>{if(!y||!k(re))return;const ae=n(y.id),se=ae?ae.ly:y.ly;if(D.current=void 0,M.current=L(re),M.current)D.current=re,b(se);else switch(v.current.clear(),T.current.clear(),x.current.clear(),S.current.clear(),c){case oe.AllSelectedObjectsOfThisType:{const ne=new Map;for(const ge of e)ge.type===z.Cuboid&&!ge.locked&&H.getState().selectedElementIdSet.has(ge.id)&&(ne.set(ge.id,ge.ly),O(ge,re));const fe={name:"Set Width for Selected Cuboids on Surface",timestamp:Date.now(),oldSizes:ne,newSize:re,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())a(Z,he);if(fe.oldChildrenPositionsMap&&fe.oldChildrenPositionsMap.size>0)for(const[Z,he]of fe.oldChildrenPositionsMap.entries()){r(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(xe,He,Z),_(xe,Z))}if(fe.oldChildrenVerticesMap&&fe.oldChildrenVerticesMap.size>0)for(const[Z,he]of fe.oldChildrenVerticesMap.entries())l(Z,he)},redo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())a(Z,fe.newSize);if(fe.newChildrenPositionsMap&&fe.newChildrenPositionsMap.size>0)for(const[Z,he]of fe.newChildrenPositionsMap.entries()){r(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(He,xe,Z),_(He,Z))}if(fe.newChildrenVerticesMap&&fe.newChildrenVerticesMap.size>0)for(const[Z,he]of fe.newChildrenVerticesMap.entries())l(Z,he)}};s(fe),p(f+1);break}case oe.AllObjectsOfThisTypeOnSurface:{const ne=new Map;for(const ge of e)ge.type===z.Cuboid&&ge.parentId===y.parentId&&!ge.locked&&(ne.set(ge.id,ge.ly),O(ge,re));const fe={name:"Set Width for All Cuboids on Surface",timestamp:Date.now(),oldSizes:ne,newSize:re,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())a(Z,he);if(fe.oldChildrenPositionsMap&&fe.oldChildrenPositionsMap.size>0)for(const[Z,he]of fe.oldChildrenPositionsMap.entries()){r(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(xe,He,Z),_(xe,Z))}if(fe.oldChildrenVerticesMap&&fe.oldChildrenVerticesMap.size>0)for(const[Z,he]of fe.oldChildrenVerticesMap.entries())l(Z,he)},redo:()=>{var ge,de;if(U(fe.newSize),fe.newChildrenPositionsMap&&fe.newChildrenPositionsMap.size>0)for(const[Z,he]of fe.newChildrenPositionsMap.entries()){r(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(He,xe,Z),_(He,Z))}if(fe.newChildrenVerticesMap&&fe.newChildrenVerticesMap.size>0)for(const[Z,he]of fe.newChildrenVerticesMap.entries())l(Z,he)}};s(fe),p(f+1);break}case oe.AllObjectsOfThisType:{const ne=new Map;for(const ge of e)ge.type===z.Cuboid&&!ge.locked&&(ne.set(ge.id,ge.ly),O(ge,re));const fe={name:"Set Width for All Cuboids on Surface",timestamp:Date.now(),oldSizes:ne,newSize:re,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())a(Z,he);if(fe.oldChildrenPositionsMap&&fe.oldChildrenPositionsMap.size>0)for(const[Z,he]of fe.oldChildrenPositionsMap.entries()){r(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(xe,He,Z),_(xe,Z))}if(fe.oldChildrenVerticesMap&&fe.oldChildrenVerticesMap.size>0)for(const[Z,he]of fe.oldChildrenVerticesMap.entries())l(Z,he)},redo:()=>{var ge,de;for(const[Z,he]of fe.oldSizes.entries())a(Z,fe.newSize);if(fe.newChildrenPositionsMap&&fe.newChildrenPositionsMap.size>0)for(const[Z,he]of fe.newChildrenPositionsMap.entries()){r(Z,he.x,he.y,he.z);const xe=(ge=fe.oldChildrenParentIdMap)==null?void 0:ge.get(Z),He=(de=fe.newChildrenParentIdMap)==null?void 0:de.get(Z);xe&&He&&xe!==He&&(B(He,xe,Z),_(He,Z))}if(fe.newChildrenVerticesMap&&fe.newChildrenVerticesMap.size>0)for(const[Z,he]of fe.newChildrenVerticesMap.entries())l(Z,he)}};s(fe),p(f+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:break;default:{O(y,re);const ne={name:"Set Cuboid Width",timestamp:Date.now(),oldSize:se,newSize:re,resizedElementId:y.id,resizedElementType:y.type,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenVerticesMap:new Map(x.current),newChildrenVerticesMap:new Map(S.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var fe,ge;if(a(y.id,ne.oldSize),ne.oldChildrenPositionsMap&&ne.oldChildrenPositionsMap.size>0)for(const[de,Z]of ne.oldChildrenPositionsMap.entries()){r(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(B(he,xe,de),_(he,de))}if(ne.oldChildrenVerticesMap&&ne.oldChildrenVerticesMap.size>0)for(const[de,Z]of ne.oldChildrenVerticesMap.entries())l(de,Z)},redo:()=>{var fe,ge;if(a(y.id,ne.newSize),ne.newChildrenPositionsMap&&ne.newChildrenPositionsMap.size>0)for(const[de,Z]of ne.newChildrenPositionsMap.entries()){r(de,Z.x,Z.y,Z.z);const he=(fe=ne.oldChildrenParentIdMap)==null?void 0:fe.get(de),xe=(ge=ne.newChildrenParentIdMap)==null?void 0:ge.get(de);he&&xe&&he!==xe&&(B(xe,he,de),_(xe,de))}if(ne.newChildrenVerticesMap&&ne.newChildrenVerticesMap.size>0)for(const[de,Z]of ne.newChildrenVerticesMap.entries())l(de,Z)}};s(ne),p(f+1);break}}},$=()=>{t(!1)},Q=()=>{$(),g()},le=()=>{X(w),M.current||(t(!1),p(0))},q=()=>{X(w)},te=M.current?": "+Y.t("message.NotApplicableToSelectedAction",E)+(D.current!==void 0?" ("+D.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Width",E),rejectedMessage:te,onApply:q,onClose:$,onClickCancel:Q,onClickOk:le,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:500,style:{width:120},step:.5,precision:2,value:w,onChange:re=>{re!==null&&b(re)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",E),": [0.1, 500] ",Y.t("word.MeterAbbreviation",E)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",E)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:W,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("cuboidMenu.OnlyThisCuboid",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("cuboidMenu.AllCuboidsOnSameSurface",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("cuboidMenu.AllSelectedCuboids",E)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("cuboidMenu.AllCuboids",E)})]})})})]})})},ddo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(qr),r=H(Gn),i=H(kge),a=H(Nwt),l=H(jwt),s=H(Uwt),c=H(En),u=H(Rb),d=H(Hb),f=H(c3),p=H(no),g=H(Zn),y=co(z.Cuboid),[w,b]=m.useState((y==null?void 0:y.lz)??0),C=m.useRef(new Map),P=m.useRef(new Map),v=m.useRef(new Map),T=m.useRef(new Map),A=Jt(),x=B=>{d(B.target.value)},S=(B,_)=>{i(B,_),a(B,_/2)},R=B=>{if(!y)return;const _=o(y);if(_)for(const X of n)X.type===z.Cuboid&&!X.locked&&X.parentId===_.id&&(i(X.id,B),a(X.id,B/2))},M=B=>{if(!y)return;const _=me.getBaseId(y.id);if(_)for(const X of n)X.type===z.Cuboid&&!X.locked&&me.getBaseId(X.id)===_&&(i(X.id,B),a(X.id,B/2))},D=B=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:{for(const _ of n)if(_.type===z.Cuboid&&!_.locked&&H.getState().selectedElementIdSet.has(_.id)&&Math.abs(_.lz-B)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const _ of n)if(_.type===z.Cuboid&&!_.locked&&Math.abs(_.lz-B)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{const _=me.getBaseId(y==null?void 0:y.id);if(_&&_!==Zo){for(const X of n)if(X.type===z.Cuboid&&X.parentId&&X.parentId!==Zo&&!X.locked){const $=X;if(_===me.getBaseId($.id)&&Math.abs($.lz-B)>It)return!0}}break}case oe.AllObjectsOfThisTypeOnSurface:{for(const _ of n)if(_.type===z.Cuboid&&_.parentId!==Zo&&_.parentId===(y==null?void 0:y.parentId)&&!_.locked&&Math.abs(_.lz-B)>It)return!0;break}default:{if(Math.abs((y==null?void 0:y.lz)-B)>It)return!0;break}}return!1}},E=(B,_)=>{if(B==null)return null;for(const X of B.children)if(X.name.includes(`${_}`))return X;return null},W=(B,_,X)=>{var $,Q;if(B){for(const q of B.children)if(q.name.includes(`${X.id}`)){(Q=($=Fn.getState().contentRef)==null?void 0:$.current)==null||Q.add(q);break}X.parentId=Zo;const le=new Xt(X.cx,X.cy).rotateAround(si,-_.rotation[2]).add(new Xt(_.cx,_.cy));X.cx=le.x,X.cy=le.y,X.cz=0,T.current.set(X.id,new ie(le.x,le.y,0)),P.current.set(X.id,Zo)}},j=(B,_)=>{e(X=>{for(const $ of X.elements)if($.parentId===B.id)if(C.current.set($.id,B.id),v.current.set($.id,new ie($.cx,$.cy,$.cz)),me.isPlantOrHuman($))if(Math.abs($.cz-B.lz/2)_/2){const le=Fn.getState().contentRef,q=E(le==null?void 0:le.current,B.id);W(q,B,$)}else $.cz=Q,T.current.set($.id,new ie($.cx,$.cy,Q))}else $.type===z.SolarPanel&&me.isEqual($.normal[2],1)&&($.cz=_/2,T.current.set($.id,new ie($.cx,$.cy,_/2)))})},L=(B,_,X)=>{if(!B||!_)return;const $=Fn.getState().contentRef,Q=E($==null?void 0:$.current,_),le=E(_===Zo?$==null?void 0:$.current:Q,X);if(le&&($!=null&&$.current)){if(B===Zo)$.current.add(le);else{const q=E($.current,B);q==null||q.add(le)}np()}},k=(B,_)=>{B&&e(X=>{for(const $ of X.elements)if($.id===_){$.parentId=B;break}})},N=(B,_)=>{H.getState().set(X=>{for(const $ of X.elements)if(B.has($.id))if(_!==void 0)$.lz=_,$.cz=_/2;else{const Q=B.get($.id);Q!==void 0&&($.lz=Q,$.cz=Q/2)}})},F=B=>{if(y&&D(B)){switch(u){case oe.AllSelectedObjectsOfThisType:{const _=new Map;for(const $ of n)$.type===z.Cuboid&&H.getState().selectedElementIdSet.has($.id)&&(_.set($.id,$.lz),j($,B));const X={name:"Set Height for Selected Cuboids",timestamp:Date.now(),oldValues:_,newValue:B,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var $,Q;if(N(X.oldValues),X.oldChildrenPositionsMap&&X.oldChildrenPositionsMap.size>0)for(const[le,q]of X.oldChildrenPositionsMap.entries()){f(le,q.x,q.y,q.z);const te=($=X.oldChildrenParentIdMap)==null?void 0:$.get(le),re=(Q=X.newChildrenParentIdMap)==null?void 0:Q.get(le);te&&re&&te!==re&&(L(te,re,le),k(te,le))}},redo:()=>{var Q,le;const $=X.newValue;if(N(X.oldValues,$),X.newChildrenPositionsMap&&X.newChildrenPositionsMap.size>0)for(const[q,te]of X.newChildrenPositionsMap.entries()){f(q,te.x,te.y,te.z);const re=(Q=X.oldChildrenParentIdMap)==null?void 0:Q.get(q),ae=(le=X.newChildrenParentIdMap)==null?void 0:le.get(q);re&&ae&&re!==ae&&(L(ae,re,q),k(ae,q))}}};c(X),N(_,B),g(p+1);break}case oe.AllObjectsOfThisType:{const _=new Map;for(const $ of n)$.type===z.Cuboid&&(_.set($.id,$.lz),j($,B));const X={name:"Set Height for All Cuboids",timestamp:Date.now(),oldValues:_,newValue:B,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var $,Q;for(const[le,q]of X.oldValues.entries())S(le,q);if(X.oldChildrenPositionsMap&&X.oldChildrenPositionsMap.size>0)for(const[le,q]of X.oldChildrenPositionsMap.entries()){f(le,q.x,q.y,q.z);const te=($=X.oldChildrenParentIdMap)==null?void 0:$.get(le),re=(Q=X.newChildrenParentIdMap)==null?void 0:Q.get(le);te&&re&&te!==re&&(L(te,re,le),k(te,le))}},redo:()=>{var Q,le;const $=X.newValue;if(l(z.Cuboid,$),s(z.Cuboid,$/2),X.newChildrenPositionsMap&&X.newChildrenPositionsMap.size>0)for(const[q,te]of X.newChildrenPositionsMap.entries()){f(q,te.x,te.y,te.z);const re=(Q=X.oldChildrenParentIdMap)==null?void 0:Q.get(q),ae=(le=X.newChildrenParentIdMap)==null?void 0:le.get(q);re&&ae&&re!==ae&&(L(ae,re,q),k(ae,q))}}};c(X),l(z.Cuboid,B),s(z.Cuboid,B/2),g(p+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{const _=new Map,X=me.getBaseId(y.id);for(const Q of n)Q.type===z.Cuboid&&me.getBaseId(Q.id)===X&&(_.set(Q.id,Q.lz),j(Q,B));const $={name:"Set Height for All Cuboids Above Same Base",timestamp:Date.now(),oldValues:_,newValue:B,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var Q,le;for(const[q,te]of $.oldValues.entries())S(q,te);if($.oldChildrenPositionsMap&&$.oldChildrenPositionsMap.size>0)for(const[q,te]of $.oldChildrenPositionsMap.entries()){f(q,te.x,te.y,te.z);const re=(Q=$.oldChildrenParentIdMap)==null?void 0:Q.get(q),ae=(le=$.newChildrenParentIdMap)==null?void 0:le.get(q);re&&ae&&re!==ae&&(L(re,ae,q),k(re,q))}},redo:()=>{var le,q;const Q=$.newValue;if(M(Q),$.newChildrenPositionsMap&&$.newChildrenPositionsMap.size>0)for(const[te,re]of $.newChildrenPositionsMap.entries()){f(te,re.x,re.y,re.z);const ae=(le=$.oldChildrenParentIdMap)==null?void 0:le.get(te),se=(q=$.newChildrenParentIdMap)==null?void 0:q.get(te);ae&&se&&ae!==se&&(L(se,ae,te),k(se,te))}}};c($),M(B),g(p+1);break}case oe.AllObjectsOfThisTypeOnSurface:{const _=new Map;for(const $ of n)$.type===z.Cuboid&&$.parentId===y.parentId&&(_.set($.id,$.lz),j($,B));const X={name:"Set Height for All Cuboids on Same Surface",timestamp:Date.now(),oldValues:_,newValue:B,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),undo:()=>{var $,Q;for(const[le,q]of X.oldValues.entries())S(le,q);if(X.oldChildrenPositionsMap&&X.oldChildrenPositionsMap.size>0)for(const[le,q]of X.oldChildrenPositionsMap.entries()){f(le,q.x,q.y,q.z);const te=($=X.oldChildrenParentIdMap)==null?void 0:$.get(le),re=(Q=X.newChildrenParentIdMap)==null?void 0:Q.get(le);te&&re&&te!==re&&(L(te,re,le),k(te,le))}},redo:()=>{var Q,le;const $=X.newValue;if(R($),X.newChildrenPositionsMap&&X.newChildrenPositionsMap.size>0)for(const[q,te]of X.newChildrenPositionsMap.entries()){f(q,te.x,te.y,te.z);const re=(Q=X.oldChildrenParentIdMap)==null?void 0:Q.get(q),ae=(le=X.newChildrenParentIdMap)==null?void 0:le.get(q);re&&ae&&re!==ae&&(L(ae,re,q),k(ae,q))}}};c(X),R(B),g(p+1);break}default:{const _=r(y.id),X=_?_.lz:y.lz;j(y,B),S(y.id,B);const $={name:"Set Cuboid Width",timestamp:Date.now(),oldValue:X,newValue:B,oldChildrenPositionsMap:new Map(v.current),newChildrenPositionsMap:new Map(T.current),oldChildrenParentIdMap:new Map(C.current),newChildrenParentIdMap:new Map(P.current),changedElementId:y.id,changedElementType:y.type,undo:()=>{var Q,le;if(S($.changedElementId,$.oldValue),$.oldChildrenPositionsMap&&$.oldChildrenPositionsMap.size>0)for(const[q,te]of $.oldChildrenPositionsMap.entries()){f(q,te.x,te.y,te.z);const re=(Q=$.oldChildrenParentIdMap)==null?void 0:Q.get(q),ae=(le=$.newChildrenParentIdMap)==null?void 0:le.get(q);re&&ae&&re!==ae&&(L(re,ae,q),k(re,q))}},redo:()=>{var Q,le;if(S($.changedElementId,$.newValue),$.newChildrenPositionsMap&&$.newChildrenPositionsMap.size>0)for(const[q,te]of $.newChildrenPositionsMap.entries()){f(q,te.x,te.y,te.z);const re=(Q=$.oldChildrenParentIdMap)==null?void 0:Q.get(q),ae=(le=$.newChildrenParentIdMap)==null?void 0:le.get(q);re&&ae&&re!==ae&&(L(ae,re,q),k(ae,q))}}};c($),g(p+1);break}}e(_=>{_.actionState.cuboidHeight=B})}},U=()=>{t(!1)},O=()=>{F(w)};return h.jsx(so,{width:550,title:Y.t("word.Height",A),onApply:O,onClose:U,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:1e3,style:{width:120},step:.5,precision:2,value:w,onChange:B=>{B!==null&&b(B)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",A),": [0.1, 1000] ",Y.t("word.MeterAbbreviation",A)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",A)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:x,value:u,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("cuboidMenu.OnlyThisCuboid",A)}),(y==null?void 0:y.parentId)!==Zo&&h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("cuboidMenu.AllCuboidsOnSameSurface",A)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("cuboidMenu.AllCuboidsAboveSameBase",A)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("cuboidMenu.AllSelectedCuboids",A)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("cuboidMenu.AllCuboids",A)})]})})})]})})},fdo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(Lge),r=H(En),i=H(Rb),a=H(Hb),l=H(no),s=H(Zn),c=co(z.Cuboid),[u,d]=m.useState(c?-c.rotation[2]:0),f=Jt(),p=v=>{a(v.target.value)},g=v=>{for(const T of e)T.type===z.Cuboid&&!T.locked&&T.parentId===(c==null?void 0:c.parentId)&&o(T.id,0,0,-v)},y=v=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const T of e)if(T.type===z.Cuboid&&!T.locked&&H.getState().selectedElementIdSet.has(T.id)&&Math.abs(-T.rotation[2]-v)>It)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const T of e)if(T.type===z.Cuboid&&T.parentId===(c==null?void 0:c.parentId)&&!T.locked&&Math.abs(-T.rotation[2]-v)>It)return!0;break;case oe.AllObjectsOfThisType:{for(const T of e)if(T.type===z.Cuboid&&!T.locked&&Math.abs(-T.rotation[2]-v)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:break;default:if(Math.abs((c?-c.rotation[2]:0)-v)>It)return!0}return!1},w=(v,T)=>{H.getState().set(A=>{for(const x of A.elements)if(v.has(x.id))if(T!==void 0)x.rotation[2]=T;else{const S=v.get(x.id);S!==void 0&&(x.rotation[2]=-S)}})},b=v=>{if(c&&y(v))switch(i){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of e)x.type===z.Cuboid&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&T.set(x.id,-x.rotation[2]);const A={name:"Set Azimuth for Selected Cuboids",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{w(A.oldValues)},redo:()=>{w(A.oldValues,-A.newValue)}};r(A),w(T,-v),s(l+1);break}case oe.AllObjectsOfThisTypeOnSurface:{const T=new Map;for(const x of e)x.type===z.Cuboid&&x.parentId===c.parentId&&!x.locked&&T.set(x.id,-x.rotation[2]);const A={name:"Set Azimuth for All Cuboids on Surface",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{for(const[x,S]of A.oldValues.entries())o(x,0,0,-S)},redo:()=>{g(A.newValue)}};r(A),g(v),s(l+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of e)x.type===z.Cuboid&&!x.locked&&T.set(x.id,-x.rotation[2]);const A={name:"Set Azimuth for All Cuboids",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{w(A.oldValues)},redo:()=>{w(A.oldValues,-A.newValue)}};r(A),w(T,-v),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:break;default:{const T=n(c.id),A=T?-T.rotation[2]:-c.rotation[2],x={name:"Set Cuboid Azimuth",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:c.id,changedElementType:c.type,undo:()=>{o(x.changedElementId,0,0,-x.oldValue)},redo:()=>{o(x.changedElementId,0,0,-x.newValue)}};r(x),o(c.id,0,0,-v),s(l+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("word.Azimuth",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:-180,max:180,style:{width:120},step:.5,precision:2,value:parseFloat(me.toDegrees(u).toFixed(2)),formatter:v=>`${v}°`,onChange:v=>{v!==null&&d(me.toRadians(v))}}),h.jsxs("div",{style:{paddingTop:"20px",paddingRight:"6px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [-180°, 180°]",h.jsx("br",{}),Y.t("message.AzimuthOfNorthIsZero",f),h.jsx("br",{}),Y.t("message.CounterclockwiseAzimuthIsPositive",f)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:p,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("cuboidMenu.OnlyThisCuboid",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("cuboidMenu.AllCuboidsOnSameSurface",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("cuboidMenu.AllSelectedCuboids",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("cuboidMenu.AllCuboids",f)})]})})})]})})},hdo=[{key:"sensorCount",objectType:z.Sensor},{key:"polygonCount",objectType:z.Polygon},{key:"humanCount",objectType:z.Human},{key:"treeCount",objectType:z.Tree},{key:"flowerCount",objectType:z.Flower},{key:"outsideLightCount",objectType:z.Light}],pdo=(t,e)=>{const n={lng:H.getState().language};let o="",r="";switch(t){case z.Light:{o=`${Y.t("cuboidMenu.RemoveAllUnlockedLights",n)} (${e})`,r=`${Y.t("cuboidMenu.DoYouReallyWantToRemoveAllLightsOnCuboid",n)} (${e} ${Y.t("cuboidMenu.Lights",n)})`;break}case z.Sensor:{o=`${Y.t("cuboidMenu.RemoveAllUnlockedSensors",n)} (${e})`,r=`${Y.t("cuboidMenu.DoYouReallyWantToRemoveAllSensorsOnCuboid",n)} (${e} ${Y.t("cuboidMenu.Sensors",n)})`;break}case z.Polygon:{o=`${Y.t("cuboidMenu.RemoveAllUnlockedPolygons",n)} (${e})`,r=`${Y.t("cuboidMenu.DoYouReallyWantToRemoveAllPolygonsOnCuboid",n)} (${e} ${Y.t("cuboidMenu.Polygons",n)})`;break}case z.Human:{o=`${Y.t("cuboidMenu.RemoveAllUnlockedHumans",n)} (${e})`,r=`${Y.t("cuboidMenu.DoYouReallyWantToRemoveAllHumansOnCuboid",n)} (${e} ${Y.t("cuboidMenu.Humans",n)})`;break}case z.Tree:{o=`${Y.t("cuboidMenu.RemoveAllUnlockedTrees",n)} (${e})`,r=`${Y.t("cuboidMenu.DoYouReallyWantToRemoveAllTreesOnCuboid",n)} (${e} ${Y.t("cuboidMenu.Trees",n)})`;break}case z.Flower:{o=`${Y.t("cuboidMenu.RemoveAllUnlockedFlowers",n)} (${e})`,r=`${Y.t("cuboidMenu.DoYouReallyWantToRemoveAllFlowersOnCuboid",n)} (${e} ${Y.t("cuboidMenu.Flowers",n)})`;break}}return{itemLabel:o,modalTitle:r}},gdo=(t,e)=>{const n=[],o={lng:H.getState().language};if(e.solarPanelCount>0){const r=Y.t("cuboidMenu.DoYouReallyWantToRemoveAllSolarPanelsOnCuboid",o)+" ("+e.solarPanelModuleCount+" "+Y.t("cuboidMenu.SolarPanels",o)+", "+e.solarPanelCount+" "+Y.t("cuboidMenu.Racks",o)+")?";n.push({key:"remove-all-solar-panels-on-cuboid",label:h.jsxs(CHe,{cuboid:t,objectType:z.SolarPanel,modalTitle:r,children:[Y.t("cuboidMenu.RemoveAllUnlockedSolarPanels",o),"  (",e.solarPanelModuleCount," ",Y.t("cuboidMenu.SolarPanels",o),",",e.solarPanelCount," ",Y.t("cuboidMenu.Racks",o),")"]})})}return hdo.forEach(({key:r,objectType:i})=>{const a=e[r];if(typeof a=="number"&&a>0){const{itemLabel:l,modalTitle:s}=pdo(i,a),c=i.replaceAll(" ","");n.push({key:`remove-all-${c}s-on-cuboid`,label:h.jsx(CHe,{cuboid:t,objectType:i,modalTitle:s,children:l})})}}),n},mdo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(Rb),a=H(Hb),l=H(no),s=H(Zn),c=co(z.Cuboid),[u,d]=m.useState((c==null?void 0:c.transparency)??0),f=Jt(),p=(T,A)=>{e(x=>{for(const S of x.elements)if(S.type===z.Cuboid&&S.id===T&&!S.locked){S.transparency=A;break}})},g=T=>{for(const A of n)A.type===z.Cuboid&&!A.locked&&A.parentId===(c==null?void 0:c.parentId)&&p(A.id,T)},y=(T,A)=>{e(x=>{for(const S of x.elements)if(S.type===z.Cuboid&&T.has(S.id))if(A!==void 0)S.transparency=A;else{const R=T.get(S.id);R!==void 0&&(S.transparency=R)}})},w=T=>{a(T.target.value)},b=T=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const A of n)if(A.type===z.Cuboid&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&Math.abs((A.transparency??0)-T)>It)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const A of n)if(A.type===z.Cuboid&&A.parentId===(c==null?void 0:c.parentId)&&!A.locked&&Math.abs((A.transparency??0)-T)>It)return!0;break;case oe.AllObjectsOfThisType:{for(const A of n)if(A.type===z.Cuboid&&!A.locked&&Math.abs((A.transparency??0)-T)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:break;default:if(Math.abs(((c==null?void 0:c.transparency)??0)-T)>It)return!0}return!1},C=T=>{if(c&&b(T))switch(i){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Cuboid&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&A.set(S.id,S.transparency??0);const x={name:"Set Transparency for Selected Cuboids",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{y(x.oldValues,-x.newValue)}};r(x),y(A,T),s(l+1);break}case oe.AllObjectsOfThisTypeOnSurface:{const A=new Map;for(const S of n)S.type===z.Cuboid&&S.parentId===c.parentId&&!S.locked&&A.set(S.id,S.transparency??0);const x={name:"Set Transparency for All Cuboids on Surface",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())p(S,R)},redo:()=>{g(x.newValue)}};r(x),g(T),s(l+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Cuboid&&!S.locked&&A.set(S.id,S.transparency??0);const x={name:"Set Transparency for All Cuboids",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{y(x.oldValues,-x.newValue)}};r(x),y(A,T),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:break;default:{const A=o(c.id),x=A?A.transparency:c.transparency,S={name:"Set Cuboid Transparency",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:c.id,changedElementType:c.type,undo:()=>{p(S.changedElementId,S.oldValue)},redo:()=>{p(S.changedElementId,S.newValue)}};r(S),p(c.id,T),s(l+1);break}}},P=()=>{t(!1)},v=()=>{C(u)};return h.jsx(so,{width:550,title:Y.t("word.Transparency",f),onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.1,precision:2,value:u,onChange:T=>{T!==null&&d(T)}}),h.jsxs("div",{style:{paddingTop:"20px",paddingRight:"6px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("cuboidMenu.OnlyThisCuboid",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("cuboidMenu.AllCuboidsOnSameSurface",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("cuboidMenu.AllSelectedCuboids",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("cuboidMenu.AllCuboids",f)})]})})})]})})},ydo=()=>{const t=H.getState().elementsToPaste;if(t&&t.length>0){const e=t[0];if(e.type===z.Human||e.type===z.Tree||e.type===z.Flower||e.type===z.Polygon||e.type===z.Sensor||e.type===z.SolarPanel||e.type===z.Cuboid)return!0}return!1},Ado=t=>{const e=[];if(t.type!==z.Cuboid)return{items:e};const n=t,o=H.getState().selectedSideIndex,r={lng:H.getState().language},i=H.getState().countAllOffspringsByTypeAtOnce(n.id,!1),a=!(n!=null&&n.locked),l=!n.textureTypes||o>=0&&n.textureTypes[o]===Co.NoTexture;return ydo()&&e.push({key:"cuboid-paste",label:h.jsx(eM,{})}),e.push({key:"cuboid-copy",label:h.jsx(Ld,{})}),a&&e.push({key:"cuboid-cut",label:h.jsx(Wd,{})}),e.push({key:"cuboid-lock",label:h.jsx(Ju,{selectedElement:n})}),e.push({key:"cuboid-group-master",label:h.jsx(DQe,{groupableElement:n})}),e.push({key:"cuboid-stackable",label:h.jsx(Kuo,{cuboid:n})}),i.gotSome()&&e.push({key:"cuboid-clear",label:h.jsx(rn,{children:Y.t("word.Clear",r)}),children:gdo(n,i)}),a&&(l&&e.push({key:"cuboid-color",label:h.jsxs(to,{Dialog:$uo,children:[Y.t("word.Color",r)," ..."]})}),e.push({key:"cuboid-texture",label:h.jsxs(to,{Dialog:sdo,children:[Y.t("word.Texture",r)," ..."]})}),e.push({key:"cuboid-length",label:h.jsxs(to,{Dialog:cdo,children:[Y.t("word.Length",r)," ..."]})}),e.push({key:"cuboid-width",label:h.jsxs(to,{Dialog:udo,children:[Y.t("word.Width",r)," ..."]})}),e.push({key:"cuboid-height",label:h.jsxs(to,{Dialog:ddo,children:[Y.t("word.Height",r)," ..."]})}),e.push({key:"cuboid-azimuth",label:h.jsxs(to,{Dialog:fdo,children:[Y.t("word.Azimuth",r)," ..."]})}),e.push({key:"cuboid-transparency",label:h.jsxs(to,{Dialog:mdo,children:[Y.t("word.Transparency",r)," ..."]})})),e.push({key:"add-polygon-on-cuboid",label:h.jsx(quo,{cuboid:n,selectedSideIndex:o})}),a&&e.push({key:"cuboid-label",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",r)}),children:PA(n)}),{items:e}},wdo=()=>{const t=H(hA),e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.groundImage=r,i.viewState.groundImageType=i.viewState.mapType})},o=r=>{const i=r.target.checked,a={name:"Show Ground Image",timestamp:Date.now(),checked:i,undo:()=>{n(!a.checked)},redo:()=>{n(a.checked)}};H.getState().addUndoable(a),n(i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t,onChange:o,children:Y.t("groundMenu.ImageOnGround",e)})})},vdo=()=>{const t=H(CBe),e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.waterSurface=r})},o=r=>{const i=r.target.checked,a={name:"Water Surface",timestamp:Date.now(),checked:i,undo:()=>{n(!a.checked)},redo:()=>{n(a.checked)}};H.getState().addUndoable(a),n(i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,update:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t,onChange:o,children:Y.t("groundMenu.WaterSurface",e)})})},xdo=()=>{const t=H(PBe),e=o=>{H.getState().set(r=>{r.viewState.groundColor=o})},n=o=>{const r=t,i=o.hex,a={name:"Set Ground Color",timestamp:Date.now(),oldValue:r,newValue:i,undo:()=>{e(a.oldValue)},redo:()=>{e(a.newValue)}};H.getState().addUndoable(a),e(i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(zf,{color:t,onChangeComplete:n})})},bdo=()=>{const t=H(xge)??Fq,n=H(Tc)>0,o=Jt(),r=s=>{H.getState().set(c=>{c.world.leafDayOfYear1=s})},i=s=>{if(s===null)return;const c=t,u=s,d={name:"Set Leaf Day 1",timestamp:Date.now(),oldValue:c,newValue:u,undo:()=>{r(d.oldValue)},redo:()=>{r(d.newValue)}};H.getState().addUndoable(d),r(u)},a=()=>h.jsx("div",{style:{width:"80px"},children:Y.t(n?"groundMenu.LeafOffDay":"groundMenu.LeafOutDay",o)}),l=()=>h.jsx("div",{style:{width:"60px"},children:"(1-150)"});return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsx(a,{}),addonAfter:h.jsx(l,{}),style:{width:"300px"},min:1,max:150,step:1,precision:0,value:t,onChange:i})})},Sdo=()=>{const t=H(bge)??kq,n=H(Tc)>0,o=Jt(),r=s=>{H.getState().set(c=>{c.world.leafDayOfYear2=s})},i=s=>{if(s===null)return;const c=t,u=s,d={name:"Set Leaf Day 2",timestamp:Date.now(),oldValue:c,newValue:u,undo:()=>{r(d.oldValue)},redo:()=>{r(d.newValue)}};H.getState().addUndoable(d),r(u)},a=()=>h.jsx("div",{style:{width:"80px"},children:Y.t(n?"groundMenu.LeafOffDay":"groundMenu.LeafOutDay",o)}),l=()=>h.jsx("div",{style:{width:"60px"},children:"(215-365)"});return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsx(a,{}),addonAfter:h.jsx(l,{}),style:{width:"300px"},min:215,max:365,step:1,precision:0,value:t,onChange:i})})},RHe=({monthIndex:t})=>{const e=H(i=>i.world.monthlyIrradianceLosses?i.world.monthlyIrradianceLosses[t]:.05)??.05,n=Jt(),o=i=>{H.getState().set(a=>{a.world.monthlyIrradianceLosses||(a.world.monthlyIrradianceLosses=new Array(12).fill(.05)),a.world.monthlyIrradianceLosses[t]=i})},r=i=>{if(i===null)return;const a=e,l=i,s={name:"Set Irradiance Loss in "+nwe[t],timestamp:Date.now(),oldValue:a,newValue:l,undo:()=>{o(s.oldValue)},redo:()=>{o(s.newValue)}};H.getState().addUndoable(s),o(l)};return h.jsx(Mn,{addonBefore:h.jsx("span",{style:{fontFamily:"monospace"},children:Y.t(`month.${nwe[t]}`,n)}),style:{width:"120px"},min:0,max:1,step:.01,precision:2,value:e,onChange:r})},Tdo=()=>{const t=H(r=>r.world.ground.albedo),e=Jt(),n=r=>{H.getState().set(i=>{i.world.ground.albedo=r})},o=r=>{if(r===null)return;const i=t,a=r,l={name:"Set Ground Albedo",timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"60px"},children:[Y.t("groundMenu.Albedo",e),":"]}),h.jsx(Mn,{min:.05,max:1,step:.01,precision:2,value:t,onChange:o})]})},Pdo=({itemLabel:t,modalTitle:e,objectType:n})=>{const o=H.getState().removeElementsByType,r=()=>{const a=H.getState().elements.filter(c=>!c.locked&&c.type===n);o(n);const l=JSON.parse(JSON.stringify(a)),s={name:"Remove All "+n+"s",timestamp:Date.now(),removedElements:l,undo:()=>{H.getState().set(c=>{c.elements.push(...s.removedElements)})},redo:()=>{o(n)}};H.getState().addUndoable(s),ht.getState().updateContextMenu()},i=()=>{Oi.confirm({title:e,onOk:r,icon:h.jsx(ny,{})})};return h.jsx(rn,{onClick:i,children:t})},HHe=({lock:t,count:e,label:n})=>{const o=H.getState().updateAllElementLocks,r=()=>{const i=new Map;for(const c of H.getState().elements)i.set(c.id,!!c.locked);const s={name:`${t?"Lock":"Unlock"} All ${t?"Unlocked":"Locked"} Elements`,timestamp:Date.now(),oldValues:i,newValue:!0,undo:()=>{for(const[c,u]of s.oldValues.entries())H.getState().updateElementLockById(c,u)},redo:()=>{o(t)}};H.getState().addUndoable(s),o(t)};return h.jsxs(rn,{update:!0,onClick:r,children:[n," (",e,")"]})},Cdo=[{key:"humanCount",type:z.Human,itemLabel:"groundMenu.RemoveAllUnlockedPeople",modalTitle:"groundMenu.DoYouReallyWantToRemoveAllPeople"},{key:"treeCount",type:z.Tree,itemLabel:"groundMenu.RemoveAllUnlockedTrees",modalTitle:"groundMenu.DoYouReallyWantToRemoveAllTrees"},{key:"flowerCount",type:z.Flower,itemLabel:"groundMenu.RemoveAllUnlockedFlowers",modalTitle:"groundMenu.DoYouReallyWantToRemoveAllFlowers"},{key:"solarPanelCount",type:z.SolarPanel,itemLabel:"groundMenu.RemoveAllUnlockedSolarPanels",modalTitle:"groundMenu.DoYouReallyWantToRemoveAllSolarPanels"},{key:"foundationCount",type:z.Foundation,itemLabel:"groundMenu.RemoveAllUnlockedFoundations",modalTitle:"groundMenu.DoYouReallyWantToRemoveAllFoundations"},{key:"cuboidCount",type:z.Cuboid,itemLabel:"groundMenu.RemoveAllUnlockedCuboids",modalTitle:"groundMenu.DoYouReallyWantToRemoveAllCuboids"}],Rdo=()=>{const t=H.getState().elementsToPaste;if(!t||t.length===0)return!1;const e=t[0];return e.type===z.Human||e.type===z.Tree||e.type===z.Flower||e.type===z.Cuboid||e.type===z.Foundation},Hdo=()=>Ms.slice().reduce((t,e,n,o)=>(t&&n%2!==0&&t.push({key:`${o[n-1]}-${o[n]}`,label:h.jsxs(rn,{stayAfterClick:!0,noPadding:!0,children:[h.jsx(RHe,{monthIndex:n-1}),h.jsx(RHe,{monthIndex:n})]})}),t),[]),Mdo=()=>{const t={lng:H.getState().language},e=H.getState().countAllElementsByType(!0),n=[];return Rdo()&&n.push({key:"ground-paste",label:h.jsx(eM,{})}),Cdo.forEach(({key:o,type:r,itemLabel:i,modalTitle:a})=>{const l=e[o];typeof l=="number"&&l>0&&n.push({key:`ground-remove-all-${r}s`,label:h.jsx(Pdo,{objectType:r,itemLabel:`${Y.t(i,t)} (${l})`,modalTitle:`${Y.t(a,t)} (${l})?`})})}),e.unlockedCount>0&&n.push({key:"lock-all-elements",label:h.jsx(HHe,{lock:!0,count:e.unlockedCount,label:Y.t("groundMenu.LockAllUnlockedElements",t)})}),e.lockedCount>0&&H.getState().elements.length>0&&n.push({key:"unlock-all-elements",label:h.jsx(HHe,{lock:!1,count:e.lockedCount,label:Y.t("groundMenu.UnlockAllLockedElements",t)})}),n.push({key:"image-on-ground",label:h.jsx(wdo,{})}),n.push({key:"water-surface",label:h.jsx(vdo,{})}),H.getState().viewState.waterSurface||n.push({key:"ground-color-submenu",label:h.jsx(rn,{children:Y.t("word.Color",t)}),children:[{key:"ground-color-picker",label:h.jsx(xdo,{}),style:{backgroundColor:"white"}}]}),n.push({key:"vegetation-submenu",label:h.jsx(rn,{children:Y.t("groundMenu.Vegetation",t)}),children:[{key:"leaf-out-day",label:h.jsx(bdo,{})},{key:"leaf-shed-day",label:h.jsx(Sdo,{})}]}),n.push({key:"monthly-irradiance-loss-submenu",label:h.jsx(rn,{children:Y.t("groundMenu.MonthlyIrradianceLoss",t)}),children:Hdo()}),n.push({key:"ground-albedo",label:h.jsx(Tdo,{})}),{items:n}};var NE={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return .5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return t===0?0:Math.pow(1024,t-1)},Out:function(t){return t===1?1:1-Math.pow(2,-10*t)},InOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return t===0?0:t===1?1:-Math.pow(2,10*(t-1))*Math.sin((t-1.1)*5*Math.PI)},Out:function(t){return t===0?0:t===1?1:Math.pow(2,-10*t)*Math.sin((t-.1)*5*Math.PI)+1},InOut:function(t){return t===0?0:t===1?1:(t*=2,t<1?-.5*Math.pow(2,10*(t-1))*Math.sin((t-1.1)*5*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin((t-1.1)*5*Math.PI)+1)}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-NE.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?NE.Bounce.In(t*2)*.5:NE.Bounce.Out(t*2-1)*.5+.5}}},VD;typeof self>"u"&&typeof process<"u"&&process.hrtime?VD=function(){var t=process.hrtime();return t[0]*1e3+t[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?VD=self.performance.now.bind(self.performance):Date.now!==void 0?VD=Date.now:VD=function(){return new Date().getTime()};var MP=VD,Ido=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(n){return e._tweens[n]})},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},t.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},t.prototype.update=function(e,n){e===void 0&&(e=MP()),n===void 0&&(n=!1);var o=Object.keys(this._tweens);if(o.length===0)return!1;for(;o.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r1?i(t[n],t[n-1],n-o):i(t[r],t[r+1>n?n:r+1],o-r)},Bezier:function(t,e){for(var n=0,o=t.length-1,r=Math.pow,i=GD.Utils.Bernstein,a=0;a<=o;a++)n+=r(1-e,o-a)*r(e,a)*t[a]*i(o,a);return n},CatmullRom:function(t,e){var n=t.length-1,o=n*e,r=Math.floor(o),i=GD.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(r=Math.floor(o=n*(1+e))),i(t[(r-1+n)%n],t[r],t[(r+1)%n],t[(r+2)%n],o-r)):e<0?t[0]-(i(t[0],t[0],t[1],t[1],-o)-t[0]):e>1?t[n]-(i(t[n],t[n],t[n-1],t[n-1],o-n)-t[n]):i(t[r?r-1:0],t[r],t[n1;o--)n*=o;return t[e]=n,n}}(),CatmullRom:function(t,e,n,o,r){var i=(n-t)*.5,a=(o-e)*.5,l=r*r,s=r*l;return(2*e-2*n+i+a)*s+(-3*e+3*n-2*i-a)*l+i*r+e}}},zdo=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),vrt=new Ido,Ddo=function(){function t(e,n){n===void 0&&(n=vrt),this._object=e,this._group=n,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=NE.Linear.None,this._interpolationFunction=GD.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=zdo.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(e,n){return this._valuesEnd=Object.create(e),n!==void 0&&(this._duration=n),this},t.prototype.duration=function(e){return this._duration=e,this},t.prototype.start=function(e){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e!==void 0?typeof e=="string"?MP()+parseFloat(e):e:MP(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(e,n,o,r){for(var i in o){var a=e[i],l=Array.isArray(a),s=l?"array":typeof a,c=!l&&Array.isArray(o[i]);if(!(s==="undefined"||s==="function")){if(c){var u=o[i];if(u.length===0)continue;u=u.map(this._handleRelativeValue.bind(this,a)),o[i]=[a].concat(u)}if((s==="object"||l)&&a&&!c){n[i]=l?[]:{};for(var d in a)n[i][d]=a[d];r[i]=l?[]:{},this._setupProperties(a,n[i],o[i],r[i])}else typeof n[i]>"u"&&(n[i]=a),l||(n[i]*=1),c?r[i]=o[i].slice().reverse():r[i]=n[i]||0}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(e){return e===void 0&&(e=MP()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this),this)},t.prototype.resume=function(e){return e===void 0&&(e=MP()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},t.prototype.stopChainedTweens=function(){for(var e=0,n=this._chainedTweens.length;ei)return!1;n&&this.start(e)}if(this._goToEnd=!1,e1?1:r;var a=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var l=0,s=this._chainedTweens.length;l{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&(l.type===z.Human||l.type===z.Tree||l.type===z.Flower)){const s=l;s.flip=i;break}})},o=r=>{const i=r.target.checked,a={name:`Flip ${t.type}`,timestamp:Date.now(),checked:i,selectedElementId:t.id,selectedElementType:z.Human,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.flip,onChange:o,children:Y.t("peopleMenu.Flip",e)})})}),Fdo=be.memo(({human:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.type===z.Human&&l.id===r){l.observer=i;break}})},o=r=>{const i=r.target.checked,a={name:"Set Observer",timestamp:Date.now(),checked:i,selectedElementId:t.id,selectedElementType:z.Human,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.observer,onChange:o,children:Y.t("peopleMenu.Observer",e)})})}),kdo=be.memo(({human:t})=>{const e=Jt(),[n,o]=m.useState(!1),r=m.useRef(0),i=m.useRef(-1),a=m.useRef(!0),l=m.useRef(!1);m.useEffect(()=>{if(l.current){if(a.current)return r.current=requestAnimationFrame(c),u(),()=>{cancelAnimationFrame(r.current)};a.current=!0}},[n]);const s=(f,p,g)=>{const y=Fn.getState().orbitControlsRef;y!=null&&y.current&&(y.current.object.position.set(f,p,g),y.current.update(),H.getState().set(w=>{const b=w.viewState;b.cameraPosition=[f,p,g]}))},c=()=>{requestAnimationFrame(c);const f=Date.now();f-i.current>100&&(Edo(),i.current=f)},u=()=>{if(!t)return;let f=t.cx,p=t.cy,g=t.cz+t.lz;const y=H.getState().getParent(t);if(y){const C=me.absoluteHumanOrTreeCoordinates(f,p,g,y);f=C.x,p=C.y,g=C.z}const w=H.getState().cameraDirection.clone().normalize().multiplyScalar(.5);f+=w.x,p+=w.y;const b=[...H.getState().viewState.cameraPosition];new Ddo(b).to([f,p,g],1e3).easing(NE.Quadratic.In).onUpdate(C=>{s(C[0],C[1],C[2])}).onComplete(()=>{H.getState().selectNone()}).start()},d=()=>{o(!n),l.current=!0};return h.jsx(rn,{onClick:d,children:Y.t("peopleMenu.ViewFromThisPerson",e)})}),Ldo=be.memo(({tree:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.type===z.Tree&&l.id===r){l.showModel=i;break}})},o=r=>{const i={name:"Show Tree Model",timestamp:Date.now(),checked:r,selectedElementId:t.id,selectedElementType:z.Tree,undo:()=>{n(t.id,!i.checked)},redo:()=>{n(t.id,i.checked)}};H.getState().addUndoable(i),n(t.id,r)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:(t==null?void 0:t.showModel)&&(t==null?void 0:t.type)===z.Tree,onChange:r=>o(r.target.checked),children:Y.t("treeMenu.ShowModel",e)})})}),Wdo=be.memo(({tree:t})=>{const e=H.getState().updateElementLxById,n=Jt(),o=t.lx??1,r=i=>{if(i===null||i===o)return;const a={name:"Set Tree Spread",timestamp:Date.now(),oldValue:o,newValue:i,changedElementId:t.id,changedElementType:t.type,undo:()=>{e(a.changedElementId,a.oldValue)},redo:()=>{e(a.changedElementId,a.newValue)}};H.getState().addUndoable(a),e(t.id,i),H.getState().set(l=>{l.actionState.treeSpread=i})};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"100px"},children:[Y.t("treeMenu.Spread",n)+" ("+Y.t("word.MeterAbbreviation",n)+")",":"]}),h.jsx(Mn,{style:{width:"160px"},min:1,max:50,step:1,precision:1,value:o,onChange:r})]})}),Ndo=be.memo(({tree:t})=>{const e=H.getState().updateElementLzById,n=Jt(),o=t.lz??1,r=i=>{if(i===null||i===o)return;const a={name:"Set Tree Height",timestamp:Date.now(),oldValue:o,newValue:i,changedElementId:t.id,changedElementType:t.type,undo:()=>{e(a.changedElementId,a.oldValue)},redo:()=>{e(a.changedElementId,a.newValue)}};H.getState().addUndoable(a),e(t.id,i),H.getState().set(l=>{l.actionState.treeHeight=i})};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"100px"},children:[Y.t("word.Height",n)+" ("+Y.t("word.MeterAbbreviation",n)+")",":"]}),h.jsx(Mn,{style:{width:"160px"},min:1,max:30,step:1,precision:1,value:o,onChange:r})]})}),{Option:Ka}=_o,Udo=be.memo(({human:t})=>{const e=H(fn),n=H(En),[o,r]=m.useState(!1),i=Jt(),a=(l,s)=>{e(c=>{for(const u of c.elements)if(u.type===z.Human&&u.id===l){const d=u;d.name=s,d.lx=Fp.fetchWidth(s),d.lz=Fp.fetchHeight(s);break}})};return h.jsxs(_o,{style:{width:"140px"},value:(t==null?void 0:t.name)??Yt.Jack,onChange:l=>{if(t){const s=t.name;if(s!==l){const c={name:"Change People",timestamp:Date.now(),oldValue:s,newValue:l,changedElementId:t.id,changedElementType:t.type,undo:()=>{a(c.changedElementId,c.oldValue)},redo:()=>{a(c.changedElementId,c.newValue)}};n(c),a(t.id,l),e(u=>{u.actionState.humanName=l}),r(!o)}}},children:[h.jsxs(Ka,{value:Yt.Jack,children:[h.jsx("img",{alt:Yt.Jack,src:Sje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.Jack",i)]},Yt.Jack),h.jsxs(Ka,{value:Yt.Jacob,children:[h.jsx("img",{alt:Yt.Jacob,src:Tje,height:20,style:{paddingRight:"16px"}})," ",Y.t("people.Jacob",i)]},Yt.Jacob),h.jsxs(Ka,{value:Yt.Jacqueline,children:[h.jsx("img",{alt:Yt.Jacqueline,src:Pje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jacqueline",i)]},Yt.Jacqueline),h.jsxs(Ka,{value:Yt.Jaah,children:[h.jsx("img",{alt:Yt.Jaah,src:bje,height:20,style:{paddingRight:"19px"}})," ",Y.t("people.Jaah",i)]},Yt.Jaah),h.jsxs(Ka,{value:Yt.Jade,children:[h.jsx("img",{alt:Yt.Jade,src:Cje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jade",i)]},Yt.Jade),h.jsxs(Ka,{value:Yt.Jamelia,children:[h.jsx("img",{alt:Yt.Jamelia,src:Rje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jamelia",i)]},Yt.Jamelia),h.jsxs(Ka,{value:Yt.James,children:[h.jsx("img",{alt:Yt.James,src:Hje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.James",i)]},Yt.James),h.jsxs(Ka,{value:Yt.Jane,children:[h.jsx("img",{alt:Yt.Jane,src:Mje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.Jane",i)]},Yt.Jane),h.jsxs(Ka,{value:Yt.Jaya,children:[h.jsx("img",{alt:Yt.Jaya,src:Ije,height:20,style:{paddingRight:"19px"}})," ",Y.t("people.Jaya",i)]},Yt.Jaya),h.jsxs(Ka,{value:Yt.Jaye,children:[h.jsx("img",{alt:Yt.Jaye,src:zje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jaye",i)]},Yt.Jaye),h.jsxs(Ka,{value:Yt.Jeanette,children:[h.jsx("img",{alt:Yt.Jeanette,src:Dje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jeanette",i)]},Yt.Jeanette),h.jsxs(Ka,{value:Yt.Jedi,children:[h.jsx("img",{alt:Yt.Jedi,src:Eje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jedi",i)]},Yt.Jedi),h.jsxs(Ka,{value:Yt.Jeff,children:[h.jsx("img",{alt:Yt.Jeff,src:Fje,height:20,style:{paddingRight:"19px"}})," ",Y.t("people.Jeff",i)]},Yt.Jeff),h.jsxs(Ka,{value:Yt.Jena,children:[h.jsx("img",{alt:Yt.Jena,src:kje,height:20,style:{paddingRight:"19px"}})," ",Y.t("people.Jena",i)]},Yt.Jena),h.jsxs(Ka,{value:Yt.Jennifer,children:[h.jsx("img",{alt:Yt.Jennifer,src:Lje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.Jennifer",i)]},Yt.Jennifer),h.jsxs(Ka,{value:Yt.Jess,children:[h.jsx("img",{alt:Yt.Jess,src:Wje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.Jess",i)]},Yt.Jess),h.jsxs(Ka,{value:Yt.Jett,children:[h.jsx("img",{alt:Yt.Jett,src:Nje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.Jett",i)]},Yt.Jett),h.jsxs(Ka,{value:Yt.Jill,children:[h.jsx("img",{alt:Yt.Jill,src:Uje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jill",i)]},Yt.Jill),h.jsxs(Ka,{value:Yt.Jiya,children:[h.jsx("img",{alt:Yt.Jiya,src:jje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jiya",i)]},Yt.Jiya),h.jsxs(Ka,{value:Yt.Joan,children:[h.jsx("img",{alt:Yt.Joan,src:Bje,height:20,style:{paddingRight:"8px"}})," ",Y.t("people.Joan",i)]},Yt.Joan),h.jsxs(Ka,{value:Yt.Jocelyn,children:[h.jsx("img",{alt:Yt.Jocelyn,src:Yje,height:20,style:{paddingRight:"23px"}})," ",Y.t("people.Jocelyn",i)]},Yt.Jocelyn),h.jsxs(Ka,{value:Yt.Joel,children:[h.jsx("img",{alt:Yt.Joel,src:Oje,height:20,style:{paddingRight:"7px"}})," ",Y.t("people.Joel",i)]},Yt.Joel),h.jsxs(Ka,{value:Yt.Joey,children:[h.jsx("img",{alt:Yt.Joey,src:_je,height:20,style:{paddingRight:"22px"}})," ",Y.t("people.Joey",i)]},Yt.Joey),h.jsxs(Ka,{value:Yt.John,children:[h.jsx("img",{alt:Yt.John,src:Vje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.John",i)]},Yt.John),h.jsxs(Ka,{value:Yt.Jonathon,children:[h.jsx("img",{alt:Yt.Jonathon,src:Gje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Jonathon",i)]},Yt.Jonathon),h.jsxs(Ka,{value:Yt.Jose,children:[h.jsx("img",{alt:Yt.Jose,src:Xje,height:20,style:{paddingRight:"5px"}})," ",Y.t("people.Jose",i)]},Yt.Jose),h.jsxs(Ka,{value:Yt.Joseph,children:[h.jsx("img",{alt:Yt.Joseph,src:Jje,height:20,style:{paddingRight:"22px"}})," ",Y.t("people.Joseph",i)]},Yt.Joseph),h.jsxs(Ka,{value:Yt.Joshua,children:[h.jsx("img",{alt:Yt.Joshua,src:Kje,height:20,style:{paddingRight:"22px"}})," ",Y.t("people.Joshua",i)]},Yt.Joshua),h.jsxs(Ka,{value:Yt.Judd,children:[h.jsx("img",{alt:Yt.Judd,src:qje,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.Judd",i)]},Yt.Judd),h.jsxs(Ka,{value:Yt.Judy,children:[h.jsx("img",{alt:Yt.Judy,src:$je,height:20,style:{paddingRight:"21px"}})," ",Y.t("people.Judy",i)]},Yt.Judy),h.jsxs(Ka,{value:Yt.Julia,children:[h.jsx("img",{alt:Yt.Julia,src:Qje,height:20,style:{paddingRight:"22px"}})," ",Y.t("people.Julia",i)]},Yt.Julia),h.jsxs(Ka,{value:Yt.Julio,children:[h.jsx("img",{alt:Yt.Julio,src:Zje,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Julio",i)]},Yt.Julio),h.jsxs(Ka,{value:Yt.Jumapili,children:[h.jsx("img",{alt:Yt.Jumapili,src:eBe,height:20,style:{paddingRight:"16px"}})," ",Y.t("people.Jumapili",i)]},Yt.Jumapili),h.jsxs(Ka,{value:Yt.June,children:[h.jsx("img",{alt:Yt.June,src:tBe,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.June",i)]},Yt.June),h.jsxs(Ka,{value:Yt.Juro,children:[h.jsx("img",{alt:Yt.Juro,src:nBe,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Juro",i)]},Yt.Juro),h.jsxs(Ka,{value:Yt.Justin,children:[h.jsx("img",{alt:Yt.Justin,src:oBe,height:20,style:{paddingRight:"20px"}})," ",Y.t("people.Justin",i)]},Yt.Justin)]})}),jdo=t=>{const e=[];if(t.type!==z.Human)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language},i=H.getState().viewState.orthographic??!1;return e.push({key:"human-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"human-cut",label:h.jsx(Wd,{})}),e.push({key:"human-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&e.push({key:"human-flip",label:h.jsx(z9e,{billboardModel:n})}),i||e.push({key:"human-move-view",label:h.jsx(kdo,{human:n})}),o&&(e.push({key:"human-obserber",label:h.jsx(Fdo,{human:n})}),e.push({key:"human-selection",label:h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"120px"},children:[Y.t("peopleMenu.ChangePerson",r),": "]}),h.jsx(Udo,{human:n})]})})),{items:e}},{Option:ef}=_o,Bdo=be.memo(({flower:t})=>{const e=H(fn),n=H(En),[o,r]=m.useState(!1),i=Jt(),a=(l,s)=>{e(c=>{for(const u of c.elements)if(u.type===z.Flower&&u.id===l){const d=u;d.name=s,d.lx=p8.fetchSpread(s),d.lz=p8.fetchHeight(s);break}})};return h.jsxs(_o,{style:{width:"200px"},value:(t==null?void 0:t.name)??ro.WhiteFlower,onChange:l=>{if(t){const s=t.name;if(s!==l){const c={name:"Change Flower",timestamp:Date.now(),oldValue:s,newValue:l,changedElementId:t.id,changedElementType:t.type,undo:()=>{a(c.changedElementId,c.oldValue)},redo:()=>{a(c.changedElementId,c.newValue)}};n(c),a(t.id,l),e(u=>{u.actionState.flowerType=l}),r(!o)}}},children:[h.jsxs(ef,{value:ro.WhiteFlower,children:[h.jsx("img",{alt:ro.WhiteFlower,src:hBe,height:20,style:{paddingRight:"17px"}})," ",Y.t("flower.WhiteFlower",i)]},ro.WhiteFlower),h.jsxs(ef,{value:ro.YellowFlower,children:[h.jsx("img",{alt:ro.YellowFlower,src:pBe,height:20,style:{paddingRight:"16px"}})," ",Y.t("flower.YellowFlower",i)]},ro.YellowFlower),h.jsxs(ef,{value:ro.Hibiscus,children:[h.jsx("img",{alt:ro.Hibiscus,src:iBe,height:20,style:{paddingRight:"19px"}})," ",Y.t("flower.Hibiscus",i)]},ro.Hibiscus),h.jsxs(ef,{value:ro.Hydrangea,children:[h.jsx("img",{alt:ro.Hydrangea,src:aBe,height:20,style:{paddingRight:"18px"}})," ",Y.t("flower.Hydrangea",i)]},ro.Hydrangea),h.jsxs(ef,{value:ro.Spirea,children:[h.jsx("img",{alt:ro.Spirea,src:uBe,height:20,style:{paddingRight:"18px"}})," ",Y.t("flower.Spirea",i)]},ro.Spirea),h.jsxs(ef,{value:ro.Hosta,children:[h.jsx("img",{alt:ro.Hosta,src:lBe,height:20,style:{paddingRight:"18px"}})," ",Y.t("flower.Hosta",i)]},ro.Hosta),h.jsxs(ef,{value:ro.Peony,children:[h.jsx("img",{alt:ro.Peony,src:sBe,height:20,style:{paddingRight:"17px"}})," ",Y.t("flower.Peony",i)]},ro.Peony),h.jsxs(ef,{value:ro.Boxwood,children:[h.jsx("img",{alt:ro.Boxwood,src:Yce,height:20,style:{paddingRight:"23px"}})," ",Y.t("flower.Boxwood",i)]},ro.Boxwood),h.jsxs(ef,{value:ro.TallBush,children:[h.jsx("img",{alt:ro.TallBush,src:Xce,height:20,style:{paddingRight:"32px"}})," ",Y.t("flower.TallBush",i)]},ro.TallBush),h.jsxs(ef,{value:ro.CactusCombo1,children:[h.jsx("img",{alt:ro.CactusCombo1,src:Oce,height:20,style:{paddingRight:"26px"}})," ",Y.t("flower.CactusCombo1",i)]},ro.CactusCombo1),h.jsxs(ef,{value:ro.CactusCombo2,children:[h.jsx("img",{alt:ro.CactusCombo2,src:_ce,height:20,style:{paddingRight:"26px"}})," ",Y.t("flower.CactusCombo2",i)]},ro.CactusCombo2),h.jsxs(ef,{value:ro.CactusCombo3,children:[h.jsx("img",{alt:ro.CactusCombo3,src:Vce,height:20,style:{paddingRight:"26px"}})," ",Y.t("flower.CactusCombo3",i)]},ro.CactusCombo3),h.jsxs(ef,{value:ro.CactusCombo4,children:[h.jsx("img",{alt:ro.CactusCombo4,src:Gce,height:20,style:{paddingRight:"26px"}})," ",Y.t("flower.CactusCombo4",i)]},ro.CactusCombo4),h.jsxs(ef,{value:ro.RedRose,children:[h.jsx("img",{alt:ro.RedRose,src:cBe,height:20,style:{paddingRight:"26px"}})," ",Y.t("flower.RedRose",i)]},ro.RedRose),h.jsxs(ef,{value:ro.Bellflower,children:[h.jsx("img",{alt:ro.Bellflower,src:rBe,height:20,style:{paddingRight:"20px"}})," ",Y.t("flower.Bellflower",i)]},ro.Bellflower),h.jsxs(ef,{value:ro.Sunflower,children:[h.jsx("img",{alt:ro.Sunflower,src:dBe,height:20,style:{paddingRight:"32px"}})," ",Y.t("flower.Sunflower",i)]},ro.Sunflower),h.jsxs(ef,{value:ro.Tulip,children:[h.jsx("img",{alt:ro.Tulip,src:fBe,height:20,style:{paddingRight:"24px"}})," ",Y.t("flower.Tulip",i)]},ro.Tulip)]})}),Ydo=t=>{const e=[];if(t.type!==z.Flower)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language};return e.push({key:"flower-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"flower-cut",label:h.jsx(Wd,{})}),e.push({key:"flower-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&e.push({key:"flower-flip",label:h.jsx(z9e,{billboardModel:n})}),o&&e.push({key:"flower-change-type",label:h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"60px"},children:[Y.t("flowerMenu.Type",r),": "]}),h.jsx(Bdo,{flower:n})]})}),{items:e}},Odo=({polygon:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.type===z.Polygon&&l.id===r){l.filled=i;break}})},o=r=>{const i={name:"Fill Polygon",timestamp:Date.now(),checked:!t.filled,selectedElementId:t.id,selectedElementType:z.Polygon,undo:()=>{n(t.id,!i.checked)},redo:()=>{n(t.id,i.checked)}};H.getState().addUndoable(i),n(t.id,r.target.checked)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.filled,onChange:o,children:Y.t("polygonMenu.Filled",e)})})},_do=({polygon:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.type===z.Polygon&&l.id===r){l.shininess=i;break}})},o=r=>{const a={name:"Shiny Polygon",timestamp:Date.now(),checked:((t==null?void 0:t.shininess)??0)>0,selectedElementId:t.id,selectedElementType:z.Polygon,undo:()=>{n(t.id,a.checked?0:100)},redo:()=>{n(t.id,a.checked?100:0)}};H.getState().addUndoable(a),n(t.id,r.target.checked?100:0)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:!!t.shininess,onChange:o,children:Y.t("polygonMenu.Shiny",e)})})},Vdo=({polygon:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.type===z.Polygon&&l.id===r){l.noOutline=i;break}})},o=r=>{const i={name:"No Outline for Polygon",timestamp:Date.now(),checked:!t.noOutline,selectedElementId:t.id,selectedElementType:z.Polygon,undo:()=>{n(t.id,!i.checked)},redo:()=>{n(t.id,i.checked)}};H.getState().addUndoable(i),n(t.id,r.target.checked)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.noOutline,onChange:o,children:Y.t("polygonMenu.NoOutline",e)})})},Gdo=({polygon:t})=>{const e=Jt(),[n,o]=m.useState((t==null?void 0:t.text)??""),r=(a,l)=>{H.getState().set(s=>{for(const c of s.elements)if(c.id===a){!c.locked&&c.type===z.Polygon&&(c.text=l);break}})},i=()=>{const a={name:"Set Text for Polygon",timestamp:Date.now(),oldValue:t.text??"",newValue:n,changedElementId:t.id,changedElementType:z.Polygon,undo:()=>{r(t.id,a.oldValue)},redo:()=>{r(t.id,a.newValue)}};H.getState().addUndoable(a),r(t.id,n)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(as,{addonBefore:h.jsxs(hy,{width:"120px",children:[Y.t("word.Text",e),":"]}),value:n,onChange:a=>o(a.target.value),onPressEnter:i,onBlur:i})})},Xdo=({polygon:t})=>{const e=Jt(),[n,o]=m.useState((t==null?void 0:t.fontSize)??1),r=(a,l)=>{H.getState().set(s=>{for(const c of s.elements)if(c.id===a){!c.locked&&c.type===z.Polygon&&(c.fontSize=l);break}})},i=()=>{const a={name:"Set Font Size for Polygon",timestamp:Date.now(),oldValue:t.fontSize??1,newValue:n,changedElementId:t.id,changedElementType:z.Polygon,undo:()=>{r(t.id,a.oldValue)},redo:()=>{r(t.id,a.newValue)}};H.getState().addUndoable(a),r(t.id,n)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsxs(hy,{width:"120px",children:[Y.t("word.FontSize",e),":"]}),min:.1,max:5,step:.01,precision:2,value:n,onChange:a=>o(a),onPressEnter:i,onBlur:i})})},Jdo=({polygon:t})=>{const e=Jt(),[n,o]=m.useState((t==null?void 0:t.fontColor)??"black"),r=(a,l)=>{H.getState().set(s=>{for(const c of s.elements)if(c.id===a){!c.locked&&c.type===z.Polygon&&(c.fontColor=l);break}})},i=()=>{const a={name:"Set Font Color for Polygon",timestamp:Date.now(),oldValue:t.fontColor??"black",newValue:n,changedElementId:t.id,changedElementType:z.Polygon,undo:()=>{r(t.id,a.oldValue)},redo:()=>{r(t.id,a.newValue)}};H.getState().addUndoable(a),r(t.id,n)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(as,{addonBefore:h.jsxs(hy,{width:"120px",children:[Y.t("word.FontColor",e),":"]}),value:n,onChange:a=>o(a.target.value),onPressEnter:i,onBlur:i})})},Kdo=({polygon:t})=>{const e=Jt(),[n,o]=m.useState((t==null?void 0:t.fontOutlineColor)??"white"),r=(a,l)=>{H.getState().set(s=>{for(const c of s.elements)if(c.id===a){!c.locked&&c.type===z.Polygon&&(c.fontOutlineColor=l);break}})},i=()=>{const a={name:"Set Font Outline Color for Polygon",timestamp:Date.now(),oldValue:t.fontOutlineColor??"white",newValue:n,changedElementId:t.id,changedElementType:z.Polygon,undo:()=>{r(t.id,a.oldValue)},redo:()=>{r(t.id,a.newValue)}};H.getState().addUndoable(a),r(t.id,n)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(as,{addonBefore:h.jsxs(hy,{width:"120px",children:[Y.t("polygonMenu.FontOutlineColor",e),":"]}),value:n,onChange:a=>o(a.target.value),onPressEnter:i,onBlur:i})})},qdo=({polygon:t})=>{const e=Jt(),[n,o]=m.useState((t==null?void 0:t.fontOutlineWidth)??0),r=(a,l)=>{H.getState().set(s=>{for(const c of s.elements)if(c.id===a){!c.locked&&c.type===z.Polygon&&(c.fontOutlineWidth=l);break}})},i=()=>{const a={name:"Set Font Outline Width for Polygon",timestamp:Date.now(),oldValue:t.fontOutlineWidth??0,newValue:n,changedElementId:t.id,changedElementType:z.Polygon,undo:()=>{r(t.id,a.oldValue)},redo:()=>{r(t.id,a.newValue)}};H.getState().addUndoable(a),r(t.id,n)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsxs(hy,{width:"120px",children:[Y.t("polygonMenu.FontOutlineWidth",e),":"]}),min:0,max:1,step:.01,precision:2,value:n,onChange:a=>o(a),onPressEnter:i,onBlur:i})})},$do=({polygon:t})=>{const e=Jt(),[n,o]=m.useState((t==null?void 0:t.fontStrokeColor)??"black"),r=(a,l)=>{H.getState().set(s=>{for(const c of s.elements)if(c.id===a){!c.locked&&c.type===z.Polygon&&(c.fontStrokeColor=l);break}})},i=()=>{const a={name:"Set Font Stroke Color for Polygon",timestamp:Date.now(),oldValue:t.fontStrokeColor??"black",newValue:n,changedElementId:t.id,changedElementType:z.Polygon,undo:()=>{r(t.id,a.oldValue)},redo:()=>{r(t.id,a.newValue)}};H.getState().addUndoable(a),r(t.id,n)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(as,{addonBefore:h.jsxs(hy,{width:"120px",children:[Y.t("polygonMenu.FontStrokeColor",e),":"]}),value:n,onChange:a=>o(a.target.value),onPressEnter:i,onBlur:i})})},Qdo=({polygon:t})=>{const e=Jt(),[n,o]=m.useState((t==null?void 0:t.fontStrokeWidth)??0),r=(a,l)=>{H.getState().set(s=>{for(const c of s.elements)if(c.id===a){!c.locked&&c.type===z.Polygon&&(c.fontStrokeWidth=l);break}})},i=()=>{const a={name:"Set Font Stroke Width for Polygon",timestamp:Date.now(),oldValue:t.fontStrokeWidth??0,newValue:n,changedElementId:t.id,changedElementType:z.Polygon,undo:()=>{r(t.id,a.oldValue)},redo:()=>{r(t.id,a.newValue)}};H.getState().addUndoable(a),r(t.id,n)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Mn,{addonBefore:h.jsxs(hy,{width:"120px",children:[Y.t("polygonMenu.FontStrokeWidth",e),":"]}),min:0,max:1,step:.01,precision:2,value:n,onChange:a=>o(a),onPressEnter:i,onBlur:i})})},Zdo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(qr),r=H(Owt),i=H(_wt),a=H(Vwt),l=H(Gwt),s=H(En),c=H(FH),u=H(kH),d=H(no),f=H(Zn),p=co(z.Polygon),[g,y]=m.useState((p==null?void 0:p.lineColor)??"black"),w=Jt(),b=x=>{u(x.target.value)},C=x=>{if(p){switch(c){case oe.AllSelectedObjectsOfThisType:for(const S of e)if(S.type===z.Polygon&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&x!==S.lineColor)return!0;break;case oe.AllObjectsOfThisType:for(const S of e)if(S.type===z.Polygon&&!S.locked&&x!==S.lineColor)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const S of e)if(S.type===z.Polygon&&S.parentId===p.parentId&&me.isIdentical(S.normal,p.normal)&&!S.locked&&S.lineColor!==x)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const S of e)if(S.type===z.Polygon&&S.foundationId===(p==null?void 0:p.foundationId)&&!S.locked&&S.lineColor!==x)return!0;break;default:if(x!==(p==null?void 0:p.lineColor))return!0}return!1}},P=(x,S)=>{H.getState().set(R=>{for(const M of R.elements)M.type===z.Polygon&&!M.locked&&x.has(M.id)&&(M.lineColor=S)})},v=x=>{if(p&&C(x))switch(c){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of e)M.type===z.Polygon&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M.lineColor??"black");const R={name:"Set Line Color for Selected Polygons",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{P(R.oldValues,R.newValue)}};s(R),P(S,x),f(d+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of e)M.type===z.Polygon&&S.set(M.id,M.lineColor??"black");const R={name:"Set Line Color for All Polygons",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{l(z.Polygon,R.newValue)}};s(R),l(z.Polygon,x),f(d+1);break}case oe.AllObjectsOfThisTypeOnSurface:{if(o(p)){const R=new Map;for(const D of e)D.type===z.Polygon&&D.parentId===p.parentId&&me.isIdentical(D.normal,p.normal)&&R.set(D.id,D.lineColor??"gray");const M={name:"Set Line Color for All Polygons on Same Surface",timestamp:Date.now(),oldValues:R,newValue:x,groupId:p.parentId,normal:p.normal,undo:()=>{for(const[D,E]of M.oldValues.entries())r(D,E)},redo:()=>{M.groupId&&i(z.Polygon,M.groupId,M.normal,M.newValue)}};s(M),i(z.Polygon,p.parentId,p.normal,x),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){const S=new Map;for(const M of e)M.type===z.Polygon&&M.foundationId===p.foundationId&&S.set(M.id,M.lineColor??"black");const R={name:"Set Line Color for All Polygons Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:p.foundationId,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{R.groupId&&a(z.Polygon,R.groupId,R.newValue)}};s(R),a(z.Polygon,p.foundationId,x),f(d+1)}break}default:{const S=n(p.id),R=S?S.lineColor:p.lineColor,M={name:"Set Line Color of Selected Polygon",timestamp:Date.now(),oldValue:R,newValue:x,changedElementId:p.id,changedElementType:p.type,undo:()=>{r(M.changedElementId,M.oldValue)},redo:()=>{r(M.changedElementId,M.newValue)}};s(M),r(p.id,x),f(d+1);break}}},T=()=>{t(!1)},A=()=>{v(g)};return h.jsx(so,{width:600,title:Y.t("polygonMenu.LineColor",w),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(zf,{color:g??(p==null?void 0:p.lineColor)??"black",onChangeComplete:x=>{y(x.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:12,children:h.jsx(Ue.Group,{onChange:b,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("polygonMenu.OnlyThisPolygon",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("polygonMenu.AllPolygonsOnSurface",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("polygonMenu.AllPolygonsAboveFoundation",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("polygonMenu.AllSelectedPolygons",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("polygonMenu.AllPolygons",w)})]})})})]})})},efo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(FH),l=H(kH),s=H(no),c=H(Zn),u=co(z.Polygon),[d,f]=m.useState((u==null?void 0:u.lineStyle)??Gh.Solid),p=Jt(),{Option:g}=_o,y=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.Polygon&&E.id===R){E.lineStyle=M;break}})},w=(R,M,D)=>{e(E=>{for(const W of E.elements)W.type===z.Polygon&&W.parentId===R&&me.isIdentical(W.normal,M)&&!W.locked&&(W.lineStyle=D)})},b=(R,M)=>{e(D=>{for(const E of D.elements)E.type===z.Polygon&&E.foundationId===R&&!E.locked&&(E.lineStyle=M)})},C=R=>{e(M=>{for(const D of M.elements)D.type===z.Polygon&&!D.locked&&(D.lineStyle=R)})},P=R=>{l(R.target.value)},v=R=>{if(u){switch(a){case oe.AllSelectedObjectsOfThisType:for(const M of n)if(M.type===z.Polygon&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&R!==M.lineStyle)return!0;break;case oe.AllObjectsOfThisType:for(const M of n)if(M.type===z.Polygon&&!M.locked&&R!==M.lineStyle)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const M of n)if(M.type===z.Polygon&&M.parentId===u.parentId&&me.isIdentical(M.normal,u.normal)&&!M.locked&&R!==M.lineStyle)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const M of n)if(M.type===z.Polygon&&M.foundationId===(u==null?void 0:u.foundationId)&&!M.locked&&R!==M.lineStyle)return!0;break;default:if(R!==(u==null?void 0:u.lineStyle))return!0}return!1}},T=(R,M)=>{H.getState().set(D=>{for(const E of D.elements)E.type===z.Polygon&&!E.locked&&R.has(E.id)&&(E.lineStyle=M)})},A=R=>{if(u&&v(R))switch(a){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.Polygon&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E.lineStyle??Gh.Solid);const D={name:"Set Line Style for Selected Polygons",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{T(D.oldValues,D.newValue)}};i(D),T(M,R),c(s+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.Polygon&&M.set(E.id,E.lineStyle??Gh.Solid);const D={name:"Set Line Style for All Polygons",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{C(D.newValue)}};i(D),C(R),c(s+1);break}case oe.AllObjectsOfThisTypeOnSurface:{if(r(u)){const D=new Map;for(const W of n)W.type===z.Polygon&&W.parentId===u.parentId&&me.isIdentical(W.normal,u.normal)&&D.set(W.id,W.lineStyle??Gh.Solid);const E={name:"Set Line Style for All Polygons on Same Surface",timestamp:Date.now(),oldValues:D,newValue:R,groupId:u.parentId,normal:u.normal,undo:()=>{for(const[W,j]of E.oldValues.entries())y(W,j)},redo:()=>{E.groupId&&w(E.groupId,E.normal,E.newValue)}};i(E),w(u.parentId,u.normal,R),c(s+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const M=new Map;for(const E of n)E.type===z.Polygon&&E.foundationId===u.foundationId&&M.set(E.id,E.lineStyle??Gh.Solid);const D={name:"Set Line Style for All Polygons Above Foundation",timestamp:Date.now(),oldValues:M,newValue:R,groupId:u.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{D.groupId&&b(D.groupId,D.newValue)}};i(D),b(u.foundationId,R),c(s+1)}break}default:{const M=o(u.id),D=M?M.lineStyle:u.lineStyle,E={name:"Set Line Style of Selected Polygon",timestamp:Date.now(),oldValue:D,newValue:R,changedElementId:u.id,changedElementType:u.type,undo:()=>{y(E.changedElementId,E.oldValue)},redo:()=>{y(E.changedElementId,E.newValue)}};i(E),y(u.id,R),c(s+1);break}}},x=()=>{t(!1)},S=()=>{A(d)};return h.jsx(so,{width:600,title:Y.t("polygonMenu.LineStyle",p),onApply:S,onClose:x,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:10,children:h.jsxs(_o,{style:{width:"200px"},value:d,onChange:R=>f(R),children:[h.jsxs(g,{value:Gh.Solid,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"48px",height:"1px",border:"1px solid dimGray"},children:" "}),Y.t("polygonMenu.SolidLine",p)]},Gh.Solid),h.jsxs(g,{value:Gh.Dashed,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"48px",height:"1px",border:"1px dashed dimGray"},children:" "}),Y.t("polygonMenu.DashedLine",p)]},Gh.Dashed),h.jsxs(g,{value:Gh.Dotted,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"48px",height:"1px",border:"1px dotted dimGray"},children:" "}),Y.t("polygonMenu.DottedLine",p)]},Gh.Dotted)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:14,children:h.jsx(Ue.Group,{onChange:P,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("polygonMenu.OnlyThisPolygon",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("polygonMenu.AllPolygonsOnSurface",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("polygonMenu.AllPolygonsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("polygonMenu.AllSelectedPolygons",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("polygonMenu.AllPolygons",p)})]})})})]})})},tfo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(qr),r=H(Xwt),i=H(Jwt),a=H(Kwt),l=H(qwt),s=H(En),c=H(FH),u=H(kH),d=H(no),f=H(Zn),p=co(z.Polygon),[g,y]=m.useState((p==null?void 0:p.lineWidth)??1),w=Jt(),{Option:b}=_o,C=S=>{u(S.target.value)},P=S=>{if(p){switch(c){case oe.AllSelectedObjectsOfThisType:for(const R of e)if(R.type===z.Polygon&&!R.locked&&H.getState().selectedElementIdSet.has(R.id)&&S!==R.lineWidth)return!0;break;case oe.AllObjectsOfThisType:for(const R of e)if(R.type===z.Polygon&&!R.locked&&S!==R.lineWidth)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const R of e)if(R.type===z.Polygon&&R.parentId===p.parentId&&me.isIdentical(R.normal,p.normal)&&!R.locked&&R.lineWidth!==S)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const R of e)if(R.type===z.Polygon&&R.foundationId===(p==null?void 0:p.foundationId)&&!R.locked&&R.lineWidth!==S)return!0;break;default:if(S!==(p==null?void 0:p.lineWidth))return!0}return!1}},v=(S,R)=>{H.getState().set(M=>{for(const D of M.elements)D.type===z.Polygon&&!D.locked&&S.has(D.id)&&(D.lineWidth=R)})},T=S=>{if(p&&P(S))switch(c){case oe.AllSelectedObjectsOfThisType:{const R=new Map;for(const D of e)D.type===z.Polygon&&H.getState().selectedElementIdSet.has(D.id)&&R.set(D.id,D.lineWidth??1);const M={name:"Set Line Width for Selected Polygons",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())r(D,E)},redo:()=>{v(M.oldValues,M.newValue)}};s(M),v(R,S),f(d+1);break}case oe.AllObjectsOfThisType:{const R=new Map;for(const D of e)D.type===z.Polygon&&R.set(D.id,D.lineWidth??1);const M={name:"Set Line Width for All Polygons",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())r(D,E)},redo:()=>{l(z.Polygon,M.newValue)}};s(M),l(z.Polygon,S),f(d+1);break}case oe.AllObjectsOfThisTypeOnSurface:{if(o(p)){const M=new Map;for(const E of e)E.type===z.Polygon&&E.parentId===p.parentId&&me.isIdentical(E.normal,p.normal)&&M.set(E.id,E.lineWidth??1);const D={name:"Set Line Width for All Polygons on Same Surface",timestamp:Date.now(),oldValues:M,newValue:S,groupId:p.parentId,normal:p.normal,undo:()=>{for(const[E,W]of D.oldValues.entries())r(E,W)},redo:()=>{D.groupId&&i(z.Polygon,D.groupId,D.normal,D.newValue)}};s(D),i(z.Polygon,p.parentId,p.normal,S),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){const R=new Map;for(const D of e)D.type===z.Polygon&&D.foundationId===p.foundationId&&R.set(D.id,D.lineWidth??1);const M={name:"Set Line Width for All Polygons Above Foundation",timestamp:Date.now(),oldValues:R,newValue:S,groupId:p.foundationId,undo:()=>{for(const[D,E]of M.oldValues.entries())r(D,E)},redo:()=>{M.groupId&&a(z.Polygon,M.groupId,M.newValue)}};s(M),a(z.Polygon,p.foundationId,S),f(d+1)}break}default:{const R=n(p.id),M=R?R.lineWidth:p.lineWidth,D={name:"Set Line Width of Selected Polygon",timestamp:Date.now(),oldValue:M,newValue:S,changedElementId:p.id,changedElementType:p.type,undo:()=>{r(D.changedElementId,D.oldValue)},redo:()=>{r(D.changedElementId,D.newValue)}};s(D),r(p.id,S),f(d+1);break}}},A=()=>{t(!1)},x=()=>{T(g),t(!1),f(0)};return h.jsx(so,{width:560,title:Y.t("polygonMenu.LineWidth",w),onApply:x,onClose:A,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:10,children:h.jsxs(_o,{style:{width:"200px"},value:g,onChange:S=>y(S),children:[h.jsx(b,{value:$y.One,children:h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"24px",width:"100%",height:"1px",border:"1px solid dimGray"}})},$y.One),h.jsx(b,{value:$y.Two,children:h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"24px",width:"100%",height:"1px",border:"2px solid dimGray"}})},$y.Two),h.jsx(b,{value:$y.Three,children:h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"24px",width:"100%",height:"1px",border:"3px solid dimGray"}})},$y.Three),h.jsx(b,{value:$y.Four,children:h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"24px",width:"100%",height:"1px",border:"4px solid dimGray"}})},$y.Four),h.jsx(b,{value:$y.Five,children:h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"24px",width:"100%",height:"1px",border:"5px solid dimGray"}})},$y.Five)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:14,children:h.jsx(Ue.Group,{onChange:C,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("polygonMenu.OnlyThisPolygon",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("polygonMenu.AllPolygonsOnSurface",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("polygonMenu.AllPolygonsAboveFoundation",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("polygonMenu.AllSelectedPolygons",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("polygonMenu.AllPolygons",w)})]})})})]})})},nfo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(qr),r=H(rYe),i=H(Bwt),a=H(Ywt),l=H(iYe),s=H(En),c=H(FH),u=H(kH),d=H(no),f=H(Zn),p=co(z.Polygon),[g,y]=m.useState((p==null?void 0:p.color)??"gray"),w=Jt(),b=x=>{u(x.target.value)},C=x=>{if(p){switch(c){case oe.AllSelectedObjectsOfThisType:for(const S of e)if(S.type===z.Polygon&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&x!==S.color)return!0;break;case oe.AllObjectsOfThisType:for(const S of e)if(S.type===z.Polygon&&!S.locked&&x!==S.color)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const S of e)if(S.type===z.Polygon&&S.foundationId===p.foundationId&&!S.locked&&S.color!==x)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const S of e)if(S.type===z.Polygon&&S.parentId===p.parentId&&me.isIdentical(S.normal,p.normal)&&!S.locked&&S.color!==x)return!0;break;default:if(x!==p.color)return!0}return!1}},P=(x,S)=>{H.getState().set(R=>{for(const M of R.elements)M.type===z.Polygon&&!M.locked&&x.has(M.id)&&(M.color=S)})},v=x=>{if(p&&C(x))switch(c){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of e)M.type===z.Polygon&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M.color??"gray");const R={name:"Set Fill Color for Selected Polygons",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{P(R.oldValues,R.newValue)}};s(R),P(S,x),f(d+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of e)M.type===z.Polygon&&S.set(M.id,M.color??"gray");const R={name:"Set Fill Color for All Polygons",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{l(z.Polygon,R.newValue)}};s(R),l(z.Polygon,x),f(d+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){const S=new Map;for(const M of e)M.type===z.Polygon&&M.foundationId===p.foundationId&&S.set(M.id,M.color??"gray");const R={name:"Set Fill Color for All Polygons Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:p.foundationId,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{R.groupId&&a(z.Polygon,R.groupId,R.newValue)}};s(R),a(z.Polygon,p.foundationId,x),f(d+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{if(o(p)){const R=new Map;for(const D of e)D.type===z.Polygon&&D.parentId===p.parentId&&me.isIdentical(D.normal,p.normal)&&R.set(D.id,D.color??"gray");const M={name:"Set Fill Color for All Polygons on Same Surface",timestamp:Date.now(),oldValues:R,newValue:x,groupId:p.parentId,normal:p.normal,undo:()=>{for(const[D,E]of M.oldValues.entries())r(D,E)},redo:()=>{M.groupId&&i(z.Polygon,M.groupId,M.normal,M.newValue)}};s(M),i(z.Polygon,p.parentId,p.normal,x),f(d+1)}break}default:{const S=n(p.id),R=S?S.color:p.color,M={name:"Set Fill Color of Selected Polygon",timestamp:Date.now(),oldValue:R,newValue:x,changedElementId:p.id,changedElementType:p.type,undo:()=>{r(M.changedElementId,M.oldValue)},redo:()=>{r(M.changedElementId,M.newValue)}};s(M),r(p.id,x),f(d+1);break}}},T=()=>{t(!1)},A=()=>{v(g)};return h.jsx(so,{width:600,title:Y.t("polygonMenu.FillColor",w),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(zf,{color:g??(p==null?void 0:p.color)??"gray",onChangeComplete:x=>{y(x.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:12,children:h.jsx(Ue.Group,{onChange:b,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("polygonMenu.OnlyThisPolygon",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("polygonMenu.AllPolygonsOnSurface",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("polygonMenu.AllPolygonsAboveFoundation",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("polygonMenu.AllSelectedPolygons",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("polygonMenu.AllPolygons",w)})]})})})]})})},ofo="/aladdin/assets/polygon_08_menu-RpvWW3pg.png",rfo="/aladdin/assets/polygon_09_menu-CCH8lYni.png",ifo="/aladdin/assets/polygon_10_menu-BYFeRpsw.png",afo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(FH),l=H(kH),s=H(no),c=H(Zn),u=co(z.Polygon),[d,f]=m.useState((u==null?void 0:u.textureType)??Jr.NoTexture),p=Jt(),{Option:g}=_o,y=(R,M)=>{e(D=>{for(const E of D.elements)if(E.id===R&&E.type===z.Polygon&&!E.locked){E.textureType=M;break}})},w=(R,M,D)=>{e(E=>{for(const W of E.elements)W.type===z.Polygon&&W.parentId===R&&me.isIdentical(W.normal,M)&&!W.locked&&(W.textureType=D)})},b=(R,M)=>{e(D=>{for(const E of D.elements)E.type===z.Polygon&&E.foundationId===R&&!E.locked&&(E.textureType=M)})},C=R=>{e(M=>{for(const D of M.elements)D.type===z.Polygon&&!D.locked&&(D.textureType=R)})},P=R=>{l(R.target.value)},v=R=>{if(u){switch(a){case oe.AllSelectedObjectsOfThisType:for(const M of n)if(M.type===z.Polygon&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&R!==M.textureType)return!0;break;case oe.AllObjectsOfThisType:for(const M of n)if(M.type===z.Polygon&&!M.locked&&R!==M.textureType)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const M of n)if(M.type===z.Polygon&&M.parentId===u.parentId&&me.isIdentical(M.normal,u.normal)&&!M.locked&&M.textureType!==R)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const M of n)if(M.type===z.Polygon&&M.foundationId===u.foundationId&&!M.locked&&M.textureType!==R)return!0;break;default:if(R!==(u==null?void 0:u.textureType))return!0}return!1}},T=(R,M)=>{H.getState().set(D=>{for(const E of D.elements)E.type===z.Polygon&&!E.locked&&R.has(E.id)&&(E.textureType=M)})},A=R=>{if(u&&v(R))switch(a){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.Polygon&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E.textureType??Jr.NoTexture);const D={name:"Set Texture for Selected Polygons",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{T(D.oldValues,D.newValue)}};i(D),T(M,R),c(s+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.Polygon&&M.set(E.id,E.textureType??Jr.NoTexture);const D={name:"Set Texture for All Polygons",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{C(D.newValue)}};i(D),C(R),c(s+1);break}case oe.AllObjectsOfThisTypeOnSurface:{if(r(u)){const D=new Map;for(const W of n)W.type===z.Polygon&&W.parentId===u.parentId&&me.isIdentical(W.normal,u.normal)&&D.set(W.id,W.textureType??Jr.NoTexture);const E={name:"Set Texture for All Polygons on Same Surface",timestamp:Date.now(),oldValues:D,newValue:R,groupId:u.parentId,normal:u.normal,undo:()=>{for(const[W,j]of E.oldValues.entries())y(W,j)},redo:()=>{E.groupId&&w(E.groupId,E.normal,E.newValue)}};i(E),w(u.parentId,u.normal,R),c(s+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const M=new Map;for(const E of n)E.type===z.Polygon&&E.foundationId===u.foundationId&&M.set(E.id,E.textureType??Jr.NoTexture);const D={name:"Set Texture for All Polygons Above Foundation",timestamp:Date.now(),oldValues:M,newValue:R,groupId:u.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{D.groupId&&b(D.groupId,D.newValue)}};i(D),b(u.foundationId,R),c(s+1)}break}default:{const M=o(u.id),D=M?M.textureType:u.textureType,E={name:"Set Texture of Selected Polygon",timestamp:Date.now(),oldValue:D,newValue:R,changedElementId:u.id,changedElementType:u.type,undo:()=>{y(E.changedElementId,E.oldValue)},redo:()=>{y(E.changedElementId,E.newValue)}};i(E),y(u.id,R),c(s+1);break}}},x=()=>{t(!1)},S=()=>{A(d)};return h.jsx(so,{width:500,title:Y.t("polygonMenu.FillTexture",p),onApply:S,onClose:x,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:10,children:h.jsxs(_o,{style:{width:"150px"},value:d,onChange:R=>f(R),children:[h.jsxs(g,{value:Jr.NoTexture,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"32px",height:"20px",border:"1px dashed dimGray"},children:" "}),Y.t("shared.NoTexture",p)]},Jr.NoTexture),h.jsxs(g,{value:Jr.Texture01,children:[h.jsx("img",{alt:Jr.Texture01,src:Jnt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture01",p)]},Jr.Texture01),h.jsxs(g,{value:Jr.Texture02,children:[h.jsx("img",{alt:Jr.Texture02,src:Knt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture02",p)]},Jr.Texture02),h.jsxs(g,{value:Jr.Texture03,children:[h.jsx("img",{alt:Jr.Texture03,src:qnt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture03",p)]},Jr.Texture03),h.jsxs(g,{value:Jr.Texture04,children:[h.jsx("img",{alt:Jr.Texture04,src:$nt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture04",p)]},Jr.Texture04),h.jsxs(g,{value:Jr.Texture05,children:[h.jsx("img",{alt:Jr.Texture05,src:Qnt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture05",p)]},Jr.Texture05),h.jsxs(g,{value:Jr.Texture06,children:[h.jsx("img",{alt:Jr.Texture06,src:Znt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture06",p)]},Jr.Texture06),h.jsxs(g,{value:Jr.Texture07,children:[h.jsx("img",{alt:Jr.Texture07,src:eot,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture07",p)]},Jr.Texture07),h.jsxs(g,{value:Jr.Texture08,children:[h.jsx("img",{alt:Jr.Texture08,src:ofo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture08",p)]},Jr.Texture08),h.jsxs(g,{value:Jr.Texture09,children:[h.jsx("img",{alt:Jr.Texture09,src:rfo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture09",p)]},Jr.Texture09),h.jsxs(g,{value:Jr.Texture10,children:[h.jsx("img",{alt:Jr.Texture10,src:ifo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("polygonMenu.Texture10",p)]},Jr.Texture10)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:14,children:h.jsx(Ue.Group,{onChange:P,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("polygonMenu.OnlyThisPolygon",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("polygonMenu.AllPolygonsOnSurface",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("polygonMenu.AllPolygonsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("polygonMenu.AllSelectedPolygons",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("polygonMenu.AllPolygons",p)})]})})})]})})},lfo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(FH),r=H(kH),i=H(no),a=H(Zn),l=H(Gn),s=H(fn),c=co(z.Polygon),[u,d]=m.useState((c==null?void 0:c.opacity)!==void 0?c.opacity:1),f=Jt(),p=(v,T)=>{s(A=>{for(const x of A.elements)if(x.id===v){x.opacity=T;break}})},g=v=>{for(const[T,A]of v.entries())p(T,A)},y=(v,T)=>{for(const A of v.keys())p(A,T)},w=v=>{if(c){switch(o){case oe.AllSelectedObjectsOfThisType:for(const T of e)if(T.type===z.Polygon&&v!==T.opacity&&!T.locked&&H.getState().selectedElementIdSet.has(T.id))return!0;break;case oe.AllObjectsOfThisType:for(const T of e)if(T.type===z.Polygon&&v!==T.opacity&&!T.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const T of e)if(T.type===z.Polygon&&T.foundationId===c.foundationId&&v!==T.opacity&&!T.locked)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:for(const T of e)if(T.type===z.Polygon&&T.parentId===c.parentId&&me.isIdentical(T.normal,c.normal)&&v!==T.opacity&&!T.locked)return!0;break;default:if(v!==(c==null?void 0:c.opacity))return!0;break}return!1}},b=v=>{if(c&&w(v))switch(o){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of e)if(x.type===z.Polygon&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)){const S=x;T.set(x.id,S.opacity),p(S.id,v)}const A={name:"Set Opacity for Selected Polygons",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{g(A.oldValues)},redo:()=>{y(A.oldValues,A.newValue)}};n(A),a(i+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of e)if(x.type===z.Polygon&&!x.locked){const S=x;T.set(x.id,S.opacity),p(S.id,v)}const A={name:"Set Opacity for All Polygons",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{g(A.oldValues)},redo:()=>{y(A.oldValues,A.newValue)}};n(A),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(c.foundationId){const T=new Map;for(const x of e)if(x.type===z.Polygon&&x.foundationId===c.foundationId&&!x.locked){const S=x;T.set(x.id,S.opacity),p(S.id,v)}const A={name:"Set Opacity for All Polygons Above Foundation",timestamp:Date.now(),oldValues:T,newValue:v,groupId:c.foundationId,undo:()=>{g(A.oldValues)},redo:()=>{y(A.oldValues,A.newValue)}};n(A),a(i+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{if(c.parentId){const T=new Map;for(const x of e)if(x.type===z.Polygon&&x.parentId===c.parentId&&me.isIdentical(x.normal,c.normal)&&!x.locked){const S=x;T.set(x.id,S.opacity),p(S.id,v)}const A={name:"Set Opacity for All Polygons Above Foundation",timestamp:Date.now(),oldValues:T,newValue:v,groupId:c.foundationId,undo:()=>{g(A.oldValues)},redo:()=>{y(A.oldValues,A.newValue)}};n(A),a(i+1)}break}default:if(c){const T=l(c.id),A=T.opacity!==void 0?T.opacity:c.opacity!==void 0?c.opacity:1,x={name:"Set Polygon Opacity",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:c.id,changedElementType:c.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};n(x),p(c.id,v),a(i+1);break}}},C=()=>{t(!1)},P=()=>{b(u)};return h.jsx(so,{width:550,title:Y.t("polygonMenu.Opacity",f),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.1,precision:1,value:u,formatter:v=>Number(v).toFixed(1),onChange:v=>d(v)}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",f),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v=>r(v.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("polygonMenu.OnlyThisPolygon",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("polygonMenu.AllPolygonsOnSurface",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("polygonMenu.AllPolygonsAboveFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("polygonMenu.AllSelectedPolygons",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("polygonMenu.AllPolygons",f)})]})})})]})})};class KR{static create(e,n,o,r,i,a,l,s,c,u,d){if(n.type!==z.Foundation&&n.type!==z.Cuboid)throw new Error("base must be a foundation or cuboid");const f=[],p=me.calculatePolygonBounds(e.vertices),g=(r===vr.portrait?o.length:o.width)*a;if(s===Dl.upDown){const y=Math.floor(((p.maxX()-p.minX())*n.lx-g)/l),w=p.minX()+g/(2*n.lx)+d/n.lx,b=l/n.lx,C=.5*Math.abs(Math.cos(i))*g/n.lx,P={x:0,y:-.5},v={x:0,y:.5},T=void 0;for(let A=0;A<=y;A++){const x=w+A*b;P.x=v.x=x-C;const S=me.polygonIntersections(P,v,e.vertices).sort((D,E)=>D.y-E.y);P.x=v.x=x+C;const R=me.polygonIntersections(P,v,e.vertices).sort((D,E)=>D.y-E.y),M=Math.max(S.length,R.length)/2;if(M>0)for(let D=0;DD.x-E.x);P.y=v.y=x+C;const R=me.polygonIntersections(P,v,e.vertices).sort((D,E)=>D.x-E.x),M=Math.max(S.length,R.length)/2;if(M>0)for(let D=0;D0)return Ga.makeSolarPanel(s,c,a*s.lx,(y+w)/2*s.ly,s.cz,vr.portrait,d,f,u,Gt,Io,i,void 0,b*s.ly,l)}static makeLeftRightSegment(e,n,o,r,i,a,l,s,c,u,d,f,p){const g=Math.abs(e.x-n.x)0)return Ga.makeSolarPanel(s,c,(y+w)/2*s.lx,a*s.ly,s.cz,vr.portrait,d,f,u,0,Io,i,void 0,b*s.lx,l)}}class sfo{static create(e,n,o,r,i,a,l,s,c,u,d){if(n.type!==z.Foundation&&n.type!==z.Cuboid)throw new Error("base must be a foundation or cuboid");const f=[],p=!me.isZero(n.rotation[2]),g=[];for(const P of e.vertices)g.push({x:P.x*n.lx+n.cx,y:P.y*n.ly+n.cy});const y=p?me.rotatePolygon(g,n.cx,n.cy,n.rotation[2]):g,w=me.calculatePolygonBounds(y),b=(r===vr.portrait?o.length:o.width)*a,C=.5*Math.abs(Math.cos(i))*b;if(s===Dl.eastWest){const P=w.maxY()-w.minY(),v=Math.floor((P-2*d-b)/l),T=w.minY()+b/2+d,A={x:w.minX(),y:0},x={x:w.maxX(),y:0};for(let S=0;S<=v;S++){const R=T+S*l;A.y=x.y=R-C;const M=me.polygonIntersections(A,x,y).sort((W,j)=>W.x-j.x);A.y=x.y=R+C;const D=me.polygonIntersections(A,x,y).sort((W,j)=>W.x-j.x),E=Math.max(M.length,D.length)/2;if(E>0)for(let W=0;W0){const Q=me.relativeCoordinates((O+B)/2,R,0,n),le=Ga.makeSolarPanel(n,o,Q.x*n.lx,Q.y*n.ly,n.cz,vr.portrait,c,u,i,-n.rotation[2],Io,[0,0,0],void 0,$,b);le.referenceId=e.id,me.changeOrientation(le,o,r),f.push(le)}}}}else if(s===Dl.northSouth){const P=w.maxX()-w.minX(),v=Math.floor((P-2*d-b)/l),T=w.minX()+b/2+d,A={x:0,y:w.minY()},x={x:0,y:w.maxY()};for(let S=0;S<=v;S++){const R=T+S*l;A.x=x.x=R-C;const M=me.polygonIntersections(A,x,y).sort((W,j)=>W.y-j.y);A.x=x.x=R+C;const D=me.polygonIntersections(A,x,y).sort((W,j)=>W.y-j.y),E=Math.max(M.length,D.length)/2;if(E>0)for(let W=0;W0){const Q=me.relativeCoordinates(R,(_+X)/2,0,n),le=Ga.makeSolarPanel(n,o,Q.x*n.lx,Q.y*n.ly,n.cz,vr.portrait,c,u,i,-n.rotation[2]+Gt,Io,[0,0,0],void 0,$,b);le.referenceId=e.id,me.changeOrientation(le,o,r),f.push(le)}}}}return f}}const{Option:Q7}=_o,cfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H.getState().solarPanelArrayLayoutParams,r=H(Cb),i=H(qr),a=H(fW),l=H(t5),s=H(kwt),c=H(l7t),u=H(Wge),d=H(a7t),f=H(En),p=H(no),g=H(Zn),y=H(Vi),[w,b]=m.useState(!1),[C,P]=m.useState(!1),[v,T]=m.useState(!1),[A,x]=m.useState({left:0,top:0,bottom:0,right:0}),S=m.useRef(null),R=m.useRef(!0),M=m.useRef(null),D=m.useRef(null),E=m.useRef(!1),W=m.useRef(H(y4t)),j=m.useRef(H(A4t)),L=m.useRef(H(P4t)),k=m.useRef(H(T4t)),N=m.useRef(H(w4t)),F=m.useRef(H(v4t)),U=m.useRef(H(x4t)??0),O=m.useRef(H(b4t)),B=m.useRef(H(S4t)),_=Jt(),X=l(W.current),$=r();m.useEffect(()=>{var he;(he=M.current)==null||he.focus()},[]),m.useEffect(()=>{var he;C&&((he=D.current)==null||he.focus())},[C]);const Q=(he,xe)=>{if(S.current){const{clientWidth:He,clientHeight:Se}=window.document.documentElement,ze=S.current.getBoundingClientRect();x({left:-ze.left+xe.x,right:He-(ze.right-xe.x),top:-ze.top+xe.y,bottom:Se-((ze==null?void 0:ze.bottom)-xe.y)})}},le=()=>{const he=(L.current===vr.portrait?X.length:X.width)*N.current;return .5*(he*Math.abs(Math.sin(k.current)))>O.current?(po(Y.t("message.SolarPanelsCannotIntersectWithGround",_)),!1):he>F.current?(po(Y.t("message.SolarPanelsCannotOverlapWithOneAnother",_)),!1):!0},q=he=>{const xe=n.filter(He=>He.type===z.SolarPanel&&He.parentId===he.parentId);if(xe.length>0)for(const He of xe)He.referenceId!==he.id&&me.isPointInside(He.cx,He.cy,he.vertices)&&s(He.id,he.id)},te=()=>{if(($==null?void 0:$.type)===z.Polygon){const he=i($);if(he){const xe=[],Se=j.current===Dl.eastWest||j.current===Dl.northSouth?sfo.create($,he,X,L.current,k.current,N.current,F.current,j.current,O.current,B.current,U.current):KR.create($,he,X,L.current,k.current,N.current,F.current,j.current,O.current,B.current,U.current);if(Se.length>0){for(const Ie of Se)xe.push(JSON.parse(JSON.stringify(Ie))),e(ye=>{ye.elements.push(Ie)});const ze={name:"Solar Panel Array Layout",timestamp:Date.now(),oldElements:H.getState().deletedElements,newElements:xe,oldParams:{pvModelName:o.pvModelName,rowAxis:o.rowAxis,orientation:o.orientation,tiltAngle:o.tiltAngle,rowsPerRack:o.rowsPerRack,interRowSpacing:o.interRowSpacing,poleHeight:o.poleHeight,poleSpacing:o.poleSpacing,margin:o.margin},newParams:{pvModelName:W.current,rowAxis:j.current,orientation:L.current,tiltAngle:k.current,rowsPerRack:N.current,interRowSpacing:F.current,poleHeight:O.current,poleSpacing:B.current,margin:U.current},referenceId:$.id,undo:()=>{u(ze.referenceId,!1),ze.oldElements.length>0&&e(Ie=>{for(const ye of ze.oldElements)Ie.elements.push(ye)}),re(ze.oldParams),ae()},redo:()=>{u(ze.referenceId,!1),ze.newElements.length>0&&e(Ie=>{for(const ye of ze.newElements)Ie.elements.push(ye)}),re(ze.newParams),ae()}};f(ze),g(p+1)}}R.current=!1,ae()}},re=he=>{W.current=he.pvModelName,j.current=he.rowAxis,L.current=he.orientation,k.current=he.tiltAngle,N.current=he.rowsPerRack,F.current=he.interRowSpacing,O.current=he.poleHeight,B.current=he.poleSpacing,U.current=he.margin??0},ae=()=>{e(he=>{he.solarPanelArrayLayoutParams.pvModelName=W.current,he.solarPanelArrayLayoutParams.rowAxis=j.current,he.solarPanelArrayLayoutParams.orientation=L.current,he.solarPanelArrayLayoutParams.tiltAngle=k.current,he.solarPanelArrayLayoutParams.rowsPerRack=N.current,he.solarPanelArrayLayoutParams.interRowSpacing=F.current,he.solarPanelArrayLayoutParams.poleHeight=O.current,he.solarPanelArrayLayoutParams.poleSpacing=B.current,he.solarPanelArrayLayoutParams.margin=U.current})},se=()=>{R.current&&(le()?$&&(q($),c($.id)>0?P(!0):(d(),te())):po(Y.t("polygonMenu.LayoutNotAcceptedCheckYourParameters",_)))},ne=()=>{se(),E.current=!1},fe=()=>{t(!1),y(),R.current=!0,E.current=!1},ge=()=>{R.current?(se(),E.current=!0):t(!1)},de=()=>{P(!1)},Z=()=>{$&&(u($.id,!0),te(),E.current&&(t(!1),g(0))),P(!1)};return h.jsxs(h.Fragment,{children:[C&&h.jsx(Oi,{width:400,open:C,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>T(!0),onMouseOut:()=>T(!1),children:Y.t("word.Reminder",_)}),footer:[h.jsx(lo,{onClick:de,children:Y.t("word.Cancel",_)},"Cancel"),h.jsx(lo,{type:"primary",ref:D,onClick:Z,children:Y.t("word.OK",_)},"OK")],children:Y.t("message.ExistingSolarPanelsWillBeRemovedBeforeApplyingNewLayout",_)+" "+Y.t("message.DoYouWantToContinue",_)}),h.jsxs(Oi,{width:640,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>T(!0),onMouseOut:()=>T(!1),children:Y.t("polygonMenu.SolarPanelArrayLayoutParametricDesign",_)}),footer:[h.jsx(lo,{disabled:!R.current,onClick:ne,children:Y.t("word.Apply",_)},"Apply"),h.jsx(lo,{onClick:fe,children:Y.t("word.Cancel",_)},"Cancel"),h.jsx(lo,{type:"primary",ref:M,onClick:ge,children:Y.t("word.OK",_)},"OK")],onCancel:()=>{t(!1),R.current=!0},maskClosable:!1,destroyOnClose:!1,modalRender:he=>h.jsx(_i,{disabled:!v,bounds:A,onStart:(xe,He)=>Q(xe,He),children:h.jsx("div",{ref:S,children:he})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayModel",_)+" ("+Object.keys(a).length+" "+Y.t("word.Options",_)+"):"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(_o,{defaultValue:"Custom",style:{width:"100%"},value:W.current,onChange:he=>{he!==null&&(W.current=he,R.current=!0,b(!w))},children:Object.keys(a).map(he=>h.jsx(Q7,{value:he,children:he+(a[he].bifacialityFactor>0?" ("+Y.t("pvModelPanel.Bifacial",_)+")":"")},he))})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayRowAxis",_)+":"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsxs(_o,{style:{width:"100%"},value:j.current,onChange:he=>{he!==null&&(j.current=he,R.current=!0,b(!w))},children:[h.jsx(Q7,{value:Dl.leftRight,children:Y.t("polygonMenu.SolarPanelArrayLeftRightRowAxis",_)},Dl.leftRight),h.jsx(Q7,{value:Dl.upDown,children:Y.t("polygonMenu.SolarPanelArrayUpDownRowAxis",_)},Dl.upDown),h.jsx(Q7,{value:Dl.eastWest,children:Y.t("polygonMenu.SolarPanelArrayEastWestRowAxis",_)},Dl.eastWest),h.jsx(Q7,{value:Dl.northSouth,children:Y.t("polygonMenu.SolarPanelArrayNorthSouthRowAxis",_)},Dl.northSouth)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayOrientation",_)+":"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsxs(_o,{style:{width:"100%"},value:L.current,onChange:he=>{he!==null&&(L.current=he,R.current=!0,b(!w))},children:[h.jsx(Q7,{value:vr.portrait,children:Y.t("solarPanelMenu.Portrait",_)},vr.portrait),h.jsx(Q7,{value:vr.landscape,children:Y.t("solarPanelMenu.Landscape",_)},vr.landscape)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayTiltAngle",_)+" ([-90°, 90°]): "}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{min:-90,max:90,style:{width:"100%"},precision:2,value:parseFloat(me.toDegrees(k.current).toFixed(2)),step:1,formatter:he=>`${he}°`,onChange:he=>{he!==null&&(k.current=me.toRadians(he),R.current=!0,b(!w))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayRowWidth",_)+" ([1-100] "+Y.t("solarPanelMenu.Panels",_)+"): "}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{min:1,max:100,step:1,style:{width:"100%"},precision:0,formatter:he=>Number(he).toFixed(0),value:N.current,onChange:he=>{he!==null&&(N.current=he,R.current=!0,b(!w))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayInterRowSpacing",_)+" ([1, 20] "+Y.t("word.MeterAbbreviation",_)+"): "}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{min:1,max:20,style:{width:"100%"},precision:2,value:F.current,step:.5,onChange:he=>{he!==null&&(F.current=he,R.current=!0,b(!w))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayMargin",_)+" ([0, 5] "+Y.t("word.MeterAbbreviation",_)+"): "}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{min:0,max:5,style:{width:"100%"},precision:1,value:U.current,step:.1,onChange:he=>{he!==null&&(U.current=he,R.current=!0,b(!w))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayPoleHeight",_)+" ([0, 10] "+Y.t("word.MeterAbbreviation",_)+"): "}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{min:0,max:10,style:{width:"100%"},precision:2,value:O.current,step:.1,onChange:he=>{he!==null&&(O.current=he,R.current=!0,b(!w))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("polygonMenu.SolarPanelArrayPoleSpacing",_)+" ([2, 50] "+Y.t("word.MeterAbbreviation",_)+"): "}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{min:2,max:50,style:{width:"100%"},precision:2,value:B.current,step:.5,onChange:he=>{he!==null&&(B.current=he,R.current=!0,b(!w))}})})]})]})]})},{Option:Bh}=_o,{TabPane:Nae}=qW,ufo=({setDialogVisible:t})=>{const e=H(fn),n=H(da),o=H(s0),r=ht(n5),i=H(fW),a=H(s3),l=H(qr),s=H(l3),c=H(wA).geneticAlgorithmParams,u=H(i$),d=H(fxt),f=H(n$),[p,g]=m.useState(!1),[y,w]=m.useState(!1),[b,C]=m.useState({left:0,top:0,bottom:0,right:0}),P=m.useRef(null),v=m.useRef(c.objectiveFunctionType),T=m.useRef(c.selectionMethod),A=m.useRef(c.searchMethod),x=m.useRef(c.populationSize),S=m.useRef(c.maximumGenerations),R=m.useRef(c.mutationRate),M=m.useRef(c.selectionRate??.5),D=m.useRef(c.crossoverRate??.5),E=m.useRef(c.convergenceThreshold),W=m.useRef(c.localSearchRadius),j=m.useRef(u.minimumTiltAngle??-Gt),L=m.useRef(u.maximumTiltAngle??Gt),k=m.useRef(u.minimumRowsPerRack),N=m.useRef(u.maximumRowsPerRack),F=m.useRef(u.minimumInterRowSpacing),U=m.useRef(u.maximumInterRowSpacing),O=m.useRef(null);m.useEffect(()=>{var Z;(Z=O.current)==null||Z.focus()},[]);const B={lng:o},_=m.useRef(u.rowAxis??Dl.leftRight),X=a?l(a):void 0,$=X?s(z.SolarPanel,X.id):void 0,Q=m.useRef($&&$.length>0?$[0].pvModelName:u.pvModelName??"CS6X-355P-FG"),le=m.useRef($&&$.length>0?$[0].orientation:u.orientation??vr.landscape),q=m.useRef($&&$.length>0?$[0].poleHeight:u.poleHeight??1),te=m.useRef($&&$.length>0?$[0].poleSpacing:u.poleSpacing??3),re=m.useRef(u.margin??0),ae=m.useRef(f.electricitySellingPrice),se=m.useRef(f.operationalCostPerUnit);m.useEffect(()=>{ae.current=f.electricitySellingPrice},[f.electricitySellingPrice]),m.useEffect(()=>{se.current=f.operationalCostPerUnit},[f.operationalCostPerUnit]);const ne=(Z,he)=>{if(P.current){const{clientWidth:xe,clientHeight:He}=window.document.documentElement,Se=P.current.getBoundingClientRect();C({left:-Se.left+he.x,right:xe-(Se.right-he.x),top:-Se.top+he.y,bottom:He-((Se==null?void 0:Se.bottom)-he.y)})}},fe=()=>{e(Z=>{Z.evolutionaryAlgorithmState.geneticAlgorithmParams.problem=Pi.SOLAR_PANEL_ARRAY,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.objectiveFunctionType=v.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.selectionMethod=T.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.searchMethod=A.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.populationSize=x.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.maximumGenerations=S.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.selectionRate=M.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.crossoverRate=D.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.mutationRate=R.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.convergenceThreshold=E.current,Z.evolutionaryAlgorithmState.geneticAlgorithmParams.localSearchRadius=W.current,Z.solarPanelArrayLayoutConstraints||(Z.solarPanelArrayLayoutConstraints=new dX),Z.solarPanelArrayLayoutConstraints.minimumRowsPerRack=k.current,Z.solarPanelArrayLayoutConstraints.maximumRowsPerRack=N.current,Z.solarPanelArrayLayoutConstraints.minimumTiltAngle=j.current,Z.solarPanelArrayLayoutConstraints.maximumTiltAngle=L.current,Z.solarPanelArrayLayoutConstraints.minimumInterRowSpacing=F.current,Z.solarPanelArrayLayoutConstraints.maximumInterRowSpacing=U.current,Z.solarPanelArrayLayoutConstraints.poleHeight=q.current,Z.solarPanelArrayLayoutConstraints.poleSpacing=te.current,Z.solarPanelArrayLayoutConstraints.pvModelName=Q.current,Z.solarPanelArrayLayoutConstraints.rowAxis=_.current,Z.solarPanelArrayLayoutConstraints.orientation=le.current,Z.solarPanelArrayLayoutConstraints.margin=re.current,Z.economicsParams.operationalCostPerUnit=se.current,Z.economicsParams.electricitySellingPrice=ae.current})},ge=()=>{r||hn(de("message.EvolutionStarted",B)),fe(),setTimeout(()=>{ht.getState().set(Z=>{Z.runEvolution=!Z.runEvolution}),e(Z=>{Z.evolutionMethod=Vs.GENETIC_ALGORITHM,n&&(Z.actionInfo={name:"Run Genetic Algorithm for Solar Panel Array Layout",timestamp:new Date().getTime(),details:{...H.getState().evolutionaryAlgorithmState.geneticAlgorithmParams,...H.getState().solarPanelArrayLayoutConstraints,...H.getState().economicsParams}})})},100)},{t:de}=Vl();return h.jsx(h.Fragment,{children:h.jsx(Oi,{width:640,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>w(!0),onMouseOut:()=>w(!1),children:de("optimizationMenu.SolarPanelArrayLayout",B)+": "+de("optimizationMenu.GeneticAlgorithmSettings",B)}),footer:[h.jsx(lo,{onClick:()=>{t(!1)},children:de("word.Cancel",B)},"Cancel"),h.jsx(lo,{type:"primary",ref:O,onClick:()=>{ge(),t(!1)},children:de("word.Run",B)},"Run")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:Z=>h.jsx(_i,{disabled:!y,bounds:b,onStart:(he,xe)=>ne(he,xe),children:h.jsx("div",{ref:P,children:Z})}),children:h.jsxs(qW,{defaultActiveKey:d,type:"card",onChange:Z=>{e(he=>{he.geneticAlgorithmWizardSelectedTab=Z})},children:[h.jsxs(Nae,{tab:de("optimizationMenu.Parameters",B),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.Objective",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:v.current,style:{width:"100%"},value:v.current,onChange:Z=>{v.current=Z,g(!p)},children:[h.jsx(Bh,{value:To.DAILY_TOTAL_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionDailyTotalYield",B)},To.DAILY_TOTAL_OUTPUT),h.jsx(Bh,{value:To.YEARLY_TOTAL_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionYearlyTotalYield",B)},To.YEARLY_TOTAL_OUTPUT),h.jsx(Bh,{value:To.DAILY_AVERAGE_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionDailyMeanYield",B)},To.DAILY_AVERAGE_OUTPUT),h.jsx(Bh,{value:To.YEARLY_AVERAGE_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionYearlyMeanYield",B)},To.YEARLY_AVERAGE_OUTPUT),h.jsx(Bh,{value:To.DAILY_PROFIT,children:de("optimizationMenu.ObjectiveFunctionDailyProfit",B)},To.DAILY_PROFIT),h.jsx(Bh,{value:To.YEARLY_PROFIT,children:de("optimizationMenu.ObjectiveFunctionYearlyProfit",B)},To.YEARLY_PROFIT)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.GeneticAlgorithmSelectionMethod",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:T.current,style:{width:"100%"},value:T.current,onChange:Z=>{T.current=Z,g(!p)},children:[h.jsx(Bh,{value:Wm.ROULETTE_WHEEL,children:de("optimizationMenu.RouletteWheel",B)},Wm.ROULETTE_WHEEL),h.jsx(Bh,{value:Wm.TOURNAMENT,children:de("optimizationMenu.Tournament",B)},Wm.TOURNAMENT)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.PopulationSize",B)+" [10, 100]:"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:10,max:100,style:{width:"100%"},precision:0,value:x.current,step:1,formatter:Z=>Number(Z).toFixed(0),onChange:Z=>{Z!==null&&(x.current=Number(Z),g(!p))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.MaximumGenerations",B)+" [5, 100]:"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:5,max:100,step:1,style:{width:"100%"},precision:0,value:S.current,formatter:Z=>Number(Z).toFixed(0),onChange:Z=>{Z!==null&&(S.current=Number(Z),g(!p))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.SelectionRate",B)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:M.current,step:.01,onChange:Z=>{Z!==null&&(M.current=Number(Z),g(!p))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.CrossoverRate",B)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:D.current,step:.01,onChange:Z=>{Z!==null&&(D.current=Number(Z),g(!p))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.MutationRate",B)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:R.current,step:.01,onChange:Z=>{Z!==null&&(R.current=Number(Z),g(!p))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.ConvergenceThreshold",B)+" (0, 0.1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:.001,max:.1,style:{width:"100%"},precision:3,value:E.current,step:.001,onChange:Z=>{Z!==null&&(E.current=Number(Z),g(!p))}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.SearchMethod",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:A.current,style:{width:"100%"},value:A.current,onChange:Z=>{A.current=Number(Z),g(!p)},children:[h.jsx(Bh,{value:us.GLOBAL_SEARCH_UNIFORM_SELECTION,children:de("optimizationMenu.GlobalSearchUniformSelection",B)},us.GLOBAL_SEARCH_UNIFORM_SELECTION),h.jsx(Bh,{value:us.LOCAL_SEARCH_RANDOM_OPTIMIZATION,children:de("optimizationMenu.LocalSearchRandomOptimization",B)},us.LOCAL_SEARCH_RANDOM_OPTIMIZATION)]})})]}),A.current===us.LOCAL_SEARCH_RANDOM_OPTIMIZATION&&h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.LocalSearchRadius",B)+" ([0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:W.current,step:.01,onChange:Z=>{Z!==null&&(W.current=Number(Z),g(!p))}})})]})]},"1"),h.jsxs(Nae,{tab:de("optimizationMenu.Variables",B),children:[h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.TiltAngleRange",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{range:!0,onChange:Z=>{j.current=me.toRadians(Z[0]),L.current=me.toRadians(Z[1]),g(!p)},min:-90,max:90,defaultValue:[me.toDegrees(j.current),me.toDegrees(L.current)],marks:{"-90":{style:{fontSize:"10px"},label:"-90°"},"-45":{style:{fontSize:"10px"},label:"-45°"},0:{style:{fontSize:"10px"},label:"0°"},45:{style:{fontSize:"10px"},label:"45°"},90:{style:{fontSize:"10px"},label:"90°"}}})})]}),h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.RowsPerRackRange",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{range:!0,onChange:Z=>{k.current=Z[0],N.current=Z[1],g(!p)},min:1,max:9,defaultValue:[k.current,N.current],marks:{1:{style:{fontSize:"10px"},label:1},2:{style:{fontSize:"10px"},label:2},3:{style:{fontSize:"10px"},label:3},4:{style:{fontSize:"10px"},label:4},5:{style:{fontSize:"10px"},label:5},6:{style:{fontSize:"10px"},label:6},7:{style:{fontSize:"10px"},label:7},8:{style:{fontSize:"10px"},label:8},9:{style:{fontSize:"10px"},label:9}}})})]}),h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.InterRowSpacingRange",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{range:!0,onChange:Z=>{F.current=Z[0],U.current=Z[1],g(!p)},min:1,max:10,defaultValue:[F.current,U.current],marks:{1:{style:{fontSize:"10px"},label:"1m"},3:{style:{fontSize:"10px"},label:"3m"},5:{style:{fontSize:"10px"},label:"5m"},7:{style:{fontSize:"10px"},label:"7m"},9:{style:{fontSize:"10px"},label:"9m"}}})})]})]},"2"),h.jsxs(Nae,{tab:de("optimizationMenu.Constants",B),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"6px",paddingTop:"0px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayModel",B)+" ("+Object.keys(i).length+" "+de("word.Options",B)+"):"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(_o,{defaultValue:"Custom",style:{width:"100%"},value:Q.current,onChange:Z=>{Q.current=Z,g(!p)},children:Object.keys(i).map(Z=>h.jsx(Bh,{value:Z,children:Z+(i[Z].bifacialityFactor>0?" ("+de("pvModelPanel.Bifacial",B)+")":"")},Z))})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"6px",paddingTop:"8px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayRowAxis",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{style:{width:"100%"},value:_.current,onChange:Z=>{_.current=Z,g(!p)},children:[h.jsx(Bh,{value:Dl.leftRight,children:de("polygonMenu.SolarPanelArrayLeftRightRowAxis",B)},Dl.leftRight),h.jsx(Bh,{value:Dl.upDown,children:de("polygonMenu.SolarPanelArrayUpDownRowAxis",B)},Dl.upDown)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"6px",paddingTop:"8px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayOrientation",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{style:{width:"100%"},value:le.current,onChange:Z=>{le.current=Z,g(!p)},children:[h.jsx(Bh,{value:vr.portrait,children:de("solarPanelMenu.Portrait",B)},vr.portrait),h.jsx(Bh,{value:vr.landscape,children:de("solarPanelMenu.Landscape",B)},vr.landscape)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayMargin",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{re.current=Z,g(!p)},min:0,max:5,step:.1,defaultValue:re.current,marks:{0:{style:{fontSize:"10px"},label:"0m"},1:{style:{fontSize:"10px"},label:"1m"},2:{style:{fontSize:"10px"},label:"2m"},3:{style:{fontSize:"10px"},label:"3m"},4:{style:{fontSize:"10px"},label:"4m"},5:{style:{fontSize:"10px"},label:"5m"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("solarCollectorMenu.PoleHeight",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{q.current=Z,g(!p)},min:0,max:10,step:.1,defaultValue:q.current,marks:{0:{style:{fontSize:"10px"},label:"0m"},2:{style:{fontSize:"10px"},label:"2m"},4:{style:{fontSize:"10px"},label:"4m"},6:{style:{fontSize:"10px"},label:"6m"},8:{style:{fontSize:"10px"},label:"8m"},10:{style:{fontSize:"10px"},label:"10m"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("solarPanelMenu.PoleSpacing",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{te.current=Z,g(!p)},min:2,max:10,step:.1,defaultValue:te.current,marks:{2:{style:{fontSize:"10px"},label:"2m"},4:{style:{fontSize:"10px"},label:"4m"},6:{style:{fontSize:"10px"},label:"6m"},8:{style:{fontSize:"10px"},label:"8m"},10:{style:{fontSize:"10px"},label:"10m"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("economicsPanel.OperationalCostPerUnit",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{se.current=Z,g(!p)},min:.1,max:1,step:.01,defaultValue:se.current,marks:{.1:{style:{fontSize:"10px"},label:"10¢"},.3:{style:{fontSize:"10px"},label:"30¢"},.5:{style:{fontSize:"10px"},label:"50¢"},.7:{style:{fontSize:"10px"},label:"70¢"},.9:{style:{fontSize:"10px"},label:"90¢"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("economicsPanel.ElectricitySellingPrice",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{ae.current=Z,g(!p)},min:.1,max:1,step:.01,defaultValue:ae.current,marks:{.1:{style:{fontSize:"10px"},label:"10¢"},.3:{style:{fontSize:"10px"},label:"30¢"},.5:{style:{fontSize:"10px"},label:"50¢"},.7:{style:{fontSize:"10px"},label:"70¢"},.9:{style:{fontSize:"10px"},label:"90¢"}}})})]})]},"3")]})})})},{Option:V1}=_o,{TabPane:Uae}=qW,dfo=({setDialogVisible:t})=>{const e=H(fn),n=H(da),o=H(s0),r=ht(n5),i=H(fW),a=H(s3),l=H(qr),s=H(l3),c=H(wA).particleSwarmOptimizationParams,u=H(i$),d=H(hxt),f=H(n$),[p,g]=m.useState(!1),[y,w]=m.useState(!1),[b,C]=m.useState({left:0,top:0,bottom:0,right:0}),P=m.useRef(null),v=m.useRef(c.objectiveFunctionType),T=m.useRef(c.searchMethod),A=m.useRef(c.swarmSize),x=m.useRef(c.maximumSteps),S=m.useRef(c.vmax??.01),R=m.useRef(c.inertia??.8),M=m.useRef(c.cognitiveCoefficient??.1),D=m.useRef(c.socialCoefficient??.1),E=m.useRef(c.convergenceThreshold),W=m.useRef(c.localSearchRadius),j=m.useRef(u.minimumTiltAngle??-Gt),L=m.useRef(u.maximumTiltAngle??Gt),k=m.useRef(u.minimumRowsPerRack),N=m.useRef(u.maximumRowsPerRack),F=m.useRef(u.minimumInterRowSpacing),U=m.useRef(u.maximumInterRowSpacing),O=m.useRef(null);m.useEffect(()=>{var Z;(Z=O.current)==null||Z.focus()},[]);const B={lng:o},_=m.useRef(u.rowAxis??Dl.leftRight),X=a?l(a):void 0,$=X?s(z.SolarPanel,X.id):void 0,Q=m.useRef($&&$.length>0?$[0].pvModelName:u.pvModelName??"CS6X-355P-FG"),le=m.useRef($&&$.length>0?$[0].orientation:u.orientation??vr.landscape),q=m.useRef($&&$.length>0?$[0].poleHeight:u.poleHeight??1),te=m.useRef($&&$.length>0?$[0].poleSpacing:u.poleSpacing??3),re=m.useRef(u.margin??0),ae=m.useRef(f.electricitySellingPrice),se=m.useRef(f.operationalCostPerUnit);m.useEffect(()=>{ae.current=f.electricitySellingPrice},[f.electricitySellingPrice]),m.useEffect(()=>{se.current=f.operationalCostPerUnit},[f.operationalCostPerUnit]);const ne=(Z,he)=>{if(P.current){const{clientWidth:xe,clientHeight:He}=window.document.documentElement,Se=P.current.getBoundingClientRect();C({left:-Se.left+he.x,right:xe-(Se.right-he.x),top:-Se.top+he.y,bottom:He-((Se==null?void 0:Se.bottom)-he.y)})}},fe=()=>{e(Z=>{Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.problem=Pi.SOLAR_PANEL_ARRAY,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.objectiveFunctionType=v.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.searchMethod=T.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.swarmSize=A.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.maximumSteps=x.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.cognitiveCoefficient=M.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.socialCoefficient=D.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.vmax=S.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.inertia=R.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.convergenceThreshold=E.current,Z.evolutionaryAlgorithmState.particleSwarmOptimizationParams.localSearchRadius=W.current,Z.solarPanelArrayLayoutConstraints||(Z.solarPanelArrayLayoutConstraints=new dX),Z.solarPanelArrayLayoutConstraints.minimumRowsPerRack=k.current,Z.solarPanelArrayLayoutConstraints.maximumRowsPerRack=N.current,Z.solarPanelArrayLayoutConstraints.minimumTiltAngle=j.current,Z.solarPanelArrayLayoutConstraints.maximumTiltAngle=L.current,Z.solarPanelArrayLayoutConstraints.minimumInterRowSpacing=F.current,Z.solarPanelArrayLayoutConstraints.maximumInterRowSpacing=U.current,Z.solarPanelArrayLayoutConstraints.poleHeight=q.current,Z.solarPanelArrayLayoutConstraints.poleSpacing=te.current,Z.solarPanelArrayLayoutConstraints.pvModelName=Q.current,Z.solarPanelArrayLayoutConstraints.rowAxis=_.current,Z.solarPanelArrayLayoutConstraints.orientation=le.current,Z.solarPanelArrayLayoutConstraints.margin=re.current,Z.economicsParams.operationalCostPerUnit=se.current,Z.economicsParams.electricitySellingPrice=ae.current})},ge=()=>{r||hn(de("message.EvolutionStarted",B)),fe(),setTimeout(()=>{ht.getState().set(Z=>{Z.runEvolution=!Z.runEvolution}),e(Z=>{Z.evolutionMethod=Vs.PARTICLE_SWARM_OPTIMIZATION,n&&(Z.actionInfo={name:"Run Particle Swarm Optimization for Solar Panel Array Layout",timestamp:new Date().getTime(),details:{...H.getState().evolutionaryAlgorithmState.particleSwarmOptimizationParams,...H.getState().solarPanelArrayLayoutConstraints,...H.getState().economicsParams}})})},100)},{t:de}=Vl();return h.jsx(h.Fragment,{children:h.jsx(Oi,{width:640,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>w(!0),onMouseOut:()=>w(!1),children:de("optimizationMenu.SolarPanelArrayLayout",B)+": "+de("optimizationMenu.ParticleSwarmOptimizationSettings",B)}),footer:[h.jsx(lo,{onClick:()=>{t(!1)},children:de("word.Cancel",B)},"Cancel"),h.jsx(lo,{type:"primary",ref:O,onClick:()=>{ge(),t(!1)},children:de("word.Run",B)},"Run")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:Z=>h.jsx(_i,{disabled:!y,bounds:b,onStart:(he,xe)=>ne(he,xe),children:h.jsx("div",{ref:P,children:Z})}),children:h.jsxs(qW,{defaultActiveKey:d,type:"card",onChange:Z=>{e(he=>{he.particleSwarmOptimizationWizardSelectedTab=Z})},children:[h.jsxs(Uae,{tab:de("optimizationMenu.Parameters",B),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.Objective",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:v.current,style:{width:"100%"},value:v.current,onChange:Z=>{v.current=Z,g(!p)},children:[h.jsx(V1,{value:To.DAILY_TOTAL_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionDailyTotalYield",B)},To.DAILY_TOTAL_OUTPUT),h.jsx(V1,{value:To.YEARLY_TOTAL_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionYearlyTotalYield",B)},To.YEARLY_TOTAL_OUTPUT),h.jsx(V1,{value:To.DAILY_AVERAGE_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionDailyMeanYield",B)},To.DAILY_AVERAGE_OUTPUT),h.jsx(V1,{value:To.YEARLY_AVERAGE_OUTPUT,children:de("optimizationMenu.ObjectiveFunctionYearlyMeanYield",B)},To.YEARLY_AVERAGE_OUTPUT),h.jsx(V1,{value:To.DAILY_PROFIT,children:de("optimizationMenu.ObjectiveFunctionDailyProfit",B)},To.DAILY_PROFIT),h.jsx(V1,{value:To.YEARLY_PROFIT,children:de("optimizationMenu.ObjectiveFunctionYearlyProfit",B)},To.YEARLY_PROFIT)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.SwarmSize",B)+" [10, 100]:"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:10,max:100,style:{width:"100%"},precision:0,value:A.current,step:1,formatter:Z=>Number(Z).toFixed(0),onChange:Z=>{A.current=Number(Z),g(!p)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.MaximumSteps",B)+" [5, 100]:"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:5,max:100,step:1,style:{width:"100%"},precision:0,value:x.current,formatter:Z=>Number(Z).toFixed(0),onChange:Z=>{x.current=Number(Z),g(!p)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.CognitiveCoefficient",B)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:M.current,step:.01,onChange:Z=>{M.current=Number(Z),g(!p)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.SocialCoefficient",B)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:D.current,step:.01,onChange:Z=>{D.current=Number(Z),g(!p)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.InertiaWeight",B)+" [0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:R.current,step:.01,onChange:Z=>{R.current=Number(Z),g(!p)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.MaximumVelocity",B)+" [0.001, 0.1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:.001,max:.1,style:{width:"100%"},precision:3,value:S.current,step:.001,onChange:Z=>{S.current=Number(Z),g(!p)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.ConvergenceThreshold",B)+" (0, 0.1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:.001,max:.1,style:{width:"100%"},precision:3,value:E.current,step:.001,onChange:Z=>{E.current=Number(Z),g(!p)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.SearchMethod",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{defaultValue:T.current,style:{width:"100%"},value:T.current,onChange:Z=>{T.current=Number(Z),g(!p)},children:[h.jsx(V1,{value:us.GLOBAL_SEARCH_UNIFORM_SELECTION,children:de("optimizationMenu.GlobalSearchUniformSelection",B)},us.GLOBAL_SEARCH_UNIFORM_SELECTION),h.jsx(V1,{value:us.LOCAL_SEARCH_RANDOM_OPTIMIZATION,children:de("optimizationMenu.LocalSearchRandomOptimization",B)},us.LOCAL_SEARCH_RANDOM_OPTIMIZATION)]})})]}),T.current===us.LOCAL_SEARCH_RANDOM_OPTIMIZATION&&h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.LocalSearchRadius",B)+" ([0, 1]: "}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Mn,{min:0,max:1,style:{width:"100%"},precision:2,value:W.current,step:.01,onChange:Z=>{W.current=Number(Z),g(!p)}})})]})]},"1"),h.jsxs(Uae,{tab:de("optimizationMenu.Variables",B),children:[h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.TiltAngleRange",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{range:!0,onChange:Z=>{j.current=me.toRadians(Z[0]),L.current=me.toRadians(Z[1]),g(!p)},min:-90,max:90,defaultValue:[me.toDegrees(j.current),me.toDegrees(L.current)],marks:{"-90":{style:{fontSize:"10px"},label:"-90°"},"-45":{style:{fontSize:"10px"},label:"-45°"},0:{style:{fontSize:"10px"},label:"0°"},45:{style:{fontSize:"10px"},label:"45°"},90:{style:{fontSize:"10px"},label:"90°"}}})})]}),h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.RowsPerRackRange",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{range:!0,onChange:Z=>{k.current=Z[0],N.current=Z[1],g(!p)},min:1,max:9,defaultValue:[k.current,N.current],marks:{1:{style:{fontSize:"10px"},label:1},2:{style:{fontSize:"10px"},label:2},3:{style:{fontSize:"10px"},label:3},4:{style:{fontSize:"10px"},label:4},5:{style:{fontSize:"10px"},label:5},6:{style:{fontSize:"10px"},label:6},7:{style:{fontSize:"10px"},label:7},8:{style:{fontSize:"10px"},label:8},9:{style:{fontSize:"10px"},label:9}}})})]}),h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("optimizationMenu.InterRowSpacingRange",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{range:!0,onChange:Z=>{F.current=Z[0],U.current=Z[1],g(!p)},min:2,max:10,defaultValue:[F.current,U.current],marks:{2:{style:{fontSize:"10px"},label:"2m"},4:{style:{fontSize:"10px"},label:"4m"},6:{style:{fontSize:"10px"},label:"6m"},8:{style:{fontSize:"10px"},label:"8m"},10:{style:{fontSize:"10px"},label:"10m"}}})})]})]},"2"),h.jsxs(Uae,{tab:de("optimizationMenu.Constants",B),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"6px",paddingTop:"0px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayModel",B)+" ("+Object.keys(i).length+" "+de("word.Options",B)+"):"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(_o,{defaultValue:"Custom",style:{width:"100%"},value:Q.current,onChange:Z=>{Q.current=Z,g(!p)},children:Object.keys(i).map(Z=>h.jsx(V1,{value:Z,children:Z+(i[Z].bifacialityFactor>0?" ("+de("pvModelPanel.Bifacial",B)+")":"")},Z))})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"6px",paddingTop:"8px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayRowAxis",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{style:{width:"100%"},value:_.current,onChange:Z=>{_.current=Z,g(!p)},children:[h.jsx(V1,{value:Dl.leftRight,children:de("polygonMenu.SolarPanelArrayLeftRightRowAxis",B)},Dl.leftRight),h.jsx(V1,{value:Dl.upDown,children:de("polygonMenu.SolarPanelArrayUpDownRowAxis",B)},Dl.upDown)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"6px",paddingTop:"8px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayOrientation",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsxs(_o,{style:{width:"100%"},value:le.current,onChange:Z=>{le.current=Z,g(!p)},children:[h.jsx(V1,{value:vr.portrait,children:de("solarPanelMenu.Portrait",B)},vr.portrait),h.jsx(V1,{value:vr.landscape,children:de("solarPanelMenu.Landscape",B)},vr.landscape)]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("polygonMenu.SolarPanelArrayMargin",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{re.current=Z,g(!p)},min:0,max:5,step:.1,defaultValue:re.current,marks:{0:{style:{fontSize:"10px"},label:"0m"},1:{style:{fontSize:"10px"},label:"1m"},2:{style:{fontSize:"10px"},label:"2m"},3:{style:{fontSize:"10px"},label:"3m"},4:{style:{fontSize:"10px"},label:"4m"},5:{style:{fontSize:"10px"},label:"5m"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("solarCollectorMenu.PoleHeight",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{q.current=Z,g(!p)},min:0,max:10,step:.1,defaultValue:q.current,marks:{0:{style:{fontSize:"10px"},label:"0m"},2:{style:{fontSize:"10px"},label:"2m"},4:{style:{fontSize:"10px"},label:"4m"},6:{style:{fontSize:"10px"},label:"6m"},8:{style:{fontSize:"10px"},label:"8m"},10:{style:{fontSize:"10px"},label:"10m"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("solarPanelMenu.PoleSpacing",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{te.current=Z,g(!p)},min:2,max:10,step:.1,defaultValue:te.current,marks:{2:{style:{fontSize:"10px"},label:"2m"},4:{style:{fontSize:"10px"},label:"4m"},6:{style:{fontSize:"10px"},label:"6m"},8:{style:{fontSize:"10px"},label:"8m"},10:{style:{fontSize:"10px"},label:"10m"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("economicsPanel.OperationalCostPerUnit",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{se.current=Z,g(!p)},min:.1,max:1,step:.01,defaultValue:se.current,marks:{.1:{style:{fontSize:"10px"},label:"10¢"},.3:{style:{fontSize:"10px"},label:"30¢"},.5:{style:{fontSize:"10px"},label:"50¢"},.7:{style:{fontSize:"10px"},label:"70¢"},.9:{style:{fontSize:"10px"},label:"90¢"}}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"0px",paddingTop:"12px"},children:[h.jsx(nt,{className:"gutter-row",span:12,children:de("economicsPanel.ElectricitySellingPrice",B)+":"}),h.jsx(nt,{className:"gutter-row",span:12,children:h.jsx(Iu,{style:{paddingBottom:0,paddingTop:0,marginTop:"16px",marginBottom:"16px"},onChange:Z=>{ae.current=Z,g(!p)},min:.1,max:1,step:.01,defaultValue:ae.current,marks:{.1:{style:{fontSize:"10px"},label:"10¢"},.3:{style:{fontSize:"10px"},label:"30¢"},.5:{style:{fontSize:"10px"},label:"50¢"},.7:{style:{fontSize:"10px"},label:"70¢"},.9:{style:{fontSize:"10px"},label:"90¢"}}})})]})]},"3")]})})})},ffo=t=>{const e=[];if(t.type!==z.Polygon)return{items:e};const n=t,o=H.getState().getParent(n),r={lng:H.getState().language},i=!n.locked;return e.push({key:"polygon-paste",label:h.jsx(eM,{})}),e.push({key:"polygon-copy",label:h.jsx(Ld,{})}),i&&e.push({key:"polygon-cut",label:h.jsx(Wd,{})}),o&&(o.type===z.Foundation||o.type===z.Cuboid)&&e.push({key:"polygon-layout-submenu",label:h.jsx(rn,{children:Y.t("polygonMenu.Layout",r)}),children:[{key:"solar-panel-layout-wizard",label:h.jsxs(to,{noPadding:!0,Dialog:cfo,children:[Y.t("polygonMenu.SolarPanelArrayLayoutParametricDesign",r)," ..."]})},{key:"solar-panel-layout-ai",label:h.jsx(rn,{noPadding:!0,children:Y.t("polygonMenu.SolarPanelArrayLayoutGenerativeDesign",r)}),children:[{key:"solar-panel-layout-ga",label:h.jsxs(to,{noPadding:!0,Dialog:ufo,children:[Y.t("optimizationMenu.GeneticAlgorithm",r)," ..."]})},{key:"solar-panel-layout-pso",label:h.jsxs(to,{noPadding:!0,Dialog:dfo,children:[Y.t("optimizationMenu.ParticleSwarmOptimization",r)," ..."]})}]}]}),e.push({key:"polygon-lock",label:h.jsx(Ju,{selectedElement:n})}),i&&(e.push({key:"polygon-filled",label:h.jsx(Odo,{polygon:n})}),n.filled&&e.push({key:"polygon-shiny",label:h.jsx(_do,{polygon:n})}),e.push({key:"polygon-no-outline",label:h.jsx(Vdo,{polygon:n})})),i&&(e.push({key:"polygon-line-color",label:h.jsxs(to,{Dialog:Zdo,children:[Y.t("polygonMenu.LineColor",r)," ..."]})},{key:"polygon-line-style",label:h.jsxs(to,{Dialog:efo,children:[Y.t("polygonMenu.LineStyle",r)," ..."]})},{key:"polygon-line-width",label:h.jsxs(to,{Dialog:tfo,children:[Y.t("polygonMenu.LineWidth",r)," ..."]})}),n.filled&&((!n.textureType||n.textureType===Jr.NoTexture)&&e.push({key:"polygon-fill-color",label:h.jsxs(to,{Dialog:nfo,children:[Y.t("polygonMenu.FillColor",r)," ..."]})}),e.push({key:"polygon-texture",label:h.jsxs(to,{Dialog:afo,children:[Y.t("polygonMenu.FillTexture",r)," ..."]})},{key:"polygon-opacity",label:h.jsxs(to,{Dialog:lfo,children:[Y.t("polygonMenu.Opacity",r)," ..."]})})),e.push({key:"polygon-text-box",label:h.jsx(rn,{children:Y.t("polygonMenu.TextBox",r)}),children:[{key:"polygon-text",label:h.jsx(Gdo,{polygon:n})},{key:"polygon-font-size",label:h.jsx(Xdo,{polygon:n})},{key:"polygon-font-color",label:h.jsx(Jdo,{polygon:n})},{key:"polygon-font-outline-color",label:h.jsx(Kdo,{polygon:n})},{key:"polygon-font-outline-width",label:h.jsx(qdo,{polygon:n})},{key:"polygon-font-stroke-color",label:h.jsx($do,{polygon:n})},{key:"polygon-font-stroke-width",label:h.jsx(Qdo,{polygon:n})}]})),{items:e}},hfo=(t,e)=>{H.getState().set(n=>{for(const o of n.elements)if(o.type===z.Polygon&&o.id===t){o.vertices.splice(e,1);break}})},pfo=(t,e)=>{H.getState().set(n=>{for(const o of n.elements)if(o.type===z.Polygon&&o.id===t){const r=o,i=r.vertices.length;if(e>0&&e{H.getState().set(n=>{for(const o of n.elements)if(o.type===z.Polygon&&o.id===t){const r=o,i=r.vertices.length;if(e>=0&&e{if(t.selectedIndex>=0){const n=t.vertices.map(i=>({...i}));switch(e){case sx.Delete:hfo(t.id,t.selectedIndex);break;case sx.InsertBeforeIndex:pfo(t.id,t.selectedIndex);break;case sx.InsertAfterIndex:gfo(t.id,t.selectedIndex);break}const o=H.getState().getElementById(t.id).vertices.map(i=>({...i})),r={name:e,timestamp:Date.now(),changedElementId:t.id,changedElementType:t.type,oldValue:n,newValue:o,undo:()=>{r.oldValue&&Array.isArray(r.oldValue)&&H.getState().updatePolygonVerticesById(r.changedElementId,n)},redo:()=>{H.getState().updatePolygonVerticesById(r.changedElementId,o)}};H.getState().addUndoable(r)}},mfo=t=>{const e=[];if(t.type!==z.Polygon)return{items:e};const n=t,o={lng:H.getState().language};return e.push({key:"polygon-vertex-insert-before-index",label:h.jsx(rn,{noPadding:!0,children:Y.t("polygonMenu.InsertVertexBeforeIndex",o)})},{key:"polygon-vertex-insert-after-index",label:h.jsx(rn,{noPadding:!0,children:Y.t("polygonMenu.InsertVertexAfterIndex",o)})}),n.vertices.length>3&&e.push({key:"polygon-vertex-delete",label:h.jsx(rn,{noPadding:!0,children:Y.t("polygonMenu.DeleteVertex",o)})}),{items:e,onClick:({key:i})=>{switch(i){case"polygon-vertex-insert-before-index":jae(n,sx.InsertBeforeIndex);break;case"polygon-vertex-insert-after-index":jae(n,sx.InsertAfterIndex);break;case"polygon-vertex-delete":jae(n,sx.Delete);break}}}},yfo=({sensor:t})=>{const e=Jt(),n=not(t);return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:!!t.showLabel,onChange:n,children:Y.t("labelSubMenu.KeepShowingLabel",e)})})},Afo=({sensor:t})=>{const e=Jt(),{labelText:n,setLabelText:o}=tot(t),r=oot(t,n);return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsx(en,{style:{width:"80px"},children:Y.t("labelSubMenu.LabelText",e)+":"}),h.jsx(as,{style:{width:"150px"},value:n,onChange:i=>o(i.target.value),onPressEnter:r,onBlur:r})]})},wfo=t=>{const e=[];if(t.type!==z.Sensor)return{items:e};const n=t,o=!n.locked;return e.push({key:"sensor-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"sensor-cut",label:h.jsx(Wd,{})}),e.push({key:"sensor-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&(e.push({key:"sensor-show-label",label:h.jsx(yfo,{sensor:n})}),e.push({key:"sensor-label-text",label:h.jsx(Afo,{sensor:n})})),{items:e}},vfo=({light:t})=>{const e=Jt(),n=H.getState().updateInsideLightById,o=r=>{const i=r.target.checked,a={name:"Inside Light",timestamp:Date.now(),checked:i,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.inside,onChange:o,children:Y.t("lightMenu.Inside",e)})})},xfo=({light:t})=>{const e=Jt(),n=t.intensity??3,o=(i,a)=>{H.getState().set(l=>{for(const s of l.elements)if(s.type===z.Light&&s.id===i){s.intensity=a;break}})},r=i=>{if(i===null||i===n)return;const a={name:"Set Light Intensity",timestamp:Date.now(),oldValue:n,newValue:i,changedElementId:t.id,undo:()=>{o(a.changedElementId,a.oldValue)},redo:()=>{o(a.changedElementId,a.newValue)}};H.getState().addUndoable(a),o(t.id,i),H.getState().set(l=>{l.actionState.lightIntensity=i})};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"80px"},children:[Y.t("lightMenu.Intensity",e),":"]}),h.jsx(Mn,{min:.1,max:10,step:.1,precision:1,value:n,onChange:r})]})},bfo=({light:t})=>{const e=Jt(),n=t.distance??5,o=(i,a)=>{H.getState().set(l=>{for(const s of l.elements)if(s.type===z.Light&&s.id===i){s.distance=a;break}})},r=i=>{if(i===null||i===n)return;const a={name:"Set Light Distance",timestamp:Date.now(),oldValue:n,newValue:i,changedElementId:t.id,undo:()=>{o(a.changedElementId,a.oldValue)},redo:()=>{o(a.changedElementId,a.newValue)}};H.getState().addUndoable(a),o(t.id,i),H.getState().set(l=>{l.actionState.lightDistance=i})};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"80px"},children:[Y.t("lightMenu.MaximumDistance",e),":"]}),h.jsx(Mn,{min:1,max:10,step:1,precision:1,value:n,onChange:r})]})},Sfo=({light:t})=>{const e=t.color??"#ffff99",n=(o,r)=>{H.getState().set(i=>{for(const a of i.elements)if(a.type===z.Light&&a.id===o){a.color=r;break}})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(zf,{color:e,onChangeComplete:o=>{const r=t.color,i=o.hex,a={name:"Set Light Color",timestamp:Date.now(),oldValue:r,newValue:i,undo:()=>{n(t.id,a.oldValue)},redo:()=>{n(t.id,a.newValue)}};H.getState().addUndoable(a),n(t.id,i),H.getState().set(l=>{l.actionState.lightColor=i})}})})},Tfo=t=>{const e=[];if(t.type!==z.Light)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language},i=n.parentId?H.getState().getParent(n):void 0;return e.push({key:"light-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"light-cut",label:h.jsx(Wd,{})}),e.push({key:"light-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&i&&(i.type===z.Roof||i.type===z.Wall)&&e.push({key:"light-inside",label:h.jsx(vfo,{light:n})}),o&&e.push({key:"light-intensity",label:h.jsx(xfo,{light:n})},{key:"light-distance",label:h.jsx(bfo,{light:n})},{key:"light-color",label:h.jsx(rn,{children:Y.t("word.Color",r)}),children:[{key:"light-color-picker",label:h.jsx(Sfo,{light:n}),style:{backgroundColor:"white"}}]}),{items:e}},Pfo=()=>{const t=H(Age),e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.axes=r})},o=r=>{const i=r.target.checked,a={name:"Show Axes",timestamp:Date.now(),checked:i,undo:()=>{n(!a.checked)},redo:()=>{n(a.checked)}};H.getState().addUndoable(a),n(i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t,onChange:o,children:Y.t("skyMenu.Axes",e)})})},Cfo=()=>{const t=H(wBe),e=Jt(),n=i=>{H.getState().set(a=>{a.viewState.theme=i})},o=i=>{const a=t,l=i.target.value,s={name:"Select Theme",timestamp:Date.now(),oldValue:a,newValue:l,undo:()=>{n(s.oldValue)},redo:()=>{n(s.newValue)}};H.getState().addUndoable(s),n(l)},r=[{value:Os.Default,label:"skyMenu.ThemeDefault"},{value:Os.Desert,label:"skyMenu.ThemeDesert"},{value:Os.Dune,label:"skyMenu.ThemeDune"},{value:Os.Forest,label:"skyMenu.ThemeForest"},{value:Os.Grassland,label:"skyMenu.ThemeGrassland"},{value:Os.Hill,label:"skyMenu.ThemeHill"},{value:Os.Lake,label:"skyMenu.ThemeLake"},{value:Os.Mountain,label:"skyMenu.ThemeMountain"},{value:Os.Rural,label:"skyMenu.ThemeRural"}];return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Ue.Group,{value:t,onChange:o,children:h.jsx(en,{direction:"vertical",children:r.map((i,a)=>h.jsx(Ue,{style:{width:"100%"},value:i.value,children:Y.t(i.label,e)},`${a}-${i.value}`))})})})},Rfo=()=>{const t=H(vBe)??!0,e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.showAzimuthAngle=r})},o=r=>{const i=t,a=r.target.checked,l={name:"Show Azimuth Angle "+a,timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t,onChange:o,children:Y.t("skyMenu.ShowAzimuthAngle",e)})})},Hfo=()=>{const t=H(xBe)??!0,e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.showElevationAngle=r})},o=r=>{const i=t,a=r.target.checked,l={name:"Show Elevation Angle "+a,timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t,onChange:o,children:Y.t("skyMenu.ShowElevationAngle",e)})})},Mfo=()=>{const t=H(bBe)??!0,e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.showZenithAngle=r})},o=r=>{const i=t,a=r.target.checked,l={name:"Show Zenith Angle "+a,timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t,onChange:o,children:Y.t("skyMenu.ShowZenithAngle",e)})})},Ifo=()=>{const t=H(ABe)??3.5,e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.directLightIntensity=r})},o=r=>{if(r===null)return;const i=t,a=r,l={name:"Set Direct Light Intensity",timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsx(en,{style:{width:"270px"},children:Y.t("skyMenu.DirectLightBrightnessAtNoon",e)+" [0.1-10]:"}),h.jsx(Mn,{min:.1,max:10,step:.1,precision:2,value:t,onChange:o})]})},zfo=()=>{const t=H(yBe)??.2,e=Jt(),n=r=>{H.getState().set(i=>{i.viewState.ambientLightIntensity=r})},o=r=>{if(r===null)return;const i=t,a=r,l={name:"Set Ambient Light Intensity",timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsx(en,{style:{width:"270px"},children:Y.t("skyMenu.AmbientLightBrightnessAtNoon",e)+" [0.01-1]:"}),h.jsx(Mn,{min:.01,max:1,step:.01,precision:2,value:t,onChange:o})]})},Dfo=()=>{const t=H(v8t)??.01,e=Jt(),n=r=>{H.getState().set(i=>{i.world.airAttenuationCoefficient=r})},o=r=>{if(r===null)return;const i=t,a=r,l={name:"Set Sunlight Attenuation Coefficient of Air",timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsx(en,{style:{width:"270px"},children:Y.t("skyMenu.SunlightAttenuationCoefficientInAir",e)+":"}),h.jsx(Mn,{min:0,max:.1,step:.001,precision:3,value:t,onChange:o})]})},Efo=()=>{const t=H(x8t)??5,e=Jt(),n=r=>{H.getState().set(i=>{i.world.airConvectiveCoefficient=r})},o=r=>{if(r===null)return;const i=t,a=r,l={name:"Set Convective Coefficient of Air",timestamp:Date.now(),oldValue:i,newValue:a,undo:()=>{n(l.oldValue)},redo:()=>{n(l.newValue)}};H.getState().addUndoable(l),n(a)};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsx(en,{style:{width:"270px"},children:Y.t("skyMenu.ConvectiveCoefficientOfAir",e)+" [W/(m²×K)]:"}),h.jsx(Mn,{min:2.5,max:20,step:.1,precision:2,value:t,onChange:o})]})},Ffo=()=>{const t=H(cW)??900,e=H.getState().world,n=Jt(),o=m.useMemo(()=>dl(new Date(e.date),e.latitude),[e.date,e.latitude]),r=a=>{H.getState().set(l=>{l.world.highestTemperatureTimeInMinutes=a})},i=a=>{if(a===null)return;const l=t,s=a,c={name:"Set Time of Highest Temperature in Minutes",timestamp:Date.now(),oldValue:l,newValue:s,undo:()=>{r(c.oldValue)},redo:()=>{r(c.newValue)}};H.getState().addUndoable(c),r(s)};return h.jsxs(rn,{stayAfterClick:!0,children:[h.jsx(en,{style:{width:"270px"},children:Y.t("skyMenu.HighestTemperatureTimeInMinutes",n)+":"}),h.jsx(Mn,{min:720,max:o.sunset,step:5,precision:0,value:t,onChange:i})]})},kfo=()=>{const t={lng:H.getState().language},e=[];return e.push({key:"axes",label:h.jsx(Pfo,{})}),e.push({key:"theme-submenu",label:h.jsx(rn,{children:Y.t("skyMenu.Theme",t)}),children:[{key:"theme-radio-group",label:h.jsx(Cfo,{}),style:{backgroundColor:"white"}}]}),e.push({key:"sun-angles-submenu",label:h.jsx(rn,{children:Y.t("skyMenu.SelectSunAnglesToShow",t)}),children:[{key:"show-azimuth-angle",label:h.jsx(Rfo,{})},{key:"ShowElevationAngle",label:h.jsx(Hfo,{})},{key:"ShowZenithAngle",label:h.jsx(Mfo,{})}]}),e.push({key:"direct-light-intensity",label:h.jsx(Ifo,{})}),e.push({key:"ambient-light-intensity",label:h.jsx(zfo,{})}),e.push({key:"air-attenuation-coefficient",label:h.jsx(Dfo,{})}),e.push({key:"air-convective-coefficient",label:h.jsx(Efo,{})}),e.push({key:"highest-temperature-time-in-minutes",label:h.jsx(Ffo,{})}),{items:e}},HK=class HK{constructor(){this.n=14,this.nominalStrings=new Array(this.n),this.nominalWidths=new Array(this.n),this.nominalHeights=new Array(this.n),this.cellNx=new Array(this.n),this.cellNy=new Array(this.n),this.nominalWidths[0]=.99,this.nominalHeights[0]=1.65,this.cellNx[0]=6,this.cellNy[0]=10,this.nominalWidths[1]=.99,this.nominalHeights[1]=1.96,this.cellNx[1]=6,this.cellNy[1]=12,this.nominalWidths[2]=1.05,this.nominalHeights[2]=1.56,this.cellNx[2]=8,this.cellNy[2]=12,this.nominalWidths[3]=1.31,this.nominalHeights[3]=1.96,this.cellNx[3]=8,this.cellNy[3]=12,this.nominalWidths[4]=1.07,this.nominalHeights[4]=2.07,this.cellNx[4]=8,this.cellNy[4]=16,this.nominalWidths[5]=.6,this.nominalHeights[5]=1.2,this.cellNx[5]=10,this.cellNy[5]=20,this.nominalWidths[6]=1.2,this.nominalHeights[6]=2,this.cellNx[6]=10,this.cellNy[6]=20,this.nominalWidths[7]=1,this.nominalHeights[7]=2.07,this.cellNx[7]=6,this.cellNy[7]=12,this.nominalWidths[8]=.8,this.nominalHeights[8]=1.56,this.cellNx[8]=6,this.cellNy[8]=12,this.nominalWidths[9]=.83,this.nominalHeights[9]=1.58,this.cellNx[9]=6,this.cellNy[9]=12,this.nominalWidths[10]=.99,this.nominalHeights[10]=1.31,this.cellNx[10]=6,this.cellNy[10]=8,this.nominalWidths[11]=.99,this.nominalHeights[11]=1.5,this.cellNx[11]=6,this.cellNy[11]=9,this.nominalWidths[12]=1.05,this.nominalHeights[12]=1.81,this.cellNx[12]=8,this.cellNy[12]=14,this.nominalWidths[13]=1.05,this.nominalHeights[13]=1.69,this.cellNx[13]=8,this.cellNy[13]=13;for(let e=0;e{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(fW),a=H(t5),l=H(En),s=H(zd),c=H(Dd),u=H(no),d=H(Zn),f=co(),[p,g]=m.useState((f==null?void 0:f.pvModelName)??"SPR-X21-335-BLK"),[y,w]=m.useState(),b=Jt(),C=a(p??"SPR-X21-335-BLK");m.useEffect(()=>{w(C.nominalWidth.toFixed(2)+"m×"+C.nominalLength.toFixed(2)+"m ("+C.n+"×"+C.m+" "+Y.t("pvModelPanel.Cells",b)+")")},[C]);const P=(W,j)=>{e(L=>{for(const k of L.elements)if(k.type===z.SolarPanel&&k.id===W&&!k.locked){const N=k;N.pvModelName=j;const F=L.pvModules[j];if(N.orientation===vr.portrait){const U=Math.max(1,Math.round(N.lx/F.width)),O=Math.max(1,Math.round(N.ly/F.length));N.lx=U*F.width,N.ly=O*F.length}else{const U=Math.max(1,Math.round(N.lx/F.length)),O=Math.max(1,Math.round(N.ly/F.width));N.lx=U*F.length,N.ly=O*F.width}break}})},v=(W,j)=>{e(L=>{const k=L.pvModules[j];for(const N of L.elements)if(N.type===z.SolarPanel&&N.foundationId===W&&!N.locked){const F=N;if(F.pvModelName=j,F.orientation===vr.portrait){const U=Math.max(1,Math.round(F.lx/k.width)),O=Math.max(1,Math.round(F.ly/k.length));F.lx=U*k.width,F.ly=O*k.length}else{const U=Math.max(1,Math.round(F.lx/k.length)),O=Math.max(1,Math.round(F.ly/k.width));F.lx=U*k.length,F.ly=O*k.width}}})},T=(W,j,L)=>{e(k=>{const N=k.pvModules[L];for(const F of k.elements)if(F.type===z.SolarPanel&&!F.locked){let U;if(j?U=F.parentId===W&&me.isIdentical(F.normal,j):U=F.parentId===W,U){const O=F;if(O.pvModelName=L,O.orientation===vr.portrait){const B=Math.max(1,Math.round(O.lx/N.width)),_=Math.max(1,Math.round(O.ly/N.length));O.lx=B*N.width,O.ly=_*N.length}else{const B=Math.max(1,Math.round(O.lx/N.length)),_=Math.max(1,Math.round(O.ly/N.width));O.lx=B*N.length,O.ly=_*N.width}}}})},A=W=>{e(j=>{const L=j.pvModules[W];for(const k of j.elements)if(k.type===z.SolarPanel&&!k.locked){const N=k;if(N.pvModelName=W,N.orientation===vr.portrait){const F=Math.max(1,Math.round(N.lx/L.width)),U=Math.max(1,Math.round(N.ly/L.length));N.lx=F*L.width,N.ly=U*L.length}else{const F=Math.max(1,Math.round(N.lx/L.length)),U=Math.max(1,Math.round(N.ly/L.width));N.lx=F*L.length,N.ly=U*L.width}}})},x=(W,j)=>{H.getState().set(L=>{const k=L.pvModules[j];for(const N of L.elements)if(N.type===z.SolarPanel&&!N.locked&&W.has(N.id)){const F=N;if(F.pvModelName=j,F.orientation===vr.portrait){const U=Math.max(1,Math.round(F.lx/k.width)),O=Math.max(1,Math.round(F.ly/k.length));F.lx=U*k.width,F.ly=O*k.length}else{const U=Math.max(1,Math.round(F.lx/k.length)),O=Math.max(1,Math.round(F.ly/k.width));F.lx=U*k.length,F.ly=O*k.width}}})},S=W=>{c(W.target.value)},R=W=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:{for(const j of n)if(j.type===z.SolarPanel&&!j.locked&&H.getState().selectedElementIdSet.has(j.id)&&j.pvModelName!==W)return!0;break}case oe.AllObjectsOfThisType:{for(const j of n)if(j.type===z.SolarPanel&&!j.locked&&j.pvModelName!==W)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const j of n)if(j.type===z.SolarPanel&&j.foundationId===(f==null?void 0:f.foundationId)&&!j.locked&&j.pvModelName!==W)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const j=r(f);if(j){if(j.type===z.Cuboid){for(const k of n)if(k.type===z.SolarPanel&&k.parentId===f.parentId&&me.isIdentical(k.normal,f.normal)&&!k.locked&&k.pvModelName!==W)return!0}else for(const k of n)if(k.type===z.SolarPanel&&k.parentId===f.parentId&&!k.locked&&k.pvModelName!==W)return!0}break}default:{if((f==null?void 0:f.pvModelName)!==W)return!0;break}}return!1}},M=W=>{if(f&&R(W)){switch(s){case oe.AllSelectedObjectsOfThisType:{const j=new Map;for(const k of n)k.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(k.id)&&j.set(k.id,k.pvModelName);const L={name:"Set Model for Selected Solar Panels",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())P(k,N)},redo:()=>{x(L.oldValues,L.newValue)}};l(L),x(j,W),d(u+1);break}case oe.AllObjectsOfThisType:{const j=new Map;for(const k of n)k.type===z.SolarPanel&&j.set(k.id,k.pvModelName);const L={name:"Set Model for All Solar Panels",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())P(k,N)},redo:()=>{A(L.newValue)}};l(L),A(W),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const j=new Map;for(const k of n)k.type===z.SolarPanel&&k.foundationId===f.foundationId&&j.set(k.id,k.pvModelName);const L={name:"Set Model for All Solar Panels Above Foundation",timestamp:Date.now(),oldValues:j,newValue:W,groupId:f.foundationId,undo:()=>{for(const[k,N]of L.oldValues.entries())P(k,N)},redo:()=>{L.groupId&&v(L.groupId,L.newValue)}};l(L),v(f.foundationId,W),d(u+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{const j=r(f);if(j){const L=new Map,k=j.type===z.Cuboid;if(k)for(const U of n)U.type===z.SolarPanel&&U.parentId===f.parentId&&me.isIdentical(U.normal,f.normal)&&L.set(U.id,U.pvModelName);else for(const U of n)U.type===z.SolarPanel&&U.parentId===f.parentId&&L.set(U.id,U.pvModelName);const N=k?f.normal:void 0,F={name:"Set Model for All Solar Panels on Surface",timestamp:Date.now(),oldValues:L,newValue:W,groupId:f.parentId,normal:N,undo:()=>{for(const[U,O]of F.oldValues.entries())P(U,O)},redo:()=>{F.groupId&&T(F.groupId,F.normal,F.newValue)}};l(F),T(f.parentId,N,W),d(u+1)}break}default:{const j=o(f.id),L=j?j.pvModelName:f.pvModelName,k={name:"Set Model for Selected Solar Panel",timestamp:Date.now(),oldValue:L,newValue:W,changedElementId:f.id,changedElementType:f.type,undo:()=>{P(k.changedElementId,k.oldValue)},redo:()=>{P(k.changedElementId,k.newValue)}};l(k),P(f.id,W),d(u+1);break}}e(j=>{j.actionState.solarPanelModelName=W})}},D=()=>{t(!1)},E=()=>{M(p)};return h.jsxs(so,{width:640,title:Y.t("pvModelPanel.SolarPanelSpecs",b),onApply:E,onClose:D,children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("pvModelPanel.Model",b)+" ("+Object.keys(i).length+" "+Y.t("word.Options",b)+"):"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(_o,{defaultValue:"Custom",style:{width:"100%"},value:p,onChange:g,children:Object.keys(i).map(W=>h.jsx(Z7,{value:W,children:W+(i[W].bifacialityFactor>0?" ("+Y.t("pvModelPanel.Bifacial",b)+")":"")},W))})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("pvModelPanel.PanelSize",b)+":"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(_o,{disabled:!0,style:{width:"100%"},value:y,onChange:W=>{},children:mfe.instance.nominalStrings.map(W=>h.jsx(Z7,{value:W,children:W},W))})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("pvModelPanel.CellType",b)+":"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsxs(_o,{disabled:!0,style:{width:"100%"},value:C.cellType,onChange:W=>{},children:[h.jsx(Z7,{value:"Monocrystalline",children:Y.t("pvModelPanel.Monocrystalline",b)},"Monocrystalline"),h.jsx(Z7,{value:"Polycrystalline",children:Y.t("pvModelPanel.Polycrystalline",b)},"Polycrystalline"),h.jsx(Z7,{value:"Thin Film",children:Y.t("pvModelPanel.ThinFilm",b)},"Thin Film")]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("pvModelPanel.BifacialityFactor",b)+":"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{disabled:!0,style:{width:"100%"},precision:2,value:C.bifacialityFactor,onChange:W=>{}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("word.Color",b)+":"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsxs(_o,{disabled:!0,style:{width:"100%"},value:C.color,onChange:W=>{},children:[h.jsx(Z7,{value:"Black",children:Y.t("pvModelPanel.Black",b)},"Black"),h.jsx(Z7,{value:"Blue",children:Y.t("pvModelPanel.Blue",b)},"Blue")]})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("pvModelPanel.SolarCellEfficiency",b)+" (%):"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{disabled:!0,style:{width:"100%"},precision:2,value:100*C.efficiency,onChange:W=>{}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("pvModelPanel.NominalOperatingCellTemperature",b)+" (°C):"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(Mn,{disabled:!0,style:{width:"100%"},precision:1,value:C.noct,onChange:W=>{}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:13,children:Y.t("pvModelPanel.TemperatureCoefficientOfPmax",b)+" (%/°C):"}),h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(as,{disabled:!0,style:{width:"100%"},value:C.pmaxTC,onChange:W=>{}})})]}),h.jsxs(on,{gutter:6,style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},children:[h.jsx(nt,{className:"gutter-row",span:3,children:Y.t("word.ApplyTo",b)+":"}),h.jsx(nt,{className:"gutter-row",span:21,children:h.jsx(Ue.Group,{onChange:S,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",b)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",b)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",b)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",b)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",b)})]})})})]})]})},{Option:MHe}=_o,Wfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(t5),i=H(qr),a=H(Fge),l=H(En),s=H(zd),c=H(Dd),u=H(no),d=H(Zn),f=H(Vi),p=co(),[g,y]=m.useState((p==null?void 0:p.orientation)??vr.portrait),w=m.useRef(!1),b=m.useRef(),C=Jt(),P=(U,O)=>{e(B=>{for(const _ of B.elements)if(_.type===z.SolarPanel&&_.id===U&&!_.locked){const X=_,$=B.pvModules[X.pvModelName];B.setSolarPanelOrientation(X,$,O);break}})},v=(U,O)=>{e(B=>{for(const _ of B.elements)if(_.type===z.SolarPanel&&_.foundationId===U&&!_.locked){const X=_,$=B.pvModules[X.pvModelName];B.setSolarPanelOrientation(X,$,O)}})},T=(U,O,B)=>{e(_=>{for(const X of _.elements)if(X.type===z.SolarPanel&&!X.locked){let $;if(O?$=X.parentId===U&&me.isIdentical(X.normal,O):$=X.parentId===U,$){const Q=X,le=_.pvModules[Q.pvModelName];_.setSolarPanelOrientation(Q,le,B)}}})},A=U=>{e(O=>{for(const B of O.elements)if(B.type===z.SolarPanel&&!B.locked){const _=B,X=O.pvModules[_.pvModelName];O.setSolarPanelOrientation(_,X,U)}})},x=(U,O)=>{H.getState().set(B=>{for(const _ of B.elements)if(_.type===z.SolarPanel&&!_.locked&&U.has(_.id)){const X=_,$=B.pvModules[X.pvModelName];B.setSolarPanelOrientation(X,$,O)}})},S=U=>{c(U.target.value)},R=U=>{if(p){const O=r(p.pvModelName);if(U===vr.portrait){const B=Math.max(1,Math.round(p.lx/O.width)),_=Math.max(1,Math.round(p.ly/O.length));a(p.id,B*O.width,_*O.length)}else{const B=Math.max(1,Math.round(p.lx/O.length)),_=Math.max(1,Math.round(p.ly/O.width));a(p.id,B*O.length,_*O.width)}P(p.id,U)}},M=(U,O)=>{const B=i(U);if(B){if(B.type===z.Cuboid&&!me.isIdentical(U.normal,rs))return!0;const _=JSON.parse(JSON.stringify(U));_.orientation=O;const X=r(_.pvModelName);if(O===vr.portrait){const $=Math.max(1,Math.round(_.lx/X.width)),Q=Math.max(1,Math.round(_.ly/X.length));_.lx=$*X.width,_.ly=Q*X.length}else{const $=Math.max(1,Math.round(_.lx/X.length)),Q=Math.max(1,Math.round(_.ly/X.width));_.lx=$*X.length,_.ly=Q*X.width}return B.type===z.Wall?me.checkElementOnWallState(_,B)===ma.Valid:B.type===z.Roof?me.checkElementOnRoofState(_,B)===ma.Valid:me.isSolarCollectorWithinHorizontalSurface(_,B)}return!1},D=(U,O)=>!M(U,O),E=U=>{if(p){switch(s){case oe.AllSelectedObjectsOfThisType:{for(const O of n)if(O.type===z.SolarPanel&&!O.locked&&H.getState().selectedElementIdSet.has(O.id)&&O.orientation!==U)return!0;break}case oe.AllObjectsOfThisType:{for(const O of n)if(O.type===z.SolarPanel&&!O.locked&&O.orientation!==U)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const O of n)if(O.type===z.SolarPanel&&O.foundationId===(p==null?void 0:p.foundationId)&&!O.locked&&O.orientation!==U)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const O=i(p);if(O){if(O.type===z.Cuboid){for(const _ of n)if(_.type===z.SolarPanel&&_.parentId===p.parentId&&me.isIdentical(_.normal,p.normal)&&!_.locked&&_.orientation!==U)return!0}else for(const _ of n)if(_.type===z.SolarPanel&&_.parentId===p.parentId&&!_.locked&&_.orientation!==U)return!0}break}default:{if((p==null?void 0:p.orientation)!==U)return!0;break}}return!1}},W=U=>{if(p&&E(U)){switch(b.current=void 0,s){case oe.AllSelectedObjectsOfThisType:{w.current=!1;for(const O of n)if(O.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(O.id)&&D(O,U)){w.current=!0;break}if(w.current)b.current=U,y(p.orientation);else{const O=new Map;for(const _ of n)_.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(_.id)&&O.set(_.id,_.orientation);const B={name:"Set Orientation for Selected Solar Panels",timestamp:Date.now(),oldValues:O,newValue:U,undo:()=>{for(const[_,X]of B.oldValues.entries())P(_,X)},redo:()=>{x(B.oldValues,B.newValue)}};l(B),x(O,U),d(u+1)}break}case oe.AllObjectsOfThisType:{w.current=!1;for(const O of n)if(O.type===z.SolarPanel&&D(O,U)){w.current=!0;break}if(w.current)b.current=U,y(p.orientation);else{const O=new Map;for(const _ of n)_.type===z.SolarPanel&&O.set(_.id,_.orientation);const B={name:"Set Orientation for All Solar Panels",timestamp:Date.now(),oldValues:O,newValue:U,undo:()=>{for(const[_,X]of B.oldValues.entries())P(_,X)},redo:()=>{A(B.newValue)}};l(B),A(U),d(u+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){w.current=!1;for(const O of n)if(O.type===z.SolarPanel&&O.foundationId===p.foundationId&&D(O,U)){w.current=!0;break}if(w.current)b.current=U,y(p.orientation);else{const O=new Map;for(const _ of n)_.type===z.SolarPanel&&_.foundationId===p.foundationId&&O.set(_.id,_.orientation);const B={name:"Set Orientation for All Solar Panels Above Foundation",timestamp:Date.now(),oldValues:O,newValue:U,groupId:p.foundationId,undo:()=>{for(const[_,X]of B.oldValues.entries())P(_,X)},redo:()=>{B.groupId&&v(B.groupId,B.newValue)}};l(B),v(p.foundationId,U),d(u+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const O=i(p);if(O){if(w.current=!1,O.type===z.Cuboid){for(const _ of n)if(_.type===z.SolarPanel&&_.parentId===p.parentId&&me.isIdentical(_.normal,p.normal)&&D(_,U)){w.current=!0;break}}else for(const _ of n)if(_.type===z.SolarPanel&&_.parentId===p.parentId&&D(_,U)){w.current=!0;break}if(w.current)b.current=U,y(p.orientation);else{const _=new Map,X=O.type===z.Cuboid;if(X)for(const le of n)le.type===z.SolarPanel&&le.parentId===p.parentId&&me.isIdentical(le.normal,p.normal)&&_.set(le.id,le.orientation);else for(const le of n)le.type===z.SolarPanel&&le.parentId===p.parentId&&_.set(le.id,le.orientation);const $=X?p.normal:void 0,Q={name:"Set Orientation for All Solar Panels on Surface",timestamp:Date.now(),oldValues:_,newValue:U,groupId:p.parentId,normal:$,undo:()=>{for(const[le,q]of Q.oldValues.entries())P(le,q)},redo:()=>{Q.groupId&&T(Q.groupId,Q.normal,Q.newValue)}};l(Q),T(p.parentId,$,U),d(u+1)}}break}default:{const O=o(p.id),B=O?O.orientation:p.orientation;if(w.current=!1,w.current)b.current=U,y(B);else{const _={name:"Set Orientation of Selected Solar Panel",timestamp:Date.now(),oldValue:B,newValue:U,changedElementId:p.id,changedElementType:p.type,undo:()=>{R(_.oldValue)},redo:()=>{R(_.newValue)}};l(_),R(U),d(u+1)}break}}e(O=>{O.actionState.solarPanelOrientation=U})}},j=()=>{p&&(y(p.orientation),w.current=!1,t(!1))},L=()=>{j(),f()},k=()=>{W(g),w.current||(t(!1),d(0))},N=()=>{W(g)},F=w.current?": "+Y.t("message.NotApplicableToSelectedAction",C)+(b.current?" ("+(b.current===vr.portrait?Y.t("solarPanelMenu.Portrait",C):Y.t("solarPanelMenu.Landscape",C))+")":""):"";return h.jsx(so,{width:550,title:Y.t("solarPanelMenu.Orientation",C),rejectedMessage:F,onApply:N,onClose:j,onClickCancel:L,onClickOk:k,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:8,children:h.jsxs(_o,{style:{width:"150px"},value:g,onChange:U=>y(U),children:[h.jsx(MHe,{value:vr.portrait,children:Y.t("solarPanelMenu.Portrait",C)},vr.portrait),h.jsx(MHe,{value:vr.landscape,children:Y.t("solarPanelMenu.Landscape",C)},vr.landscape)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:S,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",C)})]})})})]})})},Nfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(t5),i=H(qr),a=H(En),l=H(zd),s=H(Dd),c=H(no),u=H(Zn),d=H(Vi),f=co(z.SolarPanel),[p,g]=m.useState((f==null?void 0:f.lx)??1),[y,w]=m.useState(0),b=m.useRef(!1),C=m.useRef(),P=Jt();m.useEffect(()=>{if(f){const O=r(f.pvModelName)??r("SPR-X21-335-BLK");w(f.orientation===vr.portrait?O.width:O.length)}},[f]);const v=(O,B)=>{e(_=>{for(const X of _.elements)if(X.type===z.SolarPanel&&X.id===O&&!X.locked){const $=X,Q=_.getPvModule($.pvModelName);X.lx=me.panelizeLx($,Q,B);break}})},T=(O,B)=>{e(_=>{for(const X of _.elements)if(X.type===z.SolarPanel&&X.foundationId===O&&!X.locked){const $=X,Q=_.getPvModule($.pvModelName);X.lx=me.panelizeLx($,Q,B)}})},A=(O,B,_)=>{e(X=>{for(const $ of X.elements)if($.type===z.SolarPanel&&!$.locked){let Q;if(B?Q=$.parentId===O&&me.isIdentical($.normal,B):Q=$.parentId===O,Q){const le=$,q=X.getPvModule(le.pvModelName);$.lx=me.panelizeLx(le,q,_)}}})},x=O=>{e(B=>{for(const _ of B.elements)if(_.type===z.SolarPanel&&!_.locked){const X=_,$=B.getPvModule(X.pvModelName);_.lx=me.panelizeLx(X,$,O)}})},S=(O,B)=>{H.getState().set(_=>{for(const X of _.elements)if(X.type===z.SolarPanel&&!X.locked&&O.has(X.id)){const $=X,Q=_.getPvModule($.pvModelName);X.lx=me.panelizeLx($,Q,B)}})},R=O=>{s(O.target.value)},M=(O,B)=>{const _=i(O);if(_){if(_.type===z.Cuboid&&!me.isIdentical(O.normal,rs))return!0;const X=JSON.parse(JSON.stringify(O));return X.lx=B,_.type===z.Wall?me.checkElementOnWallState(X,_)===ma.Valid:_.type===z.Roof?me.checkElementOnRoofState(X,_)===ma.Valid:me.isSolarCollectorWithinHorizontalSurface(X,_)}return!1},D=(O,B)=>!M(O,B),E=O=>{if(f){switch(l){case oe.AllSelectedObjectsOfThisType:{for(const B of n)if(B.type===z.SolarPanel&&!B.locked&&H.getState().selectedElementIdSet.has(B.id)&&Math.abs(B.lx-O)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const B of n)if(B.type===z.SolarPanel&&!B.locked&&Math.abs(B.lx-O)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const B of n)if(B.type===z.SolarPanel&&B.foundationId===(f==null?void 0:f.foundationId)&&!B.locked&&Math.abs(B.lx-O)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const B=i(f);if(B){if(B.type===z.Cuboid){for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&me.isIdentical(X.normal,f.normal)&&!X.locked&&Math.abs(X.lx-O)>It)return!0}else for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&!X.locked&&Math.abs(X.lx-O)>It)return!0}break}default:{if(Math.abs((f==null?void 0:f.lx)-O)>It)return!0;break}}return!1}},W=O=>{if(f&&E(O))switch(C.current=void 0,l){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const B of n)if(B.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(B.id)&&D(B,O)){b.current=!0;break}if(b.current)C.current=O,g(f.lx);else{const B=new Map;for(const X of n)X.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(X.id)&&B.set(X.id,X.lx);const _={name:"Set Length for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:B,newValue:O,undo:()=>{for(const[X,$]of _.oldValues.entries())v(X,$)},redo:()=>{S(_.oldValues,_.newValue)}};a(_),S(B,O),u(c+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const B of n)if(B.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(B.id)&&D(B,O)){b.current=!0;break}if(b.current)C.current=O,g(f.lx);else{const B=new Map;for(const X of n)X.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(X.id)&&B.set(X.id,X.lx);const _={name:"Set Length for All Solar Panel Arrays",timestamp:Date.now(),oldValues:B,newValue:O,undo:()=>{for(const[X,$]of _.oldValues.entries())v(X,$)},redo:()=>{x(_.newValue)}};a(_),x(O),u(c+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){b.current=!1;for(const B of n)if(B.type===z.SolarPanel&&B.foundationId===f.foundationId&&D(B,O)){b.current=!0;break}if(b.current)C.current=O,g(f.lx);else{const B=new Map;for(const X of n)X.type===z.SolarPanel&&X.foundationId===f.foundationId&&B.set(X.id,X.lx);const _={name:"Set Length for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:B,newValue:O,groupId:f.foundationId,undo:()=>{for(const[X,$]of _.oldValues.entries())v(X,$)},redo:()=>{_.groupId&&T(_.groupId,_.newValue)}};a(_),T(f.foundationId,O),u(c+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const B=i(f);if(B){if(b.current=!1,B.type===z.Cuboid){for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&me.isIdentical(X.normal,f.normal)&&D(X,O)){b.current=!0;break}}else for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&D(X,O)){b.current=!0;break}if(b.current)C.current=O,g(f.lx);else{const X=new Map,$=B.type===z.Cuboid;if($)for(const q of n)q.type===z.SolarPanel&&q.parentId===f.parentId&&me.isIdentical(q.normal,f.normal)&&X.set(q.id,q.lx);else for(const q of n)q.type===z.SolarPanel&&q.parentId===f.parentId&&X.set(q.id,q.lx);const Q=$?f.normal:void 0,le={name:"Set Length for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:X,newValue:O,groupId:f.parentId,normal:Q,undo:()=>{for(const[q,te]of le.oldValues.entries())v(q,te)},redo:()=>{le.groupId&&A(le.groupId,le.normal,le.newValue)}};a(le),A(f.parentId,Q,O),u(c+1)}}break}default:{const B=o(f.id),_=B?B.lx:f.lx;if(b.current=D(f,O),b.current)C.current=O,g(_);else{const X={name:"Set Solar Panel Array Length",timestamp:Date.now(),oldValue:_,newValue:O,changedElementId:f.id,changedElementType:f.type,undo:()=>{v(X.changedElementId,X.oldValue)},redo:()=>{v(X.changedElementId,X.newValue)}};a(X),v(f.id,O),u(c+1)}break}}},j=O=>{let B=O??1;return B=Math.max(1,Math.ceil((B-y/2)/y))*y,B},L=()=>{b.current=!1,t(!1)},k=()=>{L(),d()},N=()=>{W(p),b.current||(t(!1),u(0))},F=()=>{W(p)},U=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Length",P),rejectedMessage:U,onApply:F,onClose:L,onClickCancel:k,onClickOk:N,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:y,max:100*y,step:y,style:{width:120},precision:2,value:p,onChange:O=>{O!==null&&g(j(O))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Math.round(p/y)+" "+Y.t("solarPanelMenu.PanelsWide",P),h.jsx("br",{}),Y.t("word.MaximumNumber",P),": 100 ",Y.t("solarPanelMenu.Panels",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:R,value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",P)})]})})})]})})},Ufo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(t5),i=H(qr),a=H(En),l=H(zd),s=H(Dd),c=H(no),u=H(Zn),d=H(Vi),f=co(z.SolarPanel),[p,g]=m.useState((f==null?void 0:f.ly)??2),[y,w]=m.useState(0),b=m.useRef(!1),C=m.useRef(),P=Jt();m.useEffect(()=>{if(f){const O=r(f.pvModelName)??r("SPR-X21-335-BLK");w(f.orientation===vr.portrait?O.length:O.width),g(f.ly)}},[f]);const v=(O,B)=>{e(_=>{for(const X of _.elements)if(X.type===z.SolarPanel&&X.id===O&&!X.locked){const $=X,Q=_.getPvModule($.pvModelName);X.ly=me.panelizeLy($,Q,B);break}})},T=(O,B)=>{e(_=>{for(const X of _.elements)if(X.type===z.SolarPanel&&X.foundationId===O&&!X.locked){const $=X,Q=_.getPvModule($.pvModelName);X.ly=me.panelizeLy($,Q,B)}})},A=(O,B,_)=>{e(X=>{for(const $ of X.elements)if($.type===z.SolarPanel&&!$.locked){let Q;if(B?Q=$.parentId===O&&me.isIdentical($.normal,B):Q=$.parentId===O,Q){const le=$,q=X.getPvModule(le.pvModelName);$.ly=me.panelizeLy(le,q,_)}}})},x=O=>{e(B=>{for(const _ of B.elements)if(_.type===z.SolarPanel&&!_.locked){const X=_,$=B.getPvModule(X.pvModelName);_.ly=me.panelizeLy(X,$,O)}})},S=(O,B)=>{H.getState().set(_=>{for(const X of _.elements)if(X.type===z.SolarPanel&&!X.locked&&O.has(X.id)){const $=X,Q=_.getPvModule($.pvModelName);X.ly=me.panelizeLy($,Q,B)}})},R=O=>{s(O.target.value)},M=(O,B)=>{const _=i(O);if(_){if(_.type===z.Cuboid&&!me.isIdentical(O.normal,rs))return!0;const X=JSON.parse(JSON.stringify(O));return X.ly=B,_.type===z.Wall?me.checkElementOnWallState(X,_)===ma.Valid:_.type===z.Roof?me.checkElementOnRoofState(X,_)===ma.Valid:me.isSolarCollectorWithinHorizontalSurface(X,_)}return!1},D=(O,B)=>O.tiltAngle!==0&&.5*B*Math.abs(Math.sin(O.tiltAngle))>O.poleHeight||!M(O,B),E=O=>{if(f){switch(l){case oe.AllSelectedObjectsOfThisType:{for(const B of n)if(B.type===z.SolarPanel&&!B.locked&&H.getState().selectedElementIdSet.has(B.id)&&Math.abs(B.ly-O)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const B of n)if(B.type===z.SolarPanel&&!B.locked&&Math.abs(B.ly-O)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const B of n)if(B.type===z.SolarPanel&&B.foundationId===(f==null?void 0:f.foundationId)&&!B.locked&&Math.abs(B.ly-O)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const B=i(f);if(B){if(B.type===z.Cuboid){for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&me.isIdentical(X.normal,f.normal)&&!X.locked&&Math.abs(X.ly-O)>It)return!0}else for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&!X.locked&&Math.abs(X.ly-O)>It)return!0}break}default:{if(Math.abs((f==null?void 0:f.ly)-O)>It)return!0;break}}return!1}},W=O=>{if(f&&E(O))switch(C.current=void 0,l){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const B of n)if(B.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(B.id)&&D(B,O)){b.current=!0;break}if(b.current)C.current=O,g(f.ly);else{const B=new Map;for(const X of n)X.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(X.id)&&B.set(X.id,X.ly);const _={name:"Set Width for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:B,newValue:O,undo:()=>{for(const[X,$]of _.oldValues.entries())v(X,$)},redo:()=>{S(_.oldValues,_.newValue)}};a(_),S(B,O),u(c+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const B of n)if(B.type===z.SolarPanel&&D(B,O)){b.current=!0;break}if(b.current)C.current=O,g(f.ly);else{const B=new Map;for(const X of n)X.type===z.SolarPanel&&B.set(X.id,X.ly);const _={name:"Set Width for All Solar Panel Arrays",timestamp:Date.now(),oldValues:B,newValue:O,undo:()=>{for(const[X,$]of _.oldValues.entries())v(X,$)},redo:()=>{x(_.newValue)}};a(_),x(O),u(c+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){b.current=!1;for(const B of n)if(B.type===z.SolarPanel&&B.foundationId===f.foundationId&&D(B,O)){b.current=!0;break}if(b.current)C.current=O,g(f.ly);else{const B=new Map;for(const X of n)X.type===z.SolarPanel&&X.foundationId===f.foundationId&&B.set(X.id,X.ly);const _={name:"Set Width for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:B,newValue:O,groupId:f.foundationId,undo:()=>{for(const[X,$]of _.oldValues.entries())v(X,$)},redo:()=>{_.groupId&&T(_.groupId,_.newValue)}};a(_),T(f.foundationId,O),u(c+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const B=i(f);if(B){if(b.current=!1,B.type===z.Cuboid){for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&me.isIdentical(X.normal,f.normal)&&D(X,O)){b.current=!0;break}}else for(const X of n)if(X.type===z.SolarPanel&&X.parentId===f.parentId&&D(X,O)){b.current=!0;break}if(b.current)C.current=O,g(f.ly);else{const X=new Map,$=B.type===z.Cuboid;if($)for(const q of n)q.type===z.SolarPanel&&q.parentId===f.parentId&&me.isIdentical(q.normal,f.normal)&&X.set(q.id,q.ly);else for(const q of n)q.type===z.SolarPanel&&q.parentId===f.parentId&&X.set(q.id,q.ly);const Q=$?f.normal:void 0,le={name:"Set Width for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:X,newValue:O,groupId:f.parentId,normal:Q,undo:()=>{for(const[q,te]of le.oldValues.entries())v(q,te)},redo:()=>{le.groupId&&A(le.groupId,le.normal,le.newValue)}};a(le),A(f.parentId,Q,O),u(c+1)}}break}default:{const B=o(f.id),_=B?B.ly:f.ly;if(b.current=D(f,O),b.current)C.current=O,g(_);else{const X={name:"Set Solar Panel Array Width",timestamp:Date.now(),oldValue:_,newValue:O,changedElementId:f.id,changedElementType:f.type,undo:()=>{v(X.changedElementId,X.oldValue)},redo:()=>{v(X.changedElementId,X.newValue)}};a(X),v(f.id,O),u(c+1)}break}}},j=()=>{b.current=!1,t(!1)},L=()=>{j(),d()},k=()=>{W(p),b.current||(t(!1),u(0))},N=O=>{let B=O??1;return B=Math.max(1,Math.ceil((B-y/2)/y))*y,B},F=()=>{W(p)},U=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Width",P),rejectedMessage:U,onApply:F,onClose:j,onClickCancel:L,onClickOk:k,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:y,max:100*y,step:y,style:{width:120},precision:2,value:p,onChange:O=>{O!==null&&g(N(O))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Math.round(p/y)+" "+Y.t("solarPanelMenu.PanelsLong",P),h.jsx("br",{}),Y.t("word.MaximumNumber",P),": 100 ",Y.t("solarPanelMenu.Panels",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:R,value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",P)})]})})})]})})},jfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(zd),l=H(Dd),s=H(no),c=H(Zn),u=H(S=>S.elements.find(R=>R.selected&&R.type===z.SolarPanel)),[d,f]=m.useState((u==null?void 0:u.inverterEfficiency)??.95),p=Jt(),g=(S,R)=>{e(M=>{for(const D of M.elements)if(D.type===z.SolarPanel&&D.id===S&&!D.locked){D.inverterEfficiency=R;break}})},y=(S,R)=>{e(M=>{for(const D of M.elements)D.type===z.SolarPanel&&D.foundationId===S&&!D.locked&&(D.inverterEfficiency=R)})},w=(S,R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.SolarPanel&&!E.locked){let W;R?W=E.parentId===S&&me.isIdentical(E.normal,R):W=E.parentId===S,W&&(E.inverterEfficiency=M)}})},b=S=>{e(R=>{for(const M of R.elements)M.type===z.SolarPanel&&!M.locked&&(M.inverterEfficiency=S)})},C=(S,R)=>{H.getState().set(M=>{for(const D of M.elements)D.type===z.SolarPanel&&!D.locked&&S.has(D.id)&&(D.inverterEfficiency=R)})},P=S=>{l(S.target.value)},v=S=>{switch(a){case oe.AllSelectedObjectsOfThisType:{for(const R of n)if(R.type===z.SolarPanel&&!R.locked&&H.getState().selectedElementIdSet.has(R.id)&&Math.abs((R.inverterEfficiency??.95)-S)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const R of n)if(R.type===z.SolarPanel&&!R.locked&&Math.abs((R.inverterEfficiency??.95)-S)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const R of n)if(R.type===z.SolarPanel&&R.foundationId===(u==null?void 0:u.foundationId)&&!R.locked&&Math.abs((R.inverterEfficiency??.95)-S)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const R=r(u);if(R){if(R.type===z.Cuboid){for(const D of n)if(D.type===z.SolarPanel&&D.parentId===u.parentId&&me.isIdentical(D.normal,u.normal)&&!D.locked&&Math.abs((D.inverterEfficiency??.95)-S)>It)return!0}else for(const D of n)if(D.type===z.SolarPanel&&D.parentId===u.parentId&&!D.locked&&Math.abs((D.inverterEfficiency??.95)-S)>It)return!0}break}default:{if(Math.abs(((u==null?void 0:u.inverterEfficiency)??.95)-S)>It)return!0;break}}return!1},T=S=>{if(u&&v(S))switch(a){case oe.AllSelectedObjectsOfThisType:{const R=new Map;for(const D of n)D.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(D.id)&&R.set(D.id,D.inverterEfficiency??.95);const M={name:"Set Inverter Efficiency for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{C(M.oldValues,M.newValue)}};i(M),C(R,S),c(s+1);break}case oe.AllObjectsOfThisType:{const R=new Map;for(const D of n)D.type===z.SolarPanel&&R.set(D.id,D.inverterEfficiency??.95);const M={name:"Set Inverter Efficiency for All Solar Panel Arrays",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{b(M.newValue)}};i(M),b(S),c(s+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const R=new Map;for(const D of n)D.type===z.SolarPanel&&D.foundationId===u.foundationId&&R.set(D.id,D.inverterEfficiency??.95);const M={name:"Set Inverter Efficiency for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:R,newValue:S,groupId:u.foundationId,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{M.groupId&&y(M.groupId,M.newValue)}};i(M),y(u.foundationId,S),c(s+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{const R=r(u);if(R){const M=new Map,D=R.type===z.Cuboid;if(D)for(const j of n)j.type===z.SolarPanel&&j.parentId===u.parentId&&me.isIdentical(j.normal,u.normal)&&M.set(j.id,j.inverterEfficiency??.95);else for(const j of n)j.type===z.SolarPanel&&j.parentId===u.parentId&&M.set(j.id,j.inverterEfficiency??.95);const E=D?u.normal:void 0,W={name:"Set Inverter Efficiency for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:M,newValue:S,groupId:u.parentId,normal:E,undo:()=>{for(const[j,L]of W.oldValues.entries())g(j,L)},redo:()=>{W.groupId&&w(W.groupId,W.normal,W.newValue)}};i(W),w(u.parentId,E,S),c(s+1)}break}default:{const R=o(u.id),M=R?R.inverterEfficiency??.95:u.inverterEfficiency??.95,D={name:"Set Solar Panel Array Inverter Efficiency",timestamp:Date.now(),oldValue:M,newValue:S,changedElementId:u.id,changedElementType:u.type,undo:()=>{g(D.changedElementId,D.oldValue)},redo:()=>{g(D.changedElementId,D.newValue)}};i(D),g(u.id,S),c(s+1);break}}},A=()=>{t(!1)},x=()=>{T(d)};return h.jsx(so,{width:550,title:Y.t("solarPanelMenu.InverterEfficiency",p),onApply:x,onClose:A,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.5,max:1,step:.01,style:{width:120},precision:2,value:d,onChange:S=>{S!==null&&f(S)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:["[0.5, 1.0]",h.jsx("br",{}),Y.t("solarPanelMenu.InverterEfficiencyExplained",p)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",p)})]})})})]})})},Bfo=({setDialogVisible:t})=>{const e=H(fn),n=H(s0),o=H(Kn),r=H(Gn),i=H(qr),a=H(En),l=H(zd),s=H(Dd),c=H(no),u=H(Zn),d=H(Vi),f=H(F=>F.elements.find(U=>U.selected&&U.type===z.SolarPanel)),[p,g]=m.useState(!1),[y,w]=m.useState(!1),[b,C]=m.useState({left:0,top:0,bottom:0,right:0}),P=m.useRef(null),v=m.useRef((f==null?void 0:f.dcToAcRatio)??1),T={lng:n};m.useEffect(()=>{f&&(v.current=f.dcToAcRatio??1)},[f.dcToAcRatio]);const A=(F,U)=>{e(O=>{for(const B of O.elements)if(B.type===z.SolarPanel&&B.id===F&&!B.locked){B.dcToAcRatio=U;break}})},x=(F,U)=>{e(O=>{for(const B of O.elements)B.type===z.SolarPanel&&B.foundationId===F&&!B.locked&&(B.dcToAcRatio=U)})},S=(F,U,O)=>{e(B=>{for(const _ of B.elements)if(_.type===z.SolarPanel&&!_.locked){let X;U?X=_.parentId===F&&me.isIdentical(_.normal,U):X=_.parentId===F,X&&(_.dcToAcRatio=O)}})},R=F=>{e(U=>{for(const O of U.elements)O.type===z.SolarPanel&&!O.locked&&(O.dcToAcRatio=F)})},M=(F,U)=>{H.getState().set(O=>{for(const B of O.elements)B.type===z.SolarPanel&&!B.locked&&F.has(B.id)&&(B.dcToAcRatio=U)})},D=F=>{s(F.target.value),g(!p)},E=F=>{switch(l){case oe.AllSelectedObjectsOfThisType:{for(const U of o)if(U.type===z.SolarPanel&&!U.locked&&H.getState().selectedElementIdSet.has(U.id)&&Math.abs((U.dcToAcRatio??1)-F)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const U of o)if(U.type===z.SolarPanel&&!U.locked&&Math.abs((U.dcToAcRatio??1)-F)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const U of o)if(U.type===z.SolarPanel&&U.foundationId===(f==null?void 0:f.foundationId)&&!U.locked&&Math.abs((U.dcToAcRatio??1)-F)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const U=i(f);if(U){if(U.type===z.Cuboid){for(const B of o)if(B.type===z.SolarPanel&&B.parentId===f.parentId&&me.isIdentical(B.normal,f.normal)&&!B.locked&&Math.abs((B.dcToAcRatio??1)-F)>It)return!0}else for(const B of o)if(B.type===z.SolarPanel&&B.parentId===f.parentId&&!B.locked&&Math.abs((B.dcToAcRatio??1)-F)>It)return!0}break}default:{if(Math.abs(((f==null?void 0:f.dcToAcRatio)??1)-F)>It)return!0;break}}return!1},W=F=>{if(f&&E(F)){switch(l){case oe.AllSelectedObjectsOfThisType:{const U=new Map;for(const B of o)B.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(B.id)&&U.set(B.id,B.dcToAcRatio??1);const O={name:"Set DC-AC Ratio for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())A(B,_)},redo:()=>{M(O.oldValues,O.newValue)}};a(O),M(U,F),u(c+1);break}case oe.AllObjectsOfThisType:{const U=new Map;for(const B of o)B.type===z.SolarPanel&&U.set(B.id,B.dcToAcRatio??1);const O={name:"Set DC-AC Ratio for All Solar Panel Arrays",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())A(B,_)},redo:()=>{R(O.newValue)}};a(O),R(F),u(c+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const U=new Map;for(const B of o)B.type===z.SolarPanel&&B.foundationId===f.foundationId&&U.set(B.id,B.dcToAcRatio??1);const O={name:"Set DC-AC Ratio for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:U,newValue:F,groupId:f.foundationId,undo:()=>{for(const[B,_]of O.oldValues.entries())A(B,_)},redo:()=>{O.groupId&&x(O.groupId,O.newValue)}};a(O),x(f.foundationId,F),u(c+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{const U=i(f);if(U){const O=new Map,B=U.type===z.Cuboid;if(B)for(const $ of o)$.type===z.SolarPanel&&$.parentId===f.parentId&&me.isIdentical($.normal,f.normal)&&O.set($.id,$.dcToAcRatio??1);else for(const $ of o)$.type===z.SolarPanel&&$.parentId===f.parentId&&O.set($.id,$.dcToAcRatio??1);const _=B?f.normal:void 0,X={name:"Set DC-AC Ratio for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:O,newValue:F,groupId:f.parentId,normal:_,undo:()=>{for(const[$,Q]of X.oldValues.entries())A($,Q)},redo:()=>{X.groupId&&S(X.groupId,X.normal,X.newValue)}};a(X),S(f.parentId,_,F),u(c+1)}break}default:{const U=r(f.id),O=U?U.dcToAcRatio??1:f.dcToAcRatio??1,B={name:"Set Solar Panel Array DC-AC Ratio",timestamp:Date.now(),oldValue:O,newValue:F,changedElementId:f.id,changedElementType:f.type,undo:()=>{A(B.changedElementId,B.oldValue)},redo:()=>{A(B.changedElementId,B.newValue)}};a(B),A(f.id,F),u(c+1);break}}g(!p)}},j=(F,U)=>{if(P.current){const{clientWidth:O,clientHeight:B}=window.document.documentElement,_=P.current.getBoundingClientRect();C({left:-_.left+U.x,right:O-(_.right-U.x),top:-_.top+U.y,bottom:B-((_==null?void 0:_.bottom)-U.y)})}},L=()=>{v.current=f.dcToAcRatio??1,t(!1)},k=()=>{L(),d()},N=()=>{W(v.current),t(!1),u(0)};return h.jsx(h.Fragment,{children:h.jsx(Oi,{width:550,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>w(!0),onMouseOut:()=>w(!1),children:Y.t("solarPanelMenu.DcToAcSizeRatio",T)}),footer:[h.jsx(lo,{onClick:()=>{W(v.current)},children:Y.t("word.Apply",T)},"Apply"),h.jsx(lo,{onClick:k,children:Y.t("word.Cancel",T)},"Cancel"),h.jsx(lo,{type:"primary",onClick:N,children:Y.t("word.OK",T)},"OK")],onCancel:L,maskClosable:!1,destroyOnClose:!1,modalRender:F=>h.jsx(_i,{disabled:!y,bounds:b,onStart:(U,O)=>j(U,O),children:h.jsx("div",{ref:P,children:F})}),children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:2,step:.01,style:{width:120},precision:2,value:v.current,onChange:F=>{F!==null&&(v.current=F,g(!p))},onPressEnter:N}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:["[1.0, 2.0]",h.jsx("br",{}),Y.t("solarPanelMenu.DcToAcSizeRatioExplained",T)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:D,value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",T)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",T)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",T)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",T)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",T)})]})})})]})})})},IHe=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(lYe),i=H(qr),a=H(En),l=H(zd),s=H(Dd),c=H(no),u=H(Zn),d=H(Vi),f=co(z.SolarPanel),p=(f==null?void 0:f.tiltAngle)??0,g=(f==null?void 0:f.parentType)===z.Wall,[y,w]=m.useState(g?-p:p),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=(k,N,F)=>{e(U=>{for(const O of U.elements)if(O.type===z.SolarPanel&&O.foundationId===k&&!O.locked){const B=O;B.parentType===z.Wall?B.tiltAngle=Math.min(0,F?-N:N):B.tiltAngle=N}})},T=(k,N,F)=>{e(U=>{for(const O of U.elements)if(O.type===z.SolarPanel&&!O.locked){let B;if(N?B=O.parentId===k&&me.isIdentical(O.normal,N):B=O.parentId===k,B){const _=O;_.tiltAngle=F}}})},A=(k,N)=>{e(F=>{for(const U of F.elements)if(U.type===z.SolarPanel&&!U.locked){const O=U;O.parentType===z.Wall?O.tiltAngle=Math.min(0,N?-k:k):O.tiltAngle=k}})},x=(k,N,F)=>{H.getState().set(U=>{for(const O of U.elements)if(O.type===z.SolarPanel&&!O.locked&&k.has(O.id)){const B=O;B.parentType===z.Wall?B.tiltAngle=Math.min(0,F?-N:N):B.tiltAngle=N}})},S=k=>{s(k.target.value)},R=k=>{if(f){switch(l){case oe.AllSelectedObjectsOfThisType:{for(const N of n)if(N.type===z.SolarPanel&&!N.locked&&H.getState().selectedElementIdSet.has(N.id)&&Math.abs(N.tiltAngle-k)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const N of n)if(N.type===z.SolarPanel&&!N.locked&&Math.abs(N.tiltAngle-k)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const N of n)if(N.type===z.SolarPanel&&N.foundationId===(f==null?void 0:f.foundationId)&&!N.locked&&Math.abs(N.tiltAngle-k)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const N=i(f);if(N){if(N.type===z.Cuboid){for(const U of n)if(U.type===z.SolarPanel&&U.parentId===f.parentId&&me.isIdentical(U.normal,f.normal)&&!U.locked&&Math.abs(U.tiltAngle-k)>It)return!0}else for(const U of n)if(U.type===z.SolarPanel&&U.parentId===f.parentId&&!U.locked&&Math.abs(U.tiltAngle-k)>It)return!0}break}default:{if(Math.abs((f==null?void 0:f.tiltAngle)-k)>It)return!0;break}}return!1}},M=k=>{if(g&&(k=-k),!!f&&R(k)){switch(C.current=void 0,l){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const N of n)if(N.type===z.SolarPanel&&N.parentType!==z.Wall&&H.getState().selectedElementIdSet.has(N.id)&&.5*N.ly*Math.abs(Math.sin(k))>N.poleHeight){b.current=!0;break}if(b.current)C.current=k,w(f.tiltAngle);else{const N=new Map;for(const U of n)U.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(U.id)&&N.set(U.id,U.tiltAngle);const F={name:"Set Tilt Angle for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,O)},redo:()=>{x(F.oldValues,F.newValue,!g)}};a(F),x(N,k,!g),u(c+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const N of n)if(N.type===z.SolarPanel&&N.parentType!==z.Wall&&.5*N.ly*Math.abs(Math.sin(k))>N.poleHeight){b.current=!0;break}if(b.current)C.current=k,w(f.tiltAngle);else{const N=new Map;for(const U of n)U.type===z.SolarPanel&&N.set(U.id,U.tiltAngle);const F={name:"Set Tilt Angle for All Solar Panel Arrays",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,O)},redo:()=>{A(F.newValue,!g)}};a(F),A(k,!g),u(c+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){b.current=!1;for(const N of n)if(N.type===z.SolarPanel&&N.foundationId===f.foundationId&&N.parentType!==z.Wall&&.5*N.ly*Math.abs(Math.sin(k))>N.poleHeight){b.current=!0;break}if(b.current)C.current=k,w(f.tiltAngle);else{const N=new Map;for(const U of n)U.type===z.SolarPanel&&U.foundationId===f.foundationId&&N.set(U.id,U.tiltAngle);const F={name:"Set Tilt Angle for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:N,newValue:k,groupId:f.foundationId,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,O)},redo:()=>{F.groupId&&v(F.groupId,F.newValue,!g)}};a(F),v(f.foundationId,k,!g),u(c+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const N=i(f);if(N){b.current=!1;const F=N.type===z.Cuboid;if(F){for(const U of n)if(U.type===z.SolarPanel&&U.parentId===f.parentId&&me.isIdentical(U.normal,f.normal)&&.5*U.ly*Math.abs(Math.sin(k))>U.poleHeight){b.current=!0;break}}else if(f.parentType===z.Wall)b.current=!1;else for(const U of n)if(U.type===z.SolarPanel&&U.parentId===f.parentId&&.5*U.ly*Math.abs(Math.sin(k))>U.poleHeight){b.current=!0;break}if(b.current)C.current=k,w(f.tiltAngle);else{const U=new Map;if(F)for(const _ of n)_.type===z.SolarPanel&&_.parentId===f.parentId&&me.isIdentical(_.normal,f.normal)&&U.set(_.id,_.tiltAngle);else for(const _ of n)_.type===z.SolarPanel&&_.parentId===f.parentId&&U.set(_.id,_.tiltAngle);const O=F?f.normal:void 0,B={name:"Set Tilt Angle for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:U,newValue:k,groupId:f.parentId,normal:O,undo:()=>{for(const[_,X]of B.oldValues.entries())r(_,X)},redo:()=>{B.groupId&&T(B.groupId,B.normal,B.newValue)}};a(B),T(f.parentId,O,k),u(c+1)}}break}default:{const N=o(f.id),F=N?N.tiltAngle:f.tiltAngle;if(b.current=.5*f.ly*Math.abs(Math.sin(k))>f.poleHeight,f.parentType===z.Wall&&(b.current=!1),b.current)C.current=k,w(F);else{const U={name:"Set Solar Panel Array Tilt Angle",timestamp:Date.now(),oldValue:F,newValue:k,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(U.changedElementId,U.oldValue)},redo:()=>{r(U.changedElementId,U.newValue)}};a(U),r(f.id,k),u(c+1)}break}}e(N=>{N.actionState.solarPanelTiltAngle=k})}},D=()=>{b.current=!1,t(!1)},E=()=>{D(),d()},W=()=>{M(y),b.current||(t(!1),u(0))},j=()=>{M(y)},L=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+me.toDegrees(C.current).toFixed(1)+"°)":null):null;return h.jsx(so,{width:550,title:Y.t("solarPanelMenu.TiltAngle",P),rejectedMessage:L,onApply:j,onClose:D,onClickCancel:E,onClickOk:W,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:g?0:-90,max:90,style:{width:120},precision:2,value:parseFloat(me.toDegrees(y).toFixed(2)),step:1,formatter:k=>`${k}°`,onChange:k=>{k!==null&&w(me.toRadians(k))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",P),": [",g?"0°":"-90°",", 90°]",h.jsx("br",{}),Y.t("solarPanelMenu.SouthFacingIsPositive",P)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:18,children:h.jsx(Ue.Group,{onChange:S,value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",P)})]})})})]})})},Yfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(Jq),i=H(dYe),a=H(fYe),l=H(hYe),s=H(qr),c=H(En),u=H(zd),d=H(Dd),f=H(no),p=H(Zn),g=H(Vi),y=co(z.SolarPanel),w=m.useRef(!1),b=m.useRef(),[C,P]=m.useState(y?-y.relativeAzimuth:0),v=Jt(),T=k=>{d(k.target.value)},A=(k,N)=>{const F=s(k);if(F){if(F.type===z.Cuboid&&!me.isIdentical(k.normal,rs))return!0;const U=JSON.parse(JSON.stringify(k));return U.relativeAzimuth=-N,F.type===z.Roof?me.checkElementOnRoofState(U,F)===ma.Valid:me.isSolarCollectorWithinHorizontalSurface(U,F)}return!1},x=(k,N)=>!A(k,N),S=k=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:for(const N of n)if(N.type===z.SolarPanel&&!N.locked&&N.parentType!==z.Wall&&H.getState().selectedElementIdSet.has(N.id)&&Math.abs(-N.relativeAzimuth-k)>It)return!0;break;case oe.AllObjectsOfThisType:for(const N of n)if(N.type===z.SolarPanel&&!N.locked&&N.parentType!==z.Wall&&Math.abs(-N.relativeAzimuth-k)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const N of n)if(N.type===z.SolarPanel&&N.foundationId===(y==null?void 0:y.foundationId)&&!N.locked&&N.parentType!==z.Wall&&Math.abs(-N.relativeAzimuth-k)>It)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:if(y!=null&&y.parentId){const N=s(y);if(N){if(N.type===z.Cuboid){for(const U of n)if(U.type===z.SolarPanel&&U.parentId===y.parentId&&me.isIdentical(U.normal,y.normal)&&!U.locked&&Math.abs(-U.relativeAzimuth-k)>It)return!0}else for(const U of n)if(U.type===z.SolarPanel&&U.parentId===y.parentId&&!U.locked&&Math.abs(-U.relativeAzimuth-k)>It)return!0}}break;default:if(Math.abs(-(y==null?void 0:y.relativeAzimuth)-k)>It)return!0}return!1}},R=(k,N)=>{H.getState().set(F=>{for(const U of F.elements)if(U.type===z.SolarPanel&&!U.locked&&k.has(U.id)){const O=U;O.relativeAzimuth=N}})},M=k=>{if(y&&S(k)){switch(b.current=void 0,u){case oe.AllSelectedObjectsOfThisType:{w.current=!1;for(const N of n)if(N.type===z.SolarPanel&&N.parentType!==z.Wall&&H.getState().selectedElementIdSet.has(N.id)&&x(N,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const N=new Map;for(const U of n)U.type===z.SolarPanel&&U.parentType!==z.Wall&&H.getState().selectedElementIdSet.has(U.id)&&N.set(U.id,-U.relativeAzimuth);const F={name:"Set Relative Azimuth for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,-O)},redo:()=>{R(F.oldValues,F.newValue)}};c(F),R(N,-k),p(f+1)}break}case oe.AllObjectsOfThisType:{w.current=!1;for(const N of n)if(N.type===z.SolarPanel&&N.parentType!==z.Wall&&x(N,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const N=new Map;for(const U of n)U.type===z.SolarPanel&&U.parentType!==z.Wall&&N.set(U.id,-U.relativeAzimuth);const F={name:"Set Relative Azimuth for All Solar Panel Arrays",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,-O)},redo:()=>{l(z.SolarPanel,-F.newValue)}};c(F),l(z.SolarPanel,-k),p(f+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(y.foundationId){w.current=!1;for(const N of n)if(N.type===z.SolarPanel&&N.foundationId===y.foundationId&&N.parentType!==z.Wall&&x(N,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const N=new Map;for(const U of n)U.type===z.SolarPanel&&U.foundationId===y.foundationId&&U.parentType!==z.Wall&&N.set(U.id,-U.relativeAzimuth);const F={name:"Set Relative Azimuth for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:N,newValue:k,groupId:y.foundationId,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,-O)},redo:()=>{F.groupId&&a(z.SolarPanel,F.groupId,-F.newValue)}};c(F),a(z.SolarPanel,y.foundationId,-k),p(f+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{if(y.parentId){const N=s(y);if(N){if(w.current=!1,N.type===z.Cuboid){for(const U of n)if(U.type===z.SolarPanel&&U.parentId===y.parentId&&me.isIdentical(U.normal,y.normal)&&x(U,k)){w.current=!0;break}}else for(const U of n)if(U.type===z.SolarPanel&&U.parentId===y.parentId&&x(U,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const U=new Map,O=N.type===z.Cuboid;if(O)for(const X of n)X.type===z.SolarPanel&&X.parentId===y.parentId&&me.isIdentical(X.normal,y.normal)&&U.set(X.id,-X.relativeAzimuth);else for(const X of n)X.type===z.SolarPanel&&X.parentId===y.parentId&&U.set(X.id,-X.relativeAzimuth);const B=O?y.normal:void 0,_={name:"Set Relative Azimuth for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:U,newValue:k,groupId:y.parentId,normal:B,undo:()=>{for(const[X,$]of _.oldValues.entries())r(X,-$)},redo:()=>{_.groupId&&i(z.SolarPanel,_.groupId,_.normal,-_.newValue)}};c(_),i(z.SolarPanel,y.parentId,B,-k),p(f+1)}}}break}default:{const N=o(y.id),F=N?-N.relativeAzimuth:-y.relativeAzimuth;if(w.current=x(y,k),w.current)b.current=k,P(F);else{const U={name:"Set Solar Panel Array Relative Azimuth",timestamp:Date.now(),oldValue:F,newValue:k,changedElementId:y.id,changedElementType:y.type,undo:()=>{r(U.changedElementId,-U.oldValue)},redo:()=>{r(U.changedElementId,-U.newValue)}};c(U),r(y.id,-k),p(f+1)}break}}e(N=>{N.actionState.solarPanelRelativeAzimuth=-k})}},D=()=>{w.current=!1,t(!1)},E=()=>{D(),g()},W=()=>{M(C),w.current||(t(!1),p(0))},j=()=>{M(C)},L=w.current?": "+Y.t("message.NotApplicableToSelectedAction",v)+(b.current!==void 0?" ("+me.toDegrees(b.current).toFixed(1)+"°)":null):null;return h.jsx(so,{width:550,title:Y.t("solarCollectorMenu.RelativeAzimuth",v),rejectedMessage:L,onApply:j,onClose:D,onClickCancel:E,onClickOk:W,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:-180,max:180,style:{width:120},precision:2,step:1,value:parseFloat(me.toDegrees(C).toFixed(2)),formatter:k=>`${k}°`,onChange:k=>{k!==null&&P(me.toRadians(k))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",v),": [-180°, 180°]",h.jsx("br",{}),Y.t("message.AzimuthOfNorthIsZero",v),h.jsx("br",{}),Y.t("message.CounterclockwiseAzimuthIsPositive",v)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:18,children:h.jsx(Ue.Group,{onChange:T,value:u,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",v)})]})})})]})})},Ofo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(zd),l=H(Dd),s=H(no),c=H(Zn),u=co(),[d,f]=m.useState((u==null?void 0:u.trackerType)??za.NO_TRACKER),p=Jt(),{Option:g}=_o,y=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.SolarPanel&&E.id===R&&!E.locked){E.trackerType=M;break}})},w=(R,M)=>{e(D=>{for(const E of D.elements)E.type===z.SolarPanel&&E.foundationId===R&&!E.locked&&(E.trackerType=M)})},b=(R,M,D)=>{e(E=>{for(const W of E.elements)if(W.type===z.SolarPanel&&!W.locked){let j;M?j=W.parentId===R&&me.isIdentical(W.normal,M):j=W.parentId===R,j&&(W.trackerType=D)}})},C=R=>{e(M=>{for(const D of M.elements)D.type===z.SolarPanel&&!D.locked&&(D.trackerType=R)})},P=(R,M)=>{H.getState().set(D=>{for(const E of D.elements)E.type===z.SolarPanel&&!E.locked&&R.has(E.id)&&(E.trackerType=M)})},v=R=>{l(R.target.value)},T=R=>{if(u){switch(a){case oe.AllSelectedObjectsOfThisType:{for(const M of n)if(M.type===z.SolarPanel&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&M.trackerType!==R)return!0;break}case oe.AllObjectsOfThisType:{for(const M of n)if(M.type===z.SolarPanel&&!M.locked&&M.trackerType!==R)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const M of n)if(M.type===z.SolarPanel&&M.foundationId===(u==null?void 0:u.foundationId)&&!M.locked&&M.trackerType!==R)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const M=r(u);if(M){if(M.type===z.Cuboid){for(const E of n)if(E.type===z.SolarPanel&&E.parentId===u.parentId&&me.isIdentical(E.normal,u.normal)&&!E.locked&&E.trackerType!==R)return!0}else for(const E of n)if(E.type===z.SolarPanel&&E.parentId===u.parentId&&!E.locked&&E.trackerType!==R)return!0}break}default:{if((u==null?void 0:u.trackerType)!==R)return!0;break}}return!1}},A=R=>{if(u&&T(R))switch(a){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E.trackerType);const D={name:"Set Tracker Type for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{P(D.oldValues,D.newValue)}};i(D),P(M,R),c(s+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.SolarPanel&&M.set(E.id,E.trackerType);const D={name:"Set Tracker Type for All Solar Panel Arrays",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{C(D.newValue)}};i(D),C(R),c(s+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const M=new Map;for(const E of n)E.type===z.SolarPanel&&E.foundationId===u.foundationId&&M.set(E.id,E.trackerType);const D={name:"Set Tracker Type for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:M,newValue:R,groupId:u.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())y(E,W)},redo:()=>{D.groupId&&w(D.groupId,D.newValue)}};i(D),w(u.foundationId,R),c(s+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{const M=r(u);if(M){const D=new Map,E=M.type===z.Cuboid;if(E)for(const L of n)L.type===z.SolarPanel&&L.parentId===u.parentId&&me.isIdentical(L.normal,u.normal)&&D.set(L.id,L.trackerType);else for(const L of n)L.type===z.SolarPanel&&L.parentId===u.parentId&&D.set(L.id,L.trackerType);const W=E?u.normal:void 0,j={name:"Set Tracker Type for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:D,newValue:R,groupId:u.parentId,normal:W,undo:()=>{for(const[L,k]of j.oldValues.entries())y(L,k)},redo:()=>{j.groupId&&b(j.groupId,j.normal,j.newValue)}};i(j),b(u.parentId,W,R),c(s+1)}break}default:{const M=o(u.id),D=M?M.trackerType:u.trackerType,E={name:"Set Solar Panel Array Tracker Type",timestamp:Date.now(),oldValue:D,newValue:R,changedElementId:u.id,changedElementType:u.type,undo:()=>{y(E.changedElementId,E.oldValue)},redo:()=>{y(E.changedElementId,E.newValue)}};i(E),y(u.id,R),c(s+1);break}}},x=()=>{t(!1)},S=()=>{A(d)};return h.jsx(so,{width:550,title:Y.t("solarPanelMenu.Tracker",p),onApply:S,onClose:x,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsxs(_o,{style:{width:"120px"},value:d,onChange:R=>f(R),children:[h.jsx(g,{value:za.NO_TRACKER,title:Y.t("solarPanelMenu.NoTracker",p),children:Y.t("word.None",p)},"NONE"),h.jsx(g,{value:za.HORIZONTAL_SINGLE_AXIS_TRACKER,title:Y.t("solarPanelMenu.HorizontalSingleAxisTracker",p),children:"HSAT"},"HSAT"),h.jsx(g,{value:za.VERTICAL_SINGLE_AXIS_TRACKER,title:Y.t("solarPanelMenu.VerticalSingleAxisTracker",p),children:"VSAT"},"VSAT"),h.jsx(g,{value:za.ALTAZIMUTH_DUAL_AXIS_TRACKER,title:Y.t("solarPanelMenu.AltazimuthDualAxisTracker",p),children:"AADAT"},"AADAT")]}),h.jsx("div",{style:{paddingTop:"20px",paddingRight:"10px",textAlign:"left",fontSize:"11px"},children:Y.t("solarPanelMenu.SolarTrackerFollowsSun",p)})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",p)})]})})})]})})},_fo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(zd),l=H(Dd),s=H(no),c=H(Zn),u=co(z.SolarPanel),[d,f]=m.useState((u==null?void 0:u.frameColor)??"white"),p=Jt(),g=(S,R)=>{e(M=>{for(const D of M.elements)if(D.type===z.SolarPanel&&D.id===S&&!D.locked){D.frameColor=R;break}})},y=(S,R)=>{e(M=>{for(const D of M.elements)D.type===z.SolarPanel&&D.foundationId===S&&!D.locked&&(D.frameColor=R)})},w=(S,R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.SolarPanel&&!E.locked){let W;R?W=E.parentId===S&&me.isIdentical(E.normal,R):W=E.parentId===S,W&&(E.frameColor=M)}})},b=S=>{e(R=>{for(const M of R.elements)M.type===z.SolarPanel&&!M.locked&&(M.frameColor=S)})},C=(S,R)=>{H.getState().set(M=>{for(const D of M.elements)D.type===z.SolarPanel&&!D.locked&&S.has(D.id)&&(D.frameColor=R)})},P=S=>{l(S.target.value)},v=S=>{if(u){switch(a){case oe.AllSelectedObjectsOfThisType:{for(const R of n)if(R.type===z.SolarPanel&&!R.locked&&H.getState().selectedElementIdSet.has(R.id)&&R.frameColor!==S)return!0;break}case oe.AllObjectsOfThisType:{for(const R of n)if(R.type===z.SolarPanel&&!R.locked&&R.frameColor!==S)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const R of n)if(R.type===z.SolarPanel&&R.foundationId===(u==null?void 0:u.foundationId)&&!R.locked&&R.frameColor!==S)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const R=r(u);if(R){if(R.type===z.Cuboid){for(const D of n)if(D.type===z.SolarPanel&&D.parentId===u.parentId&&me.isIdentical(D.normal,u.normal)&&!D.locked&&D.frameColor!==S)return!0}else for(const D of n)if(D.type===z.SolarPanel&&D.parentId===u.parentId&&!D.locked&&D.frameColor!==S)return!0}break}default:{if((u==null?void 0:u.frameColor)!==S)return!0;break}}return!1}},T=S=>{if(u&&v(S)){switch(a){case oe.AllSelectedObjectsOfThisType:{const R=new Map;for(const D of n)D.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(D.id)&&R.set(D.id,D.frameColor??"white");const M={name:"Set Frame Color for Selected Solar Panels",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{C(M.oldValues,M.newValue)}};i(M),C(R,S),c(s+1);break}case oe.AllObjectsOfThisType:{const R=new Map;for(const D of n)D.type===z.SolarPanel&&R.set(D.id,D.frameColor??"white");const M={name:"Set Frame Color for All Solar Panels",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{b(M.newValue)}};i(M),b(S),c(s+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const R=new Map;for(const D of n)D.type===z.SolarPanel&&D.foundationId===u.foundationId&&R.set(D.id,D.frameColor??"white");const M={name:"Set Frame Color for All Solar Panels Above Foundation",timestamp:Date.now(),oldValues:R,newValue:S,groupId:u.foundationId,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{M.groupId&&y(M.groupId,M.newValue)}};i(M),y(u.foundationId,S),c(s+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{const R=r(u);if(R){const M=new Map,D=R.type===z.Cuboid;if(D)for(const j of n)j.type===z.SolarPanel&&j.parentId===u.parentId&&me.isIdentical(j.normal,u.normal)&&M.set(j.id,j.frameColor??"white");else for(const j of n)j.type===z.SolarPanel&&j.parentId===u.parentId&&M.set(j.id,j.frameColor??"white");const E=D?u.normal:void 0,W={name:"Set Frame Color for All Solar Panels on Surface",timestamp:Date.now(),oldValues:M,newValue:S,groupId:u.parentId,normal:E,undo:()=>{for(const[j,L]of W.oldValues.entries())g(j,L)},redo:()=>{W.groupId&&w(W.groupId,W.normal,W.newValue)}};i(W),w(u.parentId,E,S),c(s+1)}break}default:{const R=o(u.id),M=R?R.frameColor:u.frameColor,D={name:"Set Frame Color of Selected Solar Panel",timestamp:Date.now(),oldValue:M,newValue:S,changedElementId:u.id,changedElementType:u.type,undo:()=>{g(u.id,D.oldValue)},redo:()=>{g(u.id,D.newValue)}};i(D),g(u.id,S),c(s+1);break}}e(R=>{R.actionState.solarPanelFrameColor=S})}},A=()=>{t(!1)},x=()=>{T(d)};return h.jsx(so,{width:680,title:Y.t("solarPanelMenu.FrameColor",p),onApply:x,onClose:A,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:10,children:h.jsx(zf,{color:d??(u==null?void 0:u.color)??"white",onChangeComplete:S=>{f(S.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:14,children:h.jsx(Ue.Group,{onChange:P,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",p)})]})})})]})})},Vfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(wW),i=H(i7t),a=H(vW),l=H(xW),s=H(qr),c=H(En),u=H(zd),d=H(Dd),f=H(no),p=H(Zn),g=H(Vi),y=co(z.SolarPanel),[w,b]=m.useState((y==null?void 0:y.poleHeight)??0),C=m.useRef(!1),P=m.useRef(),v=Jt(),T=j=>{d(j.target.value)},A=j=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:{for(const L of n)if(L.type===z.SolarPanel&&!L.locked&&H.getState().selectedElementIdSet.has(L.id)&&Math.abs(L.poleHeight-j)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const L of n)if(L.type===z.SolarPanel&&!L.locked&&Math.abs(L.poleHeight-j)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const L of n)if(L.type===z.SolarPanel&&L.foundationId===(y==null?void 0:y.foundationId)&&!L.locked&&Math.abs(L.poleHeight-j)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const L=s(y);if(L){if(L.type===z.Cuboid){for(const N of n)if(N.type===z.SolarPanel&&N.parentId===y.parentId&&me.isIdentical(N.normal,y.normal)&&!N.locked&&Math.abs(N.poleHeight-j)>It)return!0}else for(const N of n)if(N.type===z.SolarPanel&&N.parentId===y.parentId&&!N.locked&&Math.abs(N.poleHeight-j)>It)return!0}break}default:{if(Math.abs((y==null?void 0:y.poleHeight)-j)>It)return!0;break}}return!1}},x=(j,L)=>{H.getState().set(k=>{for(const N of k.elements)if(N.type===z.SolarPanel&&!N.locked&&j.has(N.id)){const F=N;F.poleHeight=L}})},S=j=>{if(y&&A(j)){switch(P.current=void 0,u){case oe.AllSelectedObjectsOfThisType:{C.current=!1;for(const L of n)if(L.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(L.id)&&.5*L.ly*Math.abs(Math.sin(L.tiltAngle))>j){C.current=!0;break}if(C.current)P.current=j,b(y.poleHeight);else{const L=new Map;for(const N of n)N.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(N.id)&&L.set(N.id,N.poleHeight);const k={name:"Set Pole Height for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:L,newValue:j,undo:()=>{for(const[N,F]of k.oldValues.entries())r(N,F)},redo:()=>{x(k.oldValues,k.newValue)}};c(k),x(L,j),p(f+1)}break}case oe.AllObjectsOfThisType:{C.current=!1;for(const L of n)if(L.type===z.SolarPanel&&.5*L.ly*Math.abs(Math.sin(L.tiltAngle))>j){C.current=!0;break}if(C.current)P.current=j,b(y.poleHeight);else{const L=new Map;for(const N of n)N.type===z.SolarPanel&&L.set(N.id,N.poleHeight);const k={name:"Set Pole Height for All Solar Panel Arrays",timestamp:Date.now(),oldValues:L,newValue:j,undo:()=>{for(const[N,F]of k.oldValues.entries())r(N,F)},redo:()=>{l(z.SolarPanel,k.newValue)}};c(k),l(z.SolarPanel,j),p(f+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(y.foundationId){C.current=!1;for(const L of n)if(L.type===z.SolarPanel&&L.foundationId===y.foundationId&&.5*L.ly*Math.abs(Math.sin(L.tiltAngle))>j){C.current=!0;break}if(C.current)P.current=j,b(y.poleHeight);else{const L=new Map;for(const N of n)N.type===z.SolarPanel&&N.foundationId===y.foundationId&&L.set(N.id,N.poleHeight);const k={name:"Set Pole Height for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:L,newValue:j,groupId:y.foundationId,undo:()=>{for(const[N,F]of k.oldValues.entries())r(N,F)},redo:()=>{k.groupId&&a(z.SolarPanel,k.groupId,k.newValue)}};c(k),a(z.SolarPanel,y.foundationId,j),p(f+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const L=s(y);if(L){if(C.current=!1,L.type===z.Cuboid){for(const N of n)if(N.type===z.SolarPanel&&N.parentId===y.parentId&&me.isIdentical(N.normal,y.normal)&&.5*N.ly*Math.abs(Math.sin(N.tiltAngle))>j){C.current=!0;break}}else for(const N of n)if(N.type===z.SolarPanel&&N.parentId===y.parentId&&.5*N.ly*Math.abs(Math.sin(N.tiltAngle))>j){C.current=!0;break}if(C.current)P.current=j,b(y.poleHeight);else{const N=new Map,F=L.type===z.Cuboid;if(F)for(const B of n)B.type===z.SolarPanel&&B.parentId===y.parentId&&me.isIdentical(B.normal,y.normal)&&N.set(B.id,B.poleHeight);else for(const B of n)B.type===z.SolarPanel&&B.parentId===y.parentId&&N.set(B.id,B.poleHeight);const U=F?y.normal:void 0,O={name:"Set Pole Height for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:N,newValue:j,groupId:y.parentId,normal:U,undo:()=>{for(const[B,_]of O.oldValues.entries())r(B,_)},redo:()=>{O.groupId&&i(z.SolarPanel,O.groupId,O.normal,O.newValue)}};c(O),i(z.SolarPanel,y.parentId,U,j),p(f+1)}}break}default:{const L=o(y.id),k=L?L.poleHeight:y.poleHeight;if(C.current=.5*y.ly*Math.abs(Math.sin(y.tiltAngle))>j,C.current)P.current=j,b(k);else{const N={name:"Set Solar Panel Array Pole Height",timestamp:Date.now(),oldValue:k,newValue:j,changedElementId:y.id,changedElementType:y.type,undo:()=>{r(N.changedElementId,N.oldValue)},redo:()=>{r(N.changedElementId,N.newValue)}};c(N),r(y.id,j),p(f+1)}break}}e(L=>{L.actionState.solarPanelPoleHeight=j})}},R=()=>{C.current=!1,t(!1)},M=()=>{R(),g()},D=()=>{S(w),C.current||(t(!1),p(0))},E=()=>{S(w)},W=C.current?": "+Y.t("message.NotApplicableToSelectedAction",v)+(P.current!==void 0?" ("+P.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("solarCollectorMenu.PoleHeight",v),rejectedMessage:W,onApply:E,onClose:R,onClickCancel:M,onClickOk:D,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:10,style:{width:120},step:.1,precision:2,value:w,onChange:j=>{j!==null&&b(j)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",v),": [0, 10] ",Y.t("word.MeterAbbreviation",v)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",v)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:T,value:u,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",v)})]})})})]})})},Gfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(zd),l=H(Dd),s=H(no),c=H(Zn),u=co(z.SolarPanel),[d,f]=m.useState((u==null?void 0:u.poleSpacing)??0),p=Jt(),g=(S,R)=>{e(M=>{for(const D of M.elements)if(D.type===z.SolarPanel&&D.id===S&&!D.locked){const E=D;E.poleSpacing=R;break}})},y=(S,R)=>{e(M=>{for(const D of M.elements)if(D.type===z.SolarPanel&&D.foundationId===S&&!D.locked){const E=D;E.poleSpacing=R}})},w=(S,R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.SolarPanel&&!E.locked){let W;if(R?W=E.parentId===S&&me.isIdentical(E.normal,R):W=E.parentId===S,W){const j=E;j.poleSpacing=M}}})},b=S=>{e(R=>{for(const M of R.elements)if(M.type===z.SolarPanel&&!M.locked){const D=M;D.poleSpacing=S}})},C=(S,R)=>{H.getState().set(M=>{for(const D of M.elements)if(D.type===z.SolarPanel&&!D.locked&&S.has(D.id)){const E=D;E.poleSpacing=R}})},P=S=>{l(S.target.value)},v=S=>{if(u){switch(a){case oe.AllSelectedObjectsOfThisType:{for(const R of n)if(R.type===z.SolarPanel&&!R.locked&&H.getState().selectedElementIdSet.has(R.id)&&Math.abs(R.poleSpacing-S)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const R of n)if(R.type===z.SolarPanel&&!R.locked&&Math.abs(R.poleSpacing-S)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const R of n)if(R.type===z.SolarPanel&&R.foundationId===(u==null?void 0:u.foundationId)&&!R.locked&&Math.abs(R.poleSpacing-S)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const R=r(u);if(R){if(R.type===z.Cuboid){for(const D of n)if(D.type===z.SolarPanel&&D.parentId===u.parentId&&me.isIdentical(D.normal,u.normal)&&!D.locked&&Math.abs(D.poleSpacing-S)>It)return!0}else for(const D of n)if(D.type===z.SolarPanel&&D.parentId===u.parentId&&!D.locked&&Math.abs(D.poleSpacing-S)>It)return!0}break}default:{if(Math.abs((u==null?void 0:u.poleSpacing)-S)>It)return!0;break}}return!1}},T=S=>{if(u&&v(S)){switch(a){case oe.AllSelectedObjectsOfThisType:{const R=new Map;for(const D of n)D.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(D.id)&&R.set(D.id,D.poleSpacing);const M={name:"Set Pole Spacing for Selected Solar Panel Arrays",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{C(M.oldValues,M.newValue)}};i(M),C(R,S),c(s+1);break}case oe.AllObjectsOfThisType:{const R=new Map;for(const D of n)D.type===z.SolarPanel&&R.set(D.id,D.poleSpacing);const M={name:"Set Pole Spacing for All Solar Panel Arrays",timestamp:Date.now(),oldValues:R,newValue:S,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{b(M.newValue)}};i(M),b(S),c(s+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const R=new Map;for(const D of n)D.type===z.SolarPanel&&D.foundationId===u.foundationId&&R.set(D.id,D.poleSpacing);const M={name:"Set Pole Spacing for All Solar Panel Arrays Above Foundation",timestamp:Date.now(),oldValues:R,newValue:S,groupId:u.foundationId,undo:()=>{for(const[D,E]of M.oldValues.entries())g(D,E)},redo:()=>{M.groupId&&y(M.groupId,M.newValue)}};i(M),y(u.foundationId,S),c(s+1)}break}case oe.AllObjectsOfThisTypeOnSurface:{const R=r(u);if(R){const M=new Map,D=R.type===z.Cuboid;if(D)for(const j of n)j.type===z.SolarPanel&&j.parentId===u.parentId&&me.isIdentical(j.normal,u.normal)&&M.set(j.id,j.poleSpacing);else for(const j of n)j.type===z.SolarPanel&&j.parentId===u.parentId&&M.set(j.id,j.poleSpacing);const E=D?u.normal:void 0,W={name:"Set Pole Spacing for All Solar Panel Arrays on Surface",timestamp:Date.now(),oldValues:M,newValue:S,groupId:u.parentId,normal:E,undo:()=>{for(const[j,L]of W.oldValues.entries())g(j,L)},redo:()=>{W.groupId&&w(W.groupId,W.normal,W.newValue)}};i(W),w(u.parentId,E,S),c(s+1)}break}default:{const R=o(u.id),M=R?R.poleSpacing:u.poleSpacing,D={name:"Set Solar Panel Array Pole Spacing",timestamp:Date.now(),oldValue:M,newValue:S,changedElementId:u.id,changedElementType:u.type,undo:()=>{g(D.changedElementId,D.oldValue)},redo:()=>{g(D.changedElementId,D.newValue)}};i(D),g(u.id,S),c(s+1);break}}e(R=>{R.actionState.solarPanelPoleSpacing=S})}},A=()=>{t(!1)},x=()=>{T(d),t(!1),c(0)};return h.jsx(so,{width:550,title:Y.t("solarPanelMenu.PoleSpacing",p),onApply:x,onClose:A,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:10,step:1,style:{width:120},precision:2,value:d,onChange:S=>{S!==null&&f(S)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [1, 10] ",Y.t("word.MeterAbbreviation",p)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",p)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",p)})]})})})]})})},Xfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(qr),r=H(Gn),i=H(Zwt),a=H(e7t),l=H(t7t),s=H(En),c=H(zd),u=H(Dd),d=H(no),f=H(Zn),p=H(Vi),g=co(z.SolarPanel),[y,w]=m.useState((g==null?void 0:g.cx)??0),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=j=>{u(j.target.value)},T=j=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const L of n)if(L.type===z.SolarPanel&&!L.locked&&Math.abs(L.cx-j)>It)return!0;break;case oe.AllObjectsOfThisType:for(const L of n)if(L.type===z.SolarPanel&&!L.locked&&H.getState().selectedElementIdSet.has(L.id)&&Math.abs(L.cx-j)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const L of n)if(L.type===z.SolarPanel&&L.foundationId===(g==null?void 0:g.foundationId)&&!L.locked&&Math.abs(L.cx-j)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.cx)-j)>It)return!0}return!1}},A=(j,L)=>{H.getState().set(k=>{for(const N of k.elements)if(N.type===z.SolarPanel&&!N.locked&&j.has(N.id)){const F=N;F.cx=L}})},x=(j,L,k)=>j+.5*L/k<.5&&j-.5*L/k>-.5,S=j=>{if(!g||!T(j))return;C.current=void 0;const L=o(g);if(L){switch(c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(k.id)&&!x(j,g.lx,L.lx)){b.current=!0;break}if(b.current)C.current=j,w(g.cx);else{const k=new Map;for(const F of n)F.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.cx);const N={name:"Set Center X for Selected Solar Panel",timestamp:Date.now(),oldValues:k,newValue:j,undo:()=>{for(const[F,U]of N.oldValues.entries())i(F,U)},redo:()=>{A(N.oldValues,N.newValue)}};s(N),A(k,j),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.SolarPanel&&!x(j,g.lx,L.lx)){b.current=!0;break}if(b.current)C.current=j,w(g.cx);else{const k=new Map;for(const F of n)F.type===z.SolarPanel&&k.set(F.id,F.cx);const N={name:"Set Center X for All Solar Panels",timestamp:Date.now(),oldValues:k,newValue:j,undo:()=>{for(const[F,U]of N.oldValues.entries())i(F,U)},redo:()=>{l(z.SolarPanel,N.newValue)}};s(N),l(z.SolarPanel,j),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.SolarPanel&&k.foundationId===g.foundationId&&!x(j,g.lx,L.lx)){b.current=!0;break}if(b.current)C.current=j,w(g.cx);else{const k=new Map;for(const F of n)F.type===z.SolarPanel&&F.foundationId===g.foundationId&&k.set(F.id,F.cx);const N={name:"Set Center X for All Solar Panels Above Foundation",timestamp:Date.now(),oldValues:k,newValue:j,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())i(F,U)},redo:()=>{N.groupId&&a(z.SolarPanel,N.groupId,N.newValue)}};s(N),a(z.SolarPanel,g.foundationId,j),f(d+1)}}break}default:{const k=r(g.id),N=k?k.cx:g.cx;if(b.current=!x(j,g.lx,L.lx),b.current)C.current=j,w(N);else{const F={name:"Set Solar Panel Center X",timestamp:Date.now(),oldValue:N,newValue:j,changedElementId:g.id,changedElementType:g.type,undo:()=>{i(F.changedElementId,F.oldValue)},redo:()=>{i(F.changedElementId,F.newValue)}};s(F),i(g.id,j),f(d+1)}break}}e(k=>{k.actionState.solarPanelCx=j})}},R=()=>{b.current=!1,t(!1)},M=()=>{R(),p()},D=()=>{S(y),b.current||(t(!1),f(0))},E=()=>{S(y)},W=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("solarCollectorMenu.RelativeXCoordinateOfCenter",P),rejectedMessage:W,onApply:E,onClose:R,onClickCancel:M,onClickOk:D,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:-.5,max:.5,style:{width:120},step:.01,precision:2,value:y,onChange:j=>{j!==null&&w(j)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",P),": [-0.5, 0.5]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",P)})]})})})]})})},Jfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(qr),r=H(Gn),i=H(n7t),a=H(o7t),l=H(r7t),s=H(En),c=H(zd),u=H(Dd),d=H(no),f=H(Zn),p=H(Vi),g=co(z.SolarPanel),[y,w]=m.useState((g==null?void 0:g.cy)??0),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=j=>{u(j.target.value)},T=j=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const L of n)if(L.type===z.SolarPanel&&!L.locked&&Math.abs(L.cy-j)>It)return!0;break;case oe.AllObjectsOfThisType:for(const L of n)if(L.type===z.SolarPanel&&!L.locked&&H.getState().selectedElementIdSet.has(L.id)&&Math.abs(L.cy-j)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const L of n)if(L.type===z.SolarPanel&&L.foundationId===(g==null?void 0:g.foundationId)&&!L.locked&&Math.abs(L.cy-j)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.cy)-j)>It)return!0}return!1}},A=(j,L)=>{H.getState().set(k=>{for(const N of k.elements)if(N.type===z.SolarPanel&&!N.locked&&j.has(N.id)){const F=N;F.cy=L}})},x=(j,L,k)=>j+.5*L/k<.5&&j-.5*L/k>-.5,S=j=>{if(!g||!T(j))return;C.current=void 0;const L=o(g);if(L){switch(c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(k.id)&&!x(j,g.ly,L.ly)){b.current=!0;break}if(b.current)C.current=j,w(g.cy);else{const k=new Map;for(const F of n)F.type===z.SolarPanel&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.cy);const N={name:"Set Center Y for Selected Solar Panel",timestamp:Date.now(),oldValues:k,newValue:j,undo:()=>{for(const[F,U]of N.oldValues.entries())i(F,U)},redo:()=>{A(N.oldValues,N.newValue)}};s(N),A(k,j),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.SolarPanel&&!x(j,g.ly,L.ly)){b.current=!0;break}if(b.current)C.current=j,w(g.cy);else{const k=new Map;for(const F of n)F.type===z.SolarPanel&&k.set(F.id,F.cy);const N={name:"Set Center Y for All Solar Panels",timestamp:Date.now(),oldValues:k,newValue:j,undo:()=>{for(const[F,U]of N.oldValues.entries())i(F,U)},redo:()=>{l(z.SolarPanel,N.newValue)}};s(N),l(z.SolarPanel,j),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.SolarPanel&&k.foundationId===g.foundationId&&!x(j,g.ly,L.ly)){b.current=!0;break}if(b.current)C.current=j,w(g.cy);else{const k=new Map;for(const F of n)F.type===z.SolarPanel&&F.foundationId===g.foundationId&&k.set(F.id,F.cy);const N={name:"Set Center Y for All Solar Panels Above Foundation",timestamp:Date.now(),oldValues:k,newValue:j,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())i(F,U)},redo:()=>{N.groupId&&a(z.SolarPanel,N.groupId,N.newValue)}};s(N),a(z.SolarPanel,g.foundationId,j),f(d+1)}}break}default:{const k=r(g.id),N=k?k.cy:g.cy;if(b.current=!x(j,g.ly,L.ly),b.current)C.current=j,w(N);else{const F={name:"Set Solar Panel Center Y",timestamp:Date.now(),oldValue:N,newValue:j,changedElementId:g.id,changedElementType:g.type,undo:()=>{i(F.changedElementId,F.oldValue)},redo:()=>{i(F.changedElementId,F.newValue)}};s(F),i(g.id,j),f(d+1)}break}}e(k=>{k.actionState.solarPanelCy=j})}},R=()=>{b.current=!1,t(!1)},M=()=>{R(),p()},D=()=>{S(y),b.current||(t(!1),f(0))},E=()=>{S(y)},W=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("solarCollectorMenu.RelativeYCoordinateOfCenter",P),rejectedMessage:W,onApply:E,onClose:R,onClickCancel:M,onClickOk:D,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:-.5,max:.5,style:{width:120},step:.01,precision:2,value:y,onChange:j=>{j!==null&&w(j)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",P),": [-0.5, 0.5]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",P)})]})})})]})})},Kfo=t=>{const e=[];if(t.type!==z.SolarPanel)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language},i=t.type===z.SolarPanel&&me.isIdentical(n.normal,rs);return e.push({key:"solar-panel-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"solar-panel-cut",label:h.jsx(Wd,{})}),e.push({key:"solar-panel-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&(e.push({key:"solar-panel-model-change",label:h.jsxs(to,{Dialog:Lfo,children:[Y.t("solarPanelMenu.ChangePvModel",r)," (",n.pvModelName,") ..."]})},{key:"solar-panel-orientation",label:h.jsxs(to,{Dialog:Wfo,children:[Y.t("solarPanelMenu.Orientation",r)," ..."]})},{key:"solar-panel-length",label:h.jsxs(to,{Dialog:Nfo,children:[Y.t("word.Length",r)," ..."]})},{key:"solar-panel-width",label:h.jsxs(to,{Dialog:Ufo,children:[Y.t("word.Width",r)," ..."]})}),e.push({key:"solar-panel-coordinates-submenu",label:h.jsx(rn,{children:Y.t("solarCollectorMenu.Coordinates",r)}),children:[{key:"solar-panel-center-x",label:h.jsxs(to,{Dialog:Xfo,children:[Y.t("solarCollectorMenu.RelativeXCoordinateOfCenter",r)," ..."]})},{key:"solar-panel-center-y",label:h.jsxs(to,{Dialog:Jfo,children:[Y.t("solarCollectorMenu.RelativeYCoordinateOfCenter",r)," ..."]})}]}),n.parentType===z.Wall&&e.push({key:"solar-panel-tilt-angle-on-wall",label:h.jsxs(to,{Dialog:IHe,children:[Y.t("solarPanelMenu.TiltAngle",r)," ..."]})}),i&&(n.trackerType===za.NO_TRACKER&&e.push({key:"solar-panel-tilt-angle",label:h.jsxs(to,{Dialog:IHe,children:[Y.t("solarPanelMenu.TiltAngle",r)," ..."]})}),e.push({key:"solar-panel-relative-azimuth",label:h.jsxs(to,{Dialog:Yfo,children:[Y.t("solarCollectorMenu.RelativeAzimuth",r)," ..."]})}),n.parentType!==z.Roof&&e.push({key:"solar-panel-tracker",label:h.jsxs(to,{Dialog:Ofo,children:[Y.t("solarPanelMenu.Tracker",r)," ..."]})})),e.push({key:"solar-panel-frame-color",label:h.jsxs(to,{Dialog:_fo,children:[Y.t("solarPanelMenu.FrameColor",r)," ..."]})}),e.push({key:"solar-panel-draw-sun-beam",label:h.jsx(t2e,{solarCollector:n})}),e.push({key:"solar-panel-electrical-submenu",label:h.jsx(rn,{children:Y.t("solarPanelMenu.ElectricalProperties",r)}),children:[{key:"solar-panel-inverter-efficiency",label:h.jsxs(to,{Dialog:jfo,children:[Y.t("solarPanelMenu.InverterEfficiency",r)," ..."]})},{key:"solar-panel-dc-ac-ratio",label:h.jsxs(to,{Dialog:Bfo,children:[Y.t("solarPanelMenu.DcToAcSizeRatio",r)," ..."]})}]}),e.push({key:"solar-panel-pole-submenu",label:h.jsx(rn,{children:Y.t("solarCollectorMenu.Pole",r)}),children:[{key:"solar-panel-pole-height",label:h.jsxs(to,{noPadding:!0,Dialog:Vfo,children:[Y.t("solarCollectorMenu.PoleHeight",r)," ..."]})},{key:"solar-panel-pole-spacing",label:h.jsxs(to,{noPadding:!0,Dialog:Gfo,children:[Y.t("solarPanelMenu.PoleSpacing",r)," ..."]})}]}),e.push({key:"solar-panel-label",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",r)}),children:PA(n)})),{items:e}},qfo=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(Iw),r=H(Xq),i=H(mW),a=H(qr),l=H(En),s=H(gA),c=H(mA),u=H(no),d=H(Zn),f=H(Vi),p=co(z.ParabolicTrough),[g,y]=m.useState((p==null?void 0:p.ly)??9),w=m.useRef(!1),b=m.useRef(),C=Jt(),P=L=>{c(L.target.value)},v=(L,k)=>{const N=a(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.ly=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},T=(L,k)=>!v(L,k),A=L=>{if(p){switch(s){case oe.AllSelectedObjectsOfThisType:for(const k of e)if(k.type===z.ParabolicTrough&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.ly-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of e)if(k.type===z.ParabolicTrough&&!k.locked&&Math.abs(k.ly-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of e)if(k.type===z.ParabolicTrough&&k.foundationId===(p==null?void 0:p.foundationId)&&!k.locked&&Math.abs(k.ly-L)>It)return!0;break;default:if(Math.abs((p==null?void 0:p.ly)-L)>It)return!0}return!1}},x=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.ParabolicTrough&&!F.locked&&L.has(F.id)&&(F.ly=k)})},S=L=>{if(p&&A(L))switch(b.current=void 0,s){case oe.AllSelectedObjectsOfThisType:{w.current=!1;for(const k of e)if(k.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(k.id)&&T(k,L)){w.current=!0;break}if(w.current)b.current=L,y(p.ly);else{const k=new Map;for(const F of e)F.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.ly);const N={name:"Set Length for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())o(F,U)},redo:()=>{x(N.oldValues,N.newValue)}};l(N),x(k,L),d(u+1)}break}case oe.AllObjectsOfThisType:{w.current=!1;for(const k of e)if(k.type===z.ParabolicTrough&&T(k,L)){w.current=!0;break}if(w.current)b.current=L,y(p.ly);else{const k=new Map;for(const F of e)F.type===z.ParabolicTrough&&k.set(F.id,F.ly);const N={name:"Set Length for All Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())o(F,U)},redo:()=>{i(z.ParabolicTrough,N.newValue)}};l(N),i(z.ParabolicTrough,L),d(u+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){w.current=!1;for(const k of e)if(k.type===z.ParabolicTrough&&k.foundationId===p.foundationId&&T(k,L)){w.current=!0;break}if(w.current)b.current=L,y(p.ly);else{const k=new Map;for(const F of e)F.type===z.ParabolicTrough&&F.foundationId===p.foundationId&&k.set(F.id,F.ly);const N={name:"Set Length for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:p.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())o(F,U)},redo:()=>{N.groupId&&r(z.ParabolicTrough,N.groupId,N.newValue)}};l(N),r(z.ParabolicTrough,p.foundationId,L),d(u+1)}}break}default:{const k=n(p.id),N=k?k.ly:p.ly;if(w.current=T(p,L),w.current)b.current=L,y(N);else{const F={name:"Set Parabolic Trough Length",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:p.id,changedElementType:p.type,undo:()=>{o(F.changedElementId,F.oldValue)},redo:()=>{o(F.changedElementId,F.newValue)}};l(F),o(p.id,L),d(u+1)}break}}},R=()=>{w.current=!1,t(!1)},M=()=>{R(),f()},D=()=>{S(g),w.current||(t(!1),d(0))},E=L=>{if(!p)return 1;let k=L??1;return k=Math.max(1,Math.ceil((k-p.moduleLength/2)/p.moduleLength))*p.moduleLength,k},W=()=>{S(g)};if((p==null?void 0:p.type)!==z.ParabolicTrough)return null;const j=w.current?": "+Y.t("message.NotApplicableToSelectedAction",C)+(b.current!==void 0?" ("+b.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("word.Length",C),rejectedMessage:j,onApply:W,onClose:R,onClickCancel:M,onClickOk:D,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:p.moduleLength,max:100*p.moduleLength,step:p.moduleLength,precision:2,style:{width:120},value:g,onChange:L=>{y(E(L))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("parabolicTroughMenu.ModuleLength",C)+": "+p.moduleLength.toFixed(1)+" "+Y.t("word.MeterAbbreviation",C),h.jsx("br",{}),Math.round(g/p.moduleLength)+" "+Y.t("parabolicTroughMenu.ModulesLong",C),h.jsx("br",{}),Y.t("word.Maximum",C),": 100 ",Y.t("parabolicTroughMenu.Modules",C)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",C)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",C)})]})})})]})})},$fo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(u3),i=H(Gq),a=H(gW),l=H(qr),s=H(En),c=H(gA),u=H(mA),d=H(no),f=H(Zn),p=H(Vi),g=co(z.ParabolicTrough),[y,w]=m.useState((g==null?void 0:g.lx)??2),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.lx=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicTrough&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.lx-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicTrough&&!k.locked&&Math.abs(k.lx-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.ParabolicTrough&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.lx-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.lx)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.ParabolicTrough&&!F.locked&&L.has(F.id)&&(F.lx=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.lx);const N={name:"Set Width for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&k.set(F.id,F.lx);const N={name:"Set Width for All Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.ParabolicTrough,N.newValue)}};s(N),a(z.ParabolicTrough,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&F.foundationId===g.foundationId&&k.set(F.id,F.lx);const N={name:"Set Width for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.ParabolicTrough,N.groupId,N.newValue)}};s(N),i(z.ParabolicTrough,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.lx:g.lx;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Parabolic Trough Width",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.parabolicTroughWidth=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.ParabolicTrough)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("word.Width",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:10,step:.5,precision:2,style:{width:120},value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 10 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",P)})]})})})]})})},Qfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(DYe),i=H(EYe),a=H(FYe),l=H(qr),s=H(En),c=H(gA),u=H(mA),d=H(no),f=H(Zn),p=H(Vi),g=co(z.ParabolicTrough),[y,w]=m.useState((g==null?void 0:g.moduleLength)??3),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.moduleLength=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicTrough&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.moduleLength-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicTrough&&!k.locked&&Math.abs(k.moduleLength-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.ParabolicTrough&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.moduleLength-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.moduleLength)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.ParabolicTrough&&!F.locked&&L.has(F.id)&&(F.moduleLength=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.moduleLength);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.moduleLength);const N={name:"Set Module Length for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.moduleLength);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&k.set(F.id,F.moduleLength);const N={name:"Set Module Length for All Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.ParabolicTrough,N.newValue)}};s(N),a(z.ParabolicTrough,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.moduleLength);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&F.foundationId===g.foundationId&&k.set(F.id,F.moduleLength);const N={name:"Set Module Length for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.ParabolicTrough,N.groupId,N.newValue)}};s(N),i(z.ParabolicTrough,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.moduleLength:g.moduleLength;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Parabolic Trough Module Length",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.parabolicTroughModuleLength=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{R(y),b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.ParabolicTrough)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("parabolicTroughMenu.LatusRectum",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:10,step:.5,style:{width:120},precision:2,value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 10 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",P)})]})})})]})})},Zfo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(MYe),i=H(IYe),a=H(zYe),l=H(qr),s=H(En),c=H(gA),u=H(mA),d=H(no),f=H(Zn),p=H(Vi),g=co(z.ParabolicTrough),[y,w]=m.useState((g==null?void 0:g.latusRectum)??2),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.latusRectum=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicTrough&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.latusRectum-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicTrough&&!k.locked&&Math.abs(k.latusRectum-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.ParabolicTrough&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.latusRectum-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.latusRectum)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.ParabolicTrough&&!F.locked&&L.has(F.id)&&(F.latusRectum=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.latusRectum);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.latusRectum);const N={name:"Set Latus Rectum for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.latusRectum);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&k.set(F.id,F.latusRectum);const N={name:"Set Latus Rectum for All Parabolic Troughs",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.ParabolicTrough,N.newValue)}};s(N),a(z.ParabolicTrough,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.ParabolicTrough&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.latusRectum);else{const k=new Map;for(const F of n)F.type===z.ParabolicTrough&&F.foundationId===g.foundationId&&k.set(F.id,F.latusRectum);const N={name:"Set Latus Rectum for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.ParabolicTrough,N.groupId,N.newValue)}};s(N),i(z.ParabolicTrough,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.latusRectum:g.latusRectum;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Parabolic Trough Latus Rectum",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.parabolicTroughLatusRectum=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{R(y),b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.ParabolicTrough)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("parabolicTroughMenu.LatusRectum",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:20,step:.5,precision:2,style:{width:120},value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 20 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",P)})]})})})]})})},eho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(wW),i=H(vW),a=H(xW),l=H(qr),s=H(En),c=H(gA),u=H(mA),d=H(no),f=H(Zn),p=H(Vi),g=co(z.ParabolicTrough),[y,w]=m.useState((g==null?void 0:g.poleHeight)??1),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=W=>{u(W.target.value)},T=W=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const j of n)if(j.type===z.ParabolicTrough&&!j.locked&&H.getState().selectedElementIdSet.has(j.id)&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const j of n)if(j.type===z.ParabolicTrough&&!j.locked&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const j of n)if(j.type===z.ParabolicTrough&&j.foundationId===(g==null?void 0:g.foundationId)&&!j.locked&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{if(l(g)){for(const L of n)if(L.type===z.ParabolicTrough&&L.parentId===g.parentId&&!L.locked&&Math.abs(L.poleHeight-W)>It)return!0}break}default:{if(Math.abs((g==null?void 0:g.poleHeight)-W)>It)return!0;break}}return!1}},A=(W,j)=>{H.getState().set(L=>{for(const k of L.elements)k.type===z.ParabolicTrough&&!k.locked&&W.has(k.id)&&(k.tiltAngle=j)})},x=W=>{if(g&&T(W)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const j of n)if(j.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(j.id)&&.5*j.ly*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(k.id)&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{A(L.oldValues,L.newValue)}};s(L),A(j,W),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const j of n)if(j.type===z.ParabolicTrough&&.5*j.ly*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.ParabolicTrough&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for All Parabolic Troughs",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{a(z.ParabolicTrough,L.newValue)}};s(L),a(z.ParabolicTrough,W),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const j of n)if(j.type===z.ParabolicTrough&&j.foundationId===g.foundationId&&.5*j.ly*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.ParabolicTrough&&k.foundationId===g.foundationId&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:j,newValue:W,groupId:g.foundationId,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{L.groupId&&i(z.ParabolicTrough,L.groupId,L.newValue)}};s(L),i(z.ParabolicTrough,g.foundationId,W),f(d+1)}}break}default:{const j=o(g.id),L=j?j.poleHeight:g.poleHeight;if(b.current=.5*g.lx*Math.abs(Math.sin(g.tiltAngle))>W,b.current)C.current=W,w(L);else{const k={name:"Set Parabolic Trough Pole Height",timestamp:Date.now(),oldValue:L,newValue:W,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(k.changedElementId,k.oldValue)},redo:()=>{r(k.changedElementId,k.newValue)}};s(k),r(g.id,W),f(d+1)}break}}e(j=>{j.actionState.parabolicTroughPoleHeight=W})}},S=()=>{b.current=!1,t(!1)},R=()=>{S(),p()},M=()=>{x(y),b.current||(t(!1),f(0))},D=()=>{x(y)};if((g==null?void 0:g.type)!==z.ParabolicTrough)return null;const E=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("solarCollectorMenu.ExtraPoleHeightInAdditionToHalfWidth",P),rejectedMessage:E,onApply:D,onClose:S,onClickCancel:R,onClickOk:M,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:5,style:{width:120},step:.1,precision:2,value:y,onChange:W=>{W!==null&&w(W)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",P),": [0, 5] ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",P)})]})})})]})})},tho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(Kq),i=H(qq),a=H($q),l=H(En),s=H(gA),c=H(mA),u=H(no),d=H(Zn),f=co(z.ParabolicTrough),[p,g]=m.useState((f==null?void 0:f.reflectance)??.9),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicTrough&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.reflectance)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicTrough&&!R.locked&&A.has(R.id)&&(R.reflectance=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicTrough,S.newValue)}};l(S),a(z.ParabolicTrough,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&R.foundationId===f.foundationId&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicTrough,S.groupId,S.newValue)}};l(S),i(z.ParabolicTrough,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.reflectance:f.reflectance,R={name:"Set Parabolic Trough Reflectance",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicTroughReflectance=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.ParabolicTrough?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",y)})]})})})]})})},nho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(yYe),i=H(AYe),a=H(wYe),l=H(En),s=H(gA),c=H(mA),u=H(no),d=H(Zn),f=co(z.ParabolicTrough),[p,g]=m.useState((f==null?void 0:f.absorptance)??.95),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.absorptance-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&Math.abs(x.absorptance-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicTrough&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.absorptance-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.absorptance)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicTrough&&!R.locked&&A.has(R.id)&&(R.absorptance=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.absorptance);const S={name:"Set Absorptance for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&x.set(R.id,R.absorptance);const S={name:"Set Absorptance for All Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicTrough,S.newValue)}};l(S),a(z.ParabolicTrough,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&R.foundationId===f.foundationId&&x.set(R.id,R.absorptance);const S={name:"Set Absorptance for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicTrough,S.groupId,S.newValue)}};l(S),i(z.ParabolicTrough,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.absorptance:f.absorptance,R={name:"Set Parabolic Trough Absorptance",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicTroughAbsorptance=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.ParabolicTrough?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReceiverAbsorptance",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",y)})]})})})]})})},oho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(vYe),i=H(xYe),a=H(bYe),l=H(En),s=H(gA),c=H(mA),u=H(no),d=H(Zn),f=co(z.ParabolicTrough),[p,g]=m.useState((f==null?void 0:f.opticalEfficiency)??.7),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.opticalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&Math.abs(x.opticalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicTrough&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.opticalEfficiency-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.opticalEfficiency)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicTrough&&!R.locked&&A.has(R.id)&&(R.opticalEfficiency=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.opticalEfficiency);const S={name:"Set Optical Efficiency for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&x.set(R.id,R.opticalEfficiency);const S={name:"Set Optical Efficiency for All Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicTrough,S.newValue)}};l(S),a(z.ParabolicTrough,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&R.foundationId===f.foundationId&&x.set(R.id,R.opticalEfficiency);const S={name:"Set Optical Efficiency for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicTrough,S.groupId,S.newValue)}};l(S),i(z.ParabolicTrough,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.opticalEfficiency:f.opticalEfficiency,R={name:"Set Parabolic Trough Optical Efficiency",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicTroughOpticalEfficiency=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.ParabolicTrough?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReflectorOpticalEfficiency",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",y)})]})})})]})})},rho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(SYe),i=H(TYe),a=H(PYe),l=H(En),s=H(gA),c=H(mA),u=H(no),d=H(Zn),f=co(z.ParabolicTrough),[p,g]=m.useState((f==null?void 0:f.thermalEfficiency)??.3),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.thermalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicTrough&&!x.locked&&Math.abs(x.thermalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicTrough&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.thermalEfficiency-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.thermalEfficiency)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicTrough&&!R.locked&&A.has(R.id)&&(R.thermalEfficiency=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.thermalEfficiency);const S={name:"Set Thermal Efficiency for Selected Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&x.set(R.id,R.thermalEfficiency);const S={name:"Set Thermal Efficiency for All Parabolic Troughs",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicTrough,S.newValue)}};l(S),a(z.ParabolicTrough,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicTrough&&R.foundationId===f.foundationId&&x.set(R.id,R.thermalEfficiency);const S={name:"Set Thermal Efficiency for All Parabolic Troughs Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicTrough,S.groupId,S.newValue)}};l(S),i(z.ParabolicTrough,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.thermalEfficiency:f.thermalEfficiency,R={name:"Set Parabolic Trough Thermal Efficiency",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicTroughThermalEfficiency=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.ParabolicTrough?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReceiverThermalEfficiency",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicTroughMenu.OnlyThisParabolicTrough",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicTroughMenu.AllParabolicTroughsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllSelectedParabolicTroughs",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicTroughMenu.AllParabolicTroughs",y)})]})})})]})})},iho=t=>{const e=[];if(t.type!==z.ParabolicTrough)return{items:e};const n=t,o={lng:H.getState().language},r=!n.locked;return e.push({key:"parabolic-trough-copy",label:h.jsx(Ld,{})}),r&&e.push({key:"parabolic-trough-cut",label:h.jsx(Wd,{})}),e.push({key:"parabolic-trough-lock",label:h.jsx(Ju,{selectedElement:n})}),r&&e.push({key:"parabolic-trough-length",label:h.jsxs(to,{Dialog:qfo,children:[Y.t("word.Length",o)," ..."]})},{key:"parabolic-trough-width",label:h.jsxs(to,{Dialog:$fo,children:[Y.t("word.Width",o)," ..."]})},{key:"parabolic-trough-module-length",label:h.jsxs(to,{Dialog:Qfo,children:[Y.t("parabolicTroughMenu.ModuleLength",o)," ..."]})},{key:"parabolic-trough-latus-rectum",label:h.jsxs(to,{Dialog:Zfo,children:[Y.t("parabolicTroughMenu.LatusRectum",o)," ..."]})},{key:"parabolic-trough-pole-height",label:h.jsxs(to,{Dialog:eho,children:[Y.t("solarCollectorMenu.ExtraPoleHeight",o)," ..."]})},{key:"parabolic-trough-reflectance",label:h.jsxs(to,{Dialog:tho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",o)," ..."]})},{key:"parabolic-trough-absorptance",label:h.jsxs(to,{Dialog:nho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReceiverAbsorptance",o)," ..."]})},{key:"parabolic-trough-optical-efficiency",label:h.jsxs(to,{Dialog:oho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReflectorOpticalEfficiency",o)," ..."]})},{key:"parabolic-trough-thermal-efficiency",label:h.jsxs(to,{Dialog:rho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReceiverThermalEfficiency",o)," ..."]})},{key:"parabolic-dish-draw-sun-beam",label:h.jsx(t2e,{solarCollector:n})},{key:"parabolic-trough-label-submenu",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",o)}),children:PA(n)}),{items:e}},aho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(u3),i=H(Iw),a=H(Gq),l=H(Xq),s=H(gW),c=H(mW),u=H(qr),d=H(En),f=H(yA),p=H(AA),g=H(no),y=H(Zn),w=H(Vi),b=co(z.ParabolicDish),[C,P]=m.useState((b==null?void 0:b.lx)??2),v=m.useRef(!1),T=m.useRef(),A=Jt(),x=F=>{p(F.target.value)},S=(F,U)=>{const O=u(F);if(O){const B=JSON.parse(JSON.stringify(F));return B.lx=U,me.isSolarCollectorWithinHorizontalSurface(B,O)}return!1},R=(F,U)=>!S(F,U),M=F=>{if(b){switch(f){case oe.AllSelectedObjectsOfThisType:for(const U of n)if(U.type===z.ParabolicDish&&!U.locked&&H.getState().selectedElementIdSet.has(U.id)&&Math.abs(U.lx-F)>It)return!0;break;case oe.AllObjectsOfThisType:for(const U of n)if(U.type===z.ParabolicDish&&!U.locked&&Math.abs(U.lx-F)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const U of n)if(U.type===z.ParabolicDish&&U.foundationId===(b==null?void 0:b.foundationId)&&!U.locked&&Math.abs(U.lx-F)>It)return!0;break;default:if(Math.abs((b==null?void 0:b.lx)-F)>It)return!0}return!1}},D=(F,U)=>{H.getState().set(O=>{for(const B of O.elements)B.type===z.ParabolicDish&&!B.locked&&F.has(B.id)&&(B.lx=U,B.ly=U)})},E=F=>{if(b&&M(F)){switch(T.current=void 0,f){case oe.AllSelectedObjectsOfThisType:{v.current=!1;for(const U of n)if(U.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(U.id)&&R(U,F)){v.current=!0;break}if(v.current)T.current=F,P(b.lx);else{const U=new Map;for(const B of n)B.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(B.id)&&U.set(B.id,B.lx);const O={name:"Set Diameter for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())r(B,_),i(B,_)},redo:()=>{D(O.oldValues,O.newValue)}};d(O),D(U,F),y(g+1)}break}case oe.AllObjectsOfThisType:{v.current=!1;for(const U of n)if(U.type===z.ParabolicDish&&R(U,F)){v.current=!0;break}if(v.current)T.current=F,P(b.lx);else{const U=new Map;for(const B of n)B.type===z.ParabolicDish&&U.set(B.id,B.lx);const O={name:"Set Diameter for All Parabolic Dishes",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())r(B,_),i(B,_)},redo:()=>{s(z.ParabolicDish,O.newValue),c(z.ParabolicDish,O.newValue)}};d(O),s(z.ParabolicDish,F),c(z.ParabolicDish,F),y(g+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(b.foundationId){v.current=!1;for(const U of n)if(U.type===z.ParabolicDish&&U.foundationId===b.foundationId&&R(U,F)){v.current=!0;break}if(v.current)T.current=F,P(b.lx);else{const U=new Map;for(const B of n)B.type===z.ParabolicDish&&B.foundationId===b.foundationId&&U.set(B.id,B.lx);const O={name:"Set Diameter for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:U,newValue:F,groupId:b.foundationId,undo:()=>{for(const[B,_]of O.oldValues.entries())r(B,_),i(B,_)},redo:()=>{O.groupId&&(a(z.ParabolicDish,O.groupId,O.newValue),l(z.ParabolicDish,O.groupId,O.newValue))}};d(O),a(z.ParabolicDish,b.foundationId,F),l(z.ParabolicDish,b.foundationId,F),y(g+1)}}break}default:{const U=o(b.id),O=U?U.lx:b.lx;if(v.current=R(b,F),v.current)T.current=F,P(O);else{const B={name:"Set Parabolic Dish Diameter",timestamp:Date.now(),oldValue:O,newValue:F,changedElementId:b.id,changedElementType:b.type,undo:()=>{r(B.changedElementId,B.oldValue),i(B.changedElementId,B.oldValue)},redo:()=>{r(B.changedElementId,B.newValue),i(B.changedElementId,B.newValue)}};d(B),r(b.id,F),i(b.id,F),y(g+1)}break}}e(U=>{U.actionState.parabolicDishRimDiameter=F})}},W=()=>{v.current=!1,t(!1)},j=()=>{W(),w()},L=()=>{E(C),v.current||(t(!1),y(0))},k=()=>{E(C)};if((b==null?void 0:b.type)!==z.ParabolicDish)return null;const N=v.current?": "+Y.t("message.NotApplicableToSelectedAction",A)+(T.current!==void 0?" ("+T.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("parabolicDishMenu.RimDiameter",A),rejectedMessage:N,onApply:k,onClose:W,onClickCancel:j,onClickOk:L,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:10,step:.5,precision:2,style:{width:120},value:C,onChange:F=>{F!==null&&P(F)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",A),": 1 ",Y.t("word.MeterAbbreviation",A),h.jsx("br",{}),Y.t("word.MaximumValue",A),": 10 ",Y.t("word.MeterAbbreviation",A)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",A)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:x,value:f,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",A)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",A)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",A)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",A)})]})})})]})})},lho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(MYe),i=H(IYe),a=H(zYe),l=H(qr),s=H(En),c=H(yA),u=H(AA),d=H(no),f=H(Zn),p=H(Vi),g=co(z.ParabolicDish),[y,w]=m.useState((g==null?void 0:g.latusRectum)??2),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.latusRectum=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicDish&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.latusRectum-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.ParabolicDish&&!k.locked&&Math.abs(k.latusRectum-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.ParabolicDish&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.latusRectum-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.latusRectum)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.ParabolicDish&&!F.locked&&L.has(F.id)&&(F.latusRectum=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.latusRectum);else{const k=new Map;for(const F of n)F.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.latusRectum);const N={name:"Set Latus Rectum for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.ParabolicDish&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.latusRectum);else{const k=new Map;for(const F of n)F.type===z.ParabolicDish&&k.set(F.id,F.latusRectum);const N={name:"Set Latus Rectum for All Parabolic Dishes",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.ParabolicDish,N.newValue)}};s(N),a(z.ParabolicDish,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.ParabolicDish&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.latusRectum);else{const k=new Map;for(const F of n)F.type===z.ParabolicDish&&F.foundationId===g.foundationId&&k.set(F.id,F.latusRectum);const N={name:"Set Latus Rectum for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.ParabolicDish,N.groupId,N.newValue)}};s(N),i(z.ParabolicDish,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.latusRectum:g.latusRectum;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Parabolic Dish Latus Rectum",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.parabolicDishLatusRectum=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{R(y),b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.ParabolicDish)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("parabolicDishMenu.LatusRectum",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:20,step:.5,style:{width:120},precision:2,value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 20 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",P)})]})})})]})})},sho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(yA),a=H(AA),l=H(no),s=H(Zn),c=co(z.ParabolicDish),[u,d]=m.useState((c==null?void 0:c.structureType)??uf.CentralPole),f=Jt(),{Option:p}=_o,g=(x,S)=>{e(R=>{for(const M of R.elements)if(M.id===x&&!M.locked&&M.type===z.ParabolicDish){M.structureType=S;break}})},y=(x,S)=>{e(R=>{for(const M of R.elements)M.foundationId===x&&!M.locked&&M.type===z.ParabolicDish&&(M.structureType=S)})},w=x=>{e(S=>{for(const R of S.elements)R.locked||R.type===z.ParabolicDish&&(R.structureType=x)})},b=x=>{a(x.target.value)},C=x=>{switch(i){case oe.AllSelectedObjectsOfThisType:for(const S of n)if(S.type===z.ParabolicDish&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&S.structureType!==x)return!0;break;case oe.AllObjectsOfThisType:for(const S of n)if(S.type===z.ParabolicDish&&!S.locked&&S.structureType!==x)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const S of n)if(S.type===z.ParabolicDish&&S.foundationId===(c==null?void 0:c.foundationId)&&!S.locked&&S.structureType!==x)return!0;break;default:if((c==null?void 0:c.structureType)!==x)return!0}return!1},P=(x,S)=>{H.getState().set(R=>{for(const M of R.elements)M.type===z.ParabolicDish&&!M.locked&&x.has(M.id)&&(M.structureType=S)})},v=x=>{if(c&&C(x)){switch(i){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M.structureType);const R={name:"Set Structure Type for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())g(M,D)},redo:()=>{P(R.oldValues,R.newValue)}};r(R),P(S,x),s(l+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.ParabolicDish&&S.set(M.id,M.structureType);const R={name:"Set Structure Type for All Parabolic Dishes",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())g(M,D)},redo:()=>{w(R.newValue)}};r(R),w(x),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(c.foundationId){const S=new Map;for(const M of n)M.type===z.ParabolicDish&&M.foundationId===c.foundationId&&S.set(M.id,M.structureType);const R={name:"Set Structure Type for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:c.foundationId,undo:()=>{for(const[M,D]of R.oldValues.entries())g(M,D)},redo:()=>{R.groupId&&y(R.groupId,R.newValue)}};r(R),y(c.foundationId,x),s(l+1)}break}default:{const S=o(c.id),R=S?S.structureType:c.structureType,M={name:"Set Parabolic Dish Structure Type",timestamp:Date.now(),oldValue:R,newValue:x,changedElementId:c.id,changedElementType:c.type,undo:()=>{g(M.changedElementId,M.oldValue)},redo:()=>{g(M.changedElementId,M.newValue)}};r(M),g(c.id,x),s(l+1);break}}e(S=>{S.actionState.parabolicDishReceiverStructure=x})}},T=()=>{t(!1)},A=()=>{v(u)};return(c==null?void 0:c.type)!==z.ParabolicDish?null:h.jsx(so,{width:640,title:Y.t("parabolicDishMenu.ReceiverStructure",f),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:8,children:h.jsxs(_o,{value:u,onChange:x=>d(x),children:[h.jsx(p,{value:uf.CentralPole,children:Y.t("parabolicDishMenu.CentralPole",f)},uf.CentralPole),h.jsx(p,{value:uf.CentralPoleWithTripod,children:Y.t("parabolicDishMenu.CentralPoleWithTripod",f)},uf.CentralPoleWithTripod),h.jsx(p,{value:uf.Quadrupod,children:Y.t("parabolicDishMenu.Quadrupod",f)},uf.Quadrupod)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:b,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",f)})]})})})]})})},cho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(wW),i=H(vW),a=H(xW),l=H(qr),s=H(En),c=H(yA),u=H(AA),d=H(no),f=H(Zn),p=H(Vi),g=co(z.ParabolicDish),[y,w]=m.useState((g==null?void 0:g.poleHeight)??1),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=W=>{u(W.target.value)},T=W=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const j of n)if(j.type===z.ParabolicDish&&!j.locked&&H.getState().selectedElementIdSet.has(j.id)&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const j of n)if(j.type===z.ParabolicDish&&!j.locked&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const j of n)if(j.type===z.ParabolicDish&&j.foundationId===(g==null?void 0:g.foundationId)&&!j.locked&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{if(l(g)){for(const L of n)if(L.type===z.ParabolicDish&&L.parentId===g.parentId&&!L.locked&&Math.abs(L.poleHeight-W)>It)return!0}break}default:{if(Math.abs((g==null?void 0:g.poleHeight)-W)>It)return!0;break}}return!1}},A=(W,j)=>{H.getState().set(L=>{for(const k of L.elements)k.type===z.ParabolicDish&&!k.locked&&W.has(k.id)&&(k.tiltAngle=j)})},x=W=>{if(g&&T(W)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const j of n)if(j.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(j.id)&&.5*j.ly*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(k.id)&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{A(L.oldValues,L.newValue)}};s(L),A(j,W),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const j of n)if(j.type===z.ParabolicDish&&.5*j.ly*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.ParabolicDish&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for All Parabolic Dishes",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{a(z.ParabolicDish,L.newValue)}};s(L),a(z.ParabolicDish,W),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const j of n)if(j.type===z.ParabolicDish&&j.foundationId===g.foundationId&&.5*j.ly*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.ParabolicDish&&k.foundationId===g.foundationId&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:j,newValue:W,groupId:g.foundationId,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{L.groupId&&i(z.ParabolicDish,L.groupId,L.newValue)}};s(L),i(z.ParabolicDish,g.foundationId,W),f(d+1)}}break}default:{const j=o(g.id),L=j?j.poleHeight:g.poleHeight;if(b.current=.5*g.lx*Math.abs(Math.sin(g.tiltAngle))>W,b.current)C.current=W,w(L);else{const k={name:"Set Parabolic Dish Pole Height",timestamp:Date.now(),oldValue:L,newValue:W,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(k.changedElementId,k.oldValue)},redo:()=>{r(k.changedElementId,k.newValue)}};s(k),r(g.id,W),f(d+1)}break}}e(j=>{j.actionState.parabolicDishPoleHeight=W})}},S=()=>{b.current=!1,t(!1)},R=()=>{S(),p()},M=()=>{x(y),b.current||(t(!1),f(0))},D=()=>{x(y)};if((g==null?void 0:g.type)!==z.ParabolicDish)return null;const E=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("parabolicDishMenu.ExtraPoleHeightInAdditionToRadius",P),rejectedMessage:E,onApply:D,onClose:S,onClickCancel:R,onClickOk:M,children:h.jsxs(on,{children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:5,style:{width:120},step:.1,precision:2,value:y,onChange:W=>{W!==null&&w(W)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",P),": [0, 5] ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",P)})]})})})]})})},uho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(pYe),i=H(gYe),a=H(mYe),l=H(qr),s=H(En),c=H(yA),u=H(AA),d=H(no),f=H(Zn),p=co(z.ParabolicDish),[g,y]=m.useState((p==null?void 0:p.poleRadius)??.1),w=Jt(),b=x=>{u(x.target.value)},C=x=>{if(p){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const S of n)if(S.type===z.ParabolicDish&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&Math.abs(S.poleRadius-x)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const S of n)if(S.type===z.ParabolicDish&&!S.locked&&Math.abs(S.poleRadius-x)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const S of n)if(S.type===z.ParabolicDish&&S.foundationId===(p==null?void 0:p.foundationId)&&!S.locked&&Math.abs(S.poleRadius-x)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{if(l(p)){for(const R of n)if(R.type===z.ParabolicDish&&R.parentId===p.parentId&&!R.locked&&Math.abs(R.poleRadius-x)>It)return!0}break}default:{if(Math.abs((p==null?void 0:p.poleRadius)-x)>It)return!0;break}}return!1}},P=(x,S)=>{H.getState().set(R=>{for(const M of R.elements)M.type===z.ParabolicDish&&!M.locked&&x.has(M.id)&&(M.poleRadius=S)})},v=x=>{if(p&&C(x)){switch(c){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M.poleRadius);const R={name:"Set Pole Radius for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{P(R.oldValues,R.newValue)}};s(R),P(S,x),f(d+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.ParabolicDish&&S.set(M.id,M.poleRadius);const R={name:"Set Pole Radius for All Parabolic Dishes",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{a(z.ParabolicDish,R.newValue)}};s(R),a(z.ParabolicDish,x),f(d+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){const S=new Map;for(const M of n)M.type===z.ParabolicDish&&M.foundationId===p.foundationId&&S.set(M.id,M.poleRadius);const R={name:"Set Pole Radius for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:p.foundationId,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{R.groupId&&i(z.ParabolicDish,R.groupId,R.newValue)}};s(R),i(z.ParabolicDish,p.foundationId,x),f(d+1)}break}default:{const S=o(p.id),R=S?S.poleRadius:p.poleRadius,M={name:"Set Parabolic Dish Pole Radius",timestamp:Date.now(),oldValue:R,newValue:x,changedElementId:p.id,changedElementType:p.type,undo:()=>{r(M.changedElementId,M.oldValue)},redo:()=>{r(M.changedElementId,M.newValue)}};s(M),r(p.id,x),f(d+1);break}}e(S=>{S.actionState.parabolicDishPoleRadius=x})}},T=()=>{t(!1)},A=()=>{v(g)};return(p==null?void 0:p.type)!==z.ParabolicDish?null:h.jsx(so,{width:600,title:Y.t("solarCollectorMenu.PoleRadius",w),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:.5,style:{width:120},step:.01,precision:2,value:g,onChange:x=>{x!==null&&y(x)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",w),": [0.1, 0.5] ",Y.t("word.MeterAbbreviation",w)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",w)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:b,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",w)})]})})})]})})},dho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(Kq),i=H(qq),a=H($q),l=H(En),s=H(yA),c=H(AA),u=H(no),d=H(Zn),f=co(z.ParabolicDish),[p,g]=m.useState((f==null?void 0:f.reflectance)??.9),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicDish&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.reflectance)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicDish&&!R.locked&&A.has(R.id)&&(R.reflectance=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicDish,S.newValue)}};l(S),a(z.ParabolicDish,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicDish&&R.foundationId===f.foundationId&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicDish,S.groupId,S.newValue)}};l(S),i(z.ParabolicDish,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.reflectance:f.reflectance,R={name:"Set Parabolic Dish Reflectance",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicDishReflectance=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.ParabolicDish?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",y)})]})})})]})})},fho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(yYe),i=H(AYe),a=H(wYe),l=H(En),s=H(yA),c=H(AA),u=H(no),d=H(Zn),f=co(z.ParabolicDish),[p,g]=m.useState((f==null?void 0:f.absorptance)??.95),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.absorptance-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&Math.abs(x.absorptance-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicDish&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.absorptance-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.absorptance)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicDish&&!R.locked&&A.has(R.id)&&(R.absorptance=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.absorptance);const S={name:"Set Absorptance for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&x.set(R.id,R.absorptance);const S={name:"Set Absorptance for All Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicDish,S.newValue)}};l(S),a(z.ParabolicDish,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicDish&&R.foundationId===f.foundationId&&x.set(R.id,R.absorptance);const S={name:"Set Absorptance for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicDish,S.groupId,S.newValue)}};l(S),i(z.ParabolicDish,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.absorptance:f.absorptance,R={name:"Set Parabolic Dish Absorptance",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicDishAbsorptance=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.ParabolicDish?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReceiverAbsorptance",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",y)})]})})})]})})},hho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(vYe),i=H(xYe),a=H(bYe),l=H(En),s=H(yA),c=H(AA),u=H(no),d=H(Zn),f=co(z.ParabolicDish),[p,g]=m.useState((f==null?void 0:f.opticalEfficiency)??.7),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.opticalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&Math.abs(x.opticalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicDish&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.opticalEfficiency-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.opticalEfficiency)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicDish&&!R.locked&&A.has(R.id)&&(R.opticalEfficiency=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.opticalEfficiency);const S={name:"Set Optical Efficiency for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&x.set(R.id,R.opticalEfficiency);const S={name:"Set Optical Efficiency for All Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicDish,S.newValue)}};l(S),a(z.ParabolicDish,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicDish&&R.foundationId===f.foundationId&&x.set(R.id,R.opticalEfficiency);const S={name:"Set Optical Efficiency for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicDish,S.groupId,S.newValue)}};l(S),i(z.ParabolicDish,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.opticalEfficiency:f.opticalEfficiency,R={name:"Set Parabolic Dish Optical Efficiency",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicDishOpticalEfficiency=A})}},v=()=>{t(!1)},T=()=>{P(p),t(!1),d(0)};return(f==null?void 0:f.type)!==z.ParabolicDish?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReflectorOpticalEfficiency",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",y)})]})})})]})})},pho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(SYe),i=H(TYe),a=H(PYe),l=H(En),s=H(yA),c=H(AA),u=H(no),d=H(Zn),f=co(z.ParabolicDish),[p,g]=m.useState((f==null?void 0:f.thermalEfficiency)??.3),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.thermalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.ParabolicDish&&!x.locked&&Math.abs(x.thermalEfficiency-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.ParabolicDish&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.thermalEfficiency-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.thermalEfficiency)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.ParabolicDish&&!R.locked&&A.has(R.id)&&(R.thermalEfficiency=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.thermalEfficiency);const S={name:"Set Thermal Efficiency for Selected Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.ParabolicDish&&x.set(R.id,R.thermalEfficiency);const S={name:"Set Thermal Efficiency for All Parabolic Dishes",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.ParabolicDish,S.newValue)}};l(S),a(z.ParabolicDish,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.ParabolicDish&&R.foundationId===f.foundationId&&x.set(R.id,R.thermalEfficiency);const S={name:"Set Thermal Efficiency for All Parabolic Dishes Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.ParabolicDish,S.groupId,S.newValue)}};l(S),i(z.ParabolicDish,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.thermalEfficiency:f.thermalEfficiency,R={name:"Set Parabolic Dish Thermal Efficiency",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.parabolicDishThermalEfficiency=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.ParabolicDish?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReceiverThermalEfficiency",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("parabolicDishMenu.OnlyThisParabolicDish",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("parabolicDishMenu.AllParabolicDishesAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("parabolicDishMenu.AllSelectedParabolicDishes",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("parabolicDishMenu.AllParabolicDishes",y)})]})})})]})})},gho=t=>{const e=[];if(t.type!==z.ParabolicDish)return{items:e};const n=t,o={lng:H.getState().language},r=!n.locked;return e.push({key:"parabolic-dish-copy",label:h.jsx(Ld,{})}),r&&e.push({key:"parabolic-dish-cut",label:h.jsx(Wd,{})}),e.push({key:"parabolic-dish-lock",label:h.jsx(Ju,{selectedElement:n})}),r&&e.push({key:"parabolic-dish-radius",label:h.jsxs(to,{Dialog:aho,children:[Y.t("parabolicDishMenu.RimDiameter",o)," ..."]})},{key:"parabolic-dish-latus-rectum",label:h.jsxs(to,{Dialog:lho,children:[Y.t("parabolicDishMenu.LatusRectum",o)," ..."]})},{key:"parabolic-dish-structure-type",label:h.jsxs(to,{Dialog:sho,children:[Y.t("parabolicDishMenu.ReceiverStructure",o)," ..."]})},{key:"parabolic-dish-pole-height",label:h.jsxs(to,{Dialog:cho,children:[Y.t("solarCollectorMenu.ExtraPoleHeight",o)," ..."]})},{key:"parabolic-dish-pole-radius",label:h.jsxs(to,{Dialog:uho,children:[Y.t("solarCollectorMenu.PoleRadius",o)," ..."]})},{key:"parabolic-dish-reflectance",label:h.jsxs(to,{Dialog:dho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",o)," ..."]})},{key:"parabolic-dish-absorptance",label:h.jsxs(to,{Dialog:fho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReceiverAbsorptance",o)," ..."]})},{key:"parabolic-dish-optical-efficiency",label:h.jsxs(to,{Dialog:hho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReflectorOpticalEfficiency",o)," ..."]})},{key:"parabolic-dish-thermal-efficiency",label:h.jsxs(to,{Dialog:pho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReceiverThermalEfficiency",o)," ..."]})},{key:"parabolic-dish-draw-sun-beam",label:h.jsx(t2e,{solarCollector:n})},{key:"parabolic-dish-label-submenu",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",o)}),children:PA(n)}),{items:e}},mho=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(sYe),r=H(cYe),i=H(uYe),a=H(En),l=H(Mb),s=H(Ib),c=H(no),u=H(Zn),d=co(z.FresnelReflector),[f,p]=m.useState(!!(d!=null&&d.drawSunBeam)),g=Jt(),y=T=>{s(T.target.value)},w=T=>{switch(l){case oe.AllSelectedObjectsOfThisType:for(const A of e)if(A.type===z.FresnelReflector&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&A.drawSunBeam!==T)return!0;break;case oe.AllObjectsOfThisType:for(const A of e)if(A.type===z.FresnelReflector&&!A.locked&&A.drawSunBeam!==T)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const A of e)if(A.type===z.FresnelReflector&&A.foundationId===(d==null?void 0:d.foundationId)&&!A.locked&&A.drawSunBeam!==T)return!0;break;default:if((d==null?void 0:d.drawSunBeam)!==T)return!0}return!1},b=(T,A)=>{H.getState().set(x=>{for(const S of x.elements)me.isSolarCollectorType(S.type)&&!S.locked&&S.type===z.FresnelReflector&&T.has(S.id)&&(S.drawSunBeam=A)})},C=T=>{if(d&&w(T))switch(l){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of e)S.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(S.id)&&A.set(S.id,S.drawSunBeam);const x={name:"Draw Sun Beam for Selected Fresnel Reflectors",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())o(S,R)},redo:()=>{b(x.oldValues,x.newValue)}};a(x),b(A,T),u(c+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of e)S.type===z.FresnelReflector&&A.set(S.id,S.drawSunBeam);const x={name:"Draw Sun Beam for All Fresnel Reflectors",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())o(S,R)},redo:()=>{i(z.FresnelReflector,x.newValue)}};a(x),i(z.FresnelReflector,T),u(c+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(d.foundationId){const A=new Map;for(const S of e)S.type===z.FresnelReflector&&S.foundationId===d.foundationId&&A.set(S.id,S.drawSunBeam);const x={name:"Draw Sun Beam for All Fresnel Reflectors Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:d.foundationId,undo:()=>{for(const[S,R]of x.oldValues.entries())o(S,R)},redo:()=>{x.groupId&&r(z.FresnelReflector,x.groupId,x.newValue)}};a(x),r(z.FresnelReflector,d.foundationId,T),u(c+1)}break}default:{const A=n(d.id),x=A?A.drawSunBeam:d.drawSunBeam,S={name:"Draw Sun Beam for Fresnel Reflector",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:d.id,changedElementType:d.type,undo:()=>{o(S.changedElementId,S.oldValue)},redo:()=>{o(S.changedElementId,S.newValue)}};a(S),o(d.id,T),u(c+1);break}}},P=()=>{t(!1)},v=()=>{C(f)};return(d==null?void 0:d.type)!==z.FresnelReflector?null:h.jsx(so,{width:500,title:Y.t("solarCollectorMenu.DrawSunBeam",g),onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:4,children:h.jsx(xc,{checked:f,onChange:T=>{p(T)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:20,children:h.jsx(Ue.Group,{onChange:y,value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("fresnelReflectorMenu.OnlyThisFresnelReflector",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("fresnelReflectorMenu.AllFresnelReflectorsAboveFoundation",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllSelectedFresnelReflectors",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllFresnelReflectors",g)})]})})})]})})},{Option:yho}=_o,Aho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(CYe),i=H(RYe),a=H(HYe),l=H(En),s=H(Mb),c=H(Ib),u=H(no),d=H(Zn),f=co(z.FresnelReflector),[p,g]=m.useState((f==null?void 0:f.receiverId)??"None"),y=Jt(),w=m.useMemo(()=>{const x=[];for(const S of n)if(S.type===z.Foundation){const R=S;R.solarStructure===Dn.FocusPipe&&x.push(R.id)}return x},[n]);m.useEffect(()=>{if(g("None"),f)if(f.receiverId)g(f.receiverId);else{const x=o(f.parentId);x&&x.type===z.Foundation&&x.solarStructure===Dn.FocusPipe&&g(x.id)}},[f]);const b=x=>{c(x.target.value)},C=x=>{switch(s){case oe.AllSelectedObjectsOfThisType:for(const S of n)if(S.type===z.FresnelReflector&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&S.receiverId!==x)return!0;break;case oe.AllObjectsOfThisType:for(const S of n)if(S.type===z.FresnelReflector&&!S.locked&&S.receiverId!==x)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const S of n)if(S.type===z.FresnelReflector&&S.foundationId===(f==null?void 0:f.foundationId)&&!S.locked&&S.receiverId!==x)return!0;break;default:if((f==null?void 0:f.receiverId)!==x)return!0}return!1},P=(x,S)=>{e(R=>{for(const M of R.elements)me.isHeliostatOrFresnelReflector(M.type)&&!M.locked&&x.has(M.id)&&(M.type===z.Heliostat?M.towerId=S:M.type===z.FresnelReflector&&(M.receiverId=S))})},v=x=>{if(f&&C(x)){switch(s){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M.receiverId);const R={name:"Set Receiver for Selected Fresnel Reflectors",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{P(R.oldValues,R.newValue)}};l(R),P(S,x),d(u+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.FresnelReflector&&S.set(M.id,M.receiverId);const R={name:"Set Receiver for All Fresnel Reflectors",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{a(z.FresnelReflector,R.newValue)}};l(R),a(z.FresnelReflector,x),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const S=new Map;for(const M of n)M.type===z.FresnelReflector&&M.foundationId===f.foundationId&&S.set(M.id,M.receiverId);const R={name:"Set Receiver for All Fresnel Reflectors Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:f.foundationId,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{R.groupId&&i(z.FresnelReflector,R.groupId,R.newValue)}};l(R),i(z.FresnelReflector,f.foundationId,x),d(u+1)}break}default:{const S=o(f.id),R=S?S.receiverId:f.receiverId,M={name:"Set Receiver for Fresnel Reflector",timestamp:Date.now(),oldValue:R,newValue:x,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(M.changedElementId,M.oldValue)},redo:()=>{r(M.changedElementId,M.newValue)}};l(M),r(f.id,x),d(u+1);break}}e(S=>{S.actionState.fresnelReflectorReceiver=x})}},T=()=>{t(!1)},A=()=>{p&&v(p)};return(f==null?void 0:f.type)!==z.FresnelReflector?null:h.jsx(so,{width:640,title:Y.t("fresnelReflectorMenu.SelectAbsorberToReflectSunlightTo",y),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:9,children:h.jsx(_o,{style:{width:"160px"},value:p,onChange:x=>{g(x)},children:w.map((x,S)=>h.jsx(yho,{value:x,children:Y.t("fresnelReflectorMenu.AbsorberPipe",y)+" "+(S+1)},S))})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:15,children:h.jsx(Ue.Group,{onChange:b,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("fresnelReflectorMenu.OnlyThisFresnelReflector",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("fresnelReflectorMenu.AllFresnelReflectorsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllSelectedFresnelReflectors",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllFresnelReflectors",y)})]})})})]})})},who=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(Iw),r=H(Xq),i=H(mW),a=H(qr),l=H(En),s=H(Mb),c=H(Ib),u=H(no),d=H(Zn),f=H(Vi),p=co(z.FresnelReflector),[g,y]=m.useState((p==null?void 0:p.ly)??9),w=m.useRef(!1),b=m.useRef(),C=Jt(),P=L=>{c(L.target.value)},v=(L,k)=>{const N=a(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.ly=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},T=(L,k)=>!v(L,k),A=L=>{if(p){switch(s){case oe.AllSelectedObjectsOfThisType:for(const k of e)if(k.type===z.FresnelReflector&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.ly-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of e)if(k.type===z.FresnelReflector&&!k.locked&&Math.abs(k.ly-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of e)if(k.type===z.FresnelReflector&&k.foundationId===(p==null?void 0:p.foundationId)&&!k.locked&&Math.abs(k.ly-L)>It)return!0;break;default:if(Math.abs((p==null?void 0:p.ly)-L)>It)return!0}return!1}},x=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.FresnelReflector&&!F.locked&&L.has(F.id)&&(F.ly=k)})},S=L=>{if(p&&A(L))switch(b.current=void 0,s){case oe.AllSelectedObjectsOfThisType:{w.current=!1;for(const k of e)if(k.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(k.id)&&T(k,L)){w.current=!0;break}if(w.current)b.current=L,y(p.ly);else{const k=new Map;for(const F of e)F.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.ly);const N={name:"Set Length for Selected Fresnel Reflectors",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())o(F,U)},redo:()=>{x(N.oldValues,N.newValue)}};l(N),x(k,L),d(u+1)}break}case oe.AllObjectsOfThisType:{w.current=!1;for(const k of e)if(k.type===z.FresnelReflector&&T(k,L)){w.current=!0;break}if(w.current)b.current=L,y(p.ly);else{const k=new Map;for(const F of e)F.type===z.FresnelReflector&&k.set(F.id,F.ly);const N={name:"Set Length for All Fresnel Reflectors",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())o(F,U)},redo:()=>{i(z.FresnelReflector,N.newValue)}};l(N),i(z.FresnelReflector,L),d(u+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){w.current=!1;for(const k of e)if(k.type===z.FresnelReflector&&k.foundationId===p.foundationId&&T(k,L)){w.current=!0;break}if(w.current)b.current=L,y(p.ly);else{const k=new Map;for(const F of e)F.type===z.FresnelReflector&&F.foundationId===p.foundationId&&k.set(F.id,F.ly);const N={name:"Set Length for All Fresnel Reflectors Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:p.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())o(F,U)},redo:()=>{N.groupId&&r(z.FresnelReflector,N.groupId,N.newValue)}};l(N),r(z.FresnelReflector,p.foundationId,L),d(u+1)}}break}default:{const k=n(p.id),N=k?k.ly:p.ly;if(w.current=T(p,L),w.current)b.current=L,y(N);else{const F={name:"Set Fresnel Reflector Length",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:p.id,changedElementType:p.type,undo:()=>{o(F.changedElementId,F.oldValue)},redo:()=>{o(F.changedElementId,F.newValue)}};l(F),o(p.id,L),d(u+1)}break}}},R=()=>{w.current=!1,t(!1)},M=()=>{R(),f()},D=()=>{S(g),w.current||(t(!1),d(0))},E=L=>{if(!p)return 1;let k=L??1;return k=Math.max(1,Math.ceil((k-p.moduleLength/2)/p.moduleLength))*p.moduleLength,k},W=()=>{S(g)};if((p==null?void 0:p.type)!==z.FresnelReflector)return null;const j=w.current?": "+Y.t("message.NotApplicableToSelectedAction",C)+(b.current!==void 0?" ("+b.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("word.Length",C),rejectedMessage:j,onApply:W,onClose:R,onClickCancel:M,onClickOk:D,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:p.moduleLength,max:200*p.moduleLength,step:p.moduleLength,style:{width:120},precision:2,value:g,onChange:L=>{L!==null&&y(E(L))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("fresnelReflectorMenu.ModuleLength",C)+": "+p.moduleLength.toFixed(1)+" "+Y.t("word.MeterAbbreviation",C),h.jsx("br",{}),Math.round(g/p.moduleLength)+" "+Y.t("fresnelReflectorMenu.ModulesLong",C),h.jsx("br",{}),Y.t("word.Maximum",C),": 200 ",Y.t("fresnelReflectorMenu.Modules",C)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",C)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("fresnelReflectorMenu.OnlyThisFresnelReflector",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("fresnelReflectorMenu.AllFresnelReflectorsAboveFoundation",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllSelectedFresnelReflectors",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllFresnelReflectors",C)})]})})})]})})},vho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(u3),i=H(Gq),a=H(gW),l=H(qr),s=H(En),c=H(Mb),u=H(Ib),d=H(no),f=H(Zn),p=H(Vi),g=co(z.FresnelReflector),[y,w]=m.useState((g==null?void 0:g.lx)??2),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.lx=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.FresnelReflector&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.lx-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.FresnelReflector&&!k.locked&&Math.abs(k.lx-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.FresnelReflector&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.lx-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.lx)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.FresnelReflector&&!F.locked&&L.has(F.id)&&(F.lx=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.lx);const N={name:"Set Width for Selected Fresnel Reflectors",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.FresnelReflector&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.FresnelReflector&&k.set(F.id,F.lx);const N={name:"Set Width for All Fresnel Reflectors",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.FresnelReflector,N.newValue)}};s(N),a(z.FresnelReflector,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.FresnelReflector&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.FresnelReflector&&F.foundationId===g.foundationId&&k.set(F.id,F.lx);const N={name:"Set Width for All Fresnel Reflectors Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.FresnelReflector,N.groupId,N.newValue)}};s(N),i(z.FresnelReflector,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.lx:g.lx;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Fresnel Reflector Width",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.fresnelReflectorWidth=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{R(y),b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.FresnelReflector)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("word.Width",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:10,step:.5,style:{width:120},precision:2,value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 10 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("fresnelReflectorMenu.OnlyThisFresnelReflector",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("fresnelReflectorMenu.AllFresnelReflectorsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllSelectedFresnelReflectors",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllFresnelReflectors",P)})]})})})]})})},xho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(DYe),i=H(EYe),a=H(FYe),l=H(qr),s=H(En),c=H(Mb),u=H(Ib),d=H(no),f=H(Zn),p=H(Vi),g=co(z.FresnelReflector),[y,w]=m.useState((g==null?void 0:g.moduleLength)??3),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.moduleLength=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.FresnelReflector&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.moduleLength-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.FresnelReflector&&!k.locked&&Math.abs(k.moduleLength-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.FresnelReflector&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.moduleLength-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.moduleLength)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.FresnelReflector&&!F.locked&&L.has(F.id)&&(F.moduleLength=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.moduleLength);else{const k=new Map;for(const F of n)F.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.moduleLength);const N={name:"Set Module Length for Selected Fresnel Reflectors",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.FresnelReflector&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.moduleLength);else{const k=new Map;for(const F of n)F.type===z.FresnelReflector&&k.set(F.id,F.moduleLength);const N={name:"Set Module Length for All Fresnel Reflectors",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.FresnelReflector,N.newValue)}};s(N),a(z.FresnelReflector,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.FresnelReflector&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.moduleLength);else{const k=new Map;for(const F of n)F.type===z.FresnelReflector&&F.foundationId===g.foundationId&&k.set(F.id,F.moduleLength);const N={name:"Set Module Length for All Fresnel Reflectors Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.FresnelReflector,N.groupId,N.newValue)}};s(N),i(z.FresnelReflector,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.moduleLength:g.moduleLength;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Fresnel Reflector Module Length",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.fresnelReflectorModuleLength=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{R(y),b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.FresnelReflector)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("fresnelReflectorMenu.ModuleLength",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:20,step:.5,style:{width:120},precision:2,value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 10 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("fresnelReflectorMenu.OnlyThisFresnelReflector",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("fresnelReflectorMenu.AllFresnelReflectorsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllSelectedFresnelReflectors",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllFresnelReflectors",P)})]})})})]})})},bho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(wW),i=H(vW),a=H(xW),l=H(qr),s=H(En),c=H(Mb),u=H(Ib),d=H(no),f=H(Zn),p=H(Vi),g=co(z.FresnelReflector),[y,w]=m.useState((g==null?void 0:g.poleHeight)??1),b=m.useRef(!1),C=m.useRef(),P=m.useRef((g==null?void 0:g.poleHeight)??1),v=Jt(),T=j=>{u(j.target.value)},A=j=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const L of n)if(L.type===z.FresnelReflector&&!L.locked&&H.getState().selectedElementIdSet.has(L.id)&&Math.abs(L.poleHeight-j)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const L of n)if(L.type===z.FresnelReflector&&!L.locked&&Math.abs(L.poleHeight-j)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const L of n)if(L.type===z.FresnelReflector&&L.foundationId===(g==null?void 0:g.foundationId)&&!L.locked&&Math.abs(L.poleHeight-j)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{if(l(g)){for(const k of n)if(k.type===z.FresnelReflector&&k.parentId===g.parentId&&!k.locked&&Math.abs(k.poleHeight-j)>It)return!0}break}default:{if(Math.abs((g==null?void 0:g.poleHeight)-j)>It)return!0;break}}return!1}},x=(j,L)=>{H.getState().set(k=>{for(const N of k.elements)N.type===z.FresnelReflector&&!N.locked&&j.has(N.id)&&(N.poleHeight=L)})},S=j=>{if(g&&A(j)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const L of n)if(L.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(L.id)&&.5*L.ly*Math.abs(Math.sin(L.tiltAngle))>j){b.current=!0;break}if(b.current)C.current=j,P.current=g.poleHeight;else{const L=new Map;for(const N of n)N.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(N.id)&&L.set(N.id,N.poleHeight);const k={name:"Set Pole Height for Selected Fresnel Reflectors",timestamp:Date.now(),oldValues:L,newValue:j,undo:()=>{for(const[N,F]of k.oldValues.entries())r(N,F)},redo:()=>{x(k.oldValues,k.newValue)}};s(k),x(L,j),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const L of n)if(L.type===z.FresnelReflector&&.5*L.ly*Math.abs(Math.sin(L.tiltAngle))>j){b.current=!0;break}if(b.current)C.current=j,P.current=g.poleHeight;else{const L=new Map;for(const N of n)N.type===z.FresnelReflector&&L.set(N.id,N.poleHeight);const k={name:"Set Pole Height for All Fresnel Reflectors",timestamp:Date.now(),oldValues:L,newValue:j,undo:()=>{for(const[N,F]of k.oldValues.entries())r(N,F)},redo:()=>{a(z.FresnelReflector,k.newValue)}};s(k),a(z.FresnelReflector,j),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const L of n)if(L.type===z.FresnelReflector&&L.foundationId===g.foundationId&&.5*L.ly*Math.abs(Math.sin(L.tiltAngle))>j){b.current=!0;break}if(b.current)C.current=j,P.current=g.poleHeight;else{const L=new Map;for(const N of n)N.type===z.FresnelReflector&&N.foundationId===g.foundationId&&L.set(N.id,N.poleHeight);const k={name:"Set Pole Height for All Fresnel Reflectors Above Foundation",timestamp:Date.now(),oldValues:L,newValue:j,groupId:g.foundationId,undo:()=>{for(const[N,F]of k.oldValues.entries())r(N,F)},redo:()=>{k.groupId&&i(z.FresnelReflector,k.groupId,k.newValue)}};s(k),i(z.FresnelReflector,g.foundationId,j),f(d+1)}}break}default:{const L=o(g.id),k=L?L.poleHeight:g.poleHeight;if(b.current=.5*g.lx*Math.abs(Math.sin(g.tiltAngle))>j,b.current)C.current=j,P.current=k;else{const N={name:"Set Fresnel Reflector Pole Height",timestamp:Date.now(),oldValue:k,newValue:j,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(N.changedElementId,N.oldValue)},redo:()=>{r(N.changedElementId,N.newValue)}};s(N),r(g.id,j),f(d+1)}break}}e(L=>{L.actionState.fresnelReflectorPoleHeight=j})}},R=()=>{t(!1)},M=()=>{R(),p()},D=()=>{S(y),b.current||(t(!1),f(0))},E=()=>{S(y)};if((g==null?void 0:g.type)!==z.FresnelReflector)return null;const W=b.current?": "+Y.t("message.NotApplicableToSelectedAction",v)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("solarCollectorMenu.ExtraPoleHeightInAdditionToHalfWidth",v),rejectedMessage:W,onApply:E,onClose:R,onClickCancel:M,onClickOk:D,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:5,style:{width:120},step:.1,precision:2,value:y,onChange:j=>{j!==null&&w(j)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",v),": [0, 5] ",Y.t("word.MeterAbbreviation",v)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",v)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:T,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("fresnelReflectorMenu.OnlyThisFresnelReflector",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("fresnelReflectorMenu.AllFresnelReflectorsAboveFoundation",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllSelectedFresnelReflectors",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllFresnelReflectors",v)})]})})})]})})},Sho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(Kq),i=H(qq),a=H($q),l=H(En),s=H(Mb),c=H(Ib),u=H(no),d=H(Zn),f=co(z.FresnelReflector),[p,g]=m.useState((f==null?void 0:f.reflectance)??.9),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.FresnelReflector&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.FresnelReflector&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.FresnelReflector&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.reflectance)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.FresnelReflector&&!R.locked&&A.has(R.id)&&(R.reflectance=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.FresnelReflector&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for Selected Fresnel Reflectors",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.FresnelReflector&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Fresnel Reflectors",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.FresnelReflector,S.newValue)}};l(S),a(z.FresnelReflector,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.FresnelReflector&&R.foundationId===f.foundationId&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Fresnel Reflectors Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.FresnelReflector,S.groupId,S.newValue)}};l(S),i(z.FresnelReflector,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.reflectance:f.reflectance,R={name:"Set Fresnel Reflector Reflectance",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.fresnelReflectorReflectance=A})}},v=()=>{t(!1)},T=()=>{P(p)};return(f==null?void 0:f.type)!==z.FresnelReflector?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,value:p,step:.01,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("fresnelReflectorMenu.OnlyThisFresnelReflector",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("fresnelReflectorMenu.AllFresnelReflectorsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllSelectedFresnelReflectors",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("fresnelReflectorMenu.AllFresnelReflectors",y)})]})})})]})})},Tho=t=>{const e=[];if(t.type!==z.FresnelReflector)return{items:e};const n=t,o={lng:H.getState().language},r=!n.locked;return e.push({key:"fresnel-reflector-copy",label:h.jsx(Ld,{})}),r&&e.push({key:"fresnel-reflector-cut",label:h.jsx(Wd,{})}),e.push({key:"fresnel-reflector-lock",label:h.jsx(Ju,{selectedElement:n})}),r&&e.push({key:"fresnel-reflector-receiver",label:h.jsxs(to,{Dialog:Aho,children:[Y.t("fresnelReflectorMenu.SelectAbsorberToReflectSunlightTo",o)," ..."]})},{key:"fresnel-reflector-length",label:h.jsxs(to,{Dialog:who,children:[Y.t("word.Length",o)," ..."]})},{key:"fresnel-reflector-width",label:h.jsxs(to,{Dialog:vho,children:[Y.t("word.Width",o)," ..."]})},{key:"fresnel-reflector-module-length",label:h.jsxs(to,{Dialog:xho,children:[Y.t("fresnelReflectorMenu.ModuleLength",o)," ..."]})},{key:"fresnel-reflector-pole-height",label:h.jsxs(to,{Dialog:bho,children:[Y.t("solarCollectorMenu.ExtraPoleHeight",o)," ..."]})},{key:"fresnel-reflector-reflectance",label:h.jsxs(to,{Dialog:Sho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",o)," ..."]})},{key:"fresnel-reflector-draw-sun-beam",label:h.jsxs(to,{Dialog:mho,children:[Y.t("solarCollectorMenu.DrawSunBeam",o)," ..."]})},{key:"fresnel-reflector-label-submenu",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",o)}),children:PA(n)}),{items:e}},Pho=({setDialogVisible:t})=>{const e=H(Kn),n=H(Gn),o=H(sYe),r=H(cYe),i=H(uYe),a=H(En),l=H(zb),s=H(Db),c=H(no),u=H(Zn),d=co(z.Heliostat),[f,p]=m.useState(!!(d!=null&&d.drawSunBeam)),g=Jt(),y=T=>{s(T.target.value)},w=T=>{switch(l){case oe.AllSelectedObjectsOfThisType:for(const A of e)if(A.type===z.Heliostat&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&A.drawSunBeam!==T)return!0;break;case oe.AllObjectsOfThisType:for(const A of e)if(A.type===z.Heliostat&&!A.locked&&A.drawSunBeam!==T)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const A of e)if(A.type===z.Heliostat&&A.foundationId===(d==null?void 0:d.foundationId)&&!A.locked&&A.drawSunBeam!==T)return!0;break;default:if((d==null?void 0:d.drawSunBeam)!==T)return!0}return!1},b=(T,A)=>{H.getState().set(x=>{for(const S of x.elements)S.type===z.Heliostat&&!S.locked&&T.has(S.id)&&(S.drawSunBeam=A)})},C=T=>{if(d&&w(T))switch(l){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of e)S.type===z.Heliostat&&H.getState().selectedElementIdSet.has(S.id)&&A.set(S.id,S.drawSunBeam);const x={name:"Draw Sun Beam for Selected Heliostats",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())o(S,R)},redo:()=>{b(x.oldValues,x.newValue)}};a(x),b(A,T),u(c+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of e)S.type===z.Heliostat&&A.set(S.id,S.drawSunBeam);const x={name:"Draw Sun Beam for All Heliostats",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())o(S,R)},redo:()=>{i(z.Heliostat,x.newValue)}};a(x),i(z.Heliostat,T),u(c+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(d.foundationId){const A=new Map;for(const S of e)S.type===z.Heliostat&&S.foundationId===d.foundationId&&A.set(S.id,S.drawSunBeam);const x={name:"Draw Sun Beam for All Heliostats Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:d.foundationId,undo:()=>{for(const[S,R]of x.oldValues.entries())o(S,R)},redo:()=>{x.groupId&&r(z.Heliostat,x.groupId,x.newValue)}};a(x),r(z.Heliostat,d.foundationId,T),u(c+1)}break}default:{const A=n(d.id),x=A?A.drawSunBeam:d.drawSunBeam,S={name:"Draw Sun Beam for Heliostat",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:d.id,changedElementType:d.type,undo:()=>{o(S.changedElementId,S.oldValue)},redo:()=>{o(S.changedElementId,S.newValue)}};a(S),o(d.id,T),u(c+1);break}}},P=()=>{t(!1)},v=()=>{C(f)};return(d==null?void 0:d.type)!==z.Heliostat?null:h.jsx(so,{width:500,title:Y.t("solarCollectorMenu.DrawSunBeam",g),onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:4,children:h.jsx(xc,{checked:f,onChange:p})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:20,children:h.jsx(Ue.Group,{onChange:y,value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("heliostatMenu.OnlyThisHeliostat",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("heliostatMenu.AllHeliostatsAboveFoundation",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("heliostatMenu.AllSelectedHeliostats",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("heliostatMenu.AllHeliostats",g)})]})})})]})})},{Option:Cho}=_o,Rho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(CYe),i=H(RYe),a=H(HYe),l=H(En),s=H(zb),c=H(Db),u=H(no),d=H(Zn),f=co(z.Heliostat),[p,g]=m.useState((f==null?void 0:f.towerId)??"None"),y=Jt(),w=m.useMemo(()=>{const x=[];for(const S of n)if(S.type===z.Foundation){const R=S;R.solarStructure===Dn.FocusTower&&x.push(R.id)}return x},[n]);m.useEffect(()=>{if(g("None"),f)if(f.towerId)g(f.towerId);else{const x=o(f.parentId);x&&x.type===z.Foundation&&x.solarStructure===Dn.FocusTower&&g(x.id)}},[f]);const b=x=>{c(x.target.value)},C=x=>{switch(s){case oe.AllSelectedObjectsOfThisType:for(const S of n)if(S.type===z.Heliostat&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&S.towerId!==x)return!0;break;case oe.AllObjectsOfThisType:for(const S of n)if(S.type===z.Heliostat&&!S.locked&&S.towerId!==x)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const S of n)if(S.type===z.Heliostat&&S.foundationId===(f==null?void 0:f.foundationId)&&!S.locked&&S.towerId!==x)return!0;break;default:if((f==null?void 0:f.towerId)!==x)return!0}return!1},P=(x,S)=>{H.getState().set(R=>{for(const M of R.elements)M.type===z.Heliostat&&!M.locked&&x.has(M.id)&&(M.towerId=S)})},v=x=>{if(f&&C(x)){switch(s){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.Heliostat&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M.towerId);const R={name:"Set Tower for Selected Heliostats",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{P(R.oldValues,R.newValue)}};l(R),P(S,x),d(u+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.Heliostat&&S.set(M.id,M.towerId);const R={name:"Set Tower for All Heliostats",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{a(z.Heliostat,R.newValue)}};l(R),a(z.Heliostat,x),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const S=new Map;for(const M of n)M.type===z.Heliostat&&M.foundationId===f.foundationId&&S.set(M.id,M.towerId);const R={name:"Set Tower for All Heliostats Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:f.foundationId,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{R.groupId&&i(z.Heliostat,R.groupId,R.newValue)}};l(R),i(z.Heliostat,f.foundationId,x),d(u+1)}break}default:{const S=o(f.id),R=S?S.towerId:f.towerId,M={name:"Set Tower for Heliostat",timestamp:Date.now(),oldValue:R,newValue:x,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(M.changedElementId,M.oldValue)},redo:()=>{r(M.changedElementId,M.newValue)}};l(M),r(f.id,x),d(u+1);break}}e(S=>{S.actionState.heliostatTower=x})}},T=()=>{t(!1)},A=()=>{p&&v(p),t(!1),d(0)};return(f==null?void 0:f.type)!==z.Heliostat?null:h.jsx(so,{width:600,title:Y.t("heliostatMenu.SelectTowerToReflectSunlightTo",y),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:8,children:h.jsx(_o,{style:{width:"120px"},value:p,onChange:g,children:w.map((x,S)=>h.jsx(Cho,{value:x,children:Y.t("heliostatMenu.Tower",y)+" "+(S+1)},S))})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:b,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("heliostatMenu.OnlyThisHeliostat",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("heliostatMenu.AllHeliostatsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("heliostatMenu.AllSelectedHeliostats",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("heliostatMenu.AllHeliostats",y)})]})})})]})})},Hho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(u3),i=H(Gq),a=H(gW),l=H(qr),s=H(En),c=H(zb),u=H(Db),d=H(no),f=H(Zn),p=H(Vi),g=co(z.Heliostat),[y,w]=m.useState((g==null?void 0:g.lx)??2),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.lx=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.Heliostat&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.lx-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.Heliostat&&!k.locked&&Math.abs(k.lx-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.Heliostat&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.lx-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.lx)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.Heliostat&&!F.locked&&L.has(F.id)&&(F.lx=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.Heliostat&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.Heliostat&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.lx);const N={name:"Set Length for Selected Heliostats",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.Heliostat&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.Heliostat&&k.set(F.id,F.lx);const N={name:"Set Length for All Heliostats",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.Heliostat,N.newValue)}};s(N),a(z.Heliostat,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.Heliostat&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.lx);else{const k=new Map;for(const F of n)F.type===z.Heliostat&&F.foundationId===g.foundationId&&k.set(F.id,F.lx);const N={name:"Set Length for All Heliostats Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.Heliostat,N.groupId,N.newValue)}};s(N),i(z.Heliostat,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.lx:g.lx;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Heliostat Length",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.heliostatLength=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{R(y),b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.Heliostat)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("word.Length",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:20,step:.5,style:{width:120},precision:2,value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 20 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("heliostatMenu.OnlyThisHeliostat",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("heliostatMenu.AllHeliostatsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("heliostatMenu.AllSelectedHeliostats",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("heliostatMenu.AllHeliostats",P)})]})})})]})})},Mho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(Iw),i=H(Xq),a=H(mW),l=H(qr),s=H(En),c=H(zb),u=H(Db),d=H(no),f=H(Zn),p=H(Vi),g=co(z.Heliostat),[y,w]=m.useState((g==null?void 0:g.ly)??4),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=L=>{u(L.target.value)},T=(L,k)=>{const N=l(L);if(N){const F=JSON.parse(JSON.stringify(L));return F.ly=k,me.isSolarCollectorWithinHorizontalSurface(F,N)}return!1},A=(L,k)=>!T(L,k),x=L=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:for(const k of n)if(k.type===z.Heliostat&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)&&Math.abs(k.ly-L)>It)return!0;break;case oe.AllObjectsOfThisType:for(const k of n)if(k.type===z.Heliostat&&!k.locked&&Math.abs(k.ly-L)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const k of n)if(k.type===z.Heliostat&&k.foundationId===(g==null?void 0:g.foundationId)&&!k.locked&&Math.abs(k.ly-L)>It)return!0;break;default:if(Math.abs((g==null?void 0:g.ly)-L)>It)return!0}return!1}},S=(L,k)=>{H.getState().set(N=>{for(const F of N.elements)F.type===z.Heliostat&&!F.locked&&L.has(F.id)&&(F.ly=k)})},R=L=>{if(g&&x(L)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.Heliostat&&H.getState().selectedElementIdSet.has(k.id)&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.ly);else{const k=new Map;for(const F of n)F.type===z.Heliostat&&H.getState().selectedElementIdSet.has(F.id)&&k.set(F.id,F.ly);const N={name:"Set Width for Selected Heliostats",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{S(N.oldValues,N.newValue)}};s(N),S(k,L),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const k of n)if(k.type===z.Heliostat&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.ly);else{const k=new Map;for(const F of n)F.type===z.Heliostat&&k.set(F.id,F.ly);const N={name:"Set Width for All Heliostats",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{a(z.Heliostat,N.newValue)}};s(N),a(z.Heliostat,L),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const k of n)if(k.type===z.Heliostat&&k.foundationId===g.foundationId&&A(k,L)){b.current=!0;break}if(b.current)C.current=L,w(g.ly);else{const k=new Map;for(const F of n)F.type===z.Heliostat&&F.foundationId===g.foundationId&&k.set(F.id,F.ly);const N={name:"Set Width for All Heliostats Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:g.foundationId,undo:()=>{for(const[F,U]of N.oldValues.entries())r(F,U)},redo:()=>{N.groupId&&i(z.Heliostat,N.groupId,N.newValue)}};s(N),i(z.Heliostat,g.foundationId,L),f(d+1)}}break}default:{const k=o(g.id),N=k?k.ly:g.ly;if(b.current=A(g,L),b.current)C.current=L,w(N);else{const F={name:"Set Heliostat Width",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(F.changedElementId,F.oldValue)},redo:()=>{r(F.changedElementId,F.newValue)}};s(F),r(g.id,L),f(d+1)}break}}e(k=>{k.actionState.heliostatWidth=L})}},M=()=>{b.current=!1,t(!1)},D=()=>{M(),p()},E=()=>{R(y),b.current||(t(!1),f(0))},W=()=>{R(y)};if((g==null?void 0:g.type)!==z.Heliostat)return null;const j=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("word.Width",P),rejectedMessage:j,onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:20,step:.5,precision:2,style:{width:120},value:y,onChange:L=>{L!==null&&w(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.MinimumValue",P),": 1 ",Y.t("word.MeterAbbreviation",P),h.jsx("br",{}),Y.t("word.MaximumValue",P),": 20 ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("heliostatMenu.OnlyThisHeliostat",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("heliostatMenu.AllHeliostatsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("heliostatMenu.AllSelectedHeliostats",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("heliostatMenu.AllHeliostats",P)})]})})})]})})},Iho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(wW),i=H(vW),a=H(xW),l=H(qr),s=H(En),c=H(zb),u=H(Db),d=H(no),f=H(Zn),p=H(Vi),g=co(z.Heliostat),[y,w]=m.useState((g==null?void 0:g.poleHeight)??1),b=m.useRef(!1),C=m.useRef(),P=Jt(),v=W=>{u(W.target.value)},T=W=>{if(g){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const j of n)if(j.type===z.Heliostat&&!j.locked&&H.getState().selectedElementIdSet.has(j.id)&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const j of n)if(j.type===z.Heliostat&&!j.locked&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const j of n)if(j.type===z.Heliostat&&j.foundationId===(g==null?void 0:g.foundationId)&&!j.locked&&Math.abs(j.poleHeight-W)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{if(l(g)){for(const L of n)if(L.type===z.Heliostat&&L.parentId===g.parentId&&!L.locked&&Math.abs(L.poleHeight-W)>It)return!0}break}default:{if(Math.abs((g==null?void 0:g.poleHeight)-W)>It)return!0;break}}return!1}},A=(W,j)=>{H.getState().set(L=>{for(const k of L.elements)k.type===z.Heliostat&&!k.locked&&W.has(k.id)&&(k.poleHeight=j)})},x=W=>{if(g&&T(W)){switch(C.current=void 0,c){case oe.AllSelectedObjectsOfThisType:{b.current=!1;for(const j of n)if(j.type===z.Heliostat&&H.getState().selectedElementIdSet.has(j.id)&&.5*Math.max(j.lx,j.ly)*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.Heliostat&&H.getState().selectedElementIdSet.has(k.id)&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for Selected Heliostats",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{A(L.oldValues,L.newValue)}};s(L),A(j,W),f(d+1)}break}case oe.AllObjectsOfThisType:{b.current=!1;for(const j of n)if(j.type===z.Heliostat&&.5*Math.max(j.lx,j.ly)*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.Heliostat&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for All Heliostats",timestamp:Date.now(),oldValues:j,newValue:W,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{a(z.Heliostat,L.newValue)}};s(L),a(z.Heliostat,W),f(d+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(g.foundationId){b.current=!1;for(const j of n)if(j.type===z.Heliostat&&j.foundationId===g.foundationId&&.5*Math.max(j.lx,j.ly)*Math.abs(Math.sin(j.tiltAngle))>W){b.current=!0;break}if(b.current)C.current=W,w(g.poleHeight);else{const j=new Map;for(const k of n)k.type===z.Heliostat&&k.foundationId===g.foundationId&&j.set(k.id,k.poleHeight);const L={name:"Set Pole Height for All Heliostats Above Foundation",timestamp:Date.now(),oldValues:j,newValue:W,groupId:g.foundationId,undo:()=>{for(const[k,N]of L.oldValues.entries())r(k,N)},redo:()=>{L.groupId&&i(z.Heliostat,L.groupId,L.newValue)}};s(L),i(z.Heliostat,g.foundationId,W),f(d+1)}}break}default:{const j=o(g.id),L=j?j.poleHeight:g.poleHeight;if(b.current=.5*Math.max(g.lx,g.ly)*Math.abs(Math.sin(g.tiltAngle))>W,b.current)C.current=W,w(L);else{const k={name:"Set Heliostat Pole Height",timestamp:Date.now(),oldValue:L,newValue:W,changedElementId:g.id,changedElementType:g.type,undo:()=>{r(k.changedElementId,k.oldValue)},redo:()=>{r(k.changedElementId,k.newValue)}};s(k),r(g.id,W),f(d+1)}break}}e(j=>{j.actionState.heliostatPoleHeight=W})}},S=()=>{b.current=!1,t(!1)},R=()=>{S(),p()},M=()=>{x(y),b.current||(t(!1),f(0))},D=()=>{x(y)};if((g==null?void 0:g.type)!==z.Heliostat)return null;const E=b.current?": "+Y.t("message.NotApplicableToSelectedAction",P)+(C.current!==void 0?" ("+C.current.toFixed(2)+")":""):null;return h.jsx(so,{width:600,title:Y.t("solarCollectorMenu.ExtraPoleHeightInAdditionToHalfWidth",P),rejectedMessage:E,onApply:D,onClose:S,onClickCancel:R,onClickOk:M,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:5,style:{width:120},step:.1,precision:2,value:y,onChange:W=>{W!==null&&w(W)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",P),": [0, 5] ",Y.t("word.MeterAbbreviation",P)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",P)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:v,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("heliostatMenu.OnlyThisHeliostat",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("heliostatMenu.AllHeliostatsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("heliostatMenu.AllSelectedHeliostats",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("heliostatMenu.AllHeliostats",P)})]})})})]})})},zho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(pYe),i=H(gYe),a=H(mYe),l=H(qr),s=H(En),c=H(zb),u=H(Db),d=H(no),f=H(Zn),p=co(z.Heliostat),[g,y]=m.useState((p==null?void 0:p.poleRadius)??.1),w=Jt(),b=x=>{u(x.target.value)},C=x=>{if(p){switch(c){case oe.AllSelectedObjectsOfThisType:{for(const S of n)if(S.type===z.Heliostat&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&Math.abs(S.poleRadius-x)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const S of n)if(S.type===z.Heliostat&&!S.locked&&Math.abs(S.poleRadius-x)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const S of n)if(S.type===z.Heliostat&&S.foundationId===(p==null?void 0:p.foundationId)&&!S.locked&&Math.abs(S.poleRadius-x)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{if(l(p)){for(const R of n)if(R.type===z.Heliostat&&R.parentId===p.parentId&&!R.locked&&Math.abs(R.poleRadius-x)>It)return!0}break}default:{if(Math.abs((p==null?void 0:p.poleRadius)-x)>It)return!0;break}}return!1}},P=(x,S)=>{H.getState().set(R=>{for(const M of R.elements)M.type===z.Heliostat&&!M.locked&&x.has(M.id)&&(M.poleRadius=S)})},v=x=>{if(p&&C(x)){switch(c){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.Heliostat&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M.poleRadius);const R={name:"Set Pole Radius for Selected Heliostats",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{P(R.oldValues,R.newValue)}};s(R),P(S,x),f(d+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of n)M.type===z.Heliostat&&S.set(M.id,M.poleRadius);const R={name:"Set Pole Radius for All Heliostats",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{a(z.Heliostat,R.newValue)}};s(R),a(z.Heliostat,x),f(d+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(p.foundationId){const S=new Map;for(const M of n)M.type===z.Heliostat&&M.foundationId===p.foundationId&&S.set(M.id,M.poleRadius);const R={name:"Set Pole Radius for All Heliostats Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:p.foundationId,undo:()=>{for(const[M,D]of R.oldValues.entries())r(M,D)},redo:()=>{R.groupId&&i(z.Heliostat,R.groupId,R.newValue)}};s(R),i(z.Heliostat,p.foundationId,x),f(d+1)}break}default:{const S=o(p.id),R=S?S.poleRadius:p.poleRadius,M={name:"Set Heliostat Pole Radius",timestamp:Date.now(),oldValue:R,newValue:x,changedElementId:p.id,changedElementType:p.type,undo:()=>{r(M.changedElementId,M.oldValue)},redo:()=>{r(M.changedElementId,M.newValue)}};s(M),r(p.id,x),f(d+1);break}}e(S=>{S.actionState.heliostatPoleRadius=x})}},T=()=>{t(!1)},A=()=>{v(g)};return(p==null?void 0:p.type)!==z.Heliostat?null:h.jsx(so,{width:600,title:Y.t("solarCollectorMenu.PoleRadius",w),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:.5,style:{width:120},step:.01,precision:2,value:g,onChange:x=>{x!==null&&y(x)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",w),": [0.1, 0.5] ",Y.t("word.MeterAbbreviation",w)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",w)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:b,value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("heliostatMenu.OnlyThisHeliostat",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("heliostatMenu.AllHeliostatsAboveFoundation",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("heliostatMenu.AllSelectedHeliostats",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("heliostatMenu.AllHeliostats",w)})]})})})]})})},Dho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(Kq),i=H(qq),a=H($q),l=H(En),s=H(zb),c=H(Db),u=H(no),d=H(Zn),f=co(z.Heliostat),[p,g]=m.useState((f==null?void 0:f.reflectance)??.9),y=Jt(),w=A=>{c(A.target.value)},b=A=>{if(f){switch(s){case oe.AllSelectedObjectsOfThisType:for(const x of n)if(x.type===z.Heliostat&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisType:for(const x of n)if(x.type===z.Heliostat&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const x of n)if(x.type===z.Heliostat&&x.foundationId===(f==null?void 0:f.foundationId)&&!x.locked&&Math.abs(x.reflectance-A)>It)return!0;break;default:if(Math.abs((f==null?void 0:f.reflectance)-A)>It)return!0}return!1}},C=(A,x)=>{H.getState().set(S=>{for(const R of S.elements)R.type===z.Heliostat&&!R.locked&&A.has(R.id)&&(R.reflectance=x)})},P=A=>{if(f&&b(A)){switch(s){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.Heliostat&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for Selected Heliostats",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{C(S.oldValues,S.newValue)}};l(S),C(x,A),d(u+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.Heliostat&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Heliostats",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{a(z.Heliostat,S.newValue)}};l(S),a(z.Heliostat,A),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(f.foundationId){const x=new Map;for(const R of n)R.type===z.Heliostat&&R.foundationId===f.foundationId&&x.set(R.id,R.reflectance);const S={name:"Set Reflectance for All Heliostats Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:f.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())r(R,M)},redo:()=>{S.groupId&&i(z.Heliostat,S.groupId,S.newValue)}};l(S),i(z.Heliostat,f.foundationId,A),d(u+1)}break}default:{const x=o(f.id),S=x?x.reflectance:f.reflectance,R={name:"Set Heliostat Reflectance",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:f.id,changedElementType:f.type,undo:()=>{r(R.changedElementId,R.oldValue)},redo:()=>{r(R.changedElementId,R.newValue)}};l(R),r(f.id,A),d(u+1);break}}e(x=>{x.actionState.heliostatReflectance=A})}},v=()=>{t(!1)},T=()=>{P(p),t(!1),d(0)};return(f==null?void 0:f.type)!==z.Heliostat?null:h.jsx(so,{width:600,title:Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",y),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},precision:2,step:.01,value:p,onChange:A=>{A!==null&&g(A)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:s,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("heliostatMenu.OnlyThisHeliostat",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("heliostatMenu.AllHeliostatsAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("heliostatMenu.AllSelectedHeliostats",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("heliostatMenu.AllHeliostats",y)})]})})})]})})},Eho=t=>{const e=[];if(t.type!==z.Heliostat)return{items:e};const n=t,o={lng:H.getState().language},r=!n.locked;return e.push({key:"heliostat-copy",label:h.jsx(Ld,{})}),r&&e.push({key:"heliostat-cut",label:h.jsx(Wd,{})}),e.push({key:"heliostat-lock",label:h.jsx(Ju,{selectedElement:n})}),r&&e.push({key:"heliostat-tower",label:h.jsxs(to,{Dialog:Rho,children:[Y.t("heliostatMenu.SelectTowerToReflectSunlightTo",o)," ..."]})},{key:"heliostat-length",label:h.jsxs(to,{Dialog:Hho,children:[Y.t("word.Length",o)," ..."]})},{key:"heliostat-width",label:h.jsxs(to,{Dialog:Mho,children:[Y.t("word.Width",o)," ..."]})},{key:"heliostat-pole-height",label:h.jsxs(to,{Dialog:Iho,children:[Y.t("solarCollectorMenu.ExtraPoleHeight",o)," ..."]})},{key:"heliostat-pole-radius",label:h.jsxs(to,{Dialog:zho,children:[Y.t("solarCollectorMenu.PoleRadius",o)," ..."]})},{key:"heliostat-reflectance",label:h.jsxs(to,{Dialog:Dho,children:[Y.t("concentratedSolarPowerCollectorMenu.ReflectorReflectance",o)," ..."]})},{key:"heliostat-draw-sun-beam",label:h.jsxs(to,{Dialog:Pho,children:[Y.t("solarCollectorMenu.DrawSunBeam",o)," ..."]})},{key:"heliostat-label-submenu",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",o)}),children:PA(n)}),{items:e}},{Option:ym}=_o,Fho=be.memo(({tree:t})=>{const e=H(fn),n=H(En),[o,r]=m.useState(!1),i=Jt(),a=(l,s)=>{e(c=>{for(const u of c.elements)if(u.type===z.Tree&&u.id===l){u.name=s;break}})};return h.jsxs(_o,{style:{width:"160px"},value:(t==null?void 0:t.name)??pr.Pine,onChange:l=>{if(t){const s=t.name;if(s!==l){const c={name:"Change Tree",timestamp:Date.now(),oldValue:s,newValue:l,changedElementId:t.id,changedElementType:t.type,undo:()=>{a(c.changedElementId,c.oldValue)},redo:()=>{a(c.changedElementId,c.newValue)}};n(c),a(t.id,l),e(u=>{u.actionState.treeType=l}),r(!o)}}},children:[h.jsxs(ym,{value:pr.Apple,children:[h.jsx("img",{alt:pr.Apple,src:sde,height:20,style:{paddingRight:"8px"}})," ",Y.t("tree.Apple",i)]},pr.Apple),h.jsxs(ym,{value:pr.Birch,children:[h.jsx("img",{alt:pr.Birch,src:cde,height:20,style:{paddingRight:"20px"}})," ",Y.t("tree.Birch",i)]},pr.Birch),h.jsxs(ym,{value:pr.Coconut,children:[h.jsx("img",{alt:pr.Coconut,src:nQe,height:20,style:{paddingRight:"18px"}})," ",Y.t("tree.Coconut",i)]},pr.Coconut),h.jsxs(ym,{value:pr.Dogwood,children:[h.jsx("img",{alt:pr.Dogwood,src:ude,height:20,style:{paddingRight:"10px"}})," ",Y.t("tree.Dogwood",i)]},pr.Dogwood),h.jsxs(ym,{value:pr.Elm,children:[h.jsx("img",{alt:pr.Elm,src:dde,height:20,style:{paddingRight:"20px"}}),Y.t("tree.Elm",i)]},pr.Elm),h.jsxs(ym,{value:pr.FanPalm,children:[h.jsx("img",{alt:pr.FanPalm,src:oQe,height:20,style:{paddingRight:"18px"}})," ",Y.t("tree.FanPalm",i)]},pr.FanPalm),h.jsxs(ym,{value:pr.Linden,children:[h.jsx("img",{alt:pr.Linden,src:fde,height:20,style:{paddingRight:"10px"}})," ",Y.t("tree.Linden",i)]},pr.Linden),h.jsxs(ym,{value:pr.Magnolia,children:[h.jsx("img",{alt:pr.Magnolia,src:hde,height:20,style:{paddingRight:"10px"}})," ",Y.t("tree.Magnolia",i)]},pr.Magnolia),h.jsxs(ym,{value:pr.Maple,children:[h.jsx("img",{alt:pr.Maple,src:pde,height:20,style:{paddingRight:"12px"}})," ",Y.t("tree.Maple",i)]},pr.Maple),h.jsxs(ym,{value:pr.Oak,children:[h.jsx("img",{alt:pr.Oak,src:gde,height:20,style:{paddingRight:"17px"}}),Y.t("tree.Oak",i)]},pr.Oak),h.jsxs(ym,{value:pr.Pine,children:[h.jsx("img",{alt:pr.Pine,src:rQe,height:20,style:{paddingRight:"18px"}})," ",Y.t("tree.Pine",i)]},pr.Pine),h.jsxs(ym,{value:pr.Spruce,children:[h.jsx("img",{alt:pr.Spruce,src:iQe,height:20,style:{paddingRight:"20px"}})," ",Y.t("tree.Spruce",i)]},pr.Spruce)]})}),kho=t=>{const e=[];if(t.type!==z.Tree)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language};return e.push({key:"tree-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"tree-cut",label:h.jsx(Wd,{})}),e.push({key:"tree-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&(e.push({key:"tree-show-model",label:h.jsx(Ldo,{tree:n})},{key:"tree-flip",label:h.jsx(z9e,{billboardModel:n})}),e.push({key:"tree-change-type",label:h.jsxs(rn,{stayAfterClick:!0,children:[h.jsxs(en,{style:{width:"100px"},children:[Y.t("treeMenu.Type",r),": "]}),h.jsx(Fho,{tree:n})]})},{key:"tree-spread",label:h.jsx(Wdo,{tree:n})},{key:"tree-height",label:h.jsx(Ndo,{tree:n})},{key:"tree-label-submenu",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",r)}),children:PA(n)})),{items:e}},Lho=({wall:t,objectType:e,modalTitle:n,onClickOk:o,children:r})=>{const i=H.getState().removeAllChildElementsByType,a=()=>{const s=H.getState().elements.filter(d=>!d.locked&&d.type===e&&d.parentId===t.id);i(t.id,e);const c=JSON.parse(JSON.stringify(s)),u={name:`Remove All ${e}s on Wall`,timestamp:Date.now(),parentId:t.id,removedElements:c,undo:()=>{H.getState().set(d=>{d.elements.push(...u.removedElements)})},redo:()=>{i(u.parentId,e)}};H.getState().addUndoable(u)},l=()=>{const s=o??a;Oi.confirm({title:n,icon:h.jsx(ny,{}),onOk:s})};return h.jsx(rn,{update:!0,noPadding:!0,onClick:l,children:r})},zHe=({wall:t,objectType:e,lock:n,children:o})=>{const r=H.getState().updateElementLockById,i=H.getState().updateElementLockByParentId,a=()=>{const l=e.replaceAll(" ",""),s=new Map;for(const d of H.getState().elements)d.parentId===t.id&&d.type===e&&s.set(d.id,!!d.locked);i(t.id,e,n);const u={name:n?`Lock All Unlocked ${l} on Wall`:`Unlock All Locked ${l} on Wall`,timestamp:Date.now(),oldValues:s,newValue:!0,undo:()=>{for(const[d,f]of u.oldValues.entries())r(d,f)},redo:()=>{i(t.id,e,n)}};H.getState().addUndoable(u)};return h.jsx(rn,{stayAfterClick:!0,update:!0,noPadding:!0,onClick:a,children:o})},Who=({wall:t})=>{const e=Jt(),n=H.getState().set,o=(i,a)=>{n(l=>{const s=l.elements.find(c=>c.id===i&&c.type===z.Wall);s&&(s.parapet.display=a)})},r=i=>{const a=i.target.checked,l={name:"Parapet",timestamp:Date.now(),checked:a,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{o(t.id,!l.checked)},redo:()=>{o(t.id,l.checked)}};H.getState().addUndoable(l),o(t.id,a),n(s=>{s.actionState.wallParapet.display=a})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.parapet.display,onChange:r,children:Y.t("wallMenu.Parapet",e)})})},Nho=({wall:t})=>{const e=Jt(),n=(i,a)=>{H.getState().set(l=>{for(const s of l.elements)if(s.id===i&&s.type===z.Wall){const c=s;c.wallStructure=a,(a===gc.Stud||a===gc.Pillar)&&(c.opacity=0);break}})},o=i=>{const a={name:"Select Wall Structure",timestamp:Date.now(),oldValue:t.wallStructure,newValue:i.target.value,changedElementId:t.id,changedElementType:t.type,undo:()=>{n(a.changedElementId,a.oldValue)},redo:()=>{n(a.changedElementId,a.newValue)}};H.getState().addUndoable(a),n(t.id,i.target.value),H.getState().set(l=>{l.actionState.wallStructure=i.target.value,(l.actionState.wallStructure===gc.Stud||l.actionState.wallStructure===gc.Pillar)&&(l.actionState.wallOpacity=0)})},r=t.wallStructure??gc.Default;return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Ue.Group,{value:r,onChange:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:gc.Default,children:Y.t("wallMenu.DefaultStructure",e)}),h.jsx(Ue,{style:{width:"100%"},value:gc.Stud,children:Y.t("wallMenu.StudStructure",e)}),h.jsx(Ue,{style:{width:"100%"},value:gc.Pillar,children:Y.t("wallMenu.PillarStructure",e)})]})})})},Uho=({wall:t})=>{const e=H.getState().set,n=Jt(),o=(i,a,l)=>{const{cx:s,cy:c,cz:u}=a,d=l?l.rotation[2]+a.relativeAngle:a.relativeAngle;if(l&&d!==void 0){const f=me.wallAbsolutePosition(new ie(s,c,u),l).setZ(a.lz/2+l.lz);return new ie().subVectors(i,f).applyEuler(new nn(0,0,-d))}return new ie},r=()=>{const i=H.getState().getFoundation(t);if(!i)return;const a=o(H.getState().pastePoint,t,i),l=Ga.makePolygon(t,-a.x/t.lx,0,-a.z/t.lz,new ie(0,0,1),[0,0,0],z.Wall);e(c=>{c.elements.push(l),c.objectTypeToAdd=z.None});const s={name:"Add",timestamp:Date.now(),addedElement:l,undo:()=>{H.getState().removeElementById(s.addedElement.id,!1)},redo:()=>{e(c=>{c.elements.push(s.addedElement),c.selectedElement=s.addedElement})}};H.getState().addUndoable(s)};return h.jsx(rn,{onClick:r,children:Y.t("foundationMenu.AddPolygon",n)})},jho=({wall:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&l.type===z.Wall){l.fill=i;break}})},o=r=>{const i={name:"Select Wall Fill",timestamp:Date.now(),oldValue:t.fill,newValue:r.target.value,changedElementId:t.id,changedElementType:t.type,undo:()=>{n(i.changedElementId,i.oldValue)},redo:()=>{n(i.changedElementId,i.newValue)}};H.getState().addUndoable(i),n(t.id,r.target.value)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Ue.Group,{value:t.fill,onChange:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:El.Full,children:Y.t("wallMenu.Full",e)}),h.jsx(Ue,{style:{width:"100%"},value:El.Partial,children:Y.t("wallMenu.Partial",e)}),h.jsx(Ue,{style:{width:"100%"},value:El.Empty,children:Y.t("wallMenu.Empty",e)})]})})})},Bho=({wall:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&l.type===z.Wall){l.openToOutside=i;break}})},o=r=>{const i={name:"Set Open to Outside",timestamp:Date.now(),oldValue:!!t.openToOutside,newValue:r.target.checked,changedElementId:t.id,changedElementType:t.type,undo:()=>{n(i.changedElementId,i.oldValue)},redo:()=>{n(i.changedElementId,i.newValue)}};H.getState().addUndoable(i),n(t.id,r.target.checked)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:!!t.openToOutside,onChange:o,children:Y.t("wallMenu.OpenToOutside",e)})})},Bae=[{key:"solarPanelCount",lockedKey:"lockedSolarPanelCount",objectType:z.SolarPanel},{key:"windowCount",lockedKey:"lockedWindowCount",objectType:z.Window},{key:"doorCount",lockedKey:"lockedDoorCount",objectType:z.Door},{key:"sensorCount",lockedKey:"lockedSensorCount",objectType:z.Sensor},{key:"polygonCount",lockedKey:"lockedPolygonCount",objectType:z.Polygon},{key:"outsideLightCount",lockedKey:"lockedLightCount",objectType:z.Light}],Yho=(t,e)=>{const n={lng:H.getState().language};let o="",r="";switch(t){case z.SolarPanel:{o=`${Y.t("wallMenu.RemoveAllUnlockedSolarPanels",n)} (${e})`,r=`${Y.t("wallMenu.DoYouReallyWantToRemoveAllSolarPanelsOnThisWall",n)} (${e} ${Y.t("wallMenu.SolarPanels",n)})`;break}case z.Window:{o=`${Y.t("wallMenu.RemoveAllUnlockedWindows",n)} (${e})`,r=`${Y.t("wallMenu.DoYouReallyWantToRemoveAllWindowsOnThisWall",n)} (${e} ${Y.t("wallMenu.Windows",n)})`;break}case z.Door:{o=`${Y.t("wallMenu.RemoveAllUnlockedDoors",n)} (${e})`,r=`${Y.t("wallMenu.DoYouReallyWantToRemoveAllDoorsOnThisWall",n)} (${e} ${Y.t("wallMenu.Doors",n)})`;break}case z.Sensor:{o=`${Y.t("wallMenu.RemoveAllUnlockedSensors",n)} (${e})`,r=`${Y.t("wallMenu.DoYouReallyWantToRemoveAllSensorsOnThisWall",n)} (${e} ${Y.t("wallMenu.Sensors",n)})`;break}case z.Light:{o=`${Y.t("wallMenu.RemoveAllUnlockedLights",n)} (${e})`,r=`${Y.t("wallMenu.DoYouReallyWantToRemoveAllLightsOnThisWall",n)} (${e} ${Y.t("wallMenu.Lights",n)})`;break}case z.Polygon:{o=`${Y.t("wallMenu.RemoveAllUnlockedPolygons",n)} (${e})`,r=`${Y.t("wallMenu.DoYouReallyWantToRemoveAllPolygonsOnThisWall",n)} (${e} ${Y.t("wallMenu.Polygons",n)})`;break}}return{itemLabel:o,modalTitle:r}},Yae=(t,e,n,o)=>n===z.Light?o?t.lockedLightCount:t.insideLightCount+t.outsideLightCount:t[e],Oho=(t,e,n)=>{const o=[],r={lng:H.getState().language};return Bae.forEach(({key:i,objectType:a})=>{const l=Yae(n,i,a);if(typeof l=="number"&&l>0){const{itemLabel:s,modalTitle:c}=Yho(a,l),u=a.replaceAll(" ","");o.push({key:`remove-all-${u}s-on-wall`,label:h.jsx(Lho,{wall:t,objectType:a,modalTitle:c,children:s})})}}),Bae.forEach(({key:i,objectType:a})=>{const l=Yae(n,i,a);if(typeof l=="number"&&l>0){const s=a.replaceAll(" ","");o.push({key:`lock-all-${s}s-on-wall`,label:h.jsxs(zHe,{wall:t,objectType:a,lock:!0,children:[Y.t(`wallMenu.LockAllUnlocked${s}s`,r)," (",l,")"]})})}}),Bae.forEach(({lockedKey:i,objectType:a})=>{const l=Yae(e,i,a,!0);if(typeof l=="number"&&l>0){const s=a.replaceAll(" ","");o.push({key:`unlock-all-${s}s-on-wall`,label:h.jsxs(zHe,{wall:t,objectType:a,lock:!1,children:[Y.t(`wallMenu.UnlockAllLocked${s}s`,r)," (",l,")"]})})}}),e.outsideLightCount>0&&o.push({key:"inside-lights-on-wall",label:h.jsxs(gX,{element:t,inside:!0,children:[Y.t("wallMenu.AllLightsOnWallInside",r)," (",e.outsideLightCount,")"]})}),e.insideLightCount>0&&o.push({key:"outside-lights-on-wall",label:h.jsxs(gX,{element:t,inside:!1,children:[Y.t("wallMenu.AllLightsOnWallOutside",r)," (",e.insideLightCount,")"]})}),o},_ho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(p3),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Wall),c=Jt(),[u,d]=XZ((s==null?void 0:s.parapet.color)??"#ffffff"),f=(T,A)=>{e(x=>{for(const S of x.elements)if(S.id===T&&S.type===z.Wall&&!S.locked){S.parapet.color=A;break}})},p=T=>{if(!s)return;const A=me.getAllConnectedWalls(s);A.length!==0&&e(x=>{for(const S of A)if(!S.locked)for(const R of x.elements)R.id===S.id&&R.type===z.Wall&&(R.parapet.color=T)})},g=(T,A)=>{e(x=>{for(const S of x.elements)S.parentId===T&&S.type===z.Wall&&!S.locked&&(S.parapet.color=A)})},y=T=>{e(A=>{for(const x of A.elements)x.type===z.Wall&&!x.locked&&(x.parapet.color=T)})},w=(T,A)=>{e(x=>{for(const S of x.elements)S.type===z.Wall&&!S.locked&&T.has(S.id)&&(S.parapet.color=A)})},b=T=>{if(s){switch(r){case oe.AllSelectedObjectsOfThisType:{for(const A of n)if(A.type===z.Wall&&T!==A.parapet.color&&!A.locked&&H.getState().selectedElementIdSet.has(A.id))return!0;break}case oe.AllObjectsOfThisType:{for(const A of n)if(A.type===z.Wall&&T!==A.parapet.color&&!A.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const A of n)if(A.type===z.Wall&&A.foundationId===s.foundationId&&T!==A.parapet.color&&!A.locked)return!0;break}case oe.AllConnectedObjects:{const A=me.getAllConnectedWalls(s);for(const x of A)if(T!==x.parapet.color&&!x.locked)return!0;break}default:{if(T!==(s==null?void 0:s.parapet.color))return!0;break}}return!1}},C=T=>{if(s&&b(T)){switch(r){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Wall&&H.getState().selectedElementIdSet.has(S.id)&&A.set(S.id,S.parapet.color??"#ffffff");const x={name:"Set Parapet Color for Selected Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{w(x.oldValues,x.newValue)}};o(x),w(A,T),a(i+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Wall&&A.set(S.id,S.parapet.color??"#ffffff");const x={name:"Set Parapet Color for All Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{y(x.newValue)}};o(x),y(T),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const A=new Map;for(const S of n)S.type===z.Wall&&S.foundationId===s.foundationId&&A.set(S.id,S.parapet.color??"#ffffff");const x={name:"Set Parapet Color for All Walls Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.foundationId,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{x.groupId&&g(x.groupId,x.newValue)}};o(x),g(s.foundationId,T),a(i+1)}break;case oe.AllConnectedObjects:if(s){const A=me.getAllConnectedWalls(s),x=new Map;for(const R of A)x.set(R.id,R.color??"#ffffff");const S={name:"Set Parapet Color for All Connected Walls",timestamp:Date.now(),oldValues:x,newValue:T,undo:()=>{for(const[R,M]of S.oldValues.entries())f(R,M)},redo:()=>{p(S.newValue)}};o(S),p(T),a(i+1)}break;default:if(s){const A=l(s.id),x=(A==null?void 0:A.parapet.color)??s.parapet.color??"#ffffff",S={name:"Set Parapet Color of Selected Wall",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(S.changedElementId,S.oldValue)},redo:()=>{f(S.changedElementId,S.newValue)}};o(S),f(s.id,T),a(i+1)}}e(A=>{A.actionState.wallParapet.color=T})}},P=()=>{C(u)},v=()=>{t(!1)};return h.jsx(so,{width:640,title:Y.t("wallMenu.ParapetColor",c),onApply:P,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:u,onChangeComplete:d})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:T=>H.getState().setWallActionScope(T.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",c)})]})})})]})})},xrt="/aladdin/assets/wall_01_menu-BlJdKfby.png",brt="/aladdin/assets/wall_02_menu-DfsmvvWJ.png",Srt="/aladdin/assets/wall_03_menu-B95_FEuA.png",Trt="/aladdin/assets/wall_04_menu-D-Kn25E7.png",Prt="/aladdin/assets/wall_05_menu-DGgjaMY9.png",Crt="/aladdin/assets/wall_06_menu-EOIch2eu.png",Rrt="/aladdin/assets/wall_07_menu-DvXS_qn2.png",Hrt="/aladdin/assets/wall_08_menu-CfftE2pF.png",Mrt="/aladdin/assets/wall_09_menu-_O8A0WOE.png",Irt="/aladdin/assets/wall_10_menu-B5QfhD3g.png",Vho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(p3),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Wall),[c,u]=m.useState((s==null?void 0:s.parapet.textureType)??Uo.Default),d=Jt(),{Option:f}=_o,p=(A,x)=>{e(S=>{for(const R of S.elements)if(R.type===z.Wall&&R.id===A&&!R.locked){R.parapet.textureType=x;break}})},g=A=>{if(!s)return;const x=me.getAllConnectedWalls(s);x.length!==0&&e(S=>{for(const R of x)if(!R.locked)for(const M of S.elements)M.id===R.id&&M.type===z.Wall&&(M.parapet.textureType=A)})},y=(A,x)=>{e(S=>{for(const R of S.elements)R.type===z.Wall&&R.foundationId===A&&!R.locked&&(R.parapet.textureType=x)})},w=A=>{e(x=>{for(const S of x.elements)S.type===z.Wall&&!S.locked&&(S.parapet.textureType=A)})},b=(A,x)=>{e(S=>{for(const R of S.elements)R.type===z.Wall&&!R.locked&&A.has(R.id)&&(R.parapet.textureType=x)})},C=A=>{if(s){switch(r){case oe.AllSelectedObjectsOfThisType:{for(const x of n)if(x.type===z.Wall&&A!==x.parapet.textureType&&!x.locked&&H.getState().selectedElementIdSet.has(x.id))return!0;break}case oe.AllObjectsOfThisType:{for(const x of n)if(x.type===z.Wall&&A!==x.parapet.textureType&&!x.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const x of n)if(x.type===z.Wall&&x.foundationId===s.foundationId&&A!==x.parapet.textureType&&!x.locked)return!0;break}case oe.AllConnectedObjects:{const x=me.getAllConnectedWalls(s);for(const S of x)if(A!==S.parapet.textureType&&!S.locked)return!0;break}default:{if(A!==(s==null?void 0:s.parapet.textureType))return!0;break}}return!1}},P=A=>{if(s&&C(A)){switch(r){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.Wall&&!R.locked&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.parapet.textureType??Uo.Default);const S={name:"Set Parapet Texture for Selected Walls",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())p(R,M)},redo:()=>{b(S.oldValues,S.newValue)}};o(S),b(x,A),a(i+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.Wall&&!R.locked&&x.set(R.id,R.parapet.textureType??Uo.Default);const S={name:"Set Parapet Texture for All Walls",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())p(R,M)},redo:()=>{w(S.newValue)}};o(S),w(A),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const x=new Map;for(const R of n)R.type===z.Wall&&R.foundationId===s.foundationId&&!R.locked&&x.set(R.id,R.parapet.textureType);const S={name:"Set Parapet Texture for All Walls Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:s.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())p(R,M)},redo:()=>{S.groupId&&y(S.groupId,S.newValue)}};o(S),y(s.foundationId,A),a(i+1)}break;case oe.AllConnectedObjects:if(s){const x=me.getAllConnectedWalls(s),S=new Map;for(const M of x)S.set(M.id,M.parapet.textureType);const R={name:"Set Parapet Texture for All Connected Walls",timestamp:Date.now(),oldValues:S,newValue:A,undo:()=>{for(const[M,D]of R.oldValues.entries())p(M,D)},redo:()=>{g(R.newValue)}};o(R),g(A),a(i+1)}break;default:if(s){const x=l(s.id),S=(x==null?void 0:x.parapet.textureType)??s.parapet.textureType,R={name:"Set Parapet Texture of Selected Wall",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(R.changedElementId,R.oldValue)},redo:()=>{p(R.changedElementId,R.newValue)}};o(R),p(s.id,A),a(i+1)}}e(x=>{x.actionState.wallParapet.textureType=A})}},v=()=>{t(!1)},T=()=>{P(c)};return h.jsx(so,{width:550,title:Y.t("word.Texture",d),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:9,children:h.jsxs(_o,{style:{width:"150px"},value:c,onChange:u,children:[h.jsxs(f,{value:Uo.NoTexture,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"32px",height:"20px",border:"1px dashed dimGray"},children:" "}),Y.t("shared.NoTexture",d)]},Uo.NoTexture),h.jsxs(f,{value:Uo.Default,children:[h.jsx("img",{alt:Uo.Default,src:Eye,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.TextureDefault",d)]},Uo.Default),h.jsxs(f,{value:Uo.Texture01,children:[h.jsx("img",{alt:Uo.Texture01,src:xrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture01",d)]},Uo.Texture01),h.jsxs(f,{value:Uo.Texture02,children:[h.jsx("img",{alt:Uo.Texture02,src:brt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture02",d)]},Uo.Texture02),h.jsxs(f,{value:Uo.Texture03,children:[h.jsx("img",{alt:Uo.Texture03,src:Srt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture03",d)]},Uo.Texture03),h.jsxs(f,{value:Uo.Texture04,children:[h.jsx("img",{alt:Uo.Texture04,src:Trt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture04",d)]},Uo.Texture04),h.jsxs(f,{value:Uo.Texture05,children:[h.jsx("img",{alt:Uo.Texture05,src:Prt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture05",d)]},Uo.Texture05),h.jsxs(f,{value:Uo.Texture06,children:[h.jsx("img",{alt:Uo.Texture06,src:Crt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture06",d)]},Uo.Texture06),h.jsxs(f,{value:Uo.Texture07,children:[h.jsx("img",{alt:Uo.Texture07,src:Rrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture07",d)]},Uo.Texture07),h.jsxs(f,{value:Uo.Texture08,children:[h.jsx("img",{alt:Uo.Texture08,src:Hrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture08",d)]},Uo.Texture08),h.jsxs(f,{value:Uo.Texture09,children:[h.jsx("img",{alt:Uo.Texture09,src:Mrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture09",d)]},Uo.Texture09),h.jsxs(f,{value:Uo.Texture10,children:[h.jsx("img",{alt:Uo.Texture10,src:Irt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture10",d)]},Uo.Texture10)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:15,children:h.jsx(Ue.Group,{onChange:A=>H.getState().setWallActionScope(A.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",d)})]})})})]})})},Oae=({wall:t,dataType:e,attributeKey:n,range:o,step:r,unit:i,setDialogVisible:a})=>{const l=H(Kn),s=H(En),c=H(p3),u=H(no),d=H(Zn),f=H(fn),p=m.useRef(t.parapet[n]),g=Jt(),y=R=>{f(M=>{switch(n){case"copingsHeight":M.actionState.wallParapet.copingsHeight=R;break;case"copingsWidth":M.actionState.wallParapet.copingsWidth=R;break;case"parapetHeight":M.actionState.wallParapet.parapetHeight=R;break}})},w=(R,M)=>{f(D=>{for(const E of D.elements)if(E.id===R&&E.type===z.Wall&&!E.locked){E.parapet[n]=M;break}}),y(M)},b=R=>{const M=me.getAllConnectedWalls(t);M.length!==0&&(f(D=>{for(const E of M)if(!E.locked)for(const W of D.elements)W.id===E.id&&W.type===z.Wall&&(W.parapet[n]=R)}),y(R))},C=(R,M)=>{f(D=>{for(const E of D.elements)E.parentId===R&&E.type===z.Wall&&!E.locked&&(E.parapet[n]=M)}),y(M)},P=R=>{f(M=>{for(const D of M.elements)D.type===z.Wall&&!D.locked&&(D.parapet[n]=R)}),y(R)},v=(R,M)=>{f(D=>{for(const E of D.elements)E.type===z.Wall&&!E.locked&&R.has(E.id)&&(E.parapet[n]=M)}),y(M)},T=R=>{switch(c){case oe.AllSelectedObjectsOfThisType:{for(const M of l)if(M.type===z.Wall&&R!==M.parapet[n]&&!M.locked&&H.getState().selectedElementIdSet.has(M.id))return!0;break}case oe.AllObjectsOfThisType:{for(const M of l)if(M.type===z.Wall&&R!==M.parapet[n]&&!M.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const M of l)if(M.type===z.Wall&&M.foundationId===t.foundationId&&R!==M.parapet[n]&&!M.locked)return!0;break}case oe.AllConnectedObjects:{const M=me.getAllConnectedWalls(t);for(const D of M)if(R!==D.parapet[n]&&!D.locked)return!0;break}default:{if(R!==t.parapet[n])return!0;break}}return!1},A=R=>{if(t&&T(R))switch(c){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of l)E.type===z.Wall&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E.parapet[n]);const D={name:`Set ${e} for Selected Walls`,timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{v(D.oldValues,D.newValue)}};s(D),v(M,R),d(u+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of l)E.type===z.Wall&&M.set(E.id,E.parapet[n]);const D={name:`Set ${e} for All Walls`,timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{P(D.newValue)}};s(D),P(R),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(t.foundationId){const M=new Map;for(const E of l)E.type===z.Wall&&E.foundationId===t.foundationId&&M.set(E.id,E.parapet[n]);const D={name:`Set ${e} for All Walls Above Foundation`,timestamp:Date.now(),oldValues:M,newValue:R,groupId:t.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{D.groupId&&C(D.groupId,D.newValue)}};s(D),C(t.foundationId,R),d(u+1)}break;case oe.AllConnectedObjects:if(t){const M=me.getAllConnectedWalls(t),D=new Map;for(const W of M)D.set(W.id,W.parapet[n]);const E={name:`Set ${e} for All Connected Walls`,timestamp:Date.now(),oldValues:D,newValue:R,undo:()=>{for(const[W,j]of E.oldValues.entries())w(W,j)},redo:()=>{b(E.newValue)}};s(E),b(R),d(u+1)}break;default:if(t){const M=t.parapet[n],D={name:`Set Wall ${e}`,timestamp:Date.now(),oldValue:M,newValue:R,changedElementId:t.id,changedElementType:t.type,undo:()=>{w(D.changedElementId,D.oldValue)},redo:()=>{w(D.changedElementId,D.newValue)}};s(D),w(t.id,R),d(u+1)}}},x=()=>{a(!1)},S=()=>{A(p.current)};return h.jsx(so,{width:550,title:Y.t(`wallMenu.${e}`,g),onApply:S,onClose:x,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:o[0],max:o[1],style:{width:120},step:r,precision:2,defaultValue:t.parapet[n],onChange:R=>p.current=R}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",g),": [",o.toString(),"] ",i]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:i??" "}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:R=>H.getState().setWallActionScope(R.target.value),value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",g)})]})})})]})})};var mV=(t=>(t.ParapetHeight="ParapetHeight",t.CopingsHeight="CopingsHeight",t.CopingsWidth="CopingsWidth",t))(mV||{});const Gho={ParapetHeight:{attributeKey:"parapetHeight",range:[0,5],step:.01,unit:"word.MeterAbbreviation"},CopingsHeight:{attributeKey:"copingsHeight",range:[0,1],step:.01,unit:"word.MeterAbbreviation"},CopingsWidth:{attributeKey:"copingsWidth",range:[0,3],step:.01,unit:"word.MeterAbbreviation"}},_ae=({Dialog:t,wall:e,dataType:n,children:o})=>{const r=Jt(),[i,a]=m.useState(!1),l=()=>{H.getState().setApplyCount(0),a(!0)},s=Gho[n];return h.jsxs(h.Fragment,{children:[h.jsx(rn,{noPadding:!0,onClick:l,children:o}),i&&h.jsx(t,{wall:e,dataType:n,attributeKey:s.attributeKey,range:s.range,step:s.step,unit:s.unit?Y.t(s.unit,r):void 0,setDialogVisible:a})]})},Xho=t=>{const e={lng:H.getState().language},n=[];return n.push({key:"parapet-checkbox",label:h.jsx(Who,{wall:t})}),t.parapet.display&&n.push({type:"divider"},{key:"parapet-color",label:h.jsxs(to,{noPadding:!0,Dialog:_ho,children:[Y.t("wallMenu.ParapetColor",e)," ..."]})},{key:"parapet-texture",label:h.jsxs(to,{noPadding:!0,Dialog:Vho,children:[Y.t("wallMenu.ParapetTexture",e)," ..."]})},{key:"parapet-height",label:h.jsxs(_ae,{wall:t,dataType:mV.ParapetHeight,Dialog:Oae,children:[Y.t("wallMenu.ParapetHeight",e)," ..."]})},{key:"copings-height",label:h.jsxs(_ae,{wall:t,dataType:mV.CopingsHeight,Dialog:Oae,children:[Y.t("wallMenu.CopingsHeight",e)," ..."]})},{key:"copings-width",label:h.jsxs(_ae,{wall:t,dataType:mV.CopingsWidth,Dialog:Oae,children:[Y.t("wallMenu.CopingsWidth",e)," ..."]})}),n},cC=({wall:t,dataType:e,attributeKey:n,range:o,step:r,unit:i,setDialogVisible:a})=>{const l=H(Kn),s=H(En),c=H(p3),u=H(no),d=H(Zn),f=H(fn),p=m.useRef(t[n]),g=Jt(),y=R=>{f(M=>{switch(n){case"ly":M.actionState.wallThickness=R;break;case"lz":M.actionState.wallHeight=R;break;case"opacity":M.actionState.wallOpacity=R;break;case"structureSpacing":M.actionState.wallStructureSpacing=R;break;case"structureWidth":M.actionState.wallStructureWidth=R;break;case"eavesLength":M.actionState.wallEavesLength=R;break}})},w=(R,M)=>{f(D=>{for(const E of D.elements)if(E.id===R&&E.type===z.Wall&&!E.locked){E[n]=M;break}}),y(M)},b=R=>{const M=me.getAllConnectedWalls(t);M.length!==0&&(f(D=>{for(const E of M)if(!E.locked)for(const W of D.elements)W.id===E.id&&W.type===z.Wall&&(W[n]=R)}),y(R))},C=(R,M)=>{f(D=>{for(const E of D.elements)E.parentId===R&&E.type===z.Wall&&!E.locked&&(E[n]=M)}),y(M)},P=R=>{f(M=>{for(const D of M.elements)D.type===z.Wall&&!D.locked&&(D[n]=R)}),y(R)},v=(R,M)=>{f(D=>{for(const E of D.elements)E.type===z.Wall&&!E.locked&&R.has(E.id)&&(E[n]=M)}),y(M)},T=R=>{switch(c){case oe.AllSelectedObjectsOfThisType:{for(const M of l)if(M.type===z.Wall&&R!==M[n]&&!M.locked&&H.getState().selectedElementIdSet.has(M.id))return!0;break}case oe.AllObjectsOfThisType:{for(const M of l)if(M.type===z.Wall&&R!==M[n]&&!M.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const M of l)if(M.type===z.Wall&&M.foundationId===t.foundationId&&R!==M[n]&&!M.locked)return!0;break}case oe.AllConnectedObjects:{const M=me.getAllConnectedWalls(t);for(const D of M)if(R!==D[n]&&!D.locked)return!0;break}default:{if(R!==t[n])return!0;break}}return!1},A=R=>{if(t&&T(R))switch(c){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of l)E.type===z.Wall&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E[n]);const D={name:`Set ${e} for Selected Walls`,timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{v(D.oldValues,D.newValue)}};s(D),v(M,R),d(u+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of l)E.type===z.Wall&&M.set(E.id,E[n]);const D={name:`Set ${e} for All Walls`,timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{P(D.newValue)}};s(D),P(R),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(t.foundationId){const M=new Map;for(const E of l)E.type===z.Wall&&E.foundationId===t.foundationId&&M.set(E.id,E[n]);const D={name:`Set ${e} for All Walls Above Foundation`,timestamp:Date.now(),oldValues:M,newValue:R,groupId:t.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{D.groupId&&C(D.groupId,D.newValue)}};s(D),C(t.foundationId,R),d(u+1)}break;case oe.AllConnectedObjects:if(t){const M=me.getAllConnectedWalls(t),D=new Map;for(const W of M)D.set(W.id,W[n]);const E={name:`Set ${e} for All Connected Walls`,timestamp:Date.now(),oldValues:D,newValue:R,undo:()=>{for(const[W,j]of E.oldValues.entries())w(W,j)},redo:()=>{b(E.newValue)}};s(E),b(R),d(u+1)}break;default:if(t){const M=t[n],D={name:`Set Wall ${e}`,timestamp:Date.now(),oldValue:M,newValue:R,changedElementId:t.id,changedElementType:t.type,undo:()=>{w(D.changedElementId,D.oldValue)},redo:()=>{w(D.changedElementId,D.newValue)}};s(D),w(t.id,R),d(u+1)}}},x=()=>{p.current=t[n],a(!1)},S=()=>{A(p.current)};return h.jsx(so,{width:550,title:Y.t(`wallMenu.${e}`,g),onApply:S,onClose:x,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:o[0],max:o[1],style:{width:120},step:r,precision:2,defaultValue:t[n],onChange:R=>p.current=R}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",g),": [",o.toString(),"] ",i]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:i??" "}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:R=>H.getState().setWallActionScope(R.target.value),value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",g)})]})})})]})})},uC=({Dialog:t,noPadding:e,dataType:n,children:o})=>{const r=Jt(),[i,a]=m.useState(!1),l=co(z.Wall),s=()=>{H.getState().setApplyCount(0),a(!0)},c=tpo[n];return h.jsxs(h.Fragment,{children:[h.jsx(rn,{noPadding:e,onClick:s,children:o}),i&&l&&h.jsx(t,{wall:l,dataType:n,attributeKey:c.attributeKey,range:c.range,step:c.step,unit:c.unit?Y.t(c.unit,r):void 0,setDialogVisible:a})]})},Jho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(p3),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Wall),[c,u]=XZ((s==null?void 0:s.structureColor)??"#ffffff"),d=Jt(),f=(T,A)=>{e(x=>{for(const S of x.elements)if(S.id===T&&S.type===z.Wall&&!S.locked){S.structureColor=A;break}})},p=T=>{if(!s)return;const A=me.getAllConnectedWalls(s);A.length!==0&&e(x=>{for(const S of A)if(!S.locked)for(const R of x.elements)R.id===S.id&&R.type===z.Wall&&(R.structureColor=T)})},g=(T,A)=>{e(x=>{for(const S of x.elements)S.parentId===T&&S.type===z.Wall&&!S.locked&&(S.structureColor=A)})},y=T=>{e(A=>{for(const x of A.elements)x.type===z.Wall&&!x.locked&&(x.structureColor=T)})},w=(T,A)=>{e(x=>{for(const S of x.elements)S.type===z.Wall&&!S.locked&&T.has(S.id)&&(S.color=A)})},b=T=>{if(s){switch(r){case oe.AllSelectedObjectsOfThisType:{for(const A of n)if(A.type===z.Wall&&T!==A.structureColor&&!A.locked&&H.getState().selectedElementIdSet.has(A.id))return!0;break}case oe.AllObjectsOfThisType:{for(const A of n)if(A.type===z.Wall&&T!==A.structureColor&&!A.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const A of n)if(A.type===z.Wall&&A.foundationId===s.foundationId&&T!==A.structureColor&&!A.locked)return!0;break}case oe.AllConnectedObjects:{const A=me.getAllConnectedWalls(s);for(const x of A)if(T!==x.structureColor&&!x.locked)return!0;break}default:{if(T!==(s==null?void 0:s.structureColor))return!0;break}}return!1}},C=T=>{if(s&&b(T)){switch(r){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Wall&&H.getState().selectedElementIdSet.has(S.id)&&A.set(S.id,S.structureColor??"#ffffff");const x={name:"Set Structure Color for Selected Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{w(x.oldValues,x.newValue)}};o(x),w(A,T),a(i+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Wall&&A.set(S.id,S.structureColor??"#ffffff");const x={name:"Set Structure Color for All Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{y(x.newValue)}};o(x),y(T),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const A=new Map;for(const S of n)S.type===z.Wall&&S.foundationId===s.foundationId&&A.set(S.id,S.structureColor??"#ffffff");const x={name:"Set Structure Color for All Walls Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.foundationId,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{x.groupId&&g(x.groupId,x.newValue)}};o(x),g(s.foundationId,T),a(i+1)}break;case oe.AllConnectedObjects:if(s){const A=me.getAllConnectedWalls(s),x=new Map;for(const R of A)x.set(R.id,R.color??"#ffffff");const S={name:"Set Structure Color for All Connected Walls",timestamp:Date.now(),oldValues:x,newValue:T,undo:()=>{for(const[R,M]of S.oldValues.entries())f(R,M)},redo:()=>{p(S.newValue)}};o(S),p(T),a(i+1)}break;default:if(s){const A=l(s.id),x=(A==null?void 0:A.structureColor)??s.structureColor??"#ffffff",S={name:"Set Structure Color of Selected Wall",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(S.changedElementId,S.oldValue)},redo:()=>{f(S.changedElementId,S.newValue)}};o(S),f(s.id,T),a(i+1)}}e(A=>{A.actionState.wallStructureColor=T})}},P=()=>{t(!1)},v=()=>{C(c)};return h.jsx(so,{width:640,title:Y.t("wallMenu.StructureColor",d),onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:c,onChangeComplete:u})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:T=>H.getState().setWallActionScope(T.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",d)})]})})})]})})};var ng=(t=>(t.Height="Height",t.Opacity="Opacity",t.StructureSpacing="StructureSpacing",t.StructureWidth="StructureWidth",t.Thickness="Thickness",t.EavesLength="EavesLength",t))(ng||{});const Kho=t=>{const e=[],n={lng:H.getState().language};return e.push({key:"wall-structure-submenu-radio-group",label:h.jsx(Nho,{wall:t}),style:{backgroundColor:"white"}}),t.wallStructure!==gc.Default&&e.push({type:"divider"},{key:"wall-structure-spacing",label:h.jsxs(uC,{noPadding:!0,dataType:ng.StructureSpacing,Dialog:cC,children:[Y.t(`wallMenu.${ng.StructureSpacing}`,n)," ..."]})},{key:"wall-structure-width",label:h.jsxs(uC,{noPadding:!0,dataType:ng.StructureWidth,Dialog:cC,children:[Y.t(`wallMenu.${ng.StructureWidth}`,n)," ..."]})},{key:"wall-structure-color",label:h.jsxs(to,{noPadding:!0,Dialog:Jho,children:[Y.t("wallMenu.StructureColor",n)," ..."]})}),e},qho=t=>{const e=[];return e.push({key:"wall-fill-radio-group",label:h.jsx(jho,{wall:t}),style:{backgroundColor:"white"}}),t.fill!==El.Full&&e.push({type:"divider"},{key:"wall-open-to-outside-checkbox",label:h.jsx(Bho,{wall:t})}),e},$ho=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(p3),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Wall),[c,u]=m.useState((s==null?void 0:s.rValue)??f6),[d,f]=m.useState(me.toRValueInUS(c)),p=Jt(),g=(T,A)=>{l(x=>{for(const S of x.elements)if(S.id===T){S.rValue=A;break}})},y=T=>{for(const[A,x]of T.entries())g(A,x)},w=(T,A)=>{for(const x of T.keys())g(x,A)},b=T=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:{for(const A of e)if(A.type===z.Wall&&T!==A.rValue&&!A.locked&&H.getState().selectedElementIdSet.has(A.id))return!0;break}case oe.AllObjectsOfThisType:{for(const A of e)if(A.type===z.Wall&&T!==A.rValue&&!A.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const A of e)if(A.type===z.Wall&&A.foundationId===s.foundationId&&T!==A.rValue&&!A.locked)return!0;break}case oe.AllConnectedObjects:{const A=me.getAllConnectedWalls(s);for(const x of A)if(T!==x.rValue&&!x.locked)return!0;break}default:{if(T!==(s==null?void 0:s.rValue))return!0;break}}return!1}},C=T=>{if(s&&b(T)){switch(o){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of e)if(S.type===z.Wall&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)){const R=S;A.set(S.id,R.rValue??f6),g(R.id,T)}const x={name:"Set R-Value for Selected Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of e)if(S.type===z.Wall&&!S.locked){const R=S;A.set(S.id,R.rValue??f6),g(R.id,T)}const x={name:"Set R-Value for All Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s!=null&&s.foundationId){const A=new Map;for(const S of e)if(S.type===z.Wall&&S.foundationId===s.foundationId&&!S.locked){const R=S;A.set(S.id,R.rValue??f6),g(R.id,T)}const x={name:"Set R-Value for All Walls Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.foundationId,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1)}break;case oe.AllConnectedObjects:if(s){const A=me.getAllConnectedWalls(s),x=new Map;for(const R of A)if(!R.locked){const M=R;x.set(R.id,M.rValue??f6),g(M.id,T)}const S={name:"Set R-Value for All Connected Walls",timestamp:Date.now(),oldValues:x,newValue:T,undo:()=>{y(S.oldValues)},redo:()=>{w(S.oldValues,S.newValue)}};n(S),i(r+1)}break;default:if(s){const x=a(s.id).rValue??s.rValue??f6,S={name:"Set Wall R-Value",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:s.id,changedElementType:s.type,undo:()=>{g(S.changedElementId,S.oldValue)},redo:()=>{g(S.changedElementId,S.newValue)}};n(S),g(s.id,T),i(r+1)}}l(A=>{A.actionState.wallRValue=T})}},P=()=>{u((s==null?void 0:s.rValue)??f6),t(!1)},v=()=>{C(c)};return h.jsx(so,{width:550,title:`${Y.t("word.RValue",p)+" "}(${Y.t("word.ThermalResistance",p)})`,onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(u(T),f(me.toRValueInUS(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0.01, 100]",h.jsx("br",{}),Y.t("word.SIUnit",p),": m²·℃/W"]}),h.jsx("br",{}),h.jsx(Mn,{min:me.toRValueInUS(.01),max:me.toRValueInUS(100),style:{width:120},step:.01,precision:2,value:d,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(f(T),u(me.toRValueInSI(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [",me.toRValueInUS(.01).toFixed(3),", ",me.toRValueInUS(100).toFixed(1),"]",h.jsx("br",{}),Y.t("word.USUnit",p),": h·ft²·℉/Btu"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:T=>H.getState().setWallActionScope(T.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",p)})]})})})]})})},Qho=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(p3),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Wall),[c,u]=m.useState((s==null?void 0:s.volumetricHeatCapacity)??.5),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)if(A.id===P){A.volumetricHeatCapacity=v;break}})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const T of e)if(T.type===z.Wall&&P!==T.volumetricHeatCapacity&&!T.locked&&H.getState().selectedElementIdSet.has(T.id))return!0;break;case oe.AllObjectsOfThisType:for(const T of e)if(T.type===z.Wall&&P!==T.volumetricHeatCapacity&&!T.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const T of e)if(T.type===z.Wall&&T.foundationId===s.foundationId&&P!==T.volumetricHeatCapacity&&!T.locked)return!0;break;case oe.AllConnectedObjects:const v=me.getAllConnectedWalls(s);for(const T of v)if(P!==T.volumetricHeatCapacity&&!T.locked)return!0;break;default:if(P!==(s==null?void 0:s.volumetricHeatCapacity))return!0;break}return!1}},w=P=>{if(s&&y(P)){switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of e)if(A.type===z.Wall&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)){const x=A;v.set(A.id,x.volumetricHeatCapacity??.5),f(x.id,P)}const T={name:"Set Volumetric Heat Capacity for Selected Walls",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of e)if(A.type===z.Wall&&!A.locked){const x=A;v.set(A.id,x.volumetricHeatCapacity??.5),f(x.id,P)}const T={name:"Set Volumetric Heat Capacity for All Walls",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(s!=null&&s.foundationId){const v=new Map;for(const A of e)if(A.type===z.Wall&&A.foundationId===s.foundationId&&!A.locked){const x=A;v.set(A.id,x.volumetricHeatCapacity??.5),f(x.id,P)}const T={name:"Set Volumetric Heat Capacity for All Walls Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break}case oe.AllConnectedObjects:{if(s){const v=me.getAllConnectedWalls(s),T=new Map;for(const x of v)if(!x.locked){const S=x;T.set(x.id,S.volumetricHeatCapacity??.5),f(S.id,P)}const A={name:"Set Volumetric Heat Capacity for All Connected Walls",timestamp:Date.now(),oldValues:T,newValue:P,undo:()=>{p(A.oldValues)},redo:()=>{g(A.oldValues,A.newValue)}};n(A),i(r+1)}break}default:{if(s){const T=a(s.id).volumetricHeatCapacity??s.volumetricHeatCapacity??.5,A={name:"Set Volumetric Heat Capacity of Wall",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}break}}l(v=>{v.actionState.wallVolumetricHeatCapacity=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("word.VolumetricHeatCapacity",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>{P!==null&&u(P)}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:["kWh/(m³·℃)",h.jsx("br",{}),h.jsx("br",{}),Y.t("word.Range",d),": [0.01, 100]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setWallActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",d)})]})})})]})})},Zho=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(p3),i=H(no),a=H(Zn),l=H(Gn),s=Jt(),c=co(z.Wall),[u,d]=m.useState((c==null?void 0:c.textureType)??Uo.Default),{Option:f}=_o,p=(A,x)=>{e(S=>{for(const R of S.elements)if(R.type===z.Wall&&R.id===A&&!R.locked){R.textureType=x;break}})},g=A=>{if(!c)return;const x=me.getAllConnectedWalls(c);x.length!==0&&e(S=>{for(const R of x)if(!R.locked)for(const M of S.elements)M.id===R.id&&M.type===z.Wall&&(M.textureType=A)})},y=(A,x)=>{e(S=>{for(const R of S.elements)R.type===z.Wall&&R.foundationId===A&&!R.locked&&(R.textureType=x)})},w=A=>{e(x=>{for(const S of x.elements)S.type===z.Wall&&!S.locked&&(S.textureType=A)})},b=(A,x)=>{e(S=>{for(const R of S.elements)R.type===z.Wall&&!R.locked&&A.has(R.id)&&(R.textureType=x)})},C=A=>{if(c){switch(r){case oe.AllSelectedObjectsOfThisType:{for(const x of n)if(x.type===z.Wall&&A!==x.textureType&&!x.locked&&H.getState().selectedElementIdSet.has(x.id))return!0;break}case oe.AllObjectsOfThisType:{for(const x of n)if(x.type===z.Wall&&A!==x.textureType&&!x.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const x of n)if(x.type===z.Wall&&x.foundationId===c.foundationId&&A!==x.textureType&&!x.locked)return!0;break}case oe.AllConnectedObjects:{const x=me.getAllConnectedWalls(c);for(const S of x)if(A!==S.textureType&&!S.locked)return!0;break}default:{if(A!==(c==null?void 0:c.textureType))return!0;break}}return!1}},P=A=>{if(c&&C(A)){switch(r){case oe.AllSelectedObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.Wall&&!R.locked&&H.getState().selectedElementIdSet.has(R.id)&&x.set(R.id,R.textureType??Uo.Default);const S={name:"Set Texture for Selected Walls",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())p(R,M)},redo:()=>{b(S.oldValues,S.newValue)}};o(S),b(x,A),a(i+1);break}case oe.AllObjectsOfThisType:{const x=new Map;for(const R of n)R.type===z.Wall&&!R.locked&&x.set(R.id,R.textureType??Uo.Default);const S={name:"Set Texture for All Walls",timestamp:Date.now(),oldValues:x,newValue:A,undo:()=>{for(const[R,M]of S.oldValues.entries())p(R,M)},redo:()=>{w(S.newValue)}};o(S),w(A),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(c.foundationId){const x=new Map;for(const R of n)R.type===z.Wall&&R.foundationId===c.foundationId&&!R.locked&&x.set(R.id,R.textureType);const S={name:"Set Texture for All Walls Above Foundation",timestamp:Date.now(),oldValues:x,newValue:A,groupId:c.foundationId,undo:()=>{for(const[R,M]of S.oldValues.entries())p(R,M)},redo:()=>{S.groupId&&y(S.groupId,S.newValue)}};o(S),y(c.foundationId,A),a(i+1)}break;case oe.AllConnectedObjects:if(c){const x=me.getAllConnectedWalls(c),S=new Map;for(const M of x)S.set(M.id,M.textureType);const R={name:"Set Texture for All Connected Walls",timestamp:Date.now(),oldValues:S,newValue:A,undo:()=>{for(const[M,D]of R.oldValues.entries())p(M,D)},redo:()=>{g(R.newValue)}};o(R),g(A),a(i+1)}break;default:if(c){const x=l(c.id),S=(x==null?void 0:x.textureType)??c.textureType,R={name:"Set Texture of Selected Wall",timestamp:Date.now(),oldValue:S,newValue:A,changedElementId:c.id,changedElementType:c.type,undo:()=>{p(R.changedElementId,R.oldValue)},redo:()=>{p(R.changedElementId,R.newValue)}};o(R),p(c.id,A),a(i+1)}}e(x=>{x.actionState.wallTexture=A})}},v=()=>{t(!1)},T=()=>{P(u)};return h.jsx(so,{width:550,title:Y.t("word.Texture",s),onApply:T,onClose:v,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:9,children:h.jsxs(_o,{style:{width:"150px"},value:u,onChange:d,children:[h.jsxs(f,{value:Uo.NoTexture,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"32px",height:"20px",border:"1px dashed dimGray"},children:" "}),Y.t("shared.NoTexture",s)]},Uo.NoTexture),h.jsxs(f,{value:Uo.Default,children:[h.jsx("img",{alt:Uo.Default,src:Eye,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.TextureDefault",s)]},Uo.Default),h.jsxs(f,{value:Uo.Texture01,children:[h.jsx("img",{alt:Uo.Texture01,src:xrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture01",s)]},Uo.Texture01),h.jsxs(f,{value:Uo.Texture02,children:[h.jsx("img",{alt:Uo.Texture02,src:brt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture02",s)]},Uo.Texture02),h.jsxs(f,{value:Uo.Texture03,children:[h.jsx("img",{alt:Uo.Texture03,src:Srt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture03",s)]},Uo.Texture03),h.jsxs(f,{value:Uo.Texture04,children:[h.jsx("img",{alt:Uo.Texture04,src:Trt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture04",s)]},Uo.Texture04),h.jsxs(f,{value:Uo.Texture05,children:[h.jsx("img",{alt:Uo.Texture05,src:Prt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture05",s)]},Uo.Texture05),h.jsxs(f,{value:Uo.Texture06,children:[h.jsx("img",{alt:Uo.Texture06,src:Crt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture06",s)]},Uo.Texture06),h.jsxs(f,{value:Uo.Texture07,children:[h.jsx("img",{alt:Uo.Texture07,src:Rrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture07",s)]},Uo.Texture07),h.jsxs(f,{value:Uo.Texture08,children:[h.jsx("img",{alt:Uo.Texture08,src:Hrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture08",s)]},Uo.Texture08),h.jsxs(f,{value:Uo.Texture09,children:[h.jsx("img",{alt:Uo.Texture09,src:Mrt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture09",s)]},Uo.Texture09),h.jsxs(f,{value:Uo.Texture10,children:[h.jsx("img",{alt:Uo.Texture10,src:Irt,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("wallMenu.Texture10",s)]},Uo.Texture10)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:15,children:h.jsx(Ue.Group,{onChange:A=>H.getState().setWallActionScope(A.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",s)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",s)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",s)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",s)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",s)})]})})})]})})},epo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(p3),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Wall),c=Jt(),[u,d]=XZ((s==null?void 0:s.color)??"#ffffff"),f=(T,A)=>{e(x=>{for(const S of x.elements)if(S.type===z.Wall&&S.id===T&&!S.locked){S.color=A;break}})},p=T=>{if(!s)return;const A=me.getAllConnectedWalls(s);A.length!==0&&e(x=>{for(const S of A)if(!S.locked)for(const R of x.elements)R.id===S.id&&R.type===z.Wall&&(R.color=T)})},g=(T,A)=>{e(x=>{for(const S of x.elements)S.type===z.Wall&&S.foundationId===T&&!S.locked&&(S.color=A)})},y=T=>{e(A=>{for(const x of A.elements)x.type===z.Wall&&!x.locked&&(x.color=T)})},w=(T,A)=>{e(x=>{for(const S of x.elements)S.type===z.Wall&&!S.locked&&T.has(S.id)&&(S.color=A)})},b=T=>{if(s){switch(r){case oe.AllSelectedObjectsOfThisType:{for(const A of n)if(A.type===z.Wall&&T!==A.color&&!A.locked&&H.getState().selectedElementIdSet.has(A.id))return!0;break}case oe.AllObjectsOfThisType:{for(const A of n)if(A.type===z.Wall&&T!==A.color&&!A.locked)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const A of n)if(A.type===z.Wall&&A.foundationId===s.foundationId&&T!==A.color&&!A.locked)return!0;break}case oe.AllConnectedObjects:{const A=me.getAllConnectedWalls(s);for(const x of A)if(T!==x.color&&!x.locked)return!0;break}default:{if(T!==(s==null?void 0:s.color))return!0;break}}return!1}},C=T=>{if(s&&b(T)){switch(r){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Wall&&H.getState().selectedElementIdSet.has(S.id)&&A.set(S.id,S.color??"#ffffff");const x={name:"Set Color for Selected Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{w(x.oldValues,x.newValue)}};o(x),w(A,T),a(i+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of n)S.type===z.Wall&&A.set(S.id,S.color??"#ffffff");const x={name:"Set Color for All Walls",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{y(x.newValue)}};o(x),y(T),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(s.foundationId){const A=new Map;for(const S of n)S.type===z.Wall&&S.foundationId===s.foundationId&&A.set(S.id,S.color??"#ffffff");const x={name:"Set Color for All Walls Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.foundationId,undo:()=>{for(const[S,R]of x.oldValues.entries())f(S,R)},redo:()=>{x.groupId&&g(x.groupId,x.newValue)}};o(x),g(s.foundationId,T),a(i+1)}break}case oe.AllConnectedObjects:{const A=me.getAllConnectedWalls(s),x=new Map;for(const R of A)x.set(R.id,R.color??"#ffffff");const S={name:"Set Color for All Connected Walls",timestamp:Date.now(),oldValues:x,newValue:T,undo:()=>{for(const[R,M]of S.oldValues.entries())f(R,M)},redo:()=>{p(S.newValue)}};o(S),p(T),a(i+1);break}default:{if(s){const A=l(s.id),x=(A==null?void 0:A.color)??s.color??"#ffffff",S={name:"Set Color of Selected Wall",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(S.changedElementId,S.oldValue)},redo:()=>{f(S.changedElementId,S.newValue)}};o(S),f(s.id,T),a(i+1)}break}}e(A=>{A.actionState.wallColor=T})}},P=()=>{t(!1)},v=()=>{C(u)};return h.jsx(so,{width:640,title:Y.t("wallMenu.Color",c),onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:u,onChangeComplete:d})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:T=>H.getState().setWallActionScope(T.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("wallMenu.OnlyThisWall",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllConnectedObjects,children:Y.t("wallMenu.AllConnectedWalls",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("wallMenu.AllWallsAboveFoundation",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("wallMenu.AllSelectedWalls",c)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("wallMenu.AllWalls",c)})]})})})]})})},tpo={Height:{attributeKey:"lz",range:[.1,1e3],step:.1,unit:"word.MeterAbbreviation"},Opacity:{attributeKey:"opacity",range:[0,1],step:.01},StructureSpacing:{attributeKey:"structureSpacing",range:[.1,1e3],step:.1,unit:"word.MeterAbbreviation"},StructureWidth:{attributeKey:"structureWidth",range:[.01,1],step:.1,unit:"word.MeterAbbreviation"},Thickness:{attributeKey:"ly",range:[.1,1],step:.01,unit:"word.MeterAbbreviation"},EavesLength:{attributeKey:"eavesLength",range:[-.1,5],step:.01,unit:"word.MeterAbbreviation"},ParapetHeight:{attributeKey:"parapetHeight",range:[0,5],step:.01,unit:"word.MeterAbbreviation"},CopingsHeight:{attributeKey:"copingsHeight",range:[0,1],step:.01,unit:"word.MeterAbbreviation"},CopingsWidth:{attributeKey:"copingsWidth",range:[0,3],step:.01,unit:"word.MeterAbbreviation"}},npo=()=>{const t=H.getState().elementsToPaste;if(t&&t.length>0){const e=t[0];if(me.isLegalOnWall(e.type))return!0}return!1},opo=t=>{const e=[];if(t.type!==z.Wall)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language},i=H.getState().countAllOffspringsByTypeAtOnce,a=i(n.id,!0),l=i(n.id,!1);return npo()&&e.push({key:"wall-paste",label:h.jsx(eM,{})}),e.push({key:"wall-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"wall-cut",label:h.jsx(Wd,{})}),e.push({key:"wall-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&(a.gotSome()&&e.push({key:"lock-unlock-clear-on-wall",label:h.jsx(rn,{children:Y.t("word.Elements",r)}),children:Oho(n,a,l)}),e.push({key:"wall-parapet",label:h.jsx(rn,{children:Y.t("wallMenu.Parapet",r)}),children:Xho(n)}),e.push({key:"wall-structure",label:h.jsx(rn,{children:Y.t("wallMenu.WallStructure",r)}),children:Kho(n)}),n.wallStructure!==gc.Default&&e.push({key:"wall-opacity",label:h.jsxs(uC,{dataType:ng.Opacity,Dialog:cC,children:[Y.t(`wallMenu.${ng.Opacity}`,r)," ..."]})}),e.push({key:"wall-fill",label:h.jsx(rn,{children:Y.t("wallMenu.Fill",r)}),children:qho(n)},{key:"add-polygon-on-wall",label:h.jsx(Uho,{wall:n})},{key:"wall-thickness",label:h.jsxs(uC,{dataType:ng.Thickness,Dialog:cC,children:[Y.t(`wallMenu.${ng.Thickness}`,r)," ..."]})},{key:"wall-height",label:h.jsxs(uC,{dataType:ng.Height,Dialog:cC,children:[Y.t(`wallMenu.${ng.Height}`,r)," ..."]})},{key:"wall-eaves-length",label:h.jsxs(uC,{dataType:ng.EavesLength,Dialog:cC,children:[Y.t(`wallMenu.${ng.EavesLength}`,r)," ..."]})},{key:"wall-r-value",label:h.jsxs(to,{Dialog:$ho,children:[Y.t("word.RValue",r)," ..."]})},{key:"wall-heat-capacity",label:h.jsxs(to,{Dialog:Qho,children:[Y.t("word.VolumetricHeatCapacity",r)," ..."]})},{key:"wall-texture",label:h.jsxs(to,{Dialog:Zho,children:[Y.t("wallMenu.Texture",r)," ..."]})},{key:"wall-color",label:h.jsxs(to,{Dialog:epo,children:[Y.t("wallMenu.Color",r)," ..."]})})),{items:e}},rpo=be.memo(({door:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&l.type===z.Door){l.filled=i;break}})},o=r=>{const i=r.target.checked,a={name:"Filled Door",timestamp:Date.now(),checked:i,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i),H.getState().set(l=>{l.actionState.doorFilled=i})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.filled,onChange:o,children:Y.t("doorMenu.Filled",e)})})}),ipo=be.memo(({door:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&l.type===z.Door){l.interior=i;break}})},o=r=>{const i=r.target.checked,a={name:"Interior Door",timestamp:Date.now(),checked:i,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i),H.getState().set(l=>{l.actionState.doorInterior=i})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.interior,onChange:o,children:Y.t("doorMenu.Interior",e)})})}),apo=be.memo(({door:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&l.type===z.Door){l.doorType=i;break}})},o=r=>{const i={name:"Select Door Type",timestamp:Date.now(),oldValue:t.doorType,newValue:r.target.value,changedElementId:t.id,changedElementType:t.type,undo:()=>{n(i.changedElementId,i.oldValue)},redo:()=>{n(i.changedElementId,i.newValue)}};H.getState().addUndoable(i),n(t.id,r.target.value),H.getState().set(a=>{a.actionState.doorType=r.target.value})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Ue.Group,{value:t.doorType,onChange:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:Pd.Default,children:Y.t("doorMenu.Default",e)}),h.jsx(Ue,{style:{width:"100%"},value:Pd.Arched,children:Y.t("doorMenu.Arched",e)})]})})})}),lpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(Ew),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=H(qr),c=co(z.Door),u=m.useMemo(()=>{const x=c?c.lx:1,S=c?s(c):null;return S?x*S.lx:x},[c==null?void 0:c.lx]),[d,f]=m.useState(u),p=Jt(),g=(x,S)=>{l(R=>{for(const M of R.elements)if(M.id===x&&M.type===z.Door){const D=M,E=s(D);D.lx=E?S/E.lx:S;break}})},y=x=>{for(const[S,R]of x.entries())g(S,R)},w=(x,S)=>{for(const R of x.keys())g(R,S)},b=x=>{if(c){switch(o){case oe.AllSelectedObjectsOfThisType:{for(const S of e)if(S.type===z.Door&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)){const R=s(S);if(R&&x!==S.lx*R.lx)return!0}break}case oe.AllObjectsOfThisType:{for(const S of e)if(S.type===z.Door&&!S.locked){const R=s(S);if(R&&x!==S.lx*R.lx)return!0}break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const S of e)if(S.type===z.Door&&S.foundationId===c.foundationId&&!S.locked){const R=s(S);if(R&&x!==S.lx*R.lx)return!0}break}case oe.OnlyThisSide:{for(const S of e)if(S.type===z.Door&&S.parentId===c.parentId&&!S.locked){const R=s(S);if(R&&x!==S.lx*R.lx)return!0}break}default:{const S=s(c);if(S&&x!==c.lx*S.lx)return!0;break}}return!1}},C=x=>{if(c&&b(x))switch(o){case oe.AllSelectedObjectsOfThisType:{const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&!D.locked&&H.getState().selectedElementIdSet.has(D.id)){const E=D,W=E?s(E):null;S.set(D.id,E.lx*(W?W.lx:1)),E.lx=W?x/W.lx:x}});const R={name:"Set Width for Selected Doors",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1);break}case oe.AllObjectsOfThisType:{const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&!D.locked){const E=D,W=E?s(E):null;S.set(D.id,E.lx*(W?W.lx:1)),E.lx=W?x/W.lx:x}});const R={name:"Set Width for All Doors",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(c.foundationId){const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&D.foundationId===c.foundationId&&!D.locked){const E=D,W=E?s(E):null;S.set(D.id,E.lx*(W?W.lx:1)),E.lx=W?x/W.lx:x}});const R={name:"Set Width for All Doors Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:c.foundationId,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1)}break;case oe.OnlyThisSide:if(c.parentId){const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&D.parentId===c.parentId&&!D.locked){const E=D,W=E?s(E):null;S.set(D.id,E.lx*(W?W.lx:1)),E.lx=W?x/W.lx:x}});const R={name:"Set Width for All Doors On the Same Wall",timestamp:Date.now(),oldValues:S,newValue:x,groupId:c.parentId,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1)}break;default:if(c){const S=a(c.id),R=c?s(S):null,M=(S.lx??c.lx??.1)*(R?R.lx:1),D={name:"Set Door Width",timestamp:Date.now(),oldValue:M,newValue:x,changedElementId:c.id,changedElementType:c.type,undo:()=>{g(D.changedElementId,D.oldValue)},redo:()=>{g(D.changedElementId,D.newValue)}};n(D),g(c.id,x),i(r+1)}}},P=()=>{t(!1)},v=()=>{C(d)},T=c?s(c):null,A=T&&c?2*T.lx*Math.min(Math.abs(.5-c.cx),Math.abs(-.5-c.cx)):100;return h.jsx(so,{width:550,title:Y.t("word.Width",p),onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:A,style:{width:120},step:.1,precision:2,value:d,formatter:x=>Number(x).toFixed(2),onChange:x=>f(x)}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0.1, ",A.toFixed(1),"]",Y.t("word.MeterAbbreviation",p)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",p)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:x=>H.getState().setDoorActionScope(x.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",p)})]})})})]})})},spo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(Ew),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=H(qr),c=co(z.Door),u=m.useMemo(()=>{const x=c?c.lz:1,S=c?s(c):null;return S?x*S.lz:x},[c==null?void 0:c.lz]),[d,f]=m.useState(u),p=Jt(),g=(x,S)=>{l(R=>{for(const M of R.elements)if(M.id===x&&M.type===z.Door){const D=M,E=s(D);D.lz=E?S/E.lz:S,E&&(D.cz=-(E.lz-S)/(2*E.lz));break}})},y=x=>{for(const[S,R]of x.entries())g(S,R)},w=(x,S)=>{for(const R of x.keys())g(R,S)},b=x=>{if(c){switch(o){case oe.AllSelectedObjectsOfThisType:{for(const S of e)if(S.type===z.Door&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)){const R=s(S);if(R&&x!==S.lz*R.lz)return!0}break}case oe.AllObjectsOfThisType:{for(const S of e)if(S.type===z.Door&&!S.locked){const R=s(S);if(R&&x!==S.lz*R.lz)return!0}break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const S of e)if(S.type===z.Door&&S.foundationId===c.foundationId&&!S.locked){const R=s(S);if(R&&x!==S.lz*R.lz)return!0}break}case oe.OnlyThisSide:{for(const S of e)if(S.type===z.Door&&S.parentId===c.parentId&&!S.locked){const R=s(S);if(R&&x!==S.lz*R.lz)return!0}break}default:{const S=s(c);if(S&&x!==c.lz*S.lz)return!0;break}}return!1}},C=x=>{if(c&&b(x))switch(o){case oe.AllSelectedObjectsOfThisType:{const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&!D.locked&&H.getState().selectedElementIdSet.has(D.id)){const E=D,W=E?s(E):null;S.set(D.id,E.lz*(W?W.lz:1)),E.lz=W?x/W.lz:x,W&&(E.cz=-(W.lz-x)/(2*W.lz))}});const R={name:"Set Height for Selected Doors",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1);break}case oe.AllObjectsOfThisType:{const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&!D.locked){const E=D,W=E?s(E):null;S.set(D.id,E.lz*(W?W.lz:1)),E.lz=W?x/W.lz:x,W&&(E.cz=-(W.lz-x)/(2*W.lz))}});const R={name:"Set Height for All Doors",timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(c.foundationId){const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&D.foundationId===c.foundationId&&!D.locked){const E=D,W=E?s(E):null;S.set(D.id,E.lz*(W?W.lz:1)),E.lz=W?x/W.lz:x,W&&(E.cz=-(W.lz-x)/(2*W.lz))}});const R={name:"Set Height for All Doors Above Foundation",timestamp:Date.now(),oldValues:S,newValue:x,groupId:c.foundationId,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1)}break;case oe.OnlyThisSide:if(c.parentId){const S=new Map;l(M=>{for(const D of M.elements)if(D.type===z.Door&&D.parentId===c.parentId&&!D.locked){const E=D,W=E?s(E):null;S.set(D.id,E.lz*(W?W.lz:1)),E.lz=W?x/W.lz:x,W&&(E.cz=-(W.lz-x)/(2*W.lz))}});const R={name:"Set Height for All Doors On the Same Wall",timestamp:Date.now(),oldValues:S,newValue:x,groupId:c.parentId,undo:()=>{y(R.oldValues)},redo:()=>{w(R.oldValues,R.newValue)}};n(R),i(r+1)}break;default:if(c){const S=a(c.id),R=c?s(S):null,M=(S.lz??c.lz??.2)*(R?R.lz:1),D={name:"Set Door Height",timestamp:Date.now(),oldValue:M,newValue:x,changedElementId:c.id,changedElementType:c.type,undo:()=>{g(D.changedElementId,D.oldValue)},redo:()=>{g(D.changedElementId,D.newValue)}};n(D),g(c.id,x),i(r+1)}}},P=()=>{f(u),t(!1)},v=()=>{C(d)},T=c?s(c):null,A=(T==null?void 0:T.lz)??20;return h.jsx(so,{width:550,title:Y.t("word.Height",p),onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:A,style:{width:120},step:.1,precision:2,value:d,formatter:x=>Number(x).toFixed(2),onChange:x=>{x!==null&&f(x)}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0.1, ",A.toFixed(1),"]",Y.t("word.MeterAbbreviation",p)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",p)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:x=>H.getState().setDoorActionScope(x.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",p)})]})})})]})})},cpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(Ew),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Door),[c,u]=m.useState((s==null?void 0:s.opacity)??1),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)if(A.id===P){A.opacity=v;break}})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Door&&P!==v.opacity&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Door&&P!==v.opacity&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Door&&v.foundationId===s.foundationId&&P!==v.opacity&&!v.locked)return!0;break;case oe.OnlyThisSide:for(const v of e)if(v.type===z.Door&&v.parentId===s.parentId&&P!==v.opacity&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.opacity))return!0;break}return!1}},w=P=>{if(s&&y(P)){switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)){const S=x;v.set(x.id,S.opacity??1),S.opacity=P}});const T={name:"Set Opacity for Selected Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&!x.locked){const S=x;v.set(x.id,S.opacity??1),S.opacity=P}});const T={name:"Set Opacity for All Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&x.foundationId===s.foundationId&&!x.locked){const S=x;v.set(x.id,S.opacity??1),S.opacity=P}});const T={name:"Set Opacity for All Doors Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;case oe.OnlyThisSide:if(s.parentId){const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&x.parentId===s.parentId&&!x.locked){const S=x;v.set(x.id,S.opacity??1),S.opacity=P}});const T={name:"Set Opacity for All Doors On the Same Wall",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.parentId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;default:if(s){const T=a(s.id).opacity??s.opacity??1,A={name:"Set Opacity of Door",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}}l(v=>{v.actionState.doorOpacity=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("wallMenu.Opacity",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>u(P)}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:["kWh/(m³·℃)",h.jsx("br",{}),h.jsx("br",{}),Y.t("word.Range",d),": [0.01, 100]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setDoorActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",d)})]})})})]})})},upo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(Ew),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Door),[c,u]=m.useState((s==null?void 0:s.uValue)??G4),[d,f]=m.useState(me.toUValueInUS(c)),p=Jt(),g=(T,A)=>{l(x=>{for(const S of x.elements)if(S.id===T){S.uValue=A;break}})},y=T=>{for(const[A,x]of T.entries())g(A,x)},w=(T,A)=>{for(const x of T.keys())g(x,A)},b=T=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const A of e)if(A.type===z.Door&&T!==A.uValue&&!A.locked&&H.getState().selectedElementIdSet.has(A.id))return!0;break;case oe.AllObjectsOfThisType:for(const A of e)if(A.type===z.Door&&T!==A.uValue&&!A.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const A of e)if(A.type===z.Door&&A.foundationId===s.foundationId&&T!==A.uValue&&!A.locked)return!0;break;case oe.OnlyThisSide:for(const A of e)if(A.type===z.Door&&A.parentId===s.parentId&&T!==A.uValue&&!A.locked)return!0;break;default:if(T!==(s==null?void 0:s.uValue))return!0;break}return!1}},C=T=>{if(s&&b(T)){switch(o){case oe.AllSelectedObjectsOfThisType:{const A=new Map;l(S=>{for(const R of S.elements)if(R.type===z.Door&&!R.locked){const M=R;A.set(R.id,M.uValue??G4),M.uValue=T}});const x={name:"Set U-Value for Selected Doors",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisType:{const A=new Map;l(S=>{for(const R of S.elements)if(R.type===z.Door&&!R.locked){const M=R;A.set(R.id,M.uValue??G4),M.uValue=T}});const x={name:"Set U-Value for All Doors",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const A=new Map;l(S=>{for(const R of S.elements)if(R.type===z.Door&&R.foundationId===s.foundationId&&!R.locked){const M=R;A.set(R.id,M.uValue??G4),M.uValue=T}});const x={name:"Set U-Value for All Doors Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.foundationId,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1)}break;case oe.OnlyThisSide:if(s.parentId){const A=new Map;l(S=>{for(const R of S.elements)if(R.type===z.Door&&R.parentId===s.parentId&&!R.locked){const M=R;A.set(R.id,M.uValue??G4),M.uValue=T}});const x={name:"Set U-Value for All Doors On the Same Wall",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.parentId,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1)}break;default:if(s){const x=a(s.id).uValue??s.uValue??G4,S={name:"Set Door U-Value",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:s.id,changedElementType:s.type,undo:()=>{g(S.changedElementId,S.oldValue)},redo:()=>{g(S.changedElementId,S.newValue)}};n(S),g(s.id,T),i(r+1)}}l(A=>{A.actionState.doorUValue=T})}},P=()=>{t(!1)},v=()=>{C(c)};return h.jsx(so,{width:550,title:`${Y.t("word.UValue",p)+" "}(${Y.t("word.ThermalTransmittance",p)})`,onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(u(T),f(me.toUValueInUS(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0.01, 100]",h.jsx("br",{}),Y.t("word.SIUnit",p),": W/(m²·℃)"]}),h.jsx("br",{}),h.jsx(Mn,{min:me.toUValueInUS(.01),max:me.toUValueInUS(100),style:{width:120},step:.01,precision:2,value:d,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(f(T),u(me.toUValueInSI(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [",me.toUValueInUS(.01).toFixed(3),", ",me.toUValueInUS(100).toFixed(1),"]",h.jsx("br",{}),Y.t("word.USUnit",p),": Btu/(h·ft²·℉)"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:T=>H.getState().setDoorActionScope(T.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",p)})]})})})]})})},dpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(Ew),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Door),[c,u]=m.useState((s==null?void 0:s.volumetricHeatCapacity)??.5),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)if(A.id===P){A.volumetricHeatCapacity=v;break}})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{switch(o){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Door&&P!==v.volumetricHeatCapacity&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Door&&P!==v.volumetricHeatCapacity&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Door&&v.foundationId===(s==null?void 0:s.foundationId)&&P!==v.volumetricHeatCapacity&&!v.locked)return!0;break;case oe.OnlyThisSide:for(const v of e)if(v.type===z.Door&&v.parentId===(s==null?void 0:s.parentId)&&P!==v.volumetricHeatCapacity&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.volumetricHeatCapacity))return!0;break}return!1},w=P=>{if(s&&y(P)){switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)){const S=x;v.set(x.id,S.volumetricHeatCapacity??.5),S.volumetricHeatCapacity=P}});const T={name:"Set Volumetric Heat Capacity for Selected Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&!x.locked){const S=x;v.set(x.id,S.volumetricHeatCapacity??.5),S.volumetricHeatCapacity=P}});const T={name:"Set Volumetric Heat Capacity for All Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&x.foundationId===s.foundationId&&!x.locked){const S=x;v.set(x.id,S.volumetricHeatCapacity??.5),S.volumetricHeatCapacity=P}});const T={name:"Set Volumetric Heat Capacity for All Doors Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;case oe.OnlyThisSide:if(s.parentId){const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Door&&x.parentId===s.parentId&&!x.locked){const S=x;v.set(x.id,S.volumetricHeatCapacity??.5),S.volumetricHeatCapacity=P}});const T={name:"Set Volumetric Heat Capacity for All Doors On the Same Wall",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.parentId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;default:if(s){const T=a(s.id).volumetricHeatCapacity??s.volumetricHeatCapacity??.5,A={name:"Set Volumetric Heat Capacity of Door",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}}l(v=>{v.actionState.doorVolumetricHeatCapacity=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("word.VolumetricHeatCapacity",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>{P!==null&&u(P)}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:["kWh/(m³·℃)",h.jsx("br",{}),h.jsx("br",{}),Y.t("word.Range",d),": [0.01, 100]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setDoorActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",d)})]})})})]})})},fpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(Ew),r=H(no),i=H(Zn),a=H(fn),l=H(Gn),s=co(z.Door),[c,u]=m.useState((s==null?void 0:s.textureType)??sr.Default),d=Jt(),{Option:f}=_o,p=(v,T)=>{a(A=>{for(const x of A.elements)if(x.id===v){x.locked||(x.textureType=T);break}})},g=(v,T)=>{for(const A of v.keys())p(A,T)},y=v=>{for(const[T,A]of v.entries())p(T,A)},w=v=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const T of e)if(T.type===z.Door&&v!==T.textureType&&!T.locked&&H.getState().selectedElementIdSet.has(T.id))return!0;break;case oe.AllObjectsOfThisType:for(const T of e)if(T.type===z.Door&&v!==T.textureType&&!T.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const T of e)if(T.type===z.Door&&T.foundationId===s.foundationId&&v!==T.textureType&&!T.locked)return!0;break;case oe.OnlyThisSide:for(const T of e)if(T.type===z.Door&&T.parentId===s.parentId&&v!==T.textureType&&!T.locked)return!0;break;default:if(v!==(s==null?void 0:s.textureType))return!0;break}return!1}},b=v=>{if(s&&w(v)){switch(o){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of H.getState().elements)x.type===z.Door&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&T.set(x.id,x.textureType??sr.Default);const A={name:"Set Texture for Selected Doors",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{y(A.oldValues)},redo:()=>{g(A.oldValues,A.newValue)}};n(A),g(T,v),i(r+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of H.getState().elements)x.type===z.Door&&!x.locked&&T.set(x.id,x.textureType??sr.Default);const A={name:"Set Texture for All Doors",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{y(A.oldValues)},redo:()=>{g(A.oldValues,A.newValue)}};n(A),g(T,v),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const T=new Map;for(const x of H.getState().elements)x.type===z.Door&&x.foundationId===s.foundationId&&!x.locked&&T.set(x.id,x.textureType);const A={name:"Set Texture for All Doors Above Foundation",timestamp:Date.now(),oldValues:T,newValue:v,groupId:s.foundationId,undo:()=>{y(A.oldValues)},redo:()=>{A.groupId&&g(A.oldValues,A.newValue)}};n(A),g(T,v),i(r+1)}break;case oe.OnlyThisSide:if(s.parentId){const T=new Map;for(const x of H.getState().elements)x.type===z.Door&&x.parentId===s.parentId&&!x.locked&&T.set(x.id,x.textureType);const A={name:"Set Texture for All Doors On the Same Wall",timestamp:Date.now(),oldValues:T,newValue:v,groupId:s.parentId,undo:()=>{y(A.oldValues)},redo:()=>{A.groupId&&g(A.oldValues,A.newValue)}};n(A),g(T,v),i(r+1)}break;default:if(s){const T=l(s.id),A=T?T.textureType:s.textureType,x={name:"Set Texture of Selected Door",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};n(x),p(s.id,v),i(r+1)}}a(T=>{T.actionState.doorTexture=v})}},C=()=>{t(!1)},P=()=>{b(c)};return h.jsx(so,{width:550,title:Y.t("word.Texture",d),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:9,children:h.jsxs(_o,{style:{width:"150px"},value:c,onChange:v=>u(v),children:[h.jsxs(f,{value:sr.NoTexture,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"32px",height:"20px",border:"1px dashed dimGray"},children:" "}),Y.t("shared.NoTexture",d)]},sr.NoTexture),h.jsxs(f,{value:sr.Default,children:[h.jsx("img",{alt:sr.Default,src:W$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.TextureDefault",d)]},sr.Default),h.jsxs(f,{value:sr.Texture01,children:[h.jsx("img",{alt:sr.Texture01,src:N$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture01",d)]},sr.Texture01),h.jsxs(f,{value:sr.Texture02,children:[h.jsx("img",{alt:sr.Texture02,src:lde,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture02",d)]},sr.Texture02),h.jsxs(f,{value:sr.Texture03,children:[h.jsx("img",{alt:sr.Texture03,src:U$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture03",d)]},sr.Texture03),h.jsxs(f,{value:sr.Texture04,children:[h.jsx("img",{alt:sr.Texture04,src:j$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture04",d)]},sr.Texture04),h.jsxs(f,{value:sr.Texture05,children:[h.jsx("img",{alt:sr.Texture05,src:B$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture05",d)]},sr.Texture05),h.jsxs(f,{value:sr.Texture06,children:[h.jsx("img",{alt:sr.Texture06,src:Y$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture06",d)]},sr.Texture06),h.jsxs(f,{value:sr.Texture07,children:[h.jsx("img",{alt:sr.Texture07,src:O$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture07",d)]},sr.Texture07),h.jsxs(f,{value:sr.Texture08,children:[h.jsx("img",{alt:sr.Texture08,src:_$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture08",d)]},sr.Texture08),h.jsxs(f,{value:sr.Texture09,children:[h.jsx("img",{alt:sr.Texture09,src:V$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture09",d)]},sr.Texture09),h.jsxs(f,{value:sr.Texture10,children:[h.jsx("img",{alt:sr.Texture10,src:G$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture10",d)]},sr.Texture10),h.jsxs(f,{value:sr.Texture11,children:[h.jsx("img",{alt:sr.Texture11,src:X$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture11",d)]},sr.Texture11),h.jsxs(f,{value:sr.Texture12,children:[h.jsx("img",{alt:sr.Texture12,src:J$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture12",d)]},sr.Texture12),h.jsxs(f,{value:sr.Texture13,children:[h.jsx("img",{alt:sr.Texture13,src:K$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture13",d)]},sr.Texture13),h.jsxs(f,{value:sr.Texture14,children:[h.jsx("img",{alt:sr.Texture14,src:q$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture14",d)]},sr.Texture14),h.jsxs(f,{value:sr.Texture15,children:[h.jsx("img",{alt:sr.Texture15,src:$$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture15",d)]},sr.Texture15),h.jsxs(f,{value:sr.Texture16,children:[h.jsx("img",{alt:sr.Texture16,src:Q$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture16",d)]},sr.Texture16),h.jsxs(f,{value:sr.Texture17,children:[h.jsx("img",{alt:sr.Texture17,src:Z$e,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("doorMenu.Texture17",d)]},sr.Texture17)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:15,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setDoorActionScope(v.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",d)})]})})})]})})},hpo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(Ew),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Door),[c,u]=m.useState((s==null?void 0:s.color)??"#ffffff"),d=Jt(),f=(P,v)=>{e(T=>{for(const A of T.elements)if(A.id===P){A.locked||(A.color=v);break}})},p=(P,v)=>{for(const T of P.keys())f(T,v)},g=P=>{for(const[v,T]of P.entries())f(v,T)},y=P=>{switch(r){case oe.AllSelectedObjectsOfThisType:for(const v of n)if(v.type===z.Door&&P!==v.color&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of n)if(v.type===z.Door&&P!==v.color&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of n)if(v.type===z.Door&&v.foundationId===(s==null?void 0:s.foundationId)&&P!==v.color&&!v.locked)return!0;break;case oe.OnlyThisSide:for(const v of n)if(v.type===z.Door&&v.parentId===(s==null?void 0:s.parentId)&&P!==v.color&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.color))return!0;break}return!1},w=P=>{if(s&&y(P)){switch(r){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&v.set(A.id,A.color??"#ffffff");const T={name:"Set Color for Selected Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&!A.locked&&v.set(A.id,A.color??"#ffffff");const T={name:"Set Color for All Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&A.foundationId===s.foundationId&&!s.locked&&v.set(A.id,A.color??"#ffffff");const T={name:"Set Color for All Doors Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{g(T.oldValues)},redo:()=>{T.groupId&&p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1)}break;case oe.OnlyThisSide:if(s.parentId){const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&A.parentId===s.parentId&&!s.locked&&v.set(A.id,A.color??"#ffffff");const T={name:"Set Color for All Doors On the Same Wall",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.parentId,undo:()=>{g(T.oldValues)},redo:()=>{T.groupId&&p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1)}break;default:if(s){const v=l(s.id),T=(v?v.color:s.color)??"#ffffff",A={name:"Set Color of Selected Door",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};o(A),f(s.id,P),a(i+1)}}e(v=>{v.actionState.doorColor=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:640,title:Y.t("word.Color",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:c,onChangeComplete:P=>{u(P.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setDoorActionScope(P.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",d)})]})})})]})})},ppo=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(Ew),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Door),[c,u]=m.useState((s==null?void 0:s.frameColor)??"#ffffff"),d=Jt(),f=(P,v)=>{e(T=>{for(const A of T.elements)if(A.id===P){!A.locked&&A.type===z.Door&&(A.frameColor=v);break}})},p=(P,v)=>{for(const T of P.keys())f(T,v)},g=P=>{for(const[v,T]of P.entries())f(v,T)},y=P=>{switch(r){case oe.AllSelectedObjectsOfThisType:for(const v of n)if(v.type===z.Door&&!v.locked&&H.getState().selectedElementIdSet.has(v.id)&&P!==v.frameColor)return!0;break;case oe.AllObjectsOfThisType:for(const v of n)if(v.type===z.Door&&!v.locked&&P!==v.frameColor)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of n)if(v.type===z.Door&&v.foundationId===(s==null?void 0:s.foundationId)&&!v.locked&&P!==v.frameColor)return!0;break;case oe.OnlyThisSide:for(const v of n)if(v.type===z.Door&&v.parentId===(s==null?void 0:s.parentId)&&!v.locked&&P!==v.frameColor)return!0;break;default:if(P!==(s==null?void 0:s.frameColor))return!0;break}return!1},w=P=>{if(s&&y(P)){switch(r){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&v.set(A.id,A.frameColor??"#ffffff");const T={name:"Set Color for Selected Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&!A.locked&&v.set(A.id,A.frameColor??"#ffffff");const T={name:"Set Color for All Doors",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&A.foundationId===s.foundationId&&!s.locked&&v.set(A.id,A.frameColor??"#ffffff");const T={name:"Set Color for All Doors Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{g(T.oldValues)},redo:()=>{T.groupId&&p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1)}break;case oe.OnlyThisSide:if(s.parentId){const v=new Map;for(const A of H.getState().elements)A.type===z.Door&&A.parentId===s.parentId&&!s.locked&&v.set(A.id,A.frameColor??"#ffffff");const T={name:"Set Color for All Doors On the Same Wall",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.parentId,undo:()=>{g(T.oldValues)},redo:()=>{T.groupId&&p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1)}break;default:if(s){const v=l(s.id),T=(v?v.frameColor:s.frameColor)??"#ffffff",A={name:"Set Color of Selected Door",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};o(A),f(s.id,P),a(i+1)}}e(v=>{v.actionState.doorColor=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:640,title:Y.t("doorMenu.FrameColor",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:c??(s==null?void 0:s.frameColor)??"#ffffff",onChangeComplete:P=>{u(P.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setDoorActionScope(P.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("doorMenu.OnlyThisDoor",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("doorMenu.AllDoorsOnWall",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("doorMenu.AllDoorsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("doorMenu.AllSelectedDoors",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("doorMenu.AllDoors",d)})]})})})]})})},gpo=t=>{const e=[];if(t.type!==z.Door)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language};return e.push({key:"door-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"door-cut",label:h.jsx(Wd,{})}),e.push({key:"door-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&(e.push({key:"door-filled",label:h.jsx(rpo,{door:n})},{key:"door-interior",label:h.jsx(ipo,{door:n})}),e.push({key:"door-type-submenu",label:h.jsx(rn,{children:Y.t("doorMenu.DoorType",r)}),children:[{key:"door-type-radio-group",label:h.jsx(apo,{door:n}),style:{backgroundColor:"white"}}]},{key:"door-width",label:h.jsxs(to,{Dialog:lpo,children:[Y.t("word.Width",r)," ..."]})},{key:"door-height",label:h.jsxs(to,{Dialog:spo,children:[Y.t("word.Height",r)," ..."]})}),n.filled&&(e.push({key:"door-u-value",label:h.jsxs(to,{Dialog:upo,children:[Y.t("word.UValue",r)," ..."]})},{key:"door-heat-capacity",label:h.jsxs(to,{Dialog:dpo,children:[Y.t("word.VolumetricHeatCapacity",r)," ..."]})},{key:"door-texture",label:h.jsxs(to,{Dialog:fpo,children:[Y.t("word.Texture",r)," ..."]})},{key:"door-color",label:h.jsxs(to,{Dialog:hpo,children:[Y.t("word.Color",r)," ..."]})},{key:"door-frame-color",label:h.jsxs(to,{Dialog:ppo,children:[Y.t("doorMenu.FrameColor",r)," ..."]})}),(n.textureType===sr.Default||n.textureType===sr.NoTexture)&&e.push({key:"door-opacity",label:h.jsxs(to,{Dialog:cpo,children:[Y.t("wallMenu.Opacity",r)," ..."]})}))),{items:e}},mpo=({windowModel:t,dataType:e,attributeKey:n,range:o,step:r,unit:i,note:a,digit:l,setDialogVisible:s})=>{const c=H(Kn),u=H(En),d=H(TW),f=H(no),p=H(Zn),g=H(fn),y=H(qr),w=m.useMemo(()=>{const L=t[n],k=y(t);if(k&&t.parentType!==z.Roof){if(n==="lx")return L*k.lx;if(n==="lz")return L*k.lz}return n==="sillWidth"&&L===void 0?.2:L},[n,t]),[b,C]=m.useState(w),P=Jt(),v=(L,k,N)=>{const F=y(L);F&&(k==="lx"||k==="lz")?L.parentType===z.Roof?L[k]=N:L[k]=N/F[k]:L[k]=N},T=(L,k)=>{g(N=>{for(const F of N.elements)if(F.id===L){!F.locked&&F.type===z.Window&&v(F,n,k);break}})},A=(L,k)=>{L&&g(N=>{for(const F of N.elements)!F.locked&&F.type===z.Window&&F.parentId===L&&v(F,n,k)})},x=(L,k)=>{L&&g(N=>{for(const F of N.elements)!F.locked&&F.type===z.Window&&F.foundationId===L&&v(F,n,k)})},S=L=>{g(k=>{for(const N of k.elements)!N.locked&&N.type===z.Window&&v(N,n,L)})},R=(L,k)=>{g(N=>{for(const F of N.elements)!F.locked&&F.type===z.Window&&L.has(F.id)&&v(F,n,k)})},M=L=>{for(const[k,N]of L.entries())T(k,N)},D=L=>{switch(d){case oe.AllSelectedObjectsOfThisType:{for(const k of c)if(k.type===z.Window&&!k.locked&&H.getState().selectedElementIdSet.has(k.id)){const N=k,F=y(N);if(F&&N.parentType!==z.Roof){if(n==="lx"){if(L!==N[n]*F.lx)return!0}else if(n==="lz"){if(L!==N[n]*F.lz)return!0}else if(L!==N[n])return!0}else if(L!==N[n])return!0}break}case oe.AllObjectsOfThisType:{for(const k of c)if(k.type===z.Window&&!k.locked){const N=k,F=y(N);if(F&&N.parentType!==z.Roof){if(n==="lx"){if(L!==N[n]*F.lx)return!0}else if(n==="lz"){if(L!==N[n]*F.lz)return!0}else if(L!==N[n])return!0}else if(L!==N[n])return!0}break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const k of c)if(k.type===z.Window&&k.foundationId===t.foundationId&&!k.locked){const N=k,F=y(N);if(F&&N.parentType!==z.Roof){if(n==="lx"){if(L!==N[n]*F.lx)return!0}else if(n==="lz"){if(L!==N[n]*F.lz)return!0}else if(L!==N[n])return!0}else if(L!==N[n])return!0}break}case oe.OnlyThisSide:{for(const k of c)if(k.type===z.Window&&k.parentId===t.parentId&&!k.locked){const N=k,F=y(N);if(F&&N.parentType!==z.Roof){if(n==="lx"){if(L!==N[n]*F.lx)return!0}else if(n==="lz"){if(L!==N[n]*F.lz)return!0}else if(L!==N[n])return!0}else if(L!==N[n])return!0}break}default:{const k=y(t);if(k&&t.parentType!==z.Roof){if(n==="lx"){if(L!==t[n]*k.lx)return!0}else if(n==="lz"){if(L!==t[n]*k.lz)return!0}else if(L!==t[n])return!0}else if(L!==t[n])return!0;break}}return!1},E=L=>{if(t&&D(L)){switch(d){case oe.AllSelectedObjectsOfThisType:{const k=new Map;for(const F of c)if(F.type===z.Window&&!F.locked&&H.getState().selectedElementIdSet.has(F.id)){const U=F,O=y(U);let B=U[n];O&&U.parentType!==z.Roof&&(n==="lx"?B*=O.lx:n==="lz"&&(B*=O.lz)),k.set(F.id,B)}const N={name:`Set ${e} for Selected Windows`,timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{M(N.oldValues)},redo:()=>{R(N.oldValues,N.newValue)}};u(N),R(k,L),p(f+1);break}case oe.AllObjectsOfThisType:{const k=new Map;for(const F of c)if(F.type===z.Window&&!F.locked){const U=F,O=y(U);let B=U[n];O&&U.parentType!==z.Roof&&(n==="lx"?B*=O.lx:n==="lz"&&(B*=O.lz)),k.set(F.id,B)}const N={name:`Set ${e} for All Windows`,timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{M(N.oldValues)},redo:()=>{S(N.newValue)}};u(N),S(L),p(f+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(t.foundationId){const k=new Map;for(const F of c)if(F.type===z.Window&&F.foundationId===t.foundationId&&!F.locked){const U=F,O=y(U);let B=U[n];O&&U.parentType!==z.Roof&&(n==="lx"?B*=O.lx:n==="lz"&&(B*=O.lz)),k.set(F.id,B)}const N={name:`Set ${e} for All Windows Above Foundation`,timestamp:Date.now(),oldValues:k,newValue:L,groupId:t.foundationId,undo:()=>{M(N.oldValues)},redo:()=>{x(t.foundationId,N.newValue)}};u(N),x(t.foundationId,L),p(f+1)}break;case oe.OnlyThisSide:if(t.parentId){const k=new Map;for(const F of c)if(F.type===z.Window&&F.parentId===t.parentId&&!F.locked){const U=F,O=y(U);let B=U[n];O&&U.parentType!==z.Roof&&(n==="lx"?B*=O.lx:n==="lz"&&(B*=O.lz)),k.set(F.id,B)}const N={name:`Set ${e} for All Windows On the Same Parent`,timestamp:Date.now(),oldValues:k,newValue:L,groupId:t.parentId,undo:()=>{M(N.oldValues)},redo:()=>{A(t.parentId,N.newValue)}};u(N),A(t.parentId,L),p(f+1)}break;default:if(t){let k=t[n];const N=y(t);N&&t.parentType!==z.Roof&&(n==="lx"?k*=N.lx:n==="lz"&&(k*=N.lz));const F={name:`Set Window ${e}`,timestamp:Date.now(),oldValue:k,newValue:L,changedElementId:t.id,changedElementType:t.type,undo:()=>{T(F.changedElementId,F.oldValue)},redo:()=>{T(F.changedElementId,F.newValue)}};u(F),T(t.id,L),p(f+1)}}g(k=>{switch(e){case $h.Width:k.actionState.windowWidth=L;break;case $h.Height:k.actionState.windowHeight=L;break;case $h.Opacity:k.actionState.windowOpacity=L;break;case $h.FrameWidth:k.actionState.windowFrameWidth=L;break;case $h.SillWidth:k.actionState.windowSillWidth=L;break;case $h.HorizontalMullionSpacing:k.actionState.windowHorizontalMullionSpacing=L;break;case $h.VerticalMullionSpacing:k.actionState.windowVerticalMullionSpacing=L;break;case $h.MullionWidth:k.actionState.windowMullionWidth=L;break}})}},W=()=>{s(!1)},j=()=>{E(b)};return h.jsx(so,{width:550,title:Y.t(`windowMenu.${e}`,P),onApply:j,onClose:W,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:o[0],max:o[1],style:{width:120},step:r,precision:2,value:b,formatter:L=>Number(L).toFixed(2),onChange:L=>{L!==null&&C(L)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",P),": [",o[0].toFixed(o[0]===0?0:l??0),","," ",o[1].toFixed(l??0),"] ",i," ",h.jsx("br",{}),h.jsx("br",{})," ",a]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:i}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:L=>H.getState().setWindowActionScope(L.target.value),value:d,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windowMenu.OnlyThisWindow",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("windowMenu.AllWindowsOnSurface",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windowMenu.AllWindowsAboveFoundation",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windowMenu.AllSelectedWindows",P)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windowMenu.AllWindows",P)})]})})})]})})},ypo=({window:t,dataType:e,attributeKey:n,setDialogVisible:o})=>{const r=H(Kn),i=H(fn),a=H(En),l=H(TW),s=H(no),c=H(Zn),[u,d]=XZ(t[n]??"#ffffff"),f=Jt(),p=(x,S)=>{i(R=>{for(const M of R.elements)if(M.id===x){!M.locked&&M.type===z.Window&&(M[n]=S);break}})},g=(x,S)=>{i(R=>{for(const M of R.elements)!M.locked&&M.type===z.Window&&M.parentId===x&&(M[n]=S)})},y=(x,S)=>{i(R=>{for(const M of R.elements)!M.locked&&M.type===z.Window&&M.foundationId===x&&(M[n]=S)})},w=x=>{i(S=>{for(const R of S.elements)!R.locked&&R.type===z.Window&&(R[n]=x)})},b=(x,S)=>{i(R=>{for(const M of R.elements)!M.locked&&M.type===z.Window&&x.has(M.id)&&(M[n]=S)})},C=x=>{for(const[S,R]of x.entries())p(S,R)},P=x=>{switch(l){case oe.AllSelectedObjectsOfThisType:for(const S of r)if(S.type===z.Window&&x!==S[n]&&!S.locked&&H.getState().selectedElementIdSet.has(S.id))return!0;break;case oe.AllObjectsOfThisType:for(const S of r)if(S.type===z.Window&&x!==S[n]&&!S.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const S of r)if(S.type===z.Window&&S.foundationId===t.foundationId&&x!==S[n]&&!S.locked)return!0;break;case oe.OnlyThisSide:for(const S of r)if(S.type===z.Window&&S.parentId===t.parentId&&x!==S[n]&&!S.locked)return!0;break;default:if(x!==t[n])return!0;break}return!1},v=x=>{if(t&&P(x)){switch(l){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of r)M.type===z.Window&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M[n]);const R={name:`Set ${e} for Selected Windows`,timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{C(R.oldValues)},redo:()=>{b(R.oldValues,R.newValue)}};a(R),b(S,x),c(s+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of r)M.type===z.Window&&!M.locked&&S.set(M.id,M[n]);const R={name:`Set ${e} for All Windows`,timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{C(R.oldValues)},redo:()=>{w(R.newValue)}};a(R),w(x),c(s+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(t.foundationId){const S=new Map;for(const M of r)M.type===z.Window&&M.foundationId===t.foundationId&&!t.locked&&S.set(M.id,M[n]);const R={name:`Set ${e} for All Windows Above Foundation`,timestamp:Date.now(),oldValues:S,newValue:x,groupId:t.foundationId,undo:()=>{C(R.oldValues)},redo:()=>{y(R.groupId,R.newValue)}};a(R),y(t.foundationId,x),c(s+1)}break}case oe.OnlyThisSide:{if(t.parentId){const S=new Map;for(const M of r)M.type===z.Window&&M.parentId===t.parentId&&!M.locked&&S.set(M.id,M[n]);const R={name:`Set ${e} for All Windows On the Same Wall`,timestamp:Date.now(),oldValues:S,newValue:x,groupId:t.parentId,undo:()=>{C(R.oldValues)},redo:()=>{g(t.parentId,R.newValue)}};a(R),g(t.parentId,x),c(s+1)}break}default:{if(t){const S=t[n],R={name:`Set ${e} of Selected window`,timestamp:Date.now(),oldValue:S,newValue:x,changedElementId:t.id,changedElementType:t.type,undo:()=>{p(R.changedElementId,R.oldValue)},redo:()=>{p(R.changedElementId,R.newValue)}};a(R),p(t.id,x),c(s+1)}break}}i(S=>{switch(e){case $h.Tint:S.actionState.windowTint=x;break;case $h.MullionColor:S.actionState.windowMullionColor=x;break;case $h.Color:S.actionState.windowColor=x;break}})}},T=()=>{o()},A=()=>{t[n]!==u&&v(u)};return h.jsx(so,{width:640,title:Y.t(`windowMenu.${e}`,f),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:u??"#73D8FF",onChangeComplete:d})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:x=>H.getState().setWindowActionScope(x.target.value),value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windowMenu.OnlyThisWindow",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("windowMenu.AllWindowsOnSurface",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windowMenu.AllWindowsAboveFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windowMenu.AllSelectedWindows",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windowMenu.AllWindows",f)})]})})})]})})},Apo=({window:t,dataType:e,attributeKey:n,setDialogVisible:o})=>{const r=H(Kn),i=H(fn),a=H(En),l=H(TW),s=H(no),c=H(Zn),[u,d]=m.useState(t[n]),f=Jt(),p=(x,S)=>{i(R=>{for(const M of R.elements)if(M.id===x&&!M.locked&&M.type===z.Window){M[n]=S;break}})},g=(x,S)=>{i(R=>{for(const M of R.elements)!M.locked&&M.type===z.Window&&M.parentId===x&&(M[n]=S)})},y=(x,S)=>{i(R=>{for(const M of R.elements)!M.locked&&M.type===z.Window&&M.foundationId===x&&(M[n]=S)})},w=x=>{i(S=>{for(const R of S.elements)!R.locked&&R.type===z.Window&&(R[n]=x)})},b=(x,S)=>{i(R=>{for(const M of R.elements)!M.locked&&M.type===z.Window&&x.has(M.id)&&(M[n]=S)})},C=x=>{for(const[S,R]of x.entries())p(S,R)},P=x=>{switch(l){case oe.AllSelectedObjectsOfThisType:for(const S of r)if(S.type===z.Window&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)&&S[n]!==x)return!0;break;case oe.AllObjectsOfThisType:for(const S of r)if(S.type===z.Window&&!S.locked&&S[n]!==x)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const S of r)if(S.type===z.Window&&S.foundationId===t.foundationId&&!S.locked&&S[n]!==x)return!0;break;case oe.OnlyThisSide:for(const S of r)if(S.type===z.Window&&S.parentId===t.parentId&&!S.locked&&S[n]!==x)return!0;break;default:if(t[n]!==x)return!0;break}return!1},v=x=>{if(t&&P(x))switch(l){case oe.AllSelectedObjectsOfThisType:{const S=new Map;for(const M of r)M.type===z.Window&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&S.set(M.id,M[n]);const R={name:`Set ${e} for Selected Windows`,timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{C(R.oldValues)},redo:()=>{b(R.oldValues,R.newValue)}};a(R),b(S,x),c(s+1);break}case oe.AllObjectsOfThisType:{const S=new Map;for(const M of r)M.type===z.Window&&!M.locked&&S.set(M.id,M[n]);const R={name:`Set ${e} for All Windows`,timestamp:Date.now(),oldValues:S,newValue:x,undo:()=>{C(R.oldValues)},redo:()=>{w(R.newValue)}};a(R),w(x),c(s+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(t.foundationId){const S=new Map;for(const M of r)M.type===z.Window&&M.foundationId===t.foundationId&&!t.locked&&S.set(M.id,M[n]);const R={name:`Set ${e} for All Windows Above Foundation`,timestamp:Date.now(),oldValues:S,newValue:x,groupId:t.foundationId,undo:()=>{C(R.oldValues)},redo:()=>{y(R.groupId,R.newValue)}};a(R),y(t.foundationId,x),c(s+1)}break}case oe.OnlyThisSide:{if(t.parentId){const S=new Map;for(const M of r)M.type===z.Window&&M.parentId===t.parentId&&!M.locked&&S.set(M.id,M[n]);const R={name:`Set ${e} for All Windows On the Same Wall`,timestamp:Date.now(),oldValues:S,newValue:x,groupId:t.parentId,undo:()=>{C(R.oldValues)},redo:()=>{g(t.parentId,R.newValue)}};a(R),g(t.parentId,x),c(s+1)}break}default:{if(t){const S=t[n],R={name:`Set ${e} of Selected window`,timestamp:Date.now(),oldValue:S,newValue:x,changedElementId:t.id,changedElementType:t.type,undo:()=>{p(R.changedElementId,R.oldValue)},redo:()=>{p(R.changedElementId,R.newValue)}};a(R),p(t.id,x),c(s+1)}break}}},T=()=>{o()},A=()=>{t[n]!==u&&v(u)};return h.jsx(so,{width:500,title:Y.t(`windowMenu.${e}`,f),onApply:A,onClose:T,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:4,children:h.jsx(xc,{checked:u,onChange:x=>{d(x)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:20,children:h.jsx(Ue.Group,{onChange:x=>H.getState().setWindowActionScope(x.target.value),value:l,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windowMenu.OnlyThisWindow",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("windowMenu.AllWindowsOnSurface",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windowMenu.AllWindowsAboveFoundation",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windowMenu.AllSelectedWindows",f)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windowMenu.AllWindows",f)})]})})})]})})},{Option:wpo}=_o,vpo=({window:t,dataType:e,attributeKey:n,options:o,optionsText:r,setDialogVisible:i})=>{const a=H(Kn),l=H(fn),s=H(En),c=H(TW),u=H(no),d=H(Zn),[f,p]=m.useState(t[n]),g=Jt(),y=(R,M)=>{l(D=>{for(const E of D.elements)if(E.id===R){!E.locked&&E.type===z.Window&&(E[n]=M);break}})},w=(R,M)=>{l(D=>{for(const E of D.elements)!E.locked&&E.type===z.Window&&E.parentId===R&&(E[n]=M)})},b=(R,M)=>{l(D=>{for(const E of D.elements)!E.locked&&E.type===z.Window&&E.foundationId===R&&(E[n]=M)})},C=R=>{l(M=>{for(const D of M.elements)!D.locked&&D.type===z.Window&&(D[n]=R)})},P=(R,M)=>{l(D=>{for(const E of D.elements)!E.locked&&E.type===z.Window&&R.has(E.id)&&(E[n]=M)})},v=R=>{for(const[M,D]of R.entries())y(M,D)},T=R=>{if(t){switch(c){case oe.AllSelectedObjectsOfThisType:for(const M of a)if(M.type===z.Window&&R!==M[n]&&!M.locked&&H.getState().selectedElementIdSet.has(M.id))return!0;break;case oe.AllObjectsOfThisType:for(const M of a)if(M.type===z.Window&&R!==M[n]&&!M.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const M of a)if(M.type===z.Window&&M.foundationId===t.foundationId&&R!==M[n]&&!M.locked)return!0;break;case oe.OnlyThisSide:for(const M of a)if(M.type===z.Window&&M.parentId===t.parentId&&R!==M[n]&&!M.locked)return!0;break;default:if(R!==t[n])return!0;break}return!1}},A=R=>{if(t&&T(R)){switch(c){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of a)E.type===z.Window&&!E.locked&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E[n]);const D={name:`Set ${e} for Selected Windows`,timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{v(D.oldValues)},redo:()=>{P(D.oldValues,D.newValue)}};s(D),P(M,R),d(u+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of a)E.type===z.Window&&!E.locked&&M.set(E.id,E[n]);const D={name:`Set ${e} for All Windows`,timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{v(D.oldValues)},redo:()=>{C(D.newValue)}};s(D),C(R),d(u+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(t.foundationId){const M=new Map;for(const E of a)E.type===z.Window&&E.foundationId===t.foundationId&&!t.locked&&M.set(E.id,E[n]);const D={name:`Set ${e} for All Windows Above Foundation`,timestamp:Date.now(),oldValues:M,newValue:R,groupId:t.foundationId,undo:()=>{v(D.oldValues)},redo:()=>{b(D.groupId,D.newValue)}};s(D),b(t.foundationId,R),d(u+1)}break}case oe.OnlyThisSide:{if(t.parentId){const M=new Map;for(const E of a)E.type===z.Window&&E.parentId===t.parentId&&!E.locked&&M.set(E.id,E[n]);const D={name:`Set ${e} for All Windows On the Same Wall`,timestamp:Date.now(),oldValues:M,newValue:R,groupId:t.parentId,undo:()=>{v(D.oldValues)},redo:()=>{w(t.parentId,D.newValue)}};s(D),w(t.parentId,R),d(u+1)}break}default:{if(t){const M=t[n],D={name:`Set ${e} of Selected window`,timestamp:Date.now(),oldValue:M,newValue:R,changedElementId:t.id,changedElementType:t.type,undo:()=>{y(D.changedElementId,D.oldValue)},redo:()=>{y(D.changedElementId,D.newValue)}};s(D),y(t.id,R),d(u+1)}break}}l(M=>{switch(e){case $h.Tint:M.actionState.windowTint=R;break;case $h.MullionColor:M.actionState.windowMullionColor=R;break;case $h.Color:M.actionState.windowColor=R;break}})}},x=()=>{i()},S=()=>{A(f)};return h.jsx(so,{width:560,title:Y.t(`windowMenu.${e}`,g),onApply:S,onClose:x,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:8,children:h.jsx(_o,{style:{width:"150px"},value:f,onChange:R=>p(R),children:o.map((R,M)=>h.jsx(wpo,{value:R,children:r[M]},R))})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:R=>H.getState().setWindowActionScope(R.target.value),value:c,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windowMenu.OnlyThisWindow",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("windowMenu.AllWindowsOnSurface",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windowMenu.AllWindowsAboveFoundation",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windowMenu.AllSelectedWindows",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windowMenu.AllWindows",g)})]})})})]})})};var xg=(t=>(t.Opacity="Opacity",t.Width="Width",t.Height="Height",t.Setback="Setback",t.HorizontalMullionSpacing="HorizontalMullionSpacing",t.VerticalMullionSpacing="VerticalMullionSpacing",t.MullionWidth="MullionWidth",t.SillWidth="SillWidth",t.FrameWidth="FrameWidth",t.ShutterWidth="ShutterWidth",t))(xg||{}),QN=(t=>(t.ShutterColor="ShutterColor",t.Color="Color",t.MullionColor="MullionColor",t.Tint="Tint",t))(QN||{}),qR=(t=>(t.Frame="Frame",t.LeftShutter="LeftShutter",t.RightShutter="RightShutter",t.HorizontalMullion="HorizontalMullion",t.VerticalMullion="VerticalMullion",t))(qR||{}),zrt=(t=>(t.WindowType="WindowType",t))(zrt||{});const A9=({dataType:t,noPadding:e})=>{const n=Jt(),[o,r]=m.useState(!1),i=co(z.Window),a=i?H.getState().getParent(i):null,l=()=>{H.getState().setApplyCount(0),r(!0)},s=zpo[t];return t===xg.Width?s.range[1]=a&&i&&i.parentType!==z.Roof?2*a.lx*Math.min(Math.abs(.5-i.cx),Math.abs(-.5-i.cx)):100:t===xg.Height&&(s.range[1]=a&&i&&i.parentType!==z.Roof?2*a.lz*Math.min(Math.abs(.5-i.cz),Math.abs(-.5-i.cz)):100),h.jsxs(h.Fragment,{children:[h.jsxs(rn,{noPadding:e,onClick:l,children:[Y.t(`windowMenu.${t}`,n)," ..."]}),o&&s&&i&&h.jsx(mpo,{windowModel:i,dataType:t,attributeKey:s.attributeKey,range:s.range,step:s.step,unit:s.unit?Y.t(s.unit,n):void 0,note:s.note?Y.t(s.note,n):void 0,digit:s.digit??0,setDialogVisible:r})]})},dee=({dataType:t,noPadding:e})=>{const[n,o]=m.useState(!1),r=Jt(),i=co(z.Window),a=()=>{H.getState().setApplyCount(0),o(!0)},l=Hpo[t];return h.jsxs(h.Fragment,{children:[h.jsxs(rn,{noPadding:e,onClick:a,children:[Y.t(`windowMenu.${t}`,r)," ..."]}),n&&l&&i&&h.jsx(ypo,{window:i,dataType:t,attributeKey:l.attributeKey,setDialogVisible:()=>o(!1)})]})},Wk=({dataType:t,noPadding:e})=>{const[n,o]=m.useState(!1),r=Jt(),i=co(z.Window),a=()=>{H.getState().setApplyCount(0),o(!0)},l=Mpo[t];return h.jsxs(h.Fragment,{children:[h.jsxs(rn,{noPadding:e,onClick:a,children:[Y.t(`windowMenu.${t}`,r)," ..."]}),n&&l&&i&&h.jsx(Apo,{window:i,dataType:t,attributeKey:l.attributeKey,setDialogVisible:()=>o(!1)})]})},xpo=({dataType:t,noPadding:e})=>{const n=Jt(),[o,r]=m.useState(!1),i=co(z.Window),a=()=>{H.getState().setApplyCount(0),r(!0)},l=Ipo[t];return h.jsxs(h.Fragment,{children:[h.jsxs(rn,{noPadding:e,onClick:a,children:[Y.t(`windowMenu.${t}`,n)," ..."]}),o&&l&&i&&h.jsx(vpo,{window:i,dataType:t,attributeKey:l.attributeKey,options:[Ti.Default,Ti.Arched,Ti.Polygonal],optionsText:[Y.t("windowMenu.Default",n),Y.t("windowMenu.Arched",n),Y.t("windowMenu.Polygonal",n)],setDialogVisible:()=>r(!1)})]})},bpo=({window:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&l.type===z.Window){l.empty=i;break}})},o=r=>{const i=r.target.checked,a={name:"Empty Window",timestamp:Date.now(),checked:i,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i),H.getState().set(l=>{l.actionState.windowEmpty=i})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:!!t.empty,onChange:o,children:Y.t("windowMenu.Empty",e)})})},Spo=({window:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{for(const l of a.elements)if(l.id===r&&l.type===z.Window){l.interior=i;break}})},o=r=>{const i=r.target.checked,a={name:"Interior Window",timestamp:Date.now(),checked:i,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i),H.getState().set(l=>{l.actionState.windowInterior=i})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:!!t.interior,onChange:o,children:Y.t("windowMenu.Interior",e)})})},Tpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(TW),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Window),[c,u]=m.useState((s==null?void 0:s.uValue)??V4),[d,f]=m.useState(me.toUValueInUS(c)),p=Jt(),g=(T,A)=>{l(x=>{for(const S of x.elements)if(S.id===T){S.uValue=A;break}})},y=T=>{for(const[A,x]of T.entries())g(A,x)},w=(T,A)=>{for(const x of T.keys())g(x,A)},b=T=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const A of e)if(A.type===z.Window&&T!==A.uValue&&!A.locked&&H.getState().selectedElementIdSet.has(A.id))return!0;break;case oe.AllObjectsOfThisType:for(const A of e)if(A.type===z.Window&&T!==A.uValue&&!A.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const A of e)if(A.type===z.Window&&A.foundationId===s.foundationId&&T!==A.uValue&&!A.locked)return!0;break;case oe.OnlyThisSide:for(const A of e)if(A.type===z.Window&&A.parentId===s.parentId&&T!==A.uValue&&!A.locked)return!0;break;default:if(T!==(s==null?void 0:s.uValue))return!0;break}return!1}},C=T=>{if(s&&b(T)){switch(o){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of e)if(S.type===z.Window&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)){const R=S;A.set(S.id,R.uValue??V4),g(R.id,T)}const x={name:"Set U-Value for Selected Windows",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of e)if(S.type===z.Window&&!S.locked){const R=S;A.set(S.id,R.uValue??V4),g(R.id,T)}const x={name:"Set U-Value for All Windows",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(s.foundationId){const A=new Map;for(const S of e)if(S.type===z.Window&&S.foundationId===s.foundationId&&!S.locked){const R=S;A.set(S.id,R.uValue??V4),g(R.id,T)}const x={name:"Set U-Value for All Windows Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.foundationId,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1)}break}case oe.OnlyThisSide:{if(s.parentId){const A=new Map;for(const S of e)if(S.type===z.Window&&S.parentId===s.parentId&&!S.locked){const R=S;A.set(S.id,R.uValue??V4),g(R.id,T)}const x={name:"Set U-Value for All Windows On the Same Wall",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.parentId,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1)}break}default:{if(s){const x=a(s.id).uValue??s.uValue??V4,S={name:"Set Window U-Value",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:s.id,changedElementType:s.type,undo:()=>{g(S.changedElementId,S.oldValue)},redo:()=>{g(S.changedElementId,S.newValue)}};n(S),g(s.id,T),i(r+1)}break}}l(A=>{A.actionState.windowUValue=T})}},P=()=>{t(!1)},v=()=>{C(c)};return h.jsx(so,{width:550,title:`${Y.t("word.UValue",p)+" "}(${Y.t("word.ThermalTransmittance",p)})`,onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(u(T),f(me.toUValueInUS(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0.01, 100]",h.jsx("br",{}),Y.t("word.SIUnit",p),": W/(m²·℃)"]}),h.jsx("br",{}),h.jsx(Mn,{min:me.toUValueInUS(.01),max:me.toUValueInUS(100),style:{width:120},step:.01,precision:2,value:d,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(f(T),u(me.toUValueInSI(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [",me.toUValueInUS(.01).toFixed(3),", ",me.toUValueInUS(100).toFixed(1),"]",h.jsx("br",{}),Y.t("word.USUnit",p),": Btu/(h·ft²·℉)"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:T=>H.getState().setWindowActionScope(T.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windowMenu.OnlyThisWindow",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisSide,children:Y.t("windowMenu.AllWindowsOnSurface",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windowMenu.AllWindowsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windowMenu.AllSelectedWindows",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windowMenu.AllWindows",p)})]})})})]})})},Ppo=t=>{const e=[];return e.push({key:"window-frame-boolean",label:h.jsx(Wk,{noPadding:!0,dataType:qR.Frame})}),t.frame&&e.push({type:"divider"},{key:"window-frame-width",label:h.jsx(A9,{noPadding:!0,dataType:xg.FrameWidth})},{key:"window-sill-width",label:h.jsx(A9,{noPadding:!0,dataType:xg.SillWidth})},{key:"window-frame-color",label:h.jsx(dee,{noPadding:!0,dataType:QN.Color})}),e},Cpo=t=>{const e=[];return e.push({key:"window-horizontal-mullion",label:h.jsx(Wk,{noPadding:!0,dataType:qR.HorizontalMullion})},{key:"window-vertical-mullion",label:h.jsx(Wk,{noPadding:!0,dataType:qR.VerticalMullion})}),(t.horizontalMullion||t.verticalMullion)&&(e.push({type:"divider"},{key:"window-mullion-width",label:h.jsx(A9,{noPadding:!0,dataType:xg.MullionWidth})},{key:"window-mullion-color",label:h.jsx(dee,{noPadding:!0,dataType:QN.MullionColor})}),t.horizontalMullion&&e.push({key:"window-horizontal-mullion-spacing",label:h.jsx(A9,{noPadding:!0,dataType:xg.HorizontalMullionSpacing})}),t.verticalMullion&&e.push({key:"window-vertical-mullion-spacing",label:h.jsx(A9,{noPadding:!0,dataType:xg.VerticalMullionSpacing})})),e},Rpo=t=>{const e=[];return e.push({key:"window-left-shutter",label:h.jsx(Wk,{noPadding:!0,dataType:qR.LeftShutter})},{key:"window-right-shutter",label:h.jsx(Wk,{noPadding:!0,dataType:qR.RightShutter})}),(t.leftShutter||t.rightShutter)&&e.push({type:"divider"},{key:"window-shutter-color",label:h.jsx(dee,{noPadding:!0,dataType:QN.ShutterColor})},{key:"window-shutter-width",label:h.jsx(A9,{noPadding:!0,dataType:xg.ShutterWidth})}),e};var $h=(t=>(t.Color="Color",t.Tint="Tint",t.Opacity="Opacity",t.WindowType="WindowType",t.MullionWidth="MullionWidth",t.HorizontalMullionSpacing="HorizontalMullionSpacing",t.VerticalMullionSpacing="VerticalMullionSpacing",t.MullionColor="MullionColor",t.Frame="Frame",t.FrameWidth="FrameWidth",t.SillWidth="SillWidth",t.Width="Width",t.Height="Height",t))($h||{});const Hpo={Tint:{attributeKey:"tint"},Color:{attributeKey:"color"},MullionColor:{attributeKey:"mullionColor"},ShutterColor:{attributeKey:"shutterColor"}},Mpo={HorizontalMullion:{attributeKey:"horizontalMullion"},VerticalMullion:{attributeKey:"verticalMullion"},Frame:{attributeKey:"frame"},LeftShutter:{attributeKey:"leftShutter"},RightShutter:{attributeKey:"rightShutter"}},Ipo={WindowType:{attributeKey:"windowType",options:[Ti.Default,Ti.Arched,Ti.Polygonal]}},zpo={Opacity:{attributeKey:"opacity",range:[0,.9],step:.1,note:"windowMenu.SolarHeatGainCoefficient",digit:1},Width:{attributeKey:"lx",range:[.1,100],step:.1,unit:"word.MeterAbbreviation",digit:1},Height:{attributeKey:"lz",range:[.1,100],step:.1,unit:"word.MeterAbbreviation",digit:1},Setback:{attributeKey:"cy",range:[0,1],step:.01,unit:"",digit:0,note:"windowMenu.RelativeToWallThickness"},MullionWidth:{attributeKey:"mullionWidth",range:[0,.5],step:.1,unit:"word.MeterAbbreviation",digit:1},ShutterWidth:{attributeKey:"shutterWidth",range:[0,.5],step:.01,unit:"",digit:1},HorizontalMullionSpacing:{attributeKey:"horizontalMullionSpacing",range:[.1,10],step:.01,unit:"word.MeterAbbreviation",digit:1},VerticalMullionSpacing:{attributeKey:"verticalMullionSpacing",range:[.1,10],step:.01,unit:"word.MeterAbbreviation",digit:1},FrameWidth:{attributeKey:"frameWidth",range:[.05,.2],step:.01,unit:"word.MeterAbbreviation",digit:2},SillWidth:{attributeKey:"sillWidth",range:[0,.5],step:.01,unit:"word.MeterAbbreviation",digit:2}},Dpo=t=>{const e=[];if(t.type!==z.Window)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language};return e.push({key:"window-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"window-cut",label:h.jsx(Wd,{})}),e.push({key:"window-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&e.push({key:"window-empty",label:h.jsx(bpo,{window:n})},{key:"window-interior",label:h.jsx(Spo,{window:n})}),o&&e.push({key:"window-type",label:h.jsx(xpo,{dataType:zrt.WindowType})},{key:"window-width",label:h.jsx(A9,{dataType:xg.Width})},{key:"window-height",label:h.jsx(A9,{dataType:xg.Height})},{key:"window-setback",label:h.jsx(A9,{dataType:xg.Setback})},{key:"window-opacity",label:h.jsx(A9,{dataType:xg.Opacity})},{key:"window-tint",label:h.jsx(dee,{dataType:QN.Tint})},{key:"window-u-value",label:h.jsxs(to,{Dialog:Tpo,children:[Y.t("word.UValue",r)," ..."]})},{key:"window-mullion-submenu",label:h.jsx(rn,{children:Y.t("windowMenu.Mullion",r)}),children:Cpo(n)},{key:"window-frame-submenu",label:h.jsx(rn,{children:Y.t("windowMenu.Frame",r)}),children:Ppo(n)},{key:"window-shutter-submenu",label:h.jsx(rn,{children:Y.t("windowMenu.Shutter",r)}),children:Rpo(n)}),{items:e}},Epo=({roof:t})=>{const e=Jt(),n=(r,i)=>{H.getState().set(a=>{const l=a.elements.find(s=>s.id===r&&s.type===z.Roof);l&&(l.ceiling=i,a.actionState.roofCeiling=i)})},o=r=>{const i=r.target.checked,a={name:"Roof Ceiling",timestamp:Date.now(),checked:i,selectedElementId:t.id,selectedElementType:t.type,undo:()=>{n(t.id,!a.checked)},redo:()=>{n(t.id,a.checked)}};H.getState().addUndoable(a),n(t.id,i)};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Li,{style:{width:"100%"},checked:t.ceiling,onChange:o,children:Y.t("roofMenu.Ceiling",e)})})},Fpo=({roof:t,objectType:e,modalTitle:n,onClickOk:o,children:r})=>{const i=H.getState().removeAllChildElementsByType,a=()=>{const s=H.getState().elements.filter(d=>!d.locked&&d.type===e&&d.parentId===t.id);i(t.id,e);const c=JSON.parse(JSON.stringify(s)),u={name:`Remove All ${e}s on Roof`,timestamp:Date.now(),parentId:t.id,removedElements:c,undo:()=>{H.getState().set(d=>{d.elements.push(...u.removedElements)})},redo:()=>{i(u.parentId,e)}};H.getState().addUndoable(u)},l=()=>{const s=o??a;Oi.confirm({title:n,icon:h.jsx(ny,{}),onOk:s})};return h.jsx(rn,{update:!0,noPadding:!0,onClick:l,children:r})},DHe=({roof:t,objectType:e,lock:n,children:o})=>{const r=H.getState().updateElementLockById,i=H.getState().updateElementLockByParentId,a=()=>{const l=e.replaceAll(" ",""),s=new Map;for(const d of H.getState().elements)d.parentId===t.id&&d.type===e&&s.set(d.id,!!d.locked);i(t.id,e,n);const u={name:n?`Lock All Unlocked ${l} on Roof`:`Unlock All Locked ${l} on Roof`,timestamp:Date.now(),oldValues:s,newValue:!0,undo:()=>{for(const[d,f]of u.oldValues.entries())r(d,f)},redo:()=>{i(t.id,e,n)}};H.getState().addUndoable(u)};return h.jsx(rn,{stayAfterClick:!0,update:!0,noPadding:!0,onClick:a,children:o})},kpo=({roof:t})=>{const e=Jt(),n=H.getState().updateRoofStructureById,o=r=>{const i={name:"Select Roof Structure",timestamp:Date.now(),oldValue:t.roofStructure??wc.Default,newValue:r.target.value,changedElementId:t.id,changedElementType:t.type,undo:()=>{n(i.changedElementId,i.oldValue)},redo:()=>{n(i.changedElementId,i.newValue)}};H.getState().addUndoable(i),n(t.id,r.target.value),H.getState().set(a=>{a.actionState.roofStructure=r.target.value})};return h.jsx(rn,{stayAfterClick:!0,noPadding:!0,children:h.jsx(Ue.Group,{value:t.roofStructure??wc.Default,onChange:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:wc.Default,children:Y.t("roofMenu.DefaultStructure",e)}),h.jsx(Ue,{style:{width:"100%"},value:wc.Rafter,children:Y.t("roofMenu.RafterStructure",e)}),h.jsx(Ue,{style:{width:"100%"},value:wc.Glass,children:Y.t("roofMenu.GlassStructure",e)})]})})})},Vae=[{key:"solarPanelCount",lockedKey:"lockedSolarPanelCount",objectType:z.SolarPanel},{key:"windowCount",lockedKey:"lockedWindowCount",objectType:z.Window},{key:"sensorCount",lockedKey:"lockedSensorCount",objectType:z.Sensor},{key:"outsideLightCount",lockedKey:"lockedLightCount",objectType:z.Light}],Lpo=(t,e)=>{const n={lng:H.getState().language};let o="",r="";switch(t){case z.SolarPanel:{o=`${Y.t("roofMenu.RemoveAllUnlockedSolarPanels",n)} (${e})`,r=`${Y.t("roofMenu.DoYouReallyWantToRemoveAllSolarPanelsOnThisRoof",n)} (${e} ${Y.t("roofMenu.SolarPanels",n)})`;break}case z.Window:{o=`${Y.t("roofMenu.RemoveAllUnlockedWindows",n)} (${e})`,r=`${Y.t("roofMenu.DoYouReallyWantToRemoveAllWindowsOnThisRoof",n)} (${e} ${Y.t("roofMenu.Windows",n)})`;break}case z.Sensor:{o=`${Y.t("roofMenu.RemoveAllUnlockedSensors",n)} (${e})`,r=`${Y.t("roofMenu.DoYouReallyWantToRemoveAllSensorsOnThisRoof",n)} (${e} ${Y.t("roofMenu.Sensors",n)})`;break}case z.Light:{o=`${Y.t("roofMenu.RemoveAllUnlockedLights",n)} (${e})`,r=`${Y.t("roofMenu.DoYouReallyWantToRemoveAllLightsOnThisRoof",n)} (${e} ${Y.t("roofMenu.Lights",n)})`;break}}return{itemLabel:o,modalTitle:r}},Gae=(t,e,n,o)=>n===z.Light?o?t.lockedLightCount:t.insideLightCount+t.outsideLightCount:t[e],Wpo=(t,e,n)=>{const o=[],r={lng:H.getState().language};return Vae.forEach(({key:i,objectType:a})=>{const l=Gae(n,i,a);if(typeof l=="number"&&l>0){const{itemLabel:s,modalTitle:c}=Lpo(a,l),u=a.replaceAll(" ","");o.push({key:`remove-all-${u}s-on-roof`,label:h.jsx(Fpo,{roof:t,objectType:a,modalTitle:c,children:s})})}}),Vae.forEach(({key:i,objectType:a})=>{const l=Gae(n,i,a);if(typeof l=="number"&&l>0){const s=a.replaceAll(" ","");o.push({key:`lock-all-${s}s-on-roof`,label:h.jsxs(DHe,{roof:t,objectType:a,lock:!0,children:[Y.t(`wallMenu.LockAllUnlocked${s}s`,r)," (",l,")"]})})}}),Vae.forEach(({lockedKey:i,objectType:a})=>{const l=Gae(e,i,a,!0);if(typeof l=="number"&&l>0){const s=a.replaceAll(" ","");o.push({key:`unlock-all-${s}s-on-wall`,label:h.jsxs(DHe,{roof:t,objectType:a,lock:!1,children:[Y.t(`wallMenu.UnlockAllLocked${s}s`,r)," (",l,")"]})})}}),e.outsideLightCount>0&&o.push({key:"inside-lights-on-wall",label:h.jsxs(gX,{element:t,inside:!0,children:[Y.t("wallMenu.AllLightsOnWallInside",r)," (",e.outsideLightCount,")"]})}),e.insideLightCount>0&&o.push({key:"outside-lights-on-wall",label:h.jsxs(gX,{element:t,inside:!1,children:[Y.t("wallMenu.AllLightsOnWallOutside",r)," (",e.insideLightCount,")"]})}),o},Npo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(sy),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.thickness)??.4),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)A.id===P&&(A.thickness=v,T.updateElementOnRoofFlag=!0),A.parentId===P&&A.type===z.Window&&(A.ly=v)})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.thickness&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.thickness&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.thickness&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.thickness))return!0;break}return!1}},w=P=>{if(s&&y(P)){switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of e)if(A.type===z.Roof&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)){const x=A;v.set(A.id,x.thickness),f(x.id,P)}const T={name:"Set Thickness for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of e)if(A.type===z.Roof&&!A.locked){const x=A;v.set(A.id,x.thickness),f(x.id,P)}const T={name:"Set Thickness for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of e)if(A.type===z.Roof&&A.foundationId===s.foundationId&&!A.locked){const x=A;v.set(A.id,x.thickness),f(x.id,P)}const T={name:"Set Thickness for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;default:if(s){const T=a(s.id).thickness??s.thickness??.4,A={name:"Set Roof Thickness",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}}l(v=>{v.actionState.roofThickness=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("word.Thickness",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.05,max:1,style:{width:120},step:.01,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>u(P)}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0.05, 1] ",Y.t("word.MeterAbbreviation",d)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",d)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},Upo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(sy),r=H(no),i=H(Zn),a=H(Gn),l=co(z.Roof),[s,c]=m.useState((l==null?void 0:l.rise)??0),u=Jt(),d=(C,P)=>{H.getState().updateRoofRiseById(C,P),H.getState().set(v=>{v.updateElementOnRoofFlag=!0})},f=C=>{for(const[P,v]of C.entries())d(P,v)},p=(C,P)=>{for(const v of C.keys())d(v,P)},g=C=>{if(l){switch(o){case oe.AllSelectedObjectsOfThisType:for(const P of e)if(P.type===z.Roof&&C!==P.rise&&!P.locked&&H.getState().selectedElementIdSet.has(P.id))return!0;break;case oe.AllObjectsOfThisType:for(const P of e)if(P.type===z.Roof&&C!==P.rise&&!P.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const P of e)if(P.type===z.Roof&&P.foundationId===l.foundationId&&C!==P.rise&&!P.locked)return!0;break;default:if(C!==(l==null?void 0:l.rise))return!0;break}return!1}},y=C=>{if(l&&g(C))switch(H.getState().roofActionScope){case oe.AllSelectedObjectsOfThisType:{const P=new Map;for(const T of e)T.type===z.Roof&&!T.locked&&(P.set(T.id,T.rise),d(T.id,C));const v={name:"Set Rise for Selected Roofs",timestamp:Date.now(),oldValues:P,newValue:C,undo:()=>{f(v.oldValues)},redo:()=>{p(v.oldValues,v.newValue)}};n(v),i(r+1);break}case oe.AllObjectsOfThisType:{const P=new Map;for(const T of e)T.type===z.Roof&&!T.locked&&(P.set(T.id,T.rise),d(T.id,C));const v={name:"Set Rise for All Roofs",timestamp:Date.now(),oldValues:P,newValue:C,undo:()=>{f(v.oldValues)},redo:()=>{p(v.oldValues,v.newValue)}};n(v),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(l.foundationId){const P=new Map;for(const T of e)T.type===z.Roof&&T.foundationId===l.foundationId&&!T.locked&&(P.set(T.id,T.rise),d(T.id,C));const v={name:"Set Rise for All Roofs Above Foundation",timestamp:Date.now(),oldValues:P,newValue:C,groupId:l.foundationId,undo:()=>{f(v.oldValues)},redo:()=>{p(v.oldValues,v.newValue)}};n(v),i(r+1)}break;default:if(l){const P=a(l.id),v=(P==null?void 0:P.rise)??(l==null?void 0:l.rise)??0,T={name:"Set Roof Rise",timestamp:Date.now(),oldValue:v,newValue:C,changedElementId:l.id,changedElementType:l.type,undo:()=>{d(T.changedElementId,T.oldValue)},redo:()=>{d(T.changedElementId,T.newValue)}};n(T),d(l.id,C),i(r+1)}}},w=()=>{t(!1)},b=()=>{y(s)};return h.jsx(so,{width:550,title:Y.t("roofMenu.Rise",u),onApply:b,onClose:w,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:200,style:{width:120},step:.1,precision:2,value:s,formatter:C=>Number(C).toFixed(2),onChange:C=>c(C)}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",u),": [0, 200] ",Y.t("word.MeterAbbreviation",u)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",u)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:C=>H.getState().setRoofActionScope(C.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",u)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",u)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",u)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",u)})]})})})]})})},jpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(sy),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.rValue)??r8),[d,f]=m.useState(me.toRValueInUS(c)),p=Jt(),g=(T,A)=>{l(x=>{for(const S of x.elements)if(S.id===T){S.rValue=A;break}})},y=T=>{for(const[A,x]of T.entries())g(A,x)},w=(T,A)=>{for(const x of T.keys())g(x,A)},b=T=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const A of e)if(A.type===z.Roof&&T!==A.rValue&&!A.locked&&H.getState().selectedElementIdSet.has(A.id))return!0;break;case oe.AllObjectsOfThisType:for(const A of e)if(A.type===z.Roof&&T!==A.rValue&&!A.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const A of e)if(A.type===z.Roof&&A.foundationId===s.foundationId&&T!==A.rValue&&!A.locked)return!0;break;default:if(T!==(s==null?void 0:s.rValue))return!0;break}return!1}},C=T=>{if(s&&b(T)){switch(o){case oe.AllSelectedObjectsOfThisType:{const A=new Map;for(const S of e)if(S.type===z.Roof&&!S.locked&&H.getState().selectedElementIdSet.has(S.id)){const R=S;A.set(S.id,R.rValue??r8),g(R.id,T)}const x={name:"Set R-Value for Selected Roofs",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisType:{const A=new Map;for(const S of e)if(S.type===z.Roof&&!S.locked){const R=S;A.set(S.id,R.rValue??r8),g(R.id,T)}const x={name:"Set R-Value for All Roofs",timestamp:Date.now(),oldValues:A,newValue:T,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const A=new Map;for(const S of e)if(S.type===z.Roof&&S.foundationId===s.foundationId&&!S.locked){const R=S;A.set(S.id,R.rValue??r8),g(R.id,T)}const x={name:"Set R-Value for All Roofs Above Foundation",timestamp:Date.now(),oldValues:A,newValue:T,groupId:s.foundationId,undo:()=>{y(x.oldValues)},redo:()=>{w(x.oldValues,x.newValue)}};n(x),i(r+1)}break;default:if(s){const x=a(s.id).rValue??s.rValue??r8,S={name:"Set Roof R-Value",timestamp:Date.now(),oldValue:x,newValue:T,changedElementId:s.id,changedElementType:s.type,undo:()=>{g(S.changedElementId,S.oldValue)},redo:()=>{g(S.changedElementId,S.newValue)}};n(S),g(s.id,T),i(r+1)}}l(A=>{A.actionState.roofRValue=T})}},P=()=>{t(!1)},v=()=>{C(c)};return h.jsx(so,{width:550,title:`${Y.t("roofMenu.RoofRValue",p)+" "}(${Y.t("word.ThermalResistance",p)})`,onApply:v,onClose:P,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(u(T),f(me.toRValueInUS(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0.01, 100]",h.jsx("br",{}),Y.t("word.SIUnit",p),": m²·℃/W"]}),h.jsx("br",{}),h.jsx(Mn,{min:me.toRValueInUS(.01),max:me.toRValueInUS(100),style:{width:120},step:.01,precision:2,value:d,formatter:T=>Number(T).toFixed(2),onChange:T=>{T!==null&&(f(T),u(me.toRValueInSI(T)))}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [",me.toRValueInUS(.01).toFixed(3),", ",me.toRValueInUS(100).toFixed(1),"]",h.jsx("br",{}),Y.t("word.USUnit",p),": h·ft²·℉/Btu"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:T=>H.getState().setRoofActionScope(T.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",p)})]})})})]})})},Bpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(p3),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.volumetricHeatCapacity)??.5),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)if(A.id===P){A.volumetricHeatCapacity=v;break}})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.volumetricHeatCapacity&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.volumetricHeatCapacity&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.volumetricHeatCapacity&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.volumetricHeatCapacity))return!0;break}return!1}},w=P=>{if(s&&y(P)){switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Roof&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)){const S=x;v.set(x.id,S.volumetricHeatCapacity??.5),S.volumetricHeatCapacity=P}});const T={name:"Set Volumetric Heat Capacity for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Roof&&!x.locked){const S=x;v.set(x.id,S.volumetricHeatCapacity??.5),S.volumetricHeatCapacity=P}});const T={name:"Set Volumetric Heat Capacity for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;l(A=>{for(const x of A.elements)if(x.type===z.Roof&&x.foundationId===s.foundationId&&!x.locked){const S=x;v.set(x.id,S.volumetricHeatCapacity??.5),S.volumetricHeatCapacity=P}});const T={name:"Set Volumetric Heat Capacity for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;default:if(s){const T=a(s.id).volumetricHeatCapacity??s.volumetricHeatCapacity??.5,A={name:"Set Volumetric Heat Capacity of Roof",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}}l(v=>{v.actionState.roofVolumetricHeatCapacity=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("word.VolumetricHeatCapacity",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>u(P)}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:["kWh/(m³·℃)",h.jsx("br",{}),h.jsx("br",{}),Y.t("word.Range",d),": [0.01, 100]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},Ypo="/aladdin/assets/roof_edge-DBy_1Q5D.png",Opo="/aladdin/assets/roof_01-BwuyLpwq.png",_po="/aladdin/assets/roof_02-DAbYjnV7.png",Vpo="/aladdin/assets/roof_03-haZGIixv.png",Gpo="/aladdin/assets/roof_04-DDuwUcDr.png",Xpo="/aladdin/assets/roof_05-CtBb5xIW.png",Jpo="/aladdin/assets/roof_06-DuyyebV8.png",Kpo="/aladdin/assets/roof_07-DXWGQN8a.png",qpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(sy),r=H(no),i=H(Zn),a=H(fn),l=H(Gn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.textureType)??Ur.Default),d=Jt(),{Option:f}=_o,p=(v,T)=>{a(A=>{for(const x of A.elements)if(x.id===v){x.locked||(x.textureType=T);break}})},g=(v,T)=>{for(const A of v.keys())p(A,T)},y=v=>{for(const[T,A]of v.entries())p(T,A)},w=v=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const T of e)if(T.type===z.Roof&&v!==T.textureType&&!T.locked&&H.getState().selectedElementIdSet.has(T.id))return!0;break;case oe.AllObjectsOfThisType:for(const T of e)if(T.type===z.Roof&&v!==T.textureType&&!T.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const T of e)if(T.type===z.Roof&&T.foundationId===s.foundationId&&v!==T.textureType&&!T.locked)return!0;break;default:if(v!==(s==null?void 0:s.textureType))return!0;break}return!1}},b=v=>{if(s&&w(v)){switch(o){case oe.AllSelectedObjectsOfThisType:{const T=new Map;for(const x of e)x.type===z.Roof&&!x.locked&&H.getState().selectedElementIdSet.has(x.id)&&T.set(x.id,x.textureType??Ur.Default);const A={name:"Set Texture for Selected Roofs",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{y(A.oldValues)},redo:()=>{g(A.oldValues,A.newValue)}};n(A),g(T,v),i(r+1);break}case oe.AllObjectsOfThisType:{const T=new Map;for(const x of e)x.type===z.Roof&&!x.locked&&T.set(x.id,x.textureType??Ur.Default);const A={name:"Set Texture for All Roofs",timestamp:Date.now(),oldValues:T,newValue:v,undo:()=>{y(A.oldValues)},redo:()=>{g(A.oldValues,A.newValue)}};n(A),g(T,v),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const T=new Map;for(const x of e)x.type===z.Roof&&x.foundationId===s.foundationId&&!x.locked&&T.set(x.id,x.textureType);const A={name:"Set Texture for All Roofs Above Foundation",timestamp:Date.now(),oldValues:T,newValue:v,groupId:s.foundationId,undo:()=>{y(A.oldValues)},redo:()=>{A.groupId&&g(A.oldValues,A.newValue)}};n(A),g(T,v),i(r+1)}break;default:if(s){const T=l(s.id),A=T?T.textureType:s.textureType,x={name:"Set Texture of Selected Roof",timestamp:Date.now(),oldValue:A,newValue:v,changedElementId:s.id,changedElementType:s.type,undo:()=>{p(x.changedElementId,x.oldValue)},redo:()=>{p(x.changedElementId,x.newValue)}};n(x),p(s.id,v),i(r+1)}}a(T=>{T.actionState.roofTexture=v})}},C=()=>{t(!1)},P=()=>{b(c)};return h.jsx(so,{width:550,title:Y.t("word.Texture",d),onApply:P,onClose:C,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:9,children:h.jsxs(_o,{style:{width:"150px"},value:c,onChange:v=>u(v),children:[h.jsxs(f,{value:Ur.NoTexture,children:[h.jsx("div",{style:{display:"inline-block",verticalAlign:"middle",marginRight:"12px",width:"32px",height:"20px",border:"1px dashed dimGray"},children:" "}),Y.t("shared.NoTexture",d)]},Ur.NoTexture),h.jsxs(f,{value:Ur.Default,children:[h.jsx("img",{alt:Ur.Default,src:Ypo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.TextureDefault",d)]},Ur.Default),h.jsxs(f,{value:Ur.Texture01,children:[h.jsx("img",{alt:Ur.Texture01,src:Opo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.Texture01",d)]},Ur.Texture01),h.jsxs(f,{value:Ur.Texture02,children:[h.jsx("img",{alt:Ur.Texture02,src:_po,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.Texture02",d)]},Ur.Texture02),h.jsxs(f,{value:Ur.Texture03,children:[h.jsx("img",{alt:Ur.Texture03,src:Vpo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.Texture03",d)]},Ur.Texture03),h.jsxs(f,{value:Ur.Texture04,children:[h.jsx("img",{alt:Ur.Texture04,src:Gpo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.Texture04",d)]},Ur.Texture04),h.jsxs(f,{value:Ur.Texture05,children:[h.jsx("img",{alt:Ur.Texture05,src:Xpo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.Texture05",d)]},Ur.Texture05),h.jsxs(f,{value:Ur.Texture06,children:[h.jsx("img",{alt:Ur.Texture06,src:Jpo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.Texture06",d)]},Ur.Texture06),h.jsxs(f,{value:Ur.Texture07,children:[h.jsx("img",{alt:Ur.Texture07,src:Kpo,height:20,width:40,style:{paddingRight:"8px"}})," ",Y.t("roofMenu.Texture07",d)]},Ur.Texture07)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:15,children:h.jsx(Ue.Group,{onChange:v=>H.getState().setRoofActionScope(v.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},$po=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(sy),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.color)??"#ffffff"),d=Jt(),f=(P,v)=>{e(T=>{for(const A of T.elements)if(A.id===P){A.locked||(A.color=v);break}})},p=(P,v)=>{for(const T of P.keys())f(T,v)},g=P=>{for(const[v,T]of P.entries())f(v,T)},y=P=>{if(s){switch(r){case oe.AllSelectedObjectsOfThisType:for(const v of n)if(v.type===z.Roof&&P!==v.color&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of n)if(v.type===z.Roof&&P!==v.color&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of n)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.color&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.color))return!0;break}return!1}},w=P=>{if(s&&y(P)){switch(r){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of n)A.type===z.Roof&&!A.locked&&v.set(A.id,A.color??"#ffffff");const T={name:"Set Color for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of n)A.type===z.Roof&&!A.locked&&v.set(A.id,A.color??"#ffffff");const T={name:"Set Color for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of n)A.type===z.Roof&&A.foundationId===s.foundationId&&!s.locked&&v.set(A.id,A.color??"#ffffff");const T={name:"Set Color for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{g(T.oldValues)},redo:()=>{T.groupId&&p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1)}break;default:if(s){const v=l(s.id),T=(v?v.color:s.color)??"#ffffff",A={name:"Set Color of Selected Roof",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};o(A),f(s.id,P),a(i+1)}}e(v=>{v.actionState.roofColor=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:640,title:Y.t("roofMenu.RoofColor",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:c,onChangeComplete:P=>{u(P.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},Qpo=({setDialogVisible:t})=>{const e=H(Kn),n=H(fn),o=H(En),r=H(sy),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.sideColor)??"#ffffff"),d=Jt(),f=(P,v)=>{n(T=>{for(const A of T.elements)if(A.id===P){A.locked||(A.sideColor=v);break}})},p=(P,v)=>{for(const T of P.keys())f(T,v)},g=P=>{for(const[v,T]of P.entries())f(v,T)},y=P=>{if(s){switch(r){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.sideColor&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.sideColor&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.sideColor&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.sideColor))return!0;break}return!1}},w=P=>{if(s&&y(P)){switch(r){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of e)A.type===z.Roof&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&v.set(A.id,A.sideColor??"#ffffff");const T={name:"Set Side Color for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of e)A.type===z.Roof&&!A.locked&&v.set(A.id,A.sideColor??"#ffffff");const T={name:"Set Side Color for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of e)A.type===z.Roof&&A.foundationId===s.foundationId&&!s.locked&&v.set(A.id,A.sideColor??"#ffffff");const T={name:"Set Side Color for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{g(T.oldValues)},redo:()=>{T.groupId&&p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1)}break;default:if(s){const v=l(s.id),T=(v?v.sideColor:s.sideColor)??"#ffffff",A={name:"Set Side Color of Selected Roof",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};o(A),f(s.id,P),a(i+1)}}n(v=>{v.actionState.roofSideColor=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:640,title:Y.t("roofMenu.RoofSideColor",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:c??(s==null?void 0:s.sideColor)??"#ffffff",onChangeComplete:P=>{u(P.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},Zpo=({setDialogVisible:t})=>{const e=H(s0),n=H(s3),o=H(En),r=H(sy),i=H(xOe),a=H(no),l=H(Zn),s=H(Vi),c=H(Gn),u=H(fn),d=H(L=>{if(n){for(const k of L.elements)if(k.id===n.id)return k}return null}),[f,p]=m.useState((d==null?void 0:d.ceilingRValue)??y6),[g,y]=m.useState(me.toRValueInUS(f)),[w,b]=m.useState(!1),[C,P]=m.useState({left:0,top:0,bottom:0,right:0}),v=m.useRef(null),T={lng:e};m.useEffect(()=>{d&&p((d==null?void 0:d.ceilingRValue)??y6)},[d==null?void 0:d.ceilingRValue]);const A=(L,k)=>{u(N=>{for(const F of N.elements)if(F.id===L){F.ceilingRValue=k;break}})},x=L=>{for(const[k,N]of L.entries())A(k,N)},S=(L,k)=>{for(const N of L.keys())A(N,k)},R=L=>{if(d){switch(r){case oe.AllObjectsOfThisType:{const k=new Map;u(F=>{for(const U of F.elements)if(U.type===z.Roof&&!U.locked){const O=U;k.set(U.id,O.ceilingRValue??y6),O.ceilingRValue=L}});const N={name:"Set R-Value for All Ceilings",timestamp:Date.now(),oldValues:k,newValue:L,undo:()=>{x(N.oldValues)},redo:()=>{S(N.oldValues,N.newValue)}};o(N),l(a+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(d.foundationId){const k=new Map;u(F=>{for(const U of F.elements)if(U.type===z.Roof&&U.foundationId===d.foundationId&&!U.locked){const O=U;k.set(U.id,O.ceilingRValue??y6),O.ceilingRValue=L}});const N={name:"Set R-Value for All Ceilings Above Foundation",timestamp:Date.now(),oldValues:k,newValue:L,groupId:d.foundationId,undo:()=>{x(N.oldValues)},redo:()=>{S(N.oldValues,N.newValue)}};o(N),l(a+1)}break}default:{if(d){const N=c(d.id).ceilingRValue??d.ceilingRValue??y6,F={name:"Set Ceiling R-Value",timestamp:Date.now(),oldValue:N,newValue:L,changedElementId:d.id,changedElementType:d.type,undo:()=>{A(F.changedElementId,F.oldValue)},redo:()=>{A(F.changedElementId,F.newValue)}};o(F),A(d.id,L),l(a+1)}break}}u(k=>{k.actionState.roofRValue=L})}},M=(L,k)=>{if(v.current){const{clientWidth:N,clientHeight:F}=window.document.documentElement,U=v.current.getBoundingClientRect();P({left:-U.left+k.x,right:N-(U.right-k.x),top:-U.top+k.y,bottom:F-((U==null?void 0:U.bottom)-k.y)})}},D=()=>{p((d==null?void 0:d.ceilingRValue)??y6),t(!1)},E=()=>{D(),s()},W=()=>{R(f),t(!1),l(0)},j=()=>{R(f)};return h.jsx(h.Fragment,{children:h.jsx(Oi,{width:550,open:!0,title:h.jsxs("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>b(!0),onMouseOut:()=>b(!1),children:[Y.t("roofMenu.CeilingRValue",T)+" ","(",Y.t("word.ThermalResistance",T),")"]}),footer:[h.jsx(lo,{onClick:j,children:Y.t("word.Apply",T)},"Apply"),h.jsx(lo,{onClick:E,children:Y.t("word.Cancel",T)},"Cancel"),h.jsx(lo,{type:"primary",onClick:W,children:Y.t("word.OK",T)},"OK")],onCancel:D,maskClosable:!1,destroyOnClose:!1,modalRender:L=>h.jsx(_i,{disabled:!w,bounds:C,onStart:(k,N)=>M(k,N),children:h.jsx("div",{ref:v,children:L})}),children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:.01,max:100,style:{width:120},step:.05,precision:2,value:f,formatter:L=>Number(L).toFixed(2),onChange:L=>{L!==null&&(p(L),y(me.toRValueInUS(L)))},onPressEnter:W}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",T),": [0.01, 100]",h.jsx("br",{}),Y.t("word.SIUnit",T),": m²·℃/W"]}),h.jsx("br",{}),h.jsx(Mn,{min:me.toRValueInUS(.01),max:me.toRValueInUS(100),style:{width:120},step:.01,precision:2,value:g,formatter:L=>Number(L).toFixed(2),onChange:L=>{L!==null&&(y(L),p(me.toRValueInSI(L)))},onPressEnter:W}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",T),": [",me.toRValueInUS(.01).toFixed(3),", ",me.toRValueInUS(100).toFixed(1),"]",h.jsx("br",{}),Y.t("word.USUnit",T),": h·ft²·℉/Btu"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:L=>i(L.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisCeiling",T)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllCeilingsAboveFoundation",T)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllCeilings",T)})]})})})]})})})},e1o=t=>{const e={lng:H.getState().language},n=[];return n.push({key:"roof-ceiling",label:h.jsx(Epo,{roof:t})}),t.ceiling&&n.push({type:"divider"},{key:"ceiling-r-value",label:h.jsxs(to,{noPadding:!0,Dialog:Zpo,children:[Y.t("roofMenu.CeilingRValue",e)," ..."]})}),n},t1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(En),r=H(sy),i=H(no),a=H(Zn),l=H(Gn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.rafterColor)??"#ffffff"),d=Jt(),f=(P,v)=>{e(T=>{for(const A of T.elements)if(A.id===P){A.locked||(A.rafterColor=v);break}})},p=(P,v)=>{for(const T of P.keys())f(T,v)},g=P=>{for(const[v,T]of P.entries())f(v,T)},y=P=>{if(s){switch(r){case oe.AllSelectedObjectsOfThisType:for(const v of n)if(v.type===z.Roof&&P!==v.rafterColor&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of n)if(v.type===z.Roof&&P!==v.rafterColor&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of n)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.rafterColor&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.rafterColor))return!0;break}return!1}},w=P=>{if(s&&y(P))switch(r){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of n)A.type===z.Roof&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&v.set(A.id,A.rafterColor??"#ffffff");const T={name:"Set Rafter Color for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of n)A.type===z.Roof&&!A.locked&&v.set(A.id,A.rafterColor??"#ffffff");const T={name:"Set Rafter Color for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{g(T.oldValues)},redo:()=>{p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of n)A.type===z.Roof&&A.foundationId===s.foundationId&&!s.locked&&v.set(A.id,A.rafterColor??"#ffffff");const T={name:"Set Rafter Color for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{g(T.oldValues)},redo:()=>{T.groupId&&p(T.oldValues,T.newValue)}};o(T),p(v,P),a(i+1)}break;default:if(s){const v=l(s.id),T=(v?v.rafterColor:s.rafterColor)??"#ffffff",A={name:"Set Rafter Color of Selected Roof",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};o(A),f(s.id,P),a(i+1)}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:640,title:Y.t("roofMenu.RoofColor",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:c,onChangeComplete:P=>{u(P.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},n1o=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(sy),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.rafterSpacing)??1),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)if(A.id===P){A.rafterSpacing=v;break}})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.rafterSpacing&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.rafterSpacing&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.rafterSpacing&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.rafterSpacing))return!0;break}return!1}},w=P=>{if(s&&y(P))switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of e)A.type===z.Roof&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&(v.set(A.id,A.rafterSpacing??1),f(A.id,P));const T={name:"Set Rafter Spacing for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of e)A.type===z.Roof&&!A.locked&&(v.set(A.id,A.rafterSpacing??1),f(A.id,P));const T={name:"Set Rafter Spacing for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of e)A.type===z.Roof&&A.foundationId===s.foundationId&&!A.locked&&(v.set(A.id,A.rafterSpacing??1),f(A.id,P));const T={name:"Set Rafter Spacing for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;default:if(s){const T=a(s.id).rafterSpacing??s.rafterSpacing??1,A={name:"Set Roof Rafter Spacing",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("roofMenu.RafterSpacing",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:100,style:{width:120},step:.1,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>u(P)}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0.1, 100] ",Y.t("word.MeterAbbreviation",d)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",d)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},o1o=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(sy),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.rafterWidth)??.1),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)if(A.id===P){A.rafterWidth=v;break}})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.rafterWidth&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.rafterWidth&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.rafterWidth&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.rafterWidth))return!0;break}return!1}},w=P=>{if(s&&y(P))switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of e)A.type===z.Roof&&!A.locked&&H.getState().selectedElementIdSet.has(A.id)&&(v.set(A.id,A.rafterWidth??.1),f(A.id,P));const T={name:"Set Rafter Width for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of e)A.type===z.Roof&&!A.locked&&(v.set(A.id,A.rafterWidth??.1),f(A.id,P));const T={name:"Set Rafter Width for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of e)A.type===z.Roof&&A.foundationId===s.foundationId&&!A.locked&&(v.set(A.id,A.rafterWidth??.1),f(A.id,P));const T={name:"Set Rafter Width for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;default:if(s){const T=a(s.id).rafterWidth??s.rafterWidth??.1,A={name:"Set Roof Rafter Width",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("roofMenu.RafterWidth",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.01,max:1,style:{width:120},step:.01,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>u(P)}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0.01, 1] ",Y.t("word.MeterAbbreviation",d)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",d)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},r1o=({setDialogVisible:t})=>{const e=H(fn),n=H(s3),o=H(En),r=H(sy),i=H(xOe),a=H(no),l=H(Zn),s=H(Vi),c=H(Gn),[u,d]=m.useState((n==null?void 0:n.glassTint)??"#73D8FF"),[f,p]=m.useState(!1),[g,y]=m.useState({left:0,top:0,bottom:0,right:0}),w=m.useRef(null),b=m.useRef(null);m.useEffect(()=>{var E;(E=b.current)==null||E.focus()});const C=Jt();m.useEffect(()=>{n&&d((n==null?void 0:n.glassTint)??"#73D8FF")},[n]);const P=(E,W)=>{e(j=>{for(const L of j.elements)if(L.id===E){L.locked||(L.glassTint=W);break}})},v=(E,W)=>{for(const j of E.keys())P(j,W)},T=E=>{for(const[W,j]of E.entries())P(W,j)},A=E=>{if(n)switch(r){case oe.AllObjectsOfThisType:{const W=new Map;for(const L of H.getState().elements)L.type===z.Roof&&!L.locked&&W.set(L.id,L.glassTint??"#73D8FF");const j={name:"Set Glass Tint for All Roofs",timestamp:Date.now(),oldValues:W,newValue:E,undo:()=>{T(j.oldValues)},redo:()=>{v(j.oldValues,j.newValue)}};o(j),v(W,E),l(a+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(n.foundationId){const W=new Map;for(const L of H.getState().elements)L.type===z.Roof&&L.foundationId===n.foundationId&&!n.locked&&W.set(L.id,L.glassTint??"#73D8FF");const j={name:"Set Glass Tint for All Roofs Above Foundation",timestamp:Date.now(),oldValues:W,newValue:E,groupId:n.foundationId,undo:()=>{T(j.oldValues)},redo:()=>{j.groupId&&v(j.oldValues,j.newValue)}};o(j),v(W,E),l(a+1)}break}default:{if(n){const W=c(n.id),j=(W?W.glassTint:n.glassTint)??"#73D8FF",L={name:"Set Glass Tint of Selected Roof",timestamp:Date.now(),oldValue:j,newValue:E,changedElementId:n.id,changedElementType:n.type,undo:()=>{P(L.changedElementId,L.oldValue)},redo:()=>{P(L.changedElementId,L.newValue)}};o(L),P(n.id,E),l(a+1)}break}}},x=(E,W)=>{if(w.current){const{clientWidth:j,clientHeight:L}=window.document.documentElement,k=w.current.getBoundingClientRect();y({left:-k.left+W.x,right:j-(k.right-W.x),top:-k.top+W.y,bottom:L-((k==null?void 0:k.bottom)-W.y)})}},S=()=>{n!=null&&n.glassTint&&d(n.glassTint),t(!1)},R=()=>{S(),s()},M=()=>{const E=c(n.id);E&&E.glassTint!==u&&A(u),t(!1),l(0)},D=()=>{A(u)};return h.jsx(h.Fragment,{children:h.jsx(Oi,{width:640,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>p(!0),onMouseOut:()=>p(!1),children:Y.t("roofMenu.GlassTint",C)}),footer:[h.jsx(lo,{onClick:D,children:Y.t("word.Apply",C)},"Apply"),h.jsx(lo,{onClick:R,children:Y.t("word.Cancel",C)},"Cancel"),h.jsx(lo,{type:"primary",ref:b,onClick:M,children:Y.t("word.OK",C)},"OK")],onCancel:S,maskClosable:!1,destroyOnClose:!1,modalRender:E=>h.jsx(_i,{disabled:!f,bounds:g,onStart:(W,j)=>x(W,j),children:h.jsx("div",{ref:w,children:E})}),children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:11,children:h.jsx(zf,{color:u??(n==null?void 0:n.glassTint)??"#73D8FF",onChangeComplete:E=>{d(E.hex)}})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:13,children:h.jsx(Ue.Group,{onChange:E=>i(E.target.value),value:r,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",C)})]})})})]})})})},i1o=t=>{const e={lng:H.getState().language},n=[];return n.push({key:"roof-structure-radio-group",label:h.jsx(kpo,{roof:t}),style:{backgroundColor:"white"}}),t.roofStructure===wc.Rafter&&n.push({type:"divider"},{key:"roof-rafter-spacing",label:h.jsxs(to,{noPadding:!0,Dialog:n1o,children:[Y.t("roofMenu.RafterSpacing",e)," ..."]})},{key:"roof-rafter-width",label:h.jsxs(to,{noPadding:!0,Dialog:o1o,children:[Y.t("roofMenu.RafterWidth",e)," ..."]})},{key:"roof-rafter-color",label:h.jsxs(to,{noPadding:!0,Dialog:t1o,children:[Y.t("roofMenu.RafterColor",e)," ..."]})}),t.roofStructure===wc.Glass&&n.push({type:"divider"},{key:"roof-glass-tint-selection",label:h.jsxs(to,{noPadding:!0,Dialog:r1o,children:[Y.t("roofMenu.GlassTint",e)," ..."]})}),n},a1o=({setDialogVisible:t})=>{const e=H(Kn),n=H(En),o=H(sy),r=H(no),i=H(Zn),a=H(Gn),l=H(fn),s=co(z.Roof),[c,u]=m.useState((s==null?void 0:s.opacity)!==void 0?s.opacity:.5),d=Jt(),f=(P,v)=>{l(T=>{for(const A of T.elements)if(A.id===P){A.opacity=v;break}})},p=P=>{for(const[v,T]of P.entries())f(v,T)},g=(P,v)=>{for(const T of P.keys())f(T,v)},y=P=>{if(s){switch(o){case oe.AllSelectedObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.opacity&&!v.locked&&H.getState().selectedElementIdSet.has(v.id))return!0;break;case oe.AllObjectsOfThisType:for(const v of e)if(v.type===z.Roof&&P!==v.opacity&&!v.locked)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const v of e)if(v.type===z.Roof&&v.foundationId===s.foundationId&&P!==v.opacity&&!v.locked)return!0;break;default:if(P!==(s==null?void 0:s.opacity))return!0;break}return!1}},w=P=>{if(s&&y(P)){switch(o){case oe.AllSelectedObjectsOfThisType:{const v=new Map;for(const A of e)if(A.type===z.Roof&&!A.locked){const x=A;v.set(A.id,x.opacity),f(x.id,P)}const T={name:"Set Opacity for Selected Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisType:{const v=new Map;for(const A of e)if(A.type===z.Roof&&!A.locked){const x=A;v.set(A.id,x.opacity),f(x.id,P)}const T={name:"Set Opacity for All Roofs",timestamp:Date.now(),oldValues:v,newValue:P,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:if(s.foundationId){const v=new Map;for(const A of e)if(A.type===z.Roof&&A.foundationId===s.foundationId&&!A.locked){const x=A;v.set(A.id,x.opacity),f(x.id,P)}const T={name:"Set Opacity for All Roofs Above Foundation",timestamp:Date.now(),oldValues:v,newValue:P,groupId:s.foundationId,undo:()=>{p(T.oldValues)},redo:()=>{g(T.oldValues,T.newValue)}};n(T),i(r+1)}break;default:if(s){const v=a(s.id),T=v.opacity!==void 0?v.opacity:s.opacity!==void 0?s.opacity:.5,A={name:"Set Roof Opacity",timestamp:Date.now(),oldValue:T,newValue:P,changedElementId:s.id,changedElementType:s.type,undo:()=>{f(A.changedElementId,A.oldValue)},redo:()=>{f(A.changedElementId,A.newValue)}};n(A),f(s.id,P),i(r+1)}}l(v=>{v.actionState.roofGlassOpacity=P})}},b=()=>{t(!1)},C=()=>{w(c)};return h.jsx(so,{width:550,title:Y.t("roofMenu.Opacity",d),onApply:C,onClose:b,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx(Mn,{min:0,max:1,style:{width:120},step:.01,precision:2,value:c,formatter:P=>Number(P).toFixed(2),onChange:P=>u(P)}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",d),": [0, 1]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:P=>H.getState().setRoofActionScope(P.target.value),value:o,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("roofMenu.OnlyThisRoof",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("roofMenu.AllRoofsAboveFoundation",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("roofMenu.AllSelectedRoofs",d)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("roofMenu.AllRoofs",d)})]})})})]})})},l1o=()=>{const t=H.getState().elementsToPaste;if(t&&t.length>0)switch(t[0].type){case z.Window:case z.SolarPanel:case z.Sensor:case z.Light:return!0}return!1},s1o=t=>{const e=[];if(t.type!==z.Roof)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language},i=H.getState().countAllOffspringsByTypeAtOnce,a=i(n.id,!0),l=i(n.id,!1),s=n.roofStructure!==wc.Rafter||n.opacity===void 0||n.opacity>0;return l1o()&&e.push({key:"roof-paste",label:h.jsx(eM,{})}),e.push({key:"roof-lock",label:h.jsx(Ju,{selectedElement:n})}),n.rise>0&&e.push({key:"roof-ceiling-submenu",label:h.jsx(rn,{children:Y.t("roofMenu.Ceiling",r)}),children:e1o(n)}),a.gotSome()&&e.push({key:"lock-unlock-clear-on-roof",label:h.jsx(rn,{children:Y.t("word.Elements",r)}),children:Wpo(n,a,l)}),o&&(n.roofType===Go.Gable&&(e.push({key:"roof-structure-submenu",label:h.jsx(rn,{children:Y.t("roofMenu.RoofStructure",r)}),children:i1o(n)}),(n.roofStructure===wc.Rafter||n.roofStructure===wc.Glass)&&e.push({key:"opacity",label:h.jsxs(to,{Dialog:a1o,children:[Y.t("roofMenu.Opacity",r)," ..."]})})),e.push({key:"roof-thickness",label:h.jsxs(to,{Dialog:Npo,children:[Y.t(n.roofStructure===wc.Rafter?"roofMenu.RafterThickness":"word.Thickness",r)," ","..."]})}),e.push({key:"roof-rise",label:h.jsxs(to,{Dialog:Upo,children:[Y.t("roofMenu.Rise",r)," ..."]})}),s&&(e.push({key:"roof-r-value",label:h.jsxs(to,{Dialog:jpo,children:[Y.t("roofMenu.RoofRValue",r)," ..."]})},{key:"roof-heat-capacity",label:h.jsxs(to,{Dialog:Bpo,children:[Y.t("word.VolumetricHeatCapacity",r)," ..."]})},{key:"roof-texture",label:h.jsxs(to,{Dialog:qpo,children:[Y.t("word.Texture",r)," ..."]})}),(n.textureType===Ur.NoTexture||n.textureType===Ur.Default)&&e.push({key:"roof-color",label:h.jsxs(to,{Dialog:$po,children:[Y.t("roofMenu.RoofColor",r)," ..."]})}),e.push({key:"roof-side-color",label:h.jsxs(to,{Dialog:Qpo,children:[Y.t("roofMenu.RoofSideColor",r)," ..."]})}))),{items:e}},c1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.relativeYawAngle)??0),p=Jt(),g=R=>{a(R.target.value)},y=R=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const M of n)if(M.type===z.WindTurbine&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&Math.abs((M.relativeYawAngle??0)-R)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const M of n)if(M.type===z.WindTurbine&&M.foundationId===(u==null?void 0:u.foundationId)&&!M.locked&&Math.abs((M.relativeYawAngle??0)-R)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const M of n)if(M.type===z.WindTurbine&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&Math.abs((M.relativeYawAngle??0)-R)>It)return!0;break;default:if(Math.abs(((u==null?void 0:u.relativeYawAngle)??0)-R)>It)return!0}return!1}},w=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&E.id===R&&!E.locked){const W=E;W.relativeYawAngle=M;break}})},b=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&E.foundationId===R&&!E.locked){const W=E;W.relativeYawAngle=M}})},C=R=>{e(M=>{for(const D of M.elements)if(D.type===z.WindTurbine&&!D.locked){const E=D;E.relativeYawAngle=R}})},P=(R,M)=>{H.getState().set(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&!E.locked&&R.has(E.id)){const W=E;W.relativeYawAngle=M}})},v=R=>{if(u&&y(R)){switch(i){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E.relativeYawAngle);const D={name:"Set Relative Yaw Angle for Selected Wind Turbines",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{P(D.oldValues,D.newValue)}};r(D),P(M,R),s(l+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.WindTurbine&&M.set(E.id,E.relativeYawAngle);const D={name:"Set Relative Yaw Angle for All Wind Turbines",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{C(D.newValue)}};r(D),C(R),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const M=new Map;for(const E of n)E.type===z.WindTurbine&&E.foundationId===u.foundationId&&M.set(E.id,E.relativeYawAngle);const D={name:"Set Relative Yaw Angle for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:M,newValue:R,groupId:u.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{D.groupId&&b(D.groupId,D.newValue)}};r(D),b(u.foundationId,R),s(l+1)}break}default:{const M=o(u.id),D=M?M.relativeYawAngle:u.relativeYawAngle,E={name:"Set Wind Turbine Relative Yaw Angle",timestamp:Date.now(),oldValue:D,newValue:R,changedElementId:u.id,changedElementType:u.type,undo:()=>{w(E.changedElementId,E.oldValue)},redo:()=>{w(E.changedElementId,E.newValue)}};r(E),w(u.id,R),s(l+1);break}}e(M=>{M.actionState.windTurbineRelativeYawAngle=R})}},T=()=>{t(!1)},A=()=>{T(),c()},x=()=>{v(d),t(!1),s(0)},S=()=>{v(d)};return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.RelativeYawAngle",p),onApply:S,onClose:T,onClickCancel:A,onClickOk:x,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:-180,max:180,style:{width:120},precision:2,step:1,value:parseFloat(me.toDegrees(d).toFixed(2)),formatter:R=>`${R}°`,onChange:R=>{R!==null&&f(me.toRadians(R))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [-180°, 180°]",h.jsx("br",{}),Y.t("message.SouthFacingIsZero",p),h.jsx("br",{}),Y.t("message.CounterclockwiseAzimuthIsPositive",p)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:g,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",p)})]})})})]})})},u1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.numberOfBlades)??3),p=Jt(),{Option:g}=_o,y=M=>{a(M.target.value)},w=M=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const D of n)if(D.type===z.WindTurbine&&!D.locked&&H.getState().selectedElementIdSet.has(D.id)&&Math.abs((D.numberOfBlades??0)-M)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const D of n)if(D.type===z.WindTurbine&&D.foundationId===(u==null?void 0:u.foundationId)&&!D.locked&&Math.abs((D.numberOfBlades??0)-M)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const D of n)if(D.type===z.WindTurbine&&!D.locked&&H.getState().selectedElementIdSet.has(D.id)&&Math.abs((D.numberOfBlades??0)-M)>It)return!0;break;default:if(Math.abs(((u==null?void 0:u.numberOfBlades)??0)-M)>It)return!0}return!1}},b=(M,D)=>{e(E=>{for(const W of E.elements)if(W.type===z.WindTurbine&&W.id===M&&!W.locked){const j=W;j.numberOfBlades=D;break}})},C=(M,D)=>{e(E=>{for(const W of E.elements)if(W.type===z.WindTurbine&&W.foundationId===M&&!W.locked){const j=W;j.numberOfBlades=D}})},P=M=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&!E.locked){const W=E;W.numberOfBlades=M}})},v=(M,D)=>{H.getState().set(E=>{for(const W of E.elements)if(W.type===z.WindTurbine&&!W.locked&&M.has(W.id)){const j=W;j.numberOfBlades=D}})},T=M=>{if(u&&w(M)){switch(i){case oe.AllSelectedObjectsOfThisType:{const D=new Map;for(const W of n)W.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(W.id)&&D.set(W.id,W.numberOfBlades??3);const E={name:"Select Blade Number for Selected Wind Turbines",timestamp:Date.now(),oldValues:D,newValue:M,undo:()=>{for(const[W,j]of E.oldValues.entries())b(W,j)},redo:()=>{v(E.oldValues,E.newValue)}};r(E),v(D,M),s(l+1);break}case oe.AllObjectsOfThisType:{const D=new Map;for(const W of n)W.type===z.WindTurbine&&D.set(W.id,W.numberOfBlades??3);const E={name:"Select Blade Number for All Wind Turbines",timestamp:Date.now(),oldValues:D,newValue:M,undo:()=>{for(const[W,j]of E.oldValues.entries())b(W,j)},redo:()=>{P(E.newValue)}};r(E),P(M),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const D=new Map;for(const W of n)W.type===z.WindTurbine&&W.foundationId===u.foundationId&&D.set(W.id,W.numberOfBlades??3);const E={name:"Select Blade Number for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:D,newValue:M,groupId:u.foundationId,undo:()=>{for(const[W,j]of E.oldValues.entries())b(W,j)},redo:()=>{E.groupId&&C(E.groupId,E.newValue)}};r(E),C(u.foundationId,M),s(l+1)}break}default:{const D=o(u.id),E=D?D.numberOfBlades??3:u.numberOfBlades??3,W={name:"Select Wind Turbine Blade Number",timestamp:Date.now(),oldValue:E,newValue:M,changedElementId:u.id,changedElementType:u.type,undo:()=>{b(W.changedElementId,W.oldValue)},redo:()=>{b(W.changedElementId,W.newValue)}};r(W),b(u.id,M),s(l+1);break}}e(D=>{D.actionState.windTurbineNumberOfBlades=M})}},A=()=>{t(!1)},x=()=>{A(),c()},S=()=>{T(d),t(!1),s(0)},R=()=>{T(d)};return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.BladeNumber",p),onApply:R,onClose:A,onClickCancel:x,onClickOk:S,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:4,children:h.jsxs(_o,{style:{width:"60px"},value:d,onChange:M=>{M!==null&&f(M)},children:[h.jsx(g,{value:1,children:"1"},1),h.jsx(g,{value:2,children:"2"},2),h.jsx(g,{value:3,children:"3"},3),h.jsx(g,{value:4,children:"4"},4),h.jsx(g,{value:8,children:"8"},8)]})}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:20,children:h.jsx(Ue.Group,{onChange:y,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",p)})]})})})]})})},d1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.initialRotorAngle)??0),p=Jt(),g=R=>{a(R.target.value)},y=R=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const M of n)if(M.type===z.WindTurbine&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&Math.abs((M.initialRotorAngle??0)-R)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const M of n)if(M.type===z.WindTurbine&&M.foundationId===(u==null?void 0:u.foundationId)&&!M.locked&&Math.abs((M.initialRotorAngle??0)-R)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const M of n)if(M.type===z.WindTurbine&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&Math.abs((M.initialRotorAngle??0)-R)>It)return!0;break;default:if(Math.abs(((u==null?void 0:u.initialRotorAngle)??0)-R)>It)return!0}return!1}},w=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&E.id===R&&!E.locked){const W=E;W.initialRotorAngle=M;break}})},b=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&E.foundationId===R&&!E.locked){const W=E;W.initialRotorAngle=M}})},C=R=>{e(M=>{for(const D of M.elements)if(D.type===z.WindTurbine&&!D.locked){const E=D;E.initialRotorAngle=R}})},P=(R,M)=>{H.getState().set(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&!E.locked&&R.has(E.id)){const W=E;W.initialRotorAngle=M}})},v=R=>{if(u&&y(R)){switch(i){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E.initialRotorAngle);const D={name:"Set Rotor Initial Angle for Selected Wind Turbines",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{P(D.oldValues,D.newValue)}};r(D),P(M,R),s(l+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.WindTurbine&&M.set(E.id,E.initialRotorAngle);const D={name:"Set Rotor Initial Angle for All Wind Turbines",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{C(D.newValue)}};r(D),C(R),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const M=new Map;for(const E of n)E.type===z.WindTurbine&&E.foundationId===u.foundationId&&M.set(E.id,E.initialRotorAngle);const D={name:"Set Rotor Initial Angle for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:M,newValue:R,groupId:u.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{D.groupId&&b(D.groupId,D.newValue)}};r(D),b(u.foundationId,R),s(l+1)}break}default:{const M=o(u.id),D=M?M.initialRotorAngle:u.initialRotorAngle,E={name:"Set Wind Turbine Rotor Initial Angle",timestamp:Date.now(),oldValue:D,newValue:R,changedElementId:u.id,changedElementType:u.type,undo:()=>{w(E.changedElementId,E.oldValue)},redo:()=>{w(E.changedElementId,E.newValue)}};r(E),w(u.id,R),s(l+1);break}}e(M=>{M.actionState.windTurbineInitialRotorAngle=R})}},T=()=>{t(!1)},A=()=>{T(),c()},x=()=>{v(d),t(!1),s(0)},S=()=>{v(d)};return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.RotorInitialAngle",p),onApply:S,onClose:T,onClickCancel:A,onClickOk:x,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:0,max:360,style:{width:120},precision:1,step:1,value:parseFloat(me.toDegrees(d).toFixed(2)),formatter:R=>`${R}°`,onChange:R=>{R!==null&&f(me.toRadians(R))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0°, 360°]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:g,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",p)})]})})})]})})},f1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=me.toRadians(10),d=co(z.WindTurbine),[f,p]=m.useState((d==null?void 0:d.pitchAngle)??u),g=Jt(),y=M=>{a(M.target.value)},w=M=>{if(d){switch(i){case oe.AllObjectsOfThisType:for(const D of n)if(D.type===z.WindTurbine&&!D.locked&&H.getState().selectedElementIdSet.has(D.id)&&Math.abs((D.pitchAngle??u)-M)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const D of n)if(D.type===z.WindTurbine&&D.foundationId===(d==null?void 0:d.foundationId)&&!D.locked&&Math.abs((D.pitchAngle??u)-M)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const D of n)if(D.type===z.WindTurbine&&!D.locked&&H.getState().selectedElementIdSet.has(D.id)&&Math.abs((D.pitchAngle??u)-M)>It)return!0;break;default:if(Math.abs(((d==null?void 0:d.pitchAngle)??u)-M)>It)return!0}return!1}},b=(M,D)=>{e(E=>{for(const W of E.elements)if(W.type===z.WindTurbine&&W.id===M&&!W.locked){const j=W;j.pitchAngle=D;break}})},C=(M,D)=>{e(E=>{for(const W of E.elements)if(W.type===z.WindTurbine&&W.foundationId===M&&!W.locked){const j=W;j.pitchAngle=D}})},P=M=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&!E.locked){const W=E;W.pitchAngle=M}})},v=(M,D)=>{H.getState().set(E=>{for(const W of E.elements)if(W.type===z.WindTurbine&&!W.locked&&M.has(W.id)){const j=W;j.pitchAngle=D}})},T=M=>{if(d&&w(M)){switch(i){case oe.AllSelectedObjectsOfThisType:{const D=new Map;for(const W of n)W.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(W.id)&&D.set(W.id,W.pitchAngle);const E={name:"Set Pitch Angle for Selected Wind Turbines",timestamp:Date.now(),oldValues:D,newValue:M,undo:()=>{for(const[W,j]of E.oldValues.entries())b(W,j)},redo:()=>{v(E.oldValues,E.newValue)}};r(E),v(D,M),s(l+1);break}case oe.AllObjectsOfThisType:{const D=new Map;for(const W of n)W.type===z.WindTurbine&&D.set(W.id,W.pitchAngle);const E={name:"Set Pitch Angle for All Wind Turbines",timestamp:Date.now(),oldValues:D,newValue:M,undo:()=>{for(const[W,j]of E.oldValues.entries())b(W,j)},redo:()=>{P(E.newValue)}};r(E),P(M),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(d.foundationId){const D=new Map;for(const W of n)W.type===z.WindTurbine&&W.foundationId===d.foundationId&&D.set(W.id,W.pitchAngle);const E={name:"Set Pitch Angle for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:D,newValue:M,groupId:d.foundationId,undo:()=>{for(const[W,j]of E.oldValues.entries())b(W,j)},redo:()=>{E.groupId&&C(E.groupId,E.newValue)}};r(E),C(d.foundationId,M),s(l+1)}break}default:{const D=o(d.id),E=D?D.pitchAngle:d.pitchAngle,W={name:"Set Wind Turbine Pitch Angle",timestamp:Date.now(),oldValue:E,newValue:M,changedElementId:d.id,changedElementType:d.type,undo:()=>{b(W.changedElementId,W.oldValue)},redo:()=>{b(W.changedElementId,W.newValue)}};r(W),b(d.id,M),s(l+1);break}}e(D=>{D.actionState.windTurbinePitchAngle=M})}},A=()=>{t(!1)},x=()=>{A(),c()},S=()=>{T(f),t(!1),s(0)},R=()=>{T(f)};return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.RotorBladePitchAngle",g),onApply:R,onClose:A,onClickCancel:x,onClickOk:S,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:-180,max:180,style:{width:120},precision:2,step:1,value:parseFloat(me.toDegrees(f).toFixed(2)),formatter:M=>`${M}°`,onChange:M=>{M!==null&&p(me.toRadians(M))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",g),": [-180°, 180°]"]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:y,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",g)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",g)})]})})})]})})},h1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.bladeRadius)??0),p=m.useRef(!1),g=m.useRef(),y=Jt(),w=E=>{a(E.target.value)},b=E=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const W of n)if(W.type===z.WindTurbine&&!W.locked&&H.getState().selectedElementIdSet.has(W.id)&&Math.abs(W.bladeRadius-E)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const W of n)if(W.type===z.WindTurbine&&W.foundationId===(u==null?void 0:u.foundationId)&&!W.locked&&Math.abs(W.bladeRadius-E)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const W of n)if(W.type===z.WindTurbine&&!W.locked&&H.getState().selectedElementIdSet.has(W.id)&&Math.abs(W.bladeRadius-E)>It)return!0;break;default:if(Math.abs((u==null?void 0:u.bladeRadius)-E)>It)return!0}return!1}},C=(E,W)=>{e(j=>{for(const L of j.elements)if(L.type===z.WindTurbine&&L.id===E&&!L.locked){const k=L;k.bladeRadius=W,k.lx=k.ly=W*2,k.lz=k.towerHeight+W;break}})},P=(E,W)=>{e(j=>{for(const L of j.elements)if(L.type===z.WindTurbine&&L.foundationId===E&&!L.locked){const k=L;k.bladeRadius=W,k.lx=k.ly=W*2,k.lz=k.towerHeight+W}})},v=E=>{e(W=>{for(const j of W.elements)if(j.type===z.WindTurbine&&!j.locked){const L=j;L.bladeRadius=E,L.lx=L.ly=E*2,L.lz=L.towerHeight+E}})},T=(E,W)=>{H.getState().set(j=>{for(const L of j.elements)if(L.type===z.WindTurbine&&!L.locked&&E.has(L.id)){const k=L;k.bladeRadius=W,k.lx=k.ly=W*2,k.lz=k.towerHeight+W}})},A=E=>{if(u&&b(E)){switch(g.current=void 0,i){case oe.AllSelectedObjectsOfThisType:{p.current=!1;for(const W of n)if(W.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(W.id)&&W.towerHeight{for(const[L,k]of j.oldValues.entries())C(L,k)},redo:()=>{T(j.oldValues,j.newValue)}};r(j),T(W,E),s(l+1)}break}case oe.AllObjectsOfThisType:{p.current=!1;for(const W of n)if(W.type===z.WindTurbine&&W.towerHeight{for(const[L,k]of j.oldValues.entries())C(L,k)},redo:()=>{v(j.newValue)}};r(j),v(E),s(l+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){p.current=!1;for(const W of n)if(W.type===z.WindTurbine&&W.foundationId===u.foundationId&&W.towerHeight{for(const[L,k]of j.oldValues.entries())C(L,k)},redo:()=>{j.groupId&&P(j.groupId,j.newValue)}};r(j),P(u.foundationId,E),s(l+1)}}break}default:{const W=o(u.id),j=W?W.bladeRadius:u.bladeRadius;if(p.current=u.towerHeight{C(L.changedElementId,L.oldValue)},redo:()=>{C(L.changedElementId,L.newValue)}};r(L),C(u.id,E),s(l+1)}break}}e(W=>{W.actionState.windTurbineBladeRadius=E})}},x=()=>{p.current=!1,t(!1)},S=()=>{x(),c()},R=()=>{A(d),p.current||(t(!1),s(0))},M=()=>{A(d)},D=p.current?": "+Y.t("message.NotApplicableToSelectedAction",y)+(g.current!==void 0?" ("+g.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.RotorBladeRadius",y),rejectedMessage:D,onApply:M,onClose:x,onClickCancel:S,onClickOk:R,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:100,style:{width:120},step:.1,precision:1,value:d,onChange:E=>{E!==null&&f(E)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [1, 100] ",Y.t("word.MeterAbbreviation",y)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",y)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",y)})]})})})]})})},p1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.bladeRootRadius)??.3),[p,g]=m.useState((u==null?void 0:u.maximumChordLength)??1),[y,w]=m.useState((u==null?void 0:u.maximumChordRadius)??3),b=m.useRef(null),C=Jt(),P=555;m.useEffect(()=>{if(!b.current||!u)return;const q=b.current.getContext("2d");if(!q)return;const te=b.current.width,re=b.current.height,ae=20,se=re*.7;q.clearRect(0,0,te,re),q.setLineDash([]),q.strokeStyle="gray",q.lineWidth=1,q.rect(0,0,te,re),q.stroke();const ne=(te-ae*2)/u.bladeRadius,fe=ne*u.bladeTipWidth,ge=ne*y,de=ne*p,Z=ne*u.bladeRadius,he=ne*d,xe=de-he,He=Z-ge/3,Se=[];Se.push(new Xt(ae,se-he)),Se.push(new Xt(ae+Z-He,se-xe/2)),Se.push(new Xt(ae+ge,se-xe)),Se.push(new Xt(ae+Z,se+he-fe));const Ie=new wq(Se).getPoints(50);q.beginPath(),q.moveTo(Ie[0].x,Ie[0].y);for(let ye=1;ye{a(q.target.value)},T=q=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const te of n)if(te.type===z.WindTurbine&&!te.locked&&H.getState().selectedElementIdSet.has(te.id)&&Math.abs(te.bladeRootRadius-q)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const te of n)if(te.type===z.WindTurbine&&te.foundationId===(u==null?void 0:u.foundationId)&&!te.locked&&Math.abs(te.bladeRootRadius-q)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const te of n)if(te.type===z.WindTurbine&&!te.locked&&H.getState().selectedElementIdSet.has(te.id)&&Math.abs(te.bladeRootRadius-q)>It)return!0;break;default:if(Math.abs(((u==null?void 0:u.bladeRootRadius)??.3)-q)>It)return!0}return!1}},A=(q,te)=>{e(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&ae.id===q&&!ae.locked){const se=ae;se.bladeRootRadius=te;break}})},x=(q,te)=>{e(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&ae.foundationId===q&&!ae.locked){const se=ae;se.bladeRootRadius=te}})},S=q=>{e(te=>{for(const re of te.elements)if(re.type===z.WindTurbine&&!re.locked){const ae=re;ae.bladeRootRadius=q}})},R=(q,te)=>{H.getState().set(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&!ae.locked&&q.has(ae.id)){const se=ae;se.bladeRootRadius=te}})},M=q=>{if(u&&T(q)){switch(i){case oe.AllSelectedObjectsOfThisType:{const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(ae.id)&&te.set(ae.id,ae.bladeRootRadius);const re={name:"Set Root Radius for Selected Wind Turbines",timestamp:Date.now(),oldValues:te,newValue:q,undo:()=>{for(const[ae,se]of re.oldValues.entries())A(ae,se)},redo:()=>{R(re.oldValues,re.newValue)}};r(re),R(te,q),s(l+1);break}case oe.AllObjectsOfThisType:{const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&te.set(ae.id,ae.bladeRootRadius);const re={name:"Set Root Radius for All Wind Turbines",timestamp:Date.now(),oldValues:te,newValue:q,undo:()=>{for(const[ae,se]of re.oldValues.entries())A(ae,se)},redo:()=>{S(re.newValue)}};r(re),S(q),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&ae.foundationId===u.foundationId&&te.set(ae.id,ae.bladeRootRadius);const re={name:"Set Root Radius for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:te,newValue:q,groupId:u.foundationId,undo:()=>{for(const[ae,se]of re.oldValues.entries())A(ae,se)},redo:()=>{re.groupId&&x(re.groupId,re.newValue)}};r(re),x(u.foundationId,q),s(l+1)}break}default:{const te=o(u.id),re=te?te.bladeRootRadius:u.bladeRootRadius,ae={name:"Set Wind Turbine Root Radius",timestamp:Date.now(),oldValue:re,newValue:q,changedElementId:u.id,changedElementType:u.type,undo:()=>{A(ae.changedElementId,ae.oldValue)},redo:()=>{A(ae.changedElementId,ae.newValue)}};r(ae),A(u.id,q),s(l+1);break}}e(te=>{te.actionState.windTurbineBladeRootRadius=q})}},D=q=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const te of n)if(te.type===z.WindTurbine&&!te.locked&&H.getState().selectedElementIdSet.has(te.id)&&Math.abs(te.maximumChordLength-q)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const te of n)if(te.type===z.WindTurbine&&te.foundationId===(u==null?void 0:u.foundationId)&&!te.locked&&Math.abs(te.maximumChordLength-q)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const te of n)if(te.type===z.WindTurbine&&!te.locked&&H.getState().selectedElementIdSet.has(te.id)&&Math.abs(te.maximumChordLength-q)>It)return!0;break;default:if(Math.abs((u==null?void 0:u.maximumChordLength)-q)>It)return!0}return!1}},E=(q,te)=>{e(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&ae.id===q&&!ae.locked){const se=ae;se.maximumChordLength=te;break}})},W=(q,te)=>{e(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&ae.foundationId===q&&!ae.locked){const se=ae;se.maximumChordLength=te}})},j=q=>{e(te=>{for(const re of te.elements)if(re.type===z.WindTurbine&&!re.locked){const ae=re;ae.maximumChordLength=q}})},L=(q,te)=>{H.getState().set(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&!ae.locked&&q.has(ae.id)){const se=ae;se.maximumChordLength=te}})},k=q=>{if(u&&D(q)){switch(i){case oe.AllSelectedObjectsOfThisType:{const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(ae.id)&&te.set(ae.id,ae.maximumChordLength);const re={name:"Set Chord Length for Selected Wind Turbines",timestamp:Date.now(),oldValues:te,newValue:q,undo:()=>{for(const[ae,se]of re.oldValues.entries())E(ae,se)},redo:()=>{L(re.oldValues,re.newValue)}};r(re),L(te,q),s(l+1);break}case oe.AllObjectsOfThisType:{const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&te.set(ae.id,ae.maximumChordLength);const re={name:"Set Chord Length for All Wind Turbines",timestamp:Date.now(),oldValues:te,newValue:q,undo:()=>{for(const[ae,se]of re.oldValues.entries())E(ae,se)},redo:()=>{j(re.newValue)}};r(re),j(q),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&ae.foundationId===u.foundationId&&te.set(ae.id,ae.maximumChordLength);const re={name:"Set Chord Length for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:te,newValue:q,groupId:u.foundationId,undo:()=>{for(const[ae,se]of re.oldValues.entries())E(ae,se)},redo:()=>{re.groupId&&W(re.groupId,re.newValue)}};r(re),W(u.foundationId,q),s(l+1)}break}default:{const te=o(u.id),re=te?te.maximumChordLength:u.maximumChordLength,ae={name:"Set Wind Turbine Chord Length",timestamp:Date.now(),oldValue:re,newValue:q,changedElementId:u.id,changedElementType:u.type,undo:()=>{E(ae.changedElementId,ae.oldValue)},redo:()=>{E(ae.changedElementId,ae.newValue)}};r(ae),E(u.id,q),s(l+1);break}}e(te=>{te.actionState.windTurbineBladeMaximumChordLength=q})}},N=q=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const te of n)if(te.type===z.WindTurbine&&!te.locked&&H.getState().selectedElementIdSet.has(te.id)&&Math.abs(te.maximumChordRadius-q)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const te of n)if(te.type===z.WindTurbine&&te.foundationId===(u==null?void 0:u.foundationId)&&!te.locked&&Math.abs(te.maximumChordRadius-q)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const te of n)if(te.type===z.WindTurbine&&!te.locked&&H.getState().selectedElementIdSet.has(te.id)&&Math.abs(te.maximumChordRadius-q)>It)return!0;break;default:if(Math.abs((u==null?void 0:u.maximumChordRadius)-q)>It)return!0}return!1}},F=(q,te)=>{e(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&ae.id===q&&!ae.locked){const se=ae;se.maximumChordRadius=te;break}})},U=(q,te)=>{e(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&ae.foundationId===q&&!ae.locked){const se=ae;se.maximumChordRadius=te}})},O=q=>{e(te=>{for(const re of te.elements)if(re.type===z.WindTurbine&&!re.locked){const ae=re;ae.maximumChordRadius=q}})},B=(q,te)=>{H.getState().set(re=>{for(const ae of re.elements)if(ae.type===z.WindTurbine&&!ae.locked&&q.has(ae.id)){const se=ae;se.maximumChordRadius=te}})},_=q=>{if(u&&N(q)){switch(i){case oe.AllSelectedObjectsOfThisType:{const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(ae.id)&&te.set(ae.id,ae.maximumChordRadius);const re={name:"Set Chord Radius for Selected Wind Turbines",timestamp:Date.now(),oldValues:te,newValue:q,undo:()=>{for(const[ae,se]of re.oldValues.entries())F(ae,se)},redo:()=>{B(re.oldValues,re.newValue)}};r(re),B(te,q),s(l+1);break}case oe.AllObjectsOfThisType:{const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&te.set(ae.id,ae.maximumChordRadius);const re={name:"Set Chord Radius for All Wind Turbines",timestamp:Date.now(),oldValues:te,newValue:q,undo:()=>{for(const[ae,se]of re.oldValues.entries())F(ae,se)},redo:()=>{O(re.newValue)}};r(re),O(q),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const te=new Map;for(const ae of n)ae.type===z.WindTurbine&&ae.foundationId===u.foundationId&&te.set(ae.id,ae.maximumChordRadius);const re={name:"Set Chord Radius for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:te,newValue:q,groupId:u.foundationId,undo:()=>{for(const[ae,se]of re.oldValues.entries())F(ae,se)},redo:()=>{re.groupId&&U(re.groupId,re.newValue)}};r(re),U(u.foundationId,q),s(l+1)}break}default:{const te=o(u.id),re=te?te.maximumChordRadius:u.maximumChordRadius,ae={name:"Set Wind Turbine Chord Radius",timestamp:Date.now(),oldValue:re,newValue:q,changedElementId:u.id,changedElementType:u.type,undo:()=>{F(ae.changedElementId,ae.oldValue)},redo:()=>{F(ae.changedElementId,ae.newValue)}};r(ae),F(u.id,q),s(l+1);break}}e(te=>{te.actionState.windTurbineBladeMaximumChordRadius=q})}},X=()=>{t(!1)},$=()=>{X(),c()},Q=()=>{k(p),_(y),M(d),t(!1),s(0)},le=()=>{k(p),_(y),M(d)};return h.jsxs(so,{width:600,title:Y.t("windTurbineMenu.RotorBladeDesign",C),onApply:le,onClose:X,onClickCancel:$,onClickOk:Q,children:[h.jsx(on,{children:h.jsx(nt,{span:24,children:h.jsx("canvas",{ref:b,id:"blade-design-canvas",width:P,height:P*.25,style:{paddingBottom:"12px"}})})}),h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"8px"},children:[h.jsx(nt,{style:{textAlign:"center",fontStyle:"italic"},children:"A: "}),h.jsx(nt,{children:h.jsx(Mn,{min:.1,max:1,style:{width:"70px"},step:.01,precision:2,value:d,onChange:q=>{q&&f(q)}})}),h.jsxs(nt,{style:{paddingTop:"5px",textAlign:"left",fontSize:"11px"},children:["[0.1, 1] ",Y.t("word.MeterAbbreviation",C)]})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"8px"},children:[h.jsx(nt,{style:{textAlign:"center",fontStyle:"italic"},children:"C: "}),h.jsx(nt,{children:h.jsx(Mn,{min:.5,max:2,style:{width:"70px"},step:.01,precision:2,value:p,onChange:q=>{q&&g(q)}})}),h.jsxs(nt,{style:{paddingTop:"5px",textAlign:"left",fontSize:"11px"},children:["[0.5, 2] ",Y.t("word.MeterAbbreviation",C)]})]}),h.jsxs(on,{gutter:6,children:[h.jsx(nt,{style:{textAlign:"center",fontStyle:"italic"},children:"D:"}),h.jsx(nt,{children:h.jsx(Mn,{min:2,max:((u==null?void 0:u.bladeRadius)??10)/2,style:{width:70},step:.01,precision:2,value:y,onChange:q=>{q&&w(q)}})}),h.jsxs(nt,{style:{paddingTop:"5px",textAlign:"left",fontSize:"11px"},children:["[2, ",((u==null?void 0:u.bladeRadius)??10)/2,"] ",Y.t("word.MeterAbbreviation",C)]})]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:v,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",C)})]})})})]})]})},g1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.hubRadius)??0),[p,g]=m.useState((u==null?void 0:u.hubLength)??0),y=Jt(),w=D=>{a(D.target.value)},b=(D,E)=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const W of n)if(W.type===z.WindTurbine&&!W.locked&&H.getState().selectedElementIdSet.has(W.id)){const j=W;if(Math.abs(j.hubRadius-D)>It||Math.abs(j.hubLength-E)>It)return!0}break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const W of n)if(W.type===z.WindTurbine&&W.foundationId===(u==null?void 0:u.foundationId)&&!W.locked){const j=W;if(Math.abs(j.hubRadius-D)>It||Math.abs(j.hubLength-E)>It)return!0}break;case oe.AllSelectedObjectsOfThisType:for(const W of n)if(W.type===z.WindTurbine&&!W.locked&&H.getState().selectedElementIdSet.has(W.id)){const j=W;if(Math.abs(j.hubRadius-D)>It||Math.abs(j.hubLength-E)>It)return!0}break;default:if(Math.abs((u==null?void 0:u.hubRadius)-D)>It||Math.abs((u==null?void 0:u.hubLength)-E)>It)return!0}return!1}},C=(D,E)=>{e(W=>{for(const j of W.elements)if(j.type===z.WindTurbine&&j.id===D&&!j.locked){const L=j;L.hubRadius=E[0],L.hubLength=E[1];break}})},P=(D,E)=>{e(W=>{for(const j of W.elements)if(j.type===z.WindTurbine&&j.foundationId===D&&!j.locked){const L=j;L.hubRadius=E[0],L.hubLength=E[1]}})},v=D=>{e(E=>{for(const W of E.elements)if(W.type===z.WindTurbine&&!W.locked){const j=W;j.hubRadius=D[0],j.hubLength=D[1]}})},T=(D,E)=>{H.getState().set(W=>{for(const j of W.elements)if(j.type===z.WindTurbine&&!j.locked&&D.has(j.id)){const L=j;L.hubRadius=E[0],L.hubLength=E[1]}})},A=D=>{if(u&&b(D[0],D[1])){switch(i){case oe.AllSelectedObjectsOfThisType:{const E=new Map;for(const j of n)if(j.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(j.id)){const L=j;E.set(j.id,[L.hubRadius,L.hubLength])}const W={name:"Set Hub Parameters for Selected Wind Turbines",timestamp:Date.now(),oldValues:E,newValue:D,undo:()=>{for(const[j,L]of W.oldValues.entries())C(j,L)},redo:()=>{T(W.oldValues,W.newValue)}};r(W),T(E,D),s(l+1);break}case oe.AllObjectsOfThisType:{const E=new Map;for(const j of n)if(j.type===z.WindTurbine){const L=j;E.set(j.id,[L.hubRadius,L.hubLength])}const W={name:"Set Hub Parameters for All Wind Turbines",timestamp:Date.now(),oldValues:E,newValue:D,undo:()=>{for(const[j,L]of W.oldValues.entries())C(j,L)},redo:()=>{v(W.newValue)}};r(W),v(D),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const E=new Map;for(const j of n)if(j.type===z.WindTurbine&&j.foundationId===u.foundationId){const L=j;E.set(j.id,[L.hubRadius,L.hubLength])}const W={name:"Set Hub Parameters for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:E,newValue:D,groupId:u.foundationId,undo:()=>{for(const[j,L]of W.oldValues.entries())C(j,L)},redo:()=>{W.groupId&&P(W.groupId,W.newValue)}};r(W),P(u.foundationId,D),s(l+1)}break}default:{const E=o(u.id),W=E?E.hubRadius:u.hubRadius,j=E?E.hubLength:u.hubLength,L={name:"Set Wind Turbine Hub Parameters",timestamp:Date.now(),oldValue:[W,j],newValue:D,changedElementId:u.id,changedElementType:u.type,undo:()=>{C(L.changedElementId,L.oldValue)},redo:()=>{C(L.changedElementId,L.newValue)}};r(L),C(u.id,D),s(l+1);break}}e(E=>{E.actionState.windTurbineHubRadius=D[0],E.actionState.windTurbineHubLength=D[1]})}},x=()=>{t(!1)},S=()=>{x(),c()},R=()=>{A([d,p]),t(!1),s(0)},M=()=>{A([d,p])};return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.HubDesign",y),onApply:M,onClose:x,onClickCancel:S,onClickOk:R,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:7,children:[h.jsx("div",{style:{marginTop:"-20px",textAlign:"left",fontSize:"12px"},children:Y.t("windTurbineMenu.HubRadius",y)}),h.jsx(Mn,{min:.5,max:5,style:{width:120},step:.01,precision:2,value:d,onChange:D=>{D!==null&&f(D)}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [0.5, 5] ",Y.t("word.MeterAbbreviation",y)]}),h.jsx("div",{style:{paddingTop:"10px",textAlign:"left",fontSize:"12px"},children:Y.t("windTurbineMenu.HubLength",y)}),h.jsx(Mn,{min:1,max:10,style:{width:120},step:.01,precision:2,value:p,onChange:D=>{D!==null&&g(D)}}),h.jsxs("div",{style:{paddingTop:"4px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [1, 10] ",Y.t("word.MeterAbbreviation",y)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",y)})]})})})]})})},m1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.birdSafe)??uc.None),[p,g]=m.useState((u==null?void 0:u.bladeColor)??t9),[y,w]=m.useState((u==null?void 0:u.stripeColor)??n9),b=Jt(),{Option:C}=_o,P=j=>{a(j.target.value)},v=(j,L,k)=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const N of n)if(N.type===z.WindTurbine&&!N.locked&&H.getState().selectedElementIdSet.has(N.id)){const F=N;if((F.birdSafe??uc.None)!==j||(F.bladeColor??t9)!==L||(F.stripeColor??n9)!==k)return!0}break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const N of n)if(N.type===z.WindTurbine&&N.foundationId===(u==null?void 0:u.foundationId)&&!N.locked){const F=N;if((F.birdSafe??uc.None)!==j||(F.bladeColor??t9)!==L||(F.stripeColor??n9)!==k)return!0}break;case oe.AllSelectedObjectsOfThisType:for(const N of n)if(N.type===z.WindTurbine&&!N.locked&&H.getState().selectedElementIdSet.has(N.id)){const F=N;if((F.birdSafe??uc.None)!==j||(F.bladeColor??t9)!==L||(F.stripeColor??n9)!==k)return!0}break;default:if((u.birdSafe??uc.None)!==j||(u.bladeColor??t9)!==L||(u.stripeColor??n9)!==k)return!0}return!1}},T=(j,L,k,N)=>{e(F=>{for(const U of F.elements)if(U.type===z.WindTurbine&&U.id===j&&!U.locked){const O=U;O.birdSafe=L,O.bladeColor=k,O.stripeColor=N;break}})},A=(j,L,k,N)=>{e(F=>{for(const U of F.elements)if(U.type===z.WindTurbine&&U.foundationId===j&&!U.locked){const O=U;O.birdSafe=L,O.bladeColor=k,O.stripeColor=N}})},x=(j,L,k)=>{e(N=>{for(const F of N.elements)if(F.type===z.WindTurbine&&!F.locked){const U=F;U.birdSafe=j,U.bladeColor=L,U.stripeColor=k}})},S=(j,L,k,N)=>{H.getState().set(F=>{for(const U of F.elements)if(U.type===z.WindTurbine&&!U.locked&&j.has(U.id)){const O=U;O.birdSafe=L,O.bladeColor=k,O.stripeColor=N}})},R=(j,L,k)=>{if(u&&v(j,L,k)){switch(i){case oe.AllSelectedObjectsOfThisType:{const N=new Map;for(const U of n)if(U.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(U.id)){const O=U;N.set(U.id,[(O.birdSafe??uc.None).toString(),O.bladeColor,O.stripeColor])}const F={name:"Select Bird-Safe Design for Selected Wind Turbines",timestamp:Date.now(),oldValues:N,newValue:[j.toString(),L,k],undo:()=>{for(const[U,O]of F.oldValues.entries()){const B=O;T(U,Number(B[0]),B[1],B[2])}},redo:()=>{const U=F.newValue;S(F.oldValues,Number(U[0]),U[1],U[2])}};r(F),S(N,j,L,k),s(l+1);break}case oe.AllObjectsOfThisType:{const N=new Map;for(const U of n)if(U.type===z.WindTurbine){const O=U;N.set(U.id,[(O.birdSafe??uc.None).toString(),O.bladeColor,O.stripeColor])}const F={name:"Select Bird-Safe Design for All Wind Turbines",timestamp:Date.now(),oldValues:N,newValue:[j.toString(),L,k],undo:()=>{for(const[U,O]of F.oldValues.entries()){const B=O;T(U,Number(B[0]),B[1],B[2])}},redo:()=>{const U=F.newValue;x(Number(U[0]),U[1],U[2])}};r(F),x(j,L,k),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const N=new Map;for(const U of n)if(U.type===z.WindTurbine&&U.foundationId===u.foundationId){const O=U;N.set(U.id,[(O.birdSafe??uc.None).toString(),O.bladeColor,O.stripeColor])}const F={name:"Select Bird-Safe Design for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:N,newValue:[j.toString(),L,k],groupId:u.foundationId,undo:()=>{for(const[U,O]of F.oldValues.entries()){const B=O;T(U,Number(B[0]),B[1],B[2])}},redo:()=>{if(F.groupId){const U=F.newValue;A(F.groupId,Number(U[0]),U[1],U[2])}}};r(F),A(u.foundationId,j,L,k),s(l+1)}break}default:{const N=o(u.id),F=N?N.birdSafe??uc.None:u.birdSafe??uc.None,U=N?N.bladeColor??t9:u.bladeColor??t9,O=N?N.stripeColor??n9:u.stripeColor??n9,B=[F.toString(),U,O],_={name:"Select Bird-Safe Design for Wind Turbine",timestamp:Date.now(),oldValue:B,newValue:[j.toString(),L,k],changedElementId:u.id,changedElementType:u.type,undo:()=>{const X=_.oldValue;T(_.changedElementId,Number(X[0]),X[1],X[2])},redo:()=>{T(_.changedElementId,j,L,k)}};r(_),T(u.id,j,L,k),s(l+1);break}}e(N=>{N.actionState.windTurbineBirdSafeDesign=j,N.actionState.windTurbineBladeColor=L,N.actionState.windTurbineStripeColor=k})}},M=()=>{t(!1)},D=()=>{M(),c()},E=()=>{R(d,p,y),t(!1),s(0)},W=()=>{R(d,p,y)};return h.jsx(so,{width:600,title:Y.t("windTurbineMenu.BirdSafeDesign",b),onApply:W,onClose:M,onClickCancel:D,onClickOk:E,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:8,children:[h.jsxs("span",{children:[Y.t("word.Pattern",b),": "]}),h.jsxs(_o,{style:{width:"116px"},value:d,onChange:j=>{j!==null&&f(j)},children:[h.jsx(C,{value:uc.None,children:Y.t("windTurbineMenu.BirdSafeNone",b)},uc.None),h.jsx(C,{value:uc.Bicolor,children:Y.t("windTurbineMenu.BirdSafeBicolor",b)},uc.Bicolor),h.jsx(C,{value:uc.Striped,children:Y.t("windTurbineMenu.BirdSafeStriped",b)},uc.Striped)]}),h.jsxs("div",{style:{marginTop:"10px"},children:[h.jsxs("span",{children:[Y.t("word.Color",b)," 1: "]}),h.jsx("input",{type:"color",value:p,onChange:j=>{g(j.target.value)}})]}),h.jsxs("div",{style:{marginTop:"10px"},children:[h.jsxs("span",{children:[Y.t("word.Color",b)," 2: "]}),h.jsx("input",{type:"color",value:y,onChange:j=>{w(j.target.value)}})]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:16,children:h.jsx(Ue.Group,{onChange:P,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",b)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",b)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",b)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",b)})]})})})]})})},y1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.towerHeight)??0),p=m.useRef(!1),g=m.useRef(),y=Jt(),w=E=>{a(E.target.value)},b=E=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const W of n)if(W.type===z.WindTurbine&&!W.locked&&H.getState().selectedElementIdSet.has(W.id)&&Math.abs(W.towerHeight-E)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const W of n)if(W.type===z.WindTurbine&&W.foundationId===(u==null?void 0:u.foundationId)&&!W.locked&&Math.abs(W.towerHeight-E)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const W of n)if(W.type===z.WindTurbine&&!W.locked&&H.getState().selectedElementIdSet.has(W.id)&&Math.abs(W.towerHeight-E)>It)return!0;break;default:if(Math.abs((u==null?void 0:u.towerHeight)-E)>It)return!0}return!1}},C=(E,W)=>{e(j=>{for(const L of j.elements)if(L.type===z.WindTurbine&&L.id===E&&!L.locked){const k=L;k.towerHeight=W,k.lz=W+k.bladeRadius;break}})},P=(E,W)=>{e(j=>{for(const L of j.elements)if(L.type===z.WindTurbine&&L.foundationId===E&&!L.locked){const k=L;k.towerHeight=W,k.lz=W+k.bladeRadius}})},v=E=>{e(W=>{for(const j of W.elements)if(j.type===z.WindTurbine&&!j.locked){const L=j;L.towerHeight=E,L.lz=E+L.bladeRadius}})},T=(E,W)=>{H.getState().set(j=>{for(const L of j.elements)if(L.type===z.WindTurbine&&!L.locked&&E.has(L.id)){const k=L;k.towerHeight=W,k.lz=W+k.bladeRadius}})},A=E=>{if(u&&b(E)){switch(g.current=void 0,i){case oe.AllSelectedObjectsOfThisType:{p.current=!1;for(const W of n)if(W.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(W.id)&&W.bladeRadius>E){p.current=!0;break}if(p.current)g.current=E,f(u.towerHeight);else{const W=new Map;for(const L of n)L.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(L.id)&&W.set(L.id,L.towerHeight);const j={name:"Set Tower Height for Selected Wind Turbines",timestamp:Date.now(),oldValues:W,newValue:E,undo:()=>{for(const[L,k]of j.oldValues.entries())C(L,k)},redo:()=>{T(j.oldValues,j.newValue)}};r(j),T(W,E),s(l+1)}break}case oe.AllObjectsOfThisType:{p.current=!1;for(const W of n)if(W.type===z.WindTurbine&&W.bladeRadius>E){p.current=!0;break}if(p.current)g.current=E,f(u.towerHeight);else{const W=new Map;for(const L of n)L.type===z.WindTurbine&&W.set(L.id,L.towerHeight);const j={name:"Set Tower Height for All Wind Turbines",timestamp:Date.now(),oldValues:W,newValue:E,undo:()=>{for(const[L,k]of j.oldValues.entries())C(L,k)},redo:()=>{v(j.newValue)}};r(j),v(E),s(l+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){p.current=!1;for(const W of n)if(W.type===z.WindTurbine&&W.foundationId===u.foundationId&&W.bladeRadius>E){p.current=!0;break}if(p.current)g.current=E,f(u.towerHeight);else{const W=new Map;for(const L of n)L.type===z.WindTurbine&&L.foundationId===u.foundationId&&W.set(L.id,L.towerHeight);const j={name:"Set Tower Height for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:W,newValue:E,groupId:u.foundationId,undo:()=>{for(const[L,k]of j.oldValues.entries())C(L,k)},redo:()=>{j.groupId&&P(j.groupId,j.newValue)}};r(j),P(u.foundationId,E),s(l+1)}}break}default:{const W=o(u.id),j=W?W.towerHeight:u.towerHeight;if(p.current=u.bladeRadius>E,p.current)g.current=E,f(j);else{const L={name:"Set Wind Turbine Tower Height",timestamp:Date.now(),oldValue:j,newValue:E,changedElementId:u.id,changedElementType:u.type,undo:()=>{C(L.changedElementId,L.oldValue)},redo:()=>{C(L.changedElementId,L.newValue)}};r(L),C(u.id,E),s(l+1)}break}}e(W=>{W.actionState.windTurbineTowerHeight=E})}},x=()=>{p.current=!1,t(!1)},S=()=>{x(),c()},R=()=>{A(d),p.current||(t(!1),s(0))},M=()=>{A(d)},D=p.current?": "+Y.t("message.NotApplicableToSelectedAction",y)+(g.current!==void 0?" ("+g.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.TowerHeight",y),rejectedMessage:D,onApply:M,onClose:x,onClickCancel:S,onClickOk:R,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:1,max:100,style:{width:120},step:.1,precision:1,value:d,onChange:E=>{E!==null&&f(E)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",y),": [1, 100] ",Y.t("word.MeterAbbreviation",y)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",y)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:w,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",y)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",y)})]})})})]})})},A1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(En),i=H(d3),a=H(f3),l=H(no),s=H(Zn),c=H(Vi),u=co(z.WindTurbine),[d,f]=m.useState((u==null?void 0:u.towerRadius)??0),p=Jt(),g=R=>{a(R.target.value)},y=R=>{if(u){switch(i){case oe.AllObjectsOfThisType:for(const M of n)if(M.type===z.WindTurbine&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&Math.abs(M.towerRadius-R)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const M of n)if(M.type===z.WindTurbine&&M.foundationId===(u==null?void 0:u.foundationId)&&!M.locked&&Math.abs(M.towerRadius-R)>It)return!0;break;case oe.AllSelectedObjectsOfThisType:for(const M of n)if(M.type===z.WindTurbine&&!M.locked&&H.getState().selectedElementIdSet.has(M.id)&&Math.abs(M.towerRadius-R)>It)return!0;break;default:if(Math.abs((u==null?void 0:u.towerRadius)-R)>It)return!0}return!1}},w=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&E.id===R&&!E.locked){const W=E;W.towerRadius=M;break}})},b=(R,M)=>{e(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&E.foundationId===R&&!E.locked){const W=E;W.towerRadius=M}})},C=R=>{e(M=>{for(const D of M.elements)if(D.type===z.WindTurbine&&!D.locked){const E=D;E.towerRadius=R}})},P=(R,M)=>{H.getState().set(D=>{for(const E of D.elements)if(E.type===z.WindTurbine&&!E.locked&&R.has(E.id)){const W=E;W.towerRadius=M}})},v=R=>{if(u&&y(R)){switch(i){case oe.AllSelectedObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.WindTurbine&&H.getState().selectedElementIdSet.has(E.id)&&M.set(E.id,E.towerRadius);const D={name:"Set Tower Radius for Selected Wind Turbines",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{P(D.oldValues,D.newValue)}};r(D),P(M,R),s(l+1);break}case oe.AllObjectsOfThisType:{const M=new Map;for(const E of n)E.type===z.WindTurbine&&M.set(E.id,E.towerRadius);const D={name:"Set Tower Radius for All Wind Turbines",timestamp:Date.now(),oldValues:M,newValue:R,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{C(D.newValue)}};r(D),C(R),s(l+1);break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(u.foundationId){const M=new Map;for(const E of n)E.type===z.WindTurbine&&E.foundationId===u.foundationId&&M.set(E.id,E.towerRadius);const D={name:"Set Tower Radius for All Wind Turbines Above Foundation",timestamp:Date.now(),oldValues:M,newValue:R,groupId:u.foundationId,undo:()=>{for(const[E,W]of D.oldValues.entries())w(E,W)},redo:()=>{D.groupId&&b(D.groupId,D.newValue)}};r(D),b(u.foundationId,R),s(l+1)}break}default:{const M=o(u.id),D=M?M.towerRadius:u.towerRadius,E={name:"Set Wind Turbine Tower Radius",timestamp:Date.now(),oldValue:D,newValue:R,changedElementId:u.id,changedElementType:u.type,undo:()=>{w(E.changedElementId,E.oldValue)},redo:()=>{w(E.changedElementId,E.newValue)}};r(E),w(u.id,R),s(l+1);break}}e(M=>{M.actionState.windTurbineTowerRadius=R})}},T=()=>{t(!1)},A=()=>{T(),c()},x=()=>{v(d),t(!1),s(0)},S=()=>{v(d)};return h.jsx(so,{width:550,title:Y.t("windTurbineMenu.TowerRadius",p),onApply:S,onClose:T,onClickCancel:A,onClickOk:x,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:.1,max:2,style:{width:120},step:.01,precision:2,value:d,onChange:R=>{R!==null&&f(R)}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",p),": [0.1, 2] ",Y.t("word.MeterAbbreviation",p)]})]}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",p)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:g,value:i,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("windTurbineMenu.OnlyThisWindTurbine",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("windTurbineMenu.AllWindTurbinesAboveFoundation",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("windTurbineMenu.AllSelectedWindTurbines",p)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("windTurbineMenu.AllWindTurbines",p)})]})})})]})})},w1o=t=>{const e=[];if(t.type!==z.WindTurbine)return{items:e};const n=t,o={lng:H.getState().language},r=!n.locked;return e.push({key:"wind-turbine-copy",label:h.jsx(Ld,{})}),r&&e.push({key:"wind-turbine-cut",label:h.jsx(Wd,{})}),e.push({key:"wind-turbine-lock",label:h.jsx(Ju,{selectedElement:n})}),r&&e.push({key:"wind-turbine-relative-yaw-angle",label:h.jsxs(to,{Dialog:c1o,children:[Y.t("windTurbineMenu.RelativeYawAngle",o)," ..."]})},{key:"wind-turbine-rotor-submenu",label:h.jsx(rn,{children:Y.t("windTurbineMenu.Rotor",o)}),children:[{key:"wind-turbine-rotor-blade-number",label:h.jsxs(to,{noPadding:!0,Dialog:u1o,children:[Y.t("windTurbineMenu.BladeNumber",o)," ..."]})},{key:"wind-turbine-rotor-initial-angle",label:h.jsxs(to,{noPadding:!0,Dialog:d1o,children:[Y.t("windTurbineMenu.RotorInitialAngle",o)," ..."]})},{key:"wind-turbine-rotor-blade-pitch-angle",label:h.jsxs(to,{noPadding:!0,Dialog:f1o,children:[Y.t("windTurbineMenu.RotorBladePitchAngle",o)," ..."]})},{key:"wind-turbine-rotor-blade-radius",label:h.jsxs(to,{noPadding:!0,Dialog:h1o,children:[Y.t("windTurbineMenu.RotorBladeRadius",o)," ..."]})},{key:"wind-turbine-rotor-blade-design",label:h.jsxs(to,{noPadding:!0,Dialog:p1o,children:[Y.t("windTurbineMenu.RotorBladeDesign",o)," ..."]})},{key:"wind-turbine-hub-design",label:h.jsxs(to,{noPadding:!0,Dialog:g1o,children:[Y.t("windTurbineMenu.HubDesign",o)," ..."]})},{key:"wind-turbine-bird-safe-blade",label:h.jsxs(to,{noPadding:!0,Dialog:m1o,children:[Y.t("windTurbineMenu.BirdSafeDesign",o)," ..."]})}]},{key:"wind-turbine-tower-submenu",label:h.jsx(rn,{children:Y.t("windTurbineMenu.Tower",o)}),children:[{key:"wind-turbine-tower-height",label:h.jsxs(to,{noPadding:!0,Dialog:y1o,children:[Y.t("windTurbineMenu.TowerHeight",o)," ..."]})},{key:"wind-turbine-tower-radius",label:h.jsxs(to,{noPadding:!0,Dialog:A1o,children:[Y.t("windTurbineMenu.TowerRadius",o)," ..."]})}]},{key:"wind-turbine-label",label:h.jsx(rn,{children:Y.t("labelSubMenu.Label",o)}),children:PA(n)}),{items:e}},v1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(zd),l=H(Dd),s=H(no),c=H(Zn),u=H(Vi),d=co(z.WaterHeater),[f,p]=m.useState((d==null?void 0:d.lx)??1),g=m.useRef(!1),y=m.useRef(),w=Jt(),b=(k,N)=>{e(F=>{for(const U of F.elements)if(U.type===z.WaterHeater&&U.id===k&&!U.locked){U.lx=N;break}})},C=(k,N)=>{e(F=>{for(const U of F.elements)U.type===z.WaterHeater&&U.foundationId===k&&!U.locked&&(U.lx=N)})},P=(k,N,F)=>{e(U=>{for(const O of U.elements)if(O.type===z.WaterHeater&&!O.locked){let B;N?B=O.parentId===k&&me.isIdentical(O.normal,N):B=O.parentId===k,B&&(O.lx=F)}})},v=k=>{e(N=>{for(const F of N.elements)F.type===z.WaterHeater&&!F.locked&&(F.lx=k)})},T=(k,N)=>{H.getState().set(F=>{for(const U of F.elements)U.type===z.WaterHeater&&!U.locked&&k.has(U.id)&&(U.lx=N)})},A=k=>{l(k.target.value)},x=(k,N)=>{const F=r(k);if(F){if(F.type===z.Cuboid&&!me.isIdentical(k.normal,rs))return!0;const U=JSON.parse(JSON.stringify(k));return U.lx=N,F.type===z.Roof?!0:me.isSolarCollectorWithinHorizontalSurface(U,F)}return!1},S=(k,N)=>!x(k,N),R=k=>{if(d){switch(a){case oe.AllSelectedObjectsOfThisType:{for(const N of n)if(N.type===z.WaterHeater&&!N.locked&&H.getState().selectedElementIdSet.has(N.id)&&Math.abs(N.lx-k)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const N of n)if(N.type===z.WaterHeater&&!N.locked&&Math.abs(N.lx-k)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const N of n)if(N.type===z.WaterHeater&&N.foundationId===(d==null?void 0:d.foundationId)&&!N.locked&&Math.abs(N.lx-k)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const N=r(d);if(N){if(N.type===z.Cuboid){for(const U of n)if(U.type===z.WaterHeater&&U.parentId===d.parentId&&me.isIdentical(U.normal,d.normal)&&!U.locked&&Math.abs(U.lx-k)>It)return!0}else for(const U of n)if(U.type===z.WaterHeater&&U.parentId===d.parentId&&!U.locked&&Math.abs(U.lx-k)>It)return!0}break}default:{if(Math.abs((d==null?void 0:d.lx)-k)>It)return!0;break}}return!1}},M=k=>{if(d&&R(k))switch(y.current=void 0,a){case oe.AllSelectedObjectsOfThisType:{g.current=!1;for(const N of n)if(N.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(N.id)&&S(N,k)){g.current=!0;break}if(g.current)y.current=k,p(d.lx);else{const N=new Map;for(const U of n)U.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(U.id)&&N.set(U.id,U.lx);const F={name:"Set Length for Selected Water Heater",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())b(U,O)},redo:()=>{T(F.oldValues,F.newValue)}};i(F),T(N,k),c(s+1)}break}case oe.AllObjectsOfThisType:{g.current=!1;for(const N of n)if(N.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(N.id)&&S(N,k)){g.current=!0;break}if(g.current)y.current=k,p(d.lx);else{const N=new Map;for(const U of n)U.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(U.id)&&N.set(U.id,U.lx);const F={name:"Set Length for All Water Heater",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())b(U,O)},redo:()=>{v(F.newValue)}};i(F),v(k),c(s+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(d.foundationId){g.current=!1;for(const N of n)if(N.type===z.WaterHeater&&N.foundationId===d.foundationId&&S(N,k)){g.current=!0;break}if(g.current)y.current=k,p(d.lx);else{const N=new Map;for(const U of n)U.type===z.WaterHeater&&U.foundationId===d.foundationId&&N.set(U.id,U.lx);const F={name:"Set Length for All Water Heater Above Foundation",timestamp:Date.now(),oldValues:N,newValue:k,groupId:d.foundationId,undo:()=>{for(const[U,O]of F.oldValues.entries())b(U,O)},redo:()=>{F.groupId&&C(F.groupId,F.newValue)}};i(F),C(d.foundationId,k),c(s+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const N=r(d);if(N){if(g.current=!1,N.type===z.Cuboid){for(const U of n)if(U.type===z.WaterHeater&&U.parentId===d.parentId&&me.isIdentical(U.normal,d.normal)&&S(U,k)){g.current=!0;break}}else for(const U of n)if(U.type===z.WaterHeater&&U.parentId===d.parentId&&S(U,k)){g.current=!0;break}if(g.current)y.current=k,p(d.lx);else{const U=new Map,O=N.type===z.Cuboid;if(O)for(const X of n)X.type===z.WaterHeater&&X.parentId===d.parentId&&me.isIdentical(X.normal,d.normal)&&U.set(X.id,X.lx);else for(const X of n)X.type===z.WaterHeater&&X.parentId===d.parentId&&U.set(X.id,X.lx);const B=O?d.normal:void 0,_={name:"Set Length for All Water Heater on Surface",timestamp:Date.now(),oldValues:U,newValue:k,groupId:d.parentId,normal:B,undo:()=>{for(const[X,$]of _.oldValues.entries())b(X,$)},redo:()=>{_.groupId&&P(_.groupId,_.normal,_.newValue)}};i(_),P(d.parentId,B,k),c(s+1)}}break}default:{const N=o(d.id),F=N?N.lx:d.lx;if(g.current=S(d,k),g.current)y.current=k,p(F);else{const U={name:"Set Water Heater Length",timestamp:Date.now(),oldValue:F,newValue:k,changedElementId:d.id,changedElementType:d.type,undo:()=>{b(U.changedElementId,U.oldValue)},redo:()=>{b(U.changedElementId,U.newValue)}};i(U),b(d.id,k),c(s+1)}break}}},D=()=>{g.current=!1,t(!1)},E=()=>{D(),u()},W=()=>{M(f),g.current||(t(!1),c(0))},j=()=>{M(f)},L=g.current?": "+Y.t("message.NotApplicableToSelectedAction",w)+(y.current!==void 0?" ("+y.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Length",w),rejectedMessage:L,onApply:j,onClose:D,onClickCancel:E,onClickOk:W,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:6,children:h.jsx(Mn,{min:0,max:100,step:.1,style:{width:120},precision:2,value:f,onChange:k=>{k!==null&&p(k)}})}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",w)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:A,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("waterHeaterMenu.OnlyThisWaterHeater",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("waterHeaterMenu.AllWaterHeatersOnSurface",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("waterHeaterMenu.AllWaterHeatersAboveFoundation",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("waterHeaterMenu.AllSelectedWaterHeaters",w)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("waterHeaterMenu.AllWaterHeaters",w)})]})})})]})})},x1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(zd),l=H(Dd),s=H(no),c=H(Zn),u=H(Vi),d=co(z.WaterHeater),[f,p]=m.useState(0),[g,y]=m.useState((d==null?void 0:d.ly)??1),w=m.useRef(!1),b=m.useRef(),C=Jt();m.useEffect(()=>{d&&p(Number((d.lz-.3).toFixed(2)))},[d]);const P=(F,U)=>{e(O=>{for(const B of O.elements)if(B.type===z.WaterHeater&&B.id===F&&!B.locked){B.ly=U;break}})},v=(F,U)=>{e(O=>{for(const B of O.elements)B.type===z.WaterHeater&&B.foundationId===F&&!B.locked&&(B.ly=U)})},T=(F,U,O)=>{e(B=>{for(const _ of B.elements)if(_.type===z.WaterHeater&&!_.locked){let X;U?X=_.parentId===F&&me.isIdentical(_.normal,U):X=_.parentId===F,X&&(_.ly=O)}})},A=F=>{e(U=>{for(const O of U.elements)O.type===z.WaterHeater&&!O.locked&&(O.ly=F)})},x=(F,U)=>{H.getState().set(O=>{for(const B of O.elements)B.type===z.WaterHeater&&!B.locked&&F.has(B.id)&&(B.ly=U)})},S=F=>{l(F.target.value)},R=(F,U)=>{const O=r(F);if(O){if(O.type===z.Cuboid&&!me.isIdentical(F.normal,rs))return!0;const B=JSON.parse(JSON.stringify(F));return B.ly=U,O.type===z.Roof?!0:me.isSolarCollectorWithinHorizontalSurface(B,O)}return!1},M=(F,U)=>!R(F,U),D=F=>{if(d){switch(a){case oe.AllSelectedObjectsOfThisType:{for(const U of n)if(U.type===z.WaterHeater&&!U.locked&&H.getState().selectedElementIdSet.has(U.id)&&Math.abs(U.ly-F)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const U of n)if(U.type===z.WaterHeater&&!U.locked&&Math.abs(U.ly-F)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const U of n)if(U.type===z.WaterHeater&&U.foundationId===(d==null?void 0:d.foundationId)&&!U.locked&&Math.abs(U.ly-F)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const U=r(d);if(U){if(U.type===z.Cuboid){for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&me.isIdentical(B.normal,d.normal)&&!B.locked&&Math.abs(B.ly-F)>It)return!0}else for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&!B.locked&&Math.abs(B.ly-F)>It)return!0}break}default:{if(Math.abs((d==null?void 0:d.ly)-F)>It)return!0;break}}return!1}},E=F=>{if(d&&D(F))switch(b.current=void 0,a){case oe.AllSelectedObjectsOfThisType:{w.current=!1;for(const U of n)if(U.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(U.id)&&M(U,F)){w.current=!0;break}if(w.current)b.current=F,y(d.ly);else{const U=new Map;for(const B of n)B.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(B.id)&&U.set(B.id,B.ly);const O={name:"Set Width for Selected Water Heater",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())P(B,_)},redo:()=>{x(O.oldValues,O.newValue)}};i(O),x(U,F),c(s+1)}break}case oe.AllObjectsOfThisType:{w.current=!1;for(const U of n)if(U.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(U.id)&&M(U,F)){w.current=!0;break}if(w.current)b.current=F,y(d.ly);else{const U=new Map;for(const B of n)B.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(B.id)&&U.set(B.id,B.ly);const O={name:"Set Length for All Water Heater",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())P(B,_)},redo:()=>{A(O.newValue)}};i(O),A(F),c(s+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(d.foundationId){w.current=!1;for(const U of n)if(U.type===z.WaterHeater&&U.foundationId===d.foundationId&&M(U,F)){w.current=!0;break}if(w.current)b.current=F,y(d.ly);else{const U=new Map;for(const B of n)B.type===z.WaterHeater&&B.foundationId===d.foundationId&&U.set(B.id,B.ly);const O={name:"Set Width for All Water Heater Above Foundation",timestamp:Date.now(),oldValues:U,newValue:F,groupId:d.foundationId,undo:()=>{for(const[B,_]of O.oldValues.entries())P(B,_)},redo:()=>{O.groupId&&v(O.groupId,O.newValue)}};i(O),v(d.foundationId,F),c(s+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const U=r(d);if(U){if(w.current=!1,U.type===z.Cuboid){for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&me.isIdentical(B.normal,d.normal)&&M(B,F)){w.current=!0;break}}else for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&M(B,F)){w.current=!0;break}if(w.current)b.current=F,y(d.ly);else{const B=new Map,_=U.type===z.Cuboid;if(_)for(const Q of n)Q.type===z.WaterHeater&&Q.parentId===d.parentId&&me.isIdentical(Q.normal,d.normal)&&B.set(Q.id,Q.ly);else for(const Q of n)Q.type===z.WaterHeater&&Q.parentId===d.parentId&&B.set(Q.id,Q.ly);const X=_?d.normal:void 0,$={name:"Set Width for All Water Heater on Surface",timestamp:Date.now(),oldValues:B,newValue:F,groupId:d.parentId,normal:X,undo:()=>{for(const[Q,le]of $.oldValues.entries())P(Q,le)},redo:()=>{$.groupId&&T($.groupId,$.normal,$.newValue)}};i($),T(d.parentId,X,F),c(s+1)}}break}default:{const U=o(d.id),O=U?U.ly:d.ly;if(w.current=M(d,F),w.current)b.current=F,y(O);else{const B={name:"Set Water Heater Width",timestamp:Date.now(),oldValue:O,newValue:F,changedElementId:d.id,changedElementType:d.type,undo:()=>{P(B.changedElementId,B.oldValue)},redo:()=>{P(B.changedElementId,B.newValue)}};i(B),P(d.id,F),c(s+1)}break}}},W=()=>{w.current=!1,t(!1)},j=()=>{W(),u()},L=()=>{E(g),w.current||(t(!1),c(0))},k=()=>{E(g)},N=w.current?": "+Y.t("message.NotApplicableToSelectedAction",C)+(b.current!==void 0?" ("+b.current.toFixed(2)+")":""):null;return console.log("min",f),h.jsx(so,{width:550,title:Y.t("word.Width",C),rejectedMessage:N,onApply:k,onClose:W,onClickCancel:j,onClickOk:L,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:6,children:h.jsx(Mn,{min:f,max:100,step:.1,style:{width:120},precision:2,value:g,onChange:F=>{F!==null&&y(F)}})}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",C)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:S,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("waterHeaterMenu.OnlyThisWaterHeater",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("waterHeaterMenu.AllWaterHeatersOnSurface",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("waterHeaterMenu.AllWaterHeatersAboveFoundation",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("waterHeaterMenu.AllSelectedWaterHeaters",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("waterHeaterMenu.AllWaterHeaters",C)})]})})})]})})},b1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(Jq),i=H(dYe),a=H(fYe),l=H(hYe),s=H(qr),c=H(En),u=H(zd),d=H(Dd),f=H(no),p=H(Zn),g=H(Vi),y=co(z.WaterHeater),w=m.useRef(!1),b=m.useRef(),[C,P]=m.useState(y?-y.relativeAzimuth:0),v=Jt(),T=k=>{d(k.target.value)},A=(k,N)=>{const F=s(k);if(F){if(F.type===z.Cuboid&&!me.isIdentical(k.normal,rs))return!0;const U=JSON.parse(JSON.stringify(k));return U.relativeAzimuth=-N,F.type===z.Roof?!0:me.isSolarCollectorWithinHorizontalSurface(U,F)}return!1},x=(k,N)=>!A(k,N),S=k=>{if(y){switch(u){case oe.AllSelectedObjectsOfThisType:for(const N of n)if(N.type===z.WaterHeater&&!N.locked&&H.getState().selectedElementIdSet.has(N.id)&&Math.abs(-N.relativeAzimuth-k)>It)return!0;break;case oe.AllObjectsOfThisType:for(const N of n)if(N.type===z.WaterHeater&&!N.locked&&Math.abs(-N.relativeAzimuth-k)>It)return!0;break;case oe.AllObjectsOfThisTypeAboveFoundation:for(const N of n)if(N.type===z.WaterHeater&&N.foundationId===(y==null?void 0:y.foundationId)&&!N.locked&&Math.abs(-N.relativeAzimuth-k)>It)return!0;break;case oe.AllObjectsOfThisTypeOnSurface:if(y!=null&&y.parentId){const N=s(y);if(N){if(N.type===z.Cuboid){for(const U of n)if(U.type===z.WaterHeater&&U.parentId===y.parentId&&me.isIdentical(U.normal,y.normal)&&!U.locked&&Math.abs(-U.relativeAzimuth-k)>It)return!0}else for(const U of n)if(U.type===z.WaterHeater&&U.parentId===y.parentId&&!U.locked&&Math.abs(-U.relativeAzimuth-k)>It)return!0}}break;default:if(Math.abs(-(y==null?void 0:y.relativeAzimuth)-k)>It)return!0}return!1}},R=(k,N)=>{H.getState().set(F=>{for(const U of F.elements)if(U.type===z.WaterHeater&&!U.locked&&k.has(U.id)){const O=U;O.relativeAzimuth=N}})},M=k=>{if(y&&S(k)){switch(b.current=void 0,u){case oe.AllSelectedObjectsOfThisType:{w.current=!1;for(const N of n)if(N.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(N.id)&&x(N,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const N=new Map;for(const U of n)U.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(U.id)&&N.set(U.id,-U.relativeAzimuth);const F={name:"Set Relative Azimuth for Selected Water Heater",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,-O)},redo:()=>{R(F.oldValues,F.newValue)}};c(F),R(N,-k),p(f+1)}break}case oe.AllObjectsOfThisType:{w.current=!1;for(const N of n)if(N.type===z.WaterHeater&&x(N,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const N=new Map;for(const U of n)U.type===z.WaterHeater&&N.set(U.id,-U.relativeAzimuth);const F={name:"Set Relative Azimuth for All Water Heater",timestamp:Date.now(),oldValues:N,newValue:k,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,-O)},redo:()=>{l(z.WaterHeater,-F.newValue)}};c(F),l(z.WaterHeater,-k),p(f+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(y.foundationId){w.current=!1;for(const N of n)if(N.type===z.WaterHeater&&N.foundationId===y.foundationId&&x(N,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const N=new Map;for(const U of n)U.type===z.WaterHeater&&U.foundationId===y.foundationId&&N.set(U.id,-U.relativeAzimuth);const F={name:"Set Relative Azimuth for All Water Heater Above Foundation",timestamp:Date.now(),oldValues:N,newValue:k,groupId:y.foundationId,undo:()=>{for(const[U,O]of F.oldValues.entries())r(U,-O)},redo:()=>{F.groupId&&a(z.WaterHeater,F.groupId,-F.newValue)}};c(F),a(z.WaterHeater,y.foundationId,-k),p(f+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{if(y.parentId){const N=s(y);if(N){if(w.current=!1,N.type===z.Cuboid){for(const U of n)if(U.type===z.WaterHeater&&U.parentId===y.parentId&&me.isIdentical(U.normal,y.normal)&&x(U,k)){w.current=!0;break}}else for(const U of n)if(U.type===z.WaterHeater&&U.parentId===y.parentId&&x(U,k)){w.current=!0;break}if(w.current)b.current=k,P(-y.relativeAzimuth);else{const U=new Map,O=N.type===z.Cuboid;if(O)for(const X of n)X.type===z.WaterHeater&&X.parentId===y.parentId&&me.isIdentical(X.normal,y.normal)&&U.set(X.id,-X.relativeAzimuth);else for(const X of n)X.type===z.WaterHeater&&X.parentId===y.parentId&&U.set(X.id,-X.relativeAzimuth);const B=O?y.normal:void 0,_={name:"Set Relative Azimuth for All Water Heater on Surface",timestamp:Date.now(),oldValues:U,newValue:k,groupId:y.parentId,normal:B,undo:()=>{for(const[X,$]of _.oldValues.entries())r(X,-$)},redo:()=>{_.groupId&&i(z.WaterHeater,_.groupId,_.normal,-_.newValue)}};c(_),i(z.WaterHeater,y.parentId,B,-k),p(f+1)}}}break}default:{const N=o(y.id),F=N?-N.relativeAzimuth:-y.relativeAzimuth;if(w.current=x(y,k),w.current)b.current=k,P(F);else{const U={name:"Set Solar Panel Array Relative Azimuth",timestamp:Date.now(),oldValue:F,newValue:k,changedElementId:y.id,changedElementType:y.type,undo:()=>{r(U.changedElementId,-U.oldValue)},redo:()=>{r(U.changedElementId,-U.newValue)}};c(U),r(y.id,-k),p(f+1)}break}}e(N=>{N.actionState.solarPanelRelativeAzimuth=-k})}},D=()=>{w.current=!1,t(!1)},E=()=>{D(),g()},W=()=>{M(C),w.current||(t(!1),p(0))},j=()=>{M(C)},L=w.current?": "+Y.t("message.NotApplicableToSelectedAction",v)+(b.current!==void 0?" ("+me.toDegrees(b.current).toFixed(1)+"°)":null):null;return h.jsx(so,{width:550,title:Y.t("solarCollectorMenu.RelativeAzimuth",v),rejectedMessage:L,onApply:j,onClose:D,onClickCancel:E,onClickOk:W,children:h.jsxs(on,{gutter:6,children:[h.jsxs(nt,{className:"gutter-row",span:6,children:[h.jsx(Mn,{min:-180,max:180,style:{width:120},precision:2,step:1,value:parseFloat(me.toDegrees(C).toFixed(2)),formatter:k=>`${k}°`,onChange:k=>{k!==null&&P(me.toRadians(k))}}),h.jsxs("div",{style:{paddingTop:"20px",textAlign:"left",fontSize:"11px"},children:[Y.t("word.Range",v),": [-180°, 180°]",h.jsx("br",{}),Y.t("message.AzimuthOfNorthIsZero",v),h.jsx("br",{}),Y.t("message.CounterclockwiseAzimuthIsPositive",v)]})]}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:18,children:h.jsx(Ue.Group,{onChange:T,value:u,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("solarPanelMenu.OnlyThisSolarPanel",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("solarPanelMenu.AllSolarPanelsOnSurface",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("solarPanelMenu.AllSolarPanelsAboveFoundation",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("solarPanelMenu.AllSelectedSolarPanels",v)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("solarPanelMenu.AllSolarPanels",v)})]})})})]})})},S1o=({setDialogVisible:t})=>{const e=H(fn),n=H(Kn),o=H(Gn),r=H(qr),i=H(En),a=H(zd),l=H(Dd),s=H(no),c=H(Zn),u=H(Vi),d=co(z.WaterHeater),[f,p]=m.useState((d==null?void 0:d.lz)??1),[g,y]=m.useState(0),w=m.useRef(!1),b=m.useRef(),C=Jt();m.useEffect(()=>{d&&y(d.ly+.3)},[d]);const P=(F,U)=>{e(O=>{for(const B of O.elements)if(B.type===z.WaterHeater&&B.id===F&&!B.locked){B.lz=U;break}})},v=(F,U)=>{e(O=>{for(const B of O.elements)B.type===z.WaterHeater&&B.foundationId===F&&!B.locked&&(B.lz=U)})},T=(F,U,O)=>{e(B=>{for(const _ of B.elements)if(_.type===z.WaterHeater&&!_.locked){let X;U?X=_.parentId===F&&me.isIdentical(_.normal,U):X=_.parentId===F,X&&(_.lz=O)}})},A=F=>{e(U=>{for(const O of U.elements)O.type===z.WaterHeater&&!O.locked&&(O.lz=F)})},x=(F,U)=>{H.getState().set(O=>{for(const B of O.elements)B.type===z.WaterHeater&&!B.locked&&F.has(B.id)&&(B.lz=U)})},S=F=>{l(F.target.value)},R=(F,U)=>{const O=r(F);if(O){if(O.type===z.Cuboid&&!me.isIdentical(F.normal,rs))return!0;const B=JSON.parse(JSON.stringify(F));return B.lz=U,O.type===z.Roof?!0:me.isSolarCollectorWithinHorizontalSurface(B,O)}return!1},M=(F,U)=>!R(F,U),D=F=>{if(d){switch(a){case oe.AllSelectedObjectsOfThisType:{for(const U of n)if(U.type===z.WaterHeater&&!U.locked&&H.getState().selectedElementIdSet.has(U.id)&&Math.abs(U.lz-F)>It)return!0;break}case oe.AllObjectsOfThisType:{for(const U of n)if(U.type===z.WaterHeater&&!U.locked&&Math.abs(U.lz-F)>It)return!0;break}case oe.AllObjectsOfThisTypeAboveFoundation:{for(const U of n)if(U.type===z.WaterHeater&&U.foundationId===(d==null?void 0:d.foundationId)&&!U.locked&&Math.abs(U.lz-F)>It)return!0;break}case oe.AllObjectsOfThisTypeOnSurface:{const U=r(d);if(U){if(U.type===z.Cuboid){for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&me.isIdentical(B.normal,d.normal)&&!B.locked&&Math.abs(B.lz-F)>It)return!0}else for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&!B.locked&&Math.abs(B.lz-F)>It)return!0}break}default:{if(Math.abs((d==null?void 0:d.lz)-F)>It)return!0;break}}return!1}},E=F=>{if(d&&D(F))switch(b.current=void 0,a){case oe.AllSelectedObjectsOfThisType:{w.current=!1;for(const U of n)if(U.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(U.id)&&M(U,F)){w.current=!0;break}if(w.current)b.current=F,p(d.lz);else{const U=new Map;for(const B of n)B.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(B.id)&&U.set(B.id,B.lz);const O={name:"Set Height for Selected Water Heater",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())P(B,_)},redo:()=>{x(O.oldValues,O.newValue)}};i(O),x(U,F),c(s+1)}break}case oe.AllObjectsOfThisType:{w.current=!1;for(const U of n)if(U.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(U.id)&&M(U,F)){w.current=!0;break}if(w.current)b.current=F,p(d.lz);else{const U=new Map;for(const B of n)B.type===z.WaterHeater&&H.getState().selectedElementIdSet.has(B.id)&&U.set(B.id,B.lz);const O={name:"Set Height for All Water Heater",timestamp:Date.now(),oldValues:U,newValue:F,undo:()=>{for(const[B,_]of O.oldValues.entries())P(B,_)},redo:()=>{A(O.newValue)}};i(O),A(F),c(s+1)}break}case oe.AllObjectsOfThisTypeAboveFoundation:{if(d.foundationId){w.current=!1;for(const U of n)if(U.type===z.WaterHeater&&U.foundationId===d.foundationId&&M(U,F)){w.current=!0;break}if(w.current)b.current=F,p(d.lz);else{const U=new Map;for(const B of n)B.type===z.WaterHeater&&B.foundationId===d.foundationId&&U.set(B.id,B.lz);const O={name:"Set Height for All Water Heater Above Foundation",timestamp:Date.now(),oldValues:U,newValue:F,groupId:d.foundationId,undo:()=>{for(const[B,_]of O.oldValues.entries())P(B,_)},redo:()=>{O.groupId&&v(O.groupId,O.newValue)}};i(O),v(d.foundationId,F),c(s+1)}}break}case oe.AllObjectsOfThisTypeOnSurface:{const U=r(d);if(U){if(w.current=!1,U.type===z.Cuboid){for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&me.isIdentical(B.normal,d.normal)&&M(B,F)){w.current=!0;break}}else for(const B of n)if(B.type===z.WaterHeater&&B.parentId===d.parentId&&M(B,F)){w.current=!0;break}if(w.current)b.current=F,p(d.lz);else{const B=new Map,_=U.type===z.Cuboid;if(_)for(const Q of n)Q.type===z.WaterHeater&&Q.parentId===d.parentId&&me.isIdentical(Q.normal,d.normal)&&B.set(Q.id,Q.lz);else for(const Q of n)Q.type===z.WaterHeater&&Q.parentId===d.parentId&&B.set(Q.id,Q.lz);const X=_?d.normal:void 0,$={name:"Set Height for All Water Heater on Surface",timestamp:Date.now(),oldValues:B,newValue:F,groupId:d.parentId,normal:X,undo:()=>{for(const[Q,le]of $.oldValues.entries())P(Q,le)},redo:()=>{$.groupId&&T($.groupId,$.normal,$.newValue)}};i($),T(d.parentId,X,F),c(s+1)}}break}default:{const U=o(d.id),O=U?U.lz:d.lz;if(w.current=M(d,F),w.current)b.current=F,p(O);else{const B={name:"Set Water Heater Height",timestamp:Date.now(),oldValue:O,newValue:F,changedElementId:d.id,changedElementType:d.type,undo:()=>{P(B.changedElementId,B.oldValue)},redo:()=>{P(B.changedElementId,B.newValue)}};i(B),P(d.id,F),c(s+1)}break}}},W=()=>{w.current=!1,t(!1)},j=()=>{W(),u()},L=()=>{E(f),w.current||(t(!1),c(0))},k=()=>{E(f)},N=w.current?": "+Y.t("message.NotApplicableToSelectedAction",C)+(b.current!==void 0?" ("+b.current.toFixed(2)+")":""):null;return h.jsx(so,{width:550,title:Y.t("word.Height",C),rejectedMessage:N,onApply:k,onClose:W,onClickCancel:j,onClickOk:L,children:h.jsxs(on,{gutter:6,children:[h.jsx(nt,{className:"gutter-row",span:6,children:h.jsx(Mn,{min:.6,max:g,step:.1,style:{width:120},precision:2,value:f,onChange:F=>{F!==null&&p(F)}})}),h.jsx(nt,{className:"gutter-row",span:1,style:{verticalAlign:"middle",paddingTop:"6px"},children:Y.t("word.MeterAbbreviation",C)}),h.jsx(nt,{className:"gutter-row",style:{border:"2px dashed #ccc",paddingTop:"8px",paddingLeft:"12px",paddingBottom:"8px"},span:17,children:h.jsx(Ue.Group,{onChange:S,value:a,children:h.jsxs(en,{direction:"vertical",children:[h.jsx(Ue,{style:{width:"100%"},value:oe.OnlyThisObject,children:Y.t("waterHeaterMenu.OnlyThisWaterHeater",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeOnSurface,children:Y.t("waterHeaterMenu.AllWaterHeatersOnSurface",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisTypeAboveFoundation,children:Y.t("waterHeaterMenu.AllWaterHeatersAboveFoundation",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllSelectedObjectsOfThisType,children:Y.t("waterHeaterMenu.AllSelectedWaterHeaters",C)}),h.jsx(Ue,{style:{width:"100%"},value:oe.AllObjectsOfThisType,children:Y.t("waterHeaterMenu.AllWaterHeaters",C)})]})})})]})})},T1o=t=>{const e=[];if(t.type!==z.WaterHeater)return{items:e};const n=t,o=!n.locked,r={lng:H.getState().language},i=t.type===z.WaterHeater&&me.isIdentical(n.normal,rs);return e.push({key:"water-heater-copy",label:h.jsx(Ld,{})}),o&&e.push({key:"water-heater-cut",label:h.jsx(Wd,{})}),e.push({key:"water-heater-lock",label:h.jsx(Ju,{selectedElement:n})}),o&&e.push({key:"water-heater-length",label:h.jsxs(to,{Dialog:v1o,children:[Y.t("word.Length",r)," ..."]})},{key:"water-heater-width",label:h.jsxs(to,{Dialog:x1o,children:[Y.t("word.Width",r)," ..."]})},{key:"water-heater-height",label:h.jsxs(to,{Dialog:S1o,children:[Y.t("word.Height",r)," ..."]})}),i&&e.push({key:"water-heater-relative-azimuth",label:h.jsxs(to,{Dialog:b1o,children:[Y.t("solarCollectorMenu.RelativeAzimuth",r)," ..."]})}),{items:e}},P1o=()=>{const t=H(p7t),e=co(),n=m.useRef(t),o=m.useRef(e);return t!==null?(n.current=t,o.current=e):setTimeout(()=>{n.current=t,o.current=t===null?void 0:e},200),[n.current,o.current]},C1o=({children:t})=>{ht(r=>r.contextMenuFlag);const[e,n]=P1o(),o=()=>{if(!n)return e===z.Ground?Mdo():e===z.Sky?kfo():{items:[]};switch(e){case z.Foundation:return Juo(n);case z.Cuboid:return Ado(n);case z.Wall:return opo(n);case z.Roof:return s1o(n);case z.SolarPanel:return Kfo(n);case z.Window:return Dpo(n);case z.Door:return gpo(n);case z.Sensor:return wfo(n);case z.Light:return Tfo(n);case z.Human:return jdo(n);case z.Tree:return kho(n);case z.Flower:return Ydo(n);case z.ParabolicTrough:return iho(n);case z.ParabolicDish:return gho(n);case z.FresnelReflector:return Tho(n);case z.Heliostat:return Eho(n);case z.Polygon:return ffo(n);case z.PolygonVertex:return mfo(n);case z.WindTurbine:return w1o(n);case z.WaterHeater:return T1o(n);default:return{items:[]}}};return h.jsx(jw,{trigger:["contextMenu"],menu:o(),overlayClassName:"my-overlay",children:t})},R1o=be.memo(C1o);(function(){var t,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(I,V,ue){I!=Array.prototype&&I!=Object.prototype&&(I[V]=ue.value)};function n(I){I=[typeof window=="object"&&window,typeof self=="object"&&self,typeof global=="object"&&global,I];for(var V=0;V>>0),P=0;function v(I,V,ue){return I.call.apply(I.bind,arguments)}function T(I,V,ue){if(!I)throw Error();if(2I.b&&(I.b++,V.next=I.a,I.a=V)}function X(){this.b=this.a=null}var $=new B(function(){return new le},function(I){I.reset()});X.prototype.add=function(I,V){var ue=$.get();ue.set(I,V),this.b?this.b.next=ue:this.a=ue,this.b=ue};function Q(){var I=xo,V=null;return I.a&&(V=I.a,I.a=I.a.next,I.a||(I.b=null),V.next=null),V}function le(){this.next=this.b=this.a=null}le.prototype.set=function(I,V){this.a=I,this.b=V,this.next=null},le.prototype.reset=function(){this.next=this.b=this.a=null};var q=Array.prototype.indexOf?function(I,V){return Array.prototype.indexOf.call(I,V,void 0)}:function(I,V){if(typeof I=="string")return typeof V!="string"||V.length!=1?-1:I.indexOf(V,0);for(var ue=0;ueV?null:typeof I=="string"?I.charAt(V):I[V]}function ge(I,V){return 0<=q(I,V)}function de(I,V){V=q(I,V);var ue;return(ue=0<=V)&&Array.prototype.splice.call(I,V,1),ue}function Z(I,V){var ue=0;re(I,function(Ce,_e){V.call(void 0,Ce,_e,I)&&Array.prototype.splice.call(I,_e,1).length==1&&ue++})}function he(I){return Array.prototype.concat.apply([],arguments)}function xe(I){var V=I.length;if(0/g,ye=/"/g,ce=/'/g,pe=/\x00/g,ve=/[\x00&<>"']/;function Ae(I,V){return I.indexOf(V)!=-1}function Te(I,V){return IV?1:0}var Me;e:{var Pe=s.navigator;if(Pe){var Ee=Pe.userAgent;if(Ee){Me=Ee;break e}}Me=""}function Be(I){return Ae(Me,I)}function Je(I,V){for(var ue in I)V.call(void 0,I[ue],ue,I)}function We(I){for(var V in I)return!1;return!0}function Ke(I){var V={},ue;for(ue in I)V[ue]=I[ue];return V}var Ne="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function De(I,V){for(var ue,Ce,_e=1;_e"}else wt=I===void 0?"undefined":I===null?"null":typeof I;O("Argument is not a %s (or a non-Element, non-Location mock); got: %s",V,wt)}}function Ye(I,V){this.a=I===yt&&V||"",this.b=Ve}Ye.prototype.ta=!0,Ye.prototype.sa=function(){return this.a},Ye.prototype.toString=function(){return"Const{"+this.a+"}"};function it(I){return I instanceof Ye&&I.constructor===Ye&&I.b===Ve?I.a:(O("expected object of type Const, got '"+I+"'"),"type_error:Const")}var Ve={},yt={},ct;function Xe(){if(ct===void 0){var I=null,V=s.trustedTypes;if(V&&V.createPolicy){try{I=V.createPolicy("goog#html",{createHTML:R,createScript:R,createScriptURL:R})}catch(ue){s.console&&s.console.error(ue.message)}ct=I}else ct=I}return ct}function ut(I,V){this.a=V===Oe?I:""}ut.prototype.ta=!0,ut.prototype.sa=function(){return this.a.toString()},ut.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};function ft(I){return I instanceof ut&&I.constructor===ut?I.a:(O("expected object of type TrustedResourceUrl, got '"+I+"' of type "+p(I)),"type_error:TrustedResourceUrl")}function ot(I,V){var ue=it(I);if(!at.test(ue))throw Error("Invalid TrustedResourceUrl format: "+ue);return I=ue.replace(st,function(Ce,_e){if(!Object.prototype.hasOwnProperty.call(V,_e))throw Error('Found marker, "'+_e+'", in format string, "'+ue+'", but no valid label mapping found in args: '+JSON.stringify(V));return Ce=V[_e],Ce instanceof Ye?it(Ce):encodeURIComponent(String(Ce))}),Ze(I)}var st=/%{(\w+)}/g,at=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,Oe={};function Ze(I){var V=Xe();return I=V?V.createScriptURL(I):I,new ut(I,Oe)}function St(I,V){this.a=V===gt?I:""}St.prototype.ta=!0,St.prototype.sa=function(){return this.a.toString()},St.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};function Pt(I){return I instanceof St&&I.constructor===St?I.a:(O("expected object of type SafeUrl, got '"+I+"' of type "+p(I)),"type_error:SafeUrl")}var Rt=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)|font\/\w+|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime|x-matroska))(?:;\w+=(?:\w+|"[\w;,= ]+"))*$/i,Ut=/^data:(.*);base64,[a-z0-9+\/]+=*$/i,Ht=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function At(I){if(I instanceof St)return I;if(I=typeof I=="object"&&I.ta?I.sa():String(I),Ht.test(I))I=new St(I,gt);else{I=String(I),I=I.replace(/(%0A|%0D)/g,"");var V=I.match(Ut);I=V&&Rt.test(V[1])?new St(I,gt):null}return I}function kt(I){return I instanceof St?I:(I=typeof I=="object"&&I.ta?I.sa():String(I),Ht.test(I)||(I="about:invalid#zClosurez"),new St(I,gt))}var gt={},dt=new St("about:invalid#zClosurez",gt);function Ct(I,V,ue){this.a=ue===Fe?I:""}Ct.prototype.ta=!0,Ct.prototype.sa=function(){return this.a.toString()},Ct.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};function tt(I){return I instanceof Ct&&I.constructor===Ct?I.a:(O("expected object of type SafeHtml, got '"+I+"' of type "+p(I)),"type_error:SafeHtml")}var Fe={};function qe(I,V){ke(I,"HTMLScriptElement"),I.src=ft(V),(V=I.ownerDocument&&I.ownerDocument.defaultView)&&V!=s?V=d(V.document):(u===null&&(u=d(s.document)),V=u),V&&I.setAttribute("nonce",V)}function je(I,V,ue,Ce){return I=I instanceof St?I:kt(I),V=V||s,ue=ue instanceof Ye?it(ue):ue||"",V.open(Pt(I),ue,Ce,void 0)}function rt(I,V){for(var ue=I.split("%s"),Ce="",_e=Array.prototype.slice.call(arguments,1);_e.length&&1")!=-1&&(I=I.replace(Ie,">")),I.indexOf('"')!=-1&&(I=I.replace(ye,""")),I.indexOf("'")!=-1&&(I=I.replace(ce,"'")),I.indexOf("\0")!=-1&&(I=I.replace(pe,"�"))),I}function Qe(I){return Qe[" "](I),I}Qe[" "]=f;function Tt(I,V){var ue=Fo;return Object.prototype.hasOwnProperty.call(ue,I)?ue[I]:ue[I]=V(I)}var Dt=Be("Opera"),lt=Be("Trident")||Be("MSIE"),zt=Be("Edge"),Ft=zt||lt,_t=Be("Gecko")&&!(Ae(Me.toLowerCase(),"webkit")&&!Be("Edge"))&&!(Be("Trident")||Be("MSIE"))&&!Be("Edge"),tn=Ae(Me.toLowerCase(),"webkit")&&!Be("Edge");function Qt(){var I=s.document;return I?I.documentMode:void 0}var gn;e:{var an="",mn=function(){var I=Me;if(_t)return/rv:([^\);]+)(\)|;)/.exec(I);if(zt)return/Edge\/([\d\.]+)/.exec(I);if(lt)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(I);if(tn)return/WebKit\/(\S+)/.exec(I);if(Dt)return/(?:Version)[ \/]?(\S+)/.exec(I)}();if(mn&&(an=mn?mn[1]:""),lt){var Hn=Qt();if(Hn!=null&&Hn>parseFloat(an)){gn=String(Hn);break e}}gn=an}var Fo={};function yo(I){return Tt(I,function(){for(var V=0,ue=He(String(gn)).split("."),Ce=He(String(I)).split("."),_e=Math.max(ue.length,Ce.length),wt=0;V==0&&wt<_e;wt++){var Et=ue[wt]||"",cn=Ce[wt]||"";do{if(Et=/(\d*)(\D*)(.*)/.exec(Et)||["","","",""],cn=/(\d*)(\D*)(.*)/.exec(cn)||["","","",""],Et[0].length==0&&cn[0].length==0)break;V=Te(Et[1].length==0?0:parseInt(Et[1],10),cn[1].length==0?0:parseInt(cn[1],10))||Te(Et[2].length==0,cn[2].length==0)||Te(Et[2],cn[2]),Et=Et[3],cn=cn[3]}while(V==0)}return 0<=V})}var So;if(s.document&<){var $o=Qt();So=$o||parseInt(gn,10)||void 0}else So=void 0;var mo=So;try{new self.OffscreenCanvas(0,0).getContext("2d")}catch{}var Jn=!lt||9<=Number(mo);function uo(I){var V=document;return typeof I=="string"?V.getElementById(I):I}function ir(I,V){Je(V,function(ue,Ce){ue&&typeof ue=="object"&&ue.ta&&(ue=ue.sa()),Ce=="style"?I.style.cssText=ue:Ce=="class"?I.className=ue:Ce=="for"?I.htmlFor=ue:Rr.hasOwnProperty(Ce)?I.setAttribute(Rr[Ce],ue):Ce.lastIndexOf("aria-",0)==0||Ce.lastIndexOf("data-",0)==0?I.setAttribute(Ce,ue):I[Ce]=ue})}var Rr={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};function br(I,V,ue){var Ce=arguments,_e=document,wt=String(Ce[0]),Et=Ce[1];if(!Jn&&Et&&(Et.name||Et.type)){if(wt=["<",wt],Et.name&&wt.push(' name="',mt(Et.name),'"'),Et.type){wt.push(' type="',mt(Et.type),'"');var cn={};De(cn,Et),delete cn.type,Et=cn}wt.push(">"),wt=wt.join("")}return wt=Wo(_e,wt),Et&&(typeof Et=="string"?wt.className=Et:Array.isArray(Et)?wt.className=Et.join(" "):ir(wt,Et)),2"u"&&typeof window<"u"&&window.postMessage&&window.addEventListener&&!Be("Presto")&&(I=function(){var _e=Wo(document,"IFRAME");_e.style.display="none",document.documentElement.appendChild(_e);var wt=_e.contentWindow;_e=wt.document,_e.open(),_e.close();var Et="callImmediate"+Math.random(),cn=wt.location.protocol=="file:"?"*":wt.location.protocol+"//"+wt.location.host;_e=A(function(ao){(cn=="*"||ao.origin==cn)&&ao.data==Et&&this.port1.onmessage()},this),wt.addEventListener("message",_e,!1),this.port1={},this.port2={postMessage:function(){wt.postMessage(Et,cn)}}}),typeof I<"u"&&!Be("Trident")&&!Be("MSIE")){var V=new I,ue={},Ce=ue;return V.port1.onmessage=function(){if(ue.next!==void 0){ue=ue.next;var _e=ue.Hb;ue.Hb=null,_e()}},function(_e){Ce.next={Hb:_e},Ce=Ce.next,V.port2.postMessage(0)}}return function(_e){s.setTimeout(_e,0)}}function No(I,V){eo||Xn(),Jo||(eo(),Jo=!0),xo.add(I,V)}var eo;function Xn(){if(s.Promise&&s.Promise.resolve){var I=s.Promise.resolve(void 0);eo=function(){I.then(Qo)}}else eo=function(){var V=Qo;!y(s.setImmediate)||s.Window&&s.Window.prototype&&!Be("Edge")&&s.Window.prototype.setImmediate==s.setImmediate?(In||(In=ar()),In(V)):s.setImmediate(V)}}var Jo=!1,xo=new X;function Qo(){for(var I;I=Q();){try{I.a.call(I.b)}catch(V){wn(V)}_($,I)}Jo=!1}function jo(I,V){if(this.a=lr,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,I!=f)try{var ue=this;I.call(V,function(Ce){Fs(ue,fr,Ce)},function(Ce){if(!(Ce instanceof mu))try{throw Ce instanceof Error?Ce:Error("Promise rejected.")}catch{}Fs(ue,ai,Ce)})}catch(Ce){Fs(this,ai,Ce)}}var lr=0,fr=2,ai=3;function hr(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}hr.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var tr=new B(function(){return new hr},function(I){I.reset()});function xi(I,V,ue){var Ce=tr.get();return Ce.g=I,Ce.b=V,Ce.f=ue,Ce}function Eo(I){if(I instanceof jo)return I;var V=new jo(f);return Fs(V,fr,I),V}function bi(I){return new jo(function(V,ue){ue(I)})}function hl(I,V,ue){ks(I,V,ue,null)||No(x(V,I))}function nr(I){return new jo(function(V,ue){var Ce=I.length,_e=[];if(Ce)for(var wt=function(Mo,Hi){Ce--,_e[Mo]=Hi,Ce==0&&V(_e)},Et=function(Mo){ue(Mo)},cn=0,ao;cn=I.keyCode)&&(I.keyCode=-1)}catch{}},xt.prototype.g=function(){return this.a};var Kt="closure_listenable_"+(1e6*Math.random()|0),sn=0;function yn(I,V,ue,Ce,_e){this.listener=I,this.proxy=null,this.src=V,this.type=ue,this.capture=!!Ce,this.Wa=_e,this.key=++sn,this.wa=this.Qa=!1}function An(I){I.wa=!0,I.listener=null,I.proxy=null,I.src=null,I.Wa=null}function bn(I){this.src=I,this.a={},this.b=0}bn.prototype.add=function(I,V,ue,Ce,_e){var wt=I.toString();I=this.a[wt],I||(I=this.a[wt]=[],this.b++);var Et=Yn(I,V,Ce,_e);return-1Ce.keyCode||Ce.returnValue!=null)){e:{var _e=!1;if(Ce.keyCode==0)try{Ce.keyCode=-1;break e}catch{_e=!0}(_e||Ce.returnValue==null)&&(Ce.returnValue=!0)}for(Ce=[],_e=V.b;_e;_e=_e.parentNode)Ce.push(_e);for(I=I.type,_e=Ce.length-1;0<=_e;_e--){V.b=Ce[_e];var wt=$u(Ce[_e],I,!0,V);ue=ue&&wt}for(_e=0;_e>>0);function Ef(I){return y(I)?I:(I[Zu]||(I[Zu]=function(V){return I.handleEvent(V)}),I[Zu])}function Xl(){un.call(this),this.v=new bn(this),this.bc=this,this.hb=null}S(Xl,un),Xl.prototype[Kt]=!0,Xl.prototype.addEventListener=function(I,V,ue,Ce){qn(this,I,V,ue,Ce)},Xl.prototype.removeEventListener=function(I,V,ue,Ce){Or(this,I,V,ue,Ce)},Xl.prototype.dispatchEvent=function(I){var V,ue=this.hb;if(ue)for(V=[];ue;ue=ue.hb)V.push(ue);ue=this.bc;var Ce=I.type||I;if(typeof I=="string")I=new Lt(I,ue);else if(I instanceof Lt)I.target=I.target||ue;else{var _e=I;I=new Lt(Ce,ue),De(I,_e)}if(_e=!0,V)for(var wt=V.length-1;0<=wt;wt--){var Et=I.b=V[wt];_e=xp(Et,Ce,!0,I)&&_e}if(Et=I.b=ue,_e=xp(Et,Ce,!0,I)&&_e,_e=xp(Et,Ce,!1,I)&&_e,V)for(wt=0;wtV)throw Error("Bad port number "+V);I.g=V}else I.g=null}function _g(I,V,ue){V instanceof Vg?(I.b=V,t7(I.b,I.i)):(ue||(V=Ih(V,zh)),I.b=new Vg(V,I.i))}function il(I,V,ue){I.b.set(V,ue)}function jd(I,V){return I.b.get(V)}function wu(I){return I instanceof Ls?new Ls(I):new Ls(I,void 0)}function p5(I,V,ue,Ce){var _e=new Ls(null,void 0);return I&&ec(_e,I),V&&(_e.a=V),ue&&xl(_e,ue),Ce&&(_e.f=Ce),_e}function wy(I,V){return I?V?decodeURI(I.replace(/%25/g,"%2525")):decodeURIComponent(I):""}function Ih(I,V,ue){return typeof I=="string"?(I=encodeURI(I).replace(V,S3),ue&&(I=I.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),I):null}function S3(I){return I=I.charCodeAt(0),"%"+(I>>4&15).toString(16)+(I&15).toString(16)}var vy=/[#\/\?@]/g,T3=/[#\?:]/g,g5=/[#\?]/g,zh=/[#\?@]/g,P3=/#/g;function Vg(I,V){this.b=this.a=null,this.c=I||null,this.f=!!V}function Bd(I){I.a||(I.a=new V0,I.b=0,I.c&&Au(I.c,function(V,ue){I.add(decodeURIComponent(V.replace(/\+/g," ")),ue)}))}function e7(I){var V=y1(I);if(typeof V>"u")throw Error("Keys are undefined");var ue=new Vg(null,void 0);I=yu(I);for(var Ce=0;Ce2*I.c&&Mh(I)))}t.clear=function(){this.a=this.c=null,this.b=0};function ms(I,V){return Bd(I),V=vu(I,V),Og(I.a.b,V)}t.forEach=function(I,V){Bd(this),this.a.forEach(function(ue,Ce){te(ue,function(_e){I.call(V,_e,Ce,this)},this)},this)},t.Y=function(){Bd(this);for(var I=this.a.X(),V=this.a.Y(),ue=[],Ce=0;CeI?!1:!lt||!mo||9',I=(Ce=Xe())?Ce.createHTML(I):I,I=new Ct(I,null,Fe),Ce=Et.document)&&(Ce.write(tt(I)),Ce.close())):(Et=je(V,Ce,ue,Et))&&I.noopener&&(Et.opener=null),Et)try{Et.focus()}catch{}return Et}function Gg(I){return new jo(function(V){function ue(){Gc(2e3).then(function(){if(!I||I.closed)V();else return ue()})}return ue()})}var C3=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,m5=/^[^@]+@[^@]+$/;function Ws(){var I=null;return new jo(function(V){s.document.readyState=="complete"?V():(I=function(){V()},$i(window,"load",I))}).o(function(V){throw Or(window,"load",I),V})}function y5(){return Ya(void 0)?Ws().then(function(){return new jo(function(I,V){var ue=s.document,Ce=setTimeout(function(){V(Error("Cordova framework is not ready."))},1e3);ue.addEventListener("deviceready",function(){clearTimeout(Ce),I()},!1)})}):bi(Error("Cordova must run in an Android or iOS file scheme."))}function Ya(I){return I=I||tc(),!(Yd()!=="file:"&&Yd()!=="ionic:"||!I.toLowerCase().match(/iphone|ipad|ipod|android/))}function R3(){var I=s.window;try{return!(!I||I==I.top)}catch{return!1}}function Hc(){return typeof s.WorkerGlobalScope<"u"&&typeof s.importScripts=="function"}function Ns(){return $n.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":$n.INTERNAL.hasOwnProperty("node")?"Node":Hc()?"Worker":"Browser"}function Xg(){var I=Ns();return I==="ReactNative"||I==="Node"}function IA(){for(var I=50,V=[];0"u"?null:Sy(I)}function S5(I){var V={},ue;for(ue in I)I.hasOwnProperty(ue)&&I[ue]!==null&&I[ue]!==void 0&&(V[ue]=I[ue]);return V}function Ty(I){if(I!==null)return JSON.parse(I)}function Kg(I){return I||Math.floor(1e9*Math.random()).toString()}function T5(I){return I=I||tc(),!(ed(I)=="Safari"||I.toLowerCase().match(/iphone|ipad|ipod/))}function P5(){var I=s.___jsl;if(I&&I.H){for(var V in I.H)if(I.H[V].r=I.H[V].r||[],I.H[V].L=I.H[V].L||[],I.H[V].r=I.H[V].L.concat(),I.CP)for(var ue=0;ueV)throw Error("Short delay should be less than long delay!");this.a=I,this.c=V,I=tc(),V=Ns(),this.b=Jc(I)||V==="ReactNative"}Ff.prototype.get=function(){var I=s.navigator;return!(I&&typeof I.onLine=="boolean"&&(b5()||Yd()==="chrome-extension:"||typeof I.connection<"u"))||I.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};function zA(){var I=s.document;return I&&typeof I.visibilityState<"u"?I.visibilityState=="visible":!0}function n7(){var I=s.document,V=null;return zA()||!I?Eo():new jo(function(ue){V=function(){zA()&&(I.removeEventListener("visibilitychange",V,!1),ue())},I.addEventListener("visibilitychange",V,!1)}).o(function(ue){throw I.removeEventListener("visibilitychange",V,!1),ue})}function H3(I){try{var V=new Date(parseInt(I,10));if(!isNaN(V.getTime())&&!/[^0-9]/.test(I))return V.toUTCString()}catch{}return null}function o7(){return!(!Jl("fireauth.oauthhelper",s)&&!Jl("fireauth.iframe",s))}function Kc(){var I=s.navigator;return I&&I.serviceWorker&&I.serviceWorker.controller||null}function X0(){var I=s.navigator;return I&&I.serviceWorker?Eo().then(function(){return I.serviceWorker.ready}).then(function(V){return V.active||null}).o(function(){return null}):Eo(null)}var r7={};function DA(I){r7[I]||(r7[I]=!0,typeof console<"u"&&typeof console.warn=="function"&&console.warn(I))}var M3;try{var EA={};Object.defineProperty(EA,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(EA,"abcd",{configurable:!0,enumerable:!0,value:2}),M3=EA.abcd==2}catch{M3=!1}function Hr(I,V,ue){M3?Object.defineProperty(I,V,{configurable:!0,enumerable:!0,value:ue}):I[V]=ue}function qc(I,V){if(V)for(var ue in V)V.hasOwnProperty(ue)&&Hr(I,ue,V[ue])}function kf(I){var V={};return qc(V,I),V}function C5(I){var V={},ue;for(ue in I)I.hasOwnProperty(ue)&&(V[ue]=I[ue]);return V}function Py(I,V){if(!V||!V.length)return!0;if(!I)return!1;for(var ue=0;ue"u")throw new M("missing-continue-uri");if(typeof V!="string"||typeof V=="string"&&!V.length)throw new M("invalid-continue-uri");this.h=V,this.b=this.a=null,this.g=!1;var ue=I[s7];if(ue&&typeof ue=="object"){V=ue[u7];var Ce=ue[S1];if(ue=ue[YA],typeof V=="string"&&V.length){if(this.a=V,typeof Ce<"u"&&typeof Ce!="boolean")throw new M("argument-error",S1+" property must be a boolean when specified.");if(this.g=!!Ce,typeof ue<"u"&&(typeof ue!="string"||typeof ue=="string"&&!ue.length))throw new M("argument-error",YA+" property must be a non empty string when specified.");this.b=ue||null}else{if(typeof V<"u")throw new M("argument-error",u7+" property must be a non empty string when specified.");if(typeof Ce<"u"||typeof ue<"u")throw new M("missing-android-pkg-name")}}else if(typeof ue<"u")throw new M("argument-error",s7+" property must be a non null object when specified.");if(this.f=null,(V=I[c7])&&typeof V=="object"){if(V=V[Mc],typeof V=="string"&&V.length)this.f=V;else if(typeof V<"u")throw new M("argument-error",Mc+" property must be a non empty string when specified.")}else if(typeof V<"u")throw new M("argument-error",c7+" property must be a non null object when specified.");if(V=I[jA],typeof V<"u"&&typeof V!="boolean")throw new M("argument-error",jA+" property must be a boolean when specified.");if(this.c=!!V,I=I[UA],typeof I<"u"&&(typeof I!="string"||typeof I=="string"&&!I.length))throw new M("argument-error",UA+" property must be a non empty string when specified.");this.i=I||null}var s7="android",UA="dynamicLinkDomain",jA="handleCodeInApp",c7="iOS",BA="url",S1="installApp",YA="minimumVersion",u7="packageName",Mc="bundleId";function OA(I){var V={};V.continueUrl=I.h,V.canHandleCodeInApp=I.c,(V.androidPackageName=I.a)&&(V.androidMinimumVersion=I.b,V.androidInstallApp=I.g),V.iOSBundleId=I.f,V.dynamicLinkDomain=I.i;for(var ue in V)V[ue]===null&&delete V[ue];return V}function jM(I){return se(I,function(V){return V=V.toString(16),1>4),Et!=64&&(V(wt<<4&240|Et>>2),cn!=64&&V(Et<<6&192|cn))}}function Ar(){if(!qg){qg={};for(var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),V=["+/=","+/","-_=","-_.","-_"],ue=0;5>ue;ue++)for(var Ce=I.concat(V[ue].split("")),_e=0;_ethis.a?this.a:I),this.b=V.provider_id||V.firebase&&V.firebase.sign_in_provider||null,this.f=V.firebase&&V.firebase.tenant||null,this.c=!!V.is_anonymous||this.b=="anonymous"}$g.prototype.T=function(){return this.f},$g.prototype.l=function(){return this.c},$g.prototype.toString=function(){return this.h};function H5(I){try{return new $g(I)}catch{return null}}function d7(I){if(!I||(I=I.split("."),I.length!=3))return null;I=I[1];for(var V=(4-I.length%4)%4,ue=0;ue_e)I[ue++]=String.fromCharCode(_e);else if(191<_e&&224>_e){var wt=Ce[V++];I[ue++]=String.fromCharCode((_e&31)<<6|wt&63)}else if(239<_e&&365>_e){wt=Ce[V++];var Et=Ce[V++],cn=Ce[V++],ao=((_e&7)<<18|(wt&63)<<12|(Et&63)<<6|cn&63)-65536;I[ue++]=String.fromCharCode(55296+(ao>>10)),I[ue++]=String.fromCharCode(56320+(ao&1023))}else wt=Ce[V++],Et=Ce[V++],I[ue++]=String.fromCharCode((_e&15)<<12|(wt&63)<<6|Et&63)}return JSON.parse(I.join(""))}catch{}return null}var _A="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),rd=["client_id","response_type","scope","redirect_uri","state"],Tp={nd:{Ja:"locale",va:700,ua:600,fa:"facebook.com",Ya:rd},pd:{Ja:null,va:500,ua:750,fa:"github.com",Ya:rd},qd:{Ja:"hl",va:515,ua:680,fa:"google.com",Ya:rd},wd:{Ja:"lang",va:485,ua:705,fa:"twitter.com",Ya:_A},kd:{Ja:"locale",va:640,ua:600,fa:"apple.com",Ya:[]}};function E3(I){for(var V in Tp)if(Tp[V].fa==I)return Tp[V];return null}function VA(I){var V={};V["facebook.com"]=id,V["google.com"]=F3,V["github.com"]=XA,V["twitter.com"]=JA;var ue=I&&I[Fh];try{if(ue)return V[ue]?new V[ue](I):new v0(I);if(typeof I[GA]<"u")return new M5(I)}catch{}return null}var GA="idToken",Fh="providerId";function M5(I){var V=I[Fh];if(!V&&I[GA]){var ue=H5(I[GA]);ue&&ue.b&&(V=ue.b)}if(!V)throw Error("Invalid additional user info!");(V=="anonymous"||V=="custom")&&(V=null),ue=!1,typeof I.isNewUser<"u"?ue=!!I.isNewUser:I.kind==="identitytoolkit#SignupNewUserResponse"&&(ue=!0),Hr(this,"providerId",V),Hr(this,"isNewUser",ue)}function v0(I){M5.call(this,I),I=Ty(I.rawUserInfo||"{}"),Hr(this,"profile",w1(I||{}))}S(v0,M5);function id(I){if(v0.call(this,I),this.providerId!="facebook.com")throw Error("Invalid provider ID!")}S(id,v0);function XA(I){if(v0.call(this,I),this.providerId!="github.com")throw Error("Invalid provider ID!");Hr(this,"username",this.profile&&this.profile.login||null)}S(XA,v0);function F3(I){if(v0.call(this,I),this.providerId!="google.com")throw Error("Invalid provider ID!")}S(F3,v0);function JA(I){if(v0.call(this,I),this.providerId!="twitter.com")throw Error("Invalid provider ID!");Hr(this,"username",I.screenName||null)}S(JA,v0);function Qg(I){var V=wu(I),ue=jd(V,"link"),Ce=jd(wu(ue),"link");return V=jd(V,"deep_link_id"),jd(wu(V),"link")||V||Ce||ue||I}function ad(I,V){if(!I&&!V)throw new M("internal-error","Internal assert: no raw session string available");if(I&&V)throw new M("internal-error","Internal assert: unable to determine the session type");this.a=I||null,this.b=V||null,this.type=this.a?I5:KA}var I5="enroll",KA="signin";ad.prototype.Ha=function(){return this.a?Eo(this.a):Eo(this.b)},ad.prototype.w=function(){return this.type==I5?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}};function Pp(){}Pp.prototype.ka=function(){},Pp.prototype.b=function(){},Pp.prototype.c=function(){},Pp.prototype.w=function(){};function Ry(I,V){return I.then(function(ue){if(ue[Zt]){var Ce=H5(ue[Zt]);if(!Ce||V!=Ce.i)throw new M("user-mismatch");return ue}throw new M("user-mismatch")}).o(function(ue){throw ue&&ue.code&&ue.code==E+"user-not-found"?new M("user-mismatch"):ue})}function T1(I,V){if(V)this.a=V;else throw new M("internal-error","failed to construct a credential");Hr(this,"providerId",I),Hr(this,"signInMethod",I)}T1.prototype.ka=function(I){return PS(I,Ic(this))},T1.prototype.b=function(I,V){var ue=Ic(this);return ue.idToken=V,Q0(I,ue)},T1.prototype.c=function(I,V){return Ry(VM(I,Ic(this)),V)};function Ic(I){return{pendingToken:I.a,requestUri:"http://localhost"}}T1.prototype.w=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}};function z5(I){if(I&&I.providerId&&I.signInMethod&&I.providerId.indexOf("saml.")==0&&I.pendingToken)try{return new T1(I.providerId,I.pendingToken)}catch{}return null}function _d(I,V,ue){if(this.a=null,V.idToken||V.accessToken)V.idToken&&Hr(this,"idToken",V.idToken),V.accessToken&&Hr(this,"accessToken",V.accessToken),V.nonce&&!V.pendingToken&&Hr(this,"nonce",V.nonce),V.pendingToken&&(this.a=V.pendingToken);else if(V.oauthToken&&V.oauthTokenSecret)Hr(this,"accessToken",V.oauthToken),Hr(this,"secret",V.oauthTokenSecret);else throw new M("internal-error","failed to construct a credential");Hr(this,"providerId",I),Hr(this,"signInMethod",ue)}_d.prototype.ka=function(I){return PS(I,bu(this))},_d.prototype.b=function(I,V){var ue=bu(this);return ue.idToken=V,Q0(I,ue)},_d.prototype.c=function(I,V){var ue=bu(this);return Ry(VM(I,ue),V)};function bu(I){var V={};return I.idToken&&(V.id_token=I.idToken),I.accessToken&&(V.access_token=I.accessToken),I.secret&&(V.oauth_token_secret=I.secret),V.providerId=I.providerId,I.nonce&&!I.a&&(V.nonce=I.nonce),V={postBody:e7(V).toString(),requestUri:"http://localhost"},I.a&&(delete V.postBody,V.pendingToken=I.a),V}_d.prototype.w=function(){var I={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(I.oauthIdToken=this.idToken),this.accessToken&&(I.oauthAccessToken=this.accessToken),this.secret&&(I.oauthTokenSecret=this.secret),this.nonce&&(I.nonce=this.nonce),this.a&&(I.pendingToken=this.a),I};function D5(I){if(I&&I.providerId&&I.signInMethod){var V={idToken:I.oauthIdToken,accessToken:I.oauthTokenSecret?null:I.oauthAccessToken,oauthTokenSecret:I.oauthTokenSecret,oauthToken:I.oauthTokenSecret&&I.oauthAccessToken,nonce:I.nonce,pendingToken:I.pendingToken};try{return new _d(I.providerId,V,I.signInMethod)}catch{}}return null}function Vd(I,V){this.Qc=V||[],qc(this,{providerId:I,isOAuthProvider:!0}),this.Jb={},this.qb=(E3(I)||{}).Ja||null,this.pb=null}Vd.prototype.Ka=function(I){return this.Jb=Ke(I),this};function Lf(I){if(typeof I!="string"||I.indexOf("saml.")!=0)throw new M("argument-error",'SAML provider IDs must be prefixed with "saml."');Vd.call(this,I,[])}S(Lf,Vd);function K0(I){Vd.call(this,I,rd),this.a=[]}S(K0,Vd),K0.prototype.Ca=function(I){return ge(this.a,I)||this.a.push(I),this},K0.prototype.Rb=function(){return xe(this.a)},K0.prototype.credential=function(I,V){var ue;if(w(I)?ue={idToken:I.idToken||null,accessToken:I.accessToken||null,nonce:I.rawNonce||null}:ue={idToken:I||null,accessToken:V||null},!ue.idToken&&!ue.accessToken)throw new M("argument-error","credential failed: must provide the ID token and/or the access token.");return new _d(this.providerId,ue,this.providerId)};function Cs(){K0.call(this,"facebook.com")}S(Cs,K0),Hr(Cs,"PROVIDER_ID","facebook.com"),Hr(Cs,"FACEBOOK_SIGN_IN_METHOD","facebook.com");function E5(I){if(!I)throw new M("argument-error","credential failed: expected 1 argument (the OAuth access token).");var V=I;return w(I)&&(V=I.accessToken),new Cs().credential({accessToken:V})}function Zg(){K0.call(this,"github.com")}S(Zg,K0),Hr(Zg,"PROVIDER_ID","github.com"),Hr(Zg,"GITHUB_SIGN_IN_METHOD","github.com");function qA(I){if(!I)throw new M("argument-error","credential failed: expected 1 argument (the OAuth access token).");var V=I;return w(I)&&(V=I.accessToken),new Zg().credential({accessToken:V})}function Hy(){K0.call(this,"google.com"),this.Ca("profile")}S(Hy,K0),Hr(Hy,"PROVIDER_ID","google.com"),Hr(Hy,"GOOGLE_SIGN_IN_METHOD","google.com");function My(I,V){var ue=I;return w(I)&&(ue=I.idToken,V=I.accessToken),new Hy().credential({idToken:ue,accessToken:V})}function em(){Vd.call(this,"twitter.com",_A)}S(em,Vd),Hr(em,"PROVIDER_ID","twitter.com"),Hr(em,"TWITTER_SIGN_IN_METHOD","twitter.com");function Kl(I,V){var ue=I;if(w(ue)||(ue={oauthToken:I,oauthTokenSecret:V}),!ue.oauthToken||!ue.oauthTokenSecret)throw new M("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new _d("twitter.com",ue,"twitter.com")}function Ci(I,V,ue){this.a=I,this.f=V,Hr(this,"providerId","password"),Hr(this,"signInMethod",ue===al.EMAIL_LINK_SIGN_IN_METHOD?al.EMAIL_LINK_SIGN_IN_METHOD:al.EMAIL_PASSWORD_SIGN_IN_METHOD)}Ci.prototype.ka=function(I){return this.signInMethod==al.EMAIL_LINK_SIGN_IN_METHOD?La(I,jy,{email:this.a,oobCode:this.f}):La(I,QM,{email:this.a,password:this.f})},Ci.prototype.b=function(I,V){return this.signInMethod==al.EMAIL_LINK_SIGN_IN_METHOD?La(I,$d,{idToken:V,email:this.a,oobCode:this.f}):La(I,KM,{idToken:V,email:this.a,password:this.f})},Ci.prototype.c=function(I,V){return Ry(this.ka(I),V)},Ci.prototype.w=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}};function zc(I){return I&&I.email&&I.password?new Ci(I.email,I.password,I.signInMethod):null}function al(){qc(this,{providerId:"password",isOAuthProvider:!1})}function js(I,V){if(V=Su(V),!V)throw new M("argument-error","Invalid email link!");return new Ci(I,V.code,al.EMAIL_LINK_SIGN_IN_METHOD)}function Su(I){return I=Qg(I),(I=D3(I))&&I.operation===x1?I:null}qc(al,{PROVIDER_ID:"password"}),qc(al,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),qc(al,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"});function Gd(I){if(!(I.fb&&I.eb||I.La&&I.ea))throw new M("internal-error");this.a=I,Hr(this,"providerId","phone"),this.fa="phone",Hr(this,"signInMethod","phone")}Gd.prototype.ka=function(I){return I.gb(Cp(this))},Gd.prototype.b=function(I,V){var ue=Cp(this);return ue.idToken=V,La(I,zU,ue)},Gd.prototype.c=function(I,V){var ue=Cp(this);return ue.operation="REAUTH",I=La(I,sm,ue),Ry(I,V)},Gd.prototype.w=function(){var I={providerId:"phone"};return this.a.fb&&(I.verificationId=this.a.fb),this.a.eb&&(I.verificationCode=this.a.eb),this.a.La&&(I.temporaryProof=this.a.La),this.a.ea&&(I.phoneNumber=this.a.ea),I};function nc(I){if(I&&I.providerId==="phone"&&(I.verificationId&&I.verificationCode||I.temporaryProof&&I.phoneNumber)){var V={};return te(["verificationId","verificationCode","temporaryProof","phoneNumber"],function(ue){I[ue]&&(V[ue]=I[ue])}),new Gd(V)}return null}function Cp(I){return I.a.La&&I.a.ea?{temporaryProof:I.a.La,phoneNumber:I.a.ea}:{sessionInfo:I.a.fb,code:I.a.eb}}function ld(I){try{this.a=I||$n.auth()}catch{throw new M("argument-error","Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().")}qc(this,{providerId:"phone",isOAuthProvider:!1})}ld.prototype.gb=function(I,V){var ue=this.a.a;return Eo(V.verify()).then(function(Ce){if(typeof Ce!="string")throw new M("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(V.type){case"recaptcha":var _e=w(I)?I.session:null,wt=w(I)?I.phoneNumber:I,Et;return _e&&_e.type==I5?Et=_e.Ha().then(function(cn){return i4(ue,{idToken:cn,phoneEnrollmentInfo:{phoneNumber:wt,recaptchaToken:Ce}})}):_e&&_e.type==KA?Et=_e.Ha().then(function(cn){return SS(ue,{mfaPendingCredential:cn,mfaEnrollmentId:I.multiFactorHint&&I.multiFactorHint.uid||I.multiFactorUid,phoneSignInInfo:{recaptchaToken:Ce}})}):Et=r4(ue,{phoneNumber:wt,recaptchaToken:Ce}),Et.then(function(cn){return typeof V.reset=="function"&&V.reset(),cn},function(cn){throw typeof V.reset=="function"&&V.reset(),cn});default:throw new M("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}})};function k3(I,V){if(!I)throw new M("missing-verification-id");if(!V)throw new M("missing-verification-code");return new Gd({fb:I,eb:V})}qc(ld,{PROVIDER_ID:"phone"}),qc(ld,{PHONE_SIGN_IN_METHOD:"phone"});function L3(I){if(I.temporaryProof&&I.phoneNumber)return new Gd({La:I.temporaryProof,ea:I.phoneNumber});var V=I&&I.providerId;if(!V||V==="password")return null;var ue=I&&I.oauthAccessToken,Ce=I&&I.oauthTokenSecret,_e=I&&I.nonce,wt=I&&I.oauthIdToken,Et=I&&I.pendingToken;try{switch(V){case"google.com":return My(wt,ue);case"facebook.com":return E5(ue);case"github.com":return qA(ue);case"twitter.com":return Kl(ue,Ce);default:return ue||Ce||wt||Et?Et?V.indexOf("saml.")==0?new T1(V,Et):new _d(V,{pendingToken:Et,idToken:I.oauthIdToken,accessToken:I.oauthAccessToken},V):new K0(V).credential({idToken:wt,accessToken:ue,rawNonce:_e}):null}}catch{return null}}function tm(I){if(!I.isOAuthProvider)throw new M("invalid-oauth-provider")}function ql(I,V,ue,Ce,_e,wt,Et){if(this.c=I,this.b=V||null,this.g=ue||null,this.f=Ce||null,this.i=wt||null,this.h=Et||null,this.a=_e||null,this.g||this.a){if(this.g&&this.a)throw new M("invalid-auth-event");if(this.g&&!this.f)throw new M("invalid-auth-event")}else throw new M("invalid-auth-event")}ql.prototype.getUid=function(){var I=[];return I.push(this.c),this.b&&I.push(this.b),this.f&&I.push(this.f),this.h&&I.push(this.h),I.join("-")},ql.prototype.T=function(){return this.h},ql.prototype.w=function(){return{type:this.c,eventId:this.b,urlResponse:this.g,sessionId:this.f,postBody:this.i,tenantId:this.h,error:this.a&&this.a.w()}};function $A(I){return I=I||{},I.type?new ql(I.type,I.eventId,I.urlResponse,I.sessionId,I.error&&D(I.error),I.postBody,I.tenantId):null}function W3(){this.b=null,this.a=[]}var P1=null;function N3(I){var V=P1;V.a.push(I),V.b||(V.b=function(ue){for(var Ce=0;Ce Auth section -> Sign in method tab.",I):Ce=="http"||Ce=="https"?ue=rt("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",I):V="operation-not-supported-in-this-environment",M.call(this,V,ue)}S(F5,M);function Tu(I,V,ue){M.call(this,I,ue),I=V||{},I.Kb&&Hr(this,"email",I.Kb),I.ea&&Hr(this,"phoneNumber",I.ea),I.credential&&Hr(this,"credential",I.credential),I.$b&&Hr(this,"tenantId",I.$b)}S(Tu,M),Tu.prototype.w=function(){var I={code:this.code,message:this.message};this.email&&(I.email=this.email),this.phoneNumber&&(I.phoneNumber=this.phoneNumber),this.tenantId&&(I.tenantId=this.tenantId);var V=this.credential&&this.credential.w();return V&&De(I,V),I},Tu.prototype.toJSON=function(){return this.w()};function Iy(I){if(I.code){var V=I.code||"";V.indexOf(E)==0&&(V=V.substring(E.length));var ue={credential:L3(I),$b:I.tenantId};if(I.email)ue.Kb=I.email;else if(I.phoneNumber)ue.ea=I.phoneNumber;else if(!ue.credential)return new M(V,I.message||void 0);return new Tu(V,ue,I.message)}return null}function Xd(){}Xd.prototype.c=null;function k5(I){return I.c||(I.c=I.b())}var zy;function Dy(){}S(Dy,Xd),Dy.prototype.a=function(){var I=U3(this);return I?new ActiveXObject(I):new XMLHttpRequest},Dy.prototype.b=function(){var I={};return U3(this)&&(I[0]=!0,I[1]=!0),I};function U3(I){if(!I.f&&typeof XMLHttpRequest>"u"&&typeof ActiveXObject<"u"){for(var V=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],ue=0;ue=R1(this).value)for(y(V)&&(V=V()),I=new sd(I,String(V),this.f),ue&&(I.a=ue),ue=this;ue;)ue=ue.a};var QA={},q0=null;function B3(I){q0||(q0=new nm(""),QA[""]=q0,q0.c=Ey);var V;if(!(V=QA[I])){V=new nm(I);var ue=I.lastIndexOf("."),Ce=I.substr(ue+1);ue=B3(I.substr(0,ue)),ue.b||(ue.b={}),ue.b[Ce]=V,V.a=ue,QA[I]=V}return V}function oc(I,V){I&&I.log(bS,V,void 0)}function Fy(I){this.f=I}S(Fy,Xd),Fy.prototype.a=function(){return new L5(this.f)},Fy.prototype.b=function(I){return function(){return I}}({});function L5(I){Xl.call(this),this.u=I,this.h=void 0,this.readyState=W5,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.l=new Headers,this.b=null,this.s="GET",this.f="",this.a=!1,this.i=B3("goog.net.FetchXmlHttp"),this.m=this.c=this.g=null}S(L5,Xl);var W5=0;t=L5.prototype,t.open=function(I,V){if(this.readyState!=W5)throw this.abort(),Error("Error reopening a connection");this.s=I,this.f=V,this.readyState=1,ky(this)},t.send=function(I){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.a=!0;var V={headers:this.l,method:this.s,credentials:this.h,cache:void 0};I&&(V.body=I),this.u.fetch(new Request(this.f,V)).then(this.uc.bind(this),this.Va.bind(this))},t.abort=function(){this.response=this.responseText="",this.l=new Headers,this.status=0,this.c&&this.c.cancel("Request was aborted."),1<=this.readyState&&this.a&&this.readyState!=4&&(this.a=!1,Nf(this)),this.readyState=W5},t.uc=function(I){this.a&&(this.g=I,this.b||(this.status=this.g.status,this.statusText=this.g.statusText,this.b=I.headers,this.readyState=2,ky(this)),this.a&&(this.readyState=3,ky(this),this.a&&(this.responseType==="arraybuffer"?I.arrayBuffer().then(this.sc.bind(this),this.Va.bind(this)):typeof s.ReadableStream<"u"&&"body"in I?(this.response=this.responseText="",this.c=I.body.getReader(),this.m=new TextDecoder,b0(this)):I.text().then(this.tc.bind(this),this.Va.bind(this)))))};function b0(I){I.c.read().then(I.pc.bind(I)).catch(I.Va.bind(I))}t.pc=function(I){if(this.a){var V=this.m.decode(I.value?I.value:new Uint8Array(0),{stream:!I.done});V&&(this.response=this.responseText+=V),I.done?Nf(this):ky(this),this.readyState==3&&b0(this)}},t.tc=function(I){this.a&&(this.response=this.responseText=I,Nf(this))},t.sc=function(I){this.a&&(this.response=I,Nf(this))},t.Va=function(I){var V=this.i;V&&V.log(j3,"Failed to fetch url "+this.f,I instanceof Error?I:Error(I)),this.a&&Nf(this)};function Nf(I){I.readyState=4,I.g=null,I.c=null,I.m=null,ky(I)}t.setRequestHeader=function(I,V){this.l.append(I,V)},t.getResponseHeader=function(I){return this.b?this.b.get(I.toLowerCase())||"":((I=this.i)&&I.log(j3,"Attempting to get response header but no headers have been received for url: "+this.f,void 0),"")},t.getAllResponseHeaders=function(){if(!this.b){var I=this.i;return I&&I.log(j3,"Attempting to get all response headers but no headers have been received for url: "+this.f,void 0),""}I=[];for(var V=this.b.entries(),ue=V.next();!ue.done;)ue=ue.value,I.push(ue[0]+": "+ue[1]),ue=V.next();return I.join(`\r +`)};function ky(I){I.onreadystatechange&&I.onreadystatechange.call(I)}Object.defineProperty(L5.prototype,"withCredentials",{get:function(){return this.h==="include"},set:function(I){this.h=I?"include":"same-origin"}});function Ly(I){Xl.call(this),this.headers=new V0,this.D=I||null,this.c=!1,this.C=this.a=null,this.h=this.P=this.l="",this.f=this.N=this.i=this.J=!1,this.g=0,this.s=null,this.m=N5,this.u=this.S=!1}S(Ly,Xl);var N5="";Ly.prototype.b=B3("goog.net.XhrIo");var om=/^https?$/i,h7=["POST","PUT"];function rm(I,V,ue,Ce,_e){if(I.a)throw Error("[goog.net.XhrIo] Object is active with another request="+I.l+"; newUri="+V);ue=ue?ue.toUpperCase():"GET",I.l=V,I.h="",I.P=ue,I.J=!1,I.c=!0,I.a=I.D?I.D.a():zy.a(),I.C=I.D?k5(I.D):k5(zy),I.a.onreadystatechange=A(I.Wb,I);try{oc(I.b,kh(I,"Opening Xhr")),I.N=!0,I.a.open(ue,String(V),!0),I.N=!1}catch(Et){oc(I.b,kh(I,"Error opening Xhr: "+Et.message)),H1(I,Et);return}V=Ce||"";var wt=new V0(I.headers);_e&&A1(_e,function(Et,cn){wt.set(cn,Et)}),_e=fe(wt.Y()),Ce=s.FormData&&V instanceof s.FormData,!ge(h7,ue)||_e||Ce||wt.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),wt.forEach(function(Et,cn){this.a.setRequestHeader(cn,Et)},I),I.m&&(I.a.responseType=I.m),"withCredentials"in I.a&&I.a.withCredentials!==I.S&&(I.a.withCredentials=I.S);try{e4(I),0=V.l&&V.cancel())}this.u?this.u.call(this.s,this):this.v=!0,this.a||(I=new U5,Wy(this),Jd(this,!1,I))}},am.prototype.m=function(I,V){this.i=!1,Jd(this,I,V)};function Jd(I,V,ue){I.a=!0,I.c=ue,I.f=!V,Kd(I)}function Wy(I){if(I.a){if(!I.v)throw new n4;I.v=!1}}function lm(I,V){Ny(I,null,V,void 0)}function Ny(I,V,ue,Ce){I.g.push([V,ue,Ce]),I.a&&Kd(I)}am.prototype.then=function(I,V,ue){var Ce,_e,wt=new jo(function(Et,cn){Ce=Et,_e=cn});return Ny(this,Ce,function(Et){Et instanceof U5?wt.cancel():_e(Et)}),wt.then(I,V,ue)},am.prototype.$goog_Thenable=!0;function S0(I){return ne(I.g,function(V){return y(V[1])})}function Kd(I){if(I.h&&I.a&&S0(I)){var V=I.h,ue=Rp[V];ue&&(s.clearTimeout(ue.a),delete Rp[V]),I.h=0}I.b&&(I.b.l--,delete I.b),V=I.c;for(var Ce=ue=!1;I.g.length&&!I.i;){var _e=I.g.shift(),wt=_e[0],Et=_e[1];if(_e=_e[2],wt=I.f?Et:wt)try{var cn=wt.call(_e||I.s,V);cn!==void 0&&(I.f=I.f&&(cn==V||cn instanceof Error),I.c=V=cn),(N(V)||typeof s.Promise=="function"&&V instanceof s.Promise)&&(Ce=!0,I.i=!0)}catch(ao){V=ao,I.f=!0,S0(I)||(ue=!0)}}I.c=V,Ce&&(cn=A(I.m,I,!0),Ce=A(I.m,I,!1),V instanceof am?(Ny(V,cn,Ce),V.C=!0):V.then(cn,Ce)),ue&&(V=new j5(V),Rp[V.a]=V,I.h=V.a)}function n4(){F.call(this)}S(n4,F),n4.prototype.message="Deferred has already fired",n4.prototype.name="AlreadyCalledError";function U5(){F.call(this)}S(U5,F),U5.prototype.message="Deferred was canceled",U5.prototype.name="CanceledError";function j5(I){this.a=s.setTimeout(A(this.c,this),0),this.b=I}j5.prototype.c=function(){throw delete Rp[this.a],this.b};var Rp={};function O3(I){var V={},ue=V.document||document,Ce=ft(I).toString(),_e=Wo(document,"SCRIPT"),wt={Xb:_e,Ma:void 0},Et=new am(wt),cn=null,ao=V.timeout!=null?V.timeout:5e3;return 0"u"||typeof s.Headers>"u"||typeof s.Request>"u"))throw new M("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.");var Et=new Ly(this.f);if(wt){Et.g=Math.max(0,wt);var cn=setTimeout(function(){Et.dispatchEvent("timeout")},wt)}_0(Et,"complete",function(){cn&&clearTimeout(cn);var ao=null;try{ao=JSON.parse(Uf(this))||null}catch{ao=null}V&&V(ao)}),Hh(Et,"ready",function(){cn&&clearTimeout(cn),Bt(this)}),Hh(Et,"timeout",function(){cn&&clearTimeout(cn),Bt(this),V&&V(null)}),rm(Et,I,ue,Ce,_e)};var qd=new Ye(yt,"https://apis.google.com/js/client.js?onload=%{onload}"),kn="__fcb"+Math.floor(1e6*Math.random()).toString();function Rn(I,V){if(((window.gapi||{}).client||{}).request)I();else{s[kn]=function(){((window.gapi||{}).client||{}).request?I():V(Error("CORS_UNSUPPORTED"))};var ue=ot(qd,{onload:kn});lm(O3(ue),function(){V(Error("CORS_UNSUPPORTED"))})}}Ge.prototype.s=function(I,V,ue,Ce,_e){var wt=this;pt.then(function(){window.gapi.client.setApiKey(wt.c);var Et=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:I,method:ue,body:Ce,headers:_e,authType:"none",callback:function(cn){window.gapi.auth.setToken(Et),V&&V(cn)}})}).o(function(Et){V&&V({error:{message:Et&&Et.message||"CORS_UNSUPPORTED"}})})};function _n(I,V){return new jo(function(ue,Ce){V.grant_type=="refresh_token"&&V.refresh_token||V.grant_type=="authorization_code"&&V.code?T0(I,I.l+"?key="+encodeURIComponent(I.c),function(_e){_e?_e.error?Ce(eI(_e)):_e.access_token&&_e.refresh_token?ue(_e):Ce(new M("internal-error")):Ce(new M("network-request-failed"))},"POST",e7(V).toString(),I.g,I.m.get()):Ce(new M("internal-error"))})}function xr(I,V,ue,Ce,_e,wt,Et){var cn=wu(V+ue);il(cn,"key",I.c),Et&&il(cn,"cb",Date.now().toString());var ao=Ce=="GET";if(ao)for(var Mo in _e)_e.hasOwnProperty(Mo)&&il(cn,Mo,_e[Mo]);return new jo(function(Hi,bl){T0(I,cn.toString(),function(gl){gl?gl.error?bl(eI(gl,wt||{})):Hi(gl):bl(new M("network-request-failed"))},Ce,ao?void 0:Sy(S5(_e)),I.a,I.v.get())})}function Dr(I){if(I=I.email,typeof I!="string"||!m5.test(I))throw new M("invalid-email")}function Qi(I){"email"in I&&Dr(I)}function Bi(I,V){return La(I,Ste,{identifier:V,continueUri:b5()?ui():"http://localhost"}).then(function(ue){return ue.signinMethods||[]})}function oa(I){return La(I,CU,{}).then(function(V){return V.authorizedDomains||[]})}function Oa(I){if(!I[Zt])throw I.mfaPendingCredential?new M("multi-factor-auth-required",null,Ke(I)):new M("internal-error")}function Ta(I){if(I.phoneNumber||I.temporaryProof){if(!I.phoneNumber||!I.temporaryProof)throw new M("internal-error")}else{if(!I.sessionInfo)throw new M("missing-verification-id");if(!I.code)throw new M("missing-verification-code")}}Ge.prototype.Ab=function(){return La(this,HU,{})},Ge.prototype.Cb=function(I,V){return La(this,RU,{idToken:I,email:V})},Ge.prototype.Db=function(I,V){return La(this,KM,{idToken:I,password:V})};var Hp={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};t=Ge.prototype,t.Eb=function(I,V){var ue={idToken:I},Ce=[];return Je(Hp,function(_e,wt){var Et=V[wt];Et===null?Ce.push(_e):wt in V&&(ue[wt]=Et)}),Ce.length&&(ue.deleteAttribute=Ce),La(this,RU,ue)},t.wb=function(I,V){return I={requestType:"PASSWORD_RESET",email:I},De(I,V),La(this,PU,I)},t.xb=function(I,V){return I={requestType:"EMAIL_SIGNIN",email:I},De(I,V),La(this,Rte,I)},t.vb=function(I,V){return I={requestType:"VERIFY_EMAIL",idToken:I},De(I,V),La(this,Hte,I)},t.Fb=function(I,V,ue){return I={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:I,newEmail:V},De(I,ue),La(this,g7,I)};function r4(I,V){return La(I,zte,V)}t.gb=function(I){return La(this,CS,I)};function i4(I,V){return La(I,Dte,V).then(function(ue){return ue.phoneSessionInfo.sessionInfo})}function gi(I){if(!I.phoneVerificationInfo)throw new M("internal-error");if(!I.phoneVerificationInfo.sessionInfo)throw new M("missing-verification-id");if(!I.phoneVerificationInfo.code)throw new M("missing-verification-code")}function SS(I,V){return La(I,qM,V).then(function(ue){return ue.phoneResponseInfo.sessionInfo})}function OM(I,V,ue){return La(I,Pte,{idToken:V,deleteProvider:ue})}function Uy(I){if(!I.requestUri||!I.sessionId&&!I.postBody&&!I.pendingToken)throw new M("internal-error")}function _M(I,V){return V.oauthIdToken&&V.providerId&&V.providerId.indexOf("oidc.")==0&&!V.pendingToken&&(I.sessionId?V.nonce=I.sessionId:I.postBody&&(I=new Vg(I.postBody),ms(I,"nonce")&&(V.nonce=I.get("nonce")))),V}function TS(I){var V=null;if(I.needConfirmation?(I.code="account-exists-with-different-credential",V=Iy(I)):I.errorMessage=="FEDERATED_USER_ID_ALREADY_LINKED"?(I.code="credential-already-in-use",V=Iy(I)):I.errorMessage=="EMAIL_EXISTS"?(I.code="email-already-in-use",V=Iy(I)):I.errorMessage&&(V=ZM(I.errorMessage)),V)throw V;Oa(I)}function PS(I,V){return V.returnIdpCredential=!0,La(I,MU,V)}function Q0(I,V){return V.returnIdpCredential=!0,La(I,$M,V)}function VM(I,V){return V.returnIdpCredential=!0,V.autoCreate=!1,La(I,m7,V)}function GM(I){if(!I.oobCode)throw new M("invalid-action-code")}t.ob=function(I,V){return La(this,Ite,{oobCode:I,newPassword:V})},t.Sa=function(I){return La(this,bte,{oobCode:I})},t.kb=function(I){return La(this,SU,{oobCode:I})};var SU={endpoint:"setAccountInfo",A:GM,Z:"email",B:!0},bte={endpoint:"resetPassword",A:GM,G:function(I){var V=I.requestType;if(!V||!I.email&&V!="EMAIL_SIGNIN"&&V!="VERIFY_AND_CHANGE_EMAIL")throw new M("internal-error")},B:!0},TU={endpoint:"signupNewUser",A:function(I){if(Dr(I),!I.password)throw new M("weak-password")},G:Oa,V:!0,B:!0},Ste={endpoint:"createAuthUri",B:!0},Tte={endpoint:"deleteAccount",O:["idToken"]},Pte={endpoint:"setAccountInfo",O:["idToken","deleteProvider"],A:function(I){if(!Array.isArray(I.deleteProvider))throw new M("internal-error")}},jy={endpoint:"emailLinkSignin",O:["email","oobCode"],A:Dr,G:Oa,V:!0,B:!0},$d={endpoint:"emailLinkSignin",O:["idToken","email","oobCode"],A:Dr,G:Oa,V:!0},XM={endpoint:"accounts/mfaEnrollment:finalize",O:["idToken","phoneVerificationInfo"],A:gi,G:Oa,B:!0,Na:!0},Cte={endpoint:"accounts/mfaSignIn:finalize",O:["mfaPendingCredential","phoneVerificationInfo"],A:gi,G:Oa,B:!0,Na:!0},JM={endpoint:"getAccountInfo"},Rte={endpoint:"getOobConfirmationCode",O:["requestType"],A:function(I){if(I.requestType!="EMAIL_SIGNIN")throw new M("internal-error");Dr(I)},Z:"email",B:!0},Hte={endpoint:"getOobConfirmationCode",O:["idToken","requestType"],A:function(I){if(I.requestType!="VERIFY_EMAIL")throw new M("internal-error")},Z:"email",B:!0},g7={endpoint:"getOobConfirmationCode",O:["idToken","newEmail","requestType"],A:function(I){if(I.requestType!="VERIFY_AND_CHANGE_EMAIL")throw new M("internal-error")},Z:"email",B:!0},PU={endpoint:"getOobConfirmationCode",O:["requestType"],A:function(I){if(I.requestType!="PASSWORD_RESET")throw new M("internal-error");Dr(I)},Z:"email",B:!0},CU={mb:!0,endpoint:"getProjectConfig",Vb:"GET"},Mte={mb:!0,endpoint:"getRecaptchaParam",Vb:"GET",G:function(I){if(!I.recaptchaSiteKey)throw new M("internal-error")}},Ite={endpoint:"resetPassword",A:GM,Z:"email",B:!0},zte={endpoint:"sendVerificationCode",O:["phoneNumber","recaptchaToken"],Z:"sessionInfo",B:!0},RU={endpoint:"setAccountInfo",O:["idToken"],A:Qi,V:!0},KM={endpoint:"setAccountInfo",O:["idToken"],A:function(I){if(Qi(I),!I.password)throw new M("weak-password")},G:Oa,V:!0},HU={endpoint:"signupNewUser",G:Oa,V:!0,B:!0},Dte={endpoint:"accounts/mfaEnrollment:start",O:["idToken","phoneEnrollmentInfo"],A:function(I){if(!I.phoneEnrollmentInfo)throw new M("internal-error");if(!I.phoneEnrollmentInfo.phoneNumber)throw new M("missing-phone-number");if(!I.phoneEnrollmentInfo.recaptchaToken)throw new M("missing-app-credential")},G:function(I){if(!I.phoneSessionInfo||!I.phoneSessionInfo.sessionInfo)throw new M("internal-error")},B:!0,Na:!0},qM={endpoint:"accounts/mfaSignIn:start",O:["mfaPendingCredential","mfaEnrollmentId","phoneSignInInfo"],A:function(I){if(!I.phoneSignInInfo||!I.phoneSignInInfo.recaptchaToken)throw new M("missing-app-credential")},G:function(I){if(!I.phoneResponseInfo||!I.phoneResponseInfo.sessionInfo)throw new M("internal-error")},B:!0,Na:!0},MU={endpoint:"verifyAssertion",A:Uy,Za:_M,G:TS,V:!0,B:!0},m7={endpoint:"verifyAssertion",A:Uy,Za:_M,G:function(I){if(I.errorMessage&&I.errorMessage=="USER_NOT_FOUND")throw new M("user-not-found");if(I.errorMessage)throw ZM(I.errorMessage);Oa(I)},V:!0,B:!0},$M={endpoint:"verifyAssertion",A:function(I){if(Uy(I),!I.idToken)throw new M("internal-error")},Za:_M,G:TS,V:!0},IU={endpoint:"verifyCustomToken",A:function(I){if(!I.token)throw new M("invalid-custom-token")},G:Oa,V:!0,B:!0},QM={endpoint:"verifyPassword",A:function(I){if(Dr(I),!I.password)throw new M("wrong-password")},G:Oa,V:!0,B:!0},CS={endpoint:"verifyPhoneNumber",A:Ta,G:Oa,B:!0},zU={endpoint:"verifyPhoneNumber",A:function(I){if(!I.idToken)throw new M("internal-error");Ta(I)},G:function(I){if(I.temporaryProof)throw I.code="credential-already-in-use",Iy(I);Oa(I)}},sm={Ib:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",A:Ta,G:Oa,B:!0},V3={endpoint:"accounts/mfaEnrollment:withdraw",O:["idToken","mfaEnrollmentId"],G:function(I){if(!!I[Zt]^!!I.refreshToken)throw new M("internal-error")},B:!0,Na:!0};function La(I,V,ue){if(!Py(ue,V.O))return bi(new M("internal-error"));var Ce=!!V.Na,_e=V.Vb||"POST",wt;return Eo(ue).then(V.A).then(function(){return V.V&&(ue.returnSecureToken=!0),V.B&&I.b&&typeof ue.tenantId>"u"&&(ue.tenantId=I.b),Ce?xr(I,I.i,V.endpoint,_e,ue,V.Ib,V.mb||!1):xr(I,I.h,V.endpoint,_e,ue,V.Ib,V.mb||!1)}).then(function(Et){return wt=Et,V.Za?V.Za(ue,wt):wt}).then(V.G).then(function(){if(!V.Z)return wt;if(!(V.Z in wt))throw new M("internal-error");return wt[V.Z]})}function ZM(I){return eI({error:{errors:[{message:I}],code:400,message:I}})}function eI(I,V){var ue=(I.error&&I.error.errors&&I.error.errors[0]||{}).reason||"",Ce={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(ue=Ce[ue]?new M(Ce[ue]):null)return ue;ue=I.error&&I.error.message||"",Ce={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_OR_INVALID_NONCE:"missing-or-invalid-nonce",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",INVALID_PROVIDER_ID:"invalid-provider-id",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",REJECTED_CREDENTIAL:"rejected-credential",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_DYNAMIC_LINK_DOMAIN:"invalid-dynamic-link-domain",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash",UNSUPPORTED_TENANT_OPERATION:"unsupported-tenant-operation",INVALID_TENANT_ID:"invalid-tenant-id",TENANT_ID_MISMATCH:"tenant-id-mismatch",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",EMAIL_CHANGE_NEEDS_VERIFICATION:"email-change-needs-verification",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",UNSUPPORTED_FIRST_FACTOR:"unsupported-first-factor",UNVERIFIED_EMAIL:"unverified-email"},De(Ce,V||{}),V=(V=ue.match(/^[^\s]+\s*:\s*([\s\S]*)$/))&&1"u"&&delete cn[ao]}),I.ports[0].postMessage({status:"done",eventId:ue,eventType:V,response:Et})})}};function Lh(I,V,ue){We(I.a)&&I.b.addEventListener("message",I.f),typeof I.a[V]>"u"&&(I.a[V]=[]),I.a[V].push(ue)}function UU(I){this.a=I}UU.prototype.postMessage=function(I,V){this.a.postMessage(I,V)};function jU(I){this.c=I,this.b=!1,this.a=[]}function BU(I,V,ue,Ce){var _e,wt=ue||{},Et,cn,ao,Mo=null;if(I.b)return bi(Error("connection_unavailable"));var Hi=Ce?800:50,bl=typeof MessageChannel<"u"?new MessageChannel:null;return new jo(function(gl,Z0){bl?(_e=Math.floor(Math.random()*Math.pow(10,20)).toString(),bl.port1.start(),cn=setTimeout(function(){Z0(Error("unsupported_event"))},Hi),Et=function(Oy){Oy.data.eventId===_e&&(Oy.data.status==="ack"?(clearTimeout(cn),ao=setTimeout(function(){Z0(Error("timeout"))},3e3)):Oy.data.status==="done"?(clearTimeout(ao),typeof Oy.data.response<"u"?gl(Oy.data.response):Z0(Error("unknown_error"))):(clearTimeout(cn),clearTimeout(ao),Z0(Error("invalid_response"))))},Mo={messageChannel:bl,onMessage:Et},I.a.push(Mo),bl.port1.addEventListener("message",Et),I.c.postMessage({eventType:V,eventId:_e,data:wt},[bl.port2])):Z0(Error("connection_unavailable"))}).then(function(gl){return IS(I,Mo),gl}).o(function(gl){throw IS(I,Mo),gl})}function IS(I,V){if(V){var ue=V.messageChannel,Ce=V.onMessage;ue&&(ue.port1.removeEventListener("message",Ce),ue.port1.close()),Z(I.a,function(_e){return _e==V})}}jU.prototype.close=function(){for(;0"u"&&(Ce=null);var _e=s.localStorage.getItem(ue);_e!==Ce&&(this.b[ue]=_e,this.nb(ue))}else if(V.indexOf("firebase:")==0&&this.a[V]){if(typeof I.a.a<"u"?G3(this,"local").ia(this.f):cI(this),this.m){if(ue=s.localStorage.getItem(V),Ce=I.a.newValue,Ce!==ue)Ce!==null?s.localStorage.setItem(V,Ce):s.localStorage.removeItem(V);else if(this.b[V]===Ce&&typeof I.a.a>"u")return}var wt=this;ue=function(){(typeof I.a.a<"u"||wt.b[V]!==s.localStorage.getItem(V))&&(wt.b[V]=s.localStorage.getItem(V),wt.nb(V))},lt&&mo&&mo==10&&s.localStorage.getItem(V)!==I.a.newValue&&I.a.newValue!==I.a.oldValue?setTimeout(ue,10):ue()}}else te(I,A(this.nb,this))},t.nb=function(I){this.a[I]&&te(this.a[I],function(V){V()})};function ene(I){this.a=I,this.b=x7()}var uI={name:"authEvent",F:"local"};function tne(I){return I.b.get(uI,I.a).then(function(V){return $A(V)})}function nne(){this.a=x7()}function one(){this.b=-1}function ES(I,V){this.b=QU,this.f=s.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=I,this.h=V,this.l=s.Int32Array?new Int32Array(64):Array(64),FS===void 0&&(s.Int32Array?FS=new Int32Array(pI):FS=pI),this.reset()}var FS;S(ES,one);for(var QU=64,rne=QU-1,ZU=[],dI=0;dIV;V++){_e=ue[V-15]|0,Ce=ue[V-2]|0;var wt=(ue[V-16]|0)+((_e>>>7|_e<<25)^(_e>>>18|_e<<14)^_e>>>3)|0,Et=(ue[V-7]|0)+((Ce>>>17|Ce<<15)^(Ce>>>19|Ce<<13)^Ce>>>10)|0;ue[V]=wt+Et|0}Ce=I.a[0]|0,_e=I.a[1]|0;var cn=I.a[2]|0,ao=I.a[3]|0,Mo=I.a[4]|0,Hi=I.a[5]|0,bl=I.a[6]|0;for(wt=I.a[7]|0,V=0;64>V;V++){var gl=((Ce>>>2|Ce<<30)^(Ce>>>13|Ce<<19)^(Ce>>>22|Ce<<10))+(Ce&_e^Ce&cn^_e&cn)|0;Et=Mo&Hi^~Mo&bl,wt=wt+((Mo>>>6|Mo<<26)^(Mo>>>11|Mo<<21)^(Mo>>>25|Mo<<7))|0,Et=Et+(FS[V]|0)|0,Et=wt+(Et+(ue[V]|0)|0)|0,wt=bl,bl=Hi,Hi=Mo,Mo=ao+Et|0,ao=cn,cn=_e,_e=Ce,Ce=Et+gl|0}I.a[0]=I.a[0]+Ce|0,I.a[1]=I.a[1]+_e|0,I.a[2]=I.a[2]+cn|0,I.a[3]=I.a[3]+ao|0,I.a[4]=I.a[4]+Mo|0,I.a[5]=I.a[5]+Hi|0,I.a[6]=I.a[6]+bl|0,I.a[7]=I.a[7]+wt|0}function hI(I,V,ue){ue===void 0&&(ue=V.length);var Ce=0,_e=I.c;if(typeof V=="string")for(;Ce=wt&&wt==(wt|0)))throw Error("message must be a byte array");I.f[_e++]=wt,_e==I.b&&(fI(I),_e=0)}else throw Error("message must be string or array");I.c=_e,I.g+=ue}var pI=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function gI(){ES.call(this,8,ine)}S(gI,ES);var ine=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function tj(I,V,ue,Ce,_e,wt){this.v=I,this.i=V,this.l=ue,this.m=Ce||null,this.u=_e||null,this.s=wt,this.h=V+":"+ue,this.C=new nne,this.g=new ene(this.h),this.f=null,this.b=[],this.a=this.c=null}function kS(I){return new M("invalid-cordova-configuration",I)}t=tj.prototype,t.ma=function(){return this.Ia?this.Ia:this.Ia=y5().then(function(){if(typeof Jl("universalLinks.subscribe",s)!="function")throw kS("cordova-universal-links-plugin-fix is not installed");if(typeof Jl("BuildInfo.packageName",s)>"u")throw kS("cordova-plugin-buildinfo is not installed");if(typeof Jl("cordova.plugins.browsertab.openUrl",s)!="function")throw kS("cordova-plugin-browsertab is not installed");if(typeof Jl("cordova.InAppBrowser.open",s)!="function")throw kS("cordova-plugin-inappbrowser is not installed")},function(){throw new M("cordova-not-ready")})};function ane(){for(var I=20,V=[];0V.c?hI(V,ej,56-V.c):hI(V,ej,V.b-(V.c-56));for(var Ce=63;56<=Ce;Ce--)V.f[Ce]=ue&255,ue/=256;for(fI(V),Ce=ue=0;Ce>_e&255;return jM(I)}t.Pb=function(I,V){return V(new M("operation-not-supported-in-this-environment")),Eo()},t.Nb=function(){return bi(new M("operation-not-supported-in-this-environment"))},t.ac=function(){return!1},t.Yb=function(){return!0},t.Ub=function(){return!0},t.Ob=function(I,V,ue,Ce){if(this.c)return bi(new M("redirect-operation-pending"));var _e=this,wt=s.document,Et=null,cn=null,ao=null,Mo=null;return this.c=Eo().then(function(){return tm(V),oj(_e)}).then(function(){return lne(_e,I,V,ue,Ce)}).then(function(){return new jo(function(Hi,bl){cn=function(){var gl=Jl("cordova.plugins.browsertab.close",s);return Hi(),typeof gl=="function"&&gl(),_e.a&&typeof _e.a.close=="function"&&(_e.a.close(),_e.a=null),!1},_e.Ea(cn),ao=function(){Et||(Et=Gc(2e3).then(function(){bl(new M("redirect-cancelled-by-user"))}))},Mo=function(){zA()&&ao()},wt.addEventListener("resume",ao,!1),tc().toLowerCase().match(/android/)||wt.addEventListener("visibilitychange",Mo,!1)}).o(function(Hi){return mI(_e).then(function(){throw Hi})})}).oa(function(){ao&&wt.removeEventListener("resume",ao,!1),Mo&&wt.removeEventListener("visibilitychange",Mo,!1),Et&&Et.cancel(),cn&&_e.Ta(cn),_e.c=null})};function lne(I,V,ue,Ce,_e){var wt=ane(),Et=new ql(V,Ce,null,wt,new M("no-auth-event"),null,_e),cn=Jl("BuildInfo.packageName",s);if(typeof cn!="string")throw new M("invalid-cordova-configuration");var ao=Jl("BuildInfo.displayName",s),Mo={};if(tc().toLowerCase().match(/iphone|ipad|ipod/))Mo.ibi=cn;else if(tc().toLowerCase().match(/android/))Mo.apn=cn;else return bi(new M("operation-not-supported-in-this-environment"));ao&&(Mo.appDisplayName=ao),wt=LS(wt),Mo.sessionId=wt;var Hi=a4(I.v,I.i,I.l,V,ue,null,Ce,I.m,Mo,I.u,_e,I.s);return I.ma().then(function(){var bl=I.h;return I.C.a.set(uI,Et.w(),bl)}).then(function(){var bl=Jl("cordova.plugins.browsertab.isAvailable",s);if(typeof bl!="function")throw new M("invalid-cordova-configuration");var gl=null;bl(function(Z0){if(Z0){if(gl=Jl("cordova.plugins.browsertab.openUrl",s),typeof gl!="function")throw new M("invalid-cordova-configuration");gl(Hi)}else{if(gl=Jl("cordova.InAppBrowser.open",s),typeof gl!="function")throw new M("invalid-cordova-configuration");Z0=tc(),I.a=gl(Hi,Z0.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||Z0.match(/(iPad|iPhone|iPod).*OS 8_\d/i)?"_blank":"_system","location=yes")}})})}function nj(I,V){for(var ue=0;ueI.f&&(I.a=I.f),V)}function RI(I,V){I.stop(),I.b=Gc(Ane(I,V)).then(function(){return n7()}).then(function(){return I.h()}).then(function(){RI(I,!0)}).o(function(ue){I.i(ue)&&RI(I,!1)})}CI.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)};function C7(I){this.f=I,this.b=this.a=null,this.c=Date.now()}C7.prototype.w=function(){return{apiKey:this.f.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:this.c}};function mj(I,V){typeof V>"u"&&(I.b?(V=I.b,V=V.a-V.g):V=0),I.c=Date.now()+1e3*V}function um(I,V){I.b=H5(V[Zt]||""),I.a=V.refreshToken,V=V.expiresIn,mj(I,typeof V<"u"?Number(V):void 0)}function yj(I,V){I.b=V.b,I.a=V.a,I.c=V.c}function BS(I,V){return _n(I.f,V).then(function(ue){return I.b=H5(ue.access_token),I.a=ue.refresh_token,mj(I,ue.expires_in),{accessToken:I.b.toString(),refreshToken:I.a}}).o(function(ue){throw ue.code=="auth/user-token-expired"&&(I.a=null),ue})}C7.prototype.getToken=function(I){return I=!!I,this.b&&!this.a?bi(new M("user-token-expired")):I||!this.b||Date.now()>this.c-3e4?this.a?BS(this,{grant_type:"refresh_token",refresh_token:this.a}):Eo(null):Eo({accessToken:this.b.toString(),refreshToken:this.a})};function As(I,V){this.a=I||null,this.b=V||null,qc(this,{lastSignInTime:H3(V||null),creationTime:H3(I||null)})}function Ec(I){return new As(I.a,I.b)}As.prototype.w=function(){return{lastLoginAt:this.b,createdAt:this.a}};function Aj(I,V,ue,Ce,_e,wt){qc(this,{uid:I,displayName:Ce||null,photoURL:_e||null,email:ue||null,phoneNumber:wt||null,providerId:V})}function Wh(I,V,ue){this.N=[],this.l=I.apiKey,this.m=I.appName,this.s=I.authDomain||null;var Ce=$n.SDK_VERSION?Jg($n.SDK_VERSION):null;this.a=new Ge(this.l,L(k),Ce),(this.u=I.emulatorConfig||null)&&Gr(this.a,this.u),this.h=new C7(this.a),_S(this,V[Zt]),um(this.h,V),Hr(this,"refreshToken",this.h.a),wj(this,ue||{}),Xl.call(this),this.P=!1,this.s&&td()&&(this.b=c4(this.s,this.l,this.m,this.u)),this.W=[],this.i=null,this.D=H7(this),this.ba=A(this.ib,this);var _e=this;this.za=null,this.Pa=function(wt){_e.xa(wt.h)},this.qa=null,this.Ba=function(wt){HI(_e,wt.c)},this.$=null,this.aa=[],this.Oa=function(wt){R7(_e,wt.f)},this.ja=null,this.S=new cm(this,ue),Hr(this,"multiFactor",this.S)}S(Wh,Xl),Wh.prototype.xa=function(I){this.za=I,zi(this.a,I)};function HI(I,V){I.u=V,Gr(I.a,V),I.b&&(V=I.b,I.b=c4(I.s,I.l,I.m,I.u),I.P&&(T7(V,I),S7(I.b,I)))}Wh.prototype.la=function(){return this.za};function MI(I,V){I.qa&&Or(I.qa,"languageCodeChanged",I.Pa),(I.qa=V)&&qn(V,"languageCodeChanged",I.Pa)}function II(I,V){I.$&&Or(I.$,"emulatorConfigChanged",I.Ba),(I.$=V)&&qn(V,"emulatorConfigChanged",I.Ba)}function R7(I,V){I.aa=V,_r(I.a,$n.SDK_VERSION?Jg($n.SDK_VERSION,I.aa):null)}Wh.prototype.Ga=function(){return xe(this.aa)};function zI(I,V){I.ja&&Or(I.ja,"frameworkChanged",I.Oa),(I.ja=V)&&qn(V,"frameworkChanged",I.Oa)}Wh.prototype.ib=function(){this.D.b&&(this.D.stop(),this.D.start())};function YS(I){try{return $n.app(I.m).auth()}catch{throw new M("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+I.m+"'!")}}function H7(I){return new CI(function(){return I.I(!0)},function(V){return!!(V&&V.code=="auth/network-request-failed")},function(){var V=I.h.c-Date.now()-3e5;return 0"u"||We(I)?{}:OA(new xu(I))}).then(function(Ce){return V.a.vb(ue,Ce)}).then(function(Ce){if(V.email!=Ce)return V.reload()}).then(function(){}))},t.Fb=function(I,V){var ue=this,Ce=null;return C0(this,this.I().then(function(_e){return Ce=_e,typeof V>"u"||We(V)?{}:OA(new xu(V))}).then(function(_e){return ue.a.Fb(Ce,I,_e)}).then(function(_e){if(ue.email!=_e)return ue.reload()}).then(function(){}))};function C0(I,V,ue){var Ce=vne(I,V,ue);return I.N.push(Ce),Ce.oa(function(){de(I.N,Ce)}),Ce.o(function(_e){var wt=null;throw _e&&_e.code==="auth/multi-factor-auth-required"&&(wt=gj(_e.w(),YS(I),A(I.jc,I))),wt||_e})}t.jc=function(I){var V=null,ue=this;return I=Ry(Eo(I),ue.uid).then(function(Ce){return V=M7(ue,Ce,"reauthenticate"),$c(ue,Ce),ue.i=null,ue.reload()}).then(function(){return V}),C0(this,I,!0)};function vne(I,V,ue){return I.i&&!ue?(V.cancel(),bi(I.i)):V.o(function(Ce){throw!Ce||Ce.code!="auth/user-disabled"&&Ce.code!="auth/user-token-expired"||(I.i||I.dispatchEvent(new d4("userInvalidated")),I.i=Ce),Ce})}t.toJSON=function(){return this.w()},t.w=function(){var I={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,tenantId:this.tenantId,providerData:[],apiKey:this.l,appName:this.m,authDomain:this.s,stsTokenManager:this.h.w(),redirectEventId:this.ga||null};return this.metadata&&De(I,this.metadata.w()),te(this.providerData,function(V){I.providerData.push(C5(V))}),De(I,this.S.w()),I};function Tj(I){if(!I.apiKey)return null;var V={apiKey:I.apiKey,authDomain:I.authDomain,appName:I.appName,emulatorConfig:I.emulatorConfig},ue={};if(I.stsTokenManager&&I.stsTokenManager.accessToken){ue[Zt]=I.stsTokenManager.accessToken,ue.refreshToken=I.stsTokenManager.refreshToken||null;var Ce=I.stsTokenManager.expirationTime;Ce&&(ue.expiresIn=(Ce-Date.now())/1e3)}else return null;var _e=new Wh(V,ue,I);return I.providerData&&te(I.providerData,function(wt){wt&&kI(_e,kf(wt))}),I.redirectEventId&&(_e.ga=I.redirectEventId),_e}function xne(I,V,ue,Ce){var _e=new Wh(I,V);return ue&&(_e.ha=ue),Ce&&R7(_e,Ce),_e.reload().then(function(){return _e})}function bne(I,V,ue,Ce){var _e=I.h,wt={};return wt[Zt]=_e.b&&_e.b.toString(),wt.refreshToken=_e.a,V=new Wh(V||{apiKey:I.l,authDomain:I.s,appName:I.m},wt),ue&&(V.ha=ue),Ce&&R7(V,Ce),Gi(V,I),V}function Sne(I){this.a=I,this.b=x7()}var NI={name:"redirectUser",F:"session"};function Pj(I){return By(I.b,NI,I.a)}function Tne(I,V){return I.b.get(NI,I.a).then(function(ue){return ue&&V&&(ue.authDomain=V),Tj(ue||{})})}function UI(I){this.a=I,this.b=x7(),this.c=null,this.f=BI(this),this.b.addListener(Ip("local"),this.a,A(this.g,this))}UI.prototype.g=function(){var I=this,V=Ip("local");H0(this,function(){return Eo().then(function(){return I.c&&I.c.F!="local"?I.b.get(V,I.a):null}).then(function(ue){if(ue)return jI(I,"local").then(function(){I.c=V})})})};function jI(I,V){var ue=[],Ce;for(Ce in s4)s4[Ce]!==V&&ue.push(By(I.b,Ip(s4[Ce]),I.a));return ue.push(By(I.b,YI,I.a)),nr(ue)}function BI(I){var V=Ip("local"),ue=Ip("session"),Ce=Ip("none");return Qte(I.b,V,I.a).then(function(){return I.b.get(ue,I.a)}).then(function(_e){return _e?ue:I.b.get(Ce,I.a).then(function(wt){return wt?Ce:I.b.get(V,I.a).then(function(Et){return Et?V:I.b.get(YI,I.a).then(function(cn){return cn?Ip(cn):V})})})}).then(function(_e){return I.c=_e,jI(I,_e.F)}).o(function(){I.c||(I.c=V)})}var YI={name:"persistence",F:"session"};function Ip(I){return{name:"authUser",F:I}}UI.prototype.yb=function(I){var V=null,ue=this;return $te(I),H0(this,function(){return I!=ue.c.F?ue.b.get(ue.c,ue.a).then(function(Ce){return V=Ce,jI(ue,I)}).then(function(){if(ue.c=Ip(I),V)return ue.b.set(ue.c,V,ue.a)}):Eo()})};function Pne(I){return H0(I,function(){return I.b.set(YI,I.c.F,I.a)})}function Cj(I,V){return H0(I,function(){return I.b.set(I.c,V.w(),I.a)})}function Rj(I){return H0(I,function(){return By(I.b,I.c,I.a)})}function R0(I,V,ue){return H0(I,function(){return I.b.get(I.c,I.a).then(function(Ce){return Ce&&V&&(Ce.authDomain=V),Ce&&ue&&(Ce.emulatorConfig=ue),Tj(Ce||{})})})}function H0(I,V){return I.f=I.f.then(V,V),I.f}function I1(I){if(this.l=!1,Hr(this,"settings",new hj),Hr(this,"app",I),$l(this).options&&$l(this).options.apiKey)I=$n.SDK_VERSION?Jg($n.SDK_VERSION):null,this.a=new Ge($l(this).options&&$l(this).options.apiKey,L(k),I);else throw new M("invalid-api-key");this.P=[],this.s=[],this.N=[],this.Pa=$n.INTERNAL.createSubscribe(A(this.zc,this)),this.W=void 0,this.ib=$n.INTERNAL.createSubscribe(A(this.Ac,this)),f4(this,null),this.i=new UI($l(this).options.apiKey+":"+$l(this).name),this.D=new Sne($l(this).options.apiKey+":"+$l(this).name),this.$=Fc(this,Ej(this)),this.h=Fc(this,Mne(this)),this.ba=!1,this.ja=A(this.Zc,this),this.Ba=A(this.da,this),this.qa=A(this.mc,this),this.za=A(this.wc,this),this.Aa=A(this.xc,this),this.b=null,Ij(this),this.INTERNAL={},this.INTERNAL.delete=A(this.delete,this),this.INTERNAL.logFramework=A(this.Gc,this),this.u=0,Xl.call(this),Rne(this),this.J=[],this.R=null}S(I1,Xl);function Hj(I){Lt.call(this,"languageCodeChanged"),this.h=I}S(Hj,Lt);function Mj(I){Lt.call(this,"emulatorConfigChanged"),this.c=I}S(Mj,Lt);function OI(I){Lt.call(this,"frameworkChanged"),this.f=I}S(OI,Lt),t=I1.prototype,t.yb=function(I){return I=this.i.yb(I),Fc(this,I)},t.xa=function(I){this.aa===I||this.l||(this.aa=I,zi(this.a,this.aa),this.dispatchEvent(new Hj(this.la())))},t.la=function(){return this.aa},t.fd=function(){var I=s.navigator;this.xa(I&&(I.languages&&I.languages[0]||I.language||I.userLanguage)||null)},t.gd=function(I,V){if(!this.R){if(!/^https?:\/\//.test(I))throw new M("argument-error","Emulator URL must start with a valid scheme (http:// or https://).");V=V?!!V.disableWarnings:!1,Cne(V),this.R={url:I,ec:V},this.settings.jb=!0,Gr(this.a,this.R),this.dispatchEvent(new Mj(this.R))}};function Cne(I){typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),s.document&&!I&&Ws().then(function(){var V=s.document.createElement("div");V.innerText="Running in emulator mode. Do not use with production credentials.",V.style.position="fixed",V.style.width="100%",V.style.backgroundColor="#ffffff",V.style.border=".1em solid #000000",V.style.color="#b50000",V.style.bottom="0px",V.style.left="0px",V.style.margin="0px",V.style.zIndex=1e4,V.style.textAlign="center",V.classList.add("firebase-emulator-warning"),s.document.body.appendChild(V)})}t.Gc=function(I){this.J.push(I),_r(this.a,$n.SDK_VERSION?Jg($n.SDK_VERSION,this.J):null),this.dispatchEvent(new OI(this.J))},t.Ga=function(){return xe(this.J)},t.zb=function(I){this.S===I||this.l||(this.S=I,this.a.b=this.S)},t.T=function(){return this.S};function Rne(I){Object.defineProperty(I,"lc",{get:function(){return this.la()},set:function(V){this.xa(V)},enumerable:!1}),I.aa=null,Object.defineProperty(I,"ti",{get:function(){return this.T()},set:function(V){this.zb(V)},enumerable:!1}),I.S=null,Object.defineProperty(I,"emulatorConfig",{get:function(){if(this.R){var V=wu(this.R.url);V=kf({protocol:V.c,host:V.a,port:V.g,options:kf({disableWarnings:this.R.ec})})}else V=null;return V},enumerable:!1})}t.toJSON=function(){return{apiKey:$l(this).options.apiKey,authDomain:$l(this).options.authDomain,appName:$l(this).name,currentUser:aa(this)&&aa(this).w()}};function _I(I){return I.Oa||bi(new M("auth-domain-config-required"))}function Ij(I){var V=$l(I).options.authDomain,ue=$l(I).options.apiKey;V&&td()&&(I.Oa=I.$.then(function(){if(!I.l){if(I.b=c4(V,ue,$l(I).name,I.R),S7(I.b,I),aa(I)&&dm(aa(I)),I.m){dm(I.m);var Ce=I.m;Ce.xa(I.la()),MI(Ce,I),Ce=I.m,R7(Ce,I.J),zI(Ce,I),Ce=I.m,HI(Ce,I.R),II(Ce,I),I.m=null}return I.b}}))}t.Gb=function(I,V){switch(I){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==V&&!!this.f;default:return!1}},t.na=function(I,V,ue,Ce){I=="signInViaPopup"&&this.g==Ce&&(ue&&this.C?this.C(ue):V&&!ue&&this.f&&this.f(V),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.C)},t.Fa=function(I,V){return I=="signInViaRedirect"||I=="signInViaPopup"&&this.g==V&&this.f?A(this.ic,this):null},t.ic=function(I,V,ue,Ce){var _e=this,wt={requestUri:I,postBody:Ce,sessionId:V,tenantId:ue};return this.c&&(this.c.cancel(),this.c=null),_e.$.then(function(){return K3(_e,PS(_e.a,wt))})},t.Xc=function(I){if(!td())return bi(new M("operation-not-supported-in-this-environment"));var V=this,ue=E3(I.providerId),Ce=Kg(),_e=null;(!nd()||R3())&&$l(this).options.authDomain&&I.isOAuthProvider&&(_e=a4($l(this).options.authDomain,$l(this).options.apiKey,$l(this).name,"signInViaPopup",I,null,Ce,$n.SDK_VERSION||null,null,null,this.T(),this.R));var wt=G0(_e,ue&&ue.va,ue&&ue.ua);return ue=_I(this).then(function(Et){return vI(Et,wt,"signInViaPopup",I,Ce,!!_e,V.T())}).then(function(){return new jo(function(Et,cn){V.na("signInViaPopup",null,new M("cancelled-popup-request"),V.g),V.f=Et,V.C=cn,V.g=Ce,V.c=sj(V.b,V,"signInViaPopup",wt,Ce)})}).then(function(Et){return wt&&ys(wt),Et?kf(Et):null}).o(function(Et){throw wt&&ys(wt),Et}),Fc(this,ue)},t.Yc=function(I){if(!td())return bi(new M("operation-not-supported-in-this-environment"));var V=this,ue=_I(this).then(function(){return Pne(V.i)}).then(function(){return lj(V.b,"signInViaRedirect",I,void 0,V.T())});return Fc(this,ue)};function zj(I){if(!td())return bi(new M("operation-not-supported-in-this-environment"));var V=_I(I).then(function(){return I.b.ra()}).then(function(ue){return ue?kf(ue):null});return Fc(I,V)}t.ra=function(){var I=this;return zj(this).then(function(V){return I.b&&u4(I.b.b),V}).o(function(V){throw I.b&&u4(I.b.b),V})},t.dd=function(I){if(!I)return bi(new M("null-user"));if(this.S!=I.tenantId)return bi(new M("tenant-id-mismatch"));var V=this,ue={};ue.apiKey=$l(this).options.apiKey,ue.authDomain=$l(this).options.authDomain,ue.appName=$l(this).name;var Ce=bne(I,ue,V.D,V.Ga());return Fc(this,this.h.then(function(){if($l(V).options.apiKey!=I.l)return Ce.reload()}).then(function(){return aa(V)&&I.uid==aa(V).uid?(Gi(aa(V),I),V.da(I)):(f4(V,Ce),dm(Ce),V.da(Ce))}).then(function(){z7(V)}))};function Hne(I,V){var ue={};return ue.apiKey=$l(I).options.apiKey,ue.authDomain=$l(I).options.authDomain,ue.appName=$l(I).name,I.R&&(ue.emulatorConfig=I.R),I.$.then(function(){return xne(ue,V,I.D,I.Ga())}).then(function(Ce){return aa(I)&&Ce.uid==aa(I).uid?(Gi(aa(I),Ce),I.da(Ce)):(f4(I,Ce),dm(Ce),I.da(Ce))}).then(function(){z7(I)})}function f4(I,V){aa(I)&&(VS(aa(I),I.Ba),Or(aa(I),"tokenChanged",I.qa),Or(aa(I),"userDeleted",I.za),Or(aa(I),"userInvalidated",I.Aa),DI(aa(I))),V&&(V.W.push(I.Ba),qn(V,"tokenChanged",I.qa),qn(V,"userDeleted",I.za),qn(V,"userInvalidated",I.Aa),0this.u&&(this.u=0),this.u==0&&aa(this)&&DI(aa(this)),this.removeAuthTokenListener(I)},t.addAuthTokenListener=function(I){var V=this;this.s.push(I),Fc(this,this.h.then(function(){V.l||ge(V.s,I)&&I(Yy(V))}))},t.removeAuthTokenListener=function(I){Z(this.s,function(V){return V==I})};function Ine(I,V){I.N.push(V),Fc(I,I.h.then(function(){!I.l&&ge(I.N,V)&&I.W!==I.getUid()&&(I.W=I.getUid(),V(Yy(I)))}))}t.delete=function(){this.l=!0;for(var I=0;I"u"||We(V)?{}:OA(new xu(V))}).then(function(Ce){return ue.a.wb(I,Ce)}).then(function(){}))},t.Wc=function(I,V){return Fc(this,SI(this,I,V,A(this.ab,this)))},t.Vc=function(I,V){var ue=this;return Fc(this,Eo().then(function(){var Ce=V||ui(),_e=js(I,Ce);if(Ce=Su(Ce),!Ce)throw new M("argument-error","Invalid email link!");if(Ce.tenantId!==ue.T())throw new M("tenant-id-mismatch");return ue.ab(_e)}))};function D7(){}D7.prototype.render=function(){},D7.prototype.reset=function(){},D7.prototype.getResponse=function(){},D7.prototype.execute=function(){};function h4(){this.a={},this.b=1e12}var XS=null;h4.prototype.render=function(I,V){return this.a[this.b.toString()]=new KS(I,V),this.b++},h4.prototype.reset=function(I){var V=JS(this,I);I=Fj(I),V&&I&&(V.delete(),delete this.a[I])},h4.prototype.getResponse=function(I){return(I=JS(this,I))?I.getResponse():null},h4.prototype.execute=function(I){(I=JS(this,I))&&I.execute()};function JS(I,V){return(V=Fj(V))&&I.a[V]||null}function Fj(I){return(I=typeof I>"u"?1e12:I)?I.toString():null}function KS(I,V){this.g=!1,this.c=V,this.a=this.b=null,this.h=this.c.size!=="invisible",this.f=uo(I);var ue=this;this.i=function(){ue.execute()},this.h?this.execute():qn(this.f,"click",this.i)}KS.prototype.getResponse=function(){return VI(this),this.b},KS.prototype.execute=function(){VI(this);var I=this;this.a||(this.a=setTimeout(function(){I.b=IA();var V=I.c.callback,ue=I.c["expired-callback"];if(V)try{V(I.b)}catch{}I.a=setTimeout(function(){if(I.a=null,I.b=null,ue)try{ue()}catch{}I.h&&I.execute()},6e4)},500))},KS.prototype.delete=function(){VI(this),this.g=!0,clearTimeout(this.a),this.a=null,Or(this.f,"click",this.i)};function VI(I){if(I.g)throw Error("reCAPTCHA mock was already deleted!")}function GI(){}Hr(GI,"FACTOR_ID","phone");function XI(){}XI.prototype.g=function(){return XS||(XS=new h4),Eo(XS)},XI.prototype.c=function(){};var JI=null;function KI(){this.b=s.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var zne=new Ye(yt,"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),Dne=new Ff(3e4,6e4);KI.prototype.g=function(I){var V=this;return new jo(function(ue,Ce){var _e=setTimeout(function(){Ce(new M("network-request-failed"))},Dne.get());if(!s.grecaptcha||I!==V.f&&!V.b){s[V.a]=function(){if(s.grecaptcha){V.f=I;var Et=s.grecaptcha.render;s.grecaptcha.render=function(cn,ao){return cn=Et(cn,ao),V.b++,cn},clearTimeout(_e),ue(s.grecaptcha)}else clearTimeout(_e),Ce(new M("internal-error"));delete s[V.a]};var wt=ot(zne,{onload:V.a,hl:I||""});Eo(O3(wt)).o(function(){clearTimeout(_e),Ce(new M("internal-error","Unable to load external reCAPTCHA dependencies!"))})}else clearTimeout(_e),ue(s.grecaptcha)})},KI.prototype.c=function(){this.b--};var qI=null;function $I(I,V,ue,Ce,_e,wt,Et){if(Hr(this,"type","recaptcha"),this.c=this.f=null,this.J=!1,this.v=V,this.g=null,Et?(JI||(JI=new XI),Et=JI):(qI||(qI=new KI),Et=qI),this.m=Et,this.a=ue||{theme:"light",type:"image"},this.h=[],this.a[Wj])throw new M("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i=this.a[Ene]==="invisible",!s.document)throw new M("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!uo(V)||!this.i&&uo(V).hasChildNodes())throw new M("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.s=new Ge(I,wt||null,_e||null),this.u=Ce||function(){return null};var cn=this;this.l=[];var ao=this.a[kj];this.a[kj]=function(Hi){if(Nj(cn,Hi),typeof ao=="function")ao(Hi);else if(typeof ao=="string"){var bl=Jl(ao,s);typeof bl=="function"&&bl(Hi)}};var Mo=this.a[Lj];this.a[Lj]=function(){if(Nj(cn,null),typeof Mo=="function")Mo();else if(typeof Mo=="string"){var Hi=Jl(Mo,s);typeof Hi=="function"&&Hi()}}}var kj="callback",Lj="expired-callback",Wj="sitekey",Ene="size";function Nj(I,V){for(var ue=0;ue_e||_e>=jj.length)throw new M("internal-error","Argument validator received an unsupported number of arguments.");ue=jj[_e],Ce=(Ce?"":ue+" argument ")+(V.name?'"'+V.name+'" ':"")+"must be "+V.K+".";break e}Ce=null}}if(Ce)throw new M("argument-error",I+" failed: "+Ce)}var jj="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function Nr(I,V){return{name:I||"",K:"a valid string",optional:!!V,M:function(ue){return typeof ue=="string"}}}function ez(I,V){return{name:I||"",K:"a boolean",optional:!!V,M:function(ue){return typeof ue=="boolean"}}}function c0(I,V){return{name:I||"",K:"a valid object",optional:!!V,M:w}}function Y5(I,V){return{name:I||"",K:"a function",optional:!!V,M:function(ue){return typeof ue=="function"}}}function z1(I,V){return{name:I||"",K:"null",optional:!!V,M:function(ue){return ue===null}}}function Bj(){return{name:"",K:"an HTML element",optional:!1,M:function(I){return!!(I&&I instanceof Element)}}}function kne(){return{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(I){return!!(I&&I instanceof I1)}}}function Lne(){return{name:"app",K:"an instance of Firebase App",optional:!0,M:function(I){return!!(I&&I instanceof $n.app.App)}}}function O5(I){return{name:I?I+"Credential":"credential",K:I?"a valid "+I+" credential":"a valid credential",optional:!1,M:function(V){if(!V)return!1;var ue=!I||V.providerId===I;return!(!V.ka||!ue)}}}function $S(){return{name:"multiFactorAssertion",K:"a valid multiFactorAssertion",optional:!1,M:function(I){return I?!!I.tb:!1}}}function p4(){return{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(I){return!!(I&&I.providerId&&I.hasOwnProperty&&I.hasOwnProperty("isOAuthProvider"))}}}function tz(I,V){return w(I)&&typeof I.type=="string"&&I.type===V&&typeof I.Ha=="function"}function Yj(I){return w(I)&&typeof I.uid=="string"}function Pu(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(I){return!(!I||typeof I.type!="string"||typeof I.verify!="function")}}}function rc(I,V,ue,Ce){return{name:ue||"",K:I.K+" or "+V.K,optional:!!Ce,M:function(_e){return I.M(_e)||V.M(_e)}}}function ic(I,V){for(var ue in V){var Ce=V[ue].name;I[Ce]=_j(Ce,I[ue],V[ue].j)}}function Oj(I,V){for(var ue in V){var Ce=V[ue].name;Ce!==ue&&Object.defineProperty(I,Ce,{get:x(function(_e){return this[_e]},ue),set:x(function(_e,wt,Et,cn){Uj(_e,[Et],[cn],!0),this[wt]=cn},Ce,ue,V[ue].lb),enumerable:!0})}}function Qc(I,V,ue,Ce){I[V]=_j(V,ue,Ce)}function _j(I,V,ue){function Ce(){var Et=Array.prototype.slice.call(arguments);return Uj(_e,ue,Et),V.apply(this,Et)}if(!ue)return V;var _e=nz(I),wt;for(wt in V)Ce[wt]=V[wt];for(wt in V.prototype)Ce.prototype[wt]=V.prototype[wt];return Ce}function nz(I){return I=I.split("."),I[I.length-1]}ic(I1.prototype,{kb:{name:"applyActionCode",j:[Nr("code")]},Sa:{name:"checkActionCode",j:[Nr("code")]},ob:{name:"confirmPasswordReset",j:[Nr("code"),Nr("newPassword")]},dc:{name:"createUserWithEmailAndPassword",j:[Nr("email"),Nr("password")]},hc:{name:"fetchSignInMethodsForEmail",j:[Nr("email")]},ra:{name:"getRedirectResult",j:[]},Bc:{name:"isSignInWithEmailLink",j:[Nr("emailLink")]},Hc:{name:"onAuthStateChanged",j:[rc(c0(),Y5(),"nextOrObserver"),Y5("opt_error",!0),Y5("opt_completed",!0)]},Ic:{name:"onIdTokenChanged",j:[rc(c0(),Y5(),"nextOrObserver"),Y5("opt_error",!0),Y5("opt_completed",!0)]},wb:{name:"sendPasswordResetEmail",j:[Nr("email"),rc(c0("opt_actionCodeSettings",!0),z1(null,!0),"opt_actionCodeSettings",!0)]},xb:{name:"sendSignInLinkToEmail",j:[Nr("email"),c0("actionCodeSettings")]},yb:{name:"setPersistence",j:[Nr("persistence")]},Sc:{name:"signInAndRetrieveDataWithCredential",j:[O5()]},Ab:{name:"signInAnonymously",j:[]},ab:{name:"signInWithCredential",j:[O5()]},Tc:{name:"signInWithCustomToken",j:[Nr("token")]},Uc:{name:"signInWithEmailAndPassword",j:[Nr("email"),Nr("password")]},Vc:{name:"signInWithEmailLink",j:[Nr("email"),Nr("emailLink",!0)]},Wc:{name:"signInWithPhoneNumber",j:[Nr("phoneNumber"),Pu()]},Xc:{name:"signInWithPopup",j:[p4()]},Yc:{name:"signInWithRedirect",j:[p4()]},dd:{name:"updateCurrentUser",j:[rc(function(I){return{name:"user",K:"an instance of Firebase User",optional:!!I,M:function(V){return!!(V&&V instanceof Wh)}}}(),z1(),"user")]},Bb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[Nr(null,!0)]},fd:{name:"useDeviceLanguage",j:[]},gd:{name:"useEmulator",j:[Nr("url"),c0("options",!0)]},jd:{name:"verifyPasswordResetCode",j:[Nr("code")]}}),Oj(I1.prototype,{lc:{name:"languageCode",lb:rc(Nr(),z1(),"languageCode")},ti:{name:"tenantId",lb:rc(Nr(),z1(),"tenantId")}}),I1.Persistence=s4,I1.Persistence.LOCAL="local",I1.Persistence.SESSION="session",I1.Persistence.NONE="none",ic(Wh.prototype,{delete:{name:"delete",j:[]},oc:{name:"getIdTokenResult",j:[ez("opt_forceRefresh",!0)]},I:{name:"getIdToken",j:[ez("opt_forceRefresh",!0)]},Cc:{name:"linkAndRetrieveDataWithCredential",j:[O5()]},rb:{name:"linkWithCredential",j:[O5()]},Dc:{name:"linkWithPhoneNumber",j:[Nr("phoneNumber"),Pu()]},Ec:{name:"linkWithPopup",j:[p4()]},Fc:{name:"linkWithRedirect",j:[p4()]},Lc:{name:"reauthenticateAndRetrieveDataWithCredential",j:[O5()]},ub:{name:"reauthenticateWithCredential",j:[O5()]},Mc:{name:"reauthenticateWithPhoneNumber",j:[Nr("phoneNumber"),Pu()]},Nc:{name:"reauthenticateWithPopup",j:[p4()]},Oc:{name:"reauthenticateWithRedirect",j:[p4()]},reload:{name:"reload",j:[]},vb:{name:"sendEmailVerification",j:[rc(c0("opt_actionCodeSettings",!0),z1(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[Nr(null,!0)]},cd:{name:"unlink",j:[Nr("provider")]},Cb:{name:"updateEmail",j:[Nr("email")]},Db:{name:"updatePassword",j:[Nr("password")]},ed:{name:"updatePhoneNumber",j:[O5("phone")]},Eb:{name:"updateProfile",j:[c0("profile")]},Fb:{name:"verifyBeforeUpdateEmail",j:[Nr("email"),rc(c0("opt_actionCodeSettings",!0),z1(null,!0),"opt_actionCodeSettings",!0)]}}),ic(h4.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),ic(D7.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),ic(jo.prototype,{oa:{name:"finally"},o:{name:"catch"},then:{name:"then"}}),Oj(hj.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",lb:ez("appVerificationDisabledForTesting")}}),ic(bI.prototype,{confirm:{name:"confirm",j:[Nr("verificationCode")]}}),Qc(Pp,"fromJSON",function(I){I=typeof I=="string"?JSON.parse(I):I;for(var V,ue=[D5,zc,nc,z5],Ce=0;Ce{const r=H(fn),i=H(mp),a=H(Pc),l=()=>{const U=[];for(const[O,B]of t.entries())U.push({...B,key:O});return U},[s,c]=m.useState({x:0,y:0}),[u,d]=m.useState(!1),[f,p]=m.useState(!1),[g,y]=m.useState({left:0,top:0,bottom:0,right:0}),[w,b]=m.useState(!1),C=m.useRef(l()),P=m.useRef(),v=m.useRef(),T=be.useRef(null),A=m.useRef(null),x=m.useRef(null),S=x.current?x.current.clientWidth+40:680,R=x.current?x.current.clientHeight+100:600,{Search:M}=as,D=Jt();m.useEffect(()=>{const U=()=>{c({x:Math.max(0,S-window.innerWidth),y:Math.min(0,window.innerHeight-R)})};return window.addEventListener("resize",U),()=>{window.removeEventListener("resize",U)}},[]),m.useEffect(()=>{t&&(C.current=l(),b(!w))},[t]);const E=(U,O)=>{c({x:Math.max(O.x,S-window.innerWidth),y:Math.min(O.y,window.innerHeight-R)})},W=(U,O)=>{},j=()=>{ht.getState().set(U=>{U.showCloudFilePanel=!1})},L=U=>{Oi.confirm({title:F("cloudFilePanel.DoYouReallyWantToDelete",D)+' "'+U+'"?',content:h.jsxs("span",{style:{color:"red",fontWeight:"bold"},children:[h.jsx(hX,{style:{marginRight:"6px"}}),F("word.Warning",D)+": "+F("message.ThisCannotBeUndone",D)]}),icon:h.jsx($W,{}),onOk:()=>{n(U);const O=new URLSearchParams(window.location.search);O.get("title")===U&&O.get("userid")===i.uid&&window.history.pushState({},document.title,t1)}})},k=()=>{P.current&&v.current&&(o(P.current,v.current),v.current=void 0),d(!1)},N=(U,O)=>{if(A.current){const{clientWidth:B,clientHeight:_}=window.document.documentElement,X=A.current.getBoundingClientRect();y({left:-X.left+O.x,right:B-(X.right-O.x),top:-X.top+O.y,bottom:_-((X==null?void 0:X.bottom)-O.y)})}},{t:F}=Vl();return h.jsxs(h.Fragment,{children:[h.jsx(Oi,{title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>p(!0),onMouseOut:()=>p(!1),children:F("word.Rename",D)}),open:u,onOk:k,onCancel:()=>{d(!1),v.current=void 0},modalRender:U=>h.jsx(_i,{disabled:!f,bounds:g,onStart:(O,B)=>N(O,B),children:h.jsx("div",{ref:A,children:U})}),children:h.jsxs(en,{direction:"vertical",style:{width:"100%"},children:[h.jsx(as,{placeholder:"Title",value:v.current?v.current:P.current,onPressEnter:k,onKeyDown:U=>{if(!aR.test(U.key))return U.preventDefault(),!1},onChange:U=>{v.current=U.target.value,b(!w)}}),h.jsxs("span",{style:{fontSize:"11px",color:"red"},children:[h.jsx(hX,{style:{marginRight:"4px"}}),F("word.Caution",D)+": "+F("cloudFilePanel.IfSharedOrPublishedRenamingFileBreaksExistingLinks",D),"."]})]})}),h.jsx(_i,{nodeRef:T,handle:".handle",bounds:"parent",axis:"both",position:s,onDrag:E,onStop:W,onMouseDown:()=>{r(U=>{U.selectedFloatingWindow="cloudFilePanel"})},children:h.jsx(I1o,{ref:T,style:{zIndex:a==="cloudFilePanel"?Sc:14},children:h.jsxs(z1o,{ref:x,children:[h.jsxs(D1o,{className:"handle",style:{direction:"ltr"},children:[h.jsx("span",{children:F("cloudFilePanel.MyCloudFiles",D)+" ("+C.current.length+")"}),h.jsx("span",{style:{cursor:"pointer"},onMouseDown:()=>{j()},onTouchStart:()=>{j()},children:F("word.Close",D)})]}),h.jsxs("div",{style:{direction:"ltr",width:"100%",justifyContent:"center"},children:[h.jsx(M,{style:{width:"50%",paddingTop:"8px",paddingBottom:"8px"},title:F("cloudFilePanel.SearchByTitle",D),allowClear:!0,size:"small",enterButton:!0,onSearch:U=>{var O;if(t){C.current=[];for(const[B,_]of t.entries())(O=_.title)!=null&&O.toLowerCase().includes(U.toLowerCase())&&C.current.push({..._,key:B});b(!w)}}}),h.jsx(lo,{type:"primary",size:"small",style:{marginLeft:"10px",marginTop:"8px"},onClick:()=>{ht.getState().set(U=>{U.refreshCloudFilesFlag=!0})},children:F("word.Refresh",D)})]}),h.jsxs(Fd,{size:"small",style:{width:"100%",direction:"ltr"},dataSource:C.current,scroll:{y:390},pagination:{defaultPageSize:10,showSizeChanger:!0,position:["bottomCenter"],pageSizeOptions:["10","20","50"]},children:[h.jsx(Xae,{title:`${F("word.Title",D)}`,dataIndex:"title",width:"56%",sortDirections:["ascend","descend","ascend"],sorter:(U,O)=>U.title.localeCompare(O.title),render:U=>h.jsx(F6.Text,{style:{fontSize:"12px",cursor:"pointer"},title:F("word.Open",D),children:U}),onCell:U=>({onClick:()=>{const O=window.getSelection();O&&O.toString().length>0||e(U.title)}})},"title"),h.jsx(Xae,{title:`${F("word.Time",D)}`,dataIndex:"timestamp",width:"25%",defaultSortOrder:"descend",sortDirections:["ascend","descend","ascend"],sorter:(U,O)=>U.timestamp-O.timestamp,render:U=>h.jsx(F6.Text,{style:{fontSize:"12px"},children:yc(new Date(U)).format("MM/DD/YYYY hh:mm A")})},"timestamp"),h.jsx(Xae,{width:"19%",title:`${F("word.Action",D)}`,render:U=>h.jsxs(en,{size:"middle",children:[h.jsx("img",{title:F("word.Delete",D),alt:"Delete",src:Drt,onClick:()=>{L(U.title)},height:16,width:16,style:{cursor:"pointer",verticalAlign:"middle"}}),h.jsx("img",{title:F("word.Rename",D),alt:"Rename",src:H1o,onClick:()=>{P.current=U.title,d(!0)},height:16,width:16,style:{cursor:"pointer",verticalAlign:"middle"}}),h.jsx(QKe,{title:F("cloudFilePanel.CopyTitle",D),alt:"Copy Title",onClick:()=>{navigator.clipboard.writeText(U.title).then(()=>S2(F("cloudFilePanel.TitleCopiedToClipBoard",D)+"."))},height:16,width:16,style:{cursor:"pointer",verticalAlign:"middle"}}),h.jsx("img",{title:F("cloudFilePanel.GenerateLink",D),alt:"Link",src:M1o,onClick:()=>{const O=t1+"?client=web&userid="+U.userid+"&title="+encodeURIComponent(U.title);navigator.clipboard.writeText(O).then(()=>S2(F("cloudFilePanel.LinkGeneratedInClipBoard",D)+"."))},height:16,width:16,style:{cursor:"pointer",verticalAlign:"middle"}})]})},"action")]})]})})})]})}),{Column:F1o}=Fd,k1o=Ro.div` +`,E1o=be.memo(({cloudFileArray:t,openCloudFile:e,deleteCloudFile:n,renameCloudFile:o})=>{const r=H(fn),i=H(mp),a=H(Pc),l=()=>{const U=[];for(const[O,B]of t.entries())U.push({...B,key:O});return U},[s,c]=m.useState({x:0,y:0}),[u,d]=m.useState(!1),[f,p]=m.useState(!1),[g,y]=m.useState({left:0,top:0,bottom:0,right:0}),[w,b]=m.useState(!1),C=m.useRef(l()),P=m.useRef(),v=m.useRef(),T=be.useRef(null),A=m.useRef(null),x=m.useRef(null),S=x.current?x.current.clientWidth+40:680,R=x.current?x.current.clientHeight+100:600,{Search:M}=as,D=Jt();m.useEffect(()=>{const U=()=>{c({x:Math.max(0,S-window.innerWidth),y:Math.min(0,window.innerHeight-R)})};return window.addEventListener("resize",U),()=>{window.removeEventListener("resize",U)}},[]),m.useEffect(()=>{t&&(C.current=l(),b(!w))},[t]);const E=(U,O)=>{c({x:Math.max(O.x,S-window.innerWidth),y:Math.min(O.y,window.innerHeight-R)})},W=(U,O)=>{},j=()=>{ht.getState().set(U=>{U.showCloudFilePanel=!1})},L=U=>{Oi.confirm({title:F("cloudFilePanel.DoYouReallyWantToDelete",D)+' "'+U+'"?',content:h.jsxs("span",{style:{color:"red",fontWeight:"bold"},children:[h.jsx(pX,{style:{marginRight:"6px"}}),F("word.Warning",D)+": "+F("message.ThisCannotBeUndone",D)]}),icon:h.jsx(QW,{}),onOk:()=>{n(U);const O=new URLSearchParams(window.location.search);O.get("title")===U&&O.get("userid")===i.uid&&window.history.pushState({},document.title,t1)}})},k=()=>{P.current&&v.current&&(o(P.current,v.current),v.current=void 0),d(!1)},N=(U,O)=>{if(A.current){const{clientWidth:B,clientHeight:_}=window.document.documentElement,X=A.current.getBoundingClientRect();y({left:-X.left+O.x,right:B-(X.right-O.x),top:-X.top+O.y,bottom:_-((X==null?void 0:X.bottom)-O.y)})}},{t:F}=Vl();return h.jsxs(h.Fragment,{children:[h.jsx(Oi,{title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>p(!0),onMouseOut:()=>p(!1),children:F("word.Rename",D)}),open:u,onOk:k,onCancel:()=>{d(!1),v.current=void 0},modalRender:U=>h.jsx(_i,{disabled:!f,bounds:g,onStart:(O,B)=>N(O,B),children:h.jsx("div",{ref:A,children:U})}),children:h.jsxs(en,{direction:"vertical",style:{width:"100%"},children:[h.jsx(as,{placeholder:"Title",value:v.current?v.current:P.current,onPressEnter:k,onKeyDown:U=>{if(!aR.test(U.key))return U.preventDefault(),!1},onChange:U=>{v.current=U.target.value,b(!w)}}),h.jsxs("span",{style:{fontSize:"11px",color:"red"},children:[h.jsx(pX,{style:{marginRight:"4px"}}),F("word.Caution",D)+": "+F("cloudFilePanel.IfSharedOrPublishedRenamingFileBreaksExistingLinks",D),"."]})]})}),h.jsx(_i,{nodeRef:T,handle:".handle",bounds:"parent",axis:"both",position:s,onDrag:E,onStop:W,onMouseDown:()=>{r(U=>{U.selectedFloatingWindow="cloudFilePanel"})},children:h.jsx(I1o,{ref:T,style:{zIndex:a==="cloudFilePanel"?Sc:14},children:h.jsxs(z1o,{ref:x,children:[h.jsxs(D1o,{className:"handle",style:{direction:"ltr"},children:[h.jsx("span",{children:F("cloudFilePanel.MyCloudFiles",D)+" ("+C.current.length+")"}),h.jsx("span",{style:{cursor:"pointer"},onMouseDown:()=>{j()},onTouchStart:()=>{j()},children:F("word.Close",D)})]}),h.jsxs("div",{style:{direction:"ltr",width:"100%",justifyContent:"center"},children:[h.jsx(M,{style:{width:"50%",paddingTop:"8px",paddingBottom:"8px"},title:F("cloudFilePanel.SearchByTitle",D),allowClear:!0,size:"small",enterButton:!0,onSearch:U=>{var O;if(t){C.current=[];for(const[B,_]of t.entries())(O=_.title)!=null&&O.toLowerCase().includes(U.toLowerCase())&&C.current.push({..._,key:B});b(!w)}}}),h.jsx(lo,{type:"primary",size:"small",style:{marginLeft:"10px",marginTop:"8px"},onClick:()=>{ht.getState().set(U=>{U.refreshCloudFilesFlag=!0})},children:F("word.Refresh",D)})]}),h.jsxs(Fd,{size:"small",style:{width:"100%",direction:"ltr"},dataSource:C.current,scroll:{y:390},pagination:{defaultPageSize:10,showSizeChanger:!0,position:["bottomCenter"],pageSizeOptions:["10","20","50"]},children:[h.jsx(Xae,{title:`${F("word.Title",D)}`,dataIndex:"title",width:"56%",sortDirections:["ascend","descend","ascend"],sorter:(U,O)=>U.title.localeCompare(O.title),render:U=>h.jsx(F6.Text,{style:{fontSize:"12px",cursor:"pointer"},title:F("word.Open",D),children:U}),onCell:U=>({onClick:()=>{const O=window.getSelection();O&&O.toString().length>0||e(U.title)}})},"title"),h.jsx(Xae,{title:`${F("word.Time",D)}`,dataIndex:"timestamp",width:"25%",defaultSortOrder:"descend",sortDirections:["ascend","descend","ascend"],sorter:(U,O)=>U.timestamp-O.timestamp,render:U=>h.jsx(F6.Text,{style:{fontSize:"12px"},children:yc(new Date(U)).format("MM/DD/YYYY hh:mm A")})},"timestamp"),h.jsx(Xae,{width:"19%",title:`${F("word.Action",D)}`,render:U=>h.jsxs(en,{size:"middle",children:[h.jsx("img",{title:F("word.Delete",D),alt:"Delete",src:Drt,onClick:()=>{L(U.title)},height:16,width:16,style:{cursor:"pointer",verticalAlign:"middle"}}),h.jsx("img",{title:F("word.Rename",D),alt:"Rename",src:H1o,onClick:()=>{P.current=U.title,d(!0)},height:16,width:16,style:{cursor:"pointer",verticalAlign:"middle"}}),h.jsx(QKe,{title:F("cloudFilePanel.CopyTitle",D),alt:"Copy Title",onClick:()=>{navigator.clipboard.writeText(U.title).then(()=>S2(F("cloudFilePanel.TitleCopiedToClipBoard",D)+"."))},height:16,width:16,style:{cursor:"pointer",verticalAlign:"middle"}}),h.jsx("img",{title:F("cloudFilePanel.GenerateLink",D),alt:"Link",src:M1o,onClick:()=>{const O=t1+"?client=web&userid="+i.uid+"&title="+encodeURIComponent(U.title);navigator.clipboard.writeText(O).then(()=>S2(F("cloudFilePanel.LinkGeneratedInClipBoard",D)+"."))},height:16,width:16,style:{cursor:"pointer",verticalAlign:"middle"}})]})},"action")]})]})})})]})}),{Column:F1o}=Fd,k1o=Ro.div` position: fixed; top: 80px; right: 24px; @@ -7120,15 +7120,15 @@ Content-Type: `+c.contentType+`\r justify-content: space-between; align-items: center; cursor: move; -`,X1o=be.memo(({openCloudFile:t})=>{var A,x,S;const e=H(fn),n=ht(xh),o=H(mp),r=ht(z8t),i=ht(E7t),a=ht(F7t),l=be.useRef(null),s=m.useRef(null),c=m.useRef(o.schoolID??sc.UNKNOWN),u=m.useRef(o.classID??Va.UNKNOWN),d=s.current?s.current.clientWidth+40:640,f=s.current?s.current.clientHeight+100:600,[p,g]=m.useState({x:0,y:0}),y=Jt();m.useEffect(()=>{const R=()=>{g({x:Math.max(0,d-window.innerWidth),y:Math.min(0,window.innerHeight-f)})};return window.addEventListener("resize",R),()=>{window.removeEventListener("resize",R)}},[]);const w=(R,M)=>{g({x:Math.max(M.x,d-window.innerWidth),y:Math.min(M.y,window.innerHeight-f)})},b=(R,M)=>{},C=()=>{ht.getState().set(R=>{R.showAccountSettingsPanel=!1})},P=o&&o.email&&o.email.endsWith("intofuture.org"),v=!1,{t:T}=Vl();return h.jsxs(h.Fragment,{children:[i&&h.jsx(N1o,{likesArray:o.likes??[],openCloudFile:t}),a&&h.jsx(O1o,{publishedModels:o.published??[],openCloudFile:t}),h.jsx(_i,{nodeRef:l,handle:".handle",bounds:"parent",axis:"both",position:p,onDrag:w,onStop:b,children:h.jsx(_1o,{ref:l,children:h.jsxs(V1o,{ref:s,children:[h.jsxs(G1o,{className:"handle",style:{direction:"ltr"},children:[h.jsx("span",{children:T("accountSettingsPanel.MyAccountSettings",y)}),h.jsx("span",{style:{cursor:"pointer"},onMouseDown:()=>{C()},onTouchStart:()=>{C()},children:T("word.Close",y)})]}),h.jsxs(on,{gutter:20,style:{paddingTop:"20px",paddingLeft:"20px",direction:"ltr"},children:[h.jsx(nt,{span:6,onClick:()=>{o.uid&&navigator.clipboard.writeText(o.uid).then(()=>S2(T("accountSettingsPanel.IDInClipBoard",y)))},children:h.jsx(lo,{title:T("accountSettingsPanel.ClickToCopyMyID",y),style:{cursor:"copy",borderRadius:"8px"},children:T("accountSettingsPanel.MyID",y)})}),h.jsx(nt,{style:{paddingTop:"8px"},span:18,children:o.uid})]}),v,h.jsxs(on,{gutter:20,style:{paddingTop:"20px",paddingLeft:"20px",direction:"ltr"},children:[h.jsx(nt,{style:{paddingTop:"8px"},span:6,children:T("accountSettingsPanel.SchoolID",y)}),h.jsx(nt,{span:18,children:h.jsxs(_o,{style:{width:"90%"},value:c.current,onChange:R=>{c.current=R,e(M=>{M.user.schoolID=R}),ht.getState().set(M=>{M.saveAccountSettingsFlag=!0})},children:[h.jsx(qf,{value:sc.UNKNOWN,children:sc.UNKNOWN},sc.UNKNOWN),h.jsx(qf,{value:sc.SCHOOL1,children:sc.SCHOOL1},sc.SCHOOL1),h.jsx(qf,{value:sc.SCHOOL2,children:sc.SCHOOL2},sc.SCHOOL2),h.jsx(qf,{value:sc.SCHOOL3,children:sc.SCHOOL3},sc.SCHOOL3),h.jsx(qf,{value:sc.SCHOOL4,children:sc.SCHOOL4},sc.SCHOOL4),h.jsx(qf,{value:sc.SCHOOL5,children:sc.SCHOOL5},sc.SCHOOL5)]})})]}),h.jsxs(on,{gutter:20,style:{paddingTop:"20px",paddingLeft:"20px",direction:"ltr"},children:[h.jsx(nt,{style:{paddingTop:"8px"},span:6,children:T("accountSettingsPanel.ClassID",y)}),h.jsx(nt,{span:18,children:h.jsxs(_o,{style:{width:"90%"},value:u.current,onChange:R=>{u.current=R,e(M=>{M.user.classID=R}),ht.getState().set(M=>{M.saveAccountSettingsFlag=!0})},children:[h.jsx(qf,{value:Va.UNKNOWN,children:Va.UNKNOWN},Va.UNKNOWN),h.jsx(qf,{value:Va.CLASS1,children:Va.CLASS1},Va.CLASS1),h.jsx(qf,{value:Va.CLASS2,children:Va.CLASS2},Va.CLASS2),h.jsx(qf,{value:Va.CLASS3,children:Va.CLASS3},Va.CLASS3),h.jsx(qf,{value:Va.CLASS4,children:Va.CLASS4},Va.CLASS4),h.jsx(qf,{value:Va.CLASS5,children:Va.CLASS5},Va.CLASS5),h.jsx(qf,{value:Va.CLASS6,children:Va.CLASS6},Va.CLASS6),h.jsx(qf,{value:Va.CLASS7,children:Va.CLASS7},Va.CLASS7),h.jsx(qf,{value:Va.CLASS8,children:Va.CLASS8},Va.CLASS8),h.jsx(qf,{value:Va.CLASS9,children:Va.CLASS9},Va.CLASS9)]})})]}),h.jsxs(on,{gutter:6,style:{paddingTop:"20px",paddingLeft:"20px",direction:"ltr"},children:[h.jsx(nt,{span:6,children:T("accountSettingsPanel.AllPublished",y)}),h.jsx(nt,{span:18,children:h.jsx("span",{style:{cursor:"pointer"},onClick:()=>{n("showPublishedModelsPanel",!0)},children:((A=o.published)==null?void 0:A.length)??0})})]}),h.jsxs(on,{gutter:6,style:{paddingTop:"20px",paddingLeft:"20px",direction:"ltr"},children:[h.jsx(nt,{span:6,children:T("accountSettingsPanel.PublishedUnderAliases",y)}),h.jsx(nt,{span:18,children:h.jsx("span",{style:{fontSize:"10px"},children:(x=o.aliases)==null?void 0:x.map((R,M)=>o.aliases?R+(M{n("showLikesPanel",!0)},children:((S=o.likes)==null?void 0:S.length)??0})})]}),P&&h.jsxs(on,{gutter:6,style:{paddingTop:"20px",paddingLeft:"20px",direction:"ltr"},children:[h.jsx(nt,{span:6,children:T("accountSettingsPanel.UserCount",y)}),h.jsx(nt,{span:18,children:r})]})]})})})]})});function Nk(t){"@babel/helpers - typeof";return Nk=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},Nk(t)}function J1o(t,e){if(Nk(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(Nk(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function K1o(t){var e=J1o(t,"string");return Nk(e)=="symbol"?e:e+""}function fo(t,e,n){return(e=K1o(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ert(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Jae,DHe;function q1o(){if(DHe)return Jae;DHe=1;var t=function(n,o,r,i,a,l,s,c){if(!n){var u;if(o===void 0)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[r,i,a,l,s,c],f=0;u=new Error(o.replace(/%s/g,function(){return d[f++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};return Jae=t,Jae}var $1o=q1o(),Gu=Ert($1o),Sa=m.createContext(null);function Q1o(){Gu(!!m.useContext,"useGoogleMap is React hook and requires React version 16.8+");var t=m.useContext(Sa);return Gu(!!t,"useGoogleMap needs a GoogleMap available up in the tree"),t}function Z1o(t,e,n){return Object.keys(t).reduce(function(r,i){return e(r,t[i],i)},n)}function ego(t,e){Object.keys(t).forEach(n=>e(t[n],n))}function tgo(t,e,n,o){var r={},i=(a,l)=>{var s=n[l];s!==e[l]&&(r[l]=s,a(o,s))};return ego(t,i),r}function ngo(t,e,n){var o=Z1o(n,function(i,a,l){return typeof t[l]=="function"&&i.push(google.maps.event.addListener(e,a,t[l])),i},[]);return o}function ogo(t){google.maps.event.removeListener(t)}function Ja(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];t.forEach(ogo)}function Ba(t){var{updaterMap:e,eventMap:n,prevProps:o,nextProps:r,instance:i}=t,a=ngo(r,i,n);return tgo(e,o,r,i),a}var EHe={onDblClick:"dblclick",onDragEnd:"dragend",onDragStart:"dragstart",onMapTypeIdChanged:"maptypeid_changed",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseDown:"mousedown",onMouseUp:"mouseup",onRightClick:"rightclick",onTilesLoaded:"tilesloaded",onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onDrag:"drag",onHeadingChanged:"heading_changed",onIdle:"idle",onProjectionChanged:"projection_changed",onResize:"resize",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed"},FHe={extraMapTypes(t,e){e.forEach(function(o,r){t.mapTypes.set(String(r),o)})},center(t,e){t.setCenter(e)},clickableIcons(t,e){t.setClickableIcons(e)},heading(t,e){t.setHeading(e)},mapTypeId(t,e){t.setMapTypeId(e)},options(t,e){t.setOptions(e)},streetView(t,e){t.setStreetView(e)},tilt(t,e){t.setTilt(e)},zoom(t,e){t.setZoom(e)}};function rgo(t){var{children:e,options:n,id:o,mapContainerStyle:r,mapContainerClassName:i,center:a,onClick:l,onDblClick:s,onDrag:c,onDragEnd:u,onDragStart:d,onMouseMove:f,onMouseOut:p,onMouseOver:g,onMouseDown:y,onMouseUp:w,onRightClick:b,onCenterChanged:C,onLoad:P,onUnmount:v}=t,[T,A]=m.useState(null),x=m.useRef(null),[S,R]=m.useState(null),[M,D]=m.useState(null),[E,W]=m.useState(null),[j,L]=m.useState(null),[k,N]=m.useState(null),[F,U]=m.useState(null),[O,B]=m.useState(null),[_,X]=m.useState(null),[$,Q]=m.useState(null),[le,q]=m.useState(null),[te,re]=m.useState(null),[ae,se]=m.useState(null);return m.useEffect(()=>{n&&T!==null&&T.setOptions(n)},[T,n]),m.useEffect(()=>{T!==null&&typeof a<"u"&&T.setCenter(a)},[T,a]),m.useEffect(()=>{T&&s&&(M!==null&&google.maps.event.removeListener(M),D(google.maps.event.addListener(T,"dblclick",s)))},[s]),m.useEffect(()=>{T&&u&&(E!==null&&google.maps.event.removeListener(E),W(google.maps.event.addListener(T,"dragend",u)))},[u]),m.useEffect(()=>{T&&d&&(j!==null&&google.maps.event.removeListener(j),L(google.maps.event.addListener(T,"dragstart",d)))},[d]),m.useEffect(()=>{T&&y&&(k!==null&&google.maps.event.removeListener(k),N(google.maps.event.addListener(T,"mousedown",y)))},[y]),m.useEffect(()=>{T&&f&&(F!==null&&google.maps.event.removeListener(F),U(google.maps.event.addListener(T,"mousemove",f)))},[f]),m.useEffect(()=>{T&&p&&(O!==null&&google.maps.event.removeListener(O),B(google.maps.event.addListener(T,"mouseout",p)))},[p]),m.useEffect(()=>{T&&g&&(_!==null&&google.maps.event.removeListener(_),X(google.maps.event.addListener(T,"mouseover",g)))},[g]),m.useEffect(()=>{T&&w&&($!==null&&google.maps.event.removeListener($),Q(google.maps.event.addListener(T,"mouseup",w)))},[w]),m.useEffect(()=>{T&&b&&(le!==null&&google.maps.event.removeListener(le),q(google.maps.event.addListener(T,"rightclick",b)))},[b]),m.useEffect(()=>{T&&l&&(te!==null&&google.maps.event.removeListener(te),re(google.maps.event.addListener(T,"click",l)))},[l]),m.useEffect(()=>{T&&c&&(ae!==null&&google.maps.event.removeListener(ae),se(google.maps.event.addListener(T,"drag",c)))},[c]),m.useEffect(()=>{T&&C&&(S!==null&&google.maps.event.removeListener(S),R(google.maps.event.addListener(T,"center_changed",C)))},[l]),m.useEffect(()=>{var ne=x.current===null?null:new google.maps.Map(x.current,n);return A(ne),ne!==null&&P&&P(ne),()=>{ne!==null&&v&&v(ne)}},[]),h.jsx("div",{id:o,ref:x,style:r,className:i,children:h.jsx(Sa.Provider,{value:T,children:T!==null?e:null})})}m.memo(rgo);class Frt extends m.PureComponent{constructor(){super(...arguments),fo(this,"state",{map:null}),fo(this,"registeredEvents",[]),fo(this,"mapRef",null),fo(this,"getInstance",()=>this.mapRef===null?null:new google.maps.Map(this.mapRef,this.props.options)),fo(this,"panTo",e=>{var n=this.getInstance();n&&n.panTo(e)}),fo(this,"setMapCallback",()=>{this.state.map!==null&&this.props.onLoad&&this.props.onLoad(this.state.map)}),fo(this,"getRef",e=>{this.mapRef=e})}componentDidMount(){var e=this.getInstance();this.registeredEvents=Ba({updaterMap:FHe,eventMap:EHe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{map:e}},this.setMapCallback)}componentDidUpdate(e){this.state.map!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:FHe,eventMap:EHe,prevProps:e,nextProps:this.props,instance:this.state.map}))}componentWillUnmount(){this.state.map!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.map),Ja(this.registeredEvents))}render(){return h.jsx("div",{id:this.props.id,ref:this.getRef,style:this.props.mapContainerStyle,className:this.props.mapContainerClassName,children:h.jsx(Sa.Provider,{value:this.state.map,children:this.state.map!==null?this.props.children:null})})}}function kHe(t,e,n,o,r,i,a){try{var l=t[i](a),s=l.value}catch(c){return void n(c)}l.done?e(s):Promise.resolve(s).then(o,r)}function krt(t){return function(){var e=this,n=arguments;return new Promise(function(o,r){var i=t.apply(e,n);function a(s){kHe(i,o,r,a,l,"next",s)}function l(s){kHe(i,o,r,a,l,"throw",s)}a(void 0)})}}function Lrt(t){var{googleMapsApiKey:e,googleMapsClientId:n,version:o="weekly",language:r,region:i,libraries:a,channel:l,mapIds:s,authReferrerPolicy:c}=t,u=[];return Gu(e&&n||!(e&&n),"You need to specify either googleMapsApiKey or googleMapsClientId for @react-google-maps/api load script to work. You cannot use both at the same time."),e?u.push("key=".concat(e)):n&&u.push("client=".concat(n)),o&&u.push("v=".concat(o)),r&&u.push("language=".concat(r)),i&&u.push("region=".concat(i)),a&&a.length&&u.push("libraries=".concat(a.sort().join(","))),l&&u.push("channel=".concat(l)),s&&s.length&&u.push("map_ids=".concat(s.join(","))),c&&u.push("auth_referrer_policy=".concat(c)),u.push("loading=async"),u.push("callback=initMap"),"https://maps.googleapis.com/maps/api/js?".concat(u.join("&"))}var b8=typeof document<"u";function Wrt(t){var{url:e,id:n,nonce:o}=t;return b8?new Promise(function(i,a){var l=document.getElementById(n),s=window;if(l){var c=l.getAttribute("data-state");if(l.src===e&&c!=="error"){if(c==="ready")return i(n);var u=s.initMap,d=l.onerror;s.initMap=function(){u&&u(),i(n)},l.onerror=function(p){d&&d(p),a(p)};return}else l.remove()}var f=document.createElement("script");f.type="text/javascript",f.src=e,f.id=n,f.async=!0,f.nonce=o||"",f.onerror=function(g){f.setAttribute("data-state","error"),a(g)},s.initMap=function(){f.setAttribute("data-state","ready"),i(n)},document.head.appendChild(f)}).catch(r=>{throw console.error("injectScript error: ",r),r}):Promise.reject(new Error("document is undefined"))}function LHe(t){var e=t.href;return e&&(e.indexOf("https://fonts.googleapis.com/css?family=Roboto")===0||e.indexOf("https://fonts.googleapis.com/css?family=Google+Sans+Text")===0)?!0:t.tagName.toLowerCase()==="style"&&t.styleSheet&&t.styleSheet.cssText&&t.styleSheet.cssText.replace(`\r +`,X1o=be.memo(({openCloudFile:t})=>{var A,x,S;const e=H(fn),n=ht(xh),o=H(mp),r=ht(z8t),i=ht(E7t),a=ht(F7t),l=be.useRef(null),s=m.useRef(null),c=m.useRef(o.schoolID??sc.UNKNOWN),u=m.useRef(o.classID??Va.UNKNOWN),d=s.current?s.current.clientWidth+40:640,f=s.current?s.current.clientHeight+100:600,[p,g]=m.useState({x:0,y:0}),y=Jt();m.useEffect(()=>{const R=()=>{g({x:Math.max(0,d-window.innerWidth),y:Math.min(0,window.innerHeight-f)})};return window.addEventListener("resize",R),()=>{window.removeEventListener("resize",R)}},[]);const w=(R,M)=>{g({x:Math.max(M.x,d-window.innerWidth),y:Math.min(M.y,window.innerHeight-f)})},b=(R,M)=>{},C=()=>{ht.getState().set(R=>{R.showAccountSettingsPanel=!1})},P=o&&o.email&&o.email.endsWith("intofuture.org"),v=!1,{t:T}=Vl();return h.jsxs(h.Fragment,{children:[i&&h.jsx(N1o,{likesArray:o.likes??[],openCloudFile:t}),a&&h.jsx(O1o,{publishedModels:o.published??[],openCloudFile:t}),h.jsx(_i,{nodeRef:l,handle:".handle",bounds:"parent",axis:"both",position:p,onDrag:w,onStop:b,children:h.jsx(_1o,{ref:l,children:h.jsxs(V1o,{ref:s,children:[h.jsxs(G1o,{className:"handle",style:{direction:"ltr"},children:[h.jsx("span",{children:T("accountSettingsPanel.MyAccountSettings",y)}),h.jsx("span",{style:{cursor:"pointer"},onMouseDown:()=>{C()},onTouchStart:()=>{C()},children:T("word.Close",y)})]}),h.jsxs(on,{gutter:20,style:{paddingTop:"20px",paddingLeft:"20px",direction:"ltr"},children:[h.jsx(nt,{span:6,onClick:()=>{o.uid&&navigator.clipboard.writeText(o.uid).then(()=>S2(T("accountSettingsPanel.IDInClipBoard",y)))},children:h.jsx(lo,{title:T("accountSettingsPanel.ClickToCopyMyID",y),style:{cursor:"copy",borderRadius:"8px"},children:T("accountSettingsPanel.MyID",y)})}),h.jsx(nt,{style:{paddingTop:"8px"},span:18,children:o.uid})]}),v,h.jsxs(on,{gutter:20,style:{paddingTop:"20px",paddingLeft:"20px",direction:"ltr"},children:[h.jsx(nt,{style:{paddingTop:"8px"},span:6,children:T("accountSettingsPanel.SchoolID",y)}),h.jsx(nt,{span:18,children:h.jsxs(_o,{style:{width:"90%"},value:c.current,onChange:R=>{c.current=R,e(M=>{M.user.schoolID=R}),ht.getState().set(M=>{M.saveAccountSettingsFlag=!0})},children:[h.jsx(qf,{value:sc.UNKNOWN,children:sc.UNKNOWN},sc.UNKNOWN),h.jsx(qf,{value:sc.SCHOOL1,children:sc.SCHOOL1},sc.SCHOOL1),h.jsx(qf,{value:sc.SCHOOL2,children:sc.SCHOOL2},sc.SCHOOL2),h.jsx(qf,{value:sc.SCHOOL3,children:sc.SCHOOL3},sc.SCHOOL3),h.jsx(qf,{value:sc.SCHOOL4,children:sc.SCHOOL4},sc.SCHOOL4),h.jsx(qf,{value:sc.SCHOOL5,children:sc.SCHOOL5},sc.SCHOOL5)]})})]}),h.jsxs(on,{gutter:20,style:{paddingTop:"20px",paddingLeft:"20px",direction:"ltr"},children:[h.jsx(nt,{style:{paddingTop:"8px"},span:6,children:T("accountSettingsPanel.ClassID",y)}),h.jsx(nt,{span:18,children:h.jsxs(_o,{style:{width:"90%"},value:u.current,onChange:R=>{u.current=R,e(M=>{M.user.classID=R}),ht.getState().set(M=>{M.saveAccountSettingsFlag=!0})},children:[h.jsx(qf,{value:Va.UNKNOWN,children:Va.UNKNOWN},Va.UNKNOWN),h.jsx(qf,{value:Va.CLASS1,children:Va.CLASS1},Va.CLASS1),h.jsx(qf,{value:Va.CLASS2,children:Va.CLASS2},Va.CLASS2),h.jsx(qf,{value:Va.CLASS3,children:Va.CLASS3},Va.CLASS3),h.jsx(qf,{value:Va.CLASS4,children:Va.CLASS4},Va.CLASS4),h.jsx(qf,{value:Va.CLASS5,children:Va.CLASS5},Va.CLASS5),h.jsx(qf,{value:Va.CLASS6,children:Va.CLASS6},Va.CLASS6),h.jsx(qf,{value:Va.CLASS7,children:Va.CLASS7},Va.CLASS7),h.jsx(qf,{value:Va.CLASS8,children:Va.CLASS8},Va.CLASS8),h.jsx(qf,{value:Va.CLASS9,children:Va.CLASS9},Va.CLASS9)]})})]}),h.jsxs(on,{gutter:6,style:{paddingTop:"20px",paddingLeft:"20px",direction:"ltr"},children:[h.jsx(nt,{span:6,children:T("accountSettingsPanel.AllPublished",y)}),h.jsx(nt,{span:18,children:h.jsx("span",{style:{cursor:"pointer"},onClick:()=>{n("showPublishedModelsPanel",!0)},children:((A=o.published)==null?void 0:A.length)??0})})]}),h.jsxs(on,{gutter:6,style:{paddingTop:"20px",paddingLeft:"20px",direction:"ltr"},children:[h.jsx(nt,{span:6,children:T("accountSettingsPanel.PublishedUnderAliases",y)}),h.jsx(nt,{span:18,children:h.jsx("span",{style:{fontSize:"10px"},children:(x=o.aliases)==null?void 0:x.map((R,M)=>o.aliases?R+(M{n("showLikesPanel",!0)},children:((S=o.likes)==null?void 0:S.length)??0})})]}),P&&h.jsxs(on,{gutter:6,style:{paddingTop:"20px",paddingLeft:"20px",direction:"ltr"},children:[h.jsx(nt,{span:6,children:T("accountSettingsPanel.UserCount",y)}),h.jsx(nt,{span:18,children:r})]})]})})})]})});function Nk(t){"@babel/helpers - typeof";return Nk=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},Nk(t)}function J1o(t,e){if(Nk(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(Nk(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function K1o(t){var e=J1o(t,"string");return Nk(e)=="symbol"?e:e+""}function fo(t,e,n){return(e=K1o(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ert(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Jae,EHe;function q1o(){if(EHe)return Jae;EHe=1;var t=function(n,o,r,i,a,l,s,c){if(!n){var u;if(o===void 0)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[r,i,a,l,s,c],f=0;u=new Error(o.replace(/%s/g,function(){return d[f++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};return Jae=t,Jae}var $1o=q1o(),Gu=Ert($1o),Sa=m.createContext(null);function Q1o(){Gu(!!m.useContext,"useGoogleMap is React hook and requires React version 16.8+");var t=m.useContext(Sa);return Gu(!!t,"useGoogleMap needs a GoogleMap available up in the tree"),t}function Z1o(t,e,n){return Object.keys(t).reduce(function(r,i){return e(r,t[i],i)},n)}function ego(t,e){Object.keys(t).forEach(n=>e(t[n],n))}function tgo(t,e,n,o){var r={},i=(a,l)=>{var s=n[l];s!==e[l]&&(r[l]=s,a(o,s))};return ego(t,i),r}function ngo(t,e,n){var o=Z1o(n,function(i,a,l){return typeof t[l]=="function"&&i.push(google.maps.event.addListener(e,a,t[l])),i},[]);return o}function ogo(t){google.maps.event.removeListener(t)}function Ja(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];t.forEach(ogo)}function Ba(t){var{updaterMap:e,eventMap:n,prevProps:o,nextProps:r,instance:i}=t,a=ngo(r,i,n);return tgo(e,o,r,i),a}var FHe={onDblClick:"dblclick",onDragEnd:"dragend",onDragStart:"dragstart",onMapTypeIdChanged:"maptypeid_changed",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseDown:"mousedown",onMouseUp:"mouseup",onRightClick:"rightclick",onTilesLoaded:"tilesloaded",onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onDrag:"drag",onHeadingChanged:"heading_changed",onIdle:"idle",onProjectionChanged:"projection_changed",onResize:"resize",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed"},kHe={extraMapTypes(t,e){e.forEach(function(o,r){t.mapTypes.set(String(r),o)})},center(t,e){t.setCenter(e)},clickableIcons(t,e){t.setClickableIcons(e)},heading(t,e){t.setHeading(e)},mapTypeId(t,e){t.setMapTypeId(e)},options(t,e){t.setOptions(e)},streetView(t,e){t.setStreetView(e)},tilt(t,e){t.setTilt(e)},zoom(t,e){t.setZoom(e)}};function rgo(t){var{children:e,options:n,id:o,mapContainerStyle:r,mapContainerClassName:i,center:a,onClick:l,onDblClick:s,onDrag:c,onDragEnd:u,onDragStart:d,onMouseMove:f,onMouseOut:p,onMouseOver:g,onMouseDown:y,onMouseUp:w,onRightClick:b,onCenterChanged:C,onLoad:P,onUnmount:v}=t,[T,A]=m.useState(null),x=m.useRef(null),[S,R]=m.useState(null),[M,D]=m.useState(null),[E,W]=m.useState(null),[j,L]=m.useState(null),[k,N]=m.useState(null),[F,U]=m.useState(null),[O,B]=m.useState(null),[_,X]=m.useState(null),[$,Q]=m.useState(null),[le,q]=m.useState(null),[te,re]=m.useState(null),[ae,se]=m.useState(null);return m.useEffect(()=>{n&&T!==null&&T.setOptions(n)},[T,n]),m.useEffect(()=>{T!==null&&typeof a<"u"&&T.setCenter(a)},[T,a]),m.useEffect(()=>{T&&s&&(M!==null&&google.maps.event.removeListener(M),D(google.maps.event.addListener(T,"dblclick",s)))},[s]),m.useEffect(()=>{T&&u&&(E!==null&&google.maps.event.removeListener(E),W(google.maps.event.addListener(T,"dragend",u)))},[u]),m.useEffect(()=>{T&&d&&(j!==null&&google.maps.event.removeListener(j),L(google.maps.event.addListener(T,"dragstart",d)))},[d]),m.useEffect(()=>{T&&y&&(k!==null&&google.maps.event.removeListener(k),N(google.maps.event.addListener(T,"mousedown",y)))},[y]),m.useEffect(()=>{T&&f&&(F!==null&&google.maps.event.removeListener(F),U(google.maps.event.addListener(T,"mousemove",f)))},[f]),m.useEffect(()=>{T&&p&&(O!==null&&google.maps.event.removeListener(O),B(google.maps.event.addListener(T,"mouseout",p)))},[p]),m.useEffect(()=>{T&&g&&(_!==null&&google.maps.event.removeListener(_),X(google.maps.event.addListener(T,"mouseover",g)))},[g]),m.useEffect(()=>{T&&w&&($!==null&&google.maps.event.removeListener($),Q(google.maps.event.addListener(T,"mouseup",w)))},[w]),m.useEffect(()=>{T&&b&&(le!==null&&google.maps.event.removeListener(le),q(google.maps.event.addListener(T,"rightclick",b)))},[b]),m.useEffect(()=>{T&&l&&(te!==null&&google.maps.event.removeListener(te),re(google.maps.event.addListener(T,"click",l)))},[l]),m.useEffect(()=>{T&&c&&(ae!==null&&google.maps.event.removeListener(ae),se(google.maps.event.addListener(T,"drag",c)))},[c]),m.useEffect(()=>{T&&C&&(S!==null&&google.maps.event.removeListener(S),R(google.maps.event.addListener(T,"center_changed",C)))},[l]),m.useEffect(()=>{var ne=x.current===null?null:new google.maps.Map(x.current,n);return A(ne),ne!==null&&P&&P(ne),()=>{ne!==null&&v&&v(ne)}},[]),h.jsx("div",{id:o,ref:x,style:r,className:i,children:h.jsx(Sa.Provider,{value:T,children:T!==null?e:null})})}m.memo(rgo);class Frt extends m.PureComponent{constructor(){super(...arguments),fo(this,"state",{map:null}),fo(this,"registeredEvents",[]),fo(this,"mapRef",null),fo(this,"getInstance",()=>this.mapRef===null?null:new google.maps.Map(this.mapRef,this.props.options)),fo(this,"panTo",e=>{var n=this.getInstance();n&&n.panTo(e)}),fo(this,"setMapCallback",()=>{this.state.map!==null&&this.props.onLoad&&this.props.onLoad(this.state.map)}),fo(this,"getRef",e=>{this.mapRef=e})}componentDidMount(){var e=this.getInstance();this.registeredEvents=Ba({updaterMap:kHe,eventMap:FHe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{map:e}},this.setMapCallback)}componentDidUpdate(e){this.state.map!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:kHe,eventMap:FHe,prevProps:e,nextProps:this.props,instance:this.state.map}))}componentWillUnmount(){this.state.map!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.map),Ja(this.registeredEvents))}render(){return h.jsx("div",{id:this.props.id,ref:this.getRef,style:this.props.mapContainerStyle,className:this.props.mapContainerClassName,children:h.jsx(Sa.Provider,{value:this.state.map,children:this.state.map!==null?this.props.children:null})})}}function LHe(t,e,n,o,r,i,a){try{var l=t[i](a),s=l.value}catch(c){return void n(c)}l.done?e(s):Promise.resolve(s).then(o,r)}function krt(t){return function(){var e=this,n=arguments;return new Promise(function(o,r){var i=t.apply(e,n);function a(s){LHe(i,o,r,a,l,"next",s)}function l(s){LHe(i,o,r,a,l,"throw",s)}a(void 0)})}}function Lrt(t){var{googleMapsApiKey:e,googleMapsClientId:n,version:o="weekly",language:r,region:i,libraries:a,channel:l,mapIds:s,authReferrerPolicy:c}=t,u=[];return Gu(e&&n||!(e&&n),"You need to specify either googleMapsApiKey or googleMapsClientId for @react-google-maps/api load script to work. You cannot use both at the same time."),e?u.push("key=".concat(e)):n&&u.push("client=".concat(n)),o&&u.push("v=".concat(o)),r&&u.push("language=".concat(r)),i&&u.push("region=".concat(i)),a&&a.length&&u.push("libraries=".concat(a.sort().join(","))),l&&u.push("channel=".concat(l)),s&&s.length&&u.push("map_ids=".concat(s.join(","))),c&&u.push("auth_referrer_policy=".concat(c)),u.push("loading=async"),u.push("callback=initMap"),"https://maps.googleapis.com/maps/api/js?".concat(u.join("&"))}var b8=typeof document<"u";function Wrt(t){var{url:e,id:n,nonce:o}=t;return b8?new Promise(function(i,a){var l=document.getElementById(n),s=window;if(l){var c=l.getAttribute("data-state");if(l.src===e&&c!=="error"){if(c==="ready")return i(n);var u=s.initMap,d=l.onerror;s.initMap=function(){u&&u(),i(n)},l.onerror=function(p){d&&d(p),a(p)};return}else l.remove()}var f=document.createElement("script");f.type="text/javascript",f.src=e,f.id=n,f.async=!0,f.nonce=o||"",f.onerror=function(g){f.setAttribute("data-state","error"),a(g)},s.initMap=function(){f.setAttribute("data-state","ready"),i(n)},document.head.appendChild(f)}).catch(r=>{throw console.error("injectScript error: ",r),r}):Promise.reject(new Error("document is undefined"))}function WHe(t){var e=t.href;return e&&(e.indexOf("https://fonts.googleapis.com/css?family=Roboto")===0||e.indexOf("https://fonts.googleapis.com/css?family=Google+Sans+Text")===0)?!0:t.tagName.toLowerCase()==="style"&&t.styleSheet&&t.styleSheet.cssText&&t.styleSheet.cssText.replace(`\r `,"").indexOf(".gm-style")===0?(t.styleSheet.cssText="",!0):t.tagName.toLowerCase()==="style"&&t.innerHTML&&t.innerHTML.replace(`\r -`,"").indexOf(".gm-style")===0?(t.innerHTML="",!0):t.tagName.toLowerCase()==="style"&&!t.styleSheet&&!t.innerHTML}function z9e(){var t=document.getElementsByTagName("head")[0];if(t){var e=t.insertBefore.bind(t);t.insertBefore=function(r,i){return LHe(r)||Reflect.apply(e,t,[r,i]),r};var n=t.appendChild.bind(t);t.appendChild=function(r){return LHe(r)||Reflect.apply(n,t,[r]),r}}}var eD=!1;function Nrt(){return h.jsx("div",{children:"Loading..."})}var Uk={id:"script-loader",version:"weekly"};class igo extends m.PureComponent{constructor(){super(...arguments),fo(this,"check",m.createRef()),fo(this,"state",{loaded:!1}),fo(this,"cleanupCallback",()=>{delete window.google.maps,this.injectScript()}),fo(this,"isCleaningUp",krt(function*(){function e(n){if(!eD)n();else if(b8)var o=window.setInterval(function(){eD||(window.clearInterval(o),n())},1)}return new Promise(e)})),fo(this,"cleanup",()=>{eD=!0;var e=document.getElementById(this.props.id);e&&e.parentNode&&e.parentNode.removeChild(e),Array.prototype.slice.call(document.getElementsByTagName("script")).filter(function(o){return typeof o.src=="string"&&o.src.includes("maps.googleapis")}).forEach(function(o){o.parentNode&&o.parentNode.removeChild(o)}),Array.prototype.slice.call(document.getElementsByTagName("link")).filter(function(o){return o.href==="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans"}).forEach(function(o){o.parentNode&&o.parentNode.removeChild(o)}),Array.prototype.slice.call(document.getElementsByTagName("style")).filter(function(o){return o.innerText!==void 0&&o.innerText.length>0&&o.innerText.includes(".gm-")}).forEach(function(o){o.parentNode&&o.parentNode.removeChild(o)})}),fo(this,"injectScript",()=>{this.props.preventGoogleFontsLoading&&z9e(),Gu(!!this.props.id,'LoadScript requires "id" prop to be a string: %s',this.props.id);var e={id:this.props.id,nonce:this.props.nonce,url:Lrt(this.props)};Wrt(e).then(()=>{this.props.onLoad&&this.props.onLoad(),this.setState(function(){return{loaded:!0}})}).catch(n=>{this.props.onError&&this.props.onError(n),console.error(` +`,"").indexOf(".gm-style")===0?(t.innerHTML="",!0):t.tagName.toLowerCase()==="style"&&!t.styleSheet&&!t.innerHTML}function D9e(){var t=document.getElementsByTagName("head")[0];if(t){var e=t.insertBefore.bind(t);t.insertBefore=function(r,i){return WHe(r)||Reflect.apply(e,t,[r,i]),r};var n=t.appendChild.bind(t);t.appendChild=function(r){return WHe(r)||Reflect.apply(n,t,[r]),r}}}var eD=!1;function Nrt(){return h.jsx("div",{children:"Loading..."})}var Uk={id:"script-loader",version:"weekly"};class igo extends m.PureComponent{constructor(){super(...arguments),fo(this,"check",m.createRef()),fo(this,"state",{loaded:!1}),fo(this,"cleanupCallback",()=>{delete window.google.maps,this.injectScript()}),fo(this,"isCleaningUp",krt(function*(){function e(n){if(!eD)n();else if(b8)var o=window.setInterval(function(){eD||(window.clearInterval(o),n())},1)}return new Promise(e)})),fo(this,"cleanup",()=>{eD=!0;var e=document.getElementById(this.props.id);e&&e.parentNode&&e.parentNode.removeChild(e),Array.prototype.slice.call(document.getElementsByTagName("script")).filter(function(o){return typeof o.src=="string"&&o.src.includes("maps.googleapis")}).forEach(function(o){o.parentNode&&o.parentNode.removeChild(o)}),Array.prototype.slice.call(document.getElementsByTagName("link")).filter(function(o){return o.href==="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans"}).forEach(function(o){o.parentNode&&o.parentNode.removeChild(o)}),Array.prototype.slice.call(document.getElementsByTagName("style")).filter(function(o){return o.innerText!==void 0&&o.innerText.length>0&&o.innerText.includes(".gm-")}).forEach(function(o){o.parentNode&&o.parentNode.removeChild(o)})}),fo(this,"injectScript",()=>{this.props.preventGoogleFontsLoading&&D9e(),Gu(!!this.props.id,'LoadScript requires "id" prop to be a string: %s',this.props.id);var e={id:this.props.id,nonce:this.props.nonce,url:Lrt(this.props)};Wrt(e).then(()=>{this.props.onLoad&&this.props.onLoad(),this.setState(function(){return{loaded:!0}})}).catch(n=>{this.props.onError&&this.props.onError(n),console.error(` There has been an Error with loading Google Maps API script, please check that you provided correct google API key (`.concat(this.props.googleMapsApiKey||"-",") or Client ID (").concat(this.props.googleMapsClientId||"-",`) to Otherwise it is a Network issue. - `))})})}componentDidMount(){if(b8){if(window.google&&window.google.maps&&!eD){console.error("google api is already presented");return}this.isCleaningUp().then(this.injectScript).catch(function(n){console.error("Error at injecting script after cleaning up: ",n)})}}componentDidUpdate(e){this.props.libraries!==e.libraries&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),b8&&e.language!==this.props.language&&(this.cleanup(),this.setState(function(){return{loaded:!1}},this.cleanupCallback))}componentWillUnmount(){if(b8){this.cleanup();var e=()=>{this.check.current||(delete window.google,eD=!1)};window.setTimeout(e,1),this.props.onUnmount&&this.props.onUnmount()}}render(){return h.jsxs(h.Fragment,{children:[h.jsx("div",{ref:this.check}),this.state.loaded?this.props.children:this.props.loadingElement||h.jsx(Nrt,{})]})}}fo(igo,"defaultProps",Uk);function ago(t,e){if(t==null)return{};var n={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(e.includes(o))continue;n[o]=t[o]}return n}function D9e(t,e){if(t==null)return{};var n,o,r=ago(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o{p.current=!1}},[]),m.useEffect(function(){b8&&c&&z9e()},[c]),m.useEffect(function(){g&&Gu(!!window.google,"useLoadScript was marked as loaded, but window.google is not present. Something went wrong.")},[g]);var C=Lrt({version:n,googleMapsApiKey:r,googleMapsClientId:i,language:a,region:l,libraries:s,channel:u,mapIds:d,authReferrerPolicy:f});m.useEffect(function(){if(!b8)return;function T(){p.current&&(y(!0),WHe=C)}if(window.google&&window.google.maps&&WHe===C){T();return}Wrt({id:e,url:C,nonce:o}).then(T).catch(function(x){p.current&&b(x),console.warn(` + `))})})}componentDidMount(){if(b8){if(window.google&&window.google.maps&&!eD){console.error("google api is already presented");return}this.isCleaningUp().then(this.injectScript).catch(function(n){console.error("Error at injecting script after cleaning up: ",n)})}}componentDidUpdate(e){this.props.libraries!==e.libraries&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),b8&&e.language!==this.props.language&&(this.cleanup(),this.setState(function(){return{loaded:!1}},this.cleanupCallback))}componentWillUnmount(){if(b8){this.cleanup();var e=()=>{this.check.current||(delete window.google,eD=!1)};window.setTimeout(e,1),this.props.onUnmount&&this.props.onUnmount()}}render(){return h.jsxs(h.Fragment,{children:[h.jsx("div",{ref:this.check}),this.state.loaded?this.props.children:this.props.loadingElement||h.jsx(Nrt,{})]})}}fo(igo,"defaultProps",Uk);function ago(t,e){if(t==null)return{};var n={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(e.includes(o))continue;n[o]=t[o]}return n}function E9e(t,e){if(t==null)return{};var n,o,r=ago(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o{p.current=!1}},[]),m.useEffect(function(){b8&&c&&D9e()},[c]),m.useEffect(function(){g&&Gu(!!window.google,"useLoadScript was marked as loaded, but window.google is not present. Something went wrong.")},[g]);var C=Lrt({version:n,googleMapsApiKey:r,googleMapsClientId:i,language:a,region:l,libraries:s,channel:u,mapIds:d,authReferrerPolicy:f});m.useEffect(function(){if(!b8)return;function T(){p.current&&(y(!0),NHe=C)}if(window.google&&window.google.maps&&NHe===C){T();return}Wrt({id:e,url:C,nonce:o}).then(T).catch(function(x){p.current&&b(x),console.warn(` There has been an Error with loading Google Maps API script, please check that you provided correct google API key (`.concat(r||"-",") or Client ID (").concat(i||"-",`) Otherwise it is a Network issue. - `)),console.error(x)})},[e,C,o]);var P=m.useRef();return m.useEffect(function(){P.current&&s!==P.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),P.current=s},[s]),{isLoaded:g,loadError:w,url:C}}var sgo=["loadingElement","onLoad","onError","onUnmount","children"],cgo=h.jsx(Nrt,{});function ugo(t){var{loadingElement:e,onLoad:n,onError:o,onUnmount:r,children:i}=t,a=D9e(t,sgo),{isLoaded:l,loadError:s}=lgo(a);return m.useEffect(function(){l&&typeof n=="function"&&n()},[l,n]),m.useEffect(function(){s&&typeof o=="function"&&o(s)},[s,o]),m.useEffect(function(){return()=>{r&&r()}},[r]),l?i:e||cgo}m.memo(ugo);function dgo(t,e,n,o){function r(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function l(u){try{c(o.next(u))}catch(d){a(d)}}function s(u){try{c(o.throw(u))}catch(d){a(d)}}function c(u){u.done?i(u.value):r(u.value).then(l,s)}c((o=o.apply(t,[])).next())})}function fgo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var hgo=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var o,r,i;if(Array.isArray(e)){if(o=e.length,o!=n.length)return!1;for(r=o;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),o=i.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;r--!==0;){var a=i[r];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n},pgo=fgo(hgo),NHe="__googleMapsScriptId",dC;(function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.LOADING=1]="LOADING",t[t.SUCCESS=2]="SUCCESS",t[t.FAILURE=3]="FAILURE"})(dC||(dC={}));class Tv{constructor(e){var{apiKey:n,authReferrerPolicy:o,channel:r,client:i,id:a=NHe,language:l,libraries:s=[],mapIds:c,nonce:u,region:d,retries:f=3,url:p="https://maps.googleapis.com/maps/api/js",version:g}=e;if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=n,this.authReferrerPolicy=o,this.channel=r,this.client=i,this.id=a||NHe,this.language=l,this.libraries=s,this.mapIds=c,this.nonce=u,this.region=d,this.retries=f,this.url=p,this.version=g,Tv.instance){if(!pgo(this.options,Tv.instance.options))throw new Error("Loader must not be called again with different options. ".concat(JSON.stringify(this.options)," !== ").concat(JSON.stringify(Tv.instance.options)));return Tv.instance}Tv.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?dC.FAILURE:this.done?dC.SUCCESS:this.loading?dC.LOADING:dC.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){var e=this.url;return e+="?callback=__googleMapsCallback&loading=async",this.apiKey&&(e+="&key=".concat(this.apiKey)),this.channel&&(e+="&channel=".concat(this.channel)),this.client&&(e+="&client=".concat(this.client)),this.libraries.length>0&&(e+="&libraries=".concat(this.libraries.join(","))),this.language&&(e+="&language=".concat(this.language)),this.region&&(e+="®ion=".concat(this.region)),this.version&&(e+="&v=".concat(this.version)),this.mapIds&&(e+="&map_ids=".concat(this.mapIds.join(","))),this.authReferrerPolicy&&(e+="&auth_referrer_policy=".concat(this.authReferrerPolicy)),e}deleteScript(){var e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,n)=>{this.loadCallback(o=>{o?n(o.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,n;if(document.getElementById(this.id)){this.callback();return}var o={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(o).forEach(i=>!o[i]&&delete o[i]),!((n=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||n===void 0)&&n.importLibrary||(i=>{var a,l,s,c="The Google Maps JavaScript API",u="google",d="importLibrary",f="__ib__",p=document,g=window;g=g[u]||(g[u]={});var y=g.maps||(g.maps={}),w=new Set,b=new URLSearchParams,C=()=>a||(a=new Promise((P,v)=>dgo(this,void 0,void 0,function*(){var T;yield l=p.createElement("script"),l.id=this.id,b.set("libraries",[...w]+"");for(s in i)b.set(s.replace(/[A-Z]/g,A=>"_"+A[0].toLowerCase()),i[s]);b.set("callback",u+".maps."+f),l.src=this.url+"?"+b,y[f]=P,l.onerror=()=>a=v(Error(c+" could not load.")),l.nonce=this.nonce||((T=p.querySelector("script[nonce]"))===null||T===void 0?void 0:T.nonce)||"",p.head.append(l)})));y[d]?console.warn(c+" only loads once. Ignoring:",i):y[d]=function(P){for(var v=arguments.length,T=new Array(v>1?v-1:0),A=1;Ay[d](P,...T))}})(o);var r=this.libraries.map(i=>this.importLibrary(i));r.length||r.push(this.importLibrary("core")),Promise.all(r).then(()=>this.callback(),i=>{var a=new ErrorEvent("error",{error:i});this.loadErrorCallback(a)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){var n=this.errors.length*Math.pow(2,this.errors.length);console.error("Failed to load Google Maps script, retrying in ".concat(n," ms.")),setTimeout(()=>{this.deleteScript(),this.setScript()},n)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),!this.loading)if(this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading=!0,this.setScript()}}}var ggo=["maps"];function Urt(t){var{id:e=Uk.id,version:n=Uk.version,nonce:o,googleMapsApiKey:r,language:i,region:a,libraries:l=ggo,preventGoogleFontsLoading:s,mapIds:c,authReferrerPolicy:u}=t,d=m.useRef(!1),[f,p]=m.useState(!1),[g,y]=m.useState(void 0);m.useEffect(function(){return d.current=!0,()=>{d.current=!1}},[]);var w=m.useMemo(()=>new Tv({id:e,apiKey:r,version:n,libraries:l,language:i||"en",region:a||"US",mapIds:c||[],nonce:o||"",authReferrerPolicy:u||"origin"}),[e,r,n,l,i,a,c,o,u]);m.useEffect(function(){f||w.load().then(()=>{d.current&&p(!0)}).catch(P=>{y(P)})},[]),m.useEffect(()=>{b8&&s&&z9e()},[s]);var b=m.useRef();return m.useEffect(()=>{b.current&&l!==b.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),b.current=l},[l]),{isLoaded:f,loadError:g}}function UHe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function aJ(t){for(var e=1;e{i!==null&&i.setMap(r)},[r]),m.useEffect(()=>{e&&i!==null&&i.setOptions(e)},[i,e]),m.useEffect(()=>{var l=new google.maps.TrafficLayer(aJ(aJ({},e),{},{map:r}));return a(l),n&&n(l),()=>{i!==null&&(o&&o(i),i.setMap(null))}},[]),null}m.memo(mgo);class ygo extends m.PureComponent{constructor(){super(...arguments),fo(this,"state",{trafficLayer:null}),fo(this,"setTrafficLayerCallback",()=>{this.state.trafficLayer!==null&&this.props.onLoad&&this.props.onLoad(this.state.trafficLayer)}),fo(this,"registeredEvents",[])}componentDidMount(){var e=new google.maps.TrafficLayer(aJ(aJ({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:BHe,eventMap:jHe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{trafficLayer:e}},this.setTrafficLayerCallback)}componentDidUpdate(e){this.state.trafficLayer!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:BHe,eventMap:jHe,prevProps:e,nextProps:this.props,instance:this.state.trafficLayer}))}componentWillUnmount(){this.state.trafficLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),Ja(this.registeredEvents),this.state.trafficLayer.setMap(null))}render(){return null}}fo(ygo,"contextType",Sa);function Ago(t){var{onLoad:e,onUnmount:n}=t,o=m.useContext(Sa),[r,i]=m.useState(null);return m.useEffect(()=>{r!==null&&r.setMap(o)},[o]),m.useEffect(()=>{var a=new google.maps.BicyclingLayer;return i(a),a.setMap(o),e&&e(a),()=>{a!==null&&(n&&n(a),a.setMap(null))}},[]),null}m.memo(Ago);class wgo extends m.PureComponent{constructor(){super(...arguments),fo(this,"state",{bicyclingLayer:null}),fo(this,"setBicyclingLayerCallback",()=>{this.state.bicyclingLayer!==null&&(this.state.bicyclingLayer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.bicyclingLayer))})}componentDidMount(){var e=new google.maps.BicyclingLayer;this.setState(()=>({bicyclingLayer:e}),this.setBicyclingLayerCallback)}componentWillUnmount(){this.state.bicyclingLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))}render(){return null}}fo(wgo,"contextType",Sa);function vgo(t){var{onLoad:e,onUnmount:n}=t,o=m.useContext(Sa),[r,i]=m.useState(null);return m.useEffect(()=>{r!==null&&r.setMap(o)},[o]),m.useEffect(()=>{var a=new google.maps.TransitLayer;return i(a),a.setMap(o),e&&e(a),()=>{r!==null&&(n&&n(r),r.setMap(null))}},[]),null}m.memo(vgo);class xgo extends m.PureComponent{constructor(){super(...arguments),fo(this,"state",{transitLayer:null}),fo(this,"setTransitLayerCallback",()=>{this.state.transitLayer!==null&&(this.state.transitLayer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.transitLayer))})}componentDidMount(){var e=new google.maps.TransitLayer;this.setState(function(){return{transitLayer:e}},this.setTransitLayerCallback)}componentWillUnmount(){this.state.transitLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))}render(){return null}}fo(xgo,"contextType",Sa);function YHe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function lJ(t){for(var e=1;e{f!==null&&f.setMap(d)},[d]),m.useEffect(()=>{e&&f!==null&&f.setOptions(e)},[f,e]),m.useEffect(()=>{f!==null&&f.setDrawingMode(n??null)},[f,n]),m.useEffect(()=>{f&&o&&(g!==null&&google.maps.event.removeListener(g),y(google.maps.event.addListener(f,"circlecomplete",o)))},[f,o]),m.useEffect(()=>{f&&r&&(w!==null&&google.maps.event.removeListener(w),b(google.maps.event.addListener(f,"markercomplete",r)))},[f,r]),m.useEffect(()=>{f&&i&&(C!==null&&google.maps.event.removeListener(C),P(google.maps.event.addListener(f,"overlaycomplete",i)))},[f,i]),m.useEffect(()=>{f&&a&&(v!==null&&google.maps.event.removeListener(v),T(google.maps.event.addListener(f,"polygoncomplete",a)))},[f,a]),m.useEffect(()=>{f&&l&&(A!==null&&google.maps.event.removeListener(A),x(google.maps.event.addListener(f,"polylinecomplete",l)))},[f,l]),m.useEffect(()=>{f&&s&&(S!==null&&google.maps.event.removeListener(S),R(google.maps.event.addListener(f,"rectanglecomplete",s)))},[f,s]),m.useEffect(()=>{Gu(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing);var M=new google.maps.drawing.DrawingManager(lJ(lJ({},e),{},{map:d}));return n&&M.setDrawingMode(n),o&&y(google.maps.event.addListener(M,"circlecomplete",o)),r&&b(google.maps.event.addListener(M,"markercomplete",r)),i&&P(google.maps.event.addListener(M,"overlaycomplete",i)),a&&T(google.maps.event.addListener(M,"polygoncomplete",a)),l&&x(google.maps.event.addListener(M,"polylinecomplete",l)),s&&R(google.maps.event.addListener(M,"rectanglecomplete",s)),p(M),c&&c(M),()=>{f!==null&&(g&&google.maps.event.removeListener(g),w&&google.maps.event.removeListener(w),C&&google.maps.event.removeListener(C),v&&google.maps.event.removeListener(v),A&&google.maps.event.removeListener(A),S&&google.maps.event.removeListener(S),u&&u(f),f.setMap(null))}},[]),null}m.memo(bgo);class Sgo extends m.PureComponent{constructor(e){super(e),fo(this,"registeredEvents",[]),fo(this,"state",{drawingManager:null}),fo(this,"setDrawingManagerCallback",()=>{this.state.drawingManager!==null&&this.props.onLoad&&this.props.onLoad(this.state.drawingManager)}),Gu(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing)}componentDidMount(){var e=new google.maps.drawing.DrawingManager(lJ(lJ({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:_He,eventMap:OHe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{drawingManager:e}},this.setDrawingManagerCallback)}componentDidUpdate(e){this.state.drawingManager!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:_He,eventMap:OHe,prevProps:e,nextProps:this.props,instance:this.state.drawingManager}))}componentWillUnmount(){this.state.drawingManager!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),Ja(this.registeredEvents),this.state.drawingManager.setMap(null))}render(){return null}}fo(Sgo,"contextType",Sa);function VHe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function LC(t){for(var e=1;e{Q!==null&&Q.setMap($)},[$]),m.useEffect(()=>{typeof n<"u"&&Q!==null&&Q.setOptions(n)},[Q,n]),m.useEffect(()=>{typeof a<"u"&&Q!==null&&Q.setDraggable(a)},[Q,a]),m.useEffect(()=>{e&&Q!==null&&Q.setPosition(e)},[Q,e]),m.useEffect(()=>{typeof l<"u"&&Q!==null&&Q.setVisible(l)},[Q,l]),m.useEffect(()=>{Q==null||Q.setAnimation(s)},[Q,s]),m.useEffect(()=>{Q&&c!==void 0&&Q.setClickable(c)},[Q,c]),m.useEffect(()=>{Q&&u!==void 0&&Q.setCursor(u)},[Q,u]),m.useEffect(()=>{Q&&d!==void 0&&Q.setIcon(d)},[Q,d]),m.useEffect(()=>{Q&&f!==void 0&&Q.setLabel(f)},[Q,f]),m.useEffect(()=>{Q&&p!==void 0&&Q.setOpacity(p)},[Q,p]),m.useEffect(()=>{Q&&g!==void 0&&Q.setShape(g)},[Q,g]),m.useEffect(()=>{Q&&y!==void 0&&Q.setTitle(y)},[Q,y]),m.useEffect(()=>{Q&&w!==void 0&&Q.setZIndex(w)},[Q,w]),m.useEffect(()=>{Q&&C&&(q!==null&&google.maps.event.removeListener(q),te(google.maps.event.addListener(Q,"dblclick",C)))},[C]),m.useEffect(()=>{Q&&v&&(re!==null&&google.maps.event.removeListener(re),ae(google.maps.event.addListener(Q,"dragend",v)))},[v]),m.useEffect(()=>{Q&&T&&(se!==null&&google.maps.event.removeListener(se),ne(google.maps.event.addListener(Q,"dragstart",T)))},[T]),m.useEffect(()=>{Q&&R&&(fe!==null&&google.maps.event.removeListener(fe),ge(google.maps.event.addListener(Q,"mousedown",R)))},[R]),m.useEffect(()=>{Q&&A&&(de!==null&&google.maps.event.removeListener(de),Z(google.maps.event.addListener(Q,"mouseout",A)))},[A]),m.useEffect(()=>{Q&&x&&(he!==null&&google.maps.event.removeListener(he),xe(google.maps.event.addListener(Q,"mouseover",x)))},[x]),m.useEffect(()=>{Q&&S&&(He!==null&&google.maps.event.removeListener(He),Se(google.maps.event.addListener(Q,"mouseup",S)))},[S]),m.useEffect(()=>{Q&&M&&(ze!==null&&google.maps.event.removeListener(ze),Ie(google.maps.event.addListener(Q,"rightclick",M)))},[M]),m.useEffect(()=>{Q&&b&&(ye!==null&&google.maps.event.removeListener(ye),ce(google.maps.event.addListener(Q,"click",b)))},[b]),m.useEffect(()=>{Q&&P&&(pe!==null&&google.maps.event.removeListener(pe),ve(google.maps.event.addListener(Q,"drag",P)))},[P]),m.useEffect(()=>{Q&&D&&(Ae!==null&&google.maps.event.removeListener(Ae),Te(google.maps.event.addListener(Q,"clickable_changed",D)))},[D]),m.useEffect(()=>{Q&&E&&(Me!==null&&google.maps.event.removeListener(Me),Pe(google.maps.event.addListener(Q,"cursor_changed",E)))},[E]),m.useEffect(()=>{Q&&W&&(Ee!==null&&google.maps.event.removeListener(Ee),Be(google.maps.event.addListener(Q,"animation_changed",W)))},[W]),m.useEffect(()=>{Q&&j&&(Je!==null&&google.maps.event.removeListener(Je),We(google.maps.event.addListener(Q,"draggable_changed",j)))},[j]),m.useEffect(()=>{Q&&L&&(Ke!==null&&google.maps.event.removeListener(Ke),Ne(google.maps.event.addListener(Q,"flat_changed",L)))},[L]),m.useEffect(()=>{Q&&k&&(De!==null&&google.maps.event.removeListener(De),ke(google.maps.event.addListener(Q,"icon_changed",k)))},[k]),m.useEffect(()=>{Q&&N&&(Ye!==null&&google.maps.event.removeListener(Ye),it(google.maps.event.addListener(Q,"position_changed",N)))},[N]),m.useEffect(()=>{Q&&F&&(Ve!==null&&google.maps.event.removeListener(Ve),yt(google.maps.event.addListener(Q,"shape_changed",F)))},[F]),m.useEffect(()=>{Q&&U&&(ct!==null&&google.maps.event.removeListener(ct),Xe(google.maps.event.addListener(Q,"title_changed",U)))},[U]),m.useEffect(()=>{Q&&O&&(ut!==null&&google.maps.event.removeListener(ut),ft(google.maps.event.addListener(Q,"visible_changed",O)))},[O]),m.useEffect(()=>{Q&&B&&(ot!==null&&google.maps.event.removeListener(ot),st(google.maps.event.addListener(Q,"zindex_changed",B)))},[B]),m.useEffect(()=>{var Oe=LC(LC(LC({},n||sJ),o?sJ:{map:$}),{},{position:e}),Ze=new google.maps.Marker(Oe);return o?o.addMarker(Ze,!!r):Ze.setMap($),e&&Ze.setPosition(e),typeof l<"u"&&Ze.setVisible(l),typeof a<"u"&&Ze.setDraggable(a),typeof c<"u"&&Ze.setClickable(c),typeof u=="string"&&Ze.setCursor(u),d&&Ze.setIcon(d),typeof f<"u"&&Ze.setLabel(f),typeof p<"u"&&Ze.setOpacity(p),g&&Ze.setShape(g),typeof y=="string"&&Ze.setTitle(y),typeof w=="number"&&Ze.setZIndex(w),C&&te(google.maps.event.addListener(Ze,"dblclick",C)),v&&ae(google.maps.event.addListener(Ze,"dragend",v)),T&&ne(google.maps.event.addListener(Ze,"dragstart",T)),R&&ge(google.maps.event.addListener(Ze,"mousedown",R)),A&&Z(google.maps.event.addListener(Ze,"mouseout",A)),x&&xe(google.maps.event.addListener(Ze,"mouseover",x)),S&&Se(google.maps.event.addListener(Ze,"mouseup",S)),M&&Ie(google.maps.event.addListener(Ze,"rightclick",M)),b&&ce(google.maps.event.addListener(Ze,"click",b)),P&&ve(google.maps.event.addListener(Ze,"drag",P)),D&&Te(google.maps.event.addListener(Ze,"clickable_changed",D)),E&&Pe(google.maps.event.addListener(Ze,"cursor_changed",E)),W&&Be(google.maps.event.addListener(Ze,"animation_changed",W)),j&&We(google.maps.event.addListener(Ze,"draggable_changed",j)),L&&Ne(google.maps.event.addListener(Ze,"flat_changed",L)),k&&ke(google.maps.event.addListener(Ze,"icon_changed",k)),N&&it(google.maps.event.addListener(Ze,"position_changed",N)),F&&yt(google.maps.event.addListener(Ze,"shape_changed",F)),U&&Xe(google.maps.event.addListener(Ze,"title_changed",U)),O&&ft(google.maps.event.addListener(Ze,"visible_changed",O)),B&&st(google.maps.event.addListener(Ze,"zindex_changed",B)),le(Ze),_&&_(Ze),()=>{q!==null&&google.maps.event.removeListener(q),re!==null&&google.maps.event.removeListener(re),se!==null&&google.maps.event.removeListener(se),fe!==null&&google.maps.event.removeListener(fe),de!==null&&google.maps.event.removeListener(de),he!==null&&google.maps.event.removeListener(he),He!==null&&google.maps.event.removeListener(He),ze!==null&&google.maps.event.removeListener(ze),ye!==null&&google.maps.event.removeListener(ye),Ae!==null&&google.maps.event.removeListener(Ae),Me!==null&&google.maps.event.removeListener(Me),Ee!==null&&google.maps.event.removeListener(Ee),Je!==null&&google.maps.event.removeListener(Je),Ke!==null&&google.maps.event.removeListener(Ke),De!==null&&google.maps.event.removeListener(De),Ye!==null&&google.maps.event.removeListener(Ye),ct!==null&&google.maps.event.removeListener(ct),ut!==null&&google.maps.event.removeListener(ut),ot!==null&&google.maps.event.removeListener(ot),X&&X(Ze),o?o.removeMarker(Ze,!!r):Ze&&Ze.setMap(null)}},[]);var at=m.useMemo(()=>i?m.Children.map(i,Oe=>{if(!m.isValidElement(Oe))return Oe;var Ze=Oe;return m.cloneElement(Ze,{anchor:Q})}):null,[i,Q]);return h.jsx(h.Fragment,{children:at})||null}m.memo(Tgo);class yfe extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[])}componentDidMount(){var e=this;return krt(function*(){var n=LC(LC(LC({},e.props.options||sJ),e.props.clusterer?sJ:{map:e.context}),{},{position:e.props.position});e.marker=new google.maps.Marker(n),e.props.clusterer?e.props.clusterer.addMarker(e.marker,!!e.props.noClustererRedraw):e.marker.setMap(e.context),e.registeredEvents=Ba({updaterMap:XHe,eventMap:GHe,prevProps:{},nextProps:e.props,instance:e.marker}),e.props.onLoad&&e.props.onLoad(e.marker)})()}componentDidUpdate(e){this.marker&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:XHe,eventMap:GHe,prevProps:e,nextProps:this.props,instance:this.marker}))}componentWillUnmount(){this.marker&&(this.props.onUnmount&&this.props.onUnmount(this.marker),Ja(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.marker,!!this.props.noClustererRedraw):this.marker&&this.marker.setMap(null))}render(){var e=this.props.children?m.Children.map(this.props.children,n=>{if(!m.isValidElement(n))return n;var o=n;return m.cloneElement(o,{anchor:this.marker})}):null;return e||null}}fo(yfe,"contextType",Sa);var Pgo=function(){function t(e,n){e.getClusterer().extend(t,google.maps.OverlayView),this.cluster=e,this.clusterClassName=this.cluster.getClusterer().getClusterClass(),this.className=this.clusterClassName,this.styles=n,this.center=void 0,this.div=null,this.sums=null,this.visible=!1,this.boundsChangedListener=null,this.url="",this.height=0,this.width=0,this.anchorText=[0,0],this.anchorIcon=[0,0],this.textColor="black",this.textSize=11,this.textDecoration="none",this.fontWeight="bold",this.fontStyle="normal",this.fontFamily="Arial,sans-serif",this.backgroundPosition="0 0",this.cMouseDownInCluster=null,this.cDraggingMapByCluster=null,this.timeOut=null,this.setMap(e.getMap()),this.onBoundsChanged=this.onBoundsChanged.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onClick=this.onClick.bind(this),this.onMouseOver=this.onMouseOver.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onAdd=this.onAdd.bind(this),this.onRemove=this.onRemove.bind(this),this.draw=this.draw.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.useStyle=this.useStyle.bind(this),this.setCenter=this.setCenter.bind(this),this.getPosFromLatLng=this.getPosFromLatLng.bind(this)}return t.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},t.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},t.prototype.onClick=function(e){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var n=this.cluster.getClusterer();if(google.maps.event.trigger(n,"click",this.cluster),google.maps.event.trigger(n,"clusterclick",this.cluster),n.getZoomOnClick()){var o=n.getMaxZoom(),r=this.cluster.getBounds(),i=n.getMap();i!==null&&"fitBounds"in i&&i.fitBounds(r),this.timeOut=window.setTimeout(function(){var a=n.getMap();if(a!==null){"fitBounds"in a&&a.fitBounds(r);var l=a.getZoom()||0;o!==null&&l>o&&a.setZoom(o+1)}},100)}e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}},t.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},t.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},t.prototype.onAdd=function(){var e;this.div=document.createElement("div"),this.div.className=this.className,this.visible&&this.show(),(e=this.getPanes())===null||e===void 0||e.overlayMouseTarget.appendChild(this.div);var n=this.getMap();n!==null&&(this.boundsChangedListener=google.maps.event.addListener(n,"bounds_changed",this.onBoundsChanged),this.div.addEventListener("mousedown",this.onMouseDown),this.div.addEventListener("click",this.onClick),this.div.addEventListener("mouseover",this.onMouseOver),this.div.addEventListener("mouseout",this.onMouseOut))},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.hide(),this.boundsChangedListener!==null&&google.maps.event.removeListener(this.boundsChangedListener),this.div.removeEventListener("mousedown",this.onMouseDown),this.div.removeEventListener("click",this.onClick),this.div.removeEventListener("mouseover",this.onMouseOver),this.div.removeEventListener("mouseout",this.onMouseOut),this.div.parentNode.removeChild(this.div),this.timeOut!==null&&(window.clearTimeout(this.timeOut),this.timeOut=null),this.div=null)},t.prototype.draw=function(){if(this.visible&&this.div!==null&&this.center){var e=this.getPosFromLatLng(this.center);this.div.style.top=e!==null?"".concat(e.y,"px"):"0",this.div.style.left=e!==null?"".concat(e.x,"px"):"0"}},t.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},t.prototype.show=function(){var e,n,o,r,i,a;if(this.div&&this.center){var l=this.sums===null||typeof this.sums.title>"u"||this.sums.title===""?this.cluster.getClusterer().getTitle():this.sums.title,s=this.backgroundPosition.split(" "),c=parseInt(((e=s[0])===null||e===void 0?void 0:e.replace(/^\s+|\s+$/g,""))||"0",10),u=parseInt(((n=s[1])===null||n===void 0?void 0:n.replace(/^\s+|\s+$/g,""))||"0",10),d=this.getPosFromLatLng(this.center);this.div.className=this.className,this.div.setAttribute("style","cursor: pointer; position: absolute; top: ".concat(d!==null?"".concat(d.y,"px"):"0","; left: ").concat(d!==null?"".concat(d.x,"px"):"0","; width: ").concat(this.width,"px; height: ").concat(this.height,"px; "));var f=document.createElement("img");f.alt=l,f.src=this.url,f.width=this.width,f.height=this.height,f.setAttribute("style","position: absolute; top: ".concat(u,"px; left: ").concat(c,"px")),this.cluster.getClusterer().enableRetinaIcons||(f.style.clip="rect(-".concat(u,"px, -").concat(c+this.width,"px, -").concat(u+this.height,", -").concat(c,")"));var p=document.createElement("div");p.setAttribute("style","position: absolute; top: ".concat(this.anchorText[0],"px; left: ").concat(this.anchorText[1],"px; color: ").concat(this.textColor,"; font-size: ").concat(this.textSize,"px; font-family: ").concat(this.fontFamily,"; font-weight: ").concat(this.fontWeight,"; fontStyle: ").concat(this.fontStyle,"; text-decoration: ").concat(this.textDecoration,"; text-align: center; width: ").concat(this.width,"px; line-height: ").concat(this.height,"px")),!((o=this.sums)===null||o===void 0)&&o.text&&(p.innerText="".concat((r=this.sums)===null||r===void 0?void 0:r.text)),!((i=this.sums)===null||i===void 0)&&i.html&&(p.innerHTML="".concat((a=this.sums)===null||a===void 0?void 0:a.html)),this.div.innerHTML="",this.div.appendChild(f),this.div.appendChild(p),this.div.title=l,this.div.style.display=""}this.visible=!0},t.prototype.useStyle=function(e){this.sums=e;var n=this.cluster.getClusterer().getStyles(),o=n[Math.min(n.length-1,Math.max(0,e.index-1))];o&&(this.url=o.url,this.height=o.height,this.width=o.width,o.className&&(this.className="".concat(this.clusterClassName," ").concat(o.className)),this.anchorText=o.anchorText||[0,0],this.anchorIcon=o.anchorIcon||[this.height/2,this.width/2],this.textColor=o.textColor||"black",this.textSize=o.textSize||11,this.textDecoration=o.textDecoration||"none",this.fontWeight=o.fontWeight||"bold",this.fontStyle=o.fontStyle||"normal",this.fontFamily=o.fontFamily||"Arial,sans-serif",this.backgroundPosition=o.backgroundPosition||"0 0")},t.prototype.setCenter=function(e){this.center=e},t.prototype.getPosFromLatLng=function(e){var n=this.getProjection().fromLatLngToDivPixel(e);return n!==null&&(n.x-=this.anchorIcon[1],n.y-=this.anchorIcon[0]),n},t}(),Cgo=function(){function t(e){this.markerClusterer=e,this.map=this.markerClusterer.getMap(),this.gridSize=this.markerClusterer.getGridSize(),this.minClusterSize=this.markerClusterer.getMinimumClusterSize(),this.averageCenter=this.markerClusterer.getAverageCenter(),this.markers=[],this.center=void 0,this.bounds=null,this.clusterIcon=new Pgo(this,this.markerClusterer.getStyles()),this.getSize=this.getSize.bind(this),this.getMarkers=this.getMarkers.bind(this),this.getCenter=this.getCenter.bind(this),this.getMap=this.getMap.bind(this),this.getClusterer=this.getClusterer.bind(this),this.getBounds=this.getBounds.bind(this),this.remove=this.remove.bind(this),this.addMarker=this.addMarker.bind(this),this.isMarkerInClusterBounds=this.isMarkerInClusterBounds.bind(this),this.calculateBounds=this.calculateBounds.bind(this),this.updateIcon=this.updateIcon.bind(this),this.isMarkerAlreadyAdded=this.isMarkerAlreadyAdded.bind(this)}return t.prototype.getSize=function(){return this.markers.length},t.prototype.getMarkers=function(){return this.markers},t.prototype.getCenter=function(){return this.center},t.prototype.getMap=function(){return this.map},t.prototype.getClusterer=function(){return this.markerClusterer},t.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center,this.center),n=this.getMarkers(),o=0,r=n;oa)e.getMap()!==this.map&&e.setMap(this.map);else if(io){this.clusterIcon.hide();return}if(n0))for(var e=0;e3?new google.maps.LatLngBounds(r==null?void 0:r.getSouthWest(),r==null?void 0:r.getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625)),l=this.getExtendedBounds(a),s=Math.min(e+this.batchSize,this.markers.length),c=e;c{R&&A&&(F!==null&&google.maps.event.removeListener(F),U(google.maps.event.addListener(R,Sm.onMouseOut,A)))},[A]),m.useEffect(()=>{R&&T&&(O!==null&&google.maps.event.removeListener(O),B(google.maps.event.addListener(R,Sm.onMouseOver,T)))},[T]),m.useEffect(()=>{R&&C&&(E!==null&&google.maps.event.removeListener(E),W(google.maps.event.addListener(R,Sm.onClick,C)))},[C]),m.useEffect(()=>{R&&P&&(j!==null&&google.maps.event.removeListener(j),L(google.maps.event.addListener(R,Sm.onClusteringBegin,P)))},[P]),m.useEffect(()=>{R&&v&&(k!==null&&google.maps.event.removeListener(k),L(google.maps.event.addListener(R,Sm.onClusteringEnd,v)))},[v]),m.useEffect(()=>{typeof o<"u"&&R!==null&&Il.averageCenter(R,o)},[R,o]),m.useEffect(()=>{typeof r<"u"&&R!==null&&Il.batchSizeIE(R,r)},[R,r]),m.useEffect(()=>{typeof i<"u"&&R!==null&&Il.calculator(R,i)},[R,i]),m.useEffect(()=>{typeof a<"u"&&R!==null&&Il.clusterClass(R,a)},[R,a]),m.useEffect(()=>{typeof l<"u"&&R!==null&&Il.enableRetinaIcons(R,l)},[R,l]),m.useEffect(()=>{typeof s<"u"&&R!==null&&Il.gridSize(R,s)},[R,s]),m.useEffect(()=>{typeof c<"u"&&R!==null&&Il.ignoreHidden(R,c)},[R,c]),m.useEffect(()=>{typeof u<"u"&&R!==null&&Il.imageExtension(R,u)},[R,u]),m.useEffect(()=>{typeof d<"u"&&R!==null&&Il.imagePath(R,d)},[R,d]),m.useEffect(()=>{typeof f<"u"&&R!==null&&Il.imageSizes(R,f)},[R,f]),m.useEffect(()=>{typeof p<"u"&&R!==null&&Il.maxZoom(R,p)},[R,p]),m.useEffect(()=>{typeof g<"u"&&R!==null&&Il.minimumClusterSize(R,g)},[R,g]),m.useEffect(()=>{typeof y<"u"&&R!==null&&Il.styles(R,y)},[R,y]),m.useEffect(()=>{typeof w<"u"&&R!==null&&Il.title(R,w)},[R,w]),m.useEffect(()=>{typeof b<"u"&&R!==null&&Il.zoomOnClick(R,b)},[R,b]),m.useEffect(()=>{if(D){var _=Fgo({},n||kgo),X=new jrt(D,[],_);return o&&Il.averageCenter(X,o),r&&Il.batchSizeIE(X,r),i&&Il.calculator(X,i),a&&Il.clusterClass(X,a),l&&Il.enableRetinaIcons(X,l),s&&Il.gridSize(X,s),c&&Il.ignoreHidden(X,c),u&&Il.imageExtension(X,u),d&&Il.imagePath(X,d),f&&Il.imageSizes(X,f),p&&Il.maxZoom(X,p),g&&Il.minimumClusterSize(X,g),y&&Il.styles(X,y),w&&Il.title(X,w),b&&Il.zoomOnClick(X,b),A&&U(google.maps.event.addListener(X,Sm.onMouseOut,A)),T&&B(google.maps.event.addListener(X,Sm.onMouseOver,T)),C&&W(google.maps.event.addListener(X,Sm.onClick,C)),P&&L(google.maps.event.addListener(X,Sm.onClusteringBegin,P)),v&&N(google.maps.event.addListener(X,Sm.onClusteringEnd,v)),M(X),x&&x(X),()=>{F!==null&&google.maps.event.removeListener(F),O!==null&&google.maps.event.removeListener(O),E!==null&&google.maps.event.removeListener(E),j!==null&&google.maps.event.removeListener(j),k!==null&&google.maps.event.removeListener(k),S&&S(X)}}},[]),R!==null&&e(R)||null}m.memo(Lgo);class Brt extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{markerClusterer:null}),fo(this,"setClustererCallback",()=>{this.state.markerClusterer!==null&&this.props.onLoad&&this.props.onLoad(this.state.markerClusterer)})}componentDidMount(){if(this.context){var e=new jrt(this.context,[],this.props.options);this.registeredEvents=Ba({updaterMap:Il,eventMap:Sm,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({markerClusterer:e}),this.setClustererCallback)}}componentDidUpdate(e){this.state.markerClusterer&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:Il,eventMap:Sm,prevProps:e,nextProps:this.props,instance:this.state.markerClusterer}))}componentWillUnmount(){this.state.markerClusterer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.markerClusterer),Ja(this.registeredEvents),this.state.markerClusterer.setMap(null))}render(){return this.state.markerClusterer!==null?this.props.children(this.state.markerClusterer):null}}fo(Brt,"contextType",Sa);function KHe(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}var Yrt=function(){function t(e){e===void 0&&(e={}),this.getCloseClickHandler=this.getCloseClickHandler.bind(this),this.closeClickHandler=this.closeClickHandler.bind(this),this.createInfoBoxDiv=this.createInfoBoxDiv.bind(this),this.addClickHandler=this.addClickHandler.bind(this),this.getCloseBoxImg=this.getCloseBoxImg.bind(this),this.getBoxWidths=this.getBoxWidths.bind(this),this.setBoxStyle=this.setBoxStyle.bind(this),this.setPosition=this.setPosition.bind(this),this.getPosition=this.getPosition.bind(this),this.setOptions=this.setOptions.bind(this),this.setContent=this.setContent.bind(this),this.setVisible=this.setVisible.bind(this),this.getContent=this.getContent.bind(this),this.getVisible=this.getVisible.bind(this),this.setZIndex=this.setZIndex.bind(this),this.getZIndex=this.getZIndex.bind(this),this.onRemove=this.onRemove.bind(this),this.panBox=this.panBox.bind(this),this.extend=this.extend.bind(this),this.close=this.close.bind(this),this.draw=this.draw.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.open=this.open.bind(this),this.extend(t,google.maps.OverlayView),this.content=e.content||"",this.disableAutoPan=e.disableAutoPan||!1,this.maxWidth=e.maxWidth||0,this.pixelOffset=e.pixelOffset||new google.maps.Size(0,0),this.position=e.position||new google.maps.LatLng(0,0),this.zIndex=e.zIndex||null,this.boxClass=e.boxClass||"infoBox",this.boxStyle=e.boxStyle||{},this.closeBoxMargin=e.closeBoxMargin||"2px",this.closeBoxURL=e.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",e.closeBoxURL===""&&(this.closeBoxURL=""),this.infoBoxClearance=e.infoBoxClearance||new google.maps.Size(1,1),typeof e.visible>"u"&&(typeof e.isHidden>"u"?e.visible=!0:e.visible=!e.isHidden),this.isHidden=!e.visible,this.alignBottom=e.alignBottom||!1,this.pane=e.pane||"floatPane",this.enableEventPropagation=e.enableEventPropagation||!1,this.div=null,this.closeListener=null,this.moveListener=null,this.mapListener=null,this.contextListener=null,this.eventListeners=null,this.fixedWidthSet=null}return t.prototype.createInfoBoxDiv=function(){var e=this,n=function(u){u.returnValue=!1,u.preventDefault&&u.preventDefault(),e.enableEventPropagation||KHe(u)};if(!this.div){this.div=document.createElement("div"),this.setBoxStyle(),typeof this.content=="string"?this.div.innerHTML=this.getCloseBoxImg()+this.content:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(this.content));var o=this.getPanes();if(o!==null&&o[this.pane].appendChild(this.div),this.addClickHandler(),this.div.style.width)this.fixedWidthSet=!0;else if(this.maxWidth!==0&&this.div.offsetWidth>this.maxWidth)this.div.style.width=this.maxWidth+"px",this.fixedWidthSet=!0;else{var r=this.getBoxWidths();this.div.style.width=this.div.offsetWidth-r.left-r.right+"px",this.fixedWidthSet=!1}if(this.panBox(this.disableAutoPan),!this.enableEventPropagation){this.eventListeners=[];for(var i=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],a=0,l=i;al&&(o=w.x+d+c+p-l),this.alignBottom?w.y<-u+g+f?r=w.y+u-g-f:w.y+u+g>s&&(r=w.y+u+g-s):w.y<-u+g?r=w.y+u-g:w.y+f+u+g>s&&(r=w.y+f+u+g-s)),o===0&&r===0||n.panBy(o,r)}}},t.prototype.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var e=this.boxStyle;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this.div.style[n]=e[n]);if(this.div.style.webkitTransform="translateZ(0)",typeof this.div.style.opacity<"u"&&this.div.style.opacity!==""){var o=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+o*100+')"',this.div.style.filter="alpha(opacity="+o*100+")"}this.div.style.position="absolute",this.div.style.visibility="hidden",this.zIndex!==null&&(this.div.style.zIndex=this.zIndex+""),this.div.style.overflow||(this.div.style.overflow="auto")}},t.prototype.getBoxWidths=function(){var e={top:0,bottom:0,left:0,right:0};if(!this.div)return e;if(document.defaultView){var n=this.div.ownerDocument,o=n&&n.defaultView?n.defaultView.getComputedStyle(this.div,""):null;o&&(e.top=parseInt(o.borderTopWidth||"",10)||0,e.bottom=parseInt(o.borderBottomWidth||"",10)||0,e.left=parseInt(o.borderLeftWidth||"",10)||0,e.right=parseInt(o.borderRightWidth||"",10)||0)}else if(document.documentElement.currentStyle){var r=this.div.currentStyle;r&&(e.top=parseInt(r.borderTopWidth||"",10)||0,e.bottom=parseInt(r.borderBottomWidth||"",10)||0,e.left=parseInt(r.borderLeftWidth||"",10)||0,e.right=parseInt(r.borderRightWidth||"",10)||0)}return e},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},t.prototype.draw=function(){if(this.createInfoBoxDiv(),this.div){var e=this.getProjection(),n=e.fromLatLngToDivPixel(this.position);n!==null&&(this.div.style.left=n.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(n.y+this.pixelOffset.height)+"px":this.div.style.top=n.y+this.pixelOffset.height+"px"),this.isHidden?this.div.style.visibility="hidden":this.div.style.visibility="visible"}},t.prototype.setOptions=function(e){e===void 0&&(e={}),typeof e.boxClass<"u"&&(this.boxClass=e.boxClass,this.setBoxStyle()),typeof e.boxStyle<"u"&&(this.boxStyle=e.boxStyle,this.setBoxStyle()),typeof e.content<"u"&&this.setContent(e.content),typeof e.disableAutoPan<"u"&&(this.disableAutoPan=e.disableAutoPan),typeof e.maxWidth<"u"&&(this.maxWidth=e.maxWidth),typeof e.pixelOffset<"u"&&(this.pixelOffset=e.pixelOffset),typeof e.alignBottom<"u"&&(this.alignBottom=e.alignBottom),typeof e.position<"u"&&this.setPosition(e.position),typeof e.zIndex<"u"&&this.setZIndex(e.zIndex),typeof e.closeBoxMargin<"u"&&(this.closeBoxMargin=e.closeBoxMargin),typeof e.closeBoxURL<"u"&&(this.closeBoxURL=e.closeBoxURL),typeof e.infoBoxClearance<"u"&&(this.infoBoxClearance=e.infoBoxClearance),typeof e.isHidden<"u"&&(this.isHidden=e.isHidden),typeof e.visible<"u"&&(this.isHidden=!e.visible),typeof e.enableEventPropagation<"u"&&(this.enableEventPropagation=e.enableEventPropagation),this.div&&this.draw()},t.prototype.setContent=function(e){this.content=e,this.div&&(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.fixedWidthSet||(this.div.style.width=""),typeof e=="string"?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e)),this.fixedWidthSet||(this.div.style.width=this.div.offsetWidth+"px",typeof e=="string"?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e))),this.addClickHandler()),google.maps.event.trigger(this,"content_changed")},t.prototype.setPosition=function(e){this.position=e,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},t.prototype.setVisible=function(e){this.isHidden=!e,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},t.prototype.setZIndex=function(e){this.zIndex=e,this.div&&(this.div.style.zIndex=e+""),google.maps.event.trigger(this,"zindex_changed")},t.prototype.getContent=function(){return this.content},t.prototype.getPosition=function(){return this.position},t.prototype.getZIndex=function(){return this.zIndex},t.prototype.getVisible=function(){var e=this.getMap();return typeof e>"u"||e===null?!1:!this.isHidden},t.prototype.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},t.prototype.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},t.prototype.open=function(e,n){var o=this;n&&(this.position=n.getPosition(),this.moveListener=google.maps.event.addListener(n,"position_changed",function(){var r=n.getPosition();o.setPosition(r)}),this.mapListener=google.maps.event.addListener(n,"map_changed",function(){o.setMap(n.map)})),this.setMap(e),this.div&&this.panBox()},t.prototype.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var e=0,n=this.eventListeners;e{p&&g!==null&&(g.close(),n?g.open(p,n):g.getPosition()&&g.open(p))},[p,g,n]),m.useEffect(()=>{o&&g!==null&&g.setOptions(o)},[g,o]),m.useEffect(()=>{if(r&&g!==null){var D=r instanceof google.maps.LatLng?r:new google.maps.LatLng(r.lat,r.lng);g.setPosition(D)}},[r]),m.useEffect(()=>{typeof i=="number"&&g!==null&&g.setZIndex(i)},[i]),m.useEffect(()=>{g&&a&&(w!==null&&google.maps.event.removeListener(w),b(google.maps.event.addListener(g,"closeclick",a)))},[a]),m.useEffect(()=>{g&&l&&(C!==null&&google.maps.event.removeListener(C),P(google.maps.event.addListener(g,"domready",l)))},[l]),m.useEffect(()=>{g&&s&&(v!==null&&google.maps.event.removeListener(v),T(google.maps.event.addListener(g,"content_changed",s)))},[s]),m.useEffect(()=>{g&&c&&(A!==null&&google.maps.event.removeListener(A),x(google.maps.event.addListener(g,"position_changed",c)))},[c]),m.useEffect(()=>{g&&u&&(S!==null&&google.maps.event.removeListener(S),R(google.maps.event.addListener(g,"zindex_changed",u)))},[u]),m.useEffect(()=>{if(p){var D=o||Ugo,{position:E}=D,W=D9e(D,Wgo),j;E&&!(E instanceof google.maps.LatLng)&&(j=new google.maps.LatLng(E.lat,E.lng));var L=new Yrt(cJ(cJ({},W),j?{position:j}:{}));M.current=document.createElement("div"),y(L),a&&b(google.maps.event.addListener(L,"closeclick",a)),l&&P(google.maps.event.addListener(L,"domready",l)),s&&T(google.maps.event.addListener(L,"content_changed",s)),c&&x(google.maps.event.addListener(L,"position_changed",c)),u&&R(google.maps.event.addListener(L,"zindex_changed",u)),L.setContent(M.current),n?L.open(p,n):L.getPosition()?L.open(p):Gu(!1,"You must provide either an anchor or a position prop for ."),d&&d(L)}return()=>{g!==null&&(w&&google.maps.event.removeListener(w),v&&google.maps.event.removeListener(v),C&&google.maps.event.removeListener(C),A&&google.maps.event.removeListener(A),S&&google.maps.event.removeListener(S),f&&f(g),g.close())}},[]),M.current?Cd.createPortal(m.Children.only(e),M.current):null}m.memo(jgo);class Bgo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"containerElement",null),fo(this,"state",{infoBox:null}),fo(this,"open",(e,n)=>{n?this.context!==null&&e.open(this.context,n):e.getPosition()?this.context!==null&&e.open(this.context):Gu(!1,"You must provide either an anchor or a position prop for .")}),fo(this,"setInfoBoxCallback",()=>{this.state.infoBox!==null&&this.containerElement!==null&&(this.state.infoBox.setContent(this.containerElement),this.open(this.state.infoBox,this.props.anchor),this.props.onLoad&&this.props.onLoad(this.state.infoBox))})}componentDidMount(){var e=this.props.options||{},{position:n}=e,o=D9e(e,Ngo),r;n&&!(n instanceof google.maps.LatLng)&&(r=new google.maps.LatLng(n.lat,n.lng));var i=new Yrt(cJ(cJ({},o),r?{position:r}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=Ba({updaterMap:QHe,eventMap:$He,prevProps:{},nextProps:this.props,instance:i}),this.setState({infoBox:i},this.setInfoBoxCallback)}componentDidUpdate(e){var{infoBox:n}=this.state;n!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:QHe,eventMap:$He,prevProps:e,nextProps:this.props,instance:n}))}componentWillUnmount(){var{onUnmount:e}=this.props,{infoBox:n}=this.state;n!==null&&(e&&e(n),Ja(this.registeredEvents),n.close())}render(){return this.containerElement?Cd.createPortal(m.Children.only(this.props.children),this.containerElement):null}}fo(Bgo,"contextType",Sa);var Kae,ZHe;function Ygo(){return ZHe||(ZHe=1,Kae=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var o,r,i;if(Array.isArray(e)){if(o=e.length,o!=n.length)return!1;for(r=o;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),o=i.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;r--!==0;){var a=i[r];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}),Kae}var Ogo=Ygo(),eMe=Ert(Ogo),tMe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],qae=1,tD=8;class E9e{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");var[n,o]=new Uint8Array(e,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");var r=o>>4;if(r!==qae)throw new Error("Got v".concat(r," data when expected v").concat(qae,"."));var i=tMe[o&15];if(!i)throw new Error("Unrecognized array type.");var[a]=new Uint16Array(e,2,1),[l]=new Uint32Array(e,4,1);return new E9e(l,a,i,e)}constructor(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:64,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Float64Array,r=arguments.length>3?arguments[3]:void 0;if(isNaN(e)||e<0)throw new Error("Unpexpected numItems value: ".concat(e,"."));this.numItems=+e,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=o,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;var i=tMe.indexOf(this.ArrayType),a=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-l%8)%8;if(i<0)throw new Error("Unexpected typed array class: ".concat(o,"."));r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,tD,e),this.coords=new this.ArrayType(this.data,tD+l+s,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(tD+a+l+s),this.ids=new this.IndexArrayType(this.data,tD,e),this.coords=new this.ArrayType(this.data,tD+l+s,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(qae<<4)+i]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=e)}add(e,n){var o=this._pos>>1;return this.ids[o]=o,this.coords[this._pos++]=e,this.coords[this._pos++]=n,o}finish(){var e=this._pos>>1;if(e!==this.numItems)throw new Error("Added ".concat(e," items when expected ").concat(this.numItems,"."));return Afe(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,n,o,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");for(var{ids:i,coords:a,nodeSize:l}=this,s=[0,i.length-1,0],c=[];s.length;){var u=s.pop()||0,d=s.pop()||0,f=s.pop()||0;if(d-f<=l){for(var p=f;p<=d;p++){var g=a[2*p],y=a[2*p+1];g>=e&&g<=o&&y>=n&&y<=r&&c.push(i[p])}continue}var w=f+d>>1,b=a[2*w],C=a[2*w+1];b>=e&&b<=o&&C>=n&&C<=r&&c.push(i[w]),(u===0?e<=b:n<=C)&&(s.push(f),s.push(w-1),s.push(1-u)),(u===0?o>=b:r>=C)&&(s.push(w+1),s.push(d),s.push(1-u))}return c}within(e,n,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");for(var{ids:r,coords:i,nodeSize:a}=this,l=[0,r.length-1,0],s=[],c=o*o;l.length;){var u=l.pop()||0,d=l.pop()||0,f=l.pop()||0;if(d-f<=a){for(var p=f;p<=d;p++)nMe(i[2*p],i[2*p+1],e,n)<=c&&s.push(r[p]);continue}var g=f+d>>1,y=i[2*g],w=i[2*g+1];nMe(y,w,e,n)<=c&&s.push(r[g]),(u===0?e-o<=y:n-o<=w)&&(l.push(f),l.push(g-1),l.push(1-u)),(u===0?e+o>=y:n+o>=w)&&(l.push(g+1),l.push(d),l.push(1-u))}return s}}function Afe(t,e,n,o,r,i){if(!(r-o<=n)){var a=o+r>>1;Ort(t,e,a,o,r,i),Afe(t,e,n,o,a-1,1-i),Afe(t,e,n,a+1,r,1-i)}}function Ort(t,e,n,o,r,i){for(;r>o;){if(r-o>600){var a=r-o+1,l=n-o+1,s=Math.log(a),c=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*c*(a-c)/a)*(l-a/2<0?-1:1),d=Math.max(o,Math.floor(n-l*c/a+u)),f=Math.min(r,Math.floor(n+(a-l)*c/a+u));Ort(t,e,n,d,f,i)}var p=e[2*n+i],g=o,y=r;for(nD(t,e,o,n),e[2*r+i]>p&&nD(t,e,o,r);gp;)y--}e[2*o+i]===p?nD(t,e,o,y):(y++,nD(t,e,y,r)),y<=n&&(o=y+1),n<=y&&(r=y-1)}}function nD(t,e,n,o){$ae(t,n,o),$ae(e,2*n,2*o),$ae(e,2*n+1,2*o+1)}function $ae(t,e,n){var o=t[e];t[e]=t[n],t[n]=o}function nMe(t,e,n,o){var r=t-n,i=e-o;return r*r+i*i}var _go={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},oMe=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),ev=2,Q4=3,Qae=4,j4=5,_rt=6;class Vgo{constructor(e){this.options=Object.assign(Object.create(_go),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){var{log:n,minZoom:o,maxZoom:r}=this.options;n&&console.time("total time");var i="prepare ".concat(e.length," points");n&&console.time(i),this.points=e;for(var a=[],l=0;l=o;g--){var y=+Date.now();p=this.trees[g]=this._createTree(this._cluster(p,g)),n&&console.log("z%d: %d clusters in %dms",g,p.numItems,+Date.now()-y)}return n&&console.timeEnd("total time"),this}getClusters(e,n){var o=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)o=-180,i=180;else if(o>i){var l=this.getClusters([o,r,180,a],n),s=this.getClusters([-180,r,i,a],n);return l.concat(s)}var c=this.trees[this._limitZoom(n)],u=c.range(jO(o),BO(a),jO(i),BO(r)),d=c.data,f=[];for(var p of u){var g=this.stride*p;f.push(d[g+j4]>1?rMe(d,g,this.clusterProps):this.points[d[g+Q4]])}return f}getChildren(e){var n=this._getOriginId(e),o=this._getOriginZoom(e),r="No cluster with the specified id.",i=this.trees[o];if(!i)throw new Error(r);var a=i.data;if(n*this.stride>=a.length)throw new Error(r);var l=this.options.radius/(this.options.extent*Math.pow(2,o-1)),s=a[n*this.stride],c=a[n*this.stride+1],u=i.within(s,c,l),d=[];for(var f of u){var p=f*this.stride;a[p+Qae]===e&&d.push(a[p+j4]>1?rMe(a,p,this.clusterProps):this.points[a[p+Q4]])}if(d.length===0)throw new Error(r);return d}getLeaves(e,n,o){n=n||10,o=o||0;var r=[];return this._appendLeaves(r,e,n,o,0),r}getTile(e,n,o){var r=this.trees[this._limitZoom(e)],i=Math.pow(2,e),{extent:a,radius:l}=this.options,s=l/a,c=(o-s)/i,u=(o+1+s)/i,d={features:[]};return this._addTileFeatures(r.range((n-s)/i,c,(n+1+s)/i,u),r.data,n,o,i,d),n===0&&this._addTileFeatures(r.range(1-s/i,c,1,u),r.data,i,o,i,d),n===i-1&&this._addTileFeatures(r.range(0,c,s/i,u),r.data,-1,o,i,d),d.features.length?d:null}getClusterExpansionZoom(e){for(var n=this._getOriginZoom(e)-1;n<=this.options.maxZoom;){var o=this.getChildren(e);if(n++,o.length!==1)break;e=o[0].properties.cluster_id}return n}_appendLeaves(e,n,o,r,i){var a=this.getChildren(n);for(var l of a){var s=l.properties;if(s&&s.cluster?i+s.point_count<=r?i+=s.point_count:i=this._appendLeaves(e,s.cluster_id,o,r,i):i1,u=void 0,d=void 0,f=void 0;if(c)u=Vrt(n,s,this.clusterProps),d=n[s],f=n[s+1];else{var p=this.points[n[s+Q4]];u=p.properties;var[g,y]=p.geometry.coordinates;d=jO(g),f=BO(y)}var w={type:1,geometry:[[Math.round(this.options.extent*(d*i-o)),Math.round(this.options.extent*(f*i-r))]],tags:u},b=void 0;c||this.options.generateId?b=n[s+Q4]:b=this.points[n[s+Q4]].id,b!==void 0&&(w.id=b),a.features.push(w)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){for(var{radius:o,extent:r,reduce:i,minPoints:a}=this.options,l=o/(r*Math.pow(2,n)),s=e.data,c=[],u=this.stride,d=0;dn&&(w+=s[C+j4])}if(w>y&&w>=a){var P=f*y,v=p*y,T=void 0,A=-1,x=((d/u|0)<<5)+(n+1)+this.points.length;for(var S of g){var R=S*u;if(!(s[R+ev]<=n)){s[R+ev]=n;var M=s[R+j4];P+=s[R]*M,v+=s[R+1]*M,s[R+Qae]=x,i&&(T||(T=this._map(s,d,!0),A=this.clusterProps.length,this.clusterProps.push(T)),i(T,this._map(s,R)))}}s[d+Qae]=x,c.push(P/w,v/w,1/0,x,-1,w),i&&c.push(A)}else{for(var D=0;D1)for(var E of g){var W=E*u;if(!(s[W+ev]<=n)){s[W+ev]=n;for(var j=0;j>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,n,o){if(e[n+j4]>1){var r=this.clusterProps[e[n+_rt]];return o?Object.assign({},r):r}var i=this.points[e[n+Q4]].properties,a=this.options.map(i);return o&&a===i?Object.assign({},a):a}}function rMe(t,e,n){return{type:"Feature",id:t[e+Q4],properties:Vrt(t,e,n),geometry:{type:"Point",coordinates:[Ggo(t[e]),Xgo(t[e+1])]}}}function Vrt(t,e,n){var o=t[e+j4],r=o>=1e4?"".concat(Math.round(o/1e3),"k"):o>=1e3?"".concat(Math.round(o/100)/10,"k"):o,i=t[e+_rt],a=i===-1?{}:Object.assign({},n[i]);return Object.assign(a,{cluster:!0,cluster_id:t[e+Q4],point_count:o,point_count_abbreviated:r})}function jO(t){return t/360+.5}function BO(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function Ggo(t){return(t-.5)*360}function Xgo(t){var e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}/*! ***************************************************************************** + `)),console.error(x)})},[e,C,o]);var P=m.useRef();return m.useEffect(function(){P.current&&s!==P.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),P.current=s},[s]),{isLoaded:g,loadError:w,url:C}}var sgo=["loadingElement","onLoad","onError","onUnmount","children"],cgo=h.jsx(Nrt,{});function ugo(t){var{loadingElement:e,onLoad:n,onError:o,onUnmount:r,children:i}=t,a=E9e(t,sgo),{isLoaded:l,loadError:s}=lgo(a);return m.useEffect(function(){l&&typeof n=="function"&&n()},[l,n]),m.useEffect(function(){s&&typeof o=="function"&&o(s)},[s,o]),m.useEffect(function(){return()=>{r&&r()}},[r]),l?i:e||cgo}m.memo(ugo);function dgo(t,e,n,o){function r(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function l(u){try{c(o.next(u))}catch(d){a(d)}}function s(u){try{c(o.throw(u))}catch(d){a(d)}}function c(u){u.done?i(u.value):r(u.value).then(l,s)}c((o=o.apply(t,[])).next())})}function fgo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var hgo=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var o,r,i;if(Array.isArray(e)){if(o=e.length,o!=n.length)return!1;for(r=o;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),o=i.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;r--!==0;){var a=i[r];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n},pgo=fgo(hgo),UHe="__googleMapsScriptId",dC;(function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.LOADING=1]="LOADING",t[t.SUCCESS=2]="SUCCESS",t[t.FAILURE=3]="FAILURE"})(dC||(dC={}));class Tv{constructor(e){var{apiKey:n,authReferrerPolicy:o,channel:r,client:i,id:a=UHe,language:l,libraries:s=[],mapIds:c,nonce:u,region:d,retries:f=3,url:p="https://maps.googleapis.com/maps/api/js",version:g}=e;if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=n,this.authReferrerPolicy=o,this.channel=r,this.client=i,this.id=a||UHe,this.language=l,this.libraries=s,this.mapIds=c,this.nonce=u,this.region=d,this.retries=f,this.url=p,this.version=g,Tv.instance){if(!pgo(this.options,Tv.instance.options))throw new Error("Loader must not be called again with different options. ".concat(JSON.stringify(this.options)," !== ").concat(JSON.stringify(Tv.instance.options)));return Tv.instance}Tv.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?dC.FAILURE:this.done?dC.SUCCESS:this.loading?dC.LOADING:dC.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){var e=this.url;return e+="?callback=__googleMapsCallback&loading=async",this.apiKey&&(e+="&key=".concat(this.apiKey)),this.channel&&(e+="&channel=".concat(this.channel)),this.client&&(e+="&client=".concat(this.client)),this.libraries.length>0&&(e+="&libraries=".concat(this.libraries.join(","))),this.language&&(e+="&language=".concat(this.language)),this.region&&(e+="®ion=".concat(this.region)),this.version&&(e+="&v=".concat(this.version)),this.mapIds&&(e+="&map_ids=".concat(this.mapIds.join(","))),this.authReferrerPolicy&&(e+="&auth_referrer_policy=".concat(this.authReferrerPolicy)),e}deleteScript(){var e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,n)=>{this.loadCallback(o=>{o?n(o.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,n;if(document.getElementById(this.id)){this.callback();return}var o={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(o).forEach(i=>!o[i]&&delete o[i]),!((n=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||n===void 0)&&n.importLibrary||(i=>{var a,l,s,c="The Google Maps JavaScript API",u="google",d="importLibrary",f="__ib__",p=document,g=window;g=g[u]||(g[u]={});var y=g.maps||(g.maps={}),w=new Set,b=new URLSearchParams,C=()=>a||(a=new Promise((P,v)=>dgo(this,void 0,void 0,function*(){var T;yield l=p.createElement("script"),l.id=this.id,b.set("libraries",[...w]+"");for(s in i)b.set(s.replace(/[A-Z]/g,A=>"_"+A[0].toLowerCase()),i[s]);b.set("callback",u+".maps."+f),l.src=this.url+"?"+b,y[f]=P,l.onerror=()=>a=v(Error(c+" could not load.")),l.nonce=this.nonce||((T=p.querySelector("script[nonce]"))===null||T===void 0?void 0:T.nonce)||"",p.head.append(l)})));y[d]?console.warn(c+" only loads once. Ignoring:",i):y[d]=function(P){for(var v=arguments.length,T=new Array(v>1?v-1:0),A=1;Ay[d](P,...T))}})(o);var r=this.libraries.map(i=>this.importLibrary(i));r.length||r.push(this.importLibrary("core")),Promise.all(r).then(()=>this.callback(),i=>{var a=new ErrorEvent("error",{error:i});this.loadErrorCallback(a)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){var n=this.errors.length*Math.pow(2,this.errors.length);console.error("Failed to load Google Maps script, retrying in ".concat(n," ms.")),setTimeout(()=>{this.deleteScript(),this.setScript()},n)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),!this.loading)if(this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading=!0,this.setScript()}}}var ggo=["maps"];function Urt(t){var{id:e=Uk.id,version:n=Uk.version,nonce:o,googleMapsApiKey:r,language:i,region:a,libraries:l=ggo,preventGoogleFontsLoading:s,mapIds:c,authReferrerPolicy:u}=t,d=m.useRef(!1),[f,p]=m.useState(!1),[g,y]=m.useState(void 0);m.useEffect(function(){return d.current=!0,()=>{d.current=!1}},[]);var w=m.useMemo(()=>new Tv({id:e,apiKey:r,version:n,libraries:l,language:i||"en",region:a||"US",mapIds:c||[],nonce:o||"",authReferrerPolicy:u||"origin"}),[e,r,n,l,i,a,c,o,u]);m.useEffect(function(){f||w.load().then(()=>{d.current&&p(!0)}).catch(P=>{y(P)})},[]),m.useEffect(()=>{b8&&s&&D9e()},[s]);var b=m.useRef();return m.useEffect(()=>{b.current&&l!==b.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),b.current=l},[l]),{isLoaded:f,loadError:g}}function jHe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function lJ(t){for(var e=1;e{i!==null&&i.setMap(r)},[r]),m.useEffect(()=>{e&&i!==null&&i.setOptions(e)},[i,e]),m.useEffect(()=>{var l=new google.maps.TrafficLayer(lJ(lJ({},e),{},{map:r}));return a(l),n&&n(l),()=>{i!==null&&(o&&o(i),i.setMap(null))}},[]),null}m.memo(mgo);class ygo extends m.PureComponent{constructor(){super(...arguments),fo(this,"state",{trafficLayer:null}),fo(this,"setTrafficLayerCallback",()=>{this.state.trafficLayer!==null&&this.props.onLoad&&this.props.onLoad(this.state.trafficLayer)}),fo(this,"registeredEvents",[])}componentDidMount(){var e=new google.maps.TrafficLayer(lJ(lJ({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:YHe,eventMap:BHe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{trafficLayer:e}},this.setTrafficLayerCallback)}componentDidUpdate(e){this.state.trafficLayer!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:YHe,eventMap:BHe,prevProps:e,nextProps:this.props,instance:this.state.trafficLayer}))}componentWillUnmount(){this.state.trafficLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),Ja(this.registeredEvents),this.state.trafficLayer.setMap(null))}render(){return null}}fo(ygo,"contextType",Sa);function Ago(t){var{onLoad:e,onUnmount:n}=t,o=m.useContext(Sa),[r,i]=m.useState(null);return m.useEffect(()=>{r!==null&&r.setMap(o)},[o]),m.useEffect(()=>{var a=new google.maps.BicyclingLayer;return i(a),a.setMap(o),e&&e(a),()=>{a!==null&&(n&&n(a),a.setMap(null))}},[]),null}m.memo(Ago);class wgo extends m.PureComponent{constructor(){super(...arguments),fo(this,"state",{bicyclingLayer:null}),fo(this,"setBicyclingLayerCallback",()=>{this.state.bicyclingLayer!==null&&(this.state.bicyclingLayer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.bicyclingLayer))})}componentDidMount(){var e=new google.maps.BicyclingLayer;this.setState(()=>({bicyclingLayer:e}),this.setBicyclingLayerCallback)}componentWillUnmount(){this.state.bicyclingLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))}render(){return null}}fo(wgo,"contextType",Sa);function vgo(t){var{onLoad:e,onUnmount:n}=t,o=m.useContext(Sa),[r,i]=m.useState(null);return m.useEffect(()=>{r!==null&&r.setMap(o)},[o]),m.useEffect(()=>{var a=new google.maps.TransitLayer;return i(a),a.setMap(o),e&&e(a),()=>{r!==null&&(n&&n(r),r.setMap(null))}},[]),null}m.memo(vgo);class xgo extends m.PureComponent{constructor(){super(...arguments),fo(this,"state",{transitLayer:null}),fo(this,"setTransitLayerCallback",()=>{this.state.transitLayer!==null&&(this.state.transitLayer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.transitLayer))})}componentDidMount(){var e=new google.maps.TransitLayer;this.setState(function(){return{transitLayer:e}},this.setTransitLayerCallback)}componentWillUnmount(){this.state.transitLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))}render(){return null}}fo(xgo,"contextType",Sa);function OHe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function sJ(t){for(var e=1;e{f!==null&&f.setMap(d)},[d]),m.useEffect(()=>{e&&f!==null&&f.setOptions(e)},[f,e]),m.useEffect(()=>{f!==null&&f.setDrawingMode(n??null)},[f,n]),m.useEffect(()=>{f&&o&&(g!==null&&google.maps.event.removeListener(g),y(google.maps.event.addListener(f,"circlecomplete",o)))},[f,o]),m.useEffect(()=>{f&&r&&(w!==null&&google.maps.event.removeListener(w),b(google.maps.event.addListener(f,"markercomplete",r)))},[f,r]),m.useEffect(()=>{f&&i&&(C!==null&&google.maps.event.removeListener(C),P(google.maps.event.addListener(f,"overlaycomplete",i)))},[f,i]),m.useEffect(()=>{f&&a&&(v!==null&&google.maps.event.removeListener(v),T(google.maps.event.addListener(f,"polygoncomplete",a)))},[f,a]),m.useEffect(()=>{f&&l&&(A!==null&&google.maps.event.removeListener(A),x(google.maps.event.addListener(f,"polylinecomplete",l)))},[f,l]),m.useEffect(()=>{f&&s&&(S!==null&&google.maps.event.removeListener(S),R(google.maps.event.addListener(f,"rectanglecomplete",s)))},[f,s]),m.useEffect(()=>{Gu(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing);var M=new google.maps.drawing.DrawingManager(sJ(sJ({},e),{},{map:d}));return n&&M.setDrawingMode(n),o&&y(google.maps.event.addListener(M,"circlecomplete",o)),r&&b(google.maps.event.addListener(M,"markercomplete",r)),i&&P(google.maps.event.addListener(M,"overlaycomplete",i)),a&&T(google.maps.event.addListener(M,"polygoncomplete",a)),l&&x(google.maps.event.addListener(M,"polylinecomplete",l)),s&&R(google.maps.event.addListener(M,"rectanglecomplete",s)),p(M),c&&c(M),()=>{f!==null&&(g&&google.maps.event.removeListener(g),w&&google.maps.event.removeListener(w),C&&google.maps.event.removeListener(C),v&&google.maps.event.removeListener(v),A&&google.maps.event.removeListener(A),S&&google.maps.event.removeListener(S),u&&u(f),f.setMap(null))}},[]),null}m.memo(bgo);class Sgo extends m.PureComponent{constructor(e){super(e),fo(this,"registeredEvents",[]),fo(this,"state",{drawingManager:null}),fo(this,"setDrawingManagerCallback",()=>{this.state.drawingManager!==null&&this.props.onLoad&&this.props.onLoad(this.state.drawingManager)}),Gu(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing)}componentDidMount(){var e=new google.maps.drawing.DrawingManager(sJ(sJ({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:VHe,eventMap:_He,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{drawingManager:e}},this.setDrawingManagerCallback)}componentDidUpdate(e){this.state.drawingManager!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:VHe,eventMap:_He,prevProps:e,nextProps:this.props,instance:this.state.drawingManager}))}componentWillUnmount(){this.state.drawingManager!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),Ja(this.registeredEvents),this.state.drawingManager.setMap(null))}render(){return null}}fo(Sgo,"contextType",Sa);function GHe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function LC(t){for(var e=1;e{Q!==null&&Q.setMap($)},[$]),m.useEffect(()=>{typeof n<"u"&&Q!==null&&Q.setOptions(n)},[Q,n]),m.useEffect(()=>{typeof a<"u"&&Q!==null&&Q.setDraggable(a)},[Q,a]),m.useEffect(()=>{e&&Q!==null&&Q.setPosition(e)},[Q,e]),m.useEffect(()=>{typeof l<"u"&&Q!==null&&Q.setVisible(l)},[Q,l]),m.useEffect(()=>{Q==null||Q.setAnimation(s)},[Q,s]),m.useEffect(()=>{Q&&c!==void 0&&Q.setClickable(c)},[Q,c]),m.useEffect(()=>{Q&&u!==void 0&&Q.setCursor(u)},[Q,u]),m.useEffect(()=>{Q&&d!==void 0&&Q.setIcon(d)},[Q,d]),m.useEffect(()=>{Q&&f!==void 0&&Q.setLabel(f)},[Q,f]),m.useEffect(()=>{Q&&p!==void 0&&Q.setOpacity(p)},[Q,p]),m.useEffect(()=>{Q&&g!==void 0&&Q.setShape(g)},[Q,g]),m.useEffect(()=>{Q&&y!==void 0&&Q.setTitle(y)},[Q,y]),m.useEffect(()=>{Q&&w!==void 0&&Q.setZIndex(w)},[Q,w]),m.useEffect(()=>{Q&&C&&(q!==null&&google.maps.event.removeListener(q),te(google.maps.event.addListener(Q,"dblclick",C)))},[C]),m.useEffect(()=>{Q&&v&&(re!==null&&google.maps.event.removeListener(re),ae(google.maps.event.addListener(Q,"dragend",v)))},[v]),m.useEffect(()=>{Q&&T&&(se!==null&&google.maps.event.removeListener(se),ne(google.maps.event.addListener(Q,"dragstart",T)))},[T]),m.useEffect(()=>{Q&&R&&(fe!==null&&google.maps.event.removeListener(fe),ge(google.maps.event.addListener(Q,"mousedown",R)))},[R]),m.useEffect(()=>{Q&&A&&(de!==null&&google.maps.event.removeListener(de),Z(google.maps.event.addListener(Q,"mouseout",A)))},[A]),m.useEffect(()=>{Q&&x&&(he!==null&&google.maps.event.removeListener(he),xe(google.maps.event.addListener(Q,"mouseover",x)))},[x]),m.useEffect(()=>{Q&&S&&(He!==null&&google.maps.event.removeListener(He),Se(google.maps.event.addListener(Q,"mouseup",S)))},[S]),m.useEffect(()=>{Q&&M&&(ze!==null&&google.maps.event.removeListener(ze),Ie(google.maps.event.addListener(Q,"rightclick",M)))},[M]),m.useEffect(()=>{Q&&b&&(ye!==null&&google.maps.event.removeListener(ye),ce(google.maps.event.addListener(Q,"click",b)))},[b]),m.useEffect(()=>{Q&&P&&(pe!==null&&google.maps.event.removeListener(pe),ve(google.maps.event.addListener(Q,"drag",P)))},[P]),m.useEffect(()=>{Q&&D&&(Ae!==null&&google.maps.event.removeListener(Ae),Te(google.maps.event.addListener(Q,"clickable_changed",D)))},[D]),m.useEffect(()=>{Q&&E&&(Me!==null&&google.maps.event.removeListener(Me),Pe(google.maps.event.addListener(Q,"cursor_changed",E)))},[E]),m.useEffect(()=>{Q&&W&&(Ee!==null&&google.maps.event.removeListener(Ee),Be(google.maps.event.addListener(Q,"animation_changed",W)))},[W]),m.useEffect(()=>{Q&&j&&(Je!==null&&google.maps.event.removeListener(Je),We(google.maps.event.addListener(Q,"draggable_changed",j)))},[j]),m.useEffect(()=>{Q&&L&&(Ke!==null&&google.maps.event.removeListener(Ke),Ne(google.maps.event.addListener(Q,"flat_changed",L)))},[L]),m.useEffect(()=>{Q&&k&&(De!==null&&google.maps.event.removeListener(De),ke(google.maps.event.addListener(Q,"icon_changed",k)))},[k]),m.useEffect(()=>{Q&&N&&(Ye!==null&&google.maps.event.removeListener(Ye),it(google.maps.event.addListener(Q,"position_changed",N)))},[N]),m.useEffect(()=>{Q&&F&&(Ve!==null&&google.maps.event.removeListener(Ve),yt(google.maps.event.addListener(Q,"shape_changed",F)))},[F]),m.useEffect(()=>{Q&&U&&(ct!==null&&google.maps.event.removeListener(ct),Xe(google.maps.event.addListener(Q,"title_changed",U)))},[U]),m.useEffect(()=>{Q&&O&&(ut!==null&&google.maps.event.removeListener(ut),ft(google.maps.event.addListener(Q,"visible_changed",O)))},[O]),m.useEffect(()=>{Q&&B&&(ot!==null&&google.maps.event.removeListener(ot),st(google.maps.event.addListener(Q,"zindex_changed",B)))},[B]),m.useEffect(()=>{var Oe=LC(LC(LC({},n||cJ),o?cJ:{map:$}),{},{position:e}),Ze=new google.maps.Marker(Oe);return o?o.addMarker(Ze,!!r):Ze.setMap($),e&&Ze.setPosition(e),typeof l<"u"&&Ze.setVisible(l),typeof a<"u"&&Ze.setDraggable(a),typeof c<"u"&&Ze.setClickable(c),typeof u=="string"&&Ze.setCursor(u),d&&Ze.setIcon(d),typeof f<"u"&&Ze.setLabel(f),typeof p<"u"&&Ze.setOpacity(p),g&&Ze.setShape(g),typeof y=="string"&&Ze.setTitle(y),typeof w=="number"&&Ze.setZIndex(w),C&&te(google.maps.event.addListener(Ze,"dblclick",C)),v&&ae(google.maps.event.addListener(Ze,"dragend",v)),T&&ne(google.maps.event.addListener(Ze,"dragstart",T)),R&&ge(google.maps.event.addListener(Ze,"mousedown",R)),A&&Z(google.maps.event.addListener(Ze,"mouseout",A)),x&&xe(google.maps.event.addListener(Ze,"mouseover",x)),S&&Se(google.maps.event.addListener(Ze,"mouseup",S)),M&&Ie(google.maps.event.addListener(Ze,"rightclick",M)),b&&ce(google.maps.event.addListener(Ze,"click",b)),P&&ve(google.maps.event.addListener(Ze,"drag",P)),D&&Te(google.maps.event.addListener(Ze,"clickable_changed",D)),E&&Pe(google.maps.event.addListener(Ze,"cursor_changed",E)),W&&Be(google.maps.event.addListener(Ze,"animation_changed",W)),j&&We(google.maps.event.addListener(Ze,"draggable_changed",j)),L&&Ne(google.maps.event.addListener(Ze,"flat_changed",L)),k&&ke(google.maps.event.addListener(Ze,"icon_changed",k)),N&&it(google.maps.event.addListener(Ze,"position_changed",N)),F&&yt(google.maps.event.addListener(Ze,"shape_changed",F)),U&&Xe(google.maps.event.addListener(Ze,"title_changed",U)),O&&ft(google.maps.event.addListener(Ze,"visible_changed",O)),B&&st(google.maps.event.addListener(Ze,"zindex_changed",B)),le(Ze),_&&_(Ze),()=>{q!==null&&google.maps.event.removeListener(q),re!==null&&google.maps.event.removeListener(re),se!==null&&google.maps.event.removeListener(se),fe!==null&&google.maps.event.removeListener(fe),de!==null&&google.maps.event.removeListener(de),he!==null&&google.maps.event.removeListener(he),He!==null&&google.maps.event.removeListener(He),ze!==null&&google.maps.event.removeListener(ze),ye!==null&&google.maps.event.removeListener(ye),Ae!==null&&google.maps.event.removeListener(Ae),Me!==null&&google.maps.event.removeListener(Me),Ee!==null&&google.maps.event.removeListener(Ee),Je!==null&&google.maps.event.removeListener(Je),Ke!==null&&google.maps.event.removeListener(Ke),De!==null&&google.maps.event.removeListener(De),Ye!==null&&google.maps.event.removeListener(Ye),ct!==null&&google.maps.event.removeListener(ct),ut!==null&&google.maps.event.removeListener(ut),ot!==null&&google.maps.event.removeListener(ot),X&&X(Ze),o?o.removeMarker(Ze,!!r):Ze&&Ze.setMap(null)}},[]);var at=m.useMemo(()=>i?m.Children.map(i,Oe=>{if(!m.isValidElement(Oe))return Oe;var Ze=Oe;return m.cloneElement(Ze,{anchor:Q})}):null,[i,Q]);return h.jsx(h.Fragment,{children:at})||null}m.memo(Tgo);class yfe extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[])}componentDidMount(){var e=this;return krt(function*(){var n=LC(LC(LC({},e.props.options||cJ),e.props.clusterer?cJ:{map:e.context}),{},{position:e.props.position});e.marker=new google.maps.Marker(n),e.props.clusterer?e.props.clusterer.addMarker(e.marker,!!e.props.noClustererRedraw):e.marker.setMap(e.context),e.registeredEvents=Ba({updaterMap:JHe,eventMap:XHe,prevProps:{},nextProps:e.props,instance:e.marker}),e.props.onLoad&&e.props.onLoad(e.marker)})()}componentDidUpdate(e){this.marker&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:JHe,eventMap:XHe,prevProps:e,nextProps:this.props,instance:this.marker}))}componentWillUnmount(){this.marker&&(this.props.onUnmount&&this.props.onUnmount(this.marker),Ja(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.marker,!!this.props.noClustererRedraw):this.marker&&this.marker.setMap(null))}render(){var e=this.props.children?m.Children.map(this.props.children,n=>{if(!m.isValidElement(n))return n;var o=n;return m.cloneElement(o,{anchor:this.marker})}):null;return e||null}}fo(yfe,"contextType",Sa);var Pgo=function(){function t(e,n){e.getClusterer().extend(t,google.maps.OverlayView),this.cluster=e,this.clusterClassName=this.cluster.getClusterer().getClusterClass(),this.className=this.clusterClassName,this.styles=n,this.center=void 0,this.div=null,this.sums=null,this.visible=!1,this.boundsChangedListener=null,this.url="",this.height=0,this.width=0,this.anchorText=[0,0],this.anchorIcon=[0,0],this.textColor="black",this.textSize=11,this.textDecoration="none",this.fontWeight="bold",this.fontStyle="normal",this.fontFamily="Arial,sans-serif",this.backgroundPosition="0 0",this.cMouseDownInCluster=null,this.cDraggingMapByCluster=null,this.timeOut=null,this.setMap(e.getMap()),this.onBoundsChanged=this.onBoundsChanged.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onClick=this.onClick.bind(this),this.onMouseOver=this.onMouseOver.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onAdd=this.onAdd.bind(this),this.onRemove=this.onRemove.bind(this),this.draw=this.draw.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.useStyle=this.useStyle.bind(this),this.setCenter=this.setCenter.bind(this),this.getPosFromLatLng=this.getPosFromLatLng.bind(this)}return t.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},t.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},t.prototype.onClick=function(e){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var n=this.cluster.getClusterer();if(google.maps.event.trigger(n,"click",this.cluster),google.maps.event.trigger(n,"clusterclick",this.cluster),n.getZoomOnClick()){var o=n.getMaxZoom(),r=this.cluster.getBounds(),i=n.getMap();i!==null&&"fitBounds"in i&&i.fitBounds(r),this.timeOut=window.setTimeout(function(){var a=n.getMap();if(a!==null){"fitBounds"in a&&a.fitBounds(r);var l=a.getZoom()||0;o!==null&&l>o&&a.setZoom(o+1)}},100)}e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}},t.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},t.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},t.prototype.onAdd=function(){var e;this.div=document.createElement("div"),this.div.className=this.className,this.visible&&this.show(),(e=this.getPanes())===null||e===void 0||e.overlayMouseTarget.appendChild(this.div);var n=this.getMap();n!==null&&(this.boundsChangedListener=google.maps.event.addListener(n,"bounds_changed",this.onBoundsChanged),this.div.addEventListener("mousedown",this.onMouseDown),this.div.addEventListener("click",this.onClick),this.div.addEventListener("mouseover",this.onMouseOver),this.div.addEventListener("mouseout",this.onMouseOut))},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.hide(),this.boundsChangedListener!==null&&google.maps.event.removeListener(this.boundsChangedListener),this.div.removeEventListener("mousedown",this.onMouseDown),this.div.removeEventListener("click",this.onClick),this.div.removeEventListener("mouseover",this.onMouseOver),this.div.removeEventListener("mouseout",this.onMouseOut),this.div.parentNode.removeChild(this.div),this.timeOut!==null&&(window.clearTimeout(this.timeOut),this.timeOut=null),this.div=null)},t.prototype.draw=function(){if(this.visible&&this.div!==null&&this.center){var e=this.getPosFromLatLng(this.center);this.div.style.top=e!==null?"".concat(e.y,"px"):"0",this.div.style.left=e!==null?"".concat(e.x,"px"):"0"}},t.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},t.prototype.show=function(){var e,n,o,r,i,a;if(this.div&&this.center){var l=this.sums===null||typeof this.sums.title>"u"||this.sums.title===""?this.cluster.getClusterer().getTitle():this.sums.title,s=this.backgroundPosition.split(" "),c=parseInt(((e=s[0])===null||e===void 0?void 0:e.replace(/^\s+|\s+$/g,""))||"0",10),u=parseInt(((n=s[1])===null||n===void 0?void 0:n.replace(/^\s+|\s+$/g,""))||"0",10),d=this.getPosFromLatLng(this.center);this.div.className=this.className,this.div.setAttribute("style","cursor: pointer; position: absolute; top: ".concat(d!==null?"".concat(d.y,"px"):"0","; left: ").concat(d!==null?"".concat(d.x,"px"):"0","; width: ").concat(this.width,"px; height: ").concat(this.height,"px; "));var f=document.createElement("img");f.alt=l,f.src=this.url,f.width=this.width,f.height=this.height,f.setAttribute("style","position: absolute; top: ".concat(u,"px; left: ").concat(c,"px")),this.cluster.getClusterer().enableRetinaIcons||(f.style.clip="rect(-".concat(u,"px, -").concat(c+this.width,"px, -").concat(u+this.height,", -").concat(c,")"));var p=document.createElement("div");p.setAttribute("style","position: absolute; top: ".concat(this.anchorText[0],"px; left: ").concat(this.anchorText[1],"px; color: ").concat(this.textColor,"; font-size: ").concat(this.textSize,"px; font-family: ").concat(this.fontFamily,"; font-weight: ").concat(this.fontWeight,"; fontStyle: ").concat(this.fontStyle,"; text-decoration: ").concat(this.textDecoration,"; text-align: center; width: ").concat(this.width,"px; line-height: ").concat(this.height,"px")),!((o=this.sums)===null||o===void 0)&&o.text&&(p.innerText="".concat((r=this.sums)===null||r===void 0?void 0:r.text)),!((i=this.sums)===null||i===void 0)&&i.html&&(p.innerHTML="".concat((a=this.sums)===null||a===void 0?void 0:a.html)),this.div.innerHTML="",this.div.appendChild(f),this.div.appendChild(p),this.div.title=l,this.div.style.display=""}this.visible=!0},t.prototype.useStyle=function(e){this.sums=e;var n=this.cluster.getClusterer().getStyles(),o=n[Math.min(n.length-1,Math.max(0,e.index-1))];o&&(this.url=o.url,this.height=o.height,this.width=o.width,o.className&&(this.className="".concat(this.clusterClassName," ").concat(o.className)),this.anchorText=o.anchorText||[0,0],this.anchorIcon=o.anchorIcon||[this.height/2,this.width/2],this.textColor=o.textColor||"black",this.textSize=o.textSize||11,this.textDecoration=o.textDecoration||"none",this.fontWeight=o.fontWeight||"bold",this.fontStyle=o.fontStyle||"normal",this.fontFamily=o.fontFamily||"Arial,sans-serif",this.backgroundPosition=o.backgroundPosition||"0 0")},t.prototype.setCenter=function(e){this.center=e},t.prototype.getPosFromLatLng=function(e){var n=this.getProjection().fromLatLngToDivPixel(e);return n!==null&&(n.x-=this.anchorIcon[1],n.y-=this.anchorIcon[0]),n},t}(),Cgo=function(){function t(e){this.markerClusterer=e,this.map=this.markerClusterer.getMap(),this.gridSize=this.markerClusterer.getGridSize(),this.minClusterSize=this.markerClusterer.getMinimumClusterSize(),this.averageCenter=this.markerClusterer.getAverageCenter(),this.markers=[],this.center=void 0,this.bounds=null,this.clusterIcon=new Pgo(this,this.markerClusterer.getStyles()),this.getSize=this.getSize.bind(this),this.getMarkers=this.getMarkers.bind(this),this.getCenter=this.getCenter.bind(this),this.getMap=this.getMap.bind(this),this.getClusterer=this.getClusterer.bind(this),this.getBounds=this.getBounds.bind(this),this.remove=this.remove.bind(this),this.addMarker=this.addMarker.bind(this),this.isMarkerInClusterBounds=this.isMarkerInClusterBounds.bind(this),this.calculateBounds=this.calculateBounds.bind(this),this.updateIcon=this.updateIcon.bind(this),this.isMarkerAlreadyAdded=this.isMarkerAlreadyAdded.bind(this)}return t.prototype.getSize=function(){return this.markers.length},t.prototype.getMarkers=function(){return this.markers},t.prototype.getCenter=function(){return this.center},t.prototype.getMap=function(){return this.map},t.prototype.getClusterer=function(){return this.markerClusterer},t.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center,this.center),n=this.getMarkers(),o=0,r=n;oa)e.getMap()!==this.map&&e.setMap(this.map);else if(io){this.clusterIcon.hide();return}if(n0))for(var e=0;e3?new google.maps.LatLngBounds(r==null?void 0:r.getSouthWest(),r==null?void 0:r.getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625)),l=this.getExtendedBounds(a),s=Math.min(e+this.batchSize,this.markers.length),c=e;c{R&&A&&(F!==null&&google.maps.event.removeListener(F),U(google.maps.event.addListener(R,Sm.onMouseOut,A)))},[A]),m.useEffect(()=>{R&&T&&(O!==null&&google.maps.event.removeListener(O),B(google.maps.event.addListener(R,Sm.onMouseOver,T)))},[T]),m.useEffect(()=>{R&&C&&(E!==null&&google.maps.event.removeListener(E),W(google.maps.event.addListener(R,Sm.onClick,C)))},[C]),m.useEffect(()=>{R&&P&&(j!==null&&google.maps.event.removeListener(j),L(google.maps.event.addListener(R,Sm.onClusteringBegin,P)))},[P]),m.useEffect(()=>{R&&v&&(k!==null&&google.maps.event.removeListener(k),L(google.maps.event.addListener(R,Sm.onClusteringEnd,v)))},[v]),m.useEffect(()=>{typeof o<"u"&&R!==null&&Il.averageCenter(R,o)},[R,o]),m.useEffect(()=>{typeof r<"u"&&R!==null&&Il.batchSizeIE(R,r)},[R,r]),m.useEffect(()=>{typeof i<"u"&&R!==null&&Il.calculator(R,i)},[R,i]),m.useEffect(()=>{typeof a<"u"&&R!==null&&Il.clusterClass(R,a)},[R,a]),m.useEffect(()=>{typeof l<"u"&&R!==null&&Il.enableRetinaIcons(R,l)},[R,l]),m.useEffect(()=>{typeof s<"u"&&R!==null&&Il.gridSize(R,s)},[R,s]),m.useEffect(()=>{typeof c<"u"&&R!==null&&Il.ignoreHidden(R,c)},[R,c]),m.useEffect(()=>{typeof u<"u"&&R!==null&&Il.imageExtension(R,u)},[R,u]),m.useEffect(()=>{typeof d<"u"&&R!==null&&Il.imagePath(R,d)},[R,d]),m.useEffect(()=>{typeof f<"u"&&R!==null&&Il.imageSizes(R,f)},[R,f]),m.useEffect(()=>{typeof p<"u"&&R!==null&&Il.maxZoom(R,p)},[R,p]),m.useEffect(()=>{typeof g<"u"&&R!==null&&Il.minimumClusterSize(R,g)},[R,g]),m.useEffect(()=>{typeof y<"u"&&R!==null&&Il.styles(R,y)},[R,y]),m.useEffect(()=>{typeof w<"u"&&R!==null&&Il.title(R,w)},[R,w]),m.useEffect(()=>{typeof b<"u"&&R!==null&&Il.zoomOnClick(R,b)},[R,b]),m.useEffect(()=>{if(D){var _=Fgo({},n||kgo),X=new jrt(D,[],_);return o&&Il.averageCenter(X,o),r&&Il.batchSizeIE(X,r),i&&Il.calculator(X,i),a&&Il.clusterClass(X,a),l&&Il.enableRetinaIcons(X,l),s&&Il.gridSize(X,s),c&&Il.ignoreHidden(X,c),u&&Il.imageExtension(X,u),d&&Il.imagePath(X,d),f&&Il.imageSizes(X,f),p&&Il.maxZoom(X,p),g&&Il.minimumClusterSize(X,g),y&&Il.styles(X,y),w&&Il.title(X,w),b&&Il.zoomOnClick(X,b),A&&U(google.maps.event.addListener(X,Sm.onMouseOut,A)),T&&B(google.maps.event.addListener(X,Sm.onMouseOver,T)),C&&W(google.maps.event.addListener(X,Sm.onClick,C)),P&&L(google.maps.event.addListener(X,Sm.onClusteringBegin,P)),v&&N(google.maps.event.addListener(X,Sm.onClusteringEnd,v)),M(X),x&&x(X),()=>{F!==null&&google.maps.event.removeListener(F),O!==null&&google.maps.event.removeListener(O),E!==null&&google.maps.event.removeListener(E),j!==null&&google.maps.event.removeListener(j),k!==null&&google.maps.event.removeListener(k),S&&S(X)}}},[]),R!==null&&e(R)||null}m.memo(Lgo);class Brt extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{markerClusterer:null}),fo(this,"setClustererCallback",()=>{this.state.markerClusterer!==null&&this.props.onLoad&&this.props.onLoad(this.state.markerClusterer)})}componentDidMount(){if(this.context){var e=new jrt(this.context,[],this.props.options);this.registeredEvents=Ba({updaterMap:Il,eventMap:Sm,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({markerClusterer:e}),this.setClustererCallback)}}componentDidUpdate(e){this.state.markerClusterer&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:Il,eventMap:Sm,prevProps:e,nextProps:this.props,instance:this.state.markerClusterer}))}componentWillUnmount(){this.state.markerClusterer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.markerClusterer),Ja(this.registeredEvents),this.state.markerClusterer.setMap(null))}render(){return this.state.markerClusterer!==null?this.props.children(this.state.markerClusterer):null}}fo(Brt,"contextType",Sa);function qHe(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}var Yrt=function(){function t(e){e===void 0&&(e={}),this.getCloseClickHandler=this.getCloseClickHandler.bind(this),this.closeClickHandler=this.closeClickHandler.bind(this),this.createInfoBoxDiv=this.createInfoBoxDiv.bind(this),this.addClickHandler=this.addClickHandler.bind(this),this.getCloseBoxImg=this.getCloseBoxImg.bind(this),this.getBoxWidths=this.getBoxWidths.bind(this),this.setBoxStyle=this.setBoxStyle.bind(this),this.setPosition=this.setPosition.bind(this),this.getPosition=this.getPosition.bind(this),this.setOptions=this.setOptions.bind(this),this.setContent=this.setContent.bind(this),this.setVisible=this.setVisible.bind(this),this.getContent=this.getContent.bind(this),this.getVisible=this.getVisible.bind(this),this.setZIndex=this.setZIndex.bind(this),this.getZIndex=this.getZIndex.bind(this),this.onRemove=this.onRemove.bind(this),this.panBox=this.panBox.bind(this),this.extend=this.extend.bind(this),this.close=this.close.bind(this),this.draw=this.draw.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.open=this.open.bind(this),this.extend(t,google.maps.OverlayView),this.content=e.content||"",this.disableAutoPan=e.disableAutoPan||!1,this.maxWidth=e.maxWidth||0,this.pixelOffset=e.pixelOffset||new google.maps.Size(0,0),this.position=e.position||new google.maps.LatLng(0,0),this.zIndex=e.zIndex||null,this.boxClass=e.boxClass||"infoBox",this.boxStyle=e.boxStyle||{},this.closeBoxMargin=e.closeBoxMargin||"2px",this.closeBoxURL=e.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",e.closeBoxURL===""&&(this.closeBoxURL=""),this.infoBoxClearance=e.infoBoxClearance||new google.maps.Size(1,1),typeof e.visible>"u"&&(typeof e.isHidden>"u"?e.visible=!0:e.visible=!e.isHidden),this.isHidden=!e.visible,this.alignBottom=e.alignBottom||!1,this.pane=e.pane||"floatPane",this.enableEventPropagation=e.enableEventPropagation||!1,this.div=null,this.closeListener=null,this.moveListener=null,this.mapListener=null,this.contextListener=null,this.eventListeners=null,this.fixedWidthSet=null}return t.prototype.createInfoBoxDiv=function(){var e=this,n=function(u){u.returnValue=!1,u.preventDefault&&u.preventDefault(),e.enableEventPropagation||qHe(u)};if(!this.div){this.div=document.createElement("div"),this.setBoxStyle(),typeof this.content=="string"?this.div.innerHTML=this.getCloseBoxImg()+this.content:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(this.content));var o=this.getPanes();if(o!==null&&o[this.pane].appendChild(this.div),this.addClickHandler(),this.div.style.width)this.fixedWidthSet=!0;else if(this.maxWidth!==0&&this.div.offsetWidth>this.maxWidth)this.div.style.width=this.maxWidth+"px",this.fixedWidthSet=!0;else{var r=this.getBoxWidths();this.div.style.width=this.div.offsetWidth-r.left-r.right+"px",this.fixedWidthSet=!1}if(this.panBox(this.disableAutoPan),!this.enableEventPropagation){this.eventListeners=[];for(var i=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],a=0,l=i;al&&(o=w.x+d+c+p-l),this.alignBottom?w.y<-u+g+f?r=w.y+u-g-f:w.y+u+g>s&&(r=w.y+u+g-s):w.y<-u+g?r=w.y+u-g:w.y+f+u+g>s&&(r=w.y+f+u+g-s)),o===0&&r===0||n.panBy(o,r)}}},t.prototype.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var e=this.boxStyle;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this.div.style[n]=e[n]);if(this.div.style.webkitTransform="translateZ(0)",typeof this.div.style.opacity<"u"&&this.div.style.opacity!==""){var o=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+o*100+')"',this.div.style.filter="alpha(opacity="+o*100+")"}this.div.style.position="absolute",this.div.style.visibility="hidden",this.zIndex!==null&&(this.div.style.zIndex=this.zIndex+""),this.div.style.overflow||(this.div.style.overflow="auto")}},t.prototype.getBoxWidths=function(){var e={top:0,bottom:0,left:0,right:0};if(!this.div)return e;if(document.defaultView){var n=this.div.ownerDocument,o=n&&n.defaultView?n.defaultView.getComputedStyle(this.div,""):null;o&&(e.top=parseInt(o.borderTopWidth||"",10)||0,e.bottom=parseInt(o.borderBottomWidth||"",10)||0,e.left=parseInt(o.borderLeftWidth||"",10)||0,e.right=parseInt(o.borderRightWidth||"",10)||0)}else if(document.documentElement.currentStyle){var r=this.div.currentStyle;r&&(e.top=parseInt(r.borderTopWidth||"",10)||0,e.bottom=parseInt(r.borderBottomWidth||"",10)||0,e.left=parseInt(r.borderLeftWidth||"",10)||0,e.right=parseInt(r.borderRightWidth||"",10)||0)}return e},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},t.prototype.draw=function(){if(this.createInfoBoxDiv(),this.div){var e=this.getProjection(),n=e.fromLatLngToDivPixel(this.position);n!==null&&(this.div.style.left=n.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(n.y+this.pixelOffset.height)+"px":this.div.style.top=n.y+this.pixelOffset.height+"px"),this.isHidden?this.div.style.visibility="hidden":this.div.style.visibility="visible"}},t.prototype.setOptions=function(e){e===void 0&&(e={}),typeof e.boxClass<"u"&&(this.boxClass=e.boxClass,this.setBoxStyle()),typeof e.boxStyle<"u"&&(this.boxStyle=e.boxStyle,this.setBoxStyle()),typeof e.content<"u"&&this.setContent(e.content),typeof e.disableAutoPan<"u"&&(this.disableAutoPan=e.disableAutoPan),typeof e.maxWidth<"u"&&(this.maxWidth=e.maxWidth),typeof e.pixelOffset<"u"&&(this.pixelOffset=e.pixelOffset),typeof e.alignBottom<"u"&&(this.alignBottom=e.alignBottom),typeof e.position<"u"&&this.setPosition(e.position),typeof e.zIndex<"u"&&this.setZIndex(e.zIndex),typeof e.closeBoxMargin<"u"&&(this.closeBoxMargin=e.closeBoxMargin),typeof e.closeBoxURL<"u"&&(this.closeBoxURL=e.closeBoxURL),typeof e.infoBoxClearance<"u"&&(this.infoBoxClearance=e.infoBoxClearance),typeof e.isHidden<"u"&&(this.isHidden=e.isHidden),typeof e.visible<"u"&&(this.isHidden=!e.visible),typeof e.enableEventPropagation<"u"&&(this.enableEventPropagation=e.enableEventPropagation),this.div&&this.draw()},t.prototype.setContent=function(e){this.content=e,this.div&&(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.fixedWidthSet||(this.div.style.width=""),typeof e=="string"?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e)),this.fixedWidthSet||(this.div.style.width=this.div.offsetWidth+"px",typeof e=="string"?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e))),this.addClickHandler()),google.maps.event.trigger(this,"content_changed")},t.prototype.setPosition=function(e){this.position=e,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},t.prototype.setVisible=function(e){this.isHidden=!e,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},t.prototype.setZIndex=function(e){this.zIndex=e,this.div&&(this.div.style.zIndex=e+""),google.maps.event.trigger(this,"zindex_changed")},t.prototype.getContent=function(){return this.content},t.prototype.getPosition=function(){return this.position},t.prototype.getZIndex=function(){return this.zIndex},t.prototype.getVisible=function(){var e=this.getMap();return typeof e>"u"||e===null?!1:!this.isHidden},t.prototype.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},t.prototype.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},t.prototype.open=function(e,n){var o=this;n&&(this.position=n.getPosition(),this.moveListener=google.maps.event.addListener(n,"position_changed",function(){var r=n.getPosition();o.setPosition(r)}),this.mapListener=google.maps.event.addListener(n,"map_changed",function(){o.setMap(n.map)})),this.setMap(e),this.div&&this.panBox()},t.prototype.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var e=0,n=this.eventListeners;e{p&&g!==null&&(g.close(),n?g.open(p,n):g.getPosition()&&g.open(p))},[p,g,n]),m.useEffect(()=>{o&&g!==null&&g.setOptions(o)},[g,o]),m.useEffect(()=>{if(r&&g!==null){var D=r instanceof google.maps.LatLng?r:new google.maps.LatLng(r.lat,r.lng);g.setPosition(D)}},[r]),m.useEffect(()=>{typeof i=="number"&&g!==null&&g.setZIndex(i)},[i]),m.useEffect(()=>{g&&a&&(w!==null&&google.maps.event.removeListener(w),b(google.maps.event.addListener(g,"closeclick",a)))},[a]),m.useEffect(()=>{g&&l&&(C!==null&&google.maps.event.removeListener(C),P(google.maps.event.addListener(g,"domready",l)))},[l]),m.useEffect(()=>{g&&s&&(v!==null&&google.maps.event.removeListener(v),T(google.maps.event.addListener(g,"content_changed",s)))},[s]),m.useEffect(()=>{g&&c&&(A!==null&&google.maps.event.removeListener(A),x(google.maps.event.addListener(g,"position_changed",c)))},[c]),m.useEffect(()=>{g&&u&&(S!==null&&google.maps.event.removeListener(S),R(google.maps.event.addListener(g,"zindex_changed",u)))},[u]),m.useEffect(()=>{if(p){var D=o||Ugo,{position:E}=D,W=E9e(D,Wgo),j;E&&!(E instanceof google.maps.LatLng)&&(j=new google.maps.LatLng(E.lat,E.lng));var L=new Yrt(uJ(uJ({},W),j?{position:j}:{}));M.current=document.createElement("div"),y(L),a&&b(google.maps.event.addListener(L,"closeclick",a)),l&&P(google.maps.event.addListener(L,"domready",l)),s&&T(google.maps.event.addListener(L,"content_changed",s)),c&&x(google.maps.event.addListener(L,"position_changed",c)),u&&R(google.maps.event.addListener(L,"zindex_changed",u)),L.setContent(M.current),n?L.open(p,n):L.getPosition()?L.open(p):Gu(!1,"You must provide either an anchor or a position prop for ."),d&&d(L)}return()=>{g!==null&&(w&&google.maps.event.removeListener(w),v&&google.maps.event.removeListener(v),C&&google.maps.event.removeListener(C),A&&google.maps.event.removeListener(A),S&&google.maps.event.removeListener(S),f&&f(g),g.close())}},[]),M.current?Cd.createPortal(m.Children.only(e),M.current):null}m.memo(jgo);class Bgo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"containerElement",null),fo(this,"state",{infoBox:null}),fo(this,"open",(e,n)=>{n?this.context!==null&&e.open(this.context,n):e.getPosition()?this.context!==null&&e.open(this.context):Gu(!1,"You must provide either an anchor or a position prop for .")}),fo(this,"setInfoBoxCallback",()=>{this.state.infoBox!==null&&this.containerElement!==null&&(this.state.infoBox.setContent(this.containerElement),this.open(this.state.infoBox,this.props.anchor),this.props.onLoad&&this.props.onLoad(this.state.infoBox))})}componentDidMount(){var e=this.props.options||{},{position:n}=e,o=E9e(e,Ngo),r;n&&!(n instanceof google.maps.LatLng)&&(r=new google.maps.LatLng(n.lat,n.lng));var i=new Yrt(uJ(uJ({},o),r?{position:r}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=Ba({updaterMap:ZHe,eventMap:QHe,prevProps:{},nextProps:this.props,instance:i}),this.setState({infoBox:i},this.setInfoBoxCallback)}componentDidUpdate(e){var{infoBox:n}=this.state;n!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:ZHe,eventMap:QHe,prevProps:e,nextProps:this.props,instance:n}))}componentWillUnmount(){var{onUnmount:e}=this.props,{infoBox:n}=this.state;n!==null&&(e&&e(n),Ja(this.registeredEvents),n.close())}render(){return this.containerElement?Cd.createPortal(m.Children.only(this.props.children),this.containerElement):null}}fo(Bgo,"contextType",Sa);var Kae,eMe;function Ygo(){return eMe||(eMe=1,Kae=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var o,r,i;if(Array.isArray(e)){if(o=e.length,o!=n.length)return!1;for(r=o;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),o=i.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;r--!==0;){var a=i[r];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}),Kae}var Ogo=Ygo(),tMe=Ert(Ogo),nMe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],qae=1,tD=8;class F9e{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");var[n,o]=new Uint8Array(e,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");var r=o>>4;if(r!==qae)throw new Error("Got v".concat(r," data when expected v").concat(qae,"."));var i=nMe[o&15];if(!i)throw new Error("Unrecognized array type.");var[a]=new Uint16Array(e,2,1),[l]=new Uint32Array(e,4,1);return new F9e(l,a,i,e)}constructor(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:64,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Float64Array,r=arguments.length>3?arguments[3]:void 0;if(isNaN(e)||e<0)throw new Error("Unpexpected numItems value: ".concat(e,"."));this.numItems=+e,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=o,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;var i=nMe.indexOf(this.ArrayType),a=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-l%8)%8;if(i<0)throw new Error("Unexpected typed array class: ".concat(o,"."));r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,tD,e),this.coords=new this.ArrayType(this.data,tD+l+s,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(tD+a+l+s),this.ids=new this.IndexArrayType(this.data,tD,e),this.coords=new this.ArrayType(this.data,tD+l+s,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(qae<<4)+i]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=e)}add(e,n){var o=this._pos>>1;return this.ids[o]=o,this.coords[this._pos++]=e,this.coords[this._pos++]=n,o}finish(){var e=this._pos>>1;if(e!==this.numItems)throw new Error("Added ".concat(e," items when expected ").concat(this.numItems,"."));return Afe(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,n,o,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");for(var{ids:i,coords:a,nodeSize:l}=this,s=[0,i.length-1,0],c=[];s.length;){var u=s.pop()||0,d=s.pop()||0,f=s.pop()||0;if(d-f<=l){for(var p=f;p<=d;p++){var g=a[2*p],y=a[2*p+1];g>=e&&g<=o&&y>=n&&y<=r&&c.push(i[p])}continue}var w=f+d>>1,b=a[2*w],C=a[2*w+1];b>=e&&b<=o&&C>=n&&C<=r&&c.push(i[w]),(u===0?e<=b:n<=C)&&(s.push(f),s.push(w-1),s.push(1-u)),(u===0?o>=b:r>=C)&&(s.push(w+1),s.push(d),s.push(1-u))}return c}within(e,n,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");for(var{ids:r,coords:i,nodeSize:a}=this,l=[0,r.length-1,0],s=[],c=o*o;l.length;){var u=l.pop()||0,d=l.pop()||0,f=l.pop()||0;if(d-f<=a){for(var p=f;p<=d;p++)oMe(i[2*p],i[2*p+1],e,n)<=c&&s.push(r[p]);continue}var g=f+d>>1,y=i[2*g],w=i[2*g+1];oMe(y,w,e,n)<=c&&s.push(r[g]),(u===0?e-o<=y:n-o<=w)&&(l.push(f),l.push(g-1),l.push(1-u)),(u===0?e+o>=y:n+o>=w)&&(l.push(g+1),l.push(d),l.push(1-u))}return s}}function Afe(t,e,n,o,r,i){if(!(r-o<=n)){var a=o+r>>1;Ort(t,e,a,o,r,i),Afe(t,e,n,o,a-1,1-i),Afe(t,e,n,a+1,r,1-i)}}function Ort(t,e,n,o,r,i){for(;r>o;){if(r-o>600){var a=r-o+1,l=n-o+1,s=Math.log(a),c=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*c*(a-c)/a)*(l-a/2<0?-1:1),d=Math.max(o,Math.floor(n-l*c/a+u)),f=Math.min(r,Math.floor(n+(a-l)*c/a+u));Ort(t,e,n,d,f,i)}var p=e[2*n+i],g=o,y=r;for(nD(t,e,o,n),e[2*r+i]>p&&nD(t,e,o,r);gp;)y--}e[2*o+i]===p?nD(t,e,o,y):(y++,nD(t,e,y,r)),y<=n&&(o=y+1),n<=y&&(r=y-1)}}function nD(t,e,n,o){$ae(t,n,o),$ae(e,2*n,2*o),$ae(e,2*n+1,2*o+1)}function $ae(t,e,n){var o=t[e];t[e]=t[n],t[n]=o}function oMe(t,e,n,o){var r=t-n,i=e-o;return r*r+i*i}var _go={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},rMe=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),ev=2,Q4=3,Qae=4,j4=5,_rt=6;class Vgo{constructor(e){this.options=Object.assign(Object.create(_go),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){var{log:n,minZoom:o,maxZoom:r}=this.options;n&&console.time("total time");var i="prepare ".concat(e.length," points");n&&console.time(i),this.points=e;for(var a=[],l=0;l=o;g--){var y=+Date.now();p=this.trees[g]=this._createTree(this._cluster(p,g)),n&&console.log("z%d: %d clusters in %dms",g,p.numItems,+Date.now()-y)}return n&&console.timeEnd("total time"),this}getClusters(e,n){var o=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)o=-180,i=180;else if(o>i){var l=this.getClusters([o,r,180,a],n),s=this.getClusters([-180,r,i,a],n);return l.concat(s)}var c=this.trees[this._limitZoom(n)],u=c.range(BO(o),YO(a),BO(i),YO(r)),d=c.data,f=[];for(var p of u){var g=this.stride*p;f.push(d[g+j4]>1?iMe(d,g,this.clusterProps):this.points[d[g+Q4]])}return f}getChildren(e){var n=this._getOriginId(e),o=this._getOriginZoom(e),r="No cluster with the specified id.",i=this.trees[o];if(!i)throw new Error(r);var a=i.data;if(n*this.stride>=a.length)throw new Error(r);var l=this.options.radius/(this.options.extent*Math.pow(2,o-1)),s=a[n*this.stride],c=a[n*this.stride+1],u=i.within(s,c,l),d=[];for(var f of u){var p=f*this.stride;a[p+Qae]===e&&d.push(a[p+j4]>1?iMe(a,p,this.clusterProps):this.points[a[p+Q4]])}if(d.length===0)throw new Error(r);return d}getLeaves(e,n,o){n=n||10,o=o||0;var r=[];return this._appendLeaves(r,e,n,o,0),r}getTile(e,n,o){var r=this.trees[this._limitZoom(e)],i=Math.pow(2,e),{extent:a,radius:l}=this.options,s=l/a,c=(o-s)/i,u=(o+1+s)/i,d={features:[]};return this._addTileFeatures(r.range((n-s)/i,c,(n+1+s)/i,u),r.data,n,o,i,d),n===0&&this._addTileFeatures(r.range(1-s/i,c,1,u),r.data,i,o,i,d),n===i-1&&this._addTileFeatures(r.range(0,c,s/i,u),r.data,-1,o,i,d),d.features.length?d:null}getClusterExpansionZoom(e){for(var n=this._getOriginZoom(e)-1;n<=this.options.maxZoom;){var o=this.getChildren(e);if(n++,o.length!==1)break;e=o[0].properties.cluster_id}return n}_appendLeaves(e,n,o,r,i){var a=this.getChildren(n);for(var l of a){var s=l.properties;if(s&&s.cluster?i+s.point_count<=r?i+=s.point_count:i=this._appendLeaves(e,s.cluster_id,o,r,i):i1,u=void 0,d=void 0,f=void 0;if(c)u=Vrt(n,s,this.clusterProps),d=n[s],f=n[s+1];else{var p=this.points[n[s+Q4]];u=p.properties;var[g,y]=p.geometry.coordinates;d=BO(g),f=YO(y)}var w={type:1,geometry:[[Math.round(this.options.extent*(d*i-o)),Math.round(this.options.extent*(f*i-r))]],tags:u},b=void 0;c||this.options.generateId?b=n[s+Q4]:b=this.points[n[s+Q4]].id,b!==void 0&&(w.id=b),a.features.push(w)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){for(var{radius:o,extent:r,reduce:i,minPoints:a}=this.options,l=o/(r*Math.pow(2,n)),s=e.data,c=[],u=this.stride,d=0;dn&&(w+=s[C+j4])}if(w>y&&w>=a){var P=f*y,v=p*y,T=void 0,A=-1,x=((d/u|0)<<5)+(n+1)+this.points.length;for(var S of g){var R=S*u;if(!(s[R+ev]<=n)){s[R+ev]=n;var M=s[R+j4];P+=s[R]*M,v+=s[R+1]*M,s[R+Qae]=x,i&&(T||(T=this._map(s,d,!0),A=this.clusterProps.length,this.clusterProps.push(T)),i(T,this._map(s,R)))}}s[d+Qae]=x,c.push(P/w,v/w,1/0,x,-1,w),i&&c.push(A)}else{for(var D=0;D1)for(var E of g){var W=E*u;if(!(s[W+ev]<=n)){s[W+ev]=n;for(var j=0;j>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,n,o){if(e[n+j4]>1){var r=this.clusterProps[e[n+_rt]];return o?Object.assign({},r):r}var i=this.points[e[n+Q4]].properties,a=this.options.map(i);return o&&a===i?Object.assign({},a):a}}function iMe(t,e,n){return{type:"Feature",id:t[e+Q4],properties:Vrt(t,e,n),geometry:{type:"Point",coordinates:[Ggo(t[e]),Xgo(t[e+1])]}}}function Vrt(t,e,n){var o=t[e+j4],r=o>=1e4?"".concat(Math.round(o/1e3),"k"):o>=1e3?"".concat(Math.round(o/100)/10,"k"):o,i=t[e+_rt],a=i===-1?{}:Object.assign({},n[i]);return Object.assign(a,{cluster:!0,cluster_id:t[e+Q4],point_count:o,point_count_abbreviated:r})}function BO(t){return t/360+.5}function YO(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function Ggo(t){return(t-.5)*360}function Xgo(t){var e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -7141,12 +7141,12 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */function Jgo(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);rsg.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(sg.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class Kgo{constructor(e){var{maxZoom:n=16}=e;this.maxZoom=n}noop(e){var{markers:n}=e;return qgo(n)}}var qgo=t=>{var e=t.map(n=>new wfe({position:sg.getPosition(n),markers:[n]}));return e};class $go extends Kgo{constructor(e){var{maxZoom:n,radius:o=60}=e,r=Jgo(e,["maxZoom","radius"]);super({maxZoom:n}),this.state={zoom:-1},this.superCluster=new Vgo(Object.assign({maxZoom:this.maxZoom,radius:o},r))}calculate(e){var n=!1,o={zoom:e.map.getZoom()};if(!eMe(e.markers,this.markers)){n=!0,this.markers=[...e.markers];var r=this.markers.map(i=>{var a=sg.getPosition(i),l=[a.lng(),a.lat()];return{type:"Feature",geometry:{type:"Point",coordinates:l},properties:{marker:i}}});this.superCluster.load(r)}return n||(this.state.zoom<=this.maxZoom||o.zoom<=this.maxZoom)&&(n=!eMe(this.state,o)),this.state=o,n&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:n}}cluster(e){var{map:n}=e;return this.superCluster.getClusters([-180,-90,180,90],Math.round(n.getZoom())).map(o=>this.transformCluster(o))}transformCluster(e){var{geometry:{coordinates:[n,o]},properties:r}=e;if(r.cluster)return new wfe({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(a=>a.properties.marker),position:{lat:o,lng:n}});var i=r.marker;return new wfe({markers:[i],position:sg.getPosition(i)})}}class Qgo{constructor(e,n){this.markers={sum:e.length};var o=n.map(i=>i.count),r=o.reduce((i,a)=>i+a,0);this.clusters={count:n.length,markers:{mean:r/n.length,sum:r,min:Math.min(...o),max:Math.max(...o)}}}}class Zgo{render(e,n,o){var{count:r,position:i}=e,a=r>Math.max(10,n.clusters.markers.mean)?"#ff0000":"#0000ff",l=' +***************************************************************************** */function Jgo(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);rsg.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(sg.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class Kgo{constructor(e){var{maxZoom:n=16}=e;this.maxZoom=n}noop(e){var{markers:n}=e;return qgo(n)}}var qgo=t=>{var e=t.map(n=>new wfe({position:sg.getPosition(n),markers:[n]}));return e};class $go extends Kgo{constructor(e){var{maxZoom:n,radius:o=60}=e,r=Jgo(e,["maxZoom","radius"]);super({maxZoom:n}),this.state={zoom:-1},this.superCluster=new Vgo(Object.assign({maxZoom:this.maxZoom,radius:o},r))}calculate(e){var n=!1,o={zoom:e.map.getZoom()};if(!tMe(e.markers,this.markers)){n=!0,this.markers=[...e.markers];var r=this.markers.map(i=>{var a=sg.getPosition(i),l=[a.lng(),a.lat()];return{type:"Feature",geometry:{type:"Point",coordinates:l},properties:{marker:i}}});this.superCluster.load(r)}return n||(this.state.zoom<=this.maxZoom||o.zoom<=this.maxZoom)&&(n=!tMe(this.state,o)),this.state=o,n&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:n}}cluster(e){var{map:n}=e;return this.superCluster.getClusters([-180,-90,180,90],Math.round(n.getZoom())).map(o=>this.transformCluster(o))}transformCluster(e){var{geometry:{coordinates:[n,o]},properties:r}=e;if(r.cluster)return new wfe({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(a=>a.properties.marker),position:{lat:o,lng:n}});var i=r.marker;return new wfe({markers:[i],position:sg.getPosition(i)})}}class Qgo{constructor(e,n){this.markers={sum:e.length};var o=n.map(i=>i.count),r=o.reduce((i,a)=>i+a,0);this.clusters={count:n.length,markers:{mean:r/n.length,sum:r,min:Math.min(...o),max:Math.max(...o)}}}}class Zgo{render(e,n,o){var{count:r,position:i}=e,a=r>Math.max(10,n.clusters.markers.mean)?"#ff0000":"#0000ff",l=' `).concat(r,` -`),s="Cluster of ".concat(r," markers"),c=Number(google.maps.Marker.MAX_ZINDEX)+r;if(sg.isAdvancedMarkerAvailable(o)){var u=new DOMParser,d=u.parseFromString(l,"image/svg+xml").documentElement;d.setAttribute("transform","translate(0 25)");var f={map:o,position:i,zIndex:c,title:s,content:d};return new google.maps.marker.AdvancedMarkerElement(f)}var p={position:i,zIndex:c,title:s,icon:{url:"data:image/svg+xml;base64,".concat(btoa(l)),anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(p)}}function emo(t,e){for(var n in e.prototype)t.prototype[n]=e.prototype[n]}class F9e{constructor(){emo(F9e,google.maps.OverlayView)}}var UE;(function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click"})(UE||(UE={}));var tmo=(t,e,n)=>{n.fitBounds(e.bounds)};class nmo extends F9e{constructor(e){var{map:n,markers:o=[],algorithmOptions:r={},algorithm:i=new $go(r),renderer:a=new Zgo,onClusterClick:l=tmo}=e;super(),this.markers=[...o],this.clusters=[],this.algorithm=i,this.renderer=a,this.onClusterClick=l,n&&this.setMap(n)}addMarker(e,n){this.markers.includes(e)||(this.markers.push(e),n||this.render())}addMarkers(e,n){e.forEach(o=>{this.addMarker(o,!0)}),n||this.render()}removeMarker(e,n){var o=this.markers.indexOf(e);return o===-1?!1:(sg.setMap(e,null),this.markers.splice(o,1),n||this.render(),!0)}removeMarkers(e,n){var o=!1;return e.forEach(r=>{o=this.removeMarker(r,!0)||o}),o&&!n&&this.render(),o}clearMarkers(e){this.markers.length=0,e||this.render()}render(){var e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,UE.CLUSTERING_BEGIN,this);var{clusters:n,changed:o}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(o||o==null){var r=new Set;for(var i of n)i.markers.length==1&&r.add(i.markers[0]);var a=[];for(var l of this.clusters)l.marker!=null&&(l.markers.length==1?r.has(l.marker)||sg.setMap(l.marker,null):a.push(l.marker));this.clusters=n,this.renderClusters(),requestAnimationFrame(()=>a.forEach(s=>sg.setMap(s,null)))}google.maps.event.trigger(this,UE.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>sg.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){var e=new Qgo(this.markers,this.clusters),n=this.getMap();this.clusters.forEach(o=>{o.markers.length===1?o.marker=o.markers[0]:(o.marker=this.renderer.render(o,e,n),o.markers.forEach(r=>sg.setMap(r,null)),this.onClusterClick&&o.marker.addListener("click",r=>{google.maps.event.trigger(this,UE.CLUSTER_CLICK,o),this.onClusterClick(r,o,n)})),sg.setMap(o.marker,n)})}}function iMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function aMe(t){for(var e=1;e{if(e&&n===null){var r=new nmo(aMe(aMe({},t),{},{map:e}));o(r)}},[e]),n}function rmo(t){var{children:e,options:n}=t,o=omo(n);return o!==null?e(o):null}m.memo(rmo);var lMe={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},sMe={options(t,e){t.setOptions(e)},position(t,e){t.setPosition(e)},zIndex(t,e){t.setZIndex(e)}};function imo(t){var{children:e,anchor:n,options:o,position:r,zIndex:i,onCloseClick:a,onDomReady:l,onContentChanged:s,onPositionChanged:c,onZindexChanged:u,onLoad:d,onUnmount:f}=t,p=m.useContext(Sa),[g,y]=m.useState(null),[w,b]=m.useState(null),[C,P]=m.useState(null),[v,T]=m.useState(null),[A,x]=m.useState(null),[S,R]=m.useState(null),M=m.useRef(null);return m.useEffect(()=>{g!==null&&(g.close(),n?g.open(p,n):g.getPosition()&&g.open(p))},[p,g,n]),m.useEffect(()=>{o&&g!==null&&g.setOptions(o)},[g,o]),m.useEffect(()=>{r&&g!==null&&g.setPosition(r)},[r]),m.useEffect(()=>{typeof i=="number"&&g!==null&&g.setZIndex(i)},[i]),m.useEffect(()=>{g&&a&&(w!==null&&google.maps.event.removeListener(w),b(google.maps.event.addListener(g,"closeclick",a)))},[a]),m.useEffect(()=>{g&&l&&(C!==null&&google.maps.event.removeListener(C),P(google.maps.event.addListener(g,"domready",l)))},[l]),m.useEffect(()=>{g&&s&&(v!==null&&google.maps.event.removeListener(v),T(google.maps.event.addListener(g,"content_changed",s)))},[s]),m.useEffect(()=>{g&&c&&(A!==null&&google.maps.event.removeListener(A),x(google.maps.event.addListener(g,"position_changed",c)))},[c]),m.useEffect(()=>{g&&u&&(S!==null&&google.maps.event.removeListener(S),R(google.maps.event.addListener(g,"zindex_changed",u)))},[u]),m.useEffect(()=>{var D=new google.maps.InfoWindow(o);return y(D),M.current=document.createElement("div"),a&&b(google.maps.event.addListener(D,"closeclick",a)),l&&P(google.maps.event.addListener(D,"domready",l)),s&&T(google.maps.event.addListener(D,"content_changed",s)),c&&x(google.maps.event.addListener(D,"position_changed",c)),u&&R(google.maps.event.addListener(D,"zindex_changed",u)),D.setContent(M.current),r&&D.setPosition(r),i&&D.setZIndex(i),n?D.open(p,n):D.getPosition()?D.open(p):Gu(!1,"You must provide either an anchor (typically render it inside a ) or a position props for ."),d&&d(D),()=>{w&&google.maps.event.removeListener(w),v&&google.maps.event.removeListener(v),C&&google.maps.event.removeListener(C),A&&google.maps.event.removeListener(A),S&&google.maps.event.removeListener(S),f&&f(D),D.close()}},[]),M.current?Cd.createPortal(m.Children.only(e),M.current):null}m.memo(imo);class Grt extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"containerElement",null),fo(this,"state",{infoWindow:null}),fo(this,"open",(e,n)=>{n?e.open(this.context,n):e.getPosition()?e.open(this.context):Gu(!1,"You must provide either an anchor (typically render it inside a ) or a position props for .")}),fo(this,"setInfoWindowCallback",()=>{this.state.infoWindow!==null&&this.containerElement!==null&&(this.state.infoWindow.setContent(this.containerElement),this.open(this.state.infoWindow,this.props.anchor),this.props.onLoad&&this.props.onLoad(this.state.infoWindow))})}componentDidMount(){var e=new google.maps.InfoWindow(this.props.options);this.containerElement=document.createElement("div"),this.registeredEvents=Ba({updaterMap:sMe,eventMap:lMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({infoWindow:e}),this.setInfoWindowCallback)}componentDidUpdate(e){this.state.infoWindow!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:sMe,eventMap:lMe,prevProps:e,nextProps:this.props,instance:this.state.infoWindow}))}componentWillUnmount(){this.state.infoWindow!==null&&(Ja(this.registeredEvents),this.props.onUnmount&&this.props.onUnmount(this.state.infoWindow),this.state.infoWindow.close())}render(){return this.containerElement?Cd.createPortal(m.Children.only(this.props.children),this.containerElement):null}}fo(Grt,"contextType",Sa);function cMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function uJ(t){for(var e=1;e{v!==null&&v.setMap(P)},[P]),m.useEffect(()=>{typeof e<"u"&&v!==null&&v.setOptions(e)},[v,e]),m.useEffect(()=>{typeof n<"u"&&v!==null&&v.setDraggable(n)},[v,n]),m.useEffect(()=>{typeof o<"u"&&v!==null&&v.setEditable(o)},[v,o]),m.useEffect(()=>{typeof r<"u"&&v!==null&&v.setVisible(r)},[v,r]),m.useEffect(()=>{typeof i<"u"&&v!==null&&v.setPath(i)},[v,i]),m.useEffect(()=>{v&&a&&(A!==null&&google.maps.event.removeListener(A),x(google.maps.event.addListener(v,"dblclick",a)))},[a]),m.useEffect(()=>{v&&l&&(S!==null&&google.maps.event.removeListener(S),R(google.maps.event.addListener(v,"dragend",l)))},[l]),m.useEffect(()=>{v&&s&&(M!==null&&google.maps.event.removeListener(M),D(google.maps.event.addListener(v,"dragstart",s)))},[s]),m.useEffect(()=>{v&&c&&(E!==null&&google.maps.event.removeListener(E),W(google.maps.event.addListener(v,"mousedown",c)))},[c]),m.useEffect(()=>{v&&u&&(j!==null&&google.maps.event.removeListener(j),L(google.maps.event.addListener(v,"mousemove",u)))},[u]),m.useEffect(()=>{v&&d&&(k!==null&&google.maps.event.removeListener(k),N(google.maps.event.addListener(v,"mouseout",d)))},[d]),m.useEffect(()=>{v&&f&&(F!==null&&google.maps.event.removeListener(F),U(google.maps.event.addListener(v,"mouseover",f)))},[f]),m.useEffect(()=>{v&&p&&(O!==null&&google.maps.event.removeListener(O),B(google.maps.event.addListener(v,"mouseup",p)))},[p]),m.useEffect(()=>{v&&g&&(_!==null&&google.maps.event.removeListener(_),X(google.maps.event.addListener(v,"rightclick",g)))},[g]),m.useEffect(()=>{v&&y&&($!==null&&google.maps.event.removeListener($),Q(google.maps.event.addListener(v,"click",y)))},[y]),m.useEffect(()=>{v&&w&&(le!==null&&google.maps.event.removeListener(le),q(google.maps.event.addListener(v,"drag",w)))},[w]),m.useEffect(()=>{var te=new google.maps.Polyline(uJ(uJ({},e||amo),{},{map:P}));return i&&te.setPath(i),typeof r<"u"&&te.setVisible(r),typeof o<"u"&&te.setEditable(o),typeof n<"u"&&te.setDraggable(n),a&&x(google.maps.event.addListener(te,"dblclick",a)),l&&R(google.maps.event.addListener(te,"dragend",l)),s&&D(google.maps.event.addListener(te,"dragstart",s)),c&&W(google.maps.event.addListener(te,"mousedown",c)),u&&L(google.maps.event.addListener(te,"mousemove",u)),d&&N(google.maps.event.addListener(te,"mouseout",d)),f&&U(google.maps.event.addListener(te,"mouseover",f)),p&&B(google.maps.event.addListener(te,"mouseup",p)),g&&X(google.maps.event.addListener(te,"rightclick",g)),y&&Q(google.maps.event.addListener(te,"click",y)),w&&q(google.maps.event.addListener(te,"drag",w)),T(te),b&&b(te),()=>{A!==null&&google.maps.event.removeListener(A),S!==null&&google.maps.event.removeListener(S),M!==null&&google.maps.event.removeListener(M),E!==null&&google.maps.event.removeListener(E),j!==null&&google.maps.event.removeListener(j),k!==null&&google.maps.event.removeListener(k),F!==null&&google.maps.event.removeListener(F),O!==null&&google.maps.event.removeListener(O),_!==null&&google.maps.event.removeListener(_),$!==null&&google.maps.event.removeListener($),C&&C(te),te.setMap(null)}},[]),null}m.memo(lmo);class smo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{polyline:null}),fo(this,"setPolylineCallback",()=>{this.state.polyline!==null&&this.props.onLoad&&this.props.onLoad(this.state.polyline)})}componentDidMount(){var e=new google.maps.Polyline(uJ(uJ({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:dMe,eventMap:uMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{polyline:e}},this.setPolylineCallback)}componentDidUpdate(e){this.state.polyline!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:dMe,eventMap:uMe,prevProps:e,nextProps:this.props,instance:this.state.polyline}))}componentWillUnmount(){this.state.polyline!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),Ja(this.registeredEvents),this.state.polyline.setMap(null))}render(){return null}}fo(smo,"contextType",Sa);function fMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function hMe(t){for(var e=1;e{A!==null&&A.setMap(T)},[T]),m.useEffect(()=>{typeof e<"u"&&A!==null&&A.setOptions(e)},[A,e]),m.useEffect(()=>{typeof n<"u"&&A!==null&&A.setDraggable(n)},[A,n]),m.useEffect(()=>{typeof o<"u"&&A!==null&&A.setEditable(o)},[A,o]),m.useEffect(()=>{typeof r<"u"&&A!==null&&A.setVisible(r)},[A,r]),m.useEffect(()=>{typeof i<"u"&&A!==null&&A.setPath(i)},[A,i]),m.useEffect(()=>{typeof a<"u"&&A!==null&&A.setPaths(a)},[A,a]),m.useEffect(()=>{A&&typeof l=="function"&&(S!==null&&google.maps.event.removeListener(S),R(google.maps.event.addListener(A,"dblclick",l)))},[l]),m.useEffect(()=>{A&&(google.maps.event.addListener(A.getPath(),"insert_at",()=>{v==null||v(A)}),google.maps.event.addListener(A.getPath(),"set_at",()=>{v==null||v(A)}),google.maps.event.addListener(A.getPath(),"remove_at",()=>{v==null||v(A)}))},[A,v]),m.useEffect(()=>{A&&typeof s=="function"&&(M!==null&&google.maps.event.removeListener(M),D(google.maps.event.addListener(A,"dragend",s)))},[s]),m.useEffect(()=>{A&&typeof c=="function"&&(E!==null&&google.maps.event.removeListener(E),W(google.maps.event.addListener(A,"dragstart",c)))},[c]),m.useEffect(()=>{A&&typeof u=="function"&&(j!==null&&google.maps.event.removeListener(j),L(google.maps.event.addListener(A,"mousedown",u)))},[u]),m.useEffect(()=>{A&&typeof d=="function"&&(k!==null&&google.maps.event.removeListener(k),N(google.maps.event.addListener(A,"mousemove",d)))},[d]),m.useEffect(()=>{A&&typeof f=="function"&&(F!==null&&google.maps.event.removeListener(F),U(google.maps.event.addListener(A,"mouseout",f)))},[f]),m.useEffect(()=>{A&&typeof p=="function"&&(O!==null&&google.maps.event.removeListener(O),B(google.maps.event.addListener(A,"mouseover",p)))},[p]),m.useEffect(()=>{A&&typeof g=="function"&&(_!==null&&google.maps.event.removeListener(_),X(google.maps.event.addListener(A,"mouseup",g)))},[g]),m.useEffect(()=>{A&&typeof y=="function"&&($!==null&&google.maps.event.removeListener($),Q(google.maps.event.addListener(A,"rightclick",y)))},[y]),m.useEffect(()=>{A&&typeof w=="function"&&(le!==null&&google.maps.event.removeListener(le),q(google.maps.event.addListener(A,"click",w)))},[w]),m.useEffect(()=>{A&&typeof b=="function"&&(te!==null&&google.maps.event.removeListener(te),re(google.maps.event.addListener(A,"drag",b)))},[b]),m.useEffect(()=>{var ae=new google.maps.Polygon(hMe(hMe({},e),{},{map:T}));return i&&ae.setPath(i),a&&ae.setPaths(a),typeof r<"u"&&ae.setVisible(r),typeof o<"u"&&ae.setEditable(o),typeof n<"u"&&ae.setDraggable(n),l&&R(google.maps.event.addListener(ae,"dblclick",l)),s&&D(google.maps.event.addListener(ae,"dragend",s)),c&&W(google.maps.event.addListener(ae,"dragstart",c)),u&&L(google.maps.event.addListener(ae,"mousedown",u)),d&&N(google.maps.event.addListener(ae,"mousemove",d)),f&&U(google.maps.event.addListener(ae,"mouseout",f)),p&&B(google.maps.event.addListener(ae,"mouseover",p)),g&&X(google.maps.event.addListener(ae,"mouseup",g)),y&&Q(google.maps.event.addListener(ae,"rightclick",y)),w&&q(google.maps.event.addListener(ae,"click",w)),b&&re(google.maps.event.addListener(ae,"drag",b)),x(ae),C&&C(ae),()=>{S!==null&&google.maps.event.removeListener(S),M!==null&&google.maps.event.removeListener(M),E!==null&&google.maps.event.removeListener(E),j!==null&&google.maps.event.removeListener(j),k!==null&&google.maps.event.removeListener(k),F!==null&&google.maps.event.removeListener(F),O!==null&&google.maps.event.removeListener(O),_!==null&&google.maps.event.removeListener(_),$!==null&&google.maps.event.removeListener($),le!==null&&google.maps.event.removeListener(le),P&&P(ae),ae.setMap(null)}},[]),null}m.memo(cmo);class umo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[])}componentDidMount(){var e=this.props.options||{};this.polygon=new google.maps.Polygon(e),this.polygon.setMap(this.context),this.registeredEvents=Ba({updaterMap:gMe,eventMap:pMe,prevProps:{},nextProps:this.props,instance:this.polygon}),this.props.onLoad&&this.props.onLoad(this.polygon)}componentDidUpdate(e){this.polygon&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:gMe,eventMap:pMe,prevProps:e,nextProps:this.props,instance:this.polygon}))}componentWillUnmount(){this.polygon&&(this.props.onUnmount&&this.props.onUnmount(this.polygon),Ja(this.registeredEvents),this.polygon&&this.polygon.setMap(null))}render(){return null}}fo(umo,"contextType",Sa);function mMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function dJ(t){for(var e=1;e{T!==null&&T.setMap(v)},[v]),m.useEffect(()=>{typeof e<"u"&&T!==null&&T.setOptions(e)},[T,e]),m.useEffect(()=>{typeof o<"u"&&T!==null&&T.setDraggable(o)},[T,o]),m.useEffect(()=>{typeof r<"u"&&T!==null&&T.setEditable(r)},[T,r]),m.useEffect(()=>{typeof i<"u"&&T!==null&&T.setVisible(i)},[T,i]),m.useEffect(()=>{typeof n<"u"&&T!==null&&T.setBounds(n)},[T,n]),m.useEffect(()=>{T&&a&&(x!==null&&google.maps.event.removeListener(x),S(google.maps.event.addListener(T,"dblclick",a)))},[a]),m.useEffect(()=>{T&&l&&(R!==null&&google.maps.event.removeListener(R),M(google.maps.event.addListener(T,"dragend",l)))},[l]),m.useEffect(()=>{T&&s&&(D!==null&&google.maps.event.removeListener(D),E(google.maps.event.addListener(T,"dragstart",s)))},[s]),m.useEffect(()=>{T&&c&&(W!==null&&google.maps.event.removeListener(W),j(google.maps.event.addListener(T,"mousedown",c)))},[c]),m.useEffect(()=>{T&&u&&(L!==null&&google.maps.event.removeListener(L),k(google.maps.event.addListener(T,"mousemove",u)))},[u]),m.useEffect(()=>{T&&d&&(N!==null&&google.maps.event.removeListener(N),F(google.maps.event.addListener(T,"mouseout",d)))},[d]),m.useEffect(()=>{T&&f&&(U!==null&&google.maps.event.removeListener(U),O(google.maps.event.addListener(T,"mouseover",f)))},[f]),m.useEffect(()=>{T&&p&&(B!==null&&google.maps.event.removeListener(B),_(google.maps.event.addListener(T,"mouseup",p)))},[p]),m.useEffect(()=>{T&&g&&(X!==null&&google.maps.event.removeListener(X),$(google.maps.event.addListener(T,"rightclick",g)))},[g]),m.useEffect(()=>{T&&y&&(Q!==null&&google.maps.event.removeListener(Q),le(google.maps.event.addListener(T,"click",y)))},[y]),m.useEffect(()=>{T&&w&&(q!==null&&google.maps.event.removeListener(q),te(google.maps.event.addListener(T,"drag",w)))},[w]),m.useEffect(()=>{T&&b&&(re!==null&&google.maps.event.removeListener(re),ae(google.maps.event.addListener(T,"bounds_changed",b)))},[b]),m.useEffect(()=>{var se=new google.maps.Rectangle(dJ(dJ({},e),{},{map:v}));return typeof i<"u"&&se.setVisible(i),typeof r<"u"&&se.setEditable(r),typeof o<"u"&&se.setDraggable(o),typeof n<"u"&&se.setBounds(n),a&&S(google.maps.event.addListener(se,"dblclick",a)),l&&M(google.maps.event.addListener(se,"dragend",l)),s&&E(google.maps.event.addListener(se,"dragstart",s)),c&&j(google.maps.event.addListener(se,"mousedown",c)),u&&k(google.maps.event.addListener(se,"mousemove",u)),d&&F(google.maps.event.addListener(se,"mouseout",d)),f&&O(google.maps.event.addListener(se,"mouseover",f)),p&&_(google.maps.event.addListener(se,"mouseup",p)),g&&$(google.maps.event.addListener(se,"rightclick",g)),y&&le(google.maps.event.addListener(se,"click",y)),w&&te(google.maps.event.addListener(se,"drag",w)),b&&ae(google.maps.event.addListener(se,"bounds_changed",b)),A(se),C&&C(se),()=>{x!==null&&google.maps.event.removeListener(x),R!==null&&google.maps.event.removeListener(R),D!==null&&google.maps.event.removeListener(D),W!==null&&google.maps.event.removeListener(W),L!==null&&google.maps.event.removeListener(L),N!==null&&google.maps.event.removeListener(N),U!==null&&google.maps.event.removeListener(U),B!==null&&google.maps.event.removeListener(B),X!==null&&google.maps.event.removeListener(X),Q!==null&&google.maps.event.removeListener(Q),q!==null&&google.maps.event.removeListener(q),re!==null&&google.maps.event.removeListener(re),P&&P(se),se.setMap(null)}},[]),null}m.memo(dmo);let fmo=class extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{rectangle:null}),fo(this,"setRectangleCallback",()=>{this.state.rectangle!==null&&this.props.onLoad&&this.props.onLoad(this.state.rectangle)})}componentDidMount(){var e=new google.maps.Rectangle(dJ(dJ({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:AMe,eventMap:yMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{rectangle:e}},this.setRectangleCallback)}componentDidUpdate(e){this.state.rectangle!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:AMe,eventMap:yMe,prevProps:e,nextProps:this.props,instance:this.state.rectangle}))}componentWillUnmount(){this.state.rectangle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),Ja(this.registeredEvents),this.state.rectangle.setMap(null))}render(){return null}};fo(fmo,"contextType",Sa);function wMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function fJ(t){for(var e=1;e{x!==null&&x.setMap(A)},[A]),m.useEffect(()=>{typeof e<"u"&&x!==null&&x.setOptions(e)},[x,e]),m.useEffect(()=>{typeof r<"u"&&x!==null&&x.setDraggable(r)},[x,r]),m.useEffect(()=>{typeof i<"u"&&x!==null&&x.setEditable(i)},[x,i]),m.useEffect(()=>{typeof a<"u"&&x!==null&&x.setVisible(a)},[x,a]),m.useEffect(()=>{typeof o=="number"&&x!==null&&x.setRadius(o)},[x,o]),m.useEffect(()=>{typeof n<"u"&&x!==null&&x.setCenter(n)},[x,n]),m.useEffect(()=>{x&&l&&(R!==null&&google.maps.event.removeListener(R),M(google.maps.event.addListener(x,"dblclick",l)))},[l]),m.useEffect(()=>{x&&s&&(D!==null&&google.maps.event.removeListener(D),E(google.maps.event.addListener(x,"dragend",s)))},[s]),m.useEffect(()=>{x&&c&&(W!==null&&google.maps.event.removeListener(W),j(google.maps.event.addListener(x,"dragstart",c)))},[c]),m.useEffect(()=>{x&&u&&(L!==null&&google.maps.event.removeListener(L),k(google.maps.event.addListener(x,"mousedown",u)))},[u]),m.useEffect(()=>{x&&d&&(N!==null&&google.maps.event.removeListener(N),F(google.maps.event.addListener(x,"mousemove",d)))},[d]),m.useEffect(()=>{x&&f&&(U!==null&&google.maps.event.removeListener(U),O(google.maps.event.addListener(x,"mouseout",f)))},[f]),m.useEffect(()=>{x&&p&&(B!==null&&google.maps.event.removeListener(B),_(google.maps.event.addListener(x,"mouseover",p)))},[p]),m.useEffect(()=>{x&&g&&(X!==null&&google.maps.event.removeListener(X),$(google.maps.event.addListener(x,"mouseup",g)))},[g]),m.useEffect(()=>{x&&y&&(Q!==null&&google.maps.event.removeListener(Q),le(google.maps.event.addListener(x,"rightclick",y)))},[y]),m.useEffect(()=>{x&&w&&(q!==null&&google.maps.event.removeListener(q),te(google.maps.event.addListener(x,"click",w)))},[w]),m.useEffect(()=>{x&&b&&(re!==null&&google.maps.event.removeListener(re),ae(google.maps.event.addListener(x,"drag",b)))},[b]),m.useEffect(()=>{x&&C&&(se!==null&&google.maps.event.removeListener(se),ne(google.maps.event.addListener(x,"center_changed",C)))},[w]),m.useEffect(()=>{x&&P&&(fe!==null&&google.maps.event.removeListener(fe),ge(google.maps.event.addListener(x,"radius_changed",P)))},[P]),m.useEffect(()=>{var de=new google.maps.Circle(fJ(fJ({},e||hmo),{},{map:A}));return typeof o=="number"&&de.setRadius(o),typeof n<"u"&&de.setCenter(n),typeof o=="number"&&de.setRadius(o),typeof a<"u"&&de.setVisible(a),typeof i<"u"&&de.setEditable(i),typeof r<"u"&&de.setDraggable(r),l&&M(google.maps.event.addListener(de,"dblclick",l)),s&&E(google.maps.event.addListener(de,"dragend",s)),c&&j(google.maps.event.addListener(de,"dragstart",c)),u&&k(google.maps.event.addListener(de,"mousedown",u)),d&&F(google.maps.event.addListener(de,"mousemove",d)),f&&O(google.maps.event.addListener(de,"mouseout",f)),p&&_(google.maps.event.addListener(de,"mouseover",p)),g&&$(google.maps.event.addListener(de,"mouseup",g)),y&&le(google.maps.event.addListener(de,"rightclick",y)),w&&te(google.maps.event.addListener(de,"click",w)),b&&ae(google.maps.event.addListener(de,"drag",b)),C&&ne(google.maps.event.addListener(de,"center_changed",C)),P&&ge(google.maps.event.addListener(de,"radius_changed",P)),S(de),v&&v(de),()=>{R!==null&&google.maps.event.removeListener(R),D!==null&&google.maps.event.removeListener(D),W!==null&&google.maps.event.removeListener(W),L!==null&&google.maps.event.removeListener(L),N!==null&&google.maps.event.removeListener(N),U!==null&&google.maps.event.removeListener(U),B!==null&&google.maps.event.removeListener(B),X!==null&&google.maps.event.removeListener(X),Q!==null&&google.maps.event.removeListener(Q),q!==null&&google.maps.event.removeListener(q),se!==null&&google.maps.event.removeListener(se),fe!==null&&google.maps.event.removeListener(fe),T&&T(de),de.setMap(null)}},[]),null}m.memo(pmo);class gmo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{circle:null}),fo(this,"setCircleCallback",()=>{this.state.circle!==null&&this.props.onLoad&&this.props.onLoad(this.state.circle)})}componentDidMount(){var e=new google.maps.Circle(fJ(fJ({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:xMe,eventMap:vMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{circle:e}},this.setCircleCallback)}componentDidUpdate(e){this.state.circle!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:xMe,eventMap:vMe,prevProps:e,nextProps:this.props,instance:this.state.circle}))}componentWillUnmount(){if(this.state.circle!==null){var e;this.props.onUnmount&&this.props.onUnmount(this.state.circle),Ja(this.registeredEvents),(e=this.state.circle)===null||e===void 0||e.setMap(null)}}render(){return null}}fo(gmo,"contextType",Sa);function bMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function hJ(t){for(var e=1;e{C!==null&&C.setMap(b)},[b]),m.useEffect(()=>{C&&o&&(v!==null&&google.maps.event.removeListener(v),T(google.maps.event.addListener(C,"dblclick",o)))},[o]),m.useEffect(()=>{C&&r&&(A!==null&&google.maps.event.removeListener(A),x(google.maps.event.addListener(C,"mousedown",r)))},[r]),m.useEffect(()=>{C&&i&&(S!==null&&google.maps.event.removeListener(S),R(google.maps.event.addListener(C,"mousemove",i)))},[i]),m.useEffect(()=>{C&&a&&(M!==null&&google.maps.event.removeListener(M),D(google.maps.event.addListener(C,"mouseout",a)))},[a]),m.useEffect(()=>{C&&l&&(E!==null&&google.maps.event.removeListener(E),W(google.maps.event.addListener(C,"mouseover",l)))},[l]),m.useEffect(()=>{C&&s&&(j!==null&&google.maps.event.removeListener(j),L(google.maps.event.addListener(C,"mouseup",s)))},[s]),m.useEffect(()=>{C&&c&&(k!==null&&google.maps.event.removeListener(k),N(google.maps.event.addListener(C,"rightclick",c)))},[c]),m.useEffect(()=>{C&&n&&(F!==null&&google.maps.event.removeListener(F),U(google.maps.event.addListener(C,"click",n)))},[n]),m.useEffect(()=>{C&&u&&(O!==null&&google.maps.event.removeListener(O),B(google.maps.event.addListener(C,"addfeature",u)))},[u]),m.useEffect(()=>{C&&d&&(_!==null&&google.maps.event.removeListener(_),X(google.maps.event.addListener(C,"removefeature",d)))},[d]),m.useEffect(()=>{C&&f&&($!==null&&google.maps.event.removeListener($),Q(google.maps.event.addListener(C,"removeproperty",f)))},[f]),m.useEffect(()=>{C&&p&&(le!==null&&google.maps.event.removeListener(le),q(google.maps.event.addListener(C,"setgeometry",p)))},[p]),m.useEffect(()=>{C&&g&&(te!==null&&google.maps.event.removeListener(te),re(google.maps.event.addListener(C,"setproperty",g)))},[g]),m.useEffect(()=>{if(b!==null){var ae=new google.maps.Data(hJ(hJ({},e),{},{map:b}));o&&T(google.maps.event.addListener(ae,"dblclick",o)),r&&x(google.maps.event.addListener(ae,"mousedown",r)),i&&R(google.maps.event.addListener(ae,"mousemove",i)),a&&D(google.maps.event.addListener(ae,"mouseout",a)),l&&W(google.maps.event.addListener(ae,"mouseover",l)),s&&L(google.maps.event.addListener(ae,"mouseup",s)),c&&N(google.maps.event.addListener(ae,"rightclick",c)),n&&U(google.maps.event.addListener(ae,"click",n)),u&&B(google.maps.event.addListener(ae,"addfeature",u)),d&&X(google.maps.event.addListener(ae,"removefeature",d)),f&&Q(google.maps.event.addListener(ae,"removeproperty",f)),p&&q(google.maps.event.addListener(ae,"setgeometry",p)),g&&re(google.maps.event.addListener(ae,"setproperty",g)),P(ae),y&&y(ae)}return()=>{C&&(v!==null&&google.maps.event.removeListener(v),A!==null&&google.maps.event.removeListener(A),S!==null&&google.maps.event.removeListener(S),M!==null&&google.maps.event.removeListener(M),E!==null&&google.maps.event.removeListener(E),j!==null&&google.maps.event.removeListener(j),k!==null&&google.maps.event.removeListener(k),F!==null&&google.maps.event.removeListener(F),O!==null&&google.maps.event.removeListener(O),_!==null&&google.maps.event.removeListener(_),$!==null&&google.maps.event.removeListener($),le!==null&&google.maps.event.removeListener(le),te!==null&&google.maps.event.removeListener(te),w&&w(C),C.setMap(null))}},[]),null}m.memo(mmo);class ymo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{data:null}),fo(this,"setDataCallback",()=>{this.state.data!==null&&this.props.onLoad&&this.props.onLoad(this.state.data)})}componentDidMount(){if(this.context!==null){var e=new google.maps.Data(hJ(hJ({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:TMe,eventMap:SMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({data:e}),this.setDataCallback)}}componentDidUpdate(e){this.state.data!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:TMe,eventMap:SMe,prevProps:e,nextProps:this.props,instance:this.state.data}))}componentWillUnmount(){this.state.data!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),Ja(this.registeredEvents),this.state.data&&this.state.data.setMap(null))}render(){return null}}fo(ymo,"contextType",Sa);function PMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function CMe(t){for(var e=1;e{this.state.kmlLayer!==null&&this.props.onLoad&&this.props.onLoad(this.state.kmlLayer)})}componentDidMount(){var e=new google.maps.KmlLayer(CMe(CMe({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:HMe,eventMap:RMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{kmlLayer:e}},this.setKmlLayerCallback)}componentDidUpdate(e){this.state.kmlLayer!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:HMe,eventMap:RMe,prevProps:e,nextProps:this.props,instance:this.state.kmlLayer}))}componentWillUnmount(){this.state.kmlLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),Ja(this.registeredEvents),this.state.kmlLayer.setMap(null))}render(){return null}}fo(Amo,"contextType",Sa);function Xrt(t,e){return typeof e=="function"?e(t.offsetWidth,t.offsetHeight):{x:0,y:0}}function wmo(t,e){return new e(t.lat,t.lng)}function vmo(t,e){return new e(new google.maps.LatLng(t.ne.lat,t.ne.lng),new google.maps.LatLng(t.sw.lat,t.sw.lng))}function xmo(t,e,n){return t instanceof e?t:n(t,e)}function bmo(t,e,n){return t instanceof e?t:n(t,e)}function Smo(t,e,n){var o=t&&t.fromLatLngToDivPixel(n.getNorthEast()),r=t&&t.fromLatLngToDivPixel(n.getSouthWest());return o&&r?{left:"".concat(r.x+e.x,"px"),top:"".concat(o.y+e.y,"px"),width:"".concat(o.x-r.x-e.x,"px"),height:"".concat(r.y-o.y-e.y,"px")}:{left:"-9999px",top:"-9999px"}}function Tmo(t,e,n){var o=t&&t.fromLatLngToDivPixel(n);if(o){var{x:r,y:i}=o;return{left:"".concat(r+e.x,"px"),top:"".concat(i+e.y,"px")}}return{left:"-9999px",top:"-9999px"}}function Jrt(t,e,n,o){return n!==void 0?Smo(t,e,bmo(n,google.maps.LatLngBounds,vmo)):Tmo(t,e,xmo(o,google.maps.LatLng,wmo))}function Pmo(t,e){return t.left===e.left&&t.top===e.top&&t.width===e.height&&t.height===e.height}function MMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Cmo(t){for(var e=1;e{var f=document.createElement("div");return f.style.position="absolute",f},[]),d=m.useMemo(()=>Rmo(u,o,e,n,l),[u,o,e,n]);return m.useEffect(()=>(i==null||i(d),d==null||d.setMap(c),()=>{a==null||a(d),d==null||d.setMap(null)}),[c,d]),m.useEffect(()=>{u.style.zIndex="".concat(r)},[r,u]),Cd.createPortal(s,u)}m.memo(Mmo);class PM extends m.PureComponent{constructor(e){super(e),fo(this,"state",{paneEl:null,containerStyle:{position:"absolute"}}),fo(this,"updatePane",()=>{var o=this.props.mapPaneName,r=this.overlayView.getPanes();Gu(!!o,"OverlayView requires props.mapPaneName but got %s",o),r?this.setState({paneEl:r[o]}):this.setState({paneEl:null})}),fo(this,"onAdd",()=>{var o,r;this.updatePane(),(o=(r=this.props).onLoad)===null||o===void 0||o.call(r,this.overlayView)}),fo(this,"onPositionElement",()=>{var o=this.overlayView.getProjection(),r=Hmo({x:0,y:0},this.containerRef.current?Xrt(this.containerRef.current,this.props.getPixelPositionOffset):{}),i=Jrt(o,r,this.props.bounds,this.props.position);if(!Pmo(i,{left:this.state.containerStyle.left,top:this.state.containerStyle.top,width:this.state.containerStyle.width,height:this.state.containerStyle.height})){var a,l,s,c;this.setState({containerStyle:{top:(a=i.top)!==null&&a!==void 0?a:0,left:(l=i.left)!==null&&l!==void 0?l:0,width:(s=i.width)!==null&&s!==void 0?s:0,height:(c=i.height)!==null&&c!==void 0?c:0,position:"absolute"}})}}),fo(this,"draw",()=>{this.onPositionElement()}),fo(this,"onRemove",()=>{var o,r;this.setState(()=>({paneEl:null})),(o=(r=this.props).onUnmount)===null||o===void 0||o.call(r,this.overlayView)}),this.containerRef=m.createRef();var n=new google.maps.OverlayView;n.onAdd=this.onAdd,n.draw=this.draw,n.onRemove=this.onRemove,this.overlayView=n}componentDidMount(){this.overlayView.setMap(this.context)}componentDidUpdate(e){var n=zMe(e.position),o=zMe(this.props.position),r=DMe(e.bounds),i=DMe(this.props.bounds);(n!==o||r!==i)&&this.overlayView.draw(),e.mapPaneName!==this.props.mapPaneName&&this.updatePane()}componentWillUnmount(){this.overlayView.setMap(null)}render(){var e=this.state.paneEl;return e?Cd.createPortal(h.jsx("div",{ref:this.containerRef,style:this.state.containerStyle,children:m.Children.only(this.props.children)}),e):null}}fo(PM,"FLOAT_PANE","floatPane");fo(PM,"MAP_PANE","mapPane");fo(PM,"MARKER_LAYER","markerLayer");fo(PM,"OVERLAY_LAYER","overlayLayer");fo(PM,"OVERLAY_MOUSE_TARGET","overlayMouseTarget");fo(PM,"contextType",Sa);function Imo(){}function EMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function FMe(t){for(var e=1;enew google.maps.GroundOverlay(e,a,o),[]);return m.useEffect(()=>{l!==null&&l.setMap(i)},[i]),m.useEffect(()=>{typeof e<"u"&&l!==null&&(l.set("url",e),l.setMap(i))},[l,e]),m.useEffect(()=>{typeof r<"u"&&l!==null&&l.setOpacity(r?1:0)},[l,r]),m.useEffect(()=>{var s=new google.maps.LatLngBounds(new google.maps.LatLng(n.south,n.west),new google.maps.LatLng(n.north,n.east));typeof n<"u"&&l!==null&&(l.set("bounds",s),l.setMap(i))},[l,n]),null}m.memo(zmo);class Krt extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{groundOverlay:null}),fo(this,"setGroundOverlayCallback",()=>{this.state.groundOverlay!==null&&this.props.onLoad&&this.props.onLoad(this.state.groundOverlay)})}componentDidMount(){Gu(!!this.props.url||!!this.props.bounds,"For GroundOverlay, url and bounds are passed in to constructor and are immutable after instantiated. This is the behavior of Google Maps JavaScript API v3 ( See https://developers.google.com/maps/documentation/javascript/reference#GroundOverlay) Hence, use the corresponding two props provided by `react-google-maps-api`, url and bounds. In some cases, you'll need the GroundOverlay component to reflect the changes of url and bounds. You can leverage the React's key property to remount the component. Typically, just `key={url}` would serve your need. See https://github.com/tomchentw/react-google-maps/issues/655");var e=new google.maps.GroundOverlay(this.props.url,this.props.bounds,FMe(FMe({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:LMe,eventMap:kMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{groundOverlay:e}},this.setGroundOverlayCallback)}componentDidUpdate(e){this.state.groundOverlay!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:LMe,eventMap:kMe,prevProps:e,nextProps:this.props,instance:this.state.groundOverlay}))}componentWillUnmount(){this.state.groundOverlay&&(this.props.onUnmount&&this.props.onUnmount(this.state.groundOverlay),this.state.groundOverlay.setMap(null))}render(){return null}}fo(Krt,"defaultProps",{onLoad:Imo});fo(Krt,"contextType",Sa);function WMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function pJ(t){for(var e=1;e{google.maps.visualization||Gu(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} in useJsApiScript? %s',google.maps.visualization)},[]),m.useEffect(()=>{Gu(!!e,"data property is required in HeatmapLayer %s",e)},[e]),m.useEffect(()=>{a!==null&&a.setMap(i)},[i]),m.useEffect(()=>{r&&a!==null&&a.setOptions(r)},[a,r]),m.useEffect(()=>{var s=new google.maps.visualization.HeatmapLayer(pJ(pJ({},r),{},{data:e,map:i}));return l(s),n&&n(s),()=>{a!==null&&(o&&o(a),a.setMap(null))}},[]),null}m.memo(Dmo);class Emo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{heatmapLayer:null}),fo(this,"setHeatmapLayerCallback",()=>{this.state.heatmapLayer!==null&&this.props.onLoad&&this.props.onLoad(this.state.heatmapLayer)})}componentDidMount(){Gu(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} to ? %s',google.maps.visualization),Gu(!!this.props.data,"data property is required in HeatmapLayer %s",this.props.data);var e=new google.maps.visualization.HeatmapLayer(pJ(pJ({},this.props.options),{},{data:this.props.data,map:this.context}));this.registeredEvents=Ba({updaterMap:UMe,eventMap:NMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{heatmapLayer:e}},this.setHeatmapLayerCallback)}componentDidUpdate(e){Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:UMe,eventMap:NMe,prevProps:e,nextProps:this.props,instance:this.state.heatmapLayer})}componentWillUnmount(){this.state.heatmapLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),Ja(this.registeredEvents),this.state.heatmapLayer.setMap(null))}render(){return null}}fo(Emo,"contextType",Sa);var jMe={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},BMe={register(t,e,n){t.registerPanoProvider(e,n)},links(t,e){t.setLinks(e)},motionTracking(t,e){t.setMotionTracking(e)},options(t,e){t.setOptions(e)},pano(t,e){t.setPano(e)},position(t,e){t.setPosition(e)},pov(t,e){t.setPov(e)},visible(t,e){t.setVisible(e)},zoom(t,e){t.setZoom(e)}};class Fmo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{streetViewPanorama:null}),fo(this,"setStreetViewPanoramaCallback",()=>{this.state.streetViewPanorama!==null&&this.props.onLoad&&this.props.onLoad(this.state.streetViewPanorama)})}componentDidMount(){var e,n,o=(e=(n=this.context)===null||n===void 0?void 0:n.getStreetView())!==null&&e!==void 0?e:null;this.registeredEvents=Ba({updaterMap:BMe,eventMap:jMe,prevProps:{},nextProps:this.props,instance:o}),this.setState(()=>({streetViewPanorama:o}),this.setStreetViewPanoramaCallback)}componentDidUpdate(e){this.state.streetViewPanorama!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:BMe,eventMap:jMe,prevProps:e,nextProps:this.props,instance:this.state.streetViewPanorama}))}componentWillUnmount(){this.state.streetViewPanorama!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),Ja(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))}render(){return null}}fo(Fmo,"contextType",Sa);class kmo extends m.PureComponent{constructor(){super(...arguments),fo(this,"state",{streetViewService:null}),fo(this,"setStreetViewServiceCallback",()=>{this.state.streetViewService!==null&&this.props.onLoad&&this.props.onLoad(this.state.streetViewService)})}componentDidMount(){var e=new google.maps.StreetViewService;this.setState(function(){return{streetViewService:e}},this.setStreetViewServiceCallback)}componentWillUnmount(){this.state.streetViewService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)}render(){return null}}fo(kmo,"contextType",Sa);var YMe={onDirectionsChanged:"directions_changed"},OMe={directions(t,e){t.setDirections(e)},map(t,e){t.setMap(e)},options(t,e){t.setOptions(e)},panel(t,e){t.setPanel(e)},routeIndex(t,e){t.setRouteIndex(e)}};class Lmo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{directionsRenderer:null}),fo(this,"setDirectionsRendererCallback",()=>{this.state.directionsRenderer!==null&&(this.state.directionsRenderer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.directionsRenderer))})}componentDidMount(){var e=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=Ba({updaterMap:OMe,eventMap:YMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{directionsRenderer:e}},this.setDirectionsRendererCallback)}componentDidUpdate(e){this.state.directionsRenderer!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:OMe,eventMap:YMe,prevProps:e,nextProps:this.props,instance:this.state.directionsRenderer}))}componentWillUnmount(){this.state.directionsRenderer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),Ja(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))}render(){return null}}fo(Lmo,"contextType",Sa);var _Me={onPlacesChanged:"places_changed"},VMe={bounds(t,e){t.setBounds(e)}};class k9e extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"containerElement",m.createRef()),fo(this,"state",{searchBox:null}),fo(this,"setSearchBoxCallback",()=>{this.state.searchBox!==null&&this.props.onLoad&&this.props.onLoad(this.state.searchBox)})}componentDidMount(){if(Gu(!!google.maps.places,'You need to provide libraries={["places"]} prop to component %s',google.maps.places),this.containerElement!==null&&this.containerElement.current!==null){var e=this.containerElement.current.querySelector("input");if(e!==null){var n=new google.maps.places.SearchBox(e,this.props.options);this.registeredEvents=Ba({updaterMap:VMe,eventMap:_Me,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{searchBox:n}},this.setSearchBoxCallback)}}}componentDidUpdate(e){this.state.searchBox!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:VMe,eventMap:_Me,prevProps:e,nextProps:this.props,instance:this.state.searchBox}))}componentWillUnmount(){this.state.searchBox!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),Ja(this.registeredEvents))}render(){return h.jsx("div",{ref:this.containerElement,children:m.Children.only(this.props.children)})}}fo(k9e,"contextType",Sa);var GMe={onPlaceChanged:"place_changed"},XMe={bounds(t,e){t.setBounds(e)},restrictions(t,e){t.setComponentRestrictions(e)},fields(t,e){t.setFields(e)},options(t,e){t.setOptions(e)},types(t,e){t.setTypes(e)}};class qrt extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"containerElement",m.createRef()),fo(this,"state",{autocomplete:null}),fo(this,"setAutocompleteCallback",()=>{this.state.autocomplete!==null&&this.props.onLoad&&this.props.onLoad(this.state.autocomplete)})}componentDidMount(){var e;Gu(!!google.maps.places,'You need to provide libraries={["places"]} prop to component %s',google.maps.places);var n=(e=this.containerElement.current)===null||e===void 0?void 0:e.querySelector("input");if(n){var o=new google.maps.places.Autocomplete(n,this.props.options);this.registeredEvents=Ba({updaterMap:XMe,eventMap:GMe,prevProps:{},nextProps:this.props,instance:o}),this.setState(()=>({autocomplete:o}),this.setAutocompleteCallback)}}componentDidUpdate(e){Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:XMe,eventMap:GMe,prevProps:e,nextProps:this.props,instance:this.state.autocomplete})}componentWillUnmount(){this.state.autocomplete!==null&&Ja(this.registeredEvents)}render(){return h.jsx("div",{ref:this.containerElement,className:this.props.className,children:m.Children.only(this.props.children)})}}fo(qrt,"defaultProps",{className:""});fo(qrt,"contextType",Sa);const JMe="/aladdin/assets/empty_heart-B57-2tMp.png",Wmo="/aladdin/assets/red_heart-BaAtCixH.png",Nmo="/aladdin/assets/open_file-B6scZwPU.png",Umo="/aladdin/assets/export_link-Dxa4UObV.png",jmo="/aladdin/assets/click_count-BZx6BgQJ.png";function YO(t){const e=new Date(t);if(!Number.isNaN(e.valueOf()))return e;const n=String(t).match(/\d+/g);if(n==null||n.length<=2)return e;{const[o,r,...i]=n.map(s=>parseInt(s)),a=[o,r-1,...i];return new Date(Date.UTC(...a))}}function KMe(t,e,n){const o=t!==1?e+"s":e;return t+" "+o+" "+n}function vfe(){return vfe=Object.assign?Object.assign.bind():function(t){for(var e=1;eDate.now();function Ymo({date:t,formatter:e=KMe,component:n="time",live:o=!0,minPeriod:r=0,maxPeriod:i=OO,title:a,now:l=Bmo,...s}){const[c,u]=m.useState(l());m.useEffect(()=>{if(!o)return;const T=(()=>{const A=YO(t).valueOf();if(!A)return console.warn("[react-timeago] Invalid Date provided"),0;const x=Math.round(Math.abs(c-A)/1e3),S=x{u(l())},R):0})();return()=>{T&&clearTimeout(T)}},[t,o,i,r,l,c]);const d=n,f=YO(t).valueOf();if(!f)return null;const p=Math.round(Math.abs(c-f)/1e3),g=f"u"?typeof t=="string"?t:YO(t).toISOString().substr(0,16).replace("T"," "):a,C=d==="time"?{...s,dateTime:YO(t).toISOString()}:s,P=KMe.bind(null,y,w,g);return m.createElement(d,vfe({},C,{title:b}),e(y,w,g,f,P,l))}function gJ(){return gJ=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[r]=t[r]);return n}var _mo=["cdnSuffix","cdnUrl","countryCode","style","svg"],Vmo="https://cdn.jsdelivr.net/gh/lipis/flag-icons/flags/4x3/",Gmo="svg",Xmo=127397,$rt=function(e){var n=e.cdnSuffix,o=n===void 0?Gmo:n,r=e.cdnUrl,i=r===void 0?Vmo:r,a=e.countryCode,l=e.style,s=e.svg,c=s===void 0?!1:s,u=Omo(e,_mo);if(typeof a!="string")return null;if(c){var d=""+i+a.toLowerCase()+"."+o;return m.createElement("img",Object.assign({},u,{src:d,style:gJ({display:"inline-block",width:"1em",height:"1em",verticalAlign:"middle"},l)}))}var f=a.toUpperCase().replace(/./g,function(p){return String.fromCodePoint(p.charCodeAt(0)+Xmo)});return m.createElement("span",Object.assign({role:"img"},u,{style:gJ({display:"inline-block",fontSize:"1em",lineHeight:"1em",verticalAlign:"middle"},l)}),f)};const Qrt=t=>{switch(t.type){case ha.PHOTOVOLTAIC:return WQe;case ha.PARABOLIC_DISH:return NQe;case ha.PARABOLIC_TROUGH:return UQe;case ha.FRESNEL_REFLECTOR:return jQe;case ha.SOLAR_POWER_TOWER:return BQe;case ha.WIND_TURBINE:return _Qe;case ha.COLOCATION_PROJECTS:return VQe;case ha.RESIDENTIAL_BUILDING:return EQe;case ha.COMMERCIAL_BUILDING:return FQe;case ha.SCHOOL_BUILDING:return kQe;case ha.TOURIST_ATTRACTION:return LQe;case ha.UNDER_CONSTRUCTION:return YQe}return OQe},{Panel:Jmo}=iye,Kmo=be.memo(({latRef:t,lngRef:e,selectAuthor:n,closeMap:o,openModel:r,deleteModel:i,likeModel:a,pinModel:l})=>{var ge;const s=H.getState().user,c=H(fn),u=H(En),d=H(ewt)??eje,f=H(twt)??0,p=H(Mge)??"roadmap",g=H(jge),y=ht(VBe),w=H(XBe),[b,C]=m.useState(null),[P,v]=m.useState(null),[T,A]=m.useState(null),[x,S]=m.useState(!0),[R,M]=m.useState(!1),D=m.useRef(null),E=m.useRef([]),W=m.useRef(-1),j=m.useRef([]),L=Jt(),k=14,N=(ge=s.email)==null?void 0:ge.endsWith("@intofuture.org"),F=()=>{j.current.length=0;for(const de in g)if(Object.hasOwn(g,de)){const Z=g[de],he=new google.maps.LatLng(Z.latitude,Z.longitude);j.current.push(he)}},U=m.useCallback(de=>{C(de),F(),de.setMapTypeId(p)},[p]),O=m.useCallback(function(){C(null)},[]),B=()=>{if(b){const de=b.getCenter();if(de){const Z=de.lat(),he=de.lng();if(Z!==t.current||he!==e.current){const xe={name:"Set Model Map Location",timestamp:Date.now(),oldLatitude:t.current,newLatitude:Z,oldLongitude:e.current,newLongitude:he,undo:()=>{t.current=xe.oldLatitude,e.current=xe.oldLongitude},redo:()=>{t.current=xe.newLatitude,e.current=xe.newLongitude}};u(xe),t.current=Z,e.current=he}}}},_=()=>{if(b){const de=b.getZoom();if(de!==void 0&&de!==d){const Z={name:"Zoom Model Map",timestamp:Date.now(),oldValue:d,newValue:de,undo:()=>{c(he=>{he.modelsMapZoom=Z.oldValue})},redo:()=>{c(he=>{he.modelsMapZoom=Z.newValue})}};u(Z),c(he=>{he.modelsMapZoom=de})}}},X=()=>{if(b){const de=b.getTilt();if(de!==void 0&&de!==f){const Z={name:"Tilt Model Map",timestamp:Date.now(),oldValue:f,newValue:de,undo:()=>{c(he=>{he.modelsMapTilt=Z.oldValue})},redo:()=>{c(he=>{he.modelsMapTilt=Z.newValue})}};u(Z),c(he=>{he.modelsMapTilt=de})}}},$=()=>{if(b){const de=b.getMapTypeId();if(de!==void 0&&de!==p){const Z={name:"Change Model Map Type",timestamp:Date.now(),oldValue:p,newValue:de,undo:()=>{c(he=>{he.modelsMapType=Z.oldValue})},redo:()=>{c(he=>{he.modelsMapType=Z.newValue})}};u(Z),c(he=>{he.modelsMapType=de})}}},Q={styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"labels",stylers:[{visibility:"off"}]}]},le=de=>{de.userid&&de.title?(r(de),o()):po(Y.t("message.ModelNotFound",L))},q=de=>{if(de.userid&&de.title){const Z=t1+"?client=web&userid="+de.userid+"&title="+encodeURIComponent(de.title);navigator.clipboard.writeText(Z).then(()=>S2(Y.t("cloudFilePanel.LinkGeneratedInClipBoard",L)+"."))}else po(Y.t("message.ModelNotFound",L))},te=de=>{Oi.confirm({title:Y.t("message.DoYouWantToDeleteModelFromMap",L),icon:h.jsx(ny,{}),onOk:()=>{i(de,()=>{c(Z=>{var he,xe;if(Z.modelSites){const He=Z.modelSites.get(me.getLatLngKey(de.latitude,de.longitude));if(He){let Se;for(const[ze,Ie]of He)if(Ie.userid===de.userid&&Ie.title===de.title){Se=ze;break}Se&&(He.delete(Se),He.size===0&&((xe=(he=E.current[W.current])==null?void 0:he.marker)==null||xe.setMap(null)))}}}),v(null),A(null)})},onCancel:()=>{},okText:Y.t("word.Yes",L),cancelText:Y.t("word.No",L)})},re=de=>{var Z;if(de.userid&&de.title){const he=me.getModelKey(de),xe=!!((Z=s.likes)!=null&&Z.includes(he));a(de,!xe,()=>{c(He=>{if(He.user)if(He.user.likes||(He.user.likes=[]),He.user.likes.includes(he)){const Se=He.user.likes.indexOf(he);Se>=0&&He.user.likes.splice(Se,1)}else He.user.likes.push(he);if(He.modelSites){const Se=He.modelSites.get(me.getLatLngKey(de.latitude,de.longitude));if(Se){for(const ze of Se.values())if(ze.userid===de.userid&&ze.title===de.title){ze.likeCount===void 0&&(ze.likeCount=0),ze.likeCount+=xe?-1:1;break}}}}),M(!R)})}},ae=de=>{const Z=H.getState().modelSites.get(me.getLatLngKey(de.latitude,de.longitude));if(Z){for(const he of Z.values())if(he.userid===de.userid&&he.title===de.title)return he.likeCount??0}return 0},se=de=>{const Z=H.getState().modelSites.get(me.getLatLngKey(de.latitude,de.longitude));if(Z){for(const he of Z.values())if(he.userid===de.userid&&he.title===de.title)return he.clickCount??0}return 0},ne=de=>{const Z=H.getState().modelSites.get(me.getLatLngKey(de.latitude,de.longitude));if(Z){for(const he of Z.values())if(he.userid===de.userid&&he.title===de.title)return he.pinned}return!1},fe=(de,Z)=>{de.userid&&de.title&&l(de,Z,()=>{c(he=>{if(he.modelSites){const xe=he.modelSites.get(me.getLatLngKey(de.latitude,de.longitude));if(xe){for(const He of xe.values())if(He.userid===de.userid&&He.title===de.title){He.pinned=Z,M(!R);break}}}})})};return h.jsx(Frt,{mapContainerStyle:{border:"1px solid",width:"100%",height:"100%"},mapTypeId:p,options:Q,center:{lat:t.current,lng:e.current},zoom:d,tilt:f,onLoad:U,onUnmount:O,onCenterChanged:B,onZoomChanged:_,onTiltChanged:X,onMapTypeIdChanged:$,children:h.jsxs(h.Fragment,{children:[y&&j.current.map((de,Z)=>{const he=.2*d;return h.jsx(yfe,{icon:{path:google.maps.SymbolPath.CIRCLE,strokeColor:"red",strokeWeight:he+2,scale:he},position:de},Z)}),P&&P.size&&T&&h.jsx(Grt,{position:{lat:T.lat(),lng:T.lng()},children:h.jsxs("div",{style:{border:"2px solid gainsboro",maxHeight:"400px",overflowY:"auto"},onMouseLeave:()=>{v(null),A(null)},children:[P.size>1?h.jsxs("div",{style:{background:"#dddddd",textAlign:"left",borderBottom:"1px solid gainsboro",paddingBottom:"4px",marginBottom:"4px"},children:[x?h.jsx(Vnn,{title:Y.t("modelsMap.SortFromNewestToOldest",L),style:{cursor:"pointer",marginLeft:"2px",marginRight:"6px"},onClick:()=>{S(!1)}}):h.jsx(zon,{title:Y.t("modelsMap.SortFromOldestToNewest",L),style:{cursor:"pointer",marginLeft:"2px",marginRight:"6px"},onClick:()=>{S(!0)}}),h.jsxs("span",{style:{fontSize:"10px"},children:[P.size," ",Y.t("modelsMap.ModelsFoundOnThisSite",L)]}),T&&h.jsxs("span",{style:{fontSize:"10px"},children:[" —"," ",Y.t("word.Coordinates",L)+": ("+T.lat().toFixed(h8)+"°, "+T.lng().toFixed(h8)+"°)"]})]}):"",[...P.keys()].sort((de,Z)=>{const he=P.get(de),xe=P.get(Z);return he!=null&&he.pinned&&!(xe!=null&&xe.pinned)?-1:xe!=null&&xe.pinned&&!(he!=null&&he.pinned)?1:(x?1:-1)*(((he==null?void 0:he.timeCreated)??0)-((xe==null?void 0:xe.timeCreated)??0))}).map((de,Z)=>{const he=P.get(de);return he?h.jsxs("div",{style:{padding:(P==null?void 0:P.size)>1?"5px 5px 20px 5px":"5px",background:Z%2===0?"white":"#eeeeee"},children:[Z===0&&h.jsxs("div",{style:{fontSize:"12px",display:"block",paddingBottom:"6px"},children:[he.countryCode&&h.jsx($rt,{countryCode:he.countryCode,style:{marginRight:"6px",width:"20px"},svg:!0}),he.address??"Unknown",P.size===1&&h.jsx("span",{style:{fontSize:"10px",display:"block",paddingTop:"10px"},children:Y.t("word.Coordinates",L)+": ("+T.lat().toFixed(h8)+"°, "+T.lng().toFixed(h8)+"°)"})]}),h.jsx(iye,{style:{background:ne(he)?"#FEF9EC":Z%2===0?"white":"#eeeeee",width:"400px"},bordered:!1,ghost:!0,defaultActiveKey:["0"],children:h.jsx(Jmo,{header:h.jsxs(h.Fragment,{children:[he.label,ne(he)&&h.jsx(qTe,{style:{marginLeft:"8px"}})]}),style:{fontSize:"12px"},children:h.jsx("div",{style:{fontSize:"10px",display:"block",textAlign:"left"},children:h.jsxs(en,{align:"start",children:[he.thumbnailUrl&&h.jsx("img",{alt:he.label,title:Y.t("word.Open",L),src:he.thumbnailUrl,style:{border:"1px solid #222",cursor:"pointer"},onClick:()=>le(he)}),h.jsxs("div",{children:[he.description&&he.description.trim()!==""?he.description:""," —  By"," ",h.jsx("span",{style:{cursor:"pointer"},title:Y.t("modelsMap.ShowModelsPublishedByThisAuthor",L),onClick:()=>{n(he.author)},children:!he.author||he.author===""?Y.t("word.Anonymous",L):he.author}),", ",he.timeCreated&&h.jsx(Ymo,{date:new Date(he.timeCreated)})]})]})})},Z)}),h.jsxs("div",{style:{marginTop:"10px",fontSize:"11px"},children:[N&&h.jsx(h.Fragment,{children:ne(he)?h.jsx(don,{style:{cursor:"pointer"},title:Y.t("word.Unpin",L),onClick:()=>fe(he,!1)}):h.jsx(qTe,{style:{cursor:"pointer"},title:Y.t("word.Pin",L),onClick:()=>fe(he,!0)})}),h.jsx("img",{alt:"Open",onClick:()=>le(he),style:{marginLeft:"10px",cursor:"pointer"},title:Y.t("word.Open",L),src:Nmo,height:k,width:k}),h.jsx("img",{alt:"Export link",onClick:()=>q(he),style:{marginLeft:"5px",cursor:"pointer"},title:Y.t("word.Share",L),src:Umo,height:k,width:k}),he.userid===s.uid&&h.jsx("img",{alt:"Delete",onClick:()=>te(he),style:{marginLeft:"5px",cursor:"pointer"},title:Y.t("word.Delete",L),src:Drt,height:k,width:k}),s.uid?h.jsx(h.Fragment,{children:s.likes&&s.likes.includes(me.getModelKey(he))?h.jsx("img",{alt:"Like",onClick:()=>re(he),style:{marginLeft:"10px",cursor:"pointer"},title:Y.t("word.AlreadyLike",L),src:Wmo,height:k,width:k}):h.jsx("img",{alt:"Like",onClick:()=>re(he),style:{marginLeft:"10px",cursor:"pointer"},title:Y.t("word.Like",L),src:JMe,height:k,width:k})}):h.jsx(h.Fragment,{children:h.jsx("img",{alt:"Like",style:{marginLeft:"10px",opacity:.5},title:Y.t("word.MustLogInToLike",L),src:JMe,height:k,width:k})}),"   ",ae(he),h.jsx("img",{alt:"Click counter",style:{marginLeft:"10px"},title:Y.t("word.ClickCount",L),src:jmo,height:k,width:k}),"   ",se(he)]})]},Z):null})]})}),!!w&&!!w.size&&h.jsx(Brt,{children:de=>h.jsx("div",{children:[...w.keys()].map((Z,he)=>{const xe=w.get(Z);if(!xe||!xe.size)return null;const He=[...xe.keys()].sort((Ie,ye)=>{const ce=xe.get(Ie),pe=xe.get(ye);return ce!=null&&ce.pinned&&!(pe!=null&&pe.pinned)?-1:pe!=null&&pe.pinned&&!(ce!=null&&ce.pinned)?1:(x?1:-1)*(((ce==null?void 0:ce.timeCreated)??0)-((pe==null?void 0:pe.timeCreated)??0))}),Se=xe.get(He[0]);if(!Se)return null;const ze=Qrt(Se);return h.jsx(yfe,{ref:Ie=>E.current[he]=Ie,clusterer:de,icon:ze?{url:ze}:void 0,position:{lat:Se.latitude,lng:Se.longitude},onClick:()=>le(Se),onMouseOver:()=>{D.current=P,W.current=he,v(xe);const Ie=Z.split(", ");A(new google.maps.LatLng(Number.parseFloat(Ie[0]),Number.parseFloat(Ie[1])))},onMouseOut:()=>{P===D.current&&(v(null),A(null))}},he)})})})]})})}),qmo="/aladdin/assets/image_load_failure-HGDkwC0S.png",Zrt=be.memo(({latRef:t,lngRef:e,author:n,models:o,closeCallback:r,openCloudFile:i})=>{const a=H(mp),l=H(s0),s=H(fn),c=H(Mge),u=m.useRef(o?new Map(o):new Map),[d,f]=m.useState(!1),[p,g]=m.useState(),[y,w]=m.useState(!1),{Search:b}=as,C=m.useMemo(()=>({lng:l}),[l]);m.useEffect(()=>{o&&(u.current=new Map(o),f(!d))},[o]);const P=m.useMemo(()=>{let T=0;for(const A of u.current.values())(n||A.userid===a.uid)&&T++;return T},[u.current,n,a.uid,d]),v=n&&c!=="roadmap";return u.current.size===0?h.jsx(gue,{mask:!1,styles:{header:{height:"40px",paddingLeft:"1px",paddingRight:"1px",paddingTop:"16px",paddingBottom:"12px",background:v?"#6A6B6E":"whitesmoke"},body:{padding:"0px 4px 0px 4px",overflowY:"hidden",background:v?"#2A2B2E":"white"}},style:{scrollbarColor:v?"#6A6B6E":"whitesmoke"},title:(n??Y.t("modelsMap.MyPublishedModels",C))+" (0)",placement:"bottom",open:!0,height:"150px",onClose:()=>{r()},children:h.jsx(fg,{image:fg.PRESENTED_IMAGE_SIMPLE,style:{color:v?"lightgray":"dimgray"}})}):h.jsx(gue,{extra:h.jsxs(en,{children:[y?h.jsx(non,{title:Y.t("modelsMap.SortFromNewestToOldest",C),style:{cursor:"pointer",marginLeft:"2px",marginRight:"6px"},onClick:()=>{w(!1)}}):h.jsx(zQe,{title:Y.t("modelsMap.SortFromOldestToNewest",C),style:{cursor:"pointer",marginLeft:"2px",marginRight:"6px"},onClick:()=>{w(!0)}}),h.jsx(b,{title:Y.t("modelsMap.SearchByLabel",C),allowClear:!0,size:"small",enterButton:!0,onSearch:T=>{var A;if(o){u.current.clear();for(const[x,S]of o)(A=S.label)!=null&&A.toLowerCase().includes(T.toLowerCase())&&u.current.set(x,S);f(!d)}}})]}),mask:!1,styles:{header:{height:"40px",color:v?"white":"black",background:v?"#6A6B6E":"whitesmoke",paddingLeft:"1px",paddingRight:"1px",paddingTop:"16px",paddingBottom:"12px",border:"none"},body:{padding:"0px 4px 0px 4px",overflowY:"hidden",background:v?"#2A2B2E":"white"}},title:(n??Y.t("modelsMap.MyPublishedModels",C))+" ("+P+")",placement:"bottom",open:!0,height:"164px",onClose:()=>{g(void 0),r()},children:h.jsx("table",{children:h.jsx("tbody",{children:h.jsx("tr",{children:[...u.current.keys()].sort((T,A)=>{const x=u.current.get(T),S=u.current.get(A);return!x||!S?0:(y?-1:1)*((S.timeCreated??0)-(x.timeCreated??0))}).map((T,A)=>{const x=u.current.get(T);return!x||!n&&x.userid!==a.uid?null:h.jsx("td",{children:h.jsxs("div",{style:{display:"block",marginTop:"4px"},children:[h.jsx("img",{loading:"lazy",height:"100px",width:"auto",onError:S=>{S.target.src=qmo},alt:x.label,title:x.label,src:x.thumbnailUrl,style:{cursor:"pointer",borderRadius:p===x?"0":"10px",border:p===x?"2px solid "+(v?"goldenrod":"red"):"none",marginRight:"4px"},onClick:()=>{g(x),i?i(x.userid,x.title):s(S=>{x&&(S.modelsMapLatitude=x.latitude,S.modelsMapLongitude=x.longitude,S.modelsMapZoom=17,t&&(t.current=x.latitude),e&&(e.current=x.longitude))})}}),h.jsxs("div",{children:[h.jsx("img",{alt:x.type,src:Qrt(x),style:{position:"relative",left:"8px",bottom:"28px",width:"16px",height:"16px"}}),h.jsx("span",{style:{position:"relative",left:"16px",bottom:"24px",color:"white",fontSize:"8px",fontWeight:"bold"},children:x.label?x.label.length>30?x.label.substring(0,30)+"...":x.label:"Unknown"})]})]})},A)})})})})})}),$mo=["places"],Qmo=Ro.div` +`),s="Cluster of ".concat(r," markers"),c=Number(google.maps.Marker.MAX_ZINDEX)+r;if(sg.isAdvancedMarkerAvailable(o)){var u=new DOMParser,d=u.parseFromString(l,"image/svg+xml").documentElement;d.setAttribute("transform","translate(0 25)");var f={map:o,position:i,zIndex:c,title:s,content:d};return new google.maps.marker.AdvancedMarkerElement(f)}var p={position:i,zIndex:c,title:s,icon:{url:"data:image/svg+xml;base64,".concat(btoa(l)),anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(p)}}function emo(t,e){for(var n in e.prototype)t.prototype[n]=e.prototype[n]}class k9e{constructor(){emo(k9e,google.maps.OverlayView)}}var UE;(function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click"})(UE||(UE={}));var tmo=(t,e,n)=>{n.fitBounds(e.bounds)};class nmo extends k9e{constructor(e){var{map:n,markers:o=[],algorithmOptions:r={},algorithm:i=new $go(r),renderer:a=new Zgo,onClusterClick:l=tmo}=e;super(),this.markers=[...o],this.clusters=[],this.algorithm=i,this.renderer=a,this.onClusterClick=l,n&&this.setMap(n)}addMarker(e,n){this.markers.includes(e)||(this.markers.push(e),n||this.render())}addMarkers(e,n){e.forEach(o=>{this.addMarker(o,!0)}),n||this.render()}removeMarker(e,n){var o=this.markers.indexOf(e);return o===-1?!1:(sg.setMap(e,null),this.markers.splice(o,1),n||this.render(),!0)}removeMarkers(e,n){var o=!1;return e.forEach(r=>{o=this.removeMarker(r,!0)||o}),o&&!n&&this.render(),o}clearMarkers(e){this.markers.length=0,e||this.render()}render(){var e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,UE.CLUSTERING_BEGIN,this);var{clusters:n,changed:o}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(o||o==null){var r=new Set;for(var i of n)i.markers.length==1&&r.add(i.markers[0]);var a=[];for(var l of this.clusters)l.marker!=null&&(l.markers.length==1?r.has(l.marker)||sg.setMap(l.marker,null):a.push(l.marker));this.clusters=n,this.renderClusters(),requestAnimationFrame(()=>a.forEach(s=>sg.setMap(s,null)))}google.maps.event.trigger(this,UE.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>sg.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){var e=new Qgo(this.markers,this.clusters),n=this.getMap();this.clusters.forEach(o=>{o.markers.length===1?o.marker=o.markers[0]:(o.marker=this.renderer.render(o,e,n),o.markers.forEach(r=>sg.setMap(r,null)),this.onClusterClick&&o.marker.addListener("click",r=>{google.maps.event.trigger(this,UE.CLUSTER_CLICK,o),this.onClusterClick(r,o,n)})),sg.setMap(o.marker,n)})}}function aMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function lMe(t){for(var e=1;e{if(e&&n===null){var r=new nmo(lMe(lMe({},t),{},{map:e}));o(r)}},[e]),n}function rmo(t){var{children:e,options:n}=t,o=omo(n);return o!==null?e(o):null}m.memo(rmo);var sMe={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},cMe={options(t,e){t.setOptions(e)},position(t,e){t.setPosition(e)},zIndex(t,e){t.setZIndex(e)}};function imo(t){var{children:e,anchor:n,options:o,position:r,zIndex:i,onCloseClick:a,onDomReady:l,onContentChanged:s,onPositionChanged:c,onZindexChanged:u,onLoad:d,onUnmount:f}=t,p=m.useContext(Sa),[g,y]=m.useState(null),[w,b]=m.useState(null),[C,P]=m.useState(null),[v,T]=m.useState(null),[A,x]=m.useState(null),[S,R]=m.useState(null),M=m.useRef(null);return m.useEffect(()=>{g!==null&&(g.close(),n?g.open(p,n):g.getPosition()&&g.open(p))},[p,g,n]),m.useEffect(()=>{o&&g!==null&&g.setOptions(o)},[g,o]),m.useEffect(()=>{r&&g!==null&&g.setPosition(r)},[r]),m.useEffect(()=>{typeof i=="number"&&g!==null&&g.setZIndex(i)},[i]),m.useEffect(()=>{g&&a&&(w!==null&&google.maps.event.removeListener(w),b(google.maps.event.addListener(g,"closeclick",a)))},[a]),m.useEffect(()=>{g&&l&&(C!==null&&google.maps.event.removeListener(C),P(google.maps.event.addListener(g,"domready",l)))},[l]),m.useEffect(()=>{g&&s&&(v!==null&&google.maps.event.removeListener(v),T(google.maps.event.addListener(g,"content_changed",s)))},[s]),m.useEffect(()=>{g&&c&&(A!==null&&google.maps.event.removeListener(A),x(google.maps.event.addListener(g,"position_changed",c)))},[c]),m.useEffect(()=>{g&&u&&(S!==null&&google.maps.event.removeListener(S),R(google.maps.event.addListener(g,"zindex_changed",u)))},[u]),m.useEffect(()=>{var D=new google.maps.InfoWindow(o);return y(D),M.current=document.createElement("div"),a&&b(google.maps.event.addListener(D,"closeclick",a)),l&&P(google.maps.event.addListener(D,"domready",l)),s&&T(google.maps.event.addListener(D,"content_changed",s)),c&&x(google.maps.event.addListener(D,"position_changed",c)),u&&R(google.maps.event.addListener(D,"zindex_changed",u)),D.setContent(M.current),r&&D.setPosition(r),i&&D.setZIndex(i),n?D.open(p,n):D.getPosition()?D.open(p):Gu(!1,"You must provide either an anchor (typically render it inside a ) or a position props for ."),d&&d(D),()=>{w&&google.maps.event.removeListener(w),v&&google.maps.event.removeListener(v),C&&google.maps.event.removeListener(C),A&&google.maps.event.removeListener(A),S&&google.maps.event.removeListener(S),f&&f(D),D.close()}},[]),M.current?Cd.createPortal(m.Children.only(e),M.current):null}m.memo(imo);class Grt extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"containerElement",null),fo(this,"state",{infoWindow:null}),fo(this,"open",(e,n)=>{n?e.open(this.context,n):e.getPosition()?e.open(this.context):Gu(!1,"You must provide either an anchor (typically render it inside a ) or a position props for .")}),fo(this,"setInfoWindowCallback",()=>{this.state.infoWindow!==null&&this.containerElement!==null&&(this.state.infoWindow.setContent(this.containerElement),this.open(this.state.infoWindow,this.props.anchor),this.props.onLoad&&this.props.onLoad(this.state.infoWindow))})}componentDidMount(){var e=new google.maps.InfoWindow(this.props.options);this.containerElement=document.createElement("div"),this.registeredEvents=Ba({updaterMap:cMe,eventMap:sMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({infoWindow:e}),this.setInfoWindowCallback)}componentDidUpdate(e){this.state.infoWindow!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:cMe,eventMap:sMe,prevProps:e,nextProps:this.props,instance:this.state.infoWindow}))}componentWillUnmount(){this.state.infoWindow!==null&&(Ja(this.registeredEvents),this.props.onUnmount&&this.props.onUnmount(this.state.infoWindow),this.state.infoWindow.close())}render(){return this.containerElement?Cd.createPortal(m.Children.only(this.props.children),this.containerElement):null}}fo(Grt,"contextType",Sa);function uMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function dJ(t){for(var e=1;e{v!==null&&v.setMap(P)},[P]),m.useEffect(()=>{typeof e<"u"&&v!==null&&v.setOptions(e)},[v,e]),m.useEffect(()=>{typeof n<"u"&&v!==null&&v.setDraggable(n)},[v,n]),m.useEffect(()=>{typeof o<"u"&&v!==null&&v.setEditable(o)},[v,o]),m.useEffect(()=>{typeof r<"u"&&v!==null&&v.setVisible(r)},[v,r]),m.useEffect(()=>{typeof i<"u"&&v!==null&&v.setPath(i)},[v,i]),m.useEffect(()=>{v&&a&&(A!==null&&google.maps.event.removeListener(A),x(google.maps.event.addListener(v,"dblclick",a)))},[a]),m.useEffect(()=>{v&&l&&(S!==null&&google.maps.event.removeListener(S),R(google.maps.event.addListener(v,"dragend",l)))},[l]),m.useEffect(()=>{v&&s&&(M!==null&&google.maps.event.removeListener(M),D(google.maps.event.addListener(v,"dragstart",s)))},[s]),m.useEffect(()=>{v&&c&&(E!==null&&google.maps.event.removeListener(E),W(google.maps.event.addListener(v,"mousedown",c)))},[c]),m.useEffect(()=>{v&&u&&(j!==null&&google.maps.event.removeListener(j),L(google.maps.event.addListener(v,"mousemove",u)))},[u]),m.useEffect(()=>{v&&d&&(k!==null&&google.maps.event.removeListener(k),N(google.maps.event.addListener(v,"mouseout",d)))},[d]),m.useEffect(()=>{v&&f&&(F!==null&&google.maps.event.removeListener(F),U(google.maps.event.addListener(v,"mouseover",f)))},[f]),m.useEffect(()=>{v&&p&&(O!==null&&google.maps.event.removeListener(O),B(google.maps.event.addListener(v,"mouseup",p)))},[p]),m.useEffect(()=>{v&&g&&(_!==null&&google.maps.event.removeListener(_),X(google.maps.event.addListener(v,"rightclick",g)))},[g]),m.useEffect(()=>{v&&y&&($!==null&&google.maps.event.removeListener($),Q(google.maps.event.addListener(v,"click",y)))},[y]),m.useEffect(()=>{v&&w&&(le!==null&&google.maps.event.removeListener(le),q(google.maps.event.addListener(v,"drag",w)))},[w]),m.useEffect(()=>{var te=new google.maps.Polyline(dJ(dJ({},e||amo),{},{map:P}));return i&&te.setPath(i),typeof r<"u"&&te.setVisible(r),typeof o<"u"&&te.setEditable(o),typeof n<"u"&&te.setDraggable(n),a&&x(google.maps.event.addListener(te,"dblclick",a)),l&&R(google.maps.event.addListener(te,"dragend",l)),s&&D(google.maps.event.addListener(te,"dragstart",s)),c&&W(google.maps.event.addListener(te,"mousedown",c)),u&&L(google.maps.event.addListener(te,"mousemove",u)),d&&N(google.maps.event.addListener(te,"mouseout",d)),f&&U(google.maps.event.addListener(te,"mouseover",f)),p&&B(google.maps.event.addListener(te,"mouseup",p)),g&&X(google.maps.event.addListener(te,"rightclick",g)),y&&Q(google.maps.event.addListener(te,"click",y)),w&&q(google.maps.event.addListener(te,"drag",w)),T(te),b&&b(te),()=>{A!==null&&google.maps.event.removeListener(A),S!==null&&google.maps.event.removeListener(S),M!==null&&google.maps.event.removeListener(M),E!==null&&google.maps.event.removeListener(E),j!==null&&google.maps.event.removeListener(j),k!==null&&google.maps.event.removeListener(k),F!==null&&google.maps.event.removeListener(F),O!==null&&google.maps.event.removeListener(O),_!==null&&google.maps.event.removeListener(_),$!==null&&google.maps.event.removeListener($),C&&C(te),te.setMap(null)}},[]),null}m.memo(lmo);class smo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{polyline:null}),fo(this,"setPolylineCallback",()=>{this.state.polyline!==null&&this.props.onLoad&&this.props.onLoad(this.state.polyline)})}componentDidMount(){var e=new google.maps.Polyline(dJ(dJ({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:fMe,eventMap:dMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{polyline:e}},this.setPolylineCallback)}componentDidUpdate(e){this.state.polyline!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:fMe,eventMap:dMe,prevProps:e,nextProps:this.props,instance:this.state.polyline}))}componentWillUnmount(){this.state.polyline!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),Ja(this.registeredEvents),this.state.polyline.setMap(null))}render(){return null}}fo(smo,"contextType",Sa);function hMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function pMe(t){for(var e=1;e{A!==null&&A.setMap(T)},[T]),m.useEffect(()=>{typeof e<"u"&&A!==null&&A.setOptions(e)},[A,e]),m.useEffect(()=>{typeof n<"u"&&A!==null&&A.setDraggable(n)},[A,n]),m.useEffect(()=>{typeof o<"u"&&A!==null&&A.setEditable(o)},[A,o]),m.useEffect(()=>{typeof r<"u"&&A!==null&&A.setVisible(r)},[A,r]),m.useEffect(()=>{typeof i<"u"&&A!==null&&A.setPath(i)},[A,i]),m.useEffect(()=>{typeof a<"u"&&A!==null&&A.setPaths(a)},[A,a]),m.useEffect(()=>{A&&typeof l=="function"&&(S!==null&&google.maps.event.removeListener(S),R(google.maps.event.addListener(A,"dblclick",l)))},[l]),m.useEffect(()=>{A&&(google.maps.event.addListener(A.getPath(),"insert_at",()=>{v==null||v(A)}),google.maps.event.addListener(A.getPath(),"set_at",()=>{v==null||v(A)}),google.maps.event.addListener(A.getPath(),"remove_at",()=>{v==null||v(A)}))},[A,v]),m.useEffect(()=>{A&&typeof s=="function"&&(M!==null&&google.maps.event.removeListener(M),D(google.maps.event.addListener(A,"dragend",s)))},[s]),m.useEffect(()=>{A&&typeof c=="function"&&(E!==null&&google.maps.event.removeListener(E),W(google.maps.event.addListener(A,"dragstart",c)))},[c]),m.useEffect(()=>{A&&typeof u=="function"&&(j!==null&&google.maps.event.removeListener(j),L(google.maps.event.addListener(A,"mousedown",u)))},[u]),m.useEffect(()=>{A&&typeof d=="function"&&(k!==null&&google.maps.event.removeListener(k),N(google.maps.event.addListener(A,"mousemove",d)))},[d]),m.useEffect(()=>{A&&typeof f=="function"&&(F!==null&&google.maps.event.removeListener(F),U(google.maps.event.addListener(A,"mouseout",f)))},[f]),m.useEffect(()=>{A&&typeof p=="function"&&(O!==null&&google.maps.event.removeListener(O),B(google.maps.event.addListener(A,"mouseover",p)))},[p]),m.useEffect(()=>{A&&typeof g=="function"&&(_!==null&&google.maps.event.removeListener(_),X(google.maps.event.addListener(A,"mouseup",g)))},[g]),m.useEffect(()=>{A&&typeof y=="function"&&($!==null&&google.maps.event.removeListener($),Q(google.maps.event.addListener(A,"rightclick",y)))},[y]),m.useEffect(()=>{A&&typeof w=="function"&&(le!==null&&google.maps.event.removeListener(le),q(google.maps.event.addListener(A,"click",w)))},[w]),m.useEffect(()=>{A&&typeof b=="function"&&(te!==null&&google.maps.event.removeListener(te),re(google.maps.event.addListener(A,"drag",b)))},[b]),m.useEffect(()=>{var ae=new google.maps.Polygon(pMe(pMe({},e),{},{map:T}));return i&&ae.setPath(i),a&&ae.setPaths(a),typeof r<"u"&&ae.setVisible(r),typeof o<"u"&&ae.setEditable(o),typeof n<"u"&&ae.setDraggable(n),l&&R(google.maps.event.addListener(ae,"dblclick",l)),s&&D(google.maps.event.addListener(ae,"dragend",s)),c&&W(google.maps.event.addListener(ae,"dragstart",c)),u&&L(google.maps.event.addListener(ae,"mousedown",u)),d&&N(google.maps.event.addListener(ae,"mousemove",d)),f&&U(google.maps.event.addListener(ae,"mouseout",f)),p&&B(google.maps.event.addListener(ae,"mouseover",p)),g&&X(google.maps.event.addListener(ae,"mouseup",g)),y&&Q(google.maps.event.addListener(ae,"rightclick",y)),w&&q(google.maps.event.addListener(ae,"click",w)),b&&re(google.maps.event.addListener(ae,"drag",b)),x(ae),C&&C(ae),()=>{S!==null&&google.maps.event.removeListener(S),M!==null&&google.maps.event.removeListener(M),E!==null&&google.maps.event.removeListener(E),j!==null&&google.maps.event.removeListener(j),k!==null&&google.maps.event.removeListener(k),F!==null&&google.maps.event.removeListener(F),O!==null&&google.maps.event.removeListener(O),_!==null&&google.maps.event.removeListener(_),$!==null&&google.maps.event.removeListener($),le!==null&&google.maps.event.removeListener(le),P&&P(ae),ae.setMap(null)}},[]),null}m.memo(cmo);class umo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[])}componentDidMount(){var e=this.props.options||{};this.polygon=new google.maps.Polygon(e),this.polygon.setMap(this.context),this.registeredEvents=Ba({updaterMap:mMe,eventMap:gMe,prevProps:{},nextProps:this.props,instance:this.polygon}),this.props.onLoad&&this.props.onLoad(this.polygon)}componentDidUpdate(e){this.polygon&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:mMe,eventMap:gMe,prevProps:e,nextProps:this.props,instance:this.polygon}))}componentWillUnmount(){this.polygon&&(this.props.onUnmount&&this.props.onUnmount(this.polygon),Ja(this.registeredEvents),this.polygon&&this.polygon.setMap(null))}render(){return null}}fo(umo,"contextType",Sa);function yMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function fJ(t){for(var e=1;e{T!==null&&T.setMap(v)},[v]),m.useEffect(()=>{typeof e<"u"&&T!==null&&T.setOptions(e)},[T,e]),m.useEffect(()=>{typeof o<"u"&&T!==null&&T.setDraggable(o)},[T,o]),m.useEffect(()=>{typeof r<"u"&&T!==null&&T.setEditable(r)},[T,r]),m.useEffect(()=>{typeof i<"u"&&T!==null&&T.setVisible(i)},[T,i]),m.useEffect(()=>{typeof n<"u"&&T!==null&&T.setBounds(n)},[T,n]),m.useEffect(()=>{T&&a&&(x!==null&&google.maps.event.removeListener(x),S(google.maps.event.addListener(T,"dblclick",a)))},[a]),m.useEffect(()=>{T&&l&&(R!==null&&google.maps.event.removeListener(R),M(google.maps.event.addListener(T,"dragend",l)))},[l]),m.useEffect(()=>{T&&s&&(D!==null&&google.maps.event.removeListener(D),E(google.maps.event.addListener(T,"dragstart",s)))},[s]),m.useEffect(()=>{T&&c&&(W!==null&&google.maps.event.removeListener(W),j(google.maps.event.addListener(T,"mousedown",c)))},[c]),m.useEffect(()=>{T&&u&&(L!==null&&google.maps.event.removeListener(L),k(google.maps.event.addListener(T,"mousemove",u)))},[u]),m.useEffect(()=>{T&&d&&(N!==null&&google.maps.event.removeListener(N),F(google.maps.event.addListener(T,"mouseout",d)))},[d]),m.useEffect(()=>{T&&f&&(U!==null&&google.maps.event.removeListener(U),O(google.maps.event.addListener(T,"mouseover",f)))},[f]),m.useEffect(()=>{T&&p&&(B!==null&&google.maps.event.removeListener(B),_(google.maps.event.addListener(T,"mouseup",p)))},[p]),m.useEffect(()=>{T&&g&&(X!==null&&google.maps.event.removeListener(X),$(google.maps.event.addListener(T,"rightclick",g)))},[g]),m.useEffect(()=>{T&&y&&(Q!==null&&google.maps.event.removeListener(Q),le(google.maps.event.addListener(T,"click",y)))},[y]),m.useEffect(()=>{T&&w&&(q!==null&&google.maps.event.removeListener(q),te(google.maps.event.addListener(T,"drag",w)))},[w]),m.useEffect(()=>{T&&b&&(re!==null&&google.maps.event.removeListener(re),ae(google.maps.event.addListener(T,"bounds_changed",b)))},[b]),m.useEffect(()=>{var se=new google.maps.Rectangle(fJ(fJ({},e),{},{map:v}));return typeof i<"u"&&se.setVisible(i),typeof r<"u"&&se.setEditable(r),typeof o<"u"&&se.setDraggable(o),typeof n<"u"&&se.setBounds(n),a&&S(google.maps.event.addListener(se,"dblclick",a)),l&&M(google.maps.event.addListener(se,"dragend",l)),s&&E(google.maps.event.addListener(se,"dragstart",s)),c&&j(google.maps.event.addListener(se,"mousedown",c)),u&&k(google.maps.event.addListener(se,"mousemove",u)),d&&F(google.maps.event.addListener(se,"mouseout",d)),f&&O(google.maps.event.addListener(se,"mouseover",f)),p&&_(google.maps.event.addListener(se,"mouseup",p)),g&&$(google.maps.event.addListener(se,"rightclick",g)),y&&le(google.maps.event.addListener(se,"click",y)),w&&te(google.maps.event.addListener(se,"drag",w)),b&&ae(google.maps.event.addListener(se,"bounds_changed",b)),A(se),C&&C(se),()=>{x!==null&&google.maps.event.removeListener(x),R!==null&&google.maps.event.removeListener(R),D!==null&&google.maps.event.removeListener(D),W!==null&&google.maps.event.removeListener(W),L!==null&&google.maps.event.removeListener(L),N!==null&&google.maps.event.removeListener(N),U!==null&&google.maps.event.removeListener(U),B!==null&&google.maps.event.removeListener(B),X!==null&&google.maps.event.removeListener(X),Q!==null&&google.maps.event.removeListener(Q),q!==null&&google.maps.event.removeListener(q),re!==null&&google.maps.event.removeListener(re),P&&P(se),se.setMap(null)}},[]),null}m.memo(dmo);let fmo=class extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{rectangle:null}),fo(this,"setRectangleCallback",()=>{this.state.rectangle!==null&&this.props.onLoad&&this.props.onLoad(this.state.rectangle)})}componentDidMount(){var e=new google.maps.Rectangle(fJ(fJ({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:wMe,eventMap:AMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{rectangle:e}},this.setRectangleCallback)}componentDidUpdate(e){this.state.rectangle!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:wMe,eventMap:AMe,prevProps:e,nextProps:this.props,instance:this.state.rectangle}))}componentWillUnmount(){this.state.rectangle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),Ja(this.registeredEvents),this.state.rectangle.setMap(null))}render(){return null}};fo(fmo,"contextType",Sa);function vMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function hJ(t){for(var e=1;e{x!==null&&x.setMap(A)},[A]),m.useEffect(()=>{typeof e<"u"&&x!==null&&x.setOptions(e)},[x,e]),m.useEffect(()=>{typeof r<"u"&&x!==null&&x.setDraggable(r)},[x,r]),m.useEffect(()=>{typeof i<"u"&&x!==null&&x.setEditable(i)},[x,i]),m.useEffect(()=>{typeof a<"u"&&x!==null&&x.setVisible(a)},[x,a]),m.useEffect(()=>{typeof o=="number"&&x!==null&&x.setRadius(o)},[x,o]),m.useEffect(()=>{typeof n<"u"&&x!==null&&x.setCenter(n)},[x,n]),m.useEffect(()=>{x&&l&&(R!==null&&google.maps.event.removeListener(R),M(google.maps.event.addListener(x,"dblclick",l)))},[l]),m.useEffect(()=>{x&&s&&(D!==null&&google.maps.event.removeListener(D),E(google.maps.event.addListener(x,"dragend",s)))},[s]),m.useEffect(()=>{x&&c&&(W!==null&&google.maps.event.removeListener(W),j(google.maps.event.addListener(x,"dragstart",c)))},[c]),m.useEffect(()=>{x&&u&&(L!==null&&google.maps.event.removeListener(L),k(google.maps.event.addListener(x,"mousedown",u)))},[u]),m.useEffect(()=>{x&&d&&(N!==null&&google.maps.event.removeListener(N),F(google.maps.event.addListener(x,"mousemove",d)))},[d]),m.useEffect(()=>{x&&f&&(U!==null&&google.maps.event.removeListener(U),O(google.maps.event.addListener(x,"mouseout",f)))},[f]),m.useEffect(()=>{x&&p&&(B!==null&&google.maps.event.removeListener(B),_(google.maps.event.addListener(x,"mouseover",p)))},[p]),m.useEffect(()=>{x&&g&&(X!==null&&google.maps.event.removeListener(X),$(google.maps.event.addListener(x,"mouseup",g)))},[g]),m.useEffect(()=>{x&&y&&(Q!==null&&google.maps.event.removeListener(Q),le(google.maps.event.addListener(x,"rightclick",y)))},[y]),m.useEffect(()=>{x&&w&&(q!==null&&google.maps.event.removeListener(q),te(google.maps.event.addListener(x,"click",w)))},[w]),m.useEffect(()=>{x&&b&&(re!==null&&google.maps.event.removeListener(re),ae(google.maps.event.addListener(x,"drag",b)))},[b]),m.useEffect(()=>{x&&C&&(se!==null&&google.maps.event.removeListener(se),ne(google.maps.event.addListener(x,"center_changed",C)))},[w]),m.useEffect(()=>{x&&P&&(fe!==null&&google.maps.event.removeListener(fe),ge(google.maps.event.addListener(x,"radius_changed",P)))},[P]),m.useEffect(()=>{var de=new google.maps.Circle(hJ(hJ({},e||hmo),{},{map:A}));return typeof o=="number"&&de.setRadius(o),typeof n<"u"&&de.setCenter(n),typeof o=="number"&&de.setRadius(o),typeof a<"u"&&de.setVisible(a),typeof i<"u"&&de.setEditable(i),typeof r<"u"&&de.setDraggable(r),l&&M(google.maps.event.addListener(de,"dblclick",l)),s&&E(google.maps.event.addListener(de,"dragend",s)),c&&j(google.maps.event.addListener(de,"dragstart",c)),u&&k(google.maps.event.addListener(de,"mousedown",u)),d&&F(google.maps.event.addListener(de,"mousemove",d)),f&&O(google.maps.event.addListener(de,"mouseout",f)),p&&_(google.maps.event.addListener(de,"mouseover",p)),g&&$(google.maps.event.addListener(de,"mouseup",g)),y&&le(google.maps.event.addListener(de,"rightclick",y)),w&&te(google.maps.event.addListener(de,"click",w)),b&&ae(google.maps.event.addListener(de,"drag",b)),C&&ne(google.maps.event.addListener(de,"center_changed",C)),P&&ge(google.maps.event.addListener(de,"radius_changed",P)),S(de),v&&v(de),()=>{R!==null&&google.maps.event.removeListener(R),D!==null&&google.maps.event.removeListener(D),W!==null&&google.maps.event.removeListener(W),L!==null&&google.maps.event.removeListener(L),N!==null&&google.maps.event.removeListener(N),U!==null&&google.maps.event.removeListener(U),B!==null&&google.maps.event.removeListener(B),X!==null&&google.maps.event.removeListener(X),Q!==null&&google.maps.event.removeListener(Q),q!==null&&google.maps.event.removeListener(q),se!==null&&google.maps.event.removeListener(se),fe!==null&&google.maps.event.removeListener(fe),T&&T(de),de.setMap(null)}},[]),null}m.memo(pmo);class gmo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{circle:null}),fo(this,"setCircleCallback",()=>{this.state.circle!==null&&this.props.onLoad&&this.props.onLoad(this.state.circle)})}componentDidMount(){var e=new google.maps.Circle(hJ(hJ({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:bMe,eventMap:xMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{circle:e}},this.setCircleCallback)}componentDidUpdate(e){this.state.circle!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:bMe,eventMap:xMe,prevProps:e,nextProps:this.props,instance:this.state.circle}))}componentWillUnmount(){if(this.state.circle!==null){var e;this.props.onUnmount&&this.props.onUnmount(this.state.circle),Ja(this.registeredEvents),(e=this.state.circle)===null||e===void 0||e.setMap(null)}}render(){return null}}fo(gmo,"contextType",Sa);function SMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function pJ(t){for(var e=1;e{C!==null&&C.setMap(b)},[b]),m.useEffect(()=>{C&&o&&(v!==null&&google.maps.event.removeListener(v),T(google.maps.event.addListener(C,"dblclick",o)))},[o]),m.useEffect(()=>{C&&r&&(A!==null&&google.maps.event.removeListener(A),x(google.maps.event.addListener(C,"mousedown",r)))},[r]),m.useEffect(()=>{C&&i&&(S!==null&&google.maps.event.removeListener(S),R(google.maps.event.addListener(C,"mousemove",i)))},[i]),m.useEffect(()=>{C&&a&&(M!==null&&google.maps.event.removeListener(M),D(google.maps.event.addListener(C,"mouseout",a)))},[a]),m.useEffect(()=>{C&&l&&(E!==null&&google.maps.event.removeListener(E),W(google.maps.event.addListener(C,"mouseover",l)))},[l]),m.useEffect(()=>{C&&s&&(j!==null&&google.maps.event.removeListener(j),L(google.maps.event.addListener(C,"mouseup",s)))},[s]),m.useEffect(()=>{C&&c&&(k!==null&&google.maps.event.removeListener(k),N(google.maps.event.addListener(C,"rightclick",c)))},[c]),m.useEffect(()=>{C&&n&&(F!==null&&google.maps.event.removeListener(F),U(google.maps.event.addListener(C,"click",n)))},[n]),m.useEffect(()=>{C&&u&&(O!==null&&google.maps.event.removeListener(O),B(google.maps.event.addListener(C,"addfeature",u)))},[u]),m.useEffect(()=>{C&&d&&(_!==null&&google.maps.event.removeListener(_),X(google.maps.event.addListener(C,"removefeature",d)))},[d]),m.useEffect(()=>{C&&f&&($!==null&&google.maps.event.removeListener($),Q(google.maps.event.addListener(C,"removeproperty",f)))},[f]),m.useEffect(()=>{C&&p&&(le!==null&&google.maps.event.removeListener(le),q(google.maps.event.addListener(C,"setgeometry",p)))},[p]),m.useEffect(()=>{C&&g&&(te!==null&&google.maps.event.removeListener(te),re(google.maps.event.addListener(C,"setproperty",g)))},[g]),m.useEffect(()=>{if(b!==null){var ae=new google.maps.Data(pJ(pJ({},e),{},{map:b}));o&&T(google.maps.event.addListener(ae,"dblclick",o)),r&&x(google.maps.event.addListener(ae,"mousedown",r)),i&&R(google.maps.event.addListener(ae,"mousemove",i)),a&&D(google.maps.event.addListener(ae,"mouseout",a)),l&&W(google.maps.event.addListener(ae,"mouseover",l)),s&&L(google.maps.event.addListener(ae,"mouseup",s)),c&&N(google.maps.event.addListener(ae,"rightclick",c)),n&&U(google.maps.event.addListener(ae,"click",n)),u&&B(google.maps.event.addListener(ae,"addfeature",u)),d&&X(google.maps.event.addListener(ae,"removefeature",d)),f&&Q(google.maps.event.addListener(ae,"removeproperty",f)),p&&q(google.maps.event.addListener(ae,"setgeometry",p)),g&&re(google.maps.event.addListener(ae,"setproperty",g)),P(ae),y&&y(ae)}return()=>{C&&(v!==null&&google.maps.event.removeListener(v),A!==null&&google.maps.event.removeListener(A),S!==null&&google.maps.event.removeListener(S),M!==null&&google.maps.event.removeListener(M),E!==null&&google.maps.event.removeListener(E),j!==null&&google.maps.event.removeListener(j),k!==null&&google.maps.event.removeListener(k),F!==null&&google.maps.event.removeListener(F),O!==null&&google.maps.event.removeListener(O),_!==null&&google.maps.event.removeListener(_),$!==null&&google.maps.event.removeListener($),le!==null&&google.maps.event.removeListener(le),te!==null&&google.maps.event.removeListener(te),w&&w(C),C.setMap(null))}},[]),null}m.memo(mmo);class ymo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{data:null}),fo(this,"setDataCallback",()=>{this.state.data!==null&&this.props.onLoad&&this.props.onLoad(this.state.data)})}componentDidMount(){if(this.context!==null){var e=new google.maps.Data(pJ(pJ({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:PMe,eventMap:TMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({data:e}),this.setDataCallback)}}componentDidUpdate(e){this.state.data!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:PMe,eventMap:TMe,prevProps:e,nextProps:this.props,instance:this.state.data}))}componentWillUnmount(){this.state.data!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),Ja(this.registeredEvents),this.state.data&&this.state.data.setMap(null))}render(){return null}}fo(ymo,"contextType",Sa);function CMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function RMe(t){for(var e=1;e{this.state.kmlLayer!==null&&this.props.onLoad&&this.props.onLoad(this.state.kmlLayer)})}componentDidMount(){var e=new google.maps.KmlLayer(RMe(RMe({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:MMe,eventMap:HMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{kmlLayer:e}},this.setKmlLayerCallback)}componentDidUpdate(e){this.state.kmlLayer!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:MMe,eventMap:HMe,prevProps:e,nextProps:this.props,instance:this.state.kmlLayer}))}componentWillUnmount(){this.state.kmlLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),Ja(this.registeredEvents),this.state.kmlLayer.setMap(null))}render(){return null}}fo(Amo,"contextType",Sa);function Xrt(t,e){return typeof e=="function"?e(t.offsetWidth,t.offsetHeight):{x:0,y:0}}function wmo(t,e){return new e(t.lat,t.lng)}function vmo(t,e){return new e(new google.maps.LatLng(t.ne.lat,t.ne.lng),new google.maps.LatLng(t.sw.lat,t.sw.lng))}function xmo(t,e,n){return t instanceof e?t:n(t,e)}function bmo(t,e,n){return t instanceof e?t:n(t,e)}function Smo(t,e,n){var o=t&&t.fromLatLngToDivPixel(n.getNorthEast()),r=t&&t.fromLatLngToDivPixel(n.getSouthWest());return o&&r?{left:"".concat(r.x+e.x,"px"),top:"".concat(o.y+e.y,"px"),width:"".concat(o.x-r.x-e.x,"px"),height:"".concat(r.y-o.y-e.y,"px")}:{left:"-9999px",top:"-9999px"}}function Tmo(t,e,n){var o=t&&t.fromLatLngToDivPixel(n);if(o){var{x:r,y:i}=o;return{left:"".concat(r+e.x,"px"),top:"".concat(i+e.y,"px")}}return{left:"-9999px",top:"-9999px"}}function Jrt(t,e,n,o){return n!==void 0?Smo(t,e,bmo(n,google.maps.LatLngBounds,vmo)):Tmo(t,e,xmo(o,google.maps.LatLng,wmo))}function Pmo(t,e){return t.left===e.left&&t.top===e.top&&t.width===e.height&&t.height===e.height}function IMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Cmo(t){for(var e=1;e{var f=document.createElement("div");return f.style.position="absolute",f},[]),d=m.useMemo(()=>Rmo(u,o,e,n,l),[u,o,e,n]);return m.useEffect(()=>(i==null||i(d),d==null||d.setMap(c),()=>{a==null||a(d),d==null||d.setMap(null)}),[c,d]),m.useEffect(()=>{u.style.zIndex="".concat(r)},[r,u]),Cd.createPortal(s,u)}m.memo(Mmo);class PM extends m.PureComponent{constructor(e){super(e),fo(this,"state",{paneEl:null,containerStyle:{position:"absolute"}}),fo(this,"updatePane",()=>{var o=this.props.mapPaneName,r=this.overlayView.getPanes();Gu(!!o,"OverlayView requires props.mapPaneName but got %s",o),r?this.setState({paneEl:r[o]}):this.setState({paneEl:null})}),fo(this,"onAdd",()=>{var o,r;this.updatePane(),(o=(r=this.props).onLoad)===null||o===void 0||o.call(r,this.overlayView)}),fo(this,"onPositionElement",()=>{var o=this.overlayView.getProjection(),r=Hmo({x:0,y:0},this.containerRef.current?Xrt(this.containerRef.current,this.props.getPixelPositionOffset):{}),i=Jrt(o,r,this.props.bounds,this.props.position);if(!Pmo(i,{left:this.state.containerStyle.left,top:this.state.containerStyle.top,width:this.state.containerStyle.width,height:this.state.containerStyle.height})){var a,l,s,c;this.setState({containerStyle:{top:(a=i.top)!==null&&a!==void 0?a:0,left:(l=i.left)!==null&&l!==void 0?l:0,width:(s=i.width)!==null&&s!==void 0?s:0,height:(c=i.height)!==null&&c!==void 0?c:0,position:"absolute"}})}}),fo(this,"draw",()=>{this.onPositionElement()}),fo(this,"onRemove",()=>{var o,r;this.setState(()=>({paneEl:null})),(o=(r=this.props).onUnmount)===null||o===void 0||o.call(r,this.overlayView)}),this.containerRef=m.createRef();var n=new google.maps.OverlayView;n.onAdd=this.onAdd,n.draw=this.draw,n.onRemove=this.onRemove,this.overlayView=n}componentDidMount(){this.overlayView.setMap(this.context)}componentDidUpdate(e){var n=DMe(e.position),o=DMe(this.props.position),r=EMe(e.bounds),i=EMe(this.props.bounds);(n!==o||r!==i)&&this.overlayView.draw(),e.mapPaneName!==this.props.mapPaneName&&this.updatePane()}componentWillUnmount(){this.overlayView.setMap(null)}render(){var e=this.state.paneEl;return e?Cd.createPortal(h.jsx("div",{ref:this.containerRef,style:this.state.containerStyle,children:m.Children.only(this.props.children)}),e):null}}fo(PM,"FLOAT_PANE","floatPane");fo(PM,"MAP_PANE","mapPane");fo(PM,"MARKER_LAYER","markerLayer");fo(PM,"OVERLAY_LAYER","overlayLayer");fo(PM,"OVERLAY_MOUSE_TARGET","overlayMouseTarget");fo(PM,"contextType",Sa);function Imo(){}function FMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function kMe(t){for(var e=1;enew google.maps.GroundOverlay(e,a,o),[]);return m.useEffect(()=>{l!==null&&l.setMap(i)},[i]),m.useEffect(()=>{typeof e<"u"&&l!==null&&(l.set("url",e),l.setMap(i))},[l,e]),m.useEffect(()=>{typeof r<"u"&&l!==null&&l.setOpacity(r?1:0)},[l,r]),m.useEffect(()=>{var s=new google.maps.LatLngBounds(new google.maps.LatLng(n.south,n.west),new google.maps.LatLng(n.north,n.east));typeof n<"u"&&l!==null&&(l.set("bounds",s),l.setMap(i))},[l,n]),null}m.memo(zmo);class Krt extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{groundOverlay:null}),fo(this,"setGroundOverlayCallback",()=>{this.state.groundOverlay!==null&&this.props.onLoad&&this.props.onLoad(this.state.groundOverlay)})}componentDidMount(){Gu(!!this.props.url||!!this.props.bounds,"For GroundOverlay, url and bounds are passed in to constructor and are immutable after instantiated. This is the behavior of Google Maps JavaScript API v3 ( See https://developers.google.com/maps/documentation/javascript/reference#GroundOverlay) Hence, use the corresponding two props provided by `react-google-maps-api`, url and bounds. In some cases, you'll need the GroundOverlay component to reflect the changes of url and bounds. You can leverage the React's key property to remount the component. Typically, just `key={url}` would serve your need. See https://github.com/tomchentw/react-google-maps/issues/655");var e=new google.maps.GroundOverlay(this.props.url,this.props.bounds,kMe(kMe({},this.props.options),{},{map:this.context}));this.registeredEvents=Ba({updaterMap:WMe,eventMap:LMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{groundOverlay:e}},this.setGroundOverlayCallback)}componentDidUpdate(e){this.state.groundOverlay!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:WMe,eventMap:LMe,prevProps:e,nextProps:this.props,instance:this.state.groundOverlay}))}componentWillUnmount(){this.state.groundOverlay&&(this.props.onUnmount&&this.props.onUnmount(this.state.groundOverlay),this.state.groundOverlay.setMap(null))}render(){return null}}fo(Krt,"defaultProps",{onLoad:Imo});fo(Krt,"contextType",Sa);function NMe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function gJ(t){for(var e=1;e{google.maps.visualization||Gu(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} in useJsApiScript? %s',google.maps.visualization)},[]),m.useEffect(()=>{Gu(!!e,"data property is required in HeatmapLayer %s",e)},[e]),m.useEffect(()=>{a!==null&&a.setMap(i)},[i]),m.useEffect(()=>{r&&a!==null&&a.setOptions(r)},[a,r]),m.useEffect(()=>{var s=new google.maps.visualization.HeatmapLayer(gJ(gJ({},r),{},{data:e,map:i}));return l(s),n&&n(s),()=>{a!==null&&(o&&o(a),a.setMap(null))}},[]),null}m.memo(Dmo);class Emo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{heatmapLayer:null}),fo(this,"setHeatmapLayerCallback",()=>{this.state.heatmapLayer!==null&&this.props.onLoad&&this.props.onLoad(this.state.heatmapLayer)})}componentDidMount(){Gu(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} to ? %s',google.maps.visualization),Gu(!!this.props.data,"data property is required in HeatmapLayer %s",this.props.data);var e=new google.maps.visualization.HeatmapLayer(gJ(gJ({},this.props.options),{},{data:this.props.data,map:this.context}));this.registeredEvents=Ba({updaterMap:jMe,eventMap:UMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{heatmapLayer:e}},this.setHeatmapLayerCallback)}componentDidUpdate(e){Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:jMe,eventMap:UMe,prevProps:e,nextProps:this.props,instance:this.state.heatmapLayer})}componentWillUnmount(){this.state.heatmapLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),Ja(this.registeredEvents),this.state.heatmapLayer.setMap(null))}render(){return null}}fo(Emo,"contextType",Sa);var BMe={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},YMe={register(t,e,n){t.registerPanoProvider(e,n)},links(t,e){t.setLinks(e)},motionTracking(t,e){t.setMotionTracking(e)},options(t,e){t.setOptions(e)},pano(t,e){t.setPano(e)},position(t,e){t.setPosition(e)},pov(t,e){t.setPov(e)},visible(t,e){t.setVisible(e)},zoom(t,e){t.setZoom(e)}};class Fmo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{streetViewPanorama:null}),fo(this,"setStreetViewPanoramaCallback",()=>{this.state.streetViewPanorama!==null&&this.props.onLoad&&this.props.onLoad(this.state.streetViewPanorama)})}componentDidMount(){var e,n,o=(e=(n=this.context)===null||n===void 0?void 0:n.getStreetView())!==null&&e!==void 0?e:null;this.registeredEvents=Ba({updaterMap:YMe,eventMap:BMe,prevProps:{},nextProps:this.props,instance:o}),this.setState(()=>({streetViewPanorama:o}),this.setStreetViewPanoramaCallback)}componentDidUpdate(e){this.state.streetViewPanorama!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:YMe,eventMap:BMe,prevProps:e,nextProps:this.props,instance:this.state.streetViewPanorama}))}componentWillUnmount(){this.state.streetViewPanorama!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),Ja(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))}render(){return null}}fo(Fmo,"contextType",Sa);class kmo extends m.PureComponent{constructor(){super(...arguments),fo(this,"state",{streetViewService:null}),fo(this,"setStreetViewServiceCallback",()=>{this.state.streetViewService!==null&&this.props.onLoad&&this.props.onLoad(this.state.streetViewService)})}componentDidMount(){var e=new google.maps.StreetViewService;this.setState(function(){return{streetViewService:e}},this.setStreetViewServiceCallback)}componentWillUnmount(){this.state.streetViewService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)}render(){return null}}fo(kmo,"contextType",Sa);var OMe={onDirectionsChanged:"directions_changed"},_Me={directions(t,e){t.setDirections(e)},map(t,e){t.setMap(e)},options(t,e){t.setOptions(e)},panel(t,e){t.setPanel(e)},routeIndex(t,e){t.setRouteIndex(e)}};class Lmo extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"state",{directionsRenderer:null}),fo(this,"setDirectionsRendererCallback",()=>{this.state.directionsRenderer!==null&&(this.state.directionsRenderer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.directionsRenderer))})}componentDidMount(){var e=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=Ba({updaterMap:_Me,eventMap:OMe,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{directionsRenderer:e}},this.setDirectionsRendererCallback)}componentDidUpdate(e){this.state.directionsRenderer!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:_Me,eventMap:OMe,prevProps:e,nextProps:this.props,instance:this.state.directionsRenderer}))}componentWillUnmount(){this.state.directionsRenderer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),Ja(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))}render(){return null}}fo(Lmo,"contextType",Sa);var VMe={onPlacesChanged:"places_changed"},GMe={bounds(t,e){t.setBounds(e)}};class L9e extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"containerElement",m.createRef()),fo(this,"state",{searchBox:null}),fo(this,"setSearchBoxCallback",()=>{this.state.searchBox!==null&&this.props.onLoad&&this.props.onLoad(this.state.searchBox)})}componentDidMount(){if(Gu(!!google.maps.places,'You need to provide libraries={["places"]} prop to component %s',google.maps.places),this.containerElement!==null&&this.containerElement.current!==null){var e=this.containerElement.current.querySelector("input");if(e!==null){var n=new google.maps.places.SearchBox(e,this.props.options);this.registeredEvents=Ba({updaterMap:GMe,eventMap:VMe,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{searchBox:n}},this.setSearchBoxCallback)}}}componentDidUpdate(e){this.state.searchBox!==null&&(Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:GMe,eventMap:VMe,prevProps:e,nextProps:this.props,instance:this.state.searchBox}))}componentWillUnmount(){this.state.searchBox!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),Ja(this.registeredEvents))}render(){return h.jsx("div",{ref:this.containerElement,children:m.Children.only(this.props.children)})}}fo(L9e,"contextType",Sa);var XMe={onPlaceChanged:"place_changed"},JMe={bounds(t,e){t.setBounds(e)},restrictions(t,e){t.setComponentRestrictions(e)},fields(t,e){t.setFields(e)},options(t,e){t.setOptions(e)},types(t,e){t.setTypes(e)}};class qrt extends m.PureComponent{constructor(){super(...arguments),fo(this,"registeredEvents",[]),fo(this,"containerElement",m.createRef()),fo(this,"state",{autocomplete:null}),fo(this,"setAutocompleteCallback",()=>{this.state.autocomplete!==null&&this.props.onLoad&&this.props.onLoad(this.state.autocomplete)})}componentDidMount(){var e;Gu(!!google.maps.places,'You need to provide libraries={["places"]} prop to component %s',google.maps.places);var n=(e=this.containerElement.current)===null||e===void 0?void 0:e.querySelector("input");if(n){var o=new google.maps.places.Autocomplete(n,this.props.options);this.registeredEvents=Ba({updaterMap:JMe,eventMap:XMe,prevProps:{},nextProps:this.props,instance:o}),this.setState(()=>({autocomplete:o}),this.setAutocompleteCallback)}}componentDidUpdate(e){Ja(this.registeredEvents),this.registeredEvents=Ba({updaterMap:JMe,eventMap:XMe,prevProps:e,nextProps:this.props,instance:this.state.autocomplete})}componentWillUnmount(){this.state.autocomplete!==null&&Ja(this.registeredEvents)}render(){return h.jsx("div",{ref:this.containerElement,className:this.props.className,children:m.Children.only(this.props.children)})}}fo(qrt,"defaultProps",{className:""});fo(qrt,"contextType",Sa);const KMe="/aladdin/assets/empty_heart-B57-2tMp.png",Wmo="/aladdin/assets/red_heart-BaAtCixH.png",Nmo="/aladdin/assets/open_file-B6scZwPU.png",Umo="/aladdin/assets/export_link-Dxa4UObV.png",jmo="/aladdin/assets/click_count-BZx6BgQJ.png";function OO(t){const e=new Date(t);if(!Number.isNaN(e.valueOf()))return e;const n=String(t).match(/\d+/g);if(n==null||n.length<=2)return e;{const[o,r,...i]=n.map(s=>parseInt(s)),a=[o,r-1,...i];return new Date(Date.UTC(...a))}}function qMe(t,e,n){const o=t!==1?e+"s":e;return t+" "+o+" "+n}function vfe(){return vfe=Object.assign?Object.assign.bind():function(t){for(var e=1;eDate.now();function Ymo({date:t,formatter:e=qMe,component:n="time",live:o=!0,minPeriod:r=0,maxPeriod:i=_O,title:a,now:l=Bmo,...s}){const[c,u]=m.useState(l());m.useEffect(()=>{if(!o)return;const T=(()=>{const A=OO(t).valueOf();if(!A)return console.warn("[react-timeago] Invalid Date provided"),0;const x=Math.round(Math.abs(c-A)/1e3),S=x{u(l())},R):0})();return()=>{T&&clearTimeout(T)}},[t,o,i,r,l,c]);const d=n,f=OO(t).valueOf();if(!f)return null;const p=Math.round(Math.abs(c-f)/1e3),g=f"u"?typeof t=="string"?t:OO(t).toISOString().substr(0,16).replace("T"," "):a,C=d==="time"?{...s,dateTime:OO(t).toISOString()}:s,P=qMe.bind(null,y,w,g);return m.createElement(d,vfe({},C,{title:b}),e(y,w,g,f,P,l))}function mJ(){return mJ=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[r]=t[r]);return n}var _mo=["cdnSuffix","cdnUrl","countryCode","style","svg"],Vmo="https://cdn.jsdelivr.net/gh/lipis/flag-icons/flags/4x3/",Gmo="svg",Xmo=127397,$rt=function(e){var n=e.cdnSuffix,o=n===void 0?Gmo:n,r=e.cdnUrl,i=r===void 0?Vmo:r,a=e.countryCode,l=e.style,s=e.svg,c=s===void 0?!1:s,u=Omo(e,_mo);if(typeof a!="string")return null;if(c){var d=""+i+a.toLowerCase()+"."+o;return m.createElement("img",Object.assign({},u,{src:d,style:mJ({display:"inline-block",width:"1em",height:"1em",verticalAlign:"middle"},l)}))}var f=a.toUpperCase().replace(/./g,function(p){return String.fromCodePoint(p.charCodeAt(0)+Xmo)});return m.createElement("span",Object.assign({role:"img"},u,{style:mJ({display:"inline-block",fontSize:"1em",lineHeight:"1em",verticalAlign:"middle"},l)}),f)};const Qrt=t=>{switch(t.type){case pa.PHOTOVOLTAIC:return WQe;case pa.PARABOLIC_DISH:return NQe;case pa.PARABOLIC_TROUGH:return UQe;case pa.FRESNEL_REFLECTOR:return jQe;case pa.SOLAR_POWER_TOWER:return BQe;case pa.WIND_TURBINE:return _Qe;case pa.COLOCATION_PROJECTS:return VQe;case pa.RESIDENTIAL_BUILDING:return EQe;case pa.COMMERCIAL_BUILDING:return FQe;case pa.SCHOOL_BUILDING:return kQe;case pa.TOURIST_ATTRACTION:return LQe;case pa.UNDER_CONSTRUCTION:return YQe}return OQe},{Panel:Jmo}=aye,Kmo=be.memo(({latRef:t,lngRef:e,selectAuthor:n,closeMap:o,openModel:r,deleteModel:i,likeModel:a,pinModel:l})=>{var ge;const s=H.getState().user,c=H(fn),u=H(En),d=H(ewt)??tje,f=H(twt)??0,p=H(Mge)??"roadmap",g=H(Bge),y=ht(GBe),w=H(JBe),[b,C]=m.useState(null),[P,v]=m.useState(null),[T,A]=m.useState(null),[x,S]=m.useState(!0),[R,M]=m.useState(!1),D=m.useRef(null),E=m.useRef([]),W=m.useRef(-1),j=m.useRef([]),L=Jt(),k=14,N=(ge=s.email)==null?void 0:ge.endsWith("@intofuture.org"),F=()=>{j.current.length=0;for(const de in g)if(Object.hasOwn(g,de)){const Z=g[de],he=new google.maps.LatLng(Z.latitude,Z.longitude);j.current.push(he)}},U=m.useCallback(de=>{C(de),F(),de.setMapTypeId(p)},[p]),O=m.useCallback(function(){C(null)},[]),B=()=>{if(b){const de=b.getCenter();if(de){const Z=de.lat(),he=de.lng();if(Z!==t.current||he!==e.current){const xe={name:"Set Model Map Location",timestamp:Date.now(),oldLatitude:t.current,newLatitude:Z,oldLongitude:e.current,newLongitude:he,undo:()=>{t.current=xe.oldLatitude,e.current=xe.oldLongitude},redo:()=>{t.current=xe.newLatitude,e.current=xe.newLongitude}};u(xe),t.current=Z,e.current=he}}}},_=()=>{if(b){const de=b.getZoom();if(de!==void 0&&de!==d){const Z={name:"Zoom Model Map",timestamp:Date.now(),oldValue:d,newValue:de,undo:()=>{c(he=>{he.modelsMapZoom=Z.oldValue})},redo:()=>{c(he=>{he.modelsMapZoom=Z.newValue})}};u(Z),c(he=>{he.modelsMapZoom=de})}}},X=()=>{if(b){const de=b.getTilt();if(de!==void 0&&de!==f){const Z={name:"Tilt Model Map",timestamp:Date.now(),oldValue:f,newValue:de,undo:()=>{c(he=>{he.modelsMapTilt=Z.oldValue})},redo:()=>{c(he=>{he.modelsMapTilt=Z.newValue})}};u(Z),c(he=>{he.modelsMapTilt=de})}}},$=()=>{if(b){const de=b.getMapTypeId();if(de!==void 0&&de!==p){const Z={name:"Change Model Map Type",timestamp:Date.now(),oldValue:p,newValue:de,undo:()=>{c(he=>{he.modelsMapType=Z.oldValue})},redo:()=>{c(he=>{he.modelsMapType=Z.newValue})}};u(Z),c(he=>{he.modelsMapType=de})}}},Q={styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"labels",stylers:[{visibility:"off"}]}]},le=de=>{de.userid&&de.title?(r(de),o()):po(Y.t("message.ModelNotFound",L))},q=de=>{if(de.userid&&de.title){const Z=t1+"?client=web&userid="+de.userid+"&title="+encodeURIComponent(de.title);navigator.clipboard.writeText(Z).then(()=>S2(Y.t("cloudFilePanel.LinkGeneratedInClipBoard",L)+"."))}else po(Y.t("message.ModelNotFound",L))},te=de=>{Oi.confirm({title:Y.t("message.DoYouWantToDeleteModelFromMap",L),icon:h.jsx(ny,{}),onOk:()=>{i(de,()=>{c(Z=>{var he,xe;if(Z.modelSites){const He=Z.modelSites.get(me.getLatLngKey(de.latitude,de.longitude));if(He){let Se;for(const[ze,Ie]of He)if(Ie.userid===de.userid&&Ie.title===de.title){Se=ze;break}Se&&(He.delete(Se),He.size===0&&((xe=(he=E.current[W.current])==null?void 0:he.marker)==null||xe.setMap(null)))}}}),v(null),A(null)})},onCancel:()=>{},okText:Y.t("word.Yes",L),cancelText:Y.t("word.No",L)})},re=de=>{var Z;if(de.userid&&de.title){const he=me.getModelKey(de),xe=!!((Z=s.likes)!=null&&Z.includes(he));a(de,!xe,()=>{c(He=>{if(He.user)if(He.user.likes||(He.user.likes=[]),He.user.likes.includes(he)){const Se=He.user.likes.indexOf(he);Se>=0&&He.user.likes.splice(Se,1)}else He.user.likes.push(he);if(He.modelSites){const Se=He.modelSites.get(me.getLatLngKey(de.latitude,de.longitude));if(Se){for(const ze of Se.values())if(ze.userid===de.userid&&ze.title===de.title){ze.likeCount===void 0&&(ze.likeCount=0),ze.likeCount+=xe?-1:1;break}}}}),M(!R)})}},ae=de=>{const Z=H.getState().modelSites.get(me.getLatLngKey(de.latitude,de.longitude));if(Z){for(const he of Z.values())if(he.userid===de.userid&&he.title===de.title)return he.likeCount??0}return 0},se=de=>{const Z=H.getState().modelSites.get(me.getLatLngKey(de.latitude,de.longitude));if(Z){for(const he of Z.values())if(he.userid===de.userid&&he.title===de.title)return he.clickCount??0}return 0},ne=de=>{const Z=H.getState().modelSites.get(me.getLatLngKey(de.latitude,de.longitude));if(Z){for(const he of Z.values())if(he.userid===de.userid&&he.title===de.title)return he.pinned}return!1},fe=(de,Z)=>{de.userid&&de.title&&l(de,Z,()=>{c(he=>{if(he.modelSites){const xe=he.modelSites.get(me.getLatLngKey(de.latitude,de.longitude));if(xe){for(const He of xe.values())if(He.userid===de.userid&&He.title===de.title){He.pinned=Z,M(!R);break}}}})})};return h.jsx(Frt,{mapContainerStyle:{border:"1px solid",width:"100%",height:"100%"},mapTypeId:p,options:Q,center:{lat:t.current,lng:e.current},zoom:d,tilt:f,onLoad:U,onUnmount:O,onCenterChanged:B,onZoomChanged:_,onTiltChanged:X,onMapTypeIdChanged:$,children:h.jsxs(h.Fragment,{children:[y&&j.current.map((de,Z)=>{const he=.2*d;return h.jsx(yfe,{icon:{path:google.maps.SymbolPath.CIRCLE,strokeColor:"red",strokeWeight:he+2,scale:he},position:de},Z)}),P&&P.size&&T&&h.jsx(Grt,{position:{lat:T.lat(),lng:T.lng()},children:h.jsxs("div",{style:{border:"2px solid gainsboro",maxHeight:"400px",overflowY:"auto"},onMouseLeave:()=>{v(null),A(null)},children:[P.size>1?h.jsxs("div",{style:{background:"#dddddd",textAlign:"left",borderBottom:"1px solid gainsboro",paddingBottom:"4px",marginBottom:"4px"},children:[x?h.jsx(Vnn,{title:Y.t("modelsMap.SortFromNewestToOldest",L),style:{cursor:"pointer",marginLeft:"2px",marginRight:"6px"},onClick:()=>{S(!1)}}):h.jsx(zon,{title:Y.t("modelsMap.SortFromOldestToNewest",L),style:{cursor:"pointer",marginLeft:"2px",marginRight:"6px"},onClick:()=>{S(!0)}}),h.jsxs("span",{style:{fontSize:"10px"},children:[P.size," ",Y.t("modelsMap.ModelsFoundOnThisSite",L)]}),T&&h.jsxs("span",{style:{fontSize:"10px"},children:[" —"," ",Y.t("word.Coordinates",L)+": ("+T.lat().toFixed(h8)+"°, "+T.lng().toFixed(h8)+"°)"]})]}):"",[...P.keys()].sort((de,Z)=>{const he=P.get(de),xe=P.get(Z);return he!=null&&he.pinned&&!(xe!=null&&xe.pinned)?-1:xe!=null&&xe.pinned&&!(he!=null&&he.pinned)?1:(x?1:-1)*(((he==null?void 0:he.timeCreated)??0)-((xe==null?void 0:xe.timeCreated)??0))}).map((de,Z)=>{const he=P.get(de);return he?h.jsxs("div",{style:{padding:(P==null?void 0:P.size)>1?"5px 5px 20px 5px":"5px",background:Z%2===0?"white":"#eeeeee"},children:[Z===0&&h.jsxs("div",{style:{fontSize:"12px",display:"block",paddingBottom:"6px"},children:[he.countryCode&&h.jsx($rt,{countryCode:he.countryCode,style:{marginRight:"6px",width:"20px"},svg:!0}),he.address??"Unknown",P.size===1&&h.jsx("span",{style:{fontSize:"10px",display:"block",paddingTop:"10px"},children:Y.t("word.Coordinates",L)+": ("+T.lat().toFixed(h8)+"°, "+T.lng().toFixed(h8)+"°)"})]}),h.jsx(aye,{style:{background:ne(he)?"#FEF9EC":Z%2===0?"white":"#eeeeee",width:"400px"},bordered:!1,ghost:!0,defaultActiveKey:["0"],children:h.jsx(Jmo,{header:h.jsxs(h.Fragment,{children:[he.label,ne(he)&&h.jsx($Te,{style:{marginLeft:"8px"}})]}),style:{fontSize:"12px"},children:h.jsx("div",{style:{fontSize:"10px",display:"block",textAlign:"left"},children:h.jsxs(en,{align:"start",children:[he.thumbnailUrl&&h.jsx("img",{alt:he.label,title:Y.t("word.Open",L),src:he.thumbnailUrl,style:{border:"1px solid #222",cursor:"pointer"},onClick:()=>le(he)}),h.jsxs("div",{children:[he.description&&he.description.trim()!==""?he.description:""," —  By"," ",h.jsx("span",{style:{cursor:"pointer"},title:Y.t("modelsMap.ShowModelsPublishedByThisAuthor",L),onClick:()=>{n(he.author)},children:!he.author||he.author===""?Y.t("word.Anonymous",L):he.author}),", ",he.timeCreated&&h.jsx(Ymo,{date:new Date(he.timeCreated)})]})]})})},Z)}),h.jsxs("div",{style:{marginTop:"10px",fontSize:"11px"},children:[N&&h.jsx(h.Fragment,{children:ne(he)?h.jsx(don,{style:{cursor:"pointer"},title:Y.t("word.Unpin",L),onClick:()=>fe(he,!1)}):h.jsx($Te,{style:{cursor:"pointer"},title:Y.t("word.Pin",L),onClick:()=>fe(he,!0)})}),h.jsx("img",{alt:"Open",onClick:()=>le(he),style:{marginLeft:"10px",cursor:"pointer"},title:Y.t("word.Open",L),src:Nmo,height:k,width:k}),h.jsx("img",{alt:"Export link",onClick:()=>q(he),style:{marginLeft:"5px",cursor:"pointer"},title:Y.t("word.Share",L),src:Umo,height:k,width:k}),he.userid===s.uid&&h.jsx("img",{alt:"Delete",onClick:()=>te(he),style:{marginLeft:"5px",cursor:"pointer"},title:Y.t("word.Delete",L),src:Drt,height:k,width:k}),s.uid?h.jsx(h.Fragment,{children:s.likes&&s.likes.includes(me.getModelKey(he))?h.jsx("img",{alt:"Like",onClick:()=>re(he),style:{marginLeft:"10px",cursor:"pointer"},title:Y.t("word.AlreadyLike",L),src:Wmo,height:k,width:k}):h.jsx("img",{alt:"Like",onClick:()=>re(he),style:{marginLeft:"10px",cursor:"pointer"},title:Y.t("word.Like",L),src:KMe,height:k,width:k})}):h.jsx(h.Fragment,{children:h.jsx("img",{alt:"Like",style:{marginLeft:"10px",opacity:.5},title:Y.t("word.MustLogInToLike",L),src:KMe,height:k,width:k})}),"   ",ae(he),h.jsx("img",{alt:"Click counter",style:{marginLeft:"10px"},title:Y.t("word.ClickCount",L),src:jmo,height:k,width:k}),"   ",se(he)]})]},Z):null})]})}),!!w&&!!w.size&&h.jsx(Brt,{children:de=>h.jsx("div",{children:[...w.keys()].map((Z,he)=>{const xe=w.get(Z);if(!xe||!xe.size)return null;const He=[...xe.keys()].sort((Ie,ye)=>{const ce=xe.get(Ie),pe=xe.get(ye);return ce!=null&&ce.pinned&&!(pe!=null&&pe.pinned)?-1:pe!=null&&pe.pinned&&!(ce!=null&&ce.pinned)?1:(x?1:-1)*(((ce==null?void 0:ce.timeCreated)??0)-((pe==null?void 0:pe.timeCreated)??0))}),Se=xe.get(He[0]);if(!Se)return null;const ze=Qrt(Se);return h.jsx(yfe,{ref:Ie=>E.current[he]=Ie,clusterer:de,icon:ze?{url:ze}:void 0,position:{lat:Se.latitude,lng:Se.longitude},onClick:()=>le(Se),onMouseOver:()=>{D.current=P,W.current=he,v(xe);const Ie=Z.split(", ");A(new google.maps.LatLng(Number.parseFloat(Ie[0]),Number.parseFloat(Ie[1])))},onMouseOut:()=>{P===D.current&&(v(null),A(null))}},he)})})})]})})}),qmo="/aladdin/assets/image_load_failure-HGDkwC0S.png",Zrt=be.memo(({latRef:t,lngRef:e,author:n,models:o,closeCallback:r,openCloudFile:i})=>{const a=H(mp),l=H(s0),s=H(fn),c=H(Mge),u=m.useRef(o?new Map(o):new Map),[d,f]=m.useState(!1),[p,g]=m.useState(),[y,w]=m.useState(!1),{Search:b}=as,C=m.useMemo(()=>({lng:l}),[l]);m.useEffect(()=>{o&&(u.current=new Map(o),f(!d))},[o]);const P=m.useMemo(()=>{let T=0;for(const A of u.current.values())(n||A.userid===a.uid)&&T++;return T},[u.current,n,a.uid,d]),v=n&&c!=="roadmap";return u.current.size===0?h.jsx(gue,{mask:!1,styles:{header:{height:"40px",paddingLeft:"1px",paddingRight:"1px",paddingTop:"16px",paddingBottom:"12px",background:v?"#6A6B6E":"whitesmoke"},body:{padding:"0px 4px 0px 4px",overflowY:"hidden",background:v?"#2A2B2E":"white"}},style:{scrollbarColor:v?"#6A6B6E":"whitesmoke"},title:(n??Y.t("modelsMap.MyPublishedModels",C))+" (0)",placement:"bottom",open:!0,height:"150px",onClose:()=>{r()},children:h.jsx(fg,{image:fg.PRESENTED_IMAGE_SIMPLE,style:{color:v?"lightgray":"dimgray"}})}):h.jsx(gue,{extra:h.jsxs(en,{children:[y?h.jsx(non,{title:Y.t("modelsMap.SortFromNewestToOldest",C),style:{cursor:"pointer",marginLeft:"2px",marginRight:"6px"},onClick:()=>{w(!1)}}):h.jsx(zQe,{title:Y.t("modelsMap.SortFromOldestToNewest",C),style:{cursor:"pointer",marginLeft:"2px",marginRight:"6px"},onClick:()=>{w(!0)}}),h.jsx(b,{title:Y.t("modelsMap.SearchByLabel",C),allowClear:!0,size:"small",enterButton:!0,onSearch:T=>{var A;if(o){u.current.clear();for(const[x,S]of o)(A=S.label)!=null&&A.toLowerCase().includes(T.toLowerCase())&&u.current.set(x,S);f(!d)}}})]}),mask:!1,styles:{header:{height:"40px",color:v?"white":"black",background:v?"#6A6B6E":"whitesmoke",paddingLeft:"1px",paddingRight:"1px",paddingTop:"16px",paddingBottom:"12px",border:"none"},body:{padding:"0px 4px 0px 4px",overflowY:"hidden",background:v?"#2A2B2E":"white"}},title:(n??Y.t("modelsMap.MyPublishedModels",C))+" ("+P+")",placement:"bottom",open:!0,height:"164px",onClose:()=>{g(void 0),r()},children:h.jsx("table",{children:h.jsx("tbody",{children:h.jsx("tr",{children:[...u.current.keys()].sort((T,A)=>{const x=u.current.get(T),S=u.current.get(A);return!x||!S?0:(y?-1:1)*((S.timeCreated??0)-(x.timeCreated??0))}).map((T,A)=>{const x=u.current.get(T);return!x||!n&&x.userid!==a.uid?null:h.jsx("td",{children:h.jsxs("div",{style:{display:"block",marginTop:"4px"},children:[h.jsx("img",{loading:"lazy",height:"100px",width:"auto",onError:S=>{S.target.src=qmo},alt:x.label,title:x.label,src:x.thumbnailUrl,style:{cursor:"pointer",borderRadius:p===x?"0":"10px",border:p===x?"2px solid "+(v?"goldenrod":"red"):"none",marginRight:"4px"},onClick:()=>{g(x),i?i(x.userid,x.title):s(S=>{x&&(S.modelsMapLatitude=x.latitude,S.modelsMapLongitude=x.longitude,S.modelsMapZoom=17,t&&(t.current=x.latitude),e&&(e.current=x.longitude))})}}),h.jsxs("div",{children:[h.jsx("img",{alt:x.type,src:Qrt(x),style:{position:"relative",left:"8px",bottom:"28px",width:"16px",height:"16px"}}),h.jsx("span",{style:{position:"relative",left:"16px",bottom:"24px",color:"white",fontSize:"8px",fontWeight:"bold"},children:x.label?x.label.length>30?x.label.substring(0,30)+"...":x.label:"Unknown"})]})]})},A)})})})})})}),$mo=["places"],Qmo=Ro.div` position: absolute; top: 70px; left: 0; @@ -7158,8 +7158,8 @@ PERFORMANCE OF THIS SOFTWARE. z-index: 999; tab-index: 0; background: white; -`,QMe=be.memo(({openCloudFile:t,deleteModelFromMap:e,likeModelFromMap:n,pinModelFromMap:o})=>{var B;const r=H(mp),i=H(fn),a=H(En),l=H(Mge),s=H(Q8t),c=s!==void 0?s:42.2844063,u=H(Z8t),d=u!==void 0?u:-71.3488548,f=H.getState().modelsMapAddress??uG,p=ht(VBe),g=ht(hwt),y=H(owt),w=H(XBe),b=H(JBe),C=m.useRef(b?new Map(b):new Map),[P,v]=m.useState(),[T,A]=m.useState(!1),x=m.useRef(),S=m.useRef(),R=m.useRef(c),M=m.useRef(d),D=Jt(),{Search:E}=as;m.useEffect(()=>{C.current=b?new Map(b):new Map,P&&(x.current=b.get(P)),A(!T)},[b,P]);const W=_=>{v(_),ht.getState().set(X=>{X.showLeaderboard||(X.leaderboardFlag=!0),_&&(x.current=C.current.get(_))})},{isLoaded:j,loadError:L}=Urt({id:"google-map-script",googleMapsApiKey:"AIzaSyCX6AmhM9d6R1ne9E7redd86YEahX_2Scs",libraries:$mo}),k=()=>{ht.getState().set(_=>{_.openModelsMap=!1}),i(_=>{_.modelsMapLatitude=R.current,_.modelsMapLongitude=M.current})},N=_=>{S.current=_},F=()=>{var X;const _=(X=S.current)==null?void 0:X.getPlaces();if(_&&_.length>0){const $=_[0].geometry;if($&&$.location){const Q={name:"Set Model Map Location",timestamp:Date.now(),oldLatitude:c,newLatitude:$.location.lat(),oldLongitude:d,newLongitude:$.location.lng(),oldAddress:f,newAddress:_[0].formatted_address,undo:()=>{i(le=>{le.modelsMapLatitude=Q.oldLatitude,le.modelsMapLongitude=Q.oldLongitude,le.modelsMapAddress=Q.oldAddress,R.current=le.modelsMapLatitude,M.current=le.modelsMapLongitude})},redo:()=>{i(le=>{le.modelsMapLatitude=Q.newLatitude,le.modelsMapLongitude=Q.newLongitude,le.modelsMapAddress=Q.newAddress,R.current=le.modelsMapLatitude,M.current=le.modelsMapLongitude})}};a(Q),i(le=>{$.location&&(le.modelsMapLatitude=$.location.lat(),le.modelsMapLongitude=$.location.lng(),R.current=le.modelsMapLatitude,M.current=le.modelsMapLongitude),le.modelsMapAddress=_[0].formatted_address})}}},U=(B=r.email)==null?void 0:B.endsWith("@intofuture.org"),O=m.useMemo(()=>{if(!w||!w.size)return 0;let _=0;for(const X of w.values())_+=X.size??0;return _},[w]);return h.jsxs(Qmo,{onKeyDown:_=>{_.key==="Escape"&&k()},children:[j&&h.jsx(en,{children:h.jsx("div",{style:{position:"absolute",fontSize:"medium",color:"black",cursor:"pointer",top:"-40px",left:"40%",width:"20%",height:"28px",background:"white",boxShadow:"1px 1px 1px 1px gray"},children:h.jsx(k9e,{onLoad:N,onPlacesChanged:F,children:h.jsx("input",{type:"text",placeholder:f,style:{boxSizing:"border-box",border:"1px solid transparent",width:"100%",height:"100%",fontSize:"14px",paddingLeft:"8px",paddingRight:"8px",outline:"none",textOverflow:"ellipses",position:"relative"}})})})}),j?h.jsx(Kmo,{latRef:R,lngRef:M,selectAuthor:W,closeMap:k,openModel:t,deleteModel:e,likeModel:n,pinModel:o}):h.jsx(LQ,{}),L&&h.jsx(en,{children:h.jsx("div",{children:"Map cannot be loaded right now, sorry."})}),h.jsxs(h.Fragment,{children:[P&&h.jsx(Zrt,{latRef:R,lngRef:M,author:P,models:x.current,closeCallback:()=>{v(void 0),x.current=void 0}}),g&&!P&&h.jsx("div",{style:{position:"absolute",fontSize:"10px",color:"black",bottom:"33px",left:"5px",width:"180px",height:"360px",overflowY:"auto",padding:"6px 6px 6px 6px",background:"whitesmoke",boxShadow:"1px 1px 1px 1px gray",textAlign:"left"},children:h.jsxs(en,{direction:"vertical",children:[h.jsx(E,{title:Y.t("modelsMap.SearchByPublisher",D),allowClear:!0,size:"small",enterButton:!0,onSearch:_=>{if(b){C.current.clear();for(const[X,$]of b)X.toLowerCase().includes(_.toLowerCase())&&C.current.set(X,$);A(!T)}}}),C.current.size===0?h.jsx(fg,{image:fg.PRESENTED_IMAGE_SIMPLE}):h.jsx("table",{children:h.jsx("tbody",{children:[...C.current.keys()].sort((_,X)=>{const $=C.current.get(_),Q=C.current.get(X);return(Q?Q.size:0)-($?$.size:0)}).map((_,X)=>{if(X>50)return null;const $=C.current.get(_);return($==null?void 0:$.size)===void 0||($==null?void 0:$.size)===0?null:h.jsxs("tr",{style:{width:"180px"},children:[h.jsx("td",{style:{width:"150px"},children:h.jsx(GKe,{icon:h.jsx(Fon,{}),color:($==null?void 0:$.size)>10?"gold":($==null?void 0:$.size)>5?"lime":($==null?void 0:$.size)>1?"blue":"magenta",style:{cursor:"pointer",fontSize:"10px",fontWeight:"bold",width:"130px"},onClick:()=>v(_),title:_,children:_.length>16?_.substring(0,15)+"...":_})}),h.jsx("td",{children:$==null?void 0:$.size})]},X)})})})]})}),h.jsx(en,{children:h.jsxs("div",{title:Y.t("modelsMap.TotalNumberOfUserPublishedModels",D)+": "+O,style:{position:"absolute",fontSize:"14px",color:"black",bottom:"6px",left:"5px",width:"180px",height:"25px",paddingTop:"4px",background:"whitesmoke",boxShadow:"1px 1px 1px 1px gray",cursor:"pointer",userSelect:"none"},onClick:()=>{ht.getState().set(_=>{_.showLeaderboard||(_.leaderboardFlag=!0),_.showLeaderboard=!_.showLeaderboard})},children:[g?h.jsx(Won,{title:Y.t("word.Close",D),style:{marginRight:"8px"}}):h.jsx(qEt,{title:Y.t("word.Open",D),style:{marginRight:"8px"}}),Y.t("word.Leaderboard",D)]})}),y&&h.jsx(en,{children:h.jsxs("div",{style:{position:"absolute",fontSize:"10px",color:l==="roadmap"?"black":"white",bottom:"6px",left:"188px",height:"25x",padding:"6px 6px 2px 6px",cursor:"pointer"},onClick:()=>{i(_=>{y&&(_.modelsMapLatitude=y.latitude,_.modelsMapLongitude=y.longitude,_.modelsMapZoom=20,R.current=_.modelsMapLatitude,M.current=_.modelsMapLongitude)})},children:[Y.t("word.Latest",D)+": ",y.countryCode&&h.jsx($rt,{countryCode:y.countryCode,style:{marginLeft:"2px",marginRight:"4px",width:"20px"},svg:!0}),y.title+", by "+y.author]})}),h.jsx(en,{children:h.jsx("div",{style:{position:"absolute",fontSize:"medium",color:"black",cursor:"pointer",top:"-52px",right:r.uid?"60px":"100px",width:"64px",height:"28px",background:"orange",boxShadow:"1px 1px 1px 1px gray",paddingTop:"4px"},onMouseDown:()=>{k()},children:Y.t("word.Close",D)})}),U&&h.jsx(en,{children:h.jsx(Li,{checked:p,style:{position:"absolute",fontSize:"medium",color:"black",cursor:"pointer",top:"-52px",right:"130px",width:"160px",height:"28px",background:"white",boxShadow:"1px 1px 1px 1px gray",paddingLeft:"4px"},onChange:()=>{ht.getState().set(_=>{_.modelsMapWeatherStations=!_.modelsMapWeatherStations})},children:p?h.jsx("span",{title:Y.t("mapPanel.WeatherStationsNote",D),children:Y.t("mapPanel.WeatherStations",D)}):h.jsx("span",{children:Y.t("mapPanel.WeatherStations",D)})})})]})]})}),Zmo="/aladdin/assets/tiny_lock-DSfuZD8Y.png",eyo="/aladdin/assets/select-C-gZZ0yB.png",ZMe="/aladdin/assets/foundation-Bf2d60AT.png",eIe="/aladdin/assets/cuboid-C70KMDTq.png",tIe="/aladdin/assets/sensor-BZ9UhBbW.png",xfe="/aladdin/assets/solar-panel-BLllvFhu.png",nIe="/aladdin/assets/wall-Dcb0OCnD.png",oIe="/aladdin/assets/window-uls1fTpz.png",rIe="/aladdin/assets/door-DmvdjDKR.png",iIe="/aladdin/assets/pyramid_roof-CRzRVezC.png",aIe="/aladdin/assets/hip_roof-gO3gEx_s.png",lIe="/aladdin/assets/gambrel_roof-BKCAWDsb.png",sIe="/aladdin/assets/mansard_roof-DRTaI5DY.png",cIe="/aladdin/assets/gable_roof-9fruWngj.png",uIe="/aladdin/assets/tree-BUu2qyTB.png",dIe="/aladdin/assets/flower-DErmZ90Q.png",fIe="/aladdin/assets/human-EToF5YZi.png",hIe="/aladdin/assets/parabolic_trough-CSR3V81L.png",pIe="/aladdin/assets/parabolic_dish-BYGRlVcr.png",gIe="/aladdin/assets/fresnel_reflector-CBKiWWxR.png",bfe="/aladdin/assets/heliostat-Kq0JVQG1.png",mIe="/aladdin/assets/wind_turbine-D02sl9A9.png",tyo="/aladdin/assets/vertical_axis_wind_turbine-C-KZaZtD.png",yIe="/aladdin/assets/led_light-D7hmM4q6.png",nyo="/aladdin/assets/group-BuZ9lmWH.png",oyo="/aladdin/assets/clear-BZ83yweM.png",ryo="/aladdin/assets/heliodon-CPHdpxt2.png",iyo="/aladdin/assets/analyze-CgmQCUK0.png",AIe="/aladdin/assets/battery_storage-BvqpVv99.png",wIe="/aladdin/assets/solar_water_heater-ifX6Xha6.png",F4=({...t})=>h.jsx("div",{style:{verticalAlign:"top",display:"inline-block",marginTop:"4px",marginRight:"8px"},children:t.children}),pv="invert(41%) sepia(0%) saturate(0%) hue-rotate(224deg) brightness(93%) contrast(81%)",JT="invert(93%) sepia(3%) saturate(1955%) hue-rotate(26deg) brightness(113%) contrast(96%)",Zc=({objectType:t,srcImg:e,setFlag:n,replacingText:o})=>{const r=a=>{H.getState().set(l=>{l.objectTypeToAdd=a,l.groupActionMode=!1,l.actionModeLock=!1}),Fn.getState().setEnableOrbitController(!1),H.getState().selectNone()},i=Jt();return h.jsxs(rn,{noPadding:!0,textSelectable:!1,onClick:()=>{n(t),r(t)},children:[h.jsx("img",{alt:t,src:e,height:36,width:36,style:{filter:pv,verticalAlign:"middle",marginRight:"10px"}}),Y.t(`toolbar.Add${o??t.replaceAll(" ","")}`,i)]})},ayo=be.memo(()=>{const t=H(fn),e=ht(xh),n=H(ma),o=H(Kn),r=H(s0),i=H(bW),a=H(c7t),l=H(IBe),s=H(Sge),c=ht(Ss),u=H(bwt),d=H($q),f=H(e$),p=H(t$),g=H(yOe),y=H(lxt),w=H(sxt),b=H(En),C=ht(pW),P=ht(zge),v=H(vOe),T=H(pxt),[A,x]=m.useState(z.Foundation),[S,R]=m.useState(z.Wall),[M,D]=m.useState(z.SolarPanel),E=m.useMemo(()=>({lng:r}),[r]),W=()=>{t(se=>{se.objectTypeToAdd=z.None,se.groupActionMode=!1,se.actionModeLock=!1}),ht.getState().setSelectButtonClicked(!0)},j=()=>{t(se=>{se.groupActionMode||(se.objectTypeToAdd=z.None),se.groupActionMode=!se.groupActionMode})},L=()=>{Oi.confirm({title:Y.t("toolbar.DoYouReallyWantToClearContent",E)+"?",icon:h.jsx(ny,{}),onOk:()=>{const se=JSON.parse(JSON.stringify(H.getState().elements));u();const ne={name:"Clear Scene",timestamp:Date.now(),removedElements:se,undo:()=>{t(fe=>{fe.elements.push(...ne.removedElements)})},redo:()=>{u()}};b(ne)}}),W()},k=()=>{const se={name:"Show Sun and Time Settings Panel",timestamp:Date.now(),checked:!l,undo:()=>{t(ne=>{ne.viewState.showHeliodonPanel=!se.checked})},redo:()=>{t(ne=>{ne.viewState.showHeliodonPanel=se.checked})}};b(se),t(ne=>{ne.viewState.showHeliodonPanel=!ne.viewState.showHeliodonPanel,ne.viewState.showHeliodonPanel&&(ne.selectedFloatingWindow="heliodonPanel")})},N=()=>{P||hn(Y.t("message.SimulationStarted",E)),setTimeout(()=>{i(),e("runStaticSimulation",!P),t(se=>{n&&(se.actionInfo={name:"Generate Daily Solar Radiation Heatmap (Static)",timestamp:new Date().getTime()})})},100)},F=()=>{C||hn(Y.t("message.SimulationStarted",E)),setTimeout(()=>{i(),e("runDynamicSimulation",!C),t(se=>{n&&(se.actionInfo={name:"Generate Daily Solar Radiation Heatmap (Dynamic)",timestamp:new Date().getTime()})})},100)},U=se=>{t(ne=>{ne.objectTypeToAdd=se,ne.groupActionMode=!1,ne.actionModeLock=!1}),Fn.getState().setEnableOrbitController(!1),ht.getState().setSelectButtonClicked(!1),i()},O=se=>{switch(se){case z.Human:case z.Tree:case z.Flower:case z.Sensor:case z.SolarPanel:case z.ParabolicDish:case z.ParabolicTrough:case z.FresnelReflector:case z.Heliostat:case z.WindTurbine:case z.VerticalAxisWindTurbine:case z.Light:case z.Wall:case z.Window:return!0;default:return!1}},B=(se,ne,fe,ge)=>{const de=O(se),Z=()=>Y.t(`toolbar.Add${ge??se.replaceAll(" ","")}`,E)+(de?` -`+(a?Y.t("toolbar.ClickToUnlockThisModeForNextAction",E):Y.t("toolbar.DoubleClickToLockThisModeForNextAction",E)):"");return h.jsxs(h.Fragment,{children:[h.jsx("img",{title:Z(),alt:se,src:ne,height:36,width:36,style:{filter:d===se||fe?JT:pv,cursor:"pointer",verticalAlign:"middle"},onClick:()=>{U(se)},onDoubleClick:()=>{de&&t(he=>{he.actionModeLock=!0})}}),(d===se||fe)&&de&&a&&h.jsx("img",{alt:"Tiny lock",src:Zmo,style:{marginLeft:"-2px",filter:d===se||fe?JT:pv,verticalAlign:"top"}})]})},_=se=>h.jsx(jw,{menu:se,trigger:["click"],children:h.jsx("span",{title:Y.t("toolbar.ClickForMoreButtons",E),style:{cursor:"pointer",verticalAlign:"middle",fontSize:"10px",marginLeft:"4px",width:"10px",height:"36px",color:"#666666",fontWeight:"bold"},children:"▼"})}),X=[{key:"add-foundation",label:h.jsx(Zc,{objectType:z.Foundation,srcImg:ZMe,setFlag:x})},{key:"add-cuboid",label:h.jsx(Zc,{objectType:z.Cuboid,srcImg:eIe,setFlag:x})},{key:"add-tree",label:h.jsx(Zc,{objectType:z.Tree,srcImg:uIe,setFlag:x})},{key:"add-flower",label:h.jsx(Zc,{objectType:z.Flower,srcImg:dIe,setFlag:x})},{key:"add-human",label:h.jsx(Zc,{objectType:z.Human,srcImg:fIe,setFlag:x,replacingText:"People"})}],$=[{key:"add-wall",label:h.jsx(Zc,{objectType:z.Wall,srcImg:nIe,setFlag:R})},{key:"add-window",label:h.jsx(Zc,{objectType:z.Window,srcImg:oIe,setFlag:R})},{key:"add-door",label:h.jsx(Zc,{objectType:z.Door,srcImg:rIe,setFlag:R})},{key:"add-pyramid-roof",label:h.jsx(Zc,{objectType:z.PyramidRoof,srcImg:iIe,setFlag:R})},{key:"add-hip-roof",label:h.jsx(Zc,{objectType:z.HipRoof,srcImg:aIe,setFlag:R})},{key:"add-gable-roof",label:h.jsx(Zc,{objectType:z.GableRoof,srcImg:cIe,setFlag:R})},{key:"add-gambrel-roof",label:h.jsx(Zc,{objectType:z.GambrelRoof,srcImg:lIe,setFlag:R})},{key:"add-mansard-roof",label:h.jsx(Zc,{objectType:z.MansardRoof,srcImg:sIe,setFlag:R})}],Q=[{key:"add-solar-panel",label:h.jsx(Zc,{objectType:z.SolarPanel,srcImg:xfe,setFlag:D})},{key:"add-parabolic-trough",label:h.jsx(Zc,{objectType:z.ParabolicTrough,srcImg:hIe,setFlag:D})},{key:"add-parabolic-dish",label:h.jsx(Zc,{objectType:z.ParabolicDish,srcImg:pIe,setFlag:D})},{key:"add-fresnel-reflector",label:h.jsx(Zc,{objectType:z.FresnelReflector,srcImg:gIe,setFlag:D})},{key:"add-heliostat",label:h.jsx(Zc,{objectType:z.Heliostat,srcImg:bfe,setFlag:D})},{key:"add-wind-turbine",label:h.jsx(Zc,{objectType:z.WindTurbine,srcImg:mIe,setFlag:D})},{key:"add-sensor",label:h.jsx(Zc,{objectType:z.Sensor,srcImg:tIe,setFlag:D})},{key:"add-light",label:h.jsx(Zc,{objectType:z.Light,srcImg:yIe,setFlag:D})},{key:"add-water-heater",label:h.jsx(Zc,{objectType:z.WaterHeater,srcImg:wIe,setFlag:D})},{key:"add-battery-storage",label:h.jsx(Zc,{objectType:z.BatteryStorage,srcImg:AIe,setFlag:D})}],le=se=>{switch(se){case z.Foundation:return B(se,ZMe,H.getState().addedFoundationId);case z.Cuboid:return B(se,eIe,H.getState().addedCuboidId);case z.Tree:return B(se,uIe);case z.Flower:return B(se,dIe);case z.Human:return B(se,fIe,void 0,"People")}},q=se=>{switch(se){case z.Wall:return B(se,nIe,H.getState().addedWallId);case z.Window:return B(se,oIe,H.getState().addedWindowId);case z.Door:return B(se,rIe,H.getState().addedDoorId);case z.PyramidRoof:return B(z.PyramidRoof,iIe);case z.HipRoof:return B(z.HipRoof,aIe);case z.GableRoof:return B(z.GableRoof,cIe);case z.GambrelRoof:return B(z.GambrelRoof,lIe);case z.MansardRoof:return B(z.MansardRoof,sIe)}},te=se=>{switch(se){case z.SolarPanel:return B(se,xfe);case z.ParabolicTrough:return B(se,hIe);case z.ParabolicDish:return B(se,pIe);case z.FresnelReflector:return B(se,gIe);case z.Heliostat:return B(se,bfe);case z.Sensor:return B(se,tIe);case z.WindTurbine:return B(se,mIe);case z.VerticalAxisWindTurbine:return B(se,tyo);case z.Light:return B(se,yIe);case z.WaterHeater:return B(se,wIe);case z.BatteryStorage:return B(se,AIe)}},re=()=>d===z.None&&!f&&!p&&!g&&!y&&!w&&!v,ae=()=>{!s||me.hasMovingParts(o)?F():N()};return h.jsxs("div",{children:[h.jsx(F4,{children:h.jsx("img",{title:Y.t("toolbar.Select",E),alt:"Select",src:eyo,height:36,width:36,style:{filter:re()?JT:pv,cursor:"pointer",verticalAlign:"middle"},onClick:W})}),h.jsx(F4,{children:h.jsx("img",{title:Y.t("toolbar.ManipulateGroup",E),alt:"Group",src:nyo,height:36,width:36,style:{filter:v?JT:pv,cursor:"pointer",verticalAlign:"middle"},onClick:j})}),h.jsxs(F4,{children:[le(A),_({items:X})]}),h.jsxs(F4,{children:[q(S),_({items:$})]}),h.jsxs(F4,{children:[te(M),_({items:Q})]}),h.jsx(F4,{children:h.jsx("img",{title:Y.t("toolbar.ClearScene",E),alt:"Clear",src:oyo,height:36,width:36,color:"#666666",style:{cursor:"pointer"},onClick:L})}),h.jsx(F4,{children:h.jsx("img",{title:Y.t("toolbar.SpatialAnalysisOfEnergy",E),alt:"Spatial analysis",src:iyo,height:36,width:36,color:"#666666",style:{filter:c?JT:pv,cursor:"pointer",verticalAlign:"middle"},onClick:()=>{c?ht.getState().set(se=>{se.showSolarRadiationHeatmap=!1,se.showHeatFluxes=!1}):T()>nje?Oi.confirm({title:Y.t("message.CalculationMayBeSlowDoYouWantToContinue",E)+" ("+Y.t("message.IncreaseSolarRadiationHeatmapGridCellSizeToSpeedUp",E)+")",icon:h.jsx($W,{}),onOk:()=>{ae()},onCancel:()=>{},okText:`${Y.t("word.Yes",E)}`,cancelText:`${Y.t("word.No",E)}`}):ae()}})}),h.jsx(F4,{children:h.jsx("img",{title:Y.t("toolbar.ShowSunAndTimeSettings",E),alt:"Heliodon",src:ryo,height:36,width:36,color:"#666666",style:{filter:l?JT:pv,cursor:"pointer",verticalAlign:"middle"},onClick:k})})]})}),lyo=Ro.div` +`,ZMe=be.memo(({openCloudFile:t,deleteModelFromMap:e,likeModelFromMap:n,pinModelFromMap:o})=>{var B;const r=H(mp),i=H(fn),a=H(En),l=H(Mge),s=H(Q8t),c=s!==void 0?s:42.2844063,u=H(Z8t),d=u!==void 0?u:-71.3488548,f=H.getState().modelsMapAddress??dG,p=ht(GBe),g=ht(hwt),y=H(owt),w=H(JBe),b=H(KBe),C=m.useRef(b?new Map(b):new Map),[P,v]=m.useState(),[T,A]=m.useState(!1),x=m.useRef(),S=m.useRef(),R=m.useRef(c),M=m.useRef(d),D=Jt(),{Search:E}=as;m.useEffect(()=>{C.current=b?new Map(b):new Map,P&&(x.current=b.get(P)),A(!T)},[b,P]);const W=_=>{v(_),ht.getState().set(X=>{X.showLeaderboard||(X.leaderboardFlag=!0),_&&(x.current=C.current.get(_))})},{isLoaded:j,loadError:L}=Urt({id:"google-map-script",googleMapsApiKey:"AIzaSyCX6AmhM9d6R1ne9E7redd86YEahX_2Scs",libraries:$mo}),k=()=>{ht.getState().set(_=>{_.openModelsMap=!1}),i(_=>{_.modelsMapLatitude=R.current,_.modelsMapLongitude=M.current})},N=_=>{S.current=_},F=()=>{var X;const _=(X=S.current)==null?void 0:X.getPlaces();if(_&&_.length>0){const $=_[0].geometry;if($&&$.location){const Q={name:"Set Model Map Location",timestamp:Date.now(),oldLatitude:c,newLatitude:$.location.lat(),oldLongitude:d,newLongitude:$.location.lng(),oldAddress:f,newAddress:_[0].formatted_address,undo:()=>{i(le=>{le.modelsMapLatitude=Q.oldLatitude,le.modelsMapLongitude=Q.oldLongitude,le.modelsMapAddress=Q.oldAddress,R.current=le.modelsMapLatitude,M.current=le.modelsMapLongitude})},redo:()=>{i(le=>{le.modelsMapLatitude=Q.newLatitude,le.modelsMapLongitude=Q.newLongitude,le.modelsMapAddress=Q.newAddress,R.current=le.modelsMapLatitude,M.current=le.modelsMapLongitude})}};a(Q),i(le=>{$.location&&(le.modelsMapLatitude=$.location.lat(),le.modelsMapLongitude=$.location.lng(),R.current=le.modelsMapLatitude,M.current=le.modelsMapLongitude),le.modelsMapAddress=_[0].formatted_address})}}},U=(B=r.email)==null?void 0:B.endsWith("@intofuture.org"),O=m.useMemo(()=>{if(!w||!w.size)return 0;let _=0;for(const X of w.values())_+=X.size??0;return _},[w]);return h.jsxs(Qmo,{onKeyDown:_=>{_.key==="Escape"&&k()},children:[j&&h.jsx(en,{children:h.jsx("div",{style:{position:"absolute",fontSize:"medium",color:"black",cursor:"pointer",top:"-40px",left:"40%",width:"20%",height:"28px",background:"white",boxShadow:"1px 1px 1px 1px gray"},children:h.jsx(L9e,{onLoad:N,onPlacesChanged:F,children:h.jsx("input",{type:"text",placeholder:f,style:{boxSizing:"border-box",border:"1px solid transparent",width:"100%",height:"100%",fontSize:"14px",paddingLeft:"8px",paddingRight:"8px",outline:"none",textOverflow:"ellipses",position:"relative"}})})})}),j?h.jsx(Kmo,{latRef:R,lngRef:M,selectAuthor:W,closeMap:k,openModel:t,deleteModel:e,likeModel:n,pinModel:o}):h.jsx(LQ,{}),L&&h.jsx(en,{children:h.jsx("div",{children:"Map cannot be loaded right now, sorry."})}),h.jsxs(h.Fragment,{children:[P&&h.jsx(Zrt,{latRef:R,lngRef:M,author:P,models:x.current,closeCallback:()=>{v(void 0),x.current=void 0}}),g&&!P&&h.jsx("div",{style:{position:"absolute",fontSize:"10px",color:"black",bottom:"33px",left:"5px",width:"180px",height:"360px",overflowY:"auto",padding:"6px 6px 6px 6px",background:"whitesmoke",boxShadow:"1px 1px 1px 1px gray",textAlign:"left"},children:h.jsxs(en,{direction:"vertical",children:[h.jsx(E,{title:Y.t("modelsMap.SearchByPublisher",D),allowClear:!0,size:"small",enterButton:!0,onSearch:_=>{if(b){C.current.clear();for(const[X,$]of b)X.toLowerCase().includes(_.toLowerCase())&&C.current.set(X,$);A(!T)}}}),C.current.size===0?h.jsx(fg,{image:fg.PRESENTED_IMAGE_SIMPLE}):h.jsx("table",{children:h.jsx("tbody",{children:[...C.current.keys()].sort((_,X)=>{const $=C.current.get(_),Q=C.current.get(X);return(Q?Q.size:0)-($?$.size:0)}).map((_,X)=>{if(X>50)return null;const $=C.current.get(_);return($==null?void 0:$.size)===void 0||($==null?void 0:$.size)===0?null:h.jsxs("tr",{style:{width:"180px"},children:[h.jsx("td",{style:{width:"150px"},children:h.jsx(GKe,{icon:h.jsx(Fon,{}),color:($==null?void 0:$.size)>10?"gold":($==null?void 0:$.size)>5?"lime":($==null?void 0:$.size)>1?"blue":"magenta",style:{cursor:"pointer",fontSize:"10px",fontWeight:"bold",width:"130px"},onClick:()=>v(_),title:_,children:_.length>16?_.substring(0,15)+"...":_})}),h.jsx("td",{children:$==null?void 0:$.size})]},X)})})})]})}),h.jsx(en,{children:h.jsxs("div",{title:Y.t("modelsMap.TotalNumberOfUserPublishedModels",D)+": "+O,style:{position:"absolute",fontSize:"14px",color:"black",bottom:"6px",left:"5px",width:"180px",height:"25px",paddingTop:"4px",background:"whitesmoke",boxShadow:"1px 1px 1px 1px gray",cursor:"pointer",userSelect:"none"},onClick:()=>{ht.getState().set(_=>{_.showLeaderboard||(_.leaderboardFlag=!0),_.showLeaderboard=!_.showLeaderboard})},children:[g?h.jsx(Won,{title:Y.t("word.Close",D),style:{marginRight:"8px"}}):h.jsx(qEt,{title:Y.t("word.Open",D),style:{marginRight:"8px"}}),Y.t("word.Leaderboard",D)]})}),y&&h.jsx(en,{children:h.jsxs("div",{style:{position:"absolute",fontSize:"10px",color:l==="roadmap"?"black":"white",bottom:"6px",left:"188px",height:"25x",padding:"6px 6px 2px 6px",cursor:"pointer"},onClick:()=>{i(_=>{y&&(_.modelsMapLatitude=y.latitude,_.modelsMapLongitude=y.longitude,_.modelsMapZoom=20,R.current=_.modelsMapLatitude,M.current=_.modelsMapLongitude)})},children:[Y.t("word.Latest",D)+": ",y.countryCode&&h.jsx($rt,{countryCode:y.countryCode,style:{marginLeft:"2px",marginRight:"4px",width:"20px"},svg:!0}),y.title+", by "+y.author]})}),h.jsx(en,{children:h.jsx("div",{style:{position:"absolute",fontSize:"medium",color:"black",cursor:"pointer",top:"-52px",right:r.uid?"60px":"100px",width:"64px",height:"28px",background:"orange",boxShadow:"1px 1px 1px 1px gray",paddingTop:"4px"},onMouseDown:()=>{k()},children:Y.t("word.Close",D)})}),U&&h.jsx(en,{children:h.jsx(Li,{checked:p,style:{position:"absolute",fontSize:"medium",color:"black",cursor:"pointer",top:"-52px",right:"130px",width:"160px",height:"28px",background:"white",boxShadow:"1px 1px 1px 1px gray",paddingLeft:"4px"},onChange:()=>{ht.getState().set(_=>{_.modelsMapWeatherStations=!_.modelsMapWeatherStations})},children:p?h.jsx("span",{title:Y.t("mapPanel.WeatherStationsNote",D),children:Y.t("mapPanel.WeatherStations",D)}):h.jsx("span",{children:Y.t("mapPanel.WeatherStations",D)})})})]})]})}),Zmo="/aladdin/assets/tiny_lock-DSfuZD8Y.png",eyo="/aladdin/assets/select-C-gZZ0yB.png",eIe="/aladdin/assets/foundation-Bf2d60AT.png",tIe="/aladdin/assets/cuboid-C70KMDTq.png",nIe="/aladdin/assets/sensor-BZ9UhBbW.png",xfe="/aladdin/assets/solar-panel-BLllvFhu.png",oIe="/aladdin/assets/wall-Dcb0OCnD.png",rIe="/aladdin/assets/window-uls1fTpz.png",iIe="/aladdin/assets/door-DmvdjDKR.png",aIe="/aladdin/assets/pyramid_roof-CRzRVezC.png",lIe="/aladdin/assets/hip_roof-gO3gEx_s.png",sIe="/aladdin/assets/gambrel_roof-BKCAWDsb.png",cIe="/aladdin/assets/mansard_roof-DRTaI5DY.png",uIe="/aladdin/assets/gable_roof-9fruWngj.png",dIe="/aladdin/assets/tree-BUu2qyTB.png",fIe="/aladdin/assets/flower-DErmZ90Q.png",hIe="/aladdin/assets/human-EToF5YZi.png",pIe="/aladdin/assets/parabolic_trough-CSR3V81L.png",gIe="/aladdin/assets/parabolic_dish-BYGRlVcr.png",mIe="/aladdin/assets/fresnel_reflector-CBKiWWxR.png",bfe="/aladdin/assets/heliostat-Kq0JVQG1.png",yIe="/aladdin/assets/wind_turbine-D02sl9A9.png",tyo="/aladdin/assets/vertical_axis_wind_turbine-C-KZaZtD.png",AIe="/aladdin/assets/led_light-D7hmM4q6.png",nyo="/aladdin/assets/group-BuZ9lmWH.png",oyo="/aladdin/assets/clear-BZ83yweM.png",ryo="/aladdin/assets/heliodon-CPHdpxt2.png",iyo="/aladdin/assets/analyze-CgmQCUK0.png",wIe="/aladdin/assets/battery_storage-BvqpVv99.png",vIe="/aladdin/assets/solar_water_heater-ifX6Xha6.png",F4=({...t})=>h.jsx("div",{style:{verticalAlign:"top",display:"inline-block",marginTop:"4px",marginRight:"8px"},children:t.children}),pv="invert(41%) sepia(0%) saturate(0%) hue-rotate(224deg) brightness(93%) contrast(81%)",JT="invert(93%) sepia(3%) saturate(1955%) hue-rotate(26deg) brightness(113%) contrast(96%)",Zc=({objectType:t,srcImg:e,setFlag:n,replacingText:o})=>{const r=a=>{H.getState().set(l=>{l.objectTypeToAdd=a,l.groupActionMode=!1,l.actionModeLock=!1}),Fn.getState().setEnableOrbitController(!1),H.getState().selectNone()},i=Jt();return h.jsxs(rn,{noPadding:!0,textSelectable:!1,onClick:()=>{n(t),r(t)},children:[h.jsx("img",{alt:t,src:e,height:36,width:36,style:{filter:pv,verticalAlign:"middle",marginRight:"10px"}}),Y.t(`toolbar.Add${o??t.replaceAll(" ","")}`,i)]})},ayo=be.memo(()=>{const t=H(fn),e=ht(xh),n=H(da),o=H(Kn),r=H(s0),i=H(bW),a=H(c7t),l=H(zBe),s=H(Sge),c=ht(Ss),u=H(bwt),d=H(Qq),f=H(e$),p=H(t$),g=H(yOe),y=H(lxt),w=H(sxt),b=H(En),C=ht(pW),P=ht(zge),v=H(vOe),T=H(pxt),[A,x]=m.useState(z.Foundation),[S,R]=m.useState(z.Wall),[M,D]=m.useState(z.SolarPanel),E=m.useMemo(()=>({lng:r}),[r]),W=()=>{t(se=>{se.objectTypeToAdd=z.None,se.groupActionMode=!1,se.actionModeLock=!1}),ht.getState().setSelectButtonClicked(!0)},j=()=>{t(se=>{se.groupActionMode||(se.objectTypeToAdd=z.None),se.groupActionMode=!se.groupActionMode})},L=()=>{Oi.confirm({title:Y.t("toolbar.DoYouReallyWantToClearContent",E)+"?",icon:h.jsx(ny,{}),onOk:()=>{const se=JSON.parse(JSON.stringify(H.getState().elements));u();const ne={name:"Clear Scene",timestamp:Date.now(),removedElements:se,undo:()=>{t(fe=>{fe.elements.push(...ne.removedElements)})},redo:()=>{u()}};b(ne)}}),W()},k=()=>{const se={name:"Show Sun and Time Settings Panel",timestamp:Date.now(),checked:!l,undo:()=>{t(ne=>{ne.viewState.showHeliodonPanel=!se.checked})},redo:()=>{t(ne=>{ne.viewState.showHeliodonPanel=se.checked})}};b(se),t(ne=>{ne.viewState.showHeliodonPanel=!ne.viewState.showHeliodonPanel,ne.viewState.showHeliodonPanel&&(ne.selectedFloatingWindow="heliodonPanel")})},N=()=>{P||hn(Y.t("message.SimulationStarted",E)),setTimeout(()=>{i(),e("runStaticSimulation",!P),t(se=>{n&&(se.actionInfo={name:"Generate Daily Solar Radiation Heatmap (Static)",timestamp:new Date().getTime()})})},100)},F=()=>{C||hn(Y.t("message.SimulationStarted",E)),setTimeout(()=>{i(),e("runDynamicSimulation",!C),t(se=>{n&&(se.actionInfo={name:"Generate Daily Solar Radiation Heatmap (Dynamic)",timestamp:new Date().getTime()})})},100)},U=se=>{t(ne=>{ne.objectTypeToAdd=se,ne.groupActionMode=!1,ne.actionModeLock=!1}),Fn.getState().setEnableOrbitController(!1),ht.getState().setSelectButtonClicked(!1),i()},O=se=>{switch(se){case z.Human:case z.Tree:case z.Flower:case z.Sensor:case z.SolarPanel:case z.ParabolicDish:case z.ParabolicTrough:case z.FresnelReflector:case z.Heliostat:case z.WindTurbine:case z.VerticalAxisWindTurbine:case z.Light:case z.Wall:case z.Window:return!0;default:return!1}},B=(se,ne,fe,ge)=>{const de=O(se),Z=()=>Y.t(`toolbar.Add${ge??se.replaceAll(" ","")}`,E)+(de?` +`+(a?Y.t("toolbar.ClickToUnlockThisModeForNextAction",E):Y.t("toolbar.DoubleClickToLockThisModeForNextAction",E)):"");return h.jsxs(h.Fragment,{children:[h.jsx("img",{title:Z(),alt:se,src:ne,height:36,width:36,style:{filter:d===se||fe?JT:pv,cursor:"pointer",verticalAlign:"middle"},onClick:()=>{U(se)},onDoubleClick:()=>{de&&t(he=>{he.actionModeLock=!0})}}),(d===se||fe)&&de&&a&&h.jsx("img",{alt:"Tiny lock",src:Zmo,style:{marginLeft:"-2px",filter:d===se||fe?JT:pv,verticalAlign:"top"}})]})},_=se=>h.jsx(jw,{menu:se,trigger:["click"],children:h.jsx("span",{title:Y.t("toolbar.ClickForMoreButtons",E),style:{cursor:"pointer",verticalAlign:"middle",fontSize:"10px",marginLeft:"4px",width:"10px",height:"36px",color:"#666666",fontWeight:"bold"},children:"▼"})}),X=[{key:"add-foundation",label:h.jsx(Zc,{objectType:z.Foundation,srcImg:eIe,setFlag:x})},{key:"add-cuboid",label:h.jsx(Zc,{objectType:z.Cuboid,srcImg:tIe,setFlag:x})},{key:"add-tree",label:h.jsx(Zc,{objectType:z.Tree,srcImg:dIe,setFlag:x})},{key:"add-flower",label:h.jsx(Zc,{objectType:z.Flower,srcImg:fIe,setFlag:x})},{key:"add-human",label:h.jsx(Zc,{objectType:z.Human,srcImg:hIe,setFlag:x,replacingText:"People"})}],$=[{key:"add-wall",label:h.jsx(Zc,{objectType:z.Wall,srcImg:oIe,setFlag:R})},{key:"add-window",label:h.jsx(Zc,{objectType:z.Window,srcImg:rIe,setFlag:R})},{key:"add-door",label:h.jsx(Zc,{objectType:z.Door,srcImg:iIe,setFlag:R})},{key:"add-pyramid-roof",label:h.jsx(Zc,{objectType:z.PyramidRoof,srcImg:aIe,setFlag:R})},{key:"add-hip-roof",label:h.jsx(Zc,{objectType:z.HipRoof,srcImg:lIe,setFlag:R})},{key:"add-gable-roof",label:h.jsx(Zc,{objectType:z.GableRoof,srcImg:uIe,setFlag:R})},{key:"add-gambrel-roof",label:h.jsx(Zc,{objectType:z.GambrelRoof,srcImg:sIe,setFlag:R})},{key:"add-mansard-roof",label:h.jsx(Zc,{objectType:z.MansardRoof,srcImg:cIe,setFlag:R})}],Q=[{key:"add-solar-panel",label:h.jsx(Zc,{objectType:z.SolarPanel,srcImg:xfe,setFlag:D})},{key:"add-parabolic-trough",label:h.jsx(Zc,{objectType:z.ParabolicTrough,srcImg:pIe,setFlag:D})},{key:"add-parabolic-dish",label:h.jsx(Zc,{objectType:z.ParabolicDish,srcImg:gIe,setFlag:D})},{key:"add-fresnel-reflector",label:h.jsx(Zc,{objectType:z.FresnelReflector,srcImg:mIe,setFlag:D})},{key:"add-heliostat",label:h.jsx(Zc,{objectType:z.Heliostat,srcImg:bfe,setFlag:D})},{key:"add-wind-turbine",label:h.jsx(Zc,{objectType:z.WindTurbine,srcImg:yIe,setFlag:D})},{key:"add-sensor",label:h.jsx(Zc,{objectType:z.Sensor,srcImg:nIe,setFlag:D})},{key:"add-light",label:h.jsx(Zc,{objectType:z.Light,srcImg:AIe,setFlag:D})},{key:"add-water-heater",label:h.jsx(Zc,{objectType:z.WaterHeater,srcImg:vIe,setFlag:D})},{key:"add-battery-storage",label:h.jsx(Zc,{objectType:z.BatteryStorage,srcImg:wIe,setFlag:D})}],le=se=>{switch(se){case z.Foundation:return B(se,eIe,H.getState().addedFoundationId);case z.Cuboid:return B(se,tIe,H.getState().addedCuboidId);case z.Tree:return B(se,dIe);case z.Flower:return B(se,fIe);case z.Human:return B(se,hIe,void 0,"People")}},q=se=>{switch(se){case z.Wall:return B(se,oIe,H.getState().addedWallId);case z.Window:return B(se,rIe,H.getState().addedWindowId);case z.Door:return B(se,iIe,H.getState().addedDoorId);case z.PyramidRoof:return B(z.PyramidRoof,aIe);case z.HipRoof:return B(z.HipRoof,lIe);case z.GableRoof:return B(z.GableRoof,uIe);case z.GambrelRoof:return B(z.GambrelRoof,sIe);case z.MansardRoof:return B(z.MansardRoof,cIe)}},te=se=>{switch(se){case z.SolarPanel:return B(se,xfe);case z.ParabolicTrough:return B(se,pIe);case z.ParabolicDish:return B(se,gIe);case z.FresnelReflector:return B(se,mIe);case z.Heliostat:return B(se,bfe);case z.Sensor:return B(se,nIe);case z.WindTurbine:return B(se,yIe);case z.VerticalAxisWindTurbine:return B(se,tyo);case z.Light:return B(se,AIe);case z.WaterHeater:return B(se,vIe);case z.BatteryStorage:return B(se,wIe)}},re=()=>d===z.None&&!f&&!p&&!g&&!y&&!w&&!v,ae=()=>{!s||me.hasMovingParts(o)?F():N()};return h.jsxs("div",{children:[h.jsx(F4,{children:h.jsx("img",{title:Y.t("toolbar.Select",E),alt:"Select",src:eyo,height:36,width:36,style:{filter:re()?JT:pv,cursor:"pointer",verticalAlign:"middle"},onClick:W})}),h.jsx(F4,{children:h.jsx("img",{title:Y.t("toolbar.ManipulateGroup",E),alt:"Group",src:nyo,height:36,width:36,style:{filter:v?JT:pv,cursor:"pointer",verticalAlign:"middle"},onClick:j})}),h.jsxs(F4,{children:[le(A),_({items:X})]}),h.jsxs(F4,{children:[q(S),_({items:$})]}),h.jsxs(F4,{children:[te(M),_({items:Q})]}),h.jsx(F4,{children:h.jsx("img",{title:Y.t("toolbar.ClearScene",E),alt:"Clear",src:oyo,height:36,width:36,color:"#666666",style:{cursor:"pointer"},onClick:L})}),h.jsx(F4,{children:h.jsx("img",{title:Y.t("toolbar.SpatialAnalysisOfEnergy",E),alt:"Spatial analysis",src:iyo,height:36,width:36,color:"#666666",style:{filter:c?JT:pv,cursor:"pointer",verticalAlign:"middle"},onClick:()=>{c?ht.getState().set(se=>{se.showSolarRadiationHeatmap=!1,se.showHeatFluxes=!1}):T()>oje?Oi.confirm({title:Y.t("message.CalculationMayBeSlowDoYouWantToContinue",E)+" ("+Y.t("message.IncreaseSolarRadiationHeatmapGridCellSizeToSpeedUp",E)+")",icon:h.jsx(QW,{}),onOk:()=>{ae()},onCancel:()=>{},okText:`${Y.t("word.Yes",E)}`,cancelText:`${Y.t("word.No",E)}`}):ae()}})}),h.jsx(F4,{children:h.jsx("img",{title:Y.t("toolbar.ShowSunAndTimeSettings",E),alt:"Heliodon",src:ryo,height:36,width:36,color:"#666666",style:{filter:l?JT:pv,cursor:"pointer",verticalAlign:"middle"},onClick:k})})]})}),lyo=Ro.div` position: absolute; top: 0; right: 10px; @@ -7171,7 +7171,7 @@ PERFORMANCE OF THIS SOFTWARE. align-items: center; user-select: none; z-index: 9; -`,syo=be.memo(({signIn:t,signOut:e})=>{const n=H(mp),o=ht(Bq),r=Jt(),i=[{key:"account",label:h.jsx(rn,{noPadding:!0,onClick:()=>{ht.getState().set(a=>{a.showAccountSettingsPanel=!0})},children:Y.t("avatarMenu.AccountSettings",r)})},{key:"signOut",label:h.jsx(rn,{noPadding:!0,onClick:e,children:Y.t("avatarMenu.SignOut",r)})}];return h.jsx(lyo,{children:h.jsxs(en,{direction:"horizontal",children:[!o&&h.jsx(ayo,{}),h.jsx("div",{style:{verticalAlign:"top"},children:n.displayName?h.jsx(jw,{menu:{items:i},trigger:["click"],children:h.jsx("a",{className:"ant-dropdown-link",onClick:a=>a.preventDefault(),title:Y.t("tooltip.clickToAccessAccountSettings",r),children:h.jsx(KGe,{size:32,src:n.photoURL,alt:n.displayName})})}):h.jsx(Al,{title:h.jsx("div",{onClick:a=>a.stopPropagation(),children:Y.t("avatarMenu.PrivacyStatementTitle",r)}),content:h.jsxs("div",{style:{width:"280px",fontSize:"12px"},children:[Y.t("avatarMenu.PrivacyStatement",r),h.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://intofuture.org/aladdin-privacy.html",children:Y.t("aboutUs.PrivacyPolicy",r)}),"."]}),children:h.jsx(lo,{type:"primary",onClick:t,children:Y.t("avatarMenu.SignIn",r)})})})]})})}),cyo=be.memo(({saveToCloud:t,isLoading:e,setTitle:n,getTitle:o,setTitleDialogVisible:r,isTitleDialogVisible:i})=>{const a=H(fn),[l,s]=m.useState(!1),[c,u]=m.useState({left:0,top:0,bottom:0,right:0}),d=m.useRef(null),f=Jt(),p=(w,b)=>{if(d.current){const{clientWidth:C,clientHeight:P}=window.document.documentElement,v=d.current.getBoundingClientRect();u({left:-v.left+b.x,right:C-(v.right-b.x),top:-v.top+b.y,bottom:P-((v==null?void 0:v.bottom)-b.y)})}},g=()=>{t(o(),!1,!0),a(w=>{w.showCloudFileTitleDialogFlag=!w.showCloudFileTitleDialogFlag,w.showCloudFileTitleDialog=!1})},y=()=>{r(!1),a(w=>{w.showCloudFileTitleDialogFlag=!w.showCloudFileTitleDialogFlag,w.showCloudFileTitleDialog=!1})};return h.jsx(Oi,{width:500,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>s(!0),onMouseOut:()=>s(!1),children:Y.t("menu.file.SaveAsCloudFile",f)}),open:i(),footer:[h.jsx(lo,{onClick:y,children:Y.t("word.Cancel",f)},"Cancel"),h.jsx(lo,{type:"primary",onClick:g,disabled:!o(),children:Y.t("word.OK",f)},"OK")],confirmLoading:e(),onCancel:y,modalRender:w=>h.jsx(_i,{disabled:!l,bounds:c,onStart:(b,C)=>p(b,C),children:h.jsx("div",{ref:d,children:w})}),children:h.jsxs(en,{direction:"horizontal",children:[h.jsxs("span",{children:[Y.t("word.Title",f),":"]}),h.jsx(as,{style:{width:"400px"},placeholder:"Title",value:o(),onPressEnter:g,onKeyDown:w=>{if(!aR.test(w.key))return w.preventDefault(),!1},onChange:w=>{n(w.target.value)}})]})})}),{Column:Zae}=Fd,uyo=Ro.div` +`,syo=be.memo(({signIn:t,signOut:e})=>{const n=H(mp),o=ht(Yq),r=Jt(),i=[{key:"account",label:h.jsx(rn,{noPadding:!0,onClick:()=>{ht.getState().set(a=>{a.showAccountSettingsPanel=!0})},children:Y.t("avatarMenu.AccountSettings",r)})},{key:"signOut",label:h.jsx(rn,{noPadding:!0,onClick:e,children:Y.t("avatarMenu.SignOut",r)})}];return h.jsx(lyo,{children:h.jsxs(en,{direction:"horizontal",children:[!o&&h.jsx(ayo,{}),h.jsx("div",{style:{verticalAlign:"top"},children:n.displayName?h.jsx(jw,{menu:{items:i},trigger:["click"],children:h.jsx("a",{className:"ant-dropdown-link",onClick:a=>a.preventDefault(),title:Y.t("tooltip.clickToAccessAccountSettings",r),children:h.jsx(KGe,{size:32,src:n.photoURL,alt:n.displayName})})}):h.jsx(Al,{title:h.jsx("div",{onClick:a=>a.stopPropagation(),children:Y.t("avatarMenu.PrivacyStatementTitle",r)}),content:h.jsxs("div",{style:{width:"280px",fontSize:"12px"},children:[Y.t("avatarMenu.PrivacyStatement",r),h.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://intofuture.org/aladdin-privacy.html",children:Y.t("aboutUs.PrivacyPolicy",r)}),"."]}),children:h.jsx(lo,{type:"primary",onClick:t,children:Y.t("avatarMenu.SignIn",r)})})})]})})}),cyo=be.memo(({saveToCloud:t,isLoading:e,setTitle:n,getTitle:o,setTitleDialogVisible:r,isTitleDialogVisible:i})=>{const a=H(fn),[l,s]=m.useState(!1),[c,u]=m.useState({left:0,top:0,bottom:0,right:0}),d=m.useRef(null),f=Jt(),p=(w,b)=>{if(d.current){const{clientWidth:C,clientHeight:P}=window.document.documentElement,v=d.current.getBoundingClientRect();u({left:-v.left+b.x,right:C-(v.right-b.x),top:-v.top+b.y,bottom:P-((v==null?void 0:v.bottom)-b.y)})}},g=()=>{t(o(),!1,!0),a(w=>{w.showCloudFileTitleDialogFlag=!w.showCloudFileTitleDialogFlag,w.showCloudFileTitleDialog=!1})},y=()=>{r(!1),a(w=>{w.showCloudFileTitleDialogFlag=!w.showCloudFileTitleDialogFlag,w.showCloudFileTitleDialog=!1})};return h.jsx(Oi,{width:500,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>s(!0),onMouseOut:()=>s(!1),children:Y.t("menu.file.SaveAsCloudFile",f)}),open:i(),footer:[h.jsx(lo,{onClick:y,children:Y.t("word.Cancel",f)},"Cancel"),h.jsx(lo,{type:"primary",onClick:g,disabled:!o(),children:Y.t("word.OK",f)},"OK")],confirmLoading:e(),onCancel:y,modalRender:w=>h.jsx(_i,{disabled:!l,bounds:c,onStart:(b,C)=>p(b,C),children:h.jsx("div",{ref:d,children:w})}),children:h.jsxs(en,{direction:"horizontal",children:[h.jsxs("span",{children:[Y.t("word.Title",f),":"]}),h.jsx(as,{style:{width:"400px"},placeholder:"Title",value:o(),onPressEnter:g,onKeyDown:w=>{if(!aR.test(w.key))return w.preventDefault(),!1},onChange:w=>{n(w.target.value)}})]})})}),{Column:Zae}=Fd,uyo=Ro.div` position: fixed; top: 90px; right: 40px; @@ -7211,7 +7211,7 @@ PERFORMANCE OF THIS SOFTWARE. justify-content: space-between; align-items: center; cursor: move; -`,hyo=be.memo(({projects:t,setProjectState:e,deleteProject:n,renameProject:o})=>{const r=H(mp),i=H(fn),a=H(Pc),l=be.useRef(null),s=m.useRef(null),c=s.current?s.current.clientWidth+40:680,u=s.current?s.current.clientHeight+100:600,[d,f]=m.useState({x:0,y:0}),[p,g]=m.useState(!1),[y,w]=m.useState(!1),[b,C]=m.useState({left:0,top:0,bottom:0,right:0}),[P,v]=m.useState(),[T,A]=m.useState(),x=m.useRef(null),S=m.useRef([...t]),[R,M]=m.useState(!1),[D,E]=m.useState(-1),{Search:W}=as,{t:j}=Vl(),L=Jt();m.useEffect(()=>{const _=()=>{f({x:Math.max(0,c-window.innerWidth),y:Math.min(0,window.innerHeight-u)})};return window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}},[]),m.useEffect(()=>{t&&(S.current=[...t],M(!R))},[t]);const k=(_,X)=>{f({x:Math.max(X.x,c-window.innerWidth),y:Math.min(X.y,window.innerHeight-u)})},N=(_,X)=>{},F=()=>{ht.getState().set(_=>{_.showProjectListPanel=!1})},U=_=>{Oi.confirm({title:j("projectListPanel.DoYouReallyWantToDeleteProject",L)+' "'+_+'"?',content:h.jsxs("span",{style:{color:"red",fontWeight:"bold"},children:[h.jsx(hX,{style:{marginRight:"6px"}}),j("word.Warning",L)+": "+j("message.ThisCannotBeUndone",L)]}),icon:h.jsx($W,{}),onOk:()=>{n(_)}})},O=()=>{P&&T&&(o(P,T),A(void 0),M(!R)),g(!1)},B=(_,X)=>{if(x.current){const{clientWidth:$,clientHeight:Q}=window.document.documentElement,le=x.current.getBoundingClientRect();C({left:-le.left+X.x,right:$-(le.right-X.x),top:-le.top+X.y,bottom:Q-((le==null?void 0:le.bottom)-X.y)})}};return h.jsxs(h.Fragment,{children:[h.jsx(Oi,{title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>w(!0),onMouseOut:()=>w(!1),children:j("word.Rename",L)}),open:p,onOk:O,onCancel:()=>{g(!1),A(void 0)},modalRender:_=>h.jsx(_i,{disabled:!y,bounds:b,onStart:(X,$)=>B(X,$),children:h.jsx("div",{ref:x,children:_})}),children:h.jsxs(en,{direction:"vertical",style:{width:"100%"},children:[h.jsx(as,{placeholder:"Title",value:T||P,onPressEnter:O,onKeyDown:_=>{if(!aR.test(_.key))return _.preventDefault(),!1},onChange:_=>{A(_.target.value)}}),h.jsxs("span",{style:{fontSize:"11px",color:"red"},children:[h.jsx(hX,{style:{marginRight:"4px"}}),j("word.Caution",L)+": "+j("projectListPanel.IfSharedOrPublishedRenamingProjectBreaksExistingLinks",L),"."]})]})}),h.jsx(_i,{nodeRef:l,handle:".handle",bounds:"parent",axis:"both",position:d,onDrag:k,onStop:N,onMouseDown:()=>{i(_=>{_.selectedFloatingWindow="projectListPanel"})},children:h.jsx(uyo,{ref:l,style:{zIndex:a==="projectListPanel"?Sc:14},children:h.jsxs(dyo,{ref:s,children:[h.jsxs(fyo,{className:"handle",style:{direction:"ltr"},children:[h.jsx("span",{children:j("projectListPanel.MyProjects",L)+" ("+S.current.length+")"}),h.jsx("span",{style:{cursor:"pointer"},onMouseDown:()=>{F()},onTouchStart:()=>{F()},children:j("word.Close",L)})]}),h.jsx("span",{style:{direction:"ltr"},children:h.jsx(W,{style:{width:"50%",paddingTop:"8px",paddingBottom:"8px"},title:j("projectListPanel.SearchByTitle",L),allowClear:!0,size:"small",enterButton:!0,onSearch:_=>{var X;if(t){S.current=[];for(const $ of t)(X=$.title)!=null&&X.toLowerCase().includes(_.toLowerCase())&&S.current.push($);M(!R)}}})}),h.jsxs(Fd,{size:"small",style:{width:"100%",direction:"ltr",verticalAlign:"top"},dataSource:S.current,scroll:{y:360},pagination:{defaultPageSize:10,showSizeChanger:!0,position:["bottomCenter"],pageSizeOptions:["10","20","50"]},children:[h.jsx(Zae,{title:`${j("word.Title",L)}`,dataIndex:"title",width:"50%",sortDirections:["ascend","descend","ascend"],sorter:(_,X)=>_.title.localeCompare(X.title),render:(_,X,$)=>{const Q=[{key:"project-title",label:h.jsxs(h.Fragment,{children:[h.jsx(rn,{noPadding:!0,fontWeight:"bold",children:_}),h.jsx("hr",{})]})},{key:"open-project",label:h.jsx(rn,{noPadding:!0,onClick:()=>e(X),children:j("word.Open",L)})},{key:"copy-title-to-clip-board",label:h.jsx(rn,{noPadding:!0,onClick:()=>{navigator.clipboard.writeText(_).then(()=>S2(j("projectListPanel.TitleCopiedToClipBoard",L)+"."))},children:j("projectListPanel.CopyTitle",L)})},{key:"rename-project",label:h.jsx(rn,{noPadding:!0,onClick:()=>{v(_),g(!0)},children:j("word.Rename",L)})},{key:"delete-project",label:h.jsx(rn,{noPadding:!0,onClick:()=>U(_),children:j("word.Delete",L)})},{key:"generate-project-link",label:h.jsx(rn,{noPadding:!0,onClick:()=>{const le=t1+"?client=web&userid="+r.uid+"&project="+encodeURIComponent(_);navigator.clipboard.writeText(le).then(()=>S2(j("projectListPanel.ProjectLinkGeneratedInClipBoard",L)+"."))},children:j("projectListPanel.GenerateProjectLink",L)})}];return h.jsxs(en,{style:{width:"100%"},children:[h.jsx(jw,{menu:{items:Q},trigger:["hover"],children:h.jsx(YKe,{style:{fontSize:"12px",cursor:"pointer"},onMouseEnter:()=>{$!==void 0&&E($)},onMouseLeave:()=>{E(-1)}})}),h.jsx(F6.Text,{title:j("word.Open",L),style:{fontSize:"12px",cursor:"pointer",verticalAlign:"top"},onClick:()=>{const le=window.getSelection();le&&le.toString().length>0||e(X)},children:_})]})},onCell:(_,X)=>({style:{background:D===X?"lightskyblue":X!==void 0&&X%2===0?"beige":"gainsboro"}})},"title"),h.jsx(Zae,{title:`${j("word.Type",L)}`,dataIndex:"type",width:"25%",render:_=>h.jsx(F6.Text,{style:{fontSize:"12px",verticalAlign:"top"},children:_}),onCell:(_,X)=>({style:{background:D===X?"lightskyblue":X!==void 0&&X%2===0?"beige":"gainsboro"}})},"type"),h.jsx(Zae,{title:`${j("word.Time",L)}`,dataIndex:"time",width:"25%",defaultSortOrder:"descend",sortDirections:["ascend","descend","ascend"],sorter:(_,X)=>_.timestamp-X.timestamp,render:_=>h.jsx(F6.Text,{style:{fontSize:"12px",verticalAlign:"top"},children:_}),onCell:(_,X)=>({style:{background:D===X?"lightskyblue":X!==void 0&&X%2===0?"beige":"gainsboro"}})},"time")]})]})})})]})}),Am=(t,e,n)=>{m.useEffect(()=>{t&&(e(),n())},[t])},pyo=be.memo(({viewOnly:t=!1,canvas:e})=>{const n=H(fn),o=ht(xh),r=H(mp),i=H(Tc),a=H(Sb),l=H(jq),s=H(w8t),c=H(qBe),u=ht(y7t),d=ht(I7t),f=ht(z7t),p=ht(D7t),g=ht(Bq),y=H(Pb),w=ht(rwt),b=ht(iwt),C=ht(dwt),P=ht(fwt),v=ht(pwt),T=ht(gwt),A=ht(mwt),x=H(nwt),S=H(GBe),R=H(Ige),M=H($Be),D=ht(_Be),E=H(ywt),W=H(JBe),j=ht(awt),L=ht(lwt),k=ht(swt),N=ht(cwt),F=ht(uwt),[U,O]=m.useState(!1),[B,_]=m.useState(!1),[X,$]=m.useState(y??"My Aladdin File"),[Q,le]=m.useState(!1),q=m.useRef(),te=m.useRef([]),[re,ae]=m.useState([]),[se,ne]=m.useState(!1),fe=m.useRef(),[ge,de]=m.useState([]),[Z,he]=m.useState(!1),xe=Jt();Am(w,ve,()=>o("saveAccountSettingsFlag",!1)),Am(b,Ze,()=>o("saveCloudFileFlag",!1)),Am(C,St,()=>o("modelsMapFlag",!1)),Am(P,Pt,()=>o("leaderboardFlag",!1)),Am(v,Rt,()=>o("publishOnModelsMapFlag",!1)),Am(j,Ut,()=>o("createProjectFlag",!1)),Am(L,Ht,()=>o("saveProjectAsFlag",!1)),Am(N,dt,()=>o("showProjectsFlag",!1)),Am(F,Ct,()=>o("updateProjectsFlag",!1)),Am(T,kt,()=>o("listCloudFilesFlag",!1)),Am(A,gt,()=>o("refreshCloudFilesFlag",!1)),Am(k,At,()=>o("curateDesignToProjectFlag",!1)),m.useEffect(()=>{const tt={apiKey:"AIzaSyD-236qE4ix9TkH2AW_wjKSz8jgK0ukjW0",authDomain:"aladdin-316017.firebaseapp.com",projectId:"aladdin-316017",storageBucket:"aladdin-316017.appspot.com",databaseURL:"https://aladdin-316017.firebaseio.com",messagingSenderId:"169516488625",appId:"1:169516488625:web:bb0ae3c3f7c6e813250f90"};let Fe=$n.apps.length===0;return $n.apps.length===1&&$n.apps[0].name===sG.LOG_DATA&&(Fe=!0),Fe?$n.initializeApp(tt):$n.app(),$n.auth().onAuthStateChanged(qe=>{const rt=new URLSearchParams(window.location.search).get("title");n(qe?mt=>{mt.user&&(mt.user.uid=qe.uid,mt.user.displayName=qe.displayName,mt.user.email=qe.email,mt.user.photoURL=qe.photoURL),mt.cloudFile=rt??void 0}:mt=>{mt.cloudFile=rt??void 0})}),Se(),window.addEventListener("popstate",He),()=>{window.removeEventListener("popstate",He)}},[]);const He=()=>{if(t)return;const tt=new URLSearchParams(window.location.search),Fe=tt.get("userid"),qe=tt.get("title");Fe&&qe&&ot(Fe,qe,!0)};m.useEffect(()=>{r.uid&&te.current.length===0&&LVn(r.uid,te.current).then(()=>{})},[r.uid]),m.useEffect(()=>{if(se){if(te.current.length>0&&r.uid){const tt=[];te.current.forEach((Fe,qe)=>{tt.push({title:Fe.title,timestamp:Fe.timestamp})}),tt.sort((Fe,qe)=>qe.timestamp-Fe.timestamp),ae(tt)}ne(!1)}},[se]),m.useEffect(()=>{if(Z){if(fe.current){const tt=[];fe.current.forEach((Fe,qe)=>{tt.push({key:qe.toString(),owner:Fe.owner,title:Fe.title,time:yc(new Date(Fe.timestamp)).format("MM/DD/YYYY hh:mm A"),timestamp:Fe.timestamp,description:Fe.description,dataColoring:Fe.dataColoring,selectedProperty:Fe.selectedProperty,sortDescending:Fe.sortDescending,xAxisNameScatterPlot:Fe.xAxisNameScatterPlot,yAxisNameScatterPlot:Fe.yAxisNameScatterPlot,dotSizeScatterPlot:Fe.dotSizeScatterPlot,thumbnailWidth:Fe.thumbnailWidth,type:Fe.type,designs:Fe.designs,ranges:Fe.ranges??[],filters:Fe.filters??[],hiddenParameters:Fe.hiddenParameters??pd.getDefaultHiddenParameters(Fe.type),counter:Fe.counter,action:""})}),tt.sort((Fe,qe)=>qe.timestamp-Fe.timestamp),de(tt)}he(!1)}},[Z]),m.useEffect(()=>{if(q.current=new Map,r.aliases&&r.aliases.length>0){for(const tt of r.aliases)if(tt!==r.displayName){const Fe=W.get(tt);Fe&&(q.current=new Map([...q.current,...Fe]))}}if(r.displayName){const tt=W.get(r.displayName);tt&&(q.current=new Map([...q.current,...tt]))}},[W,r.displayName,r.aliases]),m.useEffect(()=>{le(x)},[S]),m.useEffect(()=>{$(y??"My Aladdin File")},[y]);const Se=()=>{const tt=new URLSearchParams(window.location.search),Fe=tt.get("userid");if(Fe){const qe=tt.get("title"),je=tt.get("project");je?(O(!0),Ynt(Fe,je,ke).finally(()=>{O(!1)}),qe&&Ye(Fe,qe)):qe&&ot(Fe,qe)}else n(qe=>{qe.cloudFile=void 0});Ie().then(()=>{})},ze=()=>{n(tt=>{tt.objectTypeToAdd=z.None,tt.groupActionMode=!1})},Ie=async()=>{await $n.firestore().collection("app").doc("info").get().then(tt=>{if(tt.exists){const Fe=tt.data();Fe&&Fe.latestVersion&&ht.getState().set(qe=>{qe.latestVersion=Fe.latestVersion})}}).catch(tt=>{console.log(tt)})},ye=()=>{const tt=new $n.auth.GoogleAuthProvider;$n.auth().signInWithPopup(tt).then(Fe=>{n(qe=>{Fe.user&&(qe.user.uid=Fe.user.uid,qe.user.email=Fe.user.email,qe.user.displayName=Fe.user.displayName,qe.user.photoURL=Fe.user.photoURL,ce({...qe.user}).then(()=>{}))})}).catch(Fe=>{Fe.code!=="auth/popup-closed-by-user"&&Fe.code!=="auth/cancelled-popup-request"&&po(Y.t("message.CannotSignIn",xe)+": "+Fe)}),ze()},ce=async tt=>{const Fe=$n.firestore();let qe=!1,je=!1,rt=sc.UNKNOWN,mt=Va.UNKNOWN,Qe=[],Tt=[],Dt=[],lt=[],zt=!1,Ft=0;tt.uid!==null&&(tt&&tt.email==="charles@intofuture.org"&&await Fe.collection("users").get().then(tn=>{Ft=tn.size}),zt=await Fe.collection("users").doc(tt.uid).get().then(tn=>{const Qt=tn.data();return Qt?(qe=!!Qt.signFile,je=!!Qt.noLogging,rt=Qt.schoolID?Qt.schoolID:sc.UNKNOWN,mt=Qt.classID?Qt.classID:Va.UNKNOWN,Qt.fileList&&(Qe=Qt.fileList),Qt.likes&&(Tt=Qt.likes),Qt.published&&(Dt=Qt.published),Qt.aliases&&(lt=Qt.aliases),!0):!1})),zt?(n(_t=>{_t.user.signFile=qe,_t.user.noLogging=je,_t.user.schoolID=rt,_t.user.classID=mt,_t.user.fileList=Qe,_t.user.likes=Tt,_t.user.published=Dt,_t.user.aliases=lt}),ht.getState().set(_t=>{_t.userCount=Ft}),tt.signFile=qe,tt.noLogging=je,tt.schoolID=rt,tt.classID=mt,tt.fileList=Qe,tt.likes=Tt,tt.published=Dt,tt.aliases=lt):tt.uid&&Fe.collection("users").doc(tt.uid).set({uid:tt.uid,signFile:!!tt.signFile,noLogging:!!tt.noLogging,schoolID:tt.schoolID??sc.UNKNOWN,classID:tt.classID??Va.UNKNOWN,since:yc(new Date).format("MM/DD/YYYY hh:mm A"),os:me.getOS()}).then(()=>{hn(Y.t("message.YourAccountWasCreated",xe))}).catch(_t=>{po(Y.t("message.CannotCreateAccount",xe)+": "+_t)})},pe=()=>{$n.auth().signOut().then(()=>{n(tt=>{tt.user.uid=null,tt.user.email=null,tt.user.displayName=null,tt.user.photoURL=null,tt.user.signFile=!1,tt.user.fileList=[],tt.user.likes=[],tt.user.published=[],tt.user.aliases=[],tt.cloudFile=void 0}),ht.getState().set(tt=>{tt.showCloudFilePanel=!1,tt.showAccountSettingsPanel=!1,tt.showModelsGallery=!1,tt.showProjectListPanel=!1})}).catch(tt=>{po(Y.t("message.CannotSignOut",xe)+": "+tt)})};function ve(){r.uid&&$n.firestore().collection("users").doc(r.uid).update({signFile:!!r.signFile,schoolID:r.schoolID??sc.UNKNOWN,classID:r.classID??Va.UNKNOWN}).then(()=>{hn(Y.t("message.YourAccountSettingsWereSaved",xe))}).catch(Fe=>{po(Y.t("message.CannotSaveYourAccountSettings",xe)+": "+Fe)})}const Ae=async()=>{O(!0),await $n.firestore().collection("models").get().then(tt=>{const Fe=new Map;return tt.forEach(qe=>{var rt;const je=qe.data();if(je){const mt=new Map;for(const Qe in je)je[Qe].countryCode||(rt=je[Qe].address)!=null&&rt.endsWith("USA")&&(je[Qe].countryCode="US"),mt.set(Qe,je[Qe]);Fe.set(qe.id,mt)}}),n(qe=>{qe.modelSites=Fe}),Fe}).catch(tt=>{po(Y.t("message.CannotLoadModelsOnMap",xe)+": "+tt)}).finally(()=>{O(!1)})},Te=async()=>{await $n.firestore().collection("board").doc("info").get().then(tt=>{if(tt.exists){const Fe=tt.data();Fe&&Fe.latestModel&&n(qe=>{var mt;let je=!1;const rt=Fe.latestModel;rt.author&&(je=!!((mt=qe.peopleModels.get(rt.author))!=null&&mt.get(me.getModelKey(rt)))),qe.latestModelSite=je?rt:void 0})}}).catch(tt=>{console.log(tt)})},Me=async()=>{O(!0),await $n.firestore().collection("board").doc("people").get().then(tt=>{const Fe=tt.data();if(Fe){const qe=new Map;for(const je in Fe)qe.set(je,new Map(Object.entries(Fe[je])));n(je=>{je.peopleModels=qe})}}).catch(tt=>{po(Y.t("message.CannotLoadLeaderboard",xe)+": "+tt)}).finally(()=>{O(!1)})},Pe=(tt,Fe)=>{r&&r.uid&&($n.firestore().collection("models").doc(me.getLatLngKey(tt.latitude,tt.longitude)).update({[me.getModelKey(tt)]:$n.firestore.FieldValue.delete()}).then(()=>{S2(Y.t("message.ModelDeletedFromMap",xe)),Fe&&Fe()}).catch(qe=>{po(Y.t("message.CannotDeleteModelFromMap",xe)+": "+qe)}),$n.firestore().collection("board").doc("people").update({[(tt.author??"Anonymous")+"."+me.getModelKey(tt)]:$n.firestore.FieldValue.delete()}).then(()=>{n(qe=>{qe.peopleModels&&(qe.peopleModels.delete(me.getModelKey(tt)),ht.getState().set(je=>{je.leaderboardFlag=!0}))})}),$n.firestore().collection("users").doc(r.uid).update({published:$n.firestore.FieldValue.arrayRemove(tt.title)}).then(()=>{n(qe=>{if(qe.user&&qe.user.published&&qe.user.published.includes(tt.title)){const je=qe.user.published.indexOf(tt.title);je>=0&&qe.user.published.splice(je,1)}})}))},Ee=(tt,Fe,qe)=>{if(r&&r.uid){const je=me.getModelKey(tt);$n.firestore().collection("users").doc(r.uid).update(Fe?{likes:$n.firestore.FieldValue.arrayUnion(je)}:{likes:$n.firestore.FieldValue.arrayRemove(je)}).then(()=>{}).catch(mt=>{po(Y.t("message.CannotLikeModelFromMap",xe)+": "+mt)});const rt=je+".likeCount";$n.firestore().collection("models").doc(me.getLatLngKey(tt.latitude,tt.longitude)).update(Fe?{[rt]:$n.firestore.FieldValue.increment(1)}:{[rt]:$n.firestore.FieldValue.increment(-1)}).then(()=>{qe&&qe()}).catch(mt=>{po(Y.t("message.CannotLikeModelFromMap",xe)+": "+mt)})}},Be=(tt,Fe,qe)=>{r&&r.uid&&$n.firestore().collection("models").doc(me.getLatLngKey(tt.latitude,tt.longitude)).update({[me.getModelKey(tt)+".pinned"]:Fe}).then(()=>{qe&&qe()}).catch(()=>{})},Je=tt=>{r&&r.uid&&$n.firestore().collection("models").doc(me.getLatLngKey(tt.latitude,tt.longitude)).update({[me.getModelKey(tt)+".clickCount"]:$n.firestore.FieldValue.increment(1)}).then(()=>{}).catch(()=>{})},We=async tt=>{r.uid&&(tt||O(!0),fe.current=await $n.firestore().collection("users").doc(r.uid).collection("projects").get().then(Fe=>{const qe=[];return Fe.forEach(je=>{const rt=je.data();qe.push({owner:r.uid,title:je.id,timestamp:rt.timestamp,description:rt.description,dataColoring:rt.dataColoring,selectedProperty:rt.selectedProperty,sortDescending:rt.sortDescending,xAxisNameScatterPlot:rt.xAxisNameScatterPlot,yAxisNameScatterPlot:rt.yAxisNameScatterPlot,dotSizeScatterPlot:rt.dotSizeScatterPlot,thumbnailWidth:rt.thumbnailWidth,type:rt.type,designs:rt.designs??[],ranges:rt.ranges??[],filters:rt.filters??[],hiddenParameters:rt.hiddenParameters??pd.getDefaultHiddenParameters(rt.type),counter:rt.counter??0})}),qe}).catch(Fe=>{po(Y.t("message.CannotOpenYourProjects",xe)+": "+Fe)}).finally(()=>{tt||O(!1),he(!0)}))},Ke=tt=>{r.uid&&We(!tt).then(()=>{tt&&ht.getState().set(Fe=>{Fe.showProjectListPanel=!0})})},Ne=tt=>{r.uid&&$n.firestore().collection("users").doc(r.uid).collection("projects").doc(tt).delete().then(()=>{if(fe.current&&r.uid){for(const Fe of fe.current)if(Fe.title===tt&&Fe.designs){for(const qe of Fe.designs)n(je=>{qe.title===je.cloudFile&&(je.cloudFile=void 0)}),$n.firestore().collection("users").doc(r.uid).collection("designs").doc(qe.title).delete().then(()=>{}).catch(je=>{po(Y.t("message.CannotDeleteCloudFile",xe)+": "+je)});he(!0);break}fe.current=fe.current.filter(Fe=>Fe.title!==tt),_(!B)}n(Fe=>{tt===Fe.projectState.title&&(Fe.projectState.title=null,Fe.projectState.description=null,Fe.projectState.dataColoring=d9.ALL,Fe.projectState.selectedProperty=null,Fe.projectState.sortDescending=!1,Fe.projectState.xAxisNameScatterPlot=null,Fe.projectState.yAxisNameScatterPlot=null,Fe.projectState.dotSizeScatterPlot=5,Fe.projectState.thumbnailWidth=200,Fe.projectState.counter=0,Fe.projectState.designs=[],Fe.projectState.ranges=[],Fe.projectState.filters=[],Fe.projectState.hiddenParameters=pd.getDefaultHiddenParameters(Fe.projectState.type),Fe.designProjectType=null,Fe.projectView=!1)})}).catch(Fe=>{po(Y.t("message.CannotDeleteProject",xe)+": "+Fe)})},De=(tt,Fe)=>{const qe=r.uid;qe&&Pae(qe,Fe,je=>{po(Y.t("message.CannotOpenCloudFile",xe)+": "+je)}).then(je=>{if(je)hn(Y.t("message.TitleUsedChooseDifferentOne",xe)+": "+Fe);else{const rt=$n.firestore().collection("users").doc(qe).collection("projects");rt.doc(tt).get().then(mt=>{if(mt.exists){const Qe=mt.data();if(Qe){const Tt={...Qe};if(Qe.designs&&Qe.designs.length>0){const Dt=WCe(Fe,Qe.designs)??[];for(const[lt,zt]of Qe.designs.entries())NCe(zt.title,Dt[lt].title,Qe.owner,qe);Tt.designs=Dt,n(lt=>{lt.projectState.designs=Dt})}rt.doc(Fe).set(Tt).then(()=>{if(rt.doc(tt).delete().then(()=>{}),fe.current){const Dt=[];for(const lt of fe.current)lt.title===tt?Dt.push({owner:lt.owner,timestamp:lt.timestamp,title:Fe,description:lt.description,type:lt.type,designs:lt.designs,ranges:lt.ranges??null,filters:lt.filters??null,hiddenParameters:lt.hiddenParameters,counter:lt.counter}):Dt.push(lt);fe.current=Dt,_(!B),he(!0)}n(Dt=>{Dt.projectState.title===tt&&(Dt.projectState.title=Fe)})})}}}).catch(mt=>{po(Y.t("message.CannotRenameProject",xe)+": "+mt)})}})},ke=tt=>{n(Fe=>{Fe.projectState={...tt},Fe.projectImages.clear(),Fe.projectView=!0}),ht.getState().set(Fe=>{Fe.projectImagesUpdateFlag=!Fe.projectImagesUpdateFlag,Fe.updateProjectsFlag=!0})},Ye=(tt,Fe)=>{tt&&Fe&&(O(!0),XX(tt,Fe,!0,!0,t).finally(()=>{O(!1)}))},it=(tt,Fe,qe,je)=>{if(!r.uid||!e)return;const rt=me.resizeCanvas(e,je).toDataURL(),mt=Ont(tt,qe,rt);$n.firestore().collection("users").doc(r.uid).collection("projects").doc(Fe).update({designs:$n.firestore.FieldValue.arrayUnion(mt),counter:$n.firestore.FieldValue.increment(1)}).then(()=>{n(Qe=>{var Tt;(Tt=Qe.projectState.designs)==null||Tt.push(mt),Qe.projectState.counter++,Qe.designProjectType=Qe.projectState.type,Qe.cloudFile=mt.title}),Xe(qe,!0,!0)}).catch(Qe=>{po(Y.t("message.CannotAddDesignToProject",xe)+": "+Qe)}).finally(()=>{O(!1)})},Ve=(tt,Fe,qe)=>{if(!r.uid)return;const je=tt.trim();if(je.length===0){po(Y.t("menu.file.SavingAbortedMustHaveValidTitle",xe)+".");return}O(!0),qe?UCe(r.uid,tt,rt=>{po(Y.t("message.CannotOpenCloudFile",xe)+": "+rt)}).then(rt=>{rt?(O(!1),Oi.confirm({title:`${Y.t("message.CloudFileWithTitleExistsDoYouWantToOverwrite",xe)}`,icon:h.jsx($W,{}),onOk:()=>{Xe(je,Fe)},onCancel:()=>{n(mt=>{mt.showCloudFileTitleDialogFlag=!mt.showCloudFileTitleDialogFlag,mt.showCloudFileTitleDialog=!0})},okText:`${Y.t("word.Yes",xe)}`,cancelText:`${Y.t("word.No",xe)}`})):Xe(je,Fe)}):Xe(je,Fe),le(!1)},yt=(tt,Fe)=>{if(te.current.length>0){let qe=-1;for(const[je,rt]of te.current.entries())if(rt.title===Fe){qe=je,BCe(tt,rt);break}qe!==-1&&te.current.splice(qe,1)}},ct=(tt,Fe,qe)=>{if(te.current.length>0){let je=-1,rt=null,mt=null;for(const[Qe,Tt]of te.current.entries())if(Tt.title===Fe){je=Qe,rt={title:Fe,timestamp:Tt.timestamp},mt={title:qe,timestamp:Tt.timestamp};break}je!==-1&&mt&&rt&&(te.current.splice(je,1),te.current.push(mt),BCe(tt,rt),jCe(tt,mt))}},Xe=(tt,Fe,qe)=>{const je=r.uid;if(je)try{const rt=$n.firestore().collection("users").doc(je);if(rt){E&&ht.getState().set(Qe=>{Qe.waiting=!0});const mt=rt.collection(qe?"designs":"files").doc(tt);mt.set(c()).then(()=>{if(Fe||(n(Qe=>{Qe.cloudFile=tt}),ht.getState().setChanged(!1)),E)E==="CREATE_NEW_FILE"?M():R(E);else if(!qe){const Qe=t1+"?client=web&userid="+je+"&title="+encodeURIComponent(tt);window.history.pushState({},document.title,Qe)}mt.get().then(Qe=>{const Tt=Qe.data();if(Tt&&te.current.length>0){yt(je,tt);const Dt={timestamp:Tt.timestamp,title:tt};te.current.push(Dt),jCe(je,Dt),ne(!0)}})}).catch(Qe=>{po(Y.t("message.CannotSaveYourFileToCloud",xe)+": "+Qe)}).finally(()=>{O(!1)})}}catch(rt){po(Y.t("message.CannotSaveYourFileToCloud",xe)+": "+rt),O(!1)}},ut=(tt,Fe)=>{D?Oi.confirm({title:`${Y.t("message.DoYouWantToSaveChanges",xe)}`,icon:h.jsx(ny,{}),onOk:()=>{y?(Ve(y,!0,!1),ot(tt,Fe)):n(qe=>{qe.showCloudFileTitleDialogFlag=!qe.showCloudFileTitleDialogFlag,qe.showCloudFileTitleDialog=!0})},onCancel:()=>{ot(tt,Fe)},okText:`${Y.t("word.Yes",xe)}`,cancelText:`${Y.t("word.No",xe)}`}):ot(tt,Fe)},ft=tt=>{D?Oi.confirm({title:`${Y.t("message.DoYouWantToSaveChanges",xe)}`,icon:h.jsx(ny,{}),onOk:()=>{y?(Ve(y,!0,!1),ot(tt.userid,tt.title),Je(tt)):n(Fe=>{Fe.showCloudFileTitleDialogFlag=!Fe.showCloudFileTitleDialogFlag,Fe.showCloudFileTitleDialog=!0})},onCancel:()=>{ot(tt.userid,tt.title),Je(tt)},okText:`${Y.t("word.Yes",xe)}`,cancelText:`${Y.t("word.No",xe)}`}):(ot(tt.userid,tt.title),Je(tt))},ot=(tt,Fe,qe)=>{tt&&Fe&&(O(!0),XX(tt,Fe,!1,qe,t).finally(()=>{O(!1)}))},st=async tt=>{const Fe=r.uid;Fe&&(O(!0),te.current=[],await $n.firestore().collection("users").doc(Fe).get().then(async qe=>{var rt,mt;const je=(rt=qe.data())==null?void 0:rt.fileList;!tt&&je&&je.length>0?(mt=te.current)==null||mt.push(...je):await $n.firestore().collection("users").doc(Fe).collection("files").get().then(Qe=>{Qe.forEach(Tt=>{var lt;const Dt=Tt.data();(lt=te.current)==null||lt.push({timestamp:Dt.timestamp,title:Tt.id})})}).catch(Qe=>{po(Y.t("message.CannotOpenCloudFolder",xe)+": "+Qe)}).finally(()=>{$n.firestore().collection("users").doc(Fe).update({fileList:te.current}).then(()=>{}).catch(Qe=>{console.log(Qe)})})}).finally(()=>{O(!1),ne(!0)}))},at=(tt,Fe)=>{$n.firestore().collection("users").doc(tt).collection("files").doc(Fe).delete().then(()=>{yt(tt,Fe),ae(re.filter(qe=>qe.title!==Fe)),n(qe=>{Fe===qe.cloudFile&&(qe.cloudFile=void 0)})}).catch(qe=>{po(Y.t("message.CannotDeleteCloudFile",xe)+": "+qe)})},Oe=(tt,Fe,qe)=>{UCe(tt,qe,je=>{po(Y.t("message.CannotOpenCloudFile",xe)+": "+je)}).then(je=>{if(je)hn(Y.t("message.TitleUsedChooseDifferentOne",xe)+": "+qe);else{const rt=$n.firestore().collection("users").doc(tt).collection("files");rt.doc(Fe).get().then(mt=>{if(mt.exists){const Qe=mt.data();Qe&&rt.doc(qe).set(Qe).then(()=>{rt.doc(Fe).delete().then(()=>{}).catch(Dt=>{po(Y.t("message.CannotDeleteCloudFile",xe)+" "+Fe+": "+Dt)});for(const Dt of re)if(Dt.title===Fe){Dt.title=qe;break}ae([...re]),ct(tt,Fe,qe),n(Dt=>{Dt.cloudFile===Fe&&(Dt.cloudFile=qe)});const Tt=new URLSearchParams(window.location.search);if(Tt.get("title")===Fe&&Tt.get("userid")===r.uid){const Dt=t1+"?client=web&userid="+r.uid+"&title="+encodeURIComponent(qe);window.history.pushState({},document.title,Dt)}})}}).catch(mt=>{po(Y.t("message.CannotRenameCloudFile",xe)+": "+mt)})}})};function Ze(){y&&(Ve(y,!1,!1),$(y))}function St(){Ae().then(()=>{Te().then(()=>{})})}function Pt(){Me().then(()=>{Te().then(()=>{})})}function Rt(){if(r&&r.uid&&X){const tt=new URLSearchParams(window.location.search);if(tt.get("userid")===r.uid&&tt.get("title")===X){const Fe={latitude:i,longitude:a,address:l??null,countryCode:s??null,type:H.getState().modelType,author:H.getState().modelAuthor??r.displayName,userid:r.uid,title:X,label:H.getState().modelLabel,description:H.getState().modelDescription,timeCreated:Date.now()},qe=me.getModelKey(Fe),je=$n.firestore().collection("models");if(je){const rt=$n.storage().ref();e&&me.resizeCanvas(e,200).toBlob(Qe=>{if(Qe){const Tt={contentType:"image/png"},Dt=rt.child("images/"+qe+".png").put(Qe,Tt);Dt.on($n.storage.TaskEvent.STATE_CHANGED,lt=>{const zt=lt.bytesTransferred/lt.totalBytes*100;zt>0&&hn(Y.t("word.Upload",xe)+": "+zt+"%")},lt=>{po("Storage: "+lt)},()=>{Dt.snapshot.ref.getDownloadURL().then(lt=>{const zt={...Fe,thumbnailUrl:lt},Ft=je.doc(me.getLatLngKey(i,a));Ft.get().then(_t=>{if(_t.exists){const tn=_t.data();tn&&tn[qe]?Ft.set({[qe]:zt},{merge:!0}).then(()=>{S2(Y.t("menu.file.UpdatedOnModelsMap",xe)+".")}):Ft.set({[qe]:zt},{merge:!0}).then(()=>{S2(Y.t("menu.file.PublishedOnModelsMap",xe)+".")})}else Ft.set({[qe]:zt},{merge:!0}).then(()=>{S2(Y.t("menu.file.PublishedOnModelsMap",xe)+".")})}).catch(_t=>{po(Y.t("message.CannotPublishModelOnMap",xe)+": "+_t)}),$n.firestore().collection("board").doc("people").update({[(zt.author??"Anonymous")+"."+me.getModelKey(zt)]:zt}).then(()=>{n(_t=>{if(_t.peopleModels){const tn=_t.peopleModels.get(zt.author??"Anonymous");tn&&tn.set(me.getModelKey(zt),zt)}})}),$n.firestore().collection("board").doc("info").set({latestModel:zt},{merge:!0}).then(()=>{})})})}})}$n.firestore().collection("users").doc(r.uid).update(H.getState().modelAuthor===r.displayName?{published:$n.firestore.FieldValue.arrayUnion(X)}:{published:$n.firestore.FieldValue.arrayUnion(X),aliases:$n.firestore.FieldValue.arrayUnion(H.getState().modelAuthor)}).then(()=>{n(rt=>{rt.user&&(rt.user.published||(rt.user.published=[]),rt.user.published.includes(X)||rt.user.published.push(X),rt.user.aliases||(rt.user.aliases=[]),rt.modelAuthor&&!rt.user.aliases.includes(rt.modelAuthor)&&rt.modelAuthor!==r.displayName&&rt.user.aliases.push(rt.modelAuthor))})})}}}function Ut(){if(!r||!r.uid)return;const tt=ht.getState().projectTitle;if(!tt){po(Y.t("message.CannotCreateNewProjectWithoutTitle",xe)+".");return}const Fe=tt.trim();if(Fe.length===0){po(Y.t("message.CannotCreateNewProjectWithoutTitle",xe)+".");return}Pae(r.uid,Fe,qe=>{po(Y.t("message.CannotOpenCloudFile",xe)+": "+qe)}).then(qe=>{if(qe)hn(Y.t("message.TitleUsedChooseDifferentOne",xe)+": "+Fe);else if(r&&r.uid){const je=ht.getState().projectType??Pi.SOLAR_PANEL_ARRAY,rt=ht.getState().projectDescription??null,mt=new Date().getTime();$n.firestore().collection("users").doc(r.uid).collection("projects").doc(Fe).set({owner:r.uid,timestamp:mt,type:je,description:rt,counter:0,designs:[],hiddenParameters:pd.getDefaultHiddenParameters(je)}).then(()=>{n(Tt=>{Tt.projectView=!0,Tt.projectState.owner=r.uid,Tt.projectState.type=je,Tt.projectState.title=tt,Tt.projectState.description=rt,Tt.projectState.counter=0,Tt.projectState.dataColoring=d9.ALL,Tt.projectState.selectedProperty=null,Tt.projectState.sortDescending=!1,Tt.projectState.xAxisNameScatterPlot=null,Tt.projectState.yAxisNameScatterPlot=null,Tt.projectState.dotSizeScatterPlot=5,Tt.projectState.thumbnailWidth=200,Tt.projectState.designs=[],Tt.projectState.ranges=[],Tt.projectState.filters=[],Tt.projectState.hiddenParameters=pd.getDefaultHiddenParameters(Tt.projectState.type)})}).catch(Tt=>{po(Y.t("message.CannotCreateNewProject",xe)+": "+Tt)}).finally(()=>{d&&We(!1).then(()=>{_(!B)}),O(!1)})}}).finally(()=>{O(!1)})}function Ht(){if(!r||!r.uid)return;const tt=ht.getState().projectTitle;if(!tt){po(Y.t("message.CannotCreateNewProjectWithoutTitle",xe)+".");return}const Fe=tt.trim();if(Fe.length===0){po(Y.t("message.CannotCreateNewProjectWithoutTitle",xe)+".");return}Pae(r.uid,Fe,qe=>{po(Y.t("message.CannotOpenCloudFile",xe)+": "+qe)}).then(qe=>{if(qe)hn(Y.t("message.TitleUsedChooseDifferentOne",xe)+": "+Fe);else if(r&&r.uid){const je=H.getState().projectState.designs;if(je){const rt=ht.getState().projectType,mt=ht.getState().projectDescription,Qe=H.getState().projectState.owner,Tt=new Date().getTime(),Dt=H.getState().projectState.counter,lt=H.getState().projectState.dataColoring??null,zt=H.getState().projectState.selectedProperty??null,Ft=!!H.getState().projectState.sortDescending,_t=H.getState().projectState.xAxisNameScatterPlot??"rowWidth",tn=H.getState().projectState.yAxisNameScatterPlot??"rowWidth",Qt=H.getState().projectState.dotSizeScatterPlot??5,gn=H.getState().projectState.thumbnailWidth??200,an=WCe(Fe,je)??[];for(const[Hn,Fo]of je.entries())NCe(Fo.title,an[Hn].title,Qe,r.uid);const mn=H.getState().projectImages;if(mn&&mn.size>0){for(const[Hn,Fo]of je.entries()){const yo=mn.get(Fo.title);yo&&(an[Hn].thumbnail=EVn(yo))}$n.firestore().collection("users").doc(r.uid).collection("projects").doc(Fe).set({owner:r.uid,timestamp:Tt,type:rt,description:mt,counter:Dt,dataColoring:lt,selectedProperty:zt,sortDescending:Ft,xAxisNameScatterPlot:_t,yAxisNameScatterPlot:tn,dotSizeScatterPlot:Qt,thumbnailWidth:gn,designs:an,ranges:H.getState().projectState.ranges??null,filters:H.getState().projectState.filters??null,hiddenParameters:H.getState().projectState.hiddenParameters}).then(()=>{n(Hn=>{Hn.projectView=!0,Hn.projectState.owner=r.uid,Hn.projectState.type=rt,Hn.projectState.title=tt,Hn.projectState.description=mt,Hn.projectState.designs=an})}).catch(Hn=>{po(Y.t("message.CannotCreateNewProject",xe)+": "+Hn)}).finally(()=>{d&&We(!1).then(()=>{_(!B)}),O(!1)})}}}})}function At(){const tt=H.getState().projectState.owner;if(r.uid!==tt)hn(Y.t("message.CannotAddDesignToProjectOwnedByOthers",xe));else{const Fe=H.getState().projectState.title;if(Fe){O(!0);const qe=H.getState().projectState.type??Pi.SOLAR_PANEL_ARRAY,je=H.getState().projectState.thumbnailWidth??200,rt=H.getState().projectState.counter??0;it(qe,Fe,Fe+" "+rt,je)}}}function kt(){r.uid&&st(!1).then(()=>{ht.getState().set(tt=>{tt.showCloudFilePanel=!0})})}function gt(){r.uid&&st(!0).then(()=>{})}function dt(){Ke(!0)}function Ct(){Ke(!1),_(!B)}return t?h.jsx(h.Fragment,{children:g&&h.jsx(QMe,{openCloudFile:ft,deleteModelFromMap:Pe,likeModelFromMap:Ee,pinModelFromMap:Be})}):h.jsxs(h.Fragment,{children:[U&&h.jsx(LQ,{}),h.jsx(cyo,{saveToCloud:Ve,isLoading:()=>U,setTitle:$,getTitle:()=>X,setTitleDialogVisible:le,isTitleDialogVisible:()=>Q}),h.jsx(syo,{signIn:ye,signOut:pe}),u&&te.current.length>0&&h.jsx(E1o,{cloudFileArray:re,openCloudFile:tt=>{r.uid&&ut(r.uid,tt)},deleteCloudFile:tt=>{r.uid&&at(r.uid,tt)},renameCloudFile:(tt,Fe)=>{r.uid&&Oe(r.uid,tt,Fe)}}),d&&fe.current&&h.jsx(hyo,{projects:ge,setProjectState:ke,deleteProject:Ne,renameProject:De}),f&&h.jsx(Zrt,{author:void 0,models:q.current,openCloudFile:ut,closeCallback:()=>{o("showModelsGallery",!1),q.current=void 0}}),p&&h.jsx(X1o,{openCloudFile:ot}),g&&h.jsx(QMe,{openCloudFile:ft,deleteModelFromMap:Pe,likeModelFromMap:Ee,pinModelFromMap:Be})]})});var gyo={},myo="@firebase/database",yyo="0.11.0";/** +`,hyo=be.memo(({projects:t,setProjectState:e,deleteProject:n,renameProject:o})=>{const r=H(mp),i=H(da),a=H(fn),l=H(Pc),s=be.useRef(null),c=m.useRef(null),u=c.current?c.current.clientWidth+40:680,d=c.current?c.current.clientHeight+100:600,[f,p]=m.useState({x:0,y:0}),[g,y]=m.useState(!1),[w,b]=m.useState(!1),[C,P]=m.useState({left:0,top:0,bottom:0,right:0}),[v,T]=m.useState(),[A,x]=m.useState(),S=m.useRef(null),R=m.useRef([...t]),[M,D]=m.useState(!1),[E,W]=m.useState(-1),{Search:j}=as,{t:L}=Vl(),k=Jt();m.useEffect(()=>{const X=()=>{p({x:Math.max(0,u-window.innerWidth),y:Math.min(0,window.innerHeight-d)})};return window.addEventListener("resize",X),()=>{window.removeEventListener("resize",X)}},[]),m.useEffect(()=>{t&&(R.current=[...t],D(!M))},[t]);const N=(X,$)=>{p({x:Math.max($.x,u-window.innerWidth),y:Math.min($.y,window.innerHeight-d)})},F=(X,$)=>{},U=()=>{ht.getState().set(X=>{X.showProjectListPanel=!1}),i&&a(X=>{X.actionInfo={name:"Close Project List",timestamp:new Date().getTime()}})},O=X=>{Oi.confirm({title:L("projectListPanel.DoYouReallyWantToDeleteProject",k)+' "'+X+'"?',content:h.jsxs("span",{style:{color:"red",fontWeight:"bold"},children:[h.jsx(pX,{style:{marginRight:"6px"}}),L("word.Warning",k)+": "+L("message.ThisCannotBeUndone",k)]}),icon:h.jsx(QW,{}),onOk:()=>{n(X),i&&a($=>{$.actionInfo={name:"Delete Project",timestamp:new Date().getTime(),details:X}})}})},B=()=>{v&&A&&(o(v,A),x(void 0),D(!M),i&&a(X=>{X.actionInfo={name:"Rename Project",timestamp:new Date().getTime(),details:{oldTitle:v,newTitle:A}}})),y(!1)},_=(X,$)=>{if(S.current){const{clientWidth:Q,clientHeight:le}=window.document.documentElement,q=S.current.getBoundingClientRect();P({left:-q.left+$.x,right:Q-(q.right-$.x),top:-q.top+$.y,bottom:le-((q==null?void 0:q.bottom)-$.y)})}};return h.jsxs(h.Fragment,{children:[h.jsx(Oi,{title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>b(!0),onMouseOut:()=>b(!1),children:L("word.Rename",k)}),open:g,onOk:B,onCancel:()=>{y(!1),x(void 0)},modalRender:X=>h.jsx(_i,{disabled:!w,bounds:C,onStart:($,Q)=>_($,Q),children:h.jsx("div",{ref:S,children:X})}),children:h.jsxs(en,{direction:"vertical",style:{width:"100%"},children:[h.jsx(as,{placeholder:"Title",value:A||v,onPressEnter:B,onKeyDown:X=>{if(!aR.test(X.key))return X.preventDefault(),!1},onChange:X=>{x(X.target.value)}}),h.jsxs("span",{style:{fontSize:"11px",color:"red"},children:[h.jsx(pX,{style:{marginRight:"4px"}}),L("word.Caution",k)+": "+L("projectListPanel.IfSharedOrPublishedRenamingProjectBreaksExistingLinks",k),"."]})]})}),h.jsx(_i,{nodeRef:s,handle:".handle",bounds:"parent",axis:"both",position:f,onDrag:N,onStop:F,onMouseDown:()=>{a(X=>{X.selectedFloatingWindow="projectListPanel"})},children:h.jsx(uyo,{ref:s,style:{zIndex:l==="projectListPanel"?Sc:14},children:h.jsxs(dyo,{ref:c,children:[h.jsxs(fyo,{className:"handle",style:{direction:"ltr"},children:[h.jsx("span",{children:L("projectListPanel.MyProjects",k)+" ("+R.current.length+")"}),h.jsx("span",{style:{cursor:"pointer"},onMouseDown:()=>{U()},onTouchStart:()=>{U()},children:L("word.Close",k)})]}),h.jsx("span",{style:{direction:"ltr"},children:h.jsx(j,{style:{width:"50%",paddingTop:"8px",paddingBottom:"8px"},title:L("projectListPanel.SearchByTitle",k),allowClear:!0,size:"small",enterButton:!0,onSearch:X=>{var $;if(t){R.current=[];for(const Q of t)($=Q.title)!=null&&$.toLowerCase().includes(X.toLowerCase())&&R.current.push(Q);D(!M)}}})}),h.jsxs(Fd,{size:"small",style:{width:"100%",direction:"ltr",verticalAlign:"top"},dataSource:R.current,scroll:{y:360},pagination:{defaultPageSize:10,showSizeChanger:!0,position:["bottomCenter"],pageSizeOptions:["10","20","50"]},children:[h.jsx(Zae,{title:`${L("word.Title",k)}`,dataIndex:"title",width:"50%",sortDirections:["ascend","descend","ascend"],sorter:(X,$)=>X.title.localeCompare($.title),render:(X,$,Q)=>{const le=[{key:"project-title",label:h.jsxs(h.Fragment,{children:[h.jsx(rn,{noPadding:!0,fontWeight:"bold",children:X}),h.jsx("hr",{})]})},{key:"open-project",label:h.jsx(rn,{noPadding:!0,onClick:()=>{e($),i&&a(q=>{q.actionInfo={name:"Open Project",timestamp:new Date().getTime(),details:$.title}})},children:L("word.Open",k)})},{key:"copy-title-to-clip-board",label:h.jsx(rn,{noPadding:!0,onClick:()=>{navigator.clipboard.writeText(X).then(()=>{S2(L("projectListPanel.TitleCopiedToClipBoard",k)+"."),i&&a(q=>{q.actionInfo={name:"Copy Project Title",timestamp:new Date().getTime(),details:X}})})},children:L("projectListPanel.CopyTitle",k)})},{key:"rename-project",label:h.jsx(rn,{noPadding:!0,onClick:()=>{T(X),y(!0)},children:L("word.Rename",k)})},{key:"delete-project",label:h.jsx(rn,{noPadding:!0,onClick:()=>O(X),children:L("word.Delete",k)})},{key:"generate-project-link",label:h.jsx(rn,{noPadding:!0,onClick:()=>{const q=t1+"?client=web&userid="+r.uid+"&project="+encodeURIComponent(X);navigator.clipboard.writeText(q).then(()=>{S2(L("projectListPanel.ProjectLinkGeneratedInClipBoard",k)+"."),i&&a(te=>{te.actionInfo={name:"Generate Project Link",timestamp:new Date().getTime(),details:q}})})},children:L("projectListPanel.GenerateProjectLink",k)})}];return h.jsxs(en,{style:{width:"100%"},children:[h.jsx(jw,{menu:{items:le},trigger:["hover"],children:h.jsx(YKe,{style:{fontSize:"12px",cursor:"pointer"},onMouseEnter:()=>{Q!==void 0&&W(Q)},onMouseLeave:()=>{W(-1)}})}),h.jsx(F6.Text,{title:L("word.Open",k),style:{fontSize:"12px",cursor:"pointer",verticalAlign:"top"},onClick:()=>{const q=window.getSelection();q&&q.toString().length>0||e($)},children:X})]})},onCell:(X,$)=>({style:{background:E===$?"lightskyblue":$!==void 0&&$%2===0?"beige":"gainsboro"}})},"title"),h.jsx(Zae,{title:`${L("word.Type",k)}`,dataIndex:"type",width:"25%",render:X=>h.jsx(F6.Text,{style:{fontSize:"12px",verticalAlign:"top"},children:X}),onCell:(X,$)=>({style:{background:E===$?"lightskyblue":$!==void 0&&$%2===0?"beige":"gainsboro"}})},"type"),h.jsx(Zae,{title:`${L("word.Time",k)}`,dataIndex:"time",width:"25%",defaultSortOrder:"descend",sortDirections:["ascend","descend","ascend"],sorter:(X,$)=>X.timestamp-$.timestamp,render:X=>h.jsx(F6.Text,{style:{fontSize:"12px",verticalAlign:"top"},children:X}),onCell:(X,$)=>({style:{background:E===$?"lightskyblue":$!==void 0&&$%2===0?"beige":"gainsboro"}})},"time")]})]})})})]})}),Am=(t,e,n)=>{m.useEffect(()=>{t&&(e(),n())},[t])},pyo=be.memo(({viewOnly:t=!1,canvas:e})=>{const n=H(fn),o=ht(xh),r=H(mp),i=H(Tc),a=H(Sb),l=H(Bq),s=H(w8t),c=H($Be),u=ht(y7t),d=ht(I7t),f=ht(z7t),p=ht(D7t),g=ht(Yq),y=H(Pb),w=ht(rwt),b=ht(iwt),C=ht(dwt),P=ht(fwt),v=ht(pwt),T=ht(gwt),A=ht(mwt),x=H(nwt),S=H(XBe),R=H(Ige),M=H(QBe),D=ht(VBe),E=H(ywt),W=H(KBe),j=ht(awt),L=ht(lwt),k=ht(swt),N=ht(cwt),F=ht(uwt),[U,O]=m.useState(!1),[B,_]=m.useState(!1),[X,$]=m.useState(y??"My Aladdin File"),[Q,le]=m.useState(!1),q=m.useRef(),te=m.useRef([]),[re,ae]=m.useState([]),[se,ne]=m.useState(!1),fe=m.useRef(),[ge,de]=m.useState([]),[Z,he]=m.useState(!1),xe=Jt();Am(w,ve,()=>o("saveAccountSettingsFlag",!1)),Am(b,Ze,()=>o("saveCloudFileFlag",!1)),Am(C,St,()=>o("modelsMapFlag",!1)),Am(P,Pt,()=>o("leaderboardFlag",!1)),Am(v,Rt,()=>o("publishOnModelsMapFlag",!1)),Am(j,Ut,()=>o("createProjectFlag",!1)),Am(L,Ht,()=>o("saveProjectAsFlag",!1)),Am(N,dt,()=>o("showProjectsFlag",!1)),Am(F,Ct,()=>o("updateProjectsFlag",!1)),Am(T,kt,()=>o("listCloudFilesFlag",!1)),Am(A,gt,()=>o("refreshCloudFilesFlag",!1)),Am(k,At,()=>o("curateDesignToProjectFlag",!1)),m.useEffect(()=>{const tt={apiKey:"AIzaSyD-236qE4ix9TkH2AW_wjKSz8jgK0ukjW0",authDomain:"aladdin-316017.firebaseapp.com",projectId:"aladdin-316017",storageBucket:"aladdin-316017.appspot.com",databaseURL:"https://aladdin-316017.firebaseio.com",messagingSenderId:"169516488625",appId:"1:169516488625:web:bb0ae3c3f7c6e813250f90"};let Fe=$n.apps.length===0;return $n.apps.length===1&&$n.apps[0].name===cG.LOG_DATA&&(Fe=!0),Fe?$n.initializeApp(tt):$n.app(),$n.auth().onAuthStateChanged(qe=>{const rt=new URLSearchParams(window.location.search).get("title");n(qe?mt=>{mt.user&&(mt.user.uid=qe.uid,mt.user.displayName=qe.displayName,mt.user.email=qe.email,mt.user.photoURL=qe.photoURL,ce({...mt.user}).then(()=>{})),mt.cloudFile=rt??void 0}:mt=>{mt.cloudFile=rt??void 0})}),Se(),window.addEventListener("popstate",He),()=>{window.removeEventListener("popstate",He)}},[]);const He=()=>{if(t)return;const tt=new URLSearchParams(window.location.search),Fe=tt.get("userid"),qe=tt.get("title");Fe&&qe&&ot(Fe,qe,!0)};m.useEffect(()=>{r.uid&&te.current.length===0&&LVn(r.uid,te.current).then(()=>{})},[r.uid]),m.useEffect(()=>{if(se){if(te.current.length>0&&r.uid){const tt=[];te.current.forEach((Fe,qe)=>{tt.push({title:Fe.title,timestamp:Fe.timestamp})}),tt.sort((Fe,qe)=>qe.timestamp-Fe.timestamp),ae(tt)}ne(!1)}},[se]),m.useEffect(()=>{if(Z){if(fe.current){const tt=[];fe.current.forEach((Fe,qe)=>{tt.push({key:qe.toString(),owner:Fe.owner,title:Fe.title,time:yc(new Date(Fe.timestamp)).format("MM/DD/YYYY hh:mm A"),timestamp:Fe.timestamp,description:Fe.description,dataColoring:Fe.dataColoring,selectedProperty:Fe.selectedProperty,sortDescending:Fe.sortDescending,xAxisNameScatterPlot:Fe.xAxisNameScatterPlot,yAxisNameScatterPlot:Fe.yAxisNameScatterPlot,dotSizeScatterPlot:Fe.dotSizeScatterPlot,thumbnailWidth:Fe.thumbnailWidth,type:Fe.type,designs:Fe.designs,ranges:Fe.ranges??[],filters:Fe.filters??[],hiddenParameters:Fe.hiddenParameters??pd.getDefaultHiddenParameters(Fe.type),counter:Fe.counter,action:""})}),tt.sort((Fe,qe)=>qe.timestamp-Fe.timestamp),de(tt)}he(!1)}},[Z]),m.useEffect(()=>{if(q.current=new Map,r.aliases&&r.aliases.length>0){for(const tt of r.aliases)if(tt!==r.displayName){const Fe=W.get(tt);Fe&&(q.current=new Map([...q.current,...Fe]))}}if(r.displayName){const tt=W.get(r.displayName);tt&&(q.current=new Map([...q.current,...tt]))}},[W,r.displayName,r.aliases]),m.useEffect(()=>{le(x)},[S]),m.useEffect(()=>{$(y??"My Aladdin File")},[y]);const Se=()=>{const tt=new URLSearchParams(window.location.search),Fe=tt.get("userid");if(Fe){const qe=tt.get("title"),je=tt.get("project");je?(O(!0),Ynt(Fe,je,ke).finally(()=>{O(!1)}),qe&&Ye(Fe,qe)):qe&&ot(Fe,qe)}else n(qe=>{qe.cloudFile=void 0});Ie().then(()=>{})},ze=()=>{n(tt=>{tt.objectTypeToAdd=z.None,tt.groupActionMode=!1})},Ie=async()=>{await $n.firestore().collection("app").doc("info").get().then(tt=>{if(tt.exists){const Fe=tt.data();Fe&&Fe.latestVersion&&ht.getState().set(qe=>{qe.latestVersion=Fe.latestVersion})}}).catch(tt=>{console.log(tt)})},ye=()=>{const tt=new $n.auth.GoogleAuthProvider;$n.auth().signInWithPopup(tt).then(Fe=>{n(qe=>{Fe.user&&(qe.user.uid=Fe.user.uid,qe.user.email=Fe.user.email,qe.user.displayName=Fe.user.displayName,qe.user.photoURL=Fe.user.photoURL,ce({...qe.user}).then(()=>{}))})}).catch(Fe=>{Fe.code!=="auth/popup-closed-by-user"&&Fe.code!=="auth/cancelled-popup-request"&&po(Y.t("message.CannotSignIn",xe)+": "+Fe)}),ze()},ce=async tt=>{const Fe=$n.firestore();let qe=!1,je=!1,rt=sc.UNKNOWN,mt=Va.UNKNOWN,Qe=[],Tt=[],Dt=[],lt=[],zt=!1,Ft=0;tt.uid!==null&&(tt&&tt.email==="charles@intofuture.org"&&await Fe.collection("users").get().then(tn=>{Ft=tn.size}),zt=await Fe.collection("users").doc(tt.uid).get().then(tn=>{const Qt=tn.data();return Qt?(qe=!!Qt.signFile,je=!!Qt.noLogging,rt=Qt.schoolID?Qt.schoolID:sc.UNKNOWN,mt=Qt.classID?Qt.classID:Va.UNKNOWN,Qt.fileList&&(Qe=Qt.fileList),Qt.likes&&(Tt=Qt.likes),Qt.published&&(Dt=Qt.published),Qt.aliases&&(lt=Qt.aliases),!0):!1})),zt?(n(_t=>{_t.user.signFile=qe,_t.user.noLogging=je,_t.user.schoolID=rt,_t.user.classID=mt,_t.user.fileList=Qe,_t.user.likes=Tt,_t.user.published=Dt,_t.user.aliases=lt}),ht.getState().set(_t=>{_t.userCount=Ft}),tt.signFile=qe,tt.noLogging=je,tt.schoolID=rt,tt.classID=mt,tt.fileList=Qe,tt.likes=Tt,tt.published=Dt,tt.aliases=lt):tt.uid&&Fe.collection("users").doc(tt.uid).set({uid:tt.uid,signFile:!!tt.signFile,noLogging:!!tt.noLogging,schoolID:tt.schoolID??sc.UNKNOWN,classID:tt.classID??Va.UNKNOWN,since:yc(new Date).format("MM/DD/YYYY hh:mm A"),os:me.getOS()}).then(()=>{hn(Y.t("message.YourAccountWasCreated",xe))}).catch(_t=>{po(Y.t("message.CannotCreateAccount",xe)+": "+_t)})},pe=()=>{$n.auth().signOut().then(()=>{n(tt=>{tt.user.uid=null,tt.user.email=null,tt.user.displayName=null,tt.user.photoURL=null,tt.user.signFile=!1,tt.user.fileList=[],tt.user.likes=[],tt.user.published=[],tt.user.aliases=[],tt.cloudFile=void 0}),ht.getState().set(tt=>{tt.showCloudFilePanel=!1,tt.showAccountSettingsPanel=!1,tt.showModelsGallery=!1,tt.showProjectListPanel=!1})}).catch(tt=>{po(Y.t("message.CannotSignOut",xe)+": "+tt)})};function ve(){r.uid&&$n.firestore().collection("users").doc(r.uid).update({signFile:!!r.signFile,schoolID:r.schoolID??sc.UNKNOWN,classID:r.classID??Va.UNKNOWN}).then(()=>{hn(Y.t("message.YourAccountSettingsWereSaved",xe))}).catch(Fe=>{po(Y.t("message.CannotSaveYourAccountSettings",xe)+": "+Fe)})}const Ae=async()=>{O(!0),await $n.firestore().collection("models").get().then(tt=>{const Fe=new Map;return tt.forEach(qe=>{var rt;const je=qe.data();if(je){const mt=new Map;for(const Qe in je)je[Qe].countryCode||(rt=je[Qe].address)!=null&&rt.endsWith("USA")&&(je[Qe].countryCode="US"),mt.set(Qe,je[Qe]);Fe.set(qe.id,mt)}}),n(qe=>{qe.modelSites=Fe}),Fe}).catch(tt=>{po(Y.t("message.CannotLoadModelsOnMap",xe)+": "+tt)}).finally(()=>{O(!1)})},Te=async()=>{await $n.firestore().collection("board").doc("info").get().then(tt=>{if(tt.exists){const Fe=tt.data();Fe&&Fe.latestModel&&n(qe=>{var mt;let je=!1;const rt=Fe.latestModel;rt.author&&(je=!!((mt=qe.peopleModels.get(rt.author))!=null&&mt.get(me.getModelKey(rt)))),qe.latestModelSite=je?rt:void 0})}}).catch(tt=>{console.log(tt)})},Me=async()=>{O(!0),await $n.firestore().collection("board").doc("people").get().then(tt=>{const Fe=tt.data();if(Fe){const qe=new Map;for(const je in Fe)qe.set(je,new Map(Object.entries(Fe[je])));n(je=>{je.peopleModels=qe})}}).catch(tt=>{po(Y.t("message.CannotLoadLeaderboard",xe)+": "+tt)}).finally(()=>{O(!1)})},Pe=(tt,Fe)=>{r&&r.uid&&($n.firestore().collection("models").doc(me.getLatLngKey(tt.latitude,tt.longitude)).update({[me.getModelKey(tt)]:$n.firestore.FieldValue.delete()}).then(()=>{S2(Y.t("message.ModelDeletedFromMap",xe)),Fe&&Fe()}).catch(qe=>{po(Y.t("message.CannotDeleteModelFromMap",xe)+": "+qe)}),$n.firestore().collection("board").doc("people").update({[(tt.author??"Anonymous")+"."+me.getModelKey(tt)]:$n.firestore.FieldValue.delete()}).then(()=>{n(qe=>{qe.peopleModels&&(qe.peopleModels.delete(me.getModelKey(tt)),ht.getState().set(je=>{je.leaderboardFlag=!0}))})}),$n.firestore().collection("users").doc(r.uid).update({published:$n.firestore.FieldValue.arrayRemove(tt.title)}).then(()=>{n(qe=>{if(qe.user&&qe.user.published&&qe.user.published.includes(tt.title)){const je=qe.user.published.indexOf(tt.title);je>=0&&qe.user.published.splice(je,1)}})}))},Ee=(tt,Fe,qe)=>{if(r&&r.uid){const je=me.getModelKey(tt);$n.firestore().collection("users").doc(r.uid).update(Fe?{likes:$n.firestore.FieldValue.arrayUnion(je)}:{likes:$n.firestore.FieldValue.arrayRemove(je)}).then(()=>{}).catch(mt=>{po(Y.t("message.CannotLikeModelFromMap",xe)+": "+mt)});const rt=je+".likeCount";$n.firestore().collection("models").doc(me.getLatLngKey(tt.latitude,tt.longitude)).update(Fe?{[rt]:$n.firestore.FieldValue.increment(1)}:{[rt]:$n.firestore.FieldValue.increment(-1)}).then(()=>{qe&&qe()}).catch(mt=>{po(Y.t("message.CannotLikeModelFromMap",xe)+": "+mt)})}},Be=(tt,Fe,qe)=>{r&&r.uid&&$n.firestore().collection("models").doc(me.getLatLngKey(tt.latitude,tt.longitude)).update({[me.getModelKey(tt)+".pinned"]:Fe}).then(()=>{qe&&qe()}).catch(()=>{})},Je=tt=>{r&&r.uid&&$n.firestore().collection("models").doc(me.getLatLngKey(tt.latitude,tt.longitude)).update({[me.getModelKey(tt)+".clickCount"]:$n.firestore.FieldValue.increment(1)}).then(()=>{}).catch(()=>{})},We=async tt=>{r.uid&&(tt||O(!0),fe.current=await $n.firestore().collection("users").doc(r.uid).collection("projects").get().then(Fe=>{const qe=[];return Fe.forEach(je=>{const rt=je.data();qe.push({owner:r.uid,title:je.id,timestamp:rt.timestamp,description:rt.description,dataColoring:rt.dataColoring,selectedProperty:rt.selectedProperty,sortDescending:rt.sortDescending,xAxisNameScatterPlot:rt.xAxisNameScatterPlot,yAxisNameScatterPlot:rt.yAxisNameScatterPlot,dotSizeScatterPlot:rt.dotSizeScatterPlot,thumbnailWidth:rt.thumbnailWidth,type:rt.type,designs:rt.designs??[],ranges:rt.ranges??[],filters:rt.filters??[],hiddenParameters:rt.hiddenParameters??pd.getDefaultHiddenParameters(rt.type),counter:rt.counter??0})}),qe}).catch(Fe=>{po(Y.t("message.CannotOpenYourProjects",xe)+": "+Fe)}).finally(()=>{tt||O(!1),he(!0)}))},Ke=tt=>{r.uid&&We(!tt).then(()=>{tt&&ht.getState().set(Fe=>{Fe.showProjectListPanel=!0})})},Ne=tt=>{r.uid&&$n.firestore().collection("users").doc(r.uid).collection("projects").doc(tt).delete().then(()=>{if(fe.current&&r.uid){for(const Fe of fe.current)if(Fe.title===tt&&Fe.designs){for(const qe of Fe.designs)n(je=>{qe.title===je.cloudFile&&(je.cloudFile=void 0)}),$n.firestore().collection("users").doc(r.uid).collection("designs").doc(qe.title).delete().then(()=>{}).catch(je=>{po(Y.t("message.CannotDeleteCloudFile",xe)+": "+je)});he(!0);break}fe.current=fe.current.filter(Fe=>Fe.title!==tt),_(!B)}n(Fe=>{tt===Fe.projectState.title&&(Fe.projectState.title=null,Fe.projectState.description=null,Fe.projectState.dataColoring=d9.ALL,Fe.projectState.selectedProperty=null,Fe.projectState.sortDescending=!1,Fe.projectState.xAxisNameScatterPlot=null,Fe.projectState.yAxisNameScatterPlot=null,Fe.projectState.dotSizeScatterPlot=5,Fe.projectState.thumbnailWidth=200,Fe.projectState.counter=0,Fe.projectState.designs=[],Fe.projectState.ranges=[],Fe.projectState.filters=[],Fe.projectState.hiddenParameters=pd.getDefaultHiddenParameters(Fe.projectState.type),Fe.designProjectType=null,Fe.projectView=!1)})}).catch(Fe=>{po(Y.t("message.CannotDeleteProject",xe)+": "+Fe)})},De=(tt,Fe)=>{const qe=r.uid;qe&&Pae(qe,Fe,je=>{po(Y.t("message.CannotOpenCloudFile",xe)+": "+je)}).then(je=>{if(je)hn(Y.t("message.TitleUsedChooseDifferentOne",xe)+": "+Fe);else{const rt=$n.firestore().collection("users").doc(qe).collection("projects");rt.doc(tt).get().then(mt=>{if(mt.exists){const Qe=mt.data();if(Qe){const Tt={...Qe};if(Qe.designs&&Qe.designs.length>0){const Dt=NCe(Fe,Qe.designs)??[];for(const[lt,zt]of Qe.designs.entries())UCe(zt.title,Dt[lt].title,Qe.owner,qe);Tt.designs=Dt,n(lt=>{lt.projectState.designs=Dt})}rt.doc(Fe).set(Tt).then(()=>{if(rt.doc(tt).delete().then(()=>{}),fe.current){const Dt=[];for(const lt of fe.current)lt.title===tt?Dt.push({owner:lt.owner,timestamp:lt.timestamp,title:Fe,description:lt.description,type:lt.type,designs:lt.designs,ranges:lt.ranges??null,filters:lt.filters??null,hiddenParameters:lt.hiddenParameters,counter:lt.counter}):Dt.push(lt);fe.current=Dt,_(!B),he(!0)}n(Dt=>{Dt.projectState.title===tt&&(Dt.projectState.title=Fe)})})}}}).catch(mt=>{po(Y.t("message.CannotRenameProject",xe)+": "+mt)})}})},ke=tt=>{n(Fe=>{Fe.projectState={...tt},Fe.projectImages.clear(),Fe.projectView=!0}),ht.getState().set(Fe=>{Fe.projectImagesUpdateFlag=!Fe.projectImagesUpdateFlag,Fe.updateProjectsFlag=!0})},Ye=(tt,Fe)=>{tt&&Fe&&(O(!0),JX(tt,Fe,!0,!0,t).finally(()=>{O(!1)}))},it=(tt,Fe,qe,je)=>{if(!r.uid||!e)return;const rt=me.resizeCanvas(e,je).toDataURL(),mt=Ont(tt,qe,rt);$n.firestore().collection("users").doc(r.uid).collection("projects").doc(Fe).update({designs:$n.firestore.FieldValue.arrayUnion(mt),counter:$n.firestore.FieldValue.increment(1)}).then(()=>{n(Qe=>{var Tt;(Tt=Qe.projectState.designs)==null||Tt.push(mt),Qe.projectState.counter++,Qe.designProjectType=Qe.projectState.type,Qe.cloudFile=mt.title}),Xe(qe,!0,!0)}).catch(Qe=>{po(Y.t("message.CannotAddDesignToProject",xe)+": "+Qe)}).finally(()=>{O(!1)})},Ve=(tt,Fe,qe)=>{if(!r.uid)return;const je=tt.trim();if(je.length===0){po(Y.t("menu.file.SavingAbortedMustHaveValidTitle",xe)+".");return}O(!0),qe?jCe(r.uid,tt,rt=>{po(Y.t("message.CannotOpenCloudFile",xe)+": "+rt)}).then(rt=>{rt?(O(!1),Oi.confirm({title:`${Y.t("message.CloudFileWithTitleExistsDoYouWantToOverwrite",xe)}`,icon:h.jsx(QW,{}),onOk:()=>{Xe(je,Fe)},onCancel:()=>{n(mt=>{mt.showCloudFileTitleDialogFlag=!mt.showCloudFileTitleDialogFlag,mt.showCloudFileTitleDialog=!0})},okText:`${Y.t("word.Yes",xe)}`,cancelText:`${Y.t("word.No",xe)}`})):Xe(je,Fe)}):Xe(je,Fe),le(!1)},yt=(tt,Fe)=>{if(te.current.length>0){let qe=-1;for(const[je,rt]of te.current.entries())if(rt.title===Fe){qe=je,YCe(tt,rt);break}qe!==-1&&te.current.splice(qe,1)}},ct=(tt,Fe,qe)=>{if(te.current.length>0){let je=-1,rt=null,mt=null;for(const[Qe,Tt]of te.current.entries())if(Tt.title===Fe){je=Qe,rt={title:Fe,timestamp:Tt.timestamp},mt={title:qe,timestamp:Tt.timestamp};break}je!==-1&&mt&&rt&&(te.current.splice(je,1),te.current.push(mt),YCe(tt,rt),BCe(tt,mt))}},Xe=(tt,Fe,qe)=>{const je=r.uid;if(je)try{const rt=$n.firestore().collection("users").doc(je);if(rt){E&&ht.getState().set(Qe=>{Qe.waiting=!0});const mt=rt.collection(qe?"designs":"files").doc(tt);mt.set(c()).then(()=>{if(Fe||(n(Qe=>{Qe.cloudFile=tt}),ht.getState().setChanged(!1)),E)E==="CREATE_NEW_FILE"?M():R(E);else if(!qe){const Qe=t1+"?client=web&userid="+je+"&title="+encodeURIComponent(tt);window.history.pushState({},document.title,Qe)}mt.get().then(Qe=>{const Tt=Qe.data();if(Tt&&te.current.length>0){yt(je,tt);const Dt={timestamp:Tt.timestamp,title:tt};te.current.push(Dt),BCe(je,Dt),ne(!0)}})}).catch(Qe=>{po(Y.t("message.CannotSaveYourFileToCloud",xe)+": "+Qe)}).finally(()=>{O(!1)})}}catch(rt){po(Y.t("message.CannotSaveYourFileToCloud",xe)+": "+rt),O(!1)}},ut=(tt,Fe)=>{D?Oi.confirm({title:`${Y.t("message.DoYouWantToSaveChanges",xe)}`,icon:h.jsx(ny,{}),onOk:()=>{y?(Ve(y,!0,!1),ot(tt,Fe)):n(qe=>{qe.showCloudFileTitleDialogFlag=!qe.showCloudFileTitleDialogFlag,qe.showCloudFileTitleDialog=!0})},onCancel:()=>{ot(tt,Fe)},okText:`${Y.t("word.Yes",xe)}`,cancelText:`${Y.t("word.No",xe)}`}):ot(tt,Fe)},ft=tt=>{D?Oi.confirm({title:`${Y.t("message.DoYouWantToSaveChanges",xe)}`,icon:h.jsx(ny,{}),onOk:()=>{y?(Ve(y,!0,!1),ot(tt.userid,tt.title),Je(tt)):n(Fe=>{Fe.showCloudFileTitleDialogFlag=!Fe.showCloudFileTitleDialogFlag,Fe.showCloudFileTitleDialog=!0})},onCancel:()=>{ot(tt.userid,tt.title),Je(tt)},okText:`${Y.t("word.Yes",xe)}`,cancelText:`${Y.t("word.No",xe)}`}):(ot(tt.userid,tt.title),Je(tt))},ot=(tt,Fe,qe)=>{tt&&Fe&&(O(!0),JX(tt,Fe,!1,qe,t).finally(()=>{O(!1)}))},st=async tt=>{const Fe=r.uid;Fe&&(O(!0),te.current=[],await $n.firestore().collection("users").doc(Fe).get().then(async qe=>{var rt,mt;const je=(rt=qe.data())==null?void 0:rt.fileList;!tt&&je&&je.length>0?(mt=te.current)==null||mt.push(...je):await $n.firestore().collection("users").doc(Fe).collection("files").get().then(Qe=>{Qe.forEach(Tt=>{var lt;const Dt=Tt.data();(lt=te.current)==null||lt.push({timestamp:Dt.timestamp,title:Tt.id})})}).catch(Qe=>{po(Y.t("message.CannotOpenCloudFolder",xe)+": "+Qe)}).finally(()=>{$n.firestore().collection("users").doc(Fe).update({fileList:te.current}).then(()=>{}).catch(Qe=>{console.log(Qe)})})}).finally(()=>{O(!1),ne(!0)}))},at=(tt,Fe)=>{$n.firestore().collection("users").doc(tt).collection("files").doc(Fe).delete().then(()=>{yt(tt,Fe),ae(re.filter(qe=>qe.title!==Fe)),n(qe=>{Fe===qe.cloudFile&&(qe.cloudFile=void 0)})}).catch(qe=>{po(Y.t("message.CannotDeleteCloudFile",xe)+": "+qe)})},Oe=(tt,Fe,qe)=>{jCe(tt,qe,je=>{po(Y.t("message.CannotOpenCloudFile",xe)+": "+je)}).then(je=>{if(je)hn(Y.t("message.TitleUsedChooseDifferentOne",xe)+": "+qe);else{const rt=$n.firestore().collection("users").doc(tt).collection("files");rt.doc(Fe).get().then(mt=>{if(mt.exists){const Qe=mt.data();Qe&&rt.doc(qe).set(Qe).then(()=>{rt.doc(Fe).delete().then(()=>{}).catch(Dt=>{po(Y.t("message.CannotDeleteCloudFile",xe)+" "+Fe+": "+Dt)});for(const Dt of re)if(Dt.title===Fe){Dt.title=qe;break}ae([...re]),ct(tt,Fe,qe),n(Dt=>{Dt.cloudFile===Fe&&(Dt.cloudFile=qe)});const Tt=new URLSearchParams(window.location.search);if(Tt.get("title")===Fe&&Tt.get("userid")===r.uid){const Dt=t1+"?client=web&userid="+r.uid+"&title="+encodeURIComponent(qe);window.history.pushState({},document.title,Dt)}})}}).catch(mt=>{po(Y.t("message.CannotRenameCloudFile",xe)+": "+mt)})}})};function Ze(){y&&(Ve(y,!1,!1),$(y))}function St(){Ae().then(()=>{Te().then(()=>{})})}function Pt(){Me().then(()=>{Te().then(()=>{})})}function Rt(){if(r&&r.uid&&X){const tt=new URLSearchParams(window.location.search);if(tt.get("userid")===r.uid&&tt.get("title")===X){const Fe={latitude:i,longitude:a,address:l??null,countryCode:s??null,type:H.getState().modelType,author:H.getState().modelAuthor??r.displayName,userid:r.uid,title:X,label:H.getState().modelLabel,description:H.getState().modelDescription,timeCreated:Date.now()},qe=me.getModelKey(Fe),je=$n.firestore().collection("models");if(je){const rt=$n.storage().ref();e&&me.resizeCanvas(e,200).toBlob(Qe=>{if(Qe){const Tt={contentType:"image/png"},Dt=rt.child("images/"+qe+".png").put(Qe,Tt);Dt.on($n.storage.TaskEvent.STATE_CHANGED,lt=>{const zt=lt.bytesTransferred/lt.totalBytes*100;zt>0&&hn(Y.t("word.Upload",xe)+": "+zt+"%")},lt=>{po("Storage: "+lt)},()=>{Dt.snapshot.ref.getDownloadURL().then(lt=>{const zt={...Fe,thumbnailUrl:lt},Ft=je.doc(me.getLatLngKey(i,a));Ft.get().then(_t=>{if(_t.exists){const tn=_t.data();tn&&tn[qe]?Ft.set({[qe]:zt},{merge:!0}).then(()=>{S2(Y.t("menu.file.UpdatedOnModelsMap",xe)+".")}):Ft.set({[qe]:zt},{merge:!0}).then(()=>{S2(Y.t("menu.file.PublishedOnModelsMap",xe)+".")})}else Ft.set({[qe]:zt},{merge:!0}).then(()=>{S2(Y.t("menu.file.PublishedOnModelsMap",xe)+".")})}).catch(_t=>{po(Y.t("message.CannotPublishModelOnMap",xe)+": "+_t)}),$n.firestore().collection("board").doc("people").update({[(zt.author??"Anonymous")+"."+me.getModelKey(zt)]:zt}).then(()=>{n(_t=>{if(_t.peopleModels){const tn=_t.peopleModels.get(zt.author??"Anonymous");tn&&tn.set(me.getModelKey(zt),zt)}})}),$n.firestore().collection("board").doc("info").set({latestModel:zt},{merge:!0}).then(()=>{})})})}})}$n.firestore().collection("users").doc(r.uid).update(H.getState().modelAuthor===r.displayName?{published:$n.firestore.FieldValue.arrayUnion(X)}:{published:$n.firestore.FieldValue.arrayUnion(X),aliases:$n.firestore.FieldValue.arrayUnion(H.getState().modelAuthor)}).then(()=>{n(rt=>{rt.user&&(rt.user.published||(rt.user.published=[]),rt.user.published.includes(X)||rt.user.published.push(X),rt.user.aliases||(rt.user.aliases=[]),rt.modelAuthor&&!rt.user.aliases.includes(rt.modelAuthor)&&rt.modelAuthor!==r.displayName&&rt.user.aliases.push(rt.modelAuthor))})})}}}function Ut(){if(!r||!r.uid)return;const tt=ht.getState().projectTitle;if(!tt){po(Y.t("message.CannotCreateNewProjectWithoutTitle",xe)+".");return}const Fe=tt.trim();if(Fe.length===0){po(Y.t("message.CannotCreateNewProjectWithoutTitle",xe)+".");return}Pae(r.uid,Fe,qe=>{po(Y.t("message.CannotOpenCloudFile",xe)+": "+qe)}).then(qe=>{if(qe)hn(Y.t("message.TitleUsedChooseDifferentOne",xe)+": "+Fe);else if(r&&r.uid){const je=ht.getState().projectType??Pi.SOLAR_PANEL_ARRAY,rt=ht.getState().projectDescription??null,mt=new Date().getTime();$n.firestore().collection("users").doc(r.uid).collection("projects").doc(Fe).set({owner:r.uid,timestamp:mt,type:je,description:rt,counter:0,designs:[],hiddenParameters:pd.getDefaultHiddenParameters(je)}).then(()=>{n(Tt=>{Tt.projectView=!0,Tt.projectState.owner=r.uid,Tt.projectState.type=je,Tt.projectState.title=tt,Tt.projectState.description=rt,Tt.projectState.counter=0,Tt.projectState.dataColoring=d9.ALL,Tt.projectState.selectedProperty=null,Tt.projectState.sortDescending=!1,Tt.projectState.xAxisNameScatterPlot=null,Tt.projectState.yAxisNameScatterPlot=null,Tt.projectState.dotSizeScatterPlot=5,Tt.projectState.thumbnailWidth=200,Tt.projectState.designs=[],Tt.projectState.ranges=[],Tt.projectState.filters=[],Tt.projectState.hiddenParameters=pd.getDefaultHiddenParameters(Tt.projectState.type)})}).catch(Tt=>{po(Y.t("message.CannotCreateNewProject",xe)+": "+Tt)}).finally(()=>{d&&We(!1).then(()=>{_(!B)}),O(!1)})}}).finally(()=>{O(!1)})}function Ht(){if(!r||!r.uid)return;const tt=ht.getState().projectTitle;if(!tt){po(Y.t("message.CannotCreateNewProjectWithoutTitle",xe)+".");return}const Fe=tt.trim();if(Fe.length===0){po(Y.t("message.CannotCreateNewProjectWithoutTitle",xe)+".");return}Pae(r.uid,Fe,qe=>{po(Y.t("message.CannotOpenCloudFile",xe)+": "+qe)}).then(qe=>{if(qe)hn(Y.t("message.TitleUsedChooseDifferentOne",xe)+": "+Fe);else if(r&&r.uid){const je=H.getState().projectState.designs;if(je){const rt=ht.getState().projectType,mt=ht.getState().projectDescription,Qe=H.getState().projectState.owner,Tt=new Date().getTime(),Dt=H.getState().projectState.counter,lt=H.getState().projectState.dataColoring??null,zt=H.getState().projectState.selectedProperty??null,Ft=!!H.getState().projectState.sortDescending,_t=H.getState().projectState.xAxisNameScatterPlot??"rowWidth",tn=H.getState().projectState.yAxisNameScatterPlot??"rowWidth",Qt=H.getState().projectState.dotSizeScatterPlot??5,gn=H.getState().projectState.thumbnailWidth??200,an=NCe(Fe,je)??[];for(const[Hn,Fo]of je.entries())UCe(Fo.title,an[Hn].title,Qe,r.uid);const mn=H.getState().projectImages;if(mn&&mn.size>0){for(const[Hn,Fo]of je.entries()){const yo=mn.get(Fo.title);yo&&(an[Hn].thumbnail=EVn(yo))}$n.firestore().collection("users").doc(r.uid).collection("projects").doc(Fe).set({owner:r.uid,timestamp:Tt,type:rt,description:mt,counter:Dt,dataColoring:lt,selectedProperty:zt,sortDescending:Ft,xAxisNameScatterPlot:_t,yAxisNameScatterPlot:tn,dotSizeScatterPlot:Qt,thumbnailWidth:gn,designs:an,ranges:H.getState().projectState.ranges??null,filters:H.getState().projectState.filters??null,hiddenParameters:H.getState().projectState.hiddenParameters}).then(()=>{n(Hn=>{Hn.projectView=!0,Hn.projectState.owner=r.uid,Hn.projectState.type=rt,Hn.projectState.title=tt,Hn.projectState.description=mt,Hn.projectState.designs=an})}).catch(Hn=>{po(Y.t("message.CannotCreateNewProject",xe)+": "+Hn)}).finally(()=>{d&&We(!1).then(()=>{_(!B)}),O(!1)})}}}})}function At(){const tt=H.getState().projectState.owner;if(r.uid!==tt)hn(Y.t("message.CannotAddDesignToProjectOwnedByOthers",xe));else{const Fe=H.getState().projectState.title;if(Fe){O(!0);const qe=H.getState().projectState.type??Pi.SOLAR_PANEL_ARRAY,je=H.getState().projectState.thumbnailWidth??200,rt=H.getState().projectState.counter??0;it(qe,Fe,Fe+" "+rt,je)}}}function kt(){r.uid&&st(!1).then(()=>{ht.getState().set(tt=>{tt.showCloudFilePanel=!0})})}function gt(){r.uid&&st(!0).then(()=>{})}function dt(){Ke(!0)}function Ct(){Ke(!1),_(!B)}return t?h.jsx(h.Fragment,{children:g&&h.jsx(ZMe,{openCloudFile:ft,deleteModelFromMap:Pe,likeModelFromMap:Ee,pinModelFromMap:Be})}):h.jsxs(h.Fragment,{children:[U&&h.jsx(LQ,{}),h.jsx(cyo,{saveToCloud:Ve,isLoading:()=>U,setTitle:$,getTitle:()=>X,setTitleDialogVisible:le,isTitleDialogVisible:()=>Q}),h.jsx(syo,{signIn:ye,signOut:pe}),u&&te.current.length>0&&h.jsx(E1o,{cloudFileArray:re,openCloudFile:tt=>{r.uid&&ut(r.uid,tt)},deleteCloudFile:tt=>{r.uid&&at(r.uid,tt)},renameCloudFile:(tt,Fe)=>{r.uid&&Oe(r.uid,tt,Fe)}}),d&&fe.current&&h.jsx(hyo,{projects:ge,setProjectState:ke,deleteProject:Ne,renameProject:De}),f&&h.jsx(Zrt,{author:void 0,models:q.current,openCloudFile:ut,closeCallback:()=>{o("showModelsGallery",!1),q.current=void 0}}),p&&h.jsx(X1o,{openCloudFile:ot}),g&&h.jsx(ZMe,{openCloudFile:ft,deleteModelFromMap:Pe,likeModelFromMap:Ee,pinModelFromMap:Be})]})});var gyo={},myo="@firebase/database",yyo="0.11.0";/** * @license * Copyright 2019 Google LLC * @@ -7286,7 +7286,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var NC=new p2e("@firebase/database"),oit=function(){var t=1;return function(){return t++}}(),rit=function(t){var e=PUn(t),n=new xUn;n.update(e);var o=n.digest();return c2e.encodeByteArray(o)},QN=function(){for(var t=[],e=0;en?o.push(t.substring(r,n)):o.push(t.substring(r,r+e));return o};function Xu(t,e){for(var n in t)t.hasOwnProperty(n)&&e(n,t[n])}var lit=function(t){er(!fee(t),"Invalid JSON number");var e=11,n=52,o=(1<=Math.pow(2,1-o)?(l=Math.min(Math.floor(Math.log(t)/Math.LN2),o),i=l+o,a=Math.round(t*Math.pow(2,n-l)-Math.pow(2,n))):(i=0,a=Math.round(t/Math.pow(2,1-o-n))));var c=[];for(s=n;s;s-=1)c.push(a%2?1:0),a=Math.floor(a/2);for(s=e;s;s-=1)c.push(i%2?1:0),i=Math.floor(i/2);c.push(r?1:0),c.reverse();var u=c.join(""),d="";for(s=0;s<64;s+=8){var f=parseInt(u.substr(s,8),2).toString(16);f.length===1&&(f="0"+f),d=d+f}return d.toLowerCase()},Syo=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},Tyo=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"};function Pyo(t,e){var n="Unknown Error";t==="too_big"?n="The data requested exceeds the maximum size that can be accessed with a single request.":t==="permission_denied"?n="Client doesn't have permission to access the desired data.":t==="unavailable"&&(n="The service is unavailable");var o=new Error(t+" at "+e._path.toString()+": "+n);return o.code=t.toUpperCase(),o}var Cyo=new RegExp("^-?(0*)\\d{1,10}$"),sit=-2147483648,W9e=2147483647,mJ=function(t){if(Cyo.test(t)){var e=Number(t);if(e>=sit&&e<=W9e)return e}return null},CM=function(t){try{t()}catch(e){setTimeout(function(){var n=e.stack||"";throw vf("Exception was thrown by user callback.",n),e},Math.floor(0))}},Ryo=function(){var t=typeof window=="object"&&window.navigator&&window.navigator.userAgent||"";return t.search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},jE=function(t,e){var n=setTimeout(t,e);return typeof n=="object"&&n.unref&&n.unref(),n};/** + */var NC=new g2e("@firebase/database"),oit=function(){var t=1;return function(){return t++}}(),rit=function(t){var e=PUn(t),n=new xUn;n.update(e);var o=n.digest();return u2e.encodeByteArray(o)},ZN=function(){for(var t=[],e=0;en?o.push(t.substring(r,n)):o.push(t.substring(r,r+e));return o};function Xu(t,e){for(var n in t)t.hasOwnProperty(n)&&e(n,t[n])}var lit=function(t){er(!fee(t),"Invalid JSON number");var e=11,n=52,o=(1<=Math.pow(2,1-o)?(l=Math.min(Math.floor(Math.log(t)/Math.LN2),o),i=l+o,a=Math.round(t*Math.pow(2,n-l)-Math.pow(2,n))):(i=0,a=Math.round(t/Math.pow(2,1-o-n))));var c=[];for(s=n;s;s-=1)c.push(a%2?1:0),a=Math.floor(a/2);for(s=e;s;s-=1)c.push(i%2?1:0),i=Math.floor(i/2);c.push(r?1:0),c.reverse();var u=c.join(""),d="";for(s=0;s<64;s+=8){var f=parseInt(u.substr(s,8),2).toString(16);f.length===1&&(f="0"+f),d=d+f}return d.toLowerCase()},Syo=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},Tyo=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"};function Pyo(t,e){var n="Unknown Error";t==="too_big"?n="The data requested exceeds the maximum size that can be accessed with a single request.":t==="permission_denied"?n="Client doesn't have permission to access the desired data.":t==="unavailable"&&(n="The service is unavailable");var o=new Error(t+" at "+e._path.toString()+": "+n);return o.code=t.toUpperCase(),o}var Cyo=new RegExp("^-?(0*)\\d{1,10}$"),sit=-2147483648,N9e=2147483647,yJ=function(t){if(Cyo.test(t)){var e=Number(t);if(e>=sit&&e<=N9e)return e}return null},CM=function(t){try{t()}catch(e){setTimeout(function(){var n=e.stack||"";throw vf("Exception was thrown by user callback.",n),e},Math.floor(0))}},Ryo=function(){var t=typeof window=="object"&&window.navigator&&window.navigator.userAgent||"";return t.search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},jE=function(t,e){var n=setTimeout(t,e);return typeof n=="object"&&n.unref&&n.unref(),n};/** * @license * Copyright 2021 Google LLC * @@ -7331,7 +7331,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var N9e="5",cit="v",uit="s",dit="r",fit="f",hit=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,pit="ls",Iyo="p",Pfe="ac",git="websocket",mit="long_polling";/** + */var U9e="5",cit="v",uit="s",dit="r",fit="f",hit=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,pit="ls",Iyo="p",Pfe="ac",git="websocket",mit="long_polling";/** * @license * Copyright 2017 Google LLC * @@ -7346,7 +7346,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var U9e=function(){function t(e,n,o,r,i,a,l){i===void 0&&(i=!1),a===void 0&&(a=""),l===void 0&&(l=!1),this.secure=n,this.namespace=o,this.webSocketOnly=r,this.nodeAdmin=i,this.persistenceKey=a,this.includeNamespaceInQueryParams=l,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=Kv.get("host:"+e)||this._host}return t.prototype.isCacheableHost=function(){return this.internalHost.substr(0,2)==="s-"},t.prototype.isCustomHost=function(){return this._domain!=="firebaseio.com"&&this._domain!=="firebaseio-demo.com"},Object.defineProperty(t.prototype,"host",{get:function(){return this._host},set:function(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&Kv.set("host:"+this._host,this.internalHost))},enumerable:!1,configurable:!0}),t.prototype.toString=function(){var e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e},t.prototype.toURLString=function(){var e=this.secure?"https://":"http://",n=this.includeNamespaceInQueryParams?"?ns="+this.namespace:"";return""+e+this.host+"/"+n},t}();function zyo(t){return t.host!==t.internalHost||t.isCustomHost()||t.includeNamespaceInQueryParams}function yit(t,e,n){er(typeof e=="string","typeof type must == string"),er(typeof n=="object","typeof params must == object");var o;if(e===git)o=(t.secure?"wss://":"ws://")+t.internalHost+"/.ws?";else if(e===mit)o=(t.secure?"https://":"http://")+t.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);zyo(t)&&(n.ns=t.namespace);var r=[];return Xu(n,function(i,a){r.push(i+"="+a)}),o+r.join("&")}/** + */var j9e=function(){function t(e,n,o,r,i,a,l){i===void 0&&(i=!1),a===void 0&&(a=""),l===void 0&&(l=!1),this.secure=n,this.namespace=o,this.webSocketOnly=r,this.nodeAdmin=i,this.persistenceKey=a,this.includeNamespaceInQueryParams=l,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=Kv.get("host:"+e)||this._host}return t.prototype.isCacheableHost=function(){return this.internalHost.substr(0,2)==="s-"},t.prototype.isCustomHost=function(){return this._domain!=="firebaseio.com"&&this._domain!=="firebaseio-demo.com"},Object.defineProperty(t.prototype,"host",{get:function(){return this._host},set:function(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&Kv.set("host:"+this._host,this.internalHost))},enumerable:!1,configurable:!0}),t.prototype.toString=function(){var e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e},t.prototype.toURLString=function(){var e=this.secure?"https://":"http://",n=this.includeNamespaceInQueryParams?"?ns="+this.namespace:"";return""+e+this.host+"/"+n},t}();function zyo(t){return t.host!==t.internalHost||t.isCustomHost()||t.includeNamespaceInQueryParams}function yit(t,e,n){er(typeof e=="string","typeof type must == string"),er(typeof n=="object","typeof params must == object");var o;if(e===git)o=(t.secure?"wss://":"ws://")+t.internalHost+"/.ws?";else if(e===mit)o=(t.secure?"https://":"http://")+t.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);zyo(t)&&(n.ns=t.namespace);var r=[];return Xu(n,function(i,a){r.push(i+"="+a)}),o+r.join("&")}/** * @license * Copyright 2017 Google LLC * @@ -7376,7 +7376,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var ele={},tle={};function j9e(t){var e=t.toString();return ele[e]||(ele[e]=new Dyo),ele[e]}function Eyo(t,e){var n=t.toString();return tle[n]||(tle[n]=e()),tle[n]}/** + */var ele={},tle={};function B9e(t){var e=t.toString();return ele[e]||(ele[e]=new Dyo),ele[e]}function Eyo(t,e){var n=t.toString();return tle[n]||(tle[n]=e()),tle[n]}/** * @license * Copyright 2017 Google LLC * @@ -7406,7 +7406,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var xIe="start",kyo="close",Lyo="pLPCommand",Wyo="pRTLPCB",Ait="id",wit="pw",vit="ser",Nyo="cb",Uyo="seg",jyo="ts",Byo="d",Yyo="dframe",xit=1870,bit=30,Oyo=xit-bit,_yo=25e3,Vyo=3e4,B9e=function(){function t(e,n,o,r,i,a,l){var s=this;this.connId=e,this.repoInfo=n,this.applicationId=o,this.appCheckToken=r,this.authToken=i,this.transportSessionId=a,this.lastSessionId=l,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=ZN(e),this.stats_=j9e(n),this.urlFn=function(c){return s.appCheckToken&&(c[Pfe]=s.appCheckToken),yit(n,mit,c)}}return t.prototype.open=function(e,n){var o=this;this.curSegmentNum=0,this.onDisconnect_=n,this.myPacketOrderer=new Fyo(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(function(){o.log_("Timed out trying to connect."),o.onClosed_(),o.connectTimeoutTimer_=null},Math.floor(Vyo)),xyo(function(){if(!o.isClosed_){o.scriptTagHolder=new Gyo(function(){for(var a=[],l=0;ldocument.domain="'+a+'";<\/script>'}var l=""+i+"";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(l),this.myIFrame.doc.close()}catch(s){bd("frame writing exception"),s.stack&&bd(s.stack),bd(s)}}}return t.createIFrame_=function(){var e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{var n=e.contentWindow.document;n||bd("No IE domain setting required")}catch{var o=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+o+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e},t.prototype.close=function(){var e=this;this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout(function(){e.myIFrame!==null&&(document.body.removeChild(e.myIFrame),e.myIFrame=null)},Math.floor(0)));var n=this.onDisconnect;n&&(this.onDisconnect=null,n())},t.prototype.startLongPoll=function(e,n){for(this.myID=e,this.myPW=n,this.alive=!0;this.newRequest_(););},t.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var e={};e[Ait]=this.myID,e[wit]=this.myPW,e[vit]=this.currentSerial;for(var n=this.urlFn(e),o="",r=0;this.pendingSegs.length>0;){var i=this.pendingSegs[0];if(i.d.length+bit+o.length<=xit){var a=this.pendingSegs.shift();o=o+"&"+Uyo+r+"="+a.seg+"&"+jyo+r+"="+a.ts+"&"+Byo+r+"="+a.d,r++}else break}return n=n+o,this.addLongPollTag_(n,this.currentSerial),!0}else return!1},t.prototype.enqueueSegment=function(e,n,o){this.pendingSegs.push({seg:e,ts:n,d:o}),this.alive&&this.newRequest_()},t.prototype.addLongPollTag_=function(e,n){var o=this;this.outstandingRequests.add(n);var r=function(){o.outstandingRequests.delete(n),o.newRequest_()},i=setTimeout(r,Math.floor(_yo)),a=function(){clearTimeout(i),r()};this.addTag(e,a)},t.prototype.addTag=function(e,n){var o=this;setTimeout(function(){try{if(!o.sendNewPolls)return;var r=o.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){var i=r.readyState;(!i||i==="loaded"||i==="complete")&&(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),n())},r.onerror=function(){bd("Long-poll script failed to load: "+e),o.sendNewPolls=!1,o.close()},o.myIFrame.doc.body.appendChild(r)}catch{}},Math.floor(1))},t}();/** + */var bIe="start",kyo="close",Lyo="pLPCommand",Wyo="pRTLPCB",Ait="id",wit="pw",vit="ser",Nyo="cb",Uyo="seg",jyo="ts",Byo="d",Yyo="dframe",xit=1870,bit=30,Oyo=xit-bit,_yo=25e3,Vyo=3e4,Y9e=function(){function t(e,n,o,r,i,a,l){var s=this;this.connId=e,this.repoInfo=n,this.applicationId=o,this.appCheckToken=r,this.authToken=i,this.transportSessionId=a,this.lastSessionId=l,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=eU(e),this.stats_=B9e(n),this.urlFn=function(c){return s.appCheckToken&&(c[Pfe]=s.appCheckToken),yit(n,mit,c)}}return t.prototype.open=function(e,n){var o=this;this.curSegmentNum=0,this.onDisconnect_=n,this.myPacketOrderer=new Fyo(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(function(){o.log_("Timed out trying to connect."),o.onClosed_(),o.connectTimeoutTimer_=null},Math.floor(Vyo)),xyo(function(){if(!o.isClosed_){o.scriptTagHolder=new Gyo(function(){for(var a=[],l=0;ldocument.domain="'+a+'";<\/script>'}var l=""+i+"";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(l),this.myIFrame.doc.close()}catch(s){bd("frame writing exception"),s.stack&&bd(s.stack),bd(s)}}}return t.createIFrame_=function(){var e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{var n=e.contentWindow.document;n||bd("No IE domain setting required")}catch{var o=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+o+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e},t.prototype.close=function(){var e=this;this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout(function(){e.myIFrame!==null&&(document.body.removeChild(e.myIFrame),e.myIFrame=null)},Math.floor(0)));var n=this.onDisconnect;n&&(this.onDisconnect=null,n())},t.prototype.startLongPoll=function(e,n){for(this.myID=e,this.myPW=n,this.alive=!0;this.newRequest_(););},t.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var e={};e[Ait]=this.myID,e[wit]=this.myPW,e[vit]=this.currentSerial;for(var n=this.urlFn(e),o="",r=0;this.pendingSegs.length>0;){var i=this.pendingSegs[0];if(i.d.length+bit+o.length<=xit){var a=this.pendingSegs.shift();o=o+"&"+Uyo+r+"="+a.seg+"&"+jyo+r+"="+a.ts+"&"+Byo+r+"="+a.d,r++}else break}return n=n+o,this.addLongPollTag_(n,this.currentSerial),!0}else return!1},t.prototype.enqueueSegment=function(e,n,o){this.pendingSegs.push({seg:e,ts:n,d:o}),this.alive&&this.newRequest_()},t.prototype.addLongPollTag_=function(e,n){var o=this;this.outstandingRequests.add(n);var r=function(){o.outstandingRequests.delete(n),o.newRequest_()},i=setTimeout(r,Math.floor(_yo)),a=function(){clearTimeout(i),r()};this.addTag(e,a)},t.prototype.addTag=function(e,n){var o=this;setTimeout(function(){try{if(!o.sendNewPolls)return;var r=o.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){var i=r.readyState;(!i||i==="loaded"||i==="complete")&&(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),n())},r.onerror=function(){bd("Long-poll script failed to load: "+e),o.sendNewPolls=!1,o.close()},o.myIFrame.doc.body.appendChild(r)}catch{}},Math.floor(1))},t}();/** * @license * Copyright 2017 Google LLC * @@ -7421,7 +7421,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var Xyo=16384,Jyo=45e3,yJ=null;typeof MozWebSocket<"u"?yJ=MozWebSocket:typeof WebSocket<"u"&&(yJ=WebSocket);var Pv=function(){function t(e,n,o,r,i,a,l){this.connId=e,this.applicationId=o,this.appCheckToken=r,this.authToken=i,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=ZN(this.connId),this.stats_=j9e(n),this.connURL=t.connectionURL_(n,a,l,r),this.nodeAdmin=n.nodeAdmin}return t.connectionURL_=function(e,n,o,r){var i={};return i[cit]=N9e,typeof location<"u"&&location.hostname&&hit.test(location.hostname)&&(i[dit]=fit),n&&(i[uit]=n),o&&(i[pit]=o),r&&(i[Pfe]=r),yit(e,git,i)},t.prototype.open=function(e,n){var o=this;this.onDisconnect=n,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,Kv.set("previous_websocket_failure",!0);try{var r,i,a,l;if(!bZe()){var i={headers:{"X-Firebase-GMPID":this.applicationId||"","X-Firebase-AppCheck":this.appCheckToken||""}};this.mySock=new yJ(this.connURL,[],i)}}catch(c){this.log_("Error instantiating WebSocket.");var s=c.message||c.data;s&&this.log_(s),this.onClosed_();return}this.mySock.onopen=function(){o.log_("Websocket connected."),o.everConnected_=!0},this.mySock.onclose=function(){o.log_("Websocket connection was disconnected."),o.mySock=null,o.onClosed_()},this.mySock.onmessage=function(c){o.handleIncomingFrame(c)},this.mySock.onerror=function(c){o.log_("WebSocket error. Closing connection.");var u=c.message||c.data;u&&o.log_(u),o.onClosed_()}},t.prototype.start=function(){},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){var e=!1;if(typeof navigator<"u"&&navigator.userAgent){var n=/Android ([0-9]{0,}\.[0-9]{0,})/,o=navigator.userAgent.match(n);o&&o.length>1&&parseFloat(o[1])<4.4&&(e=!0)}return!e&&yJ!==null&&!t.forceDisallow_},t.previouslyFailed=function(){return Kv.isInMemoryStorage||Kv.get("previous_websocket_failure")===!0},t.prototype.markConnectionHealthy=function(){Kv.remove("previous_websocket_failure")},t.prototype.appendFrame_=function(e){if(this.frames.push(e),this.frames.length===this.totalFrames){var n=this.frames.join("");this.frames=null;var o=yk(n);this.onMessage(o)}},t.prototype.handleNewFrameCount_=function(e){this.totalFrames=e,this.frames=[]},t.prototype.extractFrameCount_=function(e){if(er(this.frames===null,"We already have a frame buffer"),e.length<=6){var n=Number(e);if(!isNaN(n))return this.handleNewFrameCount_(n),null}return this.handleNewFrameCount_(1),e},t.prototype.handleIncomingFrame=function(e){if(this.mySock!==null){var n=e.data;if(this.bytesReceived+=n.length,this.stats_.incrementCounter("bytes_received",n.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(n);else{var o=this.extractFrameCount_(n);o!==null&&this.appendFrame_(o)}}},t.prototype.send=function(e){this.resetKeepAlive();var n=Fu(e);this.bytesSent+=n.length,this.stats_.incrementCounter("bytes_sent",n.length);var o=ait(n,Xyo);o.length>1&&this.sendString_(String(o.length));for(var r=0;r1&&parseFloat(o[1])<4.4&&(e=!0)}return!e&&AJ!==null&&!t.forceDisallow_},t.previouslyFailed=function(){return Kv.isInMemoryStorage||Kv.get("previous_websocket_failure")===!0},t.prototype.markConnectionHealthy=function(){Kv.remove("previous_websocket_failure")},t.prototype.appendFrame_=function(e){if(this.frames.push(e),this.frames.length===this.totalFrames){var n=this.frames.join("");this.frames=null;var o=yk(n);this.onMessage(o)}},t.prototype.handleNewFrameCount_=function(e){this.totalFrames=e,this.frames=[]},t.prototype.extractFrameCount_=function(e){if(er(this.frames===null,"We already have a frame buffer"),e.length<=6){var n=Number(e);if(!isNaN(n))return this.handleNewFrameCount_(n),null}return this.handleNewFrameCount_(1),e},t.prototype.handleIncomingFrame=function(e){if(this.mySock!==null){var n=e.data;if(this.bytesReceived+=n.length,this.stats_.incrementCounter("bytes_received",n.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(n);else{var o=this.extractFrameCount_(n);o!==null&&this.appendFrame_(o)}}},t.prototype.send=function(e){this.resetKeepAlive();var n=Fu(e);this.bytesSent+=n.length,this.stats_.incrementCounter("bytes_sent",n.length);var o=ait(n,Xyo);o.length>1&&this.sendString_(String(o.length));for(var r=0;r0)return this.transports_[0];throw new Error("No transports available")},t.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},t}();/** + */var Kyo=function(){function t(e){this.initTransports_(e)}return Object.defineProperty(t,"ALL_TRANSPORTS",{get:function(){return[Y9e,Pv]},enumerable:!1,configurable:!0}),t.prototype.initTransports_=function(e){var n,o,r=Pv&&Pv.isAvailable(),i=r&&!Pv.previouslyFailed();if(e.webSocketOnly&&(r||vf("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)this.transports_=[Pv];else{var a=this.transports_=[];try{for(var l=Pg(t.ALL_TRANSPORTS),s=l.next();!s.done;s=l.next()){var c=s.value;c&&c.isAvailable()&&a.push(c)}}catch(u){n={error:u}}finally{try{s&&!s.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}}},t.prototype.initialTransport=function(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")},t.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},t}();/** * @license * Copyright 2017 Google LLC * @@ -7451,7 +7451,7 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var qyo=6e4,$yo=5e3,Qyo=10*1024,Zyo=100*1024,nle="t",bIe="d",e2o="s",SIe="r",t2o="e",TIe="o",PIe="a",CIe="n",RIe="p",n2o="h",Sit=function(){function t(e,n,o,r,i,a,l,s,c,u){this.id=e,this.repoInfo_=n,this.applicationId_=o,this.appCheckToken_=r,this.authToken_=i,this.onMessage_=a,this.onReady_=l,this.onDisconnect_=s,this.onKill_=c,this.lastSessionId=u,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=ZN("c:"+this.id+":"),this.transportManager_=new Kyo(n),this.log_("Connection created"),this.start_()}return t.prototype.start_=function(){var e=this,n=this.transportManager_.initialTransport();this.conn_=new n(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=n.responsesRequiredToBeHealthy||0;var o=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(function(){e.conn_&&e.conn_.open(o,r)},Math.floor(0));var i=n.healthyTimeout||0;i>0&&(this.healthyTimeout_=jE(function(){e.healthyTimeout_=null,e.isHealthy_||(e.conn_&&e.conn_.bytesReceived>Zyo?(e.log_("Connection exceeded healthy timeout but has received "+e.conn_.bytesReceived+" bytes. Marking connection healthy."),e.isHealthy_=!0,e.conn_.markConnectionHealthy()):e.conn_&&e.conn_.bytesSent>Qyo?e.log_("Connection exceeded healthy timeout but has sent "+e.conn_.bytesSent+" bytes. Leaving connection alive."):(e.log_("Closing unhealthy connection after timeout."),e.close()))},Math.floor(i)))},t.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},t.prototype.disconnReceiver_=function(e){var n=this;return function(o){e===n.conn_?n.onConnectionLost_(o):e===n.secondaryConn_?(n.log_("Secondary connection lost."),n.onSecondaryConnectionLost_()):n.log_("closing an old connection")}},t.prototype.connReceiver_=function(e){var n=this;return function(o){n.state_!==2&&(e===n.rx_?n.onPrimaryMessageReceived_(o):e===n.secondaryConn_?n.onSecondaryMessageReceived_(o):n.log_("message on old connection"))}},t.prototype.sendRequest=function(e){var n={t:"d",d:e};this.sendData_(n)},t.prototype.tryCleanupConnection=function(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)},t.prototype.onSecondaryControl_=function(e){if(nle in e){var n=e[nle];n===PIe?this.upgradeIfSecondaryHealthy_():n===SIe?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):n===TIe&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},t.prototype.onSecondaryMessageReceived_=function(e){var n=oD("t",e),o=oD("d",e);if(n==="c")this.onSecondaryControl_(o);else if(n==="d")this.pendingDataMessages.push(o);else throw new Error("Unknown protocol layer: "+n)},t.prototype.upgradeIfSecondaryHealthy_=function(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:RIe,d:{}}}))},t.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:PIe,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:CIe,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},t.prototype.onPrimaryMessageReceived_=function(e){var n=oD("t",e),o=oD("d",e);n==="c"?this.onControl_(o):n==="d"&&this.onDataMessage_(o)},t.prototype.onDataMessage_=function(e){this.onPrimaryResponse_(),this.onMessage_(e)},t.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},t.prototype.onControl_=function(e){var n=oD(nle,e);if(bIe in e){var o=e[bIe];if(n===n2o)this.onHandshake_(o);else if(n===CIe){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var r=0;r0&&(this.healthyTimeout_=jE(function(){e.healthyTimeout_=null,e.isHealthy_||(e.conn_&&e.conn_.bytesReceived>Zyo?(e.log_("Connection exceeded healthy timeout but has received "+e.conn_.bytesReceived+" bytes. Marking connection healthy."),e.isHealthy_=!0,e.conn_.markConnectionHealthy()):e.conn_&&e.conn_.bytesSent>Qyo?e.log_("Connection exceeded healthy timeout but has sent "+e.conn_.bytesSent+" bytes. Leaving connection alive."):(e.log_("Closing unhealthy connection after timeout."),e.close()))},Math.floor(i)))},t.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},t.prototype.disconnReceiver_=function(e){var n=this;return function(o){e===n.conn_?n.onConnectionLost_(o):e===n.secondaryConn_?(n.log_("Secondary connection lost."),n.onSecondaryConnectionLost_()):n.log_("closing an old connection")}},t.prototype.connReceiver_=function(e){var n=this;return function(o){n.state_!==2&&(e===n.rx_?n.onPrimaryMessageReceived_(o):e===n.secondaryConn_?n.onSecondaryMessageReceived_(o):n.log_("message on old connection"))}},t.prototype.sendRequest=function(e){var n={t:"d",d:e};this.sendData_(n)},t.prototype.tryCleanupConnection=function(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)},t.prototype.onSecondaryControl_=function(e){if(nle in e){var n=e[nle];n===CIe?this.upgradeIfSecondaryHealthy_():n===TIe?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):n===PIe&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},t.prototype.onSecondaryMessageReceived_=function(e){var n=oD("t",e),o=oD("d",e);if(n==="c")this.onSecondaryControl_(o);else if(n==="d")this.pendingDataMessages.push(o);else throw new Error("Unknown protocol layer: "+n)},t.prototype.upgradeIfSecondaryHealthy_=function(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:HIe,d:{}}}))},t.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:CIe,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:RIe,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},t.prototype.onPrimaryMessageReceived_=function(e){var n=oD("t",e),o=oD("d",e);n==="c"?this.onControl_(o):n==="d"&&this.onDataMessage_(o)},t.prototype.onDataMessage_=function(e){this.onPrimaryResponse_(),this.onMessage_(e)},t.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},t.prototype.onControl_=function(e){var n=oD(nle,e);if(SIe in e){var o=e[SIe];if(n===n2o)this.onHandshake_(o);else if(n===RIe){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var r=0;r0&&(this.pieces_[o]=this.pieces_[r],o++);this.pieces_.length=o,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=n}return t.prototype.toString=function(){for(var e="",n=this.pieceNum_;n=t.pieces_.length?null:t.pieces_[t.pieceNum_]}function Aw(t){return t.pieces_.length-t.pieceNum_}function Rs(t){var e=t.pieceNum_;return e=t.pieces_.length)return null;for(var e=[],n=t.pieceNum_;n0&&n.push(r[o]);return new ls(n,0)}function Ia(t){return t.pieceNum_>=t.pieces_.length}function lp(t,e){var n=Ma(t),o=Ma(e);if(n===null)return e;if(n===o)return lp(Rs(t),Rs(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function r2o(t,e){for(var n=jk(t,0),o=jk(e,0),r=0;rAw(e))return!1;for(;n0&&(t.byteLength_+=1),t.parts_.push(e),t.byteLength_+=cZ(e),Rit(t)}function l2o(t){var e=t.parts_.pop();t.byteLength_-=cZ(e),t.parts_.length>0&&(t.byteLength_-=1)}function Rit(t){if(t.byteLength_>IIe)throw new Error(t.errorPrefix_+"has a key path longer than "+IIe+" bytes ("+t.byteLength_+").");if(t.parts_.length>MIe)throw new Error(t.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+MIe+") or object contains a cycle "+gv(t))}function gv(t){return t.parts_.length===0?"":"in property '"+t.parts_.join(".")+"'"}/** + */var IIe=32,zIe=768,ls=function(){function t(e,n){if(n===void 0){this.pieces_=e.split("/");for(var o=0,r=0;r0&&(this.pieces_[o]=this.pieces_[r],o++);this.pieces_.length=o,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=n}return t.prototype.toString=function(){for(var e="",n=this.pieceNum_;n=t.pieces_.length?null:t.pieces_[t.pieceNum_]}function Aw(t){return t.pieces_.length-t.pieceNum_}function Rs(t){var e=t.pieceNum_;return e=t.pieces_.length)return null;for(var e=[],n=t.pieceNum_;n0&&n.push(r[o]);return new ls(n,0)}function Ia(t){return t.pieceNum_>=t.pieces_.length}function lp(t,e){var n=Ma(t),o=Ma(e);if(n===null)return e;if(n===o)return lp(Rs(t),Rs(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function r2o(t,e){for(var n=jk(t,0),o=jk(e,0),r=0;rAw(e))return!1;for(;n0&&(t.byteLength_+=1),t.parts_.push(e),t.byteLength_+=cZ(e),Rit(t)}function l2o(t){var e=t.parts_.pop();t.byteLength_-=cZ(e),t.parts_.length>0&&(t.byteLength_-=1)}function Rit(t){if(t.byteLength_>zIe)throw new Error(t.errorPrefix_+"has a key path longer than "+zIe+" bytes ("+t.byteLength_+").");if(t.parts_.length>IIe)throw new Error(t.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+IIe+") or object contains a cycle "+gv(t))}function gv(t){return t.parts_.length===0?"":"in property '"+t.parts_.join(".")+"'"}/** * @license * Copyright 2017 Google LLC * @@ -7541,10 +7541,10 @@ PERFORMANCE OF THIS SOFTWARE. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var rD=1e3,c2o=60*5*1e3,u2o=3*1e3,zIe=30*1e3,d2o=1.3,f2o=3e4,h2o="server_kill",DIe=3,Hx=function(t){Pr(e,t);function e(n,o,r,i,a,l,s,c){var u=t.call(this)||this;if(u.repoInfo_=n,u.applicationId_=o,u.onDataUpdate_=r,u.onConnectStatus_=i,u.onServerInfoUpdate_=a,u.authTokenProvider_=l,u.appCheckTokenProvider_=s,u.authOverride_=c,u.id=e.nextPersistentConnectionId_++,u.log_=ZN("p:"+u.id+":"),u.interruptReasons_={},u.listens=new Map,u.outstandingPuts_=[],u.outstandingGets_=[],u.outstandingPutCount_=0,u.outstandingGetCount_=0,u.onDisconnectRequestQueue_=[],u.connected_=!1,u.reconnectDelay_=rD,u.maxReconnectDelay_=c2o,u.securityDebugCallback_=null,u.lastSessionId=null,u.establishConnectionTimer_=null,u.visible_=!1,u.requestCBHash_={},u.requestNumber_=0,u.realtime_=null,u.authToken_=null,u.appCheckToken_=null,u.forceTokenRefresh_=!1,u.invalidAuthTokenCount_=0,u.invalidAppCheckTokenCount_=0,u.firstConnection_=!0,u.lastConnectionAttemptTime_=null,u.lastConnectionEstablishedTime_=null,c&&!bZe())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return s2o.getInstance().on("visible",u.onVisible_,u),n.host.indexOf("fblocal")===-1&&HIe.getInstance().on("online",u.onOnline_,u),u}return e.prototype.sendRequest=function(n,o,r){var i=++this.requestNumber_,a={r:i,a:n,b:o};this.log_(Fu(a)),er(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(a),r&&(this.requestCBHash_[i]=r)},e.prototype.get=function(n){var o=this;this.initConnection_();var r=new Bp,i={p:n._path.toString(),q:n._queryObject},a={action:"g",request:i,onComplete:function(s){var c=s.d;s.s==="ok"?(o.onDataUpdate_(i.p,c,!1,null),r.resolve(c)):r.reject(c)}};this.outstandingGets_.push(a),this.outstandingGetCount_++;var l=this.outstandingGets_.length-1;return this.connected_||setTimeout(function(){var s=o.outstandingGets_[l];s===void 0||a!==s||(delete o.outstandingGets_[l],o.outstandingGetCount_--,o.outstandingGetCount_===0&&(o.outstandingGets_=[]),o.log_("get "+l+" timed out on connection"),r.reject(new Error("Client is offline.")))},u2o),this.connected_&&this.sendGet_(l),r.promise},e.prototype.listen=function(n,o,r,i){this.initConnection_();var a=n._queryIdentifier,l=n._path.toString();this.log_("Listen called for "+l+" "+a),this.listens.has(l)||this.listens.set(l,new Map),er(n._queryParams.isDefault()||!n._queryParams.loadsAllData(),"listen() called for non-default but complete query"),er(!this.listens.get(l).has(a),"listen() called twice for same path/queryId.");var s={onComplete:i,hashFn:o,query:n,tag:r};this.listens.get(l).set(a,s),this.connected_&&this.sendListen_(s)},e.prototype.sendGet_=function(n){var o=this,r=this.outstandingGets_[n];this.sendRequest("g",r.request,function(i){delete o.outstandingGets_[n],o.outstandingGetCount_--,o.outstandingGetCount_===0&&(o.outstandingGets_=[]),r.onComplete&&r.onComplete(i)})},e.prototype.sendListen_=function(n){var o=this,r=n.query,i=r._path.toString(),a=r._queryIdentifier;this.log_("Listen on "+i+" for "+a);var l={p:i},s="q";n.tag&&(l.q=r._queryObject,l.t=n.tag),l.h=n.hashFn(),this.sendRequest(s,l,function(c){var u=c.d,d=c.s;e.warnOnListenWarnings_(u,r);var f=o.listens.get(i)&&o.listens.get(i).get(a);f===n&&(o.log_("listen response",c),d!=="ok"&&o.removeListen_(i,a),n.onComplete&&n.onComplete(d,u))})},e.warnOnListenWarnings_=function(n,o){if(n&&typeof n=="object"&&Eg(n,"w")){var r=eb(n,"w");if(Array.isArray(r)&&~r.indexOf("no_index")){var i='".indexOn": "'+o._queryParams.getIndex().toString()+'"',a=o._path.toString();vf("Using an unspecified index. Your data will be downloaded and "+("filtered on the client. Consider adding "+i+" at ")+(a+" to your security rules for better performance."))}}},e.prototype.refreshAuthToken=function(n){this.authToken_=n,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},function(){}),this.reduceReconnectDelayIfAdminCredential_(n)},e.prototype.reduceReconnectDelayIfAdminCredential_=function(n){var o=n&&n.length===40;(o||wUn(n))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=zIe)},e.prototype.refreshAppCheckToken=function(n){this.appCheckToken_=n,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},function(){})},e.prototype.tryAuth=function(){var n=this;if(this.connected_&&this.authToken_){var o=this.authToken_,r=AUn(o)?"auth":"gauth",i={cred:o};this.authOverride_===null?i.noauth=!0:typeof this.authOverride_=="object"&&(i.authvar=this.authOverride_),this.sendRequest(r,i,function(a){var l=a.s,s=a.d||"error";n.authToken_===o&&(l==="ok"?n.invalidAuthTokenCount_=0:n.onAuthRevoked_(l,s))})}},e.prototype.tryAppCheck=function(){var n=this;this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},function(o){var r=o.s,i=o.d||"error";r==="ok"?n.invalidAppCheckTokenCount_=0:n.onAppCheckRevoked_(r,i)})},e.prototype.unlisten=function(n,o){var r=n._path.toString(),i=n._queryIdentifier;this.log_("Unlisten called for "+r+" "+i),er(n._queryParams.isDefault()||!n._queryParams.loadsAllData(),"unlisten() called for non-default but complete query");var a=this.removeListen_(r,i);a&&this.connected_&&this.sendUnlisten_(r,i,n._queryObject,o)},e.prototype.sendUnlisten_=function(n,o,r,i){this.log_("Unlisten on "+n+" for "+o);var a={p:n},l="n";i&&(a.q=r,a.t=i),this.sendRequest(l,a)},e.prototype.onDisconnectPut=function(n,o,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",n,o,r):this.onDisconnectRequestQueue_.push({pathString:n,action:"o",data:o,onComplete:r})},e.prototype.onDisconnectMerge=function(n,o,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",n,o,r):this.onDisconnectRequestQueue_.push({pathString:n,action:"om",data:o,onComplete:r})},e.prototype.onDisconnectCancel=function(n,o){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",n,null,o):this.onDisconnectRequestQueue_.push({pathString:n,action:"oc",data:null,onComplete:o})},e.prototype.sendOnDisconnect_=function(n,o,r,i){var a={p:o,d:r};this.log_("onDisconnect "+n,a),this.sendRequest(n,a,function(l){i&&setTimeout(function(){i(l.s,l.d)},Math.floor(0))})},e.prototype.put=function(n,o,r,i){this.putInternal("p",n,o,r,i)},e.prototype.merge=function(n,o,r,i){this.putInternal("m",n,o,r,i)},e.prototype.putInternal=function(n,o,r,i,a){this.initConnection_();var l={p:o,d:r};a!==void 0&&(l.h=a),this.outstandingPuts_.push({action:n,request:l,onComplete:i}),this.outstandingPutCount_++;var s=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(s):this.log_("Buffering put: "+o)},e.prototype.sendPut_=function(n){var o=this,r=this.outstandingPuts_[n].action,i=this.outstandingPuts_[n].request,a=this.outstandingPuts_[n].onComplete;this.outstandingPuts_[n].queued=this.connected_,this.sendRequest(r,i,function(l){o.log_(r+" response",l),delete o.outstandingPuts_[n],o.outstandingPutCount_--,o.outstandingPutCount_===0&&(o.outstandingPuts_=[]),a&&a(l.s,l.d)})},e.prototype.reportStats=function(n){var o=this;if(this.connected_){var r={c:n};this.log_("reportStats",r),this.sendRequest("s",r,function(i){var a=i.s;if(a!=="ok"){var l=i.d;o.log_("reportStats","Error sending stats: "+l)}})}},e.prototype.onDataMessage_=function(n){if("r"in n){this.log_("from server: "+Fu(n));var o=n.r,r=this.requestCBHash_[o];r&&(delete this.requestCBHash_[o],r(n.b))}else{if("error"in n)throw"A server-side error has occurred: "+n.error;"a"in n&&this.onDataPush_(n.a,n.b)}},e.prototype.onDataPush_=function(n,o){this.log_("handleServerMessage",n,o),n==="d"?this.onDataUpdate_(o.p,o.d,!1,o.t):n==="m"?this.onDataUpdate_(o.p,o.d,!0,o.t):n==="c"?this.onListenRevoked_(o.p,o.q):n==="ac"?this.onAuthRevoked_(o.s,o.d):n==="apc"?this.onAppCheckRevoked_(o.s,o.d):n==="sd"?this.onSecurityDebugPacket_(o):Tfe("Unrecognized action received from server: "+Fu(n)+` -Are you using the latest client?`)},e.prototype.onReady_=function(n,o){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(n),this.lastSessionId=o,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},e.prototype.scheduleConnect_=function(n){var o=this;er(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(function(){o.establishConnectionTimer_=null,o.establishConnection_()},Math.floor(n))},e.prototype.initConnection_=function(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)},e.prototype.onVisible_=function(n){n&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=rD,this.realtime_||this.scheduleConnect_(0)),this.visible_=n},e.prototype.onOnline_=function(n){n?(this.log_("Browser went online."),this.reconnectDelay_=rD,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())},e.prototype.onRealtimeDisconnect_=function(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(!this.visible_)this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=new Date().getTime();else if(this.lastConnectionEstablishedTime_){var n=new Date().getTime()-this.lastConnectionEstablishedTime_;n>f2o&&(this.reconnectDelay_=rD),this.lastConnectionEstablishedTime_=null}var o=new Date().getTime()-this.lastConnectionAttemptTime_,r=Math.max(0,this.reconnectDelay_-o);r=Math.random()*r,this.log_("Trying to reconnect in "+r+"ms"),this.scheduleConnect_(r),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*d2o)}this.onConnectStatus_(!1)},e.prototype.establishConnection_=function(){return vo(this,void 0,void 0,function(){var n,o,r,i,a,l,s,c,u,d,f,p,g,y,w=this;return Ao(this,function(b){switch(b.label){case 0:if(!this.shouldReconnect_())return[3,4];this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null,n=this.onDataMessage_.bind(this),o=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+e.nextConnectionId_++,a=this.lastSessionId,l=!1,s=null,c=function(){s?s.close():(l=!0,r())},u=function(C){er(s,"sendRequest call when we're not connected not allowed."),s.sendRequest(C)},this.realtime_={close:c,sendRequest:u},d=this.forceTokenRefresh_,this.forceTokenRefresh_=!1,b.label=1;case 1:return b.trys.push([1,3,,4]),[4,Promise.all([this.authTokenProvider_.getToken(d),this.appCheckTokenProvider_.getToken(d)])];case 2:return f=rp.apply(void 0,[b.sent(),2]),p=f[0],g=f[1],l?bd("getToken() completed but was canceled"):(bd("getToken() completed. Creating connection."),this.authToken_=p&&p.accessToken,this.appCheckToken_=g&&g.token,s=new Sit(i,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,n,o,r,function(C){vf(C+" ("+w.repoInfo_.toString()+")"),w.interrupt(h2o)},a)),[3,4];case 3:return y=b.sent(),this.log_("Failed to get token: "+y),l||(this.repoInfo_.nodeAdmin&&vf(y),c()),[3,4];case 4:return[2]}})})},e.prototype.interrupt=function(n){bd("Interrupting connection for reason: "+n),this.interruptReasons_[n]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},e.prototype.resume=function(n){bd("Resuming connection for reason: "+n),delete this.interruptReasons_[n],Tde(this.interruptReasons_)&&(this.reconnectDelay_=rD,this.realtime_||this.scheduleConnect_(0))},e.prototype.handleTimestamp_=function(n){var o=n-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:o})},e.prototype.cancelSentTransactions_=function(){for(var n=0;n=DIe&&(this.reconnectDelay_=zIe,this.authTokenProvider_.notifyForInvalidToken()))},e.prototype.onAppCheckRevoked_=function(n,o){bd("App check token revoked: "+n+"/"+o),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(n==="invalid_token"||n==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=DIe&&this.appCheckTokenProvider_.notifyForInvalidToken())},e.prototype.onSecurityDebugPacket_=function(n){this.securityDebugCallback_?this.securityDebugCallback_(n):"msg"in n&&console.log("FIREBASE: "+n.msg.replace(` + */var rD=1e3,c2o=60*5*1e3,u2o=3*1e3,DIe=30*1e3,d2o=1.3,f2o=3e4,h2o="server_kill",EIe=3,Hx=function(t){Pr(e,t);function e(n,o,r,i,a,l,s,c){var u=t.call(this)||this;if(u.repoInfo_=n,u.applicationId_=o,u.onDataUpdate_=r,u.onConnectStatus_=i,u.onServerInfoUpdate_=a,u.authTokenProvider_=l,u.appCheckTokenProvider_=s,u.authOverride_=c,u.id=e.nextPersistentConnectionId_++,u.log_=eU("p:"+u.id+":"),u.interruptReasons_={},u.listens=new Map,u.outstandingPuts_=[],u.outstandingGets_=[],u.outstandingPutCount_=0,u.outstandingGetCount_=0,u.onDisconnectRequestQueue_=[],u.connected_=!1,u.reconnectDelay_=rD,u.maxReconnectDelay_=c2o,u.securityDebugCallback_=null,u.lastSessionId=null,u.establishConnectionTimer_=null,u.visible_=!1,u.requestCBHash_={},u.requestNumber_=0,u.realtime_=null,u.authToken_=null,u.appCheckToken_=null,u.forceTokenRefresh_=!1,u.invalidAuthTokenCount_=0,u.invalidAppCheckTokenCount_=0,u.firstConnection_=!0,u.lastConnectionAttemptTime_=null,u.lastConnectionEstablishedTime_=null,c&&!bZe())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return s2o.getInstance().on("visible",u.onVisible_,u),n.host.indexOf("fblocal")===-1&&MIe.getInstance().on("online",u.onOnline_,u),u}return e.prototype.sendRequest=function(n,o,r){var i=++this.requestNumber_,a={r:i,a:n,b:o};this.log_(Fu(a)),er(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(a),r&&(this.requestCBHash_[i]=r)},e.prototype.get=function(n){var o=this;this.initConnection_();var r=new Bp,i={p:n._path.toString(),q:n._queryObject},a={action:"g",request:i,onComplete:function(s){var c=s.d;s.s==="ok"?(o.onDataUpdate_(i.p,c,!1,null),r.resolve(c)):r.reject(c)}};this.outstandingGets_.push(a),this.outstandingGetCount_++;var l=this.outstandingGets_.length-1;return this.connected_||setTimeout(function(){var s=o.outstandingGets_[l];s===void 0||a!==s||(delete o.outstandingGets_[l],o.outstandingGetCount_--,o.outstandingGetCount_===0&&(o.outstandingGets_=[]),o.log_("get "+l+" timed out on connection"),r.reject(new Error("Client is offline.")))},u2o),this.connected_&&this.sendGet_(l),r.promise},e.prototype.listen=function(n,o,r,i){this.initConnection_();var a=n._queryIdentifier,l=n._path.toString();this.log_("Listen called for "+l+" "+a),this.listens.has(l)||this.listens.set(l,new Map),er(n._queryParams.isDefault()||!n._queryParams.loadsAllData(),"listen() called for non-default but complete query"),er(!this.listens.get(l).has(a),"listen() called twice for same path/queryId.");var s={onComplete:i,hashFn:o,query:n,tag:r};this.listens.get(l).set(a,s),this.connected_&&this.sendListen_(s)},e.prototype.sendGet_=function(n){var o=this,r=this.outstandingGets_[n];this.sendRequest("g",r.request,function(i){delete o.outstandingGets_[n],o.outstandingGetCount_--,o.outstandingGetCount_===0&&(o.outstandingGets_=[]),r.onComplete&&r.onComplete(i)})},e.prototype.sendListen_=function(n){var o=this,r=n.query,i=r._path.toString(),a=r._queryIdentifier;this.log_("Listen on "+i+" for "+a);var l={p:i},s="q";n.tag&&(l.q=r._queryObject,l.t=n.tag),l.h=n.hashFn(),this.sendRequest(s,l,function(c){var u=c.d,d=c.s;e.warnOnListenWarnings_(u,r);var f=o.listens.get(i)&&o.listens.get(i).get(a);f===n&&(o.log_("listen response",c),d!=="ok"&&o.removeListen_(i,a),n.onComplete&&n.onComplete(d,u))})},e.warnOnListenWarnings_=function(n,o){if(n&&typeof n=="object"&&Eg(n,"w")){var r=eb(n,"w");if(Array.isArray(r)&&~r.indexOf("no_index")){var i='".indexOn": "'+o._queryParams.getIndex().toString()+'"',a=o._path.toString();vf("Using an unspecified index. Your data will be downloaded and "+("filtered on the client. Consider adding "+i+" at ")+(a+" to your security rules for better performance."))}}},e.prototype.refreshAuthToken=function(n){this.authToken_=n,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},function(){}),this.reduceReconnectDelayIfAdminCredential_(n)},e.prototype.reduceReconnectDelayIfAdminCredential_=function(n){var o=n&&n.length===40;(o||wUn(n))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=DIe)},e.prototype.refreshAppCheckToken=function(n){this.appCheckToken_=n,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},function(){})},e.prototype.tryAuth=function(){var n=this;if(this.connected_&&this.authToken_){var o=this.authToken_,r=AUn(o)?"auth":"gauth",i={cred:o};this.authOverride_===null?i.noauth=!0:typeof this.authOverride_=="object"&&(i.authvar=this.authOverride_),this.sendRequest(r,i,function(a){var l=a.s,s=a.d||"error";n.authToken_===o&&(l==="ok"?n.invalidAuthTokenCount_=0:n.onAuthRevoked_(l,s))})}},e.prototype.tryAppCheck=function(){var n=this;this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},function(o){var r=o.s,i=o.d||"error";r==="ok"?n.invalidAppCheckTokenCount_=0:n.onAppCheckRevoked_(r,i)})},e.prototype.unlisten=function(n,o){var r=n._path.toString(),i=n._queryIdentifier;this.log_("Unlisten called for "+r+" "+i),er(n._queryParams.isDefault()||!n._queryParams.loadsAllData(),"unlisten() called for non-default but complete query");var a=this.removeListen_(r,i);a&&this.connected_&&this.sendUnlisten_(r,i,n._queryObject,o)},e.prototype.sendUnlisten_=function(n,o,r,i){this.log_("Unlisten on "+n+" for "+o);var a={p:n},l="n";i&&(a.q=r,a.t=i),this.sendRequest(l,a)},e.prototype.onDisconnectPut=function(n,o,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",n,o,r):this.onDisconnectRequestQueue_.push({pathString:n,action:"o",data:o,onComplete:r})},e.prototype.onDisconnectMerge=function(n,o,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",n,o,r):this.onDisconnectRequestQueue_.push({pathString:n,action:"om",data:o,onComplete:r})},e.prototype.onDisconnectCancel=function(n,o){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",n,null,o):this.onDisconnectRequestQueue_.push({pathString:n,action:"oc",data:null,onComplete:o})},e.prototype.sendOnDisconnect_=function(n,o,r,i){var a={p:o,d:r};this.log_("onDisconnect "+n,a),this.sendRequest(n,a,function(l){i&&setTimeout(function(){i(l.s,l.d)},Math.floor(0))})},e.prototype.put=function(n,o,r,i){this.putInternal("p",n,o,r,i)},e.prototype.merge=function(n,o,r,i){this.putInternal("m",n,o,r,i)},e.prototype.putInternal=function(n,o,r,i,a){this.initConnection_();var l={p:o,d:r};a!==void 0&&(l.h=a),this.outstandingPuts_.push({action:n,request:l,onComplete:i}),this.outstandingPutCount_++;var s=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(s):this.log_("Buffering put: "+o)},e.prototype.sendPut_=function(n){var o=this,r=this.outstandingPuts_[n].action,i=this.outstandingPuts_[n].request,a=this.outstandingPuts_[n].onComplete;this.outstandingPuts_[n].queued=this.connected_,this.sendRequest(r,i,function(l){o.log_(r+" response",l),delete o.outstandingPuts_[n],o.outstandingPutCount_--,o.outstandingPutCount_===0&&(o.outstandingPuts_=[]),a&&a(l.s,l.d)})},e.prototype.reportStats=function(n){var o=this;if(this.connected_){var r={c:n};this.log_("reportStats",r),this.sendRequest("s",r,function(i){var a=i.s;if(a!=="ok"){var l=i.d;o.log_("reportStats","Error sending stats: "+l)}})}},e.prototype.onDataMessage_=function(n){if("r"in n){this.log_("from server: "+Fu(n));var o=n.r,r=this.requestCBHash_[o];r&&(delete this.requestCBHash_[o],r(n.b))}else{if("error"in n)throw"A server-side error has occurred: "+n.error;"a"in n&&this.onDataPush_(n.a,n.b)}},e.prototype.onDataPush_=function(n,o){this.log_("handleServerMessage",n,o),n==="d"?this.onDataUpdate_(o.p,o.d,!1,o.t):n==="m"?this.onDataUpdate_(o.p,o.d,!0,o.t):n==="c"?this.onListenRevoked_(o.p,o.q):n==="ac"?this.onAuthRevoked_(o.s,o.d):n==="apc"?this.onAppCheckRevoked_(o.s,o.d):n==="sd"?this.onSecurityDebugPacket_(o):Tfe("Unrecognized action received from server: "+Fu(n)+` +Are you using the latest client?`)},e.prototype.onReady_=function(n,o){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(n),this.lastSessionId=o,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},e.prototype.scheduleConnect_=function(n){var o=this;er(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(function(){o.establishConnectionTimer_=null,o.establishConnection_()},Math.floor(n))},e.prototype.initConnection_=function(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)},e.prototype.onVisible_=function(n){n&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=rD,this.realtime_||this.scheduleConnect_(0)),this.visible_=n},e.prototype.onOnline_=function(n){n?(this.log_("Browser went online."),this.reconnectDelay_=rD,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())},e.prototype.onRealtimeDisconnect_=function(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(!this.visible_)this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=new Date().getTime();else if(this.lastConnectionEstablishedTime_){var n=new Date().getTime()-this.lastConnectionEstablishedTime_;n>f2o&&(this.reconnectDelay_=rD),this.lastConnectionEstablishedTime_=null}var o=new Date().getTime()-this.lastConnectionAttemptTime_,r=Math.max(0,this.reconnectDelay_-o);r=Math.random()*r,this.log_("Trying to reconnect in "+r+"ms"),this.scheduleConnect_(r),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*d2o)}this.onConnectStatus_(!1)},e.prototype.establishConnection_=function(){return vo(this,void 0,void 0,function(){var n,o,r,i,a,l,s,c,u,d,f,p,g,y,w=this;return Ao(this,function(b){switch(b.label){case 0:if(!this.shouldReconnect_())return[3,4];this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null,n=this.onDataMessage_.bind(this),o=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+e.nextConnectionId_++,a=this.lastSessionId,l=!1,s=null,c=function(){s?s.close():(l=!0,r())},u=function(C){er(s,"sendRequest call when we're not connected not allowed."),s.sendRequest(C)},this.realtime_={close:c,sendRequest:u},d=this.forceTokenRefresh_,this.forceTokenRefresh_=!1,b.label=1;case 1:return b.trys.push([1,3,,4]),[4,Promise.all([this.authTokenProvider_.getToken(d),this.appCheckTokenProvider_.getToken(d)])];case 2:return f=rp.apply(void 0,[b.sent(),2]),p=f[0],g=f[1],l?bd("getToken() completed but was canceled"):(bd("getToken() completed. Creating connection."),this.authToken_=p&&p.accessToken,this.appCheckToken_=g&&g.token,s=new Sit(i,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,n,o,r,function(C){vf(C+" ("+w.repoInfo_.toString()+")"),w.interrupt(h2o)},a)),[3,4];case 3:return y=b.sent(),this.log_("Failed to get token: "+y),l||(this.repoInfo_.nodeAdmin&&vf(y),c()),[3,4];case 4:return[2]}})})},e.prototype.interrupt=function(n){bd("Interrupting connection for reason: "+n),this.interruptReasons_[n]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},e.prototype.resume=function(n){bd("Resuming connection for reason: "+n),delete this.interruptReasons_[n],Tde(this.interruptReasons_)&&(this.reconnectDelay_=rD,this.realtime_||this.scheduleConnect_(0))},e.prototype.handleTimestamp_=function(n){var o=n-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:o})},e.prototype.cancelSentTransactions_=function(){for(var n=0;n=EIe&&(this.reconnectDelay_=DIe,this.authTokenProvider_.notifyForInvalidToken()))},e.prototype.onAppCheckRevoked_=function(n,o){bd("App check token revoked: "+n+"/"+o),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(n==="invalid_token"||n==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=EIe&&this.appCheckTokenProvider_.notifyForInvalidToken())},e.prototype.onSecurityDebugPacket_=function(n){this.securityDebugCallback_?this.securityDebugCallback_(n):"msg"in n&&console.log("FIREBASE: "+n.msg.replace(` `,` -FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),this.tryAppCheck();try{for(var a=Pg(this.listens.values()),l=a.next();!l.done;l=a.next()){var s=l.value;try{for(var c=(r=void 0,Pg(s.values())),u=c.next();!u.done;u=c.next()){var d=u.value;this.sendListen_(d)}}catch(g){r={error:g}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}}}catch(g){n={error:g}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}for(var f=0;f0},t.prototype.peek=function(){if(this.nodeStack_.length===0)return null;var e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}},t}(),s2=function(){function t(e,n,o,r,i){this.key=e,this.value=n,this.color=o??t.RED,this.left=r??C6.EMPTY_NODE,this.right=i??C6.EMPTY_NODE}return t.prototype.copy=function(e,n,o,r,i){return new t(e??this.key,n??this.value,o??this.color,r??this.left,i??this.right)},t.prototype.count=function(){return this.left.count()+1+this.right.count()},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)},t.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},t.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},t.prototype.minKey=function(){return this.min_().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(e,n,o){var r=this,i=o(e,r.key);return i<0?r=r.copy(null,null,null,r.left.insert(e,n,o),null):i===0?r=r.copy(null,n,null,null,null):r=r.copy(null,null,null,null,r.right.insert(e,n,o)),r.fixUp_()},t.prototype.removeMin_=function(){if(this.left.isEmpty())return C6.EMPTY_NODE;var e=this;return!e.left.isRed_()&&!e.left.left.isRed_()&&(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()},t.prototype.remove=function(e,n){var o,r;if(o=this,n(e,o.key)<0)!o.left.isEmpty()&&!o.left.isRed_()&&!o.left.left.isRed_()&&(o=o.moveRedLeft_()),o=o.copy(null,null,null,o.left.remove(e,n),null);else{if(o.left.isRed_()&&(o=o.rotateRight_()),!o.right.isEmpty()&&!o.right.isRed_()&&!o.right.left.isRed_()&&(o=o.moveRedRight_()),n(e,o.key)===0){if(o.right.isEmpty())return C6.EMPTY_NODE;r=o.right.min_(),o=o.copy(r.key,r.value,null,null,o.right.removeMin_())}o=o.copy(null,null,null,null,o.right.remove(e,n))}return o.fixUp_()},t.prototype.isRed_=function(){return this.color},t.prototype.fixUp_=function(){var e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e},t.prototype.moveRedLeft_=function(){var e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e},t.prototype.moveRedRight_=function(){var e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e},t.prototype.rotateLeft_=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight_=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip_=function(){var e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)},t.prototype.checkMaxDepth_=function(){var e=this.check_();return Math.pow(2,e)<=this.count()+1},t.prototype.check_=function(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");var e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)},t.RED=!0,t.BLACK=!1,t}(),p2o=function(){function t(){}return t.prototype.copy=function(e,n,o,r,i){return this},t.prototype.insert=function(e,n,o){return new s2(e,n,null)},t.prototype.remove=function(e,n){return this},t.prototype.count=function(){return 0},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(e){return!1},t.prototype.reverseTraversal=function(e){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.check_=function(){return 0},t.prototype.isRed_=function(){return!1},t}(),C6=function(){function t(e,n){n===void 0&&(n=t.EMPTY_NODE),this.comparator_=e,this.root_=n}return t.prototype.insert=function(e,n){return new t(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,s2.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,s2.BLACK,null,null))},t.prototype.get=function(e){for(var n,o=this.root_;!o.isEmpty();){if(n=this.comparator_(e,o.key),n===0)return o.value;n<0?o=o.left:n>0&&(o=o.right)}return null},t.prototype.getPredecessorKey=function(e){for(var n,o=this.root_,r=null;!o.isEmpty();)if(n=this.comparator_(e,o.key),n===0){if(o.left.isEmpty())return r?r.key:null;for(o=o.left;!o.right.isEmpty();)o=o.right;return o.key}else n<0?o=o.left:n>0&&(r=o,o=o.right);throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")},t.prototype.isEmpty=function(){return this.root_.isEmpty()},t.prototype.count=function(){return this.root_.count()},t.prototype.minKey=function(){return this.root_.minKey()},t.prototype.maxKey=function(){return this.root_.maxKey()},t.prototype.inorderTraversal=function(e){return this.root_.inorderTraversal(e)},t.prototype.reverseTraversal=function(e){return this.root_.reverseTraversal(e)},t.prototype.getIterator=function(e){return new VO(this.root_,null,this.comparator_,!1,e)},t.prototype.getIteratorFrom=function(e,n){return new VO(this.root_,e,this.comparator_,!1,n)},t.prototype.getReverseIteratorFrom=function(e,n){return new VO(this.root_,e,this.comparator_,!0,n)},t.prototype.getReverseIterator=function(e){return new VO(this.root_,null,this.comparator_,!0,e)},t.EMPTY_NODE=new p2o,t}();/** + */var GO=function(){function t(e,n,o,r,i){i===void 0&&(i=null),this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];for(var a=1;!e.isEmpty();)if(e=e,a=n?o(e.key,n):1,r&&(a*=-1),a<0)this.isReverse_?e=e.left:e=e.right;else if(a===0){this.nodeStack_.push(e);break}else this.nodeStack_.push(e),this.isReverse_?e=e.right:e=e.left}return t.prototype.getNext=function(){if(this.nodeStack_.length===0)return null;var e=this.nodeStack_.pop(),n;if(this.resultGenerator_?n=this.resultGenerator_(e.key,e.value):n={key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return n},t.prototype.hasNext=function(){return this.nodeStack_.length>0},t.prototype.peek=function(){if(this.nodeStack_.length===0)return null;var e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}},t}(),s2=function(){function t(e,n,o,r,i){this.key=e,this.value=n,this.color=o??t.RED,this.left=r??C6.EMPTY_NODE,this.right=i??C6.EMPTY_NODE}return t.prototype.copy=function(e,n,o,r,i){return new t(e??this.key,n??this.value,o??this.color,r??this.left,i??this.right)},t.prototype.count=function(){return this.left.count()+1+this.right.count()},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)},t.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},t.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},t.prototype.minKey=function(){return this.min_().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(e,n,o){var r=this,i=o(e,r.key);return i<0?r=r.copy(null,null,null,r.left.insert(e,n,o),null):i===0?r=r.copy(null,n,null,null,null):r=r.copy(null,null,null,null,r.right.insert(e,n,o)),r.fixUp_()},t.prototype.removeMin_=function(){if(this.left.isEmpty())return C6.EMPTY_NODE;var e=this;return!e.left.isRed_()&&!e.left.left.isRed_()&&(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()},t.prototype.remove=function(e,n){var o,r;if(o=this,n(e,o.key)<0)!o.left.isEmpty()&&!o.left.isRed_()&&!o.left.left.isRed_()&&(o=o.moveRedLeft_()),o=o.copy(null,null,null,o.left.remove(e,n),null);else{if(o.left.isRed_()&&(o=o.rotateRight_()),!o.right.isEmpty()&&!o.right.isRed_()&&!o.right.left.isRed_()&&(o=o.moveRedRight_()),n(e,o.key)===0){if(o.right.isEmpty())return C6.EMPTY_NODE;r=o.right.min_(),o=o.copy(r.key,r.value,null,null,o.right.removeMin_())}o=o.copy(null,null,null,null,o.right.remove(e,n))}return o.fixUp_()},t.prototype.isRed_=function(){return this.color},t.prototype.fixUp_=function(){var e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e},t.prototype.moveRedLeft_=function(){var e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e},t.prototype.moveRedRight_=function(){var e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e},t.prototype.rotateLeft_=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight_=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip_=function(){var e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)},t.prototype.checkMaxDepth_=function(){var e=this.check_();return Math.pow(2,e)<=this.count()+1},t.prototype.check_=function(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");var e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)},t.RED=!0,t.BLACK=!1,t}(),p2o=function(){function t(){}return t.prototype.copy=function(e,n,o,r,i){return this},t.prototype.insert=function(e,n,o){return new s2(e,n,null)},t.prototype.remove=function(e,n){return this},t.prototype.count=function(){return 0},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(e){return!1},t.prototype.reverseTraversal=function(e){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.check_=function(){return 0},t.prototype.isRed_=function(){return!1},t}(),C6=function(){function t(e,n){n===void 0&&(n=t.EMPTY_NODE),this.comparator_=e,this.root_=n}return t.prototype.insert=function(e,n){return new t(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,s2.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,s2.BLACK,null,null))},t.prototype.get=function(e){for(var n,o=this.root_;!o.isEmpty();){if(n=this.comparator_(e,o.key),n===0)return o.value;n<0?o=o.left:n>0&&(o=o.right)}return null},t.prototype.getPredecessorKey=function(e){for(var n,o=this.root_,r=null;!o.isEmpty();)if(n=this.comparator_(e,o.key),n===0){if(o.left.isEmpty())return r?r.key:null;for(o=o.left;!o.right.isEmpty();)o=o.right;return o.key}else n<0?o=o.left:n>0&&(r=o,o=o.right);throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")},t.prototype.isEmpty=function(){return this.root_.isEmpty()},t.prototype.count=function(){return this.root_.count()},t.prototype.minKey=function(){return this.root_.minKey()},t.prototype.maxKey=function(){return this.root_.maxKey()},t.prototype.inorderTraversal=function(e){return this.root_.inorderTraversal(e)},t.prototype.reverseTraversal=function(e){return this.root_.reverseTraversal(e)},t.prototype.getIterator=function(e){return new GO(this.root_,null,this.comparator_,!1,e)},t.prototype.getIteratorFrom=function(e,n){return new GO(this.root_,e,this.comparator_,!1,n)},t.prototype.getReverseIteratorFrom=function(e,n){return new GO(this.root_,e,this.comparator_,!0,n)},t.prototype.getReverseIterator=function(e){return new GO(this.root_,null,this.comparator_,!0,e)},t.EMPTY_NODE=new p2o,t}();/** * @license * Copyright 2017 Google LLC * @@ -7619,7 +7619,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function g2o(t,e){return iS(t.name,e.name)}function _9e(t,e){return iS(t,e)}/** + */function g2o(t,e){return iS(t.name,e.name)}function V9e(t,e){return iS(t,e)}/** * @license * Copyright 2017 Google LLC * @@ -7649,7 +7649,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var EIe,$R=function(){function t(e,n){n===void 0&&(n=t.__childrenNodeConstructor.EMPTY_NODE),this.value_=e,this.priorityNode_=n,this.lazyHash_=null,er(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),Iit(this.priorityNode_)}return Object.defineProperty(t,"__childrenNodeConstructor",{get:function(){return EIe},set:function(e){EIe=e},enumerable:!1,configurable:!0}),t.prototype.isLeafNode=function(){return!0},t.prototype.getPriority=function(){return this.priorityNode_},t.prototype.updatePriority=function(e){return new t(this.value_,e)},t.prototype.getImmediateChild=function(e){return e===".priority"?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.getChild=function(e){return Ia(e)?this:Ma(e)===".priority"?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.hasChild=function(){return!1},t.prototype.getPredecessorChildName=function(e,n){return null},t.prototype.updateImmediateChild=function(e,n){return e===".priority"?this.updatePriority(n):n.isEmpty()&&e!==".priority"?this:t.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,n).updatePriority(this.priorityNode_)},t.prototype.updateChild=function(e,n){var o=Ma(e);return o===null?n:n.isEmpty()&&o!==".priority"?this:(er(o!==".priority"||Aw(e)===1,".priority must be the last token in a path"),this.updateImmediateChild(o,t.__childrenNodeConstructor.EMPTY_NODE.updateChild(Rs(e),n)))},t.prototype.isEmpty=function(){return!1},t.prototype.numChildren=function(){return 0},t.prototype.forEachChild=function(e,n){return!1},t.prototype.val=function(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},t.prototype.hash=function(){if(this.lazyHash_===null){var e="";this.priorityNode_.isEmpty()||(e+="priority:"+Mit(this.priorityNode_.val())+":");var n=typeof this.value_;e+=n+":",n==="number"?e+=lit(this.value_):e+=this.value_,this.lazyHash_=rit(e)}return this.lazyHash_},t.prototype.getValue=function(){return this.value_},t.prototype.compareTo=function(e){return e===t.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof t.__childrenNodeConstructor?-1:(er(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))},t.prototype.compareToLeafNode_=function(e){var n=typeof e.value_,o=typeof this.value_,r=t.VALUE_TYPE_ORDER.indexOf(n),i=t.VALUE_TYPE_ORDER.indexOf(o);return er(r>=0,"Unknown leaf type: "+n),er(i>=0,"Unknown leaf type: "+o),r===i?o==="object"?0:this.value_=0,"Unknown leaf type: "+n),er(i>=0,"Unknown leaf type: "+o),r===i?o==="object"?0:this.value_0;)r.getNext(),i=r.peek();return r},t.prototype.compareTo=function(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===eU?-1:0},t.prototype.withIndex=function(e){if(e===D9||this.indexMap_.hasIndex(e))return this;var n=this.indexMap_.addIndex(e,this.children_);return new t(this.children_,this.priorityNode_,n)},t.prototype.isIndexed=function(e){return e===D9||this.indexMap_.hasIndex(e)},t.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode())return!1;var n=e;if(this.getPriority().equals(n.getPriority()))if(this.children_.count()===n.children_.count()){for(var o=this.getIterator(qs),r=n.getIterator(qs),i=o.getNext(),a=r.getNext();i&&a;){if(i.name!==a.name||!i.node.equals(a.node))return!1;i=o.getNext(),a=r.getNext()}return i===null&&a===null}else return!1;else return!1},t.prototype.resolveIndex_=function(e){return e===D9?null:this.indexMap_.get(e.toString())},t.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,t}(),b2o=function(t){Pr(e,t);function e(){return t.call(this,new C6(_9e),sa.EMPTY_NODE,wJ.Default)||this}return e.prototype.compareTo=function(n){return n===this?0:1},e.prototype.equals=function(n){return n===this},e.prototype.getPriority=function(){return this},e.prototype.getImmediateChild=function(n){return sa.EMPTY_NODE},e.prototype.isEmpty=function(){return!1},e}(sa),eU=new b2o;Object.defineProperties(el,{MIN:{value:new el(aA,sa.EMPTY_NODE)},MAX:{value:new el(J9,eU)}});Hit.__EMPTY_NODE=sa.EMPTY_NODE;$R.__childrenNodeConstructor=sa;m2o(eU);A2o(eU);/** + */var iD,sa=function(){function t(e,n,o){this.children_=e,this.priorityNode_=n,this.indexMap_=o,this.lazyHash_=null,this.priorityNode_&&Iit(this.priorityNode_),this.children_.isEmpty()&&er(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(t,"EMPTY_NODE",{get:function(){return iD||(iD=new t(new C6(V9e),null,vJ.Default))},enumerable:!1,configurable:!0}),t.prototype.isLeafNode=function(){return!1},t.prototype.getPriority=function(){return this.priorityNode_||iD},t.prototype.updatePriority=function(e){return this.children_.isEmpty()?this:new t(this.children_,e,this.indexMap_)},t.prototype.getImmediateChild=function(e){if(e===".priority")return this.getPriority();var n=this.children_.get(e);return n===null?iD:n},t.prototype.getChild=function(e){var n=Ma(e);return n===null?this:this.getImmediateChild(n).getChild(Rs(e))},t.prototype.hasChild=function(e){return this.children_.get(e)!==null},t.prototype.updateImmediateChild=function(e,n){if(er(n,"We should always be passing snapshot nodes"),e===".priority")return this.updatePriority(n);var o=new el(e,n),r=void 0,i=void 0;n.isEmpty()?(r=this.children_.remove(e),i=this.indexMap_.removeFromIndexes(o,this.children_)):(r=this.children_.insert(e,n),i=this.indexMap_.addToIndexes(o,this.children_));var a=r.isEmpty()?iD:this.priorityNode_;return new t(r,a,i)},t.prototype.updateChild=function(e,n){var o=Ma(e);if(o===null)return n;er(Ma(e)!==".priority"||Aw(e)===1,".priority must be the last token in a path");var r=this.getImmediateChild(o).updateChild(Rs(e),n);return this.updateImmediateChild(o,r)},t.prototype.isEmpty=function(){return this.children_.isEmpty()},t.prototype.numChildren=function(){return this.children_.count()},t.prototype.val=function(e){if(this.isEmpty())return null;var n={},o=0,r=0,i=!0;if(this.forEachChild(qs,function(s,c){n[s]=c.val(e),o++,i&&t.INTEGER_REGEXP_.test(s)?r=Math.max(r,Number(s)):i=!1}),!e&&i&&r<2*o){var a=[];for(var l in n)a[l]=n[l];return a}else return e&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},t.prototype.hash=function(){if(this.lazyHash_===null){var e="";this.getPriority().isEmpty()||(e+="priority:"+Mit(this.getPriority().val())+":"),this.forEachChild(qs,function(n,o){var r=o.hash();r!==""&&(e+=":"+n+":"+r)}),this.lazyHash_=e===""?"":rit(e)}return this.lazyHash_},t.prototype.getPredecessorChildName=function(e,n,o){var r=this.resolveIndex_(o);if(r){var i=r.getPredecessorKey(new el(e,n));return i?i.name:null}else return this.children_.getPredecessorKey(e)},t.prototype.getFirstChildName=function(e){var n=this.resolveIndex_(e);if(n){var o=n.minKey();return o&&o.name}else return this.children_.minKey()},t.prototype.getFirstChild=function(e){var n=this.getFirstChildName(e);return n?new el(n,this.children_.get(n)):null},t.prototype.getLastChildName=function(e){var n=this.resolveIndex_(e);if(n){var o=n.maxKey();return o&&o.name}else return this.children_.maxKey()},t.prototype.getLastChild=function(e){var n=this.getLastChildName(e);return n?new el(n,this.children_.get(n)):null},t.prototype.forEachChild=function(e,n){var o=this.resolveIndex_(e);return o?o.inorderTraversal(function(r){return n(r.name,r.node)}):this.children_.inorderTraversal(n)},t.prototype.getIterator=function(e){return this.getIteratorFrom(e.minPost(),e)},t.prototype.getIteratorFrom=function(e,n){var o=this.resolveIndex_(n);if(o)return o.getIteratorFrom(e,function(a){return a});for(var r=this.children_.getIteratorFrom(e.name,el.Wrap),i=r.peek();i!=null&&n.compare(i,e)<0;)r.getNext(),i=r.peek();return r},t.prototype.getReverseIterator=function(e){return this.getReverseIteratorFrom(e.maxPost(),e)},t.prototype.getReverseIteratorFrom=function(e,n){var o=this.resolveIndex_(n);if(o)return o.getReverseIteratorFrom(e,function(a){return a});for(var r=this.children_.getReverseIteratorFrom(e.name,el.Wrap),i=r.peek();i!=null&&n.compare(i,e)>0;)r.getNext(),i=r.peek();return r},t.prototype.compareTo=function(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===tU?-1:0},t.prototype.withIndex=function(e){if(e===D9||this.indexMap_.hasIndex(e))return this;var n=this.indexMap_.addIndex(e,this.children_);return new t(this.children_,this.priorityNode_,n)},t.prototype.isIndexed=function(e){return e===D9||this.indexMap_.hasIndex(e)},t.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode())return!1;var n=e;if(this.getPriority().equals(n.getPriority()))if(this.children_.count()===n.children_.count()){for(var o=this.getIterator(qs),r=n.getIterator(qs),i=o.getNext(),a=r.getNext();i&&a;){if(i.name!==a.name||!i.node.equals(a.node))return!1;i=o.getNext(),a=r.getNext()}return i===null&&a===null}else return!1;else return!1},t.prototype.resolveIndex_=function(e){return e===D9?null:this.indexMap_.get(e.toString())},t.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,t}(),b2o=function(t){Pr(e,t);function e(){return t.call(this,new C6(V9e),sa.EMPTY_NODE,vJ.Default)||this}return e.prototype.compareTo=function(n){return n===this?0:1},e.prototype.equals=function(n){return n===this},e.prototype.getPriority=function(){return this},e.prototype.getImmediateChild=function(n){return sa.EMPTY_NODE},e.prototype.isEmpty=function(){return!1},e}(sa),tU=new b2o;Object.defineProperties(el,{MIN:{value:new el(aA,sa.EMPTY_NODE)},MAX:{value:new el(J9,tU)}});Hit.__EMPTY_NODE=sa.EMPTY_NODE;$R.__childrenNodeConstructor=sa;m2o(tU);A2o(tU);/** * @license * Copyright 2017 Google LLC * @@ -7724,7 +7724,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var S2o=!0;function n0(t,e){if(e===void 0&&(e=null),t===null)return sa.EMPTY_NODE;if(typeof t=="object"&&".priority"in t&&(e=t[".priority"]),er(e===null||typeof e=="string"||typeof e=="number"||typeof e=="object"&&".sv"in e,"Invalid priority type found: "+typeof e),typeof t=="object"&&".value"in t&&t[".value"]!==null&&(t=t[".value"]),typeof t!="object"||".sv"in t){var n=t;return new $R(n,n0(e))}if(!(t instanceof Array)&&S2o){var o=[],r=!1,i=t;if(Xu(i,function(c,u){if(c.substring(0,1)!=="."){var d=n0(u);d.isEmpty()||(r=r||!d.getPriority().isEmpty(),o.push(new el(c,d)))}}),o.length===0)return sa.EMPTY_NODE;var a=AJ(o,g2o,function(c){return c.name},_9e);if(r){var l=AJ(o,qs.getCompare());return new sa(a,n0(e),new wJ({".priority":l},{".priority":qs}))}else return new sa(a,n0(e),wJ.Default)}else{var s=sa.EMPTY_NODE;return Xu(t,function(c,u){if(Eg(t,c)&&c.substring(0,1)!=="."){var d=n0(u);(d.isLeafNode()||!d.isEmpty())&&(s=s.updateImmediateChild(c,d))}}),s.updatePriority(n0(e))}}y2o(n0);/** + */var S2o=!0;function n0(t,e){if(e===void 0&&(e=null),t===null)return sa.EMPTY_NODE;if(typeof t=="object"&&".priority"in t&&(e=t[".priority"]),er(e===null||typeof e=="string"||typeof e=="number"||typeof e=="object"&&".sv"in e,"Invalid priority type found: "+typeof e),typeof t=="object"&&".value"in t&&t[".value"]!==null&&(t=t[".value"]),typeof t!="object"||".sv"in t){var n=t;return new $R(n,n0(e))}if(!(t instanceof Array)&&S2o){var o=[],r=!1,i=t;if(Xu(i,function(c,u){if(c.substring(0,1)!=="."){var d=n0(u);d.isEmpty()||(r=r||!d.getPriority().isEmpty(),o.push(new el(c,d)))}}),o.length===0)return sa.EMPTY_NODE;var a=wJ(o,g2o,function(c){return c.name},V9e);if(r){var l=wJ(o,qs.getCompare());return new sa(a,n0(e),new vJ({".priority":l},{".priority":qs}))}else return new sa(a,n0(e),vJ.Default)}else{var s=sa.EMPTY_NODE;return Xu(t,function(c,u){if(Eg(t,c)&&c.substring(0,1)!=="."){var d=n0(u);(d.isLeafNode()||!d.isEmpty())&&(s=s.updateImmediateChild(c,d))}}),s.updatePriority(n0(e))}}y2o(n0);/** * @license * Copyright 2017 Google LLC * @@ -7739,7 +7739,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var V9e=function(t){Pr(e,t);function e(n){var o=t.call(this)||this;return o.indexPath_=n,er(!Ia(n)&&Ma(n)!==".priority","Can't create PathIndex with empty path or .priority key"),o}return e.prototype.extractChild=function(n){return n.getChild(this.indexPath_)},e.prototype.isDefinedOn=function(n){return!n.getChild(this.indexPath_).isEmpty()},e.prototype.compare=function(n,o){var r=this.extractChild(n.node),i=this.extractChild(o.node),a=r.compareTo(i);return a===0?iS(n.name,o.name):a},e.prototype.makePost=function(n,o){var r=n0(n),i=sa.EMPTY_NODE.updateChild(this.indexPath_,r);return new el(o,i)},e.prototype.maxPost=function(){var n=sa.EMPTY_NODE.updateChild(this.indexPath_,eU);return new el(J9,n)},e.prototype.toString=function(){return jk(this.indexPath_,0).join("/")},e}(hee);/** + */var G9e=function(t){Pr(e,t);function e(n){var o=t.call(this)||this;return o.indexPath_=n,er(!Ia(n)&&Ma(n)!==".priority","Can't create PathIndex with empty path or .priority key"),o}return e.prototype.extractChild=function(n){return n.getChild(this.indexPath_)},e.prototype.isDefinedOn=function(n){return!n.getChild(this.indexPath_).isEmpty()},e.prototype.compare=function(n,o){var r=this.extractChild(n.node),i=this.extractChild(o.node),a=r.compareTo(i);return a===0?iS(n.name,o.name):a},e.prototype.makePost=function(n,o){var r=n0(n),i=sa.EMPTY_NODE.updateChild(this.indexPath_,r);return new el(o,i)},e.prototype.maxPost=function(){var n=sa.EMPTY_NODE.updateChild(this.indexPath_,tU);return new el(J9,n)},e.prototype.toString=function(){return jk(this.indexPath_,0).join("/")},e}(hee);/** * @license * Copyright 2017 Google LLC * @@ -7754,7 +7754,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var T2o=function(t){Pr(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.compare=function(n,o){var r=n.node.compareTo(o.node);return r===0?iS(n.name,o.name):r},e.prototype.isDefinedOn=function(n){return!0},e.prototype.indexedValueChanged=function(n,o){return!n.equals(o)},e.prototype.minPost=function(){return el.MIN},e.prototype.maxPost=function(){return el.MAX},e.prototype.makePost=function(n,o){var r=n0(n);return new el(o,r)},e.prototype.toString=function(){return".value"},e}(hee),G9e=new T2o;/** + */var T2o=function(t){Pr(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.compare=function(n,o){var r=n.node.compareTo(o.node);return r===0?iS(n.name,o.name):r},e.prototype.isDefinedOn=function(n){return!0},e.prototype.indexedValueChanged=function(n,o){return!n.equals(o)},e.prototype.minPost=function(){return el.MIN},e.prototype.maxPost=function(){return el.MAX},e.prototype.makePost=function(n,o){var r=n0(n);return new el(o,r)},e.prototype.toString=function(){return".value"},e}(hee),X9e=new T2o;/** * @license * Copyright 2017 Google LLC * @@ -7769,7 +7769,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var QR="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",Rfe="-",Eit="z",Fit=786,P2o=function(){var t=0,e=[];return function(n){var o=n===t;t=n;var r,i=new Array(8);for(r=7;r>=0;r--)i[r]=QR.charAt(n%64),n=Math.floor(n/64);er(n===0,"Cannot push at time == 0");var a=i.join("");if(o){for(r=11;r>=0&&e[r]===63;r--)e[r]=0;e[r]++}else for(r=0;r<12;r++)e[r]=Math.floor(Math.random()*64);for(r=0;r<12;r++)a+=QR.charAt(e[r]);return er(a.length===20,"nextPushId: Length should be 20."),a}}(),FIe=function(t){if(t===""+W9e)return Rfe;var e=mJ(t);if(e!=null)return""+(e+1);for(var n=new Array(t.length),o=0;o=0&&n[r]===Eit;)r--;if(r===-1)return J9;var i=n[r],a=QR.charAt(QR.indexOf(i)+1);return n[r]=a,n.slice(0,r+1).join("")},kIe=function(t){if(t===""+sit)return aA;var e=mJ(t);if(e!=null)return""+(e-1);for(var n=new Array(t.length),o=0;o=0;r--)i[r]=QR.charAt(n%64),n=Math.floor(n/64);er(n===0,"Cannot push at time == 0");var a=i.join("");if(o){for(r=11;r>=0&&e[r]===63;r--)e[r]=0;e[r]++}else for(r=0;r<12;r++)e[r]=Math.floor(Math.random()*64);for(r=0;r<12;r++)a+=QR.charAt(e[r]);return er(a.length===20,"nextPushId: Length should be 20."),a}}(),kIe=function(t){if(t===""+N9e)return Rfe;var e=yJ(t);if(e!=null)return""+(e+1);for(var n=new Array(t.length),o=0;o=0&&n[r]===Eit;)r--;if(r===-1)return J9;var i=n[r],a=QR.charAt(QR.indexOf(i)+1);return n[r]=a,n.slice(0,r+1).join("")},LIe=function(t){if(t===""+sit)return aA;var e=yJ(t);if(e!=null)return""+(e-1);for(var n=new Array(t.length),o=0;o=200&&d.status<300){try{f=yk(d.responseText)}catch{vf("Failed to parse JSON response for "+u+": "+d.responseText)}r(null,f)}else d.status!==401&&d.status!==404&&vf("Got unsuccessful REST response for "+u+" Status: "+d.status),r(d.status);r=null}},d.open("GET",u,!0),d.send()})},e}(Tit);/** + */var E2o=function(t){Pr(e,t);function e(n,o,r,i){var a=t.call(this)||this;return a.repoInfo_=n,a.onDataUpdate_=o,a.authTokenProvider_=r,a.appCheckTokenProvider_=i,a.log_=eU("p:rest:"),a.listens_={},a}return e.prototype.reportStats=function(n){throw new Error("Method not implemented.")},e.getListenId_=function(n,o){return o!==void 0?"tag$"+o:(er(n._queryParams.isDefault(),"should have a tag if it's not a default query."),n._path.toString())},e.prototype.listen=function(n,o,r,i){var a=this,l=n._path.toString();this.log_("Listen called for "+l+" "+n._queryIdentifier);var s=e.getListenId_(n,r),c={};this.listens_[s]=c;var u=WIe(n._queryParams);this.restRequest_(l+".json",u,function(d,f){var p=f;if(d===404&&(p=null,d=null),d===null&&a.onDataUpdate_(l,p,!1,r),eb(a.listens_,s)===c){var g;d?d===401?g="permission_denied":g="rest_error:"+d:g="ok",i(g,null)}})},e.prototype.unlisten=function(n,o){var r=e.getListenId_(n,o);delete this.listens_[r]},e.prototype.get=function(n){var o=this,r=WIe(n._queryParams),i=n._path.toString(),a=new Bp;return this.restRequest_(i+".json",r,function(l,s){var c=s;l===404&&(c=null,l=null),l===null?(o.onDataUpdate_(i,c,!1,null),a.resolve(c)):a.reject(new Error(c))}),a.promise},e.prototype.refreshAuthToken=function(n){},e.prototype.restRequest_=function(n,o,r){var i=this;return o===void 0&&(o={}),o.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(function(a){var l=rp(a,2),s=l[0],c=l[1];s&&s.accessToken&&(o.auth=s.accessToken),c&&c.token&&(o.ac=c.token);var u=(i.repoInfo_.secure?"https://":"http://")+i.repoInfo_.host+n+"?ns="+i.repoInfo_.namespace+vUn(o);i.log_("Sending REST request for "+u);var d=new XMLHttpRequest;d.onreadystatechange=function(){if(r&&d.readyState===4){i.log_("REST Response for "+u+" received. status:",d.status,"response:",d.responseText);var f=null;if(d.status>=200&&d.status<300){try{f=yk(d.responseText)}catch{vf("Failed to parse JSON response for "+u+": "+d.responseText)}r(null,f)}else d.status!==401&&d.status!==404&&vf("Got unsuccessful REST response for "+u+" Status: "+d.status),r(d.status);r=null}},d.open("GET",u,!0),d.send()})},e}(Tit);/** * @license * Copyright 2017 Google LLC * @@ -7889,7 +7889,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function vJ(){return{value:null,children:new Map}}function RM(t,e,n){if(Ia(e))t.value=n,t.children.clear();else if(t.value!==null)t.value=t.value.updateChild(e,n);else{var o=Ma(e);t.children.has(o)||t.children.set(o,vJ());var r=t.children.get(o);e=Rs(e),RM(r,e,n)}}function Ife(t,e){if(Ia(e))return t.value=null,t.children.clear(),!0;if(t.value!==null){if(t.value.isLeafNode())return!1;var n=t.value;return t.value=null,n.forEachChild(qs,function(i,a){RM(t,new ls(i),a)}),Ife(t,e)}else if(t.children.size>0){var o=Ma(e);if(e=Rs(e),t.children.has(o)){var r=Ife(t.children.get(o),e);r&&t.children.delete(o)}return t.children.size===0}else return!0}function zfe(t,e,n){t.value!==null?n(e,t.value):k2o(t,function(o,r){var i=new ls(e.toString()+"/"+o);zfe(r,i,n)})}function k2o(t,e){t.children.forEach(function(n,o){e(o,n)})}/** + */function xJ(){return{value:null,children:new Map}}function RM(t,e,n){if(Ia(e))t.value=n,t.children.clear();else if(t.value!==null)t.value=t.value.updateChild(e,n);else{var o=Ma(e);t.children.has(o)||t.children.set(o,xJ());var r=t.children.get(o);e=Rs(e),RM(r,e,n)}}function Ife(t,e){if(Ia(e))return t.value=null,t.children.clear(),!0;if(t.value!==null){if(t.value.isLeafNode())return!1;var n=t.value;return t.value=null,n.forEachChild(qs,function(i,a){RM(t,new ls(i),a)}),Ife(t,e)}else if(t.children.size>0){var o=Ma(e);if(e=Rs(e),t.children.has(o)){var r=Ife(t.children.get(o),e);r&&t.children.delete(o)}return t.children.size===0}else return!0}function zfe(t,e,n){t.value!==null?n(e,t.value):k2o(t,function(o,r){var i=new ls(e.toString()+"/"+o);zfe(r,i,n)})}function k2o(t,e){t.children.forEach(function(n,o){e(o,n)})}/** * @license * Copyright 2017 Google LLC * @@ -7919,7 +7919,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var NIe=10*1e3,L2o=30*1e3,W2o=5*60*1e3,N2o=function(){function t(e,n){this.server_=n,this.statsToReport_={},this.statsListener_=new Nit(e);var o=NIe+(L2o-NIe)*Math.random();jE(this.reportStats_.bind(this),Math.floor(o))}return t.prototype.reportStats_=function(){var e=this,n=this.statsListener_.get(),o={},r=!1;Xu(n,function(i,a){a>0&&Eg(e.statsToReport_,i)&&(o[i]=a,r=!0)}),r&&this.server_.reportStats(o),jE(this.reportStats_.bind(this),Math.floor(Math.random()*2*W2o))},t}();function U2o(t,e){t.statsToReport_[e]=!0}/** + */var UIe=10*1e3,L2o=30*1e3,W2o=5*60*1e3,N2o=function(){function t(e,n){this.server_=n,this.statsToReport_={},this.statsListener_=new Nit(e);var o=UIe+(L2o-UIe)*Math.random();jE(this.reportStats_.bind(this),Math.floor(o))}return t.prototype.reportStats_=function(){var e=this,n=this.statsListener_.get(),o={},r=!1;Xu(n,function(i,a){a>0&&Eg(e.statsToReport_,i)&&(o[i]=a,r=!0)}),r&&this.server_.reportStats(o),jE(this.reportStats_.bind(this),Math.floor(Math.random()*2*W2o))},t}();function U2o(t,e){t.statsToReport_[e]=!0}/** * @license * Copyright 2017 Google LLC * @@ -7934,7 +7934,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var R2;(function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"})(R2||(R2={}));function J9e(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function K9e(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function q9e(t){return{fromUser:!1,fromServer:!0,queryId:t,tagged:!0}}/** + */var R2;(function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"})(R2||(R2={}));function K9e(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function q9e(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function $9e(t){return{fromUser:!1,fromServer:!0,queryId:t,tagged:!0}}/** * @license * Copyright 2017 Google LLC * @@ -7949,7 +7949,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var j2o=function(){function t(e,n,o){this.path=e,this.affectedTree=n,this.revert=o,this.type=R2.ACK_USER_WRITE,this.source=J9e()}return t.prototype.operationForChild=function(e){if(Ia(this.path)){if(this.affectedTree.value!=null)return er(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new ls(e));return new t(Ll(),n,this.revert)}else return er(Ma(this.path)===e,"operationForChild called for unrelated child."),new t(Rs(this.path),this.affectedTree,this.revert)},t}();/** + */var j2o=function(){function t(e,n,o){this.path=e,this.affectedTree=n,this.revert=o,this.type=R2.ACK_USER_WRITE,this.source=K9e()}return t.prototype.operationForChild=function(e){if(Ia(this.path)){if(this.affectedTree.value!=null)return er(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new ls(e));return new t(Ll(),n,this.revert)}else return er(Ma(this.path)===e,"operationForChild called for unrelated child."),new t(Rs(this.path),this.affectedTree,this.revert)},t}();/** * @license * Copyright 2017 Google LLC * @@ -7994,7 +7994,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var $9e=function(){function t(e,n,o){this.source=e,this.path=n,this.children=o,this.type=R2.MERGE}return t.prototype.operationForChild=function(e){if(Ia(this.path)){var n=this.children.subtree(new ls(e));return n.isEmpty()?null:n.value?new gee(this.source,Ll(),n.value):new t(this.source,Ll(),n)}else return er(Ma(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new t(this.source,Rs(this.path),this.children)},t.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},t}();/** + */var Q9e=function(){function t(e,n,o){this.source=e,this.path=n,this.children=o,this.type=R2.MERGE}return t.prototype.operationForChild=function(e){if(Ia(this.path)){var n=this.children.subtree(new ls(e));return n.isEmpty()?null:n.value?new gee(this.source,Ll(),n.value):new t(this.source,Ll(),n)}else return er(Ma(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new t(this.source,Rs(this.path),this.children)},t.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},t}();/** * @license * Copyright 2017 Google LLC * @@ -8039,7 +8039,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function mee(t,e){return{eventCache:t,serverCache:e}}function YE(t,e,n,o){return mee(new ww(e,n,o),t.serverCache)}function jit(t,e,n,o){return mee(t.eventCache,new ww(e,n,o))}function xJ(t){return t.eventCache.isFullyInitialized()?t.eventCache.getNode():null}function sb(t){return t.serverCache.isFullyInitialized()?t.serverCache.getNode():null}/** + */function mee(t,e){return{eventCache:t,serverCache:e}}function YE(t,e,n,o){return mee(new ww(e,n,o),t.serverCache)}function jit(t,e,n,o){return mee(t.eventCache,new ww(e,n,o))}function bJ(t){return t.eventCache.isFullyInitialized()?t.eventCache.getNode():null}function sb(t){return t.serverCache.isFullyInitialized()?t.serverCache.getNode():null}/** * @license * Copyright 2017 Google LLC * @@ -8069,7 +8069,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var U6=function(){function t(e){this.writeTree_=e}return t.empty=function(){return new t(new Lg(null))},t}();function OE(t,e,n){if(Ia(e))return new U6(new Lg(n));var o=t.writeTree_.findRootMostValueAndPath(e);if(o!=null){var r=o.path,i=o.value,a=lp(r,e);return i=i.updateChild(a,n),new U6(t.writeTree_.set(r,i))}else{var l=new Lg(n),s=t.writeTree_.setTree(e,l);return new U6(s)}}function Dfe(t,e,n){var o=t;return Xu(n,function(r,i){o=OE(o,Yc(e,r),i)}),o}function UIe(t,e){if(Ia(e))return U6.empty();var n=t.writeTree_.setTree(e,new Lg(null));return new U6(n)}function Efe(t,e){return aS(t,e)!=null}function aS(t,e){var n=t.writeTree_.findRootMostValueAndPath(e);return n!=null?t.writeTree_.get(n.path).getChild(lp(n.path,e)):null}function jIe(t){var e=[],n=t.writeTree_.value;return n!=null?n.isLeafNode()||n.forEachChild(qs,function(o,r){e.push(new el(o,r))}):t.writeTree_.children.inorderTraversal(function(o,r){r.value!=null&&e.push(new el(o,r.value))}),e}function V8(t,e){if(Ia(e))return t;var n=aS(t,e);return n!=null?new U6(new Lg(n)):new U6(t.writeTree_.subtree(e))}function Ffe(t){return t.writeTree_.isEmpty()}function eH(t,e){return Bit(Ll(),t.writeTree_,e)}function Bit(t,e,n){if(e.value!=null)return n.updateChild(t,e.value);var o=null;return e.children.inorderTraversal(function(r,i){r===".priority"?(er(i.value!==null,"Priority writes must always be leaf nodes"),o=i.value):n=Bit(Yc(t,r),i,n)}),!n.getChild(t).isEmpty()&&o!==null&&(n=n.updateChild(Yc(t,".priority"),o)),n}/** + */var U6=function(){function t(e){this.writeTree_=e}return t.empty=function(){return new t(new Lg(null))},t}();function OE(t,e,n){if(Ia(e))return new U6(new Lg(n));var o=t.writeTree_.findRootMostValueAndPath(e);if(o!=null){var r=o.path,i=o.value,a=lp(r,e);return i=i.updateChild(a,n),new U6(t.writeTree_.set(r,i))}else{var l=new Lg(n),s=t.writeTree_.setTree(e,l);return new U6(s)}}function Dfe(t,e,n){var o=t;return Xu(n,function(r,i){o=OE(o,Yc(e,r),i)}),o}function jIe(t,e){if(Ia(e))return U6.empty();var n=t.writeTree_.setTree(e,new Lg(null));return new U6(n)}function Efe(t,e){return aS(t,e)!=null}function aS(t,e){var n=t.writeTree_.findRootMostValueAndPath(e);return n!=null?t.writeTree_.get(n.path).getChild(lp(n.path,e)):null}function BIe(t){var e=[],n=t.writeTree_.value;return n!=null?n.isLeafNode()||n.forEachChild(qs,function(o,r){e.push(new el(o,r))}):t.writeTree_.children.inorderTraversal(function(o,r){r.value!=null&&e.push(new el(o,r.value))}),e}function V8(t,e){if(Ia(e))return t;var n=aS(t,e);return n!=null?new U6(new Lg(n)):new U6(t.writeTree_.subtree(e))}function Ffe(t){return t.writeTree_.isEmpty()}function eH(t,e){return Bit(Ll(),t.writeTree_,e)}function Bit(t,e,n){if(e.value!=null)return n.updateChild(t,e.value);var o=null;return e.children.inorderTraversal(function(r,i){r===".priority"?(er(i.value!==null,"Priority writes must always be leaf nodes"),o=i.value):n=Bit(Yc(t,r),i,n)}),!n.getChild(t).isEmpty()&&o!==null&&(n=n.updateChild(Yc(t,".priority"),o)),n}/** * @license * Copyright 2017 Google LLC * @@ -8084,7 +8084,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function yee(t,e){return Vit(e,t)}function G2o(t,e,n,o,r){er(o>t.lastWriteId,"Stacking an older write on top of newer ones"),r===void 0&&(r=!0),t.allWrites.push({path:e,snap:n,writeId:o,visible:r}),r&&(t.visibleWrites=OE(t.visibleWrites,e,n)),t.lastWriteId=o}function X2o(t,e,n,o){er(o>t.lastWriteId,"Stacking an older merge on top of newer ones"),t.allWrites.push({path:e,children:n,writeId:o,visible:!0}),t.visibleWrites=Dfe(t.visibleWrites,e,n),t.lastWriteId=o}function J2o(t,e){for(var n=0;n=0,"removeWrite called with nonexistent writeId.");var o=t.allWrites[n];t.allWrites.splice(n,1);for(var r=o.visible,i=!1,a=t.allWrites.length-1;r&&a>=0;){var l=t.allWrites[a];l.visible&&(a>=n&&q2o(l,o.path)?r=!1:Om(o.path,l.path)&&(i=!0)),a--}if(r){if(i)return $2o(t),!0;if(o.snap)t.visibleWrites=UIe(t.visibleWrites,o.path);else{var s=o.children;Xu(s,function(c){t.visibleWrites=UIe(t.visibleWrites,Yc(o.path,c))})}return!0}else return!1}function q2o(t,e){if(t.snap)return Om(t.path,e);for(var n in t.children)if(t.children.hasOwnProperty(n)&&Om(Yc(t.path,n),e))return!0;return!1}function $2o(t){t.visibleWrites=Yit(t.allWrites,Q2o,Ll()),t.allWrites.length>0?t.lastWriteId=t.allWrites[t.allWrites.length-1].writeId:t.lastWriteId=-1}function Q2o(t){return t.visible}function Yit(t,e,n){for(var o=U6.empty(),r=0;rt.lastWriteId,"Stacking an older write on top of newer ones"),r===void 0&&(r=!0),t.allWrites.push({path:e,snap:n,writeId:o,visible:r}),r&&(t.visibleWrites=OE(t.visibleWrites,e,n)),t.lastWriteId=o}function X2o(t,e,n,o){er(o>t.lastWriteId,"Stacking an older merge on top of newer ones"),t.allWrites.push({path:e,children:n,writeId:o,visible:!0}),t.visibleWrites=Dfe(t.visibleWrites,e,n),t.lastWriteId=o}function J2o(t,e){for(var n=0;n=0,"removeWrite called with nonexistent writeId.");var o=t.allWrites[n];t.allWrites.splice(n,1);for(var r=o.visible,i=!1,a=t.allWrites.length-1;r&&a>=0;){var l=t.allWrites[a];l.visible&&(a>=n&&q2o(l,o.path)?r=!1:Om(o.path,l.path)&&(i=!0)),a--}if(r){if(i)return $2o(t),!0;if(o.snap)t.visibleWrites=jIe(t.visibleWrites,o.path);else{var s=o.children;Xu(s,function(c){t.visibleWrites=jIe(t.visibleWrites,Yc(o.path,c))})}return!0}else return!1}function q2o(t,e){if(t.snap)return Om(t.path,e);for(var n in t.children)if(t.children.hasOwnProperty(n)&&Om(Yc(t.path,n),e))return!0;return!1}function $2o(t){t.visibleWrites=Yit(t.allWrites,Q2o,Ll()),t.allWrites.length>0?t.lastWriteId=t.allWrites[t.allWrites.length-1].writeId:t.lastWriteId=-1}function Q2o(t){return t.visible}function Yit(t,e,n){for(var o=U6.empty(),r=0;r0||!t.eventCache.isFullyInitialized()||r&&!o.getNode().equals(i)||!o.getNode().getPriority().equals(i.getPriority()))&&n.push(kit(xJ(e)))}}function Xit(t,e,n,o,r,i){var a=e.eventCache;if(SJ(o,n)!=null)return e;var l=void 0,s=void 0;if(Ia(n))if(er(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){var c=sb(e),u=c instanceof sa?c:sa.EMPTY_NODE,d=Q9e(o,u);l=t.filter.updateFullNode(e.eventCache.getNode(),d,i)}else{var f=bJ(o,sb(e));l=t.filter.updateFullNode(e.eventCache.getNode(),f,i)}else{var p=Ma(n);if(p===".priority"){er(Aw(n)===1,"Can't have a priority with additional path components");var g=a.getNode();s=e.serverCache.getNode();var y=BIe(o,n,g,s);y!=null?l=t.filter.updatePriority(g,y):l=a.getNode()}else{var w=Rs(n),b=void 0;if(a.isCompleteForChild(p)){s=e.serverCache.getNode();var C=BIe(o,n,a.getNode(),s);C!=null?b=a.getNode().getImmediateChild(p).updateChild(w,C):b=a.getNode().getImmediateChild(p)}else b=Z9e(o,p,e.serverCache);b!=null?l=t.filter.updateChild(a.getNode(),p,b,w,r,i):l=a.getNode()}}return YE(e,l,a.isFullyInitialized()||Ia(n),t.filter.filtersNodes())}function TJ(t,e,n,o,r,i,a,l){var s=e.serverCache,c,u=a?t.filter:t.filter.getIndexedFilter();if(Ia(n))c=u.updateFullNode(s.getNode(),o,null);else if(u.filtersNodes()&&!s.isFiltered()){var d=s.getNode().updateChild(n,o);c=u.updateFullNode(s.getNode(),d,null)}else{var f=Ma(n);if(!s.isCompleteForPath(n)&&Aw(n)>1)return e;var p=Rs(n),g=s.getNode().getImmediateChild(f),y=g.updateChild(p,o);f===".priority"?c=u.updatePriority(s.getNode(),y):c=u.updateChild(s.getNode(),f,y,p,Git,null)}var w=jit(e,c,s.isFullyInitialized()||Ia(n),u.filtersNodes()),b=new e3e(r,w,i);return Xit(t,w,n,r,b,l)}function kfe(t,e,n,o,r,i,a){var l=e.eventCache,s,c,u=new e3e(r,e,i);if(Ia(n))c=t.filter.updateFullNode(e.eventCache.getNode(),o,a),s=YE(e,c,!0,t.filter.filtersNodes());else{var d=Ma(n);if(d===".priority")c=t.filter.updatePriority(e.eventCache.getNode(),o),s=YE(e,c,l.isFullyInitialized(),l.isFiltered());else{var f=Rs(n),p=l.getNode().getImmediateChild(d),g=void 0;if(Ia(f))g=o;else{var y=u.getCompleteChild(d);y!=null?Y9e(f)===".priority"&&y.getChild(Cit(f)).isEmpty()?g=y:g=y.updateChild(f,o):g=sa.EMPTY_NODE}if(p.equals(g))s=e;else{var w=t.filter.updateChild(l.getNode(),d,g,f,u,a);s=YE(e,w,l.isFullyInitialized(),t.filter.filtersNodes())}}}return s}function YIe(t,e){return t.eventCache.isCompleteForChild(e)}function f5o(t,e,n,o,r,i,a){var l=e;return o.foreach(function(s,c){var u=Yc(n,s);YIe(e,Ma(u))&&(l=kfe(t,l,u,c,r,i,a))}),o.foreach(function(s,c){var u=Yc(n,s);YIe(e,Ma(u))||(l=kfe(t,l,u,c,r,i,a))}),l}function OIe(t,e,n){return n.foreach(function(o,r){e=e.updateChild(o,r)}),e}function Lfe(t,e,n,o,r,i,a,l){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;var s=e,c;Ia(n)?c=o:c=new Lg(null).setTree(n,o);var u=e.serverCache.getNode();return c.children.inorderTraversal(function(d,f){if(u.hasChild(d)){var p=e.serverCache.getNode().getImmediateChild(d),g=OIe(t,p,f);s=TJ(t,s,new ls(d),g,r,i,a,l)}}),c.children.inorderTraversal(function(d,f){var p=!e.serverCache.isCompleteForChild(d)&&f.value===void 0;if(!u.hasChild(d)&&!p){var g=e.serverCache.getNode().getImmediateChild(d),y=OIe(t,g,f);s=TJ(t,s,new ls(d),y,r,i,a,l)}}),s}function h5o(t,e,n,o,r,i,a){if(SJ(r,n)!=null)return e;var l=e.serverCache.isFiltered(),s=e.serverCache;if(o.value!=null){if(Ia(n)&&s.isFullyInitialized()||s.isCompleteForPath(n))return TJ(t,e,n,s.getNode().getChild(n),r,i,l,a);if(Ia(n)){var c=new Lg(null);return s.getNode().forEachChild(D9,function(d,f){c=c.set(new ls(d),f)}),Lfe(t,e,n,c,r,i,l,a)}else return e}else{var u=new Lg(null);return o.foreach(function(d,f){var p=Yc(n,d);s.isCompleteForPath(p)&&(u=u.set(d,s.getNode().getChild(p)))}),Lfe(t,e,n,u,r,i,l,a)}}function p5o(t,e,n,o,r){var i=e.serverCache,a=jit(e,i.getNode(),i.isFullyInitialized()||Ia(n),i.isFiltered());return Xit(t,a,n,o,Git,r)}function g5o(t,e,n,o,r,i){var a;if(SJ(o,n)!=null)return e;var l=new e3e(o,e,r),s=e.eventCache.getNode(),c=void 0;if(Ia(n)||Ma(n)===".priority"){var u=void 0;if(e.serverCache.isFullyInitialized())u=bJ(o,sb(e));else{var d=e.serverCache.getNode();er(d instanceof sa,"serverChildren would be complete if leaf node"),u=Q9e(o,d)}u=u,c=t.filter.updateFullNode(s,u,i)}else{var f=Ma(n),p=Z9e(o,f,e.serverCache);p==null&&e.serverCache.isCompleteForChild(f)&&(p=s.getImmediateChild(f)),p!=null?c=t.filter.updateChild(s,f,p,Rs(n),l,i):e.eventCache.getNode().hasChild(f)?c=t.filter.updateChild(s,f,sa.EMPTY_NODE,Rs(n),l,i):c=s,c.isEmpty()&&e.serverCache.isFullyInitialized()&&(a=bJ(o,sb(e)),a.isLeafNode()&&(c=t.filter.updateFullNode(c,a,i)))}return a=e.serverCache.isFullyInitialized()||SJ(o,Ll())!=null,YE(e,c,a,t.filter.filtersNodes())}/** + */function s5o(t){return{filter:t}}function c5o(t,e){er(e.eventCache.getNode().isIndexed(t.filter.getIndex()),"Event snap not indexed"),er(e.serverCache.getNode().isIndexed(t.filter.getIndex()),"Server snap not indexed")}function u5o(t,e,n,o,r){var i=new a5o,a,l;if(n.type===R2.OVERWRITE){var s=n;s.source.fromUser?a=kfe(t,e,s.path,s.snap,o,r,i):(er(s.source.fromServer,"Unknown source."),l=s.source.tagged||e.serverCache.isFiltered()&&!Ia(s.path),a=PJ(t,e,s.path,s.snap,o,r,l,i))}else if(n.type===R2.MERGE){var c=n;c.source.fromUser?a=f5o(t,e,c.path,c.children,o,r,i):(er(c.source.fromServer,"Unknown source."),l=c.source.tagged||e.serverCache.isFiltered(),a=Lfe(t,e,c.path,c.children,o,r,l,i))}else if(n.type===R2.ACK_USER_WRITE){var u=n;u.revert?a=g5o(t,e,u.path,o,r,i):a=h5o(t,e,u.path,u.affectedTree,o,r,i)}else if(n.type===R2.LISTEN_COMPLETE)a=p5o(t,e,n.path,o,i);else throw tM("Unknown operation type: "+n.type);var d=i.getChanges();return d5o(e,a,d),{viewCache:a,changes:d}}function d5o(t,e,n){var o=e.eventCache;if(o.isFullyInitialized()){var r=o.getNode().isLeafNode()||o.getNode().isEmpty(),i=bJ(t);(n.length>0||!t.eventCache.isFullyInitialized()||r&&!o.getNode().equals(i)||!o.getNode().getPriority().equals(i.getPriority()))&&n.push(kit(bJ(e)))}}function Xit(t,e,n,o,r,i){var a=e.eventCache;if(TJ(o,n)!=null)return e;var l=void 0,s=void 0;if(Ia(n))if(er(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){var c=sb(e),u=c instanceof sa?c:sa.EMPTY_NODE,d=Z9e(o,u);l=t.filter.updateFullNode(e.eventCache.getNode(),d,i)}else{var f=SJ(o,sb(e));l=t.filter.updateFullNode(e.eventCache.getNode(),f,i)}else{var p=Ma(n);if(p===".priority"){er(Aw(n)===1,"Can't have a priority with additional path components");var g=a.getNode();s=e.serverCache.getNode();var y=YIe(o,n,g,s);y!=null?l=t.filter.updatePriority(g,y):l=a.getNode()}else{var w=Rs(n),b=void 0;if(a.isCompleteForChild(p)){s=e.serverCache.getNode();var C=YIe(o,n,a.getNode(),s);C!=null?b=a.getNode().getImmediateChild(p).updateChild(w,C):b=a.getNode().getImmediateChild(p)}else b=e3e(o,p,e.serverCache);b!=null?l=t.filter.updateChild(a.getNode(),p,b,w,r,i):l=a.getNode()}}return YE(e,l,a.isFullyInitialized()||Ia(n),t.filter.filtersNodes())}function PJ(t,e,n,o,r,i,a,l){var s=e.serverCache,c,u=a?t.filter:t.filter.getIndexedFilter();if(Ia(n))c=u.updateFullNode(s.getNode(),o,null);else if(u.filtersNodes()&&!s.isFiltered()){var d=s.getNode().updateChild(n,o);c=u.updateFullNode(s.getNode(),d,null)}else{var f=Ma(n);if(!s.isCompleteForPath(n)&&Aw(n)>1)return e;var p=Rs(n),g=s.getNode().getImmediateChild(f),y=g.updateChild(p,o);f===".priority"?c=u.updatePriority(s.getNode(),y):c=u.updateChild(s.getNode(),f,y,p,Git,null)}var w=jit(e,c,s.isFullyInitialized()||Ia(n),u.filtersNodes()),b=new t3e(r,w,i);return Xit(t,w,n,r,b,l)}function kfe(t,e,n,o,r,i,a){var l=e.eventCache,s,c,u=new t3e(r,e,i);if(Ia(n))c=t.filter.updateFullNode(e.eventCache.getNode(),o,a),s=YE(e,c,!0,t.filter.filtersNodes());else{var d=Ma(n);if(d===".priority")c=t.filter.updatePriority(e.eventCache.getNode(),o),s=YE(e,c,l.isFullyInitialized(),l.isFiltered());else{var f=Rs(n),p=l.getNode().getImmediateChild(d),g=void 0;if(Ia(f))g=o;else{var y=u.getCompleteChild(d);y!=null?O9e(f)===".priority"&&y.getChild(Cit(f)).isEmpty()?g=y:g=y.updateChild(f,o):g=sa.EMPTY_NODE}if(p.equals(g))s=e;else{var w=t.filter.updateChild(l.getNode(),d,g,f,u,a);s=YE(e,w,l.isFullyInitialized(),t.filter.filtersNodes())}}}return s}function OIe(t,e){return t.eventCache.isCompleteForChild(e)}function f5o(t,e,n,o,r,i,a){var l=e;return o.foreach(function(s,c){var u=Yc(n,s);OIe(e,Ma(u))&&(l=kfe(t,l,u,c,r,i,a))}),o.foreach(function(s,c){var u=Yc(n,s);OIe(e,Ma(u))||(l=kfe(t,l,u,c,r,i,a))}),l}function _Ie(t,e,n){return n.foreach(function(o,r){e=e.updateChild(o,r)}),e}function Lfe(t,e,n,o,r,i,a,l){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;var s=e,c;Ia(n)?c=o:c=new Lg(null).setTree(n,o);var u=e.serverCache.getNode();return c.children.inorderTraversal(function(d,f){if(u.hasChild(d)){var p=e.serverCache.getNode().getImmediateChild(d),g=_Ie(t,p,f);s=PJ(t,s,new ls(d),g,r,i,a,l)}}),c.children.inorderTraversal(function(d,f){var p=!e.serverCache.isCompleteForChild(d)&&f.value===void 0;if(!u.hasChild(d)&&!p){var g=e.serverCache.getNode().getImmediateChild(d),y=_Ie(t,g,f);s=PJ(t,s,new ls(d),y,r,i,a,l)}}),s}function h5o(t,e,n,o,r,i,a){if(TJ(r,n)!=null)return e;var l=e.serverCache.isFiltered(),s=e.serverCache;if(o.value!=null){if(Ia(n)&&s.isFullyInitialized()||s.isCompleteForPath(n))return PJ(t,e,n,s.getNode().getChild(n),r,i,l,a);if(Ia(n)){var c=new Lg(null);return s.getNode().forEachChild(D9,function(d,f){c=c.set(new ls(d),f)}),Lfe(t,e,n,c,r,i,l,a)}else return e}else{var u=new Lg(null);return o.foreach(function(d,f){var p=Yc(n,d);s.isCompleteForPath(p)&&(u=u.set(d,s.getNode().getChild(p)))}),Lfe(t,e,n,u,r,i,l,a)}}function p5o(t,e,n,o,r){var i=e.serverCache,a=jit(e,i.getNode(),i.isFullyInitialized()||Ia(n),i.isFiltered());return Xit(t,a,n,o,Git,r)}function g5o(t,e,n,o,r,i){var a;if(TJ(o,n)!=null)return e;var l=new t3e(o,e,r),s=e.eventCache.getNode(),c=void 0;if(Ia(n)||Ma(n)===".priority"){var u=void 0;if(e.serverCache.isFullyInitialized())u=SJ(o,sb(e));else{var d=e.serverCache.getNode();er(d instanceof sa,"serverChildren would be complete if leaf node"),u=Z9e(o,d)}u=u,c=t.filter.updateFullNode(s,u,i)}else{var f=Ma(n),p=e3e(o,f,e.serverCache);p==null&&e.serverCache.isCompleteForChild(f)&&(p=s.getImmediateChild(f)),p!=null?c=t.filter.updateChild(s,f,p,Rs(n),l,i):e.eventCache.getNode().hasChild(f)?c=t.filter.updateChild(s,f,sa.EMPTY_NODE,Rs(n),l,i):c=s,c.isEmpty()&&e.serverCache.isFullyInitialized()&&(a=SJ(o,sb(e)),a.isLeafNode()&&(c=t.filter.updateFullNode(c,a,i)))}return a=e.serverCache.isFullyInitialized()||TJ(o,Ll())!=null,YE(e,c,a,t.filter.filtersNodes())}/** * @license * Copyright 2017 Google LLC * @@ -8144,7 +8144,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var m5o=function(){function t(e,n){this.query_=e,this.eventRegistrations_=[];var o=this.query_._queryParams,r=new X9e(o.getIndex()),i=H2o(o);this.processor_=s5o(i);var a=n.serverCache,l=n.eventCache,s=r.updateFullNode(sa.EMPTY_NODE,a.getNode(),null),c=i.updateFullNode(sa.EMPTY_NODE,l.getNode(),null),u=new ww(s,a.isFullyInitialized(),r.filtersNodes()),d=new ww(c,l.isFullyInitialized(),i.filtersNodes());this.viewCache_=mee(d,u),this.eventGenerator_=new B2o(this.query_)}return Object.defineProperty(t.prototype,"query",{get:function(){return this.query_},enumerable:!1,configurable:!0}),t}();function y5o(t){return t.viewCache_.serverCache.getNode()}function A5o(t){return xJ(t.viewCache_)}function w5o(t,e){var n=sb(t.viewCache_);return n&&(t.query._queryParams.loadsAllData()||!Ia(e)&&!n.getImmediateChild(Ma(e)).isEmpty())?n.getChild(e):null}function _Ie(t){return t.eventRegistrations_.length===0}function v5o(t,e){t.eventRegistrations_.push(e)}function VIe(t,e,n){var o=[];if(n){er(e==null,"A cancel should cancel all event registrations.");var r=t.query._path;t.eventRegistrations_.forEach(function(s){var c=s.createCancelEvent(n,r);c&&o.push(c)})}if(e){for(var i=[],a=0;a0&&!o)if(c){var b=null;t.listenProvider_.stopListening(_E(e),b)}else s.forEach(function(C){var P=t.queryToTagMap.get(vee(C));t.listenProvider_.stopListening(_E(C),P)});N5o(t,s)}return a}function F5o(t,e,n,o){var r=o3e(t,o);if(r!=null){var i=r3e(r),a=i.path,l=i.queryId,s=lp(a,e),c=new gee(q9e(l),s,n);return i3e(t,a,c)}else return[]}function k5o(t,e,n,o){var r=o3e(t,o);if(r){var i=r3e(r),a=i.path,l=i.queryId,s=lp(a,e),c=Lg.fromObject(n),u=new $9e(q9e(l),s,c);return i3e(t,a,u)}else return[]}function JIe(t,e,n){var o=e._path,r=null,i=!1;t.syncPointTree_.foreachOnPath(o,function(y,w){var b=lp(y,o);r=r||G8(w,b),i=i||vw(w)});var a=t.syncPointTree_.get(o);a?(i=i||vw(a),r=r||G8(a,Ll())):(a=new Kit,t.syncPointTree_=t.syncPointTree_.set(o,a));var l;if(r!=null)l=!0;else{l=!1,r=sa.EMPTY_NODE;var s=t.syncPointTree_.subtree(o);s.foreachChild(function(y,w){var b=G8(w,Ll());b&&(r=r.updateImmediateChild(y,b))})}var c=Zit(a,e);if(!c&&!e._queryParams.loadsAllData()){var u=vee(e);er(!t.queryToTagMap.has(u),"View does not exist, but we have a tag");var d=U5o();t.queryToTagMap.set(u,d),t.tagToQueryMap.set(d,u)}var f=yee(t.pendingWriteTree_,o),p=P5o(a,e,n,f,r,l);if(!c&&!i){var g=Qit(a,e);p=p.concat(j5o(t,e,g))}return p}function wee(t,e,n){var o=!0,r=t.pendingWriteTree_,i=t.syncPointTree_.findOnPath(e,function(a,l){var s=lp(a,e),c=G8(l,s);if(c)return c});return Oit(r,e,i,n,o)}function L5o(t,e){var n=e._path,o=null;t.syncPointTree_.foreachOnPath(n,function(c,u){var d=lp(c,n);o=o||G8(u,d)});var r=t.syncPointTree_.get(n);r?o=o||G8(r,Ll()):(r=new Kit,t.syncPointTree_=t.syncPointTree_.set(n,r));var i=o!=null,a=i?new ww(o,!0,!1):null,l=yee(t.pendingWriteTree_,e._path),s=qit(r,e,l,i?a.getNode():sa.EMPTY_NODE,i);return A5o(s)}function HM(t,e){return eat(e,t.syncPointTree_,null,yee(t.pendingWriteTree_,Ll()))}function eat(t,e,n,o){if(Ia(t.path))return tat(t,e,n,o);var r=e.get(Ll());n==null&&r!=null&&(n=G8(r,Ll()));var i=[],a=Ma(t.path),l=t.operationForChild(a),s=e.children.get(a);if(s&&l){var c=n?n.getImmediateChild(a):null,u=_it(o,a);i=i.concat(eat(l,s,c,u))}return r&&(i=i.concat(t3e(r,t,o,n))),i}function tat(t,e,n,o){var r=e.get(Ll());n==null&&r!=null&&(n=G8(r,Ll()));var i=[];return e.children.inorderTraversal(function(a,l){var s=n?n.getImmediateChild(a):null,c=_it(o,a),u=t.operationForChild(a);u&&(i=i.concat(tat(u,l,s,c)))}),r&&(i=i.concat(t3e(r,t,o,n))),i}function nat(t,e){var n=e.query,o=RJ(t,n);return{hashFn:function(){var r=y5o(e)||sa.EMPTY_NODE;return r.hash()},onComplete:function(r){if(r==="ok")return o?E5o(t,n._path,o):D5o(t,n._path);var i=Pyo(r,n);return Wfe(t,n,null,i)}}}function RJ(t,e){var n=vee(e);return t.queryToTagMap.get(n)}function vee(t){return t._path.toString()+"$"+t._queryIdentifier}function o3e(t,e){return t.tagToQueryMap.get(e)}function r3e(t){var e=t.indexOf("$");return er(e!==-1&&e0&&!o)if(c){var b=null;t.listenProvider_.stopListening(_E(e),b)}else s.forEach(function(C){var P=t.queryToTagMap.get(vee(C));t.listenProvider_.stopListening(_E(C),P)});N5o(t,s)}return a}function F5o(t,e,n,o){var r=r3e(t,o);if(r!=null){var i=i3e(r),a=i.path,l=i.queryId,s=lp(a,e),c=new gee($9e(l),s,n);return a3e(t,a,c)}else return[]}function k5o(t,e,n,o){var r=r3e(t,o);if(r){var i=i3e(r),a=i.path,l=i.queryId,s=lp(a,e),c=Lg.fromObject(n),u=new Q9e($9e(l),s,c);return a3e(t,a,u)}else return[]}function KIe(t,e,n){var o=e._path,r=null,i=!1;t.syncPointTree_.foreachOnPath(o,function(y,w){var b=lp(y,o);r=r||G8(w,b),i=i||vw(w)});var a=t.syncPointTree_.get(o);a?(i=i||vw(a),r=r||G8(a,Ll())):(a=new Kit,t.syncPointTree_=t.syncPointTree_.set(o,a));var l;if(r!=null)l=!0;else{l=!1,r=sa.EMPTY_NODE;var s=t.syncPointTree_.subtree(o);s.foreachChild(function(y,w){var b=G8(w,Ll());b&&(r=r.updateImmediateChild(y,b))})}var c=Zit(a,e);if(!c&&!e._queryParams.loadsAllData()){var u=vee(e);er(!t.queryToTagMap.has(u),"View does not exist, but we have a tag");var d=U5o();t.queryToTagMap.set(u,d),t.tagToQueryMap.set(d,u)}var f=yee(t.pendingWriteTree_,o),p=P5o(a,e,n,f,r,l);if(!c&&!i){var g=Qit(a,e);p=p.concat(j5o(t,e,g))}return p}function wee(t,e,n){var o=!0,r=t.pendingWriteTree_,i=t.syncPointTree_.findOnPath(e,function(a,l){var s=lp(a,e),c=G8(l,s);if(c)return c});return Oit(r,e,i,n,o)}function L5o(t,e){var n=e._path,o=null;t.syncPointTree_.foreachOnPath(n,function(c,u){var d=lp(c,n);o=o||G8(u,d)});var r=t.syncPointTree_.get(n);r?o=o||G8(r,Ll()):(r=new Kit,t.syncPointTree_=t.syncPointTree_.set(n,r));var i=o!=null,a=i?new ww(o,!0,!1):null,l=yee(t.pendingWriteTree_,e._path),s=qit(r,e,l,i?a.getNode():sa.EMPTY_NODE,i);return A5o(s)}function HM(t,e){return eat(e,t.syncPointTree_,null,yee(t.pendingWriteTree_,Ll()))}function eat(t,e,n,o){if(Ia(t.path))return tat(t,e,n,o);var r=e.get(Ll());n==null&&r!=null&&(n=G8(r,Ll()));var i=[],a=Ma(t.path),l=t.operationForChild(a),s=e.children.get(a);if(s&&l){var c=n?n.getImmediateChild(a):null,u=_it(o,a);i=i.concat(eat(l,s,c,u))}return r&&(i=i.concat(n3e(r,t,o,n))),i}function tat(t,e,n,o){var r=e.get(Ll());n==null&&r!=null&&(n=G8(r,Ll()));var i=[];return e.children.inorderTraversal(function(a,l){var s=n?n.getImmediateChild(a):null,c=_it(o,a),u=t.operationForChild(a);u&&(i=i.concat(tat(u,l,s,c)))}),r&&(i=i.concat(n3e(r,t,o,n))),i}function nat(t,e){var n=e.query,o=HJ(t,n);return{hashFn:function(){var r=y5o(e)||sa.EMPTY_NODE;return r.hash()},onComplete:function(r){if(r==="ok")return o?E5o(t,n._path,o):D5o(t,n._path);var i=Pyo(r,n);return Wfe(t,n,null,i)}}}function HJ(t,e){var n=vee(e);return t.queryToTagMap.get(n)}function vee(t){return t._path.toString()+"$"+t._queryIdentifier}function r3e(t,e){return t.tagToQueryMap.get(e)}function i3e(t){var e=t.indexOf("$");return er(e!==-1&&e0}function G5o(t){return lS(t)===void 0&&!rat(t)}function bee(t,e){Xu(t.node.children,function(n,o){e(new s3e(n,t,o))})}function iat(t,e,n,o){n&&!o&&e(t),bee(t,function(r){iat(r,e,!0,o)}),n&&o&&e(t)}function X5o(t,e,n){for(var o=t.parent;o!==null;){if(e(o))return!0;o=o.parent}return!1}function nU(t){return new ls(t.parent===null?t.name:nU(t.parent)+"/"+t.name)}function Nfe(t){t.parent!==null&&J5o(t.parent,t.name,t)}function J5o(t,e,n){var o=G5o(n),r=Eg(t.node.children,e);o&&r?(delete t.node.children[e],t.node.childCount--,Nfe(t)):!o&&!r&&(t.node.children[e]=n.node,t.node.childCount++,Nfe(t))}/** + */var c3e=function(){function t(e,n,o){e===void 0&&(e=""),n===void 0&&(n=null),o===void 0&&(o={children:{},childCount:0}),this.name=e,this.parent=n,this.node=o}return t}();function xee(t,e){for(var n=e instanceof ls?e:new ls(e),o=t,r=Ma(n);r!==null;){var i=eb(o.node.children,r)||{children:{},childCount:0};o=new c3e(r,o,i),n=Rs(n),r=Ma(n)}return o}function lS(t){return t.node.value}function u3e(t,e){t.node.value=e,Nfe(t)}function rat(t){return t.node.childCount>0}function G5o(t){return lS(t)===void 0&&!rat(t)}function bee(t,e){Xu(t.node.children,function(n,o){e(new c3e(n,t,o))})}function iat(t,e,n,o){n&&!o&&e(t),bee(t,function(r){iat(r,e,!0,o)}),n&&o&&e(t)}function X5o(t,e,n){for(var o=t.parent;o!==null;){if(e(o))return!0;o=o.parent}return!1}function oU(t){return new ls(t.parent===null?t.name:oU(t.parent)+"/"+t.name)}function Nfe(t){t.parent!==null&&J5o(t.parent,t.name,t)}function J5o(t,e,n){var o=G5o(n),r=Eg(t.node.children,e);o&&r?(delete t.node.children[e],t.node.childCount--,Nfe(t)):!o&&!r&&(t.node.children[e]=n.node,t.node.childCount++,Nfe(t))}/** * @license * Copyright 2017 Google LLC * @@ -8219,7 +8219,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var K5o=/[\[\].#$\/\u0000-\u001F\u007F]/,q5o=/[\[\].#$\u0000-\u001F\u007F]/,ile=10*1024*1024,See=function(t){return typeof t=="string"&&t.length!==0&&!K5o.test(t)},aat=function(t){return typeof t=="string"&&t.length!==0&&!q5o.test(t)},$5o=function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),aat(t)},Ok=function(t){return t===null||typeof t=="string"||typeof t=="number"&&!fee(t)||t&&typeof t=="object"&&Eg(t,".sv")},K9=function(t,e,n,o){o&&e===void 0||oU(Qp(t,"value"),e,n)},oU=function(t,e,n){var o=n instanceof ls?new i2o(n,t):n;if(e===void 0)throw new Error(t+"contains undefined "+gv(o));if(typeof e=="function")throw new Error(t+"contains a function "+gv(o)+" with contents = "+e.toString());if(fee(e))throw new Error(t+"contains "+e.toString()+" "+gv(o));if(typeof e=="string"&&e.length>ile/3&&cZ(e)>ile)throw new Error(t+"contains a string greater than "+ile+" utf8 bytes "+gv(o)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){var r=!1,i=!1;if(Xu(e,function(a,l){if(a===".value")r=!0;else if(a!==".priority"&&a!==".sv"&&(i=!0,!See(a)))throw new Error(t+" contains an invalid key ("+a+") "+gv(o)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);a2o(o,a),oU(t,l,o),l2o(o)}),r&&i)throw new Error(t+' contains ".value" child '+gv(o)+" in addition to actual children.")}},Q5o=function(t,e){var n,o;for(n=0;nile/3&&cZ(e)>ile)throw new Error(t+"contains a string greater than "+ile+" utf8 bytes "+gv(o)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){var r=!1,i=!1;if(Xu(e,function(a,l){if(a===".value")r=!0;else if(a!==".priority"&&a!==".sv"&&(i=!0,!See(a)))throw new Error(t+" contains an invalid key ("+a+") "+gv(o)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);a2o(o,a),rU(t,l,o),l2o(o)}),r&&i)throw new Error(t+' contains ".value" child '+gv(o)+" in addition to actual children.")}},Q5o=function(t,e){var n,o;for(n=0;n0&&(d=tH(t,i)),ry(t.eventQueue_,d,a)}function l9o(t,e){t.interceptServerDataCallback_=e}function $Ie(t,e){f3e(t,"connected",e),e===!1&&d9o(t)}function s9o(t,e){Xu(e,function(n,o){f3e(t,n,o)})}function f3e(t,e,n){var o=new ls("/.info/"+e),r=n0(n);t.infoData_.updateSnapshot(o,r);var i=tU(t.infoSyncTree_,o,r);ry(t.eventQueue_,o,i)}function Pee(t){return t.nextWriteId_++}function c9o(t,e){var n=L5o(t.serverSyncTree_,e);return n!=null?Promise.resolve(n):t.server_.get(e).then(function(o){var r=n0(o).withIndex(e._queryParams.getIndex()),i=tU(t.serverSyncTree_,e._path,r);return d3e(t.eventQueue_,e._path,i),Promise.resolve(r)},function(o){return MM(t,"get for query "+Fu(e)+" failed: "+o),Promise.reject(new Error(o))})}function h3e(t,e,n,o,r){MM(t,"set",{path:e.toString(),value:n,priority:o});var i=iU(t),a=n0(n,o),l=wee(t.serverSyncTree_,e),s=a3e(a,l,i),c=Pee(t),u=n3e(t.serverSyncTree_,e,s,c,!0);Tee(t.eventQueue_,u),t.server_.put(e.toString(),a.val(!0),function(f,p){var g=f==="ok";g||vf("set at "+e+" failed: "+f);var y=S8(t.serverSyncTree_,c,!g);ry(t.eventQueue_,e,y),xw(t,r,f,p)});var d=g3e(t,e);tH(t,d),ry(t.eventQueue_,d,[])}function u9o(t,e,n,o){MM(t,"update",{path:e.toString(),value:n});var r=!0,i=iU(t),a={};if(Xu(n,function(c,u){r=!1,a[c]=oat(Yc(e,c),n0(u),t.serverSyncTree_,i)}),r)bd("update() called with empty data. Don't do anything."),xw(t,o,"ok",void 0);else{var l=Pee(t),s=I5o(t.serverSyncTree_,e,a,l);Tee(t.eventQueue_,s),t.server_.merge(e.toString(),n,function(c,u){var d=c==="ok";d||vf("update at "+e+" failed: "+c);var f=S8(t.serverSyncTree_,l,!d),p=f.length>0?tH(t,e):e;ry(t.eventQueue_,p,f),xw(t,o,c,u)}),Xu(n,function(c){var u=g3e(t,Yc(e,c));tH(t,u)}),ry(t.eventQueue_,e,[])}}function d9o(t){MM(t,"onDisconnectEvents");var e=iU(t),n=vJ();zfe(t.onDisconnect_,Ll(),function(r,i){var a=oat(r,i,t.serverSyncTree_,e);RM(n,r,a)});var o=[];zfe(n,Ll(),function(r,i){o=o.concat(tU(t.serverSyncTree_,r,i));var a=g3e(t,r);tH(t,a)}),t.onDisconnect_=vJ(),ry(t.eventQueue_,Ll(),o)}function f9o(t,e,n){t.server_.onDisconnectCancel(e.toString(),function(o,r){o==="ok"&&Ife(t.onDisconnect_,e),xw(t,n,o,r)})}function QIe(t,e,n,o){var r=n0(n);t.server_.onDisconnectPut(e.toString(),r.val(!0),function(i,a){i==="ok"&&RM(t.onDisconnect_,e,r),xw(t,o,i,a)})}function h9o(t,e,n,o,r){var i=n0(n,o);t.server_.onDisconnectPut(e.toString(),i.val(!0),function(a,l){a==="ok"&&RM(t.onDisconnect_,e,i),xw(t,r,a,l)})}function p9o(t,e,n,o){if(Tde(n)){bd("onDisconnect().update() called with empty data. Don't do anything."),xw(t,o,"ok",void 0);return}t.server_.onDisconnectMerge(e.toString(),n,function(r,i){r==="ok"&&Xu(n,function(a,l){var s=n0(l);RM(t.onDisconnect_,Yc(e,a),s)}),xw(t,o,r,i)})}function g9o(t,e,n){var o;Ma(e._path)===".info"?o=JIe(t.infoSyncTree_,e,n):o=JIe(t.serverSyncTree_,e,n),d3e(t.eventQueue_,e._path,o)}function Ufe(t,e,n){var o;Ma(e._path)===".info"?o=Wfe(t.infoSyncTree_,e,n):o=Wfe(t.serverSyncTree_,e,n),d3e(t.eventQueue_,e._path,o)}function fat(t){t.persistentConnection_&&t.persistentConnection_.interrupt(uat)}function m9o(t){t.persistentConnection_&&t.persistentConnection_.resume(uat)}function y9o(t,e){if(e===void 0&&(e=!1),!(typeof console>"u")){var n;e?(t.statsListener_||(t.statsListener_=new Nit(t.stats_)),n=t.statsListener_.get()):n=t.stats_.get();var o=Object.keys(n).reduce(function(r,i){return Math.max(i.length,r)},0);Xu(n,function(r,i){for(var a=r,l=r.length;l0,"Sending zero length transaction queue");var o=n.every(function(r){return r.status===0});o&&v9o(t,nU(e),n)}else rat(e)&&bee(e,function(r){Cee(t,r)})}function v9o(t,e,n){for(var o=n.map(function(f){return f.currentWriteId}),r=p3e(t,e,o),i=r,a=r.hash(),l=0;l=r9o)f=!0,p="maxretry",r=r.concat(S8(t.serverSyncTree_,u.currentWriteId,!0));else{var g=p3e(t,u.path,a);u.currentInputSnapshot=g;var y=e[c].update(g.val());if(y!==void 0){oU("transaction failed: Data returned ",y,u.path);var w=n0(y),b=typeof y=="object"&&y!=null&&Eg(y,".priority");b||(w=w.updatePriority(g.getPriority()));var C=u.currentWriteId,P=iU(t),v=a3e(w,g,P);u.currentOutputSnapshotRaw=w,u.currentOutputSnapshotResolved=v,u.currentWriteId=Pee(t),a.splice(a.indexOf(C),1),r=r.concat(n3e(t.serverSyncTree_,u.path,v,u.currentWriteId,u.applyLocally)),r=r.concat(S8(t.serverSyncTree_,C,!0))}else f=!0,p="nodata",r=r.concat(S8(t.serverSyncTree_,u.currentWriteId,!0))}ry(t.eventQueue_,n,r),r=[],f&&(e[c].status=2,function(T){setTimeout(T,Math.floor(0))}(e[c].unwatcher),e[c].onComplete&&(p==="nodata"?o.push(function(){return e[c].onComplete(null,!1,e[c].currentInputSnapshot)}):o.push(function(){return e[c].onComplete(new Error(p),!1,null)})))},s=0;s0?n:void 0)}bee(e,function(i){Ree(t,i)})}function g3e(t,e){var n=nU(hat(t,e)),o=xee(t.transactionQueueTree_,e);return X5o(o,function(r){ale(t,r)}),ale(t,o),iat(o,function(r){ale(t,r)}),n}function ale(t,e){var n=lS(e);if(n){for(var o=[],r=[],i=-1,a=0;a0&&(d=tH(t,i)),ry(t.eventQueue_,d,a)}function l9o(t,e){t.interceptServerDataCallback_=e}function QIe(t,e){h3e(t,"connected",e),e===!1&&d9o(t)}function s9o(t,e){Xu(e,function(n,o){h3e(t,n,o)})}function h3e(t,e,n){var o=new ls("/.info/"+e),r=n0(n);t.infoData_.updateSnapshot(o,r);var i=nU(t.infoSyncTree_,o,r);ry(t.eventQueue_,o,i)}function Pee(t){return t.nextWriteId_++}function c9o(t,e){var n=L5o(t.serverSyncTree_,e);return n!=null?Promise.resolve(n):t.server_.get(e).then(function(o){var r=n0(o).withIndex(e._queryParams.getIndex()),i=nU(t.serverSyncTree_,e._path,r);return f3e(t.eventQueue_,e._path,i),Promise.resolve(r)},function(o){return MM(t,"get for query "+Fu(e)+" failed: "+o),Promise.reject(new Error(o))})}function p3e(t,e,n,o,r){MM(t,"set",{path:e.toString(),value:n,priority:o});var i=aU(t),a=n0(n,o),l=wee(t.serverSyncTree_,e),s=l3e(a,l,i),c=Pee(t),u=o3e(t.serverSyncTree_,e,s,c,!0);Tee(t.eventQueue_,u),t.server_.put(e.toString(),a.val(!0),function(f,p){var g=f==="ok";g||vf("set at "+e+" failed: "+f);var y=S8(t.serverSyncTree_,c,!g);ry(t.eventQueue_,e,y),xw(t,r,f,p)});var d=m3e(t,e);tH(t,d),ry(t.eventQueue_,d,[])}function u9o(t,e,n,o){MM(t,"update",{path:e.toString(),value:n});var r=!0,i=aU(t),a={};if(Xu(n,function(c,u){r=!1,a[c]=oat(Yc(e,c),n0(u),t.serverSyncTree_,i)}),r)bd("update() called with empty data. Don't do anything."),xw(t,o,"ok",void 0);else{var l=Pee(t),s=I5o(t.serverSyncTree_,e,a,l);Tee(t.eventQueue_,s),t.server_.merge(e.toString(),n,function(c,u){var d=c==="ok";d||vf("update at "+e+" failed: "+c);var f=S8(t.serverSyncTree_,l,!d),p=f.length>0?tH(t,e):e;ry(t.eventQueue_,p,f),xw(t,o,c,u)}),Xu(n,function(c){var u=m3e(t,Yc(e,c));tH(t,u)}),ry(t.eventQueue_,e,[])}}function d9o(t){MM(t,"onDisconnectEvents");var e=aU(t),n=xJ();zfe(t.onDisconnect_,Ll(),function(r,i){var a=oat(r,i,t.serverSyncTree_,e);RM(n,r,a)});var o=[];zfe(n,Ll(),function(r,i){o=o.concat(nU(t.serverSyncTree_,r,i));var a=m3e(t,r);tH(t,a)}),t.onDisconnect_=xJ(),ry(t.eventQueue_,Ll(),o)}function f9o(t,e,n){t.server_.onDisconnectCancel(e.toString(),function(o,r){o==="ok"&&Ife(t.onDisconnect_,e),xw(t,n,o,r)})}function ZIe(t,e,n,o){var r=n0(n);t.server_.onDisconnectPut(e.toString(),r.val(!0),function(i,a){i==="ok"&&RM(t.onDisconnect_,e,r),xw(t,o,i,a)})}function h9o(t,e,n,o,r){var i=n0(n,o);t.server_.onDisconnectPut(e.toString(),i.val(!0),function(a,l){a==="ok"&&RM(t.onDisconnect_,e,i),xw(t,r,a,l)})}function p9o(t,e,n,o){if(Tde(n)){bd("onDisconnect().update() called with empty data. Don't do anything."),xw(t,o,"ok",void 0);return}t.server_.onDisconnectMerge(e.toString(),n,function(r,i){r==="ok"&&Xu(n,function(a,l){var s=n0(l);RM(t.onDisconnect_,Yc(e,a),s)}),xw(t,o,r,i)})}function g9o(t,e,n){var o;Ma(e._path)===".info"?o=KIe(t.infoSyncTree_,e,n):o=KIe(t.serverSyncTree_,e,n),f3e(t.eventQueue_,e._path,o)}function Ufe(t,e,n){var o;Ma(e._path)===".info"?o=Wfe(t.infoSyncTree_,e,n):o=Wfe(t.serverSyncTree_,e,n),f3e(t.eventQueue_,e._path,o)}function fat(t){t.persistentConnection_&&t.persistentConnection_.interrupt(uat)}function m9o(t){t.persistentConnection_&&t.persistentConnection_.resume(uat)}function y9o(t,e){if(e===void 0&&(e=!1),!(typeof console>"u")){var n;e?(t.statsListener_||(t.statsListener_=new Nit(t.stats_)),n=t.statsListener_.get()):n=t.stats_.get();var o=Object.keys(n).reduce(function(r,i){return Math.max(i.length,r)},0);Xu(n,function(r,i){for(var a=r,l=r.length;l0,"Sending zero length transaction queue");var o=n.every(function(r){return r.status===0});o&&v9o(t,oU(e),n)}else rat(e)&&bee(e,function(r){Cee(t,r)})}function v9o(t,e,n){for(var o=n.map(function(f){return f.currentWriteId}),r=g3e(t,e,o),i=r,a=r.hash(),l=0;l=r9o)f=!0,p="maxretry",r=r.concat(S8(t.serverSyncTree_,u.currentWriteId,!0));else{var g=g3e(t,u.path,a);u.currentInputSnapshot=g;var y=e[c].update(g.val());if(y!==void 0){rU("transaction failed: Data returned ",y,u.path);var w=n0(y),b=typeof y=="object"&&y!=null&&Eg(y,".priority");b||(w=w.updatePriority(g.getPriority()));var C=u.currentWriteId,P=aU(t),v=l3e(w,g,P);u.currentOutputSnapshotRaw=w,u.currentOutputSnapshotResolved=v,u.currentWriteId=Pee(t),a.splice(a.indexOf(C),1),r=r.concat(o3e(t.serverSyncTree_,u.path,v,u.currentWriteId,u.applyLocally)),r=r.concat(S8(t.serverSyncTree_,C,!0))}else f=!0,p="nodata",r=r.concat(S8(t.serverSyncTree_,u.currentWriteId,!0))}ry(t.eventQueue_,n,r),r=[],f&&(e[c].status=2,function(T){setTimeout(T,Math.floor(0))}(e[c].unwatcher),e[c].onComplete&&(p==="nodata"?o.push(function(){return e[c].onComplete(null,!1,e[c].currentInputSnapshot)}):o.push(function(){return e[c].onComplete(new Error(p),!1,null)})))},s=0;s0?n:void 0)}bee(e,function(i){Ree(t,i)})}function m3e(t,e){var n=oU(hat(t,e)),o=xee(t.transactionQueueTree_,e);return X5o(o,function(r){ale(t,r)}),ale(t,o),iat(o,function(r){ale(t,r)}),n}function ale(t,e){var n=lS(e);if(n){for(var o=[],r=[],i=-1,a=0;a0){var r=n[o];try{r=decodeURIComponent(r.replace(/\+/g," "))}catch{}e+="/"+r}return e}function S9o(t){var e,n,o={};t.charAt(0)==="?"&&(t=t.substring(1));try{for(var r=Pg(t.split("&")),i=r.next();!i.done;i=r.next()){var a=i.value;if(a.length!==0){var l=a.split("=");l.length===2?o[decodeURIComponent(l[0])]=decodeURIComponent(l[1]):vf("Invalid query segment '"+a+"' in query '"+t+"'")}}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return o}var jfe=function(t,e){var n=T9o(t),o=n.namespace;n.domain==="firebase.com"&&X9(n.host+" is no longer supported. Please use .firebaseio.com instead"),(!o||o==="undefined")&&n.domain!=="localhost"&&X9("Cannot parse Firebase url. Please use https://.firebaseio.com"),n.secure||vyo();var r=n.scheme==="ws"||n.scheme==="wss";return{repoInfo:new U9e(n.host,n.secure,o,e,r,"",o!==n.subdomain),path:new ls(n.pathString)}},T9o=function(t){var e="",n="",o="",r="",i="",a=!0,l="https",s=443;if(typeof t=="string"){var c=t.indexOf("//");c>=0&&(l=t.substring(0,c-1),t=t.substring(c+2));var u=t.indexOf("/");u===-1&&(u=t.length);var d=t.indexOf("?");d===-1&&(d=t.length),e=t.substring(0,Math.min(u,d)),u=0?(a=l==="https"||l==="wss",s=parseInt(e.substring(c+1),10)):c=e.length;var p=e.slice(0,c);if(p.toLowerCase()==="localhost")n="localhost";else if(p.split(".").length<=2)n=p;else{var g=e.indexOf(".");o=e.substring(0,g).toLowerCase(),n=e.substring(g+1),i=o}"ns"in f&&(i=f.ns)}return{host:e,port:s,domain:n,subdomain:o,secure:a,scheme:l,pathString:r,namespace:i}};/** + */function b9o(t){for(var e="",n=t.split("/"),o=0;o0){var r=n[o];try{r=decodeURIComponent(r.replace(/\+/g," "))}catch{}e+="/"+r}return e}function S9o(t){var e,n,o={};t.charAt(0)==="?"&&(t=t.substring(1));try{for(var r=Pg(t.split("&")),i=r.next();!i.done;i=r.next()){var a=i.value;if(a.length!==0){var l=a.split("=");l.length===2?o[decodeURIComponent(l[0])]=decodeURIComponent(l[1]):vf("Invalid query segment '"+a+"' in query '"+t+"'")}}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return o}var jfe=function(t,e){var n=T9o(t),o=n.namespace;n.domain==="firebase.com"&&X9(n.host+" is no longer supported. Please use .firebaseio.com instead"),(!o||o==="undefined")&&n.domain!=="localhost"&&X9("Cannot parse Firebase url. Please use https://.firebaseio.com"),n.secure||vyo();var r=n.scheme==="ws"||n.scheme==="wss";return{repoInfo:new j9e(n.host,n.secure,o,e,r,"",o!==n.subdomain),path:new ls(n.pathString)}},T9o=function(t){var e="",n="",o="",r="",i="",a=!0,l="https",s=443;if(typeof t=="string"){var c=t.indexOf("//");c>=0&&(l=t.substring(0,c-1),t=t.substring(c+2));var u=t.indexOf("/");u===-1&&(u=t.length);var d=t.indexOf("?");d===-1&&(d=t.length),e=t.substring(0,Math.min(u,d)),u=0?(a=l==="https"||l==="wss",s=parseInt(e.substring(c+1),10)):c=e.length;var p=e.slice(0,c);if(p.toLowerCase()==="localhost")n="localhost";else if(p.split(".").length<=2)n=p;else{var g=e.indexOf(".");o=e.substring(0,g).toLowerCase(),n=e.substring(g+1),i=o}"ns"in f&&(i=f.ns)}return{host:e,port:s,domain:n,subdomain:o,secure:a,scheme:l,pathString:r,namespace:i}};/** * @license * Copyright 2017 Google LLC * @@ -8309,7 +8309,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var P9o=function(){function t(e,n){this._repo=e,this._path=n}return t.prototype.cancel=function(){var e=new Bp;return f9o(this._repo,this._path,e.wrapCallback(function(){})),e.promise},t.prototype.remove=function(){_m("OnDisconnect.remove",this._path);var e=new Bp;return QIe(this._repo,this._path,null,e.wrapCallback(function(){})),e.promise},t.prototype.set=function(e){_m("OnDisconnect.set",this._path),K9("OnDisconnect.set",e,this._path,!1);var n=new Bp;return QIe(this._repo,this._path,e,n.wrapCallback(function(){})),n.promise},t.prototype.setWithPriority=function(e,n){_m("OnDisconnect.setWithPriority",this._path),K9("OnDisconnect.setWithPriority",e,this._path,!1),u3e("OnDisconnect.setWithPriority",n);var o=new Bp;return h9o(this._repo,this._path,e,n,o.wrapCallback(function(){})),o.promise},t.prototype.update=function(e){_m("OnDisconnect.update",this._path),lat("OnDisconnect.update",e,this._path);var n=new Bp;return p9o(this._repo,this._path,e,n.wrapCallback(function(){})),n.promise},t}();/** + */var P9o=function(){function t(e,n){this._repo=e,this._path=n}return t.prototype.cancel=function(){var e=new Bp;return f9o(this._repo,this._path,e.wrapCallback(function(){})),e.promise},t.prototype.remove=function(){_m("OnDisconnect.remove",this._path);var e=new Bp;return ZIe(this._repo,this._path,null,e.wrapCallback(function(){})),e.promise},t.prototype.set=function(e){_m("OnDisconnect.set",this._path),K9("OnDisconnect.set",e,this._path,!1);var n=new Bp;return ZIe(this._repo,this._path,e,n.wrapCallback(function(){})),n.promise},t.prototype.setWithPriority=function(e,n){_m("OnDisconnect.setWithPriority",this._path),K9("OnDisconnect.setWithPriority",e,this._path,!1),d3e("OnDisconnect.setWithPriority",n);var o=new Bp;return h9o(this._repo,this._path,e,n,o.wrapCallback(function(){})),o.promise},t.prototype.update=function(e){_m("OnDisconnect.update",this._path),lat("OnDisconnect.update",e,this._path);var n=new Bp;return p9o(this._repo,this._path,e,n.wrapCallback(function(){})),n.promise},t}();/** * @license * Copyright 2020 Google LLC * @@ -8324,7 +8324,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var py=function(){function t(e,n,o,r){this._repo=e,this._path=n,this._queryParams=o,this._orderByCalled=r}return Object.defineProperty(t.prototype,"key",{get:function(){return Ia(this._path)?null:Y9e(this._path)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new w3(this._repo,this._path)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_queryIdentifier",{get:function(){var e=WIe(this._queryParams),n=L9e(e);return n==="{}"?"default":n},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_queryObject",{get:function(){return WIe(this._queryParams)},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){if(e=ba(e),!(e instanceof t))return!1;var n=this._repo===e._repo,o=O9e(this._path,e._path),r=this._queryIdentifier===e._queryIdentifier;return n&&o&&r},t.prototype.toJSON=function(){return this.toString()},t.prototype.toString=function(){return this._repo.toString()+o2o(this._path)},t}();function Hee(t,e){if(t._orderByCalled===!0)throw new Error(e+": You can't combine multiple orderBy calls.")}function Kw(t){var e=null,n=null;if(t.hasStart()&&(e=t.getIndexStartValue()),t.hasEnd()&&(n=t.getIndexEndValue()),t.getIndex()===D9){var o="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",r="Query: When ordering by key, the argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() must be a string.";if(t.hasStart()){var i=t.getIndexStartName();if(i!==aA)throw new Error(o);if(typeof e!="string")throw new Error(r)}if(t.hasEnd()){var a=t.getIndexEndName();if(a!==J9)throw new Error(o);if(typeof n!="string")throw new Error(r)}}else if(t.getIndex()===qs){if(e!=null&&!Ok(e)||n!=null&&!Ok(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(er(t.getIndex()instanceof V9e||t.getIndex()===G9e,"unknown index type."),e!=null&&typeof e=="object"||n!=null&&typeof n=="object")throw new Error("Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() cannot be an object.")}function Mee(t){if(t.hasStart()&&t.hasEnd()&&t.hasLimit()&&!t.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use limitToFirst() or limitToLast() instead.")}var w3=function(t){Pr(e,t);function e(n,o){return t.call(this,n,o,new Wit,!1)||this}return Object.defineProperty(e.prototype,"parent",{get:function(){var n=Cit(this._path);return n===null?null:new e(this._repo,n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){for(var n=this;n.parent!==null;)n=n.parent;return n},enumerable:!1,configurable:!0}),e}(py),Iee=function(){function t(e,n,o){this._node=e,this.ref=n,this._index=o}return Object.defineProperty(t.prototype,"priority",{get:function(){return this._node.getPriority().val()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"key",{get:function(){return this.ref.key},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._node.numChildren()},enumerable:!1,configurable:!0}),t.prototype.child=function(e){var n=new ls(e),o=cb(this.ref,e);return new t(this._node.getChild(n),o,qs)},t.prototype.exists=function(){return!this._node.isEmpty()},t.prototype.exportVal=function(){return this._node.val(!0)},t.prototype.forEach=function(e){var n=this;if(this._node.isLeafNode())return!1;var o=this._node;return!!o.forEachChild(this._index,function(r,i){return e(new t(i,cb(n.ref,r),qs))})},t.prototype.hasChild=function(e){var n=new ls(e);return!this._node.getChild(n).isEmpty()},t.prototype.hasChildren=function(){return this._node.isLeafNode()?!1:!this._node.isEmpty()},t.prototype.toJSON=function(){return this.exportVal()},t.prototype.val=function(){return this._node.val()},t}();function wat(t,e){return t=ba(t),t._checkNotDeleted("ref"),e!==void 0?cb(t._root,e):t._root}function ZIe(t,e){t=ba(t),t._checkNotDeleted("refFromURL");var n=jfe(e,t._repo.repoInfo_.nodeAdmin);sat("refFromURL",n);var o=n.repoInfo;return!t._repo.repoInfo_.isCustomHost()&&o.host!==t._repo.repoInfo_.host&&X9("refFromURL: Host name does not match the current database: (found "+o.host+" but expected "+t._repo.repoInfo_.host+")"),wat(t,n.path.toString())}function cb(t,e){return t=ba(t),Ma(t._path)===null?e9o("child","path",e):_k("child","path",e),new w3(t._repo,Yc(t._path,e))}function C9o(t,e){t=ba(t),_m("push",t._path),K9("push",e,t._path,!0);var n=dat(t._repo),o=P2o(n),r=cb(t,o),i=cb(t,o),a;return e!=null?a=m3e(i,e).then(function(){return i}):a=Promise.resolve(i),r.then=a.then.bind(a),r.catch=a.then.bind(a,void 0),r}function R9o(t){return _m("remove",t._path),m3e(t,null)}function m3e(t,e){t=ba(t),_m("set",t._path),K9("set",e,t._path,!1);var n=new Bp;return h3e(t._repo,t._path,e,null,n.wrapCallback(function(){})),n.promise}function H9o(t,e){t=ba(t),_m("setPriority",t._path),u3e("setPriority",e);var n=new Bp;return h3e(t._repo,Yc(t._path,".priority"),e,null,n.wrapCallback(function(){})),n.promise}function M9o(t,e,n){if(_m("setWithPriority",t._path),K9("setWithPriority",e,t._path,!1),u3e("setWithPriority",n),t.key===".length"||t.key===".keys")throw"setWithPriority failed: "+t.key+" is a read-only object.";var o=new Bp;return h3e(t._repo,t._path,e,n,o.wrapCallback(function(){})),o.promise}function I9o(t,e){lat("update",e,t._path);var n=new Bp;return u9o(t._repo,t._path,e,n.wrapCallback(function(){})),n.promise}function z9o(t){return t=ba(t),c9o(t._repo,t).then(function(e){return new Iee(e,new w3(t._repo,t._path),t._queryParams.getIndex())})}var vat=function(){function t(e){this.callbackContext=e}return t.prototype.respondsTo=function(e){return e==="value"},t.prototype.createEvent=function(e,n){var o=n._queryParams.getIndex();return new mat("value",this,new Iee(e.snapshotNode,new w3(n._repo,n._path),o))},t.prototype.getEventRunner=function(e){var n=this;return e.getEventType()==="cancel"?function(){return n.callbackContext.onCancel(e.error)}:function(){return n.callbackContext.onValue(e.snapshot,null)}},t.prototype.createCancelEvent=function(e,n){return this.callbackContext.hasCancelCallback?new yat(this,e,n):null},t.prototype.matches=function(e){return e instanceof t?!e.callbackContext||!this.callbackContext?!0:e.callbackContext.matches(this.callbackContext):!1},t.prototype.hasAnyCallback=function(){return this.callbackContext!==null},t}(),xat=function(){function t(e,n){this.eventType=e,this.callbackContext=n}return t.prototype.respondsTo=function(e){var n=e==="children_added"?"child_added":e;return n=n==="children_removed"?"child_removed":n,this.eventType===n},t.prototype.createCancelEvent=function(e,n){return this.callbackContext.hasCancelCallback?new yat(this,e,n):null},t.prototype.createEvent=function(e,n){er(e.childName!=null,"Child events should have a childName.");var o=cb(new w3(n._repo,n._path),e.childName),r=n._queryParams.getIndex();return new mat(e.type,this,new Iee(e.snapshotNode,o,r),e.prevName)},t.prototype.getEventRunner=function(e){var n=this;return e.getEventType()==="cancel"?function(){return n.callbackContext.onCancel(e.error)}:function(){return n.callbackContext.onValue(e.snapshot,e.prevName)}},t.prototype.matches=function(e){return e instanceof t?this.eventType===e.eventType&&(!this.callbackContext||!e.callbackContext||this.callbackContext.matches(e.callbackContext)):!1},t.prototype.hasAnyCallback=function(){return!!this.callbackContext},t}();function aU(t,e,n,o,r){var i;if(typeof o=="object"&&(i=void 0,r=o),typeof o=="function"&&(i=o),r&&r.onlyOnce){var a=n,l=function(u,d){Ufe(t._repo,t,c),a(u,d)};l.userCallback=n.userCallback,l.context=n.context,n=l}var s=new Aat(n,i||void 0),c=e==="value"?new vat(s):new xat(e,s);return g9o(t._repo,t,c),function(){return Ufe(t._repo,t,c)}}function Bfe(t,e,n,o){return aU(t,"value",e,n,o)}function eze(t,e,n,o){return aU(t,"child_added",e,n,o)}function tze(t,e,n,o){return aU(t,"child_changed",e,n,o)}function nze(t,e,n,o){return aU(t,"child_moved",e,n,o)}function oze(t,e,n,o){return aU(t,"child_removed",e,n,o)}function rze(t,e,n){var o=null,r=n?new Aat(n):null;e==="value"?o=new vat(r):e&&(o=new xat(e,r)),Ufe(t._repo,t,o)}var d5=function(){function t(){}return t}(),bat=function(t){Pr(e,t);function e(n,o){var r=t.call(this)||this;return r._value=n,r._key=o,r}return e.prototype._apply=function(n){K9("endAt",this._value,n._path,!0);var o=Mfe(n._queryParams,this._value,this._key);if(Mee(o),Kw(o),n._queryParams.hasEnd())throw new Error("endAt: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new py(n._repo,n._path,o,n._orderByCalled)},e}(d5);function D9o(t,e){return rU("endAt","key",e),new bat(t,e)}var E9o=function(t){Pr(e,t);function e(n,o){var r=t.call(this)||this;return r._value=n,r._key=o,r}return e.prototype._apply=function(n){K9("endBefore",this._value,n._path,!1);var o=D2o(n._queryParams,this._value,this._key);if(Mee(o),Kw(o),n._queryParams.hasEnd())throw new Error("endBefore: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new py(n._repo,n._path,o,n._orderByCalled)},e}(d5);function F9o(t,e){return rU("endBefore","key",e),new E9o(t,e)}var Sat=function(t){Pr(e,t);function e(n,o){var r=t.call(this)||this;return r._value=n,r._key=o,r}return e.prototype._apply=function(n){K9("startAt",this._value,n._path,!0);var o=Hfe(n._queryParams,this._value,this._key);if(Mee(o),Kw(o),n._queryParams.hasStart())throw new Error("startAt: Starting point was already set (by another call to startAt, startBefore or equalTo).");return new py(n._repo,n._path,o,n._orderByCalled)},e}(d5);function k9o(t,e){return t===void 0&&(t=null),rU("startAt","key",e),new Sat(t,e)}var L9o=function(t){Pr(e,t);function e(n,o){var r=t.call(this)||this;return r._value=n,r._key=o,r}return e.prototype._apply=function(n){K9("startAfter",this._value,n._path,!1);var o=z2o(n._queryParams,this._value,this._key);if(Mee(o),Kw(o),n._queryParams.hasStart())throw new Error("startAfter: Starting point was already set (by another call to startAt, startAfter, or equalTo).");return new py(n._repo,n._path,o,n._orderByCalled)},e}(d5);function W9o(t,e){return rU("startAfter","key",e),new L9o(t,e)}var N9o=function(t){Pr(e,t);function e(n){var o=t.call(this)||this;return o._limit=n,o}return e.prototype._apply=function(n){if(n._queryParams.hasLimit())throw new Error("limitToFirst: Limit was already set (by another call to limitToFirst or limitToLast).");return new py(n._repo,n._path,M2o(n._queryParams,this._limit),n._orderByCalled)},e}(d5);function U9o(t){if(typeof t!="number"||Math.floor(t)!==t||t<=0)throw new Error("limitToFirst: First argument must be a positive integer.");return new N9o(t)}var j9o=function(t){Pr(e,t);function e(n){var o=t.call(this)||this;return o._limit=n,o}return e.prototype._apply=function(n){if(n._queryParams.hasLimit())throw new Error("limitToLast: Limit was already set (by another call to limitToFirst or limitToLast).");return new py(n._repo,n._path,I2o(n._queryParams,this._limit),n._orderByCalled)},e}(d5);function B9o(t){if(typeof t!="number"||Math.floor(t)!==t||t<=0)throw new Error("limitToLast: First argument must be a positive integer.");return new j9o(t)}var Y9o=function(t){Pr(e,t);function e(n){var o=t.call(this)||this;return o._path=n,o}return e.prototype._apply=function(n){Hee(n,"orderByChild");var o=new ls(this._path);if(Ia(o))throw new Error("orderByChild: cannot pass in empty path. Use orderByValue() instead.");var r=new V9e(o),i=pee(n._queryParams,r);return Kw(i),new py(n._repo,n._path,i,!0)},e}(d5);function O9o(t){if(t==="$key")throw new Error('orderByChild: "$key" is invalid. Use orderByKey() instead.');if(t==="$priority")throw new Error('orderByChild: "$priority" is invalid. Use orderByPriority() instead.');if(t==="$value")throw new Error('orderByChild: "$value" is invalid. Use orderByValue() instead.');return _k("orderByChild","path",t),new Y9o(t)}var _9o=function(t){Pr(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._apply=function(n){Hee(n,"orderByKey");var o=pee(n._queryParams,D9);return Kw(o),new py(n._repo,n._path,o,!0)},e}(d5);function V9o(){return new _9o}var G9o=function(t){Pr(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._apply=function(n){Hee(n,"orderByPriority");var o=pee(n._queryParams,qs);return Kw(o),new py(n._repo,n._path,o,!0)},e}(d5);function X9o(){return new G9o}var J9o=function(t){Pr(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._apply=function(n){Hee(n,"orderByValue");var o=pee(n._queryParams,G9e);return Kw(o),new py(n._repo,n._path,o,!0)},e}(d5);function K9o(){return new J9o}var q9o=function(t){Pr(e,t);function e(n,o){var r=t.call(this)||this;return r._value=n,r._key=o,r}return e.prototype._apply=function(n){if(K9("equalTo",this._value,n._path,!1),n._queryParams.hasStart())throw new Error("equalTo: Starting point was already set (by another call to startAt/startAfter or equalTo).");if(n._queryParams.hasEnd())throw new Error("equalTo: Ending point was already set (by another call to endAt/endBefore or equalTo).");return new bat(this._value,this._key)._apply(new Sat(this._value,this._key)._apply(n))},e}(d5);function $9o(t,e){return rU("equalTo","key",e),new q9o(t,e)}function Ky(t){for(var e,n,o=[],r=1;r{const t=H(q8t),e=H($8t),n=H(mp),o=H(Pb),r=m.useRef(),i=n.schoolID??sc.UNKNOWN,a=n.classID??Va.UNKNOWN;return m.useEffect(()=>{const l={apiKey:"AIzaSyD-236qE4ix9TkH2AW_wjKSz8jgK0ukjW0",authDomain:"aladdin-316017.firebaseapp.com",projectId:"aladdin-316017",storageBucket:"aladdin-316017.appspot.com",databaseURL:"https://aladdin-2024.firebaseio.com",messagingSenderId:"169516488625",appId:"1:169516488625:web:bb0ae3c3f7c6e813250f90"};let s;for(const c of $n.apps)if(c.name===sG.LOG_DATA){s=c;break}s||(s=$n.initializeApp(l,sG.LOG_DATA)),s&&(r.current=$n.database(s))},[]),m.useEffect(()=>{e&&n.uid&&(async()=>{if(r.current){const s=e.timestamp+" ("+yc(new Date(e.timestamp)).format("MM-DD-YYYY hh:mm A")+")";await r.current.ref(i+"/"+a+"/"+n.uid+"/"+s).set({file:o??"Untitled",action:JSON.stringify(e)})}})().catch(s=>{SR("Data logger error: "+e+" - "+s)})},[e,n.uid,o]),m.useEffect(()=>{t&&(async()=>{if(r.current){const s=t.timestamp+" ("+yc(new Date(t.timestamp)).format("MM-DD-YYYY hh:mm A")+")";await r.current.ref(i+"/"+a+"/"+n.uid+"/"+s).set({file:o??"Untitled",action:JSON.stringify(t)})}})().catch(s=>{SR("Data logger error: "+t+" - "+s)})},[t,n.uid,a,i,o]),h.jsx(h.Fragment,{})}),F3o=be.memo(()=>{const t=H(yBe)??3.5,e=H(mBe)??.2,n=H(Nq)??GF,o=me.getShadowMapSize(),r=H(Dw),i=H(Ug),a=2*i,l=i+100,s=H(Ds),c=m.useRef(null);c.current&&(c.current.shadow.camera.left=-l,c.current.shadow.camera.bottom=-l,c.current.shadow.camera.right=l,c.current.shadow.camera.top=l,c.current.shadow.camera.updateProjectionMatrix());const u=r.z>0,d=u?r.normalize().dot(Io):0;return h.jsxs(h.Fragment,{children:[h.jsx("ambientLight",{intensity:Z6t+(u?e*d:0),name:"Ambient Light"}),h.jsx("directionalLight",{ref:c,name:"Directional Light",color:"white",position:r.normalize().multiplyScalar(a),intensity:u?t*d:0,castShadow:s,"shadow-bias":0,"shadow-mapSize-height":o,"shadow-mapSize-width":o,"shadow-camera-near":1,"shadow-camera-far":n})]})}),k3o=be.memo(({element:t})=>{const e=H(zwt),n=H(d1),o=H(ly),r=H(Bge),i=t.type===z.Roof,a="lightGray",l=o3(lW,fN),s={font:l,height:0,size:.2},c={font:l,height:0,size:.35},u=m.useMemo(()=>r(t,n??o),[n,o]),d=m.useMemo(()=>{const P=-Math.atan2(e.x,e.y)+Math.PI;return new nn(Gt,0,P,"ZXY")},[e.x,e.y]),f=()=>{let P=t.lz;return i&&(P=H.getState().selectedElementHeight),Math.ceil(P)+1},p=()=>{let P=t.lz;return i&&(P=t.rise),P.toFixed(1)+" m"},g=()=>i?H.getState().selectedElementHeight+1:t.lz-.175;if(!n&&!o)return null;const y=f(),w=p(),b=g(),C=new Array(y+1).fill(0);return h.jsxs("group",{position:u,rotation:d,name:"Vertical Ruler",children:[h.jsx(jn,{userData:{unintersectable:!0},points:[[0,0,0],[0,y,0]],color:a}),h.jsxs("mesh",{position:[-1.5,b,0],userData:{unintersectable:!0},children:[h.jsx("textGeometry",{args:[w,c]}),h.jsx("meshBasicMaterial",{attach:"material",color:"white"})]}),C.map((P,v)=>{const T=.2+(v%5===0?.05:0),A=h.jsx("textGeometry",{args:[`${v}`,s]});return h.jsxs("group",{children:[h.jsx(jn,{userData:{unintersectable:!0},points:[[-T,v,0],[T,v,0]],lineWidth:.5,color:a}),!i&&h.jsxs("mesh",{position:[.4,v-.125,0],userData:{unintersectable:!0},children:[A,h.jsx("meshBasicMaterial",{attach:"material",color:a})]})]},v)})]})}),L3o=be.memo(()=>{const t=H(Eb),e=H(Zq),n=H(d1),o=H(ly),r=H(hA),i=H(Ug),a=H(t$),l=H(e$),s=H(v=>{if(v.selectedElement){const T=v.selectedElement.id;return v.elements.find(A=>A.id===T)}}),[c,u]=m.useState(!1),[d,f]=m.useState(2*i),[p,g]=m.useState(2*i);m.useEffect(()=>{const v=Math.floor(i/50)+1,T=Math.round(i/v)*2;f(T*v),g(T)},[i]),m.useEffect(()=>{if(n){const v=me.isTopResizeHandle(n)||n===vt.UpperLeft&&(s==null?void 0:s.type)===z.Wall||n===vt.UpperRight&&(s==null?void 0:s.type)===z.Wall;u(!v)}else u(!1)},[n,s==null?void 0:s.type]);const y=()=>{if(!s)return!1;const v=s.type;return v===z.Foundation||v===z.Cuboid||v===z.Tree&&s.parentId===z.Ground||v===z.Human&&s.parentId===z.Ground},w=o===Kr.Lower||o===Kr.Upper,P=(v=>me.isTopResizeHandle(v)||(s==null?void 0:s.type)===z.Wall&&me.isTopResizeHandleOfWall(v)||(s==null?void 0:s.type)===z.Roof&&me.isRiseHandleOfRoof(v))(n??o);return s?h.jsxs(h.Fragment,{children:[((c||t||me.isMoveHandle(o))&&!r&&y()||a||l)&&h.jsx("gridHelper",{rotation:[Gt,0,0],name:"Grid",args:[d,p,"gray","#444444"]}),(e||w)&&s&&y()&&h.jsx(Nye,{element:s}),P&&h.jsx(k3o,{element:s})]}):null}),lle=120,tv="DarkSlateGray",lD="white",W3o=be.memo(({visible:t=!0})=>{const e=m.useRef(null),n=Jt(),o=window.devicePixelRatio,r=lle*o,i=r/150,l=20*i+"px serif";return m.useEffect(()=>{e.current&&Fn.setState({compassRef:e})},[]),m.useEffect(()=>{if(!e.current||!t)return;const s=e.current.getContext("2d");if(!s)return;const c=55*i,u=10*i,d=40*i,f=5*i,p=30*i,g=i,y=i,w=15*i,b=r/2;s.clearRect(0,0,r,r),s.beginPath(),s.arc(b,b,d,0,Math.PI*2),s.lineWidth=f,s.strokeStyle=tv,s.stroke(),s.beginPath(),s.arc(b,b,p,0,Math.PI*2),s.lineWidth=g,s.strokeStyle=tv,s.stroke(),s.lineWidth=y,s.beginPath(),s.moveTo(b,b-c),s.lineTo(b-u,b-u),s.lineTo(b,b),s.fillStyle=lD,s.stroke(),s.fill(),s.beginPath(),s.moveTo(b,b-c),s.lineTo(b+u,b-u),s.lineTo(b,b),s.fillStyle=tv,s.stroke(),s.fill(),s.beginPath(),s.moveTo(b,b+c),s.lineTo(b-u,b+u),s.lineTo(b,b),s.fillStyle=tv,s.stroke(),s.fill(),s.beginPath(),s.moveTo(b,b+c),s.lineTo(b+u,b+u),s.lineTo(b,b),s.fillStyle=lD,s.stroke(),s.fill(),s.beginPath(),s.moveTo(b-c,b),s.lineTo(b-u,b-u),s.lineTo(b,b),s.fillStyle=tv,s.stroke(),s.fill(),s.beginPath(),s.moveTo(b-c,b),s.lineTo(b-u,b+u),s.lineTo(b,b),s.fillStyle=lD,s.stroke(),s.fill(),s.beginPath(),s.moveTo(b+c,b),s.lineTo(b+u,b-u),s.lineTo(b,b),s.fillStyle=lD,s.stroke(),s.fill(),s.beginPath(),s.moveTo(b+c,b),s.lineTo(b+u,b+u),s.lineTo(b,b),s.fillStyle=tv,s.stroke(),s.fill(),s.font=l,s.fillStyle=lD,s.textAlign="center",s.fillText(`${Y.t("compass.N",n)}`,b,w),s.save(),s.translate(r,r),s.rotate(Math.PI),s.fillText(`${Y.t("compass.S",n)}`,b,w),s.restore(),s.fillStyle=tv,s.save(),s.translate(0,r),s.rotate(-Math.PI/2),s.fillText(`${Y.t("compass.W",n)}`,b,w),s.restore(),s.save(),s.translate(r,0),s.rotate(Math.PI/2),s.fillText(`${Y.t("compass.E",n)}`,b,w),s.restore()},[n,t]),t?h.jsx("canvas",{ref:e,id:"compassCanvas",width:r,height:r,style:{position:"absolute",bottom:"0",right:"0",height:`${lle}px`,width:`${lle}px`,margin:"5px",pointerEvents:"none"}}):null});var Rat={exports:{}};(function(t,e){(function(n,o){t.exports=o(m,Lq)})(window,function(n,o){return function(r){var i={};function a(l){if(i[l])return i[l].exports;var s=i[l]={i:l,l:!1,exports:{}};return r[l].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=r,a.c=i,a.d=function(l,s,c){a.o(l,s)||Object.defineProperty(l,s,{enumerable:!0,get:c})},a.r=function(l){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})},a.t=function(l,s){if(1&s&&(l=a(l)),8&s||4&s&&typeof l=="object"&&l&&l.__esModule)return l;var c=Object.create(null);if(a.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:l}),2&s&&typeof l!="string")for(var u in l)a.d(c,u,(function(d){return l[d]}).bind(null,u));return c},a.n=function(l){var s=l&&l.__esModule?function(){return l.default}:function(){return l};return a.d(s,"a",s),s},a.o=function(l,s){return Object.prototype.hasOwnProperty.call(l,s)},a.p="",a(a.s=0)}([function(r,i,a){Object.defineProperty(i,"__esModule",{value:!0});var l=a(1);Object.defineProperty(i,"default",{enumerable:!0,get:function(){return function(s){return s&&s.__esModule?s:{default:s}}(l).default}}),r.exports=i.default},function(r,i,a){Object.defineProperty(i,"__esModule",{value:!0});var l=Object.assign||function(y){for(var w=1;w0&&p[0]!==this)return!1;var R=b.target===document.body||S,M=this.childrenContainer&&this.childrenContainer.contains(b.target);if(!(x?M:R))return!1;var D=(0,d.findMatchedKey)(b,v);return!!D&&(T(D,b),!0)}},{key:"render",value:function(){var b=this,C=this.props.children,P=Object.assign({},this.props),v=!0,T=!1,A=void 0;try{for(var x,S=Object.keys(w.propTypes)[Symbol.iterator]();!(v=(x=S.next()).done);v=!0)delete P[x.value]}catch(R){T=!0,A=R}finally{try{!v&&S.return&&S.return()}finally{if(T)throw A}}return C?c.default.createElement("span",l({ref:function(R){b.childrenContainer=R}},P),C):null}}]),w}();i.default=g,g.propTypes={handleKeys:u.default.array,handleEventType:u.default.oneOf(["keydown","keyup","keypress"]),handleFocusableElements:u.default.bool,onKeyEvent:u.default.func,isDisabled:u.default.bool,isExclusive:u.default.bool,children:u.default.any},g.defaultProps={handleKeys:[],handleFocusableElements:!1,handleEventType:"keydown",onKeyEvent:function(){return null}},r.exports=i.default},function(r,i){r.exports=n},function(r,i){r.exports=o},function(r,i,a){function l(C,P,v){return P in C?Object.defineProperty(C,P,{value:v,enumerable:!0,configurable:!0,writable:!0}):C[P]=v,C}Object.defineProperty(i,"__esModule",{value:!0}),i.matchKeyEvent=b,i.findMatchedKey=function(C,P){var v=P.map(function(T){var A=T.toLowerCase(),x=w[A];return x||[T]}).reduce(function(T,A){return T.concat(A)},[]).find(function(T){return b(C,T)});return!v&&P.includes("all")&&(v="other"),v};var s={backspace:[8],del:[46],delete:[46],ins:[45],insert:[45],tab:[9],enter:[13],return:[13],esc:[27],space:[32],pageup:[33],pagedown:[34],end:[35],home:[36],left:[37],up:[38],right:[39],down:[40],shift:[16],ctrl:[17],alt:[18],cap:[20],num:[144],clear:[12],meta:[91],";":[186,59],"=":[187,61],",":[188,44],"-":[189,45,173,109],minus:[189,45,173,109],".":[190,110],"/":[191,111],"`":[192],"[":[219],"\\":[220],"]":[221],"*":[106],"+":[107],plus:[107],"'":[222],quote:[222]},c=Object.keys(s).reduce(function(C,P){return Object.assign(C,l({},P.toUpperCase(),s[P]))},{}),u="0123456789".split("").reduce(function(C,P,v){return Object.assign(C,l({},P,[v+48,v+96]))},{}),d="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").reduce(function(C,P,v){return Object.assign(C,l({},P.toLowerCase(),[v+65]),l({},P,[v+65]))},{}),f="1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19".split(",").reduce(function(C,P,v){return Object.assign(C,l({},"f"+P,[v+112]))},{}),p={control:"ctrl",ctrl:"ctrl",shift:"shift",meta:"meta",cmd:"meta",command:"meta",option:"alt",alt:"alt"},g=i.AllKeys=Object.assign({},s,c,u,d,f),y=Object.assign({},u,d),w={all:Object.keys(g),alphanumeric:Object.keys(y),numeric:Object.keys(u),alphabetic:Object.keys(d),function:Object.keys(f)};function b(C,P){var v=C.which||C.keyCode,T=C.type,A=Object.keys(p).filter(function(j){return C[j+"Key"]}).sort(),x=P.toLowerCase().trim(),S=x==="+"?["+"]:x.split(/\s?\+\s?/),R=S.pop(),M=g[R],D=S;if(T==="keypress")return P==String.fromCharCode(v).toLowerCase();if(D.length===0&&A.length===0)return M.indexOf(v)>=0;if(D.length>0&&A.length>0){var E=D.map(function(j){return p[j]}).sort(),W=E.length===A.length&&E.every(function(j,L){return A[L]===j});return M.indexOf(v)>=0&&W}return D.length==0&&A.length===1&&R===A[0]}}])})})(Rat);var N3o=Rat.exports;const ize=Fi(N3o),U3o=be.memo(()=>{var s,c;const t=H(fn),e=H(Vge),n=H(_ge),o=H(En),r=m.useRef(!1),i=m.useRef(!1);H(AOe),H(wOe),ht(u=>u.selectedElementId),m.useEffect(()=>{Fn.setState({listenToAutoDeletionByDeleteRef:r,listenToAutoDeletionByCutRef:i})},[]);const a=L2.debounce(()=>{var v,T;const u=ht.getState().selectedElementId,d=H.getState().selectedElementIdSet;if(!u||d.size===0)return;const f=H.getState().getAutoDeletedElements();if(!f)return;const p=H.getState().deletedElements,g=H.getState().elementsToPaste,y=(v=Fn.getState().listenToAutoDeletionByCutRef)==null?void 0:v.current,w=(T=Fn.getState().listenToAutoDeletionByDeleteRef)==null?void 0:T.current;let b=[],C="";y?(Fn.getState().setListenToAutoDeletionByCut(!1),b=[...g,...f],C="Cut"):w&&(Fn.getState().setListenToAutoDeletionByDelete(!1),b=[...p,...f],C="Delete");const P={name:C,timestamp:Date.now(),deletedElements:[...b],selectedElementId:u,selectedElementIdSet:new Set(d),undo(){const A=P.deletedElements;if(!A||A.length===0)return;for(const S of this.deletedElements)if(S.type===z.Wall){const R=S;R.leftJoints.length>0&&e(R.leftJoints[0],[R.id]),R.rightJoints.length>0&&n(R.rightJoints[0],[R.id])}else S.type===z.Roof&&t(R=>{R.addedRoofIdSet.add(S.id)});const x=A.find(S=>S.id===this.selectedElementId)??null;t(S=>{S.elements.push(...A),S.selectedElement=x,S.selectedElementIdSet=new Set(this.selectedElementIdSet),S.updateWallMapOnFoundationFlag=!S.updateWallMapOnFoundationFlag,S.deletedRoofId=null,S.autoDeletedRoofs=null,S.deletedRoofIdSet.clear(),S.autoDeletedRoofIdSet.clear(),S.autoDeletedChild=null})},redo(){P.deletedElements.length!==0&&(t(A=>{A.selectedElement=A.elements.find(x=>x.id===this.selectedElementId)??null,A.selectedElementIdSet=new Set(this.selectedElementIdSet)}),H.getState().removeSelectedElements())}};o(P),t(A=>{A.selectedElement=null,A.selectedElementIdSet.clear(),A.deletedRoofId=null,A.deletedRoofIdSet.clear(),A.autoDeletedRoofs=null,A.autoDeletedRoofIdSet.clear(),A.autoDeletedChild=null}),ht.getState().setPrimitiveStore("selectedElementId",null)},50);return(((s=Fn.getState().listenToAutoDeletionByCutRef)==null?void 0:s.current)||((c=Fn.getState().listenToAutoDeletionByDeleteRef)==null?void 0:c.current))&&H.getState().getAutoDeletedElements()&&a(),null}),aze=["left","up","right","down","shift+left","shift+up","shift+right","shift+down","ctrl+shift+left","ctrl+shift+up","ctrl+shift+right","ctrl+shift+down","meta+shift+left","meta+shift+up","meta+shift+right","meta+shift+down","ctrl+f","meta+f","ctrl+o","meta+o","ctrl+s","meta+s","ctrl+c","meta+c","ctrl+x","meta+x","ctrl+v","meta+v","ctrl+[","meta+[","ctrl+]","meta+]","ctrl+z","meta+z","ctrl+y","meta+y","ctrl+m","meta+m","ctrl+u","meta+u","ctrl+b","meta+b","shift","esc","ctrl+home","ctrl+alt+h","ctrl+shift+o","meta+shift+o","ctrl+shift+s","meta+shift+s","delete","backspace","alt+backspace","f2","f4","ctrl"],j3o=be.memo(({canvas:t})=>{const e=H(fn),n=H(ma),o=H(bW),r=H(s0),i=H(xwt),a=H(En),l=H(Id)??!1,s=H(Cb),c=H(Gn),u=H(FYe),d=H(yp),f=H(s7t),p=H(qr),g=H(_ge),y=H(Vge),w=H(m7t),b=H(Ege),C=.1,P=m.useMemo(()=>({lng:r}),[r]),v=(_,X)=>(t&&(t.style.cursor="default"),d(_,X)),T=()=>{if(H.getState().viewState.navigationView)return;const _=H.getState().set2DView,X={name:"Set 2D View",timestamp:Date.now(),checked:!l,undo:()=>{_(!X.checked)},redo:()=>{_(X.checked)}};a(X),_(!l),e($=>{$.viewState.autoRotate=!1})},A=()=>{if(l)return;const _=H.getState().setNavigationView,X={name:"Set Navigation View",timestamp:Date.now(),checked:!H.getState().viewState.navigationView,undo:()=>{_(!X.checked)},redo:()=>{_(X.checked)}};a(X),_(!H.getState().viewState.navigationView),e($=>{$.viewState.autoRotate=!1})},x=()=>{if(l)return;const _={name:"Auto Rotate",timestamp:Date.now(),checked:!H.getState().viewState.autoRotate,undo:()=>{e(X=>{X.objectTypeToAdd=z.None,X.groupActionMode=!1,X.viewState.autoRotate=!_.checked})},redo:()=>{e(X=>{X.objectTypeToAdd=z.None,X.groupActionMode=!1,X.viewState.autoRotate=_.checked})}};a(_),e(X=>{X.objectTypeToAdd=z.None,X.groupActionMode=!1,X.viewState.autoRotate=!X.viewState.autoRotate})},S=(_,X,$)=>{const Q=JSON.parse(JSON.stringify(_));if(Q.cx=X,Q.cy=$,_.type===z.SolarPanel&&_.parentType===z.Roof){if(_.parentId&&_.foundationId){const le=c(_.parentId),q=c(_.foundationId);if(le&&q){const te=Cn.getRoofBoundaryVertices(le),re=Cn.getSolarPanelVerticesOnRoof(Q,q);if(!s$e(re,te)||!c$e(Q,q,re))return!1}}return!0}if(b(Q))return po(Y.t("message.MoveCancelledBecauseOfOverlap",P)),!1;if(Q.type===z.SolarPanel){const le=p(_);if(le&&!me.isSolarCollectorWithinHorizontalSurface(Q,le))return po(Y.t("message.MoveOutsideBoundaryCancelled",P)),!1}return!0},R=_=>{switch(_.type){case z.Roof:case z.Door:case z.Window:return!1;case z.SolarPanel:case z.Sensor:case z.Light:{const X=_;return X.parentType===z.Wall||X.parentType===z.Roof?!1:X.parentType===z.Cuboid?X.rotation[2]===1:!0}case z.Wall:{const X=_;return!(X.leftJoints.length!==0||X.rightJoints.length!==0)}default:return!0}},M=(_,X)=>{switch(_){case z.Foundation:case z.Cuboid:return X===z.Foundation||X===z.Cuboid;default:return X!==z.Foundation&&X!==z.Cuboid}},D=_=>{const X=H.getState().elements.filter(q=>md(q)&&q.parentId===Zo),$=new Set(_.map(q=>q.id)),Q=new Map;for(const q of X){const te=me.fetchFoundationVertexCoordinates(q);Q.set(q.id,te)}const le=q=>{for(const te of X)!$.has(te.id)&&me.areBasesOverlapped(q.id,te.id,Q)&&($.add(te.id),_.push(te),te.enableGroupMaster&&le(te))};for(const q of _)q.enableGroupMaster&&le(q)},E=()=>{const _=[],X=H.getState().selectedElementIdSet,$=s();if(!$||X.size===0)return _;if($){const Q=$.type,le=$.parentId,q=H.getState().elements.filter(te=>M(Q,te.type)&&R(te)&&te.parentId===le&&X.has(te.id));_.push(...q),md($)&&_.length>0&&le===Zo&&D(_)}return _},W=(_,X,$,Q)=>{switch(Q){case Sl.Left:return[_-$,X];case Sl.Right:return[_+$,X];case Sl.Up:return[_,X+$];case Sl.Down:return[_,X-$]}},j=(_,X)=>{e($=>{var le,q;let Q=!1;for(const te of $.elements)if(_.has(te.id)){const re=_.get(te.id);if(re!==void 0){const[ae,se]=W(te.cx,te.cy,re,X);if(te.type===z.Wall){const ne=te,fe=new ie(ae-ne.cx,se-ne.cy),ge=new ie().fromArray(ne.leftPoint).setZ(0).add(fe),de=new ie().fromArray(ne.rightPoint).setZ(0).add(fe);ne.leftPoint=ge.toArray(),ne.rightPoint=de.toArray(),Q=!0}te.cx=ae,te.cy=se}}else $.selectedElementIdSet.has(te.id)&&$.selectedElementIdSet.delete(te.id);((le=$.selectedElement)==null?void 0:le.type)===z.Cuboid||((q=$.selectedElement)==null?void 0:q.type)===z.Foundation?$.groupActionUpdateFlag=!$.groupActionUpdateFlag:Q&&($.updateWallMapOnFoundationFlag=!$.updateWallMapOnFoundationFlag)})},L=(_,X)=>{e($=>{for(const Q of $.elements)(me.isFoundationOrCuboid(Q)||me.isPlantOrHuman(Q)&&Q.parentId===Zo)&&([Q.cx,Q.cy]=W(Q.cx,Q.cy,_,X))})},k=_=>_===Sl.Left?Sl.Right:_===Sl.Right?Sl.Left:_===Sl.Up?Sl.Down:_===Sl.Down?Sl.Up:(console.error("Undo direction is possibly incorrect:",_),_),N=(_,X)=>{if(!l)return;const $=E(),Q=s(),le=X*C;if(Q&&$.length>0){const q=new Map;for(const re of $)switch(re.type){case z.Foundation:case z.Cuboid:case z.Wall:case z.Tree:case z.Flower:case z.Human:{q.set(re.id,le);break}case z.Light:case z.Sensor:{const ae=p(Q);if(ae){let se=le/ae.lx;const[ne,fe]=W(re.cx,re.cy,se,_),ge=re.lx/(2*ae.lx),de=re.lx/(2*ae.ly);switch(_){case Sl.Left:case Sl.Right:{const Z=me.clamp(ne,-.5+ge,.5-ge);se=Math.abs(Z-Q.cx);break}case Sl.Up:case Sl.Down:{const Z=me.clamp(fe,-.5+de,.5-de);se=Math.abs(Z-Q.cy);break}}q.set(re.id,se)}break}case z.SolarPanel:case z.ParabolicDish:case z.ParabolicTrough:case z.FresnelReflector:case z.Heliostat:{const ae=p(re);if(ae){let se=!0,ne=le;switch(_){case Sl.Left:case Sl.Right:{ne=le/ae.lx;break}case Sl.Up:case Sl.Down:{ne=le/ae.ly;break}}if(re.type===z.SolarPanel){const[fe,ge]=W(re.cx,re.cy,ne,_);se=S(re,fe,ge)}if(se)q.set(re.id,ne);else return}break}}j(q,_);const te={name:`Move Selected Elements ${_} By Key`,timestamp:Date.now(),direction:_,movedElementsDisplacementMap:new Map(q),undo:()=>{const re=k(te.direction);j(te.movedElementsDisplacementMap,re)},redo:()=>{j(te.movedElementsDisplacementMap,te.direction)}};a(te)}else{L(le,_);const q={name:`Move All ${_} By Key`,timestamp:Date.now(),direction:_,displacement:le,undo:()=>{const te=k(q.direction);L(q.displacement,te)},redo:()=>{L(q.displacement,q.direction)}};a(q)}},F=_=>{H.getState().set(X=>{X.multiSelectionsMode=_})},U=_=>{const X=s(),$=1;switch(_){case"left":N(Sl.Left,$);break;case"shift+left":N(Sl.Left,$/Z5);break;case"ctrl+shift+left":case"meta+shift+left":N(Sl.Left,$*Z5);break;case"right":N(Sl.Right,$);break;case"shift+right":N(Sl.Right,$/Z5);break;case"ctrl+shift+right":case"meta+shift+right":N(Sl.Right,$*Z5);break;case"down":N(Sl.Down,$);break;case"shift+down":N(Sl.Down,$/Z5);break;case"ctrl+shift+down":case"meta+shift+down":N(Sl.Down,$*Z5);break;case"up":N(Sl.Up,$);break;case"shift+up":N(Sl.Up,$/Z5);break;case"ctrl+shift+up":case"meta+shift+up":N(Sl.Up,$*Z5);break;case"ctrl+[":case"meta+[":mX(.9);break;case"ctrl+]":case"meta+]":mX(1.1);break;case"ctrl+c":case"meta+c":X&&X.type!==z.Roof&&(u(X.id),e(Q=>{Q.selectedElementIdSet.clear(),Q.selectedElementIdSet.add(X.id)}),n&&e(Q=>{Q.actionInfo={name:"Copy",timestamp:new Date().getTime(),elementId:X.id,elementType:X.type}}));break;case"ctrl+x":case"meta+x":if(!X||X.type===z.Roof)break;if(X.locked)hn(Y.t("message.ThisElementIsLocked",P));else{const Q=v(X.id,!0);if(Q.length===0)break;if(me.isElementTriggerAutoDeletion(X))Fn.getState().setListenToAutoDeletionByCut(!0),ht.getState().setPrimitiveStore("selectedElementId",X.id);else{const le={name:"Cut",timestamp:Date.now(),deletedElements:Q,selectedElementId:X.id,undo:()=>{const q=le.deletedElements;if(q.length===0)return;const te=q.find(re=>re.id===le.selectedElementId);te&&e(re=>{if(re.elements.push(...q),re.selectedElementIdSet.clear(),re.selectedElementIdSet.add(te.id),re.selectedElement=te,te.type===z.Wall){const ae=te;let se=null,ne=null;if(ae.leftJoints.length>0&&(se=ae.leftJoints[0]),ae.rightJoints.length>0&&(ne=ae.rightJoints[0]),se||ne)for(const fe of re.elements)fe.id===se&&fe.type===z.Wall&&(fe.rightJoints[0]=ae.id),fe.id===ne&&fe.type===z.Wall&&(fe.leftJoints[0]=ae.id)}})},redo:()=>{le.deletedElements&&le.deletedElements.length>0&&v(le.deletedElements[0].id,!0)}};a(le)}}break;case"ctrl+v":case"meta+v":{const Q=f();if(Q.length>0){const le={name:"Paste by Key",timestamp:Date.now(),pastedElements:JSON.parse(JSON.stringify(Q)),undo:()=>{for(const q of le.pastedElements)d(q.id,!1)},redo:()=>{e(q=>{q.elements.push(...le.pastedElements),q.selectedElement=le.pastedElements[0]})}};a(le)}break}case"ctrl+alt+h":case"ctrl+home":{if(!l){const Q=H.getState().viewState.cameraPosition,le=H.getState().viewState.panCenter;if(Q[0]!==Q[1]||Q[1]!==Q[2]||Q[0]!==Q[2]||le[0]!==0||le[1]!==0||le[2]!==0){const q={name:"Reset View",timestamp:Date.now(),oldCameraPosition:[...Q],oldPanCenter:[...le],undo:()=>{const te=Fn.getState().orbitControlsRef;te!=null&&te.current&&(te.current.object.position.set(q.oldCameraPosition[0],q.oldCameraPosition[1],q.oldCameraPosition[2]),te.current.target.set(q.oldPanCenter[0],q.oldPanCenter[1],q.oldPanCenter[2]),te.current.update(),e(re=>{const ae=re.viewState;ae.cameraPosition=[...q.oldCameraPosition],ae.panCenter=[...q.oldPanCenter]}))},redo:()=>{gX()}};a(q),e(te=>{te.objectTypeToAdd=z.None,te.groupActionMode=!1,te.viewState.orthographic=!1}),gX()}}break}case"f2":case"ctrl+b":case"meta+b":T();break;case"ctrl+u":case"meta+u":A();break;case"f4":case"ctrl+m":case"meta+m":x();break;case"ctrl+f":case"meta+f":ht.getState().set(Q=>{Q.createNewFileFlag=!0,Q.openModelsMap=!1}),e(Q=>{Q.objectTypeToAdd=z.None,Q.groupActionMode=!1,window.history.pushState({},document.title,t1),n&&(Q.actionInfo={name:"Create New File",timestamp:new Date().getTime()})});break;case"ctrl+s":case"meta+s":ht.getState().set(Q=>{Q.saveLocalFileDialogVisible=!0}),n&&e(Q=>{Q.actionInfo={name:"Save Local File",timestamp:new Date().getTime()}});break;case"ctrl+shift+o":case"meta+shift+o":ht.getState().set(Q=>{Q.listCloudFilesFlag=!0,Q.openModelsMap=!1}),n&&e(Q=>{Q.actionInfo={name:"List Cloud Files",timestamp:new Date().getTime()}});break;case"ctrl+shift+s":case"meta+shift+s":ht.getState().setSaveCloudFileFlag(!0),n&&e(Q=>{Q.actionInfo={name:"Save Cloud File",timestamp:new Date().getTime()}});break;case"alt+backspace":case"backspace":case"delete":{const Q=H.getState().selectedElementIdSet;if(!X||Q.size===0)break;const le=H.getState().removeSelectedElements();if(le.length===0)break;if((()=>{const te=le.filter(se=>se.type===z.Foundation),re=new Set(te.map(se=>se.id));return!!le.find(se=>!re.has(se.parentId)&&me.isElementTriggerAutoDeletion(se))})())Fn.getState().setListenToAutoDeletionByDelete(!0),ht.getState().setPrimitiveStore("selectedElementId",X.id);else{if(le.length===1){const te={name:"Delete",timestamp:Date.now(),deletedElements:[...le],selectedElementId:X.id,undo:()=>{const re=te.deletedElements;if(!re||re.length===0)return;const ae=re.find(se=>se.id===te.selectedElementId);if(ae&&(e(se=>{se.elements.push(...re),se.selectedElementIdSet.clear(),se.selectedElementIdSet.add(ae.id),se.selectedElement=ae,se.updateWallMapOnFoundationFlag=!se.updateWallMapOnFoundationFlag,se.deletedRoofId=null,se.deletedRoofIdSet.clear()}),ae.type===z.Wall)){const se=ae;se.leftJoints.length>0&&y(se.leftJoints[0],[se.id]),se.rightJoints.length>0&&g(se.rightJoints[0],[se.id])}},redo:()=>{const re=te.deletedElements;if(!re||re.length===0)return;const ae=re.find(se=>se.id===te.selectedElementId);ae&&v(ae.id,!1)}};a(te)}else{const te={name:"Delete Multiple",timestamp:Date.now(),deletedElements:[...le],selectedElementId:X.id,selectedElementIdSet:new Set(Q),undo(){const re=this.deletedElements;if(!re||re.length===0)return;const ae=re.find(se=>se.id===this.selectedElementId);if(ae){e(se=>{se.elements.push(...re),se.selectedElement=ae,se.selectedElementIdSet=new Set(this.selectedElementIdSet),se.updateWallMapOnFoundationFlag=!se.updateWallMapOnFoundationFlag,se.deletedRoofId=null,se.deletedRoofIdSet.clear()});for(const se of this.deletedElements)if(se.type===z.Wall){const ne=se;ne.leftJoints.length>0&&y(ne.leftJoints[0],[ne.id]),ne.rightJoints.length>0&&g(ne.rightJoints[0],[ne.id])}}},redo(){e(re=>{re.selectedElement=re.elements.find(ae=>ae.id===this.selectedElementId)??null,re.selectedElementIdSet=new Set(this.selectedElementIdSet)}),H.getState().removeSelectedElements()}};a(te)}e(te=>{te.selectedElement=null,te.selectedElementIdSet.clear()})}break}case"ctrl+z":case"meta+z":if(i.hasUndo()){const Q=i.undo();H.getState().groupActionMode&&e(le=>{le.groupActionUpdateFlag=!le.groupActionUpdateFlag}),Q&&hn(Y.t("menu.edit.Undo",P)+": "+Q,dG),n&&e(le=>{le.actionInfo={name:"Undo",timestamp:new Date().getTime()}})}break;case"ctrl+y":case"meta+y":if(i.hasRedo()){const Q=i.redo();Q&&hn(Y.t("menu.edit.Redo",P)+": "+Q,dG),H.getState().groupActionMode&&e(le=>{le.groupActionUpdateFlag=!le.groupActionUpdateFlag}),n&&e(le=>{le.actionInfo={name:"Redo",timestamp:new Date().getTime()}})}break;case"shift":H.getState().viewState.navigationView&&ht.getState().set(Q=>{Q.navigationMoveSpeed=5*H.getState().minimumNavigationMoveSpeed,Q.navigationTurnSpeed=5*H.getState().minimumNavigationTurnSpeed}),w(!0);break;case"esc":{const Q=H.getState().addedFoundationId,le=H.getState().addedCuboidId,q=H.getState().addedWallId,te=H.getState().addedWindowId,re=H.getState().addedDoorId;Q?d(Q,!1):le?d(le,!1):q?d(q,!1):te?(d(te,!1),ht.getState().setPrimitiveStore("elementBeingCanceledId",te)):re&&(d(re,!1),ht.getState().setPrimitiveStore("elementBeingCanceledId",re)),e(ae=>{ae.objectTypeToAdd=z.None,ae.actionModeLock=!1,ae.moveHandleType=null,ae.resizeHandleType=null,ae.groupActionMode=!1}),Fn.getState().setEnableOrbitController(!0),o();break}case"ctrl":{F(!0);break}}},O=_=>{switch(_){case"shift":H.getState().viewState.navigationView&&ht.getState().set(X=>{X.navigationMoveSpeed=H.getState().minimumNavigationMoveSpeed,X.navigationTurnSpeed=H.getState().minimumNavigationTurnSpeed}),w(!1);break;case"ctrl+o":case"meta+o":H.getState().localFileDialogRequested||(ht.getState().set(X=>{X.openLocalFileFlag=!0}),e(X=>{X.localFileDialogRequested=!0,n&&(X.actionInfo={name:"Open Local File",timestamp:new Date().getTime()})}));break;case"ctrl":{F(!1);break}}};m.useEffect(()=>()=>{B.current=null},[]);const B=m.useRef(null);return h.jsxs(h.Fragment,{children:[h.jsx(ize,{handleKeys:aze,handleEventType:"keydown",onKeyEvent:(_,X)=>{X.preventDefault(),B.current!==_&&(B.current=_,U(_))}}),h.jsx(ize,{handleKeys:aze,handleEventType:"keyup",onKeyEvent:(_,X)=>{X.preventDefault(),B.current=null,O(_)}}),h.jsx(U3o,{})]})}),B3o="/aladdin/assets/cloud-B68yt6QG.png",Y3o=be.memo(()=>{const t=H(fn),e=H(Iwt),{scene:n}=oi();m.useEffect(()=>{const r=n.children.filter(l=>l.name==="Content"),i=[];if(r.length>0){const l=r[0].children;for(const s of l)o(s,i)}const a=[];for(const l of i)a.push(new bf().setFromObject(l));if(a.length>0){const l=new ie,s=new ie;for(const u of a)l.min(u.min),s.max(u.max);let c=Math.abs(l.x);c{u.aabb=new bf(l,s),!isNaN(c)&&isFinite(c)&&(u.sceneRadius=Math.round(Math.max(10,c*1.25)))})}},[e]);const o=(r,i)=>{if(r.userData.aabb&&i.push(r),r.children.length>0)for(const a of r.children)o(a,i)};return h.jsx(h.Fragment,{})}),Ofe=t=>{const e=new ie().subVectors(t.localToWorld(new ie(0,0,1e3)),t.position);return e.x===0&&e.y===0&&t.getWorldDirection(e),e},qT=t=>{const e=document.getElementById("compassCanvas"),n=o=>{ht.getState().set(r=>{r.isCameraUnderGround=o})};if(e){const o=Ofe(t).normalize(),i=(Math.atan2(o.y,o.x)+Math.PI/2)/Math.PI*180;e.style.transform=`rotate(${i}deg)`;const a=t.position.z<.001;a&&!ht.getState().isCameraUnderGround?n(!0):!a&&ht.getState().isCameraUnderGround&&n(!1)}},O3o=be.memo(()=>{const t=H(fn),e=H(Id),n=H(R4t),o=H(bBe),r=H(zH),i=H(Ug),a=H(H4t),l=H(M4t),s=H(Nq)??GF,c=H(Wq),u=ht(W8t),d=ht(N8t),f=H(GBe),p=ht(KBe),g=c&&!e,y=Math.hypot(a[0],a[1],a[2]),w=(e?l*50:y*10)*i,b=m.useMemo(()=>new ie(-w,-w,0),[w]),C=m.useMemo(()=>new ie(w,w,w/2),[w]),{gl:P,invalidate:v,get:T,set:A,camera:x}=oi(),S=m.useMemo(()=>{const F=T().camera;return F.up.set(0,0,1),F},[]),R=m.useMemo(()=>P.domElement,[]),M=m.useRef(null),D=m.useRef(null),E=m.useRef(null);m.useEffect(()=>{Fn.setState({canvas:{gl:P,camera:x}}),!e&&D.current&&Fn.setState({canvas:{gl:P,camera:D.current}})},[e]),m.useEffect(()=>{H.getState().viewState.cameraPosition2D[2]<100&&t(F=>{F.viewState.cameraPosition2D[2]=150})},[]),m.useEffect(()=>{M&&M.current&&Fn.setState({orbitControlsRef:M})},[]),m.useEffect(()=>{M.current&&(M.current.addEventListener("change",W),M.current.addEventListener("start",j),M.current.addEventListener("end",L));const F=M.current;return()=>{F&&(F.removeEventListener("change",W),F.removeEventListener("start",j),F.removeEventListener("end",L))}},[g]),m.useEffect(()=>{const F=H.getState().viewState;if(M.current){if(D.current){if(g){const U=T().camera,O=F.cameraPositionNav??[5,-30,1],B=F.cameraRotationNav??[1.5374753309166491,.16505866097993566,.005476951734475092];U.position.fromArray(O),U.rotation.fromArray([B[0],B[1],B[2],"XYZ"])}else{const U=k(F.cameraPosition??[0,0,20]),O=k(F.panCenter??[0,0,0]);D.current.position.copy(U),D.current.lookAt(O),D.current.zoom=1,e||(M.current.object=D.current,M.current.target.copy(O))}x.updateMatrixWorld(),qT(T().camera)}if(E.current){const U=k(F.cameraPosition2D??[0,0,1e3]).setZ(1e3),O=k(F.panCenter2D??[0,0,0]);E.current.position.copy(U),E.current.rotation.set(0,0,0),E.current.lookAt(O),E.current.zoom=F.cameraZoom,e&&(M.current.object=E.current,M.current.target.copy(O))}}},[r]),m.useEffect(()=>{if(!E.current||!D.current||!M.current)return;const F=H.getState().viewState,U=M.current,O=E.current,B=D.current;e?(O.rotation.set(0,0,0),U.object=O,U.target.copy(k(F.panCenter2D??[0,0,0])),A({camera:O})):(U.object=B,U.target.copy(k(F.panCenter??[0,0,0])),A({camera:B}),qT(T().camera))},[e]),m.useEffect(()=>{e&&M.current&&(E.current&&(E.current.zoom=l,M.current.object=E.current),W(),M.current.update())},[l]);const W=()=>{v(),H.getState().viewState.orthographic||(qT(T().camera),M.current&&M.current.target.clamp(b,C))},j=()=>{ht.getState().set(F=>{F.duringCameraInteraction=!0})},L=()=>{ht.getState().set(F=>{F.duringCameraInteraction=!1}),t(F=>{if(!M.current)return;const U=F.viewState,O=T().camera,B=O.position,_=M.current.target;U.orthographic?(O.zoom&&!isNaN(O.zoom)?U.cameraZoom=O.zoom:U.cameraZoom=20,U.cameraPosition2D=[B.x,B.y,150],U.panCenter2D=[_.x,_.y,_.z]):g?(U.cameraPositionNav=[B.x,B.y,B.z],U.cameraRotationNav=[O.rotation.x,O.rotation.y,O.rotation.z],F.cameraDirection=Ofe(O)):(U.cameraPosition=[B.x,B.y,B.z],U.panCenter=[_.x,_.y,_.z],F.cameraDirection=Ofe(O))})},k=F=>F&&Array.isArray(F)?new ie(F[0],F[1],F[2]):F&&F.x!==null?new ie(F.x,F.y,F.z):new ie(0,0,5);ay(()=>{o&&M.current&&M.current.update()});const N=Fn(F=>F.compassRef);return m.useEffect(()=>{qT(T().camera)},[N]),m.useEffect(()=>{M.current&&(g&&!p&&!f?M.current.listenToKeyEvents(window):M.current.removeKeyEvents())},[g,p,f]),m.useEffect(()=>{if(!M.current)return;const F=H.getState().viewState;if(g){const U=T().camera,O=F.cameraPositionNav??[5,-30,1],B=F.cameraRotationNav??[1.5374753309166491,.16505866097993566,.005476951734475092];U.position.fromArray(O),U.rotation.fromArray([B[0],B[1],B[2],"XYZ"]),U.updateMatrixWorld(),qT(T().camera)}else if(M.current&&D.current){const U=k(F.cameraPosition??[0,0,20]),O=k(F.panCenter??[0,0,0]);D.current.position.copy(U),D.current.lookAt(O),D.current.zoom=1,e||(M.current.object=D.current,M.current.target.copy(O)),D.current.updateMatrixWorld(),qT(D.current)}v()},[g]),h.jsxs(h.Fragment,{children:[h.jsx(s4t,{ref:D,fov:tje,far:s,up:[0,0,1]}),h.jsx(a4t,{ref:E,up:[0,0,1]}),h.jsx("myOrbitControls",{ref:M,args:[S,R],autoRotate:o,enableRotate:n,enablePan:!0,enableZoom:!0,enableDamping:!1,maxAzimuthAngle:1/0,minAzimuthAngle:-1/0,maxPolarAngle:Gt,minPolarAngle:0,moveSpeed:u??3,turnSpeed:d??3})]})});var _fe={exports:{}},Vfe={exports:{}},Vk=1e3,Gk=Vk*60,Xk=Gk*60,Jk=Xk*24,_3o=Jk*365.25,V3o=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return G3o(t);if(n==="number"&&isNaN(t)===!1)return e.long?J3o(t):X3o(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function G3o(t){if(t=String(t),!(t.length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return n*_3o;case"days":case"day":case"d":return n*Jk;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Xk;case"minutes":case"minute":case"mins":case"min":case"m":return n*Gk;case"seconds":case"second":case"secs":case"sec":case"s":return n*Vk;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function X3o(t){return t>=Jk?Math.round(t/Jk)+"d":t>=Xk?Math.round(t/Xk)+"h":t>=Gk?Math.round(t/Gk)+"m":t>=Vk?Math.round(t/Vk)+"s":t+"ms"}function J3o(t){return GO(t,Jk,"day")||GO(t,Xk,"hour")||GO(t,Gk,"minute")||GO(t,Vk,"second")||t+" ms"}function GO(t,e,n){if(!(t=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}e.formatters.j=function(c){try{return JSON.stringify(c)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}};function r(c){var u=this.useColors;if(c[0]=(u?"%c":"")+this.namespace+(u?" %c":" ")+c[0]+(u?"%c ":" ")+"+"+e.humanize(this.diff),!!u){var d="color: "+this.color;c.splice(1,0,d,"color: inherit");var f=0,p=0;c[0].replace(/%[a-zA-Z%]/g,function(g){g!=="%%"&&(f++,g==="%c"&&(p=f))}),c.splice(p,0,d)}}function i(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(c){try{c==null?e.storage.removeItem("debug"):e.storage.debug=c}catch{}}function l(){var c;try{c=e.storage.debug}catch{}return!c&&typeof process<"u"&&"env"in process&&(c=n.DEBUG),c}e.enable(l());function s(){try{return window.localStorage}catch{}}})(_fe,_fe.exports);var q3o=_fe.exports,lze=q3o("jsonp"),$3o=e6o,Q3o=0;function Z3o(){}function e6o(t,e,n){typeof e=="function"&&(n=e,e={}),e||(e={});var o=e.prefix||"__jp",r=e.name||o+Q3o++,i=e.param||"callback",a=e.timeout!=null?e.timeout:6e4,l=encodeURIComponent,s=document.getElementsByTagName("script")[0]||document.head,c,u;a&&(u=setTimeout(function(){d(),n&&n(new Error("Timeout"))},a));function d(){c.parentNode&&c.parentNode.removeChild(c),window[r]=Z3o,u&&clearTimeout(u)}function f(){window[r]&&d()}return window[r]=function(p){lze("jsonp got",p),d(),n&&n(null,p)},t+=(~t.indexOf("?")?"&":"?")+i+"="+l(r),t=t.replace("?&","?"),lze('jsonp req "%s"',t),c=document.createElement("script"),c.src=t,s.parentNode.insertBefore(c,s),f}const sS=Fi($3o);var t6o=Object.defineProperty,n6o=Object.defineProperties,o6o=Object.getOwnPropertyDescriptors,MJ=Object.getOwnPropertySymbols,Hat=Object.prototype.hasOwnProperty,Mat=Object.prototype.propertyIsEnumerable,sze=(t,e,n)=>e in t?t6o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,cg=(t,e)=>{for(var n in e||(e={}))Hat.call(e,n)&&sze(t,n,e[n]);if(MJ)for(var n of MJ(e))Mat.call(e,n)&&sze(t,n,e[n]);return t},zee=(t,e)=>n6o(t,o6o(e)),Dee=(t,e)=>{var n={};for(var o in t)Hat.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&MJ)for(var o of MJ(t))e.indexOf(o)<0&&Mat.call(t,o)&&(n[o]=t[o]);return n};function qw(t){return n=>{var o=n,{bgStyle:r={},borderRadius:i=0,iconFillColor:a="white",round:l=!1,size:s=64}=o,c=Dee(o,["bgStyle","borderRadius","iconFillColor","round","size"]);return h.jsxs("svg",zee(cg({viewBox:"0 0 64 64",width:s,height:s},c),{children:[l?h.jsx("circle",{cx:"32",cy:"32",r:"32",fill:t.color,style:r}):h.jsx("rect",{width:"64",height:"64",rx:i,ry:i,fill:t.color,style:r}),h.jsx("path",{d:t.path,fill:a})]}))}}const r6o=qw({color:"#7f7f7f",networkName:"email",path:"M17,22v20h30V22H17z M41.1,25L32,32.1L22.9,25H41.1z M20,39V26.6l12,9.3l12-9.3V39H20z"}),i6o=r6o;function Qs(t){const e=Object.entries(t).filter(([,n])=>n!=null).map(([n,o])=>`${encodeURIComponent(n)}=${encodeURIComponent(String(o))}`);return e.length>0?`?${e.join("&")}`:""}const a6o=t=>!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function",l6o=(t,e)=>({left:window.outerWidth/2+(window.screenX||window.screenLeft||0)-t/2,top:window.outerHeight/2+(window.screenY||window.screenTop||0)-e/2}),s6o=(t,e)=>({top:(window.screen.height-e)/2,left:(window.screen.width-t)/2});function c6o(t,e,n){var o=e,{height:r,width:i}=o,a=Dee(o,["height","width"]);const l=cg({height:r,width:i,location:"no",toolbar:"no",status:"no",directories:"no",menubar:"no",scrollbars:"yes",resizable:"no",centerscreen:"yes",chrome:"yes"},a),s=window.open(t,"",Object.keys(l).map(c=>`${c}=${l[c]}`).join(", "));if(n){const c=window.setInterval(()=>{try{(s===null||s.closed)&&(window.clearInterval(c),n(s))}catch(u){console.error(u)}},1e3)}return s}function u6o(t){var e=t,{beforeOnClick:n,children:o,className:r,disabled:i,disabledStyle:a={opacity:.6},forwardedRef:l,networkLink:s,networkName:c,onClick:u,onShareWindowClose:d,openShareDialogOnClick:f=!0,opts:p,resetButtonStyle:g=!0,style:y,url:w,windowHeight:b=400,windowPosition:C="windowCenter",windowWidth:P=550}=e,v=Dee(e,["beforeOnClick","children","className","disabled","disabledStyle","forwardedRef","networkLink","networkName","onClick","onShareWindowClose","openShareDialogOnClick","opts","resetButtonStyle","style","url","windowHeight","windowPosition","windowWidth"]);const T=async S=>{const R=s(w,p);if(!i){if(S.preventDefault(),n){const M=n();a6o(M)&&await M}if(f){const M=cg({height:b,width:P},C==="windowCenter"?l6o(P,b):s6o(P,b));c6o(R,M,d)}u&&u(S,R)}},A=Vn("react-share__ShareButton",{"react-share__ShareButton--disabled":!!i,disabled:!!i},r),x=cg(cg(g?{backgroundColor:"transparent",border:"none",padding:0,font:"inherit",color:"inherit",cursor:"pointer"}:{},y),i&&a);return h.jsx("button",zee(cg({},v),{className:A,onClick:T,ref:l,style:x,children:o}))}function w0(t,e,n,o){function r(i,a){const l=n(i),s=cg({},i);return Object.keys(l).forEach(u=>{delete s[u]}),h.jsx(u6o,zee(cg(cg({},o),s),{forwardedRef:a,networkName:t,networkLink:e,opts:n(i)}))}return r.displayName=`ShareButton-${t}`,m.forwardRef(r)}function d6o(t,{subject:e,body:n,separator:o}){return"mailto:"+Qs({subject:e,body:n?n+o+t:t})}const f6o=w0("email",d6o,t=>({subject:t.subject,body:t.body,separator:t.separator||" "}),{openShareDialogOnClick:!1,onClick:(t,e)=>{window.location.href=e}}),h6o=f6o,p6o=qw({color:"#0965FE",networkName:"facebook",path:"M34.1,47V33.3h4.6l0.7-5.3h-5.3v-3.4c0-1.5,0.4-2.6,2.6-2.6l2.8,0v-4.8c-0.5-0.1-2.2-0.2-4.1-0.2 c-4.1,0-6.9,2.5-6.9,7V28H24v5.3h4.6V47H34.1z"}),g6o=p6o;function m6o(t,{appId:e,redirectUri:n,to:o}){return"https://www.facebook.com/dialog/send"+Qs({link:t,redirect_uri:n||t,app_id:e,to:o})}w0("facebookmessenger",m6o,t=>({appId:t.appId,redirectUri:t.redirectUri,to:t.to}),{windowWidth:1e3,windowHeight:820});class y6o extends Error{constructor(e){super(e),this.name="AssertionError"}}function i0(t,e){if(!t)throw new y6o(e)}function A6o(t,{hashtag:e}){return i0(t,"facebook.url"),"https://www.facebook.com/sharer/sharer.php"+Qs({u:t,hashtag:e})}const w6o=w0("facebook",A6o,t=>({hashtag:t.hashtag}),{windowWidth:550,windowHeight:400}),v6o=w6o;function x6o(){const t=m.useRef(!1);return m.useEffect(()=>(t.current=!0,()=>{t.current=!1}),[]),m.useCallback(()=>t.current,[])}function b6o(t){var e=t,{children:n=f=>f,className:o,getCount:r,url:i}=e,a=Dee(e,["children","className","getCount","url"]);const l=x6o(),[s,c]=m.useState(void 0),[u,d]=m.useState(!1);return m.useEffect(()=>{d(!0),r(i,f=>{l()&&(c(f),d(!1))})},[i]),h.jsx("span",zee(cg({className:Vn("react-share__ShareCount",o)},a),{children:!u&&s!==void 0&&n(s)}))}function cS(t){const e=n=>h.jsx(b6o,cg({getCount:t},n));return e.displayName=`ShareCount(${t.name})`,e}function S6o(t,e){const n=`https://graph.facebook.com/?id=${t}&fields=og_object{engagement}`;sS(n,(o,r)=>{e(!o&&r&&r.og_object&&r.og_object.engagement?r.og_object.engagement.count:void 0)})}cS(S6o);function T6o(t,{title:e}){return i0(t,"hatena.url"),`http://b.hatena.ne.jp/add?mode=confirm&url=${t}&title=${e}`}w0("hatena",T6o,t=>({title:t.title}),{windowWidth:660,windowHeight:460,windowPosition:"windowCenter"});function P6o(t,e){sS("https://bookmark.hatenaapis.com/count/entry"+Qs({url:t}),(o,r)=>{e(r??void 0)})}cS(P6o);function C6o(t,{title:e,description:n}){return i0(t,"instapaper.url"),"http://www.instapaper.com/hello2"+Qs({url:t,title:e,description:n})}w0("instapaper",C6o,t=>({title:t.title,description:t.description}),{windowWidth:500,windowHeight:500,windowPosition:"windowCenter"});const R6o=qw({color:"#00b800",networkName:"line",path:"M52.62 30.138c0 3.693-1.432 7.019-4.42 10.296h.001c-4.326 4.979-14 11.044-16.201 11.972-2.2.927-1.876-.591-1.786-1.112l.294-1.765c.069-.527.142-1.343-.066-1.865-.232-.574-1.146-.872-1.817-1.016-9.909-1.31-17.245-8.238-17.245-16.51 0-9.226 9.251-16.733 20.62-16.733 11.37 0 20.62 7.507 20.62 16.733zM27.81 25.68h-1.446a.402.402 0 0 0-.402.401v8.985c0 .221.18.4.402.4h1.446a.401.401 0 0 0 .402-.4v-8.985a.402.402 0 0 0-.402-.401zm9.956 0H36.32a.402.402 0 0 0-.402.401v5.338L31.8 25.858a.39.39 0 0 0-.031-.04l-.002-.003-.024-.025-.008-.007a.313.313 0 0 0-.032-.026.255.255 0 0 1-.021-.014l-.012-.007-.021-.012-.013-.006-.023-.01-.013-.005-.024-.008-.014-.003-.023-.005-.017-.002-.021-.003-.021-.002h-1.46a.402.402 0 0 0-.402.401v8.985c0 .221.18.4.402.4h1.446a.401.401 0 0 0 .402-.4v-5.337l4.123 5.568c.028.04.063.072.101.099l.004.003a.236.236 0 0 0 .025.015l.012.006.019.01a.154.154 0 0 1 .019.008l.012.004.028.01.005.001a.442.442 0 0 0 .104.013h1.446a.4.4 0 0 0 .401-.4v-8.985a.402.402 0 0 0-.401-.401zm-13.442 7.537h-3.93v-7.136a.401.401 0 0 0-.401-.401h-1.447a.4.4 0 0 0-.401.401v8.984a.392.392 0 0 0 .123.29c.072.068.17.111.278.111h5.778a.4.4 0 0 0 .401-.401v-1.447a.401.401 0 0 0-.401-.401zm21.429-5.287c.222 0 .401-.18.401-.402v-1.446a.401.401 0 0 0-.401-.402h-5.778a.398.398 0 0 0-.279.113l-.005.004-.006.008a.397.397 0 0 0-.111.276v8.984c0 .108.043.206.112.278l.005.006a.401.401 0 0 0 .284.117h5.778a.4.4 0 0 0 .401-.401v-1.447a.401.401 0 0 0-.401-.401h-3.93v-1.519h3.93c.222 0 .401-.18.401-.402V29.85a.401.401 0 0 0-.401-.402h-3.93V27.93h3.93z"}),H6o=R6o;function M6o(t,{title:e}){return i0(t,"line.url"),"https://social-plugins.line.me/lineit/share"+Qs({url:t,text:e})}const I6o=w0("line",M6o,t=>({title:t.title}),{windowWidth:500,windowHeight:500}),z6o=I6o,D6o=qw({color:"#0077B5",networkName:"linkedin",path:"M20.4,44h5.4V26.6h-5.4V44z M23.1,18c-1.7,0-3.1,1.4-3.1,3.1c0,1.7,1.4,3.1,3.1,3.1 c1.7,0,3.1-1.4,3.1-3.1C26.2,19.4,24.8,18,23.1,18z M39.5,26.2c-2.6,0-4.4,1.4-5.1,2.8h-0.1v-2.4h-5.2V44h5.4v-8.6 c0-2.3,0.4-4.5,3.2-4.5c2.8,0,2.8,2.6,2.8,4.6V44H46v-9.5C46,29.8,45,26.2,39.5,26.2z"}),E6o=D6o;function F6o(t,{title:e,summary:n,source:o}){return i0(t,"linkedin.url"),"https://linkedin.com/shareArticle"+Qs({url:t,mini:"true",title:e,summary:n,source:o})}const k6o=w0("linkedin",F6o,({title:t,summary:e,source:n})=>({title:t,summary:e,source:n}),{windowWidth:750,windowHeight:600}),L6o=k6o;function W6o(t,{title:e,description:n}){return i0(t,"livejournal.url"),"https://www.livejournal.com/update.bml"+Qs({subject:e,event:n})}w0("livejournal",W6o,t=>({title:t.title,description:t.description}),{windowWidth:660,windowHeight:460});function N6o(t,{title:e,description:n,imageUrl:o}){return i0(t,"mailru.url"),"https://connect.mail.ru/share"+Qs({url:t,title:e,description:n,image_url:o})}w0("mailru",N6o,t=>({title:t.title,description:t.description,imageUrl:t.imageUrl}),{windowWidth:660,windowHeight:460});function U6o(t,{title:e,description:n,image:o}){return i0(t,"ok.url"),"https://connect.ok.ru/offer"+Qs({url:t,title:e,description:n,imageUrl:o})}w0("ok",U6o,t=>({title:t.title,description:t.description,image:t.image}),{windowWidth:588,windowHeight:480,windowPosition:"screenCenter"});function j6o(t,e){window.OK||(window.OK={Share:{count:function(i,a){var l,s;(s=(l=window.OK.callbacks)[i])==null||s.call(l,a)}},callbacks:[]});const n="https://connect.ok.ru/dk",o=window.OK.callbacks.length;return window.ODKL={updateCount(r,i){var a,l;const s=r===""?0:parseInt(r.replace("react-share-",""),10);(l=(a=window.OK.callbacks)[s])==null||l.call(a,i===""?void 0:parseInt(i,10))}},window.OK.callbacks.push(e),sS(n+Qs({"st.cmd":"extLike",uid:`react-share-${o}`,ref:t}))}cS(j6o);function B6o(t,{media:e,description:n,pinId:o}){return o?`https://pinterest.com/pin/${o}/repin/x/`:(i0(t,"pinterest.url"),i0(e,"pinterest.media"),"https://pinterest.com/pin/create/button/"+Qs({url:t,media:e,description:n}))}w0("pinterest",B6o,t=>({media:t.media,description:t.description,pinId:t.pinId}),{windowWidth:1e3,windowHeight:730});function Y6o(t,e){sS("https://api.pinterest.com/v1/urls/count.json"+Qs({url:t}),(o,r)=>{e(r?r.count:void 0)})}cS(Y6o);function O6o(t,{title:e}){return i0(t,"pocket.url"),"https://getpocket.com/save"+Qs({url:t,title:e})}w0("pocket",O6o,t=>({title:t.title}),{windowWidth:500,windowHeight:500});const _6o=qw({color:"#FF5700",networkName:"reddit",path:"M 53.34375 32 C 53.277344 30.160156 52.136719 28.53125 50.429688 27.839844 C 48.722656 27.148438 46.769531 27.523438 45.441406 28.800781 C 41.800781 26.324219 37.519531 24.957031 33.121094 24.863281 L 35.199219 14.878906 L 42.046875 16.320312 C 42.214844 17.882812 43.496094 19.09375 45.066406 19.171875 C 46.636719 19.253906 48.03125 18.183594 48.359375 16.644531 C 48.6875 15.105469 47.847656 13.558594 46.382812 12.992188 C 44.914062 12.425781 43.253906 13.007812 42.464844 14.367188 L 34.625 12.800781 C 34.363281 12.742188 34.09375 12.792969 33.871094 12.9375 C 33.648438 13.082031 33.492188 13.308594 33.441406 13.566406 L 31.070312 24.671875 C 26.617188 24.738281 22.277344 26.105469 18.59375 28.609375 C 17.242188 27.339844 15.273438 26.988281 13.570312 27.707031 C 11.863281 28.429688 10.746094 30.089844 10.71875 31.941406 C 10.691406 33.789062 11.757812 35.484375 13.441406 36.257812 C 13.402344 36.726562 13.402344 37.195312 13.441406 37.664062 C 13.441406 44.832031 21.792969 50.65625 32.097656 50.65625 C 42.398438 50.65625 50.753906 44.832031 50.753906 37.664062 C 50.789062 37.195312 50.789062 36.726562 50.753906 36.257812 C 52.363281 35.453125 53.371094 33.800781 53.34375 32 Z M 21.34375 35.199219 C 21.34375 33.433594 22.777344 32 24.542969 32 C 26.3125 32 27.742188 33.433594 27.742188 35.199219 C 27.742188 36.96875 26.3125 38.398438 24.542969 38.398438 C 22.777344 38.398438 21.34375 36.96875 21.34375 35.199219 Z M 39.9375 44 C 37.664062 45.710938 34.871094 46.582031 32.03125 46.464844 C 29.191406 46.582031 26.398438 45.710938 24.128906 44 C 23.847656 43.65625 23.871094 43.15625 24.183594 42.839844 C 24.5 42.527344 25 42.503906 25.34375 42.785156 C 27.269531 44.195312 29.617188 44.90625 32 44.800781 C 34.386719 44.929688 36.746094 44.242188 38.6875 42.847656 C 39.042969 42.503906 39.605469 42.511719 39.953125 42.863281 C 40.296875 43.21875 40.289062 43.785156 39.9375 44.128906 Z M 39.359375 38.527344 C 37.59375 38.527344 36.160156 37.09375 36.160156 35.328125 C 36.160156 33.5625 37.59375 32.128906 39.359375 32.128906 C 41.128906 32.128906 42.558594 33.5625 42.558594 35.328125 C 42.59375 36.203125 42.269531 37.054688 41.65625 37.6875 C 41.046875 38.316406 40.203125 38.664062 39.328125 38.65625 Z M 39.359375 38.527344"}),V6o=_6o;function G6o(t,{title:e}){return i0(t,"reddit.url"),"https://www.reddit.com/submit"+Qs({url:t,title:e})}const X6o=w0("reddit",G6o,t=>({title:t.title}),{windowWidth:660,windowHeight:460,windowPosition:"windowCenter"}),J6o=X6o;function K6o(t,{title:e}){return i0(t,"gab.url"),"https://gab.com/compose"+Qs({url:t,text:e})}w0("gab",K6o,t=>({title:t.title}),{windowWidth:660,windowHeight:640,windowPosition:"windowCenter"});function q6o(t,e){const n=`https://www.reddit.com/api/info.json?limit=1&url=${t}`;sS(n,{param:"jsonp"},(o,r)=>{e(!o&&r&&r.data&&r.data.children.length>0&&r.data.children[0].data.score?r.data.children[0].data.score:void 0)})}cS(q6o);const $6o=qw({color:"#25A3E3",networkName:"telegram",path:"m45.90873,15.44335c-0.6901,-0.0281 -1.37668,0.14048 -1.96142,0.41265c-0.84989,0.32661 -8.63939,3.33986 -16.5237,6.39174c-3.9685,1.53296 -7.93349,3.06593 -10.98537,4.24067c-3.05012,1.1765 -5.34694,2.05098 -5.4681,2.09312c-0.80775,0.28096 -1.89996,0.63566 -2.82712,1.72788c-0.23354,0.27218 -0.46884,0.62161 -0.58825,1.10275c-0.11941,0.48114 -0.06673,1.09222 0.16682,1.5716c0.46533,0.96052 1.25376,1.35737 2.18443,1.71383c3.09051,0.99037 6.28638,1.93508 8.93263,2.8236c0.97632,3.44171 1.91401,6.89571 2.84116,10.34268c0.30554,0.69185 0.97105,0.94823 1.65764,0.95525l-0.00351,0.03512c0,0 0.53908,0.05268 1.06412,-0.07375c0.52679,-0.12292 1.18879,-0.42846 1.79109,-0.99212c0.662,-0.62161 2.45836,-2.38812 3.47683,-3.38552l7.6736,5.66477l0.06146,0.03512c0,0 0.84989,0.59703 2.09312,0.68132c0.62161,0.04214 1.4399,-0.07726 2.14229,-0.59176c0.70766,-0.51626 1.1765,-1.34683 1.396,-2.29506c0.65673,-2.86224 5.00979,-23.57745 5.75257,-27.00686l-0.02107,0.08077c0.51977,-1.93157 0.32837,-3.70159 -0.87096,-4.74991c-0.60054,-0.52152 -1.2924,-0.7498 -1.98425,-0.77965l0,0.00176zm-0.2072,3.29069c0.04741,0.0439 0.0439,0.0439 0.00351,0.04741c-0.01229,-0.00351 0.14048,0.2072 -0.15804,1.32576l-0.01229,0.04214l-0.00878,0.03863c-0.75858,3.50668 -5.15554,24.40802 -5.74203,26.96472c-0.08077,0.34417 -0.11414,0.31959 -0.09482,0.29852c-0.1756,-0.02634 -0.50045,-0.16506 -0.52679,-0.1756l-13.13468,-9.70175c4.4988,-4.33199 9.09945,-8.25307 13.744,-12.43229c0.8218,-0.41265 0.68483,-1.68573 -0.29852,-1.70681c-1.04305,0.24584 -1.92279,0.99564 -2.8798,1.47502c-5.49971,3.2626 -11.11882,6.13186 -16.55882,9.49279c-2.792,-0.97105 -5.57873,-1.77704 -8.15298,-2.57601c2.2336,-0.89555 4.00889,-1.55579 5.75608,-2.23009c3.05188,-1.1765 7.01687,-2.7042 10.98537,-4.24067c7.94051,-3.06944 15.92667,-6.16346 16.62028,-6.43037l0.05619,-0.02283l0.05268,-0.02283c0.19316,-0.0878 0.30378,-0.09658 0.35471,-0.10009c0,0 -0.01756,-0.05795 -0.00351,-0.04566l-0.00176,0zm-20.91715,22.0638l2.16687,1.60145c-0.93418,0.91311 -1.81743,1.77353 -2.45485,2.38812l0.28798,-3.98957"}),Q6o=$6o;function Z6o(t,{title:e}){return i0(t,"telegram.url"),"https://telegram.me/share/url"+Qs({url:t,text:e})}const eAo=w0("telegram",Z6o,t=>({title:t.title}),{windowWidth:550,windowHeight:400}),tAo=eAo;function nAo(t,{title:e,caption:n,tags:o,posttype:r}){return i0(t,"tumblr.url"),"https://www.tumblr.com/widgets/share/tool"+Qs({canonicalUrl:t,title:e,caption:n,tags:o,posttype:r})}w0("tumblr",nAo,t=>({title:t.title,tags:(t.tags||[]).join(","),caption:t.caption,posttype:t.posttype||"link"}),{windowWidth:660,windowHeight:460});function oAo(t,e){return sS("https://api.tumblr.com/v2/share/stats"+Qs({url:t}),(o,r)=>{e(!o&&r&&r.response?r.response.note_count:void 0)})}cS(oAo);function rAo(t,{title:e,via:n,hashtags:o=[],related:r=[]}){return i0(t,"twitter.url"),i0(Array.isArray(o),"twitter.hashtags is not an array"),i0(Array.isArray(r),"twitter.related is not an array"),"https://twitter.com/intent/tweet"+Qs({url:t,text:e,via:n,hashtags:o.length>0?o.join(","):void 0,related:r.length>0?r.join(","):void 0})}const iAo=w0("twitter",rAo,t=>({hashtags:t.hashtags,title:t.title,via:t.via,related:t.related}),{windowWidth:550,windowHeight:400}),aAo=iAo;function lAo(t,{title:e,separator:n}){return i0(t,"viber.url"),"viber://forward"+Qs({text:e?e+n+t:t})}w0("viber",lAo,t=>({title:t.title,separator:t.separator||" "}),{windowWidth:660,windowHeight:460});function sAo(t,{title:e,image:n,noParse:o,noVkLinks:r}){return i0(t,"vk.url"),"https://vk.com/share.php"+Qs({url:t,title:e,image:n,noparse:o?1:0,no_vk_links:r?1:0})}w0("vk",sAo,t=>({title:t.title,image:t.image,noParse:t.noParse,noVkLinks:t.noVkLinks}),{windowWidth:660,windowHeight:460});function cAo(t,e){window.VK||(window.VK={}),window.VK.Share={count:(r,i)=>{var a,l;return(l=(a=window.VK.callbacks)==null?void 0:a[r])==null?void 0:l.call(a,i)}},window.VK.callbacks=[];const n="https://vk.com/share.php",o=window.VK.callbacks.length;return window.VK.callbacks.push(e),sS(n+Qs({act:"count",index:o,url:t}))}cS(cAo);function uAo(t,{title:e,image:n}){return i0(t,"weibo.url"),"http://service.weibo.com/share/share.php"+Qs({url:t,title:e,pic:n})}w0("weibo",uAo,t=>({title:t.title,image:t.image}),{windowWidth:660,windowHeight:550,windowPosition:"screenCenter"});const dAo=qw({color:"#25D366",networkName:"whatsapp",path:"m42.32286,33.93287c-0.5178,-0.2589 -3.04726,-1.49644 -3.52105,-1.66732c-0.4712,-0.17346 -0.81554,-0.2589 -1.15987,0.2589c-0.34175,0.51004 -1.33075,1.66474 -1.63108,2.00648c-0.30032,0.33658 -0.60064,0.36247 -1.11327,0.12945c-0.5178,-0.2589 -2.17994,-0.80259 -4.14759,-2.56312c-1.53269,-1.37217 -2.56312,-3.05503 -2.86603,-3.57283c-0.30033,-0.5178 -0.03366,-0.80259 0.22524,-1.06149c0.23301,-0.23301 0.5178,-0.59547 0.7767,-0.90616c0.25372,-0.31068 0.33657,-0.5178 0.51262,-0.85437c0.17088,-0.36246 0.08544,-0.64725 -0.04402,-0.90615c-0.12945,-0.2589 -1.15987,-2.79613 -1.58964,-3.80584c-0.41424,-1.00971 -0.84142,-0.88027 -1.15987,-0.88027c-0.29773,-0.02588 -0.64208,-0.02588 -0.98382,-0.02588c-0.34693,0 -0.90616,0.12945 -1.37736,0.62136c-0.4712,0.5178 -1.80194,1.76053 -1.80194,4.27186c0,2.51134 1.84596,4.945 2.10227,5.30747c0.2589,0.33657 3.63497,5.51458 8.80262,7.74113c1.23237,0.5178 2.1903,0.82848 2.94111,1.08738c1.23237,0.38836 2.35599,0.33657 3.24402,0.20712c0.99159,-0.15534 3.04985,-1.24272 3.47963,-2.45956c0.44013,-1.21683 0.44013,-2.22654 0.31068,-2.45955c-0.12945,-0.23301 -0.46601,-0.36247 -0.98382,-0.59548m-9.40068,12.84407l-0.02589,0c-3.05503,0 -6.08417,-0.82849 -8.72495,-2.38189l-0.62136,-0.37023l-6.47252,1.68286l1.73463,-6.29129l-0.41424,-0.64725c-1.70875,-2.71846 -2.6149,-5.85116 -2.6149,-9.07706c0,-9.39809 7.68934,-17.06155 17.15993,-17.06155c4.58253,0 8.88029,1.78642 12.11655,5.02268c3.23625,3.21036 5.02267,7.50812 5.02267,12.06476c-0.0078,9.3981 -7.69712,17.06155 -17.14699,17.06155m14.58906,-31.58846c-3.93529,-3.80584 -9.1133,-5.95471 -14.62789,-5.95471c-11.36055,0 -20.60848,9.2065 -20.61625,20.52564c0,3.61684 0.94757,7.14565 2.75211,10.26282l-2.92557,10.63564l10.93337,-2.85309c3.0136,1.63108 6.4052,2.4958 9.85634,2.49839l0.01037,0c11.36574,0 20.61884,-9.2091 20.62403,-20.53082c0,-5.48093 -2.14111,-10.64081 -6.03239,-14.51915"}),fAo=dAo;function hAo(){return/(android|iphone|ipad|mobile)/i.test(navigator.userAgent)}function pAo(t,{title:e,separator:n}){return i0(t,"whatsapp.url"),"https://"+(hAo()?"api":"web")+".whatsapp.com/send"+Qs({text:e?e+n+t:t})}const gAo=w0("whatsapp",pAo,t=>({title:t.title,separator:t.separator||" "}),{windowWidth:550,windowHeight:400}),mAo=gAo;function yAo(t,{quote:e,hashtag:n}){return i0(t,"workplace.url"),"https://work.facebook.com/sharer.php"+Qs({u:t,quote:e,hashtag:n})}w0("workplace",yAo,t=>({quote:t.quote,hashtag:t.hashtag}),{windowWidth:550,windowHeight:400});const AAo=qw({color:"#000000",networkName:"X",path:"M 41.116 18.375 h 4.962 l -10.8405 12.39 l 12.753 16.86 H 38.005 l -7.821 -10.2255 L 21.235 47.625 H 16.27 l 11.595 -13.2525 L 15.631 18.375 H 25.87 l 7.0695 9.3465 z m -1.7415 26.28 h 2.7495 L 24.376 21.189 H 21.4255 z"}),wAo=AAo,vAo=Ro.div` + */var z3o=MJ.ServerValue;function D3o(t){tit(t.SDK_VERSION),t.INTERNAL.registerComponent(new Ob("database",function(e,n){var o=n.instanceIdentifier,r=e.getProvider("app").getImmediate(),i=e.getProvider("auth-internal"),a=e.getProvider("app-check-internal");return new MJ(Pat(r,i,a,o),r)},"PUBLIC").setServiceProps({Reference:qv,Query:Cat,Database:MJ,DataSnapshot:VE,enableLogging:iit,INTERNAL:S3o,ServerValue:z3o,TEST_ACCESS:I3o}).setMultipleInstances(!0)),t.registerVersion(myo,yyo)}D3o($n);const E3o=be.memo(()=>{const t=H(q8t),e=H($8t),n=H(mp),o=H(Pb),r=H(SW),i=H(jge),a=m.useRef(),l=n.schoolID??sc.UNKNOWN,s=n.classID??Va.UNKNOWN;return m.useEffect(()=>{const c={apiKey:"AIzaSyD-236qE4ix9TkH2AW_wjKSz8jgK0ukjW0",authDomain:"aladdin-316017.firebaseapp.com",projectId:"aladdin-316017",storageBucket:"aladdin-316017.appspot.com",databaseURL:"https://aladdin-2024.firebaseio.com",messagingSenderId:"169516488625",appId:"1:169516488625:web:bb0ae3c3f7c6e813250f90"};let u;for(const d of $n.apps)if(d.name===cG.LOG_DATA){u=d;break}u||(u=$n.initializeApp(c,cG.LOG_DATA)),u&&(a.current=$n.database(u))},[]),m.useEffect(()=>{e&&n.uid&&(async()=>{if(a.current){const u=e.timestamp+" ("+yc(new Date(e.timestamp)).format("MM-DD-YYYY hh:mm A")+")";await a.current.ref(l+"/"+s+"/"+n.uid+"/"+u).set(r?{project:i??"Untitled",action:JSON.stringify(e)}:{file:o??"Untitled",action:JSON.stringify(e)})}})().catch(u=>{SR("Data logger error: "+e+" - "+u)})},[e]),m.useEffect(()=>{t&&(async()=>{if(a.current){const u=t.timestamp+" ("+yc(new Date(t.timestamp)).format("MM-DD-YYYY hh:mm A")+")";await a.current.ref(l+"/"+s+"/"+n.uid+"/"+u).set(r?{project:i??"Untitled",action:JSON.stringify(t)}:{file:o??"Untitled",action:JSON.stringify(t)})}})().catch(u=>{SR("Data logger error: "+t+" - "+u)})},[t]),h.jsx(h.Fragment,{})}),F3o=be.memo(()=>{const t=H(ABe)??3.5,e=H(yBe)??.2,n=H(Uq)??GF,o=me.getShadowMapSize(),r=H(Dw),i=H(Ug),a=2*i,l=i+100,s=H(Ds),c=m.useRef(null);c.current&&(c.current.shadow.camera.left=-l,c.current.shadow.camera.bottom=-l,c.current.shadow.camera.right=l,c.current.shadow.camera.top=l,c.current.shadow.camera.updateProjectionMatrix());const u=r.z>0,d=u?r.normalize().dot(Io):0;return h.jsxs(h.Fragment,{children:[h.jsx("ambientLight",{intensity:Z6t+(u?e*d:0),name:"Ambient Light"}),h.jsx("directionalLight",{ref:c,name:"Directional Light",color:"white",position:r.normalize().multiplyScalar(a),intensity:u?t*d:0,castShadow:s,"shadow-bias":0,"shadow-mapSize-height":o,"shadow-mapSize-width":o,"shadow-camera-near":1,"shadow-camera-far":n})]})}),k3o=be.memo(({element:t})=>{const e=H(zwt),n=H(d1),o=H(ly),r=H(Yge),i=t.type===z.Roof,a="lightGray",l=o3(lW,hN),s={font:l,height:0,size:.2},c={font:l,height:0,size:.35},u=m.useMemo(()=>r(t,n??o),[n,o]),d=m.useMemo(()=>{const P=-Math.atan2(e.x,e.y)+Math.PI;return new nn(Gt,0,P,"ZXY")},[e.x,e.y]),f=()=>{let P=t.lz;return i&&(P=H.getState().selectedElementHeight),Math.ceil(P)+1},p=()=>{let P=t.lz;return i&&(P=t.rise),P.toFixed(1)+" m"},g=()=>i?H.getState().selectedElementHeight+1:t.lz-.175;if(!n&&!o)return null;const y=f(),w=p(),b=g(),C=new Array(y+1).fill(0);return h.jsxs("group",{position:u,rotation:d,name:"Vertical Ruler",children:[h.jsx(jn,{userData:{unintersectable:!0},points:[[0,0,0],[0,y,0]],color:a}),h.jsxs("mesh",{position:[-1.5,b,0],userData:{unintersectable:!0},children:[h.jsx("textGeometry",{args:[w,c]}),h.jsx("meshBasicMaterial",{attach:"material",color:"white"})]}),C.map((P,v)=>{const T=.2+(v%5===0?.05:0),A=h.jsx("textGeometry",{args:[`${v}`,s]});return h.jsxs("group",{children:[h.jsx(jn,{userData:{unintersectable:!0},points:[[-T,v,0],[T,v,0]],lineWidth:.5,color:a}),!i&&h.jsxs("mesh",{position:[.4,v-.125,0],userData:{unintersectable:!0},children:[A,h.jsx("meshBasicMaterial",{attach:"material",color:a})]})]},v)})]})}),L3o=be.memo(()=>{const t=H(Eb),e=H(Zq),n=H(d1),o=H(ly),r=H(hA),i=H(Ug),a=H(t$),l=H(e$),s=H(v=>{if(v.selectedElement){const T=v.selectedElement.id;return v.elements.find(A=>A.id===T)}}),[c,u]=m.useState(!1),[d,f]=m.useState(2*i),[p,g]=m.useState(2*i);m.useEffect(()=>{const v=Math.floor(i/50)+1,T=Math.round(i/v)*2;f(T*v),g(T)},[i]),m.useEffect(()=>{if(n){const v=me.isTopResizeHandle(n)||n===vt.UpperLeft&&(s==null?void 0:s.type)===z.Wall||n===vt.UpperRight&&(s==null?void 0:s.type)===z.Wall;u(!v)}else u(!1)},[n,s==null?void 0:s.type]);const y=()=>{if(!s)return!1;const v=s.type;return v===z.Foundation||v===z.Cuboid||v===z.Tree&&s.parentId===z.Ground||v===z.Human&&s.parentId===z.Ground},w=o===Kr.Lower||o===Kr.Upper,P=(v=>me.isTopResizeHandle(v)||(s==null?void 0:s.type)===z.Wall&&me.isTopResizeHandleOfWall(v)||(s==null?void 0:s.type)===z.Roof&&me.isRiseHandleOfRoof(v))(n??o);return s?h.jsxs(h.Fragment,{children:[((c||t||me.isMoveHandle(o))&&!r&&y()||a||l)&&h.jsx("gridHelper",{rotation:[Gt,0,0],name:"Grid",args:[d,p,"gray","#444444"]}),(e||w)&&s&&y()&&h.jsx(Uye,{element:s}),P&&h.jsx(k3o,{element:s})]}):null}),lle=120,tv="DarkSlateGray",lD="white",W3o=be.memo(({visible:t=!0})=>{const e=m.useRef(null),n=Jt(),o=window.devicePixelRatio,r=lle*o,i=r/150,l=20*i+"px serif";return m.useEffect(()=>{e.current&&Fn.setState({compassRef:e})},[]),m.useEffect(()=>{if(!e.current||!t)return;const s=e.current.getContext("2d");if(!s)return;const c=55*i,u=10*i,d=40*i,f=5*i,p=30*i,g=i,y=i,w=15*i,b=r/2;s.clearRect(0,0,r,r),s.beginPath(),s.arc(b,b,d,0,Math.PI*2),s.lineWidth=f,s.strokeStyle=tv,s.stroke(),s.beginPath(),s.arc(b,b,p,0,Math.PI*2),s.lineWidth=g,s.strokeStyle=tv,s.stroke(),s.lineWidth=y,s.beginPath(),s.moveTo(b,b-c),s.lineTo(b-u,b-u),s.lineTo(b,b),s.fillStyle=lD,s.stroke(),s.fill(),s.beginPath(),s.moveTo(b,b-c),s.lineTo(b+u,b-u),s.lineTo(b,b),s.fillStyle=tv,s.stroke(),s.fill(),s.beginPath(),s.moveTo(b,b+c),s.lineTo(b-u,b+u),s.lineTo(b,b),s.fillStyle=tv,s.stroke(),s.fill(),s.beginPath(),s.moveTo(b,b+c),s.lineTo(b+u,b+u),s.lineTo(b,b),s.fillStyle=lD,s.stroke(),s.fill(),s.beginPath(),s.moveTo(b-c,b),s.lineTo(b-u,b-u),s.lineTo(b,b),s.fillStyle=tv,s.stroke(),s.fill(),s.beginPath(),s.moveTo(b-c,b),s.lineTo(b-u,b+u),s.lineTo(b,b),s.fillStyle=lD,s.stroke(),s.fill(),s.beginPath(),s.moveTo(b+c,b),s.lineTo(b+u,b-u),s.lineTo(b,b),s.fillStyle=lD,s.stroke(),s.fill(),s.beginPath(),s.moveTo(b+c,b),s.lineTo(b+u,b+u),s.lineTo(b,b),s.fillStyle=tv,s.stroke(),s.fill(),s.font=l,s.fillStyle=lD,s.textAlign="center",s.fillText(`${Y.t("compass.N",n)}`,b,w),s.save(),s.translate(r,r),s.rotate(Math.PI),s.fillText(`${Y.t("compass.S",n)}`,b,w),s.restore(),s.fillStyle=tv,s.save(),s.translate(0,r),s.rotate(-Math.PI/2),s.fillText(`${Y.t("compass.W",n)}`,b,w),s.restore(),s.save(),s.translate(r,0),s.rotate(Math.PI/2),s.fillText(`${Y.t("compass.E",n)}`,b,w),s.restore()},[n,t]),t?h.jsx("canvas",{ref:e,id:"compassCanvas",width:r,height:r,style:{position:"absolute",bottom:"0",right:"0",height:`${lle}px`,width:`${lle}px`,margin:"5px",pointerEvents:"none"}}):null});var Rat={exports:{}};(function(t,e){(function(n,o){t.exports=o(m,Wq)})(window,function(n,o){return function(r){var i={};function a(l){if(i[l])return i[l].exports;var s=i[l]={i:l,l:!1,exports:{}};return r[l].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=r,a.c=i,a.d=function(l,s,c){a.o(l,s)||Object.defineProperty(l,s,{enumerable:!0,get:c})},a.r=function(l){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})},a.t=function(l,s){if(1&s&&(l=a(l)),8&s||4&s&&typeof l=="object"&&l&&l.__esModule)return l;var c=Object.create(null);if(a.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:l}),2&s&&typeof l!="string")for(var u in l)a.d(c,u,(function(d){return l[d]}).bind(null,u));return c},a.n=function(l){var s=l&&l.__esModule?function(){return l.default}:function(){return l};return a.d(s,"a",s),s},a.o=function(l,s){return Object.prototype.hasOwnProperty.call(l,s)},a.p="",a(a.s=0)}([function(r,i,a){Object.defineProperty(i,"__esModule",{value:!0});var l=a(1);Object.defineProperty(i,"default",{enumerable:!0,get:function(){return function(s){return s&&s.__esModule?s:{default:s}}(l).default}}),r.exports=i.default},function(r,i,a){Object.defineProperty(i,"__esModule",{value:!0});var l=Object.assign||function(y){for(var w=1;w0&&p[0]!==this)return!1;var R=b.target===document.body||S,M=this.childrenContainer&&this.childrenContainer.contains(b.target);if(!(x?M:R))return!1;var D=(0,d.findMatchedKey)(b,v);return!!D&&(T(D,b),!0)}},{key:"render",value:function(){var b=this,C=this.props.children,P=Object.assign({},this.props),v=!0,T=!1,A=void 0;try{for(var x,S=Object.keys(w.propTypes)[Symbol.iterator]();!(v=(x=S.next()).done);v=!0)delete P[x.value]}catch(R){T=!0,A=R}finally{try{!v&&S.return&&S.return()}finally{if(T)throw A}}return C?c.default.createElement("span",l({ref:function(R){b.childrenContainer=R}},P),C):null}}]),w}();i.default=g,g.propTypes={handleKeys:u.default.array,handleEventType:u.default.oneOf(["keydown","keyup","keypress"]),handleFocusableElements:u.default.bool,onKeyEvent:u.default.func,isDisabled:u.default.bool,isExclusive:u.default.bool,children:u.default.any},g.defaultProps={handleKeys:[],handleFocusableElements:!1,handleEventType:"keydown",onKeyEvent:function(){return null}},r.exports=i.default},function(r,i){r.exports=n},function(r,i){r.exports=o},function(r,i,a){function l(C,P,v){return P in C?Object.defineProperty(C,P,{value:v,enumerable:!0,configurable:!0,writable:!0}):C[P]=v,C}Object.defineProperty(i,"__esModule",{value:!0}),i.matchKeyEvent=b,i.findMatchedKey=function(C,P){var v=P.map(function(T){var A=T.toLowerCase(),x=w[A];return x||[T]}).reduce(function(T,A){return T.concat(A)},[]).find(function(T){return b(C,T)});return!v&&P.includes("all")&&(v="other"),v};var s={backspace:[8],del:[46],delete:[46],ins:[45],insert:[45],tab:[9],enter:[13],return:[13],esc:[27],space:[32],pageup:[33],pagedown:[34],end:[35],home:[36],left:[37],up:[38],right:[39],down:[40],shift:[16],ctrl:[17],alt:[18],cap:[20],num:[144],clear:[12],meta:[91],";":[186,59],"=":[187,61],",":[188,44],"-":[189,45,173,109],minus:[189,45,173,109],".":[190,110],"/":[191,111],"`":[192],"[":[219],"\\":[220],"]":[221],"*":[106],"+":[107],plus:[107],"'":[222],quote:[222]},c=Object.keys(s).reduce(function(C,P){return Object.assign(C,l({},P.toUpperCase(),s[P]))},{}),u="0123456789".split("").reduce(function(C,P,v){return Object.assign(C,l({},P,[v+48,v+96]))},{}),d="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").reduce(function(C,P,v){return Object.assign(C,l({},P.toLowerCase(),[v+65]),l({},P,[v+65]))},{}),f="1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19".split(",").reduce(function(C,P,v){return Object.assign(C,l({},"f"+P,[v+112]))},{}),p={control:"ctrl",ctrl:"ctrl",shift:"shift",meta:"meta",cmd:"meta",command:"meta",option:"alt",alt:"alt"},g=i.AllKeys=Object.assign({},s,c,u,d,f),y=Object.assign({},u,d),w={all:Object.keys(g),alphanumeric:Object.keys(y),numeric:Object.keys(u),alphabetic:Object.keys(d),function:Object.keys(f)};function b(C,P){var v=C.which||C.keyCode,T=C.type,A=Object.keys(p).filter(function(j){return C[j+"Key"]}).sort(),x=P.toLowerCase().trim(),S=x==="+"?["+"]:x.split(/\s?\+\s?/),R=S.pop(),M=g[R],D=S;if(T==="keypress")return P==String.fromCharCode(v).toLowerCase();if(D.length===0&&A.length===0)return M.indexOf(v)>=0;if(D.length>0&&A.length>0){var E=D.map(function(j){return p[j]}).sort(),W=E.length===A.length&&E.every(function(j,L){return A[L]===j});return M.indexOf(v)>=0&&W}return D.length==0&&A.length===1&&R===A[0]}}])})})(Rat);var N3o=Rat.exports;const aze=Fi(N3o),U3o=be.memo(()=>{var s,c;const t=H(fn),e=H(Gge),n=H(Vge),o=H(En),r=m.useRef(!1),i=m.useRef(!1);H(AOe),H(wOe),ht(u=>u.selectedElementId),m.useEffect(()=>{Fn.setState({listenToAutoDeletionByDeleteRef:r,listenToAutoDeletionByCutRef:i})},[]);const a=L2.debounce(()=>{var v,T;const u=ht.getState().selectedElementId,d=H.getState().selectedElementIdSet;if(!u||d.size===0)return;const f=H.getState().getAutoDeletedElements();if(!f)return;const p=H.getState().deletedElements,g=H.getState().elementsToPaste,y=(v=Fn.getState().listenToAutoDeletionByCutRef)==null?void 0:v.current,w=(T=Fn.getState().listenToAutoDeletionByDeleteRef)==null?void 0:T.current;let b=[],C="";y?(Fn.getState().setListenToAutoDeletionByCut(!1),b=[...g,...f],C="Cut"):w&&(Fn.getState().setListenToAutoDeletionByDelete(!1),b=[...p,...f],C="Delete");const P={name:C,timestamp:Date.now(),deletedElements:[...b],selectedElementId:u,selectedElementIdSet:new Set(d),undo(){const A=P.deletedElements;if(!A||A.length===0)return;for(const S of this.deletedElements)if(S.type===z.Wall){const R=S;R.leftJoints.length>0&&e(R.leftJoints[0],[R.id]),R.rightJoints.length>0&&n(R.rightJoints[0],[R.id])}else S.type===z.Roof&&t(R=>{R.addedRoofIdSet.add(S.id)});const x=A.find(S=>S.id===this.selectedElementId)??null;t(S=>{S.elements.push(...A),S.selectedElement=x,S.selectedElementIdSet=new Set(this.selectedElementIdSet),S.updateWallMapOnFoundationFlag=!S.updateWallMapOnFoundationFlag,S.deletedRoofId=null,S.autoDeletedRoofs=null,S.deletedRoofIdSet.clear(),S.autoDeletedRoofIdSet.clear(),S.autoDeletedChild=null})},redo(){P.deletedElements.length!==0&&(t(A=>{A.selectedElement=A.elements.find(x=>x.id===this.selectedElementId)??null,A.selectedElementIdSet=new Set(this.selectedElementIdSet)}),H.getState().removeSelectedElements())}};o(P),t(A=>{A.selectedElement=null,A.selectedElementIdSet.clear(),A.deletedRoofId=null,A.deletedRoofIdSet.clear(),A.autoDeletedRoofs=null,A.autoDeletedRoofIdSet.clear(),A.autoDeletedChild=null}),ht.getState().setPrimitiveStore("selectedElementId",null)},50);return(((s=Fn.getState().listenToAutoDeletionByCutRef)==null?void 0:s.current)||((c=Fn.getState().listenToAutoDeletionByDeleteRef)==null?void 0:c.current))&&H.getState().getAutoDeletedElements()&&a(),null}),lze=["left","up","right","down","shift+left","shift+up","shift+right","shift+down","ctrl+shift+left","ctrl+shift+up","ctrl+shift+right","ctrl+shift+down","meta+shift+left","meta+shift+up","meta+shift+right","meta+shift+down","ctrl+f","meta+f","ctrl+o","meta+o","ctrl+s","meta+s","ctrl+c","meta+c","ctrl+x","meta+x","ctrl+v","meta+v","ctrl+[","meta+[","ctrl+]","meta+]","ctrl+z","meta+z","ctrl+y","meta+y","ctrl+m","meta+m","ctrl+u","meta+u","ctrl+b","meta+b","shift","esc","ctrl+home","ctrl+alt+h","ctrl+shift+o","meta+shift+o","ctrl+shift+s","meta+shift+s","delete","backspace","alt+backspace","f2","f4","ctrl"],j3o=be.memo(({canvas:t})=>{const e=H(fn),n=H(da),o=H(bW),r=H(s0),i=H(xwt),a=H(En),l=H(Id)??!1,s=H(Cb),c=H(Gn),u=H(kYe),d=H(yp),f=H(s7t),p=H(qr),g=H(Vge),y=H(Gge),w=H(m7t),b=H(Ege),C=.1,P=m.useMemo(()=>({lng:r}),[r]),v=(_,X)=>(t&&(t.style.cursor="default"),d(_,X)),T=()=>{if(H.getState().viewState.navigationView)return;const _=H.getState().set2DView,X={name:"Set 2D View",timestamp:Date.now(),checked:!l,undo:()=>{_(!X.checked)},redo:()=>{_(X.checked)}};a(X),_(!l),e($=>{$.viewState.autoRotate=!1})},A=()=>{if(l)return;const _=H.getState().setNavigationView,X={name:"Set Navigation View",timestamp:Date.now(),checked:!H.getState().viewState.navigationView,undo:()=>{_(!X.checked)},redo:()=>{_(X.checked)}};a(X),_(!H.getState().viewState.navigationView),e($=>{$.viewState.autoRotate=!1})},x=()=>{if(l)return;const _={name:"Auto Rotate",timestamp:Date.now(),checked:!H.getState().viewState.autoRotate,undo:()=>{e(X=>{X.objectTypeToAdd=z.None,X.groupActionMode=!1,X.viewState.autoRotate=!_.checked})},redo:()=>{e(X=>{X.objectTypeToAdd=z.None,X.groupActionMode=!1,X.viewState.autoRotate=_.checked})}};a(_),e(X=>{X.objectTypeToAdd=z.None,X.groupActionMode=!1,X.viewState.autoRotate=!X.viewState.autoRotate})},S=(_,X,$)=>{const Q=JSON.parse(JSON.stringify(_));if(Q.cx=X,Q.cy=$,_.type===z.SolarPanel&&_.parentType===z.Roof){if(_.parentId&&_.foundationId){const le=c(_.parentId),q=c(_.foundationId);if(le&&q){const te=Cn.getRoofBoundaryVertices(le),re=Cn.getSolarPanelVerticesOnRoof(Q,q);if(!s$e(re,te)||!c$e(Q,q,re))return!1}}return!0}if(b(Q))return po(Y.t("message.MoveCancelledBecauseOfOverlap",P)),!1;if(Q.type===z.SolarPanel){const le=p(_);if(le&&!me.isSolarCollectorWithinHorizontalSurface(Q,le))return po(Y.t("message.MoveOutsideBoundaryCancelled",P)),!1}return!0},R=_=>{switch(_.type){case z.Roof:case z.Door:case z.Window:return!1;case z.SolarPanel:case z.Sensor:case z.Light:{const X=_;return X.parentType===z.Wall||X.parentType===z.Roof?!1:X.parentType===z.Cuboid?X.rotation[2]===1:!0}case z.Wall:{const X=_;return!(X.leftJoints.length!==0||X.rightJoints.length!==0)}default:return!0}},M=(_,X)=>{switch(_){case z.Foundation:case z.Cuboid:return X===z.Foundation||X===z.Cuboid;default:return X!==z.Foundation&&X!==z.Cuboid}},D=_=>{const X=H.getState().elements.filter(q=>md(q)&&q.parentId===Zo),$=new Set(_.map(q=>q.id)),Q=new Map;for(const q of X){const te=me.fetchFoundationVertexCoordinates(q);Q.set(q.id,te)}const le=q=>{for(const te of X)!$.has(te.id)&&me.areBasesOverlapped(q.id,te.id,Q)&&($.add(te.id),_.push(te),te.enableGroupMaster&&le(te))};for(const q of _)q.enableGroupMaster&&le(q)},E=()=>{const _=[],X=H.getState().selectedElementIdSet,$=s();if(!$||X.size===0)return _;if($){const Q=$.type,le=$.parentId,q=H.getState().elements.filter(te=>M(Q,te.type)&&R(te)&&te.parentId===le&&X.has(te.id));_.push(...q),md($)&&_.length>0&&le===Zo&&D(_)}return _},W=(_,X,$,Q)=>{switch(Q){case Sl.Left:return[_-$,X];case Sl.Right:return[_+$,X];case Sl.Up:return[_,X+$];case Sl.Down:return[_,X-$]}},j=(_,X)=>{e($=>{var le,q;let Q=!1;for(const te of $.elements)if(_.has(te.id)){const re=_.get(te.id);if(re!==void 0){const[ae,se]=W(te.cx,te.cy,re,X);if(te.type===z.Wall){const ne=te,fe=new ie(ae-ne.cx,se-ne.cy),ge=new ie().fromArray(ne.leftPoint).setZ(0).add(fe),de=new ie().fromArray(ne.rightPoint).setZ(0).add(fe);ne.leftPoint=ge.toArray(),ne.rightPoint=de.toArray(),Q=!0}te.cx=ae,te.cy=se}}else $.selectedElementIdSet.has(te.id)&&$.selectedElementIdSet.delete(te.id);((le=$.selectedElement)==null?void 0:le.type)===z.Cuboid||((q=$.selectedElement)==null?void 0:q.type)===z.Foundation?$.groupActionUpdateFlag=!$.groupActionUpdateFlag:Q&&($.updateWallMapOnFoundationFlag=!$.updateWallMapOnFoundationFlag)})},L=(_,X)=>{e($=>{for(const Q of $.elements)(me.isFoundationOrCuboid(Q)||me.isPlantOrHuman(Q)&&Q.parentId===Zo)&&([Q.cx,Q.cy]=W(Q.cx,Q.cy,_,X))})},k=_=>_===Sl.Left?Sl.Right:_===Sl.Right?Sl.Left:_===Sl.Up?Sl.Down:_===Sl.Down?Sl.Up:(console.error("Undo direction is possibly incorrect:",_),_),N=(_,X)=>{if(!l)return;const $=E(),Q=s(),le=X*C;if(Q&&$.length>0){const q=new Map;for(const re of $)switch(re.type){case z.Foundation:case z.Cuboid:case z.Wall:case z.Tree:case z.Flower:case z.Human:{q.set(re.id,le);break}case z.Light:case z.Sensor:{const ae=p(Q);if(ae){let se=le/ae.lx;const[ne,fe]=W(re.cx,re.cy,se,_),ge=re.lx/(2*ae.lx),de=re.lx/(2*ae.ly);switch(_){case Sl.Left:case Sl.Right:{const Z=me.clamp(ne,-.5+ge,.5-ge);se=Math.abs(Z-Q.cx);break}case Sl.Up:case Sl.Down:{const Z=me.clamp(fe,-.5+de,.5-de);se=Math.abs(Z-Q.cy);break}}q.set(re.id,se)}break}case z.SolarPanel:case z.ParabolicDish:case z.ParabolicTrough:case z.FresnelReflector:case z.Heliostat:{const ae=p(re);if(ae){let se=!0,ne=le;switch(_){case Sl.Left:case Sl.Right:{ne=le/ae.lx;break}case Sl.Up:case Sl.Down:{ne=le/ae.ly;break}}if(re.type===z.SolarPanel){const[fe,ge]=W(re.cx,re.cy,ne,_);se=S(re,fe,ge)}if(se)q.set(re.id,ne);else return}break}}j(q,_);const te={name:`Move Selected Elements ${_} By Key`,timestamp:Date.now(),direction:_,movedElementsDisplacementMap:new Map(q),undo:()=>{const re=k(te.direction);j(te.movedElementsDisplacementMap,re)},redo:()=>{j(te.movedElementsDisplacementMap,te.direction)}};a(te)}else{L(le,_);const q={name:`Move All ${_} By Key`,timestamp:Date.now(),direction:_,displacement:le,undo:()=>{const te=k(q.direction);L(q.displacement,te)},redo:()=>{L(q.displacement,q.direction)}};a(q)}},F=_=>{H.getState().set(X=>{X.multiSelectionsMode=_})},U=_=>{const X=s(),$=1;switch(_){case"left":N(Sl.Left,$);break;case"shift+left":N(Sl.Left,$/Z5);break;case"ctrl+shift+left":case"meta+shift+left":N(Sl.Left,$*Z5);break;case"right":N(Sl.Right,$);break;case"shift+right":N(Sl.Right,$/Z5);break;case"ctrl+shift+right":case"meta+shift+right":N(Sl.Right,$*Z5);break;case"down":N(Sl.Down,$);break;case"shift+down":N(Sl.Down,$/Z5);break;case"ctrl+shift+down":case"meta+shift+down":N(Sl.Down,$*Z5);break;case"up":N(Sl.Up,$);break;case"shift+up":N(Sl.Up,$/Z5);break;case"ctrl+shift+up":case"meta+shift+up":N(Sl.Up,$*Z5);break;case"ctrl+[":case"meta+[":yX(.9);break;case"ctrl+]":case"meta+]":yX(1.1);break;case"ctrl+c":case"meta+c":X&&X.type!==z.Roof&&(u(X.id),e(Q=>{Q.selectedElementIdSet.clear(),Q.selectedElementIdSet.add(X.id)}),n&&e(Q=>{Q.actionInfo={name:"Copy",timestamp:new Date().getTime(),elementId:X.id,elementType:X.type}}));break;case"ctrl+x":case"meta+x":if(!X||X.type===z.Roof)break;if(X.locked)hn(Y.t("message.ThisElementIsLocked",P));else{const Q=v(X.id,!0);if(Q.length===0)break;if(me.isElementTriggerAutoDeletion(X))Fn.getState().setListenToAutoDeletionByCut(!0),ht.getState().setPrimitiveStore("selectedElementId",X.id);else{const le={name:"Cut",timestamp:Date.now(),deletedElements:Q,selectedElementId:X.id,undo:()=>{const q=le.deletedElements;if(q.length===0)return;const te=q.find(re=>re.id===le.selectedElementId);te&&e(re=>{if(re.elements.push(...q),re.selectedElementIdSet.clear(),re.selectedElementIdSet.add(te.id),re.selectedElement=te,te.type===z.Wall){const ae=te;let se=null,ne=null;if(ae.leftJoints.length>0&&(se=ae.leftJoints[0]),ae.rightJoints.length>0&&(ne=ae.rightJoints[0]),se||ne)for(const fe of re.elements)fe.id===se&&fe.type===z.Wall&&(fe.rightJoints[0]=ae.id),fe.id===ne&&fe.type===z.Wall&&(fe.leftJoints[0]=ae.id)}})},redo:()=>{le.deletedElements&&le.deletedElements.length>0&&v(le.deletedElements[0].id,!0)}};a(le)}}break;case"ctrl+v":case"meta+v":{const Q=f();if(Q.length>0){const le={name:"Paste by Key",timestamp:Date.now(),pastedElements:JSON.parse(JSON.stringify(Q)),undo:()=>{for(const q of le.pastedElements)d(q.id,!1)},redo:()=>{e(q=>{q.elements.push(...le.pastedElements),q.selectedElement=le.pastedElements[0]})}};a(le)}break}case"ctrl+alt+h":case"ctrl+home":{if(!l){const Q=H.getState().viewState.cameraPosition,le=H.getState().viewState.panCenter;if(Q[0]!==Q[1]||Q[1]!==Q[2]||Q[0]!==Q[2]||le[0]!==0||le[1]!==0||le[2]!==0){const q={name:"Reset View",timestamp:Date.now(),oldCameraPosition:[...Q],oldPanCenter:[...le],undo:()=>{const te=Fn.getState().orbitControlsRef;te!=null&&te.current&&(te.current.object.position.set(q.oldCameraPosition[0],q.oldCameraPosition[1],q.oldCameraPosition[2]),te.current.target.set(q.oldPanCenter[0],q.oldPanCenter[1],q.oldPanCenter[2]),te.current.update(),e(re=>{const ae=re.viewState;ae.cameraPosition=[...q.oldCameraPosition],ae.panCenter=[...q.oldPanCenter]}))},redo:()=>{mX()}};a(q),e(te=>{te.objectTypeToAdd=z.None,te.groupActionMode=!1,te.viewState.orthographic=!1}),mX()}}break}case"f2":case"ctrl+b":case"meta+b":T();break;case"ctrl+u":case"meta+u":A();break;case"f4":case"ctrl+m":case"meta+m":x();break;case"ctrl+f":case"meta+f":ht.getState().set(Q=>{Q.createNewFileFlag=!0,Q.openModelsMap=!1}),e(Q=>{Q.objectTypeToAdd=z.None,Q.groupActionMode=!1,window.history.pushState({},document.title,t1),n&&(Q.actionInfo={name:"Create New File",timestamp:new Date().getTime()})});break;case"ctrl+s":case"meta+s":ht.getState().set(Q=>{Q.saveLocalFileDialogVisible=!0}),n&&e(Q=>{Q.actionInfo={name:"Save Local File",timestamp:new Date().getTime()}});break;case"ctrl+shift+o":case"meta+shift+o":ht.getState().set(Q=>{Q.listCloudFilesFlag=!0,Q.openModelsMap=!1}),n&&e(Q=>{Q.actionInfo={name:"List Cloud Files",timestamp:new Date().getTime()}});break;case"ctrl+shift+s":case"meta+shift+s":ht.getState().setSaveCloudFileFlag(!0),n&&e(Q=>{Q.actionInfo={name:"Save Cloud File",timestamp:new Date().getTime()}});break;case"alt+backspace":case"backspace":case"delete":{const Q=H.getState().selectedElementIdSet;if(!X||Q.size===0)break;const le=H.getState().removeSelectedElements();if(le.length===0)break;if((()=>{const te=le.filter(se=>se.type===z.Foundation),re=new Set(te.map(se=>se.id));return!!le.find(se=>!re.has(se.parentId)&&me.isElementTriggerAutoDeletion(se))})())Fn.getState().setListenToAutoDeletionByDelete(!0),ht.getState().setPrimitiveStore("selectedElementId",X.id);else{if(le.length===1){const te={name:"Delete",timestamp:Date.now(),deletedElements:[...le],selectedElementId:X.id,undo:()=>{const re=te.deletedElements;if(!re||re.length===0)return;const ae=re.find(se=>se.id===te.selectedElementId);if(ae&&(e(se=>{se.elements.push(...re),se.selectedElementIdSet.clear(),se.selectedElementIdSet.add(ae.id),se.selectedElement=ae,se.updateWallMapOnFoundationFlag=!se.updateWallMapOnFoundationFlag,se.deletedRoofId=null,se.deletedRoofIdSet.clear()}),ae.type===z.Wall)){const se=ae;se.leftJoints.length>0&&y(se.leftJoints[0],[se.id]),se.rightJoints.length>0&&g(se.rightJoints[0],[se.id])}},redo:()=>{const re=te.deletedElements;if(!re||re.length===0)return;const ae=re.find(se=>se.id===te.selectedElementId);ae&&v(ae.id,!1)}};a(te)}else{const te={name:"Delete Multiple",timestamp:Date.now(),deletedElements:[...le],selectedElementId:X.id,selectedElementIdSet:new Set(Q),undo(){const re=this.deletedElements;if(!re||re.length===0)return;const ae=re.find(se=>se.id===this.selectedElementId);if(ae){e(se=>{se.elements.push(...re),se.selectedElement=ae,se.selectedElementIdSet=new Set(this.selectedElementIdSet),se.updateWallMapOnFoundationFlag=!se.updateWallMapOnFoundationFlag,se.deletedRoofId=null,se.deletedRoofIdSet.clear()});for(const se of this.deletedElements)if(se.type===z.Wall){const ne=se;ne.leftJoints.length>0&&y(ne.leftJoints[0],[ne.id]),ne.rightJoints.length>0&&g(ne.rightJoints[0],[ne.id])}}},redo(){e(re=>{re.selectedElement=re.elements.find(ae=>ae.id===this.selectedElementId)??null,re.selectedElementIdSet=new Set(this.selectedElementIdSet)}),H.getState().removeSelectedElements()}};a(te)}e(te=>{te.selectedElement=null,te.selectedElementIdSet.clear()})}break}case"ctrl+z":case"meta+z":if(i.hasUndo()){const Q=i.undo();H.getState().groupActionMode&&e(le=>{le.groupActionUpdateFlag=!le.groupActionUpdateFlag}),Q&&hn(Y.t("menu.edit.Undo",P)+": "+Q,fG),n&&e(le=>{le.actionInfo={name:"Undo",timestamp:new Date().getTime()}})}break;case"ctrl+y":case"meta+y":if(i.hasRedo()){const Q=i.redo();Q&&hn(Y.t("menu.edit.Redo",P)+": "+Q,fG),H.getState().groupActionMode&&e(le=>{le.groupActionUpdateFlag=!le.groupActionUpdateFlag}),n&&e(le=>{le.actionInfo={name:"Redo",timestamp:new Date().getTime()}})}break;case"shift":H.getState().viewState.navigationView&&ht.getState().set(Q=>{Q.navigationMoveSpeed=5*H.getState().minimumNavigationMoveSpeed,Q.navigationTurnSpeed=5*H.getState().minimumNavigationTurnSpeed}),w(!0);break;case"esc":{const Q=H.getState().addedFoundationId,le=H.getState().addedCuboidId,q=H.getState().addedWallId,te=H.getState().addedWindowId,re=H.getState().addedDoorId;Q?d(Q,!1):le?d(le,!1):q?d(q,!1):te?(d(te,!1),ht.getState().setPrimitiveStore("elementBeingCanceledId",te)):re&&(d(re,!1),ht.getState().setPrimitiveStore("elementBeingCanceledId",re)),e(ae=>{ae.objectTypeToAdd=z.None,ae.actionModeLock=!1,ae.moveHandleType=null,ae.resizeHandleType=null,ae.groupActionMode=!1}),Fn.getState().setEnableOrbitController(!0),o();break}case"ctrl":{F(!0);break}}},O=_=>{switch(_){case"shift":H.getState().viewState.navigationView&&ht.getState().set(X=>{X.navigationMoveSpeed=H.getState().minimumNavigationMoveSpeed,X.navigationTurnSpeed=H.getState().minimumNavigationTurnSpeed}),w(!1);break;case"ctrl+o":case"meta+o":H.getState().localFileDialogRequested||(ht.getState().set(X=>{X.openLocalFileFlag=!0}),e(X=>{X.localFileDialogRequested=!0,n&&(X.actionInfo={name:"Open Local File",timestamp:new Date().getTime()})}));break;case"ctrl":{F(!1);break}}};m.useEffect(()=>()=>{B.current=null},[]);const B=m.useRef(null);return h.jsxs(h.Fragment,{children:[h.jsx(aze,{handleKeys:lze,handleEventType:"keydown",onKeyEvent:(_,X)=>{X.preventDefault(),B.current!==_&&(B.current=_,U(_))}}),h.jsx(aze,{handleKeys:lze,handleEventType:"keyup",onKeyEvent:(_,X)=>{X.preventDefault(),B.current=null,O(_)}}),h.jsx(U3o,{})]})}),B3o="/aladdin/assets/cloud-B68yt6QG.png",Y3o=be.memo(()=>{const t=H(fn),e=H(Iwt),{scene:n}=oi();m.useEffect(()=>{const r=n.children.filter(l=>l.name==="Content"),i=[];if(r.length>0){const l=r[0].children;for(const s of l)o(s,i)}const a=[];for(const l of i)a.push(new bf().setFromObject(l));if(a.length>0){const l=new ie,s=new ie;for(const u of a)l.min(u.min),s.max(u.max);let c=Math.abs(l.x);c{u.aabb=new bf(l,s),!isNaN(c)&&isFinite(c)&&(u.sceneRadius=Math.round(Math.max(10,c*1.25)))})}},[e]);const o=(r,i)=>{if(r.userData.aabb&&i.push(r),r.children.length>0)for(const a of r.children)o(a,i)};return h.jsx(h.Fragment,{})}),Ofe=t=>{const e=new ie().subVectors(t.localToWorld(new ie(0,0,1e3)),t.position);return e.x===0&&e.y===0&&t.getWorldDirection(e),e},qT=t=>{const e=document.getElementById("compassCanvas"),n=o=>{ht.getState().set(r=>{r.isCameraUnderGround=o})};if(e){const o=Ofe(t).normalize(),i=(Math.atan2(o.y,o.x)+Math.PI/2)/Math.PI*180;e.style.transform=`rotate(${i}deg)`;const a=t.position.z<.001;a&&!ht.getState().isCameraUnderGround?n(!0):!a&&ht.getState().isCameraUnderGround&&n(!1)}},O3o=be.memo(()=>{const t=H(fn),e=H(Id),n=H(R4t),o=H(SBe),r=H(zH),i=H(Ug),a=H(H4t),l=H(M4t),s=H(Uq)??GF,c=H(Nq),u=ht(W8t),d=ht(N8t),f=H(XBe),p=ht(qBe),g=c&&!e,y=Math.hypot(a[0],a[1],a[2]),w=(e?l*50:y*10)*i,b=m.useMemo(()=>new ie(-w,-w,0),[w]),C=m.useMemo(()=>new ie(w,w,w/2),[w]),{gl:P,invalidate:v,get:T,set:A,camera:x}=oi(),S=m.useMemo(()=>{const F=T().camera;return F.up.set(0,0,1),F},[]),R=m.useMemo(()=>P.domElement,[]),M=m.useRef(null),D=m.useRef(null),E=m.useRef(null);m.useEffect(()=>{Fn.setState({canvas:{gl:P,camera:x}}),!e&&D.current&&Fn.setState({canvas:{gl:P,camera:D.current}})},[e]),m.useEffect(()=>{H.getState().viewState.cameraPosition2D[2]<100&&t(F=>{F.viewState.cameraPosition2D[2]=150})},[]),m.useEffect(()=>{M&&M.current&&Fn.setState({orbitControlsRef:M})},[]),m.useEffect(()=>{M.current&&(M.current.addEventListener("change",W),M.current.addEventListener("start",j),M.current.addEventListener("end",L));const F=M.current;return()=>{F&&(F.removeEventListener("change",W),F.removeEventListener("start",j),F.removeEventListener("end",L))}},[g]),m.useEffect(()=>{const F=H.getState().viewState;if(M.current){if(D.current){if(g){const U=T().camera,O=F.cameraPositionNav??[5,-30,1],B=F.cameraRotationNav??[1.5374753309166491,.16505866097993566,.005476951734475092];U.position.fromArray(O),U.rotation.fromArray([B[0],B[1],B[2],"XYZ"])}else{const U=k(F.cameraPosition??[0,0,20]),O=k(F.panCenter??[0,0,0]);D.current.position.copy(U),D.current.lookAt(O),D.current.zoom=1,e||(M.current.object=D.current,M.current.target.copy(O))}x.updateMatrixWorld(),qT(T().camera)}if(E.current){const U=k(F.cameraPosition2D??[0,0,1e3]).setZ(1e3),O=k(F.panCenter2D??[0,0,0]);E.current.position.copy(U),E.current.rotation.set(0,0,0),E.current.lookAt(O),E.current.zoom=F.cameraZoom,e&&(M.current.object=E.current,M.current.target.copy(O))}}},[r]),m.useEffect(()=>{if(!E.current||!D.current||!M.current)return;const F=H.getState().viewState,U=M.current,O=E.current,B=D.current;e?(O.rotation.set(0,0,0),U.object=O,U.target.copy(k(F.panCenter2D??[0,0,0])),A({camera:O})):(U.object=B,U.target.copy(k(F.panCenter??[0,0,0])),A({camera:B}),qT(T().camera))},[e]),m.useEffect(()=>{e&&M.current&&(E.current&&(E.current.zoom=l,M.current.object=E.current),W(),M.current.update())},[l]);const W=()=>{v(),H.getState().viewState.orthographic||(qT(T().camera),M.current&&M.current.target.clamp(b,C))},j=()=>{ht.getState().set(F=>{F.duringCameraInteraction=!0})},L=()=>{ht.getState().set(F=>{F.duringCameraInteraction=!1}),t(F=>{if(!M.current)return;const U=F.viewState,O=T().camera,B=O.position,_=M.current.target;U.orthographic?(O.zoom&&!isNaN(O.zoom)?U.cameraZoom=O.zoom:U.cameraZoom=20,U.cameraPosition2D=[B.x,B.y,150],U.panCenter2D=[_.x,_.y,_.z]):g?(U.cameraPositionNav=[B.x,B.y,B.z],U.cameraRotationNav=[O.rotation.x,O.rotation.y,O.rotation.z],F.cameraDirection=Ofe(O)):(U.cameraPosition=[B.x,B.y,B.z],U.panCenter=[_.x,_.y,_.z],F.cameraDirection=Ofe(O))})},k=F=>F&&Array.isArray(F)?new ie(F[0],F[1],F[2]):F&&F.x!==null?new ie(F.x,F.y,F.z):new ie(0,0,5);ay(()=>{o&&M.current&&M.current.update()});const N=Fn(F=>F.compassRef);return m.useEffect(()=>{qT(T().camera)},[N]),m.useEffect(()=>{M.current&&(g&&!p&&!f?M.current.listenToKeyEvents(window):M.current.removeKeyEvents())},[g,p,f]),m.useEffect(()=>{if(!M.current)return;const F=H.getState().viewState;if(g){const U=T().camera,O=F.cameraPositionNav??[5,-30,1],B=F.cameraRotationNav??[1.5374753309166491,.16505866097993566,.005476951734475092];U.position.fromArray(O),U.rotation.fromArray([B[0],B[1],B[2],"XYZ"]),U.updateMatrixWorld(),qT(T().camera)}else if(M.current&&D.current){const U=k(F.cameraPosition??[0,0,20]),O=k(F.panCenter??[0,0,0]);D.current.position.copy(U),D.current.lookAt(O),D.current.zoom=1,e||(M.current.object=D.current,M.current.target.copy(O)),D.current.updateMatrixWorld(),qT(D.current)}v()},[g]),h.jsxs(h.Fragment,{children:[h.jsx(s4t,{ref:D,fov:nje,far:s,up:[0,0,1]}),h.jsx(a4t,{ref:E,up:[0,0,1]}),h.jsx("myOrbitControls",{ref:M,args:[S,R],autoRotate:o,enableRotate:n,enablePan:!0,enableZoom:!0,enableDamping:!1,maxAzimuthAngle:1/0,minAzimuthAngle:-1/0,maxPolarAngle:Gt,minPolarAngle:0,moveSpeed:u??3,turnSpeed:d??3})]})});var _fe={exports:{}},Vfe={exports:{}},Vk=1e3,Gk=Vk*60,Xk=Gk*60,Jk=Xk*24,_3o=Jk*365.25,V3o=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return G3o(t);if(n==="number"&&isNaN(t)===!1)return e.long?J3o(t):X3o(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function G3o(t){if(t=String(t),!(t.length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return n*_3o;case"days":case"day":case"d":return n*Jk;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Xk;case"minutes":case"minute":case"mins":case"min":case"m":return n*Gk;case"seconds":case"second":case"secs":case"sec":case"s":return n*Vk;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function X3o(t){return t>=Jk?Math.round(t/Jk)+"d":t>=Xk?Math.round(t/Xk)+"h":t>=Gk?Math.round(t/Gk)+"m":t>=Vk?Math.round(t/Vk)+"s":t+"ms"}function J3o(t){return XO(t,Jk,"day")||XO(t,Xk,"hour")||XO(t,Gk,"minute")||XO(t,Vk,"second")||t+" ms"}function XO(t,e,n){if(!(t=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}e.formatters.j=function(c){try{return JSON.stringify(c)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}};function r(c){var u=this.useColors;if(c[0]=(u?"%c":"")+this.namespace+(u?" %c":" ")+c[0]+(u?"%c ":" ")+"+"+e.humanize(this.diff),!!u){var d="color: "+this.color;c.splice(1,0,d,"color: inherit");var f=0,p=0;c[0].replace(/%[a-zA-Z%]/g,function(g){g!=="%%"&&(f++,g==="%c"&&(p=f))}),c.splice(p,0,d)}}function i(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(c){try{c==null?e.storage.removeItem("debug"):e.storage.debug=c}catch{}}function l(){var c;try{c=e.storage.debug}catch{}return!c&&typeof process<"u"&&"env"in process&&(c=n.DEBUG),c}e.enable(l());function s(){try{return window.localStorage}catch{}}})(_fe,_fe.exports);var q3o=_fe.exports,sze=q3o("jsonp"),$3o=e6o,Q3o=0;function Z3o(){}function e6o(t,e,n){typeof e=="function"&&(n=e,e={}),e||(e={});var o=e.prefix||"__jp",r=e.name||o+Q3o++,i=e.param||"callback",a=e.timeout!=null?e.timeout:6e4,l=encodeURIComponent,s=document.getElementsByTagName("script")[0]||document.head,c,u;a&&(u=setTimeout(function(){d(),n&&n(new Error("Timeout"))},a));function d(){c.parentNode&&c.parentNode.removeChild(c),window[r]=Z3o,u&&clearTimeout(u)}function f(){window[r]&&d()}return window[r]=function(p){sze("jsonp got",p),d(),n&&n(null,p)},t+=(~t.indexOf("?")?"&":"?")+i+"="+l(r),t=t.replace("?&","?"),sze('jsonp req "%s"',t),c=document.createElement("script"),c.src=t,s.parentNode.insertBefore(c,s),f}const sS=Fi($3o);var t6o=Object.defineProperty,n6o=Object.defineProperties,o6o=Object.getOwnPropertyDescriptors,IJ=Object.getOwnPropertySymbols,Hat=Object.prototype.hasOwnProperty,Mat=Object.prototype.propertyIsEnumerable,cze=(t,e,n)=>e in t?t6o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,cg=(t,e)=>{for(var n in e||(e={}))Hat.call(e,n)&&cze(t,n,e[n]);if(IJ)for(var n of IJ(e))Mat.call(e,n)&&cze(t,n,e[n]);return t},zee=(t,e)=>n6o(t,o6o(e)),Dee=(t,e)=>{var n={};for(var o in t)Hat.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&IJ)for(var o of IJ(t))e.indexOf(o)<0&&Mat.call(t,o)&&(n[o]=t[o]);return n};function qw(t){return n=>{var o=n,{bgStyle:r={},borderRadius:i=0,iconFillColor:a="white",round:l=!1,size:s=64}=o,c=Dee(o,["bgStyle","borderRadius","iconFillColor","round","size"]);return h.jsxs("svg",zee(cg({viewBox:"0 0 64 64",width:s,height:s},c),{children:[l?h.jsx("circle",{cx:"32",cy:"32",r:"32",fill:t.color,style:r}):h.jsx("rect",{width:"64",height:"64",rx:i,ry:i,fill:t.color,style:r}),h.jsx("path",{d:t.path,fill:a})]}))}}const r6o=qw({color:"#7f7f7f",networkName:"email",path:"M17,22v20h30V22H17z M41.1,25L32,32.1L22.9,25H41.1z M20,39V26.6l12,9.3l12-9.3V39H20z"}),i6o=r6o;function Qs(t){const e=Object.entries(t).filter(([,n])=>n!=null).map(([n,o])=>`${encodeURIComponent(n)}=${encodeURIComponent(String(o))}`);return e.length>0?`?${e.join("&")}`:""}const a6o=t=>!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function",l6o=(t,e)=>({left:window.outerWidth/2+(window.screenX||window.screenLeft||0)-t/2,top:window.outerHeight/2+(window.screenY||window.screenTop||0)-e/2}),s6o=(t,e)=>({top:(window.screen.height-e)/2,left:(window.screen.width-t)/2});function c6o(t,e,n){var o=e,{height:r,width:i}=o,a=Dee(o,["height","width"]);const l=cg({height:r,width:i,location:"no",toolbar:"no",status:"no",directories:"no",menubar:"no",scrollbars:"yes",resizable:"no",centerscreen:"yes",chrome:"yes"},a),s=window.open(t,"",Object.keys(l).map(c=>`${c}=${l[c]}`).join(", "));if(n){const c=window.setInterval(()=>{try{(s===null||s.closed)&&(window.clearInterval(c),n(s))}catch(u){console.error(u)}},1e3)}return s}function u6o(t){var e=t,{beforeOnClick:n,children:o,className:r,disabled:i,disabledStyle:a={opacity:.6},forwardedRef:l,networkLink:s,networkName:c,onClick:u,onShareWindowClose:d,openShareDialogOnClick:f=!0,opts:p,resetButtonStyle:g=!0,style:y,url:w,windowHeight:b=400,windowPosition:C="windowCenter",windowWidth:P=550}=e,v=Dee(e,["beforeOnClick","children","className","disabled","disabledStyle","forwardedRef","networkLink","networkName","onClick","onShareWindowClose","openShareDialogOnClick","opts","resetButtonStyle","style","url","windowHeight","windowPosition","windowWidth"]);const T=async S=>{const R=s(w,p);if(!i){if(S.preventDefault(),n){const M=n();a6o(M)&&await M}if(f){const M=cg({height:b,width:P},C==="windowCenter"?l6o(P,b):s6o(P,b));c6o(R,M,d)}u&&u(S,R)}},A=Vn("react-share__ShareButton",{"react-share__ShareButton--disabled":!!i,disabled:!!i},r),x=cg(cg(g?{backgroundColor:"transparent",border:"none",padding:0,font:"inherit",color:"inherit",cursor:"pointer"}:{},y),i&&a);return h.jsx("button",zee(cg({},v),{className:A,onClick:T,ref:l,style:x,children:o}))}function w0(t,e,n,o){function r(i,a){const l=n(i),s=cg({},i);return Object.keys(l).forEach(u=>{delete s[u]}),h.jsx(u6o,zee(cg(cg({},o),s),{forwardedRef:a,networkName:t,networkLink:e,opts:n(i)}))}return r.displayName=`ShareButton-${t}`,m.forwardRef(r)}function d6o(t,{subject:e,body:n,separator:o}){return"mailto:"+Qs({subject:e,body:n?n+o+t:t})}const f6o=w0("email",d6o,t=>({subject:t.subject,body:t.body,separator:t.separator||" "}),{openShareDialogOnClick:!1,onClick:(t,e)=>{window.location.href=e}}),h6o=f6o,p6o=qw({color:"#0965FE",networkName:"facebook",path:"M34.1,47V33.3h4.6l0.7-5.3h-5.3v-3.4c0-1.5,0.4-2.6,2.6-2.6l2.8,0v-4.8c-0.5-0.1-2.2-0.2-4.1-0.2 c-4.1,0-6.9,2.5-6.9,7V28H24v5.3h4.6V47H34.1z"}),g6o=p6o;function m6o(t,{appId:e,redirectUri:n,to:o}){return"https://www.facebook.com/dialog/send"+Qs({link:t,redirect_uri:n||t,app_id:e,to:o})}w0("facebookmessenger",m6o,t=>({appId:t.appId,redirectUri:t.redirectUri,to:t.to}),{windowWidth:1e3,windowHeight:820});class y6o extends Error{constructor(e){super(e),this.name="AssertionError"}}function i0(t,e){if(!t)throw new y6o(e)}function A6o(t,{hashtag:e}){return i0(t,"facebook.url"),"https://www.facebook.com/sharer/sharer.php"+Qs({u:t,hashtag:e})}const w6o=w0("facebook",A6o,t=>({hashtag:t.hashtag}),{windowWidth:550,windowHeight:400}),v6o=w6o;function x6o(){const t=m.useRef(!1);return m.useEffect(()=>(t.current=!0,()=>{t.current=!1}),[]),m.useCallback(()=>t.current,[])}function b6o(t){var e=t,{children:n=f=>f,className:o,getCount:r,url:i}=e,a=Dee(e,["children","className","getCount","url"]);const l=x6o(),[s,c]=m.useState(void 0),[u,d]=m.useState(!1);return m.useEffect(()=>{d(!0),r(i,f=>{l()&&(c(f),d(!1))})},[i]),h.jsx("span",zee(cg({className:Vn("react-share__ShareCount",o)},a),{children:!u&&s!==void 0&&n(s)}))}function cS(t){const e=n=>h.jsx(b6o,cg({getCount:t},n));return e.displayName=`ShareCount(${t.name})`,e}function S6o(t,e){const n=`https://graph.facebook.com/?id=${t}&fields=og_object{engagement}`;sS(n,(o,r)=>{e(!o&&r&&r.og_object&&r.og_object.engagement?r.og_object.engagement.count:void 0)})}cS(S6o);function T6o(t,{title:e}){return i0(t,"hatena.url"),`http://b.hatena.ne.jp/add?mode=confirm&url=${t}&title=${e}`}w0("hatena",T6o,t=>({title:t.title}),{windowWidth:660,windowHeight:460,windowPosition:"windowCenter"});function P6o(t,e){sS("https://bookmark.hatenaapis.com/count/entry"+Qs({url:t}),(o,r)=>{e(r??void 0)})}cS(P6o);function C6o(t,{title:e,description:n}){return i0(t,"instapaper.url"),"http://www.instapaper.com/hello2"+Qs({url:t,title:e,description:n})}w0("instapaper",C6o,t=>({title:t.title,description:t.description}),{windowWidth:500,windowHeight:500,windowPosition:"windowCenter"});const R6o=qw({color:"#00b800",networkName:"line",path:"M52.62 30.138c0 3.693-1.432 7.019-4.42 10.296h.001c-4.326 4.979-14 11.044-16.201 11.972-2.2.927-1.876-.591-1.786-1.112l.294-1.765c.069-.527.142-1.343-.066-1.865-.232-.574-1.146-.872-1.817-1.016-9.909-1.31-17.245-8.238-17.245-16.51 0-9.226 9.251-16.733 20.62-16.733 11.37 0 20.62 7.507 20.62 16.733zM27.81 25.68h-1.446a.402.402 0 0 0-.402.401v8.985c0 .221.18.4.402.4h1.446a.401.401 0 0 0 .402-.4v-8.985a.402.402 0 0 0-.402-.401zm9.956 0H36.32a.402.402 0 0 0-.402.401v5.338L31.8 25.858a.39.39 0 0 0-.031-.04l-.002-.003-.024-.025-.008-.007a.313.313 0 0 0-.032-.026.255.255 0 0 1-.021-.014l-.012-.007-.021-.012-.013-.006-.023-.01-.013-.005-.024-.008-.014-.003-.023-.005-.017-.002-.021-.003-.021-.002h-1.46a.402.402 0 0 0-.402.401v8.985c0 .221.18.4.402.4h1.446a.401.401 0 0 0 .402-.4v-5.337l4.123 5.568c.028.04.063.072.101.099l.004.003a.236.236 0 0 0 .025.015l.012.006.019.01a.154.154 0 0 1 .019.008l.012.004.028.01.005.001a.442.442 0 0 0 .104.013h1.446a.4.4 0 0 0 .401-.4v-8.985a.402.402 0 0 0-.401-.401zm-13.442 7.537h-3.93v-7.136a.401.401 0 0 0-.401-.401h-1.447a.4.4 0 0 0-.401.401v8.984a.392.392 0 0 0 .123.29c.072.068.17.111.278.111h5.778a.4.4 0 0 0 .401-.401v-1.447a.401.401 0 0 0-.401-.401zm21.429-5.287c.222 0 .401-.18.401-.402v-1.446a.401.401 0 0 0-.401-.402h-5.778a.398.398 0 0 0-.279.113l-.005.004-.006.008a.397.397 0 0 0-.111.276v8.984c0 .108.043.206.112.278l.005.006a.401.401 0 0 0 .284.117h5.778a.4.4 0 0 0 .401-.401v-1.447a.401.401 0 0 0-.401-.401h-3.93v-1.519h3.93c.222 0 .401-.18.401-.402V29.85a.401.401 0 0 0-.401-.402h-3.93V27.93h3.93z"}),H6o=R6o;function M6o(t,{title:e}){return i0(t,"line.url"),"https://social-plugins.line.me/lineit/share"+Qs({url:t,text:e})}const I6o=w0("line",M6o,t=>({title:t.title}),{windowWidth:500,windowHeight:500}),z6o=I6o,D6o=qw({color:"#0077B5",networkName:"linkedin",path:"M20.4,44h5.4V26.6h-5.4V44z M23.1,18c-1.7,0-3.1,1.4-3.1,3.1c0,1.7,1.4,3.1,3.1,3.1 c1.7,0,3.1-1.4,3.1-3.1C26.2,19.4,24.8,18,23.1,18z M39.5,26.2c-2.6,0-4.4,1.4-5.1,2.8h-0.1v-2.4h-5.2V44h5.4v-8.6 c0-2.3,0.4-4.5,3.2-4.5c2.8,0,2.8,2.6,2.8,4.6V44H46v-9.5C46,29.8,45,26.2,39.5,26.2z"}),E6o=D6o;function F6o(t,{title:e,summary:n,source:o}){return i0(t,"linkedin.url"),"https://linkedin.com/shareArticle"+Qs({url:t,mini:"true",title:e,summary:n,source:o})}const k6o=w0("linkedin",F6o,({title:t,summary:e,source:n})=>({title:t,summary:e,source:n}),{windowWidth:750,windowHeight:600}),L6o=k6o;function W6o(t,{title:e,description:n}){return i0(t,"livejournal.url"),"https://www.livejournal.com/update.bml"+Qs({subject:e,event:n})}w0("livejournal",W6o,t=>({title:t.title,description:t.description}),{windowWidth:660,windowHeight:460});function N6o(t,{title:e,description:n,imageUrl:o}){return i0(t,"mailru.url"),"https://connect.mail.ru/share"+Qs({url:t,title:e,description:n,image_url:o})}w0("mailru",N6o,t=>({title:t.title,description:t.description,imageUrl:t.imageUrl}),{windowWidth:660,windowHeight:460});function U6o(t,{title:e,description:n,image:o}){return i0(t,"ok.url"),"https://connect.ok.ru/offer"+Qs({url:t,title:e,description:n,imageUrl:o})}w0("ok",U6o,t=>({title:t.title,description:t.description,image:t.image}),{windowWidth:588,windowHeight:480,windowPosition:"screenCenter"});function j6o(t,e){window.OK||(window.OK={Share:{count:function(i,a){var l,s;(s=(l=window.OK.callbacks)[i])==null||s.call(l,a)}},callbacks:[]});const n="https://connect.ok.ru/dk",o=window.OK.callbacks.length;return window.ODKL={updateCount(r,i){var a,l;const s=r===""?0:parseInt(r.replace("react-share-",""),10);(l=(a=window.OK.callbacks)[s])==null||l.call(a,i===""?void 0:parseInt(i,10))}},window.OK.callbacks.push(e),sS(n+Qs({"st.cmd":"extLike",uid:`react-share-${o}`,ref:t}))}cS(j6o);function B6o(t,{media:e,description:n,pinId:o}){return o?`https://pinterest.com/pin/${o}/repin/x/`:(i0(t,"pinterest.url"),i0(e,"pinterest.media"),"https://pinterest.com/pin/create/button/"+Qs({url:t,media:e,description:n}))}w0("pinterest",B6o,t=>({media:t.media,description:t.description,pinId:t.pinId}),{windowWidth:1e3,windowHeight:730});function Y6o(t,e){sS("https://api.pinterest.com/v1/urls/count.json"+Qs({url:t}),(o,r)=>{e(r?r.count:void 0)})}cS(Y6o);function O6o(t,{title:e}){return i0(t,"pocket.url"),"https://getpocket.com/save"+Qs({url:t,title:e})}w0("pocket",O6o,t=>({title:t.title}),{windowWidth:500,windowHeight:500});const _6o=qw({color:"#FF5700",networkName:"reddit",path:"M 53.34375 32 C 53.277344 30.160156 52.136719 28.53125 50.429688 27.839844 C 48.722656 27.148438 46.769531 27.523438 45.441406 28.800781 C 41.800781 26.324219 37.519531 24.957031 33.121094 24.863281 L 35.199219 14.878906 L 42.046875 16.320312 C 42.214844 17.882812 43.496094 19.09375 45.066406 19.171875 C 46.636719 19.253906 48.03125 18.183594 48.359375 16.644531 C 48.6875 15.105469 47.847656 13.558594 46.382812 12.992188 C 44.914062 12.425781 43.253906 13.007812 42.464844 14.367188 L 34.625 12.800781 C 34.363281 12.742188 34.09375 12.792969 33.871094 12.9375 C 33.648438 13.082031 33.492188 13.308594 33.441406 13.566406 L 31.070312 24.671875 C 26.617188 24.738281 22.277344 26.105469 18.59375 28.609375 C 17.242188 27.339844 15.273438 26.988281 13.570312 27.707031 C 11.863281 28.429688 10.746094 30.089844 10.71875 31.941406 C 10.691406 33.789062 11.757812 35.484375 13.441406 36.257812 C 13.402344 36.726562 13.402344 37.195312 13.441406 37.664062 C 13.441406 44.832031 21.792969 50.65625 32.097656 50.65625 C 42.398438 50.65625 50.753906 44.832031 50.753906 37.664062 C 50.789062 37.195312 50.789062 36.726562 50.753906 36.257812 C 52.363281 35.453125 53.371094 33.800781 53.34375 32 Z M 21.34375 35.199219 C 21.34375 33.433594 22.777344 32 24.542969 32 C 26.3125 32 27.742188 33.433594 27.742188 35.199219 C 27.742188 36.96875 26.3125 38.398438 24.542969 38.398438 C 22.777344 38.398438 21.34375 36.96875 21.34375 35.199219 Z M 39.9375 44 C 37.664062 45.710938 34.871094 46.582031 32.03125 46.464844 C 29.191406 46.582031 26.398438 45.710938 24.128906 44 C 23.847656 43.65625 23.871094 43.15625 24.183594 42.839844 C 24.5 42.527344 25 42.503906 25.34375 42.785156 C 27.269531 44.195312 29.617188 44.90625 32 44.800781 C 34.386719 44.929688 36.746094 44.242188 38.6875 42.847656 C 39.042969 42.503906 39.605469 42.511719 39.953125 42.863281 C 40.296875 43.21875 40.289062 43.785156 39.9375 44.128906 Z M 39.359375 38.527344 C 37.59375 38.527344 36.160156 37.09375 36.160156 35.328125 C 36.160156 33.5625 37.59375 32.128906 39.359375 32.128906 C 41.128906 32.128906 42.558594 33.5625 42.558594 35.328125 C 42.59375 36.203125 42.269531 37.054688 41.65625 37.6875 C 41.046875 38.316406 40.203125 38.664062 39.328125 38.65625 Z M 39.359375 38.527344"}),V6o=_6o;function G6o(t,{title:e}){return i0(t,"reddit.url"),"https://www.reddit.com/submit"+Qs({url:t,title:e})}const X6o=w0("reddit",G6o,t=>({title:t.title}),{windowWidth:660,windowHeight:460,windowPosition:"windowCenter"}),J6o=X6o;function K6o(t,{title:e}){return i0(t,"gab.url"),"https://gab.com/compose"+Qs({url:t,text:e})}w0("gab",K6o,t=>({title:t.title}),{windowWidth:660,windowHeight:640,windowPosition:"windowCenter"});function q6o(t,e){const n=`https://www.reddit.com/api/info.json?limit=1&url=${t}`;sS(n,{param:"jsonp"},(o,r)=>{e(!o&&r&&r.data&&r.data.children.length>0&&r.data.children[0].data.score?r.data.children[0].data.score:void 0)})}cS(q6o);const $6o=qw({color:"#25A3E3",networkName:"telegram",path:"m45.90873,15.44335c-0.6901,-0.0281 -1.37668,0.14048 -1.96142,0.41265c-0.84989,0.32661 -8.63939,3.33986 -16.5237,6.39174c-3.9685,1.53296 -7.93349,3.06593 -10.98537,4.24067c-3.05012,1.1765 -5.34694,2.05098 -5.4681,2.09312c-0.80775,0.28096 -1.89996,0.63566 -2.82712,1.72788c-0.23354,0.27218 -0.46884,0.62161 -0.58825,1.10275c-0.11941,0.48114 -0.06673,1.09222 0.16682,1.5716c0.46533,0.96052 1.25376,1.35737 2.18443,1.71383c3.09051,0.99037 6.28638,1.93508 8.93263,2.8236c0.97632,3.44171 1.91401,6.89571 2.84116,10.34268c0.30554,0.69185 0.97105,0.94823 1.65764,0.95525l-0.00351,0.03512c0,0 0.53908,0.05268 1.06412,-0.07375c0.52679,-0.12292 1.18879,-0.42846 1.79109,-0.99212c0.662,-0.62161 2.45836,-2.38812 3.47683,-3.38552l7.6736,5.66477l0.06146,0.03512c0,0 0.84989,0.59703 2.09312,0.68132c0.62161,0.04214 1.4399,-0.07726 2.14229,-0.59176c0.70766,-0.51626 1.1765,-1.34683 1.396,-2.29506c0.65673,-2.86224 5.00979,-23.57745 5.75257,-27.00686l-0.02107,0.08077c0.51977,-1.93157 0.32837,-3.70159 -0.87096,-4.74991c-0.60054,-0.52152 -1.2924,-0.7498 -1.98425,-0.77965l0,0.00176zm-0.2072,3.29069c0.04741,0.0439 0.0439,0.0439 0.00351,0.04741c-0.01229,-0.00351 0.14048,0.2072 -0.15804,1.32576l-0.01229,0.04214l-0.00878,0.03863c-0.75858,3.50668 -5.15554,24.40802 -5.74203,26.96472c-0.08077,0.34417 -0.11414,0.31959 -0.09482,0.29852c-0.1756,-0.02634 -0.50045,-0.16506 -0.52679,-0.1756l-13.13468,-9.70175c4.4988,-4.33199 9.09945,-8.25307 13.744,-12.43229c0.8218,-0.41265 0.68483,-1.68573 -0.29852,-1.70681c-1.04305,0.24584 -1.92279,0.99564 -2.8798,1.47502c-5.49971,3.2626 -11.11882,6.13186 -16.55882,9.49279c-2.792,-0.97105 -5.57873,-1.77704 -8.15298,-2.57601c2.2336,-0.89555 4.00889,-1.55579 5.75608,-2.23009c3.05188,-1.1765 7.01687,-2.7042 10.98537,-4.24067c7.94051,-3.06944 15.92667,-6.16346 16.62028,-6.43037l0.05619,-0.02283l0.05268,-0.02283c0.19316,-0.0878 0.30378,-0.09658 0.35471,-0.10009c0,0 -0.01756,-0.05795 -0.00351,-0.04566l-0.00176,0zm-20.91715,22.0638l2.16687,1.60145c-0.93418,0.91311 -1.81743,1.77353 -2.45485,2.38812l0.28798,-3.98957"}),Q6o=$6o;function Z6o(t,{title:e}){return i0(t,"telegram.url"),"https://telegram.me/share/url"+Qs({url:t,text:e})}const eAo=w0("telegram",Z6o,t=>({title:t.title}),{windowWidth:550,windowHeight:400}),tAo=eAo;function nAo(t,{title:e,caption:n,tags:o,posttype:r}){return i0(t,"tumblr.url"),"https://www.tumblr.com/widgets/share/tool"+Qs({canonicalUrl:t,title:e,caption:n,tags:o,posttype:r})}w0("tumblr",nAo,t=>({title:t.title,tags:(t.tags||[]).join(","),caption:t.caption,posttype:t.posttype||"link"}),{windowWidth:660,windowHeight:460});function oAo(t,e){return sS("https://api.tumblr.com/v2/share/stats"+Qs({url:t}),(o,r)=>{e(!o&&r&&r.response?r.response.note_count:void 0)})}cS(oAo);function rAo(t,{title:e,via:n,hashtags:o=[],related:r=[]}){return i0(t,"twitter.url"),i0(Array.isArray(o),"twitter.hashtags is not an array"),i0(Array.isArray(r),"twitter.related is not an array"),"https://twitter.com/intent/tweet"+Qs({url:t,text:e,via:n,hashtags:o.length>0?o.join(","):void 0,related:r.length>0?r.join(","):void 0})}const iAo=w0("twitter",rAo,t=>({hashtags:t.hashtags,title:t.title,via:t.via,related:t.related}),{windowWidth:550,windowHeight:400}),aAo=iAo;function lAo(t,{title:e,separator:n}){return i0(t,"viber.url"),"viber://forward"+Qs({text:e?e+n+t:t})}w0("viber",lAo,t=>({title:t.title,separator:t.separator||" "}),{windowWidth:660,windowHeight:460});function sAo(t,{title:e,image:n,noParse:o,noVkLinks:r}){return i0(t,"vk.url"),"https://vk.com/share.php"+Qs({url:t,title:e,image:n,noparse:o?1:0,no_vk_links:r?1:0})}w0("vk",sAo,t=>({title:t.title,image:t.image,noParse:t.noParse,noVkLinks:t.noVkLinks}),{windowWidth:660,windowHeight:460});function cAo(t,e){window.VK||(window.VK={}),window.VK.Share={count:(r,i)=>{var a,l;return(l=(a=window.VK.callbacks)==null?void 0:a[r])==null?void 0:l.call(a,i)}},window.VK.callbacks=[];const n="https://vk.com/share.php",o=window.VK.callbacks.length;return window.VK.callbacks.push(e),sS(n+Qs({act:"count",index:o,url:t}))}cS(cAo);function uAo(t,{title:e,image:n}){return i0(t,"weibo.url"),"http://service.weibo.com/share/share.php"+Qs({url:t,title:e,pic:n})}w0("weibo",uAo,t=>({title:t.title,image:t.image}),{windowWidth:660,windowHeight:550,windowPosition:"screenCenter"});const dAo=qw({color:"#25D366",networkName:"whatsapp",path:"m42.32286,33.93287c-0.5178,-0.2589 -3.04726,-1.49644 -3.52105,-1.66732c-0.4712,-0.17346 -0.81554,-0.2589 -1.15987,0.2589c-0.34175,0.51004 -1.33075,1.66474 -1.63108,2.00648c-0.30032,0.33658 -0.60064,0.36247 -1.11327,0.12945c-0.5178,-0.2589 -2.17994,-0.80259 -4.14759,-2.56312c-1.53269,-1.37217 -2.56312,-3.05503 -2.86603,-3.57283c-0.30033,-0.5178 -0.03366,-0.80259 0.22524,-1.06149c0.23301,-0.23301 0.5178,-0.59547 0.7767,-0.90616c0.25372,-0.31068 0.33657,-0.5178 0.51262,-0.85437c0.17088,-0.36246 0.08544,-0.64725 -0.04402,-0.90615c-0.12945,-0.2589 -1.15987,-2.79613 -1.58964,-3.80584c-0.41424,-1.00971 -0.84142,-0.88027 -1.15987,-0.88027c-0.29773,-0.02588 -0.64208,-0.02588 -0.98382,-0.02588c-0.34693,0 -0.90616,0.12945 -1.37736,0.62136c-0.4712,0.5178 -1.80194,1.76053 -1.80194,4.27186c0,2.51134 1.84596,4.945 2.10227,5.30747c0.2589,0.33657 3.63497,5.51458 8.80262,7.74113c1.23237,0.5178 2.1903,0.82848 2.94111,1.08738c1.23237,0.38836 2.35599,0.33657 3.24402,0.20712c0.99159,-0.15534 3.04985,-1.24272 3.47963,-2.45956c0.44013,-1.21683 0.44013,-2.22654 0.31068,-2.45955c-0.12945,-0.23301 -0.46601,-0.36247 -0.98382,-0.59548m-9.40068,12.84407l-0.02589,0c-3.05503,0 -6.08417,-0.82849 -8.72495,-2.38189l-0.62136,-0.37023l-6.47252,1.68286l1.73463,-6.29129l-0.41424,-0.64725c-1.70875,-2.71846 -2.6149,-5.85116 -2.6149,-9.07706c0,-9.39809 7.68934,-17.06155 17.15993,-17.06155c4.58253,0 8.88029,1.78642 12.11655,5.02268c3.23625,3.21036 5.02267,7.50812 5.02267,12.06476c-0.0078,9.3981 -7.69712,17.06155 -17.14699,17.06155m14.58906,-31.58846c-3.93529,-3.80584 -9.1133,-5.95471 -14.62789,-5.95471c-11.36055,0 -20.60848,9.2065 -20.61625,20.52564c0,3.61684 0.94757,7.14565 2.75211,10.26282l-2.92557,10.63564l10.93337,-2.85309c3.0136,1.63108 6.4052,2.4958 9.85634,2.49839l0.01037,0c11.36574,0 20.61884,-9.2091 20.62403,-20.53082c0,-5.48093 -2.14111,-10.64081 -6.03239,-14.51915"}),fAo=dAo;function hAo(){return/(android|iphone|ipad|mobile)/i.test(navigator.userAgent)}function pAo(t,{title:e,separator:n}){return i0(t,"whatsapp.url"),"https://"+(hAo()?"api":"web")+".whatsapp.com/send"+Qs({text:e?e+n+t:t})}const gAo=w0("whatsapp",pAo,t=>({title:t.title,separator:t.separator||" "}),{windowWidth:550,windowHeight:400}),mAo=gAo;function yAo(t,{quote:e,hashtag:n}){return i0(t,"workplace.url"),"https://work.facebook.com/sharer.php"+Qs({u:t,quote:e,hashtag:n})}w0("workplace",yAo,t=>({quote:t.quote,hashtag:t.hashtag}),{windowWidth:550,windowHeight:400});const AAo=qw({color:"#000000",networkName:"X",path:"M 41.116 18.375 h 4.962 l -10.8405 12.39 l 12.753 16.86 H 38.005 l -7.821 -10.2255 L 21.235 47.625 H 16.27 l 11.595 -13.2525 L 15.631 18.375 H 25.87 l 7.0695 9.3465 z m -1.7415 26.28 h 2.7495 L 24.376 21.189 H 21.4255 z"}),wAo=AAo,vAo=Ro.div` display: flex; flex-direction: column; z-index: 999; -`,xAo=be.memo(({style:t,size:e,margin:n,round:o,handleShareWindowClose:r})=>{const i=H(mp),a=H(Pb),s=new URLSearchParams(window.location.search).get("userid"),c=Jt(),u=a??Y.t("name.Tagline",c),d="aladdinIFI "+(a?Y.t("name.Tagline",c):"");let f=t1;return a&&(s?f+="?client=web&userid="+s+"&title="+encodeURIComponent(a):i.uid&&(f+="?client=web&userid="+i.uid+"&title="+encodeURIComponent(a))),h.jsxs(vAo,{style:t,children:[h.jsx(h6o,{url:f,subject:u,children:h.jsx(i6o,{size:e,round:o})}),h.jsx(aAo,{url:f,title:u,via:d,style:{paddingRight:n},onShareWindowClose:r,children:h.jsx(wAo,{size:e,round:o})}),h.jsx(v6o,{url:f,style:{paddingRight:n},onShareWindowClose:r,children:h.jsx(g6o,{size:e,round:o})}),h.jsx(J6o,{url:f,title:u,style:{paddingRight:n},onShareWindowClose:r,children:h.jsx(V6o,{size:e,round:o})}),h.jsx(tAo,{url:f,title:u,style:{paddingRight:n},onShareWindowClose:r,children:h.jsx(Q6o,{size:e,round:o})}),h.jsx(z6o,{url:f,title:u,style:{paddingRight:n},onShareWindowClose:r,children:h.jsx(H6o,{size:e,round:o})}),h.jsx(L6o,{url:f,title:u,summary:d,source:Y.t("name.IFI",c),style:{paddingRight:n},onShareWindowClose:r,children:h.jsx(E6o,{size:e,round:o})}),h.jsx(mAo,{url:f,title:u,separator:":: ",onShareWindowClose:r,children:h.jsx(fAo,{size:e,round:o})})]})});class fC{constructor(e,n,o){if(this.fitness=Number.NaN,this.chromosome=new Array(e),this.discretizationSteps=o,n)if(o)for(let r=0;re.fitness?1:this.fitness=this.chromosome.length)throw new Error("Gene index out of bound: "+e);this.chromosome[e]=n}getGene(e){if(e<0||e>=this.chromosome.length)throw new Error("Gene index out of bound: "+e);return this.chromosome[e]}copyGenes(e){const n=Math.min(this.chromosome.length,e.chromosome.length);for(let o=0;on.compare(e))}getNicheCount(e,n){let o=0;for(const r of this.individuals){const i=e.distance(r);let a=0;ie&&(e=o.fitness,n=o);return n}evolve(e,n){this.selectSurvivors(e),this.crossover(n)}selectSurvivors(e){this.survivors=[],this.sort();const n=Math.floor(e*this.individuals.length);for(let o=0;o=r){o=l;break}let a=null;do{r=Math.random()*n,i=0;for(const l of this.survivors)if(i+=l.fitness-e,i>=r){l!==o&&(a=l);break}}while(a===null);return o&&a?new cze(o,a):null}selectParentsByTournament(){const e=this.survivors.length;if(e<=1)throw new Error("Must have at least two survivors to be used as parents");const n=e-1;let o=Math.floor(Math.random()*n),r;do r=Math.floor(Math.random()*n);while(r===o);const i=this.survivors[o].fitness>this.survivors[r].fitness?o:r;o=Math.floor(Math.random()*n);do r=Math.floor(Math.random()*n);while(r===o);let a=this.survivors[o].fitness>this.survivors[r].fitness?o:r;for(;a===i;){o=Math.floor(Math.random()*n);do r=Math.floor(Math.random()*n);while(r===o);a=this.survivors[o].fitness>this.survivors[r].fitness?o:r}return new cze(this.survivors[i],this.survivors[a])}mutate(e){if(me.isZero(e))return;let n=Math.floor(e*(this.individuals.length-1));for(n===0?n=1:n===this.individuals.length-1&&(n=this.individuals.length-2),this.mutants=[];this.mutants.lengthe)return!1}return!0}}class Iat{constructor(e,n,o,r,i,a,l,s,c,u){this.fitnessSharingRadius=.1,this.searchMethod=us.GLOBAL_SEARCH_UNIFORM_SELECTION,this.localSearchRadius=.1,this.constraints=[],this.stopped=!0,this.mutationRate=.1,this.crossoverRate=.5,this.selectionRate=.5,this.maximumGenerations=5,this.fittestOfGenerations=[],this.populationOfGenerations=[],this.outsideGenerationCounter=0,this.computeCounter=0,this.converged=!1,this.population=new uze(o,i,a,u),this.objectiveFunctionType=n,this.convergenceThreshold=l,this.maximumGenerations=r,this.searchMethod=s,this.localSearchRadius=c,this.geneNames=new Array(i),this.foundation=e;const d=e.cx,f=e.cy,p=e.lx,g=e.ly;this.minima=new Array(i),this.maxima=new Array(i);for(let y=0;y=this.maximumGenerations}}class Kk{static gaussian(){let e=0,n=0;for(;e===0;)e=Math.random();for(;n===0;)n=Math.random();return Math.sqrt(-2*Math.log(e))*Math.cos(2*Math.PI*n)}static twoGaussians(){let e=0,n=0;for(;e===0;)e=Math.random();for(;n===0;)n=Math.random();const o=new Array(2),r=Math.sqrt(-2*Math.log(e)),i=2*Math.PI*n;return o[0]=r*Math.cos(i),o[1]=r*Math.sin(i),o}static poisson(e){let n=0,o=Math.exp(-e),r=o;const i=Math.random();for(;i>r;)n++,o*=e/n,r+=o;return n}}class qk extends Iat{constructor(e,n,o,r,i,a,l,s,c){super(n,o,r,i,e.length,a,l,s,c),this.solarPanels=e;const u=this.population.individuals[0];for(const[d,f]of e.entries()){const p=.5*(1+f.tiltAngle/Gt);if(u.setGene(d,p),this.searchMethod===us.LOCAL_SEARCH_RANDOM_OPTIMIZATION)for(let g=1;g1;)w=Kk.gaussian()*this.localSearchRadius+p;y.setGene(d,w)}this.geneNames[d]="Tilt Angle ("+f.id+")"}}applyFittest(){const e=this.population.getFittest();if(e){for(let n=0;n{const t=H(fn),e=H(ma),n=H(IH)??6,o=H(DH),r=ht(n5),i=ht(Oq),a=H(s3),l=H(l3),s=H(o$),c=ht(_q),u=H(TW),d=H(r$),f=H(wA).geneticAlgorithmParams,p=Jt(),g=m.useRef(0),y=m.useRef(!1),w=m.useRef(!1),b=m.useRef(),C=m.useRef(),P=m.useRef(0),v=m.useRef(!1),T=m.useRef([]);m.useEffect(()=>{if(f.problem===Pi.SOLAR_PANEL_TILT_ANGLE&&o===Vs.GENETIC_ALGORITHM&&r){A(),g.current=requestAnimationFrame(S);const D=[...T.current];return()=>{cancelAnimationFrame(g.current),y.current||(hn(Y.t("message.EvolutionAborted",p)),ht.getState().set(E=>{E.evolutionInProgress=!1}),D.length>0&&(b.current=D,R(!0)))}}},[r]),m.useEffect(()=>{w.current=i,i?(cancelAnimationFrame(g.current),ht.getState().set(D=>{D.evolutionPaused=!0}),hn(Y.t("message.EvolutionPaused",p))):(ht.getState().set(D=>{D.evolutionPaused=!1}),S())},[i]);const A=()=>{if(!a)return;ht.getState().set(W=>{W.evolutionInProgress=!0,W.objectiveEvaluationIndex=0}),y.current=!1;const D=l(z.SolarPanel,a.id);T.current.length=0;for(const W of D)T.current.push(JSON.parse(JSON.stringify(W)));b.current=[];const E=[];for(const W of D)b.current.push(JSON.parse(JSON.stringify(W))),E.push(W.label);b.current.length>0?(C.current=new qk(b.current,a,f.objectiveFunctionType,f.populationSize,f.maximumGenerations,f.selectionMethod,f.convergenceThreshold,f.searchMethod,f.localSearchRadius),C.current.selectionRate=f.selectionRate,C.current.crossoverRate=f.crossoverRate,C.current.mutationRate=f.mutationRate,P.current=0,v.current=!1,d(E),C.current.startEvolving(),t(W=>{W.viewState.showEvolutionPanel=!0,W.selectedFloatingWindow="solarPanelOptimizationResult"})):po(Y.t("message.EncounterEvolutionError",p))},x=()=>{let D=0;switch(f.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:{const E=Tn.getState().dailyPvYield;for(const W of E)for(const j in W)Object.hasOwn(W,j)&&j==="Total"&&(D+=W[j]);break}case To.YEARLY_TOTAL_OUTPUT:{const E=Tn.getState().yearlyPvYield;for(const W of E)for(const j in W)Object.hasOwn(W,j)&&j==="Total"&&(D+=W[j]);D*=12/n;break}}return D};m.useEffect(()=>{!C.current||!c||(v.current=C.current.evolveIndividual(P.current%f.populationSize,x()),M(),P.current++,C.current.outsideGenerationCounter=Math.floor(P.current/f.populationSize),g.current=requestAnimationFrame(S))},[c]);const S=()=>{if(C.current&&o===Vs.GENETIC_ALGORITHM&&r&&!w.current){if(v.current||C.current.outsideGenerationCounter>=f.maximumGenerations){if(cancelAnimationFrame(g.current),y.current=!0,C.current.applyFittest(),M(),R(!0),hn(Y.t("message.EvolutionCompleted",p)+` -`+(v.current?Y.t("message.ConvergenceThresholdHasBeenReached",p):Y.t("message.MaximumNumberOfGenerationsHasBeenReached",p))),e&&C.current){const D=C.current.population.getFittest();D&&t(E=>{var W;E.actionInfo={name:"Genetic Algorithm for Solar Panel Tilt Angle Completed",result:qk.individualToString(D),steps:(W=C.current)==null?void 0:W.outsideGenerationCounter,timestamp:new Date().getTime()}})}return}C.current.translateIndividual(P.current%f.populationSize),R(!1)}},R=D=>{ht.getState().set(E=>{if(b.current)switch(f.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:D?E.runDailySimulationForSolarPanelsLastStep=!0:E.runDailySimulationForSolarPanels=!0;break;case To.YEARLY_TOTAL_OUTPUT:D?E.runYearlySimulationForSolarPanelsLastStep=!0:E.runYearlySimulationForSolarPanels=!0;break;default:po(Y.t("message.ObjectiveFunctionTypeError",p),60)}}),t(E=>{if(b.current){switch(f.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:E.graphState&&(E.graphState.dailyPvIndividualOutputs=!1);break;case To.YEARLY_TOTAL_OUTPUT:E.graphState&&(E.graphState.yearlyPvIndividualOutputs=!1);break;default:po(Y.t("message.ObjectiveFunctionTypeError",p),60)}for(const W of E.elements)if(W.type===z.SolarPanel){const j=W;for(const L of b.current)if(j.id===L.id){j.tiltAngle=L.tiltAngle;break}}}}),D&&ht.getState().set(E=>{E.runEvolution=!1,E.evolutionInProgress=!1,E.objectiveEvaluationIndex=0})},M=()=>{var E;if(!C.current)return;const D=[];for(let W=0;W0){const N=C.current.populationOfGenerations[W-1];if(N){let F=0;for(let U=0;U0&&D.push(j)}s(D)};return h.jsx(h.Fragment,{})});class SAo extends Iat{constructor(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y,w,b,C,P,v,T,A,x){if(super(c,u,d,f,3,p,g,y,w),this.orientation=vr.landscape,this.rowAxis=Dl.leftRight,this.poleHeight=2,this.poleSpacing=5,this.solarPanelCount=0,this.solarRackCount=0,this.minimumInterRowSpacing=2,this.maximumInterRowSpacing=10,this.minimumRowsPerRack=1,this.maximumRowsPerRack=6,this.minimumTiltAngle=-Gt,this.maximumTiltAngle=Gt,this.margin=0,this.polygon=s,this.pvModel=e,this.rowAxis=n,this.orientation=o,this.poleHeight=r,this.poleSpacing=i,this.minimumInterRowSpacing=b,this.maximumInterRowSpacing=C,this.minimumRowsPerRack=P,this.maximumRowsPerRack=v,this.minimumTiltAngle=T,this.maximumTiltAngle=A,this.margin=x,this.setInterRowSpacingBounds(),this.geneNames[0]="Tilt Angle",this.geneNames[1]="Inter-Row Spacing",this.geneNames[2]="Rack Width",a&&a.length>0){const S=a[0];if(a.length>1){const R=this.population.individuals[0],M=this.maximumTiltAngle===this.minimumTiltAngle?0:(S.tiltAngle-this.minimumTiltAngle)/(this.maximumTiltAngle-this.minimumTiltAngle);R.setGene(0,M);const D=a[1],E=l?l.interRowSpacing:this.rowAxis===Dl.upDown?Math.abs(S.cx-D.cx)*this.foundation.lx:Math.abs(S.cy-D.cy)*this.foundation.ly;let W=this.maximumInterRowSpacing===this.minimumInterRowSpacing?0:(E-this.minimumInterRowSpacing)/(this.maximumInterRowSpacing-this.minimumInterRowSpacing);W<0?W=0:W>1&&(W=1),R.setGene(1,W);const j=l?l.rowsPerRack:Math.max(1,Math.round(S.ly/(S.orientation===vr.portrait?e.length:e.width)));let L=this.maximumRowsPerRack===this.minimumRowsPerRack?0:(j-this.minimumRowsPerRack)/(this.maximumRowsPerRack-this.minimumRowsPerRack);L<0?L=0:L>1&&(L=1),R.setGene(2,L)}}}setInterRowSpacingBounds(){this.bounds=me.calculatePolygonBounds(this.polygon.vertices)}applyFittest(){const e=this.population.getFittest();e&&console.log("Fittest: "+this.individualToString(e)+", rack count: "+this.solarRackCount+", panel count: "+this.solarPanelCount)}getObjectiveUnit(){switch(this.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:return"kWh";case To.YEARLY_PROFIT:case To.DAILY_PROFIT:return"dollars"}return null}individualToString(e){let n="F("+me.toDegrees(e.getGene(0)*(this.maximumTiltAngle-this.minimumTiltAngle)+this.minimumTiltAngle).toFixed(3)+"°, ";return n+=(e.getGene(1)*(this.maximumInterRowSpacing-this.minimumInterRowSpacing)+this.minimumInterRowSpacing).toFixed(3)+"m, ",n+=Math.floor(e.getGene(2)*(this.maximumRowsPerRack-this.minimumRowsPerRack)+this.minimumRowsPerRack)+")",n+" = "+e.fitness.toFixed(5)+" "+this.getObjectiveUnit()}startEvolving(){this.outsideGenerationCounter=0,this.computeCounter=0,this.fittestOfGenerations.fill(null),this.setInterRowSpacingBounds()}translateIndividualByIndex(e){return this.translateIndividual(this.population.individuals[e])}translateBest(){const e=this.population.getFittest();return e?this.translateIndividual(e):[]}translateIndividual(e){if(!this.bounds)return[];const n=e.getGene(0)*(this.maximumTiltAngle-this.minimumTiltAngle)+this.minimumTiltAngle,o=e.getGene(1)*(this.maximumInterRowSpacing-this.minimumInterRowSpacing)+this.minimumInterRowSpacing,r=Math.floor(e.getGene(2)*(this.maximumRowsPerRack-this.minimumRowsPerRack)+this.minimumRowsPerRack),i=KR.create(this.polygon,this.foundation,this.pvModel,this.orientation,n,r,o,this.rowAxis,this.poleHeight,this.poleSpacing,this.margin);if(this.solarPanelCount=0,this.solarRackCount=i.length,i.length>0)for(const a of i)this.solarPanelCount+=me.countSolarPanelsOnRack(a,this.pvModel);return i}evolveIndividual(e,n){var r;const o=this.population.individuals.length;if(!this.converged){const i=this.population.individuals[e];i.fitness=n,this.computeCounter===0&&e===0&&(this.fittestOfGenerations[0]=i.getCopy());const a=Math.floor(this.computeCounter/o);console.log("Generation "+(a+1)+", individual "+e+" : "+this.individualToString(i)+", rack count: "+this.solarRackCount+", panel count: "+this.solarPanelCount);const l=(r=this.populationOfGenerations[a])==null?void 0:r.individuals[e];if(l){for(let c=0;c{const t=H(fn),e=H(ma),n=H(IH)??6,o=H(DH),r=ht(n5),i=ht(Oq),a=H(qr),l=H(s3),s=H(l3),c=H(o$),u=ht(_q),d=H(TW),f=H(r$),p=H(t5),g=H(Wge),y=H(wA).geneticAlgorithmParams,w=H.getState().solarPanelArrayLayoutConstraints,b=H.getState().economicsParams,C=H.getState().solarPanelArrayLayoutParams,P=m.useRef(0),v=m.useRef(!1),T=m.useRef(!1),A=m.useRef(),x=m.useRef(0),S=m.useRef(!1),R=m.useRef([]),M=m.useRef([]),D=Jt(),E=l?a(l):void 0;m.useEffect(()=>{if(o===Vs.GENETIC_ALGORITHM&&y.problem===Pi.SOLAR_PANEL_ARRAY&&r){W(),P.current=requestAnimationFrame(L);const F=[...M.current];return()=>{cancelAnimationFrame(P.current),v.current||(hn(Y.t("message.EvolutionAborted",D)),ht.getState().set(U=>{U.evolutionInProgress=!1,U.runDailySimulationForSolarPanels=!1,U.runYearlySimulationForSolarPanels=!1}),setTimeout(()=>{R.current.length>0&&g(l.id,!1),F.length>0&&(R.current=F,k(!0))},100))}}},[r]),m.useEffect(()=>{T.current=i,i?(cancelAnimationFrame(P.current),ht.getState().set(F=>{F.evolutionPaused=!0}),hn(Y.t("message.EvolutionPaused",D))):(ht.getState().set(F=>{F.evolutionPaused=!1}),L())},[i]);const W=()=>{if(!l||!E)return;ht.getState().set(U=>{U.evolutionInProgress=!0,U.objectiveEvaluationIndex=0}),v.current=!1;const F=s(z.SolarPanel,E.id);M.current.length=0;for(const U of F)M.current.push(JSON.parse(JSON.stringify(U)));A.current=new SAo(p(w.pvModelName??"CS6X-355P-FG"),w.rowAxis??Dl.leftRight,w.orientation??vr.landscape,w.poleHeight??1,w.poleSpacing??3,M.current,C,l,E,y.objectiveFunctionType,y.populationSize,y.maximumGenerations,y.selectionMethod,y.convergenceThreshold,y.searchMethod,y.localSearchRadius,w.minimumInterRowSpacing,w.maximumInterRowSpacing,w.minimumRowsPerRack,w.maximumRowsPerRack,w.minimumTiltAngle,w.maximumTiltAngle,w.margin??0),A.current.selectionRate=y.selectionRate,A.current.crossoverRate=y.crossoverRate,A.current.mutationRate=y.mutationRate,x.current=0,S.current=!1,f([...A.current.geneNames]),A.current.startEvolving(),t(U=>{U.viewState.showEvolutionPanel=!0,U.selectedFloatingWindow="solarPanelOptimizationResult"})},j=()=>{var O;let F=0;switch(y.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.DAILY_PROFIT:{const B=Tn.getState().dailyPvYield;for(const _ of B)for(const X in _)Object.hasOwn(_,X)&&X==="Total"&&(F+=_[X]);break}case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:case To.YEARLY_PROFIT:{const B=Tn.getState().yearlyPvYield;for(const _ of B)for(const X in _)Object.hasOwn(_,X)&&X==="Total"&&(F+=_[X]);F*=12/n;break}}const U=(O=A.current)==null?void 0:O.solarPanelCount;switch(y.objectiveFunctionType){case To.DAILY_AVERAGE_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:U&&(F/=U);break;case To.DAILY_PROFIT:F=F*b.electricitySellingPrice,U&&(F-=U*b.operationalCostPerUnit);break;case To.YEARLY_PROFIT:F=F*b.electricitySellingPrice,U&&(F-=U*b.operationalCostPerUnit*365);break}return F};m.useEffect(()=>{!A.current||!u||(S.current=A.current.evolveIndividual(x.current%y.populationSize,j()),N(),x.current++,A.current.outsideGenerationCounter=Math.floor(x.current/y.populationSize),P.current=requestAnimationFrame(L))},[u]);const L=()=>{if(A.current&&o===Vs.GENETIC_ALGORITHM&&r&&!T.current){if(S.current||A.current.outsideGenerationCounter>=y.maximumGenerations){if(cancelAnimationFrame(P.current),v.current=!0,R.current.length>0&&g(l.id,!1),R.current=A.current.translateBest(),A.current.applyFittest(),N(),k(!0),hn(Y.t("message.EvolutionCompleted",D)+` -`+(S.current?Y.t("message.ConvergenceThresholdHasBeenReached",D):Y.t("message.MaximumNumberOfGenerationsHasBeenReached",D))),A.current){const F=A.current.population.getFittest();if(F){const U=F.getGene(0)*(w.maximumTiltAngle-w.minimumTiltAngle)+w.minimumTiltAngle,O=F.getGene(1)*(w.maximumInterRowSpacing-w.minimumInterRowSpacing)+w.minimumInterRowSpacing,B=Math.floor(F.getGene(2)*(w.maximumRowsPerRack-w.minimumRowsPerRack)+w.minimumRowsPerRack);t(_=>{_.solarPanelArrayLayoutParams.tiltAngle=U,_.solarPanelArrayLayoutParams.interRowSpacing=O,_.solarPanelArrayLayoutParams.rowsPerRack=B,_.solarPanelArrayLayoutParams.orientation=w.orientation,_.solarPanelArrayLayoutParams.poleHeight=w.poleHeight}),e&&t(_=>{var X,$;_.actionInfo={name:"Genetic Algorithm for Solar Panel Array Layout Completed",result:(X=A.current)==null?void 0:X.individualToString(F),steps:($=A.current)==null?void 0:$.outsideGenerationCounter,timestamp:new Date().getTime()}})}}return}g(l.id,!1),setTimeout(()=>{A.current&&(R.current=A.current.translateIndividualByIndex(x.current%y.populationSize)),k(!1)},100)}},k=F=>{ht.getState().set(U=>{switch(y.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.DAILY_PROFIT:F?U.runDailySimulationForSolarPanelsLastStep=!0:U.runDailySimulationForSolarPanels=!0;break;case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:case To.YEARLY_PROFIT:F?U.runYearlySimulationForSolarPanelsLastStep=!0:U.runYearlySimulationForSolarPanels=!0;break}}),t(U=>{switch(y.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.DAILY_PROFIT:U.graphState&&(U.graphState.dailyPvIndividualOutputs=!1);break;case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:case To.YEARLY_PROFIT:U.graphState&&(U.graphState.yearlyPvIndividualOutputs=!1);break}U.elements.push(...R.current)}),F&&ht.getState().set(U=>{U.runEvolution=!1,U.evolutionInProgress=!1,U.objectiveEvaluationIndex=0})},N=()=>{if(!A.current)return;const F=[];for(let U=0;U0){const X=A.current.populationOfGenerations[U-1];if(X){let $=0;for(let Q=0;Q0&&F.push(O)}c(F)};return h.jsx(h.Fragment,{})});class PAo{constructor(e,n){this.fitness=Number.NaN,this.position=new Array,this.velocity=new Array,this.bestPositionOfParticle=new Array;for(let o=0;oe.fitness?1:this.fitnessn.compare(e)),Number.isNaN(this.bestFitness)||this.bestFitnesse)return!1}return!0}}class zat{constructor(e,n,o,r,i,a,l,s,c){this.stopped=!0,this.inertia=.8,this.cognitiveCoefficient=.1,this.socialCoefficient=.1,this.maximumSteps=5,this.bestPositionOfSteps=[],this.bestFitnessOfSteps=[],this.swarmOfSteps=[],this.outsideStepCounter=0,this.computeCounter=0,this.convergenceThreshold=.1,this.converged=!1,this.searchMethod=us.GLOBAL_SEARCH_UNIFORM_SELECTION,this.localSearchRadius=.1,this.swarm=new dze(o,a,r),this.objectiveFunctionType=n,this.convergenceThreshold=l,this.searchMethod=s,this.localSearchRadius=c,this.maximumSteps=i,this.foundation=e,this.bestPositionOfSteps=new Array(this.maximumSteps+1),this.bestPositionOfSteps.fill(null),this.bestFitnessOfSteps=new Array(this.maximumSteps+1),this.bestFitnessOfSteps.fill(0),this.swarmOfSteps=new Array(this.maximumSteps);for(let u=0;u=this.maximumSteps}}class $k extends zat{constructor(e,n,o,r,i,a,l,s,c){super(n,o,r,i,a,e.length,l,s,c),this.solarPanels=e;const u=this.swarm.particles[0];for(const[d,f]of e.entries()){const p=.5*(1+f.tiltAngle/Gt);if(u.position[d]=p,this.searchMethod===us.LOCAL_SEARCH_RANDOM_OPTIMIZATION)for(let g=1;g1;)w=Kk.gaussian()*this.localSearchRadius+p;y.position[d]=w}}}applyFittest(){const e=this.swarm.bestPositionOfSwarm;if(e){for(let n=0;ni.fitness&&i.updateBestPosition(),i.fitness=n,this.computeCounter===0&&e===0&&(this.bestPositionOfSteps[0]=[...i.position],this.bestFitnessOfSteps[0]=n);const a=Math.floor(this.computeCounter/o);console.log("Step "+(a+1)+", particle "+e+" : "+$k.particleToString(i.position,n));const l=(r=this.swarmOfSteps[a])==null?void 0:r.particles[e];if(l){for(let c=0;c{const t=H(fn),e=H(ma),n=H(IH)??6,o=H(DH),r=ht(n5),i=ht(Oq),a=H(s3),l=H(l3),s=H(o$),c=ht(_q),u=H(TW),d=H(r$),f=H(wA).particleSwarmOptimizationParams,p=Jt(),g=m.useRef(0),y=m.useRef(!1),w=m.useRef(!1),b=m.useRef(),C=m.useRef(),P=m.useRef(0),v=m.useRef(!1),T=m.useRef([]);m.useEffect(()=>{if(f.problem===Pi.SOLAR_PANEL_TILT_ANGLE&&o===Vs.PARTICLE_SWARM_OPTIMIZATION&&r){A(),g.current=requestAnimationFrame(S);const D=[...T.current];return()=>{cancelAnimationFrame(g.current),y.current||(hn(Y.t("message.EvolutionAborted",p)),ht.getState().set(E=>{E.evolutionInProgress=!1}),D.length>0&&(b.current=D,R(!0)))}}},[r]),m.useEffect(()=>{w.current=i,i?(cancelAnimationFrame(g.current),ht.getState().set(D=>{D.evolutionPaused=!0}),hn(Y.t("message.EvolutionPaused",p))):(ht.getState().set(D=>{D.evolutionPaused=!1}),S())},[i]);const A=()=>{if(!a)return;ht.getState().set(W=>{W.evolutionInProgress=!0,W.objectiveEvaluationIndex=0}),y.current=!1;const D=l(z.SolarPanel,a.id);T.current.length=0;for(const W of D)T.current.push(JSON.parse(JSON.stringify(W)));b.current=[];const E=[];for(const W of D)b.current.push(JSON.parse(JSON.stringify(W))),E.push(W.label);b.current.length>0?(C.current=new $k(b.current,a,f.objectiveFunctionType,f.swarmSize,f.vmax,f.maximumSteps,f.convergenceThreshold,f.searchMethod,f.localSearchRadius),C.current.inertia=f.inertia,C.current.cognitiveCoefficient=f.cognitiveCoefficient,C.current.socialCoefficient=f.socialCoefficient,P.current=0,v.current=!1,d(E),C.current.startEvolving(),t(W=>{W.viewState.showEvolutionPanel=!0,W.selectedFloatingWindow="solarPanelOptimizationResult"})):po(Y.t("message.EncounterEvolutionError",p))},x=()=>{let D=0;switch(f.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:{const E=Tn.getState().dailyPvYield;for(const W of E)for(const j in W)Object.hasOwn(W,j)&&j==="Total"&&(D+=W[j]);break}case To.YEARLY_TOTAL_OUTPUT:{const E=Tn.getState().yearlyPvYield;for(const W of E)for(const j in W)Object.hasOwn(W,j)&&j==="Total"&&(D+=W[j]);D*=12/n;break}}return D};m.useEffect(()=>{!C.current||!c||(v.current=C.current.updateParticle(P.current%f.swarmSize,x()),M(),P.current++,C.current.outsideStepCounter=Math.floor(P.current/f.swarmSize),g.current=requestAnimationFrame(S))},[c]);const S=()=>{if(C.current&&o===Vs.PARTICLE_SWARM_OPTIMIZATION&&r&&!w.current){if(v.current||C.current.outsideStepCounter>=f.maximumSteps){if(cancelAnimationFrame(g.current),y.current=!0,C.current.applyFittest(),M(),R(!0),hn(Y.t("message.EvolutionCompleted",p)+` -`+(v.current?Y.t("message.ConvergenceThresholdHasBeenReached",p):Y.t("message.MaximumNumberOfStepsHasBeenReached",p))),e&&C.current){const D=C.current.swarm.bestPositionOfSwarm,E=C.current.swarm.bestFitness;D&&E&&t(W=>{var j;W.actionInfo={name:"Particle Swarm Optimization for Solar Panel Tilt Angle Completed",result:$k.particleToString(D,E),steps:(j=C.current)==null?void 0:j.outsideStepCounter,timestamp:new Date().getTime()}})}return}C.current.translateParticle(P.current%f.swarmSize),R(!1)}},R=D=>{ht.getState().set(E=>{if(b.current)switch(f.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:D?E.runDailySimulationForSolarPanelsLastStep=!0:E.runDailySimulationForSolarPanels=!0;break;case To.YEARLY_TOTAL_OUTPUT:D?E.runYearlySimulationForSolarPanelsLastStep=!0:E.runYearlySimulationForSolarPanels=!0;break}}),t(E=>{if(b.current){switch(f.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:E.graphState&&(E.graphState.dailyPvIndividualOutputs=!1);break;case To.YEARLY_TOTAL_OUTPUT:E.graphState&&(E.graphState.yearlyPvIndividualOutputs=!1);break}for(const W of E.elements)if(W.type===z.SolarPanel){const j=W;for(const L of b.current)if(j.id===L.id){j.tiltAngle=L.tiltAngle;break}}}}),D&&ht.getState().set(E=>{E.runEvolution=!1,E.evolutionInProgress=!1,E.objectiveEvaluationIndex=0})},M=()=>{var E;if(!C.current)return;const D=[];for(let W=0;W0){const N=C.current.swarmOfSteps[W-1];if(N){let F=0;for(let U=0;U0&&D.push(j)}s(D)};return h.jsx(h.Fragment,{})});class RAo extends zat{constructor(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y,w,b,C,P,v,T,A,x){if(super(c,u,d,f,p,3,g,y,w),this.orientation=vr.landscape,this.rowAxis=Dl.leftRight,this.relativeMargin=.01,this.poleHeight=2,this.poleSpacing=5,this.solarPanelCount=0,this.solarRackCount=0,this.minimumInterRowSpacing=2,this.maximumInterRowSpacing=10,this.minimumRowsPerRack=1,this.maximumRowsPerRack=6,this.minimumTiltAngle=-Gt,this.maximumTiltAngle=Gt,this.margin=0,this.polygon=s,this.pvModel=e,this.rowAxis=n,this.orientation=o,this.poleHeight=r,this.poleSpacing=i,this.minimumInterRowSpacing=b,this.maximumInterRowSpacing=C,this.minimumRowsPerRack=P,this.maximumRowsPerRack=v,this.minimumTiltAngle=T,this.maximumTiltAngle=A,this.margin=x,this.setInterRowSpacingBounds(),a&&a.length>0){const S=a[0];if(a.length>1){const R=this.swarm.particles[0];R.position[0]=this.maximumTiltAngle===this.minimumTiltAngle?0:(S.tiltAngle-this.minimumTiltAngle)/(this.maximumTiltAngle-this.minimumTiltAngle);const M=a[1],D=l?l.interRowSpacing:this.rowAxis===Dl.upDown?Math.abs(S.cx-M.cx)*this.foundation.lx:Math.abs(S.cy-M.cy)*this.foundation.ly;let E=this.maximumInterRowSpacing===this.minimumInterRowSpacing?0:(D-this.minimumInterRowSpacing)/(this.maximumInterRowSpacing-this.minimumInterRowSpacing);E<0?E=0:E>1&&(E=1),R.position[1]=E;const W=l?l.rowsPerRack:Math.max(1,Math.round(S.ly/(S.orientation===vr.portrait?e.length:e.width)));let j=this.maximumRowsPerRack===this.minimumRowsPerRack?0:(W-this.minimumRowsPerRack)/(this.maximumRowsPerRack-this.minimumRowsPerRack);j<0?j=0:j>1&&(j=1),R.position[2]=j}}}setInterRowSpacingBounds(){this.bounds=me.calculatePolygonBounds(this.polygon.vertices)}applyFittest(){this.swarm.bestPositionOfSwarm&&console.log("Best: "+this.particleToString(this.swarm.bestPositionOfSwarm,this.swarm.bestFitness)+", rack count: "+this.solarRackCount+", panel count: "+this.solarPanelCount)}getObjectiveUnit(){switch(this.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:return"kWh";case To.YEARLY_PROFIT:case To.DAILY_PROFIT:return"dollars"}return null}particleToString(e,n){let o="F("+me.toDegrees(e[0]*(this.maximumTiltAngle-this.minimumTiltAngle)+this.minimumTiltAngle).toFixed(3)+"°, ";return o+=(e[1]*(this.maximumInterRowSpacing-this.minimumInterRowSpacing)+this.minimumInterRowSpacing).toFixed(3)+"m, ",o+=Math.floor(e[2]*(this.maximumRowsPerRack-this.minimumRowsPerRack)+this.minimumRowsPerRack)+")",o+" = "+n.toFixed(5)+" "+this.getObjectiveUnit()}startEvolving(){this.outsideStepCounter=0,this.computeCounter=0,this.bestPositionOfSteps.fill(null),this.bestFitnessOfSteps.fill(0),this.setInterRowSpacingBounds()}translateParticleByIndex(e){return this.translatePosition(this.swarm.particles[e].position)}translateBest(){return this.swarm.bestPositionOfSwarm?this.translatePosition(this.swarm.bestPositionOfSwarm):[]}translatePosition(e){if(!this.bounds)return[];const n=e[0]*(this.maximumTiltAngle-this.minimumTiltAngle)+this.minimumTiltAngle,o=e[1]*(this.maximumInterRowSpacing-this.minimumInterRowSpacing)+this.minimumInterRowSpacing,r=Math.floor(e[2]*(this.maximumRowsPerRack-this.minimumRowsPerRack)+this.minimumRowsPerRack),i=KR.create(this.polygon,this.foundation,this.pvModel,this.orientation,n,r,o,this.rowAxis,this.poleHeight,this.poleSpacing,this.margin);if(this.solarPanelCount=0,this.solarRackCount=i.length,i.length>0)for(const a of i)this.solarPanelCount+=me.countSolarPanelsOnRack(a,this.pvModel);return i}updateParticle(e,n){var r;const o=this.swarm.particles.length;if(!this.converged){const i=this.swarm.particles[e];i.fitness=n,this.computeCounter===0&&e===0&&(this.bestPositionOfSteps[0]=[...i.position],this.bestFitnessOfSteps[0]=n);const a=Math.floor(this.computeCounter/o);console.log("Step "+(a+1)+", particle "+e+" : "+this.particleToString(i.position,n)+", rack count: "+this.solarRackCount+", panel count: "+this.solarPanelCount);const l=(r=this.swarmOfSteps[a])==null?void 0:r.particles[e];if(l){for(let c=0;c{const t=H(fn),e=H(ma),n=H(IH)??6,o=H(DH),r=ht(n5),i=ht(Oq),a=H(qr),l=H(s3),s=H(l3),c=H(t5),u=H(Wge),d=H(o$),f=ht(_q),p=H(TW),g=H(r$),y=H(wA).particleSwarmOptimizationParams,w=H.getState().solarPanelArrayLayoutConstraints,b=H.getState().economicsParams,C=H.getState().solarPanelArrayLayoutParams,P=m.useRef(0),v=m.useRef(!1),T=m.useRef(!1),A=m.useRef(),x=m.useRef(0),S=m.useRef(!1),R=m.useRef([]),M=m.useRef([]),D=Jt(),E=l?a(l):void 0;m.useEffect(()=>{if(o===Vs.PARTICLE_SWARM_OPTIMIZATION&&y.problem===Pi.SOLAR_PANEL_ARRAY&&r){W(),P.current=requestAnimationFrame(L);const F=[...M.current];return()=>{cancelAnimationFrame(P.current),v.current||(hn(Y.t("message.EvolutionAborted",D)),ht.getState().set(U=>{U.evolutionInProgress=!1,U.runDailySimulationForSolarPanels=!1,U.runYearlySimulationForSolarPanels=!1}),setTimeout(()=>{R.current.length>0&&u(l.id,!1),F.length>0&&(R.current=F,k(!0))},100))}}},[r]),m.useEffect(()=>{T.current=i,i?(cancelAnimationFrame(P.current),ht.getState().set(F=>{F.evolutionPaused=!0}),hn(Y.t("message.EvolutionPaused",D))):(ht.getState().set(F=>{F.evolutionPaused=!1}),L())},[i]);const W=()=>{if(!l||!E)return;ht.getState().set(U=>{U.evolutionInProgress=!0,U.objectiveEvaluationIndex=0}),v.current=!1;const F=s(z.SolarPanel,E.id);M.current.length=0;for(const U of F)M.current.push(JSON.parse(JSON.stringify(U)));A.current=new RAo(c(w.pvModelName??"CS6X-355P-FG"),w.rowAxis??Dl.leftRight,w.orientation??vr.landscape,w.poleHeight??1,w.poleSpacing??3,M.current,C,l,E,y.objectiveFunctionType,y.swarmSize,y.vmax,y.maximumSteps,y.convergenceThreshold,y.searchMethod,y.localSearchRadius,w.minimumInterRowSpacing,w.maximumInterRowSpacing,w.minimumRowsPerRack,w.maximumRowsPerRack,w.minimumTiltAngle,w.maximumTiltAngle,w.margin??0),A.current.inertia=y.inertia,A.current.cognitiveCoefficient=y.cognitiveCoefficient,A.current.socialCoefficient=y.socialCoefficient,x.current=0,S.current=!1,g(["Tilt Angle","Inter-Row Spacing","Rack Width"]),A.current.startEvolving(),t(U=>{U.viewState.showEvolutionPanel=!0,U.selectedFloatingWindow="solarPanelOptimizationResult"})},j=()=>{var O;let F=0;switch(y.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.DAILY_PROFIT:{const B=Tn.getState().dailyPvYield;for(const _ of B)for(const X in _)Object.hasOwn(_,X)&&X==="Total"&&(F+=_[X]);break}case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:case To.YEARLY_PROFIT:{const B=Tn.getState().yearlyPvYield;for(const _ of B)for(const X in _)Object.hasOwn(_,X)&&X==="Total"&&(F+=_[X]);F*=12/n;break}}const U=(O=A.current)==null?void 0:O.solarPanelCount;switch(y.objectiveFunctionType){case To.DAILY_AVERAGE_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:U&&(F/=U);break;case To.DAILY_PROFIT:F=F*b.electricitySellingPrice,U&&(F-=U*b.operationalCostPerUnit);break;case To.YEARLY_PROFIT:F=F*b.electricitySellingPrice,U&&(F-=U*b.operationalCostPerUnit*365);break}return F};m.useEffect(()=>{!A.current||!f||(S.current=A.current.updateParticle(x.current%y.swarmSize,j()),N(),x.current++,A.current.outsideStepCounter=Math.floor(x.current/y.swarmSize),P.current=requestAnimationFrame(L))},[f]);const L=()=>{if(A.current&&o===Vs.PARTICLE_SWARM_OPTIMIZATION&&r&&!T.current){if(S.current||A.current.outsideStepCounter>=y.maximumSteps){if(cancelAnimationFrame(P.current),v.current=!0,R.current.length>0&&u(l.id,!1),R.current=A.current.translateBest(),A.current.applyFittest(),N(),k(!0),hn(Y.t("message.EvolutionCompleted",D)+` -`+(S.current?Y.t("message.ConvergenceThresholdHasBeenReached",D):Y.t("message.MaximumNumberOfStepsHasBeenReached",D))),A.current){const F=A.current.swarm.bestPositionOfSwarm,U=A.current.swarm.bestFitness;if(F&&U){const O=F[0]*(w.maximumTiltAngle-w.minimumTiltAngle)+w.minimumTiltAngle,B=F[1]*(w.maximumInterRowSpacing-w.minimumInterRowSpacing)+w.minimumInterRowSpacing,_=Math.floor(F[2]*(w.maximumRowsPerRack-w.minimumRowsPerRack)+w.minimumRowsPerRack);t(X=>{X.solarPanelArrayLayoutParams.tiltAngle=O,X.solarPanelArrayLayoutParams.interRowSpacing=B,X.solarPanelArrayLayoutParams.rowsPerRack=_,X.solarPanelArrayLayoutParams.orientation=w.orientation,X.solarPanelArrayLayoutParams.poleHeight=w.poleHeight}),e&&t(X=>{var $,Q;X.actionInfo={name:"Particle Swarm Optimization for Solar Panel Array Layout Completed",result:($=A.current)==null?void 0:$.particleToString(F,U),steps:(Q=A.current)==null?void 0:Q.outsideStepCounter,timestamp:new Date().getTime()}})}}return}u(l.id,!1),setTimeout(()=>{A.current&&(R.current=A.current.translateParticleByIndex(x.current%y.swarmSize)),k(!1)},100)}},k=F=>{ht.getState().set(U=>{switch(y.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.DAILY_PROFIT:F?U.runDailySimulationForSolarPanelsLastStep=!0:U.runDailySimulationForSolarPanels=!0;break;case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:case To.YEARLY_PROFIT:F?U.runYearlySimulationForSolarPanelsLastStep=!0:U.runYearlySimulationForSolarPanels=!0;break}}),t(U=>{switch(y.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.DAILY_PROFIT:U.graphState&&(U.graphState.dailyPvIndividualOutputs=!1);break;case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:case To.YEARLY_PROFIT:U.graphState&&(U.graphState.yearlyPvIndividualOutputs=!1);break}U.elements.push(...R.current)}),F&&ht.getState().set(U=>{U.runEvolution=!1,U.evolutionInProgress=!1,U.objectiveEvaluationIndex=0})},N=()=>{if(!A.current)return;const F=[];for(let U=0;U0){const X=A.current.swarmOfSteps[U-1];if(X){let $=0;for(let Q=0;Q0&&F.push(O)}d(F)};return h.jsx(h.Fragment,{})}),MAo=be.memo(()=>{const t=H($q),e=H(e$),n=H(t$),{gl:o}=oi();return o.domElement.style.cursor=t!==z.None||n||e?"crosshair":"default",null}),Im=()=>{ht.getState().set(t=>{t.showSolarRadiationHeatmap=!1,t.showHeatFluxes=!1})},IAo=be.memo(({width:t=400,height:e=400})=>{const n=H(fn),o=H(En),r=H(Tc),i=H(Sb),a=H(wge),l=H(I4t),s=H(HBe),[c,u]=m.useState(null),d=100,f=m.useCallback(P=>{u(P)},[]),p=m.useCallback(function(){u(null)},[]),g=()=>{const P=new google.maps.LatLng(r,i);new google.maps.Geocoder().geocode({location:P},function(v,T){if(T===google.maps.GeocoderStatus.OK&&v&&v[0].address_components){n(A=>{A.world.address=v[0].formatted_address});for(const A of v[0].address_components)if(A.types[0]==="country"){n(x=>{x.world.countryCode=A.short_name});break}}}).then(()=>{})},y=L2.throttle(()=>{if(c){const P=c.getCenter();if(P){const v=P.lat(),T=P.lng();if(v!==r||T!==i){g();const A={name:"Set Location",timestamp:Date.now(),oldLatitude:r,newLatitude:v,oldLongitude:i,newLongitude:T,undo:()=>{Im(),n(x=>{x.world.latitude=A.oldLatitude,x.world.longitude=A.oldLongitude})},redo:()=>{Im(),n(x=>{x.world.latitude=A.newLatitude,x.world.longitude=A.newLongitude})}};o(A),Im(),n(x=>{x.world.latitude=v,x.world.longitude=T})}}}},d,{leading:!1,trailing:!0}),w=L2.throttle(()=>{if(c){const P=c.getZoom();if(P!==void 0&&P!==a){g();const v={name:"Zoom Map",timestamp:Date.now(),oldValue:a,newValue:P,undo:()=>{n(T=>{T.viewState.mapZoom=v.oldValue})},redo:()=>{n(T=>{T.viewState.mapZoom=v.newValue})}};o(v),n(T=>{T.viewState.mapZoom=P})}}},d,{leading:!1,trailing:!0}),b=()=>{if(c){const P=c.getTilt();if(P!==void 0&&P!==l){const v={name:"Tilt Map",timestamp:Date.now(),oldValue:l,newValue:P,undo:()=>{n(T=>{T.viewState.mapTilt=v.oldValue})},redo:()=>{n(T=>{T.viewState.mapTilt=v.newValue})}};o(v),n(T=>{T.viewState.mapTilt=P})}}},C=()=>{if(c){const P=c.getMapTypeId();if(P!==void 0&&P!==s){const v={name:"Change Map Type",timestamp:Date.now(),oldValue:s,newValue:P,undo:()=>{n(T=>{T.viewState.mapType=v.oldValue,T.viewState.groundImageType=T.viewState.mapType})},redo:()=>{n(T=>{T.viewState.mapType=v.newValue,T.viewState.groundImageType=T.viewState.mapType})}};o(v),n(T=>{T.viewState.mapType=P,T.viewState.groundImageType=P})}}};return h.jsx(Frt,{mapContainerStyle:{border:"1px solid",width:t+"px",height:e+"px"},mapTypeId:s,center:{lat:r,lng:i},zoom:a,tilt:l,onLoad:f,onUnmount:p,onCenterChanged:y,onZoomChanged:w,onTiltChanged:b,onMapTypeIdChanged:C})}),zAo=["places"],DAo=Ro.div` +`,xAo=be.memo(({style:t,size:e,margin:n,round:o,handleShareWindowClose:r})=>{const i=H(mp),a=H(Pb),s=new URLSearchParams(window.location.search).get("userid"),c=Jt(),u=a??Y.t("name.Tagline",c),d="aladdinIFI "+(a?Y.t("name.Tagline",c):"");let f=t1;return a&&(s?f+="?client=web&userid="+s+"&title="+encodeURIComponent(a):i.uid&&(f+="?client=web&userid="+i.uid+"&title="+encodeURIComponent(a))),h.jsxs(vAo,{style:t,children:[h.jsx(h6o,{url:f,subject:u,children:h.jsx(i6o,{size:e,round:o})}),h.jsx(aAo,{url:f,title:u,via:d,style:{paddingRight:n},onShareWindowClose:r,children:h.jsx(wAo,{size:e,round:o})}),h.jsx(v6o,{url:f,style:{paddingRight:n},onShareWindowClose:r,children:h.jsx(g6o,{size:e,round:o})}),h.jsx(J6o,{url:f,title:u,style:{paddingRight:n},onShareWindowClose:r,children:h.jsx(V6o,{size:e,round:o})}),h.jsx(tAo,{url:f,title:u,style:{paddingRight:n},onShareWindowClose:r,children:h.jsx(Q6o,{size:e,round:o})}),h.jsx(z6o,{url:f,title:u,style:{paddingRight:n},onShareWindowClose:r,children:h.jsx(H6o,{size:e,round:o})}),h.jsx(L6o,{url:f,title:u,summary:d,source:Y.t("name.IFI",c),style:{paddingRight:n},onShareWindowClose:r,children:h.jsx(E6o,{size:e,round:o})}),h.jsx(mAo,{url:f,title:u,separator:":: ",onShareWindowClose:r,children:h.jsx(fAo,{size:e,round:o})})]})});class fC{constructor(e,n,o){if(this.fitness=Number.NaN,this.chromosome=new Array(e),this.discretizationSteps=o,n)if(o)for(let r=0;re.fitness?1:this.fitness=this.chromosome.length)throw new Error("Gene index out of bound: "+e);this.chromosome[e]=n}getGene(e){if(e<0||e>=this.chromosome.length)throw new Error("Gene index out of bound: "+e);return this.chromosome[e]}copyGenes(e){const n=Math.min(this.chromosome.length,e.chromosome.length);for(let o=0;on.compare(e))}getNicheCount(e,n){let o=0;for(const r of this.individuals){const i=e.distance(r);let a=0;ie&&(e=o.fitness,n=o);return n}evolve(e,n){this.selectSurvivors(e),this.crossover(n)}selectSurvivors(e){this.survivors=[],this.sort();const n=Math.floor(e*this.individuals.length);for(let o=0;o=r){o=l;break}let a=null;do{r=Math.random()*n,i=0;for(const l of this.survivors)if(i+=l.fitness-e,i>=r){l!==o&&(a=l);break}}while(a===null);return o&&a?new uze(o,a):null}selectParentsByTournament(){const e=this.survivors.length;if(e<=1)throw new Error("Must have at least two survivors to be used as parents");const n=e-1;let o=Math.floor(Math.random()*n),r;do r=Math.floor(Math.random()*n);while(r===o);const i=this.survivors[o].fitness>this.survivors[r].fitness?o:r;o=Math.floor(Math.random()*n);do r=Math.floor(Math.random()*n);while(r===o);let a=this.survivors[o].fitness>this.survivors[r].fitness?o:r;for(;a===i;){o=Math.floor(Math.random()*n);do r=Math.floor(Math.random()*n);while(r===o);a=this.survivors[o].fitness>this.survivors[r].fitness?o:r}return new uze(this.survivors[i],this.survivors[a])}mutate(e){if(me.isZero(e))return;let n=Math.floor(e*(this.individuals.length-1));for(n===0?n=1:n===this.individuals.length-1&&(n=this.individuals.length-2),this.mutants=[];this.mutants.lengthe)return!1}return!0}}class Iat{constructor(e,n,o,r,i,a,l,s,c,u){this.fitnessSharingRadius=.1,this.searchMethod=us.GLOBAL_SEARCH_UNIFORM_SELECTION,this.localSearchRadius=.1,this.constraints=[],this.stopped=!0,this.mutationRate=.1,this.crossoverRate=.5,this.selectionRate=.5,this.maximumGenerations=5,this.fittestOfGenerations=[],this.populationOfGenerations=[],this.outsideGenerationCounter=0,this.computeCounter=0,this.converged=!1,this.population=new dze(o,i,a,u),this.objectiveFunctionType=n,this.convergenceThreshold=l,this.maximumGenerations=r,this.searchMethod=s,this.localSearchRadius=c,this.geneNames=new Array(i),this.foundation=e;const d=e.cx,f=e.cy,p=e.lx,g=e.ly;this.minima=new Array(i),this.maxima=new Array(i);for(let y=0;y=this.maximumGenerations}}class Kk{static gaussian(){let e=0,n=0;for(;e===0;)e=Math.random();for(;n===0;)n=Math.random();return Math.sqrt(-2*Math.log(e))*Math.cos(2*Math.PI*n)}static twoGaussians(){let e=0,n=0;for(;e===0;)e=Math.random();for(;n===0;)n=Math.random();const o=new Array(2),r=Math.sqrt(-2*Math.log(e)),i=2*Math.PI*n;return o[0]=r*Math.cos(i),o[1]=r*Math.sin(i),o}static poisson(e){let n=0,o=Math.exp(-e),r=o;const i=Math.random();for(;i>r;)n++,o*=e/n,r+=o;return n}}class qk extends Iat{constructor(e,n,o,r,i,a,l,s,c){super(n,o,r,i,e.length,a,l,s,c),this.solarPanels=e;const u=this.population.individuals[0];for(const[d,f]of e.entries()){const p=.5*(1+f.tiltAngle/Gt);if(u.setGene(d,p),this.searchMethod===us.LOCAL_SEARCH_RANDOM_OPTIMIZATION)for(let g=1;g1;)w=Kk.gaussian()*this.localSearchRadius+p;y.setGene(d,w)}this.geneNames[d]="Tilt Angle ("+f.id+")"}}applyFittest(){const e=this.population.getFittest();if(e){for(let n=0;n{const t=H(fn),e=H(da),n=H(IH)??6,o=H(DH),r=ht(n5),i=ht(_q),a=H(s3),l=H(l3),s=H(o$),c=ht(Vq),u=H(PW),d=H(r$),f=H(wA).geneticAlgorithmParams,p=Jt(),g=m.useRef(0),y=m.useRef(!1),w=m.useRef(!1),b=m.useRef(),C=m.useRef(),P=m.useRef(0),v=m.useRef(!1),T=m.useRef([]);m.useEffect(()=>{if(f.problem===Pi.SOLAR_PANEL_TILT_ANGLE&&o===Vs.GENETIC_ALGORITHM&&r){A(),g.current=requestAnimationFrame(S);const D=[...T.current];return()=>{cancelAnimationFrame(g.current),y.current||(hn(Y.t("message.EvolutionAborted",p)),ht.getState().set(E=>{E.evolutionInProgress=!1}),D.length>0&&(b.current=D,R(!0)))}}},[r]),m.useEffect(()=>{w.current=i,i?(cancelAnimationFrame(g.current),ht.getState().set(D=>{D.evolutionPaused=!0}),hn(Y.t("message.EvolutionPaused",p))):(ht.getState().set(D=>{D.evolutionPaused=!1}),S())},[i]);const A=()=>{if(!a)return;ht.getState().set(W=>{W.evolutionInProgress=!0,W.objectiveEvaluationIndex=0}),y.current=!1;const D=l(z.SolarPanel,a.id);T.current.length=0;for(const W of D)T.current.push(JSON.parse(JSON.stringify(W)));b.current=[];const E=[];for(const W of D)b.current.push(JSON.parse(JSON.stringify(W))),E.push(W.label);b.current.length>0?(C.current=new qk(b.current,a,f.objectiveFunctionType,f.populationSize,f.maximumGenerations,f.selectionMethod,f.convergenceThreshold,f.searchMethod,f.localSearchRadius),C.current.selectionRate=f.selectionRate,C.current.crossoverRate=f.crossoverRate,C.current.mutationRate=f.mutationRate,P.current=0,v.current=!1,d(E),C.current.startEvolving(),t(W=>{W.viewState.showEvolutionPanel=!0,W.selectedFloatingWindow="solarPanelOptimizationResult"})):po(Y.t("message.EncounterEvolutionError",p))},x=()=>{let D=0;switch(f.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:{const E=Tn.getState().dailyPvYield;for(const W of E)for(const j in W)Object.hasOwn(W,j)&&j==="Total"&&(D+=W[j]);break}case To.YEARLY_TOTAL_OUTPUT:{const E=Tn.getState().yearlyPvYield;for(const W of E)for(const j in W)Object.hasOwn(W,j)&&j==="Total"&&(D+=W[j]);D*=12/n;break}}return D};m.useEffect(()=>{!C.current||!c||(v.current=C.current.evolveIndividual(P.current%f.populationSize,x()),M(),P.current++,C.current.outsideGenerationCounter=Math.floor(P.current/f.populationSize),g.current=requestAnimationFrame(S))},[c]);const S=()=>{if(C.current&&o===Vs.GENETIC_ALGORITHM&&r&&!w.current){if(v.current||C.current.outsideGenerationCounter>=f.maximumGenerations){if(cancelAnimationFrame(g.current),y.current=!0,C.current.applyFittest(),M(),R(!0),hn(Y.t("message.EvolutionCompleted",p)+` +`+(v.current?Y.t("message.ConvergenceThresholdHasBeenReached",p):Y.t("message.MaximumNumberOfGenerationsHasBeenReached",p))),e&&C.current){const D=C.current.population.getFittest();D&&t(E=>{var W;E.actionInfo={name:"Genetic Algorithm for Solar Panel Tilt Angle Completed",result:qk.individualToString(D),steps:(W=C.current)==null?void 0:W.outsideGenerationCounter,timestamp:new Date().getTime()}})}return}C.current.translateIndividual(P.current%f.populationSize),R(!1)}},R=D=>{ht.getState().set(E=>{if(b.current)switch(f.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:D?E.runDailySimulationForSolarPanelsLastStep=!0:E.runDailySimulationForSolarPanels=!0;break;case To.YEARLY_TOTAL_OUTPUT:D?E.runYearlySimulationForSolarPanelsLastStep=!0:E.runYearlySimulationForSolarPanels=!0;break;default:po(Y.t("message.ObjectiveFunctionTypeError",p),60)}}),t(E=>{if(b.current){switch(f.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:E.graphState&&(E.graphState.dailyPvIndividualOutputs=!1);break;case To.YEARLY_TOTAL_OUTPUT:E.graphState&&(E.graphState.yearlyPvIndividualOutputs=!1);break;default:po(Y.t("message.ObjectiveFunctionTypeError",p),60)}for(const W of E.elements)if(W.type===z.SolarPanel){const j=W;for(const L of b.current)if(j.id===L.id){j.tiltAngle=L.tiltAngle;break}}}}),D&&ht.getState().set(E=>{E.runEvolution=!1,E.evolutionInProgress=!1,E.objectiveEvaluationIndex=0})},M=()=>{var E;if(!C.current)return;const D=[];for(let W=0;W0){const N=C.current.populationOfGenerations[W-1];if(N){let F=0;for(let U=0;U0&&D.push(j)}s(D)};return h.jsx(h.Fragment,{})});class SAo extends Iat{constructor(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y,w,b,C,P,v,T,A,x){if(super(c,u,d,f,3,p,g,y,w),this.orientation=vr.landscape,this.rowAxis=Dl.leftRight,this.poleHeight=2,this.poleSpacing=5,this.solarPanelCount=0,this.solarRackCount=0,this.minimumInterRowSpacing=2,this.maximumInterRowSpacing=10,this.minimumRowsPerRack=1,this.maximumRowsPerRack=6,this.minimumTiltAngle=-Gt,this.maximumTiltAngle=Gt,this.margin=0,this.polygon=s,this.pvModel=e,this.rowAxis=n,this.orientation=o,this.poleHeight=r,this.poleSpacing=i,this.minimumInterRowSpacing=b,this.maximumInterRowSpacing=C,this.minimumRowsPerRack=P,this.maximumRowsPerRack=v,this.minimumTiltAngle=T,this.maximumTiltAngle=A,this.margin=x,this.setInterRowSpacingBounds(),this.geneNames[0]="Tilt Angle",this.geneNames[1]="Inter-Row Spacing",this.geneNames[2]="Rack Width",a&&a.length>0){const S=a[0];if(a.length>1){const R=this.population.individuals[0],M=this.maximumTiltAngle===this.minimumTiltAngle?0:(S.tiltAngle-this.minimumTiltAngle)/(this.maximumTiltAngle-this.minimumTiltAngle);R.setGene(0,M);const D=a[1],E=l?l.interRowSpacing:this.rowAxis===Dl.upDown?Math.abs(S.cx-D.cx)*this.foundation.lx:Math.abs(S.cy-D.cy)*this.foundation.ly;let W=this.maximumInterRowSpacing===this.minimumInterRowSpacing?0:(E-this.minimumInterRowSpacing)/(this.maximumInterRowSpacing-this.minimumInterRowSpacing);W<0?W=0:W>1&&(W=1),R.setGene(1,W);const j=l?l.rowsPerRack:Math.max(1,Math.round(S.ly/(S.orientation===vr.portrait?e.length:e.width)));let L=this.maximumRowsPerRack===this.minimumRowsPerRack?0:(j-this.minimumRowsPerRack)/(this.maximumRowsPerRack-this.minimumRowsPerRack);L<0?L=0:L>1&&(L=1),R.setGene(2,L)}}}setInterRowSpacingBounds(){this.bounds=me.calculatePolygonBounds(this.polygon.vertices)}applyFittest(){const e=this.population.getFittest();e&&console.log("Fittest: "+this.individualToString(e)+", rack count: "+this.solarRackCount+", panel count: "+this.solarPanelCount)}getObjectiveUnit(){switch(this.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:return"kWh";case To.YEARLY_PROFIT:case To.DAILY_PROFIT:return"dollars"}return null}individualToString(e){let n="F("+me.toDegrees(e.getGene(0)*(this.maximumTiltAngle-this.minimumTiltAngle)+this.minimumTiltAngle).toFixed(3)+"°, ";return n+=(e.getGene(1)*(this.maximumInterRowSpacing-this.minimumInterRowSpacing)+this.minimumInterRowSpacing).toFixed(3)+"m, ",n+=Math.floor(e.getGene(2)*(this.maximumRowsPerRack-this.minimumRowsPerRack)+this.minimumRowsPerRack)+")",n+" = "+e.fitness.toFixed(5)+" "+this.getObjectiveUnit()}startEvolving(){this.outsideGenerationCounter=0,this.computeCounter=0,this.fittestOfGenerations.fill(null),this.setInterRowSpacingBounds()}translateIndividualByIndex(e){return this.translateIndividual(this.population.individuals[e])}translateBest(){const e=this.population.getFittest();return e?this.translateIndividual(e):[]}translateIndividual(e){if(!this.bounds)return[];const n=e.getGene(0)*(this.maximumTiltAngle-this.minimumTiltAngle)+this.minimumTiltAngle,o=e.getGene(1)*(this.maximumInterRowSpacing-this.minimumInterRowSpacing)+this.minimumInterRowSpacing,r=Math.floor(e.getGene(2)*(this.maximumRowsPerRack-this.minimumRowsPerRack)+this.minimumRowsPerRack),i=KR.create(this.polygon,this.foundation,this.pvModel,this.orientation,n,r,o,this.rowAxis,this.poleHeight,this.poleSpacing,this.margin);if(this.solarPanelCount=0,this.solarRackCount=i.length,i.length>0)for(const a of i)this.solarPanelCount+=me.countSolarPanelsOnRack(a,this.pvModel);return i}evolveIndividual(e,n){var r;const o=this.population.individuals.length;if(!this.converged){const i=this.population.individuals[e];i.fitness=n,this.computeCounter===0&&e===0&&(this.fittestOfGenerations[0]=i.getCopy());const a=Math.floor(this.computeCounter/o);console.log("Generation "+(a+1)+", individual "+e+" : "+this.individualToString(i)+", rack count: "+this.solarRackCount+", panel count: "+this.solarPanelCount);const l=(r=this.populationOfGenerations[a])==null?void 0:r.individuals[e];if(l){for(let c=0;c{const t=H(fn),e=H(da),n=H(IH)??6,o=H(DH),r=ht(n5),i=ht(_q),a=H(qr),l=H(s3),s=H(l3),c=H(o$),u=ht(Vq),d=H(PW),f=H(r$),p=H(t5),g=H(Wge),y=H(wA).geneticAlgorithmParams,w=H.getState().solarPanelArrayLayoutConstraints,b=H.getState().economicsParams,C=H.getState().solarPanelArrayLayoutParams,P=m.useRef(0),v=m.useRef(!1),T=m.useRef(!1),A=m.useRef(),x=m.useRef(0),S=m.useRef(!1),R=m.useRef([]),M=m.useRef([]),D=Jt(),E=l?a(l):void 0;m.useEffect(()=>{if(o===Vs.GENETIC_ALGORITHM&&y.problem===Pi.SOLAR_PANEL_ARRAY&&r){W(),P.current=requestAnimationFrame(L);const F=[...M.current];return()=>{cancelAnimationFrame(P.current),v.current||(hn(Y.t("message.EvolutionAborted",D)),ht.getState().set(U=>{U.evolutionInProgress=!1,U.runDailySimulationForSolarPanels=!1,U.runYearlySimulationForSolarPanels=!1}),setTimeout(()=>{R.current.length>0&&g(l.id,!1),F.length>0&&(R.current=F,k(!0))},100))}}},[r]),m.useEffect(()=>{T.current=i,i?(cancelAnimationFrame(P.current),ht.getState().set(F=>{F.evolutionPaused=!0}),hn(Y.t("message.EvolutionPaused",D))):(ht.getState().set(F=>{F.evolutionPaused=!1}),L())},[i]);const W=()=>{if(!l||!E)return;ht.getState().set(U=>{U.evolutionInProgress=!0,U.objectiveEvaluationIndex=0}),v.current=!1;const F=s(z.SolarPanel,E.id);M.current.length=0;for(const U of F)M.current.push(JSON.parse(JSON.stringify(U)));A.current=new SAo(p(w.pvModelName??"CS6X-355P-FG"),w.rowAxis??Dl.leftRight,w.orientation??vr.landscape,w.poleHeight??1,w.poleSpacing??3,M.current,C,l,E,y.objectiveFunctionType,y.populationSize,y.maximumGenerations,y.selectionMethod,y.convergenceThreshold,y.searchMethod,y.localSearchRadius,w.minimumInterRowSpacing,w.maximumInterRowSpacing,w.minimumRowsPerRack,w.maximumRowsPerRack,w.minimumTiltAngle,w.maximumTiltAngle,w.margin??0),A.current.selectionRate=y.selectionRate,A.current.crossoverRate=y.crossoverRate,A.current.mutationRate=y.mutationRate,x.current=0,S.current=!1,f([...A.current.geneNames]),A.current.startEvolving(),t(U=>{U.viewState.showEvolutionPanel=!0,U.selectedFloatingWindow="solarPanelOptimizationResult"})},j=()=>{var O;let F=0;switch(y.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.DAILY_PROFIT:{const B=Tn.getState().dailyPvYield;for(const _ of B)for(const X in _)Object.hasOwn(_,X)&&X==="Total"&&(F+=_[X]);break}case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:case To.YEARLY_PROFIT:{const B=Tn.getState().yearlyPvYield;for(const _ of B)for(const X in _)Object.hasOwn(_,X)&&X==="Total"&&(F+=_[X]);F*=12/n;break}}const U=(O=A.current)==null?void 0:O.solarPanelCount;switch(y.objectiveFunctionType){case To.DAILY_AVERAGE_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:U&&(F/=U);break;case To.DAILY_PROFIT:F=F*b.electricitySellingPrice,U&&(F-=U*b.operationalCostPerUnit);break;case To.YEARLY_PROFIT:F=F*b.electricitySellingPrice,U&&(F-=U*b.operationalCostPerUnit*365);break}return F};m.useEffect(()=>{!A.current||!u||(S.current=A.current.evolveIndividual(x.current%y.populationSize,j()),N(),x.current++,A.current.outsideGenerationCounter=Math.floor(x.current/y.populationSize),P.current=requestAnimationFrame(L))},[u]);const L=()=>{if(A.current&&o===Vs.GENETIC_ALGORITHM&&r&&!T.current){if(S.current||A.current.outsideGenerationCounter>=y.maximumGenerations){if(cancelAnimationFrame(P.current),v.current=!0,R.current.length>0&&g(l.id,!1),R.current=A.current.translateBest(),A.current.applyFittest(),N(),k(!0),hn(Y.t("message.EvolutionCompleted",D)+` +`+(S.current?Y.t("message.ConvergenceThresholdHasBeenReached",D):Y.t("message.MaximumNumberOfGenerationsHasBeenReached",D))),A.current){const F=A.current.population.getFittest();if(F){const U=F.getGene(0)*(w.maximumTiltAngle-w.minimumTiltAngle)+w.minimumTiltAngle,O=F.getGene(1)*(w.maximumInterRowSpacing-w.minimumInterRowSpacing)+w.minimumInterRowSpacing,B=Math.floor(F.getGene(2)*(w.maximumRowsPerRack-w.minimumRowsPerRack)+w.minimumRowsPerRack);t(_=>{_.solarPanelArrayLayoutParams.tiltAngle=U,_.solarPanelArrayLayoutParams.interRowSpacing=O,_.solarPanelArrayLayoutParams.rowsPerRack=B,_.solarPanelArrayLayoutParams.orientation=w.orientation,_.solarPanelArrayLayoutParams.poleHeight=w.poleHeight}),e&&t(_=>{var X,$;_.actionInfo={name:"Genetic Algorithm for Solar Panel Array Layout Completed",result:(X=A.current)==null?void 0:X.individualToString(F),steps:($=A.current)==null?void 0:$.outsideGenerationCounter,timestamp:new Date().getTime()}})}}return}g(l.id,!1),setTimeout(()=>{A.current&&(R.current=A.current.translateIndividualByIndex(x.current%y.populationSize)),k(!1)},100)}},k=F=>{ht.getState().set(U=>{switch(y.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.DAILY_PROFIT:F?U.runDailySimulationForSolarPanelsLastStep=!0:U.runDailySimulationForSolarPanels=!0;break;case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:case To.YEARLY_PROFIT:F?U.runYearlySimulationForSolarPanelsLastStep=!0:U.runYearlySimulationForSolarPanels=!0;break}}),t(U=>{switch(y.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.DAILY_PROFIT:U.graphState&&(U.graphState.dailyPvIndividualOutputs=!1);break;case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:case To.YEARLY_PROFIT:U.graphState&&(U.graphState.yearlyPvIndividualOutputs=!1);break}U.elements.push(...R.current)}),F&&ht.getState().set(U=>{U.runEvolution=!1,U.evolutionInProgress=!1,U.objectiveEvaluationIndex=0})},N=()=>{if(!A.current)return;const F=[];for(let U=0;U0){const X=A.current.populationOfGenerations[U-1];if(X){let $=0;for(let Q=0;Q0&&F.push(O)}c(F)};return h.jsx(h.Fragment,{})});class PAo{constructor(e,n){this.fitness=Number.NaN,this.position=new Array,this.velocity=new Array,this.bestPositionOfParticle=new Array;for(let o=0;oe.fitness?1:this.fitnessn.compare(e)),Number.isNaN(this.bestFitness)||this.bestFitnesse)return!1}return!0}}class zat{constructor(e,n,o,r,i,a,l,s,c){this.stopped=!0,this.inertia=.8,this.cognitiveCoefficient=.1,this.socialCoefficient=.1,this.maximumSteps=5,this.bestPositionOfSteps=[],this.bestFitnessOfSteps=[],this.swarmOfSteps=[],this.outsideStepCounter=0,this.computeCounter=0,this.convergenceThreshold=.1,this.converged=!1,this.searchMethod=us.GLOBAL_SEARCH_UNIFORM_SELECTION,this.localSearchRadius=.1,this.swarm=new fze(o,a,r),this.objectiveFunctionType=n,this.convergenceThreshold=l,this.searchMethod=s,this.localSearchRadius=c,this.maximumSteps=i,this.foundation=e,this.bestPositionOfSteps=new Array(this.maximumSteps+1),this.bestPositionOfSteps.fill(null),this.bestFitnessOfSteps=new Array(this.maximumSteps+1),this.bestFitnessOfSteps.fill(0),this.swarmOfSteps=new Array(this.maximumSteps);for(let u=0;u=this.maximumSteps}}class $k extends zat{constructor(e,n,o,r,i,a,l,s,c){super(n,o,r,i,a,e.length,l,s,c),this.solarPanels=e;const u=this.swarm.particles[0];for(const[d,f]of e.entries()){const p=.5*(1+f.tiltAngle/Gt);if(u.position[d]=p,this.searchMethod===us.LOCAL_SEARCH_RANDOM_OPTIMIZATION)for(let g=1;g1;)w=Kk.gaussian()*this.localSearchRadius+p;y.position[d]=w}}}applyFittest(){const e=this.swarm.bestPositionOfSwarm;if(e){for(let n=0;ni.fitness&&i.updateBestPosition(),i.fitness=n,this.computeCounter===0&&e===0&&(this.bestPositionOfSteps[0]=[...i.position],this.bestFitnessOfSteps[0]=n);const a=Math.floor(this.computeCounter/o);console.log("Step "+(a+1)+", particle "+e+" : "+$k.particleToString(i.position,n));const l=(r=this.swarmOfSteps[a])==null?void 0:r.particles[e];if(l){for(let c=0;c{const t=H(fn),e=H(da),n=H(IH)??6,o=H(DH),r=ht(n5),i=ht(_q),a=H(s3),l=H(l3),s=H(o$),c=ht(Vq),u=H(PW),d=H(r$),f=H(wA).particleSwarmOptimizationParams,p=Jt(),g=m.useRef(0),y=m.useRef(!1),w=m.useRef(!1),b=m.useRef(),C=m.useRef(),P=m.useRef(0),v=m.useRef(!1),T=m.useRef([]);m.useEffect(()=>{if(f.problem===Pi.SOLAR_PANEL_TILT_ANGLE&&o===Vs.PARTICLE_SWARM_OPTIMIZATION&&r){A(),g.current=requestAnimationFrame(S);const D=[...T.current];return()=>{cancelAnimationFrame(g.current),y.current||(hn(Y.t("message.EvolutionAborted",p)),ht.getState().set(E=>{E.evolutionInProgress=!1}),D.length>0&&(b.current=D,R(!0)))}}},[r]),m.useEffect(()=>{w.current=i,i?(cancelAnimationFrame(g.current),ht.getState().set(D=>{D.evolutionPaused=!0}),hn(Y.t("message.EvolutionPaused",p))):(ht.getState().set(D=>{D.evolutionPaused=!1}),S())},[i]);const A=()=>{if(!a)return;ht.getState().set(W=>{W.evolutionInProgress=!0,W.objectiveEvaluationIndex=0}),y.current=!1;const D=l(z.SolarPanel,a.id);T.current.length=0;for(const W of D)T.current.push(JSON.parse(JSON.stringify(W)));b.current=[];const E=[];for(const W of D)b.current.push(JSON.parse(JSON.stringify(W))),E.push(W.label);b.current.length>0?(C.current=new $k(b.current,a,f.objectiveFunctionType,f.swarmSize,f.vmax,f.maximumSteps,f.convergenceThreshold,f.searchMethod,f.localSearchRadius),C.current.inertia=f.inertia,C.current.cognitiveCoefficient=f.cognitiveCoefficient,C.current.socialCoefficient=f.socialCoefficient,P.current=0,v.current=!1,d(E),C.current.startEvolving(),t(W=>{W.viewState.showEvolutionPanel=!0,W.selectedFloatingWindow="solarPanelOptimizationResult"})):po(Y.t("message.EncounterEvolutionError",p))},x=()=>{let D=0;switch(f.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:{const E=Tn.getState().dailyPvYield;for(const W of E)for(const j in W)Object.hasOwn(W,j)&&j==="Total"&&(D+=W[j]);break}case To.YEARLY_TOTAL_OUTPUT:{const E=Tn.getState().yearlyPvYield;for(const W of E)for(const j in W)Object.hasOwn(W,j)&&j==="Total"&&(D+=W[j]);D*=12/n;break}}return D};m.useEffect(()=>{!C.current||!c||(v.current=C.current.updateParticle(P.current%f.swarmSize,x()),M(),P.current++,C.current.outsideStepCounter=Math.floor(P.current/f.swarmSize),g.current=requestAnimationFrame(S))},[c]);const S=()=>{if(C.current&&o===Vs.PARTICLE_SWARM_OPTIMIZATION&&r&&!w.current){if(v.current||C.current.outsideStepCounter>=f.maximumSteps){if(cancelAnimationFrame(g.current),y.current=!0,C.current.applyFittest(),M(),R(!0),hn(Y.t("message.EvolutionCompleted",p)+` +`+(v.current?Y.t("message.ConvergenceThresholdHasBeenReached",p):Y.t("message.MaximumNumberOfStepsHasBeenReached",p))),e&&C.current){const D=C.current.swarm.bestPositionOfSwarm,E=C.current.swarm.bestFitness;D&&E&&t(W=>{var j;W.actionInfo={name:"Particle Swarm Optimization for Solar Panel Tilt Angle Completed",result:$k.particleToString(D,E),steps:(j=C.current)==null?void 0:j.outsideStepCounter,timestamp:new Date().getTime()}})}return}C.current.translateParticle(P.current%f.swarmSize),R(!1)}},R=D=>{ht.getState().set(E=>{if(b.current)switch(f.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:D?E.runDailySimulationForSolarPanelsLastStep=!0:E.runDailySimulationForSolarPanels=!0;break;case To.YEARLY_TOTAL_OUTPUT:D?E.runYearlySimulationForSolarPanelsLastStep=!0:E.runYearlySimulationForSolarPanels=!0;break}}),t(E=>{if(b.current){switch(f.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:E.graphState&&(E.graphState.dailyPvIndividualOutputs=!1);break;case To.YEARLY_TOTAL_OUTPUT:E.graphState&&(E.graphState.yearlyPvIndividualOutputs=!1);break}for(const W of E.elements)if(W.type===z.SolarPanel){const j=W;for(const L of b.current)if(j.id===L.id){j.tiltAngle=L.tiltAngle;break}}}}),D&&ht.getState().set(E=>{E.runEvolution=!1,E.evolutionInProgress=!1,E.objectiveEvaluationIndex=0})},M=()=>{var E;if(!C.current)return;const D=[];for(let W=0;W0){const N=C.current.swarmOfSteps[W-1];if(N){let F=0;for(let U=0;U0&&D.push(j)}s(D)};return h.jsx(h.Fragment,{})});class RAo extends zat{constructor(e,n,o,r,i,a,l,s,c,u,d,f,p,g,y,w,b,C,P,v,T,A,x){if(super(c,u,d,f,p,3,g,y,w),this.orientation=vr.landscape,this.rowAxis=Dl.leftRight,this.relativeMargin=.01,this.poleHeight=2,this.poleSpacing=5,this.solarPanelCount=0,this.solarRackCount=0,this.minimumInterRowSpacing=2,this.maximumInterRowSpacing=10,this.minimumRowsPerRack=1,this.maximumRowsPerRack=6,this.minimumTiltAngle=-Gt,this.maximumTiltAngle=Gt,this.margin=0,this.polygon=s,this.pvModel=e,this.rowAxis=n,this.orientation=o,this.poleHeight=r,this.poleSpacing=i,this.minimumInterRowSpacing=b,this.maximumInterRowSpacing=C,this.minimumRowsPerRack=P,this.maximumRowsPerRack=v,this.minimumTiltAngle=T,this.maximumTiltAngle=A,this.margin=x,this.setInterRowSpacingBounds(),a&&a.length>0){const S=a[0];if(a.length>1){const R=this.swarm.particles[0];R.position[0]=this.maximumTiltAngle===this.minimumTiltAngle?0:(S.tiltAngle-this.minimumTiltAngle)/(this.maximumTiltAngle-this.minimumTiltAngle);const M=a[1],D=l?l.interRowSpacing:this.rowAxis===Dl.upDown?Math.abs(S.cx-M.cx)*this.foundation.lx:Math.abs(S.cy-M.cy)*this.foundation.ly;let E=this.maximumInterRowSpacing===this.minimumInterRowSpacing?0:(D-this.minimumInterRowSpacing)/(this.maximumInterRowSpacing-this.minimumInterRowSpacing);E<0?E=0:E>1&&(E=1),R.position[1]=E;const W=l?l.rowsPerRack:Math.max(1,Math.round(S.ly/(S.orientation===vr.portrait?e.length:e.width)));let j=this.maximumRowsPerRack===this.minimumRowsPerRack?0:(W-this.minimumRowsPerRack)/(this.maximumRowsPerRack-this.minimumRowsPerRack);j<0?j=0:j>1&&(j=1),R.position[2]=j}}}setInterRowSpacingBounds(){this.bounds=me.calculatePolygonBounds(this.polygon.vertices)}applyFittest(){this.swarm.bestPositionOfSwarm&&console.log("Best: "+this.particleToString(this.swarm.bestPositionOfSwarm,this.swarm.bestFitness)+", rack count: "+this.solarRackCount+", panel count: "+this.solarPanelCount)}getObjectiveUnit(){switch(this.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:return"kWh";case To.YEARLY_PROFIT:case To.DAILY_PROFIT:return"dollars"}return null}particleToString(e,n){let o="F("+me.toDegrees(e[0]*(this.maximumTiltAngle-this.minimumTiltAngle)+this.minimumTiltAngle).toFixed(3)+"°, ";return o+=(e[1]*(this.maximumInterRowSpacing-this.minimumInterRowSpacing)+this.minimumInterRowSpacing).toFixed(3)+"m, ",o+=Math.floor(e[2]*(this.maximumRowsPerRack-this.minimumRowsPerRack)+this.minimumRowsPerRack)+")",o+" = "+n.toFixed(5)+" "+this.getObjectiveUnit()}startEvolving(){this.outsideStepCounter=0,this.computeCounter=0,this.bestPositionOfSteps.fill(null),this.bestFitnessOfSteps.fill(0),this.setInterRowSpacingBounds()}translateParticleByIndex(e){return this.translatePosition(this.swarm.particles[e].position)}translateBest(){return this.swarm.bestPositionOfSwarm?this.translatePosition(this.swarm.bestPositionOfSwarm):[]}translatePosition(e){if(!this.bounds)return[];const n=e[0]*(this.maximumTiltAngle-this.minimumTiltAngle)+this.minimumTiltAngle,o=e[1]*(this.maximumInterRowSpacing-this.minimumInterRowSpacing)+this.minimumInterRowSpacing,r=Math.floor(e[2]*(this.maximumRowsPerRack-this.minimumRowsPerRack)+this.minimumRowsPerRack),i=KR.create(this.polygon,this.foundation,this.pvModel,this.orientation,n,r,o,this.rowAxis,this.poleHeight,this.poleSpacing,this.margin);if(this.solarPanelCount=0,this.solarRackCount=i.length,i.length>0)for(const a of i)this.solarPanelCount+=me.countSolarPanelsOnRack(a,this.pvModel);return i}updateParticle(e,n){var r;const o=this.swarm.particles.length;if(!this.converged){const i=this.swarm.particles[e];i.fitness=n,this.computeCounter===0&&e===0&&(this.bestPositionOfSteps[0]=[...i.position],this.bestFitnessOfSteps[0]=n);const a=Math.floor(this.computeCounter/o);console.log("Step "+(a+1)+", particle "+e+" : "+this.particleToString(i.position,n)+", rack count: "+this.solarRackCount+", panel count: "+this.solarPanelCount);const l=(r=this.swarmOfSteps[a])==null?void 0:r.particles[e];if(l){for(let c=0;c{const t=H(fn),e=H(da),n=H(IH)??6,o=H(DH),r=ht(n5),i=ht(_q),a=H(qr),l=H(s3),s=H(l3),c=H(t5),u=H(Wge),d=H(o$),f=ht(Vq),p=H(PW),g=H(r$),y=H(wA).particleSwarmOptimizationParams,w=H.getState().solarPanelArrayLayoutConstraints,b=H.getState().economicsParams,C=H.getState().solarPanelArrayLayoutParams,P=m.useRef(0),v=m.useRef(!1),T=m.useRef(!1),A=m.useRef(),x=m.useRef(0),S=m.useRef(!1),R=m.useRef([]),M=m.useRef([]),D=Jt(),E=l?a(l):void 0;m.useEffect(()=>{if(o===Vs.PARTICLE_SWARM_OPTIMIZATION&&y.problem===Pi.SOLAR_PANEL_ARRAY&&r){W(),P.current=requestAnimationFrame(L);const F=[...M.current];return()=>{cancelAnimationFrame(P.current),v.current||(hn(Y.t("message.EvolutionAborted",D)),ht.getState().set(U=>{U.evolutionInProgress=!1,U.runDailySimulationForSolarPanels=!1,U.runYearlySimulationForSolarPanels=!1}),setTimeout(()=>{R.current.length>0&&u(l.id,!1),F.length>0&&(R.current=F,k(!0))},100))}}},[r]),m.useEffect(()=>{T.current=i,i?(cancelAnimationFrame(P.current),ht.getState().set(F=>{F.evolutionPaused=!0}),hn(Y.t("message.EvolutionPaused",D))):(ht.getState().set(F=>{F.evolutionPaused=!1}),L())},[i]);const W=()=>{if(!l||!E)return;ht.getState().set(U=>{U.evolutionInProgress=!0,U.objectiveEvaluationIndex=0}),v.current=!1;const F=s(z.SolarPanel,E.id);M.current.length=0;for(const U of F)M.current.push(JSON.parse(JSON.stringify(U)));A.current=new RAo(c(w.pvModelName??"CS6X-355P-FG"),w.rowAxis??Dl.leftRight,w.orientation??vr.landscape,w.poleHeight??1,w.poleSpacing??3,M.current,C,l,E,y.objectiveFunctionType,y.swarmSize,y.vmax,y.maximumSteps,y.convergenceThreshold,y.searchMethod,y.localSearchRadius,w.minimumInterRowSpacing,w.maximumInterRowSpacing,w.minimumRowsPerRack,w.maximumRowsPerRack,w.minimumTiltAngle,w.maximumTiltAngle,w.margin??0),A.current.inertia=y.inertia,A.current.cognitiveCoefficient=y.cognitiveCoefficient,A.current.socialCoefficient=y.socialCoefficient,x.current=0,S.current=!1,g(["Tilt Angle","Inter-Row Spacing","Rack Width"]),A.current.startEvolving(),t(U=>{U.viewState.showEvolutionPanel=!0,U.selectedFloatingWindow="solarPanelOptimizationResult"})},j=()=>{var O;let F=0;switch(y.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.DAILY_PROFIT:{const B=Tn.getState().dailyPvYield;for(const _ of B)for(const X in _)Object.hasOwn(_,X)&&X==="Total"&&(F+=_[X]);break}case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:case To.YEARLY_PROFIT:{const B=Tn.getState().yearlyPvYield;for(const _ of B)for(const X in _)Object.hasOwn(_,X)&&X==="Total"&&(F+=_[X]);F*=12/n;break}}const U=(O=A.current)==null?void 0:O.solarPanelCount;switch(y.objectiveFunctionType){case To.DAILY_AVERAGE_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:U&&(F/=U);break;case To.DAILY_PROFIT:F=F*b.electricitySellingPrice,U&&(F-=U*b.operationalCostPerUnit);break;case To.YEARLY_PROFIT:F=F*b.electricitySellingPrice,U&&(F-=U*b.operationalCostPerUnit*365);break}return F};m.useEffect(()=>{!A.current||!f||(S.current=A.current.updateParticle(x.current%y.swarmSize,j()),N(),x.current++,A.current.outsideStepCounter=Math.floor(x.current/y.swarmSize),P.current=requestAnimationFrame(L))},[f]);const L=()=>{if(A.current&&o===Vs.PARTICLE_SWARM_OPTIMIZATION&&r&&!T.current){if(S.current||A.current.outsideStepCounter>=y.maximumSteps){if(cancelAnimationFrame(P.current),v.current=!0,R.current.length>0&&u(l.id,!1),R.current=A.current.translateBest(),A.current.applyFittest(),N(),k(!0),hn(Y.t("message.EvolutionCompleted",D)+` +`+(S.current?Y.t("message.ConvergenceThresholdHasBeenReached",D):Y.t("message.MaximumNumberOfStepsHasBeenReached",D))),A.current){const F=A.current.swarm.bestPositionOfSwarm,U=A.current.swarm.bestFitness;if(F&&U){const O=F[0]*(w.maximumTiltAngle-w.minimumTiltAngle)+w.minimumTiltAngle,B=F[1]*(w.maximumInterRowSpacing-w.minimumInterRowSpacing)+w.minimumInterRowSpacing,_=Math.floor(F[2]*(w.maximumRowsPerRack-w.minimumRowsPerRack)+w.minimumRowsPerRack);t(X=>{X.solarPanelArrayLayoutParams.tiltAngle=O,X.solarPanelArrayLayoutParams.interRowSpacing=B,X.solarPanelArrayLayoutParams.rowsPerRack=_,X.solarPanelArrayLayoutParams.orientation=w.orientation,X.solarPanelArrayLayoutParams.poleHeight=w.poleHeight}),e&&t(X=>{var $,Q;X.actionInfo={name:"Particle Swarm Optimization for Solar Panel Array Layout Completed",result:($=A.current)==null?void 0:$.particleToString(F,U),steps:(Q=A.current)==null?void 0:Q.outsideStepCounter,timestamp:new Date().getTime()}})}}return}u(l.id,!1),setTimeout(()=>{A.current&&(R.current=A.current.translateParticleByIndex(x.current%y.swarmSize)),k(!1)},100)}},k=F=>{ht.getState().set(U=>{switch(y.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.DAILY_PROFIT:F?U.runDailySimulationForSolarPanelsLastStep=!0:U.runDailySimulationForSolarPanels=!0;break;case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:case To.YEARLY_PROFIT:F?U.runYearlySimulationForSolarPanelsLastStep=!0:U.runYearlySimulationForSolarPanels=!0;break}}),t(U=>{switch(y.objectiveFunctionType){case To.DAILY_TOTAL_OUTPUT:case To.DAILY_AVERAGE_OUTPUT:case To.DAILY_PROFIT:U.graphState&&(U.graphState.dailyPvIndividualOutputs=!1);break;case To.YEARLY_TOTAL_OUTPUT:case To.YEARLY_AVERAGE_OUTPUT:case To.YEARLY_PROFIT:U.graphState&&(U.graphState.yearlyPvIndividualOutputs=!1);break}U.elements.push(...R.current)}),F&&ht.getState().set(U=>{U.runEvolution=!1,U.evolutionInProgress=!1,U.objectiveEvaluationIndex=0})},N=()=>{if(!A.current)return;const F=[];for(let U=0;U0){const X=A.current.swarmOfSteps[U-1];if(X){let $=0;for(let Q=0;Q0&&F.push(O)}d(F)};return h.jsx(h.Fragment,{})}),MAo=be.memo(()=>{const t=H(Qq),e=H(e$),n=H(t$),{gl:o}=oi();return o.domElement.style.cursor=t!==z.None||n||e?"crosshair":"default",null}),Im=()=>{ht.getState().set(t=>{t.showSolarRadiationHeatmap=!1,t.showHeatFluxes=!1})},IAo=be.memo(({width:t=400,height:e=400})=>{const n=H(fn),o=H(En),r=H(Tc),i=H(Sb),a=H(wge),l=H(I4t),s=H(MBe),[c,u]=m.useState(null),d=100,f=m.useCallback(P=>{u(P)},[]),p=m.useCallback(function(){u(null)},[]),g=()=>{const P=new google.maps.LatLng(r,i);new google.maps.Geocoder().geocode({location:P},function(v,T){if(T===google.maps.GeocoderStatus.OK&&v&&v[0].address_components){n(A=>{A.world.address=v[0].formatted_address});for(const A of v[0].address_components)if(A.types[0]==="country"){n(x=>{x.world.countryCode=A.short_name});break}}}).then(()=>{})},y=L2.throttle(()=>{if(c){const P=c.getCenter();if(P){const v=P.lat(),T=P.lng();if(v!==r||T!==i){g();const A={name:"Set Location",timestamp:Date.now(),oldLatitude:r,newLatitude:v,oldLongitude:i,newLongitude:T,undo:()=>{Im(),n(x=>{x.world.latitude=A.oldLatitude,x.world.longitude=A.oldLongitude})},redo:()=>{Im(),n(x=>{x.world.latitude=A.newLatitude,x.world.longitude=A.newLongitude})}};o(A),Im(),n(x=>{x.world.latitude=v,x.world.longitude=T})}}}},d,{leading:!1,trailing:!0}),w=L2.throttle(()=>{if(c){const P=c.getZoom();if(P!==void 0&&P!==a){g();const v={name:"Zoom Map",timestamp:Date.now(),oldValue:a,newValue:P,undo:()=>{n(T=>{T.viewState.mapZoom=v.oldValue})},redo:()=>{n(T=>{T.viewState.mapZoom=v.newValue})}};o(v),n(T=>{T.viewState.mapZoom=P})}}},d,{leading:!1,trailing:!0}),b=()=>{if(c){const P=c.getTilt();if(P!==void 0&&P!==l){const v={name:"Tilt Map",timestamp:Date.now(),oldValue:l,newValue:P,undo:()=>{n(T=>{T.viewState.mapTilt=v.oldValue})},redo:()=>{n(T=>{T.viewState.mapTilt=v.newValue})}};o(v),n(T=>{T.viewState.mapTilt=P})}}},C=()=>{if(c){const P=c.getMapTypeId();if(P!==void 0&&P!==s){const v={name:"Change Map Type",timestamp:Date.now(),oldValue:s,newValue:P,undo:()=>{n(T=>{T.viewState.mapType=v.oldValue,T.viewState.groundImageType=T.viewState.mapType})},redo:()=>{n(T=>{T.viewState.mapType=v.newValue,T.viewState.groundImageType=T.viewState.mapType})}};o(v),n(T=>{T.viewState.mapType=P,T.viewState.groundImageType=P})}}};return h.jsx(Frt,{mapContainerStyle:{border:"1px solid",width:t+"px",height:e+"px"},mapTypeId:s,center:{lat:r,lng:i},zoom:a,tilt:l,onLoad:f,onUnmount:p,onCenterChanged:y,onZoomChanged:w,onTiltChanged:b,onMapTypeIdChanged:C})}),zAo=["places"],DAo=Ro.div` position: fixed; top: 40px; left: 10px; @@ -8527,7 +8527,7 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t padding: 8px; fill: #666; } -`,kAo=be.memo(()=>{const t=H(fn),e=H(En),n=H(jq),o=H(Tc),r=H(Sb),i=H(F4t),a=H(k4t),l=H(hA),s=H(SBe),c=H(wge),u=H(Pc),d=be.useRef(null),f=m.useRef(),p=m.useRef(null),g=p.current?p.current.clientWidth+40:460,y=p.current?p.current.clientHeight+40:600,[w,b]=m.useState({x:isNaN(i)?0:Math.min(i,window.innerWidth-g),y:isNaN(a)?0:Math.min(a,window.innerHeight-y)}),[C,P]=m.useState(!1),v=Jt();m.useEffect(()=>{const E=()=>{b({x:Math.min(i,window.innerWidth-g),y:Math.min(a,window.innerHeight-y)})};return window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[]);const{isLoaded:T,loadError:A}=Urt({id:"google-map-script",googleMapsApiKey:"AIzaSyCX6AmhM9d6R1ne9E7redd86YEahX_2Scs",libraries:zAo}),x=()=>{var W;const E=(W=f.current)==null?void 0:W.getPlaces();if(E&&E.length>0){const j=E[0].geometry;if(j&&j.location){const L={name:"Set Location",timestamp:Date.now(),oldLatitude:o,newLatitude:j.location.lat(),oldLongitude:r,newLongitude:j.location.lng(),oldAddress:n,newAddress:E[0].formatted_address,undo:()=>{t(k=>{k.world.latitude=L.oldLatitude,k.world.longitude=L.oldLongitude,k.world.address=L.oldAddress}),Im(),P(!C)},redo:()=>{t(k=>{k.world.latitude=L.newLatitude,k.world.longitude=L.newLongitude,k.world.address=L.newAddress}),Im(),P(!C)}};e(L),Im(),t(k=>{if(j.location&&(k.world.latitude=j.location.lat(),k.world.longitude=j.location.lng()),E[0]&&(k.world.address=E[0].formatted_address,E[0].address_components)){for(const N of E[0].address_components)if(N.types[0]==="country"){k.world.countryCode=N.short_name;break}}})}}},S=E=>{f.current=E},R=(E,W)=>{b({x:Math.min(W.x,window.innerWidth-g),y:Math.min(W.y,window.innerHeight-y)})},M=(E,W)=>{t(j=>{j.viewState.mapPanelX=Math.min(W.x,window.innerWidth-g),j.viewState.mapPanelY=Math.min(W.y,window.innerHeight-y)})},D=()=>{const E={name:"Close Maps",timestamp:Date.now(),undo:()=>{t(W=>{W.viewState.showMapPanel=!0})},redo:()=>{t(W=>{W.viewState.showMapPanel=!1})}};e(E),t(W=>{W.viewState.showMapPanel=!1})};return h.jsx(_i,{nodeRef:d,handle:".handle",bounds:"parent",axis:"both",position:w,onDrag:R,onStop:M,onMouseDown:()=>{t(E=>{E.selectedFloatingWindow="mapPanel"})},children:h.jsx(DAo,{ref:d,style:{zIndex:u==="mapPanel"?Sc:10},children:h.jsxs(EAo,{ref:p,children:[h.jsxs(FAo,{className:"handle",children:[h.jsx("span",{children:Y.t("word.Location",v)}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{D()},onMouseDown:()=>{D()},children:Y.t("word.Close",v)})]}),h.jsxs(en,{direction:"vertical",children:[h.jsx(en,{style:{paddingTop:"10px"},align:"center",size:20,children:h.jsxs(en,{direction:"horizontal",children:[h.jsx(en,{style:{fontSize:"12px"},children:Y.t("mapPanel.ImageOnGround",v)+":"}),h.jsx(xc,{title:"Show ground image",checked:l,onChange:E=>{const W={name:"Show Ground Image",timestamp:Date.now(),checked:E,undo:()=>{t(j=>{j.viewState.groundImage=!W.checked})},redo:()=>{t(j=>{j.viewState.groundImage=W.checked})}};e(W),t(j=>{j.viewState.groundImage=E})}}),h.jsx(en,{style:{fontSize:"12px"},children:Y.t("mapPanel.HideAddress",v)+":"}),h.jsx(xc,{title:"Hide address",checked:s,onChange:E=>{const W={name:"Hide Address",timestamp:Date.now(),checked:E,undo:()=>{t(j=>{j.viewState.hideAddress=!W.checked})},redo:()=>{t(j=>{j.viewState.hideAddress=W.checked})}};e(W),t(j=>{j.viewState.hideAddress=E})}})]})}),T&&h.jsx(en,{children:h.jsx("div",{children:h.jsx(k9e,{onLoad:S,onPlacesChanged:x,children:h.jsx("input",{type:"text",placeholder:n,style:{boxSizing:"border-box",border:"1px solid transparent",width:"400px",height:"32px",padding:"0 12px",borderRadius:"3px",boxShadow:"0 2px 6px rgba(0, 0, 0, 0.3)",fontSize:"14px",outline:"none",textOverflow:"ellipses",position:"relative"}})})})}),T?h.jsx(en,{children:h.jsxs("div",{children:[h.jsx(IAo,{width:400,height:400}),h.jsxs("p",{style:{paddingTop:"10px",fontSize:"12px"},children:[Y.t("mapPanel.Coordinates",v)+":"," (",Math.abs(o).toFixed(h8)+(o>0?"°N":"°S"),","," ",Math.abs(r).toFixed(h8)+(r>0?"°E":"°W"),"),  ",Y.t("mapPanel.Zoom",v)+":"," ",c]})]})}):h.jsx(LQ,{}),A&&h.jsx(en,{children:h.jsx("div",{children:"Map cannot be loaded right now, sorry."})})]})]})})})}),LAo=Ro.div` +`,kAo=be.memo(()=>{const t=H(fn),e=H(En),n=H(Bq),o=H(Tc),r=H(Sb),i=H(F4t),a=H(k4t),l=H(hA),s=H(TBe),c=H(wge),u=H(Pc),d=be.useRef(null),f=m.useRef(),p=m.useRef(null),g=p.current?p.current.clientWidth+40:460,y=p.current?p.current.clientHeight+40:600,[w,b]=m.useState({x:isNaN(i)?0:Math.min(i,window.innerWidth-g),y:isNaN(a)?0:Math.min(a,window.innerHeight-y)}),[C,P]=m.useState(!1),v=Jt();m.useEffect(()=>{const E=()=>{b({x:Math.min(i,window.innerWidth-g),y:Math.min(a,window.innerHeight-y)})};return window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[]);const{isLoaded:T,loadError:A}=Urt({id:"google-map-script",googleMapsApiKey:"AIzaSyCX6AmhM9d6R1ne9E7redd86YEahX_2Scs",libraries:zAo}),x=()=>{var W;const E=(W=f.current)==null?void 0:W.getPlaces();if(E&&E.length>0){const j=E[0].geometry;if(j&&j.location){const L={name:"Set Location",timestamp:Date.now(),oldLatitude:o,newLatitude:j.location.lat(),oldLongitude:r,newLongitude:j.location.lng(),oldAddress:n,newAddress:E[0].formatted_address,undo:()=>{t(k=>{k.world.latitude=L.oldLatitude,k.world.longitude=L.oldLongitude,k.world.address=L.oldAddress}),Im(),P(!C)},redo:()=>{t(k=>{k.world.latitude=L.newLatitude,k.world.longitude=L.newLongitude,k.world.address=L.newAddress}),Im(),P(!C)}};e(L),Im(),t(k=>{if(j.location&&(k.world.latitude=j.location.lat(),k.world.longitude=j.location.lng()),E[0]&&(k.world.address=E[0].formatted_address,E[0].address_components)){for(const N of E[0].address_components)if(N.types[0]==="country"){k.world.countryCode=N.short_name;break}}})}}},S=E=>{f.current=E},R=(E,W)=>{b({x:Math.min(W.x,window.innerWidth-g),y:Math.min(W.y,window.innerHeight-y)})},M=(E,W)=>{t(j=>{j.viewState.mapPanelX=Math.min(W.x,window.innerWidth-g),j.viewState.mapPanelY=Math.min(W.y,window.innerHeight-y)})},D=()=>{const E={name:"Close Maps",timestamp:Date.now(),undo:()=>{t(W=>{W.viewState.showMapPanel=!0})},redo:()=>{t(W=>{W.viewState.showMapPanel=!1})}};e(E),t(W=>{W.viewState.showMapPanel=!1})};return h.jsx(_i,{nodeRef:d,handle:".handle",bounds:"parent",axis:"both",position:w,onDrag:R,onStop:M,onMouseDown:()=>{t(E=>{E.selectedFloatingWindow="mapPanel"})},children:h.jsx(DAo,{ref:d,style:{zIndex:u==="mapPanel"?Sc:10},children:h.jsxs(EAo,{ref:p,children:[h.jsxs(FAo,{className:"handle",children:[h.jsx("span",{children:Y.t("word.Location",v)}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{D()},onMouseDown:()=>{D()},children:Y.t("word.Close",v)})]}),h.jsxs(en,{direction:"vertical",children:[h.jsx(en,{style:{paddingTop:"10px"},align:"center",size:20,children:h.jsxs(en,{direction:"horizontal",children:[h.jsx(en,{style:{fontSize:"12px"},children:Y.t("mapPanel.ImageOnGround",v)+":"}),h.jsx(xc,{title:"Show ground image",checked:l,onChange:E=>{const W={name:"Show Ground Image",timestamp:Date.now(),checked:E,undo:()=>{t(j=>{j.viewState.groundImage=!W.checked})},redo:()=>{t(j=>{j.viewState.groundImage=W.checked})}};e(W),t(j=>{j.viewState.groundImage=E})}}),h.jsx(en,{style:{fontSize:"12px"},children:Y.t("mapPanel.HideAddress",v)+":"}),h.jsx(xc,{title:"Hide address",checked:s,onChange:E=>{const W={name:"Hide Address",timestamp:Date.now(),checked:E,undo:()=>{t(j=>{j.viewState.hideAddress=!W.checked})},redo:()=>{t(j=>{j.viewState.hideAddress=W.checked})}};e(W),t(j=>{j.viewState.hideAddress=E})}})]})}),T&&h.jsx(en,{children:h.jsx("div",{children:h.jsx(L9e,{onLoad:S,onPlacesChanged:x,children:h.jsx("input",{type:"text",placeholder:n,style:{boxSizing:"border-box",border:"1px solid transparent",width:"400px",height:"32px",padding:"0 12px",borderRadius:"3px",boxShadow:"0 2px 6px rgba(0, 0, 0, 0.3)",fontSize:"14px",outline:"none",textOverflow:"ellipses",position:"relative"}})})})}),T?h.jsx(en,{children:h.jsxs("div",{children:[h.jsx(IAo,{width:400,height:400}),h.jsxs("p",{style:{paddingTop:"10px",fontSize:"12px"},children:[Y.t("mapPanel.Coordinates",v)+":"," (",Math.abs(o).toFixed(h8)+(o>0?"°N":"°S"),","," ",Math.abs(r).toFixed(h8)+(r>0?"°E":"°W"),"),  ",Y.t("mapPanel.Zoom",v)+":"," ",c]})]})}):h.jsx(LQ,{}),A&&h.jsx(en,{children:h.jsx("div",{children:"Map cannot be loaded right now, sorry."})})]})]})})})}),LAo=Ro.div` position: absolute; top: 80px; right: 24px; @@ -8558,58 +8558,58 @@ FIREBASE: `))},e.prototype.restoreState_=function(){var n,o,r,i;this.tryAuth(),t justify-content: space-between; align-items: center; cursor: move; -`,UAo=be.memo(()=>{const t=H(fn),e=H(En),n=H(rl),o=H(Tc),r=H(jq),i=ht(QBe),a=H(Twt),l=ht(pW),s=H(RBe),c=H(CBe),u=H(z4t),d=H(D4t),f=H(Pc),p=be.useRef(null),g=m.useRef(0),y=m.useRef(-1),w=m.useRef(null),b=w.current?w.current.clientWidth+40:680,C=w.current?w.current.clientHeight+100:250,[P,v]=m.useState({x:isNaN(u)?0:Math.max(u,b-window.innerWidth),y:isNaN(d)?0:Math.min(d,window.innerHeight-C)}),[T,A]=m.useState(!1),x=m.useMemo(()=>new Date(n),[n]),S=m.useMemo(()=>dl(x,o),[x,o]),{t:R}=Vl(),M=Jt();m.useEffect(()=>{const N=()=>{v({x:Math.max(u,b-window.innerWidth),y:Math.min(d,window.innerHeight-C)})};return window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}},[C,b,u,d]),m.useEffect(()=>(g.current=requestAnimationFrame(D),()=>{cancelAnimationFrame(g.current)}),[i]),m.useEffect(()=>{i&&S.sunset===0&&(cancelAnimationFrame(g.current),ht.getState().set(N=>{N.animateSun=!1}))},[S.sunset]);const D=()=>{const N=H.getState().animate24Hours;if(i){g.current=requestAnimationFrame(D);const F=Date.now();if(F-y.current>100){const U=x.getDate(),O=x.getMinutes()+x.getHours()*60,B=dl(x,H.getState().world.latitude);!N&&O>B.sunset&&x.setHours(B.sunrise/60,x.getMinutes()+15),x.setHours(x.getHours(),x.getMinutes()+15),x.setDate(U),E(x,!1),y.current=F}}else cancelAnimationFrame(g.current)},E=(N,F)=>{const U=new Date(x);if(U.setHours(N.getHours(),N.getMinutes()),F){const O={name:"Set Time",timestamp:Date.now(),oldValue:n,newValue:U.toLocaleString(),undo:()=>{t(B=>{B.world.date=O.oldValue})},redo:()=>{t(B=>{B.world.date=O.newValue})}};e(O)}t(O=>{O.world.date=U.toLocaleString("en-US")})},W=(N,F)=>{v({x:Math.max(F.x,b-window.innerWidth),y:Math.min(F.y,window.innerHeight-C)})},j=(N,F)=>{t(U=>{U.viewState.heliodonPanelX=Math.max(F.x,b-window.innerWidth),U.viewState.heliodonPanelY=Math.min(F.y,window.innerHeight-C)})},L=()=>{const N={name:"Close Sun and Time Settings Panel",timestamp:Date.now(),undo:()=>{t(F=>{F.viewState.showHeliodonPanel=!0})},redo:()=>{t(F=>{F.viewState.showHeliodonPanel=!1})}};e(N),t(F=>{F.viewState.showHeliodonPanel=!1})},k=m.useRef(L2.throttle(N=>{const F={name:"Set Latitude",timestamp:Date.now(),oldLatitude:o,newLatitude:N,oldAddress:r,newAddress:"",undo:()=>{t(U=>{U.world.latitude=F.oldLatitude,U.world.address=F.oldAddress}),Im(),A(!T)},redo:()=>{t(U=>{U.world.latitude=F.newLatitude,U.world.address=F.newAddress}),Im(),A(!T)}};e(F),t(U=>{U.world.latitude=N,U.world.address=""}),Im()},500,{leading:!1,trailing:!0}));return h.jsx(_i,{nodeRef:p,handle:".handle",bounds:"parent",axis:"both",position:P,onDrag:W,onStop:j,onMouseDown:()=>{t(N=>{N.selectedFloatingWindow="heliodonPanel"})},children:h.jsx(LAo,{ref:p,style:{zIndex:f==="heliodonPanel"?Sc:11},children:h.jsxs(WAo,{ref:w,children:[h.jsxs(NAo,{className:"handle",children:[h.jsx("span",{children:R("heliodonPanel.SunAndTimeSettings",M)}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{L()},onMouseDown:()=>{L()},children:R("word.Close",M)})]}),h.jsxs(en,{style:{padding:"20px"},align:"baseline",size:20,children:[h.jsxs(en,{direction:"vertical",children:[h.jsx("span",{children:R("menu.settings.Heliodon",M)}),h.jsx(xc,{checked:c,onChange:N=>{const F={name:"Show Heliodon",timestamp:Date.now(),checked:!c,undo:()=>{t(U=>{U.viewState.heliodon=!F.checked,U.viewState.heliodon&&U.updateSceneRadius()})},redo:()=>{t(U=>{U.viewState.heliodon=F.checked,U.viewState.heliodon&&U.updateSceneRadius()})}};e(F),t(U=>{U.viewState.heliodon=N,U.viewState.heliodon&&U.updateSceneRadius()})}})]}),c&&h.jsxs(en,{direction:"vertical",children:[h.jsx("span",{style:{fontSize:"10px"},children:R("heliodonPanel.SunAngles",M)}),h.jsx(xc,{checked:s,onChange:N=>{const F={name:"Show Sun Angles",timestamp:Date.now(),checked:!s,undo:()=>{t(U=>{U.viewState.showSunAngles=!F.checked})},redo:()=>{t(U=>{U.viewState.showSunAngles=F.checked})}};e(F),t(U=>{U.viewState.showSunAngles=N})}})]}),S.sunset>0&&!l&&h.jsxs(h.Fragment,{children:[h.jsxs(en,{direction:"vertical",children:[h.jsx("span",{children:R("word.Animate",M)}),h.jsx(xc,{checked:i,onChange:N=>{const F={name:"Animate Heliodon",timestamp:Date.now(),checked:!i,undo:()=>{ht.getState().set(U=>{U.animateSun=!F.checked})},redo:()=>{ht.getState().set(U=>{U.animateSun=F.checked})}};e(F),ht.getState().set(U=>{U.animateSun=N})}})]}),i&&h.jsxs(en,{direction:"vertical",children:[h.jsx("span",{style:{fontSize:"10px"},children:R("heliodonPanel.TwentyFourHours",M)}),h.jsx(xc,{checked:a,onChange:N=>{const F={name:"Animate 24 Hours",timestamp:Date.now(),checked:!a,undo:()=>{t(U=>{U.animate24Hours=!F.checked})},redo:()=>{t(U=>{U.animate24Hours=F.checked})}};e(F),t(U=>{U.animate24Hours=N})}})]})]}),h.jsxs(en,{direction:"vertical",children:[h.jsx("span",{children:R("word.Date",M)}),h.jsx(Ub,{disabled:l,value:yc(x),onChange:N=>{if(N){const F=new Date(x),U=N.toDate();F.setFullYear(U.getFullYear()),F.setMonth(U.getMonth()),F.setDate(U.getDate());const O={name:"Set Date",timestamp:Date.now(),oldValue:n,newValue:F.toString(),undo:()=>{t(B=>{B.world.date=O.oldValue}),Im()},redo:()=>{t(B=>{B.world.date=O.newValue}),Im()}};e(O),t(B=>{B.world.date=F.toLocaleString("en-US")}),Im()}}})]}),h.jsxs(en,{direction:"vertical",children:[h.jsx("span",{children:R("word.Time",M)}),h.jsx(tN,{disabled:l,value:yc(x),format:"HH:mm",onChange:N=>{N&&(E==null||E(N.toDate(),!0))}})]}),!l&&h.jsxs(en,{direction:"vertical",children:[h.jsxs("span",{children:[R("word.Latitude",M),": ",o.toFixed(2),"°"]}),h.jsx(Iu,{disabled:l,style:{width:"110px"},marks:{"-90":"-90°",0:"0°",90:"90°"},min:-90,max:90,value:o,tooltip:{open:!1},onChange:k.current})]})]})]})})})});function Dat(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e{const t=H(fn),e=H(En),n=H(rl),o=H(Tc),r=H(Bq),i=ht(ZBe),a=H(Twt),l=ht(pW),s=H(HBe),c=H(RBe),u=H(z4t),d=H(D4t),f=H(Pc),p=be.useRef(null),g=m.useRef(0),y=m.useRef(-1),w=m.useRef(null),b=w.current?w.current.clientWidth+40:680,C=w.current?w.current.clientHeight+100:250,[P,v]=m.useState({x:isNaN(u)?0:Math.max(u,b-window.innerWidth),y:isNaN(d)?0:Math.min(d,window.innerHeight-C)}),[T,A]=m.useState(!1),x=m.useMemo(()=>new Date(n),[n]),S=m.useMemo(()=>dl(x,o),[x,o]),{t:R}=Vl(),M=Jt();m.useEffect(()=>{const N=()=>{v({x:Math.max(u,b-window.innerWidth),y:Math.min(d,window.innerHeight-C)})};return window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}},[C,b,u,d]),m.useEffect(()=>(g.current=requestAnimationFrame(D),()=>{cancelAnimationFrame(g.current)}),[i]),m.useEffect(()=>{i&&S.sunset===0&&(cancelAnimationFrame(g.current),ht.getState().set(N=>{N.animateSun=!1}))},[S.sunset]);const D=()=>{const N=H.getState().animate24Hours;if(i){g.current=requestAnimationFrame(D);const F=Date.now();if(F-y.current>100){const U=x.getDate(),O=x.getMinutes()+x.getHours()*60,B=dl(x,H.getState().world.latitude);!N&&O>B.sunset&&x.setHours(B.sunrise/60,x.getMinutes()+15),x.setHours(x.getHours(),x.getMinutes()+15),x.setDate(U),E(x,!1),y.current=F}}else cancelAnimationFrame(g.current)},E=(N,F)=>{const U=new Date(x);if(U.setHours(N.getHours(),N.getMinutes()),F){const O={name:"Set Time",timestamp:Date.now(),oldValue:n,newValue:U.toLocaleString(),undo:()=>{t(B=>{B.world.date=O.oldValue})},redo:()=>{t(B=>{B.world.date=O.newValue})}};e(O)}t(O=>{O.world.date=U.toLocaleString("en-US")})},W=(N,F)=>{v({x:Math.max(F.x,b-window.innerWidth),y:Math.min(F.y,window.innerHeight-C)})},j=(N,F)=>{t(U=>{U.viewState.heliodonPanelX=Math.max(F.x,b-window.innerWidth),U.viewState.heliodonPanelY=Math.min(F.y,window.innerHeight-C)})},L=()=>{const N={name:"Close Sun and Time Settings Panel",timestamp:Date.now(),undo:()=>{t(F=>{F.viewState.showHeliodonPanel=!0})},redo:()=>{t(F=>{F.viewState.showHeliodonPanel=!1})}};e(N),t(F=>{F.viewState.showHeliodonPanel=!1})},k=m.useRef(L2.throttle(N=>{const F={name:"Set Latitude",timestamp:Date.now(),oldLatitude:o,newLatitude:N,oldAddress:r,newAddress:"",undo:()=>{t(U=>{U.world.latitude=F.oldLatitude,U.world.address=F.oldAddress}),Im(),A(!T)},redo:()=>{t(U=>{U.world.latitude=F.newLatitude,U.world.address=F.newAddress}),Im(),A(!T)}};e(F),t(U=>{U.world.latitude=N,U.world.address=""}),Im()},500,{leading:!1,trailing:!0}));return h.jsx(_i,{nodeRef:p,handle:".handle",bounds:"parent",axis:"both",position:P,onDrag:W,onStop:j,onMouseDown:()=>{t(N=>{N.selectedFloatingWindow="heliodonPanel"})},children:h.jsx(LAo,{ref:p,style:{zIndex:f==="heliodonPanel"?Sc:11},children:h.jsxs(WAo,{ref:w,children:[h.jsxs(NAo,{className:"handle",children:[h.jsx("span",{children:R("heliodonPanel.SunAndTimeSettings",M)}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{L()},onMouseDown:()=>{L()},children:R("word.Close",M)})]}),h.jsxs(en,{style:{padding:"20px"},align:"baseline",size:20,children:[h.jsxs(en,{direction:"vertical",children:[h.jsx("span",{children:R("menu.settings.Heliodon",M)}),h.jsx(xc,{checked:c,onChange:N=>{const F={name:"Show Heliodon",timestamp:Date.now(),checked:!c,undo:()=>{t(U=>{U.viewState.heliodon=!F.checked,U.viewState.heliodon&&U.updateSceneRadius()})},redo:()=>{t(U=>{U.viewState.heliodon=F.checked,U.viewState.heliodon&&U.updateSceneRadius()})}};e(F),t(U=>{U.viewState.heliodon=N,U.viewState.heliodon&&U.updateSceneRadius()})}})]}),c&&h.jsxs(en,{direction:"vertical",children:[h.jsx("span",{style:{fontSize:"10px"},children:R("heliodonPanel.SunAngles",M)}),h.jsx(xc,{checked:s,onChange:N=>{const F={name:"Show Sun Angles",timestamp:Date.now(),checked:!s,undo:()=>{t(U=>{U.viewState.showSunAngles=!F.checked})},redo:()=>{t(U=>{U.viewState.showSunAngles=F.checked})}};e(F),t(U=>{U.viewState.showSunAngles=N})}})]}),S.sunset>0&&!l&&h.jsxs(h.Fragment,{children:[h.jsxs(en,{direction:"vertical",children:[h.jsx("span",{children:R("word.Animate",M)}),h.jsx(xc,{checked:i,onChange:N=>{const F={name:"Animate Heliodon",timestamp:Date.now(),checked:!i,undo:()=>{ht.getState().set(U=>{U.animateSun=!F.checked})},redo:()=>{ht.getState().set(U=>{U.animateSun=F.checked})}};e(F),ht.getState().set(U=>{U.animateSun=N})}})]}),i&&h.jsxs(en,{direction:"vertical",children:[h.jsx("span",{style:{fontSize:"10px"},children:R("heliodonPanel.TwentyFourHours",M)}),h.jsx(xc,{checked:a,onChange:N=>{const F={name:"Animate 24 Hours",timestamp:Date.now(),checked:!a,undo:()=>{t(U=>{U.animate24Hours=!F.checked})},redo:()=>{t(U=>{U.animate24Hours=F.checked})}};e(F),t(U=>{U.animate24Hours=N})}})]})]}),h.jsxs(en,{direction:"vertical",children:[h.jsx("span",{children:R("word.Date",M)}),h.jsx(Ub,{disabled:l,value:yc(x),onChange:N=>{if(N){const F=new Date(x),U=N.toDate();F.setFullYear(U.getFullYear()),F.setMonth(U.getMonth()),F.setDate(U.getDate());const O={name:"Set Date",timestamp:Date.now(),oldValue:n,newValue:F.toString(),undo:()=>{t(B=>{B.world.date=O.oldValue}),Im()},redo:()=>{t(B=>{B.world.date=O.newValue}),Im()}};e(O),t(B=>{B.world.date=F.toLocaleString("en-US")}),Im()}}})]}),h.jsxs(en,{direction:"vertical",children:[h.jsx("span",{children:R("word.Time",M)}),h.jsx(nN,{disabled:l,value:yc(x),format:"HH:mm",onChange:N=>{N&&(E==null||E(N.toDate(),!0))}})]}),!l&&h.jsxs(en,{direction:"vertical",children:[h.jsxs("span",{children:[R("word.Latitude",M),": ",o.toFixed(2),"°"]}),h.jsx(Iu,{disabled:l,style:{width:"110px"},marks:{"-90":"-90°",0:"0°",90:"90°"},min:-90,max:90,value:o,tooltip:{open:!1},onChange:k.current})]})]})]})})})});function Dat(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e0?1:-1},$v=function(e){return _N(e)&&e.indexOf("%")===e.length-1},dr=function(e){return $Ao(e)&&!IM(e)},Nu=function(e){return dr(e)||_N(e)},t4o=0,uS=function(e){var n=++t4o;return"".concat(e||"").concat(n)},ub=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!dr(e)&&!_N(e))return o;var i;if($v(e)){var a=e.indexOf("%");i=n*parseFloat(e.slice(0,a))/100}else i=+e;return IM(i)&&(i=o),r&&i>n&&(i=n),i},c8=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},n4o=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,o={},r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function c4o(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function Jfe(t){"@babel/helpers - typeof";return Jfe=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},Jfe(t)}var pze={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},j6=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},gze=null,cle=null,x3e=function t(e){if(e===gze&&Array.isArray(cle))return cle;var n=[];return m.Children.forEach(e,function(o){ia(o)||(Gfe.isFragment(o)?n=n.concat(t(o.props.children)):n.push(o))}),cle=n,gze=e,n};function e1(t,e){var n=[],o=[];return Array.isArray(e)?o=e.map(function(r){return j6(r)}):o=[j6(e)],x3e(t).forEach(function(r){var i=Xm(r,"type.displayName")||Xm(r,"type.name");o.indexOf(i)!==-1&&n.push(r)}),n}function og(t,e){var n=e1(t,e);return n&&n[0]}var mze=function(e){if(!e||!e.props)return!1;var n=e.props,o=n.width,r=n.height;return!(!dr(o)||o<=0||!dr(r)||r<=0)},u4o=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],d4o=function(e){return e&&e.type&&_N(e.type)&&u4o.indexOf(e.type)>=0},Lat=function(e){return e&&Jfe(e)==="object"&&"cx"in e&&"cy"in e&&"r"in e},f4o=function(e,n,o,r){var i,a=(i=sle==null?void 0:sle[r])!==null&&i!==void 0?i:[];return!va(e)&&(r&&a.includes(n)||i4o.includes(n))||o&&v3e.includes(n)},ra=function(e,n,o){if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(m.isValidElement(e)&&(r=e.props),!fM(r))return null;var i={};return Object.keys(r).forEach(function(a){var l;f4o((l=r)===null||l===void 0?void 0:l[a],a,n,o)&&(i[a]=r[a])}),i},Kfe=function t(e,n){if(e===n)return!0;var o=m.Children.count(e);if(o!==m.Children.count(n))return!1;if(o===0)return!0;if(o===1)return yze(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function y4o(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function $fe(t){var e=t.children,n=t.width,o=t.height,r=t.viewBox,i=t.className,a=t.style,l=t.title,s=t.desc,c=m4o(t,g4o),u=r||{width:n,height:o,x:0,y:0},d=fl("recharts-surface",i);return be.createElement("svg",qfe({},ra(c,!0,"svg"),{className:d,width:n,height:o,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),be.createElement("title",null,l),be.createElement("desc",null,s),e)}var A4o=["children","className"];function Qfe(){return Qfe=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function v4o(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}var _l=be.forwardRef(function(t,e){var n=t.children,o=t.className,r=w4o(t,A4o),i=fl("recharts-layer",o);return be.createElement("g",Qfe({className:i},ra(r,!0),{ref:e}),n)}),B6=function(e,n){for(var o=arguments.length,r=new Array(o>2?o-2:0),i=2;ir?0:r+e),n=n>r?r:n,n<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(r);++o=o?t:S4o(t,e,n)}var P4o=T4o,C4o="\\ud800-\\udfff",R4o="\\u0300-\\u036f",H4o="\\ufe20-\\ufe2f",M4o="\\u20d0-\\u20ff",I4o=R4o+H4o+M4o,z4o="\\ufe0e\\ufe0f",D4o="\\u200d",E4o=RegExp("["+D4o+C4o+I4o+z4o+"]");function F4o(t){return E4o.test(t)}var Wat=F4o;function k4o(t){return t.split("")}var L4o=k4o,Nat="\\ud800-\\udfff",W4o="\\u0300-\\u036f",N4o="\\ufe20-\\ufe2f",U4o="\\u20d0-\\u20ff",j4o=W4o+N4o+U4o,B4o="\\ufe0e\\ufe0f",Y4o="["+Nat+"]",Zfe="["+j4o+"]",ehe="\\ud83c[\\udffb-\\udfff]",O4o="(?:"+Zfe+"|"+ehe+")",Uat="[^"+Nat+"]",jat="(?:\\ud83c[\\udde6-\\uddff]){2}",Bat="[\\ud800-\\udbff][\\udc00-\\udfff]",_4o="\\u200d",Yat=O4o+"?",Oat="["+B4o+"]?",V4o="(?:"+_4o+"(?:"+[Uat,jat,Bat].join("|")+")"+Oat+Yat+")*",G4o=Oat+Yat+V4o,X4o="(?:"+[Uat+Zfe+"?",Zfe,jat,Bat,Y4o].join("|")+")",J4o=RegExp(ehe+"(?="+ehe+")|"+X4o+G4o,"g");function K4o(t){return t.match(J4o)||[]}var q4o=K4o,$4o=L4o,Q4o=Wat,Z4o=q4o;function e8o(t){return Q4o(t)?Z4o(t):$4o(t)}var t8o=e8o,n8o=P4o,o8o=Wat,r8o=t8o,i8o=Iot;function a8o(t){return function(e){e=i8o(e);var n=o8o(e)?r8o(e):void 0,o=n?n[0]:e.charAt(0),r=n?n8o(n,1).join(""):e.slice(1);return o[t]()+r}}var l8o=a8o,s8o=l8o,c8o=s8o("toUpperCase"),u8o=c8o;const Oee=Fi(u8o);function _s(t){return function(){return t}}const _at=Math.cos,DJ=Math.sin,f5=Math.sqrt,EJ=Math.PI,_ee=2*EJ,the=Math.PI,nhe=2*the,mv=1e-6,d8o=nhe-mv;function Vat(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Vat;const n=10**e;return function(o){this._+=o[0];for(let r=1,i=o.length;rmv)if(!(Math.abs(d*s-c*u)>mv)||!i)this._append`L${this._x1=e},${this._y1=n}`;else{let p=o-a,g=r-l,y=s*s+c*c,w=p*p+g*g,b=Math.sqrt(y),C=Math.sqrt(f),P=i*Math.tan((the-Math.acos((y+f-w)/(2*b*C)))/2),v=P/C,T=P/b;Math.abs(v-1)>mv&&this._append`L${e+v*u},${n+v*d}`,this._append`A${i},${i},0,0,${+(d*p>u*g)},${this._x1=e+T*s},${this._y1=n+T*c}`}}arc(e,n,o,r,i,a){if(e=+e,n=+n,o=+o,a=!!a,o<0)throw new Error(`negative radius: ${o}`);let l=o*Math.cos(r),s=o*Math.sin(r),c=e+l,u=n+s,d=1^a,f=a?r-i:i-r;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>mv||Math.abs(this._y1-u)>mv)&&this._append`L${c},${u}`,o&&(f<0&&(f=f%nhe+nhe),f>d8o?this._append`A${o},${o},0,1,${d},${e-l},${n-s}A${o},${o},0,1,${d},${this._x1=c},${this._y1=u}`:f>mv&&this._append`A${o},${o},0,${+(f>=the)},${d},${this._x1=e+o*Math.cos(i)},${this._y1=n+o*Math.sin(i)}`)}rect(e,n,o,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${o=+o}v${+r}h${-o}Z`}toString(){return this._}}function b3e(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const o=Math.floor(n);if(!(o>=0))throw new RangeError(`invalid digits: ${n}`);e=o}return t},()=>new h8o(e)}function S3e(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Gat(t){this._context=t}Gat.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function Vee(t){return new Gat(t)}function Xat(t){return t[0]}function Jat(t){return t[1]}function T3e(t,e){var n=_s(!0),o=null,r=Vee,i=null,a=b3e(l);t=typeof t=="function"?t:t===void 0?Xat:_s(t),e=typeof e=="function"?e:e===void 0?Jat:_s(e);function l(s){var c,u=(s=S3e(s)).length,d,f=!1,p;for(o==null&&(i=r(p=a())),c=0;c<=u;++c)!(c=p;--g)l.point(P[g],v[g]);l.lineEnd(),l.areaEnd()}b&&(P[f]=+t(w,f,d),v[f]=+e(w,f,d),l.point(o?+o(w,f,d):P[f],n?+n(w,f,d):v[f]))}if(C)return l=null,C+""||null}function u(){return T3e().defined(r).curve(a).context(i)}return c.x=function(d){return arguments.length?(t=typeof d=="function"?d:_s(+d),o=null,c):t},c.x0=function(d){return arguments.length?(t=typeof d=="function"?d:_s(+d),c):t},c.x1=function(d){return arguments.length?(o=d==null?null:typeof d=="function"?d:_s(+d),c):o},c.y=function(d){return arguments.length?(e=typeof d=="function"?d:_s(+d),n=null,c):e},c.y0=function(d){return arguments.length?(e=typeof d=="function"?d:_s(+d),c):e},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:_s(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(o).y(e)},c.defined=function(d){return arguments.length?(r=typeof d=="function"?d:_s(!!d),c):r},c.curve=function(d){return arguments.length?(a=d,i!=null&&(l=a(i)),c):a},c.context=function(d){return arguments.length?(d==null?i=l=null:l=a(i=d),c):i},c}class Kat{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function p8o(t){return new Kat(t,!0)}function g8o(t){return new Kat(t,!1)}const P3e={draw(t,e){const n=f5(e/EJ);t.moveTo(n,0),t.arc(0,0,n,0,_ee)}},m8o={draw(t,e){const n=f5(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},qat=f5(1/3),y8o=qat*2,A8o={draw(t,e){const n=f5(e/y8o),o=n*qat;t.moveTo(0,-n),t.lineTo(o,0),t.lineTo(0,n),t.lineTo(-o,0),t.closePath()}},w8o={draw(t,e){const n=f5(e),o=-n/2;t.rect(o,o,n,n)}},v8o=.8908130915292852,$at=DJ(EJ/10)/DJ(7*EJ/10),x8o=DJ(_ee/10)*$at,b8o=-_at(_ee/10)*$at,S8o={draw(t,e){const n=f5(e*v8o),o=x8o*n,r=b8o*n;t.moveTo(0,-n),t.lineTo(o,r);for(let i=1;i<5;++i){const a=_ee*i/5,l=_at(a),s=DJ(a);t.lineTo(s*n,-l*n),t.lineTo(l*o-s*r,s*o+l*r)}t.closePath()}},ule=f5(3),T8o={draw(t,e){const n=-f5(e/(ule*3));t.moveTo(0,n*2),t.lineTo(-ule*n,-n),t.lineTo(ule*n,-n),t.closePath()}},wm=-.5,vm=f5(3)/2,ohe=1/f5(12),P8o=(ohe/2+1)*3,C8o={draw(t,e){const n=f5(e/P8o),o=n/2,r=n*ohe,i=o,a=n*ohe+n,l=-i,s=a;t.moveTo(o,r),t.lineTo(i,a),t.lineTo(l,s),t.lineTo(wm*o-vm*r,vm*o+wm*r),t.lineTo(wm*i-vm*a,vm*i+wm*a),t.lineTo(wm*l-vm*s,vm*l+wm*s),t.lineTo(wm*o+vm*r,wm*r-vm*o),t.lineTo(wm*i+vm*a,wm*a-vm*i),t.lineTo(wm*l+vm*s,wm*s-vm*l),t.closePath()}};function R8o(t,e){let n=null,o=b3e(r);t=typeof t=="function"?t:_s(t||P3e),e=typeof e=="function"?e:_s(e===void 0?64:+e);function r(){let i;if(n||(n=i=o()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return r.type=function(i){return arguments.length?(t=typeof i=="function"?i:_s(i),r):t},r.size=function(i){return arguments.length?(e=typeof i=="function"?i:_s(+i),r):e},r.context=function(i){return arguments.length?(n=i??null,r):n},r}function FJ(){}function kJ(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Qat(t){this._context=t}Qat.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:kJ(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:kJ(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function H8o(t){return new Qat(t)}function Zat(t){this._context=t}Zat.prototype={areaStart:FJ,areaEnd:FJ,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:kJ(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function M8o(t){return new Zat(t)}function elt(t){this._context=t}elt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,o=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,o):this._context.moveTo(n,o);break;case 3:this._point=4;default:kJ(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function I8o(t){return new elt(t)}function tlt(t){this._context=t}tlt.prototype={areaStart:FJ,areaEnd:FJ,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function z8o(t){return new tlt(t)}function wze(t){return t<0?-1:1}function vze(t,e,n){var o=t._x1-t._x0,r=e-t._x1,i=(t._y1-t._y0)/(o||r<0&&-0),a=(n-t._y1)/(r||o<0&&-0),l=(i*r+a*o)/(o+r);return(wze(i)+wze(a))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs(l))||0}function xze(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function dle(t,e,n){var o=t._x0,r=t._y0,i=t._x1,a=t._y1,l=(i-o)/3;t._context.bezierCurveTo(o+l,r+l*e,i-l,a-l*n,i,a)}function LJ(t){this._context=t}LJ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:dle(this,this._t0,xze(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,dle(this,xze(this,n=vze(this,t,e)),n);break;default:dle(this,this._t0,n=vze(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function nlt(t){this._context=new olt(t)}(nlt.prototype=Object.create(LJ.prototype)).point=function(t,e){LJ.prototype.point.call(this,e,t)};function olt(t){this._context=t}olt.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,o,r,i){this._context.bezierCurveTo(e,t,o,n,i,r)}};function D8o(t){return new LJ(t)}function E8o(t){return new nlt(t)}function rlt(t){this._context=t}rlt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var o=bze(t),r=bze(e),i=0,a=1;a=0;--e)r[e]=(a[e]-r[e+1])/i[e];for(i[n-1]=(t[n]+r[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function k8o(t){return new Gee(t,.5)}function L8o(t){return new Gee(t,0)}function W8o(t){return new Gee(t,1)}function nH(t,e){if((a=t.length)>1)for(var n=1,o,r,i=t[e[0]],a,l=i.length;n=0;)n[e]=e;return n}function N8o(t,e){return t[e]}function U8o(t){const e=[];return e.key=t,e}function j8o(){var t=_s([]),e=rhe,n=nH,o=N8o;function r(i){var a=Array.from(t.apply(this,arguments),U8o),l,s=a.length,c=-1,u;for(const d of i)for(l=0,++c;l0){for(var n,o,r=0,i=t[0].length,a;r0){for(var n=0,o=t[e[0]],r,i=o.length;n0)||!((i=(r=t[e[0]]).length)>0))){for(var n=0,o=1,r,i,a;o=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function K8o(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}var ilt={symbolCircle:P3e,symbolCross:m8o,symbolDiamond:A8o,symbolSquare:w8o,symbolStar:S8o,symbolTriangle:T8o,symbolWye:C8o},q8o=Math.PI/180,$8o=function(e){var n="symbol".concat(Oee(e));return ilt[n]||P3e},Q8o=function(e,n,o){if(n==="area")return e;switch(o){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*q8o;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.pow(Math.tan(r),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Z8o=function(e,n){ilt["symbol".concat(Oee(e))]=n},Xee=function(e){var n=e.type,o=n===void 0?"circle":n,r=e.size,i=r===void 0?64:r,a=e.sizeType,l=a===void 0?"area":a,s=J8o(e,_8o),c=Tze(Tze({},s),{},{type:o,size:i,sizeType:l}),u=function(){var w=$8o(o),b=R8o().type(w).size(Q8o(i,l,o));return b()},d=c.className,f=c.cx,p=c.cy,g=ra(c,!0);return f===+f&&p===+p&&i===+i?be.createElement("path",ihe({},g,{className:fl("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};Xee.registerSymbol=Z8o;function oH(t){"@babel/helpers - typeof";return oH=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},oH(t)}function ahe(){return ahe=Object.assign?Object.assign.bind():function(t){for(var e=1;e0?1:-1},$v=function(e){return VN(e)&&e.indexOf("%")===e.length-1},dr=function(e){return $Ao(e)&&!IM(e)},Nu=function(e){return dr(e)||VN(e)},t4o=0,uS=function(e){var n=++t4o;return"".concat(e||"").concat(n)},ub=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!dr(e)&&!VN(e))return o;var i;if($v(e)){var a=e.indexOf("%");i=n*parseFloat(e.slice(0,a))/100}else i=+e;return IM(i)&&(i=o),r&&i>n&&(i=n),i},c8=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},n4o=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,o={},r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function c4o(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function Jfe(t){"@babel/helpers - typeof";return Jfe=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},Jfe(t)}var gze={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},j6=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},mze=null,cle=null,b3e=function t(e){if(e===mze&&Array.isArray(cle))return cle;var n=[];return m.Children.forEach(e,function(o){ia(o)||(Gfe.isFragment(o)?n=n.concat(t(o.props.children)):n.push(o))}),cle=n,mze=e,n};function e1(t,e){var n=[],o=[];return Array.isArray(e)?o=e.map(function(r){return j6(r)}):o=[j6(e)],b3e(t).forEach(function(r){var i=Xm(r,"type.displayName")||Xm(r,"type.name");o.indexOf(i)!==-1&&n.push(r)}),n}function og(t,e){var n=e1(t,e);return n&&n[0]}var yze=function(e){if(!e||!e.props)return!1;var n=e.props,o=n.width,r=n.height;return!(!dr(o)||o<=0||!dr(r)||r<=0)},u4o=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],d4o=function(e){return e&&e.type&&VN(e.type)&&u4o.indexOf(e.type)>=0},Lat=function(e){return e&&Jfe(e)==="object"&&"cx"in e&&"cy"in e&&"r"in e},f4o=function(e,n,o,r){var i,a=(i=sle==null?void 0:sle[r])!==null&&i!==void 0?i:[];return!va(e)&&(r&&a.includes(n)||i4o.includes(n))||o&&x3e.includes(n)},ra=function(e,n,o){if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(m.isValidElement(e)&&(r=e.props),!fM(r))return null;var i={};return Object.keys(r).forEach(function(a){var l;f4o((l=r)===null||l===void 0?void 0:l[a],a,n,o)&&(i[a]=r[a])}),i},Kfe=function t(e,n){if(e===n)return!0;var o=m.Children.count(e);if(o!==m.Children.count(n))return!1;if(o===0)return!0;if(o===1)return Aze(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function y4o(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function $fe(t){var e=t.children,n=t.width,o=t.height,r=t.viewBox,i=t.className,a=t.style,l=t.title,s=t.desc,c=m4o(t,g4o),u=r||{width:n,height:o,x:0,y:0},d=fl("recharts-surface",i);return be.createElement("svg",qfe({},ra(c,!0,"svg"),{className:d,width:n,height:o,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),be.createElement("title",null,l),be.createElement("desc",null,s),e)}var A4o=["children","className"];function Qfe(){return Qfe=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function v4o(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}var _l=be.forwardRef(function(t,e){var n=t.children,o=t.className,r=w4o(t,A4o),i=fl("recharts-layer",o);return be.createElement("g",Qfe({className:i},ra(r,!0),{ref:e}),n)}),B6=function(e,n){for(var o=arguments.length,r=new Array(o>2?o-2:0),i=2;ir?0:r+e),n=n>r?r:n,n<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(r);++o=o?t:S4o(t,e,n)}var P4o=T4o,C4o="\\ud800-\\udfff",R4o="\\u0300-\\u036f",H4o="\\ufe20-\\ufe2f",M4o="\\u20d0-\\u20ff",I4o=R4o+H4o+M4o,z4o="\\ufe0e\\ufe0f",D4o="\\u200d",E4o=RegExp("["+D4o+C4o+I4o+z4o+"]");function F4o(t){return E4o.test(t)}var Wat=F4o;function k4o(t){return t.split("")}var L4o=k4o,Nat="\\ud800-\\udfff",W4o="\\u0300-\\u036f",N4o="\\ufe20-\\ufe2f",U4o="\\u20d0-\\u20ff",j4o=W4o+N4o+U4o,B4o="\\ufe0e\\ufe0f",Y4o="["+Nat+"]",Zfe="["+j4o+"]",ehe="\\ud83c[\\udffb-\\udfff]",O4o="(?:"+Zfe+"|"+ehe+")",Uat="[^"+Nat+"]",jat="(?:\\ud83c[\\udde6-\\uddff]){2}",Bat="[\\ud800-\\udbff][\\udc00-\\udfff]",_4o="\\u200d",Yat=O4o+"?",Oat="["+B4o+"]?",V4o="(?:"+_4o+"(?:"+[Uat,jat,Bat].join("|")+")"+Oat+Yat+")*",G4o=Oat+Yat+V4o,X4o="(?:"+[Uat+Zfe+"?",Zfe,jat,Bat,Y4o].join("|")+")",J4o=RegExp(ehe+"(?="+ehe+")|"+X4o+G4o,"g");function K4o(t){return t.match(J4o)||[]}var q4o=K4o,$4o=L4o,Q4o=Wat,Z4o=q4o;function e8o(t){return Q4o(t)?Z4o(t):$4o(t)}var t8o=e8o,n8o=P4o,o8o=Wat,r8o=t8o,i8o=Iot;function a8o(t){return function(e){e=i8o(e);var n=o8o(e)?r8o(e):void 0,o=n?n[0]:e.charAt(0),r=n?n8o(n,1).join(""):e.slice(1);return o[t]()+r}}var l8o=a8o,s8o=l8o,c8o=s8o("toUpperCase"),u8o=c8o;const Oee=Fi(u8o);function _s(t){return function(){return t}}const _at=Math.cos,EJ=Math.sin,f5=Math.sqrt,FJ=Math.PI,_ee=2*FJ,the=Math.PI,nhe=2*the,mv=1e-6,d8o=nhe-mv;function Vat(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Vat;const n=10**e;return function(o){this._+=o[0];for(let r=1,i=o.length;rmv)if(!(Math.abs(d*s-c*u)>mv)||!i)this._append`L${this._x1=e},${this._y1=n}`;else{let p=o-a,g=r-l,y=s*s+c*c,w=p*p+g*g,b=Math.sqrt(y),C=Math.sqrt(f),P=i*Math.tan((the-Math.acos((y+f-w)/(2*b*C)))/2),v=P/C,T=P/b;Math.abs(v-1)>mv&&this._append`L${e+v*u},${n+v*d}`,this._append`A${i},${i},0,0,${+(d*p>u*g)},${this._x1=e+T*s},${this._y1=n+T*c}`}}arc(e,n,o,r,i,a){if(e=+e,n=+n,o=+o,a=!!a,o<0)throw new Error(`negative radius: ${o}`);let l=o*Math.cos(r),s=o*Math.sin(r),c=e+l,u=n+s,d=1^a,f=a?r-i:i-r;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>mv||Math.abs(this._y1-u)>mv)&&this._append`L${c},${u}`,o&&(f<0&&(f=f%nhe+nhe),f>d8o?this._append`A${o},${o},0,1,${d},${e-l},${n-s}A${o},${o},0,1,${d},${this._x1=c},${this._y1=u}`:f>mv&&this._append`A${o},${o},0,${+(f>=the)},${d},${this._x1=e+o*Math.cos(i)},${this._y1=n+o*Math.sin(i)}`)}rect(e,n,o,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${o=+o}v${+r}h${-o}Z`}toString(){return this._}}function S3e(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const o=Math.floor(n);if(!(o>=0))throw new RangeError(`invalid digits: ${n}`);e=o}return t},()=>new h8o(e)}function T3e(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Gat(t){this._context=t}Gat.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function Vee(t){return new Gat(t)}function Xat(t){return t[0]}function Jat(t){return t[1]}function P3e(t,e){var n=_s(!0),o=null,r=Vee,i=null,a=S3e(l);t=typeof t=="function"?t:t===void 0?Xat:_s(t),e=typeof e=="function"?e:e===void 0?Jat:_s(e);function l(s){var c,u=(s=T3e(s)).length,d,f=!1,p;for(o==null&&(i=r(p=a())),c=0;c<=u;++c)!(c=p;--g)l.point(P[g],v[g]);l.lineEnd(),l.areaEnd()}b&&(P[f]=+t(w,f,d),v[f]=+e(w,f,d),l.point(o?+o(w,f,d):P[f],n?+n(w,f,d):v[f]))}if(C)return l=null,C+""||null}function u(){return P3e().defined(r).curve(a).context(i)}return c.x=function(d){return arguments.length?(t=typeof d=="function"?d:_s(+d),o=null,c):t},c.x0=function(d){return arguments.length?(t=typeof d=="function"?d:_s(+d),c):t},c.x1=function(d){return arguments.length?(o=d==null?null:typeof d=="function"?d:_s(+d),c):o},c.y=function(d){return arguments.length?(e=typeof d=="function"?d:_s(+d),n=null,c):e},c.y0=function(d){return arguments.length?(e=typeof d=="function"?d:_s(+d),c):e},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:_s(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(o).y(e)},c.defined=function(d){return arguments.length?(r=typeof d=="function"?d:_s(!!d),c):r},c.curve=function(d){return arguments.length?(a=d,i!=null&&(l=a(i)),c):a},c.context=function(d){return arguments.length?(d==null?i=l=null:l=a(i=d),c):i},c}class Kat{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function p8o(t){return new Kat(t,!0)}function g8o(t){return new Kat(t,!1)}const C3e={draw(t,e){const n=f5(e/FJ);t.moveTo(n,0),t.arc(0,0,n,0,_ee)}},m8o={draw(t,e){const n=f5(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},qat=f5(1/3),y8o=qat*2,A8o={draw(t,e){const n=f5(e/y8o),o=n*qat;t.moveTo(0,-n),t.lineTo(o,0),t.lineTo(0,n),t.lineTo(-o,0),t.closePath()}},w8o={draw(t,e){const n=f5(e),o=-n/2;t.rect(o,o,n,n)}},v8o=.8908130915292852,$at=EJ(FJ/10)/EJ(7*FJ/10),x8o=EJ(_ee/10)*$at,b8o=-_at(_ee/10)*$at,S8o={draw(t,e){const n=f5(e*v8o),o=x8o*n,r=b8o*n;t.moveTo(0,-n),t.lineTo(o,r);for(let i=1;i<5;++i){const a=_ee*i/5,l=_at(a),s=EJ(a);t.lineTo(s*n,-l*n),t.lineTo(l*o-s*r,s*o+l*r)}t.closePath()}},ule=f5(3),T8o={draw(t,e){const n=-f5(e/(ule*3));t.moveTo(0,n*2),t.lineTo(-ule*n,-n),t.lineTo(ule*n,-n),t.closePath()}},wm=-.5,vm=f5(3)/2,ohe=1/f5(12),P8o=(ohe/2+1)*3,C8o={draw(t,e){const n=f5(e/P8o),o=n/2,r=n*ohe,i=o,a=n*ohe+n,l=-i,s=a;t.moveTo(o,r),t.lineTo(i,a),t.lineTo(l,s),t.lineTo(wm*o-vm*r,vm*o+wm*r),t.lineTo(wm*i-vm*a,vm*i+wm*a),t.lineTo(wm*l-vm*s,vm*l+wm*s),t.lineTo(wm*o+vm*r,wm*r-vm*o),t.lineTo(wm*i+vm*a,wm*a-vm*i),t.lineTo(wm*l+vm*s,wm*s-vm*l),t.closePath()}};function R8o(t,e){let n=null,o=S3e(r);t=typeof t=="function"?t:_s(t||C3e),e=typeof e=="function"?e:_s(e===void 0?64:+e);function r(){let i;if(n||(n=i=o()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return r.type=function(i){return arguments.length?(t=typeof i=="function"?i:_s(i),r):t},r.size=function(i){return arguments.length?(e=typeof i=="function"?i:_s(+i),r):e},r.context=function(i){return arguments.length?(n=i??null,r):n},r}function kJ(){}function LJ(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Qat(t){this._context=t}Qat.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:LJ(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:LJ(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function H8o(t){return new Qat(t)}function Zat(t){this._context=t}Zat.prototype={areaStart:kJ,areaEnd:kJ,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:LJ(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function M8o(t){return new Zat(t)}function elt(t){this._context=t}elt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,o=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,o):this._context.moveTo(n,o);break;case 3:this._point=4;default:LJ(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function I8o(t){return new elt(t)}function tlt(t){this._context=t}tlt.prototype={areaStart:kJ,areaEnd:kJ,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function z8o(t){return new tlt(t)}function vze(t){return t<0?-1:1}function xze(t,e,n){var o=t._x1-t._x0,r=e-t._x1,i=(t._y1-t._y0)/(o||r<0&&-0),a=(n-t._y1)/(r||o<0&&-0),l=(i*r+a*o)/(o+r);return(vze(i)+vze(a))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs(l))||0}function bze(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function dle(t,e,n){var o=t._x0,r=t._y0,i=t._x1,a=t._y1,l=(i-o)/3;t._context.bezierCurveTo(o+l,r+l*e,i-l,a-l*n,i,a)}function WJ(t){this._context=t}WJ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:dle(this,this._t0,bze(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,dle(this,bze(this,n=xze(this,t,e)),n);break;default:dle(this,this._t0,n=xze(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function nlt(t){this._context=new olt(t)}(nlt.prototype=Object.create(WJ.prototype)).point=function(t,e){WJ.prototype.point.call(this,e,t)};function olt(t){this._context=t}olt.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,o,r,i){this._context.bezierCurveTo(e,t,o,n,i,r)}};function D8o(t){return new WJ(t)}function E8o(t){return new nlt(t)}function rlt(t){this._context=t}rlt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var o=Sze(t),r=Sze(e),i=0,a=1;a=0;--e)r[e]=(a[e]-r[e+1])/i[e];for(i[n-1]=(t[n]+r[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function k8o(t){return new Gee(t,.5)}function L8o(t){return new Gee(t,0)}function W8o(t){return new Gee(t,1)}function nH(t,e){if((a=t.length)>1)for(var n=1,o,r,i=t[e[0]],a,l=i.length;n=0;)n[e]=e;return n}function N8o(t,e){return t[e]}function U8o(t){const e=[];return e.key=t,e}function j8o(){var t=_s([]),e=rhe,n=nH,o=N8o;function r(i){var a=Array.from(t.apply(this,arguments),U8o),l,s=a.length,c=-1,u;for(const d of i)for(l=0,++c;l0){for(var n,o,r=0,i=t[0].length,a;r0){for(var n=0,o=t[e[0]],r,i=o.length;n0)||!((i=(r=t[e[0]]).length)>0))){for(var n=0,o=1,r,i,a;o=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function K8o(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}var ilt={symbolCircle:C3e,symbolCross:m8o,symbolDiamond:A8o,symbolSquare:w8o,symbolStar:S8o,symbolTriangle:T8o,symbolWye:C8o},q8o=Math.PI/180,$8o=function(e){var n="symbol".concat(Oee(e));return ilt[n]||C3e},Q8o=function(e,n,o){if(n==="area")return e;switch(o){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*q8o;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.pow(Math.tan(r),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Z8o=function(e,n){ilt["symbol".concat(Oee(e))]=n},Xee=function(e){var n=e.type,o=n===void 0?"circle":n,r=e.size,i=r===void 0?64:r,a=e.sizeType,l=a===void 0?"area":a,s=J8o(e,_8o),c=Pze(Pze({},s),{},{type:o,size:i,sizeType:l}),u=function(){var w=$8o(o),b=R8o().type(w).size(Q8o(i,l,o));return b()},d=c.className,f=c.cx,p=c.cy,g=ra(c,!0);return f===+f&&p===+p&&i===+i?be.createElement("path",ihe({},g,{className:fl("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};Xee.registerSymbol=Z8o;function oH(t){"@babel/helpers - typeof";return oH=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},oH(t)}function ahe(){return ahe=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var C=p.inactive?c:p.color;return be.createElement("li",ahe({className:w,style:d,key:"legend-item-".concat(g)},Qk(o.props,p,g)),be.createElement($fe,{width:a,height:a,viewBox:u,style:f},o.renderIcon(p)),be.createElement("span",{className:"recharts-legend-item-text",style:{color:C}},y?y(b,p,g):b))})}},{key:"render",value:function(){var o=this.props,r=o.payload,i=o.layout,a=o.align;if(!r||!r.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?a:"left"};return be.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}]),e}(m.PureComponent);eL(C3e,"displayName","Legend");eL(C3e,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});function cwo(t,e,n,o){for(var r=t.length,i=n+(o?1:-1);o?i--:++i-1}var xwo=vwo;function bwo(t,e,n){for(var o=-1,r=t==null?0:t.length;++o=Wwo){var c=e?null:kwo(t);if(c)return Lwo(c);a=!1,r=Fwo,s=new zwo}else s=e?[]:l;e:for(;++o=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function Qwo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function Zwo(t){return t.value}function e7o(t,e){if(be.isValidElement(t))return be.cloneElement(t,e);if(typeof t=="function")return be.createElement(t,e);e.ref;var n=$wo(e,_wo);return be.createElement(C3e,n)}var Mze=1,J2=function(t){Kwo(e,t);function e(){var n;Vwo(this,e);for(var o=arguments.length,r=new Array(o),i=0;iMze||Math.abs(r.height-this.lastBoundingBox.height)>Mze)&&(this.lastBoundingBox.width=r.width,this.lastBoundingBox.height=r.height,o&&o(r)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,o&&o(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?nv({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(o){var r=this.props,i=r.layout,a=r.align,l=r.verticalAlign,s=r.margin,c=r.chartWidth,u=r.chartHeight,d,f;if(!o||(o.left===void 0||o.left===null)&&(o.right===void 0||o.right===null))if(a==="center"&&i==="vertical"){var p=this.getBBoxSnapshot();d={left:((c||0)-p.width)/2}}else d=a==="right"?{right:s&&s.right||0}:{left:s&&s.left||0};if(!o||(o.top===void 0||o.top===null)&&(o.bottom===void 0||o.bottom===null))if(l==="middle"){var g=this.getBBoxSnapshot();f={top:((u||0)-g.height)/2}}else f=l==="bottom"?{bottom:s&&s.bottom||0}:{top:s&&s.top||0};return nv(nv({},d),f)}},{key:"render",value:function(){var o=this,r=this.props,i=r.content,a=r.width,l=r.height,s=r.wrapperStyle,c=r.payloadUniqBy,u=r.payload,d=nv(nv({position:"absolute",width:a||"auto",height:l||"auto"},this.getDefaultPosition(s)),s);return be.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){o.wrapperNode=p}},e7o(i,nv(nv({},this.props),{},{payload:clt(u,c,Zwo)})))}}],[{key:"getWithHeight",value:function(o,r){var i=o.props.layout;return i==="vertical"&&dr(o.props.height)?{height:o.props.height}:i==="horizontal"?{width:o.props.width||r}:null}}]),e}(m.PureComponent);Jee(J2,"displayName","Legend");Jee(J2,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Ize=dM,t7o=z5e,n7o=vp,zze=Ize?Ize.isConcatSpreadable:void 0;function o7o(t){return n7o(t)||t7o(t)||!!(zze&&t&&t[zze])}var r7o=o7o,i7o=G5e,a7o=r7o;function hlt(t,e,n,o,r){var i=-1,a=t.length;for(n||(n=a7o),r||(r=[]);++i0&&n(l)?e>1?hlt(l,e-1,n,o,r):i7o(r,l):o||(r[r.length]=l)}return r}var plt=hlt;function l7o(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}var s7o=l7o,Dze=vM;function c7o(t,e){if(t!==e){var n=t!==void 0,o=t===null,r=t===t,i=Dze(t),a=e!==void 0,l=e===null,s=e===e,c=Dze(e);if(!l&&!c&&!i&&t>e||i&&a&&s&&!l&&!c||o&&a&&s||!n&&s||!r)return 1;if(!o&&!i&&!c&&t=l)return s;var c=n[o];return s*(c=="desc"?-1:1)}}return t.index-e.index}var h7o=f7o,hle=B5e,p7o=$5e,g7o=Xw,m7o=Eot,y7o=s7o,A7o=JZ,w7o=h7o,v7o=Qb,x7o=vp;function b7o(t,e,n){e.length?e=hle(e,function(i){return x7o(i)?function(a){return p7o(a,i.length===1?i[0]:i)}:i}):e=[v7o];var o=-1;e=hle(e,A7o(g7o));var r=m7o(t,function(i,a,l){var s=hle(e,function(c){return c(i)});return{criteria:s,index:++o,value:i}});return y7o(r,function(i,a){return w7o(i,a,n)})}var S7o=b7o;function T7o(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var P7o=T7o,C7o=P7o,Eze=Math.max;function R7o(t,e,n){return e=Eze(e===void 0?t.length-1:e,0),function(){for(var o=arguments,r=-1,i=Eze(o.length-e,0),a=Array(i);++r0){if(++e>=k7o)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var U7o=N7o,j7o=F7o,B7o=U7o,Y7o=B7o(j7o),O7o=Y7o,_7o=Qb,V7o=H7o,G7o=O7o;function X7o(t,e){return G7o(V7o(t,e,_7o),t+"")}var J7o=X7o,K7o=KZ,q7o=hM,$7o=E5e,Q7o=c5;function Z7o(t,e,n){if(!Q7o(n))return!1;var o=typeof e;return(o=="number"?q7o(n)&&$7o(e,n.length):o=="string"&&e in n)?K7o(n[e],t):!1}var Kee=Z7o,evo=plt,tvo=S7o,nvo=J7o,kze=Kee,ovo=nvo(function(t,e){if(t==null)return[];var n=e.length;return n>1&&kze(t,e[0],e[1])?e=[]:n>2&&kze(e[0],e[1],e[2])&&(e=[e[0]]),tvo(t,evo(e,1),[])}),rvo=ovo;const R3e=Fi(rvo);function tL(t){"@babel/helpers - typeof";return tL=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},tL(t)}function che(){return che=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=e.x),"".concat(sD,"-left"),dr(n)&&e&&dr(e.x)&&n=e.y),"".concat(sD,"-top"),dr(o)&&e&&dr(e.y)&&oy?Math.max(u,s[o]):Math.max(d,s[o])}function wvo(t){var e=t.translateX,n=t.translateY,o=t.useTranslate3d;return{transform:o?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function vvo(t){var e=t.allowEscapeViewBox,n=t.coordinate,o=t.offsetTopLeft,r=t.position,i=t.reverseDirection,a=t.tooltipBox,l=t.useTranslate3d,s=t.viewBox,c,u,d;return a.height>0&&a.width>0&&n?(u=Nze({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:o,position:r,reverseDirection:i,tooltipDimension:a.width,viewBox:s,viewBoxDimension:s.width}),d=Nze({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:o,position:r,reverseDirection:i,tooltipDimension:a.height,viewBox:s,viewBoxDimension:s.height}),c=wvo({translateX:u,translateY:d,useTranslate3d:l})):c=yvo,{cssProperties:c,cssClasses:Avo({translateX:u,translateY:d,coordinate:n})}}function iH(t){"@babel/helpers - typeof";return iH=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},iH(t)}function Uze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function jze(t){for(var e=1;eBze||Math.abs(o.height-this.state.lastBoundingBox.height)>Bze)&&this.setState({lastBoundingBox:{width:o.width,height:o.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var o,r;this.props.active&&this.updateBBox(),this.state.dismissed&&(((o=this.props.coordinate)===null||o===void 0?void 0:o.x)!==this.state.dismissedAtCoordinate.x||((r=this.props.coordinate)===null||r===void 0?void 0:r.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var o=this,r=this.props,i=r.active,a=r.allowEscapeViewBox,l=r.animationDuration,s=r.animationEasing,c=r.children,u=r.coordinate,d=r.hasPayload,f=r.isAnimationActive,p=r.offset,g=r.position,y=r.reverseDirection,w=r.useTranslate3d,b=r.viewBox,C=r.wrapperStyle,P=vvo({allowEscapeViewBox:a,coordinate:u,offsetTopLeft:p,position:g,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:b}),v=P.cssClasses,T=P.cssProperties,A=jze(jze({transition:f&&i?"transform ".concat(l,"ms ").concat(s):void 0},T),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&d?"visible":"hidden",position:"absolute",top:0,left:0},C);return be.createElement("div",{tabIndex:-1,className:v,style:A,ref:function(S){o.wrapperNode=S}},c)}}]),e}(m.PureComponent),Mvo=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},B2={isSsr:Mvo(),get:function(e){return B2[e]},set:function(e,n){if(typeof e=="string")B2[e]=n;else{var o=Object.keys(e);o&&o.length&&o.forEach(function(r){B2[r]=e[r]})}}};function aH(t){"@babel/helpers - typeof";return aH=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},aH(t)}function Yze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Oze(t){for(var e=1;e0;return be.createElement(Hvo,{allowEscapeViewBox:a,animationDuration:l,animationEasing:s,isAnimationActive:f,active:i,coordinate:u,hasPayload:A,offset:p,position:w,reverseDirection:b,useTranslate3d:C,viewBox:P,wrapperStyle:v},Uvo(c,Oze(Oze({},this.props),{},{payload:T})))}}]),e}(m.PureComponent);H3e(rh,"displayName","Tooltip");H3e(rh,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!B2.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var jvo=l5,Bvo=function(){return jvo.Date.now()},Yvo=Bvo,Ovo=/\s/;function _vo(t){for(var e=t.length;e--&&Ovo.test(t.charAt(e)););return e}var Vvo=_vo,Gvo=Vvo,Xvo=/^\s+/;function Jvo(t){return t&&t.slice(0,Gvo(t)+1).replace(Xvo,"")}var Kvo=Jvo,qvo=Kvo,_ze=c5,$vo=vM,Vze=NaN,Qvo=/^[-+]0x[0-9a-f]+$/i,Zvo=/^0b[01]+$/i,exo=/^0o[0-7]+$/i,txo=parseInt;function nxo(t){if(typeof t=="number")return t;if($vo(t))return Vze;if(_ze(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=_ze(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=qvo(t);var n=Zvo.test(t);return n||exo.test(t)?txo(t.slice(2),n?2:8):Qvo.test(t)?Vze:+t}var wlt=nxo,oxo=c5,gle=Yvo,Gze=wlt,rxo="Expected a function",ixo=Math.max,axo=Math.min;function lxo(t,e,n){var o,r,i,a,l,s,c=0,u=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(rxo);e=Gze(e)||0,oxo(n)&&(u=!!n.leading,d="maxWait"in n,i=d?ixo(Gze(n.maxWait)||0,e):i,f="trailing"in n?!!n.trailing:f);function p(A){var x=o,S=r;return o=r=void 0,c=A,a=t.apply(S,x),a}function g(A){return c=A,l=setTimeout(b,e),u?p(A):a}function y(A){var x=A-s,S=A-c,R=e-x;return d?axo(R,i-S):R}function w(A){var x=A-s,S=A-c;return s===void 0||x>=e||x<0||d&&S>=i}function b(){var A=gle();if(w(A))return C(A);l=setTimeout(b,y(A))}function C(A){return l=void 0,f&&o?p(A):(o=r=void 0,a)}function P(){l!==void 0&&clearTimeout(l),c=0,o=s=r=l=void 0}function v(){return l===void 0?a:C(gle())}function T(){var A=gle(),x=w(A);if(o=arguments,r=this,s=A,x){if(l===void 0)return g(s);if(d)return clearTimeout(l),l=setTimeout(b,e),p(s)}return l===void 0&&(l=setTimeout(b,e)),a}return T.cancel=P,T.flush=v,T}var sxo=lxo,cxo=sxo,uxo=c5,dxo="Expected a function";function fxo(t,e,n){var o=!0,r=!0;if(typeof t!="function")throw new TypeError(dxo);return uxo(n)&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),cxo(t,e,{leading:o,maxWait:e,trailing:r})}var hxo=fxo;const vlt=Fi(hxo);function oL(t){"@babel/helpers - typeof";return oL=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},oL(t)}function Xze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function KO(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n0&&(W=vlt(W,y,{trailing:!0,leading:!1}));var j=new ResizeObserver(W),L=T.current.getBoundingClientRect(),k=L.width,N=L.height;return D(k,N),j.observe(T.current),function(){j.disconnect()}},[D,y]);var E=m.useMemo(function(){var W=R.containerWidth,j=R.containerHeight;if(W<0||j<0)return null;B6($v(a)||$v(s),`The width(%s) and height(%s) are both fixed numbers, + A`).concat(a,",").concat(a,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(o.type==="rect")return be.createElement("path",{stroke:"none",fill:s,d:"M0,".concat(xm/8,"h").concat(xm,"v").concat(xm*3/4,"h").concat(-xm,"z"),className:"recharts-legend-icon"});if(be.isValidElement(o.legendIcon)){var c=ewo({},o);return delete c.legendIcon,be.cloneElement(o.legendIcon,c)}return be.createElement(Xee,{fill:s,cx:i,cy:i,size:xm,sizeType:"diameter",type:o.type})}},{key:"renderItems",value:function(){var o=this,r=this.props,i=r.payload,a=r.iconSize,l=r.layout,s=r.formatter,c=r.inactiveColor,u={x:0,y:0,width:xm,height:xm},d={display:l==="horizontal"?"inline-block":"block",marginRight:10},f={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(p,g){var y=p.formatter||s,w=fl(eL(eL({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",p.inactive));if(p.type==="none")return null;var b=va(p.value)?null:p.value;B6(!va(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var C=p.inactive?c:p.color;return be.createElement("li",ahe({className:w,style:d,key:"legend-item-".concat(g)},Qk(o.props,p,g)),be.createElement($fe,{width:a,height:a,viewBox:u,style:f},o.renderIcon(p)),be.createElement("span",{className:"recharts-legend-item-text",style:{color:C}},y?y(b,p,g):b))})}},{key:"render",value:function(){var o=this.props,r=o.payload,i=o.layout,a=o.align;if(!r||!r.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?a:"left"};return be.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}]),e}(m.PureComponent);eL(R3e,"displayName","Legend");eL(R3e,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});function cwo(t,e,n,o){for(var r=t.length,i=n+(o?1:-1);o?i--:++i-1}var xwo=vwo;function bwo(t,e,n){for(var o=-1,r=t==null?0:t.length;++o=Wwo){var c=e?null:kwo(t);if(c)return Lwo(c);a=!1,r=Fwo,s=new zwo}else s=e?[]:l;e:for(;++o=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function Qwo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function Zwo(t){return t.value}function e7o(t,e){if(be.isValidElement(t))return be.cloneElement(t,e);if(typeof t=="function")return be.createElement(t,e);e.ref;var n=$wo(e,_wo);return be.createElement(R3e,n)}var Ize=1,J2=function(t){Kwo(e,t);function e(){var n;Vwo(this,e);for(var o=arguments.length,r=new Array(o),i=0;iIze||Math.abs(r.height-this.lastBoundingBox.height)>Ize)&&(this.lastBoundingBox.width=r.width,this.lastBoundingBox.height=r.height,o&&o(r)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,o&&o(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?nv({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(o){var r=this.props,i=r.layout,a=r.align,l=r.verticalAlign,s=r.margin,c=r.chartWidth,u=r.chartHeight,d,f;if(!o||(o.left===void 0||o.left===null)&&(o.right===void 0||o.right===null))if(a==="center"&&i==="vertical"){var p=this.getBBoxSnapshot();d={left:((c||0)-p.width)/2}}else d=a==="right"?{right:s&&s.right||0}:{left:s&&s.left||0};if(!o||(o.top===void 0||o.top===null)&&(o.bottom===void 0||o.bottom===null))if(l==="middle"){var g=this.getBBoxSnapshot();f={top:((u||0)-g.height)/2}}else f=l==="bottom"?{bottom:s&&s.bottom||0}:{top:s&&s.top||0};return nv(nv({},d),f)}},{key:"render",value:function(){var o=this,r=this.props,i=r.content,a=r.width,l=r.height,s=r.wrapperStyle,c=r.payloadUniqBy,u=r.payload,d=nv(nv({position:"absolute",width:a||"auto",height:l||"auto"},this.getDefaultPosition(s)),s);return be.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){o.wrapperNode=p}},e7o(i,nv(nv({},this.props),{},{payload:clt(u,c,Zwo)})))}}],[{key:"getWithHeight",value:function(o,r){var i=o.props.layout;return i==="vertical"&&dr(o.props.height)?{height:o.props.height}:i==="horizontal"?{width:o.props.width||r}:null}}]),e}(m.PureComponent);Jee(J2,"displayName","Legend");Jee(J2,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var zze=dM,t7o=D5e,n7o=vp,Dze=zze?zze.isConcatSpreadable:void 0;function o7o(t){return n7o(t)||t7o(t)||!!(Dze&&t&&t[Dze])}var r7o=o7o,i7o=X5e,a7o=r7o;function hlt(t,e,n,o,r){var i=-1,a=t.length;for(n||(n=a7o),r||(r=[]);++i0&&n(l)?e>1?hlt(l,e-1,n,o,r):i7o(r,l):o||(r[r.length]=l)}return r}var plt=hlt;function l7o(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}var s7o=l7o,Eze=vM;function c7o(t,e){if(t!==e){var n=t!==void 0,o=t===null,r=t===t,i=Eze(t),a=e!==void 0,l=e===null,s=e===e,c=Eze(e);if(!l&&!c&&!i&&t>e||i&&a&&s&&!l&&!c||o&&a&&s||!n&&s||!r)return 1;if(!o&&!i&&!c&&t=l)return s;var c=n[o];return s*(c=="desc"?-1:1)}}return t.index-e.index}var h7o=f7o,hle=Y5e,p7o=Q5e,g7o=Xw,m7o=Eot,y7o=s7o,A7o=JZ,w7o=h7o,v7o=Qb,x7o=vp;function b7o(t,e,n){e.length?e=hle(e,function(i){return x7o(i)?function(a){return p7o(a,i.length===1?i[0]:i)}:i}):e=[v7o];var o=-1;e=hle(e,A7o(g7o));var r=m7o(t,function(i,a,l){var s=hle(e,function(c){return c(i)});return{criteria:s,index:++o,value:i}});return y7o(r,function(i,a){return w7o(i,a,n)})}var S7o=b7o;function T7o(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var P7o=T7o,C7o=P7o,Fze=Math.max;function R7o(t,e,n){return e=Fze(e===void 0?t.length-1:e,0),function(){for(var o=arguments,r=-1,i=Fze(o.length-e,0),a=Array(i);++r0){if(++e>=k7o)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var U7o=N7o,j7o=F7o,B7o=U7o,Y7o=B7o(j7o),O7o=Y7o,_7o=Qb,V7o=H7o,G7o=O7o;function X7o(t,e){return G7o(V7o(t,e,_7o),t+"")}var J7o=X7o,K7o=KZ,q7o=hM,$7o=F5e,Q7o=c5;function Z7o(t,e,n){if(!Q7o(n))return!1;var o=typeof e;return(o=="number"?q7o(n)&&$7o(e,n.length):o=="string"&&e in n)?K7o(n[e],t):!1}var Kee=Z7o,evo=plt,tvo=S7o,nvo=J7o,Lze=Kee,ovo=nvo(function(t,e){if(t==null)return[];var n=e.length;return n>1&&Lze(t,e[0],e[1])?e=[]:n>2&&Lze(e[0],e[1],e[2])&&(e=[e[0]]),tvo(t,evo(e,1),[])}),rvo=ovo;const H3e=Fi(rvo);function tL(t){"@babel/helpers - typeof";return tL=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},tL(t)}function che(){return che=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=e.x),"".concat(sD,"-left"),dr(n)&&e&&dr(e.x)&&n=e.y),"".concat(sD,"-top"),dr(o)&&e&&dr(e.y)&&oy?Math.max(u,s[o]):Math.max(d,s[o])}function wvo(t){var e=t.translateX,n=t.translateY,o=t.useTranslate3d;return{transform:o?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function vvo(t){var e=t.allowEscapeViewBox,n=t.coordinate,o=t.offsetTopLeft,r=t.position,i=t.reverseDirection,a=t.tooltipBox,l=t.useTranslate3d,s=t.viewBox,c,u,d;return a.height>0&&a.width>0&&n?(u=Uze({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:o,position:r,reverseDirection:i,tooltipDimension:a.width,viewBox:s,viewBoxDimension:s.width}),d=Uze({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:o,position:r,reverseDirection:i,tooltipDimension:a.height,viewBox:s,viewBoxDimension:s.height}),c=wvo({translateX:u,translateY:d,useTranslate3d:l})):c=yvo,{cssProperties:c,cssClasses:Avo({translateX:u,translateY:d,coordinate:n})}}function iH(t){"@babel/helpers - typeof";return iH=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},iH(t)}function jze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Bze(t){for(var e=1;eYze||Math.abs(o.height-this.state.lastBoundingBox.height)>Yze)&&this.setState({lastBoundingBox:{width:o.width,height:o.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var o,r;this.props.active&&this.updateBBox(),this.state.dismissed&&(((o=this.props.coordinate)===null||o===void 0?void 0:o.x)!==this.state.dismissedAtCoordinate.x||((r=this.props.coordinate)===null||r===void 0?void 0:r.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var o=this,r=this.props,i=r.active,a=r.allowEscapeViewBox,l=r.animationDuration,s=r.animationEasing,c=r.children,u=r.coordinate,d=r.hasPayload,f=r.isAnimationActive,p=r.offset,g=r.position,y=r.reverseDirection,w=r.useTranslate3d,b=r.viewBox,C=r.wrapperStyle,P=vvo({allowEscapeViewBox:a,coordinate:u,offsetTopLeft:p,position:g,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:b}),v=P.cssClasses,T=P.cssProperties,A=Bze(Bze({transition:f&&i?"transform ".concat(l,"ms ").concat(s):void 0},T),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&d?"visible":"hidden",position:"absolute",top:0,left:0},C);return be.createElement("div",{tabIndex:-1,className:v,style:A,ref:function(S){o.wrapperNode=S}},c)}}]),e}(m.PureComponent),Mvo=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},B2={isSsr:Mvo(),get:function(e){return B2[e]},set:function(e,n){if(typeof e=="string")B2[e]=n;else{var o=Object.keys(e);o&&o.length&&o.forEach(function(r){B2[r]=e[r]})}}};function aH(t){"@babel/helpers - typeof";return aH=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},aH(t)}function Oze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function _ze(t){for(var e=1;e0;return be.createElement(Hvo,{allowEscapeViewBox:a,animationDuration:l,animationEasing:s,isAnimationActive:f,active:i,coordinate:u,hasPayload:A,offset:p,position:w,reverseDirection:b,useTranslate3d:C,viewBox:P,wrapperStyle:v},Uvo(c,_ze(_ze({},this.props),{},{payload:T})))}}]),e}(m.PureComponent);M3e(rh,"displayName","Tooltip");M3e(rh,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!B2.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var jvo=l5,Bvo=function(){return jvo.Date.now()},Yvo=Bvo,Ovo=/\s/;function _vo(t){for(var e=t.length;e--&&Ovo.test(t.charAt(e)););return e}var Vvo=_vo,Gvo=Vvo,Xvo=/^\s+/;function Jvo(t){return t&&t.slice(0,Gvo(t)+1).replace(Xvo,"")}var Kvo=Jvo,qvo=Kvo,Vze=c5,$vo=vM,Gze=NaN,Qvo=/^[-+]0x[0-9a-f]+$/i,Zvo=/^0b[01]+$/i,exo=/^0o[0-7]+$/i,txo=parseInt;function nxo(t){if(typeof t=="number")return t;if($vo(t))return Gze;if(Vze(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Vze(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=qvo(t);var n=Zvo.test(t);return n||exo.test(t)?txo(t.slice(2),n?2:8):Qvo.test(t)?Gze:+t}var wlt=nxo,oxo=c5,gle=Yvo,Xze=wlt,rxo="Expected a function",ixo=Math.max,axo=Math.min;function lxo(t,e,n){var o,r,i,a,l,s,c=0,u=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(rxo);e=Xze(e)||0,oxo(n)&&(u=!!n.leading,d="maxWait"in n,i=d?ixo(Xze(n.maxWait)||0,e):i,f="trailing"in n?!!n.trailing:f);function p(A){var x=o,S=r;return o=r=void 0,c=A,a=t.apply(S,x),a}function g(A){return c=A,l=setTimeout(b,e),u?p(A):a}function y(A){var x=A-s,S=A-c,R=e-x;return d?axo(R,i-S):R}function w(A){var x=A-s,S=A-c;return s===void 0||x>=e||x<0||d&&S>=i}function b(){var A=gle();if(w(A))return C(A);l=setTimeout(b,y(A))}function C(A){return l=void 0,f&&o?p(A):(o=r=void 0,a)}function P(){l!==void 0&&clearTimeout(l),c=0,o=s=r=l=void 0}function v(){return l===void 0?a:C(gle())}function T(){var A=gle(),x=w(A);if(o=arguments,r=this,s=A,x){if(l===void 0)return g(s);if(d)return clearTimeout(l),l=setTimeout(b,e),p(s)}return l===void 0&&(l=setTimeout(b,e)),a}return T.cancel=P,T.flush=v,T}var sxo=lxo,cxo=sxo,uxo=c5,dxo="Expected a function";function fxo(t,e,n){var o=!0,r=!0;if(typeof t!="function")throw new TypeError(dxo);return uxo(n)&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),cxo(t,e,{leading:o,maxWait:e,trailing:r})}var hxo=fxo;const vlt=Fi(hxo);function oL(t){"@babel/helpers - typeof";return oL=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},oL(t)}function Jze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function qO(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n0&&(W=vlt(W,y,{trailing:!0,leading:!1}));var j=new ResizeObserver(W),L=T.current.getBoundingClientRect(),k=L.width,N=L.height;return D(k,N),j.observe(T.current),function(){j.disconnect()}},[D,y]);var E=m.useMemo(function(){var W=R.containerWidth,j=R.containerHeight;if(W<0||j<0)return null;B6($v(a)||$v(s),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,a,s),B6(!n||n>0,"The aspect(%s) must be greater than zero.",n);var L=$v(a)?W:a,k=$v(s)?j:s;n&&n>0&&(L?k=L/n:k&&(L=k*n),f&&k>f&&(k=f)),B6(L>0||k>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,L,k,a,s,u,d,n);var N=!Array.isArray(p)&&Gfe.isElement(p)&&j6(p.type).endsWith("Chart");return be.Children.map(p,function(F){return Gfe.isElement(F)?m.cloneElement(F,KO({width:L,height:k},N?{style:KO({height:"100%",width:"100%",maxHeight:k,maxWidth:L},F.props.style)}:{})):F})},[n,p,s,f,d,u,R,a]);return be.createElement("div",{id:w?"".concat(w):void 0,className:fl("recharts-responsive-container",b),style:KO(KO({},v),{},{width:a,height:s,minWidth:u,minHeight:d,maxHeight:f}),ref:T},E)}),M3e=function(e){return null};M3e.displayName="Cell";function rL(t){"@babel/helpers - typeof";return rL=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},rL(t)}function Kze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function phe(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||B2.isSsr)return{width:0,height:0};var o=Rxo(n),r=JSON.stringify({text:e,copyStyle:o});if($T.widthCache[r])return $T.widthCache[r];try{var i=document.getElementById(qze);i||(i=document.createElement("span"),i.setAttribute("id",qze),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var a=phe(phe({},Cxo),o);Object.assign(i.style,a),i.textContent="".concat(e);var l=i.getBoundingClientRect(),s={width:l.width,height:l.height};return $T.widthCache[r]=s,++$T.cacheCount>Pxo&&($T.cacheCount=0,$T.widthCache={}),s}catch{return{width:0,height:0}}},Hxo=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function iL(t){"@babel/helpers - typeof";return iL=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},iL(t)}function BJ(t,e){return Dxo(t)||zxo(t,e)||Ixo(t,e)||Mxo()}function Mxo(){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 Ixo(t,e){if(t){if(typeof t=="string")return $ze(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $ze(t,e)}}function $ze(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function Gxo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function oDe(t,e){return qxo(t)||Kxo(t,e)||Jxo(t,e)||Xxo()}function Xxo(){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 Jxo(t,e){if(t){if(typeof t=="string")return rDe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rDe(t,e)}}function rDe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function(k,N){var F=N.word,U=N.width,O=k[k.length-1];if(O&&(r==null||i||O.width+U+oN.width?k:N})};if(!u)return p;for(var y="…",w=function(L){var k=d.slice(0,L),N=Tlt({breakAll:c,style:s,children:k+y}).wordsWithComputedWidth,F=f(N),U=F.length>a||g(F).width>Number(r);return[U,F]},b=0,C=d.length-1,P=0,v;b<=C&&P<=d.length-1;){var T=Math.floor((b+C)/2),A=T-1,x=w(A),S=oDe(x,2),R=S[0],M=S[1],D=w(T),E=oDe(D,1),W=E[0];if(!R&&!W&&(b=T+1),R&&W&&(C=T-1),!R&&W){v=M;break}P++}return v||p},iDe=function(e){var n=ia(e)?[]:e.toString().split(Slt);return[{words:n}]},Qxo=function(e){var n=e.width,o=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,l=e.maxLines;if((n||o)&&!B2.isSsr){var s,c,u=Tlt({breakAll:a,children:r,style:i});if(u){var d=u.wordsWithComputedWidth,f=u.spaceWidth;s=d,c=f}else return iDe(r);return $xo({breakAll:a,children:r,maxLines:l,style:i},s,c,n,o)}return iDe(r)},aDe="#808080",YJ=function(e){var n=e.x,o=n===void 0?0:n,r=e.y,i=r===void 0?0:r,a=e.lineHeight,l=a===void 0?"1em":a,s=e.capHeight,c=s===void 0?"0.71em":s,u=e.scaleToFit,d=u===void 0?!1:u,f=e.textAnchor,p=f===void 0?"start":f,g=e.verticalAnchor,y=g===void 0?"end":g,w=e.fill,b=w===void 0?aDe:w,C=nDe(e,_xo),P=m.useMemo(function(){return Qxo({breakAll:C.breakAll,children:C.children,maxLines:C.maxLines,scaleToFit:d,style:C.style,width:C.width})},[C.breakAll,C.children,C.maxLines,d,C.style,C.width]),v=C.dx,T=C.dy,A=C.angle,x=C.className,S=C.breakAll,R=nDe(C,Vxo);if(!Nu(o)||!Nu(i))return null;var M=o+(dr(v)?v:0),D=i+(dr(T)?T:0),E;switch(y){case"start":E=mle("calc(".concat(c,")"));break;case"middle":E=mle("calc(".concat((P.length-1)/2," * -").concat(l," + (").concat(c," / 2))"));break;default:E=mle("calc(".concat(P.length-1," * -").concat(l,")"));break}var W=[];if(d){var j=P[0].width,L=C.width;W.push("scale(".concat((dr(L)?L/j:1)/j,")"))}return A&&W.push("rotate(".concat(A,", ").concat(M,", ").concat(D,")")),W.length&&(R.transform=W.join(" ")),be.createElement("text",ghe({},ra(R,!0),{x:M,y:D,className:fl("recharts-text",x),textAnchor:p,fill:b.includes("url")?aDe:b}),P.map(function(k,N){var F=k.words.join(S?"":" ");return be.createElement("tspan",{x:M,dy:N===0?E:l,key:F},F)}))};function X8(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function Zxo(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function I3e(t){let e,n,o;t.length!==2?(e=X8,n=(l,s)=>X8(t(l),s),o=(l,s)=>t(l)-s):(e=t===X8||t===Zxo?t:ebo,n=t,o=t);function r(l,s,c=0,u=l.length){if(c>>1;n(l[d],s)<0?c=d+1:u=d}while(c>>1;n(l[d],s)<=0?c=d+1:u=d}while(cc&&o(l[d-1],s)>-o(l[d],s)?d-1:d}return{left:r,center:a,right:i}}function ebo(){return 0}function Plt(t){return t===null?NaN:+t}function*tbo(t,e){for(let n of t)n!=null&&(n=+n)>=n&&(yield n)}const nbo=I3e(X8),sU=nbo.right;I3e(Plt).center;class lDe extends Map{constructor(e,n=ibo){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[o,r]of e)this.set(o,r)}get(e){return super.get(sDe(this,e))}has(e){return super.has(sDe(this,e))}set(e,n){return super.set(obo(this,e),n)}delete(e){return super.delete(rbo(this,e))}}function sDe({_intern:t,_key:e},n){const o=e(n);return t.has(o)?t.get(o):n}function obo({_intern:t,_key:e},n){const o=e(n);return t.has(o)?t.get(o):(t.set(o,n),n)}function rbo({_intern:t,_key:e},n){const o=e(n);return t.has(o)&&(n=t.get(o),t.delete(o)),n}function ibo(t){return t!==null&&typeof t=="object"?t.valueOf():t}function abo(t=X8){if(t===X8)return Clt;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const o=t(e,n);return o||o===0?o:(t(n,n)===0)-(t(e,e)===0)}}function Clt(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const lbo=Math.sqrt(50),sbo=Math.sqrt(10),cbo=Math.sqrt(2);function OJ(t,e,n){const o=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(o)),i=o/Math.pow(10,r),a=i>=lbo?10:i>=sbo?5:i>=cbo?2:1;let l,s,c;return r<0?(c=Math.pow(10,-r)/a,l=Math.round(t*c),s=Math.round(e*c),l/ce&&--s,c=-c):(c=Math.pow(10,r)*a,l=Math.round(t/c),s=Math.round(e/c),l*ce&&--s),s0))return[];if(t===e)return[t];const o=e=r))return[];const l=i-r+1,s=new Array(l);if(o)if(a<0)for(let c=0;c=o)&&(n=o);return n}function uDe(t,e){let n;for(const o of t)o!=null&&(n>o||n===void 0&&o>=o)&&(n=o);return n}function Rlt(t,e,n=0,o=1/0,r){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),o=Math.floor(Math.min(t.length-1,o)),!(n<=e&&e<=o))return t;for(r=r===void 0?Clt:abo(r);o>n;){if(o-n>600){const s=o-n+1,c=e-n+1,u=Math.log(s),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(s-d)/s)*(c-s/2<0?-1:1),p=Math.max(n,Math.floor(e-c*d/s+f)),g=Math.min(o,Math.floor(e+(s-c)*d/s+f));Rlt(t,e,p,g,r)}const i=t[e];let a=n,l=o;for(cD(t,n,e),r(t[o],i)>0&&cD(t,n,o);a0;)--l}r(t[n],i)===0?cD(t,n,l):(++l,cD(t,l,o)),l<=e&&(n=l+1),e<=l&&(o=l-1)}return t}function cD(t,e,n){const o=t[e];t[e]=t[n],t[n]=o}function ubo(t,e,n){if(t=Float64Array.from(tbo(t)),!(!(o=t.length)||isNaN(e=+e))){if(e<=0||o<2)return uDe(t);if(e>=1)return cDe(t);var o,r=(o-1)*e,i=Math.floor(r),a=cDe(Rlt(t,i).subarray(0,i+1)),l=uDe(t.subarray(i+1));return a+(l-a)*(r-i)}}function dbo(t,e,n=Plt){if(!(!(o=t.length)||isNaN(e=+e))){if(e<=0||o<2)return+n(t[0],0,t);if(e>=1)return+n(t[o-1],o-1,t);var o,r=(o-1)*e,i=Math.floor(r),a=+n(t[i],i,t),l=+n(t[i+1],i+1,t);return a+(l-a)*(r-i)}}function fbo(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var o=-1,r=Math.max(0,Math.ceil((e-t)/n))|0,i=new Array(r);++o>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?$O(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?$O(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=pbo.exec(t))?new Jp(e[1],e[2],e[3],1):(e=gbo.exec(t))?new Jp(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=mbo.exec(t))?$O(e[1],e[2],e[3],e[4]):(e=ybo.exec(t))?$O(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Abo.exec(t))?yDe(e[1],e[2]/100,e[3]/100,1):(e=wbo.exec(t))?yDe(e[1],e[2]/100,e[3]/100,e[4]):dDe.hasOwnProperty(t)?pDe(dDe[t]):t==="transparent"?new Jp(NaN,NaN,NaN,0):null}function pDe(t){return new Jp(t>>16&255,t>>8&255,t&255,1)}function $O(t,e,n,o){return o<=0&&(t=e=n=NaN),new Jp(t,e,n,o)}function bbo(t){return t instanceof cU||(t=cL(t)),t?(t=t.rgb(),new Jp(t.r,t.g,t.b,t.opacity)):new Jp}function vhe(t,e,n,o){return arguments.length===1?bbo(t):new Jp(t,e,n,o??1)}function Jp(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}z3e(Jp,vhe,Mlt(cU,{brighter(t){return t=t==null?_J:Math.pow(_J,t),new Jp(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?lL:Math.pow(lL,t),new Jp(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Jp(Mx(this.r),Mx(this.g),Mx(this.b),VJ(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gDe,formatHex:gDe,formatHex8:Sbo,formatRgb:mDe,toString:mDe}));function gDe(){return`#${Qv(this.r)}${Qv(this.g)}${Qv(this.b)}`}function Sbo(){return`#${Qv(this.r)}${Qv(this.g)}${Qv(this.b)}${Qv((isNaN(this.opacity)?1:this.opacity)*255)}`}function mDe(){const t=VJ(this.opacity);return`${t===1?"rgb(":"rgba("}${Mx(this.r)}, ${Mx(this.g)}, ${Mx(this.b)}${t===1?")":`, ${t})`}`}function VJ(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Mx(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Qv(t){return t=Mx(t),(t<16?"0":"")+t.toString(16)}function yDe(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new w2(t,e,n,o)}function Ilt(t){if(t instanceof w2)return new w2(t.h,t.s,t.l,t.opacity);if(t instanceof cU||(t=cL(t)),!t)return new w2;if(t instanceof w2)return t;t=t.rgb();var e=t.r/255,n=t.g/255,o=t.b/255,r=Math.min(e,n,o),i=Math.max(e,n,o),a=NaN,l=i-r,s=(i+r)/2;return l?(e===i?a=(n-o)/l+(n0&&s<1?0:a,new w2(a,l,s,t.opacity)}function Tbo(t,e,n,o){return arguments.length===1?Ilt(t):new w2(t,e,n,o??1)}function w2(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}z3e(w2,Tbo,Mlt(cU,{brighter(t){return t=t==null?_J:Math.pow(_J,t),new w2(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?lL:Math.pow(lL,t),new w2(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,r=2*n-o;return new Jp(yle(t>=240?t-240:t+120,r,o),yle(t,r,o),yle(t<120?t+240:t-120,r,o),this.opacity)},clamp(){return new w2(ADe(this.h),QO(this.s),QO(this.l),VJ(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=VJ(this.opacity);return`${t===1?"hsl(":"hsla("}${ADe(this.h)}, ${QO(this.s)*100}%, ${QO(this.l)*100}%${t===1?")":`, ${t})`}`}}));function ADe(t){return t=(t||0)%360,t<0?t+360:t}function QO(t){return Math.max(0,Math.min(1,t||0))}function yle(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const D3e=t=>()=>t;function Pbo(t,e){return function(n){return t+n*e}}function Cbo(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}function Rbo(t){return(t=+t)==1?zlt:function(e,n){return n-e?Cbo(e,n,t):D3e(isNaN(e)?n:e)}}function zlt(t,e){var n=e-t;return n?Pbo(t,n):D3e(isNaN(t)?e:t)}const wDe=function t(e){var n=Rbo(e);function o(r,i){var a=n((r=vhe(r)).r,(i=vhe(i)).r),l=n(r.g,i.g),s=n(r.b,i.b),c=zlt(r.opacity,i.opacity);return function(u){return r.r=a(u),r.g=l(u),r.b=s(u),r.opacity=c(u),r+""}}return o.gamma=t,o}(1);function Hbo(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,o=e.slice(),r;return function(i){for(r=0;rn&&(i=e.slice(n,i),l[a]?l[a]+=i:l[++a]=i),(o=o[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,s.push({i:a,x:GJ(o,r)})),n=Ale.lastIndex;return ne&&(n=t,t=e,e=n),function(o){return Math.max(t,Math.min(e,o))}}function Ubo(t,e,n){var o=t[0],r=t[1],i=e[0],a=e[1];return r2?jbo:Ubo,s=c=null,d}function d(f){return f==null||isNaN(f=+f)?i:(s||(s=l(t.map(o),e,n)))(o(a(f)))}return d.invert=function(f){return a(r((c||(c=l(e,t.map(o),GJ)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,XJ),u()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),u()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),n=E3e,u()},d.clamp=function(f){return arguments.length?(a=f?!0:sp,u()):a!==sp},d.interpolate=function(f){return arguments.length?(n=f,u()):n},d.unknown=function(f){return arguments.length?(i=f,d):i},function(f,p){return o=f,r=p,u()}}function F3e(){return $ee()(sp,sp)}function Bbo(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function JJ(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,o=t.slice(0,n);return[o.length>1?o[0]+o.slice(2):o,+t.slice(n+1)]}function lH(t){return t=JJ(Math.abs(t)),t?t[1]:NaN}function Ybo(t,e){return function(n,o){for(var r=n.length,i=[],a=0,l=t[0],s=0;r>0&&l>0&&(s+l+1>o&&(l=Math.max(1,o-s)),i.push(n.substring(r-=l,r+l)),!((s+=l+1)>o));)l=t[a=(a+1)%t.length];return i.reverse().join(e)}}function Obo(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var _bo=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function uL(t){if(!(e=_bo.exec(t)))throw new Error("invalid format: "+t);var e;return new k3e({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}uL.prototype=k3e.prototype;function k3e(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}k3e.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Vbo(t){e:for(var e=t.length,n=1,o=-1,r;n0&&(o=0);break}return o>0?t.slice(0,o)+t.slice(r+1):t}var Dlt;function Gbo(t,e){var n=JJ(t,e);if(!n)return t+"";var o=n[0],r=n[1],i=r-(Dlt=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=o.length;return i===a?o:i>a?o+new Array(i-a+1).join("0"):i>0?o.slice(0,i)+"."+o.slice(i):"0."+new Array(1-i).join("0")+JJ(t,Math.max(0,e+i-1))[0]}function xDe(t,e){var n=JJ(t,e);if(!n)return t+"";var o=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+o:o.length>r+1?o.slice(0,r+1)+"."+o.slice(r+1):o+new Array(r-o.length+2).join("0")}const bDe={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Bbo,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>xDe(t*100,e),r:xDe,s:Gbo,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function SDe(t){return t}var TDe=Array.prototype.map,PDe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Xbo(t){var e=t.grouping===void 0||t.thousands===void 0?SDe:Ybo(TDe.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",o=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?SDe:Obo(TDe.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",l=t.minus===void 0?"−":t.minus+"",s=t.nan===void 0?"NaN":t.nan+"";function c(d){d=uL(d);var f=d.fill,p=d.align,g=d.sign,y=d.symbol,w=d.zero,b=d.width,C=d.comma,P=d.precision,v=d.trim,T=d.type;T==="n"?(C=!0,T="g"):bDe[T]||(P===void 0&&(P=12),v=!0,T="g"),(w||f==="0"&&p==="=")&&(w=!0,f="0",p="=");var A=y==="$"?n:y==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",x=y==="$"?o:/[%p]/.test(T)?a:"",S=bDe[T],R=/[defgprs%]/.test(T);P=P===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function M(D){var E=A,W=x,j,L,k;if(T==="c")W=S(D)+W,D="";else{D=+D;var N=D<0||1/D<0;if(D=isNaN(D)?s:S(Math.abs(D),P),v&&(D=Vbo(D)),N&&+D==0&&g!=="+"&&(N=!1),E=(N?g==="("?g:l:g==="-"||g==="("?"":g)+E,W=(T==="s"?PDe[8+Dlt/3]:"")+W+(N&&g==="("?")":""),R){for(j=-1,L=D.length;++jk||k>57){W=(k===46?r+D.slice(j+1):D.slice(j))+W,D=D.slice(0,j);break}}}C&&!w&&(D=e(D,1/0));var F=E.length+D.length+W.length,U=F>1)+E+D+W+U.slice(F);break;default:D=U+E+D+W;break}return i(D)}return M.toString=function(){return d+""},M}function u(d,f){var p=c((d=uL(d),d.type="f",d)),g=Math.max(-8,Math.min(8,Math.floor(lH(f)/3)))*3,y=Math.pow(10,-g),w=PDe[8+g/3];return function(b){return p(y*b)+w}}return{format:c,formatPrefix:u}}var ZO,L3e,Elt;Jbo({thousands:",",grouping:[3],currency:["$",""]});function Jbo(t){return ZO=Xbo(t),L3e=ZO.format,Elt=ZO.formatPrefix,ZO}function Kbo(t){return Math.max(0,-lH(Math.abs(t)))}function qbo(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(lH(e)/3)))*3-lH(Math.abs(t)))}function $bo(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,lH(e)-lH(t))+1}function Flt(t,e,n,o){var r=Ahe(t,e,n),i;switch(o=uL(o??",f"),o.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return o.precision==null&&!isNaN(i=qbo(r,a))&&(o.precision=i),Elt(o,a)}case"":case"e":case"g":case"p":case"r":{o.precision==null&&!isNaN(i=$bo(r,Math.max(Math.abs(t),Math.abs(e))))&&(o.precision=i-(o.type==="e"));break}case"f":case"%":{o.precision==null&&!isNaN(i=Kbo(r))&&(o.precision=i-(o.type==="%")*2);break}}return L3e(o)}function $w(t){var e=t.domain;return t.ticks=function(n){var o=e();return mhe(o[0],o[o.length-1],n??10)},t.tickFormat=function(n,o){var r=e();return Flt(r[0],r[r.length-1],n??10,o)},t.nice=function(n){n==null&&(n=10);var o=e(),r=0,i=o.length-1,a=o[r],l=o[i],s,c,u=10;for(l0;){if(c=yhe(a,l,n),c===s)return o[r]=a,o[i]=l,e(o);if(c>0)a=Math.floor(a/c)*c,l=Math.ceil(l/c)*c;else if(c<0)a=Math.ceil(a*c)/c,l=Math.floor(l*c)/c;else break;s=c}return t},t}function dL(){var t=F3e();return t.copy=function(){return uU(t,dL())},gy.apply(t,arguments),$w(t)}function klt(t){var e;function n(o){return o==null||isNaN(o=+o)?e:o}return n.invert=n,n.domain=n.range=function(o){return arguments.length?(t=Array.from(o,XJ),n):t.slice()},n.unknown=function(o){return arguments.length?(e=o,n):e},n.copy=function(){return klt(t).unknown(e)},t=arguments.length?Array.from(t,XJ):[0,1],$w(n)}function Llt(t,e){t=t.slice();var n=0,o=t.length-1,r=t[n],i=t[o],a;return iMath.pow(t,e)}function nSo(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function HDe(t){return(e,n)=>-t(-e,n)}function W3e(t){const e=t(CDe,RDe),n=e.domain;let o=10,r,i;function a(){return r=nSo(o),i=tSo(o),n()[0]<0?(r=HDe(r),i=HDe(i),t(Qbo,Zbo)):t(CDe,RDe),e}return e.base=function(l){return arguments.length?(o=+l,a()):o},e.domain=function(l){return arguments.length?(n(l),a()):n()},e.ticks=l=>{const s=n();let c=s[0],u=s[s.length-1];const d=u0){for(;f<=p;++f)for(g=1;gu)break;b.push(y)}}else for(;f<=p;++f)for(g=o-1;g>=1;--g)if(y=f>0?g/i(-f):g*i(f),!(yu)break;b.push(y)}b.length*2{if(l==null&&(l=10),s==null&&(s=o===10?"s":","),typeof s!="function"&&(!(o%1)&&(s=uL(s)).precision==null&&(s.trim=!0),s=L3e(s)),l===1/0)return s;const c=Math.max(1,o*l/e.ticks().length);return u=>{let d=u/i(Math.round(r(u)));return d*on(Llt(n(),{floor:l=>i(Math.floor(r(l))),ceil:l=>i(Math.ceil(r(l)))})),e}function Wlt(){const t=W3e($ee()).domain([1,10]);return t.copy=()=>uU(t,Wlt()).base(t.base()),gy.apply(t,arguments),t}function MDe(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function IDe(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function N3e(t){var e=1,n=t(MDe(e),IDe(e));return n.constant=function(o){return arguments.length?t(MDe(e=+o),IDe(e)):e},$w(n)}function Nlt(){var t=N3e($ee());return t.copy=function(){return uU(t,Nlt()).constant(t.constant())},gy.apply(t,arguments)}function zDe(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function oSo(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function rSo(t){return t<0?-t*t:t*t}function U3e(t){var e=t(sp,sp),n=1;function o(){return n===1?t(sp,sp):n===.5?t(oSo,rSo):t(zDe(n),zDe(1/n))}return e.exponent=function(r){return arguments.length?(n=+r,o()):n},$w(e)}function j3e(){var t=U3e($ee());return t.copy=function(){return uU(t,j3e()).exponent(t.exponent())},gy.apply(t,arguments),t}function iSo(){return j3e.apply(null,arguments).exponent(.5)}function DDe(t){return Math.sign(t)*t*t}function aSo(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function Ult(){var t=F3e(),e=[0,1],n=!1,o;function r(i){var a=aSo(t(i));return isNaN(a)?o:n?Math.round(a):a}return r.invert=function(i){return t.invert(DDe(i))},r.domain=function(i){return arguments.length?(t.domain(i),r):t.domain()},r.range=function(i){return arguments.length?(t.range((e=Array.from(i,XJ)).map(DDe)),r):e.slice()},r.rangeRound=function(i){return r.range(i).round(!0)},r.round=function(i){return arguments.length?(n=!!i,r):n},r.clamp=function(i){return arguments.length?(t.clamp(i),r):t.clamp()},r.unknown=function(i){return arguments.length?(o=i,r):o},r.copy=function(){return Ult(t.domain(),e).round(n).clamp(t.clamp()).unknown(o)},gy.apply(r,arguments),$w(r)}function jlt(){var t=[],e=[],n=[],o;function r(){var a=0,l=Math.max(1,e.length);for(n=new Array(l-1);++a0?n[l-1]:t[0],l=n?[o[n-1],e]:[o[c-1],o[c]]},a.unknown=function(s){return arguments.length&&(i=s),a},a.thresholds=function(){return o.slice()},a.copy=function(){return Blt().domain([t,e]).range(r).unknown(i)},gy.apply($w(a),arguments)}function Ylt(){var t=[.5],e=[0,1],n,o=1;function r(i){return i!=null&&i<=i?e[sU(t,i,0,o)]:n}return r.domain=function(i){return arguments.length?(t=Array.from(i),o=Math.min(t.length,e.length-1),r):t.slice()},r.range=function(i){return arguments.length?(e=Array.from(i),o=Math.min(t.length,e.length-1),r):e.slice()},r.invertExtent=function(i){var a=e.indexOf(i);return[t[a-1],t[a]]},r.unknown=function(i){return arguments.length?(n=i,r):n},r.copy=function(){return Ylt().domain(t).range(e).unknown(n)},gy.apply(r,arguments)}const wle=new Date,vle=new Date;function Ku(t,e,n,o){function r(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return r.floor=i=>(t(i=new Date(+i)),i),r.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),r.round=i=>{const a=r(i),l=r.ceil(i);return i-a(e(i=new Date(+i),a==null?1:Math.floor(a)),i),r.range=(i,a,l)=>{const s=[];if(i=r.ceil(i),l=l==null?1:Math.floor(l),!(i0))return s;let c;do s.push(c=new Date(+i)),e(i,l),t(i);while(cKu(a=>{if(a>=a)for(;t(a),!i(a);)a.setTime(a-1)},(a,l)=>{if(a>=a)if(l<0)for(;++l<=0;)for(;e(a,-1),!i(a););else for(;--l>=0;)for(;e(a,1),!i(a););}),n&&(r.count=(i,a)=>(wle.setTime(+i),vle.setTime(+a),t(wle),t(vle),Math.floor(n(wle,vle))),r.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?r.filter(o?a=>o(a)%i===0:a=>r.count(0,a)%i===0):r)),r}const KJ=Ku(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);KJ.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Ku(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):KJ);KJ.range;const R6=1e3,Vm=R6*60,H6=Vm*60,lA=H6*24,B3e=lA*7,EDe=lA*30,xle=lA*365,Zv=Ku(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*R6)},(t,e)=>(e-t)/R6,t=>t.getUTCSeconds());Zv.range;const Y3e=Ku(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*R6)},(t,e)=>{t.setTime(+t+e*Vm)},(t,e)=>(e-t)/Vm,t=>t.getMinutes());Y3e.range;const O3e=Ku(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Vm)},(t,e)=>(e-t)/Vm,t=>t.getUTCMinutes());O3e.range;const _3e=Ku(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*R6-t.getMinutes()*Vm)},(t,e)=>{t.setTime(+t+e*H6)},(t,e)=>(e-t)/H6,t=>t.getHours());_3e.range;const V3e=Ku(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*H6)},(t,e)=>(e-t)/H6,t=>t.getUTCHours());V3e.range;const dU=Ku(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Vm)/lA,t=>t.getDate()-1);dU.range;const Qee=Ku(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/lA,t=>t.getUTCDate()-1);Qee.range;const Olt=Ku(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/lA,t=>Math.floor(t/lA));Olt.range;function dS(t){return Ku(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Vm)/B3e)}const Zee=dS(0),qJ=dS(1),lSo=dS(2),sSo=dS(3),sH=dS(4),cSo=dS(5),uSo=dS(6);Zee.range;qJ.range;lSo.range;sSo.range;sH.range;cSo.range;uSo.range;function fS(t){return Ku(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/B3e)}const ete=fS(0),$J=fS(1),dSo=fS(2),fSo=fS(3),cH=fS(4),hSo=fS(5),pSo=fS(6);ete.range;$J.range;dSo.range;fSo.range;cH.range;hSo.range;pSo.range;const G3e=Ku(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());G3e.range;const X3e=Ku(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());X3e.range;const sA=Ku(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());sA.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ku(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});sA.range;const cA=Ku(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());cA.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ku(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});cA.range;function _lt(t,e,n,o,r,i){const a=[[Zv,1,R6],[Zv,5,5*R6],[Zv,15,15*R6],[Zv,30,30*R6],[i,1,Vm],[i,5,5*Vm],[i,15,15*Vm],[i,30,30*Vm],[r,1,H6],[r,3,3*H6],[r,6,6*H6],[r,12,12*H6],[o,1,lA],[o,2,2*lA],[n,1,B3e],[e,1,EDe],[e,3,3*EDe],[t,1,xle]];function l(c,u,d){const f=uw).right(a,f);if(p===a.length)return t.every(Ahe(c/xle,u/xle,d));if(p===0)return KJ.every(Math.max(Ahe(c,u,d),1));const[g,y]=a[f/a[p-1][2]53)return null;"w"in ne||(ne.w=1),"Z"in ne?(ge=Sle(uD(ne.y,0,1)),de=ge.getUTCDay(),ge=de>4||de===0?$J.ceil(ge):$J(ge),ge=Qee.offset(ge,(ne.V-1)*7),ne.y=ge.getUTCFullYear(),ne.m=ge.getUTCMonth(),ne.d=ge.getUTCDate()+(ne.w+6)%7):(ge=ble(uD(ne.y,0,1)),de=ge.getDay(),ge=de>4||de===0?qJ.ceil(ge):qJ(ge),ge=dU.offset(ge,(ne.V-1)*7),ne.y=ge.getFullYear(),ne.m=ge.getMonth(),ne.d=ge.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),de="Z"in ne?Sle(uD(ne.y,0,1)).getUTCDay():ble(uD(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(de+5)%7:ne.w+ne.U*7-(de+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,Sle(ne)):ble(ne)}}function S(re,ae,se,ne){for(var fe=0,ge=ae.length,de=se.length,Z,he;fe=de)return-1;if(Z=ae.charCodeAt(fe++),Z===37){if(Z=ae.charAt(fe++),he=T[Z in FDe?ae.charAt(fe++):Z],!he||(ne=he(re,se,ne))<0)return-1}else if(Z!=se.charCodeAt(ne++))return-1}return ne}function R(re,ae,se){var ne=c.exec(ae.slice(se));return ne?(re.p=u.get(ne[0].toLowerCase()),se+ne[0].length):-1}function M(re,ae,se){var ne=p.exec(ae.slice(se));return ne?(re.w=g.get(ne[0].toLowerCase()),se+ne[0].length):-1}function D(re,ae,se){var ne=d.exec(ae.slice(se));return ne?(re.w=f.get(ne[0].toLowerCase()),se+ne[0].length):-1}function E(re,ae,se){var ne=b.exec(ae.slice(se));return ne?(re.m=C.get(ne[0].toLowerCase()),se+ne[0].length):-1}function W(re,ae,se){var ne=y.exec(ae.slice(se));return ne?(re.m=w.get(ne[0].toLowerCase()),se+ne[0].length):-1}function j(re,ae,se){return S(re,e,ae,se)}function L(re,ae,se){return S(re,n,ae,se)}function k(re,ae,se){return S(re,o,ae,se)}function N(re){return a[re.getDay()]}function F(re){return i[re.getDay()]}function U(re){return s[re.getMonth()]}function O(re){return l[re.getMonth()]}function B(re){return r[+(re.getHours()>=12)]}function _(re){return 1+~~(re.getMonth()/3)}function X(re){return a[re.getUTCDay()]}function $(re){return i[re.getUTCDay()]}function Q(re){return s[re.getUTCMonth()]}function le(re){return l[re.getUTCMonth()]}function q(re){return r[+(re.getUTCHours()>=12)]}function te(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var ae=A(re+="",P);return ae.toString=function(){return re},ae},parse:function(re){var ae=x(re+="",!1);return ae.toString=function(){return re},ae},utcFormat:function(re){var ae=A(re+="",v);return ae.toString=function(){return re},ae},utcParse:function(re){var ae=x(re+="",!0);return ae.toString=function(){return re},ae}}}var FDe={"-":"",_:" ",0:"0"},Ud=/^\s*\d+/,vSo=/^%/,xSo=/[\\^$*+?|[\]().{}]/g;function Ul(t,e,n){var o=t<0?"-":"",r=(o?-t:t)+"",i=r.length;return o+(i[e.toLowerCase(),n]))}function SSo(t,e,n){var o=Ud.exec(e.slice(n,n+1));return o?(t.w=+o[0],n+o[0].length):-1}function TSo(t,e,n){var o=Ud.exec(e.slice(n,n+1));return o?(t.u=+o[0],n+o[0].length):-1}function PSo(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.U=+o[0],n+o[0].length):-1}function CSo(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.V=+o[0],n+o[0].length):-1}function RSo(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.W=+o[0],n+o[0].length):-1}function kDe(t,e,n){var o=Ud.exec(e.slice(n,n+4));return o?(t.y=+o[0],n+o[0].length):-1}function LDe(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.y=+o[0]+(+o[0]>68?1900:2e3),n+o[0].length):-1}function HSo(t,e,n){var o=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return o?(t.Z=o[1]?0:-(o[2]+(o[3]||"00")),n+o[0].length):-1}function MSo(t,e,n){var o=Ud.exec(e.slice(n,n+1));return o?(t.q=o[0]*3-3,n+o[0].length):-1}function ISo(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.m=o[0]-1,n+o[0].length):-1}function WDe(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.d=+o[0],n+o[0].length):-1}function zSo(t,e,n){var o=Ud.exec(e.slice(n,n+3));return o?(t.m=0,t.d=+o[0],n+o[0].length):-1}function NDe(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.H=+o[0],n+o[0].length):-1}function DSo(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.M=+o[0],n+o[0].length):-1}function ESo(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.S=+o[0],n+o[0].length):-1}function FSo(t,e,n){var o=Ud.exec(e.slice(n,n+3));return o?(t.L=+o[0],n+o[0].length):-1}function kSo(t,e,n){var o=Ud.exec(e.slice(n,n+6));return o?(t.L=Math.floor(o[0]/1e3),n+o[0].length):-1}function LSo(t,e,n){var o=vSo.exec(e.slice(n,n+1));return o?n+o[0].length:-1}function WSo(t,e,n){var o=Ud.exec(e.slice(n));return o?(t.Q=+o[0],n+o[0].length):-1}function NSo(t,e,n){var o=Ud.exec(e.slice(n));return o?(t.s=+o[0],n+o[0].length):-1}function UDe(t,e){return Ul(t.getDate(),e,2)}function USo(t,e){return Ul(t.getHours(),e,2)}function jSo(t,e){return Ul(t.getHours()%12||12,e,2)}function BSo(t,e){return Ul(1+dU.count(sA(t),t),e,3)}function Vlt(t,e){return Ul(t.getMilliseconds(),e,3)}function YSo(t,e){return Vlt(t,e)+"000"}function OSo(t,e){return Ul(t.getMonth()+1,e,2)}function _So(t,e){return Ul(t.getMinutes(),e,2)}function VSo(t,e){return Ul(t.getSeconds(),e,2)}function GSo(t){var e=t.getDay();return e===0?7:e}function XSo(t,e){return Ul(Zee.count(sA(t)-1,t),e,2)}function Glt(t){var e=t.getDay();return e>=4||e===0?sH(t):sH.ceil(t)}function JSo(t,e){return t=Glt(t),Ul(sH.count(sA(t),t)+(sA(t).getDay()===4),e,2)}function KSo(t){return t.getDay()}function qSo(t,e){return Ul(qJ.count(sA(t)-1,t),e,2)}function $So(t,e){return Ul(t.getFullYear()%100,e,2)}function QSo(t,e){return t=Glt(t),Ul(t.getFullYear()%100,e,2)}function ZSo(t,e){return Ul(t.getFullYear()%1e4,e,4)}function eTo(t,e){var n=t.getDay();return t=n>=4||n===0?sH(t):sH.ceil(t),Ul(t.getFullYear()%1e4,e,4)}function tTo(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Ul(e/60|0,"0",2)+Ul(e%60,"0",2)}function jDe(t,e){return Ul(t.getUTCDate(),e,2)}function nTo(t,e){return Ul(t.getUTCHours(),e,2)}function oTo(t,e){return Ul(t.getUTCHours()%12||12,e,2)}function rTo(t,e){return Ul(1+Qee.count(cA(t),t),e,3)}function Xlt(t,e){return Ul(t.getUTCMilliseconds(),e,3)}function iTo(t,e){return Xlt(t,e)+"000"}function aTo(t,e){return Ul(t.getUTCMonth()+1,e,2)}function lTo(t,e){return Ul(t.getUTCMinutes(),e,2)}function sTo(t,e){return Ul(t.getUTCSeconds(),e,2)}function cTo(t){var e=t.getUTCDay();return e===0?7:e}function uTo(t,e){return Ul(ete.count(cA(t)-1,t),e,2)}function Jlt(t){var e=t.getUTCDay();return e>=4||e===0?cH(t):cH.ceil(t)}function dTo(t,e){return t=Jlt(t),Ul(cH.count(cA(t),t)+(cA(t).getUTCDay()===4),e,2)}function fTo(t){return t.getUTCDay()}function hTo(t,e){return Ul($J.count(cA(t)-1,t),e,2)}function pTo(t,e){return Ul(t.getUTCFullYear()%100,e,2)}function gTo(t,e){return t=Jlt(t),Ul(t.getUTCFullYear()%100,e,2)}function mTo(t,e){return Ul(t.getUTCFullYear()%1e4,e,4)}function yTo(t,e){var n=t.getUTCDay();return t=n>=4||n===0?cH(t):cH.ceil(t),Ul(t.getUTCFullYear()%1e4,e,4)}function ATo(){return"+0000"}function BDe(){return"%"}function YDe(t){return+t}function ODe(t){return Math.floor(+t/1e3)}var QT,Klt,qlt;wTo({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function wTo(t){return QT=wSo(t),Klt=QT.format,QT.parse,qlt=QT.utcFormat,QT.utcParse,QT}function vTo(t){return new Date(t)}function xTo(t){return t instanceof Date?+t:+new Date(+t)}function J3e(t,e,n,o,r,i,a,l,s,c){var u=F3e(),d=u.invert,f=u.domain,p=c(".%L"),g=c(":%S"),y=c("%I:%M"),w=c("%I %p"),b=c("%a %d"),C=c("%b %d"),P=c("%B"),v=c("%Y");function T(A){return(s(A)e(r/(t.length-1)))},n.quantiles=function(o){return Array.from({length:o+1},(r,i)=>ubo(t,i/o))},n.copy=function(){return est(e).domain(t)},CA.apply(n,arguments)}function nte(){var t=0,e=.5,n=1,o=1,r,i,a,l,s,c=sp,u,d=!1,f;function p(y){return isNaN(y=+y)?f:(y=.5+((y=+u(y))-i)*(o*ye}var MTo=HTo,ITo=rst,zTo=MTo,DTo=Qb;function ETo(t){return t&&t.length?ITo(t,DTo,zTo):void 0}var FTo=ETo;const T8=Fi(FTo);function kTo(t,e){return tt.e^i.s<0?1:-1;for(o=i.d.length,r=t.d.length,e=0,n=ot.d[e]^i.s<0?1:-1;return o===r?0:o>r^i.s<0?1:-1};Br.decimalPlaces=Br.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*mc;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Br.dividedBy=Br.div=function(t){return Y6(this,new this.constructor(t))};Br.dividedToIntegerBy=Br.idiv=function(t){var e=this,n=e.constructor;return Is(Y6(e,new n(t),0,1),n.precision)};Br.equals=Br.eq=function(t){return!this.cmp(t)};Br.exponent=function(){return uu(this)};Br.greaterThan=Br.gt=function(t){return this.cmp(t)>0};Br.greaterThanOrEqualTo=Br.gte=function(t){return this.cmp(t)>=0};Br.isInteger=Br.isint=function(){return this.e>this.d.length-2};Br.isNegative=Br.isneg=function(){return this.s<0};Br.isPositive=Br.ispos=function(){return this.s>0};Br.isZero=function(){return this.s===0};Br.lessThan=Br.lt=function(t){return this.cmp(t)<0};Br.lessThanOrEqualTo=Br.lte=function(t){return this.cmp(t)<1};Br.logarithm=Br.log=function(t){var e,n=this,o=n.constructor,r=o.precision,i=r+5;if(t===void 0)t=new o(10);else if(t=new o(t),t.s<1||t.eq(pg))throw Error(iy+"NaN");if(n.s<1)throw Error(iy+(n.s?"NaN":"-Infinity"));return n.eq(pg)?new o(0):(_c=!1,e=Y6(fL(n,i),fL(t,i),i),_c=!0,Is(e,r))};Br.minus=Br.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?sst(e,t):ast(e,(t.s=-t.s,t))};Br.modulo=Br.mod=function(t){var e,n=this,o=n.constructor,r=o.precision;if(t=new o(t),!t.s)throw Error(iy+"NaN");return n.s?(_c=!1,e=Y6(n,t,0,1).times(t),_c=!0,n.minus(e)):Is(new o(n),r)};Br.naturalExponential=Br.exp=function(){return lst(this)};Br.naturalLogarithm=Br.ln=function(){return fL(this)};Br.negated=Br.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Br.plus=Br.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?ast(e,t):sst(e,(t.s=-t.s,t))};Br.precision=Br.sd=function(t){var e,n,o,r=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Ix+t);if(e=uu(r)+1,o=r.d.length-1,n=o*mc+1,o=r.d[o],o){for(;o%10==0;o/=10)n--;for(o=r.d[0];o>=10;o/=10)n++}return t&&e>n?e:n};Br.squareRoot=Br.sqrt=function(){var t,e,n,o,r,i,a,l=this,s=l.constructor;if(l.s<1){if(!l.s)return new s(0);throw Error(iy+"NaN")}for(t=uu(l),_c=!1,r=Math.sqrt(+l),r==0||r==1/0?(e=w9(l.d),(e.length+t)%2==0&&(e+="0"),r=Math.sqrt(e),t=EM((t+1)/2)-(t<0||t%2),r==1/0?e="5e"+t:(e=r.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),o=new s(e)):o=new s(r.toString()),n=s.precision,r=a=n+3;;)if(i=o,o=i.plus(Y6(l,i,a+2)).times(.5),w9(i.d).slice(0,a)===(e=w9(o.d)).slice(0,a)){if(e=e.slice(a-3,a+1),r==a&&e=="4999"){if(Is(i,n+1,0),i.times(i).eq(l)){o=i;break}}else if(e!="9999")break;a+=4}return _c=!0,Is(o,n)};Br.times=Br.mul=function(t){var e,n,o,r,i,a,l,s,c,u=this,d=u.constructor,f=u.d,p=(t=new d(t)).d;if(!u.s||!t.s)return new d(0);for(t.s*=u.s,n=u.e+t.e,s=f.length,c=p.length,s=0;){for(e=0,r=s+o;r>o;)l=i[r]+p[o]*f[r-o-1]+e,i[r--]=l%Ad|0,e=l/Ad|0;i[r]=(i[r]+e)%Ad|0}for(;!i[--a];)i.pop();return e?++n:i.shift(),t.d=i,t.e=n,_c?Is(t,d.precision):t};Br.toDecimalPlaces=Br.todp=function(t,e){var n=this,o=n.constructor;return n=new o(n),t===void 0?n:(q9(t,0,DM),e===void 0?e=o.rounding:q9(e,0,8),Is(n,t+uu(n)+1,e))};Br.toExponential=function(t,e){var n,o=this,r=o.constructor;return t===void 0?n=fb(o,!0):(q9(t,0,DM),e===void 0?e=r.rounding:q9(e,0,8),o=Is(new r(o),t+1,e),n=fb(o,!0,t+1)),n};Br.toFixed=function(t,e){var n,o,r=this,i=r.constructor;return t===void 0?fb(r):(q9(t,0,DM),e===void 0?e=i.rounding:q9(e,0,8),o=Is(new i(r),t+uu(r)+1,e),n=fb(o.abs(),!1,t+uu(o)+1),r.isneg()&&!r.isZero()?"-"+n:n)};Br.toInteger=Br.toint=function(){var t=this,e=t.constructor;return Is(new e(t),uu(t)+1,e.rounding)};Br.toNumber=function(){return+this};Br.toPower=Br.pow=function(t){var e,n,o,r,i,a,l=this,s=l.constructor,c=12,u=+(t=new s(t));if(!t.s)return new s(pg);if(l=new s(l),!l.s){if(t.s<1)throw Error(iy+"Infinity");return l}if(l.eq(pg))return l;if(o=s.precision,t.eq(pg))return Is(l,o);if(e=t.e,n=t.d.length-1,a=e>=n,i=l.s,a){if((n=u<0?-u:u)<=ist){for(r=new s(pg),e=Math.ceil(o/mc+4),_c=!1;n%2&&(r=r.times(l),GDe(r.d,e)),n=EM(n/2),n!==0;)l=l.times(l),GDe(l.d,e);return _c=!0,t.s<0?new s(pg).div(r):Is(r,o)}}else if(i<0)throw Error(iy+"NaN");return i=i<0&&t.d[Math.max(e,n)]&1?-1:1,l.s=1,_c=!1,r=t.times(fL(l,o+c)),_c=!0,r=lst(r),r.s=i,r};Br.toPrecision=function(t,e){var n,o,r=this,i=r.constructor;return t===void 0?(n=uu(r),o=fb(r,n<=i.toExpNeg||n>=i.toExpPos)):(q9(t,1,DM),e===void 0?e=i.rounding:q9(e,0,8),r=Is(new i(r),t,e),n=uu(r),o=fb(r,t<=n||n<=i.toExpNeg,t)),o};Br.toSignificantDigits=Br.tosd=function(t,e){var n=this,o=n.constructor;return t===void 0?(t=o.precision,e=o.rounding):(q9(t,1,DM),e===void 0?e=o.rounding:q9(e,0,8)),Is(new o(n),t,e)};Br.toString=Br.valueOf=Br.val=Br.toJSON=Br[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=uu(t),n=t.constructor;return fb(t,e<=n.toExpNeg||e>=n.toExpPos)};function ast(t,e){var n,o,r,i,a,l,s,c,u=t.constructor,d=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),_c?Is(e,d):e;if(s=t.d,c=e.d,a=t.e,r=e.e,s=s.slice(),i=a-r,i){for(i<0?(o=s,i=-i,l=c.length):(o=c,r=a,l=s.length),a=Math.ceil(d/mc),l=a>l?a+1:l+1,i>l&&(i=l,o.length=1),o.reverse();i--;)o.push(0);o.reverse()}for(l=s.length,i=c.length,l-i<0&&(i=l,o=c,c=s,s=o),n=0;i;)n=(s[--i]=s[i]+c[i]+n)/Ad|0,s[i]%=Ad;for(n&&(s.unshift(n),++r),l=s.length;s[--l]==0;)s.pop();return e.d=s,e.e=r,_c?Is(e,d):e}function q9(t,e,n){if(t!==~~t||tn)throw Error(Ix+t)}function w9(t){var e,n,o,r=t.length-1,i="",a=t[0];if(r>0){for(i+=a,e=1;ea?1:-1;else for(l=s=0;lr[l]?1:-1;break}return s}function n(o,r,i){for(var a=0;i--;)o[i]-=a,a=o[i]1;)o.shift()}return function(o,r,i,a){var l,s,c,u,d,f,p,g,y,w,b,C,P,v,T,A,x,S,R=o.constructor,M=o.s==r.s?1:-1,D=o.d,E=r.d;if(!o.s)return new R(o);if(!r.s)throw Error(iy+"Division by zero");for(s=o.e-r.e,x=E.length,T=D.length,p=new R(M),g=p.d=[],c=0;E[c]==(D[c]||0);)++c;if(E[c]>(D[c]||0)&&--s,i==null?C=i=R.precision:a?C=i+(uu(o)-uu(r))+1:C=i,C<0)return new R(0);if(C=C/mc+2|0,c=0,x==1)for(u=0,E=E[0],C++;(c1&&(E=t(E,u),D=t(D,u),x=E.length,T=D.length),v=x,y=D.slice(0,x),w=y.length;w=Ad/2&&++A;do u=0,l=e(E,y,x,w),l<0?(b=y[0],x!=w&&(b=b*Ad+(y[1]||0)),u=b/A|0,u>1?(u>=Ad&&(u=Ad-1),d=t(E,u),f=d.length,w=y.length,l=e(d,y,f,w),l==1&&(u--,n(d,x16)throw Error($3e+uu(t));if(!t.s)return new u(pg);for(e==null?(_c=!1,l=d):l=e,a=new u(.03125);t.abs().gte(.1);)t=t.times(a),c+=5;for(o=Math.log(yv(2,c))/Math.LN10*2+5|0,l+=o,n=r=i=new u(pg),u.precision=l;;){if(r=Is(r.times(t),l),n=n.times(++s),a=i.plus(Y6(r,n,l)),w9(a.d).slice(0,l)===w9(i.d).slice(0,l)){for(;c--;)i=Is(i.times(i),l);return u.precision=d,e==null?(_c=!0,Is(i,d)):i}i=a}}function uu(t){for(var e=t.e*mc,n=t.d[0];n>=10;n/=10)e++;return e}function Tle(t,e,n){if(e>t.LN10.sd())throw _c=!0,n&&(t.precision=n),Error(iy+"LN10 precision limit exceeded");return Is(new t(t.LN10),e)}function Z4(t){for(var e="";t--;)e+="0";return e}function fL(t,e){var n,o,r,i,a,l,s,c,u,d=1,f=10,p=t,g=p.d,y=p.constructor,w=y.precision;if(p.s<1)throw Error(iy+(p.s?"NaN":"-Infinity"));if(p.eq(pg))return new y(0);if(e==null?(_c=!1,c=w):c=e,p.eq(10))return e==null&&(_c=!0),Tle(y,c);if(c+=f,y.precision=c,n=w9(g),o=n.charAt(0),i=uu(p),Math.abs(i)<15e14){for(;o<7&&o!=1||o==1&&n.charAt(1)>3;)p=p.times(t),n=w9(p.d),o=n.charAt(0),d++;i=uu(p),o>1?(p=new y("0."+n),i++):p=new y(o+"."+n.slice(1))}else return s=Tle(y,c+2,w).times(i+""),p=fL(new y(o+"."+n.slice(1)),c-f).plus(s),y.precision=w,e==null?(_c=!0,Is(p,w)):p;for(l=a=p=Y6(p.minus(pg),p.plus(pg),c),u=Is(p.times(p),c),r=3;;){if(a=Is(a.times(u),c),s=l.plus(Y6(a,new y(r),c)),w9(s.d).slice(0,c)===w9(l.d).slice(0,c))return l=l.times(2),i!==0&&(l=l.plus(Tle(y,c+2,w).times(i+""))),l=Y6(l,new y(d),c),y.precision=w,e==null?(_c=!0,Is(l,w)):l;l=s,r+=2}}function VDe(t,e){var n,o,r;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(o=e.search(/e/i))>0?(n<0&&(n=o),n+=+e.slice(o+1),e=e.substring(0,o)):n<0&&(n=e.length),o=0;e.charCodeAt(o)===48;)++o;for(r=e.length;e.charCodeAt(r-1)===48;)--r;if(e=e.slice(o,r),e){if(r-=o,n=n-o-1,t.e=EM(n/mc),t.d=[],o=(n+1)%mc,n<0&&(o+=mc),oQJ||t.e<-QJ))throw Error($3e+n)}else t.s=0,t.e=0,t.d=[0];return t}function Is(t,e,n){var o,r,i,a,l,s,c,u,d=t.d;for(a=1,i=d[0];i>=10;i/=10)a++;if(o=e-a,o<0)o+=mc,r=e,c=d[u=0];else{if(u=Math.ceil((o+1)/mc),i=d.length,u>=i)return t;for(c=i=d[u],a=1;i>=10;i/=10)a++;o%=mc,r=o-mc+a}if(n!==void 0&&(i=yv(10,a-r-1),l=c/i%10|0,s=e<0||d[u+1]!==void 0||c%i,s=n<4?(l||s)&&(n==0||n==(t.s<0?3:2)):l>5||l==5&&(n==4||s||n==6&&(o>0?r>0?c/yv(10,a-r):0:d[u-1])%10&1||n==(t.s<0?8:7))),e<1||!d[0])return s?(i=uu(t),d.length=1,e=e-i-1,d[0]=yv(10,(mc-e%mc)%mc),t.e=EM(-e/mc)||0):(d.length=1,d[0]=t.e=t.s=0),t;if(o==0?(d.length=u,i=1,u--):(d.length=u+1,i=yv(10,mc-o),d[u]=r>0?(c/yv(10,a-r)%yv(10,r)|0)*i:0),s)for(;;)if(u==0){(d[0]+=i)==Ad&&(d[0]=1,++t.e);break}else{if(d[u]+=i,d[u]!=Ad)break;d[u--]=0,i=1}for(o=d.length;d[--o]===0;)d.pop();if(_c&&(t.e>QJ||t.e<-QJ))throw Error($3e+uu(t));return t}function sst(t,e){var n,o,r,i,a,l,s,c,u,d,f=t.constructor,p=f.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new f(t),_c?Is(e,p):e;if(s=t.d,d=e.d,o=e.e,c=t.e,s=s.slice(),a=c-o,a){for(u=a<0,u?(n=s,a=-a,l=d.length):(n=d,o=c,l=s.length),r=Math.max(Math.ceil(p/mc),l)+2,a>r&&(a=r,n.length=1),n.reverse(),r=a;r--;)n.push(0);n.reverse()}else{for(r=s.length,l=d.length,u=r0;--r)s[l++]=0;for(r=d.length;r>a;){if(s[--r]0?i=i.charAt(0)+"."+i.slice(1)+Z4(o):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(r<0?"e":"e+")+r):r<0?(i="0."+Z4(-r-1)+i,n&&(o=n-a)>0&&(i+=Z4(o))):r>=a?(i+=Z4(r+1-a),n&&(o=n-r-1)>0&&(i=i+"."+Z4(o))):((o=r+1)0&&(r+1===a&&(i+="."),i+=Z4(o))),t.s<0?"-"+i:i}function GDe(t,e){if(t.length>e)return t.length=e,!0}function cst(t){var e,n,o;function r(i){var a=this;if(!(a instanceof r))return new r(i);if(a.constructor=r,i instanceof r){a.s=i.s,a.e=i.e,a.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Ix+i);if(i>0)a.s=1;else if(i<0)i=-i,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(i===~~i&&i<1e7){a.e=0,a.d=[i];return}return VDe(a,i.toString())}else if(typeof i!="string")throw Error(Ix+i);if(i.charCodeAt(0)===45?(i=i.slice(1),a.s=-1):a.s=1,$To.test(i))VDe(a,i);else throw Error(Ix+i)}if(r.prototype=Br,r.ROUND_UP=0,r.ROUND_DOWN=1,r.ROUND_CEIL=2,r.ROUND_FLOOR=3,r.ROUND_HALF_UP=4,r.ROUND_HALF_DOWN=5,r.ROUND_HALF_EVEN=6,r.ROUND_HALF_CEIL=7,r.ROUND_HALF_FLOOR=8,r.clone=cst,r.config=r.set=QTo,t===void 0&&(t={}),t)for(o=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=r[e+1]&&o<=r[e+2])this[n]=o;else throw Error(Ix+n+": "+o);if((o=t[n="LN10"])!==void 0)if(o==Math.LN10)this[n]=new this(o);else throw Error(Ix+n+": "+o);return this}var Q3e=cst(qTo);pg=new Q3e(1);const vs=Q3e;function ZTo(t){return oPo(t)||nPo(t)||tPo(t)||ePo()}function ePo(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tPo(t,e){if(t){if(typeof t=="string")return She(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return She(t,e)}}function nPo(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function oPo(t){if(Array.isArray(t))return She(t)}function She(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n=e?n.apply(void 0,r):t(e-a,XDe(function(){for(var l=arguments.length,s=new Array(l),c=0;c1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||B2.isSsr)return{width:0,height:0};var o=Rxo(n),r=JSON.stringify({text:e,copyStyle:o});if($T.widthCache[r])return $T.widthCache[r];try{var i=document.getElementById($ze);i||(i=document.createElement("span"),i.setAttribute("id",$ze),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var a=phe(phe({},Cxo),o);Object.assign(i.style,a),i.textContent="".concat(e);var l=i.getBoundingClientRect(),s={width:l.width,height:l.height};return $T.widthCache[r]=s,++$T.cacheCount>Pxo&&($T.cacheCount=0,$T.widthCache={}),s}catch{return{width:0,height:0}}},Hxo=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function iL(t){"@babel/helpers - typeof";return iL=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},iL(t)}function YJ(t,e){return Dxo(t)||zxo(t,e)||Ixo(t,e)||Mxo()}function Mxo(){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 Ixo(t,e){if(t){if(typeof t=="string")return Qze(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qze(t,e)}}function Qze(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function Gxo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function rDe(t,e){return qxo(t)||Kxo(t,e)||Jxo(t,e)||Xxo()}function Xxo(){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 Jxo(t,e){if(t){if(typeof t=="string")return iDe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iDe(t,e)}}function iDe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function(k,N){var F=N.word,U=N.width,O=k[k.length-1];if(O&&(r==null||i||O.width+U+oN.width?k:N})};if(!u)return p;for(var y="…",w=function(L){var k=d.slice(0,L),N=Tlt({breakAll:c,style:s,children:k+y}).wordsWithComputedWidth,F=f(N),U=F.length>a||g(F).width>Number(r);return[U,F]},b=0,C=d.length-1,P=0,v;b<=C&&P<=d.length-1;){var T=Math.floor((b+C)/2),A=T-1,x=w(A),S=rDe(x,2),R=S[0],M=S[1],D=w(T),E=rDe(D,1),W=E[0];if(!R&&!W&&(b=T+1),R&&W&&(C=T-1),!R&&W){v=M;break}P++}return v||p},aDe=function(e){var n=ia(e)?[]:e.toString().split(Slt);return[{words:n}]},Qxo=function(e){var n=e.width,o=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,l=e.maxLines;if((n||o)&&!B2.isSsr){var s,c,u=Tlt({breakAll:a,children:r,style:i});if(u){var d=u.wordsWithComputedWidth,f=u.spaceWidth;s=d,c=f}else return aDe(r);return $xo({breakAll:a,children:r,maxLines:l,style:i},s,c,n,o)}return aDe(r)},lDe="#808080",OJ=function(e){var n=e.x,o=n===void 0?0:n,r=e.y,i=r===void 0?0:r,a=e.lineHeight,l=a===void 0?"1em":a,s=e.capHeight,c=s===void 0?"0.71em":s,u=e.scaleToFit,d=u===void 0?!1:u,f=e.textAnchor,p=f===void 0?"start":f,g=e.verticalAnchor,y=g===void 0?"end":g,w=e.fill,b=w===void 0?lDe:w,C=oDe(e,_xo),P=m.useMemo(function(){return Qxo({breakAll:C.breakAll,children:C.children,maxLines:C.maxLines,scaleToFit:d,style:C.style,width:C.width})},[C.breakAll,C.children,C.maxLines,d,C.style,C.width]),v=C.dx,T=C.dy,A=C.angle,x=C.className,S=C.breakAll,R=oDe(C,Vxo);if(!Nu(o)||!Nu(i))return null;var M=o+(dr(v)?v:0),D=i+(dr(T)?T:0),E;switch(y){case"start":E=mle("calc(".concat(c,")"));break;case"middle":E=mle("calc(".concat((P.length-1)/2," * -").concat(l," + (").concat(c," / 2))"));break;default:E=mle("calc(".concat(P.length-1," * -").concat(l,")"));break}var W=[];if(d){var j=P[0].width,L=C.width;W.push("scale(".concat((dr(L)?L/j:1)/j,")"))}return A&&W.push("rotate(".concat(A,", ").concat(M,", ").concat(D,")")),W.length&&(R.transform=W.join(" ")),be.createElement("text",ghe({},ra(R,!0),{x:M,y:D,className:fl("recharts-text",x),textAnchor:p,fill:b.includes("url")?lDe:b}),P.map(function(k,N){var F=k.words.join(S?"":" ");return be.createElement("tspan",{x:M,dy:N===0?E:l,key:F},F)}))};function X8(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function Zxo(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function z3e(t){let e,n,o;t.length!==2?(e=X8,n=(l,s)=>X8(t(l),s),o=(l,s)=>t(l)-s):(e=t===X8||t===Zxo?t:ebo,n=t,o=t);function r(l,s,c=0,u=l.length){if(c>>1;n(l[d],s)<0?c=d+1:u=d}while(c>>1;n(l[d],s)<=0?c=d+1:u=d}while(cc&&o(l[d-1],s)>-o(l[d],s)?d-1:d}return{left:r,center:a,right:i}}function ebo(){return 0}function Plt(t){return t===null?NaN:+t}function*tbo(t,e){for(let n of t)n!=null&&(n=+n)>=n&&(yield n)}const nbo=z3e(X8),cU=nbo.right;z3e(Plt).center;class sDe extends Map{constructor(e,n=ibo){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[o,r]of e)this.set(o,r)}get(e){return super.get(cDe(this,e))}has(e){return super.has(cDe(this,e))}set(e,n){return super.set(obo(this,e),n)}delete(e){return super.delete(rbo(this,e))}}function cDe({_intern:t,_key:e},n){const o=e(n);return t.has(o)?t.get(o):n}function obo({_intern:t,_key:e},n){const o=e(n);return t.has(o)?t.get(o):(t.set(o,n),n)}function rbo({_intern:t,_key:e},n){const o=e(n);return t.has(o)&&(n=t.get(o),t.delete(o)),n}function ibo(t){return t!==null&&typeof t=="object"?t.valueOf():t}function abo(t=X8){if(t===X8)return Clt;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const o=t(e,n);return o||o===0?o:(t(n,n)===0)-(t(e,e)===0)}}function Clt(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const lbo=Math.sqrt(50),sbo=Math.sqrt(10),cbo=Math.sqrt(2);function _J(t,e,n){const o=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(o)),i=o/Math.pow(10,r),a=i>=lbo?10:i>=sbo?5:i>=cbo?2:1;let l,s,c;return r<0?(c=Math.pow(10,-r)/a,l=Math.round(t*c),s=Math.round(e*c),l/ce&&--s,c=-c):(c=Math.pow(10,r)*a,l=Math.round(t/c),s=Math.round(e/c),l*ce&&--s),s0))return[];if(t===e)return[t];const o=e=r))return[];const l=i-r+1,s=new Array(l);if(o)if(a<0)for(let c=0;c=o)&&(n=o);return n}function dDe(t,e){let n;for(const o of t)o!=null&&(n>o||n===void 0&&o>=o)&&(n=o);return n}function Rlt(t,e,n=0,o=1/0,r){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),o=Math.floor(Math.min(t.length-1,o)),!(n<=e&&e<=o))return t;for(r=r===void 0?Clt:abo(r);o>n;){if(o-n>600){const s=o-n+1,c=e-n+1,u=Math.log(s),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(s-d)/s)*(c-s/2<0?-1:1),p=Math.max(n,Math.floor(e-c*d/s+f)),g=Math.min(o,Math.floor(e+(s-c)*d/s+f));Rlt(t,e,p,g,r)}const i=t[e];let a=n,l=o;for(cD(t,n,e),r(t[o],i)>0&&cD(t,n,o);a0;)--l}r(t[n],i)===0?cD(t,n,l):(++l,cD(t,l,o)),l<=e&&(n=l+1),e<=l&&(o=l-1)}return t}function cD(t,e,n){const o=t[e];t[e]=t[n],t[n]=o}function ubo(t,e,n){if(t=Float64Array.from(tbo(t)),!(!(o=t.length)||isNaN(e=+e))){if(e<=0||o<2)return dDe(t);if(e>=1)return uDe(t);var o,r=(o-1)*e,i=Math.floor(r),a=uDe(Rlt(t,i).subarray(0,i+1)),l=dDe(t.subarray(i+1));return a+(l-a)*(r-i)}}function dbo(t,e,n=Plt){if(!(!(o=t.length)||isNaN(e=+e))){if(e<=0||o<2)return+n(t[0],0,t);if(e>=1)return+n(t[o-1],o-1,t);var o,r=(o-1)*e,i=Math.floor(r),a=+n(t[i],i,t),l=+n(t[i+1],i+1,t);return a+(l-a)*(r-i)}}function fbo(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var o=-1,r=Math.max(0,Math.ceil((e-t)/n))|0,i=new Array(r);++o>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?QO(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?QO(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=pbo.exec(t))?new Jp(e[1],e[2],e[3],1):(e=gbo.exec(t))?new Jp(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=mbo.exec(t))?QO(e[1],e[2],e[3],e[4]):(e=ybo.exec(t))?QO(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Abo.exec(t))?ADe(e[1],e[2]/100,e[3]/100,1):(e=wbo.exec(t))?ADe(e[1],e[2]/100,e[3]/100,e[4]):fDe.hasOwnProperty(t)?gDe(fDe[t]):t==="transparent"?new Jp(NaN,NaN,NaN,0):null}function gDe(t){return new Jp(t>>16&255,t>>8&255,t&255,1)}function QO(t,e,n,o){return o<=0&&(t=e=n=NaN),new Jp(t,e,n,o)}function bbo(t){return t instanceof uU||(t=cL(t)),t?(t=t.rgb(),new Jp(t.r,t.g,t.b,t.opacity)):new Jp}function vhe(t,e,n,o){return arguments.length===1?bbo(t):new Jp(t,e,n,o??1)}function Jp(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}D3e(Jp,vhe,Mlt(uU,{brighter(t){return t=t==null?VJ:Math.pow(VJ,t),new Jp(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?lL:Math.pow(lL,t),new Jp(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Jp(Mx(this.r),Mx(this.g),Mx(this.b),GJ(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:mDe,formatHex:mDe,formatHex8:Sbo,formatRgb:yDe,toString:yDe}));function mDe(){return`#${Qv(this.r)}${Qv(this.g)}${Qv(this.b)}`}function Sbo(){return`#${Qv(this.r)}${Qv(this.g)}${Qv(this.b)}${Qv((isNaN(this.opacity)?1:this.opacity)*255)}`}function yDe(){const t=GJ(this.opacity);return`${t===1?"rgb(":"rgba("}${Mx(this.r)}, ${Mx(this.g)}, ${Mx(this.b)}${t===1?")":`, ${t})`}`}function GJ(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Mx(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Qv(t){return t=Mx(t),(t<16?"0":"")+t.toString(16)}function ADe(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new w2(t,e,n,o)}function Ilt(t){if(t instanceof w2)return new w2(t.h,t.s,t.l,t.opacity);if(t instanceof uU||(t=cL(t)),!t)return new w2;if(t instanceof w2)return t;t=t.rgb();var e=t.r/255,n=t.g/255,o=t.b/255,r=Math.min(e,n,o),i=Math.max(e,n,o),a=NaN,l=i-r,s=(i+r)/2;return l?(e===i?a=(n-o)/l+(n0&&s<1?0:a,new w2(a,l,s,t.opacity)}function Tbo(t,e,n,o){return arguments.length===1?Ilt(t):new w2(t,e,n,o??1)}function w2(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}D3e(w2,Tbo,Mlt(uU,{brighter(t){return t=t==null?VJ:Math.pow(VJ,t),new w2(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?lL:Math.pow(lL,t),new w2(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,r=2*n-o;return new Jp(yle(t>=240?t-240:t+120,r,o),yle(t,r,o),yle(t<120?t+240:t-120,r,o),this.opacity)},clamp(){return new w2(wDe(this.h),ZO(this.s),ZO(this.l),GJ(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=GJ(this.opacity);return`${t===1?"hsl(":"hsla("}${wDe(this.h)}, ${ZO(this.s)*100}%, ${ZO(this.l)*100}%${t===1?")":`, ${t})`}`}}));function wDe(t){return t=(t||0)%360,t<0?t+360:t}function ZO(t){return Math.max(0,Math.min(1,t||0))}function yle(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const E3e=t=>()=>t;function Pbo(t,e){return function(n){return t+n*e}}function Cbo(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}function Rbo(t){return(t=+t)==1?zlt:function(e,n){return n-e?Cbo(e,n,t):E3e(isNaN(e)?n:e)}}function zlt(t,e){var n=e-t;return n?Pbo(t,n):E3e(isNaN(t)?e:t)}const vDe=function t(e){var n=Rbo(e);function o(r,i){var a=n((r=vhe(r)).r,(i=vhe(i)).r),l=n(r.g,i.g),s=n(r.b,i.b),c=zlt(r.opacity,i.opacity);return function(u){return r.r=a(u),r.g=l(u),r.b=s(u),r.opacity=c(u),r+""}}return o.gamma=t,o}(1);function Hbo(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,o=e.slice(),r;return function(i){for(r=0;rn&&(i=e.slice(n,i),l[a]?l[a]+=i:l[++a]=i),(o=o[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,s.push({i:a,x:XJ(o,r)})),n=Ale.lastIndex;return ne&&(n=t,t=e,e=n),function(o){return Math.max(t,Math.min(e,o))}}function Ubo(t,e,n){var o=t[0],r=t[1],i=e[0],a=e[1];return r2?jbo:Ubo,s=c=null,d}function d(f){return f==null||isNaN(f=+f)?i:(s||(s=l(t.map(o),e,n)))(o(a(f)))}return d.invert=function(f){return a(r((c||(c=l(e,t.map(o),XJ)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,JJ),u()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),u()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),n=F3e,u()},d.clamp=function(f){return arguments.length?(a=f?!0:sp,u()):a!==sp},d.interpolate=function(f){return arguments.length?(n=f,u()):n},d.unknown=function(f){return arguments.length?(i=f,d):i},function(f,p){return o=f,r=p,u()}}function k3e(){return $ee()(sp,sp)}function Bbo(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function KJ(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,o=t.slice(0,n);return[o.length>1?o[0]+o.slice(2):o,+t.slice(n+1)]}function lH(t){return t=KJ(Math.abs(t)),t?t[1]:NaN}function Ybo(t,e){return function(n,o){for(var r=n.length,i=[],a=0,l=t[0],s=0;r>0&&l>0&&(s+l+1>o&&(l=Math.max(1,o-s)),i.push(n.substring(r-=l,r+l)),!((s+=l+1)>o));)l=t[a=(a+1)%t.length];return i.reverse().join(e)}}function Obo(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var _bo=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function uL(t){if(!(e=_bo.exec(t)))throw new Error("invalid format: "+t);var e;return new L3e({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}uL.prototype=L3e.prototype;function L3e(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}L3e.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Vbo(t){e:for(var e=t.length,n=1,o=-1,r;n0&&(o=0);break}return o>0?t.slice(0,o)+t.slice(r+1):t}var Dlt;function Gbo(t,e){var n=KJ(t,e);if(!n)return t+"";var o=n[0],r=n[1],i=r-(Dlt=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=o.length;return i===a?o:i>a?o+new Array(i-a+1).join("0"):i>0?o.slice(0,i)+"."+o.slice(i):"0."+new Array(1-i).join("0")+KJ(t,Math.max(0,e+i-1))[0]}function bDe(t,e){var n=KJ(t,e);if(!n)return t+"";var o=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+o:o.length>r+1?o.slice(0,r+1)+"."+o.slice(r+1):o+new Array(r-o.length+2).join("0")}const SDe={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Bbo,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>bDe(t*100,e),r:bDe,s:Gbo,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function TDe(t){return t}var PDe=Array.prototype.map,CDe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Xbo(t){var e=t.grouping===void 0||t.thousands===void 0?TDe:Ybo(PDe.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",o=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?TDe:Obo(PDe.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",l=t.minus===void 0?"−":t.minus+"",s=t.nan===void 0?"NaN":t.nan+"";function c(d){d=uL(d);var f=d.fill,p=d.align,g=d.sign,y=d.symbol,w=d.zero,b=d.width,C=d.comma,P=d.precision,v=d.trim,T=d.type;T==="n"?(C=!0,T="g"):SDe[T]||(P===void 0&&(P=12),v=!0,T="g"),(w||f==="0"&&p==="=")&&(w=!0,f="0",p="=");var A=y==="$"?n:y==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",x=y==="$"?o:/[%p]/.test(T)?a:"",S=SDe[T],R=/[defgprs%]/.test(T);P=P===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function M(D){var E=A,W=x,j,L,k;if(T==="c")W=S(D)+W,D="";else{D=+D;var N=D<0||1/D<0;if(D=isNaN(D)?s:S(Math.abs(D),P),v&&(D=Vbo(D)),N&&+D==0&&g!=="+"&&(N=!1),E=(N?g==="("?g:l:g==="-"||g==="("?"":g)+E,W=(T==="s"?CDe[8+Dlt/3]:"")+W+(N&&g==="("?")":""),R){for(j=-1,L=D.length;++jk||k>57){W=(k===46?r+D.slice(j+1):D.slice(j))+W,D=D.slice(0,j);break}}}C&&!w&&(D=e(D,1/0));var F=E.length+D.length+W.length,U=F>1)+E+D+W+U.slice(F);break;default:D=U+E+D+W;break}return i(D)}return M.toString=function(){return d+""},M}function u(d,f){var p=c((d=uL(d),d.type="f",d)),g=Math.max(-8,Math.min(8,Math.floor(lH(f)/3)))*3,y=Math.pow(10,-g),w=CDe[8+g/3];return function(b){return p(y*b)+w}}return{format:c,formatPrefix:u}}var e_,W3e,Elt;Jbo({thousands:",",grouping:[3],currency:["$",""]});function Jbo(t){return e_=Xbo(t),W3e=e_.format,Elt=e_.formatPrefix,e_}function Kbo(t){return Math.max(0,-lH(Math.abs(t)))}function qbo(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(lH(e)/3)))*3-lH(Math.abs(t)))}function $bo(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,lH(e)-lH(t))+1}function Flt(t,e,n,o){var r=Ahe(t,e,n),i;switch(o=uL(o??",f"),o.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return o.precision==null&&!isNaN(i=qbo(r,a))&&(o.precision=i),Elt(o,a)}case"":case"e":case"g":case"p":case"r":{o.precision==null&&!isNaN(i=$bo(r,Math.max(Math.abs(t),Math.abs(e))))&&(o.precision=i-(o.type==="e"));break}case"f":case"%":{o.precision==null&&!isNaN(i=Kbo(r))&&(o.precision=i-(o.type==="%")*2);break}}return W3e(o)}function $w(t){var e=t.domain;return t.ticks=function(n){var o=e();return mhe(o[0],o[o.length-1],n??10)},t.tickFormat=function(n,o){var r=e();return Flt(r[0],r[r.length-1],n??10,o)},t.nice=function(n){n==null&&(n=10);var o=e(),r=0,i=o.length-1,a=o[r],l=o[i],s,c,u=10;for(l0;){if(c=yhe(a,l,n),c===s)return o[r]=a,o[i]=l,e(o);if(c>0)a=Math.floor(a/c)*c,l=Math.ceil(l/c)*c;else if(c<0)a=Math.ceil(a*c)/c,l=Math.floor(l*c)/c;else break;s=c}return t},t}function dL(){var t=k3e();return t.copy=function(){return dU(t,dL())},gy.apply(t,arguments),$w(t)}function klt(t){var e;function n(o){return o==null||isNaN(o=+o)?e:o}return n.invert=n,n.domain=n.range=function(o){return arguments.length?(t=Array.from(o,JJ),n):t.slice()},n.unknown=function(o){return arguments.length?(e=o,n):e},n.copy=function(){return klt(t).unknown(e)},t=arguments.length?Array.from(t,JJ):[0,1],$w(n)}function Llt(t,e){t=t.slice();var n=0,o=t.length-1,r=t[n],i=t[o],a;return iMath.pow(t,e)}function nSo(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function MDe(t){return(e,n)=>-t(-e,n)}function N3e(t){const e=t(RDe,HDe),n=e.domain;let o=10,r,i;function a(){return r=nSo(o),i=tSo(o),n()[0]<0?(r=MDe(r),i=MDe(i),t(Qbo,Zbo)):t(RDe,HDe),e}return e.base=function(l){return arguments.length?(o=+l,a()):o},e.domain=function(l){return arguments.length?(n(l),a()):n()},e.ticks=l=>{const s=n();let c=s[0],u=s[s.length-1];const d=u0){for(;f<=p;++f)for(g=1;gu)break;b.push(y)}}else for(;f<=p;++f)for(g=o-1;g>=1;--g)if(y=f>0?g/i(-f):g*i(f),!(yu)break;b.push(y)}b.length*2{if(l==null&&(l=10),s==null&&(s=o===10?"s":","),typeof s!="function"&&(!(o%1)&&(s=uL(s)).precision==null&&(s.trim=!0),s=W3e(s)),l===1/0)return s;const c=Math.max(1,o*l/e.ticks().length);return u=>{let d=u/i(Math.round(r(u)));return d*on(Llt(n(),{floor:l=>i(Math.floor(r(l))),ceil:l=>i(Math.ceil(r(l)))})),e}function Wlt(){const t=N3e($ee()).domain([1,10]);return t.copy=()=>dU(t,Wlt()).base(t.base()),gy.apply(t,arguments),t}function IDe(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function zDe(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function U3e(t){var e=1,n=t(IDe(e),zDe(e));return n.constant=function(o){return arguments.length?t(IDe(e=+o),zDe(e)):e},$w(n)}function Nlt(){var t=U3e($ee());return t.copy=function(){return dU(t,Nlt()).constant(t.constant())},gy.apply(t,arguments)}function DDe(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function oSo(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function rSo(t){return t<0?-t*t:t*t}function j3e(t){var e=t(sp,sp),n=1;function o(){return n===1?t(sp,sp):n===.5?t(oSo,rSo):t(DDe(n),DDe(1/n))}return e.exponent=function(r){return arguments.length?(n=+r,o()):n},$w(e)}function B3e(){var t=j3e($ee());return t.copy=function(){return dU(t,B3e()).exponent(t.exponent())},gy.apply(t,arguments),t}function iSo(){return B3e.apply(null,arguments).exponent(.5)}function EDe(t){return Math.sign(t)*t*t}function aSo(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function Ult(){var t=k3e(),e=[0,1],n=!1,o;function r(i){var a=aSo(t(i));return isNaN(a)?o:n?Math.round(a):a}return r.invert=function(i){return t.invert(EDe(i))},r.domain=function(i){return arguments.length?(t.domain(i),r):t.domain()},r.range=function(i){return arguments.length?(t.range((e=Array.from(i,JJ)).map(EDe)),r):e.slice()},r.rangeRound=function(i){return r.range(i).round(!0)},r.round=function(i){return arguments.length?(n=!!i,r):n},r.clamp=function(i){return arguments.length?(t.clamp(i),r):t.clamp()},r.unknown=function(i){return arguments.length?(o=i,r):o},r.copy=function(){return Ult(t.domain(),e).round(n).clamp(t.clamp()).unknown(o)},gy.apply(r,arguments),$w(r)}function jlt(){var t=[],e=[],n=[],o;function r(){var a=0,l=Math.max(1,e.length);for(n=new Array(l-1);++a0?n[l-1]:t[0],l=n?[o[n-1],e]:[o[c-1],o[c]]},a.unknown=function(s){return arguments.length&&(i=s),a},a.thresholds=function(){return o.slice()},a.copy=function(){return Blt().domain([t,e]).range(r).unknown(i)},gy.apply($w(a),arguments)}function Ylt(){var t=[.5],e=[0,1],n,o=1;function r(i){return i!=null&&i<=i?e[cU(t,i,0,o)]:n}return r.domain=function(i){return arguments.length?(t=Array.from(i),o=Math.min(t.length,e.length-1),r):t.slice()},r.range=function(i){return arguments.length?(e=Array.from(i),o=Math.min(t.length,e.length-1),r):e.slice()},r.invertExtent=function(i){var a=e.indexOf(i);return[t[a-1],t[a]]},r.unknown=function(i){return arguments.length?(n=i,r):n},r.copy=function(){return Ylt().domain(t).range(e).unknown(n)},gy.apply(r,arguments)}const wle=new Date,vle=new Date;function Ku(t,e,n,o){function r(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return r.floor=i=>(t(i=new Date(+i)),i),r.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),r.round=i=>{const a=r(i),l=r.ceil(i);return i-a(e(i=new Date(+i),a==null?1:Math.floor(a)),i),r.range=(i,a,l)=>{const s=[];if(i=r.ceil(i),l=l==null?1:Math.floor(l),!(i0))return s;let c;do s.push(c=new Date(+i)),e(i,l),t(i);while(cKu(a=>{if(a>=a)for(;t(a),!i(a);)a.setTime(a-1)},(a,l)=>{if(a>=a)if(l<0)for(;++l<=0;)for(;e(a,-1),!i(a););else for(;--l>=0;)for(;e(a,1),!i(a););}),n&&(r.count=(i,a)=>(wle.setTime(+i),vle.setTime(+a),t(wle),t(vle),Math.floor(n(wle,vle))),r.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?r.filter(o?a=>o(a)%i===0:a=>r.count(0,a)%i===0):r)),r}const qJ=Ku(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);qJ.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Ku(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):qJ);qJ.range;const R6=1e3,Vm=R6*60,H6=Vm*60,lA=H6*24,Y3e=lA*7,FDe=lA*30,xle=lA*365,Zv=Ku(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*R6)},(t,e)=>(e-t)/R6,t=>t.getUTCSeconds());Zv.range;const O3e=Ku(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*R6)},(t,e)=>{t.setTime(+t+e*Vm)},(t,e)=>(e-t)/Vm,t=>t.getMinutes());O3e.range;const _3e=Ku(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Vm)},(t,e)=>(e-t)/Vm,t=>t.getUTCMinutes());_3e.range;const V3e=Ku(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*R6-t.getMinutes()*Vm)},(t,e)=>{t.setTime(+t+e*H6)},(t,e)=>(e-t)/H6,t=>t.getHours());V3e.range;const G3e=Ku(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*H6)},(t,e)=>(e-t)/H6,t=>t.getUTCHours());G3e.range;const fU=Ku(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Vm)/lA,t=>t.getDate()-1);fU.range;const Qee=Ku(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/lA,t=>t.getUTCDate()-1);Qee.range;const Olt=Ku(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/lA,t=>Math.floor(t/lA));Olt.range;function dS(t){return Ku(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Vm)/Y3e)}const Zee=dS(0),$J=dS(1),lSo=dS(2),sSo=dS(3),sH=dS(4),cSo=dS(5),uSo=dS(6);Zee.range;$J.range;lSo.range;sSo.range;sH.range;cSo.range;uSo.range;function fS(t){return Ku(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Y3e)}const ete=fS(0),QJ=fS(1),dSo=fS(2),fSo=fS(3),cH=fS(4),hSo=fS(5),pSo=fS(6);ete.range;QJ.range;dSo.range;fSo.range;cH.range;hSo.range;pSo.range;const X3e=Ku(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());X3e.range;const J3e=Ku(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());J3e.range;const sA=Ku(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());sA.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ku(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});sA.range;const cA=Ku(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());cA.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ku(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});cA.range;function _lt(t,e,n,o,r,i){const a=[[Zv,1,R6],[Zv,5,5*R6],[Zv,15,15*R6],[Zv,30,30*R6],[i,1,Vm],[i,5,5*Vm],[i,15,15*Vm],[i,30,30*Vm],[r,1,H6],[r,3,3*H6],[r,6,6*H6],[r,12,12*H6],[o,1,lA],[o,2,2*lA],[n,1,Y3e],[e,1,FDe],[e,3,3*FDe],[t,1,xle]];function l(c,u,d){const f=uw).right(a,f);if(p===a.length)return t.every(Ahe(c/xle,u/xle,d));if(p===0)return qJ.every(Math.max(Ahe(c,u,d),1));const[g,y]=a[f/a[p-1][2]53)return null;"w"in ne||(ne.w=1),"Z"in ne?(ge=Sle(uD(ne.y,0,1)),de=ge.getUTCDay(),ge=de>4||de===0?QJ.ceil(ge):QJ(ge),ge=Qee.offset(ge,(ne.V-1)*7),ne.y=ge.getUTCFullYear(),ne.m=ge.getUTCMonth(),ne.d=ge.getUTCDate()+(ne.w+6)%7):(ge=ble(uD(ne.y,0,1)),de=ge.getDay(),ge=de>4||de===0?$J.ceil(ge):$J(ge),ge=fU.offset(ge,(ne.V-1)*7),ne.y=ge.getFullYear(),ne.m=ge.getMonth(),ne.d=ge.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),de="Z"in ne?Sle(uD(ne.y,0,1)).getUTCDay():ble(uD(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(de+5)%7:ne.w+ne.U*7-(de+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,Sle(ne)):ble(ne)}}function S(re,ae,se,ne){for(var fe=0,ge=ae.length,de=se.length,Z,he;fe=de)return-1;if(Z=ae.charCodeAt(fe++),Z===37){if(Z=ae.charAt(fe++),he=T[Z in kDe?ae.charAt(fe++):Z],!he||(ne=he(re,se,ne))<0)return-1}else if(Z!=se.charCodeAt(ne++))return-1}return ne}function R(re,ae,se){var ne=c.exec(ae.slice(se));return ne?(re.p=u.get(ne[0].toLowerCase()),se+ne[0].length):-1}function M(re,ae,se){var ne=p.exec(ae.slice(se));return ne?(re.w=g.get(ne[0].toLowerCase()),se+ne[0].length):-1}function D(re,ae,se){var ne=d.exec(ae.slice(se));return ne?(re.w=f.get(ne[0].toLowerCase()),se+ne[0].length):-1}function E(re,ae,se){var ne=b.exec(ae.slice(se));return ne?(re.m=C.get(ne[0].toLowerCase()),se+ne[0].length):-1}function W(re,ae,se){var ne=y.exec(ae.slice(se));return ne?(re.m=w.get(ne[0].toLowerCase()),se+ne[0].length):-1}function j(re,ae,se){return S(re,e,ae,se)}function L(re,ae,se){return S(re,n,ae,se)}function k(re,ae,se){return S(re,o,ae,se)}function N(re){return a[re.getDay()]}function F(re){return i[re.getDay()]}function U(re){return s[re.getMonth()]}function O(re){return l[re.getMonth()]}function B(re){return r[+(re.getHours()>=12)]}function _(re){return 1+~~(re.getMonth()/3)}function X(re){return a[re.getUTCDay()]}function $(re){return i[re.getUTCDay()]}function Q(re){return s[re.getUTCMonth()]}function le(re){return l[re.getUTCMonth()]}function q(re){return r[+(re.getUTCHours()>=12)]}function te(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var ae=A(re+="",P);return ae.toString=function(){return re},ae},parse:function(re){var ae=x(re+="",!1);return ae.toString=function(){return re},ae},utcFormat:function(re){var ae=A(re+="",v);return ae.toString=function(){return re},ae},utcParse:function(re){var ae=x(re+="",!0);return ae.toString=function(){return re},ae}}}var kDe={"-":"",_:" ",0:"0"},Ud=/^\s*\d+/,vSo=/^%/,xSo=/[\\^$*+?|[\]().{}]/g;function Ul(t,e,n){var o=t<0?"-":"",r=(o?-t:t)+"",i=r.length;return o+(i[e.toLowerCase(),n]))}function SSo(t,e,n){var o=Ud.exec(e.slice(n,n+1));return o?(t.w=+o[0],n+o[0].length):-1}function TSo(t,e,n){var o=Ud.exec(e.slice(n,n+1));return o?(t.u=+o[0],n+o[0].length):-1}function PSo(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.U=+o[0],n+o[0].length):-1}function CSo(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.V=+o[0],n+o[0].length):-1}function RSo(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.W=+o[0],n+o[0].length):-1}function LDe(t,e,n){var o=Ud.exec(e.slice(n,n+4));return o?(t.y=+o[0],n+o[0].length):-1}function WDe(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.y=+o[0]+(+o[0]>68?1900:2e3),n+o[0].length):-1}function HSo(t,e,n){var o=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return o?(t.Z=o[1]?0:-(o[2]+(o[3]||"00")),n+o[0].length):-1}function MSo(t,e,n){var o=Ud.exec(e.slice(n,n+1));return o?(t.q=o[0]*3-3,n+o[0].length):-1}function ISo(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.m=o[0]-1,n+o[0].length):-1}function NDe(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.d=+o[0],n+o[0].length):-1}function zSo(t,e,n){var o=Ud.exec(e.slice(n,n+3));return o?(t.m=0,t.d=+o[0],n+o[0].length):-1}function UDe(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.H=+o[0],n+o[0].length):-1}function DSo(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.M=+o[0],n+o[0].length):-1}function ESo(t,e,n){var o=Ud.exec(e.slice(n,n+2));return o?(t.S=+o[0],n+o[0].length):-1}function FSo(t,e,n){var o=Ud.exec(e.slice(n,n+3));return o?(t.L=+o[0],n+o[0].length):-1}function kSo(t,e,n){var o=Ud.exec(e.slice(n,n+6));return o?(t.L=Math.floor(o[0]/1e3),n+o[0].length):-1}function LSo(t,e,n){var o=vSo.exec(e.slice(n,n+1));return o?n+o[0].length:-1}function WSo(t,e,n){var o=Ud.exec(e.slice(n));return o?(t.Q=+o[0],n+o[0].length):-1}function NSo(t,e,n){var o=Ud.exec(e.slice(n));return o?(t.s=+o[0],n+o[0].length):-1}function jDe(t,e){return Ul(t.getDate(),e,2)}function USo(t,e){return Ul(t.getHours(),e,2)}function jSo(t,e){return Ul(t.getHours()%12||12,e,2)}function BSo(t,e){return Ul(1+fU.count(sA(t),t),e,3)}function Vlt(t,e){return Ul(t.getMilliseconds(),e,3)}function YSo(t,e){return Vlt(t,e)+"000"}function OSo(t,e){return Ul(t.getMonth()+1,e,2)}function _So(t,e){return Ul(t.getMinutes(),e,2)}function VSo(t,e){return Ul(t.getSeconds(),e,2)}function GSo(t){var e=t.getDay();return e===0?7:e}function XSo(t,e){return Ul(Zee.count(sA(t)-1,t),e,2)}function Glt(t){var e=t.getDay();return e>=4||e===0?sH(t):sH.ceil(t)}function JSo(t,e){return t=Glt(t),Ul(sH.count(sA(t),t)+(sA(t).getDay()===4),e,2)}function KSo(t){return t.getDay()}function qSo(t,e){return Ul($J.count(sA(t)-1,t),e,2)}function $So(t,e){return Ul(t.getFullYear()%100,e,2)}function QSo(t,e){return t=Glt(t),Ul(t.getFullYear()%100,e,2)}function ZSo(t,e){return Ul(t.getFullYear()%1e4,e,4)}function eTo(t,e){var n=t.getDay();return t=n>=4||n===0?sH(t):sH.ceil(t),Ul(t.getFullYear()%1e4,e,4)}function tTo(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Ul(e/60|0,"0",2)+Ul(e%60,"0",2)}function BDe(t,e){return Ul(t.getUTCDate(),e,2)}function nTo(t,e){return Ul(t.getUTCHours(),e,2)}function oTo(t,e){return Ul(t.getUTCHours()%12||12,e,2)}function rTo(t,e){return Ul(1+Qee.count(cA(t),t),e,3)}function Xlt(t,e){return Ul(t.getUTCMilliseconds(),e,3)}function iTo(t,e){return Xlt(t,e)+"000"}function aTo(t,e){return Ul(t.getUTCMonth()+1,e,2)}function lTo(t,e){return Ul(t.getUTCMinutes(),e,2)}function sTo(t,e){return Ul(t.getUTCSeconds(),e,2)}function cTo(t){var e=t.getUTCDay();return e===0?7:e}function uTo(t,e){return Ul(ete.count(cA(t)-1,t),e,2)}function Jlt(t){var e=t.getUTCDay();return e>=4||e===0?cH(t):cH.ceil(t)}function dTo(t,e){return t=Jlt(t),Ul(cH.count(cA(t),t)+(cA(t).getUTCDay()===4),e,2)}function fTo(t){return t.getUTCDay()}function hTo(t,e){return Ul(QJ.count(cA(t)-1,t),e,2)}function pTo(t,e){return Ul(t.getUTCFullYear()%100,e,2)}function gTo(t,e){return t=Jlt(t),Ul(t.getUTCFullYear()%100,e,2)}function mTo(t,e){return Ul(t.getUTCFullYear()%1e4,e,4)}function yTo(t,e){var n=t.getUTCDay();return t=n>=4||n===0?cH(t):cH.ceil(t),Ul(t.getUTCFullYear()%1e4,e,4)}function ATo(){return"+0000"}function YDe(){return"%"}function ODe(t){return+t}function _De(t){return Math.floor(+t/1e3)}var QT,Klt,qlt;wTo({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function wTo(t){return QT=wSo(t),Klt=QT.format,QT.parse,qlt=QT.utcFormat,QT.utcParse,QT}function vTo(t){return new Date(t)}function xTo(t){return t instanceof Date?+t:+new Date(+t)}function K3e(t,e,n,o,r,i,a,l,s,c){var u=k3e(),d=u.invert,f=u.domain,p=c(".%L"),g=c(":%S"),y=c("%I:%M"),w=c("%I %p"),b=c("%a %d"),C=c("%b %d"),P=c("%B"),v=c("%Y");function T(A){return(s(A)e(r/(t.length-1)))},n.quantiles=function(o){return Array.from({length:o+1},(r,i)=>ubo(t,i/o))},n.copy=function(){return est(e).domain(t)},CA.apply(n,arguments)}function nte(){var t=0,e=.5,n=1,o=1,r,i,a,l,s,c=sp,u,d=!1,f;function p(y){return isNaN(y=+y)?f:(y=.5+((y=+u(y))-i)*(o*ye}var MTo=HTo,ITo=rst,zTo=MTo,DTo=Qb;function ETo(t){return t&&t.length?ITo(t,DTo,zTo):void 0}var FTo=ETo;const T8=Fi(FTo);function kTo(t,e){return tt.e^i.s<0?1:-1;for(o=i.d.length,r=t.d.length,e=0,n=ot.d[e]^i.s<0?1:-1;return o===r?0:o>r^i.s<0?1:-1};Br.decimalPlaces=Br.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*mc;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Br.dividedBy=Br.div=function(t){return Y6(this,new this.constructor(t))};Br.dividedToIntegerBy=Br.idiv=function(t){var e=this,n=e.constructor;return Is(Y6(e,new n(t),0,1),n.precision)};Br.equals=Br.eq=function(t){return!this.cmp(t)};Br.exponent=function(){return uu(this)};Br.greaterThan=Br.gt=function(t){return this.cmp(t)>0};Br.greaterThanOrEqualTo=Br.gte=function(t){return this.cmp(t)>=0};Br.isInteger=Br.isint=function(){return this.e>this.d.length-2};Br.isNegative=Br.isneg=function(){return this.s<0};Br.isPositive=Br.ispos=function(){return this.s>0};Br.isZero=function(){return this.s===0};Br.lessThan=Br.lt=function(t){return this.cmp(t)<0};Br.lessThanOrEqualTo=Br.lte=function(t){return this.cmp(t)<1};Br.logarithm=Br.log=function(t){var e,n=this,o=n.constructor,r=o.precision,i=r+5;if(t===void 0)t=new o(10);else if(t=new o(t),t.s<1||t.eq(pg))throw Error(iy+"NaN");if(n.s<1)throw Error(iy+(n.s?"NaN":"-Infinity"));return n.eq(pg)?new o(0):(_c=!1,e=Y6(fL(n,i),fL(t,i),i),_c=!0,Is(e,r))};Br.minus=Br.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?sst(e,t):ast(e,(t.s=-t.s,t))};Br.modulo=Br.mod=function(t){var e,n=this,o=n.constructor,r=o.precision;if(t=new o(t),!t.s)throw Error(iy+"NaN");return n.s?(_c=!1,e=Y6(n,t,0,1).times(t),_c=!0,n.minus(e)):Is(new o(n),r)};Br.naturalExponential=Br.exp=function(){return lst(this)};Br.naturalLogarithm=Br.ln=function(){return fL(this)};Br.negated=Br.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Br.plus=Br.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?ast(e,t):sst(e,(t.s=-t.s,t))};Br.precision=Br.sd=function(t){var e,n,o,r=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Ix+t);if(e=uu(r)+1,o=r.d.length-1,n=o*mc+1,o=r.d[o],o){for(;o%10==0;o/=10)n--;for(o=r.d[0];o>=10;o/=10)n++}return t&&e>n?e:n};Br.squareRoot=Br.sqrt=function(){var t,e,n,o,r,i,a,l=this,s=l.constructor;if(l.s<1){if(!l.s)return new s(0);throw Error(iy+"NaN")}for(t=uu(l),_c=!1,r=Math.sqrt(+l),r==0||r==1/0?(e=w9(l.d),(e.length+t)%2==0&&(e+="0"),r=Math.sqrt(e),t=EM((t+1)/2)-(t<0||t%2),r==1/0?e="5e"+t:(e=r.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),o=new s(e)):o=new s(r.toString()),n=s.precision,r=a=n+3;;)if(i=o,o=i.plus(Y6(l,i,a+2)).times(.5),w9(i.d).slice(0,a)===(e=w9(o.d)).slice(0,a)){if(e=e.slice(a-3,a+1),r==a&&e=="4999"){if(Is(i,n+1,0),i.times(i).eq(l)){o=i;break}}else if(e!="9999")break;a+=4}return _c=!0,Is(o,n)};Br.times=Br.mul=function(t){var e,n,o,r,i,a,l,s,c,u=this,d=u.constructor,f=u.d,p=(t=new d(t)).d;if(!u.s||!t.s)return new d(0);for(t.s*=u.s,n=u.e+t.e,s=f.length,c=p.length,s=0;){for(e=0,r=s+o;r>o;)l=i[r]+p[o]*f[r-o-1]+e,i[r--]=l%Ad|0,e=l/Ad|0;i[r]=(i[r]+e)%Ad|0}for(;!i[--a];)i.pop();return e?++n:i.shift(),t.d=i,t.e=n,_c?Is(t,d.precision):t};Br.toDecimalPlaces=Br.todp=function(t,e){var n=this,o=n.constructor;return n=new o(n),t===void 0?n:(q9(t,0,DM),e===void 0?e=o.rounding:q9(e,0,8),Is(n,t+uu(n)+1,e))};Br.toExponential=function(t,e){var n,o=this,r=o.constructor;return t===void 0?n=fb(o,!0):(q9(t,0,DM),e===void 0?e=r.rounding:q9(e,0,8),o=Is(new r(o),t+1,e),n=fb(o,!0,t+1)),n};Br.toFixed=function(t,e){var n,o,r=this,i=r.constructor;return t===void 0?fb(r):(q9(t,0,DM),e===void 0?e=i.rounding:q9(e,0,8),o=Is(new i(r),t+uu(r)+1,e),n=fb(o.abs(),!1,t+uu(o)+1),r.isneg()&&!r.isZero()?"-"+n:n)};Br.toInteger=Br.toint=function(){var t=this,e=t.constructor;return Is(new e(t),uu(t)+1,e.rounding)};Br.toNumber=function(){return+this};Br.toPower=Br.pow=function(t){var e,n,o,r,i,a,l=this,s=l.constructor,c=12,u=+(t=new s(t));if(!t.s)return new s(pg);if(l=new s(l),!l.s){if(t.s<1)throw Error(iy+"Infinity");return l}if(l.eq(pg))return l;if(o=s.precision,t.eq(pg))return Is(l,o);if(e=t.e,n=t.d.length-1,a=e>=n,i=l.s,a){if((n=u<0?-u:u)<=ist){for(r=new s(pg),e=Math.ceil(o/mc+4),_c=!1;n%2&&(r=r.times(l),XDe(r.d,e)),n=EM(n/2),n!==0;)l=l.times(l),XDe(l.d,e);return _c=!0,t.s<0?new s(pg).div(r):Is(r,o)}}else if(i<0)throw Error(iy+"NaN");return i=i<0&&t.d[Math.max(e,n)]&1?-1:1,l.s=1,_c=!1,r=t.times(fL(l,o+c)),_c=!0,r=lst(r),r.s=i,r};Br.toPrecision=function(t,e){var n,o,r=this,i=r.constructor;return t===void 0?(n=uu(r),o=fb(r,n<=i.toExpNeg||n>=i.toExpPos)):(q9(t,1,DM),e===void 0?e=i.rounding:q9(e,0,8),r=Is(new i(r),t,e),n=uu(r),o=fb(r,t<=n||n<=i.toExpNeg,t)),o};Br.toSignificantDigits=Br.tosd=function(t,e){var n=this,o=n.constructor;return t===void 0?(t=o.precision,e=o.rounding):(q9(t,1,DM),e===void 0?e=o.rounding:q9(e,0,8)),Is(new o(n),t,e)};Br.toString=Br.valueOf=Br.val=Br.toJSON=Br[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=uu(t),n=t.constructor;return fb(t,e<=n.toExpNeg||e>=n.toExpPos)};function ast(t,e){var n,o,r,i,a,l,s,c,u=t.constructor,d=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),_c?Is(e,d):e;if(s=t.d,c=e.d,a=t.e,r=e.e,s=s.slice(),i=a-r,i){for(i<0?(o=s,i=-i,l=c.length):(o=c,r=a,l=s.length),a=Math.ceil(d/mc),l=a>l?a+1:l+1,i>l&&(i=l,o.length=1),o.reverse();i--;)o.push(0);o.reverse()}for(l=s.length,i=c.length,l-i<0&&(i=l,o=c,c=s,s=o),n=0;i;)n=(s[--i]=s[i]+c[i]+n)/Ad|0,s[i]%=Ad;for(n&&(s.unshift(n),++r),l=s.length;s[--l]==0;)s.pop();return e.d=s,e.e=r,_c?Is(e,d):e}function q9(t,e,n){if(t!==~~t||tn)throw Error(Ix+t)}function w9(t){var e,n,o,r=t.length-1,i="",a=t[0];if(r>0){for(i+=a,e=1;ea?1:-1;else for(l=s=0;lr[l]?1:-1;break}return s}function n(o,r,i){for(var a=0;i--;)o[i]-=a,a=o[i]1;)o.shift()}return function(o,r,i,a){var l,s,c,u,d,f,p,g,y,w,b,C,P,v,T,A,x,S,R=o.constructor,M=o.s==r.s?1:-1,D=o.d,E=r.d;if(!o.s)return new R(o);if(!r.s)throw Error(iy+"Division by zero");for(s=o.e-r.e,x=E.length,T=D.length,p=new R(M),g=p.d=[],c=0;E[c]==(D[c]||0);)++c;if(E[c]>(D[c]||0)&&--s,i==null?C=i=R.precision:a?C=i+(uu(o)-uu(r))+1:C=i,C<0)return new R(0);if(C=C/mc+2|0,c=0,x==1)for(u=0,E=E[0],C++;(c1&&(E=t(E,u),D=t(D,u),x=E.length,T=D.length),v=x,y=D.slice(0,x),w=y.length;w=Ad/2&&++A;do u=0,l=e(E,y,x,w),l<0?(b=y[0],x!=w&&(b=b*Ad+(y[1]||0)),u=b/A|0,u>1?(u>=Ad&&(u=Ad-1),d=t(E,u),f=d.length,w=y.length,l=e(d,y,f,w),l==1&&(u--,n(d,x16)throw Error(Q3e+uu(t));if(!t.s)return new u(pg);for(e==null?(_c=!1,l=d):l=e,a=new u(.03125);t.abs().gte(.1);)t=t.times(a),c+=5;for(o=Math.log(yv(2,c))/Math.LN10*2+5|0,l+=o,n=r=i=new u(pg),u.precision=l;;){if(r=Is(r.times(t),l),n=n.times(++s),a=i.plus(Y6(r,n,l)),w9(a.d).slice(0,l)===w9(i.d).slice(0,l)){for(;c--;)i=Is(i.times(i),l);return u.precision=d,e==null?(_c=!0,Is(i,d)):i}i=a}}function uu(t){for(var e=t.e*mc,n=t.d[0];n>=10;n/=10)e++;return e}function Tle(t,e,n){if(e>t.LN10.sd())throw _c=!0,n&&(t.precision=n),Error(iy+"LN10 precision limit exceeded");return Is(new t(t.LN10),e)}function Z4(t){for(var e="";t--;)e+="0";return e}function fL(t,e){var n,o,r,i,a,l,s,c,u,d=1,f=10,p=t,g=p.d,y=p.constructor,w=y.precision;if(p.s<1)throw Error(iy+(p.s?"NaN":"-Infinity"));if(p.eq(pg))return new y(0);if(e==null?(_c=!1,c=w):c=e,p.eq(10))return e==null&&(_c=!0),Tle(y,c);if(c+=f,y.precision=c,n=w9(g),o=n.charAt(0),i=uu(p),Math.abs(i)<15e14){for(;o<7&&o!=1||o==1&&n.charAt(1)>3;)p=p.times(t),n=w9(p.d),o=n.charAt(0),d++;i=uu(p),o>1?(p=new y("0."+n),i++):p=new y(o+"."+n.slice(1))}else return s=Tle(y,c+2,w).times(i+""),p=fL(new y(o+"."+n.slice(1)),c-f).plus(s),y.precision=w,e==null?(_c=!0,Is(p,w)):p;for(l=a=p=Y6(p.minus(pg),p.plus(pg),c),u=Is(p.times(p),c),r=3;;){if(a=Is(a.times(u),c),s=l.plus(Y6(a,new y(r),c)),w9(s.d).slice(0,c)===w9(l.d).slice(0,c))return l=l.times(2),i!==0&&(l=l.plus(Tle(y,c+2,w).times(i+""))),l=Y6(l,new y(d),c),y.precision=w,e==null?(_c=!0,Is(l,w)):l;l=s,r+=2}}function GDe(t,e){var n,o,r;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(o=e.search(/e/i))>0?(n<0&&(n=o),n+=+e.slice(o+1),e=e.substring(0,o)):n<0&&(n=e.length),o=0;e.charCodeAt(o)===48;)++o;for(r=e.length;e.charCodeAt(r-1)===48;)--r;if(e=e.slice(o,r),e){if(r-=o,n=n-o-1,t.e=EM(n/mc),t.d=[],o=(n+1)%mc,n<0&&(o+=mc),oZJ||t.e<-ZJ))throw Error(Q3e+n)}else t.s=0,t.e=0,t.d=[0];return t}function Is(t,e,n){var o,r,i,a,l,s,c,u,d=t.d;for(a=1,i=d[0];i>=10;i/=10)a++;if(o=e-a,o<0)o+=mc,r=e,c=d[u=0];else{if(u=Math.ceil((o+1)/mc),i=d.length,u>=i)return t;for(c=i=d[u],a=1;i>=10;i/=10)a++;o%=mc,r=o-mc+a}if(n!==void 0&&(i=yv(10,a-r-1),l=c/i%10|0,s=e<0||d[u+1]!==void 0||c%i,s=n<4?(l||s)&&(n==0||n==(t.s<0?3:2)):l>5||l==5&&(n==4||s||n==6&&(o>0?r>0?c/yv(10,a-r):0:d[u-1])%10&1||n==(t.s<0?8:7))),e<1||!d[0])return s?(i=uu(t),d.length=1,e=e-i-1,d[0]=yv(10,(mc-e%mc)%mc),t.e=EM(-e/mc)||0):(d.length=1,d[0]=t.e=t.s=0),t;if(o==0?(d.length=u,i=1,u--):(d.length=u+1,i=yv(10,mc-o),d[u]=r>0?(c/yv(10,a-r)%yv(10,r)|0)*i:0),s)for(;;)if(u==0){(d[0]+=i)==Ad&&(d[0]=1,++t.e);break}else{if(d[u]+=i,d[u]!=Ad)break;d[u--]=0,i=1}for(o=d.length;d[--o]===0;)d.pop();if(_c&&(t.e>ZJ||t.e<-ZJ))throw Error(Q3e+uu(t));return t}function sst(t,e){var n,o,r,i,a,l,s,c,u,d,f=t.constructor,p=f.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new f(t),_c?Is(e,p):e;if(s=t.d,d=e.d,o=e.e,c=t.e,s=s.slice(),a=c-o,a){for(u=a<0,u?(n=s,a=-a,l=d.length):(n=d,o=c,l=s.length),r=Math.max(Math.ceil(p/mc),l)+2,a>r&&(a=r,n.length=1),n.reverse(),r=a;r--;)n.push(0);n.reverse()}else{for(r=s.length,l=d.length,u=r0;--r)s[l++]=0;for(r=d.length;r>a;){if(s[--r]0?i=i.charAt(0)+"."+i.slice(1)+Z4(o):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(r<0?"e":"e+")+r):r<0?(i="0."+Z4(-r-1)+i,n&&(o=n-a)>0&&(i+=Z4(o))):r>=a?(i+=Z4(r+1-a),n&&(o=n-r-1)>0&&(i=i+"."+Z4(o))):((o=r+1)0&&(r+1===a&&(i+="."),i+=Z4(o))),t.s<0?"-"+i:i}function XDe(t,e){if(t.length>e)return t.length=e,!0}function cst(t){var e,n,o;function r(i){var a=this;if(!(a instanceof r))return new r(i);if(a.constructor=r,i instanceof r){a.s=i.s,a.e=i.e,a.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Ix+i);if(i>0)a.s=1;else if(i<0)i=-i,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(i===~~i&&i<1e7){a.e=0,a.d=[i];return}return GDe(a,i.toString())}else if(typeof i!="string")throw Error(Ix+i);if(i.charCodeAt(0)===45?(i=i.slice(1),a.s=-1):a.s=1,$To.test(i))GDe(a,i);else throw Error(Ix+i)}if(r.prototype=Br,r.ROUND_UP=0,r.ROUND_DOWN=1,r.ROUND_CEIL=2,r.ROUND_FLOOR=3,r.ROUND_HALF_UP=4,r.ROUND_HALF_DOWN=5,r.ROUND_HALF_EVEN=6,r.ROUND_HALF_CEIL=7,r.ROUND_HALF_FLOOR=8,r.clone=cst,r.config=r.set=QTo,t===void 0&&(t={}),t)for(o=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=r[e+1]&&o<=r[e+2])this[n]=o;else throw Error(Ix+n+": "+o);if((o=t[n="LN10"])!==void 0)if(o==Math.LN10)this[n]=new this(o);else throw Error(Ix+n+": "+o);return this}var Z3e=cst(qTo);pg=new Z3e(1);const vs=Z3e;function ZTo(t){return oPo(t)||nPo(t)||tPo(t)||ePo()}function ePo(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tPo(t,e){if(t){if(typeof t=="string")return She(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return She(t,e)}}function nPo(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function oPo(t){if(Array.isArray(t))return She(t)}function She(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n=e?n.apply(void 0,r):t(e-a,JDe(function(){for(var l=arguments.length,s=new Array(l),c=0;ct.length)&&(e=t.length);for(var n=0,o=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],o=!0,r=!1,i=void 0;try{for(var a=t[Symbol.iterator](),l;!(o=(l=a.next()).done)&&(n.push(l.value),!(e&&n.length===e));o=!0);}catch(s){r=!0,i=s}finally{try{!o&&a.return!=null&&a.return()}finally{if(r)throw i}}return n}}function APo(t){if(Array.isArray(t))return t}function pst(t){var e=hL(t,2),n=e[0],o=e[1],r=n,i=o;return n>o&&(r=o,i=n),[r,i]}function gst(t,e,n){if(t.lte(0))return new vs(0);var o=ite.getDigitCount(t.toNumber()),r=new vs(10).pow(o),i=t.div(r),a=o!==1?.05:.1,l=new vs(Math.ceil(i.div(a).toNumber())).add(n).mul(a),s=l.mul(r);return e?s:new vs(Math.ceil(s))}function wPo(t,e,n){var o=1,r=new vs(t);if(!r.isint()&&n){var i=Math.abs(t);i<1?(o=new vs(10).pow(ite.getDigitCount(t)-1),r=new vs(Math.floor(r.div(o).toNumber())).mul(o)):i>1&&(r=new vs(Math.floor(t)))}else t===0?r=new vs(Math.floor((e-1)/2)):n||(r=new vs(Math.floor(t)));var a=Math.floor((e-1)/2),l=lPo(aPo(function(s){return r.add(new vs(s-a).mul(o)).toNumber()}),The);return l(0,e)}function mst(t,e,n,o){var r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new vs(0),tickMin:new vs(0),tickMax:new vs(0)};var i=gst(new vs(e).sub(t).div(n-1),o,r),a;t<=0&&e>=0?a=new vs(0):(a=new vs(t).add(e).div(2),a=a.sub(new vs(a).mod(i)));var l=Math.ceil(a.sub(t).div(i).toNumber()),s=Math.ceil(new vs(e).sub(a).div(i).toNumber()),c=l+s+1;return c>n?mst(t,e,n,o,r+1):(c0?s+(n-c):s,l=e>0?l:l+(n-c)),{step:i,tickMin:a.sub(new vs(l).mul(i)),tickMax:a.add(new vs(s).mul(i))})}function vPo(t){var e=hL(t,2),n=e[0],o=e[1],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(r,2),l=pst([n,o]),s=hL(l,2),c=s[0],u=s[1];if(c===-1/0||u===1/0){var d=u===1/0?[c].concat(Che(The(0,r-1).map(function(){return 1/0}))):[].concat(Che(The(0,r-1).map(function(){return-1/0})),[u]);return n>o?Phe(d):d}if(c===u)return wPo(c,r,i);var f=mst(c,u,a,i),p=f.step,g=f.tickMin,y=f.tickMax,w=ite.rangeStep(g,y.add(new vs(.1).mul(p)),p);return n>o?Phe(w):w}function xPo(t,e){var n=hL(t,2),o=n[0],r=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=pst([o,r]),l=hL(a,2),s=l[0],c=l[1];if(s===-1/0||c===1/0)return[o,r];if(s===c)return[s];var u=Math.max(e,2),d=gst(new vs(c).sub(s).div(u-1),i,0),f=[].concat(Che(ite.rangeStep(new vs(s),new vs(c).sub(new vs(.99).mul(d)),d)),[c]);return o>r?Phe(f):f}var bPo=fst(vPo),SPo=fst(xPo),TPo="Invariant failed";function hb(t,e){throw new Error(TPo)}var PPo=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ZJ(){return ZJ=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function DPo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function FM(t){var e=t.offset,n=t.layout,o=t.width,r=t.dataKey,i=t.data,a=t.dataPointFormatter,l=t.xAxis,s=t.yAxis,c=zPo(t,PPo),u=ra(c,!1);t.direction==="x"&&l.type!=="number"&&hb();var d=i.map(function(f){var p=a(f,r),g=p.x,y=p.y,w=p.value,b=p.errorVal;if(!b)return null;var C=[],P,v;if(Array.isArray(b)){var T=CPo(b,2);P=T[0],v=T[1]}else P=v=b;if(n==="vertical"){var A=l.scale,x=y+e,S=x+o,R=x-o,M=A(w-P),D=A(w+v);C.push({x1:D,y1:S,x2:D,y2:R}),C.push({x1:M,y1:x,x2:D,y2:x}),C.push({x1:M,y1:S,x2:M,y2:R})}else if(n==="horizontal"){var E=s.scale,W=g+e,j=W-o,L=W+o,k=E(w-P),N=E(w+v);C.push({x1:j,y1:N,x2:L,y2:N}),C.push({x1:W,y1:k,x2:W,y2:N}),C.push({x1:j,y1:k,x2:L,y2:k})}return be.createElement(_l,ZJ({className:"recharts-errorBar",key:"bar-".concat(C.map(function(F){return"".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))},u),C.map(function(F){return be.createElement("line",ZJ({},F,{key:"line-".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))}))});return be.createElement(_l,{className:"recharts-errorBars"},d)}FM.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};FM.displayName="ErrorBar";function pL(t){"@babel/helpers - typeof";return pL=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},pL(t)}function KDe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Ple(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,a=-1,l=(n=o==null?void 0:o.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var s=i.range,c=0;c0?r[c-1].coordinate:r[l-1].coordinate,d=r[c].coordinate,f=c>=l-1?r[0].coordinate:r[c+1].coordinate,p=void 0;if(H2(d-u)!==H2(f-d)){var g=[];if(H2(f-d)===H2(s[1]-s[0])){p=f;var y=d+s[1]-s[0];g[0]=Math.min(y,(y+u)/2),g[1]=Math.max(y,(y+u)/2)}else{p=u;var w=f+s[1]-s[0];g[0]=Math.min(d,(w+d)/2),g[1]=Math.max(d,(w+d)/2)}var b=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(e>b[0]&&e<=b[1]||e>=g[0]&&e<=g[1]){a=r[c].index;break}}else{var C=Math.min(u,f),P=Math.max(u,f);if(e>(C+d)/2&&e<=(P+d)/2){a=r[c].index;break}}}else for(var v=0;v0&&v(o[v].coordinate+o[v-1].coordinate)/2&&e<=(o[v].coordinate+o[v+1].coordinate)/2||v===l-1&&e>(o[v].coordinate+o[v-1].coordinate)/2){a=o[v].index;break}return a},Z3e=function(e){var n=e,o=n.type.displayName,r=e.props,i=r.stroke,a=r.fill,l;switch(o){case"Line":l=i;break;case"Area":case"Radar":l=i&&i!=="none"?i:a;break;default:l=a;break}return l},OPo=function(e){var n=e.barSize,o=e.totalSize,r=e.stackGroups,i=r===void 0?{}:r;if(!i)return{};for(var a={},l=Object.keys(i),s=0,c=l.length;s=0});if(b&&b.length){var C=b[0].props.barSize,P=b[0].props[w];a[P]||(a[P]=[]);var v=ia(C)?n:C;a[P].push({item:b[0],stackList:b.slice(1),barSize:ia(v)?void 0:ub(v,o,0)})}}return a},_Po=function(e){var n=e.barGap,o=e.barCategoryGap,r=e.bandSize,i=e.sizeList,a=i===void 0?[]:i,l=e.maxBarSize,s=a.length;if(s<1)return null;var c=ub(n,r,0,!0),u,d=[];if(a[0].barSize===+a[0].barSize){var f=!1,p=r/s,g=a.reduce(function(v,T){return v+T.barSize||0},0);g+=(s-1)*c,g>=r&&(g-=(s-1)*c,c=0),g>=r&&p>0&&(f=!0,p*=.9,g=s*p);var y=(r-g)/2>>0,w={offset:y-c,size:0};u=a.reduce(function(v,T){var A={item:T.item,position:{offset:w.offset+w.size+c,size:f?p:T.barSize}},x=[].concat($De(v),[A]);return w=x[x.length-1].position,T.stackList&&T.stackList.length&&T.stackList.forEach(function(S){x.push({item:S,position:w})}),x},d)}else{var b=ub(o,r,0,!0);r-2*b-(s-1)*c<=0&&(c=0);var C=(r-2*b-(s-1)*c)/s;C>1&&(C>>=0);var P=l===+l?Math.min(C,l):C;u=a.reduce(function(v,T,A){var x=[].concat($De(v),[{item:T.item,position:{offset:b+(C+c)*A+(C-P)/2,size:P}}]);return T.stackList&&T.stackList.length&&T.stackList.forEach(function(S){x.push({item:S,position:x[x.length-1].position})}),x},d)}return u},VPo=function(e,n,o,r){var i=o.children,a=o.width,l=o.margin,s=a-(l.left||0)-(l.right||0),c=yst({children:i,legendWidth:s});if(c){var u=r||{},d=u.width,f=u.height,p=c.align,g=c.verticalAlign,y=c.layout;if((y==="vertical"||y==="horizontal"&&g==="middle")&&p!=="center"&&dr(e[p]))return zm(zm({},e),{},YC({},p,e[p]+(d||0)));if((y==="horizontal"||y==="vertical"&&p==="center")&&g!=="middle"&&dr(e[g]))return zm(zm({},e),{},YC({},g,e[g]+(f||0)))}return e},GPo=function(e,n,o){return ia(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||o==="x"?n==="xAxis":o==="y"?n==="yAxis":!0},Ast=function(e,n,o,r,i){var a=n.props.children,l=e1(a,FM).filter(function(c){return GPo(r,i,c.props.direction)});if(l&&l.length){var s=l.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var d=Bu(u,o);if(ia(d))return c;var f=Array.isArray(d)?[ote(d),T8(d)]:[d,d],p=s.reduce(function(g,y){var w=Bu(u,y,0),b=f[0]-Math.abs(Array.isArray(w)?w[0]:w),C=f[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(b,g[0]),Math.max(C,g[1])]},[1/0,-1/0]);return[Math.min(p[0],c[0]),Math.max(p[1],c[1])]},[1/0,-1/0])}return null},XPo=function(e,n,o,r,i){var a=n.map(function(l){return Ast(e,l,o,i,r)}).filter(function(l){return!ia(l)});return a&&a.length?a.reduce(function(l,s){return[Math.min(l[0],s[0]),Math.max(l[1],s[1])]},[1/0,-1/0]):null},wst=function(e,n,o,r,i){var a=n.map(function(s){var c=s.props.dataKey;return o==="number"&&c&&Ast(e,s,c,r)||XE(e,c,o,i)});if(o==="number")return a.reduce(function(s,c){return[Math.min(s[0],c[0]),Math.max(s[1],c[1])]},[1/0,-1/0]);var l={};return a.reduce(function(s,c){for(var u=0,d=c.length;u=2?H2(l[0]-l[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(d){var f=i?i.indexOf(d):d;return{coordinate:r(f)+c,value:d,offset:c}});return u.filter(function(d){return!IM(d.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(d,f){return{coordinate:r(d)+c,value:d,index:f,offset:c}}):r.ticks&&!o?r.ticks(e.tickCount).map(function(d){return{coordinate:r(d)+c,value:d,offset:c}}):r.domain().map(function(d,f){return{coordinate:r(d)+c,value:i?i[d]:d,index:f,offset:c}})},Cle=new WeakMap,e_=function(e,n){if(typeof n!="function")return e;Cle.has(e)||Cle.set(e,new WeakMap);var o=Cle.get(e);if(o.has(n))return o.get(n);var r=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return o.set(n,r),r},JPo=function(e,n,o){var r=e.scale,i=e.type,a=e.layout,l=e.axisType;if(r==="auto")return a==="radial"&&l==="radiusAxis"?{scale:aL(),realScaleType:"band"}:a==="radial"&&l==="angleAxis"?{scale:dL(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!o)?{scale:jC(),realScaleType:"point"}:i==="category"?{scale:aL(),realScaleType:"band"}:{scale:dL(),realScaleType:"linear"};if(_N(r)){var s="scale".concat(Oee(r));return{scale:(_De[s]||jC)(),realScaleType:_De[s]?s:"point"}}return va(r)?{scale:r}:{scale:jC(),realScaleType:"point"}},QDe=1e-4,KPo=function(e){var n=e.domain();if(!(!n||n.length<=2)){var o=n.length,r=e.range(),i=Math.min(r[0],r[1])-QDe,a=Math.max(r[0],r[1])+QDe,l=e(n[0]),s=e(n[o-1]);(la||sa)&&e.domain([n[0],n[o-1]])}},qPo=function(e,n){if(!e)return null;for(var o=0,r=e.length;or)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]=0?(e[l][o][0]=i,e[l][o][1]=i+s,i=e[l][o][1]):(e[l][o][0]=a,e[l][o][1]=a+s,a=e[l][o][1])}},ZPo=function(e){var n=e.length;if(!(n<=0))for(var o=0,r=e[0].length;o=0?(e[a][o][0]=i,e[a][o][1]=i+l,i=e[a][o][1]):(e[a][o][0]=0,e[a][o][1]=0)}},eCo={sign:QPo,expand:B8o,none:nH,silhouette:Y8o,wiggle:O8o,positive:ZPo},tCo=function(e,n,o){var r=n.map(function(l){return l.props.dataKey}),i=eCo[o],a=j8o().keys(r).value(function(l,s){return+Bu(l,s,0)}).order(rhe).offset(i);return a(e)},nCo=function(e,n,o,r,i,a){if(!e)return null;var l=a?n.reverse():n,s={},c=l.reduce(function(d,f){var p=f.props,g=p.stackId,y=p.hide;if(y)return d;var w=f.props[o],b=d[w]||{hasStack:!1,stackGroups:{}};if(Nu(g)){var C=b.stackGroups[g]||{numericAxisId:o,cateAxisId:r,items:[]};C.items.push(f),b.hasStack=!0,b.stackGroups[g]=C}else b.stackGroups[uS("_stackId_")]={numericAxisId:o,cateAxisId:r,items:[f]};return zm(zm({},d),{},YC({},w,b))},s),u={};return Object.keys(c).reduce(function(d,f){var p=c[f];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(y,w){var b=p.stackGroups[w];return zm(zm({},y),{},YC({},w,{numericAxisId:o,cateAxisId:r,items:b.items,stackedData:tCo(e,b.items,i)}))},g)}return zm(zm({},d),{},YC({},f,p))},u)},oCo=function(e,n){var o=n.realScaleType,r=n.type,i=n.tickCount,a=n.originalDomain,l=n.allowDecimals,s=o||n.scale;if(s!=="auto"&&s!=="linear")return null;if(i&&r==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=bPo(c,i,l);return e.domain([ote(u),T8(u)]),{niceTicks:u}}if(i&&r==="number"){var d=e.domain(),f=SPo(d,i,l);return{niceTicks:f}}return null};function uH(t){var e=t.axis,n=t.ticks,o=t.bandSize,r=t.entry,i=t.index,a=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!ia(r[e.dataKey])){var l=IJ(n,"value",r[e.dataKey]);if(l)return l.coordinate+o/2}return n[i]?n[i].coordinate+o/2:null}var s=Bu(r,ia(a)?e.dataKey:a);return ia(s)?null:e.scale(s)}var ZDe=function(e){var n=e.axis,o=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,l=e.index;if(n.type==="category")return o[l]?o[l].coordinate+r:null;var s=Bu(a,n.dataKey,n.domain[l]);return ia(s)?null:n.scale(s)-i/2+r},rCo=function(e){var n=e.numericAxis,o=n.scale.domain();if(n.type==="number"){var r=Math.min(o[0],o[1]),i=Math.max(o[0],o[1]);return r<=0&&i>=0?0:i<0?i:r}return o[0]},iCo=function(e,n){var o=e.props.stackId;if(Nu(o)){var r=n[o];if(r){var i=r.items.indexOf(e);return i>=0?r.stackedData[i]:null}}return null},aCo=function(e){return e.reduce(function(n,o){return[ote(o.concat([n[0]]).filter(dr)),T8(o.concat([n[1]]).filter(dr))]},[1/0,-1/0])},bst=function(e,n,o){return Object.keys(e).reduce(function(r,i){var a=e[i],l=a.stackedData,s=l.reduce(function(c,u){var d=aCo(u.slice(n,o+1));return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]).map(function(r){return r===1/0||r===-1/0?0:r})},eEe=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,tEe=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Mhe=function(e,n,o){if(va(e))return e(n,o);if(!Array.isArray(e))return n;var r=[];if(dr(e[0]))r[0]=o?e[0]:Math.min(e[0],n[0]);else if(eEe.test(e[0])){var i=+eEe.exec(e[0])[1];r[0]=n[0]-i}else va(e[0])?r[0]=e[0](n[0]):r[0]=n[0];if(dr(e[1]))r[1]=o?e[1]:Math.max(e[1],n[1]);else if(tEe.test(e[1])){var a=+tEe.exec(e[1])[1];r[1]=n[1]+a}else va(e[1])?r[1]=e[1](n[1]):r[1]=n[1];return r},eK=function(e,n,o){if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!o||r>0)return r}if(e&&n&&n.length>=2){for(var i=R3e(n,function(d){return d.coordinate}),a=1/0,l=1,s=i.length;la&&(c=2*Math.PI-c),{radius:l,angle:uCo(c),angleInRadian:c}},hCo=function(e){var n=e.startAngle,o=e.endAngle,r=Math.floor(n/360),i=Math.floor(o/360),a=Math.min(r,i);return{startAngle:n-a*360,endAngle:o-a*360}},pCo=function(e,n){var o=n.startAngle,r=n.endAngle,i=Math.floor(o/360),a=Math.floor(r/360),l=Math.min(i,a);return e+l*360},iEe=function(e,n){var o=e.x,r=e.y,i=fCo({x:o,y:r},n),a=i.radius,l=i.angle,s=n.innerRadius,c=n.outerRadius;if(ac)return!1;if(a===0)return!0;var u=hCo(n),d=u.startAngle,f=u.endAngle,p=l,g;if(d<=f){for(;p>f;)p-=360;for(;p=d&&p<=f}else{for(;p>d;)p-=360;for(;p=f&&p<=d}return g?rEe(rEe({},n),{},{radius:a,angle:pCo(p,n)}):null};function yL(t){"@babel/helpers - typeof";return yL=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},yL(t)}var gCo=["offset"];function mCo(t){return vCo(t)||wCo(t)||ACo(t)||yCo()}function yCo(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ACo(t,e){if(t){if(typeof t=="string")return Ihe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ihe(t,e)}}function wCo(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function vCo(t){if(Array.isArray(t))return Ihe(t)}function Ihe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function bCo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function aEe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Cu(t){for(var e=1;e=0?1:-1,P,v;r==="insideStart"?(P=p+C*a,v=y):r==="insideEnd"?(P=g-C*a,v=!y):r==="end"&&(P=g+C*a,v=y),v=b<=0?v:!v;var T=pf(c,u,w,P),A=pf(c,u,w,P+(v?1:-1)*359),x="M".concat(T.x,",").concat(T.y,` +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hst(t,e){if(t){if(typeof t=="string")return Rhe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rhe(t,e)}}function Rhe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],o=!0,r=!1,i=void 0;try{for(var a=t[Symbol.iterator](),l;!(o=(l=a.next()).done)&&(n.push(l.value),!(e&&n.length===e));o=!0);}catch(s){r=!0,i=s}finally{try{!o&&a.return!=null&&a.return()}finally{if(r)throw i}}return n}}function APo(t){if(Array.isArray(t))return t}function pst(t){var e=hL(t,2),n=e[0],o=e[1],r=n,i=o;return n>o&&(r=o,i=n),[r,i]}function gst(t,e,n){if(t.lte(0))return new vs(0);var o=ite.getDigitCount(t.toNumber()),r=new vs(10).pow(o),i=t.div(r),a=o!==1?.05:.1,l=new vs(Math.ceil(i.div(a).toNumber())).add(n).mul(a),s=l.mul(r);return e?s:new vs(Math.ceil(s))}function wPo(t,e,n){var o=1,r=new vs(t);if(!r.isint()&&n){var i=Math.abs(t);i<1?(o=new vs(10).pow(ite.getDigitCount(t)-1),r=new vs(Math.floor(r.div(o).toNumber())).mul(o)):i>1&&(r=new vs(Math.floor(t)))}else t===0?r=new vs(Math.floor((e-1)/2)):n||(r=new vs(Math.floor(t)));var a=Math.floor((e-1)/2),l=lPo(aPo(function(s){return r.add(new vs(s-a).mul(o)).toNumber()}),The);return l(0,e)}function mst(t,e,n,o){var r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new vs(0),tickMin:new vs(0),tickMax:new vs(0)};var i=gst(new vs(e).sub(t).div(n-1),o,r),a;t<=0&&e>=0?a=new vs(0):(a=new vs(t).add(e).div(2),a=a.sub(new vs(a).mod(i)));var l=Math.ceil(a.sub(t).div(i).toNumber()),s=Math.ceil(new vs(e).sub(a).div(i).toNumber()),c=l+s+1;return c>n?mst(t,e,n,o,r+1):(c0?s+(n-c):s,l=e>0?l:l+(n-c)),{step:i,tickMin:a.sub(new vs(l).mul(i)),tickMax:a.add(new vs(s).mul(i))})}function vPo(t){var e=hL(t,2),n=e[0],o=e[1],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(r,2),l=pst([n,o]),s=hL(l,2),c=s[0],u=s[1];if(c===-1/0||u===1/0){var d=u===1/0?[c].concat(Che(The(0,r-1).map(function(){return 1/0}))):[].concat(Che(The(0,r-1).map(function(){return-1/0})),[u]);return n>o?Phe(d):d}if(c===u)return wPo(c,r,i);var f=mst(c,u,a,i),p=f.step,g=f.tickMin,y=f.tickMax,w=ite.rangeStep(g,y.add(new vs(.1).mul(p)),p);return n>o?Phe(w):w}function xPo(t,e){var n=hL(t,2),o=n[0],r=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=pst([o,r]),l=hL(a,2),s=l[0],c=l[1];if(s===-1/0||c===1/0)return[o,r];if(s===c)return[s];var u=Math.max(e,2),d=gst(new vs(c).sub(s).div(u-1),i,0),f=[].concat(Che(ite.rangeStep(new vs(s),new vs(c).sub(new vs(.99).mul(d)),d)),[c]);return o>r?Phe(f):f}var bPo=fst(vPo),SPo=fst(xPo),TPo="Invariant failed";function hb(t,e){throw new Error(TPo)}var PPo=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function eK(){return eK=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function DPo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function FM(t){var e=t.offset,n=t.layout,o=t.width,r=t.dataKey,i=t.data,a=t.dataPointFormatter,l=t.xAxis,s=t.yAxis,c=zPo(t,PPo),u=ra(c,!1);t.direction==="x"&&l.type!=="number"&&hb();var d=i.map(function(f){var p=a(f,r),g=p.x,y=p.y,w=p.value,b=p.errorVal;if(!b)return null;var C=[],P,v;if(Array.isArray(b)){var T=CPo(b,2);P=T[0],v=T[1]}else P=v=b;if(n==="vertical"){var A=l.scale,x=y+e,S=x+o,R=x-o,M=A(w-P),D=A(w+v);C.push({x1:D,y1:S,x2:D,y2:R}),C.push({x1:M,y1:x,x2:D,y2:x}),C.push({x1:M,y1:S,x2:M,y2:R})}else if(n==="horizontal"){var E=s.scale,W=g+e,j=W-o,L=W+o,k=E(w-P),N=E(w+v);C.push({x1:j,y1:N,x2:L,y2:N}),C.push({x1:W,y1:k,x2:W,y2:N}),C.push({x1:j,y1:k,x2:L,y2:k})}return be.createElement(_l,eK({className:"recharts-errorBar",key:"bar-".concat(C.map(function(F){return"".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))},u),C.map(function(F){return be.createElement("line",eK({},F,{key:"line-".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))}))});return be.createElement(_l,{className:"recharts-errorBars"},d)}FM.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};FM.displayName="ErrorBar";function pL(t){"@babel/helpers - typeof";return pL=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},pL(t)}function qDe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Ple(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,a=-1,l=(n=o==null?void 0:o.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var s=i.range,c=0;c0?r[c-1].coordinate:r[l-1].coordinate,d=r[c].coordinate,f=c>=l-1?r[0].coordinate:r[c+1].coordinate,p=void 0;if(H2(d-u)!==H2(f-d)){var g=[];if(H2(f-d)===H2(s[1]-s[0])){p=f;var y=d+s[1]-s[0];g[0]=Math.min(y,(y+u)/2),g[1]=Math.max(y,(y+u)/2)}else{p=u;var w=f+s[1]-s[0];g[0]=Math.min(d,(w+d)/2),g[1]=Math.max(d,(w+d)/2)}var b=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(e>b[0]&&e<=b[1]||e>=g[0]&&e<=g[1]){a=r[c].index;break}}else{var C=Math.min(u,f),P=Math.max(u,f);if(e>(C+d)/2&&e<=(P+d)/2){a=r[c].index;break}}}else for(var v=0;v0&&v(o[v].coordinate+o[v-1].coordinate)/2&&e<=(o[v].coordinate+o[v+1].coordinate)/2||v===l-1&&e>(o[v].coordinate+o[v-1].coordinate)/2){a=o[v].index;break}return a},e6e=function(e){var n=e,o=n.type.displayName,r=e.props,i=r.stroke,a=r.fill,l;switch(o){case"Line":l=i;break;case"Area":case"Radar":l=i&&i!=="none"?i:a;break;default:l=a;break}return l},OPo=function(e){var n=e.barSize,o=e.totalSize,r=e.stackGroups,i=r===void 0?{}:r;if(!i)return{};for(var a={},l=Object.keys(i),s=0,c=l.length;s=0});if(b&&b.length){var C=b[0].props.barSize,P=b[0].props[w];a[P]||(a[P]=[]);var v=ia(C)?n:C;a[P].push({item:b[0],stackList:b.slice(1),barSize:ia(v)?void 0:ub(v,o,0)})}}return a},_Po=function(e){var n=e.barGap,o=e.barCategoryGap,r=e.bandSize,i=e.sizeList,a=i===void 0?[]:i,l=e.maxBarSize,s=a.length;if(s<1)return null;var c=ub(n,r,0,!0),u,d=[];if(a[0].barSize===+a[0].barSize){var f=!1,p=r/s,g=a.reduce(function(v,T){return v+T.barSize||0},0);g+=(s-1)*c,g>=r&&(g-=(s-1)*c,c=0),g>=r&&p>0&&(f=!0,p*=.9,g=s*p);var y=(r-g)/2>>0,w={offset:y-c,size:0};u=a.reduce(function(v,T){var A={item:T.item,position:{offset:w.offset+w.size+c,size:f?p:T.barSize}},x=[].concat(QDe(v),[A]);return w=x[x.length-1].position,T.stackList&&T.stackList.length&&T.stackList.forEach(function(S){x.push({item:S,position:w})}),x},d)}else{var b=ub(o,r,0,!0);r-2*b-(s-1)*c<=0&&(c=0);var C=(r-2*b-(s-1)*c)/s;C>1&&(C>>=0);var P=l===+l?Math.min(C,l):C;u=a.reduce(function(v,T,A){var x=[].concat(QDe(v),[{item:T.item,position:{offset:b+(C+c)*A+(C-P)/2,size:P}}]);return T.stackList&&T.stackList.length&&T.stackList.forEach(function(S){x.push({item:S,position:x[x.length-1].position})}),x},d)}return u},VPo=function(e,n,o,r){var i=o.children,a=o.width,l=o.margin,s=a-(l.left||0)-(l.right||0),c=yst({children:i,legendWidth:s});if(c){var u=r||{},d=u.width,f=u.height,p=c.align,g=c.verticalAlign,y=c.layout;if((y==="vertical"||y==="horizontal"&&g==="middle")&&p!=="center"&&dr(e[p]))return zm(zm({},e),{},YC({},p,e[p]+(d||0)));if((y==="horizontal"||y==="vertical"&&p==="center")&&g!=="middle"&&dr(e[g]))return zm(zm({},e),{},YC({},g,e[g]+(f||0)))}return e},GPo=function(e,n,o){return ia(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||o==="x"?n==="xAxis":o==="y"?n==="yAxis":!0},Ast=function(e,n,o,r,i){var a=n.props.children,l=e1(a,FM).filter(function(c){return GPo(r,i,c.props.direction)});if(l&&l.length){var s=l.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var d=Bu(u,o);if(ia(d))return c;var f=Array.isArray(d)?[ote(d),T8(d)]:[d,d],p=s.reduce(function(g,y){var w=Bu(u,y,0),b=f[0]-Math.abs(Array.isArray(w)?w[0]:w),C=f[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(b,g[0]),Math.max(C,g[1])]},[1/0,-1/0]);return[Math.min(p[0],c[0]),Math.max(p[1],c[1])]},[1/0,-1/0])}return null},XPo=function(e,n,o,r,i){var a=n.map(function(l){return Ast(e,l,o,i,r)}).filter(function(l){return!ia(l)});return a&&a.length?a.reduce(function(l,s){return[Math.min(l[0],s[0]),Math.max(l[1],s[1])]},[1/0,-1/0]):null},wst=function(e,n,o,r,i){var a=n.map(function(s){var c=s.props.dataKey;return o==="number"&&c&&Ast(e,s,c,r)||XE(e,c,o,i)});if(o==="number")return a.reduce(function(s,c){return[Math.min(s[0],c[0]),Math.max(s[1],c[1])]},[1/0,-1/0]);var l={};return a.reduce(function(s,c){for(var u=0,d=c.length;u=2?H2(l[0]-l[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(d){var f=i?i.indexOf(d):d;return{coordinate:r(f)+c,value:d,offset:c}});return u.filter(function(d){return!IM(d.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(d,f){return{coordinate:r(d)+c,value:d,index:f,offset:c}}):r.ticks&&!o?r.ticks(e.tickCount).map(function(d){return{coordinate:r(d)+c,value:d,offset:c}}):r.domain().map(function(d,f){return{coordinate:r(d)+c,value:i?i[d]:d,index:f,offset:c}})},Cle=new WeakMap,t_=function(e,n){if(typeof n!="function")return e;Cle.has(e)||Cle.set(e,new WeakMap);var o=Cle.get(e);if(o.has(n))return o.get(n);var r=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return o.set(n,r),r},JPo=function(e,n,o){var r=e.scale,i=e.type,a=e.layout,l=e.axisType;if(r==="auto")return a==="radial"&&l==="radiusAxis"?{scale:aL(),realScaleType:"band"}:a==="radial"&&l==="angleAxis"?{scale:dL(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!o)?{scale:jC(),realScaleType:"point"}:i==="category"?{scale:aL(),realScaleType:"band"}:{scale:dL(),realScaleType:"linear"};if(VN(r)){var s="scale".concat(Oee(r));return{scale:(VDe[s]||jC)(),realScaleType:VDe[s]?s:"point"}}return va(r)?{scale:r}:{scale:jC(),realScaleType:"point"}},ZDe=1e-4,KPo=function(e){var n=e.domain();if(!(!n||n.length<=2)){var o=n.length,r=e.range(),i=Math.min(r[0],r[1])-ZDe,a=Math.max(r[0],r[1])+ZDe,l=e(n[0]),s=e(n[o-1]);(la||sa)&&e.domain([n[0],n[o-1]])}},qPo=function(e,n){if(!e)return null;for(var o=0,r=e.length;or)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]=0?(e[l][o][0]=i,e[l][o][1]=i+s,i=e[l][o][1]):(e[l][o][0]=a,e[l][o][1]=a+s,a=e[l][o][1])}},ZPo=function(e){var n=e.length;if(!(n<=0))for(var o=0,r=e[0].length;o=0?(e[a][o][0]=i,e[a][o][1]=i+l,i=e[a][o][1]):(e[a][o][0]=0,e[a][o][1]=0)}},eCo={sign:QPo,expand:B8o,none:nH,silhouette:Y8o,wiggle:O8o,positive:ZPo},tCo=function(e,n,o){var r=n.map(function(l){return l.props.dataKey}),i=eCo[o],a=j8o().keys(r).value(function(l,s){return+Bu(l,s,0)}).order(rhe).offset(i);return a(e)},nCo=function(e,n,o,r,i,a){if(!e)return null;var l=a?n.reverse():n,s={},c=l.reduce(function(d,f){var p=f.props,g=p.stackId,y=p.hide;if(y)return d;var w=f.props[o],b=d[w]||{hasStack:!1,stackGroups:{}};if(Nu(g)){var C=b.stackGroups[g]||{numericAxisId:o,cateAxisId:r,items:[]};C.items.push(f),b.hasStack=!0,b.stackGroups[g]=C}else b.stackGroups[uS("_stackId_")]={numericAxisId:o,cateAxisId:r,items:[f]};return zm(zm({},d),{},YC({},w,b))},s),u={};return Object.keys(c).reduce(function(d,f){var p=c[f];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(y,w){var b=p.stackGroups[w];return zm(zm({},y),{},YC({},w,{numericAxisId:o,cateAxisId:r,items:b.items,stackedData:tCo(e,b.items,i)}))},g)}return zm(zm({},d),{},YC({},f,p))},u)},oCo=function(e,n){var o=n.realScaleType,r=n.type,i=n.tickCount,a=n.originalDomain,l=n.allowDecimals,s=o||n.scale;if(s!=="auto"&&s!=="linear")return null;if(i&&r==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=bPo(c,i,l);return e.domain([ote(u),T8(u)]),{niceTicks:u}}if(i&&r==="number"){var d=e.domain(),f=SPo(d,i,l);return{niceTicks:f}}return null};function uH(t){var e=t.axis,n=t.ticks,o=t.bandSize,r=t.entry,i=t.index,a=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!ia(r[e.dataKey])){var l=zJ(n,"value",r[e.dataKey]);if(l)return l.coordinate+o/2}return n[i]?n[i].coordinate+o/2:null}var s=Bu(r,ia(a)?e.dataKey:a);return ia(s)?null:e.scale(s)}var eEe=function(e){var n=e.axis,o=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,l=e.index;if(n.type==="category")return o[l]?o[l].coordinate+r:null;var s=Bu(a,n.dataKey,n.domain[l]);return ia(s)?null:n.scale(s)-i/2+r},rCo=function(e){var n=e.numericAxis,o=n.scale.domain();if(n.type==="number"){var r=Math.min(o[0],o[1]),i=Math.max(o[0],o[1]);return r<=0&&i>=0?0:i<0?i:r}return o[0]},iCo=function(e,n){var o=e.props.stackId;if(Nu(o)){var r=n[o];if(r){var i=r.items.indexOf(e);return i>=0?r.stackedData[i]:null}}return null},aCo=function(e){return e.reduce(function(n,o){return[ote(o.concat([n[0]]).filter(dr)),T8(o.concat([n[1]]).filter(dr))]},[1/0,-1/0])},bst=function(e,n,o){return Object.keys(e).reduce(function(r,i){var a=e[i],l=a.stackedData,s=l.reduce(function(c,u){var d=aCo(u.slice(n,o+1));return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]).map(function(r){return r===1/0||r===-1/0?0:r})},tEe=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,nEe=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Mhe=function(e,n,o){if(va(e))return e(n,o);if(!Array.isArray(e))return n;var r=[];if(dr(e[0]))r[0]=o?e[0]:Math.min(e[0],n[0]);else if(tEe.test(e[0])){var i=+tEe.exec(e[0])[1];r[0]=n[0]-i}else va(e[0])?r[0]=e[0](n[0]):r[0]=n[0];if(dr(e[1]))r[1]=o?e[1]:Math.max(e[1],n[1]);else if(nEe.test(e[1])){var a=+nEe.exec(e[1])[1];r[1]=n[1]+a}else va(e[1])?r[1]=e[1](n[1]):r[1]=n[1];return r},tK=function(e,n,o){if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!o||r>0)return r}if(e&&n&&n.length>=2){for(var i=H3e(n,function(d){return d.coordinate}),a=1/0,l=1,s=i.length;la&&(c=2*Math.PI-c),{radius:l,angle:uCo(c),angleInRadian:c}},hCo=function(e){var n=e.startAngle,o=e.endAngle,r=Math.floor(n/360),i=Math.floor(o/360),a=Math.min(r,i);return{startAngle:n-a*360,endAngle:o-a*360}},pCo=function(e,n){var o=n.startAngle,r=n.endAngle,i=Math.floor(o/360),a=Math.floor(r/360),l=Math.min(i,a);return e+l*360},aEe=function(e,n){var o=e.x,r=e.y,i=fCo({x:o,y:r},n),a=i.radius,l=i.angle,s=n.innerRadius,c=n.outerRadius;if(ac)return!1;if(a===0)return!0;var u=hCo(n),d=u.startAngle,f=u.endAngle,p=l,g;if(d<=f){for(;p>f;)p-=360;for(;p=d&&p<=f}else{for(;p>d;)p-=360;for(;p=f&&p<=d}return g?iEe(iEe({},n),{},{radius:a,angle:pCo(p,n)}):null};function yL(t){"@babel/helpers - typeof";return yL=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},yL(t)}var gCo=["offset"];function mCo(t){return vCo(t)||wCo(t)||ACo(t)||yCo()}function yCo(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ACo(t,e){if(t){if(typeof t=="string")return Ihe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ihe(t,e)}}function wCo(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function vCo(t){if(Array.isArray(t))return Ihe(t)}function Ihe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function bCo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function lEe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Cu(t){for(var e=1;e=0?1:-1,P,v;r==="insideStart"?(P=p+C*a,v=y):r==="insideEnd"?(P=g-C*a,v=!y):r==="end"&&(P=g+C*a,v=y),v=b<=0?v:!v;var T=pf(c,u,w,P),A=pf(c,u,w,P+(v?1:-1)*359),x="M".concat(T.x,",").concat(T.y,` A`).concat(w,",").concat(w,",0,1,").concat(v?0:1,`, - `).concat(A.x,",").concat(A.y),S=ia(e.id)?uS("recharts-radial-line-"):e.id;return be.createElement("text",AL({},o,{dominantBaseline:"central",className:fl("recharts-radial-bar-label",l)}),be.createElement("defs",null,be.createElement("path",{id:S,d:x})),be.createElement("textPath",{xlinkHref:"#".concat(S)},n))},MCo=function(e){var n=e.viewBox,o=e.offset,r=e.position,i=n,a=i.cx,l=i.cy,s=i.innerRadius,c=i.outerRadius,u=i.startAngle,d=i.endAngle,f=(u+d)/2;if(r==="outside"){var p=pf(a,l,c+o,f),g=p.x,y=p.y;return{x:g,y,textAnchor:g>=a?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"end"};var w=(s+c)/2,b=pf(a,l,w,f),C=b.x,P=b.y;return{x:C,y:P,textAnchor:"middle",verticalAnchor:"middle"}},ICo=function(e){var n=e.viewBox,o=e.parentViewBox,r=e.offset,i=e.position,a=n,l=a.x,s=a.y,c=a.width,u=a.height,d=u>=0?1:-1,f=d*r,p=d>0?"end":"start",g=d>0?"start":"end",y=c>=0?1:-1,w=y*r,b=y>0?"end":"start",C=y>0?"start":"end";if(i==="top"){var P={x:l+c/2,y:s-d*r,textAnchor:"middle",verticalAnchor:p};return Cu(Cu({},P),o?{height:Math.max(s-o.y,0),width:c}:{})}if(i==="bottom"){var v={x:l+c/2,y:s+u+f,textAnchor:"middle",verticalAnchor:g};return Cu(Cu({},v),o?{height:Math.max(o.y+o.height-(s+u),0),width:c}:{})}if(i==="left"){var T={x:l-w,y:s+u/2,textAnchor:b,verticalAnchor:"middle"};return Cu(Cu({},T),o?{width:Math.max(T.x-o.x,0),height:u}:{})}if(i==="right"){var A={x:l+c+w,y:s+u/2,textAnchor:C,verticalAnchor:"middle"};return Cu(Cu({},A),o?{width:Math.max(o.x+o.width-A.x,0),height:u}:{})}var x=o?{width:c,height:u}:{};return i==="insideLeft"?Cu({x:l+w,y:s+u/2,textAnchor:C,verticalAnchor:"middle"},x):i==="insideRight"?Cu({x:l+c-w,y:s+u/2,textAnchor:b,verticalAnchor:"middle"},x):i==="insideTop"?Cu({x:l+c/2,y:s+f,textAnchor:"middle",verticalAnchor:g},x):i==="insideBottom"?Cu({x:l+c/2,y:s+u-f,textAnchor:"middle",verticalAnchor:p},x):i==="insideTopLeft"?Cu({x:l+w,y:s+f,textAnchor:C,verticalAnchor:g},x):i==="insideTopRight"?Cu({x:l+c-w,y:s+f,textAnchor:b,verticalAnchor:g},x):i==="insideBottomLeft"?Cu({x:l+w,y:s+u-f,textAnchor:C,verticalAnchor:p},x):i==="insideBottomRight"?Cu({x:l+c-w,y:s+u-f,textAnchor:b,verticalAnchor:p},x):fM(i)&&(dr(i.x)||$v(i.x))&&(dr(i.y)||$v(i.y))?Cu({x:l+ub(i.x,c),y:s+ub(i.y,u),textAnchor:"end",verticalAnchor:"end"},x):Cu({x:l+c/2,y:s+u/2,textAnchor:"middle",verticalAnchor:"middle"},x)},zCo=function(e){return"cx"in e&&dr(e.cx)};function os(t){var e=t.offset,n=e===void 0?5:e,o=xCo(t,gCo),r=Cu({offset:n},o),i=r.viewBox,a=r.position,l=r.value,s=r.children,c=r.content,u=r.className,d=u===void 0?"":u,f=r.textBreakAll;if(!i||ia(l)&&ia(s)&&!m.isValidElement(c)&&!va(c))return null;if(m.isValidElement(c))return m.cloneElement(c,r);var p;if(va(c)){if(p=m.createElement(c,r),m.isValidElement(p))return p}else p=CCo(r);var g=zCo(i),y=ra(r,!0);if(g&&(a==="insideStart"||a==="insideEnd"||a==="end"))return HCo(r,p,y);var w=g?MCo(r):ICo(r);return be.createElement(YJ,AL({className:fl("recharts-label",d)},y,w,{breakAll:f}),p)}os.displayName="Label";var Tst=function(e){var n=e.cx,o=e.cy,r=e.angle,i=e.startAngle,a=e.endAngle,l=e.r,s=e.radius,c=e.innerRadius,u=e.outerRadius,d=e.x,f=e.y,p=e.top,g=e.left,y=e.width,w=e.height,b=e.clockWise,C=e.labelViewBox;if(C)return C;if(dr(y)&&dr(w)){if(dr(d)&&dr(f))return{x:d,y:f,width:y,height:w};if(dr(p)&&dr(g))return{x:p,y:g,width:y,height:w}}return dr(d)&&dr(f)?{x:d,y:f,width:0,height:0}:dr(n)&&dr(o)?{cx:n,cy:o,startAngle:i||r||0,endAngle:a||r||0,innerRadius:c||0,outerRadius:u||s||l||0,clockWise:b}:e.viewBox?e.viewBox:{}},DCo=function(e,n){return e?e===!0?be.createElement(os,{key:"label-implicit",viewBox:n}):Nu(e)?be.createElement(os,{key:"label-implicit",viewBox:n,value:e}):m.isValidElement(e)?e.type===os?m.cloneElement(e,{key:"label-implicit",viewBox:n}):be.createElement(os,{key:"label-implicit",content:e,viewBox:n}):va(e)?be.createElement(os,{key:"label-implicit",content:e,viewBox:n}):fM(e)?be.createElement(os,AL({viewBox:n},e,{key:"label-implicit"})):null:null},ECo=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&o&&!e.label)return null;var r=e.children,i=Tst(e),a=e1(r,os).map(function(s,c){return m.cloneElement(s,{viewBox:n||i,key:"label-".concat(c)})});if(!o)return a;var l=DCo(e.label,n||i);return[l].concat(mCo(a))};os.parseViewBox=Tst;os.renderCallByParent=ECo;function FCo(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var kCo=FCo;const LCo=Fi(kCo);function wL(t){"@babel/helpers - typeof";return wL=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},wL(t)}var WCo=["valueAccessor"],NCo=["data","dataKey","clockWise","id","textBreakAll"];function UCo(t){return OCo(t)||YCo(t)||BCo(t)||jCo()}function jCo(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BCo(t,e){if(t){if(typeof t=="string")return zhe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zhe(t,e)}}function YCo(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function OCo(t){if(Array.isArray(t))return zhe(t)}function zhe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function XCo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}var JCo=function(e){return Array.isArray(e.value)?LCo(e.value):e.value};function F9(t){var e=t.valueAccessor,n=e===void 0?JCo:e,o=cEe(t,WCo),r=o.data,i=o.dataKey,a=o.clockWise,l=o.id,s=o.textBreakAll,c=cEe(o,NCo);return!r||!r.length?null:be.createElement(_l,{className:"recharts-label-list"},r.map(function(u,d){var f=ia(i)?n(u,d):Bu(u&&u.payload,i),p=ia(l)?{}:{id:"".concat(l,"-").concat(d)};return be.createElement(os,nK({},ra(u,!0),c,p,{parentViewBox:u.parentViewBox,value:f,textBreakAll:s,viewBox:os.parseViewBox(ia(a)?u:sEe(sEe({},u),{},{clockWise:a})),key:"label-".concat(d),index:d}))}))}F9.displayName="LabelList";function KCo(t,e){return t?t===!0?be.createElement(F9,{key:"labelList-implicit",data:e}):be.isValidElement(t)||va(t)?be.createElement(F9,{key:"labelList-implicit",data:e,content:t}):fM(t)?be.createElement(F9,nK({data:e},t,{key:"labelList-implicit"})):null:null}function qCo(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var o=t.children,r=e1(o,F9).map(function(a,l){return m.cloneElement(a,{data:e,key:"labelList-".concat(l)})});if(!n)return r;var i=KCo(t.label,e);return[i].concat(UCo(r))}F9.renderCallByParent=qCo;function vL(t){"@babel/helpers - typeof";return vL=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},vL(t)}function Dhe(){return Dhe=Object.assign?Object.assign.bind():function(t){for(var e=1;e=a?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"end"};var w=(s+c)/2,b=pf(a,l,w,f),C=b.x,P=b.y;return{x:C,y:P,textAnchor:"middle",verticalAnchor:"middle"}},ICo=function(e){var n=e.viewBox,o=e.parentViewBox,r=e.offset,i=e.position,a=n,l=a.x,s=a.y,c=a.width,u=a.height,d=u>=0?1:-1,f=d*r,p=d>0?"end":"start",g=d>0?"start":"end",y=c>=0?1:-1,w=y*r,b=y>0?"end":"start",C=y>0?"start":"end";if(i==="top"){var P={x:l+c/2,y:s-d*r,textAnchor:"middle",verticalAnchor:p};return Cu(Cu({},P),o?{height:Math.max(s-o.y,0),width:c}:{})}if(i==="bottom"){var v={x:l+c/2,y:s+u+f,textAnchor:"middle",verticalAnchor:g};return Cu(Cu({},v),o?{height:Math.max(o.y+o.height-(s+u),0),width:c}:{})}if(i==="left"){var T={x:l-w,y:s+u/2,textAnchor:b,verticalAnchor:"middle"};return Cu(Cu({},T),o?{width:Math.max(T.x-o.x,0),height:u}:{})}if(i==="right"){var A={x:l+c+w,y:s+u/2,textAnchor:C,verticalAnchor:"middle"};return Cu(Cu({},A),o?{width:Math.max(o.x+o.width-A.x,0),height:u}:{})}var x=o?{width:c,height:u}:{};return i==="insideLeft"?Cu({x:l+w,y:s+u/2,textAnchor:C,verticalAnchor:"middle"},x):i==="insideRight"?Cu({x:l+c-w,y:s+u/2,textAnchor:b,verticalAnchor:"middle"},x):i==="insideTop"?Cu({x:l+c/2,y:s+f,textAnchor:"middle",verticalAnchor:g},x):i==="insideBottom"?Cu({x:l+c/2,y:s+u-f,textAnchor:"middle",verticalAnchor:p},x):i==="insideTopLeft"?Cu({x:l+w,y:s+f,textAnchor:C,verticalAnchor:g},x):i==="insideTopRight"?Cu({x:l+c-w,y:s+f,textAnchor:b,verticalAnchor:g},x):i==="insideBottomLeft"?Cu({x:l+w,y:s+u-f,textAnchor:C,verticalAnchor:p},x):i==="insideBottomRight"?Cu({x:l+c-w,y:s+u-f,textAnchor:b,verticalAnchor:p},x):fM(i)&&(dr(i.x)||$v(i.x))&&(dr(i.y)||$v(i.y))?Cu({x:l+ub(i.x,c),y:s+ub(i.y,u),textAnchor:"end",verticalAnchor:"end"},x):Cu({x:l+c/2,y:s+u/2,textAnchor:"middle",verticalAnchor:"middle"},x)},zCo=function(e){return"cx"in e&&dr(e.cx)};function os(t){var e=t.offset,n=e===void 0?5:e,o=xCo(t,gCo),r=Cu({offset:n},o),i=r.viewBox,a=r.position,l=r.value,s=r.children,c=r.content,u=r.className,d=u===void 0?"":u,f=r.textBreakAll;if(!i||ia(l)&&ia(s)&&!m.isValidElement(c)&&!va(c))return null;if(m.isValidElement(c))return m.cloneElement(c,r);var p;if(va(c)){if(p=m.createElement(c,r),m.isValidElement(p))return p}else p=CCo(r);var g=zCo(i),y=ra(r,!0);if(g&&(a==="insideStart"||a==="insideEnd"||a==="end"))return HCo(r,p,y);var w=g?MCo(r):ICo(r);return be.createElement(OJ,AL({className:fl("recharts-label",d)},y,w,{breakAll:f}),p)}os.displayName="Label";var Tst=function(e){var n=e.cx,o=e.cy,r=e.angle,i=e.startAngle,a=e.endAngle,l=e.r,s=e.radius,c=e.innerRadius,u=e.outerRadius,d=e.x,f=e.y,p=e.top,g=e.left,y=e.width,w=e.height,b=e.clockWise,C=e.labelViewBox;if(C)return C;if(dr(y)&&dr(w)){if(dr(d)&&dr(f))return{x:d,y:f,width:y,height:w};if(dr(p)&&dr(g))return{x:p,y:g,width:y,height:w}}return dr(d)&&dr(f)?{x:d,y:f,width:0,height:0}:dr(n)&&dr(o)?{cx:n,cy:o,startAngle:i||r||0,endAngle:a||r||0,innerRadius:c||0,outerRadius:u||s||l||0,clockWise:b}:e.viewBox?e.viewBox:{}},DCo=function(e,n){return e?e===!0?be.createElement(os,{key:"label-implicit",viewBox:n}):Nu(e)?be.createElement(os,{key:"label-implicit",viewBox:n,value:e}):m.isValidElement(e)?e.type===os?m.cloneElement(e,{key:"label-implicit",viewBox:n}):be.createElement(os,{key:"label-implicit",content:e,viewBox:n}):va(e)?be.createElement(os,{key:"label-implicit",content:e,viewBox:n}):fM(e)?be.createElement(os,AL({viewBox:n},e,{key:"label-implicit"})):null:null},ECo=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&o&&!e.label)return null;var r=e.children,i=Tst(e),a=e1(r,os).map(function(s,c){return m.cloneElement(s,{viewBox:n||i,key:"label-".concat(c)})});if(!o)return a;var l=DCo(e.label,n||i);return[l].concat(mCo(a))};os.parseViewBox=Tst;os.renderCallByParent=ECo;function FCo(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var kCo=FCo;const LCo=Fi(kCo);function wL(t){"@babel/helpers - typeof";return wL=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},wL(t)}var WCo=["valueAccessor"],NCo=["data","dataKey","clockWise","id","textBreakAll"];function UCo(t){return OCo(t)||YCo(t)||BCo(t)||jCo()}function jCo(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BCo(t,e){if(t){if(typeof t=="string")return zhe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zhe(t,e)}}function YCo(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function OCo(t){if(Array.isArray(t))return zhe(t)}function zhe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function XCo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}var JCo=function(e){return Array.isArray(e.value)?LCo(e.value):e.value};function F9(t){var e=t.valueAccessor,n=e===void 0?JCo:e,o=uEe(t,WCo),r=o.data,i=o.dataKey,a=o.clockWise,l=o.id,s=o.textBreakAll,c=uEe(o,NCo);return!r||!r.length?null:be.createElement(_l,{className:"recharts-label-list"},r.map(function(u,d){var f=ia(i)?n(u,d):Bu(u&&u.payload,i),p=ia(l)?{}:{id:"".concat(l,"-").concat(d)};return be.createElement(os,oK({},ra(u,!0),c,p,{parentViewBox:u.parentViewBox,value:f,textBreakAll:s,viewBox:os.parseViewBox(ia(a)?u:cEe(cEe({},u),{},{clockWise:a})),key:"label-".concat(d),index:d}))}))}F9.displayName="LabelList";function KCo(t,e){return t?t===!0?be.createElement(F9,{key:"labelList-implicit",data:e}):be.isValidElement(t)||va(t)?be.createElement(F9,{key:"labelList-implicit",data:e,content:t}):fM(t)?be.createElement(F9,oK({data:e},t,{key:"labelList-implicit"})):null:null}function qCo(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var o=t.children,r=e1(o,F9).map(function(a,l){return m.cloneElement(a,{data:e,key:"labelList-".concat(l)})});if(!n)return r;var i=KCo(t.label,e);return[i].concat(UCo(r))}F9.renderCallByParent=qCo;function vL(t){"@babel/helpers - typeof";return vL=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},vL(t)}function Dhe(){return Dhe=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(a>c),`, `).concat(d.x,",").concat(d.y,` `);if(r>0){var p=pf(n,o,r,a),g=pf(n,o,r,c);f+="L ".concat(g.x,",").concat(g.y,` A `).concat(r,",").concat(r,`,0, `).concat(+(Math.abs(s)>180),",").concat(+(a<=c),`, - `).concat(p.x,",").concat(p.y," Z")}else f+="L ".concat(n,",").concat(o," Z");return f},tRo=function(e){var n=e.cx,o=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,l=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,d=H2(u-c),f=t_({cx:n,cy:o,radius:i,angle:c,sign:d,cornerRadius:a,cornerIsExternal:s}),p=f.circleTangency,g=f.lineTangency,y=f.theta,w=t_({cx:n,cy:o,radius:i,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:s}),b=w.circleTangency,C=w.lineTangency,P=w.theta,v=s?Math.abs(c-u):Math.abs(c-u)-y-P;if(v<0)return l?"M ".concat(g.x,",").concat(g.y,` + `).concat(p.x,",").concat(p.y," Z")}else f+="L ".concat(n,",").concat(o," Z");return f},tRo=function(e){var n=e.cx,o=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,l=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,d=H2(u-c),f=n_({cx:n,cy:o,radius:i,angle:c,sign:d,cornerRadius:a,cornerIsExternal:s}),p=f.circleTangency,g=f.lineTangency,y=f.theta,w=n_({cx:n,cy:o,radius:i,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:s}),b=w.circleTangency,C=w.lineTangency,P=w.theta,v=s?Math.abs(c-u):Math.abs(c-u)-y-P;if(v<0)return l?"M ".concat(g.x,",").concat(g.y,` a`).concat(a,",").concat(a,",0,0,1,").concat(a*2,`,0 a`).concat(a,",").concat(a,",0,0,1,").concat(-a*2,`,0 `):Pst({cx:n,cy:o,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var T="M ".concat(g.x,",").concat(g.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(p.x,",").concat(p.y,` A`).concat(i,",").concat(i,",0,").concat(+(v>180),",").concat(+(d<0),",").concat(b.x,",").concat(b.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(C.x,",").concat(C.y,` - `);if(r>0){var A=t_({cx:n,cy:o,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),x=A.circleTangency,S=A.lineTangency,R=A.theta,M=t_({cx:n,cy:o,radius:r,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),D=M.circleTangency,E=M.lineTangency,W=M.theta,j=s?Math.abs(c-u):Math.abs(c-u)-R-W;if(j<0&&a===0)return"".concat(T,"L").concat(n,",").concat(o,"Z");T+="L".concat(E.x,",").concat(E.y,` + `);if(r>0){var A=n_({cx:n,cy:o,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),x=A.circleTangency,S=A.lineTangency,R=A.theta,M=n_({cx:n,cy:o,radius:r,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),D=M.circleTangency,E=M.lineTangency,W=M.theta,j=s?Math.abs(c-u):Math.abs(c-u)-R-W;if(j<0&&a===0)return"".concat(T,"L").concat(n,",").concat(o,"Z");T+="L".concat(E.x,",").concat(E.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(D.x,",").concat(D.y,` A`).concat(r,",").concat(r,",0,").concat(+(j>180),",").concat(+(d>0),",").concat(x.x,",").concat(x.y,` - A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(S.x,",").concat(S.y,"Z")}else T+="L".concat(n,",").concat(o,"Z");return T},nRo={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Cst=function(e){var n=dEe(dEe({},nRo),e),o=n.cx,r=n.cy,i=n.innerRadius,a=n.outerRadius,l=n.cornerRadius,s=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,d=n.endAngle,f=n.className;if(a0&&Math.abs(u-d)<360?w=tRo({cx:o,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(y,g/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:u,endAngle:d}):w=Pst({cx:o,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d}),be.createElement("path",Dhe({},ra(n,!0),{className:p,d:w,role:"img"}))};function xL(t){"@babel/helpers - typeof";return xL=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},xL(t)}function Ehe(){return Ehe=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[o],e[o],o,o,t,e,n))return!1;return!0}function fRo(t,e){return kM(t.getTime(),e.getTime())}function wEe(t,e,n){if(t.size!==e.size)return!1;for(var o={},r=t.entries(),i=0,a,l;(a=r.next())&&!a.done;){for(var s=e.entries(),c=!1,u=0;(l=s.next())&&!l.done;){var d=a.value,f=d[0],p=d[1],g=l.value,y=g[0],w=g[1];!c&&!o[u]&&(c=n.equals(f,y,i,u,t,e,n)&&n.equals(p,w,f,y,t,e,n))&&(o[u]=!0),u++}if(!c)return!1;i++}return!0}function hRo(t,e,n){var o=AEe(t),r=o.length;if(AEe(e).length!==r)return!1;for(var i;r-- >0;)if(i=o[r],i===Hst&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Rst(e,i)||!n.equals(t[i],e[i],i,i,t,e,n))return!1;return!0}function gD(t,e,n){var o=mEe(t),r=o.length;if(mEe(e).length!==r)return!1;for(var i,a,l;r-- >0;)if(i=o[r],i===Hst&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Rst(e,i)||!n.equals(t[i],e[i],i,i,t,e,n)||(a=yEe(t,i),l=yEe(e,i),(a||l)&&(!a||!l||a.configurable!==l.configurable||a.enumerable!==l.enumerable||a.writable!==l.writable)))return!1;return!0}function pRo(t,e){return kM(t.valueOf(),e.valueOf())}function gRo(t,e){return t.source===e.source&&t.flags===e.flags}function vEe(t,e,n){if(t.size!==e.size)return!1;for(var o={},r=t.values(),i,a;(i=r.next())&&!i.done;){for(var l=e.values(),s=!1,c=0;(a=l.next())&&!a.done;)!s&&!o[c]&&(s=n.equals(i.value,a.value,i.value,a.value,t,e,n))&&(o[c]=!0),c++;if(!s)return!1}return!0}function mRo(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var yRo="[object Arguments]",ARo="[object Boolean]",wRo="[object Date]",vRo="[object Map]",xRo="[object Number]",bRo="[object Object]",SRo="[object RegExp]",TRo="[object Set]",PRo="[object String]",CRo=Array.isArray,xEe=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,bEe=Object.assign,RRo=Object.prototype.toString.call.bind(Object.prototype.toString);function HRo(t){var e=t.areArraysEqual,n=t.areDatesEqual,o=t.areMapsEqual,r=t.areObjectsEqual,i=t.arePrimitiveWrappersEqual,a=t.areRegExpsEqual,l=t.areSetsEqual,s=t.areTypedArraysEqual;return function(u,d,f){if(u===d)return!0;if(u==null||d==null||typeof u!="object"||typeof d!="object")return u!==u&&d!==d;var p=u.constructor;if(p!==d.constructor)return!1;if(p===Object)return r(u,d,f);if(CRo(u))return e(u,d,f);if(xEe!=null&&xEe(u))return s(u,d,f);if(p===Date)return n(u,d,f);if(p===RegExp)return a(u,d,f);if(p===Map)return o(u,d,f);if(p===Set)return l(u,d,f);var g=RRo(u);return g===wRo?n(u,d,f):g===SRo?a(u,d,f):g===vRo?o(u,d,f):g===TRo?l(u,d,f):g===bRo?typeof u.then!="function"&&typeof d.then!="function"&&r(u,d,f):g===yRo?r(u,d,f):g===ARo||g===xRo||g===PRo?i(u,d,f):!1}}function MRo(t){var e=t.circular,n=t.createCustomConfig,o=t.strict,r={areArraysEqual:o?gD:dRo,areDatesEqual:fRo,areMapsEqual:o?gEe(wEe,gD):wEe,areObjectsEqual:o?gD:hRo,arePrimitiveWrappersEqual:pRo,areRegExpsEqual:gRo,areSetsEqual:o?gEe(vEe,gD):vEe,areTypedArraysEqual:o?gD:mRo};if(n&&(r=bEe({},r,n(r))),e){var i=o_(r.areArraysEqual),a=o_(r.areMapsEqual),l=o_(r.areObjectsEqual),s=o_(r.areSetsEqual);r=bEe({},r,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:l,areSetsEqual:s})}return r}function IRo(t){return function(e,n,o,r,i,a,l){return t(e,n,l)}}function zRo(t){var e=t.circular,n=t.comparator,o=t.createState,r=t.equals,i=t.strict;if(o)return function(s,c){var u=o(),d=u.cache,f=d===void 0?e?new WeakMap:void 0:d,p=u.meta;return n(s,c,{cache:f,equals:r,meta:p,strict:i})};if(e)return function(s,c){return n(s,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};var a={cache:void 0,equals:r,meta:void 0,strict:i};return function(s,c){return n(s,c,a)}}var DRo=Zw();Zw({strict:!0});Zw({circular:!0});Zw({circular:!0,strict:!0});Zw({createInternalComparator:function(){return kM}});Zw({strict:!0,createInternalComparator:function(){return kM}});Zw({circular:!0,createInternalComparator:function(){return kM}});Zw({circular:!0,createInternalComparator:function(){return kM},strict:!0});function Zw(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,o=t.createInternalComparator,r=t.createState,i=t.strict,a=i===void 0?!1:i,l=MRo(t),s=HRo(l),c=o?o(s):IRo(s);return zRo({circular:n,comparator:s,createState:r,equals:c,strict:a})}function ERo(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function SEe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,o=function r(i){n<0&&(n=i),i-n>e?(t(i),n=-1):ERo(r)};requestAnimationFrame(o)}function Fhe(t){"@babel/helpers - typeof";return Fhe=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},Fhe(t)}function FRo(t){return NRo(t)||WRo(t)||LRo(t)||kRo()}function kRo(){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 LRo(t,e){if(t){if(typeof t=="string")return TEe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TEe(t,e)}}function TEe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n0&&Math.abs(u-d)<360?w=tRo({cx:o,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(y,g/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:u,endAngle:d}):w=Pst({cx:o,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d}),be.createElement("path",Dhe({},ra(n,!0),{className:p,d:w,role:"img"}))};function xL(t){"@babel/helpers - typeof";return xL=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},xL(t)}function Ehe(){return Ehe=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[o],e[o],o,o,t,e,n))return!1;return!0}function fRo(t,e){return kM(t.getTime(),e.getTime())}function vEe(t,e,n){if(t.size!==e.size)return!1;for(var o={},r=t.entries(),i=0,a,l;(a=r.next())&&!a.done;){for(var s=e.entries(),c=!1,u=0;(l=s.next())&&!l.done;){var d=a.value,f=d[0],p=d[1],g=l.value,y=g[0],w=g[1];!c&&!o[u]&&(c=n.equals(f,y,i,u,t,e,n)&&n.equals(p,w,f,y,t,e,n))&&(o[u]=!0),u++}if(!c)return!1;i++}return!0}function hRo(t,e,n){var o=wEe(t),r=o.length;if(wEe(e).length!==r)return!1;for(var i;r-- >0;)if(i=o[r],i===Hst&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Rst(e,i)||!n.equals(t[i],e[i],i,i,t,e,n))return!1;return!0}function gD(t,e,n){var o=yEe(t),r=o.length;if(yEe(e).length!==r)return!1;for(var i,a,l;r-- >0;)if(i=o[r],i===Hst&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Rst(e,i)||!n.equals(t[i],e[i],i,i,t,e,n)||(a=AEe(t,i),l=AEe(e,i),(a||l)&&(!a||!l||a.configurable!==l.configurable||a.enumerable!==l.enumerable||a.writable!==l.writable)))return!1;return!0}function pRo(t,e){return kM(t.valueOf(),e.valueOf())}function gRo(t,e){return t.source===e.source&&t.flags===e.flags}function xEe(t,e,n){if(t.size!==e.size)return!1;for(var o={},r=t.values(),i,a;(i=r.next())&&!i.done;){for(var l=e.values(),s=!1,c=0;(a=l.next())&&!a.done;)!s&&!o[c]&&(s=n.equals(i.value,a.value,i.value,a.value,t,e,n))&&(o[c]=!0),c++;if(!s)return!1}return!0}function mRo(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var yRo="[object Arguments]",ARo="[object Boolean]",wRo="[object Date]",vRo="[object Map]",xRo="[object Number]",bRo="[object Object]",SRo="[object RegExp]",TRo="[object Set]",PRo="[object String]",CRo=Array.isArray,bEe=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,SEe=Object.assign,RRo=Object.prototype.toString.call.bind(Object.prototype.toString);function HRo(t){var e=t.areArraysEqual,n=t.areDatesEqual,o=t.areMapsEqual,r=t.areObjectsEqual,i=t.arePrimitiveWrappersEqual,a=t.areRegExpsEqual,l=t.areSetsEqual,s=t.areTypedArraysEqual;return function(u,d,f){if(u===d)return!0;if(u==null||d==null||typeof u!="object"||typeof d!="object")return u!==u&&d!==d;var p=u.constructor;if(p!==d.constructor)return!1;if(p===Object)return r(u,d,f);if(CRo(u))return e(u,d,f);if(bEe!=null&&bEe(u))return s(u,d,f);if(p===Date)return n(u,d,f);if(p===RegExp)return a(u,d,f);if(p===Map)return o(u,d,f);if(p===Set)return l(u,d,f);var g=RRo(u);return g===wRo?n(u,d,f):g===SRo?a(u,d,f):g===vRo?o(u,d,f):g===TRo?l(u,d,f):g===bRo?typeof u.then!="function"&&typeof d.then!="function"&&r(u,d,f):g===yRo?r(u,d,f):g===ARo||g===xRo||g===PRo?i(u,d,f):!1}}function MRo(t){var e=t.circular,n=t.createCustomConfig,o=t.strict,r={areArraysEqual:o?gD:dRo,areDatesEqual:fRo,areMapsEqual:o?mEe(vEe,gD):vEe,areObjectsEqual:o?gD:hRo,arePrimitiveWrappersEqual:pRo,areRegExpsEqual:gRo,areSetsEqual:o?mEe(xEe,gD):xEe,areTypedArraysEqual:o?gD:mRo};if(n&&(r=SEe({},r,n(r))),e){var i=r_(r.areArraysEqual),a=r_(r.areMapsEqual),l=r_(r.areObjectsEqual),s=r_(r.areSetsEqual);r=SEe({},r,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:l,areSetsEqual:s})}return r}function IRo(t){return function(e,n,o,r,i,a,l){return t(e,n,l)}}function zRo(t){var e=t.circular,n=t.comparator,o=t.createState,r=t.equals,i=t.strict;if(o)return function(s,c){var u=o(),d=u.cache,f=d===void 0?e?new WeakMap:void 0:d,p=u.meta;return n(s,c,{cache:f,equals:r,meta:p,strict:i})};if(e)return function(s,c){return n(s,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};var a={cache:void 0,equals:r,meta:void 0,strict:i};return function(s,c){return n(s,c,a)}}var DRo=Zw();Zw({strict:!0});Zw({circular:!0});Zw({circular:!0,strict:!0});Zw({createInternalComparator:function(){return kM}});Zw({strict:!0,createInternalComparator:function(){return kM}});Zw({circular:!0,createInternalComparator:function(){return kM}});Zw({circular:!0,createInternalComparator:function(){return kM},strict:!0});function Zw(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,o=t.createInternalComparator,r=t.createState,i=t.strict,a=i===void 0?!1:i,l=MRo(t),s=HRo(l),c=o?o(s):IRo(s);return zRo({circular:n,comparator:s,createState:r,equals:c,strict:a})}function ERo(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function TEe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,o=function r(i){n<0&&(n=i),i-n>e?(t(i),n=-1):ERo(r)};requestAnimationFrame(o)}function Fhe(t){"@babel/helpers - typeof";return Fhe=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},Fhe(t)}function FRo(t){return NRo(t)||WRo(t)||LRo(t)||kRo()}function kRo(){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 LRo(t,e){if(t){if(typeof t=="string")return PEe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PEe(t,e)}}function PEe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);nt.length)&&(e=t.length);for(var n=0,o=new Array(e);n1?1:b<0?0:b},y=function(b){for(var C=b>1?1:b,P=C,v=0;v<8;++v){var T=d(P)-C,A=p(P);if(Math.abs(T-C)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,o=n===void 0?100:n,r=e.damping,i=r===void 0?8:r,a=e.dt,l=a===void 0?17:a,s=function(u,d,f){var p=-(u-d)*o,g=f*i,y=f+(p-g)*l/1e3,w=f*l/1e3+u;return Math.abs(w-d)t.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function gHo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function Rle(t){return wHo(t)||AHo(t)||yHo(t)||mHo()}function mHo(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yHo(t,e){if(t){if(typeof t=="string")return Uhe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Uhe(t,e)}}function AHo(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function wHo(t){if(Array.isArray(t))return Uhe(t)}function Uhe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function iK(t){return iK=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},iK(t)}var K2=function(t){THo(n,t);var e=PHo(n);function n(o,r){var i;vHo(this,n),i=e.call(this,o,r);var a=i.props,l=a.isActive,s=a.attributeName,c=a.from,u=a.to,d=a.steps,f=a.children,p=a.duration;if(i.handleStyleChange=i.handleStyleChange.bind(Yhe(i)),i.changeStyle=i.changeStyle.bind(Yhe(i)),!l||p<=0)return i.state={style:{}},typeof f=="function"&&(i.state={style:u}),Bhe(i);if(d&&d.length)i.state={style:d[0].style};else if(c){if(typeof f=="function")return i.state={style:c},Bhe(i);i.state={style:s?KD({},s,c):c}}else i.state={style:{}};return i}return bHo(n,[{key:"componentDidMount",value:function(){var r=this.props,i=r.isActive,a=r.canBegin;this.mounted=!0,!(!i||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(r){var i=this.props,a=i.isActive,l=i.canBegin,s=i.attributeName,c=i.shouldReAnimate,u=i.to,d=i.from,f=this.state.style;if(l){if(!a){var p={style:s?KD({},s,u):u};this.state&&f&&(s&&f[s]!==u||!s&&f!==u)&&this.setState(p);return}if(!(DRo(r.to,u)&&r.canBegin&&r.isActive)){var g=!r.canBegin||!r.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=g||c?d:r.to;if(this.state&&f){var w={style:s?KD({},s,y):y};(s&&f[s]!==y||!s&&f!==y)&&this.setState(w)}this.runAnimation(qy(qy({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var r=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),r&&r()}},{key:"handleStyleChange",value:function(r){this.changeStyle(r)}},{key:"changeStyle",value:function(r){this.mounted&&this.setState({style:r})}},{key:"runJSAnimation",value:function(r){var i=this,a=r.from,l=r.to,s=r.duration,c=r.easing,u=r.begin,d=r.onAnimationEnd,f=r.onAnimationStart,p=fHo(a,l,tHo(c),s,this.changeStyle),g=function(){i.stopJSAnimation=p()};this.manager.start([f,u,g,s,d])}},{key:"runStepAnimation",value:function(r){var i=this,a=r.steps,l=r.begin,s=r.onAnimationStart,c=a[0],u=c.style,d=c.duration,f=d===void 0?0:d,p=function(y,w,b){if(b===0)return y;var C=w.duration,P=w.easing,v=P===void 0?"ease":P,T=w.style,A=w.properties,x=w.onAnimationEnd,S=b>0?a[b-1]:w,R=A||Object.keys(T);if(typeof v=="function"||v==="spring")return[].concat(Rle(y),[i.runJSAnimation.bind(i,{from:S.style,to:T,duration:C,easing:v}),C]);var M=REe(R,C,v),D=qy(qy(qy({},S.style),T),{},{transition:M});return[].concat(Rle(y),[D,C,x]).filter(ORo)};return this.manager.start([s].concat(Rle(a.reduce(p,[u,Math.max(f,l)])),[r.onAnimationEnd]))}},{key:"runAnimation",value:function(r){this.manager||(this.manager=URo());var i=r.begin,a=r.duration,l=r.attributeName,s=r.to,c=r.easing,u=r.onAnimationStart,d=r.onAnimationEnd,f=r.steps,p=r.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof c=="function"||typeof p=="function"||c==="spring"){this.runJSAnimation(r);return}if(f.length>1){this.runStepAnimation(r);return}var y=l?KD({},l,s):s,w=REe(Object.keys(y),a,c);g.start([u,i,qy(qy({},y),{},{transition:w}),a,d])}},{key:"render",value:function(){var r=this.props,i=r.children;r.begin;var a=r.duration;r.attributeName,r.easing;var l=r.isActive;r.steps,r.from,r.to,r.canBegin,r.onAnimationEnd,r.shouldReAnimate,r.onAnimationReStart;var s=pHo(r,hHo),c=m.Children.count(i),u=this.state.style;if(typeof i=="function")return i(u);if(!l||c===0||a<=0)return i;var d=function(p){var g=p.props,y=g.style,w=y===void 0?{}:y,b=g.className,C=m.cloneElement(p,qy(qy({},s),{},{style:qy(qy({},w),u),className:b}));return C};return c===1?d(m.Children.only(i)):be.createElement("div",null,m.Children.map(i,function(f){return d(f)}))}}]),n}(m.PureComponent);K2.displayName="Animate";K2.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};K2.propTypes={from:go.oneOfType([go.object,go.string]),to:go.oneOfType([go.object,go.string]),attributeName:go.string,duration:go.number,begin:go.number,easing:go.oneOfType([go.string,go.func]),steps:go.arrayOf(go.shape({duration:go.number.isRequired,style:go.object.isRequired,easing:go.oneOfType([go.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),go.func]),properties:go.arrayOf("string"),onAnimationEnd:go.func})),children:go.oneOfType([go.node,go.func]),isActive:go.bool,canBegin:go.bool,onAnimationEnd:go.func,shouldReAnimate:go.bool,onAnimationStart:go.func,onAnimationReStart:go.func};go.object,go.object,go.object,go.element;go.object,go.object,go.object,go.oneOfType([go.array,go.element]),go.any;function TL(t){"@babel/helpers - typeof";return TL=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},TL(t)}function aK(){return aK=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0?1:-1,s=o>=0?1:-1,c=r>=0&&o>=0||r<0&&o<0?1:0,u;if(a>0&&i instanceof Array){for(var d=[0,0,0,0],f=0,p=4;fa?a:i[f];u="M".concat(e,",").concat(n+l*d[0]),d[0]>0&&(u+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(c,",").concat(e+s*d[0],",").concat(n)),u+="L ".concat(e+o-s*d[1],",").concat(n),d[1]>0&&(u+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(c,`, +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ist(t,e){if(t){if(typeof t=="string")return khe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return khe(t,e)}}function $Ro(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function QRo(t){if(Array.isArray(t))return khe(t)}function khe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n1?1:b<0?0:b},y=function(b){for(var C=b>1?1:b,P=C,v=0;v<8;++v){var T=d(P)-C,A=p(P);if(Math.abs(T-C)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,o=n===void 0?100:n,r=e.damping,i=r===void 0?8:r,a=e.dt,l=a===void 0?17:a,s=function(u,d,f){var p=-(u-d)*o,g=f*i,y=f+(p-g)*l/1e3,w=f*l/1e3+u;return Math.abs(w-d)t.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function gHo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function Rle(t){return wHo(t)||AHo(t)||yHo(t)||mHo()}function mHo(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yHo(t,e){if(t){if(typeof t=="string")return Uhe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Uhe(t,e)}}function AHo(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function wHo(t){if(Array.isArray(t))return Uhe(t)}function Uhe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function aK(t){return aK=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},aK(t)}var K2=function(t){THo(n,t);var e=PHo(n);function n(o,r){var i;vHo(this,n),i=e.call(this,o,r);var a=i.props,l=a.isActive,s=a.attributeName,c=a.from,u=a.to,d=a.steps,f=a.children,p=a.duration;if(i.handleStyleChange=i.handleStyleChange.bind(Yhe(i)),i.changeStyle=i.changeStyle.bind(Yhe(i)),!l||p<=0)return i.state={style:{}},typeof f=="function"&&(i.state={style:u}),Bhe(i);if(d&&d.length)i.state={style:d[0].style};else if(c){if(typeof f=="function")return i.state={style:c},Bhe(i);i.state={style:s?KD({},s,c):c}}else i.state={style:{}};return i}return bHo(n,[{key:"componentDidMount",value:function(){var r=this.props,i=r.isActive,a=r.canBegin;this.mounted=!0,!(!i||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(r){var i=this.props,a=i.isActive,l=i.canBegin,s=i.attributeName,c=i.shouldReAnimate,u=i.to,d=i.from,f=this.state.style;if(l){if(!a){var p={style:s?KD({},s,u):u};this.state&&f&&(s&&f[s]!==u||!s&&f!==u)&&this.setState(p);return}if(!(DRo(r.to,u)&&r.canBegin&&r.isActive)){var g=!r.canBegin||!r.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=g||c?d:r.to;if(this.state&&f){var w={style:s?KD({},s,y):y};(s&&f[s]!==y||!s&&f!==y)&&this.setState(w)}this.runAnimation(qy(qy({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var r=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),r&&r()}},{key:"handleStyleChange",value:function(r){this.changeStyle(r)}},{key:"changeStyle",value:function(r){this.mounted&&this.setState({style:r})}},{key:"runJSAnimation",value:function(r){var i=this,a=r.from,l=r.to,s=r.duration,c=r.easing,u=r.begin,d=r.onAnimationEnd,f=r.onAnimationStart,p=fHo(a,l,tHo(c),s,this.changeStyle),g=function(){i.stopJSAnimation=p()};this.manager.start([f,u,g,s,d])}},{key:"runStepAnimation",value:function(r){var i=this,a=r.steps,l=r.begin,s=r.onAnimationStart,c=a[0],u=c.style,d=c.duration,f=d===void 0?0:d,p=function(y,w,b){if(b===0)return y;var C=w.duration,P=w.easing,v=P===void 0?"ease":P,T=w.style,A=w.properties,x=w.onAnimationEnd,S=b>0?a[b-1]:w,R=A||Object.keys(T);if(typeof v=="function"||v==="spring")return[].concat(Rle(y),[i.runJSAnimation.bind(i,{from:S.style,to:T,duration:C,easing:v}),C]);var M=HEe(R,C,v),D=qy(qy(qy({},S.style),T),{},{transition:M});return[].concat(Rle(y),[D,C,x]).filter(ORo)};return this.manager.start([s].concat(Rle(a.reduce(p,[u,Math.max(f,l)])),[r.onAnimationEnd]))}},{key:"runAnimation",value:function(r){this.manager||(this.manager=URo());var i=r.begin,a=r.duration,l=r.attributeName,s=r.to,c=r.easing,u=r.onAnimationStart,d=r.onAnimationEnd,f=r.steps,p=r.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof c=="function"||typeof p=="function"||c==="spring"){this.runJSAnimation(r);return}if(f.length>1){this.runStepAnimation(r);return}var y=l?KD({},l,s):s,w=HEe(Object.keys(y),a,c);g.start([u,i,qy(qy({},y),{},{transition:w}),a,d])}},{key:"render",value:function(){var r=this.props,i=r.children;r.begin;var a=r.duration;r.attributeName,r.easing;var l=r.isActive;r.steps,r.from,r.to,r.canBegin,r.onAnimationEnd,r.shouldReAnimate,r.onAnimationReStart;var s=pHo(r,hHo),c=m.Children.count(i),u=this.state.style;if(typeof i=="function")return i(u);if(!l||c===0||a<=0)return i;var d=function(p){var g=p.props,y=g.style,w=y===void 0?{}:y,b=g.className,C=m.cloneElement(p,qy(qy({},s),{},{style:qy(qy({},w),u),className:b}));return C};return c===1?d(m.Children.only(i)):be.createElement("div",null,m.Children.map(i,function(f){return d(f)}))}}]),n}(m.PureComponent);K2.displayName="Animate";K2.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};K2.propTypes={from:go.oneOfType([go.object,go.string]),to:go.oneOfType([go.object,go.string]),attributeName:go.string,duration:go.number,begin:go.number,easing:go.oneOfType([go.string,go.func]),steps:go.arrayOf(go.shape({duration:go.number.isRequired,style:go.object.isRequired,easing:go.oneOfType([go.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),go.func]),properties:go.arrayOf("string"),onAnimationEnd:go.func})),children:go.oneOfType([go.node,go.func]),isActive:go.bool,canBegin:go.bool,onAnimationEnd:go.func,shouldReAnimate:go.bool,onAnimationStart:go.func,onAnimationReStart:go.func};go.object,go.object,go.object,go.element;go.object,go.object,go.object,go.oneOfType([go.array,go.element]),go.any;function TL(t){"@babel/helpers - typeof";return TL=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},TL(t)}function lK(){return lK=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0?1:-1,s=o>=0?1:-1,c=r>=0&&o>=0||r<0&&o<0?1:0,u;if(a>0&&i instanceof Array){for(var d=[0,0,0,0],f=0,p=4;fa?a:i[f];u="M".concat(e,",").concat(n+l*d[0]),d[0]>0&&(u+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(c,",").concat(e+s*d[0],",").concat(n)),u+="L ".concat(e+o-s*d[1],",").concat(n),d[1]>0&&(u+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(c,`, `).concat(e+o,",").concat(n+l*d[1])),u+="L ".concat(e+o,",").concat(n+r-l*d[2]),d[2]>0&&(u+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(c,`, `).concat(e+o-s*d[2],",").concat(n+r)),u+="L ".concat(e+s*d[3],",").concat(n+r),d[3]>0&&(u+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(c,`, `).concat(e,",").concat(n+r-l*d[3])),u+="Z"}else if(a>0&&i===+i&&i>0){var g=Math.min(a,i);u="M ".concat(e,",").concat(n+l*g,` @@ -8619,13 +8619,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(e+o,",").concat(n+r-l*g,` A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(e+o-s*g,",").concat(n+r,` L `).concat(e+s*g,",").concat(n+r,` - A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(e,",").concat(n+r-l*g," Z")}else u="M ".concat(e,",").concat(n," h ").concat(o," v ").concat(r," h ").concat(-o," Z");return u},kHo=function(e,n){if(!e||!n)return!1;var o=e.x,r=e.y,i=n.x,a=n.y,l=n.width,s=n.height;if(Math.abs(l)>0&&Math.abs(s)>0){var c=Math.min(i,i+l),u=Math.max(i,i+l),d=Math.min(a,a+s),f=Math.max(a,a+s);return o>=c&&o<=u&&r>=d&&r<=f}return!1},LHo={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},e6e=function(e){var n=kEe(kEe({},LHo),e),o=m.useRef(),r=m.useState(-1),i=RHo(r,2),a=i[0],l=i[1];m.useEffect(function(){if(o.current&&o.current.getTotalLength)try{var v=o.current.getTotalLength();v&&l(v)}catch{}},[]);var s=n.x,c=n.y,u=n.width,d=n.height,f=n.radius,p=n.className,g=n.animationEasing,y=n.animationDuration,w=n.animationBegin,b=n.isAnimationActive,C=n.isUpdateAnimationActive;if(s!==+s||c!==+c||u!==+u||d!==+d||u===0||d===0)return null;var P=fl("recharts-rectangle",p);return C?be.createElement(K2,{canBegin:a>0,from:{width:u,height:d,x:s,y:c},to:{width:u,height:d,x:s,y:c},duration:y,animationEasing:g,isActive:C},function(v){var T=v.width,A=v.height,x=v.x,S=v.y;return be.createElement(K2,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:y,isActive:b,easing:g},be.createElement("path",aK({},ra(n,!0),{className:P,d:LEe(x,S,T,A,f),ref:o})))}):be.createElement("path",aK({},ra(n,!0),{className:P,d:LEe(s,c,u,d,f)}))};function Ohe(){return Ohe=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function OHo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}var _Ho=function(e,n,o,r,i,a){return"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(n,"h").concat(o)},VHo=function(e){var n=e.x,o=n===void 0?0:n,r=e.y,i=r===void 0?0:r,a=e.top,l=a===void 0?0:a,s=e.left,c=s===void 0?0:s,u=e.width,d=u===void 0?0:u,f=e.height,p=f===void 0?0:f,g=e.className,y=YHo(e,WHo),w=NHo({x:o,y:i,top:l,left:c,width:d,height:p},y);return!dr(o)||!dr(i)||!dr(d)||!dr(p)||!dr(l)||!dr(c)?null:be.createElement("path",_he({},ra(w,!0),{className:fl("recharts-cross",g),d:_Ho(o,i,d,p,l,c)}))},GHo=bA,XHo=s5,JHo="[object Boolean]";function KHo(t){return t===!0||t===!1||XHo(t)&&GHo(t)==JHo}var qHo=KHo;const $Ho=Fi(qHo);function CL(t){"@babel/helpers - typeof";return CL=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},CL(t)}function lK(){return lK=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:f,x:s,y:c},to:{upperWidth:u,lowerWidth:d,height:f,x:s,y:c},duration:y,animationEasing:g,isActive:b},function(P){var v=P.upperWidth,T=P.lowerWidth,A=P.height,x=P.x,S=P.y;return be.createElement(K2,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:y,easing:g},be.createElement("path",lK({},ra(n,!0),{className:C,d:BEe(x,S,v,T,A),ref:o})))}):be.createElement("g",null,be.createElement("path",lK({},ra(n,!0),{className:C,d:BEe(s,c,u,d,f)})))},sMo=["option","shapeType","propTransformer","activeClassName","isActive"];function RL(t){"@babel/helpers - typeof";return RL=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},RL(t)}function cMo(t,e){if(t==null)return{};var n=uMo(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function uMo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function YEe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function sK(t){for(var e=1;e0&&o.handleDrag(r.changedTouches[0])}),Z1($5(o),"handleDragEnd",function(){o.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var r=o.props,i=r.endIndex,a=r.onDragEnd,l=r.startIndex;a==null||a({endIndex:i,startIndex:l})}),o.detachDragEndListener()}),Z1($5(o),"handleLeaveWrapper",function(){(o.state.isTravellerMoving||o.state.isSlideMoving)&&(o.leaveTimer=window.setTimeout(o.handleDragEnd,o.props.leaveTimeOut))}),Z1($5(o),"handleEnterSlideOrTraveller",function(){o.setState({isTextActive:!0})}),Z1($5(o),"handleLeaveSlideOrTraveller",function(){o.setState({isTextActive:!1})}),Z1($5(o),"handleSlideDragStart",function(r){var i=KEe(r)?r.changedTouches[0]:r;o.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),o.attachDragEndListener()}),o.travellerDragStartHandlers={startX:o.handleTravellerDragStart.bind($5(o),"startX"),endX:o.handleTravellerDragStart.bind($5(o),"endX")},o.state={},o}return OMo(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(o){var r=o.startX,i=o.endX,a=this.state.scaleValues,l=this.props,s=l.gap,c=l.data,u=c.length-1,d=Math.min(r,i),f=Math.max(r,i),p=e.getIndexInRange(a,d),g=e.getIndexInRange(a,f);return{startIndex:p-p%s,endIndex:g===u?u:g-g%s}}},{key:"getTextOfTick",value:function(o){var r=this.props,i=r.data,a=r.tickFormatter,l=r.dataKey,s=Bu(i[o],l,o);return va(a)?a(s,o):s}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(o){var r=this.state,i=r.slideMoveStartX,a=r.startX,l=r.endX,s=this.props,c=s.x,u=s.width,d=s.travellerWidth,f=s.startIndex,p=s.endIndex,g=s.onChange,y=o.pageX-i;y>0?y=Math.min(y,c+u-d-l,c+u-d-a):y<0&&(y=Math.max(y,c-a,c-l));var w=this.getIndex({startX:a+y,endX:l+y});(w.startIndex!==f||w.endIndex!==p)&&g&&g(w),this.setState({startX:a+y,endX:l+y,slideMoveStartX:o.pageX})}},{key:"handleTravellerDragStart",value:function(o,r){var i=KEe(r)?r.changedTouches[0]:r;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:o,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(o){var r=this.state,i=r.brushMoveStartX,a=r.movingTravellerId,l=r.endX,s=r.startX,c=this.state[a],u=this.props,d=u.x,f=u.width,p=u.travellerWidth,g=u.onChange,y=u.gap,w=u.data,b={startX:this.state.startX,endX:this.state.endX},C=o.pageX-i;C>0?C=Math.min(C,d+f-p-c):C<0&&(C=Math.max(C,d-c)),b[a]=c+C;var P=this.getIndex(b),v=P.startIndex,T=P.endIndex,A=function(){var S=w.length-1;return a==="startX"&&(l>s?v%y===0:T%y===0)||ls?T%y===0:v%y===0)||l>s&&T===S};this.setState(Z1(Z1({},a,c+C),"brushMoveStartX",o.pageX),function(){g&&A()&&g(P)})}},{key:"handleTravellerMoveKeyboard",value:function(o,r){var i=this,a=this.state,l=a.scaleValues,s=a.startX,c=a.endX,u=this.state[r],d=l.indexOf(u);if(d!==-1){var f=d+o;if(!(f===-1||f>=l.length)){var p=l[f];r==="startX"&&p>=c||r==="endX"&&p<=s||this.setState(Z1({},r,p),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var o=this.props,r=o.x,i=o.y,a=o.width,l=o.height,s=o.fill,c=o.stroke;return be.createElement("rect",{stroke:c,fill:s,x:r,y:i,width:a,height:l})}},{key:"renderPanorama",value:function(){var o=this.props,r=o.x,i=o.y,a=o.width,l=o.height,s=o.data,c=o.children,u=o.padding,d=m.Children.only(c);return d?be.cloneElement(d,{x:r,y:i,width:a,height:l,margin:u,compact:!0,data:s}):null}},{key:"renderTravellerLayer",value:function(o,r){var i,a,l=this,s=this.props,c=s.y,u=s.travellerWidth,d=s.height,f=s.traveller,p=s.ariaLabel,g=s.data,y=s.startIndex,w=s.endIndex,b=Math.max(o,this.props.x),C=Mle(Mle({},ra(this.props,!1)),{},{x:b,y:c,width:u,height:d}),P=p||"Min value: ".concat((i=g[y])===null||i===void 0?void 0:i.name,", Max value: ").concat((a=g[w])===null||a===void 0?void 0:a.name);return be.createElement(_l,{tabIndex:0,role:"slider","aria-label":P,"aria-valuenow":o,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[r],onTouchStart:this.travellerDragStartHandlers[r],onKeyDown:function(T){["ArrowLeft","ArrowRight"].includes(T.key)&&(T.preventDefault(),T.stopPropagation(),l.handleTravellerMoveKeyboard(T.key==="ArrowRight"?1:-1,r))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(f,C))}},{key:"renderSlide",value:function(o,r){var i=this.props,a=i.y,l=i.height,s=i.stroke,c=i.travellerWidth,u=Math.min(o,r)+c,d=Math.max(Math.abs(r-o)-c,0);return be.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:s,fillOpacity:.2,x:u,y:a,width:d,height:l})}},{key:"renderText",value:function(){var o=this.props,r=o.startIndex,i=o.endIndex,a=o.y,l=o.height,s=o.travellerWidth,c=o.stroke,u=this.state,d=u.startX,f=u.endX,p=5,g={pointerEvents:"none",fill:c};return be.createElement(_l,{className:"recharts-brush-texts"},be.createElement(YJ,uK({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,f)-p,y:a+l/2},g),this.getTextOfTick(r)),be.createElement(YJ,uK({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,f)+s+p,y:a+l/2},g),this.getTextOfTick(i)))}},{key:"render",value:function(){var o=this.props,r=o.data,i=o.className,a=o.children,l=o.x,s=o.y,c=o.width,u=o.height,d=o.alwaysShowText,f=this.state,p=f.startX,g=f.endX,y=f.isTextActive,w=f.isSlideMoving,b=f.isTravellerMoving,C=f.isTravellerFocused;if(!r||!r.length||!dr(l)||!dr(s)||!dr(c)||!dr(u)||c<=0||u<=0)return null;var P=fl("recharts-brush",i),v=be.Children.count(a)===1,T=BMo("userSelect","none");return be.createElement(_l,{className:P,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:T},this.renderBackground(),v&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(y||w||b||C||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(o){var r=o.x,i=o.y,a=o.width,l=o.height,s=o.stroke,c=Math.floor(i+l/2)-1;return be.createElement(be.Fragment,null,be.createElement("rect",{x:r,y:i,width:a,height:l,fill:s,stroke:"none"}),be.createElement("line",{x1:r+1,y1:c,x2:r+a-1,y2:c,fill:"none",stroke:"#fff"}),be.createElement("line",{x1:r+1,y1:c+2,x2:r+a-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(o,r){var i;return be.isValidElement(o)?i=be.cloneElement(o,r):va(o)?i=o(r):i=e.renderDefaultTraveller(r),i}},{key:"getDerivedStateFromProps",value:function(o,r){var i=o.data,a=o.width,l=o.x,s=o.travellerWidth,c=o.updateId,u=o.startIndex,d=o.endIndex;if(i!==r.prevData||c!==r.prevUpdateId)return Mle({prevData:i,prevTravellerWidth:s,prevUpdateId:c,prevX:l,prevWidth:a},i&&i.length?JMo({data:i,width:a,x:l,travellerWidth:s,startIndex:u,endIndex:d}):{scale:null,scaleValues:null});if(r.scale&&(a!==r.prevWidth||l!==r.prevX||s!==r.prevTravellerWidth)){r.scale.range([l,l+a-s]);var f=r.scale.domain().map(function(p){return r.scale(p)});return{prevData:i,prevTravellerWidth:s,prevUpdateId:c,prevX:l,prevWidth:a,startX:r.scale(o.startIndex),endX:r.scale(o.endIndex),scaleValues:f}}return null}},{key:"getIndexInRange",value:function(o,r){for(var i=o.length,a=0,l=i-1;l-a>1;){var s=Math.floor((a+l)/2);o[s]>r?l=s:a=s}return r>=o[l]?l:a}}]),e}(m.PureComponent);Z1(hH,"displayName","Brush");Z1(hH,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var KMo=Q5e;function qMo(t,e){var n;return KMo(t,function(o,r,i){return n=e(o,r,i),!n}),!!n}var $Mo=qMo,QMo=got,ZMo=Xw,eIo=$Mo,tIo=vp,nIo=Kee;function oIo(t,e,n){var o=tIo(t)?QMo:eIo;return n&&nIo(t,e,n)&&(e=void 0),o(t,ZMo(e))}var rIo=oIo;const iIo=Fi(rIo);var k9=function(e,n){var o=e.alwaysShow,r=e.ifOverflow;return o&&(r="extendDomain"),r===n},aIo=Z5e,lIo=N5e,sIo=Xw;function cIo(t,e){var n={};return e=sIo(e),lIo(t,function(o,r,i){aIo(n,r,e(o,r,i))}),n}var uIo=cIo;const dIo=Fi(uIo);function fIo(t,e){for(var n=-1,o=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function MIo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function IIo(t,e){var n=t.x,o=t.y,r=HIo(t,TIo),i="".concat(n),a=parseInt(i,10),l="".concat(o),s=parseInt(l,10),c="".concat(e.height||r.height),u=parseInt(c,10),d="".concat(e.width||r.width),f=parseInt(d,10);return mD(mD(mD(mD(mD({},e),r),a?{x:a}:{}),s?{y:s}:{}),{},{height:u,width:f,name:e.name,radius:e.radius})}function $Ee(t){return be.createElement(Vhe,Xhe({shapeType:"rectangle",propTransformer:IIo,activeClassName:"recharts-active-bar"},t))}var zIo=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(o,r){if(typeof e=="number")return e;var i=typeof o=="number";return i?e(o,r):(i||hb(),n)}},DIo=["value","background"],jst;function pH(t){"@babel/helpers - typeof";return pH=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},pH(t)}function EIo(t,e){if(t==null)return{};var n=FIo(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function FIo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function fK(){return fK=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(j)0&&Math.abs(W)0&&(W=Math.min(($||0)-(j[Q-1]||0),W))}),Number.isFinite(W)){var L=W/E,k=y.layout==="vertical"?o.height:o.width;if(y.padding==="gap"&&(x=L*k/2),y.padding==="no-gap"){var N=ub(e.barCategoryGap,L*k),F=L*k/2;x=F-N-(F-N)/k*N}}}r==="xAxis"?S=[o.left+(P.left||0)+(x||0),o.left+o.width-(P.right||0)-(x||0)]:r==="yAxis"?S=s==="horizontal"?[o.top+o.height-(P.bottom||0),o.top+(P.top||0)]:[o.top+(P.top||0)+(x||0),o.top+o.height-(P.bottom||0)-(x||0)]:S=y.range,T&&(S=[S[1],S[0]]);var U=JPo(y,i,f),O=U.scale,B=U.realScaleType;O.domain(b).range(S),KPo(O);var _=oCo(O,h2(h2({},y),{},{realScaleType:B}));r==="xAxis"?(D=w==="top"&&!v||w==="bottom"&&v,R=o.left,M=d[A]-D*y.height):r==="yAxis"&&(D=w==="left"&&!v||w==="right"&&v,R=d[A]-D*y.width,M=o.top);var X=h2(h2(h2({},y),_),{},{realScaleType:B,x:R,y:M,scale:O,width:r==="xAxis"?o.width:y.width,height:r==="yAxis"?o.height:y.height});return X.bandSize=eK(X,_),!y.hide&&r==="xAxis"?d[A]+=(D?-1:1)*X.height:y.hide||(d[A]+=(D?-1:1)*X.width),h2(h2({},p),{},ste({},g,X))},{})},_st=function(e,n){var o=e.x,r=e.y,i=n.x,a=n.y;return{x:Math.min(o,i),y:Math.min(r,a),width:Math.abs(i-o),height:Math.abs(a-r)}},_Io=function(e){var n=e.x1,o=e.y1,r=e.x2,i=e.y2;return _st({x:n,y:o},{x:r,y:i})},Vst=function(){function t(e){BIo(this,t),this.scale=e}return YIo(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=o.bandAware,i=o.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(r){var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}return this.scale(n)}}},{key:"isInRange",value:function(n){var o=this.range(),r=o[0],i=o[o.length-1];return r<=i?n>=r&&n<=i:n>=i&&n<=r}}],[{key:"create",value:function(n){return new t(n)}}]),t}();ste(Vst,"EPS",1e-4);var t6e=function(e){var n=Object.keys(e).reduce(function(o,r){return h2(h2({},o),{},ste({},r,Vst.create(e[r])))},{});return h2(h2({},n),{},{apply:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.bandAware,l=i.position;return dIo(r,function(s,c){return n[c].apply(s,{bandAware:a,position:l})})},isInRange:function(r){return Ust(r,function(i,a){return n[a].isInRange(i)})}})};function VIo(t){return(t%180+180)%180}var GIo=function(e){var n=e.width,o=e.height,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=VIo(r),a=i*Math.PI/180,l=Math.atan(o/n),s=a>l&&a-1?r[i?e[a]:a]:void 0}}var $Io=qIo,QIo=kst;function ZIo(t){var e=QIo(t),n=e%1;return e===e?n?e-n:e:0}var ezo=ZIo,tzo=slt,nzo=Xw,ozo=ezo,rzo=Math.max;function izo(t,e,n){var o=t==null?0:t.length;if(!o)return-1;var r=n==null?0:ozo(n);return r<0&&(r=rzo(o+r,0)),tzo(t,nzo(e),r)}var azo=izo,lzo=$Io,szo=azo,czo=lzo(szo),uzo=czo;const dzo=Fi(uzo);var fzo=xZn(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),n6e=m.createContext(void 0),o6e=m.createContext(void 0),Gst=m.createContext(void 0),Xst=m.createContext({}),Jst=m.createContext(void 0),Kst=m.createContext(0),qst=m.createContext(0),nFe=function(e){var n=e.state,o=n.xAxisMap,r=n.yAxisMap,i=n.offset,a=e.clipPathId,l=e.children,s=e.width,c=e.height,u=fzo(i);return be.createElement(n6e.Provider,{value:o},be.createElement(o6e.Provider,{value:r},be.createElement(Xst.Provider,{value:i},be.createElement(Gst.Provider,{value:u},be.createElement(Jst.Provider,{value:a},be.createElement(Kst.Provider,{value:c},be.createElement(qst.Provider,{value:s},l)))))))},hzo=function(){return m.useContext(Jst)},$st=function(e){var n=m.useContext(n6e);n==null&&hb();var o=n[e];return o==null&&hb(),o},pzo=function(){var e=m.useContext(n6e);return c8(e)},gzo=function(){var e=m.useContext(o6e),n=dzo(e,function(o){return Ust(o.domain,Number.isFinite)});return n||c8(e)},Qst=function(e){var n=m.useContext(o6e);n==null&&hb();var o=n[e];return o==null&&hb(),o},mzo=function(){var e=m.useContext(Gst);return e},yzo=function(){return m.useContext(Xst)},r6e=function(){return m.useContext(qst)},i6e=function(){return m.useContext(Kst)};function DL(t){"@babel/helpers - typeof";return DL=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},DL(t)}function oFe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function rFe(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);nt*r)return!1;var i=n();return t*(e-t*i/2-o)>=0&&t*(e+t*i/2-r)<=0}function Nzo(t,e){return Zst(t,e+1)}function Uzo(t,e,n,o,r){for(var i=(o||[]).slice(),a=e.start,l=e.end,s=0,c=1,u=a,d=function(){var g=o==null?void 0:o[s];if(g===void 0)return{v:Zst(o,c)};var y=s,w,b=function(){return w===void 0&&(w=n(g,y)),w},C=g.coordinate,P=s===0||pK(t,C,b,u,l);P||(s=0,u=a,c+=1),P&&(u=C+t*(b()/2+r),s+=c)},f;c<=i.length;)if(f=d(),f)return f.v;return[]}function kL(t){"@babel/helpers - typeof";return kL=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},kL(t)}function uFe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Zf(t){for(var e=1;e0?p.coordinate-w*t:p.coordinate})}else i[f]=p=Zf(Zf({},p),{},{tickCoord:p.coordinate});var b=pK(t,p.tickCoord,y,l,s);b&&(s=p.tickCoord-t*(y()/2+r),i[f]=Zf(Zf({},p),{},{isShow:!0}))},u=a-1;u>=0;u--)c(u);return i}function _zo(t,e,n,o,r,i){var a=(o||[]).slice(),l=a.length,s=e.start,c=e.end;if(i){var u=o[l-1],d=n(u,l-1),f=t*(u.coordinate+t*d/2-c);a[l-1]=u=Zf(Zf({},u),{},{tickCoord:f>0?u.coordinate-f*t:u.coordinate});var p=pK(t,u.tickCoord,function(){return d},s,c);p&&(c=u.tickCoord-t*(d/2+r),a[l-1]=Zf(Zf({},u),{},{isShow:!0}))}for(var g=i?l-1:l,y=function(C){var P=a[C],v,T=function(){return v===void 0&&(v=n(P,C)),v};if(C===0){var A=t*(P.coordinate-t*T()/2-s);a[C]=P=Zf(Zf({},P),{},{tickCoord:A<0?P.coordinate-A*t:P.coordinate})}else a[C]=P=Zf(Zf({},P),{},{tickCoord:P.coordinate});var x=pK(t,P.tickCoord,T,s,c);x&&(s=P.tickCoord+t*(T()/2+r),a[C]=Zf(Zf({},P),{},{isShow:!0}))},w=0;w=2?H2(r[1].coordinate-r[0].coordinate):1,b=Wzo(i,w,p);return s==="equidistantPreserveStart"?Uzo(w,b,y,r,a):(s==="preserveStart"||s==="preserveStartEnd"?f=_zo(w,b,y,r,a,s==="preserveStartEnd"):f=Ozo(w,b,y,r,a),f.filter(function(C){return C.isShow}))}var Vzo=["viewBox"],Gzo=["viewBox"],Xzo=["ticks"];function gH(t){"@babel/helpers - typeof";return gH=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},gH(t)}function pC(){return pC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function Jzo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function Kzo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fFe(t,e){for(var n=0;n0?s(this.props):s(p)),a<=0||l<=0||!g||!g.length?null:be.createElement(_l,{className:fl("recharts-cartesian-axis",c),ref:function(w){o.layerReference=w}},i&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),os.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(o,r,i){var a;return be.isValidElement(o)?a=be.cloneElement(o,r):va(o)?a=o(r):a=be.createElement(YJ,pC({},r,{className:"recharts-cartesian-axis-tick-value"}),i),a}}]),e}(m.Component);l6e(LM,"displayName","CartesianAxis");l6e(LM,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var nDo=["x1","y1","x2","y2","key"],oDo=["offset"];function pb(t){"@babel/helpers - typeof";return pb=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},pb(t)}function hFe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function uh(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function lDo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}var sDo=function(e){var n=e.fill;if(!n||n==="none")return null;var o=e.fillOpacity,r=e.x,i=e.y,a=e.width,l=e.height;return be.createElement("rect",{x:r,y:i,width:a,height:l,stroke:"none",fill:n,fillOpacity:o,className:"recharts-cartesian-grid-bg"})};function nct(t,e){var n;if(be.isValidElement(t))n=be.cloneElement(t,e);else if(va(t))n=t(e);else{var o=e.x1,r=e.y1,i=e.x2,a=e.y2,l=e.key,s=pFe(e,nDo),c=ra(s,!1);c.offset;var u=pFe(c,oDo);n=be.createElement("line",ex({},u,{x1:o,y1:r,x2:i,y2:a,fill:"none",key:l}))}return n}function cDo(t){var e=t.x,n=t.width,o=t.horizontal,r=o===void 0?!0:o,i=t.horizontalPoints;if(!r||!i||!i.length)return null;var a=i.map(function(l,s){var c=uh(uh({},t),{},{x1:e,y1:l,x2:e+n,y2:l,key:"line-".concat(s),index:s});return nct(r,c)});return be.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function uDo(t){var e=t.y,n=t.height,o=t.vertical,r=o===void 0?!0:o,i=t.verticalPoints;if(!r||!i||!i.length)return null;var a=i.map(function(l,s){var c=uh(uh({},t),{},{x1:l,y1:e,x2:l,y2:e+n,key:"line-".concat(s),index:s});return nct(r,c)});return be.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function dDo(t){var e=t.horizontalFill,n=t.fillOpacity,o=t.x,r=t.y,i=t.width,a=t.height,l=t.horizontalPoints,s=t.horizontal,c=s===void 0?!0:s;if(!c||!e||!e.length)return null;var u=l.map(function(f){return Math.round(f+r-r)}).sort(function(f,p){return f-p});r!==u[0]&&u.unshift(0);var d=u.map(function(f,p){var g=!u[p+1],y=g?r+a-f:u[p+1]-f;if(y<=0)return null;var w=p%e.length;return be.createElement("rect",{key:"react-".concat(p),y:f,x:o,height:y,width:i,stroke:"none",fill:e[w],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return be.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function fDo(t){var e=t.vertical,n=e===void 0?!0:e,o=t.verticalFill,r=t.fillOpacity,i=t.x,a=t.y,l=t.width,s=t.height,c=t.verticalPoints;if(!n||!o||!o.length)return null;var u=c.map(function(f){return Math.round(f+i-i)}).sort(function(f,p){return f-p});i!==u[0]&&u.unshift(0);var d=u.map(function(f,p){var g=!u[p+1],y=g?i+l-f:u[p+1]-f;if(y<=0)return null;var w=p%o.length;return be.createElement("rect",{key:"react-".concat(p),x:f,y:a,width:y,height:s,stroke:"none",fill:o[w],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return be.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var hDo=function(e,n){var o=e.xAxis,r=e.width,i=e.height,a=e.offset;return xst(a6e(uh(uh(uh({},LM.defaultProps),o),{},{ticks:M6(o,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,n)},pDo=function(e,n){var o=e.yAxis,r=e.width,i=e.height,a=e.offset;return xst(a6e(uh(uh(uh({},LM.defaultProps),o),{},{ticks:M6(o,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,n)},ZT={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function bw(t){var e,n,o,r,i,a,l=r6e(),s=i6e(),c=yzo(),u=uh(uh({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:ZT.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:ZT.fill,horizontal:(o=t.horizontal)!==null&&o!==void 0?o:ZT.horizontal,horizontalFill:(r=t.horizontalFill)!==null&&r!==void 0?r:ZT.horizontalFill,vertical:(i=t.vertical)!==null&&i!==void 0?i:ZT.vertical,verticalFill:(a=t.verticalFill)!==null&&a!==void 0?a:ZT.verticalFill,x:dr(t.x)?t.x:c.left,y:dr(t.y)?t.y:c.top,width:dr(t.width)?t.width:c.width,height:dr(t.height)?t.height:c.height}),d=u.x,f=u.y,p=u.width,g=u.height,y=u.syncWithTicks,w=u.horizontalValues,b=u.verticalValues,C=pzo(),P=gzo();if(!dr(p)||p<=0||!dr(g)||g<=0||!dr(d)||d!==+d||!dr(f)||f!==+f)return null;var v=u.verticalCoordinatesGenerator||hDo,T=u.horizontalCoordinatesGenerator||pDo,A=u.horizontalPoints,x=u.verticalPoints;if((!A||!A.length)&&va(T)){var S=w&&w.length,R=T({yAxis:P?uh(uh({},P),{},{ticks:S?w:P.ticks}):void 0,width:l,height:s,offset:c},S?!0:y);B6(Array.isArray(R),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(pb(R),"]")),Array.isArray(R)&&(A=R)}if((!x||!x.length)&&va(v)){var M=b&&b.length,D=v({xAxis:C?uh(uh({},C),{},{ticks:M?b:C.ticks}):void 0,width:l,height:s,offset:c},M?!0:y);B6(Array.isArray(D),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(pb(D),"]")),Array.isArray(D)&&(x=D)}return be.createElement("g",{className:"recharts-cartesian-grid"},be.createElement(sDo,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height}),be.createElement(cDo,ex({},u,{offset:c,horizontalPoints:A,xAxis:C,yAxis:P})),be.createElement(uDo,ex({},u,{offset:c,verticalPoints:x,xAxis:C,yAxis:P})),be.createElement(dDo,ex({},u,{horizontalPoints:A})),be.createElement(fDo,ex({},u,{verticalPoints:x})))}bw.displayName="CartesianGrid";var gDo=["type","layout","connectNulls","ref"];function mH(t){"@babel/helpers - typeof";return mH=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},mH(t)}function mDo(t,e){if(t==null)return{};var n=yDo(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function yDo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function KE(){return KE=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);nd){p=[].concat(eP(s.slice(0,g)),[d-y]);break}var w=p.length%2===0?[0,f]:[f];return[].concat(eP(e.repeat(s,u)),eP(p),w).map(function(b){return"".concat(b,"px")}).join(", ")}),p2(B4(n),"id",uS("recharts-line-")),p2(B4(n),"pathRef",function(a){n.mainCurve=a}),p2(B4(n),"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),p2(B4(n),"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return SDo(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var o=this.getTotalLength();this.setState({totalLength:o})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var o=this.getTotalLength();o!==this.state.totalLength&&this.setState({totalLength:o})}}},{key:"getTotalLength",value:function(){var o=this.mainCurve;try{return o&&o.getTotalLength&&o.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(o,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,a=i.points,l=i.xAxis,s=i.yAxis,c=i.layout,u=i.children,d=e1(u,FM);if(!d)return null;var f=function(y,w){return{x:y.x,y:y.y,value:y.value,errorVal:Bu(y.payload,w)}},p={clipPath:o?"url(#clipPath-".concat(r,")"):null};return be.createElement(_l,p,d.map(function(g){return be.cloneElement(g,{key:"bar-".concat(g.props.dataKey),data:a,xAxis:l,yAxis:s,layout:c,dataPointFormatter:f})}))}},{key:"renderDots",value:function(o,r,i){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var l=this.props,s=l.dot,c=l.points,u=l.dataKey,d=ra(this.props,!1),f=ra(s,!0),p=c.map(function(y,w){var b=$1($1($1({key:"dot-".concat(w),r:3},d),f),{},{value:y.value,dataKey:u,cx:y.x,cy:y.y,index:w,payload:y.payload});return e.renderDotItem(s,b)}),g={clipPath:o?"url(#clipPath-".concat(r?"":"dots-").concat(i,")"):null};return be.createElement(_l,KE({className:"recharts-line-dots",key:"dots"},g),p)}},{key:"renderCurveStatically",value:function(o,r,i,a){var l=this.props,s=l.type,c=l.layout,u=l.connectNulls;l.ref;var d=mDo(l,gDo),f=$1($1($1({},ra(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:r?"url(#clipPath-".concat(i,")"):null,points:o},a),{},{type:s,layout:c,connectNulls:u});return be.createElement(zx,KE({},f,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(o,r){var i=this,a=this.props,l=a.points,s=a.strokeDasharray,c=a.isAnimationActive,u=a.animationBegin,d=a.animationDuration,f=a.animationEasing,p=a.animationId,g=a.animateNewValues,y=a.width,w=a.height,b=this.state,C=b.prevPoints,P=b.totalLength;return be.createElement(K2,{begin:u,duration:d,isActive:c,easing:f,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var T=v.t;if(C){var A=C.length/l.length,x=l.map(function(E,W){var j=Math.floor(W*A);if(C[j]){var L=C[j],k=N0(L.x,E.x),N=N0(L.y,E.y);return $1($1({},E),{},{x:k(T),y:N(T)})}if(g){var F=N0(y*2,E.x),U=N0(w/2,E.y);return $1($1({},E),{},{x:F(T),y:U(T)})}return $1($1({},E),{},{x:E.x,y:E.y})});return i.renderCurveStatically(x,o,r)}var S=N0(0,P),R=S(T),M;if(s){var D="".concat(s).split(/[,\s]+/gim).map(function(E){return parseFloat(E)});M=i.getStrokeDasharray(R,P,D)}else M=i.generateSimpleStrokeDasharray(P,R);return i.renderCurveStatically(l,o,r,{strokeDasharray:M})})}},{key:"renderCurve",value:function(o,r){var i=this.props,a=i.points,l=i.isAnimationActive,s=this.state,c=s.prevPoints,u=s.totalLength;return l&&a&&a.length&&(!c&&u>0||!db(c,a))?this.renderCurveWithAnimation(o,r):this.renderCurveStatically(a,o,r)}},{key:"render",value:function(){var o,r=this.props,i=r.hide,a=r.dot,l=r.points,s=r.className,c=r.xAxis,u=r.yAxis,d=r.top,f=r.left,p=r.width,g=r.height,y=r.isAnimationActive,w=r.id;if(i||!l||!l.length)return null;var b=this.state.isAnimationFinished,C=l.length===1,P=fl("recharts-line",s),v=c&&c.allowDataOverflow,T=u&&u.allowDataOverflow,A=v||T,x=ia(w)?this.id:w,S=(o=ra(a,!1))!==null&&o!==void 0?o:{r:3,strokeWidth:2},R=S.r,M=R===void 0?3:R,D=S.strokeWidth,E=D===void 0?2:D,W=Lat(a)?a:{},j=W.clipDot,L=j===void 0?!0:j,k=M*2+E;return be.createElement(_l,{className:P},v||T?be.createElement("defs",null,be.createElement("clipPath",{id:"clipPath-".concat(x)},be.createElement("rect",{x:v?f:f-p/2,y:T?d:d-g/2,width:v?p:p*2,height:T?g:g*2})),!L&&be.createElement("clipPath",{id:"clipPath-dots-".concat(x)},be.createElement("rect",{x:f-k/2,y:d-k/2,width:p+k,height:g+k}))):null,!C&&this.renderCurve(A,x),this.renderErrorBar(A,x),(C||a)&&this.renderDots(A,L,x),(!y||b)&&F9.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(o,r){return o.animationId!==r.prevAnimationId?{prevAnimationId:o.animationId,curPoints:o.points,prevPoints:r.curPoints}:o.points!==r.curPoints?{curPoints:o.points}:null}},{key:"repeat",value:function(o,r){for(var i=o.length%2!==0?[].concat(eP(o),[0]):o,a=[],l=0;l=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function IDo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function tx(){return tx=Object.assign?Object.assign.bind():function(t){for(var e=1;e0||!db(u,a)||!db(d,l))?this.renderAreaWithAnimation(o,r):this.renderAreaStatically(a,l,o,r)}},{key:"render",value:function(){var o,r=this.props,i=r.hide,a=r.dot,l=r.points,s=r.className,c=r.top,u=r.left,d=r.xAxis,f=r.yAxis,p=r.width,g=r.height,y=r.isAnimationActive,w=r.id;if(i||!l||!l.length)return null;var b=this.state.isAnimationFinished,C=l.length===1,P=fl("recharts-area",s),v=d&&d.allowDataOverflow,T=f&&f.allowDataOverflow,A=v||T,x=ia(w)?this.id:w,S=(o=ra(a,!1))!==null&&o!==void 0?o:{r:3,strokeWidth:2},R=S.r,M=R===void 0?3:R,D=S.strokeWidth,E=D===void 0?2:D,W=Lat(a)?a:{},j=W.clipDot,L=j===void 0?!0:j,k=M*2+E;return be.createElement(_l,{className:P},v||T?be.createElement("defs",null,be.createElement("clipPath",{id:"clipPath-".concat(x)},be.createElement("rect",{x:v?u:u-p/2,y:T?c:c-g/2,width:v?p:p*2,height:T?g:g*2})),!L&&be.createElement("clipPath",{id:"clipPath-dots-".concat(x)},be.createElement("rect",{x:u-k/2,y:c-k/2,width:p+k,height:g+k}))):null,C?null:this.renderArea(A,x),(a||C)&&this.renderDots(A,L,x),(!y||b)&&F9.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(o,r){return o.animationId!==r.prevAnimationId?{prevAnimationId:o.animationId,curPoints:o.points,curBaseLine:o.baseLine,prevPoints:r.curPoints,prevBaseLine:r.curBaseLine}:o.points!==r.curPoints||o.baseLine!==r.curBaseLine?{curPoints:o.points,curBaseLine:o.baseLine}:null}}]),e}(m.PureComponent);ict=RA;v9(RA,"displayName","Area");v9(RA,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!B2.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});v9(RA,"getBaseValue",function(t,e,n,o){var r=t.layout,i=t.baseValue,a=e.props.baseValue,l=a??i;if(dr(l)&&typeof l=="number")return l;var s=r==="horizontal"?o:n,c=s.scale.domain();if(s.type==="number"){var u=Math.max(c[0],c[1]),d=Math.min(c[0],c[1]);return l==="dataMin"?d:l==="dataMax"||u<0?u:Math.max(Math.min(c[0],c[1]),0)}return l==="dataMin"?c[0]:l==="dataMax"?c[1]:c[0]});v9(RA,"getComposedData",function(t){var e=t.props,n=t.item,o=t.xAxis,r=t.yAxis,i=t.xAxisTicks,a=t.yAxisTicks,l=t.bandSize,s=t.dataKey,c=t.stackedData,u=t.dataStartIndex,d=t.displayedData,f=t.offset,p=e.layout,g=c&&c.length,y=ict.getBaseValue(e,n,o,r),w=p==="horizontal",b=!1,C=d.map(function(v,T){var A;g?A=c[u+T]:(A=Bu(v,s),Array.isArray(A)?b=!0:A=[y,A]);var x=A[1]==null||g&&Bu(v,s)==null;return w?{x:uH({axis:o,ticks:i,bandSize:l,entry:v,index:T}),y:x?null:r.scale(A[1]),value:A,payload:v}:{x:x?null:o.scale(A[1]),y:uH({axis:r,ticks:a,bandSize:l,entry:v,index:T}),value:A,payload:v}}),P;return g||b?P=C.map(function(v){var T=Array.isArray(v.value)?v.value[0]:null;return w?{x:v.x,y:T!=null&&v.y!=null?r.scale(T):null}:{x:T!=null?o.scale(T):null,y:v.y}}):P=w?r.scale(y):o.scale(y),Y4({points:C,baseLine:P,layout:p,isRange:b},f)});v9(RA,"renderDotItem",function(t,e){var n;if(be.isValidElement(t))n=be.cloneElement(t,e);else if(va(t))n=t(e);else{var o=fl("recharts-area-dot",typeof t!="boolean"?t.className:"");n=be.createElement(fU,tx({},e,{className:o}))}return n});var mU=function(){return null};mU.displayName="ZAxis";mU.defaultProps={zAxisId:0,range:[64,64],scale:"auto",type:"number"};var WDo=["option","isActive"];function qE(){return qE=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function UDo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function jDo(t){var e=t.option,n=t.isActive,o=NDo(t,WDo);return typeof e=="string"?be.createElement(Vhe,qE({option:be.createElement(Xee,qE({type:e},o)),isActive:n,shapeType:"symbols"},o)):be.createElement(Vhe,qE({option:e,isActive:n,shapeType:"symbols"},o))}function AH(t){"@babel/helpers - typeof";return AH=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},AH(t)}function $E(){return $E=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function mEo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function yEo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function AEo(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,o=new Array(e);n0?a:e&&e.length&&dr(r)&&dr(i)?e.slice(r,i+1):[]};function yct(t){return t==="number"?[0,"auto"]:void 0}var cpe=function(e,n,o,r){var i=e.graphicalItems,a=e.tooltipAxis,l=cte(n,e);return o<0||!i||!i.length||o>=l.length?null:i.reduce(function(s,c){var u,d=(u=c.props.data)!==null&&u!==void 0?u:n;d&&e.dataStartIndex+e.dataEndIndex!==0&&(d=d.slice(e.dataStartIndex,e.dataEndIndex+1));var f;if(a.dataKey&&!a.allowDuplicatedCategory){var p=d===void 0?l:d;f=IJ(p,a.dataKey,r)}else f=d&&d[o]||l[o];return f?[].concat(vH(s),[Sst(c,f)]):s},[])},CFe=function(e,n,o,r){var i=r||{x:e.chartX,y:e.chartY},a=MEo(i,o),l=e.orderedTooltipTicks,s=e.tooltipAxis,c=e.tooltipTicks,u=YPo(a,l,c,s);if(u>=0&&c){var d=c[u]&&c[u].value,f=cpe(e,n,u,d),p=IEo(o,l,u,i);return{activeTooltipIndex:u,activeLabel:d,activePayload:f,activeCoordinate:p}}return null},zEo=function(e,n){var o=n.axes,r=n.graphicalItems,i=n.axisType,a=n.axisIdKey,l=n.stackGroups,s=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,d=e.children,f=e.stackOffset,p=vst(u,i);return o.reduce(function(g,y){var w,b=y.props,C=b.type,P=b.dataKey,v=b.allowDataOverflow,T=b.allowDuplicatedCategory,A=b.scale,x=b.ticks,S=b.includeHidden,R=y.props[a];if(g[R])return g;var M=cte(e.data,{graphicalItems:r.filter(function(_){return _.props[a]===R}),dataStartIndex:s,dataEndIndex:c}),D=M.length,E,W,j;rEo(y.props.domain,v,C)&&(E=Mhe(y.props.domain,null,v),p&&(C==="number"||A!=="auto")&&(j=XE(M,P,"category")));var L=yct(C);if(!E||E.length===0){var k,N=(k=y.props.domain)!==null&&k!==void 0?k:L;if(P){if(E=XE(M,P,C),C==="category"&&p){var F=n4o(E);T&&F?(W=E,E=cK(0,D)):T||(E=nEe(N,E,y).reduce(function(_,X){return _.indexOf(X)>=0?_:[].concat(vH(_),[X])},[]))}else if(C==="category")T?E=E.filter(function(_){return _!==""&&!ia(_)}):E=nEe(N,E,y).reduce(function(_,X){return _.indexOf(X)>=0||X===""||ia(X)?_:[].concat(vH(_),[X])},[]);else if(C==="number"){var U=XPo(M,r.filter(function(_){return _.props[a]===R&&(S||!_.props.hide)}),P,i,u);U&&(E=U)}p&&(C==="number"||A!=="auto")&&(j=XE(M,P,"category"))}else p?E=cK(0,D):l&&l[R]&&l[R].hasStack&&C==="number"?E=f==="expand"?[0,1]:bst(l[R].stackGroups,s,c):E=wst(M,r.filter(function(_){return _.props[a]===R&&(S||!_.props.hide)}),C,u,!0);if(C==="number")E=ape(d,E,R,i,x),N&&(E=Mhe(N,E,v));else if(C==="category"&&N){var O=N,B=E.every(function(_){return O.indexOf(_)>=0});B&&(E=O)}}return Po(Po({},g),{},ki({},R,Po(Po({},y.props),{},{axisType:i,domain:E,categoricalDomain:j,duplicateDomain:W,originalDomain:(w=y.props.domain)!==null&&w!==void 0?w:L,isCategorical:p,layout:u})))},{})},DEo=function(e,n){var o=n.graphicalItems,r=n.Axis,i=n.axisType,a=n.axisIdKey,l=n.stackGroups,s=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,d=e.children,f=cte(e.data,{graphicalItems:o,dataStartIndex:s,dataEndIndex:c}),p=f.length,g=vst(u,i),y=-1;return o.reduce(function(w,b){var C=b.props[a],P=yct("number");if(!w[C]){y++;var v;return g?v=cK(0,p):l&&l[C]&&l[C].hasStack?(v=bst(l[C].stackGroups,s,c),v=ape(d,v,C,i)):(v=Mhe(P,wst(f,o.filter(function(T){return T.props[a]===C&&!T.props.hide}),"number",u),r.defaultProps.allowDataOverflow),v=ape(d,v,C,i)),Po(Po({},w),{},ki({},C,Po(Po({axisType:i},r.defaultProps),{},{hide:!0,orientation:Xm(REo,"".concat(i,".").concat(y%2),null),domain:v,originalDomain:P,isCategorical:g,layout:u})))}return w},{})},EEo=function(e,n){var o=n.axisType,r=o===void 0?"xAxis":o,i=n.AxisComp,a=n.graphicalItems,l=n.stackGroups,s=n.dataStartIndex,c=n.dataEndIndex,u=e.children,d="".concat(r,"Id"),f=e1(u,i),p={};return f&&f.length?p=zEo(e,{axes:f,graphicalItems:a,axisType:r,axisIdKey:d,stackGroups:l,dataStartIndex:s,dataEndIndex:c}):a&&a.length&&(p=DEo(e,{Axis:i,graphicalItems:a,axisType:r,axisIdKey:d,stackGroups:l,dataStartIndex:s,dataEndIndex:c})),p},FEo=function(e){var n=c8(e),o=M6(n,!1,!0);return{tooltipTicks:o,orderedTooltipTicks:R3e(o,function(r){return r.coordinate}),tooltipAxis:n,tooltipAxisBandSize:eK(n,o)}},RFe=function(e){var n=e.children,o=e.defaultShowTooltip,r=og(n,hH),i=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(i=r.props.startIndex),r.props.endIndex>=0&&(a=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!o}},kEo=function(e){return!e||!e.length?!1:e.some(function(n){var o=j6(n&&n.type);return o&&o.indexOf("Bar")>=0})},HFe=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},LEo=function(e,n){var o=e.props,r=e.graphicalItems,i=e.xAxisMap,a=i===void 0?{}:i,l=e.yAxisMap,s=l===void 0?{}:l,c=o.width,u=o.height,d=o.children,f=o.margin||{},p=og(d,hH),g=og(d,J2),y=Object.keys(s).reduce(function(T,A){var x=s[A],S=x.orientation;return!x.mirror&&!x.hide?Po(Po({},T),{},ki({},S,T[S]+x.width)):T},{left:f.left||0,right:f.right||0}),w=Object.keys(a).reduce(function(T,A){var x=a[A],S=x.orientation;return!x.mirror&&!x.hide?Po(Po({},T),{},ki({},S,Xm(T,"".concat(S))+x.height)):T},{top:f.top||0,bottom:f.bottom||0}),b=Po(Po({},w),y),C=b.bottom;p&&(b.bottom+=p.props.height||hH.defaultProps.height),g&&n&&(b=VPo(b,r,o,n));var P=c-b.left-b.right,v=u-b.top-b.bottom;return Po(Po({brushBottom:C},b),{},{width:Math.max(P,0),height:Math.max(v,0)})},WEo=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},yU=function(e){var n,o=e.chartName,r=e.GraphicalChild,i=e.defaultTooltipEventType,a=i===void 0?"axis":i,l=e.validateTooltipEventTypes,s=l===void 0?["axis"]:l,c=e.axisComponents,u=e.legendContent,d=e.formatAxisMap,f=e.defaultProps,p=function(w,b){var C=b.graphicalItems,P=b.stackGroups,v=b.offset,T=b.updateId,A=b.dataStartIndex,x=b.dataEndIndex,S=w.barSize,R=w.layout,M=w.barGap,D=w.barCategoryGap,E=w.maxBarSize,W=HFe(R),j=W.numericAxisName,L=W.cateAxisName,k=kEo(C),N=[];return C.forEach(function(F,U){var O=cte(w.data,{graphicalItems:[F],dataStartIndex:A,dataEndIndex:x}),B=F.props,_=B.dataKey,X=B.maxBarSize,$=F.props["".concat(j,"Id")],Q=F.props["".concat(L,"Id")],le={},q=c.reduce(function(Se,ze){var Ie=b["".concat(ze.axisType,"Map")],ye=F.props["".concat(ze.axisType,"Id")];Ie&&Ie[ye]||ze.axisType==="zAxis"||hb();var ce=Ie[ye];return Po(Po({},Se),{},ki(ki({},ze.axisType,ce),"".concat(ze.axisType,"Ticks"),M6(ce)))},le),te=q[L],re=q["".concat(L,"Ticks")],ae=P&&P[$]&&P[$].hasStack&&iCo(F,P[$].stackGroups),se=j6(F.type).indexOf("Bar")>=0,ne=eK(te,re),fe=[],ge=k&&OPo({barSize:S,stackGroups:P,totalSize:WEo(q,L)});if(se){var de,Z,he=ia(X)?E:X,xe=(de=(Z=eK(te,re,!0))!==null&&Z!==void 0?Z:he)!==null&&de!==void 0?de:0;fe=_Po({barGap:M,barCategoryGap:D,bandSize:xe!==ne?xe:ne,sizeList:ge[Q],maxBarSize:he}),xe!==ne&&(fe=fe.map(function(Se){return Po(Po({},Se),{},{position:Po(Po({},Se.position),{},{offset:Se.position.offset-xe/2})})}))}var He=F&&F.type&&F.type.getComposedData;He&&N.push({props:Po(Po({},He(Po(Po({},q),{},{displayedData:O,props:w,dataKey:_,item:F,bandSize:ne,barPosition:fe,offset:v,stackedData:ae,layout:R,dataStartIndex:A,dataEndIndex:x}))),{},ki(ki(ki({key:F.key||"item-".concat(U)},j,q[j]),L,q[L]),"animationId",T)),childIndex:p4o(F,w.children),item:F})}),N},g=function(w,b){var C=w.props,P=w.dataStartIndex,v=w.dataEndIndex,T=w.updateId;if(!mze({props:C}))return null;var A=C.children,x=C.layout,S=C.stackOffset,R=C.data,M=C.reverseStackOrder,D=HFe(x),E=D.numericAxisName,W=D.cateAxisName,j=e1(A,r),L=nCo(R,j,"".concat(E,"Id"),"".concat(W,"Id"),S,M),k=c.reduce(function(B,_){var X="".concat(_.axisType,"Map");return Po(Po({},B),{},ki({},X,EEo(C,Po(Po({},_),{},{graphicalItems:j,stackGroups:_.axisType===E&&L,dataStartIndex:P,dataEndIndex:v}))))},{}),N=LEo(Po(Po({},k),{},{props:C,graphicalItems:j}),b==null?void 0:b.legendBBox);Object.keys(k).forEach(function(B){k[B]=d(C,k[B],N,B.replace("Map",""),o)});var F=k["".concat(W,"Map")],U=FEo(F),O=p(C,Po(Po({},k),{},{dataStartIndex:P,dataEndIndex:v,updateId:T,graphicalItems:j,stackGroups:L,offset:N}));return Po(Po({formattedGraphicalItems:O,graphicalItems:j,offset:N,stackGroups:L},U),k)};return n=function(y){bEo(w,y);function w(b){var C,P,v;return yEo(this,w),v=vEo(this,w,[b]),ki(Tl(v),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ki(Tl(v),"accessibilityManager",new oEo),ki(Tl(v),"handleLegendBBoxUpdate",function(T){if(T){var A=v.state,x=A.dataStartIndex,S=A.dataEndIndex,R=A.updateId;v.setState(Po({legendBBox:T},g({props:v.props,dataStartIndex:x,dataEndIndex:S,updateId:R},Po(Po({},v.state),{},{legendBBox:T}))))}}),ki(Tl(v),"handleReceiveSyncEvent",function(T,A,x){if(v.props.syncId===T){if(x===v.eventEmitterSymbol&&typeof v.props.syncMethod!="function")return;v.applySyncEvent(A)}}),ki(Tl(v),"handleBrushChange",function(T){var A=T.startIndex,x=T.endIndex;if(A!==v.state.dataStartIndex||x!==v.state.dataEndIndex){var S=v.state.updateId;v.setState(function(){return Po({dataStartIndex:A,dataEndIndex:x},g({props:v.props,dataStartIndex:A,dataEndIndex:x,updateId:S},v.state))}),v.triggerSyncEvent({dataStartIndex:A,dataEndIndex:x})}}),ki(Tl(v),"handleMouseEnter",function(T){var A=v.getMouseInfo(T);if(A){var x=Po(Po({},A),{},{isTooltipActive:!0});v.setState(x),v.triggerSyncEvent(x);var S=v.props.onMouseEnter;va(S)&&S(x,T)}}),ki(Tl(v),"triggeredAfterMouseMove",function(T){var A=v.getMouseInfo(T),x=A?Po(Po({},A),{},{isTooltipActive:!0}):{isTooltipActive:!1};v.setState(x),v.triggerSyncEvent(x);var S=v.props.onMouseMove;va(S)&&S(x,T)}),ki(Tl(v),"handleItemMouseEnter",function(T){v.setState(function(){return{isTooltipActive:!0,activeItem:T,activePayload:T.tooltipPayload,activeCoordinate:T.tooltipPosition||{x:T.cx,y:T.cy}}})}),ki(Tl(v),"handleItemMouseLeave",function(){v.setState(function(){return{isTooltipActive:!1}})}),ki(Tl(v),"handleMouseMove",function(T){T.persist(),v.throttleTriggeredAfterMouseMove(T)}),ki(Tl(v),"handleMouseLeave",function(T){v.throttleTriggeredAfterMouseMove.cancel();var A={isTooltipActive:!1};v.setState(A),v.triggerSyncEvent(A);var x=v.props.onMouseLeave;va(x)&&x(A,T)}),ki(Tl(v),"handleOuterEvent",function(T){var A=h4o(T),x=Xm(v.props,"".concat(A));if(A&&va(x)){var S,R;/.*touch.*/i.test(A)?R=v.getMouseInfo(T.changedTouches[0]):R=v.getMouseInfo(T),x((S=R)!==null&&S!==void 0?S:{},T)}}),ki(Tl(v),"handleClick",function(T){var A=v.getMouseInfo(T);if(A){var x=Po(Po({},A),{},{isTooltipActive:!0});v.setState(x),v.triggerSyncEvent(x);var S=v.props.onClick;va(S)&&S(x,T)}}),ki(Tl(v),"handleMouseDown",function(T){var A=v.props.onMouseDown;if(va(A)){var x=v.getMouseInfo(T);A(x,T)}}),ki(Tl(v),"handleMouseUp",function(T){var A=v.props.onMouseUp;if(va(A)){var x=v.getMouseInfo(T);A(x,T)}}),ki(Tl(v),"handleTouchMove",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&v.throttleTriggeredAfterMouseMove(T.changedTouches[0])}),ki(Tl(v),"handleTouchStart",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&v.handleMouseDown(T.changedTouches[0])}),ki(Tl(v),"handleTouchEnd",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&v.handleMouseUp(T.changedTouches[0])}),ki(Tl(v),"triggerSyncEvent",function(T){v.props.syncId!==void 0&&zle.emit(Dle,v.props.syncId,T,v.eventEmitterSymbol)}),ki(Tl(v),"applySyncEvent",function(T){var A=v.props,x=A.layout,S=A.syncMethod,R=v.state.updateId,M=T.dataStartIndex,D=T.dataEndIndex;if(T.dataStartIndex!==void 0||T.dataEndIndex!==void 0)v.setState(Po({dataStartIndex:M,dataEndIndex:D},g({props:v.props,dataStartIndex:M,dataEndIndex:D,updateId:R},v.state)));else if(T.activeTooltipIndex!==void 0){var E=T.chartX,W=T.chartY,j=T.activeTooltipIndex,L=v.state,k=L.offset,N=L.tooltipTicks;if(!k)return;if(typeof S=="function")j=S(N,T);else if(S==="value"){j=-1;for(var F=0;F=0){var ae,se;if(E.dataKey&&!E.allowDuplicatedCategory){var ne=typeof E.dataKey=="function"?re:"payload.".concat(E.dataKey.toString());ae=IJ(F,ne,j),se=U&&O&&IJ(O,ne,j)}else ae=F==null?void 0:F[W],se=U&&O&&O[W];if(Q||$){var fe=T.props.activeIndex!==void 0?T.props.activeIndex:W;return[m.cloneElement(T,Po(Po(Po({},S.props),q),{},{activeIndex:fe})),null,null]}if(!ia(ae))return[te].concat(vH(v.renderActivePoints({item:S,activePoint:ae,basePoint:se,childIndex:W,isRange:U})))}else{var ge,de=(ge=v.getItemByXY(v.state.activeCoordinate))!==null&&ge!==void 0?ge:{graphicalItem:te},Z=de.graphicalItem,he=Z.item,xe=he===void 0?T:he,He=Z.childIndex,Se=Po(Po(Po({},S.props),q),{},{activeIndex:He});return[m.cloneElement(xe,Se),null,null]}return U?[te,null,null]:[te,null]}),ki(Tl(v),"renderCustomized",function(T,A,x){return m.cloneElement(T,Po(Po({key:"recharts-customized-".concat(x)},v.props),v.state))}),ki(Tl(v),"renderMap",{CartesianGrid:{handler:i_,once:!0},ReferenceArea:{handler:v.renderReferenceElement},ReferenceLine:{handler:i_},ReferenceDot:{handler:v.renderReferenceElement},XAxis:{handler:i_},YAxis:{handler:i_},Brush:{handler:v.renderBrush,once:!0},Bar:{handler:v.renderGraphicChild},Line:{handler:v.renderGraphicChild},Area:{handler:v.renderGraphicChild},Radar:{handler:v.renderGraphicChild},RadialBar:{handler:v.renderGraphicChild},Scatter:{handler:v.renderGraphicChild},Pie:{handler:v.renderGraphicChild},Funnel:{handler:v.renderGraphicChild},Tooltip:{handler:v.renderCursor,once:!0},PolarGrid:{handler:v.renderPolarGrid,once:!0},PolarAngleAxis:{handler:v.renderPolarAxis},PolarRadiusAxis:{handler:v.renderPolarAxis},Customized:{handler:v.renderCustomized}}),v.clipPathId="".concat((C=b.id)!==null&&C!==void 0?C:uS("recharts"),"-clip"),v.throttleTriggeredAfterMouseMove=vlt(v.triggeredAfterMouseMove,(P=b.throttleDelay)!==null&&P!==void 0?P:1e3/60),v.state={},v}return wEo(w,[{key:"componentDidMount",value:function(){var C,P;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var C=this.props,P=C.children,v=C.data,T=C.height,A=C.layout,x=og(P,rh);if(x){var S=x.props.defaultIndex;if(!(typeof S!="number"||S<0||S>this.state.tooltipTicks.length)){var R=this.state.tooltipTicks[S]&&this.state.tooltipTicks[S].value,M=cpe(this.state,v,S,R),D=this.state.tooltipTicks[S].coordinate,E=(this.state.offset.top+T)/2,W=A==="horizontal",j=W?{x:D,y:E}:{y:D,x:E},L=this.state.formattedGraphicalItems.find(function(N){var F=N.item;return F.type.name==="Scatter"});L&&(j=Po(Po({},j),L.props.points[S].tooltipPosition),M=L.props.points[S].tooltipPayload);var k={activeTooltipIndex:S,isTooltipActive:!0,activeLabel:R,activePayload:M,activeCoordinate:j};this.setState(k),this.renderCursor(x),this.accessibilityManager.setIndex(S)}}}},{key:"getSnapshotBeforeUpdate",value:function(C,P){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==P.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==C.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==C.margin){var v,T;this.accessibilityManager.setDetails({offset:{left:(v=this.props.margin.left)!==null&&v!==void 0?v:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0}})}return null}},{key:"componentDidUpdate",value:function(C){Kfe([og(C.children,rh)],[og(this.props.children,rh)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var C=og(this.props.children,rh);if(C&&typeof C.props.shared=="boolean"){var P=C.props.shared?"axis":"item";return s.indexOf(P)>=0?P:a}return a}},{key:"getMouseInfo",value:function(C){if(!this.container)return null;var P=this.container,v=P.getBoundingClientRect(),T=Hxo(v),A={chartX:Math.round(C.pageX-T.left),chartY:Math.round(C.pageY-T.top)},x=v.width/P.offsetWidth||1,S=this.inRange(A.chartX,A.chartY,x);if(!S)return null;var R=this.state,M=R.xAxisMap,D=R.yAxisMap,E=this.getTooltipEventType();if(E!=="axis"&&M&&D){var W=c8(M).scale,j=c8(D).scale,L=W&&W.invert?W.invert(A.chartX):null,k=j&&j.invert?j.invert(A.chartY):null;return Po(Po({},A),{},{xValue:L,yValue:k})}var N=CFe(this.state,this.props.data,this.props.layout,S);return N?Po(Po({},A),N):null}},{key:"inRange",value:function(C,P){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=this.props.layout,A=C/v,x=P/v;if(T==="horizontal"||T==="vertical"){var S=this.state.offset,R=A>=S.left&&A<=S.left+S.width&&x>=S.top&&x<=S.top+S.height;return R?{x:A,y:x}:null}var M=this.state,D=M.angleAxisMap,E=M.radiusAxisMap;if(D&&E){var W=c8(D);return iEe({x:A,y:x},W)}return null}},{key:"parseEventsOfWrapper",value:function(){var C=this.props.children,P=this.getTooltipEventType(),v=og(C,rh),T={};v&&P==="axis"&&(v.props.trigger==="click"?T={onClick:this.handleClick}:T={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var A=zJ(this.props,this.handleOuterEvent);return Po(Po({},A),T)}},{key:"addListener",value:function(){zle.on(Dle,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){zle.removeListener(Dle,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(C,P,v){for(var T=this.state.formattedGraphicalItems,A=0,x=T.length;A{const r=Jt(),[i,a]=m.useState(!1),l=()=>{n==null||n(!t)},s=()=>{o==null||o(!e)};return h.jsx(Al,{content:h.jsxs("div",{style:{width:"200px"},children:[h.jsx(hw,{checked:t,onClick:l,children:Y.t("menu.graph.ShowHorizontalGridLines",r)}),h.jsx(hw,{checked:e,onClick:s,children:Y.t("menu.graph.ShowHorizontalGridLines",r)})]}),children:h.jsx(Ome,{style:{position:"absolute",fontSize:"30px",top:"4px",right:"30px",transition:"0.5s",color:i?"darkgray":"lightblue",cursor:"pointer"},onMouseOver:()=>{a(!0)},onMouseOut:()=>{a(!1)}})})}),Act=be.memo(({type:t,dataSource:e,height:n,dataKeyAxisX:o,labelX:r,labelY:i,unitX:a,unitY:l,yMin:s="auto",yMax:c="auto",fractionDigits:u=2,referenceX:d,color:f})=>{const[p,g]=m.useState(0),[y,w]=m.useState(!0),[b,C]=m.useState(!0),[P,v]=m.useState(null);m.useEffect(()=>{if(!e||e.length===0)return;const R=Array.isArray(e)?Object.keys(e[0]).length-1:Object.keys(e).length-1;p!==R&&g(R)},[e]);const T=m.useMemo(()=>{const R=[];for(let M=0;M{},x=R=>{v(R.dataKey)},S=()=>{v(null)};return h.jsx(h.Fragment,{children:e&&h.jsx("div",{id:"bar-graph-"+r+"-"+i,style:{width:"100%",height:`${n}%`,position:"relative",direction:"ltr"},children:h.jsxs("div",{style:{userSelect:"none",width:"100%",height:"100%",position:"absolute",top:0,left:0},children:[h.jsx(lU,{width:"100%",height:"100%",children:h.jsxs(NEo,{data:e,onMouseDown:A,margin:{top:5,right:30,left:20,bottom:30},children:[h.jsx(rh,{formatter:R=>R.toFixed(u)+" "+l}),h.jsx(bw,{vertical:b,horizontal:y,stroke:"rgba(128, 128, 128, 0.3)"}),h.jsx($9,{x:d,stroke:"orange",strokeWidth:2}),h.jsx(l1,{dataKey:o??r,fontSize:"10px",children:h.jsx(os,{value:r+(a?" ("+a+")":""),offset:0,position:"bottom"})}),h.jsx(vh,{domain:[s,c],fontSize:"10px",children:h.jsx(os,{dx:-15,value:i+(l?" ("+l+")":""),offset:0,angle:-90,position:"center"})}),T,p>1&&h.jsx(J2,{iconType:"plainline",verticalAlign:"top",height:36,onMouseLeave:S,onMouseEnter:x})]})}),h.jsx(YEo,{horizontalGrid:y,verticalGrid:b,changeHorizontalGrid:R=>{w(R)},changeVerticalGrid:R=>{C(R)}})]})})})}),WM=1,OEo=t=>{const{cx:e,cy:n,opacity:o,stroke:r,index:i,numberOfPoints:a,numberOfSymbols:l,scale:s,fillColor:c}=t,u=a?Math.round(a/l):1;return e&&n&&i>0&&i%u===0?h.jsx("svg",{x:e-10*s,y:n-10*s,width:20*s,height:20*s,viewBox:"-10 -10 20 20",children:h.jsx("circle",{cx:"0",cy:"0",r:"3",style:{opacity:o,stroke:r,fill:c??"white",strokeWidth:WM}})}):null},_Eo=t=>{const{cx:e,cy:n,opacity:o,stroke:r,index:i,scale:a,numberOfPoints:l,numberOfSymbols:s,fillColor:c}=t,u=l?Math.round(l/s):1;return e&&n&&i>0&&i%u===0?h.jsx("svg",{x:e-10*a,y:n-10*a,width:20*a,height:20*a,viewBox:"-10 -10 20 20",children:h.jsx("rect",{x:"-3",y:"-3",width:"6",height:"6",style:{opacity:o,stroke:r,fill:c??"white",strokeWidth:WM}})}):null},a_=t=>{const{cx:e,cy:n,opacity:o,stroke:r,index:i,scale:a,numberOfPoints:l,numberOfSymbols:s,direction:c,fillColor:u}=t,d=l?Math.round(l/s):1;if(e&&n&&i>0&&i%d===0){let f;switch(c){case 1:f="-4,2.5,4,2.5,0,-3.5";break;case 2:f="2.5,4,2.5,-4,-3.5,0";break;case 3:f="-2.5,4,-2.5,-4,3.5,0";break;default:f="-4,-2.5,4,-2.5,0,3.5"}return h.jsx("svg",{x:e-10*a,y:n-10*a,width:20*a,height:20*a,viewBox:"-10 -10 20 20",children:h.jsx("polygon",{points:f,style:{opacity:o,stroke:r,fill:u??"white",strokeWidth:WM}})})}return null},VEo=t=>{const{cx:e,cy:n,opacity:o,stroke:r,index:i,scale:a,numberOfPoints:l,numberOfSymbols:s,fillColor:c}=t,u=l?Math.round(l/s):1;return e&&n&&i>0&&i%u===0?h.jsx("svg",{x:e-10*a,y:n-10*a,width:20*a,height:20*a,viewBox:"-10 -10 20 20",children:h.jsx("polygon",{points:"-3,0,0,5,3,0,0,-5",style:{opacity:o,stroke:r,fill:c??"white",strokeWidth:WM}})}):null},GEo=t=>{const{cx:e,cy:n,opacity:o,stroke:r,index:i,scale:a,numberOfPoints:l,numberOfSymbols:s,fillColor:c}=t,u=l?Math.round(l/s):1;if(e&&n&&i>0&&i%u===0){const d=.05*a;return h.jsx("svg",{x:e-100*d,y:n-100*d,width:300*d,height:300*d,viewBox:"0 0 300 300",children:h.jsx("polygon",{points:"100,10 40,180 190,60 10,60 160,180",style:{opacity:o,stroke:r,fill:c??"white",strokeWidth:WM}})})}return null},XEo=t=>{const{cx:e,cy:n,opacity:o,stroke:r,index:i,scale:a,numberOfPoints:l,numberOfSymbols:s,fillColor:c}=t,u=l?Math.round(l/s):1;if(e&&n&&i>0&&i%u===0){const d=.02*a;return h.jsx("svg",{x:e-150*d,y:n-150*d,width:300*d,height:300*d,viewBox:"0 0 300 300",children:h.jsx("polygon",{className:"hex",points:"300,150 225,280 75,280 0,150 75,20 225,20",style:{opacity:o,stroke:r,fill:c??"white",strokeWidth:WM}})})}return null},Dx=(t,e,n,o,r,i)=>{switch(t){case"circle":return h.jsx(OEo,{scale:e,numberOfPoints:n,numberOfSymbols:o,opacity:r,fillColor:i});case"square":return h.jsx(_Eo,{scale:e,numberOfPoints:n,numberOfSymbols:o,opacity:r,fillColor:i});case"triangle up":return h.jsx(a_,{scale:1.1*e,numberOfPoints:n,numberOfSymbols:o,direction:1,opacity:r,fillColor:i});case"triangle down":return h.jsx(a_,{scale:1.1*e,numberOfPoints:n,numberOfSymbols:o,direction:0,opacity:r,fillColor:i});case"triangle right":return h.jsx(a_,{scale:1.1*e,numberOfPoints:n,numberOfSymbols:o,direction:3,opacity:r,fillColor:i});case"triangle left":return h.jsx(a_,{scale:1.1*e,numberOfPoints:n,numberOfSymbols:o,direction:2,opacity:r,fillColor:i});case"star":return h.jsx(GEo,{scale:1.25*e,numberOfPoints:n,numberOfSymbols:o,opacity:r,fillColor:i});case"diamond":return h.jsx(VEo,{scale:1.1*e,numberOfPoints:n,numberOfSymbols:o,opacity:r,fillColor:i});case"hexagon":return h.jsx(XEo,{scale:1.3*e,numberOfPoints:n,numberOfSymbols:o,opacity:r,fillColor:i})}},JEo=be.memo(({horizontalGrid:t,verticalGrid:e,lineCount:n,lineWidth:o,symbolSize:r,changeHorizontalGrid:i,changeVerticalGrid:a,changeLineWidth:l,changeSymbolSize:s})=>{const c=Jt(),[u,d]=m.useState(!1),f=()=>{i==null||i(!t)},p=()=>{a==null||a(!e)},g=w=>{l==null||l(w/2)},y=w=>{s==null||s(w/5)};return h.jsx(Al,{content:h.jsxs("div",{style:{width:"200px"},children:[h.jsx(EC,{min:0,max:10,value:o*2,onChange:g,children:Y.t("menu.graph.LineWidth",c)+":"}),h.jsx(EC,{min:2,max:12,value:r*5,onChange:y,children:Y.t("menu.graph.SymbolSize",c)+":"}),h.jsx(hw,{checked:t,onClick:f,children:Y.t("menu.graph.ShowHorizontalGridLines",c)}),h.jsx(hw,{checked:e,onClick:p,children:Y.t("menu.graph.ShowHorizontalGridLines",c)})]}),children:h.jsx(Ome,{style:{position:"absolute",fontSize:"30px",top:"4px",right:"30px",transition:"0.5s",color:u?"darkgray":"lightblue",cursor:"pointer"},onMouseOver:()=>{d(!0)},onMouseOut:()=>{d(!1)}})})}),Ex=["circle","square","triangle up","triangle down","triangle right","triangle left","star","diamond","hexagon"],Tf=({type:t,chartType:e=Ml.Line,selectedIndex:n,dataSource:o,labels:r,height:i,dataKeyAxisX:a,labelX:l,labelY:s,unitX:c,unitY:u,yMin:d="auto",yMax:f="auto",curveType:p="linear",referenceX:g,fractionDigits:y=2,symbolCount:w=12})=>{const[b,C]=m.useState(0),[P,v]=m.useState(!0),[T,A]=m.useState(!0),[x,S]=m.useState(null),[R,M]=m.useState(2),[D,E]=m.useState(1);m.useEffect(()=>{if(!o||o.length===0){C(0);return}const N=Array.isArray(o)?Object.keys(o[0]).length-1:Object.keys(o).length-1;b!==N&&C(N)},[b,o]);const W=m.useMemo(()=>{const N=[];let F;for(let U=0;U0?_||F:!1,isAnimationActive:!1},U))}return N},[t,e,n,p,r,b,R,w,D,x]),j=()=>{},L=N=>{S(N.dataKey)},k=()=>{S(null)};return h.jsx(h.Fragment,{children:o&&h.jsx("div",{id:"line-graph-"+l+"-"+s,style:{width:"100%",height:`${i}%`,position:"relative",direction:"ltr"},children:h.jsxs("div",{style:{userSelect:"none",width:"100%",height:"100%",position:"absolute",top:0,left:0},children:[h.jsx(lU,{width:"100%",height:"100%",children:e===Ml.Area?h.jsxs(jEo,{data:o,onMouseDown:j,margin:{top:5,right:30,left:20,bottom:30},children:[h.jsx(rh,{formatter:N=>N.toFixed(y)+" "+u}),h.jsx(bw,{vertical:T,horizontal:P,stroke:"rgba(128, 128, 128, 0.3)"}),h.jsx($9,{x:g,stroke:"orange",strokeWidth:2}),h.jsx(l1,{dataKey:a??l,fontSize:"10px",children:h.jsx(os,{value:l+(c?" ("+c+")":""),offset:0,position:"bottom"})}),h.jsx(vh,{domain:[d,f],fontSize:"10px",children:h.jsx(os,{dx:-15,value:s+(u?" ("+u+")":""),offset:0,angle:-90,position:"center"})}),W,b>1&&h.jsx(J2,{iconType:"plainline",verticalAlign:"top",height:36,onMouseLeave:k,onMouseEnter:L})]}):h.jsxs(s6e,{data:o,onMouseDown:j,margin:{top:5,right:30,left:20,bottom:30},children:[h.jsx(rh,{formatter:N=>N.toFixed(y)+" "+u}),h.jsx(bw,{vertical:T,horizontal:P,stroke:"rgba(128, 128, 128, 0.3)"}),h.jsx($9,{x:g,stroke:"orange",strokeWidth:2}),h.jsx(l1,{dataKey:a??l,fontSize:"10px",children:h.jsx(os,{value:l+(c?" ("+c+")":""),offset:0,position:"bottom"})}),h.jsx(vh,{domain:[d,f],fontSize:"10px",children:h.jsx(os,{dx:-15,value:s+(u?" ("+u+")":""),offset:0,angle:-90,position:"center"})}),W,b>1&&h.jsx(J2,{wrapperStyle:{fontSize:"11px"},iconType:"plainline",verticalAlign:"top",height:36,onMouseLeave:k,onMouseEnter:L})]})}),h.jsx(JEo,{lineCount:b,symbolSize:D,lineWidth:R,horizontalGrid:P,verticalGrid:T,changeHorizontalGrid:N=>{v(N)},changeVerticalGrid:N=>{A(N)},changeLineWidth:N=>{M(N)},changeSymbolSize:N=>{E(N)}})]})})})},KEo=Ro.div` + A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(e,",").concat(n+r-l*g," Z")}else u="M ".concat(e,",").concat(n," h ").concat(o," v ").concat(r," h ").concat(-o," Z");return u},kHo=function(e,n){if(!e||!n)return!1;var o=e.x,r=e.y,i=n.x,a=n.y,l=n.width,s=n.height;if(Math.abs(l)>0&&Math.abs(s)>0){var c=Math.min(i,i+l),u=Math.max(i,i+l),d=Math.min(a,a+s),f=Math.max(a,a+s);return o>=c&&o<=u&&r>=d&&r<=f}return!1},LHo={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},t6e=function(e){var n=LEe(LEe({},LHo),e),o=m.useRef(),r=m.useState(-1),i=RHo(r,2),a=i[0],l=i[1];m.useEffect(function(){if(o.current&&o.current.getTotalLength)try{var v=o.current.getTotalLength();v&&l(v)}catch{}},[]);var s=n.x,c=n.y,u=n.width,d=n.height,f=n.radius,p=n.className,g=n.animationEasing,y=n.animationDuration,w=n.animationBegin,b=n.isAnimationActive,C=n.isUpdateAnimationActive;if(s!==+s||c!==+c||u!==+u||d!==+d||u===0||d===0)return null;var P=fl("recharts-rectangle",p);return C?be.createElement(K2,{canBegin:a>0,from:{width:u,height:d,x:s,y:c},to:{width:u,height:d,x:s,y:c},duration:y,animationEasing:g,isActive:C},function(v){var T=v.width,A=v.height,x=v.x,S=v.y;return be.createElement(K2,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:y,isActive:b,easing:g},be.createElement("path",lK({},ra(n,!0),{className:P,d:WEe(x,S,T,A,f),ref:o})))}):be.createElement("path",lK({},ra(n,!0),{className:P,d:WEe(s,c,u,d,f)}))};function Ohe(){return Ohe=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function OHo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}var _Ho=function(e,n,o,r,i,a){return"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(n,"h").concat(o)},VHo=function(e){var n=e.x,o=n===void 0?0:n,r=e.y,i=r===void 0?0:r,a=e.top,l=a===void 0?0:a,s=e.left,c=s===void 0?0:s,u=e.width,d=u===void 0?0:u,f=e.height,p=f===void 0?0:f,g=e.className,y=YHo(e,WHo),w=NHo({x:o,y:i,top:l,left:c,width:d,height:p},y);return!dr(o)||!dr(i)||!dr(d)||!dr(p)||!dr(l)||!dr(c)?null:be.createElement("path",_he({},ra(w,!0),{className:fl("recharts-cross",g),d:_Ho(o,i,d,p,l,c)}))},GHo=bA,XHo=s5,JHo="[object Boolean]";function KHo(t){return t===!0||t===!1||XHo(t)&&GHo(t)==JHo}var qHo=KHo;const $Ho=Fi(qHo);function CL(t){"@babel/helpers - typeof";return CL=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},CL(t)}function sK(){return sK=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:f,x:s,y:c},to:{upperWidth:u,lowerWidth:d,height:f,x:s,y:c},duration:y,animationEasing:g,isActive:b},function(P){var v=P.upperWidth,T=P.lowerWidth,A=P.height,x=P.x,S=P.y;return be.createElement(K2,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:y,easing:g},be.createElement("path",sK({},ra(n,!0),{className:C,d:YEe(x,S,v,T,A),ref:o})))}):be.createElement("g",null,be.createElement("path",sK({},ra(n,!0),{className:C,d:YEe(s,c,u,d,f)})))},sMo=["option","shapeType","propTransformer","activeClassName","isActive"];function RL(t){"@babel/helpers - typeof";return RL=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},RL(t)}function cMo(t,e){if(t==null)return{};var n=uMo(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function uMo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function OEe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function cK(t){for(var e=1;e0&&o.handleDrag(r.changedTouches[0])}),Z1($5(o),"handleDragEnd",function(){o.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var r=o.props,i=r.endIndex,a=r.onDragEnd,l=r.startIndex;a==null||a({endIndex:i,startIndex:l})}),o.detachDragEndListener()}),Z1($5(o),"handleLeaveWrapper",function(){(o.state.isTravellerMoving||o.state.isSlideMoving)&&(o.leaveTimer=window.setTimeout(o.handleDragEnd,o.props.leaveTimeOut))}),Z1($5(o),"handleEnterSlideOrTraveller",function(){o.setState({isTextActive:!0})}),Z1($5(o),"handleLeaveSlideOrTraveller",function(){o.setState({isTextActive:!1})}),Z1($5(o),"handleSlideDragStart",function(r){var i=qEe(r)?r.changedTouches[0]:r;o.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),o.attachDragEndListener()}),o.travellerDragStartHandlers={startX:o.handleTravellerDragStart.bind($5(o),"startX"),endX:o.handleTravellerDragStart.bind($5(o),"endX")},o.state={},o}return OMo(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(o){var r=o.startX,i=o.endX,a=this.state.scaleValues,l=this.props,s=l.gap,c=l.data,u=c.length-1,d=Math.min(r,i),f=Math.max(r,i),p=e.getIndexInRange(a,d),g=e.getIndexInRange(a,f);return{startIndex:p-p%s,endIndex:g===u?u:g-g%s}}},{key:"getTextOfTick",value:function(o){var r=this.props,i=r.data,a=r.tickFormatter,l=r.dataKey,s=Bu(i[o],l,o);return va(a)?a(s,o):s}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(o){var r=this.state,i=r.slideMoveStartX,a=r.startX,l=r.endX,s=this.props,c=s.x,u=s.width,d=s.travellerWidth,f=s.startIndex,p=s.endIndex,g=s.onChange,y=o.pageX-i;y>0?y=Math.min(y,c+u-d-l,c+u-d-a):y<0&&(y=Math.max(y,c-a,c-l));var w=this.getIndex({startX:a+y,endX:l+y});(w.startIndex!==f||w.endIndex!==p)&&g&&g(w),this.setState({startX:a+y,endX:l+y,slideMoveStartX:o.pageX})}},{key:"handleTravellerDragStart",value:function(o,r){var i=qEe(r)?r.changedTouches[0]:r;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:o,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(o){var r=this.state,i=r.brushMoveStartX,a=r.movingTravellerId,l=r.endX,s=r.startX,c=this.state[a],u=this.props,d=u.x,f=u.width,p=u.travellerWidth,g=u.onChange,y=u.gap,w=u.data,b={startX:this.state.startX,endX:this.state.endX},C=o.pageX-i;C>0?C=Math.min(C,d+f-p-c):C<0&&(C=Math.max(C,d-c)),b[a]=c+C;var P=this.getIndex(b),v=P.startIndex,T=P.endIndex,A=function(){var S=w.length-1;return a==="startX"&&(l>s?v%y===0:T%y===0)||ls?T%y===0:v%y===0)||l>s&&T===S};this.setState(Z1(Z1({},a,c+C),"brushMoveStartX",o.pageX),function(){g&&A()&&g(P)})}},{key:"handleTravellerMoveKeyboard",value:function(o,r){var i=this,a=this.state,l=a.scaleValues,s=a.startX,c=a.endX,u=this.state[r],d=l.indexOf(u);if(d!==-1){var f=d+o;if(!(f===-1||f>=l.length)){var p=l[f];r==="startX"&&p>=c||r==="endX"&&p<=s||this.setState(Z1({},r,p),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var o=this.props,r=o.x,i=o.y,a=o.width,l=o.height,s=o.fill,c=o.stroke;return be.createElement("rect",{stroke:c,fill:s,x:r,y:i,width:a,height:l})}},{key:"renderPanorama",value:function(){var o=this.props,r=o.x,i=o.y,a=o.width,l=o.height,s=o.data,c=o.children,u=o.padding,d=m.Children.only(c);return d?be.cloneElement(d,{x:r,y:i,width:a,height:l,margin:u,compact:!0,data:s}):null}},{key:"renderTravellerLayer",value:function(o,r){var i,a,l=this,s=this.props,c=s.y,u=s.travellerWidth,d=s.height,f=s.traveller,p=s.ariaLabel,g=s.data,y=s.startIndex,w=s.endIndex,b=Math.max(o,this.props.x),C=Mle(Mle({},ra(this.props,!1)),{},{x:b,y:c,width:u,height:d}),P=p||"Min value: ".concat((i=g[y])===null||i===void 0?void 0:i.name,", Max value: ").concat((a=g[w])===null||a===void 0?void 0:a.name);return be.createElement(_l,{tabIndex:0,role:"slider","aria-label":P,"aria-valuenow":o,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[r],onTouchStart:this.travellerDragStartHandlers[r],onKeyDown:function(T){["ArrowLeft","ArrowRight"].includes(T.key)&&(T.preventDefault(),T.stopPropagation(),l.handleTravellerMoveKeyboard(T.key==="ArrowRight"?1:-1,r))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(f,C))}},{key:"renderSlide",value:function(o,r){var i=this.props,a=i.y,l=i.height,s=i.stroke,c=i.travellerWidth,u=Math.min(o,r)+c,d=Math.max(Math.abs(r-o)-c,0);return be.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:s,fillOpacity:.2,x:u,y:a,width:d,height:l})}},{key:"renderText",value:function(){var o=this.props,r=o.startIndex,i=o.endIndex,a=o.y,l=o.height,s=o.travellerWidth,c=o.stroke,u=this.state,d=u.startX,f=u.endX,p=5,g={pointerEvents:"none",fill:c};return be.createElement(_l,{className:"recharts-brush-texts"},be.createElement(OJ,dK({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,f)-p,y:a+l/2},g),this.getTextOfTick(r)),be.createElement(OJ,dK({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,f)+s+p,y:a+l/2},g),this.getTextOfTick(i)))}},{key:"render",value:function(){var o=this.props,r=o.data,i=o.className,a=o.children,l=o.x,s=o.y,c=o.width,u=o.height,d=o.alwaysShowText,f=this.state,p=f.startX,g=f.endX,y=f.isTextActive,w=f.isSlideMoving,b=f.isTravellerMoving,C=f.isTravellerFocused;if(!r||!r.length||!dr(l)||!dr(s)||!dr(c)||!dr(u)||c<=0||u<=0)return null;var P=fl("recharts-brush",i),v=be.Children.count(a)===1,T=BMo("userSelect","none");return be.createElement(_l,{className:P,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:T},this.renderBackground(),v&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(y||w||b||C||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(o){var r=o.x,i=o.y,a=o.width,l=o.height,s=o.stroke,c=Math.floor(i+l/2)-1;return be.createElement(be.Fragment,null,be.createElement("rect",{x:r,y:i,width:a,height:l,fill:s,stroke:"none"}),be.createElement("line",{x1:r+1,y1:c,x2:r+a-1,y2:c,fill:"none",stroke:"#fff"}),be.createElement("line",{x1:r+1,y1:c+2,x2:r+a-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(o,r){var i;return be.isValidElement(o)?i=be.cloneElement(o,r):va(o)?i=o(r):i=e.renderDefaultTraveller(r),i}},{key:"getDerivedStateFromProps",value:function(o,r){var i=o.data,a=o.width,l=o.x,s=o.travellerWidth,c=o.updateId,u=o.startIndex,d=o.endIndex;if(i!==r.prevData||c!==r.prevUpdateId)return Mle({prevData:i,prevTravellerWidth:s,prevUpdateId:c,prevX:l,prevWidth:a},i&&i.length?JMo({data:i,width:a,x:l,travellerWidth:s,startIndex:u,endIndex:d}):{scale:null,scaleValues:null});if(r.scale&&(a!==r.prevWidth||l!==r.prevX||s!==r.prevTravellerWidth)){r.scale.range([l,l+a-s]);var f=r.scale.domain().map(function(p){return r.scale(p)});return{prevData:i,prevTravellerWidth:s,prevUpdateId:c,prevX:l,prevWidth:a,startX:r.scale(o.startIndex),endX:r.scale(o.endIndex),scaleValues:f}}return null}},{key:"getIndexInRange",value:function(o,r){for(var i=o.length,a=0,l=i-1;l-a>1;){var s=Math.floor((a+l)/2);o[s]>r?l=s:a=s}return r>=o[l]?l:a}}]),e}(m.PureComponent);Z1(hH,"displayName","Brush");Z1(hH,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var KMo=Z5e;function qMo(t,e){var n;return KMo(t,function(o,r,i){return n=e(o,r,i),!n}),!!n}var $Mo=qMo,QMo=got,ZMo=Xw,eIo=$Mo,tIo=vp,nIo=Kee;function oIo(t,e,n){var o=tIo(t)?QMo:eIo;return n&&nIo(t,e,n)&&(e=void 0),o(t,ZMo(e))}var rIo=oIo;const iIo=Fi(rIo);var k9=function(e,n){var o=e.alwaysShow,r=e.ifOverflow;return o&&(r="extendDomain"),r===n},aIo=e9e,lIo=U5e,sIo=Xw;function cIo(t,e){var n={};return e=sIo(e),lIo(t,function(o,r,i){aIo(n,r,e(o,r,i))}),n}var uIo=cIo;const dIo=Fi(uIo);function fIo(t,e){for(var n=-1,o=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function MIo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function IIo(t,e){var n=t.x,o=t.y,r=HIo(t,TIo),i="".concat(n),a=parseInt(i,10),l="".concat(o),s=parseInt(l,10),c="".concat(e.height||r.height),u=parseInt(c,10),d="".concat(e.width||r.width),f=parseInt(d,10);return mD(mD(mD(mD(mD({},e),r),a?{x:a}:{}),s?{y:s}:{}),{},{height:u,width:f,name:e.name,radius:e.radius})}function QEe(t){return be.createElement(Vhe,Xhe({shapeType:"rectangle",propTransformer:IIo,activeClassName:"recharts-active-bar"},t))}var zIo=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(o,r){if(typeof e=="number")return e;var i=typeof o=="number";return i?e(o,r):(i||hb(),n)}},DIo=["value","background"],jst;function pH(t){"@babel/helpers - typeof";return pH=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},pH(t)}function EIo(t,e){if(t==null)return{};var n=FIo(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function FIo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function hK(){return hK=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(j)0&&Math.abs(W)0&&(W=Math.min(($||0)-(j[Q-1]||0),W))}),Number.isFinite(W)){var L=W/E,k=y.layout==="vertical"?o.height:o.width;if(y.padding==="gap"&&(x=L*k/2),y.padding==="no-gap"){var N=ub(e.barCategoryGap,L*k),F=L*k/2;x=F-N-(F-N)/k*N}}}r==="xAxis"?S=[o.left+(P.left||0)+(x||0),o.left+o.width-(P.right||0)-(x||0)]:r==="yAxis"?S=s==="horizontal"?[o.top+o.height-(P.bottom||0),o.top+(P.top||0)]:[o.top+(P.top||0)+(x||0),o.top+o.height-(P.bottom||0)-(x||0)]:S=y.range,T&&(S=[S[1],S[0]]);var U=JPo(y,i,f),O=U.scale,B=U.realScaleType;O.domain(b).range(S),KPo(O);var _=oCo(O,h2(h2({},y),{},{realScaleType:B}));r==="xAxis"?(D=w==="top"&&!v||w==="bottom"&&v,R=o.left,M=d[A]-D*y.height):r==="yAxis"&&(D=w==="left"&&!v||w==="right"&&v,R=d[A]-D*y.width,M=o.top);var X=h2(h2(h2({},y),_),{},{realScaleType:B,x:R,y:M,scale:O,width:r==="xAxis"?o.width:y.width,height:r==="yAxis"?o.height:y.height});return X.bandSize=tK(X,_),!y.hide&&r==="xAxis"?d[A]+=(D?-1:1)*X.height:y.hide||(d[A]+=(D?-1:1)*X.width),h2(h2({},p),{},ste({},g,X))},{})},_st=function(e,n){var o=e.x,r=e.y,i=n.x,a=n.y;return{x:Math.min(o,i),y:Math.min(r,a),width:Math.abs(i-o),height:Math.abs(a-r)}},_Io=function(e){var n=e.x1,o=e.y1,r=e.x2,i=e.y2;return _st({x:n,y:o},{x:r,y:i})},Vst=function(){function t(e){BIo(this,t),this.scale=e}return YIo(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=o.bandAware,i=o.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(r){var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}return this.scale(n)}}},{key:"isInRange",value:function(n){var o=this.range(),r=o[0],i=o[o.length-1];return r<=i?n>=r&&n<=i:n>=i&&n<=r}}],[{key:"create",value:function(n){return new t(n)}}]),t}();ste(Vst,"EPS",1e-4);var n6e=function(e){var n=Object.keys(e).reduce(function(o,r){return h2(h2({},o),{},ste({},r,Vst.create(e[r])))},{});return h2(h2({},n),{},{apply:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.bandAware,l=i.position;return dIo(r,function(s,c){return n[c].apply(s,{bandAware:a,position:l})})},isInRange:function(r){return Ust(r,function(i,a){return n[a].isInRange(i)})}})};function VIo(t){return(t%180+180)%180}var GIo=function(e){var n=e.width,o=e.height,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=VIo(r),a=i*Math.PI/180,l=Math.atan(o/n),s=a>l&&a-1?r[i?e[a]:a]:void 0}}var $Io=qIo,QIo=kst;function ZIo(t){var e=QIo(t),n=e%1;return e===e?n?e-n:e:0}var ezo=ZIo,tzo=slt,nzo=Xw,ozo=ezo,rzo=Math.max;function izo(t,e,n){var o=t==null?0:t.length;if(!o)return-1;var r=n==null?0:ozo(n);return r<0&&(r=rzo(o+r,0)),tzo(t,nzo(e),r)}var azo=izo,lzo=$Io,szo=azo,czo=lzo(szo),uzo=czo;const dzo=Fi(uzo);var fzo=xZn(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),o6e=m.createContext(void 0),r6e=m.createContext(void 0),Gst=m.createContext(void 0),Xst=m.createContext({}),Jst=m.createContext(void 0),Kst=m.createContext(0),qst=m.createContext(0),oFe=function(e){var n=e.state,o=n.xAxisMap,r=n.yAxisMap,i=n.offset,a=e.clipPathId,l=e.children,s=e.width,c=e.height,u=fzo(i);return be.createElement(o6e.Provider,{value:o},be.createElement(r6e.Provider,{value:r},be.createElement(Xst.Provider,{value:i},be.createElement(Gst.Provider,{value:u},be.createElement(Jst.Provider,{value:a},be.createElement(Kst.Provider,{value:c},be.createElement(qst.Provider,{value:s},l)))))))},hzo=function(){return m.useContext(Jst)},$st=function(e){var n=m.useContext(o6e);n==null&&hb();var o=n[e];return o==null&&hb(),o},pzo=function(){var e=m.useContext(o6e);return c8(e)},gzo=function(){var e=m.useContext(r6e),n=dzo(e,function(o){return Ust(o.domain,Number.isFinite)});return n||c8(e)},Qst=function(e){var n=m.useContext(r6e);n==null&&hb();var o=n[e];return o==null&&hb(),o},mzo=function(){var e=m.useContext(Gst);return e},yzo=function(){return m.useContext(Xst)},i6e=function(){return m.useContext(qst)},a6e=function(){return m.useContext(Kst)};function DL(t){"@babel/helpers - typeof";return DL=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},DL(t)}function rFe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function iFe(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);nt*r)return!1;var i=n();return t*(e-t*i/2-o)>=0&&t*(e+t*i/2-r)<=0}function Nzo(t,e){return Zst(t,e+1)}function Uzo(t,e,n,o,r){for(var i=(o||[]).slice(),a=e.start,l=e.end,s=0,c=1,u=a,d=function(){var g=o==null?void 0:o[s];if(g===void 0)return{v:Zst(o,c)};var y=s,w,b=function(){return w===void 0&&(w=n(g,y)),w},C=g.coordinate,P=s===0||gK(t,C,b,u,l);P||(s=0,u=a,c+=1),P&&(u=C+t*(b()/2+r),s+=c)},f;c<=i.length;)if(f=d(),f)return f.v;return[]}function kL(t){"@babel/helpers - typeof";return kL=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},kL(t)}function dFe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Zf(t){for(var e=1;e0?p.coordinate-w*t:p.coordinate})}else i[f]=p=Zf(Zf({},p),{},{tickCoord:p.coordinate});var b=gK(t,p.tickCoord,y,l,s);b&&(s=p.tickCoord-t*(y()/2+r),i[f]=Zf(Zf({},p),{},{isShow:!0}))},u=a-1;u>=0;u--)c(u);return i}function _zo(t,e,n,o,r,i){var a=(o||[]).slice(),l=a.length,s=e.start,c=e.end;if(i){var u=o[l-1],d=n(u,l-1),f=t*(u.coordinate+t*d/2-c);a[l-1]=u=Zf(Zf({},u),{},{tickCoord:f>0?u.coordinate-f*t:u.coordinate});var p=gK(t,u.tickCoord,function(){return d},s,c);p&&(c=u.tickCoord-t*(d/2+r),a[l-1]=Zf(Zf({},u),{},{isShow:!0}))}for(var g=i?l-1:l,y=function(C){var P=a[C],v,T=function(){return v===void 0&&(v=n(P,C)),v};if(C===0){var A=t*(P.coordinate-t*T()/2-s);a[C]=P=Zf(Zf({},P),{},{tickCoord:A<0?P.coordinate-A*t:P.coordinate})}else a[C]=P=Zf(Zf({},P),{},{tickCoord:P.coordinate});var x=gK(t,P.tickCoord,T,s,c);x&&(s=P.tickCoord+t*(T()/2+r),a[C]=Zf(Zf({},P),{},{isShow:!0}))},w=0;w=2?H2(r[1].coordinate-r[0].coordinate):1,b=Wzo(i,w,p);return s==="equidistantPreserveStart"?Uzo(w,b,y,r,a):(s==="preserveStart"||s==="preserveStartEnd"?f=_zo(w,b,y,r,a,s==="preserveStartEnd"):f=Ozo(w,b,y,r,a),f.filter(function(C){return C.isShow}))}var Vzo=["viewBox"],Gzo=["viewBox"],Xzo=["ticks"];function gH(t){"@babel/helpers - typeof";return gH=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},gH(t)}function pC(){return pC=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function Jzo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function Kzo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hFe(t,e){for(var n=0;n0?s(this.props):s(p)),a<=0||l<=0||!g||!g.length?null:be.createElement(_l,{className:fl("recharts-cartesian-axis",c),ref:function(w){o.layerReference=w}},i&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),os.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(o,r,i){var a;return be.isValidElement(o)?a=be.cloneElement(o,r):va(o)?a=o(r):a=be.createElement(OJ,pC({},r,{className:"recharts-cartesian-axis-tick-value"}),i),a}}]),e}(m.Component);s6e(LM,"displayName","CartesianAxis");s6e(LM,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var nDo=["x1","y1","x2","y2","key"],oDo=["offset"];function pb(t){"@babel/helpers - typeof";return pb=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},pb(t)}function pFe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function uh(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function lDo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}var sDo=function(e){var n=e.fill;if(!n||n==="none")return null;var o=e.fillOpacity,r=e.x,i=e.y,a=e.width,l=e.height;return be.createElement("rect",{x:r,y:i,width:a,height:l,stroke:"none",fill:n,fillOpacity:o,className:"recharts-cartesian-grid-bg"})};function nct(t,e){var n;if(be.isValidElement(t))n=be.cloneElement(t,e);else if(va(t))n=t(e);else{var o=e.x1,r=e.y1,i=e.x2,a=e.y2,l=e.key,s=gFe(e,nDo),c=ra(s,!1);c.offset;var u=gFe(c,oDo);n=be.createElement("line",ex({},u,{x1:o,y1:r,x2:i,y2:a,fill:"none",key:l}))}return n}function cDo(t){var e=t.x,n=t.width,o=t.horizontal,r=o===void 0?!0:o,i=t.horizontalPoints;if(!r||!i||!i.length)return null;var a=i.map(function(l,s){var c=uh(uh({},t),{},{x1:e,y1:l,x2:e+n,y2:l,key:"line-".concat(s),index:s});return nct(r,c)});return be.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function uDo(t){var e=t.y,n=t.height,o=t.vertical,r=o===void 0?!0:o,i=t.verticalPoints;if(!r||!i||!i.length)return null;var a=i.map(function(l,s){var c=uh(uh({},t),{},{x1:l,y1:e,x2:l,y2:e+n,key:"line-".concat(s),index:s});return nct(r,c)});return be.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function dDo(t){var e=t.horizontalFill,n=t.fillOpacity,o=t.x,r=t.y,i=t.width,a=t.height,l=t.horizontalPoints,s=t.horizontal,c=s===void 0?!0:s;if(!c||!e||!e.length)return null;var u=l.map(function(f){return Math.round(f+r-r)}).sort(function(f,p){return f-p});r!==u[0]&&u.unshift(0);var d=u.map(function(f,p){var g=!u[p+1],y=g?r+a-f:u[p+1]-f;if(y<=0)return null;var w=p%e.length;return be.createElement("rect",{key:"react-".concat(p),y:f,x:o,height:y,width:i,stroke:"none",fill:e[w],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return be.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function fDo(t){var e=t.vertical,n=e===void 0?!0:e,o=t.verticalFill,r=t.fillOpacity,i=t.x,a=t.y,l=t.width,s=t.height,c=t.verticalPoints;if(!n||!o||!o.length)return null;var u=c.map(function(f){return Math.round(f+i-i)}).sort(function(f,p){return f-p});i!==u[0]&&u.unshift(0);var d=u.map(function(f,p){var g=!u[p+1],y=g?i+l-f:u[p+1]-f;if(y<=0)return null;var w=p%o.length;return be.createElement("rect",{key:"react-".concat(p),x:f,y:a,width:y,height:s,stroke:"none",fill:o[w],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return be.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var hDo=function(e,n){var o=e.xAxis,r=e.width,i=e.height,a=e.offset;return xst(l6e(uh(uh(uh({},LM.defaultProps),o),{},{ticks:M6(o,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,n)},pDo=function(e,n){var o=e.yAxis,r=e.width,i=e.height,a=e.offset;return xst(l6e(uh(uh(uh({},LM.defaultProps),o),{},{ticks:M6(o,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,n)},ZT={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function bw(t){var e,n,o,r,i,a,l=i6e(),s=a6e(),c=yzo(),u=uh(uh({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:ZT.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:ZT.fill,horizontal:(o=t.horizontal)!==null&&o!==void 0?o:ZT.horizontal,horizontalFill:(r=t.horizontalFill)!==null&&r!==void 0?r:ZT.horizontalFill,vertical:(i=t.vertical)!==null&&i!==void 0?i:ZT.vertical,verticalFill:(a=t.verticalFill)!==null&&a!==void 0?a:ZT.verticalFill,x:dr(t.x)?t.x:c.left,y:dr(t.y)?t.y:c.top,width:dr(t.width)?t.width:c.width,height:dr(t.height)?t.height:c.height}),d=u.x,f=u.y,p=u.width,g=u.height,y=u.syncWithTicks,w=u.horizontalValues,b=u.verticalValues,C=pzo(),P=gzo();if(!dr(p)||p<=0||!dr(g)||g<=0||!dr(d)||d!==+d||!dr(f)||f!==+f)return null;var v=u.verticalCoordinatesGenerator||hDo,T=u.horizontalCoordinatesGenerator||pDo,A=u.horizontalPoints,x=u.verticalPoints;if((!A||!A.length)&&va(T)){var S=w&&w.length,R=T({yAxis:P?uh(uh({},P),{},{ticks:S?w:P.ticks}):void 0,width:l,height:s,offset:c},S?!0:y);B6(Array.isArray(R),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(pb(R),"]")),Array.isArray(R)&&(A=R)}if((!x||!x.length)&&va(v)){var M=b&&b.length,D=v({xAxis:C?uh(uh({},C),{},{ticks:M?b:C.ticks}):void 0,width:l,height:s,offset:c},M?!0:y);B6(Array.isArray(D),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(pb(D),"]")),Array.isArray(D)&&(x=D)}return be.createElement("g",{className:"recharts-cartesian-grid"},be.createElement(sDo,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height}),be.createElement(cDo,ex({},u,{offset:c,horizontalPoints:A,xAxis:C,yAxis:P})),be.createElement(uDo,ex({},u,{offset:c,verticalPoints:x,xAxis:C,yAxis:P})),be.createElement(dDo,ex({},u,{horizontalPoints:A})),be.createElement(fDo,ex({},u,{verticalPoints:x})))}bw.displayName="CartesianGrid";var gDo=["type","layout","connectNulls","ref"];function mH(t){"@babel/helpers - typeof";return mH=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},mH(t)}function mDo(t,e){if(t==null)return{};var n=yDo(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function yDo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function KE(){return KE=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);nd){p=[].concat(eP(s.slice(0,g)),[d-y]);break}var w=p.length%2===0?[0,f]:[f];return[].concat(eP(e.repeat(s,u)),eP(p),w).map(function(b){return"".concat(b,"px")}).join(", ")}),p2(B4(n),"id",uS("recharts-line-")),p2(B4(n),"pathRef",function(a){n.mainCurve=a}),p2(B4(n),"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),p2(B4(n),"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return SDo(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var o=this.getTotalLength();this.setState({totalLength:o})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var o=this.getTotalLength();o!==this.state.totalLength&&this.setState({totalLength:o})}}},{key:"getTotalLength",value:function(){var o=this.mainCurve;try{return o&&o.getTotalLength&&o.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(o,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,a=i.points,l=i.xAxis,s=i.yAxis,c=i.layout,u=i.children,d=e1(u,FM);if(!d)return null;var f=function(y,w){return{x:y.x,y:y.y,value:y.value,errorVal:Bu(y.payload,w)}},p={clipPath:o?"url(#clipPath-".concat(r,")"):null};return be.createElement(_l,p,d.map(function(g){return be.cloneElement(g,{key:"bar-".concat(g.props.dataKey),data:a,xAxis:l,yAxis:s,layout:c,dataPointFormatter:f})}))}},{key:"renderDots",value:function(o,r,i){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var l=this.props,s=l.dot,c=l.points,u=l.dataKey,d=ra(this.props,!1),f=ra(s,!0),p=c.map(function(y,w){var b=$1($1($1({key:"dot-".concat(w),r:3},d),f),{},{value:y.value,dataKey:u,cx:y.x,cy:y.y,index:w,payload:y.payload});return e.renderDotItem(s,b)}),g={clipPath:o?"url(#clipPath-".concat(r?"":"dots-").concat(i,")"):null};return be.createElement(_l,KE({className:"recharts-line-dots",key:"dots"},g),p)}},{key:"renderCurveStatically",value:function(o,r,i,a){var l=this.props,s=l.type,c=l.layout,u=l.connectNulls;l.ref;var d=mDo(l,gDo),f=$1($1($1({},ra(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:r?"url(#clipPath-".concat(i,")"):null,points:o},a),{},{type:s,layout:c,connectNulls:u});return be.createElement(zx,KE({},f,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(o,r){var i=this,a=this.props,l=a.points,s=a.strokeDasharray,c=a.isAnimationActive,u=a.animationBegin,d=a.animationDuration,f=a.animationEasing,p=a.animationId,g=a.animateNewValues,y=a.width,w=a.height,b=this.state,C=b.prevPoints,P=b.totalLength;return be.createElement(K2,{begin:u,duration:d,isActive:c,easing:f,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var T=v.t;if(C){var A=C.length/l.length,x=l.map(function(E,W){var j=Math.floor(W*A);if(C[j]){var L=C[j],k=N0(L.x,E.x),N=N0(L.y,E.y);return $1($1({},E),{},{x:k(T),y:N(T)})}if(g){var F=N0(y*2,E.x),U=N0(w/2,E.y);return $1($1({},E),{},{x:F(T),y:U(T)})}return $1($1({},E),{},{x:E.x,y:E.y})});return i.renderCurveStatically(x,o,r)}var S=N0(0,P),R=S(T),M;if(s){var D="".concat(s).split(/[,\s]+/gim).map(function(E){return parseFloat(E)});M=i.getStrokeDasharray(R,P,D)}else M=i.generateSimpleStrokeDasharray(P,R);return i.renderCurveStatically(l,o,r,{strokeDasharray:M})})}},{key:"renderCurve",value:function(o,r){var i=this.props,a=i.points,l=i.isAnimationActive,s=this.state,c=s.prevPoints,u=s.totalLength;return l&&a&&a.length&&(!c&&u>0||!db(c,a))?this.renderCurveWithAnimation(o,r):this.renderCurveStatically(a,o,r)}},{key:"render",value:function(){var o,r=this.props,i=r.hide,a=r.dot,l=r.points,s=r.className,c=r.xAxis,u=r.yAxis,d=r.top,f=r.left,p=r.width,g=r.height,y=r.isAnimationActive,w=r.id;if(i||!l||!l.length)return null;var b=this.state.isAnimationFinished,C=l.length===1,P=fl("recharts-line",s),v=c&&c.allowDataOverflow,T=u&&u.allowDataOverflow,A=v||T,x=ia(w)?this.id:w,S=(o=ra(a,!1))!==null&&o!==void 0?o:{r:3,strokeWidth:2},R=S.r,M=R===void 0?3:R,D=S.strokeWidth,E=D===void 0?2:D,W=Lat(a)?a:{},j=W.clipDot,L=j===void 0?!0:j,k=M*2+E;return be.createElement(_l,{className:P},v||T?be.createElement("defs",null,be.createElement("clipPath",{id:"clipPath-".concat(x)},be.createElement("rect",{x:v?f:f-p/2,y:T?d:d-g/2,width:v?p:p*2,height:T?g:g*2})),!L&&be.createElement("clipPath",{id:"clipPath-dots-".concat(x)},be.createElement("rect",{x:f-k/2,y:d-k/2,width:p+k,height:g+k}))):null,!C&&this.renderCurve(A,x),this.renderErrorBar(A,x),(C||a)&&this.renderDots(A,L,x),(!y||b)&&F9.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(o,r){return o.animationId!==r.prevAnimationId?{prevAnimationId:o.animationId,curPoints:o.points,prevPoints:r.curPoints}:o.points!==r.curPoints?{curPoints:o.points}:null}},{key:"repeat",value:function(o,r){for(var i=o.length%2!==0?[].concat(eP(o),[0]):o,a=[],l=0;l=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function IDo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function tx(){return tx=Object.assign?Object.assign.bind():function(t){for(var e=1;e0||!db(u,a)||!db(d,l))?this.renderAreaWithAnimation(o,r):this.renderAreaStatically(a,l,o,r)}},{key:"render",value:function(){var o,r=this.props,i=r.hide,a=r.dot,l=r.points,s=r.className,c=r.top,u=r.left,d=r.xAxis,f=r.yAxis,p=r.width,g=r.height,y=r.isAnimationActive,w=r.id;if(i||!l||!l.length)return null;var b=this.state.isAnimationFinished,C=l.length===1,P=fl("recharts-area",s),v=d&&d.allowDataOverflow,T=f&&f.allowDataOverflow,A=v||T,x=ia(w)?this.id:w,S=(o=ra(a,!1))!==null&&o!==void 0?o:{r:3,strokeWidth:2},R=S.r,M=R===void 0?3:R,D=S.strokeWidth,E=D===void 0?2:D,W=Lat(a)?a:{},j=W.clipDot,L=j===void 0?!0:j,k=M*2+E;return be.createElement(_l,{className:P},v||T?be.createElement("defs",null,be.createElement("clipPath",{id:"clipPath-".concat(x)},be.createElement("rect",{x:v?u:u-p/2,y:T?c:c-g/2,width:v?p:p*2,height:T?g:g*2})),!L&&be.createElement("clipPath",{id:"clipPath-dots-".concat(x)},be.createElement("rect",{x:u-k/2,y:c-k/2,width:p+k,height:g+k}))):null,C?null:this.renderArea(A,x),(a||C)&&this.renderDots(A,L,x),(!y||b)&&F9.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(o,r){return o.animationId!==r.prevAnimationId?{prevAnimationId:o.animationId,curPoints:o.points,curBaseLine:o.baseLine,prevPoints:r.curPoints,prevBaseLine:r.curBaseLine}:o.points!==r.curPoints||o.baseLine!==r.curBaseLine?{curPoints:o.points,curBaseLine:o.baseLine}:null}}]),e}(m.PureComponent);ict=RA;v9(RA,"displayName","Area");v9(RA,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!B2.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});v9(RA,"getBaseValue",function(t,e,n,o){var r=t.layout,i=t.baseValue,a=e.props.baseValue,l=a??i;if(dr(l)&&typeof l=="number")return l;var s=r==="horizontal"?o:n,c=s.scale.domain();if(s.type==="number"){var u=Math.max(c[0],c[1]),d=Math.min(c[0],c[1]);return l==="dataMin"?d:l==="dataMax"||u<0?u:Math.max(Math.min(c[0],c[1]),0)}return l==="dataMin"?c[0]:l==="dataMax"?c[1]:c[0]});v9(RA,"getComposedData",function(t){var e=t.props,n=t.item,o=t.xAxis,r=t.yAxis,i=t.xAxisTicks,a=t.yAxisTicks,l=t.bandSize,s=t.dataKey,c=t.stackedData,u=t.dataStartIndex,d=t.displayedData,f=t.offset,p=e.layout,g=c&&c.length,y=ict.getBaseValue(e,n,o,r),w=p==="horizontal",b=!1,C=d.map(function(v,T){var A;g?A=c[u+T]:(A=Bu(v,s),Array.isArray(A)?b=!0:A=[y,A]);var x=A[1]==null||g&&Bu(v,s)==null;return w?{x:uH({axis:o,ticks:i,bandSize:l,entry:v,index:T}),y:x?null:r.scale(A[1]),value:A,payload:v}:{x:x?null:o.scale(A[1]),y:uH({axis:r,ticks:a,bandSize:l,entry:v,index:T}),value:A,payload:v}}),P;return g||b?P=C.map(function(v){var T=Array.isArray(v.value)?v.value[0]:null;return w?{x:v.x,y:T!=null&&v.y!=null?r.scale(T):null}:{x:T!=null?o.scale(T):null,y:v.y}}):P=w?r.scale(y):o.scale(y),Y4({points:C,baseLine:P,layout:p,isRange:b},f)});v9(RA,"renderDotItem",function(t,e){var n;if(be.isValidElement(t))n=be.cloneElement(t,e);else if(va(t))n=t(e);else{var o=fl("recharts-area-dot",typeof t!="boolean"?t.className:"");n=be.createElement(hU,tx({},e,{className:o}))}return n});var yU=function(){return null};yU.displayName="ZAxis";yU.defaultProps={zAxisId:0,range:[64,64],scale:"auto",type:"number"};var WDo=["option","isActive"];function qE(){return qE=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function UDo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function jDo(t){var e=t.option,n=t.isActive,o=NDo(t,WDo);return typeof e=="string"?be.createElement(Vhe,qE({option:be.createElement(Xee,qE({type:e},o)),isActive:n,shapeType:"symbols"},o)):be.createElement(Vhe,qE({option:e,isActive:n,shapeType:"symbols"},o))}function AH(t){"@babel/helpers - typeof";return AH=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},AH(t)}function $E(){return $E=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function mEo(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i=0)&&(n[r]=t[r]);return n}function yEo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function AEo(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,o=new Array(e);n0?a:e&&e.length&&dr(r)&&dr(i)?e.slice(r,i+1):[]};function yct(t){return t==="number"?[0,"auto"]:void 0}var cpe=function(e,n,o,r){var i=e.graphicalItems,a=e.tooltipAxis,l=cte(n,e);return o<0||!i||!i.length||o>=l.length?null:i.reduce(function(s,c){var u,d=(u=c.props.data)!==null&&u!==void 0?u:n;d&&e.dataStartIndex+e.dataEndIndex!==0&&(d=d.slice(e.dataStartIndex,e.dataEndIndex+1));var f;if(a.dataKey&&!a.allowDuplicatedCategory){var p=d===void 0?l:d;f=zJ(p,a.dataKey,r)}else f=d&&d[o]||l[o];return f?[].concat(vH(s),[Sst(c,f)]):s},[])},RFe=function(e,n,o,r){var i=r||{x:e.chartX,y:e.chartY},a=MEo(i,o),l=e.orderedTooltipTicks,s=e.tooltipAxis,c=e.tooltipTicks,u=YPo(a,l,c,s);if(u>=0&&c){var d=c[u]&&c[u].value,f=cpe(e,n,u,d),p=IEo(o,l,u,i);return{activeTooltipIndex:u,activeLabel:d,activePayload:f,activeCoordinate:p}}return null},zEo=function(e,n){var o=n.axes,r=n.graphicalItems,i=n.axisType,a=n.axisIdKey,l=n.stackGroups,s=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,d=e.children,f=e.stackOffset,p=vst(u,i);return o.reduce(function(g,y){var w,b=y.props,C=b.type,P=b.dataKey,v=b.allowDataOverflow,T=b.allowDuplicatedCategory,A=b.scale,x=b.ticks,S=b.includeHidden,R=y.props[a];if(g[R])return g;var M=cte(e.data,{graphicalItems:r.filter(function(_){return _.props[a]===R}),dataStartIndex:s,dataEndIndex:c}),D=M.length,E,W,j;rEo(y.props.domain,v,C)&&(E=Mhe(y.props.domain,null,v),p&&(C==="number"||A!=="auto")&&(j=XE(M,P,"category")));var L=yct(C);if(!E||E.length===0){var k,N=(k=y.props.domain)!==null&&k!==void 0?k:L;if(P){if(E=XE(M,P,C),C==="category"&&p){var F=n4o(E);T&&F?(W=E,E=uK(0,D)):T||(E=oEe(N,E,y).reduce(function(_,X){return _.indexOf(X)>=0?_:[].concat(vH(_),[X])},[]))}else if(C==="category")T?E=E.filter(function(_){return _!==""&&!ia(_)}):E=oEe(N,E,y).reduce(function(_,X){return _.indexOf(X)>=0||X===""||ia(X)?_:[].concat(vH(_),[X])},[]);else if(C==="number"){var U=XPo(M,r.filter(function(_){return _.props[a]===R&&(S||!_.props.hide)}),P,i,u);U&&(E=U)}p&&(C==="number"||A!=="auto")&&(j=XE(M,P,"category"))}else p?E=uK(0,D):l&&l[R]&&l[R].hasStack&&C==="number"?E=f==="expand"?[0,1]:bst(l[R].stackGroups,s,c):E=wst(M,r.filter(function(_){return _.props[a]===R&&(S||!_.props.hide)}),C,u,!0);if(C==="number")E=ape(d,E,R,i,x),N&&(E=Mhe(N,E,v));else if(C==="category"&&N){var O=N,B=E.every(function(_){return O.indexOf(_)>=0});B&&(E=O)}}return Po(Po({},g),{},ki({},R,Po(Po({},y.props),{},{axisType:i,domain:E,categoricalDomain:j,duplicateDomain:W,originalDomain:(w=y.props.domain)!==null&&w!==void 0?w:L,isCategorical:p,layout:u})))},{})},DEo=function(e,n){var o=n.graphicalItems,r=n.Axis,i=n.axisType,a=n.axisIdKey,l=n.stackGroups,s=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,d=e.children,f=cte(e.data,{graphicalItems:o,dataStartIndex:s,dataEndIndex:c}),p=f.length,g=vst(u,i),y=-1;return o.reduce(function(w,b){var C=b.props[a],P=yct("number");if(!w[C]){y++;var v;return g?v=uK(0,p):l&&l[C]&&l[C].hasStack?(v=bst(l[C].stackGroups,s,c),v=ape(d,v,C,i)):(v=Mhe(P,wst(f,o.filter(function(T){return T.props[a]===C&&!T.props.hide}),"number",u),r.defaultProps.allowDataOverflow),v=ape(d,v,C,i)),Po(Po({},w),{},ki({},C,Po(Po({axisType:i},r.defaultProps),{},{hide:!0,orientation:Xm(REo,"".concat(i,".").concat(y%2),null),domain:v,originalDomain:P,isCategorical:g,layout:u})))}return w},{})},EEo=function(e,n){var o=n.axisType,r=o===void 0?"xAxis":o,i=n.AxisComp,a=n.graphicalItems,l=n.stackGroups,s=n.dataStartIndex,c=n.dataEndIndex,u=e.children,d="".concat(r,"Id"),f=e1(u,i),p={};return f&&f.length?p=zEo(e,{axes:f,graphicalItems:a,axisType:r,axisIdKey:d,stackGroups:l,dataStartIndex:s,dataEndIndex:c}):a&&a.length&&(p=DEo(e,{Axis:i,graphicalItems:a,axisType:r,axisIdKey:d,stackGroups:l,dataStartIndex:s,dataEndIndex:c})),p},FEo=function(e){var n=c8(e),o=M6(n,!1,!0);return{tooltipTicks:o,orderedTooltipTicks:H3e(o,function(r){return r.coordinate}),tooltipAxis:n,tooltipAxisBandSize:tK(n,o)}},HFe=function(e){var n=e.children,o=e.defaultShowTooltip,r=og(n,hH),i=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(i=r.props.startIndex),r.props.endIndex>=0&&(a=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!o}},kEo=function(e){return!e||!e.length?!1:e.some(function(n){var o=j6(n&&n.type);return o&&o.indexOf("Bar")>=0})},MFe=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},LEo=function(e,n){var o=e.props,r=e.graphicalItems,i=e.xAxisMap,a=i===void 0?{}:i,l=e.yAxisMap,s=l===void 0?{}:l,c=o.width,u=o.height,d=o.children,f=o.margin||{},p=og(d,hH),g=og(d,J2),y=Object.keys(s).reduce(function(T,A){var x=s[A],S=x.orientation;return!x.mirror&&!x.hide?Po(Po({},T),{},ki({},S,T[S]+x.width)):T},{left:f.left||0,right:f.right||0}),w=Object.keys(a).reduce(function(T,A){var x=a[A],S=x.orientation;return!x.mirror&&!x.hide?Po(Po({},T),{},ki({},S,Xm(T,"".concat(S))+x.height)):T},{top:f.top||0,bottom:f.bottom||0}),b=Po(Po({},w),y),C=b.bottom;p&&(b.bottom+=p.props.height||hH.defaultProps.height),g&&n&&(b=VPo(b,r,o,n));var P=c-b.left-b.right,v=u-b.top-b.bottom;return Po(Po({brushBottom:C},b),{},{width:Math.max(P,0),height:Math.max(v,0)})},WEo=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},AU=function(e){var n,o=e.chartName,r=e.GraphicalChild,i=e.defaultTooltipEventType,a=i===void 0?"axis":i,l=e.validateTooltipEventTypes,s=l===void 0?["axis"]:l,c=e.axisComponents,u=e.legendContent,d=e.formatAxisMap,f=e.defaultProps,p=function(w,b){var C=b.graphicalItems,P=b.stackGroups,v=b.offset,T=b.updateId,A=b.dataStartIndex,x=b.dataEndIndex,S=w.barSize,R=w.layout,M=w.barGap,D=w.barCategoryGap,E=w.maxBarSize,W=MFe(R),j=W.numericAxisName,L=W.cateAxisName,k=kEo(C),N=[];return C.forEach(function(F,U){var O=cte(w.data,{graphicalItems:[F],dataStartIndex:A,dataEndIndex:x}),B=F.props,_=B.dataKey,X=B.maxBarSize,$=F.props["".concat(j,"Id")],Q=F.props["".concat(L,"Id")],le={},q=c.reduce(function(Se,ze){var Ie=b["".concat(ze.axisType,"Map")],ye=F.props["".concat(ze.axisType,"Id")];Ie&&Ie[ye]||ze.axisType==="zAxis"||hb();var ce=Ie[ye];return Po(Po({},Se),{},ki(ki({},ze.axisType,ce),"".concat(ze.axisType,"Ticks"),M6(ce)))},le),te=q[L],re=q["".concat(L,"Ticks")],ae=P&&P[$]&&P[$].hasStack&&iCo(F,P[$].stackGroups),se=j6(F.type).indexOf("Bar")>=0,ne=tK(te,re),fe=[],ge=k&&OPo({barSize:S,stackGroups:P,totalSize:WEo(q,L)});if(se){var de,Z,he=ia(X)?E:X,xe=(de=(Z=tK(te,re,!0))!==null&&Z!==void 0?Z:he)!==null&&de!==void 0?de:0;fe=_Po({barGap:M,barCategoryGap:D,bandSize:xe!==ne?xe:ne,sizeList:ge[Q],maxBarSize:he}),xe!==ne&&(fe=fe.map(function(Se){return Po(Po({},Se),{},{position:Po(Po({},Se.position),{},{offset:Se.position.offset-xe/2})})}))}var He=F&&F.type&&F.type.getComposedData;He&&N.push({props:Po(Po({},He(Po(Po({},q),{},{displayedData:O,props:w,dataKey:_,item:F,bandSize:ne,barPosition:fe,offset:v,stackedData:ae,layout:R,dataStartIndex:A,dataEndIndex:x}))),{},ki(ki(ki({key:F.key||"item-".concat(U)},j,q[j]),L,q[L]),"animationId",T)),childIndex:p4o(F,w.children),item:F})}),N},g=function(w,b){var C=w.props,P=w.dataStartIndex,v=w.dataEndIndex,T=w.updateId;if(!yze({props:C}))return null;var A=C.children,x=C.layout,S=C.stackOffset,R=C.data,M=C.reverseStackOrder,D=MFe(x),E=D.numericAxisName,W=D.cateAxisName,j=e1(A,r),L=nCo(R,j,"".concat(E,"Id"),"".concat(W,"Id"),S,M),k=c.reduce(function(B,_){var X="".concat(_.axisType,"Map");return Po(Po({},B),{},ki({},X,EEo(C,Po(Po({},_),{},{graphicalItems:j,stackGroups:_.axisType===E&&L,dataStartIndex:P,dataEndIndex:v}))))},{}),N=LEo(Po(Po({},k),{},{props:C,graphicalItems:j}),b==null?void 0:b.legendBBox);Object.keys(k).forEach(function(B){k[B]=d(C,k[B],N,B.replace("Map",""),o)});var F=k["".concat(W,"Map")],U=FEo(F),O=p(C,Po(Po({},k),{},{dataStartIndex:P,dataEndIndex:v,updateId:T,graphicalItems:j,stackGroups:L,offset:N}));return Po(Po({formattedGraphicalItems:O,graphicalItems:j,offset:N,stackGroups:L},U),k)};return n=function(y){bEo(w,y);function w(b){var C,P,v;return yEo(this,w),v=vEo(this,w,[b]),ki(Tl(v),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ki(Tl(v),"accessibilityManager",new oEo),ki(Tl(v),"handleLegendBBoxUpdate",function(T){if(T){var A=v.state,x=A.dataStartIndex,S=A.dataEndIndex,R=A.updateId;v.setState(Po({legendBBox:T},g({props:v.props,dataStartIndex:x,dataEndIndex:S,updateId:R},Po(Po({},v.state),{},{legendBBox:T}))))}}),ki(Tl(v),"handleReceiveSyncEvent",function(T,A,x){if(v.props.syncId===T){if(x===v.eventEmitterSymbol&&typeof v.props.syncMethod!="function")return;v.applySyncEvent(A)}}),ki(Tl(v),"handleBrushChange",function(T){var A=T.startIndex,x=T.endIndex;if(A!==v.state.dataStartIndex||x!==v.state.dataEndIndex){var S=v.state.updateId;v.setState(function(){return Po({dataStartIndex:A,dataEndIndex:x},g({props:v.props,dataStartIndex:A,dataEndIndex:x,updateId:S},v.state))}),v.triggerSyncEvent({dataStartIndex:A,dataEndIndex:x})}}),ki(Tl(v),"handleMouseEnter",function(T){var A=v.getMouseInfo(T);if(A){var x=Po(Po({},A),{},{isTooltipActive:!0});v.setState(x),v.triggerSyncEvent(x);var S=v.props.onMouseEnter;va(S)&&S(x,T)}}),ki(Tl(v),"triggeredAfterMouseMove",function(T){var A=v.getMouseInfo(T),x=A?Po(Po({},A),{},{isTooltipActive:!0}):{isTooltipActive:!1};v.setState(x),v.triggerSyncEvent(x);var S=v.props.onMouseMove;va(S)&&S(x,T)}),ki(Tl(v),"handleItemMouseEnter",function(T){v.setState(function(){return{isTooltipActive:!0,activeItem:T,activePayload:T.tooltipPayload,activeCoordinate:T.tooltipPosition||{x:T.cx,y:T.cy}}})}),ki(Tl(v),"handleItemMouseLeave",function(){v.setState(function(){return{isTooltipActive:!1}})}),ki(Tl(v),"handleMouseMove",function(T){T.persist(),v.throttleTriggeredAfterMouseMove(T)}),ki(Tl(v),"handleMouseLeave",function(T){v.throttleTriggeredAfterMouseMove.cancel();var A={isTooltipActive:!1};v.setState(A),v.triggerSyncEvent(A);var x=v.props.onMouseLeave;va(x)&&x(A,T)}),ki(Tl(v),"handleOuterEvent",function(T){var A=h4o(T),x=Xm(v.props,"".concat(A));if(A&&va(x)){var S,R;/.*touch.*/i.test(A)?R=v.getMouseInfo(T.changedTouches[0]):R=v.getMouseInfo(T),x((S=R)!==null&&S!==void 0?S:{},T)}}),ki(Tl(v),"handleClick",function(T){var A=v.getMouseInfo(T);if(A){var x=Po(Po({},A),{},{isTooltipActive:!0});v.setState(x),v.triggerSyncEvent(x);var S=v.props.onClick;va(S)&&S(x,T)}}),ki(Tl(v),"handleMouseDown",function(T){var A=v.props.onMouseDown;if(va(A)){var x=v.getMouseInfo(T);A(x,T)}}),ki(Tl(v),"handleMouseUp",function(T){var A=v.props.onMouseUp;if(va(A)){var x=v.getMouseInfo(T);A(x,T)}}),ki(Tl(v),"handleTouchMove",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&v.throttleTriggeredAfterMouseMove(T.changedTouches[0])}),ki(Tl(v),"handleTouchStart",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&v.handleMouseDown(T.changedTouches[0])}),ki(Tl(v),"handleTouchEnd",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&v.handleMouseUp(T.changedTouches[0])}),ki(Tl(v),"triggerSyncEvent",function(T){v.props.syncId!==void 0&&zle.emit(Dle,v.props.syncId,T,v.eventEmitterSymbol)}),ki(Tl(v),"applySyncEvent",function(T){var A=v.props,x=A.layout,S=A.syncMethod,R=v.state.updateId,M=T.dataStartIndex,D=T.dataEndIndex;if(T.dataStartIndex!==void 0||T.dataEndIndex!==void 0)v.setState(Po({dataStartIndex:M,dataEndIndex:D},g({props:v.props,dataStartIndex:M,dataEndIndex:D,updateId:R},v.state)));else if(T.activeTooltipIndex!==void 0){var E=T.chartX,W=T.chartY,j=T.activeTooltipIndex,L=v.state,k=L.offset,N=L.tooltipTicks;if(!k)return;if(typeof S=="function")j=S(N,T);else if(S==="value"){j=-1;for(var F=0;F=0){var ae,se;if(E.dataKey&&!E.allowDuplicatedCategory){var ne=typeof E.dataKey=="function"?re:"payload.".concat(E.dataKey.toString());ae=zJ(F,ne,j),se=U&&O&&zJ(O,ne,j)}else ae=F==null?void 0:F[W],se=U&&O&&O[W];if(Q||$){var fe=T.props.activeIndex!==void 0?T.props.activeIndex:W;return[m.cloneElement(T,Po(Po(Po({},S.props),q),{},{activeIndex:fe})),null,null]}if(!ia(ae))return[te].concat(vH(v.renderActivePoints({item:S,activePoint:ae,basePoint:se,childIndex:W,isRange:U})))}else{var ge,de=(ge=v.getItemByXY(v.state.activeCoordinate))!==null&&ge!==void 0?ge:{graphicalItem:te},Z=de.graphicalItem,he=Z.item,xe=he===void 0?T:he,He=Z.childIndex,Se=Po(Po(Po({},S.props),q),{},{activeIndex:He});return[m.cloneElement(xe,Se),null,null]}return U?[te,null,null]:[te,null]}),ki(Tl(v),"renderCustomized",function(T,A,x){return m.cloneElement(T,Po(Po({key:"recharts-customized-".concat(x)},v.props),v.state))}),ki(Tl(v),"renderMap",{CartesianGrid:{handler:a_,once:!0},ReferenceArea:{handler:v.renderReferenceElement},ReferenceLine:{handler:a_},ReferenceDot:{handler:v.renderReferenceElement},XAxis:{handler:a_},YAxis:{handler:a_},Brush:{handler:v.renderBrush,once:!0},Bar:{handler:v.renderGraphicChild},Line:{handler:v.renderGraphicChild},Area:{handler:v.renderGraphicChild},Radar:{handler:v.renderGraphicChild},RadialBar:{handler:v.renderGraphicChild},Scatter:{handler:v.renderGraphicChild},Pie:{handler:v.renderGraphicChild},Funnel:{handler:v.renderGraphicChild},Tooltip:{handler:v.renderCursor,once:!0},PolarGrid:{handler:v.renderPolarGrid,once:!0},PolarAngleAxis:{handler:v.renderPolarAxis},PolarRadiusAxis:{handler:v.renderPolarAxis},Customized:{handler:v.renderCustomized}}),v.clipPathId="".concat((C=b.id)!==null&&C!==void 0?C:uS("recharts"),"-clip"),v.throttleTriggeredAfterMouseMove=vlt(v.triggeredAfterMouseMove,(P=b.throttleDelay)!==null&&P!==void 0?P:1e3/60),v.state={},v}return wEo(w,[{key:"componentDidMount",value:function(){var C,P;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var C=this.props,P=C.children,v=C.data,T=C.height,A=C.layout,x=og(P,rh);if(x){var S=x.props.defaultIndex;if(!(typeof S!="number"||S<0||S>this.state.tooltipTicks.length)){var R=this.state.tooltipTicks[S]&&this.state.tooltipTicks[S].value,M=cpe(this.state,v,S,R),D=this.state.tooltipTicks[S].coordinate,E=(this.state.offset.top+T)/2,W=A==="horizontal",j=W?{x:D,y:E}:{y:D,x:E},L=this.state.formattedGraphicalItems.find(function(N){var F=N.item;return F.type.name==="Scatter"});L&&(j=Po(Po({},j),L.props.points[S].tooltipPosition),M=L.props.points[S].tooltipPayload);var k={activeTooltipIndex:S,isTooltipActive:!0,activeLabel:R,activePayload:M,activeCoordinate:j};this.setState(k),this.renderCursor(x),this.accessibilityManager.setIndex(S)}}}},{key:"getSnapshotBeforeUpdate",value:function(C,P){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==P.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==C.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==C.margin){var v,T;this.accessibilityManager.setDetails({offset:{left:(v=this.props.margin.left)!==null&&v!==void 0?v:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0}})}return null}},{key:"componentDidUpdate",value:function(C){Kfe([og(C.children,rh)],[og(this.props.children,rh)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var C=og(this.props.children,rh);if(C&&typeof C.props.shared=="boolean"){var P=C.props.shared?"axis":"item";return s.indexOf(P)>=0?P:a}return a}},{key:"getMouseInfo",value:function(C){if(!this.container)return null;var P=this.container,v=P.getBoundingClientRect(),T=Hxo(v),A={chartX:Math.round(C.pageX-T.left),chartY:Math.round(C.pageY-T.top)},x=v.width/P.offsetWidth||1,S=this.inRange(A.chartX,A.chartY,x);if(!S)return null;var R=this.state,M=R.xAxisMap,D=R.yAxisMap,E=this.getTooltipEventType();if(E!=="axis"&&M&&D){var W=c8(M).scale,j=c8(D).scale,L=W&&W.invert?W.invert(A.chartX):null,k=j&&j.invert?j.invert(A.chartY):null;return Po(Po({},A),{},{xValue:L,yValue:k})}var N=RFe(this.state,this.props.data,this.props.layout,S);return N?Po(Po({},A),N):null}},{key:"inRange",value:function(C,P){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=this.props.layout,A=C/v,x=P/v;if(T==="horizontal"||T==="vertical"){var S=this.state.offset,R=A>=S.left&&A<=S.left+S.width&&x>=S.top&&x<=S.top+S.height;return R?{x:A,y:x}:null}var M=this.state,D=M.angleAxisMap,E=M.radiusAxisMap;if(D&&E){var W=c8(D);return aEe({x:A,y:x},W)}return null}},{key:"parseEventsOfWrapper",value:function(){var C=this.props.children,P=this.getTooltipEventType(),v=og(C,rh),T={};v&&P==="axis"&&(v.props.trigger==="click"?T={onClick:this.handleClick}:T={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var A=DJ(this.props,this.handleOuterEvent);return Po(Po({},A),T)}},{key:"addListener",value:function(){zle.on(Dle,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){zle.removeListener(Dle,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(C,P,v){for(var T=this.state.formattedGraphicalItems,A=0,x=T.length;A{const r=Jt(),[i,a]=m.useState(!1),l=()=>{n==null||n(!t)},s=()=>{o==null||o(!e)};return h.jsx(Al,{content:h.jsxs("div",{style:{width:"200px"},children:[h.jsx(hw,{checked:t,onClick:l,children:Y.t("menu.graph.ShowHorizontalGridLines",r)}),h.jsx(hw,{checked:e,onClick:s,children:Y.t("menu.graph.ShowHorizontalGridLines",r)})]}),children:h.jsx(_me,{style:{position:"absolute",fontSize:"30px",top:"4px",right:"30px",transition:"0.5s",color:i?"darkgray":"lightblue",cursor:"pointer"},onMouseOver:()=>{a(!0)},onMouseOut:()=>{a(!1)}})})}),Act=be.memo(({type:t,dataSource:e,height:n,dataKeyAxisX:o,labelX:r,labelY:i,unitX:a,unitY:l,yMin:s="auto",yMax:c="auto",fractionDigits:u=2,referenceX:d,color:f})=>{const[p,g]=m.useState(0),[y,w]=m.useState(!0),[b,C]=m.useState(!0),[P,v]=m.useState(null);m.useEffect(()=>{if(!e||e.length===0)return;const R=Array.isArray(e)?Object.keys(e[0]).length-1:Object.keys(e).length-1;p!==R&&g(R)},[e]);const T=m.useMemo(()=>{const R=[];for(let M=0;M{},x=R=>{v(R.dataKey)},S=()=>{v(null)};return h.jsx(h.Fragment,{children:e&&h.jsx("div",{id:"bar-graph-"+r+"-"+i,style:{width:"100%",height:`${n}%`,position:"relative",direction:"ltr"},children:h.jsxs("div",{style:{userSelect:"none",width:"100%",height:"100%",position:"absolute",top:0,left:0},children:[h.jsx(sU,{width:"100%",height:"100%",children:h.jsxs(NEo,{data:e,onMouseDown:A,margin:{top:5,right:30,left:20,bottom:30},children:[h.jsx(rh,{formatter:R=>R.toFixed(u)+" "+l}),h.jsx(bw,{vertical:b,horizontal:y,stroke:"rgba(128, 128, 128, 0.3)"}),h.jsx($9,{x:d,stroke:"orange",strokeWidth:2}),h.jsx(l1,{dataKey:o??r,fontSize:"10px",children:h.jsx(os,{value:r+(a?" ("+a+")":""),offset:0,position:"bottom"})}),h.jsx(vh,{domain:[s,c],fontSize:"10px",children:h.jsx(os,{dx:-15,value:i+(l?" ("+l+")":""),offset:0,angle:-90,position:"center"})}),T,p>1&&h.jsx(J2,{iconType:"plainline",verticalAlign:"top",height:36,onMouseLeave:S,onMouseEnter:x})]})}),h.jsx(YEo,{horizontalGrid:y,verticalGrid:b,changeHorizontalGrid:R=>{w(R)},changeVerticalGrid:R=>{C(R)}})]})})})}),WM=1,OEo=t=>{const{cx:e,cy:n,opacity:o,stroke:r,index:i,numberOfPoints:a,numberOfSymbols:l,scale:s,fillColor:c}=t,u=a?Math.round(a/l):1;return e&&n&&i>0&&i%u===0?h.jsx("svg",{x:e-10*s,y:n-10*s,width:20*s,height:20*s,viewBox:"-10 -10 20 20",children:h.jsx("circle",{cx:"0",cy:"0",r:"3",style:{opacity:o,stroke:r,fill:c??"white",strokeWidth:WM}})}):null},_Eo=t=>{const{cx:e,cy:n,opacity:o,stroke:r,index:i,scale:a,numberOfPoints:l,numberOfSymbols:s,fillColor:c}=t,u=l?Math.round(l/s):1;return e&&n&&i>0&&i%u===0?h.jsx("svg",{x:e-10*a,y:n-10*a,width:20*a,height:20*a,viewBox:"-10 -10 20 20",children:h.jsx("rect",{x:"-3",y:"-3",width:"6",height:"6",style:{opacity:o,stroke:r,fill:c??"white",strokeWidth:WM}})}):null},l_=t=>{const{cx:e,cy:n,opacity:o,stroke:r,index:i,scale:a,numberOfPoints:l,numberOfSymbols:s,direction:c,fillColor:u}=t,d=l?Math.round(l/s):1;if(e&&n&&i>0&&i%d===0){let f;switch(c){case 1:f="-4,2.5,4,2.5,0,-3.5";break;case 2:f="2.5,4,2.5,-4,-3.5,0";break;case 3:f="-2.5,4,-2.5,-4,3.5,0";break;default:f="-4,-2.5,4,-2.5,0,3.5"}return h.jsx("svg",{x:e-10*a,y:n-10*a,width:20*a,height:20*a,viewBox:"-10 -10 20 20",children:h.jsx("polygon",{points:f,style:{opacity:o,stroke:r,fill:u??"white",strokeWidth:WM}})})}return null},VEo=t=>{const{cx:e,cy:n,opacity:o,stroke:r,index:i,scale:a,numberOfPoints:l,numberOfSymbols:s,fillColor:c}=t,u=l?Math.round(l/s):1;return e&&n&&i>0&&i%u===0?h.jsx("svg",{x:e-10*a,y:n-10*a,width:20*a,height:20*a,viewBox:"-10 -10 20 20",children:h.jsx("polygon",{points:"-3,0,0,5,3,0,0,-5",style:{opacity:o,stroke:r,fill:c??"white",strokeWidth:WM}})}):null},GEo=t=>{const{cx:e,cy:n,opacity:o,stroke:r,index:i,scale:a,numberOfPoints:l,numberOfSymbols:s,fillColor:c}=t,u=l?Math.round(l/s):1;if(e&&n&&i>0&&i%u===0){const d=.05*a;return h.jsx("svg",{x:e-100*d,y:n-100*d,width:300*d,height:300*d,viewBox:"0 0 300 300",children:h.jsx("polygon",{points:"100,10 40,180 190,60 10,60 160,180",style:{opacity:o,stroke:r,fill:c??"white",strokeWidth:WM}})})}return null},XEo=t=>{const{cx:e,cy:n,opacity:o,stroke:r,index:i,scale:a,numberOfPoints:l,numberOfSymbols:s,fillColor:c}=t,u=l?Math.round(l/s):1;if(e&&n&&i>0&&i%u===0){const d=.02*a;return h.jsx("svg",{x:e-150*d,y:n-150*d,width:300*d,height:300*d,viewBox:"0 0 300 300",children:h.jsx("polygon",{className:"hex",points:"300,150 225,280 75,280 0,150 75,20 225,20",style:{opacity:o,stroke:r,fill:c??"white",strokeWidth:WM}})})}return null},Dx=(t,e,n,o,r,i)=>{switch(t){case"circle":return h.jsx(OEo,{scale:e,numberOfPoints:n,numberOfSymbols:o,opacity:r,fillColor:i});case"square":return h.jsx(_Eo,{scale:e,numberOfPoints:n,numberOfSymbols:o,opacity:r,fillColor:i});case"triangle up":return h.jsx(l_,{scale:1.1*e,numberOfPoints:n,numberOfSymbols:o,direction:1,opacity:r,fillColor:i});case"triangle down":return h.jsx(l_,{scale:1.1*e,numberOfPoints:n,numberOfSymbols:o,direction:0,opacity:r,fillColor:i});case"triangle right":return h.jsx(l_,{scale:1.1*e,numberOfPoints:n,numberOfSymbols:o,direction:3,opacity:r,fillColor:i});case"triangle left":return h.jsx(l_,{scale:1.1*e,numberOfPoints:n,numberOfSymbols:o,direction:2,opacity:r,fillColor:i});case"star":return h.jsx(GEo,{scale:1.25*e,numberOfPoints:n,numberOfSymbols:o,opacity:r,fillColor:i});case"diamond":return h.jsx(VEo,{scale:1.1*e,numberOfPoints:n,numberOfSymbols:o,opacity:r,fillColor:i});case"hexagon":return h.jsx(XEo,{scale:1.3*e,numberOfPoints:n,numberOfSymbols:o,opacity:r,fillColor:i})}},JEo=be.memo(({horizontalGrid:t,verticalGrid:e,lineCount:n,lineWidth:o,symbolSize:r,changeHorizontalGrid:i,changeVerticalGrid:a,changeLineWidth:l,changeSymbolSize:s})=>{const c=Jt(),[u,d]=m.useState(!1),f=()=>{i==null||i(!t)},p=()=>{a==null||a(!e)},g=w=>{l==null||l(w/2)},y=w=>{s==null||s(w/5)};return h.jsx(Al,{content:h.jsxs("div",{style:{width:"200px"},children:[h.jsx(EC,{min:0,max:10,value:o*2,onChange:g,children:Y.t("menu.graph.LineWidth",c)+":"}),h.jsx(EC,{min:2,max:12,value:r*5,onChange:y,children:Y.t("menu.graph.SymbolSize",c)+":"}),h.jsx(hw,{checked:t,onClick:f,children:Y.t("menu.graph.ShowHorizontalGridLines",c)}),h.jsx(hw,{checked:e,onClick:p,children:Y.t("menu.graph.ShowHorizontalGridLines",c)})]}),children:h.jsx(_me,{style:{position:"absolute",fontSize:"30px",top:"4px",right:"30px",transition:"0.5s",color:u?"darkgray":"lightblue",cursor:"pointer"},onMouseOver:()=>{d(!0)},onMouseOut:()=>{d(!1)}})})}),Ex=["circle","square","triangle up","triangle down","triangle right","triangle left","star","diamond","hexagon"],Tf=({type:t,chartType:e=Ml.Line,selectedIndex:n,dataSource:o,labels:r,height:i,dataKeyAxisX:a,labelX:l,labelY:s,unitX:c,unitY:u,yMin:d="auto",yMax:f="auto",curveType:p="linear",referenceX:g,fractionDigits:y=2,symbolCount:w=12})=>{const[b,C]=m.useState(0),[P,v]=m.useState(!0),[T,A]=m.useState(!0),[x,S]=m.useState(null),[R,M]=m.useState(2),[D,E]=m.useState(1);m.useEffect(()=>{if(!o||o.length===0){C(0);return}const N=Array.isArray(o)?Object.keys(o[0]).length-1:Object.keys(o).length-1;b!==N&&C(N)},[b,o]);const W=m.useMemo(()=>{const N=[];let F;for(let U=0;U0?_||F:!1,isAnimationActive:!1},U))}return N},[t,e,n,p,r,b,R,w,D,x]),j=()=>{},L=N=>{S(N.dataKey)},k=()=>{S(null)};return h.jsx(h.Fragment,{children:o&&h.jsx("div",{id:"line-graph-"+l+"-"+s,style:{width:"100%",height:`${i}%`,position:"relative",direction:"ltr"},children:h.jsxs("div",{style:{userSelect:"none",width:"100%",height:"100%",position:"absolute",top:0,left:0},children:[h.jsx(sU,{width:"100%",height:"100%",children:e===Ml.Area?h.jsxs(jEo,{data:o,onMouseDown:j,margin:{top:5,right:30,left:20,bottom:30},children:[h.jsx(rh,{formatter:N=>N.toFixed(y)+" "+u}),h.jsx(bw,{vertical:T,horizontal:P,stroke:"rgba(128, 128, 128, 0.3)"}),h.jsx($9,{x:g,stroke:"orange",strokeWidth:2}),h.jsx(l1,{dataKey:a??l,fontSize:"10px",children:h.jsx(os,{value:l+(c?" ("+c+")":""),offset:0,position:"bottom"})}),h.jsx(vh,{domain:[d,f],fontSize:"10px",children:h.jsx(os,{dx:-15,value:s+(u?" ("+u+")":""),offset:0,angle:-90,position:"center"})}),W,b>1&&h.jsx(J2,{iconType:"plainline",verticalAlign:"top",height:36,onMouseLeave:k,onMouseEnter:L})]}):h.jsxs(c6e,{data:o,onMouseDown:j,margin:{top:5,right:30,left:20,bottom:30},children:[h.jsx(rh,{formatter:N=>N.toFixed(y)+" "+u}),h.jsx(bw,{vertical:T,horizontal:P,stroke:"rgba(128, 128, 128, 0.3)"}),h.jsx($9,{x:g,stroke:"orange",strokeWidth:2}),h.jsx(l1,{dataKey:a??l,fontSize:"10px",children:h.jsx(os,{value:l+(c?" ("+c+")":""),offset:0,position:"bottom"})}),h.jsx(vh,{domain:[d,f],fontSize:"10px",children:h.jsx(os,{dx:-15,value:s+(u?" ("+u+")":""),offset:0,angle:-90,position:"center"})}),W,b>1&&h.jsx(J2,{wrapperStyle:{fontSize:"11px"},iconType:"plainline",verticalAlign:"top",height:36,onMouseLeave:k,onMouseEnter:L})]})}),h.jsx(JEo,{lineCount:b,symbolSize:D,lineWidth:R,horizontalGrid:P,verticalGrid:T,changeHorizontalGrid:N=>{v(N)},changeVerticalGrid:N=>{A(N)},changeLineWidth:N=>{M(N)},changeSymbolSize:N=>{E(N)}})]})})})},KEo=Ro.div` position: fixed; top: 80px; left: 50px; @@ -8700,16 +8700,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho justify-content: space-between; align-items: center; cursor: move; -`,nFo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=Tn($vt),a=Tn(mOe),l=H(X4t),s=H(jg),c=H(J4t),u=H(K4t),d=H(Pc),[f,p]=m.useState(!0),g=m.useRef(null),y=m.useRef(),w=g.current?g.current.clientWidth+40:l?l.width+40:640,b=g.current?g.current.clientHeight+100:l?l.height+100:600,[C,P]=m.useState({x:l?Math.max(l.x,w-window.innerWidth):0,y:l?Math.min(l.y,window.innerHeight-b):0}),v=be.useRef(null),T=Jt(),A=Ms[r.getMonth()];m.useEffect(()=>{P({x:Math.max(l==null?void 0:l.x,w-window.innerWidth),y:Math.min(l==null?void 0:l.y,window.innerHeight-b)})},[l,w,b]),m.useEffect(()=>{const j=()=>{P({x:Math.max(l==null?void 0:l.x,w-window.innerWidth),y:Math.min(l==null?void 0:l.y,window.innerHeight-b)})};return window.addEventListener("resize",j),()=>{window.removeEventListener("resize",j)}},[l,w,b]),m.useEffect(()=>(g.current&&(y.current||(y.current=new ResizeObserver(()=>{o(j=>{g.current&&(j.viewState.yearlyLightSensorPanelRect||(j.viewState.yearlyLightSensorPanelRect=new cr(0,0,600,500)),j.viewState.yearlyLightSensorPanelRect.width=g.current.offsetWidth,j.viewState.yearlyLightSensorPanelRect.height=g.current.offsetHeight)})})),y.current.observe(g.current)),()=>{var j;(j=y.current)==null||j.disconnect()}),[]);const x=(j,L)=>{P({x:Math.max(L.x,w-window.innerWidth),y:Math.min(L.y,window.innerHeight-b)})},S=(j,L)=>{o(k=>{k.viewState.yearlyLightSensorPanelRect||(k.viewState.yearlyLightSensorPanelRect=new cr(0,0,600,500)),k.viewState.yearlyLightSensorPanelRect.x=Math.max(L.x,w-window.innerWidth),k.viewState.yearlyLightSensorPanelRect.y=Math.min(L.y,window.innerHeight-b)})},R=()=>{o(j=>{j.viewState.showYearlyLightSensorPanel=!1,e&&(j.actionInfo={name:"Close Yearly Light Sensor Graph",timestamp:new Date().getTime()})})},{t:M}=Vl(),D=M("word.Month",T),E=M("word.Radiation",T),W=i&&i[0]?Object.keys(i[0]).length===0:!0;return h.jsx(_i,{nodeRef:v,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:x,onStop:S,onMouseDown:()=>{o(j=>{j.selectedFloatingWindow="yearlyLightSensorPanel"})},children:h.jsx(ZEo,{ref:v,style:{zIndex:d==="yearlyLightSensorPanel"?Sc:9},children:h.jsxs(eFo,{ref:g,style:{opacity:n,width:(l?l.width:600)+"px",height:(l?l.height:500)+"px"},children:[h.jsxs(tFo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[M("sensorPanel.LightSensor",T)+": ",h.jsx("span",{style:{fontSize:"10px"},children:M("sensorPanel.WeatherDataFrom",T)+" "+t+" | "+r.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{R()},onMouseDown:()=>{R()},children:M("word.Close",T)})]}),c&&h.jsx(Tf,{type:vi.DaylightData,chartType:Ml.Area,dataSource:i.map(j=>({Month:j.Month,Daylight:j.Daylight})),height:100,dataKeyAxisX:"Month",labelX:D,labelY:M("word.Daylight",T),unitY:M("word.Hour",T),yMin:0,curveType:"linear",fractionDigits:1,referenceX:A}),u&&h.jsx(Act,{type:vi.ClearnessData,dataSource:i.map(j=>({Month:j.Month,Clearness:j.Clearness})),height:100,dataKeyAxisX:"Month",labelX:D,labelY:M("yearlyLightSensorPanel.SkyClearness",T),unitY:"%",yMin:0,yMax:100,fractionDigits:1,referenceX:A,color:"#66CDAA"}),f&&h.jsx(Tf,{type:vi.YearlyRadiationSensorData,chartType:Ml.Line,dataSource:i.map(({Daylight:j,Clearness:L,...k})=>k),labels:a,height:100,dataKeyAxisX:"Month",labelX:D,labelY:E,unitY:"kWh/m²/"+M("word.Day",T),yMin:0,curveType:"linear",fractionDigits:2,referenceX:A}),h.jsxs(en,{style:{alignSelf:"center",padding:"10px",direction:"ltr"},children:[h.jsxs(en,{children:[h.jsx(xc,{title:M("yearlyLightSensorPanel.ShowDaylightResults",T),checked:c,onChange:j=>{o(L=>{L.viewState.yearlyLightSensorPanelShowDaylight=j})}}),M("word.Daylight",T)]}),h.jsxs(en,{children:[h.jsx(xc,{title:M("yearlyLightSensorPanel.ShowSkyClearnessResults",T),checked:u,onChange:j=>{o(L=>{L.viewState.yearlyLightSensorPanelShowClearness=j})}}),M("yearlyLightSensorPanel.SkyClearness",T)]}),h.jsxs(en,{children:[h.jsx(xc,{title:M("yearlyLightSensorPanel.ShowAverageDailySolarRadiation",T),checked:f,onChange:j=>{p(j)}}),M("word.Radiation",T)]}),h.jsxs(en,{children:[h.jsx(lo,{type:"default",icon:W?h.jsx(Sh,{}):h.jsx(Hf,{}),title:M(W?"word.Run":"word.Update",T),onClick:()=>{if(s(z.Sensor)===0){hn(M("analysisManager.NoSensorForCollectingData",T));return}hn(M("message.SimulationStarted",T)),setTimeout(()=>{o(L=>{e&&(L.actionInfo={name:"Collect Yearly Data for Sensors",timestamp:new Date().getTime()})}),ht.getState().set(L=>{L.runYearlyLightSensor=!0,L.pauseYearlyLightSensor=!1,L.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:M("word.SaveAsImage",T),onClick:()=>{kd("line-graph-"+D+"-"+E,"yearly-light-sensor").then(()=>{hn(M("message.ScreenshotSaved",T)),e&&o(j=>{j.actionInfo={name:"Take Screenshot of Yearly Light Sensor Graph",timestamp:new Date().getTime()}})})}}),i&&i.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:M("word.SaveAsCsv",T),onClick:()=>{bh(i,"yearly-light-sensor.csv"),hn(M("message.CsvFileSaved",T)),e&&o(j=>{j.actionInfo={name:"Export Yearly Light Sensor Result as CSV",timestamp:new Date().getTime()}})}})]})]})]})})})});//! moment.js +`,nFo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=Tn($vt),a=Tn(mOe),l=H(X4t),s=H(jg),c=H(J4t),u=H(K4t),d=H(Pc),[f,p]=m.useState(!0),g=m.useRef(null),y=m.useRef(),w=g.current?g.current.clientWidth+40:l?l.width+40:640,b=g.current?g.current.clientHeight+100:l?l.height+100:600,[C,P]=m.useState({x:l?Math.max(l.x,w-window.innerWidth):0,y:l?Math.min(l.y,window.innerHeight-b):0}),v=be.useRef(null),T=Jt(),A=Ms[r.getMonth()];m.useEffect(()=>{P({x:Math.max(l==null?void 0:l.x,w-window.innerWidth),y:Math.min(l==null?void 0:l.y,window.innerHeight-b)})},[l,w,b]),m.useEffect(()=>{const j=()=>{P({x:Math.max(l==null?void 0:l.x,w-window.innerWidth),y:Math.min(l==null?void 0:l.y,window.innerHeight-b)})};return window.addEventListener("resize",j),()=>{window.removeEventListener("resize",j)}},[l,w,b]),m.useEffect(()=>(g.current&&(y.current||(y.current=new ResizeObserver(()=>{o(j=>{g.current&&(j.viewState.yearlyLightSensorPanelRect||(j.viewState.yearlyLightSensorPanelRect=new cr(0,0,600,500)),j.viewState.yearlyLightSensorPanelRect.width=g.current.offsetWidth,j.viewState.yearlyLightSensorPanelRect.height=g.current.offsetHeight)})})),y.current.observe(g.current)),()=>{var j;(j=y.current)==null||j.disconnect()}),[]);const x=(j,L)=>{P({x:Math.max(L.x,w-window.innerWidth),y:Math.min(L.y,window.innerHeight-b)})},S=(j,L)=>{o(k=>{k.viewState.yearlyLightSensorPanelRect||(k.viewState.yearlyLightSensorPanelRect=new cr(0,0,600,500)),k.viewState.yearlyLightSensorPanelRect.x=Math.max(L.x,w-window.innerWidth),k.viewState.yearlyLightSensorPanelRect.y=Math.min(L.y,window.innerHeight-b)})},R=()=>{o(j=>{j.viewState.showYearlyLightSensorPanel=!1,e&&(j.actionInfo={name:"Close Yearly Light Sensor Graph",timestamp:new Date().getTime()})})},{t:M}=Vl(),D=M("word.Month",T),E=M("word.Radiation",T),W=i&&i[0]?Object.keys(i[0]).length===0:!0;return h.jsx(_i,{nodeRef:v,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:x,onStop:S,onMouseDown:()=>{o(j=>{j.selectedFloatingWindow="yearlyLightSensorPanel"})},children:h.jsx(ZEo,{ref:v,style:{zIndex:d==="yearlyLightSensorPanel"?Sc:9},children:h.jsxs(eFo,{ref:g,style:{opacity:n,width:(l?l.width:600)+"px",height:(l?l.height:500)+"px"},children:[h.jsxs(tFo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[M("sensorPanel.LightSensor",T)+": ",h.jsx("span",{style:{fontSize:"10px"},children:M("sensorPanel.WeatherDataFrom",T)+" "+t+" | "+r.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{R()},onMouseDown:()=>{R()},children:M("word.Close",T)})]}),c&&h.jsx(Tf,{type:vi.DaylightData,chartType:Ml.Area,dataSource:i.map(j=>({Month:j.Month,Daylight:j.Daylight})),height:100,dataKeyAxisX:"Month",labelX:D,labelY:M("word.Daylight",T),unitY:M("word.Hour",T),yMin:0,curveType:"linear",fractionDigits:1,referenceX:A}),u&&h.jsx(Act,{type:vi.ClearnessData,dataSource:i.map(j=>({Month:j.Month,Clearness:j.Clearness})),height:100,dataKeyAxisX:"Month",labelX:D,labelY:M("yearlyLightSensorPanel.SkyClearness",T),unitY:"%",yMin:0,yMax:100,fractionDigits:1,referenceX:A,color:"#66CDAA"}),f&&h.jsx(Tf,{type:vi.YearlyRadiationSensorData,chartType:Ml.Line,dataSource:i.map(({Daylight:j,Clearness:L,...k})=>k),labels:a,height:100,dataKeyAxisX:"Month",labelX:D,labelY:E,unitY:"kWh/m²/"+M("word.Day",T),yMin:0,curveType:"linear",fractionDigits:2,referenceX:A}),h.jsxs(en,{style:{alignSelf:"center",padding:"10px",direction:"ltr"},children:[h.jsxs(en,{children:[h.jsx(xc,{title:M("yearlyLightSensorPanel.ShowDaylightResults",T),checked:c,onChange:j=>{o(L=>{L.viewState.yearlyLightSensorPanelShowDaylight=j})}}),M("word.Daylight",T)]}),h.jsxs(en,{children:[h.jsx(xc,{title:M("yearlyLightSensorPanel.ShowSkyClearnessResults",T),checked:u,onChange:j=>{o(L=>{L.viewState.yearlyLightSensorPanelShowClearness=j})}}),M("yearlyLightSensorPanel.SkyClearness",T)]}),h.jsxs(en,{children:[h.jsx(xc,{title:M("yearlyLightSensorPanel.ShowAverageDailySolarRadiation",T),checked:f,onChange:j=>{p(j)}}),M("word.Radiation",T)]}),h.jsxs(en,{children:[h.jsx(lo,{type:"default",icon:W?h.jsx(Sh,{}):h.jsx(Hf,{}),title:M(W?"word.Run":"word.Update",T),onClick:()=>{if(s(z.Sensor)===0){hn(M("analysisManager.NoSensorForCollectingData",T));return}hn(M("message.SimulationStarted",T)),setTimeout(()=>{o(L=>{e&&(L.actionInfo={name:"Collect Yearly Data for Sensors",timestamp:new Date().getTime()})}),ht.getState().set(L=>{L.runYearlyLightSensor=!0,L.pauseYearlyLightSensor=!1,L.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:M("word.SaveAsImage",T),onClick:()=>{kd("line-graph-"+D+"-"+E,"yearly-light-sensor").then(()=>{hn(M("message.ScreenshotSaved",T)),e&&o(j=>{j.actionInfo={name:"Take Screenshot of Yearly Light Sensor Graph",timestamp:new Date().getTime()}})})}}),i&&i.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:M("word.SaveAsCsv",T),onClick:()=>{bh(i,"yearly-light-sensor.csv"),hn(M("message.CsvFileSaved",T)),e&&o(j=>{j.actionInfo={name:"Export Yearly Light Sensor Result as CSV",timestamp:new Date().getTime()}})}})]})]})]})})})});//! moment.js //! version : 2.29.4 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -var wct;function yr(){return wct.apply(null,arguments)}function oFo(t){wct=t}function q2(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function Fx(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function Nl(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function c6e(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(Nl(t,e))return!1;return!0}function Ep(t){return t===void 0}function uA(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function AU(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function vct(t,e){var n=[],o,r=t.length;for(o=0;o>>0,o;for(o=0;o0)for(n=0;n>>0,o;for(o=0;o0)for(n=0;n=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+o}var h6e=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,l_=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,kle={},OC={};function pi(t,e,n,o){var r=o;typeof o=="string"&&(r=function(){return this[o]()}),t&&(OC[t]=r),e&&(OC[e[0]]=function(){return Q9(r.apply(this,arguments),e[1],e[2])}),n&&(OC[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function sFo(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function cFo(t){var e=t.match(h6e),n,o;for(n=0,o=e.length;n=0&&l_.test(t);)t=t.replace(l_,o),l_.lastIndex=0,n-=1;return t}var uFo={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function dFo(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(h6e).map(function(o){return o==="MMMM"||o==="MM"||o==="DD"||o==="dddd"?o.slice(1):o}).join(""),this._longDateFormat[t])}var fFo="Invalid date";function hFo(){return this._invalidDate}var pFo="%d",gFo=/\d{1,2}/;function mFo(t){return this._ordinal.replace("%d",t)}var yFo={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function AFo(t,e,n,o){var r=this._relativeTime[n];return x3(r)?r(t,e,n,o):r.replace(/%d/i,t)}function wFo(t,e){var n=this._relativeTime[t>0?"future":"past"];return x3(n)?n(e):n.replace(/%s/i,e)}var ZE={};function Ph(t,e){var n=t.toLowerCase();ZE[n]=ZE[n+"s"]=ZE[e]=t}function yy(t){return typeof t=="string"?ZE[t]||ZE[t.toLowerCase()]:void 0}function p6e(t){var e={},n,o;for(o in t)Nl(t,o)&&(n=yy(o),n&&(e[n]=t[o]));return e}var Tct={};function Ch(t,e){Tct[t]=e}function vFo(t){var e=[],n;for(n in t)Nl(t,n)&&e.push({unit:n,priority:Tct[n]});return e.sort(function(o,r){return o.priority-r.priority}),e}function dte(t){return t%4===0&&t%100!==0||t%400===0}function Dm(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function Ua(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=Dm(e)),n}function NM(t,e){return function(n){return n!=null?(Pct(this,t,n),yr.updateOffset(this,e),this):vK(this,t)}}function vK(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function Pct(t,e,n){t.isValid()&&!isNaN(n)&&(e==="FullYear"&&dte(t.year())&&t.month()===1&&t.date()===29?(n=Ua(n),t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),yte(n,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function xFo(t){return t=yy(t),x3(this[t])?this[t]():this}function bFo(t,e){if(typeof t=="object"){t=p6e(t);var n=vFo(t),o,r=n.length;for(o=0;o68?1900:2e3)};var kct=NM("FullYear",!0);function BFo(){return dte(this.year())}function YFo(t,e,n,o,r,i,a){var l;return t<100&&t>=0?(l=new Date(t+400,e,n,o,r,i,a),isFinite(l.getFullYear())&&l.setFullYear(t)):l=new Date(t,e,n,o,r,i,a),l}function NL(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function bK(t,e,n){var o=7+e-n,r=(7+NL(t,0,o).getUTCDay()-e)%7;return-r+o-1}function Lct(t,e,n,o,r){var i=(7+n-o)%7,a=bK(t,o,r),l=1+7*(e-1)+i+a,s,c;return l<=0?(s=t-1,c=eF(s)+l):l>eF(t)?(s=t+1,c=l-eF(t)):(s=t,c=l),{year:s,dayOfYear:c}}function UL(t,e,n){var o=bK(t.year(),e,n),r=Math.floor((t.dayOfYear()-o-1)/7)+1,i,a;return r<1?(a=t.year()-1,i=r+O6(a,e,n)):r>O6(t.year(),e,n)?(i=r-O6(t.year(),e,n),a=t.year()+1):(a=t.year(),i=r),{week:i,year:a}}function O6(t,e,n){var o=bK(t,e,n),r=bK(t+1,e,n);return(eF(t)-o+r)/7}pi("w",["ww",2],"wo","week");pi("W",["WW",2],"Wo","isoWeek");Ph("week","w");Ph("isoWeek","W");Ch("week",5);Ch("isoWeek",5);Wr("w",Cc);Wr("ww",Cc,Yg);Wr("W",Cc);Wr("WW",Cc,Yg);xU(["w","ww","W","WW"],function(t,e,n,o){e[o.substr(0,1)]=Ua(t)});function OFo(t){return UL(t,this._week.dow,this._week.doy).week}var _Fo={dow:0,doy:6};function VFo(){return this._week.dow}function GFo(){return this._week.doy}function XFo(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function JFo(t){var e=UL(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}pi("d",0,"do","day");pi("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});pi("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});pi("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});pi("e",0,0,"weekday");pi("E",0,0,"isoWeekday");Ph("day","d");Ph("weekday","e");Ph("isoWeekday","E");Ch("day",11);Ch("weekday",11);Ch("isoWeekday",11);Wr("d",Cc);Wr("e",Cc);Wr("E",Cc);Wr("dd",function(t,e){return e.weekdaysMinRegex(t)});Wr("ddd",function(t,e){return e.weekdaysShortRegex(t)});Wr("dddd",function(t,e){return e.weekdaysRegex(t)});xU(["dd","ddd","dddd"],function(t,e,n,o){var r=n._locale.weekdaysParse(t,o,n._strict);r!=null?e.d=r:wa(n).invalidWeekday=t});xU(["d","e","E"],function(t,e,n,o){e[o]=Ua(t)});function KFo(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function qFo(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function y6e(t,e){return t.slice(e,7).concat(t.slice(0,e))}var $Fo="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Wct="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),QFo="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ZFo=vU,eko=vU,tko=vU;function nko(t,e){var n=q2(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?y6e(n,this._week.dow):t?n[t.day()]:n}function oko(t){return t===!0?y6e(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function rko(t){return t===!0?y6e(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function iko(t,e,n){var o,r,i,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)i=v3([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(i,"").toLocaleLowerCase();return n?e==="dddd"?(r=F0.call(this._weekdaysParse,a),r!==-1?r:null):e==="ddd"?(r=F0.call(this._shortWeekdaysParse,a),r!==-1?r:null):(r=F0.call(this._minWeekdaysParse,a),r!==-1?r:null):e==="dddd"?(r=F0.call(this._weekdaysParse,a),r!==-1||(r=F0.call(this._shortWeekdaysParse,a),r!==-1)?r:(r=F0.call(this._minWeekdaysParse,a),r!==-1?r:null)):e==="ddd"?(r=F0.call(this._shortWeekdaysParse,a),r!==-1||(r=F0.call(this._weekdaysParse,a),r!==-1)?r:(r=F0.call(this._minWeekdaysParse,a),r!==-1?r:null)):(r=F0.call(this._minWeekdaysParse,a),r!==-1||(r=F0.call(this._weekdaysParse,a),r!==-1)?r:(r=F0.call(this._shortWeekdaysParse,a),r!==-1?r:null))}function ako(t,e,n){var o,r,i;if(this._weekdaysParseExact)return iko.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(r=v3([2e3,1]).day(o),n&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[o]||(i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[o]=new RegExp(i.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[o].test(t))return o;if(n&&e==="ddd"&&this._shortWeekdaysParse[o].test(t))return o;if(n&&e==="dd"&&this._minWeekdaysParse[o].test(t))return o;if(!n&&this._weekdaysParse[o].test(t))return o}}function lko(t){if(!this.isValid())return t!=null?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return t!=null?(t=KFo(t,this.localeData()),this.add(t-e,"d")):e}function sko(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function cko(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=qFo(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function uko(t){return this._weekdaysParseExact?(Nl(this,"_weekdaysRegex")||A6e.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(Nl(this,"_weekdaysRegex")||(this._weekdaysRegex=ZFo),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function dko(t){return this._weekdaysParseExact?(Nl(this,"_weekdaysRegex")||A6e.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Nl(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=eko),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function fko(t){return this._weekdaysParseExact?(Nl(this,"_weekdaysRegex")||A6e.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Nl(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tko),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function A6e(){function t(u,d){return d.length-u.length}var e=[],n=[],o=[],r=[],i,a,l,s,c;for(i=0;i<7;i++)a=v3([2e3,1]).day(i),l=ug(this.weekdaysMin(a,"")),s=ug(this.weekdaysShort(a,"")),c=ug(this.weekdays(a,"")),e.push(l),n.push(s),o.push(c),r.push(l),r.push(s),r.push(c);e.sort(t),n.sort(t),o.sort(t),r.sort(t),this._weekdaysRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function w6e(){return this.hours()%12||12}function hko(){return this.hours()||24}pi("H",["HH",2],0,"hour");pi("h",["hh",2],0,w6e);pi("k",["kk",2],0,hko);pi("hmm",0,0,function(){return""+w6e.apply(this)+Q9(this.minutes(),2)});pi("hmmss",0,0,function(){return""+w6e.apply(this)+Q9(this.minutes(),2)+Q9(this.seconds(),2)});pi("Hmm",0,0,function(){return""+this.hours()+Q9(this.minutes(),2)});pi("Hmmss",0,0,function(){return""+this.hours()+Q9(this.minutes(),2)+Q9(this.seconds(),2)});function Nct(t,e){pi(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}Nct("a",!0);Nct("A",!1);Ph("hour","h");Ch("hour",13);function Uct(t,e){return e._meridiemParse}Wr("a",Uct);Wr("A",Uct);Wr("H",Cc);Wr("h",Cc);Wr("k",Cc);Wr("HH",Cc,Yg);Wr("hh",Cc,Yg);Wr("kk",Cc,Yg);Wr("hmm",Hct);Wr("hmmss",Mct);Wr("Hmm",Hct);Wr("Hmmss",Mct);Ts(["H","HH"],Uu);Ts(["k","kk"],function(t,e,n){var o=Ua(t);e[Uu]=o===24?0:o});Ts(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t});Ts(["h","hh"],function(t,e,n){e[Uu]=Ua(t),wa(n).bigHour=!0});Ts("hmm",function(t,e,n){var o=t.length-2;e[Uu]=Ua(t.substr(0,o)),e[M2]=Ua(t.substr(o)),wa(n).bigHour=!0});Ts("hmmss",function(t,e,n){var o=t.length-4,r=t.length-2;e[Uu]=Ua(t.substr(0,o)),e[M2]=Ua(t.substr(o,2)),e[z6]=Ua(t.substr(r)),wa(n).bigHour=!0});Ts("Hmm",function(t,e,n){var o=t.length-2;e[Uu]=Ua(t.substr(0,o)),e[M2]=Ua(t.substr(o))});Ts("Hmmss",function(t,e,n){var o=t.length-4,r=t.length-2;e[Uu]=Ua(t.substr(0,o)),e[M2]=Ua(t.substr(o,2)),e[z6]=Ua(t.substr(r))});function pko(t){return(t+"").toLowerCase().charAt(0)==="p"}var gko=/[ap]\.?m?\.?/i,mko=NM("Hours",!0);function yko(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var jct={calendar:aFo,longDateFormat:uFo,invalidDate:fFo,ordinal:pFo,dayOfMonthOrdinalParse:gFo,relativeTime:yFo,months:zFo,monthsShort:Ict,week:_Fo,weekdays:$Fo,weekdaysMin:QFo,weekdaysShort:Wct,meridiemParse:gko},Lc={},yD={},jL;function Ako(t,e){var n,o=Math.min(t.length,e.length);for(n=0;n0;){if(r=Ate(i.slice(0,n).join("-")),r)return r;if(o&&o.length>=n&&Ako(i,o)>=n-1)break;n--}e++}return jL}function vko(t){return t.match("^[^/\\\\]*$")!=null}function Ate(t){var e=null,n;if(Lc[t]===void 0&&typeof ph<"u"&&ph&&ph.exports&&vko(t))try{e=jL._abbr,n=require,n("./locale/"+t),J8(e)}catch{Lc[t]=null}return Lc[t]}function J8(t,e){var n;return t&&(Ep(e)?n=HA(t):n=v6e(t,e),n?jL=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),jL._abbr}function v6e(t,e){if(e!==null){var n,o=jct;if(e.abbr=t,Lc[t]!=null)bct("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),o=Lc[t]._config;else if(e.parentLocale!=null)if(Lc[e.parentLocale]!=null)o=Lc[e.parentLocale]._config;else if(n=Ate(e.parentLocale),n!=null)o=n._config;else return yD[e.parentLocale]||(yD[e.parentLocale]=[]),yD[e.parentLocale].push({name:t,config:e}),null;return Lc[t]=new f6e(dpe(o,e)),yD[t]&&yD[t].forEach(function(r){v6e(r.name,r.config)}),J8(t),Lc[t]}else return delete Lc[t],null}function xko(t,e){if(e!=null){var n,o,r=jct;Lc[t]!=null&&Lc[t].parentLocale!=null?Lc[t].set(dpe(Lc[t]._config,e)):(o=Ate(t),o!=null&&(r=o._config),e=dpe(r,e),o==null&&(e.abbr=t),n=new f6e(e),n.parentLocale=Lc[t],Lc[t]=n),J8(t)}else Lc[t]!=null&&(Lc[t].parentLocale!=null?(Lc[t]=Lc[t].parentLocale,t===J8()&&J8(t)):Lc[t]!=null&&delete Lc[t]);return Lc[t]}function HA(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return jL;if(!q2(t)){if(e=Ate(t),e)return e;t=[t]}return wko(t)}function bko(){return fpe(Lc)}function x6e(t){var e,n=t._a;return n&&wa(t).overflow===-2&&(e=n[I6]<0||n[I6]>11?I6:n[h9]<1||n[h9]>yte(n[mh],n[I6])?h9:n[Uu]<0||n[Uu]>24||n[Uu]===24&&(n[M2]!==0||n[z6]!==0||n[nx]!==0)?Uu:n[M2]<0||n[M2]>59?M2:n[z6]<0||n[z6]>59?z6:n[nx]<0||n[nx]>999?nx:-1,wa(t)._overflowDayOfYear&&(eh9)&&(e=h9),wa(t)._overflowWeeks&&e===-1&&(e=HFo),wa(t)._overflowWeekday&&e===-1&&(e=MFo),wa(t).overflow=e),t}var Sko=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Tko=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Pko=/Z|[+-]\d\d(?::?\d\d)?/,s_=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Lle=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Cko=/^\/?Date\((-?\d+)/i,Rko=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Hko={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Bct(t){var e,n,o=t._i,r=Sko.exec(o)||Tko.exec(o),i,a,l,s,c=s_.length,u=Lle.length;if(r){for(wa(t).iso=!0,e=0,n=c;eeF(a)||t._dayOfYear===0)&&(wa(t)._overflowDayOfYear=!0),n=NL(a,0,t._dayOfYear),t._a[I6]=n.getUTCMonth(),t._a[h9]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=o[e]=r[e];for(;e<7;e++)t._a[e]=o[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[Uu]===24&&t._a[M2]===0&&t._a[z6]===0&&t._a[nx]===0&&(t._nextDay=!0,t._a[Uu]=0),t._d=(t._useUTC?NL:YFo).apply(null,o),i=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Uu]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==i&&(wa(t).weekdayMismatch=!0)}}function Lko(t){var e,n,o,r,i,a,l,s,c;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(i=1,a=4,n=IP(e.GG,t._a[mh],UL(bc(),1,4).year),o=IP(e.W,1),r=IP(e.E,1),(r<1||r>7)&&(s=!0)):(i=t._locale._week.dow,a=t._locale._week.doy,c=UL(bc(),i,a),n=IP(e.gg,t._a[mh],c.year),o=IP(e.w,c.week),e.d!=null?(r=e.d,(r<0||r>6)&&(s=!0)):e.e!=null?(r=e.e+i,(e.e<0||e.e>6)&&(s=!0)):r=i),o<1||o>O6(n,i,a)?wa(t)._overflowWeeks=!0:s!=null?wa(t)._overflowWeekday=!0:(l=Lct(n,o,r,i,a),t._a[mh]=l.year,t._dayOfYear=l.dayOfYear)}yr.ISO_8601=function(){};yr.RFC_2822=function(){};function S6e(t){if(t._f===yr.ISO_8601){Bct(t);return}if(t._f===yr.RFC_2822){Yct(t);return}t._a=[],wa(t).empty=!0;var e=""+t._i,n,o,r,i,a,l=e.length,s=0,c,u;for(r=Sct(t._f,t._locale).match(h6e)||[],u=r.length,n=0;n0&&wa(t).unusedInput.push(a),e=e.slice(e.indexOf(o)+o.length),s+=o.length),OC[i]?(o?wa(t).empty=!1:wa(t).unusedTokens.push(i),RFo(i,o,t)):t._strict&&!o&&wa(t).unusedTokens.push(i);wa(t).charsLeftOver=l-s,e.length>0&&wa(t).unusedInput.push(e),t._a[Uu]<=12&&wa(t).bigHour===!0&&t._a[Uu]>0&&(wa(t).bigHour=void 0),wa(t).parsedDateParts=t._a.slice(0),wa(t).meridiem=t._meridiem,t._a[Uu]=Wko(t._locale,t._a[Uu],t._meridiem),c=wa(t).era,c!==null&&(t._a[mh]=t._locale.erasConvertYear(c,t._a[mh])),b6e(t),x6e(t)}function Wko(t,e,n){var o;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(o=t.isPM(n),o&&e<12&&(e+=12),!o&&e===12&&(e=0)),e)}function Nko(t){var e,n,o,r,i,a,l=!1,s=t._f.length;if(s===0){wa(t).invalidFormat=!0,t._d=new Date(NaN);return}for(r=0;rthis?this:t:ute()});function Vct(t,e){var n,o;if(e.length===1&&q2(e[0])&&(e=e[0]),!e.length)return bc();for(n=e[0],o=1;othis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function iLo(){if(!Ep(this._isDSTShifted))return this._isDSTShifted;var t={},e;return d6e(t,this),t=Oct(t),t._a?(e=t._isUTC?v3(t._a):bc(t._a),this._isDSTShifted=this.isValid()&&qko(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function aLo(){return this.isValid()?!this._isUTC:!1}function lLo(){return this.isValid()?this._isUTC:!1}function Xct(){return this.isValid()?this._isUTC&&this._offset===0:!1}var sLo=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,cLo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function h5(t,e){var n=t,o=null,r,i,a;return yV(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:uA(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(o=sLo.exec(t))?(r=o[1]==="-"?-1:1,n={y:0,d:Ua(o[h9])*r,h:Ua(o[Uu])*r,m:Ua(o[M2])*r,s:Ua(o[z6])*r,ms:Ua(ppe(o[nx]*1e3))*r}):(o=cLo.exec(t))?(r=o[1]==="-"?-1:1,n={y:ov(o[2],r),M:ov(o[3],r),w:ov(o[4],r),d:ov(o[5],r),h:ov(o[6],r),m:ov(o[7],r),s:ov(o[8],r)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(a=uLo(bc(n.from),bc(n.to)),n={},n.ms=a.milliseconds,n.M=a.months),i=new wte(n),yV(t)&&Nl(t,"_locale")&&(i._locale=t._locale),yV(t)&&Nl(t,"_isValid")&&(i._isValid=t._isValid),i}h5.fn=wte.prototype;h5.invalid=Kko;function ov(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function DFe(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function uLo(t,e){var n;return t.isValid()&&e.isValid()?(e=P6e(e,t),t.isBefore(e)?n=DFe(t,e):(n=DFe(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Jct(t,e){return function(n,o){var r,i;return o!==null&&!isNaN(+o)&&(bct(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=o,o=i),r=h5(n,o),Kct(this,r,t),this}}function Kct(t,e,n,o){var r=e._milliseconds,i=ppe(e._days),a=ppe(e._months);t.isValid()&&(o=o??!0,a&&Dct(t,vK(t,"Month")+a*n),i&&Pct(t,"Date",vK(t,"Date")+i*n),r&&t._d.setTime(t._d.valueOf()+r*n),o&&yr.updateOffset(t,i||a))}var dLo=Jct(1,"add"),fLo=Jct(-1,"subtract");function qct(t){return typeof t=="string"||t instanceof String}function hLo(t){return $2(t)||AU(t)||qct(t)||uA(t)||gLo(t)||pLo(t)||t===null||t===void 0}function pLo(t){var e=Fx(t)&&!c6e(t),n=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],r,i,a=o.length;for(r=0;rn.valueOf():n.valueOf()9999?mV(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):x3(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",mV(n,"Z")):mV(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function MLo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,o,r,i;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',o=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",i=e+'[")]',this.format(n+o+r+i)}function ILo(t){t||(t=this.isUtc()?yr.defaultFormatUtc:yr.defaultFormat);var e=mV(this,t);return this.localeData().postformat(e)}function zLo(t,e){return this.isValid()&&($2(t)&&t.isValid()||bc(t).isValid())?h5({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function DLo(t){return this.from(bc(),t)}function ELo(t,e){return this.isValid()&&($2(t)&&t.isValid()||bc(t).isValid())?h5({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function FLo(t){return this.to(bc(),t)}function $ct(t){var e;return t===void 0?this._locale._abbr:(e=HA(t),e!=null&&(this._locale=e),this)}var Qct=my("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function Zct(){return this._locale}var SK=1e3,_C=60*SK,TK=60*_C,e0t=(365*400+97)*24*TK;function VC(t,e){return(t%e+e)%e}function t0t(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-e0t:new Date(t,e,n).valueOf()}function n0t(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-e0t:Date.UTC(t,e,n)}function kLo(t){var e,n;if(t=yy(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?n0t:t0t,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=VC(e+(this._isUTC?0:this.utcOffset()*_C),TK);break;case"minute":e=this._d.valueOf(),e-=VC(e,_C);break;case"second":e=this._d.valueOf(),e-=VC(e,SK);break}return this._d.setTime(e),yr.updateOffset(this,!0),this}function LLo(t){var e,n;if(t=yy(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?n0t:t0t,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=TK-VC(e+(this._isUTC?0:this.utcOffset()*_C),TK)-1;break;case"minute":e=this._d.valueOf(),e+=_C-VC(e,_C)-1;break;case"second":e=this._d.valueOf(),e+=SK-VC(e,SK)-1;break}return this._d.setTime(e),yr.updateOffset(this,!0),this}function WLo(){return this._d.valueOf()-(this._offset||0)*6e4}function NLo(){return Math.floor(this.valueOf()/1e3)}function ULo(){return new Date(this.valueOf())}function jLo(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function BLo(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function YLo(){return this.isValid()?this.toISOString():null}function OLo(){return u6e(this)}function _Lo(){return R8({},wa(this))}function VLo(){return wa(this).overflow}function GLo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}pi("N",0,0,"eraAbbr");pi("NN",0,0,"eraAbbr");pi("NNN",0,0,"eraAbbr");pi("NNNN",0,0,"eraName");pi("NNNNN",0,0,"eraNarrow");pi("y",["y",1],"yo","eraYear");pi("y",["yy",2],0,"eraYear");pi("y",["yyy",3],0,"eraYear");pi("y",["yyyy",4],0,"eraYear");Wr("N",C6e);Wr("NN",C6e);Wr("NNN",C6e);Wr("NNNN",oWo);Wr("NNNNN",rWo);Ts(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,o){var r=n._locale.erasParse(t,o,n._strict);r?wa(n).era=r:wa(n).invalidEra=t});Wr("y",UM);Wr("yy",UM);Wr("yyy",UM);Wr("yyyy",UM);Wr("yo",iWo);Ts(["y","yy","yyy","yyyy"],mh);Ts(["yo"],function(t,e,n,o){var r;n._locale._eraYearOrdinalRegex&&(r=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[mh]=n._locale.eraYearOrdinalParse(t,r):e[mh]=parseInt(t,10)});function XLo(t,e){var n,o,r,i=this._eras||HA("en")._eras;for(n=0,o=i.length;n=0)return i[o]}function KLo(t,e){var n=t.since<=t.until?1:-1;return e===void 0?yr(t.since).year():yr(t.since).year()+(e-t.offset)*n}function qLo(){var t,e,n,o=this.localeData().eras();for(t=0,e=o.length;ti&&(e=i),fWo.call(this,t,e,n,o,r))}function fWo(t,e,n,o,r){var i=Lct(t,e,n,o,r),a=NL(i.year,0,i.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}pi("Q",0,"Qo","quarter");Ph("quarter","Q");Ch("quarter",7);Wr("Q",Cct);Ts("Q",function(t,e){e[I6]=(Ua(t)-1)*3});function hWo(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}pi("D",["DD",2],"Do","date");Ph("date","D");Ch("date",9);Wr("D",Cc);Wr("DD",Cc,Yg);Wr("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});Ts(["D","DD"],h9);Ts("Do",function(t,e){e[h9]=Ua(t.match(Cc)[0])});var r0t=NM("Date",!0);pi("DDD",["DDDD",3],"DDDo","dayOfYear");Ph("dayOfYear","DDD");Ch("dayOfYear",4);Wr("DDD",hte);Wr("DDDD",Rct);Ts(["DDD","DDDD"],function(t,e,n){n._dayOfYear=Ua(t)});function pWo(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}pi("m",["mm",2],0,"minute");Ph("minute","m");Ch("minute",14);Wr("m",Cc);Wr("mm",Cc,Yg);Ts(["m","mm"],M2);var gWo=NM("Minutes",!1);pi("s",["ss",2],0,"second");Ph("second","s");Ch("second",15);Wr("s",Cc);Wr("ss",Cc,Yg);Ts(["s","ss"],z6);var mWo=NM("Seconds",!1);pi("S",0,0,function(){return~~(this.millisecond()/100)});pi(0,["SS",2],0,function(){return~~(this.millisecond()/10)});pi(0,["SSS",3],0,"millisecond");pi(0,["SSSS",4],0,function(){return this.millisecond()*10});pi(0,["SSSSS",5],0,function(){return this.millisecond()*100});pi(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});pi(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});pi(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});pi(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});Ph("millisecond","ms");Ch("millisecond",16);Wr("S",hte,Cct);Wr("SS",hte,Yg);Wr("SSS",hte,Rct);var H8,i0t;for(H8="SSSS";H8.length<=9;H8+="S")Wr(H8,UM);function yWo(t,e){e[nx]=Ua(("0."+t)*1e3)}for(H8="S";H8.length<=9;H8+="S")Ts(H8,yWo);i0t=NM("Milliseconds",!1);pi("z",0,0,"zoneAbbr");pi("zz",0,0,"zoneName");function AWo(){return this._isUTC?"UTC":""}function wWo(){return this._isUTC?"Coordinated Universal Time":""}var qo=wU.prototype;qo.add=dLo;qo.calendar=ALo;qo.clone=wLo;qo.diff=CLo;qo.endOf=LLo;qo.format=ILo;qo.from=zLo;qo.fromNow=DLo;qo.to=ELo;qo.toNow=FLo;qo.get=xFo;qo.invalidAt=VLo;qo.isAfter=vLo;qo.isBefore=xLo;qo.isBetween=bLo;qo.isSame=SLo;qo.isSameOrAfter=TLo;qo.isSameOrBefore=PLo;qo.isValid=OLo;qo.lang=Qct;qo.locale=$ct;qo.localeData=Zct;qo.max=Oko;qo.min=Yko;qo.parsingFlags=_Lo;qo.set=bFo;qo.startOf=kLo;qo.subtract=fLo;qo.toArray=jLo;qo.toObject=BLo;qo.toDate=ULo;qo.toISOString=HLo;qo.inspect=MLo;typeof Symbol<"u"&&Symbol.for!=null&&(qo[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});qo.toJSON=YLo;qo.toString=RLo;qo.unix=NLo;qo.valueOf=WLo;qo.creationData=GLo;qo.eraName=qLo;qo.eraNarrow=$Lo;qo.eraAbbr=QLo;qo.eraYear=ZLo;qo.year=kct;qo.isLeapYear=BFo;qo.weekYear=aWo;qo.isoWeekYear=lWo;qo.quarter=qo.quarters=hWo;qo.month=Ect;qo.daysInMonth=NFo;qo.week=qo.weeks=XFo;qo.isoWeek=qo.isoWeeks=JFo;qo.weeksInYear=uWo;qo.weeksInWeekYear=dWo;qo.isoWeeksInYear=sWo;qo.isoWeeksInISOWeekYear=cWo;qo.date=r0t;qo.day=qo.days=lko;qo.weekday=sko;qo.isoWeekday=cko;qo.dayOfYear=pWo;qo.hour=qo.hours=mko;qo.minute=qo.minutes=gWo;qo.second=qo.seconds=mWo;qo.millisecond=qo.milliseconds=i0t;qo.utcOffset=Qko;qo.utc=eLo;qo.local=tLo;qo.parseZone=nLo;qo.hasAlignedHourOffset=oLo;qo.isDST=rLo;qo.isLocal=aLo;qo.isUtcOffset=lLo;qo.isUtc=Xct;qo.isUTC=Xct;qo.zoneAbbr=AWo;qo.zoneName=wWo;qo.dates=my("dates accessor is deprecated. Use date instead.",r0t);qo.months=my("months accessor is deprecated. Use month instead",Ect);qo.years=my("years accessor is deprecated. Use year instead",kct);qo.zone=my("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Zko);qo.isDSTShifted=my("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",iLo);function vWo(t){return bc(t*1e3)}function xWo(){return bc.apply(null,arguments).parseZone()}function a0t(t){return t}var jl=f6e.prototype;jl.calendar=lFo;jl.longDateFormat=dFo;jl.invalidDate=hFo;jl.ordinal=mFo;jl.preparse=a0t;jl.postformat=a0t;jl.relativeTime=AFo;jl.pastFuture=wFo;jl.set=iFo;jl.eras=XLo;jl.erasParse=JLo;jl.erasConvertYear=KLo;jl.erasAbbrRegex=tWo;jl.erasNameRegex=eWo;jl.erasNarrowRegex=nWo;jl.months=FFo;jl.monthsShort=kFo;jl.monthsParse=WFo;jl.monthsRegex=jFo;jl.monthsShortRegex=UFo;jl.week=OFo;jl.firstDayOfYear=GFo;jl.firstDayOfWeek=VFo;jl.weekdays=nko;jl.weekdaysMin=rko;jl.weekdaysShort=oko;jl.weekdaysParse=ako;jl.weekdaysRegex=uko;jl.weekdaysShortRegex=dko;jl.weekdaysMinRegex=fko;jl.isPM=pko;jl.meridiem=yko;function PK(t,e,n,o){var r=HA(),i=v3().set(o,e);return r[n](i,t)}function l0t(t,e,n){if(uA(t)&&(e=t,t=void 0),t=t||"",e!=null)return PK(t,e,n,"month");var o,r=[];for(o=0;o<12;o++)r[o]=PK(t,o,n,"month");return r}function H6e(t,e,n,o){typeof t=="boolean"?(uA(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,uA(e)&&(n=e,e=void 0),e=e||"");var r=HA(),i=t?r._week.dow:0,a,l=[];if(n!=null)return PK(e,(n+i)%7,o,"day");for(a=0;a<7;a++)l[a]=PK(e,(a+i)%7,o,"day");return l}function bWo(t,e){return l0t(t,e,"months")}function SWo(t,e){return l0t(t,e,"monthsShort")}function TWo(t,e,n){return H6e(t,e,n,"weekdays")}function PWo(t,e,n){return H6e(t,e,n,"weekdaysShort")}function CWo(t,e,n){return H6e(t,e,n,"weekdaysMin")}J8("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=Ua(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}});yr.lang=my("moment.lang is deprecated. Use moment.locale instead.",J8);yr.langData=my("moment.langData is deprecated. Use moment.localeData instead.",HA);var c6=Math.abs;function RWo(){var t=this._data;return this._milliseconds=c6(this._milliseconds),this._days=c6(this._days),this._months=c6(this._months),t.milliseconds=c6(t.milliseconds),t.seconds=c6(t.seconds),t.minutes=c6(t.minutes),t.hours=c6(t.hours),t.months=c6(t.months),t.years=c6(t.years),this}function s0t(t,e,n,o){var r=h5(e,n);return t._milliseconds+=o*r._milliseconds,t._days+=o*r._days,t._months+=o*r._months,t._bubble()}function HWo(t,e){return s0t(this,t,e,1)}function MWo(t,e){return s0t(this,t,e,-1)}function EFe(t){return t<0?Math.floor(t):Math.ceil(t)}function IWo(){var t=this._milliseconds,e=this._days,n=this._months,o=this._data,r,i,a,l,s;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=EFe(mpe(n)+e)*864e5,e=0,n=0),o.milliseconds=t%1e3,r=Dm(t/1e3),o.seconds=r%60,i=Dm(r/60),o.minutes=i%60,a=Dm(i/60),o.hours=a%24,e+=Dm(a/24),s=Dm(c0t(e)),n+=s,e-=EFe(mpe(s)),l=Dm(n/12),n%=12,o.days=e,o.months=n,o.years=l,this}function c0t(t){return t*4800/146097}function mpe(t){return t*146097/4800}function zWo(t){if(!this.isValid())return NaN;var e,n,o=this._milliseconds;if(t=yy(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+o/864e5,n=this._months+c0t(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(mpe(this._months)),t){case"week":return e/7+o/6048e5;case"day":return e+o/864e5;case"hour":return e*24+o/36e5;case"minute":return e*1440+o/6e4;case"second":return e*86400+o/1e3;case"millisecond":return Math.floor(e*864e5)+o;default:throw new Error("Unknown unit "+t)}}function DWo(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Ua(this._months/12)*31536e6:NaN}function MA(t){return function(){return this.as(t)}}var EWo=MA("ms"),FWo=MA("s"),kWo=MA("m"),LWo=MA("h"),WWo=MA("d"),NWo=MA("w"),UWo=MA("M"),jWo=MA("Q"),BWo=MA("y");function YWo(){return h5(this)}function OWo(t){return t=yy(t),this.isValid()?this[t+"s"]():NaN}function hS(t){return function(){return this.isValid()?this._data[t]:NaN}}var _Wo=hS("milliseconds"),VWo=hS("seconds"),GWo=hS("minutes"),XWo=hS("hours"),JWo=hS("days"),KWo=hS("months"),qWo=hS("years");function $Wo(){return Dm(this.days()/7)}var p6=Math.round,gC={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function QWo(t,e,n,o,r){return r.relativeTime(e||1,!!n,t,o)}function ZWo(t,e,n,o){var r=h5(t).abs(),i=p6(r.as("s")),a=p6(r.as("m")),l=p6(r.as("h")),s=p6(r.as("d")),c=p6(r.as("M")),u=p6(r.as("w")),d=p6(r.as("y")),f=i<=n.ss&&["s",i]||i0,f[4]=o,QWo.apply(null,f)}function eNo(t){return t===void 0?p6:typeof t=="function"?(p6=t,!0):!1}function tNo(t,e){return gC[t]===void 0?!1:e===void 0?gC[t]:(gC[t]=e,t==="s"&&(gC.ss=e-1),!0)}function nNo(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,o=gC,r,i;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(o=Object.assign({},gC,e),e.s!=null&&e.ss==null&&(o.ss=e.s-1)),r=this.localeData(),i=ZWo(this,!n,o,r),n&&(i=r.pastFuture(+this,i)),r.postformat(i)}var Wle=Math.abs;function tP(t){return(t>0)-(t<0)||+t}function xte(){if(!this.isValid())return this.localeData().invalidDate();var t=Wle(this._milliseconds)/1e3,e=Wle(this._days),n=Wle(this._months),o,r,i,a,l=this.asSeconds(),s,c,u,d;return l?(o=Dm(t/60),r=Dm(o/60),t%=60,o%=60,i=Dm(n/12),n%=12,a=t?t.toFixed(3).replace(/\.?0+$/,""):"",s=l<0?"-":"",c=tP(this._months)!==tP(l)?"-":"",u=tP(this._days)!==tP(l)?"-":"",d=tP(this._milliseconds)!==tP(l)?"-":"",s+"P"+(i?c+i+"Y":"")+(n?c+n+"M":"")+(e?u+e+"D":"")+(r||o||t?"T":"")+(r?d+r+"H":"")+(o?d+o+"M":"")+(t?d+a+"S":"")):"P0D"}var vl=wte.prototype;vl.isValid=Jko;vl.abs=RWo;vl.add=HWo;vl.subtract=MWo;vl.as=zWo;vl.asMilliseconds=EWo;vl.asSeconds=FWo;vl.asMinutes=kWo;vl.asHours=LWo;vl.asDays=WWo;vl.asWeeks=NWo;vl.asMonths=UWo;vl.asQuarters=jWo;vl.asYears=BWo;vl.valueOf=DWo;vl._bubble=IWo;vl.clone=YWo;vl.get=OWo;vl.milliseconds=_Wo;vl.seconds=VWo;vl.minutes=GWo;vl.hours=XWo;vl.days=JWo;vl.weeks=$Wo;vl.months=KWo;vl.years=qWo;vl.humanize=nNo;vl.toISOString=xte;vl.toString=xte;vl.toJSON=xte;vl.locale=$ct;vl.localeData=Zct;vl.toIsoString=my("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",xte);vl.lang=Qct;pi("X",0,0,"unix");pi("x",0,0,"valueOf");Wr("x",gte);Wr("X",TFo);Ts("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)});Ts("x",function(t,e,n){n._d=new Date(Ua(t))});//! moment.js -yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3;yr.unix=vWo;yr.months=bWo;yr.isDate=AU;yr.locale=J8;yr.invalid=ute;yr.duration=h5;yr.isMoment=$2;yr.weekdays=TWo;yr.parseZone=xWo;yr.localeData=HA;yr.isDuration=yV;yr.monthsShort=SWo;yr.weekdaysMin=CWo;yr.defineLocale=v6e;yr.updateLocale=xko;yr.locales=bko;yr.weekdaysShort=PWo;yr.normalizeUnits=yy;yr.relativeTimeRounding=eNo;yr.relativeTimeThreshold=tNo;yr.calendarFormat=yLo;yr.prototype=qo;yr.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const oNo=Ro.div` +`+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var zFe={};function bct(t,e){yr.deprecationHandler!=null&&yr.deprecationHandler(t,e),zFe[t]||(xct(e),zFe[t]=!0)}yr.suppressDeprecationWarnings=!1;yr.deprecationHandler=null;function x3(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function iFo(t){var e,n;for(n in t)Nl(t,n)&&(e=t[n],x3(e)?this[n]=e:this["_"+n]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function dpe(t,e){var n=R8({},t),o;for(o in e)Nl(e,o)&&(Fx(t[o])&&Fx(e[o])?(n[o]={},R8(n[o],t[o]),R8(n[o],e[o])):e[o]!=null?n[o]=e[o]:delete n[o]);for(o in t)Nl(t,o)&&!Nl(e,o)&&Fx(t[o])&&(n[o]=R8({},n[o]));return n}function h6e(t){t!=null&&this.set(t)}var fpe;Object.keys?fpe=Object.keys:fpe=function(t){var e,n=[];for(e in t)Nl(t,e)&&n.push(e);return n};var aFo={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function lFo(t,e,n){var o=this._calendar[t]||this._calendar.sameElse;return x3(o)?o.call(e,n):o}function Q9(t,e,n){var o=""+Math.abs(t),r=e-o.length,i=t>=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+o}var p6e=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,s_=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,kle={},OC={};function pi(t,e,n,o){var r=o;typeof o=="string"&&(r=function(){return this[o]()}),t&&(OC[t]=r),e&&(OC[e[0]]=function(){return Q9(r.apply(this,arguments),e[1],e[2])}),n&&(OC[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function sFo(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function cFo(t){var e=t.match(p6e),n,o;for(n=0,o=e.length;n=0&&s_.test(t);)t=t.replace(s_,o),s_.lastIndex=0,n-=1;return t}var uFo={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function dFo(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(p6e).map(function(o){return o==="MMMM"||o==="MM"||o==="DD"||o==="dddd"?o.slice(1):o}).join(""),this._longDateFormat[t])}var fFo="Invalid date";function hFo(){return this._invalidDate}var pFo="%d",gFo=/\d{1,2}/;function mFo(t){return this._ordinal.replace("%d",t)}var yFo={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function AFo(t,e,n,o){var r=this._relativeTime[n];return x3(r)?r(t,e,n,o):r.replace(/%d/i,t)}function wFo(t,e){var n=this._relativeTime[t>0?"future":"past"];return x3(n)?n(e):n.replace(/%s/i,e)}var ZE={};function Ph(t,e){var n=t.toLowerCase();ZE[n]=ZE[n+"s"]=ZE[e]=t}function yy(t){return typeof t=="string"?ZE[t]||ZE[t.toLowerCase()]:void 0}function g6e(t){var e={},n,o;for(o in t)Nl(t,o)&&(n=yy(o),n&&(e[n]=t[o]));return e}var Tct={};function Ch(t,e){Tct[t]=e}function vFo(t){var e=[],n;for(n in t)Nl(t,n)&&e.push({unit:n,priority:Tct[n]});return e.sort(function(o,r){return o.priority-r.priority}),e}function dte(t){return t%4===0&&t%100!==0||t%400===0}function Dm(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function Ua(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=Dm(e)),n}function NM(t,e){return function(n){return n!=null?(Pct(this,t,n),yr.updateOffset(this,e),this):xK(this,t)}}function xK(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function Pct(t,e,n){t.isValid()&&!isNaN(n)&&(e==="FullYear"&&dte(t.year())&&t.month()===1&&t.date()===29?(n=Ua(n),t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),yte(n,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function xFo(t){return t=yy(t),x3(this[t])?this[t]():this}function bFo(t,e){if(typeof t=="object"){t=g6e(t);var n=vFo(t),o,r=n.length;for(o=0;o68?1900:2e3)};var kct=NM("FullYear",!0);function BFo(){return dte(this.year())}function YFo(t,e,n,o,r,i,a){var l;return t<100&&t>=0?(l=new Date(t+400,e,n,o,r,i,a),isFinite(l.getFullYear())&&l.setFullYear(t)):l=new Date(t,e,n,o,r,i,a),l}function NL(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function SK(t,e,n){var o=7+e-n,r=(7+NL(t,0,o).getUTCDay()-e)%7;return-r+o-1}function Lct(t,e,n,o,r){var i=(7+n-o)%7,a=SK(t,o,r),l=1+7*(e-1)+i+a,s,c;return l<=0?(s=t-1,c=eF(s)+l):l>eF(t)?(s=t+1,c=l-eF(t)):(s=t,c=l),{year:s,dayOfYear:c}}function UL(t,e,n){var o=SK(t.year(),e,n),r=Math.floor((t.dayOfYear()-o-1)/7)+1,i,a;return r<1?(a=t.year()-1,i=r+O6(a,e,n)):r>O6(t.year(),e,n)?(i=r-O6(t.year(),e,n),a=t.year()+1):(a=t.year(),i=r),{week:i,year:a}}function O6(t,e,n){var o=SK(t,e,n),r=SK(t+1,e,n);return(eF(t)-o+r)/7}pi("w",["ww",2],"wo","week");pi("W",["WW",2],"Wo","isoWeek");Ph("week","w");Ph("isoWeek","W");Ch("week",5);Ch("isoWeek",5);Wr("w",Cc);Wr("ww",Cc,Yg);Wr("W",Cc);Wr("WW",Cc,Yg);bU(["w","ww","W","WW"],function(t,e,n,o){e[o.substr(0,1)]=Ua(t)});function OFo(t){return UL(t,this._week.dow,this._week.doy).week}var _Fo={dow:0,doy:6};function VFo(){return this._week.dow}function GFo(){return this._week.doy}function XFo(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function JFo(t){var e=UL(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}pi("d",0,"do","day");pi("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});pi("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});pi("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});pi("e",0,0,"weekday");pi("E",0,0,"isoWeekday");Ph("day","d");Ph("weekday","e");Ph("isoWeekday","E");Ch("day",11);Ch("weekday",11);Ch("isoWeekday",11);Wr("d",Cc);Wr("e",Cc);Wr("E",Cc);Wr("dd",function(t,e){return e.weekdaysMinRegex(t)});Wr("ddd",function(t,e){return e.weekdaysShortRegex(t)});Wr("dddd",function(t,e){return e.weekdaysRegex(t)});bU(["dd","ddd","dddd"],function(t,e,n,o){var r=n._locale.weekdaysParse(t,o,n._strict);r!=null?e.d=r:wa(n).invalidWeekday=t});bU(["d","e","E"],function(t,e,n,o){e[o]=Ua(t)});function KFo(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function qFo(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function A6e(t,e){return t.slice(e,7).concat(t.slice(0,e))}var $Fo="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Wct="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),QFo="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ZFo=xU,eko=xU,tko=xU;function nko(t,e){var n=q2(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?A6e(n,this._week.dow):t?n[t.day()]:n}function oko(t){return t===!0?A6e(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function rko(t){return t===!0?A6e(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function iko(t,e,n){var o,r,i,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)i=v3([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(i,"").toLocaleLowerCase();return n?e==="dddd"?(r=F0.call(this._weekdaysParse,a),r!==-1?r:null):e==="ddd"?(r=F0.call(this._shortWeekdaysParse,a),r!==-1?r:null):(r=F0.call(this._minWeekdaysParse,a),r!==-1?r:null):e==="dddd"?(r=F0.call(this._weekdaysParse,a),r!==-1||(r=F0.call(this._shortWeekdaysParse,a),r!==-1)?r:(r=F0.call(this._minWeekdaysParse,a),r!==-1?r:null)):e==="ddd"?(r=F0.call(this._shortWeekdaysParse,a),r!==-1||(r=F0.call(this._weekdaysParse,a),r!==-1)?r:(r=F0.call(this._minWeekdaysParse,a),r!==-1?r:null)):(r=F0.call(this._minWeekdaysParse,a),r!==-1||(r=F0.call(this._weekdaysParse,a),r!==-1)?r:(r=F0.call(this._shortWeekdaysParse,a),r!==-1?r:null))}function ako(t,e,n){var o,r,i;if(this._weekdaysParseExact)return iko.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(r=v3([2e3,1]).day(o),n&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[o]||(i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[o]=new RegExp(i.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[o].test(t))return o;if(n&&e==="ddd"&&this._shortWeekdaysParse[o].test(t))return o;if(n&&e==="dd"&&this._minWeekdaysParse[o].test(t))return o;if(!n&&this._weekdaysParse[o].test(t))return o}}function lko(t){if(!this.isValid())return t!=null?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return t!=null?(t=KFo(t,this.localeData()),this.add(t-e,"d")):e}function sko(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function cko(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=qFo(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function uko(t){return this._weekdaysParseExact?(Nl(this,"_weekdaysRegex")||w6e.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(Nl(this,"_weekdaysRegex")||(this._weekdaysRegex=ZFo),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function dko(t){return this._weekdaysParseExact?(Nl(this,"_weekdaysRegex")||w6e.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Nl(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=eko),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function fko(t){return this._weekdaysParseExact?(Nl(this,"_weekdaysRegex")||w6e.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Nl(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tko),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function w6e(){function t(u,d){return d.length-u.length}var e=[],n=[],o=[],r=[],i,a,l,s,c;for(i=0;i<7;i++)a=v3([2e3,1]).day(i),l=ug(this.weekdaysMin(a,"")),s=ug(this.weekdaysShort(a,"")),c=ug(this.weekdays(a,"")),e.push(l),n.push(s),o.push(c),r.push(l),r.push(s),r.push(c);e.sort(t),n.sort(t),o.sort(t),r.sort(t),this._weekdaysRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function v6e(){return this.hours()%12||12}function hko(){return this.hours()||24}pi("H",["HH",2],0,"hour");pi("h",["hh",2],0,v6e);pi("k",["kk",2],0,hko);pi("hmm",0,0,function(){return""+v6e.apply(this)+Q9(this.minutes(),2)});pi("hmmss",0,0,function(){return""+v6e.apply(this)+Q9(this.minutes(),2)+Q9(this.seconds(),2)});pi("Hmm",0,0,function(){return""+this.hours()+Q9(this.minutes(),2)});pi("Hmmss",0,0,function(){return""+this.hours()+Q9(this.minutes(),2)+Q9(this.seconds(),2)});function Nct(t,e){pi(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}Nct("a",!0);Nct("A",!1);Ph("hour","h");Ch("hour",13);function Uct(t,e){return e._meridiemParse}Wr("a",Uct);Wr("A",Uct);Wr("H",Cc);Wr("h",Cc);Wr("k",Cc);Wr("HH",Cc,Yg);Wr("hh",Cc,Yg);Wr("kk",Cc,Yg);Wr("hmm",Hct);Wr("hmmss",Mct);Wr("Hmm",Hct);Wr("Hmmss",Mct);Ts(["H","HH"],Uu);Ts(["k","kk"],function(t,e,n){var o=Ua(t);e[Uu]=o===24?0:o});Ts(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t});Ts(["h","hh"],function(t,e,n){e[Uu]=Ua(t),wa(n).bigHour=!0});Ts("hmm",function(t,e,n){var o=t.length-2;e[Uu]=Ua(t.substr(0,o)),e[M2]=Ua(t.substr(o)),wa(n).bigHour=!0});Ts("hmmss",function(t,e,n){var o=t.length-4,r=t.length-2;e[Uu]=Ua(t.substr(0,o)),e[M2]=Ua(t.substr(o,2)),e[z6]=Ua(t.substr(r)),wa(n).bigHour=!0});Ts("Hmm",function(t,e,n){var o=t.length-2;e[Uu]=Ua(t.substr(0,o)),e[M2]=Ua(t.substr(o))});Ts("Hmmss",function(t,e,n){var o=t.length-4,r=t.length-2;e[Uu]=Ua(t.substr(0,o)),e[M2]=Ua(t.substr(o,2)),e[z6]=Ua(t.substr(r))});function pko(t){return(t+"").toLowerCase().charAt(0)==="p"}var gko=/[ap]\.?m?\.?/i,mko=NM("Hours",!0);function yko(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var jct={calendar:aFo,longDateFormat:uFo,invalidDate:fFo,ordinal:pFo,dayOfMonthOrdinalParse:gFo,relativeTime:yFo,months:zFo,monthsShort:Ict,week:_Fo,weekdays:$Fo,weekdaysMin:QFo,weekdaysShort:Wct,meridiemParse:gko},Lc={},yD={},jL;function Ako(t,e){var n,o=Math.min(t.length,e.length);for(n=0;n0;){if(r=Ate(i.slice(0,n).join("-")),r)return r;if(o&&o.length>=n&&Ako(i,o)>=n-1)break;n--}e++}return jL}function vko(t){return t.match("^[^/\\\\]*$")!=null}function Ate(t){var e=null,n;if(Lc[t]===void 0&&typeof ph<"u"&&ph&&ph.exports&&vko(t))try{e=jL._abbr,n=require,n("./locale/"+t),J8(e)}catch{Lc[t]=null}return Lc[t]}function J8(t,e){var n;return t&&(Ep(e)?n=HA(t):n=x6e(t,e),n?jL=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),jL._abbr}function x6e(t,e){if(e!==null){var n,o=jct;if(e.abbr=t,Lc[t]!=null)bct("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),o=Lc[t]._config;else if(e.parentLocale!=null)if(Lc[e.parentLocale]!=null)o=Lc[e.parentLocale]._config;else if(n=Ate(e.parentLocale),n!=null)o=n._config;else return yD[e.parentLocale]||(yD[e.parentLocale]=[]),yD[e.parentLocale].push({name:t,config:e}),null;return Lc[t]=new h6e(dpe(o,e)),yD[t]&&yD[t].forEach(function(r){x6e(r.name,r.config)}),J8(t),Lc[t]}else return delete Lc[t],null}function xko(t,e){if(e!=null){var n,o,r=jct;Lc[t]!=null&&Lc[t].parentLocale!=null?Lc[t].set(dpe(Lc[t]._config,e)):(o=Ate(t),o!=null&&(r=o._config),e=dpe(r,e),o==null&&(e.abbr=t),n=new h6e(e),n.parentLocale=Lc[t],Lc[t]=n),J8(t)}else Lc[t]!=null&&(Lc[t].parentLocale!=null?(Lc[t]=Lc[t].parentLocale,t===J8()&&J8(t)):Lc[t]!=null&&delete Lc[t]);return Lc[t]}function HA(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return jL;if(!q2(t)){if(e=Ate(t),e)return e;t=[t]}return wko(t)}function bko(){return fpe(Lc)}function b6e(t){var e,n=t._a;return n&&wa(t).overflow===-2&&(e=n[I6]<0||n[I6]>11?I6:n[h9]<1||n[h9]>yte(n[mh],n[I6])?h9:n[Uu]<0||n[Uu]>24||n[Uu]===24&&(n[M2]!==0||n[z6]!==0||n[nx]!==0)?Uu:n[M2]<0||n[M2]>59?M2:n[z6]<0||n[z6]>59?z6:n[nx]<0||n[nx]>999?nx:-1,wa(t)._overflowDayOfYear&&(eh9)&&(e=h9),wa(t)._overflowWeeks&&e===-1&&(e=HFo),wa(t)._overflowWeekday&&e===-1&&(e=MFo),wa(t).overflow=e),t}var Sko=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Tko=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Pko=/Z|[+-]\d\d(?::?\d\d)?/,c_=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Lle=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Cko=/^\/?Date\((-?\d+)/i,Rko=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Hko={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Bct(t){var e,n,o=t._i,r=Sko.exec(o)||Tko.exec(o),i,a,l,s,c=c_.length,u=Lle.length;if(r){for(wa(t).iso=!0,e=0,n=c;eeF(a)||t._dayOfYear===0)&&(wa(t)._overflowDayOfYear=!0),n=NL(a,0,t._dayOfYear),t._a[I6]=n.getUTCMonth(),t._a[h9]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=o[e]=r[e];for(;e<7;e++)t._a[e]=o[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[Uu]===24&&t._a[M2]===0&&t._a[z6]===0&&t._a[nx]===0&&(t._nextDay=!0,t._a[Uu]=0),t._d=(t._useUTC?NL:YFo).apply(null,o),i=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Uu]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==i&&(wa(t).weekdayMismatch=!0)}}function Lko(t){var e,n,o,r,i,a,l,s,c;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(i=1,a=4,n=IP(e.GG,t._a[mh],UL(bc(),1,4).year),o=IP(e.W,1),r=IP(e.E,1),(r<1||r>7)&&(s=!0)):(i=t._locale._week.dow,a=t._locale._week.doy,c=UL(bc(),i,a),n=IP(e.gg,t._a[mh],c.year),o=IP(e.w,c.week),e.d!=null?(r=e.d,(r<0||r>6)&&(s=!0)):e.e!=null?(r=e.e+i,(e.e<0||e.e>6)&&(s=!0)):r=i),o<1||o>O6(n,i,a)?wa(t)._overflowWeeks=!0:s!=null?wa(t)._overflowWeekday=!0:(l=Lct(n,o,r,i,a),t._a[mh]=l.year,t._dayOfYear=l.dayOfYear)}yr.ISO_8601=function(){};yr.RFC_2822=function(){};function T6e(t){if(t._f===yr.ISO_8601){Bct(t);return}if(t._f===yr.RFC_2822){Yct(t);return}t._a=[],wa(t).empty=!0;var e=""+t._i,n,o,r,i,a,l=e.length,s=0,c,u;for(r=Sct(t._f,t._locale).match(p6e)||[],u=r.length,n=0;n0&&wa(t).unusedInput.push(a),e=e.slice(e.indexOf(o)+o.length),s+=o.length),OC[i]?(o?wa(t).empty=!1:wa(t).unusedTokens.push(i),RFo(i,o,t)):t._strict&&!o&&wa(t).unusedTokens.push(i);wa(t).charsLeftOver=l-s,e.length>0&&wa(t).unusedInput.push(e),t._a[Uu]<=12&&wa(t).bigHour===!0&&t._a[Uu]>0&&(wa(t).bigHour=void 0),wa(t).parsedDateParts=t._a.slice(0),wa(t).meridiem=t._meridiem,t._a[Uu]=Wko(t._locale,t._a[Uu],t._meridiem),c=wa(t).era,c!==null&&(t._a[mh]=t._locale.erasConvertYear(c,t._a[mh])),S6e(t),b6e(t)}function Wko(t,e,n){var o;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(o=t.isPM(n),o&&e<12&&(e+=12),!o&&e===12&&(e=0)),e)}function Nko(t){var e,n,o,r,i,a,l=!1,s=t._f.length;if(s===0){wa(t).invalidFormat=!0,t._d=new Date(NaN);return}for(r=0;rthis?this:t:ute()});function Vct(t,e){var n,o;if(e.length===1&&q2(e[0])&&(e=e[0]),!e.length)return bc();for(n=e[0],o=1;othis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function iLo(){if(!Ep(this._isDSTShifted))return this._isDSTShifted;var t={},e;return f6e(t,this),t=Oct(t),t._a?(e=t._isUTC?v3(t._a):bc(t._a),this._isDSTShifted=this.isValid()&&qko(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function aLo(){return this.isValid()?!this._isUTC:!1}function lLo(){return this.isValid()?this._isUTC:!1}function Xct(){return this.isValid()?this._isUTC&&this._offset===0:!1}var sLo=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,cLo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function h5(t,e){var n=t,o=null,r,i,a;return AV(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:uA(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(o=sLo.exec(t))?(r=o[1]==="-"?-1:1,n={y:0,d:Ua(o[h9])*r,h:Ua(o[Uu])*r,m:Ua(o[M2])*r,s:Ua(o[z6])*r,ms:Ua(ppe(o[nx]*1e3))*r}):(o=cLo.exec(t))?(r=o[1]==="-"?-1:1,n={y:ov(o[2],r),M:ov(o[3],r),w:ov(o[4],r),d:ov(o[5],r),h:ov(o[6],r),m:ov(o[7],r),s:ov(o[8],r)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(a=uLo(bc(n.from),bc(n.to)),n={},n.ms=a.milliseconds,n.M=a.months),i=new wte(n),AV(t)&&Nl(t,"_locale")&&(i._locale=t._locale),AV(t)&&Nl(t,"_isValid")&&(i._isValid=t._isValid),i}h5.fn=wte.prototype;h5.invalid=Kko;function ov(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function EFe(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function uLo(t,e){var n;return t.isValid()&&e.isValid()?(e=C6e(e,t),t.isBefore(e)?n=EFe(t,e):(n=EFe(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Jct(t,e){return function(n,o){var r,i;return o!==null&&!isNaN(+o)&&(bct(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=o,o=i),r=h5(n,o),Kct(this,r,t),this}}function Kct(t,e,n,o){var r=e._milliseconds,i=ppe(e._days),a=ppe(e._months);t.isValid()&&(o=o??!0,a&&Dct(t,xK(t,"Month")+a*n),i&&Pct(t,"Date",xK(t,"Date")+i*n),r&&t._d.setTime(t._d.valueOf()+r*n),o&&yr.updateOffset(t,i||a))}var dLo=Jct(1,"add"),fLo=Jct(-1,"subtract");function qct(t){return typeof t=="string"||t instanceof String}function hLo(t){return $2(t)||wU(t)||qct(t)||uA(t)||gLo(t)||pLo(t)||t===null||t===void 0}function pLo(t){var e=Fx(t)&&!u6e(t),n=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],r,i,a=o.length;for(r=0;rn.valueOf():n.valueOf()9999?yV(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):x3(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",yV(n,"Z")):yV(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function MLo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,o,r,i;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',o=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",i=e+'[")]',this.format(n+o+r+i)}function ILo(t){t||(t=this.isUtc()?yr.defaultFormatUtc:yr.defaultFormat);var e=yV(this,t);return this.localeData().postformat(e)}function zLo(t,e){return this.isValid()&&($2(t)&&t.isValid()||bc(t).isValid())?h5({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function DLo(t){return this.from(bc(),t)}function ELo(t,e){return this.isValid()&&($2(t)&&t.isValid()||bc(t).isValid())?h5({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function FLo(t){return this.to(bc(),t)}function $ct(t){var e;return t===void 0?this._locale._abbr:(e=HA(t),e!=null&&(this._locale=e),this)}var Qct=my("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function Zct(){return this._locale}var TK=1e3,_C=60*TK,PK=60*_C,e0t=(365*400+97)*24*PK;function VC(t,e){return(t%e+e)%e}function t0t(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-e0t:new Date(t,e,n).valueOf()}function n0t(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-e0t:Date.UTC(t,e,n)}function kLo(t){var e,n;if(t=yy(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?n0t:t0t,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=VC(e+(this._isUTC?0:this.utcOffset()*_C),PK);break;case"minute":e=this._d.valueOf(),e-=VC(e,_C);break;case"second":e=this._d.valueOf(),e-=VC(e,TK);break}return this._d.setTime(e),yr.updateOffset(this,!0),this}function LLo(t){var e,n;if(t=yy(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?n0t:t0t,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=PK-VC(e+(this._isUTC?0:this.utcOffset()*_C),PK)-1;break;case"minute":e=this._d.valueOf(),e+=_C-VC(e,_C)-1;break;case"second":e=this._d.valueOf(),e+=TK-VC(e,TK)-1;break}return this._d.setTime(e),yr.updateOffset(this,!0),this}function WLo(){return this._d.valueOf()-(this._offset||0)*6e4}function NLo(){return Math.floor(this.valueOf()/1e3)}function ULo(){return new Date(this.valueOf())}function jLo(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function BLo(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function YLo(){return this.isValid()?this.toISOString():null}function OLo(){return d6e(this)}function _Lo(){return R8({},wa(this))}function VLo(){return wa(this).overflow}function GLo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}pi("N",0,0,"eraAbbr");pi("NN",0,0,"eraAbbr");pi("NNN",0,0,"eraAbbr");pi("NNNN",0,0,"eraName");pi("NNNNN",0,0,"eraNarrow");pi("y",["y",1],"yo","eraYear");pi("y",["yy",2],0,"eraYear");pi("y",["yyy",3],0,"eraYear");pi("y",["yyyy",4],0,"eraYear");Wr("N",R6e);Wr("NN",R6e);Wr("NNN",R6e);Wr("NNNN",oWo);Wr("NNNNN",rWo);Ts(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,o){var r=n._locale.erasParse(t,o,n._strict);r?wa(n).era=r:wa(n).invalidEra=t});Wr("y",UM);Wr("yy",UM);Wr("yyy",UM);Wr("yyyy",UM);Wr("yo",iWo);Ts(["y","yy","yyy","yyyy"],mh);Ts(["yo"],function(t,e,n,o){var r;n._locale._eraYearOrdinalRegex&&(r=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[mh]=n._locale.eraYearOrdinalParse(t,r):e[mh]=parseInt(t,10)});function XLo(t,e){var n,o,r,i=this._eras||HA("en")._eras;for(n=0,o=i.length;n=0)return i[o]}function KLo(t,e){var n=t.since<=t.until?1:-1;return e===void 0?yr(t.since).year():yr(t.since).year()+(e-t.offset)*n}function qLo(){var t,e,n,o=this.localeData().eras();for(t=0,e=o.length;ti&&(e=i),fWo.call(this,t,e,n,o,r))}function fWo(t,e,n,o,r){var i=Lct(t,e,n,o,r),a=NL(i.year,0,i.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}pi("Q",0,"Qo","quarter");Ph("quarter","Q");Ch("quarter",7);Wr("Q",Cct);Ts("Q",function(t,e){e[I6]=(Ua(t)-1)*3});function hWo(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}pi("D",["DD",2],"Do","date");Ph("date","D");Ch("date",9);Wr("D",Cc);Wr("DD",Cc,Yg);Wr("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});Ts(["D","DD"],h9);Ts("Do",function(t,e){e[h9]=Ua(t.match(Cc)[0])});var r0t=NM("Date",!0);pi("DDD",["DDDD",3],"DDDo","dayOfYear");Ph("dayOfYear","DDD");Ch("dayOfYear",4);Wr("DDD",hte);Wr("DDDD",Rct);Ts(["DDD","DDDD"],function(t,e,n){n._dayOfYear=Ua(t)});function pWo(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}pi("m",["mm",2],0,"minute");Ph("minute","m");Ch("minute",14);Wr("m",Cc);Wr("mm",Cc,Yg);Ts(["m","mm"],M2);var gWo=NM("Minutes",!1);pi("s",["ss",2],0,"second");Ph("second","s");Ch("second",15);Wr("s",Cc);Wr("ss",Cc,Yg);Ts(["s","ss"],z6);var mWo=NM("Seconds",!1);pi("S",0,0,function(){return~~(this.millisecond()/100)});pi(0,["SS",2],0,function(){return~~(this.millisecond()/10)});pi(0,["SSS",3],0,"millisecond");pi(0,["SSSS",4],0,function(){return this.millisecond()*10});pi(0,["SSSSS",5],0,function(){return this.millisecond()*100});pi(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});pi(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});pi(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});pi(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});Ph("millisecond","ms");Ch("millisecond",16);Wr("S",hte,Cct);Wr("SS",hte,Yg);Wr("SSS",hte,Rct);var H8,i0t;for(H8="SSSS";H8.length<=9;H8+="S")Wr(H8,UM);function yWo(t,e){e[nx]=Ua(("0."+t)*1e3)}for(H8="S";H8.length<=9;H8+="S")Ts(H8,yWo);i0t=NM("Milliseconds",!1);pi("z",0,0,"zoneAbbr");pi("zz",0,0,"zoneName");function AWo(){return this._isUTC?"UTC":""}function wWo(){return this._isUTC?"Coordinated Universal Time":""}var qo=vU.prototype;qo.add=dLo;qo.calendar=ALo;qo.clone=wLo;qo.diff=CLo;qo.endOf=LLo;qo.format=ILo;qo.from=zLo;qo.fromNow=DLo;qo.to=ELo;qo.toNow=FLo;qo.get=xFo;qo.invalidAt=VLo;qo.isAfter=vLo;qo.isBefore=xLo;qo.isBetween=bLo;qo.isSame=SLo;qo.isSameOrAfter=TLo;qo.isSameOrBefore=PLo;qo.isValid=OLo;qo.lang=Qct;qo.locale=$ct;qo.localeData=Zct;qo.max=Oko;qo.min=Yko;qo.parsingFlags=_Lo;qo.set=bFo;qo.startOf=kLo;qo.subtract=fLo;qo.toArray=jLo;qo.toObject=BLo;qo.toDate=ULo;qo.toISOString=HLo;qo.inspect=MLo;typeof Symbol<"u"&&Symbol.for!=null&&(qo[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});qo.toJSON=YLo;qo.toString=RLo;qo.unix=NLo;qo.valueOf=WLo;qo.creationData=GLo;qo.eraName=qLo;qo.eraNarrow=$Lo;qo.eraAbbr=QLo;qo.eraYear=ZLo;qo.year=kct;qo.isLeapYear=BFo;qo.weekYear=aWo;qo.isoWeekYear=lWo;qo.quarter=qo.quarters=hWo;qo.month=Ect;qo.daysInMonth=NFo;qo.week=qo.weeks=XFo;qo.isoWeek=qo.isoWeeks=JFo;qo.weeksInYear=uWo;qo.weeksInWeekYear=dWo;qo.isoWeeksInYear=sWo;qo.isoWeeksInISOWeekYear=cWo;qo.date=r0t;qo.day=qo.days=lko;qo.weekday=sko;qo.isoWeekday=cko;qo.dayOfYear=pWo;qo.hour=qo.hours=mko;qo.minute=qo.minutes=gWo;qo.second=qo.seconds=mWo;qo.millisecond=qo.milliseconds=i0t;qo.utcOffset=Qko;qo.utc=eLo;qo.local=tLo;qo.parseZone=nLo;qo.hasAlignedHourOffset=oLo;qo.isDST=rLo;qo.isLocal=aLo;qo.isUtcOffset=lLo;qo.isUtc=Xct;qo.isUTC=Xct;qo.zoneAbbr=AWo;qo.zoneName=wWo;qo.dates=my("dates accessor is deprecated. Use date instead.",r0t);qo.months=my("months accessor is deprecated. Use month instead",Ect);qo.years=my("years accessor is deprecated. Use year instead",kct);qo.zone=my("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Zko);qo.isDSTShifted=my("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",iLo);function vWo(t){return bc(t*1e3)}function xWo(){return bc.apply(null,arguments).parseZone()}function a0t(t){return t}var jl=h6e.prototype;jl.calendar=lFo;jl.longDateFormat=dFo;jl.invalidDate=hFo;jl.ordinal=mFo;jl.preparse=a0t;jl.postformat=a0t;jl.relativeTime=AFo;jl.pastFuture=wFo;jl.set=iFo;jl.eras=XLo;jl.erasParse=JLo;jl.erasConvertYear=KLo;jl.erasAbbrRegex=tWo;jl.erasNameRegex=eWo;jl.erasNarrowRegex=nWo;jl.months=FFo;jl.monthsShort=kFo;jl.monthsParse=WFo;jl.monthsRegex=jFo;jl.monthsShortRegex=UFo;jl.week=OFo;jl.firstDayOfYear=GFo;jl.firstDayOfWeek=VFo;jl.weekdays=nko;jl.weekdaysMin=rko;jl.weekdaysShort=oko;jl.weekdaysParse=ako;jl.weekdaysRegex=uko;jl.weekdaysShortRegex=dko;jl.weekdaysMinRegex=fko;jl.isPM=pko;jl.meridiem=yko;function CK(t,e,n,o){var r=HA(),i=v3().set(o,e);return r[n](i,t)}function l0t(t,e,n){if(uA(t)&&(e=t,t=void 0),t=t||"",e!=null)return CK(t,e,n,"month");var o,r=[];for(o=0;o<12;o++)r[o]=CK(t,o,n,"month");return r}function M6e(t,e,n,o){typeof t=="boolean"?(uA(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,uA(e)&&(n=e,e=void 0),e=e||"");var r=HA(),i=t?r._week.dow:0,a,l=[];if(n!=null)return CK(e,(n+i)%7,o,"day");for(a=0;a<7;a++)l[a]=CK(e,(a+i)%7,o,"day");return l}function bWo(t,e){return l0t(t,e,"months")}function SWo(t,e){return l0t(t,e,"monthsShort")}function TWo(t,e,n){return M6e(t,e,n,"weekdays")}function PWo(t,e,n){return M6e(t,e,n,"weekdaysShort")}function CWo(t,e,n){return M6e(t,e,n,"weekdaysMin")}J8("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=Ua(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}});yr.lang=my("moment.lang is deprecated. Use moment.locale instead.",J8);yr.langData=my("moment.langData is deprecated. Use moment.localeData instead.",HA);var c6=Math.abs;function RWo(){var t=this._data;return this._milliseconds=c6(this._milliseconds),this._days=c6(this._days),this._months=c6(this._months),t.milliseconds=c6(t.milliseconds),t.seconds=c6(t.seconds),t.minutes=c6(t.minutes),t.hours=c6(t.hours),t.months=c6(t.months),t.years=c6(t.years),this}function s0t(t,e,n,o){var r=h5(e,n);return t._milliseconds+=o*r._milliseconds,t._days+=o*r._days,t._months+=o*r._months,t._bubble()}function HWo(t,e){return s0t(this,t,e,1)}function MWo(t,e){return s0t(this,t,e,-1)}function FFe(t){return t<0?Math.floor(t):Math.ceil(t)}function IWo(){var t=this._milliseconds,e=this._days,n=this._months,o=this._data,r,i,a,l,s;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=FFe(mpe(n)+e)*864e5,e=0,n=0),o.milliseconds=t%1e3,r=Dm(t/1e3),o.seconds=r%60,i=Dm(r/60),o.minutes=i%60,a=Dm(i/60),o.hours=a%24,e+=Dm(a/24),s=Dm(c0t(e)),n+=s,e-=FFe(mpe(s)),l=Dm(n/12),n%=12,o.days=e,o.months=n,o.years=l,this}function c0t(t){return t*4800/146097}function mpe(t){return t*146097/4800}function zWo(t){if(!this.isValid())return NaN;var e,n,o=this._milliseconds;if(t=yy(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+o/864e5,n=this._months+c0t(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(mpe(this._months)),t){case"week":return e/7+o/6048e5;case"day":return e+o/864e5;case"hour":return e*24+o/36e5;case"minute":return e*1440+o/6e4;case"second":return e*86400+o/1e3;case"millisecond":return Math.floor(e*864e5)+o;default:throw new Error("Unknown unit "+t)}}function DWo(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Ua(this._months/12)*31536e6:NaN}function MA(t){return function(){return this.as(t)}}var EWo=MA("ms"),FWo=MA("s"),kWo=MA("m"),LWo=MA("h"),WWo=MA("d"),NWo=MA("w"),UWo=MA("M"),jWo=MA("Q"),BWo=MA("y");function YWo(){return h5(this)}function OWo(t){return t=yy(t),this.isValid()?this[t+"s"]():NaN}function hS(t){return function(){return this.isValid()?this._data[t]:NaN}}var _Wo=hS("milliseconds"),VWo=hS("seconds"),GWo=hS("minutes"),XWo=hS("hours"),JWo=hS("days"),KWo=hS("months"),qWo=hS("years");function $Wo(){return Dm(this.days()/7)}var p6=Math.round,gC={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function QWo(t,e,n,o,r){return r.relativeTime(e||1,!!n,t,o)}function ZWo(t,e,n,o){var r=h5(t).abs(),i=p6(r.as("s")),a=p6(r.as("m")),l=p6(r.as("h")),s=p6(r.as("d")),c=p6(r.as("M")),u=p6(r.as("w")),d=p6(r.as("y")),f=i<=n.ss&&["s",i]||i0,f[4]=o,QWo.apply(null,f)}function eNo(t){return t===void 0?p6:typeof t=="function"?(p6=t,!0):!1}function tNo(t,e){return gC[t]===void 0?!1:e===void 0?gC[t]:(gC[t]=e,t==="s"&&(gC.ss=e-1),!0)}function nNo(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,o=gC,r,i;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(o=Object.assign({},gC,e),e.s!=null&&e.ss==null&&(o.ss=e.s-1)),r=this.localeData(),i=ZWo(this,!n,o,r),n&&(i=r.pastFuture(+this,i)),r.postformat(i)}var Wle=Math.abs;function tP(t){return(t>0)-(t<0)||+t}function xte(){if(!this.isValid())return this.localeData().invalidDate();var t=Wle(this._milliseconds)/1e3,e=Wle(this._days),n=Wle(this._months),o,r,i,a,l=this.asSeconds(),s,c,u,d;return l?(o=Dm(t/60),r=Dm(o/60),t%=60,o%=60,i=Dm(n/12),n%=12,a=t?t.toFixed(3).replace(/\.?0+$/,""):"",s=l<0?"-":"",c=tP(this._months)!==tP(l)?"-":"",u=tP(this._days)!==tP(l)?"-":"",d=tP(this._milliseconds)!==tP(l)?"-":"",s+"P"+(i?c+i+"Y":"")+(n?c+n+"M":"")+(e?u+e+"D":"")+(r||o||t?"T":"")+(r?d+r+"H":"")+(o?d+o+"M":"")+(t?d+a+"S":"")):"P0D"}var vl=wte.prototype;vl.isValid=Jko;vl.abs=RWo;vl.add=HWo;vl.subtract=MWo;vl.as=zWo;vl.asMilliseconds=EWo;vl.asSeconds=FWo;vl.asMinutes=kWo;vl.asHours=LWo;vl.asDays=WWo;vl.asWeeks=NWo;vl.asMonths=UWo;vl.asQuarters=jWo;vl.asYears=BWo;vl.valueOf=DWo;vl._bubble=IWo;vl.clone=YWo;vl.get=OWo;vl.milliseconds=_Wo;vl.seconds=VWo;vl.minutes=GWo;vl.hours=XWo;vl.days=JWo;vl.weeks=$Wo;vl.months=KWo;vl.years=qWo;vl.humanize=nNo;vl.toISOString=xte;vl.toString=xte;vl.toJSON=xte;vl.locale=$ct;vl.localeData=Zct;vl.toIsoString=my("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",xte);vl.lang=Qct;pi("X",0,0,"unix");pi("x",0,0,"valueOf");Wr("x",gte);Wr("X",TFo);Ts("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)});Ts("x",function(t,e,n){n._d=new Date(Ua(t))});//! moment.js +yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3;yr.unix=vWo;yr.months=bWo;yr.isDate=wU;yr.locale=J8;yr.invalid=ute;yr.duration=h5;yr.isMoment=$2;yr.weekdays=TWo;yr.parseZone=xWo;yr.localeData=HA;yr.isDuration=AV;yr.monthsShort=SWo;yr.weekdaysMin=CWo;yr.defineLocale=x6e;yr.updateLocale=xko;yr.locales=bko;yr.weekdaysShort=PWo;yr.normalizeUnits=yy;yr.relativeTimeRounding=eNo;yr.relativeTimeThreshold=tNo;yr.calendarFormat=yLo;yr.prototype=qo;yr.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const oNo=Ro.div` position: fixed; top: 80px; right: 24px; @@ -8747,7 +8747,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,aNo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=Tn(mOe),a=Tn(Kvt),l=H(V4t),s=H(jg),c=H(Pc),u=be.useRef(null),d=m.useRef(null),f=m.useRef(),p=d.current?d.current.clientWidth+40:l?l.width+40:640,g=d.current?d.current.clientHeight+100:l?l.height+100:460,[y,w]=m.useState({x:l?Math.max(l.x,p-window.innerWidth):0,y:l?Math.min(l.y,window.innerHeight-g):0}),b=Jt();m.useEffect(()=>{w({x:Math.max(l==null?void 0:l.x,p-window.innerWidth),y:Math.min(l==null?void 0:l.y,window.innerHeight-g)})},[l,p,g]),m.useEffect(()=>{const S=()=>{w({x:Math.max(l==null?void 0:l.x,p-window.innerWidth),y:Math.min(l==null?void 0:l.y,window.innerHeight-g)})};return window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S)}},[l,p,g]),m.useEffect(()=>(d.current&&(f.current||(f.current=new ResizeObserver(()=>{o(S=>{d.current&&(S.viewState.dailyLightSensorPanelRect||(S.viewState.dailyLightSensorPanelRect=new cr(0,0,600,360)),S.viewState.dailyLightSensorPanelRect.width=d.current.offsetWidth,S.viewState.dailyLightSensorPanelRect.height=d.current.offsetHeight)})})),f.current.observe(d.current)),()=>{var S;(S=f.current)==null||S.disconnect()}),[]);const C=(S,R)=>{w({x:Math.max(R.x,p-window.innerWidth),y:Math.min(R.y,window.innerHeight-g)})},P=(S,R)=>{o(M=>{M.viewState.dailyLightSensorPanelRect||(M.viewState.dailyLightSensorPanelRect=new cr(0,0,600,360)),M.viewState.dailyLightSensorPanelRect.x=Math.max(R.x,p-window.innerWidth),M.viewState.dailyLightSensorPanelRect.y=Math.min(R.y,window.innerHeight-g)})},v=()=>{o(S=>{S.viewState.showDailyLightSensorPanel=!1,e&&(S.actionInfo={name:"Close Daily Light Sensor Graph",timestamp:new Date().getTime()})})},T=Y.t("word.Hour",b),A=Y.t("word.Radiation",b),x=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:u,handle:".handle",bounds:"parent",axis:"both",position:y,onDrag:C,onStop:P,onMouseDown:()=>{o(S=>{S.selectedFloatingWindow="dailyLightSensorPanel"})},children:h.jsx(oNo,{ref:u,style:{zIndex:c==="dailyLightSensorPanel"?Sc:9},children:h.jsxs(rNo,{ref:d,style:{opacity:n,width:(l?l.width:600)+"px",height:(l?l.height:360)+"px"},children:[h.jsxs(iNo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[Y.t("sensorPanel.LightSensor",b)+": ",h.jsx("span",{style:{fontSize:"10px"},children:Y.t("sensorPanel.WeatherDataFrom",b)+" "+t+" | "+yr(r).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{v()},onMouseDown:()=>{v()},children:`${Y.t("word.Close",b)}`})]}),h.jsx(Tf,{type:vi.DailyRadiationSensorData,chartType:Ml.Line,dataSource:a,labels:i,height:100,dataKeyAxisX:"Hour",labelX:T,labelY:A,unitY:"kWh/m²",yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[h.jsx(lo,{type:"default",icon:x?h.jsx(Sh,{}):h.jsx(Hf,{}),title:Y.t(x?"word.Run":"word.Update",b),onClick:()=>{if(s(z.Sensor)===0){hn(Y.t("analysisManager.NoSensorForCollectingData",b));return}hn(Y.t("message.SimulationStarted",b)),setTimeout(()=>{o(R=>{e&&(R.actionInfo={name:"Collect Daily Data for Sensors",timestamp:new Date().getTime()})}),ht.getState().set(R=>{R.runDailyLightSensor=!0,R.pauseDailyLightSensor=!1,R.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:Y.t("word.SaveAsImage",b),onClick:()=>{kd("line-graph-"+T+"-"+A,"daily-light-sensor").then(()=>{hn(Y.t("message.ScreenshotSaved",b)),e&&o(S=>{S.actionInfo={name:"Take Screenshot of Daily Light Sensor Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:Y.t("word.SaveAsCsv",b),onClick:()=>{bh(a,"daily-light-sensor.csv"),hn(Y.t("message.CsvFileSaved",b)),e&&o(S=>{S.actionInfo={name:"Export Daily Light Sensor Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),lNo=Ro.div` +`,aNo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=Tn(mOe),a=Tn(Kvt),l=H(V4t),s=H(jg),c=H(Pc),u=be.useRef(null),d=m.useRef(null),f=m.useRef(),p=d.current?d.current.clientWidth+40:l?l.width+40:640,g=d.current?d.current.clientHeight+100:l?l.height+100:460,[y,w]=m.useState({x:l?Math.max(l.x,p-window.innerWidth):0,y:l?Math.min(l.y,window.innerHeight-g):0}),b=Jt();m.useEffect(()=>{w({x:Math.max(l==null?void 0:l.x,p-window.innerWidth),y:Math.min(l==null?void 0:l.y,window.innerHeight-g)})},[l,p,g]),m.useEffect(()=>{const S=()=>{w({x:Math.max(l==null?void 0:l.x,p-window.innerWidth),y:Math.min(l==null?void 0:l.y,window.innerHeight-g)})};return window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S)}},[l,p,g]),m.useEffect(()=>(d.current&&(f.current||(f.current=new ResizeObserver(()=>{o(S=>{d.current&&(S.viewState.dailyLightSensorPanelRect||(S.viewState.dailyLightSensorPanelRect=new cr(0,0,600,360)),S.viewState.dailyLightSensorPanelRect.width=d.current.offsetWidth,S.viewState.dailyLightSensorPanelRect.height=d.current.offsetHeight)})})),f.current.observe(d.current)),()=>{var S;(S=f.current)==null||S.disconnect()}),[]);const C=(S,R)=>{w({x:Math.max(R.x,p-window.innerWidth),y:Math.min(R.y,window.innerHeight-g)})},P=(S,R)=>{o(M=>{M.viewState.dailyLightSensorPanelRect||(M.viewState.dailyLightSensorPanelRect=new cr(0,0,600,360)),M.viewState.dailyLightSensorPanelRect.x=Math.max(R.x,p-window.innerWidth),M.viewState.dailyLightSensorPanelRect.y=Math.min(R.y,window.innerHeight-g)})},v=()=>{o(S=>{S.viewState.showDailyLightSensorPanel=!1,e&&(S.actionInfo={name:"Close Daily Light Sensor Graph",timestamp:new Date().getTime()})})},T=Y.t("word.Hour",b),A=Y.t("word.Radiation",b),x=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:u,handle:".handle",bounds:"parent",axis:"both",position:y,onDrag:C,onStop:P,onMouseDown:()=>{o(S=>{S.selectedFloatingWindow="dailyLightSensorPanel"})},children:h.jsx(oNo,{ref:u,style:{zIndex:c==="dailyLightSensorPanel"?Sc:9},children:h.jsxs(rNo,{ref:d,style:{opacity:n,width:(l?l.width:600)+"px",height:(l?l.height:360)+"px"},children:[h.jsxs(iNo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[Y.t("sensorPanel.LightSensor",b)+": ",h.jsx("span",{style:{fontSize:"10px"},children:Y.t("sensorPanel.WeatherDataFrom",b)+" "+t+" | "+yr(r).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{v()},onMouseDown:()=>{v()},children:`${Y.t("word.Close",b)}`})]}),h.jsx(Tf,{type:vi.DailyRadiationSensorData,chartType:Ml.Line,dataSource:a,labels:i,height:100,dataKeyAxisX:"Hour",labelX:T,labelY:A,unitY:"kWh/m²",yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[h.jsx(lo,{type:"default",icon:x?h.jsx(Sh,{}):h.jsx(Hf,{}),title:Y.t(x?"word.Run":"word.Update",b),onClick:()=>{if(s(z.Sensor)===0){hn(Y.t("analysisManager.NoSensorForCollectingData",b));return}hn(Y.t("message.SimulationStarted",b)),setTimeout(()=>{o(R=>{e&&(R.actionInfo={name:"Collect Daily Data for Sensors",timestamp:new Date().getTime()})}),ht.getState().set(R=>{R.runDailyLightSensor=!0,R.pauseDailyLightSensor=!1,R.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:Y.t("word.SaveAsImage",b),onClick:()=>{kd("line-graph-"+T+"-"+A,"daily-light-sensor").then(()=>{hn(Y.t("message.ScreenshotSaved",b)),e&&o(S=>{S.actionInfo={name:"Take Screenshot of Daily Light Sensor Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:Y.t("word.SaveAsCsv",b),onClick:()=>{bh(a,"daily-light-sensor.csv"),hn(Y.t("message.CsvFileSaved",b)),e&&o(S=>{S.actionInfo={name:"Export Daily Light Sensor Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),lNo=Ro.div` position: fixed; top: 80px; left: 10px; @@ -8812,7 +8812,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; font-size: 12px; flex-direction: column; opacity: 100%; -`,pNo=be.memo(()=>{const t=H(fn),e=H(En),n=H(Dw),o=H(Id)??!1,r=H(Wq)??!1,i=Jt(),a=n.y>0?"navajowhite":"antiquewhite",l=me.isMac(),s=c=>{t(u=>{u.viewState.navigationView=c,u.viewState.enableRotate=!c})};return h.jsx(fNo,{children:h.jsxs(hNo,{style:{color:a,fontSize:r?"10px":"9px"},children:[r&&h.jsxs("span",{style:{fontSize:"12px",paddingLeft:"6px",paddingRight:"6px",paddingTop:"2px",paddingBottom:"2px",marginBottom:"6px",background:"tomato",border:"1px solid"},children:[h.jsx("b",{children:Y.t("instructionPanel.NavigationMode",i)}),h.jsx(Lw,{style:{paddingLeft:"6px",cursor:"pointer"},onClick:()=>{const c={name:"Close Navigation Mode",timestamp:Date.now(),undo:()=>{s(!0)},redo:()=>{s(!1)}};e(c),s(!1)}})]}),h.jsxs("span",{children:[h.jsx("b",{children:Y.t(r?"instructionPanel.DisableNavigation":"instructionPanel.EnableNavigation",i)}),": ",Y.t("word.Press",i)," ",l?"⌘":"Ctrl","+U"]}),r&&h.jsxs(h.Fragment,{children:[h.jsxs("span",{children:[h.jsx("b",{children:Y.t("instructionPanel.MoveForwardBack",i)}),":"," ",Y.t("instructionPanel.MoveForwardBackInstruction",i)]}),h.jsxs("span",{children:[h.jsx("b",{children:Y.t("instructionPanel.MoveLeftRight",i)}),":"," ",Y.t("instructionPanel.MoveLeftRightInstruction",i)]}),h.jsxs("span",{children:[h.jsx("b",{children:Y.t("instructionPanel.MoveUpDown",i)}),":"," ",Y.t("instructionPanel.MoveUpDownInstruction",i)]}),h.jsxs("span",{children:[h.jsx("b",{children:Y.t("instructionPanel.Turn",i)}),": ",Y.t("instructionPanel.TurnInstruction",i)]})]}),!o&&!r&&h.jsxs("span",{children:[h.jsx("b",{children:Y.t("instructionPanel.Rotate",i)}),": ",Y.t("instructionPanel.DragMouse",i)]}),!r&&h.jsxs(h.Fragment,{children:[h.jsxs("span",{children:[h.jsx("b",{children:Y.t("instructionPanel.Zoom",i)}),":"," ",Y.t(l?"instructionPanel.MouseWheelOrKeysMac":"instructionPanel.MouseWheelOrKeys",i)]}),h.jsxs("span",{children:[h.jsx("b",{children:Y.t("instructionPanel.Pan",i)}),":"," ",Y.t(l?"instructionPanel.HoldMetaDragMouse":"instructionPanel.HoldCtrlDragMouse",i)]}),h.jsxs("span",{children:[h.jsx("b",{children:Y.t(o?"instructionPanel.Exit2DMode":"instructionPanel.Enter2DMode",i)}),":"," ",Y.t("word.Press",i)," ",l?"⌘":"Ctrl","+B"]})]})]})})}),gNo=Ro.div` +`,pNo=be.memo(()=>{const t=H(fn),e=H(En),n=H(Dw),o=H(Id)??!1,r=H(Nq)??!1,i=Jt(),a=n.y>0?"navajowhite":"antiquewhite",l=me.isMac(),s=c=>{t(u=>{u.viewState.navigationView=c,u.viewState.enableRotate=!c})};return h.jsx(fNo,{children:h.jsxs(hNo,{style:{color:a,fontSize:r?"10px":"9px"},children:[r&&h.jsxs("span",{style:{fontSize:"12px",paddingLeft:"6px",paddingRight:"6px",paddingTop:"2px",paddingBottom:"2px",marginBottom:"6px",background:"tomato",border:"1px solid"},children:[h.jsx("b",{children:Y.t("instructionPanel.NavigationMode",i)}),h.jsx(Lw,{style:{paddingLeft:"6px",cursor:"pointer"},onClick:()=>{const c={name:"Close Navigation Mode",timestamp:Date.now(),undo:()=>{s(!0)},redo:()=>{s(!1)}};e(c),s(!1)}})]}),h.jsxs("span",{children:[h.jsx("b",{children:Y.t(r?"instructionPanel.DisableNavigation":"instructionPanel.EnableNavigation",i)}),": ",Y.t("word.Press",i)," ",l?"⌘":"Ctrl","+U"]}),r&&h.jsxs(h.Fragment,{children:[h.jsxs("span",{children:[h.jsx("b",{children:Y.t("instructionPanel.MoveForwardBack",i)}),":"," ",Y.t("instructionPanel.MoveForwardBackInstruction",i)]}),h.jsxs("span",{children:[h.jsx("b",{children:Y.t("instructionPanel.MoveLeftRight",i)}),":"," ",Y.t("instructionPanel.MoveLeftRightInstruction",i)]}),h.jsxs("span",{children:[h.jsx("b",{children:Y.t("instructionPanel.MoveUpDown",i)}),":"," ",Y.t("instructionPanel.MoveUpDownInstruction",i)]}),h.jsxs("span",{children:[h.jsx("b",{children:Y.t("instructionPanel.Turn",i)}),": ",Y.t("instructionPanel.TurnInstruction",i)]})]}),!o&&!r&&h.jsxs("span",{children:[h.jsx("b",{children:Y.t("instructionPanel.Rotate",i)}),": ",Y.t("instructionPanel.DragMouse",i)]}),!r&&h.jsxs(h.Fragment,{children:[h.jsxs("span",{children:[h.jsx("b",{children:Y.t("instructionPanel.Zoom",i)}),":"," ",Y.t(l?"instructionPanel.MouseWheelOrKeysMac":"instructionPanel.MouseWheelOrKeys",i)]}),h.jsxs("span",{children:[h.jsx("b",{children:Y.t("instructionPanel.Pan",i)}),":"," ",Y.t(l?"instructionPanel.HoldMetaDragMouse":"instructionPanel.HoldCtrlDragMouse",i)]}),h.jsxs("span",{children:[h.jsx("b",{children:Y.t(o?"instructionPanel.Exit2DMode":"instructionPanel.Enter2DMode",i)}),":"," ",Y.t("word.Press",i)," ",l?"⌘":"Ctrl","+B"]})]})]})})}),gNo=Ro.div` position: fixed; top: 85px; right: 36px; @@ -8850,7 +8850,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,ANo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=H(IH)??6,i=new Date(H(rl)),a=Tn($7t),l=H(JYe),s=Tn(KYe),c=H(jg),u=H(Q4t),d=ht(n5),f=H.getState().economicsParams,p=ht(Rf),g=H(Pc),y=be.useRef(null),w=m.useRef(null),b=w.current?w.current.clientWidth+40:640,C=w.current?w.current.clientHeight+100:500,[P,v]=m.useState({x:u?Math.max(u.x,b-window.innerWidth):0,y:u?Math.min(u.y,window.innerHeight-C):0}),[T,A]=m.useState(0),x=m.useRef(new Map),S=m.useRef(),R=Ms[i.getMonth()],M=Jt(),D=c(z.SolarPanel);m.useEffect(()=>{let Q=0;x.current.clear();for(const le of a)for(const q in le)Object.hasOwn(le,q)&&q!=="Month"&&(Q+=le[q],x.current.set(q,(x.current.get(q)??0)+le[q]));A(Q)},[a]),m.useEffect(()=>{v({x:Math.max(u==null?void 0:u.x,b-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-C)})},[u,b,C]),m.useEffect(()=>{const Q=()=>{v({x:Math.max(u==null?void 0:u.x,b-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-C)})};return window.addEventListener("resize",Q),()=>{window.removeEventListener("resize",Q)}},[u,b,C]),m.useEffect(()=>(w.current&&(S.current||(S.current=new ResizeObserver(()=>{o(Q=>{w.current&&(Q.viewState.yearlyPvYieldPanelRect||(Q.viewState.yearlyPvYieldPanelRect=new cr(0,0,600,400)),Q.viewState.yearlyPvYieldPanelRect.width=w.current.offsetWidth,Q.viewState.yearlyPvYieldPanelRect.height=w.current.offsetHeight)})})),S.current.observe(w.current)),()=>{var Q;(Q=S.current)==null||Q.disconnect()}),[]);const E=(Q,le)=>{v({x:Math.max(le.x,b-window.innerWidth),y:Math.min(le.y,window.innerHeight-C)})},W=(Q,le)=>{o(q=>{q.viewState.yearlyPvYieldPanelRect||(q.viewState.yearlyPvYieldPanelRect=new cr(0,0,600,400)),q.viewState.yearlyPvYieldPanelRect.x=Math.max(le.x,b-window.innerWidth),q.viewState.yearlyPvYieldPanelRect.y=Math.min(le.y,window.innerHeight-C)})},j=()=>{o(Q=>{Q.viewState.showYearlyPvYieldPanel=!1,e&&(Q.actionInfo={name:"Close Solar Panel Yearly Yield Graph",timestamp:new Date().getTime()})})};m.useEffect(()=>{D<2&&l&&o(Q=>{Q.graphState&&(Q.graphState.yearlyPvIndividualOutputs=!1)})},[D,l]);const{t:L}=Vl(),k=L("word.Month",M),N=L("solarPanelYieldPanel.Yield",M),F=me.countAllSolarPanels(),U=12/r,O=T*U,B=F*f.operationalCostPerUnit*365,_=O*f.electricitySellingPrice,X=_-B,$=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:y,handle:".handle",bounds:"parent",axis:"both",position:P,onDrag:E,onStop:W,onMouseDown:()=>{o(Q=>{Q.selectedFloatingWindow="yearlyPvYieldPanel"})},children:h.jsx(gNo,{ref:y,style:{zIndex:g==="yearlyPvYieldPanel"?Sc:9},children:h.jsxs(mNo,{ref:w,style:{opacity:n,width:(u?u.width:600)+"px",height:(u?u.height:400)+"px"},children:[h.jsxs(yNo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[L("solarPanelYieldPanel.SolarPanelYearlyYield",M)+": ",h.jsx("span",{style:{fontSize:"10px"},children:L("sensorPanel.WeatherDataFrom",M)+" "+t+" | "+i.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{j()},onMouseDown:()=>{j()},children:L("word.Close",M)})]}),h.jsx(Tf,{type:vi.YearlyPvYield,chartType:l?Ml.Line:Ml.Area,dataSource:a.map(({Daylight:Q,Clearness:le,...q})=>q),labels:s,height:100,dataKeyAxisX:"Month",labelX:k,labelY:N,unitY:L("word.kWh",M),yMin:0,curveType:"linear",fractionDigits:2,referenceX:R}),!p&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&D>1&&x.current.size>0?h.jsx(Al,{title:L("shared.OutputBreakdown",M),content:[...x.current.entries()].map((Q,le)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:Q[0]+": "}),h.jsx(nt,{span:8,children:(Q[1]*U).toFixed(2)})]}),le===x.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:L("word.Total",M)+": "+O.toFixed(2)+" "+L("word.kWh",M)})]})]},le)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:L("shared.OutputBreakdown",M)})}):h.jsxs(h.Fragment,{children:[O>0&&h.jsx(en,{children:L("solarPanelYieldPanel.YearlyTotal",M)+": "+O.toFixed(2)+" "+L("word.kWh",M)}),O>0&&h.jsx(Al,{title:L("shared.MoreResults",M),content:h.jsxs(h.Fragment,{children:[h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:L("solarPanelYieldPanel.ModuleCount",M)+": "}),h.jsx(nt,{span:10,children:F})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:L("solarPanelYieldPanel.MeanYield",M)+": "}),h.jsxs(nt,{span:10,children:[(O/F).toFixed(2)," kWh"]})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:L("solarPanelYieldPanel.TotalCost",M)+": "}),h.jsxs(nt,{span:10,children:["$",B.toFixed(2)]})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:L("solarPanelYieldPanel.TotalRevenue",M)+": "}),h.jsxs(nt,{span:10,children:["$",_.toFixed(2)]})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:L("solarPanelYieldPanel.Profit",M)+": "}),h.jsx(nt,{span:10,children:(X>0?"$":"-$")+Math.abs(X).toFixed(2)})]})]}),children:h.jsx(lo,{type:"default",children:L("shared.MoreResults",M)})})]}),!d&&h.jsxs(h.Fragment,{children:[D>1&&h.jsx(xc,{title:L("solarPanelYieldPanel.ShowOutputsOfIndividualSolarPanels",M),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:Q=>{if(D===0){hn(L("analysisManager.NoSolarPanelForAnalysis",M));return}hn(L("message.SimulationStarted",M)),setTimeout(()=>{o(le=>{le.graphState&&(le.graphState.yearlyPvIndividualOutputs=Q),e&&(le.actionInfo={name:"Run Yearly Simulation For Solar Panels: "+(Q?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(le=>{le.simulationInProgress=!0,le.runYearlySimulationForSolarPanels=!0,le.pauseYearlySimulationForSolarPanels=!1})},100)}}),h.jsx(lo,{type:"default",icon:$?h.jsx(Sh,{}):h.jsx(Hf,{}),title:L($?"word.Run":"word.Update",M),onClick:()=>{if(D===0){hn(L("analysisManager.NoSolarPanelForAnalysis",M));return}hn(L("message.SimulationStarted",M)),setTimeout(()=>{o(Q=>{e&&(Q.actionInfo={name:"Run Yearly Simulation For Solar Panels",timestamp:new Date().getTime()})}),ht.getState().set(Q=>{Q.simulationInProgress=!0,Q.runYearlySimulationForSolarPanels=!0,Q.pauseYearlySimulationForSolarPanels=!1})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:L("word.SaveAsImage",M),onClick:()=>{kd("line-graph-"+k+"-"+N,"yearly-pv-yield").then(()=>{hn(L("message.ScreenshotSaved",M)),e&&o(Q=>{Q.actionInfo={name:"Take Screenshot of Solar Panel Yearly Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:L("word.SaveAsCsv",M),onClick:()=>{bh(a,"yearly-pv-yield.csv"),hn(L("message.CsvFileSaved",M)),e&&o(Q=>{Q.actionInfo={name:"Export Solar Panel Yearly Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})]})})})}),wNo=Ro.div` +`,ANo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=H(IH)??6,i=new Date(H(rl)),a=Tn($7t),l=H(JYe),s=Tn(KYe),c=H(jg),u=H(Q4t),d=ht(n5),f=H.getState().economicsParams,p=ht(Rf),g=H(Pc),y=be.useRef(null),w=m.useRef(null),b=w.current?w.current.clientWidth+40:640,C=w.current?w.current.clientHeight+100:500,[P,v]=m.useState({x:u?Math.max(u.x,b-window.innerWidth):0,y:u?Math.min(u.y,window.innerHeight-C):0}),[T,A]=m.useState(0),x=m.useRef(new Map),S=m.useRef(),R=Ms[i.getMonth()],M=Jt(),D=c(z.SolarPanel);m.useEffect(()=>{let Q=0;x.current.clear();for(const le of a)for(const q in le)Object.hasOwn(le,q)&&q!=="Month"&&(Q+=le[q],x.current.set(q,(x.current.get(q)??0)+le[q]));A(Q)},[a]),m.useEffect(()=>{v({x:Math.max(u==null?void 0:u.x,b-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-C)})},[u,b,C]),m.useEffect(()=>{const Q=()=>{v({x:Math.max(u==null?void 0:u.x,b-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-C)})};return window.addEventListener("resize",Q),()=>{window.removeEventListener("resize",Q)}},[u,b,C]),m.useEffect(()=>(w.current&&(S.current||(S.current=new ResizeObserver(()=>{o(Q=>{w.current&&(Q.viewState.yearlyPvYieldPanelRect||(Q.viewState.yearlyPvYieldPanelRect=new cr(0,0,600,400)),Q.viewState.yearlyPvYieldPanelRect.width=w.current.offsetWidth,Q.viewState.yearlyPvYieldPanelRect.height=w.current.offsetHeight)})})),S.current.observe(w.current)),()=>{var Q;(Q=S.current)==null||Q.disconnect()}),[]);const E=(Q,le)=>{v({x:Math.max(le.x,b-window.innerWidth),y:Math.min(le.y,window.innerHeight-C)})},W=(Q,le)=>{o(q=>{q.viewState.yearlyPvYieldPanelRect||(q.viewState.yearlyPvYieldPanelRect=new cr(0,0,600,400)),q.viewState.yearlyPvYieldPanelRect.x=Math.max(le.x,b-window.innerWidth),q.viewState.yearlyPvYieldPanelRect.y=Math.min(le.y,window.innerHeight-C)})},j=()=>{o(Q=>{Q.viewState.showYearlyPvYieldPanel=!1,e&&(Q.actionInfo={name:"Close Solar Panel Yearly Yield Graph",timestamp:new Date().getTime()})})};m.useEffect(()=>{D<2&&l&&o(Q=>{Q.graphState&&(Q.graphState.yearlyPvIndividualOutputs=!1)})},[D,l]);const{t:L}=Vl(),k=L("word.Month",M),N=L("solarPanelYieldPanel.Yield",M),F=me.countAllSolarPanels(),U=12/r,O=T*U,B=F*f.operationalCostPerUnit*365,_=O*f.electricitySellingPrice,X=_-B,$=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:y,handle:".handle",bounds:"parent",axis:"both",position:P,onDrag:E,onStop:W,onMouseDown:()=>{o(Q=>{Q.selectedFloatingWindow="yearlyPvYieldPanel"})},children:h.jsx(gNo,{ref:y,style:{zIndex:g==="yearlyPvYieldPanel"?Sc:9},children:h.jsxs(mNo,{ref:w,style:{opacity:n,width:(u?u.width:600)+"px",height:(u?u.height:400)+"px"},children:[h.jsxs(yNo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[L("solarPanelYieldPanel.SolarPanelYearlyYield",M)+": ",h.jsx("span",{style:{fontSize:"10px"},children:L("sensorPanel.WeatherDataFrom",M)+" "+t+" | "+i.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{j()},onMouseDown:()=>{j()},children:L("word.Close",M)})]}),h.jsx(Tf,{type:vi.YearlyPvYield,chartType:l?Ml.Line:Ml.Area,dataSource:a.map(({Daylight:Q,Clearness:le,...q})=>q),labels:s,height:100,dataKeyAxisX:"Month",labelX:k,labelY:N,unitY:L("word.kWh",M),yMin:0,curveType:"linear",fractionDigits:2,referenceX:R}),!p&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&D>1&&x.current.size>0?h.jsx(Al,{title:L("shared.OutputBreakdown",M),content:[...x.current.entries()].map((Q,le)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:Q[0]+": "}),h.jsx(nt,{span:8,children:(Q[1]*U).toFixed(2)})]}),le===x.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:L("word.Total",M)+": "+O.toFixed(2)+" "+L("word.kWh",M)})]})]},le)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:L("shared.OutputBreakdown",M)})}):h.jsxs(h.Fragment,{children:[O>0&&h.jsx(en,{children:L("solarPanelYieldPanel.YearlyTotal",M)+": "+O.toFixed(2)+" "+L("word.kWh",M)}),O>0&&h.jsx(Al,{title:L("shared.MoreResults",M),content:h.jsxs(h.Fragment,{children:[h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:L("solarPanelYieldPanel.ModuleCount",M)+": "}),h.jsx(nt,{span:10,children:F})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:L("solarPanelYieldPanel.MeanYield",M)+": "}),h.jsxs(nt,{span:10,children:[(O/F).toFixed(2)," kWh"]})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:L("solarPanelYieldPanel.TotalCost",M)+": "}),h.jsxs(nt,{span:10,children:["$",B.toFixed(2)]})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:L("solarPanelYieldPanel.TotalRevenue",M)+": "}),h.jsxs(nt,{span:10,children:["$",_.toFixed(2)]})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:L("solarPanelYieldPanel.Profit",M)+": "}),h.jsx(nt,{span:10,children:(X>0?"$":"-$")+Math.abs(X).toFixed(2)})]})]}),children:h.jsx(lo,{type:"default",children:L("shared.MoreResults",M)})})]}),!d&&h.jsxs(h.Fragment,{children:[D>1&&h.jsx(xc,{title:L("solarPanelYieldPanel.ShowOutputsOfIndividualSolarPanels",M),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:Q=>{if(D===0){hn(L("analysisManager.NoSolarPanelForAnalysis",M));return}hn(L("message.SimulationStarted",M)),setTimeout(()=>{o(le=>{le.graphState&&(le.graphState.yearlyPvIndividualOutputs=Q),e&&(le.actionInfo={name:"Run Yearly Simulation For Solar Panels: "+(Q?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(le=>{le.simulationInProgress=!0,le.runYearlySimulationForSolarPanels=!0,le.pauseYearlySimulationForSolarPanels=!1})},100)}}),h.jsx(lo,{type:"default",icon:$?h.jsx(Sh,{}):h.jsx(Hf,{}),title:L($?"word.Run":"word.Update",M),onClick:()=>{if(D===0){hn(L("analysisManager.NoSolarPanelForAnalysis",M));return}hn(L("message.SimulationStarted",M)),setTimeout(()=>{o(Q=>{e&&(Q.actionInfo={name:"Run Yearly Simulation For Solar Panels",timestamp:new Date().getTime()})}),ht.getState().set(Q=>{Q.simulationInProgress=!0,Q.runYearlySimulationForSolarPanels=!0,Q.pauseYearlySimulationForSolarPanels=!1})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:L("word.SaveAsImage",M),onClick:()=>{kd("line-graph-"+k+"-"+N,"yearly-pv-yield").then(()=>{hn(L("message.ScreenshotSaved",M)),e&&o(Q=>{Q.actionInfo={name:"Take Screenshot of Solar Panel Yearly Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:L("word.SaveAsCsv",M),onClick:()=>{bh(a,"yearly-pv-yield.csv"),hn(L("message.CsvFileSaved",M)),e&&o(Q=>{Q.actionInfo={name:"Export Solar Panel Yearly Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})]})})})}),wNo=Ro.div` position: fixed; top: 80px; right: 24px; @@ -8888,7 +8888,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,bNo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=H(jg),a=Tn(K7t),l=H(XYe),s=H(q4t),c=Tn(KYe),u=ht(n5),d=H.getState().economicsParams,f=ht(Rf),p=H(Pc),g=be.useRef(null),y=m.useRef(null),w=y.current?y.current.offsetWidth+40:s?s.width+40:640,b=y.current?y.current.offsetHeight+100:s?s.height+100:500,[C,P]=m.useState({x:s?Math.max(s.x,w-window.innerWidth):0,y:s?Math.min(s.y,window.innerHeight-b):0}),[v,T]=m.useState(0),A=m.useRef(new Map),x=m.useRef(),S=Jt();m.useEffect(()=>{let B=0;A.current.clear();for(const _ of a)for(const X in _)Object.hasOwn(_,X)&&X!=="Hour"&&(B+=_[X],A.current.set(X,(A.current.get(X)??0)+_[X]));T(B)},[a]),m.useEffect(()=>{P({x:Math.max(s==null?void 0:s.x,w-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-b)})},[s,w,b]),m.useEffect(()=>{const B=()=>{P({x:Math.max(s==null?void 0:s.x,w-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-b)})};return window.addEventListener("resize",B),()=>{window.removeEventListener("resize",B)}},[s,w,b]),m.useEffect(()=>(y.current&&(x.current||(x.current=new ResizeObserver(()=>{o(B=>{y.current&&(B.viewState.dailyPvYieldPanelRect||(B.viewState.dailyPvYieldPanelRect=new cr(0,0,600,400)),B.viewState.dailyPvYieldPanelRect.width=y.current.offsetWidth,B.viewState.dailyPvYieldPanelRect.height=y.current.offsetHeight)})})),x.current.observe(y.current)),()=>{var B;(B=x.current)==null||B.disconnect()}),[]);const R=(B,_)=>{P({x:Math.max(_.x,w-window.innerWidth),y:Math.min(_.y,window.innerHeight-b)})},M=(B,_)=>{o(X=>{X.viewState.dailyPvYieldPanelRect||(X.viewState.dailyPvYieldPanelRect=new cr(0,0,600,400)),X.viewState.dailyPvYieldPanelRect.x=Math.max(_.x,w-window.innerWidth),X.viewState.dailyPvYieldPanelRect.y=Math.min(_.y,window.innerHeight-b)})},D=()=>{o(B=>{B.viewState.showDailyPvYieldPanel=!1,e&&(B.actionInfo={name:"Close Solar Panel Daily Yield Graph",timestamp:new Date().getTime()})})},E=i(z.SolarPanel);m.useEffect(()=>{E<2&&l&&o(B=>{B.graphState&&(B.graphState.dailyPvIndividualOutputs=!1)})},[E,l]);const{t:W}=Vl(),j=W("word.Hour",S),L=W("solarPanelYieldPanel.YieldPerHour",S),k=me.countAllSolarPanels(),N=k*d.operationalCostPerUnit,F=v*d.electricitySellingPrice,U=F-N,O=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:g,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:R,onStop:M,onMouseDown:()=>{o(B=>{B.selectedFloatingWindow="dailyPvYieldPanel"})},children:h.jsx(wNo,{ref:g,style:{zIndex:p==="dailyPvYieldPanel"?Sc:9},children:h.jsxs(vNo,{ref:y,style:{opacity:n,width:(s?s.width:600)+"px",height:(s?s.height:400)+"px"},children:[h.jsxs(xNo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[W("solarPanelYieldPanel.SolarPanelDailyYield",S)+": ",h.jsx("span",{style:{fontSize:"10px"},children:W("sensorPanel.WeatherDataFrom",S)+" "+t+" | "+yr(r).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{D()},onMouseDown:()=>{D()},children:W("word.Close",S)})]}),h.jsx(Tf,{type:vi.DailyPvYield,chartType:l?Ml.Line:Ml.Area,dataSource:a,labels:c,height:100,dataKeyAxisX:"Hour",labelX:j,labelY:L,unitY:W("word.kWh",S),yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),!f&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&E>1&&A.current.size>0?h.jsx(Al,{title:W("shared.OutputBreakdown",S),content:[...A.current.entries()].map((B,_)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:B[0]+": "}),h.jsx(nt,{span:8,children:B[1].toFixed(3)})]}),_===A.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:W("word.Total",S)+": "+v.toFixed(3)+" "+W("word.kWh",S)})]})]},_)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:W("shared.OutputBreakdown",S)})}):h.jsxs(h.Fragment,{children:[v>0&&h.jsx(en,{style:{cursor:"default"},children:W("solarPanelYieldPanel.DailyTotal",S)+": "+v.toFixed(3)+" "+W("word.kWh",S)}),v>0&&h.jsx(Al,{title:W("shared.MoreResults",S),content:h.jsxs(h.Fragment,{children:[h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:W("solarPanelYieldPanel.ModuleCount",S)+": "}),h.jsx(nt,{span:10,children:k})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:W("solarPanelYieldPanel.MeanYield",S)+": "}),h.jsxs(nt,{span:10,children:[(v/k).toFixed(2)," kWh"]})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:W("solarPanelYieldPanel.TotalCost",S)+": "}),h.jsxs(nt,{span:10,children:["$",N.toFixed(2)]})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:W("solarPanelYieldPanel.TotalRevenue",S)+": "}),h.jsxs(nt,{span:10,children:["$",F.toFixed(2)]})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:W("solarPanelYieldPanel.Profit",S)+": "}),h.jsx(nt,{span:10,children:(U>0?"$":"-$")+Math.abs(U).toFixed(2)})]})]}),children:h.jsx(lo,{type:"default",children:W("shared.MoreResults",S)})})]}),!u&&h.jsxs(h.Fragment,{children:[E>1&&h.jsx(xc,{title:W("solarPanelYieldPanel.ShowOutputsOfIndividualSolarPanels",S),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:B=>{if(E===0){hn(W("analysisManager.NoSolarPanelForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.dailyPvIndividualOutputs=B),e&&(_.actionInfo={name:"Run Daily Simulation For Solar Panels: "+(B?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailySimulationForSolarPanels=!0,_.pauseDailySimulationForSolarPanels=!1})},100)}}),h.jsx(lo,{type:"default",icon:O?h.jsx(Sh,{}):h.jsx(Hf,{}),title:W(O?"word.Run":"word.Update",S),onClick:()=>{if(E===0){hn(W("analysisManager.NoSolarPanelForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(B=>{e&&(B.actionInfo={name:"Run Daily Simulation For Solar Panels",timestamp:new Date().getTime()})}),ht.getState().set(B=>{B.simulationInProgress=!0,B.runDailySimulationForSolarPanels=!0,B.pauseDailySimulationForSolarPanels=!1})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:W("word.SaveAsImage",S),onClick:()=>{kd("line-graph-"+j+"-"+L,"daily-pv-yield").then(()=>{hn(W("message.ScreenshotSaved",S)),e&&o(B=>{B.actionInfo={name:"Take Screenshot of Solar Panel Daily Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:W("word.SaveAsCsv",S),onClick:()=>{bh(a,"daily-pv-yield.csv"),hn(W("message.CsvFileSaved",S)),e&&o(B=>{B.actionInfo={name:"Export Solar Panel Daily Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})]})})})}),SNo="/aladdin/assets/light_bulb-D1RiLhYG.png",TNo="/aladdin/assets/diameter-CQ4-OfKR.png",PNo="/aladdin/assets/area-C8e5STKh.png",CNo=Ro.div` +`,bNo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=H(jg),a=Tn(K7t),l=H(XYe),s=H(q4t),c=Tn(KYe),u=ht(n5),d=H.getState().economicsParams,f=ht(Rf),p=H(Pc),g=be.useRef(null),y=m.useRef(null),w=y.current?y.current.offsetWidth+40:s?s.width+40:640,b=y.current?y.current.offsetHeight+100:s?s.height+100:500,[C,P]=m.useState({x:s?Math.max(s.x,w-window.innerWidth):0,y:s?Math.min(s.y,window.innerHeight-b):0}),[v,T]=m.useState(0),A=m.useRef(new Map),x=m.useRef(),S=Jt();m.useEffect(()=>{let B=0;A.current.clear();for(const _ of a)for(const X in _)Object.hasOwn(_,X)&&X!=="Hour"&&(B+=_[X],A.current.set(X,(A.current.get(X)??0)+_[X]));T(B)},[a]),m.useEffect(()=>{P({x:Math.max(s==null?void 0:s.x,w-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-b)})},[s,w,b]),m.useEffect(()=>{const B=()=>{P({x:Math.max(s==null?void 0:s.x,w-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-b)})};return window.addEventListener("resize",B),()=>{window.removeEventListener("resize",B)}},[s,w,b]),m.useEffect(()=>(y.current&&(x.current||(x.current=new ResizeObserver(()=>{o(B=>{y.current&&(B.viewState.dailyPvYieldPanelRect||(B.viewState.dailyPvYieldPanelRect=new cr(0,0,600,400)),B.viewState.dailyPvYieldPanelRect.width=y.current.offsetWidth,B.viewState.dailyPvYieldPanelRect.height=y.current.offsetHeight)})})),x.current.observe(y.current)),()=>{var B;(B=x.current)==null||B.disconnect()}),[]);const R=(B,_)=>{P({x:Math.max(_.x,w-window.innerWidth),y:Math.min(_.y,window.innerHeight-b)})},M=(B,_)=>{o(X=>{X.viewState.dailyPvYieldPanelRect||(X.viewState.dailyPvYieldPanelRect=new cr(0,0,600,400)),X.viewState.dailyPvYieldPanelRect.x=Math.max(_.x,w-window.innerWidth),X.viewState.dailyPvYieldPanelRect.y=Math.min(_.y,window.innerHeight-b)})},D=()=>{o(B=>{B.viewState.showDailyPvYieldPanel=!1,e&&(B.actionInfo={name:"Close Solar Panel Daily Yield Graph",timestamp:new Date().getTime()})})},E=i(z.SolarPanel);m.useEffect(()=>{E<2&&l&&o(B=>{B.graphState&&(B.graphState.dailyPvIndividualOutputs=!1)})},[E,l]);const{t:W}=Vl(),j=W("word.Hour",S),L=W("solarPanelYieldPanel.YieldPerHour",S),k=me.countAllSolarPanels(),N=k*d.operationalCostPerUnit,F=v*d.electricitySellingPrice,U=F-N,O=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:g,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:R,onStop:M,onMouseDown:()=>{o(B=>{B.selectedFloatingWindow="dailyPvYieldPanel"})},children:h.jsx(wNo,{ref:g,style:{zIndex:p==="dailyPvYieldPanel"?Sc:9},children:h.jsxs(vNo,{ref:y,style:{opacity:n,width:(s?s.width:600)+"px",height:(s?s.height:400)+"px"},children:[h.jsxs(xNo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[W("solarPanelYieldPanel.SolarPanelDailyYield",S)+": ",h.jsx("span",{style:{fontSize:"10px"},children:W("sensorPanel.WeatherDataFrom",S)+" "+t+" | "+yr(r).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{D()},onMouseDown:()=>{D()},children:W("word.Close",S)})]}),h.jsx(Tf,{type:vi.DailyPvYield,chartType:l?Ml.Line:Ml.Area,dataSource:a,labels:c,height:100,dataKeyAxisX:"Hour",labelX:j,labelY:L,unitY:W("word.kWh",S),yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),!f&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&E>1&&A.current.size>0?h.jsx(Al,{title:W("shared.OutputBreakdown",S),content:[...A.current.entries()].map((B,_)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:B[0]+": "}),h.jsx(nt,{span:8,children:B[1].toFixed(3)})]}),_===A.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:W("word.Total",S)+": "+v.toFixed(3)+" "+W("word.kWh",S)})]})]},_)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:W("shared.OutputBreakdown",S)})}):h.jsxs(h.Fragment,{children:[v>0&&h.jsx(en,{style:{cursor:"default"},children:W("solarPanelYieldPanel.DailyTotal",S)+": "+v.toFixed(3)+" "+W("word.kWh",S)}),v>0&&h.jsx(Al,{title:W("shared.MoreResults",S),content:h.jsxs(h.Fragment,{children:[h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:W("solarPanelYieldPanel.ModuleCount",S)+": "}),h.jsx(nt,{span:10,children:k})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:W("solarPanelYieldPanel.MeanYield",S)+": "}),h.jsxs(nt,{span:10,children:[(v/k).toFixed(2)," kWh"]})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:W("solarPanelYieldPanel.TotalCost",S)+": "}),h.jsxs(nt,{span:10,children:["$",N.toFixed(2)]})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:W("solarPanelYieldPanel.TotalRevenue",S)+": "}),h.jsxs(nt,{span:10,children:["$",F.toFixed(2)]})]}),h.jsxs(on,{style:{width:"200px"},children:[h.jsx(nt,{span:14,children:W("solarPanelYieldPanel.Profit",S)+": "}),h.jsx(nt,{span:10,children:(U>0?"$":"-$")+Math.abs(U).toFixed(2)})]})]}),children:h.jsx(lo,{type:"default",children:W("shared.MoreResults",S)})})]}),!u&&h.jsxs(h.Fragment,{children:[E>1&&h.jsx(xc,{title:W("solarPanelYieldPanel.ShowOutputsOfIndividualSolarPanels",S),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:B=>{if(E===0){hn(W("analysisManager.NoSolarPanelForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(_=>{_.graphState&&(_.graphState.dailyPvIndividualOutputs=B),e&&(_.actionInfo={name:"Run Daily Simulation For Solar Panels: "+(B?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(_=>{_.simulationInProgress=!0,_.runDailySimulationForSolarPanels=!0,_.pauseDailySimulationForSolarPanels=!1})},100)}}),h.jsx(lo,{type:"default",icon:O?h.jsx(Sh,{}):h.jsx(Hf,{}),title:W(O?"word.Run":"word.Update",S),onClick:()=>{if(E===0){hn(W("analysisManager.NoSolarPanelForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(B=>{e&&(B.actionInfo={name:"Run Daily Simulation For Solar Panels",timestamp:new Date().getTime()})}),ht.getState().set(B=>{B.simulationInProgress=!0,B.runDailySimulationForSolarPanels=!0,B.pauseDailySimulationForSolarPanels=!1})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:W("word.SaveAsImage",S),onClick:()=>{kd("line-graph-"+j+"-"+L,"daily-pv-yield").then(()=>{hn(W("message.ScreenshotSaved",S)),e&&o(B=>{B.actionInfo={name:"Take Screenshot of Solar Panel Daily Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:W("word.SaveAsCsv",S),onClick:()=>{bh(a,"daily-pv-yield.csv"),hn(W("message.CsvFileSaved",S)),e&&o(B=>{B.actionInfo={name:"Export Solar Panel Daily Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})]})})})}),SNo="/aladdin/assets/light_bulb-D1RiLhYG.png",TNo="/aladdin/assets/diameter-CQ4-OfKR.png",PNo="/aladdin/assets/area-C8e5STKh.png",CNo=Ro.div` position: absolute; bottom: 40px; left: 0; @@ -8917,7 +8917,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; font-size: 12px; flex-direction: column; opacity: 100%; -`,HNo=be.memo(()=>{const t=H(Kn),e=H(jg),n=H(d7t),o=H(qr),r=H(Dw),i=H(Ug),a=H(Qq),l=H(b=>b.selectedElement===null?null:b.elements.find(C=>{var P;return C.id===((P=b.selectedElement)==null?void 0:P.id)}));let s=0,c=0,u=0;if(l)if(l.type===z.SolarPanel)s=n(l.id),c=l.dailyYield??0;else if(l.type===z.Polygon){const b=o(l);b&&(s=me.countAllChildSolarPanels(b.id),c=me.countAllChildSolarPanelDailyYields(b.id))}else s=me.countAllChildSolarPanels(l.id),c=me.countAllChildSolarPanelDailyYields(l.id),u=me.countAllChildElementsByType(l.id,z.Heliostat);else s=me.countAllSolarPanels(),c=me.countAllSolarPanelDailyYields(),u=e(z.Heliostat);const d=Jt(),f=r.y>0,p=f?"navajowhite":"antiquewhite",g=f?"invert(85%) sepia(45%) saturate(335%) hue-rotate(329deg) brightness(100%) contrast(101%)":"invert(95%) sepia(7%) saturate(1598%) hue-rotate(312deg) brightness(106%) contrast(96%)",y=l&&l.type===z.Foundation&&!l.notBuilding&&me.getBuildingCompletionStatus(l,t)===jc.COMPLETE,w=m.useRef(null);return m.useEffect(()=>{w.current&&Fn.setState({solarPanelCountRef:w})},[s]),h.jsx(CNo,{children:h.jsx(RNo,{$projectView:a,children:h.jsxs(en,{direction:"horizontal",style:{color:p,fontSize:"10px"},children:[s>0&&h.jsxs(h.Fragment,{children:[h.jsx("img",{alt:"Solar panel count",title:Y.t("designInfoPanel.NumberOfSelectedSolarPanels",d),src:xfe,height:24,width:36,style:{paddingLeft:"10px",cursor:"pointer",filter:"invert(100%) "}}),h.jsx("span",{ref:w,children:s})]}),u>0&&h.jsxs(h.Fragment,{children:[h.jsx("img",{alt:"Heliostat count",title:Y.t("designInfoPanel.NumberOfSelectedHeliostats",d),src:bfe,height:24,width:36,style:{paddingLeft:"10px",marginTop:"4px",marginBottom:"4px",cursor:"pointer",filter:"invert(100%) "}}),h.jsx("span",{children:u})]}),c>0&&h.jsxs(h.Fragment,{children:[h.jsx("img",{title:Y.t("designInfoPanel.ElectricityGeneratedDailyBySolarPanels",d),alt:"Electricity",src:SNo,height:24,width:24,style:{filter:g,marginLeft:"10px",marginTop:"4px",marginBottom:"4px",cursor:"pointer",verticalAlign:"middle"}}),h.jsx("span",{children:c.toFixed(1)+" "+Y.t("word.kWh",d)})]}),!l&&h.jsxs(h.Fragment,{children:[h.jsx("img",{title:Y.t("designInfoPanel.SceneDiameter",d),alt:"Diameter",src:TNo,height:20,width:20,style:{filter:g,marginLeft:"10px",marginTop:"4px",marginBottom:"4px",cursor:"pointer",verticalAlign:"middle"}}),h.jsx("span",{children:i*2+" "+Y.t("word.MeterAbbreviation",d)})]}),y&&h.jsxs(h.Fragment,{children:[h.jsx("img",{title:Y.t("designInfoPanel.BuildingArea",d),alt:"Area",src:PNo,height:20,width:20,style:{filter:g,marginLeft:"10px",marginTop:"4px",marginBottom:"4px",cursor:"pointer",verticalAlign:"middle"}}),h.jsxs("span",{children:[me.getBuildingArea(l,t).toFixed(2)+" "+Y.t("word.MeterAbbreviation",d),h.jsx("sup",{children:"2"})]})]})]})})})}),MNo="/aladdin/assets/location-_zTaloy5.png",INo="/aladdin/assets/date-Dqo8FDne.png",zNo="/aladdin/assets/thermometer-B30VcfuL.png",DNo=Ro.div` +`,HNo=be.memo(()=>{const t=H(Kn),e=H(jg),n=H(d7t),o=H(qr),r=H(Dw),i=H(Ug),a=H(SW),l=H(b=>b.selectedElement===null?null:b.elements.find(C=>{var P;return C.id===((P=b.selectedElement)==null?void 0:P.id)}));let s=0,c=0,u=0;if(l)if(l.type===z.SolarPanel)s=n(l.id),c=l.dailyYield??0;else if(l.type===z.Polygon){const b=o(l);b&&(s=me.countAllChildSolarPanels(b.id),c=me.countAllChildSolarPanelDailyYields(b.id))}else s=me.countAllChildSolarPanels(l.id),c=me.countAllChildSolarPanelDailyYields(l.id),u=me.countAllChildElementsByType(l.id,z.Heliostat);else s=me.countAllSolarPanels(),c=me.countAllSolarPanelDailyYields(),u=e(z.Heliostat);const d=Jt(),f=r.y>0,p=f?"navajowhite":"antiquewhite",g=f?"invert(85%) sepia(45%) saturate(335%) hue-rotate(329deg) brightness(100%) contrast(101%)":"invert(95%) sepia(7%) saturate(1598%) hue-rotate(312deg) brightness(106%) contrast(96%)",y=l&&l.type===z.Foundation&&!l.notBuilding&&me.getBuildingCompletionStatus(l,t)===jc.COMPLETE,w=m.useRef(null);return m.useEffect(()=>{w.current&&Fn.setState({solarPanelCountRef:w})},[s]),h.jsx(CNo,{children:h.jsx(RNo,{$projectView:a,children:h.jsxs(en,{direction:"horizontal",style:{color:p,fontSize:"10px"},children:[s>0&&h.jsxs(h.Fragment,{children:[h.jsx("img",{alt:"Solar panel count",title:Y.t("designInfoPanel.NumberOfSelectedSolarPanels",d),src:xfe,height:24,width:36,style:{paddingLeft:"10px",cursor:"pointer",filter:"invert(100%) "}}),h.jsx("span",{ref:w,children:s})]}),u>0&&h.jsxs(h.Fragment,{children:[h.jsx("img",{alt:"Heliostat count",title:Y.t("designInfoPanel.NumberOfSelectedHeliostats",d),src:bfe,height:24,width:36,style:{paddingLeft:"10px",marginTop:"4px",marginBottom:"4px",cursor:"pointer",filter:"invert(100%) "}}),h.jsx("span",{children:u})]}),c>0&&h.jsxs(h.Fragment,{children:[h.jsx("img",{title:Y.t("designInfoPanel.ElectricityGeneratedDailyBySolarPanels",d),alt:"Electricity",src:SNo,height:24,width:24,style:{filter:g,marginLeft:"10px",marginTop:"4px",marginBottom:"4px",cursor:"pointer",verticalAlign:"middle"}}),h.jsx("span",{children:c.toFixed(1)+" "+Y.t("word.kWh",d)})]}),!l&&h.jsxs(h.Fragment,{children:[h.jsx("img",{title:Y.t("designInfoPanel.SceneDiameter",d),alt:"Diameter",src:TNo,height:20,width:20,style:{filter:g,marginLeft:"10px",marginTop:"4px",marginBottom:"4px",cursor:"pointer",verticalAlign:"middle"}}),h.jsx("span",{children:i*2+" "+Y.t("word.MeterAbbreviation",d)})]}),y&&h.jsxs(h.Fragment,{children:[h.jsx("img",{title:Y.t("designInfoPanel.BuildingArea",d),alt:"Area",src:PNo,height:20,width:20,style:{filter:g,marginLeft:"10px",marginTop:"4px",marginBottom:"4px",cursor:"pointer",verticalAlign:"middle"}}),h.jsxs("span",{children:[me.getBuildingArea(l,t).toFixed(2)+" "+Y.t("word.MeterAbbreviation",d),h.jsx("sup",{children:"2"})]})]})]})})})}),MNo="/aladdin/assets/location-_zTaloy5.png",INo="/aladdin/assets/date-Dqo8FDne.png",zNo="/aladdin/assets/thermometer-B30VcfuL.png",DNo=Ro.div` position: absolute; top: 75px; left: 0; @@ -8945,7 +8945,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; font-size: 12px; flex-direction: column; opacity: 100%; -`,FNo=be.memo(()=>{const t=H(rl),e=H(jq),n=H(Tc),o=H(Sb),r=H(jBe),i=H(k7t),a=H(Dw),l=H(cW)??900,s=H(Qq),c=H(SBe),[u,d]=m.useState({low:0,high:20}),[f,p]=m.useState(10),g=new Date(t),y=a.y>0,w=Jt();m.useEffect(()=>{if(i){const v=Qx(g,i.lowestTemperatures,i.highestTemperatures);d(v);const T=$x(v.high,v.low,r,l,b,me.minutesIntoDay(g));p(T)}},[t,i]);const b=m.useMemo(()=>dl(g,n),[t,n]),C=y?"navajowhite":"antiquewhite",P=y?"invert(85%) sepia(45%) saturate(335%) hue-rotate(329deg) brightness(100%) contrast(101%)":"invert(95%) sepia(7%) saturate(1598%) hue-rotate(312deg) brightness(106%) contrast(96%)";return h.jsx(DNo,{children:h.jsx(ENo,{$projectView:s,children:h.jsxs(en,{direction:"horizontal",style:{color:C,fontSize:"10px"},children:[h.jsx("img",{title:Y.t("word.Location",w),alt:"Location",src:MNo,height:20,width:20,style:{filter:P,cursor:"pointer",verticalAlign:"middle"}}),(c?"":e??"")+" ("+Math.abs(n).toFixed(2)+"°"+(n>0?"N":"S")+", "+Math.abs(o).toFixed(2)+"°"+(o>0?"E":"W")+")",h.jsx("img",{title:Y.t("word.Date",w),alt:"Date",src:INo,height:20,width:20,style:{filter:P,cursor:"pointer",verticalAlign:"middle"}}),yc(g).format("MM/DD hh:mm A"),h.jsx("img",{title:Y.t("word.Temperature",w),alt:"Temperature",src:zNo,height:20,width:20,style:{filter:P,cursor:"pointer",verticalAlign:"middle"}}),u?f.toFixed(1)+"°C ("+Y.t("siteInfoPanel.Low",w)+":"+u.low.toFixed(1)+"°C, "+Y.t("siteInfoPanel.High",w)+": "+u.high.toFixed(1)+"°C)":""]})})})}),kNo=Ro.div` +`,FNo=be.memo(()=>{const t=H(rl),e=H(Bq),n=H(Tc),o=H(Sb),r=H(BBe),i=H(k7t),a=H(Dw),l=H(cW)??900,s=H(SW),c=H(TBe),[u,d]=m.useState({low:0,high:20}),[f,p]=m.useState(10),g=new Date(t),y=a.y>0,w=Jt();m.useEffect(()=>{if(i){const v=Qx(g,i.lowestTemperatures,i.highestTemperatures);d(v);const T=$x(v.high,v.low,r,l,b,me.minutesIntoDay(g));p(T)}},[t,i]);const b=m.useMemo(()=>dl(g,n),[t,n]),C=y?"navajowhite":"antiquewhite",P=y?"invert(85%) sepia(45%) saturate(335%) hue-rotate(329deg) brightness(100%) contrast(101%)":"invert(95%) sepia(7%) saturate(1598%) hue-rotate(312deg) brightness(106%) contrast(96%)";return h.jsx(DNo,{children:h.jsx(ENo,{$projectView:s,children:h.jsxs(en,{direction:"horizontal",style:{color:C,fontSize:"10px"},children:[h.jsx("img",{title:Y.t("word.Location",w),alt:"Location",src:MNo,height:20,width:20,style:{filter:P,cursor:"pointer",verticalAlign:"middle"}}),(c?"":e??"")+" ("+Math.abs(n).toFixed(2)+"°"+(n>0?"N":"S")+", "+Math.abs(o).toFixed(2)+"°"+(o>0?"E":"W")+")",h.jsx("img",{title:Y.t("word.Date",w),alt:"Date",src:INo,height:20,width:20,style:{filter:P,cursor:"pointer",verticalAlign:"middle"}}),yc(g).format("MM/DD hh:mm A"),h.jsx("img",{title:Y.t("word.Temperature",w),alt:"Temperature",src:zNo,height:20,width:20,style:{filter:P,cursor:"pointer",verticalAlign:"middle"}}),u?f.toFixed(1)+"°C ("+Y.t("siteInfoPanel.Low",w)+":"+u.low.toFixed(1)+"°C, "+Y.t("siteInfoPanel.High",w)+": "+u.high.toFixed(1)+"°C)":""]})})})}),kNo=Ro.div` position: absolute; left: 0; margin: 0; @@ -8972,7 +8972,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; font-size: 12px; flex-direction: column; opacity: 100%; -`,WNo=be.memo(()=>{const t=H(fn),e=H(Cf),n=H(vge),o=H(e5),r=ht(h3),i=Jt();return h.jsx(kNo,{style:{top:n?"110px":"80px"},children:h.jsx(LNo,{style:{width:r?"320px":"170px",left:r?"calc(100vw / 2 - 150px)":"calc(100vw / 2 - 80px)"},children:h.jsxs(en,{direction:"horizontal",style:{color:"antiquewhite",fontSize:"10px"},children:[Y.t("visualizationControlPanel.ColorContrast",i)+":",h.jsx(Mn,{title:Y.t("visualizationControlPanel.ClickUpOrDownArrowButtonsToChange",i),min:.5,max:50,step:.5,style:{width:70},precision:1,value:e??5,onChange:a=>{a!==null&&t(l=>{l.viewState.solarRadiationHeatMapMaxValue=a})}}),r&&h.jsxs(h.Fragment,{children:[Y.t("visualizationControlPanel.FluxScale",i)+":",h.jsx(Mn,{title:Y.t("visualizationControlPanel.ClickUpOrDownArrowButtonsToChange",i),min:1,max:50,step:5,style:{width:65},precision:0,value:o??20,onChange:a=>{a!==null&&t(l=>{l.viewState.heatFluxScaleFactor=a})}})]})]})})})}),{Column:c_}=Fd,NNo=Ro.div` +`,WNo=be.memo(()=>{const t=H(fn),e=H(Cf),n=H(vge),o=H(e5),r=ht(h3),i=Jt();return h.jsx(kNo,{style:{top:n?"110px":"80px"},children:h.jsx(LNo,{style:{width:r?"320px":"170px",left:r?"calc(100vw / 2 - 150px)":"calc(100vw / 2 - 80px)"},children:h.jsxs(en,{direction:"horizontal",style:{color:"antiquewhite",fontSize:"10px"},children:[Y.t("visualizationControlPanel.ColorContrast",i)+":",h.jsx(Mn,{title:Y.t("visualizationControlPanel.ClickUpOrDownArrowButtonsToChange",i),min:.5,max:50,step:.5,style:{width:70},precision:1,value:e??5,onChange:a=>{a!==null&&t(l=>{l.viewState.solarRadiationHeatMapMaxValue=a})}}),r&&h.jsxs(h.Fragment,{children:[Y.t("visualizationControlPanel.FluxScale",i)+":",h.jsx(Mn,{title:Y.t("visualizationControlPanel.ClickUpOrDownArrowButtonsToChange",i),min:1,max:50,step:5,style:{width:65},precision:0,value:o??20,onChange:a=>{a!==null&&t(l=>{l.viewState.heatFluxScaleFactor=a})}})]})]})})})}),{Column:u_}=Fd,NNo=Ro.div` position: fixed; top: 90px; right: 36px; @@ -9010,7 +9010,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,BNo=be.memo(()=>{const t=H(ma),e=H(fn),n=new Date(H(rl)),o=H(e8t),r=Tn(_7t),i=H(u7t),a=H(Pc),l=be.useRef(null),s=m.useRef(null),c=m.useRef(),u=s.current?s.current.clientWidth+40:o?o.width+40:640,d=s.current?s.current.clientHeight+100:o?o.height+100:570,[f,p]=m.useState({x:o?Math.max(o.x,u-window.innerWidth):0,y:o?Math.min(o.y,window.innerHeight-d):0}),[g,y]=m.useState([]),w=Jt();m.useEffect(()=>{p({x:Math.max(o==null?void 0:o.x,u-window.innerWidth),y:Math.min(o==null?void 0:o.y,window.innerHeight-d)})},[o,u,d]),m.useEffect(()=>{const T=()=>{p({x:Math.max(o==null?void 0:o.x,u-window.innerWidth),y:Math.min(o==null?void 0:o.y,window.innerHeight-d)})};return window.addEventListener("resize",T),()=>{window.removeEventListener("resize",T)}},[d,o==null?void 0:o.x,o==null?void 0:o.y,u]),m.useEffect(()=>(s.current&&(c.current||(c.current=new ResizeObserver(()=>{e(T=>{s.current&&(T.viewState.visibilityResultsPanelRect||(T.viewState.visibilityResultsPanelRect=new cr(0,0,600,470)),T.viewState.visibilityResultsPanelRect.width=s.current.offsetWidth,T.viewState.visibilityResultsPanelRect.height=s.current.offsetHeight)})})),c.current.observe(s.current)),()=>{var T;(T=c.current)==null||T.disconnect()}),[]),m.useEffect(()=>{if(r){const T=[];r.forEach((A,x)=>{let S=0,R="",M=0;A.forEach((D,E)=>{M++,S+=D,R+=D.toFixed(2)+", "}),T.push({key:x.observer.id,observer:Fp.fetchLabel(x.observer.name,w),vantage:"("+x.position.x.toFixed(1)+", "+x.position.y.toFixed(1)+", "+x.position.z.toFixed(1)+") "+v("word.MeterAbbreviation",w),total:S.toFixed(2),itemized:M>1?R.substring(0,R.length-2):"---"})}),y(T)}},[r,w]);const b=(T,A)=>{p({x:Math.max(A.x,u-window.innerWidth),y:Math.min(A.y,window.innerHeight-d)})},C=(T,A)=>{e(x=>{x.viewState.visibilityResultsPanelRect||(x.viewState.visibilityResultsPanelRect=new cr(0,0,600,470)),x.viewState.visibilityResultsPanelRect.x=Math.max(A.x,u-window.innerWidth),x.viewState.visibilityResultsPanelRect.y=Math.min(A.y,window.innerHeight-d)})},P=()=>{e(T=>{T.viewState.showSolarPanelVisibilityResultsPanel=!1,t&&(T.actionInfo={name:"Close Visibility Results Panel",timestamp:new Date().getTime()})})},{t:v}=Vl();return h.jsx(_i,{nodeRef:l,handle:".handle",bounds:"parent",axis:"both",position:f,onDrag:b,onStop:C,onMouseDown:()=>{e(T=>{T.selectedFloatingWindow="visibilityResultsPanel"})},children:h.jsx(NNo,{ref:l,style:{zIndex:a==="visibilityResultsPanel"?Sc:8},children:h.jsxs(UNo,{ref:s,style:{width:(o?o.width:600)+"px",height:(o?o.height:470)+"px"},children:[h.jsxs(jNo,{className:"handle",style:{direction:"ltr"},children:[h.jsx("span",{children:v("visibilityPanel.SolarPanelVisibility",w)+" — "+yr(n).format("h:mm A MM/DD")}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{P()},onMouseDown:()=>{P()},children:v("word.Close",w)})]}),h.jsxs(Fd,{id:"visibility-results-table",style:{width:"100%",direction:"ltr"},dataSource:g,pagination:{defaultPageSize:5,showSizeChanger:!0,pageSizeOptions:["5","10","50"]},children:[h.jsx(c_,{title:`${v("visibilityPanel.Observer",w)}`,dataIndex:"observer"},"observer"),h.jsx(c_,{title:`${v("visibilityPanel.VantagePoint",w)}`,dataIndex:"vantage"},"vantage"),h.jsx(c_,{title:`${v("visibilityPanel.TotalVisibility",w)}`,dataIndex:"total"},"total"),h.jsx(c_,{title:`${v("visibilityPanel.ItemizedVisibilityByFields",w)}`,dataIndex:"itemized"},"itemized")]}),h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[h.jsx(lo,{type:"default",icon:h.jsx(Hf,{}),title:v("word.Update",w),onClick:()=>{if(i()===0){hn(v("analysisManager.NoObserverForVisibilityAnalysis",w));return}hn(v("message.SimulationStarted",w)),setTimeout(()=>{ht.getState().set(A=>{A.simulationInProgress=!0,A.runSolarPanelVisibilityAnalysis=!0}),e(A=>{t&&(A.actionInfo={name:"Run Visibility Analysis For Solar Panels",timestamp:new Date().getTime()})})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:v("word.SaveAsImage",w),onClick:()=>{kd("visibility-results-table","visibility-results").then(()=>{hn(v("message.ScreenshotSaved",w))})}})]})]})})})}),YNo=Ro.div` +`,BNo=be.memo(()=>{const t=H(da),e=H(fn),n=new Date(H(rl)),o=H(e8t),r=Tn(_7t),i=H(u7t),a=H(Pc),l=be.useRef(null),s=m.useRef(null),c=m.useRef(),u=s.current?s.current.clientWidth+40:o?o.width+40:640,d=s.current?s.current.clientHeight+100:o?o.height+100:570,[f,p]=m.useState({x:o?Math.max(o.x,u-window.innerWidth):0,y:o?Math.min(o.y,window.innerHeight-d):0}),[g,y]=m.useState([]),w=Jt();m.useEffect(()=>{p({x:Math.max(o==null?void 0:o.x,u-window.innerWidth),y:Math.min(o==null?void 0:o.y,window.innerHeight-d)})},[o,u,d]),m.useEffect(()=>{const T=()=>{p({x:Math.max(o==null?void 0:o.x,u-window.innerWidth),y:Math.min(o==null?void 0:o.y,window.innerHeight-d)})};return window.addEventListener("resize",T),()=>{window.removeEventListener("resize",T)}},[d,o==null?void 0:o.x,o==null?void 0:o.y,u]),m.useEffect(()=>(s.current&&(c.current||(c.current=new ResizeObserver(()=>{e(T=>{s.current&&(T.viewState.visibilityResultsPanelRect||(T.viewState.visibilityResultsPanelRect=new cr(0,0,600,470)),T.viewState.visibilityResultsPanelRect.width=s.current.offsetWidth,T.viewState.visibilityResultsPanelRect.height=s.current.offsetHeight)})})),c.current.observe(s.current)),()=>{var T;(T=c.current)==null||T.disconnect()}),[]),m.useEffect(()=>{if(r){const T=[];r.forEach((A,x)=>{let S=0,R="",M=0;A.forEach((D,E)=>{M++,S+=D,R+=D.toFixed(2)+", "}),T.push({key:x.observer.id,observer:Fp.fetchLabel(x.observer.name,w),vantage:"("+x.position.x.toFixed(1)+", "+x.position.y.toFixed(1)+", "+x.position.z.toFixed(1)+") "+v("word.MeterAbbreviation",w),total:S.toFixed(2),itemized:M>1?R.substring(0,R.length-2):"---"})}),y(T)}},[r,w]);const b=(T,A)=>{p({x:Math.max(A.x,u-window.innerWidth),y:Math.min(A.y,window.innerHeight-d)})},C=(T,A)=>{e(x=>{x.viewState.visibilityResultsPanelRect||(x.viewState.visibilityResultsPanelRect=new cr(0,0,600,470)),x.viewState.visibilityResultsPanelRect.x=Math.max(A.x,u-window.innerWidth),x.viewState.visibilityResultsPanelRect.y=Math.min(A.y,window.innerHeight-d)})},P=()=>{e(T=>{T.viewState.showSolarPanelVisibilityResultsPanel=!1,t&&(T.actionInfo={name:"Close Visibility Results Panel",timestamp:new Date().getTime()})})},{t:v}=Vl();return h.jsx(_i,{nodeRef:l,handle:".handle",bounds:"parent",axis:"both",position:f,onDrag:b,onStop:C,onMouseDown:()=>{e(T=>{T.selectedFloatingWindow="visibilityResultsPanel"})},children:h.jsx(NNo,{ref:l,style:{zIndex:a==="visibilityResultsPanel"?Sc:8},children:h.jsxs(UNo,{ref:s,style:{width:(o?o.width:600)+"px",height:(o?o.height:470)+"px"},children:[h.jsxs(jNo,{className:"handle",style:{direction:"ltr"},children:[h.jsx("span",{children:v("visibilityPanel.SolarPanelVisibility",w)+" — "+yr(n).format("h:mm A MM/DD")}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{P()},onMouseDown:()=>{P()},children:v("word.Close",w)})]}),h.jsxs(Fd,{id:"visibility-results-table",style:{width:"100%",direction:"ltr"},dataSource:g,pagination:{defaultPageSize:5,showSizeChanger:!0,pageSizeOptions:["5","10","50"]},children:[h.jsx(u_,{title:`${v("visibilityPanel.Observer",w)}`,dataIndex:"observer"},"observer"),h.jsx(u_,{title:`${v("visibilityPanel.VantagePoint",w)}`,dataIndex:"vantage"},"vantage"),h.jsx(u_,{title:`${v("visibilityPanel.TotalVisibility",w)}`,dataIndex:"total"},"total"),h.jsx(u_,{title:`${v("visibilityPanel.ItemizedVisibilityByFields",w)}`,dataIndex:"itemized"},"itemized")]}),h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[h.jsx(lo,{type:"default",icon:h.jsx(Hf,{}),title:v("word.Update",w),onClick:()=>{if(i()===0){hn(v("analysisManager.NoObserverForVisibilityAnalysis",w));return}hn(v("message.SimulationStarted",w)),setTimeout(()=>{ht.getState().set(A=>{A.simulationInProgress=!0,A.runSolarPanelVisibilityAnalysis=!0}),e(A=>{t&&(A.actionInfo={name:"Run Visibility Analysis For Solar Panels",timestamp:new Date().getTime()})})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:v("word.SaveAsImage",w),onClick:()=>{kd("visibility-results-table","visibility-results").then(()=>{hn(v("message.ScreenshotSaved",w))})}})]})]})})})}),YNo=Ro.div` position: fixed; top: 85px; right: 36px; @@ -9048,7 +9048,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,VNo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=H(uW)??6,i=new Date(H(rl)),a=Tn(avt),l=H(eOe),s=Tn(tOe),c=H(jg),u=H(o8t),d=ht(Rf),f=H(Pc),p=be.useRef(null),g=m.useRef(null),y=m.useRef(),w=g.current?g.current.clientWidth+40:u?u.width+40:640,b=g.current?g.current.clientHeight+100:u?u.height+100:500,[C,P]=m.useState({x:u?Math.max(u.x,w-window.innerWidth):0,y:u?Math.min(u.y,window.innerHeight-b):0}),[v,T]=m.useState(0),A=m.useRef(new Map),x=Ms[i.getMonth()],S=Jt();m.useEffect(()=>{let F=0;A.current.clear();for(const U of a)for(const O in U)Object.hasOwn(U,O)&&O!=="Month"&&(F+=U[O],A.current.set(O,(A.current.get(O)??0)+U[O]));T(F)},[a]),m.useEffect(()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})},[u,w,b]),m.useEffect(()=>{const F=()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[u,w,b]),m.useEffect(()=>(g.current&&(y.current||(y.current=new ResizeObserver(()=>{o(F=>{g.current&&(F.viewState.yearlyParabolicTroughYieldPanelRect||(F.viewState.yearlyParabolicTroughYieldPanelRect=new cr(0,0,600,400)),F.viewState.yearlyParabolicTroughYieldPanelRect.width=g.current.offsetWidth,F.viewState.yearlyParabolicTroughYieldPanelRect.height=g.current.offsetHeight)})})),y.current.observe(g.current)),()=>{var F;(F=y.current)==null||F.disconnect()}),[]);const R=(F,U)=>{P({x:Math.max(U.x,w-window.innerWidth),y:Math.min(U.y,window.innerHeight-b)})},M=(F,U)=>{o(O=>{O.viewState.yearlyParabolicTroughYieldPanelRect||(O.viewState.yearlyParabolicTroughYieldPanelRect=new cr(0,0,600,400)),O.viewState.yearlyParabolicTroughYieldPanelRect.x=Math.max(U.x,w-window.innerWidth),O.viewState.yearlyParabolicTroughYieldPanelRect.y=Math.min(U.y,window.innerHeight-b)})},D=()=>{o(F=>{F.viewState.showYearlyParabolicTroughYieldPanel=!1,e&&(F.actionInfo={name:"Close Parabolic Trough Yearly Yield Graph",timestamp:new Date().getTime()})})},E=c(z.ParabolicTrough);m.useEffect(()=>{E<2&&l&&o(F=>{F.graphState&&(F.graphState.yearlyParabolicTroughIndividualOutputs=!1)})},[E,l]);const{t:W}=Vl(),j=W("word.Month",S),L=W("parabolicTroughYieldPanel.Yield",S),k=12/r,N=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:p,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:R,onStop:M,onMouseDown:()=>{o(F=>{F.selectedFloatingWindow="yearlyParabolicTroughYieldPanel"})},children:h.jsx(YNo,{ref:p,style:{zIndex:f==="yearlyParabolicTroughYieldPanel"?Sc:9},children:h.jsxs(ONo,{ref:g,style:{opacity:n,width:(u?u.width:600)+"px",height:(u?u.height:400)+"px"},children:[h.jsxs(_No,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[W("parabolicTroughYieldPanel.ParabolicTroughYearlyYield",S)+": ",h.jsx("span",{style:{fontSize:"10px"},children:W("sensorPanel.WeatherDataFrom",S)+" "+t+" | "+i.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{D()},onMouseDown:()=>{D()},children:W("word.Close",S)})]}),h.jsx(Tf,{type:vi.YearlyParabolicTroughYield,chartType:l?Ml.Line:Ml.Area,dataSource:a.map(({Daylight:F,Clearness:U,...O})=>O),labels:s,height:100,dataKeyAxisX:"Month",labelX:j,labelY:L,unitY:W("word.kWh",S),yMin:0,curveType:"linear",fractionDigits:2,referenceX:x}),!d&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&E>1&&A.current.size>0?h.jsx(Al,{title:[...A.current.entries()].map((F,U)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:F[0]+": "}),h.jsx(nt,{span:8,children:(F[1]*k).toFixed(2)})]}),U===A.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:W("word.Total",S)+": "+(v*k).toFixed(2)+" "+W("word.kWh",S)})]})]},U)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:W("shared.OutputBreakdown",S)})}):h.jsxs(en,{children:[W("parabolicTroughYieldPanel.YearlyTotal",S),":",(v*k).toFixed(2)," ",W("word.kWh",S)]}),E>1&&h.jsx(xc,{title:W("parabolicTroughYieldPanel.ShowOutputsOfIndividualParabolicTroughs",S),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:F=>{if(E===0){hn(W("analysisManager.NoParabolicTroughForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(U=>{U.graphState&&(U.graphState.yearlyParabolicTroughIndividualOutputs=F),e&&(U.actionInfo={name:"Run Yearly Simulation For Parabolic Troughs: "+(F?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(U=>{U.runYearlySimulationForParabolicTroughs=!0,U.pauseYearlySimulationForParabolicTroughs=!1,U.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:N?h.jsx(Sh,{}):h.jsx(Hf,{}),title:W(N?"word.Run":"word.Update",S),onClick:()=>{if(E===0){hn(W("analysisManager.NoParabolicTroughForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(F=>{e&&(F.actionInfo={name:"Run Yearly Simulation For Parabolic Troughs",timestamp:new Date().getTime()})}),ht.getState().set(F=>{F.runYearlySimulationForParabolicTroughs=!0,F.pauseYearlySimulationForParabolicTroughs=!1,F.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:W("word.SaveAsImage",S),onClick:()=>{kd("line-graph-"+j+"-"+L,"yearly-parabolic-trough-yield").then(()=>{hn(W("message.ScreenshotSaved",S)),e&&o(F=>{F.actionInfo={name:"Take Screenshot of Yearly Parabolic Trough Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:W("word.SaveAsCsv",S),onClick:()=>{bh(a,"yearly-parabolic-trough-yield.csv"),hn(W("message.CsvFileSaved",S)),e&&o(F=>{F.actionInfo={name:"Export Yearly Parabolic Trough Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),GNo=Ro.div` +`,VNo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=H(uW)??6,i=new Date(H(rl)),a=Tn(avt),l=H(eOe),s=Tn(tOe),c=H(jg),u=H(o8t),d=ht(Rf),f=H(Pc),p=be.useRef(null),g=m.useRef(null),y=m.useRef(),w=g.current?g.current.clientWidth+40:u?u.width+40:640,b=g.current?g.current.clientHeight+100:u?u.height+100:500,[C,P]=m.useState({x:u?Math.max(u.x,w-window.innerWidth):0,y:u?Math.min(u.y,window.innerHeight-b):0}),[v,T]=m.useState(0),A=m.useRef(new Map),x=Ms[i.getMonth()],S=Jt();m.useEffect(()=>{let F=0;A.current.clear();for(const U of a)for(const O in U)Object.hasOwn(U,O)&&O!=="Month"&&(F+=U[O],A.current.set(O,(A.current.get(O)??0)+U[O]));T(F)},[a]),m.useEffect(()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})},[u,w,b]),m.useEffect(()=>{const F=()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[u,w,b]),m.useEffect(()=>(g.current&&(y.current||(y.current=new ResizeObserver(()=>{o(F=>{g.current&&(F.viewState.yearlyParabolicTroughYieldPanelRect||(F.viewState.yearlyParabolicTroughYieldPanelRect=new cr(0,0,600,400)),F.viewState.yearlyParabolicTroughYieldPanelRect.width=g.current.offsetWidth,F.viewState.yearlyParabolicTroughYieldPanelRect.height=g.current.offsetHeight)})})),y.current.observe(g.current)),()=>{var F;(F=y.current)==null||F.disconnect()}),[]);const R=(F,U)=>{P({x:Math.max(U.x,w-window.innerWidth),y:Math.min(U.y,window.innerHeight-b)})},M=(F,U)=>{o(O=>{O.viewState.yearlyParabolicTroughYieldPanelRect||(O.viewState.yearlyParabolicTroughYieldPanelRect=new cr(0,0,600,400)),O.viewState.yearlyParabolicTroughYieldPanelRect.x=Math.max(U.x,w-window.innerWidth),O.viewState.yearlyParabolicTroughYieldPanelRect.y=Math.min(U.y,window.innerHeight-b)})},D=()=>{o(F=>{F.viewState.showYearlyParabolicTroughYieldPanel=!1,e&&(F.actionInfo={name:"Close Parabolic Trough Yearly Yield Graph",timestamp:new Date().getTime()})})},E=c(z.ParabolicTrough);m.useEffect(()=>{E<2&&l&&o(F=>{F.graphState&&(F.graphState.yearlyParabolicTroughIndividualOutputs=!1)})},[E,l]);const{t:W}=Vl(),j=W("word.Month",S),L=W("parabolicTroughYieldPanel.Yield",S),k=12/r,N=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:p,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:R,onStop:M,onMouseDown:()=>{o(F=>{F.selectedFloatingWindow="yearlyParabolicTroughYieldPanel"})},children:h.jsx(YNo,{ref:p,style:{zIndex:f==="yearlyParabolicTroughYieldPanel"?Sc:9},children:h.jsxs(ONo,{ref:g,style:{opacity:n,width:(u?u.width:600)+"px",height:(u?u.height:400)+"px"},children:[h.jsxs(_No,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[W("parabolicTroughYieldPanel.ParabolicTroughYearlyYield",S)+": ",h.jsx("span",{style:{fontSize:"10px"},children:W("sensorPanel.WeatherDataFrom",S)+" "+t+" | "+i.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{D()},onMouseDown:()=>{D()},children:W("word.Close",S)})]}),h.jsx(Tf,{type:vi.YearlyParabolicTroughYield,chartType:l?Ml.Line:Ml.Area,dataSource:a.map(({Daylight:F,Clearness:U,...O})=>O),labels:s,height:100,dataKeyAxisX:"Month",labelX:j,labelY:L,unitY:W("word.kWh",S),yMin:0,curveType:"linear",fractionDigits:2,referenceX:x}),!d&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&E>1&&A.current.size>0?h.jsx(Al,{title:[...A.current.entries()].map((F,U)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:F[0]+": "}),h.jsx(nt,{span:8,children:(F[1]*k).toFixed(2)})]}),U===A.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:W("word.Total",S)+": "+(v*k).toFixed(2)+" "+W("word.kWh",S)})]})]},U)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:W("shared.OutputBreakdown",S)})}):h.jsxs(en,{children:[W("parabolicTroughYieldPanel.YearlyTotal",S),":",(v*k).toFixed(2)," ",W("word.kWh",S)]}),E>1&&h.jsx(xc,{title:W("parabolicTroughYieldPanel.ShowOutputsOfIndividualParabolicTroughs",S),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:F=>{if(E===0){hn(W("analysisManager.NoParabolicTroughForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(U=>{U.graphState&&(U.graphState.yearlyParabolicTroughIndividualOutputs=F),e&&(U.actionInfo={name:"Run Yearly Simulation For Parabolic Troughs: "+(F?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(U=>{U.runYearlySimulationForParabolicTroughs=!0,U.pauseYearlySimulationForParabolicTroughs=!1,U.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:N?h.jsx(Sh,{}):h.jsx(Hf,{}),title:W(N?"word.Run":"word.Update",S),onClick:()=>{if(E===0){hn(W("analysisManager.NoParabolicTroughForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(F=>{e&&(F.actionInfo={name:"Run Yearly Simulation For Parabolic Troughs",timestamp:new Date().getTime()})}),ht.getState().set(F=>{F.runYearlySimulationForParabolicTroughs=!0,F.pauseYearlySimulationForParabolicTroughs=!1,F.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:W("word.SaveAsImage",S),onClick:()=>{kd("line-graph-"+j+"-"+L,"yearly-parabolic-trough-yield").then(()=>{hn(W("message.ScreenshotSaved",S)),e&&o(F=>{F.actionInfo={name:"Take Screenshot of Yearly Parabolic Trough Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:W("word.SaveAsCsv",S),onClick:()=>{bh(a,"yearly-parabolic-trough-yield.csv"),hn(W("message.CsvFileSaved",S)),e&&o(F=>{F.actionInfo={name:"Export Yearly Parabolic Trough Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),GNo=Ro.div` position: fixed; top: 80px; right: 24px; @@ -9086,7 +9086,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,KNo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=H(jg),a=Tn(rvt),l=H(ZYe),s=H(t8t),c=Tn(tOe),u=ht(Rf),d=H(Pc),f=be.useRef(null),p=m.useRef(null),g=m.useRef(),y=p.current?p.current.clientWidth+40:s?s.width+40:640,w=p.current?p.current.clientHeight+100:s?s.height+100:500,[b,C]=m.useState({x:s?Math.max(s.x,y-window.innerWidth):0,y:s?Math.min(s.y,window.innerHeight-w):0}),[P,v]=m.useState(0),T=m.useRef(new Map),A=Jt();m.useEffect(()=>{let L=0;T.current.clear();for(const k of a)for(const N in k)Object.hasOwn(k,N)&&N!=="Hour"&&(L+=k[N],T.current.set(N,(T.current.get(N)??0)+k[N]));v(L)},[a]),m.useEffect(()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})},[s,y,w]),m.useEffect(()=>{const L=()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})};return window.addEventListener("resize",L),()=>{window.removeEventListener("resize",L)}},[s,y,w]),m.useEffect(()=>(p.current&&(g.current||(g.current=new ResizeObserver(()=>{o(L=>{p.current&&(L.viewState.dailyParabolicTroughYieldPanelRect||(L.viewState.dailyParabolicTroughYieldPanelRect=new cr(0,0,600,400)),L.viewState.dailyParabolicTroughYieldPanelRect.width=p.current.offsetWidth,L.viewState.dailyParabolicTroughYieldPanelRect.height=p.current.offsetHeight)})})),g.current.observe(p.current)),()=>{var L;(L=g.current)==null||L.disconnect()}),[]);const x=(L,k)=>{C({x:Math.max(k.x,y-window.innerWidth),y:Math.min(k.y,window.innerHeight-w)})},S=(L,k)=>{o(N=>{N.viewState.dailyParabolicTroughYieldPanelRect||(N.viewState.dailyParabolicTroughYieldPanelRect=new cr(0,0,600,400)),N.viewState.dailyParabolicTroughYieldPanelRect.x=Math.max(k.x,y-window.innerWidth),N.viewState.dailyParabolicTroughYieldPanelRect.y=Math.min(k.y,window.innerHeight-w)})},R=()=>{o(L=>{L.viewState.showDailyParabolicTroughYieldPanel=!1,e&&(L.actionInfo={name:"Close Parabolic Trough Daily Yield Graph",timestamp:new Date().getTime()})})},M=i(z.ParabolicTrough);m.useEffect(()=>{M<2&&l&&o(L=>{L.graphState&&(L.graphState.dailyParabolicTroughIndividualOutputs=!1)})},[M,l]);const{t:D}=Vl(),E=D("word.Hour",A),W=D("parabolicTroughYieldPanel.YieldPerHour",A),j=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:f,handle:".handle",bounds:"parent",axis:"both",position:b,onDrag:x,onStop:S,onMouseDown:()=>{o(L=>{L.selectedFloatingWindow="dailyParabolicTroughYieldPanel"})},children:h.jsx(GNo,{ref:f,style:{zIndex:d==="dailyParabolicTroughYieldPanel"?Sc:9},children:h.jsxs(XNo,{ref:p,style:{opacity:n,width:(s?s.width:600)+"px",height:(s?s.height:400)+"px"},children:[h.jsxs(JNo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[D("parabolicTroughYieldPanel.ParabolicTroughDailyYield",A)+": ",h.jsx("span",{style:{fontSize:"10px"},children:D("sensorPanel.WeatherDataFrom",A)+" "+t+" | "+yr(r).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{R()},onMouseDown:()=>{R()},children:D("word.Close",A)})]}),h.jsx(Tf,{type:vi.DailyParabolicTroughYield,chartType:l?Ml.Line:Ml.Area,dataSource:a,labels:c,height:100,dataKeyAxisX:"Hour",labelX:E,labelY:W,unitY:D("word.kWh",A),yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),!u&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&M>1&&T.current.size>0?h.jsx(Al,{title:[...T.current.entries()].map((L,k)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:L[0]+": "}),h.jsx(nt,{span:8,children:L[1].toFixed(3)})]}),k===T.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:D("word.Total",A)+": "+P.toFixed(3)+" "+D("word.kWh",A)})]})]},k)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:D("shared.OutputBreakdown",A)})}):h.jsxs(en,{style:{cursor:"default"},children:[D("parabolicTroughYieldPanel.DailyTotal",A),":",P.toFixed(2)," ",D("word.kWh",A)]}),M>1&&h.jsx(xc,{title:D("parabolicTroughYieldPanel.ShowOutputsOfIndividualParabolicTroughs",A),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:L=>{if(M===0){hn(D("analysisManager.NoParabolicTroughForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(k=>{k.graphState&&(k.graphState.dailyParabolicTroughIndividualOutputs=L),e&&(k.actionInfo={name:"Run Daily Simulation For Parabolic Troughs: "+(L?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(k=>{k.runDailySimulationForParabolicTroughs=!0,k.pauseDailySimulationForParabolicTroughs=!1,k.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:j?h.jsx(Sh,{}):h.jsx(Hf,{}),title:D(j?"word.Run":"word.Update",A),onClick:()=>{if(M===0){hn(D("analysisManager.NoParabolicTroughForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(L=>{e&&(L.actionInfo={name:"Run Daily Simulation For Parabolic Troughs",timestamp:new Date().getTime()})}),ht.getState().set(L=>{L.runDailySimulationForParabolicTroughs=!0,L.pauseDailySimulationForParabolicTroughs=!1,L.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:D("word.SaveAsImage",A),onClick:()=>{kd("line-graph-"+E+"-"+W,"daily-parabolic-trough-yield").then(()=>{hn(D("message.ScreenshotSaved",A)),e&&o(L=>{L.actionInfo={name:"Take Screenshot of Daily Parabolic Trough Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:D("word.SaveAsCsv",A),onClick:()=>{bh(a,"daily-parabolic-trough-yield.csv"),hn(D("message.CsvFileSaved",A)),e&&o(L=>{L.actionInfo={name:"Export Daily Parabolic Trough Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),qNo=Ro.div` +`,KNo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=H(jg),a=Tn(rvt),l=H(ZYe),s=H(t8t),c=Tn(tOe),u=ht(Rf),d=H(Pc),f=be.useRef(null),p=m.useRef(null),g=m.useRef(),y=p.current?p.current.clientWidth+40:s?s.width+40:640,w=p.current?p.current.clientHeight+100:s?s.height+100:500,[b,C]=m.useState({x:s?Math.max(s.x,y-window.innerWidth):0,y:s?Math.min(s.y,window.innerHeight-w):0}),[P,v]=m.useState(0),T=m.useRef(new Map),A=Jt();m.useEffect(()=>{let L=0;T.current.clear();for(const k of a)for(const N in k)Object.hasOwn(k,N)&&N!=="Hour"&&(L+=k[N],T.current.set(N,(T.current.get(N)??0)+k[N]));v(L)},[a]),m.useEffect(()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})},[s,y,w]),m.useEffect(()=>{const L=()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})};return window.addEventListener("resize",L),()=>{window.removeEventListener("resize",L)}},[s,y,w]),m.useEffect(()=>(p.current&&(g.current||(g.current=new ResizeObserver(()=>{o(L=>{p.current&&(L.viewState.dailyParabolicTroughYieldPanelRect||(L.viewState.dailyParabolicTroughYieldPanelRect=new cr(0,0,600,400)),L.viewState.dailyParabolicTroughYieldPanelRect.width=p.current.offsetWidth,L.viewState.dailyParabolicTroughYieldPanelRect.height=p.current.offsetHeight)})})),g.current.observe(p.current)),()=>{var L;(L=g.current)==null||L.disconnect()}),[]);const x=(L,k)=>{C({x:Math.max(k.x,y-window.innerWidth),y:Math.min(k.y,window.innerHeight-w)})},S=(L,k)=>{o(N=>{N.viewState.dailyParabolicTroughYieldPanelRect||(N.viewState.dailyParabolicTroughYieldPanelRect=new cr(0,0,600,400)),N.viewState.dailyParabolicTroughYieldPanelRect.x=Math.max(k.x,y-window.innerWidth),N.viewState.dailyParabolicTroughYieldPanelRect.y=Math.min(k.y,window.innerHeight-w)})},R=()=>{o(L=>{L.viewState.showDailyParabolicTroughYieldPanel=!1,e&&(L.actionInfo={name:"Close Parabolic Trough Daily Yield Graph",timestamp:new Date().getTime()})})},M=i(z.ParabolicTrough);m.useEffect(()=>{M<2&&l&&o(L=>{L.graphState&&(L.graphState.dailyParabolicTroughIndividualOutputs=!1)})},[M,l]);const{t:D}=Vl(),E=D("word.Hour",A),W=D("parabolicTroughYieldPanel.YieldPerHour",A),j=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:f,handle:".handle",bounds:"parent",axis:"both",position:b,onDrag:x,onStop:S,onMouseDown:()=>{o(L=>{L.selectedFloatingWindow="dailyParabolicTroughYieldPanel"})},children:h.jsx(GNo,{ref:f,style:{zIndex:d==="dailyParabolicTroughYieldPanel"?Sc:9},children:h.jsxs(XNo,{ref:p,style:{opacity:n,width:(s?s.width:600)+"px",height:(s?s.height:400)+"px"},children:[h.jsxs(JNo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[D("parabolicTroughYieldPanel.ParabolicTroughDailyYield",A)+": ",h.jsx("span",{style:{fontSize:"10px"},children:D("sensorPanel.WeatherDataFrom",A)+" "+t+" | "+yr(r).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{R()},onMouseDown:()=>{R()},children:D("word.Close",A)})]}),h.jsx(Tf,{type:vi.DailyParabolicTroughYield,chartType:l?Ml.Line:Ml.Area,dataSource:a,labels:c,height:100,dataKeyAxisX:"Hour",labelX:E,labelY:W,unitY:D("word.kWh",A),yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),!u&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&M>1&&T.current.size>0?h.jsx(Al,{title:[...T.current.entries()].map((L,k)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:L[0]+": "}),h.jsx(nt,{span:8,children:L[1].toFixed(3)})]}),k===T.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:D("word.Total",A)+": "+P.toFixed(3)+" "+D("word.kWh",A)})]})]},k)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:D("shared.OutputBreakdown",A)})}):h.jsxs(en,{style:{cursor:"default"},children:[D("parabolicTroughYieldPanel.DailyTotal",A),":",P.toFixed(2)," ",D("word.kWh",A)]}),M>1&&h.jsx(xc,{title:D("parabolicTroughYieldPanel.ShowOutputsOfIndividualParabolicTroughs",A),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:L=>{if(M===0){hn(D("analysisManager.NoParabolicTroughForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(k=>{k.graphState&&(k.graphState.dailyParabolicTroughIndividualOutputs=L),e&&(k.actionInfo={name:"Run Daily Simulation For Parabolic Troughs: "+(L?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(k=>{k.runDailySimulationForParabolicTroughs=!0,k.pauseDailySimulationForParabolicTroughs=!1,k.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:j?h.jsx(Sh,{}):h.jsx(Hf,{}),title:D(j?"word.Run":"word.Update",A),onClick:()=>{if(M===0){hn(D("analysisManager.NoParabolicTroughForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(L=>{e&&(L.actionInfo={name:"Run Daily Simulation For Parabolic Troughs",timestamp:new Date().getTime()})}),ht.getState().set(L=>{L.runDailySimulationForParabolicTroughs=!0,L.pauseDailySimulationForParabolicTroughs=!1,L.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:D("word.SaveAsImage",A),onClick:()=>{kd("line-graph-"+E+"-"+W,"daily-parabolic-trough-yield").then(()=>{hn(D("message.ScreenshotSaved",A)),e&&o(L=>{L.actionInfo={name:"Take Screenshot of Daily Parabolic Trough Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:D("word.SaveAsCsv",A),onClick:()=>{bh(a,"daily-parabolic-trough-yield.csv"),hn(D("message.CsvFileSaved",A)),e&&o(L=>{L.actionInfo={name:"Export Daily Parabolic Trough Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),qNo=Ro.div` position: fixed; top: 80px; right: 24px; @@ -9124,7 +9124,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,ZNo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=H(jg),a=Tn(Yvt),l=H(dOe),s=H(r8t),c=Tn(hOe),u=ht(Rf),d=H(Pc),f=be.useRef(null),p=m.useRef(null),g=m.useRef(),y=p.current?p.current.clientWidth+40:s?s.width+40:640,w=p.current?p.current.clientHeight+100:s?s.height+100:500,[b,C]=m.useState({x:s?Math.max(s.x,y-window.innerWidth):0,y:s?Math.min(s.y,window.innerHeight-w):0}),[P,v]=m.useState(0),T=m.useRef(new Map),A=Jt();m.useEffect(()=>{let L=0;T.current.clear();for(const k of a)for(const N in k)Object.hasOwn(k,N)&&N!=="Hour"&&(L+=k[N],T.current.set(N,(T.current.get(N)??0)+k[N]));v(L)},[a]),m.useEffect(()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})},[s,y,w]),m.useEffect(()=>{const L=()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})};return window.addEventListener("resize",L),()=>{window.removeEventListener("resize",L)}},[s,y,w]),m.useEffect(()=>(p.current&&(g.current||(g.current=new ResizeObserver(()=>{o(L=>{p.current&&(L.viewState.dailyParabolicDishYieldPanelRect||(L.viewState.dailyParabolicDishYieldPanelRect=new cr(0,0,600,400)),L.viewState.dailyParabolicDishYieldPanelRect.width=p.current.offsetWidth,L.viewState.dailyParabolicDishYieldPanelRect.height=p.current.offsetHeight)})})),g.current.observe(p.current)),()=>{var L;(L=g.current)==null||L.disconnect()}),[]);const x=(L,k)=>{C({x:Math.max(k.x,y-window.innerWidth),y:Math.min(k.y,window.innerHeight-w)})},S=(L,k)=>{o(N=>{N.viewState.dailyParabolicDishYieldPanelRect||(N.viewState.dailyParabolicDishYieldPanelRect=new cr(0,0,600,400)),N.viewState.dailyParabolicDishYieldPanelRect.x=Math.max(k.x,y-window.innerWidth),N.viewState.dailyParabolicDishYieldPanelRect.y=Math.min(k.y,window.innerHeight-w)})},R=()=>{o(L=>{L.viewState.showDailyParabolicDishYieldPanel=!1,e&&(L.actionInfo={name:"Close Parabolic Dish Daily Yield Graph",timestamp:new Date().getTime()})})},M=i(z.ParabolicDish);m.useEffect(()=>{M<2&&l&&o(L=>{L.graphState&&(L.graphState.dailyParabolicDishIndividualOutputs=!1)})},[M,l]);const{t:D}=Vl(),E=D("word.Hour",A),W=D("parabolicDishYieldPanel.YieldPerHour",A),j=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:f,handle:".handle",bounds:"parent",axis:"both",position:b,onDrag:x,onStop:S,onMouseDown:()=>{o(L=>{L.selectedFloatingWindow="dailyParabolicDishYieldPanel"})},children:h.jsx(qNo,{ref:f,style:{zIndex:d==="dailyParabolicDishYieldPanel"?Sc:9},children:h.jsxs($No,{ref:p,style:{opacity:n,width:(s?s.width:600)+"px",height:(s?s.height:400)+"px"},children:[h.jsxs(QNo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[D("parabolicDishYieldPanel.ParabolicDishDailyYield",A)+": ",h.jsx("span",{style:{fontSize:"10px"},children:D("sensorPanel.WeatherDataFrom",A)+" "+t+" | "+yr(r).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{R()},onMouseDown:()=>{R()},children:D("word.Close",A)})]}),h.jsx(Tf,{type:vi.DailyParabolicDishYield,chartType:l?Ml.Line:Ml.Area,dataSource:a,labels:c,height:100,dataKeyAxisX:"Hour",labelX:E,labelY:W,unitY:D("word.kWh",A),yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),!u&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&M>1&&T.current.size>0?h.jsx(Al,{title:[...T.current.entries()].map((L,k)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:L[0]+": "}),h.jsx(nt,{span:8,children:L[1].toFixed(3)})]}),k===T.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:D("word.Total",A)+": "+P.toFixed(3)+" "+D("word.kWh",A)})]})]},k)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:D("shared.OutputBreakdown",A)})}):h.jsxs(en,{style:{cursor:"default"},children:[D("parabolicDishYieldPanel.DailyTotal",A),":",P.toFixed(2)," ",D("word.kWh",A)]}),M>1&&h.jsx(xc,{title:D("parabolicDishYieldPanel.ShowOutputsOfIndividualParabolicDishes",A),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:L=>{if(M===0){hn(D("analysisManager.NoParabolicDishForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(k=>{k.graphState&&(k.graphState.dailyParabolicDishIndividualOutputs=L),e&&(k.actionInfo={name:"Run Daily Simulation For Parabolic Dishes: "+(L?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(k=>{k.runDailySimulationForParabolicDishes=!0,k.pauseDailySimulationForParabolicDishes=!1,k.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:j?h.jsx(Sh,{}):h.jsx(Hf,{}),title:D(j?"word.Run":"word.Update",A),onClick:()=>{if(M===0){hn(D("analysisManager.NoParabolicDishForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(L=>{e&&(L.actionInfo={name:"Run Daily Simulation For Parabolic Dishes",timestamp:new Date().getTime()})}),ht.getState().set(L=>{L.runDailySimulationForParabolicDishes=!0,L.pauseDailySimulationForParabolicDishes=!1,L.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:D("word.SaveAsImage",A),onClick:()=>{kd("line-graph-"+E+"-"+W,"daily-parabolic-dish-yield").then(()=>{hn(D("message.ScreenshotSaved",A)),e&&o(L=>{L.actionInfo={name:"Take Screenshot of Daily Parabolic Dish Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:D("word.SaveAsCsv",A),onClick:()=>{bh(a,"daily-parabolic-dish-yield.csv"),hn(D("message.CsvFileSaved",A)),e&&o(L=>{L.actionInfo={name:"Export Daily Parabolic Dish Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),eUo=Ro.div` +`,ZNo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=H(jg),a=Tn(Yvt),l=H(dOe),s=H(r8t),c=Tn(hOe),u=ht(Rf),d=H(Pc),f=be.useRef(null),p=m.useRef(null),g=m.useRef(),y=p.current?p.current.clientWidth+40:s?s.width+40:640,w=p.current?p.current.clientHeight+100:s?s.height+100:500,[b,C]=m.useState({x:s?Math.max(s.x,y-window.innerWidth):0,y:s?Math.min(s.y,window.innerHeight-w):0}),[P,v]=m.useState(0),T=m.useRef(new Map),A=Jt();m.useEffect(()=>{let L=0;T.current.clear();for(const k of a)for(const N in k)Object.hasOwn(k,N)&&N!=="Hour"&&(L+=k[N],T.current.set(N,(T.current.get(N)??0)+k[N]));v(L)},[a]),m.useEffect(()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})},[s,y,w]),m.useEffect(()=>{const L=()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})};return window.addEventListener("resize",L),()=>{window.removeEventListener("resize",L)}},[s,y,w]),m.useEffect(()=>(p.current&&(g.current||(g.current=new ResizeObserver(()=>{o(L=>{p.current&&(L.viewState.dailyParabolicDishYieldPanelRect||(L.viewState.dailyParabolicDishYieldPanelRect=new cr(0,0,600,400)),L.viewState.dailyParabolicDishYieldPanelRect.width=p.current.offsetWidth,L.viewState.dailyParabolicDishYieldPanelRect.height=p.current.offsetHeight)})})),g.current.observe(p.current)),()=>{var L;(L=g.current)==null||L.disconnect()}),[]);const x=(L,k)=>{C({x:Math.max(k.x,y-window.innerWidth),y:Math.min(k.y,window.innerHeight-w)})},S=(L,k)=>{o(N=>{N.viewState.dailyParabolicDishYieldPanelRect||(N.viewState.dailyParabolicDishYieldPanelRect=new cr(0,0,600,400)),N.viewState.dailyParabolicDishYieldPanelRect.x=Math.max(k.x,y-window.innerWidth),N.viewState.dailyParabolicDishYieldPanelRect.y=Math.min(k.y,window.innerHeight-w)})},R=()=>{o(L=>{L.viewState.showDailyParabolicDishYieldPanel=!1,e&&(L.actionInfo={name:"Close Parabolic Dish Daily Yield Graph",timestamp:new Date().getTime()})})},M=i(z.ParabolicDish);m.useEffect(()=>{M<2&&l&&o(L=>{L.graphState&&(L.graphState.dailyParabolicDishIndividualOutputs=!1)})},[M,l]);const{t:D}=Vl(),E=D("word.Hour",A),W=D("parabolicDishYieldPanel.YieldPerHour",A),j=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:f,handle:".handle",bounds:"parent",axis:"both",position:b,onDrag:x,onStop:S,onMouseDown:()=>{o(L=>{L.selectedFloatingWindow="dailyParabolicDishYieldPanel"})},children:h.jsx(qNo,{ref:f,style:{zIndex:d==="dailyParabolicDishYieldPanel"?Sc:9},children:h.jsxs($No,{ref:p,style:{opacity:n,width:(s?s.width:600)+"px",height:(s?s.height:400)+"px"},children:[h.jsxs(QNo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[D("parabolicDishYieldPanel.ParabolicDishDailyYield",A)+": ",h.jsx("span",{style:{fontSize:"10px"},children:D("sensorPanel.WeatherDataFrom",A)+" "+t+" | "+yr(r).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{R()},onMouseDown:()=>{R()},children:D("word.Close",A)})]}),h.jsx(Tf,{type:vi.DailyParabolicDishYield,chartType:l?Ml.Line:Ml.Area,dataSource:a,labels:c,height:100,dataKeyAxisX:"Hour",labelX:E,labelY:W,unitY:D("word.kWh",A),yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),!u&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&M>1&&T.current.size>0?h.jsx(Al,{title:[...T.current.entries()].map((L,k)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:L[0]+": "}),h.jsx(nt,{span:8,children:L[1].toFixed(3)})]}),k===T.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:D("word.Total",A)+": "+P.toFixed(3)+" "+D("word.kWh",A)})]})]},k)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:D("shared.OutputBreakdown",A)})}):h.jsxs(en,{style:{cursor:"default"},children:[D("parabolicDishYieldPanel.DailyTotal",A),":",P.toFixed(2)," ",D("word.kWh",A)]}),M>1&&h.jsx(xc,{title:D("parabolicDishYieldPanel.ShowOutputsOfIndividualParabolicDishes",A),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:L=>{if(M===0){hn(D("analysisManager.NoParabolicDishForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(k=>{k.graphState&&(k.graphState.dailyParabolicDishIndividualOutputs=L),e&&(k.actionInfo={name:"Run Daily Simulation For Parabolic Dishes: "+(L?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(k=>{k.runDailySimulationForParabolicDishes=!0,k.pauseDailySimulationForParabolicDishes=!1,k.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:j?h.jsx(Sh,{}):h.jsx(Hf,{}),title:D(j?"word.Run":"word.Update",A),onClick:()=>{if(M===0){hn(D("analysisManager.NoParabolicDishForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(L=>{e&&(L.actionInfo={name:"Run Daily Simulation For Parabolic Dishes",timestamp:new Date().getTime()})}),ht.getState().set(L=>{L.runDailySimulationForParabolicDishes=!0,L.pauseDailySimulationForParabolicDishes=!1,L.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:D("word.SaveAsImage",A),onClick:()=>{kd("line-graph-"+E+"-"+W,"daily-parabolic-dish-yield").then(()=>{hn(D("message.ScreenshotSaved",A)),e&&o(L=>{L.actionInfo={name:"Take Screenshot of Daily Parabolic Dish Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:D("word.SaveAsCsv",A),onClick:()=>{bh(a,"daily-parabolic-dish-yield.csv"),hn(D("message.CsvFileSaved",A)),e&&o(L=>{L.actionInfo={name:"Export Daily Parabolic Dish Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),eUo=Ro.div` position: fixed; top: 85px; right: 36px; @@ -9162,7 +9162,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,oUo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=H(uW)??6,i=new Date(H(rl)),a=Tn(_vt),l=H(fOe),s=Tn(hOe),c=H(jg),u=H(a8t),d=ht(Rf),f=H(Pc),p=be.useRef(null),g=m.useRef(null),y=m.useRef(),w=g.current?g.current.clientWidth+40:u?u.width+40:640,b=g.current?g.current.clientHeight+100:u?u.height+100:500,[C,P]=m.useState({x:u?Math.max(u.x,w-window.innerWidth):0,y:u?Math.min(u.y,window.innerHeight-b):0}),[v,T]=m.useState(0),A=m.useRef(new Map),x=Ms[i.getMonth()],S=Jt();m.useEffect(()=>{let F=0;A.current.clear();for(const U of a)for(const O in U)Object.hasOwn(U,O)&&O!=="Month"&&(F+=U[O],A.current.set(O,(A.current.get(O)??0)+U[O]));T(F)},[a]),m.useEffect(()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})},[u,w,b]),m.useEffect(()=>{const F=()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[u,w,b]),m.useEffect(()=>(g.current&&(y.current||(y.current=new ResizeObserver(()=>{o(F=>{g.current&&(F.viewState.yearlyParabolicDishYieldPanelRect||(F.viewState.yearlyParabolicDishYieldPanelRect=new cr(0,0,600,400)),F.viewState.yearlyParabolicDishYieldPanelRect.width=g.current.offsetWidth,F.viewState.yearlyParabolicDishYieldPanelRect.height=g.current.offsetHeight)})})),y.current.observe(g.current)),()=>{var F;(F=y.current)==null||F.disconnect()}),[]);const R=(F,U)=>{P({x:Math.max(U.x,w-window.innerWidth),y:Math.min(U.y,window.innerHeight-b)})},M=(F,U)=>{o(O=>{O.viewState.yearlyParabolicDishYieldPanelRect||(O.viewState.yearlyParabolicDishYieldPanelRect=new cr(0,0,600,400)),O.viewState.yearlyParabolicDishYieldPanelRect.x=Math.max(U.x,w-window.innerWidth),O.viewState.yearlyParabolicDishYieldPanelRect.y=Math.min(U.y,window.innerHeight-b)})},D=()=>{o(F=>{F.viewState.showYearlyParabolicDishYieldPanel=!1,e&&(F.actionInfo={name:"Close Parabolic Dish Yearly Yield Graph",timestamp:new Date().getTime()})})},E=c(z.ParabolicDish);m.useEffect(()=>{E<2&&l&&o(F=>{F.graphState&&(F.graphState.yearlyParabolicDishIndividualOutputs=!1)})},[E,l]);const{t:W}=Vl(),j=W("word.Month",S),L=W("parabolicDishYieldPanel.Yield",S),k=12/r,N=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:p,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:R,onStop:M,onMouseDown:()=>{o(F=>{F.selectedFloatingWindow="yearlyParabolicDishYieldPanel"})},children:h.jsx(eUo,{ref:p,style:{zIndex:f==="yearlyParabolicDishYieldPanel"?Sc:9},children:h.jsxs(tUo,{ref:g,style:{opacity:n,width:(u?u.width:600)+"px",height:(u?u.height:400)+"px"},children:[h.jsxs(nUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[W("parabolicDishYieldPanel.ParabolicDishYearlyYield",S)+": ",h.jsx("span",{style:{fontSize:"10px"},children:W("sensorPanel.WeatherDataFrom",S)+" "+t+" | "+i.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{D()},onMouseDown:()=>{D()},children:W("word.Close",S)})]}),h.jsx(Tf,{type:vi.YearlyParabolicDishYield,chartType:l?Ml.Line:Ml.Area,dataSource:a.map(({Daylight:F,Clearness:U,...O})=>O),labels:s,height:100,dataKeyAxisX:"Month",labelX:j,labelY:L,unitY:W("word.kWh",S),yMin:0,curveType:"linear",fractionDigits:2,referenceX:x}),!d&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&E>1&&A.current.size>0?h.jsx(Al,{title:[...A.current.entries()].map((F,U)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:F[0]+": "}),h.jsx(nt,{span:8,children:(F[1]*k).toFixed(2)})]}),U===A.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:W("word.Total",S)+": "+(v*k).toFixed(2)+" "+W("word.kWh",S)})]})]},U)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:W("shared.OutputBreakdown",S)})}):h.jsxs(en,{children:[W("parabolicDishYieldPanel.YearlyTotal",S),":",(v*k).toFixed(2)," ",W("word.kWh",S)]}),E>1&&h.jsx(xc,{title:W("parabolicDishYieldPanel.ShowOutputsOfIndividualParabolicDishes",S),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:F=>{if(E===0){hn(W("analysisManager.NoParabolicDishForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(U=>{U.graphState&&(U.graphState.yearlyParabolicDishIndividualOutputs=F),e&&(U.actionInfo={name:"Run Yearly Simulation For Parabolic Dishes: "+(F?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(U=>{U.runYearlySimulationForParabolicDishes=!0,U.pauseYearlySimulationForParabolicDishes=!1,U.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:N?h.jsx(Sh,{}):h.jsx(Hf,{}),title:W(N?"word.Run":"word.Update",S),onClick:()=>{if(E===0){hn(W("analysisManager.NoParabolicDishForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(F=>{e&&(F.actionInfo={name:"Run Yearly Simulation For Parabolic Dishes",timestamp:new Date().getTime()})}),ht.getState().set(F=>{F.runYearlySimulationForParabolicDishes=!0,F.pauseYearlySimulationForParabolicDishes=!1,F.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:W("word.SaveAsImage",S),onClick:()=>{kd("line-graph-"+j+"-"+L,"yearly-parabolic-dish-yield").then(()=>{hn(W("message.ScreenshotSaved",S)),e&&o(F=>{F.actionInfo={name:"Take Screenshot of Yearly Parabolic Dish Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:W("word.SaveAsCsv",S),onClick:()=>{bh(a,"yearly-parabolic-dish-yield.csv"),hn(W("message.CsvFileSaved",S)),e&&o(F=>{F.actionInfo={name:"Export Yearly Parabolic Dish Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),rUo=Ro.div` +`,oUo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=H(uW)??6,i=new Date(H(rl)),a=Tn(_vt),l=H(fOe),s=Tn(hOe),c=H(jg),u=H(a8t),d=ht(Rf),f=H(Pc),p=be.useRef(null),g=m.useRef(null),y=m.useRef(),w=g.current?g.current.clientWidth+40:u?u.width+40:640,b=g.current?g.current.clientHeight+100:u?u.height+100:500,[C,P]=m.useState({x:u?Math.max(u.x,w-window.innerWidth):0,y:u?Math.min(u.y,window.innerHeight-b):0}),[v,T]=m.useState(0),A=m.useRef(new Map),x=Ms[i.getMonth()],S=Jt();m.useEffect(()=>{let F=0;A.current.clear();for(const U of a)for(const O in U)Object.hasOwn(U,O)&&O!=="Month"&&(F+=U[O],A.current.set(O,(A.current.get(O)??0)+U[O]));T(F)},[a]),m.useEffect(()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})},[u,w,b]),m.useEffect(()=>{const F=()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[u,w,b]),m.useEffect(()=>(g.current&&(y.current||(y.current=new ResizeObserver(()=>{o(F=>{g.current&&(F.viewState.yearlyParabolicDishYieldPanelRect||(F.viewState.yearlyParabolicDishYieldPanelRect=new cr(0,0,600,400)),F.viewState.yearlyParabolicDishYieldPanelRect.width=g.current.offsetWidth,F.viewState.yearlyParabolicDishYieldPanelRect.height=g.current.offsetHeight)})})),y.current.observe(g.current)),()=>{var F;(F=y.current)==null||F.disconnect()}),[]);const R=(F,U)=>{P({x:Math.max(U.x,w-window.innerWidth),y:Math.min(U.y,window.innerHeight-b)})},M=(F,U)=>{o(O=>{O.viewState.yearlyParabolicDishYieldPanelRect||(O.viewState.yearlyParabolicDishYieldPanelRect=new cr(0,0,600,400)),O.viewState.yearlyParabolicDishYieldPanelRect.x=Math.max(U.x,w-window.innerWidth),O.viewState.yearlyParabolicDishYieldPanelRect.y=Math.min(U.y,window.innerHeight-b)})},D=()=>{o(F=>{F.viewState.showYearlyParabolicDishYieldPanel=!1,e&&(F.actionInfo={name:"Close Parabolic Dish Yearly Yield Graph",timestamp:new Date().getTime()})})},E=c(z.ParabolicDish);m.useEffect(()=>{E<2&&l&&o(F=>{F.graphState&&(F.graphState.yearlyParabolicDishIndividualOutputs=!1)})},[E,l]);const{t:W}=Vl(),j=W("word.Month",S),L=W("parabolicDishYieldPanel.Yield",S),k=12/r,N=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:p,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:R,onStop:M,onMouseDown:()=>{o(F=>{F.selectedFloatingWindow="yearlyParabolicDishYieldPanel"})},children:h.jsx(eUo,{ref:p,style:{zIndex:f==="yearlyParabolicDishYieldPanel"?Sc:9},children:h.jsxs(tUo,{ref:g,style:{opacity:n,width:(u?u.width:600)+"px",height:(u?u.height:400)+"px"},children:[h.jsxs(nUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[W("parabolicDishYieldPanel.ParabolicDishYearlyYield",S)+": ",h.jsx("span",{style:{fontSize:"10px"},children:W("sensorPanel.WeatherDataFrom",S)+" "+t+" | "+i.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{D()},onMouseDown:()=>{D()},children:W("word.Close",S)})]}),h.jsx(Tf,{type:vi.YearlyParabolicDishYield,chartType:l?Ml.Line:Ml.Area,dataSource:a.map(({Daylight:F,Clearness:U,...O})=>O),labels:s,height:100,dataKeyAxisX:"Month",labelX:j,labelY:L,unitY:W("word.kWh",S),yMin:0,curveType:"linear",fractionDigits:2,referenceX:x}),!d&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&E>1&&A.current.size>0?h.jsx(Al,{title:[...A.current.entries()].map((F,U)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:F[0]+": "}),h.jsx(nt,{span:8,children:(F[1]*k).toFixed(2)})]}),U===A.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:W("word.Total",S)+": "+(v*k).toFixed(2)+" "+W("word.kWh",S)})]})]},U)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:W("shared.OutputBreakdown",S)})}):h.jsxs(en,{children:[W("parabolicDishYieldPanel.YearlyTotal",S),":",(v*k).toFixed(2)," ",W("word.kWh",S)]}),E>1&&h.jsx(xc,{title:W("parabolicDishYieldPanel.ShowOutputsOfIndividualParabolicDishes",S),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:F=>{if(E===0){hn(W("analysisManager.NoParabolicDishForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(U=>{U.graphState&&(U.graphState.yearlyParabolicDishIndividualOutputs=F),e&&(U.actionInfo={name:"Run Yearly Simulation For Parabolic Dishes: "+(F?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(U=>{U.runYearlySimulationForParabolicDishes=!0,U.pauseYearlySimulationForParabolicDishes=!1,U.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:N?h.jsx(Sh,{}):h.jsx(Hf,{}),title:W(N?"word.Run":"word.Update",S),onClick:()=>{if(E===0){hn(W("analysisManager.NoParabolicDishForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(F=>{e&&(F.actionInfo={name:"Run Yearly Simulation For Parabolic Dishes",timestamp:new Date().getTime()})}),ht.getState().set(F=>{F.runYearlySimulationForParabolicDishes=!0,F.pauseYearlySimulationForParabolicDishes=!1,F.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:W("word.SaveAsImage",S),onClick:()=>{kd("line-graph-"+j+"-"+L,"yearly-parabolic-dish-yield").then(()=>{hn(W("message.ScreenshotSaved",S)),e&&o(F=>{F.actionInfo={name:"Take Screenshot of Yearly Parabolic Dish Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:W("word.SaveAsCsv",S),onClick:()=>{bh(a,"yearly-parabolic-dish-yield.csv"),hn(W("message.CsvFileSaved",S)),e&&o(F=>{F.actionInfo={name:"Export Yearly Parabolic Dish Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),rUo=Ro.div` position: fixed; top: 80px; right: 24px; @@ -9200,7 +9200,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,lUo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=H(jg),a=Tn(hvt),l=H(nOe),s=H(l8t),c=Tn(rOe),u=ht(Rf),d=H(Pc),f=be.useRef(null),p=m.useRef(null),g=m.useRef(),y=p.current?p.current.clientWidth+40:s?s.width+40:640,w=p.current?p.current.clientHeight+100:s?s.height+100:500,[b,C]=m.useState({x:s?Math.max(s.x,y-window.innerWidth):0,y:s?Math.min(s.y,window.innerHeight-w):0}),[P,v]=m.useState(0),T=m.useRef(new Map),A=Jt();m.useEffect(()=>{let L=0;T.current.clear();for(const k of a)for(const N in k)Object.hasOwn(k,N)&&N!=="Hour"&&(L+=k[N],T.current.set(N,(T.current.get(N)??0)+k[N]));v(L)},[a]),m.useEffect(()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})},[s,y,w]),m.useEffect(()=>{const L=()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})};return window.addEventListener("resize",L),()=>{window.removeEventListener("resize",L)}},[s,y,w]),m.useEffect(()=>(p.current&&(g.current||(g.current=new ResizeObserver(()=>{o(L=>{p.current&&(L.viewState.dailyFresnelReflectorYieldPanelRect||(L.viewState.dailyFresnelReflectorYieldPanelRect=new cr(0,0,600,400)),L.viewState.dailyFresnelReflectorYieldPanelRect.width=p.current.offsetWidth,L.viewState.dailyFresnelReflectorYieldPanelRect.height=p.current.offsetHeight)})})),g.current.observe(p.current)),()=>{var L;(L=g.current)==null||L.disconnect()}),[]);const x=(L,k)=>{C({x:Math.max(k.x,y-window.innerWidth),y:Math.min(k.y,window.innerHeight-w)})},S=(L,k)=>{o(N=>{N.viewState.dailyFresnelReflectorYieldPanelRect||(N.viewState.dailyFresnelReflectorYieldPanelRect=new cr(0,0,600,400)),N.viewState.dailyFresnelReflectorYieldPanelRect.x=Math.max(k.x,y-window.innerWidth),N.viewState.dailyFresnelReflectorYieldPanelRect.y=Math.min(k.y,window.innerHeight-w)})},R=()=>{o(L=>{L.viewState.showDailyFresnelReflectorYieldPanel=!1,e&&(L.actionInfo={name:"Close Fresnel Reflector Daily Yield Graph",timestamp:new Date().getTime()})})},M=i(z.FresnelReflector);m.useEffect(()=>{M<2&&l&&o(L=>{L.graphState&&(L.graphState.dailyFresnelReflectorIndividualOutputs=!1)})},[M,l]);const{t:D}=Vl(),E=D("word.Hour",A),W=D("fresnelReflectorYieldPanel.YieldPerHour",A),j=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:f,handle:".handle",bounds:"parent",axis:"both",position:b,onDrag:x,onStop:S,onMouseDown:()=>{o(L=>{L.selectedFloatingWindow="dailyFresnelReflectorYieldPanel"})},children:h.jsx(rUo,{ref:f,style:{zIndex:d==="dailyFresnelReflectorYieldPanel"?Sc:9},children:h.jsxs(iUo,{ref:p,style:{opacity:n,width:(s?s.width:600)+"px",height:(s?s.height:400)+"px"},children:[h.jsxs(aUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[D("fresnelReflectorYieldPanel.FresnelReflectorDailyYield",A)+": ",h.jsx("span",{style:{fontSize:"10px"},children:D("sensorPanel.WeatherDataFrom",A)+" "+t+" | "+yr(r).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{R()},onMouseDown:()=>{R()},children:D("word.Close",A)})]}),h.jsx(Tf,{type:vi.DailyFresnelReflectorYield,chartType:l?Ml.Line:Ml.Area,dataSource:a,labels:c,height:100,dataKeyAxisX:"Hour",labelX:E,labelY:W,unitY:D("word.kWh",A),yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),!u&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&M>1&&T.current.size>0?h.jsx(Al,{title:[...T.current.entries()].map((L,k)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:L[0]+": "}),h.jsx(nt,{span:8,children:L[1].toFixed(3)})]}),k===T.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:D("word.Total",A)+": "+P.toFixed(3)+" "+D("word.kWh",A)})]})]},k)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:D("shared.OutputBreakdown",A)})}):h.jsxs(en,{style:{cursor:"default"},children:[D("fresnelReflectorYieldPanel.DailyTotal",A),":",P.toFixed(2)," ",D("word.kWh",A)]}),M>1&&h.jsx(xc,{title:D("fresnelReflectorYieldPanel.ShowOutputsOfIndividualFresnelReflectors",A),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:L=>{if(M===0){hn(D("analysisManager.NoFresnelReflectorForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(k=>{k.graphState&&(k.graphState.dailyFresnelReflectorIndividualOutputs=L),e&&(k.actionInfo={name:"Run Daily Simulation For Fresnel Reflectors: "+(L?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(k=>{k.runDailySimulationForFresnelReflectors=!0,k.pauseDailySimulationForFresnelReflectors=!1,k.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:j?h.jsx(Sh,{}):h.jsx(Hf,{}),title:D(j?"word.Run":"word.Update",A),onClick:()=>{if(M===0){hn(D("analysisManager.NoFresnelReflectorForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(L=>{e&&(L.actionInfo={name:"Run Daily Simulation For Fresnel Reflectors",timestamp:new Date().getTime()})}),ht.getState().set(L=>{L.runDailySimulationForFresnelReflectors=!0,L.pauseDailySimulationForFresnelReflectors=!1,L.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:D("word.SaveAsImage",A),onClick:()=>{kd("line-graph-"+E+"-"+W,"daily-fresnel-reflector-yield").then(()=>{hn(D("message.ScreenshotSaved",A)),e&&o(L=>{L.actionInfo={name:"Take Screenshot of Daily Fresnel Reflector Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:D("word.SaveAsCsv",A),onClick:()=>{bh(a,"daily-fresnel-yield.csv"),hn(D("message.CsvFileSaved",A)),e&&o(L=>{L.actionInfo={name:"Export Daily Fresnel Reflector Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),sUo=Ro.div` +`,lUo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=H(jg),a=Tn(hvt),l=H(nOe),s=H(l8t),c=Tn(rOe),u=ht(Rf),d=H(Pc),f=be.useRef(null),p=m.useRef(null),g=m.useRef(),y=p.current?p.current.clientWidth+40:s?s.width+40:640,w=p.current?p.current.clientHeight+100:s?s.height+100:500,[b,C]=m.useState({x:s?Math.max(s.x,y-window.innerWidth):0,y:s?Math.min(s.y,window.innerHeight-w):0}),[P,v]=m.useState(0),T=m.useRef(new Map),A=Jt();m.useEffect(()=>{let L=0;T.current.clear();for(const k of a)for(const N in k)Object.hasOwn(k,N)&&N!=="Hour"&&(L+=k[N],T.current.set(N,(T.current.get(N)??0)+k[N]));v(L)},[a]),m.useEffect(()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})},[s,y,w]),m.useEffect(()=>{const L=()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})};return window.addEventListener("resize",L),()=>{window.removeEventListener("resize",L)}},[s,y,w]),m.useEffect(()=>(p.current&&(g.current||(g.current=new ResizeObserver(()=>{o(L=>{p.current&&(L.viewState.dailyFresnelReflectorYieldPanelRect||(L.viewState.dailyFresnelReflectorYieldPanelRect=new cr(0,0,600,400)),L.viewState.dailyFresnelReflectorYieldPanelRect.width=p.current.offsetWidth,L.viewState.dailyFresnelReflectorYieldPanelRect.height=p.current.offsetHeight)})})),g.current.observe(p.current)),()=>{var L;(L=g.current)==null||L.disconnect()}),[]);const x=(L,k)=>{C({x:Math.max(k.x,y-window.innerWidth),y:Math.min(k.y,window.innerHeight-w)})},S=(L,k)=>{o(N=>{N.viewState.dailyFresnelReflectorYieldPanelRect||(N.viewState.dailyFresnelReflectorYieldPanelRect=new cr(0,0,600,400)),N.viewState.dailyFresnelReflectorYieldPanelRect.x=Math.max(k.x,y-window.innerWidth),N.viewState.dailyFresnelReflectorYieldPanelRect.y=Math.min(k.y,window.innerHeight-w)})},R=()=>{o(L=>{L.viewState.showDailyFresnelReflectorYieldPanel=!1,e&&(L.actionInfo={name:"Close Fresnel Reflector Daily Yield Graph",timestamp:new Date().getTime()})})},M=i(z.FresnelReflector);m.useEffect(()=>{M<2&&l&&o(L=>{L.graphState&&(L.graphState.dailyFresnelReflectorIndividualOutputs=!1)})},[M,l]);const{t:D}=Vl(),E=D("word.Hour",A),W=D("fresnelReflectorYieldPanel.YieldPerHour",A),j=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:f,handle:".handle",bounds:"parent",axis:"both",position:b,onDrag:x,onStop:S,onMouseDown:()=>{o(L=>{L.selectedFloatingWindow="dailyFresnelReflectorYieldPanel"})},children:h.jsx(rUo,{ref:f,style:{zIndex:d==="dailyFresnelReflectorYieldPanel"?Sc:9},children:h.jsxs(iUo,{ref:p,style:{opacity:n,width:(s?s.width:600)+"px",height:(s?s.height:400)+"px"},children:[h.jsxs(aUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[D("fresnelReflectorYieldPanel.FresnelReflectorDailyYield",A)+": ",h.jsx("span",{style:{fontSize:"10px"},children:D("sensorPanel.WeatherDataFrom",A)+" "+t+" | "+yr(r).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{R()},onMouseDown:()=>{R()},children:D("word.Close",A)})]}),h.jsx(Tf,{type:vi.DailyFresnelReflectorYield,chartType:l?Ml.Line:Ml.Area,dataSource:a,labels:c,height:100,dataKeyAxisX:"Hour",labelX:E,labelY:W,unitY:D("word.kWh",A),yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),!u&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&M>1&&T.current.size>0?h.jsx(Al,{title:[...T.current.entries()].map((L,k)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:L[0]+": "}),h.jsx(nt,{span:8,children:L[1].toFixed(3)})]}),k===T.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:D("word.Total",A)+": "+P.toFixed(3)+" "+D("word.kWh",A)})]})]},k)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:D("shared.OutputBreakdown",A)})}):h.jsxs(en,{style:{cursor:"default"},children:[D("fresnelReflectorYieldPanel.DailyTotal",A),":",P.toFixed(2)," ",D("word.kWh",A)]}),M>1&&h.jsx(xc,{title:D("fresnelReflectorYieldPanel.ShowOutputsOfIndividualFresnelReflectors",A),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:L=>{if(M===0){hn(D("analysisManager.NoFresnelReflectorForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(k=>{k.graphState&&(k.graphState.dailyFresnelReflectorIndividualOutputs=L),e&&(k.actionInfo={name:"Run Daily Simulation For Fresnel Reflectors: "+(L?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(k=>{k.runDailySimulationForFresnelReflectors=!0,k.pauseDailySimulationForFresnelReflectors=!1,k.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:j?h.jsx(Sh,{}):h.jsx(Hf,{}),title:D(j?"word.Run":"word.Update",A),onClick:()=>{if(M===0){hn(D("analysisManager.NoFresnelReflectorForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(L=>{e&&(L.actionInfo={name:"Run Daily Simulation For Fresnel Reflectors",timestamp:new Date().getTime()})}),ht.getState().set(L=>{L.runDailySimulationForFresnelReflectors=!0,L.pauseDailySimulationForFresnelReflectors=!1,L.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:D("word.SaveAsImage",A),onClick:()=>{kd("line-graph-"+E+"-"+W,"daily-fresnel-reflector-yield").then(()=>{hn(D("message.ScreenshotSaved",A)),e&&o(L=>{L.actionInfo={name:"Take Screenshot of Daily Fresnel Reflector Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:D("word.SaveAsCsv",A),onClick:()=>{bh(a,"daily-fresnel-yield.csv"),hn(D("message.CsvFileSaved",A)),e&&o(L=>{L.actionInfo={name:"Export Daily Fresnel Reflector Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),sUo=Ro.div` position: fixed; top: 85px; right: 36px; @@ -9238,7 +9238,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,dUo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=H(uW)??6,i=new Date(H(rl)),a=Tn(gvt),l=H(oOe),s=Tn(rOe),c=H(jg),u=H(c8t),d=ht(Rf),f=H(Pc),p=be.useRef(null),g=m.useRef(null),y=m.useRef(),w=g.current?g.current.clientWidth+40:u?u.width+40:640,b=g.current?g.current.clientHeight+100:u?u.height+100:500,[C,P]=m.useState({x:u?Math.max(u.x,w-window.innerWidth):0,y:u?Math.min(u.y,window.innerHeight-b):0}),[v,T]=m.useState(0),A=m.useRef(new Map),x=Ms[i.getMonth()],S=Jt();m.useEffect(()=>{let F=0;A.current.clear();for(const U of a)for(const O in U)Object.hasOwn(U,O)&&O!=="Month"&&(F+=U[O],A.current.set(O,(A.current.get(O)??0)+U[O]));T(F)},[a]),m.useEffect(()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})},[u,w,b]),m.useEffect(()=>{const F=()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[u,w,b]),m.useEffect(()=>(g.current&&(y.current||(y.current=new ResizeObserver(()=>{o(F=>{g.current&&(F.viewState.yearlyFresnelReflectorYieldPanelRect||(F.viewState.yearlyFresnelReflectorYieldPanelRect=new cr(0,0,600,400)),F.viewState.yearlyFresnelReflectorYieldPanelRect.width=g.current.offsetWidth,F.viewState.yearlyFresnelReflectorYieldPanelRect.height=g.current.offsetHeight)})})),y.current.observe(g.current)),()=>{var F;(F=y.current)==null||F.disconnect()}),[]);const R=(F,U)=>{P({x:Math.max(U.x,w-window.innerWidth),y:Math.min(U.y,window.innerHeight-b)})},M=(F,U)=>{o(O=>{O.viewState.yearlyFresnelReflectorYieldPanelRect||(O.viewState.yearlyFresnelReflectorYieldPanelRect=new cr(0,0,600,400)),O.viewState.yearlyFresnelReflectorYieldPanelRect.x=Math.max(U.x,w-window.innerWidth),O.viewState.yearlyFresnelReflectorYieldPanelRect.y=Math.min(U.y,window.innerHeight-b)})},D=()=>{o(F=>{F.viewState.showYearlyFresnelReflectorYieldPanel=!1,e&&(F.actionInfo={name:"Close Fresnel Reflector Yearly Yield Graph",timestamp:new Date().getTime()})})},E=c(z.FresnelReflector);m.useEffect(()=>{E<2&&l&&o(F=>{F.graphState&&(F.graphState.yearlyFresnelReflectorIndividualOutputs=!1)})},[E,l]);const{t:W}=Vl(),j=W("word.Month",S),L=W("fresnelReflectorYieldPanel.Yield",S),k=12/r,N=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:p,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:R,onStop:M,onMouseDown:()=>{o(F=>{F.selectedFloatingWindow="yearlyFresnelReflectorYieldPanel"})},children:h.jsx(sUo,{ref:p,style:{zIndex:f==="yearlyFresnelReflectorYieldPanel"?Sc:9},children:h.jsxs(cUo,{ref:g,style:{opacity:n,width:(u?u.width:600)+"px",height:(u?u.height:400)+"px"},children:[h.jsxs(uUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[W("fresnelReflectorYieldPanel.FresnelReflectorYearlyYield",S)+": ",h.jsx("span",{style:{fontSize:"10px"},children:W("sensorPanel.WeatherDataFrom",S)+" "+t+" | "+i.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{D()},onMouseDown:()=>{D()},children:W("word.Close",S)})]}),h.jsx(Tf,{type:vi.YearlyFresnelReflectorYield,chartType:l?Ml.Line:Ml.Area,dataSource:a.map(({Daylight:F,Clearness:U,...O})=>O),labels:s,height:100,dataKeyAxisX:"Month",labelX:j,labelY:L,unitY:W("word.kWh",S),yMin:0,curveType:"linear",fractionDigits:2,referenceX:x}),!d&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&E>1&&A.current.size>0?h.jsx(Al,{title:[...A.current.entries()].map((F,U)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:F[0]+": "}),h.jsx(nt,{span:8,children:(F[1]*k).toFixed(2)})]}),U===A.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:W("word.Total",S)+": "+(v*k).toFixed(2)+" "+W("word.kWh",S)})]})]},U)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:W("shared.OutputBreakdown",S)})}):h.jsxs(en,{children:[W("fresnelReflectorYieldPanel.YearlyTotal",S),":",(v*k).toFixed(2)," ",W("word.kWh",S)]}),E>1&&h.jsx(xc,{title:W("fresnelReflectorYieldPanel.ShowOutputsOfIndividualFresnelReflectors",S),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:F=>{if(E===0){hn(W("analysisManager.NoFresnelReflectorForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(U=>{U.graphState&&(U.graphState.yearlyFresnelReflectorIndividualOutputs=F),e&&(U.actionInfo={name:"Run Yearly Simulation For Fresnel Reflectors: "+(F?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(U=>{U.runYearlySimulationForFresnelReflectors=!0,U.pauseYearlySimulationForFresnelReflectors=!1,U.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:N?h.jsx(Sh,{}):h.jsx(Hf,{}),title:W(N?"word.Run":"word.Update",S),onClick:()=>{if(E===0){hn(W("analysisManager.NoFresnelReflectorForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(F=>{e&&(F.actionInfo={name:"Run Yearly Simulation For Fresnel Reflectors",timestamp:new Date().getTime()})}),ht.getState().set(F=>{F.runYearlySimulationForFresnelReflectors=!0,F.pauseYearlySimulationForFresnelReflectors=!1,F.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:W("word.SaveAsImage",S),onClick:()=>{kd("line-graph-"+j+"-"+L,"yearly-fresnel-reflector-yield").then(()=>{hn(W("message.ScreenshotSaved",S)),e&&o(F=>{F.actionInfo={name:"Take Screenshot of Yearly Fresnel Reflector Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:W("word.SaveAsCsv",S),onClick:()=>{bh(a,"yearly-fresnel-reflector-yield.csv"),hn(W("message.CsvFileSaved",S)),e&&o(F=>{F.actionInfo={name:"Export Yearly Fresnel Reflector Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),fUo=Ro.div` +`,dUo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=H(uW)??6,i=new Date(H(rl)),a=Tn(gvt),l=H(oOe),s=Tn(rOe),c=H(jg),u=H(c8t),d=ht(Rf),f=H(Pc),p=be.useRef(null),g=m.useRef(null),y=m.useRef(),w=g.current?g.current.clientWidth+40:u?u.width+40:640,b=g.current?g.current.clientHeight+100:u?u.height+100:500,[C,P]=m.useState({x:u?Math.max(u.x,w-window.innerWidth):0,y:u?Math.min(u.y,window.innerHeight-b):0}),[v,T]=m.useState(0),A=m.useRef(new Map),x=Ms[i.getMonth()],S=Jt();m.useEffect(()=>{let F=0;A.current.clear();for(const U of a)for(const O in U)Object.hasOwn(U,O)&&O!=="Month"&&(F+=U[O],A.current.set(O,(A.current.get(O)??0)+U[O]));T(F)},[a]),m.useEffect(()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})},[u,w,b]),m.useEffect(()=>{const F=()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[u,w,b]),m.useEffect(()=>(g.current&&(y.current||(y.current=new ResizeObserver(()=>{o(F=>{g.current&&(F.viewState.yearlyFresnelReflectorYieldPanelRect||(F.viewState.yearlyFresnelReflectorYieldPanelRect=new cr(0,0,600,400)),F.viewState.yearlyFresnelReflectorYieldPanelRect.width=g.current.offsetWidth,F.viewState.yearlyFresnelReflectorYieldPanelRect.height=g.current.offsetHeight)})})),y.current.observe(g.current)),()=>{var F;(F=y.current)==null||F.disconnect()}),[]);const R=(F,U)=>{P({x:Math.max(U.x,w-window.innerWidth),y:Math.min(U.y,window.innerHeight-b)})},M=(F,U)=>{o(O=>{O.viewState.yearlyFresnelReflectorYieldPanelRect||(O.viewState.yearlyFresnelReflectorYieldPanelRect=new cr(0,0,600,400)),O.viewState.yearlyFresnelReflectorYieldPanelRect.x=Math.max(U.x,w-window.innerWidth),O.viewState.yearlyFresnelReflectorYieldPanelRect.y=Math.min(U.y,window.innerHeight-b)})},D=()=>{o(F=>{F.viewState.showYearlyFresnelReflectorYieldPanel=!1,e&&(F.actionInfo={name:"Close Fresnel Reflector Yearly Yield Graph",timestamp:new Date().getTime()})})},E=c(z.FresnelReflector);m.useEffect(()=>{E<2&&l&&o(F=>{F.graphState&&(F.graphState.yearlyFresnelReflectorIndividualOutputs=!1)})},[E,l]);const{t:W}=Vl(),j=W("word.Month",S),L=W("fresnelReflectorYieldPanel.Yield",S),k=12/r,N=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:p,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:R,onStop:M,onMouseDown:()=>{o(F=>{F.selectedFloatingWindow="yearlyFresnelReflectorYieldPanel"})},children:h.jsx(sUo,{ref:p,style:{zIndex:f==="yearlyFresnelReflectorYieldPanel"?Sc:9},children:h.jsxs(cUo,{ref:g,style:{opacity:n,width:(u?u.width:600)+"px",height:(u?u.height:400)+"px"},children:[h.jsxs(uUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[W("fresnelReflectorYieldPanel.FresnelReflectorYearlyYield",S)+": ",h.jsx("span",{style:{fontSize:"10px"},children:W("sensorPanel.WeatherDataFrom",S)+" "+t+" | "+i.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{D()},onMouseDown:()=>{D()},children:W("word.Close",S)})]}),h.jsx(Tf,{type:vi.YearlyFresnelReflectorYield,chartType:l?Ml.Line:Ml.Area,dataSource:a.map(({Daylight:F,Clearness:U,...O})=>O),labels:s,height:100,dataKeyAxisX:"Month",labelX:j,labelY:L,unitY:W("word.kWh",S),yMin:0,curveType:"linear",fractionDigits:2,referenceX:x}),!d&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&E>1&&A.current.size>0?h.jsx(Al,{title:[...A.current.entries()].map((F,U)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:F[0]+": "}),h.jsx(nt,{span:8,children:(F[1]*k).toFixed(2)})]}),U===A.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:W("word.Total",S)+": "+(v*k).toFixed(2)+" "+W("word.kWh",S)})]})]},U)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:W("shared.OutputBreakdown",S)})}):h.jsxs(en,{children:[W("fresnelReflectorYieldPanel.YearlyTotal",S),":",(v*k).toFixed(2)," ",W("word.kWh",S)]}),E>1&&h.jsx(xc,{title:W("fresnelReflectorYieldPanel.ShowOutputsOfIndividualFresnelReflectors",S),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:F=>{if(E===0){hn(W("analysisManager.NoFresnelReflectorForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(U=>{U.graphState&&(U.graphState.yearlyFresnelReflectorIndividualOutputs=F),e&&(U.actionInfo={name:"Run Yearly Simulation For Fresnel Reflectors: "+(F?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(U=>{U.runYearlySimulationForFresnelReflectors=!0,U.pauseYearlySimulationForFresnelReflectors=!1,U.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:N?h.jsx(Sh,{}):h.jsx(Hf,{}),title:W(N?"word.Run":"word.Update",S),onClick:()=>{if(E===0){hn(W("analysisManager.NoFresnelReflectorForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(F=>{e&&(F.actionInfo={name:"Run Yearly Simulation For Fresnel Reflectors",timestamp:new Date().getTime()})}),ht.getState().set(F=>{F.runYearlySimulationForFresnelReflectors=!0,F.pauseYearlySimulationForFresnelReflectors=!1,F.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:W("word.SaveAsImage",S),onClick:()=>{kd("line-graph-"+j+"-"+L,"yearly-fresnel-reflector-yield").then(()=>{hn(W("message.ScreenshotSaved",S)),e&&o(F=>{F.actionInfo={name:"Take Screenshot of Yearly Fresnel Reflector Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:W("word.SaveAsCsv",S),onClick:()=>{bh(a,"yearly-fresnel-reflector-yield.csv"),hn(W("message.CsvFileSaved",S)),e&&o(F=>{F.actionInfo={name:"Export Yearly Fresnel Reflector Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),fUo=Ro.div` position: fixed; top: 80px; right: 24px; @@ -9276,7 +9276,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,gUo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=H(jg),a=Tn(bvt),l=H(iOe),s=H(u8t),c=Tn(lOe),u=ht(Rf),d=H(Pc),f=be.useRef(null),p=m.useRef(null),g=m.useRef(),y=p.current?p.current.clientWidth+40:s?s.width+40:640,w=p.current?p.current.clientHeight+100:s?s.height+100:500,[b,C]=m.useState({x:s?Math.max(s.x,y-window.innerWidth):0,y:s?Math.min(s.y,window.innerHeight-w):0}),[P,v]=m.useState(0),T=m.useRef(new Map),A=Jt();m.useEffect(()=>{let L=0;T.current.clear();for(const k of a)for(const N in k)Object.hasOwn(k,N)&&N!=="Hour"&&(L+=k[N],T.current.set(N,(T.current.get(N)??0)+k[N]));v(L)},[a]),m.useEffect(()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})},[s,y,w]),m.useEffect(()=>{const L=()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})};return window.addEventListener("resize",L),()=>{window.removeEventListener("resize",L)}},[s,y,w]),m.useEffect(()=>(p.current&&(g.current||(g.current=new ResizeObserver(()=>{o(L=>{p.current&&(L.viewState.dailyHeliostatYieldPanelRect||(L.viewState.dailyHeliostatYieldPanelRect=new cr(0,0,600,400)),L.viewState.dailyHeliostatYieldPanelRect.width=p.current.offsetWidth,L.viewState.dailyHeliostatYieldPanelRect.height=p.current.offsetHeight)})})),g.current.observe(p.current)),()=>{var L;(L=g.current)==null||L.disconnect()}),[]);const x=(L,k)=>{C({x:Math.max(k.x,y-window.innerWidth),y:Math.min(k.y,window.innerHeight-w)})},S=(L,k)=>{o(N=>{N.viewState.dailyHeliostatYieldPanelRect||(N.viewState.dailyHeliostatYieldPanelRect=new cr(0,0,600,400)),N.viewState.dailyHeliostatYieldPanelRect.x=Math.max(k.x,y-window.innerWidth),N.viewState.dailyHeliostatYieldPanelRect.y=Math.min(k.y,window.innerHeight-w)})},R=()=>{o(L=>{L.viewState.showDailyHeliostatYieldPanel=!1,e&&(L.actionInfo={name:"Close Heliostat Daily Yield Graph",timestamp:new Date().getTime()})})},M=i(z.Heliostat);m.useEffect(()=>{M<2&&l&&o(L=>{L.graphState&&(L.graphState.dailyHeliostatIndividualOutputs=!1)})},[M,l]);const{t:D}=Vl(),E=D("word.Hour",A),W=D("heliostatYieldPanel.YieldPerHour",A),j=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:f,handle:".handle",bounds:"parent",axis:"both",position:b,onDrag:x,onStop:S,onMouseDown:()=>{o(L=>{L.selectedFloatingWindow="dailyHeliostatYieldPanel"})},children:h.jsx(fUo,{ref:f,style:{zIndex:d==="dailyHeliostatYieldPanel"?Sc:9},children:h.jsxs(hUo,{ref:p,style:{opacity:n,width:(s?s.width:600)+"px",height:(s?s.height:400)+"px"},children:[h.jsxs(pUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[D("heliostatYieldPanel.HeliostatDailyYield",A)+": ",h.jsx("span",{style:{fontSize:"10px"},children:D("sensorPanel.WeatherDataFrom",A)+" "+t+" | "+yr(r).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{R()},onMouseDown:()=>{R()},children:D("word.Close",A)})]}),h.jsx(Tf,{type:vi.DailyHeliostatYield,chartType:l?Ml.Line:Ml.Area,dataSource:a,labels:c,height:100,dataKeyAxisX:"Hour",labelX:E,labelY:W,unitY:D("word.kWh",A),yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),!u&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&M>1&&T.current.size>0?h.jsx(Al,{title:[...T.current.entries()].map((L,k)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:L[0]+": "}),h.jsx(nt,{span:8,children:L[1].toFixed(3)})]}),k===T.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:D("word.Total",A)+": "+P.toFixed(3)+" "+D("word.kWh",A)})]})]},k)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:D("shared.OutputBreakdown",A)})}):h.jsxs(en,{style:{cursor:"default"},children:[D("heliostatYieldPanel.DailyTotal",A),":",P.toFixed(2)," ",D("word.kWh",A)]}),M>1&&h.jsx(xc,{title:D("heliostatYieldPanel.ShowOutputsOfIndividualHeliostats",A),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:L=>{if(M===0){hn(D("analysisManager.NoHeliostatForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(k=>{k.graphState&&(k.graphState.dailyHeliostatIndividualOutputs=L),e&&(k.actionInfo={name:"Run Daily Simulation For Heliostats: "+(L?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(k=>{k.runDailySimulationForHeliostats=!0,k.pauseDailySimulationForHeliostats=!1,k.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:j?h.jsx(Sh,{}):h.jsx(Hf,{}),title:D(j?"word.Run":"word.Update",A),onClick:()=>{if(M===0){hn(D("analysisManager.NoHeliostatForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(L=>{e&&(L.actionInfo={name:"Run Daily Simulation For Heliostats",timestamp:new Date().getTime()})}),ht.getState().set(L=>{L.runDailySimulationForHeliostats=!0,L.pauseDailySimulationForHeliostats=!1,L.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:D("word.SaveAsImage",A),onClick:()=>{kd("line-graph-"+E+"-"+W,"daily-heliostat-yield").then(()=>{hn(D("message.ScreenshotSaved",A)),e&&o(L=>{L.actionInfo={name:"Take Screenshot of Daily Heliostat Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:D("word.SaveAsCsv",A),onClick:()=>{bh(a,"daily-heliostat-yield.csv"),hn(D("message.CsvFileSaved",A)),e&&o(L=>{L.actionInfo={name:"Export Daily Heliostat Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),mUo=Ro.div` +`,gUo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=H(jg),a=Tn(bvt),l=H(iOe),s=H(u8t),c=Tn(lOe),u=ht(Rf),d=H(Pc),f=be.useRef(null),p=m.useRef(null),g=m.useRef(),y=p.current?p.current.clientWidth+40:s?s.width+40:640,w=p.current?p.current.clientHeight+100:s?s.height+100:500,[b,C]=m.useState({x:s?Math.max(s.x,y-window.innerWidth):0,y:s?Math.min(s.y,window.innerHeight-w):0}),[P,v]=m.useState(0),T=m.useRef(new Map),A=Jt();m.useEffect(()=>{let L=0;T.current.clear();for(const k of a)for(const N in k)Object.hasOwn(k,N)&&N!=="Hour"&&(L+=k[N],T.current.set(N,(T.current.get(N)??0)+k[N]));v(L)},[a]),m.useEffect(()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})},[s,y,w]),m.useEffect(()=>{const L=()=>{C({x:Math.max(s==null?void 0:s.x,y-window.innerWidth),y:Math.min(s==null?void 0:s.y,window.innerHeight-w)})};return window.addEventListener("resize",L),()=>{window.removeEventListener("resize",L)}},[s,y,w]),m.useEffect(()=>(p.current&&(g.current||(g.current=new ResizeObserver(()=>{o(L=>{p.current&&(L.viewState.dailyHeliostatYieldPanelRect||(L.viewState.dailyHeliostatYieldPanelRect=new cr(0,0,600,400)),L.viewState.dailyHeliostatYieldPanelRect.width=p.current.offsetWidth,L.viewState.dailyHeliostatYieldPanelRect.height=p.current.offsetHeight)})})),g.current.observe(p.current)),()=>{var L;(L=g.current)==null||L.disconnect()}),[]);const x=(L,k)=>{C({x:Math.max(k.x,y-window.innerWidth),y:Math.min(k.y,window.innerHeight-w)})},S=(L,k)=>{o(N=>{N.viewState.dailyHeliostatYieldPanelRect||(N.viewState.dailyHeliostatYieldPanelRect=new cr(0,0,600,400)),N.viewState.dailyHeliostatYieldPanelRect.x=Math.max(k.x,y-window.innerWidth),N.viewState.dailyHeliostatYieldPanelRect.y=Math.min(k.y,window.innerHeight-w)})},R=()=>{o(L=>{L.viewState.showDailyHeliostatYieldPanel=!1,e&&(L.actionInfo={name:"Close Heliostat Daily Yield Graph",timestamp:new Date().getTime()})})},M=i(z.Heliostat);m.useEffect(()=>{M<2&&l&&o(L=>{L.graphState&&(L.graphState.dailyHeliostatIndividualOutputs=!1)})},[M,l]);const{t:D}=Vl(),E=D("word.Hour",A),W=D("heliostatYieldPanel.YieldPerHour",A),j=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:f,handle:".handle",bounds:"parent",axis:"both",position:b,onDrag:x,onStop:S,onMouseDown:()=>{o(L=>{L.selectedFloatingWindow="dailyHeliostatYieldPanel"})},children:h.jsx(fUo,{ref:f,style:{zIndex:d==="dailyHeliostatYieldPanel"?Sc:9},children:h.jsxs(hUo,{ref:p,style:{opacity:n,width:(s?s.width:600)+"px",height:(s?s.height:400)+"px"},children:[h.jsxs(pUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[D("heliostatYieldPanel.HeliostatDailyYield",A)+": ",h.jsx("span",{style:{fontSize:"10px"},children:D("sensorPanel.WeatherDataFrom",A)+" "+t+" | "+yr(r).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{R()},onMouseDown:()=>{R()},children:D("word.Close",A)})]}),h.jsx(Tf,{type:vi.DailyHeliostatYield,chartType:l?Ml.Line:Ml.Area,dataSource:a,labels:c,height:100,dataKeyAxisX:"Hour",labelX:E,labelY:W,unitY:D("word.kWh",A),yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),!u&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&M>1&&T.current.size>0?h.jsx(Al,{title:[...T.current.entries()].map((L,k)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:L[0]+": "}),h.jsx(nt,{span:8,children:L[1].toFixed(3)})]}),k===T.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:D("word.Total",A)+": "+P.toFixed(3)+" "+D("word.kWh",A)})]})]},k)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:D("shared.OutputBreakdown",A)})}):h.jsxs(en,{style:{cursor:"default"},children:[D("heliostatYieldPanel.DailyTotal",A),":",P.toFixed(2)," ",D("word.kWh",A)]}),M>1&&h.jsx(xc,{title:D("heliostatYieldPanel.ShowOutputsOfIndividualHeliostats",A),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:L=>{if(M===0){hn(D("analysisManager.NoHeliostatForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(k=>{k.graphState&&(k.graphState.dailyHeliostatIndividualOutputs=L),e&&(k.actionInfo={name:"Run Daily Simulation For Heliostats: "+(L?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(k=>{k.runDailySimulationForHeliostats=!0,k.pauseDailySimulationForHeliostats=!1,k.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:j?h.jsx(Sh,{}):h.jsx(Hf,{}),title:D(j?"word.Run":"word.Update",A),onClick:()=>{if(M===0){hn(D("analysisManager.NoHeliostatForAnalysis",A));return}hn(D("message.SimulationStarted",A)),setTimeout(()=>{o(L=>{e&&(L.actionInfo={name:"Run Daily Simulation For Heliostats",timestamp:new Date().getTime()})}),ht.getState().set(L=>{L.runDailySimulationForHeliostats=!0,L.pauseDailySimulationForHeliostats=!1,L.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:D("word.SaveAsImage",A),onClick:()=>{kd("line-graph-"+E+"-"+W,"daily-heliostat-yield").then(()=>{hn(D("message.ScreenshotSaved",A)),e&&o(L=>{L.actionInfo={name:"Take Screenshot of Daily Heliostat Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:D("word.SaveAsCsv",A),onClick:()=>{bh(a,"daily-heliostat-yield.csv"),hn(D("message.CsvFileSaved",A)),e&&o(L=>{L.actionInfo={name:"Export Daily Heliostat Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),mUo=Ro.div` position: fixed; top: 85px; right: 36px; @@ -9314,7 +9314,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,wUo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=H(uW)??6,i=new Date(H(rl)),a=Tn(Tvt),l=H(aOe),s=Tn(lOe),c=H(jg),u=H(f8t),d=ht(Rf),f=H(Pc),p=be.useRef(null),g=m.useRef(null),y=m.useRef(),w=g.current?g.current.clientWidth+40:u?u.width+40:640,b=g.current?g.current.clientHeight+100:u?u.height+100:500,[C,P]=m.useState({x:u?Math.max(u.x,w-window.innerWidth):0,y:u?Math.min(u.y,window.innerHeight-b):0}),[v,T]=m.useState(0),A=m.useRef(new Map),x=Ms[i.getMonth()],S=Jt();m.useEffect(()=>{let F=0;A.current.clear();for(const U of a)for(const O in U)Object.hasOwn(U,O)&&O!=="Month"&&(F+=U[O],A.current.set(O,(A.current.get(O)??0)+U[O]));T(F)},[a]),m.useEffect(()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})},[u,w,b]),m.useEffect(()=>{const F=()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[u,w,b]),m.useEffect(()=>(g.current&&(y.current||(y.current=new ResizeObserver(()=>{o(F=>{g.current&&(F.viewState.yearlyHeliostatYieldPanelRect||(F.viewState.yearlyHeliostatYieldPanelRect=new cr(0,0,600,400)),F.viewState.yearlyHeliostatYieldPanelRect.width=g.current.offsetWidth,F.viewState.yearlyHeliostatYieldPanelRect.height=g.current.offsetHeight)})})),y.current.observe(g.current)),()=>{var F;(F=y.current)==null||F.disconnect()}),[]);const R=(F,U)=>{P({x:Math.max(U.x,w-window.innerWidth),y:Math.min(U.y,window.innerHeight-b)})},M=(F,U)=>{o(O=>{O.viewState.yearlyHeliostatYieldPanelRect||(O.viewState.yearlyHeliostatYieldPanelRect=new cr(0,0,600,400)),O.viewState.yearlyHeliostatYieldPanelRect.x=Math.max(U.x,w-window.innerWidth),O.viewState.yearlyHeliostatYieldPanelRect.y=Math.min(U.y,window.innerHeight-b)})},D=()=>{o(F=>{F.viewState.showYearlyHeliostatYieldPanel=!1,e&&(F.actionInfo={name:"Close Heliostat Yearly Yield Graph",timestamp:new Date().getTime()})})},E=c(z.Heliostat);m.useEffect(()=>{E<2&&l&&o(F=>{F.graphState&&(F.graphState.yearlyHeliostatIndividualOutputs=!1)})},[E,l]);const{t:W}=Vl(),j=W("word.Month",S),L=W("heliostatYieldPanel.Yield",S),k=12/r,N=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:p,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:R,onStop:M,onMouseDown:()=>{o(F=>{F.selectedFloatingWindow="yearlyHeliostatYieldPanel"})},children:h.jsx(mUo,{ref:p,style:{zIndex:f==="yearlyHeliostatYieldPanel"?Sc:9},children:h.jsxs(yUo,{ref:g,style:{opacity:n,width:(u?u.width:600)+"px",height:(u?u.height:400)+"px"},children:[h.jsxs(AUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[W("heliostatYieldPanel.HeliostatYearlyYield",S)+": ",h.jsx("span",{style:{fontSize:"10px"},children:W("sensorPanel.WeatherDataFrom",S)+" "+t+" | "+i.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{D()},onMouseDown:()=>{D()},children:W("word.Close",S)})]}),h.jsx(Tf,{type:vi.YearlyHeliostatYield,chartType:l?Ml.Line:Ml.Area,dataSource:a.map(({Daylight:F,Clearness:U,...O})=>O),labels:s,height:100,dataKeyAxisX:"Month",labelX:j,labelY:L,unitY:W("word.kWh",S),yMin:0,curveType:"linear",fractionDigits:2,referenceX:x}),!d&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&E>1&&A.current.size>0?h.jsx(Al,{title:[...A.current.entries()].map((F,U)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:F[0]+": "}),h.jsx(nt,{span:8,children:(F[1]*k).toFixed(2)})]}),U===A.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:W("word.Total",S)+": "+(v*k).toFixed(2)+" "+W("word.kWh",S)})]})]},U)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:W("shared.OutputBreakdown",S)})}):h.jsxs(en,{children:[W("heliostatYieldPanel.YearlyTotal",S),":",(v*k).toFixed(2)," ",W("word.kWh",S)]}),E>1&&h.jsx(xc,{title:W("heliostatYieldPanel.ShowOutputsOfIndividualHeliostats",S),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:F=>{if(E===0){hn(W("analysisManager.NoHeliostatForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(U=>{U.graphState&&(U.graphState.yearlyHeliostatIndividualOutputs=F),e&&(U.actionInfo={name:"Run Yearly Simulation For Heliostats: "+(F?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(U=>{U.runYearlySimulationForHeliostats=!0,U.pauseYearlySimulationForHeliostats=!1,U.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:N?h.jsx(Sh,{}):h.jsx(Hf,{}),title:W(N?"word.Run":"word.Update",S),onClick:()=>{if(E===0){hn(W("analysisManager.NoHeliostatForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(F=>{e&&(F.actionInfo={name:"Run Yearly Simulation For Heliostats",timestamp:new Date().getTime()})}),ht.getState().set(F=>{F.runYearlySimulationForHeliostats=!0,F.pauseYearlySimulationForHeliostats=!1,F.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:W("word.SaveAsImage",S),onClick:()=>{kd("line-graph-"+j+"-"+L,"yearly-heliostat-yield").then(()=>{hn(W("message.ScreenshotSaved",S)),e&&o(F=>{F.actionInfo={name:"Take Screenshot of Yearly Heliostat Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:W("word.SaveAsCsv",S),onClick:()=>{bh(a,"yearly-heliostat-yield.csv"),hn(W("message.CsvFileSaved",S)),e&&o(F=>{F.actionInfo={name:"Export Yearly Heliostat Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),vUo=be.memo(({dataSource:t,height:e,dataKeyAxisX:n,labelX:o,labelY1:r,labelY2:i,unitX:a,unitY1:l,unitY2:s,yMin1:c="auto",yMax1:u="auto",yMin2:d="auto",yMax2:f="auto",curveType:p="linear",referenceX:g,fractionDigits:y=2,symbolCount:w=12})=>{const[b,C]=m.useState(0),[P,v]=m.useState(null),T=!0,A=!0,x=2,S=1;m.useEffect(()=>{if(!t||t.length===0)return;let W=Array.isArray(t)?Object.keys(t[0]).length-1:Object.keys(t).length-1;W--,b!==W/2&&C(W/2)},[t]);const R=m.useMemo(()=>{const W=[];let j;W.push(h.jsx(Hg,{yAxisId:"left",type:p,name:"T_Ambient",dataKey:"T_Ambient",stroke:rg[0],strokeDasharray:"5 5",opacity:.5,strokeWidth:x,dot:!1,isAnimationActive:!1},"ambient-temperature"));for(let L=0;L0?F||j:!1,isAnimationActive:!1},"left-"+L)),k="V_Tower"+(L+1),N=P===null||P===k?1:.25,F=Dx(Ex[2*L+1],S,t.length,w,N),W.push(h.jsx(Hg,{yAxisId:"right",type:p,name:k,dataKey:k,stroke:rg[2*L+1],opacity:N,strokeWidth:x,dot:w>0?F||j:!1,isAnimationActive:!1},"right-"+L))}return W},[p,b,x,w,S,P]),M=()=>{},D=W=>{v(W.dataKey)},E=()=>{v(null)};return h.jsx(h.Fragment,{children:t&&h.jsx("div",{id:"biaxial-line-graph-"+o+"-"+r+"-"+i,style:{width:"100%",height:`${e}%`,position:"relative",direction:"ltr"},children:h.jsx("div",{style:{userSelect:"none",width:"100%",height:"100%",position:"absolute",top:0,left:0},children:h.jsx(lU,{width:"100%",height:"100%",children:h.jsxs(s6e,{data:t,onMouseDown:M,margin:{top:5,right:30,left:20,bottom:30},children:[h.jsx(rh,{formatter:W=>W.toFixed(y)}),h.jsx(bw,{vertical:A,horizontal:T,stroke:"rgba(128, 128, 128, 0.3)"}),h.jsx($9,{yAxisId:"left",x:g,stroke:"orange",strokeWidth:2}),h.jsx(l1,{dataKey:n??o,fontSize:"10px",children:h.jsx(os,{value:o+(a?" ("+a+")":""),offset:0,position:"bottom"})}),h.jsx(vh,{domain:[c,u],yAxisId:"left",fontSize:"10px",children:h.jsx(os,{dx:-15,value:r+(l?" ("+l+")":""),offset:0,angle:-90,position:"center"})}),h.jsx(vh,{domain:[d,f],yAxisId:"right",orientation:"right",fontSize:"10px",children:h.jsx(os,{dx:15,value:i+(s?" ("+s+")":""),offset:0,angle:-90,position:"center"})}),R,b>1&&h.jsx(J2,{iconType:"plainline",verticalAlign:"top",height:36,onMouseLeave:E,onMouseEnter:D})]})})})})})}),xUo=Ro.div` +`,wUo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=H(uW)??6,i=new Date(H(rl)),a=Tn(Tvt),l=H(aOe),s=Tn(lOe),c=H(jg),u=H(f8t),d=ht(Rf),f=H(Pc),p=be.useRef(null),g=m.useRef(null),y=m.useRef(),w=g.current?g.current.clientWidth+40:u?u.width+40:640,b=g.current?g.current.clientHeight+100:u?u.height+100:500,[C,P]=m.useState({x:u?Math.max(u.x,w-window.innerWidth):0,y:u?Math.min(u.y,window.innerHeight-b):0}),[v,T]=m.useState(0),A=m.useRef(new Map),x=Ms[i.getMonth()],S=Jt();m.useEffect(()=>{let F=0;A.current.clear();for(const U of a)for(const O in U)Object.hasOwn(U,O)&&O!=="Month"&&(F+=U[O],A.current.set(O,(A.current.get(O)??0)+U[O]));T(F)},[a]),m.useEffect(()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})},[u,w,b]),m.useEffect(()=>{const F=()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[u,w,b]),m.useEffect(()=>(g.current&&(y.current||(y.current=new ResizeObserver(()=>{o(F=>{g.current&&(F.viewState.yearlyHeliostatYieldPanelRect||(F.viewState.yearlyHeliostatYieldPanelRect=new cr(0,0,600,400)),F.viewState.yearlyHeliostatYieldPanelRect.width=g.current.offsetWidth,F.viewState.yearlyHeliostatYieldPanelRect.height=g.current.offsetHeight)})})),y.current.observe(g.current)),()=>{var F;(F=y.current)==null||F.disconnect()}),[]);const R=(F,U)=>{P({x:Math.max(U.x,w-window.innerWidth),y:Math.min(U.y,window.innerHeight-b)})},M=(F,U)=>{o(O=>{O.viewState.yearlyHeliostatYieldPanelRect||(O.viewState.yearlyHeliostatYieldPanelRect=new cr(0,0,600,400)),O.viewState.yearlyHeliostatYieldPanelRect.x=Math.max(U.x,w-window.innerWidth),O.viewState.yearlyHeliostatYieldPanelRect.y=Math.min(U.y,window.innerHeight-b)})},D=()=>{o(F=>{F.viewState.showYearlyHeliostatYieldPanel=!1,e&&(F.actionInfo={name:"Close Heliostat Yearly Yield Graph",timestamp:new Date().getTime()})})},E=c(z.Heliostat);m.useEffect(()=>{E<2&&l&&o(F=>{F.graphState&&(F.graphState.yearlyHeliostatIndividualOutputs=!1)})},[E,l]);const{t:W}=Vl(),j=W("word.Month",S),L=W("heliostatYieldPanel.Yield",S),k=12/r,N=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:p,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:R,onStop:M,onMouseDown:()=>{o(F=>{F.selectedFloatingWindow="yearlyHeliostatYieldPanel"})},children:h.jsx(mUo,{ref:p,style:{zIndex:f==="yearlyHeliostatYieldPanel"?Sc:9},children:h.jsxs(yUo,{ref:g,style:{opacity:n,width:(u?u.width:600)+"px",height:(u?u.height:400)+"px"},children:[h.jsxs(AUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[W("heliostatYieldPanel.HeliostatYearlyYield",S)+": ",h.jsx("span",{style:{fontSize:"10px"},children:W("sensorPanel.WeatherDataFrom",S)+" "+t+" | "+i.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{D()},onMouseDown:()=>{D()},children:W("word.Close",S)})]}),h.jsx(Tf,{type:vi.YearlyHeliostatYield,chartType:l?Ml.Line:Ml.Area,dataSource:a.map(({Daylight:F,Clearness:U,...O})=>O),labels:s,height:100,dataKeyAxisX:"Month",labelX:j,labelY:L,unitY:W("word.kWh",S),yMin:0,curveType:"linear",fractionDigits:2,referenceX:x}),!d&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[l&&E>1&&A.current.size>0?h.jsx(Al,{title:[...A.current.entries()].map((F,U)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:F[0]+": "}),h.jsx(nt,{span:8,children:(F[1]*k).toFixed(2)})]}),U===A.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:W("word.Total",S)+": "+(v*k).toFixed(2)+" "+W("word.kWh",S)})]})]},U)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:W("shared.OutputBreakdown",S)})}):h.jsxs(en,{children:[W("heliostatYieldPanel.YearlyTotal",S),":",(v*k).toFixed(2)," ",W("word.kWh",S)]}),E>1&&h.jsx(xc,{title:W("heliostatYieldPanel.ShowOutputsOfIndividualHeliostats",S),checkedChildren:h.jsx(fu,{}),unCheckedChildren:h.jsx(fu,{}),checked:l,onChange:F=>{if(E===0){hn(W("analysisManager.NoHeliostatForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(U=>{U.graphState&&(U.graphState.yearlyHeliostatIndividualOutputs=F),e&&(U.actionInfo={name:"Run Yearly Simulation For Heliostats: "+(F?"Individual":"Total"),timestamp:new Date().getTime()})}),ht.getState().set(U=>{U.runYearlySimulationForHeliostats=!0,U.pauseYearlySimulationForHeliostats=!1,U.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:N?h.jsx(Sh,{}):h.jsx(Hf,{}),title:W(N?"word.Run":"word.Update",S),onClick:()=>{if(E===0){hn(W("analysisManager.NoHeliostatForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(F=>{e&&(F.actionInfo={name:"Run Yearly Simulation For Heliostats",timestamp:new Date().getTime()})}),ht.getState().set(F=>{F.runYearlySimulationForHeliostats=!0,F.pauseYearlySimulationForHeliostats=!1,F.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:W("word.SaveAsImage",S),onClick:()=>{kd("line-graph-"+j+"-"+L,"yearly-heliostat-yield").then(()=>{hn(W("message.ScreenshotSaved",S)),e&&o(F=>{F.actionInfo={name:"Take Screenshot of Yearly Heliostat Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:W("word.SaveAsCsv",S),onClick:()=>{bh(a,"yearly-heliostat-yield.csv"),hn(W("message.CsvFileSaved",S)),e&&o(F=>{F.actionInfo={name:"Export Yearly Heliostat Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),vUo=be.memo(({dataSource:t,height:e,dataKeyAxisX:n,labelX:o,labelY1:r,labelY2:i,unitX:a,unitY1:l,unitY2:s,yMin1:c="auto",yMax1:u="auto",yMin2:d="auto",yMax2:f="auto",curveType:p="linear",referenceX:g,fractionDigits:y=2,symbolCount:w=12})=>{const[b,C]=m.useState(0),[P,v]=m.useState(null),T=!0,A=!0,x=2,S=1;m.useEffect(()=>{if(!t||t.length===0)return;let W=Array.isArray(t)?Object.keys(t[0]).length-1:Object.keys(t).length-1;W--,b!==W/2&&C(W/2)},[t]);const R=m.useMemo(()=>{const W=[];let j;W.push(h.jsx(Hg,{yAxisId:"left",type:p,name:"T_Ambient",dataKey:"T_Ambient",stroke:rg[0],strokeDasharray:"5 5",opacity:.5,strokeWidth:x,dot:!1,isAnimationActive:!1},"ambient-temperature"));for(let L=0;L0?F||j:!1,isAnimationActive:!1},"left-"+L)),k="V_Tower"+(L+1),N=P===null||P===k?1:.25,F=Dx(Ex[2*L+1],S,t.length,w,N),W.push(h.jsx(Hg,{yAxisId:"right",type:p,name:k,dataKey:k,stroke:rg[2*L+1],opacity:N,strokeWidth:x,dot:w>0?F||j:!1,isAnimationActive:!1},"right-"+L))}return W},[p,b,x,w,S,P]),M=()=>{},D=W=>{v(W.dataKey)},E=()=>{v(null)};return h.jsx(h.Fragment,{children:t&&h.jsx("div",{id:"biaxial-line-graph-"+o+"-"+r+"-"+i,style:{width:"100%",height:`${e}%`,position:"relative",direction:"ltr"},children:h.jsx("div",{style:{userSelect:"none",width:"100%",height:"100%",position:"absolute",top:0,left:0},children:h.jsx(sU,{width:"100%",height:"100%",children:h.jsxs(c6e,{data:t,onMouseDown:M,margin:{top:5,right:30,left:20,bottom:30},children:[h.jsx(rh,{formatter:W=>W.toFixed(y)}),h.jsx(bw,{vertical:A,horizontal:T,stroke:"rgba(128, 128, 128, 0.3)"}),h.jsx($9,{yAxisId:"left",x:g,stroke:"orange",strokeWidth:2}),h.jsx(l1,{dataKey:n??o,fontSize:"10px",children:h.jsx(os,{value:o+(a?" ("+a+")":""),offset:0,position:"bottom"})}),h.jsx(vh,{domain:[c,u],yAxisId:"left",fontSize:"10px",children:h.jsx(os,{dx:-15,value:r+(l?" ("+l+")":""),offset:0,angle:-90,position:"center"})}),h.jsx(vh,{domain:[d,f],yAxisId:"right",orientation:"right",fontSize:"10px",children:h.jsx(os,{dx:15,value:i+(s?" ("+s+")":""),offset:0,angle:-90,position:"center"})}),R,b>1&&h.jsx(J2,{iconType:"plainline",verticalAlign:"top",height:36,onMouseLeave:E,onMouseEnter:D})]})})})})})}),xUo=Ro.div` position: fixed; top: 80px; right: 24px; @@ -9352,7 +9352,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,TUo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=H(WYe),a=Tn(Ivt),l=Tn(Mvt),s=H(zvt),c=H(h8t),u=Tn(uOe),d=ht(Rf),f=H(Pc),p=be.useRef(null),g=m.useRef(null),y=m.useRef(),w=g.current?g.current.clientWidth+40:c?c.width+40:680,b=g.current?g.current.clientHeight+100:c?c.height+100:650,[C,P]=m.useState({x:c?Math.max(c.x,w-window.innerWidth):0,y:c?Math.min(c.y,window.innerHeight-b):0}),[v,T]=m.useState(0),A=m.useRef(new Map),x=Jt();m.useEffect(()=>{let F=0;A.current.clear();for(const U of a)for(const O in U)Object.hasOwn(U,O)&&O!=="Hour"&&(F+=U[O],A.current.set(O,(A.current.get(O)??0)+U[O]));T(F)},[a]),m.useEffect(()=>{P({x:Math.max(c==null?void 0:c.x,w-window.innerWidth),y:Math.min(c==null?void 0:c.y,window.innerHeight-b)})},[c,w,b]),m.useEffect(()=>{const F=()=>{P({x:Math.max(c==null?void 0:c.x,w-window.innerWidth),y:Math.min(c==null?void 0:c.y,window.innerHeight-b)})};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[c,w,b]),m.useEffect(()=>(g.current&&(y.current||(y.current=new ResizeObserver(()=>{o(F=>{g.current&&(F.viewState.dailyUpdraftTowerYieldPanelRect||(F.viewState.dailyUpdraftTowerYieldPanelRect=new cr(0,0,640,550)),F.viewState.dailyUpdraftTowerYieldPanelRect.width=g.current.offsetWidth,F.viewState.dailyUpdraftTowerYieldPanelRect.height=g.current.offsetHeight)})})),y.current.observe(g.current)),()=>{var F;(F=y.current)==null||F.disconnect()}),[]);const S=(F,U)=>{P({x:Math.max(U.x,w-window.innerWidth),y:Math.min(U.y,window.innerHeight-b)})},R=(F,U)=>{o(O=>{O.viewState.dailyUpdraftTowerYieldPanelRect||(O.viewState.dailyUpdraftTowerYieldPanelRect=new cr(0,0,640,550)),O.viewState.dailyUpdraftTowerYieldPanelRect.x=Math.max(U.x,w-window.innerWidth),O.viewState.dailyUpdraftTowerYieldPanelRect.y=Math.min(U.y,window.innerHeight-b)})},M=()=>{o(F=>{F.viewState.showDailyUpdraftTowerYieldPanel=!1,e&&(F.actionInfo={name:"Close Solar Updraft Tower Daily Yield Graph",timestamp:new Date().getTime()})})},D=i(Dn.UpdraftTower);m.useEffect(()=>{D<2&&s&&o(F=>{F.graphState&&(F.graphState.dailyUpdraftTowerIndividualOutputs=!1)})},[D,s]);const{t:E}=Vl(),W=E("word.Hour",x),j=E("updraftTowerYieldPanel.YieldPerHour",x),L=E("updraftTowerYieldPanel.ChimneyAirTemperature",x),k=E("updraftTowerYieldPanel.ChimneyWindSpeed",x),N=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:p,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:S,onStop:R,onMouseDown:()=>{o(F=>{F.selectedFloatingWindow="dailySolarUpdraftTowerYieldPanel"})},children:h.jsx(xUo,{ref:p,style:{zIndex:f==="dailySolarUpdraftTowerYieldPanel"?Sc:9},children:h.jsxs(bUo,{ref:g,style:{opacity:n,width:(c?c.width:640)+"px",height:(c?c.height:550)+"px"},children:[h.jsxs(SUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[E("updraftTowerYieldPanel.UpdraftTowerDailyYield",x)+": ",h.jsx("span",{style:{fontSize:"10px"},children:E("sensorPanel.WeatherDataFrom",x)+" "+t+" | "+yr(r).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{M()},onMouseDown:()=>{M()},children:E("word.Close",x)})]}),h.jsx(Tf,{type:vi.DailyUpdraftTowerYield,chartType:s?Ml.Line:Ml.Area,dataSource:a,labels:u,height:100,dataKeyAxisX:"Hour",labelX:W,labelY:j,unitY:E("word.kWh",x),yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),h.jsx(vUo,{dataSource:l,height:100,dataKeyAxisX:"Hour",labelX:W,labelY1:L,labelY2:k,unitY1:"°C",unitY2:E("word.MeterPerSecond",x),yMin1:0,yMin2:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),!d&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[D>1&&A.current.size>0?h.jsx(Al,{title:[...A.current.entries()].map((F,U)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:F[0]+": "}),h.jsx(nt,{span:8,children:F[1].toFixed(3)})]}),U===A.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:E("word.Total",x)+": "+v.toFixed(3)+" "+E("word.kWh",x)})]})]},U)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:E("shared.OutputBreakdown",x)})}):h.jsxs(en,{style:{cursor:"default"},children:[E("updraftTowerYieldPanel.DailyTotal",x),":",v.toFixed(2)," ",E("word.kWh",x)]}),h.jsx(lo,{type:"default",icon:N?h.jsx(Sh,{}):h.jsx(Hf,{}),title:E(N?"word.Run":"word.Update",x),onClick:()=>{if(D===0){hn(E("analysisManager.NoSolarUpdraftTowerForAnalysis",x));return}hn(E("message.SimulationStarted",x)),setTimeout(()=>{o(F=>{e&&(F.actionInfo={name:"Run Daily Simulation For Solar Updraft Tower",timestamp:new Date().getTime()})}),ht.getState().set(F=>{F.runDailySimulationForUpdraftTower=!0,F.pauseDailySimulationForUpdraftTower=!1,F.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:E("word.SaveAsImage",x),onClick:()=>{kd("line-graph-"+W+"-"+j,"daily-updraft-tower-yield").then(()=>{hn(E("message.ScreenshotSaved",x)),e&&o(F=>{F.actionInfo={name:"Take Screenshot of Daily Updraft Tower Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:E("word.SaveAsCsv",x),onClick:()=>{bh(a,"daily-updraft-tower-yield.csv"),hn(E("message.CsvFileSaved",x)),e&&o(F=>{F.actionInfo={name:"Export Daily Updraft Tower Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),PUo=Ro.div` +`,TUo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=new Date(H(rl)),i=H(NYe),a=Tn(Ivt),l=Tn(Mvt),s=H(zvt),c=H(h8t),u=Tn(uOe),d=ht(Rf),f=H(Pc),p=be.useRef(null),g=m.useRef(null),y=m.useRef(),w=g.current?g.current.clientWidth+40:c?c.width+40:680,b=g.current?g.current.clientHeight+100:c?c.height+100:650,[C,P]=m.useState({x:c?Math.max(c.x,w-window.innerWidth):0,y:c?Math.min(c.y,window.innerHeight-b):0}),[v,T]=m.useState(0),A=m.useRef(new Map),x=Jt();m.useEffect(()=>{let F=0;A.current.clear();for(const U of a)for(const O in U)Object.hasOwn(U,O)&&O!=="Hour"&&(F+=U[O],A.current.set(O,(A.current.get(O)??0)+U[O]));T(F)},[a]),m.useEffect(()=>{P({x:Math.max(c==null?void 0:c.x,w-window.innerWidth),y:Math.min(c==null?void 0:c.y,window.innerHeight-b)})},[c,w,b]),m.useEffect(()=>{const F=()=>{P({x:Math.max(c==null?void 0:c.x,w-window.innerWidth),y:Math.min(c==null?void 0:c.y,window.innerHeight-b)})};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[c,w,b]),m.useEffect(()=>(g.current&&(y.current||(y.current=new ResizeObserver(()=>{o(F=>{g.current&&(F.viewState.dailyUpdraftTowerYieldPanelRect||(F.viewState.dailyUpdraftTowerYieldPanelRect=new cr(0,0,640,550)),F.viewState.dailyUpdraftTowerYieldPanelRect.width=g.current.offsetWidth,F.viewState.dailyUpdraftTowerYieldPanelRect.height=g.current.offsetHeight)})})),y.current.observe(g.current)),()=>{var F;(F=y.current)==null||F.disconnect()}),[]);const S=(F,U)=>{P({x:Math.max(U.x,w-window.innerWidth),y:Math.min(U.y,window.innerHeight-b)})},R=(F,U)=>{o(O=>{O.viewState.dailyUpdraftTowerYieldPanelRect||(O.viewState.dailyUpdraftTowerYieldPanelRect=new cr(0,0,640,550)),O.viewState.dailyUpdraftTowerYieldPanelRect.x=Math.max(U.x,w-window.innerWidth),O.viewState.dailyUpdraftTowerYieldPanelRect.y=Math.min(U.y,window.innerHeight-b)})},M=()=>{o(F=>{F.viewState.showDailyUpdraftTowerYieldPanel=!1,e&&(F.actionInfo={name:"Close Solar Updraft Tower Daily Yield Graph",timestamp:new Date().getTime()})})},D=i(Dn.UpdraftTower);m.useEffect(()=>{D<2&&s&&o(F=>{F.graphState&&(F.graphState.dailyUpdraftTowerIndividualOutputs=!1)})},[D,s]);const{t:E}=Vl(),W=E("word.Hour",x),j=E("updraftTowerYieldPanel.YieldPerHour",x),L=E("updraftTowerYieldPanel.ChimneyAirTemperature",x),k=E("updraftTowerYieldPanel.ChimneyWindSpeed",x),N=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:p,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:S,onStop:R,onMouseDown:()=>{o(F=>{F.selectedFloatingWindow="dailySolarUpdraftTowerYieldPanel"})},children:h.jsx(xUo,{ref:p,style:{zIndex:f==="dailySolarUpdraftTowerYieldPanel"?Sc:9},children:h.jsxs(bUo,{ref:g,style:{opacity:n,width:(c?c.width:640)+"px",height:(c?c.height:550)+"px"},children:[h.jsxs(SUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[E("updraftTowerYieldPanel.UpdraftTowerDailyYield",x)+": ",h.jsx("span",{style:{fontSize:"10px"},children:E("sensorPanel.WeatherDataFrom",x)+" "+t+" | "+yr(r).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{M()},onMouseDown:()=>{M()},children:E("word.Close",x)})]}),h.jsx(Tf,{type:vi.DailyUpdraftTowerYield,chartType:s?Ml.Line:Ml.Area,dataSource:a,labels:u,height:100,dataKeyAxisX:"Hour",labelX:W,labelY:j,unitY:E("word.kWh",x),yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),h.jsx(vUo,{dataSource:l,height:100,dataKeyAxisX:"Hour",labelX:W,labelY1:L,labelY2:k,unitY1:"°C",unitY2:E("word.MeterPerSecond",x),yMin1:0,yMin2:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:r.getHours()}),!d&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[D>1&&A.current.size>0?h.jsx(Al,{title:[...A.current.entries()].map((F,U)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:F[0]+": "}),h.jsx(nt,{span:8,children:F[1].toFixed(3)})]}),U===A.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:E("word.Total",x)+": "+v.toFixed(3)+" "+E("word.kWh",x)})]})]},U)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:E("shared.OutputBreakdown",x)})}):h.jsxs(en,{style:{cursor:"default"},children:[E("updraftTowerYieldPanel.DailyTotal",x),":",v.toFixed(2)," ",E("word.kWh",x)]}),h.jsx(lo,{type:"default",icon:N?h.jsx(Sh,{}):h.jsx(Hf,{}),title:E(N?"word.Run":"word.Update",x),onClick:()=>{if(D===0){hn(E("analysisManager.NoSolarUpdraftTowerForAnalysis",x));return}hn(E("message.SimulationStarted",x)),setTimeout(()=>{o(F=>{e&&(F.actionInfo={name:"Run Daily Simulation For Solar Updraft Tower",timestamp:new Date().getTime()})}),ht.getState().set(F=>{F.runDailySimulationForUpdraftTower=!0,F.pauseDailySimulationForUpdraftTower=!1,F.simulationInProgress=!0})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:E("word.SaveAsImage",x),onClick:()=>{kd("line-graph-"+W+"-"+j,"daily-updraft-tower-yield").then(()=>{hn(E("message.ScreenshotSaved",x)),e&&o(F=>{F.actionInfo={name:"Take Screenshot of Daily Updraft Tower Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:E("word.SaveAsCsv",x),onClick:()=>{bh(a,"daily-updraft-tower-yield.csv"),hn(E("message.CsvFileSaved",x)),e&&o(F=>{F.actionInfo={name:"Export Daily Updraft Tower Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),PUo=Ro.div` position: fixed; top: 80px; left: 10px; @@ -9389,7 +9389,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,HUo=be.memo(({city:t})=>{const e=H(En),n=H(pu)??m0,o=H(fn),r=H(rl),i=H(Tc),a=H(A8t),l=H(jBe)??y2.Sinusoidal,s=H(cW)??900,c=H(U4t),u=H(Pc),d=be.useRef(null),f=m.useRef(null),p=m.useRef(),g=f.current?f.current.clientWidth+40:c?c.width+40:640,y=f.current?f.current.clientHeight+100:c?c.height+100:500,[w,b]=m.useState({x:c?Math.min(c.x,window.innerWidth-g):0,y:c?Math.min(c.y,window.innerHeight-y):0}),[C,P]=m.useState(l),v=new Date(r),T=Jt(),A=f1(t);m.useEffect(()=>{b({x:Math.min(c==null?void 0:c.x,window.innerWidth-g),y:Math.min(c==null?void 0:c.y,window.innerHeight-y)})},[c,g,y]),m.useEffect(()=>{const E=()=>{b({x:Math.min(c==null?void 0:c.x,window.innerWidth-g),y:Math.min(c==null?void 0:c.y,window.innerHeight-y)})};return window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[c,g,y]),m.useEffect(()=>(f.current&&(p.current||(p.current=new ResizeObserver(()=>{o(E=>{f.current&&(E.viewState.diurnalTemperaturePanelRect||(E.viewState.diurnalTemperaturePanelRect=new cr(0,0,600,400)),E.viewState.diurnalTemperaturePanelRect.width=f.current.offsetWidth,E.viewState.diurnalTemperaturePanelRect.height=f.current.offsetHeight)})})),p.current.observe(f.current)),()=>{var E;(E=p.current)==null||E.disconnect()}),[]);const x=m.useMemo(()=>{const E=[];if(A){const W=dl(v,i);for(let j=0;j<24;j++){v.setHours(j);const L=Qx(v,A.lowestTemperatures,A.highestTemperatures),k=me.minutesIntoDay(v);E.push({Hour:j,Sinusoidal:$x(L.high,L.low,y2.Sinusoidal,s,W,k),PartonLogan:$x(L.high,L.low,y2.PartonLogan,s,W,k),Ground:gZe(i,me.dayOfYear(v),k,A.lowestTemperatures,A.highestTemperatures,s,.5*(L.high-L.low),a.thermalDiffusivity??.05,ZUe)})}}return E},[A,s,r,i,a.thermalDiffusivity]),S=(E,W)=>{b({x:Math.min(W.x,window.innerWidth-g),y:Math.min(W.y,window.innerHeight-y)})},R=(E,W)=>{o(j=>{j.viewState.diurnalTemperaturePanelRect||(j.viewState.diurnalTemperaturePanelRect=new cr(0,0,600,400)),j.viewState.diurnalTemperaturePanelRect.x=Math.min(W.x,window.innerWidth-g),j.viewState.diurnalTemperaturePanelRect.y=Math.min(W.y,window.innerHeight-y)})},M=()=>{const E={name:"Close Diurnal Temperature Panel",timestamp:Date.now(),undo:()=>{o(W=>{W.viewState.showDiurnalTemperaturePanel=!0})},redo:()=>{o(W=>{W.viewState.showDiurnalTemperaturePanel=!1})}};e(E),o(W=>{W.viewState.showDiurnalTemperaturePanel=!1})},D=E=>{const W=C,j=E.target.value,L={name:"Change Diurnal Temperature Model",timestamp:Date.now(),oldValue:W,newValue:j,undo:()=>{P(L.oldValue),o(k=>{k.world.diurnalTemperatureModel=L.oldValue})},redo:()=>{P(L.newValue),o(k=>{k.world.diurnalTemperatureModel=L.newValue})}};e(L),P(j),o(k=>{k.world.diurnalTemperatureModel=j})};return h.jsx(_i,{nodeRef:d,handle:".handle",bounds:"parent",axis:"both",position:w,onDrag:S,onStop:R,onMouseDown:()=>{o(E=>{E.selectedFloatingWindow="diurnalTemperaturePanel"})},children:h.jsx(PUo,{ref:d,style:{zIndex:u==="diurnalTemperaturePanel"?Sc:10},children:h.jsxs(CUo,{ref:f,style:{opacity:n,width:(c?c.width:600)+"px",height:(c?c.height:400)+"px"},children:[h.jsxs(RUo,{className:"handle",children:[h.jsx("span",{children:Y.t("menu.settings.DiurnalTemperature",T)+": "+t+" | "+yc(v).format("MM/DD")}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{M()},onMouseDown:()=>{M()},children:Y.t("word.Close",T)})]}),h.jsx(Tf,{chartType:Ml.Line,type:vi.HourlyTemperatures,selectedIndex:C-y2.Sinusoidal,dataSource:x,height:100,dataKeyAxisX:"Hour",labelX:Y.t("word.Hour",T),labelY:Y.t("word.Temperature",T),unitY:"°C",fractionDigits:1,referenceX:v.getHours()}),h.jsxs(en,{style:{alignSelf:"center"},children:[h.jsx(en,{children:Y.t("diurnalTemperaturePanel.SelectAirTemperatureModel",T)}),h.jsxs(Ue.Group,{onChange:D,value:C,style:{display:"flex"},children:[h.jsx(Ue,{style:{width:"auto"},value:y2.Sinusoidal,children:Y.t("diurnalTemperaturePanel.Sinusoidal",T)}),h.jsx(Ue,{style:{width:"auto"},value:y2.PartonLogan,children:"Parton-Logan"})]})]})]})})})}),MUo=Ro.div` +`,HUo=be.memo(({city:t})=>{const e=H(En),n=H(pu)??m0,o=H(fn),r=H(rl),i=H(Tc),a=H(A8t),l=H(BBe)??y2.Sinusoidal,s=H(cW)??900,c=H(U4t),u=H(Pc),d=be.useRef(null),f=m.useRef(null),p=m.useRef(),g=f.current?f.current.clientWidth+40:c?c.width+40:640,y=f.current?f.current.clientHeight+100:c?c.height+100:500,[w,b]=m.useState({x:c?Math.min(c.x,window.innerWidth-g):0,y:c?Math.min(c.y,window.innerHeight-y):0}),[C,P]=m.useState(l),v=new Date(r),T=Jt(),A=f1(t);m.useEffect(()=>{b({x:Math.min(c==null?void 0:c.x,window.innerWidth-g),y:Math.min(c==null?void 0:c.y,window.innerHeight-y)})},[c,g,y]),m.useEffect(()=>{const E=()=>{b({x:Math.min(c==null?void 0:c.x,window.innerWidth-g),y:Math.min(c==null?void 0:c.y,window.innerHeight-y)})};return window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[c,g,y]),m.useEffect(()=>(f.current&&(p.current||(p.current=new ResizeObserver(()=>{o(E=>{f.current&&(E.viewState.diurnalTemperaturePanelRect||(E.viewState.diurnalTemperaturePanelRect=new cr(0,0,600,400)),E.viewState.diurnalTemperaturePanelRect.width=f.current.offsetWidth,E.viewState.diurnalTemperaturePanelRect.height=f.current.offsetHeight)})})),p.current.observe(f.current)),()=>{var E;(E=p.current)==null||E.disconnect()}),[]);const x=m.useMemo(()=>{const E=[];if(A){const W=dl(v,i);for(let j=0;j<24;j++){v.setHours(j);const L=Qx(v,A.lowestTemperatures,A.highestTemperatures),k=me.minutesIntoDay(v);E.push({Hour:j,Sinusoidal:$x(L.high,L.low,y2.Sinusoidal,s,W,k),PartonLogan:$x(L.high,L.low,y2.PartonLogan,s,W,k),Ground:gZe(i,me.dayOfYear(v),k,A.lowestTemperatures,A.highestTemperatures,s,.5*(L.high-L.low),a.thermalDiffusivity??.05,eje)})}}return E},[A,s,r,i,a.thermalDiffusivity]),S=(E,W)=>{b({x:Math.min(W.x,window.innerWidth-g),y:Math.min(W.y,window.innerHeight-y)})},R=(E,W)=>{o(j=>{j.viewState.diurnalTemperaturePanelRect||(j.viewState.diurnalTemperaturePanelRect=new cr(0,0,600,400)),j.viewState.diurnalTemperaturePanelRect.x=Math.min(W.x,window.innerWidth-g),j.viewState.diurnalTemperaturePanelRect.y=Math.min(W.y,window.innerHeight-y)})},M=()=>{const E={name:"Close Diurnal Temperature Panel",timestamp:Date.now(),undo:()=>{o(W=>{W.viewState.showDiurnalTemperaturePanel=!0})},redo:()=>{o(W=>{W.viewState.showDiurnalTemperaturePanel=!1})}};e(E),o(W=>{W.viewState.showDiurnalTemperaturePanel=!1})},D=E=>{const W=C,j=E.target.value,L={name:"Change Diurnal Temperature Model",timestamp:Date.now(),oldValue:W,newValue:j,undo:()=>{P(L.oldValue),o(k=>{k.world.diurnalTemperatureModel=L.oldValue})},redo:()=>{P(L.newValue),o(k=>{k.world.diurnalTemperatureModel=L.newValue})}};e(L),P(j),o(k=>{k.world.diurnalTemperatureModel=j})};return h.jsx(_i,{nodeRef:d,handle:".handle",bounds:"parent",axis:"both",position:w,onDrag:S,onStop:R,onMouseDown:()=>{o(E=>{E.selectedFloatingWindow="diurnalTemperaturePanel"})},children:h.jsx(PUo,{ref:d,style:{zIndex:u==="diurnalTemperaturePanel"?Sc:10},children:h.jsxs(CUo,{ref:f,style:{opacity:n,width:(c?c.width:600)+"px",height:(c?c.height:400)+"px"},children:[h.jsxs(RUo,{className:"handle",children:[h.jsx("span",{children:Y.t("menu.settings.DiurnalTemperature",T)+": "+t+" | "+yc(v).format("MM/DD")}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{M()},onMouseDown:()=>{M()},children:Y.t("word.Close",T)})]}),h.jsx(Tf,{chartType:Ml.Line,type:vi.HourlyTemperatures,selectedIndex:C-y2.Sinusoidal,dataSource:x,height:100,dataKeyAxisX:"Hour",labelX:Y.t("word.Hour",T),labelY:Y.t("word.Temperature",T),unitY:"°C",fractionDigits:1,referenceX:v.getHours()}),h.jsxs(en,{style:{alignSelf:"center"},children:[h.jsx(en,{children:Y.t("diurnalTemperaturePanel.SelectAirTemperatureModel",T)}),h.jsxs(Ue.Group,{onChange:D,value:C,style:{display:"flex"},children:[h.jsx(Ue,{style:{width:"auto"},value:y2.Sinusoidal,children:Y.t("diurnalTemperaturePanel.Sinusoidal",T)}),h.jsx(Ue,{style:{width:"auto"},value:y2.PartonLogan,children:"Parton-Logan"})]})]})]})})})}),MUo=Ro.div` position: fixed; top: 85px; right: 36px; @@ -9427,7 +9427,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,DUo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=H(BBe)??6,i=new Date(H(rl)),a=Tn(Fvt),l=H(kvt),s=Tn(uOe),c=H(WYe),u=H(g8t),d=ht(Rf),f=H(Pc),p=be.useRef(null),g=m.useRef(null),y=m.useRef(),w=g.current?g.current.clientWidth+40:u?u.width+40:640,b=g.current?g.current.clientHeight+100:u?u.height+100:500,[C,P]=m.useState({x:u?Math.max(u.x,w-window.innerWidth):0,y:u?Math.min(u.y,window.innerHeight-b):0}),[v,T]=m.useState(0),A=m.useRef(new Map),x=Ms[i.getMonth()],S=Jt();m.useEffect(()=>{let F=0;A.current.clear();for(const U of a)for(const O in U)Object.hasOwn(U,O)&&O!=="Month"&&(F+=U[O],A.current.set(O,(A.current.get(O)??0)+U[O]));T(F)},[a]),m.useEffect(()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})},[u,w,b]),m.useEffect(()=>{const F=()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[u,w,b]),m.useEffect(()=>(g.current&&(y.current||(y.current=new ResizeObserver(()=>{o(F=>{g.current&&(F.viewState.yearlyUpdraftTowerYieldPanelRect||(F.viewState.yearlyUpdraftTowerYieldPanelRect=new cr(0,0,600,400)),F.viewState.yearlyUpdraftTowerYieldPanelRect.width=g.current.offsetWidth,F.viewState.yearlyUpdraftTowerYieldPanelRect.height=g.current.offsetHeight)})})),y.current.observe(g.current)),()=>{var F;(F=y.current)==null||F.disconnect()}),[]);const R=(F,U)=>{P({x:Math.max(U.x,w-window.innerWidth),y:Math.min(U.y,window.innerHeight-b)})},M=(F,U)=>{o(O=>{O.viewState.yearlyUpdraftTowerYieldPanelRect||(O.viewState.yearlyUpdraftTowerYieldPanelRect=new cr(0,0,600,400)),O.viewState.yearlyUpdraftTowerYieldPanelRect.x=Math.max(U.x,w-window.innerWidth),O.viewState.yearlyUpdraftTowerYieldPanelRect.y=Math.min(U.y,window.innerHeight-b)})},D=()=>{o(F=>{F.viewState.showYearlyUpdraftTowerYieldPanel=!1,e&&(F.actionInfo={name:"Close Solar Updraft Tower Yearly Yield Graph",timestamp:new Date().getTime()})})},E=c(Dn.UpdraftTower);m.useEffect(()=>{E<2&&l&&o(F=>{F.graphState&&(F.graphState.yearlyUpdraftTowerIndividualOutputs=!1)})},[E,l]);const{t:W}=Vl(),j=W("word.Month",S),L=W("updraftTowerYieldPanel.Yield",S),k=12/r,N=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:p,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:R,onStop:M,onMouseDown:()=>{o(F=>{F.selectedFloatingWindow="yearlySolarUpdraftTowerYieldPanel"})},children:h.jsx(MUo,{ref:p,style:{zIndex:f==="yearlySolarUpdraftTowerYieldPanel"?Sc:9},children:h.jsxs(IUo,{ref:g,style:{opacity:n,width:(u?u.width:600)+"px",height:(u?u.height:400)+"px"},children:[h.jsxs(zUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[W("updraftTowerYieldPanel.UpdraftTowerYearlyYield",S)+": ",h.jsx("span",{style:{fontSize:"10px"},children:W("sensorPanel.WeatherDataFrom",S)+" "+t+" | "+i.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{D()},onMouseDown:()=>{D()},children:W("word.Close",S)})]}),h.jsx(Tf,{type:vi.YearlyUpdraftTowerYield,chartType:l?Ml.Line:Ml.Area,dataSource:a.map(({Daylight:F,Clearness:U,...O})=>O),labels:s,height:100,dataKeyAxisX:"Month",labelX:j,labelY:L,unitY:W("word.kWh",S),yMin:0,curveType:"linear",fractionDigits:2,referenceX:x}),!d&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[E>1&&A.current.size>0?h.jsx(Al,{title:[...A.current.entries()].map((F,U)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:F[0]+": "}),h.jsx(nt,{span:8,children:(F[1]*k).toFixed(2)})]}),U===A.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:W("word.Total",S)+": "+(v*k).toFixed(2)+" "+W("word.kWh",S)})]})]},U)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:W("shared.OutputBreakdown",S)})}):h.jsxs(en,{children:[W("updraftTowerYieldPanel.YearlyTotal",S),":",(v*k).toFixed(2)," ",W("word.kWh",S)]}),h.jsx(lo,{type:"default",icon:N?h.jsx(Sh,{}):h.jsx(Hf,{}),title:W(N?"word.Run":"word.Update",S),onClick:()=>{if(E===0){hn(W("analysisManager.NoSolarUpdraftTowerForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(F=>{e&&(F.actionInfo={name:"Run Yearly Simulation For Solar Updraft Tower",timestamp:new Date().getTime()})}),ht.getState().set(F=>{F.simulationInProgress=!0,F.runYearlySimulationForUpdraftTower=!0,F.pauseYearlySimulationForUpdraftTower=!1})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:W("word.SaveAsImage",S),onClick:()=>{kd("line-graph-"+j+"-"+L,"yearly-updraft-tower-yield").then(()=>{hn(W("message.ScreenshotSaved",S)),e&&o(F=>{F.actionInfo={name:"Take Screenshot of Yearly Updraft Tower Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:W("word.SaveAsCsv",S),onClick:()=>{bh(a,"yearly-updraft-tower-yield.csv"),hn(W("message.CsvFileSaved",S)),e&&o(F=>{F.actionInfo={name:"Export Yearly Updraft Tower Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),EUo=({dataSource:t,labels:e,height:n,dataKeyAxisX:o,labelX:r,labelY1:i,labelY2:a,unitX:l,unitY1:s,unitY2:c,yMin1:u="auto",yMax1:d="auto",yMin2:f="auto",yMax2:p="auto",curveType:g="linear",referenceX:y,fractionDigits:w=2})=>{const b=H(i$),[C,P]=m.useState(null),v=!0,T=!0,A=2,x=1,S=m.useRef([]),R=m.useMemo(()=>{if(!t||t.length===0)return[];const W=Object.keys(t[0]).length-1,j=t[1]?Object.keys(t[1]).length-1:W,L=t.length,k=[],N=W-1,F=(j-W)/N;let U;S.current.length=0;for(let O=0;O0?X||U:!1,isAnimationActive:!1},"left-"+O)),S.current.push({id:B,type:"line",value:B,color:rg[O]})}else if(O===N){const B="Objective",_=C===null||C===B?1:.25,X=Dx(Ex[O],x,t.length,L,_);k.push(h.jsx(Hg,{yAxisId:"right",type:g,name:B,dataKey:B,stroke:rg[O],opacity:_,strokeWidth:A,dot:L>0?X||U:!1,isAnimationActive:!1},"right")),S.current.push({id:B,type:"line",value:B,color:rg[N]})}else{const B=Math.floor((O-W)/F),_="Individual"+(O+1),X=.5,$=Dx(Ex[B],x*.5,t.length,L,X,rg[B]);k.push(h.jsx(Hg,{yAxisId:"left",type:g,name:_,dataKey:_,opacity:X,stroke:rg[B],strokeWidth:0,dot:$||U,isAnimationActive:!1},"left-"+O))}return k},[t,g,A,x,C]),M=()=>{},D=W=>{P(W.id)},E=()=>{P(null)};return h.jsx(h.Fragment,{children:t&&h.jsx("div",{id:"biaxial-line-graph-"+r+"-"+i+"-"+a,style:{width:"100%",height:`${n}%`,position:"relative",direction:"ltr"},children:h.jsx("div",{style:{userSelect:"none",width:"100%",height:"100%",position:"absolute",top:0,left:0},children:h.jsx(lU,{width:"100%",height:"100%",children:h.jsxs(s6e,{data:t,onMouseDown:M,margin:{top:5,right:30,left:20,bottom:30},children:[h.jsx(rh,{formatter:W=>W.toFixed(w),content:({active:W,payload:j})=>!W||!j?null:j.map(L=>{var k;if(!((k=L.name)!=null&&k.toString().startsWith("Individual"))){let N;return L.name==="Tilt Angle"?N=me.toDegrees(L.value*(b.maximumTiltAngle-b.minimumTiltAngle)+b.minimumTiltAngle).toFixed(w)+"°":L.name==="Inter-Row Spacing"?N=(L.value*(b.maximumInterRowSpacing-b.minimumInterRowSpacing)+b.minimumInterRowSpacing).toFixed(w)+"m":L.name==="Rack Width"?N=Math.floor(L.value*(b.maximumRowsPerRack-b.minimumRowsPerRack)+b.minimumRowsPerRack)+" panels":L.name==="Objective"?N=L.value.toFixed(w)+" "+c:N=L.value.toFixed(w),h.jsxs("div",{children:[L.name,": ",N]},L.name)}return null})}),h.jsx(bw,{vertical:T,horizontal:v,stroke:"rgba(128, 128, 128, 0.3)"}),h.jsx($9,{yAxisId:"left",x:y,stroke:"orange",strokeWidth:2}),h.jsx(l1,{dataKey:o??r,style:{fontSize:"10px"},children:h.jsx(os,{value:r+(l?" ("+l+")":""),offset:0,position:"bottom"})}),h.jsx(vh,{domain:[u,d],yAxisId:"left",style:{fontSize:"10px"},children:h.jsx(os,{dx:-20,value:i+(s?" ("+s+")":""),offset:0,angle:-90,position:"center"})}),h.jsx(vh,{domain:[f,p],yAxisId:"right",orientation:"right",style:{fontSize:"10px"},children:h.jsx(os,{dx:30,value:a+(c?" ("+c+")":""),offset:0,angle:-90,position:"center"})}),R,h.jsx(J2,{payload:S.current,iconType:"plainline",verticalAlign:"top",height:36,onMouseLeave:E,onMouseEnter:D})]})})})})})},FUo=Ro.div` +`,DUo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=H(YBe)??6,i=new Date(H(rl)),a=Tn(Fvt),l=H(kvt),s=Tn(uOe),c=H(NYe),u=H(g8t),d=ht(Rf),f=H(Pc),p=be.useRef(null),g=m.useRef(null),y=m.useRef(),w=g.current?g.current.clientWidth+40:u?u.width+40:640,b=g.current?g.current.clientHeight+100:u?u.height+100:500,[C,P]=m.useState({x:u?Math.max(u.x,w-window.innerWidth):0,y:u?Math.min(u.y,window.innerHeight-b):0}),[v,T]=m.useState(0),A=m.useRef(new Map),x=Ms[i.getMonth()],S=Jt();m.useEffect(()=>{let F=0;A.current.clear();for(const U of a)for(const O in U)Object.hasOwn(U,O)&&O!=="Month"&&(F+=U[O],A.current.set(O,(A.current.get(O)??0)+U[O]));T(F)},[a]),m.useEffect(()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})},[u,w,b]),m.useEffect(()=>{const F=()=>{P({x:Math.max(u==null?void 0:u.x,w-window.innerWidth),y:Math.min(u==null?void 0:u.y,window.innerHeight-b)})};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[u,w,b]),m.useEffect(()=>(g.current&&(y.current||(y.current=new ResizeObserver(()=>{o(F=>{g.current&&(F.viewState.yearlyUpdraftTowerYieldPanelRect||(F.viewState.yearlyUpdraftTowerYieldPanelRect=new cr(0,0,600,400)),F.viewState.yearlyUpdraftTowerYieldPanelRect.width=g.current.offsetWidth,F.viewState.yearlyUpdraftTowerYieldPanelRect.height=g.current.offsetHeight)})})),y.current.observe(g.current)),()=>{var F;(F=y.current)==null||F.disconnect()}),[]);const R=(F,U)=>{P({x:Math.max(U.x,w-window.innerWidth),y:Math.min(U.y,window.innerHeight-b)})},M=(F,U)=>{o(O=>{O.viewState.yearlyUpdraftTowerYieldPanelRect||(O.viewState.yearlyUpdraftTowerYieldPanelRect=new cr(0,0,600,400)),O.viewState.yearlyUpdraftTowerYieldPanelRect.x=Math.max(U.x,w-window.innerWidth),O.viewState.yearlyUpdraftTowerYieldPanelRect.y=Math.min(U.y,window.innerHeight-b)})},D=()=>{o(F=>{F.viewState.showYearlyUpdraftTowerYieldPanel=!1,e&&(F.actionInfo={name:"Close Solar Updraft Tower Yearly Yield Graph",timestamp:new Date().getTime()})})},E=c(Dn.UpdraftTower);m.useEffect(()=>{E<2&&l&&o(F=>{F.graphState&&(F.graphState.yearlyUpdraftTowerIndividualOutputs=!1)})},[E,l]);const{t:W}=Vl(),j=W("word.Month",S),L=W("updraftTowerYieldPanel.Yield",S),k=12/r,N=a&&a[0]?Object.keys(a[0]).length===0:!0;return h.jsx(_i,{nodeRef:p,handle:".handle",bounds:"parent",axis:"both",position:C,onDrag:R,onStop:M,onMouseDown:()=>{o(F=>{F.selectedFloatingWindow="yearlySolarUpdraftTowerYieldPanel"})},children:h.jsx(MUo,{ref:p,style:{zIndex:f==="yearlySolarUpdraftTowerYieldPanel"?Sc:9},children:h.jsxs(IUo,{ref:g,style:{opacity:n,width:(u?u.width:600)+"px",height:(u?u.height:400)+"px"},children:[h.jsxs(zUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[W("updraftTowerYieldPanel.UpdraftTowerYearlyYield",S)+": ",h.jsx("span",{style:{fontSize:"10px"},children:W("sensorPanel.WeatherDataFrom",S)+" "+t+" | "+i.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{D()},onMouseDown:()=>{D()},children:W("word.Close",S)})]}),h.jsx(Tf,{type:vi.YearlyUpdraftTowerYield,chartType:l?Ml.Line:Ml.Area,dataSource:a.map(({Daylight:F,Clearness:U,...O})=>O),labels:s,height:100,dataKeyAxisX:"Month",labelX:j,labelY:L,unitY:W("word.kWh",S),yMin:0,curveType:"linear",fractionDigits:2,referenceX:x}),!d&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[E>1&&A.current.size>0?h.jsx(Al,{title:[...A.current.entries()].map((F,U)=>h.jsxs(be.Fragment,{children:[h.jsxs(on,{style:{textAlign:"right"},children:[h.jsx(nt,{span:16,style:{textAlign:"right",paddingRight:"8px"},children:F[0]+": "}),h.jsx(nt,{span:8,children:(F[1]*k).toFixed(2)})]}),U===A.current.size-1&&h.jsxs(h.Fragment,{children:[h.jsx("hr",{}),h.jsx("div",{style:{textAlign:"right"},children:W("word.Total",S)+": "+(v*k).toFixed(2)+" "+W("word.kWh",S)})]})]},U)),children:h.jsx(en,{style:{cursor:"pointer",border:"2px solid #ccc",padding:"4px"},children:W("shared.OutputBreakdown",S)})}):h.jsxs(en,{children:[W("updraftTowerYieldPanel.YearlyTotal",S),":",(v*k).toFixed(2)," ",W("word.kWh",S)]}),h.jsx(lo,{type:"default",icon:N?h.jsx(Sh,{}):h.jsx(Hf,{}),title:W(N?"word.Run":"word.Update",S),onClick:()=>{if(E===0){hn(W("analysisManager.NoSolarUpdraftTowerForAnalysis",S));return}hn(W("message.SimulationStarted",S)),setTimeout(()=>{o(F=>{e&&(F.actionInfo={name:"Run Yearly Simulation For Solar Updraft Tower",timestamp:new Date().getTime()})}),ht.getState().set(F=>{F.simulationInProgress=!0,F.runYearlySimulationForUpdraftTower=!0,F.pauseYearlySimulationForUpdraftTower=!1})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:W("word.SaveAsImage",S),onClick:()=>{kd("line-graph-"+j+"-"+L,"yearly-updraft-tower-yield").then(()=>{hn(W("message.ScreenshotSaved",S)),e&&o(F=>{F.actionInfo={name:"Take Screenshot of Yearly Updraft Tower Yield Graph",timestamp:new Date().getTime()}})})}}),a&&a.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:W("word.SaveAsCsv",S),onClick:()=>{bh(a,"yearly-updraft-tower-yield.csv"),hn(W("message.CsvFileSaved",S)),e&&o(F=>{F.actionInfo={name:"Export Yearly Updraft Tower Yield Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),EUo=({dataSource:t,labels:e,height:n,dataKeyAxisX:o,labelX:r,labelY1:i,labelY2:a,unitX:l,unitY1:s,unitY2:c,yMin1:u="auto",yMax1:d="auto",yMin2:f="auto",yMax2:p="auto",curveType:g="linear",referenceX:y,fractionDigits:w=2})=>{const b=H(i$),[C,P]=m.useState(null),v=!0,T=!0,A=2,x=1,S=m.useRef([]),R=m.useMemo(()=>{if(!t||t.length===0)return[];const W=Object.keys(t[0]).length-1,j=t[1]?Object.keys(t[1]).length-1:W,L=t.length,k=[],N=W-1,F=(j-W)/N;let U;S.current.length=0;for(let O=0;O0?X||U:!1,isAnimationActive:!1},"left-"+O)),S.current.push({id:B,type:"line",value:B,color:rg[O]})}else if(O===N){const B="Objective",_=C===null||C===B?1:.25,X=Dx(Ex[O],x,t.length,L,_);k.push(h.jsx(Hg,{yAxisId:"right",type:g,name:B,dataKey:B,stroke:rg[O],opacity:_,strokeWidth:A,dot:L>0?X||U:!1,isAnimationActive:!1},"right")),S.current.push({id:B,type:"line",value:B,color:rg[N]})}else{const B=Math.floor((O-W)/F),_="Individual"+(O+1),X=.5,$=Dx(Ex[B],x*.5,t.length,L,X,rg[B]);k.push(h.jsx(Hg,{yAxisId:"left",type:g,name:_,dataKey:_,opacity:X,stroke:rg[B],strokeWidth:0,dot:$||U,isAnimationActive:!1},"left-"+O))}return k},[t,g,A,x,C]),M=()=>{},D=W=>{P(W.id)},E=()=>{P(null)};return h.jsx(h.Fragment,{children:t&&h.jsx("div",{id:"biaxial-line-graph-"+r+"-"+i+"-"+a,style:{width:"100%",height:`${n}%`,position:"relative",direction:"ltr"},children:h.jsx("div",{style:{userSelect:"none",width:"100%",height:"100%",position:"absolute",top:0,left:0},children:h.jsx(sU,{width:"100%",height:"100%",children:h.jsxs(c6e,{data:t,onMouseDown:M,margin:{top:5,right:30,left:20,bottom:30},children:[h.jsx(rh,{formatter:W=>W.toFixed(w),content:({active:W,payload:j})=>!W||!j?null:j.map(L=>{var k;if(!((k=L.name)!=null&&k.toString().startsWith("Individual"))){let N;return L.name==="Tilt Angle"?N=me.toDegrees(L.value*(b.maximumTiltAngle-b.minimumTiltAngle)+b.minimumTiltAngle).toFixed(w)+"°":L.name==="Inter-Row Spacing"?N=(L.value*(b.maximumInterRowSpacing-b.minimumInterRowSpacing)+b.minimumInterRowSpacing).toFixed(w)+"m":L.name==="Rack Width"?N=Math.floor(L.value*(b.maximumRowsPerRack-b.minimumRowsPerRack)+b.minimumRowsPerRack)+" panels":L.name==="Objective"?N=L.value.toFixed(w)+" "+c:N=L.value.toFixed(w),h.jsxs("div",{children:[L.name,": ",N]},L.name)}return null})}),h.jsx(bw,{vertical:T,horizontal:v,stroke:"rgba(128, 128, 128, 0.3)"}),h.jsx($9,{yAxisId:"left",x:y,stroke:"orange",strokeWidth:2}),h.jsx(l1,{dataKey:o??r,style:{fontSize:"10px"},children:h.jsx(os,{value:r+(l?" ("+l+")":""),offset:0,position:"bottom"})}),h.jsx(vh,{domain:[u,d],yAxisId:"left",style:{fontSize:"10px"},children:h.jsx(os,{dx:-20,value:i+(s?" ("+s+")":""),offset:0,angle:-90,position:"center"})}),h.jsx(vh,{domain:[f,p],yAxisId:"right",orientation:"right",style:{fontSize:"10px"},children:h.jsx(os,{dx:30,value:a+(c?" ("+c+")":""),offset:0,angle:-90,position:"center"})}),R,h.jsx(J2,{payload:S.current,iconType:"plainline",verticalAlign:"top",height:36,onMouseLeave:E,onMouseEnter:D})]})})})})})},FUo=Ro.div` position: fixed; top: 80px; right: 24px; @@ -9465,7 +9465,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,WUo=be.memo(()=>{const t=H(ma),e=H(pu)??m0,n=H(fn),o=H(dxt),r=H(TW),i=H(y8t),a=H(s3),l=H(DH),s=H.getState().evolutionaryAlgorithmState,c=ht(Rf),u=ht(NYe),d=H(Pc),f=be.useRef(null),p=m.useRef(null),g=m.useRef(),y=p.current?p.current.clientWidth+40:i?i.width+40:680,w=p.current?p.current.clientHeight+100:i?i.height+100:500,[b,C]=m.useState({x:i?Math.max(i.x,y-window.innerWidth):0,y:i?Math.min(i.y,window.innerHeight-w):0}),P=Jt();m.useEffect(()=>{C({x:Math.max(i==null?void 0:i.x,y-window.innerWidth),y:Math.min(i==null?void 0:i.y,window.innerHeight-w)})},[i,y,w]),m.useEffect(()=>{const k=()=>{C({x:Math.max(i==null?void 0:i.x,y-window.innerWidth),y:Math.min(i==null?void 0:i.y,window.innerHeight-w)})};return window.addEventListener("resize",k),()=>{window.removeEventListener("resize",k)}},[i,y,w]),m.useEffect(()=>(p.current&&(g.current||(g.current=new ResizeObserver(()=>{n(k=>{p.current&&(k.viewState.evolutionPanelRect||(k.viewState.evolutionPanelRect=new cr(0,0,640,400)),k.viewState.evolutionPanelRect.width=p.current.offsetWidth,k.viewState.evolutionPanelRect.height=p.current.offsetHeight)})})),g.current.observe(p.current)),()=>{var k;(k=g.current)==null||k.disconnect()}),[]);const v=(k,N)=>{C({x:Math.max(N.x,y-window.innerWidth),y:Math.min(N.y,window.innerHeight-w)})},T=(k,N)=>{n(F=>{F.viewState.evolutionPanelRect||(F.viewState.evolutionPanelRect=new cr(0,0,640,400)),F.viewState.evolutionPanelRect.x=Math.max(N.x,y-window.innerWidth),F.viewState.evolutionPanelRect.y=Math.min(N.y,window.innerHeight-w)})},A=()=>{n(k=>{k.viewState.showEvolutionPanel=!1,t&&(k.actionInfo={name:"Close Solar Panel Optimization Graph",timestamp:new Date().getTime()})})},x=m.useMemo(()=>!l||l===Vs.GENETIC_ALGORITHM?s.geneticAlgorithmParams:s.particleSwarmOptimizationParams,[l,s]),S=m.useMemo(()=>Y.t(l===Vs.GENETIC_ALGORITHM?"optimizationMenu.Generation":"optimizationMenu.Step",P),[l,P]),R=m.useMemo(()=>x.problem===Pi.SOLAR_PANEL_TILT_ANGLE?Y.t("solarPanelMenu.TiltAngle",P):Y.t("optimizationMenu.NormalizedVariables",P),[x.problem,P]),M=m.useMemo(()=>x.problem===Pi.SOLAR_PANEL_TILT_ANGLE?"°":"",[x.problem]),D=m.useMemo(()=>x.problem===Pi.SOLAR_PANEL_ARRAY&&(x.objectiveFunctionType===To.DAILY_PROFIT||x.objectiveFunctionType===To.YEARLY_PROFIT)?Y.t("word.dollar",P):Y.t("word.kWh",P),[x.problem,x.objectiveFunctionType,P]),E=m.useMemo(()=>{switch(x.objectiveFunctionType){case To.DAILY_PROFIT:return Y.t("optimizationMenu.ObjectiveFunctionDailyProfit",P);case To.YEARLY_PROFIT:return Y.t("optimizationMenu.ObjectiveFunctionYearlyProfit",P);case To.DAILY_AVERAGE_OUTPUT:return Y.t("optimizationMenu.ObjectiveFunctionDailyMeanYield",P);case To.YEARLY_AVERAGE_OUTPUT:return Y.t("optimizationMenu.ObjectiveFunctionYearlyMeanYield",P);case To.DAILY_TOTAL_OUTPUT:return Y.t("optimizationMenu.ObjectiveFunctionDailyTotalYield",P)}return Y.t("optimizationMenu.ObjectiveFunctionYearlyTotalYield",P)},[x.objectiveFunctionType,P]),W=m.useMemo(()=>a?x.problem===Pi.SOLAR_PANEL_TILT_ANGLE?a.type===z.Foundation:x.problem===Pi.SOLAR_PANEL_ARRAY?a.type===z.Polygon:!1:!1,[x.problem,a]),j=m.useMemo(()=>x.problem===Pi.SOLAR_PANEL_ARRAY?Y.t("optimizationMenu.ClickTargetPolygonToActivate",P):Y.t("optimizationMenu.ClickTargetFoundationToActivate",P),[x.problem,P]),L=m.useMemo(()=>{let k="";return x.problem===Pi.SOLAR_PANEL_TILT_ANGLE&&(k+=Y.t("optimizationMenu.SolarPanelTiltAngleOptimization",P)),x.problem===Pi.SOLAR_PANEL_ARRAY&&(k+=Y.t("optimizationMenu.SolarPanelArrayLayout",P)),k+=": ",k+=l===Vs.GENETIC_ALGORITHM?Y.t("optimizationMenu.GeneticAlgorithm",P):Y.t("optimizationMenu.ParticleSwarmOptimization",P),k},[x.problem,l,P]);return h.jsx(_i,{nodeRef:f,handle:".handle",bounds:"parent",axis:"both",position:b,onDrag:v,onStop:T,onMouseDown:()=>{n(k=>{k.selectedFloatingWindow="solarPanelOptimizationResult"})},children:h.jsx(FUo,{ref:f,style:{zIndex:d==="solarPanelOptimizationResult"?Sc:9},children:h.jsxs(kUo,{ref:p,style:{opacity:e,width:(i?i.width:640)+"px",height:(i?i.height:400)+"px"},children:[h.jsxs(LUo,{className:"handle",style:{direction:"ltr"},children:[h.jsx("span",{children:L}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{A()},onMouseDown:()=>{A()},children:`${Y.t("word.Close",P)}`})]}),h.jsx(EUo,{dataSource:o,labels:r,height:100,dataKeyAxisX:"Step",labelX:S,labelY1:R,labelY2:E,unitY1:M,unitY2:D,curveType:"linear",fractionDigits:2}),!c&&!u&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[W&&h.jsx(lo,{type:"default",icon:h.jsx(zQe,{}),title:Y.t("word.Run",P),onClick:()=>{hn(Y.t("message.EvolutionStarted",P)),setTimeout(()=>{ht.getState().set(k=>{k.runEvolution=!0,k.pauseEvolution=!1,k.evolutionInProgress=!0}),t&&n(k=>{let N;x.problem===Pi.SOLAR_PANEL_ARRAY?l===Vs.GENETIC_ALGORITHM?N="Run Genetic Algorithm for Solar Panel Array Layout":l===Vs.PARTICLE_SWARM_OPTIMIZATION&&(N="Run Particle Swarm Optimization for Solar Panel Array Layout"):x.problem===Pi.SOLAR_PANEL_TILT_ANGLE&&(l===Vs.GENETIC_ALGORITHM?N="Run Genetic Algorithm for Solar Panel Tilt Angle":l===Vs.PARTICLE_SWARM_OPTIMIZATION&&(N="Run Particle Swarm Optimization for Solar Panel Tilt Angle")),N&&(k.actionInfo={name:N,timestamp:new Date().getTime()})})},100)}}),!W&&h.jsx("span",{children:j}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:Y.t("word.SaveAsImage",P),onClick:()=>{kd("biaxial-line-graph-"+S+"-"+R+"-"+E,"solar-panel-tilt-angle-evolution").then(()=>{hn(Y.t("message.ScreenshotSaved",P))})}})]})]})})})}),NUo=be.memo(({setDialogVisible:t})=>{const e=H(fn),n=H(n$),o=H(En),[r,i]=m.useState(!1),[a,l]=m.useState(!1),[s,c]=m.useState({left:0,top:0,bottom:0,right:0}),u=m.useRef(null),d=m.useRef(null),f=m.useRef(n.electricitySellingPrice),p=m.useRef(n.operationalCostPerUnit),g=Jt();m.useEffect(()=>{var P;(P=d.current)==null||P.focus()},[]);const y=(P,v)=>{if(u.current){const{clientWidth:T,clientHeight:A}=window.document.documentElement,x=u.current.getBoundingClientRect();c({left:-x.left+v.x,right:T-(x.right-v.x),top:-x.top+v.y,bottom:A-((x==null?void 0:x.bottom)-v.y)})}},w=()=>{const P=n.electricitySellingPrice,v=f.current;if(P!==v){const x={name:"Electricity Selling Price",timestamp:Date.now(),oldValue:P,newValue:v,undo:()=>{e(S=>{S.economicsParams.electricitySellingPrice=x.oldValue})},redo:()=>{e(S=>{S.economicsParams.electricitySellingPrice=x.newValue})}};o(x),e(S=>{S.economicsParams.electricitySellingPrice=v})}const T=n.operationalCostPerUnit,A=p.current;if(T!==A){const x={name:"Operational Cost per Unit",timestamp:Date.now(),oldValue:T,newValue:A,undo:()=>{e(S=>{S.economicsParams.operationalCostPerUnit=x.oldValue})},redo:()=>{e(S=>{S.economicsParams.operationalCostPerUnit=x.newValue})}};o(x),e(S=>{S.economicsParams.operationalCostPerUnit=A})}},b=()=>{t(!1)},C=()=>{w(),t(!1)};return h.jsxs(Oi,{width:500,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>l(!0),onMouseOut:()=>l(!1),children:Y.t("economicsPanel.EconomicsParameters",g)}),footer:[h.jsx(lo,{onClick:b,children:Y.t("word.Cancel",g)},"Cancel"),h.jsx(lo,{type:"primary",ref:d,onClick:C,children:Y.t("word.OK",g)},"OK")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:P=>h.jsx(_i,{disabled:!a,bounds:s,onStart:(v,T)=>y(v,T),children:h.jsx("div",{ref:u,children:P})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:16,children:Y.t("economicsPanel.ElectricitySellingPrice",g)+" ([0.1, 1]): "}),h.jsx(nt,{className:"gutter-row",span:8,children:h.jsx(Mn,{min:.1,max:1,style:{width:"100%"},precision:2,value:f.current,step:.01,formatter:P=>`$${P}/kWh`,onChange:P=>{P!==null&&(f.current=P,i(!r))},onBlur:P=>{const v=P.target.value.replace("$","").replace("/kWh",""),T=parseFloat(v);f.current=Number.isNaN(T)?.1:T,i(!r)},onPressEnter:P=>{const v=P.target.value.replace("$","").replace("/kWh",""),T=parseFloat(v);f.current=Number.isNaN(T)?.1:T,i(!r)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:16,children:Y.t("economicsPanel.OperationalCostPerUnit",g)+" ([0.1, 1]): "}),h.jsx(nt,{className:"gutter-row",span:8,children:h.jsx(Mn,{min:.1,max:1,style:{width:"100%"},precision:2,value:p.current,step:.01,formatter:P=>`$${P}/day`,onChange:P=>{P!==null&&(p.current=P,i(!r))},onBlur:P=>{const v=P.target.value.replace("$","").replace("/day",""),T=parseFloat(v);p.current=Number.isNaN(T)?.1:T,i(!r)},onPressEnter:P=>{const v=P.target.value.replace("$","").replace("/day",""),T=parseFloat(v);p.current=Number.isNaN(T)?.1:T,i(!r)}})})]})]})}),u0t=(t,e,n)=>{const o=H.getState().elements,r=H(pA),i=H(Gn),a=ht(Rge),l=Tn(Tb),s=Tn(j8t),c=Tn(Y8t),u=[],d=[],f=m.useRef(new Map),p=m.useRef(new Map),g=m.useRef(new Map);return m.useEffect(()=>{var w,b,C,P,v,T,A,x;if(!e)return;const y=Qx(t,e.lowestTemperatures,e.highestTemperatures);f.current.clear(),p.current.clear(),g.current.clear();for(let S=0;S<24;S++){const R={},M=new Map;for(const D of o)if(me.onBuildingEnvelope(D)){const E=l.get(D.id);if(E){const W=D.type===z.Foundation?D:r(D);if(W&&!W.notBuilding&&me.getBuildingCompletionStatus(W,o)===jc.COMPLETE){let j=M.get(W.id);j||(j=n?{heater:0,ac:0,geothermal:0,solarPanel:0,label:(w=W.label)==null?void 0:w.trim()}:{heater:0,ac:0,geothermal:0,label:(b=W.label)==null?void 0:b.trim()},M.set(W.id,j),(C=W.hvacSystem)!=null&&C.id?W.hvacSystem.id&&W.hvacSystem.id.length>0&&!d.includes(W.hvacSystem.id)&&d.push(W.hvacSystem.id):W.label&&W.label.length>0&&!d.includes(W.label)&&d.push(W.label)),D.type===z.Foundation?j.geothermal+=E[S]:E[S]<0?j.heater+=E[S]:j.ac+=E[S]}}}for(const D of o)if(D.type===z.Foundation){const E=D;if(!E.notBuilding&&me.getBuildingCompletionStatus(E,o)!==jc.COMPLETE)continue;const W=M.get(D.id);if(W){const j=s.get(D.id);if(j&&(W.heater<0?(W.heater+=j[S],W.heater>0&&(W.heater=0)):W.ac>0&&(W.ac+=j[S])),W.solarPanel!==void 0){const L=c.get(D.id);L&&(W.solarPanel+=L[S])}}}if(M.size>1){let D=1;for(const E of M.keys()){R.Hour=S;const W=M.get(E);if(W){const j=i(E);if(j&&j.type===z.Foundation){const L=j;if(!L.notBuilding&&me.getBuildingCompletionStatus(L,o)===jc.COMPLETE){const k=((P=L.hvacSystem)==null?void 0:P.thermostatSetpoint)??20,N=((v=L.hvacSystem)==null?void 0:v.temperatureThreshold)??3,F=((T=L.hvacSystem)==null?void 0:T.id)??(W.label&&W.label!==""?W.label:D.toString());F===D.toString()&&D++;let U=Math.abs(vO(y,W.heater,k,N)),O=vO(y,W.ac,k,N);U>0?(U-=W.geothermal,U<0&&(U=0)):O>0&&(O+=W.geothermal,O<0&&(O=0));const B="Heater "+F;R[B]?R[B]=R[B]+U:R[B]=U;const _="AC "+F;if(R[_]?R[_]=R[_]+O:R[_]=O,W.solarPanel!==void 0){const Q="Solar "+F;R[Q]?R[Q]=R[Q]-W.solarPanel:R[Q]=-W.solarPanel}const X="Net "+F;R[X]?R[X]=R[X]+U+O-(W.solarPanel??0):R[X]=U+O-(W.solarPanel??0);let $=f.current.get(F);$===void 0&&($=0),$+=U,f.current.set(F,$),$=p.current.get(F),$===void 0&&($=0),$+=O,p.current.set(F,$),n&&($=g.current.get(F),$===void 0&&($=0),$+=W.solarPanel,g.current.set(F,$))}}}}}else for(const D of M.keys()){R.Hour=S;const E=M.get(D);if(E){const W=i(D);if(W&&W.type===z.Foundation){const j=W;if(!j.notBuilding&&me.getBuildingCompletionStatus(j,o)===jc.COMPLETE){const L=((A=j.hvacSystem)==null?void 0:A.thermostatSetpoint)??20,k=((x=j.hvacSystem)==null?void 0:x.temperatureThreshold)??3;let N=Math.abs(vO(y,E.heater,L,k)),F=vO(y,E.ac,L,k);N>0?(N-=E.geothermal,N<0&&(N=0)):F>0&&(F+=E.geothermal,F<0&&(F=0)),R.Heater=N,R.AC=F,E.solarPanel!==void 0&&(R.Solar=-E.solarPanel),R.Net=N+F-(E.solarPanel??0);const U="default";let O=f.current.get(U);O===void 0&&(O=0),O+=N,f.current.set(U,O),O=p.current.get(U),O===void 0&&(O=0),O+=F,p.current.set(U,O),n&&(O=g.current.get(U),O===void 0&&(O=0),O+=E.solarPanel,g.current.set(U,O))}}}}u.push(R)}},[a,e]),{sum:u,sumHeaterMap:f.current,sumAcMap:p.current,sumSolarPanelMap:g.current,dataLabels:d}},UUo=be.memo(({horizontalGrid:t,verticalGrid:e,lineWidth:n,symbolSize:o,barCategoryGap:r,changeHorizontalGrid:i,changeVerticalGrid:a,changeLineWidth:l,changeSymbolSize:s,changeBarCategoryGap:c})=>{const u=Jt(),[d,f]=m.useState(!1),p=()=>{i==null||i(!t)},g=()=>{a==null||a(!e)},y=C=>{l==null||l(C/2)},w=C=>{s==null||s(C/5)},b=C=>{c==null||c(C)};return h.jsx(Al,{content:h.jsxs("div",{style:{width:"200px"},children:[h.jsx(EC,{min:0,max:10,value:n*2,onChange:y,children:Y.t("menu.graph.LineWidth",u)+":"}),h.jsx(EC,{min:2,max:12,value:o*5,onChange:w,children:Y.t("menu.graph.SymbolSize",u)+":"}),h.jsx(EC,{min:0,max:20,value:r,onChange:b,children:Y.t("menu.graph.BarCategoryGap",u)+":"}),h.jsx(hw,{checked:t,onClick:p,children:Y.t("menu.graph.ShowHorizontalGridLines",u)}),h.jsx(hw,{checked:e,onClick:g,children:Y.t("menu.graph.ShowHorizontalGridLines",u)})]}),children:h.jsx(Ome,{style:{position:"absolute",fontSize:"30px",top:"4px",right:"30px",transition:"0.5s",color:d?"darkgray":"lightblue",cursor:"pointer"},onMouseOver:()=>{f(!0)},onMouseOut:()=>{f(!1)}})})}),d0t=({type:t,dataSource:e,hasSolarPanels:n,labels:o,height:r,dataKeyAxisX:i,labelX:a,labelY:l,unitX:s,unitY:c,yMin:u="auto",yMax:d="auto",curveType:f="linear",referenceX:p,fractionDigits:g=2,symbolCount:y=12})=>{const[w,b]=m.useState(0),[C,P]=m.useState(),[v,T]=m.useState(!0),[A,x]=m.useState(!0),[S,R]=m.useState(null),[M,D]=m.useState(2),[E,W]=m.useState(1),[j,L]=m.useState(2);m.useEffect(()=>{if(!e||e.length===0)return;const O=n?4:3,B=(Array.isArray(e)?Object.keys(e[0]).length-1:Object.keys(e).length-1)/O;if(w!==B&&b(B),B===1&&e[0]){for(const _ in e[0])if(_.startsWith("Heater")){P(_.length>6?_.substring(6).trim():void 0);break}}},[e]);const k=m.useMemo(()=>{const O=[],B=n?4:3;let _;const X="gray",$=1;for(let le=0;le1?o[le*B]:C?"Heater "+C:"Heater";O.push(h.jsx(Y2,{name:q,dataKey:q,stroke:X,fill:"#FA8072",opacity:S===null||S===q?1:.25,strokeWidth:$,isAnimationActive:!1,stackId:"stack"+le},le*B)),q=w>1?o[le*B+1]:C?"AC "+C:"AC",O.push(h.jsx(Y2,{name:q,dataKey:q,stroke:X,fill:"#00BFFF",opacity:S===null||S===q?1:.25,strokeWidth:$,isAnimationActive:!1,stackId:"stack"+le},le*B+1)),n&&(q=w>1?o[le*B+2]:C?"Solar "+C:"Solar",O.push(h.jsx(Y2,{name:q,dataKey:q,stroke:X,fill:"#3CB371",opacity:S===null||S===q?1:.25,strokeWidth:$,isAnimationActive:!1,stackId:"stack"+le},le*B+2)))}const Q=B-1;for(let le=0;le1?o[le*B+Q]:C?"Net "+C:"Net",te=S===null||S===q?1:.25,re=Dx(Ex[le],E,e.length,y,te);le===0&&(_=re),O.push(h.jsx(Hg,{type:f,name:q,dataKey:q,stroke:rg[le],opacity:S===null||S===q?1:.25,strokeWidth:M,dot:y>0?re||_:!1,isAnimationActive:!1},le*B+Q))}return O},[t,f,o,w,C,M,y,E,S]),N=()=>{},F=O=>{R(O.dataKey)},U=()=>{R(null)};return h.jsx(h.Fragment,{children:e&&h.jsx("div",{id:"line-graph-"+a+"-"+l,style:{width:"100%",height:`${r}%`,position:"relative",direction:"ltr"},children:h.jsxs("div",{style:{userSelect:"none",width:"100%",height:"100%",position:"absolute",top:0,left:0},children:[h.jsx(lU,{width:"100%",height:"100%",children:h.jsxs(BEo,{data:e,stackOffset:"sign",barGap:0,barCategoryGap:j,onMouseDown:N,margin:{top:5,right:30,left:20,bottom:30},children:[h.jsx(rh,{formatter:O=>O.toFixed(g)+" "+c}),h.jsx(bw,{vertical:A,horizontal:v,stroke:"rgba(128, 128, 128, 0.3)"}),h.jsx($9,{x:p,stroke:"orange",strokeWidth:2}),h.jsx(l1,{dataKey:i??a,fontSize:"10px",children:h.jsx(os,{value:a+(s?" ("+s+")":""),offset:0,position:"bottom"})}),h.jsx(vh,{domain:[u,d],fontSize:"10px",children:h.jsx(os,{dx:-15,value:l+(c?" ("+c+")":""),offset:0,angle:-90,position:"center"})}),k,h.jsx($9,{y:0,stroke:"#888"}),w>0&&h.jsx(J2,{wrapperStyle:{fontSize:"11px"},iconType:"plainline",verticalAlign:"top",height:36,onMouseLeave:U,onMouseEnter:F})]})}),h.jsx(UUo,{symbolSize:E,lineWidth:M,barCategoryGap:j,horizontalGrid:v,verticalGrid:A,changeHorizontalGrid:O=>{T(O)},changeVerticalGrid:O=>{x(O)},changeLineWidth:O=>{D(O)},changeSymbolSize:O=>{W(O)},changeBarCategoryGap:O=>{L(O)}})]})})})},jUo=Ro.div` +`,WUo=be.memo(()=>{const t=H(da),e=H(pu)??m0,n=H(fn),o=H(dxt),r=H(PW),i=H(y8t),a=H(s3),l=H(DH),s=H.getState().evolutionaryAlgorithmState,c=ht(Rf),u=ht(UYe),d=H(Pc),f=be.useRef(null),p=m.useRef(null),g=m.useRef(),y=p.current?p.current.clientWidth+40:i?i.width+40:680,w=p.current?p.current.clientHeight+100:i?i.height+100:500,[b,C]=m.useState({x:i?Math.max(i.x,y-window.innerWidth):0,y:i?Math.min(i.y,window.innerHeight-w):0}),P=Jt();m.useEffect(()=>{C({x:Math.max(i==null?void 0:i.x,y-window.innerWidth),y:Math.min(i==null?void 0:i.y,window.innerHeight-w)})},[i,y,w]),m.useEffect(()=>{const k=()=>{C({x:Math.max(i==null?void 0:i.x,y-window.innerWidth),y:Math.min(i==null?void 0:i.y,window.innerHeight-w)})};return window.addEventListener("resize",k),()=>{window.removeEventListener("resize",k)}},[i,y,w]),m.useEffect(()=>(p.current&&(g.current||(g.current=new ResizeObserver(()=>{n(k=>{p.current&&(k.viewState.evolutionPanelRect||(k.viewState.evolutionPanelRect=new cr(0,0,640,400)),k.viewState.evolutionPanelRect.width=p.current.offsetWidth,k.viewState.evolutionPanelRect.height=p.current.offsetHeight)})})),g.current.observe(p.current)),()=>{var k;(k=g.current)==null||k.disconnect()}),[]);const v=(k,N)=>{C({x:Math.max(N.x,y-window.innerWidth),y:Math.min(N.y,window.innerHeight-w)})},T=(k,N)=>{n(F=>{F.viewState.evolutionPanelRect||(F.viewState.evolutionPanelRect=new cr(0,0,640,400)),F.viewState.evolutionPanelRect.x=Math.max(N.x,y-window.innerWidth),F.viewState.evolutionPanelRect.y=Math.min(N.y,window.innerHeight-w)})},A=()=>{n(k=>{k.viewState.showEvolutionPanel=!1,t&&(k.actionInfo={name:"Close Solar Panel Optimization Graph",timestamp:new Date().getTime()})})},x=m.useMemo(()=>!l||l===Vs.GENETIC_ALGORITHM?s.geneticAlgorithmParams:s.particleSwarmOptimizationParams,[l,s]),S=m.useMemo(()=>Y.t(l===Vs.GENETIC_ALGORITHM?"optimizationMenu.Generation":"optimizationMenu.Step",P),[l,P]),R=m.useMemo(()=>x.problem===Pi.SOLAR_PANEL_TILT_ANGLE?Y.t("solarPanelMenu.TiltAngle",P):Y.t("optimizationMenu.NormalizedVariables",P),[x.problem,P]),M=m.useMemo(()=>x.problem===Pi.SOLAR_PANEL_TILT_ANGLE?"°":"",[x.problem]),D=m.useMemo(()=>x.problem===Pi.SOLAR_PANEL_ARRAY&&(x.objectiveFunctionType===To.DAILY_PROFIT||x.objectiveFunctionType===To.YEARLY_PROFIT)?Y.t("word.dollar",P):Y.t("word.kWh",P),[x.problem,x.objectiveFunctionType,P]),E=m.useMemo(()=>{switch(x.objectiveFunctionType){case To.DAILY_PROFIT:return Y.t("optimizationMenu.ObjectiveFunctionDailyProfit",P);case To.YEARLY_PROFIT:return Y.t("optimizationMenu.ObjectiveFunctionYearlyProfit",P);case To.DAILY_AVERAGE_OUTPUT:return Y.t("optimizationMenu.ObjectiveFunctionDailyMeanYield",P);case To.YEARLY_AVERAGE_OUTPUT:return Y.t("optimizationMenu.ObjectiveFunctionYearlyMeanYield",P);case To.DAILY_TOTAL_OUTPUT:return Y.t("optimizationMenu.ObjectiveFunctionDailyTotalYield",P)}return Y.t("optimizationMenu.ObjectiveFunctionYearlyTotalYield",P)},[x.objectiveFunctionType,P]),W=m.useMemo(()=>a?x.problem===Pi.SOLAR_PANEL_TILT_ANGLE?a.type===z.Foundation:x.problem===Pi.SOLAR_PANEL_ARRAY?a.type===z.Polygon:!1:!1,[x.problem,a]),j=m.useMemo(()=>x.problem===Pi.SOLAR_PANEL_ARRAY?Y.t("optimizationMenu.ClickTargetPolygonToActivate",P):Y.t("optimizationMenu.ClickTargetFoundationToActivate",P),[x.problem,P]),L=m.useMemo(()=>{let k="";return x.problem===Pi.SOLAR_PANEL_TILT_ANGLE&&(k+=Y.t("optimizationMenu.SolarPanelTiltAngleOptimization",P)),x.problem===Pi.SOLAR_PANEL_ARRAY&&(k+=Y.t("optimizationMenu.SolarPanelArrayLayout",P)),k+=": ",k+=l===Vs.GENETIC_ALGORITHM?Y.t("optimizationMenu.GeneticAlgorithm",P):Y.t("optimizationMenu.ParticleSwarmOptimization",P),k},[x.problem,l,P]);return h.jsx(_i,{nodeRef:f,handle:".handle",bounds:"parent",axis:"both",position:b,onDrag:v,onStop:T,onMouseDown:()=>{n(k=>{k.selectedFloatingWindow="solarPanelOptimizationResult"})},children:h.jsx(FUo,{ref:f,style:{zIndex:d==="solarPanelOptimizationResult"?Sc:9},children:h.jsxs(kUo,{ref:p,style:{opacity:e,width:(i?i.width:640)+"px",height:(i?i.height:400)+"px"},children:[h.jsxs(LUo,{className:"handle",style:{direction:"ltr"},children:[h.jsx("span",{children:L}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{A()},onMouseDown:()=>{A()},children:`${Y.t("word.Close",P)}`})]}),h.jsx(EUo,{dataSource:o,labels:r,height:100,dataKeyAxisX:"Step",labelX:S,labelY1:R,labelY2:E,unitY1:M,unitY2:D,curveType:"linear",fractionDigits:2}),!c&&!u&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[W&&h.jsx(lo,{type:"default",icon:h.jsx(zQe,{}),title:Y.t("word.Run",P),onClick:()=>{hn(Y.t("message.EvolutionStarted",P)),setTimeout(()=>{ht.getState().set(k=>{k.runEvolution=!0,k.pauseEvolution=!1,k.evolutionInProgress=!0}),t&&n(k=>{let N;x.problem===Pi.SOLAR_PANEL_ARRAY?l===Vs.GENETIC_ALGORITHM?N="Run Genetic Algorithm for Solar Panel Array Layout":l===Vs.PARTICLE_SWARM_OPTIMIZATION&&(N="Run Particle Swarm Optimization for Solar Panel Array Layout"):x.problem===Pi.SOLAR_PANEL_TILT_ANGLE&&(l===Vs.GENETIC_ALGORITHM?N="Run Genetic Algorithm for Solar Panel Tilt Angle":l===Vs.PARTICLE_SWARM_OPTIMIZATION&&(N="Run Particle Swarm Optimization for Solar Panel Tilt Angle")),N&&(k.actionInfo={name:N,timestamp:new Date().getTime()})})},100)}}),!W&&h.jsx("span",{children:j}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:Y.t("word.SaveAsImage",P),onClick:()=>{kd("biaxial-line-graph-"+S+"-"+R+"-"+E,"solar-panel-tilt-angle-evolution").then(()=>{hn(Y.t("message.ScreenshotSaved",P))})}})]})]})})})}),NUo=be.memo(({setDialogVisible:t})=>{const e=H(fn),n=H(n$),o=H(En),[r,i]=m.useState(!1),[a,l]=m.useState(!1),[s,c]=m.useState({left:0,top:0,bottom:0,right:0}),u=m.useRef(null),d=m.useRef(null),f=m.useRef(n.electricitySellingPrice),p=m.useRef(n.operationalCostPerUnit),g=Jt();m.useEffect(()=>{var P;(P=d.current)==null||P.focus()},[]);const y=(P,v)=>{if(u.current){const{clientWidth:T,clientHeight:A}=window.document.documentElement,x=u.current.getBoundingClientRect();c({left:-x.left+v.x,right:T-(x.right-v.x),top:-x.top+v.y,bottom:A-((x==null?void 0:x.bottom)-v.y)})}},w=()=>{const P=n.electricitySellingPrice,v=f.current;if(P!==v){const x={name:"Electricity Selling Price",timestamp:Date.now(),oldValue:P,newValue:v,undo:()=>{e(S=>{S.economicsParams.electricitySellingPrice=x.oldValue})},redo:()=>{e(S=>{S.economicsParams.electricitySellingPrice=x.newValue})}};o(x),e(S=>{S.economicsParams.electricitySellingPrice=v})}const T=n.operationalCostPerUnit,A=p.current;if(T!==A){const x={name:"Operational Cost per Unit",timestamp:Date.now(),oldValue:T,newValue:A,undo:()=>{e(S=>{S.economicsParams.operationalCostPerUnit=x.oldValue})},redo:()=>{e(S=>{S.economicsParams.operationalCostPerUnit=x.newValue})}};o(x),e(S=>{S.economicsParams.operationalCostPerUnit=A})}},b=()=>{t(!1)},C=()=>{w(),t(!1)};return h.jsxs(Oi,{width:500,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>l(!0),onMouseOut:()=>l(!1),children:Y.t("economicsPanel.EconomicsParameters",g)}),footer:[h.jsx(lo,{onClick:b,children:Y.t("word.Cancel",g)},"Cancel"),h.jsx(lo,{type:"primary",ref:d,onClick:C,children:Y.t("word.OK",g)},"OK")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:P=>h.jsx(_i,{disabled:!a,bounds:s,onStart:(v,T)=>y(v,T),children:h.jsx("div",{ref:u,children:P})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:16,children:Y.t("economicsPanel.ElectricitySellingPrice",g)+" ([0.1, 1]): "}),h.jsx(nt,{className:"gutter-row",span:8,children:h.jsx(Mn,{min:.1,max:1,style:{width:"100%"},precision:2,value:f.current,step:.01,formatter:P=>`$${P}/kWh`,onChange:P=>{P!==null&&(f.current=P,i(!r))},onBlur:P=>{const v=P.target.value.replace("$","").replace("/kWh",""),T=parseFloat(v);f.current=Number.isNaN(T)?.1:T,i(!r)},onPressEnter:P=>{const v=P.target.value.replace("$","").replace("/kWh",""),T=parseFloat(v);f.current=Number.isNaN(T)?.1:T,i(!r)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:16,children:Y.t("economicsPanel.OperationalCostPerUnit",g)+" ([0.1, 1]): "}),h.jsx(nt,{className:"gutter-row",span:8,children:h.jsx(Mn,{min:.1,max:1,style:{width:"100%"},precision:2,value:p.current,step:.01,formatter:P=>`$${P}/day`,onChange:P=>{P!==null&&(p.current=P,i(!r))},onBlur:P=>{const v=P.target.value.replace("$","").replace("/day",""),T=parseFloat(v);p.current=Number.isNaN(T)?.1:T,i(!r)},onPressEnter:P=>{const v=P.target.value.replace("$","").replace("/day",""),T=parseFloat(v);p.current=Number.isNaN(T)?.1:T,i(!r)}})})]})]})}),u0t=(t,e,n)=>{const o=H.getState().elements,r=H(pA),i=H(Gn),a=ht(Rge),l=Tn(Tb),s=Tn(j8t),c=Tn(Y8t),u=[],d=[],f=m.useRef(new Map),p=m.useRef(new Map),g=m.useRef(new Map);return m.useEffect(()=>{var w,b,C,P,v,T,A,x;if(!e)return;const y=Qx(t,e.lowestTemperatures,e.highestTemperatures);f.current.clear(),p.current.clear(),g.current.clear();for(let S=0;S<24;S++){const R={},M=new Map;for(const D of o)if(me.onBuildingEnvelope(D)){const E=l.get(D.id);if(E){const W=D.type===z.Foundation?D:r(D);if(W&&!W.notBuilding&&me.getBuildingCompletionStatus(W,o)===jc.COMPLETE){let j=M.get(W.id);j||(j=n?{heater:0,ac:0,geothermal:0,solarPanel:0,label:(w=W.label)==null?void 0:w.trim()}:{heater:0,ac:0,geothermal:0,label:(b=W.label)==null?void 0:b.trim()},M.set(W.id,j),(C=W.hvacSystem)!=null&&C.id?W.hvacSystem.id&&W.hvacSystem.id.length>0&&!d.includes(W.hvacSystem.id)&&d.push(W.hvacSystem.id):W.label&&W.label.length>0&&!d.includes(W.label)&&d.push(W.label)),D.type===z.Foundation?j.geothermal+=E[S]:E[S]<0?j.heater+=E[S]:j.ac+=E[S]}}}for(const D of o)if(D.type===z.Foundation){const E=D;if(!E.notBuilding&&me.getBuildingCompletionStatus(E,o)!==jc.COMPLETE)continue;const W=M.get(D.id);if(W){const j=s.get(D.id);if(j&&(W.heater<0?(W.heater+=j[S],W.heater>0&&(W.heater=0)):W.ac>0&&(W.ac+=j[S])),W.solarPanel!==void 0){const L=c.get(D.id);L&&(W.solarPanel+=L[S])}}}if(M.size>1){let D=1;for(const E of M.keys()){R.Hour=S;const W=M.get(E);if(W){const j=i(E);if(j&&j.type===z.Foundation){const L=j;if(!L.notBuilding&&me.getBuildingCompletionStatus(L,o)===jc.COMPLETE){const k=((P=L.hvacSystem)==null?void 0:P.thermostatSetpoint)??20,N=((v=L.hvacSystem)==null?void 0:v.temperatureThreshold)??3,F=((T=L.hvacSystem)==null?void 0:T.id)??(W.label&&W.label!==""?W.label:D.toString());F===D.toString()&&D++;let U=Math.abs(xO(y,W.heater,k,N)),O=xO(y,W.ac,k,N);U>0?(U-=W.geothermal,U<0&&(U=0)):O>0&&(O+=W.geothermal,O<0&&(O=0));const B="Heater "+F;R[B]?R[B]=R[B]+U:R[B]=U;const _="AC "+F;if(R[_]?R[_]=R[_]+O:R[_]=O,W.solarPanel!==void 0){const Q="Solar "+F;R[Q]?R[Q]=R[Q]-W.solarPanel:R[Q]=-W.solarPanel}const X="Net "+F;R[X]?R[X]=R[X]+U+O-(W.solarPanel??0):R[X]=U+O-(W.solarPanel??0);let $=f.current.get(F);$===void 0&&($=0),$+=U,f.current.set(F,$),$=p.current.get(F),$===void 0&&($=0),$+=O,p.current.set(F,$),n&&($=g.current.get(F),$===void 0&&($=0),$+=W.solarPanel,g.current.set(F,$))}}}}}else for(const D of M.keys()){R.Hour=S;const E=M.get(D);if(E){const W=i(D);if(W&&W.type===z.Foundation){const j=W;if(!j.notBuilding&&me.getBuildingCompletionStatus(j,o)===jc.COMPLETE){const L=((A=j.hvacSystem)==null?void 0:A.thermostatSetpoint)??20,k=((x=j.hvacSystem)==null?void 0:x.temperatureThreshold)??3;let N=Math.abs(xO(y,E.heater,L,k)),F=xO(y,E.ac,L,k);N>0?(N-=E.geothermal,N<0&&(N=0)):F>0&&(F+=E.geothermal,F<0&&(F=0)),R.Heater=N,R.AC=F,E.solarPanel!==void 0&&(R.Solar=-E.solarPanel),R.Net=N+F-(E.solarPanel??0);const U="default";let O=f.current.get(U);O===void 0&&(O=0),O+=N,f.current.set(U,O),O=p.current.get(U),O===void 0&&(O=0),O+=F,p.current.set(U,O),n&&(O=g.current.get(U),O===void 0&&(O=0),O+=E.solarPanel,g.current.set(U,O))}}}}u.push(R)}},[a,e]),{sum:u,sumHeaterMap:f.current,sumAcMap:p.current,sumSolarPanelMap:g.current,dataLabels:d}},UUo=be.memo(({horizontalGrid:t,verticalGrid:e,lineWidth:n,symbolSize:o,barCategoryGap:r,changeHorizontalGrid:i,changeVerticalGrid:a,changeLineWidth:l,changeSymbolSize:s,changeBarCategoryGap:c})=>{const u=Jt(),[d,f]=m.useState(!1),p=()=>{i==null||i(!t)},g=()=>{a==null||a(!e)},y=C=>{l==null||l(C/2)},w=C=>{s==null||s(C/5)},b=C=>{c==null||c(C)};return h.jsx(Al,{content:h.jsxs("div",{style:{width:"200px"},children:[h.jsx(EC,{min:0,max:10,value:n*2,onChange:y,children:Y.t("menu.graph.LineWidth",u)+":"}),h.jsx(EC,{min:2,max:12,value:o*5,onChange:w,children:Y.t("menu.graph.SymbolSize",u)+":"}),h.jsx(EC,{min:0,max:20,value:r,onChange:b,children:Y.t("menu.graph.BarCategoryGap",u)+":"}),h.jsx(hw,{checked:t,onClick:p,children:Y.t("menu.graph.ShowHorizontalGridLines",u)}),h.jsx(hw,{checked:e,onClick:g,children:Y.t("menu.graph.ShowHorizontalGridLines",u)})]}),children:h.jsx(_me,{style:{position:"absolute",fontSize:"30px",top:"4px",right:"30px",transition:"0.5s",color:d?"darkgray":"lightblue",cursor:"pointer"},onMouseOver:()=>{f(!0)},onMouseOut:()=>{f(!1)}})})}),d0t=({type:t,dataSource:e,hasSolarPanels:n,labels:o,height:r,dataKeyAxisX:i,labelX:a,labelY:l,unitX:s,unitY:c,yMin:u="auto",yMax:d="auto",curveType:f="linear",referenceX:p,fractionDigits:g=2,symbolCount:y=12})=>{const[w,b]=m.useState(0),[C,P]=m.useState(),[v,T]=m.useState(!0),[A,x]=m.useState(!0),[S,R]=m.useState(null),[M,D]=m.useState(2),[E,W]=m.useState(1),[j,L]=m.useState(2);m.useEffect(()=>{if(!e||e.length===0)return;const O=n?4:3,B=(Array.isArray(e)?Object.keys(e[0]).length-1:Object.keys(e).length-1)/O;if(w!==B&&b(B),B===1&&e[0]){for(const _ in e[0])if(_.startsWith("Heater")){P(_.length>6?_.substring(6).trim():void 0);break}}},[e]);const k=m.useMemo(()=>{const O=[],B=n?4:3;let _;const X="gray",$=1;for(let le=0;le1?o[le*B]:C?"Heater "+C:"Heater";O.push(h.jsx(Y2,{name:q,dataKey:q,stroke:X,fill:"#FA8072",opacity:S===null||S===q?1:.25,strokeWidth:$,isAnimationActive:!1,stackId:"stack"+le},le*B)),q=w>1?o[le*B+1]:C?"AC "+C:"AC",O.push(h.jsx(Y2,{name:q,dataKey:q,stroke:X,fill:"#00BFFF",opacity:S===null||S===q?1:.25,strokeWidth:$,isAnimationActive:!1,stackId:"stack"+le},le*B+1)),n&&(q=w>1?o[le*B+2]:C?"Solar "+C:"Solar",O.push(h.jsx(Y2,{name:q,dataKey:q,stroke:X,fill:"#3CB371",opacity:S===null||S===q?1:.25,strokeWidth:$,isAnimationActive:!1,stackId:"stack"+le},le*B+2)))}const Q=B-1;for(let le=0;le1?o[le*B+Q]:C?"Net "+C:"Net",te=S===null||S===q?1:.25,re=Dx(Ex[le],E,e.length,y,te);le===0&&(_=re),O.push(h.jsx(Hg,{type:f,name:q,dataKey:q,stroke:rg[le],opacity:S===null||S===q?1:.25,strokeWidth:M,dot:y>0?re||_:!1,isAnimationActive:!1},le*B+Q))}return O},[t,f,o,w,C,M,y,E,S]),N=()=>{},F=O=>{R(O.dataKey)},U=()=>{R(null)};return h.jsx(h.Fragment,{children:e&&h.jsx("div",{id:"line-graph-"+a+"-"+l,style:{width:"100%",height:`${r}%`,position:"relative",direction:"ltr"},children:h.jsxs("div",{style:{userSelect:"none",width:"100%",height:"100%",position:"absolute",top:0,left:0},children:[h.jsx(sU,{width:"100%",height:"100%",children:h.jsxs(BEo,{data:e,stackOffset:"sign",barGap:0,barCategoryGap:j,onMouseDown:N,margin:{top:5,right:30,left:20,bottom:30},children:[h.jsx(rh,{formatter:O=>O.toFixed(g)+" "+c}),h.jsx(bw,{vertical:A,horizontal:v,stroke:"rgba(128, 128, 128, 0.3)"}),h.jsx($9,{x:p,stroke:"orange",strokeWidth:2}),h.jsx(l1,{dataKey:i??a,fontSize:"10px",children:h.jsx(os,{value:a+(s?" ("+s+")":""),offset:0,position:"bottom"})}),h.jsx(vh,{domain:[u,d],fontSize:"10px",children:h.jsx(os,{dx:-15,value:l+(c?" ("+c+")":""),offset:0,angle:-90,position:"center"})}),k,h.jsx($9,{y:0,stroke:"#888"}),w>0&&h.jsx(J2,{wrapperStyle:{fontSize:"11px"},iconType:"plainline",verticalAlign:"top",height:36,onMouseLeave:U,onMouseEnter:F})]})}),h.jsx(UUo,{symbolSize:E,lineWidth:M,barCategoryGap:j,horizontalGrid:v,verticalGrid:A,changeHorizontalGrid:O=>{T(O)},changeVerticalGrid:O=>{x(O)},changeLineWidth:O=>{D(O)},changeSymbolSize:O=>{W(O)},changeBarCategoryGap:O=>{L(O)}})]})})})},jUo=Ro.div` position: fixed; top: 80px; right: 24px; @@ -9503,7 +9503,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,OUo=be.memo(({city:t})=>{const e=H(ma),n=H(pu)??m0,o=H(fn),r=H(bW),i=new Date(H(rl)),a=H(Y4t),l=ht(Rge),s=ht(hW),c=ht(Rwt),u=ht(Rf),d=me.hasSolarPanels(H.getState().elements),f=Tn(qYe),p=Tn($Ye),g=Tn(QYe),y=H(Pc),w=be.useRef(null),b=m.useRef(null),C=m.useRef(),P=b.current?b.current.clientWidth+40:a?a.width+40:640,v=b.current?b.current.clientHeight+100:a?a.height+100:460,[T,A]=m.useState({x:a?Math.max(a.x,P-window.innerWidth):0,y:a?Math.min(a.y,window.innerHeight-v):0}),[x,S]=m.useState([]),[R,M]=m.useState(0),[D,E]=m.useState(0),[W,j]=m.useState(0),[L,k]=m.useState(0),[N,F]=m.useState(["Heater","AC","Net"]),U=Jt(),O=f1(t),B=m.useRef([]),_=m.useRef([]),X=m.useRef([]),$=m.useRef([]);m.useEffect(()=>{s&&Q()},[s]),m.useEffect(()=>{Q()},[c]);const Q=()=>{S([]),M(0),E(0),j(0),k(0),F([])},{sum:le,sumHeaterMap:q,sumAcMap:te,sumSolarPanelMap:re,dataLabels:ae}=u0t(i,O,d);m.useEffect(()=>{S(le);let he=0,xe=0,He=0;const Se=q.size>1;if(q){B.current=[];for(const Ie of q.keys()){const ye=q.get(Ie);ye&&(he+=ye,Se&&B.current.push(Ie+": "+ye.toFixed(2)+" "+Y.t("word.kWh",U)))}}if(te){_.current=[];for(const Ie of te.keys()){const ye=te.get(Ie);ye&&(xe+=ye,Se&&_.current.push(Ie+": "+ye.toFixed(2)+" "+Y.t("word.kWh",U)))}}if(re&&re.size>0){X.current=[];for(const Ie of re.keys()){const ye=re.get(Ie);ye&&(He+=ye,Se&&X.current.push(Ie+": "+ye.toFixed(2)+" "+Y.t("word.kWh",U)))}}if(q&&te&&re){$.current=[];for(const Ie of q.keys()){let ye=0;const ce=q.get(Ie),pe=te.get(Ie),ve=re.get(Ie);ce&&(ye+=ce),pe&&(ye+=pe),ve&&(ye-=ve),Se&&$.current.push(Ie+": "+ye.toFixed(2)+" "+Y.t("word.kWh",U))}}M(he),E(xe),j(He),k(he+xe-He),f(he),p(xe),g(He);const ze=(Object.keys(le[0]).length-1)/(d?4:3);if(ze>1){const Ie=[];let ye=0;for(let ce=0;ce{A({x:Math.max(a==null?void 0:a.x,P-window.innerWidth),y:Math.min(a==null?void 0:a.y,window.innerHeight-v)})},[a,P,v]),m.useEffect(()=>{const he=()=>{A({x:Math.max(a==null?void 0:a.x,P-window.innerWidth),y:Math.min(a==null?void 0:a.y,window.innerHeight-v)})};return window.addEventListener("resize",he),()=>{window.removeEventListener("resize",he)}},[a,P,v]),m.useEffect(()=>(b.current&&(C.current||(C.current=new ResizeObserver(()=>{o(he=>{b.current&&(he.viewState.dailyBuildingEnergyPanelRect||(he.viewState.dailyBuildingEnergyPanelRect=new cr(0,0,600,360)),he.viewState.dailyBuildingEnergyPanelRect.width=b.current.offsetWidth,he.viewState.dailyBuildingEnergyPanelRect.height=b.current.offsetHeight)})})),C.current.observe(b.current)),()=>{var he;(he=C.current)==null||he.disconnect()}),[]);const se=(he,xe)=>{A({x:Math.max(xe.x,P-window.innerWidth),y:Math.min(xe.y,window.innerHeight-v)})},ne=(he,xe)=>{o(He=>{He.viewState.dailyBuildingEnergyPanelRect||(He.viewState.dailyBuildingEnergyPanelRect=new cr(0,0,600,360)),He.viewState.dailyBuildingEnergyPanelRect.x=Math.max(xe.x,P-window.innerWidth),He.viewState.dailyBuildingEnergyPanelRect.y=Math.min(xe.y,window.innerHeight-v)})},fe=()=>{o(he=>{he.viewState.showDailyBuildingEnergyPanel=!1,e&&(he.actionInfo={name:"Close Daily Building Energy Graph",timestamp:new Date().getTime()})})},ge=Y.t("word.Hour",U),de=Y.t("word.Energy",U),Z=x&&x[0]?Object.keys(x[0]).length===0:!0;return h.jsx(_i,{nodeRef:w,handle:".handle",bounds:"parent",axis:"both",position:T,onDrag:se,onStop:ne,onMouseDown:()=>{o(he=>{he.selectedFloatingWindow="dailyBuildingEnergyPanel"})},children:h.jsx(jUo,{ref:w,style:{zIndex:y==="dailyBuildingEnergyPanel"?Sc:9},children:h.jsxs(BUo,{ref:b,style:{opacity:n,width:(a?a.width:600)+"px",height:(a?a.height:360)+"px"},children:[h.jsxs(YUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[Y.t("buildingEnergyPanel.DailyBuildingEnergy",U)+": ",h.jsx("span",{style:{fontSize:"10px"},children:Y.t("sensorPanel.WeatherDataFrom",U)+" "+t+" | "+yr(i).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{fe()},onMouseDown:()=>{fe()},children:`${Y.t("word.Close",U)}`})]}),h.jsx(d0t,{type:vi.DailyBuildingEnergy,dataSource:x,hasSolarPanels:d,labels:N,height:100,dataKeyAxisX:"Hour",labelX:ge,labelY:de,unitY:Y.t("word.kWh",U),yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:i.getHours()}),!u&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[B.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.Heater",U)+": "+R.toFixed(1)}):h.jsx(Al,{content:B.current.map((he,xe)=>h.jsx("div",{children:he},xe)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.Heater",U)+": "+R.toFixed(1)})}),_.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.AC",U)+": "+D.toFixed(1)}):h.jsx(Al,{content:_.current.map((he,xe)=>h.jsx("div",{children:he},xe)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.AC",U)+": "+D.toFixed(1)})}),W!==0&&h.jsx(h.Fragment,{children:X.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.SolarPanel",U)+": "+W.toFixed(1)}):h.jsx(Al,{content:X.current.map((he,xe)=>h.jsx("div",{children:he},xe)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.SolarPanel",U)+": "+W.toFixed(1)})})}),$.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.Net",U)+": "+L.toFixed(1)}):h.jsx(Al,{content:$.current.map((he,xe)=>h.jsx("div",{children:he},xe)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.Net",U)+": "+L.toFixed(1)})}),h.jsx(lo,{type:"default",icon:Z?h.jsx(Sh,{}):h.jsx(Hf,{}),title:Y.t(Z?"word.Run":"word.Update",U),onClick:()=>{const he=H.getState().elements,xe=H.getState().countElementsByType,He=H.getState().getChildrenOfType,Se=yX(he,xe,He);if(Se.status===ag.NO_BUILDING){hn(Y.t("analysisManager.NoBuildingForAnalysis",U));return}if(Se.status===ag.AT_LEAST_ONE_BAD_NO_GOOD){let ze;switch(Se.buildingCompletion){case jc.WALL_DISJOINED:ze=Y.t("message.WallsAreNotConnected",U);break;case jc.WALL_EMPTY:ze=Y.t("message.BuildingContainsEmptyWall",U);break;case jc.ROOF_MISSING:ze=Y.t("message.BuildingRoofMissing",U);break;default:ze=Y.t("message.UnknownErrors",U)}po(Y.t("message.SimulationWillNotStartDueToErrors",U)+": "+ze);return}Se.status===ag.AT_LEAST_ONE_BAD_AT_LEAST_ONE_GOOD&&SR(Y.t("message.SimulationWillStartDespiteWarnings",U)),hn(Y.t("message.SimulationStarted",U)),setTimeout(()=>{r(),ht.getState().set(ze=>{ze.runDailyThermalSimulation=!0,ze.pauseDailyThermalSimulation=!1,ze.simulationInProgress=!0}),o(ze=>{e&&(ze.actionInfo={name:"Run Daily Building Energy Analysis",timestamp:new Date().getTime()})})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:Y.t("word.SaveAsImage",U),onClick:()=>{kd("line-graph-"+ge+"-"+de,"daily-building-energy").then(()=>{hn(Y.t("message.ScreenshotSaved",U)),e&&o(he=>{he.actionInfo={name:"Take Screenshot of Daily Building Energy Graph",timestamp:new Date().getTime()}})})}}),x&&x.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:Y.t("word.SaveAsCsv",U),onClick:()=>{bh(x,"daily-building-energy.csv"),hn(Y.t("message.CsvFileSaved",U)),e&&o(he=>{he.actionInfo={name:"Export Daily Building Energy Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),_Uo=Ro.div` +`,OUo=be.memo(({city:t})=>{const e=H(da),n=H(pu)??m0,o=H(fn),r=H(bW),i=new Date(H(rl)),a=H(Y4t),l=ht(Rge),s=ht(hW),c=ht(Rwt),u=ht(Rf),d=me.hasSolarPanels(H.getState().elements),f=Tn(qYe),p=Tn($Ye),g=Tn(QYe),y=H(Pc),w=be.useRef(null),b=m.useRef(null),C=m.useRef(),P=b.current?b.current.clientWidth+40:a?a.width+40:640,v=b.current?b.current.clientHeight+100:a?a.height+100:460,[T,A]=m.useState({x:a?Math.max(a.x,P-window.innerWidth):0,y:a?Math.min(a.y,window.innerHeight-v):0}),[x,S]=m.useState([]),[R,M]=m.useState(0),[D,E]=m.useState(0),[W,j]=m.useState(0),[L,k]=m.useState(0),[N,F]=m.useState(["Heater","AC","Net"]),U=Jt(),O=f1(t),B=m.useRef([]),_=m.useRef([]),X=m.useRef([]),$=m.useRef([]);m.useEffect(()=>{s&&Q()},[s]),m.useEffect(()=>{Q()},[c]);const Q=()=>{S([]),M(0),E(0),j(0),k(0),F([])},{sum:le,sumHeaterMap:q,sumAcMap:te,sumSolarPanelMap:re,dataLabels:ae}=u0t(i,O,d);m.useEffect(()=>{S(le);let he=0,xe=0,He=0;const Se=q.size>1;if(q){B.current=[];for(const Ie of q.keys()){const ye=q.get(Ie);ye&&(he+=ye,Se&&B.current.push(Ie+": "+ye.toFixed(2)+" "+Y.t("word.kWh",U)))}}if(te){_.current=[];for(const Ie of te.keys()){const ye=te.get(Ie);ye&&(xe+=ye,Se&&_.current.push(Ie+": "+ye.toFixed(2)+" "+Y.t("word.kWh",U)))}}if(re&&re.size>0){X.current=[];for(const Ie of re.keys()){const ye=re.get(Ie);ye&&(He+=ye,Se&&X.current.push(Ie+": "+ye.toFixed(2)+" "+Y.t("word.kWh",U)))}}if(q&&te&&re){$.current=[];for(const Ie of q.keys()){let ye=0;const ce=q.get(Ie),pe=te.get(Ie),ve=re.get(Ie);ce&&(ye+=ce),pe&&(ye+=pe),ve&&(ye-=ve),Se&&$.current.push(Ie+": "+ye.toFixed(2)+" "+Y.t("word.kWh",U))}}M(he),E(xe),j(He),k(he+xe-He),f(he),p(xe),g(He);const ze=(Object.keys(le[0]).length-1)/(d?4:3);if(ze>1){const Ie=[];let ye=0;for(let ce=0;ce{A({x:Math.max(a==null?void 0:a.x,P-window.innerWidth),y:Math.min(a==null?void 0:a.y,window.innerHeight-v)})},[a,P,v]),m.useEffect(()=>{const he=()=>{A({x:Math.max(a==null?void 0:a.x,P-window.innerWidth),y:Math.min(a==null?void 0:a.y,window.innerHeight-v)})};return window.addEventListener("resize",he),()=>{window.removeEventListener("resize",he)}},[a,P,v]),m.useEffect(()=>(b.current&&(C.current||(C.current=new ResizeObserver(()=>{o(he=>{b.current&&(he.viewState.dailyBuildingEnergyPanelRect||(he.viewState.dailyBuildingEnergyPanelRect=new cr(0,0,600,360)),he.viewState.dailyBuildingEnergyPanelRect.width=b.current.offsetWidth,he.viewState.dailyBuildingEnergyPanelRect.height=b.current.offsetHeight)})})),C.current.observe(b.current)),()=>{var he;(he=C.current)==null||he.disconnect()}),[]);const se=(he,xe)=>{A({x:Math.max(xe.x,P-window.innerWidth),y:Math.min(xe.y,window.innerHeight-v)})},ne=(he,xe)=>{o(He=>{He.viewState.dailyBuildingEnergyPanelRect||(He.viewState.dailyBuildingEnergyPanelRect=new cr(0,0,600,360)),He.viewState.dailyBuildingEnergyPanelRect.x=Math.max(xe.x,P-window.innerWidth),He.viewState.dailyBuildingEnergyPanelRect.y=Math.min(xe.y,window.innerHeight-v)})},fe=()=>{o(he=>{he.viewState.showDailyBuildingEnergyPanel=!1,e&&(he.actionInfo={name:"Close Daily Building Energy Graph",timestamp:new Date().getTime()})})},ge=Y.t("word.Hour",U),de=Y.t("word.Energy",U),Z=x&&x[0]?Object.keys(x[0]).length===0:!0;return h.jsx(_i,{nodeRef:w,handle:".handle",bounds:"parent",axis:"both",position:T,onDrag:se,onStop:ne,onMouseDown:()=>{o(he=>{he.selectedFloatingWindow="dailyBuildingEnergyPanel"})},children:h.jsx(jUo,{ref:w,style:{zIndex:y==="dailyBuildingEnergyPanel"?Sc:9},children:h.jsxs(BUo,{ref:b,style:{opacity:n,width:(a?a.width:600)+"px",height:(a?a.height:360)+"px"},children:[h.jsxs(YUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[Y.t("buildingEnergyPanel.DailyBuildingEnergy",U)+": ",h.jsx("span",{style:{fontSize:"10px"},children:Y.t("sensorPanel.WeatherDataFrom",U)+" "+t+" | "+yr(i).format("MM/DD")})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{fe()},onMouseDown:()=>{fe()},children:`${Y.t("word.Close",U)}`})]}),h.jsx(d0t,{type:vi.DailyBuildingEnergy,dataSource:x,hasSolarPanels:d,labels:N,height:100,dataKeyAxisX:"Hour",labelX:ge,labelY:de,unitY:Y.t("word.kWh",U),yMin:0,curveType:"linear",fractionDigits:2,symbolCount:24,referenceX:i.getHours()}),!u&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[B.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.Heater",U)+": "+R.toFixed(1)}):h.jsx(Al,{content:B.current.map((he,xe)=>h.jsx("div",{children:he},xe)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.Heater",U)+": "+R.toFixed(1)})}),_.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.AC",U)+": "+D.toFixed(1)}):h.jsx(Al,{content:_.current.map((he,xe)=>h.jsx("div",{children:he},xe)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.AC",U)+": "+D.toFixed(1)})}),W!==0&&h.jsx(h.Fragment,{children:X.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.SolarPanel",U)+": "+W.toFixed(1)}):h.jsx(Al,{content:X.current.map((he,xe)=>h.jsx("div",{children:he},xe)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.SolarPanel",U)+": "+W.toFixed(1)})})}),$.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.Net",U)+": "+L.toFixed(1)}):h.jsx(Al,{content:$.current.map((he,xe)=>h.jsx("div",{children:he},xe)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.Net",U)+": "+L.toFixed(1)})}),h.jsx(lo,{type:"default",icon:Z?h.jsx(Sh,{}):h.jsx(Hf,{}),title:Y.t(Z?"word.Run":"word.Update",U),onClick:()=>{const he=H.getState().elements,xe=H.getState().countElementsByType,He=H.getState().getChildrenOfType,Se=AX(he,xe,He);if(Se.status===ag.NO_BUILDING){hn(Y.t("analysisManager.NoBuildingForAnalysis",U));return}if(Se.status===ag.AT_LEAST_ONE_BAD_NO_GOOD){let ze;switch(Se.buildingCompletion){case jc.WALL_DISJOINED:ze=Y.t("message.WallsAreNotConnected",U);break;case jc.WALL_EMPTY:ze=Y.t("message.BuildingContainsEmptyWall",U);break;case jc.ROOF_MISSING:ze=Y.t("message.BuildingRoofMissing",U);break;default:ze=Y.t("message.UnknownErrors",U)}po(Y.t("message.SimulationWillNotStartDueToErrors",U)+": "+ze);return}Se.status===ag.AT_LEAST_ONE_BAD_AT_LEAST_ONE_GOOD&&SR(Y.t("message.SimulationWillStartDespiteWarnings",U)),hn(Y.t("message.SimulationStarted",U)),setTimeout(()=>{r(),ht.getState().set(ze=>{ze.runDailyThermalSimulation=!0,ze.pauseDailyThermalSimulation=!1,ze.simulationInProgress=!0}),o(ze=>{e&&(ze.actionInfo={name:"Run Daily Building Energy Analysis",timestamp:new Date().getTime()})})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:Y.t("word.SaveAsImage",U),onClick:()=>{kd("line-graph-"+ge+"-"+de,"daily-building-energy").then(()=>{hn(Y.t("message.ScreenshotSaved",U)),e&&o(he=>{he.actionInfo={name:"Take Screenshot of Daily Building Energy Graph",timestamp:new Date().getTime()}})})}}),x&&x.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:Y.t("word.SaveAsCsv",U),onClick:()=>{bh(x,"daily-building-energy.csv"),hn(Y.t("message.CsvFileSaved",U)),e&&o(he=>{he.actionInfo={name:"Export Daily Building Energy Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),_Uo=Ro.div` position: fixed; top: 80px; right: 24px; @@ -9541,7 +9541,7 @@ yr.version="2.29.4";oFo(bc);yr.fn=qo;yr.min=_ko;yr.max=Vko;yr.now=Gko;yr.utc=v3; justify-content: space-between; align-items: center; cursor: move; -`,XUo=be.memo(({city:t})=>{const e=H.getState().world,n=H(ma),o=H(pu)??m0,r=H(fn),i=H(bW),a=new Date(H(rl)),l=H(_4t),s=ht(Rge),c=ht(Yq),u=ht(Hwt),d=ht(Rf),f=me.hasSolarPanels(H.getState().elements),p=Tn(qYe),g=Tn($Ye),y=Tn(QYe),w=H(Pc),b=m.useRef(null),C=m.useRef(),P=b.current?b.current.clientWidth+40:l?l.width+40:640,v=b.current?b.current.clientHeight+100:l?l.height+100:600,[T,A]=m.useState({x:l?Math.max(l.x,P-window.innerWidth):0,y:l?Math.min(l.y,window.innerHeight-v):0}),x=be.useRef(null),S=Jt(),R=f1(t),M=Ms[a.getMonth()],D=e.daysPerYear??6,E=12/D,[W,j]=m.useState(0),[L,k]=m.useState(0),[N,F]=m.useState(0),[U,O]=m.useState(0),[B,_]=m.useState(["Heater","AC","Solar","Net"]),[X,$]=m.useState([]),{sum:Q,sumHeaterMap:le,sumAcMap:q,sumSolarPanelMap:te,dataLabels:re}=u0t(a,R,f),ae=m.useRef(new Array(D).fill({})),se=m.useRef(new Array(D).fill(0)),ne=m.useRef(new Array(D).fill(0)),fe=m.useRef(new Array(D).fill(0)),ge=m.useRef(new Array(D).fill(0)),de=m.useRef([]),Z=m.useRef([]),he=m.useRef([]),xe=m.useRef([]);m.useEffect(()=>{He()},[D,u]),m.useEffect(()=>{c&&He()},[c]);const He=()=>{ae.current=new Array(D).fill({}),se.current=new Array(D).fill(0),ne.current=new Array(D).fill(0),fe.current=new Array(D).fill(0),ge.current=new Array(D).fill(0),$([]),j(0),k(0),F(0),O(0),_([])};m.useEffect(()=>{const ve=Math.floor(a.getMonth()/E),Ae=(Object.keys(Q[0]).length-1)/(f?4:3);if(de.current=[],Z.current=[],xe.current=[],he.current=[],Ae>1){const We=new Map,Ke=new Map,Ne=new Map,De=new Map;for(const Ve of Q){let yt=0;for(let ct=0;ct6&&(De=" "+Ve.substring(6).trim());break}const ke="Heater"+De,Ye="AC"+De,it="Net"+De;if(f){const Ve="Solar"+De;let yt=0;_([ke,Ye,Ve,it]);for(const Xe of Q)We+=Xe[ke],Ke+=Xe[Ye],yt+=Xe[Ve],Ne+=Xe[it];const ct={};ct.Month=Ms[a.getMonth()],ct[ke]=30*We,ct[Ye]=30*Ke,ct[Ve]=30*yt,ct[it]=30*Ne,ae.current[ve]=ct}else{_([ke,Ye,it]);for(const yt of Q)We+=yt[ke],Ke+=yt[Ye],Ne+=yt[it];const Ve={};Ve.Month=Ms[a.getMonth()],Ve[ke]=30*We,Ve[Ye]=30*Ke,Ve[it]=30*Ne,ae.current[ve]=Ve}}$([...ae.current]);let Te=0;if(le)for(const We of le.keys())Te+=le.get(We)??0;let Me=0;if(q)for(const We of q.keys())Me+=q.get(We)??0;let Pe=0;if(te&&f)for(const We of te.keys())Pe+=te.get(We)??0;se.current[ve]=Te*E*30,ne.current[ve]=Me*E*30,fe.current[ve]=Pe*E*30,ge.current[ve]=se.current[ve]+ne.current[ve]-fe.current[ve];const Ee=se.current.slice(0,ve+1).reduce((We,Ke)=>We+Ke,0);j(Ee);const Be=ne.current.slice(0,ve+1).reduce((We,Ke)=>We+Ke,0);k(Be);const Je=fe.current.slice(0,ve+1).reduce((We,Ke)=>We+Ke,0);F(Je),O(ge.current.slice(0,ve+1).reduce((We,Ke)=>We+Ke,0)),p(Ee),g(Be),y(Je),ht.getState().showSolarRadiationHeatmap||Tn.getState().clearDataStore()},[s]),m.useEffect(()=>{A({x:Math.max(l==null?void 0:l.x,P-window.innerWidth),y:Math.min(l==null?void 0:l.y,window.innerHeight-v)})},[l,P,v]),m.useEffect(()=>{const ve=()=>{A({x:Math.max(l==null?void 0:l.x,P-window.innerWidth),y:Math.min(l==null?void 0:l.y,window.innerHeight-v)})};return window.addEventListener("resize",ve),()=>{window.removeEventListener("resize",ve)}},[l,P,v]),m.useEffect(()=>(b.current&&(C.current||(C.current=new ResizeObserver(()=>{r(ve=>{b.current&&(ve.viewState.yearlyBuildingEnergyPanelRect||(ve.viewState.yearlyBuildingEnergyPanelRect=new cr(0,0,600,500)),ve.viewState.yearlyBuildingEnergyPanelRect.width=b.current.offsetWidth,ve.viewState.yearlyBuildingEnergyPanelRect.height=b.current.offsetHeight)})})),C.current.observe(b.current)),()=>{var ve;(ve=C.current)==null||ve.disconnect()}),[]);const Se=(ve,Ae)=>{A({x:Math.max(Ae.x,P-window.innerWidth),y:Math.min(Ae.y,window.innerHeight-v)})},ze=(ve,Ae)=>{r(Te=>{Te.viewState.yearlyBuildingEnergyPanelRect||(Te.viewState.yearlyBuildingEnergyPanelRect=new cr(0,0,600,360)),Te.viewState.yearlyBuildingEnergyPanelRect.x=Math.max(Ae.x,P-window.innerWidth),Te.viewState.yearlyBuildingEnergyPanelRect.y=Math.min(Ae.y,window.innerHeight-v)})},Ie=()=>{r(ve=>{ve.viewState.showYearlyBuildingEnergyPanel=!1,n&&(ve.actionInfo={name:"Close Yearly Building Energy Graph",timestamp:new Date().getTime()})})},ye=Y.t("word.Month",S),ce=Y.t("word.Energy",S),pe=X&&X[0]?Object.keys(X[0]).length===0:!0;return h.jsx(_i,{nodeRef:x,handle:".handle",bounds:"parent",axis:"both",position:T,onDrag:Se,onStop:ze,onMouseDown:()=>{r(ve=>{ve.selectedFloatingWindow="yearlyBuildingEnergyPanel"})},children:h.jsx(_Uo,{ref:x,style:{zIndex:w==="yearlyBuildingEnergyPanel"?Sc:9},children:h.jsxs(VUo,{ref:b,style:{opacity:o,width:(l?l.width:600)+"px",height:(l?l.height:400)+"px"},children:[h.jsxs(GUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[Y.t("buildingEnergyPanel.YearlyBuildingEnergy",S)+": ",h.jsx("span",{style:{fontSize:"10px"},children:Y.t("sensorPanel.WeatherDataFrom",S)+" "+t+" | "+a.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{Ie()},onMouseDown:()=>{Ie()},children:`${Y.t("word.Close",S)}`})]}),h.jsx(d0t,{type:vi.YearlyBuildingEnergy,dataSource:X,hasSolarPanels:f,labels:B,height:100,dataKeyAxisX:"Month",labelX:ye,labelY:ce,unitY:Y.t("word.kWh",S),yMin:0,curveType:"linear",fractionDigits:2,referenceX:M}),!d&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[de.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.Heater",S)+": "+W.toFixed(0)}):h.jsx(Al,{content:de.current.map((ve,Ae)=>h.jsx("div",{children:ve},Ae)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.Heater",S)+": "+W.toFixed(0)})}),Z.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.AC",S)+": "+L.toFixed(0)}):h.jsx(Al,{content:Z.current.map((ve,Ae)=>h.jsx("div",{children:ve},Ae)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.AC",S)+": "+L.toFixed(0)})}),N!==0&&h.jsx(h.Fragment,{children:he.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.SolarPanel",S)+": "+N.toFixed(0)}):h.jsx(Al,{content:he.current.map((ve,Ae)=>h.jsx("div",{children:ve},Ae)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.SolarPanel",S)+": "+N.toFixed(0)})})}),xe.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.Net",S)+": "+U.toFixed(0)}):h.jsx(Al,{content:xe.current.map((ve,Ae)=>h.jsx("div",{children:ve},Ae)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.Net",S)+": "+U.toFixed(0)})}),h.jsx(lo,{type:"default",icon:pe?h.jsx(Sh,{}):h.jsx(Hf,{}),title:Y.t(pe?"word.Run":"word.Update",S),onClick:()=>{const ve=H.getState().elements,Ae=H.getState().countElementsByType,Te=H.getState().getChildrenOfType,Me=yX(ve,Ae,Te);if(Me.status===ag.NO_BUILDING){hn(Y.t("analysisManager.NoBuildingForAnalysis",S));return}if(Me.status===ag.AT_LEAST_ONE_BAD_NO_GOOD){let Pe;switch(Me.buildingCompletion){case jc.WALL_DISJOINED:Pe=Y.t("message.WallsAreNotConnected",S);break;case jc.WALL_EMPTY:Pe=Y.t("message.BuildingContainsEmptyWall",S);break;case jc.ROOF_MISSING:Pe=Y.t("message.BuildingRoofMissing",S);break;default:Pe=Y.t("message.UnknownErrors",S)}po(Y.t("message.SimulationWillNotStartDueToErrors",S)+": "+Pe);return}Me.status===ag.AT_LEAST_ONE_BAD_AT_LEAST_ONE_GOOD&&SR(Y.t("message.SimulationWillStartDespiteWarnings",S)),hn(Y.t("message.SimulationStarted",S)),setTimeout(()=>{i(),ht.getState().set(Pe=>{Pe.runYearlyThermalSimulation=!0,Pe.pauseYearlyThermalSimulation=!1,Pe.simulationInProgress=!0}),r(Pe=>{n&&(Pe.actionInfo={name:"Run Yearly Building Energy Analysis",timestamp:new Date().getTime()})})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:Y.t("word.SaveAsImage",S),onClick:()=>{kd("line-graph-"+ye+"-"+ce,"yearly-building-energy").then(()=>{hn(Y.t("message.ScreenshotSaved",S)),n&&r(ve=>{ve.actionInfo={name:"Take Screenshot of Yearly Building Energy Graph",timestamp:new Date().getTime()}})})}}),ae.current&&ae.current.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:Y.t("word.SaveAsCsv",S),onClick:()=>{bh(ae.current,"yearly-building-energy.csv"),hn(Y.t("message.CsvFileSaved",S)),n&&r(ve=>{ve.actionInfo={name:"Export Yearly Building Energy Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),JUo=be.memo(({setDialogVisible:t})=>{const e=H(fn),n=H(En),o=H(k8t),r=H(L8t),[i,a]=m.useState(!1),[l,s]=m.useState(!1),[c,u]=m.useState({left:0,top:0,bottom:0,right:0}),d=m.useRef(null),f=m.useRef(null),p=m.useRef(o),g=m.useRef(r),y=Jt();m.useEffect(()=>{var A;(A=f.current)==null||A.focus()},[]);const w=(A,x)=>{if(d.current){const{clientWidth:S,clientHeight:R}=window.document.documentElement,M=d.current.getBoundingClientRect();u({left:-M.left+x.x,right:S-(M.right-x.x),top:-M.top+x.y,bottom:R-((M==null?void 0:M.bottom)-x.y)})}},b=A=>{e(x=>{x.minimumNavigationMoveSpeed=A}),ht.getState().set(x=>{x.navigationMoveSpeed=A})},C=A=>{e(x=>{x.minimumNavigationTurnSpeed=A}),ht.getState().set(x=>{x.navigationTurnSpeed=A})},P=()=>{const A=o,x=p.current;if(A!==x){const M={name:"Minimum Navigation Move Speed",timestamp:Date.now(),oldValue:A,newValue:x,undo:()=>{b(M.oldValue)},redo:()=>{b(M.newValue)}};n(M),b(x)}const S=r,R=g.current;if(S!==R){const M={name:"Minimum Navigation Turn Speed",timestamp:Date.now(),oldValue:S,newValue:R,undo:()=>{C(M.oldValue)},redo:()=>{C(M.newValue)}};n(M),C(R)}},v=()=>{t(!1)},T=()=>{P(),t(!1)};return h.jsxs(Oi,{width:500,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>s(!0),onMouseOut:()=>s(!1),children:`${Y.t("navigationPanel.NavigationParameters",y)}`}),footer:[h.jsx(lo,{onClick:v,children:`${Y.t("word.Cancel",y)}`},"Cancel"),h.jsx(lo,{type:"primary",ref:f,onClick:T,children:`${Y.t("word.OK",y)}`},"OK")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:A=>h.jsx(_i,{disabled:!l,bounds:c,onStart:(x,S)=>w(x,S),children:h.jsx("div",{ref:d,children:A})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:16,children:Y.t("navigationPanel.MinimumMoveSpeed",y)+" ([1, 10]): "}),h.jsx(nt,{className:"gutter-row",span:8,children:h.jsx(Mn,{min:1,max:10,style:{width:"100%"},precision:0,value:p.current,step:1,onChange:A=>{p.current=Number(A),a(!i)},onBlur:A=>{const x=A.target.value,S=parseFloat(x);p.current=Number.isNaN(S)?3:S,a(!i)},onPressEnter:A=>{const x=A.target.value,S=parseFloat(x);p.current=Number.isNaN(S)?3:S,a(!i)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:16,children:Y.t("navigationPanel.MinimumTurnSpeed",y)+" ([1, 5]): "}),h.jsx(nt,{className:"gutter-row",span:8,children:h.jsx(Mn,{min:1,max:5,style:{width:"100%"},precision:0,value:g.current,step:1,onChange:A=>{g.current=Number(A),a(!i)},onBlur:A=>{const x=A.target.value,S=parseFloat(x);g.current=Number.isNaN(S)?3:S,a(!i)},onPressEnter:A=>{const x=A.target.value,S=parseFloat(x);g.current=Number.isNaN(S)?3:S,a(!i)}})})]})]})}),KUo=be.memo(({setDialogVisible:t})=>{const e=H(fn),n=H(En),o=H(Nq),r=me.getShadowMapSize(),i=4096,a=1e4,[l,s]=m.useState(!1),[c,u]=m.useState(!1),[d,f]=m.useState({left:0,top:0,bottom:0,right:0}),p=m.useRef(null),g=m.useRef(null),y=m.useRef(o?Math.round(o)/a:1),w=m.useRef(r?Math.round(r/i):1),b=Jt();m.useEffect(()=>{var S;(S=g.current)==null||S.focus()},[]);const C=(S,R)=>{if(p.current){const{clientWidth:M,clientHeight:D}=window.document.documentElement,E=p.current.getBoundingClientRect();f({left:-E.left+R.x,right:M-(E.right-R.x),top:-E.top+R.y,bottom:D-((E==null?void 0:E.bottom)-R.y)})}},P=S=>{e(R=>{R.viewState.shadowCameraFar=S})},v=S=>{localStorage.setItem("aladdin-shadow-map-size",S.toString())},T=()=>{const S=o,R=y.current*a;if(S!==R){const E={name:"Shadow Camera Far Distance",timestamp:Date.now(),oldValue:S,newValue:R,undo:()=>{P(E.oldValue)},redo:()=>{P(E.newValue)}};n(E),P(R)}const M=r,D=w.current*i;if(M!==D){const E={name:"Shadow Map Size",timestamp:Date.now(),oldValue:M,newValue:D,undo:()=>{v(E.oldValue)},redo:()=>{v(E.newValue)}};n(E),v(D)}},A=()=>{t(!1)},x=()=>{T(),t(!1),window.location.reload()};return h.jsxs(Oi,{width:500,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>u(!0),onMouseOut:()=>u(!1),children:`${Y.t("shadowSettingsPanel.ShadowSettings",b)}`}),footer:[h.jsx(lo,{onClick:A,children:`${Y.t("word.Cancel",b)}`},"Cancel"),h.jsx(lo,{type:"primary",ref:g,onClick:x,children:`${Y.t("word.OK",b)}`},"OK")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:S=>h.jsx(_i,{disabled:!c,bounds:d,onStart:(R,M)=>C(R,M),children:h.jsx("div",{ref:p,children:S})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:18,children:Y.t("shadowSettingsPanel.ShadowCameraFarDistance",b)+" ([1, 1000]×"+a+"): "}),h.jsx(nt,{className:"gutter-row",span:6,children:h.jsx(Mn,{min:1,max:1e3,style:{width:"100%"},precision:0,value:y.current,step:1,onChange:S=>{y.current=Number(S),s(!l)},onBlur:S=>{const R=S.target.value,M=parseFloat(R);y.current=Number.isNaN(M)?1:M,s(!l)},onPressEnter:S=>{const R=S.target.value,M=parseFloat(R);y.current=Number.isNaN(M)?1:M,s(!l)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"10px"},children:[h.jsx(nt,{className:"gutter-row",span:18,children:Y.t("shadowSettingsPanel.ShadowMapSize",b)+" ([1, 4]×"+i+"): "}),h.jsx(nt,{className:"gutter-row",span:6,children:h.jsx(Mn,{min:1,max:4,style:{width:"100%"},precision:0,value:w.current,step:1,onChange:S=>{w.current=Number(S),s(!l)},onBlur:S=>{const R=S.target.value,M=parseFloat(R);w.current=Number.isNaN(M)?1:M,s(!l)},onPressEnter:S=>{const R=S.target.value,M=parseFloat(R);w.current=Number.isNaN(M)?1:M,s(!l)}})})]}),h.jsx(on,{style:{fontSize:"10px"},children:h.jsxs(nt,{span:24,children:[Y.t("shadowSettingsPanel.Notes",b),":",h.jsx("br",{}),h.jsxs("ul",{children:[h.jsx("li",{children:Y.t("shadowSettingsPanel.RefreshPageNote",b)}),h.jsx("li",{children:Y.t("shadowSettingsPanel.MapSizeWarning",b)})]})]})})]})}),qUo=be.memo(()=>{const t=H(vge),e=H(Uq),n=H(MBe),o=H(E4t),r=H(IBe),i=H(zBe),a=H(L4t),l=H(N4t),s=ht(D8t),c=ht(E8t),u=ht(F8t),d=ht(Ss),f=H(DBe),p=H(G4t),g=H(EBe),y=H($4t),w=H(Z4t),b=H(FBe),C=H(n8t),P=H(kBe),v=H(i8t),T=H(LBe),A=H(s8t),x=H(WBe),S=H(d8t),R=H(NBe),M=H(p8t),D=H(B4t),E=H(O4t),W=H(m8t),j=H(Qq),L=H(Tc),k=H(Sb),N=H(_Ye),F=H(OYe),U=H(jge),O=H(Wq)??!1,[B,_]=m.useState("Boston MA, USA");return m.useEffect(()=>{if(Object.keys(U).length===0)return;const X=N(L,k)??"Boston MA, USA";_(X),F(X)},[L,k,U]),h.jsxs(h.Fragment,{children:[o&&h.jsx(kAo,{}),r&&h.jsx(UAo,{}),i&&h.jsx(dNo,{}),t&&h.jsx(FNo,{}),e&&h.jsx(HNo,{}),(n||O)&&!j&&h.jsx(pNo,{}),a&&h.jsx(QEo,{city:B,graphs:[vi.MonthlyTemperatures,vi.SunshineHours]}),l&&h.jsx(HUo,{city:B}),s&&h.jsx(NUo,{setDialogVisible:X=>{ht.getState().set($=>{$.showEconomicsPanel=X})}}),c&&h.jsx(JUo,{setDialogVisible:X=>{ht.getState().set($=>{$.showNavigationPanel=X})}}),u&&h.jsx(KUo,{setDialogVisible:X=>{ht.getState().set($=>{$.showShadowSettings=X})}}),p&&h.jsx(nFo,{city:B}),f&&h.jsx(aNo,{city:B}),y&&h.jsx(ANo,{city:B}),g&&h.jsx(bNo,{city:B}),w&&h.jsx(BNo,{}),C&&h.jsx(VNo,{city:B}),b&&h.jsx(KNo,{city:B}),v&&h.jsx(oUo,{city:B}),P&&h.jsx(ZNo,{city:B}),T&&h.jsx(lUo,{city:B}),A&&h.jsx(dUo,{city:B}),x&&h.jsx(gUo,{city:B}),S&&h.jsx(wUo,{city:B}),R&&h.jsx(TUo,{city:B}),M&&h.jsx(DUo,{city:B}),D&&h.jsx(OUo,{city:B}),E&&h.jsx(XUo,{city:B}),d&&h.jsx(WNo,{}),W&&h.jsx(WUo,{})]})});class cl{static computeSolarPanelOutput(e,n,o,r,i,a,l,s,c){const u=i.parentType===z.Roof,d=i.parentType===z.Wall;u&&(a=l);const f=d?me.absoluteCoordinates(i.cx,i.cy,i.cz,a,l,i.lz):me.absoluteCoordinates(i.cx,i.cy,i.cz,a,void 0,void 0,!0),p=a.rotation[2];let g=i.tiltAngle,y=p+i.relativeAzimuth,w=!0;if(u&&(f.z=i.cz+i.lz+.02+a.cz,me.isZero(i.rotation[0])?f.z+=i.poleHeight:(g=i.rotation[0],y=p,w=!1)),d&&!me.isZero(i.tiltAngle)){const Q=a,q=(l?l.rotation[2]+Q.relativeAngle:Q.relativeAngle)-Gt,te=i.ly*Math.abs(Math.sin(i.tiltAngle))/2;f.x+=te*Math.cos(q),f.y+=te*Math.sin(q)}const b=new ie().fromArray(i.normal),C=e.getMonth(),P=me.dayOfYear(e),v=n.solarRadiationHeatmapGridCellSize??.5;let T,A,x,S,R;n.discretization===Fm.EXACT?(T=i.lx,A=i.ly,i.orientation===vr.portrait?(x=Math.max(1,Math.round(i.lx/r.width)),S=Math.max(1,Math.round(i.ly/r.length)),x*=r.n,S*=r.m):(x=Math.max(1,Math.round(i.lx/r.length)),S=Math.max(1,Math.round(i.ly/r.width)),x*=r.m,S*=r.n),R=i.lx/x):(T=i.lx,A=i.ly,x=Math.max(2,Math.round(i.lx/v)),S=Math.max(2,Math.round(i.ly/v)),x%2!==0&&(x+=1),S%2!==0&&(S+=1),R=v);const M=T/x,D=A/S,E=f.x-(T-R)/2,W=f.y-(A-R)/2,j=u||d?f.z:a.lz+i.poleHeight+i.lz,L=new Xt(f.x,f.y),k=new ie,N=Array.from(Array(x),()=>new Array(S));let F=new nn(u&&!w?0:g,0,y,"ZYX");if(i.trackerType!==za.NO_TRACKER){const Q=p?o.clone().applyAxisAngle(Io,-p):o.clone();switch(i.trackerType){case za.ALTAZIMUTH_DUAL_AXIS_TRACKER:{const le=new bs().setFromUnitVectors(Io,Q);F=new nn().setFromQuaternion(le),F.z+=y;break}case za.HORIZONTAL_SINGLE_AXIS_TRACKER:{const le=new bs().setFromUnitVectors(Io,new ie(Q.x,0,Q.z).normalize());F=new nn().setFromQuaternion(le),F.z+=y;break}case za.VERTICAL_SINGLE_AXIS_TRACKER:{const le=new ie(Q.x,-Q.y,0).normalize(),q=Math.acos(Oc.dot(le))*Math.sign(le.x);F=new nn(i.tiltAngle,0,q+p,"ZYX");break}case za.TILTED_SINGLE_AXIS_TRACKER:break}}b.applyEuler(F),u&&!w&&(F.x=i.rotation[0],F.z=i.rotation[2]+p),d&&(F.x=Gt+i.tiltAngle,F.z=a.relativeAngle+p);const U=Ri(o,P,s,yi.SPHERE_MODEL),O=ni(n.ground,C,b,U),B=b.dot(o),_=new Xt,X=new ie;for(let Q=0;Q0&&(_.set(E+Q*M,W+le*D),X.set(_.x-L.x,_.y-L.y,0),X.applyEuler(F),k.set(f.x+X.x,f.y+X.y,j+X.z),c(i.id,k,o)<0&&(N[Q][le]+=B*U));let $=0;switch(r.shadeTolerance){case Fv.NONE:{let Q=Number.MAX_VALUE;for(let le=0;leArray(b).fill(0)),N=Array(w).fill(0).map(()=>Array(b).fill(0));let F;for(let U=0;U0)for(const Q of a){if(Q.type!==z.Window)continue;const le=Q.cx*r.lx,q=Q.cz*r.lz,te=Q.lx*r.lx/2,re=Q.lz*r.lz/2,ae=Q;if(ae.windowType===Ti.Arched){const se=T.clone().add(new ie(ae.cx*r.lx,0,ae.cz*r.lz));cl.pointWithinArch(R,ae.lx,ae.lz,ae.archHeight,se)&&(F=!1)}else if(X.x>=le-te&&X.x=q-re&&X.y0)for(const Q of l){if(Q.type!==z.Door)continue;const le=Q.cx*r.lx,q=Q.cz*r.lz,te=Q.lx*r.lx/2,re=Q.lz*r.lz/2,ae=Q;if(ae.doorType===Pd.Arched){const se=T.clone().add(new ie(ae.cx*r.lx,0,ae.cz*r.lz));cl.pointWithinArch(R,ae.lx,ae.lz,ae.archHeight,se)&&(F=!1)}else if(X.x>=le-te&&X.x=q-re&&X.y0)for(const Q of s){const le=Q.cx*r.lx,q=Q.cz*r.lz,te=Q.lx/2,re=Q.ly/2;if(X.x>=le-te&&X.x=q-re&&X.yl6||le<0)&&Q&&(k[U][O]+=j),L>0&&le<0&&(N[U][O]+=L*W,Q&&(k[U][O]+=L*W))}}}return{intensity:k,unitArea:C*P,heatmap:N}}static computeDoorSolarRadiationEnergy(e,n,o,r,i,a,l,s){const c=me.dayOfYear(e),u=n.solarRadiationHeatmapGridCellSize??.5,d=r.lx*i.lx,f=r.lz*i.lz,p=Math.max(2,Math.round(d/u)),g=Math.max(2,Math.round(f/u)),y=d/p,w=f/g,b=a.rotation[2]+i.relativeAngle,P=me.wallAbsolutePosition(new ie(i.cx,i.cy,i.cz),a).setZ(i.lz/2+a.lz).clone().add(new ie(r.cx*i.lx,0,r.cz*i.lz)),v=new ie(Math.cos(b-Gt),Math.sin(b-Gt),0),T=y*Math.cos(b),A=y*Math.sin(b),x=new ie,S=Ri(o,c,l,yi.SPHERE_MODEL),R=ni(n.ground,e.getMonth(),v,S),M=v.dot(o),D=Array(p).fill(0).map(()=>Array(g).fill(0));if(r.doorType===Pd.Arched)for(let E=0;E0&&s(r.id,x,o)<0&&(D[E][W]+=M*S))}else for(let E=0;E0){const j=E-p/2+.5,L=W-g/2+.5;x.set(P.x+j*T,P.y+j*A,P.z+L*w),s(r.id,x,o)<0&&(D[E][W]+=M*S)}return{intensity:D,unitArea:y*w}}static pointWithinArch(e,n,o,r,i){if(r>0){const a=.5*n,l=Math.min(r,o,a),s=.5*(l+a*a/l),c=e.x-i.x,u=e.y-i.y,d=c*c+u*u;let f=e.z-i.z;return d-o/2?!0:(f=e.z-(o-s),d+f*fArray(g).fill(0));if(r.windowType===Ti.Arched)for(let E=0;E0&&s(r.id,x,o)<0&&(D[E][W]+=M*S))}else for(let E=0;E0){const j=E-p/2+.5,L=W-g/2+.5;x.set(P.x+j*T,P.y+j*A,P.z+L*w),s(r.id,x,o)<0&&(D[E][W]+=M*S)}return{intensity:D,unitArea:y*w}}static computeRoofWindowSolarRadiationEnergy(e,n,o,r,i,a,l,s){const c=me.dayOfYear(e),u=n.solarRadiationHeatmapGridCellSize??.5,d=r.lx,f=r.lz,p=Math.max(2,Math.round(d/u)),g=Math.max(2,Math.round(f/u)),y=d/p,w=f/g,b=new ie(r.cx,r.cy,r.cz).applyEuler(new nn(0,0,a.rotation[2]));b.x+=a.cx,b.y+=a.cy,b.z+=a.lz;const C=new nn(r.rotation[0],r.rotation[1],r.rotation[2]+a.rotation[2],"ZXY"),P=new ie(0,0,1).applyEuler(C),v=new ie,T=Ri(o,c,l,yi.SPHERE_MODEL),A=ni(n.ground,e.getMonth(),P,T),x=P.dot(o),S=Array(p).fill(0).map(()=>Array(g).fill(0));if(r.windowType===Ti.Arched)for(let R=0;R0&&s(r.id,v,o)<0&&(S[R][M]+=x*T))}else for(let R=0;R0){const D=R-p/2+.5,E=M-g/2+.5,W=new ie(D,E,0);W.applyEuler(C),v.set(b.x+W.x,b.y+W.y,b.z+W.z),s(r.id,v,o)<0&&(S[R][M]+=x*T)}return{intensity:S,unitArea:y*w}}static computePyramidRoofSolarRadiationEnergy(e,n,o,r,i,a,l,s,c,u,d,f){if(i)return cl.computeFlatRoofSolarRadiationEnergy(e,n,o,r,a,l,s,c,u,d,f);const p=n.solarRadiationHeatmapGridCellSize??.5,g=me.dayOfYear(e),y=new nn(0,0,s.rotation[2],"ZYX"),w=Ri(o,g,d,yi.SPHERE_MODEL),b=[],C=[];for(const[P,v]of l.entries()){const T=r.id+"-"+P,A=v[0].clone().applyEuler(y),x=v[1].clone().applyEuler(y),S=v[2].clone().applyEuler(y),R=new ie().subVectors(x,A),M=new ie().subVectors(S,A),D=new ie().subVectors(S,x),E=R.length(),W=new ie().crossVectors(M,D).length()/E,j=Math.max(2,Math.round(E/p)),L=Math.max(2,Math.round(W/p)),k=Array(j).fill(0).map(()=>Array(L).fill(0));b.push(k),R.normalize();const N=j*M.dot(R)/E;M.normalize(),D.normalize();const F=new ie().crossVectors(M,D).normalize(),U=R.multiplyScalar(.5*E/j),O=new ie().crossVectors(F,R).normalize().multiplyScalar(.5*W/L),B=new ie(s.cx+A.x,s.cy+A.y,s.lz+A.z+L0+(a?r.thickness:0));B.add(U).add(O),U.multiplyScalar(2),O.multiplyScalar(2),C.push(U.length()*O.length());const _=new ie,X=[],$=.01;X.push({x:-$,y:-$}),X.push({x:j+$,y:-$}),X.push({x:N,y:L+$});const Q=ni(n.ground,e.getMonth(),F,w),le=F.dot(o);for(let q=0;ql6||se<0)&&(k[q][re]+=Q),le>0&&se<0&&(k[q][re]+=le*w)}}}}return{segmentIntensities:b,segmentUnitArea:C}}static computeHipRoofSolarRadiationEnergy(e,n,o,r,i,a,l,s,c,u,d,f){if(i)return cl.computeFlatRoofSolarRadiationEnergy(e,n,o,r,a,l,s,c,u,d,f);const p=me.dayOfYear(e),g=n.solarRadiationHeatmapGridCellSize??.5,y=new nn(0,0,s.rotation[2],"ZYX"),w=Ri(o,p,d,yi.SPHERE_MODEL),b=[],C=[];for(const[P,v]of l.entries()){const T=r.id+"-"+P,A=v[0].clone().applyEuler(y),x=v[1].clone().applyEuler(y),S=v[2].clone().applyEuler(y),R=new ie().subVectors(x,A),M=new ie().subVectors(S,A),D=new ie().subVectors(S,x),E=R.length(),W=new ie().crossVectors(M,D).length()/E,j=Math.max(2,Math.round(E/g)),L=Math.max(2,Math.round(W/g)),k=Array(j).fill(0).map(()=>Array(L).fill(0));b.push(k),R.normalize();const N=j*M.dot(R)/E;M.normalize(),D.normalize();const F=new ie().crossVectors(M,D).normalize(),U=R.multiplyScalar(.5*E/j),O=new ie().crossVectors(F,R).normalize().multiplyScalar(.5*W/L),B=new ie,_=new ie(s.cx+A.x,s.cy+A.y,s.lz+A.z+L0+(a?r.thickness:0));_.add(U).add(O),U.multiplyScalar(2),O.multiplyScalar(2),C.push(U.length()*O.length());const X=ni(n.ground,e.getMonth(),F,w),$=F.dot(o),Q=[];for(const le of v)Q.push({x:le.x,y:le.y});if(P%2===0)for(let le=0;lel6||ae<0)&&(k[le][te]+=X),$>0&&ae<0&&(k[le][te]+=$*w)}}}else{const le=[];le.push({x:-.01,y:-.01}),le.push({x:j+.01,y:-.01}),le.push({x:N,y:L+.01});for(let te=0;tel6||ne<0)&&(k[te][ae]+=X),$>0&&ne<0&&(k[te][ae]+=$*w)}}}}}return{segmentIntensities:b,segmentUnitArea:C}}static computeGambrelRoofSolarRadiationEnergy(e,n,o,r,i,a,l,s,c,u,d,f){if(i)return cl.computeFlatRoofSolarRadiationEnergy(e,n,o,r,a,l,s,c,u,d,f);const p=me.dayOfYear(e),g=n.solarRadiationHeatmapGridCellSize??.5,y=new nn(0,0,s.rotation[2],"ZYX"),w=Ri(o,p,d,yi.SPHERE_MODEL),b=[],C=[];for(const[P,v]of l.entries()){const T=r.id+"-"+P,A=v[0].clone().applyEuler(y),x=v[1].clone().applyEuler(y),S=v[2].clone().applyEuler(y),R=new ie().subVectors(x,A),M=new ie().subVectors(S,A),D=new ie().subVectors(S,x),E=R.length(),W=new ie().crossVectors(M,D).length()/E,j=Math.max(2,Math.round(E/g)),L=Math.max(2,Math.round(W/g)),k=Array(j).fill(0).map(()=>Array(L).fill(0));b.push(k),R.normalize(),M.normalize(),D.normalize();const N=new ie().crossVectors(M,D).normalize(),F=R.multiplyScalar(.5*E/j),U=new ie().crossVectors(N,R).normalize().multiplyScalar(.5*W/L),O=new ie(s.cx+A.x,s.cy+A.y,s.lz+A.z+L0+(a?r.thickness:0));O.add(F).add(U),F.multiplyScalar(2),U.multiplyScalar(2),C.push(F.length()*U.length());const B=new ie,_=ni(n.ground,e.getMonth(),N,w),X=N.dot(o);for(let $=0;$l6||q<0)&&(k[$][le]+=_),X>0&&q<0&&(k[$][le]+=X*w)}}}return{segmentIntensities:b,segmentUnitArea:C}}static computeMansardRoofSolarRadiationEnergy(e,n,o,r,i,a,l,s,c,u,d,f){if(i)return cl.computeFlatRoofSolarRadiationEnergy(e,n,o,r,a,l,s,c,u,d,f);const p=me.dayOfYear(e),g=n.solarRadiationHeatmapGridCellSize??.5,y=new nn(0,0,s.rotation[2],"ZYX"),w=Ri(o,p,d,yi.SPHERE_MODEL),b=[],C=[];for(const[P,v]of l.entries()){const T=r.id+"-"+P;if(P===l.length-1){let A=Number.MAX_VALUE,x=Number.MAX_VALUE,S=-Number.MAX_VALUE,R=-Number.MAX_VALUE;for(const O of v){const B=O.clone().applyEuler(y);B.x>S&&(S=B.x),B.xR&&(R=B.y),B.yArray(E).fill(0));b.push(L);const k=new ie(A+g/2,x+g/2,s.lz+M+L0+(a?r.thickness:0)),N=new ie(0,0,k.z),F=ni(n.ground,e.getMonth(),Io,w),U=Io.dot(o);for(let O=0;Ol6||_<0)&&(L[O][B]+=F),U>0&&_<0&&(L[O][B]+=U*w)}}}else{const A=v[0].clone().applyEuler(y),x=v[1].clone().applyEuler(y),S=v[2].clone().applyEuler(y),R=new ie().subVectors(x,A),M=new ie().subVectors(S,A),D=new ie().subVectors(S,x),E=R.length(),W=new ie().crossVectors(M,D).length()/E,j=Math.max(2,Math.round(E/g)),L=Math.max(2,Math.round(W/g)),k=Array(j).fill(0).map(()=>Array(L).fill(0));b.push(k),R.normalize(),M.normalize(),D.normalize();const N=new ie().crossVectors(M,D).normalize(),F=R.multiplyScalar(.5*E/j),U=new ie().crossVectors(N,R).normalize().multiplyScalar(.5*W/L),O=new ie(s.cx+A.x,s.cy+A.y,s.lz+A.z+L0+(a?r.thickness:0));O.add(F).add(U),F.multiplyScalar(2),U.multiplyScalar(2),C.push(F.length()*U.length());const B=new ie,_=ni(n.ground,e.getMonth(),N,w),X=N.dot(o);for(let $=0;$l6||q<0)&&(k[$][le]+=_),X>0&&q<0&&(k[$][le]+=X*w)}}}}return{segmentIntensities:b,segmentUnitArea:C}}static computeFlatRoofSolarRadiationEnergy(e,n,o,r,i,a,l,s,c,u,d){const f=me.dayOfYear(e),p=n.solarRadiationHeatmapGridCellSize??.5,g=new nn(0,0,l.rotation[2],"ZYX"),y=Ri(o,f,u,yi.SPHERE_MODEL),w=[],b=[];let C=Number.MAX_VALUE,P=Number.MAX_VALUE,v=-Number.MAX_VALUE,T=-Number.MAX_VALUE;for(const k of a)for(const N of k){const F=N.clone().applyEuler(g);F.x>v&&(v=F.x),F.xT&&(T=F.y),F.yArray(x).fill(0));w.push(M),b.push(S*R);const D=a[0][0].z,E=new ie(C+p/2,P+p/2,l.lz+D+L0+(i?r.thickness:0)),W=new ie(0,0,E.z),j=ni(n.ground,e.getMonth(),Io,y),L=Io.dot(o);for(let k=0;kl6||F<0)&&(M[k][N]+=j),L>0&&F<0&&(M[k][N]+=L*y)}}return{segmentIntensities:w,segmentUnitArea:b}}static computeGableRoofSolarRadiationEnergy(e,n,o,r,i,a,l,s,c,u,d){const f=me.dayOfYear(e),p=n.solarRadiationHeatmapGridCellSize??.5,g=new nn(0,0,l.rotation[2],"ZYX"),y=Ri(o,f,u,yi.SPHERE_MODEL),w=[],b=[];for(const[C,P]of a.entries()){const v=r.id+"-"+C,T=P[0].clone().applyEuler(g),A=P[1].clone().applyEuler(g),x=P[2].clone().applyEuler(g),S=new ie().subVectors(A,T),R=new ie().subVectors(x,T),M=new ie().subVectors(x,A),D=S.length(),E=new ie().crossVectors(R,M).length()/D,W=Math.max(2,Math.round(D/p)),j=Math.max(2,Math.round(E/p)),L=Array(W).fill(0).map(()=>Array(j).fill(0));w.push(L),S.normalize(),R.normalize(),M.normalize();const k=new ie().crossVectors(R,M).normalize(),N=S.multiplyScalar(.5*D/W),F=new ie().crossVectors(k,S).normalize().multiplyScalar(.5*E/j),U=new ie(l.cx+T.x,l.cy+T.y,l.lz+T.z+L0+(i?r.thickness:0));U.add(N).add(F),N.multiplyScalar(2),F.multiplyScalar(2),b.push(N.length()*F.length());const O=new ie,B=ni(n.ground,e.getMonth(),k,y),_=k.dot(o);for(let X=0;Xl6||le<0)&&(L[X][Q]+=B),_>0&&le<0&&(L[X][Q]+=_*y)}}}return{segmentIntensities:w,segmentUnitArea:b}}static isPointRoof(e,n,o,r){if(n&&n.length>0)for(const i of n){const a=Cn.getAbsoluteWindowVerticesOnRoof(i,r),l=me.getPoints(a);if(me.isPointInside(e.x,e.y,l))return!1}if(o&&o.length>0)for(const i of o){const a=Cn.getAbsoluteSolarPanelVerticesOnRoof(i,r),l=me.getPoints(a);if(me.isPointInside(e.x,e.y,l))return!1}return!0}}const $Uo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(pA),r=H(qr),i=H(l3),a=H(t5),l=Tn(Cge),s=Tn(dW),c=Tn(Hge),u=Tn(U8t),d=Tn(B8t),f=Tn(O8t),p=H(ma),g=ht(hW),y=ht(Pwt),w=ht(Yq),b=ht(Cwt),C=H.getState().world,P=H.getState().elements,v=C.noAnimationForThermalSimulation,T=C.highestTemperatureTimeInMinutes??900,A=m.useRef(0),x=m.useRef(!1),S=m.useRef(new Date(C.date)),R=m.useRef(0),M=m.useRef(!1),D=m.useRef(new Date(C.date)),E=m.useRef(0),W=m.useRef({high:20,low:0}),j=m.useRef(20),L=m.useRef(20),k=m.useRef(new Map),N=m.useRef(new Map),F=m.useRef(new Map),U=m.useRef([]),O=m.useRef([]),B=m.useRef(),_=m.useRef(),X=m.useRef(0),$=m.useRef(new Map),Q=Jt(),le=f1(t),q=new Date(C.date),te=t?le==null?void 0:le.elevation:0,re=C.monthlyIrradianceLosses??new Array(12).fill(.05),ae=C.timesPerHour??4,se=60/ae,ne=C.daysPerYear??6,fe=12/ne,{scene:ge}=oi(),de=m.useMemo(()=>new l0,[]),Z=()=>a9(1,jye(q),hN(q),me.toRadians(C.latitude)).normalize(),he=(Oe,Ze,St)=>{if(U.current.length>1){O.current.length=0,de.set(Ze,St);const Pt=U.current.filter(Rt=>Rt.uuid!==Oe);if(de.intersectObjects(Pt,!1,O.current),O.current.length>0)return O.current[0].distance}return-1},xe=()=>{const Oe=ge.children.filter(Ze=>Ze.name==="Content");if(Oe.length>0){const Ze=Oe[0].children;U.current.length=0;for(const St of Ze)me.fetchSimulationElements(St,U.current)}},He=Oe=>{if(le){W.current=Qx(q,le.lowestTemperatures,le.highestTemperatures);const Ze=me.minutesIntoDay(Oe);j.current=$x(W.current.high,W.current.low,C.diurnalTemperatureModel??y2.Sinusoidal,T,dl(Oe,C.latitude),Ze),L.current=gZe(C.latitude,me.dayOfYear(q),Ze,le.lowestTemperatures,le.highestTemperatures,T,.5*(W.current.high-W.current.low),C.ground.thermalDiffusivity??.05,ZUe)}},Se=(Oe,Ze)=>{let St=k.current.get(Oe);St||(St=new Array(24).fill(0),k.current.set(Oe,St)),St[q.getHours()]+=Ze},ze=(Oe,Ze)=>{let St=N.current.get(Oe);St||(St=new Array(24).fill(0),N.current.set(Oe,St)),St[q.getHours()]+=Ze},Ie=(Oe,Ze)=>{let St=F.current.get(Oe);St||(St=new Array(24).fill(0),F.current.set(Oe,St)),St[q.getHours()]+=Ze},ye=()=>{var Oe,Ze,St,Pt;for(const Rt of P){if(me.onBuildingEnvelope(Rt)&&((Oe=k.current.get(Rt.id))==null||Oe.fill(0)),Rt.type===z.Roof)for(const Ut of k.current.keys())Ut!==Rt.id&&Ut.startsWith(Rt.id)&&((Ze=k.current.get(Ut))==null||Ze.fill(0));Rt.type===z.Foundation&&((St=N.current.get(Rt.id))==null||St.fill(0),(Pt=F.current.get(Rt.id))==null||Pt.fill(0))}},ce=()=>{$.current.clear()};m.useEffect(()=>{if(g)if(v&&!me.hasMovingParts(P))pe();else return xe(),ve(),A.current=requestAnimationFrame(Te),()=>{cancelAnimationFrame(A.current),x.current||(hn(Y.t("message.SimulationAborted",Q)),e(Oe=>{Oe.world.date=S.current.toLocaleString("en-US")}),ht.getState().set(Oe=>{Oe.simulationInProgress=!1,Oe.simulationPaused=!1})),M.current=!1}},[g]),m.useEffect(()=>{M.current=y,y?(D.current=new Date(q.getTime()),cancelAnimationFrame(A.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",Q))):(n("simulationPaused",!1),q.setHours(q.getHours(),q.getMinutes()+se),Te())},[y]);const pe=()=>{Je()},ve=()=>{M.current?(q.setTime(D.current.getTime()),M.current=!1):(S.current=new Date(C.date),E.current=me.dayOfYear(q),q.setHours(0,se/2)),x.current=!1,ye(),ce()},Ae=()=>{for(const Oe of P){if(me.onBuildingEnvelope(Oe)||Oe.type===z.SolarPanel){const Ze=k.current.get(Oe.id);Ze&&u(Oe.id,[...Ze]);const St=$.current.get(Oe.id);St&&l(Oe.id,St.map(Pt=>[...Pt]))}if(Oe.type===z.Roof){for(const Ze of k.current.keys())if(Ze!==Oe.id&&Ze.startsWith(Oe.id)){const St=k.current.get(Ze);St&&u(Ze,[...St]);const Pt=$.current.get(Ze);Pt&&l(Ze,Pt.map(Rt=>[...Rt]))}}if(Oe.type===z.Foundation){let Ze=N.current.get(Oe.id);Ze&&d(Oe.id,[...Ze]),Ze=F.current.get(Oe.id),Ze&&f(Oe.id,[...Ze])}}ht.getState().set(Oe=>{Oe.flagOfDailySimulation=!Oe.flagOfDailySimulation,Oe.runYearlyThermalSimulation||(Oe.showSolarRadiationHeatmap=!0,Oe.showHeatFluxes=!0)}),p&&!w&&setTimeout(()=>{e(Oe=>{const Ze=Tn.getState().totalBuildingHeater,St=Tn.getState().totalBuildingAc,Pt=Tn.getState().totalBuildingSolarPanel;Oe.actionInfo={name:"Daily Building Energy Analysis Completed",result:{Heater:Ze.toFixed(2),AC:St.toFixed(2),SolarPanel:Pt.toFixed(2),Net:(Ze+St-Pt).toFixed(2)},timestamp:new Date().getTime()}})},10)},Te=()=>{if(g&&!M.current){if(q.getMinutes()+q.getHours()*60+(me.dayOfYear(q)-E.current)*T2+se>T2){Je(),cancelAnimationFrame(A.current),e(Ze=>{Ze.world.date=S.current.toLocaleString("en-US"),Ze.viewState.showDailyBuildingEnergyPanel=!0,Ze.selectedFloatingWindow="dailyBuildingEnergyPanel"}),ht.getState().set(Ze=>{Ze.runDailyThermalSimulation=!1,Ze.simulationPaused=!1,Ze.simulationInProgress=!1}),hn(Y.t("message.SimulationCompleted",Q)),x.current=!0,Ae();return}e(Ze=>{Ze.world.date=q.toLocaleString("en-US")}),Je(),A.current=requestAnimationFrame(Te),q.setHours(q.getHours(),q.getMinutes()+se)}},[Me,Pe]=m.useState(q.getMonth());m.useEffect(()=>{setTimeout(()=>{xe()},200)},[Me]),m.useEffect(()=>{if(w)if(ht.getState().set(Oe=>{Oe.showSolarRadiationHeatmap=!1,Oe.showHeatFluxes=!1}),v&&!me.hasMovingParts(P))setTimeout(()=>{},50);else return Ee(),Pe(q.getMonth()),xe(),A.current=requestAnimationFrame(Be),()=>{cancelAnimationFrame(A.current),x.current||(hn(Y.t("message.SimulationAborted",Q)),e(Oe=>{Oe.world.date=S.current.toLocaleString("en-US")}),ht.getState().set(Oe=>{Oe.simulationInProgress=!1,Oe.simulationPaused=!1})),M.current=!1}},[w]),m.useEffect(()=>{M.current=b,b?(D.current=new Date(q.getTime()),cancelAnimationFrame(A.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",Q))):(n("simulationPaused",!1),q.setHours(q.getHours(),q.getMinutes()+se),Be())},[b]);const Ee=()=>{M.current?(q.setTime(D.current.getTime()),M.current=!1):(S.current=new Date(C.date),R.current=0,q.setMonth(0,22),E.current=me.dayOfYear(q),q.setHours(0,se/2),e(Oe=>{Oe.viewState.showYearlyBuildingEnergyPanel=!0,Oe.selectedFloatingWindow="yearlyBuildingEnergyPanel",Oe.world.date=q.toLocaleString("en-US")})),ye(),ce(),x.current=!1},Be=()=>{w&&!M.current&&(q.getMinutes()+q.getHours()*60+(me.dayOfYear(q)-E.current)*T2{Ze.world.date=q.toLocaleString("en-US")}),Je(),q.setHours(q.getHours(),q.getMinutes()+se),A.current=requestAnimationFrame(Be)):(Ae(),R.current++,R.current===ne?(cancelAnimationFrame(A.current),setTimeout(()=>{e(Ze=>{Ze.world.date=S.current.toLocaleString("en-US")})},10),ht.getState().set(Ze=>{Ze.runYearlyThermalSimulation=!1,Ze.simulationInProgress=!1,Ze.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",Q)),x.current=!0,p&&setTimeout(()=>{e(Ze=>{const St=Tn.getState().totalBuildingHeater,Pt=Tn.getState().totalBuildingAc,Rt=Tn.getState().totalBuildingSolarPanel;Ze.actionInfo={name:"Yearly Building Energy Analysis Completed",result:{Heater:St.toFixed(2),AC:Pt.toFixed(2),SolarPanel:Rt.toFixed(2),Net:(St+Pt-Rt).toFixed(2)},timestamp:new Date().getTime()}})},10)):(q.setMonth(R.current*fe,22),q.setHours(0,se/2),Pe(q.getMonth()),E.current=me.dayOfYear(q),ye(),ce(),A.current=requestAnimationFrame(Be))))},Je=()=>{He(q),_.current=dl(q,C.latitude);const Oe=_.current.daylight()/60;X.current=Oe>It?le.sunshineHours[q.getMonth()]/(30*Oe*ae):0,B.current=Z();for(const Ze of P)switch(Ze.type){case z.Door:{it(Ze);break}case z.Window:{ke(Ze),Ye(Ze);break}case z.Wall:{Ve(Ze);break}case z.Roof:{const St=Ze;Xe(St),yt(St);break}case z.SolarPanel:{De(Ze);break}}},We=(Oe,Ze)=>{let St=Ze.efficiency;return Ze.cellType==="Monocrystalline"&&(St*=.95),St*(1+Ze.pmaxTC*(Oe-25))},Ke=()=>{if(!_.current)throw new Error("sun minutes not set");const Oe=_.current.daylight()/60;return Oe>It?le.sunshineHours[q.getMonth()]/(30*Oe*ae):0},Ne=Oe=>{if(!a(Oe.pvModelName))throw new Error("PV model not found");return Oe.lx*Oe.ly*(Oe.inverterEfficiency??.95)*(1-re[q.getMonth()])},De=Oe=>{const Ze=o(Oe);if(Ze){const St=r(Oe);if(St){const Pt=a(Oe.pvModelName);if(B.current&&B.current.z>0){const Rt=cl.computeSolarPanelOutput(q,C,B.current,Pt,Oe,St,Ze,te,he),Ut=We(j.current,Pt)*Ke()*Ne(Oe);if(Ie(Ze.id,Rt.average*Ut),g){for(let At=0;At{var St;if(Oe.interior)return;const Ze=o(Oe);if(Ze){const Pt=r(Oe);if(Pt){const Rt=((St=Ze.hvacSystem)==null?void 0:St.thermostatSetpoint)??20,Ut=me.getWindowArea(Oe,Oe.parentType===z.Roof?void 0:Pt),Ht=j.current-Rt;Oe.empty?Se(Oe.id,Ht*Ut*wO*.001/ae):Se(Oe.id,Ht*Ut*(Oe.uValue??V4)*.001/ae)}}},Ye=Oe=>{if(Oe.interior)return;const Ze=o(Oe);if(Ze){const St=r(Oe);if(St){let Pt=0;if(Oe.parentType===z.Roof){const Rt=s(St.id);if(!Rt)return;for(let Ut=0;Ut0){const Ht=cl.computeRoofWindowSolarRadiationEnergy(q,C,B.current,Oe,St,Ze,te,he);for(let At=0;At0){const Rt=cl.computeWallWindowSolarRadiationEnergy(q,C,B.current,Oe,St,Ze,te,he);for(let Ut=0;Ut{var St;if(Oe.interior)return;const Ze=o(Oe);if(Ze){const Pt=r(Oe);if(Pt){const Rt=((St=Ze.hvacSystem)==null?void 0:St.thermostatSetpoint)??20,Ut=me.getDoorArea(Oe,Pt);if(Oe.filled){const Ht=K7(Oe);let At=0;if(B.current&&B.current.z>0){const dt=cl.computeDoorSolarRadiationEnergy(q,C,B.current,Oe,Pt,Ze,te,he);for(let Ct=0;Ct{var St;const Ze=o(Oe);if(Ze){const Pt=Oe.fill!==El.Empty&&Oe.wallStructure===gc.Default,Rt=((St=Ze.hvacSystem)==null?void 0:St.thermostatSetpoint)??20;if(Pt){const Ut=Oe.fill===El.Partial&&!me.isPartialWallFull(Oe),Ht=me.getWallVertices(Oe,0),At=Ut?me.getPartialWallVertices(Oe,0):Ht,kt=me.getPolygonArea(Ht);let gt=Ut?me.getPolygonArea(At):kt;const dt=i(z.Window,Oe.id),Ct=i(z.Door,Oe.id),tt=K7(Oe);let Fe=0;if(B.current&&B.current.z>0){const mt=(Ut?At.length:Ht.length)===4,Qe=i(z.SolarPanel,Oe.id),Tt=cl.computeWallSolarRadiationEnergy(q,C,B.current,Oe,Ze,dt,Ct,Qe,mt?0:1,te,he);for(let Dt=0;Dt0)for(const mt of dt)gt-=me.getWindowArea(mt,Oe);if(Ct&&Ct.length>0)for(const mt of Ct)gt-=mt.lx*mt.lz*Oe.lx*Oe.lz;const qe=me.isZero(Fe)||me.isZero(tt)?0:Fe*tt/((Oe.volumetricHeatCapacity??.5)*gt*Oe.ly);let rt=(j.current+qe-Rt)*gt/(Oe.rValue??f6)*.001/ae;Ut&&Oe.openToOutside&&(rt+=(j.current-Rt)*(kt-gt)*wO*.001/ae),Se(Oe.id,rt)}else if(Oe.openToOutside){const Ut=me.getWallVertices(Oe,0),Ht=me.getPolygonArea(Ut),At=j.current-Rt;Se(Oe.id,At*Ht*wO*.001/ae)}}},yt=Oe=>{var Ut;const Ze=o(Oe);if(!Ze)return;const St=((Ut=Ze.hvacSystem)==null?void 0:Ut.thermostatSetpoint)??20,Pt=me.calculateBuildingArea(Oe),Rt=L.current-St;Se(Ze.id,Rt*Pt/(Ze.rValue??o8)*.001/ae)},ct=(Oe,Ze,St)=>{const Pt=1/(Oe.rValue??r8),Rt=1/(Oe.ceilingRValue??y6);return(Pt*Ze+Rt*St)/(Pt+Rt)},Xe=Oe=>{var Rt;const Ze=o(Oe);if(!Ze)return;const St=s(Oe.id);if(!St)return;let Pt;switch(Oe.roofType){case Go.Pyramid:Pt=ut(Oe,St,Ze);break;case Go.Hip:Pt=ft(Oe,St,Ze);break;case Go.Gable:Pt=at(Oe,St,Ze);break;case Go.Gambrel:Pt=ot(Oe,St,Ze);break;case Go.Mansard:Pt=st(Oe,St,Ze);break}if(Pt){const Ut=((Rt=Ze.hvacSystem)==null?void 0:Rt.thermostatSetpoint)??20;let Ht=0;for(const[At,kt]of Pt.entries()){const dt=(kt.surfaceTemperature-(Oe.ceiling?ct(Oe,kt.surfaceTemperature,Ut):Ut))*kt.totalArea/(Oe.rValue??r8)*.001/ae;Se(Oe.id+"-"+At,dt),Ht+=dt}Se(Oe.id,Ht)}},ut=(Oe,Ze,St)=>{if(Oe.roofType!==Go.Pyramid)throw new Error("roof is not pyramid");const Pt=Ze.length;if(Pt===0)return;let Rt=!0;const Ut=Ze[0][0].z;for(const Fe of Ze)for(const qe of Fe)if(Math.abs(qe.z-Ut)>.01){Rt=!1;break}const Ht=Rt?1:Pt,At=i(z.Window,Oe.id),kt=[];if(Rt){let Fe=0;for(const qe of Ze){const je=[];for(const rt of qe)je.push(me.mapVector3ToPoint2(rt));Fe+=me.getPolygonArea(je)}if(At.length>0){for(const qe of At)Fe-=qe.lx*qe.lz;Fe<0&&(Fe=0)}kt.push(Fe)}else for(const Fe of Ze){let qe=me.getTriangleArea(Fe[0],Fe[1],Fe[2]);if(At.length>0){for(const je of At)Cn.onSegment(Fe,je.cx,je.cy)&&(qe-=je.lx*je.lz);qe<0&&(qe=0)}kt.push(qe)}const gt=K7(Oe),dt=Array(Ht).fill(0);if(B.current&&B.current.z>0){const Fe=i(z.SolarPanel,Oe.id),qe=cl.computePyramidRoofSolarRadiationEnergy(q,C,B.current,Oe,Rt,!0,Ze,St,At,Fe,te,he);for(let je=0;je{if(Oe.roofType!==Go.Hip)throw new Error("roof is not hip");const Pt=Ze.length;if(Pt===0)return;let Rt=!0;const Ut=Ze[0][0].z;for(const qe of Ze)for(const je of qe)if(Math.abs(je.z-Ut)>.01){Rt=!1;break}const Ht=Rt?1:Pt,At=[],kt=i(z.Window,Oe.id);for(const qe of Ze){let je=0;if(qe.length===3?je=me.getTriangleArea(qe[0],qe[1],qe[2]):qe.length===4&&(je=me.getTriangleArea(qe[0],qe[1],qe[2])+me.getTriangleArea(qe[2],qe[3],qe[0])),kt.length>0){for(const rt of kt)Cn.onSegment(qe,rt.cx,rt.cy)&&(je-=rt.lx*rt.lz);je<0&&(je=0)}At.push(je)}const gt=Rt?[At.reduce((qe,je)=>qe+je,0)]:At,dt=K7(Oe),Ct=Array(Ht).fill(0);if(B.current&&B.current.z>0){const qe=i(z.SolarPanel,Oe.id),je=cl.computeHipRoofSolarRadiationEnergy(q,C,B.current,Oe,Rt,!0,Ze,St,kt,qe,te,he);for(let rt=0;rt{if(Oe.roofType!==Go.Gambrel)throw new Error("roof is not gambrel");const Pt=Ze.length;if(Pt===0)return;let Rt=!0;const Ut=Ze[0][0].z;for(const qe of Ze)for(const je of qe)if(Math.abs(je.z-Ut)>.01){Rt=!1;break}const Ht=Rt?1:Pt,At=[],kt=i(z.Window,Oe.id);for(const qe of Ze){let je=me.getTriangleArea(qe[0],qe[1],qe[2])+me.getTriangleArea(qe[2],qe[3],qe[0]);if(kt.length>0){for(const rt of kt)Cn.onSegment(qe,rt.cx,rt.cy)&&(je-=rt.lx*rt.lz);je<0&&(je=0)}At.push(je)}const gt=Rt?[At.reduce((qe,je)=>qe+je,0)]:At,dt=K7(Oe),Ct=Array(Ht).fill(0);if(B.current&&B.current.z>0){const qe=i(z.SolarPanel,Oe.id),je=cl.computeGambrelRoofSolarRadiationEnergy(q,C,B.current,Oe,Rt,!0,Ze,St,kt,qe,te,he);for(let rt=0;rt{if(Oe.roofType!==Go.Mansard)throw new Error("roof is not mansard");const Pt=Ze.length;if(Pt===0)return;let Rt=!0;const Ut=Ze[0][0].z;for(const mt of Ze)for(const Qe of mt)if(Math.abs(Qe.z-Ut)>.01){Rt=!1;break}const Ht=Rt?1:Pt,At=[],kt=i(z.Window,Oe.id);for(let mt=0;mt0){for(const Dt of kt)Cn.onSegment(Qe,Dt.cx,Dt.cy)&&(Tt-=Dt.lx*Dt.lz);Tt<0&&(Tt=0)}At.push(Tt)}const gt=Ze[Pt-1],dt=new Array;for(const mt of gt)dt.push({x:mt.x,y:mt.y});let Ct=me.getPolygonArea(dt);if(kt.length>0){for(let mt=kt.length-1;mt>=0;mt--){const Qe=kt[mt];Cn.onSegment(gt,Qe.cx,Qe.cy)&&(Ct-=Qe.lx*Qe.lz,kt.splice(mt,1))}Ct<0&&(Ct=0)}At.push(Ct);const tt=Rt?[At.reduce((mt,Qe)=>mt+Qe,0)]:At,Fe=K7(Oe),qe=Array(Ht).fill(0);if(B.current&&B.current.z>0){const mt=i(z.SolarPanel,Oe.id),Qe=cl.computeMansardRoofSolarRadiationEnergy(q,C,B.current,Oe,Rt,!0,Ze,St,kt,mt,te,he);for(let Tt=0;Tt{if(Oe.roofType!==Go.Gable)throw new Error("roof is not gable");const Pt=Ze.length;if(Pt===0)return;const Rt=i(z.Window,Oe.id),Ut=[];for(const dt of Ze){let Ct=me.getTriangleArea(dt[0],dt[1],dt[2])+me.getTriangleArea(dt[2],dt[3],dt[0]);if(Rt.length>0){for(const tt of Rt)Cn.onSegment(dt,tt.cx,tt.cy)&&(Ct-=tt.lx*tt.lz);Ct<0&&(Ct=0)}Ut.push(Ct)}const Ht=K7(Oe),At=Array(Pt).fill(0);if(B.current&&B.current.z>0){const dt=i(z.SolarPanel,Oe.id),Ct=cl.computeGableRoofSolarRadiationEnergy(q,C,B.current,Oe,!0,Ze,St,Rt,dt,te,he);for(let tt=0;tt{const e=H.getState().world,n=H.getState().elements,o=H(qr),r=H(pA),i=Tn(Cge),a=Tn(OBe),l=ht(zge),s=Tn(Hge),{scene:c}=oi(),u=Jt(),d=f1(t),f=new Date(e.date),p=t?d==null?void 0:d.elevation:0,g=60/e.timesPerHour,y=m.useMemo(()=>new l0,[]),w=e.solarRadiationHeatmapGridCellSize??.5,b=m.useRef([]),C=m.useRef([]);m.useEffect(()=>{l&&n&&n.length>0&&(a(),T(),ht.getState().set(U=>{U.runStaticSimulation=!1,U.simulationInProgress=!1,U.showSolarRadiationHeatmap=!0}),hn(Y.t("message.SimulationCompleted",u)))},[l]);const P=(U,O,B)=>{if(b.current.length>1){C.current.length=0,y.set(O,B);const _=b.current.filter(X=>X.uuid!==U);return y.intersectObjects(_,!1,C.current),C.current.length>0}return!1},v=()=>{const U=c.children.filter(O=>O.name==="Content");if(U.length>0){const O=U[0].children;b.current.length=0;for(const B of O)me.fetchSimulationElements(B,b.current)}},T=()=>{v();for(const U of n)switch(U.type){case z.Foundation:{const O=U;x(O),O.solarStructure===Dn.UpdraftTower&&S(O);break}case z.Cuboid:{A(U);break}case z.SolarPanel:{R(U);break}case z.Wall:{M(U);break}case z.Door:{D(U);break}case z.Roof:{const O=U;switch(O.roofType){case Go.Pyramid:E(O);break;case Go.Gable:N(O);break;case Go.Gambrel:j(O);break;case Go.Mansard:W(O);break;case Go.Hip:L(O);break}break}}},A=U=>{const O=f.getFullYear(),B=f.getMonth(),_=f.getDate(),X=me.dayOfYear(f),$=U.lx,Q=U.ly,le=U.lz,q=Math.max(2,Math.round($/w)),te=Math.max(2,Math.round(Q/w)),re=Math.max(2,Math.round(le/w)),ae=$/q,se=Q/te,ne=le/re,fe=o(U);let ge=U.cx,de=U.cy,Z=U.cz;if(fe&&fe.type===z.Cuboid){const De=me.getWorldDataById(U.id);ge=De.pos.x,de=De.pos.y,Z=De.pos.z}const he=Array(q).fill(0).map(()=>Array(te).fill(0)),xe=Array(q).fill(0).map(()=>Array(re).fill(0)),He=Array(q).fill(0).map(()=>Array(re).fill(0));let Se=Array(te).fill(0).map(()=>Array(re).fill(0)),ze=Array(te).fill(0).map(()=>Array(re).fill(0));const Ie=Io,ye=Vp.clone().applyAxisAngle(Io,U.rotation[2]),ce=Oc.clone().applyAxisAngle(Io,U.rotation[2]),pe=_p.clone().applyAxisAngle(Io,U.rotation[2]),ve=Op.clone().applyAxisAngle(Io,U.rotation[2]),Ae=new ie;let Te=0;const Me=new Xt(ge,de),Pe=new Xt,Ee=de-Q/2,Be=de+Q/2,Je=ge-$/2,We=ge+$/2;for(let De=0;De<24;De++)for(let ke=0;ke0){Te++;const Ve=Ri(it,X,p,yi.SPHERE_MODEL);let yt=ni(e.ground,B,Ie,Ve),ct=Ie.dot(it),Xe=ge-$/2,ut=de-Q/2;const ft=Z+le/2;for(let ot=0;ot0&&(Pe.set(Xe+(ot+.5)*ae,ut+(st+.5)*se),Pe.rotateAround(Me,U.rotation[2]),Ae.set(Pe.x,Pe.y,ft),P(U.id,Ae,it)||(he[ot][st]+=ct*Ve));Xe=ge-$/2,ut=Z-le/2,yt=ni(e.ground,B,ye,Ve),ct=ye.dot(it);for(let ot=0;ot0&&(Pe.set(Xe+(ot+.5)*ae,Ee),Pe.rotateAround(Me,U.rotation[2]),Ae.set(Pe.x,Pe.y,ut+(st+.5)*ne),P(U.id,Ae,it)||(xe[ot][st]+=ct*Ve));yt=ni(e.ground,B,ce,Ve),ct=ce.dot(it);for(let ot=0;ot0&&(Pe.set(Xe+(ot+.5)*ae,Be),Pe.rotateAround(Me,U.rotation[2]),Ae.set(Pe.x,Pe.y,ut+(re-(st+.5))*ne),P(U.id,Ae,it)||(He[ot][st]+=ct*Ve));Xe=de-Q/2,ut=Z-le/2,yt=ni(e.ground,B,pe,Ve),ct=pe.dot(it);for(let ot=0;ot0&&(Pe.set(Je,Xe+(ot+.5)*se),Pe.rotateAround(Me,U.rotation[2]),Ae.set(Pe.x,Pe.y,ut+(st+.5)*ne),P(U.id,Ae,it)||(Se[ot][st]+=ct*Ve));yt=ni(e.ground,B,ve,Ve),ct=ve.dot(it);for(let ot=0;ot0&&(Pe.set(We,Xe+(ot+.5)*se),Pe.rotateAround(Me,U.rotation[2]),Ae.set(Pe.x,Pe.y,ut+(st+.5)*ne),P(U.id,Ae,it)||(ze[ot][st]+=ct*Ve))}}Se=me.transpose(Se),ze=me.transpose(ze);const Ke=Te*g/60,Ne=Ke>It?d.sunshineHours[B]/(30*Ke*e.timesPerHour):0;F(he,Ne),F(xe,Ne),F(He,Ne),F(Se,Ne),F(ze,Ne),i(U.id+"-top",he),i(U.id+"-south",xe),i(U.id+"-north",He),i(U.id+"-west",Se),i(U.id+"-east",ze)},x=U=>{const O=f.getFullYear(),B=f.getMonth(),_=f.getDate(),X=me.dayOfYear(f),$=U.lx,Q=U.ly,le=U.lz,q=Math.max(2,Math.round($/w)),te=Math.max(2,Math.round(Q/w)),re=$/q,ae=Q/te,se=U.cx-$/2,ne=U.cy-Q/2,fe=new Xt(U.cx,U.cy),ge=new ie,de=Array(q).fill(0).map(()=>Array(te).fill(0));let Z=0;for(let He=0;He<24;He++)for(let Se=0;Se0){Z++;const ye=Ri(Ie,X,p,yi.SPHERE_MODEL),ce=ni(e.ground,B,Io,ye),pe=Io.dot(Ie),ve=new Xt;for(let Ae=0;Ae0&&(ve.set(se+(Ae+.5)*re,ne+(Te+.5)*ae),ve.rotateAround(fe,U.rotation[2]),ge.set(ve.x,ve.y,le),P(U.id,ge,Ie)||(de[Ae][Te]+=pe*ye))}}const he=Z*g/60,xe=he>It?d.sunshineHours[B]/(30*he*e.timesPerHour):0;F(de,xe),i(U.id,de)},S=U=>{const O=U.solarUpdraftTower;if(!O)return;const B=f.getFullYear(),_=f.getMonth(),X=f.getDate(),$=me.dayOfYear(f),Q=O.collectorRadius,le=Math.max(2,Math.round(Q*2/w)),q=U.cx-Q+w/2,te=U.cy-Q+w/2,re=U.lz+O.collectorHeight,ae=Array(le).fill(0).map(()=>Array(le).fill(0)),se=new ie(0,0,re),ne=Q*Q;let fe=0,ge,de;for(let xe=0;xe<24;xe++)for(let He=0;He0){fe++;const Ie=Ri(ze,$,p,yi.SPHERE_MODEL),ye=ni(e.ground,_,Io,Ie),ce=Io.dot(ze);for(let pe=0;pene)&&(ae[pe][ve]+=ye,ce>0&&(P(U.id+"-sut",se,ze)||(ae[pe][ve]+=ce*Ie)))}}}const Z=fe*g/60,he=Z>It?d.sunshineHours[_]/(30*Z*e.timesPerHour):0;F(ae,he),i(U.id+"-sut",ae)},R=U=>{if(U.trackerType!==za.NO_TRACKER)throw new Error("trackers cannot use static simulation");let O=o(U);if(!O)throw new Error("parent of solar panel does not exist");const B=U.parentType===z.Roof,_=U.parentType===z.Wall;if(B&&(O=r(O),!O))throw new Error("foundation of solar panel does not exist");const X=_?me.absoluteCoordinates(U.cx,U.cy,U.cz,O,r(U),U.lz):me.absoluteCoordinates(U.cx,U.cy,U.cz,O,void 0,void 0,!0),$=new ie().fromArray(U.normal);_&&$.applyEuler(new nn(0,0,O.relativeAngle));const Q=O.rotation[2];let le=Q+(_?0:U.relativeAzimuth),q=U.tiltAngle,te=!0;if(B&&(X.z=U.cz+U.lz+.02+O.cz,me.isZero(U.rotation[0])?X.z+=U.poleHeight:(q=U.rotation[0],le=Q,te=!1)),_&&!me.isZero(U.tiltAngle)){const Me=O,Pe=r(O),Be=(Pe?Pe.rotation[2]+Me.relativeAngle:Me.relativeAngle)-Gt,Je=U.ly*Math.abs(Math.sin(U.tiltAngle))/2;X.x+=Je*Math.cos(Be),X.y+=Je*Math.sin(Be)}const re=new nn(B&&!te?0:q,0,le,"ZYX");$.applyEuler(re);const ae=f.getFullYear(),se=f.getMonth(),ne=f.getDate(),fe=me.dayOfYear(f),ge=U.lx,de=U.ly,Z=Math.max(2,Math.round(U.lx/w)),he=Math.max(2,Math.round(U.ly/w)),xe=ge/Z,He=de/he,Se=X.x-(ge-w)/2,ze=X.y-(de-w)/2,Ie=B||_?X.z:O.lz+U.poleHeight+U.lz,ye=new Xt(X.x,X.y),ce=new ie,pe=Array(Z).fill(0).map(()=>Array(he).fill(0));let ve=0;if(B&&!te&&(re.x=U.rotation[0],re.z=U.rotation[2]+Q),_){const Me=o(U);Me&&(re.x=Gt+U.tiltAngle,re.z=O.relativeAngle+Me.rotation[2])}for(let Me=0;Me<24;Me++)for(let Pe=0;Pe0){ve++;const Je=Ri(Be,fe,p,yi.SPHERE_MODEL),We=ni(e.ground,se,$,Je),Ke=$.dot(Be),Ne=new Xt,De=new ie;for(let ke=0;ke0&&(Ne.set(Se+ke*xe,ze+Ye*He),De.set(Ne.x-ye.x,Ne.y-ye.y,0),De.applyEuler(re),ce.set(X.x+De.x,X.y+De.y,Ie+De.z),P(U.id,ce,Be)||(pe[ke][Ye]+=Ke*Je))}}const Ae=ve*g/60,Te=Ae>It?d.sunshineHours[se]/(30*Ae*e.timesPerHour):0;F(pe,Te),i(U.id,pe)},M=U=>{const O=r(U);if(!O)throw new Error("foundation of wall not found");const B=f.getFullYear(),_=f.getMonth(),X=f.getDate(),$=me.dayOfYear(f),Q=U.lx,le=me.getHighestPointOfWall(U),q=Math.max(2,Math.round(Q/w)),te=Math.max(2,Math.round(le/w)),re=Q/q,ae=le/te,se=O.rotation[2]+U.relativeAngle,ne=me.wallAbsolutePosition(new ie(U.cx,U.cy,le/2),O).setZ(le/2+O.lz),fe=new ie(Math.cos(se-Gt),Math.sin(se-Gt),0),ge=new ie,de=Array(q).fill(0).map(()=>Array(te).fill(0));let Z=0;const he=re*Math.cos(se),xe=re*Math.sin(se),He=me.getWallVertices(U,2),Se=(le-U.lz)/2;for(let ye=0;ye<24;ye++)for(let ce=0;ce0){Z++;const Ae=Ri(ve,$,p,yi.SPHERE_MODEL),Te=ni(e.ground,_,fe,Ae),Me=fe.dot(ve);for(let Pe=0;Pe0&&(ge.set(ne.x+Be*he,ne.y+Be*xe,ne.z+Je*ae),P(U.id,ge,ve)||(de[Pe][Ee]+=Me*Ae)))}}}const ze=Z*g/60,Ie=ze>It?d.sunshineHours[_]/(30*ze*e.timesPerHour):0;F(de,Ie),i(U.id,de)},D=U=>{const O=r(U);if(!O)throw new Error("foundation of door not found");const B=o(U);if(!B)throw new Error("parent of door not found");const _=B,X=f.getFullYear(),$=f.getMonth(),Q=f.getDate(),le=me.dayOfYear(f),q=U.lx*_.lx,te=U.lz*_.lz,re=Math.max(2,Math.round(q/w)),ae=Math.max(2,Math.round(te/w)),se=q/re,ne=te/ae,fe=O.rotation[2]+_.relativeAngle,de=me.wallAbsolutePosition(new ie(_.cx,_.cy,_.cz),O).setZ(_.lz/2+O.lz).clone().add(new ie(U.cx*_.lx,0,U.cz*_.lz)),Z=new ie(Math.cos(fe-Gt),Math.sin(fe-Gt),0),he=new ie,xe=Array(re).fill(0).map(()=>Array(ae).fill(0));let He=0;const Se=se*Math.cos(fe),ze=se*Math.sin(fe);for(let ce=0;ce<24;ce++)for(let pe=0;pe0){He++;const Te=Ri(Ae,le,p,yi.SPHERE_MODEL),Me=ni(e.ground,$,Z,Te),Pe=Z.dot(Ae);if(U.doorType===Pd.Arched)for(let Ee=0;Ee0&&(P(U.id,he,Ae)||(xe[Ee][Be]+=Pe*Te)))}else for(let Ee=0;Ee0&&(he.set(de.x+Je*Se,de.y+Je*ze,de.z+We*ne),P(U.id,he,Ae)||(xe[Ee][Be]+=Pe*Te))}}}const Ie=He*g/60,ye=Ie>It?d.sunshineHours[$]/(30*Ie*e.timesPerHour):0;F(xe,ye),i(U.id,xe)},E=U=>{if(U.roofType!==Go.Pyramid)throw new Error("roof is not pyramid");const O=r(U);if(!O)throw new Error("foundation of wall not found");const B=s(U.id);if(!B||B.length===0)return;let _=!0;const X=B[0][0].z;for(const $ of B)for(const Q of $)if(Math.abs(Q.z-X)>.01){_=!1;break}if(_)k(U,O,B);else{const $=f.getFullYear(),Q=f.getMonth(),le=f.getDate(),q=me.dayOfYear(f),te=new nn(0,0,O.rotation[2],"ZYX");for(const[re,ae]of B.entries()){const se=U.id+"-"+re,ne=ae[0].clone().applyEuler(te),fe=ae[1].clone().applyEuler(te),ge=ae[2].clone().applyEuler(te),de=new ie().subVectors(fe,ne),Z=new ie().subVectors(ge,ne),he=new ie().subVectors(ge,fe),xe=de.length(),He=new ie().crossVectors(Z,he).length()/xe,Se=Math.max(2,Math.round(xe/w)),ze=Math.max(2,Math.round(He/w)),Ie=Array(Se).fill(0).map(()=>Array(ze).fill(0));de.normalize(),Z.normalize(),he.normalize();const ye=new ie().crossVectors(Z,he).normalize(),ce=de.multiplyScalar(.5*xe/Se),pe=new ie().crossVectors(ye,de).normalize().multiplyScalar(.5*He/ze),ve=new ie(O.cx+ne.x,O.cy+ne.y,O.lz+ne.z+L0);ve.add(ce).add(pe),ce.multiplyScalar(2),pe.multiplyScalar(2);let Ae=0;const Te=new ie;for(let Ee=0;Ee<24;Ee++)for(let Be=0;Be0){Ae++;const Ke=Ri(We,q,p,yi.SPHERE_MODEL),Ne=ni(e.ground,Q,ye,Ke),De=ye.dot(We);for(let ke=0;ke0&&(Te.copy(ve).add(Ye).add(pe.clone().multiplyScalar(it)),P(se,Te,We)||(Ie[ke][it]+=De*Ke))}}}const Me=Ae*g/60,Pe=Me>It?d.sunshineHours[Q]/(30*Me*e.timesPerHour):0;F(Ie,Pe),i(se,Ie)}}},W=U=>{if(U.roofType!==Go.Mansard)throw new Error("roof is not mansard");const O=r(U);if(!O)throw new Error("foundation of wall not found");const B=s(U.id);if(!B||B.length===0)return;let _=!0;const X=B[0][0].z;for(const $ of B)for(const Q of $)if(Math.abs(Q.z-X)>.01){_=!1;break}if(_)k(U,O,B);else{const $=f.getFullYear(),Q=f.getMonth(),le=f.getDate(),q=me.dayOfYear(f),te=new nn(0,0,O.rotation[2],"ZYX");for(const[re,ae]of B.entries()){const se=U.id+"-"+re;if(re===B.length-1){let ne=Number.MAX_VALUE,fe=Number.MAX_VALUE,ge=-Number.MAX_VALUE,de=-Number.MAX_VALUE;for(const Ae of ae){const Te=Ae.clone().applyEuler(te);Te.x>ge&&(ge=Te.x),Te.xde&&(de=Te.y),Te.yArray(xe).fill(0)),Ie=new ie(ne+w/2,fe+w/2,O.lz+Z+L0);let ye=0;const ce=new ie(0,0,Ie.z);for(let Ae=0;Ae<24;Ae++)for(let Te=0;Te0){ye++;const Ee=Ri(Pe,q,p,yi.SPHERE_MODEL),Be=ni(e.ground,Q,Io,Ee),Je=Io.dot(Pe);for(let We=0;We0&&(ce.y=Ie.y+Ke*Se,P(se,ce,Pe)||(ze[We][Ke]+=Je*Ee))}}}const pe=ye*g/60,ve=pe>It?d.sunshineHours[Q]/(30*pe*e.timesPerHour):0;F(ze,ve),i(se,ze)}else{const ne=ae[0].clone().applyEuler(te),fe=ae[1].clone().applyEuler(te),ge=ae[2].clone().applyEuler(te),de=new ie().subVectors(fe,ne),Z=new ie().subVectors(ge,ne),he=new ie().subVectors(ge,fe),xe=de.length(),He=new ie().crossVectors(Z,he).length()/xe,Se=Math.max(2,Math.round(xe/w)),ze=Math.max(2,Math.round(He/w)),Ie=Array(Se).fill(0).map(()=>Array(ze).fill(0));de.normalize(),Z.normalize(),he.normalize();const ye=new ie().crossVectors(Z,he).normalize(),ce=de.multiplyScalar(.5*xe/Se),pe=new ie().crossVectors(ye,de).normalize().multiplyScalar(.5*He/ze),ve=new ie(O.cx+ne.x,O.cy+ne.y,O.lz+ne.z+L0);ve.add(ce).add(pe),ce.multiplyScalar(2),pe.multiplyScalar(2);let Ae=0;const Te=new ie;for(let Ee=0;Ee<24;Ee++)for(let Be=0;Be0){Ae++;const Ke=Ri(We,q,p,yi.SPHERE_MODEL),Ne=ni(e.ground,Q,ye,Ke),De=ye.dot(We);for(let ke=0;ke0&&(Te.copy(ve).add(Ye).add(pe.clone().multiplyScalar(it)),P(se,Te,We)||(Ie[ke][it]+=De*Ke))}}}const Me=Ae*g/60,Pe=Me>It?d.sunshineHours[Q]/(30*Me*e.timesPerHour):0;F(Ie,Pe),i(se,Ie)}}}},j=U=>{if(U.roofType!==Go.Gambrel)throw new Error("roof is not gambrel");const O=r(U);if(!O)throw new Error("foundation of wall not found");const B=s(U.id);if(!B||B.length===0)return;let _=!0;const X=B[0][0].z;for(const $ of B)for(const Q of $)if(Math.abs(Q.z-X)>.01){_=!1;break}if(_)k(U,O,B);else{const $=f.getFullYear(),Q=f.getMonth(),le=f.getDate(),q=me.dayOfYear(f),te=new nn(0,0,O.rotation[2],"ZYX");for(const[re,ae]of B.entries()){const se=U.id+"-"+re,ne=ae[0].clone().applyEuler(te),fe=ae[1].clone().applyEuler(te),ge=ae[2].clone().applyEuler(te),de=new ie().subVectors(fe,ne),Z=new ie().subVectors(ge,ne),he=new ie().subVectors(ge,fe),xe=de.length(),He=new ie().crossVectors(Z,he).length()/xe,Se=Math.max(2,Math.round(xe/w)),ze=Math.max(2,Math.round(He/w)),Ie=Array(Se).fill(0).map(()=>Array(ze).fill(0));de.normalize(),Z.normalize(),he.normalize();const ye=new ie().crossVectors(Z,he).normalize(),ce=de.multiplyScalar(.5*xe/Se),pe=new ie().crossVectors(ye,de).normalize().multiplyScalar(.5*He/ze),ve=new ie(O.cx+ne.x,O.cy+ne.y,O.lz+ne.z+L0);ve.add(ce).add(pe),ce.multiplyScalar(2),pe.multiplyScalar(2);let Ae=0;const Te=new ie;for(let Ee=0;Ee<24;Ee++)for(let Be=0;Be0){Ae++;const Ke=Ri(We,q,p,yi.SPHERE_MODEL),Ne=ni(e.ground,Q,ye,Ke),De=ye.dot(We);for(let ke=0;ke0&&(Te.copy(ve).add(Ye).add(pe.clone().multiplyScalar(it)),P(se,Te,We)||(Ie[ke][it]+=De*Ke))}}}const Me=Ae*g/60,Pe=Me>It?d.sunshineHours[Q]/(30*Me*e.timesPerHour):0;F(Ie,Pe),i(se,Ie)}}},L=U=>{if(U.roofType!==Go.Hip)throw new Error("roof is not hip");const O=r(U);if(!O)throw new Error("foundation of wall not found");const B=s(U.id);if(!B||B.length===0)return;let _=!0;const X=B[0][0].z;for(const $ of B)for(const Q of $)if(Math.abs(Q.z-X)>.01){_=!1;break}if(_)k(U,O,B);else{const $=f.getFullYear(),Q=f.getMonth(),le=f.getDate(),q=me.dayOfYear(f),te=new nn(0,0,O.rotation[2],"ZYX");for(const[re,ae]of B.entries()){const se=U.id+"-"+re,ne=ae[0].clone().applyEuler(te),fe=ae[1].clone().applyEuler(te),ge=ae[2].clone().applyEuler(te),de=new ie().subVectors(fe,ne),Z=new ie().subVectors(ge,ne),he=new ie().subVectors(ge,fe),xe=de.length(),He=new ie().crossVectors(Z,he).length()/xe,Se=Math.max(2,Math.round(xe/w)),ze=Math.max(2,Math.round(He/w)),Ie=Array(Se).fill(0).map(()=>Array(ze).fill(0));de.normalize(),Z.normalize(),he.normalize();const ye=new ie().crossVectors(Z,he).normalize(),ce=de.multiplyScalar(.5*xe/Se),pe=new ie().crossVectors(ye,de).normalize().multiplyScalar(.5*He/ze);let ve=0;const Ae=new ie,Te=new ie(O.cx+ne.x,O.cy+ne.y,O.lz+ne.z+L0);if(Te.add(ce).add(pe),ce.multiplyScalar(2),pe.multiplyScalar(2),re%2===0)for(let Ee=0;Ee<24;Ee++)for(let Be=0;Be0){ve++;const Ke=Ri(We,q,p,yi.SPHERE_MODEL),Ne=ni(e.ground,Q,ye,Ke),De=ye.dot(We);for(let ke=0;ke0&&(Ae.copy(Te).add(Ye).add(pe.clone().multiplyScalar(it)),P(se,Ae,We)||(Ie[ke][it]+=De*Ke))}}}else for(let Ee=0;Ee<24;Ee++)for(let Be=0;Be0){ve++;const Ke=Ri(We,q,p,yi.SPHERE_MODEL),Ne=ni(e.ground,Q,ye,Ke),De=ye.dot(We);for(let ke=0;ke0&&(Ae.copy(Te).add(Ye).add(pe.clone().multiplyScalar(it)),P(se,Ae,We)||(Ie[ke][it]+=De*Ke))}}}const Me=ve*g/60,Pe=Me>It?d.sunshineHours[Q]/(30*Me*e.timesPerHour):0;F(Ie,Pe),i(se,Ie)}}},k=(U,O,B)=>{const _=f.getFullYear(),X=f.getMonth(),$=f.getDate(),Q=me.dayOfYear(f),le=new nn(0,0,O.rotation[2],"ZYX"),q=B[0][0].z;let te=Number.MAX_VALUE,re=Number.MAX_VALUE,ae=-Number.MAX_VALUE,se=-Number.MAX_VALUE;for(const Ie of B)for(const ye of Ie){const ce=ye.clone().applyEuler(le);ce.x>ae&&(ae=ce.x),ce.xse&&(se=ce.y),ce.yArray(fe).fill(0)),he=new ie(te+w/2,re+w/2,O.lz+q+L0);let xe=0;const He=new ie(0,0,he.z);for(let Ie=0;Ie<24;Ie++)for(let ye=0;ye0){xe++;const ve=Ri(pe,Q,p,yi.SPHERE_MODEL),Ae=ni(e.ground,X,Io,ve),Te=Io.dot(pe);for(let Me=0;Me0&&(He.y=he.y+Pe*de,P(U.id,He,pe)||(Z[Me][Pe]+=Te*ve))}}}const Se=xe*g/60,ze=Se>It?d.sunshineHours[X]/(30*Se*e.timesPerHour):0;F(Z,ze),i(U.id,Z)},N=U=>{if(U.roofType!==Go.Gable)throw new Error("roof is not gable");const O=r(U);if(!O)throw new Error("foundation of wall not found");const B=s(U.id);if(!B||B.length===0)return;const _=f.getFullYear(),X=f.getMonth(),$=f.getDate(),Q=me.dayOfYear(f),le=new nn(0,0,O.rotation[2],"ZYX");for(const[q,te]of B.entries()){const re=U.id+"-"+q,ae=te[0].clone().applyEuler(le),se=te[1].clone().applyEuler(le),ne=te[2].clone().applyEuler(le),fe=new ie().subVectors(se,ae),ge=new ie().subVectors(ne,ae),de=new ie().subVectors(ne,se),Z=fe.length(),he=new ie().crossVectors(ge,de).length()/Z,xe=Math.max(2,Math.round(Z/w)),He=Math.max(2,Math.round(he/w)),Se=Array(xe).fill(0).map(()=>Array(He).fill(0));fe.normalize(),ge.normalize(),de.normalize();const ze=new ie().crossVectors(ge,de).normalize(),Ie=fe.multiplyScalar(.5*Z/xe),ye=new ie().crossVectors(ze,fe).normalize().multiplyScalar(.5*he/He),ce=new ie(O.cx+ae.x,O.cy+ae.y,O.lz+ae.z+L0);ce.add(Ie).add(ye),Ie.multiplyScalar(2),ye.multiplyScalar(2);let pe=0;const ve=new ie;for(let Me=0;Me<24;Me++)for(let Pe=0;Pe0){pe++;const Je=Ri(Be,Q,p,yi.SPHERE_MODEL),We=ni(e.ground,X,ze,Je),Ke=ze.dot(Be);for(let Ne=0;Ne0&&(ve.copy(ce).add(De).add(ye.clone().multiplyScalar(ke)),P(re,ve,Be)||(Se[Ne][ke]+=Ke*Je))}}}const Ae=pe*g/60,Te=Ae>It?d.sunshineHours[X]/(30*Ae*e.timesPerHour):0;F(Se,Te),i(re,Se)}},F=(U,O)=>{for(let B=0;B{const e=H(fn),n=ht(xh),o=H.getState().world,r=H.getState().elements,i=H(qr),a=H(pA),l=Tn(Cge),s=Tn(OBe),c=ht(pW),u=ht(Mwt),d=H(yge),f=Tn(Hge),{scene:p}=oi(),g=Jt(),y=f1(t),w=new Date(o.date),b=t?y==null?void 0:y.elevation:0,C=60/o.timesPerHour,P=m.useMemo(()=>new l0,[]),v=o.solarRadiationHeatmapGridCellSize??.5,T=m.useRef([]),A=m.useRef([]),x=m.useRef(0),S=m.useRef(!1),R=m.useRef(new Date(o.date)),M=m.useRef(new Map),D=m.useRef(!1),E=m.useRef(new Date(o.date)),W=m.useMemo(()=>dl(w,o.latitude),[o.date,o.latitude]);m.useEffect(()=>{if(c)return j(),x.current=requestAnimationFrame(N),()=>{cancelAnimationFrame(x.current),S.current||(hn(Y.t("message.SimulationAborted",g)),e(Z=>{Z.world.date=R.current.toLocaleString("en-US")}),n("simulationInProgress",!1))}},[c]),m.useEffect(()=>{D.current=u,u?(E.current=new Date(w.getTime()),cancelAnimationFrame(x.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",g))):(n("simulationPaused",!1),N())},[u]);const j=()=>{n("simulationInProgress",!0),w.setHours(Math.floor(W.sunrise/60),W.sunrise%60),R.current=new Date(o.date),S.current=!1,U();for(const Z of r)switch(Z.type){case z.Wall:case z.Door:case z.SolarPanel:case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:{M.current.delete(Z.id);break}case z.Cuboid:{M.current.delete(Z.id+"-top"),M.current.delete(Z.id+"-north"),M.current.delete(Z.id+"-south"),M.current.delete(Z.id+"-west"),M.current.delete(Z.id+"-east");break}case z.Roof:{const he=Z,xe=f(he.id);if(xe){const He=xe.length;for(let Se=0;Se{s();const Z=W.daylight()/60,he=Z>It?y.sunshineHours[w.getMonth()]/(30*Z*o.timesPerHour):0;for(const xe of r){switch(xe.type){case z.Foundation:case z.Wall:case z.Door:case z.SolarPanel:case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:{const He=M.current.get(xe.id);if(He){for(let Se=0;Se[...Se]))}break}case z.Cuboid:{k(xe.id,"top",he),k(xe.id,"south",he),k(xe.id,"north",he),k(xe.id,"west",he),k(xe.id,"east",he);break}case z.Roof:{const He=xe,Se=f(He.id);if(Se&&Se.length>0){if(He.roofType===Go.Pyramid||He.roofType===Go.Mansard||He.roofType===Go.Gambrel||He.roofType===Go.Hip){let ze=!0;const Ie=Se[0][0].z;for(const ye of Se)for(const ce of ye)if(Math.abs(ce.z-Ie)>.01){ze=!1;break}if(ze){const ye=M.current.get(He.id);if(ye){for(let ce=0;ce[...ce]))}break}}for(let ze=0;ze[...ce]))}}}break}}if(xe.type===z.Foundation){const He=xe;if(He.solarStructure===Dn.UpdraftTower&&He.solarUpdraftTower){const Se=xe.id+"-sut",ze=M.current.get(Se);if(ze){for(let Ie=0;Ie[...Ie]))}}}}},k=(Z,he,xe)=>{const He=M.current.get(Z+"-"+he);if(He){for(let Se=0;Se{if(c&&!D.current){if(w.getMinutes()+w.getHours()*60>=W.sunset){cancelAnimationFrame(x.current),ht.getState().set(he=>{he.runDynamicSimulation=!1}),e(he=>{he.world.date=R.current.toLocaleString("en-US")}),hn(Y.t("message.SimulationCompleted",g)),S.current=!0,L(),setTimeout(()=>{n("simulationInProgress",!1),n("showSolarRadiationHeatmap",!0)},10);return}if(w.setHours(w.getHours(),w.getMinutes()+C),e(he=>{he.world.date=w.toLocaleString("en-US")}),d)for(const he of r)switch(he.type){case z.FresnelReflector:fe(he);break;case z.Heliostat:ge(he);break}else for(const he of r)switch(he.type){case z.Foundation:{const xe=he;B(xe),xe.solarStructure===Dn.UpdraftTower&&de(xe);break}case z.Cuboid:{O(he);break}case z.SolarPanel:{ae(he);break}case z.ParabolicTrough:{se(he);break}case z.ParabolicDish:{ne(he);break}case z.FresnelReflector:{fe(he);break}case z.Heliostat:{ge(he);break}case z.Wall:{_(he);break}case z.Door:{X(he);break}case z.Roof:{const xe=he;switch(xe.roofType){case Go.Pyramid:Q(xe);break;case Go.Gable:re(xe);break;case Go.Gambrel:q(xe);break;case Go.Mansard:le(xe);break;case Go.Hip:te(xe);break}break}}x.current=requestAnimationFrame(N)}},F=(Z,he,xe)=>{if(T.current.length>1){A.current.length=0,P.set(he,xe);const He=T.current.filter(Se=>Se.uuid!==Z);return P.intersectObjects(He,!1,A.current),A.current.length>0}return!1},U=()=>{const Z=p.children.filter(he=>he.name==="Content");if(Z.length>0){const he=Z[0].children;T.current.length=0;for(const xe of he)me.fetchSimulationElements(xe,T.current)}},O=Z=>{const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=me.dayOfYear(w),He=Z.lx,Se=Z.ly,ze=Z.lz,Ie=Math.max(2,Math.round(He/v)),ye=Math.max(2,Math.round(Se/v)),ce=Math.max(2,Math.round(ze/v)),pe=He/Ie,ve=Se/ye,Ae=ze/ce;let Te=M.current.get(Z.id+"-top");(!Te||Te.length!==Ie||Te[0].length!==ye)&&(Te=Array(Ie).fill(0).map(()=>Array(ye).fill(0)),M.current.set(Z.id+"-top",Te));let Me=M.current.get(Z.id+"-south");(!Me||Me.length!==Ie||Me[0].length!==ce)&&(Me=Array(Ie).fill(0).map(()=>Array(ce).fill(0)),M.current.set(Z.id+"-south",Me));let Pe=M.current.get(Z.id+"-north");(!Pe||Pe.length!==Ie||Pe[0].length!==ce)&&(Pe=Array(Ie).fill(0).map(()=>Array(ce).fill(0)),M.current.set(Z.id+"-north",Pe));let Ee=M.current.get(Z.id+"-west");(!Ee||Ee.length!==ye||Ee[0].length!==ce)&&(Ee=Array(ye).fill(0).map(()=>Array(ce).fill(0)),M.current.set(Z.id+"-west",Ee));let Be=M.current.get(Z.id+"-east");(!Be||Be.length!==ye||Be[0].length!==ce)&&(Be=Array(ye).fill(0).map(()=>Array(ce).fill(0)),M.current.set(Z.id+"-east",Be));const Je=Io,We=Vp.clone().applyAxisAngle(Io,Z.rotation[2]),Ke=Oc.clone().applyAxisAngle(Io,Z.rotation[2]),Ne=_p.clone().applyAxisAngle(Io,Z.rotation[2]),De=Op.clone().applyAxisAngle(Io,Z.rotation[2]),ke=i(Z);let Ye=Z.cx,it=Z.cy,Ve=Z.cz;if(ke&&ke.type===z.Cuboid){const Ut=me.getWorldDataById(Z.id);Ye=Ut.pos.x,it=Ut.pos.y,Ve=Ut.pos.z}const yt=new ie,ct=new Xt(Ye,it),Xe=new Xt,ut=it-Se/2,ft=it+Se/2,ot=Ye-He/2,st=Ye+He/2,at=Ri(he,xe,b,yi.SPHERE_MODEL);let Oe=ni(o.ground,w.getMonth(),Je,at),Ze=Je.dot(he),St=Ye-He/2,Pt=it-Se/2;const Rt=Ve+ze/2;for(let Ut=0;Ut0&&(Xe.set(St+(Ut+.5)*pe,Pt+(Ht+.5)*ve),Xe.rotateAround(ct,Z.rotation[2]),yt.set(Xe.x,Xe.y,Rt),F(Z.id,yt,he)||(Te[Ut][Ht]+=Ze*at));St=Ye-He/2,Pt=Ve-ze/2,Oe=ni(o.ground,w.getMonth(),We,at),Ze=We.dot(he);for(let Ut=0;Ut0&&(Xe.set(St+(Ut+.5)*pe,ut),Xe.rotateAround(ct,Z.rotation[2]),yt.set(Xe.x,Xe.y,Pt+(Ht+.5)*Ae),F(Z.id,yt,he)||(Me[Ut][Ht]+=Ze*at));Oe=ni(o.ground,w.getMonth(),Ke,at),Ze=Ke.dot(he);for(let Ut=0;Ut0&&(Xe.set(St+(Ut+.5)*pe,ft),Xe.rotateAround(ct,Z.rotation[2]),yt.set(Xe.x,Xe.y,Pt+(ce-(Ht+.5))*Ae),F(Z.id,yt,he)||(Pe[Ut][Ht]+=Ze*at));St=it-Se/2,Pt=Ve-ze/2,Oe=ni(o.ground,w.getMonth(),Ne,at),Ze=Ne.dot(he);for(let Ut=0;Ut0&&(Xe.set(ot,St+(Ut+.5)*ve),Xe.rotateAround(ct,Z.rotation[2]),yt.set(Xe.x,Xe.y,Pt+(Ht+.5)*Ae),F(Z.id,yt,he)||(Ee[Ut][Ht]+=Ze*at));Oe=ni(o.ground,w.getMonth(),De,at),Ze=De.dot(he);for(let Ut=0;Ut0&&(Xe.set(st,St+(Ut+.5)*ve),Xe.rotateAround(ct,Z.rotation[2]),yt.set(Xe.x,Xe.y,Pt+(Ht+.5)*Ae),F(Z.id,yt,he)||(Be[Ut][Ht]+=Ze*at))},B=Z=>{const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=me.dayOfYear(w),He=Z.lx,Se=Z.ly,ze=Z.lz,Ie=Math.max(2,Math.round(He/v)),ye=Math.max(2,Math.round(Se/v)),ce=He/Ie,pe=Se/ye,ve=Z.cx-He/2,Ae=Z.cy-Se/2,Te=new Xt(Z.cx,Z.cy),Me=new ie;let Pe=M.current.get(Z.id);(!Pe||Pe.length!==Ie||Pe[0].length!==ye)&&(Pe=Array(Ie).fill(0).map(()=>Array(ye).fill(0)),M.current.set(Z.id,Pe));const Ee=Ri(he,xe,b,yi.SPHERE_MODEL),Be=ni(o.ground,w.getMonth(),Io,Ee),Je=Io.dot(he),We=new Xt;for(let Ke=0;Ke0&&(We.set(ve+(Ke+.5)*ce,Ae+(Ne+.5)*pe),We.rotateAround(Te,Z.rotation[2]),Me.set(We.x,We.y,ze),F(Z.id,Me,he)||(Pe[Ke][Ne]+=Je*Ee))},_=Z=>{const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=a(Z);if(!xe)throw new Error("foundation of wall not found");const He=me.dayOfYear(w),Se=Z.lx,ze=me.getHighestPointOfWall(Z),Ie=Math.max(2,Math.round(Se/v)),ye=Math.max(2,Math.round(ze/v)),ce=Se/Ie,pe=ze/ye,ve=xe.rotation[2]+Z.relativeAngle,Ae=me.wallAbsolutePosition(new ie(Z.cx,Z.cy,Z.cz),xe).setZ(ze/2+xe.lz),Te=new ie(Math.cos(ve-Gt),Math.sin(ve-Gt),0),Me=ce*Math.cos(ve),Pe=ce*Math.sin(ve),Ee=new ie;let Be=M.current.get(Z.id);(!Be||Be.length!==Ie||Be[0].length!==ye)&&(Be=Array(Ie).fill(0).map(()=>Array(ye).fill(0)),M.current.set(Z.id,Be));const Je=me.getWallVertices(Z,1),We=(ze-Z.lz)/2,Ke=Ri(he,He,b,yi.SPHERE_MODEL),Ne=ni(o.ground,w.getMonth(),Te,Ke),De=Te.dot(he);for(let ke=0;ke0&&(Ee.set(Ae.x+it*Me,Ae.y+it*Pe,Ae.z+Ve*pe),F(Z.id,Ee,he)||(Be[ke][Ye]+=De*Ke)))}},X=Z=>{const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=a(Z);if(!xe)throw new Error("foundation of door not found");const He=i(Z);if(!He)throw new Error("parent of door not found");const Se=me.dayOfYear(w),ze=He,Ie=Z.lx*ze.lx,ye=Z.lz*ze.lz,ce=Math.max(2,Math.round(Ie/v)),pe=Math.max(2,Math.round(ye/v)),ve=Ie/ce,Ae=ye/pe,Te=xe.rotation[2]+ze.relativeAngle,Pe=me.wallAbsolutePosition(new ie(ze.cx,ze.cy,ze.cz),xe).setZ(ze.lz/2+xe.lz).clone().add(new ie(Z.cx*ze.lx,0,Z.cz*ze.lz)),Ee=new ie(Math.cos(Te-Gt),Math.sin(Te-Gt),0),Be=ve*Math.cos(Te),Je=ve*Math.sin(Te),We=new ie;let Ke=M.current.get(Z.id);(!Ke||Ke.length!==ce||Ke[0].length!==pe)&&(Ke=Array(ce).fill(0).map(()=>Array(pe).fill(0)),M.current.set(Z.id,Ke));const Ne=Ri(he,Se,b,yi.SPHERE_MODEL),De=ni(o.ground,w.getMonth(),Ee,Ne),ke=Ee.dot(he);if(Z.doorType===Pd.Arched)for(let Ye=0;Ye0&&(F(Z.id,We,he)||(Ke[Ye][it]+=ke*Ne)))}else for(let Ye=0;Ye0){const Ve=Ye-ce/2+.5,yt=it-pe/2+.5;We.set(Pe.x+Ve*Be,Pe.y+Ve*Je,Pe.z+yt*Ae),F(Z.id,We,he)||(Ke[Ye][it]+=ke*Ne)}},$=(Z,he,xe,He)=>{const Se=He[0][0].z,ze=me.dayOfYear(w),Ie=Ri(Z,ze,b,yi.SPHERE_MODEL),ye=new nn(0,0,xe.rotation[2],"ZYX");let ce=Number.MAX_VALUE,pe=Number.MAX_VALUE,ve=-Number.MAX_VALUE,Ae=-Number.MAX_VALUE;for(const De of He)for(const ke of De){const Ye=ke.clone().applyEuler(ye);Ye.x>ve&&(ve=Ye.x),Ye.xAe&&(Ae=Ye.y),Ye.yArray(Me).fill(0)),M.current.set(he.id,Be));const Je=new ie(ce+v/2,pe+v/2,xe.lz+Se+L0),We=new ie(0,0,Je.z),Ke=ni(o.ground,w.getMonth(),Io,Ie),Ne=Io.dot(Z);for(let De=0;De0&&(We.y=Je.y+ke*Ee,F(he.id,We,Z)||(Be[De][ke]+=Ne*Ie))}},Q=Z=>{if(Z.roofType!==Go.Pyramid)throw new Error("roof is not pyramid");const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=a(Z);if(!xe)throw new Error("foundation of wall not found");const He=f(Z.id);if(!He||He.length===0)return;let Se=!0;const ze=He[0][0].z;for(const Ie of He)for(const ye of Ie)if(Math.abs(ye.z-ze)>.01){Se=!1;break}if(Se)$(he,Z,xe,He);else{const Ie=me.dayOfYear(w),ye=new nn(0,0,xe.rotation[2],"ZYX"),ce=Ri(he,Ie,b,yi.SPHERE_MODEL);for(const[pe,ve]of He.entries()){const Ae=Z.id+"-"+pe,Te=ve[0].clone().applyEuler(ye),Me=ve[1].clone().applyEuler(ye),Pe=ve[2].clone().applyEuler(ye),Ee=new ie().subVectors(Me,Te),Be=new ie().subVectors(Pe,Te),Je=new ie().subVectors(Pe,Me),We=Ee.length(),Ke=new ie().crossVectors(Be,Je).length()/We,Ne=Math.max(2,Math.round(We/v)),De=Math.max(2,Math.round(Ke/v));let ke=M.current.get(Ae);(!ke||ke.length!==Ne||ke[0].length!==De)&&(ke=Array(Ne).fill(0).map(()=>Array(De).fill(0)),M.current.set(Ae,ke)),Ee.normalize(),Be.normalize(),Je.normalize();const Ye=new ie().crossVectors(Be,Je).normalize(),it=Ee.multiplyScalar(.5*We/Ne),Ve=new ie().crossVectors(Ye,Ee).normalize().multiplyScalar(.5*Ke/De),yt=new ie(xe.cx+Te.x,xe.cy+Te.y,xe.lz+Te.z+L0);yt.add(it).add(Ve),it.multiplyScalar(2),Ve.multiplyScalar(2);const ct=new ie,Xe=ni(o.ground,w.getMonth(),Ye,ce),ut=Ye.dot(he);for(let ft=0;ft0&&(ct.copy(yt).add(ot).add(Ve.clone().multiplyScalar(st)),F(Ae,ct,he)||(ke[ft][st]+=ut*ce))}}}},le=Z=>{if(Z.roofType!==Go.Mansard)throw new Error("roof is not mansard");const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=a(Z);if(!xe)throw new Error("foundation of wall not found");const He=f(Z.id);if(!He||He.length===0)return;let Se=!0;const ze=He[0][0].z;for(const Ie of He)for(const ye of Ie)if(Math.abs(ye.z-ze)>.01){Se=!1;break}if(Se)$(he,Z,xe,He);else{const Ie=me.dayOfYear(w),ye=new nn(0,0,xe.rotation[2],"ZYX"),ce=Ri(he,Ie,b,yi.SPHERE_MODEL);for(const[pe,ve]of He.entries()){const Ae=Z.id+"-"+pe;if(pe===He.length-1){let Te=Number.MAX_VALUE,Me=Number.MAX_VALUE,Pe=-Number.MAX_VALUE,Ee=-Number.MAX_VALUE;for(const yt of ve){const ct=yt.clone().applyEuler(ye);ct.x>Pe&&(Pe=ct.x),ct.xEe&&(Ee=ct.y),ct.yArray(We).fill(0)),M.current.set(Ae,De));const ke=new ie(Te+v/2,Me+v/2,xe.lz+Be+L0),Ye=new ie(0,0,ke.z),it=ni(o.ground,w.getMonth(),Io,ce),Ve=Io.dot(he);for(let yt=0;yt0&&(Ye.y=ke.y+ct*Ne,F(Ae,Ye,he)||(De[yt][ct]+=Ve*ce))}}else{const Te=ve[0].clone().applyEuler(ye),Me=ve[1].clone().applyEuler(ye),Pe=ve[2].clone().applyEuler(ye),Ee=new ie().subVectors(Me,Te),Be=new ie().subVectors(Pe,Te),Je=new ie().subVectors(Pe,Me),We=Ee.length(),Ke=new ie().crossVectors(Be,Je).length()/We,Ne=Math.max(2,Math.round(We/v)),De=Math.max(2,Math.round(Ke/v));let ke=M.current.get(Ae);(!ke||ke.length!==Ne||ke[0].length!==De)&&(ke=Array(Ne).fill(0).map(()=>Array(De).fill(0)),M.current.set(Ae,ke)),Ee.normalize(),Be.normalize(),Je.normalize();const Ye=new ie().crossVectors(Be,Je).normalize(),it=Ee.multiplyScalar(.5*We/Ne),Ve=new ie().crossVectors(Ye,Ee).normalize().multiplyScalar(.5*Ke/De),yt=new ie(xe.cx+Te.x,xe.cy+Te.y,xe.lz+Te.z+L0);yt.add(it).add(Ve),it.multiplyScalar(2),Ve.multiplyScalar(2);const ct=new ie,Xe=ni(o.ground,w.getMonth(),Ye,ce),ut=Ye.dot(he);for(let ft=0;ft0&&(ct.copy(yt).add(ot).add(Ve.clone().multiplyScalar(st)),F(Ae,ct,he)||(ke[ft][st]+=ut*ce))}}}}},q=Z=>{if(Z.roofType!==Go.Gambrel)throw new Error("roof is not gambrel");const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=a(Z);if(!xe)throw new Error("foundation of wall not found");const He=f(Z.id);if(!He||He.length===0)return;let Se=!0;const ze=He[0][0].z;for(const Ie of He)for(const ye of Ie)if(Math.abs(ye.z-ze)>.01){Se=!1;break}if(Se)$(he,Z,xe,He);else{const Ie=me.dayOfYear(w),ye=new nn(0,0,xe.rotation[2],"ZYX"),ce=Ri(he,Ie,b,yi.SPHERE_MODEL);for(const[pe,ve]of He.entries()){const Ae=Z.id+"-"+pe,Te=ve[0].clone().applyEuler(ye),Me=ve[1].clone().applyEuler(ye),Pe=ve[2].clone().applyEuler(ye),Ee=new ie().subVectors(Me,Te),Be=new ie().subVectors(Pe,Te),Je=new ie().subVectors(Pe,Me),We=Ee.length(),Ke=new ie().crossVectors(Be,Je).length()/We,Ne=Math.max(2,Math.round(We/v)),De=Math.max(2,Math.round(Ke/v));let ke=M.current.get(Ae);(!ke||ke.length!==Ne||ke[0].length!==De)&&(ke=Array(Ne).fill(0).map(()=>Array(De).fill(0)),M.current.set(Ae,ke)),Ee.normalize(),Be.normalize(),Je.normalize();const Ye=new ie().crossVectors(Be,Je).normalize(),it=Ee.multiplyScalar(.5*We/Ne),Ve=new ie().crossVectors(Ye,Ee).normalize().multiplyScalar(.5*Ke/De),yt=new ie(xe.cx+Te.x,xe.cy+Te.y,xe.lz+Te.z+L0);yt.add(it).add(Ve),it.multiplyScalar(2),Ve.multiplyScalar(2);const ct=new ie,Xe=ni(o.ground,w.getMonth(),Ye,ce),ut=Ye.dot(he);for(let ft=0;ft0&&(ct.copy(yt).add(ot).add(Ve.clone().multiplyScalar(st)),F(Ae,ct,he)||(ke[ft][st]+=ut*ce))}}}},te=Z=>{if(Z.roofType!==Go.Hip)throw new Error("roof is not hip");const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=a(Z);if(!xe)throw new Error("foundation of wall not found");const He=f(Z.id);if(!He||He.length===0)return;let Se=!0;const ze=He[0][0].z;for(const Ie of He)for(const ye of Ie)if(Math.abs(ye.z-ze)>.01){Se=!1;break}if(Se)$(he,Z,xe,He);else{const Ie=me.dayOfYear(w),ye=new nn(0,0,xe.rotation[2],"ZYX"),ce=Ri(he,Ie,b,yi.SPHERE_MODEL);for(const[pe,ve]of He.entries()){const Ae=Z.id+"-"+pe,Te=ve[0].clone().applyEuler(ye),Me=ve[1].clone().applyEuler(ye),Pe=ve[2].clone().applyEuler(ye),Ee=new ie().subVectors(Me,Te),Be=new ie().subVectors(Pe,Te),Je=new ie().subVectors(Pe,Me),We=Ee.length(),Ke=new ie().crossVectors(Be,Je).length()/We,Ne=Math.max(2,Math.round(We/v)),De=Math.max(2,Math.round(Ke/v));let ke=M.current.get(Ae);(!ke||ke.length!==Ne||ke[0].length!==De)&&(ke=Array(Ne).fill(0).map(()=>Array(De).fill(0)),M.current.set(Ae,ke)),Ee.normalize(),Be.normalize(),Je.normalize();const Ye=new ie().crossVectors(Be,Je).normalize(),it=Ee.multiplyScalar(.5*We/Ne),Ve=new ie().crossVectors(Ye,Ee).normalize().multiplyScalar(.5*Ke/De),yt=new ie,ct=new ie(xe.cx+Te.x,xe.cy+Te.y,xe.lz+Te.z+L0);ct.add(it).add(Ve),it.multiplyScalar(2),Ve.multiplyScalar(2);const Xe=ni(o.ground,w.getMonth(),Ye,ce),ut=Ye.dot(he);for(let ft=0;ft0&&(yt.copy(ct).add(ot).add(Ve.clone().multiplyScalar(st)),F(Ae,yt,he)||(ke[ft][st]+=ut*ce))}}}},re=Z=>{if(Z.roofType!==Go.Gable)throw new Error("roof is not gable");const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=a(Z);if(!xe)throw new Error("foundation of wall not found");const He=f(Z.id);if(!He||He.length===0)return;const Se=me.dayOfYear(w),ze=new nn(0,0,xe.rotation[2],"ZYX"),Ie=Ri(he,Se,b,yi.SPHERE_MODEL);for(const[ye,ce]of He.entries()){const pe=Z.id+"-"+ye,ve=ce[0].clone().applyEuler(ze),Ae=ce[1].clone().applyEuler(ze),Te=ce[2].clone().applyEuler(ze),Me=new ie().subVectors(Ae,ve),Pe=new ie().subVectors(Te,ve),Ee=new ie().subVectors(Te,Ae),Be=Me.length(),Je=new ie().crossVectors(Pe,Ee).length()/Be,We=Math.max(2,Math.round(Be/v)),Ke=Math.max(2,Math.round(Je/v));let Ne=M.current.get(pe);(!Ne||Ne.length!==We||Ne[0].length!==Ke)&&(Ne=Array(We).fill(0).map(()=>Array(Ke).fill(0)),M.current.set(pe,Ne)),Me.normalize(),Pe.normalize(),Ee.normalize();const De=new ie().crossVectors(Pe,Ee).normalize(),ke=Me.multiplyScalar(.5*Be/We),Ye=new ie().crossVectors(De,Me).normalize().multiplyScalar(.5*Je/Ke),it=new ie(xe.cx+ve.x,xe.cy+ve.y,xe.lz+ve.z+L0);it.add(ke).add(Ye),ke.multiplyScalar(2),Ye.multiplyScalar(2);const Ve=new ie,yt=ni(o.ground,w.getMonth(),De,Ie),ct=De.dot(he);for(let Xe=0;Xe0&&(Ve.copy(it).add(ut).add(Ye.clone().multiplyScalar(ft)),F(pe,Ve,he)||(Ne[Xe][ft]+=ct*Ie))}}},ae=Z=>{const he=Ei(w,o.latitude);if(he.z<=0)return;let xe=i(Z);if(!xe)throw new Error("parent of solar panel does not exist");const He=Z.parentType===z.Roof,Se=Z.parentType===z.Wall;if(He&&(xe=a(xe),!xe))throw new Error("foundation of solar panel does not exist");const ze=me.dayOfYear(w),Ie=Se?me.absoluteCoordinates(Z.cx,Z.cy,Z.cz,xe,a(Z),Z.lz):me.absoluteCoordinates(Z.cx,Z.cy,Z.cz,xe,void 0,void 0,!0),ye=xe.rotation[2];let ce=ye+(Se?0:Z.relativeAzimuth),pe=Z.tiltAngle,ve=!0;if(He&&(Ie.z=Z.cz+Z.lz+.02+xe.cz,me.isZero(Z.rotation[0])?Ie.z+=Z.poleHeight:(pe=Z.rotation[0],ce=ye,ve=!1)),Se&&!me.isZero(Z.tiltAngle)){const ft=xe,ot=a(xe),at=(ot?ot.rotation[2]+ft.relativeAngle:ft.relativeAngle)-Gt,Oe=Z.ly*Math.abs(Math.sin(Z.tiltAngle))/2;Ie.x+=Oe*Math.cos(at),Ie.y+=Oe*Math.sin(at)}const Ae=new ie().fromArray(Z.normal),Te=Z.lx,Me=Z.ly,Pe=Math.max(2,Math.round(Z.lx/v)),Ee=Math.max(2,Math.round(Z.ly/v)),Be=Te/Pe,Je=Me/Ee,We=Ie.x-(Te-v)/2,Ke=Ie.y-(Me-v)/2,Ne=He||Se?Ie.z:xe.lz+Z.poleHeight+Z.lz,De=new Xt(Ie.x,Ie.y),ke=new ie;let Ye=M.current.get(Z.id);(!Ye||Ye.length!==Pe||Ye[0].length!==Ee)&&(Ye=Array(Pe).fill(0).map(()=>Array(Ee).fill(0)),M.current.set(Z.id,Ye));let it=new nn(He&&!ve?0:pe,0,ce,"ZYX");if(Z.trackerType!==za.NO_TRACKER){const ft=ye?he.clone().applyAxisAngle(Io,-ye):he.clone();switch(Z.trackerType){case za.ALTAZIMUTH_DUAL_AXIS_TRACKER:{const ot=new bs().setFromUnitVectors(Io,ft);it=new nn().setFromQuaternion(ot),it.z+=ce;break}case za.HORIZONTAL_SINGLE_AXIS_TRACKER:{const ot=new bs().setFromUnitVectors(Io,new ie(ft.x,0,ft.z).normalize());it=new nn().setFromQuaternion(ot),it.z+=ce;break}case za.VERTICAL_SINGLE_AXIS_TRACKER:{if(Math.abs(Z.tiltAngle)>.001){const ot=new ie(ft.x,-ft.y,0).normalize(),st=Math.acos(Oc.dot(ot))*Math.sign(ot.x);it=new nn(Z.tiltAngle,0,st+ye,"ZYX")}break}case za.TILTED_SINGLE_AXIS_TRACKER:break}}if(Se&&Ae.applyEuler(new nn(0,0,xe.relativeAngle)),Ae.applyEuler(it),He&&!ve&&(it.x=Z.rotation[0],it.z=Z.rotation[2]+ye),Se){const ft=i(Z);ft&&(it.x=Gt+Z.tiltAngle,it.z=xe.relativeAngle+ft.rotation[2])}const Ve=Ri(he,ze,b,yi.SPHERE_MODEL),yt=ni(o.ground,w.getMonth(),Ae,Ve),ct=Ae.dot(he),Xe=new Xt,ut=new ie;for(let ft=0;ft0&&(Xe.set(We+ft*Be,Ke+ot*Je),ut.set(Xe.x-De.x,Xe.y-De.y,0),ut.applyEuler(it),ke.set(Ie.x+ut.x,Ie.y+ut.y,Ne+ut.z),F(Z.id,ke,he)||(Ye[ft][ot]+=ct*Ve))},se=Z=>{const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=i(Z);if(!xe)throw new Error("parent of parabolic trough does not exist");const He=me.dayOfYear(w),Se=me.absoluteCoordinates(Z.cx,Z.cy,Z.cz,xe),ze=new ie().fromArray(Z.normal),Ie=ze.clone(),ye=Z.lx,ce=Z.ly,pe=ye*ye/(4*Z.latusRectum),ve=Z.poleHeight+ye/2,Ae=Math.max(2,Math.round(Z.lx/v)),Te=Math.max(2,Math.round(Z.ly/v)),Me=ye/Ae,Pe=ce/Te,Ee=Se.x-(ye-v)/2,Be=Se.y-(ce-v)/2,Je=xe.lz+ve+Z.lz+pe,We=new Xt(Se.x,Se.y),Ke=new ie;let Ne=M.current.get(Z.id);(!Ne||Ne.length!==Ae||Ne[0].length!==Te)&&(Ne=Array(Ae).fill(0).map(()=>Array(Te).fill(0)),M.current.set(Z.id,Ne));const De=xe.rotation[2],ke=De+Z.relativeAzimuth,Ye=me.isZero(ke),it=Ye?1:Math.cos(ke),Ve=Ye?0:Math.sin(ke),yt=De?he.clone().applyAxisAngle(Io,-De):he.clone(),ct=new bs().setFromUnitVectors(Io,new ie(yt.x*it,yt.x*Ve,yt.z).normalize()),Xe=new nn().setFromQuaternion(ct);ze.copy(Ie.clone().applyEuler(Xe));const ut=Ri(he,He,b,yi.SPHERE_MODEL),ft=ni(o.ground,w.getMonth(),ze,ut),ot=ze.dot(he),st=new Xt,at=new ie;let Oe=0,Ze=0,St=1;const Pt=4/(Z.latusRectum*Z.latusRectum);for(let Rt=0;Rt0&&(st.set(Oe,Be+Ut*Pe),Ye||st.rotateAround(We,ke),at.set(st.x-We.x,st.y-We.y,0),at.applyEuler(Xe),Ke.set(Se.x+at.x,Se.y+at.y,Je+at.z),F(Z.id,Ke,he)||(Ne[Rt][Ut]+=ot*ut*St))}},ne=Z=>{const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=i(Z);if(!xe)throw new Error("parent of parabolic dish does not exist");const He=me.dayOfYear(w),Se=me.absoluteCoordinates(Z.cx,Z.cy,Z.cz,xe),ze=new ie().fromArray(Z.normal),Ie=ze.clone(),ye=Z.lx,ce=Z.ly,pe=ye*ye/(4*Z.latusRectum),ve=Z.poleHeight+ye/2,Ae=Math.max(2,Math.round(Z.lx/v)),Te=Math.max(2,Math.round(Z.ly/v)),Me=ye/Ae,Pe=ce/Te,Ee=Se.x-(ye-v)/2,Be=Se.y-(ce-v)/2,Je=xe.lz+ve+Z.lz+pe,We=new Xt(Se.x,Se.y),Ke=new ie;let Ne=M.current.get(Z.id);(!Ne||Ne.length!==Ae||Ne[0].length!==Te)&&(Ne=Array(Ae).fill(0).map(()=>Array(Te).fill(0)),M.current.set(Z.id,Ne));const De=xe.rotation[2],ke=De+Z.relativeAzimuth,Ye=me.isZero(ke),it=De?he.clone().applyAxisAngle(Io,-De):he.clone(),Ve=new bs().setFromUnitVectors(Io,it),yt=new nn().setFromQuaternion(Ve);ze.copy(Ie.clone().applyEuler(yt));const ct=Ri(he,He,b,yi.SPHERE_MODEL),Xe=ni(o.ground,w.getMonth(),ze,ct),ut=ze.dot(he),ft=new Xt,ot=new ie;let st=0,at=0,Oe=0,Ze=0,St=1;const Pt=4/(Z.latusRectum*Z.latusRectum);for(let Rt=0;Rtye/2))for(let Ut=0;Utce/2)&&(Ne[Rt][Ut]+=Xe,ut>0&&(ft.set(st,at),Ye||ft.rotateAround(We,ke),ot.set(ft.x-We.x,ft.y-We.y,0),ot.applyEuler(yt),Ke.set(Se.x+ot.x,Se.y+ot.y,Je+ot.z),F(Z.id,Ke,he)||(St=1/Math.sqrt(1+(Oe*Oe+Ze*Ze)*Pt),Ne[Rt][Ut]+=ut*ct*St)))},fe=Z=>{const he=Ei(w,o.latitude);if(he.zArray(Me).fill(0)),M.current.set(Z.id,De));const Ye=xe.rotation[2]+Z.relativeAzimuth,it=me.isZero(Ye),Ve=it?1:Math.cos(Ye),yt=it?0:Math.sin(Ye),ct=He.solarStructure===Dn.FocusPipe?new ie((He.cx-Ie.x)*Ve,(He.cy-Ie.y)*yt,He.cz-Ie.z+He.lz/2+(Se.absorberHeight??10)):void 0,Xe=new ie(yt,Ve,0),ut=new ie;let ft,ot;if(ct){ut.set(ct.x,ct.y,ct.z);const Rt=-ct.z*(he.y*Xe.y+he.x*Xe.x)/he.z;ut.x+=Rt*Xe.x,ut.y-=Rt*Xe.y,ot=ut.clone().normalize();let Ut=ot.add(he).normalize();me.isSame(Ut,Io)&&(Ut=new ie(-.001,0,1).normalize()),it||Ut.applyAxisAngle(Io,-Ye),ft=new nn(0,Math.atan2(Ut.x,Ut.z),Ye,"ZXY"),ye.copy(ce.clone().applyEuler(ft))}else ot=new ie(0,0,1),ft=new nn;const st=Ri(he,ze,b,yi.SPHERE_MODEL),at=ni(o.ground,w.getMonth(),ye,st),Oe=ye.dot(he),Ze=new Xt,St=new ie;let Pt=0;if(d)for(let Rt=0;Rt0&&(Ze.set(Pt,Je+Ut*Ee),St.set(Ze.x-Ke.x,Ze.y-Ke.y,0),St.applyEuler(ft),Ne.set(Ie.x+St.x,Ie.y+St.y,We+St.z),!F(Z.id,Ne,he)&&!F(Z.id,Ne,ot)&&(De[Rt][Ut]+=Oe*st))}else for(let Rt=0;Rt0&&(Ze.set(Pt,Je+Ut*Ee),St.set(Ze.x-Ke.x,Ze.y-Ke.y,0),St.applyEuler(ft),Ne.set(Ie.x+St.x,Ie.y+St.y,We+St.z),F(Z.id,Ne,he)||(De[Rt][Ut]+=Oe*st))}},ge=Z=>{const he=Ei(w,o.latitude);if(he.zArray(Me).fill(0)),M.current.set(Z.id,De));const ke=xe.rotation[2],Ye=He.solarStructure===Dn.FocusTower?new ie(He.cx-Ie.x,He.cy-Ie.y,He.cz-Ie.z+(Se.towerHeight??20)):void 0;let it,Ve;if(Ye){it=Ye.clone().normalize();let st=it.clone().add(he).normalize();me.isSame(st,Io)&&(st=new ie(-.001,0,1).normalize()),ke&&st.applyAxisAngle(Io,-ke);const at=Math.hypot(st.x,st.y);Ve=new nn(Math.atan2(at,st.z),0,Math.atan2(st.y,st.x)+Gt,"ZXY"),ye.copy(ce.clone().applyEuler(Ve))}else it=new ie(0,0,1),Ve=new nn;const yt=Ri(he,ze,b,yi.SPHERE_MODEL),ct=ni(o.ground,w.getMonth(),ye,yt),Xe=ye.dot(he),ut=new Xt,ft=new ie;let ot=0;if(d)for(let st=0;st0&&(ut.set(ot,Je+at*Ee),ft.set(ut.x-Ke.x,ut.y-Ke.y,0),ft.applyEuler(Ve),Ne.set(Ie.x+ft.x,Ie.y+ft.y,We+ft.z),!F(Z.id,Ne,he)&&!F(Z.id,Ne,it)&&(De[st][at]+=Xe*yt))}else for(let st=0;st0&&(ut.set(ot,Je+at*Ee),ft.set(ut.x-Ke.x,ut.y-Ke.y,0),ft.applyEuler(Ve),Ne.set(Ie.x+ft.x,Ie.y+ft.y,We+ft.z),F(Z.id,Ne,he)||(De[st][at]+=Xe*yt))}},de=Z=>{const he=Z.solarUpdraftTower;if(!he)return;const xe=Ei(w,o.latitude);if(xe.z<=0)return;const He=me.dayOfYear(w),Se=new ie().fromArray(Z.normal),ze=he.collectorRadius,Ie=Math.max(2,Math.round(ze*2/v)),ye=Z.cx-ze+v/2,ce=Z.cy-ze+v/2,pe=Z.lz+he.collectorHeight,ve=Z.id+"-sut";let Ae=M.current.get(ve);(!Ae||Ae.length!==Ie||Ae[0].length!==Ie)&&(Ae=Array(Ie).fill(0).map(()=>Array(Ie).fill(0)),M.current.set(ve,Ae));const Te=Ri(xe,He,b,yi.SPHERE_MODEL),Me=ni(o.ground,w.getMonth(),Se,Te),Pe=new ie(0,0,pe),Ee=Se.dot(xe),Be=ze*ze;let Je,We;for(let Ke=0;KeBe)&&(Ae[Ke][Ne]+=Me,Ee>0&&(F(ve,Pe,xe)||(Ae[Ke][Ne]+=Ee*Te)))}};return h.jsx(h.Fragment,{})}),ejo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(ma),r=H.getState().world,i=H.getState().elements,a=H(qr),l=Tn(ivt),s=H(yW),c=Tn(lvt),u=H(AW),d=H(ZYe),f=H(eOe),p=Tn(svt),g=ht(evt),y=ht(tvt),w=ht(nvt),b=ht(ovt),C=H(FBe),{scene:P}=oi(),v=Jt(),T=f1(t),A=new Date(r.date),x=t?T==null?void 0:T.elevation:0,S=r.cspTimesPerHour??4,R=60/S,M=r.cspDaysPerYear??6,D=12/M,E=m.useMemo(()=>new l0,[]),W=r.monthlyIrradianceLosses??new Array(12).fill(.05),j=r.cspGridCellSize??.5,L=m.useRef([]),k=m.useRef([]),N=m.useRef(0),F=m.useRef(!1),U=m.useRef(new Date(r.date)),O=m.useRef(new Map),B=m.useRef(new Map),_=m.useRef(0),X=m.useRef(!1),$=m.useRef(new Date(r.date)),Q=m.useMemo(()=>dl(A,r.latitude),[r.date,r.latitude]),le=m.useRef(Q),q=me.daysInYear(A)/12;m.useEffect(()=>{if(g)return te(),N.current=requestAnimationFrame(re),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[g]),m.useEffect(()=>{X.current=w,w?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),re())},[w]);const te=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),A.setHours(Math.floor(Q.sunrise/60),R/2-30)),F.current=!1,ze(),Ie()},re=()=>{if(g&&!X.current){if(A.getMinutes()+A.getHours()*60>=Q.sunset){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showDailyParabolicTroughYieldPanel=!0,pe.selectedFloatingWindow="dailyParabolicTroughYieldPanel"}),ht.getState().set(pe=>{pe.runDailySimulationForParabolicTroughs=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,ae(),o&&e(pe=>{const ve=Tn.getState().sumDailyParabolicTroughYield();pe.actionInfo={name:"Daily Simulation for Parabolic Troughs Completed",result:{totalYield:ve},details:Tn.getState().dailyParabolicTroughYield,timestamp:new Date().getTime()}});return}A.setHours(A.getHours(),A.getMinutes()+R),e(pe=>{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.ParabolicTrough&&Z(pe);N.current=requestAnimationFrame(re)}},ae=()=>{const ce=he();for(const pe of i)if(pe.type===z.ParabolicTrough){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=He(ve)*ce;for(let Me=0;Me{var ce;if(d){const pe=new Array(24).fill(0),ve=new Map;let Ae=0;const Te=[];for(const Pe of i)if(Pe.type===z.ParabolicTrough){const Ee=O.current.get(Pe.id);if(Ee){s(Pe.id,Ee.reduce((Be,Je)=>Be+Je,0)),Ae++,ve.set("Trough"+Ae,Ee),Te.push(Pe.label??"Trough"+Ae);for(let Be=0;Be<24;Be++)pe[Be]+=Ee[Be]}}const Me=[];for(let Pe=0;Pe<24;Pe++){const Ee={};Ee.Hour=Pe;for(let Be=1;Be<=Ae;Be++){const Je="Trough"+Be;Ee[Te[Be-1]]=(ce=ve.get(Je))==null?void 0:ce[Pe]}Me.push(Ee)}l(Me),p(Te)}else{const pe=new Array(24).fill(0);for(const Ae of i)if(Ae.type===z.ParabolicTrough){const Te=O.current.get(Ae.id);if(Te){s(Ae.id,Te.reduce((Me,Pe)=>Me+Pe,0));for(let Me=0;Me<24;Me++)pe[Me]+=Te[Me]}}const ve=[];for(let Ae=0;Ae<24;Ae++)ve.push({Hour:Ae,Total:pe[Ae]});l(ve)}};m.useEffect(()=>{if(y)return ne(),N.current=requestAnimationFrame(fe),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[y]),m.useEffect(()=>{X.current=b,b?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),fe())},[b]);const ne=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),_.current=0,A.setMonth(0,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),e(ce=>{ce.world.date=A.toLocaleString("en-US")})),F.current=!1,ze(),Ie(),ye()},fe=()=>{if(y&&!X.current)if(A.getMinutes()+A.getHours()*60{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.ParabolicTrough&&Z(pe);N.current=requestAnimationFrame(fe)}else{if(ge(),_.current++,_.current===M){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showYearlyParabolicTroughYieldPanel=!0,pe.selectedFloatingWindow="yearlyParabolicTroughYieldPanel"}),ht.getState().set(pe=>{pe.runYearlySimulationForParabolicTroughs=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,de(),o&&e(pe=>{const ve=Tn.getState().sumYearlyParabolicTroughYield();pe.actionInfo={name:"Yearly Simulation for Parabolic Troughs Completed",result:{totalYield:ve},details:Tn.getState().yearlyParabolicTroughYield,timestamp:new Date().getTime()}});return}A.setMonth(_.current*D,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),Ie(),N.current=requestAnimationFrame(fe)}},ge=()=>{const ce=xe();for(const pe of i)if(pe.type===z.ParabolicTrough){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=B.current.get(ve.id);if(Te){const Me=Ae.reduce((Pe,Ee)=>Pe+Ee,0);Te[_.current]+=Me*ce*He(ve)}}}C&&ae()},de=()=>{if(f){const ce=[],pe=[];let ve=0;for(const Te of i)if(Te.type===z.ParabolicTrough){const Me=B.current.get(Te.id);Me&&(u(Te.id,Me.reduce((Pe,Ee)=>Pe+Ee,0)*D*q),ce.push(Me),ve++,pe.push(Te.label??"Trough"+ve))}const Ae=[];for(let Te=0;Te<12;Te+=D){const Me={};Me.Month=Ms[Te];for(const[Pe,Ee]of ce.entries())Me[pe[Pe]]=Ee[Te/D]*q;Ae.push(Me)}c(Ae),p(pe)}else{const ce=[];for(const ve of i)if(ve.type===z.ParabolicTrough){const Ae=B.current.get(ve.id);Ae&&(u(ve.id,Ae.reduce((Te,Me)=>Te+Me,0)*D*q),ce.push(Ae))}const pe=[];for(let ve=0;ve<12;ve+=D){let Ae=0;for(const Te of ce)Ae+=Te[ve/D];pe.push({Month:Ms[ve],Total:Ae*q})}c(pe)}},Z=ce=>{const pe=Ei(A,r.latitude);if(pe.z0&&(Rt.set(Ve+kt*De,yt+gt*ke),Be||Rt.rotateAround(Xe,Ee),Ut.set(Rt.x-Xe.x,Rt.y-Xe.y,0),Ut.applyEuler(Ze),ut.set(Te.x+Ut.x,Te.y+Ut.y,ct+Ut.z),Se(ce.id,ut,pe)||(Ht+=Pt*St));const At=O.current.get(ce.id);if(At){const kt=A.getMinutes()>=30?A.getHours()+1===24?0:A.getHours()+1:A.getHours();At[kt]+=Ht/(Ke*Ne)}},he=()=>{const ce=Q.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},xe=()=>{const ce=le.current.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},He=ce=>ce.lx*ce.ly*ce.opticalEfficiency*ce.thermalEfficiency*ce.absorptance*ce.reflectance*(1-W[A.getMonth()]),Se=(ce,pe,ve)=>{if(L.current.length>1){k.current.length=0,E.set(pe,ve);const Ae=L.current.filter(Te=>Te.uuid!==ce);return E.intersectObjects(Ae,!1,k.current),k.current.length>0}return!1},ze=()=>{const ce=P.children.filter(pe=>pe.name==="Content");if(ce.length>0){const pe=ce[0].children;L.current.length=0;for(const ve of pe)me.fetchSimulationElements(ve,L.current)}},Ie=()=>{for(const ce of i)if(ce.type===z.ParabolicTrough){const pe=O.current.get(ce.id);pe?pe.fill(0):O.current.set(ce.id,new Array(24).fill(0))}},ye=()=>{for(const ce of i)if(ce.type===z.ParabolicTrough){const pe=B.current.get(ce.id);pe&&pe.length===M?pe.fill(0):B.current.set(ce.id,new Array(M).fill(0))}};return h.jsx(h.Fragment,{})}),tjo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(ma),r=H.getState().world,i=H.getState().elements,a=H(qr),l=Tn(Ovt),s=H(yW),c=Tn(Vvt),u=H(AW),d=H(dOe),f=H(fOe),p=Tn(Gvt),g=ht(Nvt),y=ht(Uvt),w=ht(jvt),b=ht(Bvt),C=H(kBe),{scene:P}=oi(),v=Jt(),T=f1(t),A=new Date(r.date),x=t?T==null?void 0:T.elevation:0,S=r.cspTimesPerHour??4,R=60/S,M=r.cspDaysPerYear??6,D=12/M,E=m.useMemo(()=>new l0,[]),W=r.monthlyIrradianceLosses??new Array(12).fill(.05),j=r.cspGridCellSize??.5,L=m.useRef([]),k=m.useRef([]),N=m.useRef(0),F=m.useRef(!1),U=m.useRef(new Date(r.date)),O=m.useRef(new Map),B=m.useRef(new Map),_=m.useRef(0),X=m.useRef(!1),$=m.useRef(new Date(r.date)),Q=m.useMemo(()=>dl(A,r.latitude),[r.date,r.latitude]),le=m.useRef(Q),q=me.daysInYear(A)/12;m.useEffect(()=>{if(g)return te(),N.current=requestAnimationFrame(re),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[g]),m.useEffect(()=>{X.current=w,w?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),re())},[w]);const te=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),A.setHours(Math.floor(Q.sunrise/60),R/2-30)),F.current=!1,ze(),Ie()},re=()=>{if(g&&!X.current){if(A.getMinutes()+A.getHours()*60>=Q.sunset){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showDailyParabolicDishYieldPanel=!0,pe.selectedFloatingWindow="dailyParabolicDishYieldPanel"}),ht.getState().set(pe=>{pe.runDailySimulationForParabolicDishes=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,ae(),o&&e(pe=>{const ve=Tn.getState().sumDailyParabolicDishYield();pe.actionInfo={name:"Daily Simulation for Parabolic Dishes Completed",result:{totalYield:ve},details:Tn.getState().dailyParabolicDishYield,timestamp:new Date().getTime()}});return}A.setHours(A.getHours(),A.getMinutes()+R),e(pe=>{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.ParabolicDish&&Z(pe);N.current=requestAnimationFrame(re)}},ae=()=>{const ce=he();for(const pe of i)if(pe.type===z.ParabolicDish){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=He(ve)*ce;for(let Me=0;Me{var ce;if(d){const pe=new Array(24).fill(0),ve=new Map;let Ae=0;const Te=[];for(const Pe of i)if(Pe.type===z.ParabolicDish){const Ee=O.current.get(Pe.id);if(Ee){s(Pe.id,Ee.reduce((Be,Je)=>Be+Je,0)),Ae++,ve.set("Dish"+Ae,Ee),Te.push(Pe.label??"Dish"+Ae);for(let Be=0;Be<24;Be++)pe[Be]+=Ee[Be]}}const Me=[];for(let Pe=0;Pe<24;Pe++){const Ee={};Ee.Hour=Pe;for(let Be=1;Be<=Ae;Be++){const Je="Dish"+Be;Ee[Te[Be-1]]=(ce=ve.get(Je))==null?void 0:ce[Pe]}Me.push(Ee)}l(Me),p(Te)}else{const pe=new Array(24).fill(0);for(const Ae of i)if(Ae.type===z.ParabolicDish){const Te=O.current.get(Ae.id);if(Te){s(Ae.id,Te.reduce((Me,Pe)=>Me+Pe,0));for(let Me=0;Me<24;Me++)pe[Me]+=Te[Me]}}const ve=[];for(let Ae=0;Ae<24;Ae++)ve.push({Hour:Ae,Total:pe[Ae]});l(ve)}};m.useEffect(()=>{if(y)return ne(),N.current=requestAnimationFrame(fe),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[y]),m.useEffect(()=>{X.current=b,b?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),fe())},[b]);const ne=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),_.current=0,A.setMonth(0,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),e(ce=>{ce.world.date=A.toLocaleString("en-US")})),F.current=!1,ze(),Ie(),ye()},fe=()=>{if(y&&!X.current)if(A.getMinutes()+A.getHours()*60{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.ParabolicDish&&Z(pe);N.current=requestAnimationFrame(fe)}else{if(ge(),_.current++,_.current===M){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showYearlyParabolicDishYieldPanel=!0,pe.selectedFloatingWindow="yearlyParabolicDishYieldPanel"}),ht.getState().set(pe=>{pe.runYearlySimulationForParabolicDishes=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,de(),o&&e(pe=>{const ve=Tn.getState().sumYearlyParabolicDishYield();pe.actionInfo={name:"Yearly Simulation for Parabolic Dishes Completed",result:{totalYield:ve},details:Tn.getState().yearlyParabolicDishYield,timestamp:new Date().getTime()}});return}A.setMonth(_.current*D,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),Ie(),N.current=requestAnimationFrame(fe)}},ge=()=>{const ce=xe();for(const pe of i)if(pe.type===z.ParabolicDish){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=B.current.get(ve.id);if(Te){const Me=Ae.reduce((Pe,Ee)=>Pe+Ee,0);Te[_.current]+=Me*ce*He(ve)}}}C&&ae()},de=()=>{if(f){const ce=[],pe=[];let ve=0;for(const Te of i)if(Te.type===z.ParabolicDish){const Me=B.current.get(Te.id);Me&&(u(Te.id,Me.reduce((Pe,Ee)=>Pe+Ee,0)*D*q),ce.push(Me),ve++,pe.push(Te.label??"Dish"+ve))}const Ae=[];for(let Te=0;Te<12;Te+=D){const Me={};Me.Month=Ms[Te];for(const[Pe,Ee]of ce.entries())Me[pe[Pe]]=Ee[Te/D]*q;Ae.push(Me)}c(Ae),p(pe)}else{const ce=[];for(const ve of i)if(ve.type===z.ParabolicDish){const Ae=B.current.get(ve.id);Ae&&(u(ve.id,Ae.reduce((Te,Me)=>Te+Me,0)*D*q),ce.push(Ae))}const pe=[];for(let ve=0;ve<12;ve+=D){let Ae=0;for(const Te of ce)Ae+=Te[ve/D];pe.push({Month:Ms[ve],Total:Ae*q})}c(pe)}},Z=ce=>{const pe=Ei(A,r.latitude);if(pe.z0&&(St.set(Ye+Ht*Ke,it+At*Ne),ft||St.rotateAround(yt,ut),Pt.set(St.x-yt.x,St.y-yt.y,0),Pt.applyEuler(at),ct.set(Te.x+Pt.x,Te.y+Pt.y,Ve+Pt.z),Se(ce.id,ct,pe)||(Rt+=Ze*Oe));const Ut=O.current.get(ce.id);if(Ut){const Ht=A.getMinutes()>=30?A.getHours()+1===24?0:A.getHours()+1:A.getHours();Ut[Ht]+=Rt/(Je*We)}},he=()=>{const ce=Q.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},xe=()=>{const ce=le.current.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},He=ce=>ce.lx*ce.ly*ce.opticalEfficiency*ce.thermalEfficiency*ce.absorptance*ce.reflectance*(1-W[A.getMonth()]),Se=(ce,pe,ve)=>{if(L.current.length>1){k.current.length=0,E.set(pe,ve);const Ae=L.current.filter(Te=>Te.uuid!==ce);return E.intersectObjects(Ae,!1,k.current),k.current.length>0}return!1},ze=()=>{const ce=P.children.filter(pe=>pe.name==="Content");if(ce.length>0){const pe=ce[0].children;L.current.length=0;for(const ve of pe)me.fetchSimulationElements(ve,L.current)}},Ie=()=>{for(const ce of i)if(ce.type===z.ParabolicDish){const pe=O.current.get(ce.id);pe?pe.fill(0):O.current.set(ce.id,new Array(24).fill(0))}},ye=()=>{for(const ce of i)if(ce.type===z.ParabolicDish){const pe=B.current.get(ce.id);pe&&pe.length===M?pe.fill(0):B.current.set(ce.id,new Array(M).fill(0))}};return h.jsx(h.Fragment,{})}),njo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(ma),r=H.getState().world,i=H.getState().elements,a=H(qr),l=Tn(pvt),s=H(yW),c=H(nOe),u=Tn(mvt),d=H(AW),f=H(oOe),p=Tn(yvt),g=ht(cvt),y=ht(uvt),w=ht(dvt),b=ht(fvt),C=H(LBe),{scene:P}=oi(),v=Jt(),T=f1(t),A=new Date(r.date),x=t?T==null?void 0:T.elevation:0,S=r.cspTimesPerHour??4,R=60/S,M=r.cspDaysPerYear??6,D=12/M,E=m.useMemo(()=>new l0,[]),W=r.monthlyIrradianceLosses??new Array(12).fill(.05),j=r.cspGridCellSize??.5,L=m.useRef([]),k=m.useRef([]),N=m.useRef(0),F=m.useRef(!1),U=m.useRef(new Date(r.date)),O=m.useRef(new Map),B=m.useRef(new Map),_=m.useRef(0),X=m.useRef(!1),$=m.useRef(new Date(r.date)),Q=m.useMemo(()=>dl(A,r.latitude),[r.date,r.latitude]),le=m.useRef(Q),q=me.daysInYear(A)/12;m.useEffect(()=>{if(g)return te(),N.current=requestAnimationFrame(re),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[g]),m.useEffect(()=>{X.current=w,w?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),re())},[w]);const te=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),A.setHours(Math.floor(Q.sunrise/60),R/2-30)),F.current=!1,ze(),Ie()},re=()=>{if(g&&!X.current){if(A.getMinutes()+A.getHours()*60>=Q.sunset){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showDailyFresnelReflectorYieldPanel=!0,pe.selectedFloatingWindow="dailyFresnelReflectorYieldPanel"}),ht.getState().set(pe=>{pe.runDailySimulationForFresnelReflectors=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,ae(),o&&e(pe=>{const ve=Tn.getState().sumDailyFresnelReflectorYield();pe.actionInfo={name:"Daily Simulation for Fresnel Reflectors Completed",result:{totalYield:ve},details:Tn.getState().dailyFresnelReflectorYield,timestamp:new Date().getTime()}});return}A.setHours(A.getHours(),A.getMinutes()+R),e(pe=>{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.FresnelReflector&&Z(pe);N.current=requestAnimationFrame(re)}},ae=()=>{const ce=he();for(const pe of i)if(pe.type===z.FresnelReflector){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=He(ve)*ce;for(let Me=0;Me{var ce;if(c){const pe=new Array(24).fill(0),ve=new Map;let Ae=0;const Te=[];for(const Pe of i)if(Pe.type===z.FresnelReflector){const Ee=O.current.get(Pe.id);if(Ee){s(Pe.id,Ee.reduce((Be,Je)=>Be+Je,0)),Ae++,ve.set("Reflector"+Ae,Ee),Te.push(Pe.label??"Reflector"+Ae);for(let Be=0;Be<24;Be++)pe[Be]+=Ee[Be]}}const Me=[];for(let Pe=0;Pe<24;Pe++){const Ee={};Ee.Hour=Pe;for(let Be=1;Be<=Ae;Be++){const Je="Reflector"+Be;Ee[Te[Be-1]]=(ce=ve.get(Je))==null?void 0:ce[Pe]}Me.push(Ee)}l(Me),p(Te)}else{const pe=new Array(24).fill(0);for(const Ae of i)if(Ae.type===z.FresnelReflector){const Te=O.current.get(Ae.id);if(Te){s(Ae.id,Te.reduce((Me,Pe)=>Me+Pe,0));for(let Me=0;Me<24;Me++)pe[Me]+=Te[Me]}}const ve=[];for(let Ae=0;Ae<24;Ae++)ve.push({Hour:Ae,Total:pe[Ae]});l(ve)}};m.useEffect(()=>{if(y)return ne(),N.current=requestAnimationFrame(fe),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[y]),m.useEffect(()=>{X.current=b,b?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),fe())},[b]);const ne=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),_.current=0,A.setMonth(0,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),e(ce=>{ce.world.date=A.toLocaleString("en-US")})),F.current=!1,ze(),Ie(),ye()},fe=()=>{if(y&&!X.current)if(A.getMinutes()+A.getHours()*60{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.FresnelReflector&&Z(pe);N.current=requestAnimationFrame(fe)}else{if(ge(),_.current++,_.current===M){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showYearlyFresnelReflectorYieldPanel=!0,pe.selectedFloatingWindow="yearlyFresnelReflectorYieldPanel"}),ht.getState().set(pe=>{pe.runYearlySimulationForFresnelReflectors=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,de(),o&&e(pe=>{const ve=Tn.getState().sumYearlyFresnelReflectorYield();pe.actionInfo={name:"Yearly Simulation for Fresnel Reflectors Completed",result:{totalYield:ve},details:Tn.getState().yearlyFresnelReflectorYield,timestamp:new Date().getTime()}});return}A.setMonth(_.current*D,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),Ie(),N.current=requestAnimationFrame(fe)}},ge=()=>{const ce=xe();for(const pe of i)if(pe.type===z.FresnelReflector){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=B.current.get(ve.id);if(Te){const Me=Ae.reduce((Pe,Ee)=>Pe+Ee,0);Te[_.current]+=Me*ce*He(ve)}}}C&&ae()},de=()=>{if(f){const ce=[],pe=[];let ve=0;for(const Te of i)if(Te.type===z.FresnelReflector){const Me=B.current.get(Te.id);Me&&(d(Te.id,Me.reduce((Pe,Ee)=>Pe+Ee,0)*D*q),ce.push(Me),ve++,pe.push(Te.label??"Reflector"+ve))}const Ae=[];for(let Te=0;Te<12;Te+=D){const Me={};Me.Month=Ms[Te];for(const[Pe,Ee]of ce.entries())Me[pe[Pe]]=Ee[Te/D]*q;Ae.push(Me)}u(Ae),p(pe)}else{const ce=[];for(const ve of i)if(ve.type===z.FresnelReflector){const Ae=B.current.get(ve.id);Ae&&(d(ve.id,Ae.reduce((Te,Me)=>Te+Me,0)*D*q),ce.push(Ae))}const pe=[];for(let ve=0;ve<12;ve+=D){let Ae=0;for(const Te of ce)Ae+=Te[ve/D];pe.push({Month:Ms[ve],Total:Ae*q})}u(pe)}},Z=ce=>{const pe=Ei(A,r.latitude);if(pe.z0&&(At.set(dt,Ve+Fe*Ye),kt.set(At.x-ct.x,At.y-ct.y,0),kt.applyEuler(Pt),Xe.set(Pe.x+kt.x,Pe.y+kt.y,yt+kt.z),!Se(ce.id,Xe,pe)&&!Se(ce.id,Xe,Rt)&&(gt+=Ht*Ut))}const Ct=O.current.get(ce.id);if(Ct){const tt=A.getMinutes()>=30?A.getHours()+1===24?0:A.getHours()+1:A.getHours();Ct[tt]+=gt/(Ne*De)}},he=()=>{const ce=Q.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},xe=()=>{const ce=le.current.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},He=ce=>{const pe=a(ce);if(!pe)throw new Error("parent of Fresnel reflector does not exist");let ve=1;if(pe.type===z.Foundation){const Te=pe.solarAbsorberPipe;ve*=((Te==null?void 0:Te.absorberOpticalEfficiency)??.7)*((Te==null?void 0:Te.absorberThermalEfficiency)??.3)*((Te==null?void 0:Te.absorberAbsorptance)??.95)}return ce.lx*ce.ly*ce.reflectance*ve*(1-W[A.getMonth()])},Se=(ce,pe,ve)=>{if(L.current.length>1){k.current.length=0,E.set(pe,ve);const Ae=L.current.filter(Te=>Te.uuid!==ce);return E.intersectObjects(Ae,!1,k.current),k.current.length>0}return!1},ze=()=>{const ce=P.children.filter(pe=>pe.name==="Content");if(ce.length>0){const pe=ce[0].children;L.current.length=0;for(const ve of pe)me.fetchSimulationElements(ve,L.current)}},Ie=()=>{for(const ce of i)if(ce.type===z.FresnelReflector){const pe=O.current.get(ce.id);pe?pe.fill(0):O.current.set(ce.id,new Array(24).fill(0))}},ye=()=>{for(const ce of i)if(ce.type===z.FresnelReflector){const pe=B.current.get(ce.id);pe&&pe.length===M?pe.fill(0):B.current.set(ce.id,new Array(M).fill(0))}};return h.jsx(h.Fragment,{})}),ojo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(ma),r=H.getState().world,i=H.getState().elements,a=H(qr),l=Tn(Svt),s=H(yW),c=H(iOe),u=Tn(Pvt),d=H(AW),f=H(aOe),p=Tn(Cvt),g=ht(Avt),y=ht(wvt),w=ht(vvt),b=ht(xvt),C=H(WBe),{scene:P}=oi(),v=Jt(),T=f1(t),A=new Date(r.date),x=t?T==null?void 0:T.elevation:0,S=r.cspTimesPerHour??4,R=60/S,M=r.cspDaysPerYear??6,D=12/M,E=m.useMemo(()=>new l0,[]),W=r.monthlyIrradianceLosses??new Array(12).fill(.05),j=r.cspGridCellSize??.5,L=m.useRef([]),k=m.useRef([]),N=m.useRef(0),F=m.useRef(!1),U=m.useRef(new Date(r.date)),O=m.useRef(new Map),B=m.useRef(new Map),_=m.useRef(0),X=m.useRef(!1),$=m.useRef(new Date(r.date)),Q=m.useMemo(()=>dl(A,r.latitude),[r.date,r.latitude]),le=m.useRef(Q),q=me.daysInYear(A)/12;m.useEffect(()=>{if(g)return te(),N.current=requestAnimationFrame(re),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[g]),m.useEffect(()=>{X.current=w,w?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),re())},[w]);const te=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),A.setHours(Math.floor(Q.sunrise/60),R/2-30)),F.current=!1,ze(),Ie()},re=()=>{if(g&&!X.current){if(A.getMinutes()+A.getHours()*60>=Q.sunset){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showDailyHeliostatYieldPanel=!0,pe.selectedFloatingWindow="dailyHeliostatYieldPanel"}),ht.getState().set(pe=>{pe.runDailySimulationForHeliostats=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,ae(),o&&e(pe=>{const ve=Tn.getState().sumDailyHeliostatYield();pe.actionInfo={name:"Daily Simulation for Heliostats Completed",result:{totalYield:ve},details:Tn.getState().dailyHeliostatYield,timestamp:new Date().getTime()}});return}A.setHours(A.getHours(),A.getMinutes()+R),e(pe=>{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.Heliostat&&Z(pe);N.current=requestAnimationFrame(re)}},ae=()=>{const ce=he();for(const pe of i)if(pe.type===z.Heliostat){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=He(ve)*ce;for(let Me=0;Me{var ce;if(c){const pe=new Array(24).fill(0),ve=new Map;let Ae=0;const Te=[];for(const Pe of i)if(Pe.type===z.Heliostat){const Ee=O.current.get(Pe.id);if(Ee){s(Pe.id,Ee.reduce((Be,Je)=>Be+Je,0)),Ae++,ve.set("Heliostat"+Ae,Ee),Te.push(Pe.label??"Heliostat"+Ae);for(let Be=0;Be<24;Be++)pe[Be]+=Ee[Be]}}const Me=[];for(let Pe=0;Pe<24;Pe++){const Ee={};Ee.Hour=Pe;for(let Be=1;Be<=Ae;Be++){const Je="Heliostat"+Be;Ee[Te[Be-1]]=(ce=ve.get(Je))==null?void 0:ce[Pe]}Me.push(Ee)}l(Me),p(Te)}else{const pe=new Array(24).fill(0);for(const Ae of i)if(Ae.type===z.Heliostat){const Te=O.current.get(Ae.id);if(Te){s(Ae.id,Te.reduce((Me,Pe)=>Me+Pe,0));for(let Me=0;Me<24;Me++)pe[Me]+=Te[Me]}}const ve=[];for(let Ae=0;Ae<24;Ae++)ve.push({Hour:Ae,Total:pe[Ae]});l(ve)}};m.useEffect(()=>{if(y)return ne(),N.current=requestAnimationFrame(fe),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[y]),m.useEffect(()=>{X.current=b,b?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),fe())},[b]);const ne=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),_.current=0,A.setMonth(0,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),e(ce=>{ce.world.date=A.toLocaleString("en-US")})),F.current=!1,ze(),Ie(),ye()},fe=()=>{if(y&&!X.current)if(A.getMinutes()+A.getHours()*60{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.Heliostat&&Z(pe);N.current=requestAnimationFrame(fe)}else{if(ge(),_.current++,_.current===M){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showYearlyHeliostatYieldPanel=!0,pe.selectedFloatingWindow="yearlyHeliostatYieldPanel"}),ht.getState().set(pe=>{pe.runYearlySimulationForHeliostats=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,de(),o&&e(pe=>{const ve=Tn.getState().sumYearlyHeliostatYield();pe.actionInfo={name:"Yearly Simulation for Heliostats Completed",result:{totalYield:ve},details:Tn.getState().yearlyHeliostatYield,timestamp:new Date().getTime()}});return}A.setMonth(_.current*D,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),Ie(),N.current=requestAnimationFrame(fe)}},ge=()=>{const ce=xe();for(const pe of i)if(pe.type===z.Heliostat){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=B.current.get(ve.id);if(Te){const Me=Ae.reduce((Pe,Ee)=>Pe+Ee,0);Te[_.current]+=Me*ce*He(ve)}}}C&&ae()},de=()=>{if(f){const ce=[],pe=[];let ve=0;for(const Te of i)if(Te.type===z.Heliostat){const Me=B.current.get(Te.id);Me&&(d(Te.id,Me.reduce((Pe,Ee)=>Pe+Ee,0)*D*q),ce.push(Me),ve++,pe.push(Te.label??"Heliostat"+ve))}const Ae=[];for(let Te=0;Te<12;Te+=D){const Me={};Me.Month=Ms[Te];for(const[Pe,Ee]of ce.entries())Me[pe[Pe]]=Ee[Te/D]*q;Ae.push(Me)}u(Ae),p(pe)}else{const ce=[];for(const ve of i)if(ve.type===z.Heliostat){const Ae=B.current.get(ve.id);Ae&&(d(ve.id,Ae.reduce((Te,Me)=>Te+Me,0)*D*q),ce.push(Ae))}const pe=[];for(let ve=0;ve<12;ve+=D){let Ae=0;for(const Te of ce)Ae+=Te[ve/D];pe.push({Month:Ms[ve],Total:Ae*q})}u(pe)}},Z=ce=>{const pe=Ei(A,r.latitude);if(pe.z0&&(Ze.set(Rt,Ve+At*Ye),St.set(Ze.x-ct.x,Ze.y-ct.y,0),St.applyEuler(st),Xe.set(Pe.x+St.x,Pe.y+St.y,yt+St.z),!Se(ce.id,Xe,pe)&&!Se(ce.id,Xe,ot)&&(Pt+=Oe*at))}const Ut=O.current.get(ce.id);if(Ut){const Ht=A.getMinutes()>=30?A.getHours()+1===24?0:A.getHours()+1:A.getHours();Ut[Ht]+=Pt/(Ne*De)}},he=()=>{const ce=Q.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},xe=()=>{const ce=le.current.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},He=ce=>{const pe=a(ce);if(!pe)throw new Error("parent of heliostat does not exist");let ve=1;if(pe.type===z.Foundation){const Te=pe.solarPowerTower;ve*=((Te==null?void 0:Te.receiverOpticalEfficiency)??.7)*((Te==null?void 0:Te.receiverThermalEfficiency)??.3)*((Te==null?void 0:Te.receiverAbsorptance)??.95)}return ce.lx*ce.ly*ce.reflectance*ve*(1-W[A.getMonth()])},Se=(ce,pe,ve)=>{if(L.current.length>1){k.current.length=0,E.set(pe,ve);const Ae=L.current.filter(Te=>Te.uuid!==ce);return E.intersectObjects(Ae,!1,k.current),k.current.length>0}return!1},ze=()=>{const ce=P.children.filter(pe=>pe.name==="Content");if(ce.length>0){const pe=ce[0].children;L.current.length=0;for(const ve of pe)me.fetchSimulationElements(ve,L.current)}},Ie=()=>{for(const ce of i)if(ce.type===z.Heliostat){const pe=O.current.get(ce.id);pe?pe.fill(0):O.current.set(ce.id,new Array(24).fill(0))}},ye=()=>{for(const ce of i)if(ce.type===z.Heliostat){const pe=B.current.get(ce.id);pe&&pe.length===M?pe.fill(0):B.current.set(ce.id,new Array(M).fill(0))}};return h.jsx(h.Fragment,{})}),rjo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(ma),r=H.getState().world,i=H.getState().elements,a=Tn(Wvt),l=Tn(Dvt),s=Tn(Evt),c=Tn(Lvt),u=ht(sOe),d=ht(Rvt),f=ht(cOe),p=ht(Hvt),g=H(NBe),y=H(YBe),w=H(cW)??900,b=r.sutGridCellSize??1,{scene:C}=oi(),P=Jt(),v=f1(t),T=new Date(r.date),A=v?v.elevation:0,x=r.sutTimesPerHour??4,S=60/x,R=r.sutDaysPerYear??6,M=12/R,D=m.useMemo(()=>new l0,[]),E=m.useRef([]),W=m.useRef([]),j=m.useRef(0),L=m.useRef(!1),k=m.useRef(new Date(r.date)),N=m.useRef(new Array(24).fill(0)),F=m.useRef(new Map),U=m.useRef(new Map),O=m.useRef(new Map),B=m.useRef(new Map),_=m.useRef(0),X=m.useRef(!1),$=m.useRef(new Date(r.date)),Q=m.useRef(0),le=m.useMemo(()=>dl(T,r.latitude),[r.date,r.latitude]),q=m.useRef(le),te=me.daysInYear(T)/12;m.useEffect(()=>{if(u)if(y&&!me.hasMovingParts(i))re();else return ae(),j.current=requestAnimationFrame(se),()=>{cancelAnimationFrame(j.current),L.current||(hn(Y.t("message.SimulationAborted",P)),e(Ae=>{Ae.world.date=k.current.toLocaleString("en-US")}),ht.getState().set(Ae=>{Ae.simulationInProgress=!1,Ae.simulationPaused=!1})),X.current=!1}},[u]),m.useEffect(()=>{X.current=d,d?($.current=new Date(T.getTime()),cancelAnimationFrame(j.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",P))):(n("simulationPaused",!1),se())},[d]);const re=()=>{pe(),He();for(const Ae of i)if(Ae.type===z.Foundation){const Te=Ae;Te.solarStructure===Dn.UpdraftTower&&Te.solarUpdraftTower&&Ie(Te)}e(Ae=>{Ae.viewState.showDailyUpdraftTowerYieldPanel=!0,Ae.selectedFloatingWindow="dailySolarUpdraftTowerYieldPanel"}),ht.getState().set(Ae=>{Ae.runDailySimulationForUpdraftTower=!1,Ae.simulationInProgress=!1,Ae.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",P)),L.current=!0,ne(),o&&e(Ae=>{const Te=Tn.getState().sumDailyUpdraftTowerYield();Ae.actionInfo={name:"Static Daily Simulation for Updraft Tower Completed",result:{totalYield:Te},details:Tn.getState().dailyUpdraftTowerYield,timestamp:new Date().getTime()}})},ae=()=>{X.current?(T.setTime($.current.getTime()),X.current=!1):(k.current=new Date(r.date),Q.current=T.getDay(),T.setHours(Math.floor(le.sunrise/60),-S/2)),L.current=!1,pe(),He()},se=()=>{if(u&&!X.current){if(T.getMinutes()+T.getHours()*60+(T.getDay()-Q.current)*T2+S>=le.sunset){cancelAnimationFrame(j.current),e(Te=>{Te.world.date=k.current.toLocaleString("en-US"),Te.viewState.showDailyUpdraftTowerYieldPanel=!0,Te.selectedFloatingWindow="dailySolarUpdraftTowerYieldPanel"}),ht.getState().set(Te=>{Te.runDailySimulationForUpdraftTower=!1,Te.simulationInProgress=!1,Te.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",P)),L.current=!0,ne(),o&&e(Te=>{const Me=Tn.getState().sumDailyUpdraftTowerYield();Te.actionInfo={name:"Dynamic Daily Simulation for Updraft Tower Completed",result:{totalYield:Me},details:Tn.getState().dailyUpdraftTowerYield,timestamp:new Date().getTime()}});return}T.setHours(T.getHours(),T.getMinutes()+S),e(Te=>{Te.world.date=T.toLocaleString("en-US")});for(const Te of i)if(Te.type===z.Foundation){const Me=Te;Me.solarStructure===Dn.UpdraftTower&&Me.solarUpdraftTower&&ze(Me)}j.current=requestAnimationFrame(se)}},ne=()=>{const Ae=ye();for(const Te of i)if(Te.type===z.Foundation){const Me=Te;if(Me.solarStructure===Dn.UpdraftTower&&Me.solarUpdraftTower){const Pe=Me.solarUpdraftTower.collectorTransmissivity??.9,Ee=Me.solarUpdraftTower.turbineEfficiency??.3,Be=Me.solarUpdraftTower.dischargeCoefficient??.65,Je=Math.PI*Me.solarUpdraftTower.chimneyRadius*Me.solarUpdraftTower.chimneyRadius,We=Math.PI*Me.solarUpdraftTower.collectorRadius*Me.solarUpdraftTower.collectorRadius,Ke=fO*CSe*Je,Ne=2*PSe*Me.solarUpdraftTower.chimneyHeight,De=F.current.get(Te.id+"-sut"),ke=U.current.get(Te.id+"-sut"),Ye=O.current.get(Te.id+"-sut");if(Ye&&De&&ke){const it=.5*Be*Ee*fO*Je,Ve=new Date(r.date);let yt;v&&(yt=Qx(Ve,v.lowestTemperatures,v.highestTemperatures));for(let ct=0;ct0&&ct>0&&De[ct-1]>Xe){const at=(De[ct-1]+Xe)/2,Oe=(r.airConvectiveCoefficient??5)*We*(at-Xe),Ze=at+C4,St=Ze*Ze*Ze*Ze,Pt=ut*ut*ut*ut,Rt=(Me.solarUpdraftTower.collectorEmissivity??.95)*RSe*We*(St-Pt);Ye[ct]-=Oe+Rt,Ye[ct]<0&&(Ye[ct]=0)}const ft=Ye[ct]/(Ke*ut),ot=ut*(1+Math.cbrt(ft*ft/Ne))-C4,st=ot>Xe?Math.sqrt(Ne*((ot+C4)/ut-1)):0;Ye[ct]=it*st*st*st*.001,De[ct]=ot,ke[ct]=st}}}}fe()},fe=()=>{var Be,Je,We;const Ae=new Map;let Te=0;const Me=[];for(const Ke of i)if(Ke.type===z.Foundation){const Ne=Ke;if(Ne.solarStructure===Dn.UpdraftTower&&Ne.solarUpdraftTower){Te++;const De=F.current.get(Ke.id+"-sut");De&&Ae.set("Temperature Tower"+Te,De);const ke=U.current.get(Ke.id+"-sut");ke&&Ae.set("Wind Speed Tower"+Te,ke);const Ye=O.current.get(Ke.id+"-sut");Ye&&(Ae.set("Tower"+Te,Ye),Me.push(Ke.label?Ke.label:"Tower"+Te))}}const Pe=[];for(let Ke=0;Ke<24;Ke++){const Ne={};Ne.Hour=Ke;for(let De=1;De<=Te;De++){const ke="Tower"+De;Ne[Me[De-1]]=(Be=Ae.get(ke))==null?void 0:Be[Ke]}Pe.push(Ne)}s(Pe);const Ee=[];for(let Ke=0;Ke<24;Ke++){const Ne={};Ne.Hour=Ke,Ne.T_Ambient=N.current[Ke];for(let De=1;De<=Te;De++){let ke="Temperature Tower"+De;Ne["T_"+Me[De-1]]=(Je=Ae.get(ke))==null?void 0:Je[Ke],ke="Wind Speed Tower"+De,Ne["V_"+Me[De-1]]=(We=Ae.get(ke))==null?void 0:We[Ke]}Ee.push(Ne)}l(Ee),a(Me)};m.useEffect(()=>{if(f)if(y&&!me.hasMovingParts(i))de();else return ge(),j.current=requestAnimationFrame(Z),()=>{cancelAnimationFrame(j.current),L.current||(hn(Y.t("message.SimulationAborted",P)),e(Ae=>{Ae.world.date=k.current.toLocaleString("en-US")}),ht.getState().set(Ae=>{Ae.simulationInProgress=!1,Ae.simulationPaused=!1})),X.current=!1}},[f]),m.useEffect(()=>{X.current=p,p?($.current=new Date(T.getTime()),cancelAnimationFrame(j.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",P))):(n("simulationPaused",!1),Z())},[p]);const ge=()=>{X.current?(T.setTime($.current.getTime()),X.current=!1):(k.current=new Date(r.date),_.current=0,T.setMonth(0,22),Q.current=T.getDay(),q.current=dl(T,r.latitude),T.setHours(Math.floor(q.current.sunrise/60),-S/2),e(Ae=>{Ae.world.date=T.toLocaleString("en-US")})),L.current=!1,pe(),He(),Se()},de=()=>{pe(),He(),Se(),k.current=new Date(r.date),_.current=0;for(let Ae=0;Ae<12;Ae+=M){T.setMonth(Ae,22),q.current=dl(T,r.latitude),He();for(const Te of i)if(Te.type===z.Foundation){const Me=Te;Me.solarStructure===Dn.UpdraftTower&&Me.solarUpdraftTower&&Ie(Me)}he(),_.current++}e(Ae=>{Ae.world.date=k.current.toLocaleString("en-US"),Ae.viewState.showYearlyUpdraftTowerYieldPanel=!0,Ae.selectedFloatingWindow="yearlySolarUpdraftTowerYieldPanel"}),ht.getState().set(Ae=>{Ae.runYearlySimulationForUpdraftTower=!1,Ae.simulationInProgress=!1,Ae.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",P)),L.current=!0,xe(),o&&e(Ae=>{const Te=Tn.getState().sumYearlyUpdraftTowerYield();Ae.actionInfo={name:"Static Yearly Simulation for Updraft Tower Completed",result:{totalYield:Te},details:Tn.getState().yearlyUpdraftTowerYield,timestamp:new Date().getTime()}})},Z=()=>{if(f&&!X.current)if(T.getMinutes()+T.getHours()*60+(T.getDay()-Q.current)*T2+S{Te.world.date=T.toLocaleString("en-US")});for(const Te of i)if(Te.type===z.Foundation){const Me=Te;Me.solarStructure===Dn.UpdraftTower&&Me.solarUpdraftTower&&ze(Me)}j.current=requestAnimationFrame(Z)}else{if(he(),_.current++,_.current===R){cancelAnimationFrame(j.current),e(Te=>{Te.world.date=k.current.toLocaleString("en-US"),Te.viewState.showYearlyUpdraftTowerYieldPanel=!0,Te.selectedFloatingWindow="yearlySolarUpdraftTowerYieldPanel"}),ht.getState().set(Te=>{Te.runYearlySimulationForUpdraftTower=!1,Te.simulationInProgress=!1,Te.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",P)),L.current=!0,xe(),o&&e(Te=>{const Me=Tn.getState().sumYearlyUpdraftTowerYield();Te.actionInfo={name:"Dynamic Yearly Simulation for Updraft Tower Completed",result:{totalYield:Me},details:Tn.getState().yearlyUpdraftTowerYield,timestamp:new Date().getTime()}});return}T.setMonth(_.current*M,22),Q.current=T.getDay(),q.current=dl(T,r.latitude),T.setHours(Math.floor(q.current.sunrise/60),-S/2),He(),j.current=requestAnimationFrame(Z)}},he=()=>{const Ae=ce();for(const Te of i)if(Te.type===z.Foundation){const Me=Te;if(Me.solarStructure===Dn.UpdraftTower&&Me.solarUpdraftTower){const Pe=O.current.get(Me.id+"-sut"),Ee=F.current.get(Te.id+"-sut"),Be=U.current.get(Te.id+"-sut");if(Pe&&Ee&&Be){const Je=Me.solarUpdraftTower.collectorTransmissivity??.9,We=Me.solarUpdraftTower.turbineEfficiency??.3,Ke=Me.solarUpdraftTower.dischargeCoefficient??.65,Ne=Math.PI*Me.solarUpdraftTower.chimneyRadius*Me.solarUpdraftTower.chimneyRadius,De=Math.PI*Me.solarUpdraftTower.collectorRadius*Me.solarUpdraftTower.collectorRadius,ke=fO*CSe*Ne,Ye=2*PSe*Me.solarUpdraftTower.chimneyHeight,it=.5*Ke*We*fO*Ne;let Ve;v&&(Ve=Qx(T,v.lowestTemperatures,v.highestTemperatures));for(let ct=0;ct0&&ct>0&&Ee[ct-1]>Xe){const at=(Ee[ct-1]+Xe)/2,Oe=(r.airConvectiveCoefficient??5)*De*(at-Xe),Ze=at+C4,St=Ze*Ze*Ze*Ze,Pt=ut*ut*ut*ut,Rt=(Me.solarUpdraftTower.collectorEmissivity??.95)*RSe*De*(St-Pt);Pe[ct]-=Oe+Rt,Pe[ct]<0&&(Pe[ct]=0)}const ft=Pe[ct]/(ke*ut),ot=ut*(1+Math.cbrt(ft*ft/Ye))-C4,st=ot>Xe?Math.sqrt(Ye*((ot+C4)/ut-1)):0;Pe[ct]=it*st*st*st*.001,Ee[ct]=ot,Be[ct]=st}const yt=B.current.get(Me.id+"-sut");if(yt){const ct=Pe.reduce((Xe,ut)=>Xe+ut,0);yt[_.current]+=ct}}}}g&&fe()},xe=()=>{const Ae=[],Te=[];let Me=0;for(const Ee of i)if(Ee.type===z.Foundation){const Be=Ee;if(Be.solarStructure===Dn.UpdraftTower&&Be.solarUpdraftTower){const Je=B.current.get(Ee.id+"-sut");Je&&(Ae.push(Je),Te.push(Ee.label?Ee.label:"Tower"+ ++Me))}}const Pe=[];for(let Ee=0;Ee<12;Ee+=M){const Be={};Be.Month=Ms[Ee];for(const[Je,We]of Ae.entries())Be[Te[Je]]=We[Ee/M]*te;Pe.push(Be)}c(Pe),a(Te)},He=()=>{for(const Ae of i)if(Ae.type===z.Foundation){const Te=Ae;if(Te.solarStructure===Dn.UpdraftTower&&Te.solarUpdraftTower){const Me=F.current.get(Ae.id+"-sut");Me?Me.fill(0):F.current.set(Ae.id+"-sut",new Array(24).fill(0));const Pe=U.current.get(Ae.id+"-sut");Pe?Pe.fill(0):U.current.set(Ae.id+"-sut",new Array(24).fill(0));const Ee=O.current.get(Ae.id+"-sut");Ee?Ee.fill(0):O.current.set(Ae.id+"-sut",new Array(24).fill(0))}}},Se=()=>{for(const Ae of i)if(Ae.type===z.Foundation){const Te=Ae;if(Te.solarStructure===Dn.UpdraftTower&&Te.solarUpdraftTower){const Me=B.current.get(Ae.id+"-sut");Me&&Me.length===R?Me.fill(0):B.current.set(Ae.id+"-sut",new Array(R).fill(0))}}},ze=Ae=>{const Te=Ae.solarUpdraftTower;if(!Te)return;const Me=Ei(T,r.latitude);if(Me.zyt)&&(Xe++,ct+=Ye,Ve>0&&(ve(Ae.id+"-sut",it,Me)||(ct+=Ve*ke)))}Xe&&(ct/=Xe);const ot=T.getMinutes()>=30?T.getHours()+1===24?0:T.getHours()+1:T.getHours(),st=Math.PI*Te.collectorRadius*Te.collectorRadius;Pe[ot]+=ct*st}},Ie=Ae=>{const Te=Ae.solarUpdraftTower;if(!Te)return;const Me=O.current.get(Ae.id+"-sut");if(!Me)return;const Pe=new ie().fromArray(Ae.normal),Ee=T.getFullYear(),Be=T.getMonth(),Je=T.getDate(),We=me.dayOfYear(T),Ke=Te.collectorRadius,Ne=Math.max(2,Math.round(Ke*2/b)),De=Ae.cx-Ke+b/2,ke=Ae.cy-Ke+b/2,Ye=Ae.lz+Te.collectorHeight,it=new ie(0,0,Ye),Ve=Ke*Ke;let yt=0,ct,Xe;const ut=Math.PI*Te.collectorRadius*Te.collectorRadius;for(let ft=0;ft<24;ft++){for(let ot=0;ot0){const Oe=Ri(at,We,A,yi.SPHERE_MODEL),Ze=ni(r.ground,Be,Io,Oe),St=Pe.dot(at);yt=0;for(let Pt=0;PtVe)&&(yt++,Me[ft]+=Ze,St>0&&(ve(Ae.id+"-sut",it,at)||(Me[ft]+=St*Oe)))}}}yt&&(Me[ft]/=yt),Me[ft]*=ut}},ye=()=>{const Ae=le.daylight()/60;return Ae>It?v.sunshineHours[T.getMonth()]/(30*Ae*x):0},ce=()=>{const Ae=T.getMonth(),Te=q.current.daylight()/60;return Te>It?v.sunshineHours[Ae]/(30*Te*x):0},pe=()=>{const Ae=C.children.filter(Te=>Te.name==="Content");if(Ae.length>0){const Te=Ae[0].children;E.current.length=0;for(const Me of Te)me.fetchSimulationElements(Me,E.current)}},ve=(Ae,Te,Me)=>{if(E.current.length>1){W.current.length=0,D.set(Te,Me);const Pe=E.current.filter(Ee=>Ee.uuid!==Ae);return D.intersectObjects(Pe,!1,W.current),W.current.length>0}return!1};return h.jsx(h.Fragment,{})});class ijo{constructor(e,n){this.position=e,this.observer=n}}const ajo=be.memo(()=>{const t=H.getState().world,e=H.getState().elements,n=H(fn),o=ht(xh),r=H(qr),i=H(pA),a=ht(O7t),{scene:l}=oi(),s=Jt(),c=m.useMemo(()=>new l0,[]),u=t.solarPanelVisibilityGridCellSize??.2,d=m.useRef([]),f=m.useRef([]),p=m.useRef([]);m.useEffect(()=>{a&&e&&e.length>0&&(w(),o("runSolarPanelVisibilityAnalysis",!1),n(P=>{P.viewState.showSolarPanelVisibilityResultsPanel=!0,P.selectedFloatingWindow="visibilityResultsPanel"}),hn(Y.t("message.SimulationCompleted",s))),o("simulationInProgress",!1)},[a]);const g=()=>{const P=l.children.filter(v=>v.name==="Content");if(P.length>0){const v=P[0].children;f.current.length=0;for(const T of v)me.fetchSimulationElements(T,f.current)}},y=()=>{d.current=[];for(const P of e)if(P.type===z.Human){const v=P;if(v.observer){const T=r(v),A=T?me.absoluteHumanOrTreeCoordinates(v.cx,v.cy,v.cz,T):new ie(v.cx,v.cy,v.cz);A.z+=v.lz,d.current.push(new ijo(A,v))}}},w=()=>{if(Tn.getState().clearSolarPanelVisibilityResults(),y(),d.current.length!==0){g();for(const P of d.current){const v=new Map;for(const T of e)if(T.type===z.SolarPanel){const A=T;v.set(A.parentId,0)}for(const T of e)if(T.type===z.SolarPanel){const A=T;let x=v.get(A.parentId)??0;x+=b(A,P.position)*100,v.set(A.parentId,x)}Tn.getState().setSolarPanelVisibilityResult(P,v)}}},b=(P,v)=>{let T=r(P);if(!T)throw new Error("parent of solar panel does not exist");let A=!1;const x=P.parentType===z.Wall;if(T.type===z.Roof){if(T=i(T),!T)throw new Error("foundation of solar panel does not exist");A=!0}const S=x?me.absoluteCoordinates(P.cx,P.cy,P.cz,T,i(P),P.lz):me.absoluteCoordinates(P.cx,P.cy,P.cz,T,void 0,void 0,!0);A&&(S.z=P.cz+T.cz);const R=new ie().fromArray(P.normal);x&&R.applyEuler(new nn(0,0,T.relativeAngle));const M=T.rotation[2]+P.relativeAzimuth;Math.abs(P.tiltAngle)>.001&&R.applyEuler(new nn(P.tiltAngle,0,M,"ZYX"));const D=P.lx,E=P.ly*Math.cos(P.tiltAngle),W=P.ly*Math.abs(Math.sin(P.tiltAngle)),j=Math.max(2,Math.round(P.lx/u)),L=Math.max(2,Math.round(P.ly/u)),k=D/j,N=E/L,F=W/L,U=S.x-D/2,O=S.y-E/2,B=(A?S.z:P.poleHeight+S.z)-W/2,_=new Xt(S.x,S.y);let X=0;const $=new ie,Q=new ie;let le;const q=new Xt,te=me.isZero(M);for(let re=0;re0&&(Q.normalize(),C(P.id,$,Q)&&(X+=Math.abs(Q.dot(R))/(le*le)));return X*u*u/(4*Math.PI)},C=(P,v,T)=>{if(f.current.length>1){p.current.length=0,c.set(v,T);const A=f.current.filter(x=>x.uuid!==P);if(c.intersectObjects(A,!1,p.current),p.current.length===0)return!0;for(const[x,S]of p.current.entries())if(S.object.name.endsWith("eyeball")&&x===0)return!0;return!1}return!0};return h.jsx(h.Fragment,{})}),ljo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(ma),r=H.getState().world,i=H.getState().elements,a=H(qr),l=H(pA),s=H(N7t),c=H(j7t),u=Tn(Zvt),d=Tn(qvt),f=Tn(Qvt),p=ht(pOe),g=ht(Xvt),y=ht(gOe),w=ht(Jvt),b=H(DBe),C=H(Tge),{scene:P}=oi(),v=Jt(),T=f1(t),A=new Date(r.date),x=m.useMemo(()=>s(t??"Boston MA, USA"),[t]),S=m.useMemo(()=>c(t??"Boston MA, USA"),[t]),R=t?T==null?void 0:T.elevation:0,M=r.timesPerHour??4,D=60/M,E=m.useMemo(()=>new l0,[]),W=m.useRef([]),j=m.useRef([]),L=m.useRef(0),k=m.useRef(!1),N=m.useRef(new Date(r.date)),F=m.useRef(new Map),U=m.useRef(new Map),O=m.useRef(new Array(12).fill(0)),B=m.useRef(new Array(12).fill(0)),_=m.useRef(0),X=m.useRef(!1),$=m.useRef(new Date(r.date)),Q=m.useRef(0),le=m.useMemo(()=>dl(A,r.latitude),[r.date,r.latitude]),q=m.useRef(le);m.useEffect(()=>{if(p)if(C&&!me.hasMovingParts(i))te();else return re(),L.current=requestAnimationFrame(ae),()=>{cancelAnimationFrame(L.current),k.current||(hn(Y.t("message.SimulationAborted",v)),e(ve=>{ve.world.date=N.current.toLocaleString("en-US")}),ht.getState().set(ve=>{ve.simulationInProgress=!1,ve.simulationPaused=!1})),X.current=!1}},[p]),m.useEffect(()=>{X.current=g,g?($.current=new Date(A.getTime()),cancelAnimationFrame(L.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),ae())},[g]);const te=()=>{ce(),xe();for(const ve of i)ve.type===z.Sensor&&ze(ve);e(ve=>{ve.viewState.showDailyLightSensorPanel=!0,ve.selectedFloatingWindow="dailyLightSensorPanel"}),ht.getState().set(ve=>{ve.runDailyLightSensor=!1,ve.simulationInProgress=!1,ve.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),k.current=!0,se(),o&&e(ve=>{ve.actionInfo={name:"Static Daily Simulation for Sensors Completed",details:Tn.getState().dailyLightSensorData,timestamp:new Date().getTime()}})},re=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(N.current=new Date(r.date),Q.current=A.getDay(),A.setHours(Math.floor(le.sunrise/60),-D/2)),k.current=!1,ce(),xe()},ae=()=>{if(p&&!X.current){if(A.getMinutes()+A.getHours()*60+(A.getDay()-Q.current)*T2+D>=le.sunset){cancelAnimationFrame(L.current),e(Ae=>{Ae.world.date=N.current.toLocaleString("en-US"),Ae.viewState.showDailyLightSensorPanel=!0,Ae.selectedFloatingWindow="dailyLightSensorPanel"}),ht.getState().set(Ae=>{Ae.runDailyLightSensor=!1,Ae.simulationInProgress=!1,Ae.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),k.current=!0,se(),o&&e(Ae=>{Ae.actionInfo={name:"Dynamic Daily Simulation for Sensors Completed",details:Tn.getState().dailyLightSensorData,timestamp:new Date().getTime()}});return}A.setHours(A.getHours(),A.getMinutes()+D),e(Ae=>{Ae.world.date=A.toLocaleString("en-US")});for(const Ae of i)Ae.type===z.Sensor&&Se(Ae);L.current=requestAnimationFrame(ae)}},se=()=>{const ve=Ie();for(const Ae of i)if(Ae.type===z.Sensor){const Te=F.current.get(Ae.id);if(Te)for(let Me=0;Me{var Pe;const ve=new Map;let Ae=0;const Te=[];for(const Ee of i)if(Ee.type===z.Sensor){const Be=F.current.get(Ee.id);Be&&(ve.set("Radiation"+ ++Ae,Be),Te.push(Ee.label?Ee.label:"Radiation"+Ae))}const Me=[];for(let Ee=0;Ee<24;Ee++){const Be={};Be.Hour=Ee;for(let Je=1;Je<=Ae;Je++){const We="Radiation"+Je;Be[Te[Je-1]]=(Pe=ve.get(We))==null?void 0:Pe[Ee]}Me.push(Be)}d(Me),u(Te)};m.useEffect(()=>{if(y)if(C&&!me.hasMovingParts(i))ge();else return fe(),L.current=requestAnimationFrame(de),()=>{cancelAnimationFrame(L.current),k.current||(hn(Y.t("message.SimulationAborted",v)),e(ve=>{ve.world.date=N.current.toLocaleString("en-US")}),ht.getState().set(ve=>{ve.simulationInProgress=!1,ve.simulationPaused=!1})),X.current=!1}},[y]),m.useEffect(()=>{X.current=w,w?($.current=new Date(A.getTime()),cancelAnimationFrame(L.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),de())},[w]);const fe=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(N.current=new Date(r.date),_.current=0,A.setMonth(0,22),Q.current=A.getDay(),q.current=dl(A,r.latitude),A.setHours(Math.floor(q.current.sunrise/60),-D/2),e(ve=>{ve.world.date=A.toLocaleString("en-US")})),k.current=!1,ce(),xe(),He()},ge=()=>{ce(),xe(),He(),N.current=new Date(r.date),_.current=0;for(let ve=0;ve<12;ve++){A.setMonth(ve,22),q.current=dl(A,r.latitude),xe();for(const Ae of i)Ae.type===z.Sensor&&ze(Ae);Z(),_.current++}e(ve=>{ve.world.date=N.current.toLocaleString("en-US"),ve.viewState.showYearlyLightSensorPanel=!0,ve.selectedFloatingWindow="yearlyLightSensorPanel"}),ht.getState().set(ve=>{ve.runYearlyLightSensor=!1,ve.simulationInProgress=!1,ve.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),k.current=!0,he(),o&&e(ve=>{ve.actionInfo={name:"Static Yearly Simulation for Sensors Completed",details:Tn.getState().yearlyLightSensorData,timestamp:new Date().getTime()}})},de=()=>{if(y&&!X.current)if(A.getMinutes()+A.getHours()*60+(A.getDay()-Q.current)*T2+D{Ae.world.date=A.toLocaleString("en-US")});for(const Ae of i)Ae.type===z.Sensor&&Se(Ae);L.current=requestAnimationFrame(de)}else{if(Z(),_.current++,_.current===12){cancelAnimationFrame(L.current),e(Ae=>{Ae.world.date=N.current.toLocaleString("en-US"),Ae.viewState.showYearlyLightSensorPanel=!0,Ae.selectedFloatingWindow="yearlyLightSensorPanel"}),ht.getState().set(Ae=>{Ae.runYearlyLightSensor=!1,Ae.simulationInProgress=!1,Ae.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),k.current=!0,he(),o&&e(Ae=>{Ae.actionInfo={name:"Dynamic Yearly Simulation for Sensors Completed",details:Tn.getState().yearlyLightSensorData,timestamp:new Date().getTime()}});return}A.setMonth(_.current,22),Q.current=A.getDay(),q.current=dl(A,r.latitude),A.setHours(Math.floor(q.current.sunrise/60),-D/2),xe(),L.current=requestAnimationFrame(de)}},Z=()=>{const ve=ye();for(const Ae of i)if(Ae.type===z.Sensor){const Te=F.current.get(Ae.id);if(Te){const Me=U.current.get(Ae.id);if(Me){const Pe=Te.reduce((Ee,Be)=>Ee+Be,0);Me[_.current]+=Pe*ve}}}b&&se()},he=()=>{const ve=[],Ae=[];let Te=0,Me=!1,Pe=!1;for(const We of i)if(We.type===z.Sensor){const Ke=U.current.get(We.id);Ke&&(ve.push(Ke),Ae.push(We.label?We.label:"Radiation"+ ++Te),!Me&&me.isIdentical(We.normal,rs)&&(Me=!0),!Pe&&me.isIdentical(We.normal,iAt)&&(Pe=!0))}const Ee=Me&&x;Ee&&Ae.push("Measured (Hor.)");const Be=Pe&&S;Be&&Ae.push("Measured (Ver.)");const Je=[];for(let We=0;We<12;We++){const Ke={};Ke.Month=Ms[We];for(const[Ne,De]of ve.entries())Ke.Daylight=O.current[We],Ke.Clearness=B.current[We]*100,Ee&&(Ke["Measured (Hor.)"]=x.data[We]),Be&&(Ke["Measured (Ver.)"]=S.data[We]),Ke[Ae[Ne]]=De[We];Je.push(Ke)}f(Je),u(Ae)},xe=()=>{for(const ve of i)if(ve.type===z.Sensor){const Ae=F.current.get(ve.id);Ae?Ae.fill(0):F.current.set(ve.id,new Array(24).fill(0))}},He=()=>{for(const ve of i)if(ve.type===z.Sensor){const Ae=U.current.get(ve.id);Ae?Ae.fill(0):U.current.set(ve.id,new Array(12).fill(0))}},Se=ve=>{const Ae=Ei(A,r.latitude);if(Ae.z0&&(pe(ve.id,Pe,Ae)||(Ke+=We*Je));const Ne=F.current.get(ve.id);if(Ne){const De=A.getMinutes()>=30?A.getHours()+1===24?0:A.getHours()+1:A.getHours();Ne[De]+=Ke}},ze=ve=>{const Ae=a(ve);if(!Ae)throw new Error("parent of sensor does not exist");const Te=F.current.get(ve.id);if(!Te)return;let Me=null;Ae.type===z.Wall&&(Me=l(ve));const Pe=me.absoluteCoordinates(ve.cx,ve.cy,ve.cz,Ae,Me||void 0),Ee=new ie().fromArray(ve.normal);Ee.applyAxisAngle(Io,Ae.rotation[2]);const Be=A.getFullYear(),Je=A.getMonth(),We=A.getDate(),Ke=me.dayOfYear(A);for(let Ne=0;Ne<24;Ne++)for(let De=0;De0){const it=Ri(Ye,Ke,R,yi.SPHERE_MODEL),Ve=Ee.dot(Ye);Ve>0&&(pe(ve.id,Pe,Ye)||(Te[Ne]+=Ve*it)),Te[Ne]+=ni(r.ground,Je,Ee,it)}}},Ie=()=>{const ve=le.daylight()/60;return ve>It?T.sunshineHours[A.getMonth()]/(30*ve*M):0},ye=()=>{const ve=A.getMonth(),Ae=q.current.daylight()/60;return Ae>It?(O.current[ve]=Ae,B.current[ve]=T.sunshineHours[ve]/(30*Ae),B.current[ve]/M):(O.current[ve]=0,B.current[ve]=0,0)},ce=()=>{const ve=P.children.filter(Ae=>Ae.name==="Content");if(ve.length>0){const Ae=ve[0].children;W.current.length=0;for(const Te of Ae)me.fetchSimulationElements(Te,W.current)}},pe=(ve,Ae,Te)=>{if(W.current.length>1){j.current.length=0,E.set(Ae,Te);const Me=W.current.filter(Pe=>Pe.uuid!==ve);return E.intersectObjects(Me,!1,j.current),j.current.length>0}return!1};return h.jsx(h.Fragment,{})}),FFe=(t,e)=>{let n=e.efficiency;return e.cellType==="Monocrystalline"&&(n*=.95),n*(1+e.pmaxTC*(t-25))},sjo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(ma),r=H.getState().world,i=H.getState().elements,a=H(t5),l=H(qr),s=H(pA),c=Tn(q7t),u=H(yW),d=Tn(Q7t),f=H(AW),p=H(XYe),g=H(JYe),y=Tn(Z7t),w=ht(VYe),b=ht(V7t),C=ht(X7t),P=ht(GYe),v=ht(G7t),T=ht(J7t),A=H(EBe),x=H(Pge),S=H(cW)??900,R=ht(n5),{scene:M}=oi(),D=Jt(),E=f1(t),W=new Date(r.date),j=t?E==null?void 0:E.elevation:0,L=r.timesPerHour??4,k=60/L,N=r.daysPerYear??6,F=12/N,U=m.useMemo(()=>new l0,[]),O=r.monthlyIrradianceLosses??new Array(12).fill(.05),B=r.pvGridCellSize??.25,_=m.useRef([]),X=m.useRef([]),$=m.useRef(0),Q=m.useRef(!1),le=m.useRef(new Date(r.date)),q=m.useRef(new Map),te=m.useRef(new Map),re=m.useRef(0),ae=m.useRef(!1),se=m.useRef(new Date(r.date)),ne=m.useRef(0),fe=m.useRef(20),ge=m.useMemo(()=>dl(W,r.latitude),[r.date,r.latitude]),de=m.useRef(ge),Z=me.daysInYear(W)/12;m.useEffect(()=>{if(w)if(x&&!me.hasMovingParts(i))setTimeout(()=>{he(!1)},50);else return xe(),$.current=requestAnimationFrame(He),()=>{cancelAnimationFrame($.current),Q.current||(hn(Y.t("message.SimulationAborted",D)),e(De=>{De.world.date=le.current.toLocaleString("en-US")}),ht.getState().set(De=>{De.simulationInProgress=!1,De.simulationPaused=!1})),ae.current=!1}},[w]),m.useEffect(()=>{b&&x&&!me.hasMovingParts(i)&&setTimeout(()=>{he(!0)},50)},[b]),m.useEffect(()=>{ae.current=C,C?(se.current=new Date(W.getTime()),cancelAnimationFrame($.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",D))):(n("simulationPaused",!1),He())},[C]);const he=De=>{Ne(),Me();for(const ke of i)ke.type===z.SolarPanel&&Ae(ke);if(e(ke=>{!R&&!De&&(ke.viewState.showDailyPvYieldPanel=!0,ke.selectedFloatingWindow="dailyPvYieldPanel")}),ht.getState().set(ke=>{De?ke.runDailySimulationForSolarPanelsLastStep=!1:ke.runDailySimulationForSolarPanels=!1,ke.simulationInProgress=!1,ke.simulationPaused=!1}),Q.current=!0,Se(),!R&&!De&&(hn(Y.t("message.SimulationCompleted",D)),o)){const ke=Tn.getState().sumDailyPvYield(),Ye=Tn.getState().getDailyPvProfit(),it=Tn.getState().dailyPvYield;e(Ve=>{Ve.actionInfo={name:"Static Daily Simulation for Solar Panels Completed",result:{totalYield:ke.toFixed(2),profit:Ye.toFixed(2)},details:it,timestamp:new Date().getTime()}})}},xe=()=>{ae.current?(W.setTime(se.current.getTime()),ae.current=!1):(le.current=new Date(r.date),ne.current=W.getDay(),W.setHours(Math.floor(ge.sunrise/60),-k/2)),Q.current=!1,Ne(),Me()},He=()=>{if(w&&!ae.current){if(W.getMinutes()+W.getHours()*60+(W.getDay()-ne.current)*T2+k>=ge.sunset){if(cancelAnimationFrame($.current),e(ke=>{ke.world.date=le.current.toLocaleString("en-US"),R||(ke.viewState.showDailyPvYieldPanel=!0,ke.selectedFloatingWindow="dailyPvYieldPanel")}),ht.getState().set(ke=>{ke.runDailySimulationForSolarPanels=!1,ke.simulationInProgress=!1,ke.simulationPaused=!1}),Q.current=!0,Se(),!R&&(hn(Y.t("message.SimulationCompleted",D)),o)){const ke=Tn.getState().sumDailyPvYield(),Ye=Tn.getState().getDailyPvProfit(),it=Tn.getState().dailyPvYield;e(Ve=>{Ve.actionInfo={name:"Dynamic Daily Simulation for Solar Panels Completed",result:{totalYield:ke.toFixed(2),profit:Ye.toFixed(2)},details:it,timestamp:new Date().getTime()}})}return}W.setHours(W.getHours(),W.getMinutes()+k),e(ke=>{ke.world.date=W.toLocaleString("en-US")});for(const ke of i)ke.type===z.SolarPanel&&Te(ke);$.current=requestAnimationFrame(He)}},Se=()=>{const De=Ee();for(const ke of i)if(ke.type===z.SolarPanel){const Ye=ke,it=q.current.get(ke.id);if(it){const Ve=Je(Ye)*De;for(let yt=0;yt{var De;if(p){const ke=new Array(24).fill(0),Ye=new Map;let it=0;const Ve=[];for(const ct of i)if(ct.type===z.SolarPanel){const Xe=q.current.get(ct.id);if(Xe){u(ct.id,Xe.reduce((ut,ft)=>ut+ft,0)),it++,Ye.set("Panel"+it,Xe),Ve.push(ct.label?ct.label:"Panel"+it);for(let ut=0;ut<24;ut++)ke[ut]+=Xe[ut]}}const yt=[];for(let ct=0;ct<24;ct++){const Xe={};Xe.Hour=ct;for(let ut=1;ut<=it;ut++){const ft="Panel"+ut;Xe[Ve[ut-1]]=(De=Ye.get(ft))==null?void 0:De[ct]}yt.push(Xe)}c(yt),y(Ve)}else{const ke=new Array(24).fill(0);for(const it of i)if(it.type===z.SolarPanel){const Ve=q.current.get(it.id);if(Ve){u(it.id,Ve.reduce((yt,ct)=>yt+ct,0));for(let yt=0;yt<24;yt++)ke[yt]+=Ve[yt]}}const Ye=[];for(let it=0;it<24;it++)Ye.push({Hour:it,Total:ke[it]});c(Ye)}};m.useEffect(()=>{if(P)if(x&&!me.hasMovingParts(i))setTimeout(()=>{ye(!1)},50);else return Ie(),$.current=requestAnimationFrame(ce),()=>{cancelAnimationFrame($.current),Q.current||(hn(Y.t("message.SimulationAborted",D)),e(De=>{De.world.date=le.current.toLocaleString("en-US")}),ht.getState().set(De=>{De.simulationInProgress=!1,De.simulationPaused=!1})),ae.current=!1}},[P]),m.useEffect(()=>{v&&x&&!me.hasMovingParts(i)&&setTimeout(()=>{ye(!0)},50)},[v]),m.useEffect(()=>{ae.current=T,T?(se.current=new Date(W.getTime()),cancelAnimationFrame($.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",D))):(n("simulationPaused",!1),ce())},[T]);const Ie=()=>{ae.current?(W.setTime(se.current.getTime()),ae.current=!1):(le.current=new Date(r.date),re.current=0,W.setMonth(0,22),ne.current=W.getDay(),de.current=dl(W,r.latitude),W.setHours(Math.floor(de.current.sunrise/60),-k/2),e(De=>{De.world.date=W.toLocaleString("en-US")})),Q.current=!1,Ne(),Me(),Pe()},ye=De=>{Ne(),Me(),Pe(),le.current=new Date(r.date),re.current=0;for(let ke=0;ke<12;ke+=F){W.setMonth(ke,22),de.current=dl(W,r.latitude),Me();for(const Ye of i)Ye.type===z.SolarPanel&&Ae(Ye);pe(),re.current++}if(e(ke=>{ke.world.date=le.current.toLocaleString("en-US"),!R&&!De&&(ke.viewState.showYearlyPvYieldPanel=!0,ke.selectedFloatingWindow="yearlyPvYieldPanel")}),ht.getState().set(ke=>{De?ke.runYearlySimulationForSolarPanelsLastStep=!1:ke.runYearlySimulationForSolarPanels=!1,ke.simulationInProgress=!1,ke.simulationPaused=!1}),Q.current=!0,ve(),!R&&!De&&(hn(Y.t("message.SimulationCompleted",D)),o)){const ke=Tn.getState().sumYearlyPvYield(),Ye=Tn.getState().getYearlyPvProfit(),it=Tn.getState().yearlyPvYield;e(Ve=>{Ve.actionInfo={name:"Static Yearly Simulation for Solar Panels Completed",result:{totalYield:ke.toFixed(2),profit:Ye.toFixed(2)},details:it,timestamp:new Date().getTime()}})}},ce=()=>{if(P&&!ae.current)if(W.getMinutes()+W.getHours()*60+(W.getDay()-ne.current)*T2+k{ke.world.date=W.toLocaleString("en-US")});for(const ke of i)ke.type===z.SolarPanel&&Te(ke);$.current=requestAnimationFrame(ce)}else{if(pe(),re.current++,re.current===N){if(cancelAnimationFrame($.current),e(ke=>{ke.world.date=le.current.toLocaleString("en-US"),R||(ke.viewState.showYearlyPvYieldPanel=!0,ke.selectedFloatingWindow="yearlyPvYieldPanel")}),ht.getState().set(ke=>{ke.runYearlySimulationForSolarPanels=!1,ke.simulationInProgress=!1,ke.simulationPaused=!1}),Q.current=!0,ve(),!R&&(hn(Y.t("message.SimulationCompleted",D)),o)){const ke=Tn.getState().sumYearlyPvYield(),Ye=Tn.getState().getYearlyPvProfit(),it=Tn.getState().yearlyPvYield;e(Ve=>{Ve.actionInfo={name:"Dynamic Yearly Simulation for Solar Panels Completed",result:{totalYield:ke.toFixed(2),profit:Ye.toFixed(2)},details:it,timestamp:new Date().getTime()}})}return}W.setMonth(re.current*F,22),ne.current=W.getDay(),de.current=dl(W,r.latitude),W.setHours(Math.floor(de.current.sunrise/60),-k/2),Me(),$.current=requestAnimationFrame(ce)}},pe=()=>{const De=Be();for(const ke of i)if(ke.type===z.SolarPanel){const Ye=ke,it=q.current.get(ke.id);if(it){const Ve=te.current.get(ke.id);if(Ve){const yt=it.reduce((ct,Xe)=>ct+Xe,0);Ve[re.current]+=yt*De*Je(Ye)}}}!R&&A&&Se()},ve=()=>{if(g){const De=[],ke=[];let Ye=0;for(const Ve of i)if(Ve.type===z.SolarPanel){const yt=te.current.get(Ve.id);yt&&(f(Ve.id,yt.reduce((ct,Xe)=>ct+Xe,0)*F*Z),De.push(yt),Ye++,ke.push(Ve.label??"Panel"+Ye))}const it=[];for(let Ve=0;Ve<12;Ve+=F){const yt={};yt.Month=Ms[Ve];for(const[ct,Xe]of De.entries())yt[ke[ct]]=Xe[Ve/F]*Z;it.push(yt)}d(it),y(ke)}else{const De=[];for(const Ye of i)if(Ye.type===z.SolarPanel){const it=te.current.get(Ye.id);it&&(f(Ye.id,it.reduce((Ve,yt)=>Ve+yt,0)*F*Z),De.push(it))}const ke=[];for(let Ye=0;Ye<12;Ye+=F){let it=0;for(const Ve of De)it+=Ve[Ye/F];ke.push({Month:Ms[Ye],Total:it*Z})}d(ke)}},Ae=De=>{if(De.trackerType!==za.NO_TRACKER)throw new Error("static simulation is not for solar panel with tracker");let ke=l(De);if(!ke)throw new Error("parent of solar panel does not exist");const Ye=De.parentType===z.Roof,it=De.parentType===z.Wall;if(Ye&&(ke=s(ke),!ke))throw new Error("foundation of solar panel does not exist");const Ve=a(De.pvModelName);if(!Ve)throw new Error("PV model not found");const yt=q.current.get(De.id);if(!yt)return;const ct=it?me.absoluteCoordinates(De.cx,De.cy,De.cz,ke,s(De),De.lz):me.absoluteCoordinates(De.cx,De.cy,De.cz,ke,void 0,void 0,!0),Xe=ke.rotation[2];let ut=Xe+De.relativeAzimuth,ft=De.tiltAngle,ot=!0;if(Ye&&(ct.z=De.cz+De.lz+.02+ke.cz,me.isZero(De.rotation[0])?ct.z+=De.poleHeight:(ft=De.rotation[0],ut=Xe,ot=!1)),it&&!me.isZero(De.tiltAngle)){const mt=ke,Qe=s(ke),Dt=(Qe?Qe.rotation[2]+mt.relativeAngle:mt.relativeAngle)-Gt,lt=De.ly*Math.abs(Math.sin(De.tiltAngle))/2;ct.x+=lt*Math.cos(Dt),ct.y+=lt*Math.sin(Dt)}const st=new ie().fromArray(De.normal),at=new nn(Ye&&!ot?0:ft,0,ut,"ZYX");st.applyEuler(at);const Oe=W.getFullYear(),Ze=W.getMonth(),St=W.getDate(),Pt=me.dayOfYear(W);let Rt,Ut,Ht,At,kt;r.discretization===Fm.EXACT?(Rt=De.lx,Ut=De.ly,De.orientation===vr.portrait?(Ht=Math.max(1,Math.round(De.lx/Ve.width)),At=Math.max(1,Math.round(De.ly/Ve.length)),Ht*=Ve.n,At*=Ve.m):(Ht=Math.max(1,Math.round(De.lx/Ve.length)),At=Math.max(1,Math.round(De.ly/Ve.width)),Ht*=Ve.m,At*=Ve.n),kt=De.lx/Ht):(Rt=De.lx,Ut=De.ly,Ht=Math.max(2,Math.round(De.lx/B)),At=Math.max(2,Math.round(De.ly/B)),Ht%2!==0&&(Ht+=1),At%2!==0&&(At+=1),kt=B);const gt=Rt/Ht,dt=Ut/At,Ct=ct.x-(Rt-kt)/2,tt=ct.y-(Ut-kt)/2,Fe=Ye||it?ct.z:ke.lz+De.poleHeight+De.lz,qe=new Xt(ct.x,ct.y),je=new ie,rt=Array.from(Array(Ht),()=>new Array(At));Ye&&!ot&&(at.x=De.rotation[0],at.z=De.rotation[2]+Xe),it&&(at.x=Gt+De.tiltAngle,at.z=ke.relativeAngle+Xe);for(let mt=0;mt<24;mt++)for(let Qe=0;Qe0){const lt=Ri(Dt,Pt,j,yi.SPHERE_MODEL),zt=ni(r.ground,Ze,st,lt),Ft=st.dot(Dt),_t=new Xt,tn=new ie;if(Ve.bifacialityFactor>0){const an=st.clone().negate(),mn=ni(r.ground,Ze,an,lt),Hn=zt+mn*Ve.bifacialityFactor;for(let Fo=0;Fo0?Ft:-Ft*Ve.bifacialityFactor)*lt)}else for(let an=0;an0&&(_t.set(Ct+an*gt,tt+mn*dt),tn.set(_t.x-qe.x,_t.y-qe.y,0),tn.applyEuler(at),je.set(ct.x+tn.x,ct.y+tn.y,Fe+tn.z),Ke(De.id,je,Dt)||(rt[an][mn]+=Ft*lt));let Qt=0;We(Tt);const gn=FFe(fe.current,Ve);switch(Ve.shadeTolerance){case Fv.NONE:{let an=Number.MAX_VALUE;for(let mn=0;mn{let ke=l(De);if(!ke)throw new Error("parent of solar panel does not exist");const Ye=De.parentType===z.Roof,it=De.parentType===z.Wall;if(Ye&&(ke=s(ke),!ke))throw new Error("foundation of solar panel does not exist");const Ve=a(De.pvModelName);if(!Ve)throw new Error("PV model not found");const yt=Ei(W,r.latitude);if(yt.z<=0)return;const ct=it?me.absoluteCoordinates(De.cx,De.cy,De.cz,ke,s(De),De.lz):me.absoluteCoordinates(De.cx,De.cy,De.cz,ke,void 0,void 0,!0),Xe=ke.rotation[2];let ut=De.tiltAngle,ft=Xe+(it?0:De.relativeAzimuth),ot=!0;if(Ye&&(ct.z=De.cz+De.lz+.02+ke.cz,me.isZero(De.rotation[0])?ct.z+=De.poleHeight:(ut=De.rotation[0],ft=Xe,ot=!1)),it&&!me.isZero(De.tiltAngle)){const zt=ke,Ft=s(ke),tn=(Ft?Ft.rotation[2]+zt.relativeAngle:zt.relativeAngle)-Gt,Qt=De.ly*Math.abs(Math.sin(De.tiltAngle))/2;ct.x+=Qt*Math.cos(tn),ct.y+=Qt*Math.sin(tn)}const st=new ie().fromArray(De.normal),at=W.getMonth(),Oe=me.dayOfYear(W);let Ze,St,Pt,Rt,Ut;r.discretization===Fm.EXACT?(Ze=De.lx,St=De.ly,De.orientation===vr.portrait?(Pt=Math.max(1,Math.round(De.lx/Ve.width)),Rt=Math.max(1,Math.round(De.ly/Ve.length)),Pt*=Ve.n,Rt*=Ve.m):(Pt=Math.max(1,Math.round(De.lx/Ve.length)),Rt=Math.max(1,Math.round(De.ly/Ve.width)),Pt*=Ve.m,Rt*=Ve.n),Ut=De.lx/Pt):(Ze=De.lx,St=De.ly,Pt=Math.max(2,Math.round(De.lx/B)),Rt=Math.max(2,Math.round(De.ly/B)),Pt%2!==0&&(Pt+=1),Rt%2!==0&&(Rt+=1),Ut=B);const Ht=Ze/Pt,At=St/Rt,kt=ct.x-(Ze-Ut)/2,gt=ct.y-(St-Ut)/2,dt=Ye||it?ct.z:ke.lz+De.poleHeight+De.lz,Ct=new Xt(ct.x,ct.y),tt=new ie,Fe=Array.from(Array(Pt),()=>new Array(Rt));let qe=new nn(Ye&&!ot?0:ut,0,ft,"ZYX");if(De.trackerType!==za.NO_TRACKER){const zt=Xe?yt.clone().applyAxisAngle(Io,-Xe):yt.clone();switch(De.trackerType){case za.ALTAZIMUTH_DUAL_AXIS_TRACKER:{const Ft=new bs().setFromUnitVectors(Io,zt);qe=new nn().setFromQuaternion(Ft),qe.z+=ft;break}case za.HORIZONTAL_SINGLE_AXIS_TRACKER:{const Ft=new bs().setFromUnitVectors(Io,new ie(zt.x,0,zt.z).normalize());qe=new nn().setFromQuaternion(Ft),qe.z+=ft;break}case za.VERTICAL_SINGLE_AXIS_TRACKER:{const Ft=new ie(zt.x,-zt.y,0).normalize(),_t=Math.acos(Oc.dot(Ft))*Math.sign(Ft.x);qe=new nn(De.tiltAngle,0,_t+Xe,"ZYX");break}case za.TILTED_SINGLE_AXIS_TRACKER:break}}if(it&&st.applyEuler(new nn(0,0,ke.relativeAngle)),st.applyEuler(qe),Ye&&!ot&&(qe.x=De.rotation[0],qe.z=De.rotation[2]+Xe),it){const zt=l(De);zt&&(qe.x=Gt+De.tiltAngle,qe.z=ke.relativeAngle+zt.rotation[2])}const je=Ri(yt,Oe,j,yi.SPHERE_MODEL),rt=ni(r.ground,at,st,je),mt=st.dot(yt),Qe=new Xt,Tt=new ie;if(Ve.bifacialityFactor>0){const zt=st.clone().negate(),Ft=ni(r.ground,at,zt,je),_t=rt+Ft*Ve.bifacialityFactor;for(let tn=0;tn0?mt:-mt*Ve.bifacialityFactor)*je)}else for(let zt=0;zt0&&(Qe.set(kt+zt*Ht,gt+Ft*At),Tt.set(Qe.x-Ct.x,Qe.y-Ct.y,0),Tt.applyEuler(qe),tt.set(ct.x+Tt.x,ct.y+Tt.y,dt+Tt.z),Ke(De.id,tt,yt)||(Fe[zt][Ft]+=mt*je));let Dt=0;switch(Ve.shadeTolerance){case Fv.NONE:{let zt=Number.MAX_VALUE;for(let Ft=0;Ft=30?W.getHours()+1===24?0:W.getHours()+1:W.getHours();lt[Ft]+=zt*Dt/(Pt*Rt)}},Me=()=>{for(const De of i)if(De.type===z.SolarPanel){const ke=q.current.get(De.id);ke?ke.fill(0):q.current.set(De.id,new Array(24).fill(0))}},Pe=()=>{for(const De of i)if(De.type===z.SolarPanel){const ke=te.current.get(De.id);ke&&ke.length===N?ke.fill(0):te.current.set(De.id,new Array(N).fill(0))}},Ee=()=>{const De=ge.daylight()/60;return De>It?E.sunshineHours[W.getMonth()]/(30*De*L):0},Be=()=>{const De=de.current.daylight()/60;return De>It?E.sunshineHours[W.getMonth()]/(30*De*L):0},Je=De=>{if(!a(De.pvModelName))throw new Error("PV model not found");return De.lx*De.ly*(De.inverterEfficiency??.95)*(1-O[W.getMonth()])},We=De=>{if(E){const ke=Qx(De,E.lowestTemperatures,E.highestTemperatures);fe.current=$x(ke.high,ke.low,r.diurnalTemperatureModel,S,dl(De,r.latitude),me.minutesIntoDay(De))}},Ke=(De,ke,Ye)=>{if(_.current.length>1){X.current.length=0,U.set(ke,Ye);const it=_.current.filter(Ve=>Ve.uuid!==De);return U.intersectObjects(it,!1,X.current),X.current.length>0}return!1},Ne=()=>{const De=M.children.filter(ke=>ke.name==="Content");if(De.length>0){const ke=De[0].children;_.current.length=0;for(const Ye of ke)me.fetchSimulationElements(Ye,_.current)}};return h.jsx(h.Fragment,{})}),cjo=be.memo(()=>{const t=H(Tc),e=H(Sb),n=H(_Ye),o=H(OYe),r=H(jge),[i,a]=m.useState("Boston MA, USA");return m.useEffect(()=>{if(Object.keys(r).length===0)return;const l=n(t,e)??"Boston MA, USA";a(l),o(l)},[t,e,r]),h.jsxs(h.Fragment,{children:[h.jsx($Uo,{city:i}),h.jsx(QUo,{city:i}),h.jsx(ZUo,{city:i}),h.jsx(ljo,{city:i}),h.jsx(sjo,{city:i}),h.jsx(ajo,{}),h.jsx(ejo,{city:i}),h.jsx(tjo,{city:i}),h.jsx(njo,{city:i}),h.jsx(ojo,{city:i}),h.jsx(rjo,{city:i})]})}),u_="/aladdin/assets/image_fail_try_again-CaxVXMjm.png";var BL=(t=>(t[t.None=0]="None",t[t.Equal=1]="Equal",t[t.LessThan=2]="LessThan",t[t.GreaterThan=3]="GreaterThan",t[t.Between=4]="Between",t))(BL||{});const ujo=5,djo=be.memo(({yScale:t,tickLength:e,tickIntegers:n,variable:o,name:r,unit:i,type:a,digits:l,min:s,max:c,step:u,value:d,filter:f,hover:p})=>{const g=H(fn),y=H(mp),w=H(s0),b=H(BYe),C=H(jYe),P=H(YYe),[v,T]=m.useState(!1),A=m.useRef(s),x=m.useRef(c);m.useEffect(()=>{A.current=s},[s]),m.useEffect(()=>{x.current=c},[c]);const S={lng:w},R=y.uid===b,M=t.range(),D=t(s)-t(c),E=40,W=m.useMemo(()=>{const B=M[0]-M[1],_=a==="number"?Math.floor(B/e):1;return(n?t.ticks(_).filter($=>Number.isInteger($)):t.ticks(_)).map($=>({value:$,yOffset:t($)}))},[t,e,a,n,M]),j=()=>{g(B=>{B.projectState.selectedProperty=B.projectState.selectedProperty!==o?o:null}),ht.getState().set(B=>{B.updateProjectsFlag=!0})},L=()=>{R&&b&&C?RVn(b,C,P!==o?o:null).then(()=>{j()}):j()},k=(B,_)=>h.jsx("span",{style:{display:"block",width:_+"px"},children:B}),N=()=>h.jsx("text",{onClick:L,x:0,y:-20,style:{fontSize:"10px",textAnchor:"middle",fill:"dimgray",cursor:"pointer",fontWeight:P===o?"bold":"normal"},children:r}),F=m.useMemo(()=>o==="yearlyProfit"||o==="unitCost"||o==="sellingPrice"||o==="totalYearlyCost",[o]),U=()=>o==="totalYearlyCost"||o==="totalYearlyYield"||o==="meanYearlyYield"||o==="unitCost"||o==="poleHeight"||o==="interRowSpacing"?0:o==="tiltAngle"||o==="latitude"?-90:o==="rowWidth"?1:Number.MIN_SAFE_INTEGER,O=()=>o==="tiltAngle"||o==="latitude"?90:Number.MAX_SAFE_INTEGER;return h.jsxs(h.Fragment,{children:[o!=="orientation"?h.jsx(Al,{content:h.jsxs("div",{children:[h.jsx(Mn,{style:{width:"240px"},addonBefore:k(Y.t("word.Minimum",S)+(F?" $":""),80),addonAfter:i,min:U(),max:x.current-u,step:u,value:A.current,onChange:B=>{B!==null&&(g(_=>{if(_.projectState.ranges){let X=-1,$=null;for(const[Q,le]of _.projectState.ranges.entries())if(le.variable===o){X=Q,$=le;break}if(X>=0&&$)_.projectState.ranges[X]={variable:$.variable,minimum:B,maximum:$.maximum},y.uid&&_.projectState.title&&LCe(y.uid,_.projectState.title,_.projectState.ranges);else{const Q={variable:o,minimum:B,maximum:c};_.projectState.ranges.push(Q),y.uid&&_.projectState.title&&FO(y.uid,_.projectState.title,Q)}}else{const X={variable:o,minimum:B,maximum:c};_.projectState.ranges=[X],y.uid&&_.projectState.title&&FO(y.uid,_.projectState.title,X)}}),A.current=Number(B),T(!v))}}),h.jsx("br",{}),h.jsx(Mn,{style:{width:"240px"},addonBefore:k(Y.t("word.Maximum",S)+(F?" $":""),80),addonAfter:i,min:A.current+u,max:O(),step:u,value:x.current,onChange:B=>{B!==null&&(g(_=>{if(_.projectState.ranges){let X=-1,$=null;for(const[Q,le]of _.projectState.ranges.entries())if(le.variable===o){X=Q,$=le;break}if(X>=0&&$)_.projectState.ranges[X]={variable:$.variable,minimum:$.minimum,maximum:B},y.uid&&_.projectState.title&&LCe(y.uid,_.projectState.title,_.projectState.ranges);else{const Q={variable:o,minimum:s,maximum:B};_.projectState.ranges.push(Q),y.uid&&_.projectState.title&&FO(y.uid,_.projectState.title,Q)}}else{const X={variable:o,minimum:s,maximum:B};_.projectState.ranges=[X],y.uid&&_.projectState.title&&FO(y.uid,_.projectState.title,X)}}),x.current=Number(B),T(!v))}})]}),children:N()}):h.jsx(h.Fragment,{children:N()}),d!==void 0&&h.jsx("text",{x:0,y:-8,style:{fontSize:"9px",textAnchor:"middle",fill:"dimgray"},children:F?d.toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:l})+(o==="yearlyProfit"||o==="totalYearlyCost"?"K":""):(o==="orientation"?Y.t(d===0?"solarPanelMenu.Landscape":"solarPanelMenu.Portrait",S)+(d===0?" (▭)":" (▯)"):d.toFixed(l))+(i!==""?i:"")}),f&&f.type===BL.Between&&h.jsx("rect",{x:-5,y:t(f.upperBound??c),width:10,height:t((f==null?void 0:f.lowerBound)??s)-t((f==null?void 0:f.upperBound)??c),fill:"lightgray"}),h.jsx("rect",{x:-E/2,y:0,width:E,height:D,fill:"gold",fillOpacity:P===o?.25:0}),W.map(({value:B,yOffset:_})=>h.jsxs("g",{transform:`translate(0, ${_})`,shapeRendering:"crispEdges",children:[h.jsx("line",{x1:-ujo,x2:0,stroke:"black",strokeWidth:1}),h.jsx("text",{style:{fontSize:"10px",textAnchor:"start",alignmentBaseline:"central",transform:"translateX(-25px)"},children:o==="orientation"?B===0?"▭":"▯":B},B)]},B)),h.jsx("line",{x1:0,x2:0,y1:t(s),y2:t(c),stroke:"black",strokeWidth:2}),f&&f.type===BL.Between&&h.jsx("foreignObject",{x:-E/2,y:4,width:E,height:D-3,children:h.jsx(fy,{theme:{components:{Slider:{railBg:"black",railSize:0,handleSize:8}}},children:h.jsx(Iu,{style:{marginLeft:E/2+"px"},min:s,max:c,step:(c-s)/100,value:[f.lowerBound??s,f.upperBound??c],onChange:B=>{f&&(f.lowerBound=B[0],f.upperBound=B[1],p&&p(-1),g(_=>{if(_.projectState.filters){let X=-1;for(const[$,Q]of _.projectState.filters.entries())if(Q.variable===o){X=$;break}if(X>=0)_.projectState.filters[X]={variable:f.variable,type:f.type,lowerBound:f.lowerBound,upperBound:f.upperBound};else{const $={variable:o,type:f.type,lowerBound:f.lowerBound,upperBound:f.upperBound};_.projectState.filters.push($)}}}),T(!v))},range:!0,vertical:!0})})})]})}),nP={top:30,right:55,bottom:36,left:55},fjo=["#e0ac2b","#e85252","#6689c6","#9a6fb0","#a53253","#69b3a2","#556b2f","#8b008b","#ff1493","#d2691e","#2f4f4f","#dc143c"],hjo=be.memo(({id:t,width:e,height:n,data:o,types:r,minima:i,maxima:a,filters:l,steps:s,variables:c,titles:u,units:d,digits:f,tickIntegers:p,hover:g,hoveredIndex:y,selectedIndex:w})=>{const b=e-nP.right-nP.left,C=n-nP.top-nP.bottom,P=m.useMemo(()=>[...new Set(o.map(M=>M.group))],[o]),v=m.useMemo(()=>jC().range([0,b]).domain(c).padding(0),[c,b]),T=m.useMemo(()=>{const M={};return c.forEach((D,E)=>{M[D]=dL().range([C,0]).domain([i[E]??0,a[E]??1])}),M},[c,i,a,C]),A=m.useMemo(()=>qee().domain(P).range(fjo),[P]),x=T3e(),S=m.useMemo(()=>o.map((M,D)=>{if(M.invisible)return null;const E=c.map(j=>{const L=T[j],k=v(j)??0,N=L(M[j]);return[k,N]}),W=x(E);if(W)return h.jsx("path",{onMouseOver:()=>{g(D)},d:W,stroke:M.hovered?"red":A(M.group),fill:"none",strokeWidth:M.excluded?.25:M.selected?3:1,strokeDasharray:M.hovered?"3,3":"none"},D)}),[o,c,v,T,A]),R=m.useMemo(()=>c.map((M,D)=>{const E=T[M];return h.jsx("g",{transform:"translate("+v(M)+",0)",children:h.jsx(djo,{yScale:E,tickLength:40,tickIntegers:p[D],type:r[D]??"number",variable:c[D],name:u[D],unit:d[D],digits:f[D],min:i[D],max:a[D],step:s[D],value:y>=0&&!o[y].invisible?o[y][M]:w>=0&&!o[w].invisible?o[w][M]:void 0,filter:l[D],hover:g})},D)}),[c,o,v,T,p,r,u,d,f,i,a,s,l,w,y]);return h.jsx("svg",{id:t,width:e,height:n,onMouseLeave:()=>{g&&g(-1)},onContextMenu:M=>{M.stopPropagation()},children:h.jsxs("g",{width:b,height:C,transform:`translate(${[nP.left,nP.top].join(",")})`,children:[S,R]})})});var ype={};(function(t){(function(){var e=t||!1||this||window;e.default=e;var n="http://www.w3.org/2000/xmlns/",o="http://www.w3.org/1999/xhtml",r="http://www.w3.org/2000/svg",i=']>',a=/url\(["']?(.+?)["']?\)/,l={woff2:"font/woff2",woff:"font/woff",otf:"application/x-font-opentype",ttf:"application/x-font-ttf",eot:"application/vnd.ms-fontobject",sfnt:"application/font-sfnt",svg:"image/svg+xml"},s=function(E){return E instanceof HTMLElement||E instanceof SVGElement},c=function(E){if(!s(E))throw new Error("an HTMLElement or SVGElement is required; got "+E)},u=function(E){return new Promise(function(W,j){s(E)?W(E):j(new Error("an HTMLElement or SVGElement is required; got "+E))})},d=function(E){return E&&E.lastIndexOf("http",0)===0&&E.lastIndexOf(window.location.host)===-1},f=function(E){var W=Object.keys(l).filter(function(j){return E.indexOf("."+j)>0}).map(function(j){return l[j]});return W?W[0]:(console.error("Unknown font format for "+E+". Fonts may not be working correctly."),"application/octet-stream")},p=function(E){for(var W="",j=new Uint8Array(E),L=0;L"u"||L===null||isNaN(parseFloat(L))?0:L},y=function(E,W,j,L){if(E.tagName==="svg")return{width:j||g(E,W,"width"),height:L||g(E,W,"height")};if(E.getBBox){var k=E.getBBox(),N=k.x,F=k.y,U=k.width,O=k.height;return{width:N+U,height:F+O}}},w=function(E){return decodeURIComponent(encodeURIComponent(E).replace(/%([0-9A-F]{2})/g,function(W,j){var L=String.fromCharCode("0x"+j);return L==="%"?"%25":L}))},b=function(E){for(var W=window.atob(E.split(",")[1]),j=E.split(",")[0].split(":")[1].split(";")[0],L=new ArrayBuffer(W.length),k=new Uint8Array(L),N=0;N{const e=H.getState().world,n=H(da),o=H(pu)??m0,r=H(fn),i=H(bW),a=new Date(H(rl)),l=H(_4t),s=ht(Rge),c=ht(Oq),u=ht(Hwt),d=ht(Rf),f=me.hasSolarPanels(H.getState().elements),p=Tn(qYe),g=Tn($Ye),y=Tn(QYe),w=H(Pc),b=m.useRef(null),C=m.useRef(),P=b.current?b.current.clientWidth+40:l?l.width+40:640,v=b.current?b.current.clientHeight+100:l?l.height+100:600,[T,A]=m.useState({x:l?Math.max(l.x,P-window.innerWidth):0,y:l?Math.min(l.y,window.innerHeight-v):0}),x=be.useRef(null),S=Jt(),R=f1(t),M=Ms[a.getMonth()],D=e.daysPerYear??6,E=12/D,[W,j]=m.useState(0),[L,k]=m.useState(0),[N,F]=m.useState(0),[U,O]=m.useState(0),[B,_]=m.useState(["Heater","AC","Solar","Net"]),[X,$]=m.useState([]),{sum:Q,sumHeaterMap:le,sumAcMap:q,sumSolarPanelMap:te,dataLabels:re}=u0t(a,R,f),ae=m.useRef(new Array(D).fill({})),se=m.useRef(new Array(D).fill(0)),ne=m.useRef(new Array(D).fill(0)),fe=m.useRef(new Array(D).fill(0)),ge=m.useRef(new Array(D).fill(0)),de=m.useRef([]),Z=m.useRef([]),he=m.useRef([]),xe=m.useRef([]);m.useEffect(()=>{He()},[D,u]),m.useEffect(()=>{c&&He()},[c]);const He=()=>{ae.current=new Array(D).fill({}),se.current=new Array(D).fill(0),ne.current=new Array(D).fill(0),fe.current=new Array(D).fill(0),ge.current=new Array(D).fill(0),$([]),j(0),k(0),F(0),O(0),_([])};m.useEffect(()=>{const ve=Math.floor(a.getMonth()/E),Ae=(Object.keys(Q[0]).length-1)/(f?4:3);if(de.current=[],Z.current=[],xe.current=[],he.current=[],Ae>1){const We=new Map,Ke=new Map,Ne=new Map,De=new Map;for(const Ve of Q){let yt=0;for(let ct=0;ct6&&(De=" "+Ve.substring(6).trim());break}const ke="Heater"+De,Ye="AC"+De,it="Net"+De;if(f){const Ve="Solar"+De;let yt=0;_([ke,Ye,Ve,it]);for(const Xe of Q)We+=Xe[ke],Ke+=Xe[Ye],yt+=Xe[Ve],Ne+=Xe[it];const ct={};ct.Month=Ms[a.getMonth()],ct[ke]=30*We,ct[Ye]=30*Ke,ct[Ve]=30*yt,ct[it]=30*Ne,ae.current[ve]=ct}else{_([ke,Ye,it]);for(const yt of Q)We+=yt[ke],Ke+=yt[Ye],Ne+=yt[it];const Ve={};Ve.Month=Ms[a.getMonth()],Ve[ke]=30*We,Ve[Ye]=30*Ke,Ve[it]=30*Ne,ae.current[ve]=Ve}}$([...ae.current]);let Te=0;if(le)for(const We of le.keys())Te+=le.get(We)??0;let Me=0;if(q)for(const We of q.keys())Me+=q.get(We)??0;let Pe=0;if(te&&f)for(const We of te.keys())Pe+=te.get(We)??0;se.current[ve]=Te*E*30,ne.current[ve]=Me*E*30,fe.current[ve]=Pe*E*30,ge.current[ve]=se.current[ve]+ne.current[ve]-fe.current[ve];const Ee=se.current.slice(0,ve+1).reduce((We,Ke)=>We+Ke,0);j(Ee);const Be=ne.current.slice(0,ve+1).reduce((We,Ke)=>We+Ke,0);k(Be);const Je=fe.current.slice(0,ve+1).reduce((We,Ke)=>We+Ke,0);F(Je),O(ge.current.slice(0,ve+1).reduce((We,Ke)=>We+Ke,0)),p(Ee),g(Be),y(Je),ht.getState().showSolarRadiationHeatmap||Tn.getState().clearDataStore()},[s]),m.useEffect(()=>{A({x:Math.max(l==null?void 0:l.x,P-window.innerWidth),y:Math.min(l==null?void 0:l.y,window.innerHeight-v)})},[l,P,v]),m.useEffect(()=>{const ve=()=>{A({x:Math.max(l==null?void 0:l.x,P-window.innerWidth),y:Math.min(l==null?void 0:l.y,window.innerHeight-v)})};return window.addEventListener("resize",ve),()=>{window.removeEventListener("resize",ve)}},[l,P,v]),m.useEffect(()=>(b.current&&(C.current||(C.current=new ResizeObserver(()=>{r(ve=>{b.current&&(ve.viewState.yearlyBuildingEnergyPanelRect||(ve.viewState.yearlyBuildingEnergyPanelRect=new cr(0,0,600,500)),ve.viewState.yearlyBuildingEnergyPanelRect.width=b.current.offsetWidth,ve.viewState.yearlyBuildingEnergyPanelRect.height=b.current.offsetHeight)})})),C.current.observe(b.current)),()=>{var ve;(ve=C.current)==null||ve.disconnect()}),[]);const Se=(ve,Ae)=>{A({x:Math.max(Ae.x,P-window.innerWidth),y:Math.min(Ae.y,window.innerHeight-v)})},ze=(ve,Ae)=>{r(Te=>{Te.viewState.yearlyBuildingEnergyPanelRect||(Te.viewState.yearlyBuildingEnergyPanelRect=new cr(0,0,600,360)),Te.viewState.yearlyBuildingEnergyPanelRect.x=Math.max(Ae.x,P-window.innerWidth),Te.viewState.yearlyBuildingEnergyPanelRect.y=Math.min(Ae.y,window.innerHeight-v)})},Ie=()=>{r(ve=>{ve.viewState.showYearlyBuildingEnergyPanel=!1,n&&(ve.actionInfo={name:"Close Yearly Building Energy Graph",timestamp:new Date().getTime()})})},ye=Y.t("word.Month",S),ce=Y.t("word.Energy",S),pe=X&&X[0]?Object.keys(X[0]).length===0:!0;return h.jsx(_i,{nodeRef:x,handle:".handle",bounds:"parent",axis:"both",position:T,onDrag:Se,onStop:ze,onMouseDown:()=>{r(ve=>{ve.selectedFloatingWindow="yearlyBuildingEnergyPanel"})},children:h.jsx(_Uo,{ref:x,style:{zIndex:w==="yearlyBuildingEnergyPanel"?Sc:9},children:h.jsxs(VUo,{ref:b,style:{opacity:o,width:(l?l.width:600)+"px",height:(l?l.height:400)+"px"},children:[h.jsxs(GUo,{className:"handle",style:{direction:"ltr"},children:[h.jsxs("span",{children:[Y.t("buildingEnergyPanel.YearlyBuildingEnergy",S)+": ",h.jsx("span",{style:{fontSize:"10px"},children:Y.t("sensorPanel.WeatherDataFrom",S)+" "+t+" | "+a.getFullYear()})]}),h.jsx("span",{style:{cursor:"pointer"},onTouchStart:()=>{Ie()},onMouseDown:()=>{Ie()},children:`${Y.t("word.Close",S)}`})]}),h.jsx(d0t,{type:vi.YearlyBuildingEnergy,dataSource:X,hasSolarPanels:f,labels:B,height:100,dataKeyAxisX:"Month",labelX:ye,labelY:ce,unitY:Y.t("word.kWh",S),yMin:0,curveType:"linear",fractionDigits:2,referenceX:M}),!d&&h.jsxs(en,{style:{alignSelf:"center",direction:"ltr"},children:[de.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.Heater",S)+": "+W.toFixed(0)}):h.jsx(Al,{content:de.current.map((ve,Ae)=>h.jsx("div",{children:ve},Ae)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.Heater",S)+": "+W.toFixed(0)})}),Z.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.AC",S)+": "+L.toFixed(0)}):h.jsx(Al,{content:Z.current.map((ve,Ae)=>h.jsx("div",{children:ve},Ae)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.AC",S)+": "+L.toFixed(0)})}),N!==0&&h.jsx(h.Fragment,{children:he.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.SolarPanel",S)+": "+N.toFixed(0)}):h.jsx(Al,{content:he.current.map((ve,Ae)=>h.jsx("div",{children:ve},Ae)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.SolarPanel",S)+": "+N.toFixed(0)})})}),xe.current.length===0?h.jsx(en,{style:{cursor:"default"},children:Y.t("buildingEnergyPanel.Net",S)+": "+U.toFixed(0)}):h.jsx(Al,{content:xe.current.map((ve,Ae)=>h.jsx("div",{children:ve},Ae)),children:h.jsx(en,{style:{cursor:"help"},children:Y.t("buildingEnergyPanel.Net",S)+": "+U.toFixed(0)})}),h.jsx(lo,{type:"default",icon:pe?h.jsx(Sh,{}):h.jsx(Hf,{}),title:Y.t(pe?"word.Run":"word.Update",S),onClick:()=>{const ve=H.getState().elements,Ae=H.getState().countElementsByType,Te=H.getState().getChildrenOfType,Me=AX(ve,Ae,Te);if(Me.status===ag.NO_BUILDING){hn(Y.t("analysisManager.NoBuildingForAnalysis",S));return}if(Me.status===ag.AT_LEAST_ONE_BAD_NO_GOOD){let Pe;switch(Me.buildingCompletion){case jc.WALL_DISJOINED:Pe=Y.t("message.WallsAreNotConnected",S);break;case jc.WALL_EMPTY:Pe=Y.t("message.BuildingContainsEmptyWall",S);break;case jc.ROOF_MISSING:Pe=Y.t("message.BuildingRoofMissing",S);break;default:Pe=Y.t("message.UnknownErrors",S)}po(Y.t("message.SimulationWillNotStartDueToErrors",S)+": "+Pe);return}Me.status===ag.AT_LEAST_ONE_BAD_AT_LEAST_ONE_GOOD&&SR(Y.t("message.SimulationWillStartDespiteWarnings",S)),hn(Y.t("message.SimulationStarted",S)),setTimeout(()=>{i(),ht.getState().set(Pe=>{Pe.runYearlyThermalSimulation=!0,Pe.pauseYearlyThermalSimulation=!1,Pe.simulationInProgress=!0}),r(Pe=>{n&&(Pe.actionInfo={name:"Run Yearly Building Energy Analysis",timestamp:new Date().getTime()})})},100)}}),h.jsx(lo,{type:"default",icon:h.jsx(Vu,{}),title:Y.t("word.SaveAsImage",S),onClick:()=>{kd("line-graph-"+ye+"-"+ce,"yearly-building-energy").then(()=>{hn(Y.t("message.ScreenshotSaved",S)),n&&r(ve=>{ve.actionInfo={name:"Take Screenshot of Yearly Building Energy Graph",timestamp:new Date().getTime()}})})}}),ae.current&&ae.current.length>0&&h.jsx(lo,{type:"default",icon:h.jsx(Mf,{}),title:Y.t("word.SaveAsCsv",S),onClick:()=>{bh(ae.current,"yearly-building-energy.csv"),hn(Y.t("message.CsvFileSaved",S)),n&&r(ve=>{ve.actionInfo={name:"Export Yearly Building Energy Result as CSV",timestamp:new Date().getTime()}})}})]})]})})})}),JUo=be.memo(({setDialogVisible:t})=>{const e=H(fn),n=H(En),o=H(k8t),r=H(L8t),[i,a]=m.useState(!1),[l,s]=m.useState(!1),[c,u]=m.useState({left:0,top:0,bottom:0,right:0}),d=m.useRef(null),f=m.useRef(null),p=m.useRef(o),g=m.useRef(r),y=Jt();m.useEffect(()=>{var A;(A=f.current)==null||A.focus()},[]);const w=(A,x)=>{if(d.current){const{clientWidth:S,clientHeight:R}=window.document.documentElement,M=d.current.getBoundingClientRect();u({left:-M.left+x.x,right:S-(M.right-x.x),top:-M.top+x.y,bottom:R-((M==null?void 0:M.bottom)-x.y)})}},b=A=>{e(x=>{x.minimumNavigationMoveSpeed=A}),ht.getState().set(x=>{x.navigationMoveSpeed=A})},C=A=>{e(x=>{x.minimumNavigationTurnSpeed=A}),ht.getState().set(x=>{x.navigationTurnSpeed=A})},P=()=>{const A=o,x=p.current;if(A!==x){const M={name:"Minimum Navigation Move Speed",timestamp:Date.now(),oldValue:A,newValue:x,undo:()=>{b(M.oldValue)},redo:()=>{b(M.newValue)}};n(M),b(x)}const S=r,R=g.current;if(S!==R){const M={name:"Minimum Navigation Turn Speed",timestamp:Date.now(),oldValue:S,newValue:R,undo:()=>{C(M.oldValue)},redo:()=>{C(M.newValue)}};n(M),C(R)}},v=()=>{t(!1)},T=()=>{P(),t(!1)};return h.jsxs(Oi,{width:500,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>s(!0),onMouseOut:()=>s(!1),children:`${Y.t("navigationPanel.NavigationParameters",y)}`}),footer:[h.jsx(lo,{onClick:v,children:`${Y.t("word.Cancel",y)}`},"Cancel"),h.jsx(lo,{type:"primary",ref:f,onClick:T,children:`${Y.t("word.OK",y)}`},"OK")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:A=>h.jsx(_i,{disabled:!l,bounds:c,onStart:(x,S)=>w(x,S),children:h.jsx("div",{ref:d,children:A})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:16,children:Y.t("navigationPanel.MinimumMoveSpeed",y)+" ([1, 10]): "}),h.jsx(nt,{className:"gutter-row",span:8,children:h.jsx(Mn,{min:1,max:10,style:{width:"100%"},precision:0,value:p.current,step:1,onChange:A=>{p.current=Number(A),a(!i)},onBlur:A=>{const x=A.target.value,S=parseFloat(x);p.current=Number.isNaN(S)?3:S,a(!i)},onPressEnter:A=>{const x=A.target.value,S=parseFloat(x);p.current=Number.isNaN(S)?3:S,a(!i)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:16,children:Y.t("navigationPanel.MinimumTurnSpeed",y)+" ([1, 5]): "}),h.jsx(nt,{className:"gutter-row",span:8,children:h.jsx(Mn,{min:1,max:5,style:{width:"100%"},precision:0,value:g.current,step:1,onChange:A=>{g.current=Number(A),a(!i)},onBlur:A=>{const x=A.target.value,S=parseFloat(x);g.current=Number.isNaN(S)?3:S,a(!i)},onPressEnter:A=>{const x=A.target.value,S=parseFloat(x);g.current=Number.isNaN(S)?3:S,a(!i)}})})]})]})}),KUo=be.memo(({setDialogVisible:t})=>{const e=H(fn),n=H(En),o=H(Uq),r=me.getShadowMapSize(),i=4096,a=1e4,[l,s]=m.useState(!1),[c,u]=m.useState(!1),[d,f]=m.useState({left:0,top:0,bottom:0,right:0}),p=m.useRef(null),g=m.useRef(null),y=m.useRef(o?Math.round(o)/a:1),w=m.useRef(r?Math.round(r/i):1),b=Jt();m.useEffect(()=>{var S;(S=g.current)==null||S.focus()},[]);const C=(S,R)=>{if(p.current){const{clientWidth:M,clientHeight:D}=window.document.documentElement,E=p.current.getBoundingClientRect();f({left:-E.left+R.x,right:M-(E.right-R.x),top:-E.top+R.y,bottom:D-((E==null?void 0:E.bottom)-R.y)})}},P=S=>{e(R=>{R.viewState.shadowCameraFar=S})},v=S=>{localStorage.setItem("aladdin-shadow-map-size",S.toString())},T=()=>{const S=o,R=y.current*a;if(S!==R){const E={name:"Shadow Camera Far Distance",timestamp:Date.now(),oldValue:S,newValue:R,undo:()=>{P(E.oldValue)},redo:()=>{P(E.newValue)}};n(E),P(R)}const M=r,D=w.current*i;if(M!==D){const E={name:"Shadow Map Size",timestamp:Date.now(),oldValue:M,newValue:D,undo:()=>{v(E.oldValue)},redo:()=>{v(E.newValue)}};n(E),v(D)}},A=()=>{t(!1)},x=()=>{T(),t(!1),window.location.reload()};return h.jsxs(Oi,{width:500,open:!0,title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>u(!0),onMouseOut:()=>u(!1),children:`${Y.t("shadowSettingsPanel.ShadowSettings",b)}`}),footer:[h.jsx(lo,{onClick:A,children:`${Y.t("word.Cancel",b)}`},"Cancel"),h.jsx(lo,{type:"primary",ref:g,onClick:x,children:`${Y.t("word.OK",b)}`},"OK")],onCancel:()=>{t(!1)},maskClosable:!1,destroyOnClose:!1,modalRender:S=>h.jsx(_i,{disabled:!c,bounds:d,onStart:(R,M)=>C(R,M),children:h.jsx("div",{ref:p,children:S})}),children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{className:"gutter-row",span:18,children:Y.t("shadowSettingsPanel.ShadowCameraFarDistance",b)+" ([1, 1000]×"+a+"): "}),h.jsx(nt,{className:"gutter-row",span:6,children:h.jsx(Mn,{min:1,max:1e3,style:{width:"100%"},precision:0,value:y.current,step:1,onChange:S=>{y.current=Number(S),s(!l)},onBlur:S=>{const R=S.target.value,M=parseFloat(R);y.current=Number.isNaN(M)?1:M,s(!l)},onPressEnter:S=>{const R=S.target.value,M=parseFloat(R);y.current=Number.isNaN(M)?1:M,s(!l)}})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"10px"},children:[h.jsx(nt,{className:"gutter-row",span:18,children:Y.t("shadowSettingsPanel.ShadowMapSize",b)+" ([1, 4]×"+i+"): "}),h.jsx(nt,{className:"gutter-row",span:6,children:h.jsx(Mn,{min:1,max:4,style:{width:"100%"},precision:0,value:w.current,step:1,onChange:S=>{w.current=Number(S),s(!l)},onBlur:S=>{const R=S.target.value,M=parseFloat(R);w.current=Number.isNaN(M)?1:M,s(!l)},onPressEnter:S=>{const R=S.target.value,M=parseFloat(R);w.current=Number.isNaN(M)?1:M,s(!l)}})})]}),h.jsx(on,{style:{fontSize:"10px"},children:h.jsxs(nt,{span:24,children:[Y.t("shadowSettingsPanel.Notes",b),":",h.jsx("br",{}),h.jsxs("ul",{children:[h.jsx("li",{children:Y.t("shadowSettingsPanel.RefreshPageNote",b)}),h.jsx("li",{children:Y.t("shadowSettingsPanel.MapSizeWarning",b)})]})]})})]})}),qUo=be.memo(()=>{const t=H(vge),e=H(jq),n=H(IBe),o=H(E4t),r=H(zBe),i=H(DBe),a=H(L4t),l=H(N4t),s=ht(D8t),c=ht(E8t),u=ht(F8t),d=ht(Ss),f=H(EBe),p=H(G4t),g=H(FBe),y=H($4t),w=H(Z4t),b=H(kBe),C=H(n8t),P=H(LBe),v=H(i8t),T=H(WBe),A=H(s8t),x=H(NBe),S=H(d8t),R=H(UBe),M=H(p8t),D=H(B4t),E=H(O4t),W=H(m8t),j=H(SW),L=H(Tc),k=H(Sb),N=H(_Ye),F=H(OYe),U=H(Bge),O=H(Nq)??!1,[B,_]=m.useState("Boston MA, USA");return m.useEffect(()=>{if(Object.keys(U).length===0)return;const X=N(L,k)??"Boston MA, USA";_(X),F(X)},[L,k,U]),h.jsxs(h.Fragment,{children:[o&&h.jsx(kAo,{}),r&&h.jsx(UAo,{}),i&&h.jsx(dNo,{}),t&&h.jsx(FNo,{}),e&&h.jsx(HNo,{}),(n||O)&&!j&&h.jsx(pNo,{}),a&&h.jsx(QEo,{city:B,graphs:[vi.MonthlyTemperatures,vi.SunshineHours]}),l&&h.jsx(HUo,{city:B}),s&&h.jsx(NUo,{setDialogVisible:X=>{ht.getState().set($=>{$.showEconomicsPanel=X})}}),c&&h.jsx(JUo,{setDialogVisible:X=>{ht.getState().set($=>{$.showNavigationPanel=X})}}),u&&h.jsx(KUo,{setDialogVisible:X=>{ht.getState().set($=>{$.showShadowSettings=X})}}),p&&h.jsx(nFo,{city:B}),f&&h.jsx(aNo,{city:B}),y&&h.jsx(ANo,{city:B}),g&&h.jsx(bNo,{city:B}),w&&h.jsx(BNo,{}),C&&h.jsx(VNo,{city:B}),b&&h.jsx(KNo,{city:B}),v&&h.jsx(oUo,{city:B}),P&&h.jsx(ZNo,{city:B}),T&&h.jsx(lUo,{city:B}),A&&h.jsx(dUo,{city:B}),x&&h.jsx(gUo,{city:B}),S&&h.jsx(wUo,{city:B}),R&&h.jsx(TUo,{city:B}),M&&h.jsx(DUo,{city:B}),D&&h.jsx(OUo,{city:B}),E&&h.jsx(XUo,{city:B}),d&&h.jsx(WNo,{}),W&&h.jsx(WUo,{})]})});class cl{static computeSolarPanelOutput(e,n,o,r,i,a,l,s,c){const u=i.parentType===z.Roof,d=i.parentType===z.Wall;u&&(a=l);const f=d?me.absoluteCoordinates(i.cx,i.cy,i.cz,a,l,i.lz):me.absoluteCoordinates(i.cx,i.cy,i.cz,a,void 0,void 0,!0),p=a.rotation[2];let g=i.tiltAngle,y=p+i.relativeAzimuth,w=!0;if(u&&(f.z=i.cz+i.lz+.02+a.cz,me.isZero(i.rotation[0])?f.z+=i.poleHeight:(g=i.rotation[0],y=p,w=!1)),d&&!me.isZero(i.tiltAngle)){const Q=a,q=(l?l.rotation[2]+Q.relativeAngle:Q.relativeAngle)-Gt,te=i.ly*Math.abs(Math.sin(i.tiltAngle))/2;f.x+=te*Math.cos(q),f.y+=te*Math.sin(q)}const b=new ie().fromArray(i.normal),C=e.getMonth(),P=me.dayOfYear(e),v=n.solarRadiationHeatmapGridCellSize??.5;let T,A,x,S,R;n.discretization===Fm.EXACT?(T=i.lx,A=i.ly,i.orientation===vr.portrait?(x=Math.max(1,Math.round(i.lx/r.width)),S=Math.max(1,Math.round(i.ly/r.length)),x*=r.n,S*=r.m):(x=Math.max(1,Math.round(i.lx/r.length)),S=Math.max(1,Math.round(i.ly/r.width)),x*=r.m,S*=r.n),R=i.lx/x):(T=i.lx,A=i.ly,x=Math.max(2,Math.round(i.lx/v)),S=Math.max(2,Math.round(i.ly/v)),x%2!==0&&(x+=1),S%2!==0&&(S+=1),R=v);const M=T/x,D=A/S,E=f.x-(T-R)/2,W=f.y-(A-R)/2,j=u||d?f.z:a.lz+i.poleHeight+i.lz,L=new Xt(f.x,f.y),k=new ie,N=Array.from(Array(x),()=>new Array(S));let F=new nn(u&&!w?0:g,0,y,"ZYX");if(i.trackerType!==za.NO_TRACKER){const Q=p?o.clone().applyAxisAngle(Io,-p):o.clone();switch(i.trackerType){case za.ALTAZIMUTH_DUAL_AXIS_TRACKER:{const le=new bs().setFromUnitVectors(Io,Q);F=new nn().setFromQuaternion(le),F.z+=y;break}case za.HORIZONTAL_SINGLE_AXIS_TRACKER:{const le=new bs().setFromUnitVectors(Io,new ie(Q.x,0,Q.z).normalize());F=new nn().setFromQuaternion(le),F.z+=y;break}case za.VERTICAL_SINGLE_AXIS_TRACKER:{const le=new ie(Q.x,-Q.y,0).normalize(),q=Math.acos(Oc.dot(le))*Math.sign(le.x);F=new nn(i.tiltAngle,0,q+p,"ZYX");break}case za.TILTED_SINGLE_AXIS_TRACKER:break}}b.applyEuler(F),u&&!w&&(F.x=i.rotation[0],F.z=i.rotation[2]+p),d&&(F.x=Gt+i.tiltAngle,F.z=a.relativeAngle+p);const U=Ri(o,P,s,yi.SPHERE_MODEL),O=ni(n.ground,C,b,U),B=b.dot(o),_=new Xt,X=new ie;for(let Q=0;Q0&&(_.set(E+Q*M,W+le*D),X.set(_.x-L.x,_.y-L.y,0),X.applyEuler(F),k.set(f.x+X.x,f.y+X.y,j+X.z),c(i.id,k,o)<0&&(N[Q][le]+=B*U));let $=0;switch(r.shadeTolerance){case Fv.NONE:{let Q=Number.MAX_VALUE;for(let le=0;leArray(b).fill(0)),N=Array(w).fill(0).map(()=>Array(b).fill(0));let F;for(let U=0;U0)for(const Q of a){if(Q.type!==z.Window)continue;const le=Q.cx*r.lx,q=Q.cz*r.lz,te=Q.lx*r.lx/2,re=Q.lz*r.lz/2,ae=Q;if(ae.windowType===Ti.Arched){const se=T.clone().add(new ie(ae.cx*r.lx,0,ae.cz*r.lz));cl.pointWithinArch(R,ae.lx,ae.lz,ae.archHeight,se)&&(F=!1)}else if(X.x>=le-te&&X.x=q-re&&X.y0)for(const Q of l){if(Q.type!==z.Door)continue;const le=Q.cx*r.lx,q=Q.cz*r.lz,te=Q.lx*r.lx/2,re=Q.lz*r.lz/2,ae=Q;if(ae.doorType===Pd.Arched){const se=T.clone().add(new ie(ae.cx*r.lx,0,ae.cz*r.lz));cl.pointWithinArch(R,ae.lx,ae.lz,ae.archHeight,se)&&(F=!1)}else if(X.x>=le-te&&X.x=q-re&&X.y0)for(const Q of s){const le=Q.cx*r.lx,q=Q.cz*r.lz,te=Q.lx/2,re=Q.ly/2;if(X.x>=le-te&&X.x=q-re&&X.yl6||le<0)&&Q&&(k[U][O]+=j),L>0&&le<0&&(N[U][O]+=L*W,Q&&(k[U][O]+=L*W))}}}return{intensity:k,unitArea:C*P,heatmap:N}}static computeDoorSolarRadiationEnergy(e,n,o,r,i,a,l,s){const c=me.dayOfYear(e),u=n.solarRadiationHeatmapGridCellSize??.5,d=r.lx*i.lx,f=r.lz*i.lz,p=Math.max(2,Math.round(d/u)),g=Math.max(2,Math.round(f/u)),y=d/p,w=f/g,b=a.rotation[2]+i.relativeAngle,P=me.wallAbsolutePosition(new ie(i.cx,i.cy,i.cz),a).setZ(i.lz/2+a.lz).clone().add(new ie(r.cx*i.lx,0,r.cz*i.lz)),v=new ie(Math.cos(b-Gt),Math.sin(b-Gt),0),T=y*Math.cos(b),A=y*Math.sin(b),x=new ie,S=Ri(o,c,l,yi.SPHERE_MODEL),R=ni(n.ground,e.getMonth(),v,S),M=v.dot(o),D=Array(p).fill(0).map(()=>Array(g).fill(0));if(r.doorType===Pd.Arched)for(let E=0;E0&&s(r.id,x,o)<0&&(D[E][W]+=M*S))}else for(let E=0;E0){const j=E-p/2+.5,L=W-g/2+.5;x.set(P.x+j*T,P.y+j*A,P.z+L*w),s(r.id,x,o)<0&&(D[E][W]+=M*S)}return{intensity:D,unitArea:y*w}}static pointWithinArch(e,n,o,r,i){if(r>0){const a=.5*n,l=Math.min(r,o,a),s=.5*(l+a*a/l),c=e.x-i.x,u=e.y-i.y,d=c*c+u*u;let f=e.z-i.z;return d-o/2?!0:(f=e.z-(o-s),d+f*fArray(g).fill(0));if(r.windowType===Ti.Arched)for(let E=0;E0&&s(r.id,x,o)<0&&(D[E][W]+=M*S))}else for(let E=0;E0){const j=E-p/2+.5,L=W-g/2+.5;x.set(P.x+j*T,P.y+j*A,P.z+L*w),s(r.id,x,o)<0&&(D[E][W]+=M*S)}return{intensity:D,unitArea:y*w}}static computeRoofWindowSolarRadiationEnergy(e,n,o,r,i,a,l,s){const c=me.dayOfYear(e),u=n.solarRadiationHeatmapGridCellSize??.5,d=r.lx,f=r.lz,p=Math.max(2,Math.round(d/u)),g=Math.max(2,Math.round(f/u)),y=d/p,w=f/g,b=new ie(r.cx,r.cy,r.cz).applyEuler(new nn(0,0,a.rotation[2]));b.x+=a.cx,b.y+=a.cy,b.z+=a.lz;const C=new nn(r.rotation[0],r.rotation[1],r.rotation[2]+a.rotation[2],"ZXY"),P=new ie(0,0,1).applyEuler(C),v=new ie,T=Ri(o,c,l,yi.SPHERE_MODEL),A=ni(n.ground,e.getMonth(),P,T),x=P.dot(o),S=Array(p).fill(0).map(()=>Array(g).fill(0));if(r.windowType===Ti.Arched)for(let R=0;R0&&s(r.id,v,o)<0&&(S[R][M]+=x*T))}else for(let R=0;R0){const D=R-p/2+.5,E=M-g/2+.5,W=new ie(D,E,0);W.applyEuler(C),v.set(b.x+W.x,b.y+W.y,b.z+W.z),s(r.id,v,o)<0&&(S[R][M]+=x*T)}return{intensity:S,unitArea:y*w}}static computePyramidRoofSolarRadiationEnergy(e,n,o,r,i,a,l,s,c,u,d,f){if(i)return cl.computeFlatRoofSolarRadiationEnergy(e,n,o,r,a,l,s,c,u,d,f);const p=n.solarRadiationHeatmapGridCellSize??.5,g=me.dayOfYear(e),y=new nn(0,0,s.rotation[2],"ZYX"),w=Ri(o,g,d,yi.SPHERE_MODEL),b=[],C=[];for(const[P,v]of l.entries()){const T=r.id+"-"+P,A=v[0].clone().applyEuler(y),x=v[1].clone().applyEuler(y),S=v[2].clone().applyEuler(y),R=new ie().subVectors(x,A),M=new ie().subVectors(S,A),D=new ie().subVectors(S,x),E=R.length(),W=new ie().crossVectors(M,D).length()/E,j=Math.max(2,Math.round(E/p)),L=Math.max(2,Math.round(W/p)),k=Array(j).fill(0).map(()=>Array(L).fill(0));b.push(k),R.normalize();const N=j*M.dot(R)/E;M.normalize(),D.normalize();const F=new ie().crossVectors(M,D).normalize(),U=R.multiplyScalar(.5*E/j),O=new ie().crossVectors(F,R).normalize().multiplyScalar(.5*W/L),B=new ie(s.cx+A.x,s.cy+A.y,s.lz+A.z+L0+(a?r.thickness:0));B.add(U).add(O),U.multiplyScalar(2),O.multiplyScalar(2),C.push(U.length()*O.length());const _=new ie,X=[],$=.01;X.push({x:-$,y:-$}),X.push({x:j+$,y:-$}),X.push({x:N,y:L+$});const Q=ni(n.ground,e.getMonth(),F,w),le=F.dot(o);for(let q=0;ql6||se<0)&&(k[q][re]+=Q),le>0&&se<0&&(k[q][re]+=le*w)}}}}return{segmentIntensities:b,segmentUnitArea:C}}static computeHipRoofSolarRadiationEnergy(e,n,o,r,i,a,l,s,c,u,d,f){if(i)return cl.computeFlatRoofSolarRadiationEnergy(e,n,o,r,a,l,s,c,u,d,f);const p=me.dayOfYear(e),g=n.solarRadiationHeatmapGridCellSize??.5,y=new nn(0,0,s.rotation[2],"ZYX"),w=Ri(o,p,d,yi.SPHERE_MODEL),b=[],C=[];for(const[P,v]of l.entries()){const T=r.id+"-"+P,A=v[0].clone().applyEuler(y),x=v[1].clone().applyEuler(y),S=v[2].clone().applyEuler(y),R=new ie().subVectors(x,A),M=new ie().subVectors(S,A),D=new ie().subVectors(S,x),E=R.length(),W=new ie().crossVectors(M,D).length()/E,j=Math.max(2,Math.round(E/g)),L=Math.max(2,Math.round(W/g)),k=Array(j).fill(0).map(()=>Array(L).fill(0));b.push(k),R.normalize();const N=j*M.dot(R)/E;M.normalize(),D.normalize();const F=new ie().crossVectors(M,D).normalize(),U=R.multiplyScalar(.5*E/j),O=new ie().crossVectors(F,R).normalize().multiplyScalar(.5*W/L),B=new ie,_=new ie(s.cx+A.x,s.cy+A.y,s.lz+A.z+L0+(a?r.thickness:0));_.add(U).add(O),U.multiplyScalar(2),O.multiplyScalar(2),C.push(U.length()*O.length());const X=ni(n.ground,e.getMonth(),F,w),$=F.dot(o),Q=[];for(const le of v)Q.push({x:le.x,y:le.y});if(P%2===0)for(let le=0;lel6||ae<0)&&(k[le][te]+=X),$>0&&ae<0&&(k[le][te]+=$*w)}}}else{const le=[];le.push({x:-.01,y:-.01}),le.push({x:j+.01,y:-.01}),le.push({x:N,y:L+.01});for(let te=0;tel6||ne<0)&&(k[te][ae]+=X),$>0&&ne<0&&(k[te][ae]+=$*w)}}}}}return{segmentIntensities:b,segmentUnitArea:C}}static computeGambrelRoofSolarRadiationEnergy(e,n,o,r,i,a,l,s,c,u,d,f){if(i)return cl.computeFlatRoofSolarRadiationEnergy(e,n,o,r,a,l,s,c,u,d,f);const p=me.dayOfYear(e),g=n.solarRadiationHeatmapGridCellSize??.5,y=new nn(0,0,s.rotation[2],"ZYX"),w=Ri(o,p,d,yi.SPHERE_MODEL),b=[],C=[];for(const[P,v]of l.entries()){const T=r.id+"-"+P,A=v[0].clone().applyEuler(y),x=v[1].clone().applyEuler(y),S=v[2].clone().applyEuler(y),R=new ie().subVectors(x,A),M=new ie().subVectors(S,A),D=new ie().subVectors(S,x),E=R.length(),W=new ie().crossVectors(M,D).length()/E,j=Math.max(2,Math.round(E/g)),L=Math.max(2,Math.round(W/g)),k=Array(j).fill(0).map(()=>Array(L).fill(0));b.push(k),R.normalize(),M.normalize(),D.normalize();const N=new ie().crossVectors(M,D).normalize(),F=R.multiplyScalar(.5*E/j),U=new ie().crossVectors(N,R).normalize().multiplyScalar(.5*W/L),O=new ie(s.cx+A.x,s.cy+A.y,s.lz+A.z+L0+(a?r.thickness:0));O.add(F).add(U),F.multiplyScalar(2),U.multiplyScalar(2),C.push(F.length()*U.length());const B=new ie,_=ni(n.ground,e.getMonth(),N,w),X=N.dot(o);for(let $=0;$l6||q<0)&&(k[$][le]+=_),X>0&&q<0&&(k[$][le]+=X*w)}}}return{segmentIntensities:b,segmentUnitArea:C}}static computeMansardRoofSolarRadiationEnergy(e,n,o,r,i,a,l,s,c,u,d,f){if(i)return cl.computeFlatRoofSolarRadiationEnergy(e,n,o,r,a,l,s,c,u,d,f);const p=me.dayOfYear(e),g=n.solarRadiationHeatmapGridCellSize??.5,y=new nn(0,0,s.rotation[2],"ZYX"),w=Ri(o,p,d,yi.SPHERE_MODEL),b=[],C=[];for(const[P,v]of l.entries()){const T=r.id+"-"+P;if(P===l.length-1){let A=Number.MAX_VALUE,x=Number.MAX_VALUE,S=-Number.MAX_VALUE,R=-Number.MAX_VALUE;for(const O of v){const B=O.clone().applyEuler(y);B.x>S&&(S=B.x),B.xR&&(R=B.y),B.yArray(E).fill(0));b.push(L);const k=new ie(A+g/2,x+g/2,s.lz+M+L0+(a?r.thickness:0)),N=new ie(0,0,k.z),F=ni(n.ground,e.getMonth(),Io,w),U=Io.dot(o);for(let O=0;Ol6||_<0)&&(L[O][B]+=F),U>0&&_<0&&(L[O][B]+=U*w)}}}else{const A=v[0].clone().applyEuler(y),x=v[1].clone().applyEuler(y),S=v[2].clone().applyEuler(y),R=new ie().subVectors(x,A),M=new ie().subVectors(S,A),D=new ie().subVectors(S,x),E=R.length(),W=new ie().crossVectors(M,D).length()/E,j=Math.max(2,Math.round(E/g)),L=Math.max(2,Math.round(W/g)),k=Array(j).fill(0).map(()=>Array(L).fill(0));b.push(k),R.normalize(),M.normalize(),D.normalize();const N=new ie().crossVectors(M,D).normalize(),F=R.multiplyScalar(.5*E/j),U=new ie().crossVectors(N,R).normalize().multiplyScalar(.5*W/L),O=new ie(s.cx+A.x,s.cy+A.y,s.lz+A.z+L0+(a?r.thickness:0));O.add(F).add(U),F.multiplyScalar(2),U.multiplyScalar(2),C.push(F.length()*U.length());const B=new ie,_=ni(n.ground,e.getMonth(),N,w),X=N.dot(o);for(let $=0;$l6||q<0)&&(k[$][le]+=_),X>0&&q<0&&(k[$][le]+=X*w)}}}}return{segmentIntensities:b,segmentUnitArea:C}}static computeFlatRoofSolarRadiationEnergy(e,n,o,r,i,a,l,s,c,u,d){const f=me.dayOfYear(e),p=n.solarRadiationHeatmapGridCellSize??.5,g=new nn(0,0,l.rotation[2],"ZYX"),y=Ri(o,f,u,yi.SPHERE_MODEL),w=[],b=[];let C=Number.MAX_VALUE,P=Number.MAX_VALUE,v=-Number.MAX_VALUE,T=-Number.MAX_VALUE;for(const k of a)for(const N of k){const F=N.clone().applyEuler(g);F.x>v&&(v=F.x),F.xT&&(T=F.y),F.yArray(x).fill(0));w.push(M),b.push(S*R);const D=a[0][0].z,E=new ie(C+p/2,P+p/2,l.lz+D+L0+(i?r.thickness:0)),W=new ie(0,0,E.z),j=ni(n.ground,e.getMonth(),Io,y),L=Io.dot(o);for(let k=0;kl6||F<0)&&(M[k][N]+=j),L>0&&F<0&&(M[k][N]+=L*y)}}return{segmentIntensities:w,segmentUnitArea:b}}static computeGableRoofSolarRadiationEnergy(e,n,o,r,i,a,l,s,c,u,d){const f=me.dayOfYear(e),p=n.solarRadiationHeatmapGridCellSize??.5,g=new nn(0,0,l.rotation[2],"ZYX"),y=Ri(o,f,u,yi.SPHERE_MODEL),w=[],b=[];for(const[C,P]of a.entries()){const v=r.id+"-"+C,T=P[0].clone().applyEuler(g),A=P[1].clone().applyEuler(g),x=P[2].clone().applyEuler(g),S=new ie().subVectors(A,T),R=new ie().subVectors(x,T),M=new ie().subVectors(x,A),D=S.length(),E=new ie().crossVectors(R,M).length()/D,W=Math.max(2,Math.round(D/p)),j=Math.max(2,Math.round(E/p)),L=Array(W).fill(0).map(()=>Array(j).fill(0));w.push(L),S.normalize(),R.normalize(),M.normalize();const k=new ie().crossVectors(R,M).normalize(),N=S.multiplyScalar(.5*D/W),F=new ie().crossVectors(k,S).normalize().multiplyScalar(.5*E/j),U=new ie(l.cx+T.x,l.cy+T.y,l.lz+T.z+L0+(i?r.thickness:0));U.add(N).add(F),N.multiplyScalar(2),F.multiplyScalar(2),b.push(N.length()*F.length());const O=new ie,B=ni(n.ground,e.getMonth(),k,y),_=k.dot(o);for(let X=0;Xl6||le<0)&&(L[X][Q]+=B),_>0&&le<0&&(L[X][Q]+=_*y)}}}return{segmentIntensities:w,segmentUnitArea:b}}static isPointRoof(e,n,o,r){if(n&&n.length>0)for(const i of n){const a=Cn.getAbsoluteWindowVerticesOnRoof(i,r),l=me.getPoints(a);if(me.isPointInside(e.x,e.y,l))return!1}if(o&&o.length>0)for(const i of o){const a=Cn.getAbsoluteSolarPanelVerticesOnRoof(i,r),l=me.getPoints(a);if(me.isPointInside(e.x,e.y,l))return!1}return!0}}const $Uo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(pA),r=H(qr),i=H(l3),a=H(t5),l=Tn(Cge),s=Tn(dW),c=Tn(Hge),u=Tn(U8t),d=Tn(B8t),f=Tn(O8t),p=H(da),g=ht(hW),y=ht(Pwt),w=ht(Oq),b=ht(Cwt),C=H.getState().world,P=H.getState().elements,v=C.noAnimationForThermalSimulation,T=C.highestTemperatureTimeInMinutes??900,A=m.useRef(0),x=m.useRef(!1),S=m.useRef(new Date(C.date)),R=m.useRef(0),M=m.useRef(!1),D=m.useRef(new Date(C.date)),E=m.useRef(0),W=m.useRef({high:20,low:0}),j=m.useRef(20),L=m.useRef(20),k=m.useRef(new Map),N=m.useRef(new Map),F=m.useRef(new Map),U=m.useRef([]),O=m.useRef([]),B=m.useRef(),_=m.useRef(),X=m.useRef(0),$=m.useRef(new Map),Q=Jt(),le=f1(t),q=new Date(C.date),te=t?le==null?void 0:le.elevation:0,re=C.monthlyIrradianceLosses??new Array(12).fill(.05),ae=C.timesPerHour??4,se=60/ae,ne=C.daysPerYear??6,fe=12/ne,{scene:ge}=oi(),de=m.useMemo(()=>new l0,[]),Z=()=>a9(1,Bye(q),pN(q),me.toRadians(C.latitude)).normalize(),he=(Oe,Ze,St)=>{if(U.current.length>1){O.current.length=0,de.set(Ze,St);const Pt=U.current.filter(Rt=>Rt.uuid!==Oe);if(de.intersectObjects(Pt,!1,O.current),O.current.length>0)return O.current[0].distance}return-1},xe=()=>{const Oe=ge.children.filter(Ze=>Ze.name==="Content");if(Oe.length>0){const Ze=Oe[0].children;U.current.length=0;for(const St of Ze)me.fetchSimulationElements(St,U.current)}},He=Oe=>{if(le){W.current=Qx(q,le.lowestTemperatures,le.highestTemperatures);const Ze=me.minutesIntoDay(Oe);j.current=$x(W.current.high,W.current.low,C.diurnalTemperatureModel??y2.Sinusoidal,T,dl(Oe,C.latitude),Ze),L.current=gZe(C.latitude,me.dayOfYear(q),Ze,le.lowestTemperatures,le.highestTemperatures,T,.5*(W.current.high-W.current.low),C.ground.thermalDiffusivity??.05,eje)}},Se=(Oe,Ze)=>{let St=k.current.get(Oe);St||(St=new Array(24).fill(0),k.current.set(Oe,St)),St[q.getHours()]+=Ze},ze=(Oe,Ze)=>{let St=N.current.get(Oe);St||(St=new Array(24).fill(0),N.current.set(Oe,St)),St[q.getHours()]+=Ze},Ie=(Oe,Ze)=>{let St=F.current.get(Oe);St||(St=new Array(24).fill(0),F.current.set(Oe,St)),St[q.getHours()]+=Ze},ye=()=>{var Oe,Ze,St,Pt;for(const Rt of P){if(me.onBuildingEnvelope(Rt)&&((Oe=k.current.get(Rt.id))==null||Oe.fill(0)),Rt.type===z.Roof)for(const Ut of k.current.keys())Ut!==Rt.id&&Ut.startsWith(Rt.id)&&((Ze=k.current.get(Ut))==null||Ze.fill(0));Rt.type===z.Foundation&&((St=N.current.get(Rt.id))==null||St.fill(0),(Pt=F.current.get(Rt.id))==null||Pt.fill(0))}},ce=()=>{$.current.clear()};m.useEffect(()=>{if(g)if(v&&!me.hasMovingParts(P))pe();else return xe(),ve(),A.current=requestAnimationFrame(Te),()=>{cancelAnimationFrame(A.current),x.current||(hn(Y.t("message.SimulationAborted",Q)),e(Oe=>{Oe.world.date=S.current.toLocaleString("en-US")}),ht.getState().set(Oe=>{Oe.simulationInProgress=!1,Oe.simulationPaused=!1})),M.current=!1}},[g]),m.useEffect(()=>{M.current=y,y?(D.current=new Date(q.getTime()),cancelAnimationFrame(A.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",Q))):(n("simulationPaused",!1),q.setHours(q.getHours(),q.getMinutes()+se),Te())},[y]);const pe=()=>{Je()},ve=()=>{M.current?(q.setTime(D.current.getTime()),M.current=!1):(S.current=new Date(C.date),E.current=me.dayOfYear(q),q.setHours(0,se/2)),x.current=!1,ye(),ce()},Ae=()=>{for(const Oe of P){if(me.onBuildingEnvelope(Oe)||Oe.type===z.SolarPanel){const Ze=k.current.get(Oe.id);Ze&&u(Oe.id,[...Ze]);const St=$.current.get(Oe.id);St&&l(Oe.id,St.map(Pt=>[...Pt]))}if(Oe.type===z.Roof){for(const Ze of k.current.keys())if(Ze!==Oe.id&&Ze.startsWith(Oe.id)){const St=k.current.get(Ze);St&&u(Ze,[...St]);const Pt=$.current.get(Ze);Pt&&l(Ze,Pt.map(Rt=>[...Rt]))}}if(Oe.type===z.Foundation){let Ze=N.current.get(Oe.id);Ze&&d(Oe.id,[...Ze]),Ze=F.current.get(Oe.id),Ze&&f(Oe.id,[...Ze])}}ht.getState().set(Oe=>{Oe.flagOfDailySimulation=!Oe.flagOfDailySimulation,Oe.runYearlyThermalSimulation||(Oe.showSolarRadiationHeatmap=!0,Oe.showHeatFluxes=!0)}),p&&!w&&setTimeout(()=>{e(Oe=>{const Ze=Tn.getState().totalBuildingHeater,St=Tn.getState().totalBuildingAc,Pt=Tn.getState().totalBuildingSolarPanel;Oe.actionInfo={name:"Daily Building Energy Analysis Completed",result:{Heater:Ze.toFixed(2),AC:St.toFixed(2),SolarPanel:Pt.toFixed(2),Net:(Ze+St-Pt).toFixed(2)},timestamp:new Date().getTime()}})},10)},Te=()=>{if(g&&!M.current){if(q.getMinutes()+q.getHours()*60+(me.dayOfYear(q)-E.current)*T2+se>T2){Je(),cancelAnimationFrame(A.current),e(Ze=>{Ze.world.date=S.current.toLocaleString("en-US"),Ze.viewState.showDailyBuildingEnergyPanel=!0,Ze.selectedFloatingWindow="dailyBuildingEnergyPanel"}),ht.getState().set(Ze=>{Ze.runDailyThermalSimulation=!1,Ze.simulationPaused=!1,Ze.simulationInProgress=!1}),hn(Y.t("message.SimulationCompleted",Q)),x.current=!0,Ae();return}e(Ze=>{Ze.world.date=q.toLocaleString("en-US")}),Je(),A.current=requestAnimationFrame(Te),q.setHours(q.getHours(),q.getMinutes()+se)}},[Me,Pe]=m.useState(q.getMonth());m.useEffect(()=>{setTimeout(()=>{xe()},200)},[Me]),m.useEffect(()=>{if(w)if(ht.getState().set(Oe=>{Oe.showSolarRadiationHeatmap=!1,Oe.showHeatFluxes=!1}),v&&!me.hasMovingParts(P))setTimeout(()=>{},50);else return Ee(),Pe(q.getMonth()),xe(),A.current=requestAnimationFrame(Be),()=>{cancelAnimationFrame(A.current),x.current||(hn(Y.t("message.SimulationAborted",Q)),e(Oe=>{Oe.world.date=S.current.toLocaleString("en-US")}),ht.getState().set(Oe=>{Oe.simulationInProgress=!1,Oe.simulationPaused=!1})),M.current=!1}},[w]),m.useEffect(()=>{M.current=b,b?(D.current=new Date(q.getTime()),cancelAnimationFrame(A.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",Q))):(n("simulationPaused",!1),q.setHours(q.getHours(),q.getMinutes()+se),Be())},[b]);const Ee=()=>{M.current?(q.setTime(D.current.getTime()),M.current=!1):(S.current=new Date(C.date),R.current=0,q.setMonth(0,22),E.current=me.dayOfYear(q),q.setHours(0,se/2),e(Oe=>{Oe.viewState.showYearlyBuildingEnergyPanel=!0,Oe.selectedFloatingWindow="yearlyBuildingEnergyPanel",Oe.world.date=q.toLocaleString("en-US")})),ye(),ce(),x.current=!1},Be=()=>{w&&!M.current&&(q.getMinutes()+q.getHours()*60+(me.dayOfYear(q)-E.current)*T2{Ze.world.date=q.toLocaleString("en-US")}),Je(),q.setHours(q.getHours(),q.getMinutes()+se),A.current=requestAnimationFrame(Be)):(Ae(),R.current++,R.current===ne?(cancelAnimationFrame(A.current),setTimeout(()=>{e(Ze=>{Ze.world.date=S.current.toLocaleString("en-US")})},10),ht.getState().set(Ze=>{Ze.runYearlyThermalSimulation=!1,Ze.simulationInProgress=!1,Ze.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",Q)),x.current=!0,p&&setTimeout(()=>{e(Ze=>{const St=Tn.getState().totalBuildingHeater,Pt=Tn.getState().totalBuildingAc,Rt=Tn.getState().totalBuildingSolarPanel;Ze.actionInfo={name:"Yearly Building Energy Analysis Completed",result:{Heater:St.toFixed(2),AC:Pt.toFixed(2),SolarPanel:Rt.toFixed(2),Net:(St+Pt-Rt).toFixed(2)},timestamp:new Date().getTime()}})},10)):(q.setMonth(R.current*fe,22),q.setHours(0,se/2),Pe(q.getMonth()),E.current=me.dayOfYear(q),ye(),ce(),A.current=requestAnimationFrame(Be))))},Je=()=>{He(q),_.current=dl(q,C.latitude);const Oe=_.current.daylight()/60;X.current=Oe>It?le.sunshineHours[q.getMonth()]/(30*Oe*ae):0,B.current=Z();for(const Ze of P)switch(Ze.type){case z.Door:{it(Ze);break}case z.Window:{ke(Ze),Ye(Ze);break}case z.Wall:{Ve(Ze);break}case z.Roof:{const St=Ze;Xe(St),yt(St);break}case z.SolarPanel:{De(Ze);break}}},We=(Oe,Ze)=>{let St=Ze.efficiency;return Ze.cellType==="Monocrystalline"&&(St*=.95),St*(1+Ze.pmaxTC*(Oe-25))},Ke=()=>{if(!_.current)throw new Error("sun minutes not set");const Oe=_.current.daylight()/60;return Oe>It?le.sunshineHours[q.getMonth()]/(30*Oe*ae):0},Ne=Oe=>{if(!a(Oe.pvModelName))throw new Error("PV model not found");return Oe.lx*Oe.ly*(Oe.inverterEfficiency??.95)*(1-re[q.getMonth()])},De=Oe=>{const Ze=o(Oe);if(Ze){const St=r(Oe);if(St){const Pt=a(Oe.pvModelName);if(B.current&&B.current.z>0){const Rt=cl.computeSolarPanelOutput(q,C,B.current,Pt,Oe,St,Ze,te,he),Ut=We(j.current,Pt)*Ke()*Ne(Oe);if(Ie(Ze.id,Rt.average*Ut),g){for(let At=0;At{var St;if(Oe.interior)return;const Ze=o(Oe);if(Ze){const Pt=r(Oe);if(Pt){const Rt=((St=Ze.hvacSystem)==null?void 0:St.thermostatSetpoint)??20,Ut=me.getWindowArea(Oe,Oe.parentType===z.Roof?void 0:Pt),Ht=j.current-Rt;Oe.empty?Se(Oe.id,Ht*Ut*vO*.001/ae):Se(Oe.id,Ht*Ut*(Oe.uValue??V4)*.001/ae)}}},Ye=Oe=>{if(Oe.interior)return;const Ze=o(Oe);if(Ze){const St=r(Oe);if(St){let Pt=0;if(Oe.parentType===z.Roof){const Rt=s(St.id);if(!Rt)return;for(let Ut=0;Ut0){const Ht=cl.computeRoofWindowSolarRadiationEnergy(q,C,B.current,Oe,St,Ze,te,he);for(let At=0;At0){const Rt=cl.computeWallWindowSolarRadiationEnergy(q,C,B.current,Oe,St,Ze,te,he);for(let Ut=0;Ut{var St;if(Oe.interior)return;const Ze=o(Oe);if(Ze){const Pt=r(Oe);if(Pt){const Rt=((St=Ze.hvacSystem)==null?void 0:St.thermostatSetpoint)??20,Ut=me.getDoorArea(Oe,Pt);if(Oe.filled){const Ht=K7(Oe);let At=0;if(B.current&&B.current.z>0){const dt=cl.computeDoorSolarRadiationEnergy(q,C,B.current,Oe,Pt,Ze,te,he);for(let Ct=0;Ct{var St;const Ze=o(Oe);if(Ze){const Pt=Oe.fill!==El.Empty&&Oe.wallStructure===gc.Default,Rt=((St=Ze.hvacSystem)==null?void 0:St.thermostatSetpoint)??20;if(Pt){const Ut=Oe.fill===El.Partial&&!me.isPartialWallFull(Oe),Ht=me.getWallVertices(Oe,0),At=Ut?me.getPartialWallVertices(Oe,0):Ht,kt=me.getPolygonArea(Ht);let gt=Ut?me.getPolygonArea(At):kt;const dt=i(z.Window,Oe.id),Ct=i(z.Door,Oe.id),tt=K7(Oe);let Fe=0;if(B.current&&B.current.z>0){const mt=(Ut?At.length:Ht.length)===4,Qe=i(z.SolarPanel,Oe.id),Tt=cl.computeWallSolarRadiationEnergy(q,C,B.current,Oe,Ze,dt,Ct,Qe,mt?0:1,te,he);for(let Dt=0;Dt0)for(const mt of dt)gt-=me.getWindowArea(mt,Oe);if(Ct&&Ct.length>0)for(const mt of Ct)gt-=mt.lx*mt.lz*Oe.lx*Oe.lz;const qe=me.isZero(Fe)||me.isZero(tt)?0:Fe*tt/((Oe.volumetricHeatCapacity??.5)*gt*Oe.ly);let rt=(j.current+qe-Rt)*gt/(Oe.rValue??f6)*.001/ae;Ut&&Oe.openToOutside&&(rt+=(j.current-Rt)*(kt-gt)*vO*.001/ae),Se(Oe.id,rt)}else if(Oe.openToOutside){const Ut=me.getWallVertices(Oe,0),Ht=me.getPolygonArea(Ut),At=j.current-Rt;Se(Oe.id,At*Ht*vO*.001/ae)}}},yt=Oe=>{var Ut;const Ze=o(Oe);if(!Ze)return;const St=((Ut=Ze.hvacSystem)==null?void 0:Ut.thermostatSetpoint)??20,Pt=me.calculateBuildingArea(Oe),Rt=L.current-St;Se(Ze.id,Rt*Pt/(Ze.rValue??o8)*.001/ae)},ct=(Oe,Ze,St)=>{const Pt=1/(Oe.rValue??r8),Rt=1/(Oe.ceilingRValue??y6);return(Pt*Ze+Rt*St)/(Pt+Rt)},Xe=Oe=>{var Rt;const Ze=o(Oe);if(!Ze)return;const St=s(Oe.id);if(!St)return;let Pt;switch(Oe.roofType){case Go.Pyramid:Pt=ut(Oe,St,Ze);break;case Go.Hip:Pt=ft(Oe,St,Ze);break;case Go.Gable:Pt=at(Oe,St,Ze);break;case Go.Gambrel:Pt=ot(Oe,St,Ze);break;case Go.Mansard:Pt=st(Oe,St,Ze);break}if(Pt){const Ut=((Rt=Ze.hvacSystem)==null?void 0:Rt.thermostatSetpoint)??20;let Ht=0;for(const[At,kt]of Pt.entries()){const dt=(kt.surfaceTemperature-(Oe.ceiling?ct(Oe,kt.surfaceTemperature,Ut):Ut))*kt.totalArea/(Oe.rValue??r8)*.001/ae;Se(Oe.id+"-"+At,dt),Ht+=dt}Se(Oe.id,Ht)}},ut=(Oe,Ze,St)=>{if(Oe.roofType!==Go.Pyramid)throw new Error("roof is not pyramid");const Pt=Ze.length;if(Pt===0)return;let Rt=!0;const Ut=Ze[0][0].z;for(const Fe of Ze)for(const qe of Fe)if(Math.abs(qe.z-Ut)>.01){Rt=!1;break}const Ht=Rt?1:Pt,At=i(z.Window,Oe.id),kt=[];if(Rt){let Fe=0;for(const qe of Ze){const je=[];for(const rt of qe)je.push(me.mapVector3ToPoint2(rt));Fe+=me.getPolygonArea(je)}if(At.length>0){for(const qe of At)Fe-=qe.lx*qe.lz;Fe<0&&(Fe=0)}kt.push(Fe)}else for(const Fe of Ze){let qe=me.getTriangleArea(Fe[0],Fe[1],Fe[2]);if(At.length>0){for(const je of At)Cn.onSegment(Fe,je.cx,je.cy)&&(qe-=je.lx*je.lz);qe<0&&(qe=0)}kt.push(qe)}const gt=K7(Oe),dt=Array(Ht).fill(0);if(B.current&&B.current.z>0){const Fe=i(z.SolarPanel,Oe.id),qe=cl.computePyramidRoofSolarRadiationEnergy(q,C,B.current,Oe,Rt,!0,Ze,St,At,Fe,te,he);for(let je=0;je{if(Oe.roofType!==Go.Hip)throw new Error("roof is not hip");const Pt=Ze.length;if(Pt===0)return;let Rt=!0;const Ut=Ze[0][0].z;for(const qe of Ze)for(const je of qe)if(Math.abs(je.z-Ut)>.01){Rt=!1;break}const Ht=Rt?1:Pt,At=[],kt=i(z.Window,Oe.id);for(const qe of Ze){let je=0;if(qe.length===3?je=me.getTriangleArea(qe[0],qe[1],qe[2]):qe.length===4&&(je=me.getTriangleArea(qe[0],qe[1],qe[2])+me.getTriangleArea(qe[2],qe[3],qe[0])),kt.length>0){for(const rt of kt)Cn.onSegment(qe,rt.cx,rt.cy)&&(je-=rt.lx*rt.lz);je<0&&(je=0)}At.push(je)}const gt=Rt?[At.reduce((qe,je)=>qe+je,0)]:At,dt=K7(Oe),Ct=Array(Ht).fill(0);if(B.current&&B.current.z>0){const qe=i(z.SolarPanel,Oe.id),je=cl.computeHipRoofSolarRadiationEnergy(q,C,B.current,Oe,Rt,!0,Ze,St,kt,qe,te,he);for(let rt=0;rt{if(Oe.roofType!==Go.Gambrel)throw new Error("roof is not gambrel");const Pt=Ze.length;if(Pt===0)return;let Rt=!0;const Ut=Ze[0][0].z;for(const qe of Ze)for(const je of qe)if(Math.abs(je.z-Ut)>.01){Rt=!1;break}const Ht=Rt?1:Pt,At=[],kt=i(z.Window,Oe.id);for(const qe of Ze){let je=me.getTriangleArea(qe[0],qe[1],qe[2])+me.getTriangleArea(qe[2],qe[3],qe[0]);if(kt.length>0){for(const rt of kt)Cn.onSegment(qe,rt.cx,rt.cy)&&(je-=rt.lx*rt.lz);je<0&&(je=0)}At.push(je)}const gt=Rt?[At.reduce((qe,je)=>qe+je,0)]:At,dt=K7(Oe),Ct=Array(Ht).fill(0);if(B.current&&B.current.z>0){const qe=i(z.SolarPanel,Oe.id),je=cl.computeGambrelRoofSolarRadiationEnergy(q,C,B.current,Oe,Rt,!0,Ze,St,kt,qe,te,he);for(let rt=0;rt{if(Oe.roofType!==Go.Mansard)throw new Error("roof is not mansard");const Pt=Ze.length;if(Pt===0)return;let Rt=!0;const Ut=Ze[0][0].z;for(const mt of Ze)for(const Qe of mt)if(Math.abs(Qe.z-Ut)>.01){Rt=!1;break}const Ht=Rt?1:Pt,At=[],kt=i(z.Window,Oe.id);for(let mt=0;mt0){for(const Dt of kt)Cn.onSegment(Qe,Dt.cx,Dt.cy)&&(Tt-=Dt.lx*Dt.lz);Tt<0&&(Tt=0)}At.push(Tt)}const gt=Ze[Pt-1],dt=new Array;for(const mt of gt)dt.push({x:mt.x,y:mt.y});let Ct=me.getPolygonArea(dt);if(kt.length>0){for(let mt=kt.length-1;mt>=0;mt--){const Qe=kt[mt];Cn.onSegment(gt,Qe.cx,Qe.cy)&&(Ct-=Qe.lx*Qe.lz,kt.splice(mt,1))}Ct<0&&(Ct=0)}At.push(Ct);const tt=Rt?[At.reduce((mt,Qe)=>mt+Qe,0)]:At,Fe=K7(Oe),qe=Array(Ht).fill(0);if(B.current&&B.current.z>0){const mt=i(z.SolarPanel,Oe.id),Qe=cl.computeMansardRoofSolarRadiationEnergy(q,C,B.current,Oe,Rt,!0,Ze,St,kt,mt,te,he);for(let Tt=0;Tt{if(Oe.roofType!==Go.Gable)throw new Error("roof is not gable");const Pt=Ze.length;if(Pt===0)return;const Rt=i(z.Window,Oe.id),Ut=[];for(const dt of Ze){let Ct=me.getTriangleArea(dt[0],dt[1],dt[2])+me.getTriangleArea(dt[2],dt[3],dt[0]);if(Rt.length>0){for(const tt of Rt)Cn.onSegment(dt,tt.cx,tt.cy)&&(Ct-=tt.lx*tt.lz);Ct<0&&(Ct=0)}Ut.push(Ct)}const Ht=K7(Oe),At=Array(Pt).fill(0);if(B.current&&B.current.z>0){const dt=i(z.SolarPanel,Oe.id),Ct=cl.computeGableRoofSolarRadiationEnergy(q,C,B.current,Oe,!0,Ze,St,Rt,dt,te,he);for(let tt=0;tt{const e=H.getState().world,n=H.getState().elements,o=H(qr),r=H(pA),i=Tn(Cge),a=Tn(_Be),l=ht(zge),s=Tn(Hge),{scene:c}=oi(),u=Jt(),d=f1(t),f=new Date(e.date),p=t?d==null?void 0:d.elevation:0,g=60/e.timesPerHour,y=m.useMemo(()=>new l0,[]),w=e.solarRadiationHeatmapGridCellSize??.5,b=m.useRef([]),C=m.useRef([]);m.useEffect(()=>{l&&n&&n.length>0&&(a(),T(),ht.getState().set(U=>{U.runStaticSimulation=!1,U.simulationInProgress=!1,U.showSolarRadiationHeatmap=!0}),hn(Y.t("message.SimulationCompleted",u)))},[l]);const P=(U,O,B)=>{if(b.current.length>1){C.current.length=0,y.set(O,B);const _=b.current.filter(X=>X.uuid!==U);return y.intersectObjects(_,!1,C.current),C.current.length>0}return!1},v=()=>{const U=c.children.filter(O=>O.name==="Content");if(U.length>0){const O=U[0].children;b.current.length=0;for(const B of O)me.fetchSimulationElements(B,b.current)}},T=()=>{v();for(const U of n)switch(U.type){case z.Foundation:{const O=U;x(O),O.solarStructure===Dn.UpdraftTower&&S(O);break}case z.Cuboid:{A(U);break}case z.SolarPanel:{R(U);break}case z.Wall:{M(U);break}case z.Door:{D(U);break}case z.Roof:{const O=U;switch(O.roofType){case Go.Pyramid:E(O);break;case Go.Gable:N(O);break;case Go.Gambrel:j(O);break;case Go.Mansard:W(O);break;case Go.Hip:L(O);break}break}}},A=U=>{const O=f.getFullYear(),B=f.getMonth(),_=f.getDate(),X=me.dayOfYear(f),$=U.lx,Q=U.ly,le=U.lz,q=Math.max(2,Math.round($/w)),te=Math.max(2,Math.round(Q/w)),re=Math.max(2,Math.round(le/w)),ae=$/q,se=Q/te,ne=le/re,fe=o(U);let ge=U.cx,de=U.cy,Z=U.cz;if(fe&&fe.type===z.Cuboid){const De=me.getWorldDataById(U.id);ge=De.pos.x,de=De.pos.y,Z=De.pos.z}const he=Array(q).fill(0).map(()=>Array(te).fill(0)),xe=Array(q).fill(0).map(()=>Array(re).fill(0)),He=Array(q).fill(0).map(()=>Array(re).fill(0));let Se=Array(te).fill(0).map(()=>Array(re).fill(0)),ze=Array(te).fill(0).map(()=>Array(re).fill(0));const Ie=Io,ye=Vp.clone().applyAxisAngle(Io,U.rotation[2]),ce=Oc.clone().applyAxisAngle(Io,U.rotation[2]),pe=_p.clone().applyAxisAngle(Io,U.rotation[2]),ve=Op.clone().applyAxisAngle(Io,U.rotation[2]),Ae=new ie;let Te=0;const Me=new Xt(ge,de),Pe=new Xt,Ee=de-Q/2,Be=de+Q/2,Je=ge-$/2,We=ge+$/2;for(let De=0;De<24;De++)for(let ke=0;ke0){Te++;const Ve=Ri(it,X,p,yi.SPHERE_MODEL);let yt=ni(e.ground,B,Ie,Ve),ct=Ie.dot(it),Xe=ge-$/2,ut=de-Q/2;const ft=Z+le/2;for(let ot=0;ot0&&(Pe.set(Xe+(ot+.5)*ae,ut+(st+.5)*se),Pe.rotateAround(Me,U.rotation[2]),Ae.set(Pe.x,Pe.y,ft),P(U.id,Ae,it)||(he[ot][st]+=ct*Ve));Xe=ge-$/2,ut=Z-le/2,yt=ni(e.ground,B,ye,Ve),ct=ye.dot(it);for(let ot=0;ot0&&(Pe.set(Xe+(ot+.5)*ae,Ee),Pe.rotateAround(Me,U.rotation[2]),Ae.set(Pe.x,Pe.y,ut+(st+.5)*ne),P(U.id,Ae,it)||(xe[ot][st]+=ct*Ve));yt=ni(e.ground,B,ce,Ve),ct=ce.dot(it);for(let ot=0;ot0&&(Pe.set(Xe+(ot+.5)*ae,Be),Pe.rotateAround(Me,U.rotation[2]),Ae.set(Pe.x,Pe.y,ut+(re-(st+.5))*ne),P(U.id,Ae,it)||(He[ot][st]+=ct*Ve));Xe=de-Q/2,ut=Z-le/2,yt=ni(e.ground,B,pe,Ve),ct=pe.dot(it);for(let ot=0;ot0&&(Pe.set(Je,Xe+(ot+.5)*se),Pe.rotateAround(Me,U.rotation[2]),Ae.set(Pe.x,Pe.y,ut+(st+.5)*ne),P(U.id,Ae,it)||(Se[ot][st]+=ct*Ve));yt=ni(e.ground,B,ve,Ve),ct=ve.dot(it);for(let ot=0;ot0&&(Pe.set(We,Xe+(ot+.5)*se),Pe.rotateAround(Me,U.rotation[2]),Ae.set(Pe.x,Pe.y,ut+(st+.5)*ne),P(U.id,Ae,it)||(ze[ot][st]+=ct*Ve))}}Se=me.transpose(Se),ze=me.transpose(ze);const Ke=Te*g/60,Ne=Ke>It?d.sunshineHours[B]/(30*Ke*e.timesPerHour):0;F(he,Ne),F(xe,Ne),F(He,Ne),F(Se,Ne),F(ze,Ne),i(U.id+"-top",he),i(U.id+"-south",xe),i(U.id+"-north",He),i(U.id+"-west",Se),i(U.id+"-east",ze)},x=U=>{const O=f.getFullYear(),B=f.getMonth(),_=f.getDate(),X=me.dayOfYear(f),$=U.lx,Q=U.ly,le=U.lz,q=Math.max(2,Math.round($/w)),te=Math.max(2,Math.round(Q/w)),re=$/q,ae=Q/te,se=U.cx-$/2,ne=U.cy-Q/2,fe=new Xt(U.cx,U.cy),ge=new ie,de=Array(q).fill(0).map(()=>Array(te).fill(0));let Z=0;for(let He=0;He<24;He++)for(let Se=0;Se0){Z++;const ye=Ri(Ie,X,p,yi.SPHERE_MODEL),ce=ni(e.ground,B,Io,ye),pe=Io.dot(Ie),ve=new Xt;for(let Ae=0;Ae0&&(ve.set(se+(Ae+.5)*re,ne+(Te+.5)*ae),ve.rotateAround(fe,U.rotation[2]),ge.set(ve.x,ve.y,le),P(U.id,ge,Ie)||(de[Ae][Te]+=pe*ye))}}const he=Z*g/60,xe=he>It?d.sunshineHours[B]/(30*he*e.timesPerHour):0;F(de,xe),i(U.id,de)},S=U=>{const O=U.solarUpdraftTower;if(!O)return;const B=f.getFullYear(),_=f.getMonth(),X=f.getDate(),$=me.dayOfYear(f),Q=O.collectorRadius,le=Math.max(2,Math.round(Q*2/w)),q=U.cx-Q+w/2,te=U.cy-Q+w/2,re=U.lz+O.collectorHeight,ae=Array(le).fill(0).map(()=>Array(le).fill(0)),se=new ie(0,0,re),ne=Q*Q;let fe=0,ge,de;for(let xe=0;xe<24;xe++)for(let He=0;He0){fe++;const Ie=Ri(ze,$,p,yi.SPHERE_MODEL),ye=ni(e.ground,_,Io,Ie),ce=Io.dot(ze);for(let pe=0;pene)&&(ae[pe][ve]+=ye,ce>0&&(P(U.id+"-sut",se,ze)||(ae[pe][ve]+=ce*Ie)))}}}const Z=fe*g/60,he=Z>It?d.sunshineHours[_]/(30*Z*e.timesPerHour):0;F(ae,he),i(U.id+"-sut",ae)},R=U=>{if(U.trackerType!==za.NO_TRACKER)throw new Error("trackers cannot use static simulation");let O=o(U);if(!O)throw new Error("parent of solar panel does not exist");const B=U.parentType===z.Roof,_=U.parentType===z.Wall;if(B&&(O=r(O),!O))throw new Error("foundation of solar panel does not exist");const X=_?me.absoluteCoordinates(U.cx,U.cy,U.cz,O,r(U),U.lz):me.absoluteCoordinates(U.cx,U.cy,U.cz,O,void 0,void 0,!0),$=new ie().fromArray(U.normal);_&&$.applyEuler(new nn(0,0,O.relativeAngle));const Q=O.rotation[2];let le=Q+(_?0:U.relativeAzimuth),q=U.tiltAngle,te=!0;if(B&&(X.z=U.cz+U.lz+.02+O.cz,me.isZero(U.rotation[0])?X.z+=U.poleHeight:(q=U.rotation[0],le=Q,te=!1)),_&&!me.isZero(U.tiltAngle)){const Me=O,Pe=r(O),Be=(Pe?Pe.rotation[2]+Me.relativeAngle:Me.relativeAngle)-Gt,Je=U.ly*Math.abs(Math.sin(U.tiltAngle))/2;X.x+=Je*Math.cos(Be),X.y+=Je*Math.sin(Be)}const re=new nn(B&&!te?0:q,0,le,"ZYX");$.applyEuler(re);const ae=f.getFullYear(),se=f.getMonth(),ne=f.getDate(),fe=me.dayOfYear(f),ge=U.lx,de=U.ly,Z=Math.max(2,Math.round(U.lx/w)),he=Math.max(2,Math.round(U.ly/w)),xe=ge/Z,He=de/he,Se=X.x-(ge-w)/2,ze=X.y-(de-w)/2,Ie=B||_?X.z:O.lz+U.poleHeight+U.lz,ye=new Xt(X.x,X.y),ce=new ie,pe=Array(Z).fill(0).map(()=>Array(he).fill(0));let ve=0;if(B&&!te&&(re.x=U.rotation[0],re.z=U.rotation[2]+Q),_){const Me=o(U);Me&&(re.x=Gt+U.tiltAngle,re.z=O.relativeAngle+Me.rotation[2])}for(let Me=0;Me<24;Me++)for(let Pe=0;Pe0){ve++;const Je=Ri(Be,fe,p,yi.SPHERE_MODEL),We=ni(e.ground,se,$,Je),Ke=$.dot(Be),Ne=new Xt,De=new ie;for(let ke=0;ke0&&(Ne.set(Se+ke*xe,ze+Ye*He),De.set(Ne.x-ye.x,Ne.y-ye.y,0),De.applyEuler(re),ce.set(X.x+De.x,X.y+De.y,Ie+De.z),P(U.id,ce,Be)||(pe[ke][Ye]+=Ke*Je))}}const Ae=ve*g/60,Te=Ae>It?d.sunshineHours[se]/(30*Ae*e.timesPerHour):0;F(pe,Te),i(U.id,pe)},M=U=>{const O=r(U);if(!O)throw new Error("foundation of wall not found");const B=f.getFullYear(),_=f.getMonth(),X=f.getDate(),$=me.dayOfYear(f),Q=U.lx,le=me.getHighestPointOfWall(U),q=Math.max(2,Math.round(Q/w)),te=Math.max(2,Math.round(le/w)),re=Q/q,ae=le/te,se=O.rotation[2]+U.relativeAngle,ne=me.wallAbsolutePosition(new ie(U.cx,U.cy,le/2),O).setZ(le/2+O.lz),fe=new ie(Math.cos(se-Gt),Math.sin(se-Gt),0),ge=new ie,de=Array(q).fill(0).map(()=>Array(te).fill(0));let Z=0;const he=re*Math.cos(se),xe=re*Math.sin(se),He=me.getWallVertices(U,2),Se=(le-U.lz)/2;for(let ye=0;ye<24;ye++)for(let ce=0;ce0){Z++;const Ae=Ri(ve,$,p,yi.SPHERE_MODEL),Te=ni(e.ground,_,fe,Ae),Me=fe.dot(ve);for(let Pe=0;Pe0&&(ge.set(ne.x+Be*he,ne.y+Be*xe,ne.z+Je*ae),P(U.id,ge,ve)||(de[Pe][Ee]+=Me*Ae)))}}}const ze=Z*g/60,Ie=ze>It?d.sunshineHours[_]/(30*ze*e.timesPerHour):0;F(de,Ie),i(U.id,de)},D=U=>{const O=r(U);if(!O)throw new Error("foundation of door not found");const B=o(U);if(!B)throw new Error("parent of door not found");const _=B,X=f.getFullYear(),$=f.getMonth(),Q=f.getDate(),le=me.dayOfYear(f),q=U.lx*_.lx,te=U.lz*_.lz,re=Math.max(2,Math.round(q/w)),ae=Math.max(2,Math.round(te/w)),se=q/re,ne=te/ae,fe=O.rotation[2]+_.relativeAngle,de=me.wallAbsolutePosition(new ie(_.cx,_.cy,_.cz),O).setZ(_.lz/2+O.lz).clone().add(new ie(U.cx*_.lx,0,U.cz*_.lz)),Z=new ie(Math.cos(fe-Gt),Math.sin(fe-Gt),0),he=new ie,xe=Array(re).fill(0).map(()=>Array(ae).fill(0));let He=0;const Se=se*Math.cos(fe),ze=se*Math.sin(fe);for(let ce=0;ce<24;ce++)for(let pe=0;pe0){He++;const Te=Ri(Ae,le,p,yi.SPHERE_MODEL),Me=ni(e.ground,$,Z,Te),Pe=Z.dot(Ae);if(U.doorType===Pd.Arched)for(let Ee=0;Ee0&&(P(U.id,he,Ae)||(xe[Ee][Be]+=Pe*Te)))}else for(let Ee=0;Ee0&&(he.set(de.x+Je*Se,de.y+Je*ze,de.z+We*ne),P(U.id,he,Ae)||(xe[Ee][Be]+=Pe*Te))}}}const Ie=He*g/60,ye=Ie>It?d.sunshineHours[$]/(30*Ie*e.timesPerHour):0;F(xe,ye),i(U.id,xe)},E=U=>{if(U.roofType!==Go.Pyramid)throw new Error("roof is not pyramid");const O=r(U);if(!O)throw new Error("foundation of wall not found");const B=s(U.id);if(!B||B.length===0)return;let _=!0;const X=B[0][0].z;for(const $ of B)for(const Q of $)if(Math.abs(Q.z-X)>.01){_=!1;break}if(_)k(U,O,B);else{const $=f.getFullYear(),Q=f.getMonth(),le=f.getDate(),q=me.dayOfYear(f),te=new nn(0,0,O.rotation[2],"ZYX");for(const[re,ae]of B.entries()){const se=U.id+"-"+re,ne=ae[0].clone().applyEuler(te),fe=ae[1].clone().applyEuler(te),ge=ae[2].clone().applyEuler(te),de=new ie().subVectors(fe,ne),Z=new ie().subVectors(ge,ne),he=new ie().subVectors(ge,fe),xe=de.length(),He=new ie().crossVectors(Z,he).length()/xe,Se=Math.max(2,Math.round(xe/w)),ze=Math.max(2,Math.round(He/w)),Ie=Array(Se).fill(0).map(()=>Array(ze).fill(0));de.normalize(),Z.normalize(),he.normalize();const ye=new ie().crossVectors(Z,he).normalize(),ce=de.multiplyScalar(.5*xe/Se),pe=new ie().crossVectors(ye,de).normalize().multiplyScalar(.5*He/ze),ve=new ie(O.cx+ne.x,O.cy+ne.y,O.lz+ne.z+L0);ve.add(ce).add(pe),ce.multiplyScalar(2),pe.multiplyScalar(2);let Ae=0;const Te=new ie;for(let Ee=0;Ee<24;Ee++)for(let Be=0;Be0){Ae++;const Ke=Ri(We,q,p,yi.SPHERE_MODEL),Ne=ni(e.ground,Q,ye,Ke),De=ye.dot(We);for(let ke=0;ke0&&(Te.copy(ve).add(Ye).add(pe.clone().multiplyScalar(it)),P(se,Te,We)||(Ie[ke][it]+=De*Ke))}}}const Me=Ae*g/60,Pe=Me>It?d.sunshineHours[Q]/(30*Me*e.timesPerHour):0;F(Ie,Pe),i(se,Ie)}}},W=U=>{if(U.roofType!==Go.Mansard)throw new Error("roof is not mansard");const O=r(U);if(!O)throw new Error("foundation of wall not found");const B=s(U.id);if(!B||B.length===0)return;let _=!0;const X=B[0][0].z;for(const $ of B)for(const Q of $)if(Math.abs(Q.z-X)>.01){_=!1;break}if(_)k(U,O,B);else{const $=f.getFullYear(),Q=f.getMonth(),le=f.getDate(),q=me.dayOfYear(f),te=new nn(0,0,O.rotation[2],"ZYX");for(const[re,ae]of B.entries()){const se=U.id+"-"+re;if(re===B.length-1){let ne=Number.MAX_VALUE,fe=Number.MAX_VALUE,ge=-Number.MAX_VALUE,de=-Number.MAX_VALUE;for(const Ae of ae){const Te=Ae.clone().applyEuler(te);Te.x>ge&&(ge=Te.x),Te.xde&&(de=Te.y),Te.yArray(xe).fill(0)),Ie=new ie(ne+w/2,fe+w/2,O.lz+Z+L0);let ye=0;const ce=new ie(0,0,Ie.z);for(let Ae=0;Ae<24;Ae++)for(let Te=0;Te0){ye++;const Ee=Ri(Pe,q,p,yi.SPHERE_MODEL),Be=ni(e.ground,Q,Io,Ee),Je=Io.dot(Pe);for(let We=0;We0&&(ce.y=Ie.y+Ke*Se,P(se,ce,Pe)||(ze[We][Ke]+=Je*Ee))}}}const pe=ye*g/60,ve=pe>It?d.sunshineHours[Q]/(30*pe*e.timesPerHour):0;F(ze,ve),i(se,ze)}else{const ne=ae[0].clone().applyEuler(te),fe=ae[1].clone().applyEuler(te),ge=ae[2].clone().applyEuler(te),de=new ie().subVectors(fe,ne),Z=new ie().subVectors(ge,ne),he=new ie().subVectors(ge,fe),xe=de.length(),He=new ie().crossVectors(Z,he).length()/xe,Se=Math.max(2,Math.round(xe/w)),ze=Math.max(2,Math.round(He/w)),Ie=Array(Se).fill(0).map(()=>Array(ze).fill(0));de.normalize(),Z.normalize(),he.normalize();const ye=new ie().crossVectors(Z,he).normalize(),ce=de.multiplyScalar(.5*xe/Se),pe=new ie().crossVectors(ye,de).normalize().multiplyScalar(.5*He/ze),ve=new ie(O.cx+ne.x,O.cy+ne.y,O.lz+ne.z+L0);ve.add(ce).add(pe),ce.multiplyScalar(2),pe.multiplyScalar(2);let Ae=0;const Te=new ie;for(let Ee=0;Ee<24;Ee++)for(let Be=0;Be0){Ae++;const Ke=Ri(We,q,p,yi.SPHERE_MODEL),Ne=ni(e.ground,Q,ye,Ke),De=ye.dot(We);for(let ke=0;ke0&&(Te.copy(ve).add(Ye).add(pe.clone().multiplyScalar(it)),P(se,Te,We)||(Ie[ke][it]+=De*Ke))}}}const Me=Ae*g/60,Pe=Me>It?d.sunshineHours[Q]/(30*Me*e.timesPerHour):0;F(Ie,Pe),i(se,Ie)}}}},j=U=>{if(U.roofType!==Go.Gambrel)throw new Error("roof is not gambrel");const O=r(U);if(!O)throw new Error("foundation of wall not found");const B=s(U.id);if(!B||B.length===0)return;let _=!0;const X=B[0][0].z;for(const $ of B)for(const Q of $)if(Math.abs(Q.z-X)>.01){_=!1;break}if(_)k(U,O,B);else{const $=f.getFullYear(),Q=f.getMonth(),le=f.getDate(),q=me.dayOfYear(f),te=new nn(0,0,O.rotation[2],"ZYX");for(const[re,ae]of B.entries()){const se=U.id+"-"+re,ne=ae[0].clone().applyEuler(te),fe=ae[1].clone().applyEuler(te),ge=ae[2].clone().applyEuler(te),de=new ie().subVectors(fe,ne),Z=new ie().subVectors(ge,ne),he=new ie().subVectors(ge,fe),xe=de.length(),He=new ie().crossVectors(Z,he).length()/xe,Se=Math.max(2,Math.round(xe/w)),ze=Math.max(2,Math.round(He/w)),Ie=Array(Se).fill(0).map(()=>Array(ze).fill(0));de.normalize(),Z.normalize(),he.normalize();const ye=new ie().crossVectors(Z,he).normalize(),ce=de.multiplyScalar(.5*xe/Se),pe=new ie().crossVectors(ye,de).normalize().multiplyScalar(.5*He/ze),ve=new ie(O.cx+ne.x,O.cy+ne.y,O.lz+ne.z+L0);ve.add(ce).add(pe),ce.multiplyScalar(2),pe.multiplyScalar(2);let Ae=0;const Te=new ie;for(let Ee=0;Ee<24;Ee++)for(let Be=0;Be0){Ae++;const Ke=Ri(We,q,p,yi.SPHERE_MODEL),Ne=ni(e.ground,Q,ye,Ke),De=ye.dot(We);for(let ke=0;ke0&&(Te.copy(ve).add(Ye).add(pe.clone().multiplyScalar(it)),P(se,Te,We)||(Ie[ke][it]+=De*Ke))}}}const Me=Ae*g/60,Pe=Me>It?d.sunshineHours[Q]/(30*Me*e.timesPerHour):0;F(Ie,Pe),i(se,Ie)}}},L=U=>{if(U.roofType!==Go.Hip)throw new Error("roof is not hip");const O=r(U);if(!O)throw new Error("foundation of wall not found");const B=s(U.id);if(!B||B.length===0)return;let _=!0;const X=B[0][0].z;for(const $ of B)for(const Q of $)if(Math.abs(Q.z-X)>.01){_=!1;break}if(_)k(U,O,B);else{const $=f.getFullYear(),Q=f.getMonth(),le=f.getDate(),q=me.dayOfYear(f),te=new nn(0,0,O.rotation[2],"ZYX");for(const[re,ae]of B.entries()){const se=U.id+"-"+re,ne=ae[0].clone().applyEuler(te),fe=ae[1].clone().applyEuler(te),ge=ae[2].clone().applyEuler(te),de=new ie().subVectors(fe,ne),Z=new ie().subVectors(ge,ne),he=new ie().subVectors(ge,fe),xe=de.length(),He=new ie().crossVectors(Z,he).length()/xe,Se=Math.max(2,Math.round(xe/w)),ze=Math.max(2,Math.round(He/w)),Ie=Array(Se).fill(0).map(()=>Array(ze).fill(0));de.normalize(),Z.normalize(),he.normalize();const ye=new ie().crossVectors(Z,he).normalize(),ce=de.multiplyScalar(.5*xe/Se),pe=new ie().crossVectors(ye,de).normalize().multiplyScalar(.5*He/ze);let ve=0;const Ae=new ie,Te=new ie(O.cx+ne.x,O.cy+ne.y,O.lz+ne.z+L0);if(Te.add(ce).add(pe),ce.multiplyScalar(2),pe.multiplyScalar(2),re%2===0)for(let Ee=0;Ee<24;Ee++)for(let Be=0;Be0){ve++;const Ke=Ri(We,q,p,yi.SPHERE_MODEL),Ne=ni(e.ground,Q,ye,Ke),De=ye.dot(We);for(let ke=0;ke0&&(Ae.copy(Te).add(Ye).add(pe.clone().multiplyScalar(it)),P(se,Ae,We)||(Ie[ke][it]+=De*Ke))}}}else for(let Ee=0;Ee<24;Ee++)for(let Be=0;Be0){ve++;const Ke=Ri(We,q,p,yi.SPHERE_MODEL),Ne=ni(e.ground,Q,ye,Ke),De=ye.dot(We);for(let ke=0;ke0&&(Ae.copy(Te).add(Ye).add(pe.clone().multiplyScalar(it)),P(se,Ae,We)||(Ie[ke][it]+=De*Ke))}}}const Me=ve*g/60,Pe=Me>It?d.sunshineHours[Q]/(30*Me*e.timesPerHour):0;F(Ie,Pe),i(se,Ie)}}},k=(U,O,B)=>{const _=f.getFullYear(),X=f.getMonth(),$=f.getDate(),Q=me.dayOfYear(f),le=new nn(0,0,O.rotation[2],"ZYX"),q=B[0][0].z;let te=Number.MAX_VALUE,re=Number.MAX_VALUE,ae=-Number.MAX_VALUE,se=-Number.MAX_VALUE;for(const Ie of B)for(const ye of Ie){const ce=ye.clone().applyEuler(le);ce.x>ae&&(ae=ce.x),ce.xse&&(se=ce.y),ce.yArray(fe).fill(0)),he=new ie(te+w/2,re+w/2,O.lz+q+L0);let xe=0;const He=new ie(0,0,he.z);for(let Ie=0;Ie<24;Ie++)for(let ye=0;ye0){xe++;const ve=Ri(pe,Q,p,yi.SPHERE_MODEL),Ae=ni(e.ground,X,Io,ve),Te=Io.dot(pe);for(let Me=0;Me0&&(He.y=he.y+Pe*de,P(U.id,He,pe)||(Z[Me][Pe]+=Te*ve))}}}const Se=xe*g/60,ze=Se>It?d.sunshineHours[X]/(30*Se*e.timesPerHour):0;F(Z,ze),i(U.id,Z)},N=U=>{if(U.roofType!==Go.Gable)throw new Error("roof is not gable");const O=r(U);if(!O)throw new Error("foundation of wall not found");const B=s(U.id);if(!B||B.length===0)return;const _=f.getFullYear(),X=f.getMonth(),$=f.getDate(),Q=me.dayOfYear(f),le=new nn(0,0,O.rotation[2],"ZYX");for(const[q,te]of B.entries()){const re=U.id+"-"+q,ae=te[0].clone().applyEuler(le),se=te[1].clone().applyEuler(le),ne=te[2].clone().applyEuler(le),fe=new ie().subVectors(se,ae),ge=new ie().subVectors(ne,ae),de=new ie().subVectors(ne,se),Z=fe.length(),he=new ie().crossVectors(ge,de).length()/Z,xe=Math.max(2,Math.round(Z/w)),He=Math.max(2,Math.round(he/w)),Se=Array(xe).fill(0).map(()=>Array(He).fill(0));fe.normalize(),ge.normalize(),de.normalize();const ze=new ie().crossVectors(ge,de).normalize(),Ie=fe.multiplyScalar(.5*Z/xe),ye=new ie().crossVectors(ze,fe).normalize().multiplyScalar(.5*he/He),ce=new ie(O.cx+ae.x,O.cy+ae.y,O.lz+ae.z+L0);ce.add(Ie).add(ye),Ie.multiplyScalar(2),ye.multiplyScalar(2);let pe=0;const ve=new ie;for(let Me=0;Me<24;Me++)for(let Pe=0;Pe0){pe++;const Je=Ri(Be,Q,p,yi.SPHERE_MODEL),We=ni(e.ground,X,ze,Je),Ke=ze.dot(Be);for(let Ne=0;Ne0&&(ve.copy(ce).add(De).add(ye.clone().multiplyScalar(ke)),P(re,ve,Be)||(Se[Ne][ke]+=Ke*Je))}}}const Ae=pe*g/60,Te=Ae>It?d.sunshineHours[X]/(30*Ae*e.timesPerHour):0;F(Se,Te),i(re,Se)}},F=(U,O)=>{for(let B=0;B{const e=H(fn),n=ht(xh),o=H.getState().world,r=H.getState().elements,i=H(qr),a=H(pA),l=Tn(Cge),s=Tn(_Be),c=ht(pW),u=ht(Mwt),d=H(yge),f=Tn(Hge),{scene:p}=oi(),g=Jt(),y=f1(t),w=new Date(o.date),b=t?y==null?void 0:y.elevation:0,C=60/o.timesPerHour,P=m.useMemo(()=>new l0,[]),v=o.solarRadiationHeatmapGridCellSize??.5,T=m.useRef([]),A=m.useRef([]),x=m.useRef(0),S=m.useRef(!1),R=m.useRef(new Date(o.date)),M=m.useRef(new Map),D=m.useRef(!1),E=m.useRef(new Date(o.date)),W=m.useMemo(()=>dl(w,o.latitude),[o.date,o.latitude]);m.useEffect(()=>{if(c)return j(),x.current=requestAnimationFrame(N),()=>{cancelAnimationFrame(x.current),S.current||(hn(Y.t("message.SimulationAborted",g)),e(Z=>{Z.world.date=R.current.toLocaleString("en-US")}),n("simulationInProgress",!1))}},[c]),m.useEffect(()=>{D.current=u,u?(E.current=new Date(w.getTime()),cancelAnimationFrame(x.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",g))):(n("simulationPaused",!1),N())},[u]);const j=()=>{n("simulationInProgress",!0),w.setHours(Math.floor(W.sunrise/60),W.sunrise%60),R.current=new Date(o.date),S.current=!1,U();for(const Z of r)switch(Z.type){case z.Wall:case z.Door:case z.SolarPanel:case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:{M.current.delete(Z.id);break}case z.Cuboid:{M.current.delete(Z.id+"-top"),M.current.delete(Z.id+"-north"),M.current.delete(Z.id+"-south"),M.current.delete(Z.id+"-west"),M.current.delete(Z.id+"-east");break}case z.Roof:{const he=Z,xe=f(he.id);if(xe){const He=xe.length;for(let Se=0;Se{s();const Z=W.daylight()/60,he=Z>It?y.sunshineHours[w.getMonth()]/(30*Z*o.timesPerHour):0;for(const xe of r){switch(xe.type){case z.Foundation:case z.Wall:case z.Door:case z.SolarPanel:case z.ParabolicTrough:case z.ParabolicDish:case z.FresnelReflector:case z.Heliostat:{const He=M.current.get(xe.id);if(He){for(let Se=0;Se[...Se]))}break}case z.Cuboid:{k(xe.id,"top",he),k(xe.id,"south",he),k(xe.id,"north",he),k(xe.id,"west",he),k(xe.id,"east",he);break}case z.Roof:{const He=xe,Se=f(He.id);if(Se&&Se.length>0){if(He.roofType===Go.Pyramid||He.roofType===Go.Mansard||He.roofType===Go.Gambrel||He.roofType===Go.Hip){let ze=!0;const Ie=Se[0][0].z;for(const ye of Se)for(const ce of ye)if(Math.abs(ce.z-Ie)>.01){ze=!1;break}if(ze){const ye=M.current.get(He.id);if(ye){for(let ce=0;ce[...ce]))}break}}for(let ze=0;ze[...ce]))}}}break}}if(xe.type===z.Foundation){const He=xe;if(He.solarStructure===Dn.UpdraftTower&&He.solarUpdraftTower){const Se=xe.id+"-sut",ze=M.current.get(Se);if(ze){for(let Ie=0;Ie[...Ie]))}}}}},k=(Z,he,xe)=>{const He=M.current.get(Z+"-"+he);if(He){for(let Se=0;Se{if(c&&!D.current){if(w.getMinutes()+w.getHours()*60>=W.sunset){cancelAnimationFrame(x.current),ht.getState().set(he=>{he.runDynamicSimulation=!1}),e(he=>{he.world.date=R.current.toLocaleString("en-US")}),hn(Y.t("message.SimulationCompleted",g)),S.current=!0,L(),setTimeout(()=>{n("simulationInProgress",!1),n("showSolarRadiationHeatmap",!0)},10);return}if(w.setHours(w.getHours(),w.getMinutes()+C),e(he=>{he.world.date=w.toLocaleString("en-US")}),d)for(const he of r)switch(he.type){case z.FresnelReflector:fe(he);break;case z.Heliostat:ge(he);break}else for(const he of r)switch(he.type){case z.Foundation:{const xe=he;B(xe),xe.solarStructure===Dn.UpdraftTower&&de(xe);break}case z.Cuboid:{O(he);break}case z.SolarPanel:{ae(he);break}case z.ParabolicTrough:{se(he);break}case z.ParabolicDish:{ne(he);break}case z.FresnelReflector:{fe(he);break}case z.Heliostat:{ge(he);break}case z.Wall:{_(he);break}case z.Door:{X(he);break}case z.Roof:{const xe=he;switch(xe.roofType){case Go.Pyramid:Q(xe);break;case Go.Gable:re(xe);break;case Go.Gambrel:q(xe);break;case Go.Mansard:le(xe);break;case Go.Hip:te(xe);break}break}}x.current=requestAnimationFrame(N)}},F=(Z,he,xe)=>{if(T.current.length>1){A.current.length=0,P.set(he,xe);const He=T.current.filter(Se=>Se.uuid!==Z);return P.intersectObjects(He,!1,A.current),A.current.length>0}return!1},U=()=>{const Z=p.children.filter(he=>he.name==="Content");if(Z.length>0){const he=Z[0].children;T.current.length=0;for(const xe of he)me.fetchSimulationElements(xe,T.current)}},O=Z=>{const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=me.dayOfYear(w),He=Z.lx,Se=Z.ly,ze=Z.lz,Ie=Math.max(2,Math.round(He/v)),ye=Math.max(2,Math.round(Se/v)),ce=Math.max(2,Math.round(ze/v)),pe=He/Ie,ve=Se/ye,Ae=ze/ce;let Te=M.current.get(Z.id+"-top");(!Te||Te.length!==Ie||Te[0].length!==ye)&&(Te=Array(Ie).fill(0).map(()=>Array(ye).fill(0)),M.current.set(Z.id+"-top",Te));let Me=M.current.get(Z.id+"-south");(!Me||Me.length!==Ie||Me[0].length!==ce)&&(Me=Array(Ie).fill(0).map(()=>Array(ce).fill(0)),M.current.set(Z.id+"-south",Me));let Pe=M.current.get(Z.id+"-north");(!Pe||Pe.length!==Ie||Pe[0].length!==ce)&&(Pe=Array(Ie).fill(0).map(()=>Array(ce).fill(0)),M.current.set(Z.id+"-north",Pe));let Ee=M.current.get(Z.id+"-west");(!Ee||Ee.length!==ye||Ee[0].length!==ce)&&(Ee=Array(ye).fill(0).map(()=>Array(ce).fill(0)),M.current.set(Z.id+"-west",Ee));let Be=M.current.get(Z.id+"-east");(!Be||Be.length!==ye||Be[0].length!==ce)&&(Be=Array(ye).fill(0).map(()=>Array(ce).fill(0)),M.current.set(Z.id+"-east",Be));const Je=Io,We=Vp.clone().applyAxisAngle(Io,Z.rotation[2]),Ke=Oc.clone().applyAxisAngle(Io,Z.rotation[2]),Ne=_p.clone().applyAxisAngle(Io,Z.rotation[2]),De=Op.clone().applyAxisAngle(Io,Z.rotation[2]),ke=i(Z);let Ye=Z.cx,it=Z.cy,Ve=Z.cz;if(ke&&ke.type===z.Cuboid){const Ut=me.getWorldDataById(Z.id);Ye=Ut.pos.x,it=Ut.pos.y,Ve=Ut.pos.z}const yt=new ie,ct=new Xt(Ye,it),Xe=new Xt,ut=it-Se/2,ft=it+Se/2,ot=Ye-He/2,st=Ye+He/2,at=Ri(he,xe,b,yi.SPHERE_MODEL);let Oe=ni(o.ground,w.getMonth(),Je,at),Ze=Je.dot(he),St=Ye-He/2,Pt=it-Se/2;const Rt=Ve+ze/2;for(let Ut=0;Ut0&&(Xe.set(St+(Ut+.5)*pe,Pt+(Ht+.5)*ve),Xe.rotateAround(ct,Z.rotation[2]),yt.set(Xe.x,Xe.y,Rt),F(Z.id,yt,he)||(Te[Ut][Ht]+=Ze*at));St=Ye-He/2,Pt=Ve-ze/2,Oe=ni(o.ground,w.getMonth(),We,at),Ze=We.dot(he);for(let Ut=0;Ut0&&(Xe.set(St+(Ut+.5)*pe,ut),Xe.rotateAround(ct,Z.rotation[2]),yt.set(Xe.x,Xe.y,Pt+(Ht+.5)*Ae),F(Z.id,yt,he)||(Me[Ut][Ht]+=Ze*at));Oe=ni(o.ground,w.getMonth(),Ke,at),Ze=Ke.dot(he);for(let Ut=0;Ut0&&(Xe.set(St+(Ut+.5)*pe,ft),Xe.rotateAround(ct,Z.rotation[2]),yt.set(Xe.x,Xe.y,Pt+(ce-(Ht+.5))*Ae),F(Z.id,yt,he)||(Pe[Ut][Ht]+=Ze*at));St=it-Se/2,Pt=Ve-ze/2,Oe=ni(o.ground,w.getMonth(),Ne,at),Ze=Ne.dot(he);for(let Ut=0;Ut0&&(Xe.set(ot,St+(Ut+.5)*ve),Xe.rotateAround(ct,Z.rotation[2]),yt.set(Xe.x,Xe.y,Pt+(Ht+.5)*Ae),F(Z.id,yt,he)||(Ee[Ut][Ht]+=Ze*at));Oe=ni(o.ground,w.getMonth(),De,at),Ze=De.dot(he);for(let Ut=0;Ut0&&(Xe.set(st,St+(Ut+.5)*ve),Xe.rotateAround(ct,Z.rotation[2]),yt.set(Xe.x,Xe.y,Pt+(Ht+.5)*Ae),F(Z.id,yt,he)||(Be[Ut][Ht]+=Ze*at))},B=Z=>{const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=me.dayOfYear(w),He=Z.lx,Se=Z.ly,ze=Z.lz,Ie=Math.max(2,Math.round(He/v)),ye=Math.max(2,Math.round(Se/v)),ce=He/Ie,pe=Se/ye,ve=Z.cx-He/2,Ae=Z.cy-Se/2,Te=new Xt(Z.cx,Z.cy),Me=new ie;let Pe=M.current.get(Z.id);(!Pe||Pe.length!==Ie||Pe[0].length!==ye)&&(Pe=Array(Ie).fill(0).map(()=>Array(ye).fill(0)),M.current.set(Z.id,Pe));const Ee=Ri(he,xe,b,yi.SPHERE_MODEL),Be=ni(o.ground,w.getMonth(),Io,Ee),Je=Io.dot(he),We=new Xt;for(let Ke=0;Ke0&&(We.set(ve+(Ke+.5)*ce,Ae+(Ne+.5)*pe),We.rotateAround(Te,Z.rotation[2]),Me.set(We.x,We.y,ze),F(Z.id,Me,he)||(Pe[Ke][Ne]+=Je*Ee))},_=Z=>{const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=a(Z);if(!xe)throw new Error("foundation of wall not found");const He=me.dayOfYear(w),Se=Z.lx,ze=me.getHighestPointOfWall(Z),Ie=Math.max(2,Math.round(Se/v)),ye=Math.max(2,Math.round(ze/v)),ce=Se/Ie,pe=ze/ye,ve=xe.rotation[2]+Z.relativeAngle,Ae=me.wallAbsolutePosition(new ie(Z.cx,Z.cy,Z.cz),xe).setZ(ze/2+xe.lz),Te=new ie(Math.cos(ve-Gt),Math.sin(ve-Gt),0),Me=ce*Math.cos(ve),Pe=ce*Math.sin(ve),Ee=new ie;let Be=M.current.get(Z.id);(!Be||Be.length!==Ie||Be[0].length!==ye)&&(Be=Array(Ie).fill(0).map(()=>Array(ye).fill(0)),M.current.set(Z.id,Be));const Je=me.getWallVertices(Z,1),We=(ze-Z.lz)/2,Ke=Ri(he,He,b,yi.SPHERE_MODEL),Ne=ni(o.ground,w.getMonth(),Te,Ke),De=Te.dot(he);for(let ke=0;ke0&&(Ee.set(Ae.x+it*Me,Ae.y+it*Pe,Ae.z+Ve*pe),F(Z.id,Ee,he)||(Be[ke][Ye]+=De*Ke)))}},X=Z=>{const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=a(Z);if(!xe)throw new Error("foundation of door not found");const He=i(Z);if(!He)throw new Error("parent of door not found");const Se=me.dayOfYear(w),ze=He,Ie=Z.lx*ze.lx,ye=Z.lz*ze.lz,ce=Math.max(2,Math.round(Ie/v)),pe=Math.max(2,Math.round(ye/v)),ve=Ie/ce,Ae=ye/pe,Te=xe.rotation[2]+ze.relativeAngle,Pe=me.wallAbsolutePosition(new ie(ze.cx,ze.cy,ze.cz),xe).setZ(ze.lz/2+xe.lz).clone().add(new ie(Z.cx*ze.lx,0,Z.cz*ze.lz)),Ee=new ie(Math.cos(Te-Gt),Math.sin(Te-Gt),0),Be=ve*Math.cos(Te),Je=ve*Math.sin(Te),We=new ie;let Ke=M.current.get(Z.id);(!Ke||Ke.length!==ce||Ke[0].length!==pe)&&(Ke=Array(ce).fill(0).map(()=>Array(pe).fill(0)),M.current.set(Z.id,Ke));const Ne=Ri(he,Se,b,yi.SPHERE_MODEL),De=ni(o.ground,w.getMonth(),Ee,Ne),ke=Ee.dot(he);if(Z.doorType===Pd.Arched)for(let Ye=0;Ye0&&(F(Z.id,We,he)||(Ke[Ye][it]+=ke*Ne)))}else for(let Ye=0;Ye0){const Ve=Ye-ce/2+.5,yt=it-pe/2+.5;We.set(Pe.x+Ve*Be,Pe.y+Ve*Je,Pe.z+yt*Ae),F(Z.id,We,he)||(Ke[Ye][it]+=ke*Ne)}},$=(Z,he,xe,He)=>{const Se=He[0][0].z,ze=me.dayOfYear(w),Ie=Ri(Z,ze,b,yi.SPHERE_MODEL),ye=new nn(0,0,xe.rotation[2],"ZYX");let ce=Number.MAX_VALUE,pe=Number.MAX_VALUE,ve=-Number.MAX_VALUE,Ae=-Number.MAX_VALUE;for(const De of He)for(const ke of De){const Ye=ke.clone().applyEuler(ye);Ye.x>ve&&(ve=Ye.x),Ye.xAe&&(Ae=Ye.y),Ye.yArray(Me).fill(0)),M.current.set(he.id,Be));const Je=new ie(ce+v/2,pe+v/2,xe.lz+Se+L0),We=new ie(0,0,Je.z),Ke=ni(o.ground,w.getMonth(),Io,Ie),Ne=Io.dot(Z);for(let De=0;De0&&(We.y=Je.y+ke*Ee,F(he.id,We,Z)||(Be[De][ke]+=Ne*Ie))}},Q=Z=>{if(Z.roofType!==Go.Pyramid)throw new Error("roof is not pyramid");const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=a(Z);if(!xe)throw new Error("foundation of wall not found");const He=f(Z.id);if(!He||He.length===0)return;let Se=!0;const ze=He[0][0].z;for(const Ie of He)for(const ye of Ie)if(Math.abs(ye.z-ze)>.01){Se=!1;break}if(Se)$(he,Z,xe,He);else{const Ie=me.dayOfYear(w),ye=new nn(0,0,xe.rotation[2],"ZYX"),ce=Ri(he,Ie,b,yi.SPHERE_MODEL);for(const[pe,ve]of He.entries()){const Ae=Z.id+"-"+pe,Te=ve[0].clone().applyEuler(ye),Me=ve[1].clone().applyEuler(ye),Pe=ve[2].clone().applyEuler(ye),Ee=new ie().subVectors(Me,Te),Be=new ie().subVectors(Pe,Te),Je=new ie().subVectors(Pe,Me),We=Ee.length(),Ke=new ie().crossVectors(Be,Je).length()/We,Ne=Math.max(2,Math.round(We/v)),De=Math.max(2,Math.round(Ke/v));let ke=M.current.get(Ae);(!ke||ke.length!==Ne||ke[0].length!==De)&&(ke=Array(Ne).fill(0).map(()=>Array(De).fill(0)),M.current.set(Ae,ke)),Ee.normalize(),Be.normalize(),Je.normalize();const Ye=new ie().crossVectors(Be,Je).normalize(),it=Ee.multiplyScalar(.5*We/Ne),Ve=new ie().crossVectors(Ye,Ee).normalize().multiplyScalar(.5*Ke/De),yt=new ie(xe.cx+Te.x,xe.cy+Te.y,xe.lz+Te.z+L0);yt.add(it).add(Ve),it.multiplyScalar(2),Ve.multiplyScalar(2);const ct=new ie,Xe=ni(o.ground,w.getMonth(),Ye,ce),ut=Ye.dot(he);for(let ft=0;ft0&&(ct.copy(yt).add(ot).add(Ve.clone().multiplyScalar(st)),F(Ae,ct,he)||(ke[ft][st]+=ut*ce))}}}},le=Z=>{if(Z.roofType!==Go.Mansard)throw new Error("roof is not mansard");const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=a(Z);if(!xe)throw new Error("foundation of wall not found");const He=f(Z.id);if(!He||He.length===0)return;let Se=!0;const ze=He[0][0].z;for(const Ie of He)for(const ye of Ie)if(Math.abs(ye.z-ze)>.01){Se=!1;break}if(Se)$(he,Z,xe,He);else{const Ie=me.dayOfYear(w),ye=new nn(0,0,xe.rotation[2],"ZYX"),ce=Ri(he,Ie,b,yi.SPHERE_MODEL);for(const[pe,ve]of He.entries()){const Ae=Z.id+"-"+pe;if(pe===He.length-1){let Te=Number.MAX_VALUE,Me=Number.MAX_VALUE,Pe=-Number.MAX_VALUE,Ee=-Number.MAX_VALUE;for(const yt of ve){const ct=yt.clone().applyEuler(ye);ct.x>Pe&&(Pe=ct.x),ct.xEe&&(Ee=ct.y),ct.yArray(We).fill(0)),M.current.set(Ae,De));const ke=new ie(Te+v/2,Me+v/2,xe.lz+Be+L0),Ye=new ie(0,0,ke.z),it=ni(o.ground,w.getMonth(),Io,ce),Ve=Io.dot(he);for(let yt=0;yt0&&(Ye.y=ke.y+ct*Ne,F(Ae,Ye,he)||(De[yt][ct]+=Ve*ce))}}else{const Te=ve[0].clone().applyEuler(ye),Me=ve[1].clone().applyEuler(ye),Pe=ve[2].clone().applyEuler(ye),Ee=new ie().subVectors(Me,Te),Be=new ie().subVectors(Pe,Te),Je=new ie().subVectors(Pe,Me),We=Ee.length(),Ke=new ie().crossVectors(Be,Je).length()/We,Ne=Math.max(2,Math.round(We/v)),De=Math.max(2,Math.round(Ke/v));let ke=M.current.get(Ae);(!ke||ke.length!==Ne||ke[0].length!==De)&&(ke=Array(Ne).fill(0).map(()=>Array(De).fill(0)),M.current.set(Ae,ke)),Ee.normalize(),Be.normalize(),Je.normalize();const Ye=new ie().crossVectors(Be,Je).normalize(),it=Ee.multiplyScalar(.5*We/Ne),Ve=new ie().crossVectors(Ye,Ee).normalize().multiplyScalar(.5*Ke/De),yt=new ie(xe.cx+Te.x,xe.cy+Te.y,xe.lz+Te.z+L0);yt.add(it).add(Ve),it.multiplyScalar(2),Ve.multiplyScalar(2);const ct=new ie,Xe=ni(o.ground,w.getMonth(),Ye,ce),ut=Ye.dot(he);for(let ft=0;ft0&&(ct.copy(yt).add(ot).add(Ve.clone().multiplyScalar(st)),F(Ae,ct,he)||(ke[ft][st]+=ut*ce))}}}}},q=Z=>{if(Z.roofType!==Go.Gambrel)throw new Error("roof is not gambrel");const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=a(Z);if(!xe)throw new Error("foundation of wall not found");const He=f(Z.id);if(!He||He.length===0)return;let Se=!0;const ze=He[0][0].z;for(const Ie of He)for(const ye of Ie)if(Math.abs(ye.z-ze)>.01){Se=!1;break}if(Se)$(he,Z,xe,He);else{const Ie=me.dayOfYear(w),ye=new nn(0,0,xe.rotation[2],"ZYX"),ce=Ri(he,Ie,b,yi.SPHERE_MODEL);for(const[pe,ve]of He.entries()){const Ae=Z.id+"-"+pe,Te=ve[0].clone().applyEuler(ye),Me=ve[1].clone().applyEuler(ye),Pe=ve[2].clone().applyEuler(ye),Ee=new ie().subVectors(Me,Te),Be=new ie().subVectors(Pe,Te),Je=new ie().subVectors(Pe,Me),We=Ee.length(),Ke=new ie().crossVectors(Be,Je).length()/We,Ne=Math.max(2,Math.round(We/v)),De=Math.max(2,Math.round(Ke/v));let ke=M.current.get(Ae);(!ke||ke.length!==Ne||ke[0].length!==De)&&(ke=Array(Ne).fill(0).map(()=>Array(De).fill(0)),M.current.set(Ae,ke)),Ee.normalize(),Be.normalize(),Je.normalize();const Ye=new ie().crossVectors(Be,Je).normalize(),it=Ee.multiplyScalar(.5*We/Ne),Ve=new ie().crossVectors(Ye,Ee).normalize().multiplyScalar(.5*Ke/De),yt=new ie(xe.cx+Te.x,xe.cy+Te.y,xe.lz+Te.z+L0);yt.add(it).add(Ve),it.multiplyScalar(2),Ve.multiplyScalar(2);const ct=new ie,Xe=ni(o.ground,w.getMonth(),Ye,ce),ut=Ye.dot(he);for(let ft=0;ft0&&(ct.copy(yt).add(ot).add(Ve.clone().multiplyScalar(st)),F(Ae,ct,he)||(ke[ft][st]+=ut*ce))}}}},te=Z=>{if(Z.roofType!==Go.Hip)throw new Error("roof is not hip");const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=a(Z);if(!xe)throw new Error("foundation of wall not found");const He=f(Z.id);if(!He||He.length===0)return;let Se=!0;const ze=He[0][0].z;for(const Ie of He)for(const ye of Ie)if(Math.abs(ye.z-ze)>.01){Se=!1;break}if(Se)$(he,Z,xe,He);else{const Ie=me.dayOfYear(w),ye=new nn(0,0,xe.rotation[2],"ZYX"),ce=Ri(he,Ie,b,yi.SPHERE_MODEL);for(const[pe,ve]of He.entries()){const Ae=Z.id+"-"+pe,Te=ve[0].clone().applyEuler(ye),Me=ve[1].clone().applyEuler(ye),Pe=ve[2].clone().applyEuler(ye),Ee=new ie().subVectors(Me,Te),Be=new ie().subVectors(Pe,Te),Je=new ie().subVectors(Pe,Me),We=Ee.length(),Ke=new ie().crossVectors(Be,Je).length()/We,Ne=Math.max(2,Math.round(We/v)),De=Math.max(2,Math.round(Ke/v));let ke=M.current.get(Ae);(!ke||ke.length!==Ne||ke[0].length!==De)&&(ke=Array(Ne).fill(0).map(()=>Array(De).fill(0)),M.current.set(Ae,ke)),Ee.normalize(),Be.normalize(),Je.normalize();const Ye=new ie().crossVectors(Be,Je).normalize(),it=Ee.multiplyScalar(.5*We/Ne),Ve=new ie().crossVectors(Ye,Ee).normalize().multiplyScalar(.5*Ke/De),yt=new ie,ct=new ie(xe.cx+Te.x,xe.cy+Te.y,xe.lz+Te.z+L0);ct.add(it).add(Ve),it.multiplyScalar(2),Ve.multiplyScalar(2);const Xe=ni(o.ground,w.getMonth(),Ye,ce),ut=Ye.dot(he);for(let ft=0;ft0&&(yt.copy(ct).add(ot).add(Ve.clone().multiplyScalar(st)),F(Ae,yt,he)||(ke[ft][st]+=ut*ce))}}}},re=Z=>{if(Z.roofType!==Go.Gable)throw new Error("roof is not gable");const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=a(Z);if(!xe)throw new Error("foundation of wall not found");const He=f(Z.id);if(!He||He.length===0)return;const Se=me.dayOfYear(w),ze=new nn(0,0,xe.rotation[2],"ZYX"),Ie=Ri(he,Se,b,yi.SPHERE_MODEL);for(const[ye,ce]of He.entries()){const pe=Z.id+"-"+ye,ve=ce[0].clone().applyEuler(ze),Ae=ce[1].clone().applyEuler(ze),Te=ce[2].clone().applyEuler(ze),Me=new ie().subVectors(Ae,ve),Pe=new ie().subVectors(Te,ve),Ee=new ie().subVectors(Te,Ae),Be=Me.length(),Je=new ie().crossVectors(Pe,Ee).length()/Be,We=Math.max(2,Math.round(Be/v)),Ke=Math.max(2,Math.round(Je/v));let Ne=M.current.get(pe);(!Ne||Ne.length!==We||Ne[0].length!==Ke)&&(Ne=Array(We).fill(0).map(()=>Array(Ke).fill(0)),M.current.set(pe,Ne)),Me.normalize(),Pe.normalize(),Ee.normalize();const De=new ie().crossVectors(Pe,Ee).normalize(),ke=Me.multiplyScalar(.5*Be/We),Ye=new ie().crossVectors(De,Me).normalize().multiplyScalar(.5*Je/Ke),it=new ie(xe.cx+ve.x,xe.cy+ve.y,xe.lz+ve.z+L0);it.add(ke).add(Ye),ke.multiplyScalar(2),Ye.multiplyScalar(2);const Ve=new ie,yt=ni(o.ground,w.getMonth(),De,Ie),ct=De.dot(he);for(let Xe=0;Xe0&&(Ve.copy(it).add(ut).add(Ye.clone().multiplyScalar(ft)),F(pe,Ve,he)||(Ne[Xe][ft]+=ct*Ie))}}},ae=Z=>{const he=Ei(w,o.latitude);if(he.z<=0)return;let xe=i(Z);if(!xe)throw new Error("parent of solar panel does not exist");const He=Z.parentType===z.Roof,Se=Z.parentType===z.Wall;if(He&&(xe=a(xe),!xe))throw new Error("foundation of solar panel does not exist");const ze=me.dayOfYear(w),Ie=Se?me.absoluteCoordinates(Z.cx,Z.cy,Z.cz,xe,a(Z),Z.lz):me.absoluteCoordinates(Z.cx,Z.cy,Z.cz,xe,void 0,void 0,!0),ye=xe.rotation[2];let ce=ye+(Se?0:Z.relativeAzimuth),pe=Z.tiltAngle,ve=!0;if(He&&(Ie.z=Z.cz+Z.lz+.02+xe.cz,me.isZero(Z.rotation[0])?Ie.z+=Z.poleHeight:(pe=Z.rotation[0],ce=ye,ve=!1)),Se&&!me.isZero(Z.tiltAngle)){const ft=xe,ot=a(xe),at=(ot?ot.rotation[2]+ft.relativeAngle:ft.relativeAngle)-Gt,Oe=Z.ly*Math.abs(Math.sin(Z.tiltAngle))/2;Ie.x+=Oe*Math.cos(at),Ie.y+=Oe*Math.sin(at)}const Ae=new ie().fromArray(Z.normal),Te=Z.lx,Me=Z.ly,Pe=Math.max(2,Math.round(Z.lx/v)),Ee=Math.max(2,Math.round(Z.ly/v)),Be=Te/Pe,Je=Me/Ee,We=Ie.x-(Te-v)/2,Ke=Ie.y-(Me-v)/2,Ne=He||Se?Ie.z:xe.lz+Z.poleHeight+Z.lz,De=new Xt(Ie.x,Ie.y),ke=new ie;let Ye=M.current.get(Z.id);(!Ye||Ye.length!==Pe||Ye[0].length!==Ee)&&(Ye=Array(Pe).fill(0).map(()=>Array(Ee).fill(0)),M.current.set(Z.id,Ye));let it=new nn(He&&!ve?0:pe,0,ce,"ZYX");if(Z.trackerType!==za.NO_TRACKER){const ft=ye?he.clone().applyAxisAngle(Io,-ye):he.clone();switch(Z.trackerType){case za.ALTAZIMUTH_DUAL_AXIS_TRACKER:{const ot=new bs().setFromUnitVectors(Io,ft);it=new nn().setFromQuaternion(ot),it.z+=ce;break}case za.HORIZONTAL_SINGLE_AXIS_TRACKER:{const ot=new bs().setFromUnitVectors(Io,new ie(ft.x,0,ft.z).normalize());it=new nn().setFromQuaternion(ot),it.z+=ce;break}case za.VERTICAL_SINGLE_AXIS_TRACKER:{if(Math.abs(Z.tiltAngle)>.001){const ot=new ie(ft.x,-ft.y,0).normalize(),st=Math.acos(Oc.dot(ot))*Math.sign(ot.x);it=new nn(Z.tiltAngle,0,st+ye,"ZYX")}break}case za.TILTED_SINGLE_AXIS_TRACKER:break}}if(Se&&Ae.applyEuler(new nn(0,0,xe.relativeAngle)),Ae.applyEuler(it),He&&!ve&&(it.x=Z.rotation[0],it.z=Z.rotation[2]+ye),Se){const ft=i(Z);ft&&(it.x=Gt+Z.tiltAngle,it.z=xe.relativeAngle+ft.rotation[2])}const Ve=Ri(he,ze,b,yi.SPHERE_MODEL),yt=ni(o.ground,w.getMonth(),Ae,Ve),ct=Ae.dot(he),Xe=new Xt,ut=new ie;for(let ft=0;ft0&&(Xe.set(We+ft*Be,Ke+ot*Je),ut.set(Xe.x-De.x,Xe.y-De.y,0),ut.applyEuler(it),ke.set(Ie.x+ut.x,Ie.y+ut.y,Ne+ut.z),F(Z.id,ke,he)||(Ye[ft][ot]+=ct*Ve))},se=Z=>{const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=i(Z);if(!xe)throw new Error("parent of parabolic trough does not exist");const He=me.dayOfYear(w),Se=me.absoluteCoordinates(Z.cx,Z.cy,Z.cz,xe),ze=new ie().fromArray(Z.normal),Ie=ze.clone(),ye=Z.lx,ce=Z.ly,pe=ye*ye/(4*Z.latusRectum),ve=Z.poleHeight+ye/2,Ae=Math.max(2,Math.round(Z.lx/v)),Te=Math.max(2,Math.round(Z.ly/v)),Me=ye/Ae,Pe=ce/Te,Ee=Se.x-(ye-v)/2,Be=Se.y-(ce-v)/2,Je=xe.lz+ve+Z.lz+pe,We=new Xt(Se.x,Se.y),Ke=new ie;let Ne=M.current.get(Z.id);(!Ne||Ne.length!==Ae||Ne[0].length!==Te)&&(Ne=Array(Ae).fill(0).map(()=>Array(Te).fill(0)),M.current.set(Z.id,Ne));const De=xe.rotation[2],ke=De+Z.relativeAzimuth,Ye=me.isZero(ke),it=Ye?1:Math.cos(ke),Ve=Ye?0:Math.sin(ke),yt=De?he.clone().applyAxisAngle(Io,-De):he.clone(),ct=new bs().setFromUnitVectors(Io,new ie(yt.x*it,yt.x*Ve,yt.z).normalize()),Xe=new nn().setFromQuaternion(ct);ze.copy(Ie.clone().applyEuler(Xe));const ut=Ri(he,He,b,yi.SPHERE_MODEL),ft=ni(o.ground,w.getMonth(),ze,ut),ot=ze.dot(he),st=new Xt,at=new ie;let Oe=0,Ze=0,St=1;const Pt=4/(Z.latusRectum*Z.latusRectum);for(let Rt=0;Rt0&&(st.set(Oe,Be+Ut*Pe),Ye||st.rotateAround(We,ke),at.set(st.x-We.x,st.y-We.y,0),at.applyEuler(Xe),Ke.set(Se.x+at.x,Se.y+at.y,Je+at.z),F(Z.id,Ke,he)||(Ne[Rt][Ut]+=ot*ut*St))}},ne=Z=>{const he=Ei(w,o.latitude);if(he.z<=0)return;const xe=i(Z);if(!xe)throw new Error("parent of parabolic dish does not exist");const He=me.dayOfYear(w),Se=me.absoluteCoordinates(Z.cx,Z.cy,Z.cz,xe),ze=new ie().fromArray(Z.normal),Ie=ze.clone(),ye=Z.lx,ce=Z.ly,pe=ye*ye/(4*Z.latusRectum),ve=Z.poleHeight+ye/2,Ae=Math.max(2,Math.round(Z.lx/v)),Te=Math.max(2,Math.round(Z.ly/v)),Me=ye/Ae,Pe=ce/Te,Ee=Se.x-(ye-v)/2,Be=Se.y-(ce-v)/2,Je=xe.lz+ve+Z.lz+pe,We=new Xt(Se.x,Se.y),Ke=new ie;let Ne=M.current.get(Z.id);(!Ne||Ne.length!==Ae||Ne[0].length!==Te)&&(Ne=Array(Ae).fill(0).map(()=>Array(Te).fill(0)),M.current.set(Z.id,Ne));const De=xe.rotation[2],ke=De+Z.relativeAzimuth,Ye=me.isZero(ke),it=De?he.clone().applyAxisAngle(Io,-De):he.clone(),Ve=new bs().setFromUnitVectors(Io,it),yt=new nn().setFromQuaternion(Ve);ze.copy(Ie.clone().applyEuler(yt));const ct=Ri(he,He,b,yi.SPHERE_MODEL),Xe=ni(o.ground,w.getMonth(),ze,ct),ut=ze.dot(he),ft=new Xt,ot=new ie;let st=0,at=0,Oe=0,Ze=0,St=1;const Pt=4/(Z.latusRectum*Z.latusRectum);for(let Rt=0;Rtye/2))for(let Ut=0;Utce/2)&&(Ne[Rt][Ut]+=Xe,ut>0&&(ft.set(st,at),Ye||ft.rotateAround(We,ke),ot.set(ft.x-We.x,ft.y-We.y,0),ot.applyEuler(yt),Ke.set(Se.x+ot.x,Se.y+ot.y,Je+ot.z),F(Z.id,Ke,he)||(St=1/Math.sqrt(1+(Oe*Oe+Ze*Ze)*Pt),Ne[Rt][Ut]+=ut*ct*St)))},fe=Z=>{const he=Ei(w,o.latitude);if(he.zArray(Me).fill(0)),M.current.set(Z.id,De));const Ye=xe.rotation[2]+Z.relativeAzimuth,it=me.isZero(Ye),Ve=it?1:Math.cos(Ye),yt=it?0:Math.sin(Ye),ct=He.solarStructure===Dn.FocusPipe?new ie((He.cx-Ie.x)*Ve,(He.cy-Ie.y)*yt,He.cz-Ie.z+He.lz/2+(Se.absorberHeight??10)):void 0,Xe=new ie(yt,Ve,0),ut=new ie;let ft,ot;if(ct){ut.set(ct.x,ct.y,ct.z);const Rt=-ct.z*(he.y*Xe.y+he.x*Xe.x)/he.z;ut.x+=Rt*Xe.x,ut.y-=Rt*Xe.y,ot=ut.clone().normalize();let Ut=ot.add(he).normalize();me.isSame(Ut,Io)&&(Ut=new ie(-.001,0,1).normalize()),it||Ut.applyAxisAngle(Io,-Ye),ft=new nn(0,Math.atan2(Ut.x,Ut.z),Ye,"ZXY"),ye.copy(ce.clone().applyEuler(ft))}else ot=new ie(0,0,1),ft=new nn;const st=Ri(he,ze,b,yi.SPHERE_MODEL),at=ni(o.ground,w.getMonth(),ye,st),Oe=ye.dot(he),Ze=new Xt,St=new ie;let Pt=0;if(d)for(let Rt=0;Rt0&&(Ze.set(Pt,Je+Ut*Ee),St.set(Ze.x-Ke.x,Ze.y-Ke.y,0),St.applyEuler(ft),Ne.set(Ie.x+St.x,Ie.y+St.y,We+St.z),!F(Z.id,Ne,he)&&!F(Z.id,Ne,ot)&&(De[Rt][Ut]+=Oe*st))}else for(let Rt=0;Rt0&&(Ze.set(Pt,Je+Ut*Ee),St.set(Ze.x-Ke.x,Ze.y-Ke.y,0),St.applyEuler(ft),Ne.set(Ie.x+St.x,Ie.y+St.y,We+St.z),F(Z.id,Ne,he)||(De[Rt][Ut]+=Oe*st))}},ge=Z=>{const he=Ei(w,o.latitude);if(he.zArray(Me).fill(0)),M.current.set(Z.id,De));const ke=xe.rotation[2],Ye=He.solarStructure===Dn.FocusTower?new ie(He.cx-Ie.x,He.cy-Ie.y,He.cz-Ie.z+(Se.towerHeight??20)):void 0;let it,Ve;if(Ye){it=Ye.clone().normalize();let st=it.clone().add(he).normalize();me.isSame(st,Io)&&(st=new ie(-.001,0,1).normalize()),ke&&st.applyAxisAngle(Io,-ke);const at=Math.hypot(st.x,st.y);Ve=new nn(Math.atan2(at,st.z),0,Math.atan2(st.y,st.x)+Gt,"ZXY"),ye.copy(ce.clone().applyEuler(Ve))}else it=new ie(0,0,1),Ve=new nn;const yt=Ri(he,ze,b,yi.SPHERE_MODEL),ct=ni(o.ground,w.getMonth(),ye,yt),Xe=ye.dot(he),ut=new Xt,ft=new ie;let ot=0;if(d)for(let st=0;st0&&(ut.set(ot,Je+at*Ee),ft.set(ut.x-Ke.x,ut.y-Ke.y,0),ft.applyEuler(Ve),Ne.set(Ie.x+ft.x,Ie.y+ft.y,We+ft.z),!F(Z.id,Ne,he)&&!F(Z.id,Ne,it)&&(De[st][at]+=Xe*yt))}else for(let st=0;st0&&(ut.set(ot,Je+at*Ee),ft.set(ut.x-Ke.x,ut.y-Ke.y,0),ft.applyEuler(Ve),Ne.set(Ie.x+ft.x,Ie.y+ft.y,We+ft.z),F(Z.id,Ne,he)||(De[st][at]+=Xe*yt))}},de=Z=>{const he=Z.solarUpdraftTower;if(!he)return;const xe=Ei(w,o.latitude);if(xe.z<=0)return;const He=me.dayOfYear(w),Se=new ie().fromArray(Z.normal),ze=he.collectorRadius,Ie=Math.max(2,Math.round(ze*2/v)),ye=Z.cx-ze+v/2,ce=Z.cy-ze+v/2,pe=Z.lz+he.collectorHeight,ve=Z.id+"-sut";let Ae=M.current.get(ve);(!Ae||Ae.length!==Ie||Ae[0].length!==Ie)&&(Ae=Array(Ie).fill(0).map(()=>Array(Ie).fill(0)),M.current.set(ve,Ae));const Te=Ri(xe,He,b,yi.SPHERE_MODEL),Me=ni(o.ground,w.getMonth(),Se,Te),Pe=new ie(0,0,pe),Ee=Se.dot(xe),Be=ze*ze;let Je,We;for(let Ke=0;KeBe)&&(Ae[Ke][Ne]+=Me,Ee>0&&(F(ve,Pe,xe)||(Ae[Ke][Ne]+=Ee*Te)))}};return h.jsx(h.Fragment,{})}),ejo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(da),r=H.getState().world,i=H.getState().elements,a=H(qr),l=Tn(ivt),s=H(yW),c=Tn(lvt),u=H(AW),d=H(ZYe),f=H(eOe),p=Tn(svt),g=ht(evt),y=ht(tvt),w=ht(nvt),b=ht(ovt),C=H(kBe),{scene:P}=oi(),v=Jt(),T=f1(t),A=new Date(r.date),x=t?T==null?void 0:T.elevation:0,S=r.cspTimesPerHour??4,R=60/S,M=r.cspDaysPerYear??6,D=12/M,E=m.useMemo(()=>new l0,[]),W=r.monthlyIrradianceLosses??new Array(12).fill(.05),j=r.cspGridCellSize??.5,L=m.useRef([]),k=m.useRef([]),N=m.useRef(0),F=m.useRef(!1),U=m.useRef(new Date(r.date)),O=m.useRef(new Map),B=m.useRef(new Map),_=m.useRef(0),X=m.useRef(!1),$=m.useRef(new Date(r.date)),Q=m.useMemo(()=>dl(A,r.latitude),[r.date,r.latitude]),le=m.useRef(Q),q=me.daysInYear(A)/12;m.useEffect(()=>{if(g)return te(),N.current=requestAnimationFrame(re),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[g]),m.useEffect(()=>{X.current=w,w?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),re())},[w]);const te=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),A.setHours(Math.floor(Q.sunrise/60),R/2-30)),F.current=!1,ze(),Ie()},re=()=>{if(g&&!X.current){if(A.getMinutes()+A.getHours()*60>=Q.sunset){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showDailyParabolicTroughYieldPanel=!0,pe.selectedFloatingWindow="dailyParabolicTroughYieldPanel"}),ht.getState().set(pe=>{pe.runDailySimulationForParabolicTroughs=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,ae(),o&&e(pe=>{const ve=Tn.getState().sumDailyParabolicTroughYield();pe.actionInfo={name:"Daily Simulation for Parabolic Troughs Completed",result:{totalYield:ve},details:Tn.getState().dailyParabolicTroughYield,timestamp:new Date().getTime()}});return}A.setHours(A.getHours(),A.getMinutes()+R),e(pe=>{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.ParabolicTrough&&Z(pe);N.current=requestAnimationFrame(re)}},ae=()=>{const ce=he();for(const pe of i)if(pe.type===z.ParabolicTrough){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=He(ve)*ce;for(let Me=0;Me{var ce;if(d){const pe=new Array(24).fill(0),ve=new Map;let Ae=0;const Te=[];for(const Pe of i)if(Pe.type===z.ParabolicTrough){const Ee=O.current.get(Pe.id);if(Ee){s(Pe.id,Ee.reduce((Be,Je)=>Be+Je,0)),Ae++,ve.set("Trough"+Ae,Ee),Te.push(Pe.label??"Trough"+Ae);for(let Be=0;Be<24;Be++)pe[Be]+=Ee[Be]}}const Me=[];for(let Pe=0;Pe<24;Pe++){const Ee={};Ee.Hour=Pe;for(let Be=1;Be<=Ae;Be++){const Je="Trough"+Be;Ee[Te[Be-1]]=(ce=ve.get(Je))==null?void 0:ce[Pe]}Me.push(Ee)}l(Me),p(Te)}else{const pe=new Array(24).fill(0);for(const Ae of i)if(Ae.type===z.ParabolicTrough){const Te=O.current.get(Ae.id);if(Te){s(Ae.id,Te.reduce((Me,Pe)=>Me+Pe,0));for(let Me=0;Me<24;Me++)pe[Me]+=Te[Me]}}const ve=[];for(let Ae=0;Ae<24;Ae++)ve.push({Hour:Ae,Total:pe[Ae]});l(ve)}};m.useEffect(()=>{if(y)return ne(),N.current=requestAnimationFrame(fe),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[y]),m.useEffect(()=>{X.current=b,b?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),fe())},[b]);const ne=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),_.current=0,A.setMonth(0,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),e(ce=>{ce.world.date=A.toLocaleString("en-US")})),F.current=!1,ze(),Ie(),ye()},fe=()=>{if(y&&!X.current)if(A.getMinutes()+A.getHours()*60{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.ParabolicTrough&&Z(pe);N.current=requestAnimationFrame(fe)}else{if(ge(),_.current++,_.current===M){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showYearlyParabolicTroughYieldPanel=!0,pe.selectedFloatingWindow="yearlyParabolicTroughYieldPanel"}),ht.getState().set(pe=>{pe.runYearlySimulationForParabolicTroughs=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,de(),o&&e(pe=>{const ve=Tn.getState().sumYearlyParabolicTroughYield();pe.actionInfo={name:"Yearly Simulation for Parabolic Troughs Completed",result:{totalYield:ve},details:Tn.getState().yearlyParabolicTroughYield,timestamp:new Date().getTime()}});return}A.setMonth(_.current*D,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),Ie(),N.current=requestAnimationFrame(fe)}},ge=()=>{const ce=xe();for(const pe of i)if(pe.type===z.ParabolicTrough){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=B.current.get(ve.id);if(Te){const Me=Ae.reduce((Pe,Ee)=>Pe+Ee,0);Te[_.current]+=Me*ce*He(ve)}}}C&&ae()},de=()=>{if(f){const ce=[],pe=[];let ve=0;for(const Te of i)if(Te.type===z.ParabolicTrough){const Me=B.current.get(Te.id);Me&&(u(Te.id,Me.reduce((Pe,Ee)=>Pe+Ee,0)*D*q),ce.push(Me),ve++,pe.push(Te.label??"Trough"+ve))}const Ae=[];for(let Te=0;Te<12;Te+=D){const Me={};Me.Month=Ms[Te];for(const[Pe,Ee]of ce.entries())Me[pe[Pe]]=Ee[Te/D]*q;Ae.push(Me)}c(Ae),p(pe)}else{const ce=[];for(const ve of i)if(ve.type===z.ParabolicTrough){const Ae=B.current.get(ve.id);Ae&&(u(ve.id,Ae.reduce((Te,Me)=>Te+Me,0)*D*q),ce.push(Ae))}const pe=[];for(let ve=0;ve<12;ve+=D){let Ae=0;for(const Te of ce)Ae+=Te[ve/D];pe.push({Month:Ms[ve],Total:Ae*q})}c(pe)}},Z=ce=>{const pe=Ei(A,r.latitude);if(pe.z0&&(Rt.set(Ve+kt*De,yt+gt*ke),Be||Rt.rotateAround(Xe,Ee),Ut.set(Rt.x-Xe.x,Rt.y-Xe.y,0),Ut.applyEuler(Ze),ut.set(Te.x+Ut.x,Te.y+Ut.y,ct+Ut.z),Se(ce.id,ut,pe)||(Ht+=Pt*St));const At=O.current.get(ce.id);if(At){const kt=A.getMinutes()>=30?A.getHours()+1===24?0:A.getHours()+1:A.getHours();At[kt]+=Ht/(Ke*Ne)}},he=()=>{const ce=Q.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},xe=()=>{const ce=le.current.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},He=ce=>ce.lx*ce.ly*ce.opticalEfficiency*ce.thermalEfficiency*ce.absorptance*ce.reflectance*(1-W[A.getMonth()]),Se=(ce,pe,ve)=>{if(L.current.length>1){k.current.length=0,E.set(pe,ve);const Ae=L.current.filter(Te=>Te.uuid!==ce);return E.intersectObjects(Ae,!1,k.current),k.current.length>0}return!1},ze=()=>{const ce=P.children.filter(pe=>pe.name==="Content");if(ce.length>0){const pe=ce[0].children;L.current.length=0;for(const ve of pe)me.fetchSimulationElements(ve,L.current)}},Ie=()=>{for(const ce of i)if(ce.type===z.ParabolicTrough){const pe=O.current.get(ce.id);pe?pe.fill(0):O.current.set(ce.id,new Array(24).fill(0))}},ye=()=>{for(const ce of i)if(ce.type===z.ParabolicTrough){const pe=B.current.get(ce.id);pe&&pe.length===M?pe.fill(0):B.current.set(ce.id,new Array(M).fill(0))}};return h.jsx(h.Fragment,{})}),tjo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(da),r=H.getState().world,i=H.getState().elements,a=H(qr),l=Tn(Ovt),s=H(yW),c=Tn(Vvt),u=H(AW),d=H(dOe),f=H(fOe),p=Tn(Gvt),g=ht(Nvt),y=ht(Uvt),w=ht(jvt),b=ht(Bvt),C=H(LBe),{scene:P}=oi(),v=Jt(),T=f1(t),A=new Date(r.date),x=t?T==null?void 0:T.elevation:0,S=r.cspTimesPerHour??4,R=60/S,M=r.cspDaysPerYear??6,D=12/M,E=m.useMemo(()=>new l0,[]),W=r.monthlyIrradianceLosses??new Array(12).fill(.05),j=r.cspGridCellSize??.5,L=m.useRef([]),k=m.useRef([]),N=m.useRef(0),F=m.useRef(!1),U=m.useRef(new Date(r.date)),O=m.useRef(new Map),B=m.useRef(new Map),_=m.useRef(0),X=m.useRef(!1),$=m.useRef(new Date(r.date)),Q=m.useMemo(()=>dl(A,r.latitude),[r.date,r.latitude]),le=m.useRef(Q),q=me.daysInYear(A)/12;m.useEffect(()=>{if(g)return te(),N.current=requestAnimationFrame(re),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[g]),m.useEffect(()=>{X.current=w,w?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),re())},[w]);const te=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),A.setHours(Math.floor(Q.sunrise/60),R/2-30)),F.current=!1,ze(),Ie()},re=()=>{if(g&&!X.current){if(A.getMinutes()+A.getHours()*60>=Q.sunset){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showDailyParabolicDishYieldPanel=!0,pe.selectedFloatingWindow="dailyParabolicDishYieldPanel"}),ht.getState().set(pe=>{pe.runDailySimulationForParabolicDishes=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,ae(),o&&e(pe=>{const ve=Tn.getState().sumDailyParabolicDishYield();pe.actionInfo={name:"Daily Simulation for Parabolic Dishes Completed",result:{totalYield:ve},details:Tn.getState().dailyParabolicDishYield,timestamp:new Date().getTime()}});return}A.setHours(A.getHours(),A.getMinutes()+R),e(pe=>{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.ParabolicDish&&Z(pe);N.current=requestAnimationFrame(re)}},ae=()=>{const ce=he();for(const pe of i)if(pe.type===z.ParabolicDish){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=He(ve)*ce;for(let Me=0;Me{var ce;if(d){const pe=new Array(24).fill(0),ve=new Map;let Ae=0;const Te=[];for(const Pe of i)if(Pe.type===z.ParabolicDish){const Ee=O.current.get(Pe.id);if(Ee){s(Pe.id,Ee.reduce((Be,Je)=>Be+Je,0)),Ae++,ve.set("Dish"+Ae,Ee),Te.push(Pe.label??"Dish"+Ae);for(let Be=0;Be<24;Be++)pe[Be]+=Ee[Be]}}const Me=[];for(let Pe=0;Pe<24;Pe++){const Ee={};Ee.Hour=Pe;for(let Be=1;Be<=Ae;Be++){const Je="Dish"+Be;Ee[Te[Be-1]]=(ce=ve.get(Je))==null?void 0:ce[Pe]}Me.push(Ee)}l(Me),p(Te)}else{const pe=new Array(24).fill(0);for(const Ae of i)if(Ae.type===z.ParabolicDish){const Te=O.current.get(Ae.id);if(Te){s(Ae.id,Te.reduce((Me,Pe)=>Me+Pe,0));for(let Me=0;Me<24;Me++)pe[Me]+=Te[Me]}}const ve=[];for(let Ae=0;Ae<24;Ae++)ve.push({Hour:Ae,Total:pe[Ae]});l(ve)}};m.useEffect(()=>{if(y)return ne(),N.current=requestAnimationFrame(fe),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[y]),m.useEffect(()=>{X.current=b,b?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),fe())},[b]);const ne=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),_.current=0,A.setMonth(0,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),e(ce=>{ce.world.date=A.toLocaleString("en-US")})),F.current=!1,ze(),Ie(),ye()},fe=()=>{if(y&&!X.current)if(A.getMinutes()+A.getHours()*60{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.ParabolicDish&&Z(pe);N.current=requestAnimationFrame(fe)}else{if(ge(),_.current++,_.current===M){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showYearlyParabolicDishYieldPanel=!0,pe.selectedFloatingWindow="yearlyParabolicDishYieldPanel"}),ht.getState().set(pe=>{pe.runYearlySimulationForParabolicDishes=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,de(),o&&e(pe=>{const ve=Tn.getState().sumYearlyParabolicDishYield();pe.actionInfo={name:"Yearly Simulation for Parabolic Dishes Completed",result:{totalYield:ve},details:Tn.getState().yearlyParabolicDishYield,timestamp:new Date().getTime()}});return}A.setMonth(_.current*D,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),Ie(),N.current=requestAnimationFrame(fe)}},ge=()=>{const ce=xe();for(const pe of i)if(pe.type===z.ParabolicDish){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=B.current.get(ve.id);if(Te){const Me=Ae.reduce((Pe,Ee)=>Pe+Ee,0);Te[_.current]+=Me*ce*He(ve)}}}C&&ae()},de=()=>{if(f){const ce=[],pe=[];let ve=0;for(const Te of i)if(Te.type===z.ParabolicDish){const Me=B.current.get(Te.id);Me&&(u(Te.id,Me.reduce((Pe,Ee)=>Pe+Ee,0)*D*q),ce.push(Me),ve++,pe.push(Te.label??"Dish"+ve))}const Ae=[];for(let Te=0;Te<12;Te+=D){const Me={};Me.Month=Ms[Te];for(const[Pe,Ee]of ce.entries())Me[pe[Pe]]=Ee[Te/D]*q;Ae.push(Me)}c(Ae),p(pe)}else{const ce=[];for(const ve of i)if(ve.type===z.ParabolicDish){const Ae=B.current.get(ve.id);Ae&&(u(ve.id,Ae.reduce((Te,Me)=>Te+Me,0)*D*q),ce.push(Ae))}const pe=[];for(let ve=0;ve<12;ve+=D){let Ae=0;for(const Te of ce)Ae+=Te[ve/D];pe.push({Month:Ms[ve],Total:Ae*q})}c(pe)}},Z=ce=>{const pe=Ei(A,r.latitude);if(pe.z0&&(St.set(Ye+Ht*Ke,it+At*Ne),ft||St.rotateAround(yt,ut),Pt.set(St.x-yt.x,St.y-yt.y,0),Pt.applyEuler(at),ct.set(Te.x+Pt.x,Te.y+Pt.y,Ve+Pt.z),Se(ce.id,ct,pe)||(Rt+=Ze*Oe));const Ut=O.current.get(ce.id);if(Ut){const Ht=A.getMinutes()>=30?A.getHours()+1===24?0:A.getHours()+1:A.getHours();Ut[Ht]+=Rt/(Je*We)}},he=()=>{const ce=Q.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},xe=()=>{const ce=le.current.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},He=ce=>ce.lx*ce.ly*ce.opticalEfficiency*ce.thermalEfficiency*ce.absorptance*ce.reflectance*(1-W[A.getMonth()]),Se=(ce,pe,ve)=>{if(L.current.length>1){k.current.length=0,E.set(pe,ve);const Ae=L.current.filter(Te=>Te.uuid!==ce);return E.intersectObjects(Ae,!1,k.current),k.current.length>0}return!1},ze=()=>{const ce=P.children.filter(pe=>pe.name==="Content");if(ce.length>0){const pe=ce[0].children;L.current.length=0;for(const ve of pe)me.fetchSimulationElements(ve,L.current)}},Ie=()=>{for(const ce of i)if(ce.type===z.ParabolicDish){const pe=O.current.get(ce.id);pe?pe.fill(0):O.current.set(ce.id,new Array(24).fill(0))}},ye=()=>{for(const ce of i)if(ce.type===z.ParabolicDish){const pe=B.current.get(ce.id);pe&&pe.length===M?pe.fill(0):B.current.set(ce.id,new Array(M).fill(0))}};return h.jsx(h.Fragment,{})}),njo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(da),r=H.getState().world,i=H.getState().elements,a=H(qr),l=Tn(pvt),s=H(yW),c=H(nOe),u=Tn(mvt),d=H(AW),f=H(oOe),p=Tn(yvt),g=ht(cvt),y=ht(uvt),w=ht(dvt),b=ht(fvt),C=H(WBe),{scene:P}=oi(),v=Jt(),T=f1(t),A=new Date(r.date),x=t?T==null?void 0:T.elevation:0,S=r.cspTimesPerHour??4,R=60/S,M=r.cspDaysPerYear??6,D=12/M,E=m.useMemo(()=>new l0,[]),W=r.monthlyIrradianceLosses??new Array(12).fill(.05),j=r.cspGridCellSize??.5,L=m.useRef([]),k=m.useRef([]),N=m.useRef(0),F=m.useRef(!1),U=m.useRef(new Date(r.date)),O=m.useRef(new Map),B=m.useRef(new Map),_=m.useRef(0),X=m.useRef(!1),$=m.useRef(new Date(r.date)),Q=m.useMemo(()=>dl(A,r.latitude),[r.date,r.latitude]),le=m.useRef(Q),q=me.daysInYear(A)/12;m.useEffect(()=>{if(g)return te(),N.current=requestAnimationFrame(re),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[g]),m.useEffect(()=>{X.current=w,w?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),re())},[w]);const te=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),A.setHours(Math.floor(Q.sunrise/60),R/2-30)),F.current=!1,ze(),Ie()},re=()=>{if(g&&!X.current){if(A.getMinutes()+A.getHours()*60>=Q.sunset){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showDailyFresnelReflectorYieldPanel=!0,pe.selectedFloatingWindow="dailyFresnelReflectorYieldPanel"}),ht.getState().set(pe=>{pe.runDailySimulationForFresnelReflectors=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,ae(),o&&e(pe=>{const ve=Tn.getState().sumDailyFresnelReflectorYield();pe.actionInfo={name:"Daily Simulation for Fresnel Reflectors Completed",result:{totalYield:ve},details:Tn.getState().dailyFresnelReflectorYield,timestamp:new Date().getTime()}});return}A.setHours(A.getHours(),A.getMinutes()+R),e(pe=>{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.FresnelReflector&&Z(pe);N.current=requestAnimationFrame(re)}},ae=()=>{const ce=he();for(const pe of i)if(pe.type===z.FresnelReflector){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=He(ve)*ce;for(let Me=0;Me{var ce;if(c){const pe=new Array(24).fill(0),ve=new Map;let Ae=0;const Te=[];for(const Pe of i)if(Pe.type===z.FresnelReflector){const Ee=O.current.get(Pe.id);if(Ee){s(Pe.id,Ee.reduce((Be,Je)=>Be+Je,0)),Ae++,ve.set("Reflector"+Ae,Ee),Te.push(Pe.label??"Reflector"+Ae);for(let Be=0;Be<24;Be++)pe[Be]+=Ee[Be]}}const Me=[];for(let Pe=0;Pe<24;Pe++){const Ee={};Ee.Hour=Pe;for(let Be=1;Be<=Ae;Be++){const Je="Reflector"+Be;Ee[Te[Be-1]]=(ce=ve.get(Je))==null?void 0:ce[Pe]}Me.push(Ee)}l(Me),p(Te)}else{const pe=new Array(24).fill(0);for(const Ae of i)if(Ae.type===z.FresnelReflector){const Te=O.current.get(Ae.id);if(Te){s(Ae.id,Te.reduce((Me,Pe)=>Me+Pe,0));for(let Me=0;Me<24;Me++)pe[Me]+=Te[Me]}}const ve=[];for(let Ae=0;Ae<24;Ae++)ve.push({Hour:Ae,Total:pe[Ae]});l(ve)}};m.useEffect(()=>{if(y)return ne(),N.current=requestAnimationFrame(fe),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[y]),m.useEffect(()=>{X.current=b,b?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),fe())},[b]);const ne=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),_.current=0,A.setMonth(0,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),e(ce=>{ce.world.date=A.toLocaleString("en-US")})),F.current=!1,ze(),Ie(),ye()},fe=()=>{if(y&&!X.current)if(A.getMinutes()+A.getHours()*60{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.FresnelReflector&&Z(pe);N.current=requestAnimationFrame(fe)}else{if(ge(),_.current++,_.current===M){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showYearlyFresnelReflectorYieldPanel=!0,pe.selectedFloatingWindow="yearlyFresnelReflectorYieldPanel"}),ht.getState().set(pe=>{pe.runYearlySimulationForFresnelReflectors=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,de(),o&&e(pe=>{const ve=Tn.getState().sumYearlyFresnelReflectorYield();pe.actionInfo={name:"Yearly Simulation for Fresnel Reflectors Completed",result:{totalYield:ve},details:Tn.getState().yearlyFresnelReflectorYield,timestamp:new Date().getTime()}});return}A.setMonth(_.current*D,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),Ie(),N.current=requestAnimationFrame(fe)}},ge=()=>{const ce=xe();for(const pe of i)if(pe.type===z.FresnelReflector){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=B.current.get(ve.id);if(Te){const Me=Ae.reduce((Pe,Ee)=>Pe+Ee,0);Te[_.current]+=Me*ce*He(ve)}}}C&&ae()},de=()=>{if(f){const ce=[],pe=[];let ve=0;for(const Te of i)if(Te.type===z.FresnelReflector){const Me=B.current.get(Te.id);Me&&(d(Te.id,Me.reduce((Pe,Ee)=>Pe+Ee,0)*D*q),ce.push(Me),ve++,pe.push(Te.label??"Reflector"+ve))}const Ae=[];for(let Te=0;Te<12;Te+=D){const Me={};Me.Month=Ms[Te];for(const[Pe,Ee]of ce.entries())Me[pe[Pe]]=Ee[Te/D]*q;Ae.push(Me)}u(Ae),p(pe)}else{const ce=[];for(const ve of i)if(ve.type===z.FresnelReflector){const Ae=B.current.get(ve.id);Ae&&(d(ve.id,Ae.reduce((Te,Me)=>Te+Me,0)*D*q),ce.push(Ae))}const pe=[];for(let ve=0;ve<12;ve+=D){let Ae=0;for(const Te of ce)Ae+=Te[ve/D];pe.push({Month:Ms[ve],Total:Ae*q})}u(pe)}},Z=ce=>{const pe=Ei(A,r.latitude);if(pe.z0&&(At.set(dt,Ve+Fe*Ye),kt.set(At.x-ct.x,At.y-ct.y,0),kt.applyEuler(Pt),Xe.set(Pe.x+kt.x,Pe.y+kt.y,yt+kt.z),!Se(ce.id,Xe,pe)&&!Se(ce.id,Xe,Rt)&&(gt+=Ht*Ut))}const Ct=O.current.get(ce.id);if(Ct){const tt=A.getMinutes()>=30?A.getHours()+1===24?0:A.getHours()+1:A.getHours();Ct[tt]+=gt/(Ne*De)}},he=()=>{const ce=Q.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},xe=()=>{const ce=le.current.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},He=ce=>{const pe=a(ce);if(!pe)throw new Error("parent of Fresnel reflector does not exist");let ve=1;if(pe.type===z.Foundation){const Te=pe.solarAbsorberPipe;ve*=((Te==null?void 0:Te.absorberOpticalEfficiency)??.7)*((Te==null?void 0:Te.absorberThermalEfficiency)??.3)*((Te==null?void 0:Te.absorberAbsorptance)??.95)}return ce.lx*ce.ly*ce.reflectance*ve*(1-W[A.getMonth()])},Se=(ce,pe,ve)=>{if(L.current.length>1){k.current.length=0,E.set(pe,ve);const Ae=L.current.filter(Te=>Te.uuid!==ce);return E.intersectObjects(Ae,!1,k.current),k.current.length>0}return!1},ze=()=>{const ce=P.children.filter(pe=>pe.name==="Content");if(ce.length>0){const pe=ce[0].children;L.current.length=0;for(const ve of pe)me.fetchSimulationElements(ve,L.current)}},Ie=()=>{for(const ce of i)if(ce.type===z.FresnelReflector){const pe=O.current.get(ce.id);pe?pe.fill(0):O.current.set(ce.id,new Array(24).fill(0))}},ye=()=>{for(const ce of i)if(ce.type===z.FresnelReflector){const pe=B.current.get(ce.id);pe&&pe.length===M?pe.fill(0):B.current.set(ce.id,new Array(M).fill(0))}};return h.jsx(h.Fragment,{})}),ojo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(da),r=H.getState().world,i=H.getState().elements,a=H(qr),l=Tn(Svt),s=H(yW),c=H(iOe),u=Tn(Pvt),d=H(AW),f=H(aOe),p=Tn(Cvt),g=ht(Avt),y=ht(wvt),w=ht(vvt),b=ht(xvt),C=H(NBe),{scene:P}=oi(),v=Jt(),T=f1(t),A=new Date(r.date),x=t?T==null?void 0:T.elevation:0,S=r.cspTimesPerHour??4,R=60/S,M=r.cspDaysPerYear??6,D=12/M,E=m.useMemo(()=>new l0,[]),W=r.monthlyIrradianceLosses??new Array(12).fill(.05),j=r.cspGridCellSize??.5,L=m.useRef([]),k=m.useRef([]),N=m.useRef(0),F=m.useRef(!1),U=m.useRef(new Date(r.date)),O=m.useRef(new Map),B=m.useRef(new Map),_=m.useRef(0),X=m.useRef(!1),$=m.useRef(new Date(r.date)),Q=m.useMemo(()=>dl(A,r.latitude),[r.date,r.latitude]),le=m.useRef(Q),q=me.daysInYear(A)/12;m.useEffect(()=>{if(g)return te(),N.current=requestAnimationFrame(re),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[g]),m.useEffect(()=>{X.current=w,w?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),re())},[w]);const te=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),A.setHours(Math.floor(Q.sunrise/60),R/2-30)),F.current=!1,ze(),Ie()},re=()=>{if(g&&!X.current){if(A.getMinutes()+A.getHours()*60>=Q.sunset){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showDailyHeliostatYieldPanel=!0,pe.selectedFloatingWindow="dailyHeliostatYieldPanel"}),ht.getState().set(pe=>{pe.runDailySimulationForHeliostats=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,ae(),o&&e(pe=>{const ve=Tn.getState().sumDailyHeliostatYield();pe.actionInfo={name:"Daily Simulation for Heliostats Completed",result:{totalYield:ve},details:Tn.getState().dailyHeliostatYield,timestamp:new Date().getTime()}});return}A.setHours(A.getHours(),A.getMinutes()+R),e(pe=>{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.Heliostat&&Z(pe);N.current=requestAnimationFrame(re)}},ae=()=>{const ce=he();for(const pe of i)if(pe.type===z.Heliostat){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=He(ve)*ce;for(let Me=0;Me{var ce;if(c){const pe=new Array(24).fill(0),ve=new Map;let Ae=0;const Te=[];for(const Pe of i)if(Pe.type===z.Heliostat){const Ee=O.current.get(Pe.id);if(Ee){s(Pe.id,Ee.reduce((Be,Je)=>Be+Je,0)),Ae++,ve.set("Heliostat"+Ae,Ee),Te.push(Pe.label??"Heliostat"+Ae);for(let Be=0;Be<24;Be++)pe[Be]+=Ee[Be]}}const Me=[];for(let Pe=0;Pe<24;Pe++){const Ee={};Ee.Hour=Pe;for(let Be=1;Be<=Ae;Be++){const Je="Heliostat"+Be;Ee[Te[Be-1]]=(ce=ve.get(Je))==null?void 0:ce[Pe]}Me.push(Ee)}l(Me),p(Te)}else{const pe=new Array(24).fill(0);for(const Ae of i)if(Ae.type===z.Heliostat){const Te=O.current.get(Ae.id);if(Te){s(Ae.id,Te.reduce((Me,Pe)=>Me+Pe,0));for(let Me=0;Me<24;Me++)pe[Me]+=Te[Me]}}const ve=[];for(let Ae=0;Ae<24;Ae++)ve.push({Hour:Ae,Total:pe[Ae]});l(ve)}};m.useEffect(()=>{if(y)return ne(),N.current=requestAnimationFrame(fe),()=>{cancelAnimationFrame(N.current),F.current||(hn(Y.t("message.SimulationAborted",v)),e(ce=>{ce.world.date=U.current.toLocaleString("en-US")}),ht.getState().set(ce=>{ce.simulationInProgress=!1,ce.simulationPaused=!1})),X.current=!1}},[y]),m.useEffect(()=>{X.current=b,b?($.current=new Date(A.getTime()),cancelAnimationFrame(N.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),fe())},[b]);const ne=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(U.current=new Date(r.date),_.current=0,A.setMonth(0,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),e(ce=>{ce.world.date=A.toLocaleString("en-US")})),F.current=!1,ze(),Ie(),ye()},fe=()=>{if(y&&!X.current)if(A.getMinutes()+A.getHours()*60{pe.world.date=A.toLocaleString("en-US")});for(const pe of i)pe.type===z.Heliostat&&Z(pe);N.current=requestAnimationFrame(fe)}else{if(ge(),_.current++,_.current===M){cancelAnimationFrame(N.current),e(pe=>{pe.world.date=U.current.toLocaleString("en-US"),pe.viewState.showYearlyHeliostatYieldPanel=!0,pe.selectedFloatingWindow="yearlyHeliostatYieldPanel"}),ht.getState().set(pe=>{pe.runYearlySimulationForHeliostats=!1,pe.simulationInProgress=!1,pe.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),F.current=!0,de(),o&&e(pe=>{const ve=Tn.getState().sumYearlyHeliostatYield();pe.actionInfo={name:"Yearly Simulation for Heliostats Completed",result:{totalYield:ve},details:Tn.getState().yearlyHeliostatYield,timestamp:new Date().getTime()}});return}A.setMonth(_.current*D,22),le.current=dl(A,r.latitude),A.setHours(Math.floor(le.current.sunrise/60),R/2-30),Ie(),N.current=requestAnimationFrame(fe)}},ge=()=>{const ce=xe();for(const pe of i)if(pe.type===z.Heliostat){const ve=pe,Ae=O.current.get(ve.id);if(Ae){const Te=B.current.get(ve.id);if(Te){const Me=Ae.reduce((Pe,Ee)=>Pe+Ee,0);Te[_.current]+=Me*ce*He(ve)}}}C&&ae()},de=()=>{if(f){const ce=[],pe=[];let ve=0;for(const Te of i)if(Te.type===z.Heliostat){const Me=B.current.get(Te.id);Me&&(d(Te.id,Me.reduce((Pe,Ee)=>Pe+Ee,0)*D*q),ce.push(Me),ve++,pe.push(Te.label??"Heliostat"+ve))}const Ae=[];for(let Te=0;Te<12;Te+=D){const Me={};Me.Month=Ms[Te];for(const[Pe,Ee]of ce.entries())Me[pe[Pe]]=Ee[Te/D]*q;Ae.push(Me)}u(Ae),p(pe)}else{const ce=[];for(const ve of i)if(ve.type===z.Heliostat){const Ae=B.current.get(ve.id);Ae&&(d(ve.id,Ae.reduce((Te,Me)=>Te+Me,0)*D*q),ce.push(Ae))}const pe=[];for(let ve=0;ve<12;ve+=D){let Ae=0;for(const Te of ce)Ae+=Te[ve/D];pe.push({Month:Ms[ve],Total:Ae*q})}u(pe)}},Z=ce=>{const pe=Ei(A,r.latitude);if(pe.z0&&(Ze.set(Rt,Ve+At*Ye),St.set(Ze.x-ct.x,Ze.y-ct.y,0),St.applyEuler(st),Xe.set(Pe.x+St.x,Pe.y+St.y,yt+St.z),!Se(ce.id,Xe,pe)&&!Se(ce.id,Xe,ot)&&(Pt+=Oe*at))}const Ut=O.current.get(ce.id);if(Ut){const Ht=A.getMinutes()>=30?A.getHours()+1===24?0:A.getHours()+1:A.getHours();Ut[Ht]+=Pt/(Ne*De)}},he=()=>{const ce=Q.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},xe=()=>{const ce=le.current.daylight()/60;return ce>It?T.sunshineHours[A.getMonth()]/(30*ce*S):0},He=ce=>{const pe=a(ce);if(!pe)throw new Error("parent of heliostat does not exist");let ve=1;if(pe.type===z.Foundation){const Te=pe.solarPowerTower;ve*=((Te==null?void 0:Te.receiverOpticalEfficiency)??.7)*((Te==null?void 0:Te.receiverThermalEfficiency)??.3)*((Te==null?void 0:Te.receiverAbsorptance)??.95)}return ce.lx*ce.ly*ce.reflectance*ve*(1-W[A.getMonth()])},Se=(ce,pe,ve)=>{if(L.current.length>1){k.current.length=0,E.set(pe,ve);const Ae=L.current.filter(Te=>Te.uuid!==ce);return E.intersectObjects(Ae,!1,k.current),k.current.length>0}return!1},ze=()=>{const ce=P.children.filter(pe=>pe.name==="Content");if(ce.length>0){const pe=ce[0].children;L.current.length=0;for(const ve of pe)me.fetchSimulationElements(ve,L.current)}},Ie=()=>{for(const ce of i)if(ce.type===z.Heliostat){const pe=O.current.get(ce.id);pe?pe.fill(0):O.current.set(ce.id,new Array(24).fill(0))}},ye=()=>{for(const ce of i)if(ce.type===z.Heliostat){const pe=B.current.get(ce.id);pe&&pe.length===M?pe.fill(0):B.current.set(ce.id,new Array(M).fill(0))}};return h.jsx(h.Fragment,{})}),rjo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(da),r=H.getState().world,i=H.getState().elements,a=Tn(Wvt),l=Tn(Dvt),s=Tn(Evt),c=Tn(Lvt),u=ht(sOe),d=ht(Rvt),f=ht(cOe),p=ht(Hvt),g=H(UBe),y=H(OBe),w=H(cW)??900,b=r.sutGridCellSize??1,{scene:C}=oi(),P=Jt(),v=f1(t),T=new Date(r.date),A=v?v.elevation:0,x=r.sutTimesPerHour??4,S=60/x,R=r.sutDaysPerYear??6,M=12/R,D=m.useMemo(()=>new l0,[]),E=m.useRef([]),W=m.useRef([]),j=m.useRef(0),L=m.useRef(!1),k=m.useRef(new Date(r.date)),N=m.useRef(new Array(24).fill(0)),F=m.useRef(new Map),U=m.useRef(new Map),O=m.useRef(new Map),B=m.useRef(new Map),_=m.useRef(0),X=m.useRef(!1),$=m.useRef(new Date(r.date)),Q=m.useRef(0),le=m.useMemo(()=>dl(T,r.latitude),[r.date,r.latitude]),q=m.useRef(le),te=me.daysInYear(T)/12;m.useEffect(()=>{if(u)if(y&&!me.hasMovingParts(i))re();else return ae(),j.current=requestAnimationFrame(se),()=>{cancelAnimationFrame(j.current),L.current||(hn(Y.t("message.SimulationAborted",P)),e(Ae=>{Ae.world.date=k.current.toLocaleString("en-US")}),ht.getState().set(Ae=>{Ae.simulationInProgress=!1,Ae.simulationPaused=!1})),X.current=!1}},[u]),m.useEffect(()=>{X.current=d,d?($.current=new Date(T.getTime()),cancelAnimationFrame(j.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",P))):(n("simulationPaused",!1),se())},[d]);const re=()=>{pe(),He();for(const Ae of i)if(Ae.type===z.Foundation){const Te=Ae;Te.solarStructure===Dn.UpdraftTower&&Te.solarUpdraftTower&&Ie(Te)}e(Ae=>{Ae.viewState.showDailyUpdraftTowerYieldPanel=!0,Ae.selectedFloatingWindow="dailySolarUpdraftTowerYieldPanel"}),ht.getState().set(Ae=>{Ae.runDailySimulationForUpdraftTower=!1,Ae.simulationInProgress=!1,Ae.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",P)),L.current=!0,ne(),o&&e(Ae=>{const Te=Tn.getState().sumDailyUpdraftTowerYield();Ae.actionInfo={name:"Static Daily Simulation for Updraft Tower Completed",result:{totalYield:Te},details:Tn.getState().dailyUpdraftTowerYield,timestamp:new Date().getTime()}})},ae=()=>{X.current?(T.setTime($.current.getTime()),X.current=!1):(k.current=new Date(r.date),Q.current=T.getDay(),T.setHours(Math.floor(le.sunrise/60),-S/2)),L.current=!1,pe(),He()},se=()=>{if(u&&!X.current){if(T.getMinutes()+T.getHours()*60+(T.getDay()-Q.current)*T2+S>=le.sunset){cancelAnimationFrame(j.current),e(Te=>{Te.world.date=k.current.toLocaleString("en-US"),Te.viewState.showDailyUpdraftTowerYieldPanel=!0,Te.selectedFloatingWindow="dailySolarUpdraftTowerYieldPanel"}),ht.getState().set(Te=>{Te.runDailySimulationForUpdraftTower=!1,Te.simulationInProgress=!1,Te.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",P)),L.current=!0,ne(),o&&e(Te=>{const Me=Tn.getState().sumDailyUpdraftTowerYield();Te.actionInfo={name:"Dynamic Daily Simulation for Updraft Tower Completed",result:{totalYield:Me},details:Tn.getState().dailyUpdraftTowerYield,timestamp:new Date().getTime()}});return}T.setHours(T.getHours(),T.getMinutes()+S),e(Te=>{Te.world.date=T.toLocaleString("en-US")});for(const Te of i)if(Te.type===z.Foundation){const Me=Te;Me.solarStructure===Dn.UpdraftTower&&Me.solarUpdraftTower&&ze(Me)}j.current=requestAnimationFrame(se)}},ne=()=>{const Ae=ye();for(const Te of i)if(Te.type===z.Foundation){const Me=Te;if(Me.solarStructure===Dn.UpdraftTower&&Me.solarUpdraftTower){const Pe=Me.solarUpdraftTower.collectorTransmissivity??.9,Ee=Me.solarUpdraftTower.turbineEfficiency??.3,Be=Me.solarUpdraftTower.dischargeCoefficient??.65,Je=Math.PI*Me.solarUpdraftTower.chimneyRadius*Me.solarUpdraftTower.chimneyRadius,We=Math.PI*Me.solarUpdraftTower.collectorRadius*Me.solarUpdraftTower.collectorRadius,Ke=hO*RSe*Je,Ne=2*CSe*Me.solarUpdraftTower.chimneyHeight,De=F.current.get(Te.id+"-sut"),ke=U.current.get(Te.id+"-sut"),Ye=O.current.get(Te.id+"-sut");if(Ye&&De&&ke){const it=.5*Be*Ee*hO*Je,Ve=new Date(r.date);let yt;v&&(yt=Qx(Ve,v.lowestTemperatures,v.highestTemperatures));for(let ct=0;ct0&&ct>0&&De[ct-1]>Xe){const at=(De[ct-1]+Xe)/2,Oe=(r.airConvectiveCoefficient??5)*We*(at-Xe),Ze=at+C4,St=Ze*Ze*Ze*Ze,Pt=ut*ut*ut*ut,Rt=(Me.solarUpdraftTower.collectorEmissivity??.95)*HSe*We*(St-Pt);Ye[ct]-=Oe+Rt,Ye[ct]<0&&(Ye[ct]=0)}const ft=Ye[ct]/(Ke*ut),ot=ut*(1+Math.cbrt(ft*ft/Ne))-C4,st=ot>Xe?Math.sqrt(Ne*((ot+C4)/ut-1)):0;Ye[ct]=it*st*st*st*.001,De[ct]=ot,ke[ct]=st}}}}fe()},fe=()=>{var Be,Je,We;const Ae=new Map;let Te=0;const Me=[];for(const Ke of i)if(Ke.type===z.Foundation){const Ne=Ke;if(Ne.solarStructure===Dn.UpdraftTower&&Ne.solarUpdraftTower){Te++;const De=F.current.get(Ke.id+"-sut");De&&Ae.set("Temperature Tower"+Te,De);const ke=U.current.get(Ke.id+"-sut");ke&&Ae.set("Wind Speed Tower"+Te,ke);const Ye=O.current.get(Ke.id+"-sut");Ye&&(Ae.set("Tower"+Te,Ye),Me.push(Ke.label?Ke.label:"Tower"+Te))}}const Pe=[];for(let Ke=0;Ke<24;Ke++){const Ne={};Ne.Hour=Ke;for(let De=1;De<=Te;De++){const ke="Tower"+De;Ne[Me[De-1]]=(Be=Ae.get(ke))==null?void 0:Be[Ke]}Pe.push(Ne)}s(Pe);const Ee=[];for(let Ke=0;Ke<24;Ke++){const Ne={};Ne.Hour=Ke,Ne.T_Ambient=N.current[Ke];for(let De=1;De<=Te;De++){let ke="Temperature Tower"+De;Ne["T_"+Me[De-1]]=(Je=Ae.get(ke))==null?void 0:Je[Ke],ke="Wind Speed Tower"+De,Ne["V_"+Me[De-1]]=(We=Ae.get(ke))==null?void 0:We[Ke]}Ee.push(Ne)}l(Ee),a(Me)};m.useEffect(()=>{if(f)if(y&&!me.hasMovingParts(i))de();else return ge(),j.current=requestAnimationFrame(Z),()=>{cancelAnimationFrame(j.current),L.current||(hn(Y.t("message.SimulationAborted",P)),e(Ae=>{Ae.world.date=k.current.toLocaleString("en-US")}),ht.getState().set(Ae=>{Ae.simulationInProgress=!1,Ae.simulationPaused=!1})),X.current=!1}},[f]),m.useEffect(()=>{X.current=p,p?($.current=new Date(T.getTime()),cancelAnimationFrame(j.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",P))):(n("simulationPaused",!1),Z())},[p]);const ge=()=>{X.current?(T.setTime($.current.getTime()),X.current=!1):(k.current=new Date(r.date),_.current=0,T.setMonth(0,22),Q.current=T.getDay(),q.current=dl(T,r.latitude),T.setHours(Math.floor(q.current.sunrise/60),-S/2),e(Ae=>{Ae.world.date=T.toLocaleString("en-US")})),L.current=!1,pe(),He(),Se()},de=()=>{pe(),He(),Se(),k.current=new Date(r.date),_.current=0;for(let Ae=0;Ae<12;Ae+=M){T.setMonth(Ae,22),q.current=dl(T,r.latitude),He();for(const Te of i)if(Te.type===z.Foundation){const Me=Te;Me.solarStructure===Dn.UpdraftTower&&Me.solarUpdraftTower&&Ie(Me)}he(),_.current++}e(Ae=>{Ae.world.date=k.current.toLocaleString("en-US"),Ae.viewState.showYearlyUpdraftTowerYieldPanel=!0,Ae.selectedFloatingWindow="yearlySolarUpdraftTowerYieldPanel"}),ht.getState().set(Ae=>{Ae.runYearlySimulationForUpdraftTower=!1,Ae.simulationInProgress=!1,Ae.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",P)),L.current=!0,xe(),o&&e(Ae=>{const Te=Tn.getState().sumYearlyUpdraftTowerYield();Ae.actionInfo={name:"Static Yearly Simulation for Updraft Tower Completed",result:{totalYield:Te},details:Tn.getState().yearlyUpdraftTowerYield,timestamp:new Date().getTime()}})},Z=()=>{if(f&&!X.current)if(T.getMinutes()+T.getHours()*60+(T.getDay()-Q.current)*T2+S{Te.world.date=T.toLocaleString("en-US")});for(const Te of i)if(Te.type===z.Foundation){const Me=Te;Me.solarStructure===Dn.UpdraftTower&&Me.solarUpdraftTower&&ze(Me)}j.current=requestAnimationFrame(Z)}else{if(he(),_.current++,_.current===R){cancelAnimationFrame(j.current),e(Te=>{Te.world.date=k.current.toLocaleString("en-US"),Te.viewState.showYearlyUpdraftTowerYieldPanel=!0,Te.selectedFloatingWindow="yearlySolarUpdraftTowerYieldPanel"}),ht.getState().set(Te=>{Te.runYearlySimulationForUpdraftTower=!1,Te.simulationInProgress=!1,Te.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",P)),L.current=!0,xe(),o&&e(Te=>{const Me=Tn.getState().sumYearlyUpdraftTowerYield();Te.actionInfo={name:"Dynamic Yearly Simulation for Updraft Tower Completed",result:{totalYield:Me},details:Tn.getState().yearlyUpdraftTowerYield,timestamp:new Date().getTime()}});return}T.setMonth(_.current*M,22),Q.current=T.getDay(),q.current=dl(T,r.latitude),T.setHours(Math.floor(q.current.sunrise/60),-S/2),He(),j.current=requestAnimationFrame(Z)}},he=()=>{const Ae=ce();for(const Te of i)if(Te.type===z.Foundation){const Me=Te;if(Me.solarStructure===Dn.UpdraftTower&&Me.solarUpdraftTower){const Pe=O.current.get(Me.id+"-sut"),Ee=F.current.get(Te.id+"-sut"),Be=U.current.get(Te.id+"-sut");if(Pe&&Ee&&Be){const Je=Me.solarUpdraftTower.collectorTransmissivity??.9,We=Me.solarUpdraftTower.turbineEfficiency??.3,Ke=Me.solarUpdraftTower.dischargeCoefficient??.65,Ne=Math.PI*Me.solarUpdraftTower.chimneyRadius*Me.solarUpdraftTower.chimneyRadius,De=Math.PI*Me.solarUpdraftTower.collectorRadius*Me.solarUpdraftTower.collectorRadius,ke=hO*RSe*Ne,Ye=2*CSe*Me.solarUpdraftTower.chimneyHeight,it=.5*Ke*We*hO*Ne;let Ve;v&&(Ve=Qx(T,v.lowestTemperatures,v.highestTemperatures));for(let ct=0;ct0&&ct>0&&Ee[ct-1]>Xe){const at=(Ee[ct-1]+Xe)/2,Oe=(r.airConvectiveCoefficient??5)*De*(at-Xe),Ze=at+C4,St=Ze*Ze*Ze*Ze,Pt=ut*ut*ut*ut,Rt=(Me.solarUpdraftTower.collectorEmissivity??.95)*HSe*De*(St-Pt);Pe[ct]-=Oe+Rt,Pe[ct]<0&&(Pe[ct]=0)}const ft=Pe[ct]/(ke*ut),ot=ut*(1+Math.cbrt(ft*ft/Ye))-C4,st=ot>Xe?Math.sqrt(Ye*((ot+C4)/ut-1)):0;Pe[ct]=it*st*st*st*.001,Ee[ct]=ot,Be[ct]=st}const yt=B.current.get(Me.id+"-sut");if(yt){const ct=Pe.reduce((Xe,ut)=>Xe+ut,0);yt[_.current]+=ct}}}}g&&fe()},xe=()=>{const Ae=[],Te=[];let Me=0;for(const Ee of i)if(Ee.type===z.Foundation){const Be=Ee;if(Be.solarStructure===Dn.UpdraftTower&&Be.solarUpdraftTower){const Je=B.current.get(Ee.id+"-sut");Je&&(Ae.push(Je),Te.push(Ee.label?Ee.label:"Tower"+ ++Me))}}const Pe=[];for(let Ee=0;Ee<12;Ee+=M){const Be={};Be.Month=Ms[Ee];for(const[Je,We]of Ae.entries())Be[Te[Je]]=We[Ee/M]*te;Pe.push(Be)}c(Pe),a(Te)},He=()=>{for(const Ae of i)if(Ae.type===z.Foundation){const Te=Ae;if(Te.solarStructure===Dn.UpdraftTower&&Te.solarUpdraftTower){const Me=F.current.get(Ae.id+"-sut");Me?Me.fill(0):F.current.set(Ae.id+"-sut",new Array(24).fill(0));const Pe=U.current.get(Ae.id+"-sut");Pe?Pe.fill(0):U.current.set(Ae.id+"-sut",new Array(24).fill(0));const Ee=O.current.get(Ae.id+"-sut");Ee?Ee.fill(0):O.current.set(Ae.id+"-sut",new Array(24).fill(0))}}},Se=()=>{for(const Ae of i)if(Ae.type===z.Foundation){const Te=Ae;if(Te.solarStructure===Dn.UpdraftTower&&Te.solarUpdraftTower){const Me=B.current.get(Ae.id+"-sut");Me&&Me.length===R?Me.fill(0):B.current.set(Ae.id+"-sut",new Array(R).fill(0))}}},ze=Ae=>{const Te=Ae.solarUpdraftTower;if(!Te)return;const Me=Ei(T,r.latitude);if(Me.zyt)&&(Xe++,ct+=Ye,Ve>0&&(ve(Ae.id+"-sut",it,Me)||(ct+=Ve*ke)))}Xe&&(ct/=Xe);const ot=T.getMinutes()>=30?T.getHours()+1===24?0:T.getHours()+1:T.getHours(),st=Math.PI*Te.collectorRadius*Te.collectorRadius;Pe[ot]+=ct*st}},Ie=Ae=>{const Te=Ae.solarUpdraftTower;if(!Te)return;const Me=O.current.get(Ae.id+"-sut");if(!Me)return;const Pe=new ie().fromArray(Ae.normal),Ee=T.getFullYear(),Be=T.getMonth(),Je=T.getDate(),We=me.dayOfYear(T),Ke=Te.collectorRadius,Ne=Math.max(2,Math.round(Ke*2/b)),De=Ae.cx-Ke+b/2,ke=Ae.cy-Ke+b/2,Ye=Ae.lz+Te.collectorHeight,it=new ie(0,0,Ye),Ve=Ke*Ke;let yt=0,ct,Xe;const ut=Math.PI*Te.collectorRadius*Te.collectorRadius;for(let ft=0;ft<24;ft++){for(let ot=0;ot0){const Oe=Ri(at,We,A,yi.SPHERE_MODEL),Ze=ni(r.ground,Be,Io,Oe),St=Pe.dot(at);yt=0;for(let Pt=0;PtVe)&&(yt++,Me[ft]+=Ze,St>0&&(ve(Ae.id+"-sut",it,at)||(Me[ft]+=St*Oe)))}}}yt&&(Me[ft]/=yt),Me[ft]*=ut}},ye=()=>{const Ae=le.daylight()/60;return Ae>It?v.sunshineHours[T.getMonth()]/(30*Ae*x):0},ce=()=>{const Ae=T.getMonth(),Te=q.current.daylight()/60;return Te>It?v.sunshineHours[Ae]/(30*Te*x):0},pe=()=>{const Ae=C.children.filter(Te=>Te.name==="Content");if(Ae.length>0){const Te=Ae[0].children;E.current.length=0;for(const Me of Te)me.fetchSimulationElements(Me,E.current)}},ve=(Ae,Te,Me)=>{if(E.current.length>1){W.current.length=0,D.set(Te,Me);const Pe=E.current.filter(Ee=>Ee.uuid!==Ae);return D.intersectObjects(Pe,!1,W.current),W.current.length>0}return!1};return h.jsx(h.Fragment,{})});class ijo{constructor(e,n){this.position=e,this.observer=n}}const ajo=be.memo(()=>{const t=H.getState().world,e=H.getState().elements,n=H(fn),o=ht(xh),r=H(qr),i=H(pA),a=ht(O7t),{scene:l}=oi(),s=Jt(),c=m.useMemo(()=>new l0,[]),u=t.solarPanelVisibilityGridCellSize??.2,d=m.useRef([]),f=m.useRef([]),p=m.useRef([]);m.useEffect(()=>{a&&e&&e.length>0&&(w(),o("runSolarPanelVisibilityAnalysis",!1),n(P=>{P.viewState.showSolarPanelVisibilityResultsPanel=!0,P.selectedFloatingWindow="visibilityResultsPanel"}),hn(Y.t("message.SimulationCompleted",s))),o("simulationInProgress",!1)},[a]);const g=()=>{const P=l.children.filter(v=>v.name==="Content");if(P.length>0){const v=P[0].children;f.current.length=0;for(const T of v)me.fetchSimulationElements(T,f.current)}},y=()=>{d.current=[];for(const P of e)if(P.type===z.Human){const v=P;if(v.observer){const T=r(v),A=T?me.absoluteHumanOrTreeCoordinates(v.cx,v.cy,v.cz,T):new ie(v.cx,v.cy,v.cz);A.z+=v.lz,d.current.push(new ijo(A,v))}}},w=()=>{if(Tn.getState().clearSolarPanelVisibilityResults(),y(),d.current.length!==0){g();for(const P of d.current){const v=new Map;for(const T of e)if(T.type===z.SolarPanel){const A=T;v.set(A.parentId,0)}for(const T of e)if(T.type===z.SolarPanel){const A=T;let x=v.get(A.parentId)??0;x+=b(A,P.position)*100,v.set(A.parentId,x)}Tn.getState().setSolarPanelVisibilityResult(P,v)}}},b=(P,v)=>{let T=r(P);if(!T)throw new Error("parent of solar panel does not exist");let A=!1;const x=P.parentType===z.Wall;if(T.type===z.Roof){if(T=i(T),!T)throw new Error("foundation of solar panel does not exist");A=!0}const S=x?me.absoluteCoordinates(P.cx,P.cy,P.cz,T,i(P),P.lz):me.absoluteCoordinates(P.cx,P.cy,P.cz,T,void 0,void 0,!0);A&&(S.z=P.cz+T.cz);const R=new ie().fromArray(P.normal);x&&R.applyEuler(new nn(0,0,T.relativeAngle));const M=T.rotation[2]+P.relativeAzimuth;Math.abs(P.tiltAngle)>.001&&R.applyEuler(new nn(P.tiltAngle,0,M,"ZYX"));const D=P.lx,E=P.ly*Math.cos(P.tiltAngle),W=P.ly*Math.abs(Math.sin(P.tiltAngle)),j=Math.max(2,Math.round(P.lx/u)),L=Math.max(2,Math.round(P.ly/u)),k=D/j,N=E/L,F=W/L,U=S.x-D/2,O=S.y-E/2,B=(A?S.z:P.poleHeight+S.z)-W/2,_=new Xt(S.x,S.y);let X=0;const $=new ie,Q=new ie;let le;const q=new Xt,te=me.isZero(M);for(let re=0;re0&&(Q.normalize(),C(P.id,$,Q)&&(X+=Math.abs(Q.dot(R))/(le*le)));return X*u*u/(4*Math.PI)},C=(P,v,T)=>{if(f.current.length>1){p.current.length=0,c.set(v,T);const A=f.current.filter(x=>x.uuid!==P);if(c.intersectObjects(A,!1,p.current),p.current.length===0)return!0;for(const[x,S]of p.current.entries())if(S.object.name.endsWith("eyeball")&&x===0)return!0;return!1}return!0};return h.jsx(h.Fragment,{})}),ljo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(da),r=H.getState().world,i=H.getState().elements,a=H(qr),l=H(pA),s=H(N7t),c=H(j7t),u=Tn(Zvt),d=Tn(qvt),f=Tn(Qvt),p=ht(pOe),g=ht(Xvt),y=ht(gOe),w=ht(Jvt),b=H(EBe),C=H(Tge),{scene:P}=oi(),v=Jt(),T=f1(t),A=new Date(r.date),x=m.useMemo(()=>s(t??"Boston MA, USA"),[t]),S=m.useMemo(()=>c(t??"Boston MA, USA"),[t]),R=t?T==null?void 0:T.elevation:0,M=r.timesPerHour??4,D=60/M,E=m.useMemo(()=>new l0,[]),W=m.useRef([]),j=m.useRef([]),L=m.useRef(0),k=m.useRef(!1),N=m.useRef(new Date(r.date)),F=m.useRef(new Map),U=m.useRef(new Map),O=m.useRef(new Array(12).fill(0)),B=m.useRef(new Array(12).fill(0)),_=m.useRef(0),X=m.useRef(!1),$=m.useRef(new Date(r.date)),Q=m.useRef(0),le=m.useMemo(()=>dl(A,r.latitude),[r.date,r.latitude]),q=m.useRef(le);m.useEffect(()=>{if(p)if(C&&!me.hasMovingParts(i))te();else return re(),L.current=requestAnimationFrame(ae),()=>{cancelAnimationFrame(L.current),k.current||(hn(Y.t("message.SimulationAborted",v)),e(ve=>{ve.world.date=N.current.toLocaleString("en-US")}),ht.getState().set(ve=>{ve.simulationInProgress=!1,ve.simulationPaused=!1})),X.current=!1}},[p]),m.useEffect(()=>{X.current=g,g?($.current=new Date(A.getTime()),cancelAnimationFrame(L.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),ae())},[g]);const te=()=>{ce(),xe();for(const ve of i)ve.type===z.Sensor&&ze(ve);e(ve=>{ve.viewState.showDailyLightSensorPanel=!0,ve.selectedFloatingWindow="dailyLightSensorPanel"}),ht.getState().set(ve=>{ve.runDailyLightSensor=!1,ve.simulationInProgress=!1,ve.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),k.current=!0,se(),o&&e(ve=>{ve.actionInfo={name:"Static Daily Simulation for Sensors Completed",details:Tn.getState().dailyLightSensorData,timestamp:new Date().getTime()}})},re=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(N.current=new Date(r.date),Q.current=A.getDay(),A.setHours(Math.floor(le.sunrise/60),-D/2)),k.current=!1,ce(),xe()},ae=()=>{if(p&&!X.current){if(A.getMinutes()+A.getHours()*60+(A.getDay()-Q.current)*T2+D>=le.sunset){cancelAnimationFrame(L.current),e(Ae=>{Ae.world.date=N.current.toLocaleString("en-US"),Ae.viewState.showDailyLightSensorPanel=!0,Ae.selectedFloatingWindow="dailyLightSensorPanel"}),ht.getState().set(Ae=>{Ae.runDailyLightSensor=!1,Ae.simulationInProgress=!1,Ae.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),k.current=!0,se(),o&&e(Ae=>{Ae.actionInfo={name:"Dynamic Daily Simulation for Sensors Completed",details:Tn.getState().dailyLightSensorData,timestamp:new Date().getTime()}});return}A.setHours(A.getHours(),A.getMinutes()+D),e(Ae=>{Ae.world.date=A.toLocaleString("en-US")});for(const Ae of i)Ae.type===z.Sensor&&Se(Ae);L.current=requestAnimationFrame(ae)}},se=()=>{const ve=Ie();for(const Ae of i)if(Ae.type===z.Sensor){const Te=F.current.get(Ae.id);if(Te)for(let Me=0;Me{var Pe;const ve=new Map;let Ae=0;const Te=[];for(const Ee of i)if(Ee.type===z.Sensor){const Be=F.current.get(Ee.id);Be&&(ve.set("Radiation"+ ++Ae,Be),Te.push(Ee.label?Ee.label:"Radiation"+Ae))}const Me=[];for(let Ee=0;Ee<24;Ee++){const Be={};Be.Hour=Ee;for(let Je=1;Je<=Ae;Je++){const We="Radiation"+Je;Be[Te[Je-1]]=(Pe=ve.get(We))==null?void 0:Pe[Ee]}Me.push(Be)}d(Me),u(Te)};m.useEffect(()=>{if(y)if(C&&!me.hasMovingParts(i))ge();else return fe(),L.current=requestAnimationFrame(de),()=>{cancelAnimationFrame(L.current),k.current||(hn(Y.t("message.SimulationAborted",v)),e(ve=>{ve.world.date=N.current.toLocaleString("en-US")}),ht.getState().set(ve=>{ve.simulationInProgress=!1,ve.simulationPaused=!1})),X.current=!1}},[y]),m.useEffect(()=>{X.current=w,w?($.current=new Date(A.getTime()),cancelAnimationFrame(L.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",v))):(n("simulationPaused",!1),de())},[w]);const fe=()=>{X.current?(A.setTime($.current.getTime()),X.current=!1):(N.current=new Date(r.date),_.current=0,A.setMonth(0,22),Q.current=A.getDay(),q.current=dl(A,r.latitude),A.setHours(Math.floor(q.current.sunrise/60),-D/2),e(ve=>{ve.world.date=A.toLocaleString("en-US")})),k.current=!1,ce(),xe(),He()},ge=()=>{ce(),xe(),He(),N.current=new Date(r.date),_.current=0;for(let ve=0;ve<12;ve++){A.setMonth(ve,22),q.current=dl(A,r.latitude),xe();for(const Ae of i)Ae.type===z.Sensor&&ze(Ae);Z(),_.current++}e(ve=>{ve.world.date=N.current.toLocaleString("en-US"),ve.viewState.showYearlyLightSensorPanel=!0,ve.selectedFloatingWindow="yearlyLightSensorPanel"}),ht.getState().set(ve=>{ve.runYearlyLightSensor=!1,ve.simulationInProgress=!1,ve.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),k.current=!0,he(),o&&e(ve=>{ve.actionInfo={name:"Static Yearly Simulation for Sensors Completed",details:Tn.getState().yearlyLightSensorData,timestamp:new Date().getTime()}})},de=()=>{if(y&&!X.current)if(A.getMinutes()+A.getHours()*60+(A.getDay()-Q.current)*T2+D{Ae.world.date=A.toLocaleString("en-US")});for(const Ae of i)Ae.type===z.Sensor&&Se(Ae);L.current=requestAnimationFrame(de)}else{if(Z(),_.current++,_.current===12){cancelAnimationFrame(L.current),e(Ae=>{Ae.world.date=N.current.toLocaleString("en-US"),Ae.viewState.showYearlyLightSensorPanel=!0,Ae.selectedFloatingWindow="yearlyLightSensorPanel"}),ht.getState().set(Ae=>{Ae.runYearlyLightSensor=!1,Ae.simulationInProgress=!1,Ae.simulationPaused=!1}),hn(Y.t("message.SimulationCompleted",v)),k.current=!0,he(),o&&e(Ae=>{Ae.actionInfo={name:"Dynamic Yearly Simulation for Sensors Completed",details:Tn.getState().yearlyLightSensorData,timestamp:new Date().getTime()}});return}A.setMonth(_.current,22),Q.current=A.getDay(),q.current=dl(A,r.latitude),A.setHours(Math.floor(q.current.sunrise/60),-D/2),xe(),L.current=requestAnimationFrame(de)}},Z=()=>{const ve=ye();for(const Ae of i)if(Ae.type===z.Sensor){const Te=F.current.get(Ae.id);if(Te){const Me=U.current.get(Ae.id);if(Me){const Pe=Te.reduce((Ee,Be)=>Ee+Be,0);Me[_.current]+=Pe*ve}}}b&&se()},he=()=>{const ve=[],Ae=[];let Te=0,Me=!1,Pe=!1;for(const We of i)if(We.type===z.Sensor){const Ke=U.current.get(We.id);Ke&&(ve.push(Ke),Ae.push(We.label?We.label:"Radiation"+ ++Te),!Me&&me.isIdentical(We.normal,rs)&&(Me=!0),!Pe&&me.isIdentical(We.normal,iAt)&&(Pe=!0))}const Ee=Me&&x;Ee&&Ae.push("Measured (Hor.)");const Be=Pe&&S;Be&&Ae.push("Measured (Ver.)");const Je=[];for(let We=0;We<12;We++){const Ke={};Ke.Month=Ms[We];for(const[Ne,De]of ve.entries())Ke.Daylight=O.current[We],Ke.Clearness=B.current[We]*100,Ee&&(Ke["Measured (Hor.)"]=x.data[We]),Be&&(Ke["Measured (Ver.)"]=S.data[We]),Ke[Ae[Ne]]=De[We];Je.push(Ke)}f(Je),u(Ae)},xe=()=>{for(const ve of i)if(ve.type===z.Sensor){const Ae=F.current.get(ve.id);Ae?Ae.fill(0):F.current.set(ve.id,new Array(24).fill(0))}},He=()=>{for(const ve of i)if(ve.type===z.Sensor){const Ae=U.current.get(ve.id);Ae?Ae.fill(0):U.current.set(ve.id,new Array(12).fill(0))}},Se=ve=>{const Ae=Ei(A,r.latitude);if(Ae.z0&&(pe(ve.id,Pe,Ae)||(Ke+=We*Je));const Ne=F.current.get(ve.id);if(Ne){const De=A.getMinutes()>=30?A.getHours()+1===24?0:A.getHours()+1:A.getHours();Ne[De]+=Ke}},ze=ve=>{const Ae=a(ve);if(!Ae)throw new Error("parent of sensor does not exist");const Te=F.current.get(ve.id);if(!Te)return;let Me=null;Ae.type===z.Wall&&(Me=l(ve));const Pe=me.absoluteCoordinates(ve.cx,ve.cy,ve.cz,Ae,Me||void 0),Ee=new ie().fromArray(ve.normal);Ee.applyAxisAngle(Io,Ae.rotation[2]);const Be=A.getFullYear(),Je=A.getMonth(),We=A.getDate(),Ke=me.dayOfYear(A);for(let Ne=0;Ne<24;Ne++)for(let De=0;De0){const it=Ri(Ye,Ke,R,yi.SPHERE_MODEL),Ve=Ee.dot(Ye);Ve>0&&(pe(ve.id,Pe,Ye)||(Te[Ne]+=Ve*it)),Te[Ne]+=ni(r.ground,Je,Ee,it)}}},Ie=()=>{const ve=le.daylight()/60;return ve>It?T.sunshineHours[A.getMonth()]/(30*ve*M):0},ye=()=>{const ve=A.getMonth(),Ae=q.current.daylight()/60;return Ae>It?(O.current[ve]=Ae,B.current[ve]=T.sunshineHours[ve]/(30*Ae),B.current[ve]/M):(O.current[ve]=0,B.current[ve]=0,0)},ce=()=>{const ve=P.children.filter(Ae=>Ae.name==="Content");if(ve.length>0){const Ae=ve[0].children;W.current.length=0;for(const Te of Ae)me.fetchSimulationElements(Te,W.current)}},pe=(ve,Ae,Te)=>{if(W.current.length>1){j.current.length=0,E.set(Ae,Te);const Me=W.current.filter(Pe=>Pe.uuid!==ve);return E.intersectObjects(Me,!1,j.current),j.current.length>0}return!1};return h.jsx(h.Fragment,{})}),kFe=(t,e)=>{let n=e.efficiency;return e.cellType==="Monocrystalline"&&(n*=.95),n*(1+e.pmaxTC*(t-25))},sjo=be.memo(({city:t})=>{const e=H(fn),n=ht(xh),o=H(da),r=H.getState().world,i=H.getState().elements,a=H(t5),l=H(qr),s=H(pA),c=Tn(q7t),u=H(yW),d=Tn(Q7t),f=H(AW),p=H(XYe),g=H(JYe),y=Tn(Z7t),w=ht(VYe),b=ht(V7t),C=ht(X7t),P=ht(GYe),v=ht(G7t),T=ht(J7t),A=H(FBe),x=H(Pge),S=H(cW)??900,R=ht(n5),{scene:M}=oi(),D=Jt(),E=f1(t),W=new Date(r.date),j=t?E==null?void 0:E.elevation:0,L=r.timesPerHour??4,k=60/L,N=r.daysPerYear??6,F=12/N,U=m.useMemo(()=>new l0,[]),O=r.monthlyIrradianceLosses??new Array(12).fill(.05),B=r.pvGridCellSize??.25,_=m.useRef([]),X=m.useRef([]),$=m.useRef(0),Q=m.useRef(!1),le=m.useRef(new Date(r.date)),q=m.useRef(new Map),te=m.useRef(new Map),re=m.useRef(0),ae=m.useRef(!1),se=m.useRef(new Date(r.date)),ne=m.useRef(0),fe=m.useRef(20),ge=m.useMemo(()=>dl(W,r.latitude),[r.date,r.latitude]),de=m.useRef(ge),Z=me.daysInYear(W)/12;m.useEffect(()=>{if(w)if(x&&!me.hasMovingParts(i))setTimeout(()=>{he(!1)},50);else return xe(),$.current=requestAnimationFrame(He),()=>{cancelAnimationFrame($.current),Q.current||(hn(Y.t("message.SimulationAborted",D)),e(De=>{De.world.date=le.current.toLocaleString("en-US")}),ht.getState().set(De=>{De.simulationInProgress=!1,De.simulationPaused=!1})),ae.current=!1}},[w]),m.useEffect(()=>{b&&x&&!me.hasMovingParts(i)&&setTimeout(()=>{he(!0)},50)},[b]),m.useEffect(()=>{ae.current=C,C?(se.current=new Date(W.getTime()),cancelAnimationFrame($.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",D))):(n("simulationPaused",!1),He())},[C]);const he=De=>{Ne(),Me();for(const ke of i)ke.type===z.SolarPanel&&Ae(ke);if(e(ke=>{!R&&!De&&(ke.viewState.showDailyPvYieldPanel=!0,ke.selectedFloatingWindow="dailyPvYieldPanel")}),ht.getState().set(ke=>{De?ke.runDailySimulationForSolarPanelsLastStep=!1:ke.runDailySimulationForSolarPanels=!1,ke.simulationInProgress=!1,ke.simulationPaused=!1}),Q.current=!0,Se(),!R&&!De&&(hn(Y.t("message.SimulationCompleted",D)),o)){const ke=Tn.getState().sumDailyPvYield(),Ye=Tn.getState().getDailyPvProfit(),it=Tn.getState().dailyPvYield;e(Ve=>{Ve.actionInfo={name:"Static Daily Simulation for Solar Panels Completed",result:{totalYield:ke.toFixed(2),profit:Ye.toFixed(2)},details:it,timestamp:new Date().getTime()}})}},xe=()=>{ae.current?(W.setTime(se.current.getTime()),ae.current=!1):(le.current=new Date(r.date),ne.current=W.getDay(),W.setHours(Math.floor(ge.sunrise/60),-k/2)),Q.current=!1,Ne(),Me()},He=()=>{if(w&&!ae.current){if(W.getMinutes()+W.getHours()*60+(W.getDay()-ne.current)*T2+k>=ge.sunset){if(cancelAnimationFrame($.current),e(ke=>{ke.world.date=le.current.toLocaleString("en-US"),R||(ke.viewState.showDailyPvYieldPanel=!0,ke.selectedFloatingWindow="dailyPvYieldPanel")}),ht.getState().set(ke=>{ke.runDailySimulationForSolarPanels=!1,ke.simulationInProgress=!1,ke.simulationPaused=!1}),Q.current=!0,Se(),!R&&(hn(Y.t("message.SimulationCompleted",D)),o)){const ke=Tn.getState().sumDailyPvYield(),Ye=Tn.getState().getDailyPvProfit(),it=Tn.getState().dailyPvYield;e(Ve=>{Ve.actionInfo={name:"Dynamic Daily Simulation for Solar Panels Completed",result:{totalYield:ke.toFixed(2),profit:Ye.toFixed(2)},details:it,timestamp:new Date().getTime()}})}return}W.setHours(W.getHours(),W.getMinutes()+k),e(ke=>{ke.world.date=W.toLocaleString("en-US")});for(const ke of i)ke.type===z.SolarPanel&&Te(ke);$.current=requestAnimationFrame(He)}},Se=()=>{const De=Ee();for(const ke of i)if(ke.type===z.SolarPanel){const Ye=ke,it=q.current.get(ke.id);if(it){const Ve=Je(Ye)*De;for(let yt=0;yt{var De;if(p){const ke=new Array(24).fill(0),Ye=new Map;let it=0;const Ve=[];for(const ct of i)if(ct.type===z.SolarPanel){const Xe=q.current.get(ct.id);if(Xe){u(ct.id,Xe.reduce((ut,ft)=>ut+ft,0)),it++,Ye.set("Panel"+it,Xe),Ve.push(ct.label?ct.label:"Panel"+it);for(let ut=0;ut<24;ut++)ke[ut]+=Xe[ut]}}const yt=[];for(let ct=0;ct<24;ct++){const Xe={};Xe.Hour=ct;for(let ut=1;ut<=it;ut++){const ft="Panel"+ut;Xe[Ve[ut-1]]=(De=Ye.get(ft))==null?void 0:De[ct]}yt.push(Xe)}c(yt),y(Ve)}else{const ke=new Array(24).fill(0);for(const it of i)if(it.type===z.SolarPanel){const Ve=q.current.get(it.id);if(Ve){u(it.id,Ve.reduce((yt,ct)=>yt+ct,0));for(let yt=0;yt<24;yt++)ke[yt]+=Ve[yt]}}const Ye=[];for(let it=0;it<24;it++)Ye.push({Hour:it,Total:ke[it]});c(Ye)}};m.useEffect(()=>{if(P)if(x&&!me.hasMovingParts(i))setTimeout(()=>{ye(!1)},50);else return Ie(),$.current=requestAnimationFrame(ce),()=>{cancelAnimationFrame($.current),Q.current||(hn(Y.t("message.SimulationAborted",D)),e(De=>{De.world.date=le.current.toLocaleString("en-US")}),ht.getState().set(De=>{De.simulationInProgress=!1,De.simulationPaused=!1})),ae.current=!1}},[P]),m.useEffect(()=>{v&&x&&!me.hasMovingParts(i)&&setTimeout(()=>{ye(!0)},50)},[v]),m.useEffect(()=>{ae.current=T,T?(se.current=new Date(W.getTime()),cancelAnimationFrame($.current),n("simulationPaused",!0),hn(Y.t("message.SimulationPaused",D))):(n("simulationPaused",!1),ce())},[T]);const Ie=()=>{ae.current?(W.setTime(se.current.getTime()),ae.current=!1):(le.current=new Date(r.date),re.current=0,W.setMonth(0,22),ne.current=W.getDay(),de.current=dl(W,r.latitude),W.setHours(Math.floor(de.current.sunrise/60),-k/2),e(De=>{De.world.date=W.toLocaleString("en-US")})),Q.current=!1,Ne(),Me(),Pe()},ye=De=>{Ne(),Me(),Pe(),le.current=new Date(r.date),re.current=0;for(let ke=0;ke<12;ke+=F){W.setMonth(ke,22),de.current=dl(W,r.latitude),Me();for(const Ye of i)Ye.type===z.SolarPanel&&Ae(Ye);pe(),re.current++}if(e(ke=>{ke.world.date=le.current.toLocaleString("en-US"),!R&&!De&&(ke.viewState.showYearlyPvYieldPanel=!0,ke.selectedFloatingWindow="yearlyPvYieldPanel")}),ht.getState().set(ke=>{De?ke.runYearlySimulationForSolarPanelsLastStep=!1:ke.runYearlySimulationForSolarPanels=!1,ke.simulationInProgress=!1,ke.simulationPaused=!1}),Q.current=!0,ve(),!R&&!De&&(hn(Y.t("message.SimulationCompleted",D)),o)){const ke=Tn.getState().sumYearlyPvYield(),Ye=Tn.getState().getYearlyPvProfit(),it=Tn.getState().yearlyPvYield;e(Ve=>{Ve.actionInfo={name:"Static Yearly Simulation for Solar Panels Completed",result:{totalYield:ke.toFixed(2),profit:Ye.toFixed(2)},details:it,timestamp:new Date().getTime()}})}},ce=()=>{if(P&&!ae.current)if(W.getMinutes()+W.getHours()*60+(W.getDay()-ne.current)*T2+k{ke.world.date=W.toLocaleString("en-US")});for(const ke of i)ke.type===z.SolarPanel&&Te(ke);$.current=requestAnimationFrame(ce)}else{if(pe(),re.current++,re.current===N){if(cancelAnimationFrame($.current),e(ke=>{ke.world.date=le.current.toLocaleString("en-US"),R||(ke.viewState.showYearlyPvYieldPanel=!0,ke.selectedFloatingWindow="yearlyPvYieldPanel")}),ht.getState().set(ke=>{ke.runYearlySimulationForSolarPanels=!1,ke.simulationInProgress=!1,ke.simulationPaused=!1}),Q.current=!0,ve(),!R&&(hn(Y.t("message.SimulationCompleted",D)),o)){const ke=Tn.getState().sumYearlyPvYield(),Ye=Tn.getState().getYearlyPvProfit(),it=Tn.getState().yearlyPvYield;e(Ve=>{Ve.actionInfo={name:"Dynamic Yearly Simulation for Solar Panels Completed",result:{totalYield:ke.toFixed(2),profit:Ye.toFixed(2)},details:it,timestamp:new Date().getTime()}})}return}W.setMonth(re.current*F,22),ne.current=W.getDay(),de.current=dl(W,r.latitude),W.setHours(Math.floor(de.current.sunrise/60),-k/2),Me(),$.current=requestAnimationFrame(ce)}},pe=()=>{const De=Be();for(const ke of i)if(ke.type===z.SolarPanel){const Ye=ke,it=q.current.get(ke.id);if(it){const Ve=te.current.get(ke.id);if(Ve){const yt=it.reduce((ct,Xe)=>ct+Xe,0);Ve[re.current]+=yt*De*Je(Ye)}}}!R&&A&&Se()},ve=()=>{if(g){const De=[],ke=[];let Ye=0;for(const Ve of i)if(Ve.type===z.SolarPanel){const yt=te.current.get(Ve.id);yt&&(f(Ve.id,yt.reduce((ct,Xe)=>ct+Xe,0)*F*Z),De.push(yt),Ye++,ke.push(Ve.label??"Panel"+Ye))}const it=[];for(let Ve=0;Ve<12;Ve+=F){const yt={};yt.Month=Ms[Ve];for(const[ct,Xe]of De.entries())yt[ke[ct]]=Xe[Ve/F]*Z;it.push(yt)}d(it),y(ke)}else{const De=[];for(const Ye of i)if(Ye.type===z.SolarPanel){const it=te.current.get(Ye.id);it&&(f(Ye.id,it.reduce((Ve,yt)=>Ve+yt,0)*F*Z),De.push(it))}const ke=[];for(let Ye=0;Ye<12;Ye+=F){let it=0;for(const Ve of De)it+=Ve[Ye/F];ke.push({Month:Ms[Ye],Total:it*Z})}d(ke)}},Ae=De=>{if(De.trackerType!==za.NO_TRACKER)throw new Error("static simulation is not for solar panel with tracker");let ke=l(De);if(!ke)throw new Error("parent of solar panel does not exist");const Ye=De.parentType===z.Roof,it=De.parentType===z.Wall;if(Ye&&(ke=s(ke),!ke))throw new Error("foundation of solar panel does not exist");const Ve=a(De.pvModelName);if(!Ve)throw new Error("PV model not found");const yt=q.current.get(De.id);if(!yt)return;const ct=it?me.absoluteCoordinates(De.cx,De.cy,De.cz,ke,s(De),De.lz):me.absoluteCoordinates(De.cx,De.cy,De.cz,ke,void 0,void 0,!0),Xe=ke.rotation[2];let ut=Xe+De.relativeAzimuth,ft=De.tiltAngle,ot=!0;if(Ye&&(ct.z=De.cz+De.lz+.02+ke.cz,me.isZero(De.rotation[0])?ct.z+=De.poleHeight:(ft=De.rotation[0],ut=Xe,ot=!1)),it&&!me.isZero(De.tiltAngle)){const mt=ke,Qe=s(ke),Dt=(Qe?Qe.rotation[2]+mt.relativeAngle:mt.relativeAngle)-Gt,lt=De.ly*Math.abs(Math.sin(De.tiltAngle))/2;ct.x+=lt*Math.cos(Dt),ct.y+=lt*Math.sin(Dt)}const st=new ie().fromArray(De.normal),at=new nn(Ye&&!ot?0:ft,0,ut,"ZYX");st.applyEuler(at);const Oe=W.getFullYear(),Ze=W.getMonth(),St=W.getDate(),Pt=me.dayOfYear(W);let Rt,Ut,Ht,At,kt;r.discretization===Fm.EXACT?(Rt=De.lx,Ut=De.ly,De.orientation===vr.portrait?(Ht=Math.max(1,Math.round(De.lx/Ve.width)),At=Math.max(1,Math.round(De.ly/Ve.length)),Ht*=Ve.n,At*=Ve.m):(Ht=Math.max(1,Math.round(De.lx/Ve.length)),At=Math.max(1,Math.round(De.ly/Ve.width)),Ht*=Ve.m,At*=Ve.n),kt=De.lx/Ht):(Rt=De.lx,Ut=De.ly,Ht=Math.max(2,Math.round(De.lx/B)),At=Math.max(2,Math.round(De.ly/B)),Ht%2!==0&&(Ht+=1),At%2!==0&&(At+=1),kt=B);const gt=Rt/Ht,dt=Ut/At,Ct=ct.x-(Rt-kt)/2,tt=ct.y-(Ut-kt)/2,Fe=Ye||it?ct.z:ke.lz+De.poleHeight+De.lz,qe=new Xt(ct.x,ct.y),je=new ie,rt=Array.from(Array(Ht),()=>new Array(At));Ye&&!ot&&(at.x=De.rotation[0],at.z=De.rotation[2]+Xe),it&&(at.x=Gt+De.tiltAngle,at.z=ke.relativeAngle+Xe);for(let mt=0;mt<24;mt++)for(let Qe=0;Qe0){const lt=Ri(Dt,Pt,j,yi.SPHERE_MODEL),zt=ni(r.ground,Ze,st,lt),Ft=st.dot(Dt),_t=new Xt,tn=new ie;if(Ve.bifacialityFactor>0){const an=st.clone().negate(),mn=ni(r.ground,Ze,an,lt),Hn=zt+mn*Ve.bifacialityFactor;for(let Fo=0;Fo0?Ft:-Ft*Ve.bifacialityFactor)*lt)}else for(let an=0;an0&&(_t.set(Ct+an*gt,tt+mn*dt),tn.set(_t.x-qe.x,_t.y-qe.y,0),tn.applyEuler(at),je.set(ct.x+tn.x,ct.y+tn.y,Fe+tn.z),Ke(De.id,je,Dt)||(rt[an][mn]+=Ft*lt));let Qt=0;We(Tt);const gn=kFe(fe.current,Ve);switch(Ve.shadeTolerance){case Fv.NONE:{let an=Number.MAX_VALUE;for(let mn=0;mn{let ke=l(De);if(!ke)throw new Error("parent of solar panel does not exist");const Ye=De.parentType===z.Roof,it=De.parentType===z.Wall;if(Ye&&(ke=s(ke),!ke))throw new Error("foundation of solar panel does not exist");const Ve=a(De.pvModelName);if(!Ve)throw new Error("PV model not found");const yt=Ei(W,r.latitude);if(yt.z<=0)return;const ct=it?me.absoluteCoordinates(De.cx,De.cy,De.cz,ke,s(De),De.lz):me.absoluteCoordinates(De.cx,De.cy,De.cz,ke,void 0,void 0,!0),Xe=ke.rotation[2];let ut=De.tiltAngle,ft=Xe+(it?0:De.relativeAzimuth),ot=!0;if(Ye&&(ct.z=De.cz+De.lz+.02+ke.cz,me.isZero(De.rotation[0])?ct.z+=De.poleHeight:(ut=De.rotation[0],ft=Xe,ot=!1)),it&&!me.isZero(De.tiltAngle)){const zt=ke,Ft=s(ke),tn=(Ft?Ft.rotation[2]+zt.relativeAngle:zt.relativeAngle)-Gt,Qt=De.ly*Math.abs(Math.sin(De.tiltAngle))/2;ct.x+=Qt*Math.cos(tn),ct.y+=Qt*Math.sin(tn)}const st=new ie().fromArray(De.normal),at=W.getMonth(),Oe=me.dayOfYear(W);let Ze,St,Pt,Rt,Ut;r.discretization===Fm.EXACT?(Ze=De.lx,St=De.ly,De.orientation===vr.portrait?(Pt=Math.max(1,Math.round(De.lx/Ve.width)),Rt=Math.max(1,Math.round(De.ly/Ve.length)),Pt*=Ve.n,Rt*=Ve.m):(Pt=Math.max(1,Math.round(De.lx/Ve.length)),Rt=Math.max(1,Math.round(De.ly/Ve.width)),Pt*=Ve.m,Rt*=Ve.n),Ut=De.lx/Pt):(Ze=De.lx,St=De.ly,Pt=Math.max(2,Math.round(De.lx/B)),Rt=Math.max(2,Math.round(De.ly/B)),Pt%2!==0&&(Pt+=1),Rt%2!==0&&(Rt+=1),Ut=B);const Ht=Ze/Pt,At=St/Rt,kt=ct.x-(Ze-Ut)/2,gt=ct.y-(St-Ut)/2,dt=Ye||it?ct.z:ke.lz+De.poleHeight+De.lz,Ct=new Xt(ct.x,ct.y),tt=new ie,Fe=Array.from(Array(Pt),()=>new Array(Rt));let qe=new nn(Ye&&!ot?0:ut,0,ft,"ZYX");if(De.trackerType!==za.NO_TRACKER){const zt=Xe?yt.clone().applyAxisAngle(Io,-Xe):yt.clone();switch(De.trackerType){case za.ALTAZIMUTH_DUAL_AXIS_TRACKER:{const Ft=new bs().setFromUnitVectors(Io,zt);qe=new nn().setFromQuaternion(Ft),qe.z+=ft;break}case za.HORIZONTAL_SINGLE_AXIS_TRACKER:{const Ft=new bs().setFromUnitVectors(Io,new ie(zt.x,0,zt.z).normalize());qe=new nn().setFromQuaternion(Ft),qe.z+=ft;break}case za.VERTICAL_SINGLE_AXIS_TRACKER:{const Ft=new ie(zt.x,-zt.y,0).normalize(),_t=Math.acos(Oc.dot(Ft))*Math.sign(Ft.x);qe=new nn(De.tiltAngle,0,_t+Xe,"ZYX");break}case za.TILTED_SINGLE_AXIS_TRACKER:break}}if(it&&st.applyEuler(new nn(0,0,ke.relativeAngle)),st.applyEuler(qe),Ye&&!ot&&(qe.x=De.rotation[0],qe.z=De.rotation[2]+Xe),it){const zt=l(De);zt&&(qe.x=Gt+De.tiltAngle,qe.z=ke.relativeAngle+zt.rotation[2])}const je=Ri(yt,Oe,j,yi.SPHERE_MODEL),rt=ni(r.ground,at,st,je),mt=st.dot(yt),Qe=new Xt,Tt=new ie;if(Ve.bifacialityFactor>0){const zt=st.clone().negate(),Ft=ni(r.ground,at,zt,je),_t=rt+Ft*Ve.bifacialityFactor;for(let tn=0;tn0?mt:-mt*Ve.bifacialityFactor)*je)}else for(let zt=0;zt0&&(Qe.set(kt+zt*Ht,gt+Ft*At),Tt.set(Qe.x-Ct.x,Qe.y-Ct.y,0),Tt.applyEuler(qe),tt.set(ct.x+Tt.x,ct.y+Tt.y,dt+Tt.z),Ke(De.id,tt,yt)||(Fe[zt][Ft]+=mt*je));let Dt=0;switch(Ve.shadeTolerance){case Fv.NONE:{let zt=Number.MAX_VALUE;for(let Ft=0;Ft=30?W.getHours()+1===24?0:W.getHours()+1:W.getHours();lt[Ft]+=zt*Dt/(Pt*Rt)}},Me=()=>{for(const De of i)if(De.type===z.SolarPanel){const ke=q.current.get(De.id);ke?ke.fill(0):q.current.set(De.id,new Array(24).fill(0))}},Pe=()=>{for(const De of i)if(De.type===z.SolarPanel){const ke=te.current.get(De.id);ke&&ke.length===N?ke.fill(0):te.current.set(De.id,new Array(N).fill(0))}},Ee=()=>{const De=ge.daylight()/60;return De>It?E.sunshineHours[W.getMonth()]/(30*De*L):0},Be=()=>{const De=de.current.daylight()/60;return De>It?E.sunshineHours[W.getMonth()]/(30*De*L):0},Je=De=>{if(!a(De.pvModelName))throw new Error("PV model not found");return De.lx*De.ly*(De.inverterEfficiency??.95)*(1-O[W.getMonth()])},We=De=>{if(E){const ke=Qx(De,E.lowestTemperatures,E.highestTemperatures);fe.current=$x(ke.high,ke.low,r.diurnalTemperatureModel,S,dl(De,r.latitude),me.minutesIntoDay(De))}},Ke=(De,ke,Ye)=>{if(_.current.length>1){X.current.length=0,U.set(ke,Ye);const it=_.current.filter(Ve=>Ve.uuid!==De);return U.intersectObjects(it,!1,X.current),X.current.length>0}return!1},Ne=()=>{const De=M.children.filter(ke=>ke.name==="Content");if(De.length>0){const ke=De[0].children;_.current.length=0;for(const Ye of ke)me.fetchSimulationElements(Ye,_.current)}};return h.jsx(h.Fragment,{})}),cjo=be.memo(()=>{const t=H(Tc),e=H(Sb),n=H(_Ye),o=H(OYe),r=H(Bge),[i,a]=m.useState("Boston MA, USA");return m.useEffect(()=>{if(Object.keys(r).length===0)return;const l=n(t,e)??"Boston MA, USA";a(l),o(l)},[t,e,r]),h.jsxs(h.Fragment,{children:[h.jsx($Uo,{city:i}),h.jsx(QUo,{city:i}),h.jsx(ZUo,{city:i}),h.jsx(ljo,{city:i}),h.jsx(sjo,{city:i}),h.jsx(ajo,{}),h.jsx(ejo,{city:i}),h.jsx(tjo,{city:i}),h.jsx(njo,{city:i}),h.jsx(ojo,{city:i}),h.jsx(rjo,{city:i})]})}),d_="/aladdin/assets/image_fail_try_again-CaxVXMjm.png";var BL=(t=>(t[t.None=0]="None",t[t.Equal=1]="Equal",t[t.LessThan=2]="LessThan",t[t.GreaterThan=3]="GreaterThan",t[t.Between=4]="Between",t))(BL||{});const ujo=5,djo=be.memo(({yScale:t,tickLength:e,tickIntegers:n,variable:o,name:r,unit:i,type:a,digits:l,min:s,max:c,step:u,value:d,filter:f,hover:p})=>{const g=H(fn),y=H(mp),w=H(s0),b=H(BYe),C=H(jge),P=H(YYe),[v,T]=m.useState(!1),A=m.useRef(s),x=m.useRef(c);m.useEffect(()=>{A.current=s},[s]),m.useEffect(()=>{x.current=c},[c]);const S={lng:w},R=y.uid===b,M=t.range(),D=t(s)-t(c),E=40,W=m.useMemo(()=>{const B=M[0]-M[1],_=a==="number"?Math.floor(B/e):1;return(n?t.ticks(_).filter($=>Number.isInteger($)):t.ticks(_)).map($=>({value:$,yOffset:t($)}))},[t,e,a,n,M]),j=()=>{g(B=>{B.projectState.selectedProperty=B.projectState.selectedProperty!==o?o:null}),ht.getState().set(B=>{B.updateProjectsFlag=!0})},L=()=>{R&&b&&C?RVn(b,C,P!==o?o:null).then(()=>{j()}):j()},k=(B,_)=>h.jsx("span",{style:{display:"block",width:_+"px"},children:B}),N=()=>h.jsx("text",{onClick:L,x:0,y:-20,style:{fontSize:"10px",textAnchor:"middle",fill:"dimgray",cursor:"pointer",fontWeight:P===o?"bold":"normal"},children:r}),F=m.useMemo(()=>o==="yearlyProfit"||o==="unitCost"||o==="sellingPrice"||o==="totalYearlyCost",[o]),U=()=>o==="totalYearlyCost"||o==="totalYearlyYield"||o==="meanYearlyYield"||o==="unitCost"||o==="poleHeight"||o==="interRowSpacing"?0:o==="tiltAngle"||o==="latitude"?-90:o==="rowWidth"?1:Number.MIN_SAFE_INTEGER,O=()=>o==="tiltAngle"||o==="latitude"?90:Number.MAX_SAFE_INTEGER;return h.jsxs(h.Fragment,{children:[o!=="orientation"?h.jsx(Al,{content:h.jsxs("div",{children:[h.jsx(Mn,{style:{width:"240px"},addonBefore:k(Y.t("word.Minimum",S)+(F?" $":""),80),addonAfter:i,min:U(),max:x.current-u,step:u,value:A.current,onChange:B=>{B!==null&&(g(_=>{if(_.projectState.ranges){let X=-1,$=null;for(const[Q,le]of _.projectState.ranges.entries())if(le.variable===o){X=Q,$=le;break}if(X>=0&&$)_.projectState.ranges[X]={variable:$.variable,minimum:B,maximum:$.maximum},y.uid&&_.projectState.title&&WCe(y.uid,_.projectState.title,_.projectState.ranges);else{const Q={variable:o,minimum:B,maximum:c};_.projectState.ranges.push(Q),y.uid&&_.projectState.title&&kO(y.uid,_.projectState.title,Q)}}else{const X={variable:o,minimum:B,maximum:c};_.projectState.ranges=[X],y.uid&&_.projectState.title&&kO(y.uid,_.projectState.title,X)}}),A.current=Number(B),T(!v))}}),h.jsx("br",{}),h.jsx(Mn,{style:{width:"240px"},addonBefore:k(Y.t("word.Maximum",S)+(F?" $":""),80),addonAfter:i,min:A.current+u,max:O(),step:u,value:x.current,onChange:B=>{B!==null&&(g(_=>{if(_.projectState.ranges){let X=-1,$=null;for(const[Q,le]of _.projectState.ranges.entries())if(le.variable===o){X=Q,$=le;break}if(X>=0&&$)_.projectState.ranges[X]={variable:$.variable,minimum:$.minimum,maximum:B},y.uid&&_.projectState.title&&WCe(y.uid,_.projectState.title,_.projectState.ranges);else{const Q={variable:o,minimum:s,maximum:B};_.projectState.ranges.push(Q),y.uid&&_.projectState.title&&kO(y.uid,_.projectState.title,Q)}}else{const X={variable:o,minimum:s,maximum:B};_.projectState.ranges=[X],y.uid&&_.projectState.title&&kO(y.uid,_.projectState.title,X)}}),x.current=Number(B),T(!v))}})]}),children:N()}):h.jsx(h.Fragment,{children:N()}),d!==void 0&&h.jsx("text",{x:0,y:-8,style:{fontSize:"9px",textAnchor:"middle",fill:"dimgray"},children:F?d.toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:l})+(o==="yearlyProfit"||o==="totalYearlyCost"?"K":""):(o==="orientation"?Y.t(d===0?"solarPanelMenu.Landscape":"solarPanelMenu.Portrait",S)+(d===0?" (▭)":" (▯)"):d.toFixed(l))+(i!==""?i:"")}),f&&f.type===BL.Between&&h.jsx("rect",{x:-5,y:t(f.upperBound??c),width:10,height:t((f==null?void 0:f.lowerBound)??s)-t((f==null?void 0:f.upperBound)??c),fill:"lightgray"}),h.jsx("rect",{x:-E/2,y:0,width:E,height:D,fill:"gold",fillOpacity:P===o?.25:0}),W.map(({value:B,yOffset:_})=>h.jsxs("g",{transform:`translate(0, ${_})`,shapeRendering:"crispEdges",children:[h.jsx("line",{x1:-ujo,x2:0,stroke:"black",strokeWidth:1}),h.jsx("text",{style:{fontSize:"10px",textAnchor:"start",alignmentBaseline:"central",transform:"translateX(-25px)"},children:o==="orientation"?B===0?"▭":"▯":B},B)]},B)),h.jsx("line",{x1:0,x2:0,y1:t(s),y2:t(c),stroke:"black",strokeWidth:2}),f&&f.type===BL.Between&&h.jsx("foreignObject",{x:-E/2,y:4,width:E,height:D-3,children:h.jsx(fy,{theme:{components:{Slider:{railBg:"black",railSize:0,handleSize:8}}},children:h.jsx(Iu,{style:{marginLeft:E/2+"px"},min:s,max:c,step:(c-s)/100,value:[f.lowerBound??s,f.upperBound??c],onChange:B=>{f&&(f.lowerBound=B[0],f.upperBound=B[1],p&&p(-1),g(_=>{if(_.projectState.filters){let X=-1;for(const[$,Q]of _.projectState.filters.entries())if(Q.variable===o){X=$;break}if(X>=0)_.projectState.filters[X]={variable:f.variable,type:f.type,lowerBound:f.lowerBound,upperBound:f.upperBound};else{const $={variable:o,type:f.type,lowerBound:f.lowerBound,upperBound:f.upperBound};_.projectState.filters.push($)}}}),T(!v))},range:!0,vertical:!0})})})]})}),nP={top:30,right:55,bottom:36,left:55},fjo=["#e0ac2b","#e85252","#6689c6","#9a6fb0","#a53253","#69b3a2","#556b2f","#8b008b","#ff1493","#d2691e","#2f4f4f","#dc143c"],hjo=be.memo(({id:t,width:e,height:n,data:o,types:r,minima:i,maxima:a,filters:l,steps:s,variables:c,titles:u,units:d,digits:f,tickIntegers:p,hover:g,hoveredIndex:y,selectedIndex:w})=>{const b=e-nP.right-nP.left,C=n-nP.top-nP.bottom,P=m.useMemo(()=>[...new Set(o.map(M=>M.group))],[o]),v=m.useMemo(()=>jC().range([0,b]).domain(c).padding(0),[c,b]),T=m.useMemo(()=>{const M={};return c.forEach((D,E)=>{M[D]=dL().range([C,0]).domain([i[E]??0,a[E]??1])}),M},[c,i,a,C]),A=m.useMemo(()=>qee().domain(P).range(fjo),[P]),x=P3e(),S=m.useMemo(()=>o.map((M,D)=>{if(M.invisible)return null;const E=c.map(j=>{const L=T[j],k=v(j)??0,N=L(M[j]);return[k,N]}),W=x(E);if(W)return h.jsx("path",{onMouseOver:()=>{g(D)},d:W,stroke:M.hovered?"red":A(M.group),fill:"none",strokeWidth:M.excluded?.25:M.selected?3:1,strokeDasharray:M.hovered?"3,3":"none"},D)}),[o,c,v,T,A]),R=m.useMemo(()=>c.map((M,D)=>{const E=T[M];return h.jsx("g",{transform:"translate("+v(M)+",0)",children:h.jsx(djo,{yScale:E,tickLength:40,tickIntegers:p[D],type:r[D]??"number",variable:c[D],name:u[D],unit:d[D],digits:f[D],min:i[D],max:a[D],step:s[D],value:y>=0&&!o[y].invisible?o[y][M]:w>=0&&!o[w].invisible?o[w][M]:void 0,filter:l[D],hover:g})},D)}),[c,o,v,T,p,r,u,d,f,i,a,s,l,w,y]);return h.jsx("svg",{id:t,width:e,height:n,onMouseLeave:()=>{g&&g(-1)},onContextMenu:M=>{M.stopPropagation()},children:h.jsxs("g",{width:b,height:C,transform:`translate(${[nP.left,nP.top].join(",")})`,children:[S,R]})})});var ype={};(function(t){(function(){var e=t||!1||this||window;e.default=e;var n="http://www.w3.org/2000/xmlns/",o="http://www.w3.org/1999/xhtml",r="http://www.w3.org/2000/svg",i=']>',a=/url\(["']?(.+?)["']?\)/,l={woff2:"font/woff2",woff:"font/woff",otf:"application/x-font-opentype",ttf:"application/x-font-ttf",eot:"application/vnd.ms-fontobject",sfnt:"application/font-sfnt",svg:"image/svg+xml"},s=function(E){return E instanceof HTMLElement||E instanceof SVGElement},c=function(E){if(!s(E))throw new Error("an HTMLElement or SVGElement is required; got "+E)},u=function(E){return new Promise(function(W,j){s(E)?W(E):j(new Error("an HTMLElement or SVGElement is required; got "+E))})},d=function(E){return E&&E.lastIndexOf("http",0)===0&&E.lastIndexOf(window.location.host)===-1},f=function(E){var W=Object.keys(l).filter(function(j){return E.indexOf("."+j)>0}).map(function(j){return l[j]});return W?W[0]:(console.error("Unknown font format for "+E+". Fonts may not be working correctly."),"application/octet-stream")},p=function(E){for(var W="",j=new Uint8Array(E),L=0;L"u"||L===null||isNaN(parseFloat(L))?0:L},y=function(E,W,j,L){if(E.tagName==="svg")return{width:j||g(E,W,"width"),height:L||g(E,W,"height")};if(E.getBBox){var k=E.getBBox(),N=k.x,F=k.y,U=k.width,O=k.height;return{width:N+U,height:F+O}}},w=function(E){return decodeURIComponent(encodeURIComponent(E).replace(/%([0-9A-F]{2})/g,function(W,j){var L=String.fromCharCode("0x"+j);return L==="%"?"%25":L}))},b=function(E){for(var W=window.atob(E.split(",")[1]),j=E.split(",")[0].split(":")[1].split(";")[0],L=new ArrayBuffer(W.length),k=new Uint8Array(L),N=0;N"u",X=F||[];return S().forEach(function($){var Q=$.rules,le=$.href;Q&&Array.from(Q).forEach(function(q){if(typeof q.style<"u")if(C(E,q.selectorText))B.push(O(q.selectorText,q.style.cssText));else if(_&&q.cssText.match(/^@font-face/)){var te=P(q,le);te&&X.push(te)}else U||B.push(q.cssText)})}),A(X).then(function($){return B.join(` `)+$})},M=function(){if(!navigator.msSaveOrOpenBlob&&!("download"in document.createElement("a")))return{popup:window.open()}};e.prepareSvg=function(D,E,W){c(D);var j=E||{},L=j.left,k=L===void 0?0:L,N=j.top,F=N===void 0?0:N,U=j.width,O=j.height,B=j.scale,_=B===void 0?1:B,X=j.responsive,$=X===void 0?!1:X,Q=j.excludeCss,le=Q===void 0?!1:Q;return v(D).then(function(){var q=D.cloneNode(!0);q.style.backgroundColor=(E||{}).backgroundColor||D.style.backgroundColor;var te=y(D,q,U,O),re=te.width,ae=te.height;if(D.tagName!=="svg")if(D.getBBox){q.getAttribute("transform")!=null&&q.setAttribute("transform",q.getAttribute("transform").replace(/translate\(.*?\)/,""));var se=document.createElementNS("http://www.w3.org/2000/svg","svg");se.appendChild(q),q=se}else{console.error("Attempted to render non-SVG element",D);return}if(q.setAttribute("version","1.1"),q.setAttribute("viewBox",[k,F,re,ae].join(" ")),q.getAttribute("xmlns")||q.setAttributeNS(n,"xmlns",r),q.getAttribute("xmlns:xlink")||q.setAttributeNS(n,"xmlns:xlink","http://www.w3.org/1999/xlink"),$?(q.removeAttribute("width"),q.removeAttribute("height"),q.setAttribute("preserveAspectRatio","xMinYMin meet")):(q.setAttribute("width",re*_),q.setAttribute("height",ae*_)),Array.from(q.querySelectorAll("foreignObject > *")).forEach(function(ge){ge.setAttributeNS(n,"xmlns",ge.tagName==="svg"?r:o)}),le){var ne=document.createElement("div");ne.appendChild(q);var fe=ne.innerHTML;if(typeof W=="function")W(fe,re,ae);else return{src:fe,width:re,height:ae}}else return R(D,E).then(function(ge){var de=document.createElement("style");de.setAttribute("type","text/css"),de.innerHTML=`{const n=H(fn),o=H(mp),r=H(Pb),i=H(jYe),a=H(BYe),l=H(w7t),s=H(v7t),c=H(YYe),u=H(A7t),d=H(x7t),f=H(b7t),p=H(M7t),g=H(C7t),y=H(H7t),w=H(R7t),b=H(S7t),C=H(T7t),P=H(P7t),v=H(i$),T=H(n$),[A,x]=m.useState(),[S,R]=m.useState(),[M,D]=m.useState(!1),[E,W]=m.useState(!1),j=m.useRef(!1),L=m.useRef(u??null),k=m.useRef(!1),N=m.useRef(!1),F=m.useRef(d??d9.ALL),U=m.useRef(!1),O=m.useRef(l??[]),B=m.useRef(f??200),_=m.useRef(b??"rowWidth"),X=m.useRef(C??"rowWidth"),$=m.useRef(P??5),Q=m.useRef(!0),le=m.useRef(!0);m.useEffect(()=>{_.current=b??"rowWidth"},[b]),m.useEffect(()=>{X.current=C??"rowWidth"},[C]),m.useEffect(()=>{$.current=P??5},[P]),m.useEffect(()=>{B.current=f??200},[f]);const{t:q}=Vl(),te=Jt(),re=o.uid===a;m.useEffect(()=>{if(O.current=[],l){for(const rt of l)O.current.push(rt);const je=c;if(je){const rt=g?1:-1;O.current.sort((mt,Qe)=>je?je==="rowWidth"&&"rowsPerRack"in mt&&"rowsPerRack"in Qe?rt*(mt.rowsPerRack-Qe.rowsPerRack):je==="orientation"?rt*((mt[je]==="Landscape"?0:1)-(Qe[je]==="Landscape"?0:1)):je==="totalYearlyYield"&&"yearlyYield"in mt&&"yearlyYield"in Qe?rt*(mt.yearlyYield-Qe.yearlyYield):je==="meanYearlyYield"&&"yearlyYield"in mt&&"yearlyYield"in Qe?rt*(mt.yearlyYield/mt.panelCount-Qe.yearlyYield/Qe.panelCount):je==="totalYearlyCost"?rt*(me.calculateCost(mt)-me.calculateCost(Qe)):je==="yearlyProfit"?rt*(me.calculateProfit(mt)-me.calculateProfit(Qe)):je in mt&&je in Qe?rt*(mt[je]-Qe[je]):0:0)}D(!M)}},[l,g,c]),m.useEffect(()=>{if(x(void 0),l){for(const je of l)if(je.title===r){x(je);break}}},[r,l]),m.useEffect(()=>{const je=()=>{D(!M)};return window.addEventListener("resize",je),()=>{window.removeEventListener("resize",je)}},[M]);const ae=()=>{n(je=>{je.projectView=!1,je.projectState.title=null,je.projectState.description=null,je.projectState.owner=null,je.projectImages.clear()}),x(void 0),ht.getState().set(je=>{je.projectImagesUpdateFlag=!je.projectImagesUpdateFlag})},se=()=>{ht.getState().set(je=>{je.curateDesignToProjectFlag=!0})},ne=()=>{o.uid&&i&&A&&SVn(o.uid,i,A).then(()=>{n(je=>{if(je.projectState.designs){let rt=-1;for(const[mt,Qe]of je.projectState.designs.entries())if(Qe.title===A.title){rt=mt;break}rt>=0&&je.projectState.designs.splice(rt,1)}})})},fe=window.innerHeight,ge=Math.round(800/B.current),de=48/ge,Z=Math.round(t*window.innerWidth/ge-de),[he,xe,He,Se,ze,Ie]=m.useMemo(()=>[pd.getVariables(s,p??[]),pd.getTitles(s,te,p??[]),pd.getUnits(s,te,p??[]),pd.getDigits(s,p??[]),pd.getTickIntegers(s,p??[]),pd.getTypes(s,p??[])],[s,p,E,te]),ye=m.useMemo(()=>{const je=[];if(l&&s===Pi.SOLAR_PANEL_ARRAY)for(const rt of l){const mt={};if(p!=null&&p.includes("rowWidth")||(mt.rowWidth=rt.rowsPerRack),p!=null&&p.includes("tiltAngle")||(mt.tiltAngle=me.toDegrees(rt.tiltAngle)),p!=null&&p.includes("interRowSpacing")||(mt.interRowSpacing=rt.interRowSpacing),p!=null&&p.includes("latitude")||(mt.latitude=rt.latitude??42),p!=null&&p.includes("orientation")||(mt.orientation=rt.orientation===vr.landscape?0:1),p!=null&&p.includes("poleHeight")||(mt.poleHeight=rt.poleHeight),p!=null&&p.includes("unitCost")||(mt.unitCost=rt.unitCost),p!=null&&p.includes("sellingPrice")||(mt.sellingPrice=rt.sellingPrice),p!=null&&p.includes("")||(mt.totalYearlyCost=me.calculateCost(rt)),p!=null&&p.includes("totalYearlyYield")||(mt.totalYearlyYield=rt.yearlyYield*.001),p!=null&&p.includes("meanYearlyYield")||(mt.meanYearlyYield=rt.yearlyYield/rt.panelCount),p!=null&&p.includes("yearlyProfit")||(mt.yearlyProfit=me.calculateProfit(rt)),mt.group=d===d9.INDIVIDUALS?rt.title:"default",mt.selected=A===rt,mt.hovered=S===rt,mt.invisible=rt.invisible,mt.excluded=!1,w){for(const Qe of w)if(Qe.type===BL.Between&&Qe.upperBound!==void 0&&Qe.lowerBound!==void 0){const Tt=mt[Qe.variable];if(typeof Tt=="number"&&(Tt>Qe.upperBound||Tt{n(je=>{if(je.projectState.designs)for(const[rt,mt]of je.projectState.designs.entries())mt.excluded=ye[rt].excluded})},[ye]);const ce=(je,rt)=>{let mt=rt;if(y){for(const Qe of y)if(Qe.variable===je){mt=Qe.minimum??rt;break}}return mt},pe=(je,rt)=>{let mt=rt;if(y){for(const Qe of y)if(Qe.variable===je){mt=Qe.maximum??rt;break}}return mt},ve=m.useMemo(()=>{if(s===Pi.SOLAR_PANEL_ARRAY&&v){const je=[];return p!=null&&p.includes("rowWidth")||je.push(ce("rowWidth",v.minimumRowsPerRack)),p!=null&&p.includes("tiltAngle")||je.push(ce("tiltAngle",me.toDegrees(v.minimumTiltAngle))),p!=null&&p.includes("interRowSpacing")||je.push(ce("interRowSpacing",v.minimumInterRowSpacing)),p!=null&&p.includes("latitude")||je.push(ce("latitude",-90)),p!=null&&p.includes("orientation")||je.push(0),p!=null&&p.includes("poleHeight")||je.push(ce("poleHeight",0)),p!=null&&p.includes("unitCost")||je.push(ce("unitCost",.1)),p!=null&&p.includes("sellingPrice")||je.push(ce("sellingPrice",.1)),p!=null&&p.includes("totalYearlyCost")||je.push(ce("totalYearlyCost",0)),p!=null&&p.includes("totalYearlyYield")||je.push(ce("totalYearlyYield",0)),p!=null&&p.includes("meanYearlyYield")||je.push(ce("meanYearlyYield",0)),p!=null&&p.includes("yearlyProfit")||je.push(ce("yearlyProfit",-10)),je}return[]},[v,s,y,p,E]),Ae=m.useMemo(()=>{if(s===Pi.SOLAR_PANEL_ARRAY&&v){const je=[];return p!=null&&p.includes("rowWidth")||je.push(pe("rowWidth",v.maximumRowsPerRack)),p!=null&&p.includes("tiltAngle")||je.push(pe("tiltAngle",me.toDegrees(v.maximumTiltAngle))),p!=null&&p.includes("interRowSpacing")||je.push(pe("interRowSpacing",v.maximumInterRowSpacing)),p!=null&&p.includes("latitude")||je.push(pe("latitude",90)),p!=null&&p.includes("orientation")||je.push(1),p!=null&&p.includes("poleHeight")||je.push(pe("poleHeight",5)),p!=null&&p.includes("unitCost")||je.push(pe("unitCost",1)),p!=null&&p.includes("sellingPrice")||je.push(pe("sellingPrice",.5)),p!=null&&p.includes("totalYearlyCost")||je.push(pe("totalYearlyCost",100)),p!=null&&p.includes("totalYearlyYield")||je.push(pe("totalYearlyYield",100)),p!=null&&p.includes("meanYearlyYield")||je.push(pe("meanYearlyYield",1e3)),p!=null&&p.includes("yearlyProfit")||je.push(pe("yearlyProfit",10)),je}return[]},[v,s,y,p,E]),Te=(je,rt)=>{let mt=rt;if(w){for(const Qe of w)if(Qe.variable===je){mt=Qe.lowerBound??rt;break}}return mt},Me=(je,rt)=>{let mt=rt;if(w){for(const Qe of w)if(Qe.variable===je){mt=Qe.upperBound??rt;break}}return mt},Pe=(je,rt,mt)=>({variable:je,type:BL.Between,upperBound:Me(je,rt),lowerBound:Te(je,mt)}),Ee=m.useMemo(()=>{const je=[];return p!=null&&p.includes("rowWidth")||je.push(Pe("rowWidth",v.maximumRowsPerRack,v.minimumRowsPerRack)),p!=null&&p.includes("tiltAngle")||je.push(Pe("tiltAngle",me.toDegrees(v.maximumTiltAngle),me.toDegrees(v.minimumTiltAngle))),p!=null&&p.includes("interRowSpacing")||je.push(Pe("interRowSpacing",v.maximumInterRowSpacing,v.minimumInterRowSpacing)),p!=null&&p.includes("latitude")||je.push(Pe("latitude",90,-90)),p!=null&&p.includes("orientation")||je.push(Pe("orientation",1,0)),p!=null&&p.includes("poleHeight")||je.push(Pe("poleHeight",5,0)),p!=null&&p.includes("unitCost")||je.push(Pe("unitCost",1,.1)),p!=null&&p.includes("sellingPrice")||je.push(Pe("sellingPrice",.5,.1)),p!=null&&p.includes("totalYearlyCost")||je.push(Pe("totalYearlyCost",100,0)),p!=null&&p.includes("totalYearlyYield")||je.push(Pe("totalYearlyYield",100,0)),p!=null&&p.includes("meanYearlyYield")||je.push(Pe("meanYearlyYield",1e3,0)),p!=null&&p.includes("yearlyProfit")||je.push(Pe("yearlyProfit",10,-10)),je},[E,w,p]),Be=m.useMemo(()=>{if(s===Pi.SOLAR_PANEL_ARRAY&&v){const je=[];return p!=null&&p.includes("rowWidth")||je.push(1),p!=null&&p.includes("tiltAngle")||je.push(.1),p!=null&&p.includes("interRowSpacing")||je.push(.1),p!=null&&p.includes("latitude")||je.push(.1),p!=null&&p.includes("orientation")||je.push(1),p!=null&&p.includes("poleHeight")||je.push(.1),p!=null&&p.includes("unitCost")||je.push(.01),p!=null&&p.includes("sellingPrice")||je.push(.01),p!=null&&p.includes("totalYearlyCost")||je.push(.1),p!=null&&p.includes("totalYearlyYield")||je.push(1),p!=null&&p.includes("meanYearlyYield")||je.push(1),p!=null&&p.includes("yearlyProfit")||je.push(.1),je}return[]},[s,p,E]),Je=m.useRef(!(p!=null&&p.includes("rowWidth"))),We=m.useRef(!(p!=null&&p.includes("tiltAngle"))),Ke=m.useRef(!(p!=null&&p.includes("interRowSpacing"))),Ne=m.useRef(!(p!=null&&p.includes("latitude"))),De=m.useRef(!(p!=null&&p.includes("orientation"))),ke=m.useRef(!(p!=null&&p.includes("poleHeight"))),Ye=m.useRef(!(p!=null&&p.includes("unitCost"))),it=m.useRef(!(p!=null&&p.includes("sellingPrice"))),Ve=m.useRef(!(p!=null&&p.includes("totalYearlyCost"))),yt=m.useRef(!(p!=null&&p.includes("totalYearlyYield"))),ct=m.useRef(!(p!=null&&p.includes("meanYearlyYield"))),Xe=m.useRef(!(p!=null&&p.includes("yearlyProfit")));m.useEffect(()=>{Je.current=!(p!=null&&p.includes("rowWidth")),We.current=!(p!=null&&p.includes("tiltAngle")),Ke.current=!(p!=null&&p.includes("interRowSpacing")),Ne.current=!(p!=null&&p.includes("latitude")),De.current=!(p!=null&&p.includes("orientation")),ke.current=!(p!=null&&p.includes("poleHeight")),Ye.current=!(p!=null&&p.includes("unitCost")),it.current=!(p!=null&&p.includes("sellingPrice")),Ve.current=!(p!=null&&p.includes("totalYearlyCost")),yt.current=!(p!=null&&p.includes("totalYearlyYield")),ct.current=!(p!=null&&p.includes("meanYearlyYield")),Xe.current=!(p!=null&&p.includes("yearlyProfit")),D(!M)},[p]),m.useEffect(()=>{L.current=u},[u]);const ut=je=>{l&&(je>=0&&je{n(rt=>{if(rt.projectState.designs){for(const mt of rt.projectState.designs)if(mt.title===je){mt.invisible=!mt.invisible;break}}})},ot=je=>{ft(je.title),re&&o.uid&&i&&FVn(o.uid,i,je)},st=(je,rt)=>{n(mt=>{mt.projectState.hiddenParameters&&(je?mt.projectState.hiddenParameters.includes(rt)&&mt.projectState.hiddenParameters.splice(mt.projectState.hiddenParameters.indexOf(rt),1):mt.projectState.hiddenParameters.includes(rt)||mt.projectState.hiddenParameters.push(rt))})},at=(je,rt)=>{U.current=!0,re?o.uid&&i&&TVn(o.uid,i,rt,!je).then(()=>{st(je,rt)}):st(je,rt)},Oe=()=>{n(je=>{je.projectState.dataColoring=F.current}),ht.getState().set(je=>{je.updateProjectsFlag=!0}),D(!M)},Ze=je=>{F.current=je,re?o.uid&&i&&CVn(o.uid,i,F.current).then(()=>{Oe()}):Oe()},St=()=>h.jsxs("div",{children:[h.jsx(Li,{style:{width:"100%"},onChange:je=>{Je.current=je.target.checked,at(Je.current,"rowWidth"),W(!E)},checked:Je.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayRowWidth",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{We.current=je.target.checked,at(We.current,"tiltAngle"),W(!E)},checked:We.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayTiltAngle",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{Ke.current=je.target.checked,at(Ke.current,"interRowSpacing"),W(!E)},checked:Ke.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayRowSpacing",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{Ne.current=je.target.checked,at(Ne.current,"latitude"),W(!E)},checked:Ne.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("word.Latitude",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{De.current=je.target.checked,at(De.current,"orientation"),W(!E)},checked:De.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayOrientation",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{ke.current=je.target.checked,at(ke.current,"poleHeight"),W(!E)},checked:ke.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayPoleHeight",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{Ye.current=je.target.checked,at(Ye.current,"unitCost"),W(!E)},checked:Ye.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("economicsPanel.UnitCost",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{it.current=je.target.checked,at(it.current,"sellingPrice"),W(!E)},checked:it.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("economicsPanel.SellingPrice",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{Ve.current=je.target.checked,at(Ve.current,"totalYearlyCost"),W(!E)},checked:Ve.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayTotalYearlyCost",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{yt.current=je.target.checked,at(yt.current,"totalYearlyYield"),W(!E)},checked:yt.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayTotalYearlyYield",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{ct.current=je.target.checked,at(ct.current,"meanYearlyYield"),W(!E)},checked:ct.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayMeanYearlyYield",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{Xe.current=je.target.checked,at(Xe.current,"yearlyProfit"),W(!E)},checked:Xe.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayYearlyProfit",te)})})]}),Pt=()=>h.jsxs(h.Fragment,{children:[h.jsx(Oh,{value:"rowWidth",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayRowWidth",te)})},"rowWidth"),h.jsx(Oh,{value:"tiltAngle",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayTiltAngle",te)})},"tiltAngle"),h.jsx(Oh,{value:"interRowSpacing",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayRowSpacing",te)})},"interRowSpacing"),h.jsx(Oh,{value:"latitude",children:h.jsx("span",{style:{fontSize:"12px"},children:q("word.Latitude",te)})},"latitude"),h.jsx(Oh,{value:"orientation",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayOrientation",te)})},"orientation"),h.jsx(Oh,{value:"poleHeight",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayPoleHeight",te)})},"poleHeight"),h.jsx(Oh,{value:"unitCost",children:h.jsx("span",{style:{fontSize:"12px"},children:q("economicsPanel.UnitCost",te)})},"unitCost"),h.jsx(Oh,{value:"sellingPrice",children:h.jsx("span",{style:{fontSize:"12px"},children:q("economicsPanel.SellingPrice",te)})},"sellingPrice"),h.jsx(Oh,{value:"totalYearlyCost",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayTotalYearlyCost",te)})},"totalYearlyCost"),h.jsx(Oh,{value:"totalYearlyYield",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayTotalYearlyYield",te)})},"totalYearlyYield"),h.jsx(Oh,{value:"meanYearlyYield",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayMeanYearlyYield",te)})},"meanYearlyYield"),h.jsx(Oh,{value:"yearlyProfit",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayYearlyProfit",te)})},"yearlyProfit")]}),Rt=m.useMemo(()=>{const je=[];if(l&&s===Pi.SOLAR_PANEL_ARRAY)for(const rt of l){if(rt.invisible||rt===A)continue;const mt={};pd.setScatterData(_.current,"x",mt,rt),pd.setScatterData(X.current,"y",mt,rt),je.push(mt)}return je},[_.current,X.current,l,s,A]),Ut=m.useMemo(()=>{const je=[];if(l&&s===Pi.SOLAR_PANEL_ARRAY)for(const rt of l){if(rt!==A)continue;const mt={};pd.setScatterData(_.current,"x",mt,rt),pd.setScatterData(X.current,"y",mt,rt),je.push(mt)}return je},[_.current,X.current,l,s,A]),Ht=je=>{const rt={min:0,max:1};if(s===Pi.SOLAR_PANEL_ARRAY&&v)switch(je){case"rowWidth":rt.min=ce("rowWidth",v.minimumRowsPerRack),rt.max=pe("rowWidth",v.maximumRowsPerRack);break;case"tiltAngle":rt.min=ce("tiltAngle",me.toDegrees(v.minimumTiltAngle)),rt.max=pe("tiltAngle",me.toDegrees(v.maximumTiltAngle));break;case"interRowSpacing":rt.min=ce("interRowSpacing",v.minimumInterRowSpacing),rt.max=pe("interRowSpacing",v.maximumInterRowSpacing);break;case"latitude":rt.min=ce("latitude",-90),rt.max=pe("latitude",90);break;case"orientation":rt.min=0,rt.max=1;break;case"poleHeight":rt.min=ce("poleHeight",0),rt.max=pe("poleHeight",5);break;case"unitCost":rt.min=ce("unitCost",.1),rt.max=pe("unitCost",1);break;case"sellingPrice":rt.min=ce("sellingPrice",.1),rt.max=pe("sellingPrice",.5);break;case"totalYearlyCost":rt.min=ce("totalYearlyCost",0),rt.max=pe("totalYearlyCost",100);break;case"totalYearlyYield":rt.min=ce("totalYearlyYield",0),rt.max=pe("totalYearlyYield",100);break;case"meanYearlyYield":rt.min=ce("meanYearlyYield",0),rt.max=pe("meanYearlyYield",1e3);break;case"yearlyProfit":rt.min=ce("yearlyProfit",-10),rt.max=pe("yearlyProfit",10);break}return rt},At=m.useMemo(()=>Ht(_.current),[_.current,y]),kt=m.useMemo(()=>Ht(X.current),[X.current,y]),gt=m.useMemo(()=>pd.getUnit(_.current,te),[_.current,te]),dt=m.useMemo(()=>pd.getUnit(X.current,te),[X.current,te]),Ct=()=>h.jsxs("div",{style:{width:"280px"},children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{span:8,style:{paddingTop:"5px"},children:h.jsxs("span",{style:{fontSize:"12px"},children:[q("projectPanel.SelectXAxis",te),": "]})}),h.jsx(nt,{span:16,children:h.jsx(_o,{style:{width:"100%"},value:_.current,onChange:je=>{_.current=je,re&&o.uid&&i&&HVn(o.uid,i,je).then(()=>{}),D(!M)},children:Pt()})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"8px"},children:[h.jsx(nt,{span:8,style:{paddingTop:"5px"},children:h.jsxs("span",{style:{fontSize:"12px"},children:[q("projectPanel.SelectYAxis",te),": "]})}),h.jsx(nt,{span:16,children:h.jsx(_o,{style:{width:"100%"},value:X.current,onChange:je=>{X.current=je,re&&o.uid&&i&&MVn(o.uid,i,je).then(()=>{}),D(!M)},children:Pt()})})]}),h.jsx(on,{style:{paddingBottom:"8px"},children:h.jsxs("div",{children:[h.jsxs(UEo,{id:"scatter-chart",width:280,height:240,margin:{top:0,right:0,bottom:-10,left:-10},children:[h.jsx(bw,{strokeWidth:"1",stroke:"gray",horizontal:Q.current,vertical:le.current}),h.jsx(l1,{dataKey:"x",fontSize:10,type:"number",domain:[At.min,At.max],name:"x",unit:gt,strokeWidth:1,stroke:"gray",tickFormatter:(je,rt)=>_.current==="yearlyProfit"||_.current==="unitCost"||_.current==="sellingPrice"?"$"+je:je}),h.jsx(vh,{dataKey:"y",fontSize:10,type:"number",domain:[kt.min,kt.max],name:"y",unit:dt,strokeWidth:1,stroke:"gray",tickFormatter:(je,rt)=>X.current==="yearlyProfit"||X.current==="unitCost"||X.current==="sellingPrice"?"$"+je:je}),h.jsx(rh,{cursor:{strokeDasharray:"3 3"},formatter:je=>je.toFixed(2)}),h.jsx(gb,{name:"All",data:Rt,fill:"#8884d8",shape:h.jsx(fU,{fill:"#8884d8",r:$.current})}),A&&h.jsx(gb,{name:"Selected",data:Ut,fill:"red",shape:"star"})]}),h.jsx(pjo,{symbolSize:$.current,horizontalGrid:Q.current,verticalGrid:le.current,changeHorizontalGrid:je=>{Q.current=je,D(!M)},changeVerticalGrid:je=>{le.current=je,D(!M)},changeSymbolSize:je=>{$.current=je,re&&o.uid&&i&&IVn(o.uid,i,je).then(()=>{}),D(!M)}})]})}),h.jsx(on,{children:h.jsx("span",{style:{width:"100%",textAlign:"center"},children:h.jsx(Vu,{style:{fontSize:"18px",color:"gray",paddingRight:"8px"},title:q("projectPanel.ScatterPlotScreenshot",te),onClick:()=>{const je=document.getElementById("scatter-chart");je&&ype.saveSvgAsPng(je,"scatter-chart-"+i+".png").then(()=>{hn(q("message.ScreenshotSaved",te))})}})})})]}),tt=()=>h.jsx("div",{children:h.jsxs(Ue.Group,{onChange:je=>{Ze(je.target.value)},value:d??d9.ALL,children:[h.jsx(Ue,{style:{fontSize:"12px",width:"100%"},value:d9.ALL,children:q("projectPanel.SameColorForAllDesigns",te)}),h.jsx("br",{}),h.jsx(Ue,{style:{fontSize:"12px",width:"100%"},value:d9.INDIVIDUALS,children:q("projectPanel.OneColorForEachDesign",te)})]})}),Fe=()=>h.jsx("div",{style:{width:"250px"},onClick:je=>je.stopPropagation(),children:h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{span:14,style:{paddingTop:"5px"},children:h.jsxs("span",{style:{fontSize:"12px"},children:[q("projectPanel.ThumbnailImageSize",te),": "]})}),h.jsx(nt,{span:10,children:h.jsxs(_o,{style:{width:"100%"},value:B.current,onChange:je=>{B.current=je,re?o.uid&&i&&zVn(o.uid,i,je).then(()=>{n(rt=>{rt.projectState.thumbnailWidth=B.current})}):n(rt=>{rt.projectState.thumbnailWidth=B.current}),D(!M)},children:[h.jsx(Oh,{value:100,children:h.jsx("span",{style:{fontSize:"12px"},children:q("word.Small",te)})},"small-thumbnail"),h.jsx(Oh,{value:125,children:h.jsx("span",{style:{fontSize:"12px"},children:q("word.Medium",te)})},"medium-thumbnail"),h.jsx(Oh,{value:200,children:h.jsx("span",{style:{fontSize:"12px"},children:q("word.Large",te)})},"large-thumbnail")]})})]})}),qe=[{key:"1",label:h.jsxs(wjo,{children:[h.jsx("span",{children:q("projectPanel.ProjectDescription",te)+" | "+q("projectPanel.ProjectType",te)+": "+s}),h.jsxs("span",{children:[re&&h.jsxs(h.Fragment,{children:[N.current&&h.jsx(lo,{style:{border:"none",padding:"4px"},onClick:je=>{je.stopPropagation(),j.current=!j.current,D(!M)},children:j.current?h.jsx(Jnn,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.MakeDescriptionNonEditable",te)}):h.jsx(KKe,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.MakeDescriptionEditable",te)})}),h.jsx(lo,{style:{border:"none",padding:"4px"},onClick:je=>{je.stopPropagation(),se()},children:h.jsx(Znn,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.CurateCurrentDesign",te)})}),A&&A.title===r&&h.jsx(lo,{style:{border:"none",padding:"4px"},onClick:je=>{je.stopPropagation(),e&&o.uid&&i&&r&&kVn(o.uid,s,i,f??200,r,e).then(()=>{D(!M)})},children:h.jsx(Ynn,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.UpdateSelectedDesign",te)})}),A&&h.jsx(lo,{style:{border:"none",padding:"4px"},onClick:je=>{je.stopPropagation(),ne(),x(void 0)},children:h.jsx(lGt,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.RemoveSelectedDesign",te)})}),A&&h.jsx(lo,{style:{border:"none",padding:"4px"},onClick:je=>{if(je.stopPropagation(),i){let rt=t1+"?client=web&userid="+o.uid+"&project="+encodeURIComponent(i);A&&(rt+="&title="+encodeURIComponent(A.title)),navigator.clipboard.writeText(rt).then(()=>S2(q("projectListPanel.ProjectLinkGeneratedInClipBoard",te)+"."))}},children:h.jsx(ion,{style:{fontSize:"24px",color:"gray"},title:q("projectListPanel.GenerateProjectLink",te)})})]}),l&&l.length>1&&c&&h.jsx(lo,{style:{border:"none",padding:"4px"},onClick:je=>{je.stopPropagation(),n(rt=>{rt.projectState.sortDescending=!rt.projectState.sortDescending})},children:g?h.jsx(Son,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.ClickToFlipSortingOrder",te)}):h.jsx(Con,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.ClickToFlipSortingOrder",te)})}),h.jsx(Al,{title:h.jsx("div",{onClick:je=>je.stopPropagation(),children:q("projectPanel.ProjectSettings",te)}),content:Fe,children:h.jsx(lo,{style:{border:"none",padding:"4px"},onClick:je=>je.stopPropagation(),children:h.jsx(von,{style:{fontSize:"24px",color:"gray"}})})})]})]}),children:h.jsx(gjo,{title:j.current?void 0:q("projectPanel.DoubleClickToMakeDescriptionEditable",te),readOnly:!j.current,value:L.current??void 0,onDoubleClick:()=>{j.current=!j.current,D(!M)},onChange:je=>{L.current=je.target.value,k.current=!0,n(rt=>{rt.projectState.description=je.target.value}),D(!M)},onBlur:()=>{j.current=!1,k.current&&o.uid&&re&&i&&PVn(o.uid,i,L.current).then(()=>{k.current=!1,D(!M)})},style:{paddingLeft:"10px",textAlign:"left",resize:j.current?"vertical":"none",border:j.current?"1px solid gray":"none"}})}];return h.jsx(mjo,{onContextMenu:je=>{je.stopPropagation()},children:h.jsxs(yjo,{children:[h.jsxs(Ajo,{children:[h.jsx("span",{children:q(re?"projectPanel.Project":"projectPanel.ProjectByOtherPeople",te)+": "+i+(re?"":" ("+q("word.Owner",te)+": "+(a==null?void 0:a.substring(0,4))+"***)")+" ("+O.current.length+")"}),h.jsx("span",{style:{cursor:"pointer"},onMouseDown:()=>{ae()},onTouchStart:()=>{ae()},children:h.jsx(Lw,{title:q("word.Close",te)})})]}),h.jsx(iye,{items:qe,style:{backgroundColor:"white",border:"none"},onChange:je=>{N.current=je.length>0,D(!M)}}),O.current.length>0&&h.jsxs(xjo,{children:[h.jsx(mue,{style:{width:"100%",height:fe/2-(N.current?160:80),paddingLeft:"4px",paddingRight:"4px",overflowX:"hidden",overflowY:"auto"},grid:{column:ge,gutter:1},dataSource:O.current,renderItem:je=>{var Qe;const rt=je.title.lastIndexOf(" "),mt=f===100?8:f===125?12:30;return h.jsxs(mue.Item,{style:{marginBottom:"-28px"},onMouseOver:()=>{R(je)},onMouseLeave:()=>{R(void 0)},children:[h.jsx("img",{loading:"eager",width:Z+"px",height:"auto",onError:Tt=>{Tt.target.src=u_},onLoad:Tt=>{n(Dt=>{Dt.projectImages.set(je.title,Tt.target)}),ht.getState().set(Dt=>{Dt.projectImagesUpdateFlag=!Dt.projectImagesUpdateFlag})},alt:je.title,title:(je.timestamp?q("word.LastUpdate",te)+": "+yc(new Date(je.timestamp)).format("MM-DD-YYYY hh:mm A")+` -`:"")+q(A===je?"projectPanel.SingleClickToDeselectDoubleClickToOpen":"projectPanel.SingleClickToSelectDoubleClickToOpen",te),src:(Qe=je.thumbnail)!=null&&Qe.startsWith("data:image/png;base64")?je.thumbnail:u_,style:{transition:".5s ease",opacity:je.excluded?.25:S===je?.5:1,padding:"1px",cursor:"pointer",borderRadius:A===je?"0":"10px",border:A===je?"2px solid red":"none"},onDoubleClick:Tt=>{const Dt=Tt.target;Dt.src===u_&&(Dt.src=je.thumbnailUrl),x(je),a&&XX(a,je.title,!0,!0).then(()=>{})},onClick:Tt=>{const Dt=Tt.target;Dt.src===u_&&(Dt.src=je.thumbnailUrl),x(je!==A?je:void 0)}}),h.jsx("div",{style:{position:"relative",left:"10px",textAlign:"left",bottom:"18px",color:"white",fontSize:"8px",fontWeight:je.title===r?"bold":"normal"},children:je.title?je.title.length>mt?je.title.substring(0,Math.min(mt,rt))+"..."+je.title.substring(rt):je.title:"Unknown"}),h.jsxs("div",{style:{position:"relative",right:"10px",textAlign:"right",bottom:"36px",color:"white"},children:[je.title===r&&h.jsx(kKe,{style:{paddingRight:"4px",fontSize:"16px"}}),je.invisible?h.jsx(Unn,{onClick:()=>{ot(je)},style:{fontSize:"16px"},title:q("projectPanel.DesignNotShownInSolutionSpaceClickToShow",te)}):h.jsx(mme,{onClick:()=>{ot(je)},style:{fontSize:"16px"},title:q("projectPanel.DesignShownInSolutionSpaceClickToHide",te)})]})]})}}),h.jsxs(vjo,{children:[h.jsx("span",{style:{paddingLeft:"20px"},children:q("projectPanel.SolutionSpace",te)}),h.jsxs("span",{children:[s===Pi.SOLAR_PANEL_ARRAY&&h.jsx(Al,{title:q("projectPanel.ChooseSolutionSpace",te),onOpenChange:je=>{U.current&&(je||ht.getState().set(rt=>{rt.updateProjectsFlag=!0}),U.current=!1)},content:St(),children:h.jsx(lo,{style:{border:"none",paddingRight:0,background:"white"},children:h.jsx(Lnn,{style:{fontSize:"24px",color:"gray"}})})}),h.jsx(Al,{title:q("projectPanel.ChooseDataColoring",te),content:tt(),children:h.jsx(lo,{style:{border:"none",paddingRight:0,background:"white"},children:h.jsx(Mnn,{style:{fontSize:"24px",color:"gray"}})})}),h.jsx(Al,{title:q("projectPanel.GenerateScatterPlot",te),content:Ct(),children:h.jsx(lo,{style:{border:"none",paddingRight:0,background:"white"},children:h.jsx(xWt,{style:{fontSize:"24px",color:"gray"}})})}),h.jsx(lo,{style:{border:"none",paddingRight:"20px",background:"white"},onClick:()=>{const je=document.getElementById("design-space");je&&ype.saveSvgAsPng(je,"design-space-"+i+".png").then(()=>{hn(q("message.ScreenshotSaved",te))})},children:h.jsx(Vu,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.SolutionSpaceScreenshot",te)})})]})]}),h.jsx(hjo,{id:"design-space",width:t*window.innerWidth,height:fe/2-120,data:ye,types:Ie,minima:ve,maxima:Ae,filters:Ee,steps:Be,variables:he,titles:xe,units:He,digits:Se,tickIntegers:ze,hover:ut,hoveredIndex:l&&S?l.indexOf(S):-1,selectedIndex:l&&A?l.indexOf(A):-1})]})]})})}),Sjo=new Xt,k4=({args:t,handleType:e})=>{const[n,o,r,i]=t,[a,l]=m.useState(Da);return h.jsx(Qr,{name:e,args:[i,i,i],position:[n,o,r],onPointerOver:()=>l(ta),onPointerOut:()=>l(Da),children:h.jsx("meshStandardMaterial",{color:a})})},d_=({args:t,handleType:e})=>{const[n,o,r,i]=t,[a,l]=m.useState(Da);return h.jsx(ds,{name:e,args:[i],position:[n,o,r],onPointerOver:()=>l(ta),onPointerOut:()=>l(Da),children:h.jsx("meshStandardMaterial",{color:a})})},kFe=({args:t,handleType:e})=>{const[n,o,r,i]=t,[a,l]=m.useState(Da),s=m.useMemo(()=>h.jsx("meshStandardMaterial",{color:a}),[a]);return h.jsxs("group",{name:e,position:[n,o,r],rotation:[Gt,0,0],onPointerOver:()=>l(ta),onPointerOut:()=>l(Da),scale:i*4,children:[h.jsxs("group",{children:[h.jsx(mge,{args:[.15,.05,6,8,3/2*Math.PI],rotation:[Gt,0,Gt],children:s}),h.jsx(Rd,{args:[.1,.1,6],rotation:[Gt,0,0],position:[.15,0,.05],children:s}),h.jsx(lR,{args:[.05,6],rotation:[0,Gt,0],position:[0,0,.15],children:s})]}),h.jsx(ua,{name:e,args:[.35,.35],position:[0,.05,0],rotation:[-Gt,0,0],visible:!1})]})},Tjo=be.memo(({groupedElementsIdSet:t,childCuboidSet:e,initialPosition:n,initialDimension:o,initialRotation:r})=>{const[i,a,l]=n,[s,c,u]=o,d=s===0?1:c/s,f=t.size>1||e.size>0,p=m.useRef(null),g=m.useRef(new ie),y=m.useRef(new nn),w=m.useRef(new Xt),b=m.useRef(new Map),C=m.useRef(new Map),P=m.useRef(new Map),v=m.useRef(new Map),T=m.useRef(new Map),A=m.useRef(new Map),x=m.useRef(new Map),S=m.useRef(new Map),R=m.useRef(new ie),M=m.useRef(!1),D=m.useRef(new Map),E=m.useRef(new Map),W=m.useRef(new Map),j=m.useRef(new Map),L=m.useRef(new Map),[k,N]=m.useState(new ie(i,a,l)),[F,U]=m.useState(r),[O,B]=m.useState(s/2),[_,X]=m.useState(c/2),[$,Q]=m.useState(u),[le,q]=m.useState(!1),[te,re]=m.useState("Null"),{get:ae}=oi(),se=m.useMemo(()=>new l0,[]),ne=m.useMemo(()=>new Xt,[]),fe=H(Id),ge=H(Gn),de=H(Dge),Z=H(fn),he=H(En);m.useEffect(()=>{Q(u)},[u]),m.useEffect(()=>{N(new ie(i,a,l)),He(s,c),U(r)},[n,o,r]);const xe=Xe=>{ne.x=Xe.offsetX/ae().gl.domElement.clientWidth*2-1,ne.y=-(Xe.offsetY/ae().gl.domElement.clientHeight)*2+1,se.setFromCamera(ne,ae().camera)},He=(Xe,ut)=>{B(Xe/2),X(ut/2)},Se=Xe=>{q(!0),Fn.getState().setEnableOrbitController(!1),M.current=!0,g.current.set(0,0,0),y.current.set(0,0,0),Ae(Ho.Default),Xe.stopPropagation()},ze=(Xe,ut,ft)=>{Z(ot=>{for(const st of ot.elements)if(md(st)&&Xe.has(st.id))[st.cx,st.cy,st.lx,st.ly]=Xe.get(st.id);else if(st.foundationId&&Xe.has(st.foundationId))switch(st.type){case z.Wall:{const at=ut.get(st.id);if(!at)continue;const Oe=st,Ze=at.slice(0,3),St=at.slice(3);Oe.cx=(Ze[0]+St[0])/2,Oe.cy=(Ze[1]+St[1])/2,Oe.lx=Math.hypot(Ze[0]-St[0]+(Ze[1]-St[1])),Oe.relativeAngle=Math.atan2(St[1]-Ze[1],St[0]-Ze[0]),Oe.leftPoint=[...Ze],Oe.rightPoint=[...St];break}case z.Window:{const at=st;if(at.parentType!==z.Roof)continue;const Oe=ft.get(st.id);if(!Oe)continue;[at.cx,at.cy]=Oe;break}case z.SolarPanel:{const at=ft.get(st.id);if(!at)continue;[st.cx,st.cy]=at;break}}ot.groupActionUpdateFlag=!ot.groupActionUpdateFlag,ot.updateElementOnRoofFlag=!0})},Ie=(Xe,ut)=>{Z(ft=>{for(const ot of ft.elements){if(Xe.has(ot.id)){const st=Xe.get(ot.id);st!==void 0&&(ot.type===z.Roof?ot.rise=st:ot.type===z.SolarPanel?ot.cz=st:ot.lz=st)}if(ot.type===z.Wall&&ut.has(ot.id)){const st=ot,at=ut.get(st.id);at&&(st.leftTopPartialHeight=at.upperLeft,st.rightTopPartialHeight=at.upperRight,st.leftUnfilledHeight=at.lowerLeft,st.rightUnfilledHeight=at.lowerRight)}}ft.groupActionUpdateFlag=!ft.groupActionUpdateFlag,ft.updateElementOnRoofFlag=!0})},ye=Xe=>{Z(ut=>{for(const ft of ut.elements)if(Xe.has(ft.id)){const ot=Xe.get(ft.id);ot&&(ft.cx=ot[0],ft.cy=ot[1],ft.cz=ot[2],ft.rotation[2]=ot[3])}ut.groupActionUpdateFlag=!ut.groupActionUpdateFlag})},ce=()=>{const Xe=new Map;for(const ot of H.getState().elements)(md(ot)&&t.has(ot.id)||t.has(ot.parentId))&&Xe.set(ot.id,[ot.cx,ot.cy,ot.cz,ot.rotation[2]]);const ft={name:`${te==="Move"?"Move":"Rotate"} Foundation Group`,timestamp:Date.now(),oldPositionMap:new Map(D.current),newPositionMap:new Map(Xe),undo:()=>{ye(ft.oldPositionMap)},redo:()=>{ye(ft.newPositionMap)}};he(ft)},pe=()=>{const Xe=new Map,ut=new Map,ft=new Map;for(const st of H.getState().elements)if(md(st)&&D.current.has(st.id))Xe.set(st.id,[st.cx,st.cy,st.lx,st.ly]);else if(E.current.has(st.id)){const at=st;ut.set(st.id,[...at.leftPoint,...at.rightPoint])}else if(L.current.has(st.id))if(st.type===z.Window){const at=st;if(at.parentType!==z.Roof)continue;ft.set(at.id,[at.cx,at.cy])}else st.type===z.SolarPanel&&ft.set(st.id,[st.cx,st.cy]);const ot={name:"Resize Building XY",timestamp:Date.now(),oldFoundationDataMap:new Map(D.current),newFoundationDataMap:new Map(Xe),oldWallPointsMap:new Map(E.current),newWallPointsMap:new Map(ut),oldSkylightPosMap:new Map(L.current),newSkylightPosMap:new Map(ft),undo:()=>{ze(ot.oldFoundationDataMap,ot.oldWallPointsMap,ot.oldSkylightPosMap)},redo:()=>{ze(ot.newFoundationDataMap,ot.newWallPointsMap,ot.newSkylightPosMap)}};he(ot)},ve=()=>{const Xe=new Map,ut=new Map;for(const ot of H.getState().elements)if(W.current.has(ot.id)&&(ot.type===z.Roof?Xe.set(ot.id,ot.rise):ot.type===z.SolarPanel?Xe.set(ot.id,ot.cz):Xe.set(ot.id,ot.lz)),ot.type===z.Wall&&j.current.has(ot.id)){const st=ot;ut.set(st.id,{lowerLeft:st.leftUnfilledHeight,lowerRight:st.rightUnfilledHeight,upperLeft:st.leftTopPartialHeight,upperRight:st.rightTopPartialHeight})}const ft={name:"Resize Building Z",timestamp:Date.now(),oldElementHeightMap:new Map(W.current),newElementHeightMap:new Map(Xe),oldPartialWallHeightMap:new Map(j.current),newPartialWallHeightMap:new Map(ut),undo:()=>{Ie(ft.oldElementHeightMap,ft.oldPartialWallHeightMap)},redo:()=>{Ie(ft.newElementHeightMap,ft.newPartialWallHeightMap)}};he(ft)},Ae=Xe=>{Z(ut=>{ut.moveHandleType=Xe})},Te=Xe=>{const ut=new Xt(Xe.x,Xe.y),ft=w.current.clone();if(f){const ot=new Xt().subVectors(ut,ft),st=Math.max(1,ot.length()),at=Math.sqrt(Math.pow(st,2)/(Math.pow(d,2)+1)),Oe=at*d,Ze=new Xt(at*Math.sign(ot.x),Oe*Math.sign(ot.y)).normalize().multiplyScalar(st/2).add(ft);N(new ie(Ze.x,Ze.y)),He(at,Oe),Z(St=>{const Pt=new Map;for(const Rt of St.elements)if(md(Rt)&&(t.has(Rt.id)||e.has(Rt.id))){const Ut=x.current.get(Rt.id),Ht=S.current.get(Rt.id);if(Ut&&Ht){const At=Ht[0]*at,kt=Ht[1]*Oe;if(Rt.lx=At,Rt.ly=kt,Rt.parentId!==Zo){const gt=Pt.get(Rt.parentId);if(gt){const{pos:dt,rot:Ct}=gt,tt=new ie(Ut[0]*at+Ze.x,Ut[1]*Oe+Ze.y),Fe=tt.clone().sub(dt).applyEuler(new nn(0,0,-Ct));Rt.cx=Fe.x,Rt.cy=Fe.y,Pt.set(Rt.id,{pos:tt.clone(),rot:Rt.rotation[2]+Ct})}}else{const gt=Ut[0]*at+Ze.x,dt=Ut[1]*Oe+Ze.y;Rt.cx=gt,Rt.cy=dt,Pt.set(Rt.id,{pos:new ie(gt,dt),rot:Rt.rotation[2]})}for(const gt of St.elements)if(gt.foundationId===Rt.id)switch(gt.type){case z.Wall:{const dt=gt,Ct=C.current.get(dt.id);if(!Ct)continue;const[tt,Fe]=Ct,qe=[tt.x*At,tt.y*kt,Rt.lz],je=[Fe.x*At,Fe.y*kt,Rt.lz];dt.cx=(qe[0]+je[0])/2,dt.cy=(qe[1]+je[1])/2,dt.lx=Math.hypot(qe[0]-je[0]+(qe[1]-je[1])),dt.relativeAngle=Math.atan2(je[1]-qe[1],je[0]-qe[0]),dt.leftPoint=[...qe],dt.rightPoint=[...je];break}case z.SolarPanel:{const dt=gt,Ct=v.current.get(dt.id);if(!Ct)continue;const tt=dt.parentType,[Fe,qe,je]=dt.normal;tt===z.Foundation||tt===z.Roof||tt===z.Cuboid&&me.isEqual(je,1)?(dt.cx=Ct[0]*At,dt.cy=Ct[1]*kt):tt===z.Cuboid&&(me.isEqual(Fe,0)&&me.isEqual(qe,1)?(dt.cx=Ct[0]*At,dt.cy=kt/2):me.isEqual(Fe,0)&&me.isEqual(qe,-1)?(dt.cx=Ct[0]*At,dt.cy=-kt/2):me.isEqual(Fe,-1)&&me.isEqual(qe,0)?(dt.cx=-At/2,dt.cy=Ct[1]*kt):me.isEqual(Fe,1)&&me.isEqual(qe,0)&&(dt.cx=At/2,dt.cy=Ct[1]*kt));break}case z.Window:{const dt=gt;if(dt.parentType!==z.Roof)continue;const Ct=v.current.get(dt.id);if(!Ct)continue;dt.cx=Ct[0]*At,dt.cy=Ct[1]*kt;break}}}}})}else{const ot=ft.distanceTo(ut),st=Math.atan2(ut.x-ft.x,ut.y-ft.y)+F,at=Math.abs(ot*Math.sin(st)),Oe=Math.abs(ot*Math.cos(st)),Ze=new Xt().addVectors(ut,ft).multiplyScalar(.5);N(new ie(Ze.x,Ze.y)),He(at,Oe),Z(St=>{for(const Pt of St.elements)if(t.has(Pt.id))Pt.lx=at,Pt.ly=Oe,Pt.cx=Ze.x,Pt.cy=Ze.y;else if(Pt.foundationId&&t.has(Pt.foundationId))switch(Pt.type){case z.Wall:{const Rt=Pt,Ut=C.current.get(Rt.id);if(!Ut)continue;const[Ht,At]=Ut,kt=[Ht.x*at,Ht.y*Oe,0],gt=[At.x*at,At.y*Oe,0];Rt.cx=(kt[0]+gt[0])/2,Rt.cy=(kt[1]+gt[1])/2,Rt.lx=Math.hypot(kt[0]-gt[0],kt[1]-gt[1]),Rt.relativeAngle=Math.atan2(gt[1]-kt[1],gt[0]-kt[0]),Rt.leftPoint=[...kt],Rt.rightPoint=[...gt];break}case z.SolarPanel:{const Rt=Pt,Ut=v.current.get(Rt.id);if(!Ut)continue;const Ht=Rt.parentType,[At,kt,gt]=Rt.normal;Ht===z.Foundation||Ht===z.Roof||Ht===z.Cuboid&&me.isEqual(gt,1)?(Rt.cx=Ut[0]*at,Rt.cy=Ut[1]*Oe):Ht===z.Cuboid&&(me.isEqual(At,0)&&me.isEqual(kt,1)?(Rt.cx=Ut[0]*at,Rt.cy=Oe/2):me.isEqual(At,0)&&me.isEqual(kt,-1)?(Rt.cx=Ut[0]*at,Rt.cy=-Oe/2):me.isEqual(At,-1)&&me.isEqual(kt,0)?(Rt.cx=-at/2,Rt.cy=Ut[1]*Oe):me.isEqual(At,1)&&me.isEqual(kt,0)&&(Rt.cx=at/2,Rt.cy=Ut[1]*Oe));break}case z.Window:{const Rt=Pt;if(Rt.parentType!==z.Roof)continue;const Ut=v.current.get(Rt.id);if(!Ut)continue;Rt.cx=Ut[0]*at,Rt.cy=Ut[1]*Oe}}})}H.getState().updateElementOnRoofFn()},Me=Xe=>{if(Xe.z<.1)return;const ut=Xe.z;Q(ut),Z(ft=>{for(const ot of ft.elements)if(b.current.has(ot.id)){if(ot.type===z.Wall){ot.lz=ut*b.current.get(ot.id);const st=ot;if(st.fill===El.Partial){const at=P.current.get(st.id);at&&(st.leftTopPartialHeight=ut*at.upperLeft,st.rightTopPartialHeight=ut*at.upperRight,st.leftUnfilledHeight=ut*at.lowerLeft,st.rightUnfilledHeight=ut*at.lowerRight)}}else if(ot.type===z.Roof)ot.rise=ut*b.current.get(ot.id);else if(ot.type===z.Cuboid){const st=b.current.get(ot.id);if(st){const at=st*ut;ot.lz=at,ot.cz=at/2}}else if(ot.type===z.SolarPanel&&ot.parentType===z.Cuboid&&b.current.has(ot.parentId)){const st=b.current.get(ot.parentId);if(st){const at=st*ut;if(me.isEqual(ot.normal[2],1))ot.cz=at/2;else{const Oe=b.current.get(ot.id);Oe&&(ot.cz=Oe*at)}}}}ft.updateElementOnRoofFlag=!0})},Pe=Xe=>{const ut=new ie(k.x,k.y),ft=Math.atan2(ut.x-Xe.x,Xe.y-ut.y)+(te==="Rotate Upper"?0:Math.PI),ot=Math.abs(ft)>Math.PI?-la:0,st=ft+ot,at=new nn(0,0,st),Oe=A.current.size;Z(Ze=>{for(const St of Ze.elements){if(md(St)&&t.has(St.id)&&!e.has(St.id)){const Pt=T.current.get(St.id),Rt=Oe!==1?A.current.get(St.id):0;if(Pt&&Rt!==void 0){const Ut=Pt.clone().applyEuler(at);St.cx=ut.x+Ut.x,St.cy=ut.y+Ut.y,St.rotation=[0,0,Rt+st]}}if(St.type!==z.Cuboid&&t.has(St.parentId)){const Pt=Oe!==1?A.current.get(St.parentId):0;Pt!==void 0&&(St.rotation=[0,0,Pt+st])}}}),U(st)},Ee=(Xe,ut)=>{const ft=new Xt(k.x,k.y);w.current.set(Xe,ut).rotateAround(Sjo,F).add(ft),re("Resize XY"),x.current.clear(),S.current.clear(),C.current.clear(),D.current.clear(),E.current.clear(),v.current.clear(),L.current.clear();const[ot,st]=[O*2,_*2];for(const at of H.getState().elements)if(md(at)&&(t.has(at.id)||e.has(at.id))){const{pos:Oe}=me.getWorldDataById(at.id);x.current.set(at.id,[(Oe.x-k.x)/ot,(Oe.y-k.y)/st]),S.current.set(at.id,[at.lx/ot,at.ly/st]),D.current.set(at.id,[at.cx,at.cy,at.lx,at.ly])}else if(at.foundationId&&(t.has(at.foundationId)||e.has(at.foundationId))){const Oe=ge(at.foundationId);if(!Oe)continue;switch(at.type){case z.Wall:{const Ze=at,St=new Xt(Ze.leftPoint[0]/Oe.lx,Ze.leftPoint[1]/Oe.ly),Pt=new Xt(Ze.rightPoint[0]/Oe.lx,Ze.rightPoint[1]/Oe.ly);C.current.set(Ze.id,[St,Pt]),E.current.set(Ze.id,[...Ze.leftPoint,...Ze.rightPoint]);break}case z.SolarPanel:case z.Window:{const Ze=at;v.current.set(Ze.id,[Ze.cx/Oe.lx,Ze.cy/Oe.ly]),L.current.set(Ze.id,[Ze.cx,Ze.cy]);break}}}},Be=(Xe,ut,ft)=>{const{x:ot,y:st}=de();g.current.set(Xe,ut,ft),y.current.set(-Gt,0,-Math.atan2(ot,st)-F,"ZXY"),re("Resize Z"),b.current.clear(),W.current.clear(),P.current.clear(),j.current.clear();for(const at of H.getState().elements)if(at.foundationId&&(t.has(at.foundationId)||e.has(at.parentId))){if(at.type===z.Wall){b.current.set(at.id,at.lz/$),W.current.set(at.id,at.lz);const Oe=at;Oe.fill===El.Partial&&(j.current.set(Oe.id,{upperLeft:Oe.leftTopPartialHeight,upperRight:Oe.rightTopPartialHeight,lowerLeft:Oe.leftUnfilledHeight,lowerRight:Oe.rightUnfilledHeight}),P.current.set(Oe.id,{upperLeft:Oe.leftTopPartialHeight/$,upperRight:Oe.rightTopPartialHeight/$,lowerLeft:Oe.leftUnfilledHeight/$,lowerRight:Oe.rightUnfilledHeight/$}))}else if(at.type===z.Roof)b.current.set(at.id,at.rise/$),W.current.set(at.id,at.rise);else if(at.type===z.SolarPanel&&at.parentType===z.Cuboid){const Oe=H.getState().elements.find(Ze=>Ze.id===at.parentId);Oe&&(b.current.set(at.id,at.cz/Oe.lz),W.current.set(at.id,at.cz))}}else(t.has(at.id)||e.has(at.id))&&(b.current.set(at.id,at.lz/$),W.current.set(at.id,at.lz))},Je=Xe=>{switch(Se(Xe),Xe.object.name){case vt.UpperLeft:{Ee(O,-_);break}case vt.UpperRight:{Ee(-O,-_);break}case vt.LowerLeft:{Ee(O,_);break}case vt.LowerRight:{Ee(-O,_);break}case vt.UpperLeftTop:{Be(-O,_,$);break}case vt.UpperRightTop:{Be(O,_,$);break}case vt.LowerLeftTop:{Be(-O,-_,$);break}case vt.LowerRightTop:{Be(O,-_,$);break}}},We=Xe=>{if(Se(Xe),re("Move"),Xe.intersections.length>0){const ut=Xe.intersections[0].point.clone().setZ(0);R.current.subVectors(k,ut);for(const ft of H.getState().elements)if(md(ft)&&t.has(ft.id)){const ot=new ie(ft.cx,ft.cy),st=new ie().subVectors(ot,ut);T.current.set(ft.id,st),D.current.set(ft.id,[ft.cx,ft.cy,ft.cz,ft.rotation[2]])}}},Ke=Xe=>{if(Se(Xe),Xe.object.name===Kr.Lower?re("Rotate Lower"):Xe.object.name===Kr.Upper&&re("Rotate Upper"),Xe.intersections.length>0){const ut=new ie(k.x,k.y);for(const ft of H.getState().elements){if(md(ft)&&t.has(ft.id)){const ot=new ie(ft.cx,ft.cy),st=new ie().subVectors(ot,ut);T.current.set(ft.id,st),A.current.set(ft.id,ft.rotation[2]),D.current.set(ft.id,[ft.cx,ft.cy,ft.cz,ft.rotation[2]])}t.has(ft.parentId)&&D.current.set(ft.id,[ft.cx,ft.cy,ft.cz,ft.rotation[2]])}}},Ne=()=>{switch(te){case"Move":case"Rotate Lower":case"Rotate Upper":ce();break;case"Resize XY":pe();break;case"Resize Z":ve();break}q(!1),Fn.getState().setEnableOrbitController(!0),M.current=!1,re("Null"),Ae(null),Z(Xe=>{Xe.groupActionUpdateFlag=!Xe.groupActionUpdateFlag,Xe.updateWallMapOnFoundationFlag=!Xe.updateWallMapOnFoundationFlag,Xe.updateElementOnRoofFlag=!0})},De=Xe=>{if(!p.current||!M.current)return;xe(Xe);const ut=se.intersectObjects([p.current]);if(ut.length>0){const ft=ut[0].point;switch(te){case"Resize XY":Te(ft);break;case"Resize Z":Me(ft);break;case"Rotate Lower":case"Rotate Upper":Pe(ft);break;case"Move":N(new ie().addVectors(ft.clone().setZ(0),R.current)),Z(ot=>{for(const st of ot.elements)if(md(st)&&t.has(st.id)&&!e.has(st.id)){const at=T.current.get(st.id);at&&(st.cx=ft.x+at.x,st.cy=ft.y+at.y)}});break}}},ke=a5(),Ye=ke/2,it=$+Ye-ke/2,Ve=O+ke,yt=_+ke,ct=_+ke*4;return h.jsxs("group",{name:"Group Master",position:k,rotation:[0,0,F],children:[h.jsxs("group",{name:"Resize Handle Group",onPointerDown:Je,children:[h.jsx(k4,{args:[O,_,Ye,ke],handleType:vt.UpperRight}),h.jsx(k4,{args:[-O,_,Ye,ke],handleType:vt.UpperLeft}),h.jsx(k4,{args:[O,-_,Ye,ke],handleType:vt.LowerRight}),h.jsx(k4,{args:[-O,-_,Ye,ke],handleType:vt.LowerLeft}),!fe&&h.jsxs(h.Fragment,{children:[h.jsx(k4,{args:[O,_,it,ke],handleType:vt.UpperRightTop}),h.jsx(k4,{args:[-O,_,it,ke],handleType:vt.UpperLeftTop}),h.jsx(k4,{args:[O,-_,it,ke],handleType:vt.LowerRightTop}),h.jsx(k4,{args:[-O,-_,it,ke],handleType:vt.LowerLeftTop})]})]}),h.jsxs("group",{name:"Move Handle Group",onPointerDown:We,children:[h.jsx(d_,{args:[0,yt,Ye,ke],handleType:Ho.Upper}),h.jsx(d_,{args:[0,-yt,Ye,ke],handleType:Ho.Lower}),h.jsx(d_,{args:[Ve,0,Ye,ke],handleType:Ho.Right}),h.jsx(d_,{args:[-Ve,0,Ye,ke],handleType:Ho.Left})]}),h.jsxs("group",{name:"Rotate Handle Group",onPointerDown:Ke,children:[h.jsx(kFe,{args:[0,ct,Ye,ke],handleType:Kr.Upper}),h.jsx(kFe,{args:[0,-ct,Ye,ke],handleType:Kr.Lower})]}),le&&h.jsx(ua,{name:"Intersection Plane",ref:p,args:[Math.max(O*2.4,1e3),Math.max(O*2.4,1e3)],visible:!1,position:g.current,rotation:y.current,onPointerMove:De,onPointerUp:Ne}),h.jsx("group",{name:"Wireframe Group",position:[0,0,$/2],children:h.jsx(fw,{hx:O,hy:_,hz:$/2,lineColor:"white"})})]})}),Pjo=t=>t.parentId===Zo&&(t.type===z.Foundation||t.type===z.Cuboid),Cjo=be.memo(()=>{H(axt);const t=H(Dwt),e=d();if(e.length===0)return null;const{allBaseElements:n,allBaseElementsVerticesMap:o,cuboidParentIdMap:r}=f(),i=new Set(e.map(w=>w.id)),a=[...e];for(const w of e)w.enableGroupMaster&&p(w);const{position:l,dimension:s,rotation:c,childCuboidIdSet:u}=g();function d(){const w=new Set;for(const b of H.getState().elements)t.has(b.id)&&(b.parentId===Zo&&md(b)?w.add(b.id):b.foundationId&&w.add(b.foundationId));return w.size===0?[]:H.getState().elements.filter(b=>w.has(b.id))}function f(){const w=[],b=new Map,C=new Map;for(const P of H.getState().elements){if(Pjo(P)){const v=me.fetchFoundationVertexCoordinates(P);w.push(P),b.set(P.id,v)}P.type===z.Cuboid&&P.parentId!==Zo&&C.set(P.id,P.parentId)}return{allBaseElements:w,allBaseElementsVerticesMap:b,cuboidParentIdMap:C}}function p(w){for(const b of n)!i.has(b.id)&&me.areBasesOverlapped(w.id,b.id,o)&&(i.add(b.id),a.push(b),b.enableGroupMaster&&p(b))}function g(){const w=a.map(R=>me.fetchFoundationVertexCoordinates(R)).flat(),b=new Set,C=me.calculatePolygonBounds(w);let P=1,v=1;const T=new Map;for(const R of H.getState().elements)if(R.foundationId&&i.has(R.foundationId))if(R.type===z.Wall){const M=R;P=Math.max(P,M.lz),M.roofId&&(T.get(M.roofId)??0)H(vOe)?h.jsx(Cjo,{}):null),Hjo=be.memo(({showGallery:t,defaultSize:e=50,minWidth:n=25,maxWidth:o=75,children:r,wait:i=50,onChange:a})=>{const[l,s]=r,c=m.useRef(!1),u=p=>{const g=document.querySelector(".split-pane");g&&g.style.setProperty("--percentWidth",p+"%")},d=()=>{c.current=!0},f=m.useCallback(L2.throttle(p=>{if(!c.current)return;const g=Math.max(n,Math.min(o,p.clientX/window.innerWidth*100));u(g),a&&a(g)},i),[]);return m.useEffect(()=>{u(e)},[e]),m.useEffect(()=>{const p=()=>{c.current=!1};return window.addEventListener("pointerup",p),()=>window.removeEventListener("pointerup",p)},[]),m.useEffect(()=>{u(t?e:0)},[t,e]),h.jsxs("div",{className:"split-pane",onPointerMove:f,children:[h.jsx("div",{className:"left-child",children:l}),t&&h.jsx("div",{className:"sash",onPointerDown:d}),h.jsx("div",{className:"right-child",children:s})]})},(t,e)=>t.showGallery===e.showGallery&&t.onChange===e.onChange),Nle=72,LFe=be.memo(({viewOnly:t=!1})=>{const e=H(mp),n=ht(_8t),o=H(ma),r=H(fn),i=ht(_Be),a=H(Id)??!1,l=H(Nq)??GF,s=H(Pb),c=H(Qq),u=H(Age),d=H(ABe),f=H(hA),p=H(C4t)??"roadmap",g=ht(Bq),y=H(DH),w=H(wA),[b,C]=m.useState(!0),[P,v]=m.useState(50),[T,A]=m.useState(!1),x=m.useRef(null),S=Jt();m.useEffect(()=>{C(!1)},[]),m.useEffect(()=>{n&&A(TC.localeCompare(n)<0)},[n]),m.useEffect(()=>{r(j=>{var L;j.loggable=e&&e.uid?!((L=e.email)!=null&&L.endsWith("@intofuture.org")):!1,e&&(e.noLogging||!e.schoolID||e.schoolID==="UNKNOWN SCHOOL"||!e.classID||e.classID==="UNKNOWN CLASS")&&(j.loggable=!1)})},[e]),console.log("x");const R=e.uid&&new URLSearchParams(window.location.search).get("userid")===e.uid,M=j=>{Fn.setState(L=>{if(!x.current)return L;const k=L.pointer;return k.x=j.clientX/x.current.clientWidth*2-1,k.y=-((j.clientY-Nle)/x.current.clientHeight)*2+1,{pointer:k}})},D=j=>{M(j)},E=()=>h.jsxs(f6t,{ref:x,shadows:!0,gl:{preserveDrawingBuffer:!0,logarithmicDepthBuffer:!0},frameloop:"demand",style:{height:"100%",width:"100%",backgroundColor:"black"},camera:{fov:tje,far:l,up:[0,0,1]},onPointerMove:D,children:[h.jsx(MAo,{}),h.jsx(O3o,{}),h.jsx(F3o,{}),h.jsx(gnn,{}),h.jsx(L3o,{}),h.jsxs(m.Suspense,{fallback:null,children:[h.jsx(hnn,{}),h.jsx(Rjo,{})]}),h.jsxs(m.Suspense,{fallback:null,children:[u&&h.jsx(qen,{}),h.jsx(Ken,{theme:d}),h.jsx(wnn,{}),f&&h.jsx(tGn,{})]}),h.jsx(Y3o,{}),h.jsx(cjo,{}),y===Vs.GENETIC_ALGORITHM&&w.geneticAlgorithmParams.problem===Pi.SOLAR_PANEL_TILT_ANGLE&&h.jsx(bAo,{}),y===Vs.GENETIC_ALGORITHM&&w.geneticAlgorithmParams.problem===Pi.SOLAR_PANEL_ARRAY&&h.jsx(TAo,{}),y===Vs.PARTICLE_SWARM_OPTIMIZATION&&w.particleSwarmOptimizationParams.problem===Pi.SOLAR_PANEL_TILT_ANGLE&&h.jsx(CAo,{}),y===Vs.PARTICLE_SWARM_OPTIMIZATION&&w.particleSwarmOptimizationParams.problem===Pi.SOLAR_PANEL_ARRAY&&h.jsx(HAo,{})]}),W=m.useMemo(()=>new Xt,[]);return h.jsxs("div",{className:"App",style:{position:"relative",overflow:"hidden"},onContextMenu:j=>j.preventDefault(),children:[h.jsx(unn,{initializing:b}),h.jsxs("div",{style:{backgroundColor:"lightblue",height:Nle+"px",paddingTop:"10px",textAlign:"start",userSelect:"none",fontSize:"30px"},children:[h.jsx(QGe,{offset:["10px","0px"],count:T?h.jsx(Cnn,{style:{color:"red",cursor:"pointer"},title:Y.t("message.NewVersionAvailable",S)}):void 0,children:h.jsx(en,{style:{marginLeft:"120px",verticalAlign:"middle",cursor:"pointer",userSelect:"none",fontSize:"30px"},title:Y.t("tooltip.visitAladdinHomePage",S),onClick:CQt,children:`${Y.t("name.Aladdin",S)}`})}),s&&!g&&h.jsxs("span",{style:{marginLeft:"20px",fontSize:"14px",verticalAlign:"center",userSelect:"text",color:R?"black":"gray"},children:[h.jsx("img",{title:Y.t("toolbar.CloudFile",S),alt:"Cloud",src:B3o,height:32,width:32,style:{paddingRight:"8px"}}),s+(R&&i?" *":""),!t&&R&&i&&h.jsx(lo,{type:"primary",size:"small",style:{marginLeft:"10px"},title:Y.t("menu.file.SaveCloudFile",S),onClick:()=>{ht.getState().setSaveCloudFileFlag(!0),o&&r(j=>{j.actionInfo={name:"Save Cloud File",timestamp:new Date().getTime()}})},children:`${Y.t("word.Save",S)}`})]})]}),t?h.jsxs("div",{style:{position:"absolute",bottom:"6px",left:"6px",zIndex:999,fontSize:"8px",userSelect:"none",color:f||c?p!=="roadmap"?"antiquewhite":"darkslategrey":"antiquewhite"},children:[h.jsx("img",{alt:"IFI Logo",src:KTe,height:"30px",style:{verticalAlign:"bottom",cursor:"pointer"},title:Y.t("tooltip.gotoIFI",S),onClick:SSe})," V "+TC]}):h.jsxs(h.Fragment,{children:[h.jsx("img",{alt:"IFI Logo",src:KTe,height:c?"24px":"40px",style:{position:"absolute",cursor:"pointer",bottom:"6px",left:"6px",zIndex:999,userSelect:"none"},title:Y.t("tooltip.gotoIFI",S),onClick:SSe}),h.jsxs("div",{style:{position:"absolute",bottom:"4px",left:c?"24px":"44px",zIndex:999,fontSize:"10px",userSelect:"none",color:f?p!=="roadmap"?"antiquewhite":"darkslategrey":c?"darkslategrey":"antiquewhite"},children:["   ©",new Date().getFullYear()," ",`${Y.t("name.IFI",S)}`," ",Y.t("word.VersionInitial",S)+TC+". "+Y.t("word.AllRightsReserved",S)+". "]})]}),!t&&h.jsx(xAo,{size:16,round:!0,margin:"2px",style:{position:"absolute",right:"0",top:"80px"}}),h.jsx(YVn,{viewOnly:t,canvas:x.current}),h.jsx(pyo,{viewOnly:t,canvas:x.current}),h.jsx(qUo,{}),h.jsx(R1o,{children:h.jsxs("div",{style:{height:`calc(100vh - ${Nle}px)`},children:[h.jsxs(Hjo,{showGallery:c,defaultSize:c?50:0,onChange:j=>{v(Math.round(100-j));const L=Fn.getState().canvas;if(L){const{gl:k,camera:N}=L,F=(100-j)*window.innerWidth/100;k.getSize(W),k.setSize(F,W.y),N instanceof zu&&(N.aspect=F/W.y,N.updateProjectionMatrix(),np())}},children:[c?h.jsx(bjo,{canvas:x.current,relativeWidth:1-P*.01}):h.jsx(h.Fragment,{}),E()]}),h.jsx(j3o,{canvas:x.current})]})}),h.jsx(W3o,{visible:!a}),!t&&h.jsx($Vn,{}),!t&&o&&h.jsx(E3o,{})]})}),Mjo=be.memo(({viewOnly:t=!1})=>{const e=H(fn),n=H(qBe),o=H(Ige),r=H($Be),i=ht(KBe),a=ht(wwt),l=ht(vwt),s=H(Pb),c=ht(Awt),u=H(mp),d=H(s0),[f,p]=m.useState(!1),[g,y]=m.useState(!1),[w,b]=m.useState({left:0,top:0,bottom:0,right:0}),C=m.useRef(null),{t:P}=Vl(),v=m.useMemo(()=>({lng:d}),[d]);m.useEffect(()=>{a&&(T(),ht.getState().setCreateNewFileFlag(!1))},[a]),m.useEffect(()=>{l&&(A(),ht.getState().setOpenLocalFileFlag(!1))},[l]);const T=()=>{Oi.confirm({title:`${P("message.DoYouWantToSaveChanges",v)}`,icon:h.jsx(ny,{}),okText:`${P("word.Yes",v)}`,cancelText:`${P("word.No",v)}`,onOk:()=>{u.uid?s?(e(W=>{W.localContentToImportAfterCloudFileUpdate="CREATE_NEW_FILE"}),ht.getState().setSaveCloudFileFlag(!0)):e(W=>{W.showCloudFileTitleDialogFlag=!W.showCloudFileTitleDialogFlag,W.showCloudFileTitleDialog=!0}):hn(P("menu.file.ToSaveYourWorkPleaseSignIn",v))},onCancel:()=>{r()}})},A=()=>{!t&&ht.getState().changed?Oi.confirm({title:P("message.DoYouWantToSaveChanges",v),icon:h.jsx(ny,{}),onOk:()=>{u.uid?s?x(!0):e(W=>{W.showCloudFileTitleDialogFlag=!W.showCloudFileTitleDialogFlag,W.showCloudFileTitleDialog=!0}):hn(P("menu.file.ToSaveYourWorkPleaseSignIn",v))},onCancel:()=>x(!1),okText:P("word.Yes",v),cancelText:P("word.No",v)}):x(!1)},x=W=>{document.body.onfocus=()=>{e(L=>{L.localFileDialogRequested=!1})};const j=document.getElementById("file-dialog");j.onchange=()=>{if(j.files&&j.files.length>0){ht.getState().set(N=>{N.waiting=!0});const L=new FileReader;L.readAsText(j.files[0]);const k=j.files[0].name;ht.getState().set(N=>{N.localFileName=k}),L.onload=()=>{if(L.result){const N=JSON.parse(L.result.toString());W?s&&(e(F=>{F.localContentToImportAfterCloudFileUpdate=N}),ht.getState().setSaveCloudFileFlag(!0)):o(N)}j.value=""}}},j.click()},S=()=>{let W=c.trim();if(W.length>0){W.endsWith(".ala")||(W+=".ala");const j=new Blob([JSON.stringify(n())],{type:"application/json"});return r$e.saveAs(j,W),ht.getState().set(L=>{L.localFileName=W}),e(L=>{L.cloudFile=void 0}),!0}else return po(P("menu.file.SavingAbortedMustHaveValidFileName",v)+"."),!1},R=(W,j)=>{if(C.current){const{clientWidth:L,clientHeight:k}=window.document.documentElement,N=C.current.getBoundingClientRect();b({left:-N.left+j.x,right:L-(N.right-j.x),top:-N.top+j.y,bottom:k-((N==null?void 0:N.bottom)-j.y)})}},M=()=>{p(!0),S()&&ht.getState().set(W=>{W.saveLocalFileDialogVisible=!1}),p(!1)},D=()=>{ht.getState().set(W=>{W.saveLocalFileDialogVisible=!1})},E=()=>{s&&ht.getState().set(W=>{W.localFileName=s,W.localFileName.endsWith(".ala")||(W.localFileName+=".ala")})};return h.jsx(h.Fragment,{children:h.jsx(Oi,{title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>y(!0),onMouseOut:()=>y(!1),children:P("menu.file.SaveAsLocalFile",v)}),footer:s?[h.jsx(lo,{onClick:E,children:P("menu.file.UseCloudFileName",v)},"Apply"),h.jsx(lo,{onClick:D,children:P("word.Cancel",v)},"Cancel"),h.jsx(lo,{type:"primary",onClick:M,disabled:!c,children:P("word.OK",v)},"OK")]:[h.jsx(lo,{onClick:D,children:P("word.Cancel",v)},"Cancel"),h.jsx(lo,{type:"primary",onClick:M,disabled:!c,children:P("word.OK",v)},"OK")],open:i,confirmLoading:f,onCancel:D,modalRender:W=>h.jsx(_i,{disabled:!g,bounds:w,onStart:(j,L)=>R(j,L),children:h.jsx("div",{ref:C,children:W})}),children:h.jsx(as,{placeholder:"File name",value:c,onPressEnter:M,onChange:W=>{ht.getState().set(j=>{j.localFileName=W.target.value})}})})})}),Ijo=()=>{const t=H(K8t),e=H(w=>w.world),n=H(w=>w.elements),o=H(w=>w.viewState),r=H(w=>w.notes),i=ht(Ss),a=ht(h3),l=ht(V8t),s=ht(G8t),c=H(L7t),u=H(W7t),d=H(U7t),f=H(J8t),p=new URLSearchParams(window.location.search),g=p.get("viewonly")==="true",y=p.get("map")==="true";return m.useEffect(()=>{c(),u(),d(),f(),ht.getState().set(w=>{w.openModelsMap=y,y&&(w.modelsMapFlag=!0,w.modelsMapWeatherStations=!1,w.leaderboardFlag=!0,w.showLeaderboard=!0)})},[]),m.useEffect(()=>{ht.getState().skipChange?s(!1):ht.getState().changed||l(!0)},[e,o,n,r]),m.useEffect(()=>{i&&ht.getState().set(w=>{w.showSolarRadiationHeatmap=!1}),a&&ht.getState().set(w=>{w.showHeatFluxes=!1})},[n]),h.jsx(fy,{locale:t,children:h.jsxs(Nen,{children:[g?h.jsx(LFe,{viewOnly:!0}):h.jsx(zjo,{children:h.jsx(LFe,{viewOnly:!1})}),h.jsx(Mjo,{viewOnly:g})]})})},zjo=be.memo(({children:t})=>(["iir3sv1kW1Vzbj9sOA46RfLWKCU2"].find(n=>n===H.getState().user.uid),h.jsx(jen,{onBeforeunload:()=>"",children:t}))),Djo=QLe(document.getElementById("root"));Djo.render(h.jsx(Ijo,{}))});export default Ejo(); +`,bjo=be.memo(({relativeWidth:t,canvas:e})=>{const n=H(fn),o=H(mp),r=H(Pb),i=H(jge),a=H(BYe),l=H(w7t),s=H(v7t),c=H(YYe),u=H(A7t),d=H(x7t),f=H(b7t),p=H(M7t),g=H(C7t),y=H(H7t),w=H(R7t),b=H(S7t),C=H(T7t),P=H(P7t),v=H(i$),T=H(n$),[A,x]=m.useState(),[S,R]=m.useState(),[M,D]=m.useState(!1),[E,W]=m.useState(!1),j=m.useRef(!1),L=m.useRef(u??null),k=m.useRef(!1),N=m.useRef(!1),F=m.useRef(d??d9.ALL),U=m.useRef(!1),O=m.useRef(l??[]),B=m.useRef(f??200),_=m.useRef(b??"rowWidth"),X=m.useRef(C??"rowWidth"),$=m.useRef(P??5),Q=m.useRef(!0),le=m.useRef(!0);m.useEffect(()=>{_.current=b??"rowWidth"},[b]),m.useEffect(()=>{X.current=C??"rowWidth"},[C]),m.useEffect(()=>{$.current=P??5},[P]),m.useEffect(()=>{B.current=f??200},[f]);const{t:q}=Vl(),te=Jt(),re=o.uid===a;m.useEffect(()=>{if(O.current=[],l){for(const rt of l)O.current.push(rt);const je=c;if(je){const rt=g?1:-1;O.current.sort((mt,Qe)=>je?je==="rowWidth"&&"rowsPerRack"in mt&&"rowsPerRack"in Qe?rt*(mt.rowsPerRack-Qe.rowsPerRack):je==="orientation"?rt*((mt[je]==="Landscape"?0:1)-(Qe[je]==="Landscape"?0:1)):je==="totalYearlyYield"&&"yearlyYield"in mt&&"yearlyYield"in Qe?rt*(mt.yearlyYield-Qe.yearlyYield):je==="meanYearlyYield"&&"yearlyYield"in mt&&"yearlyYield"in Qe?rt*(mt.yearlyYield/mt.panelCount-Qe.yearlyYield/Qe.panelCount):je==="totalYearlyCost"?rt*(me.calculateCost(mt)-me.calculateCost(Qe)):je==="yearlyProfit"?rt*(me.calculateProfit(mt)-me.calculateProfit(Qe)):je in mt&&je in Qe?rt*(mt[je]-Qe[je]):0:0)}D(!M)}},[l,g,c]),m.useEffect(()=>{if(x(void 0),l){for(const je of l)if(je.title===r){x(je);break}}},[r,l]),m.useEffect(()=>{const je=()=>{D(!M)};return window.addEventListener("resize",je),()=>{window.removeEventListener("resize",je)}},[M]);const ae=()=>{n(je=>{je.projectView=!1,je.projectState.title=null,je.projectState.description=null,je.projectState.owner=null,je.projectImages.clear()}),x(void 0),ht.getState().set(je=>{je.projectImagesUpdateFlag=!je.projectImagesUpdateFlag})},se=()=>{ht.getState().set(je=>{je.curateDesignToProjectFlag=!0})},ne=()=>{o.uid&&i&&A&&SVn(o.uid,i,A).then(()=>{n(je=>{if(je.projectState.designs){let rt=-1;for(const[mt,Qe]of je.projectState.designs.entries())if(Qe.title===A.title){rt=mt;break}rt>=0&&je.projectState.designs.splice(rt,1)}})})},fe=window.innerHeight,ge=Math.round(800/B.current),de=48/ge,Z=Math.round(t*window.innerWidth/ge-de),[he,xe,He,Se,ze,Ie]=m.useMemo(()=>[pd.getVariables(s,p??[]),pd.getTitles(s,te,p??[]),pd.getUnits(s,te,p??[]),pd.getDigits(s,p??[]),pd.getTickIntegers(s,p??[]),pd.getTypes(s,p??[])],[s,p,E,te]),ye=m.useMemo(()=>{const je=[];if(l&&s===Pi.SOLAR_PANEL_ARRAY)for(const rt of l){const mt={};if(p!=null&&p.includes("rowWidth")||(mt.rowWidth=rt.rowsPerRack),p!=null&&p.includes("tiltAngle")||(mt.tiltAngle=me.toDegrees(rt.tiltAngle)),p!=null&&p.includes("interRowSpacing")||(mt.interRowSpacing=rt.interRowSpacing),p!=null&&p.includes("latitude")||(mt.latitude=rt.latitude??42),p!=null&&p.includes("orientation")||(mt.orientation=rt.orientation===vr.landscape?0:1),p!=null&&p.includes("poleHeight")||(mt.poleHeight=rt.poleHeight),p!=null&&p.includes("unitCost")||(mt.unitCost=rt.unitCost),p!=null&&p.includes("sellingPrice")||(mt.sellingPrice=rt.sellingPrice),p!=null&&p.includes("")||(mt.totalYearlyCost=me.calculateCost(rt)),p!=null&&p.includes("totalYearlyYield")||(mt.totalYearlyYield=rt.yearlyYield*.001),p!=null&&p.includes("meanYearlyYield")||(mt.meanYearlyYield=rt.yearlyYield/rt.panelCount),p!=null&&p.includes("yearlyProfit")||(mt.yearlyProfit=me.calculateProfit(rt)),mt.group=d===d9.INDIVIDUALS?rt.title:"default",mt.selected=A===rt,mt.hovered=S===rt,mt.invisible=rt.invisible,mt.excluded=!1,w){for(const Qe of w)if(Qe.type===BL.Between&&Qe.upperBound!==void 0&&Qe.lowerBound!==void 0){const Tt=mt[Qe.variable];if(typeof Tt=="number"&&(Tt>Qe.upperBound||Tt{n(je=>{if(je.projectState.designs)for(const[rt,mt]of je.projectState.designs.entries())mt.excluded=ye[rt].excluded})},[ye]);const ce=(je,rt)=>{let mt=rt;if(y){for(const Qe of y)if(Qe.variable===je){mt=Qe.minimum??rt;break}}return mt},pe=(je,rt)=>{let mt=rt;if(y){for(const Qe of y)if(Qe.variable===je){mt=Qe.maximum??rt;break}}return mt},ve=m.useMemo(()=>{if(s===Pi.SOLAR_PANEL_ARRAY&&v){const je=[];return p!=null&&p.includes("rowWidth")||je.push(ce("rowWidth",v.minimumRowsPerRack)),p!=null&&p.includes("tiltAngle")||je.push(ce("tiltAngle",me.toDegrees(v.minimumTiltAngle))),p!=null&&p.includes("interRowSpacing")||je.push(ce("interRowSpacing",v.minimumInterRowSpacing)),p!=null&&p.includes("latitude")||je.push(ce("latitude",-90)),p!=null&&p.includes("orientation")||je.push(0),p!=null&&p.includes("poleHeight")||je.push(ce("poleHeight",0)),p!=null&&p.includes("unitCost")||je.push(ce("unitCost",.1)),p!=null&&p.includes("sellingPrice")||je.push(ce("sellingPrice",.1)),p!=null&&p.includes("totalYearlyCost")||je.push(ce("totalYearlyCost",0)),p!=null&&p.includes("totalYearlyYield")||je.push(ce("totalYearlyYield",0)),p!=null&&p.includes("meanYearlyYield")||je.push(ce("meanYearlyYield",0)),p!=null&&p.includes("yearlyProfit")||je.push(ce("yearlyProfit",-10)),je}return[]},[v,s,y,p,E]),Ae=m.useMemo(()=>{if(s===Pi.SOLAR_PANEL_ARRAY&&v){const je=[];return p!=null&&p.includes("rowWidth")||je.push(pe("rowWidth",v.maximumRowsPerRack)),p!=null&&p.includes("tiltAngle")||je.push(pe("tiltAngle",me.toDegrees(v.maximumTiltAngle))),p!=null&&p.includes("interRowSpacing")||je.push(pe("interRowSpacing",v.maximumInterRowSpacing)),p!=null&&p.includes("latitude")||je.push(pe("latitude",90)),p!=null&&p.includes("orientation")||je.push(1),p!=null&&p.includes("poleHeight")||je.push(pe("poleHeight",5)),p!=null&&p.includes("unitCost")||je.push(pe("unitCost",1)),p!=null&&p.includes("sellingPrice")||je.push(pe("sellingPrice",.5)),p!=null&&p.includes("totalYearlyCost")||je.push(pe("totalYearlyCost",100)),p!=null&&p.includes("totalYearlyYield")||je.push(pe("totalYearlyYield",100)),p!=null&&p.includes("meanYearlyYield")||je.push(pe("meanYearlyYield",1e3)),p!=null&&p.includes("yearlyProfit")||je.push(pe("yearlyProfit",10)),je}return[]},[v,s,y,p,E]),Te=(je,rt)=>{let mt=rt;if(w){for(const Qe of w)if(Qe.variable===je){mt=Qe.lowerBound??rt;break}}return mt},Me=(je,rt)=>{let mt=rt;if(w){for(const Qe of w)if(Qe.variable===je){mt=Qe.upperBound??rt;break}}return mt},Pe=(je,rt,mt)=>({variable:je,type:BL.Between,upperBound:Me(je,rt),lowerBound:Te(je,mt)}),Ee=m.useMemo(()=>{const je=[];return p!=null&&p.includes("rowWidth")||je.push(Pe("rowWidth",v.maximumRowsPerRack,v.minimumRowsPerRack)),p!=null&&p.includes("tiltAngle")||je.push(Pe("tiltAngle",me.toDegrees(v.maximumTiltAngle),me.toDegrees(v.minimumTiltAngle))),p!=null&&p.includes("interRowSpacing")||je.push(Pe("interRowSpacing",v.maximumInterRowSpacing,v.minimumInterRowSpacing)),p!=null&&p.includes("latitude")||je.push(Pe("latitude",90,-90)),p!=null&&p.includes("orientation")||je.push(Pe("orientation",1,0)),p!=null&&p.includes("poleHeight")||je.push(Pe("poleHeight",5,0)),p!=null&&p.includes("unitCost")||je.push(Pe("unitCost",1,.1)),p!=null&&p.includes("sellingPrice")||je.push(Pe("sellingPrice",.5,.1)),p!=null&&p.includes("totalYearlyCost")||je.push(Pe("totalYearlyCost",100,0)),p!=null&&p.includes("totalYearlyYield")||je.push(Pe("totalYearlyYield",100,0)),p!=null&&p.includes("meanYearlyYield")||je.push(Pe("meanYearlyYield",1e3,0)),p!=null&&p.includes("yearlyProfit")||je.push(Pe("yearlyProfit",10,-10)),je},[E,w,p]),Be=m.useMemo(()=>{if(s===Pi.SOLAR_PANEL_ARRAY&&v){const je=[];return p!=null&&p.includes("rowWidth")||je.push(1),p!=null&&p.includes("tiltAngle")||je.push(.1),p!=null&&p.includes("interRowSpacing")||je.push(.1),p!=null&&p.includes("latitude")||je.push(.1),p!=null&&p.includes("orientation")||je.push(1),p!=null&&p.includes("poleHeight")||je.push(.1),p!=null&&p.includes("unitCost")||je.push(.01),p!=null&&p.includes("sellingPrice")||je.push(.01),p!=null&&p.includes("totalYearlyCost")||je.push(.1),p!=null&&p.includes("totalYearlyYield")||je.push(1),p!=null&&p.includes("meanYearlyYield")||je.push(1),p!=null&&p.includes("yearlyProfit")||je.push(.1),je}return[]},[s,p,E]),Je=m.useRef(!(p!=null&&p.includes("rowWidth"))),We=m.useRef(!(p!=null&&p.includes("tiltAngle"))),Ke=m.useRef(!(p!=null&&p.includes("interRowSpacing"))),Ne=m.useRef(!(p!=null&&p.includes("latitude"))),De=m.useRef(!(p!=null&&p.includes("orientation"))),ke=m.useRef(!(p!=null&&p.includes("poleHeight"))),Ye=m.useRef(!(p!=null&&p.includes("unitCost"))),it=m.useRef(!(p!=null&&p.includes("sellingPrice"))),Ve=m.useRef(!(p!=null&&p.includes("totalYearlyCost"))),yt=m.useRef(!(p!=null&&p.includes("totalYearlyYield"))),ct=m.useRef(!(p!=null&&p.includes("meanYearlyYield"))),Xe=m.useRef(!(p!=null&&p.includes("yearlyProfit")));m.useEffect(()=>{Je.current=!(p!=null&&p.includes("rowWidth")),We.current=!(p!=null&&p.includes("tiltAngle")),Ke.current=!(p!=null&&p.includes("interRowSpacing")),Ne.current=!(p!=null&&p.includes("latitude")),De.current=!(p!=null&&p.includes("orientation")),ke.current=!(p!=null&&p.includes("poleHeight")),Ye.current=!(p!=null&&p.includes("unitCost")),it.current=!(p!=null&&p.includes("sellingPrice")),Ve.current=!(p!=null&&p.includes("totalYearlyCost")),yt.current=!(p!=null&&p.includes("totalYearlyYield")),ct.current=!(p!=null&&p.includes("meanYearlyYield")),Xe.current=!(p!=null&&p.includes("yearlyProfit")),D(!M)},[p]),m.useEffect(()=>{L.current=u},[u]);const ut=je=>{l&&(je>=0&&je{n(rt=>{if(rt.projectState.designs){for(const mt of rt.projectState.designs)if(mt.title===je){mt.invisible=!mt.invisible;break}}})},ot=je=>{ft(je.title),re&&o.uid&&i&&FVn(o.uid,i,je)},st=(je,rt)=>{n(mt=>{mt.projectState.hiddenParameters&&(je?mt.projectState.hiddenParameters.includes(rt)&&mt.projectState.hiddenParameters.splice(mt.projectState.hiddenParameters.indexOf(rt),1):mt.projectState.hiddenParameters.includes(rt)||mt.projectState.hiddenParameters.push(rt))})},at=(je,rt)=>{U.current=!0,re?o.uid&&i&&TVn(o.uid,i,rt,!je).then(()=>{st(je,rt)}):st(je,rt)},Oe=()=>{n(je=>{je.projectState.dataColoring=F.current}),ht.getState().set(je=>{je.updateProjectsFlag=!0}),D(!M)},Ze=je=>{F.current=je,re?o.uid&&i&&CVn(o.uid,i,F.current).then(()=>{Oe()}):Oe()},St=()=>h.jsxs("div",{children:[h.jsx(Li,{style:{width:"100%"},onChange:je=>{Je.current=je.target.checked,at(Je.current,"rowWidth"),W(!E)},checked:Je.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayRowWidth",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{We.current=je.target.checked,at(We.current,"tiltAngle"),W(!E)},checked:We.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayTiltAngle",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{Ke.current=je.target.checked,at(Ke.current,"interRowSpacing"),W(!E)},checked:Ke.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayRowSpacing",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{Ne.current=je.target.checked,at(Ne.current,"latitude"),W(!E)},checked:Ne.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("word.Latitude",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{De.current=je.target.checked,at(De.current,"orientation"),W(!E)},checked:De.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayOrientation",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{ke.current=je.target.checked,at(ke.current,"poleHeight"),W(!E)},checked:ke.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayPoleHeight",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{Ye.current=je.target.checked,at(Ye.current,"unitCost"),W(!E)},checked:Ye.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("economicsPanel.UnitCost",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{it.current=je.target.checked,at(it.current,"sellingPrice"),W(!E)},checked:it.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("economicsPanel.SellingPrice",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{Ve.current=je.target.checked,at(Ve.current,"totalYearlyCost"),W(!E)},checked:Ve.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayTotalYearlyCost",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{yt.current=je.target.checked,at(yt.current,"totalYearlyYield"),W(!E)},checked:yt.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayTotalYearlyYield",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{ct.current=je.target.checked,at(ct.current,"meanYearlyYield"),W(!E)},checked:ct.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayMeanYearlyYield",te)})}),h.jsx("br",{}),h.jsx(Li,{style:{width:"100%"},onChange:je=>{Xe.current=je.target.checked,at(Xe.current,"yearlyProfit"),W(!E)},checked:Xe.current,children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayYearlyProfit",te)})})]}),Pt=()=>h.jsxs(h.Fragment,{children:[h.jsx(Oh,{value:"rowWidth",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayRowWidth",te)})},"rowWidth"),h.jsx(Oh,{value:"tiltAngle",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayTiltAngle",te)})},"tiltAngle"),h.jsx(Oh,{value:"interRowSpacing",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayRowSpacing",te)})},"interRowSpacing"),h.jsx(Oh,{value:"latitude",children:h.jsx("span",{style:{fontSize:"12px"},children:q("word.Latitude",te)})},"latitude"),h.jsx(Oh,{value:"orientation",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayOrientation",te)})},"orientation"),h.jsx(Oh,{value:"poleHeight",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayPoleHeight",te)})},"poleHeight"),h.jsx(Oh,{value:"unitCost",children:h.jsx("span",{style:{fontSize:"12px"},children:q("economicsPanel.UnitCost",te)})},"unitCost"),h.jsx(Oh,{value:"sellingPrice",children:h.jsx("span",{style:{fontSize:"12px"},children:q("economicsPanel.SellingPrice",te)})},"sellingPrice"),h.jsx(Oh,{value:"totalYearlyCost",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayTotalYearlyCost",te)})},"totalYearlyCost"),h.jsx(Oh,{value:"totalYearlyYield",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayTotalYearlyYield",te)})},"totalYearlyYield"),h.jsx(Oh,{value:"meanYearlyYield",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayMeanYearlyYield",te)})},"meanYearlyYield"),h.jsx(Oh,{value:"yearlyProfit",children:h.jsx("span",{style:{fontSize:"12px"},children:q("polygonMenu.SolarPanelArrayYearlyProfit",te)})},"yearlyProfit")]}),Rt=m.useMemo(()=>{const je=[];if(l&&s===Pi.SOLAR_PANEL_ARRAY)for(const rt of l){if(rt.invisible||rt===A)continue;const mt={};pd.setScatterData(_.current,"x",mt,rt),pd.setScatterData(X.current,"y",mt,rt),je.push(mt)}return je},[_.current,X.current,l,s,A]),Ut=m.useMemo(()=>{const je=[];if(l&&s===Pi.SOLAR_PANEL_ARRAY)for(const rt of l){if(rt!==A)continue;const mt={};pd.setScatterData(_.current,"x",mt,rt),pd.setScatterData(X.current,"y",mt,rt),je.push(mt)}return je},[_.current,X.current,l,s,A]),Ht=je=>{const rt={min:0,max:1};if(s===Pi.SOLAR_PANEL_ARRAY&&v)switch(je){case"rowWidth":rt.min=ce("rowWidth",v.minimumRowsPerRack),rt.max=pe("rowWidth",v.maximumRowsPerRack);break;case"tiltAngle":rt.min=ce("tiltAngle",me.toDegrees(v.minimumTiltAngle)),rt.max=pe("tiltAngle",me.toDegrees(v.maximumTiltAngle));break;case"interRowSpacing":rt.min=ce("interRowSpacing",v.minimumInterRowSpacing),rt.max=pe("interRowSpacing",v.maximumInterRowSpacing);break;case"latitude":rt.min=ce("latitude",-90),rt.max=pe("latitude",90);break;case"orientation":rt.min=0,rt.max=1;break;case"poleHeight":rt.min=ce("poleHeight",0),rt.max=pe("poleHeight",5);break;case"unitCost":rt.min=ce("unitCost",.1),rt.max=pe("unitCost",1);break;case"sellingPrice":rt.min=ce("sellingPrice",.1),rt.max=pe("sellingPrice",.5);break;case"totalYearlyCost":rt.min=ce("totalYearlyCost",0),rt.max=pe("totalYearlyCost",100);break;case"totalYearlyYield":rt.min=ce("totalYearlyYield",0),rt.max=pe("totalYearlyYield",100);break;case"meanYearlyYield":rt.min=ce("meanYearlyYield",0),rt.max=pe("meanYearlyYield",1e3);break;case"yearlyProfit":rt.min=ce("yearlyProfit",-10),rt.max=pe("yearlyProfit",10);break}return rt},At=m.useMemo(()=>Ht(_.current),[_.current,y]),kt=m.useMemo(()=>Ht(X.current),[X.current,y]),gt=m.useMemo(()=>pd.getUnit(_.current,te),[_.current,te]),dt=m.useMemo(()=>pd.getUnit(X.current,te),[X.current,te]),Ct=()=>h.jsxs("div",{style:{width:"280px"},children:[h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{span:8,style:{paddingTop:"5px"},children:h.jsxs("span",{style:{fontSize:"12px"},children:[q("projectPanel.SelectXAxis",te),": "]})}),h.jsx(nt,{span:16,children:h.jsx(_o,{style:{width:"100%"},value:_.current,onChange:je=>{_.current=je,re&&o.uid&&i&&HVn(o.uid,i,je).then(()=>{}),D(!M)},children:Pt()})})]}),h.jsxs(on,{gutter:6,style:{paddingBottom:"8px"},children:[h.jsx(nt,{span:8,style:{paddingTop:"5px"},children:h.jsxs("span",{style:{fontSize:"12px"},children:[q("projectPanel.SelectYAxis",te),": "]})}),h.jsx(nt,{span:16,children:h.jsx(_o,{style:{width:"100%"},value:X.current,onChange:je=>{X.current=je,re&&o.uid&&i&&MVn(o.uid,i,je).then(()=>{}),D(!M)},children:Pt()})})]}),h.jsx(on,{style:{paddingBottom:"8px"},children:h.jsxs("div",{children:[h.jsxs(UEo,{id:"scatter-chart",width:280,height:240,margin:{top:0,right:0,bottom:-10,left:-10},children:[h.jsx(bw,{strokeWidth:"1",stroke:"gray",horizontal:Q.current,vertical:le.current}),h.jsx(l1,{dataKey:"x",fontSize:10,type:"number",domain:[At.min,At.max],name:"x",unit:gt,strokeWidth:1,stroke:"gray",tickFormatter:(je,rt)=>_.current==="yearlyProfit"||_.current==="unitCost"||_.current==="sellingPrice"?"$"+je:je}),h.jsx(vh,{dataKey:"y",fontSize:10,type:"number",domain:[kt.min,kt.max],name:"y",unit:dt,strokeWidth:1,stroke:"gray",tickFormatter:(je,rt)=>X.current==="yearlyProfit"||X.current==="unitCost"||X.current==="sellingPrice"?"$"+je:je}),h.jsx(rh,{cursor:{strokeDasharray:"3 3"},formatter:je=>je.toFixed(2)}),h.jsx(gb,{name:"All",data:Rt,fill:"#8884d8",shape:h.jsx(hU,{fill:"#8884d8",r:$.current})}),A&&h.jsx(gb,{name:"Selected",data:Ut,fill:"red",shape:"star"})]}),h.jsx(pjo,{symbolSize:$.current,horizontalGrid:Q.current,verticalGrid:le.current,changeHorizontalGrid:je=>{Q.current=je,D(!M)},changeVerticalGrid:je=>{le.current=je,D(!M)},changeSymbolSize:je=>{$.current=je,re&&o.uid&&i&&IVn(o.uid,i,je).then(()=>{}),D(!M)}})]})}),h.jsx(on,{children:h.jsx("span",{style:{width:"100%",textAlign:"center"},children:h.jsx(Vu,{style:{fontSize:"18px",color:"gray",paddingRight:"8px"},title:q("projectPanel.ScatterPlotScreenshot",te),onClick:()=>{const je=document.getElementById("scatter-chart");je&&ype.saveSvgAsPng(je,"scatter-chart-"+i+".png").then(()=>{hn(q("message.ScreenshotSaved",te))})}})})})]}),tt=()=>h.jsx("div",{children:h.jsxs(Ue.Group,{onChange:je=>{Ze(je.target.value)},value:d??d9.ALL,children:[h.jsx(Ue,{style:{fontSize:"12px",width:"100%"},value:d9.ALL,children:q("projectPanel.SameColorForAllDesigns",te)}),h.jsx("br",{}),h.jsx(Ue,{style:{fontSize:"12px",width:"100%"},value:d9.INDIVIDUALS,children:q("projectPanel.OneColorForEachDesign",te)})]})}),Fe=()=>h.jsx("div",{style:{width:"250px"},onClick:je=>je.stopPropagation(),children:h.jsxs(on,{gutter:6,style:{paddingBottom:"4px"},children:[h.jsx(nt,{span:14,style:{paddingTop:"5px"},children:h.jsxs("span",{style:{fontSize:"12px"},children:[q("projectPanel.ThumbnailImageSize",te),": "]})}),h.jsx(nt,{span:10,children:h.jsxs(_o,{style:{width:"100%"},value:B.current,onChange:je=>{B.current=je,re?o.uid&&i&&zVn(o.uid,i,je).then(()=>{n(rt=>{rt.projectState.thumbnailWidth=B.current})}):n(rt=>{rt.projectState.thumbnailWidth=B.current}),D(!M)},children:[h.jsx(Oh,{value:100,children:h.jsx("span",{style:{fontSize:"12px"},children:q("word.Small",te)})},"small-thumbnail"),h.jsx(Oh,{value:125,children:h.jsx("span",{style:{fontSize:"12px"},children:q("word.Medium",te)})},"medium-thumbnail"),h.jsx(Oh,{value:200,children:h.jsx("span",{style:{fontSize:"12px"},children:q("word.Large",te)})},"large-thumbnail")]})})]})}),qe=[{key:"1",label:h.jsxs(wjo,{children:[h.jsx("span",{children:q("projectPanel.ProjectDescription",te)+" | "+q("projectPanel.ProjectType",te)+": "+s}),h.jsxs("span",{children:[re&&h.jsxs(h.Fragment,{children:[N.current&&h.jsx(lo,{style:{border:"none",padding:"4px"},onClick:je=>{je.stopPropagation(),j.current=!j.current,D(!M)},children:j.current?h.jsx(Jnn,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.MakeDescriptionNonEditable",te)}):h.jsx(KKe,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.MakeDescriptionEditable",te)})}),h.jsx(lo,{style:{border:"none",padding:"4px"},onClick:je=>{je.stopPropagation(),se()},children:h.jsx(Znn,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.CurateCurrentDesign",te)})}),A&&A.title===r&&h.jsx(lo,{style:{border:"none",padding:"4px"},onClick:je=>{je.stopPropagation(),e&&o.uid&&i&&r&&kVn(o.uid,s,i,f??200,r,e).then(()=>{D(!M)})},children:h.jsx(Ynn,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.UpdateSelectedDesign",te)})}),A&&h.jsx(lo,{style:{border:"none",padding:"4px"},onClick:je=>{je.stopPropagation(),ne(),x(void 0)},children:h.jsx(lGt,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.RemoveSelectedDesign",te)})}),A&&h.jsx(lo,{style:{border:"none",padding:"4px"},onClick:je=>{if(je.stopPropagation(),i){let rt=t1+"?client=web&userid="+o.uid+"&project="+encodeURIComponent(i);A&&(rt+="&title="+encodeURIComponent(A.title)),navigator.clipboard.writeText(rt).then(()=>S2(q("projectListPanel.ProjectLinkGeneratedInClipBoard",te)+"."))}},children:h.jsx(ion,{style:{fontSize:"24px",color:"gray"},title:q("projectListPanel.GenerateProjectLink",te)})})]}),l&&l.length>1&&c&&h.jsx(lo,{style:{border:"none",padding:"4px"},onClick:je=>{je.stopPropagation(),n(rt=>{rt.projectState.sortDescending=!rt.projectState.sortDescending})},children:g?h.jsx(Son,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.ClickToFlipSortingOrder",te)}):h.jsx(Con,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.ClickToFlipSortingOrder",te)})}),h.jsx(Al,{title:h.jsx("div",{onClick:je=>je.stopPropagation(),children:q("projectPanel.ProjectSettings",te)}),content:Fe,children:h.jsx(lo,{style:{border:"none",padding:"4px"},onClick:je=>je.stopPropagation(),children:h.jsx(von,{style:{fontSize:"24px",color:"gray"}})})})]})]}),children:h.jsx(gjo,{title:j.current?void 0:q("projectPanel.DoubleClickToMakeDescriptionEditable",te),readOnly:!j.current,value:L.current??void 0,onDoubleClick:()=>{j.current=!j.current,D(!M)},onChange:je=>{L.current=je.target.value,k.current=!0,n(rt=>{rt.projectState.description=je.target.value}),D(!M)},onBlur:()=>{j.current=!1,k.current&&o.uid&&re&&i&&PVn(o.uid,i,L.current).then(()=>{k.current=!1,D(!M)})},style:{paddingLeft:"10px",textAlign:"left",resize:j.current?"vertical":"none",border:j.current?"1px solid gray":"none"}})}];return h.jsx(mjo,{onContextMenu:je=>{je.stopPropagation()},children:h.jsxs(yjo,{children:[h.jsxs(Ajo,{children:[h.jsx("span",{children:q(re?"projectPanel.Project":"projectPanel.ProjectByOtherPeople",te)+": "+i+(re?"":" ("+q("word.Owner",te)+": "+(a==null?void 0:a.substring(0,4))+"***)")+" ("+O.current.length+")"}),h.jsx("span",{style:{cursor:"pointer"},onMouseDown:()=>{ae()},onTouchStart:()=>{ae()},children:h.jsx(Lw,{title:q("word.Close",te)})})]}),h.jsx(aye,{items:qe,style:{backgroundColor:"white",border:"none"},onChange:je=>{N.current=je.length>0,D(!M)}}),O.current.length>0&&h.jsxs(xjo,{children:[h.jsx(mue,{style:{width:"100%",height:fe/2-(N.current?160:80),paddingLeft:"4px",paddingRight:"4px",overflowX:"hidden",overflowY:"auto"},grid:{column:ge,gutter:1},dataSource:O.current,renderItem:je=>{var Qe;const rt=je.title.lastIndexOf(" "),mt=f===100?8:f===125?12:30;return h.jsxs(mue.Item,{style:{marginBottom:"-28px"},onMouseOver:()=>{R(je)},onMouseLeave:()=>{R(void 0)},children:[h.jsx("img",{loading:"eager",width:Z+"px",height:"auto",onError:Tt=>{Tt.target.src=d_},onLoad:Tt=>{n(Dt=>{Dt.projectImages.set(je.title,Tt.target)}),ht.getState().set(Dt=>{Dt.projectImagesUpdateFlag=!Dt.projectImagesUpdateFlag})},alt:je.title,title:(je.timestamp?q("word.LastUpdate",te)+": "+yc(new Date(je.timestamp)).format("MM-DD-YYYY hh:mm A")+` +`:"")+q(A===je?"projectPanel.SingleClickToDeselectDoubleClickToOpen":"projectPanel.SingleClickToSelectDoubleClickToOpen",te),src:(Qe=je.thumbnail)!=null&&Qe.startsWith("data:image/png;base64")?je.thumbnail:d_,style:{transition:".5s ease",opacity:je.excluded?.25:S===je?.5:1,padding:"1px",cursor:"pointer",borderRadius:A===je?"0":"10px",border:A===je?"2px solid red":"none"},onDoubleClick:Tt=>{const Dt=Tt.target;Dt.src===d_&&(Dt.src=je.thumbnailUrl),x(je),a&&JX(a,je.title,!0,!0).then(()=>{})},onClick:Tt=>{const Dt=Tt.target;Dt.src===d_&&(Dt.src=je.thumbnailUrl),x(je!==A?je:void 0)}}),h.jsx("div",{style:{position:"relative",left:"10px",textAlign:"left",bottom:"18px",color:"white",fontSize:"8px",fontWeight:je.title===r?"bold":"normal"},children:je.title?je.title.length>mt?je.title.substring(0,Math.min(mt,rt))+"..."+je.title.substring(rt):je.title:"Unknown"}),h.jsxs("div",{style:{position:"relative",right:"10px",textAlign:"right",bottom:"36px",color:"white"},children:[je.title===r&&h.jsx(kKe,{style:{paddingRight:"4px",fontSize:"16px"}}),je.invisible?h.jsx(Unn,{onClick:()=>{ot(je)},style:{fontSize:"16px"},title:q("projectPanel.DesignNotShownInSolutionSpaceClickToShow",te)}):h.jsx(yme,{onClick:()=>{ot(je)},style:{fontSize:"16px"},title:q("projectPanel.DesignShownInSolutionSpaceClickToHide",te)})]})]})}}),h.jsxs(vjo,{children:[h.jsx("span",{style:{paddingLeft:"20px"},children:q("projectPanel.SolutionSpace",te)}),h.jsxs("span",{children:[s===Pi.SOLAR_PANEL_ARRAY&&h.jsx(Al,{title:q("projectPanel.ChooseSolutionSpace",te),onOpenChange:je=>{U.current&&(je||ht.getState().set(rt=>{rt.updateProjectsFlag=!0}),U.current=!1)},content:St(),children:h.jsx(lo,{style:{border:"none",paddingRight:0,background:"white"},children:h.jsx(Lnn,{style:{fontSize:"24px",color:"gray"}})})}),h.jsx(Al,{title:q("projectPanel.ChooseDataColoring",te),content:tt(),children:h.jsx(lo,{style:{border:"none",paddingRight:0,background:"white"},children:h.jsx(Mnn,{style:{fontSize:"24px",color:"gray"}})})}),h.jsx(Al,{title:q("projectPanel.GenerateScatterPlot",te),content:Ct(),children:h.jsx(lo,{style:{border:"none",paddingRight:0,background:"white"},children:h.jsx(xWt,{style:{fontSize:"24px",color:"gray"}})})}),h.jsx(lo,{style:{border:"none",paddingRight:"20px",background:"white"},onClick:()=>{const je=document.getElementById("design-space");je&&ype.saveSvgAsPng(je,"design-space-"+i+".png").then(()=>{hn(q("message.ScreenshotSaved",te))})},children:h.jsx(Vu,{style:{fontSize:"24px",color:"gray"},title:q("projectPanel.SolutionSpaceScreenshot",te)})})]})]}),h.jsx(hjo,{id:"design-space",width:t*window.innerWidth,height:fe/2-120,data:ye,types:Ie,minima:ve,maxima:Ae,filters:Ee,steps:Be,variables:he,titles:xe,units:He,digits:Se,tickIntegers:ze,hover:ut,hoveredIndex:l&&S?l.indexOf(S):-1,selectedIndex:l&&A?l.indexOf(A):-1})]})]})})}),Sjo=new Xt,k4=({args:t,handleType:e})=>{const[n,o,r,i]=t,[a,l]=m.useState(Da);return h.jsx(Qr,{name:e,args:[i,i,i],position:[n,o,r],onPointerOver:()=>l(ta),onPointerOut:()=>l(Da),children:h.jsx("meshStandardMaterial",{color:a})})},f_=({args:t,handleType:e})=>{const[n,o,r,i]=t,[a,l]=m.useState(Da);return h.jsx(ds,{name:e,args:[i],position:[n,o,r],onPointerOver:()=>l(ta),onPointerOut:()=>l(Da),children:h.jsx("meshStandardMaterial",{color:a})})},LFe=({args:t,handleType:e})=>{const[n,o,r,i]=t,[a,l]=m.useState(Da),s=m.useMemo(()=>h.jsx("meshStandardMaterial",{color:a}),[a]);return h.jsxs("group",{name:e,position:[n,o,r],rotation:[Gt,0,0],onPointerOver:()=>l(ta),onPointerOut:()=>l(Da),scale:i*4,children:[h.jsxs("group",{children:[h.jsx(mge,{args:[.15,.05,6,8,3/2*Math.PI],rotation:[Gt,0,Gt],children:s}),h.jsx(Rd,{args:[.1,.1,6],rotation:[Gt,0,0],position:[.15,0,.05],children:s}),h.jsx(lR,{args:[.05,6],rotation:[0,Gt,0],position:[0,0,.15],children:s})]}),h.jsx(ua,{name:e,args:[.35,.35],position:[0,.05,0],rotation:[-Gt,0,0],visible:!1})]})},Tjo=be.memo(({groupedElementsIdSet:t,childCuboidSet:e,initialPosition:n,initialDimension:o,initialRotation:r})=>{const[i,a,l]=n,[s,c,u]=o,d=s===0?1:c/s,f=t.size>1||e.size>0,p=m.useRef(null),g=m.useRef(new ie),y=m.useRef(new nn),w=m.useRef(new Xt),b=m.useRef(new Map),C=m.useRef(new Map),P=m.useRef(new Map),v=m.useRef(new Map),T=m.useRef(new Map),A=m.useRef(new Map),x=m.useRef(new Map),S=m.useRef(new Map),R=m.useRef(new ie),M=m.useRef(!1),D=m.useRef(new Map),E=m.useRef(new Map),W=m.useRef(new Map),j=m.useRef(new Map),L=m.useRef(new Map),[k,N]=m.useState(new ie(i,a,l)),[F,U]=m.useState(r),[O,B]=m.useState(s/2),[_,X]=m.useState(c/2),[$,Q]=m.useState(u),[le,q]=m.useState(!1),[te,re]=m.useState("Null"),{get:ae}=oi(),se=m.useMemo(()=>new l0,[]),ne=m.useMemo(()=>new Xt,[]),fe=H(Id),ge=H(Gn),de=H(Dge),Z=H(fn),he=H(En);m.useEffect(()=>{Q(u)},[u]),m.useEffect(()=>{N(new ie(i,a,l)),He(s,c),U(r)},[n,o,r]);const xe=Xe=>{ne.x=Xe.offsetX/ae().gl.domElement.clientWidth*2-1,ne.y=-(Xe.offsetY/ae().gl.domElement.clientHeight)*2+1,se.setFromCamera(ne,ae().camera)},He=(Xe,ut)=>{B(Xe/2),X(ut/2)},Se=Xe=>{q(!0),Fn.getState().setEnableOrbitController(!1),M.current=!0,g.current.set(0,0,0),y.current.set(0,0,0),Ae(Ho.Default),Xe.stopPropagation()},ze=(Xe,ut,ft)=>{Z(ot=>{for(const st of ot.elements)if(md(st)&&Xe.has(st.id))[st.cx,st.cy,st.lx,st.ly]=Xe.get(st.id);else if(st.foundationId&&Xe.has(st.foundationId))switch(st.type){case z.Wall:{const at=ut.get(st.id);if(!at)continue;const Oe=st,Ze=at.slice(0,3),St=at.slice(3);Oe.cx=(Ze[0]+St[0])/2,Oe.cy=(Ze[1]+St[1])/2,Oe.lx=Math.hypot(Ze[0]-St[0]+(Ze[1]-St[1])),Oe.relativeAngle=Math.atan2(St[1]-Ze[1],St[0]-Ze[0]),Oe.leftPoint=[...Ze],Oe.rightPoint=[...St];break}case z.Window:{const at=st;if(at.parentType!==z.Roof)continue;const Oe=ft.get(st.id);if(!Oe)continue;[at.cx,at.cy]=Oe;break}case z.SolarPanel:{const at=ft.get(st.id);if(!at)continue;[st.cx,st.cy]=at;break}}ot.groupActionUpdateFlag=!ot.groupActionUpdateFlag,ot.updateElementOnRoofFlag=!0})},Ie=(Xe,ut)=>{Z(ft=>{for(const ot of ft.elements){if(Xe.has(ot.id)){const st=Xe.get(ot.id);st!==void 0&&(ot.type===z.Roof?ot.rise=st:ot.type===z.SolarPanel?ot.cz=st:ot.lz=st)}if(ot.type===z.Wall&&ut.has(ot.id)){const st=ot,at=ut.get(st.id);at&&(st.leftTopPartialHeight=at.upperLeft,st.rightTopPartialHeight=at.upperRight,st.leftUnfilledHeight=at.lowerLeft,st.rightUnfilledHeight=at.lowerRight)}}ft.groupActionUpdateFlag=!ft.groupActionUpdateFlag,ft.updateElementOnRoofFlag=!0})},ye=Xe=>{Z(ut=>{for(const ft of ut.elements)if(Xe.has(ft.id)){const ot=Xe.get(ft.id);ot&&(ft.cx=ot[0],ft.cy=ot[1],ft.cz=ot[2],ft.rotation[2]=ot[3])}ut.groupActionUpdateFlag=!ut.groupActionUpdateFlag})},ce=()=>{const Xe=new Map;for(const ot of H.getState().elements)(md(ot)&&t.has(ot.id)||t.has(ot.parentId))&&Xe.set(ot.id,[ot.cx,ot.cy,ot.cz,ot.rotation[2]]);const ft={name:`${te==="Move"?"Move":"Rotate"} Foundation Group`,timestamp:Date.now(),oldPositionMap:new Map(D.current),newPositionMap:new Map(Xe),undo:()=>{ye(ft.oldPositionMap)},redo:()=>{ye(ft.newPositionMap)}};he(ft)},pe=()=>{const Xe=new Map,ut=new Map,ft=new Map;for(const st of H.getState().elements)if(md(st)&&D.current.has(st.id))Xe.set(st.id,[st.cx,st.cy,st.lx,st.ly]);else if(E.current.has(st.id)){const at=st;ut.set(st.id,[...at.leftPoint,...at.rightPoint])}else if(L.current.has(st.id))if(st.type===z.Window){const at=st;if(at.parentType!==z.Roof)continue;ft.set(at.id,[at.cx,at.cy])}else st.type===z.SolarPanel&&ft.set(st.id,[st.cx,st.cy]);const ot={name:"Resize Building XY",timestamp:Date.now(),oldFoundationDataMap:new Map(D.current),newFoundationDataMap:new Map(Xe),oldWallPointsMap:new Map(E.current),newWallPointsMap:new Map(ut),oldSkylightPosMap:new Map(L.current),newSkylightPosMap:new Map(ft),undo:()=>{ze(ot.oldFoundationDataMap,ot.oldWallPointsMap,ot.oldSkylightPosMap)},redo:()=>{ze(ot.newFoundationDataMap,ot.newWallPointsMap,ot.newSkylightPosMap)}};he(ot)},ve=()=>{const Xe=new Map,ut=new Map;for(const ot of H.getState().elements)if(W.current.has(ot.id)&&(ot.type===z.Roof?Xe.set(ot.id,ot.rise):ot.type===z.SolarPanel?Xe.set(ot.id,ot.cz):Xe.set(ot.id,ot.lz)),ot.type===z.Wall&&j.current.has(ot.id)){const st=ot;ut.set(st.id,{lowerLeft:st.leftUnfilledHeight,lowerRight:st.rightUnfilledHeight,upperLeft:st.leftTopPartialHeight,upperRight:st.rightTopPartialHeight})}const ft={name:"Resize Building Z",timestamp:Date.now(),oldElementHeightMap:new Map(W.current),newElementHeightMap:new Map(Xe),oldPartialWallHeightMap:new Map(j.current),newPartialWallHeightMap:new Map(ut),undo:()=>{Ie(ft.oldElementHeightMap,ft.oldPartialWallHeightMap)},redo:()=>{Ie(ft.newElementHeightMap,ft.newPartialWallHeightMap)}};he(ft)},Ae=Xe=>{Z(ut=>{ut.moveHandleType=Xe})},Te=Xe=>{const ut=new Xt(Xe.x,Xe.y),ft=w.current.clone();if(f){const ot=new Xt().subVectors(ut,ft),st=Math.max(1,ot.length()),at=Math.sqrt(Math.pow(st,2)/(Math.pow(d,2)+1)),Oe=at*d,Ze=new Xt(at*Math.sign(ot.x),Oe*Math.sign(ot.y)).normalize().multiplyScalar(st/2).add(ft);N(new ie(Ze.x,Ze.y)),He(at,Oe),Z(St=>{const Pt=new Map;for(const Rt of St.elements)if(md(Rt)&&(t.has(Rt.id)||e.has(Rt.id))){const Ut=x.current.get(Rt.id),Ht=S.current.get(Rt.id);if(Ut&&Ht){const At=Ht[0]*at,kt=Ht[1]*Oe;if(Rt.lx=At,Rt.ly=kt,Rt.parentId!==Zo){const gt=Pt.get(Rt.parentId);if(gt){const{pos:dt,rot:Ct}=gt,tt=new ie(Ut[0]*at+Ze.x,Ut[1]*Oe+Ze.y),Fe=tt.clone().sub(dt).applyEuler(new nn(0,0,-Ct));Rt.cx=Fe.x,Rt.cy=Fe.y,Pt.set(Rt.id,{pos:tt.clone(),rot:Rt.rotation[2]+Ct})}}else{const gt=Ut[0]*at+Ze.x,dt=Ut[1]*Oe+Ze.y;Rt.cx=gt,Rt.cy=dt,Pt.set(Rt.id,{pos:new ie(gt,dt),rot:Rt.rotation[2]})}for(const gt of St.elements)if(gt.foundationId===Rt.id)switch(gt.type){case z.Wall:{const dt=gt,Ct=C.current.get(dt.id);if(!Ct)continue;const[tt,Fe]=Ct,qe=[tt.x*At,tt.y*kt,Rt.lz],je=[Fe.x*At,Fe.y*kt,Rt.lz];dt.cx=(qe[0]+je[0])/2,dt.cy=(qe[1]+je[1])/2,dt.lx=Math.hypot(qe[0]-je[0]+(qe[1]-je[1])),dt.relativeAngle=Math.atan2(je[1]-qe[1],je[0]-qe[0]),dt.leftPoint=[...qe],dt.rightPoint=[...je];break}case z.SolarPanel:{const dt=gt,Ct=v.current.get(dt.id);if(!Ct)continue;const tt=dt.parentType,[Fe,qe,je]=dt.normal;tt===z.Foundation||tt===z.Roof||tt===z.Cuboid&&me.isEqual(je,1)?(dt.cx=Ct[0]*At,dt.cy=Ct[1]*kt):tt===z.Cuboid&&(me.isEqual(Fe,0)&&me.isEqual(qe,1)?(dt.cx=Ct[0]*At,dt.cy=kt/2):me.isEqual(Fe,0)&&me.isEqual(qe,-1)?(dt.cx=Ct[0]*At,dt.cy=-kt/2):me.isEqual(Fe,-1)&&me.isEqual(qe,0)?(dt.cx=-At/2,dt.cy=Ct[1]*kt):me.isEqual(Fe,1)&&me.isEqual(qe,0)&&(dt.cx=At/2,dt.cy=Ct[1]*kt));break}case z.Window:{const dt=gt;if(dt.parentType!==z.Roof)continue;const Ct=v.current.get(dt.id);if(!Ct)continue;dt.cx=Ct[0]*At,dt.cy=Ct[1]*kt;break}}}}})}else{const ot=ft.distanceTo(ut),st=Math.atan2(ut.x-ft.x,ut.y-ft.y)+F,at=Math.abs(ot*Math.sin(st)),Oe=Math.abs(ot*Math.cos(st)),Ze=new Xt().addVectors(ut,ft).multiplyScalar(.5);N(new ie(Ze.x,Ze.y)),He(at,Oe),Z(St=>{for(const Pt of St.elements)if(t.has(Pt.id))Pt.lx=at,Pt.ly=Oe,Pt.cx=Ze.x,Pt.cy=Ze.y;else if(Pt.foundationId&&t.has(Pt.foundationId))switch(Pt.type){case z.Wall:{const Rt=Pt,Ut=C.current.get(Rt.id);if(!Ut)continue;const[Ht,At]=Ut,kt=[Ht.x*at,Ht.y*Oe,0],gt=[At.x*at,At.y*Oe,0];Rt.cx=(kt[0]+gt[0])/2,Rt.cy=(kt[1]+gt[1])/2,Rt.lx=Math.hypot(kt[0]-gt[0],kt[1]-gt[1]),Rt.relativeAngle=Math.atan2(gt[1]-kt[1],gt[0]-kt[0]),Rt.leftPoint=[...kt],Rt.rightPoint=[...gt];break}case z.SolarPanel:{const Rt=Pt,Ut=v.current.get(Rt.id);if(!Ut)continue;const Ht=Rt.parentType,[At,kt,gt]=Rt.normal;Ht===z.Foundation||Ht===z.Roof||Ht===z.Cuboid&&me.isEqual(gt,1)?(Rt.cx=Ut[0]*at,Rt.cy=Ut[1]*Oe):Ht===z.Cuboid&&(me.isEqual(At,0)&&me.isEqual(kt,1)?(Rt.cx=Ut[0]*at,Rt.cy=Oe/2):me.isEqual(At,0)&&me.isEqual(kt,-1)?(Rt.cx=Ut[0]*at,Rt.cy=-Oe/2):me.isEqual(At,-1)&&me.isEqual(kt,0)?(Rt.cx=-at/2,Rt.cy=Ut[1]*Oe):me.isEqual(At,1)&&me.isEqual(kt,0)&&(Rt.cx=at/2,Rt.cy=Ut[1]*Oe));break}case z.Window:{const Rt=Pt;if(Rt.parentType!==z.Roof)continue;const Ut=v.current.get(Rt.id);if(!Ut)continue;Rt.cx=Ut[0]*at,Rt.cy=Ut[1]*Oe}}})}H.getState().updateElementOnRoofFn()},Me=Xe=>{if(Xe.z<.1)return;const ut=Xe.z;Q(ut),Z(ft=>{for(const ot of ft.elements)if(b.current.has(ot.id)){if(ot.type===z.Wall){ot.lz=ut*b.current.get(ot.id);const st=ot;if(st.fill===El.Partial){const at=P.current.get(st.id);at&&(st.leftTopPartialHeight=ut*at.upperLeft,st.rightTopPartialHeight=ut*at.upperRight,st.leftUnfilledHeight=ut*at.lowerLeft,st.rightUnfilledHeight=ut*at.lowerRight)}}else if(ot.type===z.Roof)ot.rise=ut*b.current.get(ot.id);else if(ot.type===z.Cuboid){const st=b.current.get(ot.id);if(st){const at=st*ut;ot.lz=at,ot.cz=at/2}}else if(ot.type===z.SolarPanel&&ot.parentType===z.Cuboid&&b.current.has(ot.parentId)){const st=b.current.get(ot.parentId);if(st){const at=st*ut;if(me.isEqual(ot.normal[2],1))ot.cz=at/2;else{const Oe=b.current.get(ot.id);Oe&&(ot.cz=Oe*at)}}}}ft.updateElementOnRoofFlag=!0})},Pe=Xe=>{const ut=new ie(k.x,k.y),ft=Math.atan2(ut.x-Xe.x,Xe.y-ut.y)+(te==="Rotate Upper"?0:Math.PI),ot=Math.abs(ft)>Math.PI?-la:0,st=ft+ot,at=new nn(0,0,st),Oe=A.current.size;Z(Ze=>{for(const St of Ze.elements){if(md(St)&&t.has(St.id)&&!e.has(St.id)){const Pt=T.current.get(St.id),Rt=Oe!==1?A.current.get(St.id):0;if(Pt&&Rt!==void 0){const Ut=Pt.clone().applyEuler(at);St.cx=ut.x+Ut.x,St.cy=ut.y+Ut.y,St.rotation=[0,0,Rt+st]}}if(St.type!==z.Cuboid&&t.has(St.parentId)){const Pt=Oe!==1?A.current.get(St.parentId):0;Pt!==void 0&&(St.rotation=[0,0,Pt+st])}}}),U(st)},Ee=(Xe,ut)=>{const ft=new Xt(k.x,k.y);w.current.set(Xe,ut).rotateAround(Sjo,F).add(ft),re("Resize XY"),x.current.clear(),S.current.clear(),C.current.clear(),D.current.clear(),E.current.clear(),v.current.clear(),L.current.clear();const[ot,st]=[O*2,_*2];for(const at of H.getState().elements)if(md(at)&&(t.has(at.id)||e.has(at.id))){const{pos:Oe}=me.getWorldDataById(at.id);x.current.set(at.id,[(Oe.x-k.x)/ot,(Oe.y-k.y)/st]),S.current.set(at.id,[at.lx/ot,at.ly/st]),D.current.set(at.id,[at.cx,at.cy,at.lx,at.ly])}else if(at.foundationId&&(t.has(at.foundationId)||e.has(at.foundationId))){const Oe=ge(at.foundationId);if(!Oe)continue;switch(at.type){case z.Wall:{const Ze=at,St=new Xt(Ze.leftPoint[0]/Oe.lx,Ze.leftPoint[1]/Oe.ly),Pt=new Xt(Ze.rightPoint[0]/Oe.lx,Ze.rightPoint[1]/Oe.ly);C.current.set(Ze.id,[St,Pt]),E.current.set(Ze.id,[...Ze.leftPoint,...Ze.rightPoint]);break}case z.SolarPanel:case z.Window:{const Ze=at;v.current.set(Ze.id,[Ze.cx/Oe.lx,Ze.cy/Oe.ly]),L.current.set(Ze.id,[Ze.cx,Ze.cy]);break}}}},Be=(Xe,ut,ft)=>{const{x:ot,y:st}=de();g.current.set(Xe,ut,ft),y.current.set(-Gt,0,-Math.atan2(ot,st)-F,"ZXY"),re("Resize Z"),b.current.clear(),W.current.clear(),P.current.clear(),j.current.clear();for(const at of H.getState().elements)if(at.foundationId&&(t.has(at.foundationId)||e.has(at.parentId))){if(at.type===z.Wall){b.current.set(at.id,at.lz/$),W.current.set(at.id,at.lz);const Oe=at;Oe.fill===El.Partial&&(j.current.set(Oe.id,{upperLeft:Oe.leftTopPartialHeight,upperRight:Oe.rightTopPartialHeight,lowerLeft:Oe.leftUnfilledHeight,lowerRight:Oe.rightUnfilledHeight}),P.current.set(Oe.id,{upperLeft:Oe.leftTopPartialHeight/$,upperRight:Oe.rightTopPartialHeight/$,lowerLeft:Oe.leftUnfilledHeight/$,lowerRight:Oe.rightUnfilledHeight/$}))}else if(at.type===z.Roof)b.current.set(at.id,at.rise/$),W.current.set(at.id,at.rise);else if(at.type===z.SolarPanel&&at.parentType===z.Cuboid){const Oe=H.getState().elements.find(Ze=>Ze.id===at.parentId);Oe&&(b.current.set(at.id,at.cz/Oe.lz),W.current.set(at.id,at.cz))}}else(t.has(at.id)||e.has(at.id))&&(b.current.set(at.id,at.lz/$),W.current.set(at.id,at.lz))},Je=Xe=>{switch(Se(Xe),Xe.object.name){case vt.UpperLeft:{Ee(O,-_);break}case vt.UpperRight:{Ee(-O,-_);break}case vt.LowerLeft:{Ee(O,_);break}case vt.LowerRight:{Ee(-O,_);break}case vt.UpperLeftTop:{Be(-O,_,$);break}case vt.UpperRightTop:{Be(O,_,$);break}case vt.LowerLeftTop:{Be(-O,-_,$);break}case vt.LowerRightTop:{Be(O,-_,$);break}}},We=Xe=>{if(Se(Xe),re("Move"),Xe.intersections.length>0){const ut=Xe.intersections[0].point.clone().setZ(0);R.current.subVectors(k,ut);for(const ft of H.getState().elements)if(md(ft)&&t.has(ft.id)){const ot=new ie(ft.cx,ft.cy),st=new ie().subVectors(ot,ut);T.current.set(ft.id,st),D.current.set(ft.id,[ft.cx,ft.cy,ft.cz,ft.rotation[2]])}}},Ke=Xe=>{if(Se(Xe),Xe.object.name===Kr.Lower?re("Rotate Lower"):Xe.object.name===Kr.Upper&&re("Rotate Upper"),Xe.intersections.length>0){const ut=new ie(k.x,k.y);for(const ft of H.getState().elements){if(md(ft)&&t.has(ft.id)){const ot=new ie(ft.cx,ft.cy),st=new ie().subVectors(ot,ut);T.current.set(ft.id,st),A.current.set(ft.id,ft.rotation[2]),D.current.set(ft.id,[ft.cx,ft.cy,ft.cz,ft.rotation[2]])}t.has(ft.parentId)&&D.current.set(ft.id,[ft.cx,ft.cy,ft.cz,ft.rotation[2]])}}},Ne=()=>{switch(te){case"Move":case"Rotate Lower":case"Rotate Upper":ce();break;case"Resize XY":pe();break;case"Resize Z":ve();break}q(!1),Fn.getState().setEnableOrbitController(!0),M.current=!1,re("Null"),Ae(null),Z(Xe=>{Xe.groupActionUpdateFlag=!Xe.groupActionUpdateFlag,Xe.updateWallMapOnFoundationFlag=!Xe.updateWallMapOnFoundationFlag,Xe.updateElementOnRoofFlag=!0})},De=Xe=>{if(!p.current||!M.current)return;xe(Xe);const ut=se.intersectObjects([p.current]);if(ut.length>0){const ft=ut[0].point;switch(te){case"Resize XY":Te(ft);break;case"Resize Z":Me(ft);break;case"Rotate Lower":case"Rotate Upper":Pe(ft);break;case"Move":N(new ie().addVectors(ft.clone().setZ(0),R.current)),Z(ot=>{for(const st of ot.elements)if(md(st)&&t.has(st.id)&&!e.has(st.id)){const at=T.current.get(st.id);at&&(st.cx=ft.x+at.x,st.cy=ft.y+at.y)}});break}}},ke=a5(),Ye=ke/2,it=$+Ye-ke/2,Ve=O+ke,yt=_+ke,ct=_+ke*4;return h.jsxs("group",{name:"Group Master",position:k,rotation:[0,0,F],children:[h.jsxs("group",{name:"Resize Handle Group",onPointerDown:Je,children:[h.jsx(k4,{args:[O,_,Ye,ke],handleType:vt.UpperRight}),h.jsx(k4,{args:[-O,_,Ye,ke],handleType:vt.UpperLeft}),h.jsx(k4,{args:[O,-_,Ye,ke],handleType:vt.LowerRight}),h.jsx(k4,{args:[-O,-_,Ye,ke],handleType:vt.LowerLeft}),!fe&&h.jsxs(h.Fragment,{children:[h.jsx(k4,{args:[O,_,it,ke],handleType:vt.UpperRightTop}),h.jsx(k4,{args:[-O,_,it,ke],handleType:vt.UpperLeftTop}),h.jsx(k4,{args:[O,-_,it,ke],handleType:vt.LowerRightTop}),h.jsx(k4,{args:[-O,-_,it,ke],handleType:vt.LowerLeftTop})]})]}),h.jsxs("group",{name:"Move Handle Group",onPointerDown:We,children:[h.jsx(f_,{args:[0,yt,Ye,ke],handleType:Ho.Upper}),h.jsx(f_,{args:[0,-yt,Ye,ke],handleType:Ho.Lower}),h.jsx(f_,{args:[Ve,0,Ye,ke],handleType:Ho.Right}),h.jsx(f_,{args:[-Ve,0,Ye,ke],handleType:Ho.Left})]}),h.jsxs("group",{name:"Rotate Handle Group",onPointerDown:Ke,children:[h.jsx(LFe,{args:[0,ct,Ye,ke],handleType:Kr.Upper}),h.jsx(LFe,{args:[0,-ct,Ye,ke],handleType:Kr.Lower})]}),le&&h.jsx(ua,{name:"Intersection Plane",ref:p,args:[Math.max(O*2.4,1e3),Math.max(O*2.4,1e3)],visible:!1,position:g.current,rotation:y.current,onPointerMove:De,onPointerUp:Ne}),h.jsx("group",{name:"Wireframe Group",position:[0,0,$/2],children:h.jsx(fw,{hx:O,hy:_,hz:$/2,lineColor:"white"})})]})}),Pjo=t=>t.parentId===Zo&&(t.type===z.Foundation||t.type===z.Cuboid),Cjo=be.memo(()=>{H(axt);const t=H(Dwt),e=d();if(e.length===0)return null;const{allBaseElements:n,allBaseElementsVerticesMap:o,cuboidParentIdMap:r}=f(),i=new Set(e.map(w=>w.id)),a=[...e];for(const w of e)w.enableGroupMaster&&p(w);const{position:l,dimension:s,rotation:c,childCuboidIdSet:u}=g();function d(){const w=new Set;for(const b of H.getState().elements)t.has(b.id)&&(b.parentId===Zo&&md(b)?w.add(b.id):b.foundationId&&w.add(b.foundationId));return w.size===0?[]:H.getState().elements.filter(b=>w.has(b.id))}function f(){const w=[],b=new Map,C=new Map;for(const P of H.getState().elements){if(Pjo(P)){const v=me.fetchFoundationVertexCoordinates(P);w.push(P),b.set(P.id,v)}P.type===z.Cuboid&&P.parentId!==Zo&&C.set(P.id,P.parentId)}return{allBaseElements:w,allBaseElementsVerticesMap:b,cuboidParentIdMap:C}}function p(w){for(const b of n)!i.has(b.id)&&me.areBasesOverlapped(w.id,b.id,o)&&(i.add(b.id),a.push(b),b.enableGroupMaster&&p(b))}function g(){const w=a.map(R=>me.fetchFoundationVertexCoordinates(R)).flat(),b=new Set,C=me.calculatePolygonBounds(w);let P=1,v=1;const T=new Map;for(const R of H.getState().elements)if(R.foundationId&&i.has(R.foundationId))if(R.type===z.Wall){const M=R;P=Math.max(P,M.lz),M.roofId&&(T.get(M.roofId)??0)H(vOe)?h.jsx(Cjo,{}):null),Hjo=be.memo(({showGallery:t,defaultSize:e=50,minWidth:n=25,maxWidth:o=75,children:r,wait:i=50,onChange:a})=>{const[l,s]=r,c=m.useRef(!1),u=p=>{const g=document.querySelector(".split-pane");g&&g.style.setProperty("--percentWidth",p+"%")},d=()=>{c.current=!0},f=m.useCallback(L2.throttle(p=>{if(!c.current)return;const g=Math.max(n,Math.min(o,p.clientX/window.innerWidth*100));u(g),a&&a(g)},i),[]);return m.useEffect(()=>{u(e)},[e]),m.useEffect(()=>{const p=()=>{c.current=!1};return window.addEventListener("pointerup",p),()=>window.removeEventListener("pointerup",p)},[]),m.useEffect(()=>{u(t?e:0)},[t,e]),h.jsxs("div",{className:"split-pane",onPointerMove:f,children:[h.jsx("div",{className:"left-child",children:l}),t&&h.jsx("div",{className:"sash",onPointerDown:d}),h.jsx("div",{className:"right-child",children:s})]})},(t,e)=>t.showGallery===e.showGallery&&t.onChange===e.onChange),Nle=72,WFe=be.memo(({viewOnly:t=!1})=>{const e=H(mp),n=ht(_8t),o=H(da),r=H(fn),i=ht(VBe),a=H(Id)??!1,l=H(Uq)??GF,s=H(Pb),c=H(SW),u=H(Age),d=H(wBe),f=H(hA),p=H(C4t)??"roadmap",g=ht(Yq),y=H(DH),w=H(wA),[b,C]=m.useState(!0),[P,v]=m.useState(50),[T,A]=m.useState(!1),x=m.useRef(null),S=Jt();m.useEffect(()=>{C(!1)},[]),m.useEffect(()=>{n&&A(TC.localeCompare(n)<0)},[n]),m.useEffect(()=>{r(j=>{var L;j.loggable=e&&e.uid?!((L=e.email)!=null&&L.endsWith("@intofuture.org")):!1,e&&(e.noLogging||!e.schoolID||e.schoolID==="UNKNOWN SCHOOL"||!e.classID||e.classID==="UNKNOWN CLASS")&&(j.loggable=!1)})},[e]),console.log("x");const R=e.uid&&new URLSearchParams(window.location.search).get("userid")===e.uid,M=j=>{Fn.setState(L=>{if(!x.current)return L;const k=L.pointer;return k.x=j.clientX/x.current.clientWidth*2-1,k.y=-((j.clientY-Nle)/x.current.clientHeight)*2+1,{pointer:k}})},D=j=>{M(j)},E=()=>h.jsxs(f6t,{ref:x,shadows:!0,gl:{preserveDrawingBuffer:!0,logarithmicDepthBuffer:!0},frameloop:"demand",style:{height:"100%",width:"100%",backgroundColor:"black"},camera:{fov:nje,far:l,up:[0,0,1]},onPointerMove:D,children:[h.jsx(MAo,{}),h.jsx(O3o,{}),h.jsx(F3o,{}),h.jsx(gnn,{}),h.jsx(L3o,{}),h.jsxs(m.Suspense,{fallback:null,children:[h.jsx(hnn,{}),h.jsx(Rjo,{})]}),h.jsxs(m.Suspense,{fallback:null,children:[u&&h.jsx(qen,{}),h.jsx(Ken,{theme:d}),h.jsx(wnn,{}),f&&h.jsx(tGn,{})]}),h.jsx(Y3o,{}),h.jsx(cjo,{}),y===Vs.GENETIC_ALGORITHM&&w.geneticAlgorithmParams.problem===Pi.SOLAR_PANEL_TILT_ANGLE&&h.jsx(bAo,{}),y===Vs.GENETIC_ALGORITHM&&w.geneticAlgorithmParams.problem===Pi.SOLAR_PANEL_ARRAY&&h.jsx(TAo,{}),y===Vs.PARTICLE_SWARM_OPTIMIZATION&&w.particleSwarmOptimizationParams.problem===Pi.SOLAR_PANEL_TILT_ANGLE&&h.jsx(CAo,{}),y===Vs.PARTICLE_SWARM_OPTIMIZATION&&w.particleSwarmOptimizationParams.problem===Pi.SOLAR_PANEL_ARRAY&&h.jsx(HAo,{})]}),W=m.useMemo(()=>new Xt,[]);return h.jsxs("div",{className:"App",style:{position:"relative",overflow:"hidden"},onContextMenu:j=>j.preventDefault(),children:[h.jsx(unn,{initializing:b}),h.jsxs("div",{style:{backgroundColor:"lightblue",height:Nle+"px",paddingTop:"10px",textAlign:"start",userSelect:"none",fontSize:"30px"},children:[h.jsx(QGe,{offset:["10px","0px"],count:T?h.jsx(Cnn,{style:{color:"red",cursor:"pointer"},title:Y.t("message.NewVersionAvailable",S)}):void 0,children:h.jsx(en,{style:{marginLeft:"120px",verticalAlign:"middle",cursor:"pointer",userSelect:"none",fontSize:"30px"},title:Y.t("tooltip.visitAladdinHomePage",S),onClick:CQt,children:`${Y.t("name.Aladdin",S)}`})}),s&&!g&&h.jsxs("span",{style:{marginLeft:"20px",fontSize:"14px",verticalAlign:"center",userSelect:"text",color:R?"black":"gray"},children:[h.jsx("img",{title:Y.t("toolbar.CloudFile",S),alt:"Cloud",src:B3o,height:32,width:32,style:{paddingRight:"8px"}}),s+(R&&i?" *":""),!t&&R&&i&&h.jsx(lo,{type:"primary",size:"small",style:{marginLeft:"10px"},title:Y.t("menu.file.SaveCloudFile",S),onClick:()=>{ht.getState().setSaveCloudFileFlag(!0),o&&r(j=>{j.actionInfo={name:"Save Cloud File",timestamp:new Date().getTime()}})},children:`${Y.t("word.Save",S)}`})]})]}),t?h.jsxs("div",{style:{position:"absolute",bottom:"6px",left:"6px",zIndex:999,fontSize:"8px",userSelect:"none",color:f||c?p!=="roadmap"?"antiquewhite":"darkslategrey":"antiquewhite"},children:[h.jsx("img",{alt:"IFI Logo",src:qTe,height:"30px",style:{verticalAlign:"bottom",cursor:"pointer"},title:Y.t("tooltip.gotoIFI",S),onClick:TSe})," V "+TC]}):h.jsxs(h.Fragment,{children:[h.jsx("img",{alt:"IFI Logo",src:qTe,height:c?"24px":"40px",style:{position:"absolute",cursor:"pointer",bottom:"6px",left:"6px",zIndex:999,userSelect:"none"},title:Y.t("tooltip.gotoIFI",S),onClick:TSe}),h.jsxs("div",{style:{position:"absolute",bottom:"4px",left:c?"24px":"44px",zIndex:999,fontSize:"10px",userSelect:"none",color:f?p!=="roadmap"?"antiquewhite":"darkslategrey":c?"darkslategrey":"antiquewhite"},children:["   ©",new Date().getFullYear()," ",`${Y.t("name.IFI",S)}`," ",Y.t("word.VersionInitial",S)+TC+". "+Y.t("word.AllRightsReserved",S)+". "]})]}),!t&&h.jsx(xAo,{size:16,round:!0,margin:"2px",style:{position:"absolute",right:"0",top:"80px"}}),h.jsx(YVn,{viewOnly:t,canvas:x.current}),h.jsx(pyo,{viewOnly:t,canvas:x.current}),h.jsx(qUo,{}),h.jsx(R1o,{children:h.jsxs("div",{style:{height:`calc(100vh - ${Nle}px)`},children:[h.jsxs(Hjo,{showGallery:c,defaultSize:c?50:0,onChange:j=>{v(Math.round(100-j));const L=Fn.getState().canvas;if(L){const{gl:k,camera:N}=L,F=(100-j)*window.innerWidth/100;k.getSize(W),k.setSize(F,W.y),N instanceof zu&&(N.aspect=F/W.y,N.updateProjectionMatrix(),np())}},children:[c?h.jsx(bjo,{canvas:x.current,relativeWidth:1-P*.01}):h.jsx(h.Fragment,{}),E()]}),h.jsx(j3o,{canvas:x.current})]})}),h.jsx(W3o,{visible:!a}),!t&&h.jsx($Vn,{}),!t&&o&&h.jsx(E3o,{})]})}),Mjo=be.memo(({viewOnly:t=!1})=>{const e=H(fn),n=H($Be),o=H(Ige),r=H(QBe),i=ht(qBe),a=ht(wwt),l=ht(vwt),s=H(Pb),c=ht(Awt),u=H(mp),d=H(s0),[f,p]=m.useState(!1),[g,y]=m.useState(!1),[w,b]=m.useState({left:0,top:0,bottom:0,right:0}),C=m.useRef(null),{t:P}=Vl(),v=m.useMemo(()=>({lng:d}),[d]);m.useEffect(()=>{a&&(T(),ht.getState().setCreateNewFileFlag(!1))},[a]),m.useEffect(()=>{l&&(A(),ht.getState().setOpenLocalFileFlag(!1))},[l]);const T=()=>{Oi.confirm({title:`${P("message.DoYouWantToSaveChanges",v)}`,icon:h.jsx(ny,{}),okText:`${P("word.Yes",v)}`,cancelText:`${P("word.No",v)}`,onOk:()=>{u.uid?s?(e(W=>{W.localContentToImportAfterCloudFileUpdate="CREATE_NEW_FILE"}),ht.getState().setSaveCloudFileFlag(!0)):e(W=>{W.showCloudFileTitleDialogFlag=!W.showCloudFileTitleDialogFlag,W.showCloudFileTitleDialog=!0}):hn(P("menu.file.ToSaveYourWorkPleaseSignIn",v))},onCancel:()=>{r()}})},A=()=>{!t&&ht.getState().changed?Oi.confirm({title:P("message.DoYouWantToSaveChanges",v),icon:h.jsx(ny,{}),onOk:()=>{u.uid?s?x(!0):e(W=>{W.showCloudFileTitleDialogFlag=!W.showCloudFileTitleDialogFlag,W.showCloudFileTitleDialog=!0}):hn(P("menu.file.ToSaveYourWorkPleaseSignIn",v))},onCancel:()=>x(!1),okText:P("word.Yes",v),cancelText:P("word.No",v)}):x(!1)},x=W=>{document.body.onfocus=()=>{e(L=>{L.localFileDialogRequested=!1})};const j=document.getElementById("file-dialog");j.onchange=()=>{if(j.files&&j.files.length>0){ht.getState().set(N=>{N.waiting=!0});const L=new FileReader;L.readAsText(j.files[0]);const k=j.files[0].name;ht.getState().set(N=>{N.localFileName=k}),L.onload=()=>{if(L.result){const N=JSON.parse(L.result.toString());W?s&&(e(F=>{F.localContentToImportAfterCloudFileUpdate=N}),ht.getState().setSaveCloudFileFlag(!0)):o(N)}j.value=""}}},j.click()},S=()=>{let W=c.trim();if(W.length>0){W.endsWith(".ala")||(W+=".ala");const j=new Blob([JSON.stringify(n())],{type:"application/json"});return r$e.saveAs(j,W),ht.getState().set(L=>{L.localFileName=W}),e(L=>{L.cloudFile=void 0}),!0}else return po(P("menu.file.SavingAbortedMustHaveValidFileName",v)+"."),!1},R=(W,j)=>{if(C.current){const{clientWidth:L,clientHeight:k}=window.document.documentElement,N=C.current.getBoundingClientRect();b({left:-N.left+j.x,right:L-(N.right-j.x),top:-N.top+j.y,bottom:k-((N==null?void 0:N.bottom)-j.y)})}},M=()=>{p(!0),S()&&ht.getState().set(W=>{W.saveLocalFileDialogVisible=!1}),p(!1)},D=()=>{ht.getState().set(W=>{W.saveLocalFileDialogVisible=!1})},E=()=>{s&&ht.getState().set(W=>{W.localFileName=s,W.localFileName.endsWith(".ala")||(W.localFileName+=".ala")})};return h.jsx(h.Fragment,{children:h.jsx(Oi,{title:h.jsx("div",{style:{width:"100%",cursor:"move"},onMouseOver:()=>y(!0),onMouseOut:()=>y(!1),children:P("menu.file.SaveAsLocalFile",v)}),footer:s?[h.jsx(lo,{onClick:E,children:P("menu.file.UseCloudFileName",v)},"Apply"),h.jsx(lo,{onClick:D,children:P("word.Cancel",v)},"Cancel"),h.jsx(lo,{type:"primary",onClick:M,disabled:!c,children:P("word.OK",v)},"OK")]:[h.jsx(lo,{onClick:D,children:P("word.Cancel",v)},"Cancel"),h.jsx(lo,{type:"primary",onClick:M,disabled:!c,children:P("word.OK",v)},"OK")],open:i,confirmLoading:f,onCancel:D,modalRender:W=>h.jsx(_i,{disabled:!g,bounds:w,onStart:(j,L)=>R(j,L),children:h.jsx("div",{ref:C,children:W})}),children:h.jsx(as,{placeholder:"File name",value:c,onPressEnter:M,onChange:W=>{ht.getState().set(j=>{j.localFileName=W.target.value})}})})})}),Ijo=()=>{const t=H(K8t),e=H(w=>w.world),n=H(w=>w.elements),o=H(w=>w.viewState),r=H(w=>w.notes),i=ht(Ss),a=ht(h3),l=ht(V8t),s=ht(G8t),c=H(L7t),u=H(W7t),d=H(U7t),f=H(J8t),p=new URLSearchParams(window.location.search),g=p.get("viewonly")==="true",y=p.get("map")==="true";return m.useEffect(()=>{c(),u(),d(),f(),ht.getState().set(w=>{w.openModelsMap=y,y&&(w.modelsMapFlag=!0,w.modelsMapWeatherStations=!1,w.leaderboardFlag=!0,w.showLeaderboard=!0)})},[]),m.useEffect(()=>{ht.getState().skipChange?s(!1):ht.getState().changed||l(!0)},[e,o,n,r]),m.useEffect(()=>{i&&ht.getState().set(w=>{w.showSolarRadiationHeatmap=!1}),a&&ht.getState().set(w=>{w.showHeatFluxes=!1})},[n]),h.jsx(fy,{locale:t,children:h.jsxs(Nen,{children:[g?h.jsx(WFe,{viewOnly:!0}):h.jsx(zjo,{children:h.jsx(WFe,{viewOnly:!1})}),h.jsx(Mjo,{viewOnly:g})]})})},zjo=be.memo(({children:t})=>(["iir3sv1kW1Vzbj9sOA46RfLWKCU2"].find(n=>n===H.getState().user.uid),h.jsx(jen,{onBeforeunload:()=>"",children:t}))),Djo=ZLe(document.getElementById("root"));Djo.render(h.jsx(Ijo,{}))});export default Ejo(); diff --git a/index.html b/index.html index 7ae6015a..7d71fc0b 100644 --- a/index.html +++ b/index.html @@ -61,7 +61,7 @@ } Aladdin - +